ATLAS Offline Software
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
MissingEtTruth Class Reference

#include <MissingEtTruth.h>

Inheritance diagram for MissingEtTruth:
Collaboration diagram for MissingEtTruth:

Public Types

enum  TruthIndex {
  Int = 0, NonInt = 1, IntCentral = 2, IntFwd = 3,
  IntOutCover = 4, Muons = 5, Size = 6, NotValid = 999
}
 
enum  Source {
  Calo = 0, Calib = 1, Truth = 2, Muon = 3,
  CaloRaw = 4, Final = 5, Cryo = 6, Topo = 7,
  Ref = 8, DeadMaterial = 9, Track = 10, ObjElectron = 100,
  ObjMuon = 101, ObjJet = 102, ObjIdTrk = 103, ObjMiniJet = 104,
  ObjRest = 105, ObjFinal = 106, Unknown = 999
}
 

Public Member Functions

 MissingEtTruth ()
 
 MissingEtTruth (MissingEtRegions *aRegion)
 
 MissingEtTruth (MissingET::Source aSource, MissingEtRegions *aRegion)
 
virtual ~MissingEtTruth ()
 
void addPart (HepMC::ConstGenParticlePtr aPart, double etaFull)
 
void setExTruth (TruthIndex aTruth, double theEx)
 
void setEyTruth (TruthIndex aTruth, double theEy)
 
void setEtSumTruth (TruthIndex aTruth, double theEtSum)
 
void setExTruthVec (std::vector< double > &&exCaloVec)
 
void setEyTruthVec (std::vector< double > &&exCaloVec)
 
void setEtSumTruthVec (std::vector< double > &&etSumCaloVec)
 
double exTruth (TruthIndex aTruth) const
 
double eyTruth (TruthIndex aTruth) const
 
double etSumTruth (TruthIndex aTruth) const
 
const std::vector< double > & exTruthVec () const
 
const std::vector< double > & eyTruthVec () const
 
const std::vector< double > & etSumTruthVec () const
 
virtual void setEx (double theEx)
 
virtual void setEy (double theEy)
 
virtual void setEtSum (double theSum)
 
virtual void add (double theEx, double theEy, double theEt, double theEta, double weight)
 
virtual double etx () const
 
virtual double ety () const
 
virtual double sumet () const
 
virtual double et () const
 
virtual double phi () const
 
virtual const MissingEtRegionsgetRegions () const
 
virtual Source getSource () const
 

Protected Member Functions

void setup ()
 

Protected Attributes

std::vector< double > m_exTruth
 
std::vector< double > m_eyTruth
 
std::vector< double > m_etSumTruth
 
std::unique_ptr< MissingEtRegionsm_regions
 
Source m_source
 
double m_ex
 
double m_ey
 
double m_etSum
 

Detailed Description

Definition at line 27 of file MissingEtTruth.h.

Member Enumeration Documentation

◆ Source

enum MissingET::Source
inherited
Enumerator
Calo 
Calib 
Truth 
Muon 
CaloRaw 
Final 
Cryo 
Topo 
Ref 
DeadMaterial 
Track 
ObjElectron 
ObjMuon 
ObjJet 
ObjIdTrk 
ObjMiniJet 
ObjRest 
ObjFinal 
Unknown 

Definition at line 37 of file Reconstruction/MissingETEvent/MissingETEvent/MissingET.h.

◆ TruthIndex

Enumerator
Int 
NonInt 
IntCentral 
IntFwd 
IntOutCover 
Muons 
Size 
NotValid 

Definition at line 40 of file MissingEtTruth.h.

Constructor & Destructor Documentation

◆ MissingEtTruth() [1/3]

MissingEtTruth::MissingEtTruth ( )

Definition at line 24 of file MissingEtTruth.cxx.

25 {
26  this->setup();
27 }

◆ MissingEtTruth() [2/3]

MissingEtTruth::MissingEtTruth ( MissingEtRegions aRegion)

Definition at line 29 of file MissingEtTruth.cxx.

30  : MissingET(MissingET::Truth,aRegion)
31 {
32  this->setup();
33 }

◆ MissingEtTruth() [3/3]

MissingEtTruth::MissingEtTruth ( MissingET::Source  aSource,
MissingEtRegions aRegion 
)

Definition at line 35 of file MissingEtTruth.cxx.

37  : MissingET(aSource,aRegion)
38 {
39  this->setup();
40 }

◆ ~MissingEtTruth()

MissingEtTruth::~MissingEtTruth ( )
virtual

Definition at line 42 of file MissingEtTruth.cxx.

43 {
44  this->setup();
45 }

Member Function Documentation

◆ add()

void MissingET::add ( double  theEx,
double  theEy,
double  theEt,
double  theEta,
double  weight 
)
virtualinherited

Definition at line 127 of file MissingET.cxx.

129 {
130  // Note the minus sign! We want to calculate missing ET
131  m_ex -= theEx * weight;
132  m_ey -= theEy * weight;
133  m_etSum += theEt * weight;
134 
135  // regions
136  if ( m_regions != 0 ) m_regions->addReg(theEx, theEy, theEt, theEta, weight);
137 }

◆ addPart()

void MissingEtTruth::addPart ( HepMC::ConstGenParticlePtr  aPart,
double  etaFull 
)

Definition at line 47 of file MissingEtTruth.cxx.

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 }

◆ et()

double MissingET::et ( ) const
virtualinherited

Definition at line 153 of file MissingET.cxx.

154 {
155  return sqrt(m_ex*m_ex + m_ey*m_ey);
156 }

◆ etSumTruth()

double MissingEtTruth::etSumTruth ( MissingEtTruth::TruthIndex  theTruth) const

Definition at line 157 of file MissingEtTruth.cxx.

158 {
159  return m_etSumTruth[theTruth] ;
160 }

◆ etSumTruthVec()

const std::vector< double > & MissingEtTruth::etSumTruthVec ( ) const

Definition at line 175 of file MissingEtTruth.cxx.

176 {
177  return m_etSumTruth;
178 }

◆ etx()

double MissingET::etx ( ) const
virtualinherited

Definition at line 141 of file MissingET.cxx.

142 {
143  return m_ex;
144 }

◆ ety()

double MissingET::ety ( ) const
virtualinherited

Definition at line 145 of file MissingET.cxx.

146 {
147  return m_ey;
148 }

◆ exTruth()

double MissingEtTruth::exTruth ( MissingEtTruth::TruthIndex  theTruth) const

Definition at line 147 of file MissingEtTruth.cxx.

148 {
149  return m_exTruth[theTruth] ;
150 }

◆ exTruthVec()

const std::vector< double > & MissingEtTruth::exTruthVec ( ) const

Definition at line 163 of file MissingEtTruth.cxx.

164 {
165  return m_exTruth;
166 }

◆ eyTruth()

double MissingEtTruth::eyTruth ( MissingEtTruth::TruthIndex  theTruth) const

Definition at line 152 of file MissingEtTruth.cxx.

153 {
154  return m_eyTruth[theTruth] ;
155 }

◆ eyTruthVec()

const std::vector< double > & MissingEtTruth::eyTruthVec ( ) const

Definition at line 169 of file MissingEtTruth.cxx.

170 {
171  return m_eyTruth;
172 }

◆ getRegions()

const MissingEtRegions * MissingET::getRegions ( ) const
virtualinherited

Definition at line 164 of file MissingET.cxx.

165 {
166  return m_regions.get();
167 }

◆ getSource()

MissingET::Source MissingET::getSource ( ) const
virtualinherited

Definition at line 171 of file MissingET.cxx.

172 {
173  return m_source;
174 }

◆ phi()

double MissingET::phi ( ) const
virtualinherited

Definition at line 157 of file MissingET.cxx.

158 {
159 
160  return atan2(m_ey,m_ex);
161 }

◆ setEtSum()

void MissingET::setEtSum ( double  theSum)
virtualinherited

Definition at line 104 of file MissingET.cxx.

105 {
106  m_etSum = theEtSum;
107 }

◆ setEtSumTruth()

void MissingEtTruth::setEtSumTruth ( MissingEtTruth::TruthIndex  theTruth,
double  theEtSum 
)

Definition at line 116 of file MissingEtTruth.cxx.

118 {
119  if ( theTruth < Size ) m_etSumTruth[(size_t)theTruth] = theEtSum;
120 
121 }

◆ setEtSumTruthVec()

void MissingEtTruth::setEtSumTruthVec ( std::vector< double > &&  etSumCaloVec)

Definition at line 138 of file MissingEtTruth.cxx.

139 {
140  assert (etSumTruthVec.size() == Size);
141  m_etSumTruth = std::move (etSumTruthVec);
142 }

◆ setEx()

void MissingET::setEx ( double  theEx)
virtualinherited

Definition at line 96 of file MissingET.cxx.

97 {
98  m_ex = theEx;
99 }

◆ setExTruth()

void MissingEtTruth::setExTruth ( MissingEtTruth::TruthIndex  theTruth,
double  theEx 
)

Definition at line 102 of file MissingEtTruth.cxx.

104 {
105  if ( theTruth < Size ) m_exTruth[(size_t)theTruth] = theEx;
106 }

◆ setExTruthVec()

void MissingEtTruth::setExTruthVec ( std::vector< double > &&  exCaloVec)

Definition at line 124 of file MissingEtTruth.cxx.

125 {
126  assert (exTruthVec.size() == Size);
127  m_exTruth = std::move (exTruthVec);
128 }

◆ setEy()

void MissingET::setEy ( double  theEy)
virtualinherited

Definition at line 100 of file MissingET.cxx.

101 {
102  m_ey = theEy;
103 }

◆ setEyTruth()

void MissingEtTruth::setEyTruth ( MissingEtTruth::TruthIndex  theTruth,
double  theEy 
)

Definition at line 109 of file MissingEtTruth.cxx.

111 {
112  if ( theTruth < Size ) m_eyTruth[(size_t)theTruth] = theEy;
113 }

◆ setEyTruthVec()

void MissingEtTruth::setEyTruthVec ( std::vector< double > &&  exCaloVec)

Definition at line 131 of file MissingEtTruth.cxx.

132 {
133  assert (eyTruthVec.size() == Size);
134  m_eyTruth = std::move (eyTruthVec);
135 }

◆ setup()

void MissingEtTruth::setup ( )
protected

Definition at line 181 of file MissingEtTruth.cxx.

182 {
183  // initialize data members
184 
185  m_exTruth.resize(MissingEtTruth::Size,0.);
186  m_eyTruth.resize(MissingEtTruth::Size,0.);
188 }

◆ sumet()

double MissingET::sumet ( ) const
virtualinherited

Definition at line 149 of file MissingET.cxx.

150 {
151  return m_etSum;
152 }

Member Data Documentation

◆ m_etSum

double MissingET::m_etSum
protectedinherited

◆ m_etSumTruth

std::vector<double> MissingEtTruth::m_etSumTruth
protected

Definition at line 88 of file MissingEtTruth.h.

◆ m_ex

double MissingET::m_ex
protectedinherited

◆ m_exTruth

std::vector<double> MissingEtTruth::m_exTruth
protected

Definition at line 86 of file MissingEtTruth.h.

◆ m_ey

double MissingET::m_ey
protectedinherited

◆ m_eyTruth

std::vector<double> MissingEtTruth::m_eyTruth
protected

Definition at line 87 of file MissingEtTruth.h.

◆ m_regions

std::unique_ptr<MissingEtRegions> MissingET::m_regions
protectedinherited

◆ m_source

Source MissingET::m_source
protectedinherited

The documentation for this class was generated from the following files:
MissingEtTruth::NotValid
@ NotValid
Definition: MissingEtTruth.h:60
MissingET::m_source
Source m_source
Definition: Reconstruction/MissingETEvent/MissingETEvent/MissingET.h:119
MissingET::MissingET
MissingET()
Definition: MissingET.cxx:41
MissingEtTruth::exTruthVec
const std::vector< double > & exTruthVec() const
Definition: MissingEtTruth.cxx:163
MissingEtTruth::Int
@ Int
Definition: MissingEtTruth.h:51
MissingEtTruth::IntOutCover
@ IntOutCover
Definition: MissingEtTruth.h:57
MissingEtTruth::setup
void setup()
Definition: MissingEtTruth.cxx:181
MissingEtTruth::m_eyTruth
std::vector< double > m_eyTruth
Definition: MissingEtTruth.h:87
MissingET::m_ey
double m_ey
Definition: Reconstruction/MissingETEvent/MissingETEvent/MissingET.h:123
MissingEtTruth::IntCentral
@ IntCentral
Definition: MissingEtTruth.h:53
MissingEtTruth::TruthIndex
TruthIndex
Definition: MissingEtTruth.h:41
drawFromPickle.exp
exp
Definition: drawFromPickle.py:36
MissingEtTruth::NonInt
@ NonInt
Definition: MissingEtTruth.h:52
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:189
egammaParameters::etap
@ etap
pointing eta reconstructed from the cluster (first and second sampling)
Definition: egammaParamDefs.h:274
MissingEtTruth::m_etSumTruth
std::vector< double > m_etSumTruth
Definition: MissingEtTruth.h:88
MissingEtTruth::m_exTruth
std::vector< double > m_exTruth
Definition: MissingEtTruth.h:86
ParticleGun_EoverP_Config.momentum
momentum
Definition: ParticleGun_EoverP_Config.py:63
MissingEtTruth::etSumTruthVec
const std::vector< double > & etSumTruthVec() const
Definition: MissingEtTruth.cxx:175
MissingEtTruth::eyTruthVec
const std::vector< double > & eyTruthVec() const
Definition: MissingEtTruth.cxx:169
MissingEtTruth::Size
@ Size
Definition: MissingEtTruth.h:59
MissingET::m_ex
double m_ex
Definition: Reconstruction/MissingETEvent/MissingETEvent/MissingET.h:122
MissingET::m_regions
std::unique_ptr< MissingEtRegions > m_regions
Definition: Reconstruction/MissingETEvent/MissingETEvent/MissingET.h:117
MissingEtTruth::IntFwd
@ IntFwd
Definition: MissingEtTruth.h:55
MissingET::add
virtual void add(double theEx, double theEy, double theEt, double theEta, double weight)
Definition: MissingET.cxx:127
DetType::Part
Part
Definition: DetType.h:14
MC::isSimInteracting
bool isSimInteracting(const T &p)
Identify if the particle could interact with the detector during the simulation, e....
Definition: HepMCHelpers.h:60
MissingEtTruth::Muons
@ Muons
Definition: MissingEtTruth.h:58
MissingET::Truth
@ Truth
Definition: Reconstruction/MissingETEvent/MissingETEvent/MissingET.h:50
MissingET::m_etSum
double m_etSum
Definition: Reconstruction/MissingETEvent/MissingETEvent/MissingET.h:124