CbmRoot
Loading...
Searching...
No Matches
CbmTofExtendTracks.h
Go to the documentation of this file.
1/* Copyright (C) 2021 PI-UHd, GSI
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Norbert Herrmann [committer] */
4
5// -------------------------------------------------------------------------
6// ----- CbmTofExtendTracks header file -----
7// ----- Created 21/12/20 by N. Herrmann -----
8// -------------------------------------------------------------------------
9
15#ifndef CBMTOFEXTENDTRACKS
16#define CBMTOFEXTENDTRACKS 1
17
18#include "FairTask.h"
19//#include "CbmTofTypes.h"
20#include "TTimeStamp.h"
21
22#include <map>
23#include <vector>
24
29class TClonesArray;
30class TFile;
31class TH1;
32class TH2;
33class TH3;
34// Geometry
37class CbmTofDigiPar;
39class CbmTofAddress;
40class CbmPixelHit;
41class CbmTofHit;
42class CbmMatch;
43class CbmEvent;
44class CbmStsHit;
45class CbmMuchPixelHit;
46class CbmRichHit;
47
48class CbmTofExtendTracks : public FairTask {
49 friend class CbmTofFindTracks;
50 friend class CbmTofTrackFinderNN;
51 friend class CbmTofAnaTestbeam;
52
53 public:
56
57
64 CbmTofExtendTracks(const char* name, const char* title = "FairTask", CbmTofTrackFinder* finder = NULL);
65
67 virtual ~CbmTofExtendTracks();
68
69 inline static CbmTofExtendTracks* Instance() { return fInstance; }
70
72 virtual InitStatus Init();
73
74 // Initialize other parameters not included in parameter classes.
75 Bool_t InitParameters();
76
78 virtual void Exec(Option_t* opt);
79 virtual void ExecExtend(Option_t* opt, CbmEvent* tEvent = NULL);
80
82 virtual void Finish();
83
85 virtual void SetParContainers();
86
87 virtual void CreateHistograms();
88
89 virtual void FindVertex();
90
91 virtual void FillHistograms(CbmEvent* tEvent = NULL);
92
93
94 virtual void Line3Dfit(std::vector<CbmPixelHit*>, CbmTofTrackletParam*);
95 Double_t GetFitX(Double_t, CbmTofTrackletParam*);
96 Double_t GetFitY(Double_t, CbmTofTrackletParam*);
97 Double_t GetFitT(Double_t, CbmTofTrackletParam*);
98
99 virtual void TrkAddStation(Int_t iStation);
100
103
104 inline void SetTrkHitsMin(Int_t i) { fiTrkHitsMin = i; };
105 inline void SetCutDX(Double_t val) { fdTrkCutDX = val; };
106 inline void SetCutDY(Double_t val) { fdTrkCutDY = val; };
107 inline void SetCutDT(Double_t val) { fdTrkCutDT = val; };
108 inline void SetChi2Max(Double_t val) { fdChi2Max = val; };
109 inline void SetCorSrc(Int_t i) { fiCorSrc = i; };
110 inline void SetCorMode(Int_t i) { fiCorMode = i; };
111 inline void SetAddStations(Int_t i) { fiAddStations = i; };
112 inline void SetReqStations(Int_t i) { fiReqStations = i; };
113 inline void SetStationUT(Int_t i) { fiStationUT = i; };
114 inline void SetCutStationMaxHitMul(Int_t i) { fiCutStationMaxHitMul = i; };
115 inline void SetNTrkTofMax(Int_t i) { fiNTrkTofMax = i; };
116
117 inline void SetCalParFileName(TString CalParFileName) { fCalParFileName = CalParFileName; }
118 inline void SetCalOutFileName(TString CalOutFileName) { fCalOutFileName = CalOutFileName; }
119
121 void UseFinder(CbmTofTrackFinder* finder) { fFinder = finder; };
122
123 inline Double_t GetVertexT() const { return fVTX_T; }
124 inline Double_t GetVertexX() const { return fVTX_X; }
125 inline Double_t GetVertexY() const { return fVTX_Y; }
126 inline Double_t GetVertexZ() const { return fVTX_Z; }
127
128 private:
130 CbmTofTrackFinder* fFinder; // Pointer to TrackFinder concrete class
131 CbmTofTrackletTools* fTrackletTools; // Pointer to Tracklet tools class
132 CbmTofCalibrator* fTofCalibrator; // Pointer to Calibrator
133 TClonesArray* fEventsColl; // CBMEvents (time based)
134 TClonesArray* fTofHitArrayIn; // Input array of TOF hits
135 TClonesArray* fStsHitArrayIn; // Input array of TOF hits
136 TClonesArray* fMuchHitArrayIn; // Input array of TOF hits
137 TClonesArray* fRichHitArrayIn; // Input array of TOF hits
138 TClonesArray* fTofMatchArrayIn; // Input array of TOF hit matches
139 TClonesArray* fTofHitArray; // Output array of recalibrated TOF hits
140 TClonesArray* fTofTrackArrayIn; // Input array of CbmTofTracks
141 TClonesArray* fTrackArrayOut; // Output array of CbmTofTracks in CbmEvent mode
142 std::vector<std::vector<Int_t>> fvTofHitIndex; // Index of hit in TS
143 std::vector<Int_t> fvTofTrackIndex; // Index of track in TS
144 std::vector<std::vector<Int_t>> fvStsHitIndex; // Index of hit in TS
145 std::vector<std::vector<Int_t>> fvMuchHitIndex; // Index of hit in TS
146 std::vector<std::vector<Int_t>> fvRichHitIndex; // Index of hit in TS
147 std::vector<Double_t> fvTofStationZ; // Z position of Tof stations
148 std::vector<Double_t> fvStsStationZ; // Z position of Tof stations
149 std::vector<Double_t> fvMuchStationZ; // Z position of Tof stations
150 std::vector<Double_t> fvRichStationZ; // Z position of Tof stations
151
152 std::vector<std::vector<CbmPixelHit*>> fvAllHitPointer; // Pointer to hits in TS
153 std::vector<std::vector<CbmPixelHit*>> fvTrkCalHits;
154 std::vector<CbmTofTrackletParam*> fvTrkPar;
155
156 std::map<Int_t, Int_t> fMapStationZ;
157 std::map<Int_t, Int_t>::iterator itMapStationZ;
158
159 std::vector<Double_t> fvToff; // station correction parameter
160 std::vector<Double_t> fvXoff; // station correction parameter
161 std::vector<Double_t> fvYoff; // station correction parameter
162 std::vector<Double_t> fvZoff; // station correction parameter
163
164 std::vector<Double_t> fvTsig; // station matching parameter
165 std::vector<Double_t> fvXsig; // station matching parameter
166 std::vector<Double_t> fvYsig; // station matching parameter
167 std::vector<Double_t> fvZsig; // station matching parameter
168
171
172 // Control histograms
177
182
183 std::vector<TH2*> fhTrkStationDX;
184 std::vector<TH2*> fhTrkStationDY;
185 std::vector<TH2*> fhTrkStationDZ;
186 std::vector<TH2*> fhTrkStationDT;
187 std::vector<TH2*> fhTrkStationNHits;
188 std::vector<std::vector<TH2*>> fhTrkStationDXDY;
189
190 std::vector<TH2*> fhTrkPullDX;
191 std::vector<TH2*> fhTrkPullDY;
192 std::vector<TH2*> fhTrkPullDT;
193
198
203
204 std::vector<TH2*> fhExt_TrkSizVel;
205 std::vector<TH2*> fhExt_TrkSizChiSq;
206
210
216
217 Bool_t LoadCalParameter();
218 Bool_t WriteHistos();
219 Bool_t UpdateCalHistos();
220
221 TString fCalParFileName; // name of the file name with Calibration Parameters
223 TFile* fCalParFile; // pointer to Calibration Parameter file
224
225 Double_t fVTXNorm; // Number of Hits contributing to Vertex determination
226 Double_t fVTX_T; // measured event wise t0
227 Double_t fVTX_X; // measured event wise vertex x
228 Double_t fVTX_Y; // measured event wise vertex y
229 Double_t fVTX_Z; // measured event wise vertex z
230 Double_t fT0MAX; // range of calibration histogram
231 Int_t fiTrkHitsMin; // Min number of hits required for tracks
232 Double_t fdTrkCutDX;
233 Double_t fdTrkCutDY;
234 Double_t fdTrkCutDT;
235 Double_t fdChi2Max; // Max accepted matching chi2
236 Int_t fiCorSrc; // correction source (0 - all hits, 1 pulls)
237 Int_t fiCorMode; // correction update mode
238 Int_t fiAddStations; // extend tracks (station number *100)
239 Int_t fiReqStations; // request station for track (station number *100)
240 Int_t fiStationUT; // station under test
241 Int_t fiCutStationMaxHitMul; //max hit multiplicity for any station
242 Int_t fiNTrkTofMax; // maximum number of TofTracks per event
243 Int_t fiEvent; // Number of processed events
244 // ToF geometry variables
245
247};
248
249#endif
Class characterising one event by a collection of links (indices) to data objects,...
Definition CbmEvent.h:34
data class for a reconstructed 3-d hit in the STS
Definition CbmStsHit.h:35
CBM ToF interface class to the unique address.
contains filling and updating of calibration histos
Parameters class for the CBM ToF digitizer using beam data distributions.
CbmTofCalibrator * fTofCalibrator
CbmTofTrackFinder * GetFinder()
std::vector< Double_t > fvZsig
std::vector< Double_t > fvStsStationZ
std::vector< Double_t > fvXsig
std::vector< Double_t > fvToff
virtual void Line3Dfit(std::vector< CbmPixelHit * >, CbmTofTrackletParam *)
CbmTofExtendTracks(const CbmTofExtendTracks &)
void SetChi2Max(Double_t val)
virtual InitStatus Init()
void SetCutStationMaxHitMul(Int_t i)
std::vector< Double_t > fvMuchStationZ
std::vector< CbmTofTrackletParam * > fvTrkPar
Double_t GetVertexZ() const
std::vector< std::vector< CbmPixelHit * > > fvTrkCalHits
virtual void CreateHistograms()
virtual void TrkAddStation(Int_t iStation)
std::vector< TH2 * > fhTrkStationDY
CbmTofExtendTracks & operator=(const CbmTofExtendTracks &)
void SetReqStations(Int_t i)
virtual void ExecExtend(Option_t *opt, CbmEvent *tEvent=NULL)
std::map< Int_t, Int_t >::iterator itMapStationZ
std::vector< TH2 * > fhTrkPullDY
std::vector< TH2 * > fhTrkStationDT
std::vector< TH2 * > fhTrkPullDX
std::vector< Int_t > fvTofTrackIndex
std::vector< std::vector< TH2 * > > fhTrkStationDXDY
void SetCutDX(Double_t val)
void SetCalOutFileName(TString CalOutFileName)
virtual void FillHistograms(CbmEvent *tEvent=NULL)
std::vector< std::vector< CbmPixelHit * > > fvAllHitPointer
std::vector< std::vector< Int_t > > fvTofHitIndex
std::vector< Double_t > fvXoff
TClonesArray * fTrackArrayOut
TClonesArray * fMuchHitArrayIn
std::vector< Double_t > fvTofStationZ
void SetCutDT(Double_t val)
TClonesArray * fTofHitArrayIn
std::vector< TH2 * > fhTrkStationNHits
Double_t GetFitY(Double_t, CbmTofTrackletParam *)
CbmTofTrackFinder * fFinder
void UseFinder(CbmTofTrackFinder *finder)
void SetCutDY(Double_t val)
Double_t GetVertexX() const
std::vector< Double_t > fvTsig
TClonesArray * fTofHitArray
virtual void SetParContainers()
std::vector< Double_t > fvYsig
void SetCalParFileName(TString CalParFileName)
std::vector< TH2 * > fhTrkStationDX
std::map< Int_t, Int_t > fMapStationZ
TClonesArray * fTofTrackArrayIn
TClonesArray * fRichHitArrayIn
std::vector< TH2 * > fhTrkPullDT
Double_t GetFitT(Double_t, CbmTofTrackletParam *)
std::vector< TH2 * > fhExt_TrkSizVel
Double_t GetFitX(Double_t, CbmTofTrackletParam *)
Double_t GetVertexY() const
std::vector< std::vector< Int_t > > fvMuchHitIndex
void SetNTrkTofMax(Int_t i)
std::vector< Double_t > fvYoff
static CbmTofExtendTracks * fInstance
TClonesArray * fStsHitArrayIn
TClonesArray * fEventsColl
std::vector< Double_t > fvRichStationZ
static CbmTofExtendTracks * Instance()
std::vector< Double_t > fvZoff
CbmTofTrackletTools * fTrackletTools
std::vector< std::vector< Int_t > > fvRichHitIndex
TClonesArray * fTofMatchArrayIn
void SetAddStations(Int_t i)
std::vector< TH2 * > fhExt_TrkSizChiSq
std::vector< std::vector< Int_t > > fvStsHitIndex
void SetTrkHitsMin(Int_t i)
Double_t GetVertexT() const
std::vector< TH2 * > fhTrkStationDZ
virtual void Exec(Option_t *opt)
ClassDef(CbmTofExtendTracks, 1)
contains fits and resolution functions