CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch13/src/DataFormats/EcalDetId/interface/EcalElectronicsId.h

Go to the documentation of this file.
00001 #ifndef DATAFORMATS_ECALDETID_ECALELECTRONICSID_H
00002 #define DATAFORMATS_ECALDETID_ECALELECTRONICSID_H 1
00003 
00004 #include <ostream>
00005 #include <stdint.h>
00006 
00007 #include "DataFormats/EcalDetId/interface/EcalSubdetector.h"
00008 
00009 
00020 class EcalElectronicsId {
00021   
00022  public:
00023 
00025   EcalElectronicsId();
00027   EcalElectronicsId(uint32_t);
00029   EcalElectronicsId(int dccid, int towerid, int stripid, int xtalid);
00030   
00031   uint32_t operator()() { return EcalElectronicsId_; }
00032   uint32_t rawId() const { return EcalElectronicsId_; }
00033   
00035   int dccId() const { return (EcalElectronicsId_>>13)&0x7F; }
00037   int towerId() const { return (EcalElectronicsId_>>6)&0x7F; }
00039   int stripId() const { return (EcalElectronicsId_>>3)&0x7; }
00041   int xtalId() const { return (EcalElectronicsId_&0x7); }
00042 
00044   int zside() const;
00045 
00047   EcalSubdetector subdet() const;
00048 
00050   int linearIndex() const { return (EcalElectronicsId_)&0x3FFFFF; }
00051 
00053   int channelId() const;        // xtal id between 1 and 25
00054   
00055   static const int MAX_DCCID = 54; //To be updated with correct and final number
00056   static const int MIN_DCCID = 1;
00057   static const int MAX_TOWERID = 70;
00058   static const int MIN_TOWERID = 1;
00059   static const int MAX_STRIPID = 5;
00060   static const int MIN_STRIPID = 1;
00061   static const int MAX_CHANNELID = 25;
00062   static const int MIN_CHANNELID = 1;
00063   static const int MAX_XTALID = 5;
00064   static const int MIN_XTALID = 1;
00065   
00066   static const int MIN_DCCID_EEM = 1;
00067   static const int MAX_DCCID_EEM = 9;
00068   static const int MIN_DCCID_EBM = 10;
00069   static const int MAX_DCCID_EBM = 27;
00070   static const int MIN_DCCID_EBP = 28;
00071   static const int MAX_DCCID_EBP = 45;
00072   static const int MIN_DCCID_EEP = 46;
00073   static const int MAX_DCCID_EEP = 54;
00074 
00075   static const int DCCID_PHI0_EBM = 10;
00076   static const int DCCID_PHI0_EBP = 28;
00077 
00078   static const int kDCCChannelBoundary = 17;
00079   static const int DCC_EBM = 10;        // id of the DCC in EB- which contains phi=0 deg.
00080   static const int DCC_EBP = 28;        // id of the DCC in EB+ which contains phi=0 deg.
00081   static const int DCC_EEM = 1;         // id of the DCC in EE- which contains phi=0 deg.
00082   static const int DCC_EEP = 46;        // id of the DCC in EE+ which contains phi=0 deg.
00083 
00084 
00086   int operator==(const EcalElectronicsId& id) const { return id.EcalElectronicsId_==EcalElectronicsId_; }
00088   int operator!=(const EcalElectronicsId& id) const { return id.EcalElectronicsId_!=EcalElectronicsId_; }
00090   int operator<(const EcalElectronicsId& id) const { return EcalElectronicsId_<id.EcalElectronicsId_; }
00091   
00092  private:
00093   
00094   uint32_t EcalElectronicsId_;
00095 };
00096 
00097 std::ostream& operator<<(std::ostream&,const EcalElectronicsId&);
00098 
00099   
00100 #endif