BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
BmnUpstreamTracking.h
Go to the documentation of this file.
1// Author: Vasilisa Lenivenko (VBLHEP) <vasilisa@jinr.ru> 2019-07-18
2
3////////////////////////////////////////////////////////////////////////////////
4// //
5// BmnUpstreamTracking //
6// //
7// Implementation of an algorithm developed by //
8// V.Lenivenko and V.Paltchik //
9// to the BmnRoot software //
10// //
11// The algorithm serves for searching for tracks //
12// in the Silicon detectors & MWPCs //
13// of the configuration SRC of BM@N experiment //
14// //
15////////////////////////////////////////////////////////////////////////////////
16
17#ifndef BMNUPSTREAMTRACKING_H
18#define BMNUPSTREAMTRACKING_H 1
19
20#include "BmnMwpcHit.h"
21#include "BmnMwpcSegment.h"
22#include "BmnMwpcTrack.h"
23#include "BmnSiliconHit.h"
24#include "BmnSiliconTrackFinder.h"
25#include "BmnTrack.h"
26#include "FairMCPoint.h"
27#include "FairTask.h"
28#include "FairTrackParam.h"
29#include "TH1D.h"
30#include "TH2D.h"
31#include "TList.h"
32
33#include <TClonesArray.h>
34#include <TMath.h>
35#include <TString.h>
36#include <TVector2.h>
37#include <fstream>
38#include <vector>
39using namespace std;
40using namespace TMath;
41
42struct Smatch
43{
44 Int_t Ind1 = -1; // Si
45 Int_t Ind2 = -1; // Pctr
46 Int_t Inds2 = -1; // seg2
47 Int_t Inds3 = -1; // seg3
50 Double_t Z1 = -999.;
51 Double_t Z2 = -999.;
52 Double_t Zs2 = -999.;
53 Double_t Zs3 = -999.;
57 Double_t param1[4] = {999., 999., 999., 999.};
58 Double_t param2[4] = {999., 999., 999., 999.};
59 Double_t params2[4] = {999., 999., 999., 999.};
60 Double_t params3[4] = {999., 999., 999., 999.};
61 // Silicon
62 Double_t SiCoordX[4] = {-999., -999., -999., -999.};
63 Double_t SiCoordY[4] = {-999., -999., -999., -999.};
64 Double_t SiCoordZ[4] = {-999., -999., -999., -999.};
65 Double_t SiSigmaX[4] = {-999., -999., -999., -999.};
66 Double_t SiSigmaY[4] = {-999., -999., -999., -999.};
67 Double_t SiMod[4] = {-999., -999., -999., -999.};
68};
69
71{
72 Double_t param[4] = {999., 999., 999., 999.};
73 Double_t CoordX[5] = {-999., -999., -999., -999., -999.};
74 Double_t CoordY[5] = {-999., -999., -999., -999., -999.};
75 Double_t CoordZ[5] = {-999., -999., -999., -999., -999.};
76 Double_t Chi2 = 999.;
78 Int_t Pdg = -1;
79};
80
82{
83 public:
86 virtual ~BmnUpstreamTracking();
87
88 virtual InitStatus Init();
89 virtual void Exec(Option_t* opt);
90 virtual void Finish();
91
92 static bool compareSegments(const Smatch& a, const Smatch& b) { return a.Chi2m < b.Chi2m; }
93
94 struct MC_points
95 {
96 Int_t Id = -1; //
97 Int_t Pdg = -1; //
103
111
112 Double_t param[4] = {999., 999., 999., 999.};
113 Double_t x_si[4] = {-999., -999., -999., -999.};
114 Double_t y_si[4] = {-999., -999., -999., -999.};
115 Double_t z_si[4] = {-999., -999., -999., -999.};
116 };
118 {
119 Double_t track1[5] = {-999., -999., -999., -999., -999.}; // Ax, x, Ay, Y
121 Double_t track2[5] = {-999., -999., -999., -999., -999.}; // Ax, x, Ay, Y
123 };
124
125 private:
127 UInt_t fEventNo = 0; // event counter
139 //--mc--
144
145 /** Output array of Silicon Hits **/
149 //--------
180
181 vector<Smatch> vtmpSeg;
182 vector<Smatch> OutVector;
183 vector<UpTracks> vecUpTracks;
184 vector<MC_points> vec_points;
185 vector<twotracks> vec_twotracks;
186 //--------
188 void ReadSiliconTracks(Double_t**, Double_t*, Int_t&, vector<MC_points>&);
189 void ReadSiliconHits(Double_t***, Int_t*);
190 void ReadMWPCSegments(Double_t***, Double_t**, Int_t*, vector<MC_points>&);
193 Double_t*,
194 Int_t&,
195 Double_t***,
196 Double_t**,
197 Int_t*,
198 vector<Smatch>&,
199 vector<Smatch>&);
201 Double_t*,
202 Int_t&,
203 Double_t***,
204 Double_t**,
205 Int_t*,
206 vector<Smatch>&,
207 vector<Smatch>&);
208 void RecordingBest(Int_t&, vector<Smatch>&, vector<Smatch>&);
210 Int_t&,
211 Int_t&,
212 Double_t**,
213 Double_t***,
214 Double_t*,
215 Double_t**,
216 Double_t&,
217 Double_t&,
218 vector<Smatch>&);
219 void GetAddSiHits(vector<Smatch>&, Double_t***, Int_t*);
220 void GetHitsToPoints(vector<Smatch>&, Double_t***, Int_t*, Double_t***, Int_t*, Double_t***, Int_t&);
221 void GlobalFit(Double_t**, Double_t**, Double_t*);
223 void CalculationOfChi2(Double_t***, Int_t&, vector<UpTracks>&);
224 void PrintAllTracks(vector<UpTracks>&);
225 void TrackRecording(vector<UpTracks>&);
226 void MCefficiencyCalculation(vector<MC_points>&, vector<UpTracks>&);
227
228 //--------
229 const Int_t kBig = 200;
230 const Int_t kPoints = 5; // kNumDets
231 const Int_t kPoin_Par = 5; // parameters
232 const Int_t kNumPars = 10; // parameters
233 const Int_t kNumPairs = 2; // number of MWPC pairs
234 const Int_t kNumChambers = 4; // number of MWPC stat
235 const Int_t kNumStSi = 4; // number of Si stat
236 const Int_t kMaxMC = 100;
237 const Int_t fNstations = 4;
238 const Int_t kNPlanes = 6;
239 const Double_t kChi2_Max = 50.;
240 const Double_t dw = 0.25; // [cm]//MWPC wire step
241 const Double_t SigmXmwpc = sqrt(2) * dw / 6.; // dw/6.;//dw / sq12;
242 const Double_t SigmYmwpc = sqrt(2) * dw / 3.; // dw/3.
243 // matching consts
244 const Double_t cutAx = 0.02; // 0.012;
245 const Double_t cutAy = 0.02; // 0.015;
246 const Double_t cutX = 1.5; // cm
247 const Double_t cutY = 2.0; // cm
248 // important Z
249 const Double_t Zcentr = -350.; // cm
250 const Double_t kZ_target = -645.191; // cm
251 const Double_t kZSi_cent = -392.5;
252 // MC
253 const Int_t PDG_Be7 = 1000040070; // Be7
254 const Int_t PDG_Li6 = 1000030060; // Li6
255 const Int_t PDG_Li7 = 1000030070; // Li7
256 const Int_t PDG_He3 = 1000020030; // He3
257 const Int_t PDG_He4 = 1000020040; // He4
258 const Int_t PDG_H2 = 1000010020; // H2
259 const Int_t PDG_p = 2212; // proton
260
261 // some hists
267 vector<TH1D*> hResXst, hResYst;
268
270};
271
272#endif
bool Bool_t
int Int_t
double Double_t
const char Option_t
#define ClassDef(name, id)
vector< UpTracks > vecUpTracks
void PCTracksSiTracksMatching(Double_t **, Double_t *, Int_t &, Double_t ***, Double_t **, Int_t *, vector< Smatch > &, vector< Smatch > &)
vector< Smatch > OutVector
void RecordCandidateSeg(Int_t &, Int_t &, Int_t &, Double_t **, Double_t ***, Double_t *, Double_t **, Double_t &, Double_t &, vector< Smatch > &)
bool InvertMatrix(Double_t *, Double_t *)
void RecordingBest(Int_t &, vector< Smatch > &, vector< Smatch > &)
void PrintAllTracks(vector< UpTracks > &)
vector< MC_points > vec_points
void PCSegmentsSiTracksMatching(Double_t **, Double_t *, Int_t &, Double_t ***, Double_t **, Int_t *, vector< Smatch > &, vector< Smatch > &)
void GetHitsToPoints(vector< Smatch > &, Double_t ***, Int_t *, Double_t ***, Int_t *, Double_t ***, Int_t &)
vector< twotracks > vec_twotracks
void ReadSiliconTracks(Double_t **, Double_t *, Int_t &, vector< MC_points > &)
void ReadMWPCSegments(Double_t ***, Double_t **, Int_t *, vector< MC_points > &)
void ReadSiliconHits(Double_t ***, Int_t *)
static bool compareSegments(const Smatch &a, const Smatch &b)
virtual void Exec(Option_t *opt)
virtual InitStatus Init()
void ReadMWPCTracks(Double_t ***, Double_t **, Int_t *)
void MCefficiencyCalculation(vector< MC_points > &, vector< UpTracks > &)
void GlobalFit(Double_t **, Double_t **, Double_t *)
TClonesArray * fBmnUpstreamTracksArray
Output array of Silicon Hits.
void GetAddSiHits(vector< Smatch > &, Double_t ***, Int_t *)
void TrackRecording(vector< UpTracks > &)
void CalculationOfChi2(Double_t ***, Int_t &, vector< UpTracks > &)
RVec< PromoteType< T > > sqrt(const RVec< T > &v)
Definition json.hpp:4446
Double_t SiMod[4]
Double_t params3[4]
Double_t SiSigmaX[4]
Double_t params2[4]
Double_t param1[4]
Double_t SiCoordZ[4]
Double_t param2[4]
Double_t SiCoordX[4]
Double_t SiCoordY[4]
Double_t Chi2m
Double_t SiSigmaY[4]
Double_t distX
Double_t distY
Double_t CoordX[5]
Double_t CoordY[5]
Double_t CoordZ[5]
Double_t param[4]