Hall C ROOT/C++ Analyzer (hcana)
THcDCHit.h
Go to the documentation of this file.
1 #ifndef ROOT_THcDCHit
2 #define ROOT_THcDCHit
3 
5 // //
6 // THcDCHit //
7 // //
9 
10 #include "TObject.h"
11 #include "THcDCWire.h"
12 #include "THcDriftChamberPlane.h"
13 #include "THcDriftChamber.h"
14 #include <cstdio>
15 
16 class THcDCHit : public TObject {
17 
18 public:
19  THcDCHit( THcDCWire* wire=NULL, Int_t rawnorefcorrtime=0, Int_t rawtime=0, Double_t time=0.0,
20  THcDriftChamberPlane* wp=0) :
21  fWire(wire), fRawNoRefCorrTime(rawnorefcorrtime), fRawTime(rawtime), fTime(time), fWirePlane(wp),
22  fDist(0.0), fLR(0), ftrDist(kBig),fNPlaneCluster(0) {
23  if (wire) ConvertTimeToDist();
24  fCorrected = 0;
25  }
26  virtual ~THcDCHit() {}
27 
28  virtual Double_t ConvertTimeToDist();
29  Int_t Compare ( const TObject* obj ) const;
30  Bool_t IsSortable () const { return kTRUE; }
31  virtual void Print( Option_t* opt="" ) const;
32 
33  // Get and Set Functions
34  THcDCWire* GetWire() const { return fWire; }
35  Double_t GetWireSigma() const { return fWire->GetSigma(); }
36  Int_t GetWireNum() const { return fWire->GetNum(); }
37  Int_t GetRawTime() const { return fRawTime; }
39  Double_t GetTime() const { return fTime; }
40  Double_t GetDist() const { return fDist; }
41  Double_t GetPos() const { return fWire->GetPos(); } //Position of hit wire
42  Double_t GetCoord() const { return fCoord; }
43  Double_t GetdDist() const { return fdDist; }
44  Int_t GetCorrectedStatus() const { return fCorrected; }
45 
47 
48  void SetWire(THcDCWire * wire) { fWire = wire; ConvertTimeToDist(); }
49  void SetRawTime(Int_t time) { fRawTime = time; }
50  void SetTime(Double_t time) { fTime = time; }
51  void SetDist(Double_t dist) { fDist = dist; }
52  void SetLeftRight(Int_t lr) { fCoord = GetPos() + lr*fDist; fLR=lr;}
54  Int_t GetNPlaneClust() const { return fNPlaneCluster; }
55  Int_t GetLR() { return fLR; }
56  void SetdDist(Double_t ddist) { fdDist = ddist; }
57  void SetFitDist(Double_t dist) { ftrDist = dist; }
58  Int_t GetPlaneNum() const { return fWirePlane->GetPlaneNum(); }
62 
64 
65 protected:
66  static const Double_t kBig;
67 
68  THcDCWire* fWire; // Wire on which the hit occurred
69  Int_t fRawNoRefCorrTime; // raw TDC value (channels)
70  Int_t fRawTime; // TDC value (channels) reference time subtracted
71  Double_t fTime; // Time corrected for time offset of wire (s)
73  Double_t fDist; // (Perpendicular) Drift Distance
74  Int_t fLR; // +1/-1 which side of wire
75  Double_t fCoord; // Actual coordinate of hit
76  Double_t fdDist; // uncertainty in fDist (for chi2 calc)
77  Double_t ftrDist; // (Perpendicular) distance from the track
78  Int_t fCorrected; // Has this hit been corrected?
79  Int_t fReadoutSide; // Side where wire is read out. 1-4 is T/R/B/L from beam view for new chambers.
80  Int_t fNPlaneCluster; // Number of plane clusters hit is in.
81 
83 
84 
85 private:
86  THcDCHit( const THcDCHit& );
87  THcDCHit& operator=( const THcDCHit& );
88 
89  ClassDef(THcDCHit,2) // Drift Chamber Hit
90 };
91 
93 
94 #endif
Drift chamber wire hit info.
Definition: THcDCHit.h:16
void SetFitDist(Double_t dist)
Definition: THcDCHit.h:57
Int_t GetPlaneIndex() const
Definition: THcDCHit.h:59
void SetCorrectedStatus(Int_t c)
Definition: THcDCHit.h:61
static const Double_t kBig
Definition: THcDCHit.h:66
const char Option_t
THcDriftChamberPlane * GetWirePlane() const
Definition: THcDCHit.h:46
Int_t Compare(const TObject *obj) const
Definition: THcDCHit.cxx:54
Class for a a single Hall C horizontal drift chamber plane.
Int_t GetChamberNum() const
Definition: THcDCHit.h:60
THcDCWire * GetWire() const
Definition: THcDCHit.h:34
THcDriftChamberPlane * fWirePlane
Definition: THcDCHit.h:72
Double_t fDist
Pointer to parent wire plane.
Definition: THcDCHit.h:73
int Int_t
bool Bool_t
Int_t GetWireNum() const
Definition: THcDCHit.h:36
Double_t fTime
Definition: THcDCHit.h:71
Int_t fNPlaneCluster
Definition: THcDCHit.h:80
Int_t fCorrected
Definition: THcDCHit.h:78
void SetWire(THcDCWire *wire)
Definition: THcDCHit.h:48
#define ClassDef(name, id)
Double_t fdDist
Definition: THcDCHit.h:76
THcDriftChamber * fChamber
Definition: THcDCHit.h:82
void SetdDist(Double_t ddist)
Definition: THcDCHit.h:56
Double_t GetCoord() const
Definition: THcDCHit.h:42
Int_t GetPlaneNum() const
Definition: THcDCHit.h:58
Double_t fCoord
Definition: THcDCHit.h:75
Double_t GetPos() const
Definition: THcDCWire.h:27
void SetTime(Double_t time)
Definition: THcDCHit.h:50
Class representing a drift chamber wire.
Definition: THcDCWire.h:13
Double_t GetTime() const
Definition: THcDCHit.h:39
Int_t GetReadoutSide()
Definition: THcDCHit.h:63
Int_t GetChamberNum() const
void IncrNPlaneClust()
Definition: THcDCHit.h:53
Int_t fLR
Definition: THcDCHit.h:74
Int_t fReadoutSide
Definition: THcDCHit.h:79
void SetLeftRight(Int_t lr)
Definition: THcDCHit.h:52
Int_t fRawTime
Definition: THcDCHit.h:70
Int_t fRawNoRefCorrTime
Definition: THcDCHit.h:69
Int_t GetRawNoRefCorrTime() const
Definition: THcDCHit.h:38
Int_t GetCorrectedStatus() const
Definition: THcDCHit.h:44
Double_t GetPos() const
Definition: THcDCHit.h:41
Double_t GetSigma() const
Definition: THcDCWire.h:29
virtual void Print(Option_t *opt="") const
Definition: THcDCHit.cxx:18
THcDCHit & operator=(const THcDCHit &)
double Double_t
Int_t GetReadoutSide()
Definition: THcDCWire.h:30
Bool_t IsSortable() const
Definition: THcDCHit.h:30
Double_t ftrDist
Definition: THcDCHit.h:77
THcDCHit(THcDCWire *wire=NULL, Int_t rawnorefcorrtime=0, Int_t rawtime=0, Double_t time=0.0, THcDriftChamberPlane *wp=0)
Definition: THcDCHit.h:19
Int_t GetNPlaneClust() const
Definition: THcDCHit.h:54
Double_t GetWireSigma() const
Definition: THcDCHit.h:35
Int_t GetNum() const
Definition: THcDCWire.h:25
virtual Double_t ConvertTimeToDist()
Definition: THcDCHit.cxx:34
THcDCWire * fWire
Definition: THcDCHit.h:68
Int_t GetRawTime() const
Definition: THcDCHit.h:37
Subdetector class for a single drift chamber with several planes.
Double_t GetdDist() const
Definition: THcDCHit.h:43
Double_t GetDist() const
Definition: THcDCHit.h:40
Int_t GetLR()
Definition: THcDCHit.h:55
void SetRawTime(Int_t time)
Definition: THcDCHit.h:49
const Bool_t kTRUE
virtual ~THcDCHit()
Definition: THcDCHit.h:26
void SetDist(Double_t dist)
Definition: THcDCHit.h:51