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

Definition at line 43 of file EcalTrigPrimCompactColl.h.

Member Function Documentation

◆ compressedEt() [1/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; }
uint16_t raw(int ieta, int iphi) const
get the raw word

◆ compressedEt() [2/2]

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

Definition at line 57 of file EcalTrigPrimCompactColl.h.

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

Referenced by compressedEt().

57 { return compressedEt(ttId.ieta(), ttId.iphi()); }
unsigned ttId(DetId const &, EcalElectronicsMapping const *)
int compressedEt(int ieta, int iphi) const
get the encoded/compressed Et (8 bits)

◆ fineGrain() [1/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; }
uint16_t raw(int ieta, int iphi) const
get the raw word

◆ fineGrain() [2/2]

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

Definition at line 63 of file EcalTrigPrimCompactColl.h.

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

Referenced by fineGrain().

63 { return fineGrain(ttId.ieta(), ttId.iphi()); }
bool fineGrain(int ieta, int iphi) const
get the fine-grain bit (1 bit)
unsigned ttId(DetId const &, EcalElectronicsMapping const *)

◆ index()

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

Definition at line 34 of file EcalTrigPrimCompactColl.h.

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

Referenced by 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  }

◆ l1aSpike() [1/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.

◆ l1aSpike() [2/2]

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

Definition at line 87 of file EcalTrigPrimCompactColl.h.

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

87 { return sFGVB(ttId); }
unsigned ttId(DetId const &, EcalElectronicsMapping const *)
int sFGVB(int ieta, int iphi) const

◆ raw() [1/2]

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().

◆ raw() [2/2]

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

Definition at line 51 of file EcalTrigPrimCompactColl.h.

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

Referenced by raw().

51 { return raw(ttId.ieta(), ttId.iphi()); }
uint16_t raw(int ieta, int iphi) const
get the raw word
unsigned ttId(DetId const &, EcalElectronicsMapping const *)

◆ setValue()

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

◆ sFGVB() [1/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.

Referenced by l1aSpike().

76 { return (raw(ieta, iphi) >> 12) & 0x1; }
uint16_t raw(int ieta, int iphi) const
get the raw word

◆ sFGVB() [2/2]

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

Definition at line 77 of file EcalTrigPrimCompactColl.h.

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

Referenced by sFGVB().

77 { return sFGVB(ttId.ieta(), ttId.iphi()); }
unsigned ttId(DetId const &, EcalElectronicsMapping const *)
int sFGVB(int ieta, int iphi) const

◆ toEcalTrigPrimDigiCollection()

void EcalTrigPrimCompactColl::toEcalTrigPrimDigiCollection ( EcalTrigPrimDigiCollection dest) const

Definition at line 3 of file EcalTrigPrimCompactColl.cc.

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().

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 }
uint16_t raw(int ieta, int iphi) const
get the raw word
static const int SUBDETIJMODE
void push_back(T const &t)
int zside(DetId const &)
unsigned ttId(DetId const &, EcalElectronicsMapping const *)
void reserve(size_type n)
EcalSubdetector

◆ ttFlag() [1/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; }
uint16_t raw(int ieta, int iphi) const
get the raw word

◆ ttFlag() [2/2]

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

Definition at line 69 of file EcalTrigPrimCompactColl.h.

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

Referenced by ttFlag().

69 { return ttFlag(ttId.ieta(), ttId.iphi()); }
unsigned ttId(DetId const &, EcalElectronicsMapping const *)
int ttFlag(int ieta, int iphi) const
get the Trigger tower Flag (3 bits)

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().