ATLAS Offline Software
xAODParentChildFilter.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 #ifndef GENERATORFILTERSXAODPARENTCHILDFILTER_H
5 #define GENERATORFILTERSXAODPARENTCHILDFILTER_H
6 
11 #include "xAODTruth/TruthEvent.h"
13 
17 public:
18 
19  xAODParentChildFilter(const std::string& name, ISvcLocator* pSvcLocator);
20  virtual StatusCode filterInitialize();
21  virtual StatusCode filterEvent();
22 
23 private:
24 
25  Gaudi::Property<double> m_PtMinParent{this,"PtMinParent",0.,"Min parent Pt"};
26  Gaudi::Property<double> m_PtMaxParent{this,"PtMaxParent",1e9,"Max parent Pt"};
27  Gaudi::Property<double> m_MassMinParent{this,"MassMinParent",-1e9,"Min parent mass"};
28  Gaudi::Property<double> m_MassMaxParent{this,"MassMaxParent",1e9,"Max parent mass"};
29  Gaudi::Property<std::vector<int>> m_PDGParent{this,"PDGParent",0,"PDG ID of parents"};
30  Gaudi::Property<double> m_EtaRangeParent{this,"EtaRangeParent",10.0,"Parent eta range"};
31  Gaudi::Property<std::vector<int>> m_PDGChild{this,"PDGChild",0,"PDG ID of child"};
32  Gaudi::Property<double> m_PtMinChild{this,"PtMinChild",0.,"Min child Pt"};
33  Gaudi::Property<double> m_EtaRangeChild{this,"EtaRangeChild",10.,"Child eta range"};
34 
35 
37  inline double getRapidity(HepMC::GenParticle*& p) {
38  double e = (p)->momentum().e();
39  double pz = (p)->momentum().pz();
40  if (e == pz) return 9999.;
41  if (e == -pz) return -9999.;
42  double rapidity = 0.5 * log((e + pz) / (e - pz));
43  return rapidity;
44  };
45 };
46 
47 #endif
xAODParentChildFilter::getRapidity
double getRapidity(HepMC::GenParticle *&p)
calculate the rapidity of a particle
Definition: xAODParentChildFilter.h:37
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
xAODParentChildFilter::filterInitialize
virtual StatusCode filterInitialize()
Definition: xAODParentChildFilter.cxx:14
TruthParticleContainer.h
GenFilter.h
xAODParentChildFilter::m_PtMinChild
Gaudi::Property< double > m_PtMinChild
Definition: xAODParentChildFilter.h:32
xAODParentChildFilter
Allows the user to search for any given decay Parent -> Child + X.
Definition: xAODParentChildFilter.h:16
xAODParentChildFilter::m_MassMinParent
Gaudi::Property< double > m_MassMinParent
Definition: xAODParentChildFilter.h:27
TruthParticleAuxContainer.h
GenFilter
Base class for event generator filtering modules.
Definition: GenFilter.h:30
xAODParentChildFilter::m_PtMinParent
Gaudi::Property< double > m_PtMinParent
Definition: xAODParentChildFilter.h:25
ParticleGun_EoverP_Config.momentum
momentum
Definition: ParticleGun_EoverP_Config.py:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
Amg::pz
@ pz
Definition: GeoPrimitives.h:40
xAODParentChildFilter::filterEvent
virtual StatusCode filterEvent()
Definition: xAODParentChildFilter.cxx:30
xAODParentChildFilter::m_PtMaxParent
Gaudi::Property< double > m_PtMaxParent
Definition: xAODParentChildFilter.h:26
xAODParentChildFilter::m_PDGParent
Gaudi::Property< std::vector< int > > m_PDGParent
Definition: xAODParentChildFilter.h:29
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
xAODParentChildFilter::m_PDGChild
Gaudi::Property< std::vector< int > > m_PDGChild
Definition: xAODParentChildFilter.h:31
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
xAODParentChildFilter::m_EtaRangeParent
Gaudi::Property< double > m_EtaRangeParent
Definition: xAODParentChildFilter.h:30
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
xAODParentChildFilter::xAODParentChildFilter
xAODParentChildFilter(const std::string &name, ISvcLocator *pSvcLocator)
Definition: xAODParentChildFilter.cxx:7
TruthParticle.h
TruthEventContainer.h
xAODParentChildFilter::m_EtaRangeChild
Gaudi::Property< double > m_EtaRangeChild
Definition: xAODParentChildFilter.h:33
xAODParentChildFilter::m_MassMaxParent
Gaudi::Property< double > m_MassMaxParent
Definition: xAODParentChildFilter.h:28
TruthEvent.h
GenParticle
@ GenParticle
Definition: TruthClasses.h:30