Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef HcalRecoParam_h
0002 #define HcalRecoParam_h
0003 
0004 /** 
0005 \class HcalRecoParam
0006 \author Radek Ofierzynski
0007 POOL object to store timeslice reco values
0008 
0009 mParam1, mParam2 re-define to keep more parameters   28-Oct-2011  sk.
0010  
0011 */
0012 
0013 #include "CondFormats/Serialization/interface/Serializable.h"
0014 #include <cstdint>
0015 
0016 class HcalRecoParam {
0017 public:
0018   constexpr HcalRecoParam() : mId(0), mParam1(0), mParam2(0) {}
0019 
0020   constexpr HcalRecoParam(unsigned long fId, unsigned int fParam1, unsigned int fParam2)
0021       : mId(fId), mParam1(fParam1), mParam2(fParam2) {}
0022 
0023   constexpr uint32_t rawId() const { return mId; }
0024 
0025   constexpr unsigned int param1() const { return mParam1; }
0026   constexpr unsigned int param2() const { return mParam2; }
0027 
0028   constexpr bool correctForPhaseContainment() const { return mParam1 & 0x1; }
0029   constexpr bool correctForLeadingEdge() const { return (mParam1 >> 1) & 0x1; }
0030   constexpr float correctionPhaseNS() const { return ((mParam1 >> 2) & 0xFF) / 4. - 32.; }
0031   constexpr unsigned int firstSample() const { return (mParam1 < 10) ? (mParam1) : ((mParam1 >> 10) & 0xF); }
0032   constexpr unsigned int samplesToAdd() const { return (mParam1 < 10) ? (mParam2) : ((mParam1 >> 14) & 0xF); }
0033   constexpr unsigned int pulseShapeID() const { return (mParam1 >> 18) & 0x1FF; }
0034 
0035   constexpr bool useLeakCorrection() const { return mParam2 & 0x1; }
0036   constexpr unsigned int leakCorrectionID() const { return (mParam2 >> 1) & 0xF; }
0037   constexpr bool correctForTimeslew() const { return (mParam2 >> 5) & 0x1; }
0038   constexpr unsigned int timeslewCorrectionID() const { return (mParam2 >> 6) & 0xF; }
0039   constexpr bool correctTiming() const { return (mParam2 >> 10) & 0x1; }
0040   constexpr unsigned int firstAuxTS() const { return (mParam2 >> 11) & 0xF; }
0041   constexpr unsigned int specialCaseID() const { return (mParam2 >> 15) & 0xF; }
0042   constexpr unsigned int noiseFlaggingID() const { return (mParam2 >> 19) & 0xF; }
0043   constexpr unsigned int pileupCleaningID() const { return (mParam2 >> 23) & 0xF; }
0044   constexpr unsigned int packingScheme() const { return (mParam2 >> 27) & 0xF; }
0045 
0046 private:
0047   uint32_t mId;
0048   uint32_t mParam1;
0049   uint32_t mParam2;
0050 
0051   COND_SERIALIZABLE;
0052 };
0053 
0054 #endif