ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
DerivationFramework::SUSYGenFilterTool Class Reference

#include <SUSYGenFilterTool.h>

Inheritance diagram for DerivationFramework::SUSYGenFilterTool:
Collaboration diagram for DerivationFramework::SUSYGenFilterTool:

Public Member Functions

 SUSYGenFilterTool (const std::string &t, const std::string &n, const IInterface *p)
 
 ~SUSYGenFilterTool ()
 
virtual StatusCode initialize () override
 
virtual StatusCode addBranches () const override
 
StatusCode getGenFiltVars (const xAOD::TruthParticleContainer *tpc, float &genFiltHT, float &genFiltMET) const
 
bool isPrompt (const xAOD::TruthParticle *tp) const
 
MCTruthPartClassifier::ParticleOrigin getPartOrigin (const xAOD::TruthParticle *tp) const
 

Private Attributes

std::string m_eventInfoName
 
std::string m_mcName
 
std::string m_truthJetsName
 
float m_MinJetPt
 Min pT for the truth jets. More...
 
float m_MaxJetEta
 Max eta for the truth jets. More...
 
float m_MinLepPt
 Min pT for the truth leptons. More...
 
float m_MaxLepEta
 Max eta for the truth leptons. More...
 
ToolHandle< IMCTruthClassifierm_classif
 

Detailed Description

Definition at line 28 of file SUSYGenFilterTool.h.

Constructor & Destructor Documentation

◆ SUSYGenFilterTool()

DerivationFramework::SUSYGenFilterTool::SUSYGenFilterTool ( const std::string &  t,
const std::string &  n,
const IInterface *  p 
)

Definition at line 19 of file SUSYGenFilterTool.cxx.

19  :
20  base_class(t,n,p),
21  m_classif("MCTruthClassifier/SUSYGenFilt_MCTruthClassifier")
22  {
23 
24 
25  declareProperty("EventInfoName",m_eventInfoName="EventInfo");
26  declareProperty("MCCollectionName",m_mcName="TruthParticles");
27  declareProperty("TruthJetCollectionName",m_truthJetsName="AntiKt4TruthWZJets");
28  declareProperty("MinJetPt",m_MinJetPt = 35e3);
29  declareProperty("MaxJetEta",m_MaxJetEta = 2.5);
30  declareProperty("MinLeptonPt",m_MinLepPt = 25e3);
31  declareProperty("MaxLeptonEta",m_MaxLepEta = 2.5);
32  }

◆ ~SUSYGenFilterTool()

DerivationFramework::SUSYGenFilterTool::~SUSYGenFilterTool ( )

Definition at line 34 of file SUSYGenFilterTool.cxx.

34 {}

Member Function Documentation

◆ addBranches()

StatusCode DerivationFramework::SUSYGenFilterTool::addBranches ( ) const
overridevirtual

Definition at line 72 of file SUSYGenFilterTool.cxx.

72  {
73  ATH_MSG_VERBOSE("SUSYGenFilterTool::addBranches()");
74 
76  if (evtStore()->retrieve(eventInfo,m_eventInfoName).isFailure()) {
77  ATH_MSG_ERROR("could not retrieve event info " <<m_eventInfoName);
78  return StatusCode::FAILURE;
79  }
80 
81  const xAOD::TruthParticleContainer* truthPC = 0;
82  if (evtStore()->retrieve(truthPC,m_mcName).isFailure()) {
83  ATH_MSG_ERROR("WARNING could not retrieve TruthParticleContainer " <<m_mcName);
84  return StatusCode::FAILURE;
85  }
86 
87  float genFiltHT(0.), genFiltMET(0.);
88  ATH_CHECK( getGenFiltVars(truthPC, genFiltHT, genFiltMET) );
89 
90  ATH_MSG_DEBUG("Computed generator filter quantities: HT " << genFiltHT/1e3 << ", MET " << genFiltMET/1e3 );
91 
92  dec_genFiltHT(*eventInfo) = genFiltHT;
93  dec_genFiltMET(*eventInfo) = genFiltMET;
94 
95  return StatusCode::SUCCESS;
96  }

◆ getGenFiltVars()

StatusCode DerivationFramework::SUSYGenFilterTool::getGenFiltVars ( const xAOD::TruthParticleContainer tpc,
float &  genFiltHT,
float &  genFiltMET 
) const

Definition at line 98 of file SUSYGenFilterTool.cxx.

98  {
99  // Get jet container out
100  const xAOD::JetContainer* truthjets = 0;
101  if ( evtStore()->retrieve( truthjets, m_truthJetsName).isFailure() || !truthjets ){
102  ATH_MSG_ERROR( "No xAOD::JetContainer found in StoreGate with key " << m_truthJetsName );
103  return StatusCode::FAILURE;
104  }
105 
106  // Get HT
107  genFiltHT = -1;
108  for (const auto tj : *truthjets) {
109  if ( tj->pt()>m_MinJetPt && fabs(tj->eta())<m_MaxJetEta ) {
110  ATH_MSG_VERBOSE("Adding truth jet with pt " << tj->pt()
111  << ", eta " << tj->eta()
112  << ", phi " << tj->phi()
113  << ", nconst = " << tj->numConstituents());
114  genFiltHT += tj->pt();
115  }
116  }
117 
118  float MEx(0.), MEy(0.);
119  for (const auto tp : *tpc){
120  int pdgid = tp->pdgId();
121  if (HepMC::is_simulation_particle(tp)) continue; // Particle is from G4
122  if (MC::isZeroEnergyPhoton(tp)) continue; // Work around for an old generator bug
123  if ( !MC::isStable(tp) ) continue; // Stable!
124 
125  if ((MC::isElectron(pdgid) || MC::isMuon(pdgid)) && tp->pt()>m_MinLepPt && std::fabs(tp->eta())<m_MaxLepEta) {
126  if( isPrompt(tp) ) {
127  ATH_MSG_VERBOSE("Adding prompt lepton " << tp);
128  genFiltHT += tp->pt();
129  }
130  }
131 
133  ATH_MSG_VERBOSE("Found prompt nonInteracting particle " << tp);
134  MEx += tp->px();
135  MEy += tp->py();
136  }
137  }
138  genFiltMET = std::sqrt(MEx*MEx+MEy*MEy);
139 
140  return StatusCode::SUCCESS;
141  }

◆ getPartOrigin()

MCTruthPartClassifier::ParticleOrigin DerivationFramework::SUSYGenFilterTool::getPartOrigin ( const xAOD::TruthParticle tp) const

◆ initialize()

StatusCode DerivationFramework::SUSYGenFilterTool::initialize ( )
overridevirtual

Definition at line 36 of file SUSYGenFilterTool.cxx.

36  {
37  ATH_MSG_INFO("Initialize " );
38  return StatusCode::SUCCESS;
39  }

◆ isPrompt()

bool DerivationFramework::SUSYGenFilterTool::isPrompt ( const xAOD::TruthParticle tp) const

Definition at line 41 of file SUSYGenFilterTool.cxx.

42  {
43  ParticleOrigin orig = m_classif->particleTruthClassifier( tp ).second;
44  ATH_MSG_VERBOSE("Particle has origin " << orig);
45 
46  switch(orig) {
47  case PhotonConv:
48  case DalitzDec:
49  case ElMagProc:
50  case Mu:
51  case TauLep:
52  case LightMeson:
53  case StrangeMeson:
54  case CharmedMeson:
55  case BottomMeson:
56  case CCbarMeson:
57  case JPsi:
58  case BBbarMeson:
59  case LightBaryon:
60  case StrangeBaryon:
61  case CharmedBaryon:
62  case BottomBaryon:
63  case PionDecay:
64  case KaonDecay:
65  return false;
66  default:
67  break;
68  }
69  return true;
70  }

Member Data Documentation

◆ m_classif

ToolHandle<IMCTruthClassifier> DerivationFramework::SUSYGenFilterTool::m_classif
private

Definition at line 52 of file SUSYGenFilterTool.h.

◆ m_eventInfoName

std::string DerivationFramework::SUSYGenFilterTool::m_eventInfoName
private

Definition at line 43 of file SUSYGenFilterTool.h.

◆ m_MaxJetEta

float DerivationFramework::SUSYGenFilterTool::m_MaxJetEta
private

Max eta for the truth jets.

Definition at line 48 of file SUSYGenFilterTool.h.

◆ m_MaxLepEta

float DerivationFramework::SUSYGenFilterTool::m_MaxLepEta
private

Max eta for the truth leptons.

Definition at line 50 of file SUSYGenFilterTool.h.

◆ m_mcName

std::string DerivationFramework::SUSYGenFilterTool::m_mcName
private

Definition at line 44 of file SUSYGenFilterTool.h.

◆ m_MinJetPt

float DerivationFramework::SUSYGenFilterTool::m_MinJetPt
private

Min pT for the truth jets.

Definition at line 47 of file SUSYGenFilterTool.h.

◆ m_MinLepPt

float DerivationFramework::SUSYGenFilterTool::m_MinLepPt
private

Min pT for the truth leptons.

Definition at line 49 of file SUSYGenFilterTool.h.

◆ m_truthJetsName

std::string DerivationFramework::SUSYGenFilterTool::m_truthJetsName
private

Definition at line 45 of file SUSYGenFilterTool.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
TauLep
@ TauLep
Definition: TruthClasses.h:63
StrangeMeson
@ StrangeMeson
Definition: TruthClasses.h:80
DerivationFramework::SUSYGenFilterTool::isPrompt
bool isPrompt(const xAOD::TruthParticle *tp) const
Definition: SUSYGenFilterTool.cxx:41
Mu
@ Mu
Definition: TruthClasses.h:62
BBbarMeson
@ BBbarMeson
Definition: TruthClasses.h:85
BottomMeson
@ BottomMeson
Definition: TruthClasses.h:82
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
DerivationFramework::SUSYGenFilterTool::m_MinJetPt
float m_MinJetPt
Min pT for the truth jets.
Definition: SUSYGenFilterTool.h:47
MC::isSpecialNonInteracting
bool isSpecialNonInteracting(const T &p)
Identify a special non-interacting particles.
Definition: HepMCHelpers.h:83
PionDecay
@ PionDecay
Definition: TruthClasses.h:90
ElMagProc
@ ElMagProc
Definition: TruthClasses.h:61
DerivationFramework::SUSYGenFilterTool::m_MinLepPt
float m_MinLepPt
Min pT for the truth leptons.
Definition: SUSYGenFilterTool.h:49
ParticleTest.tp
tp
Definition: ParticleTest.py:25
PhotonConv
@ PhotonConv
Definition: TruthClasses.h:59
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
CCbarMeson
@ CCbarMeson
Definition: TruthClasses.h:83
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
CharmedBaryon
@ CharmedBaryon
Definition: TruthClasses.h:88
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
CheckAppliedSFs.e3
e3
Definition: CheckAppliedSFs.py:264
HepMC::is_simulation_particle
bool is_simulation_particle(const T &p)
Method to establish if a particle (or barcode) was created during the simulation (TODO update to be s...
Definition: MagicNumbers.h:355
DerivationFramework::SUSYGenFilterTool::m_mcName
std::string m_mcName
Definition: SUSYGenFilterTool.h:44
beamspotman.n
n
Definition: beamspotman.py:731
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ParticleOrigin
ParticleOrigin
Definition: TruthClasses.h:51
xAOD::EgammaHelpers::isElectron
bool isElectron(const xAOD::Egamma *eg)
is the object an electron (not Fwd)
Definition: EgammaxAODHelpers.cxx:12
StrangeBaryon
@ StrangeBaryon
Definition: TruthClasses.h:87
LightMeson
@ LightMeson
Definition: TruthClasses.h:79
DerivationFramework::SUSYGenFilterTool::m_MaxLepEta
float m_MaxLepEta
Max eta for the truth leptons.
Definition: SUSYGenFilterTool.h:50
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
JPsi
@ JPsi
Definition: TruthClasses.h:84
CharmedMeson
@ CharmedMeson
Definition: TruthClasses.h:81
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
DerivationFramework::SUSYGenFilterTool::m_MaxJetEta
float m_MaxJetEta
Max eta for the truth jets.
Definition: SUSYGenFilterTool.h:48
BottomBaryon
@ BottomBaryon
Definition: TruthClasses.h:89
columnar::ContainerId::eventInfo
@ eventInfo
LightBaryon
@ LightBaryon
Definition: TruthClasses.h:86
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
MC::isStable
bool isStable(const T &p)
Identify if the particle is stable, i.e. has not decayed.
Definition: HepMCHelpers.h:45
DerivationFramework::SUSYGenFilterTool::m_truthJetsName
std::string m_truthJetsName
Definition: SUSYGenFilterTool.h:45
DerivationFramework::SUSYGenFilterTool::m_classif
ToolHandle< IMCTruthClassifier > m_classif
Definition: SUSYGenFilterTool.h:52
DalitzDec
@ DalitzDec
Definition: TruthClasses.h:60
MC::isZeroEnergyPhoton
bool isZeroEnergyPhoton(const T &p)
Identify a photon with zero energy. Probably a workaround for a generator bug.
Definition: HepMCHelpers.h:71
DerivationFramework::SUSYGenFilterTool::getGenFiltVars
StatusCode getGenFiltVars(const xAOD::TruthParticleContainer *tpc, float &genFiltHT, float &genFiltMET) const
Definition: SUSYGenFilterTool.cxx:98
KaonDecay
@ KaonDecay
Definition: TruthClasses.h:91
DerivationFramework::SUSYGenFilterTool::m_eventInfoName
std::string m_eventInfoName
Definition: SUSYGenFilterTool.h:43
isMuon
bool isMuon(const T &p)
Definition: AtlasPID.h:194