EICrecon
JANA based reconstruction for the EPIC detector
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
JEventSourcePODIO Class Reference

#include <JEventSourcePODIO.h>

Inheritance diagram for JEventSourcePODIO:
Inheritance graph
[legend]
Collaboration diagram for JEventSourcePODIO:
Collaboration graph
[legend]

Public Member Functions

 JEventSourcePODIO (std::string resource_name, JApplication *app)
 
virtual ~JEventSourcePODIO ()
 
void Open () override
 Open the root file and read in metadata.
 
void Close () override
 
Result Emit (JEvent &event) override
 
void PrintCollectionTypeTable (void)
 
std::vector< std::string_view > getAvailableCategories () const
 
std::size_t getEntries (const std::string &category) const
 
podio::Frame getFrame (const std::string &category, std::size_t index) const
 

Static Public Member Functions

static std::string GetDescription ()
 

Protected Attributes

std::unique_ptr< podio::Reader > m_reader
 
std::size_t Nevents_in_file = 0
 
std::size_t Nevents_read = 0
 
bool m_run_forever = false
 
bool m_use_event_headers = true
 
std::shared_ptr< spdlog::logger > m_log
 

Constructor & Destructor Documentation

◆ JEventSourcePODIO()

JEventSourcePODIO::JEventSourcePODIO ( std::string  resource_name,
JApplication app 
)
Parameters
resource_nameName of root file to open (n.b. file is not opened until Open() is called)
appJApplication

◆ ~JEventSourcePODIO()

JEventSourcePODIO::~JEventSourcePODIO ( )
virtual

Member Function Documentation

◆ Close()

void JEventSourcePODIO::Close ( )
override

Cleanly close the resource when JANA is terminated via Ctrl-C or jana:nevents

Parameters
event

◆ Emit()

JEventSourcePODIO::Result JEventSourcePODIO::Emit ( JEvent &  event)
override

Read next event from file and copy its objects into the given JEvent.

Parameters
event

Calls to GetEvent are synchronized with each other, which means they can read and write state on the JEventSource without causing race conditions.

◆ getAvailableCategories()

std::vector< std::string_view > JEventSourcePODIO::getAvailableCategories ( ) const

◆ GetDescription()

std::string JEventSourcePODIO::GetDescription ( )
static

GetDescription() helps JANA explain to the user what is going on

◆ getEntries()

std::size_t JEventSourcePODIO::getEntries ( const std::string &  category) const

◆ getFrame()

podio::Frame JEventSourcePODIO::getFrame ( const std::string &  category,
std::size_t  index 
) const

◆ Open()

void JEventSourcePODIO::Open ( )
override

Open the root file and read in metadata.

◆ PrintCollectionTypeTable()

void JEventSourcePODIO::PrintCollectionTypeTable ( void  )

Print the list of collection names from the currently open file along with their types. This will be called automatically when the file is open if the PODIO:PRINT_TYPE_TABLE variable is set to a non-zero value

Member Data Documentation

◆ m_log

std::shared_ptr<spdlog::logger> JEventSourcePODIO::m_log
protected

◆ m_reader

std::unique_ptr<podio::Reader> JEventSourcePODIO::m_reader
protected

◆ m_run_forever

bool JEventSourcePODIO::m_run_forever = false
protected

◆ m_use_event_headers

bool JEventSourcePODIO::m_use_event_headers = true
protected

◆ Nevents_in_file

std::size_t JEventSourcePODIO::Nevents_in_file = 0
protected

◆ Nevents_read

std::size_t JEventSourcePODIO::Nevents_read = 0
protected

The documentation for this class was generated from the following files: