ATLAS Offline Software
McVtxFilterTool.h
Go to the documentation of this file.
1 
3 /*
4  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // McVtxFilterTool.h
8 // Header file for class McVtxFilterTool
9 // Author: S.Binet<binet@cern.ch>
10 // Modified: D. Schouten <dschoute@sfu.ca>
12 #ifndef MCPARTICLETOOLS_MCVTXFILTERTOOL_H
13 #define MCPARTICLETOOLS_MCVTXFILTERTOOL_H 1
14 
47 // STL includes
48 #include <string>
49 #include <vector>
50 
51 // HepMC / CLHEP includes
52 
53 // FrameWork includes
54 #include "Gaudi/Property.h"
55 #include "GaudiKernel/ServiceHandle.h"
57 
58 // DataModel includes
60 
61 // McParticleUtils includes
63 
64 // McParticleKernel includes
66 
67 // Forward declaration
68 class McEventCollection;
70 
71 class McVtxFilterTool : virtual public IMcVtxFilterTool,
72  public AthAlgTool
73 {
74 
76  // Public enums:
78  public:
79  struct VtxType {
80  enum Flag {
81  Unknown = -1,
84  };
85  };
86 
88  // Public methods:
90  public:
91 
92  // Copy constructor:
93 
95  McVtxFilterTool( const std::string& type,
96  const std::string& name,
97  const IInterface* parent );
98 
100  virtual ~McVtxFilterTool();
101 
102  // Assignment operator:
103  //McVtxFilterTool &operator=(const McVtxFilterTool &alg);
104 
105  // Athena algorithm's Hooks
106  virtual StatusCode initialize();
107  virtual StatusCode execute();
108 
110  // Const methods:
112 
115  void displayOptions() const;
116 
119  void stats() const;
120 
123  virtual bool isAccepted( const HepMC::ConstGenVertexPtr& vtx ) const;
124 
126  // Non-const methods:
128 
132  virtual void filterMcEventCollection( const McEventCollection* mcCollection,
133  McEventCollection* filterColl );
134 
136  // Protected methods:
138  protected:
139 
142 
148  void addVertex( const HepMC::ConstGenVertexPtr& vtx, HepMC::GenEvent * evt,
149  const VtxType::Flag vtxType = VtxType::IsNotRootVertex, bool isSignal=false ) const;
150 
155  bool keepParticle( const VtxType::Flag vtxType, const HepMC::ConstGenParticlePtr& p ) const;
156 
166  void setupFilters( Gaudi::Details::PropertyBase& decayPatterns );
167 
169  // Protected data:
171  protected:
172 
173  // Containers
174 
177  StringProperty m_mcEventsName;
178 
181  StringProperty m_mcEventsOutputName;
182 
185  StringArrayProperty m_decayPatterns;
186 
189  BooleanArrayProperty m_matchSigns;
190 
193  BooleanArrayProperty m_matchBranches;
194 
198 
201  std::vector<double> m_counter;
202 
206  BooleanProperty m_doSignalProcessVtx;
207 
210  BooleanProperty m_fillTree;
211 
214  LongArrayProperty m_particles;
215 };
216 
217 #endif //> MCPARTICLETOOLS_MCVTXFILTERTOOL_H
McVtxFilterTool::m_doSignalProcessVtx
BooleanProperty m_doSignalProcessVtx
Switch to include or not the signal_process_vertex into the McEventCollection (default = true)
Definition: McVtxFilterTool.h:206
McVtxFilterTool::m_mcEventsOutputName
StringProperty m_mcEventsOutputName
Output McEventCollection location (filtered from the McEventCollection)
Definition: McVtxFilterTool.h:181
McVtxFilterTool::stats
void stats() const
Display the statistics for each McVtxFilter this Tool is embedding.
Definition: McVtxFilterTool.cxx:179
McVtxFilterTool::addVertex
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 b...
Definition: McVtxFilterTool.cxx:271
McVtxFilterTool::VtxType
Definition: McVtxFilterTool.h:79
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
McVtxFilterTool::isAccepted
virtual bool isAccepted(const HepMC::ConstGenVertexPtr &vtx) const
Return true if one of the McVtxFilters accept this GenVertex.
Definition: McVtxFilterTool.cxx:189
McVtxFilterTool::execute
virtual StatusCode execute()
Definition: McVtxFilterTool.cxx:126
McVtxFilterTool::m_mcEventsName
StringProperty m_mcEventsName
Location of the McEventCollection to be filtered.
Definition: McVtxFilterTool.h:177
McVtxFilterTool::initialize
virtual StatusCode initialize()
Athena Algorithm's Hooks.
Definition: McVtxFilterTool.cxx:111
McVtxFilterTool::m_counter
std::vector< double > m_counter
Stores the total number of filtered vertices for each McVtxFilter.
Definition: McVtxFilterTool.h:201
McVtxFilterTool::m_filters
DataVector< McVtxFilter > m_filters
Filters.
Definition: McVtxFilterTool.h:197
McVtxFilterTool::VtxType::IsNotRootVertex
@ IsNotRootVertex
Definition: McVtxFilterTool.h:83
LArG4FSStartPointFilter.evt
evt
Definition: LArG4FSStartPointFilter.py:42
McVtxFilterTool::m_matchSigns
BooleanArrayProperty m_matchSigns
Booleans to setup each of the McVtxFilter::matchSign.
Definition: McVtxFilterTool.h:189
McVtxFilterTool::VtxType::Unknown
@ Unknown
Definition: McVtxFilterTool.h:81
McVtxFilterTool
Definition: McVtxFilterTool.h:73
McVtxFilterTool::McVtxFilterTool
McVtxFilterTool()
Default constructor:
McVtxFilterTool::m_fillTree
BooleanProperty m_fillTree
Switch to fill the entire tree from a decay vertex.
Definition: McVtxFilterTool.h:210
McVtxFilterTool::filterMcEventCollection
virtual void filterMcEventCollection(const McEventCollection *mcCollection, McEventCollection *filterColl)
Filter the McEventCollection according to the list of McVtxFilter embedded in this AlgTool,...
Definition: McVtxFilterTool.cxx:205
IMcVtxFilterTool
Definition: IMcVtxFilterTool.h:27
McVtxFilterTool::VtxType::Flag
Flag
Definition: McVtxFilterTool.h:80
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
GenVertex_fwd.h
AthAlgTool.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
McVtxFilterTool::m_matchBranches
BooleanArrayProperty m_matchBranches
Booleans to setup each of the McVtxFilter::matchBranch.
Definition: McVtxFilterTool.h:193
McEventCollection
This defines the McEventCollection, which is really just an ObjectVector of McEvent objects.
Definition: McEventCollection.h:33
DataVector< McVtxFilter >
McVtxFilterTool::m_decayPatterns
StringArrayProperty m_decayPatterns
Patterns of the decays to look for (ex: "23 -> -5 + 5" )
Definition: McVtxFilterTool.h:185
HepMC::ConstGenParticlePtr
const GenParticle * ConstGenParticlePtr
Definition: GenParticle.h:38
McVtxFilter.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
McVtxFilterTool::m_particles
LongArrayProperty m_particles
List of outgoing particles from the decay vertex to include.
Definition: McVtxFilterTool.h:214
McVtxFilterTool::~McVtxFilterTool
virtual ~McVtxFilterTool()
Destructor:
Definition: McVtxFilterTool.cxx:104
McVtxFilterTool::keepParticle
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 cho...
Definition: McVtxFilterTool.cxx:415
DataVector.h
An STL vector of pointers that by default owns its pointed-to elements.
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
IMcVtxFilterTool.h
HepMC::ConstGenVertexPtr
const HepMC::GenVertex * ConstGenVertexPtr
Definition: GenVertex.h:60
AthAlgTool
Definition: AthAlgTool.h:26
McVtxFilterTool::displayOptions
void displayOptions() const
Display the decay pattern of each McVtxFilter this Tool is embedding.
Definition: McVtxFilterTool.cxx:162
McVtxFilterTool::VtxType::IsRootVertex
@ IsRootVertex
Definition: McVtxFilterTool.h:82
McVtxFilterTool::setupFilters
void setupFilters(Gaudi::Details::PropertyBase &decayPatterns)
Callback method to ensure consistency of filters.
Definition: McVtxFilterTool.cxx:461