![]() |
ATLAS Offline Software
|
The linker branch is a helper class to establish linking indices between dumped particle collections. More...
#include <LinkerBranch.h>
Public Types | |
using | ParticleBranch_ptr = std::shared_ptr< IParticleFourMomBranch > |
Abreviation of the pointer to the particle branch. More... | |
using | Linker_t = std::function< const xAOD::IParticle *(const xAOD::IParticle *)> |
Typedef of the linker function. More... | |
using | DataDependency = SG::VarHandleKey * |
using | DataDependency = SG::VarHandleKey * |
Public Member Functions | |
LinkerBranch (IParticleFourMomBranch &parent, ParticleBranch_ptr linkColl, Linker_t linker, const std::string &altName="") | |
Standard constructor fo the LinkerBranch. More... | |
void | push_back (const xAOD::IParticle *p) override |
Interface methods to handle the particle. More... | |
void | push_back (const xAOD::IParticle &p) override |
void | operator+= (const xAOD::IParticle *p) override |
void | operator+= (const xAOD::IParticle &p) override |
bool | fill (const EventContext &ctx) override |
Clears vector in cases that it has not been updated in this event Retursn falls if the vector has not been initialized yet. More... | |
bool | init () override |
Initialized the Branch. More... | |
size_t | size () const |
Returns the number of actual saved elements. More... | |
void | push_back (const unsigned short &value) |
Adds a new element at the end of the vector. More... | |
void | operator+= (const unsigned short &value) |
unsigned short & | operator[] (size_t idx) |
Accesses the idx-th element. More... | |
unsigned short & | get (size_t idx) |
bool & | get (size_t idx) |
bool & | get (size_t) |
const unsigned short & | getDefault () const |
void | setDefault (const unsigned short &def) |
bool | isUpdated () const |
bool | hasDefault () const |
std::string | name () const override final |
Returns the name of the branch. More... | |
bool | initialized () const |
Returns whether the object has been initialized or not The outcome of the variable is bound to a successful call of the addToTree method. More... | |
TTree * | tree () override final |
Returns the underlying TTree object. More... | |
const TTree * | tree () const override final |
std::vector< DataDependency > | data_dependencies () override final |
Returns the data dependencies needed by the MuonTesterBranch. More... | |
bool | msgLvl (const MSG::Level lvl) const |
Test the output level. More... | |
MsgStream & | msg () const |
The standard message stream. More... | |
MsgStream & | msg (const MSG::Level lvl) const |
The standard message stream. More... | |
void | setLevel (MSG::Level lvl) |
Change the current logging level. More... | |
Static Public Member Functions | |
static std::string | eraseWhiteSpaces (const std::string &In) |
Protected Member Functions | |
template<class T > | |
bool | addToTree (T &variable) |
Connects the Memory buffer with the TTree. More... | |
template<class Key > | |
bool | declare_dependency (Key &key) |
Declares the ReadHandle/ ReadCondHandleKey as data dependency of the algorithm. More... | |
MuonTesterTree & | parent () |
Returns the reference to the MuonTesterTree parent. More... | |
Private Member Functions | |
void | initMessaging () const |
Initialize our message level and MessageSvc. More... | |
Private Attributes | |
std::weak_ptr< IParticleFourMomBranch > | m_linkColl |
Linker_t | m_linkerFunc |
std::vector< unsigned short > | m_variable |
unsigned short | m_default |
bool | m_hasDefault |
bool | m_updated |
TTree * | m_tree {nullptr} |
MuonTesterTree * | m_parent {nullptr} |
std::string | m_name {} |
bool | m_init {false} |
std::vector< DataDependency > | m_dependencies {} |
std::string | m_nm |
Message source name. More... | |
boost::thread_specific_ptr< MsgStream > | m_msg_tls |
MsgStream instance (a std::cout like with print-out levels) More... | |
std::atomic< IMessageSvc * > | m_imsg { nullptr } |
MessageSvc pointer. More... | |
std::atomic< MSG::Level > | m_lvl { MSG::NIL } |
Current logging level. More... | |
std::atomic_flag m_initialized | ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT |
Messaging initialized (initMessaging) More... | |
The linker branch is a helper class to establish linking indices between dumped particle collections.
Once the primary particle is added to the collection, the linker branch calls the linker function to find the related particle and to add it into it's forseen collection. The position where the related particle is saved in the tree, is then saved by the linker branch
Definition at line 17 of file LinkerBranch.h.
|
inherited |
Definition at line 39 of file IMuonTesterBranch.h.
|
inherited |
Definition at line 39 of file IMuonTesterBranch.h.
using MuonVal::LinkerBranch::Linker_t = std::function<const xAOD::IParticle*(const xAOD::IParticle*)> |
Typedef of the linker function.
The function takes as argument the primary particle of interest and shall then return the particle to associate with
Definition at line 25 of file LinkerBranch.h.
using MuonVal::LinkerBranch::ParticleBranch_ptr = std::shared_ptr<IParticleFourMomBranch> |
Abreviation of the pointer to the particle branch.
Definition at line 21 of file LinkerBranch.h.
MuonVal::LinkerBranch::LinkerBranch | ( | IParticleFourMomBranch & | parent, |
ParticleBranch_ptr | linkColl, | ||
Linker_t | linker, | ||
const std::string & | altName = "" |
||
) |
Standard constructor fo the LinkerBranch.
parent | Particle branch collection where the linker branch is appended to. The primary particle of interest is provided by this collection. |
linkColl | Particle branch collection where the linked particle shall be appended |
linker | Function to find the linked particle from the primary particle |
altName | by default the name is <primaryColl>_linked<Secondary>. Parse an alternative name |
Definition at line 7 of file LinkerBranch.cxx.
|
protectedinherited |
Connects the Memory buffer with the TTree.
|
finaloverridevirtualinherited |
Returns the data dependencies needed by the MuonTesterBranch.
Implements MuonVal::IMuonTesterBranch.
Definition at line 61 of file MuonTesterBranch.cxx.
|
protectedinherited |
Declares the ReadHandle/ ReadCondHandleKey as data dependency of the algorithm.
|
staticinherited |
|
overridevirtualinherited |
Clears vector in cases that it has not been updated in this event Retursn falls if the vector has not been initialized yet.
Implements MuonVal::IMuonTesterBranch.
|
inlineinherited |
|
inherited |
|
inherited |
Definition at line 63 of file MuonTesterBranch.cxx.
|
inlineinherited |
|
inlineinherited |
|
overridevirtualinherited |
Initialized the Branch.
Implements MuonVal::IMuonTesterBranch.
|
inherited |
Returns whether the object has been initialized or not The outcome of the variable is bound to a successful call of the addToTree method.
Definition at line 52 of file MuonTesterBranch.cxx.
|
privateinherited |
Initialize our message level and MessageSvc.
This method should only be called once.
Definition at line 39 of file AthMessaging.cxx.
|
inlineinherited |
|
inlineinherited |
The standard message stream.
Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.
Definition at line 164 of file AthMessaging.h.
|
inlineinherited |
The standard message stream.
Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.
Definition at line 179 of file AthMessaging.h.
|
inlineinherited |
Test the output level.
lvl | The message level to test against |
true | Messages at level "lvl" will be printed |
Definition at line 151 of file AthMessaging.h.
|
finaloverridevirtualinherited |
Returns the name of the branch.
Implements MuonVal::IMuonTesterBranch.
Definition at line 51 of file MuonTesterBranch.cxx.
|
inlineinherited |
|
overridevirtual |
Implements MuonVal::IParticleDecorationBranch.
Definition at line 19 of file LinkerBranch.cxx.
|
overridevirtual |
Implements MuonVal::IParticleDecorationBranch.
Definition at line 16 of file LinkerBranch.cxx.
|
inlineinherited |
Accesses the idx-th element.
If the index is larger than the size of the vector it is then enlarged with the default_value
|
protectedinherited |
Returns the reference to the MuonTesterTree parent.
Definition at line 38 of file MuonTesterBranch.cxx.
|
inlineinherited |
Adds a new element at the end of the vector.
|
overridevirtual |
Implements MuonVal::IParticleDecorationBranch.
Definition at line 22 of file LinkerBranch.cxx.
|
overridevirtual |
Interface methods to handle the particle.
Implements MuonVal::IParticleDecorationBranch.
Definition at line 25 of file LinkerBranch.cxx.
|
inherited |
|
inherited |
Change the current logging level.
Use this rather than msg().setLevel() for proper operation with MT.
Definition at line 28 of file AthMessaging.cxx.
|
inlineinherited |
Returns the number of actual saved elements.
|
finaloverridevirtualinherited |
|
finaloverridevirtualinherited |
Returns the underlying TTree object.
Implements MuonVal::IMuonTesterBranch.
Definition at line 53 of file MuonTesterBranch.cxx.
|
mutableprivateinherited |
Messaging initialized (initMessaging)
Definition at line 141 of file AthMessaging.h.
|
privateinherited |
Definition at line 55 of file VectorBranch.h.
|
privateinherited |
Definition at line 62 of file MuonTesterBranch.h.
|
privateinherited |
Definition at line 56 of file VectorBranch.h.
|
mutableprivateinherited |
MessageSvc pointer.
Definition at line 135 of file AthMessaging.h.
|
privateinherited |
Definition at line 61 of file MuonTesterBranch.h.
|
private |
Definition at line 47 of file LinkerBranch.h.
|
private |
Definition at line 48 of file LinkerBranch.h.
|
mutableprivateinherited |
Current logging level.
Definition at line 138 of file AthMessaging.h.
|
mutableprivateinherited |
MsgStream instance (a std::cout like with print-out levels)
Definition at line 132 of file AthMessaging.h.
|
privateinherited |
Definition at line 60 of file MuonTesterBranch.h.
|
privateinherited |
Message source name.
Definition at line 129 of file AthMessaging.h.
|
privateinherited |
Definition at line 59 of file MuonTesterBranch.h.
|
privateinherited |
Definition at line 58 of file MuonTesterBranch.h.
|
privateinherited |
Definition at line 57 of file VectorBranch.h.
|
privateinherited |
Definition at line 54 of file VectorBranch.h.