JANA2
C++ framework for multi-threaded data processing
|
Public Member Functions | |
JEvent (JApplication *app) | |
void | SetFactorySet (JFactorySet *aFactorySet) |
void | SetRunNumber (int32_t aRunNumber) |
void | SetEventNumber (uint64_t aEventNumber) |
void | SetJApplication (JApplication *app) |
void | SetJEventSource (JEventSource *aSource) |
void | SetDefaultTags (std::map< std::string, std::string > aDefaultTags) |
void | SetSequential (bool isSequential) |
JFactorySet * | GetFactorySet () const |
int32_t | GetRunNumber () const |
uint64_t | GetEventNumber () const |
JApplication * | GetJApplication () const |
JEventSource * | GetJEventSource () const |
JCallGraphRecorder * | GetJCallGraphRecorder () const |
JInspector * | GetJInspector () const |
void | Inspect () const |
bool | GetSequential () const |
bool | IsWarmedUp () |
JEventLevel | GetLevel () const |
void | SetLevel (JEventLevel level) |
void | SetEventIndex (int event_index) |
int64_t | GetEventIndex () const |
bool | HasParent (JEventLevel level) const |
const JEvent & | GetParent (JEventLevel level) const |
void | SetParent (JEvent *parent) |
JEvent * | ReleaseParent (JEventLevel level) |
void | Release () |
void | Clear () |
void | Finish () |
JFactory * | GetFactory (const std::string &object_name, const std::string &tag) const |
GetFactory() should be used with extreme care because it subverts the JEvent abstraction. More... | |
std::vector< JFactory * > | GetAllFactories () const |
GetAllFactories() should be used with extreme care because it subverts the JEvent abstraction. More... | |
template<class T > | |
JFactoryT< T > * | GetFactory (const std::string &tag="", bool throw_on_missing=false) const |
GetFactory() should be used with extreme care because it subverts the JEvent abstraction. More... | |
template<class T > | |
std::vector< JFactoryT< T > * > | GetFactoryAll (bool throw_on_missing=false) const |
GetFactoryAll returns all JFactoryT's for type T (each corresponds to a different tag). More... | |
template<class T > | |
JFactoryT< T > * | GetSingle (const T *&t, const char *tag="", bool exception_if_not_one=true) const |
C-style getters. More... | |
template<class T > | |
JFactoryT< T > * | Get (const T **item, const std::string &tag="") const |
Get conveniently returns one item from inside the JFactory. More... | |
template<class T > | |
JFactoryT< T > * | Get (std::vector< const T * > &vec, const std::string &tag="", bool strict=true) const |
template<class T > | |
void | GetAll (std::vector< const T * > &vec) const |
GetAll returns all JObjects of (child) type T, regardless of tag. | |
template<class T > | |
const T * | GetSingle (const std::string &tag="") const |
C++ style getters. More... | |
template<class T > | |
const T * | GetSingleStrict (const std::string &tag="") const |
GetSingleStrict conveniently returns one item from inside the JFactory. More... | |
template<class T > | |
std::vector< const T * > | Get (const std::string &tag="", bool strict=true) const |
template<class T > | |
JFactoryT< T >::PairType | GetIterators (const std::string &aTag="") const |
template<class T > | |
std::vector< const T * > | GetAll () const |
GetAll returns all JObjects of (child) type T, regardless of tag. | |
template<class T > | |
std::map< std::pair< std::string, std::string >, std::vector< T * > > | GetAllChildren () const |
template<class T > | |
JFactoryT< T > * | Insert (T *item, const std::string &aTag="") const |
Insert() allows an EventSource to insert items directly into the JEvent, removing the need for user-extended JEvents and/or JEventSource::GetObjects(...) Repeated calls to Insert() will append to the previous data rather than overwrite it, which saves the user from having to allocate a throwaway vector and requires less error handling. | |
template<class T > | |
JFactoryT< T > * | Insert (const std::vector< T * > &items, const std::string &tag="") const |
template<class S > | |
std::map< std::pair< std::string, std::string >, std::vector< S * > > | GetAllChildren () const |
JFactoryT< T > * JEvent::Get | ( | const T ** | destination, |
const std::string & | tag = "" |
||
) | const |
Get conveniently returns one item from inside the JFactory.
This should be used when the data in question is optional and the caller wants to examine the result and decide how to proceed. The caller should embed this inside an if-block. Get updates the destination
out parameter and returns a pointer to the enclosing JFactory.
destination
to point to nullptr.destination
to point to that item.destination
to point to the first time. Referenced by GetSingle().
std::vector< JFactory * > JEvent::GetAllFactories | ( | ) | const |
GetAllFactories() should be used with extreme care because it subverts the JEvent abstraction.
Most historical uses of GetFactory are far better served by JMultifactory
JFactory * JEvent::GetFactory | ( | const std::string & | object_name, |
const std::string & | tag | ||
) | const |
GetFactory() should be used with extreme care because it subverts the JEvent abstraction.
Most historical uses of GetFactory are far better served by JMultifactory
|
inline |
GetFactory() should be used with extreme care because it subverts the JEvent abstraction.
Most historical uses of GetFactory are far better served by JMultifactory.
|
inline |
GetFactoryAll returns all JFactoryT's for type T (each corresponds to a different tag).
This is useful when there are many different tags, or the tags are unknown, and the user wishes to examine them all together.
const T * JEvent::GetSingle | ( | const std::string & | tag = "" | ) | const |
C++ style getters.
GetSingle conveniently returns one item from inside the JFactory. This should be used when the data in question is optional and the caller wants to examine the result and decide how to proceed. The caller should embed this inside an if-block.
JFactoryT< T > * JEvent::GetSingle | ( | const T *& | t, |
const char * | tag = "" , |
||
bool | exception_if_not_one = true |
||
) | const |
C-style getters.
This is a convenience method that can be used to get a pointer to the single object of type T from the specified factory. It simply calls the Get(vector<...>) method and copies the first pointer into "t" (or NULL if something other than 1 object is returned).
This is intended to address the common situation in which there is an interest in the event if and only if there is exactly 1 object of type T. If the event has no objects of that type or more than 1 object of that type (for the specified factory) then an exception of type "unsigned long" is thrown with the value being the number of objects of type T. You can supress the exception by setting exception_if_not_one to false. In that case, you will have to check if t==NULL to know if the call succeeded.
References Get().
const T * JEvent::GetSingleStrict | ( | const std::string & | tag = "" | ) | const |
GetSingleStrict conveniently returns one item from inside the JFactory.
This should be used when the data in question is mandatory, and its absence indicates an error which should stop execution. The caller does not need to embed this in an if- or try-catch block; it can be a one-liner.