BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
BmnMwpcHitFinder.h
Go to the documentation of this file.
1// Author: Vasilisa Lenivenko <vasilisa@jinr.ru> 2018-07-18
2
3////////////////////////////////////////////////////////////////////////////////
4// //
5// BmnMwpcHitFinder //
6// //
7// Implementation of an algorithm developed by //
8// Vasilisa Lenivenko and Vladimir Palchik //
9// to the BmnRoot software //
10// //
11// The algorithm serves for searching for hits //
12// in the Multi Wire Prop. Chambers of the BM@N experiment //
13// //
14////////////////////////////////////////////////////////////////////////////////
15
16#ifndef BMNMWPCHITFINDER_H
17#define BMNMWPCHITFINDER_H
18
19#include "BmnMwpcDigit.h"
20#include "BmnMwpcGeometrySRC.h"
21#include "BmnMwpcHit.h"
22#include "BmnMwpcTrack.h"
23#include "BmnTrack.h"
24#include "FairTask.h"
25#include "TH1D.h"
26#include "TH2D.h"
27#include "TList.h"
28
29#include <BmnEventQuality.h>
30#include <TClonesArray.h>
31#include <TMath.h>
32#include <TString.h>
33#include <TVector3.h>
34#include <algorithm>
35#include <map>
36#include <vector>
37using namespace std;
38
39class BmnMwpcHitFinder : public FairTask
40{
41 public:
42 /** Default constructor **/
44 /** Constructor to be used **/
46 /** Destructor **/
48
49 /** Virtual method Init **/
50 virtual InitStatus Init();
51 /** Virtual method Exec **/
52 virtual void Exec(Option_t* opt);
53 /** Virtual method Finish **/
54 virtual void Finish();
55
56 struct MC_points
57 {
58 Int_t Id = -1; // Id
59 Int_t Pdg = -999; // Id
60 Int_t Np2 = 0;
61 Int_t Np3 = 0;
62 Bool_t xWas2 = 0;
63 Bool_t uWas2 = 0;
64 Bool_t vWas2 = 0;
65 Bool_t xWas3 = 0;
66 Bool_t uWas3 = 0;
67 Bool_t vWas3 = 0;
68
69 Double_t param2[4] = {999., 999., 999., 999.};
70 Double_t param3[4] = {999., 999., 999., 999.};
71
72 Double_t x2[6] = {-999., -999., -999., -999., -999., -999.};
73 Double_t y2[6] = {-999., -999., -999., -999., -999., -999.};
74 Double_t z2[6] = {-999., -999., -999., -999., -999., -999.};
75 Double_t x3[6] = {-999., -999., -999., -999., -999., -999.};
76 Double_t y3[6] = {-999., -999., -999., -999., -999., -999.};
77 Double_t z3[6] = {-999., -999., -999., -999., -999., -999.};
78 Double_t xt = -999.;
79 Double_t yt = -999.;
80 };
81
82 private:
84 Bool_t fDebug = 0;
85 Bool_t fDoTest = 0;
86 UInt_t fEventNo; // event counter
87
88 TString fInputBranchName;
89 TString fOutputBranchName;
91
92 /** Input array of MWPC digits **/
93 TClonesArray* fBmnMwpcDigitArray; //!
94 TClonesArray* fBmnHitsArray; //!
95 /** Output array of MWPC hits **/
96 TClonesArray* fBmnMwpcSegmentsArray; //!
97 TClonesArray* fBmnMwpcEventHeader; //!
98
99 TString fOutputFileName;
100
101 Int_t nInputDigits; // max. number of found digits per plane
103
104 BmnMwpcGeometrySRC* fMwpcGeometrySRC;
105
106 TList fList;
107
113 Int_t kBig;
114 TVector3* ChCent;
115 Float_t* Zmid;
116 Float_t* ChZ;
120
121 TH2D *hYvsX_mc_ch2, *hYvsX_mc_ch3; //!
122
130
140
141 vector<MC_points> vec_points;
142
143 // Arrays
144 Int_t* Nseg_Ch; //!
145 Int_t* counter_pl; //!
146 Int_t* Nbest_Ch; //!
147 Int_t* ipl; //!
148 Int_t* Nlay_w_wires; //!
149 Float_t* sigm2; //!
150 Float_t* z2; //!
151 Float_t** shift; //!
152 Float_t** kZ_loc; //!
153 Float_t** z_gl; //!
154 Int_t** kPln; //!
155 Int_t** iw; //!
156 Int_t** iw_Ch; //!
157 Int_t** Nhits_Ch; //!
158 Int_t** Beam_wires_min; //!
159 Int_t** Beam_wires_max; //!
160 Float_t** XVU; //!
161 Float_t** XVU_cl; //!
162 Int_t** ind_best_Ch; //!
163 Int_t** best_Ch_gl; //!
164 Double_t** Chi2_ndf_Ch; //!
166 Int_t*** wire_Ch; //!
167 Float_t*** xuv_Ch; //!
168 Int_t*** Wires_Ch; //!
169 Int_t*** clust_Ch; //!
170 Float_t*** XVU_Ch; //!
171 Double_t*** par_ab_Ch; //!
172 Double_t*** Coord_xuv; //!
173 Double_t*** XVU_coord; //!
174 Double_t*** Coord_wire; //!
175
176 Int_t* Nbest_seg; //!
177 Int_t** Nclust; //!
178 Int_t** Nhits_seg; //!
179 Int_t*** ClusterSize; //!
180 Double_t*** DigitsArray; //!
182 Double_t*** Coor_seg; //!
183 Double_t*** Cluster_seg; //!
184 Double_t*** par_ab_seg; //!
185 Double_t**** sigma2_seg; //!
186 Double_t*** Cluster_coord; //!
187 Int_t** Fired_layer; //!
188
189 Double_t** matrA; //!
190 Double_t** matrb; //!
191 Double_t** Amatr; //!
192 Double_t** bmatr; //!
193 const int kMaxMC = 100;
195
196 // functions for Vasilisa method:
198 void ReadWires(Double_t***, Int_t**, vector<MC_points>&);
202 Int_t**,
203 Double_t***,
204 Int_t***,
205 Int_t*,
206 Double_t***,
207 Double_t***,
208 Int_t**,
209 Int_t,
210 Short_t,
211 Int_t);
213 Int_t**,
214 Double_t***,
215 Int_t***,
216 Int_t*,
217 Double_t***,
218 Double_t***,
219 Int_t**,
220 Int_t,
221 Short_t,
222 Int_t,
223 Int_t*,
224 Double_t***);
226 Int_t*,
227 Double_t***,
228 Double_t***,
229 Int_t**,
230 Float_t**,
231 Int_t,
232 Double_t,
233 Double_t,
234 Int_t**,
235 Double_t**,
236 Double_t***,
237 Double_t***,
238 Double_t***,
239 Int_t*,
240 Int_t*,
241 Double_t****);
243 Int_t*,
244 Double_t***,
245 Double_t***,
246 Int_t**,
247 Float_t**,
248 Int_t,
249 Double_t,
250 Double_t,
251 Int_t**,
252 Double_t**,
253 Double_t***,
254 Double_t***,
255 Double_t***,
256 Int_t*,
257 Int_t*,
258 Double_t****);
263 void MCefficiencyCalculation(Int_t, vector<MC_points>&, Double_t***, Int_t*);
265
266 const Int_t PDG_Li7 = 1000030070; // Li7
267 const Int_t PDG_He4 = 1000020040; // He4
268
271
273};
274
275#endif
bool Bool_t
int Int_t
unsigned int UInt_t
float Float_t
short Short_t
double Double_t
const char Option_t
#define ClassDef(name, id)
vector< TH1D * > hBy_mc_ch
vector< TH1D * > hWiresUp
Double_t *** Cluster_coord
vector< TH1D * > hAx_mc_ch
Double_t *** par_ab_seg
Double_t *** Coord_wire
TClonesArray * fBmnEvQuality
void PrepareArraysToProcessEvent()
Double_t *** XVU_coord
vector< TH2D * > hY_X_Ch
TClonesArray * fBmnMwpcSegmentsArray
Output array of MWPC hits.
vector< TH1D * > hWiresVm
vector< TH1D * > hoccupancyUm
vector< TH1D * > hdY_mc_SegCh
vector< TH1D * > hAy_mc_ch
vector< TH1D * > hWiresXp
vector< TH1D * > hResiduals_pl5_Ch
TString fBmnEvQualityBranchName
vector< TH1D * > hWiresVp
vector< TH1D * > hBx_mc_ch
void Clustering(Int_t, Int_t ***, Double_t ***, Double_t ***, Double_t ***, Int_t **, Int_t *)
vector< TH1D * > hdAy_mc_Seg_deltaCh
vector< TH1D * > hResiduals_pl3_Ch
BmnMwpcGeometrySRC * fMwpcGeometrySRC
vector< TH1D * > hoccupancyVm
void SegmentFinder2coord(Int_t, Int_t **, Double_t ***, Int_t ***, Int_t *, Double_t ***, Double_t ***, Int_t **, Int_t, Short_t, Int_t, Int_t *, Double_t ***)
virtual void Finish()
Virtual method Finish.
vector< TH1D * > hResiduals_pl1_Ch
Double_t *** Coord_xuv
Double_t *** par_ab_Ch
TClonesArray * fBmnHitsArray
vector< TH1D * > hResiduals_pl2_Ch
vector< TH1D * > hChisq_ndf_Ch
Double_t *** Coor_seg
vector< TH1D * > hdAx_mc_SegCh
void ProcessSegments2coord(Int_t, Int_t *, Double_t ***, Double_t ***, Int_t **, Float_t **, Int_t, Double_t, Double_t, Int_t **, Double_t **, Double_t ***, Double_t ***, Double_t ***, Int_t *, Int_t *, Double_t ****)
Double_t ** Chi2_ndf_Ch
vector< TH1D * > hdX_mc_SegCh
vector< TH2D * > htime_wire_Ch
BmnMwpcHitFinder()
Default constructor.
vector< TH1D * > hx_target_best
virtual void Exec(Option_t *opt)
Virtual method Exec.
Double_t *** DigitsArray
virtual InitStatus Init()
Virtual method Init.
vector< TH1D * > hy_target_best
vector< TH1D * > hdY_mc_Seg_deltaCh
vector< TH1D * > hdAx_mc_Seg_deltaCh
vector< TH1D * > hNum_layers_out_beam_Ch
vector< TH1D * > hResiduals_pl4_Ch
void ReadWires(Double_t ***, Int_t **, vector< MC_points > &)
void ProcessSegments(Int_t, Int_t *, Double_t ***, Double_t ***, Int_t **, Float_t **, Int_t, Double_t, Double_t, Int_t **, Double_t **, Double_t ***, Double_t ***, Double_t ***, Int_t *, Int_t *, Double_t ****)
vector< TH1D * > hpar_Bx_Ch
vector< TH1D * > hfiredWire_Ch
virtual ~BmnMwpcHitFinder()
Destructor.
vector< TH1D * > hNp_best_Ch
void SegmentParamAlignment(Int_t, Int_t *, Double_t ***, Float_t **)
void FillFitMatrix(Int_t, Double_t **, Float_t **, Double_t *, Int_t *)
BmnMwpcHitFinder(Bool_t, Int_t, Int_t)
Constructor to be used.
void FillFreeCoefVector(Int_t, Double_t *, Double_t ***, Int_t, Float_t **, Double_t *, Int_t *)
vector< TH1D * > hResiduals_pl0_Ch
vector< MC_points > vec_points
void SegmentsStoring(Int_t *, Double_t ***, Double_t **, Int_t **, Double_t ***, Double_t ***, Double_t ****)
vector< TH2D * > hEvent_display_Ch
TString fBmnEventHeaderBranchName
vector< TH1D * > hoccupancyVp
TClonesArray * fBmnMwpcEventHeader
vector< TH1D * > hoccupancyUp
Double_t ** Chi2_ndf_best_Ch
void InverseMatrix(Double_t **, Double_t **)
vector< TH1D * > hNbest_Ch
vector< TH1D * > hClusterSize
vector< TH1D * > hdAy_mc_SegCh
vector< TH1D * > hOccupancy
vector< TH1D * > hfired_wire_Ch
TClonesArray * fBmnMwpcDigitArray
Input array of MWPC digits.
vector< TH1D * > hpar_By_Ch
Double_t **** sigma2_seg
vector< TH1D * > hpar_Ax_Ch
vector< TH1D * > hWiresUm
vector< TH1D * > hpar_Ay_Ch
vector< TH1D * > hWiresXm
void MCefficiencyCalculation(Int_t, vector< MC_points > &, Double_t ***, Int_t *)
vector< TH1D * > hoccupancyXm
void SegmentFinder(Int_t, Int_t **, Double_t ***, Int_t ***, Int_t *, Double_t ***, Double_t ***, Int_t **, Int_t, Short_t, Int_t)
Double_t *** Cluster_seg
vector< TH1D * > hNFired_layers_Ch
vector< TH1D * > hoccupancyXp
vector< TH1D * > hTime
vector< TH1D * > hdX_mc_Seg_deltaCh
void FillFreeCoefVectorXUV(Int_t, Double_t *, Float_t **, Float_t **, Float_t *, Int_t *)
Double_t ** Chi2_ndf_seg
Definition json.hpp:4446