ATLAS Offline Software
|
#include <McVtxFilterTool.h>
Classes | |
struct | VtxType |
Public Member Functions | |
McVtxFilterTool (const std::string &type, const std::string &name, const IInterface *parent) | |
Constructor with parameters: More... | |
virtual | ~McVtxFilterTool () |
Destructor: More... | |
virtual StatusCode | initialize () |
Athena Algorithm's Hooks. More... | |
virtual StatusCode | execute () |
void | displayOptions () const |
Display the decay pattern of each McVtxFilter this Tool is embedding. More... | |
void | stats () const |
Display the statistics for each McVtxFilter this Tool is embedding. More... | |
virtual bool | isAccepted (const HepMC::ConstGenVertexPtr &vtx) const |
Return true if one of the McVtxFilters accept this GenVertex. More... | |
virtual void | filterMcEventCollection (const McEventCollection *mcCollection, McEventCollection *filterColl) |
Filter the McEventCollection according to the list of McVtxFilter embedded in this AlgTool, and fill the output McEventCollection. More... | |
ServiceHandle< StoreGateSvc > & | evtStore () |
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More... | |
const ServiceHandle< StoreGateSvc > & | evtStore () const |
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More... | |
const ServiceHandle< StoreGateSvc > & | detStore () const |
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More... | |
virtual StatusCode | sysInitialize () override |
Perform system initialization for an algorithm. More... | |
virtual StatusCode | sysStart () override |
Handle START transition. More... | |
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
Return this algorithm's input handles. More... | |
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
Return this algorithm's output handles. More... | |
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
Declare a new Gaudi property. More... | |
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
Declare a new Gaudi property. More... | |
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
Declare a new Gaudi property. More... | |
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
Declare a new Gaudi property. More... | |
void | updateVHKA (Gaudi::Details::PropertyBase &) |
MsgStream & | msg () const |
MsgStream & | msg (const MSG::Level lvl) const |
bool | msgLvl (const MSG::Level lvl) const |
Static Public Member Functions | |
static const InterfaceID & | interfaceID () |
I/O operators. More... | |
Protected Member Functions | |
McVtxFilterTool () | |
Default constructor: More... | |
void | addVertex (const HepMC::ConstGenVertexPtr &vtx, HepMC::GenEvent *evt, const VtxType::Flag vtxType=VtxType::IsNotRootVertex, bool isSignal=false) const |
Add the vertex to the event : nothing very special, just to factorize code Input GenVertex is const because we add a copy of it to the GenEvent. More... | |
bool | keepParticle (const VtxType::Flag vtxType, const HepMC::ConstGenParticlePtr &p) const |
Helper function: return true if we are at a root vertex (i.e., a vertex that satisfies one of the chosen decay modes) and if the PDG of the particle is in the m_particles list (or the m_particle list is empty). More... | |
void | setupFilters (Gaudi::Details::PropertyBase &decayPatterns) |
Callback method to ensure consistency of filters. More... | |
void | renounceArray (SG::VarHandleKeyArray &handlesArray) |
remove all handles from I/O resolution More... | |
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > | renounce (T &h) |
void | extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps) |
Add StoreName to extra input/output deps as needed. More... | |
Protected Attributes | |
StringProperty | m_mcEventsName |
Location of the McEventCollection to be filtered. More... | |
StringProperty | m_mcEventsOutputName |
Output McEventCollection location (filtered from the McEventCollection) More... | |
StringArrayProperty | m_decayPatterns |
Patterns of the decays to look for (ex: "23 -> -5 + 5" ) More... | |
BooleanArrayProperty | m_matchSigns |
Booleans to setup each of the McVtxFilter::matchSign. More... | |
BooleanArrayProperty | m_matchBranches |
Booleans to setup each of the McVtxFilter::matchBranch. More... | |
DataVector< McVtxFilter > | m_filters |
Filters. More... | |
std::vector< double > | m_counter |
Stores the total number of filtered vertices for each McVtxFilter. More... | |
BooleanProperty | m_doSignalProcessVtx |
Switch to include or not the signal_process_vertex into the McEventCollection (default = true) More... | |
BooleanProperty | m_fillTree |
Switch to fill the entire tree from a decay vertex. More... | |
LongArrayProperty | m_particles |
List of outgoing particles from the decay vertex to include. More... | |
Private Types | |
typedef ServiceHandle< StoreGateSvc > | StoreGateSvc_t |
Private Member Functions | |
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &) |
specialization for handling Gaudi::Property<SG::VarHandleKey> More... | |
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &) |
specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More... | |
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &) |
specialization for handling Gaudi::Property<SG::VarHandleBase> More... | |
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &) |
specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More... | |
Private Attributes | |
StoreGateSvc_t | m_evtStore |
Pointer to StoreGate (event store by default) More... | |
StoreGateSvc_t | m_detStore |
Pointer to StoreGate (detector store by default) More... | |
std::vector< SG::VarHandleKeyArray * > | m_vhka |
bool | m_varHandleArraysDeclared |
AlgTool which filters an input McEventCollection and outputs a new one from the decay patterns it has been setup with. The decay patterns describe the decay vertices one is looking for and are modeled via a simple std::string. One can specify multiple decay patterns and modify them at the jobOption level via the property "DecayPatterns". One can also explicitly specify to record the signal process vertex of the input McEventCollection into the new one, even if it does not satisfy a single decay pattern in the list of decay vertices to look for.
Note that the real work of the filtering is performed by the McVtxFilter class which is located in the AnalysisUtils package.
Added new properties:
ex. suppose have processes like:
u + ubar -> gluon(->jet(s)) + photon(->e+/e- + bremsstrahlung photons)
and want to filter out only the jet(s) from the gluon. Use these jobOptions
Definition at line 71 of file McVtxFilterTool.h.
|
privateinherited |
Definition at line 388 of file AthCommonDataStore.h.
McVtxFilterTool::McVtxFilterTool | ( | const std::string & | type, |
const std::string & | name, | ||
const IInterface * | parent | ||
) |
Constructor with parameters:
Public methods:
Constructors
Definition at line 34 of file McVtxFilterTool.cxx.
|
virtual |
|
protected |
Default constructor:
|
protected |
Add the vertex to the event : nothing very special, just to factorize code Input GenVertex is const because we add a copy of it to the GenEvent.
Const methods:
The last parameter is used here to add (or not) the whole decay tree at a given vertex. (Default: just add the vertex, not the whole tree of children)
Fill the parent branch
Fill the children branch
Definition at line 271 of file McVtxFilterTool.cxx.
|
inlineprivateinherited |
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
|
inlineprivateinherited |
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
|
inlineprivateinherited |
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
|
inlineprivateinherited |
specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>
Definition at line 199 of file AthCommonDataStore.h.
|
inlineinherited |
Declare a new Gaudi property.
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
|
inlineinherited |
Declare a new Gaudi property.
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
|
inlineinherited |
Definition at line 259 of file AthCommonDataStore.h.
|
inlineinherited |
Declare a new Gaudi property.
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
|
inlineinherited |
Declare a new Gaudi property.
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
|
inlineinherited |
Definition at line 145 of file AthCommonDataStore.h.
|
inlineinherited |
The standard StoreGateSvc/DetectorStore
Returns (kind of) a pointer to the StoreGateSvc
.
Definition at line 95 of file AthCommonDataStore.h.
|
virtual |
Display the decay pattern of each McVtxFilter this Tool is embedding.
Const methods:
Implements IMcVtxFilterTool.
Definition at line 162 of file McVtxFilterTool.cxx.
|
inlineinherited |
The standard StoreGateSvc
(event store) Returns (kind of) a pointer to the StoreGateSvc
.
Definition at line 85 of file AthCommonDataStore.h.
|
inlineinherited |
The standard StoreGateSvc
(event store) Returns (kind of) a pointer to the StoreGateSvc
.
Definition at line 90 of file AthCommonDataStore.h.
|
virtual |
|
protectedinherited |
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
|
virtual |
Filter the McEventCollection according to the list of McVtxFilter embedded in this AlgTool, and fill the output McEventCollection.
Non-const methods:
Create a set with ids of copied vertices.
Local copy of the GenEvent from StoreGate
Create the event container, with Signal Process and event number from the GenEvent source
Handling the signal_process_vertex stuff Signal_process_vertex pointer is not set by all generators, but in case it has been set up, one should keep this usefull information, shouldn't we ? So first we check it is present in the original GenEvent, and then we check if it as not already added by any previous McVtxFilter (by chance or because it was just meant to be)
Implements IMcVtxFilterTool.
Definition at line 205 of file McVtxFilterTool.cxx.
|
virtual |
Athena Algorithm's Hooks.
Implements IMcVtxFilterTool.
Definition at line 111 of file McVtxFilterTool.cxx.
|
overridevirtualinherited |
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
|
inlinestaticinherited |
|
virtual |
Return true if one of the McVtxFilters accept this GenVertex.
Implements IMcVtxFilterTool.
Definition at line 189 of file McVtxFilterTool.cxx.
|
protected |
Helper function: return true if we are at a root vertex (i.e., a vertex that satisfies one of the chosen decay modes) and if the PDG of the particle is in the m_particles list (or the m_particle list is empty).
Definition at line 415 of file McVtxFilterTool.cxx.
|
inlineinherited |
Definition at line 24 of file AthCommonMsg.h.
|
inlineinherited |
Definition at line 27 of file AthCommonMsg.h.
|
inlineinherited |
Definition at line 30 of file AthCommonMsg.h.
|
overridevirtualinherited |
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
|
inlineprotectedinherited |
Definition at line 380 of file AthCommonDataStore.h.
|
inlineprotectedinherited |
remove all handles from I/O resolution
Definition at line 364 of file AthCommonDataStore.h.
|
protected |
Callback method to ensure consistency of filters.
Method to ensure the synchronisation between the filters and the decay patterns they are supposed to match. This is to cope with the case where this tool is called by some parent AlgTool/Algorithm which wants to override the DecayPatterns property given by the JobOptionSvc. We ensure the consistency between those 2 entities by defining a callback function (@setupFilters) to perform the job.
Definition at line 461 of file McVtxFilterTool.cxx.
|
virtual |
Display the statistics for each McVtxFilter this Tool is embedding.
Implements IMcVtxFilterTool.
Definition at line 179 of file McVtxFilterTool.cxx.
|
overridevirtualinherited |
Perform system initialization for an algorithm.
We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.
Reimplemented in DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.
|
overridevirtualinherited |
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
|
inlineinherited |
Definition at line 308 of file AthCommonDataStore.h.
|
protected |
Stores the total number of filtered vertices for each McVtxFilter.
Definition at line 201 of file McVtxFilterTool.h.
|
protected |
Patterns of the decays to look for (ex: "23 -> -5 + 5" )
Definition at line 185 of file McVtxFilterTool.h.
|
privateinherited |
Pointer to StoreGate (detector store by default)
Definition at line 393 of file AthCommonDataStore.h.
|
protected |
Switch to include or not the signal_process_vertex into the McEventCollection (default = true)
Definition at line 206 of file McVtxFilterTool.h.
|
privateinherited |
Pointer to StoreGate (event store by default)
Definition at line 390 of file AthCommonDataStore.h.
|
protected |
Switch to fill the entire tree from a decay vertex.
Definition at line 210 of file McVtxFilterTool.h.
|
protected |
Filters.
Definition at line 197 of file McVtxFilterTool.h.
|
protected |
Booleans to setup each of the McVtxFilter::matchBranch.
Definition at line 193 of file McVtxFilterTool.h.
|
protected |
Booleans to setup each of the McVtxFilter::matchSign.
Definition at line 189 of file McVtxFilterTool.h.
|
protected |
Location of the McEventCollection to be filtered.
Definition at line 177 of file McVtxFilterTool.h.
|
protected |
Output McEventCollection location (filtered from the McEventCollection)
Definition at line 181 of file McVtxFilterTool.h.
|
protected |
List of outgoing particles from the decay vertex to include.
Definition at line 214 of file McVtxFilterTool.h.
|
privateinherited |
Definition at line 399 of file AthCommonDataStore.h.
|
privateinherited |
Definition at line 398 of file AthCommonDataStore.h.