CMS 3D CMS Logo

EcalTrigPrimCompactColl.h
Go to the documentation of this file.
1 #ifndef ECALTRIGPRIMCOMPACTCOLL_H
2 #define ECALTRIGPRIMCOMPACTCOLL_H
3 
4 #include <vector>
5 #include <cinttypes>
7 
11 
28 private:
29  static const int nPhiBins = 72;
30  static const int nEtaBins = 56;
31  static const int nBins = nPhiBins * nEtaBins;
32 
33 private:
34  static size_t index(int ieta, int iphi) {
35  size_t r = unsigned(((ieta < 0) ? (ieta + 28) : (ieta + 27)) * nPhiBins + (iphi - 1));
36  if (r >= (unsigned)nBins)
37  throw cms::Exception("Invalid argument")
38  << "Trigger tower index (" << ieta << "," << iphi << ") are out of range";
39  return r;
40  }
41 
42 public:
44 
46  void setValue(int ieta, int iphi, uint16_t sample) { data_[index(ieta, iphi)] = sample; }
47 
49  uint16_t raw(int ieta, int iphi) const { return data_[index(ieta, iphi)]; }
51  uint16_t raw(const EcalTrigTowerDetId& ttId) const { return raw(ttId.ieta(), ttId.iphi()); }
53 
55  int compressedEt(int ieta, int iphi) const { return raw(ieta, iphi) & 0xFF; }
57  int compressedEt(const EcalTrigTowerDetId& ttId) const { return compressedEt(ttId.ieta(), ttId.iphi()); }
59 
61  bool fineGrain(int ieta, int iphi) const { return (raw(ieta, iphi) & 0x100) != 0; }
63  bool fineGrain(const EcalTrigTowerDetId& ttId) const { return fineGrain(ttId.ieta(), ttId.iphi()); }
65 
67  int ttFlag(int ieta, int iphi) const { return (raw(ieta, iphi) >> 9) & 0x7; }
69  int ttFlag(const EcalTrigTowerDetId& ttId) const { return ttFlag(ttId.ieta(), ttId.iphi()); }
71 
73  int sFGVB(int ieta, int iphi) const { return (raw(ieta, iphi) >> 12) & 0x1; }
77  int sFGVB(const EcalTrigTowerDetId& ttId) const { return sFGVB(ttId.ieta(), ttId.iphi()); }
79 
81  int l1aSpike(int ieta, int iphi) const { return sFGVB(ieta, iphi); }
87  int l1aSpike(const EcalTrigTowerDetId& ttId) const { return sFGVB(ttId); }
89 
91 
92 private:
93  int16_t formatVers_;
94  std::vector<uint16_t> data_;
95 };
96 
97 #endif //ECALTRIGPRIMCOMPACTCOLL_H not defined
simplePhotonAnalyzer_cfi.sample
sample
Definition: simplePhotonAnalyzer_cfi.py:12
EcalTrigPrimCompactColl
Definition: EcalTrigPrimCompactColl.h:27
ecaldqm::ttId
unsigned ttId(DetId const &)
Definition: EcalDQMCommonUtils.cc:101
EcalTrigPrimDigiCollection
edm::SortedCollection< EcalTriggerPrimitiveDigi > EcalTrigPrimDigiCollection
Definition: EcalTrigPrimCompactColl.h:10
edm::SortedCollection
Definition: SortedCollection.h:49
EcalTrigPrimCompactColl::sFGVB
int sFGVB(int ieta, int iphi) const
Definition: EcalTrigPrimCompactColl.h:76
EcalTrigPrimCompactColl::formatVers_
int16_t formatVers_
Definition: EcalTrigPrimCompactColl.h:93
EcalTrigTowerDetId
Definition: EcalTrigTowerDetId.h:14
EcalTrigPrimCompactColl::ttFlag
int ttFlag(const EcalTrigTowerDetId &ttId) const
Definition: EcalTrigPrimCompactColl.h:69
EcalTrigPrimCompactColl::data_
std::vector< uint16_t > data_
Definition: EcalTrigPrimCompactColl.h:94
EcalTriggerPrimitiveDigi.h
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
EcalTrigPrimCompactColl::setValue
void setValue(int ieta, int iphi, uint16_t sample)
Set data.
Definition: EcalTrigPrimCompactColl.h:46
EcalTrigPrimCompactColl::fineGrain
bool fineGrain(const EcalTrigTowerDetId &ttId) const
Definition: EcalTrigPrimCompactColl.h:63
EcalTrigPrimCompactColl::compressedEt
int compressedEt(int ieta, int iphi) const
get the encoded/compressed Et (8 bits)
Definition: EcalTrigPrimCompactColl.h:56
EcalTrigPrimCompactColl::nBins
static const int nBins
Definition: EcalTrigPrimCompactColl.h:31
EcalTrigPrimCompactColl::nEtaBins
static const int nEtaBins
Definition: EcalTrigPrimCompactColl.h:30
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
EcalTrigPrimCompactColl::compressedEt
int compressedEt(const EcalTrigTowerDetId &ttId) const
Definition: EcalTrigPrimCompactColl.h:57
EcalTrigPrimCompactColl::l1aSpike
int l1aSpike(const EcalTrigTowerDetId &ttId) const
Definition: EcalTrigPrimCompactColl.h:87
EcalTrigPrimCompactColl::toEcalTrigPrimDigiCollection
void toEcalTrigPrimDigiCollection(EcalTrigPrimDigiCollection &dest) const
Definition: EcalTrigPrimCompactColl.cc:3
EcalTrigPrimCompactColl::raw
uint16_t raw(const EcalTrigTowerDetId &ttId) const
Definition: EcalTrigPrimCompactColl.h:51
alignCSCRings.r
r
Definition: alignCSCRings.py:93
EcalTrigPrimCompactColl::nPhiBins
static const int nPhiBins
Definition: EcalTrigPrimCompactColl.h:29
EcalTrigPrimCompactColl::sFGVB
int sFGVB(const EcalTrigTowerDetId &ttId) const
Definition: EcalTrigPrimCompactColl.h:77
SortedCollection.h
Exception
Definition: hltDiff.cc:246
EcalTrigPrimCompactColl::l1aSpike
int l1aSpike(int ieta, int iphi) const
Definition: EcalTrigPrimCompactColl.h:86
EcalTrigPrimCompactColl::ttFlag
int ttFlag(int ieta, int iphi) const
get the Trigger tower Flag (3 bits)
Definition: EcalTrigPrimCompactColl.h:68
Exception.h
EcalTrigPrimCompactColl::EcalTrigPrimCompactColl
EcalTrigPrimCompactColl()
Definition: EcalTrigPrimCompactColl.h:43
EcalTrigPrimCompactColl::index
static size_t index(int ieta, int iphi)
Definition: EcalTrigPrimCompactColl.h:34
EcalTrigPrimCompactColl::fineGrain
bool fineGrain(int ieta, int iphi) const
get the fine-grain bit (1 bit)
Definition: EcalTrigPrimCompactColl.h:62
EcalTrigPrimCompactColl::raw
uint16_t raw(int ieta, int iphi) const
get the raw word
Definition: EcalTrigPrimCompactColl.h:50
mps_fire.dest
dest
Definition: mps_fire.py:179