CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/src/DataFormats/HcalDetId/interface/HcalCastorDetId.h

Go to the documentation of this file.
00001 #ifndef HcalCastorDetId_h_included
00002 #define HcalCastorDetId_h_included 1
00003 
00004 #include <ostream>
00005 #include "DataFormats/DetId/interface/DetId.h"
00006 
00023 class HcalCastorDetId : public DetId 
00024 {
00025    public:
00026 
00027       enum Section { Unknown=0, EM=1, HAD=2 };
00028 
00029       // 1 => CaloTower, 2 => ZDC, 3 => Castor
00030       static const int SubdetectorId = 3;
00031 
00033       HcalCastorDetId();
00034   
00036       HcalCastorDetId(uint32_t rawid);
00037   
00039       HcalCastorDetId( Section section,
00040                        bool true_for_positive_eta,
00041                        int sector,
00042                        int module);
00043 
00044       // constructor without section
00045       HcalCastorDetId( bool true_for_positive_eta,
00046                        int sector,
00047                        int module );
00048 
00050       HcalCastorDetId(const DetId& id);
00051   
00053       HcalCastorDetId& operator=(const DetId& id);
00054 
00056       //int zside() const { return (id_&0x40)?(1):(-1); }
00057       int zside() const { return 2*( ( id_ >> 8 ) & 0x1 ) - 1 ; }
00058 
00060       //Section section() const { return (Section)((id_>>7)&0x3); }
00061       Section section() const ;
00062     
00064       //int module() const { return id_&0xF; }
00065       int module() const { return ( id_ & 0xF ) ; }
00066     
00068       //int sector() const { return (id_>>6)&0x3; }
00069       int sector() const { return ((id_ >> 4) & 0xF) + 1 ; }
00070    
00071       // get the individual cell id
00072       //  int channel() const;
00073 
00074       enum { kNumberModulesPerEnd  = 14 ,
00075              kNumberSectorsPerEnd  = 16 ,
00076              kNumberCellsPerEnd    = kNumberModulesPerEnd*kNumberSectorsPerEnd ,
00077              kSizeForDenseIndexing = kNumberCellsPerEnd } ;
00078 
00079       uint32_t denseIndex() const ;
00080 
00081       static bool validDetId( Section iSection,
00082                               bool    posEta,
00083                               int     iSector,
00084                               int     iMod     ) ;
00085 
00086       static bool validDenseIndex( uint32_t din ) 
00087       { return ( din < kSizeForDenseIndexing ) ; }
00088 
00089       static HcalCastorDetId detIdFromDenseIndex( uint32_t di ) ;
00090 
00091    private:
00092 
00093       void buildMe( Section section,
00094                     bool    true_for_positive_eta,
00095                     int     sector,
00096                     int     module ) ;
00097 };
00098 
00099 std::ostream& operator<<(std::ostream&,const HcalCastorDetId& id);
00100 
00101 
00102 #endif // HcalCastorDetId_h_included
00103