#include <EventBase.hpp>
Inheritance diagram for cafe::EventBase:

This class provides three generic services:
Definition at line 33 of file EventBase.hpp.
Public Member Functions | |
| EventBase () | |
| virtual | ~EventBase () |
| TTree * | getTree () const |
| Get current TTree. | |
| int | getCookie () const |
| Get current cookie (== tree number). | |
| ClassDef (EventBase, 0) | |
Access to branches in the tree. | |
| template<typename T> const T * | get (const std::string &branchName, const Variables &vars=cafe::detail::empty) const |
| Return a pointer to the object corresponding to branch 'branchName'. | |
| template<typename T> Collection< T > | getCollection (const std::string &branchName, const Variables &vars=cafe::detail::empty) const |
| Return a Collection<T> corresponding to the TClonesArray in 'branchName'. | |
| const TClonesArray * | getClonesArray (const std::string &branchName, const Variables &vars=cafe::detail::empty) const |
| Return the TClonesArray for the given branch. | |
| bool | readBranch (const std::string &branchName) |
| Read this branch if not already in memory. | |
| void | setBranchAddresses (TTree *tree) |
| Called when the tree changes. | |
| bool | setPartialRead (bool allow) |
| Allow/Disallow partial reading of objects. | |
| bool | getPartialRead () const |
| Get partial read flag. | |
Access to intermediate values stored in Event. | |
| template<typename T> void | put (const std::string &key, const T &value) |
| Store arbitrary value with key. | |
| void | clear (const std::string &key) |
| template<typename T> bool | get (const std::string &key, T &value) const |
| Retrieve arbitrary value with key. | |
| void | clear () |
| Clear any values kept in the event store. | |
| std::vector< std::string > * | varnames () |
| std::vector< std::string > * | vartypes () |
Tagging | |
| void | tag (const std::string &name) |
| Tag the event with 'name'. | |
| template<typename ITER> void | tag (ITER from, ITER to) |
| Tag the events with all tags in the list 'C' can be any STL container. | |
| bool | hasTag (const std::string &name) const |
| Check if event is tagged with 'name'. | |
| bool | hasTag (const char *name) const |
| Check if event is tagged with 'name'. | |
| template<typename C> bool | hasTag (const C &c) const |
| Check if event has any of the tags in the list 'C' can be any STL container. | |
| void | untag (const std::string &name) |
| Remove tag with 'name'. | |
| template<typename ITER> void | untag (ITER from, ITER to) |
| Remove all of the tags in the list 'C' can be any STL container. | |
| ostream & | printTags (ostream &os) const |
| Print all tags in the event. | |
Private Types | |
| typedef std::map< std::string, BaseHolder * > | Map |
| typedef std::map< std::string, BranchHolderBase * > | BranchMap |
Private Attributes | |
| Map | _map |
| TTree * | _tree |
| BranchMap | _branches |
| std::set< std::string > | _tags |
| int | _cookie |
| bool | _partial_read |
| UInt_t | _objectCount |
|
|
Definition at line 203 of file EventBase.hpp. |
|
|
Definition at line 187 of file EventBase.hpp. |
|
|
Definition at line 19 of file EventBase.cpp. |
|
|
Definition at line 27 of file EventBase.cpp. |
|
||||||||||||
|
Reimplemented in cafe::Event. |
|
|
Clear any values kept in the event store.
Definition at line 69 of file EventBase.cpp. References _map, _objectCount, _tags, cafe::Stat::eventEnd(), and STAT. |
|
|
Definition at line 94 of file EventBase.cpp. References _map. Referenced by cafe::EventMultiSplitter::processPermutation(), and cafe::RunController::processTree(). |
|
||||||||||||||||
|
Retrieve arbitrary value with key.
Definition at line 362 of file EventBase.hpp. References _map, and cafe::EventBase::Holder< T >::value(). |
|
||||||||||||||||
|
Return a pointer to the object corresponding to branch 'branchName'. If the branch does not exist, return 0. Definition at line 263 of file EventBase.hpp. References _branches, _cookie, _partial_read, _tree, cafe::EventBase::BranchHolder< T >::getObject(), and cafe::EventBase::BranchHolder< T >::setBranchAddress(). Referenced by cafe::Trigger::processEvent(), cafe::Stat::processEvent(), cafe::SelectObjects::processEvent(), cafe::RemoveObjects::processEvent(), cafe::Hist3D::processEvent(), cafe::Hist2D::processEvent(), and cafe::Hist1D::processEvent(). |
|
||||||||||||
|
Return the TClonesArray for the given branch.
Definition at line 158 of file EventBase.cpp. References _branches, _cookie, _partial_read, _tree, cafe::EventBase::BranchHolder< T >::getObject(), and cafe::EventBase::BranchHolder< T >::setBranchAddress(). Referenced by cafe::RemoveObjects::processEvent(), cafe::Hist1D::processEvent(), and cafe::AssociatedTracks::processEvent(). |
|
||||||||||||||||
|
Return a Collection<T> corresponding to the TClonesArray in 'branchName'. If the branch does not exist, return an empty Collection<T>. Definition at line 275 of file EventBase.hpp. References _branches, _cookie, _partial_read, _tree, cafe::EventBase::BranchHolder< T >::getObject(), and cafe::EventBase::BranchHolder< T >::setBranchAddress(). Referenced by cafe::RandomSelectUserObjects< T >::processEvent(), and cafe::AssociatedTracks::processEvent(). |
|
|
Get current cookie (== tree number).
Definition at line 153 of file EventBase.cpp. References _cookie. Referenced by cafe::SelectBranches::SelectBranches(). |
|
|
Get partial read flag.
Definition at line 64 of file EventBase.cpp. References _partial_read. |
|
|
Get current TTree.
Definition at line 148 of file EventBase.cpp. References _tree. Referenced by cafe::SelectObjects::processEvent(), cafe::RandomProcessor::processEvent(), cafe::EventList::processEvent(), and cafe::SelectBranches::SelectBranches(). |
|
||||||||||
|
Check if event has any of the tags in the list 'C' can be any STL container.
Definition at line 380 of file EventBase.hpp. References _tags. |
|
|
Check if event is tagged with 'name'.
Definition at line 130 of file EventBase.cpp. References _tags. |
|
|
Check if event is tagged with 'name'.
Definition at line 125 of file EventBase.cpp. References _tags. Referenced by cafe::EventList::processEvent(), and cafe::StatSample::tagged(). |
|
|
Print all tags in the event.
Definition at line 140 of file EventBase.cpp. References _tags. |
|
||||||||||||||||
|
Store arbitrary value with key. The value must be copy constructible and assignable. If you store primitive types, make sure to tell it exactly which type you mean, e.g.: event.put("MyValue", (int )5); int x; event.get("MyValue", x); If you store a pointer, the pointer will be deleted at the end of the current event processing. If you want the pointer to be preserved, call the method like this: SomePointer *ptr = ...; event.put("MyName", keep(ptr)); where 'keep' is defined in the 'cafe' namespace. Note that the entry "MyName" in the Event is still cleared at the end of the current event processing. Definition at line 351 of file EventBase.hpp. References _map. Referenced by cafe::Stat::processEvent(), and cafe::AssociatedTracks::processEvent(). |
|
|
Read this branch if not already in memory.
Definition at line 44 of file EventBase.cpp. References _branches, _tree, and cafe::EventBase::BranchHolderBase::readBranch(). Referenced by cafe::Write::processEvent(), and cafe::RandomSelectUserObjects< T >::processEvent(). |
|
|
Called when the tree changes. Set addresses for reading Branches. Definition at line 33 of file EventBase.cpp. References _branches, _cookie, and _tree. Referenced by cafe::Selector::Init(), and cafe::RunController::processTree(). |
|
|
Allow/Disallow partial reading of objects. Returns old value. Default is true. Definition at line 57 of file EventBase.cpp. References _partial_read. Referenced by cafe::RunController::Run(). |
|
||||||||||||||||
|
Tag the events with all tags in the list 'C' can be any STL container.
Definition at line 393 of file EventBase.hpp. References tag(). |
|
|
Tag the event with 'name'.
Definition at line 120 of file EventBase.cpp. References _tags. Referenced by cafe::Stat::processEvent(), cafe::Select::processEvent(), cafe::OR::processEvent(), cafe::IfPr::processEvent(), cafe::If::processEvent(), cafe::Fork::processEvent(), cafe::Controller::processEvent(), and tag(). |
|
||||||||||||||||
|
Remove all of the tags in the list 'C' can be any STL container.
Definition at line 403 of file EventBase.hpp. References untag(). |
|
|
Remove tag with 'name'.
Definition at line 135 of file EventBase.cpp. References _tags. Referenced by cafe::OR::processEvent(), cafe::IfPr::processEvent(), cafe::If::processEvent(), cafe::Fork::processEvent(), cafe::Controller::processEvent(), and untag(). |
|
|
Definition at line 104 of file EventBase.cpp. References _map. |
|
|
Definition at line 112 of file EventBase.cpp. References _map. |
|
|
Definition at line 222 of file EventBase.hpp. Referenced by get(), getClonesArray(), getCollection(), readBranch(), and setBranchAddresses(). |
|
|
Definition at line 224 of file EventBase.hpp. Referenced by get(), getClonesArray(), getCollection(), getCookie(), and setBranchAddresses(). |
|
|
Definition at line 188 of file EventBase.hpp. Referenced by clear(), get(), put(), varnames(), and vartypes(). |
|
|
Definition at line 226 of file EventBase.hpp. Referenced by clear(). |
|
|
Definition at line 225 of file EventBase.hpp. Referenced by get(), getClonesArray(), getCollection(), getPartialRead(), and setPartialRead(). |
|
|
Definition at line 223 of file EventBase.hpp. Referenced by clear(), hasTag(), printTags(), tag(), and untag(). |
|
|
Definition at line 221 of file EventBase.hpp. Referenced by get(), getClonesArray(), getCollection(), getTree(), readBranch(), and setBranchAddresses(). |
1.3.4