CMS 3D CMS Logo

HcalCastorDetId Class Reference

Contents of the HcalCastorDetId : [9] Z position (true for positive) [8:7] Section (EM/HAD) [6:4] sector (depth) [3:0] module. More...

#include <DataFormats/HcalDetId/interface/HcalCastorDetId.h>

Inheritance diagram for HcalCastorDetId:

DetId

List of all members.

Public Types

enum  Section { Unknown = 0, EM = 1, HAD = 2 }

Public Member Functions

 HcalCastorDetId (const DetId &id)
 Constructor from a generic cell id.
 HcalCastorDetId (bool true_for_positive_eta, int sector, int module)
 HcalCastorDetId (Section section, bool true_for_positive_eta, int sector, int module)
 Constructor from section, z-side, sector and module.
 HcalCastorDetId (uint32_t rawid)
 Create cellid from raw id (0=invalid tower id).
 HcalCastorDetId ()
 Create a null cellid.
int module () const
 get the module (1-2 for EM, 1-12 for HAD)
HcalCastorDetIdoperator= (const DetId &id)
 Assignment from a generic cell id.
Section section () const
 get the section
int sector () const
 get the sector (1-16)
int zside () const
 get the z-side of the cell (1/-1)

Static Public Attributes

static const int SubdetectorId = 3


Detailed Description

Contents of the HcalCastorDetId : [9] Z position (true for positive) [8:7] Section (EM/HAD) [6:4] sector (depth) [3:0] module.

NEW: [8] z position [7:4] sector [3:0] module

Author:
P. Katsas, T. McCauley

Definition at line 23 of file HcalCastorDetId.h.


Member Enumeration Documentation

enum HcalCastorDetId::Section

Enumerator:
Unknown 
EM 
HAD 

Definition at line 26 of file HcalCastorDetId.h.

00026 { Unknown=0, EM=1, HAD=2 };


Constructor & Destructor Documentation

HcalCastorDetId::HcalCastorDetId (  ) 

Create a null cellid.

Definition at line 5 of file HcalCastorDetId.cc.

00005                                  : DetId() {
00006 }

HcalCastorDetId::HcalCastorDetId ( uint32_t  rawid  ) 

Create cellid from raw id (0=invalid tower id).

Definition at line 8 of file HcalCastorDetId.cc.

00008                                                : DetId(rawid) {
00009 }

HcalCastorDetId::HcalCastorDetId ( Section  section,
bool  true_for_positive_eta,
int  sector,
int  module 
)

Constructor from section, z-side, sector and module.

Definition at line 11 of file HcalCastorDetId.cc.

References DetId::id_.

00015     : DetId(DetId::Calo, SubdetectorId) 
00016 {
00017     /*
00018       OLD
00019     id_|=(section&0x3)<<7;
00020     id_|=(sector&0x3)<<6;
00021     if (true_for_positive_eta) id_|=0x40;
00022     id_|=module&0x3;
00023     */
00024     
00025     sector -= 1; // we count sector from 1-16 instead of 0-15
00026     
00027     id_ |= ( true_for_positive_eta << 8 ) | ( sector << 4 ) | module;
00028 }

HcalCastorDetId::HcalCastorDetId ( bool  true_for_positive_eta,
int  sector,
int  module 
)

Definition at line 31 of file HcalCastorDetId.cc.

References DetId::id_.

00034     : DetId(DetId::Calo, SubdetectorId) 
00035 {
00036     /*
00037       OLD
00038     id_|=(section&0x3)<<7;
00039     id_|=(sector&0x3)<<6;
00040     if (true_for_positive_eta) id_|=0x40;
00041     id_|=module&0x3;
00042     */
00043     
00044     sector -= 1; // we count sectors from 1-16 instead of 0-15
00045     
00046     id_ |= ( true_for_positive_eta << 8 ) | ( sector << 4 ) | module;
00047 }

HcalCastorDetId::HcalCastorDetId ( const DetId id  ) 

Constructor from a generic cell id.

Definition at line 49 of file HcalCastorDetId.cc.

References DetId::Calo, DetId::det(), Exception, DetId::id_, DetId::null(), DetId::rawId(), SubdetectorId, and DetId::subdetId().

00050 {
00051     if (!gen.null() && (gen.det() != DetId::Calo || gen.subdetId() != SubdetectorId)) 
00052     {
00053         throw cms::Exception("Invalid DetId") << "Cannot initialize CASTORDetId from " << std::hex << gen.rawId() << std::dec; 
00054     }
00055   
00056     id_= gen.rawId();
00057 }


Member Function Documentation

int HcalCastorDetId::module (  )  const [inline]

get the module (1-2 for EM, 1-12 for HAD)

Definition at line 72 of file HcalCastorDetId.h.

References DetId::id_.

Referenced by CastorTopology::incModule(), CastorTopology::incSector(), CastorText2DetIdConverter::init(), CastorHardcodeGeometryLoader::makeCell(), and section().

00073         {
00074             return (id_ & 0xF);
00075         }

HcalCastorDetId & HcalCastorDetId::operator= ( const DetId id  ) 

Assignment from a generic cell id.

Definition at line 59 of file HcalCastorDetId.cc.

References DetId::Calo, DetId::det(), Exception, DetId::id_, DetId::null(), DetId::rawId(), SubdetectorId, and DetId::subdetId().

00060 {
00061     if (!gen.null() && (gen.det() != DetId::Calo || gen.subdetId() != SubdetectorId)) 
00062     {
00063         throw cms::Exception("Invalid DetId") << "Cannot assign Castor DetId from " << std::hex << gen.rawId() << std::dec; 
00064     }
00065   
00066     id_ = gen.rawId();
00067     
00068     return *this;
00069 }

Section HcalCastorDetId::section (  )  const [inline]

get the section

Definition at line 58 of file HcalCastorDetId.h.

References EM, HAD, mod(), module(), and Unknown.

Referenced by CastorTopology::incModule(), CastorTopology::incSector(), CastorText2DetIdConverter::init(), CastorHardcodeGeometryLoader::makeCell(), and operator<<().

00059         {
00060             int mod = module();
00061             
00062             if ( mod <= 2 )
00063                 return HcalCastorDetId::EM;    
00064             if ( mod > 2 && mod <= 14 )
00065                 return HcalCastorDetId::HAD;
00066             else
00067                 return HcalCastorDetId::Unknown;
00068         }

int HcalCastorDetId::sector (  )  const [inline]

get the sector (1-16)

Definition at line 79 of file HcalCastorDetId.h.

References DetId::id_.

Referenced by CastorTopology::incModule(), CastorTopology::incSector(), and CastorText2DetIdConverter::init().

00080         {
00081             return ((id_ >> 4) & 0xF) + 1;
00082         }

int HcalCastorDetId::zside (  )  const [inline]

get the z-side of the cell (1/-1)

Definition at line 50 of file HcalCastorDetId.h.

References DetId::id_.

Referenced by CastorTopology::incModule(), CastorTopology::incSector(), CastorText2DetIdConverter::init(), and CastorHardcodeGeometryLoader::makeCell().

00051         {
00052             return ((id_ >> 8) & 0x1);
00053         }


Member Data Documentation

const int HcalCastorDetId::SubdetectorId = 3 [static]

Definition at line 29 of file HcalCastorDetId.h.

Referenced by CastorHitFilter::accepts(), CastorSimpleReconstructor::CastorSimpleReconstructor(), CastorDigiProducer::checkGeometry(), CastorHitCorrection::delay(), HcalGenericDetId::genericSubdet(), HcalCastorDetId(), CastorHardcodeGeometryLoader::load(), operator=(), CastorSimpleReconstructor::produce(), CastorDigiProducer::sortHits(), and CastorHitCorrection::timeOfFlight().


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