ATLAS Offline Software
EtaPtFilterTool.h
Go to the documentation of this file.
1 
3 /*
4  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // EtaPtFilterTool.h
8 // Header file for class EtaPtFilterTool
9 // Author: S.Binet<binet@cern.ch>
11 #ifndef MCPARTICLETOOLS_ETAPTFILTERTOOL_H
12 #define MCPARTICLETOOLS_ETAPTFILTERTOOL_H 1
13 
14 // STL includes
15 #include <string>
16 #include <map>
17 
18 // McParticleTools includes
20 
21 // Forward declaration
22 
24 {
25 
26  public:
27 
28  // Copy constructor:
29 
31  EtaPtFilterTool( const std::string& type,
32  const std::string& name,
33  const IInterface* parent );
34 
36  virtual ~EtaPtFilterTool();
37 
38 
40  // Non-const methods:
42 
48 
50  // Protected methods:
52  protected:
53  using ParticleMap_t = std::unordered_map<const HepMC::GenParticle*,
55  using VertexMap_t = std::unordered_map<const HepMC::GenVertex*,
57 
61 
63  // Const methods:
65 
70  StatusCode buildGenEvent( const HepMC::GenEvent* in, HepMC::GenEvent* out );
71 
74  bool isAccepted( const HepMC::ConstGenParticlePtr& mcPart ) const;
75 
79  bool isAccepted( const HepMC::ConstGenVertexPtr& vtx ) const;
80 
83  StatusCode addVertex( const HepMC::ConstGenVertexPtr& srcVtx, HepMC::GenEvent* evt,
84  VertexMap_t& vmap,
85  ParticleMap_t& pmap,
86  bool isSignalVertex = false ) const;
87 
88 
89  bool isPartonVertex( const HepMC::ConstGenVertexPtr& vtx ) const;
90  bool isFromHardScattering( const HepMC::ConstGenVertexPtr& vtx ) const;
91 
93  // Non-const methods:
95 
100 
103  void setupInnerEtaRegionCuts( Gaudi::Details::PropertyBase& innerEtaRegionCuts );
104 
107  void setupOuterEtaRegionCuts( Gaudi::Details::PropertyBase& outerEtaRegionCuts );
108 
110  // Protected data:
112  protected:
113 
119  DoubleArrayProperty m_innerEtaRegionCuts;
120 
126  DoubleArrayProperty m_outerEtaRegionCuts;
127 
131  BooleanProperty m_onlyGenerator;
132 
137 
141  BooleanProperty m_keepDocumentaries;
142 
145  BooleanProperty m_keepAllLeptons;
146 
147 
148  /* For the isolation */
149  std::map<int,double> m_isol_energies;
150 
151 };
152 
153 
154 #endif //> MCPARTICLETOOLS_ETAPTFILTERTOOL_H
HepMC::GenVertexPtr
HepMC::GenVertex * GenVertexPtr
Definition: GenVertex.h:59
EtaPtFilterTool::isPartonVertex
bool isPartonVertex(const HepMC::ConstGenVertexPtr &vtx) const
Definition: EtaPtFilterTool.cxx:423
EtaPtFilterTool::isFromHardScattering
bool isFromHardScattering(const HepMC::ConstGenVertexPtr &vtx) const
Definition: EtaPtFilterTool.cxx:447
TruthParticleFilterBaseTool.h
HepMC::GenParticlePtr
GenParticle * GenParticlePtr
Definition: GenParticle.h:37
EtaPtFilterTool::setupInnerEtaRegionCuts
void setupInnerEtaRegionCuts(Gaudi::Details::PropertyBase &innerEtaRegionCuts)
Callback function to setup the "InnerEtaRegionCuts" property.
Definition: EtaPtFilterTool.cxx:503
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
EtaPtFilterTool::addVertex
StatusCode addVertex(const HepMC::ConstGenVertexPtr &srcVtx, HepMC::GenEvent *evt, VertexMap_t &vmap, ParticleMap_t &pmap, bool isSignalVertex=false) const
Helper method to copy a given vertex and add it to a GenEvent.
Definition: EtaPtFilterTool.cxx:295
LArG4FSStartPointFilter.evt
evt
Definition: LArG4FSStartPointFilter.py:42
EtaPtFilterTool::VertexMap_t
std::unordered_map< const HepMC::GenVertex *, HepMC::GenVertexPtr > VertexMap_t
Definition: EtaPtFilterTool.h:56
EtaPtFilterTool::~EtaPtFilterTool
virtual ~EtaPtFilterTool()
Destructor:
Definition: EtaPtFilterTool.cxx:105
EtaPtFilterTool::EtaPtFilterTool
EtaPtFilterTool()
Default constructor:
EtaPtFilterTool::m_innerEtaRegionCuts
DoubleArrayProperty m_innerEtaRegionCuts
vector of cuts parameters for the inner region delimited in |eta| 0-th element is the minimum |eta| o...
Definition: EtaPtFilterTool.h:119
EtaPtFilterTool::initializeTool
StatusCode initializeTool()
Method to initialize the tool: we need to check the validity of the parameters given for the inner an...
Definition: EtaPtFilterTool.cxx:465
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
EtaPtFilterTool::m_outerEtaRegionCuts
DoubleArrayProperty m_outerEtaRegionCuts
vector of cuts parameters for the outer region delimited in |eta| 0-th element is the minimum |eta| o...
Definition: EtaPtFilterTool.h:126
test_pyathena.parent
parent
Definition: test_pyathena.py:15
EtaPtFilterTool::m_isol_energies
std::map< int, double > m_isol_energies
Definition: EtaPtFilterTool.h:149
McEventCollection
This defines the McEventCollection, which is really just an ObjectVector of McEvent objects.
Definition: McEventCollection.h:33
EtaPtFilterTool::m_onlyGenerator
BooleanProperty m_onlyGenerator
Switch to only include particles from generation and reject particles from detector simulation (Geant...
Definition: EtaPtFilterTool.h:131
EtaPtFilterTool::m_keepDocumentaries
BooleanProperty m_keepDocumentaries
Switch to keep all generator particles which are documentaries (statuscode == 3)
Definition: EtaPtFilterTool.h:141
TruthParticleFilterBaseTool
Definition: TruthParticleFilterBaseTool.h:33
HepMC::ConstGenParticlePtr
const GenParticle * ConstGenParticlePtr
Definition: GenParticle.h:38
EtaPtFilterTool::isAccepted
bool isAccepted(const HepMC::ConstGenParticlePtr &mcPart) const
Check if a given particle is within the acceptance (pt+eta)
Definition: EtaPtFilterTool.cxx:191
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
EtaPtFilterTool::buildMcAod
StatusCode buildMcAod(const McEventCollection *in, McEventCollection *out)
This method will check the validity of the input McEventCollection and build a filtered one from the ...
Definition: EtaPtFilterTool.cxx:111
EtaPtFilterTool::buildGenEvent
StatusCode buildGenEvent(const HepMC::GenEvent *in, HepMC::GenEvent *out)
This method will check the validity of the input HepMC::GenEvent and build a filtered one from the st...
Definition: EtaPtFilterTool.cxx:155
EtaPtFilterTool::ParticleMap_t
std::unordered_map< const HepMC::GenParticle *, HepMC::GenParticlePtr > ParticleMap_t
Definition: EtaPtFilterTool.h:54
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
EtaPtFilterTool
Definition: EtaPtFilterTool.h:24
HepMC::ConstGenVertexPtr
const HepMC::GenVertex * ConstGenVertexPtr
Definition: GenVertex.h:60
EtaPtFilterTool::m_keepAllLeptons
BooleanProperty m_keepAllLeptons
Switch to keep all leptons - i.e.
Definition: EtaPtFilterTool.h:145
EtaPtFilterTool::setupOuterEtaRegionCuts
void setupOuterEtaRegionCuts(Gaudi::Details::PropertyBase &outerEtaRegionCuts)
Callback function to setup the "OuterEtaRegionCuts" property.
Definition: EtaPtFilterTool.cxx:508
GenParticle
@ GenParticle
Definition: TruthClasses.h:30
EtaPtFilterTool::m_butKeepAllGeneratorStable
BooleanProperty m_butKeepAllGeneratorStable
Switch to keep all stable generator particles (IsGenStable) regardless what eta or pt cuts are define...
Definition: EtaPtFilterTool.h:136