test
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>
7 
9 
10  public:
11 
12  typedef DetId key_type;
13 
14  enum Flags {
15  kGood=-1, // channel is good (mutually exclusive with other states) setFlagBit(kGood) reset flags_ to zero
16  kPoorReco, // channel has been badly reconstructed (e.g. bad shape, bad chi2 etc.)
17  kSaturated, // saturated channel
18  kOutOfTime, // channel out of time
19  kLeadingEdgeRecovered, // saturated channel: energy estimated from the leading edge before saturation
20  kHasSwitchToGain6, // at least one data frame is in G6
21  kHasSwitchToGain1 // at least one data frame is in G1
22 
23  };
24 
26 
27  EcalUncalibratedRecHit(const DetId& id, float ampl, float ped,
28  float jit, float chi2, uint32_t flags = 0, uint32_t aux = 0);
29 
30 
31  float amplitude() const { return amplitude_; }
32  float amplitudeError() const { return amplitudeError_; }
33  float pedestal() const { return pedestal_; }
34  float jitter() const { return jitter_; }
35  float chi2() const { return chi2_; }
36  float outOfTimeAmplitude(int bx) const { return OOTamplitudes_[bx]; }
37 
38  uint32_t flags() const { return flags_; }
39  float jitterError() const;
40  uint8_t jitterErrorBits() const;
41  DetId id() const { return id_; }
42 
44  void setAmplitudeError( float amplitudeerror ) { amplitudeError_ = amplitudeerror; }
45  void setPedestal( float pedestal ) { pedestal_ = pedestal; }
46  void setJitter( float jitter ) { jitter_ = jitter; }
47  void setChi2( float chi2 ) { chi2_ = chi2; }
48  void setOutOfTimeAmplitude( int bx, float amplitude ) { OOTamplitudes_[bx] = amplitude; }
49 
50  void setJitterError( float jitterErr );
51  void setFlags( uint32_t flags ) { flags_ = flags; }
52  void setId( DetId id ) { id_ = id; }
53  void setAux( uint32_t aux ) { aux_ = aux; }
54  void setFlagBit(Flags flag);
55  bool checkFlag(Flags flag) const;
56 
57  bool isSaturated() const;
58  bool isJitterValid() const;
59  bool isJitterErrorValid() const;
60 
61  private:
62  float amplitude_; //< Reconstructed amplitude
63  float amplitudeError_; //< Reconstructed amplitude uncertainty
64  float pedestal_; //< Reconstructed pedestal
65  float jitter_; //< Reconstructed time jitter
66  float chi2_; //< Chi2 of the pulse
67  float OOTamplitudes_[EcalDataFrame::MAXSAMPLES]; //< Out-Of-Time reconstructed amplitude, one for each active BX, from readout sample 0 to 9
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)
float outOfTimeAmplitude(int bx) const
void setAmplitudeError(float amplitudeerror)
float OOTamplitudes_[EcalDataFrame::MAXSAMPLES]
void setFlags(uint32_t flags)
bool checkFlag(Flags flag) const
Definition: DetId.h:18
void setOutOfTimeAmplitude(int bx, float amplitude)
void setPedestal(float pedestal)
void setAmplitude(float amplitude)
static const int MAXSAMPLES
Definition: EcalDataFrame.h:48