CMS 3D CMS Logo

Public Member Functions | Static Public Attributes | Private Attributes

EcalElectronicsId Class Reference

Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [2:0] xtal Index starts from 1. More...

#include <EcalElectronicsId.h>

List of all members.

Public Member Functions

int channelId () const
 so far for EndCap only :
int dccId () const
 get the DCC (Ecal Local DCC value not global one) id
 EcalElectronicsId (uint32_t)
 EcalElectronicsId ()
 EcalElectronicsId (int dccid, int towerid, int stripid, int xtalid)
int linearIndex () const
 get a fast, compact, unique index for linear lookups (maximum value = 4194303)
int operator!= (const EcalElectronicsId &id) const
uint32_t operator() ()
int operator< (const EcalElectronicsId &id) const
 Compare the id to another id for use in a map.
int operator== (const EcalElectronicsId &id) const
uint32_t rawId () const
int stripId () const
 get the tower id
EcalSubdetector subdet () const
 get the subdet
int towerId () const
 get the tower id
int xtalId () const
 get the channel id
int zside () const
 zside = +1 or -1

Static Public Attributes

static const int DCC_EBM = 10
static const int DCC_EBP = 28
static const int DCC_EEM = 1
static const int DCC_EEP = 46
static const int DCCID_PHI0_EBM = 10
static const int DCCID_PHI0_EBP = 28
static const int kDCCChannelBoundary = 17
static const int MAX_CHANNELID = 25
static const int MAX_DCCID = 54
static const int MAX_DCCID_EBM = 27
static const int MAX_DCCID_EBP = 45
static const int MAX_DCCID_EEM = 9
static const int MAX_DCCID_EEP = 54
static const int MAX_STRIPID = 5
static const int MAX_TOWERID = 70
static const int MAX_XTALID = 5
static const int MIN_CHANNELID = 1
static const int MIN_DCCID = 1
static const int MIN_DCCID_EBM = 10
static const int MIN_DCCID_EBP = 28
static const int MIN_DCCID_EEM = 1
static const int MIN_DCCID_EEP = 46
static const int MIN_STRIPID = 1
static const int MIN_TOWERID = 1
static const int MIN_XTALID = 1

Private Attributes

uint32_t EcalElectronicsId_

Detailed Description

Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [2:0] xtal Index starts from 1.

Definition at line 20 of file EcalElectronicsId.h.


Constructor & Destructor Documentation

EcalElectronicsId::EcalElectronicsId ( )

Default constructor -- invalid value

Definition at line 8 of file EcalElectronicsId.cc.

References EcalElectronicsId_.

                                     {
  EcalElectronicsId_=0xFFFFFFFFu;
}
EcalElectronicsId::EcalElectronicsId ( uint32_t  id)

from raw

Definition at line 12 of file EcalElectronicsId.cc.

References EcalElectronicsId_.

EcalElectronicsId::EcalElectronicsId ( int  dccid,
int  towerid,
int  stripid,
int  xtalid 
)

Constructor from dcc,tower,channel

Definition at line 16 of file EcalElectronicsId.cc.

References EcalElectronicsId_, Exception, MAX_DCCID, MAX_STRIPID, MAX_TOWERID, MAX_XTALID, MIN_DCCID, MIN_STRIPID, MIN_TOWERID, and MIN_XTALID.

                                                                                   {
  if ( (dccid < MIN_DCCID) || (dccid > MAX_DCCID) ||  
       (towerid < MIN_TOWERID) || (towerid > MAX_TOWERID) ||  
       (stripid < MIN_STRIPID) || (stripid > MAX_STRIPID) ||  
       (xtalid < MIN_XTALID) || (xtalid > MAX_XTALID) )
    throw cms::Exception("InvalidDetId") << "EcalElectronicsId:  Cannot create object.  Indexes out of bounds. Dcc tower strip xtal " << dccid << " " << towerid << " " << stripid << " " << xtalid << ".";
  EcalElectronicsId_= (xtalid&0x7) | ( (stripid&0x7) << 3) | ( (towerid&0x7F) << 6) | ((dccid&0x7F) << 13);
}

Member Function Documentation

int EcalElectronicsId::channelId ( ) const

so far for EndCap only :

Definition at line 72 of file EcalElectronicsId.cc.

References dccId(), EEQuadrant(), strip(), stripId(), towerId(), and xtalId().

Referenced by EcalTestPulseAnalyzer::analyze(), EcalABAnalyzer::analyze(), EcalLaserAnalyzer::analyze(), EcalPerEvtLaserAnalyzer::analyze(), and EcalLaserAnalyzer2::analyze().

                                       {
 int dcc = dccId() ;
 int dcc_channel = towerId();
 int quadrant = EEQuadrant(dcc, dcc_channel);
 int strip = stripId();
 int xtal = xtalId();
 int channel;
 if (quadrant ==1 || quadrant== 3) channel = 5*(strip-1) + xtal;
 else channel = 5*(xtal-1) + strip;
 return channel;
}
int EcalElectronicsId::dccId ( ) const [inline]
int EcalElectronicsId::linearIndex ( ) const [inline]

get a fast, compact, unique index for linear lookups (maximum value = 4194303)

Definition at line 50 of file EcalElectronicsId.h.

References EcalElectronicsId_.

{ return (EcalElectronicsId_)&0x3FFFFF; }
int EcalElectronicsId::operator!= ( const EcalElectronicsId id) const [inline]

Non-Equality operator

Definition at line 88 of file EcalElectronicsId.h.

References EcalElectronicsId_.

{ return id.EcalElectronicsId_!=EcalElectronicsId_; }
uint32_t EcalElectronicsId::operator() ( ) [inline]

Definition at line 31 of file EcalElectronicsId.h.

References EcalElectronicsId_.

{ return EcalElectronicsId_; }
int EcalElectronicsId::operator< ( const EcalElectronicsId id) const [inline]

Compare the id to another id for use in a map.

Definition at line 90 of file EcalElectronicsId.h.

References EcalElectronicsId_.

{ return EcalElectronicsId_<id.EcalElectronicsId_; }
int EcalElectronicsId::operator== ( const EcalElectronicsId id) const [inline]

Equality operator

Definition at line 86 of file EcalElectronicsId.h.

References EcalElectronicsId_.

{ return id.EcalElectronicsId_==EcalElectronicsId_; }
uint32_t EcalElectronicsId::rawId ( ) const [inline]
int EcalElectronicsId::stripId ( ) const [inline]
EcalSubdetector EcalElectronicsId::subdet ( ) const

get the subdet

Definition at line 26 of file EcalElectronicsId.cc.

References dccId(), EcalBarrel, EcalEndcap, MAX_DCCID_EBM, MAX_DCCID_EBP, MIN_DCCID_EBM, and MIN_DCCID_EBP.

Referenced by EcalElectronicsMapping::getElectronicsId(), and EcalDetIdToBeRecoveredProducer::produce().

                                                {
        int dcc = dccId();
        if ( (dcc >= MIN_DCCID_EBM && dcc <= MAX_DCCID_EBM) ||
             (dcc >= MIN_DCCID_EBP && dcc <= MAX_DCCID_EBP) ) return EcalBarrel;
        else return EcalEndcap;
}
int EcalElectronicsId::towerId ( ) const [inline]
int EcalElectronicsId::xtalId ( ) const [inline]
int EcalElectronicsId::zside ( ) const

zside = +1 or -1

Definition at line 33 of file EcalElectronicsId.cc.

References dccId(), MAX_DCCID_EBM, MAX_DCCID_EBP, MAX_DCCID_EEM, MAX_DCCID_EEP, MIN_DCCID_EBM, MIN_DCCID_EBP, MIN_DCCID_EEM, and MIN_DCCID_EEP.

Referenced by EcalSelectiveReadout::eeRuInterest().

                                   {
        int dcc = dccId();
        if ( (dcc >= MIN_DCCID_EEM && dcc <= MAX_DCCID_EEM)) return -1;
        if ( (dcc >= MIN_DCCID_EBM && dcc <= MAX_DCCID_EBM)) return -1;
        if ( (dcc >= MIN_DCCID_EEP && dcc <= MAX_DCCID_EEP)) return +1;
        if ( (dcc >= MIN_DCCID_EBP && dcc <= MAX_DCCID_EBP)) return +1;
        return 0;
}

Member Data Documentation

const int EcalElectronicsId::DCC_EBM = 10 [static]

Definition at line 79 of file EcalElectronicsId.h.

const int EcalElectronicsId::DCC_EBP = 28 [static]

Definition at line 80 of file EcalElectronicsId.h.

const int EcalElectronicsId::DCC_EEM = 1 [static]

Definition at line 81 of file EcalElectronicsId.h.

Referenced by EEQuadrant().

const int EcalElectronicsId::DCC_EEP = 46 [static]

Definition at line 82 of file EcalElectronicsId.h.

Referenced by EEQuadrant().

const int EcalElectronicsId::DCCID_PHI0_EBM = 10 [static]

Definition at line 75 of file EcalElectronicsId.h.

const int EcalElectronicsId::DCCID_PHI0_EBP = 28 [static]

Definition at line 76 of file EcalElectronicsId.h.

const int EcalElectronicsId::kDCCChannelBoundary = 17 [static]

Definition at line 78 of file EcalElectronicsId.h.

Referenced by EEQuadrant().

const int EcalElectronicsId::MAX_CHANNELID = 25 [static]

Definition at line 61 of file EcalElectronicsId.h.

const int EcalElectronicsId::MAX_DCCID = 54 [static]

Definition at line 55 of file EcalElectronicsId.h.

Referenced by EcalElectronicsId().

const int EcalElectronicsId::MAX_DCCID_EBM = 27 [static]

Definition at line 69 of file EcalElectronicsId.h.

Referenced by subdet(), and zside().

const int EcalElectronicsId::MAX_DCCID_EBP = 45 [static]

Definition at line 71 of file EcalElectronicsId.h.

Referenced by BlockFormatter::DigiToRaw(), subdet(), and zside().

const int EcalElectronicsId::MAX_DCCID_EEM = 9 [static]

Definition at line 67 of file EcalElectronicsId.h.

Referenced by TCCBlockFormatter::DigiToRaw(), and zside().

const int EcalElectronicsId::MAX_DCCID_EEP = 54 [static]

Definition at line 73 of file EcalElectronicsId.h.

Referenced by TCCBlockFormatter::DigiToRaw(), and zside().

const int EcalElectronicsId::MAX_STRIPID = 5 [static]

Definition at line 59 of file EcalElectronicsId.h.

Referenced by EcalElectronicsId().

const int EcalElectronicsId::MAX_TOWERID = 70 [static]

Definition at line 57 of file EcalElectronicsId.h.

Referenced by EcalElectronicsId().

const int EcalElectronicsId::MAX_XTALID = 5 [static]

Definition at line 63 of file EcalElectronicsId.h.

Referenced by EcalElectronicsId().

const int EcalElectronicsId::MIN_CHANNELID = 1 [static]

Definition at line 62 of file EcalElectronicsId.h.

const int EcalElectronicsId::MIN_DCCID = 1 [static]

Definition at line 56 of file EcalElectronicsId.h.

Referenced by EcalElectronicsId().

const int EcalElectronicsId::MIN_DCCID_EBM = 10 [static]

Definition at line 68 of file EcalElectronicsId.h.

Referenced by BlockFormatter::DigiToRaw(), subdet(), and zside().

const int EcalElectronicsId::MIN_DCCID_EBP = 28 [static]

Definition at line 70 of file EcalElectronicsId.h.

Referenced by subdet(), and zside().

const int EcalElectronicsId::MIN_DCCID_EEM = 1 [static]

Definition at line 66 of file EcalElectronicsId.h.

Referenced by TCCBlockFormatter::DigiToRaw(), and zside().

const int EcalElectronicsId::MIN_DCCID_EEP = 46 [static]
const int EcalElectronicsId::MIN_STRIPID = 1 [static]

Definition at line 60 of file EcalElectronicsId.h.

Referenced by EcalElectronicsId().

const int EcalElectronicsId::MIN_TOWERID = 1 [static]

Definition at line 58 of file EcalElectronicsId.h.

Referenced by EcalElectronicsId().

const int EcalElectronicsId::MIN_XTALID = 1 [static]

Definition at line 64 of file EcalElectronicsId.h.

Referenced by EcalElectronicsId().