1 #ifndef ECALTRIGPRIMCOMPACTCOLL_H 2 #define ECALTRIGPRIMCOMPACTCOLL_H 35 static size_t index(
int ieta,
int iphi){
36 size_t r = unsigned(((ieta<0) ? (ieta+28) : (ieta+27))*nPhiBins + (iphi -1));
37 if(r >= (
unsigned)nBins)
throw cms::Exception(
"Invalid argument") <<
"Trigger tower index (" << ieta <<
"," << iphi <<
") are out of range";
48 uint16_t
raw(
int ieta,
int iphi)
const {
return data_[
index(ieta, iphi)]; }
54 int compressedEt(
int ieta,
int iphi)
const {
return raw(ieta, iphi)&0xFF; }
60 bool fineGrain(
int ieta,
int iphi)
const {
return (
raw(ieta, iphi)&0x100)!=0; }
66 int ttFlag(
int ieta,
int iphi)
const {
return (
raw(ieta, iphi)>>9)&0x7; }
72 int sFGVB(
int ieta,
int iphi)
const {
return (
raw(ieta, iphi) >>12) & 0x1; }
80 int l1aSpike(
int ieta,
int iphi)
const {
return sFGVB(ieta, iphi); }
96 #endif //ECALTRIGPRIMCOMPACTCOLL_H not defined
EcalTrigPrimCompactColl()
bool fineGrain(const EcalTrigTowerDetId &ttId) const
int ttFlag(int ieta, int iphi) const
get the Trigger tower Flag (3 bits)
void setValue(int ieta, int iphi, uint16_t sample)
Set data.
std::vector< uint16_t > data_
int sFGVB(int ieta, int iphi) const
unsigned ttId(DetId const &)
int ieta() const
get the tower ieta
int l1aSpike(const EcalTrigTowerDetId &ttId) const
int compressedEt(int ieta, int iphi) const
get the encoded/compressed Et (8 bits)
int l1aSpike(int ieta, int iphi) const
bool fineGrain(int ieta, int iphi) const
get the fine-grain bit (1 bit)
int iphi() const
get the tower iphi
edm::SortedCollection< EcalTriggerPrimitiveDigi > EcalTrigPrimDigiCollection
static const int nEtaBins
void toEcalTrigPrimDigiCollection(EcalTrigPrimDigiCollection &dest) const
int ttFlag(const EcalTrigTowerDetId &ttId) const
static size_t index(int ieta, int iphi)
uint16_t raw(int ieta, int iphi) const
get the raw word
uint16_t raw(const EcalTrigTowerDetId &ttId) const
static const int nPhiBins
int sFGVB(const EcalTrigTowerDetId &ttId) const
int compressedEt(const EcalTrigTowerDetId &ttId) const