CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 43 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 56 of file EcalTrigPrimCompactColl.h.

56 { 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 57 of file EcalTrigPrimCompactColl.h.

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

Referenced by compressedEt().

57 { 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 62 of file EcalTrigPrimCompactColl.h.

62 { 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 63 of file EcalTrigPrimCompactColl.h.

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

Referenced by fineGrain().

63 { 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 34 of file EcalTrigPrimCompactColl.h.

References Exception, nBins, nPhiBins, and alignCSCRings::r.

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

34  {
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  }
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 86 of file EcalTrigPrimCompactColl.h.

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

Definition at line 87 of file EcalTrigPrimCompactColl.h.

References sFGVB().

87 { 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 50 of file EcalTrigPrimCompactColl.h.

Referenced by toEcalTrigPrimDigiCollection().

50 { 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 51 of file EcalTrigPrimCompactColl.h.

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

Referenced by raw().

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

Set data.

Definition at line 46 of file EcalTrigPrimCompactColl.h.

References data_, index(), and makeMEIFBenchmarkPlots::sample.

46 { data_[index(ieta, iphi)] = sample; }
std::vector< uint16_t > data_
static size_t index(int ieta, int iphi)
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 76 of file EcalTrigPrimCompactColl.h.

Referenced by l1aSpike().

76 { 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 77 of file EcalTrigPrimCompactColl.h.

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

Referenced by sFGVB().

77 { 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(), cmsswSequenceInfo::tp, ecaldqm::ttId(), and ecaldqm::zside().

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 &, EcalElectronicsMapping 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 68 of file EcalTrigPrimCompactColl.h.

68 { 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 69 of file EcalTrigPrimCompactColl.h.

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

Referenced by ttFlag().

69 { 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 94 of file EcalTrigPrimCompactColl.h.

Referenced by setValue().

int16_t EcalTrigPrimCompactColl::formatVers_
private

Definition at line 93 of file EcalTrigPrimCompactColl.h.

const int EcalTrigPrimCompactColl::nBins = nPhiBins * nEtaBins
staticprivate

Definition at line 31 of file EcalTrigPrimCompactColl.h.

Referenced by index().

const int EcalTrigPrimCompactColl::nEtaBins = 56
staticprivate

Definition at line 30 of file EcalTrigPrimCompactColl.h.

const int EcalTrigPrimCompactColl::nPhiBins = 72
staticprivate

Definition at line 29 of file EcalTrigPrimCompactColl.h.

Referenced by index().