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

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

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::EcalTrigPrimCompactColl ( )
inline

Definition at line 43 of file EcalTrigPrimCompactColl.h.

43 : formatVers_(0), data_(nBins){};

Member Function Documentation

◆ compressedEt() [1/2]

int EcalTrigPrimCompactColl::compressedEt ( const EcalTrigTowerDetId ttId) const
inline

Definition at line 57 of file EcalTrigPrimCompactColl.h.

57 { return compressedEt(ttId.ieta(), ttId.iphi()); }

References compressedEt(), and ecaldqm::ttId().

Referenced by compressedEt().

◆ compressedEt() [2/2]

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; }

◆ fineGrain() [1/2]

bool EcalTrigPrimCompactColl::fineGrain ( const EcalTrigTowerDetId ttId) const
inline

Definition at line 63 of file EcalTrigPrimCompactColl.h.

63 { return fineGrain(ttId.ieta(), ttId.iphi()); }

References fineGrain(), and ecaldqm::ttId().

Referenced by fineGrain().

◆ fineGrain() [2/2]

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; }

◆ index()

static size_t EcalTrigPrimCompactColl::index ( int  ieta,
int  iphi 
)
inlinestaticprivate

Definition at line 34 of file EcalTrigPrimCompactColl.h.

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  }

References Exception, LEDCalibrationChannels::ieta, LEDCalibrationChannels::iphi, nBins, nPhiBins, and alignCSCRings::r.

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

◆ l1aSpike() [1/2]

int EcalTrigPrimCompactColl::l1aSpike ( const EcalTrigTowerDetId ttId) const
inline

Definition at line 87 of file EcalTrigPrimCompactColl.h.

87 { return sFGVB(ttId); }

References sFGVB(), and ecaldqm::ttId().

◆ l1aSpike() [2/2]

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); }

◆ raw() [1/2]

uint16_t EcalTrigPrimCompactColl::raw ( const EcalTrigTowerDetId ttId) const
inline

Definition at line 51 of file EcalTrigPrimCompactColl.h.

51 { return raw(ttId.ieta(), ttId.iphi()); }

References raw(), and ecaldqm::ttId().

Referenced by raw().

◆ raw() [2/2]

uint16_t EcalTrigPrimCompactColl::raw ( int  ieta,
int  iphi 
) const
inline

get the raw word

Definition at line 50 of file EcalTrigPrimCompactColl.h.

50 { return data_[index(ieta, iphi)]; }

Referenced by toEcalTrigPrimDigiCollection().

◆ setValue()

void EcalTrigPrimCompactColl::setValue ( int  ieta,
int  iphi,
uint16_t  sample 
)
inline

◆ sFGVB() [1/2]

int EcalTrigPrimCompactColl::sFGVB ( const EcalTrigTowerDetId ttId) const
inline

Definition at line 77 of file EcalTrigPrimCompactColl.h.

77 { return sFGVB(ttId.ieta(), ttId.iphi()); }

References sFGVB(), and ecaldqm::ttId().

Referenced by sFGVB().

◆ sFGVB() [2/2]

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.

76 { return (raw(ieta, iphi) >> 12) & 0x1; }

Referenced by l1aSpike().

◆ toEcalTrigPrimDigiCollection()

void EcalTrigPrimCompactColl::toEcalTrigPrimDigiCollection ( EcalTrigPrimDigiCollection dest) const

Definition at line 3 of file EcalTrigPrimCompactColl.cc.

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) {
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 }

References mps_fire::dest, EcalBarrel, EcalEndcap, LEDCalibrationChannels::iphi, edm::SortedCollection< T, SORT >::push_back(), raw(), edm::SortedCollection< T, SORT >::reserve(), edm::SortedCollection< T, SORT >::sort(), EcalTrigTowerDetId::SUBDETIJMODE, cmsswSequenceInfo::tp, ecaldqm::ttId(), and ecaldqm::zside().

◆ ttFlag() [1/2]

int EcalTrigPrimCompactColl::ttFlag ( const EcalTrigTowerDetId ttId) const
inline

Definition at line 69 of file EcalTrigPrimCompactColl.h.

69 { return ttFlag(ttId.ieta(), ttId.iphi()); }

References ttFlag(), and ecaldqm::ttId().

Referenced by ttFlag().

◆ ttFlag() [2/2]

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; }

Member Data Documentation

◆ data_

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

Definition at line 94 of file EcalTrigPrimCompactColl.h.

Referenced by setValue().

◆ formatVers_

int16_t EcalTrigPrimCompactColl::formatVers_
private

Definition at line 93 of file EcalTrigPrimCompactColl.h.

◆ nBins

const int EcalTrigPrimCompactColl::nBins = nPhiBins * nEtaBins
staticprivate

Definition at line 31 of file EcalTrigPrimCompactColl.h.

Referenced by index().

◆ nEtaBins

const int EcalTrigPrimCompactColl::nEtaBins = 56
staticprivate

Definition at line 30 of file EcalTrigPrimCompactColl.h.

◆ nPhiBins

const int EcalTrigPrimCompactColl::nPhiBins = 72
staticprivate

Definition at line 29 of file EcalTrigPrimCompactColl.h.

Referenced by index().

EcalTrigTowerDetId::SUBDETIJMODE
static const int SUBDETIJMODE
Definition: EcalTrigTowerDetId.h:107
edm::SortedCollection::sort
void sort()
Definition: SortedCollection.h:302
simplePhotonAnalyzer_cfi.sample
sample
Definition: simplePhotonAnalyzer_cfi.py:12
ecaldqm::zside
int zside(DetId const &)
Definition: EcalDQMCommonUtils.cc:189
ecaldqm::ttId
unsigned ttId(DetId const &, EcalElectronicsMapping const *)
Definition: EcalDQMCommonUtils.cc:99
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
EcalSubdetector
EcalSubdetector
Definition: EcalSubdetector.h:10
EcalTrigTowerDetId
Definition: EcalTrigTowerDetId.h:14
edm::SortedCollection::push_back
void push_back(T const &t)
Definition: SortedCollection.h:188
EcalTrigPrimCompactColl::data_
std::vector< uint16_t > data_
Definition: EcalTrigPrimCompactColl.h:94
EcalBarrel
Definition: EcalSubdetector.h:10
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
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
cmsswSequenceInfo.tp
tp
Definition: cmsswSequenceInfo.py:17
EcalEndcap
Definition: EcalSubdetector.h:10
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
alignCSCRings.r
r
Definition: alignCSCRings.py:93
EcalTrigPrimCompactColl::nPhiBins
static const int nPhiBins
Definition: EcalTrigPrimCompactColl.h:29
edm::SortedCollection::reserve
void reserve(size_type n)
Definition: SortedCollection.h:225
EcalTriggerPrimitiveDigi
Definition: EcalTriggerPrimitiveDigi.h:16
Exception
Definition: hltDiff.cc:245
EcalTrigPrimCompactColl::ttFlag
int ttFlag(int ieta, int iphi) const
get the Trigger tower Flag (3 bits)
Definition: EcalTrigPrimCompactColl.h:68
EcalTriggerPrimitiveSample
Definition: EcalTriggerPrimitiveSample.h:12
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