CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_4/src/DataFormats/EcalRecHit/interface/EcalUncalibratedRecHit.h

Go to the documentation of this file.
00001 #ifndef DATAFORMATS_ECALUNCALIBRATEDRECHIT
00002 #define DATAFORMATS_ECALUNCALIBRATEDRECHIT
00003 
00004 #include <vector>
00005 #include "DataFormats/DetId/interface/DetId.h"
00006 
00007 class EcalUncalibratedRecHit {
00008 
00009   public:
00010   
00011   typedef DetId key_type;
00012 
00013   enum Flags {
00014           kGood=-1,                 // channel is good (mutually exclusive with other states)  setFlagBit(kGood) reset flags_ to zero 
00015           kPoorReco,                // channel has been badly reconstructed (e.g. bad shape, bad chi2 etc.)
00016           kSaturated,               // saturated channel
00017           kOutOfTime,               // channel out of time
00018           kLeadingEdgeRecovered,    // saturated channel: energy estimated from the leading edge before saturation
00019           kHasSwitchToGain6,        // at least one data frame is in G6
00020           kHasSwitchToGain1         // at least one data frame is in G1
00021           
00022   };
00023 
00024   EcalUncalibratedRecHit();
00025   EcalUncalibratedRecHit(const DetId& detId, float ampl, float ped,
00026                           float jit, float chi2, uint32_t flags = 0, uint32_t aux = 0);
00027 
00028   virtual ~EcalUncalibratedRecHit();
00029   float amplitude() const { return amplitude_; }
00030   float pedestal() const { return pedestal_; }
00031   float jitter() const { return jitter_; }
00032   float chi2() const { return chi2_; }
00033   float outOfTimeEnergy() const { return OOTamplitude_; }
00034   float outOfTimeChi2() const { return OOTchi2_; }
00035 
00036   uint32_t flags() const { return flags_; }
00037   float jitterError() const;
00038   uint8_t jitterErrorBits() const;
00039   DetId  id() const { return id_; }
00040 
00041   void setAmplitude( float amplitude ) { amplitude_ = amplitude; }
00042   void setPedestal( float pedestal ) { pedestal_ = pedestal; }
00043   void setJitter( float jitter ) { jitter_ = jitter; }
00044   void setChi2( float chi2 ) { chi2_ = chi2; }
00045   void setOutOfTimeEnergy( float energy ) { OOTamplitude_ = energy; }
00046   void setOutOfTimeChi2( float chi2 ){ OOTchi2_ = chi2; }
00047 
00048   void setJitterError( float jitterErr );
00049   void setFlags( uint32_t flags ) { flags_ = flags; }
00050   void setId( DetId id ) { id_ = id; }
00051   void setAux( uint32_t aux ) { aux_ = aux; }
00052   void setFlagBit(Flags flag);
00053   bool checkFlag(Flags flag) const;
00054 
00055   bool isSaturated() const;
00056   bool isJitterValid() const;
00057   bool isJitterErrorValid() const;
00058 
00059  private:
00060   float amplitude_;    //< Reconstructed amplitude
00061   float pedestal_;     //< Reconstructed pedestal
00062   float jitter_;       //< Reconstructed time jitter
00063   float chi2_;         //< Chi2 of the pulse
00064   float OOTamplitude_; //< Out-Of-Time reconstructed amplitude 
00065   float OOTchi2_;      //< Out-Of-Time Chi2 
00066   uint32_t flags_;     //< flag to be propagated to RecHit
00067   uint32_t aux_;       //< aux word; first 8 bits contain time (jitter) error
00068   DetId  id_;          //< Detector ID
00069 };
00070 
00071 #endif