Hall C ROOT/C++ Analyzer (hcana)
Go to the documentation of this file.
1 #ifndef ROOT_THcDC
2 #define ROOT_THcDC
5 // //
6 // THcDC //
7 // //
10 #include "THaTrackingDetector.h"
11 #include "THcHitList.h"
12 #include "THcRawDCHit.h"
13 #include "THcSpacePoint.h"
14 #include "THcDriftChamberPlane.h"
15 #include "THcDriftChamber.h"
16 #include "TMath.h"
18 #define NUM_FPRAY 4
20 //class THaScCalib;
21 class TClonesArray;
23 class THcDC : public THaTrackingDetector, public THcHitList {
25 public:
26  THcDC( const char* name, const char* description = "",
27  THaApparatus* a = NULL );
28  virtual ~THcDC();
30  virtual Int_t Decode( const THaEvData& );
31  virtual EStatus Init( const TDatime& run_time );
32  virtual Int_t End(THaRunBase* run=0);
33  virtual Int_t CoarseTrack( TClonesArray& tracks );
34  virtual Int_t FineTrack( TClonesArray& tracks );
36  virtual Int_t ApplyCorrections( void );
38  // Int_t GetNHits() const { return fNhit; }
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:
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];}
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];}
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;}
70  Double_t GetPlaneTimeZero(Int_t plane) const { return fPlaneTimeZero[plane-1];}
71  Double_t GetSigma(Int_t plane) const { return fSigma[plane-1];}
74  Double_t GetNSperChan() const { return fNSperChan;}
76  Double_t GetCenter(Int_t plane) const {
77  return
78  //fXCenter[chamber]*sin(fAlphaAngle[plane-1]) +
79  //fYCenter[chamber]*cos(fAlphaAngle[plane-1]);
81  fXPos[plane-1]*sin(fAlphaAngle[plane-1]) +
82  fYPos[plane-1]*cos(fAlphaAngle[plane-1]);
83  }
84  // friend class THaScCalib;
86  THcDC(); // for ROOT I/O
87 protected:
100  TClonesArray* fDCTracks; // Tracks found from stubs (THcDCTrack obj)
101  // Calibration
103  // Hall C Parameters
104  char fPrefix[2];
105  Int_t fNPlanes; // Total number of DC planes
106  char** fPlaneNames;
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.
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]
131  Double_t* fWire_hit_should; //[fNPlanes]
133  Double_t fNSperChan; /* TDC bin size */
135  Int_t fSingleStub; /* If 1, single stubs make tracks */
145  // Each of these will be dimensioned with the number of chambers
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
178  //
187  // For accumulating statitics for efficiencies
192  // Pointer to global var indicating whether this spectrometer is triggered
193  // for this event.
196  // Useful derived quantities
197  // double tan_angle, sin_angle, cos_angle;
199  // Intermediate structure for building
200  static const UInt_t MAXTRACKS = 100;
202  std::vector<THcDriftChamberPlane*> fPlanes; // List of plane objects
203  std::vector<THcDriftChamber*> fChambers; // List of chamber objects
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();
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 };
230 #endif
Int_t fNthits
Definition: THcDC.h:121
Double_t * fCentralTime
Definition: THcDC.h:158
Int_t GetFixPropagationCorrectionFlag() const
Definition: THcDC.h:72
TClonesArray * fTrackProj
Definition: THcDC.h:205
Int_t fNsp_best
Definition: THcDC.h:124
Int_t fUseNewTrackFit
Definition: THcDC.h:142
char fPrefix[2]
Definition: THcDC.h:104
Double_t fNSperChan
Definition: THcDC.h:133
Bool_t * fPresentP
Definition: THcDC.h:194
Double_t * fPlaneTimeZero
Definition: THcDC.h:175
Double_t fXtTrCriterion
Definition: THcDC.h:137
Double_t GetSigma(Int_t plane) const
Definition: THcDC.h:71
Int_t fdebugtrackprint
Definition: THcDC.h:93
Int_t GetReadoutLR(Int_t plane) const
Definition: THcDC.h:65
Double_t * fSpace_Point_Criterion
Definition: THcDC.h:151
Double_t * fSigma
Definition: THcDC.h:176
std::vector< THcDriftChamber * > fChambers
Definition: THcDC.h:203
Double_t DpsiFun(Double_t ray[4], Int_t plane)
Definition: THcDC.cxx:1572
Double_t fXp_fp_best
Definition: THcDC.h:181
Int_t fdebugprintrawdc
Definition: THcDC.h:90
Int_t GetNWires(Int_t plane) const
Definition: THcDC.h:44
Int_t * fTdcWinMin
Definition: THcDC.h:156
Builds a Hall C ENGINE style list of raw hits from raw data.
Definition: THcHitList.h:27
Int_t fNhits
Definition: THcDC.h:120
Int_t GetTdcWinMax(Int_t plane) const
Definition: THcDC.h:50
Double_t * fResidualsExclPlane
Definition: THcDC.h:129
Double_t fYptTrCriterion
Definition: THcDC.h:140
Int_t GetTdcWinMin(Int_t plane) const
Definition: THcDC.h:49
Int_t fTDC_RefTimeCut
Definition: THcDC.h:96
Double_t fChisq_best
Definition: THcDC.h:183
Int_t GetWireOrder(Int_t plane) const
Definition: THcDC.h:46
Int_t fHMSStyleChambers
Definition: THcDC.h:95
void Setup(const char *name, const char *description)
Definition: THcDC.cxx:93
Int_t fNPlanes
Definition: THcDC.h:105
int Int_t
Int_t fSingleStub
Definition: THcDC.h:135
bool Bool_t
UInt_t fNChambers
Definition: THcDC.h:107
void DeleteArrays()
Definition: THcDC.cxx:469
Double_t fXptTrCriterion
Definition: THcDC.h:139
Int_t * fDriftTimeSign
Definition: THcDC.h:162
Int_t * fMaxHits
Definition: THcDC.h:149
Double_t * fWire_hit_did
Definition: THcDC.h:130
Double_t * fZPos
Definition: THcDC.h:169
Int_t GetVersion() const
Definition: THcDC.h:67
double cos(double)
Analyze a package of horizontal drift chambers.
Definition: THcDC.h:23
virtual EStatus Init(const TDatime &run_time)
Definition: THcDC.cxx:196
virtual Int_t DefineVariables(EMode mode=kDefine)
Definition: THcDC.cxx:399
Int_t fNTracksMaxFP
Definition: THcDC.h:136
Double_t * fLR_best
Definition: THcDC.h:126
Int_t * fNChamber
Definition: THcDC.h:160
Int_t * fMinHits
Definition: THcDC.h:148
Double_t fY_fp_best
Definition: THcDC.h:180
Double_t GetCenter(Int_t plane) const
Definition: THcDC.h:76
Double_t * fCentralWire
Definition: THcDC.h:174
Int_t fVersion
Definition: THcDC.h:143
Int_t fFixLR
Definition: THcDC.h:108
void PrintSpacePoints()
Definition: THcDC.cxx:746
Double_t GetNSperChan() const
Definition: THcDC.h:74
Definition: THcDC.cxx:189
virtual Int_t CoarseTrack(TClonesArray &tracks)
Definition: THcDC.cxx:609
Double_t GetSpacePointCriterion(Int_t chamber) const
Definition: THcDC.h:62
void PrintTrack()
Definition: THcDC.cxx:1536
Int_t GetMinCombos(Int_t chamber) const
Definition: THcDC.h:61
Int_t * fTdcWinMax
Definition: THcDC.h:157
Double_t GetGammaAngle(Int_t plane) const
Definition: THcDC.h:57
Double_t * fGammaAngle
Definition: THcDC.h:172
Int_t fdebugprintdecodeddc
Definition: THcDC.h:94
UInt_t fNDCTracks
Definition: THcDC.h:99
Double_t GetPlaneTimeZero(Int_t plane) const
Definition: THcDC.h:70
void EfficiencyPerWire(Int_t golden_track_index)
Definition: THcDC.cxx:727
double sin(double)
Double_t * fWire_hit_should
Definition: THcDC.h:131
Double_t fYp_fp_best
Definition: THcDC.h:182
Double_t GetBetaAngle(Int_t plane) const
Definition: THcDC.h:56
Int_t fStubTest
Definition: THcDC.h:119
Double_t * fYCenter
Definition: THcDC.h:147
Double_t * fYPos
Definition: THcDC.h:168
Int_t fUseNewLinkStubs
Definition: THcDC.h:141
Double_t fYtTrCriterion
Definition: THcDC.h:138
Int_t GetDriftTimeSign(Int_t plane) const
Definition: THcDC.h:64
char ** fPlaneNames
Definition: THcDC.h:106
Double_t * fXCenter
Definition: THcDC.h:146
Int_t fTotEvents
Definition: THcDC.h:188
void SetFocalPlaneBestTrack(Int_t golden_track_index)
Definition: THcDC.cxx:702
Int_t * fReadoutLR
Definition: THcDC.h:164
Double_t * fBetaAngle
Definition: THcDC.h:171
auto * a
Int_t * fNWires
Definition: THcDC.h:159
Int_t GetNChamber(Int_t plane) const
Definition: THcDC.h:45
Int_t * fReadoutTB
Definition: THcDC.h:163
Int_t * fPlaneEvents
Definition: THcDC.h:190
Double_t GetCentralWire(Int_t plane) const
Definition: THcDC.h:48
unsigned int UInt_t
Int_t GetMinHits(Int_t chamber) const
Definition: THcDC.h:59
void run(bool only_compile=false)
Int_t fProjectToChamber
Definition: THcDC.h:114
virtual Int_t End(THaRunBase *run=0)
Definition: THcDC.cxx:1613
Bool_t fInSideDipoleExit_best
Definition: THcDC.h:186
Int_t fdebugflagstubs
Definition: THcDC.h:92
virtual Int_t ReadDatabase(const TDatime &date)
Definition: THcDC.cxx:270
void LinkStubs()
Definition: THcDC.cxx:861
virtual Int_t ApplyCorrections(void)
Definition: THcDC.cxx:603
void ClearEvent()
Definition: THcDC.cxx:521
static const UInt_t MAXTRACKS
Definition: THcDC.h:200
Int_t fdebugflagpr
Definition: THcDC.h:91
Int_t * fWireOrder
Definition: THcDC.h:161
double Double_t
Int_t fUseNewFindSpacePoints
Definition: THcDC.h:88
Int_t * fNChamHits
Definition: THcDC.h:189
Double_t * fResiduals
Definition: THcDC.h:128
Int_t fSp1_ID_best
Definition: THcDC.h:184
Int_t fFixPropagationCorrection
Definition: THcDC.h:110
Int_t * fMinCombos
Definition: THcDC.h:150
void PrintStubs()
Definition: THcDC.cxx:765
Double_t GetCentralTime(Int_t plane) const
Definition: THcDC.h:63
virtual ~THcDC()
Definition: THcDC.cxx:449
Double_t GetYPos(Int_t plane) const
Definition: THcDC.h:53
Int_t GetMaxHits(Int_t chamber) const
Definition: THcDC.h:60
void EffInit()
Definition: THcDC.cxx:1621
Int_t fN_True_RawHits
Definition: THcDC.h:122
Double_t * fDist_best
Definition: THcDC.h:125
void NewTrackFit(UInt_t TrackIndex)
Definition: THcDC.cxx:1113
virtual Int_t Decode(const THaEvData &)
Definition: THcDC.cxx:554
void FitLineToTrack(Int_t TrackHits, Double_t coords[], Int_t planes[], Double_t wiresigma[], Double_t TrackCoord[], Double_t save_ray[])
Definition: THcDC.cxx:1073
Int_t GetReadoutTB(Int_t plane) const
Definition: THcDC.h:66
void NewLinkStubs()
Definition: THcDC.cxx:780
Double_t * fPos_best
Definition: THcDC.h:127
virtual Int_t FineTrack(TClonesArray &tracks)
Definition: THcDC.cxx:697
TClonesArray * fDCTracks
Definition: THcDC.h:100
void TrackFit()
Definition: THcDC.cxx:1243
Double_t fX_fp_best
Definition: THcDC.h:179
Double_t ** fPlaneCoeffs
Definition: THcDC.h:177
Int_t fdebuglinkstubs
Definition: THcDC.h:89
Double_t fTrackLargeResidCut
Definition: THcDC.h:97
void Eff()
Definition: THcDC.cxx:1645
Double_t GetAlphaAngle(Int_t plane) const
Definition: THcDC.h:55
Double_t * fPitch
Definition: THcDC.h:173
std::vector< THcDriftChamberPlane * > fPlanes
Definition: THcDC.h:202
Double_t GetXPos(Int_t plane) const
Definition: THcDC.h:52
char name[80]
Double_t fWireVelocity
Definition: THcDC.h:134
Double_t * fAlphaAngle
Definition: THcDC.h:170
Double_t GetZPos(Int_t plane) const
Definition: THcDC.h:54
Int_t fNSp
Definition: THcDC.h:123
Int_t fSp2_ID_best
Definition: THcDC.h:185
Double_t GetPitch(Int_t plane) const
Definition: THcDC.h:47
ClassDef(THcHitList, 0)
Double_t * fXPos
Definition: THcDC.h:167