CMS 3D CMS Logo

Public Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes

EcalTrigPrimCompactColl Class Reference

#include <EcalTrigPrimCompactColl.h>

List of all members.

Public Member Functions

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

References raw().

{ return raw(ieta, iphi)&0xFF; }
int EcalTrigPrimCompactColl::compressedEt ( const EcalTrigTowerDetId ttId) const [inline]

Definition at line 56 of file EcalTrigPrimCompactColl.h.

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

Referenced by compressedEt().

{ return compressedEt(ttId.ieta(), ttId.iphi()); }
bool EcalTrigPrimCompactColl::fineGrain ( const EcalTrigTowerDetId ttId) const [inline]

Definition at line 62 of file EcalTrigPrimCompactColl.h.

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

Referenced by fineGrain().

{ return fineGrain(ttId.ieta(), ttId.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.

References raw().

{ return (raw(ieta, iphi)&0x100)!=0; }
static size_t EcalTrigPrimCompactColl::index ( int  ieta,
int  iphi 
) [inline, static, private]

Definition at line 35 of file EcalTrigPrimCompactColl.h.

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

Referenced by raw(), and setValue().

                                         {
    size_t r = unsigned(((ieta<0) ? (ieta+28) : (ieta+27))*nPhiBins + (iphi -1));
    if(r >= (unsigned)nBins) throw cms::Exception("Invalid argument") << "Trigger tower index (" << ieta << "," << iphi << ") are out of range";
    return r;
  }
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.

References sFGVB().

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

Definition at line 86 of file EcalTrigPrimCompactColl.h.

References sFGVB().

{ return sFGVB(ttId); }
uint16_t EcalTrigPrimCompactColl::raw ( const EcalTrigTowerDetId ttId) const [inline]

Definition at line 50 of file EcalTrigPrimCompactColl.h.

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

Referenced by raw().

{ return raw(ttId.ieta(), ttId.iphi()); }
uint16_t EcalTrigPrimCompactColl::raw ( int  ieta,
int  iphi 
) const [inline]

get the raw word

Definition at line 49 of file EcalTrigPrimCompactColl.h.

References data_, and index().

Referenced by compressedEt(), fineGrain(), sFGVB(), toEcalTrigPrimDigiCollection(), and ttFlag().

{ return data_[index(ieta, iphi)]; }
void EcalTrigPrimCompactColl::setValue ( int  ieta,
int  iphi,
uint16_t  sample 
) [inline]

Set data.

Definition at line 45 of file EcalTrigPrimCompactColl.h.

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

{ data_[index(ieta, iphi)] = sample;}
int EcalTrigPrimCompactColl::sFGVB ( const EcalTrigTowerDetId ttId) const [inline]

Definition at line 76 of file EcalTrigPrimCompactColl.h.

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

Referenced by sFGVB().

{ return sFGVB(ttId.ieta(), ttId.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 75 of file EcalTrigPrimCompactColl.h.

References raw().

Referenced by l1aSpike().

{ return (raw(ieta, iphi) >>12) & 0x1; }
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(), and ecaldqm::ttId().

                                                                                                {
  const int nTtEtaBins = 56;
  const int nTtPhiBins = 72;
  EcalTrigPrimDigiCollection tpColl;
  tpColl.reserve(nTtEtaBins*nTtPhiBins);
  
  for(int zside = -1; zside <= 1; zside +=2){
    for(int iabseta = 1; iabseta <= nTtEtaBins/2; ++iabseta){
      EcalSubdetector subdet = (iabseta <= 17) ? EcalBarrel : EcalEndcap;
      for(int iphi = 1; iphi <= 72; ++iphi){
        const EcalTrigTowerDetId ttId(zside, subdet, iabseta, iphi, EcalTrigTowerDetId::SUBDETIJMODE);
        EcalTriggerPrimitiveDigi tp(ttId);
        const int rawTp = raw(ttId.ieta(), ttId.iphi());
        const EcalTriggerPrimitiveSample tps(rawTp);
        tp.setSize(1);
        tp.setSample(0, tps);
        tpColl.push_back(tp);
      }
    }
  }
  tpColl.sort();
  dest.swap(tpColl);
}
int EcalTrigPrimCompactColl::ttFlag ( int  ieta,
int  iphi 
) const [inline]

get the Trigger tower Flag (3 bits)

Definition at line 67 of file EcalTrigPrimCompactColl.h.

References raw().

{ return (raw(ieta, iphi)>>9)&0x7; }
int EcalTrigPrimCompactColl::ttFlag ( const EcalTrigTowerDetId ttId) const [inline]

Definition at line 68 of file EcalTrigPrimCompactColl.h.

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

Referenced by ttFlag().

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

Member Data Documentation

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

Definition at line 93 of file EcalTrigPrimCompactColl.h.

Referenced by raw(), and setValue().

Definition at line 92 of file EcalTrigPrimCompactColl.h.

const int EcalTrigPrimCompactColl::nBins = nPhiBins*nEtaBins [static, private]

Definition at line 32 of file EcalTrigPrimCompactColl.h.

Referenced by index().

const int EcalTrigPrimCompactColl::nEtaBins = 56 [static, private]

Definition at line 31 of file EcalTrigPrimCompactColl.h.

const int EcalTrigPrimCompactColl::nPhiBins = 72 [static, private]

Definition at line 30 of file EcalTrigPrimCompactColl.h.

Referenced by index().