CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EcalRecHit.h
Go to the documentation of this file.
1 #ifndef DATAFORMATS_ECALRECHIT_H
2 #define DATAFORMATS_ECALRECHIT_H 1
3 
5 
12 class EcalRecHit : public CaloRecHit {
13 public:
14  typedef DetId key_type;
15 
16  // recHit flags
17  enum Flags {
18  kGood=0, // channel ok, the energy and time measurement are reliable
19  kPoorReco, // the energy is available from the UncalibRecHit, but approximate (bad shape, large chi2)
20  kOutOfTime, // the energy is available from the UncalibRecHit (sync reco), but the event is out of time
21  kFaultyHardware, // The energy is available from the UncalibRecHit, channel is faulty at some hardware level (e.g. noisy)
22  kNoisy, // the channel is very noisy
23  kPoorCalib, // the energy is available from the UncalibRecHit, but the calibration of the channel is poor
24  kSaturated, // saturated channel (recovery not tried)
25  kLeadingEdgeRecovered, // saturated channel: energy estimated from the leading edge before saturation
26  kNeighboursRecovered, // saturated/isolated dead: energy estimated from neighbours
27  kTowerRecovered, // channel in TT with no data link, info retrieved from Trigger Primitive
28  kDead, // channel is dead and any recovery fails
29  kKilled, // MC only flag: the channel is killed in the real detector
30  kTPSaturated, // the channel is in a region with saturated TP
31  kL1SpikeFlag, // the channel is in a region with TP with sFGVB = 0
32  kWeird, // the signal is believed to originate from an anomalous deposit (spike)
33  kDiWeird, // the signal is anomalous, and neighbors another anomalous signal
34  kHasSwitchToGain6, // at least one data frame is in G6
35  kHasSwitchToGain1, // at least one data frame is in G1
36  //
37  kUnknown // to ease the interface with functions returning flags.
38  };
39 
40  // ES recHit flags
41  enum ESFlags {
58  };
59 
71  EcalRecHit();
72  // by default a recHit is greated with no flag
73  EcalRecHit(const DetId& id, float energy, float time, uint32_t flags = 0, uint32_t flagBits = 0);
75  // For the moment not returning a specific id for subdetector
76  DetId id() const { return DetId(detid());}
77  bool isRecovered() const;
78  bool isTimeValid() const;
79  bool isTimeErrorValid() const;
80 
81 
82  float chi2() const;
83  float outOfTimeChi2() const;
84 
85  // set the energy for out of time events
86  // (only energy >= 0 will be stored)
87  float outOfTimeEnergy() const;
88  float timeError() const;
89 
90  void setChi2( float chi2 );
91  void setOutOfTimeChi2( float chi2 );
92  void setOutOfTimeEnergy( float energy );
93 
94  void setTimeError( uint8_t timeErrBits );
95 
96 
98  void setFlag(int flag) {flagBits_|= (0x1 << flag);}
99  void unsetFlag(int flag) {flagBits_ &= ~(0x1 << flag);}
100 
102  bool checkFlag(int flag) const{return flagBits_ & ( 0x1<<flag);}
103 
105  bool checkFlagMask(uint32_t mask) const { return flagBits_&mask; }
106 
108  Flags recoFlag() const ;
109 
110 private:
111 
113  uint32_t flagBits_;
114 };
115 
116 std::ostream& operator<<(std::ostream& s, const EcalRecHit& hit);
117 
118 #endif
long int flag
Definition: mlp_lapack.h:47
void unsetFlag(int flag)
Definition: EcalRecHit.h:99
bool isTimeErrorValid() const
Definition: EcalRecHit.cc:121
const DetId & detid() const
Definition: CaloRecHit.h:22
Flags recoFlag() const
DEPRECATED provided for temporary backward compatibility.
Definition: EcalRecHit.cc:133
void setFlag(int flag)
set the flags (from Flags or ESFlags)
Definition: EcalRecHit.h:98
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
float time() const
Definition: CaloRecHit.h:21
bool isTimeValid() const
Definition: EcalRecHit.cc:112
bool isRecovered() const
Definition: EcalRecHit.cc:18
void setTimeError(uint8_t timeErrBits)
Definition: EcalRecHit.cc:88
float outOfTimeEnergy() const
Definition: EcalRecHit.cc:40
bool checkFlag(int flag) const
check if the flag is true
Definition: EcalRecHit.h:102
float outOfTimeChi2() const
Definition: EcalRecHit.cc:34
float energy() const
Definition: CaloRecHit.h:19
float chi2() const
Definition: EcalRecHit.cc:26
uint32_t flags() const
Definition: CaloRecHit.h:23
float timeError() const
Definition: EcalRecHit.cc:95
void setOutOfTimeChi2(float chi2)
Definition: EcalRecHit.cc:77
Definition: DetId.h:20
DetId id() const
get the id
Definition: EcalRecHit.h:76
bool checkFlagMask(uint32_t mask) const
apply a bitmask to our flags. Experts only
Definition: EcalRecHit.h:105
void setChi2(float chi2)
Definition: EcalRecHit.cc:52
void setOutOfTimeEnergy(float energy)
Definition: EcalRecHit.cc:62
DetId key_type
Definition: EcalRecHit.h:14
uint32_t flagBits_
store rechit condition (see Flags enum) in a bit-wise way
Definition: EcalRecHit.h:113