197 const char* DigitsTOF700 =
"argon_tof700_digits_files.txt")
201#if ROOT_VERSION_CODE < ROOT_VERSION(5, 99, 99)
202 gROOT->LoadMacro(
"$VMCWORKDIR/macro/run/bmnloadlibs.C");
208 if (RunPeriod >= 1 && RunPeriod <= 7) {
209 sprintf(mapping,
"TOF700_map_period_%d.txt", RunPeriod);
211 printf(
"Non-existing run period number %d!", RunPeriod);
221 if (strstr(TracksGemDch,
".root")) {
222 bmnTree->
Add(TracksGemDch);
224 ifstream fin(TracksGemDch);
226 for (
int idx = 0; idx < 1000; idx++) {
230 if (strlen(filename.Data()) == 0)
232 if ((filename.Data())[0] ==
'#')
234 cout <<
" GEM+DCH tracks file #" << idx + 1 <<
" " << filename.
Data() << endl;
235 bmnTree->
Add(filename);
239 printf(
"Non-existing run list file: %s!", TracksGemDch);
246 char fnametof700[256];
248 if (strstr(DigitsTOF700,
".root")) {
249 bmnTreetof700->
Add(DigitsTOF700);
250 strcpy(fnametof700, DigitsTOF700);
252 ifstream fin(DigitsTOF700);
254 for (
int idx = 0; idx < 1000; idx++) {
258 if (strlen(filename.Data()) == 0)
260 if ((filename.Data())[0] ==
'#')
262 cout <<
" TOF digits file #" << idx + 1 <<
" " << filename.
Data() << endl;
263 bmnTreetof700->
Add(filename);
264 strcpy(fnametof700, filename.Data());
268 printf(
"Non-existing run list file: %s!", DigitsTOF700);
275 char fnametof700raw[256];
276 strcpy(fnametof700raw, fnametof700);
277 strcpy(strstr(fnametof700raw,
"digi.root"),
"raw.root");
294 char name[128], title[128];
297 gStyle->SetOptStat(111111);
302 char fname_calib_root[128], *delim = 0;
303 strcpy(fname_calib_root,
gSystem->BaseName(fnametof700));
304 if ((delim = strrchr(fname_calib_root, (
int)
'.')))
306 strcat(fname_calib_root,
"_calibration.root");
307 TFile* fc =
new TFile(fname_calib_root,
"READ",
"Proton mass based calibration of BmnTOF700");
315 printf(
"\n ******************* Time offsets for whole chamber **********************\n");
318 printf(
"%d %f\n", c,
tofcalc[c]);
322 printf(
"\n ******************* Time offsets for one strip **************************\n");
325 printf(
"\n Chamber %d %.1f\n", c,
idchambers[c]);
329 for (
int s = 0; s < smax; s++) {
332 printf(
" strip %d %f\n", s,
tofcals[c][s]);
335 printf(
"\n *************************************************************************\n");
341 if (strlen(fnametof700)) {
342 char fname_root[128], *delim = 0;
343 strcpy(fname_root,
gSystem->BaseName(fnametof700));
344 if ((delim = strrchr(fname_root, (
int)
'.')))
346 strcat(fname_root,
"_identification_results.root");
347 f =
new TFile(fname_root,
"RECREATE",
"Results of BmnTOF700");
350 TH1F* hntr =
new TH1F(
"hntr",
"Number of all tracks", 200, 0, 200);
351 TH1F* hntr0 =
new TH1F(
"hntr0",
"Number of selected tracks", 200, 0, 200);
352 TH1F* hntr1 =
new TH1F(
"hntr1",
"Number of tracks with FLAG conditions", 200, 0, 200);
353 TH2F* hxytr =
new TH2F(
"hxytr",
"XY tracks", 1500, -150, 150, 1000, -100, 100);
354 TH1F* hptr =
new TH1F(
"hptr",
"Momentum of tracks", 1000, -10, 10);
355 TH1F* hp0 =
new TH1F(
"hp0",
"Momentum of tracks (all)", 1000, -10, 10);
356 TH1F* hltr =
new TH1F(
"hltr",
"Lenght of GEM tracks", 100, 500, 700);
357 TH1F* hltra =
new TH1F(
"hltra",
"Lenght of GEM+DCH tracks", 100, 500, 700);
358 TH2F* hxytrtof =
new TH2F(
"hxytrtof",
"XY tracks with TOF700 hits", 1500, -150, 150, 1000, -100, 100);
359 TH2F* hxyhit =
new TH2F(
"hxyhit",
"XY track hit distance from TOF700 hit", 100, -50, 50, 40, -10, 10);
360 TH1F* hlrdiffs =
new TH1F(
"hlrdiffs",
"LR difference for TOF700 hits with track (small chamber)", 100, -5, +5);
361 TH1F* hlrdiffb =
new TH1F(
"hlrdiffb",
"LR difference for TOF700 hits with track (big chamber)", 100, -5, +5);
362 TH1F* hxdiff =
new TH1F(
"hxdiff",
"X difference for TOF700 hits with track", 100, -50, +50);
363 TH2F* hxxhits =
new TH2F(
"hxxhits",
"X track hit vs TOF700 hit (small chambers)", 200, -100, 100, 200, -100, 100);
364 TH2F* hxxhitb =
new TH2F(
"hxxhitb",
"X track hit vs TOF700 hit (big chambers)", 200, -100, 100, 200, -100, 100);
365 TH2F* hlrxhits =
new TH2F(
"hlrxhits",
"X TOF700 hit vs LR difference (small chamber)", 100, -5, 5, 200, -100, 100);
366 TH2F* hlrxhitb =
new TH2F(
"hlrxhitb",
"X TOF700 hit vs LR difference (big chamber)", 100, -5, 5, 200, -100, 100);
368 TH2F* hlrxtrs =
new TH2F(
"hlrxtrs",
"X TOF700 tr vs LR difference (small chamber)", 100, -5, 5, 200, -100, 100);
369 TH2F* hlrxtrb =
new TH2F(
"hlrxtrb",
"X TOF700 tr vs LR difference (big chamber)", 100, -5, 5, 200, -100, 100);
371 TH1F* hcsignp =
new TH1F(
"hsignp",
"Chambers with right correlation (x vs lr)", 60, 0, 60);
372 TH1F* hcsignm =
new TH1F(
"hsignm",
"Chambers with wrong correlation (x vs lr)", 60, 0, 60);
374 TH1F* htoftr =
new TH1F(
"htoftr",
"TOF of tracks with TOF700 hits", 600, -20, 40);
375 TH1F* htof =
new TH1F(
"htof",
"TOF for hits", 600, -20, 40);
376 TH1F* hntof =
new TH1F(
"hntof",
"Number of hits", 100, 0, 100);
377 TH1F* hnhit =
new TH1F(
"hnhit",
"Number of hits in width limits", 100, 0, 100);
378 TH2F* hxytof =
new TH2F(
"hxytof",
"XY TOF700 hits", 1500, -150, 150, 1000, -100, 100);
379 TH2F* hpbeta =
new TH2F(
"hpbeta",
"Beta vs momentum", 200, 0, 10, 220, 0, 1.1f);
381 TH2F* hpbetac =
new TH2F(
"hpbetac",
"Beta vs momentum, chamber corrections", 200, 0, 10, 220, 0, 1.1f);
383 TH2F* hpbetas =
new TH2F(
"hpbetas",
"Beta vs momentum, strip corrections", 200, 0, 10, 220, 0, 1.1f);
385 TH2F* hpbetacm =
new TH2F(
"hpbetacm",
"Beta vs momentum, Z<0, chamber corrections", 200, 0, 10, 220, 0, 1.1f);
387 TH2F* hpbetasm =
new TH2F(
"hpbetasm",
"Beta vs momentum, Z<0, strip corrections", 200, 0, 10, 220, 0, 1.1f);
389 TH1F* hmass =
new TH1F(
"hmass",
"Mass, p<2", 100, -0.5, 4.5);
390 TH1F* hmassc =
new TH1F(
"hmassc",
"Mass, chamber corrections", 100, -0.5, 4.5);
391 TH1F* hmassc15 =
new TH1F(
"hmassc15",
"Mass, chamber corrections, p<1.5", 100, -0.5, 4.5);
392 TH1F* hmassc20 =
new TH1F(
"hmassc20",
"Mass, chamber corrections, p<2.0", 100, -0.5, 4.5);
393 TH1F* hmasss =
new TH1F(
"hmasss",
"Mass, strip corrections", 100, -0.5, 4.5);
394 TH1F* hmasss15 =
new TH1F(
"hmasss15",
"Mass, strip corrections, p<1.5", 100, -0.5, 4.5);
395 TH1F* hmasss20 =
new TH1F(
"hmasss20",
"Mass, strip corrections, p<2.0", 100, -0.5, 4.5);
396 TH1F* hmasscm =
new TH1F(
"hmasscm",
"Mass, Z<0, chamber corrections", 200, -1, 4);
397 TH1F* hmasssm =
new TH1F(
"hmasssm",
"Mass, Z<0, strip corrections", 200, -1, 4);
399 TH1F* hdtps =
new TH1F(
"hdtps",
"Time resolution, protons, strip corrections", 200, -1., +1.);
401 new TH2F(
"hdtpsvsp",
"Time resolution vs momentum, protons, strip corrections", 240, 0., 6., 200, -1., +1.);
403 TH1F* hdtpc =
new TH1F(
"hdtpc",
"Time resolution, protons, chamber corrections", 200, -1., +1.);
405 new TH2F(
"hdtpcvsp",
"Time resolution vs momentum, protons, chamber corrections", 240, 0., 6., 200, -1., +1.);
407 TH2F* hdtpcvspwlim =
new TH2F(
"hdtpcvspwlim",
"Time resolution vs momentum, protons, chamber corrections, w>3000",
408 240, 0., 6., 200, -1., +1.);
410 TH1F* hdtpcplim =
new TH1F(
"hdtpcplim",
"Time resolution, protons, p>3", 200, -1., +1.);
411 TH1F* hdtpcp1lim =
new TH1F(
"hdtpcp1lim",
"Time resolution, protons, p>4", 200, -1., +1.);
412 TH1F* hdtpcp2lim =
new TH1F(
"hdtpcp2lim",
"Time resolution, protons, p<2", 200, -1., +1.);
413 TH1F* hdtpcp3lim =
new TH1F(
"hdtpcp3lim",
"Time resolution, protons, 2<p<5", 200, -1., +1.);
414 TH1F* hdtpcwlim =
new TH1F(
"hdtpcwlim",
"Time resolution, protons, w>3000", 200, -1., +1.);
415 TH1F* hdtpcwplim =
new TH1F(
"hdtpcwplim",
"Time resolution, protons, p>3, w>3000", 200, -1., +1.);
416 TH1F* hdtpcwp1lim =
new TH1F(
"hdtpcwp1lim",
"Time resolution, protons, p>4, w>3000", 200, -1., +1.);
418 TH2F* hmassvsp =
new TH2F(
"hmassvsp",
"Mass vs momentum", 240, 0., 6., 200, -0.2, 4.8);
420 TH2F* hmasssvsp =
new TH2F(
"hmasssvsp",
"Mass vs momentum, strip correction", 240, 0., 6., 200, -0.2, 4.8);
422 TH2F* hmasscvsp =
new TH2F(
"hmasscvsp",
"Mass vs momentum, chamber corrections", 240, 0., 6., 200, -0.2, 4.8);
424 TH2F* hmasssmvsp =
new TH2F(
"hmasssmvsp",
"Mass vs momentum, Z<0, strip correction", 240, 0., 6., 200, -0.2, 4.8);
427 new TH2F(
"hmasscmvsp",
"Mass vs momentum, Z<0, chamber corrections", 240, 0., 6., 200, -0.2, 4.8);
430 TH1F* htofp =
new TH1F(
"htofp",
"TOF for proton hits, p<2", 600, -20, 40);
431 TH1F* hstr =
new TH1F(
"hstr",
"Strips", 32, 0, 32);
432 TH1F* hcha =
new TH1F(
"hcha",
"Chambers", 60, 0, 60);
433 TH1F* hstrtr =
new TH1F(
"hstrtr",
"Strips with tracks", 32, 0, 32);
434 TH1F* hchatr =
new TH1F(
"hchatr",
"Chambers with tracks", 60, 0, 60);
436 TH2F* hdxy0 =
new TH2F(
"hdxy0",
"DxDy all", 40, -10, +10, 40, -10, +10);
437 TH1F* hdx =
new TH1F(
"hdx",
"dx all", 40, -10, +10);
438 TH1F* hdy =
new TH1F(
"hdy",
"dy all", 40, -10, +10);
439 TH2F* hdxy =
new TH2F(
"hdxy",
"DxDy selected", 40, -10, +10, 40, -10, +10);
440 TH2F* hdxytof =
new TH2F(
"hdxytof",
"DxDy with TOF700 hits", 40, -10, +10, 40, -10, +10);
441 TH2F* hdxyeff =
new TH2F(
"hdxyeff",
"Efficiency vs DxDy", 40, -10, +10, 40, -10, +10);
443 TH1F* hdxeff =
new TH1F(
"hdxeff",
"Efficiency vs Dx", 40, -10, +10);
444 TH1F* hdyeff =
new TH1F(
"hdyeff",
"Efficiency vs Dy", 40, -10, +10);
445 TH2F* hxygoodtr =
new TH2F(
"hxygoodtr",
"XY good tracks", 70, -140, 140, 60, -90, 90);
446 TH2F* hxygoodhit =
new TH2F(
"hxygoodhit",
"XY good tracks with good hits", 70, -140, 140, 60, -90, 90);
447 TH2F* hxyeff =
new TH2F(
"hxyeff",
"Efficiency vs XY good tracks", 70, -140, 140, 60, -90, 90);
449 TH1F* hxeff =
new TH1F(
"hxeff",
"Efficiency vs X good tracks", 70, -140, 140);
450 TH1F* hyeff =
new TH1F(
"hyeff",
"Efficiency vs Y good tracks", 60, -90, 90);
451 TH1F* hdtx =
new TH1F(
"hdtx",
"dtx", 100, -0.25, +0.25);
452 TH1F* hdty =
new TH1F(
"hdty",
"dty", 100, -0.25, +0.25);
453 TH1F* hDdx =
new TH1F(
"hDdx",
"Err dx", 100, 0, 10);
454 TH1F* hDdy =
new TH1F(
"hDdy",
"Err dy", 100, 0, 10);
455 TH1F* hDdtx =
new TH1F(
"hDdtx",
"Err dtx", 100, 0, 0.05);
456 TH1F* hDdty =
new TH1F(
"hDdty",
"Err dty", 100, 0, 0.05);
457 TH1F* hpdx =
new TH1F(
"hpdx",
"Pull dx", 500, -2.5, +2.5);
458 TH1F* hpdy =
new TH1F(
"hpdy",
"Pull dy", 500, -2.5, +2.5);
459 TH1F* hpdtx =
new TH1F(
"hpdtx",
"Pull dtx", 500, -25., +25.);
460 TH1F* hpdty =
new TH1F(
"hpdty",
"Pull dty", 500, -25., +25.);
461 TH1F* hchi2m =
new TH1F(
"hChi2m",
"Chi2 GemDch track", 1000, 0, 100);
462 TH1F* hchi2 =
new TH1F(
"hchi2",
"Chi2 tracks matching", 1000, 0, 100);
473 char nam[64], tit[64];
475 float cvel = 29.97925f;
476 float ekin = 3.2f, ebeam = ekin +
MP, pbeam =
TMath::Sqrt(ebeam * ebeam +
MP *
MP);
477 float cbeam = pbeam / ebeam;
478 float cpeak = cbeam *
CFACTOR * cvel;
482 TOF2->get_chamber_z(
i, &zc[
i]);
485 Int_t startEvent = 0;
488 printf(
"\nNumber of events in tracks chain is %d (tof700 chain %d)\n", nEvents, nEventstof700);
490 int Ntr = 0, Ntr1 = 0, Ntr1g = 0, Ntr0 = 0;
491 Int_t iEv = 0, iEvtof700 = 0, fCurrent = -1;
492 UInt_t trackEvId = 0, tof700EvId = 0;
493 UInt_t trackRunId = 0, tof700RunId = 0;
494 for (
Int_t iEv0 = startEvent; iEv0 < startEvent + nEvents; iEv0++) {
495 if (iEv % 10000 == 0) {
496 cout <<
"Event: " << iEv <<
"/" << startEvent + nEvents <<
" ( Run " << trackRunId <<
" EvId " << trackEvId
504 if (mtracks == NULL) {
512 }
while (gemdchtrack0 == NULL);
519 if (eventHeader == NULL)
524 if (tof700RunId == trackRunId && tof700EvId > trackEvId)
526 if (tof700RunId > trackRunId)
529 if (!(tof700EvId == trackEvId && tof700RunId == trackRunId)) {
532 if (eventHeadertof700 == NULL)
540 if (iEvtof700 >= nEventstof700)
542 if (tof700RunId > trackRunId)
544 if (tof700RunId == trackRunId && tof700EvId > trackEvId)
546 }
while (!(tof700EvId == trackEvId && tof700RunId == trackRunId));
548 if (eventHeadertof700 == NULL)
550 if (!(tof700EvId == trackEvId && tof700RunId == trackRunId)) {
551 cout <<
"Not found EventId " << trackEvId <<
" in tof700 digits file" << endl;
552 cout <<
"Tracks Event: " << iEv <<
", TOF700 Event: " << iEvtof700 << endl;
553 cout <<
"Tracks RunId: " << trackRunId <<
", TOF700 RunId: " << tof700RunId << endl;
554 cout <<
"Tracks EventId: " << trackEvId <<
", TOF700 EventId: " << tof700EvId << endl;
555 if (iEvtof700 >= nEventstof700)
557 if (tof700RunId > trackRunId)
559 if (tof700RunId == trackRunId && tof700EvId > trackEvId)
576 for (
int j = 0; j < 32; j++)
578 for (
int j = 0; j < 32; j++)
580 for (
int j = 0; j < 32; j++)
587 float x = 0., y = 0., z = 0.;
588 int hchamb[1000] = {0}, hstrip[1000] = {0};
589 int clchamb[1000] = {0}, clstrip[1000] = {0};
590 Bool_t usedstrip[1000] = {
false};
592 for (
Int_t iDig = 0; iDig < ntof; ++iDig) {
600 Float_t lrdiff = digit->GetDiff();
606 if (
XYPANIN && (
TOF2->get_hit_xp(plane, strip, lrdiff) == 0.))
609 smax1[plane] = strip;
610 if (width > wmax[plane]) {
616 if (width <
wmi[plane] || width >
wma[plane])
622 nhits[plane][strip]++;
623 tof[plane][strip] = time;
627 TOF2->get_hit_xyzp(plane, strip, lrdiff, &x, &y, &z);
629 TOF2->get_hit_xyz(plane, strip, lrdiff, &x, &y, &z);
635 TOF2->get_strip_xyz(plane, strip, &x, &y, &z);
641 numhit[plane][strip] =
nhi;
646 float xyz[3] = {0.}, cxyz[3] = {0.}, xrpc = 0., yrpc = 0., dz = 100., tx = 0., ty = 0., zcha = 0.;
647 float beta = 1.0f, mass = 1.0f, mass2 = 1.0f, tcor = 0., tcorc = 0., tcors = 0., tcorspi = 0., tcorcpi = 0.;
649 int ntr = mtracks->GetEntriesFast();
653 int ntr1 = 0, ntr1g = 0;
654 int iflag = 0, igem = 0, idch = 0;
683 Double_t le = 0., p = 0., ps = 0., pmod = 0., lenr = 0.;
686 double dist = 0., distmin = 1000000000.0f;
701 float massmaxpi = 0.;
702 float massminpi = 0.;
712 double timepeak = 0., betapeak = 0.;
714 for (
Int_t iTr = 0; iTr < ntr; ++iTr) {
716 if (gemdchtrack == NULL)
744 hp0->
Fill(1. / QpGem);
756 nGemHits = gtrack->
GetNDF();
758 Xpv = gemdchtrack->
GetXpv();
759 Ypv = gemdchtrack->
GetYpv();
762 if (nGemHits <
MINGEMNDF || xGem < -140.f || xGem > 240.f || yGem < -40.f || yGem > 200.f
763 || txGem < -0.5f || txGem > 1.0f || tyGem < -0.1f || tyGem > 0.5f || Xpv < -3.5f || Xpv > 4.0f
764 || Ypv < -1.0f || Ypv > 6.0f || QpGem == 0.0f || 1.0f /
TMath::Abs(QpGem) > 15.0f
768 printf(
"xGem %f yGem %f txGem %f tyGem %f Xpv %f Ypv %f QpGem %f\n", xGem, yGem, txGem, tyGem,
775 dxm = gemdchtrack->
GetDx();
776 dym = gemdchtrack->
GetDy();
777 dtx = gemdchtrack->
GetDtx();
778 dty = gemdchtrack->
GetDty();
779 Ddx = gemdchtrack->
GetDdx();
780 Ddy = gemdchtrack->
GetDdy();
783 Chi2m = gemdchtrack->
GetChi2();
786 hdxy0->
Fill(dxm, dym);
802 xgoodtr = xyz[0] + tx * 100.;
803 ygoodtr = xyz[1] + ty * 100.;
804 hxytr->
Fill(xgoodtr, ygoodtr);
814 chi2 = dxm * dxm / Ddx + dym * dym / Ddy;
818 hdxy->
Fill(dxm, dym);
830 hxygoodtr->
Fill(xgoodtr, ygoodtr);
831 cxyz[0] = tx /
TMath::Sqrt(1. + tx * tx + ty * ty);
832 cxyz[1] = ty /
TMath::Sqrt(1. + tx * tx + ty * ty);
833 cxyz[2] = 1. /
TMath::Sqrt(1. + tx * tx + ty * ty);
842 int clstart = -1, clwidth = -1, cstr = -1;
843 float samps = 0., timemin = 1000000000.;
848 for (
int j = 0; j < nstr && nhit[i] > 0; j++) {
857 if (
tof[
i][j] < timemin) {
869 if (j == (nstr - 1)) {
871 clstrip[ncl0] = cstr;
872 clwidth = (j + 1 - clstart);
873 tcl[
i][ncl[
i]] = timemin;
874 acl[
i][ncl[
i]] = samps;
875 wcl[
i][ncl[
i]] = clwidth;
879 timemin = 1000000000.;
882 }
else if (clstart >= 0) {
884 clstrip[ncl0] = cstr;
885 clwidth = (j - clstart);
886 tcl[
i][ncl[
i]] = timemin;
887 acl[
i][ncl[
i]] = samps;
888 wcl[
i][ncl[
i]] = clwidth;
892 timemin = 1000000000.;
900 distmin = 1000000000.0f;
901 for (
int icl = 0; icl < ncl0; icl++) {
904 int ih = numhit[ic][is];
907 dz =
zhi[ih] - xyz[2];
908 xrpc = xyz[0] + dz * tx;
909 yrpc = xyz[1] + dz * ty;
929 if (
dist < distmin) {
931 himin = numhit[ic][is];
938 distmin = 1000000000.0f;
939 for (
int ih = 0; ih < nh; ih++) {
944 dz =
zhi[ih] - xyz[2];
945 xrpc = xyz[0] + dz * tx;
946 yrpc = xyz[1] + dz * ty;
966 if (
dist < distmin) {
977 usedstrip[himin] =
true;
978 hdxytof->
Fill(dxm, dym);
979 hxygoodhit->
Fill(xgoodtr, ygoodtr);
985 dz =
zhi[himin] - xyz[2];
986 xrpc = xyz[0] + dz * tx;
987 yrpc = xyz[1] + dz * ty;
989 hxyhit->
Fill(xrpc -
xhi[himin], yrpc -
yhi[himin]);
996 hxxhits->
Fill(
xhi[himin] - xc, xrpc - xc);
998 hxxhitb->
Fill(
xhi[himin] - xc, xrpc - xc);
1005 hlrxtrs->
Fill(
lrd[himin], xrpc - xc);
1007 hlrxtrb->
Fill(
lrd[himin], xrpc - xc);
1009 if (
lrd[himin] > 0. && (
xhi[himin] - xc) > 0.)
1011 if (
lrd[himin] < 0. && (
xhi[himin] - xc) < 0.)
1013 if (
lrd[himin] > 0. && (
xhi[himin] - xc) < 0.)
1015 if (
lrd[himin] < 0. && (
xhi[himin] - xc) > 0.)
1018 cosa =
sqrt(1. + tx * tx + ty * ty);
1022 hidist =
TMath::Sqrt(xc * xc + yc * yc + (zc - ztarg) * (zc - ztarg));
1028 hxytrtof->
Fill(xrpc, yrpc);
1036 tofr =
tof[ic][is] + lenr / cpeak;
1044 tofr0 =
tof[ic][is];
1047 beta = lenr / tofr / cvel;
1051 mass2 = p * p * (1.f /
beta /
beta - 1.f);
1059 if (p > 0.f && mass2 > massmin1 && mass2 < massmax1 && pmod >
PMIN && pmod <
PMAX) {
1063 tcors = tcor -
tofcals[ic][is];
1064 tcalibrc->
Fill(ic, tcorc);
1065 tcalibrs->
Fill(ic, is, tcors);
1069 if (mass2 > massmin2 && mass2 < massmax2) {
1071 hdtpcvsp->
Fill(p, tcorc);
1073 hdtpsvsp->
Fill(p, tcors);
1075 hdtpcplim->
Fill(tcorc);
1077 hdtpcp1lim->
Fill(tcorc);
1079 hdtpcp2lim->
Fill(tcorc);
1080 if (p >= 2.0f && p < 5.0f)
1081 hdtpcp3lim->
Fill(tcorc);
1083 hdtpcwlim->
Fill(tcorc);
1084 hdtpcvspwlim->
Fill(p, tcorc);
1086 hdtpcwplim->
Fill(tcorc);
1088 hdtpcwp1lim->
Fill(tcorc);
1094 if (p > 0 && massmaxpi > massmin1)
1095 massmaxpi = massmin1;
1098 if (mass2 < massmaxpi && mass2 > massminpi && pmod >
PMIN && pmod <
PMAXPI) {
1100 tcorpi = tofpi - tofr;
1101 tcorcpi = tcorpi -
tofcalc[ic];
1102 tcorspi = tcorpi -
tofcals[ic][is];
1103 tcalibrc->
Fill(ic, tcorcpi);
1104 tcalibrs->
Fill(ic, is, tcorspi);
1107 betapeak = lenr / timepeak / cvel;
1108 tpeak->
Fill(ic, timepeak);
1109 bpeak->
Fill(ic, betapeak);
1111 tofrs = tofr +
tofcals[ic][is];
1112 betac = lenr / tofrc / cvel;
1113 betas = lenr / tofrs / cvel;
1114 masss2 = p * p * (1.f / betas / betas - 1.f);
1116 massc2 = p * p * (1.f / betac / betac - 1.f);
1119 hpbetac->
Fill(p, betac);
1120 hmassc->
Fill(massc2);
1121 hmasscvsp->
Fill(p, massc2);
1122 hpbetas->
Fill(p, betas);
1123 hmasss->
Fill(masss2);
1124 hmasssvsp->
Fill(p, masss2);
1126 hmasss15->
Fill(masss2);
1127 hmassc15->
Fill(massc2);
1130 hmasss20->
Fill(masss2);
1131 hmassc20->
Fill(massc2);
1135 hmasscm->
Fill(massc2);
1138 hmasssm->
Fill(masss2);
1150 TH1D *projtmp = 0, *projtmp1 = 0;
1151 hdxyeff->
Divide(hdxytof, hdxy);
1162 hxyeff->
Divide(hxygoodhit, hxygoodtr);
1175 printf(
"Number of tracks %d, per event %f\n", Ntr, (
float)Ntr / nEvents);
1176 printf(
"GEM+DCH1+DCH2 tracks %d, per event %f (%f%% per track)\n", Ntr1, (
float)Ntr1 / nEvents,
1177 (
float)Ntr1 / Ntr * 100.f);
1178 printf(
"Good GEM+DCH1+DCH2 tracks %d, per event %f (%f%% per track)\n", Ntr0, (
float)Ntr0 / nEvents,
1179 (
float)Ntr0 / Ntr * 100.f);
1180 }
else if (
FLAG > 0) {
1181 printf(
"Number of tracks %d, per event %f\n", Ntr, (
float)Ntr / nEvents);
1182 printf(
"GEM+DCH1 tracks %d, per event %f (%f%% per track)\n", Ntr1, (
float)Ntr1 / nEvents,
1183 (
float)Ntr1 / Ntr * 100.f);
1184 printf(
"Good GEM+DCH1 tracks %d, per event %f (%f%% per track)\n", Ntr0, (
float)Ntr0 / nEvents,
1185 (
float)Ntr0 / Ntr * 100.f);
1187 printf(
"Number of tracks %d, per event %f\n", Ntr, (
float)Ntr / nEvents);
1188 printf(
"GEM+DCH tracks %d, per event %f (%f%% per track)\n", Ntr1, (
float)Ntr1 / nEvents,
1189 Ntr > 0 ? (
float)Ntr1 / Ntr * 100.f : 0.f);
1190 printf(
"Good GEM+DCH tracks %d, per event %f (%f%% per valid track)\n", Ntr1g, (
float)Ntr1g / nEvents,
1191 Ntr1 > 0 ? (
float)Ntr1g / Ntr1 * 100.f : 0.f);
1192 printf(
"Matched GEM+DCH tracks %d, per event %f (%f%% per good track)\n", Ntr0, (
float)Ntr0 / nEvents,
1193 Ntr1g > 0 ? (
float)Ntr0 / Ntr1g * 100.f : 0.f);
1201 char fname_calibr_root[128], *delim = 0;
1202 strcpy(fname_calibr_root,
gSystem->BaseName(fnametof700));
1203 if ((delim = strrchr(fname_calibr_root, (
int)
'.')))
1205 strcat(fname_calibr_root,
"_calibration.root");
1206 TFile* fc =
new TFile(fname_calibr_root,
"RECREATE",
"Proton mass based calibration of BmnTOF700");