ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
PhysicsValidation
GeneratorPhysVal
src
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>
11
#include "
xAODTruth/TruthParticleContainer.h
"
12
#include "
TruthUtils/HepMCHelpers.h
"
13
14
class
GeneratorSelector
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
TruthParticleContainer.h
HepMCHelpers.h
ATLAS-specific HepMC functions.
GeneratorSelector::GeneratorSelector
GeneratorSelector()=default
GeneratorSelector::GetSimulationLevel
const std::vector< TLorentzVector > GetSimulationLevel(const xAOD::TruthParticleContainer *cont)
Definition
GeneratorSelector.h:35
GeneratorSelector::~GeneratorSelector
~GeneratorSelector()=default
GeneratorSelector::CUT_STATUS
CUT_STATUS
Definition
GeneratorSelector.h:21
GeneratorSelector::CUT_STATUS::YES
@ YES
Definition
GeneratorSelector.h:21
GeneratorSelector::CUT_STATUS::NO
@ NO
Definition
GeneratorSelector.h:21
GeneratorSelector::GetGeneratorLevel
const std::vector< TLorentzVector > GetGeneratorLevel(const xAOD::TruthParticleContainer *cont)
Definition
GeneratorSelector.h:22
MC::isGenStable
bool isGenStable(const T &p)
Determine if the particle is stable at the generator (not det-sim) level,.
Definition
HepMCHelpers.h:55
MC::isSimStable
bool isSimStable(const T &p)
Identify if the particle is considered stable at the post-detector-sim stage.
Definition
HepMCHelpers.h:58
xAOD::TruthParticleContainer
TruthParticleContainer_v1 TruthParticleContainer
Declare the latest version of the truth particle container.
Definition
Event/xAOD/xAODTruth/xAODTruth/TruthParticleContainer.h:17
Generated on
for ATLAS Offline Software by
1.17.0