CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/src/DataFormats/HcalDetId/interface/HcalZDCDetId.h

Go to the documentation of this file.
00001 #ifndef HcalZDCDetId_h_included
00002 #define HcalZDCDetId_h_included 1
00003 
00004 #include <ostream>
00005 #include "DataFormats/DetId/interface/DetId.h"
00006 
00018 class HcalZDCDetId : public DetId {
00019 public:
00020   enum Section { Unknown=0, EM=1, HAD=2, LUM=3 };
00021   // 1 => CaloTower, 3 => Castor
00022   static const int SubdetectorId = 2;
00023 
00025   HcalZDCDetId();
00027   HcalZDCDetId(uint32_t rawid);
00029   HcalZDCDetId(Section section, bool true_for_positive_eta, int channel);
00031   HcalZDCDetId(const DetId& id);
00033   HcalZDCDetId& operator=(const DetId& id);
00034 
00036   int zside() const { return (id_&0x40)?(1):(-1); }
00038   Section section() const { return (Section)((id_>>4)&0x3); }
00040   int depth() const { return (((id_>>4)&0x3)==1)?(1):((((id_>>4)&0x3)==2)?((id_&0xF)+1):(id_&0xF)); }
00042   int channel() const { return id_&0xF; }
00043 
00044   uint32_t denseIndex() const ;
00045 
00046   static bool validDenseIndex( uint32_t di ) { return ( di < kSizeForDenseIndexing ) ; }
00047 
00048   static HcalZDCDetId detIdFromDenseIndex( uint32_t di ) ;
00049 
00050   static bool validDetId( Section se, int dp ) ;
00051 
00052    private:
00053 
00054       enum { kDepEM  = 5,
00055              kDepHAD = 4,
00056              kDepLUM = 2,
00057              kDepTot = kDepEM + kDepHAD + kDepLUM };
00058 
00059    public:
00060 
00061       enum { kSizeForDenseIndexing = 2*kDepTot } ;
00062 
00063 };
00064 
00065 std::ostream& operator<<(std::ostream&,const HcalZDCDetId& id);
00066 
00067 
00068 #endif // HcalZDCDetId_h_included