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

#include <MissingEtCalo.h>

Inheritance diagram for MissingEtCalo:
Collaboration diagram for MissingEtCalo:

Public Types

enum  CaloIndex {
  PEMB = 0, EMB = 1, PEMEC = 2, EME = 3,
  TILE = 4, HEC = 5, FCAL = 6, Size = 7,
  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

 MissingEtCalo ()
 
 MissingEtCalo (MissingEtRegions *aRegion)
 
 MissingEtCalo (MissingET::Source aSource, MissingEtRegions *aRegion)
 
virtual ~MissingEtCalo ()
 
void addCalo (const CaloCell *aCell, double weight)
 
CaloIndex getCaloIndex (CaloSampling::CaloSample aSample)
 
void setExCalo (CaloIndex aCalo, double theEx)
 
void setEyCalo (CaloIndex aCalo, double theEy)
 
void setEtSumCalo (CaloIndex aCalo, double theEtSum)
 
void setNCellCalo (CaloIndex aCalo, unsigned int theNCell)
 
void setCalibType (const std::string &theCalibType)
 
void setExCaloVec (std::vector< double > &&exCaloVec)
 
void setEyCaloVec (std::vector< double > &&exCaloVec)
 
void setEtSumCaloVec (std::vector< double > &&etSumCaloVec)
 
void setNCellCaloVec (std::vector< unsigned int > &&ncellCaloVec)
 
double exCalo (CaloIndex aCalo) const
 
double eyCalo (CaloIndex aCalo) const
 
double etSumCalo (CaloIndex aCalo) const
 
unsigned int ncellCalo (CaloIndex aCalo) const
 
const std::string & calibType () const
 
const std::vector< double > & exCaloVec () const
 
const std::vector< double > & eyCaloVec () const
 
const std::vector< double > & etSumCaloVec () const
 
const std::vector< unsigned int > & ncellCaloVec () 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 ()
 
void Calc_Ecellxy (const CaloCell *cObj, double &ex, double &ey)
 

Protected Attributes

std::vector< double > m_exCalo
 
std::vector< double > m_eyCalo
 
std::vector< double > m_etSumCalo
 
std::vector< unsigned int > m_nCellsCalo
 
std::string m_calibType
 
std::unique_ptr< MissingEtRegionsm_regions
 
Source m_source
 
double m_ex
 
double m_ey
 
double m_etSum
 

Detailed Description

Definition at line 26 of file MissingEtCalo.h.

Member Enumeration Documentation

◆ CaloIndex

Enumerator
PEMB 
EMB 
PEMEC 
EME 
TILE 
HEC 
FCAL 
Size 
NotValid 

Definition at line 39 of file MissingEtCalo.h.

◆ 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.

Constructor & Destructor Documentation

◆ MissingEtCalo() [1/3]

MissingEtCalo::MissingEtCalo ( )

Definition at line 20 of file MissingEtCalo.cxx.

21 {
22  this->setup();
23 }

◆ MissingEtCalo() [2/3]

MissingEtCalo::MissingEtCalo ( MissingEtRegions aRegion)

Definition at line 25 of file MissingEtCalo.cxx.

26  : MissingET(MissingET::Calo,aRegion)
27 {
28  this->setup();
29 }

◆ MissingEtCalo() [3/3]

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

Definition at line 31 of file MissingEtCalo.cxx.

33  : MissingET(aSource,aRegion)
34 {
35  this->setup();
36 }

◆ ~MissingEtCalo()

MissingEtCalo::~MissingEtCalo ( )
virtual

Definition at line 38 of file MissingEtCalo.cxx.

39 {
40  this->setup();
41 }

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 }

◆ addCalo()

void MissingEtCalo::addCalo ( const CaloCell aCell,
double  weight 
)

Definition at line 43 of file MissingEtCalo.cxx.

44 {
45  //For efficiency don't call Calc_Ecellxy directly here but put the
46  //calculations directly:
47  double etc = aCell->et();
48  CxxUtils::sincos sc(aCell->phi());
49  double exc = etc * sc.cs;
50  double eyc = etc * sc.sn;
51  double etac = aCell->eta();
52 
53  // update the global sums and eta regions
54  this->add(exc, eyc, etc, etac, weight);
55 
56  // get the calo sample from each cell
57  CaloSampling::CaloSample aSample = aCell->caloDDE()->getSampling();
58  CaloIndex theIndex = this->getCaloIndex(aSample);
59 
60  // calorimeter sums
61  if ( theIndex != NotValid )
62  {
63  m_exCalo[(size_t)theIndex] -= weight * exc;
64  m_eyCalo[(size_t)theIndex] -= weight * eyc;
65  m_etSumCalo[(size_t)theIndex] += weight * etc;
66  ++(m_nCellsCalo[(size_t)theIndex]);
67  }
68 }

◆ Calc_Ecellxy()

void MissingEtCalo::Calc_Ecellxy ( const CaloCell cObj,
double &  ex,
double &  ey 
)
protected

Definition at line 283 of file MissingEtCalo.cxx.

284 {
285  //function to calculate x and y component of cell energy
286 
287  CxxUtils::sincos sc(cObj->phi());
288  //Done the following way to avoid a temporary et_cell variable:
289  ex = cObj->et();
290  ey = ex * sc.sn;
291  ex *= sc.cs;
292 }

◆ calibType()

const std::string & MissingEtCalo::calibType ( ) const

Definition at line 238 of file MissingEtCalo.cxx.

239 {
240 
241  return m_calibType ;
242 }

◆ 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 }

◆ etSumCalo()

double MissingEtCalo::etSumCalo ( MissingEtCalo::CaloIndex  theCalo) const

Definition at line 228 of file MissingEtCalo.cxx.

229 {
230  return m_etSumCalo[theCalo] ;
231 }

◆ etSumCaloVec()

const std::vector< double > & MissingEtCalo::etSumCaloVec ( ) const

Definition at line 260 of file MissingEtCalo.cxx.

261 {
262  return m_etSumCalo;
263 }

◆ 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 }

◆ exCalo()

double MissingEtCalo::exCalo ( MissingEtCalo::CaloIndex  theCalo) const

Definition at line 218 of file MissingEtCalo.cxx.

219 {
220  return m_exCalo[theCalo] ;
221 }

◆ exCaloVec()

const std::vector< double > & MissingEtCalo::exCaloVec ( ) const

Definition at line 246 of file MissingEtCalo.cxx.

247 {
248  return m_exCalo;
249 }

◆ eyCalo()

double MissingEtCalo::eyCalo ( MissingEtCalo::CaloIndex  theCalo) const

Definition at line 223 of file MissingEtCalo.cxx.

224 {
225  return m_eyCalo[theCalo] ;
226 }

◆ eyCaloVec()

const std::vector< double > & MissingEtCalo::eyCaloVec ( ) const

Definition at line 253 of file MissingEtCalo.cxx.

254 {
255  return m_eyCalo;
256 }

◆ getCaloIndex()

MissingEtCalo::CaloIndex MissingEtCalo::getCaloIndex ( CaloSampling::CaloSample  aSample)

Definition at line 70 of file MissingEtCalo.cxx.

71 {
72 
73  // The CaloIndex identifies the calorimeters used in Atrecon and as such
74  // users will be able to seemlessly use the Athena values in their analysis.
75  // 7 calos : PS Barrel, EM Barrel, PS EndCap, EM EndCap, Tile, HEC, FCAL
76 
77  CaloIndex theIndex = NotValid;
78  switch ( aSample )
79  {
80 
81  // PS Barrel
83  theIndex = PEMB;
84  break;
85 
86  // EM Barrel
87  case CaloSampling::EMB1:
88  case CaloSampling::EMB2:
89  case CaloSampling::EMB3:
90  theIndex = EMB;
91  break;
92 
93  // PS EndCap
95  theIndex = PEMEC;
96  break;
97 
98  // EM EndCap
99  case CaloSampling::EME1:
100  case CaloSampling::EME2:
101  case CaloSampling::EME3:
102  theIndex = EME;
103  break;
104 
105  // Tile
115  theIndex = TILE;
116  break;
117 
118  // HEC
119  case CaloSampling::HEC0:
120  case CaloSampling::HEC1:
121  case CaloSampling::HEC2:
122  case CaloSampling::HEC3:
123  theIndex = HEC;
124  break;
125 
126  // FCAL
127  case CaloSampling::FCAL0:
128  case CaloSampling::FCAL1:
129  case CaloSampling::FCAL2:
130  theIndex = FCAL;
131  break;
132 
133  default:
134  break;
135  }
136  return theIndex;
137 }

◆ 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 }

◆ ncellCalo()

unsigned int MissingEtCalo::ncellCalo ( MissingEtCalo::CaloIndex  theCalo) const

Definition at line 233 of file MissingEtCalo.cxx.

234 {
235  return m_nCellsCalo[theCalo] ;
236 }

◆ ncellCaloVec()

const std::vector< unsigned int > & MissingEtCalo::ncellCaloVec ( ) const

Definition at line 267 of file MissingEtCalo.cxx.

268 {
269  return m_nCellsCalo;
270 }

◆ phi()

double MissingET::phi ( ) const
virtualinherited

Definition at line 157 of file MissingET.cxx.

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

◆ setCalibType()

void MissingEtCalo::setCalibType ( const std::string &  theCalibType)

Definition at line 181 of file MissingEtCalo.cxx.

182 {
183 
184  m_calibType=theCalibType;
185 }

◆ setEtSum()

void MissingET::setEtSum ( double  theSum)
virtualinherited

Definition at line 104 of file MissingET.cxx.

105 {
106  m_etSum = theEtSum;
107 }

◆ setEtSumCalo()

void MissingEtCalo::setEtSumCalo ( MissingEtCalo::CaloIndex  theCalo,
double  theEtSum 
)

Definition at line 166 of file MissingEtCalo.cxx.

168 {
169  if ( theCalo < Size ) m_etSumCalo[(size_t)theCalo] = theEtSum;
170 
171 }

◆ setEtSumCaloVec()

void MissingEtCalo::setEtSumCaloVec ( std::vector< double > &&  etSumCaloVec)

Definition at line 202 of file MissingEtCalo.cxx.

203 {
204  assert (etSumCaloVec.size() == Size);
205  m_etSumCalo = std::move (etSumCaloVec);
206 }

◆ setEx()

void MissingET::setEx ( double  theEx)
virtualinherited

Definition at line 96 of file MissingET.cxx.

97 {
98  m_ex = theEx;
99 }

◆ setExCalo()

void MissingEtCalo::setExCalo ( MissingEtCalo::CaloIndex  theCalo,
double  theEx 
)

Definition at line 152 of file MissingEtCalo.cxx.

154 {
155  if ( theCalo < Size ) m_exCalo[(size_t)theCalo] = theEx;
156 }

◆ setExCaloVec()

void MissingEtCalo::setExCaloVec ( std::vector< double > &&  exCaloVec)

Definition at line 188 of file MissingEtCalo.cxx.

189 {
190  assert (exCaloVec.size() == Size);
191  m_exCalo = std::move (exCaloVec);
192 }

◆ setEy()

void MissingET::setEy ( double  theEy)
virtualinherited

Definition at line 100 of file MissingET.cxx.

101 {
102  m_ey = theEy;
103 }

◆ setEyCalo()

void MissingEtCalo::setEyCalo ( MissingEtCalo::CaloIndex  theCalo,
double  theEy 
)

Definition at line 159 of file MissingEtCalo.cxx.

161 {
162  if ( theCalo < Size ) m_eyCalo[(size_t)theCalo] = theEy;
163 }

◆ setEyCaloVec()

void MissingEtCalo::setEyCaloVec ( std::vector< double > &&  exCaloVec)

Definition at line 195 of file MissingEtCalo.cxx.

196 {
197  assert (eyCaloVec.size() == Size);
198  m_eyCalo = std::move (eyCaloVec);
199 }

◆ setNCellCalo()

void MissingEtCalo::setNCellCalo ( MissingEtCalo::CaloIndex  theCalo,
unsigned int  theNCell 
)

Definition at line 174 of file MissingEtCalo.cxx.

176 {
177  if ( theCalo < Size ) m_nCellsCalo[(size_t)theCalo] = theNCell;
178 
179 }

◆ setNCellCaloVec()

void MissingEtCalo::setNCellCaloVec ( std::vector< unsigned int > &&  ncellCaloVec)

Definition at line 209 of file MissingEtCalo.cxx.

210 {
211  assert (ncellCaloVec.size() == Size);
212  m_nCellsCalo = std::move (ncellCaloVec);
213 }

◆ setup()

void MissingEtCalo::setup ( )
protected

Definition at line 273 of file MissingEtCalo.cxx.

274 {
275  // initialize data members
276 
277  m_exCalo.resize(MissingEtCalo::Size,0.);
278  m_eyCalo.resize(MissingEtCalo::Size,0.);
279  m_etSumCalo.resize(MissingEtCalo::Size,0.);
281 }

◆ sumet()

double MissingET::sumet ( ) const
virtualinherited

Definition at line 149 of file MissingET.cxx.

150 {
151  return m_etSum;
152 }

Member Data Documentation

◆ m_calibType

std::string MissingEtCalo::m_calibType
protected

Definition at line 97 of file MissingEtCalo.h.

◆ m_etSum

double MissingET::m_etSum
protectedinherited

◆ m_etSumCalo

std::vector<double> MissingEtCalo::m_etSumCalo
protected

Definition at line 94 of file MissingEtCalo.h.

◆ m_ex

double MissingET::m_ex
protectedinherited

◆ m_exCalo

std::vector<double> MissingEtCalo::m_exCalo
protected

Definition at line 92 of file MissingEtCalo.h.

◆ m_ey

double MissingET::m_ey
protectedinherited

◆ m_eyCalo

std::vector<double> MissingEtCalo::m_eyCalo
protected

Definition at line 93 of file MissingEtCalo.h.

◆ m_nCellsCalo

std::vector<unsigned int> MissingEtCalo::m_nCellsCalo
protected

Definition at line 95 of file MissingEtCalo.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:
MissingEtCalo::getCaloIndex
CaloIndex getCaloIndex(CaloSampling::CaloSample aSample)
Definition: MissingEtCalo.cxx:70
MissingET::m_source
Source m_source
Definition: Reconstruction/MissingETEvent/MissingETEvent/MissingET.h:119
CaloCell_ID_FCS::TileExt2
@ TileExt2
Definition: FastCaloSim_CaloCell_ID.h:39
CaloCell::phi
virtual double phi() const override final
get phi (through CaloDetDescrElement)
Definition: CaloCell.h:359
constants.EMB1
int EMB1
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:53
MissingEtCalo::PEMB
@ PEMB
Definition: MissingEtCalo.h:50
MissingET::Calo
@ Calo
Definition: Reconstruction/MissingETEvent/MissingETEvent/MissingET.h:48
MissingEtCalo::CaloIndex
CaloIndex
Definition: MissingEtCalo.h:40
CaloCell_ID_FCS::TileExt0
@ TileExt0
Definition: FastCaloSim_CaloCell_ID.h:37
MissingET::MissingET
MissingET()
Definition: MissingET.cxx:41
CaloCell_ID_FCS::TileBar1
@ TileBar1
Definition: FastCaloSim_CaloCell_ID.h:32
MissingEtCalo::HEC
@ HEC
Definition: MissingEtCalo.h:55
CaloCell_ID_FCS::FCAL1
@ FCAL1
Definition: FastCaloSim_CaloCell_ID.h:41
MissingEtCalo::ncellCaloVec
const std::vector< unsigned int > & ncellCaloVec() const
Definition: MissingEtCalo.cxx:267
MissingEtCalo::m_eyCalo
std::vector< double > m_eyCalo
Definition: MissingEtCalo.h:93
MissingET::m_ey
double m_ey
Definition: Reconstruction/MissingETEvent/MissingETEvent/MissingET.h:123
CaloCell_ID_FCS::HEC2
@ HEC2
Definition: FastCaloSim_CaloCell_ID.h:29
MissingEtCalo::m_calibType
std::string m_calibType
Definition: MissingEtCalo.h:97
MissingEtCalo::exCaloVec
const std::vector< double > & exCaloVec() const
Definition: MissingEtCalo.cxx:246
CaloCell_ID_FCS::TileGap3
@ TileGap3
Definition: FastCaloSim_CaloCell_ID.h:36
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
MissingEtCalo::FCAL
@ FCAL
Definition: MissingEtCalo.h:56
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:189
CaloCell_ID_FCS::HEC1
@ HEC1
Definition: FastCaloSim_CaloCell_ID.h:28
constants.EMB2
int EMB2
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:54
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
CaloCell_ID_FCS::TileBar0
@ TileBar0
Definition: FastCaloSim_CaloCell_ID.h:31
CaloCell_ID_FCS::TileGap2
@ TileGap2
Definition: FastCaloSim_CaloCell_ID.h:35
CaloCell::caloDDE
const CaloDetDescrElement * caloDDE() const
get pointer to CaloDetDescrElement (data member)
Definition: CaloCell.h:305
MissingEtCalo::eyCaloVec
const std::vector< double > & eyCaloVec() const
Definition: MissingEtCalo.cxx:253
CaloCell::et
virtual double et() const override final
get et
Definition: CaloCell.h:407
constants.EME1
int EME1
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:55
MissingEtCalo::EMB
@ EMB
Definition: MissingEtCalo.h:51
MissingET::m_ex
double m_ex
Definition: Reconstruction/MissingETEvent/MissingETEvent/MissingET.h:122
MissingEtCalo::Size
@ Size
Definition: MissingEtCalo.h:57
CaloCell_ID_FCS::TileGap1
@ TileGap1
Definition: FastCaloSim_CaloCell_ID.h:34
MissingEtCalo::m_etSumCalo
std::vector< double > m_etSumCalo
Definition: MissingEtCalo.h:94
CaloCell_ID_FCS::TileExt1
@ TileExt1
Definition: FastCaloSim_CaloCell_ID.h:38
CaloCell_ID_FCS::EME3
@ EME3
Definition: FastCaloSim_CaloCell_ID.h:26
MissingET::m_regions
std::unique_ptr< MissingEtRegions > m_regions
Definition: Reconstruction/MissingETEvent/MissingETEvent/MissingET.h:117
MissingEtCalo::setup
void setup()
Definition: MissingEtCalo.cxx:273
MissingET::add
virtual void add(double theEx, double theEy, double theEt, double theEta, double weight)
Definition: MissingET.cxx:127
CaloCell_ID_FCS::HEC0
@ HEC0
Definition: FastCaloSim_CaloCell_ID.h:27
MissingEtCalo::etSumCaloVec
const std::vector< double > & etSumCaloVec() const
Definition: MissingEtCalo.cxx:260
CaloDetDescrElement::getSampling
CaloCell_ID::CaloSample getSampling() const
cell sampling
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:395
CaloCell_ID_FCS::PreSamplerE
@ PreSamplerE
Definition: FastCaloSim_CaloCell_ID.h:23
CaloCell_ID_FCS::PreSamplerB
@ PreSamplerB
Definition: FastCaloSim_CaloCell_ID.h:19
MissingEtCalo::PEMEC
@ PEMEC
Definition: MissingEtCalo.h:52
CxxUtils::sincos
Helper to simultaneously calculate sin and cos of the same angle.
Definition: sincos.h:76
CaloCell_ID_FCS::FCAL2
@ FCAL2
Definition: FastCaloSim_CaloCell_ID.h:42
MissingEtCalo::NotValid
@ NotValid
Definition: MissingEtCalo.h:58
MissingEtCalo::EME
@ EME
Definition: MissingEtCalo.h:53
CaloCell_ID_FCS::HEC3
@ HEC3
Definition: FastCaloSim_CaloCell_ID.h:30
MissingEtCalo::m_exCalo
std::vector< double > m_exCalo
Definition: MissingEtCalo.h:92
CaloCell_ID_FCS::FCAL0
@ FCAL0
Definition: FastCaloSim_CaloCell_ID.h:40
CaloCell_ID_FCS::EMB3
@ EMB3
Definition: FastCaloSim_CaloCell_ID.h:22
MissingEtCalo::m_nCellsCalo
std::vector< unsigned int > m_nCellsCalo
Definition: MissingEtCalo.h:95
CaloCell_ID_FCS::TileBar2
@ TileBar2
Definition: FastCaloSim_CaloCell_ID.h:33
MissingET::m_etSum
double m_etSum
Definition: Reconstruction/MissingETEvent/MissingETEvent/MissingET.h:124
constants.EME2
int EME2
Definition: Calorimeter/CaloClusterCorrection/python/constants.py:56
CaloCell::eta
virtual double eta() const override final
get eta (through CaloDetDescrElement)
Definition: CaloCell.h:366
MissingEtCalo::TILE
@ TILE
Definition: MissingEtCalo.h:54