File indexing completed on 2024-04-06 12:04:09
0001 #ifndef DATAFORMATS_FTLUNCALIBRATEDRECHIT
0002 #define DATAFORMATS_FTLUNCALIBRATEDRECHIT
0003
0004 #include <vector>
0005 #include "DataFormats/DetId/interface/DetId.h"
0006
0007 class FTLUncalibratedRecHit {
0008 public:
0009 typedef DetId key_type;
0010
0011 enum Flags {
0012 kGood = -1,
0013 kPoorReco,
0014 kSaturated,
0015 kOutOfTime
0016 };
0017
0018 FTLUncalibratedRecHit();
0019 FTLUncalibratedRecHit(const DetId& detId,
0020 uint8_t row,
0021 uint8_t column,
0022 std::pair<float, float> ampl,
0023 std::pair<float, float> time,
0024 float timeError,
0025 float position,
0026 float positionError,
0027 unsigned char flags = 0);
0028 FTLUncalibratedRecHit(const DetId& detId,
0029 std::pair<float, float> ampl,
0030 std::pair<float, float> time,
0031 float timeError,
0032 float position,
0033 float positionError,
0034 unsigned char flags = 0);
0035
0036 ~FTLUncalibratedRecHit() = default;
0037 std::pair<float, float> amplitude() const { return amplitude_; }
0038 std::pair<float, float> time() const { return time_; }
0039 float position() const { return position_; }
0040
0041 float timeError() const { return timeError_; }
0042 float positionError() const { return positionError_; }
0043
0044 unsigned char flags() const { return flags_; };
0045
0046 DetId id() const { return id_; }
0047 int row() const { return row_; }
0048 int column() const { return column_; }
0049
0050 void setAmplitude(std::pair<float, float> amplitude) { amplitude_ = amplitude; }
0051 void setTime(std::pair<float, float> time) { time_ = time; }
0052
0053 void setTimeError(float timeErr) { timeError_ = timeErr; }
0054 void setId(DetId id) { id_ = id; }
0055 void setFlagBit(Flags flag);
0056 bool checkFlag(Flags flag) const;
0057
0058 void setPosition(float position) { position_ = position; }
0059 void setPositionError(float positionErr) { positionError_ = positionErr; }
0060
0061 bool isTimeValid() const;
0062 bool isTimeErrorValid() const;
0063
0064 bool isSaturated() const;
0065
0066 private:
0067 std::pair<float, float> amplitude_;
0068 std::pair<float, float> time_;
0069 float timeError_;
0070 float position_;
0071 float positionError_;
0072 DetId id_;
0073 uint8_t row_;
0074 uint8_t column_;
0075 unsigned char flags_;
0076 };
0077
0078 #endif