Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef DATAFORMATS_HGCUNCALIBRATEDRECHIT
0002 #define DATAFORMATS_HGCUNCALIBRATEDRECHIT
0003 
0004 #include <vector>
0005 #include "DataFormats/DetId/interface/DetId.h"
0006 
0007 class HGCUncalibratedRecHit {
0008 public:
0009   typedef DetId key_type;
0010 
0011   enum Flags {
0012     kGood = -1,  // channel is good (mutually exclusive with other states)  setFlagBit(kGood) reset flags_ to zero
0013     kPoorReco,   // channel has been badly reconstructed (e.g. bad shape, bad chi2 etc.)
0014     kSaturated,  // saturated channel
0015     kOutOfTime   // channel out of time
0016   };
0017 
0018   HGCUncalibratedRecHit();
0019   HGCUncalibratedRecHit(
0020       const DetId& detId, float ampl, float ped, float jit, float chi2, uint32_t flags = 0, uint32_t aux = 0);
0021 
0022   virtual ~HGCUncalibratedRecHit();
0023   float amplitude() const { return amplitude_; }
0024   float pedestal() const { return pedestal_; }
0025   float jitter() const { return jitter_; }
0026   float chi2() const { return chi2_; }
0027   float outOfTimeEnergy() const { return OOTamplitude_; }
0028   float outOfTimeChi2() const { return OOTchi2_; }
0029 
0030   uint32_t flags() const { return flags_; }
0031   float jitterError() const;
0032   uint8_t jitterErrorBits() const;
0033   DetId id() const { return id_; }
0034 
0035   void setAmplitude(float amplitude) { amplitude_ = amplitude; }
0036   void setPedestal(float pedestal) { pedestal_ = pedestal; }
0037   void setJitter(float jitter) { jitter_ = jitter; }
0038   void setChi2(float chi2) { chi2_ = chi2; }
0039   void setOutOfTimeEnergy(float energy) { OOTamplitude_ = energy; }
0040   void setOutOfTimeChi2(float chi2) { OOTchi2_ = chi2; }
0041 
0042   void setJitterError(float jitterErr);
0043   void setFlags(uint32_t flags) { flags_ = flags; }
0044   void setId(DetId id) { id_ = id; }
0045   void setAux(uint32_t aux) { aux_ = aux; }
0046   void setFlagBit(Flags flag);
0047   bool checkFlag(Flags flag) const;
0048 
0049   bool isSaturated() const;
0050   bool isJitterValid() const;
0051   bool isJitterErrorValid() const;
0052 
0053 private:
0054   float amplitude_;     //< Reconstructed amplitude
0055   float pedestal_;      //< Reconstructed pedestal
0056   float jitter_;        //< Reconstructed time jitter
0057   float chi2_;          //< Chi2 of the pulse
0058   float OOTamplitude_;  //< Out-Of-Time reconstructed amplitude
0059   float OOTchi2_;       //< Out-Of-Time Chi2
0060   uint32_t flags_;      //< flag to be propagated to RecHit
0061   uint32_t aux_;        //< aux word; first 8 bits contain time (jitter) error
0062   DetId id_;            //< Detector ID
0063 };
0064 
0065 #endif