CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
EcalPhiSymRecHit Class Reference

#include <EcalPhiSymRecHit.h>

Public Member Functions

void addHit (const std::vector< float > &etValues, const float laserCorr=0)
 
 EcalPhiSymRecHit ()
 
 EcalPhiSymRecHit (uint32_t id, unsigned int nMisCalibV, unsigned int status=0)
 
 EcalPhiSymRecHit (uint32_t id, std::vector< float > &etValues, unsigned int status=0)
 
int8_t eeRing () const
 
float lc2Sum () const
 
float lcSum () const
 
uint32_t nHits () const
 
unsigned int nSumEt () const
 
EcalPhiSymRecHitoperator+= (const EcalPhiSymRecHit &rhs)
 
uint32_t rawId () const
 
void reset ()
 
void setEERing (const int8_t &eering)
 
unsigned int statusCode () const
 
float sumEt (int i=0) const
 
float sumEt2 () const
 
 ~EcalPhiSymRecHit ()=default
 

Private Attributes

unsigned int chStatus_
 
int8_t eeRing_
 
float et2Sum_
 
std::vector< float > etSum_
 
uint32_t id_
 
float lc2Sum_
 
float lcSum_
 
uint32_t nHits_
 

Detailed Description

Dataformat dedicated to Phi Symmetry ecal calibration

Note: SumEt array ordering: 0 - central value 1<->N/2 - misCalib<1 N/2+1<->N - misCalib>1

Original Author: Simone Pigazzini (2022)

Definition at line 24 of file EcalPhiSymRecHit.h.

Constructor & Destructor Documentation

◆ EcalPhiSymRecHit() [1/3]

EcalPhiSymRecHit::EcalPhiSymRecHit ( )

Definition at line 4 of file EcalPhiSymRecHit.cc.

5  : id_(0), eeRing_(0), chStatus_(0), nHits_(0), etSum_(1, 0.), et2Sum_(0), lcSum_(0), lc2Sum_(0) {}
std::vector< float > etSum_
unsigned int chStatus_

◆ EcalPhiSymRecHit() [2/3]

EcalPhiSymRecHit::EcalPhiSymRecHit ( uint32_t  id,
unsigned int  nMisCalibV,
unsigned int  status = 0 
)

Definition at line 7 of file EcalPhiSymRecHit.cc.

8  : id_(id), eeRing_(0), chStatus_(status), nHits_(0), etSum_(nMisCalibV, 0.), et2Sum_(0), lcSum_(0), lc2Sum_(0) {}
std::vector< float > etSum_
unsigned int chStatus_

◆ EcalPhiSymRecHit() [3/3]

EcalPhiSymRecHit::EcalPhiSymRecHit ( uint32_t  id,
std::vector< float > &  etValues,
unsigned int  status = 0 
)

Definition at line 10 of file EcalPhiSymRecHit.cc.

11  : id_(id),
12  eeRing_(0),
14  nHits_(0),
15  etSum_(etValues.begin(), etValues.end()),
16  et2Sum_(0),
17  lcSum_(0),
18  lc2Sum_(0) {}
std::vector< float > etSum_
unsigned int chStatus_

◆ ~EcalPhiSymRecHit()

EcalPhiSymRecHit::~EcalPhiSymRecHit ( )
default

Member Function Documentation

◆ addHit()

void EcalPhiSymRecHit::addHit ( const std::vector< float > &  etValues,
const float  laserCorr = 0 
)

Definition at line 21 of file EcalPhiSymRecHit.cc.

References et2Sum_, etSum_, mps_fire::i, lc2Sum_, lcSum_, SiStripPI::min, and nHits_.

21  {
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 }
std::vector< float > etSum_

◆ eeRing()

int8_t EcalPhiSymRecHit::eeRing ( ) const
inline

Definition at line 36 of file EcalPhiSymRecHit.h.

References eeRing_.

36 { return eeRing_; };

◆ lc2Sum()

float EcalPhiSymRecHit::lc2Sum ( ) const
inline

Definition at line 43 of file EcalPhiSymRecHit.h.

References lc2Sum_.

Referenced by operator+=().

43 { return lc2Sum_; };

◆ lcSum()

float EcalPhiSymRecHit::lcSum ( ) const
inline

Definition at line 42 of file EcalPhiSymRecHit.h.

References lcSum_.

Referenced by operator+=().

42 { return lcSum_; };

◆ nHits()

uint32_t EcalPhiSymRecHit::nHits ( ) const
inline

Definition at line 38 of file EcalPhiSymRecHit.h.

References nHits_.

Referenced by operator+=().

38 { return nHits_; };

◆ nSumEt()

unsigned int EcalPhiSymRecHit::nSumEt ( ) const
inline

Definition at line 39 of file EcalPhiSymRecHit.h.

References etSum_.

39 { return etSum_.size(); };
std::vector< float > etSum_

◆ operator+=()

EcalPhiSymRecHit & EcalPhiSymRecHit::operator+= ( const EcalPhiSymRecHit rhs)

Definition at line 42 of file EcalPhiSymRecHit.cc.

References cms::cuda::assert(), et2Sum_, etSum_, mps_fire::i, id_, lc2Sum(), lc2Sum_, lcSum(), lcSum_, nHits(), nHits_, rawId(), sumEt(), and sumEt2().

42  {
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

◆ rawId()

uint32_t EcalPhiSymRecHit::rawId ( ) const
inline

Definition at line 35 of file EcalPhiSymRecHit.h.

References id_.

Referenced by operator+=().

35 { return id_; };

◆ reset()

void EcalPhiSymRecHit::reset ( void  )

Definition at line 32 of file EcalPhiSymRecHit.cc.

References et2Sum_, etSum_, lc2Sum_, lcSum_, and nHits_.

Referenced by MatrixReader.MatrixReader::__init__(), data_sources.json_list::__next__(), and MatrixReader.MatrixReader::showRaw().

32  {
33  nHits_ = 0.;
34  et2Sum_ = 0.;
35  lcSum_ = 0.;
36  lc2Sum_ = 0.;
37  etSum_ = std::vector<float>(etSum_.size(), 0.);
38 }
std::vector< float > etSum_

◆ setEERing()

void EcalPhiSymRecHit::setEERing ( const int8_t &  eering)
inline

Definition at line 46 of file EcalPhiSymRecHit.h.

References eeRing_.

46 { eeRing_ = eering; };

◆ statusCode()

unsigned int EcalPhiSymRecHit::statusCode ( ) const
inline

Definition at line 37 of file EcalPhiSymRecHit.h.

References chStatus_.

37 { return chStatus_; };
unsigned int chStatus_

◆ sumEt()

float EcalPhiSymRecHit::sumEt ( int  i = 0) const
inline

Definition at line 40 of file EcalPhiSymRecHit.h.

References etSum_, and mps_fire::i.

Referenced by operator+=().

40 { return etSum_[i]; };
std::vector< float > etSum_

◆ sumEt2()

float EcalPhiSymRecHit::sumEt2 ( ) const
inline

Definition at line 41 of file EcalPhiSymRecHit.h.

References et2Sum_.

Referenced by operator+=().

41 { return et2Sum_; };

Member Data Documentation

◆ chStatus_

unsigned int EcalPhiSymRecHit::chStatus_
private

Definition at line 58 of file EcalPhiSymRecHit.h.

Referenced by statusCode().

◆ eeRing_

int8_t EcalPhiSymRecHit::eeRing_
private

Definition at line 57 of file EcalPhiSymRecHit.h.

Referenced by eeRing(), and setEERing().

◆ et2Sum_

float EcalPhiSymRecHit::et2Sum_
private

Definition at line 61 of file EcalPhiSymRecHit.h.

Referenced by addHit(), operator+=(), reset(), and sumEt2().

◆ etSum_

std::vector<float> EcalPhiSymRecHit::etSum_
private

Definition at line 60 of file EcalPhiSymRecHit.h.

Referenced by addHit(), nSumEt(), operator+=(), reset(), and sumEt().

◆ id_

uint32_t EcalPhiSymRecHit::id_
private

Definition at line 56 of file EcalPhiSymRecHit.h.

Referenced by operator+=(), and rawId().

◆ lc2Sum_

float EcalPhiSymRecHit::lc2Sum_
private

Definition at line 63 of file EcalPhiSymRecHit.h.

Referenced by addHit(), lc2Sum(), operator+=(), and reset().

◆ lcSum_

float EcalPhiSymRecHit::lcSum_
private

Definition at line 62 of file EcalPhiSymRecHit.h.

Referenced by addHit(), lcSum(), operator+=(), and reset().

◆ nHits_

uint32_t EcalPhiSymRecHit::nHits_
private

Definition at line 59 of file EcalPhiSymRecHit.h.

Referenced by addHit(), nHits(), operator+=(), and reset().