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

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. | |
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. | |
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 |
This class provides three generic services:
Definition at line 34 of file EventBase.hpp.
|
|
Definition at line 198 of file EventBase.hpp. |
|
|
Definition at line 182 of file EventBase.hpp. |
|
|
Definition at line 15 of file EventBase.cpp. |
|
|
Definition at line 22 of file EventBase.cpp. |
|
||||||||||||
|
Reimplemented in cafe::Event. |
|
|
Clear any values kept in the event store.
Definition at line 64 of file EventBase.cpp. References _map, _tags, cafe::Stat::eventEnd(), and STAT. |
|
|
Definition at line 345 of file EventBase.hpp. References _map. Referenced by cafe::EventMultiSplitter::processPermutation(), and cafe::RunController::processTree(). |
|
||||||||||||||||
|
Retrieve arbitrary value with key.
Definition at line 354 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 257 of file EventBase.hpp. References _branches, _cookie, _partial_read, _tree, cafe::EventBase::BranchHolder< T >::getObject(), and cafe::EventBase::BranchHolder< T >::setBranchAddress(). Referenced by caf_util::VertexSelector::processEvent(), caf_util::TopologicalSelector::processEvent(), caf_util::TauSelector::processEvent(), cafe::StatGWeight::processEvent(), cafe::Stat::processEvent(), cafe::SelectObjects::processEvent(), caf_util::ResSelector::processEvent(), caf_util::ReComputeMET::processEvent(), caf_util::METSelector::processEvent(), caf_util::JetSelector::processEvent(), cafe::Hist3D::processEvent(), cafe::Hist2D::processEvent(), cafe::Hist1D::processEvent(), caf_util::EventQuality::processEvent(), caf_util::ElectronSelector::processEvent(), and caf_util::BTagJetSelector::processEvent(). |
|
||||||||||||
|
Return the TClonesArray for the given branch.
Definition at line 107 of file EventBase.cpp. References _branches, _cookie, _partial_read, _tree, cafe::EventBase::BranchHolder< T >::getObject(), and cafe::EventBase::BranchHolder< T >::setBranchAddress(). Referenced by caf_util::ResSelector::processEvent(), and cafe::Hist1D::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 269 of file EventBase.hpp. References _branches, _cookie, _partial_read, _tree, cafe::EventBase::BranchHolder< T >::getObject(), and cafe::EventBase::BranchHolder< T >::setBranchAddress(). Referenced by caf_util::EMJetMatching::after(), caf_util::ApplyJES::after(), caf_util::TRefFinder::FindTrack(), caf_util::TRefFinder::FindVertex(), caf_util::TopologicalSelector::processEvent(), cafe::SelectUserObjects< T >::processEvent(), caf_util::ReComputeMET::processEvent(), caf_util::JetSelector::processEvent(), and caf_util::VertexSelector::selectObject(). |
|
|
Get current cookie (== tree number).
Definition at line 102 of file EventBase.cpp. References _cookie. Referenced by cafe::SelectBranches::SelectBranches(). |
|
|
Get partial read flag.
Definition at line 59 of file EventBase.cpp. References _partial_read. |
|
|
Get current TTree.
Definition at line 97 of file EventBase.cpp. References _tree. Referenced by cafe::Write::processEvent(), cafe::SelectObjects::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 372 of file EventBase.hpp. References _tags. |
|
|
Check if event is tagged with 'name'.
Definition at line 87 of file EventBase.cpp. References _tags. |
|
|
Check if event is tagged with 'name'.
Definition at line 82 of file EventBase.cpp. References _tags. Referenced by cafe::EventList::processEvent(), and cafe::StatSample::tagged(). |
|
||||||||||||||||
|
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 340 of file EventBase.hpp. References _map. Referenced by caf_util::TopologicalSelector::processEvent(), cafe::Stat::processEvent(), caf_util::ResSelector::processEvent(), and caf_util::METSelector::processEvent(). |
|
|
Read this branch if not already in memory.
Definition at line 39 of file EventBase.cpp. References _branches, _tree, and cafe::EventBase::BranchHolderBase::readBranch(). Referenced by cafe::Write::processEvent(). |
|
|
Called when the tree changes. Set addresses for reading Branches. Definition at line 28 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 52 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 385 of file EventBase.hpp. References tag(). |
|
|
Tag the event with 'name'.
Definition at line 77 of file EventBase.cpp. References _tags. Referenced by cafe::Stat::processEvent(), cafe::Select::processEvent(), caf_util::JetSelector::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 395 of file EventBase.hpp. References untag(). |
|
|
Remove tag with 'name'.
Definition at line 92 of file EventBase.cpp. References _tags. Referenced by cafe::If::processEvent(), cafe::Fork::processEvent(), cafe::Controller::processEvent(), and untag(). |
|
|
Definition at line 217 of file EventBase.hpp. Referenced by get(), getClonesArray(), getCollection(), readBranch(), and setBranchAddresses(). |
|
|
Definition at line 219 of file EventBase.hpp. Referenced by get(), getClonesArray(), getCollection(), getCookie(), and setBranchAddresses(). |
|
|
Definition at line 183 of file EventBase.hpp. |
|
|
Definition at line 220 of file EventBase.hpp. Referenced by get(), getClonesArray(), getCollection(), getPartialRead(), and setPartialRead(). |
|
|
Definition at line 218 of file EventBase.hpp. |
|
|
Definition at line 216 of file EventBase.hpp. Referenced by get(), getClonesArray(), getCollection(), getTree(), readBranch(), and setBranchAddresses(). |
1.3.4