CMS 3D CMS Logo

HodoscopeDetId Class Reference

Hodoscope fiber identifier class for the ECAL TBH4 setup. More...

#include <SimDataFormats/EcalTestBeam/interface/HodoscopeDetId.h>

Inheritance diagram for HodoscopeDetId:

DetId

List of all members.

Public Member Functions

int fibrId () const
 HodoscopeDetId (const DetId &id)
 Constructor from a generic cell id.
 HodoscopeDetId (int indexPlane, int indexFibr)
 Constructor from crystal ieta and iphi or from SM# and crystal#.
 HodoscopeDetId (uint32_t rawid)
 Constructor from a raw value.
 HodoscopeDetId ()
 Constructor of a null id.
HodoscopeDetIdoperator= (const DetId &id)
 Assignment operator from cell id.
int planeId () const
EcalSubdetector subdet () const
 get the subdetector

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


Detailed Description

Hodoscope fiber identifier class for the ECAL TBH4 setup.

Id
HodoscopeDetId.h,v 1.1 2007/03/16 19:33:23 fabiocos Exp

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.

00005                                : DetId() {
00006 }

HodoscopeDetId::HodoscopeDetId ( uint32_t  rawid  ) 

Constructor from a raw value.

Definition at line 8 of file HodoscopeDetId.cc.

00008                                              : DetId(rawid) {
00009 }

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 Exception, DetId::id_, MAX_FIBR, and MAX_PLANE.

00014   : DetId(Ecal,EcalLaserPnDiode)
00015 {
00016   int iPlane = indexPlane;
00017   int iFibr = indexFibr;
00018   if (iPlane < MIN_PLANE || iPlane > MAX_PLANE ||
00019       iFibr < MIN_FIBR || iFibr > MAX_FIBR) {
00020     throw cms::Exception("InvalidDetId") << "HodoscopeDetId:  Cannot create object.  Indexes out of bounds.";
00021   }
00022   id_|= (iPlane&0x3 | ((iFibr&0x3F)<<2)) ;
00023 }

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, Exception, DetId::id_, DetId::null(), DetId::rawId(), and DetId::subdetId().

00025                                                {
00026  if (!gen.null() && ( gen.det()!=Ecal || gen.subdetId()!=EcalLaserPnDiode )) {
00027     throw cms::Exception("InvalidDetId");
00028   }
00029   id_=gen.rawId();
00030 }


Member Function Documentation

int HodoscopeDetId::fibrId (  )  const [inline]

Definition at line 36 of file HodoscopeDetId.h.

References DetId::id_.

Referenced by TBHodoActiveVolumeRawInfoProducer::produce().

00036 { return (id_>>2)&0x3F ; }

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, Exception, DetId::id_, DetId::null(), DetId::rawId(), and DetId::subdetId().

00032                                                           {
00033   if (!gen.null() && ( gen.det()!=Ecal || gen.subdetId()!=EcalLaserPnDiode )) {
00034     throw cms::Exception("InvalidDetId");
00035   }
00036   id_=gen.rawId();
00037   return *this;
00038 }

int HodoscopeDetId::planeId (  )  const [inline]

Definition at line 34 of file HodoscopeDetId.h.

References DetId::id_.

Referenced by TBHodoActiveVolumeRawInfoProducer::produce().

00034 { return id_&0x3 ; }

EcalSubdetector HodoscopeDetId::subdet (  )  const [inline]

get the subdetector

Definition at line 32 of file HodoscopeDetId.h.

References DetId::subdetId().

00032 { return EcalSubdetector(subdetId()); }


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.


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:24:45 2009 for CMSSW by  doxygen 1.5.4