FTLUncalibratedRecHit

Flags

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
#ifndef DATAFORMATS_FTLUNCALIBRATEDRECHIT
#define DATAFORMATS_FTLUNCALIBRATEDRECHIT

#include <vector>
#include "DataFormats/DetId/interface/DetId.h"

class FTLUncalibratedRecHit {
public:
  typedef DetId key_type;

  enum Flags {
    kGood = -1,  // channel is good (mutually exclusive with other states)  setFlagBit(kGood) reset flags_ to zero
    kPoorReco,   // channel has been badly reconstructed (e.g. bad shape, bad chi2 etc.)
    kSaturated,  // saturated channel
    kOutOfTime   // channel out of time
  };

  FTLUncalibratedRecHit();
  FTLUncalibratedRecHit(const DetId& detId,
                        uint8_t row,
                        uint8_t column,
                        std::pair<float, float> ampl,
                        std::pair<float, float> time,
                        float timeError,
                        float position,
                        float positionError,
                        unsigned char flags = 0);
  FTLUncalibratedRecHit(const DetId& detId,
                        std::pair<float, float> ampl,
                        std::pair<float, float> time,
                        float timeError,
                        float position,
                        float positionError,
                        unsigned char flags = 0);

  ~FTLUncalibratedRecHit() = default;
  std::pair<float, float> amplitude() const { return amplitude_; }
  std::pair<float, float> time() const { return time_; }
  float position() const { return position_; }

  float timeError() const { return timeError_; }
  float positionError() const { return positionError_; }

  unsigned char flags() const { return flags_; };

  DetId id() const { return id_; }
  int row() const { return row_; }
  int column() const { return column_; }

  void setAmplitude(std::pair<float, float> amplitude) { amplitude_ = amplitude; }
  void setTime(std::pair<float, float> time) { time_ = time; }

  void setTimeError(float timeErr) { timeError_ = timeErr; }
  void setId(DetId id) { id_ = id; }
  void setFlagBit(Flags flag);
  bool checkFlag(Flags flag) const;

  void setPosition(float position) { position_ = position; }
  void setPositionError(float positionErr) { positionError_ = positionErr; }

  bool isTimeValid() const;
  bool isTimeErrorValid() const;

  bool isSaturated() const;

private:
  std::pair<float, float> amplitude_;
  std::pair<float, float> time_;
  float timeError_;
  float position_;  /// distance from the center of the bar to the hit
  float positionError_;
  DetId id_;
  uint8_t row_;
  uint8_t column_;
  unsigned char flags_;
};

#endif