CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Attributes
EcalPnDiodeDetId Class Reference

#include <EcalPnDiodeDetId.h>

Inheritance diagram for EcalPnDiodeDetId:
DetId

Public Member Functions

 EcalPnDiodeDetId ()
 
 EcalPnDiodeDetId (uint32_t rawid)
 
 EcalPnDiodeDetId (int EcalSubDetectorId, int DCCId, int PnId)
 Constructor from signed EcalSubDetectorId, DCCId, PnId. More...
 
 EcalPnDiodeDetId (const DetId &id)
 
int hashedIndex () const
 get a compact index for arrays [TODO: NEEDS WORK] More...
 
int iDCCId () const
 get the DCCId More...
 
int iEcalSubDetectorId () const
 get EcalSubDetectorId More...
 
int iPnId () const
 get the PnId More...
 
EcalPnDiodeDetIdoperator= (const DetId &id)
 
- Public Member Functions inherited from DetId
Detector det () const
 get the detector field from this detid More...
 
 DetId ()
 Create an empty or null id (also for persistence) More...
 
 DetId (uint32_t id)
 Create an id from a raw number. More...
 
 DetId (Detector det, int subdet)
 Create an id, filling the detector and subdetector fields as specified. More...
 
bool null () const
 is this a null id ? More...
 
 operator uint32_t () const
 
bool operator!= (DetId id) const
 inequality More...
 
uint32_t operator() () const
 
bool operator< (DetId id) const
 comparison More...
 
bool operator== (DetId id) const
 equality More...
 
uint32_t rawId () const
 get the raw id More...
 
int subdetId () const
 get the contents of the subdetector field (not cast into any detector's numbering enum) More...
 

Static Public Attributes

static const int MAX_DCCID = 54
 
static const int MAX_PNID = 15
 
static const int MIN_DCCID = 1
 
static const int MIN_PNID = 1
 
- Static Public Attributes inherited from DetId
static const int kDetOffset = 28
 
static const int kSubdetOffset = 25
 

Additional Inherited Members

- Public Types inherited from DetId
enum  Detector {
  Tracker =1, Muon =2, Ecal =3, Hcal =4,
  Calo =5
}
 
- Protected Attributes inherited from DetId
uint32_t id_
 

Detailed Description

DetId for an Calo Trigger tower Packing:

[31:28] Global det == ECAL [27:25] ECAL det == EcalLaserPnDiode [24:12] Not Used [10] SubDetectorId: EB (1) ,EE (2) [9:4] DCCId (relative to SubDetector. In barrel it is the SupermoduleId from 1-36) [3:0] PnId (In barrel from 1-10 according CMS IN-2005/021)

Id:
EcalPnDiodeDetId.h,v 1.3 2007/07/31 15:20:00 ratnik Exp

Definition at line 25 of file EcalPnDiodeDetId.h.

Constructor & Destructor Documentation

EcalPnDiodeDetId::EcalPnDiodeDetId ( )

Constructor of a null id

Definition at line 4 of file EcalPnDiodeDetId.cc.

4  {
5 }
EcalPnDiodeDetId::EcalPnDiodeDetId ( uint32_t  rawid)

Constructor from a raw value

Definition at line 8 of file EcalPnDiodeDetId.cc.

8  : DetId(rawid) {
9 }
DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:28
EcalPnDiodeDetId::EcalPnDiodeDetId ( int  EcalSubDetectorId,
int  DCCId,
int  PnId 
)

Constructor from signed EcalSubDetectorId, DCCId, PnId.

Definition at line 11 of file EcalPnDiodeDetId.cc.

References EcalBarrel, EcalEndcap, edm::hlt::Exception, DetId::id_, MAX_DCCID, MAX_PNID, MIN_DCCID, and MIN_PNID.

12  if ( (DCCId < MIN_DCCID) || (DCCId > MAX_DCCID) ||
13  (PnId < MIN_PNID) || (PnId > MAX_PNID) ||
14  (EcalSubDetectorId != EcalBarrel && EcalSubDetectorId != EcalEndcap))
15  throw cms::Exception("InvalidDetId") << "EcalPnDiodeDetId: Cannot create object. Indexes out of bounds.";
16  id_|= ((((EcalSubDetectorId==EcalBarrel)?(0):(1))<<11) |
17  ((DCCId&0x7F)<<4) |
18  (PnId&0xF));
19 }
DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:28
static const int MIN_DCCID
static const int MAX_PNID
static const int MAX_DCCID
uint32_t id_
Definition: DetId.h:57
static const int MIN_PNID
EcalPnDiodeDetId::EcalPnDiodeDetId ( const DetId id)

Constructor from a generic cell id

Definition at line 21 of file EcalPnDiodeDetId.cc.

References DetId::det(), DetId::Ecal, EcalLaserPnDiode, edm::hlt::Exception, DetId::id_, DetId::null(), DetId::rawId(), and DetId::subdetId().

21  {
22  if (!gen.null() && ( gen.det()!=Ecal || gen.subdetId()!=EcalLaserPnDiode)) {
23  throw cms::Exception("InvalidDetId");
24  }
25  id_=gen.rawId();
26 }
uint32_t id_
Definition: DetId.h:57

Member Function Documentation

int EcalPnDiodeDetId::hashedIndex ( ) const

get a compact index for arrays [TODO: NEEDS WORK]

Definition at line 36 of file EcalPnDiodeDetId.cc.

References edm::hlt::Exception.

37 {
38  throw cms::Exception("MethodNotImplemented");
39 }
int EcalPnDiodeDetId::iDCCId ( ) const
inline

get the DCCId

Definition at line 47 of file EcalPnDiodeDetId.h.

References DetId::id_.

Referenced by EcalTestPulseAnalyzer::analyze(), EcalLaserAnalyzer2::analyze(), EcalLaserAnalyzer::analyze(), and EcalDigiDisplay::readPNDigis().

47 { return (id_>>4) & 0x7F; }
uint32_t id_
Definition: DetId.h:57
int EcalPnDiodeDetId::iEcalSubDetectorId ( ) const
inline

get EcalSubDetectorId

Definition at line 45 of file EcalPnDiodeDetId.h.

References EcalBarrel, EcalEndcap, and DetId::id_.

45 { return (id_ & 0x800 ) ? (EcalEndcap):(EcalBarrel); }
uint32_t id_
Definition: DetId.h:57
int EcalPnDiodeDetId::iPnId ( ) const
inline

get the PnId

Definition at line 49 of file EcalPnDiodeDetId.h.

References DetId::id_.

Referenced by EcalLaserAnalyzer2::analyze(), and EcalLaserAnalyzer::analyze().

49 { return id_&0xF; }
uint32_t id_
Definition: DetId.h:57
EcalPnDiodeDetId & EcalPnDiodeDetId::operator= ( const DetId id)

Assignment from a generic cell id

Definition at line 28 of file EcalPnDiodeDetId.cc.

References DetId::det(), DetId::Ecal, EcalLaserPnDiode, edm::hlt::Exception, DetId::id_, DetId::null(), DetId::rawId(), and DetId::subdetId().

28  {
29  if (!gen.null() && ( gen.det()!=Ecal || gen.subdetId()!=EcalLaserPnDiode)) {
30  throw cms::Exception("InvalidDetId");
31  }
32  id_=gen.rawId();
33  return *this;
34 }
uint32_t id_
Definition: DetId.h:57

Member Data Documentation

const int EcalPnDiodeDetId::MAX_DCCID = 54
static

Definition at line 39 of file EcalPnDiodeDetId.h.

Referenced by EcalPnDiodeDetId().

const int EcalPnDiodeDetId::MAX_PNID = 15
static

Definition at line 41 of file EcalPnDiodeDetId.h.

Referenced by EcalPnDiodeDetId().

const int EcalPnDiodeDetId::MIN_DCCID = 1
static

Definition at line 40 of file EcalPnDiodeDetId.h.

Referenced by EcalPnDiodeDetId().

const int EcalPnDiodeDetId::MIN_PNID = 1
static

Definition at line 42 of file EcalPnDiodeDetId.h.

Referenced by EcalPnDiodeDetId().