ATLAS Offline Software
GeneratorSelector.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef GeneratorPhysVal_GeneratorSelector_H
6 #define GeneratorPhysVal_GeneratorSelector_H
7 
8 
9 #include <vector>
10 #include <TLorentzVector.h>
13 
15 {
16  public:
17 
18  GeneratorSelector() = default;
19  ~GeneratorSelector() = default;
20 
21  enum class CUT_STATUS {YES,NO};
22  const std::vector< TLorentzVector > GetGeneratorLevel(const xAOD::TruthParticleContainer *cont)
23  {
24  std::vector< TLorentzVector > generic_stable_parton;
25 
26  for(const auto& vcont: *cont){
27  if (!(MC::isGenStable(vcont))) continue;
28  TLorentzVector tlv (vcont->px(), vcont->py(), vcont->pz(), vcont->e());
29  generic_stable_parton.push_back(tlv);
30  }
31 
32  return generic_stable_parton;
33  }
34 
35  const std::vector< TLorentzVector > GetSimulationLevel(const xAOD::TruthParticleContainer *cont)
36  {
37  std::vector< TLorentzVector > generic_stable_parton;
38 
39  for(const auto& vcont: *cont){
40  if (!(MC::isSimStable(vcont))) continue;
41  TLorentzVector tlv (vcont->px(), vcont->py(), vcont->pz(), vcont->e());
42  generic_stable_parton.push_back(tlv);
43 
44  }
45 
46  return generic_stable_parton;
47  }
48 
49 };
50 
51 #endif
GeneratorSelector::GetGeneratorLevel
const std::vector< TLorentzVector > GetGeneratorLevel(const xAOD::TruthParticleContainer *cont)
Definition: GeneratorSelector.h:22
GeneratorSelector::GeneratorSelector
GeneratorSelector()=default
GeneratorSelector::GetSimulationLevel
const std::vector< TLorentzVector > GetSimulationLevel(const xAOD::TruthParticleContainer *cont)
Definition: GeneratorSelector.h:35
TruthParticleContainer.h
MC::isGenStable
bool isGenStable(const T &p)
Determine if the particle is stable at the generator (not det-sim) level,.
Definition: HepMCHelpers.h:54
GeneratorSelector::CUT_STATUS::NO
@ NO
GeneratorSelector::~GeneratorSelector
~GeneratorSelector()=default
GeneratorSelector::CUT_STATUS
CUT_STATUS
Definition: GeneratorSelector.h:21
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
GeneratorSelector::CUT_STATUS::YES
@ YES
MC::isSimStable
bool isSimStable(const T &p)
Identify if the particle is considered stable at the post-detector-sim stage.
Definition: HepMCHelpers.h:57
GeneratorSelector
Definition: GeneratorSelector.h:15
HepMCHelpers.h