CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EcalUncalibratedRecHit.h
Go to the documentation of this file.
1 #ifndef DATAFORMATS_ECALUNCALIBRATEDRECHIT
2 #define DATAFORMATS_ECALUNCALIBRATEDRECHIT
3 
4 #include <vector>
6 
8 
9  public:
10 
11  typedef DetId key_type;
12 
13  enum Flags {
14  kGood=-1, // channel is good (mutually exclusive with other states) setFlagBit(kGood) reset flags_ to zero
15  kPoorReco, // channel has been badly reconstructed (e.g. bad shape, bad chi2 etc.)
16  kSaturated, // saturated channel
17  kOutOfTime, // channel out of time
18  kLeadingEdgeRecovered, // saturated channel: energy estimated from the leading edge before saturation
19  kHasSwitchToGain6, // at least one data frame is in G6
20  kHasSwitchToGain1 // at least one data frame is in G1
21 
22  };
23 
25  amplitude_(0.), pedestal_(0.), jitter_(0.), chi2_(10000.), OOTamplitude_(0.), OOTchi2_(10000.), flags_(0), aux_(0) { }
26 
27  EcalUncalibratedRecHit(const DetId& id, float ampl, float ped,
28  float jit, float chi2, uint32_t flags = 0, uint32_t aux = 0):
29  amplitude_(ampl), pedestal_(ped), jitter_(jit), chi2_(chi2), OOTamplitude_(0.), OOTchi2_(10000.), flags_(flags), aux_(aux), id_(id) { }
30 
31 
32  float amplitude() const { return amplitude_; }
33  float pedestal() const { return pedestal_; }
34  float jitter() const { return jitter_; }
35  float chi2() const { return chi2_; }
36  float outOfTimeEnergy() const { return OOTamplitude_; }
37  float outOfTimeChi2() const { return OOTchi2_; }
38 
39  uint32_t flags() const { return flags_; }
40  float jitterError() const;
41  uint8_t jitterErrorBits() const;
42  DetId id() const { return id_; }
43 
45  void setPedestal( float pedestal ) { pedestal_ = pedestal; }
46  void setJitter( float jitter ) { jitter_ = jitter; }
47  void setChi2( float chi2 ) { chi2_ = chi2; }
49  void setOutOfTimeChi2( float chi2 ){ OOTchi2_ = chi2; }
50 
51  void setJitterError( float jitterErr );
52  void setFlags( uint32_t flags ) { flags_ = flags; }
53  void setId( DetId id ) { id_ = id; }
54  void setAux( uint32_t aux ) { aux_ = aux; }
55  void setFlagBit(Flags flag);
56  bool checkFlag(Flags flag) const;
57 
58  bool isSaturated() const;
59  bool isJitterValid() const;
60  bool isJitterErrorValid() const;
61 
62  private:
63  float amplitude_; //< Reconstructed amplitude
64  float pedestal_; //< Reconstructed pedestal
65  float jitter_; //< Reconstructed time jitter
66  float chi2_; //< Chi2 of the pulse
67  float OOTamplitude_; //< Out-Of-Time reconstructed amplitude
68  float OOTchi2_; //< Out-Of-Time Chi2
69  uint32_t flags_; //< flag to be propagated to RecHit
70  uint32_t aux_; //< aux word; first 8 bits contain time (jitter) error
71  DetId id_; //< Detector ID
72 };
73 
74 #endif
void setJitter(float jitter)
void setJitterError(float jitterErr)
void setOutOfTimeChi2(float chi2)
EcalUncalibratedRecHit(const DetId &id, float ampl, float ped, float jit, float chi2, uint32_t flags=0, uint32_t aux=0)
void setFlags(uint32_t flags)
bool checkFlag(Flags flag) const
Definition: DetId.h:18
void setPedestal(float pedestal)
void setOutOfTimeEnergy(float energy)
void setAmplitude(float amplitude)