00001
00015 #ifndef HIT_HH
00016 #define HIT_HH
00017
00018 #include "data_base.hh"
00019
00020 namespace larlight{
00025 class hit : public data_base {
00026
00027 public:
00028
00030 hit(DATA::DATA_TYPE type=DATA::Hit);
00031
00033 hit(const hit& original);
00034
00036 virtual ~hit(){}
00037
00038 void clear_data();
00039
00040
00041 void set_waveform (const std::vector<Double_t>& wf) { fHitSignal = wf;}
00042 void set_times (Double_t start, Double_t peak, Double_t end)
00043 {fStartTime = start; fPeakTime = peak; fEndTime = end;}
00044 void set_times_err (Double_t start, Double_t peak, Double_t end)
00045 {fSigmaStartTime = start; fSigmaPeakTime = peak; fSigmaEndTime = end;}
00046 void set_charge (Double_t q, Double_t q_max)
00047 {fCharge=q; fMaxCharge = q_max;}
00048 void set_charge_err(Double_t q, Double_t q_max)
00049 {fSigmaCharge=q; fSigmaMaxCharge=q_max;}
00050 void set_multiplicity(Int_t m){ fMultiplicity=m;}
00051 void set_channel (UInt_t ch){ fChannel=ch;}
00052 void set_wire (UInt_t wire) { fWire=wire;}
00053 void set_fit_goodness(Double_t v){ fGoodnessOfFit = v;}
00054 void set_view(GEO::View_t v){ fView = v;}
00055 void set_sigtype(GEO::SigType_t t) {fSignalType=t;}
00056
00057
00058 const std::vector<Double_t>& HitSignal() const { return fHitSignal; }
00059 Double_t StartTime() const { return fStartTime; }
00060 Double_t EndTime() const { return fEndTime; }
00061 Double_t PeakTime() const { return fPeakTime; }
00062 Double_t SigmaStartTime() const { return fSigmaStartTime; }
00063 Double_t SigmaEndTime() const { return fSigmaEndTime; }
00064 Double_t SigmaPeakTime() const { return fSigmaPeakTime; }
00065 Int_t Multiplicity() const { return fMultiplicity; }
00066 UInt_t Channel() const { return fChannel; }
00067 UInt_t Wire() const { return fWire; }
00068 Double_t Charge(bool max=false) const { return ( max ? fMaxCharge : fCharge);}
00069 Double_t SigmaCharge(bool max=false) const { return ( max ? fSigmaMaxCharge : fSigmaCharge ); }
00070 Double_t GoodnessOfFit() const { return fGoodnessOfFit; }
00071 GEO::SigType_t SignalType() const { return fSignalType; }
00072 GEO::View_t View() const { return fView; }
00073
00074 protected:
00075
00076 std::vector<Double_t> fHitSignal;
00077 Double_t fStartTime;
00078 Double_t fSigmaStartTime;
00079 Double_t fPeakTime;
00080 Double_t fSigmaPeakTime;
00081 Double_t fEndTime;
00082 Double_t fSigmaEndTime;
00083 Double_t fCharge;
00084 Double_t fSigmaCharge;
00085 Double_t fMaxCharge;
00086 Double_t fSigmaMaxCharge;
00087 Int_t fMultiplicity;
00088 Double_t fGoodnessOfFit;
00089 GEO::View_t fView;
00090 GEO::SigType_t fSignalType;
00091 UInt_t fChannel;
00092 UInt_t fWire;
00093 private:
00094
00096 ClassDef(hit,2)
00098
00099 };
00100
00105 class event_hit : public std::vector<larlight::hit>,
00106 public event_base {
00107
00108 public:
00109
00111 event_hit(DATA::DATA_TYPE type=DATA::Hit);
00112
00114 event_hit(const event_hit& original) : std::vector<larlight::hit>(original), event_base(original)
00115 {}
00116
00118 ~event_hit(){}
00119
00121 virtual void clear_data(){event_base::clear_data(); clear();}
00122
00128 void get_axis_range (std::vector<Double_t> &chmax, std::vector<Double_t> &chmin,
00129 std::vector<Double_t> &wiremax, std::vector<Double_t> &wiremin,
00130 std::vector<Double_t> &timemax, std::vector<Double_t> &timemin) const;
00131
00135 void get_axis_range (std::vector<Double_t> &chmax, std::vector<Double_t> &chmin,
00136 std::vector<Double_t> &wiremax, std::vector<Double_t> &wiremin,
00137 std::vector<Double_t> &timemax, std::vector<Double_t> &timemin,
00138 const std::vector<unsigned short>& hit_index) const;
00139
00140 private:
00141
00143 ClassDef(event_hit,3)
00145 };
00146 }
00147 #endif
00148