CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/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,                 // channel is good
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           kFake                  // the signal in the channel is a fake (e.g. a so-called spike)
00020   };
00021 
00022   EcalUncalibratedRecHit();
00023   EcalUncalibratedRecHit(const DetId& detId, double ampl, double ped,
00024                           double jit, double chi2, uint32_t flags = 0, uint32_t aux = 0);
00025 
00026   virtual ~EcalUncalibratedRecHit();
00027   double amplitude() const { return amplitude_; }
00028   double pedestal() const { return pedestal_; }
00029   double jitter() const { return jitter_; }
00030   double chi2() const { return chi2_; }
00031   uint32_t recoFlag() const { return 0xF & flags_; }
00032   float  outOfTimeEnergy() const;
00033   float  outOfTimeChi2() const;
00034   float jitterError() const;
00035   uint8_t jitterErrorBits() const;
00036   DetId  id() const { return id_; }
00037 
00038   void setAmplitude( double amplitude ) { amplitude_ = amplitude; }
00039   void setPedestal( double pedestal ) { pedestal_ = pedestal; }
00040   void setJitter( double jitter ) { jitter_ = jitter; }
00041   void setJitterError( float jitterErr );
00042   void setChi2( double chi2 ) { chi2_ = chi2; }
00043   void setFlags( uint32_t flags ) { flags_ = flags; }
00044   void setRecoFlag( uint32_t flags );
00045   // set the energy for out of time events
00046   // (only energy >= 0 will be stored)
00047   void setOutOfTimeEnergy( float energy );
00048   void setOutOfTimeChi2( float chi2 );
00049   void setId( DetId id ) { id_ = id; }
00050   void setAux( uint32_t aux ) { aux_ = aux; }
00051   
00052   bool isSaturated() const;
00053   bool isJitterValid() const;
00054   bool isJitterErrorValid() const;
00055 
00056  private:
00057   double amplitude_;   //< Reconstructed amplitude
00058   double pedestal_;    //< Reconstructed pedestal
00059   double jitter_;      //< Reconstructed time jitter
00060   double chi2_;        //< Chi2 of the fit
00061   uint32_t flags_;     //< flag to be propagated to RecHit
00062   uint32_t aux_;       //< aux word; first 8 bits contain time (jitter) error
00063   DetId  id_;          //< Detector ID
00064 };
00065 
00066 #endif