ATLAS Offline Software
|
McVtxFilter allows to select HepMC::GenParticle based on the decay pattern. More...
#include <McVtxFilter.h>
Public Member Functions | |
McVtxFilter () | |
Default constructor: More... | |
McVtxFilter (const McVtxFilter &rhs) | |
Copy constructor: More... | |
McVtxFilter (const std::string &decayPattern, const bool matchSign=false, const bool matchBranches=false) | |
Constructor with parameters: More... | |
McVtxFilter (const bool matchSign, const bool matchBranches) | |
Constructor with parameters: More... | |
virtual | ~McVtxFilter () |
Destructor: More... | |
McVtxFilter & | operator= (const McVtxFilter &rhs) |
Assignment operator: More... | |
virtual bool | isAccepted (HepMC::ConstGenVertexPtr vtx) const |
Main filter method. More... | |
void | dump (std::ostream &out=std::cout) const |
Dump to std::ostream (default = std::cout) the decay pattern the filter one is looking for. More... | |
bool | isFullVtx () const |
returns true if the vertex filter requires a parent AND a child list ie: returns false if the filter looks only for a lonely particle (eg: a photon or an electron, see TruthParticleAlgs for a concrete example) More... | |
bool | matchSign () const |
return true if the filter discriminates the sign of the particles More... | |
bool | matchBranches () const |
return true if the filter strictly matchs the number of output particles eg: a vertex t->Wbgg won't be selected if matchBranches == true and decay pattern = "#id 6[24,5]" More... | |
const std::string & | decayPattern () const |
return the decay pattern used by this filter More... | |
const DataVector< const ParticleCandidateList > & | parentList () const |
return the list of particle candidates for the input particles (parent) More... | |
const DataVector< const ParticleCandidateList > & | childList () const |
return the list of particle candidates for the output particles (child) More... | |
virtual void | setFilter (const IFilterCuts *filter) |
Set filter cut options. More... | |
void | setMatchSign (const bool matchSign) |
Set if one wants to discriminate the sign of the particles. More... | |
void | setMatchBranches (const bool matchVtxBranches) |
Set if one wants to strictly match the number of output particles. More... | |
void | setDecayPattern (const std::string &decayPattern) |
Set the decay pattern to look for : it correctly setups the parent and children according to the LaTeX-like string which is given as argument. 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... | |
Protected Member Functions | |
bool | checkParentBranch (HepMC::ConstGenVertexPtr vtx) const |
Check if the parent branch fulfills the requirements. More... | |
bool | checkChildBranch (HepMC::ConstGenVertexPtr vtx) const |
Check if the child branch fulfills the requirements. More... | |
bool | checkTwoBodyDecay (HepMC::ConstGenVertexPtr vtx) const |
Check the branches for the special case of a 1->2 body decay (there is some room for optimisation in that particular case) More... | |
Protected Attributes | |
bool | m_matchSign |
Discrimination between particles and conjugates. More... | |
bool | m_matchBranches |
Tell if one wants a strict vertex branches matching. More... | |
std::string | m_decayPattern |
The decay pattern one looks for. More... | |
DataVector< const ParticleCandidateList > | m_parentList |
The list of the matching particles Ids : each item in DataVector stands for an entering branch to the vertex. More... | |
DataVector< const ParticleCandidateList > | m_childList |
The list of the matching particles Ids : each item in DataVector stands for an out-going branch to the vertex. More... | |
Private Member Functions | |
void | initMessaging () const |
Initialize our message level and MessageSvc. More... | |
Private Attributes | |
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... | |
McVtxFilter allows to select HepMC::GenParticle based on the decay pattern.
Hopefully one will be able to also select the particles by pt (in a coming patch). It uses internally the DecayPattern class to build the filtering decision The basic modus operandi is to loop on HepMC::GenVertex (of a given HepMC::GenEvent) to select the ones which are of interest (and fulfill the decay pattern).
Definition at line 44 of file McVtxFilter.h.
McVtxFilter::McVtxFilter | ( | ) |
McVtxFilter::McVtxFilter | ( | const McVtxFilter & | rhs | ) |
McVtxFilter::McVtxFilter | ( | const std::string & | decayPattern, |
const bool | matchSign = false , |
||
const bool | matchBranches = false |
||
) |
|
inlinevirtual |
|
protected |
Check if the child branch fulfills the requirements.
Check we aren't in the "any particle" case
Check there is enough outgoing particles in the current vertex
Definition at line 369 of file McVtxFilter.cxx.
|
protected |
Check if the parent branch fulfills the requirements.
Protected methods:
Check we aren't in the "any particle" case
Check if number of parents is OK
Definition at line 302 of file McVtxFilter.cxx.
|
protected |
Check the branches for the special case of a 1->2 body decay (there is some room for optimisation in that particular case)
First check the parent branch matching decision if it doesn't fulfil our requirements, it is not worth continuing the process
Now, handle the child branch
Cache the 2 particle candidate lists
Cache the id of the outgoing particles of the vertex being analysed
Loop over candidates for the 1st child
Loop over candidate for the 2nd child
If the strict match sign has been required, we check if the PDG ids are matching
if we are in a loose sign request, we check only that the absolute values of the pdg IDs are matching
If we are here, then the vertex candidate didn't fulfil the requirements we have setup
Definition at line 414 of file McVtxFilter.cxx.
|
inline |
return the list of particle candidates for the output particles (child)
Definition at line 236 of file McVtxFilter.h.
|
inline |
return the decay pattern used by this filter
Definition at line 224 of file McVtxFilter.h.
void McVtxFilter::dump | ( | std::ostream & | out = std::cout | ) | const |
Dump to std::ostream (default = std::cout) the decay pattern the filter one is looking for.
Definition at line 201 of file McVtxFilter.cxx.
|
privateinherited |
Initialize our message level and MessageSvc.
This method should only be called once.
Definition at line 39 of file AthMessaging.cxx.
|
virtual |
Main filter method.
Const methods:
This method takes the decision whether or not the filter has to accept the vertex. It checks if the vertex has the required number of ingoing particles the required number of outgoing particles. Then for each branch (parent child) it checks if the particle can match an asked for particle.
First handle special case where the filter has only 1 child and no parent : one is looking for a stable particle with no end_vertex
Skip vertices which don't match the number of branches we are looking for : check if number of parents and of children is OK
Then handle the case we are looking for a 1->2 body decay
Handle other generic cases
Definition at line 128 of file McVtxFilter.cxx.
|
inline |
returns true if the vertex filter requires a parent AND a child list ie: returns false if the filter looks only for a lonely particle (eg: a photon or an electron, see TruthParticleAlgs for a concrete example)
Definition at line 205 of file McVtxFilter.h.
|
inline |
return true if the filter strictly matchs the number of output particles eg: a vertex t->Wbgg won't be selected if matchBranches == true and decay pattern = "#id 6[24,5]"
Definition at line 219 of file McVtxFilter.h.
|
inline |
return true if the filter discriminates the sign of the particles
Definition at line 214 of file McVtxFilter.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 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.
McVtxFilter & McVtxFilter::operator= | ( | const McVtxFilter & | rhs | ) |
|
inline |
return the list of particle candidates for the input particles (parent)
Definition at line 230 of file McVtxFilter.h.
void McVtxFilter::setDecayPattern | ( | const std::string & | decayPattern | ) |
Set the decay pattern to look for : it correctly setups the parent and children according to the LaTeX-like string which is given as argument.
Set the filter from a decay pattern.
Definition at line 247 of file McVtxFilter.cxx.
|
virtual |
Set filter cut options.
Non-const methods:
Set filter cut options
Implements IFilterCuts.
Definition at line 232 of file McVtxFilter.cxx.
|
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.
|
inline |
Set if one wants to strictly match the number of output particles.
Definition at line 250 of file McVtxFilter.h.
|
inline |
Set if one wants to discriminate the sign of the particles.
Definition at line 245 of file McVtxFilter.h.
|
mutableprivateinherited |
Messaging initialized (initMessaging)
Definition at line 141 of file AthMessaging.h.
|
protected |
The list of the matching particles Ids : each item in DataVector stands for an out-going branch to the vertex.
Definition at line 186 of file McVtxFilter.h.
|
protected |
The decay pattern one looks for.
Ex: 23 -> -11 + 11 to model a Z0 -> e+ e- decay
Definition at line 178 of file McVtxFilter.h.
|
mutableprivateinherited |
MessageSvc pointer.
Definition at line 135 of file AthMessaging.h.
|
mutableprivateinherited |
Current logging level.
Definition at line 138 of file AthMessaging.h.
|
protected |
Tell if one wants a strict vertex branches matching.
This is to cope with radiations in the output branches If true then a decay t->Wbggg will not be kept if one asked for a top into W+b decay... Default : false
Definition at line 174 of file McVtxFilter.h.
|
protected |
Discrimination between particles and conjugates.
Definition at line 167 of file McVtxFilter.h.
|
mutableprivateinherited |
MsgStream instance (a std::cout like with print-out levels)
Definition at line 132 of file AthMessaging.h.
|
privateinherited |
Message source name.
Definition at line 129 of file AthMessaging.h.
|
protected |
The list of the matching particles Ids : each item in DataVector stands for an entering branch to the vertex.
Definition at line 182 of file McVtxFilter.h.