File indexing completed on 2024-04-06 12:04:09
0001 #ifndef DATAFORMATS_FTLRECHIT_H
0002 #define DATAFORMATS_FTLRECHIT_H 1
0003
0004 #include "DataFormats/ForwardDetId/interface/MTDDetId.h"
0005 #include "DataFormats/CaloRecHit/interface/CaloRecHit.h"
0006 #include <vector>
0007
0008
0009
0010
0011
0012
0013
0014
0015 class FTLRecHit {
0016 public:
0017 typedef DetId key_type;
0018
0019
0020 enum Flags {
0021 kGood = 0,
0022 kKilled,
0023 kUnknown
0024 };
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037 FTLRecHit();
0038
0039 FTLRecHit(const DetId& id,
0040 uint8_t row,
0041 uint8_t column,
0042 float energy,
0043 float time,
0044 float timeError,
0045 float position,
0046 float positionError,
0047 uint32_t flagBits = 0);
0048
0049 FTLRecHit(const DetId& id,
0050 float energy,
0051 float time,
0052 float timeError,
0053 float position,
0054 float positionError,
0055 uint32_t flagBits = 0);
0056
0057
0058
0059 float energy() const { return energy_; }
0060 void setEnergy(float energy) { energy_ = energy; }
0061
0062 const DetId& id() const { return id_; }
0063 const DetId& detid() const { return id(); }
0064
0065 const MTDDetId mtdId() const { return MTDDetId(id_); }
0066
0067 int row() const { return row_; }
0068 int column() const { return column_; }
0069
0070 float time() const { return time_; }
0071 void setTime(float time) { time_ = time; }
0072
0073 float position() const { return position_; }
0074 void setPosition(float position) { position_ = position; }
0075
0076 bool isTimeValid() const;
0077 bool isTimeErrorValid() const;
0078
0079 float timeError() const { return timeError_; }
0080 void setTimeError(float err) { timeError_ = err; }
0081
0082 float positionError() const { return positionError_; }
0083 void setPositionError(float poserr) { positionError_ = poserr; }
0084
0085
0086 void setFlag(int flag) { flagBits_ |= (0x1 << flag); }
0087 void unsetFlag(int flag) { flagBits_ &= ~(0x1 << flag); }
0088
0089
0090 bool checkFlag(int flag) const { return flagBits_ & (0x1 << flag); }
0091
0092
0093 bool checkFlags(const std::vector<int>& flagsvec) const;
0094
0095 private:
0096 DetId id_;
0097 float energy_;
0098 float time_;
0099 float timeError_;
0100
0101 float position_;
0102 float positionError_;
0103 uint8_t row_;
0104 uint8_t column_;
0105
0106
0107 unsigned char flagBits_;
0108 };
0109
0110 std::ostream& operator<<(std::ostream& s, const FTLRecHit& hit);
0111
0112 #endif