Hall A ROOT/C++ Analyzer (podd)
Loading...
Searching...
No Matches
THaVDCChamber.h
Go to the documentation of this file.
1#ifndef Podd_THaVDCChamber_h_
2#define Podd_THaVDCChamber_h_
3
5// //
6// THaVDCChamber //
7// //
9
10#include "THaSubDetector.h"
11#include "TClonesArray.h"
12#include "THaVDCPlane.h"
13#include "THaVDCPoint.h"
14#include <cassert>
15
16class THaEvData;
17
18// Coordinates of a point in this chamber
20public:
23 Double_t theta; // TRANSPORT x' = dx/dz
24 Double_t phi; // TRANSPORT y' = dy/dz
25};
26
28
29public:
30
31 explicit THaVDCChamber( const char* name="", const char* description="",
32 THaDetectorBase* parent = nullptr );
33 virtual ~THaVDCChamber();
34
35 virtual void Clear( Option_t* opt="" ); // Reset event-by-event data
36 virtual Int_t Decode( const THaEvData& evData );
37 virtual Int_t CoarseTrack(); // Find clusters & estimate track
38 virtual Int_t FineTrack(); // More precisely calculate track
39 virtual EStatus Init( const TDatime& date );
40 virtual void SetDebug( Int_t level );
41
43 const THaVDCCluster* v ) const;
44
45 // Get and Set Functions
46 THaVDCPlane* GetUPlane() const { return fU; }
47 THaVDCPlane* GetVPlane() const { return fV; }
48 Int_t GetNPoints() const { return fPoints->GetLast()+1; }
49 TClonesArray* GetPoints() const { return fPoints; }
50 Double_t GetSpacing() const { return fSpacing;}
52 { assert( i>=0 && i<GetNPoints() );
53 return static_cast<THaVDCPoint*>( fPoints->UncheckedAt(i) ); }
54 Double_t GetZ() const { return fU->GetZ(); }
55
56protected:
57
58 // Subdetectors
59 THaVDCPlane* fU; // The U plane
60 THaVDCPlane* fV; // The V plane
61
62 // Event data
63 TClonesArray* fPoints; // Pairs of possibly matching U and V clusters
64
65 // Geometry
66 Double_t fSpacing; // Space between U & V planes (m)
67 Double_t fSin_u; // Trig functions for the U plane axis angle
69 Double_t fSin_v; // Trig functions for the V plane axis angle
71 Double_t fInv_sin_vu; // 1/Sine of the difference between the
72 // V axis angle and the U axis angle
73
74 void ApplyTimeCorrection(); // Correct hit drift times by common offset
75 void FindClusters(); // Find clusters in U and V planes
76 void FitTracks(); // Fit local tracks for each cluster
77 Int_t MatchUVClusters(); // Match clusters in U with clusters in V
78 Int_t CalcPointCoords() const;
79
80 Double_t UVtoX( Double_t u, Double_t v ) const;
81 Double_t UVtoY( Double_t u, Double_t v ) const;
82
83 virtual Int_t DefineVariables( EMode mode = kDefine );
84
85 ClassDef(THaVDCChamber,0) // VDC chamber (pair of a U and a V plane)
86};
87
88//_____________________________________________________________________________
90{
91 return (u*fSin_v - v*fSin_u) * fInv_sin_vu;
92}
93
94//_____________________________________________________________________________
96{
97 return (v*fCos_u - u*fCos_v) * fInv_sin_vu;
98}
99
101
102#endif
int Int_t
double Double_t
const char Option_t
#define ClassDef(name, id)
char name[80]
Double_t fCos_u
virtual Int_t DefineVariables(EMode mode=kDefine)
Double_t fSin_v
THaVDCPlane * GetUPlane() const
virtual void Clear(Option_t *opt="")
TClonesArray * fPoints
THaVDCPlane * fU
Double_t fInv_sin_vu
Double_t UVtoX(Double_t u, Double_t v) const
virtual Int_t CoarseTrack()
Int_t MatchUVClusters()
THaVDCPlane * fV
THaVDCPoint * GetPoint(Int_t i) const
TClonesArray * GetPoints() const
void ApplyTimeCorrection()
Int_t CalcPointCoords() const
Double_t fSin_u
Double_t fSpacing
Double_t GetSpacing() const
virtual void SetDebug(Int_t level)
virtual Int_t FineTrack()
Double_t fCos_v
virtual ~THaVDCChamber()
Int_t GetNPoints() const
THaVDCPlane * GetVPlane() const
Double_t GetZ() const
virtual Int_t Decode(const THaEvData &evData)
PointCoords_t CalcDetCoords(const THaVDCCluster *u, const THaVDCCluster *v) const
Double_t UVtoY(Double_t u, Double_t v) const
Double_t GetZ() const
Definition THaVDCPlane.h:61
TObject * UncheckedAt(Int_t i) const
Int_t GetLast() const override
v