CMS 3D CMS Logo

FTLRecHit.h
Go to the documentation of this file.
1 #ifndef DATAFORMATS_FTLRECHIT_H
2 #define DATAFORMATS_FTLRECHIT_H 1
3 
6 #include <vector>
7 
15 class FTLRecHit {
16 public:
17  typedef DetId key_type;
18 
19  // FTLEE recHit flags
20  enum Flags {
21  kGood = 0, // channel ok, the energy and time measurement are reliable
22  kKilled, // MC only flag: the channel is killed in the real detector
23  kUnknown // to ease the interface with functions returning flags.
24  };
25 
37  FTLRecHit();
38  // by default a recHit is greated with no flag
39  FTLRecHit(const DetId& id, float energy, float time, float timeError, uint32_t flagBits = 0);
40 
41  FTLRecHit(
42  const DetId& id, uint8_t row, uint8_t column, float energy, float time, float timeError, uint32_t flagBits = 0);
43 
45 
46  float energy() const { return energy_; }
47  void setEnergy(float energy) { energy_ = energy; }
48 
49  const DetId& id() const { return id_; }
50  const DetId& detid() const { return id(); }
51 
52  const MTDDetId mtdId() const { return MTDDetId(id_); }
53 
54  int row() const { return row_; }
55  int column() const { return column_; }
56 
57  float time() const { return time_; }
58  void setTime(float time) { time_ = time; }
59 
60  bool isTimeValid() const;
61  bool isTimeErrorValid() const;
62 
63  float timeError() const { return timeError_; }
64  void setTimeError(float err) { timeError_ = err; }
65 
67  void setFlag(int flag) { flagBits_ |= (0x1 << flag); }
68  void unsetFlag(int flag) { flagBits_ &= ~(0x1 << flag); }
69 
71  bool checkFlag(int flag) const { return flagBits_ & (0x1 << flag); }
72 
74  bool checkFlags(const std::vector<int>& flagsvec) const;
75 
76 private:
79  uint8_t row_, column_;
80 
82  unsigned char flagBits_;
83 };
84 
85 std::ostream& operator<<(std::ostream& s, const FTLRecHit& hit);
86 
87 #endif
FTLRecHit::key_type
DetId key_type
Definition: FTLRecHit.h:17
FTLRecHit
Definition: FTLRecHit.h:15
FTLRecHit::column
int column() const
Definition: FTLRecHit.h:55
FTLRecHit::column_
uint8_t column_
Definition: FTLRecHit.h:79
FTLRecHit::time
float time() const
Definition: FTLRecHit.h:57
FTLRecHit::FTLRecHit
FTLRecHit()
Definition: FTLRecHit.cc:11
FTLRecHit::isTimeErrorValid
bool isTimeErrorValid() const
Definition: FTLRecHit.cc:34
FTLRecHit::checkFlag
bool checkFlag(int flag) const
check if the flag is true
Definition: FTLRecHit.h:71
FTLRecHit::timeError
float timeError() const
Definition: FTLRecHit.h:63
CaloRecHit.h
FTLRecHit::row_
uint8_t row_
Definition: FTLRecHit.h:79
FTLRecHit::id
const DetId & id() const
Definition: FTLRecHit.h:49
DetId
Definition: DetId.h:17
FTLRecHit::Flags
Flags
Definition: FTLRecHit.h:20
alignCSCRings.s
s
Definition: alignCSCRings.py:92
FTLRecHit::setTime
void setTime(float time)
Definition: FTLRecHit.h:58
FTLRecHit::unsetFlag
void unsetFlag(int flag)
Definition: FTLRecHit.h:68
FTLRecHit::energy
float energy() const
get the id
Definition: FTLRecHit.h:46
FTLRecHit::checkFlags
bool checkFlags(const std::vector< int > &flagsvec) const
check if one of the flags in a set is true
Definition: FTLRecHit.cc:44
FTLRecHit::energy_
float energy_
Definition: FTLRecHit.h:78
runTheMatrix.err
err
Definition: runTheMatrix.py:288
MTDDetId.h
FTLRecHit::timeError_
float timeError_
Definition: FTLRecHit.h:78
FTLRecHit::setFlag
void setFlag(int flag)
set the flags (from Flags or ESFlags)
Definition: FTLRecHit.h:67
FTLRecHit::time_
float time_
Definition: FTLRecHit.h:78
FTLRecHit::kGood
Definition: FTLRecHit.h:21
FTLRecHit::detid
const DetId & detid() const
Definition: FTLRecHit.h:50
FTLRecHit::id_
DetId id_
Definition: FTLRecHit.h:77
FTLRecHit::flagBits_
unsigned char flagBits_
store rechit condition (see Flags enum) in a bit-wise way
Definition: FTLRecHit.h:82
FTLRecHit::setEnergy
void setEnergy(float energy)
Definition: FTLRecHit.h:47
FTLRecHit::kUnknown
Definition: FTLRecHit.h:23
FTLRecHit::setTimeError
void setTimeError(float err)
Definition: FTLRecHit.h:64
MTDDetId
Detector identifier base class for the MIP Timing Layer.
Definition: MTDDetId.h:21
operator<<
std::ostream & operator<<(std::ostream &s, const FTLRecHit &hit)
Definition: FTLRecHit.cc:53
FTLRecHit::isTimeValid
bool isTimeValid() const
Definition: FTLRecHit.cc:27
FTLRecHit::row
int row() const
Definition: FTLRecHit.h:54
FTLRecHit::kKilled
Definition: FTLRecHit.h:22
hit
Definition: SiStripHitEffFromCalibTree.cc:88
RemoveAddSevLevel.flag
flag
Definition: RemoveAddSevLevel.py:116
FTLRecHit::mtdId
const MTDDetId mtdId() const
Definition: FTLRecHit.h:52