Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:04:17

0001 #ifndef DATAFORMATS_HCALDETID_HCALCALIBDETID_H
0002 #define DATAFORMATS_HCALDETID_HCALCALIBDETID_H 1
0003 
0004 #include <ostream>
0005 #include "DataFormats/HcalDetId/interface/HcalSubdetector.h"
0006 #include "DataFormats/HcalDetId/interface/HcalOtherDetId.h"
0007 
0008 /** \class HcalCalibDetId
0009   *  
0010   *  Contents of the HcalCalibDetId :
0011   *     [19:17] Calibration Category (1 = CalibUnit, 2 = HOX, 3=uMNio/qie, 4=CastorRad, 5=LASMON, 6=HBX, 7=HEX)
0012   *
0013   *  For CalibUnit:
0014   *     [16:14] Subdetector
0015   *     [13:11] Ieta (-2 -> 2)
0016   *     [10:4] Iphi ("low edge")
0017   *     [3:0] Calibration channel type
0018   * 
0019   *  For HX (HOCrosstalk) channels:
0020   *     [11] side (true = positive)
0021   *     [10:7] ieta
0022   *     [6:0] iphi
0023   *
0024   *  For uMNqie channels:
0025   *     [7:0] channel (typically just 0 or 1, but space for more if needed)
0026   *
0027   *  For Castor Radiation Facility:
0028   *     [16:10] RM
0029   *     [9:5] fiber-in-rm
0030   *     [4:0] channel-on-fiber
0031   *     
0032   *  For Laser Monitoring channels: 
0033   *     [16:10] ieta
0034   *     [9:5]   iphi 
0035   *     [3:0]   cbox  
0036   *
0037   *  For HBX/HEX:
0038   *     [19:17]  6 or 7 (CalibType) 
0039   *     [12:12]  side (true = positive)
0040   *     [11:7]   ieta (1-29)
0041   *     [6:0]    iphi (1-72)
0042   *    
0043   * \author J. Mans - Minnesota
0044   */
0045 class HcalCalibDetId : public HcalOtherDetId {
0046 public:
0047   /** Type identifier within calibration det ids */
0048   enum CalibDetType {
0049     CalibrationBox = 1,
0050     HOCrosstalk = 2,
0051     uMNqie = 3,
0052     CastorRadFacility = 4,
0053     LASERMON = 5,
0054     HBX = 6,
0055     HEX = 7
0056   };
0057 
0058   /** Create a null det id */
0059   HcalCalibDetId();
0060   /** Create from a raw id */
0061   HcalCalibDetId(uint32_t rawid);
0062   /** Create from a generic cell id */
0063   HcalCalibDetId(const DetId& id);
0064   HcalCalibDetId& operator=(const DetId& id);
0065   /** Construct a calibration box - channel detid */
0066   HcalCalibDetId(HcalSubdetector subdet, int ieta, int iphi, int ctype);
0067   /** Construct an HOX/HBX/HEX Crosstalk id  */
0068   HcalCalibDetId(CalibDetType dt, int ieta, int iphi);
0069   /** Keep old HOX constructor for back-compatibility */
0070   HcalCalibDetId(int ieta, int iphi);
0071   /** Construct a uMNqie id or other id which uses a single value plus a DetType */
0072   HcalCalibDetId(CalibDetType dt, int value);
0073   /** Construct a Castor radiation test facility id or other id which uses three values plus a DetType */
0074   HcalCalibDetId(CalibDetType dt, int value1, int value2, int value3);
0075 
0076   /// get the flavor of this calibration detid
0077   CalibDetType calibFlavor() const { return (CalibDetType)((id_ >> 17) & 0x7); }
0078   /// get the HcalSubdetector (if relevant)
0079   HcalSubdetector hcalSubdet() const;
0080   /// get the rbx name (if relevant)
0081   /// std::string rbx() const;
0082   /// get the "ieta" identifier (if relevant)
0083   int ieta() const;
0084   /// get the low-edge iphi (if relevant)
0085   int iphi() const;
0086   /// get the calibration box channel (if relevant)
0087   int cboxChannel() const;
0088   /// get the calibration box channel as a string (if relevant)
0089   std::string cboxChannelString() const;
0090 
0091   /// get the rm (where relevant)
0092   int rm() const;
0093   /// get the fiber (where relevant)
0094   int fiber() const;
0095   /// get the channel (for uMNio/qie or similar)
0096   int channel() const;
0097 
0098   /// get the sign of ieta (+/-1)
0099   int zside() const;
0100 
0101   /// constants
0102   static const int cbox_MixerHigh = 0;           // HB/HE/HO/HF
0103   static const int cbox_MixerLow = 1;            // HB/HE/HO/HF
0104   static const int cbox_LaserMegatile = 2;       // in HB only!
0105   static const int cbox_RadDam_Layer0_RM4 = 3;   // in HE only!
0106   static const int cbox_RadDam_Layer7_RM4 = 4;   // in HE only!
0107   static const int cbox_RadDam_Layer0_RM1 = 5;   // in HE only!
0108   static const int cbox_RadDam_Layer7_RM1 = 6;   // in HE only!
0109   static const int cbox_HOCrosstalkPIN = 7;      // in (part of) HO only!
0110   static const int cbox_HF_ScintillatorPIN = 8;  // in HF only!
0111 };
0112 
0113 std::ostream& operator<<(std::ostream& s, const HcalCalibDetId& id);
0114 
0115 #endif