CMS 3D CMS Logo

EcalPhiSymRecHit.cc
Go to the documentation of this file.
2 
3 //**********constructors******************************************************************
5  : id_(0), eeRing_(0), chStatus_(0), nHits_(0), etSum_(1, 0.), et2Sum_(0), lcSum_(0), lc2Sum_(0) {}
6 
7 EcalPhiSymRecHit::EcalPhiSymRecHit(uint32_t id, unsigned int nMisCalibV, unsigned int status)
8  : id_(id), eeRing_(0), chStatus_(status), nHits_(0), etSum_(nMisCalibV, 0.), et2Sum_(0), lcSum_(0), lc2Sum_(0) {}
9 
10 EcalPhiSymRecHit::EcalPhiSymRecHit(uint32_t id, std::vector<float>& etValues, unsigned int status)
11  : id_(id),
12  eeRing_(0),
13  chStatus_(status),
14  nHits_(0),
15  etSum_(etValues.begin(), etValues.end()),
16  et2Sum_(0),
17  lcSum_(0),
18  lc2Sum_(0) {}
19 
20 //**********utils*************************************************************************
21 void EcalPhiSymRecHit::addHit(const std::vector<float>& etValues, const float laserCorr) {
22  if (etValues[0] > 0.) {
23  ++nHits_;
24  et2Sum_ += etValues[0] * etValues[0];
25  lcSum_ += laserCorr;
26  lc2Sum_ += laserCorr * laserCorr;
27  }
28  for (unsigned int i = 0; i < std::min(etSum_.size(), etValues.size()); ++i)
29  etSum_[i] += etValues[i];
30 }
31 
33  nHits_ = 0.;
34  et2Sum_ = 0.;
35  lcSum_ = 0.;
36  lc2Sum_ = 0.;
37  etSum_ = std::vector<float>(etSum_.size(), 0.);
38 }
39 
40 //**********operators*********************************************************************
41 
43  // assume same id, do not check channel status
44  assert("EcalPhiSymRecHit operator+= : attempting to sum RecHits belonging to different channels" &&
45  (id_ == rhs.rawId()));
46  nHits_ += rhs.nHits();
47  et2Sum_ += rhs.sumEt2();
48  lcSum_ += rhs.lcSum();
49  lc2Sum_ += rhs.lc2Sum();
50  for (unsigned int i = 0; i < etSum_.size(); ++i)
51  etSum_[i] += rhs.sumEt(i);
52 
53  return *this;
54 }
std::vector< float > etSum_
uint32_t rawId() const
assert(be >=bs)
float sumEt2() const
uint32_t nHits() const
float sumEt(int i=0) const
float lc2Sum() const
float lcSum() const
EcalPhiSymRecHit & operator+=(const EcalPhiSymRecHit &rhs)
void addHit(const std::vector< float > &etValues, const float laserCorr=0)