CMS 3D CMS Logo

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

#include <EcalTrigPrimCompactColl.h>

Public Member Functions

 EcalTrigPrimCompactColl ()
 
void setValue (int ieta, int iphi, uint16_t sample)
 Set data. More...
 
void toEcalTrigPrimDigiCollection (EcalTrigPrimDigiCollection &dest) const
 
uint16_t raw (int ieta, int iphi) const
 get the raw word More...
 
uint16_t raw (const EcalTrigTowerDetId &ttId) const
 
int compressedEt (int ieta, int iphi) const
 get the encoded/compressed Et (8 bits) More...
 
int compressedEt (const EcalTrigTowerDetId &ttId) const
 
bool fineGrain (int ieta, int iphi) const
 get the fine-grain bit (1 bit) More...
 
bool fineGrain (const EcalTrigTowerDetId &ttId) const
 
int ttFlag (int ieta, int iphi) const
 get the Trigger tower Flag (3 bits) More...
 
int ttFlag (const EcalTrigTowerDetId &ttId) const
 
int sFGVB (int ieta, int iphi) const
 
int sFGVB (const EcalTrigTowerDetId &ttId) const
 
int l1aSpike (int ieta, int iphi) const
 
int l1aSpike (const EcalTrigTowerDetId &ttId) const
 

Static Private Member Functions

static size_t index (int ieta, int iphi)
 

Private Attributes

std::vector< uint16_t > data_
 
int16_t formatVers_
 

Static Private Attributes

static const int nBins = nPhiBins*nEtaBins
 
static const int nEtaBins = 56
 
static const int nPhiBins = 72
 

Detailed Description

This collection is used to store ECAL trigger primitive with a low footpring in ROOT EDM file.

Note that only the time sample of interest time is stored. In nornal operation data contains only this time sample.

The interface is similar to EcalTriggerPrimitiveSample one. The collection can also be converted to an EcalTrigPrimDigiCollection with the method toEcalTrigPrimDigiCollection().

The collection is generated with EcalCompactTrigPrimProducer module from package RecoLocalCalo/EcalRecProducers.

author: Ph. Gras CEA/IRFU Saclay

Definition at line 27 of file EcalTrigPrimCompactColl.h.

Constructor & Destructor Documentation

EcalTrigPrimCompactColl::EcalTrigPrimCompactColl ( )
inline

Definition at line 42 of file EcalTrigPrimCompactColl.h.

Member Function Documentation

int EcalTrigPrimCompactColl::compressedEt ( int  ieta,
int  iphi 
) const
inline

get the encoded/compressed Et (8 bits)

Definition at line 55 of file EcalTrigPrimCompactColl.h.

Referenced by raw().

55 { return raw(ieta, iphi)&0xFF; }
uint16_t raw(int ieta, int iphi) const
get the raw word
int EcalTrigPrimCompactColl::compressedEt ( const EcalTrigTowerDetId ttId) const
inline

Definition at line 56 of file EcalTrigPrimCompactColl.h.

References compressedEt(), fineGrain(), EcalTrigTowerDetId::ieta(), EcalTrigTowerDetId::iphi(), and raw().

Referenced by compressedEt().

56 { return compressedEt(ttId.ieta(), ttId.iphi()); }
int ieta() const
get the tower ieta
int compressedEt(int ieta, int iphi) const
get the encoded/compressed Et (8 bits)
int iphi() const
get the tower iphi
bool EcalTrigPrimCompactColl::fineGrain ( int  ieta,
int  iphi 
) const
inline

get the fine-grain bit (1 bit)

Definition at line 61 of file EcalTrigPrimCompactColl.h.

Referenced by compressedEt().

61 { return (raw(ieta, iphi)&0x100)!=0; }
uint16_t raw(int ieta, int iphi) const
get the raw word
bool EcalTrigPrimCompactColl::fineGrain ( const EcalTrigTowerDetId ttId) const
inline

Definition at line 62 of file EcalTrigPrimCompactColl.h.

References fineGrain(), EcalTrigTowerDetId::ieta(), EcalTrigTowerDetId::iphi(), raw(), and ttFlag().

Referenced by fineGrain().

62 { return fineGrain(ttId.ieta(), ttId.iphi()); }
int ieta() const
get the tower ieta
bool fineGrain(int ieta, int iphi) const
get the fine-grain bit (1 bit)
int iphi() const
get the tower iphi
static size_t EcalTrigPrimCompactColl::index ( int  ieta,
int  iphi 
)
inlinestaticprivate

Definition at line 35 of file EcalTrigPrimCompactColl.h.

References Exception, and alignCSCRings::r.

Referenced by BeautifulSoup.PageElement::insert(), and setValue().

35  {
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";
38  return r;
39  }
int EcalTrigPrimCompactColl::l1aSpike ( int  ieta,
int  iphi 
) const
inline

Gets the "strip fine grain veto bit" (sFGVB) used as L1A spike detection Deprecated. Use instead sFGVB() method. Indeed the name of the method being missleading, since it returns 0 for spike-compatible deposit.

Returns
0 spike-like pattern 1 EM-shower-like pattern

Definition at line 85 of file EcalTrigPrimCompactColl.h.

Referenced by sFGVB().

85 { return sFGVB(ieta, iphi); }
int sFGVB(int ieta, int iphi) const
int EcalTrigPrimCompactColl::l1aSpike ( const EcalTrigTowerDetId ttId) const
inline

Definition at line 86 of file EcalTrigPrimCompactColl.h.

References mps_fire::dest, sFGVB(), and toEcalTrigPrimDigiCollection().

86 { return sFGVB(ttId); }
int sFGVB(int ieta, int iphi) const
uint16_t EcalTrigPrimCompactColl::raw ( int  ieta,
int  iphi 
) const
inline

get the raw word

Definition at line 49 of file EcalTrigPrimCompactColl.h.

Referenced by compressedEt(), fineGrain(), raw(), setValue(), toEcalTrigPrimDigiCollection(), and ttFlag().

49 { return data_[index(ieta, iphi)]; }
std::vector< uint16_t > data_
static size_t index(int ieta, int iphi)
uint16_t EcalTrigPrimCompactColl::raw ( const EcalTrigTowerDetId ttId) const
inline

Definition at line 50 of file EcalTrigPrimCompactColl.h.

References compressedEt(), EcalTrigTowerDetId::ieta(), EcalTrigTowerDetId::iphi(), and raw().

Referenced by raw().

50 { return raw(ttId.ieta(), ttId.iphi()); }
int ieta() const
get the tower ieta
int iphi() const
get the tower iphi
uint16_t raw(int ieta, int iphi) const
get the raw word
void EcalTrigPrimCompactColl::setValue ( int  ieta,
int  iphi,
uint16_t  sample 
)
inline
int EcalTrigPrimCompactColl::sFGVB ( int  ieta,
int  iphi 
) const
inline

Gets the "strip fine grain veto bit" (sFGVB) used as L1A spike detection

Returns
0 spike like pattern 1 EM shower like pattern

Definition at line 75 of file EcalTrigPrimCompactColl.h.

Referenced by l1aSpike(), sFGVB(), and ttFlag().

75 { return (raw(ieta, iphi) >>12) & 0x1; }
uint16_t raw(int ieta, int iphi) const
get the raw word
int EcalTrigPrimCompactColl::sFGVB ( const EcalTrigTowerDetId ttId) const
inline

Definition at line 76 of file EcalTrigPrimCompactColl.h.

References EcalTrigTowerDetId::ieta(), EcalTrigTowerDetId::iphi(), l1aSpike(), and sFGVB().

Referenced by sFGVB().

76 { return sFGVB(ttId.ieta(), ttId.iphi()); }
int sFGVB(int ieta, int iphi) const
int ieta() const
get the tower ieta
int iphi() const
get the tower iphi
void EcalTrigPrimCompactColl::toEcalTrigPrimDigiCollection ( EcalTrigPrimDigiCollection dest) const

Definition at line 3 of file EcalTrigPrimCompactColl.cc.

References EcalBarrel, EcalEndcap, EcalTrigTowerDetId::ieta(), EcalTrigTowerDetId::iphi(), edm::SortedCollection< T, SORT >::push_back(), raw(), edm::SortedCollection< T, SORT >::reserve(), EcalTriggerPrimitiveDigi::setSample(), EcalTriggerPrimitiveDigi::setSize(), edm::SortedCollection< T, SORT >::sort(), EcalTrigTowerDetId::SUBDETIJMODE, edm::SortedCollection< T, SORT >::swap(), ecaldqm::ttId(), and ecaldqm::zside().

Referenced by l1aSpike().

3  {
4  const int nTtEtaBins = 56;
5  const int nTtPhiBins = 72;
7  tpColl.reserve(nTtEtaBins*nTtPhiBins);
8 
9  for(int zside = -1; zside <= 1; zside +=2){
10  for(int iabseta = 1; iabseta <= nTtEtaBins/2; ++iabseta){
11  EcalSubdetector subdet = (iabseta <= 17) ? EcalBarrel : EcalEndcap;
12  for(int iphi = 1; iphi <= 72; ++iphi){
13  const EcalTrigTowerDetId ttId(zside, subdet, iabseta, iphi, EcalTrigTowerDetId::SUBDETIJMODE);
15  const int rawTp = raw(ttId.ieta(), ttId.iphi());
16  const EcalTriggerPrimitiveSample tps(rawTp);
17  tp.setSize(1);
18  tp.setSample(0, tps);
19  tpColl.push_back(tp);
20  }
21  }
22  }
23  tpColl.sort();
24  dest.swap(tpColl);
25 }
static const int SUBDETIJMODE
void swap(SortedCollection &other)
void push_back(T const &t)
int zside(DetId const &)
unsigned ttId(DetId const &)
void reserve(size_type n)
EcalSubdetector
uint16_t raw(int ieta, int iphi) const
get the raw word
int EcalTrigPrimCompactColl::ttFlag ( int  ieta,
int  iphi 
) const
inline

get the Trigger tower Flag (3 bits)

Definition at line 67 of file EcalTrigPrimCompactColl.h.

Referenced by fineGrain().

67 { return (raw(ieta, iphi)>>9)&0x7; }
uint16_t raw(int ieta, int iphi) const
get the raw word
int EcalTrigPrimCompactColl::ttFlag ( const EcalTrigTowerDetId ttId) const
inline

Definition at line 68 of file EcalTrigPrimCompactColl.h.

References EcalTrigTowerDetId::ieta(), EcalTrigTowerDetId::iphi(), raw(), sFGVB(), and ttFlag().

Referenced by ttFlag().

68 { return ttFlag(ttId.ieta(), ttId.iphi()); }
int ttFlag(int ieta, int iphi) const
get the Trigger tower Flag (3 bits)
int ieta() const
get the tower ieta
int iphi() const
get the tower iphi

Member Data Documentation

std::vector<uint16_t> EcalTrigPrimCompactColl::data_
private

Definition at line 93 of file EcalTrigPrimCompactColl.h.

Referenced by setValue().

int16_t EcalTrigPrimCompactColl::formatVers_
private

Definition at line 92 of file EcalTrigPrimCompactColl.h.

const int EcalTrigPrimCompactColl::nBins = nPhiBins*nEtaBins
staticprivate

Definition at line 32 of file EcalTrigPrimCompactColl.h.

const int EcalTrigPrimCompactColl::nEtaBins = 56
staticprivate

Definition at line 31 of file EcalTrigPrimCompactColl.h.

const int EcalTrigPrimCompactColl::nPhiBins = 72
staticprivate

Definition at line 30 of file EcalTrigPrimCompactColl.h.