Hall C ROOT/C++ Analyzer (hcana)
Loading...
Searching...
No Matches
THcHodoscope.h
Go to the documentation of this file.
1#ifndef ROOT_THcHodoscope
2#define ROOT_THcHodoscope
3
5// //
6// THcHodoscope //
7// //
9
10#include <vector>
11
12#include "TClonesArray.h"
13#include "TH1F.h"
15#include "THcHitList.h"
16#include "THcHodoHit.h"
17#include "THcRawHodoHit.h"
19#include "THcCherenkov.h"
20
21#include "THaTrackingDetector.h"
22#include "THcHitList.h"
23#include "THcRawDCHit.h"
24#include "THcSpacePoint.h"
26#include "THcDriftChamber.h"
27#include "TMath.h"
28
29#include "THaSubDetector.h"
30#include "TClonesArray.h"
31#include <iostream>
32#include <fstream>
33
34
35class THaScCalib;
36
38
39public:
40 THcHodoscope( const char* name, const char* description = "",
41 THaApparatus* a = NULL );
42 virtual ~THcHodoscope();
43
44 virtual Int_t Decode( const THaEvData& );
45 virtual EStatus Init( const TDatime& run_time );
46 virtual void Clear( Option_t* opt="" );
47
50 virtual Int_t End(THaRunBase* run=0);
51
53 void EstimateFocalPlaneTime(void);
54 void OriginalTrackEffTest(void);
55 void TrackEffTest(void);
56 void CalcCluster(void);
57 virtual Int_t ApplyCorrections( void );
58 Double_t GetStartTime() const { return fStartTime; }
61 Int_t GetNfptimes() const {return fNfptimes;};
62 Int_t GetScinIndex(Int_t nPlane, Int_t nPaddle);
63 Int_t GetScinIndex(Int_t nSide, Int_t nPlane, Int_t nPaddle);
65 Int_t GetNTracks() const { return fTrackProj->GetLast()+1; }
66 Double_t GetTdcMin() const {return fScinTdcMin;}
67 Double_t GetTdcMax() const {return fScinTdcMax;}
73 Double_t GetHodoPosMinPh(Int_t iii) const {return fHodoPosMinPh[iii];}
74 Double_t GetHodoNegMinPh(Int_t iii) const {return fHodoNegMinPh[iii];}
77 Double_t GetHodoVelLight(Int_t iii) const {return fHodoVelLight[iii];}
88
89 //Get Time Walk Parameters
90 Double_t GetHodoVelFit(Int_t iii) const {return fHodoVelFit[iii];}
91 Double_t GetHodoCableFit(Int_t iii) const {return fHodoCableFit[iii];}
92 Double_t GetHodoLCoeff(Int_t iii) const {return fHodo_LCoeff[iii];}
93
94
95 Double_t GetHodoPos_c1(Int_t iii) const {return fHodoPos_c1[iii];}
96 Double_t GetHodoNeg_c1(Int_t iii) const {return fHodoNeg_c1[iii];}
97 Double_t GetHodoPos_c2(Int_t iii) const {return fHodoPos_c2[iii];}
98 Double_t GetHodoNeg_c2(Int_t iii) const {return fHodoNeg_c2[iii];}
99 Double_t GetTDCThrs() const {return fTdc_Thrs;}
100
104
105 Int_t GetGoodRawPad(Int_t iii){return fTOFCalc[iii].good_raw_pad;}
106 Int_t GetGoodRawPlane(Int_t iii){return fTOFCalc[iii].pindex;}
108 Int_t GetTotHits(){return fTOFCalc.size();}
109
112 UInt_t GetNPaddles(Int_t ip) { return fNPaddle[ip];}
116 Int_t GetTdcOffset(Int_t ip) const { return fTdcOffset[ip];}
118
119
120 Double_t GetBeta() const {return fBeta;}
121
122
123 Double_t GetHodoPosSigma(Int_t iii) const {return fHodoPosSigma[iii];}
124 Double_t GetHodoNegSigma(Int_t iii) const {return fHodoNegSigma[iii];}
125
126 Bool_t GetFlags(Int_t itrack, Int_t iplane, Int_t ihit,
127 Bool_t& onTrack, Bool_t& goodScinTime,
128 Bool_t& goodTdcNeg, Bool_t& goodTdcPos) const {
129 onTrack = fGoodFlags[itrack][iplane][ihit].onTrack;
130 goodScinTime = fGoodFlags[itrack][iplane][ihit].goodScinTime;
131 goodTdcNeg = fGoodFlags[itrack][iplane][ihit].goodTdcNeg;
132 goodTdcPos = fGoodFlags[itrack][iplane][ihit].goodTdcPos;
133 return(kTRUE);
134 }
135
136 const TClonesArray* GetTrackHits() const { return fTrackProj; }
137
138 friend class THaScCalib;
139
140 THcHodoscope(); // for ROOT I/O
141protected:
142
144
147
149
151
153 // Calibration
157 // Per-event data
174
176
179 // Per-event data
180
181 // Potential Hall C parameters. Mostly here for demonstration
182 Int_t fNPlanes; // Number of planes
183 UInt_t fMaxScinPerPlane,fMaxHodoScin,fTotHodScin; // max number of scin/plane; product of the first two
187 Int_t fNumPlanesBetaCalc; // Number of planes to use in beta calculation
189 Double_t fScinTdcMin, fScinTdcMax; // min and max TDC values
191 UInt_t* fNPaddle; // Number of paddles per plane
193
198
202
218
219 //New Time-Walk Calibration Parameters
230
231 Double_t fPartMass; // Nominal particle mass
232 Double_t fBetaNominal; // Beta for central ray of nominal particle type
233
234 THcScintillatorPlane** fPlanes; // List of plane objects
235
236 TClonesArray* fTrackProj; // projection of track onto scintillator plane
237 // and estimated match to TOF paddle
238
239 //-------------------------- Ahmed -----------------------------
240
241
245
251
255
270
277 ofstream fDumpOut;
280
281
286
291
292 // Double_t** fScinHit; // [fNPlanes] Array
293
294 Double_t* fFPTime; // [fNPlanes] Array
295
296
297 Double_t* fSumPlaneTime; // [fNPlanes]
298
299 Int_t* fNScinHits; // [fNPlanes]
300 Int_t* fNPlaneTime; // [fNPlanes]
301
302 Bool_t* fGoodPlaneTime; // [fNPlanes]
303
304 //----------------------------------------------------------------
305
306 // Useful derived quantities
307 // double tan_angle, sin_angle, cos_angle;
308
309 // static const char NDEST = 2;
310 // struct DataDest {
311 // Int_t* nthit;
312 // Int_t* nahit;
313 // Double_t* tdc;
314 // Double_t* tdc_c;
315 // Double_t* adc;
316 // Double_t* adc_p;
317 // Double_t* adc_c;
318 // Double_t* offset;
319 // Double_t* ped;
320 // Double_t* gain;
321 // } fDataDest[NDEST]; // Lookup table for decoder
322
323 // Inforamtion for each plane
324 // struct NoTrkPlaneInfo {
325 // Bool_t goodplanetime;
326 // NoTrkPlaneInfo () : goodplanetime(kFALSE) {}
327 // };
328 // std::vector<NoTrkPlaneInfo> fNoTrkPlaneInfo;
329
330 // Inforamtion for each plane
331 // struct NoTrkHitInfo {
332 // Bool_t goodtwotimes;
333 // Bool_t goodscintime;
334 // NoTrkHitInfo () : goodtwotimes(kFALSE) {}
335 // };
336 // std::vector<NoTrkHitInfo> fNoTrkHitInfo;
337
338
339 // Used in TOF calculation (FineProcess) to hold information about hits
340 // within a given plane
361 std::vector<TOFPInfo> fTOFPInfo;
362
363 // Used to hold information about all hits within the hodoscope for the TOF
378 std::vector<TOFCalc> fTOFCalc;
379 // This doesn't work because we clear this structure each track
380 // Do we need an vector of vectors of structures?
381 // Start with a separate vector of vectors for now.
382 std::vector<std::vector<Double_t> > fdEdX; // Vector over track #
383 std::vector<Int_t > fNScinHit; // # scins hit for the track
384 std::vector<std::vector<Int_t> > fScinHitPaddle; // Vector over hits in a plane #
385 std::vector<Int_t > fNClust; // # scins clusters for the plane
386 std::vector<std::vector<Int_t> > fClustSize; // # scin cluster size
387 std::vector<std::vector<Double_t> > fClustPos; // # scin cluster position
388 std::vector<Int_t > fNCluster; // # scins clusters for the plane
389 std::vector<std::vector<Int_t> > fClusterSize; // # scin cluster size
390 std::vector<std::vector<Double_t> > fClusterXPos; // # scin cluster position
391 std::vector<std::vector<Double_t> > fClusterYPos; // # scin cluster position
392 std::vector<Int_t > fThreeScin; // # scins three clusters for the plane
393 std::vector<Int_t > fGoodScinHitsX; // # hits in fid x range
394 // Could combine the above into a structure
395
404 std::vector<std::vector<std::vector<GoodFlags> > > fGoodFlags;
405 //
406
407 void DeleteArrays();
408 virtual Int_t ReadDatabase( const TDatime& date );
409 virtual Int_t DefineVariables( EMode mode = kDefine );
410 enum ESide { kLeft = 0, kRight = 1 };
411
412 virtual Double_t TimeWalkCorrection(const Int_t& paddle,
413 const ESide side);
414 void Setup(const char* name, const char* description);
415
416 ClassDef(THcHodoscope,0) // Hodoscope detector
417};
418
420
421#endif
int Int_t
unsigned int UInt_t
bool Bool_t
const Bool_t kFALSE
double Double_t
const Bool_t kTRUE
const char Option_t
Class for gas Cherenkov detectors.
Builds a Hall C ENGx1INE style list of raw hits from raw data.
Definition THcHitList.h:27
Class representing a single hit for the Hodoscopes.
Definition THcHodoHit.h:16
Generic hodoscope consisting of multiple planes with multiple paddles with phototubes on both ends.
std::vector< std::vector< Int_t > > fClustSize
Double_t * fHodoPosInvAdcAdc
Double_t * fHodoPos_c1
Double_t GetStartTime() const
Double_t * fHodoNegTimeOffset
Double_t * fHodoNeg_c1
Double_t fOffsetTime
Double_t * fPlaneCenter
std::vector< std::vector< Int_t > > fScinHitPaddle
Double_t * fHodoCableFit
Double_t GetHodoNegInvAdcOffset(Int_t iii) const
Double_t fTimeHist_StartTime_Hits
Int_t * fxHiScin
Double_t GetStartTimeSlop() const
Double_t fTimeHist_FpTime_NumPeaks
friend class THaScCalib
Int_t fdebugprintscinraw
std::vector< std::vector< Double_t > > fClusterYPos
Double_t * fHodoSigmaNeg
THcScintillatorPlane ** fPlanes
Double_t fTOFCalib_beta_lo
Double_t fTdc_Thrs
Double_t GetBeta() const
Double_t GetTDCThrs() const
Double_t * fHodoPosPhcCoeff
void CalcCluster(void)
virtual Int_t ReadDatabase(const TDatime &date)
Double_t trackeff_scint_ydiff_max
Double_t * fHodoPosMinPh
Double_t GetHodoPosMinPh(Int_t iii) const
void EstimateFocalPlaneTime(void)
Double_t * fHodoPosAdcTimeWindowMin
Int_t fNumPlanesBetaCalc
Double_t fScinTdcToTime
Double_t GetHodoPos_c2(Int_t iii) const
Double_t * fHodoNegAdcTimeWindowMin
Double_t * fFPTime
virtual Int_t End(THaRunBase *run=0)
Double_t * fHodoSlop
THcScintillatorPlane * GetPlane(Int_t ip)
Double_t fScin2XdZpos
Double_t fFPTimeAll
Double_t fScinTdcMin
Double_t GetHodoPosAdcTimeWindowMin(Int_t iii) const
Double_t GetHodoPosPhcCoeff(Int_t iii) const
Double_t * fHodoPosTimeOffset
Double_t fTimeHist_FpTime_Peak
Double_t GetTdcMin() const
Double_t GetHodoPosAdcTimeWindowMax(Int_t iii) const
Double_t GetHodoPosInvAdcOffset(Int_t iii) const
Int_t GetNTracks() const
Int_t * fHodoNegPedLimit
string fTOFDumpFile
Double_t fBeta
std::vector< Int_t > fThreeScin
Double_t GetHodoPosInvAdcLinear(Int_t iii) const
Double_t * fHodoNegInvAdcLinear
Double_t fScinTdcMax
Bool_t * fGoodPlaneTime
Double_t DetermineTimePeak(Int_t FillFlag)
Double_t * fHodoPosAdcTimeWindowMax
Double_t fBetaNoTrk
Bool_t fGoodEventTOFCalib
Double_t GetHodoNeg_c2(Int_t iii) const
Int_t * fHodoPosPedLimit
Double_t GetHodoLCoeff(Int_t iii) const
virtual EStatus Init(const TDatime &run_time)
Double_t fTofTolerance
Int_t GetGoodRawPad(Int_t iii)
Double_t * fHodoNegPhcCoeff
std::vector< TOFPInfo > fTOFPInfo
Double_t * fHodoNegSigma
Double_t GetHodoNegSigma(Int_t iii) const
Int_t GetTotHits()
Double_t fTOFCalib_beta_hi
Int_t * fNPlaneTime
Double_t GetHodoVelLight(Int_t iii) const
Double_t fTimeHist_StartTime_NumPeaks
Double_t GetHodoNegAdcTimeWindowMax(Int_t iii) const
UInt_t fTotHodScin
virtual Int_t Decode(const THaEvData &)
Double_t GetHodoPosInvAdcAdc(Int_t iii) const
virtual ~THcHodoscope()
Int_t fTDC_RefTimeCut
Double_t GetHodoPos_c1(Int_t iii) const
Double_t * fHodoPos_c2
UInt_t * fNPaddle
Double_t GetHodoNeg_c1(Int_t iii) const
Bool_t IsStartTimeGood() const
Double_t GetHodoNegMinPh(Int_t iii) const
char ** fPlaneNames
Double_t fNormETot
Double_t GetAdcTdcOffset(Int_t ip) const
TClonesArray * fTrackProj
Double_t GetPlaneCenter(Int_t ip)
Int_t * fyLoScin
Double_t fTimeHist_FpTime_Hits
Int_t GetNfptimes() const
THcCherenkov * fCherenkov
std::vector< std::vector< std::vector< GoodFlags > > > fGoodFlags
Double_t fTOFCalib_shtrk_hi
Bool_t * fPresentP
Int_t fADC_RefTimeCut
std::vector< Int_t > fNCluster
Double_t fBetaNoTrkChiSq
Double_t * fHodoNegMinPh
void OriginalTrackEffTest(void)
Int_t * fyHiScin
Double_t fChi2Min
ofstream fDumpOut
std::vector< Int_t > fNScinHit
Int_t fGoodScinHits
Double_t GetHodoVelFit(Int_t iii) const
virtual Int_t DefineVariables(EMode mode=kDefine)
Int_t * fxLoScin
Int_t fTrackBetaIncludeSinglePmtHits
std::vector< Int_t > fGoodScinHitsX
Double_t fTimeHist_StartTime_Sigma
Int_t * fNScinHits
Double_t * fHodoNegInvAdcAdc
Double_t * fHodoPosInvAdcLinear
Double_t fScin2YZpos
UInt_t GetNPaddles(Int_t ip)
Double_t fStartTimeCenter
Double_t * fHodoVelLight
std::vector< Int_t > fNClust
Double_t GetTdcMax() const
Double_t * fHodoNegAdcTimeWindowMax
Double_t fTOFCalib_shtrk_lo
Double_t fPathLengthCentral
Double_t GetHodoNegInvAdcLinear(Int_t iii) const
Int_t fTrackEffTestNScinPlanes
Double_t GetStartTimeCenter() const
Int_t GetScinIndex(Int_t nPlane, Int_t nPaddle)
Double_t GetHodoNegAdcTimeWindowMin(Int_t iii) const
Double_t GetHodoSlop(Int_t ip)
Double_t fTOFCalib_cer_lo
Double_t fTimeHist_StartTime_Peak
Int_t GetGoodRawPlane(Int_t iii)
Int_t fAnalyzePedestals
Double_t * fSumPlaneTime
Double_t fNCerNPE
UInt_t fMaxHodoScin
std::vector< std::vector< Double_t > > fdEdX
Double_t * fHodoPosInvAdcOffset
virtual Double_t TimeWalkCorrection(const Int_t &paddle, const ESide side)
UInt_t fMaxScinPerPlane
Double_t fRatio_xpfp_to_xfp
Double_t GetHodoPosSigma(Int_t iii) const
virtual Int_t CoarseProcess(TClonesArray &tracks)
std::vector< std::vector< Double_t > > fClusterXPos
Double_t GetHodoNegTimeOffset(Int_t iii) const
Double_t * fHodoNeg_c2
Double_t GetHodoNegInvAdcAdc(Int_t iii) const
Double_t fStartTimeSlop
Double_t * fHodoSigmaPos
std::vector< TOFCalc > fTOFCalc
Double_t GetTdcToTime() const
Int_t fTofUsingInvAdc
Bool_t GetFlags(Int_t itrack, Int_t iplane, Int_t ihit, Bool_t &onTrack, Bool_t &goodScinTime, Bool_t &goodTdcNeg, Bool_t &goodTdcPos) const
const TClonesArray * GetTrackHits() const
Double_t * fHodoNegInvAdcOffset
virtual void Clear(Option_t *opt="")
Double_t * fPlaneSpacing
Double_t * fHodoPosSigma
Double_t fStartTime
virtual Int_t ApplyCorrections(void)
Double_t fTimeHist_FpTime_Sigma
Double_t fBetaNominal
Double_t GetHodoCableFit(Int_t iii) const
Int_t GetNScinHits(Int_t iii)
Bool_t fGoodStartTime
Int_t GetNPlanes()
Double_t GetPathLengthCentral()
Double_t GetHodoPosTimeOffset(Int_t iii) const
Double_t GetPlaneSpacing(Int_t ip)
Double_t fScin2YdZpos
std::vector< std::vector< Int_t > > fClusterSize
Double_t GetTofTolerance() const
Double_t fScin2XZpos
Double_t * fHodoVelFit
Double_t * fHodo_LCoeff
virtual Int_t FineProcess(TClonesArray &tracks)
Double_t * fAdcTdcOffset
Int_t * fTdcOffset
Double_t fPartMass
Double_t fADCStartTime
Double_t GetOffsetTime() const
Double_t GetHodoNegPhcCoeff(Int_t iii) const
void TrackEffTest(void)
Double_t trackeff_scint_xdiff_max
std::vector< std::vector< Double_t > > fClustPos
Double_t GetBetaNotrk() const
Int_t GetTdcOffset(Int_t ip) const
Double_t GetBetaNominal() const
A single plane of scintillators.
Int_t GetLast() const override
TArc a
void tracks()