Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-03-24 23:45:59

0001 #ifndef Calibration_EcalCalibAlgos_EcalPhiSymRecHit_h
0002 #define Calibration_EcalCalibAlgos_EcalPhiSymRecHit_h
0003 
0004 /** \class EcalPhiSymRecHit
0005  * 
0006  * Dataformat dedicated to Phi Symmetry ecal calibration
0007  * 
0008  * Note: SumEt array ordering:
0009  *       0         - central value
0010  *       1<->N/2   - misCalib<1
0011  *       N/2+1<->N - misCalib>1
0012  *
0013  * Original Author: Simone Pigazzini (2022)
0014  */
0015 
0016 #include <vector>
0017 #include <cassert>
0018 
0019 #include "DataFormats/DetId/interface/DetId.h"
0020 #include "DataFormats/EcalDetId/interface/EBDetId.h"
0021 #include "DataFormats/EcalDetId/interface/EEDetId.h"
0022 #include "DataFormats/EcalDetId/interface/EcalSubdetector.h"
0023 
0024 class EcalPhiSymRecHit {
0025 public:
0026   //---ctors---
0027   EcalPhiSymRecHit();
0028   EcalPhiSymRecHit(uint32_t id, unsigned int nMisCalibV, unsigned int status = 0);
0029   EcalPhiSymRecHit(uint32_t id, std::vector<float>& etValues, unsigned int status = 0);
0030 
0031   //---dtor---
0032   ~EcalPhiSymRecHit() = default;
0033 
0034   //---getters---
0035   inline uint32_t rawId() const { return id_; };
0036   inline int8_t eeRing() const { return eeRing_; };
0037   inline unsigned int statusCode() const { return chStatus_; };
0038   inline uint32_t nHits() const { return nHits_; };
0039   inline unsigned int nSumEt() const { return etSum_.size(); };
0040   inline float sumEt(int i = 0) const { return etSum_[i]; };
0041   inline float sumEt2() const { return et2Sum_; };
0042   inline float lcSum() const { return lcSum_; };
0043   inline float lc2Sum() const { return lc2Sum_; };
0044 
0045   //---setters---
0046   void setEERing(const int8_t& eering) { eeRing_ = eering; };
0047 
0048   //---utils---
0049   void addHit(const std::vector<float>& etValues, const float laserCorr = 0);
0050   void reset();
0051 
0052   //---operators---
0053   EcalPhiSymRecHit& operator+=(const EcalPhiSymRecHit& rhs);
0054 
0055 private:
0056   uint32_t id_;
0057   int8_t eeRing_;
0058   unsigned int chStatus_;
0059   uint32_t nHits_;
0060   std::vector<float> etSum_;
0061   float et2Sum_;
0062   float lcSum_;
0063   float lc2Sum_;
0064 };
0065 
0066 typedef std::vector<EcalPhiSymRecHit> EcalPhiSymRecHitCollection;
0067 
0068 #endif