ATLAS Offline Software
Loading...
Searching...
No Matches
MissingEtTruth.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3*/
4
5/********************************************************************
6
7NAME: MissingEtTruth.cxx
8PACKAGE: offline/Reconstruction/MissingETEvent
9
10AUTHORS: P. Loch, S. Resconi
11CREATED: Oct 2004
12
13PURPOSE:
14********************************************************************/
18
19#include "CLHEP/Vector/LorentzVector.h"
20#include "CLHEP/Units/SystemOfUnits.h"
22
23
28
34
36 MissingEtRegions* aRegion)
37 : MissingET(aSource,aRegion)
38{
39 this->setup();
40}
41
46
48{
49
50 double weight = 1.;
51 double exp = (Part)->momentum().px();
52 double eyp = (Part)->momentum().py();
53 double etp = (Part)->momentum().perp();
54 double etap = (Part)->momentum().pseudoRapidity();
55 int idp = (Part)->pdg_id();
56
57 TruthIndex thePart = NotValid;
58
59 if ( ! MC::isSimInteracting(Part) ) // if IsGenNonInteracting returns true
60 {
61 thePart = NonInt; // all NON interacting particles (neutrinos + SUSY particles)
62 m_exTruth[NonInt] += exp;
63 m_eyTruth[NonInt] += eyp;
64 m_etSumTruth[NonInt] += etp;
65
66 } else {
67 if (abs(idp) != 13) // all interacting particles and NO muons
68 {
69 if( fabs(etap) <= 5.) {
70 // update the global sums and eta regions in eta <= 5
71 this->add(exp, eyp, etp, etap, weight);
72 m_exTruth[Int] -= exp;
73 m_eyTruth[Int] -= eyp;
74 m_etSumTruth[Int] += etp;
75 //thePart = Int;
76 }
77 if( fabs(etap) <= etaFull) thePart = IntCentral;
78 if( fabs(etap) > etaFull && fabs(etap) <= 5.) thePart = IntFwd;
79 if( fabs(etap) > 5.) thePart = IntOutCover;
80 } else {
81 //if (etp > 6000. && fabs(etap) <= 2.5) // select "measurable" muons
82 //{
83 thePart = Muons; // all muons
84 //}
85 }
86
87 if (thePart != NotValid) { // Can be == if etap is a nan !! Fixed by Scott Snyder
88 m_exTruth[(size_t)thePart] -= exp;
89 m_eyTruth[(size_t)thePart] -= eyp;
90 m_etSumTruth[(size_t)thePart] += etp;
91 }
92
93 }
94
95
96
97}
98
99
100//set methods
101
103 double theEx)
104{
105 if ( theTruth < Size ) m_exTruth[(size_t)theTruth] = theEx;
106}
107
108
110 double theEy)
111{
112 if ( theTruth < Size ) m_eyTruth[(size_t)theTruth] = theEy;
113}
114
115
117 double theEtSum)
118{
119 if ( theTruth < Size ) m_etSumTruth[(size_t)theTruth] = theEtSum;
120
121}
122
123
124void MissingEtTruth::setExTruthVec(std::vector<double>&& exTruthVec)
125{
126 assert (exTruthVec.size() == Size);
127 m_exTruth = std::move (exTruthVec);
128}
129
130
131void MissingEtTruth::setEyTruthVec(std::vector<double>&& eyTruthVec)
132{
133 assert (eyTruthVec.size() == Size);
134 m_eyTruth = std::move (eyTruthVec);
135}
136
137
139{
140 assert (etSumTruthVec.size() == Size);
141 m_etSumTruth = std::move (etSumTruthVec);
142}
143
144
145// get methods
146
148{
149 return m_exTruth[theTruth] ;
150}
151
153{
154 return m_eyTruth[theTruth] ;
155}
156
158{
159 return m_etSumTruth[theTruth] ;
160}
161
162
163const std::vector<double>& MissingEtTruth::exTruthVec() const
164{
165 return m_exTruth;
166}
167
168
169const std::vector<double>& MissingEtTruth::eyTruthVec() const
170{
171 return m_eyTruth;
172}
173
174
175const std::vector<double>& MissingEtTruth::etSumTruthVec() const
176{
177 return m_etSumTruth;
178}
179
180
182{
183 // initialize data members
184
188}
189
ATLAS-specific HepMC functions.
virtual void add(double theEx, double theEy, double theEt, double theEta, double weight)
std::vector< double > m_exTruth
void setExTruthVec(std::vector< double > &&exCaloVec)
virtual ~MissingEtTruth()
void setEtSumTruthVec(std::vector< double > &&etSumCaloVec)
std::vector< double > m_eyTruth
double exTruth(TruthIndex aTruth) const
void addPart(HepMC::ConstGenParticlePtr aPart, double etaFull)
void setEyTruth(TruthIndex aTruth, double theEy)
std::vector< double > m_etSumTruth
double etSumTruth(TruthIndex aTruth) const
void setEtSumTruth(TruthIndex aTruth, double theEtSum)
const std::vector< double > & eyTruthVec() const
void setEyTruthVec(std::vector< double > &&exCaloVec)
const std::vector< double > & exTruthVec() const
double eyTruth(TruthIndex aTruth) const
void setExTruth(TruthIndex aTruth, double theEx)
const std::vector< double > & etSumTruthVec() const
const GenParticle * ConstGenParticlePtr
Definition GenParticle.h:38
bool isSimInteracting(const T &p)
Identify if the particle could interact with the detector during the simulation, e....
Definition Muons.py:1