Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:53:14

0001 #ifndef ECALDETID_ECALPNDIODEDETID_H
0002 #define ECALDETID_ECALPNDIODEDETID_H
0003 
0004 #include <ostream>
0005 #include "DataFormats/DetId/interface/DetId.h"
0006 #include "DataFormats/EcalDetId/interface/EcalSubdetector.h"
0007 
0008 /** \class EcalPnDiodeDetId
0009     
0010    DetId for an Calo Trigger tower
0011    Packing:
0012 
0013    [31:28] Global det == ECAL
0014    [27:25] ECAL det == EcalLaserPnDiode
0015    [24:12] Not Used
0016    [10]    SubDetectorId: EB (1) ,EE (2)
0017    [9:4]   DCCId (relative to SubDetector. In barrel it is the SupermoduleId from 1-36)
0018    [3:0]   PnId (In barrel from 1-10 according CMS IN-2005/021)
0019 
0020 */
0021 
0022 class EcalPnDiodeDetId : public DetId {
0023 public:
0024   /** Constructor of a null id */
0025   EcalPnDiodeDetId();
0026   /** Constructor from a raw value */
0027   EcalPnDiodeDetId(uint32_t rawid);
0028   /** \brief Constructor from signed EcalSubDetectorId, DCCId, PnId
0029    */
0030   EcalPnDiodeDetId(int EcalSubDetectorId, int DCCId, int PnId);
0031   /** Constructor from a generic cell id */
0032   EcalPnDiodeDetId(const DetId& id);
0033   /** Assignment from a generic cell id */
0034   EcalPnDiodeDetId& operator=(const DetId& id);
0035 
0036   static const int MAX_DCCID = 54;
0037   static const int MIN_DCCID = 1;
0038   static const int MAX_PNID = 15;
0039   static const int MIN_PNID = 1;
0040 
0041   /// get EcalSubDetectorId
0042   int iEcalSubDetectorId() const { return (id_ & 0x800) ? (EcalEndcap) : (EcalBarrel); }
0043   /// get the DCCId
0044   int iDCCId() const { return (id_ >> 4) & 0x7F; }
0045   /// get the PnId
0046   int iPnId() const { return id_ & 0xF; }
0047   /// get a compact index for arrays [TODO: NEEDS WORK]
0048   int hashedIndex() const;
0049 };
0050 
0051 std::ostream& operator<<(std::ostream&, const EcalPnDiodeDetId& id);
0052 
0053 #endif