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
HodoscopeDetId Class Reference

#include <HodoscopeDetId.h>

Inheritance diagram for HodoscopeDetId:
DetId

Public Member Functions

int fibrId () const
 
 HodoscopeDetId ()
 
 HodoscopeDetId (uint32_t rawid)
 
 HodoscopeDetId (int indexPlane, int indexFibr)
 
 HodoscopeDetId (const DetId &id)
 
HodoscopeDetIdoperator= (const DetId &id)
 
int planeId () const
 
EcalSubdetector subdet () const
 get the subdetector More...
 
- 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_FIBR = 63
 
static const int MAX_PLANE = 3
 
static const int MIN_FIBR = 0
 
static const int MIN_PLANE = 0
 range constants More...
 
- 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

Hodoscope fiber identifier class for the ECAL TBH4 setup

$Id$

Definition at line 17 of file HodoscopeDetId.h.

Constructor & Destructor Documentation

HodoscopeDetId::HodoscopeDetId ( )

Constructor of a null id

Definition at line 5 of file HodoscopeDetId.cc.

5  : DetId() {
6 }
DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:28
HodoscopeDetId::HodoscopeDetId ( uint32_t  rawid)

Constructor from a raw value

Definition at line 8 of file HodoscopeDetId.cc.

8  : DetId(rawid) {
9 }
DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:28
HodoscopeDetId::HodoscopeDetId ( int  indexPlane,
int  indexFibr 
)

Constructor from crystal ieta and iphi or from SM# and crystal#

Definition at line 13 of file HodoscopeDetId.cc.

References edm::hlt::Exception, DetId::id_, MAX_FIBR, and MAX_PLANE.

15 {
16  int iPlane = indexPlane;
17  int iFibr = indexFibr;
18  if (iPlane < MIN_PLANE || iPlane > MAX_PLANE ||
19  iFibr < MIN_FIBR || iFibr > MAX_FIBR) {
20  throw cms::Exception("InvalidDetId") << "HodoscopeDetId: Cannot create object. Indexes out of bounds.";
21  }
22  id_ |= ((iPlane&0x3) | ((iFibr&0x3F)<<2)) ;
23 }
DetId()
Create an empty or null id (also for persistence)
Definition: DetId.h:28
static const int MAX_FIBR
uint32_t id_
Definition: DetId.h:57
static const int MAX_PLANE
HodoscopeDetId::HodoscopeDetId ( const DetId id)

Constructor from a generic cell id

Definition at line 25 of file HodoscopeDetId.cc.

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

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

Member Function Documentation

int HodoscopeDetId::fibrId ( ) const
inline

Definition at line 36 of file HodoscopeDetId.h.

References DetId::id_.

Referenced by TBHodoActiveVolumeRawInfoProducer::produce().

36 { return (id_>>2)&0x3F ; }
uint32_t id_
Definition: DetId.h:57
HodoscopeDetId & HodoscopeDetId::operator= ( const DetId id)

Assignment operator from cell id

Definition at line 32 of file HodoscopeDetId.cc.

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

32  {
33  if (!gen.null() && ( gen.det()!=Ecal || gen.subdetId()!=EcalLaserPnDiode )) {
34  throw cms::Exception("InvalidDetId");
35  }
36  id_=gen.rawId();
37  return *this;
38 }
uint32_t id_
Definition: DetId.h:57
int HodoscopeDetId::planeId ( ) const
inline

Definition at line 34 of file HodoscopeDetId.h.

References DetId::id_.

Referenced by TBHodoActiveVolumeRawInfoProducer::produce().

34 { return id_&0x3 ; }
uint32_t id_
Definition: DetId.h:57
EcalSubdetector HodoscopeDetId::subdet ( ) const
inline

get the subdetector

Definition at line 32 of file HodoscopeDetId.h.

References DetId::subdetId().

32 { return EcalSubdetector(subdetId()); }
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
EcalSubdetector

Member Data Documentation

const int HodoscopeDetId::MAX_FIBR = 63
static

Definition at line 42 of file HodoscopeDetId.h.

Referenced by HodoscopeDetId().

const int HodoscopeDetId::MAX_PLANE = 3
static

Definition at line 40 of file HodoscopeDetId.h.

Referenced by HodoscopeDetId().

const int HodoscopeDetId::MIN_FIBR = 0
static

Definition at line 41 of file HodoscopeDetId.h.

const int HodoscopeDetId::MIN_PLANE = 0
static

range constants

Definition at line 39 of file HodoscopeDetId.h.