BmnRoot 26.10.0-19-g6979a6c6
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
BmnEfficiencyTOF700.C
Go to the documentation of this file.
1#include <Rtypes.h>
2#include <fstream>
3R__ADD_INCLUDE_PATH($VMCWORKDIR)
4#include "base/BmnEnums.h"
5#include "macro/run/bmnloadlibs.C"
6
7#define CALRUNNAME 1
8#define CALIBFILE "bmn_run4704_digi_calibration.root"
9#define CORRECTIONFILE "bmn_argon_protonbased_time_corrections.root"
10
11// Fragments
12#define PFRMAX 2.0
13#define MFRMIN -0.3
14#define TXBEAM 0.002
15#define TYBEAM 0.005
16#define PTMIN 0.0
17#define PTMAX 1.4
18#define YLMIN 0.0
19#define YLMAX 2.0
20#define NPT 7
21#define NYL 5
22#define MPR 0.938
23#define M1 (MPR * MPR)
24#define M2 (4. * MPR * MPR)
25#define M3 (9. * MPR * MPR)
26#define M4 (16. * MPR * MPR)
27// Proton region min and max (M1 - one nucleon, Z1 - charge +1, etc)
28#define M1Z1MIN 0.5
29#define M1Z1MAX 1.4
30// D
31#define M2Z1MIN 2.4
32#define M2Z1MAX 6.0
33// T
34#define M3Z1MIN 6.0
35#define M3Z1MAX 9.5
36// He3
37#define M3Z2MIN 1.4
38#define M3Z2MAX 2.4
39// He
40#define M2Z1MIN 2.4
41#define M2Z1MAX 6.0
42
43//
44
45#define XGEMCOR 1
46#define XTOFCOR 1
47#define PUREDCH 0
48#define USEDCHXY 0
49#define USEDCHTXTY 0
50#define USEGEMTXTY 0
51
52#define TRACKS_ONLY 0
53
54#define REFIT 1
55#define REFIT_DEBUG 0
56#define DCHCOVPAR 0
57
58#define MINDCHHITS 7
59
60#if XGEMCOR != 0
61Double_t Xgemcorrection(Double_t p, Double_t* txcor, Double_t* xsigma, Double_t* ysigma);
62Bool_t GemCorInit = true;
63TH1D *hftmp = 0, *hftsp = 0, *hftmn = 0, *hftsn = 0;
64TH1D *hfmp = 0, *hfsp = 0, *hfmn = 0, *hfsn = 0;
65TH1D *hfmpy = 0, *hfspy = 0, *hfmny = 0, *hfsny = 0;
66TF1 *fmp = 0, *fsp = 0, *fmn = 0, *fsn = 0;
67TF1 *ftmp = 0, *ftsp = 0, *ftmn = 0, *ftsn = 0;
68TF1 *fmpy = 0, *fspy = 0, *fmny = 0, *fsny = 0;
69Double_t NDXsigma = 2.5;
70#else
72#endif
76
77#if XTOFCOR >= 0
78Double_t Xgemcorrectiontof700(Double_t p0, Double_t* xsigmatof700, Double_t* ysigmatof700);
82TF1 *fmptof700 = 0, *fsptof700 = 0, *fmntof700 = 0, *fsntof700 = 0;
84#endif
85#define MAX_NPAIRS 1000
89
90// Sigma DCH-TOF700
91#define SigmaX_DCH_TOF 1.2
92#define SigmaY_DCH_TOF 1.6
93
94// Sigma GEM-TOF700
95#define SigmaX_GEM_TOF 1.7
96#define SigmaY_GEM_TOF 1.4
97
98#define GEMTYPE 2
99
100// Gleb_SIGEM_v1_*.root - Gem + SILICON треки версия Глеба с damount = dx * dx / (ddxgem + ddxdch) + dy * dy / (ddygem
101// + ddydch);
102#if GEMTYPE == 0
103#define DTXDCH +0.0
104#define DTYDCH +0.0
105#define DXDCH -9.2454
106#define DYDCH +3.7912
107#define DZDCH -0.1655
108#define MINGEMNDF 4
109#define MINSIHITS 2
110#define TRACKFILE "argon_tracks_gleb_chi2_files.txt"
111
112// Gleb_SIGEM_v1_filtered_*.root - Отфильтрованный Gem + SILICON треки версия Глеба с damount = dx * dx / (ddxgem +
113// ddxdch) + dy * dy / (ddygem + ddydch);
114#elif GEMTYPE == 1
115#define DTXDCH +0.0
116#define DTYDCH +0.0
117#define DXDCH -10.2734
118#define DYDCH +3.6434
119#define DZDCH -4.26
120#define MINGEMNDF 4
121#define MINSIHITS 2
122#define TRACKFILE "argon_tracks_gleb_chi2_filter_files.txt"
123
124// Gleb_SIGEM_v2_*.root - Gem + SILICON треки версия Глеба с damount = dx * dx + dy * dy;
125#elif GEMTYPE == 2
126/*
127#define DTXDCH +0.0
128#define DTYDCH +0.0
129#define DXDCH -9.2454
130#define DYDCH +3.7912
131#define DZDCH -0.1655
132#define MINGEMNDF 6
133#define TRACKFILE "argon_tracks_gleb_files.txt"
134*/
135#define DTXDCH +0.0
136#define DTYDCH +0.0
137#define DXDCH -9.1845
138#define DYDCH +3.143
139#define DZDCH -0.1655
140#define MINGEMNDF 4
141#define MINSIHITS 2
142#define TRACKFILE "argon_tracks_lalyo_final2_without_ecal.txt"
143// #define TRACKFILE "argon_tracks_lalyo_final2.txt"
144// #define TRACKFILE "argon_tracks_lalyo_final1.txt"
145// #define TRACKFILE "argon_tracks_lalyo_final.txt"
146// #define TRACKFILE "argon_tracks_lalyo_fragments_recent.txt"
147// #define TRACKFILE "argon_tracks_lalyo_fragments_new.txt"
148// #define TRACKFILE "argon_tracks_lalyo_fragments.txt"
149// #define TRACKFILE "argon_tracks_lalyo_no_correction_with_cov_dch678_fullfull.txt"
150// #define TRACKFILE "argon_tracks_lalyo_no_correction_with_cov_dch678_full.txt"
151// #define TRACKFILE "argon_tracks_lalyo_files_Xgem_correction_with_cov_dch678_full.txt"
152// #define TRACKFILE "argon_tracks_lalyo_files_no_correction_with_cov_dch_full.txt"
153// #define TRACKFILE "argon_tracks_lalyo_files_no_correction_with_cov_dch_1.txt"
154// #define TRACKFILE "argon_tracks_lalyo_files_Xgem_TXgem_correction_new.txt"
155// #define TRACKFILE "argon_tracks_lalyo_files_Xgem_TXgem_correction.txt"
156// #define TRACKFILE "argon_tracks_lalyo_files_Xgem_correction.txt"
157// #define TRACKFILE "argon_tracks_lalyo_files_full_shiftfield_fixpv.txt"
158// #define TRACKFILE "argon_tracks_lalyo_files_full_shiftfield.txt"
159// #define TRACKFILE "argon_tracks_lalyo_files_full.txt"
160
161// Merts_SIGEM_v1_*.root - Gem + SILICON треки версия Merts с damount = dx * dx / (ddxgem + ddxdch) + dy * dy / (ddygem
162// + ddydch);
163#elif GEMTYPE == 3
164#define DTXDCH +0.0065589
165#define DTYDCH -0.0004069
166#define DXDCH -8.00097
167#define DYDCH -3.1156
168#define DZDCH -2.32
169#define MINGEMNDF 4
170#define MINSIHITS 2
171#define TRACKFILE "argon_tracks_merts_chi2_files.txt"
172
173// Merts_SIGEM_v2_*.root - Gem + SILICON треки версия Merts с damount = dx * dx + dy * dy;
174#elif GEMTYPE == 4
175#define DTXDCH +0.0065589
176#define DTYDCH -0.0004069
177#define DXDCH -8.00097
178#define DYDCH -3.1156
179#define DZDCH -2.32
180#define MINGEMNDF 4
181#define MINSIHITS 2
182#define TRACKFILE "argon_tracks_merts_files.txt"
183
184#endif
185
186// Old Gleb
187#define DTX0DCH +0.0
188#define DTY0DCH +0.0
189#define DX0DCH -10.3038
190#define DY0DCH +2.55
191#define DZ0DCH +1.94
192
193#define MINTIME true
194
195#define GEMDEBUG false
196
197#define XYPANIN 0
198#define XYPETNEW 1
199
200// #define DXGEMDCHMAX 5.
201// #define DYGEMDCHMAX 3.
202#define DXGEMDCHMAX 2.5
203#define DYGEMDCHMAX 1.5
204
205#define USE_CLUSTERS 1
206
207#define STRIP_CORRECTIONS 1
208#define LIST_STRIP_CORRECTIONS 0
209
210// CALIBRATION - 0 - read corrections from root file *calibration.root, main time peak from TOF700_MC_time_run7.txt
211// 1 - no calibration correction on input, calculation and store corrections in *calibration.root file,
212// mean time peak from beam momentum 2 - no calibration correction on input, calculation and store
213// corrections in *calibration.root file, mean time peak from TOF700_MC_time_run7.txt 3 - no calibration
214// correction on input, calculation and store corrections in *calibration.root file, mean time peak from
215// TOF700_MC_time_run7.txt
216#define CALIBRATION 0
217
218// GEMCUTS = 0 - don't use additional cuts on GEM tracks, 1 - use additional cuts
219#define GEMCUTS 1
220
221// PRIMARY_VERTEX_CUTS = 0 - don't use additional cuts on primary vertex, 1 - use additional cuts
222#define PRIMARY_VERTEX_CUTS 1
223// #define PV_HARD 3.0f
224#define PV_HARD 0.0f
225
226// CVERS=0 - use last calibration tables, 1 - use *;1 version
227#define CVERS 1
228
229// CFACTOR - beta factor for main time peak particles
230#define CFACTOR 0.97f
231
232// FLAG -1 - (GEM+DCH1+DCH2), 0 - all, +1 (GEM+DCH1)
233#define FLAG 0
234
235// BETAMAX max velocity for proton selection
236#define BETAMAX 1.00f
237
238// PMIN min momentum for track selection
239#define PMIN 0.5f
240
241// PMAX max momentum for track selection
242#define PMAX 5.0f
243
244// PMAX1 max momentum for proton mass limits for calculate corrections
245#define PMAX1 3.0f
246
247// PMAX2 max momentum for proton mass limits for resolution hists
248#define PMAX2 2.5f
249
250// PRES min momentum for resolution hists
251#define PRES 2.0f
252
253// PRES1 another min momentum for resolution hists
254#define PRES1 3.0f
255
256// PMAXPI max momentum for pion track selection for calculate corrections
257#define PMAXPI 3.0f
258
259// MPIMAX max limit pion mass
260#define MPIMAX 0.2f
261
262// MP proton mass
263#define MP 0.938f
264
265// MP2 proton mass sqare
266#define MP2 (MP * MP)
267
268// pion mass
269#define MPI 0.139
270
271// pion mass square
272#define MPI2 (MPI * MPI)
273
274// scale factor for min mass proton region selection
275#define DMPSCALE1 1.
276
277// scale factor for max mass proton region selection
278#define DMPSCALE2 1.
279
280// scale factor for min mass proton region selection for time hist
281#define DMPSCALET1 1.
282
283// scale factor for max mass proton region selection for time hist
284#define DMPSCALET2 1.5
285
286// scale factor for pion region selection
287#define DMPISCALE 1.
288
289// PSCALE - momentum scale factor
290// #define PSCALE 0.96f
291#define PSCALE 0.99f
292// #define PSCALE 1.00f
293
294#define WRITE_CALIBRATION 0
295
296// #define XFACTOR 5.0f
297#define XFACTOR 1.0f
298// #define DISTMAX 20.0f
299// #define DXMAX 5.0f
300// #define DYMAX 3.0f
301#define DISTMAX 20.0f
302#define DXMAX 5.0f
303#define DYMAX 3.0f
304#define DXMAXPAN 5.0f
305#define DYMAXPAN 5.0f
306#define GEM2SCALE 1.5f
307
308#define ACCEPTANCE false
309#define DXBORDER 4.
310#define DYBORDER 4.
311
312#define TOFMAX 39.0f
313
314#define IN_WIDTH_LIMITS 0
315#define WMIN 2900
316#define WMAX 9000
317
318#define NUMBER_CHAMBERS 59
319
322
323int wmi[NUMBER_CHAMBERS] = {2900};
324int wma[NUMBER_CHAMBERS] = {9000};
325
326int nhi = 0;
328int nhits[NUMBER_CHAMBERS][32] = {{0}};
329float tof[NUMBER_CHAMBERS][32] = {{0.}};
330float tofWidths[NUMBER_CHAMBERS][32] = {{0.}};
331double xhi[1000], yhi[1000], zhi[1000];
332double lrd[1000];
333double xhic[1000], yhic[1000], zhic[1000];
334using namespace std;
335using namespace TMath;
336
338
341
342float idchambers[59] = {27.1, 28.1, 3.1, 1.1, 29.1, 4.1, 33.1, 30.1, 5.1, 19.3, 31.1, 6.1,
343 2.1, 32.1, 15.2, 16.2, 17.2, 18.2, 19.2, 20.2, 7.1, 115.2, 113.1, 117.1,
344 35.1, 9.1, 37.1, 11.1, 39.1, 13.1, 34.1, 8.1, 36.1, 10.1, 38.1, 12.1,
345 21.2, 23.2, 25.2, 22.2, 24.2, 26.2, 107.2, 108.2, 109.2, 110.2, 111.2, 112.2,
346 114.1, 116.2, 118.1, 14.1, 40.1, 119.2, 120.2, 121.2, 122.2, 123.2, 124.2};
347
351
352Int_t Atar[6] = {0, 12, 27, 63, 120, 208}, Ztar[6] = {0, 6, 13, 29, 50, 82}, Ntar[10000] = {0}, IdTrig[10000] = {0},
353 fSp41[10000] = {0};
354TString NameTar[6] = {" ", "C", "Al", "Cu", "Sn", "Pb"};
356void xystrip(TH2D* h, Int_t i, Int_t j);
357
358Int_t readMCTimeFile(const char* MCTimeFile = "TOF700_MC_argon_qgsm_time_run7.txt");
359
360TFile* f = NULL;
361
362void BmnEfficiencyTOF700(const char* TracksGemDch = TRACKFILE,
363 const char* DigitsTOF700 = "argon_tof700_digits_files_pro_full_new.txt")
364{
365
366 /* Load basic libraries */
367#if ROOT_VERSION_CODE < ROOT_VERSION(5, 99, 99)
368 gROOT->LoadMacro("$VMCWORKDIR/macro/run/bmnloadlibs.C");
369#endif
370 bmnloadlibs(); // load BmnRoot libraries
371
372 int RunPeriod = 7;
373 char mapping[256];
374 if (RunPeriod >= 1 && RunPeriod <= 7) {
375 sprintf(mapping, "TOF700_map_period_%d.txt", RunPeriod);
376 } else {
377 printf("Non-existing run period number %d!", RunPeriod);
378 return;
379 }
380
381 BmnEventHeader* eventHeadertof700 = NULL;
382 TClonesArray *tof700Digits = NULL, *eventHeader = NULL;
383 TClonesArray *tracks = NULL, *mtracks = NULL;
384 CbmVertex* primaryVertex = NULL;
385 TString filename;
386
387 TChain* bmnTree = new TChain("bmndata");
388 if (strstr(TracksGemDch, ".root")) {
389 bmnTree->Add(TracksGemDch);
390 } else {
391 ifstream fin(TracksGemDch);
392 if (fin.is_open()) {
393 for (int idx = 0; idx < 1000; idx++) {
394 if (fin.eof())
395 break;
396 fin >> filename;
397 if (strlen(filename.Data()) == 0)
398 break;
399 if ((filename.Data())[0] == '#')
400 continue;
401 cout << " GEM+DCH tracks file #" << idx + 1 << " " << filename.Data() << endl;
402 bmnTree->Add(filename);
403 }
404 fin.close();
405 } else {
406 printf("Non-existing run list file: %s!", TracksGemDch);
407 return;
408 }
409 }
410 bmnTree->SetBranchAddress("EventHeader", &eventHeader);
411 bmnTree->SetBranchAddress("GemDchTracks", &mtracks);
412 bmnTree->SetBranchAddress("PrimaryVertex", &primaryVertex);
413
414 char fnametof700[256];
415 TChain* bmnTreetof700 = new TChain("bmndata");
416 if (strstr(DigitsTOF700, ".root")) {
417 bmnTreetof700->Add(DigitsTOF700); //
418 strcpy(fnametof700, DigitsTOF700);
419 } else {
420 ifstream fin(DigitsTOF700);
421 if (fin.is_open()) {
422 for (int idx = 0; idx < 1000; idx++) {
423 if (fin.eof())
424 break;
425 fin >> filename;
426 if (strlen(filename.Data()) == 0)
427 break;
428 if ((filename.Data())[0] == '#')
429 continue;
430 cout << " TOF digits file #" << idx + 1 << " " << filename.Data() << endl;
431 bmnTreetof700->Add(filename);
432 strcpy(fnametof700, filename.Data());
433 }
434 fin.close();
435 } else {
436 printf("Non-existing run list file: %s!", DigitsTOF700);
437 return;
438 }
439 }
440 bmnTreetof700->SetBranchAddress("BmnEventHeader.", &eventHeadertof700);
441 bmnTreetof700->SetBranchAddress("TOF700", &tof700Digits);
442
443 char fnametof700raw[256];
444 strcpy(fnametof700raw, fnametof700);
445 strcpy(strstr(fnametof700raw, "digi.root"), "raw.root");
446 if (XYPANIN)
447 TOF2 = new BmnTof2Raw2DigitNew(mapping, fnametof700raw, 0, 0, "TOF700_geometry_run7_panin.txt");
448 else
449 TOF2 = new BmnTof2Raw2DigitNew(mapping, fnametof700raw, 0, 0, "TOF700_geometry_run7.txt");
450
451 Double_t xmintof700 = +1000., xmaxtof700 = -1000., ymintof700 = +1000., ymaxtof700 = -1000.;
452 Float_t xs = 0., ys = 0., zs = 0.;
453 Double_t xsmin = 0., ysmin = 0., xsmax = 0., ysmax = 0.;
454 Double_t z_tof700_average = 0.;
455 for (int c = 0; c < NUMBER_CHAMBERS; c++) {
456 halfwidthy[c] = 0.5f;
457 if (idchambers[c] < 100.f) {
458 halfwidthx[c] = 8.0f;
459 } else {
460 halfwidthx[c] = 28.0f;
461 }
462 wmi[c] = WMIN;
463 wma[c] = WMAX;
464 int nstr = 32;
465 if (idchambers[c] > 100.f)
466 nstr = 16;
467 TOF2->get_strip_xyz(c, 0, &xs, &ys, &zs);
468 if (idchambers[c] != 19.3f)
469 z_tof700_average += zs;
470 xsmin = xs - halfwidthx[c];
471 xsmax = xs + halfwidthx[c];
472 ysmin = ys - halfwidthy[c];
473 ysmax = ys + halfwidthy[c];
474 if (xsmin < xmintof700)
475 xmintof700 = xsmin;
476 if (xsmax > xmaxtof700)
477 xmaxtof700 = xsmax;
478 if (ysmin < ymintof700)
479 ymintof700 = ysmin;
480 if (ysmax > ymaxtof700)
481 ymaxtof700 = ysmax;
482 TOF2->get_strip_xyz(c, nstr - 1, &xs, &ys, &zs);
483 xsmin = xs - halfwidthx[c];
484 xsmax = xs + halfwidthx[c];
485 ysmin = ys - halfwidthy[c];
486 ysmax = ys + halfwidthy[c];
487 if (xsmin < xmintof700)
488 xmintof700 = xsmin;
489 if (xsmax > xmaxtof700)
490 xmaxtof700 = xsmax;
491 if (ysmin < ymintof700)
492 ymintof700 = ysmin;
493 if (ysmax > ymaxtof700)
494 ymaxtof700 = ysmax;
495 }
496 xmintof700 -= DXBORDER;
497 xmaxtof700 += DXBORDER;
498 ymintof700 -= DYBORDER;
499 ymaxtof700 += DYBORDER;
500
501 z_tof700_average /= (NUMBER_CHAMBERS - 1);
502
503 char name[128], title[128];
504
505 gStyle->SetOptFit(111);
506 gStyle->SetOptStat(111111);
507
509
510 if (CALIBRATION == 0) {
511 char fname_calib_root[128];
512#if CALRUNNAME == 0
513 TString dir = getenv("VMCWORKDIR");
514#ifdef CORRECTIONFILE
515 TString path = dir + "/input/" + CORRECTIONFILE;
516#else
517 TString path = dir + "/input/" + CALIBFILE;
518#endif
519 strcpy(fname_calib_root, path.Data());
520#else
521 char* delim = 0;
522 strcpy(fname_calib_root, gSystem->BaseName(fnametof700));
523 if ((delim = strrchr(fname_calib_root, (int)'.')))
524 *delim = '\0';
525 strcat(fname_calib_root, "_calibration.root");
526#endif
527 TFile* fc = new TFile(fname_calib_root, "READ", "Proton mass based calibration of BmnTOF700");
528 if (CVERS == 0) {
529 itcalibr = (TProfile2D*)fc->Get("tcalibr");
530 itcalibrc = (TProfile*)fc->Get("tcalibrc");
531 } else {
532 itcalibr = (TProfile2D*)fc->Get("tcalibr;1");
533 itcalibrc = (TProfile*)fc->Get("tcalibrc;1");
534 }
535 printf("\n ******************* Time offsets for whole chamber **********************\n");
536 for (int c = 0; c < NUMBER_CHAMBERS; c++) {
537 tofcalc[c] = itcalibrc->GetBinContent(c + 1);
538 printf("%d %f\n", c, tofcalc[c]);
539 }
540 if (STRIP_CORRECTIONS) {
542 printf("\n ******************* Time offsets for one strip **************************\n");
543 for (int c = 0; c < NUMBER_CHAMBERS; c++) {
545 printf("\n Chamber %d %.1f\n", c, idchambers[c]);
546 int smax = 32;
547 if (idchambers[c] >= 100.f)
548 smax = 16;
549 for (int s = 0; s < smax; s++) {
550 tofcals[c][s] = itcalibr->GetBinContent(c + 1, s + 1);
552 printf(" strip %d %f\n", s, tofcals[c][s]);
553 }
555 printf("\n *************************************************************************\n");
556 }
557 }
558 }
559
560 if (strlen(fnametof700)) {
561 char fname_root[128], *delim = 0;
562 strcpy(fname_root, gSystem->BaseName(fnametof700));
563 if ((delim = strrchr(fname_root, (int)'.')))
564 *delim = '\0';
565 if (TRACKS_ONLY)
566 strcat(fname_root, "_efficiency_ntr_results.root");
567 else
568 strcat(fname_root, "_efficiency_results.root");
569 f = new TFile(fname_root, "RECREATE", "Results of BmnTOF700");
570 }
571
573
574#if XGEMCOR != 0
575 if (Xgemcorrection(1., &DTXcor, &DXsigma, &DYsigma) == -777.)
576 return;
577 DXsigma = 0.;
578 DYsigma = 0.;
579 DTXcor = 0.;
580#endif
581
582 TH1D* htarget = new TH1D("htarget", "Statistic vs target", 10, 0, 10);
583 TH1D* hntr = new TH1D("hntr", "Number of all tracks", 200, 0, 200);
584 TH1D* hntr0 = new TH1D("hntr0", "Number of selected tracks", 200, 0, 200);
585 TH1D* hntr1 = new TH1D("hntr1", "Number of tracks with FLAG conditions", 200, 0, 200);
586
587 TH1D* hntrgem0 = new TH1D("hntrgem0", "Number of GEM tracks", 200, 0, 200);
588 TH1D* hntrgemcut = new TH1D("hntrgemcut", "Number of GEM tracks after cuts", 200, 0, 200);
589 TH1D* hntrgem = new TH1D("hntrgem", "Number of good GEM tracks", 200, 0, 200);
590 TH1D* hntrdch0 = new TH1D("hntrdch0", "Number of DCH tracks", 200, 0, 200);
591 TH1D* hntrdch = new TH1D("hntrdch", "Number of good DCH tracks", 200, 0, 200);
592 TH2D* hntrgemdch = new TH2D("hntrgemdch", "Number of good DCH vs GEM tracks", 50, 0, 50, 50, 0, 50);
593
594 TH2D* hxydch = new TH2D("hxydch", "XY DCH refitted tracks", 70, -140, 140, 60, -90, 90);
595 hxydch->SetOption("COLZ");
596 hxydch->Sumw2();
597 TH2D* hxydch1 = new TH2D("hxydch1", "XY DCH tracks", 70, -140, 140, 60, -90, 90);
598 hxydch1->SetOption("COLZ");
599 hxydch1->Sumw2();
600 TH2D* hxygem = new TH2D("hxygem", "XY GEM tracks", 70, -140, 140, 60, -90, 90);
601 hxygem->SetOption("COLZ");
602 hxygem->Sumw2();
603 TProfile2D* pxygem_p = new TProfile2D("pxygem_p", "Momentum variation vs XY GEM positive tracks", 70, -140, 140, 60,
604 -90, 90, 0, 5, "s");
605 pxygem_p->Sumw2();
606 TProfile2D* pxygem_pn = new TProfile2D("pxygem_pn", "Momentum variation vs XY GEM negative tracks", 70, -140, 140,
607 60, -90, 90, 0, 5, "s");
608 pxygem_pn->Sumw2();
609 TProfile2D* pxygem_tx = new TProfile2D("pxygem_tx", "TX variation vs XY GEM positive tracks", 70, -140, 140, 60,
610 -90, 90, -0.5, +0.5, "s");
611 pxygem_tx->Sumw2();
612 TProfile2D* pxygem_txn = new TProfile2D("pxygem_txn", "TX variation vs XY GEM negative tracks", 70, -140, 140, 60,
613 -90, 90, -0.5, +0.5, "s");
614 pxygem_txn->Sumw2();
615 TProfile2D* pxygem_ty = new TProfile2D("pxygem_ty", "TY variation vs XY GEM positive tracks", 70, -140, 140, 60,
616 -90, 90, -0.5, +0.5, "s");
617 pxygem_ty->Sumw2();
618 TProfile2D* pxygem_tyn = new TProfile2D("pxygem_tyn", "TY variation vs XY GEM negative tracks", 70, -140, 140, 60,
619 -90, 90, -0.5, +0.5, "s");
620 pxygem_tyn->Sumw2();
621
622 TH2D* hxygem0 = new TH2D("hxygem0", "XY GEM tracks (1st plane)", 20, -10, 10, 20, -10, 10);
623 hxygem0->SetOption("COLZ");
624 hxygem0->Sumw2();
625 TH2D* hxygem0p = new TH2D("hxygem0p", "XY GEM positive tracks (1st plane)", 20, -10, 10, 20, -10, 10);
626 hxygem0p->SetOption("COLZ");
627 hxygem0p->Sumw2();
628 TH2D* hxygem0n = new TH2D("hxygem0n", "XY GEM negative tracks (1st plane)", 20, -10, 10, 20, -10, 10);
629 hxygem0n->SetOption("COLZ");
630 hxygem0n->Sumw2();
631 TProfile2D* pxygem0_p = new TProfile2D("pxygem0_p", "Momentum variation vs XY GEM positive tracks (1st plane)", 20,
632 -10, 10, 20, -10, 10, 0, 5, "s");
633 pxygem0_p->Sumw2();
634 TProfile2D* pxygem0_pn = new TProfile2D("pxygem0_pn", "Momentum variation vs XY GEM negative tracks (1st plane)",
635 20, -10, 10, 20, -10, 10, 0, 5, "s");
636 pxygem0_pn->Sumw2();
637 TProfile2D* pxygem0_tx = new TProfile2D("pxygem0_tx", "TX variation vs XY GEM positive tracks (1st plane)", 20, -10,
638 10, 20, -10, 10, -0.5, +0.5, "s");
639 pxygem0_tx->Sumw2();
640 TProfile2D* pxygem0_txn = new TProfile2D("pxygem0_txn", "TX variation vs XY GEM negative tracks (1st plane)", 20,
641 -10, 10, 20, -10, 10, -0.5, +0.5, "s");
642 pxygem0_txn->Sumw2();
643 TProfile2D* pxygem0_ty = new TProfile2D("pxygem0_ty", "TY variation vs XY GEM positive tracks (1st plane)", 20, -10,
644 10, 20, -10, 10, -0.5, +0.5, "s");
645 pxygem0_ty->Sumw2();
646 TProfile2D* pxygem0_tyn = new TProfile2D("pxygem0_tyn", "TY variation vs XY GEM negative tracks (1st plane)", 20,
647 -10, 10, 20, -10, 10, -0.5, +0.5, "s");
648 pxygem0_tyn->Sumw2();
649 TH2D* hxygoodtrgem0 =
650 new TH2D("hxygoodtrgem0", "XY (gem 1st plane) GEM+DCH+TOF700 good tracks", 20, -10, 10, 20, -10, 10);
651 hxygoodtrgem0->SetOption("COLZ");
652 hxygoodtrgem0->Sumw2();
653 TH2D* hxyefftrgem0 =
654 new TH2D("hxyefftrgem0", "XY (gem 1st plane) GEM+DCH+TOF700 good tracks", 20, -10, 10, 20, -10, 10);
655 hxyefftrgem0->SetOption("COLZ");
656 hxyefftrgem0->Sumw2();
657 TH2D* hxygoodtrgem0p =
658 new TH2D("hxygoodtrgem0p", "XY (gem 1st plane) GEM+DCH+TOF700 good positive tracks", 20, -10, 10, 20, -10, 10);
659 hxygoodtrgem0p->SetOption("COLZ");
660 hxygoodtrgem0p->Sumw2();
661 TH2D* hxyefftrgem0p = new TH2D("hxyefftrgem0p", "XY (gem 1st plane) GEM+DCH+TOF700 efficiency positive tracks", 20,
662 -10, 10, 20, -10, 10);
663 hxyefftrgem0p->SetOption("COLZ");
664 hxyefftrgem0p->Sumw2();
665 TH2D* hxygoodtrgem0n =
666 new TH2D("hxygoodtrgem0n", "XY (gem 1st plane) GEM+DCH+TOF700 good negative tracks", 20, -10, 10, 20, -10, 10);
667 hxygoodtrgem0n->SetOption("COLZ");
668 hxygoodtrgem0n->Sumw2();
669 TH2D* hxyefftrgem0n = new TH2D("hxyefftrgem0n", "XY (gem 1st plane) GEM+DCH+TOF700 efficiency negative tracks", 20,
670 -10, 10, 20, -10, 10);
671 hxyefftrgem0n->SetOption("COLZ");
672 hxyefftrgem0n->Sumw2();
673
674 TH1D* hptr = new TH1D("hptr", "Momentum of GEM tracks", 1000, -10, 10);
675 TH1D* hpgemdch = new TH1D("hpgemdch", "Momentum of GEM+DCH tracks", 1000, -10, 10);
676 hpgemdch->Sumw2();
677 TH1D* hpgemtof = new TH1D("hpgemtof", "Momentum of GEMTOF tracks", 1000, -10, 10);
678 hpgemtof->Sumw2();
679 TH1D* hpgemdch2 = new TH1D("hpgemdch2", "Momentum of GEMTOF+DCH tracks", 1000, -10, 10);
680 hpgemdch2->Sumw2();
681 TH1D* hpgoodhit = new TH1D("hpgoodhit", "Momentum of GEM+DCH+TOF700 tracks", 1000, -10, 10);
682 hpgoodhit->Sumw2();
683 TH1D* hpgoodhit2 = new TH1D("hpgoodhit2", "Momentum of GEMTOF+DCH+TOF700 tracks", 1000, -10, 10);
684 hpgoodhit2->Sumw2();
685 TH1D* hpbadhit = new TH1D("hpbadhit", "Momentum of GEM+DCH+NoTOF700 tracks", 1000, -10, 10);
686 TH1D* hp0 = new TH1D("hp0", "Momentum of tracks (all)", 1000, -10, 10);
687 TH1D* hltr = new TH1D("hltr", "Lenght of GEM tracks", 100, 500, 700);
688 TH1D* hltra = new TH1D("hltra", "Lenght of GEM+DCH tracks", 100, 500, 700);
689 TH2D* hxytrtof = new TH2D("hxytrtof", "XY tracks with TOF700 hits", 1500, -150, 150, 1000, -100, 100);
690 hxytrtof->SetOption("COLZ");
691
692 // TOF700 hits
693 TH2D* hxyhit = new TH2D("hxyhit", "XY track hit distance from TOF700 hit", 200, -50, 50, 40, -10, 10);
694 hxyhit->SetOption("COLZ");
695 TH2D* hxyghit = new TH2D("hxyghit", "XY GEM track hit distance from DCH1 hit", 200, -50, 50, 40, -10, 10);
696 hxyghit->SetOption("COLZ");
697 TH2D* hxyhit1 = new TH2D("hxyhit1", "XY track hit distance from TOF700 hit (DCH track)", 200, -50, 50, 40, -10, 10);
698 hxyhit1->SetOption("COLZ");
699 TH2D* hxyhit2 =
700 new TH2D("hxyhit2", "XY track hit distance from TOF700 hit (GEMTOFDCH track)", 200, -50, 50, 40, -10, 10);
701 hxyhit2->SetOption("COLZ");
702 TH2D* hxyhit2g =
703 new TH2D("hxyhit2g", "XY track hit distance from TOF700 hit (GEMTOF track)", 200, -50, 50, 40, -10, 10);
704 hxyhit2g->SetOption("COLZ");
705 // GEM+DCH track
706 TH2D* hhitdxvsx = new TH2D("hhitdxvsx", "X track distance from TOF700 hit vs X", 50, -50, 150, 50, -2.5, 2.5);
707 hhitdxvsx->SetOption("COLZ");
708 // TH2D *hhitdxvsy = new TH2D("hhitdxvsy","X track hit distance from TOF700 hit vs Y", 25,-10,90,50,-2.5,2.5);
709 // TH2D *hhitdyvsx = new TH2D("hhitdyvsx","Y track hit distance from TOF700 hit vs X", 50,-50,150,50,-2.5,2.5);
710 // TH2D *hhitdyvsy = new TH2D("hhitdyvsy","Y track hit distance from TOF700 hit vs Y", 25,-10,90,50,-2.5,2.5);
711 TProfile* phitdxvsx =
712 new TProfile("phitdxvsx", "Average X track hit distance from TOF700 hit vs X", 50, -50, 150, -10, 10, "s");
713 TProfile* phitdxvsy =
714 new TProfile("phitdxvsy", "Average X track hit distance from TOF700 hit vs Y", 25, -10, 90, -10, 10, "s");
715 TProfile* phitdyvsx =
716 new TProfile("phitdyvsx", "Average Y track hit distance from TOF700 hit vs X", 50, -50, 150, -10, 10, "s");
717 TProfile* phitdyvsy =
718 new TProfile("phitdyvsy", "Average Y track hit distance from TOF700 hit vs Y", 25, -10, 90, -10, 10, "s");
719 TH2D* hhitdxvsp = new TH2D("hhitdxvsp", "X track distance from TOF700 hit vs momentum", 50, 0, 5, 100, -5, 5);
720 hhitdxvsp->SetOption("COLZ");
721 TH2D* hhitdxvspn =
722 new TH2D("hhitdxvspn", "X track distance from TOF700 hit vs momentum (negative)", 50, 0, 5, 100, -5, 5);
723 hhitdxvspn->SetOption("COLZ");
724 TH2D* hhitdxvsp1 =
725 new TH2D("hhitdxvsp1", "X track distance from TOF700 hit vs momentum (X<0)", 50, 0, 5, 100, -5, 5);
726 TH2D* hhitdxvsp2 =
727 new TH2D("hhitdxvsp2", "X track distance from TOF700 hit vs momentum (0<X<40)", 50, 0, 5, 100, -5, 5);
728 TH2D* hhitdxvsp3 =
729 new TH2D("hhitdxvsp3", "X track distance from TOF700 hit vs momentum (40<X<80)", 50, 0, 5, 100, -5, 5);
730 TH2D* hhitdxvsp4 =
731 new TH2D("hhitdxvsp4", "X track distance from TOF700 hit vs momentum (80<X<120)", 50, 0, 5, 100, -5, 5);
732 TH2D* hhitdxvsp5 =
733 new TH2D("hhitdxvsp5", "X track distance from TOF700 hit vs momentum (X>120)", 50, 0, 5, 100, -5, 5);
734 TH2D* hhitdyvsp = new TH2D("hhitdyvsp", "Y track distance from TOF700 hit vs momentum", 50, 0, 5, 100, -5, 5);
735 hhitdyvsp->SetOption("COLZ");
736 TH2D* hhitdyvspn =
737 new TH2D("hhitdyvspn", "Y track distance from TOF700 hit vs momentum (negative)", 50, 0, 5, 100, -5, 5);
738 hhitdyvspn->SetOption("COLZ");
739
740 // GEM track
741 TH2D* hhitdxvsx2 =
742 new TH2D("hhitdxvsx2", "X track distance from TOF700 hit vs X (GEMTOFDCH track)", 50, -50, 150, 50, -2.5, 2.5);
743 hhitdxvsx2->SetOption("COLZ");
744 TProfile* phitdxvsx2 =
745 new TProfile("phitdxvsx2", "Average X track hit distance from TOF700 hit vs X (GEMTOFDCH track)", 50, -50, 150,
746 -10, 10, "s");
747 TProfile* phitdxvsy2 = new TProfile(
748 "phitdxvsy2", "Average X track hit distance from TOF700 hit vs Y (GEMTOFDCH track)", 25, -10, 90, -10, 10, "s");
749 TProfile* phitdyvsx2 =
750 new TProfile("phitdyvsx2", "Average Y track hit distance from TOF700 hit vs X (GEMTOFDCH track)", 50, -50, 150,
751 -10, 10, "s");
752 TProfile* phitdyvsy2 = new TProfile(
753 "phitdyvsy2", "Average Y track hit distance from TOF700 hit vs Y (GEMTOFDCH track)", 25, -10, 90, -10, 10, "s");
754 TH2D* hhitdxvsp22 =
755 new TH2D("hhitdxvsp22", "X GEMTOFDCH track distance from TOF700 hit vs momentum", 50, 0, 5, 100, -5, 5);
756 hhitdxvsp22->SetOption("COLZ");
757 TH2D* hhitdxvspn2 = new TH2D("hhitdxvspn2", "X GEMTOFDCH track distance from TOF700 hit vs momentum (negative)", 50,
758 0, 5, 100, -5, 5);
759 hhitdxvspn2->SetOption("COLZ");
760 TH2D* hhitdyvsp2 =
761 new TH2D("hhitdyvsp2", "Y GEMTOFDCH track distance from TOF700 hit vs momentum", 50, 0, 5, 100, -5, 5);
762 hhitdyvsp2->SetOption("COLZ");
763 TH2D* hhitdyvspn2 = new TH2D("hhitdyvspn2", "Y GEMTOFDCH track distance from TOF700 hit vs momentum (negative)", 50,
764 0, 5, 100, -5, 5);
765 hhitdyvspn2->SetOption("COLZ");
766
767 TH2D* hhitdxvsx2g =
768 new TH2D("hhitdxvsx2g", "X track distance from TOF700 hit vs X (GEMTOF track)", 50, -50, 150, 50, -2.5, 2.5);
769 hhitdxvsx2g->SetOption("COLZ");
770 TH2D* hhitdxvsp2g =
771 new TH2D("hhitdxvsp2g", "X GEMTOF track distance from TOF700 hit vs momentum", 50, 0, 5, 100, -5, 5);
772 hhitdxvsp2g->SetOption("COLZ");
773 TH2D* hhitdxvspn2g = new TH2D("hhitdxvspn2g", "X GEMTOF track distance from TOF700 hit vs momentum (negative)", 50,
774 0, 5, 100, -5, 5);
775 hhitdxvspn2g->SetOption("COLZ");
776 TH2D* hhitdyvsp2g =
777 new TH2D("hhitdyvsp2g", "Y GEMTOF track distance from TOF700 hit vs momentum", 50, 0, 5, 100, -5, 5);
778 hhitdyvsp2g->SetOption("COLZ");
779 TH2D* hhitdyvspn2g = new TH2D("hhitdyvspn2g", "Y GEMTOFDCH track distance from TOF700 hit vs momentum (negative)",
780 50, 0, 5, 100, -5, 5);
781 hhitdyvspn2g->SetOption("COLZ");
782
783 // DCH track
784 TH2D* hhitdxvsx1 =
785 new TH2D("hhitdxvsx1", "X track distance from TOF700 hit vs X (DCH track)", 50, -50, 150, 50, -2.5, 2.5);
786 hhitdxvsx1->SetOption("COLZ");
787 TProfile* phitdxvsx1 = new TProfile("phitdxvsx1", "Average X track hit distance from TOF700 hit vs X (DCH track)",
788 50, -50, 150, -10, 10, "s");
789 TProfile* phitdxvsy1 = new TProfile("phitdxvsy1", "Average X track hit distance from TOF700 hit vs Y (DCH track)",
790 25, -10, 90, -10, 10, "s");
791 TProfile* phitdyvsx1 = new TProfile("phitdyvsx1", "Average Y track hit distance from TOF700 hit vs X (DCH track)",
792 50, -50, 150, -10, 10, "s");
793 TProfile* phitdyvsy1 = new TProfile("phitdyvsy1", "Average Y track hit distance from TOF700 hit vs Y (DCH track)",
794 25, -10, 90, -10, 10, "s");
795 TH2D* hhitdxvsp11 =
796 new TH2D("hhitdxvsp11", "X DCH track distance from TOF700 hit vs momentum", 50, 0, 5, 100, -5, 5);
797 hhitdxvsp11->SetOption("COLZ");
798 TH2D* hhitdxvspn1 =
799 new TH2D("hhitdxvspn1", "X DCH track distance from TOF700 hit vs momentum (negative)", 50, 0, 5, 100, -5, 5);
800 hhitdxvspn1->SetOption("COLZ");
801 TH2D* hhitdyvsp1 = new TH2D("hhitdyvsp1", "Y DCH track distance from TOF700 hit vs momentum", 50, 0, 5, 100, -5, 5);
802 hhitdyvsp1->SetOption("COLZ");
803 TH2D* hhitdyvspn1 =
804 new TH2D("hhitdyvspn1", "Y DCH track distance from TOF700 hit vs momentum (negative)", 50, 0, 5, 100, -5, 5);
805 hhitdyvspn1->SetOption("COLZ");
806#if REFIT != 0
807 TH1D* hdxrefit1 = new TH1D("hdxrefit1", "TX(refit)-TX(dch)", 200, -5, +5);
808 TH1D* hdyrefit1 = new TH1D("hdyrefit1", "TX(refit)-TX(dch)", 200, -5, +5);
809 TH1D* hdtxrefit1 = new TH1D("hdtxrefit1", "TX(refit)-TX(dch)", 500, -0.5, +0.5);
810 TH1D* hdtyrefit1 = new TH1D("hdtyrefit1", "TY(refit)-TY(dch)", 500, -0.5, +0.5);
811 TH1D* hdxrefit = new TH1D("hdxrefit", "TX(refit)-TX(gem)", 200, -5, +5);
812 TH1D* hdyrefit = new TH1D("hdyrefit", "TX(refit)-TX(gem)", 200, -5, +5);
813 TH1D* hdtxrefit = new TH1D("hdtxrefit", "TX(refit)-TX(gem)", 500, -0.5, +0.5);
814 TH1D* hdtyrefit = new TH1D("hdtyrefit", "TY(refit)-TY(gem)", 500, -0.5, +0.5);
815 TH1D* hdprefit = new TH1D("hdprefit", "P(refit)-P(gem)", 200, -0.5, +0.5);
816#endif
817
818 // DCH1 hits
819 TH2D* hghitdxvsx = new TH2D("hghitdxvsx", "X track distance from DCH1 hit vs X", 50, -50, 150, 50, -2.5, 2.5);
820 hghitdxvsx->SetOption("COLZ");
821 TH2D* hghitdxvsp = new TH2D("hghitdxvsp", "X GEM track distance from DCH1 hit vs momentum", 50, 0, 5, 100, -5, 5);
822 hghitdxvsp->SetOption("COLZ");
823 TH2D* hghitdxvspn =
824 new TH2D("hghitdxvspn", "X GEM track distance from DCH1 hit vs momentum (negative)", 50, 0, 5, 100, -5, 5);
825 hghitdxvspn->SetOption("COLZ");
826 TH2D* hghitdxvspa = new TH2D("hghitdxvspa", "X GEM track distance from DCH1 hit vs momentum (all combinations)", 50,
827 0, 5, 200, -10, 10);
828 hghitdxvspa->SetOption("COLZ");
829 TH2D* hghitdxvspw1 =
830 new TH2D("hghitdxvspw1", "X GEM track distance from DCH1 hit vs momentum (all combinations, default window)",
831 50, 0, 5, 200, -10, 10);
832 hghitdxvspw1->SetOption("COLZ");
833 TH2D* hghitdxvspw2 =
834 new TH2D("hghitdxvspw2", "X GEM track distance from DCH1 hit vs momentum (all combinations, double window)", 50,
835 0, 5, 200, -10, 10);
836 hghitdxvspw2->SetOption("COLZ");
837 TH2D* hghitdxvspw3 =
838 new TH2D("hghitdxvspw3", "X GEM track distance from DCH1 hit vs momentum (all combinations, 2*sigma window)",
839 50, 0, 5, 200, -10, 10);
840 hghitdxvspw3->SetOption("COLZ");
841
842 TH2D* hghitdxvspan =
843 new TH2D("hghitdxvspan", "X GEM track distance from DCH1 hit vs momentum (negative, all combinations)", 50, 0,
844 5, 200, -10, 10);
845 hghitdxvspan->SetOption("COLZ");
846 TH2D* hghitdxvspw1n = new TH2D(
847 "hghitdxvspw1n", "X GEM track distance from DCH1 hit vs momentum (negative, all combinations, default window)",
848 50, 0, 5, 200, -10, 10);
849 hghitdxvspw1n->SetOption("COLZ");
850 TH2D* hghitdxvspw2n = new TH2D(
851 "hghitdxvspw2n", "X GEM track distance from DCH1 hit vs momentum (negative, all combinations, double window)",
852 50, 0, 5, 200, -10, 10);
853 hghitdxvspw2n->SetOption("COLZ");
854 TH2D* hghitdxvspw3n = new TH2D(
855 "hghitdxvspw3n", "X GEM track distance from DCH1 hit vs momentum (negative, all combinations, 2*sigma window)",
856 50, 0, 5, 200, -10, 10);
857 hghitdxvspw3n->SetOption("COLZ");
858
859 TH2D* hghitdxvspar =
860 new TH2D("hghitdxvspar", "X GEM track distance from DCH1 hit vs momentum (non-shifted, all combinations)", 50,
861 0, 5, 200, -10, 10);
862 hghitdxvspar->SetOption("COLZ");
863 TH2D* hghitdxvspw1r =
864 new TH2D("hghitdxvspw1r",
865 "X GEM track distance from DCH1 hit vs momentum (non-shifted, all combinations, default window)", 50,
866 0, 5, 200, -10, 10);
867 hghitdxvspw1r->SetOption("COLZ");
868 TH2D* hghitdxvspw2r =
869 new TH2D("hghitdxvspw2r",
870 "X GEM track distance from DCH1 hit vs momentum (non-shifted, all combinations, double window)", 50, 0,
871 5, 200, -10, 10);
872 hghitdxvspw2r->SetOption("COLZ");
873 TH2D* hghitdxvspw3r =
874 new TH2D("hghitdxvspw3r",
875 "X GEM track distance from DCH1 hit vs momentum (non-shifted, all combinations, 2*sigma window)", 50,
876 0, 5, 200, -10, 10);
877 hghitdxvspw3r->SetOption("COLZ");
878
879 TH2D* hghitdxvsparn = new TH2D(
880 "hghitdxvsparn", "X GEM track distance from DCH1 hit vs momentum (negative, non-shifted, all combinations)", 50,
881 0, 5, 200, -10, 10);
882 hghitdxvsparn->SetOption("COLZ");
883 TH2D* hghitdxvspw1rn = new TH2D(
884 "hghitdxvspw1rn",
885 "X GEM track distance from DCH1 hit vs momentum (negative, non-shifted, all combinations, default window)", 50,
886 0, 5, 200, -10, 10);
887 hghitdxvspw1rn->SetOption("COLZ");
888 TH2D* hghitdxvspw2rn = new TH2D(
889 "hghitdxvspw2rn",
890 "X GEM track distance from DCH1 hit vs momentum (negative, non-shifted, all combinations, double window)", 50,
891 0, 5, 200, -10, 10);
892 hghitdxvspw2rn->SetOption("COLZ");
893 TH2D* hghitdxvspw3rn = new TH2D(
894 "hghitdxvspw3rn",
895 "X GEM track distance from DCH1 hit vs momentum (negative, non-shifted, all combinations, 2*sigma window)", 50,
896 0, 5, 200, -10, 10);
897 hghitdxvspw3rn->SetOption("COLZ");
898
899 TH2D* hghitdxvsp1 =
900 new TH2D("hghitdxvsp1", "X GEM track distance from DCH1 hit vs momentum (X<0)", 50, 0, 5, 100, -5, 5);
901 TH2D* hghitdxvsp2 =
902 new TH2D("hghitdxvsp2", "X GEM track distance from DCH1 hit vs momentum (0<X<40)", 50, 0, 5, 100, -5, 5);
903 TH2D* hghitdxvsp3 =
904 new TH2D("hghitdxvsp3", "X GEM track distance from DCH1 hit vs momentum (40<X<80)", 50, 0, 5, 100, -5, 5);
905 TH2D* hghitdxvsp4 =
906 new TH2D("hghitdxvsp4", "X GEM track distance from DCH1 hit vs momentum (80<X<120)", 50, 0, 5, 100, -5, 5);
907 TH2D* hghitdxvsp5 =
908 new TH2D("hghitdxvsp5", "X GEM track distance from DCh1 hit vs momentum (X>120)", 50, 0, 5, 100, -5, 5);
909
910 TH2D* hghitdyvsp = new TH2D("hghitdyvsp", "Y GEM track distance from DCH1 hit vs momentum", 50, 0, 5, 100, -5, 5);
911 hghitdyvsp->SetOption("COLZ");
912 TH2D* hghitdyvspn =
913 new TH2D("hghitdyvspn", "Y GEM track distance from DCH1 hit vs momentum (negative)", 50, 0, 5, 100, -5, 5);
914 hghitdyvspn->SetOption("COLZ");
915 TH2D* hghitdyvspa = new TH2D("hghitdyvspa", "Y GEM track distance from DCH1 hit vs momentum (all combinations)", 50,
916 0, 5, 200, -10, 10);
917 hghitdyvspa->SetOption("COLZ");
918 TH2D* hghitdyvspw1 =
919 new TH2D("hghitdyvspw1", "Y GEM track distance from DCH1 hit vs momentum (all combinations, default window)",
920 50, 0, 5, 200, -10, 10);
921 hghitdyvspw1->SetOption("COLZ");
922 TH2D* hghitdyvspw2 =
923 new TH2D("hghitdyvspw2", "Y GEM track distance from DCH1 hit vs momentum (all combinations, double window)", 50,
924 0, 5, 200, -10, 10);
925 hghitdyvspw2->SetOption("COLZ");
926 TH2D* hghitdyvspw3 =
927 new TH2D("hghitdyvspw3", "Y GEM track distance from DCH1 hit vs momentum (all combinations, 2*sigma window)",
928 50, 0, 5, 200, -10, 10);
929 hghitdyvspw3->SetOption("COLZ");
930 //
931 TH1D* hnwin1 = new TH1D("hnwin1", "Number of pairs in default DXDY window", 10, 0, 10);
932 TH1D* hnwin2 = new TH1D("hnwin2", "Number of pairs in twice wider DXDY window", 10, 0, 10);
933 TH1D* hnwins = new TH1D("hnwins", "Number of pairs in default DXDY N-sigma window", 10, 0, 10);
934
935 TH1D* hchambigx = new TH1D("hchambigx", "Chambers for X > 110", 60, 0, 60);
936 TH1D* hchambigy = new TH1D("hchambigy", "Chambers for Y > 75", 60, 0, 60);
937 TH2D* hxvsxbigx = new TH2D("hxvsxbigx", "Xtr vs Xhit for big X", 25, 100, 150, 25, 100, 150);
938 TH2D* hyvsybigy = new TH2D("hyvsybigy", "Ytr vs Yhit for big Y", 40, 70, 90, 40, 70, 90);
939 TH1D* hpbigx = new TH1D("hpbigx", "Momentum for X > 110", 500, -10, 10);
940 TH1D* hpbigy = new TH1D("hpbigy", "Momentum for Y > 75", 500, -10, 10);
941 TH1D* hybigx = new TH1D("hybigx", "Y for X > 110", 25, -10, 90);
942 TH1D* hxbigy = new TH1D("hxbigy", "X for Y > 75", 50, -50, 150);
943 TH1D* hlrbigx = new TH1D("hlrbigx", "LR difference for TOF700 hits with track (big X)", 100, -5, +5);
944 TH2D* hxxhitbigx = new TH2D("hxxhitbigx", "X-X0 track hit vs TOF700 hit (big X)", 200, -100, 100, 200, -100, 100);
945 TH2D* hxyhitlr = new TH2D("hxyhitlr", "XY track hit distance from TOF700 hit (lr cut)", 200, -50, 50, 40, -10, 10);
946 TH1D* hxdiffs = new TH1D("hxdiffs", "X-X0 difference for TOF700 hits with track (small chambers)", 100, -50, +50);
947 TH1D* hxdiffb = new TH1D("hxdiffb", "X-X0 difference for TOF700 hits with track (big chambers)", 100, -50, +50);
948 TH2D* hxxhits =
949 new TH2D("hxxhits", "X-X0 track hit vs TOF700 hit (small chambers)", 200, -100, 100, 200, -100, 100);
950 TH2D* hxxhitb = new TH2D("hxxhitb", "X-X0 track hit vs TOF700 hit (big chambers)", 200, -100, 100, 200, -100, 100);
951 TH1D* hlrs = new TH1D("hlrs", "LR difference for TOF700 hits with track (small chambers)", 100, -5, +5);
952 TH1D* hlrb = new TH1D("hlrb", "LR difference for TOF700 hits with track (big chambers)", 100, -5, +5);
953
954 TH1D* htoftr = new TH1D("htoftr", "TOF of tracks with TOF700 hits", 600, -20, 40);
955 TH1D* htof = new TH1D("htof", "TOF for hits", 600, -20, 40);
956 TH1D* hntof = new TH1D("hntof", "Number of hits", 100, 0, 100);
957 TH1D* hncl = new TH1D("hncl", "Number of all clusters", 100, 0, 100);
958 TH1D* hncln = new TH1D("hncln", "Number of all clusters without 19.2 chamber", 100, 0, 100);
959 TH1D* hncls = new TH1D("hncls", "Number of clusters (small chambers)", 100, 0, 100);
960 TH1D* hnclsn = new TH1D("hnclsn", "Number of clusters (small chambers without 19.2)", 100, 0, 100);
961 TH1D* hnclb = new TH1D("hnclb", "Number of clusters (big chambers)", 100, 0, 100);
962 TH2D* hnclvschambs = new TH2D("hnclvschambs", "Number of clusters vs chamber vs ncl (small)", 50, 0, 50, 10, 0, 10);
963 TH2D* hnclvschambb = new TH2D("hnclvschambb", "Number of clusters vs chamber vs ncl (big)", 50, 0, 50, 10, 0, 10);
964 TH1D* hnclvschambs1 = new TH1D("hnclvschambs1", "Number of clusters vs chamber(small)", 50, 0, 50);
965 TH1D* hnclvschambb1 = new TH1D("hnclvschambb1", "Number of clusters vs chamber (big)", 50, 0, 50);
966 TH1D* hncltr = new TH1D("hncltr", "Number of clusters with a track", 100, 0, 100);
967 TH2D* hncltrvschambs =
968 new TH2D("hncltrvschambs", "Number of clusters with a track vs chamber vs ncl (small)", 50, 0, 50, 10, 0, 10);
969 TH2D* hncltrvschambb =
970 new TH2D("hncltrvschambb", "Number of clusters with a track vs chamber vs ncl (big)", 50, 0, 50, 10, 0, 10);
971 TH1D* hncltrvschambs1 =
972 new TH1D("hncltrvschambs1", "Number of clusters with a track vs chamber (small)", 50, 0, 50);
973 TH1D* hncltrvschambb1 = new TH1D("hncltrvschambb1", "Number of clusters with a track vs chamber (big)", 50, 0, 50);
974 // TH2D *hnclchambeffs = new TH2D("hnclchambeffs","Efficiency of clusters with a track vs chamber vs ncl
975 // (small)", 50,0,50,10,0,10); TH2D *hnclchambeffb = new TH2D("hnclchambeffb","Efficiency of clusters with a
976 // track vs chamber vs ncl (big)", 50,0,50,10,0,10);
977 TH1D* hchambeffs =
978 new TH1D("hchambeffs", "Efficiency of clusters with a track vs chamber vs ncl (small)", 50, 0, 50);
979 TH1D* hchambeffb = new TH1D("hchambeffb", "Efficiency of clusters with a track vs chamber vs ncl (big)", 50, 0, 50);
980 TH1D* hclnums = new TH1D("hclnums", "Number of strips in cluster (small chambers)", 10, 0, 10);
981 TH1D* hclnumb = new TH1D("hclnumb", "Number of strips in cluster (big chambers)", 10, 0, 10);
982 TH2D* hclwids = new TH2D("hclwids", "Cluser amp vs chamber ID (small chambers)", 50, 0, 50, 250, 0, 25000);
983 TH2D* hclwidb = new TH2D("hclwidb", "Cluser amp vs chamber ID (big chambers)", 50, 0, 50, 250, 0, 25000);
984 TH2D* hclamps = new TH2D("hclamps", "Strip amp vs chamber ID (small chambers)", 50, 0, 50, 250, 0, 25000);
985 TH2D* hclampb = new TH2D("hclampb", "Strip amp vs chamber ID (big chambers)", 50, 0, 50, 250, 0, 25000);
986 TH2D* hxycluster = new TH2D("hxycluster", "XY TOF700 cluster", 70, -140, 140, 60, -90, 90);
987 hxycluster->SetOption("COLZ");
988 hxycluster->Sumw2();
989 TH2D* hxyhits = new TH2D("hxyhits", "XY TOF700 hits", 20, 0, 20, 128, 0, 128);
990 hxyhits->SetOption("COLZ");
991 hxyhits->Sumw2();
992 TH2D* hxystrips = new TH2D("hxystrips", "XY TOF700 strips", 20, 0, 20, 128, 0, 128);
993 hxystrips->SetOption("COLZ");
994 hxystrips->Sumw2();
995 TH2D* hxygoodcluster =
996 new TH2D("hxygoodcluster", "XY TOF700 cluster with GEM+DCH tracks", 70, -140, 140, 60, -90, 90);
997 hxygoodcluster->SetOption("COLZ");
998 hxygoodcluster->Sumw2();
999 TH2D* hxygoodstrips =
1000 new TH2D("hxygoodstrips", "XY TOF700 strips with matched GEM+DCH tracks", 20, 0, 20, 128, 0, 128);
1001 hxygoodstrips->SetOption("COLZ");
1002 hxygoodstrips->Sumw2();
1003 TH2D* hxygood1strips =
1004 new TH2D("hxygood1strips", "XY TOF700 strips with matched(1) GEM+DCH tracks", 20, 0, 20, 128, 0, 128);
1005 hxygood1strips->SetOption("COLZ");
1006 hxygood1strips->Sumw2();
1007 TH2D* hxytrackstrips = new TH2D("hxytrackstrips", "XY TOF700 strips for GEM+DCH tracks", 20, 0, 20, 128, 0, 128);
1008 hxytrackstrips->SetOption("COLZ");
1009 hxytrackstrips->Sumw2();
1010 TH2D* hxygoodclustergem =
1011 new TH2D("hxygoodclustergem", "XY TOF700 cluster with GEM tracks", 70, -140, 140, 60, -90, 90);
1012 hxygoodclustergem->SetOption("COLZ");
1013 hxygoodclustergem->Sumw2();
1014 TH2D* hxygoodclusterdch =
1015 new TH2D("hxygoodclusterdch", "XY TOF700 cluster with DCH tracks", 70, -140, 140, 60, -90, 90);
1016 hxygoodclusterdch->SetOption("COLZ");
1017 hxygoodclusterdch->Sumw2();
1018 TH2D* hxyclustereff =
1019 new TH2D("hxyclustereff", "Efficiency GEM+DCH vs XY TOF700 cluster", 70, -140, 140, 60, -90, 90);
1020 hxyclustereff->SetOption("COLZ");
1021 hxyclustereff->Sumw2();
1022 TH2D* hxystripseff = new TH2D("hxystripseff", "XY TOF700 strips efficiency (over hits)", 20, 0, 20, 128, 0, 128);
1023 hxystripseff->SetOption("COLZ");
1024 hxystripseff->Sumw2();
1025 TH2D* hxytrackstripseff =
1026 new TH2D("hxytrackstripseff", "XY TOF700 strips efficiency (over tracks)", 20, 0, 20, 128, 0, 128);
1027 hxytrackstripseff->SetOption("COLZ");
1028 hxytrackstripseff->Sumw2();
1029 TH2D* hxytrackstripseff1 =
1030 new TH2D("hxytrackstripseff1", "XY TOF700 strips efficiency (1) (over tracks)", 20, 0, 20, 128, 0, 128);
1031 hxytrackstripseff1->SetOption("COLZ");
1032 hxytrackstripseff1->Sumw2();
1033 TH2D* hxyclustereffgem =
1034 new TH2D("hxyclustereffgem", "Efficiency GEM vs XY TOF700 cluster", 70, -140, 140, 60, -90, 90);
1035 hxyclustereffgem->SetOption("COLZ");
1036 hxyclustereffgem->Sumw2();
1037 TH2D* hxyclustereffdch =
1038 new TH2D("hxyclustereffdch", "Efficiency DCH vs XY TOF700 cluster", 70, -140, 140, 60, -90, 90);
1039 hxyclustereffdch->SetOption("COLZ");
1040 hxyclustereffdch->Sumw2();
1041
1042 TH1D* hnhit = new TH1D("hnhit", "Number of hits in width limits", 100, 0, 100);
1043 TH2D* hxytof = new TH2D("hxytof", "XY TOF700 hits", 1500, -150, 150, 1000, -100, 100);
1044 hxytof->SetOption("COLZ");
1045 hxytof->Sumw2();
1046 TH2D* hpbeta = new TH2D("hpbeta", "Beta vs momentum", 200, 0, 10, 220, 0, 1.1f);
1047 hpbeta->SetOption("COLZ");
1048 TH2D* hpbetac = new TH2D("hpbetac", "Beta vs momentum, chamber corrections", 200, 0, 10, 220, 0, 1.1f);
1049 hpbetac->SetOption("COLZ");
1050 TH2D* hpbetas = new TH2D("hpbetas", "Beta vs momentum, strip corrections", 200, 0, 10, 220, 0, 1.1f);
1051 hpbetas->SetOption("COLZ");
1052 TH2D* hpbetacm = new TH2D("hpbetacm", "Beta vs momentum, Z<0, chamber corrections", 200, 0, 10, 220, 0, 1.1f);
1053 hpbetacm->SetOption("COLZ");
1054 TH2D* hpbetasm = new TH2D("hpbetasm", "Beta vs momentum, Z<0, strip corrections", 200, 0, 10, 220, 0, 1.1f);
1055 hpbetasm->SetOption("COLZ");
1056 TH1D* hmass = new TH1D("hmass", "Mass, p<2", 400, -0.5, 9.5);
1057 TH1D* hmassc = new TH1D("hmassc", "Mass, chamber corrections", 400, -0.5, 9.5);
1058 TH1D* hmassc15 = new TH1D("hmassc15", "Mass, chamber corrections, p<1.5", 400, -0.5, 9.5);
1059 TH1D* hmassc20 = new TH1D("hmassc20", "Mass, chamber corrections, p<2.0", 400, -0.5, 9.5);
1060 TH1D* hmasss = new TH1D("hmasss", "Mass, strip corrections", 400, -0.5, 9.5);
1061 TH1D* hmasss15 = new TH1D("hmasss15", "Mass, strip corrections, p<1.5", 400, -0.5, 9.5);
1062 TH1D* hmasss20 = new TH1D("hmasss20", "Mass, strip corrections, p<2.0", 400, -0.5, 9.5);
1063 TH3D* hmasss15tt =
1064 new TH3D("hmasss15tt", "Mass vs trigger vs target, strip corrections, p<1.5", 400, -0.5, 9.5, 5, 1, 6, 6, 0, 6);
1065 TH3D* hmasss20tt =
1066 new TH3D("hmasss20tt", "Mass vs trigger vs target, strip corrections, p<2.0", 400, -0.5, 9.5, 5, 1, 6, 6, 0, 6);
1067 TH1D* hmasscm = new TH1D("hmasscm", "Mass, Z<0, chamber corrections", 200, -1, 4);
1068 TH1D* hmasssm = new TH1D("hmasssm", "Mass, Z<0, strip corrections", 200, -1, 4);
1069
1070 TH1D* hdtps = new TH1D("hdtps", "Time resolution, protons, strip corrections", 200, -1., +1.);
1071 TH2D* hdtpsvsp =
1072 new TH2D("hdtpsvsp", "Time resolution vs momentum, protons, strip corrections", 240, 0., 6., 200, -1., +1.);
1073 hdtpsvsp->SetOption("COLZ");
1074 TH3D* hdtpsvscvss = new TH3D("hdtpsvscvss", "Time resolution vs chamber vs strip, strip corrections", 59, 0, 59, 32,
1075 0., 32., 200, -1., +1.);
1076 TH3D* hdtpcvscvsp = new TH3D("hdtpcvscvsp", "Time resolution vs chamber vs momentum, chamber corrections", 59, 0,
1077 59, 60, 0., 6., 200, -1., +1.);
1078
1079 TH1D* hdtpc = new TH1D("hdtpc", "Time resolution, protons, chamber corrections", 200, -1., +1.);
1080 TH2D* hdtpcvsp =
1081 new TH2D("hdtpcvsp", "Time resolution vs momentum, protons, chamber corrections", 240, 0., 6., 200, -1., +1.);
1082 hdtpcvsp->SetOption("COLZ");
1083 TH2D* hdtpcvspwlim = new TH2D("hdtpcvspwlim", "Time resolution vs momentum, protons, chamber corrections, w>3000",
1084 240, 0., 6., 200, -1., +1.);
1085 hdtpcvspwlim->SetOption("COLZ");
1086 TH1D* hdtpcplim = new TH1D("hdtpcplim", "Time resolution, protons, p>3", 200, -1., +1.);
1087 TH1D* hdtpcp1lim = new TH1D("hdtpcp1lim", "Time resolution, protons, p>4", 200, -1., +1.);
1088 TH1D* hdtpcp2lim = new TH1D("hdtpcp2lim", "Time resolution, protons, p<2", 200, -1., +1.);
1089 TH1D* hdtpcp3lim = new TH1D("hdtpcp3lim", "Time resolution, protons, 2<p<5", 200, -1., +1.);
1090 TH1D* hdtpcwlim = new TH1D("hdtpcwlim", "Time resolution, protons, w>3000", 200, -1., +1.);
1091 TH1D* hdtpcwplim = new TH1D("hdtpcwplim", "Time resolution, protons, p>3, w>3000", 200, -1., +1.);
1092 TH1D* hdtpcwp1lim = new TH1D("hdtpcwp1lim", "Time resolution, protons, p>4, w>3000", 200, -1., +1.);
1093
1094 TH2D* hmassvsp = new TH2D("hmassvsp", "Mass vs momentum", 240, 0., 6., 200, -0.2, 4.8);
1095 hmassvsp->SetOption("COLZ");
1096 TH2D* hmasssvsp = new TH2D("hmasssvsp", "Mass vs momentum, strip correction", 240, 0., 6., 200, -0.2, 4.8);
1097 hmasssvsp->SetOption("COLZ");
1098 TH2D* hmasscvsp = new TH2D("hmasscvsp", "Mass vs momentum, chamber corrections", 240, 0., 6., 200, -0.2, 4.8);
1099 hmasscvsp->SetOption("COLZ");
1100 TH2D* hmasssmvsp = new TH2D("hmasssmvsp", "Mass vs momentum, Z<0, strip correction", 240, 0., 6., 200, -0.2, 4.8);
1101 hmasssmvsp->SetOption("COLZ");
1102 TH2D* hmasscmvsp =
1103 new TH2D("hmasscmvsp", "Mass vs momentum, Z<0, chamber corrections", 240, 0., 6., 200, -0.2, 4.8);
1104 hmasscmvsp->SetOption("COLZ");
1105
1106 TH1D* htofp = new TH1D("htofp", "TOF for proton hits, p<2", 600, -20, 40);
1107
1108 TH1D* hstr = new TH1D("hstr", "Strips", 32, 0, 32);
1109 TH1D* hcha = new TH1D("hcha", "Chambers", 60, 0, 60);
1110 TH1D* hstrtr = new TH1D("hstrtr", "Strips with tracks", 32, 0, 32);
1111 TH1D* hchatr = new TH1D("hchatr", "Chambers with tracks", 60, 0, 60);
1112
1113 TH2D* hdxy0 = new TH2D("hdxy0", "DxDy all", 40, -5, +5, 40, -5, +5);
1114 hdxy0->SetOption("COLZ");
1115 TH2D* hgdtxvsp = new TH2D("hgdtxvsp", "DTX vs P GEM-DCH (positive)", 50, 0, 5, 250, -0.5, +0.5);
1116 hgdtxvsp->SetOption("COLZ");
1117 TH2D* hgdtxvspn = new TH2D("hgdtxvspn", "DTX vs P GEM-DCH (negative)", 50, 0, 5, 250, -0.5, +0.5);
1118 hgdtxvspn->SetOption("COLZ");
1119 TH2D* hgdtxrvsp = new TH2D("hgdtxrvsp", "DTX vs P GEMDCH-DCH (positive)", 50, 0, 5, 250, -0.5, +0.5);
1120 hgdtxrvsp->SetOption("COLZ");
1121 TH2D* hgdtxrvspn = new TH2D("hgdtxrvspn", "DTX vs P GEMDCH-DCH (negative)", 50, 0, 5, 250, -0.5, +0.5);
1122 hgdtxrvspn->SetOption("COLZ");
1123 TH2D* hgdtxvspall = new TH2D("hgdtxvspall", "DTX vs P GEM-DCH (all pairs, positive)", 50, 0, 5, 250, -0.5, +0.5);
1124 hgdtxvspall->SetOption("COLZ");
1125 TH2D* hgdtxvspnall = new TH2D("hgdtxvspnall", "DTX vs P GEM-DCH (all pairs, negative)", 50, 0, 5, 250, -0.5, +0.5);
1126 hgdtxvspnall->SetOption("COLZ");
1127 TH2D* hgdtxvsdxall =
1128 new TH2D("hgdtxvsdxall", "DTX vs DX GEM-DCH (all pairs, positive)", 100, -5, 5, 250, -0.5, +0.5);
1129 hgdtxvsdxall->SetOption("COLZ");
1130 TH2D* hgdtx1vsp = new TH2D("hgdtx1vsp", "DX/LENG vs P GEM-DCH (positive)", 50, 0, 5, 250, -0.1, +0.1);
1131 hgdtx1vsp->SetOption("COLZ");
1132 TH2D* hgdtx1vspn = new TH2D("hgdtx1vspn", "DX/LENG vs P GEM-DCH (negative)", 50, 0, 5, 250, -0.1, +0.1);
1133 hgdtx1vspn->SetOption("COLZ");
1134 TH2D* hgdtx1vspall =
1135 new TH2D("hgdtx1vspall", "DX/LENG vs P GEM-DCH (all pairs, positive)", 50, 0, 5, 250, -0.5, +0.5);
1136 hgdtx1vspall->SetOption("COLZ");
1137 TH2D* hgdtx1vspnall =
1138 new TH2D("hgdtx1vspnall", "DX/LENG vs P GEM-DCH (all pairs, negative)", 50, 0, 5, 250, -0.5, +0.5);
1139 hgdtx1vspnall->SetOption("COLZ");
1140 TH2D* hgdtxty = new TH2D("hgdtxty", "DTY vs DTX GEM-DCH (positive)", 250, -0.5, +0.5, 250, -0.5, +0.5);
1141 hgdtxty->SetOption("COLZ");
1142 TH2D* hgdtxtyn = new TH2D("hgdtxtyn", "DTY vs DTX GEM-DCH (negative)", 250, -0.5, +0.5, 250, -0.5, +0.5);
1143 hgdtxtyn->SetOption("COLZ");
1144 TH2D* hdxyreal = new TH2D("hdxyreal", "DxDy all real", 40, -5, +5, 40, -5, +5);
1145 hdxyreal->SetOption("COLZ");
1146 TH2D* hdtxtyreal = new TH2D("hdtxtyreal", "DtxDty all real", 250, -0.5, +0.5, 250, -0.5, +0.5);
1147 hdtxtyreal->SetOption("COLZ");
1148 TH2D* hdxyrealall = new TH2D("hdxyrealall", "DxDy all combinations real", 40, -5, +5, 40, -5, +5);
1149 hdxyrealall->SetOption("COLZ");
1150 TH2D* hdtxtyrealall = new TH2D("hdtxtyrealall", "DtxDty all combinations real", 250, -0.5, +0.5, 250, -0.5, +0.5);
1151 hdtxtyrealall->SetOption("COLZ");
1152 TH2D* hdtxtyrealallw =
1153 new TH2D("hdtxtyrealallw", "DtxDty all combinations real in window", 250, -0.5, +0.5, 250, -0.5, +0.5);
1154 hdtxtyrealallw->SetOption("COLZ");
1155 TH1D* hdx = new TH1D("hdx", "dx all", 40, -5, +5);
1156 TH1D* hdy = new TH1D("hdy", "dy all", 40, -5, +5);
1157 TH2D* hdxy = new TH2D("hdxy", "DxDy selected", 40, -5, +5, 40, -5, +5);
1158 hdxy->SetOption("COLZ");
1159 hdxy->Sumw2();
1160 TH2D* hdxy2 = new TH2D("hdxy2", "DxDy selected (GEMTOF tracks)", 40, -5, +5, 40, -5, +5);
1161 hdxy2->SetOption("COLZ");
1162 hdxy2->Sumw2();
1163 TH2D* hdxytof = new TH2D("hdxytof", "DxDy with TOF700 hits", 40, -5, +5, 40, -5, +5);
1164 hdxytof->SetOption("COLZ");
1165 hdxytof->Sumw2();
1166 TH2D* hdxytof2 = new TH2D("hdxytof2", "DxDy with TOF700 hits (GEMTOF tracks)", 40, -5, +5, 40, -5, +5);
1167 hdxytof2->SetOption("COLZ");
1168 hdxytof2->Sumw2();
1169 TH2D* hdxyeff = new TH2D("hdxyeff", "Efficiency vs DxDy", 40, -5, +5, 40, -5, +5);
1170 hdxyeff->SetOption("COLZ");
1171 hdxyeff->Sumw2();
1172 TH2D* hdxyeff2 = new TH2D("hdxyeff2", "Efficiency vs DxDy (GEMTOF tracks)", 40, -5, +5, 40, -5, +5);
1173 hdxyeff2->SetOption("COLZ");
1174 hdxyeff2->Sumw2();
1175 TH1D* hdxeff = new TH1D("hdxeff", "Efficiency vs Dx", 40, -5, +5);
1176 TH1D* hdyeff = new TH1D("hdyeff", "Efficiency vs Dy", 40, -5, +5);
1177 TH2D* hxygoodtr = new TH2D("hxygoodtr", "XY(dch) GEM+DCH good tracks", 70, -140, 140, 60, -90, 90);
1178 hxygoodtr->SetOption("COLZ");
1179 hxygoodtr->Sumw2();
1180 TH2D* hxygoodtrp = new TH2D("hxygoodtrp", "XY(dch) GEM+DCH good positive tracks", 70, -140, 140, 60, -90, 90);
1181 hxygoodtrp->SetOption("COLZ");
1182 hxygoodtrp->Sumw2();
1183 TH2D* hxygoodtrn = new TH2D("hxygoodtrn", "XY(dch) GEM+DCH good negative tracks", 70, -140, 140, 60, -90, 90);
1184 hxygoodtrn->SetOption("COLZ");
1185 hxygoodtrn->Sumw2();
1186 TH2D* hxygoodtrgem = new TH2D("hxygoodtrgem", "XY(gem) GEM+DCH good tracks", 70, -140, 140, 60, -90, 90);
1187 hxygoodtrgem->SetOption("COLZ");
1188 hxygoodtrgem->Sumw2();
1189 TH2D* hxygoodtr2 = new TH2D("hxygoodtr2", "XY(dch) GEMTOF+DCH good tracks", 70, -140, 140, 60, -90, 90);
1190 hxygoodtr2->SetOption("COLZ");
1191 hxygoodtr2->Sumw2();
1192 TH2D* hxygoodtrgem2 = new TH2D("hxygoodtrgem2", "XY(gem) GEMTOF+DCH good tracks", 70, -140, 140, 60, -90, 90);
1193 hxygoodtrgem2->SetOption("COLZ");
1194 hxygoodtrgem2->Sumw2();
1195 TH2D* hxygoodhit = new TH2D("hxygoodhit", "XY good tracks (GEM+DCH) with good hits", 70, -140, 140, 60, -90, 90);
1196 hxygoodhit->SetOption("COLZ");
1197 hxygoodhit->Sumw2();
1198 TH2D* hxygoodhitp =
1199 new TH2D("hxygoodhitp", "XY good positive tracks (GEM+DCH) with good hits", 70, -140, 140, 60, -90, 90);
1200 hxygoodhitp->SetOption("COLZ");
1201 hxygoodhitp->Sumw2();
1202 TH2D* hxygoodhitn =
1203 new TH2D("hxygoodhitn", "XY good negative tracks (GEM+DCH) with good hits", 70, -140, 140, 60, -90, 90);
1204 hxygoodhitn->SetOption("COLZ");
1205 hxygoodhitn->Sumw2();
1206 TH2D* hxygoodhit2 =
1207 new TH2D("hxygoodhit2", "XY good tracks (GEMTOF+DCH) with good hits", 70, -140, 140, 60, -90, 90);
1208 hxygoodhit2->SetOption("COLZ");
1209 hxygoodhit2->Sumw2();
1210 TH2D* hxygoodhitgem2 =
1211 new TH2D("hxygoodhitgem2", "XY (gem) good tracks (GEMTOF+DCH) with good hits", 70, -140, 140, 60, -90, 90);
1212 hxygoodhitgem2->SetOption("COLZ");
1213 hxygoodhitgem2->Sumw2();
1214 TH2D* hxygoodhita = new TH2D("hxygoodhita", "XY good tracks (GEM+DCH) with good hits", 70, -140, 140, 60, -90, 90);
1215 hxygoodhita->SetOption("COLZ");
1216 hxygoodhita->Sumw2();
1217 TH2D* hxygoodhita2 =
1218 new TH2D("hxygoodhita2", "XY good tracks (GEMTOF+DCH) with good hits", 70, -140, 140, 60, -90, 90);
1219 hxygoodhita2->SetOption("COLZ");
1220 hxygoodhita2->Sumw2();
1221 TH2D* hxygoodhit1 = new TH2D("hxygoodhit1", "XY good tracks (DCH) with good hits", 70, -140, 140, 60, -90, 90);
1222 hxygoodhit1->SetOption("COLZ");
1223 hxygoodhit1->Sumw2();
1224 TH2D* hxybadhit = new TH2D("hxybadhit", "XY good tracks (GEM+DCH) with no hits", 70, -140, 140, 60, -90, 90);
1225 hxybadhit->SetOption("COLZ");
1226 TH2D* hxybadhita = new TH2D("hxybadhita", "XY good tracks (GEM+DCH) with no hits", 70, -140, 140, 60, -90, 90);
1227 hxybadhita->SetOption("COLZ");
1228
1229 TH2D* hxygemtofdchtof =
1230 new TH2D("hxygemtofdchtof", "XY(gem) GEMTOF and DCHTOF good tracks", 70, -140, 140, 60, -90, 90);
1231 hxygemtofdchtof->SetOption("COLZ");
1232 hxygemtofdchtof->Sumw2();
1233 TH2D* hxygemtofdchtofd =
1234 new TH2D("hxygemtofdchtofd", "XY(dch) GEMTOF and DCHTOF good tracks", 70, -140, 140, 60, -90, 90);
1235 hxygemtofdchtofd->SetOption("COLZ");
1236 hxygemtofdchtofd->Sumw2();
1237 TH2D* hxygemtofdchtof1 =
1238 new TH2D("hxygemtofdchtof1", "XY(gem) GEMTOF+DCHTOF good tracks", 70, -140, 140, 60, -90, 90);
1239 hxygemtofdchtof1->SetOption("COLZ");
1240 hxygemtofdchtof1->Sumw2();
1241 TH2D* hxygemtofdchtofd1 =
1242 new TH2D("hxygemtofdchtofd1", "XY(dch) GEMTOF+DCHTOF good tracks", 70, -140, 140, 60, -90, 90);
1243 hxygemtofdchtofd1->SetOption("COLZ");
1244 hxygemtofdchtofd1->Sumw2();
1245 TH2D* hxygemtofdchtof2 =
1246 new TH2D("hxygemtofdchtof2", "XY(gem) GEMTOF+DCHTOF good tracks (same TOF hit)", 70, -140, 140, 60, -90, 90);
1247 hxygemtofdchtof2->SetOption("COLZ");
1248 hxygemtofdchtof2->Sumw2();
1249 TH2D* hxygemtofdchtofd2 =
1250 new TH2D("hxygemtofdchtofd2", "XY(dch) GEMTOF+DCHTOF good tracks (same TOF hit)", 70, -140, 140, 60, -90, 90);
1251 hxygemtofdchtofd2->SetOption("COLZ");
1252 hxygemtofdchtofd2->Sumw2();
1253
1254 TH1D* hpgemtofdchtof = new TH1D("hpgemtofdchtof", "P GEMTOF and DCHTOF good tracks", 1000, -10, 10);
1255 hpgemtofdchtof->SetOption("COLZ");
1256 hpgemtofdchtof->Sumw2();
1257 TH1D* hpgemtofdchtof1 = new TH1D("hpgemtofdchtof1", "P GEMTOF+DCHTOF good tracks", 1000, -10, 10);
1258 hpgemtofdchtof1->SetOption("COLZ");
1259 hpgemtofdchtof1->Sumw2();
1260 TH1D* hpgemtofdchtof2 = new TH1D("hpgemtofdchtof2", "P GEMTOF+DCHTOF good tracks (same TOF hit)", 1000, -10, 10);
1261 hpgemtofdchtof2->SetOption("COLZ");
1262 hpgemtofdchtof2->Sumw2();
1263
1264 // Efficiencies
1265 TH2D* hxyeff =
1266 new TH2D("hxyeff", "Efficiency GEM+DCH+TOF700 vs XY good GEM+DCH tracks", 70, -140, 140, 60, -90, 90);
1267 hxyeff->SetOption("COLZ");
1268 hxyeff->Sumw2();
1269 TH2D* hxyeffp =
1270 new TH2D("hxyeffp", "Efficiency GEM+DCH+TOF700 vs XY good GEM+DCH positive tracks", 70, -140, 140, 60, -90, 90);
1271 hxyeffp->SetOption("COLZ");
1272 hxyeffp->Sumw2();
1273 TH2D* hxyeffn =
1274 new TH2D("hxyeffn", "Efficiency GEM+DCH+TOF700 vs XY good GEM+DCH negative tracks", 70, -140, 140, 60, -90, 90);
1275 hxyeffn->SetOption("COLZ");
1276 hxyeffn->Sumw2();
1277 TH2D* hxyeff2 =
1278 new TH2D("hxyeff2", "Efficiency GEMTOF+DCH+TOF700 vs XY good GEMTOF+DCH tracks", 70, -140, 140, 60, -90, 90);
1279 hxyeff2->SetOption("COLZ");
1280 hxyeff2->Sumw2();
1281 TH1D* hxeff = new TH1D("hxeff", "Efficiency GEM+DCH+TOF700 vs X good GEM+DCH tracks", 70, -140, 140);
1282 TH1D* hyeff = new TH1D("hyeff", "Efficiency GEM+DCH+TOF700 vs Y good GEM+DCH tracks", 60, -90, 90);
1283 TH2D* hxyeffmg = new TH2D("hxyeffmg", "Efficiency GEM+DCH vs XY good GEM tracks", 70, -140, 140, 60, -90, 90);
1284 hxyeffmg->SetOption("COLZ");
1285 hxyeffmg->Sumw2();
1286 TH2D* hxyeffmg2 =
1287 new TH2D("hxyeffmg2", "Efficiency GEMTOF+DCH vs XY good GEMTOF tracks", 70, -140, 140, 60, -90, 90);
1288 hxyeffmg2->SetOption("COLZ");
1289 hxyeffmg2->Sumw2();
1290 TH2D* hxyeffmg2f =
1291 new TH2D("hxyeffmg2f", "Efficiency GEMTOF+DCH vs XY good GEM tracks (full)", 70, -140, 140, 60, -90, 90);
1292 hxyeffmg2f->SetOption("COLZ");
1293 hxyeffmg2f->Sumw2();
1294 TH2D* hxyeffmd = new TH2D("hxyeffmd", "Efficiency GEM+DCH vs XY good DCH tracks", 70, -140, 140, 60, -90, 90);
1295 hxyeffmd->SetOption("COLZ");
1296 hxyeffmd->Sumw2();
1297 TH2D* hxyeffm1d = new TH2D("hxyeffm1d", "Efficiency DCH+TOF700 vs XY good DCH tracks", 70, -140, 140, 60, -90, 90);
1298 hxyeffm1d->SetOption("COLZ");
1299 hxyeffm1d->Sumw2();
1300 TH2D* hxyeffdg = new TH2D("hxyeffdg", "Efficiency DCH vs XY good GEM tracks", 70, -140, 140, 60, -90, 90);
1301 hxyeffdg->SetOption("COLZ");
1302 hxyeffdg->Sumw2();
1303 TH2D* hxyeffgd = new TH2D("hxyeffgd", "Efficiency GEM vs XY good DCH tracks", 70, -140, 140, 60, -90, 90);
1304 hxyeffgd->SetOption("COLZ");
1305 hxyeffgd->Sumw2();
1306 TH2D* hxyeffgemtof =
1307 new TH2D("hxyeffgemtof", "Efficiency GEMTOF vs XY good GEM tracks", 70, -140, 140, 60, -90, 90);
1308 hxyeffgemtof->SetOption("COLZ");
1309 hxyeffgemtof->Sumw2();
1310 TH2D* hxyeffgemtofdchtof1 =
1311 new TH2D("hxyeffgemtofdchtof1", "Efficiency vs XY(gem) GEMTOF+DCHTOF good tracks", 70, -140, 140, 60, -90, 90);
1312 hxyeffgemtofdchtof1->SetOption("COLZ");
1313 hxyeffgemtofdchtof1->Sumw2();
1314 TH2D* hxyeffgemtofdchtofd1 =
1315 new TH2D("hxyeffgemtofdchtofd1", "Efficiency vs XY(dch) GEMTOF+DCHTOF good tracks", 70, -140, 140, 60, -90, 90);
1316 hxyeffgemtofdchtofd1->SetOption("COLZ");
1317 hxyeffgemtofdchtofd1->Sumw2();
1318 TH2D* hxyeffgemtofdchtof2 =
1319 new TH2D("hxyeffgemtofdchtof2", "Efficiency vs XY(gem) GEMTOF+DCHTOF good tracks (same TOF hit)", 70, -140, 140,
1320 60, -90, 90);
1321 hxyeffgemtofdchtof2->SetOption("COLZ");
1322 hxyeffgemtofdchtof2->Sumw2();
1323 TH2D* hxyeffgemtofdchtofd2 =
1324 new TH2D("hxyeffgemtofdchtofd2", "Efficiency vs XY(dch) GEMTOF+DCHTOF good tracks (same TOF hit)", 70, -140,
1325 140, 60, -90, 90);
1326 hxyeffgemtofdchtofd2->SetOption("COLZ");
1327 hxyeffgemtofdchtofd2->Sumw2();
1328
1329 // Efficiencies vs P
1330 TH1D* hpeff = new TH1D("hpeff", "Efficiency GEM+DCH+TOF700 vs P good GEM+DCH tracks", 1000, -10, 10);
1331 hpeff->Sumw2();
1332 TH1D* hpeff2 = new TH1D("hpeff2", "Efficiency GEMTOF+DCH+TOF700 vs P good GEMTOF+DCH tracks", 1000, -10, 10);
1333 hpeff2->Sumw2();
1334 TH1D* hpeff2gt = new TH1D("hpeff2gt", "Efficiency GEMTOF+DCH+TOF700 vs P good GEMTOF tracks", 1000, -10, 10);
1335 hpeff2gt->Sumw2();
1336 TH1D* hpeffmg = new TH1D("hpeffmg", "Efficiency GEM+DCH vs P good GEM tracks", 1000, -10, 10);
1337 hpeffmg->Sumw2();
1338 TH1D* hpeffmg2 = new TH1D("hpeffmg2", "Efficiency GEMTOF+DCH vs P good GEMTOF tracks", 1000, -10, 10);
1339 hpeffmg2->Sumw2();
1340 TH1D* hpeffmg2f = new TH1D("hpeffmg2f", "Efficiency GEMTOF+DCH vs P good GEM tracks", 1000, -10, 10);
1341 hpeffmg2f->Sumw2();
1342 TH1D* hpeffgemtof = new TH1D("hpeffgemtof", "Efficiency GEMTOFvs P good GEM tracks", 1000, -10, 10);
1343 hpeffgemtof->Sumw2();
1344
1345 TH1D* hpeffgemtofdchtof =
1346 new TH1D("hpeffgemtofdchtof", "Efficiency vs P GEMTOF and DCHTOF good tracks", 1000, -10, 10);
1347 hpeffgemtofdchtof->SetOption("COLZ");
1348 hpeffgemtofdchtof->Sumw2();
1349 TH1D* hpeffgemtofdchtof1 =
1350 new TH1D("hpeffgemtofdchtof1", "Efficiency vs P P GEMTOF+DCHTOF good tracks", 1000, -10, 10);
1351 hpeffgemtofdchtof1->SetOption("COLZ");
1352 hpeffgemtofdchtof1->Sumw2();
1353 TH1D* hpeffgemtofdchtof2 =
1354 new TH1D("hpeffgemtofdchtof2", "Efficiency vs P P GEMTOF+DCHTOF good tracks (same TOF hit)", 1000, -10, 10);
1355 hpeffgemtofdchtof2->SetOption("COLZ");
1356 hpeffgemtofdchtof2->Sumw2();
1357
1358 // Fragments
1359
1360 TH2D* hyp0 = new TH2D("hyp0", "PT vs YLAB all particles", NYL * 3, YLMIN, 6, NPT * 2, PTMIN, PTMAX);
1361 hyp0->SetOption("COLZ");
1362 hyp0->Sumw2();
1363
1364 TH1D* hmfr0 = new TH1D("hmfr0", "M2 all particles", 400, -0.5, 9.5);
1365 TH1D* hmfrall = new TH1D("hmfrall", "M2 all fragments", 400, -0.5, 9.5);
1366 TH1D* hmfr = new TH1D("hmfr", "M2 selected fragments", 400, -0.5, 9.5);
1367
1368 TH3D* hmfr0tt = new TH3D("hmfr0tt", "M2 vs trigger vs target all particles", 400, -0.5, 9.5, 5, 1, 6, 6, 0, 6);
1369 TH3D* hmfralltt = new TH3D("hmfralltt", "M2 vs trigger vs target all fragments", 400, -0.5, 9.5, 5, 1, 6, 6, 0, 6);
1370 TH3D* hmfrtt = new TH3D("hmfrtt", "M2 vs trigger vs target selected fragments", 400, -0.5, 9.5, 5, 1, 6, 6, 0, 6);
1371
1372 TH2D* hypall = new TH2D("hypall", "PT vs YLAB all fragments", NYL, YLMIN, YLMAX, NPT, PTMIN, PTMAX);
1373 hypall->SetOption("COLZ");
1374 hypall->Sumw2();
1375
1376 TH2D* hypall1 = new TH2D("hypall1", "PT vs YLAB all fragments", 20, YLMIN, YLMAX, 28, PTMIN, PTMAX);
1377 hypall1->SetOption("COLZ");
1378 hypall1->Sumw2();
1379
1380 TH2D* hyp_p = new TH2D("hyp_p", "PT vs YLAB protons", NYL, YLMIN, YLMAX, NPT, PTMIN, PTMAX);
1381 hyp_p->SetOption("COLZ");
1382 hyp_p->Sumw2();
1383
1384 TH2D* hyp_p1 = new TH2D("hyp_p1", "PT vs YLAB protons", 20, YLMIN, YLMAX, 28, PTMIN, PTMAX);
1385 hyp_p1->SetOption("COLZ");
1386 hyp_p1->Sumw2();
1387
1388 TH2D* hyp_d = new TH2D("hyp_d", "PT vs YLAB deuteron+he4", NYL, YLMIN, YLMAX, NPT, PTMIN, PTMAX);
1389 hyp_d->SetOption("COLZ");
1390 hyp_d->Sumw2();
1391
1392 TH2D* hyp_d1 = new TH2D("hyp_d1", "PT vs YLAB deuteron+he4", 20, YLMIN, YLMAX, 28, PTMIN, PTMAX);
1393 hyp_d1->SetOption("COLZ");
1394 hyp_d1->Sumw2();
1395
1396 TH2D* hyp_he3 = new TH2D("hyp_he3", "PT vs YLAB He3", NYL, YLMIN, YLMAX, NPT, PTMIN, PTMAX);
1397 hyp_he3->SetOption("COLZ");
1398 hyp_he3->Sumw2();
1399
1400 TH2D* hyp_t = new TH2D("hyp_t", "PT vs YLAB triton", NYL, YLMIN, YLMAX, NPT, PTMIN, PTMAX);
1401 hyp_t->SetOption("COLZ");
1402 hyp_t->Sumw2();
1403
1404 TH2D* hyp_he31 = new TH2D("hyp_he31", "PT vs YLAB He3", 20, YLMIN, YLMAX, 28, PTMIN, PTMAX);
1405 hyp_he31->SetOption("COLZ");
1406 hyp_he31->Sumw2();
1407
1408 TH2D* hyp_t1 = new TH2D("hyp_t1", "PT vs YLAB triton", 20, YLMIN, YLMAX, 28, PTMIN, PTMAX);
1409 hyp_t1->SetOption("COLZ");
1410 hyp_t1->Sumw2();
1411
1412 TH2D* hghitdxvsp_pi =
1413 new TH2D("hghitdxvsp_pi", "X GEM track distance from DCH1 hit vs momentum (pions)", 50, 0, 5, 100, -5, 5);
1414 hghitdxvsp_pi->SetOption("COLZ");
1415
1416 TH2D* hghitdxvsp_p =
1417 new TH2D("hghitdxvsp_p", "X GEM track distance from DCH1 hit vs momentum (protons)", 50, 0, 5, 100, -5, 5);
1418 hghitdxvsp_p->SetOption("COLZ");
1419
1420 TH2D* hghitdxvsp_d =
1421 new TH2D("hghitdxvsp_d", "X GEM track distance from DCH1 hit vs momentum (deuterons)", 50, 0, 5, 100, -5, 5);
1422 hghitdxvsp_d->SetOption("COLZ");
1423
1424 TH2D* hhitdxvsp_pi =
1425 new TH2D("hhitdxvsp_pi", "X track distance from TOF700 hit vs momentum (pions)", 50, 0, 5, 100, -5, 5);
1426 hhitdxvsp_pi->SetOption("COLZ");
1427
1428 TH2D* hhitdxvsp_p =
1429 new TH2D("hhitdxvsp_p", "X track distance from TOF700 hit vs momentum (protons)", 50, 0, 5, 100, -5, 5);
1430 hhitdxvsp_p->SetOption("COLZ");
1431
1432 TH2D* hhitdxvsp_d =
1433 new TH2D("hhitdxvsp_d", "X track distance from TOF700 hit vs momentum (deuterons)", 50, 0, 5, 100, -5, 5);
1434 hhitdxvsp_d->SetOption("COLZ");
1435
1436 TH1F* hplaz = new TH1F("hplaz", "Z hits coordinates TOF700 planes", 100, 600, 650);
1437 TH1F* hpla = new TH1F("hpla", "X hits on all TOF700 planes", 300, -150, 150);
1438 TH1F* hpla1a = new TH1F("hpla1a", "X hits on TOF700 plane 1A", 300, -150, 150);
1439 TH1F* hpla1b = new TH1F("hpla1b", "X hits on TOF700 plane 1B", 300, -150, 150);
1440 TH1F* hpla2ac = new TH1F("hpla2ac", "X hits on TOF700 plane 2A, central row", 300, -150, 150);
1441 TH1F* hpla2au = new TH1F("hpla2au", "X hits on TOF700 plane 2A, upper row", 300, -150, 150);
1442 TH1F* hpla2bc = new TH1F("hpla2bc", "X hits on TOF700 plane 2B, central row", 300, -150, 150);
1443 TH1F* hpla2bu = new TH1F("hpla2bu", "X hits on TOF700 plane 2B, upper row", 300, -150, 150);
1444 TH1F* hpla2abc = new TH1F("hpla2abc", "X hits on TOF700 plane 2A & 2B, central row", 300, -150, 150);
1445
1446 TH2F* h2pla1a = new TH2F("h2pla1a", "XY hits on TOF700 plane 1A", 300, -150, 150, 170, -85, +85);
1447 TH2F* h2pla1b = new TH2F("h2pla1b", "XY hits on TOF700 plane 1B", 300, -150, 150, 170, -85, +85);
1448 TH2F* h2pla2ac = new TH2F("h2pla2ac", "XY hits on TOF700 plane 2A, central row", 300, -150, 150, 170, -85, +85);
1449 TH2F* h2pla2au = new TH2F("h2pla2au", "XY hits on TOF700 plane 2A, upper row", 300, -150, 150, 170, -85, +85);
1450 TH2F* h2pla2bc = new TH2F("h2pla2bc", "XY hits on TOF700 plane 2B, central row", 300, -150, 150, 170, -85, +85);
1451 TH2F* h2pla2bu = new TH2F("h2pla2bu", "XY hits on TOF700 plane 2B, upper row", 300, -150, 150, 170, -85, +85);
1452 TH2F* h2pla2abc =
1453 new TH2F("h2pla2abc", "XY hits on TOF700 plane 2A & 2B, central row", 300, -150, 150, 170, -85, +85);
1454
1455 TH1F* hplatrz = new TH1F("hplatrz", "Z matched hits coordinates TOF700 planes", 100, 600, 650);
1456 TH1F* hplatr = new TH1F("hplatr", "X matched hits on all TOF700 planes", 300, -150, 150);
1457 TH1F* hplatr1a = new TH1F("hplatr1a", "X matched hits on TOF700 plane 1A", 300, -150, 150);
1458 TH1F* hplatr1b = new TH1F("hplatr1b", "X matched hits on TOF700 plane 1B", 300, -150, 150);
1459 TH1F* hplatr2ac = new TH1F("hplatr2ac", "X matched hits on TOF700 plane 2A, central row", 300, -150, 150);
1460 TH1F* hplatr2au = new TH1F("hplatr2au", "X matched hits on TOF700 plane 2A, upper row", 300, -150, 150);
1461 TH1F* hplatr2bc = new TH1F("hplatr2bc", "X matched hits on TOF700 plane 2B, central row", 300, -150, 150);
1462 TH1F* hplatr2bu = new TH1F("hplatr2bu", "X matched hits on TOF700 plane 2B, upper row", 300, -150, 150);
1463 TH1F* hplatr2abc = new TH1F("hplatr2abc", "X matched hits on TOF700 plane 2A & 2B, central row", 300, -150, 150);
1464
1465 TH1F* hplaeffz = new TH1F("hplaeffz", "Z efficiency (hits) TOF700 planes", 100, 600, 650);
1466 TH1F* hplaeff = new TH1F("hplaeff", "X efficiency (hits) on all TOF700 planes", 300, -150, 150);
1467 TH1F* hplaeff1a = new TH1F("hplaeff1a", "X efficiency (hits) on TOF700 plane 1A", 300, -150, 150);
1468 TH1F* hplaeff1b = new TH1F("hplaeff1b", "X efficiency (hits) on TOF700 plane 1B", 300, -150, 150);
1469 TH1F* hplaeff2ac = new TH1F("hplaeff2ac", "X efficiency (hits) on TOF700 plane 2A, central row", 300, -150, 150);
1470 TH1F* hplaeff2au = new TH1F("hplaeff2au", "X efficiency (hits) on TOF700 plane 2A, upper row", 300, -150, 150);
1471 TH1F* hplaeff2bc = new TH1F("hplaeff2bc", "X efficiency (hits) on TOF700 plane 2B, central row", 300, -150, 150);
1472 TH1F* hplaeff2bu = new TH1F("hplaeff2bu", "X efficiency (hits) on TOF700 plane 2B, upper row", 300, -150, 150);
1473 TH1F* hplaeff2abc =
1474 new TH1F("hplaeff2abc", "X efficiency (hits) on TOF700 plane 2A & 2B, central row", 300, -150, 150);
1475
1476 TH1F* hplatraz = new TH1F("hplatraz", "Z tracks coordinates TOF700 planes", 100, 600, 650);
1477 TH1F* hplatra = new TH1F("hplatra", "X tracks on all TOF700 planes", 300, -150, 150);
1478 TH1F* hplatra1a = new TH1F("hplatra1a", "X tracks on TOF700 plane 1A", 300, -150, 150);
1479 TH1F* hplatra1b = new TH1F("hplatra1b", "X tracks on TOF700 plane 1B", 300, -150, 150);
1480 TH1F* hplatra2ac = new TH1F("hplatra2ac", "X tracks on TOF700 plane 2A, central row", 300, -150, 150);
1481 TH1F* hplatra2au = new TH1F("hplatra2au", "X tracks on TOF700 plane 2A, upper row", 300, -150, 150);
1482 TH1F* hplatra2bc = new TH1F("hplatra2bc", "X tracks on TOF700 plane 2B, central row", 300, -150, 150);
1483 TH1F* hplatra2bu = new TH1F("hplatra2bu", "X tracks on TOF700 plane 2B, upper row", 300, -150, 150);
1484 TH1F* hplatra2abc = new TH1F("hplatra2abc", "X tracks on TOF700 plane 2A & 2B, central row", 300, -150, 150);
1485
1486 TH1F* hplatramz = new TH1F("hplatramz", "Z matched tracks coordinates TOF700 planes", 100, 600, 650);
1487 TH1F* hplatram = new TH1F("hplatram", "X matched tracks on all TOF700 planes", 300, -150, 150);
1488 TH1F* hplatram1a = new TH1F("hplatram1a", "X matched tracks on TOF700 plane 1A", 300, -150, 150);
1489 TH1F* hplatram1b = new TH1F("hplatram1b", "X matched tracks on TOF700 plane 1B", 300, -150, 150);
1490 TH1F* hplatram2ac = new TH1F("hplatram2ac", "X matched tracks on TOF700 plane 2A, central row", 300, -150, 150);
1491 TH1F* hplatram2au = new TH1F("hplatram2au", "X matched tracks on TOF700 plane 2A, upper row", 300, -150, 150);
1492 TH1F* hplatram2bc = new TH1F("hplatram2bc", "X matched tracks on TOF700 plane 2B, central row", 300, -150, 150);
1493 TH1F* hplatram2bu = new TH1F("hplatram2bu", "X matched tracks on TOF700 plane 2B, upper row", 300, -150, 150);
1494 TH1F* hplatram2abc =
1495 new TH1F("hplatram2abc", "X matched tracks on TOF700 plane 2A & 2B, central row", 300, -150, 150);
1496
1497 TH1F* hplaeffaz = new TH1F("hplaeffaz", "Z efficiency (tracks) TOF700 planes", 100, 600, 650);
1498 TH1F* hplaeffa = new TH1F("hplaeffa", "X efficiency (tracks) on all TOF700 planes", 300, -150, 150);
1499 TH1F* hplaeffa1a = new TH1F("hplaeffa1a", "X efficiency (tracks) on TOF700 plane 1A", 300, -150, 150);
1500 TH1F* hplaeffa1b = new TH1F("hplaeffa1b", "X efficiency (tracks) on TOF700 plane 1B", 300, -150, 150);
1501 TH1F* hplaeffa2ac =
1502 new TH1F("hplaeffa2ac", "X efficiency (tracks) on TOF700 plane 2A, central row", 300, -150, 150);
1503 TH1F* hplaeffa2au = new TH1F("hplaeffa2au", "X efficiency (tracks) on TOF700 plane 2A, upper row", 300, -150, 150);
1504 TH1F* hplaeffa2bc =
1505 new TH1F("hplaeffa2bc", "X efficiency (tracks) on TOF700 plane 2B, central row", 300, -150, 150);
1506 TH1F* hplaeffa2bu = new TH1F("hplaeffa2bu", "X efficiency (tracks) on TOF700 plane 2B, upper row", 300, -150, 150);
1507 TH1F* hplaeffa2abc =
1508 new TH1F("hplaeffa2abc", "X efficiency (tracks) on TOF700 plane 2A & 2B, central row", 300, -150, 150);
1509
1510 // Fragments tree
1511
1512 TTree* tfr = new TTree("tfr", "Tree with fragments");
1513 Int_t nurun = 0, nuev = 0, tri = 0, tar = 0;
1514 Double_t pfr = 0., yfr = 0., ptfr = 0., efr = 0., pxfr = 0., pyfr = 0., pzfr = 0., bfr = 0., m2fr = 0.;
1515 Double_t x700fr = 0., y700fr = 0.;
1516 tfr->Branch("x700fr", &x700fr, "x700fr/D");
1517 tfr->Branch("y700fr", &y700fr, "y700fr/D");
1518 tfr->Branch("m2fr", &m2fr, "m2fr/D");
1519 tfr->Branch("pxfr", &pxfr, "px/D");
1520 tfr->Branch("pyfr", &pyfr, "py/D");
1521 tfr->Branch("pzfr", &pzfr, "pz/D");
1522 tfr->Branch("pfr", &pfr, "pfr/D");
1523 tfr->Branch("yfr", &yfr, "yfr/D");
1524 tfr->Branch("ptfr", &ptfr, "ptfr/D");
1525 tfr->Branch("bfr", &bfr, "bfr/D");
1526 tfr->Branch("efr", &efr, "efr/D");
1527 tfr->Branch("tri", &tri, "tri/i");
1528 tfr->Branch("tar", &tar, "tar/i");
1529 tfr->Branch("nurun", &nurun, "nurun/i");
1530 tfr->Branch("nuev", &nuev, "nuev/i");
1531 //
1532 TH1D* hdtx = new TH1D("hdtx", "dtx", 100, -0.25, +0.25);
1533 TH1D* hdty = new TH1D("hdty", "dty", 100, -0.25, +0.25);
1534 TH1D* hDdx = new TH1D("hDdx", "Err dx", 100, 0, 10);
1535 TH1D* hDdy = new TH1D("hDdy", "Err dy", 100, 0, 10);
1536 TH1D* hDdtx = new TH1D("hDdtx", "Err dtx", 100, 0, 0.05);
1537 TH1D* hDdty = new TH1D("hDdty", "Err dty", 100, 0, 0.05);
1538 TH1D* hpdx = new TH1D("hpdx", "Pull dx", 500, -2.5, +2.5);
1539 TH1D* hpdy = new TH1D("hpdy", "Pull dy", 500, -2.5, +2.5);
1540 TH1D* hpdtx = new TH1D("hpdtx", "Pull dtx", 500, -25., +25.);
1541 TH1D* hpdty = new TH1D("hpdty", "Pull dty", 500, -25., +25.);
1542 TH1D* hchi2m = new TH1D("hChi2m", "Chi2 GemDch track", 1000, 0, 100);
1543 TH1D* hchi2 = new TH1D("hchi2", "Chi2 tracks matching", 1000, 0, 100);
1544
1545 TProfile2D* tcalibrs = new TProfile2D("tcalibr", "Time calibration based on proton mass, strips", NUMBER_CHAMBERS,
1546 0, NUMBER_CHAMBERS, 32, 0, 32, -1., +1., "e");
1547 TProfile* tcalibrc = new TProfile("tcalibrc", "Time calibration based on proton mass, chambers", NUMBER_CHAMBERS, 0,
1548 NUMBER_CHAMBERS, -1., +1., "e");
1549
1550 TProfile* tpeak = new TProfile("tpeak", "Peak time vs chamber", NUMBER_CHAMBERS, 0, NUMBER_CHAMBERS, 0., +30., "e");
1551 TProfile* bpeak =
1552 new TProfile("bpeak", "Peak velosity vs chamber", NUMBER_CHAMBERS, 0, NUMBER_CHAMBERS, 0., +1.5, "e");
1553
1554 char nam[64], tit[64];
1555
1556 float cvel = 29.97925f;
1557 float ekin = 3.2f, ebeam = ekin + MP, pbeam = TMath::Sqrt(ebeam * ebeam + MP * MP);
1558 float cbeam = pbeam / ebeam;
1559 float cpeak = cbeam * CFACTOR * cvel;
1560 float ztarg = 0.f; //-2.2f;
1561 float zca[NUMBER_CHAMBERS] = {0.f};
1562 for (int i = 0; i < NUMBER_CHAMBERS; i++) {
1563 TOF2->get_chamber_z(i, &zca[i]);
1564 }
1565
1566 Int_t startEvent = 0;
1567 Int_t nEvents = bmnTree->GetEntries();
1568 Int_t nEventstof700 = bmnTreetof700->GetEntries();
1569 printf("\nNumber of events in tracks chain is %d (tof700 chain %d)\n", nEvents, nEventstof700);
1570
1571 int Ntr = 0, Ntr1 = 0, Ntr1g = 0, Ntr2g = 0, Ntr0 = 0, Ntr02 = 0;
1572 Int_t iEv = 0, iEvtof700 = 0, fCurrent = -1, nevs = 0;
1573 UInt_t trackEvId = 0, tof700EvId = 0;
1574 UInt_t trackRunId = 0, tof700RunId = 0;
1575 TH1D *projtmp = 0, *projtmp1 = 0;
1576 for (Int_t iEv0 = startEvent; iEv0 < startEvent + nEvents; iEv0++) {
1577 if (iEv % 10000 == 0) {
1578 cout << "Event: " << iEv << "/" << startEvent + nEvents << " ( Run " << trackRunId << " EvId " << trackEvId
1579 << " )" << endl;
1580 }
1581 BmnGemDchTrack* gemdchtrack0 = NULL;
1582 do {
1583 if (iEv >= nEvents)
1584 break;
1585 bmnTree->GetEntry(iEv);
1586 if (mtracks == NULL) {
1587 iEv++;
1588 continue;
1589 };
1590 gemdchtrack0 = (BmnGemDchTrack*)(mtracks->UncheckedAt(0));
1591 // gemdchtrack0 = (BmnGemDchTrack*)(mtracks->At(0));
1592 // printf("First attempt, iEv = %d, iEv0 = %d\n",iEv,iEv0);
1593 iEv++;
1594 } while (gemdchtrack0 == NULL);
1595 // printf("Point 0, iEv = %d\n",iEv);
1596 if (iEv >= nEvents)
1597 break;
1598 // trackEvId = gemdchtrack0->GetEventId();
1599 trackEvId = ((BmnEventHeader*)eventHeader)->GetEventId();
1600 // printf("Point 1, iEv = %d, trackEvId = %d\n",iEv,trackEvId);
1601 if (eventHeader == NULL)
1602 continue;
1603 // trackRunId = ((BmnEventHeader*)eventHeader->UncheckedAt(0))->GetRunId();
1604 trackRunId = ((BmnEventHeader*)eventHeader)->GetRunId();
1605 // printf("Point 2, iEv = %d, trackRunId = %d\n",iEv,trackRunId);
1606 if (tof700RunId == trackRunId && tof700EvId > trackEvId)
1607 continue;
1608 if (tof700RunId > trackRunId)
1609 continue;
1610 // printf("Point 3, iEv = %d\n",iEv);
1611 if (!(tof700EvId == trackEvId && tof700RunId == trackRunId)) {
1612 do {
1613 bmnTreetof700->GetEntry(iEvtof700);
1614 if (eventHeadertof700 == NULL)
1615 break;
1616 tof700EvId = eventHeadertof700->GetEventId();
1617 // tof700RunId = ((BmnEventHeader*) eventHeadertof700->UncheckedAt(0))->GetRunId();
1618 tof700RunId = eventHeadertof700->GetRunId();
1619 // tof700EvId = ((BmnEventHeader*) eventHeadertof700->UncheckedAt(0))->GetEventId();
1620 // tof700RunId = ((BmnEventHeader*) eventHeadertof700->UncheckedAt(0))->GetRunId();
1621 // cout << "Tracks Event: " << iEv << ", TOF700 Event: " << iEvtof700 << endl;
1622 // cout << "Tracks EventId: " << trackEvId << ", TOF700 EventId: " << tof700EvId << endl;
1623 // cout << "Tracks RunId: " << trackRunId << ", TOF700 RunId: " << tof700RunId << endl;
1624 iEvtof700++;
1625 if (iEvtof700 >= nEventstof700)
1626 break;
1627 if (tof700RunId > trackRunId)
1628 break;
1629 if (tof700RunId == trackRunId && tof700EvId > trackEvId)
1630 break;
1631 } while (!(tof700EvId == trackEvId && tof700RunId == trackRunId));
1632 }
1633 if (eventHeadertof700 == NULL)
1634 continue;
1635 if (!(tof700EvId == trackEvId && tof700RunId == trackRunId)) {
1636 cout << "Not found EventId " << trackEvId << " in tof700 digits file" << endl;
1637 cout << "Tracks Event: " << iEv << ", TOF700 Event: " << iEvtof700 << endl;
1638 cout << "Tracks RunId: " << trackRunId << ", TOF700 RunId: " << tof700RunId << endl;
1639 cout << "Tracks EventId: " << trackEvId << ", TOF700 EventId: " << tof700EvId << endl;
1640 if (iEvtof700 >= nEventstof700)
1641 break;
1642 if (tof700RunId > trackRunId)
1643 continue;
1644 if (tof700RunId == trackRunId && tof700EvId > trackEvId)
1645 continue;
1646 break;
1647 // continue;
1648 }
1649
1650 // Skip zero field data
1651 if (fSp41[trackRunId] <= 0)
1652 continue;
1653
1654 tar = Ntar[trackRunId];
1655 htarget->Fill(tar);
1656 // if (true) continue;
1657
1658 float wmax[NUMBER_CHAMBERS] = {0.};
1659 float tmax[NUMBER_CHAMBERS] = {-10000000.};
1660 int smax[NUMBER_CHAMBERS] = {-1};
1661 int smax1[NUMBER_CHAMBERS] = {-1};
1662 int istr[NUMBER_CHAMBERS] = {-1};
1663
1664 for (int i = 0; i < NUMBER_CHAMBERS; i++) {
1665 wmax[i] = 0.;
1666 tmax[i] = -1000000.;
1667 smax[i] = -1;
1668 smax1[i] = -1;
1669 nhit[i] = 0;
1670 for (int j = 0; j < 32; j++)
1671 nhits[i][j] = 0;
1672 for (int j = 0; j < 32; j++)
1673 tofWidths[i][j] = 0.;
1674 for (int j = 0; j < 32; j++)
1675 tof[i][j] = 0.;
1676 }
1677 nhi = 0;
1678
1679 int ntof = tof700Digits->GetEntriesFast();
1680 hntof->Fill(ntof);
1681 float x = 0., y = 0., z = 0.;
1682 int hchamb[1000] = {0}, hstrip[1000] = {0};
1683 int clchamb[1000] = {0}, clstrip[1000] = {0};
1684 Float_t clwid[1000] = {0};
1685 Bool_t usedstrip[1000] = {false};
1686 Bool_t usedstrip1[1000] = {false};
1687 Bool_t usedstrip2[1000] = {false};
1688 Bool_t usedtrack[1000] = {false};
1689 Bool_t usedtrack1[1000] = {false};
1690 Bool_t usedtrack2[1000] = {false};
1691 Int_t numhit[NUMBER_CHAMBERS][32] = {{0}};
1692 for (Int_t iDig = 0; iDig < ntof; ++iDig) {
1693 BmnTof2Digit* digit = (BmnTof2Digit*)tof700Digits->At(iDig);
1694 if (digit == NULL)
1695 continue;
1696 Short_t plane = digit->GetPlane();
1697 Short_t strip = digit->GetStrip();
1698 Float_t time = digit->GetTime();
1699 // if (plane == 8) time -= 40.69f; // Chamber 5.1
1700 Float_t width = digit->GetAmplitude();
1701 Float_t lrdiff = digit->GetDiff();
1702 // if (iEv % 10 == 0) cout << "plane = " << plane << " strip = " << strip << " time = " << time <<
1703 // " width = " << width << endl; if (iEv % 10 == 0) cout << "wmi = " << wmi[plane] << " wma = "
1704 // << wma[plane] << endl;
1705 if (plane >= NUMBER_CHAMBERS)
1706 continue;
1707 if (XYPANIN && (TOF2->get_hit_xp(plane, strip, lrdiff) == 0.))
1708 continue;
1709 // if (lrdiff < -0.5 || lrdiff > 0.5) continue;
1710 if (IN_WIDTH_LIMITS)
1711 if (width < wmi[plane] || width > wma[plane])
1712 continue;
1713
1714 if (XYPANIN)
1715 TOF2->get_hit_xyzp(plane, strip, lrdiff, &x, &y, &z);
1716 else if (XYPETNEW) {
1717 TOF2->get_hit_xyzng(plane, strip, lrdiff, &x, &y, &z);
1718 if (z == 0.)
1719 TOF2->get_hit_xyz(plane, strip, lrdiff, &x, &y, &z);
1720 if (z == 0.)
1721 continue;
1722 } else
1723 TOF2->get_hit_xyz(plane, strip, lrdiff, &x, &y, &z);
1724
1725 htof->Fill(time);
1726 hchamb[nhi] = plane;
1727 hstrip[nhi] = strip;
1728 smax1[plane] = strip;
1729 if (width > wmax[plane]) {
1730 wmax[plane] = width;
1731 tmax[plane] = time;
1732 smax[plane] = strip;
1733 }
1734 nhit[plane]++;
1735 nhits[plane][strip]++;
1736 tof[plane][strip] = time;
1737 tofWidths[plane][strip] = width;
1738 istr[plane] = strip;
1739
1740 xhi[nhi] = x;
1741 yhi[nhi] = y;
1742 zhi[nhi] = z;
1743 lrd[nhi] = lrdiff;
1744 hxytof->Fill(x, y);
1745 /*
1746 hplaz->Fill(z);
1747 hpla->Fill(x);
1748 if (z < 600) hpla1a->Fill(x);
1749 if (z > 605 && z < 610) hpla1b->Fill(x);
1750 if (z > 625 && z < 630 && y < 20) hpla2ac->Fill(x);
1751 if (z > 625 && z < 630 && y > 20) hpla2au->Fill(x);
1752 if (z > 635 && z < 660 && y < 20) hpla2bc->Fill(x);
1753 if (z > 635 && z < 660 && y > 20) hpla2bu->Fill(x);
1754 if (z > 625 && z < 660 && y < 20) hpla2abc->Fill(x);
1755 */
1756 TOF2->get_strip_xyz(plane, strip, &x, &y, &z);
1757 xhic[nhi] = x;
1758 yhic[nhi] = y;
1759 zhic[nhi] = z;
1760 hstr->Fill(strip);
1761 hcha->Fill(plane);
1762 numhit[plane][strip] = nhi;
1763 nhi++;
1764 } // tof700Digits loop
1765 hnhit->Fill(nhi);
1766 // Clusterization
1767 int ncl0 = 0, ncl[NUMBER_CHAMBERS] = {0}, ncls = 0, nclb = 0;
1768 int ncln = 0, nclsn = 0;
1769 Float_t tcl[NUMBER_CHAMBERS][32] = {{0}};
1770 Int_t acl[NUMBER_CHAMBERS][32] = {{0}};
1771 Int_t wcl[NUMBER_CHAMBERS][32] = {{0}};
1772 if (USE_CLUSTERS) {
1773 for (int i = 0; i < NUMBER_CHAMBERS; i++) {
1774 ncl[i] = 0;
1775 // if (nhit[i] == 0) continue;
1776 int clstart = -1, clwidth = -1, cstr = -1;
1777 float samps = 0., timemin = 1000000000.;
1778 float widthmax = 0.;
1779 int nstr = 32;
1780 if (idchambers[i] > 100.f)
1781 nstr = 16;
1782 for (int j = 0; j < nstr; j++) {
1783 // if (nhits[i][j] == 0) continue;
1784 if (tofWidths[i][j] > 0.) {
1785 // if (idchambers[i] != 19.3) xystrip(hxyhits, i, j);
1786 if (clstart < 0) {
1787 clstart = j;
1788 cstr = j;
1789 timemin = tof[i][j];
1790 widthmax = tofWidths[i][j];
1791 } else {
1792 if (MINTIME) {
1793 if (tof[i][j] < timemin) {
1794 timemin = tof[i][j];
1795 cstr = j;
1796 }
1797 } else {
1798 if (tofWidths[i][j] > widthmax) {
1799 widthmax = tofWidths[i][j];
1800 cstr = j;
1801 }
1802 }
1803 }
1804 samps += tofWidths[i][j];
1805 if (idchambers[i] < 100.f)
1806 hclamps->Fill(idchambers[i] != 19.3 ? (Int_t)idchambers[i] : 49, tofWidths[i][j]);
1807 else
1808 hclampb->Fill((Int_t)idchambers[i] - 100, tofWidths[i][j]);
1809 if (j == (nstr - 1)) {
1810 clchamb[ncl0] = i;
1811 clstrip[ncl0] = cstr;
1812 clwid[ncl0] = samps;
1813 clwidth = (j + 1 - clstart);
1814 tcl[i][ncl[i]] = timemin;
1815 acl[i][ncl[i]] = samps;
1816 wcl[i][ncl[i]] = clwidth;
1817 ncl0++;
1818 ncl[i]++;
1819 samps = 0.;
1820 timemin = 1000000000.;
1821 widthmax = 0.;
1822 int ih = numhit[i][cstr];
1823 if (idchambers[i] < 100.f)
1824 hclnums->Fill(clwidth);
1825 else
1826 hclnumb->Fill(clwidth);
1827 if (idchambers[i] < 100.f)
1828 hclwids->Fill(idchambers[i] != 19.3 ? (Int_t)idchambers[i] : 49, samps);
1829 else
1830 hclwidb->Fill((Int_t)idchambers[i] - 100, samps);
1831 hxycluster->Fill(xhi[ih], yhi[ih]);
1832 if (idchambers[i] == 19.3)
1833 continue;
1834 xystrip(hxystrips, i, cstr);
1835 hplaz->Fill(zhi[numhit[i][cstr]]);
1836 hpla->Fill(xhi[numhit[i][cstr]]);
1837 if (zhi[numhit[i][cstr]] < 600)
1838 hpla1a->Fill(xhi[numhit[i][cstr]]);
1839 if (zhi[numhit[i][cstr]] > 605 && zhi[numhit[i][cstr]] < 610)
1840 hpla1b->Fill(xhi[numhit[i][cstr]]);
1841 if (zhi[numhit[i][cstr]] > 625 && zhi[numhit[i][cstr]] < 630 && yhi[numhit[i][cstr]] < 20)
1842 hpla2ac->Fill(xhi[numhit[i][cstr]]);
1843 if (zhi[numhit[i][cstr]] > 625 && zhi[numhit[i][cstr]] < 630 && yhi[numhit[i][cstr]] > 20)
1844 hpla2au->Fill(xhi[numhit[i][cstr]]);
1845 if (zhi[numhit[i][cstr]] > 635 && zhi[numhit[i][cstr]] < 660 && yhi[numhit[i][cstr]] < 20)
1846 hpla2bc->Fill(xhi[numhit[i][cstr]]);
1847 if (zhi[numhit[i][cstr]] > 635 && zhi[numhit[i][cstr]] < 660 && yhi[numhit[i][cstr]] > 20)
1848 hpla2bu->Fill(xhi[numhit[i][cstr]]);
1849 if (zhi[numhit[i][cstr]] > 625 && zhi[numhit[i][cstr]] < 660 && yhi[numhit[i][cstr]] < 20)
1850 hpla2abc->Fill(xhi[numhit[i][cstr]]);
1851 if (zhi[numhit[i][cstr]] < 600)
1852 h2pla1a->Fill(xhi[numhit[i][cstr]], yhi[numhit[i][cstr]]);
1853 if (zhi[numhit[i][cstr]] > 605 && zhi[numhit[i][cstr]] < 610)
1854 h2pla1b->Fill(xhi[numhit[i][cstr]], yhi[numhit[i][cstr]]);
1855 if (zhi[numhit[i][cstr]] > 625 && zhi[numhit[i][cstr]] < 630 && yhi[numhit[i][cstr]] < 20)
1856 h2pla2ac->Fill(xhi[numhit[i][cstr]], yhi[numhit[i][cstr]]);
1857 if (zhi[numhit[i][cstr]] > 625 && zhi[numhit[i][cstr]] < 630 && yhi[numhit[i][cstr]] > 20)
1858 h2pla2au->Fill(xhi[numhit[i][cstr]], yhi[numhit[i][cstr]]);
1859 if (zhi[numhit[i][cstr]] > 635 && zhi[numhit[i][cstr]] < 660 && yhi[numhit[i][cstr]] < 20)
1860 h2pla2bc->Fill(xhi[numhit[i][cstr]], yhi[numhit[i][cstr]]);
1861 if (zhi[numhit[i][cstr]] > 635 && zhi[numhit[i][cstr]] < 660 && yhi[numhit[i][cstr]] > 20)
1862 h2pla2bu->Fill(xhi[numhit[i][cstr]], yhi[numhit[i][cstr]]);
1863 if (zhi[numhit[i][cstr]] > 625 && zhi[numhit[i][cstr]] < 660 && yhi[numhit[i][cstr]] < 20)
1864 h2pla2abc->Fill(xhi[numhit[i][cstr]], yhi[numhit[i][cstr]]);
1865 }
1866 } else if (clstart >= 0) {
1867 clchamb[ncl0] = i;
1868 clstrip[ncl0] = cstr;
1869 clwid[ncl0] = samps;
1870 clwidth = (j - clstart);
1871 tcl[i][ncl[i]] = timemin;
1872 acl[i][ncl[i]] = samps;
1873 wcl[i][ncl[i]] = clwidth;
1874 ncl0++;
1875 ncl[i]++;
1876 samps = 0.;
1877 timemin = 1000000000.;
1878 widthmax = 0.;
1879 clstart = -1;
1880 int ih = numhit[i][cstr];
1881 if (idchambers[i] < 100.f)
1882 hclnums->Fill(clwidth);
1883 else
1884 hclnumb->Fill(clwidth);
1885 if (idchambers[i] < 100.f)
1886 hclwids->Fill(idchambers[i] != 19.3 ? (Int_t)idchambers[i] : 49, samps);
1887 else
1888 hclwidb->Fill((Int_t)idchambers[i] - 100, samps);
1889 hxycluster->Fill(xhi[ih], yhi[ih]);
1890 if (idchambers[i] == 19.3)
1891 continue;
1892 xystrip(hxystrips, i, cstr);
1893 hplaz->Fill(zhi[numhit[i][cstr]]);
1894 hpla->Fill(xhi[numhit[i][cstr]]);
1895 if (zhi[numhit[i][cstr]] < 600)
1896 hpla1a->Fill(xhi[numhit[i][cstr]]);
1897 if (zhi[numhit[i][cstr]] > 605 && zhi[numhit[i][cstr]] < 610)
1898 hpla1b->Fill(xhi[numhit[i][cstr]]);
1899 if (zhi[numhit[i][cstr]] > 625 && zhi[numhit[i][cstr]] < 630 && yhi[numhit[i][cstr]] < 20)
1900 hpla2ac->Fill(xhi[numhit[i][cstr]]);
1901 if (zhi[numhit[i][cstr]] > 625 && zhi[numhit[i][cstr]] < 630 && yhi[numhit[i][cstr]] > 20)
1902 hpla2au->Fill(xhi[numhit[i][cstr]]);
1903 if (zhi[numhit[i][cstr]] > 635 && zhi[numhit[i][cstr]] < 660 && yhi[numhit[i][cstr]] < 20)
1904 hpla2bc->Fill(xhi[numhit[i][cstr]]);
1905 if (zhi[numhit[i][cstr]] > 635 && zhi[numhit[i][cstr]] < 660 && yhi[numhit[i][cstr]] > 20)
1906 hpla2bu->Fill(xhi[numhit[i][cstr]]);
1907 if (zhi[numhit[i][cstr]] > 625 && zhi[numhit[i][cstr]] < 660 && yhi[numhit[i][cstr]] < 20)
1908 hpla2abc->Fill(xhi[numhit[i][cstr]]);
1909 if (zhi[numhit[i][cstr]] < 600)
1910 h2pla1a->Fill(xhi[numhit[i][cstr]], yhi[numhit[i][cstr]]);
1911 if (zhi[numhit[i][cstr]] > 605 && zhi[numhit[i][cstr]] < 610)
1912 h2pla1b->Fill(xhi[numhit[i][cstr]], yhi[numhit[i][cstr]]);
1913 if (zhi[numhit[i][cstr]] > 625 && zhi[numhit[i][cstr]] < 630 && yhi[numhit[i][cstr]] < 20)
1914 h2pla2ac->Fill(xhi[numhit[i][cstr]], yhi[numhit[i][cstr]]);
1915 if (zhi[numhit[i][cstr]] > 625 && zhi[numhit[i][cstr]] < 630 && yhi[numhit[i][cstr]] > 20)
1916 h2pla2au->Fill(xhi[numhit[i][cstr]], yhi[numhit[i][cstr]]);
1917 if (zhi[numhit[i][cstr]] > 635 && zhi[numhit[i][cstr]] < 660 && yhi[numhit[i][cstr]] < 20)
1918 h2pla2bc->Fill(xhi[numhit[i][cstr]], yhi[numhit[i][cstr]]);
1919 if (zhi[numhit[i][cstr]] > 635 && zhi[numhit[i][cstr]] < 660 && yhi[numhit[i][cstr]] > 20)
1920 h2pla2bu->Fill(xhi[numhit[i][cstr]], yhi[numhit[i][cstr]]);
1921 if (zhi[numhit[i][cstr]] > 625 && zhi[numhit[i][cstr]] < 660 && yhi[numhit[i][cstr]] < 20)
1922 h2pla2abc->Fill(xhi[numhit[i][cstr]], yhi[numhit[i][cstr]]);
1923 }
1924 }
1925 if (idchambers[i] < 100.f)
1926 hnclvschambs->Fill(idchambers[i] != 19.3 ? (Int_t)idchambers[i] : 49, ncl[i]);
1927 else
1928 hnclvschambb->Fill((Int_t)idchambers[i] - 100, ncl[i]);
1929 if (idchambers[i] < 100.f)
1930 hnclvschambs1->Fill(idchambers[i] != 19.3 ? (Int_t)idchambers[i] : 49, ncl[i]);
1931 else
1932 hnclvschambb1->Fill((Int_t)idchambers[i] - 100, ncl[i]);
1933
1934 if (idchambers[i] < 100.f)
1935 ncls += ncl[i];
1936 else
1937 nclb += ncl[i];
1938 if ((int)idchambers[i] != 19)
1939 ncln += ncl[i];
1940 if (idchambers[i] < 100.f && (int)idchambers[i] != 19)
1941 nclsn += ncl[i];
1942 }
1943 hncl->Fill(ncl0);
1944 hncls->Fill(ncls);
1945 hnclb->Fill(nclb);
1946 hncln->Fill(ncln);
1947 hnclsn->Fill(nclsn);
1948 }
1949 //
1950 float xyz[3] = {0.}, cxyz[3] = {0.}, xrpc = 0., yrpc = 0., dz = 100., tx = 0., ty = 0., zcha = 0., tx0 = 0.;
1951 float xrpcm = 0., yrpcm = 0., zrpcm = 0.;
1952 float xrpcm1 = 0., yrpcm1 = 0., zrpcm1 = 0.;
1953 Int_t crpc1 = -1, crpc2 = -1;
1954 float txdch = 0., tydch = 0., xyzdch[3] = {0.}, cxyzdch[3] = {0.};
1955 float beta = 1.0f, mass = 1.0f, mass2 = 1.0f, tcor = 0., tcorc = 0., tcors = 0., tcorspi = 0., tcorcpi = 0.;
1956 int nh = 0;
1957 int ntr = mtracks->GetEntriesFast();
1958 hntr->Fill(ntr);
1959 Ntr += ntr;
1960 int ntr0 = 0, ntr02 = 0;
1961 int ntr1 = 0, ntr1g = 0, ntr2g = 0;
1962 int iflag = 0, igem = 0, idch = 0;
1963 float chi2 = 0.f;
1964 BmnGemDchTrack* gemdchtrack = NULL;
1965 BmnTrack* track = NULL;
1966#if GEMTYPE > 2
1967 BmnTrack* gtrack = NULL; // Merts GEM tracks
1968#else
1969 CbmStsTrack* gtrack = NULL; // Gleb GEM tracks
1970#endif
1971 Bool_t gooddch = false, goodgem = false, goodgemdch = false, gooddchtof = false, goodgemdchtof = false,
1972 goodgemtof = false;
1973 Bool_t goodgemdch2 = false, goodgemdchtof2 = false;
1974 Double_t xGem = 0.;
1975 Double_t xGem0 = 0.;
1976 Double_t yGem = 0.;
1977 Double_t zGem = 0.;
1978 Double_t txGem = 0.;
1979 Double_t tyGem = 0.;
1980 Double_t xGem1st = 0.;
1981 Double_t yGem1st = 0.;
1982 Double_t zGem1st = 0.;
1983 Double_t txGem1st = 0.;
1984 Double_t tyGem1st = 0.;
1985 Double_t QpGem = 0.;
1986 Double_t QpDch = 0.;
1987 Int_t nGemHits = 0;
1988 Int_t nSiHits = 0;
1989 Double_t Xpv = 0.;
1990 Double_t Ypv = 0.;
1991 Double_t dxm = 0.;
1992 Double_t dym = 0.;
1993 Double_t dtx = 0.;
1994 Double_t dty = 0.;
1995 Double_t Ddx = 0.;
1996 Double_t Ddy = 0.;
1997 Double_t Ddtx = 0.;
1998 Double_t Ddty = 0.;
1999 Double_t Chi2m = 0.;
2000 Double_t xgoodtr = 0.;
2001 Double_t ygoodtr = 0.;
2002 Double_t xgoodtr1 = 0.;
2003 Double_t ygoodtr1 = 0.;
2004 Double_t le = 0., p = 0., ps = 0., pmod = 0., lenr = 0.;
2005 int himin = -1, himin1 = -1, himin2 = -1;
2006
2007 // TOF700 matching variables
2008
2009 Int_t Npairs = 0, Npairs1 = 0, Npairs2 = 0;
2010 Int_t Ihit[MAX_NPAIRS] = {-1}, Ihit1[MAX_NPAIRS] = {-1}, Ihit2[MAX_NPAIRS] = {-1};
2011 // Int_t Igem[MAX_NPAIRS] = {-1}, Igem1[MAX_NPAIRS] = {-1}, Igem2[MAX_NPAIRS] = {-1};
2012 // Int_t Idch[MAX_NPAIRS] = {-1}, Idch1[MAX_NPAIRS] = {-1}, Idch2[MAX_NPAIRS] = {-1};
2013 Int_t Isort[MAX_NPAIRS] = {0}, Isort1[MAX_NPAIRS] = {0}, Isort2[MAX_NPAIRS] = {0};
2014 Int_t Itrack[MAX_NPAIRS] = {0}, Itrack1[MAX_NPAIRS] = {0}, Itrack2[MAX_NPAIRS] = {0};
2015 Double_t Dpairs[MAX_NPAIRS] = {0}, Dpairs1[MAX_NPAIRS] = {0}, Dpairs2[MAX_NPAIRS] = {0};
2016 Double_t Cpairs[MAX_NPAIRS] = {0}, Cpairs1[MAX_NPAIRS] = {0}, Cpairs2[MAX_NPAIRS] = {0};
2017 Double_t Vpairs[MAX_NPAIRS][25] = {{0}}, Vpairs1[MAX_NPAIRS][25] = {{0}}, Vpairs2[MAX_NPAIRS][25] = {{0}};
2018
2019 //
2020
2021 double dx, dy, dl;
2022 double dist = 0., distmin = 1000000000.0f, distmin1 = 1000000000.0f, distmin2 = 1000000000.0f;
2023 Float_t xc, yc, zc;
2024 int ic;
2025 int is;
2026 double cosa = 0.;
2027 float hidist = 0.;
2028 Double_t tofr0 = 0.f;
2029 Double_t tofr = 0.f;
2030 Double_t tofp = 0.f;
2031 Double_t tofpi = 0.f;
2032 float massmin1 = 0.;
2033 float massmax1 = 0.;
2034 float massmin2 = 0.;
2035 float massmax2 = 0.;
2036
2037 float massmaxpi = 0.;
2038 float massminpi = 0.;
2039 float tcorpi = 0.;
2040 float tofrc = 0.;
2041 float tofrs = 0.;
2042 float betac = 0.;
2043 float betas = 0.;
2044 float masss2 = 0.;
2045 float masss = 0.;
2046 float massc2 = 0.;
2047 float massc = 0.;
2048 double timepeak = 0., betapeak = 0.;
2049 Bool_t first_track = true;
2050 Int_t ncltr[NUMBER_CHAMBERS] = {0};
2051 Int_t ntrgem = 0, ntrdch0 = 0, ntrdch = 0, ntrgem0 = 0, ntrgemcut = 0;
2052 Double_t xtrgem[100], xtrgem0[100], ytrgem[100], xtrdch[100], ytrdch[100], dxtrgem[100], dytrgem[100],
2053 ztrgem[100], ztrgem1st[100];
2054 Double_t txtrgem[100], tytrgem[100], txtrdch[100], tytrdch[100];
2055 Double_t pgem[100];
2056 for (Int_t iTr = 0; iTr < ntr; ++iTr) {
2057 gemdchtrack = (BmnGemDchTrack*)mtracks->At(iTr);
2058 if (gemdchtrack == NULL)
2059 continue;
2060 track = (BmnTrack*)gemdchtrack->GetDchTrack();
2061 gooddch = false;
2062 if (track != NULL
2063 && (track->GetUniqueID() == 100 || track->GetUniqueID() == 200 || track->GetUniqueID() == 400))
2064 {
2065 if ((FLAG < 0 && track->GetFlag() < 0) || (FLAG > 0 && track->GetFlag() >= 0) || (FLAG == 0)) {
2066 QpDch = track->GetParamLast()->GetQp();
2067 if (!TMath::IsNaN(QpDch) && (track->GetParamLast()->GetZ() > 500.f)
2068 && (track->GetNHits() >= MINDCHHITS))
2069 {
2070 // get xyz and cxyz here
2071 xyz[0] = track->GetParamLast()->GetX() + (DX0DCH) - (DXDCH);
2072 xyz[1] = track->GetParamLast()->GetY() + (DY0DCH) - (DYDCH);
2073 xyz[2] = track->GetParamLast()->GetZ() + (DZ0DCH) - (DZDCH);
2074 tx = track->GetParamLast()->GetTx() + (DTX0DCH) - (DTXDCH);
2075 tx0 = tx;
2076 ty = track->GetParamLast()->GetTy() + (DTY0DCH) - (DTYDCH);
2077 cxyz[0] = tx / TMath::Sqrt(1. + tx * tx + ty * ty);
2078 cxyz[1] = ty / TMath::Sqrt(1. + tx * tx + ty * ty);
2079 cxyz[2] = 1. / TMath::Sqrt(1. + tx * tx + ty * ty);
2080
2081 xyzdch[0] = track->GetParamFirst()->GetX() + (DX0DCH) - (DXDCH);
2082 xyzdch[1] = track->GetParamFirst()->GetY() + (DY0DCH) - (DYDCH);
2083 xyzdch[2] = track->GetParamFirst()->GetZ() + (DZ0DCH) - (DZDCH);
2084 txdch = track->GetParamFirst()->GetTx() + (DTX0DCH) - (DTXDCH);
2085 tydch = track->GetParamFirst()->GetTy() + (DTY0DCH) - (DTYDCH);
2086 cxyzdch[0] = txdch / TMath::Sqrt(1. + txdch * txdch + tydch * tydch);
2087 cxyzdch[1] = tydch / TMath::Sqrt(1. + txdch * txdch + tydch * tydch);
2088 cxyzdch[2] = 1. / TMath::Sqrt(1. + txdch * txdch + tydch * tydch);
2089
2090 ntrdch0++;
2091#if PUREDCH != 0
2092 xyz[0] = xyzdch[0];
2093 xyz[1] = xyzdch[1];
2094 xyz[2] = xyzdch[2];
2095 tx = txdch;
2096 ty = tydch;
2097 cxyz[0] = cxyzdch[0];
2098 cxyz[1] = cxyzdch[1];
2099 cxyz[2] = cxyzdch[2];
2100#endif
2101 xgoodtr = xyz[0];
2102 ygoodtr = xyz[1];
2103 xgoodtr1 = xyzdch[0];
2104 ygoodtr1 = xyzdch[1];
2105 if (ACCEPTANCE) {
2106 Double_t xdch = xgoodtr1 + txdch * (z_tof700_average - xyzdch[2]);
2107 Double_t ydch = ygoodtr1 + tydch * (z_tof700_average - xyzdch[2]);
2108 if (xdch >= xmintof700 && xdch <= xmaxtof700 && ydch >= ymintof700 && ydch <= ymaxtof700) {
2109 hxydch->Fill(xgoodtr, ygoodtr);
2110 hxydch1->Fill(xgoodtr1, ygoodtr1);
2111 gooddch = true;
2112 }
2113 } else {
2114 hxydch->Fill(xgoodtr, ygoodtr);
2115 hxydch1->Fill(xgoodtr1, ygoodtr1);
2116 gooddch = true;
2117 }
2118 }
2119 }
2120 }
2121 if (gooddch) {
2122 xtrdch[ntrdch] = xyzdch[0];
2123 ytrdch[ntrdch] = xyzdch[1];
2124 txtrdch[ntrdch] = txdch;
2125 tytrdch[ntrdch] = tydch;
2126 ntrdch++;
2127 }
2128#if GEMTYPE > 2
2129 gtrack = (BmnTrack*)gemdchtrack->GetGemTrack(); // Merts GEM tracks
2130#else
2131 gtrack = (CbmStsTrack*)gemdchtrack->GetGemTrack(); // Gleb GEM tracks
2132#endif
2133 goodgem = false;
2134 if (gtrack != NULL
2135 && (gtrack->GetUniqueID() == 100 || gtrack->GetUniqueID() == 300 || gtrack->GetUniqueID() == 500))
2136 {
2137 // Selection criteria
2138 QpGem = gtrack->GetParamLast()->GetQp();
2139 if (!TMath::IsNaN(QpGem)) {
2140 if (QpGem != 0. && (gtrack->GetParamLast()->GetZ() > 500.f)) {
2141 hp0->Fill(1. / QpGem);
2142 } else {
2143 // hp0->Fill(0.);
2144 }
2145 // ntr1++;
2146 ntrgem0++;
2147 xGem = gtrack->GetParamLast()->GetX() + (DX0DCH) - (DXDCH);
2148 yGem = gtrack->GetParamLast()->GetY() + (DY0DCH) - (DYDCH);
2149 zGem = gtrack->GetParamLast()->GetZ() + (DZ0DCH) - (DZDCH);
2150 txGem = gtrack->GetParamLast()->GetTx() + (DTX0DCH) - (DTXDCH);
2151 tyGem = gtrack->GetParamLast()->GetTy() + (DTY0DCH) - (DTYDCH);
2152 xGem0 = xGem;
2153 xGem1st = gtrack->GetParamFirst()->GetX();
2154 yGem1st = gtrack->GetParamFirst()->GetY();
2155 zGem1st = gtrack->GetParamFirst()->GetZ();
2156 txGem1st = gtrack->GetParamFirst()->GetTx();
2157 tyGem1st = gtrack->GetParamFirst()->GetTy();
2158#if GEMTYPE > 2
2159 nGemHits = gtrack->GetNHits(); // Merts GEM tracks
2160#else
2161 // nGemHits = gtrack->GetNDF(); // Gleb GEM tracks
2162 nGemHits = gemdchtrack->GetGemHits(); // Gleb GEM tracks
2163 nSiHits = gemdchtrack->GetSiHits(); // Gleb GEM tracks
2164#endif
2165 Xpv = gemdchtrack->GetXpv();
2166 Ypv = gemdchtrack->GetYpv();
2167
2168 if (GEMCUTS) {
2169 Bool_t goodpv = true;
2170 if (PRIMARY_VERTEX_CUTS) {
2171 // if(ntr < 2) goodpv = false;
2172 if (primaryVertex->GetNTracks() < 2)
2173 goodpv = false;
2174 if (primaryVertex->GetX() < -6.5 + PV_HARD || primaryVertex->GetX() > 7.5 - PV_HARD
2175 || primaryVertex->GetY() < -4.5 + PV_HARD || primaryVertex->GetY() > 9.5 - PV_HARD
2176 || primaryVertex->GetZ() < -6.5 + PV_HARD || primaryVertex->GetZ() > 7.5 - PV_HARD)
2177 goodpv = false;
2178 }
2179 if ((!goodpv) || nGemHits < MINGEMNDF || nSiHits < MINSIHITS || xGem < -140.f || xGem > 240.f
2180 || yGem < -40.f || yGem > 200.f || txGem < -0.5f || txGem > 1.0f || tyGem < -0.1f
2181 || tyGem > 0.5f || Xpv < -6.5f + PV_HARD || Xpv > 7.5f - PV_HARD || Ypv < -4.5f + PV_HARD
2182 || Ypv > 9.5f - PV_HARD || Xpv == 0. || Ypv == 0. || QpGem == 0.0f
2183 || 1.0f / TMath::Abs(QpGem) > 15.0f || 1.0f / TMath::Abs(QpGem) < 0.15f || zGem < 500.f)
2184 {
2185 if (GEMDEBUG)
2186 printf("xGem %f yGem %f txGem %f tyGem %f Xpv %f Ypv %f QpGem %f\n", xGem, yGem, txGem,
2187 tyGem, Xpv, Ypv, QpGem);
2188 } else {
2189#if XGEMCOR != 0
2190 if (XGEMCOR == 1) {
2191 xGem -= Xgemcorrection(1. / QpGem * PSCALE, &DTXcor, &DXsigma,
2192 &DYsigma); /* txGem -= DTXcor; */
2193 } else if (XGEMCOR == 2) {
2194 Double_t dummy = Xgemcorrection(1. / QpGem * PSCALE, &DTXcor, &DXsigma, &DYsigma);
2195 DTXcor = 0.;
2196 }
2197#endif
2198 ntrgemcut++;
2199 if (ACCEPTANCE) {
2200 Double_t xgema = xGem + txGem * (z_tof700_average - zGem);
2201 Double_t ygema = yGem + tyGem * (z_tof700_average - zGem);
2202 if (xgema >= xmintof700 && xgema <= xmaxtof700 && ygema >= ymintof700
2203 && ygema <= ymaxtof700)
2204 {
2205 goodgem = true;
2206 le = gemdchtrack->GetLength() - ztarg;
2207 p = QpGem;
2208 ps = p;
2209 if (p != 0.)
2210 p = 1. / p;
2211 p *= PSCALE;
2212 hptr->Fill(p); // GeV/c
2213 hltr->Fill(le); // cm
2214 pmod = TMath::Abs(p);
2215 hxygem->Fill(xGem, yGem);
2216 if (p > 0.)
2217 pxygem_p->Fill(xGem, yGem, p);
2218 else if (p < 0.)
2219 pxygem_pn->Fill(xGem, yGem, -p);
2220 if (p > 0.)
2221 pxygem_tx->Fill(xGem, yGem, txGem);
2222 else if (p < 0.)
2223 pxygem_txn->Fill(xGem, yGem, txGem);
2224 if (p > 0.)
2225 pxygem_ty->Fill(xGem, yGem, tyGem);
2226 else if (p < 0.)
2227 pxygem_tyn->Fill(xGem, yGem, tyGem);
2228
2229 hxygem0->Fill(xGem1st, yGem1st);
2230 if (p > 0.)
2231 pxygem0_p->Fill(xGem1st, yGem1st, p);
2232 else if (p < 0.)
2233 pxygem0_pn->Fill(xGem1st, yGem1st, -p);
2234 if (p > 0.)
2235 pxygem0_tx->Fill(xGem1st, yGem1st, txGem1st);
2236 else if (p < 0.)
2237 pxygem0_txn->Fill(xGem1st, yGem1st, txGem1st);
2238 if (p > 0.)
2239 pxygem0_ty->Fill(xGem1st, yGem1st, tyGem1st);
2240 else if (p < 0.)
2241 pxygem0_tyn->Fill(xGem1st, yGem1st, tyGem1st);
2242 if (p > 0.)
2243 hxygem0p->Fill(xGem1st, yGem1st);
2244 else if (p < 0.)
2245 hxygem0n->Fill(xGem1st, yGem1st);
2246 }
2247 } else {
2248 goodgem = true;
2249 le = gemdchtrack->GetLength() - ztarg;
2250 p = QpGem;
2251 ps = p;
2252 if (p != 0.)
2253 p = 1. / p;
2254 p *= PSCALE;
2255 hptr->Fill(p); // GeV/c
2256 hltr->Fill(le); // cm
2257 pmod = TMath::Abs(p);
2258 hxygem->Fill(xGem, yGem);
2259 if (p > 0.)
2260 pxygem_p->Fill(xGem, yGem, p);
2261 else if (p < 0.)
2262 pxygem_pn->Fill(xGem, yGem, -p);
2263 if (p > 0.)
2264 pxygem_tx->Fill(xGem, yGem, txGem);
2265 else if (p < 0.)
2266 pxygem_txn->Fill(xGem, yGem, txGem);
2267 if (p > 0.)
2268 pxygem_ty->Fill(xGem, yGem, tyGem);
2269 else if (p < 0.)
2270 pxygem_tyn->Fill(xGem, yGem, tyGem);
2271
2272 hxygem0->Fill(xGem1st, yGem1st);
2273 if (p > 0.)
2274 pxygem0_p->Fill(xGem1st, yGem1st, p);
2275 else if (p < 0.)
2276 pxygem0_pn->Fill(xGem1st, yGem1st, -p);
2277 if (p > 0.)
2278 pxygem0_tx->Fill(xGem1st, yGem1st, txGem1st);
2279 else if (p < 0.)
2280 pxygem0_txn->Fill(xGem1st, yGem1st, txGem1st);
2281 if (p > 0.)
2282 pxygem0_ty->Fill(xGem1st, yGem1st, tyGem1st);
2283 else if (p < 0.)
2284 pxygem0_tyn->Fill(xGem1st, yGem1st, tyGem1st);
2285 if (p > 0.)
2286 hxygem0p->Fill(xGem1st, yGem1st);
2287 else if (p < 0.)
2288 hxygem0n->Fill(xGem1st, yGem1st);
2289 }
2290 }
2291 } else {
2292 if (ACCEPTANCE) {
2293 Double_t xgema = xGem + txGem * (z_tof700_average - zGem);
2294 Double_t ygema = yGem + tyGem * (z_tof700_average - zGem);
2295 if (xgema >= xmintof700 && xgema <= xmaxtof700 && ygema >= ymintof700
2296 && ygema <= ymaxtof700)
2297 {
2298 goodgem = true;
2299 le = gemdchtrack->GetLength() - ztarg;
2300 p = QpGem;
2301 ps = p;
2302 if (p != 0.)
2303 p = 1. / p;
2304 p *= PSCALE;
2305 hptr->Fill(p); // GeV/c
2306 hltr->Fill(le); // cm
2307 pmod = TMath::Abs(p);
2308 hxygem->Fill(xGem, yGem);
2309 if (p > 0.)
2310 pxygem_p->Fill(xGem, yGem, p);
2311 else if (p < 0.)
2312 pxygem_pn->Fill(xGem, yGem, -p);
2313 if (p > 0.)
2314 pxygem_tx->Fill(xGem, yGem, txGem);
2315 else if (p < 0.)
2316 pxygem_txn->Fill(xGem, yGem, txGem);
2317 if (p > 0.)
2318 pxygem_ty->Fill(xGem, yGem, tyGem);
2319 else if (p < 0.)
2320 pxygem_tyn->Fill(xGem, yGem, tyGem);
2321
2322 hxygem0->Fill(xGem1st, yGem1st);
2323 if (p > 0.)
2324 pxygem0_p->Fill(xGem1st, yGem1st, p);
2325 else if (p < 0.)
2326 pxygem0_pn->Fill(xGem1st, yGem1st, -p);
2327 if (p > 0.)
2328 pxygem0_tx->Fill(xGem1st, yGem1st, txGem1st);
2329 else if (p < 0.)
2330 pxygem0_txn->Fill(xGem1st, yGem1st, txGem1st);
2331 if (p > 0.)
2332 pxygem0_ty->Fill(xGem1st, yGem1st, tyGem1st);
2333 else if (p < 0.)
2334 pxygem0_tyn->Fill(xGem1st, yGem1st, tyGem1st);
2335 if (p > 0.)
2336 hxygem0p->Fill(xGem1st, yGem1st);
2337 else if (p < 0.)
2338 hxygem0n->Fill(xGem1st, yGem1st);
2339 }
2340 } else {
2341 goodgem = true;
2342 le = gemdchtrack->GetLength() - ztarg;
2343 p = QpGem;
2344 ps = p;
2345 if (p != 0.)
2346 p = 1. / p;
2347 p *= PSCALE;
2348 hptr->Fill(p); // GeV/c
2349 hltr->Fill(le); // cm
2350 pmod = TMath::Abs(p);
2351 hxygem->Fill(xGem, yGem);
2352 if (p > 0.)
2353 pxygem_p->Fill(xGem, yGem, p);
2354 else if (p < 0.)
2355 pxygem_pn->Fill(xGem, yGem, -p);
2356 if (p > 0.)
2357 pxygem_tx->Fill(xGem, yGem, txGem);
2358 else if (p < 0.)
2359 pxygem_txn->Fill(xGem, yGem, txGem);
2360 if (p > 0.)
2361 pxygem_ty->Fill(xGem, yGem, tyGem);
2362 else if (p < 0.)
2363 pxygem_tyn->Fill(xGem, yGem, tyGem);
2364
2365 hxygem0->Fill(xGem1st, yGem1st);
2366 if (p > 0.)
2367 pxygem0_p->Fill(xGem1st, yGem1st, p);
2368 else if (p < 0.)
2369 pxygem0_pn->Fill(xGem1st, yGem1st, -p);
2370 if (p > 0.)
2371 pxygem0_tx->Fill(xGem1st, yGem1st, txGem1st);
2372 else if (p < 0.)
2373 pxygem0_txn->Fill(xGem1st, yGem1st, txGem1st);
2374 if (p > 0.)
2375 pxygem0_ty->Fill(xGem1st, yGem1st, tyGem1st);
2376 else if (p < 0.)
2377 pxygem0_tyn->Fill(xGem1st, yGem1st, tyGem1st);
2378 if (p > 0.)
2379 hxygem0p->Fill(xGem1st, yGem1st);
2380 else if (p < 0.)
2381 hxygem0n->Fill(xGem1st, yGem1st);
2382 }
2383 }
2384 }
2385 }
2386#if USEGEMTXTY != 0
2387 tx = txGem;
2388 ty = tyGem;
2389#else
2390#if USEDCHTXTY != 0
2391 tx = txdch;
2392 ty = tydch;
2393#endif
2394#endif
2395 if (goodgem) {
2396 // Fragments
2397 pfr = fabs(p);
2398 pzfr = pfr / TMath::Sqrt(1. + txGem1st * txGem1st + tyGem1st * tyGem1st);
2399 pxfr = pzfr * txGem1st;
2400 pyfr = pzfr * tyGem1st;
2401 ptfr = TMath::Sqrt(pxfr * pxfr + pyfr * pyfr);
2402 //
2403 pgem[ntrgem] = p;
2404 xtrgem0[ntrgem] = xGem0;
2405 xtrgem[ntrgem] = xGem;
2406 ytrgem[ntrgem] = yGem;
2407 txtrgem[ntrgem] = txGem;
2408 tytrgem[ntrgem] = tyGem;
2409 dxtrgem[ntrgem] = DXsigma;
2410 dytrgem[ntrgem] = DYsigma;
2411 ztrgem[ntrgem] = zGem;
2412 ztrgem1st[ntrgem] = zGem1st;
2413 ntrgem++;
2414 }
2415 if (TRACKS_ONLY)
2416 continue;
2417 goodgemdch = false;
2418 if (goodgem && gooddch) {
2419
2420 hdxyreal->Fill(xGem - xyzdch[0], yGem - xyzdch[1]);
2421 hdtxtyreal->Fill(txGem - txdch, tyGem - tydch);
2422 ntr1++;
2423 // fill matching parameters
2424 dxm = gemdchtrack->GetDx();
2425 dym = gemdchtrack->GetDy();
2426 dtx = gemdchtrack->GetDtx();
2427 dty = gemdchtrack->GetDty();
2428 Ddx = gemdchtrack->GetDdx();
2429 Ddy = gemdchtrack->GetDdy();
2430 Ddtx = gemdchtrack->GetDdtx();
2431 Ddty = gemdchtrack->GetDdty();
2432 Chi2m = gemdchtrack->GetChi2();
2433 hdx->Fill(dxm);
2434 hdy->Fill(dym);
2435 hdxy0->Fill(dxm, dym);
2436 hdtx->Fill(dtx);
2437 hdty->Fill(dty);
2438 hDdx->Fill(sqrt(Ddx));
2439 hDdy->Fill(sqrt(Ddy));
2440 hDdtx->Fill(sqrt(Ddtx));
2441 hDdty->Fill(sqrt(Ddty));
2442 hpdx->Fill(dxm / sqrt(Ddx));
2443 hpdy->Fill(dym / sqrt(Ddy));
2444 hpdtx->Fill(dtx / sqrt(Ddtx));
2445 hpdty->Fill(dty / sqrt(Ddty));
2446 hchi2m->Fill(Chi2m);
2447 chi2 = dxm * dxm / Ddx + dym * dym / Ddy;
2448 hchi2->Fill(chi2);
2449 // Selection criteria - x and y tracks matching
2450 if (DXsigma > 0. && DYsigma > 0. && NDXsigma > 0) {
2451 if (fabs(xGem - xyzdch[0]) <= NDXsigma * DXsigma && fabs(yGem - xyzdch[1]) <= NDXsigma * DYsigma) {
2452 ntr1g++;
2453 hdxy->Fill(xGem - xyzdch[0], yGem - xyzdch[1]);
2454 hxygoodtr->Fill(xgoodtr, ygoodtr);
2455 if (p > 0.)
2456 hxygoodtrp->Fill(xgoodtr, ygoodtr);
2457 else if (p < 0.)
2458 hxygoodtrn->Fill(xgoodtr, ygoodtr);
2459 hxygoodtrgem->Fill(xGem, yGem);
2460 hpgemdch->Fill(p); // GeV/c
2461 goodgemdch = true;
2462 }
2463 } else {
2464 if (dxm >= -DXGEMDCHMAX && dxm <= +DXGEMDCHMAX && dym >= -DYGEMDCHMAX
2465 && dym <= +DYGEMDCHMAX /* && Chi2m <= 30.f && chi2 > 30.f*/)
2466 {
2467 ntr1g++;
2468 hdxy->Fill(dxm, dym);
2469 hxygoodtr->Fill(xgoodtr, ygoodtr);
2470 if (p > 0.)
2471 hxygoodtrp->Fill(xgoodtr, ygoodtr);
2472 else if (p < 0.)
2473 hxygoodtrn->Fill(xgoodtr, ygoodtr);
2474 hxygoodtrgem->Fill(xGem, yGem);
2475 hpgemdch->Fill(p); // GeV/c
2476 goodgemdch = true;
2477 }
2478 }
2479 }
2480#if REFIT != 0
2481 if (goodgemdch) {
2482 if (REFIT_DEBUG)
2483 printf(" ********** Event %d Track %d ******************\n", iEv, iTr);
2484 TMatrixDSym covdch0(5), covdch(5), icovdch(5);
2485 covdch *= 0.;
2486 covdch0 *= 0.;
2487 // track->GetParamFirst()->CovMatrix(covdch0);
2488 for (int ir = 0; ir < 5; ir++)
2489 covdch0(ir, ir) = track->GetParamFirst()->GetCovariance(ir, ir);
2490#if DCHCOVPAR != 0
2491 covdch(0, 0) = covdch0(0, 0);
2492 covdch(1, 1) = covdch0(2, 2);
2493 covdch(2, 2) = covdch0(1, 1);
2494 covdch(3, 3) = covdch0(3, 3);
2495// covdch(4,4) = covdch0(4,4);
2496#else
2497 covdch = covdch0;
2498#endif
2499 covdch(4, 4) = 10000.;
2500 if (REFIT_DEBUG)
2501 printf(" Err DCH x = %10.5f\n", TMath::Sqrt(covdch(0, 0)));
2502 if (REFIT_DEBUG)
2503 printf(" Err DCH y = %10.5f\n", TMath::Sqrt(covdch(1, 1)));
2504 if (REFIT_DEBUG)
2505 printf(" Err DCH tx = %10.5f\n", TMath::Sqrt(covdch(2, 2)));
2506 if (REFIT_DEBUG)
2507 printf(" Err DCH ty = %10.5f\n", TMath::Sqrt(covdch(3, 3)));
2508 icovdch = covdch;
2509 icovdch.Invert();
2510 TMatrixDSym covgem(5), icovgem(5);
2511 covgem *= 0.;
2512 // gtrack->GetParamLast()->CovMatrix(covgem);
2513 for (int ir = 0; ir < 5; ir++)
2514 for (int ic = 0; ic < 5; ic++)
2515 covgem(ir, ic) = gtrack->GetParamLast()->GetCovariance(ir, ic);
2516 if (REFIT_DEBUG)
2517 printf(" Err GEM x = %10.5f\n", TMath::Sqrt(covgem(0, 0)));
2518 if (REFIT_DEBUG)
2519 printf(" Err GEM y = %10.5f\n", TMath::Sqrt(covgem(1, 1)));
2520 if (REFIT_DEBUG)
2521 printf(" Err GEM tx = %10.5f\n", TMath::Sqrt(covgem(2, 2)));
2522 if (REFIT_DEBUG)
2523 printf(" Err GEM ty = %10.5f\n", TMath::Sqrt(covgem(3, 3)));
2524 if (REFIT_DEBUG)
2525 printf(" Err GEM ip = %10.5f\n", TMath::Sqrt(covgem(4, 4)) / QpGem);
2526 icovgem = covgem;
2527 icovgem.Invert();
2528 TMatrixDSym covgemdch(5), icovgemdch(5);
2529 icovgemdch *= 0.;
2530 icovgemdch += icovgem;
2531 icovgemdch += icovdch;
2532 covgemdch = icovgemdch;
2533 covgemdch.Invert();
2534 TVectorD sumgemdch(5), pargemdch(5);
2535 TVectorD pargem(5), pardch(5), pagemdch(5);
2536 pardch(0) = xyzdch[0];
2537 pardch(1) = xyzdch[1];
2538 pardch(2) = txdch;
2539 pardch(3) = tydch;
2540 pardch(4) = 1.;
2541 pargem(0) = xGem;
2542 pargem(1) = yGem;
2543 pargem(2) = txGem;
2544 pargem(3) = tyGem;
2545 pargem(4) = QpGem;
2546 sumgemdch *= 0.;
2547 sumgemdch += icovgem * pargem;
2548 sumgemdch += icovdch * pardch;
2549 pargemdch = covgemdch * sumgemdch;
2550 xyz[0] = pargemdch(0);
2551 xyz[1] = pargemdch(1);
2552 tx = pargemdch(2);
2553 ty = pargemdch(3);
2554 hdxrefit1->Fill(pargemdch(0) - pardch(0));
2555 hdyrefit1->Fill(pargemdch(1) - pardch(1));
2556 hdtxrefit1->Fill(pargemdch(2) - pardch(2));
2557 hdtyrefit1->Fill(pargemdch(3) - pardch(3));
2558 hdxrefit->Fill(pargemdch(0) - pargem(0));
2559 hdyrefit->Fill(pargemdch(1) - pargem(1));
2560 hdtxrefit->Fill(pargemdch(2) - pargem(2));
2561 hdtyrefit->Fill(pargemdch(3) - pargem(3));
2562 if (pargem(4) != 0.)
2563 hdprefit->Fill((pargemdch(4) - pargem(4)) / pargem(4));
2564 // tx0 = tx;
2565 cxyz[0] = tx / TMath::Sqrt(1. + tx * tx + ty * ty);
2566 cxyz[1] = ty / TMath::Sqrt(1. + tx * tx + ty * ty);
2567 cxyz[2] = 1. / TMath::Sqrt(1. + tx * tx + ty * ty);
2568 track->GetParamLast()->SetCovMatrix(covgemdch);
2569 if (REFIT_DEBUG)
2570 printf(" x %10.5f %10.5f %10.5f\n", pargem(0), pardch(0), pargemdch(0));
2571 if (REFIT_DEBUG)
2572 printf(" y %10.5f %10.5f %10.5f\n", pargem(1), pardch(1), pargemdch(1));
2573 if (REFIT_DEBUG)
2574 printf(" tx %10.5f %10.5f %10.5f\n", pargem(2), pardch(2), pargemdch(2));
2575 if (REFIT_DEBUG)
2576 printf(" ty %10.5f %10.5f %10.5f\n", pargem(3), pardch(3), pargemdch(3));
2577 if (REFIT_DEBUG)
2578 printf(" p %10.5f %10.5f %10.5f\n", 1. / pargem(4), 1. / pardch(4), 1. / pargemdch(4));
2579 }
2580#endif
2581 if (goodgemdch) {
2582 Int_t nth = 0, itc[100] = {0}, its[100] = {0};
2583 TOF2->get_track_hits(xyz, cxyz, &nth, itc, its);
2584 if (nth > 0 && idchambers[itc[0]] != 19.3f) {
2585 crpc1 = itc[0];
2586 xystrip(hxytrackstrips, itc[0], its[0]);
2587 zrpcm = zca[itc[0]];
2588 dz = zrpcm - xyz[2];
2589 xrpcm = xyz[0] + dz * tx;
2590 yrpcm = xyz[1] + dz * ty;
2591 hplatraz->Fill(zrpcm);
2592 hplatra->Fill(xrpcm);
2593 if (zrpcm < 600)
2594 hplatra1a->Fill(xrpcm);
2595 if (zrpcm > 605 && zrpcm < 610)
2596 hplatra1b->Fill(xrpcm);
2597 if (zrpcm > 625 && zrpcm < 630 && yrpcm < 20)
2598 hplatra2ac->Fill(xrpcm);
2599 if (zrpcm > 625 && zrpcm < 630 && yrpcm > 20)
2600 hplatra2au->Fill(xrpcm);
2601 if (zrpcm > 635 && zrpcm < 660 && yrpcm < 20)
2602 hplatra2bc->Fill(xrpcm);
2603 if (zrpcm > 635 && zrpcm < 660 && yrpcm > 20)
2604 hplatra2bu->Fill(xrpcm);
2605 if (zrpcm > 625 && zrpcm < 660 && yrpcm < 20)
2606 hplatra2abc->Fill(xrpcm);
2607 }
2608 if (nth > 1 && idchambers[itc[1]] != 19.3f) {
2609 crpc2 = itc[1];
2610 xystrip(hxytrackstrips, itc[1], its[1]);
2611 zrpcm1 = zca[itc[1]];
2612 dz = zrpcm1 - xyz[2];
2613 xrpcm1 = xyz[0] + dz * tx;
2614 yrpcm1 = xyz[1] + dz * ty;
2615 hplatraz->Fill(zrpcm1);
2616 hplatra->Fill(xrpcm1);
2617 if (zrpcm1 < 600)
2618 hplatra1a->Fill(xrpcm1);
2619 if (zrpcm1 > 605 && zrpcm1 < 610)
2620 hplatra1b->Fill(xrpcm1);
2621 if (zrpcm1 > 625 && zrpcm1 < 630 && yrpcm1 < 20)
2622 hplatra2ac->Fill(xrpcm1);
2623 if (zrpcm1 > 625 && zrpcm1 < 630 && yrpcm1 > 20)
2624 hplatra2au->Fill(xrpcm1);
2625 if (zrpcm1 > 635 && zrpcm1 < 660 && yrpcm1 < 20)
2626 hplatra2bc->Fill(xrpcm1);
2627 if (zrpcm1 > 635 && zrpcm1 < 660 && yrpcm1 > 20)
2628 hplatra2bu->Fill(xrpcm1);
2629 if (zrpcm1 > 625 && zrpcm1 < 660 && yrpcm1 < 20)
2630 hplatra2abc->Fill(xrpcm1);
2631 }
2632 }
2633
2634 Double_t corxrpc = 0.;
2635#if XTOFCOR == 1
2636 corxrpc = Xgemcorrectiontof700(1. / QpGem * PSCALE, &SigmaX_TOF700, &SigmaY_TOF700);
2637#else
2639#endif
2640 if (USE_CLUSTERS) {
2641 himin = -1;
2642 dist = 0.;
2643 distmin = 1000000000.0f;
2644 for (int icl = 0; icl < ncl0; icl++) {
2645 if (!goodgemdch)
2646 continue;
2647 ic = clchamb[icl];
2648 is = clstrip[icl];
2649 int ih = numhit[ic][is];
2650 // if (usedstrip[ih]) continue;
2651 dz = zhi[ih] - xyz[2];
2652#if USEDCHXY == 0
2653 xrpc = xyz[0] + dz * tx;
2654 yrpc = xyz[1] + dz * ty;
2655 xrpc -= corxrpc;
2656
2657#else
2658 xrpc = xyzdch[0] + dz * tx;
2659 yrpc = xyzdch[1] + dz * ty;
2660#endif
2661
2662 dx = xrpc - xhi[ih];
2663 dy = yrpc - yhi[ih];
2665 continue;
2667 continue;
2668 dist = TMath::Sqrt(dx * dx + dy * dy);
2669 himin = numhit[ic][is];
2670 Ihit[Npairs] = himin;
2671 Dpairs[Npairs] = dist;
2673 Itrack[Npairs] = iTr;
2674
2675 Vpairs[Npairs][0] = xgoodtr;
2676 Vpairs[Npairs][1] = ygoodtr;
2677 Vpairs[Npairs][2] = xGem;
2678 Vpairs[Npairs][3] = yGem;
2679 Vpairs[Npairs][4] = zGem;
2680 Vpairs[Npairs][5] = txGem;
2681 Vpairs[Npairs][6] = tyGem;
2682 Vpairs[Npairs][7] = p;
2683 Vpairs[Npairs][8] = dxm;
2684 Vpairs[Npairs][9] = dym;
2685 Vpairs[Npairs][10] = xGem1st;
2686 Vpairs[Npairs][11] = yGem1st;
2687 Vpairs[Npairs][12] = xyz[0];
2688 ;
2689 Vpairs[Npairs][13] = xyz[1];
2690 Vpairs[Npairs][14] = xyz[2];
2691 Vpairs[Npairs][15] = tx;
2692 Vpairs[Npairs][16] = ty;
2693 Vpairs[Npairs][17] = le;
2694 Vpairs[Npairs][18] = pfr;
2695 Vpairs[Npairs][19] = pxfr;
2696 Vpairs[Npairs][20] = pyfr;
2697 Vpairs[Npairs][21] = pzfr;
2698 Vpairs[Npairs][22] = ptfr;
2699 Vpairs[Npairs][23] = corxrpc;
2700
2701 Npairs++;
2702 }
2703 himin1 = -1;
2704 dist = 0.;
2705 distmin1 = 1000000000.0f;
2706 for (int icl = 0; icl < ncl0; icl++) {
2707 if (!gooddch)
2708 continue;
2709 ic = clchamb[icl];
2710 is = clstrip[icl];
2711 int ih = numhit[ic][is];
2712 // if (usedstrip1[ih]) continue;
2713 dz = zhi[ih] - xyzdch[2];
2714 xrpc = xyzdch[0] + dz * txdch;
2715 yrpc = xyzdch[1] + dz * tydch;
2716 dx = xrpc - xhi[ih];
2717 dy = yrpc - yhi[ih];
2719 continue;
2721 continue;
2722 dist = TMath::Sqrt(dx * dx + dy * dy);
2723 himin1 = numhit[ic][is];
2724 Ihit1[Npairs1] = himin1;
2725 Dpairs1[Npairs1] = dist;
2726 Cpairs1[Npairs1] =
2728 Itrack1[Npairs1] = iTr;
2729
2730 Vpairs1[Npairs1][0] = xgoodtr1;
2731 Vpairs1[Npairs1][1] = ygoodtr1;
2732 Vpairs1[Npairs1][2] = xyzdch[0];
2733 Vpairs1[Npairs1][3] = xyzdch[1];
2734 Vpairs1[Npairs1][4] = xyzdch[2];
2735 Vpairs1[Npairs1][5] = txdch;
2736 Vpairs1[Npairs1][6] = tydch;
2737 Vpairs1[Npairs1][7] = p;
2738 Vpairs1[Npairs1][8] = 0.;
2739 if (goodgemdch)
2740 Vpairs1[Npairs1][8] = 1.;
2741
2742 Npairs1++;
2743 }
2744 himin2 = -1;
2745 dist = 0.;
2746 distmin2 = 1000000000.0f;
2747 for (int icl = 0; icl < ncl0; icl++) {
2748 if (!goodgem)
2749 continue;
2750 ic = clchamb[icl];
2751 is = clstrip[icl];
2752 int ih = numhit[ic][is];
2753 // if (usedstrip2[ih]) continue;
2754 dz = zhi[ih] - zGem;
2755 xrpc = xGem + dz * txGem;
2756 yrpc = yGem + dz * tyGem;
2757 dx = xrpc - xhi[ih];
2758 dy = yrpc - yhi[ih];
2760 continue;
2762 continue;
2763 dist = TMath::Sqrt(dx * dx + dy * dy);
2764 himin2 = numhit[ic][is];
2765 Ihit2[Npairs2] = himin2;
2766 Dpairs2[Npairs2] = dist;
2767 Cpairs2[Npairs2] =
2769 Itrack2[Npairs2] = iTr;
2770
2771 Vpairs2[Npairs2][0] = xgoodtr;
2772 Vpairs2[Npairs2][1] = xgoodtr;
2773 Vpairs2[Npairs2][2] = xGem;
2774 Vpairs2[Npairs2][3] = yGem;
2775 Vpairs2[Npairs2][4] = zGem;
2776 Vpairs2[Npairs2][5] = txGem;
2777 Vpairs2[Npairs2][6] = tyGem;
2778 Vpairs2[Npairs2][7] = p;
2779 Vpairs2[Npairs2][8] = dxm;
2780 Vpairs2[Npairs2][9] = dym;
2781 Vpairs2[Npairs2][10] = 0.;
2782 if (goodgemdch)
2783 Vpairs2[Npairs2][10] = 1.;
2784
2785 Npairs2++;
2786 }
2787 } else {
2788 nh = nhi;
2789 himin = -1;
2790 dist = 0.;
2791 distmin = 1000000000.0f;
2792 for (int ih = 0; ih < nh; ih++) {
2793 if (!goodgemdch)
2794 continue;
2795 // if (usedstrip[ih]) continue;
2796 ic = hchamb[ih];
2797 is = hstrip[ih];
2798 dz = zhi[ih] - xyz[2];
2799#if USEDCHXY == 0
2800 xrpc = xyz[0] + dz * tx;
2801 yrpc = xyz[1] + dz * ty;
2802 xrpc -= corxrpc;
2803#else
2804 xrpc = xyzdch[0] + dz * tx;
2805 yrpc = xyzdch[1] + dz * ty;
2806#endif
2807 dx = xrpc - xhi[ih];
2808 dy = yrpc - yhi[ih];
2810 continue;
2812 continue;
2813 dist = TMath::Sqrt(dx * dx + dy * dy);
2814 himin = numhit[ic][is];
2815 Ihit[Npairs] = himin;
2816 Dpairs[Npairs] = dist;
2818 Itrack[Npairs] = iTr;
2819
2820 Vpairs[Npairs][0] = xgoodtr;
2821 Vpairs[Npairs][1] = ygoodtr;
2822 Vpairs[Npairs][2] = xGem;
2823 Vpairs[Npairs][3] = yGem;
2824 Vpairs[Npairs][4] = zGem;
2825 Vpairs[Npairs][5] = txGem;
2826 Vpairs[Npairs][6] = tyGem;
2827 Vpairs[Npairs][7] = p;
2828 Vpairs[Npairs][8] = dxm;
2829 Vpairs[Npairs][9] = dym;
2830 Vpairs[Npairs][10] = xGem1st;
2831 Vpairs[Npairs][11] = yGem1st;
2832 Vpairs[Npairs][12] = xyz[0];
2833 ;
2834 Vpairs[Npairs][13] = xyz[1];
2835 Vpairs[Npairs][14] = xyz[2];
2836 Vpairs[Npairs][15] = tx;
2837 Vpairs[Npairs][16] = ty;
2838 Vpairs[Npairs][17] = le;
2839 Vpairs[Npairs][18] = pfr;
2840 Vpairs[Npairs][19] = pxfr;
2841 Vpairs[Npairs][20] = pyfr;
2842 Vpairs[Npairs][21] = pzfr;
2843 Vpairs[Npairs][22] = ptfr;
2844 Vpairs[Npairs][23] = corxrpc;
2845
2846 Npairs++;
2847 }
2848
2849 nh = nhi;
2850 himin1 = -1;
2851 dist = 0.;
2852 distmin1 = 1000000000.0f;
2853 for (int ih = 0; ih < nh; ih++) {
2854 if (!gooddch)
2855 continue;
2856 // if (usedstrip1[ih]) continue;
2857 ic = hchamb[ih];
2858 is = hstrip[ih];
2859 dz = zhi[ih] - xyz[2];
2860 xrpc = xyzdch[0] + dz * txdch;
2861 yrpc = xyzdch[1] + dz * tydch;
2862 dx = xrpc - xhi[ih];
2863 dy = yrpc - yhi[ih];
2865 continue;
2867 continue;
2868 dist = TMath::Sqrt(dx * dx + dy * dy);
2869 himin1 = numhit[ic][is];
2870 Ihit1[Npairs1] = himin1;
2871 Dpairs1[Npairs1] = dist;
2872 Cpairs1[Npairs1] =
2874 Itrack1[Npairs1] = iTr;
2875
2876 Vpairs1[Npairs1][0] = xgoodtr1;
2877 Vpairs1[Npairs1][1] = ygoodtr1;
2878 Vpairs1[Npairs1][2] = xyzdch[0];
2879 Vpairs1[Npairs1][3] = xyzdch[1];
2880 Vpairs1[Npairs1][4] = xyzdch[2];
2881 Vpairs1[Npairs1][5] = txdch;
2882 Vpairs1[Npairs1][6] = tydch;
2883 Vpairs1[Npairs1][7] = p;
2884 Vpairs1[Npairs1][8] = 0.;
2885 if (goodgemdch)
2886 Vpairs1[Npairs1][8] = 1.;
2887
2888 Npairs1++;
2889 }
2890
2891 nh = nhi;
2892 himin2 = -1;
2893 dist = 0.;
2894 distmin2 = 1000000000.0f;
2895 for (int ih = 0; ih < nh; ih++) {
2896 if (!goodgem)
2897 continue;
2898 // if (usedstrip2[ih]) continue;
2899 ic = hchamb[ih];
2900 is = hstrip[ih];
2901 dz = zhi[ih] - zGem;
2902 xrpc = xGem + dz * txGem;
2903 yrpc = yGem + dz * tyGem;
2904 dx = xrpc - xhi[ih];
2905 dy = yrpc - yhi[ih];
2907 continue;
2909 continue;
2910 dist = TMath::Sqrt(dx * dx + dy * dy);
2911 himin2 = numhit[ic][is];
2912 Ihit2[Npairs2] = himin2;
2913 Dpairs2[Npairs2] = dist;
2914 Cpairs2[Npairs2] =
2916 Itrack2[Npairs2] = iTr;
2917
2918 Vpairs2[Npairs2][0] = xgoodtr;
2919 Vpairs2[Npairs2][1] = xgoodtr;
2920 Vpairs2[Npairs2][2] = xGem;
2921 Vpairs2[Npairs2][3] = yGem;
2922 Vpairs2[Npairs2][4] = zGem;
2923 Vpairs2[Npairs2][5] = txGem;
2924 Vpairs2[Npairs2][6] = tyGem;
2925 Vpairs2[Npairs2][7] = p;
2926 Vpairs2[Npairs2][8] = dxm;
2927 Vpairs2[Npairs2][9] = dym;
2928 Vpairs2[Npairs2][10] = 0.;
2929 if (goodgemdch)
2930 Vpairs2[Npairs2][10] = 1.;
2931
2932 Npairs2++;
2933 }
2934 }
2935 } // tracks loop
2936 // DCH+TOF700 matching
2937 // Selection criteria on minimal distance track-hit
2938 // Selection criteria time-of-flight
2939 Int_t iptra = 0, ip = 0;
2940 TMath::Sort(Npairs1, Dpairs1, Isort1, false);
2941 for (int ip0 = 0; ip0 < Npairs1; ip0++) {
2942 gooddchtof = false;
2943 ip = Isort1[ip0];
2944 himin1 = Ihit1[ip];
2945 iptra = Itrack1[ip];
2946 if (himin1 >= 0 && !usedstrip1[himin1] && !usedtrack1[iptra]) {
2947 ic = hchamb[himin1];
2948 is = hstrip[himin1];
2949 if (tof[ic][is] <= TOFMAX) {
2950 gooddchtof = true;
2951 usedstrip1[himin1] = true;
2952 usedtrack1[iptra] = true;
2953 xgoodtr1 = Vpairs1[ip][0];
2954 ygoodtr1 = Vpairs1[ip][1];
2955 xyzdch[0] = Vpairs1[ip][2];
2956 xyzdch[1] = Vpairs1[ip][3];
2957 xyzdch[2] = Vpairs1[ip][4];
2958 txdch = Vpairs1[ip][5];
2959 tydch = Vpairs1[ip][6];
2960 p = Vpairs1[ip][7];
2961 goodgemdch = false;
2962 if (Vpairs1[ip][8] != 0.)
2963 goodgemdch = true;
2964 hxygoodhit1->Fill(xgoodtr1, ygoodtr1);
2965 hxygoodclusterdch->Fill(xhi[himin1], yhi[himin1]);
2966 if (goodgemdch) {
2967 dz = zhi[himin] - xyzdch[2];
2968 xrpc = xyzdch[0] + dz * txdch;
2969 yrpc = xyzdch[1] + dz * tydch;
2970 hxyhit1->Fill(xrpc - xhi[himin1], yrpc - yhi[himin1]);
2971 phitdxvsx1->Fill(xrpc, xrpc - xhi[himin1]);
2972 phitdyvsx1->Fill(xrpc, yrpc - yhi[himin1]);
2973 phitdxvsy1->Fill(yrpc, xrpc - xhi[himin1]);
2974 phitdyvsy1->Fill(yrpc, yrpc - yhi[himin1]);
2975 hhitdxvsx1->Fill(xrpc, xrpc - xhi[himin1]);
2976 if (p > 0.f) {
2977 hhitdxvsp11->Fill(p, xrpc - xhi[himin1]);
2978 hhitdyvsp1->Fill(p, yrpc - yhi[himin1]);
2979 } else if (p < 0.f) {
2980 hhitdxvspn1->Fill(fabs(p), xrpc - xhi[himin1]);
2981
2982 hhitdyvspn1->Fill(fabs(p), yrpc - yhi[himin1]);
2983 }
2984 }
2985 }
2986 }
2987 } // loop on pairs type 1 (dch_track+tof700_hit)
2988 // GEM+TOF700 matching
2989 // Selection criteria on minimal distance track-hit
2990 // Selection criteria time-of-flight
2991 TMath::Sort(Npairs2, Dpairs2, Isort2, false);
2992 for (int ip0 = 0; ip0 < Npairs2; ip0++) {
2993 goodgemtof = false;
2994 goodgemdch2 = false;
2995 ip = Isort2[ip0];
2996 himin2 = Ihit2[ip];
2997 iptra = Itrack2[ip];
2998 if (himin2 >= 0 && !usedstrip2[himin2] && !usedtrack2[iptra]) {
2999 ic = hchamb[himin2];
3000 is = hstrip[himin2];
3001 if (tof[ic][is] <= TOFMAX) {
3002 goodgemtof = true;
3003 usedstrip2[himin2] = true;
3004 usedtrack2[iptra] = true;
3005 xgoodtr = Vpairs2[ip][0];
3006 ygoodtr = Vpairs2[ip][1];
3007 xGem = Vpairs2[ip][2];
3008 yGem = Vpairs2[ip][3];
3009 zGem = Vpairs2[ip][4];
3010 txGem = Vpairs2[ip][5];
3011 tyGem = Vpairs2[ip][6];
3012 p = Vpairs2[ip][7];
3013 dxm = Vpairs2[ip][8];
3014 dym = Vpairs2[ip][9];
3015 goodgemdch = false;
3016 if (Vpairs2[ip][10] != 0.)
3017 goodgemdch = true;
3018 hxygoodhit2->Fill(xGem, yGem);
3019 hpgemtof->Fill(p);
3020 dz = zhi[himin2] - zGem;
3021 xrpc = xGem + dz * txGem;
3022 yrpc = yGem + dz * tyGem;
3023 hxygoodclustergem->Fill(xhi[himin2], yhi[himin2]);
3024
3025 hxyhit2g->Fill(xrpc - xhi[himin2], yrpc - yhi[himin2]);
3026 hhitdxvsx2g->Fill(xrpc, xrpc - xhi[himin2]);
3027 if (p > 0.f) {
3028 hhitdxvsp2g->Fill(p, xrpc - xhi[himin2]);
3029 hhitdyvsp2g->Fill(p, yrpc - yhi[himin2]);
3030 } else if (p < 0.f) {
3031 hhitdxvspn2g->Fill(fabs(p), xrpc - xhi[himin2]);
3032 hhitdyvspn2g->Fill(fabs(p), yrpc - yhi[himin2]);
3033 }
3034
3035 if (goodgemdch) {
3036 goodgemdch2 = true;
3037 ntr2g++;
3038 hdxy2->Fill(dxm, dym);
3039 hxygoodtrgem2->Fill(xGem, yGem);
3040 hxygoodtr2->Fill(xgoodtr, ygoodtr);
3041 hpgemdch2->Fill(p); // GeV/c
3042 hxyhit2->Fill(xrpc - xhi[himin2], yrpc - yhi[himin2]);
3043 phitdxvsx2->Fill(xrpc, xrpc - xhi[himin2]);
3044 phitdyvsx2->Fill(xrpc, yrpc - yhi[himin2]);
3045 phitdxvsy2->Fill(yrpc, xrpc - xhi[himin2]);
3046 phitdyvsy2->Fill(yrpc, yrpc - yhi[himin2]);
3047 hhitdxvsx2->Fill(xrpc, xrpc - xhi[himin2]);
3048 if (p > 0.f) {
3049 hhitdxvsp22->Fill(p, xrpc - xhi[himin2]);
3050 hhitdyvsp2->Fill(p, yrpc - yhi[himin2]);
3051 } else if (p < 0.f) {
3052 hhitdxvspn2->Fill(fabs(p), xrpc - xhi[himin2]);
3053 hhitdyvspn2->Fill(fabs(p), yrpc - yhi[himin2]);
3054 }
3055 }
3056 }
3057 }
3058 } // loop on pairs type 2 (gem_track+tof700_hit)
3059 // GEMTOF+DCHTOF matching
3060 // Selection criteria on minimal distance track-hit
3061 // Selection criteria time-of-flight
3062
3063 Int_t ipa = 0, iptraa = 0;
3064 for (int ip0 = 0; ip0 < Npairs2; ip0++) {
3065 ip = Isort2[ip0];
3066 himin2 = Ihit2[ip];
3067 iptra = Itrack2[ip];
3068 for (int ip0a = 0; ip0a < Npairs1; ip0a++) {
3069 ipa = Isort1[ip0];
3070 himin1 = Ihit1[ipa];
3071 iptraa = Itrack1[ipa];
3072 if (usedtrack2[iptra] && usedtrack1[iptraa] && iptra == iptraa) {
3073 xgoodtr = Vpairs2[ip][0];
3074 ygoodtr = Vpairs2[ip][1];
3075 xGem = Vpairs2[ip][2];
3076 yGem = Vpairs2[ip][3];
3077 p = Vpairs2[ip][7];
3078 hpgemtofdchtof->Fill(p);
3079 hxygemtofdchtof->Fill(xGem, yGem);
3080 hxygemtofdchtofd->Fill(xgoodtr, ygoodtr);
3081 goodgemdch = false;
3082 if (Vpairs2[ip][10] != 0.)
3083 goodgemdch = true;
3084 if (goodgemdch) {
3085 hpgemtofdchtof1->Fill(p);
3086 hxygemtofdchtof1->Fill(xGem, yGem);
3087 hxygemtofdchtofd1->Fill(xgoodtr, ygoodtr);
3088 if (himin1 == himin2) {
3089 hpgemtofdchtof2->Fill(p);
3090 hxygemtofdchtof2->Fill(xGem, yGem);
3091 hxygemtofdchtofd2->Fill(xgoodtr, ygoodtr);
3092 }
3093 }
3094 break;
3095 }
3096 }
3097 }
3098
3099 // GEM+DCH+TOF700 matching
3100 // Selection criteria on minimal distance track-hit
3101 // Selection criteria time-of-flight
3102 Double_t corxrpc = 0.;
3103 TMath::Sort(Npairs, Dpairs, Isort, false);
3104 for (int ip0 = 0; ip0 < Npairs; ip0++) {
3105 goodgemdchtof = false;
3106 goodgemdchtof2 = false;
3107 ip = Isort[ip0];
3108 himin = Ihit[ip];
3109 iptra = Itrack[ip];
3110 if (himin >= 0) {
3111 ic = hchamb[himin];
3112 is = hstrip[himin];
3113 if (tof[ic][is] <= TOFMAX && !usedstrip[himin] && !usedtrack[iptra]) {
3114 usedstrip[himin] = true;
3115 usedtrack[iptra] = true;
3116 xgoodtr = Vpairs[ip][0];
3117 ygoodtr = Vpairs[ip][1];
3118 xGem = Vpairs[ip][2];
3119 yGem = Vpairs[ip][3];
3120 zGem = Vpairs[ip][4];
3121 txGem = Vpairs[ip][5];
3122 tyGem = Vpairs[ip][6];
3123 p = Vpairs[ip][7];
3124 dxm = Vpairs[ip][8];
3125 dym = Vpairs[ip][9];
3126 xGem1st = Vpairs[ip][10];
3127 yGem1st = Vpairs[ip][11];
3128 xyz[0] = Vpairs[ip][12];
3129 xyz[1] = Vpairs[ip][13];
3130 xyz[2] = Vpairs[ip][14];
3131 tx = Vpairs[ip][15];
3132 ty = Vpairs[ip][16];
3133 le = Vpairs[ip][17];
3134 pfr = Vpairs[ip][18];
3135 pxfr = Vpairs[ip][19];
3136 pyfr = Vpairs[ip][20];
3137 pzfr = Vpairs[ip][21];
3138 ptfr = Vpairs[ip][22];
3139 corxrpc = Vpairs[ip][23];
3140 // if (goodgemdch2)
3141 if (usedtrack2[iptra]) {
3142 ntr02++;
3143 goodgemdchtof2 = true;
3144 hdxytof2->Fill(dxm, dym);
3145 hxygoodhitgem2->Fill(xGem, yGem);
3146 hxygoodhita2->Fill(xhi[himin], yhi[himin]);
3147 hpgoodhit2->Fill(p); // GeV/c
3148 }
3149 ntr0++;
3150 ncltr[ic]++;
3151 goodgemdchtof = true;
3152 usedstrip[himin] = true;
3153 hdxytof->Fill(dxm, dym);
3154 x700fr = xgoodtr;
3155 y700fr = ygoodtr;
3156 hxygoodhit->Fill(xgoodtr, ygoodtr);
3157 if (p > 0.)
3158 hxygoodhitp->Fill(xgoodtr, ygoodtr);
3159 else if (p < 0.)
3160 hxygoodhitn->Fill(xgoodtr, ygoodtr);
3161 hxygoodhita->Fill(xhi[himin], yhi[himin]);
3162 hxygoodcluster->Fill(xhi[himin], yhi[himin]);
3163 if (idchambers[ic] != 19.3)
3164 xystrip(hxygoodstrips, ic, is);
3165 if (idchambers[ic] != 19.3 && (ic == crpc1 || ic == crpc2))
3166 xystrip(hxygood1strips, ic, is);
3167 hxygoodtrgem0->Fill(xGem1st, yGem1st);
3168 if (p > 0.)
3169 hxygoodtrgem0p->Fill(xGem1st, yGem1st);
3170 else if (p < 0.)
3171 hxygoodtrgem0n->Fill(xGem1st, yGem1st);
3172 hpgoodhit->Fill(p); // GeV/c
3173 xc = xhic[himin];
3174 yc = yhic[himin];
3175 zc = zhic[himin];
3176 dz = zhi[himin] - xyz[2];
3177#if USEDCHXY == 0
3178 xrpc = xyz[0] + dz * tx;
3179 yrpc = xyz[1] + dz * ty;
3180 xrpc -= corxrpc;
3181#else
3182 xrpc = xyzdch[0] + dz * txdch;
3183 yrpc = xyzdch[1] + dz * tydch;
3184#endif
3185 hxyhit->Fill(xrpc - xhi[himin], yrpc - yhi[himin]);
3186 hxyghit->Fill(xGem - xyzdch[0], yGem - xyzdch[1]);
3187 if (idchambers[ic] < 100.f && fabs(lrd[himin]) < 1.)
3188 hxyhitlr->Fill(xrpc - xhi[himin], yrpc - yhi[himin]);
3189 if (idchambers[ic] > 100.f && fabs(lrd[himin]) < 3.)
3190 hxyhitlr->Fill(xrpc - xhi[himin], yrpc - yhi[himin]);
3191 if (idchambers[ic] < 100.f)
3192 hxdiffs->Fill(xhi[himin] - xc);
3193 if (idchambers[ic] > 100.f)
3194 hxdiffb->Fill(xhi[himin] - xc);
3195 if (idchambers[ic] < 100.f)
3196 hxxhits->Fill(xhi[himin] - xc, xrpc - xc);
3197 if (idchambers[ic] > 100.f)
3198 hxxhitb->Fill(xhi[himin] - xc, xrpc - xc);
3199 if (idchambers[ic] < 100.f)
3200 hlrs->Fill(lrd[himin]);
3201 if (idchambers[ic] > 100.f)
3202 hlrb->Fill(lrd[himin]);
3203 phitdxvsx->Fill(xrpc, xrpc - xhi[himin]);
3204 phitdyvsx->Fill(xrpc, yrpc - yhi[himin]);
3205 phitdxvsy->Fill(yrpc, xrpc - xhi[himin]);
3206 phitdyvsy->Fill(yrpc, yrpc - yhi[himin]);
3207 hhitdxvsx->Fill(xrpc, xrpc - xhi[himin]);
3208 if (p > 0.f) {
3209 hhitdxvsp->Fill(p, xrpc - xhi[himin]);
3210 hhitdyvsp->Fill(p, yrpc - yhi[himin]);
3211 if (xrpc < 0.)
3212 hhitdxvsp1->Fill(p, xrpc - xhi[himin]);
3213 else if (xrpc < 40.)
3214 hhitdxvsp2->Fill(p, xrpc - xhi[himin]);
3215 else if (xrpc < 80.)
3216 hhitdxvsp3->Fill(p, xrpc - xhi[himin]);
3217 else if (xrpc < 120.)
3218 hhitdxvsp4->Fill(p, xrpc - xhi[himin]);
3219 else if (xrpc < 160.)
3220 hhitdxvsp5->Fill(p, xrpc - xhi[himin]);
3221 } else if (p < 0.f) {
3222 hhitdxvspn->Fill(fabs(p), xrpc - xhi[himin]);
3223 hhitdyvspn->Fill(fabs(p), yrpc - yhi[himin]);
3224 }
3225 // DCH1 hits
3226 hghitdxvsx->Fill(xGem, xGem - xyzdch[0]);
3227 if (p > 0.f) {
3228 hghitdxvsp->Fill(p, xGem - xyzdch[0]);
3229 hghitdyvsp->Fill(p, yGem - xyzdch[1]);
3230 if (xGem < 0.)
3231 hghitdxvsp1->Fill(p, xGem - xyzdch[0]);
3232 else if (xGem < 40.)
3233 hghitdxvsp2->Fill(p, xGem - xyzdch[0]);
3234 else if (xGem < 80.)
3235 hghitdxvsp3->Fill(p, xGem - xyzdch[0]);
3236 else if (xGem < 120.)
3237 hghitdxvsp4->Fill(p, xGem - xyzdch[0]);
3238 else if (xGem < 160.)
3239 hghitdxvsp5->Fill(p, xGem - xyzdch[0]);
3240 hgdtxvsp->Fill(p, txGem - txdch);
3241 hgdtxrvsp->Fill(p, tx0 - txdch);
3242 hgdtx1vsp->Fill(p, (xGem - xyzdch[0]) / (zGem - zGem1st));
3243 hgdtxty->Fill(txGem - txdch, tyGem - tydch);
3244 } else if (p < 0.f) {
3245 hghitdxvspn->Fill(fabs(p), xGem - xyzdch[0]);
3246 hghitdyvspn->Fill(fabs(p), yGem - xyzdch[1]);
3247 hgdtxvspn->Fill(fabs(p), txGem - txdch);
3248 hgdtxrvspn->Fill(fabs(p), tx0 - txdch);
3249 hgdtx1vspn->Fill(fabs(p), (xGem - xyzdch[0]) / (zGem - zGem1st));
3250 hgdtxtyn->Fill(txGem - txdch, tyGem - tydch);
3251 }
3252 // Big systematic at edges
3253 if (xrpc > 110.)
3254 hchambigx->Fill(ic);
3255 if (yrpc > 75.)
3256 hchambigy->Fill(ic);
3257 hxvsxbigx->Fill(xhi[himin], xrpc);
3258 hyvsybigy->Fill(yhi[himin], yrpc);
3259 if (xrpc > 110.)
3260 hpbigx->Fill(p);
3261 if (yrpc > 75.)
3262 hpbigy->Fill(p);
3263 if (xrpc > 110.)
3264 hybigx->Fill(yrpc);
3265 if (yrpc > 75.)
3266 hxbigy->Fill(xrpc);
3267 if (xrpc > 110. && (ic == 21 || ic == 22))
3268 hlrbigx->Fill(lrd[himin]);
3269 if (xrpc > 110. && (ic == 21 || ic == 22))
3270 hxxhitbigx->Fill(xhi[himin] - xc, xrpc - xc);
3271 //
3272 cosa = sqrt(1. + tx * tx + ty * ty);
3273 dl = dz * cosa;
3274 lenr = le + dl;
3275 hltra->Fill(lenr);
3276 hidist = TMath::Sqrt(xc * xc + yc * yc + (zc - ztarg) * (zc - ztarg));
3277 hstrtr->Fill(is);
3278 hchatr->Fill(ic);
3279 hxytrtof->Fill(xrpc, yrpc);
3280
3281 hplatrz->Fill(zhi[himin]);
3282 hplatr->Fill(xhi[himin]);
3283 if (zhi[himin] < 600)
3284 hplatr1a->Fill(xhi[himin]);
3285 if (zhi[himin] > 605 && zhi[himin] < 610)
3286 hplatr1b->Fill(xhi[himin]);
3287 if (zhi[himin] > 625 && zhi[himin] < 630 && yhi[himin] < 20)
3288 hplatr2ac->Fill(xhi[himin]);
3289 if (zhi[himin] > 625 && zhi[himin] < 630 && yhi[himin] > 20)
3290 hplatr2au->Fill(xhi[himin]);
3291 if (zhi[himin] > 635 && zhi[himin] < 660 && yhi[himin] < 20)
3292 hplatr2bc->Fill(xhi[himin]);
3293 if (zhi[himin] > 635 && zhi[himin] < 660 && yhi[himin] > 20)
3294 hplatr2bu->Fill(xhi[himin]);
3295 if (zhi[himin] > 625 && zhi[himin] < 660 && yhi[himin] < 20)
3296 hplatr2abc->Fill(xhi[himin]);
3297
3298 if (ic == crpc1) {
3299 hplatramz->Fill(zrpcm);
3300 hplatram->Fill(xrpcm);
3301 if (zrpcm < 600)
3302 hplatram1a->Fill(xrpcm);
3303 if (zrpcm > 605 && zrpcm < 610)
3304 hplatram1b->Fill(xrpcm);
3305 if (zrpcm > 625 && zrpcm < 630 && yrpcm < 20)
3306 hplatram2ac->Fill(xrpcm);
3307 if (zrpcm > 625 && zrpcm < 630 && yrpcm > 20)
3308 hplatram2au->Fill(xrpcm);
3309 if (zrpcm > 635 && zrpcm < 660 && yrpcm < 20)
3310 hplatram2bc->Fill(xrpcm);
3311 if (zrpcm > 635 && zrpcm < 660 && yrpcm > 20)
3312 hplatram2bu->Fill(xrpcm);
3313 if (zrpcm > 625 && zrpcm < 660 && yrpcm < 20)
3314 hplatram2abc->Fill(xrpcm);
3315 } else if (ic == crpc2) {
3316 hplatramz->Fill(zrpcm1);
3317 hplatram->Fill(xrpcm1);
3318 if (zrpcm1 < 600)
3319 hplatram1a->Fill(xrpcm1);
3320 if (zrpcm1 > 605 && zrpcm1 < 610)
3321 hplatram1b->Fill(xrpcm);
3322 if (zrpcm1 > 625 && zrpcm1 < 630 && yrpcm1 < 20)
3323 hplatram2ac->Fill(xrpcm);
3324 if (zrpcm1 > 625 && zrpcm1 < 630 && yrpcm1 > 20)
3325 hplatram2au->Fill(xrpcm);
3326 if (zrpcm1 > 635 && zrpcm1 < 660 && yrpcm1 < 20)
3327 hplatram2bc->Fill(xrpcm);
3328 if (zrpcm1 > 635 && zrpcm1 < 660 && yrpcm1 > 20)
3329 hplatram2bu->Fill(xrpcm);
3330 if (zrpcm1 > 625 && zrpcm1 < 660 && yrpcm1 < 20)
3331 hplatram2abc->Fill(xrpcm);
3332 } else {
3333 hplatramz->Fill(zrpcm);
3334 hplatram->Fill(xrpcm);
3335 if (zrpcm < 600)
3336 hplatram1a->Fill(xrpcm);
3337 if (zrpcm > 605 && zrpcm < 610)
3338 hplatram1b->Fill(xrpcm);
3339 if (zrpcm > 625 && zrpcm < 630 && yrpcm < 20)
3340 hplatram2ac->Fill(xrpcm);
3341 if (zrpcm > 625 && zrpcm < 630 && yrpcm > 20)
3342 hplatram2au->Fill(xrpcm);
3343 if (zrpcm > 635 && zrpcm < 660 && yrpcm < 20)
3344 hplatram2bc->Fill(xrpcm);
3345 if (zrpcm > 635 && zrpcm < 660 && yrpcm > 20)
3346 hplatram2bu->Fill(xrpcm);
3347 if (zrpcm > 625 && zrpcm < 660 && yrpcm < 20)
3348 hplatram2abc->Fill(xrpcm);
3349 }
3350
3351 htoftr->Fill(tof[ic][is]);
3352 //
3353 tofr = 0.f;
3354 if (CALIBRATION == 0) {
3355 tofr = tof[ic][is] + tofcalmc[ic];
3356 } else if (CALIBRATION == 1) {
3357 tofr = tof[ic][is] + lenr / cpeak;
3358 } else if (CALIBRATION == 2) {
3359 tofr = tof[ic][is] + tofcalmc[ic];
3360 } else if (CALIBRATION == 3) {
3361 tofr = tof[ic][is] + tofcalmc[ic];
3362 } else {
3363 continue;
3364 }
3365 tofr0 = tof[ic][is];
3366 tofp = 0.f;
3367 tofpi = 0.f;
3368 beta = lenr / tofr / cvel;
3369 // Selection criteria
3370 if (beta <= 0.)
3371 continue;
3372 mass2 = p * p * (1.f / beta / beta - 1.f);
3373 mass = TMath::Sqrt(mass2);
3374 hpbeta->Fill(fabs(p), beta);
3375 hmass->Fill(mass2);
3376 hmassvsp->Fill(fabs(p), mass2);
3377
3378 massmin1 = MP2 - MP2 / (DMPSCALE1 * PMAX1) * (p - 0.5);
3379 massmax1 = MP2 + MP2 / (DMPSCALE2 * PMAX1) * (p - 0.5);
3380 if (p > 0.f && mass2 > massmin1 && mass2 < massmax1 && pmod > PMIN && pmod < PMAX) {
3381 tofp = (lenr / 29.97925f) * TMath::Sqrt(MP2 + p * p) / p;
3382 tcor = tofp - tofr;
3383 tcorc = tcor - tofcalc[ic];
3384 tcors = tcor - tofcals[ic][is];
3385 tcalibrc->Fill(ic, tcorc);
3386 tcalibrs->Fill(ic, is, tcors);
3387 htofp->Fill(tofr0);
3388 massmin2 = MP2 - MP2 / (DMPSCALET1 * PMAX2) * (p - 0.5);
3389 massmax2 = MP2 + MP2 / (DMPSCALET2 * PMAX2) * (p - 0.5);
3390 if (mass2 > massmin2 && mass2 < massmax2) {
3391 hdtpc->Fill(tcorc);
3392 hdtpcvsp->Fill(p, tcorc);
3393 hdtps->Fill(tcors);
3394 hdtpsvsp->Fill(p, tcors);
3395 hdtpsvscvss->Fill(ic, is, tcors);
3396 hdtpcvscvsp->Fill(ic, p, tcors);
3397 if (p > PRES)
3398 hdtpcplim->Fill(tcorc);
3399 if (p > PRES1)
3400 hdtpcp1lim->Fill(tcorc);
3401 if (p < 2.0f)
3402 hdtpcp2lim->Fill(tcorc);
3403 if (p >= 2.0f && p < 5.0f)
3404 hdtpcp3lim->Fill(tcorc);
3405 if (tofWidths[ic][is] > WMIN && tofWidths[ic][is] < WMAX) {
3406 hdtpcwlim->Fill(tcorc);
3407 hdtpcvspwlim->Fill(p, tcorc);
3408 if (p > PRES)
3409 hdtpcwplim->Fill(tcorc);
3410 if (p > PRES1)
3411 hdtpcwp1lim->Fill(tcorc);
3412 }
3413 }
3414 }
3415 // massmaxpi = 0.1 + MPIMAX*TMath::Abs(p-0.5)/PMAXPI/DMPISCALE; // Kapishin
3416 massmaxpi = 0.1 + MPIMAX * TMath::Abs(pmod - 0.5) / PMAXPI;
3417 if (p > 0 && massmaxpi > massmin1)
3418 massmaxpi = massmin1;
3419 // massminpi =-0.1 - MPIMAX*TMath::Abs(p-0.5)/PMAXPI/DMPISCALE; // Kapishin
3420 massminpi = -0.1 - MPIMAX * TMath::Abs(pmod - 0.5) / PMAXPI;
3421 if (mass2 < massmaxpi && mass2 > massminpi && pmod > PMIN && pmod < PMAXPI) {
3422 tofpi = (lenr / 29.97925f) * TMath::Sqrt(MPI2 + p * p) / pmod;
3423 tcorpi = tofpi - tofr;
3424 tcorcpi = tcorpi - tofcalc[ic];
3425 tcorspi = tcorpi - tofcals[ic][is];
3426 tcalibrc->Fill(ic, tcorcpi);
3427 tcalibrs->Fill(ic, is, tcorspi);
3428 }
3429 timepeak = tofcalmc[ic] + tofcalc[ic];
3430 betapeak = lenr / timepeak / cvel;
3431 tpeak->Fill(ic, timepeak);
3432 bpeak->Fill(ic, betapeak);
3433 tofrc = tofr + tofcalc[ic];
3434 tofrs = tofr + tofcals[ic][is];
3435 betac = lenr / tofrc / cvel;
3436 betas = lenr / tofrs / cvel;
3437 masss2 = p * p * (1.f / betas / betas - 1.f);
3438 masss = TMath::Sqrt(masss2);
3439 massc2 = p * p * (1.f / betac / betac - 1.f);
3440 massc = TMath::Sqrt(massc2);
3441 tri = IdTrig[trackRunId];
3442 if (tri == 20)
3443 tri = 40;
3444 else if (tri == 41)
3445 tri = 41;
3446 else if (tri == 42)
3447 tri = 42;
3448 else if (tri == 46)
3449 tri = 43;
3450 else if (tri == 44)
3451 tri = 0;
3452 else if (tri == 45)
3453 tri = 0;
3454 else if (tri == 46)
3455 tri = 0;
3456 else if (tri == 47)
3457 tri = 44;
3458 else if (tri == 48)
3459 tri = 0;
3460 else if (tri == 49)
3461 tri = 45;
3462 else
3463 tri = 0;
3464 tar = Ntar[trackRunId];
3465 if (p > 0) {
3466 hpbetac->Fill(p, betac);
3467 hmassc->Fill(massc2);
3468 hmasscvsp->Fill(p, massc2);
3469 hpbetas->Fill(p, betas);
3470 hmasss->Fill(masss2);
3471 hmasssvsp->Fill(p, masss2);
3472 if (p < 1.5) {
3473 hmasss15->Fill(masss2);
3474 if (Ntar[trackRunId] > 0 && tri >= 40)
3475 hmasss15tt->Fill(masss2, tar, tri - 40);
3476 hmassc15->Fill(massc2);
3477 }
3478 if (p < 2.0) {
3479 hmasss20->Fill(masss2);
3480 if (Ntar[trackRunId] > 0 && tri >= 40)
3481 hmasss20tt->Fill(masss2, tar, tri - 40);
3482 hmassc20->Fill(massc2);
3483 }
3484 // Fragments
3485 nurun = trackRunId;
3486 nuev = trackEvId;
3487 m2fr = masss2;
3488 bfr = betas;
3489 efr = TMath::Sqrt(pfr * pfr + masss2);
3490 yfr = 0.5 * TMath::Log((efr + pzfr) / (efr - pzfr));
3491 if (masss2 >= MFRMIN)
3492 tfr->Fill();
3493 Double_t pfrmax = PFRMAX;
3494 Int_t ftype = -1;
3495 if (masss2 < M1Z1MIN) {
3496 ftype = 0;
3497 pfrmax = PFRMAX;
3498 } else if (masss2 >= M1Z1MIN && masss2 < M1Z1MAX) {
3499 ftype = 1;
3500 pfrmax = PFRMAX;
3501 } else if (masss2 >= M3Z2MIN && masss2 < M3Z2MAX) {
3502 ftype = 2;
3503 pfrmax = PFRMAX + 1.;
3504 } else if (masss2 >= M2Z1MIN && masss2 < M2Z1MAX) {
3505 ftype = 3;
3506 pfrmax = PFRMAX + 2.;
3507 } else if (masss2 >= M3Z1MIN && masss2 < M3Z1MAX) {
3508 ftype = 4;
3509 pfrmax = PFRMAX + 3.;
3510 }
3511 if (p < pfrmax) {
3512 if (ftype == 0) {
3513 hhitdxvsp_pi->Fill(p, xrpc - xhi[himin]);
3514 hghitdxvsp_pi->Fill(p, xGem - xyzdch[0]);
3515 } else if (ftype == 1) {
3516 hhitdxvsp_p->Fill(p, xrpc - xhi[himin]);
3517 hghitdxvsp_p->Fill(p, xGem - xyzdch[0]);
3518 } else if (ftype == 3) {
3519 hhitdxvsp_d->Fill(p, xrpc - xhi[himin]);
3520 hghitdxvsp_d->Fill(p, xGem - xyzdch[0]);
3521 }
3522 hyp0->Fill(yfr, ptfr);
3523 hmfr0->Fill(masss2);
3524 if (Ntar[trackRunId] > 0 && tri >= 40)
3525 hmfr0tt->Fill(m2fr, tar, tri - 40);
3526 if (ftype <= 0)
3527 continue;
3528 hmfrall->Fill(masss2);
3529 if (Ntar[trackRunId] > 0 && tri >= 40)
3530 hmfralltt->Fill(m2fr, tar, tri - 40);
3531 hypall->Fill(yfr, ptfr);
3532 hypall1->Fill(yfr, ptfr);
3533 if (ftype == 1) {
3534 hyp_p->Fill(yfr, ptfr);
3535 hyp_p1->Fill(yfr, ptfr);
3536 hmfr->Fill(masss2);
3537 } else if (ftype == 2) {
3538 hyp_he3->Fill(yfr, ptfr);
3539 hyp_he31->Fill(yfr, ptfr);
3540 hmfr->Fill(masss2);
3541 } else if (ftype == 3) {
3542 hyp_d->Fill(yfr, ptfr);
3543 hyp_d1->Fill(yfr, ptfr);
3544 hmfr->Fill(masss2);
3545 } else if (ftype == 4) {
3546 hyp_t->Fill(yfr, ptfr);
3547 hyp_t1->Fill(yfr, ptfr);
3548 hmfr->Fill(masss2);
3549 };
3550 if (ftype <= 4 && Ntar[trackRunId] > 0 && tri >= 40)
3551 hmfrtt->Fill(m2fr, tar, tri - 40);
3552 }
3553 //
3554 } else {
3555 hpbetacm->Fill(fabs(p), betac);
3556 hmasscm->Fill(massc2);
3557 hmasscmvsp->Fill(fabs(p), massc2);
3558 hpbetasm->Fill(fabs(p), betas);
3559 hmasssm->Fill(masss2);
3560 hmasssmvsp->Fill(fabs(p), masss2);
3561 }
3562 } // hit is good!
3563 } // hit exist!
3564 } // loop on pairs main type (gem+dch_track+tof700_hit)
3565
3566 int nwin1 = 0, nwin2 = 0, nwins = 0;
3567 Double_t dxr = 0., dyr = 0.;
3568 Double_t dxr0 = 0., dyr0 = 0.;
3569 Double_t dtxr = 0., dtyr = 0.;
3570 for (int itg = 0; itg < ntrgem; itg++) {
3571 nwin1 = 0;
3572 nwin2 = 0;
3573 nwins = 0;
3574 for (int itd = 0; itd < ntrdch; itd++) {
3575 dxr = xtrgem[itg] - xtrdch[itd];
3576 dyr = ytrgem[itg] - ytrdch[itd];
3577 dxr0 = xtrgem0[itg] - xtrdch[itd];
3578 // dyr0 = ytrgem0[itg]-ytrdch[itd];
3579 dtxr = txtrgem[itg] - txtrdch[itd];
3580 dtyr = tytrgem[itg] - tytrdch[itd];
3581 if (pgem[itg] > 0.) {
3582 hghitdxvspa->Fill(pgem[itg], dxr);
3583 hghitdxvspar->Fill(pgem[itg], dxr0);
3584 hghitdyvspa->Fill(pgem[itg], dyr);
3585 hgdtx1vspall->Fill(pgem[itg], (xtrgem[itg] - xtrdch[itd]) / (ztrgem[itg] - ztrgem1st[itg]));
3586 } else if (pgem[itg] < 0.) {
3587 hghitdxvspan->Fill(-pgem[itg], dxr);
3588 hghitdxvsparn->Fill(-pgem[itg], dxr0);
3589 hgdtx1vspnall->Fill(-pgem[itg], (xtrgem[itg] - xtrdch[itd]) / (ztrgem[itg] - ztrgem1st[itg]));
3590 }
3591 hdxyrealall->Fill(dxr, dyr);
3592 hdtxtyrealall->Fill(dtxr, dtyr);
3593 if (dxr >= -DXGEMDCHMAX && dxr <= +DXGEMDCHMAX && dyr >= -DYGEMDCHMAX
3594 && dyr <= +DYGEMDCHMAX /* && Chi2m <= 30.f && chi2 > 30.f*/)
3595 {
3596 hdtxtyrealallw->Fill(dtxr, dtyr);
3597 if (pgem[itg] > 0.) {
3598 hghitdxvspw1->Fill(pgem[itg], dxr);
3599 hghitdyvspw1->Fill(pgem[itg], dyr);
3600 } else if (pgem[itg] < 0.) {
3601 hghitdxvspw1n->Fill(-pgem[itg], dxr);
3602 }
3603 nwin1++;
3604 }
3605 if (dxr0 >= -DXGEMDCHMAX && dxr0 <= +DXGEMDCHMAX && dyr >= -DYGEMDCHMAX
3606 && dyr <= +DYGEMDCHMAX /* && Chi2m <= 30.f && chi2 > 30.f*/)
3607 {
3608 if (pgem[itg] > 0.) {
3609 hghitdxvspw1r->Fill(pgem[itg], dxr0);
3610 } else if (pgem[itg] < 0.) {
3611 hghitdxvspw1rn->Fill(-pgem[itg], dxr);
3612 }
3613 }
3614 if (dxr >= -2. * DXGEMDCHMAX && dxr <= +2. * DXGEMDCHMAX && dyr >= -2. * DYGEMDCHMAX
3615 && dyr <= +2. * DYGEMDCHMAX /* && Chi2m <= 30.f && chi2 > 30.f*/)
3616 {
3617 if (pgem[itg] > 0.) {
3618 hghitdxvspw2->Fill(pgem[itg], dxr);
3619 hghitdyvspw2->Fill(pgem[itg], dyr);
3620 } else if (pgem[itg] < 0.) {
3621 hghitdxvspw2n->Fill(-pgem[itg], dxr);
3622 }
3623 nwin2++;
3624 }
3625 if (dxr0 >= -2. * DXGEMDCHMAX && dxr0 <= +2. * DXGEMDCHMAX && dyr >= -2. * DYGEMDCHMAX
3626 && dyr <= +2. * DYGEMDCHMAX /* && Chi2m <= 30.f && chi2 > 30.f*/)
3627 {
3628 if (pgem[itg] > 0.) {
3629 hghitdxvspw2r->Fill(pgem[itg], dxr0);
3630 hgdtxvspall->Fill(pgem[itg], dtxr);
3631 if (pgem[itg] < 1.5)
3632 hgdtxvsdxall->Fill(dxr0, dtxr);
3633 } else if (pgem[itg] < 0.) {
3634 hghitdxvspw2rn->Fill(-pgem[itg], dxr0);
3635 hgdtxvspnall->Fill(-pgem[itg], dtxr);
3636 }
3637 }
3638 if (NDXsigma > 0 && dxtrgem[itg] > 0. && dytrgem[itg] > 0.) {
3639 if (fabs(dxr) <= NDXsigma * dxtrgem[itg] && fabs(dyr) <= NDXsigma * dytrgem[itg]) {
3640 if (pgem[itg] > 0.) {
3641 hghitdxvspw3->Fill(pgem[itg], dxr);
3642 hghitdyvspw3->Fill(pgem[itg], dyr);
3643 } else if (pgem[itg] < 0.) {
3644 hghitdxvspw3n->Fill(-pgem[itg], dxr);
3645 }
3646 nwins++;
3647 }
3648 }
3649 if (NDXsigma > 0 && dxtrgem[itg] > 0. && dytrgem[itg] > 0.) {
3650 if (fabs(dxr0) <= NDXsigma * dxtrgem[itg] && fabs(dyr) <= NDXsigma * dytrgem[itg]) {
3651 if (pgem[itg] > 0.) {
3652 hghitdxvspw3r->Fill(pgem[itg], dxr0);
3653 } else if (pgem[itg] < 0.) {
3654 hghitdxvspw3rn->Fill(-pgem[itg], dxr);
3655 }
3656 }
3657 }
3658 }
3659 hnwin1->Fill(nwin1);
3660 hnwin2->Fill(nwin2);
3661 hnwins->Fill(nwins);
3662 }
3663
3664 for (int ict = 0; ict < NUMBER_CHAMBERS; ict++) {
3665 if (ncl[ict] <= 0)
3666 continue;
3667 if (idchambers[ict] < 100.)
3668 hncltrvschambs->Fill(idchambers[ict] != 19.3 ? (Int_t)idchambers[ict] : 49, ncltr[ict]);
3669 else
3670 hncltrvschambb->Fill((Int_t)idchambers[ict] - 100, ncltr[ict]);
3671 if (idchambers[ict] < 100.)
3672 hncltrvschambs1->Fill(idchambers[ict] != 19.3 ? (Int_t)idchambers[ict] : 49, ncltr[ict]);
3673 else
3674 hncltrvschambb1->Fill((Int_t)idchambers[ict] - 100, ncltr[ict]);
3675 }
3676 hntr1->Fill(ntr1);
3677 hncltr->Fill(ntr0);
3678 Ntr1 += ntr1;
3679 Ntr1g += ntr1g;
3680 Ntr2g += ntr2g;
3681 hntr0->Fill(ntr0);
3682 Ntr0 += ntr0;
3683 Ntr02 += ntr02;
3684 // t_out->Fill();
3685 hntrdch0->Fill(ntrdch0);
3686 hntrdch->Fill(ntrdch);
3687 hntrgem0->Fill(ntrgem0);
3688 hntrgemcut->Fill(ntrgemcut);
3689 hntrgem->Fill(ntrgem);
3690 hntrgemdch->Fill(ntrgem, ntrdch);
3691
3692 if (iEv % 50000 == 0) {
3693 hdxyeff->Divide(hdxytof, hdxy);
3694 hdxeff->Divide((projtmp = hdxytof->ProjectionX()), (projtmp1 = hdxy->ProjectionX()));
3695 if (projtmp)
3696 delete projtmp;
3697 if (projtmp1)
3698 delete projtmp1;
3699 hdyeff->Divide((projtmp = hdxytof->ProjectionY()), (projtmp1 = hdxy->ProjectionY()));
3700 if (projtmp)
3701 delete projtmp;
3702 if (projtmp1)
3703 delete projtmp1;
3704 hdxyeff2->Divide(hdxytof2, hdxy2);
3705 hxyeff2->Divide(hxygoodhitgem2, hxygoodtrgem2);
3706 hxyeff->Divide(hxygoodhit, hxygoodtr);
3707 hxyeffp->Divide(hxygoodhitp, hxygoodtrp);
3708 hxyeffn->Divide(hxygoodhitn, hxygoodtrn);
3709 hxeff->Divide((projtmp = hxygoodhit->ProjectionX()), (projtmp1 = hxygoodtr->ProjectionX()));
3710 if (projtmp)
3711 delete projtmp;
3712 if (projtmp1)
3713 delete projtmp1;
3714 hyeff->Divide((projtmp = hxygoodhit->ProjectionY()), (projtmp1 = hxygoodtr->ProjectionY()));
3715 if (projtmp)
3716 delete projtmp;
3717 if (projtmp1)
3718 delete projtmp1;
3719 hpeff->Divide(hpgoodhit, hpgemdch);
3720 hpeffmg->Divide(hpgemdch, hptr);
3721 hpeff2->Divide(hpgoodhit2, hpgemdch2);
3722 hpeff2gt->Divide(hpgoodhit2, hpgemtof);
3723 hpeffmg2->Divide(hpgemdch2, hpgemtof);
3724 hpeffmg2f->Divide(hpgemdch2, hptr);
3725 hpeffgemtof->Divide(hpgemtof, hptr);
3726 hxyeffmg->Divide(hxygoodtrgem, hxygem);
3727 hxyeffmg2->Divide(hxygoodtrgem2, hxygoodhit2);
3728 hxyeffmg2f->Divide(hxygoodtrgem2, hxygem);
3729 hxyefftrgem0->Divide(hxygoodtrgem0, hxygem0);
3730 hxyefftrgem0p->Divide(hxygoodtrgem0p, hxygem0p);
3731 hxyefftrgem0n->Divide(hxygoodtrgem0n, hxygem0n);
3732 hxyeffmd->Divide(hxygoodtr, hxydch);
3733 hxyeffdg->Divide(hxydch, hxygem);
3734 hxyeffgd->Divide(hxygem, hxydch);
3735 hxyeffm1d->Divide(hxygoodhit1, hxydch1);
3736 hxyeffgemtof->Divide(hxygoodhit2, hxygem);
3737 hxyeffgemtofdchtof1->Divide(hxygemtofdchtof1, hxygemtofdchtof);
3738 hxyeffgemtofdchtof2->Divide(hxygemtofdchtof2, hxygemtofdchtof);
3739 hxyeffgemtofdchtofd1->Divide(hxygemtofdchtofd1, hxygemtofdchtofd);
3740 hxyeffgemtofdchtofd2->Divide(hxygemtofdchtofd2, hxygemtofdchtofd);
3741 hpeffgemtofdchtof1->Divide(hpgemtofdchtof1, hpgemtofdchtof);
3742 hpeffgemtofdchtof2->Divide(hpgemtofdchtof2, hpgemtofdchtof);
3743 hxybadhit->Add(hxygoodtr, hxygoodhit, 1., -1.);
3744 hxybadhita->Add(hxygoodtr, hxygoodhita, 1., -1.);
3745 hpbadhit->Add(hpgemdch, hpgoodhit, 1., -1.);
3746 // hnclchambeffs->Divide(hncltrvschambs,hnclvschambs);
3747 hchambeffs->Divide(hncltrvschambs1, hnclvschambs1);
3748 // hnclchambeffb->Divide(hncltrvschambb,hnclvschambb);
3749 hchambeffb->Divide(hncltrvschambb1, hnclvschambb1);
3750 hxyclustereff->Divide(hxygoodcluster, hxycluster);
3751 hxyclustereffgem->Divide(hxygoodclustergem, hxycluster);
3752 hxyclustereffdch->Divide(hxygoodclusterdch, hxycluster);
3753 hxystripseff->Divide(hxygoodstrips, hxystrips);
3754 hxytrackstripseff->Divide(hxygoodstrips, hxytrackstrips);
3755 hxytrackstripseff1->Divide(hxygood1strips, hxytrackstrips);
3756
3757 hplaeffz->Divide(hplatrz, hplaz);
3758 hplaeff->Divide(hplatr, hpla);
3759 hplaeff1a->Divide(hplatr1a, hpla1a);
3760 hplaeff1b->Divide(hplatr1b, hpla1b);
3761 hplaeff2ac->Divide(hplatr2ac, hpla2ac);
3762 hplaeff2au->Divide(hplatr2au, hpla2au);
3763 hplaeff2bc->Divide(hplatr2bc, hpla2bc);
3764 hplaeff2bu->Divide(hplatr2bu, hpla2bu);
3765 hplaeff2abc->Divide(hplatr2abc, hpla2abc);
3766
3767 hplaeffaz->Divide(hplatramz, hplatraz);
3768 hplaeffa->Divide(hplatram, hplatra);
3769 hplaeffa1a->Divide(hplatram1a, hplatra1a);
3770 hplaeffa1b->Divide(hplatram1b, hplatra1b);
3771 hplaeffa2ac->Divide(hplatram2ac, hplatra2ac);
3772 hplaeffa2au->Divide(hplatram2au, hplatra2au);
3773 hplaeffa2bc->Divide(hplatram2bc, hplatra2bc);
3774 hplaeffa2bu->Divide(hplatram2bu, hplatra2bu);
3775 hplaeffa2abc->Divide(hplatram2abc, hplatra2abc);
3776
3777 if (FLAG < 0) {
3778 printf("Number of tracks %d, per event %f\n", Ntr, (float)Ntr / nEvents);
3779 printf("GEM+DCH1+DCH2 tracks %d, per event %f (%f%% per track)\n", Ntr1, (float)Ntr1 / nEvents,
3780 (float)Ntr1 / Ntr * 100.f);
3781 printf("Good GEM+DCH1+DCH2 tracks %d, per event %f (%f%% per track)\n", Ntr0, (float)Ntr0 / nEvents,
3782 (float)Ntr0 / Ntr * 100.f);
3783 } else if (FLAG > 0) {
3784 printf("Number of tracks %d, per event %f\n", Ntr, (float)Ntr / nEvents);
3785 printf("GEM+DCH1 tracks %d, per event %f (%f%% per track)\n", Ntr1, (float)Ntr1 / nEvents,
3786 (float)Ntr1 / Ntr * 100.f);
3787 printf("Good GEM+DCH1 tracks %d, per event %f (%f%% per track)\n", Ntr0, (float)Ntr0 / nEvents,
3788 (float)Ntr0 / Ntr * 100.f);
3789 } else {
3790 printf("Number of tracks %d, per event %f\n", Ntr, (float)Ntr / nEvents);
3791 printf("GEM+DCH tracks %d, per event %f (%f%% per track)\n", Ntr1, (float)Ntr1 / nEvents,
3792 Ntr > 0 ? (float)Ntr1 / Ntr * 100.f : 0.f);
3793 printf("Good GEM+DCH tracks %d, per event %f (%f%% per valid track)\n", Ntr1g, (float)Ntr1g / nEvents,
3794 Ntr1 > 0 ? (float)Ntr1g / Ntr1 * 100.f : 0.f);
3795 printf("Matched GEM+DCH tracks %d, per event %f (%f%% per good track)\n", Ntr0, (float)Ntr0 / nEvents,
3796 Ntr1g > 0 ? (float)Ntr0 / Ntr1g * 100.f : 0.f);
3797 printf("Good GEMTOF+DCH tracks %d, per event %f (%f%% per valid track)\n", Ntr2g,
3798 (float)Ntr2g / nEvents, Ntr1 > 0 ? (float)Ntr2g / Ntr1 * 100.f : 0.f);
3799 printf("Matched GEMTOF+DCH tracks %d, per event %f (%f%% per good track)\n", Ntr02,
3800 (float)Ntr02 / nEvents, Ntr2g > 0 ? (float)Ntr02 / Ntr2g * 100.f : 0.f);
3801 }
3802
3803 if (f) {
3804 tfr->AutoSave("FlushBaskets");
3805 f->Write(NULL, TObject::kOverwrite);
3806 }
3807
3808 if (WRITE_CALIBRATION) {
3809 char fname_calibr_root[128], *delim = 0;
3810 strcpy(fname_calibr_root, gSystem->BaseName(fnametof700));
3811 if ((delim = strrchr(fname_calibr_root, (int)'.')))
3812 *delim = '\0';
3813 strcat(fname_calibr_root, "_calibration.root");
3814 TFile* fc = new TFile(fname_calibr_root, "RECREATE", "Proton mass based calibration of BmnTOF700");
3815 tcalibrs->Write();
3816 tcalibrc->Write();
3817 fc->Close();
3818 }
3819 }
3820 } // event loop
3821
3822 hdxyeff->Divide(hdxytof, hdxy);
3823 hdxeff->Divide((projtmp = hdxytof->ProjectionX()), (projtmp1 = hdxy->ProjectionX()));
3824 if (projtmp)
3825 delete projtmp;
3826 if (projtmp1)
3827 delete projtmp1;
3828 hdyeff->Divide((projtmp = hdxytof->ProjectionY()), (projtmp1 = hdxy->ProjectionY()));
3829 if (projtmp)
3830 delete projtmp;
3831 if (projtmp1)
3832 delete projtmp1;
3833 hdxyeff2->Divide(hdxytof2, hdxy2);
3834 hxyeff2->Divide(hxygoodhitgem2, hxygoodtrgem2);
3835 hxyeff->Divide(hxygoodhit, hxygoodtr);
3836 hxyeffp->Divide(hxygoodhitp, hxygoodtrp);
3837 hxyeffn->Divide(hxygoodhitn, hxygoodtrn);
3838 hxeff->Divide((projtmp = hxygoodhit->ProjectionX()), (projtmp1 = hxygoodtr->ProjectionX()));
3839 if (projtmp)
3840 delete projtmp;
3841 if (projtmp1)
3842 delete projtmp1;
3843 hyeff->Divide((projtmp = hxygoodhit->ProjectionY()), (projtmp1 = hxygoodtr->ProjectionY()));
3844 if (projtmp)
3845 delete projtmp;
3846 if (projtmp1)
3847 delete projtmp1;
3848 hpeff->Divide(hpgoodhit, hpgemdch);
3849 hpeffmg->Divide(hpgemdch, hptr);
3850 hpeff2->Divide(hpgoodhit2, hpgemdch2);
3851 hpeff2gt->Divide(hpgoodhit2, hpgemtof);
3852 hpeffmg2->Divide(hpgemdch2, hpgemtof);
3853 hpeffmg2f->Divide(hpgemdch2, hptr);
3854 hpeffgemtof->Divide(hpgemtof, hptr);
3855 hxyeffmg->Divide(hxygoodtrgem, hxygem);
3856 hxyeffmg2->Divide(hxygoodtrgem2, hxygoodhit2);
3857 hxyeffmg2f->Divide(hxygoodtrgem2, hxygem);
3858 hxyefftrgem0->Divide(hxygoodtrgem0, hxygem0);
3859 hxyefftrgem0p->Divide(hxygoodtrgem0p, hxygem0p);
3860 hxyefftrgem0n->Divide(hxygoodtrgem0n, hxygem0n);
3861 hxyeffmd->Divide(hxygoodtr, hxydch);
3862 hxyeffdg->Divide(hxydch, hxygem);
3863 hxyeffgd->Divide(hxygem, hxydch);
3864 hxyeffm1d->Divide(hxygoodhit1, hxydch1);
3865 hxyeffgemtof->Divide(hxygoodhit2, hxygem);
3866 hxyeffgemtofdchtof1->Divide(hxygemtofdchtof1, hxygemtofdchtof);
3867 hxyeffgemtofdchtof2->Divide(hxygemtofdchtof2, hxygemtofdchtof);
3868 hxyeffgemtofdchtofd1->Divide(hxygemtofdchtofd1, hxygemtofdchtofd);
3869 hxyeffgemtofdchtofd2->Divide(hxygemtofdchtofd2, hxygemtofdchtofd);
3870 hpeffgemtofdchtof1->Divide(hpgemtofdchtof1, hpgemtofdchtof);
3871 hpeffgemtofdchtof2->Divide(hpgemtofdchtof2, hpgemtofdchtof);
3872 hxybadhit->Add(hxygoodtr, hxygoodhit, 1., -1.);
3873 hxybadhita->Add(hxygoodtr, hxygoodhita, 1., -1.);
3874 hpbadhit->Add(hpgemdch, hpgoodhit, 1., -1.);
3875 // hnclchambeffs->Divide(hncltrvschambs,hnclvschambs);
3876 hchambeffs->Divide(hncltrvschambs1, hnclvschambs1);
3877 // hnclchambeffb->Divide(hncltrvschambb,hnclvschambb);
3878 hchambeffb->Divide(hncltrvschambb1, hnclvschambb1);
3879 hxyclustereff->Divide(hxygoodcluster, hxycluster);
3880 hxyclustereffgem->Divide(hxygoodclustergem, hxycluster);
3881 hxyclustereffdch->Divide(hxygoodclusterdch, hxycluster);
3882 hxystripseff->Divide(hxygoodstrips, hxystrips);
3883 hxytrackstripseff->Divide(hxygoodstrips, hxytrackstrips);
3884 hxytrackstripseff1->Divide(hxygood1strips, hxytrackstrips);
3885
3886 hplaeffz->Divide(hplatrz, hplaz);
3887 hplaeff->Divide(hplatr, hpla);
3888 hplaeff1a->Divide(hplatr1a, hpla1a);
3889 hplaeff1b->Divide(hplatr1b, hpla1b);
3890 hplaeff2ac->Divide(hplatr2ac, hpla2ac);
3891 hplaeff2au->Divide(hplatr2au, hpla2au);
3892 hplaeff2bc->Divide(hplatr2bc, hpla2bc);
3893 hplaeff2bu->Divide(hplatr2bu, hpla2bu);
3894 hplaeff2abc->Divide(hplatr2abc, hpla2abc);
3895
3896 hplaeffaz->Divide(hplatramz, hplatraz);
3897 hplaeffa->Divide(hplatram, hplatra);
3898 hplaeffa1a->Divide(hplatram1a, hplatra1a);
3899 hplaeffa1b->Divide(hplatram1b, hplatra1b);
3900 hplaeffa2ac->Divide(hplatram2ac, hplatra2ac);
3901 hplaeffa2au->Divide(hplatram2au, hplatra2au);
3902 hplaeffa2bc->Divide(hplatram2bc, hplatra2bc);
3903 hplaeffa2bu->Divide(hplatram2bu, hplatra2bu);
3904 hplaeffa2abc->Divide(hplatram2abc, hplatra2abc);
3905
3906 if (FLAG < 0) {
3907 printf("Number of tracks %d, per event %f\n", Ntr, (float)Ntr / nEvents);
3908 printf("GEM+DCH1+DCH2 tracks %d, per event %f (%f%% per track)\n", Ntr1, (float)Ntr1 / nEvents,
3909 (float)Ntr1 / Ntr * 100.f);
3910 printf("Good GEM+DCH1+DCH2 tracks %d, per event %f (%f%% per track)\n", Ntr0, (float)Ntr0 / nEvents,
3911 (float)Ntr0 / Ntr * 100.f);
3912 } else if (FLAG > 0) {
3913 printf("Number of tracks %d, per event %f\n", Ntr, (float)Ntr / nEvents);
3914 printf("GEM+DCH1 tracks %d, per event %f (%f%% per track)\n", Ntr1, (float)Ntr1 / nEvents,
3915 (float)Ntr1 / Ntr * 100.f);
3916 printf("Good GEM+DCH1 tracks %d, per event %f (%f%% per track)\n", Ntr0, (float)Ntr0 / nEvents,
3917 (float)Ntr0 / Ntr * 100.f);
3918 } else {
3919 printf("Number of tracks %d, per event %f\n", Ntr, (float)Ntr / nEvents);
3920 printf("GEM+DCH tracks %d, per event %f (%f%% per track)\n", Ntr1, (float)Ntr1 / nEvents,
3921 Ntr > 0 ? (float)Ntr1 / Ntr * 100.f : 0.f);
3922 printf("Good GEM+DCH tracks %d, per event %f (%f%% per valid track)\n", Ntr1g, (float)Ntr1g / nEvents,
3923 Ntr1 > 0 ? (float)Ntr1g / Ntr1 * 100.f : 0.f);
3924 printf("Matched GEM+DCH tracks %d, per event %f (%f%% per good track)\n", Ntr0, (float)Ntr0 / nEvents,
3925 Ntr1g > 0 ? (float)Ntr0 / Ntr1g * 100.f : 0.f);
3926 printf("Good GEMTOF+DCH tracks %d, per event %f (%f%% per valid track)\n", Ntr2g, (float)Ntr2g / nEvents,
3927 Ntr1 > 0 ? (float)Ntr2g / Ntr1 * 100.f : 0.f);
3928 printf("Matched GEMTOF+DCH tracks %d, per event %f (%f%% per good track)\n", Ntr02, (float)Ntr02 / nEvents,
3929 Ntr2g > 0 ? (float)Ntr02 / Ntr2g * 100.f : 0.f);
3930 }
3931
3932 if (f) {
3933 tfr->AutoSave("FlushBaskets");
3934 f->Write(NULL, TObject::kOverwrite);
3935 }
3936
3937 if (WRITE_CALIBRATION) {
3938 char fname_calibr_root[128], *delim = 0;
3939 strcpy(fname_calibr_root, gSystem->BaseName(fnametof700));
3940 if ((delim = strrchr(fname_calibr_root, (int)'.')))
3941 *delim = '\0';
3942 strcat(fname_calibr_root, "_calibration.root");
3943 TFile* fc = new TFile(fname_calibr_root, "RECREATE", "Proton mass based calibration of BmnTOF700");
3944 tcalibrs->Write();
3945 tcalibrc->Write();
3946 fc->Close();
3947 }
3948
3949 return;
3950}
3951
3953{
3954 // example of macro called when a mouse event occurs in a pad.
3955 // Example:
3956 // Root > TFile f("hsimple.root");
3957 // Root > hpxpy.Draw();
3958 // Root > c1.AddExec("exsel","select_hist()");
3959 // When moving the mouse in the canvas, a second canvas shows the
3960 // projection along X of the bin corresponding to the Y position
3961 // of the mouse. The resulting histogram is fitted with a gaussian.
3962 // A "dynamic" line shows the current bin position in Y.
3963 // This more elaborated example can be used as a starting point
3964 // to develop more powerful interactive applications exploiting CINT
3965 // as a development engine.
3966 // Author: Rene Brun
3967
3968 int event = gPad->GetEvent();
3969 if (event != 11)
3970 return;
3971
3972 TObject* select = gPad->GetSelected();
3973 if (!select)
3974 return;
3975 if (!(select->InheritsFrom("TH1")))
3976 return;
3977
3978 // create or set the new canvas c2
3979 TCanvas* csingle = 0;
3980 if ((csingle = (TCanvas*)gROOT->GetListOfCanvases()->FindObject("csingle")))
3981 ;
3982 else
3983 csingle = new TCanvas("csingle");
3984 csingle->cd();
3985
3986 // draw slice corresponding to mouse position
3987 if (!(select->InheritsFrom("TH1F"))) {
3988 TH1F* h = (TH1F*)select;
3989 h->Draw();
3990 } else if (!(select->InheritsFrom("TH2F"))) {
3991 TH2F* h = (TH2F*)select;
3992 h->Draw();
3993 } else if (!(select->InheritsFrom("TProfile"))) {
3994 TProfile* h = (TProfile*)select;
3995 h->Draw();
3996 } else if (!(select->InheritsFrom("TH1D"))) {
3997 TH1D* h = (TH1D*)select;
3998 h->Draw();
3999 } else if (!(select->InheritsFrom("TH2D"))) {
4000 TH2D* h = (TH2D*)select;
4001 h->Draw();
4002 } else if (!(select->InheritsFrom("TProfile2D"))) {
4003 TProfile2D* h = (TProfile2D*)select;
4004 h->Draw();
4005 } else
4006 return;
4007 csingle->Update();
4008}
4009
4010int readMCTimeFile(const char* MCTimeFile)
4011{
4012 // cout << "readMCTimeFile: " << MCTimeFile << endl;
4013 float idchambers[59] = {27.1, 28.1, 3.1, 1.1, 29.1, 4.1, 33.1, 30.1, 5.1, 19.3, 31.1, 6.1,
4014 2.1, 32.1, 15.2, 16.2, 17.2, 18.2, 19.2, 20.2, 7.1, 115.2, 113.1, 117.1,
4015 35.1, 9.1, 37.1, 11.1, 39.1, 13.1, 34.1, 8.1, 36.1, 10.1, 38.1, 12.1,
4016 21.2, 23.2, 25.2, 22.2, 24.2, 26.2, 107.2, 108.2, 109.2, 110.2, 111.2, 112.2,
4017 114.1, 116.2, 118.1, 14.1, 40.1, 119.2, 120.2, 121.2, 122.2, 123.2, 124.2};
4018 bool notused[59] = {true};
4019 int order[59] = {-1};
4020 int c = 0, cmin = -1, c0 = 0;
4021 float idmin = 200.f;
4022 for (c0 = 0; c0 < 59; c0++) {
4023 notused[c0] = true;
4024 order[c0] = -1;
4025 }
4026 for (c0 = 0; c0 < 59; c0++) {
4027 cmin = -1;
4028 idmin = 200.f;
4029 for (c = 0; c < 59; c++) {
4030 if (notused[c] && (idchambers[c] < idmin)) {
4031 idmin = idchambers[c];
4032 cmin = c;
4033 }
4034 }
4035 // printf("c0 %d cmin %d notused %d\n",c0,cmin,(int)notused[cmin]);
4036 if (cmin >= 0) {
4037 notused[cmin] = false;
4038 order[c0] = cmin;
4039 }
4040 }
4041 char fname[128];
4042 FILE* ft = 0;
4043 float time = 0.f, timesigma = 0.f;
4044 if (MCTimeFile == NULL) {
4045 printf("TOF700 MC time-of-flight file name not defined!\n");
4046 return 0;
4047 }
4048 if (strlen(MCTimeFile) == 0) {
4049 printf("TOF700 MC time-of-flight file name not defined!\n");
4050 return 0;
4051 }
4052 TString dir = getenv("VMCWORKDIR");
4053 sprintf(fname, "%s/geometry/%s", dir.Data(), MCTimeFile);
4054 ft = fopen(fname, "r");
4055 if (ft == NULL) {
4056 printf("TOF700 MC time-of-flight file %s open error!\n", fname);
4057 return 0;
4058 }
4059 int cexp = 0, ic = -1;
4060 while (fscanf(ft, "%d %f %f\n", &ic, &time, &timesigma) == 3) {
4061 if (ic > 0 && ic <= 59) {
4062 cexp = order[ic - 1];
4063 tofcalmc[cexp] = time;
4064 if (1)
4065 printf("Chamber %.1f (MC %d, EXP %d) average time-of-flight %f with sigma %f\n", idchambers[cexp], ic,
4066 cexp, time, timesigma);
4067 }
4068 }
4069 fclose(ft);
4070 return 1;
4071}
4072
4074{
4075 Int_t Nruns[6] = {0};
4076 TObjArray arrayConditions;
4077 UniSearchCondition* searchCondition = new UniSearchCondition(columnPeriodNumber, conditionEqual, 7);
4078 arrayConditions.Add((TObject*)searchCondition);
4079 // searchCondition = new UniSearchCondition(columnTargetParticle, conditionEqual, TString("Sn"));
4080 // arrayConditions.Add((TObject*)searchCondition);
4081 searchCondition = new UniSearchCondition(columnBeamParticle, conditionEqual, TString("Ar"));
4082 arrayConditions.Add((TObject*)searchCondition);
4083 // searchCondition = new UniSearchCondition(columnSp41, conditionGreaterOrEqual, 1200);
4084 // arrayConditions.Add((TObject*)searchCondition);
4085 // searchCondition = new UniSearchCondition(columnSp41, conditionLessOrEqual, 1300);
4086 // arrayConditions.Add((TObject*)searchCondition);
4087
4088 TObjArray* pRecordArray = ElogDbRecord::Search(arrayConditions);
4089
4090 // clean memory for conditions after search
4091 arrayConditions.SetOwner(kTRUE);
4092 arrayConditions.Delete();
4093
4094 // print run numbers and file path with raw data
4095 for (int i = 0; i < pRecordArray->GetEntriesFast(); i++) {
4096 ElogDbRecord* pRecord = (ElogDbRecord*)pRecordArray->At(i);
4097 // cout<<i<<" Record: time - "<<pRecord->GetRecordDate().AsSQLString()<<", period -
4098 // "<<(pRecord->GetPeriodNumber() == NULL ? 0 : *pRecord->GetPeriodNumber())
4099 // <<", run - "<<(pRecord->GetRunNumber() == NULL ? 0 : *pRecord->GetRunNumber())<<", SP-41 field -
4100 // "<<(pRecord->GetSp41() == NULL ? 0 : *pRecord->GetSp41())<<"A"
4101 // << ", Target - " << pRecord->GetTarget() << ", Energy - "<< *pRecord->GetEnergy() << endl;
4102 if (pRecord->GetTarget() == "")
4103 continue;
4104 if (pRecord->GetTarget() == "C") { /*printf(" Carbon\n");*/
4105 Ntar[(pRecord->GetRunNumber() == NULL ? 0 : *pRecord->GetRunNumber())] = 1;
4106 Nruns[1]++;
4107 }
4108 if (pRecord->GetTarget() == "Al") { /*printf(" Carbon\n");*/
4109 Ntar[(pRecord->GetRunNumber() == NULL ? 0 : *pRecord->GetRunNumber())] = 2;
4110 Nruns[2]++;
4111 }
4112 if (pRecord->GetTarget() == "Cu") { /*printf(" Carbon\n");*/
4113 Ntar[(pRecord->GetRunNumber() == NULL ? 0 : *pRecord->GetRunNumber())] = 3;
4114 Nruns[3]++;
4115 }
4116 if (pRecord->GetTarget() == "Sn") { /*printf(" Carbon\n");*/
4117 Ntar[(pRecord->GetRunNumber() == NULL ? 0 : *pRecord->GetRunNumber())] = 4;
4118 Nruns[4]++;
4119 }
4120 if (pRecord->GetTarget() == "Pb") { /*printf(" Carbon\n");*/
4121 Ntar[(pRecord->GetRunNumber() == NULL ? 0 : *pRecord->GetRunNumber())] = 5;
4122 Nruns[5]++;
4123 }
4124 ElogDbTrigger* t = ElogDbTrigger::GetTrigger((pRecord->GetTriggerId() == NULL ? 0 : *pRecord->GetTriggerId()));
4125 TString ti = (t == NULL ? "NoInfo" : t->GetTriggerInfo());
4126 Int_t tid = (t == NULL ? 0 : t->GetTriggerId());
4127 IdTrig[(pRecord->GetRunNumber() == NULL ? 0 : *pRecord->GetRunNumber())] = tid;
4128 fSp41[(pRecord->GetRunNumber() == NULL ? 0 : *pRecord->GetRunNumber())] =
4129 ((pRecord->GetSp41() == NULL ? 0 : *pRecord->GetSp41()));
4130 // printf("Pb trigger %s\n",ti.Data());
4131 // printf("Run %d Target %s Trigger id %d info %s\n", (pRecord->GetRunNumber() == NULL ? 0 :
4132 //*pRecord->GetRunNumber()), NameTar[Ntar[(pRecord->GetRunNumber() == NULL ? 0 :
4133 //*pRecord->GetRunNumber())]].Data(), tid, ti.Data());
4134 }
4135 printf("\nNruns ");
4136 for (int it = 1; it < 6; it++)
4137 printf(" %s %i", NameTar[it].Data(), Nruns[it]);
4138 printf("\n\n");
4139
4140 // clean memory after work - deleting the array of runs
4141 delete pRecordArray;
4142
4143 // cout << "\nMacro finished successfully" << endl;
4144}
4145#if XGEMCOR != 0
4146Double_t Xgemcorrection(Double_t p0, Double_t* txcor, Double_t* xsigma, Double_t* ysigma)
4147{
4148 Double_t p = p0;
4149 if (GemCorInit) {
4150 char fname_dt_root[128];
4151 strcpy(fname_dt_root, "dxgar_vs_p.root");
4152 TFile* fc = new TFile(fname_dt_root, "READ", "DCH1 X residuals vs P");
4153 hfmp = (TH1D*)fc->Get("hghitdxvspw2r_1");
4154 hfsp = (TH1D*)fc->Get("hghitdxvspw2r_2");
4155 fmp = (TF1*)fc->Get("fmp");
4156 fsp = (TF1*)fc->Get("fsp");
4157 if (fmp == 0 || fsp == 0) {
4158 printf("\nError - no fmp and fsp functions!\n");
4159 return -777.;
4160 }
4161 fc->Close();
4162 f->cd();
4163
4164 strcpy(fname_dt_root, "dxgar_vs_pn.root");
4165 fc = new TFile(fname_dt_root, "READ", "DCH1 X residuals vs P");
4166 hfmn = (TH1D*)fc->Get("hghitdxvspnw2rn_1");
4167 hfsn = (TH1D*)fc->Get("hghitdxvspnw2rn_2");
4168 fmn = (TF1*)fc->Get("fmn");
4169 fsn = (TF1*)fc->Get("fsn");
4170 if (fmn == 0 || fsn == 0) {
4171 printf("\nError - no fmn and fsn functions!\n");
4172 return -777.;
4173 }
4174 fc->Close();
4175 f->cd();
4176
4177 strcpy(fname_dt_root, "dyg_vs_p.root");
4178 fc = new TFile(fname_dt_root, "READ", "DCH1 Y residuals vs P");
4179 hfmpy = (TH1D*)fc->Get("hghitdyvsp_1");
4180 hfspy = (TH1D*)fc->Get("hghitdyvsp_2");
4181 fmpy = (TF1*)fc->Get("fmpy");
4182 fspy = (TF1*)fc->Get("fspy");
4183 if (fmpy == 0 || fspy == 0) {
4184 printf("\nError - no fmpy and fspy functions!\n");
4185 return -777.;
4186 }
4187 fc->Close();
4188 f->cd();
4189
4190 strcpy(fname_dt_root, "dyg_vs_pn.root");
4191 fc = new TFile(fname_dt_root, "READ", "DCH1 Y residuals vs P");
4192 hfmny = (TH1D*)fc->Get("hghitdyvspn_1");
4193 hfsny = (TH1D*)fc->Get("hghitdyvspn_2");
4194 fmny = (TF1*)fc->Get("fmny");
4195 fsny = (TF1*)fc->Get("fsny");
4196 if (fmny == 0 || fsny == 0) {
4197 printf("\nError - no fmny and fsny functions!\n");
4198 return -777.;
4199 }
4200 fc->Close();
4201 f->cd();
4202
4203 strcpy(fname_dt_root, "dtxg_vs_p.root");
4204 fc = new TFile(fname_dt_root, "READ", "DCH1 TX residuals vs P");
4205 hftmp = (TH1D*)fc->Get("hgdtxvsp_1");
4206 hftsp = (TH1D*)fc->Get("hgdtxvsp_2");
4207 ftmp = (TF1*)fc->Get("ftmp");
4208 ftsp = (TF1*)fc->Get("ftsp");
4209 if (ftmp == 0 || ftsp == 0) {
4210 printf("\nError - no ftmp and ftsp functions!\n");
4211 return -777.;
4212 }
4213 fc->Close();
4214 f->cd();
4215
4216 strcpy(fname_dt_root, "dtxg_vs_pn.root");
4217 fc = new TFile(fname_dt_root, "READ", "DCH1 Y residuals vs P");
4218 hftmn = (TH1D*)fc->Get("hgdtxvspn_1");
4219 hftsn = (TH1D*)fc->Get("hgdtxvspn_2");
4220 ftmn = (TF1*)fc->Get("ftmn");
4221 ftsn = (TF1*)fc->Get("ftsn");
4222 if (ftmn == 0 || ftsn == 0) {
4223 printf("\nError - no ftmn and ftsn functions!\n");
4224 return -777.;
4225 }
4226 fc->Close();
4227 f->cd();
4228
4229 GemCorInit = false;
4230 }
4231 if (p > 0.) {
4232 if (p < 0.7)
4233 p = 0.7;
4234 if (p > 5.0)
4235 p = 5.0;
4236 *txcor = 1.00 * ftmp->Eval(p);
4237 p = p0;
4238 if (p < 0.7)
4239 p = 0.7;
4240 if (p > 5.0)
4241 p = 5.0;
4242 *ysigma = fspy->Eval(p);
4243 p = p0;
4244 if (p < 0.6)
4245 p = 0.6;
4246 if (p > 5.0)
4247 p = 5.0;
4248 *xsigma = fsp->Eval(p);
4249 p = p0;
4250 if (p < 0.6)
4251 p = 0.6;
4252 if (p > 5.0)
4253 p = 5.0;
4254 return 1.00 * (fmp->Eval(p));
4255 } else if (p < 0.) {
4256 p = -p;
4257 if (p < 0.6)
4258 p = 0.6;
4259 if (p > 4.0)
4260 p = 4.0;
4261 *txcor = 1.00 * ftmn->Eval(p);
4262 p = -p0;
4263 if (p < 0.8)
4264 p = 0.8;
4265 if (p > 4.0)
4266 p = 4.0;
4267 *ysigma = fsny->Eval(p);
4268 p = -p0;
4269 if (p < 0.8)
4270 p = 0.8;
4271 if (p > 4.7)
4272 p = 4.7;
4273 *xsigma = fsn->Eval(p);
4274 p = -p0;
4275 if (p < 0.8)
4276 p = 0.8;
4277 if (p > 3.5)
4278 p = 3.5;
4279 return 1.00 * (fmn->Eval(p));
4280 }
4281 return 0.;
4282}
4283#endif
4284
4285#if XTOFCOR != 0
4286Double_t Xgemcorrectiontof700(Double_t p0, Double_t* xsigmatof700, Double_t* ysigmatof700)
4287{
4288 Double_t p = p0;
4289 if (GemCorInittof700) {
4290 char fnametof700_dt_root[128];
4291 strcpy(fnametof700_dt_root, "Dx_vs_p_TOF700_data.root");
4292 TFile* fctof700 = new TFile(fnametof700_dt_root, "READ", "DCH1 X residuals vs P");
4293 hfmptof700 = (TH1D*)fctof700->Get("FitsliceMean");
4294 hfsptof700 = (TH1D*)fctof700->Get("FitsliceSigma");
4295 fmptof700 = (TF1*)fctof700->Get("f3");
4296 fsptof700 = (TF1*)fctof700->Get("f4");
4297 if (fmptof700 == 0 || fsptof700 == 0) {
4298 printf("\nError - no f3 and f4 functions!\n");
4299 return -777.;
4300 }
4301 fctof700->Close();
4302
4303 strcpy(fnametof700_dt_root, "Dx_vs_p_TOF700_data_minus.root");
4304 fctof700 = new TFile(fnametof700_dt_root, "READ", "DCH1 X residuals vs P");
4305 hfmntof700 = (TH1D*)fctof700->Get("FitsliceMean");
4306 hfsntof700 = (TH1D*)fctof700->Get("FitsliceSigma");
4307 fmntof700 = (TF1*)fctof700->Get("f3n");
4308 fsntof700 = (TF1*)fctof700->Get("f4n");
4309 if (fmntof700 == 0 || fsntof700 == 0) {
4310 printf("\nError - no f3n and f4n functions!\n");
4311 return -777.;
4312 }
4313 fctof700->Close();
4314
4315 strcpy(fnametof700_dt_root, "Dy_vs_p_TOF700_data.root");
4316 fctof700 = new TFile(fnametof700_dt_root, "READ", "DCH1 Y residuals vs P");
4317 hfmpytof700 = (TH1D*)fctof700->Get("FitsliceMean");
4318 hfspytof700 = (TH1D*)fctof700->Get("FitsliceSigma");
4319 fmpytof700 = (TF1*)fctof700->Get("f3y");
4320 fspytof700 = (TF1*)fctof700->Get("f4y");
4321 if (fmpytof700 == 0 || fspytof700 == 0) {
4322 printf("\nError - no f3y and f4y functions!\n");
4323 return -777.;
4324 }
4325 fctof700->Close();
4326
4327 strcpy(fnametof700_dt_root, "Dy_vs_p_TOF700_data_minus.root");
4328 fctof700 = new TFile(fnametof700_dt_root, "READ", "DCH1 Y residuals vs P");
4329 hfmnytof700 = (TH1D*)fctof700->Get("FitsliceMean");
4330 hfsnytof700 = (TH1D*)fctof700->Get("FitsliceSigma");
4331 fmnytof700 = (TF1*)fctof700->Get("f3yn");
4332 fsnytof700 = (TF1*)fctof700->Get("f4yn");
4333 if (fmnytof700 == 0 || fsnytof700 == 0) {
4334 printf("\nError - no fmny and fsny functions!\n");
4335 return -777.;
4336 }
4337 fctof700->Close();
4338
4339 GemCorInittof700 = false;
4340 }
4341 if (p > 0.) {
4342 if (p < 0.65)
4343 p = 0.65;
4344 if (p > 5.0)
4345 p = 5.0;
4346 *ysigmatof700 = fspytof700->Eval(p);
4347 p = p0;
4348 if (p < 0.65)
4349 p = 0.65;
4350 if (p > 5.0)
4351 p = 5.0;
4352 *xsigmatof700 = fsptof700->Eval(p);
4353 p = p0;
4354 if (p < 0.65)
4355 p = 0.65;
4356 if (p > 5.0)
4357 p = 5.0;
4358 return 1.00 * (fmptof700->Eval(p));
4359 } else if (p < 0.) {
4360 // p = -p;
4361 if (p > -0.65)
4362 p = -0.65;
4363 if (p < -2.5)
4364 p = -2.5;
4365 *ysigmatof700 = fsnytof700->Eval(p);
4366 // p = -p0;
4367 if (p > -0.65)
4368 p = -0.65;
4369 if (p < -2.5)
4370 p = -2.5;
4371 *xsigmatof700 = fsntof700->Eval(p);
4372 // p = -p0;
4373 if (p > -0.65)
4374 p = -0.65;
4375 if (p < -2.5)
4376 p = -2.5;
4377 return 1.00 * (fmntof700->Eval(p));
4378 }
4379 return 0.;
4380}
4381#endif
4382
4384{
4385 Int_t ich, ichx, ibx, iby;
4386 if ((ich = (int)idchambers[i]) <= 40) {
4387 ichx = ich;
4388 if (ichx > 20)
4389 ichx += 2;
4390 ibx = (ichx - 1) % 14 + 3;
4391 iby = 2 - (ichx - 1) / 14;
4392 iby = 16 + iby * 32 + j;
4393 h->Fill(ibx, iby);
4394 } else {
4395 if (ich <= 112) {
4396 iby = 112 + j;
4397 ibx = (ich - 107) * 3 + 1;
4398 h->Fill(ibx, iby);
4399 h->Fill(ibx + 1, iby);
4400 h->Fill(ibx + 2, iby);
4401 } else if (ich >= 119) {
4402 iby = j;
4403 ibx = (ich - 119) * 3 + 1;
4404 h->Fill(ibx, iby);
4405 h->Fill(ibx + 1, iby);
4406 h->Fill(ibx + 2, iby);
4407 } else if (ich == 113 || ich == 115 || ich == 117) {
4408 iby = 2 - (ich - 113) / 2;
4409 iby = 24 + iby * 32 + j;
4410 ibx = 0;
4411 h->Fill(ibx, iby);
4412 h->Fill(ibx + 1, iby);
4413 h->Fill(ibx + 2, iby);
4414 } else if (ich == 114 || ich == 116 || ich == 118) {
4415 iby = 2 - (ich - 114) / 2;
4416 iby = 24 + iby * 32 + j;
4417 ibx = 17;
4418 h->Fill(ibx, iby);
4419 h->Fill(ibx + 1, iby);
4420 h->Fill(ibx + 2, iby);
4421 }
4422 }
4423}
#define WMIN
#define PMAX2
int nhits[NUMBER_CHAMBERS][32]
#define CVERS
float tofWidths[NUMBER_CHAMBERS][32]
#define MPIMAX
#define DMPSCALET2
double yhi[1000]
#define GEMDEBUG
#define XYPANIN
Double_t tofcalc[NUMBER_CHAMBERS]
TProfile * itcalibrc
#define PMAX
Float_t halfwidthy[NUMBER_CHAMBERS]
#define CALIBRATION
Float_t halfwidthx[NUMBER_CHAMBERS]
double zhic[1000]
#define MP
#define PRES
float tof[NUMBER_CHAMBERS][32]
#define USE_CLUSTERS
double lrd[1000]
#define LIST_STRIP_CORRECTIONS
double xhi[1000]
#define PMIN
#define STRIP_CORRECTIONS
#define DXGEMDCHMAX
#define MPI2
double yhic[1000]
#define WRITE_CALIBRATION
#define DMPSCALE2
Double_t tofcals[NUMBER_CHAMBERS][32]
#define GEMCUTS
#define PMAXPI
#define PSCALE
#define WMAX
Double_t tofcalmc[NUMBER_CHAMBERS]
double zhi[1000]
#define PRES1
#define DMPSCALE1
#define MINGEMNDF
#define MINTIME
double xhic[1000]
#define CFACTOR
#define MP2
int nhit[NUMBER_CHAMBERS]
#define PMAX1
#define DYGEMDCHMAX
#define TOFMAX
TProfile2D * itcalibr
#define DMPSCALET1
#define PV_HARD
#define M3Z1MAX
#define DXBORDER
#define PFRMAX
#define XGEMCOR
#define NPT
TF1 * fmpytof700
#define SigmaX_GEM_TOF
#define DXDCH
Int_t Atar[6]
#define TRACKS_ONLY
Double_t NTOFsigma
TString NameTar[6]
TH1D * hfmptof700
TH1D * hfmnytof700
#define DTYDCH
void BmnEfficiencyTOF700(const char *TracksGemDch=TRACKFILE, const char *DigitsTOF700="argon_tof700_digits_files_pro_full_new.txt")
#define DY0DCH
#define CALIBFILE
#define DYBORDER
Double_t NDXsigma
#define PTMIN
#define DTXDCH
#define DZ0DCH
#define DX0DCH
TH1D * hfsptof700
Bool_t GemCorInittof700
#define YLMIN
#define NYL
Int_t Ztar[6]
#define M2Z1MAX
#define MAX_NPAIRS
#define SigmaX_DCH_TOF
TF1 * fmnytof700
#define M3Z2MAX
#define DYDCH
#define CORRECTIONFILE
Int_t readMCTimeFile(const char *MCTimeFile="TOF700_MC_argon_qgsm_time_run7.txt")
TH1D * hfsntof700
void selecting_records_target()
TF1 * fsntof700
#define PRIMARY_VERTEX_CUTS
#define ACCEPTANCE
TF1 * fmptof700
TF1 * fmntof700
void xystrip(TH2D *h, Int_t i, Int_t j)
#define MINDCHHITS
#define M1Z1MIN
TH1D * hfsnytof700
#define SigmaY_GEM_TOF
TFile * f
TH1D * hfspytof700
TF1 * fsptof700
#define M3Z2MIN
#define MINSIHITS
Double_t DYsigma
#define DTX0DCH
Int_t IdTrig[10000]
#define TRACKFILE
#define MFRMIN
TH1D * hfmntof700
Double_t Xgemcorrectiontof700(Double_t p0, Double_t *xsigmatof700, Double_t *ysigmatof700)
Double_t SigmaX_TOF700
#define PTMAX
TF1 * fsnytof700
Int_t Ntar[10000]
#define DTY0DCH
#define M3Z1MIN
#define REFIT_DEBUG
#define YLMAX
void select_hist()
Double_t DTXcor
TH1D * hfmpytof700
Double_t DXsigma
#define M2Z1MIN
Int_t fSp41[10000]
#define DZDCH
TF1 * fspytof700
#define SigmaY_DCH_TOF
Double_t SigmaY_TOF700
#define FLAG
#define M1Z1MAX
#define XYPETNEW
vector< Double_t > dist(vector< Double_t > qp, Double_t mu)
Definition BmnMath.cxx:869
#define IN_WIDTH_LIMITS
int wma[NUMBER_CHAMBERS]
#define NUMBER_CHAMBERS
float idchambers[59]
int wmi[NUMBER_CHAMBERS]
friend F32vec4 fabs(const F32vec4 &a)
Definition P4_F32vec4.h:52
int i
Definition P4_F32vec4.h:22
bool Bool_t
int Int_t
unsigned int UInt_t
float Float_t
short Short_t
double Double_t
constexpr Bool_t kTRUE
#define R__ADD_INCLUDE_PATH(PATH)
TMatrixTSym< Double_t > TMatrixDSym
#define gROOT
R__EXTERN TStyle * gStyle
R__EXTERN TSystem * gSystem
TVectorT< Double_t > TVectorD
#define gPad
UInt_t GetEventId()
Get the event ID for this event.
Double_t GetDdtx() const
Double_t GetDtx() const
Double_t GetYpv() const
Double_t GetChi2() const
Double_t GetDdx() const
Int_t GetSiHits() const
CbmStsTrack * GetGemTrack()
Int_t GetEventId() const
Double_t GetDdty() const
Double_t GetLength() const
Double_t GetXpv() const
Double_t GetDdy() const
Double_t GetDx() const
Double_t GetDty() const
Double_t GetDy() const
Int_t GetGemHits() const
BmnTrack * GetDchTrack()
Short_t GetPlane() const
Short_t GetStrip() const
Float_t GetTime() const
Float_t GetAmplitude() const
FairTrackParam * GetParamFirst()
Definition BmnTrack.h:63
Int_t GetNHits() const
Accessors.
Definition BmnTrack.h:49
FairTrackParam * GetParamLast()
Definition BmnTrack.h:65
Int_t GetFlag() const
Definition BmnTrack.h:53
CbmVertex.h.
Definition CbmVertex.h:21
Double_t GetZ() const
Definition CbmVertex.h:60
Double_t GetX() const
Accessors.
Definition CbmVertex.h:58
Int_t GetNTracks() const
Definition CbmVertex.h:63
Double_t GetY() const
Definition CbmVertex.h:59
TVirtualPad * cd(Int_t subpadnumber=0) override
void Update() override
Int_t SetBranchAddress(const char *bname, T **add, TBranch **ptr=nullptr)
virtual Int_t Add(const char *name, Long64_t nentries=TTree::kMaxEntries)
Long64_t GetEntries() const override
Int_t GetEntry(Long64_t entry=0, Int_t getall=0) override
virtual void SetOwner(Bool_t enable=kTRUE)
T * Get(const char *namecycle)
virtual Double_t Eval(Double_t x, Double_t y=0, Double_t z=0, Double_t t=0) const
void Close(Option_t *option="") override
virtual Bool_t Add(const TH1 *h, const TH1 *h2, Double_t c1=1, Double_t c2=1)
void Draw(Option_t *option="") override
virtual Int_t Fill(const char *name, Double_t w)
virtual Bool_t Divide(const TH1 *h1)
virtual void SetOption(Option_t *option=" ")
virtual void Sumw2(Bool_t flag=kTRUE)
TH1D * ProjectionY(const char *name="_py", Int_t firstxbin=0, Int_t lastxbin=-1, Option_t *option="") const
virtual Int_t Fill(const char *namex, const char *namey, Double_t w)
TH1D * ProjectionX(const char *name="_px", Int_t firstybin=0, Int_t lastybin=-1, Option_t *option="") const
virtual Int_t Fill(const char *namex, const char *namey, const char *namez, Double_t w)
TMatrixTSym< Element > & Invert(Double_t *det=nullptr)
Int_t GetEntriesFast() const
void Delete(Option_t *option="") override
TObject * At(Int_t idx) const override
void Add(TObject *obj) override
virtual UInt_t GetUniqueID() const
virtual Int_t Write(const char *name=nullptr, Int_t option=0, Int_t bufsize=0)
Int_t Fill(const char *namex, const char *namey, Double_t z) override
void Sumw2(Bool_t flag=kTRUE) override
Int_t Fill(const char *namex, Double_t y) override
const char * Data() const
virtual Int_t Fill()
virtual Long64_t AutoSave(Option_t *option="")
virtual Int_t Branch(const char *folder, Int_t bufsize=32000, Int_t splitlevel=99)
double beta(double x, double y)
RVec< PromoteType< T > > sqrt(const RVec< T > &v)
Bool_t IsNaN(Double_t x)
Double_t Log(Double_t x)
Double_t Sqrt(Double_t x)
Double_t Abs(Double_t d)
void Sort(Index n, const Element *a, Index *index, Bool_t down=kTRUE)