ATLAS Offline Software
MissingEtRegions.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 
7 NAME: MissingEtRegions.cxx
8 PACKAGE: offline/Reconstruction/MissingETEvent
9 
10 AUTHORS: S. Resconi
11 CREATED: Oct 2004
12 
13 PURPOSE: Calculate Ex,Ey and Sumet in Eta Regions
14 ********************************************************************/
15 
17 #include <math.h>
18 
19 // default contructor
21  : m_reg(MissingEtRegions::Unknown)
22 {
23  this->setup();
24 }
25 
26 
27 // destructor
29 { }
30 /*
31 // addReg method
32 void MissingEtRegions::addReg(const CaloCell* aCell, double &weight)
33 {
34 
35  double theEx=0.;
36  double theEy=0.;
37  Calc_Ecellxy(aCell, theEx, theEy);
38 
39  double theEta = aCell->eta();
40 
41  //summing on all eta regions
42  int theReg = EndCap;
43  if ( fabs(theEta) <= 1.5 ) theReg = Central ;
44  if ( fabs(theEta) >= 3.2 ) theReg = Forward ;
45 
46  // changed sign to ex and ey sum as in Atrecon
47 
48  m_exReg[(size_t)theReg] -= weight * theEx;
49  m_eyReg[(size_t)theReg] -= weight * theEy;
50 
51  // Sumet for each region
52  m_etReg[(size_t)theReg] += weight * aCell->et() ;
53 
54 } */
55 
56 // addReg method
57 void MissingEtRegions::addReg(double theEx, double theEy, double theEt,
58  double theEta, double weight)
59 {
60  // Summing on all eta regions
61  size_t theReg(Forward);
62  theEta=fabs(theEta);
63  if ( theEta <= 1.5 ) theReg = Central ;
64  else {
65  if ( theEta <3.2 ) theReg = EndCap ;
66  else {
67  if ( fabs(theEta) > 4.5 )
68  return;
69  }
70  }
71 
72  m_exReg[theReg] -= weight * theEx;
73  m_eyReg[theReg] -= weight * theEy;
74  m_etReg[theReg] += weight * theEt ;
75 
76 }
77 
78 
79 
80 // retrieve the eta regions
82 {
83  return m_reg;
84 }
85 
87 {
91 }
92 
93 // set methods
94 
96  double theEx)
97 {
98  if ( theReg < Size ) m_exReg[(size_t)theReg] = theEx;
99 }
100 
102  double theEy)
103 {
104  if ( theReg < Size ) m_eyReg[(size_t)theReg] = theEy;
105 }
106 
108  double theEtSum)
109 {
110  if ( theReg < Size ) m_etReg[(size_t)theReg] = theEtSum;
111 }
112 
113 
114 void MissingEtRegions::setExRegVec(std::vector<double>&& exVec)
115 {
116  assert (exVec.size() == Size);
117  m_exReg = std::move (exVec);
118 }
119 
120 
121 void MissingEtRegions::setEyRegVec(std::vector<double>&& eyVec)
122 {
123  assert (eyVec.size() == Size);
124  m_eyReg = std::move (eyVec);
125 }
126 
127 
128 void MissingEtRegions::setEtSumRegVec(std::vector<double>&& etSumVec)
129 {
130  assert (etSumVec.size() == Size);
131  m_etReg = std::move (etSumVec);
132 }
133 
134 
135 // get methods
136 
138 {
139  return m_exReg[theReg] ;
140 }
141 
143 {
144  return m_eyReg[theReg] ;
145 }
146 
148 {
149  return m_etReg[theReg] ;
150 }
151 
152 
153 const std::vector<double>&
155 {
156  return m_exReg;
157 }
158 
159 
160 const std::vector<double>&
162 {
163  return m_eyReg;
164 }
165 
166 
167 const std::vector<double>&
169 {
170  return m_etReg;
171 }
172 
173 
GetLCDefs::Unknown
@ Unknown
Definition: GetLCDefs.h:21
MissingEtRegions
Definition: MissingEtRegions.h:22
MissingEtRegions::setExRegVec
void setExRegVec(std::vector< double > &&exVec)
Definition: MissingEtRegions.cxx:114
MissingEtRegions::addReg
virtual void addReg(double theEx, double theEy, double theEt, double theEta, double weight)
Definition: MissingEtRegions.cxx:57
MissingEtRegions::m_exReg
std::vector< double > m_exReg
Definition: MissingEtRegions.h:81
MissingEtRegions::setEyReg
void setEyReg(RegionIndex aRegion, double theEy)
Definition: MissingEtRegions.cxx:101
MissingEtRegions::MissingEtRegions
MissingEtRegions()
Definition: MissingEtRegions.cxx:20
MissingEtRegions::etSumReg
double etSumReg(RegionIndex aRegion) const
Definition: MissingEtRegions.cxx:147
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:189
MissingEtRegions::EndCap
@ EndCap
Definition: MissingEtRegions.h:49
MissingEtRegions::Central
@ Central
Definition: MissingEtRegions.h:48
MissingEtRegions::exRegVec
const std::vector< double > & exRegVec() const
Definition: MissingEtRegions.cxx:154
MissingEtRegions::~MissingEtRegions
virtual ~MissingEtRegions()
Definition: MissingEtRegions.cxx:28
MissingEtRegions::Size
@ Size
Definition: MissingEtRegions.h:51
MissingEtRegions::etSumRegVec
const std::vector< double > & etSumRegVec() const
Definition: MissingEtRegions.cxx:168
MissingEtRegions::setup
void setup()
Definition: MissingEtRegions.cxx:86
MissingEtRegions::eyRegVec
const std::vector< double > & eyRegVec() const
Definition: MissingEtRegions.cxx:161
MissingEtRegions.h
MissingEtRegions::m_eyReg
std::vector< double > m_eyReg
Definition: MissingEtRegions.h:82
MissingEtRegions::Forward
@ Forward
Definition: MissingEtRegions.h:50
MissingEtRegions::exReg
double exReg(RegionIndex aRegion) const
Definition: MissingEtRegions.cxx:137
MissingEtRegions::m_etReg
std::vector< double > m_etReg
Definition: MissingEtRegions.h:83
MissingEtRegions::m_reg
RegionIndex m_reg
Definition: MissingEtRegions.h:79
MissingEtRegions::setEtSumReg
void setEtSumReg(RegionIndex aRegion, double theEtSum)
Definition: MissingEtRegions.cxx:107
MissingEtRegions::setEyRegVec
void setEyRegVec(std::vector< double > &&eyVec)
Definition: MissingEtRegions.cxx:121
MissingEtRegions::setEtSumRegVec
void setEtSumRegVec(std::vector< double > &&etSumVec)
Definition: MissingEtRegions.cxx:128
MissingEtRegions::getRegions
virtual RegionIndex getRegions()
Definition: MissingEtRegions.cxx:81
MissingEtRegions::eyReg
double eyReg(RegionIndex aRegion) const
Definition: MissingEtRegions.cxx:142
MissingEtRegions::RegionIndex
RegionIndex
Definition: MissingEtRegions.h:38
MissingEtRegions::setExReg
void setExReg(RegionIndex aRegion, double theEx)
Definition: MissingEtRegions.cxx:95