Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:51:09

0001 #ifndef HcalMCParam_h
0002 #define HcalMCParam_h
0003 
0004 /** 
0005 \class HcalMCParam
0006 \author Radek Ofierzynski
0007 POOL object to store MC information
0008 */
0009 
0010 #include "CondFormats/Serialization/interface/Serializable.h"
0011 #include <cstdint>
0012 
0013 // definition 8.Feb.2011
0014 // MC signal shape integer variable assigned to each readout this way:
0015 // 0 - regular HPD  HB/HE/HO shape
0016 // 1 - "special" HB shape
0017 // 2 - SiPMs shape (HO, possibly also in HB/HE)
0018 // 3 - HF Shape
0019 // 4 - ZDC shape
0020 //
0021 // change in definition  28.Oct.2011  sk
0022 // mParam1 is now packed word.
0023 //   pulseShapeID                              [0,500]          9 bits  (use this as phot0 detetor ID as well)
0024 //   syncPhase = cms.bool(True),               bool             1 bit   (use this for QPLL unlocked channel)
0025 //   binOfMaximum = cms.int32(5)               [1-10]           4 bits
0026 //   timePhase = cms.double(5.0),              [-30.0,30.0]     8 bits  (0.25ns step)
0027 //   timeSmearing = cms.bool(False)            bool             1 bit
0028 //   packingScheme                                              4 bits
0029 class HcalMCParam {
0030 public:
0031   HcalMCParam() : mId(0), mParam1(0) {}
0032 
0033   HcalMCParam(unsigned long fId, unsigned int fParam1) : mId(fId), mParam1(fParam1) {}
0034 
0035   uint32_t rawId() const { return mId; }
0036 
0037   unsigned int param1() const { return mParam1; }
0038   unsigned int signalShape() const { return mParam1 & 0x1FF; }
0039   bool syncPhase() const { return (mParam1 >> 9) & 0x1; }
0040   unsigned int binOfMaximum() const { return (mParam1 >> 10) & 0xF; }
0041   float timePhase() const { return ((mParam1 >> 14) & 0xFF) / 4.0 - 32.0; }
0042   bool timeSmearing() const { return (mParam1 >> 22) & 0x1; }
0043   unsigned int packingScheme() const { return (mParam1 >> 27) & 0xF; }
0044 
0045 private:
0046   uint32_t mId;
0047   uint32_t mParam1;
0048 
0049   COND_SERIALIZABLE;
0050 };
0051 
0052 #endif