Hall A ROOT/C++ Analyzer (podd)
Loading...
Searching...
No Matches
THaVDCHit.h
Go to the documentation of this file.
1#ifndef Podd_THaVDCHit_h_
2#define Podd_THaVDCHit_h_
3
5// //
6// THaVDCHit //
7// //
9
10#include "TObject.h"
11#include "THaVDCWire.h"
12#include "DataType.h"
13#include <cassert>
14#include <functional>
15
16class THaVDCHit : public TObject {
17
18public:
19 explicit THaVDCHit( THaVDCWire* wire=nullptr, UInt_t rawtime=0,
20 Double_t time=0.0, UInt_t nthit=0 )
21 : fWire(wire), fRawTime(rawtime), fTime(time),
22 fNthit(nthit), fDist(kBig), fdDist(1.0), ftrDist(kBig),
23 fltrDist(kBig), fTrkNum(0), fClsNum(-1) {}
24 THaVDCHit( const THaVDCHit& ) = default;
25 THaVDCHit& operator=( const THaVDCHit& ) = default;
26
27 virtual Double_t ConvertTimeToDist(Double_t slope);
28 Int_t Compare ( const TObject* obj ) const;
29 Bool_t IsSortable () const { return true; }
30
31 // Get and Set Functions
32 THaVDCWire* GetWire() const { return fWire; }
33 Int_t GetWireNum() const { return fWire->GetNum(); }
34 UInt_t GetRawTime() const { return fRawTime; }
35 Double_t GetTime() const { return fTime; }
36 Double_t GetDist() const { return fDist; }
37 Double_t GetPos() const { return fWire->GetPos(); } //Position of hit wire
38 Double_t GetdDist() const { return fdDist; }
39 Int_t GetTrkNum() const { return fTrkNum; }
40 Int_t GetClsNum() const { return fClsNum; }
41 UInt_t GetNthit() const { return fNthit; }
42
43 void SetWire(THaVDCWire * wire) { fWire = wire; }
46 void SetDist(Double_t dist) { fDist = dist; }
47 void SetdDist(Double_t ddist) { fdDist = ddist; }
48 void SetFitDist(Double_t dist) { ftrDist = dist; }
50 void SetTrkNum(Int_t num) { fTrkNum = num; }
51 void SetClsNum(Int_t num) { fClsNum = num; }
52 void SetNthit(UInt_t num) { fNthit = num; }
53
54 // Functor for ordering hits
56 public:
57 bool operator() ( const THaVDCHit* a, const THaVDCHit* b ) const
58 {
59 assert( a && b );
60 if( a->GetWireNum() != b->GetWireNum() )
61 return ( a->GetWireNum() < b->GetWireNum() );
62 return ( a->GetTime() < b->GetTime() );
63 }
64 };
65
66protected:
67
68 THaVDCWire* fWire; // Wire on which the hit occurred
69 UInt_t fRawTime; // TDC value (channels)
70 Double_t fTime; // Measured drift time, corrected for trigger time (s)
71 UInt_t fNthit; // Number of TDC hits per channel per event
72 Double_t fDist; // (Perpendicular) Drift Distance
73 Double_t fdDist; // Uncertainty in fDist (for chi2 calc)
74 Double_t ftrDist; // (Perpendicular) distance from the global track (m)
75 Double_t fltrDist; // (Perpendicular) distance from the local track (m)
76 Int_t fTrkNum; // Number of the track using this hit (0 = unused)
77 Int_t fClsNum; // Number of the cluster using this hit (-1 = unused)
78
79 ClassDef(THaVDCHit,4) // VDCHit class
80};
81
83#endif
int Int_t
unsigned int UInt_t
const Data_t kBig
Definition DataType.h:15
uint32_t time
bool Bool_t
double Double_t
#define ClassDef(name, id)
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t b
bool operator()(const THaVDCHit *a, const THaVDCHit *b) const
Definition THaVDCHit.h:57
Double_t fltrDist
Definition THaVDCHit.h:75
THaVDCWire * GetWire() const
Definition THaVDCHit.h:32
THaVDCHit(const THaVDCHit &)=default
void SetFitDist(Double_t dist)
Definition THaVDCHit.h:48
Bool_t IsSortable() const
Definition THaVDCHit.h:29
void SetWire(THaVDCWire *wire)
Definition THaVDCHit.h:43
Double_t fDist
Definition THaVDCHit.h:72
Int_t fTrkNum
Definition THaVDCHit.h:76
UInt_t GetRawTime() const
Definition THaVDCHit.h:34
THaVDCWire * fWire
Definition THaVDCHit.h:68
UInt_t fNthit
Definition THaVDCHit.h:71
Double_t GetdDist() const
Definition THaVDCHit.h:38
Double_t fdDist
Definition THaVDCHit.h:73
Double_t GetDist() const
Definition THaVDCHit.h:36
THaVDCHit & operator=(const THaVDCHit &)=default
UInt_t fRawTime
Definition THaVDCHit.h:69
void SetNthit(UInt_t num)
Definition THaVDCHit.h:52
Double_t GetTime() const
Definition THaVDCHit.h:35
UInt_t GetNthit() const
Definition THaVDCHit.h:41
void SetdDist(Double_t ddist)
Definition THaVDCHit.h:47
THaVDCHit(THaVDCWire *wire=nullptr, UInt_t rawtime=0, Double_t time=0.0, UInt_t nthit=0)
Definition THaVDCHit.h:19
Int_t GetWireNum() const
Definition THaVDCHit.h:33
virtual Double_t ConvertTimeToDist(Double_t slope)
Definition THaVDCHit.cxx:16
void SetClsNum(Int_t num)
Definition THaVDCHit.h:51
Int_t GetTrkNum() const
Definition THaVDCHit.h:39
Int_t Compare(const TObject *obj) const
Definition THaVDCHit.cxx:36
void SetRawTime(UInt_t time)
Definition THaVDCHit.h:44
Double_t fTime
Definition THaVDCHit.h:70
Double_t GetPos() const
Definition THaVDCHit.h:37
void SetLocalFitDist(Double_t dist)
Definition THaVDCHit.h:49
void SetDist(Double_t dist)
Definition THaVDCHit.h:46
Double_t ftrDist
Definition THaVDCHit.h:74
void SetTime(Double_t time)
Definition THaVDCHit.h:45
Int_t fClsNum
Definition THaVDCHit.h:77
void SetTrkNum(Int_t num)
Definition THaVDCHit.h:50
Int_t GetClsNum() const
Definition THaVDCHit.h:40
Double_t GetPos() const
Definition THaVDCWire.h:27
Int_t GetNum() const
Definition THaVDCWire.h:25
double dist(AxisAngle const &r1, AxisAngle const &r2)
TArc a