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,
40  uint8_t row,
41  uint8_t column,
42  float energy,
43  float time,
44  float timeError,
45  float position,
46  float positionError,
47  uint32_t flagBits = 0);
48 
49  FTLRecHit(const DetId& id,
50  float energy,
51  float time,
52  float timeError,
53  float position,
54  float positionError,
55  uint32_t flagBits = 0);
56 
58 
59  float energy() const { return energy_; }
60  void setEnergy(float energy) { energy_ = energy; }
61 
62  const DetId& id() const { return id_; }
63  const DetId& detid() const { return id(); }
64 
65  const MTDDetId mtdId() const { return MTDDetId(id_); }
66 
67  int row() const { return row_; }
68  int column() const { return column_; }
69 
70  float time() const { return time_; }
71  void setTime(float time) { time_ = time; }
72 
73  float position() const { return position_; }
75 
76  bool isTimeValid() const;
77  bool isTimeErrorValid() const;
78 
79  float timeError() const { return timeError_; }
80  void setTimeError(float err) { timeError_ = err; }
81 
82  float positionError() const { return positionError_; }
83  void setPositionError(float poserr) { positionError_ = poserr; }
84 
86  void setFlag(int flag) { flagBits_ |= (0x1 << flag); }
87  void unsetFlag(int flag) { flagBits_ &= ~(0x1 << flag); }
88 
90  bool checkFlag(int flag) const { return flagBits_ & (0x1 << flag); }
91 
93  bool checkFlags(const std::vector<int>& flagsvec) const;
94 
95 private:
97  float energy_;
98  float time_;
99  float timeError_;
101  float position_;
103  uint8_t row_;
104  uint8_t column_;
105 
107  unsigned char flagBits_;
108 };
109 
110 std::ostream& operator<<(std::ostream& s, const FTLRecHit& hit);
111 
112 #endif
FTLRecHit::key_type
DetId key_type
Definition: FTLRecHit.h:17
FTLRecHit
Definition: FTLRecHit.h:15
FTLRecHit::column
int column() const
Definition: FTLRecHit.h:68
FTLRecHit::column_
uint8_t column_
Definition: FTLRecHit.h:104
FTLRecHit::time
float time() const
Definition: FTLRecHit.h:70
FTLRecHit::FTLRecHit
FTLRecHit()
Definition: FTLRecHit.cc:11
FTLRecHit::isTimeErrorValid
bool isTimeErrorValid() const
Definition: FTLRecHit.cc:44
FTLRecHit::checkFlag
bool checkFlag(int flag) const
check if the flag is true
Definition: FTLRecHit.h:90
FTLRecHit::timeError
float timeError() const
Definition: FTLRecHit.h:79
CaloRecHit.h
FTLRecHit::row_
uint8_t row_
Definition: FTLRecHit.h:103
FTLRecHit::id
const DetId & id() const
Definition: FTLRecHit.h:62
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:71
FTLRecHit::unsetFlag
void unsetFlag(int flag)
Definition: FTLRecHit.h:87
FTLRecHit::energy
float energy() const
get the id
Definition: FTLRecHit.h:59
FTLRecHit::checkFlags
bool checkFlags(const std::vector< int > &flagsvec) const
check if one of the flags in a set is true
Definition: FTLRecHit.cc:54
FTLRecHit::positionError_
float positionError_
Definition: FTLRecHit.h:102
FTLRecHit::energy_
float energy_
Definition: FTLRecHit.h:97
MTDDetId.h
FTLRecHit::timeError_
float timeError_
Definition: FTLRecHit.h:99
FTLRecHit::setFlag
void setFlag(int flag)
set the flags (from Flags or ESFlags)
Definition: FTLRecHit.h:86
FTLRecHit::setPositionError
void setPositionError(float poserr)
Definition: FTLRecHit.h:83
FTLRecHit::time_
float time_
Definition: FTLRecHit.h:98
FTLRecHit::positionError
float positionError() const
Definition: FTLRecHit.h:82
submitPVResolutionJobs.err
err
Definition: submitPVResolutionJobs.py:85
FTLRecHit::kGood
Definition: FTLRecHit.h:21
FTLRecHit::detid
const DetId & detid() const
Definition: FTLRecHit.h:63
FTLRecHit::id_
DetId id_
Definition: FTLRecHit.h:96
FTLRecHit::flagBits_
unsigned char flagBits_
store rechit condition (see Flags enum) in a bit-wise way
Definition: FTLRecHit.h:107
FTLRecHit::setEnergy
void setEnergy(float energy)
Definition: FTLRecHit.h:60
FTLRecHit::kUnknown
Definition: FTLRecHit.h:23
FTLRecHit::setTimeError
void setTimeError(float err)
Definition: FTLRecHit.h:80
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:63
FTLRecHit::isTimeValid
bool isTimeValid() const
Definition: FTLRecHit.cc:37
FTLRecHit::position_
float position_
position is the distance from the center of the bar to hit
Definition: FTLRecHit.h:101
FTLRecHit::setPosition
void setPosition(float position)
Definition: FTLRecHit.h:74
FTLRecHit::row
int row() const
Definition: FTLRecHit.h:67
FTLRecHit::position
float position() const
Definition: FTLRecHit.h:73
FTLRecHit::kKilled
Definition: FTLRecHit.h:22
hit
Definition: SiStripHitEffFromCalibTree.cc:88
RemoveAddSevLevel.flag
flag
Definition: RemoveAddSevLevel.py:117
FTLRecHit::mtdId
const MTDDetId mtdId() const
Definition: FTLRecHit.h:65