Hall C ROOT/C++ Analyzer (hcana)
Loading...
Searching...
No Matches
THcDC.h
Go to the documentation of this file.
1#ifndef ROOT_THcDC
2#define ROOT_THcDC
3
5// //
6// THcDC //
7// //
9
10#include "THaTrackingDetector.h"
11#include "THcHitList.h"
12#include "THcRawDCHit.h"
13#include "THcSpacePoint.h"
15#include "THcDriftChamber.h"
16#include "TMath.h"
17
18#define NUM_FPRAY 4
19
20//class THaScCalib;
21class TClonesArray;
22
23class THcDC : public THaTrackingDetector, public THcHitList {
24
25public:
26 THcDC( const char* name, const char* description = "",
27 THaApparatus* a = NULL );
28 virtual ~THcDC();
29
30 virtual Int_t Decode( const THaEvData& );
31 virtual EStatus Init( const TDatime& run_time );
32 virtual Int_t End(THaRunBase* run=0);
35
36 virtual Int_t ApplyCorrections( void );
37
38 // Int_t GetNHits() const { return fNhit; }
39
40 // Int_t GetNTracks() const { return fNDCTracks; }
41 // const TClonesArray* GetTrackHits() const { return fTrackProj; }
42 void SetFocalPlaneBestTrack(Int_t golden_track_index); // Called in THcHallCSpectrometer:
43
44 Int_t GetNWires(Int_t plane) const { return fNWires[plane-1];}
45 Int_t GetNChamber(Int_t plane) const { return fNChamber[plane-1];}
46 Int_t GetWireOrder(Int_t plane) const { return fWireOrder[plane-1];}
47 Double_t GetPitch(Int_t plane) const { return fPitch[plane-1];}
48 Double_t GetCentralWire(Int_t plane) const { return fCentralWire[plane-1];}
49 Int_t GetTdcWinMin(Int_t plane) const { return fTdcWinMin[plane-1];}
50 Int_t GetTdcWinMax(Int_t plane) const { return fTdcWinMax[plane-1];}
51
52 Double_t GetXPos(Int_t plane) const { return fXPos[plane-1];}
53 Double_t GetYPos(Int_t plane) const { return fYPos[plane-1];}
54 Double_t GetZPos(Int_t plane) const { return fZPos[plane-1];}
55 Double_t GetAlphaAngle(Int_t plane) const { return fAlphaAngle[plane-1];}
56 Double_t GetBetaAngle(Int_t plane) const { return fBetaAngle[plane-1];}
57 Double_t GetGammaAngle(Int_t plane) const { return fGammaAngle[plane-1];}
58
59 Int_t GetMinHits(Int_t chamber) const { return fMinHits[chamber-1];}
60 Int_t GetMaxHits(Int_t chamber) const { return fMaxHits[chamber-1];}
61 Int_t GetMinCombos(Int_t chamber) const { return fMinCombos[chamber-1];}
62 Double_t GetSpacePointCriterion(Int_t chamber) const { return fSpace_Point_Criterion[chamber-1];}
63 Double_t GetCentralTime(Int_t plane) const { return fCentralTime[plane-1];}
64 Int_t GetDriftTimeSign(Int_t plane) const { return fDriftTimeSign[plane-1];}
65 Int_t GetReadoutLR(Int_t plane) const { return fReadoutLR[plane-1];}
66 Int_t GetReadoutTB(Int_t plane) const { return fReadoutTB[plane-1];}
67 Int_t GetVersion() const {return fVersion;}
68
69
70 Double_t GetPlaneTimeZero(Int_t plane) const { return fPlaneTimeZero[plane-1];}
71 Double_t GetSigma(Int_t plane) const { return fSigma[plane-1];}
73
74 Double_t GetNSperChan() const { return fNSperChan;}
75
76 Double_t GetCenter(Int_t plane) const {
77 return
78 //fXCenter[chamber]*sin(fAlphaAngle[plane-1]) +
79 //fYCenter[chamber]*cos(fAlphaAngle[plane-1]);
80
81 fXPos[plane-1]*sin(fAlphaAngle[plane-1]) +
82 fYPos[plane-1]*cos(fAlphaAngle[plane-1]);
83 }
84 // friend class THaScCalib;
85
86 THcDC(); // for ROOT I/O
87protected:
98
100 TClonesArray* fDCTracks; // Tracks found from stubs (THcDCTrack obj)
101 // Calibration
102
103 // Hall C Parameters
104 char fPrefix[2];
105 Int_t fNPlanes; // Total number of DC planes
108 Int_t fFixLR; // If 1, allow a given hit to have different LR
109 // for different space points
110 Int_t fFixPropagationCorrection; // If 1, don't reapply (and accumulate) the
111 // propagation along the wire correction for
112 // each space point a hit occurs in. Keep a
113 // separate correction for each space point.
114 Int_t fProjectToChamber; // If 1, project y position each stub back to it's own
115 // chamber before comparing y positions in LinkStubs
116 // Was used for SOS in ENGINE.
117
118 // Per-event data
123 Int_t fNSp; // Number of space points
124 Int_t fNsp_best; // Number of space points for gloden track
125 Double_t* fDist_best; //[fNPlanes]
126 Double_t* fLR_best; //[fNPlanes]
127 Double_t* fPos_best; //[fNPlanes]
128 Double_t* fResiduals; //[fNPlanes] Array of residuals
129 Double_t* fResidualsExclPlane; //[fNPlanes] Array of residuals with plane excluded
130 Double_t* fWire_hit_did; //[fNPlanes]
132
133 Double_t fNSperChan; /* TDC bin size */
135 Int_t fSingleStub; /* If 1, single stubs make tracks */
144
145 // Each of these will be dimensioned with the number of chambers
152
153 // Each of these will be dimensioned with the number of planes
154 // A THcDCPlane class object will need to access the value for
155 // its plane number. Should we have a Get method for each or
159 Int_t* fNWires; // Number of wires per plane
165
166
178 //
187 // For accumulating statitics for efficiencies
191
192 // Pointer to global var indicating whether this spectrometer is triggered
193 // for this event.
195
196 // Useful derived quantities
197 // double tan_angle, sin_angle, cos_angle;
198
199 // Intermediate structure for building
200 static const UInt_t MAXTRACKS = 100;
201
202 std::vector<THcDriftChamberPlane*> fPlanes; // List of plane objects
203 std::vector<THcDriftChamber*> fChambers; // List of chamber objects
204
205 TClonesArray* fTrackProj; // projection of track onto scintillator plane
206 // and estimated match to TOF paddle
207 void ClearEvent();
208 void DeleteArrays();
209 virtual Int_t ReadDatabase( const TDatime& date );
210 virtual Int_t DefineVariables( EMode mode = kDefine );
211 void LinkStubs();
212 void NewLinkStubs();
213 void TrackFit();
214 void NewTrackFit(UInt_t TrackIndex);
215 void FitLineToTrack(Int_t TrackHits,Double_t coords[],Int_t planes[],Double_t wiresigma[], Double_t TrackCoord[], Double_t save_ray[]);
216 Double_t DpsiFun(Double_t ray[4], Int_t plane);
217 void EffInit();
218 void Eff();
219
220 void Setup(const char* name, const char* description);
221 void PrintSpacePoints();
222 void PrintStubs();
223 void PrintTrack();
224 void EfficiencyPerWire(Int_t golden_track_index);
225 ClassDef(THcDC,0) // Set of Drift Chambers detector
226};
227
229
230#endif
int Int_t
unsigned int UInt_t
bool Bool_t
double Double_t
Analyze a package of horizontal drift chambers.
Definition THcDC.h:23
virtual Int_t End(THaRunBase *run=0)
Definition THcDC.cxx:1611
Bool_t fInSideDipoleExit_best
Definition THcDC.h:186
Bool_t * fPresentP
Definition THcDC.h:194
Int_t GetNChamber(Int_t plane) const
Definition THcDC.h:45
virtual Int_t ReadDatabase(const TDatime &date)
Definition THcDC.cxx:269
Int_t fNSp
Definition THcDC.h:123
Int_t fTDC_RefTimeCut
Definition THcDC.h:96
Int_t fdebugprintrawdc
Definition THcDC.h:90
Double_t GetNSperChan() const
Definition THcDC.h:74
Int_t fUseNewTrackFit
Definition THcDC.h:142
Int_t fdebugflagstubs
Definition THcDC.h:92
Int_t fTotEvents
Definition THcDC.h:188
Double_t * fLR_best
Definition THcDC.h:126
Int_t fN_True_RawHits
Definition THcDC.h:122
virtual EStatus Init(const TDatime &run_time)
Definition THcDC.cxx:195
Int_t GetFixPropagationCorrectionFlag() const
Definition THcDC.h:72
Int_t fSp2_ID_best
Definition THcDC.h:185
Int_t GetWireOrder(Int_t plane) const
Definition THcDC.h:46
Int_t * fNWires
Definition THcDC.h:159
Double_t GetPlaneTimeZero(Int_t plane) const
Definition THcDC.h:70
Double_t GetGammaAngle(Int_t plane) const
Definition THcDC.h:57
Double_t * fZPos
Definition THcDC.h:169
Double_t GetXPos(Int_t plane) const
Definition THcDC.h:52
Int_t fFixPropagationCorrection
Definition THcDC.h:110
void NewLinkStubs()
Definition THcDC.cxx:778
Int_t GetNWires(Int_t plane) const
Definition THcDC.h:44
Double_t GetBetaAngle(Int_t plane) const
Definition THcDC.h:56
Double_t * fBetaAngle
Definition THcDC.h:171
void PrintStubs()
Definition THcDC.cxx:763
Int_t fUseNewLinkStubs
Definition THcDC.h:141
Double_t fY_fp_best
Definition THcDC.h:180
Int_t GetDriftTimeSign(Int_t plane) const
Definition THcDC.h:64
Double_t * fGammaAngle
Definition THcDC.h:172
void Setup(const char *name, const char *description)
Definition THcDC.cxx:94
Double_t GetYPos(Int_t plane) const
Definition THcDC.h:53
Int_t GetTdcWinMin(Int_t plane) const
Definition THcDC.h:49
Int_t * fReadoutTB
Definition THcDC.h:163
Int_t * fPlaneEvents
Definition THcDC.h:190
THcDC()
Definition THcDC.cxx:188
void ClearEvent()
Definition THcDC.cxx:519
Double_t GetCentralWire(Int_t plane) const
Definition THcDC.h:48
Int_t fNPlanes
Definition THcDC.h:105
Int_t fVersion
Definition THcDC.h:143
Int_t fNTracksMaxFP
Definition THcDC.h:136
void NewTrackFit(UInt_t TrackIndex)
Definition THcDC.cxx:1111
Double_t ** fPlaneCoeffs
Definition THcDC.h:177
Double_t fNSperChan
Definition THcDC.h:133
Double_t * fYPos
Definition THcDC.h:168
Int_t fProjectToChamber
Definition THcDC.h:114
Double_t * fCentralWire
Definition THcDC.h:174
Double_t fXtTrCriterion
Definition THcDC.h:137
Double_t fXptTrCriterion
Definition THcDC.h:139
Int_t * fMinHits
Definition THcDC.h:148
virtual ~THcDC()
Definition THcDC.cxx:447
std::vector< THcDriftChamberPlane * > fPlanes
Definition THcDC.h:202
Double_t * fSpace_Point_Criterion
Definition THcDC.h:151
Double_t fWireVelocity
Definition THcDC.h:134
Int_t GetTdcWinMax(Int_t plane) const
Definition THcDC.h:50
Int_t fStubTest
Definition THcDC.h:119
TClonesArray * fDCTracks
Definition THcDC.h:100
std::vector< THcDriftChamber * > fChambers
Definition THcDC.h:203
Int_t fFixLR
Definition THcDC.h:108
char fPrefix[2]
Definition THcDC.h:104
void EffInit()
Definition THcDC.cxx:1619
Int_t GetReadoutLR(Int_t plane) const
Definition THcDC.h:65
virtual Int_t ApplyCorrections(void)
Definition THcDC.cxx:601
Int_t * fWireOrder
Definition THcDC.h:161
Double_t * fPlaneTimeZero
Definition THcDC.h:175
Double_t GetCentralTime(Int_t plane) const
Definition THcDC.h:63
Int_t * fMinCombos
Definition THcDC.h:150
Double_t fYptTrCriterion
Definition THcDC.h:140
Int_t GetMinCombos(Int_t chamber) const
Definition THcDC.h:61
Int_t fSingleStub
Definition THcDC.h:135
void Eff()
Definition THcDC.cxx:1643
Double_t fX_fp_best
Definition THcDC.h:179
void TrackFit()
Definition THcDC.cxx:1241
Double_t * fResiduals
Definition THcDC.h:128
TClonesArray * fTrackProj
Definition THcDC.h:205
Int_t fSp1_ID_best
Definition THcDC.h:184
static const UInt_t MAXTRACKS
Definition THcDC.h:200
Double_t * fResidualsExclPlane
Definition THcDC.h:129
Double_t DpsiFun(Double_t ray[4], Int_t plane)
Definition THcDC.cxx:1570
Double_t fChisq_best
Definition THcDC.h:183
void PrintSpacePoints()
Definition THcDC.cxx:744
Int_t * fTdcWinMin
Definition THcDC.h:156
Double_t * fAlphaAngle
Definition THcDC.h:170
Double_t * fWire_hit_should
Definition THcDC.h:131
Double_t GetSigma(Int_t plane) const
Definition THcDC.h:71
virtual Int_t Decode(const THaEvData &)
Definition THcDC.cxx:552
Double_t * fPitch
Definition THcDC.h:173
Int_t * fNChamber
Definition THcDC.h:160
Double_t GetCenter(Int_t plane) const
Definition THcDC.h:76
Int_t * fReadoutLR
Definition THcDC.h:164
Int_t fdebugprintdecodeddc
Definition THcDC.h:94
Double_t * fSigma
Definition THcDC.h:176
void EfficiencyPerWire(Int_t golden_track_index)
Definition THcDC.cxx:725
Double_t GetSpacePointCriterion(Int_t chamber) const
Definition THcDC.h:62
virtual Int_t CoarseTrack(TClonesArray &tracks)
Definition THcDC.cxx:607
Int_t fdebugflagpr
Definition THcDC.h:91
Double_t * fXCenter
Definition THcDC.h:146
Int_t * fMaxHits
Definition THcDC.h:149
Double_t * fCentralTime
Definition THcDC.h:158
void FitLineToTrack(Int_t TrackHits, Double_t coords[], Int_t planes[], Double_t wiresigma[], Double_t TrackCoord[], Double_t save_ray[])
Definition THcDC.cxx:1071
Double_t * fXPos
Definition THcDC.h:167
Int_t fHMSStyleChambers
Definition THcDC.h:95
Double_t fXp_fp_best
Definition THcDC.h:181
UInt_t fNChambers
Definition THcDC.h:107
Double_t GetAlphaAngle(Int_t plane) const
Definition THcDC.h:55
Double_t GetZPos(Int_t plane) const
Definition THcDC.h:54
Double_t fTrackLargeResidCut
Definition THcDC.h:97
Int_t GetReadoutTB(Int_t plane) const
Definition THcDC.h:66
Int_t * fDriftTimeSign
Definition THcDC.h:162
Double_t GetPitch(Int_t plane) const
Definition THcDC.h:47
Double_t * fPos_best
Definition THcDC.h:127
Int_t * fTdcWinMax
Definition THcDC.h:157
Double_t * fWire_hit_did
Definition THcDC.h:130
virtual Int_t FineTrack(TClonesArray &tracks)
Definition THcDC.cxx:695
Int_t fUseNewFindSpacePoints
Definition THcDC.h:88
Int_t fNhits
Definition THcDC.h:120
UInt_t fNDCTracks
Definition THcDC.h:99
void PrintTrack()
Definition THcDC.cxx:1534
Double_t * fDist_best
Definition THcDC.h:125
void LinkStubs()
Definition THcDC.cxx:859
Int_t GetMaxHits(Int_t chamber) const
Definition THcDC.h:60
Int_t fNsp_best
Definition THcDC.h:124
Int_t * fNChamHits
Definition THcDC.h:189
Double_t fYp_fp_best
Definition THcDC.h:182
virtual Int_t DefineVariables(EMode mode=kDefine)
Definition THcDC.cxx:398
Double_t fYtTrCriterion
Definition THcDC.h:138
Int_t fdebugtrackprint
Definition THcDC.h:93
Int_t fdebuglinkstubs
Definition THcDC.h:89
Double_t * fYCenter
Definition THcDC.h:147
Int_t fNthits
Definition THcDC.h:121
Int_t GetMinHits(Int_t chamber) const
Definition THcDC.h:59
Int_t GetVersion() const
Definition THcDC.h:67
char ** fPlaneNames
Definition THcDC.h:106
void DeleteArrays()
Definition THcDC.cxx:467
void SetFocalPlaneBestTrack(Int_t golden_track_index)
Definition THcDC.cxx:700
Builds a Hall C ENGx1INE style list of raw hits from raw data.
Definition THcHitList.h:27
ClassDef(THcHitList, 0)
RVec< PromoteType< T > > cos(const RVec< T > &v)
RVec< PromoteType< T > > sin(const RVec< T > &v)
TArc a
void tracks()