176 : FairTask(name, verbose)
181 , fChannelInfoRef(NULL)
182 , fChannelInfoDut(NULL)
183 , fChannelInfoSel2(NULL)
184 , fMbsMappingPar(NULL)
193 , fTofDigisColl(NULL)
195 , fTofDigiMatchColl(NULL)
196 , fTofTrackColl(NULL)
198 , fTofDigisCollIn(NULL)
199 , fTofHitsCollIn(NULL)
200 , fTofDigiMatchCollIn(NULL)
201 , fTofTrackCollIn(NULL)
209 , fhTriggerPattern(NULL)
210 , fhTriggerType(NULL)
211 , fhTimeInSpill(NULL)
227 , fhDTLH_DStrip(NULL)
248 , fhNMatch04sel(NULL)
250 , fhDigiMul0best(NULL)
251 , fhDigiMul4best(NULL)
255 , fhChiDT04best(NULL)
256 , fhDT24DT04best(NULL)
257 , fhDTD4DT04best(NULL)
260 , fhNMatchD4sel(NULL)
261 , fhChi04D4best(NULL)
264 , fhDigiMul0D4best(NULL)
265 , fhDigiMul4D4best(NULL)
266 , fhCluSize04D4best(NULL)
267 , fhCluMul04D4best(NULL)
268 , fhStrMul04D4best(NULL)
269 , fhCluMulTSig0D4best(NULL)
270 , fhCluMulTSig4D4best(NULL)
271 , fhCluMulTrel0D4best(NULL)
272 , fhCluMulTrel4D4best(NULL)
273 , fhCluSizeTrel0D4best(NULL)
274 , fhCluSizeTrel4D4best(NULL)
275 , fhDXDY04D4best(NULL)
276 , fhDXDT04D4best(NULL)
277 , fhDYDT04D4best(NULL)
278 , fhDistDT04D4best(NULL)
279 , fhTexpDT04D4best(NULL)
280 , fhCluSize0DT04D4best(NULL)
281 , fhCluSize4DT04D4best(NULL)
282 , fhTot0DT04D4best(NULL)
283 , fhTot4DT04D4best(NULL)
284 , fhCluSizeSigT0D4best(NULL)
285 , fhCluSizeSigT4D4best(NULL)
286 , fhChiDT04D4best(NULL)
287 , fhDT24DT04D4best(NULL)
288 , fhDTD4DT04D4best(NULL)
289 , fhX0DT04D4best(NULL)
290 , fhY0DT04D4best(NULL)
291 , fhTISDT04D4best(NULL)
292 , fhDTMul4D4best(NULL)
299 , fhDTMul0D4best(NULL)
306 , fhChi04D4sbest(NULL)
309 , fhDigiMul0D4sbest(NULL)
310 , fhDigiMul4D4sbest(NULL)
311 , fhCluMul04D4sbest(NULL)
312 , fhDXDY04D4sbest(NULL)
313 , fhDXDT04D4sbest(NULL)
314 , fhDYDT04D4sbest(NULL)
315 , fhDistDT04D4sbest(NULL)
316 , fhTexpDT04D4sbest(NULL)
317 , fhCluSize0DT04D4sbest(NULL)
318 , fhCluSize4DT04D4sbest(NULL)
319 , fhTot0DT04D4sbest(NULL)
320 , fhTot4DT04D4sbest(NULL)
321 , fhChiDT04D4sbest(NULL)
322 , fhDT24DT04D4sbest(NULL)
323 , fhDTD4DT04D4sbest(NULL)
324 , fhX0DT04D4sbest(NULL)
325 , fhY0DT04D4sbest(NULL)
326 , fhDTMul4D4sbest(NULL)
327 , fhDTX4D4sbest(NULL)
328 , fhDTY4D4sbest(NULL)
329 , fhDXX4D4sbest(NULL)
330 , fhDXY4D4sbest(NULL)
331 , fhDYX4D4sbest(NULL)
332 , fhDYY4D4sbest(NULL)
333 , fhDTMul0D4sbest(NULL)
334 , fhDTX0D4sbest(NULL)
335 , fhDTY0D4sbest(NULL)
336 , fhDXX0D4sbest(NULL)
337 , fhDXY0D4sbest(NULL)
338 , fhDYX0D4sbest(NULL)
339 , fhDYY0D4sbest(NULL)
341 , fhNMatch24sel(NULL)
352 , fhXYSel2D4best(NULL)
355 , fhXYSel2D4sel(NULL)
381 , fhDutChi_Found(NULL)
382 , fhDutChi_Missed(NULL)
383 , fhDutChi_Match(NULL)
384 , fhDutXY_Found(NULL)
385 , fhDutXY_Missed(NULL)
386 , fhDutDTLH_Found(NULL)
387 , fhDutDTLH_Missed(NULL)
388 , fhDutMul_Found(NULL)
389 , fhDutMul_Missed(NULL)
390 , fhDutTIS_Found(NULL)
391 , fhDutTIS_Missed(NULL)
392 , fhDutTIR_Found(NULL)
393 , fhDutTIR_Missed(NULL)
394 , fhDutVel_Found(NULL)
395 , fhDutVel_Missed(NULL)
396 , fhDutDTLH_CluSize(NULL)
397 , fhDutDTLH_Tot(NULL)
398 , fhDutDTLH_Mul(NULL)
399 , fhDutDTLH_TIS(NULL)
400 , fhDutDTLH_Missed_TIS(NULL)
401 , fhDutDTLH_DDH_Found(NULL)
402 , fhDutDTLH_DD_Found(NULL)
403 , fhDutDTLH_DD_Missed(NULL)
407 , fhNMergedMCEvents(NULL)
408 , fhAccTrackMul(NULL)
409 , fhAccRefTrackMul(NULL)
410 , fhAccPrimTrackMul(NULL)
411 , fhAccTrackPointMul(NULL)
412 , fhAccRefTrackPointMul(NULL)
413 , fhAccRndmTrackPointMul(NULL)
414 , fhAccRefTrackAcceptance(NULL)
415 , fhAccRefTrackAcceptanceEfficiency(NULL)
416 , fhAccRefTrackAcceptancePurity(NULL)
417 , fhAccRefTrackMulCentrality(NULL)
418 , fhAccRefTracksProcSpec(NULL)
419 , fhSelMCTrackEfficiency(NULL)
420 , fhSelMCTrackMatchEfficiency(NULL)
421 , fhSelMCTrackMatchPurity(NULL)
422 , fhSelMCTrackDutHitMatchNNMul(NULL)
423 , fhSelMCTrackDutHitMatchAccNNMul(NULL)
424 , fhSelEfficiency(NULL)
426 , fhSelRefTrackShare(NULL)
427 , fhSelRefTrackProcSpec(NULL)
428 , fhSelMatchEfficiency(NULL)
429 , fhSelMatchPurity(NULL)
430 , fhResX04HitExp(NULL)
431 , fhResX04ExpMC(NULL)
432 , fhResX04HitMC(NULL)
433 , fhResY04HitExp(NULL)
434 , fhResY04ExpMC(NULL)
435 , fhResY04HitMC(NULL)
436 , fhResT04HitExp(NULL)
437 , fhResT04ExpMC(NULL)
438 , fhResT04HitMC(NULL)
439 , fhNTracksPerMRefHit(NULL)
440 , fhNTracksPerSel2Hit(NULL)
441 , fhNTracksPerDutHit(NULL)
442 , fhNTracksPerSelMRefHit(NULL)
443 , fhNTracksPerSelSel2Hit(NULL)
444 , fhNTracksPerSelDutHit(NULL)
445 , fhSelTrklEfficiency(NULL)
446 , fhSelTrklPurity(NULL)
447 , fhSelTrklRefTrackShare(NULL)
448 , fhSelTrklRefTrackProcSpec(NULL)
449 , fhSelTrklMatchEfficiency(NULL)
450 , fhSelTrklMatchPurity(NULL)
451 , fhDutResX_Hit_Trk(NULL)
452 , fhDutResX_Trk_MC(NULL)
453 , fhDutResX_Hit_MC(NULL)
454 , fhDutResY_Hit_Trk(NULL)
455 , fhDutResY_Trk_MC(NULL)
456 , fhDutResY_Hit_MC(NULL)
457 , fhDutResT_Hit_Trk(NULL)
458 , fhDutResT_Trk_MC(NULL)
459 , fhDutResT_Hit_MC(NULL)
460 , fhSelHitTupleEfficiencyTIS(NULL)
461 , fhSelTrklEfficiencyTIS(NULL)
462 , fhSelMCTrackEfficiencyTIS(NULL)
463 , fhSelHitTupleMatchEfficiencyTIS(NULL)
464 , fhSelTrklMatchEfficiencyTIS(NULL)
465 , fhSelMCTrackMatchEfficiencyTIS(NULL)
466 , fhSelHitTupleResidualTTIS(NULL)
467 , fhSelTrklResidualTTIS(NULL)
468 , fhSelMCTrackResidualTTIS(NULL)
469 , fhSelHitTupleDutCluSizeTIS(NULL)
470 , fhSelTrklDutCluSizeTIS(NULL)
471 , fhSelMCTrackDutCluSizeTIS(NULL)
478 , fhAccRefTrackResT(NULL)
479 , fhAccRefTrackResX(NULL)
480 , fhAccRefTrackResY(NULL)
481 , fhAccRefTrackResTx(NULL)
482 , fhAccRefTrackResTy(NULL)
483 , fhAccRefTrackResV(NULL)
484 , fhAccRefTrackResN(NULL)
485 , fhAccRefTrackShare(NULL)
486 , fhRecRefTrackEfficiency(NULL)
487 , fhRecRndmTrackEfficiency(NULL)
488 , fhRecRefTrackGhostShare(NULL)
489 , fhRecRefTrackCloneShare(NULL)
490 , fhRecRndmTrackGhostShare(NULL)
491 , fhRecRndmTrackCloneShare(NULL)
492 , fhDomTracksProcSpec()
493 , fhDomTracksProcMat()
494 , fhRndmTracksProcSpec()
495 , fhRndmTracksProcMat()
496 , fhCounterAccTrackMul()
497 , fhCounterAccRefTrackMul()
498 , fhCounterAccRndmTrackMul()
499 , fhCounterAccDomTrackMul()
500 , fhCounterRecRefTrackEfficiencyPassed()
501 , fhCounterRecRefTrackEfficiencyTotal()
502 , fhCounterRecRefTrackPurityPassed()
503 , fhCounterRefTrackMulHitMul()
504 , fhCounterRefTrackLocalXY()
505 , fhCounterRefTrackMulCell()
506 , fhCounterHitMulCell()
507 , fhSelTrklFitRedChiSq(NULL)
508 , fhSelTrklDutHitMatchNNMul(NULL)
509 , fhSelTrklDutHitMatchAccNNMul(NULL)
510 , fhSelHitTupleDutHitMatchMul(NULL)
511 , fhSelHitTupleDutHitMatchAccMul(NULL)
512 , fhSelTypeNNChiSq(NULL)
513 , fhSelTypeNNResidualT(NULL)
514 , fhSelTypeNNResidualX(NULL)
515 , fhSelTypeNNResidualY(NULL)
516 , fhSelTypeAccNNChiSq(NULL)
517 , fhSelTypeAccNNResidualT(NULL)
518 , fhSelTypeAccNNResidualX(NULL)
519 , fhSelTypeAccNNResidualY(NULL)
520 , fhGoodSelTypeNNPureChiSq(NULL)
521 , fhGoodSelTypeNNAllChiSq(NULL)
522 , fhTrklNofHitsRate(NULL)
523 , fhTrklDetHitRate(NULL)
524 , fhTrklNofHitsRateInSpill(NULL)
525 , fhTrklDetHitRateInSpill(NULL)
528 , fCalParFileName(
"")
529 , fCalOutFileName(
"./tofAnaTestBeam.hst.root")
531 , fhDTD4DT04D4Off(NULL)
534 , fhDTTexpD4Off(NULL)
535 , fhCluSize0DT04D4Off(NULL)
536 , fhCluSize4DT04D4Off(NULL)
537 , fhTot0DT04D4Off(NULL)
538 , fhTot4DT04D4Off(NULL)
539 , fhSelTypeNNResidualT_Width(NULL)
540 , fhSelTypeNNResidualX_Width(NULL)
541 , fhSelTypeNNResidualY_Width(NULL)
542 , fhSelHitTupleResidualXYT_Width(NULL)
546 , fdStartSpillTime(-100)
600 , fEnableMatchPosScaling(kTRUE)
603 , fTrackletTools(NULL)
604 , fbMonteCarloComparison(kFALSE)
605 , fbPointsInInputFile(kFALSE)
606 , fbTracksInInputFile(kFALSE)
607 , fMCEventHeader(NULL)
613 , fTofHitPointMatches(NULL)
614 , fTofHitAccTrackMatches(NULL)
615 , fTofTrackletAccTrackMatches(NULL)
616 , fTofAccTrackTrackletMatches(NULL)
617 , fTofAccTrackPointMatches(NULL)
619 , fCurrentModuleNodePath()
620 , fiCurrentModuleType(-1)
621 , fiCurrentModuleIndex(-1)
622 , fiCurrentCounterIndex(-1)
623 , fCounterModuleNodes()
625 , fdGhostTrackHitQuota(0.7)
626 , fbDelayMCPoints(kFALSE)
627 , fbAttachDutHitToTracklet(kFALSE)
628 , fbBestSelTrackletOnly(kFALSE)
629 , fbUseSigCalib(kFALSE)
635 , fiMinMCRefTrackPoints(3)
636 , fiMaxMCRefTracks(1)
1351 Double_t XDMAX = 300.;
1352 Double_t YDMAX = 300.;
1353 Double_t TDMAX = 1000.;
1354 Double_t DTMAX = 1.;
1355 Double_t DXMAX = 10.;
1356 Double_t DYMAX = 10.;
1360 TDirectory* oldir = gDirectory;
1364 Double_t TISmax = 11.;
1365 Double_t TISnbins = 110.;
1366 fhRate_all =
new TH1F(
"hRate_all",
"Event Rate; Rate (Hz); t (sec)", 1000, 0, 100);
1367 fhTriggerPattern =
new TH1I(
"tof_trb_trigger_pattern",
"CTS trigger pattern", 16, 0, 16);
1368 fhTriggerType =
new TH1I(
"tof_trb_trigger_types",
"CTS trigger types", 16, 0, 16);
1369 fhTimeInSpill =
new TH1I(
"tof_trb_time_in_spill",
"Time in Spill", TISnbins, 0, TISmax);
1370 fhTIS_all =
new TH1F(
"TIS_all",
"Time in Spill (all); t (sec)", TISnbins, 0, TISmax);
1371 fhTIS_sel =
new TH1F(
"TIS_sel",
"Time in Spill (sel); t (sec)", TISnbins, 0, TISmax);
1372 fhTIS_sel1 =
new TH1F(
"TIS_sel1",
"Time in Spill (sel1); t (sec)", TISnbins, 0, TISmax);
1373 fhTIS_sel2 =
new TH1F(
"TIS_sel2",
"Time in Spill (sel2); t (sec)", TISnbins, 0, TISmax);
1376 Double_t TIRmax = 1800.;
1377 Double_t TIRnbins = 18000.;
1378 fhTIR_all =
new TH1F(
"TIR_all",
"Time in Run (all); t (sec)", TIRnbins, 0, TIRmax);
1379 fhTIR_sel =
new TH1F(
"TIR_sel",
"Time in Run (sel); t (sec)", TIRnbins, 0, TIRmax);
1380 fhTIR_sel1 =
new TH1F(
"TIR_sel1",
"Time in Run (sel1); t (sec)", TIRnbins, 0, TIRmax);
1381 fhTIR_sel2 =
new TH1F(
"TIR_sel2",
"Time in Run (sel2); t (sec)", TIRnbins, 0, TIRmax);
1383 Double_t TISmax2 = 11.;
1384 Double_t TISnbins2 = 110.;
1385 fhTIS_Nhit =
new TH2F(
"TIS_Nhit",
"Time in Spill (Nhit); t (sec); N_{hit}", TISnbins2, 0, TISmax2, 25, 0, 50);
1386 fhTIS_Ntrk =
new TH2F(
"TIS_Ntrk",
"Time in Spill (Ntrk); t (sec); N_{trk}", TISnbins2, 0, TISmax2, 10, 0, 10);
1388 fhDTLH_all =
new TH1F(
"hDTLH_all",
"Time to last hit in Dut(all); log( #DeltaT (ns)); counts", 100., 0., 12.);
1389 fhDTLH_sel =
new TH1F(
"hDTLH_sel",
"Time to last hit in Dut(sel); log( #DeltaT (ns)); counts", 100., 0., 12.);
1390 fhDTLH_sel1 =
new TH1F(
"hDTLH_sel1",
"Time to last hit in Dut(sel1); log( #DeltaT (ns)); counts", 100., 0., 12.);
1391 fhDTLH_sel2 =
new TH1F(
"hDTLH_sel2",
"Time to last hit in Dut(sel2); log( #DeltaT (ns)); counts", 100., 0., 12.);
1393 "Time to last hit strip matching Dut(sel1); strip ; "
1394 "Channel-PredictedChannel",
1395 32, 0, 31, 7., -3.5, 3.5);
1397 fhBRefMul =
new TH1F(Form(
"hBRefMul"), Form(
"Multiplicity in Beam Reference counter ; Mul ()"), 50, 0., 50.);
1398 fhDTD4 =
new TH1F(Form(
"hDTD4"), Form(
"reference time ; #Delta tD4 (ns)"), 101, -100., 100.);
1402 for (
Int_t iDet = 0; iDet < iNbDet; iDet++) {
1403 fhXYPos[iDet] =
new TH2F(Form(
"hXY_SmT%d", iDet), Form(
"XY Position correlation of Det# %d; X[cm]; Y [cm]", iDet),
1404 100, -YDMAX / 2., YDMAX / 2., 100, -YDMAX, 0.);
1408 new TH2F(Form(
"hEtaPhi"), Form(
"Reconstructed Tof Hits; #phi (degree) ; #eta"), 200, -20., 20., 200, 1., 1.7);
1411 new TH2F(Form(
"hXX2"), Form(
"Plastic position correlation; XPla0; XPla1"), 100, -XDMAX, XDMAX, 100, -XDMAX, XDMAX);
1413 new TH2F(Form(
"hYY2"), Form(
"Plastic position correlation; YPla0; YPla1"), 100, -YDMAX, YDMAX, 100, -YDMAX, YDMAX);
1414 fhDT2 =
new TH1F(Form(
"hDT2"), Form(
"Plastic time difference; TPla0 - TPla1 (ns)"), 100, -1., 1.);
1416 for (
Int_t iDet = 0; iDet < 2; iDet++) {
1418 new TH2F(Form(
"hXX02_%d", iDet), Form(
"X Position correlation; X0; X2"), 100, -YDMAX, YDMAX, 100, -YDMAX, YDMAX);
1420 new TH2F(Form(
"hYY02_%d", iDet), Form(
"Y Position correlation; Y0; Y2"), 100, -YDMAX, YDMAX, 100, -YDMAX, YDMAX);
1423 const Double_t HTMAX = 100.;
1424 const Double_t HYMAX = 40.;
1425 fhDutDXDYDT =
new TH3F(Form(
"hDutDXDYDT"), Form(
"Hits distances; #DeltaX [cm]; #DeltaY [cm]; #DeltaT [ns]"), 101,
1426 -HYMAX, HYMAX, 101, -HYMAX, HYMAX, 101, -HTMAX, HTMAX);
1427 fhRefDXDYDT =
new TH3F(Form(
"hRefDXDYDT"), Form(
"Hits distances; #DeltaX [cm]; #DeltaY [cm]; #DeltaT [ns]"), 101,
1428 -HYMAX, HYMAX, 101, -HYMAX, HYMAX, 101, -HTMAX, HTMAX);
1431 new TH2F(Form(
"hXX04"), Form(
"X Position correlation; X0 [cm]; X4 [cm]"), 500, -YDMAX, YDMAX, 500, -YDMAX, YDMAX);
1433 new TH2F(Form(
"hYY04"), Form(
"Y Position correlation; Y0 [cm]; Y4 [cm]"), 500, -YDMAX, YDMAX, 500, -YDMAX, YDMAX);
1435 new TH2F(Form(
"hXY04"), Form(
"X Position correlation; X0 [cm]; Y4 [cm]"), 500, -YDMAX, YDMAX, 500, -YDMAX, YDMAX);
1437 new TH2F(Form(
"hYX04"), Form(
"Y Position correlation; Y0 [cm]; X4 [cm]"), 500, -YDMAX, YDMAX, 500, -YDMAX, YDMAX);
1438 fhTT04 =
new TH2F(Form(
"hTT04"), Form(
"Time correlation; T0 [ns]; T0 - T4 [ns]"), 100, -TDMAX, TDMAX, 100, -1., 1.);
1439 fhDXDY04 =
new TH2F(Form(
"hDXDY04"), Form(
"position correlation; #Delta x [cm]; #DeltaY [cm]"), 100, -DXMAX, DXMAX,
1440 100, -DYMAX, DYMAX);
1441 fhDXDT04 =
new TH2F(Form(
"hDXDT04"), Form(
"Time - position correlation; #Delta x [cm]; #DeltaT [ns]"), 100, -DXMAX,
1442 DXMAX, 100, -DTMAX, DTMAX);
1443 fhDYDT04 =
new TH2F(Form(
"hDYDT04"), Form(
"Time - position correlation; #Delta y [cm]; #DeltaT [ns]"), 100, -DYMAX,
1444 DYMAX, 100, -DTMAX, DTMAX);
1445 fhChi04 =
new TH1F(Form(
"hChi04"), Form(
"Matching Chi2; #chi; Nhits"), 100, 0.,
fdChi2Lim);
1446 fhChiSel24 =
new TH1F(Form(
"hChiSel24"), Form(
"Matching Chi2S24; #chi; Nhits"), 100, 0.,
fdChi2Lim2);
1447 fhDXSel24 =
new TH1F(Form(
"hDXSel24"), Form(
"Matching Sel24; #Delta x [cm]; Nhits"), 100, -10., 10.);
1448 fhDYSel24 =
new TH1F(Form(
"hDYSel24"), Form(
"Matching Sel24; #Delta y [cm]; Nhits"), 100, -10., 10.);
1449 fhDTSel24 =
new TH1F(Form(
"hDTSel24"), Form(
"Matching Sel24; #Delta t_{cor} [ns]; Nhits"), 100, -1., 1.);
1450 fhTofSel24 =
new TH1F(Form(
"hTofSel24"), Form(
"Matching Sel24; #Delta t [ns]; Nhits"), 100, -10., 10.);
1453 new TH2F(Form(
"hXY0D4best"), Form(
"local position 0; x [cm]; y [cm]"), iNbinXY, -17., 17., iNbinXY, -17., 17.);
1455 new TH2F(Form(
"hXY4D4best"), Form(
"local position 4; x [cm]; y [cm]"), iNbinXY, -17., 17., iNbinXY, -17., 17.);
1456 fhXX04D4best =
new TH2F(Form(
"hXX04D4best"), Form(
"local x position 0-4; x0 [cm]; x4 [cm]"), iNbinXY, -17., 17.,
1457 iNbinXY, -17., 17.);
1458 fhYY04D4best =
new TH2F(Form(
"hYY04D4best"), Form(
"local y position 0-4; y0 [cm]; y4 [cm]"), iNbinXY, -17., 17.,
1459 iNbinXY, -17., 17.);
1460 fhXYSel2D4best =
new TH2F(Form(
"hXYSel2D4best"), Form(
"local position Sel2; x [cm]; y [cm]"), iNbinXY, -17., 17.,
1461 iNbinXY, -17., 17.);
1463 new TH2F(Form(
"hXY0D4sel"), Form(
"predicted position 0; x [cm]; y [cm]"), iNbinXY, -17., 17., iNbinXY, -17., 17.);
1465 new TH2F(Form(
"hXY4D4sel"), Form(
"selected position 4; x [cm]; y [cm]"), iNbinXY, -17., 17., iNbinXY, -17., 17.);
1466 fhXYSel2D4sel =
new TH2F(Form(
"hXYSel2D4sel"), Form(
"selected position Sel2; x [cm]; y [cm]"), iNbinXY, -17., 17.,
1467 iNbinXY, -17., 17.);
1469 fhDXDY04best =
new TH2F(Form(
"hDXDY04best"), Form(
"position correlation; #Delta x [cm]; #DeltaY [cm]"), 100, -DXMAX,
1470 DXMAX, 100, -DYMAX, DYMAX);
1471 fhDXDT04best =
new TH2F(Form(
"hDXDT04best"), Form(
"time - position correlation; #Delta x [cm]; #DeltaT [ns]"), 100,
1472 -DXMAX, DXMAX, 100, -DTMAX, DTMAX);
1473 fhDYDT04best =
new TH2F(Form(
"hDYDT04best"), Form(
"time - position correlation; #Delta y [cm]; #DeltaT [ns]"), 100,
1474 -DYMAX, DYMAX, 100, -DTMAX, DTMAX);
1476 fhX0DT04best =
new TH2F(Form(
"hX0DT04best"), Form(
"time - position correlation; #Delta x [cm]; #DeltaT [ns]"), 100,
1477 -50., 50., 100, -DTMAX, DTMAX);
1478 fhY0DT04best =
new TH2F(Form(
"hY0DT04best"), Form(
"time - position correlation; #Delta y [cm]; #DeltaT [ns]"), 100,
1479 -50., 50., 100, -DTMAX, DTMAX);
1481 fhChi04best =
new TH1F(Form(
"hChi04best"), Form(
"matching chi2; #chi; Nhits"), 100, 0.,
fdChi2Lim);
1482 fhDigiMul0best =
new TH1F(Form(
"hDigiMul0best"), Form(
"Number of digis in cluster; N_{digi}; "), 40, 0., 40.);
1483 fhDigiMul4best =
new TH1F(Form(
"hDigiMul4best"), Form(
"Number of digis in cluster; N_{digi}; "), 40, 0., 40.);
1485 fhChiDT04best =
new TH2F(Form(
"hChiDT04best"), Form(
"Time - Chi correlation; #chi; #DeltaT [ns]"), 100, 0., 100., 100,
1488 fhDXDY04D4best =
new TH2F(Form(
"hDXDY04D4best"), Form(
"position correlation; #Delta x [cm]; #DeltaY [cm]"), 100,
1489 -DXMAX, DXMAX, 100, -DYMAX, DYMAX);
1490 fhDXDT04D4best =
new TH2F(Form(
"hDXDT04D4best"), Form(
"time - position correlation; #Delta x [cm]; #DeltaT [ns]"),
1491 100, -DXMAX, DXMAX, 100, -DTMAX, DTMAX);
1492 fhDYDT04D4best =
new TH2F(Form(
"hDYDT04D4best"), Form(
"time - position correlation; #Delta y [cm]; #DeltaT [ns]"),
1493 100, -DYMAX, DYMAX, 100, -DTMAX, DTMAX);
1494 fhDistDT04D4best =
new TH2F(Form(
"hDistDT04D4best"), Form(
"time - distance correlation; Dist [cm]; #DeltaT [ns]"),
1497 new TH2F(Form(
"hTexpDT04D4best"), Form(
"measured - expected time - correlation; Texp [ns]; #DeltaT [ns]"), 100, 0.,
1498 1., 100, -DTMAX, DTMAX);
1500 new TH2F(Form(
"hCluSize0DT04D4best"), Form(
"time - CluSize correlation; M_{strips} ; #DeltaT [ns]"), 20, 0.5, 20.5,
1501 100, -DTMAX, DTMAX);
1503 new TH2F(Form(
"hCluSize4DT04D4best"), Form(
"time - CluSize correlation; M_{strips} ; #DeltaT [ns]"), 20, 0.5, 20.5,
1504 100, -DTMAX, DTMAX);
1506 new TH2F(Form(
"hCluSizeSigT0D4best"), Form(
"time spread - CluSize correlation; M_{strips} ; #sigma_{T} [ns]"), 20,
1507 0.5, 20.5, 100, 0., DTMAX / 5.);
1509 new TH2F(Form(
"hCluSizeSigT4D4best"), Form(
"time spread - CluSize correlation; M_{strips} ; #sigma_{T} [ns]"), 20,
1510 0.5, 20.5, 100, 0., DTMAX / 5.);
1511 fhTot0DT04D4best =
new TH2F(Form(
"hTot0DT04D4best"), Form(
"time - Tot correlation; ln TOT0 ; #DeltaT [ns]"), 100,
1512 -2.5, 3.0, 100, -DTMAX, DTMAX);
1513 fhTot4DT04D4best =
new TH2F(Form(
"hTot4DT04D4best"), Form(
"time - Tot correlation; ln TOT4 ; #DeltaT [ns]"), 100,
1514 -2.5, 3.0, 100, -DTMAX, DTMAX);
1516 fhX0DT04D4best =
new TH2F(Form(
"hX0DT04D4best"), Form(
"time - position correlation; #Delta x [cm]; #DeltaT [ns]"),
1517 100, -50., 50., 100, -DTMAX, DTMAX);
1518 fhY0DT04D4best =
new TH2F(Form(
"hY0DT04D4best"), Form(
"time - position correlation; #Delta y [cm]; #DeltaT [ns]"),
1519 100, -50., 50., 100, -DTMAX, DTMAX);
1521 fhTISDT04D4best =
new TH2F(Form(
"hTISDT04D4best"), Form(
"time - TIS; time in spill [s]; #DeltaT [ns]"), TISnbins, 0.,
1522 TISmax, 100, -DTMAX, DTMAX);
1525 fhTofD4best =
new TH1F(Form(
"hTofD4best"), Form(
"tof D4; t [ns]; Counts"), 100, 0., 50.);
1526 fhVelD4best =
new TH1F(Form(
"hVelD4best"), Form(
"vel D4; v [cm/ns]; Counts"), 100, 0., 50.);
1529 new TH2F(Form(
"hDigiMul0D4best"), Form(
"Number of digis in cluster; Mul0; N_{strips}; "), 40, 0., 40., 40, 0., 40.);
1531 new TH2F(Form(
"hDigiMul4D4best"), Form(
"Number of digis in cluster; Mul4; N_{strips}; "), 40, 0., 40., 40, 0., 40.);
1533 new TH2F(Form(
"hCluSize04D4best"), Form(
"cluster multiplicity ; CluSize0; CluSize4"), 40, 0., 40., 40, 0., 40.);
1535 new TH2F(Form(
"hCluMul04D4best"), Form(
"cluster size correlation ; Mul0; Mul4"), 40, 0., 40., 20, 0., 20.);
1537 new TH2F(Form(
"hStrMul04D4best"), Form(
"strip multiplicity ; StrMul0; StrMul4"), 50, 0., 50., 50, 0., 50.);
1539 new TH2F(Form(
"hCluMulTSig0D4best"), Form(
"time spread - cluster multiplicity ; Mul0; #sigma_{T} (ns)"), 50, 0.,
1540 50., 100, 0., 200.);
1542 new TH2F(Form(
"hCluMulTSig4D4best"), Form(
"time spread - cluster multiplicity ; Mul4; #sigma_{T} (ns)"), 50, 0.,
1543 50., 100, 0., 200.);
1545 new TH2F(Form(
"hCluMulTrel0D4best"), Form(
"arrrival time - cluster multiplicity ; Mul0; T_{rel} (ns)"), 50, 0., 50.,
1548 new TH2F(Form(
"hCluMulTrel4D4best"), Form(
"arrival time - cluster multiplicity ; Mul4; T_{rel} (ns)"), 50, 0., 50.,
1551 new TH2F(Form(
"hCluSizeTrel0D4best"), Form(
"arrrival time - cluster size ; CluSize0; T_{rel} (ns)"), 30, 0., 30.,
1554 new TH2F(Form(
"hCluSizeTrel4D4best"), Form(
"arrival time - cluster size ; CluSize4; T_{rel} (ns)"), 30, 0., 30., 99,
1557 fhChiDT04D4best =
new TH2F(Form(
"hChiDT04D4best"), Form(
"Time - position correlation; #chi; #DeltaT [ns]"), 100, 0.,
1558 100., 100, -DTMAX, DTMAX);
1559 Double_t dtscal = 5.;
1562 new TH2F(Form(
"hDTD4DT04D4best"), Form(
"Time - velocity correlation; #DeltaTD4 [ns]; #DeltaT04 [ns]"), 100,
1563 -DTMAX * 6., DTMAX * 6., 500, -DTMAX * dtscal, DTMAX * dtscal);
1567 fhDTMul4D4best =
new TH2F(Form(
"hDTMul4D4best"), Form(
"MRef Time - Multiplicity correlation; Mul4 ; #DeltaT04 [ns]"),
1568 20, 0., 20., 100, -DTMAX, DTMAX);
1569 fhDTX4D4best =
new TH2F(Form(
"hDTX4D4best"), Form(
"MRef Time - position correlation; X4 [cm]; #DeltaT04 [ns]"), 50,
1570 -17., 17., 100, -DTMAX, DTMAX);
1571 fhDTY4D4best =
new TH2F(Form(
"hDTY4D4best"), Form(
"MRef Time - position correlation; Y4 [cm]; #DeltaT04 [ns]"), 50,
1572 -15., 15., 100, -DTMAX, DTMAX);
1573 fhDXX4D4best =
new TH2F(Form(
"hDXX4D4best"), Form(
"MRef DX - position correlation; X4 [cm]; #DeltaX04 [cm]"), 50,
1574 -17., 17., 50, -10., 10.);
1575 fhDXY4D4best =
new TH2F(Form(
"hDXY4D4best"), Form(
"MRef DX - position correlation; Y4 [cm]; #DeltaX04 [cm]"), 50,
1576 -15., 15., 50, -10., 10.);
1577 fhDYX4D4best =
new TH2F(Form(
"hDYX4D4best"), Form(
"MRef DY - position correlation; X4 [cm]; #DeltaY04 [cm]"), 50,
1578 -17., 17., 50, -10., 10.);
1579 fhDYY4D4best =
new TH2F(Form(
"hDYY4D4best"), Form(
"MRef DY - position correlation; Y4 [cm]; #DeltaY04 [cm]"), 50,
1580 -15., 15., 50, -10., 10.);
1582 fhDTMul0D4best =
new TH2F(Form(
"hDTMul0D4best"), Form(
"Dut Time - Multiplicity correlation; Mul0 ; #DeltaT04 [ns]"),
1583 40, 0., 40., 100, -DTMAX, DTMAX);
1584 fhDTX0D4best =
new TH2F(Form(
"hDTX0D4best"), Form(
"Dut Time - position correlation; X0 [cm]; #DeltaT04 [ns]"), 50,
1585 -17., 17., 100, -DTMAX, DTMAX);
1586 fhDTY0D4best =
new TH2F(Form(
"hDTY0D4best"), Form(
"Dut Time - position correlation; Y0 [cm]; #DeltaT04 [ns]"), 50,
1587 -15., 15., 100, -DTMAX, DTMAX);
1588 fhDXX0D4best =
new TH2F(Form(
"hDXX0D4best"), Form(
"Dut DX - position correlation; X0 [cm]; #DeltaX04 [cm]"), 50, -17.,
1589 17., 50, -15., 15.);
1590 fhDXY0D4best =
new TH2F(Form(
"hDXY0D4best"), Form(
"Dut DX - position correlation; Y0 [cm]; #DeltaX04 [cm]"), 50, -15.,
1591 15., 50, -15., 15.);
1592 fhDYX0D4best =
new TH2F(Form(
"hDYX0D4best"), Form(
"Dut DY - position correlation; X0 [cm]; #DeltaY04 [cm]"), 50, -17.,
1593 17., 50, -15., 15.);
1594 fhDYY0D4best =
new TH2F(Form(
"hDYY0D4best"), Form(
"Dut DY - position correlation; Y0 [cm]; #DeltaY04 [cm]"), 50, -15.,
1595 15., 50, -15., 15.);
1598 fhX0DT04D4sbest =
new TH2F(Form(
"hX0DT04D4sbest"), Form(
"time - position correlation; #Delta x [cm]; #DeltaT [ns]"),
1599 100, -50., 50., 100, -DTMAX, DTMAX);
1600 fhY0DT04D4sbest =
new TH2F(Form(
"hY0DT04D4sbest"), Form(
"time - position correlation; #Delta y [cm]; #DeltaT [ns]"),
1601 100, -50., 50., 100, -DTMAX, DTMAX);
1603 fhDXDY04D4sbest =
new TH2F(Form(
"hDXDY04D4sbest"), Form(
"position correlation; #Delta x [cm]; #DeltaY [cm]"), 100,
1604 -DXMAX, DXMAX, 100, -DYMAX, DYMAX);
1605 fhDXDT04D4sbest =
new TH2F(Form(
"hDXDT04D4sbest"), Form(
"time - position correlation; #Delta x [cm]; #DeltaT [ns]"),
1606 100, -DXMAX, DXMAX, 100, -DTMAX, DTMAX);
1607 fhDYDT04D4sbest =
new TH2F(Form(
"hDYDT04D4sbest"), Form(
"time - position correlation; #Delta y [cm]; #DeltaT [ns]"),
1608 100, -DYMAX, DYMAX, 100, -DTMAX, DTMAX);
1609 fhDistDT04D4sbest =
new TH2F(Form(
"hDistDT04D4sbest"), Form(
"time - distance correlation; Dist [cm]; #DeltaT [ns]"),
1612 new TH2F(Form(
"hTexpDT04D4sbest"), Form(
"measured - expected time - correlation; Texp [ns]; #DeltaT [ns]"), 100, 0.,
1613 6., 100, -DTMAX, DTMAX);
1615 new TH2F(Form(
"hCluSize0DT04D4sbest"), Form(
"time - CluSize correlation; N_{strips} ; #DeltaT [ns]"), 20, 0.5, 20.5,
1616 100, -DTMAX, DTMAX);
1618 new TH2F(Form(
"hCluSize4DT04D4sbest"), Form(
"time - CluSize correlation; N_{strips} ; #DeltaT [ns]"), 20, 0.5, 20.5,
1619 100, -DTMAX, DTMAX);
1620 fhTot0DT04D4sbest =
new TH2F(Form(
"hTot0DT04D4sbest"), Form(
"time - Tot correlation; ln TOT0 ; #DeltaT [ns]"), 100,
1621 6.5, 9.5, 100, -DTMAX, DTMAX);
1622 fhTot4DT04D4sbest =
new TH2F(Form(
"hTot4DT04D4sbest"), Form(
"time - Tot correlation; ln TOT4 ; #DeltaT [ns]"), 100,
1623 6.5, 9.5, 100, -DTMAX, DTMAX);
1626 fhTofD4sbest =
new TH1F(Form(
"hTofD4sbest"), Form(
"tof D4; t [ns]; Counts"), 100, 0., 50.);
1627 fhVelD4sbest =
new TH1F(Form(
"hVelD4sbest"), Form(
"vel D4; v [cm/ns]; Counts"), 100, 0., 50.);
1629 fhDigiMul0D4sbest =
new TH1F(Form(
"hDigiMul0D4sbest"), Form(
"Number of digis in cluster; N_{digi}; "), 20, 0., 20.);
1630 fhDigiMul4D4sbest =
new TH1F(Form(
"hDigiMul4D4sbest"), Form(
"Number of digis in cluster; N_{digi}; "), 20, 0., 20.);
1632 new TH2F(Form(
"hCluMul04D4sbest"), Form(
"cluster multiplicity ; Mul0; Mul4"), 10, 0., 10., 10, 0., 10.);
1634 fhChiDT04D4sbest =
new TH2F(Form(
"hChiDT04D4sbest"), Form(
"Time - position correlation; #chi; #DeltaT [ns]"), 100, 0.,
1635 100., 100, -DTMAX, DTMAX);
1638 new TH2F(Form(
"hDTD4DT04D4sbest"), Form(
"Time - velocity correlation; #DeltaTD4 [ns]; #DeltaT04 [ns]"), 100,
1639 -DTMAX * 6., DTMAX * 6., 100, -DTMAX, DTMAX);
1641 fhDTMul4D4sbest =
new TH2F(Form(
"hDTMul4D4sbest"), Form(
"Time - Multiplicity correlation; Mul4 ; #DeltaT04 [ns]"), 10,
1642 0., 10., 100, -DTMAX, DTMAX);
1643 fhDTX4D4sbest =
new TH2F(Form(
"hDTX4D4sbest"), Form(
"Time - position correlation; X4 [cm]; #DeltaT04 [ns]"), 50, -15.,
1644 15., 100, -DTMAX, DTMAX);
1645 fhDTY4D4sbest =
new TH2F(Form(
"hDTY4D4sbest"), Form(
"Time - position correlation; Y4 [cm]; #DeltaT04 [ns]"), 50, -15.,
1646 15., 100, -DTMAX, DTMAX);
1647 fhDXX4D4sbest =
new TH2F(Form(
"hDXX4D4sbest"), Form(
"DX - position correlation; X4 [cm]; #DeltaX04 [cm]"), 50, -15.,
1648 15., 50, -10., 10.);
1649 fhDXY4D4sbest =
new TH2F(Form(
"hDXY4D4sbest"), Form(
"DX - position correlation; Y4 [cm]; #DeltaX04 [cm]"), 50, -15.,
1650 15., 50, -10., 10.);
1651 fhDYX4D4sbest =
new TH2F(Form(
"hDYX4D4sbest"), Form(
"DY - position correlation; X4 [cm]; #DeltaY04 [cm]"), 50, -15.,
1652 15., 50, -10., 10.);
1653 fhDYY4D4sbest =
new TH2F(Form(
"hDYY4D4sbest"), Form(
"DY - position correlation; Y4 [cm]; #DeltaY04 [cm]"), 50, -15.,
1654 15., 50, -10., 10.);
1656 fhDTMul0D4sbest =
new TH2F(Form(
"hDTMul0D4sbest"), Form(
"Time - Multiplicity correlation; Mul0 ; #DeltaT04 [ns]"), 10,
1657 0., 10., 100, -DTMAX, DTMAX);
1658 fhDTX0D4sbest =
new TH2F(Form(
"hDTX0D4sbest"), Form(
"Time - position correlation; X0 [cm]; #DeltaT04 [ns]"), 50, -17.,
1659 17., 100, -DTMAX, DTMAX);
1660 fhDTY0D4sbest =
new TH2F(Form(
"hDTY0D4sbest"), Form(
"Time - position correlation; Y0 [cm]; #DeltaT04 [ns]"), 50, -15.,
1661 15., 100, -DTMAX, DTMAX);
1662 fhDXX0D4sbest =
new TH2F(Form(
"hDXX0D4sbest"), Form(
"DX - position correlation; X0 [cm]; #DeltaX04 [cm]"), 50, -17.,
1663 17., 50, -15., 15.);
1664 fhDXY0D4sbest =
new TH2F(Form(
"hDXY0D4sbest"), Form(
"DX - position correlation; Y0 [cm]; #DeltaX04 [cm]"), 50, -15.,
1665 15., 50, -15., 15.);
1666 fhDYX0D4sbest =
new TH2F(Form(
"hDYX0D4sbest"), Form(
"DY - position correlation; X0 [cm]; #DeltaY04 [cm]"), 50, -17.,
1667 17., 50, -15., 15.);
1668 fhDYY0D4sbest =
new TH2F(Form(
"hDYY0D4sbest"), Form(
"DY - position correlation; Y0 [cm]; #DeltaY04 [cm]"), 50, -15.,
1669 15., 50, -15., 15.);
1671 fhNMatch04 =
new TH1F(Form(
"hNMatch04"), Form(
"Number of Matched Hit pairs 0-4; NMatched"), 50, 0., 50.);
1673 fhNMatch04sel =
new TH1F(Form(
"hNMatch04sel"), Form(
"Number of Matched Hit pairs 0-4; NMatched"), 50, 0., 50.);
1675 fhNMatchD4sel =
new TH1F(Form(
"hNMatchD4sel"), Form(
"Number of Matched Hit pairs 0-4; NMatched"), 50, 0., 50.);
1677 fhDTD4sel =
new TH1F(Form(
"hDTD4sel"), Form(
"Time difference BRef - MrpcRef; #DeltaTD4 (ns)"), 100, -
DTDMAX,
DTDMAX);
1680 new TH1F(Form(
"hTofD4sel"), Form(
"Time difference BRef - MrpcRef; #DeltaTD4 (ns)"), 100, -
DTDMAX,
DTDMAX);
1682 fhDT04DX0_1 =
new TH2F(Form(
"hDT04DX0_1"), Form(
"Time - position correlation; #DeltaX0 [cm]; #DeltaT04 [ns]"), 50,
1683 -25., 25., 100, -DTMAX, DTMAX);
1684 fhDT04DY0_1 =
new TH2F(Form(
"hDT04DY0_1"), Form(
"Time - position correlation; #DeltaY0 [cm]; #DeltaT04 [ns]"), 50,
1685 -25., 25., 100, -DTMAX, DTMAX);
1686 fhDT04DT0_1 =
new TH2F(Form(
"hDT04DT0_1"), Form(
"Time - time correlation; #DeltaT0 [ns]; #DeltaT04 [ns]"), 50, -5.,
1687 5., 100, -DTMAX, DTMAX);
1689 fhDT04DX4_1 =
new TH2F(Form(
"hDT04DX4_1"), Form(
"Time - position correlation; #DeltaX4 [cm]; #DeltaT04 [ns]"), 50,
1690 -10., 10., 100, -DTMAX, DTMAX);
1691 fhDT04DY4_1 =
new TH2F(Form(
"hDT04DY4_1"), Form(
"Time - position correlation; #DeltaY4 [cm]; #DeltaT04 [ns]"), 50,
1692 -15., 15., 100, -DTMAX, DTMAX);
1693 fhDT04DT4_1 =
new TH2F(Form(
"hDT04DT4_1"), Form(
"Time - time correlation; #DeltaT4 [ns]; #DeltaT04 [ns]"), 50, -5.,
1694 5., 100, -DTMAX, DTMAX);
1696 fhDT04DX0_2 =
new TH2F(Form(
"hDT04DX0_2"), Form(
"Time - position correlation; #DeltaX0 [cm]; #DeltaT04 [ns]"), 50,
1697 -25., 25., 100, -DTMAX, DTMAX);
1698 fhDT04DY0_2 =
new TH2F(Form(
"hDT04DY0_2"), Form(
"Time - position correlation; #DeltaY0 [cm]; #DeltaT04 [ns]"), 50,
1699 -25., 25., 100, -DTMAX, DTMAX);
1700 fhDT04DT0_2 =
new TH2F(Form(
"hDT04DT0_2"), Form(
"Time - time correlation; #DeltaT0 [ns]; #DeltaT04 [ns]"), 50, -5.,
1701 5., 100, -DTMAX, DTMAX);
1703 fhDT04DX4_2 =
new TH2F(Form(
"hDT04DX4_2"), Form(
"Time - position correlation; #DeltaX4 [cm]; #DeltaT04 [ns]"), 50,
1704 -10., 10., 100, -DTMAX, DTMAX);
1705 fhDT04DY4_2 =
new TH2F(Form(
"hDT04DY4_2"), Form(
"Time - position correlation; #DeltaY4 [cm]; #DeltaT04 [ns]"), 50,
1706 -15., 15., 100, -DTMAX, DTMAX);
1707 fhDT04DT4_2 =
new TH2F(Form(
"hDT04DT4_2"), Form(
"Time - time correlation; #DeltaT4 [ns]; #DeltaT04 [ns]"), 50, -5.,
1708 5., 100, -DTMAX, DTMAX);
1712 fhDutPullX =
new TH1F(Form(
"hDutPullX_Sm_%03d", iDutId), Form(
"hDutPullX_Sm_%03d; #DeltaX", iDutId), 100, -10., 10.);
1714 new TH1F(Form(
"hDutPullXB_Sm_%03d", iDutId), Form(
"hDutPullXB_Sm_%03d; #DeltaX", iDutId), 100, -10., 10.);
1715 fhDutPullY =
new TH1F(Form(
"hDutPullY_Sm_%03d", iDutId), Form(
"hDutPullY_Sm_%03d; #DeltaY", iDutId), 100, -10., 10.);
1717 new TH1F(Form(
"hDutPullYB_Sm_%03d", iDutId), Form(
"hDutPullYB_Sm_%03d; #DeltaY", iDutId), 100, -10., 10.);
1719 new TH1F(Form(
"hDutPullZ_Sm_%03d", iDutId), Form(
"hDutPullZ_Sm_%03d; #DeltaZ", iDutId), 100, -200., 200.);
1720 fhDutPullT =
new TH1F(Form(
"hDutPullT_Sm_%03d", iDutId), Form(
"hDutPullT_Sm_%03d; #DeltaT", iDutId), 100, -0.5, 0.5);
1722 new TH1F(Form(
"hDutPullTB_Sm_%03d", iDutId), Form(
"hDutPullTB_Sm_%03d; #DeltaT", iDutId), 150, -0.75, 0.75);
1724 fhDutChi_Found =
new TH1F(Form(
"hDutChi_Found_%03d", iDutId), Form(
"hDutChi_Found_%03d; #chi", iDutId), 50, 0., 10.);
1726 new TH1F(Form(
"hDutChi_Missed_%03d", iDutId), Form(
"hDutChi_Missed_%03d; #chi", iDutId), 50, 0., 10.);
1728 fhDutChi_Match =
new TH1F(Form(
"hDutChi_Match_%03d", iDutId), Form(
"hDutChi_Match_%03d; #chi", iDutId), 50, 0., 10.);
1729 Double_t XSIZ = 20.;
1730 Double_t DTSIZ = 0.5;
1732 fhDutXY_Found =
new TH2F(Form(
"hDutXY_Found_%03d", iDutId), Form(
"hDutXY_Found_%03d; x(cm); y (cm)", iDutId), Nbins,
1733 -XSIZ, XSIZ, Nbins, -XSIZ, XSIZ);
1734 fhDutXY_Missed =
new TH2F(Form(
"hDutXY_Missed_%03d", iDutId), Form(
"hDutXY_Missed_%03d; x(cm); y (cm)", iDutId),
1735 Nbins, -XSIZ, XSIZ, Nbins, -XSIZ, XSIZ);
1738 new TH1F(Form(
"hDutDTLH_Found_%03d", iDutId), Form(
"hDutDTLH_Found_%03d; log(#DeltaT)", iDutId), 50, 0., 12.);
1740 new TH1F(Form(
"hDutDTLH_Missed_%03d", iDutId), Form(
"hDutDTLH_Missed_%03d; log(#DeltaT)", iDutId), 50, 0., 12.);
1742 new TH1F(Form(
"hDutMul_Found_%03d", iDutId), Form(
"hDutMul_Found_%03d; Hit Multiplicity", iDutId), 32, 0., 32.);
1744 new TH1F(Form(
"hDutMul_Missed_%03d", iDutId), Form(
"hDutMul_Missed_%03d; Hit Multiplicity", iDutId), 32, 0., 32.);
1745 fhDutTIS_Found =
new TH2F(Form(
"hDutTIS_Found_%03d", iDutId), Form(
"hDutTIS_Found_%03d; Time in spill (s)", iDutId),
1746 TISnbins, 0, TISmax, 9, 0, 9);
1748 Form(
"hDutTIS_Missed_%03d; Time in spill (s)", iDutId), TISnbins, 0, TISmax, 9, 0, 9);
1749 fhDutTIR_Found =
new TH2F(Form(
"hDutTIR_Found_%03d", iDutId), Form(
"hDutTIR_Found_%03d; Time in spill (s)", iDutId),
1750 TIRnbins, 0, TIRmax, 9, 0, 9);
1752 Form(
"hDutTIR_Missed_%03d; Time in spill (s)", iDutId), TIRnbins, 0, TIRmax, 9, 0, 9);
1754 new TH1F(Form(
"hDutVel_Found_%03d", iDutId), Form(
"hDutVel_Found_%03d; velocity (cm/ns)", iDutId), 50, 0., 50.);
1756 new TH1F(Form(
"hDutVel_Missed_%03d", iDutId), Form(
"hDutVel_Missed_%03d; velocity (cm/ns)", iDutId), 50, 0., 50.);
1758 Form(
"hDutDTLH_CluSize_%03d; log(#DeltaT); CluSize", iDutId), 50, 0., 12., 10, 1., 11.);
1759 fhDutDTLH_Tot =
new TH2F(Form(
"hDutDTLH_Tot_%03d", iDutId), Form(
"hDutDTLH_Tot_%03d; log(#DeltaT); Tot", iDutId), 50,
1760 0., 12., 50, 0., 20.);
1761 fhDutDTLH_Mul =
new TH2F(Form(
"hDutDTLH_Mul_%03d", iDutId), Form(
"hDutDTLH_Mul_%03d; log(#DeltaT); Mul", iDutId), 50,
1762 0., 12., 30, 0., 30.);
1763 fhDutDTLH_TIS =
new TH2F(Form(
"hDutDTLH_TIS_%03d", iDutId), Form(
"hDutDTLH_TIS_%03d; log(#DeltaT); TIS (s)", iDutId),
1764 50, 0., 12., TISnbins, 0, TISmax);
1766 new TH2F(Form(
"hDutDTLH_Missed_TIS_%03d", iDutId), Form(
"hDutDTLH_Missed_TIS_%03d; log(#DeltaT); TIS (s)", iDutId),
1767 50, 0., 12., TISnbins, 0, TISmax);
1769 new TH2F(Form(
"hDutDTLH_DDH_Found_%03d", iDutId),
1770 Form(
"hDutDTLH_DDH_Found_%03d; log(#DeltaT); distance to LH (cm)", iDutId), 50, 0., 12., 40, 0., 4.);
1772 new TH2F(Form(
"hDutDTLH_DD_Found_%03d", iDutId),
1773 Form(
"hDutDTLH_DD_Found_%03d; log(#DeltaT); distance to LH (cm)", iDutId), 50, 0., 12., 40, 0., 4.);
1775 new TH2F(Form(
"hDutDTLH_DD_Missed_%03d", iDutId),
1776 Form(
"hDutDTLH_DD_Missed_%03d; log(#DeltaT); distance to LH (cm)", iDutId), 50, 0., 12., 40, 0., 4.);
1777 fhDutXYDX =
new TH3F(Form(
"hDutXYDX_%03d", iDutId), Form(
"hDutXYDT_%03d; x(cm); y (cm); #Deltax (cm)", iDutId),
1778 Nbins, -XSIZ, XSIZ, Nbins, -XSIZ, XSIZ, Nbins, -2., 2.);
1779 fhDutXYDY =
new TH3F(Form(
"hDutXYDY_%03d", iDutId), Form(
"hDutXYDT_%03d; x(cm); y (cm); #Deltay (cm)", iDutId),
1780 Nbins, -XSIZ, XSIZ, Nbins, -XSIZ, XSIZ, Nbins, -2., 2.);
1781 fhDutXYDT =
new TH3F(Form(
"hDutXYDT_%03d", iDutId), Form(
"hDutXYDT_%03d; x(cm); y (cm); #Deltat (ns)", iDutId),
1782 Nbins, -XSIZ, XSIZ, Nbins, -XSIZ, XSIZ, Nbins, -DTSIZ, DTSIZ);
1786 new TH2F(
"hSelTypeNNChiSq",
"ST NN #chi^{2}; sel type ST []; #chi^{2}_{3} []; ", 3, 0, 3, 1000, 0., 100.);
1788 fhSelTypeNNResidualT =
new TH2F(
"hSelTypeNNResidualT",
"ST NN ResiT vs. ST; sel type ST []; T_{DUT} - T_{ST} [ns]",
1789 3, 0, 3, 3001, -1.5, 1.5);
1791 fhSelTypeNNResidualX =
new TH2F(
"hSelTypeNNResidualX",
"ST NN ResiX vs. ST; sel type ST []; X_{DUT} - X_{ST} [cm]",
1792 3, 0, 3, 801, -4., 4.);
1794 fhSelTypeNNResidualY =
new TH2F(
"hSelTypeNNResidualY",
"ST NN ResiY vs. ST; sel type ST []; Y_{DUT} - Y_{ST} [cm]",
1795 3, 0, 3, 3001, -15., 15.);
1798 new TH2F(
"hSelTypeAccNNChiSq",
"ST acc NN #chi^{2}; sel type ST []; #chi^{2}_{3} []; ", 3, 0, 3, 1000, 0., 100.);
1801 new TH2F(
"hSelTypeAccNNResidualT",
"ST acc NN ResiT vs. ST; sel type ST []; T_{DUT} - T_{ST} [ns]", 3, 0, 3, 3001,
1805 "hSelTypeAccNNResidualX",
"ST acc NN ResiX vs. ST; sel type ST []; X_{DUT} - X_{ST} [cm]", 3, 0, 3, 801, -4., 4.);
1808 new TH2F(
"hSelTypeAccNNResidualY",
"ST acc NN ResiY vs. ST; sel type ST []; Y_{DUT} - Y_{ST} [cm]", 3, 0, 3, 3001,
1812 fhSelEfficiency =
new TEfficiency(
"hSelEfficiency",
"; acc ref MUL []; Sel efficiency []", 50, 0., 50.);
1815 new TEfficiency(
"hSelHitTupleEfficiencyTIS",
"; time in spill [s]; Sel efficiency []", TISnbins, 0., TISmax);
1818 new TEfficiency(
"hSelMatchEfficiency",
"; acc ref MUL []; Sel match efficiency []", 50, 0., 50.);
1821 "hSelHitTupleMatchEfficiencyTIS",
"; time in spill [s]; Sel match efficiency []", TISnbins, 0., TISmax);
1824 TISnbins, 0., TISmax, 301, -1.5, 1.5);
1827 TISnbins, 0., TISmax, 20, 0.5, 20.5);
1830 fhSelTrklEfficiency =
new TEfficiency(
"hSelTrklEfficiency",
"; acc ref MUL []; Sel efficiency []", 50, 0., 50.);
1833 new TEfficiency(
"hSelTrklEfficiencyTIS",
"; time in spill [s]; Sel efficiency []", TISnbins, 0., TISmax);
1836 new TEfficiency(
"hSelTrklMatchEfficiency",
"; acc ref MUL []; Sel match efficiency []", 50, 0., 50.);
1839 new TEfficiency(
"hSelTrklMatchEfficiencyTIS",
"; time in spill [s]; Sel match efficiency []", TISnbins, 0., TISmax);
1841 fhSelTrklResidualTTIS =
new TH2F(
"hSelTrklResidualTTIS",
"; time in spill [s]; T_{hit} - T_{sel} [ns]", TISnbins, 0.,
1842 TISmax, 301, -1.5, 1.5);
1845 new TH2F(
"hSelTrklDutCluSizeTIS",
"; time in spill [s]; cluster size [cells]", TISnbins, 0., TISmax, 20, 0.5, 20.5);
1852 fhNMergedMCEvents =
new TH1F(
"hNMergedMCEvents",
"Merged MC events; events []; ", 10, -0.5, 9.5);
1854 fhAccTrackMul =
new TH1F(
"hAccTrackMul",
"Acc track mul; MUL []; ", 150, -0.5, 149.5);
1855 fhAccRefTrackMul =
new TH1F(
"hAccRefTrackMul",
"Acc ref track mul; MUL []; ", 50, -0.5, 49.5);
1856 fhAccPrimTrackMul =
new TH1F(
"hAccPrimTrackMul",
"Acc prim track mul; MUL []; ", 60, -0.5, 59.5);
1858 new TH1F(
"hAccTrackPointMul",
"Acc track points; points []; ", iNCounters, -0.5, iNCounters - 0.5);
1860 new TH1F(
"hAccRefTrackPointMul",
"Acc ref track points; points []; ", iNCounters, -0.5, iNCounters - 0.5);
1862 new TH1F(
"hAccRndmTrackPointMul",
"Acc rndm track points; points []; ", iNCounters, -0.5, iNCounters - 0.5);
1866 new TH2F(
"hAccRefTrackAcceptance",
"Ref track acceptance; y_{lab} []; p_{t}/m [1/c]", 42, -1., 6., 30, 0., 2.5);
1869 new TEfficiency(
"hAccRefTrackAcceptanceEfficiency",
"Ref track acceptance efficiency; y_{lab} []; p_{t}/m [1/c]",
1870 42, -1., 6., 30, 0., 2.5);
1873 new TEfficiency(
"hAccRefTrackAcceptancePurity",
"Ref track acceptance purity; y_{lab} []; p_{t}/m [1/c]", 42, -1.,
1877 "hAccRefTrackMulCentrality",
"Acc ref track mul vs. centrality; b [fm]; MUL []", 20, 0., 20., 50, -0.5, 49.5);
1879 fhAccRefTracksProcSpec =
new TH2F(
"hAccRefTracksProcSpec",
"ref track proc/spec; ; ", 5, 0., 5., 5, 0., 5.);
1885 new TEfficiency(
"hSelMCTrackEfficiency",
"; acc ref MUL []; Sel efficiency []", 50, 0., 50.);
1888 new TEfficiency(
"hSelMCTrackMatchEfficiency",
"; acc ref MUL []; Sel match efficiency []", 50, 0., 50.);
1891 new TEfficiency(
"hSelMCTrackMatchPurity",
"; acc ref MUL []; Sel match purity []", 50, 0., 50.);
1894 new TH1F(
"hSelMCTrackDutHitMatchNNMul",
"Sel track-hit match mul; MUL []; ", 30, 0.5, 30.5);
1897 new TH1F(
"hSelMCTrackDutHitMatchAccNNMul",
"Sel track-hit match acc mul; MUL []; ", 30, 0.5, 30.5);
1900 fhSelPurity =
new TEfficiency(
"hSelPurity",
"; acc ref MUL []; Sel purity []", 50, 0., 50.);
1903 new TEfficiency(
"hSelRefTrackShare",
"; acc ref MUL []; Sel ref track share []", 50, 0.5, 50.5);
1905 fhSelRefTrackProcSpec =
new TH2F(
"hSelRefTrackProcSpec",
"ST 0 ref track proc/spec; ; ", 5, 0., 5., 5, 0., 5.);
1909 fhSelMatchPurity =
new TEfficiency(
"hSelMatchPurity",
"; acc ref MUL []; Sel match purity []", 50, 0., 50.);
1912 fhResX04HitExp =
new TH2F(
"hResX04HitExp",
"DUT hit-exp residual X; acc ref MUL []; X_{hit} - X_{exp} [cm]", 50, 0.,
1915 fhResX04ExpMC =
new TH2F(
"hResX04ExpMC",
"DUT exp-MC residual X; acc ref MUL []; X_{exp} - X_{MC} [cm]", 50, 0.,
1918 fhResX04HitMC =
new TH2F(
"hResX04HitMC",
"DUT hit-MC residual X; acc ref MUL []; X_{hit} - X_{MC} [cm]", 50, 0.,
1921 fhResY04HitExp =
new TH2F(
"hResY04HitExp",
"DUT hit-exp residual Y; acc ref MUL []; Y_{hit} - Y_{exp} [cm]", 50, 0.,
1922 50., 3001, -15., 15.);
1924 fhResY04ExpMC =
new TH2F(
"hResY04ExpMC",
"DUT exp-MC residual Y; acc ref MUL []; Y_{exp} - Y_{MC} [cm]", 50, 0.,
1925 50., 3001, -15., 15.);
1927 fhResY04HitMC =
new TH2F(
"hResY04HitMC",
"DUT hit-MC residual Y; acc ref MUL []; Y_{hit} - Y_{MC} [cm]", 50, 0.,
1928 50., 3001, -15., 15.);
1930 fhResT04HitExp =
new TH2F(
"hResT04HitExp",
"DUT hit-exp residual T; acc ref MUL []; T_{hit} - T_{exp} [ns]", 50, 0.,
1931 50., 3001, -1.5, 1.5);
1933 fhResT04ExpMC =
new TH2F(
"hResT04ExpMC",
"DUT exp-MC residual T; acc ref MUL []; T_{exp} - T_{MC} [ns]", 50, 0.,
1934 50., 3001, -1.5, 1.5);
1936 fhResT04HitMC =
new TH2F(
"hResT04HitMC",
"DUT hit-MC residual T; acc ref MUL []; T_{hit} - T_{MC} [ns]", 50, 0.,
1937 50., 3001, -1.5, 1.5);
1939 fhNTracksPerMRefHit =
new TH1F(
"hNTracksPerMRefHit",
"MRef tracks/hit; #tracks/hit []; ", 20, -0.5, 19.5);
1941 fhNTracksPerSel2Hit =
new TH1F(
"hNTracksPerSel2Hit",
"Sel2 tracks/hit; #tracks/hit []; ", 20, -0.5, 19.5);
1943 fhNTracksPerDutHit =
new TH1F(
"hNTracksPerDutHit",
"DUT tracks/hit; #tracks/hit []; ", 20, -0.5, 19.5);
1945 fhNTracksPerSelMRefHit =
new TH1F(
"hNTracksPerSelMRefHit",
"MRef sel tracks/hit; #tracks/hit []; ", 20, -0.5, 19.5);
1947 fhNTracksPerSelSel2Hit =
new TH1F(
"hNTracksPerSelSel2Hit",
"Sel2 sel tracks/hit; #tracks/hit []; ", 20, -0.5, 19.5);
1949 fhNTracksPerSelDutHit =
new TH1F(
"hNTracksPerSelDutHit",
"DUT sel tracks/hit; #tracks/hit []; ", 20, -0.5, 19.5);
1952 fhSelTrklPurity =
new TEfficiency(
"hSelTrklPurity",
"; acc ref MUL []; Sel purity []", 50, 0., 50.);
1955 new TEfficiency(
"hSelTrklRefTrackShare",
"; acc ref MUL []; Sel ref track share []", 50, 0.5, 50.5);
1958 new TH2F(
"hSelTrklRefTrackProcSpec",
"ST 1 ref track proc/spec; ; ", 5, 0., 5., 5, 0., 5.);
1963 fhSelTrklMatchPurity =
new TEfficiency(
"hSelTrklMatchPurity",
"; acc ref MUL []; Sel match purity []", 50, 0., 50.);
1966 new TH2F(
"hDutResX_Hit_Trk",
"DUT hit-trklt residual X; acc ref MUL []; X_{hit} - X_{trklt} [cm]", 50, 0., 50.,
1969 fhDutResX_Trk_MC =
new TH2F(
"hDutResX_Trk_MC",
"DUT trklt-MC residual X; acc ref MUL []; X_{trklt} - X_{MC} [cm]",
1970 50, 0., 50., 801, -4., 4.);
1972 fhDutResX_Hit_MC =
new TH2F(
"hDutResX_Hit_MC",
"DUT hit-MC residual X; acc ref MUL []; X_{hit} - X_{MC} [cm]", 50,
1973 0., 50., 801, -4., 4.);
1976 new TH2F(
"hDutResY_Hit_Trk",
"DUT hit-trklt residual Y; acc ref MUL []; Y_{hit} - Y_{trklt} [cm]", 50, 0., 50.,
1979 fhDutResY_Trk_MC =
new TH2F(
"hDutResY_Trk_MC",
"DUT trklt-MC residual Y; acc ref MUL []; Y_{trklt} - Y_{MC} [cm]",
1980 50, 0., 50., 3001, -15., 15.);
1982 fhDutResY_Hit_MC =
new TH2F(
"hDutResY_Hit_MC",
"DUT hit-MC residual Y; acc ref MUL []; Y_{hit} - Y_{MC} [cm]", 50,
1983 0., 50., 3001, -15., 15.);
1986 new TH2F(
"hDutResT_Hit_Trk",
"DUT hit-trklt residual T; acc ref MUL []; T_{hit} - T_{trklt} [ns]", 50, 0., 50.,
1989 fhDutResT_Trk_MC =
new TH2F(
"hDutResT_Trk_MC",
"DUT trklt-MC residual T; acc ref MUL []; T_{trklt} - T_{MC} [ns]",
1990 50, 0., 50., 3001, -1.5, 1.5);
1992 fhDutResT_Hit_MC =
new TH2F(
"hDutResT_Hit_MC",
"DUT hit-MC residual T; acc ref MUL []; T_{hit} - T_{MC} [ns]", 50,
1993 0., 50., 3001, -1.5, 1.5);
1997 new TEfficiency(
"hSelMCTrackEfficiencyTIS",
"; time in spill [s]; Sel efficiency []", TISnbins, 0., TISmax);
2000 "hSelMCTrackMatchEfficiencyTIS",
"; time in spill [s]; Sel match efficiency []", TISnbins, 0., TISmax);
2003 TISnbins, 0., TISmax, 301, -1.5, 1.5);
2006 TISnbins, 0., TISmax, 20, 0.5, 20.5);
2009 fhPVResTAll =
new TH2F(
"hPVResTAll",
"PV all reco-MC residual T; acc ref MUL []; T_{reco} - T_{MC} [ns]", 50, 0.,
2010 50., 3001, -1.5, 1.5);
2012 fhPVResXAll =
new TH2F(
"hPVResXAll",
"PV all reco-MC residual X; acc ref MUL []; X_{reco} - X_{MC} [cm]", 50, 0.,
2015 fhPVResYAll =
new TH2F(
"hPVResYAll",
"PV all reco-MC residual Y; acc ref MUL []; Y_{reco} - Y_{MC} [cm]", 50, 0.,
2016 50., 2001, -10., 10.);
2018 fhPVResTRef =
new TH2F(
"hPVResTRef",
"PV ref reco-MC residual T; acc ref MUL []; T_{reco} - T_{MC} [ns]", 50, 0.,
2019 50., 3001, -1.5, 1.5);
2021 fhPVResXRef =
new TH2F(
"hPVResXRef",
"PV ref reco-MC residual X; acc ref MUL []; X_{reco} - X_{MC} [cm]", 50, 0.,
2024 fhPVResYRef =
new TH2F(
"hPVResYRef",
"PV ref reco-MC residual Y; acc ref MUL []; Y_{reco} - Y_{MC} [cm]", 50, 0.,
2025 50., 2001, -10., 10.);
2029 "ref track-tracklet residual T; acc ref MUL "
2030 "[]; T0_{trklt} - T_{trk} [ns]",
2031 50, 0., 50., 3001, -1.5, 1.5);
2034 "ref track-tracklet residual X; acc ref MUL "
2035 "[]; X0_{trklt} - X_{trk} [cm]",
2036 50, 0., 50., 801, -4., 4.);
2039 "ref track-tracklet residual Y; acc ref MUL "
2040 "[]; Y0_{trklt} - Y_{trk} [cm]",
2041 50, 0., 50., 2001, -10., 10.);
2044 "ref track-tracklet residual Tx; acc ref MUL "
2045 "[]; Tx0_{trklt} - Tx_{trk} []",
2046 50, 0., 50., 201, -1., 1.);
2049 "ref track-tracklet residual Ty; acc ref MUL "
2050 "[]; Ty0_{trklt} - Ty_{trk} []",
2051 50, 0., 50., 201, -1., 1.);
2054 "ref track-tracklet residual V; acc ref MUL "
2055 "[]; V0_{trklt} - V_{trk} [cm/ns]",
2056 50, 0., 50., 101, -5., 5.);
2059 new TH2F(
"hAccRefTrackResN",
"ref track-tracklet residual N; acc ref MUL []; N0_{trklt} - N_{trk} []", 50, 0.,
2060 50., 11, -5.5, 5.5);
2063 fhAccRefTrackShare =
new TEfficiency(
"hAccRefTrackShare",
"; acc ref MUL []; acc ref share []", 50, 0., 50.);
2066 new TEfficiency(
"hRecRefTrackEfficiency",
"; acc ref MUL []; acc ref reco eff []", 50, 0., 50.);
2069 new TEfficiency(
"hRecRndmTrackEfficiency",
"; acc ref MUL []; acc rndm reco eff []", 50, 0., 50.);
2072 new TEfficiency(
"hRecRefTrackGhostShare",
"; acc ref MUL []; acc ref ghost share []", 50, 0., 50.);
2075 new TEfficiency(
"hRecRefTrackCloneShare",
"; acc ref MUL []; acc ref clone share []", 50, 0., 50.);
2078 new TEfficiency(
"hRecRndmTrackGhostShare",
"; acc ref MUL []; acc rndm ghost share []", 50, 0., 50.);
2081 new TEfficiency(
"hRecRndmTrackCloneShare",
"; acc ref MUL []; acc rndm clone share []", 50, 0., 50.);
2083 TH1* tCurrentHistogram(NULL);
2086 auto const& CounterID = CounterModuleNode.first;
2088 Int_t iModuleType = std::get<0>(CounterID);
2089 Int_t iModuleIndex = std::get<1>(CounterID);
2090 Int_t iCounterIndex = std::get<2>(CounterID);
2095 new TH2F(Form(
"hDomTracksProcSpec_%d_%d_%d", iModuleType, iModuleIndex, iCounterIndex),
2096 Form(
"%d-%d-%d dom proc/spec; ; ", iModuleType, iModuleIndex, iCounterIndex), 5, 0., 5., 5, 0., 5.);
2097 tCurrentHistogram->SetCanExtend(TH1::kAllAxes);
2098 tCurrentHistogram->SetStats(0);
2100 fhDomTracksProcSpec.insert(std::make_pair(CounterID,
dynamic_cast<TH2*
>(tCurrentHistogram)));
2104 new TH2F(Form(
"hDomTracksProcMat_%d_%d_%d", iModuleType, iModuleIndex, iCounterIndex),
2105 Form(
"%d-%d-%d dom proc/mat; ; ", iModuleType, iModuleIndex, iCounterIndex), 5, 0., 5., 5, 0., 5.);
2106 tCurrentHistogram->SetCanExtend(TH1::kAllAxes);
2107 tCurrentHistogram->SetStats(0);
2109 fhDomTracksProcMat.insert(std::make_pair(CounterID,
dynamic_cast<TH2*
>(tCurrentHistogram)));
2113 new TH2F(Form(
"hRndmTracksProcSpec_%d_%d_%d", iModuleType, iModuleIndex, iCounterIndex),
2114 Form(
"%d-%d-%d rndm proc/spec; ; ", iModuleType, iModuleIndex, iCounterIndex), 5, 0., 5., 5, 0., 5.);
2115 tCurrentHistogram->SetCanExtend(TH1::kAllAxes);
2116 tCurrentHistogram->SetStats(0);
2122 new TH2F(Form(
"hRndmTracksProcMat_%d_%d_%d", iModuleType, iModuleIndex, iCounterIndex),
2123 Form(
"%d-%d-%d rndm proc/mat; ; ", iModuleType, iModuleIndex, iCounterIndex), 5, 0., 5., 5, 0., 5.);
2124 tCurrentHistogram->SetCanExtend(TH1::kAllAxes);
2125 tCurrentHistogram->SetStats(0);
2127 fhRndmTracksProcMat.insert(std::make_pair(CounterID,
dynamic_cast<TH2*
>(tCurrentHistogram)));
2131 new TH1F(Form(
"hCounterAccTrackMul_%d_%d_%d", iModuleType, iModuleIndex, iCounterIndex),
2132 Form(
"%d-%d-%d acc mul; MUL []; ", iModuleType, iModuleIndex, iCounterIndex), 100, -0.5, 99.5);
2138 new TH1F(Form(
"hCounterAccRefTrackMul_%d_%d_%d", iModuleType, iModuleIndex, iCounterIndex),
2139 Form(
"%d-%d-%d acc ref mul; MUL []; ", iModuleType, iModuleIndex, iCounterIndex), 50, -0.5, 49.5);
2145 new TH1F(Form(
"hCounterAccRndmTrackMul_%d_%d_%d", iModuleType, iModuleIndex, iCounterIndex),
2146 Form(
"%d-%d-%d acc rndm mul; MUL []; ", iModuleType, iModuleIndex, iCounterIndex), 50, -0.5, 49.5);
2152 new TH1F(Form(
"hCounterAccDomTrackMul_%d_%d_%d", iModuleType, iModuleIndex, iCounterIndex),
2153 Form(
"%d-%d-%d acc dom mul; MUL []; ", iModuleType, iModuleIndex, iCounterIndex), 50, -0.5, 49.5);
2158 tCurrentHistogram =
new TH1F(
2159 Form(
"hCounterRecRefTrackEfficiencyPassed_%d_%d_%d", iModuleType, iModuleIndex, iCounterIndex),
2160 Form(
"%d-%d-%d acc ref reco eff; acc ref MUL []; reco efficiency []", iModuleType, iModuleIndex, iCounterIndex),
2166 tCurrentHistogram =
new TH1F(
2167 Form(
"hCounterRecRefTrackEfficiencyTotal_%d_%d_%d", iModuleType, iModuleIndex, iCounterIndex),
2168 Form(
"%d-%d-%d acc ref reco eff; acc ref MUL []; reco efficiency []", iModuleType, iModuleIndex, iCounterIndex),
2174 tCurrentHistogram =
new TH1F(
2175 Form(
"hCounterRecRefTrackPurityPassed_%d_%d_%d", iModuleType, iModuleIndex, iCounterIndex),
2176 Form(
"%d-%d-%d acc ref reco pure; acc ref MUL []; reco purity []", iModuleType, iModuleIndex, iCounterIndex),
2182 tCurrentHistogram =
new TH2F(
2183 Form(
"hCounterRefTrackMulHitMul_%d_%d_%d", iModuleType, iModuleIndex, iCounterIndex),
2184 Form(
"%d-%d-%d acc ref mul/hit mul; acc ref MUL []; hit MUL []", iModuleType, iModuleIndex, iCounterIndex), 50,
2185 -0.5, 49.5, 30, -0.5, 29.5);
2191 new TH2F(Form(
"hCounterRefTrackLocalXY_%d_%d_%d", iModuleType, iModuleIndex, iCounterIndex),
2192 Form(
"%d-%d-%d acc ref track position; X [cm]; Y [cm]", iModuleType, iModuleIndex, iCounterIndex),
2193 2 * iNbinXY + 1, -17., 17., 2 * iNbinXY + 1, -17., 17.);
2198 tCurrentHistogram =
new TH2F(
2199 Form(
"hCounterRefTrackMulCell_%d_%d_%d", iModuleType, iModuleIndex, iCounterIndex),
2200 Form(
"%d-%d-%d cell acc ref mul; strip []; ref track MUL []", iModuleType, iModuleIndex, iCounterIndex),
2201 iNCounterCells, 0, iNCounterCells, 10, -0.5, 9.5);
2208 "hGoodSelTypeNNPureChiSq",
"gST pure NN #chi^{2}; sel type ST []; #chi^{2}_{3} []; ", 3, 0, 3, 1000, 0., 100.);
2211 "hGoodSelTypeNNAllChiSq",
"gST all NN #chi^{2}; sel type ST []; #chi^{2}_{3} []; ", 3, 0, 3, 1000, 0., 100.);
2216 auto const& CounterID = CounterModuleNode.first;
2218 Int_t iModuleType = std::get<0>(CounterID);
2219 Int_t iModuleIndex = std::get<1>(CounterID);
2220 Int_t iCounterIndex = std::get<2>(CounterID);
2223 TH1* tCurrentHistogram =
2224 new TH2F(Form(
"hCounterHitMulCell_%d_%d_%d", iModuleType, iModuleIndex, iCounterIndex),
2225 Form(
"%d-%d-%d cell hit mul; strip []; hit MUL []", iModuleType, iModuleIndex, iCounterIndex),
2226 iNCounterCells, 0, iNCounterCells, 10, -0.5, 9.5);
2228 fhCounterHitMulCell.insert(std::make_pair(CounterID,
dynamic_cast<TH2*
>(tCurrentHistogram)));
2232 fhSelTrklFitRedChiSq =
new TH1F(
"hSelTrklFitRedChiSq",
"Sel trkl 3D fit #chi^{2}/4; #chi^{2}/4 []; ", 1000, 0., 10.);
2235 new TH1F(
"hSelTrklDutHitMatchAccNNMul",
"Sel trkl-hit match acc mul; MUL []; ", 30, 0.5, 30.5);
2238 new TH1F(
"hSelHitTupleDutHitMatchMul",
"Sel hit-hit match mul; MUL []; ", 30, 0.5, 30.5);
2240 new TH1F(
"hSelHitTupleDutHitMatchAccMul",
"Sel hit-hit match acc mul; MUL []; ", 30, 0.5, 30.5);
2243 Double_t TRange = 600.;
2244 Double_t NStations = 10.;
2247 fhTrklNofHitsRate =
new TH2F(Form(
"hTrklNofHitsRate"), Form(
"hTrklNofHitsRate; Time (s); NofHits "), (
Int_t) TRange,
2248 0., TRange, 10, 1., 11.);
2249 fhTrklDetHitRate =
new TH2F(Form(
"hTrklDetHitRate"), Form(
"hTrklDetHitRate; Time (s); DetIndx "), (
Int_t) TRange, 0.,
2250 TRange, NStations, 0., NStations);
2253 Double_t TRangeSpill = 10.;
2255 new TH2F(Form(
"hTrklNofHitsRateInSpill"), Form(
"hTrklNofHitsRateInSpill; Time (s); NofHits "),
2256 (
Int_t) TRangeSpill * 10, 0., TRangeSpill, 10, 1., 11.);
2258 new TH2F(Form(
"hTrklDetHitRateInSpill"), Form(
"hTrklDetHitRateInSpill; Time (s); DetIndx "),
2259 (
Int_t) TRangeSpill * 10, 0., TRangeSpill, NStations, 0., NStations);
2265 for (
Int_t iDet = 0; iDet < iNbDet; iDet++) {
2266 fhLHTime[iDet] =
new TH2D(Form(
"hLHTime_Det%d", iDet), Form(
"hLHTime_Det%d ; x (cm); y (cm) ", iDet), iNbins,
2267 -16., 16., iNbins, -16., 16.);
2268 fvLHit[iDet].resize(iNbins * iNbins);
2269 for (
size_t iBin = 0; iBin <
fvLHit[iDet].size(); iBin++)
2270 fvLHit[iDet][iBin] = NULL;
2274 gDirectory->cd(oldir->GetPath());
2282 std::set<Int_t> DutHitSet;
2288 if (
fiDutAddr == iDetId) { DutHitSet.emplace(iHitInd); }
2296 TGeoNode* tNode(NULL);
2297 TGeoMedium* tMedium(NULL);
2298 TGeoMaterial* tMaterial(NULL);
2300 const char* cMaterialName;
2309 Int_t iNAccPrimTracks(0);
2311 for (
Int_t iTrack = 0; iTrack <
fAccTracks->GetEntriesFast(); iTrack++) {
2316 tMedium = tNode->GetMedium();
2317 tMaterial = tMedium->GetMaterial();
2321 if (0 == std::strcmp(
"target", cMaterialName)) {
2351 Int_t iBRefHitInd(-1);
2352 Int_t iMRefHitInd(-1);
2353 Int_t iSel2HitInd(-1);
2355 Bool_t bGoodTrackSel(kFALSE);
2362 for (UInt_t uChannel = 0; uChannel < 16; uChannel++) {
2363 if (uTriggerPattern & (0x1 << uChannel)) {
fhTriggerPattern->Fill(uChannel); }
2371 Int_t iNbTofHits, iNbTofTracks;
2399 Int_t iNbMatchedHits = 0;
2400 Int_t iNbMaxMatch = 500;
2403 Double_t Chi2List[iNbMaxMatch];
2407 pChi2Hit1[0] = NULL;
2408 pChi2Hit2[0] = NULL;
2413 BSel[iSel] = kFALSE;
2415 Double_t dDTD4 = 0.;
2418 Double_t dMul0 = 0.;
2419 Double_t dMul4 = 0.;
2420 Double_t dMulS2 = 0.;
2421 Double_t dStrMul0 = 0.;
2422 Double_t dStrMul4 = 0.;
2423 Double_t dMulD = 0.;
2424 Double_t dM4Max = 1;
2426 Double_t dM0Max = 100;
2428 Double_t dMDMax = 1;
2430 Double_t hitpos1[3], hitpos2[3], hitpos3[3], hitpos4[3];
2431 Double_t hitpos1_local[3], hitpos2_local[3], hitpos3_local[3], hitpos4_local[3];
2432 std::vector<CbmTofHit*> vDiaHit;
2433 Double_t DDiaAvLim = 0.2;
2434 Double_t dMulDAv = 0;
2443 Int_t iBeamRefMul = iNbTofHits / 4;
2444 if (iBeamRefMul > 0) {
2448 dMulD = (Double_t) iBeamRefMul;
2450 iBRefHitInd = iNbTofHits - 1;
2457 Double_t vdTimes[iBeamRefMul];
2459 vdTimes[iLast] = 1.E300;
2460 for (
Int_t iHitInd = 0; iHitInd < iNbTofHits; iHitInd++) {
2462 if (NULL == pHit)
continue;
2465 if (pHit->
GetTime() < vdTimes[iLast]) {
2466 if (iLast < iBeamRefMul) { iLast++; }
2468 for (iT = 0; iT < iLast; iT++)
2469 if (pHit->
GetTime() < vdTimes[iT])
break;
2470 for (
Int_t iL = iLast; iL > iT; iL--)
2471 vdTimes[iL] = vdTimes[iL - 1];
2472 vdTimes[iT] = pHit->
GetTime();
2481 for (
Int_t iHit = 0; iHit < iLast; iHit++) {
2482 dTDia += vdTimes[iHit];
2484 dTDia /= (Double_t) iLast;
2485 dMulD = (Double_t) iLast;
2486 Double_t hitPos[3] = {3 * 0.};
2487 Double_t hitPosErr[3] = {3 * 1.};
2494 new ((*fTofHitsColl)[iNbTofHits])
CbmTofHit(*pDia);
2499 iBRefHitInd = iNbTofHits;
2506 for (
Int_t iHitInd = 0; iHitInd < iNbTofHits; iHitInd++) {
2508 if (NULL == pHit)
continue;
2513 std::map<UInt_t, UInt_t>::iterator it =
fDetIdMap.find(iDetId);
2533 vDiaHit.resize(dMulD);
2534 vDiaHit[dMulD - 1] = pHit;
2538 iBRefHitInd = iHitInd;
2543 for (
Int_t iDiaHit = 0; iDiaHit < dMulD; iDiaHit++) {
2544 if (vDiaHit[iDiaHit] != pDia) {
2545 if (TMath::Abs(vDiaHit[iDiaHit]->GetTime() -
dTDia) < DDiaAvLim) {
2546 dTDia = (
dTDia * dMulDAv + vDiaHit[iDiaHit]->GetTime()) / (dMulDAv + 1);
2554 LOG(debug) << Form(
"Diamond mul %3.0f, mulAv %3.0f, time: %6.2e", dMulD, dMulDAv,
dTDia)
2559 if (iNbTofHits > 5) {
2563 LOG(info) <<
"StartAnalysisTime from TAv set to " <<
StartAnalysisTime <<
" ns. ";
2567 vector<CbmTofHit*> vDutHit;
2568 vector<CbmTofHit*> vRefHit;
2571 for (
Int_t iHitInd = 0; iHitInd < iNbTofHits; iHitInd++) {
2573 if (NULL == pHit)
continue;
2579 LOG(debug) << Form(
"process %d.(%d) Tof hit 0x%08x, Ind %d, x = %6.1f, y = "
2580 "%6.1f, z=%6.1f, t=%10.1f",
2581 iHitInd, iNbTofHits, iChId, iDetInd, pHit->
GetX(), pHit->
GetY(), pHit->
GetZ(), pHit->
GetTime());
2584 LOG(debug) <<
"NULL Channel Pointer for ChId " << Form(
" 0x%08x ", iChId);
2590 Double_t dPhi = TMath::ATan2(pHit->
GetY(), pHit->
GetX()) * 180.0 / TMath::Pi();
2592 TMath::ATan(TMath::Sqrt(pHit->
GetX() * pHit->
GetX() + pHit->
GetY() * pHit->
GetY()) / pHit->
GetZ());
2593 Double_t dEta = -TMath::Log(TMath::Tan(dTheta * 0.5));
2599 LOG(debug2) <<
"process iDetId " << Form(
" 0x%08x ", iDetId)
2600 << Form(
", Muls %4.0f, %4.0f, %4.0f", dMulD, dMul0, dMul4);
2605 vDutHit.push_back(pHit);
2611 Double_t xPos1 = pHit->
GetX();
2612 Double_t yPos1 = pHit->
GetY();
2613 Double_t zPos1 = pHit->
GetZ();
2614 Double_t tof1 = pHit->
GetTime();
2615 Double_t dzscal = 1.;
2617 for (
Int_t iHitInd2 = 0; iHitInd2 < iNbTofHits; iHitInd2++) {
2618 if (iHitInd2 != iHitInd) {
2620 if (NULL == pHit2)
continue;
2636 Double_t xPos2 = dzscal * pHit2->
GetX();
2637 Double_t yPos2 = dzscal * pHit2->
GetY();
2638 Double_t tof2 = pHit2->
GetTime();
2639 Double_t dTcor = 0.;
2643 Double_t Chi2Match = TMath::Power((xPos1 - xPos2 -
fdDXMean) /
GetSigX(0), 2.)
2646 if (Chi2Match > 1.E8)
continue;
2649 LOG(debug2) <<
" Chi2 "
2651 << Form(
" -> %f ", Chi2Match);
2652 LOG(debug2) <<
" Chi2 " << Form(
" %f %f %f %f %f %f ", xPos1, xPos2, yPos1, yPos2, tof1, tof2)
2653 << Form(
" -> %f ", Chi2Match);
2656 if (iNbMatchedHits == iNbMaxMatch) iNbMatchedHits = iNbMaxMatch - 1;
2657 LOG(debug) << Form(
"match %d (%f): %2d. - %2d. Tof hit 0x%08x "
2658 "with 0x%08x, DeltaT = %f ns",
2659 iNbMatchedHits, Chi2Match, iHitInd, iHitInd2, iChId2, iChId,
2662 fhDXDY04->Fill(xPos1 - xPos2, yPos1 - yPos2);
2667 for (
Int_t iM = 0; iM < iNbMatchedHits; iM++) {
2668 if (Chi2Match < Chi2List[iM]) {
2670 LOG(debug) << Form(
" fill Chi2 %3d (%3d), %12.1f, %12.1f: "
2671 "HitInd %3d, %3d, Ids 0x%08x, 0x%08x",
2672 iM, iNbMatchedHits, Chi2Match, Chi2List[iM], iHitInd, iHitInd2, iChId, iChId2);
2674 for (
Int_t iMM = iNbMatchedHits; iMM >= iM; iMM--) {
2675 Chi2List[iMM] = Chi2List[iMM - 1];
2676 pChi2Hit1[iMM] = pChi2Hit1[iMM - 1];
2677 pChi2Hit2[iMM] = pChi2Hit2[iMM - 1];
2680 Chi2List[iM] = Chi2Match;
2681 pChi2Hit1[iM] = pHit;
2682 pChi2Hit2[iM] = pHit2;
2683 Chi2List[iNbMatchedHits] = 1.E8;
2685 if (Chi2Match == Chi2List[iM - 1]) {
2686 LOG(debug) << Form(
"same Chi2?: M %d, Mul0 %3.0f, HitInd "
2687 "%d, %d, Ids 0x%p, 0x%p - 0x%p, 0x%p",
2688 iM, dMul0, iHitInd, iHitInd2, pHit, pHit2, pChi2Hit1[iM - 1], pChi2Hit2[iM - 1]);
2690 LOG(debug) << pChi2Hit1[iM - 1]->
ToString();
2711 vRefHit.push_back(pHit);
2719 LOG(debug2) <<
"Process BeamRef Hit with " << pHit <<
", " << pDia;
2720 if (pHit != pDia)
continue;
2722 Double_t dDDia = 0.;
2723 for (
Int_t iHitInd1 = 0; iHitInd1 < iNbTofHits; iHitInd1++)
2724 if (iHitInd1 != iHitInd) {
2726 if (pHit1 == NULL)
continue;
2736 LOG(debug) << Form(
"DDia %f", dDDia);
2737 if (dDDia == 0.)
continue;
2740 Double_t zPos1 = pHit->
GetZ();
2741 for (
Int_t iHitInd2 = 0; iHitInd2 < iNbTofHits; iHitInd2++)
2742 if (iHitInd2 != iHitInd) {
2744 if (pHit2 == NULL)
continue;
2749 if (NULL == fChannelInfo2) {
2750 LOG(debug) <<
"Invalid Channel Pointer for ChId2 " << Form(
" 0x%08x ", iChId2);
2753 LOG(debug2) << Form(
"TDia %f, THit %f",
dTDia, pHit2->
GetTime());
2760 LOG(debug) << Form(
"dDTD4 %8.4e, min: %8.4e", dDTD4,
dDTD4Min);
2764 LOG(debug1) << Form(
"Valid Mrpc hit 0x%08x", iChId2);
2766 gGeoManager->FindNode(fChannelInfo2->
GetX(), fChannelInfo2->
GetY(), fChannelInfo2->
GetZ());
2767 Double_t hitpos[3], hitpos_local[3];
2768 hitpos[0] = pHit2->
GetX();
2769 hitpos[1] = pHit2->
GetY();
2770 hitpos[2] = pHit2->
GetZ();
2771 gGeoManager->GetCurrentNode();
2772 gGeoManager->MasterToLocal(hitpos, hitpos_local);
2774 && TMath::Abs(dDTD4) < TMath::Abs(
dDTD4Min)) {
2778 iMRefHitInd = iHitInd2;
2785 Double_t dzscal = 1.;
2786 Double_t xPos2 = pHit2->
GetX();
2787 Double_t yPos2 = pHit2->
GetY();
2788 Double_t zPos2 = pHit2->
GetZ();
2789 Double_t tof2 = pHit2->
GetTime();
2790 Double_t dTcor = 0.;
2791 Double_t xPos3B = 0.;
2792 Double_t yPos3B = 0.;
2793 Double_t tof3B = 0.;
2800 for (
Int_t iHitInd3 = 0; iHitInd3 < iNbTofHits; iHitInd3++) {
2801 LOG(debug2) << Form(
"inspect %d. Sel2, Ind %d, Ind2 %d ", iHitInd3, iHitInd, iHitInd2);
2804 if (iHitInd3 != iHitInd2) {
2806 if (pHit3 == NULL)
continue;
2810 if (NULL == fChannelInfo3) {
2811 LOG(debug) <<
"Invalid Channel Pointer for ChId3 " << Form(
" 0x%08x ", iChId3);
2814 LOG(debug2) << Form(
"inspect %d. Sel2 0x%08x", iHitInd3, iDetId3);
2817 LOG(debug1) << Form(
"found Sel2 0x%08x, z-info: %7.1f, %7.1f",
fiMrpcSel2Addr, dzscal, zPos1);
2820 gGeoManager->FindNode(fChannelInfo3->
GetX(), fChannelInfo3->
GetY(), fChannelInfo3->
GetZ());
2821 hitpos3[0] = pHit3->
GetX();
2822 hitpos3[1] = pHit3->
GetY();
2823 hitpos3[2] = pHit3->
GetZ();
2824 gGeoManager->GetCurrentNode();
2825 gGeoManager->MasterToLocal(hitpos3, hitpos3_local);
2828 Double_t xPos3 = dzscal * pHit3->
GetX();
2829 Double_t yPos3 = dzscal * pHit3->
GetY();
2830 Double_t tof3 = pHit3->
GetTime();
2832 Double_t Chi2Match = TMath::Power((xPos3 - xPos2) /
GetSHTSigX(), 2.)
2833 + TMath::Power((yPos3 - yPos2) /
GetSHTSigY(), 2.)
2837 LOG(debug1) << Form(
"valid Sel2 0x%08x with Chi2 %7.1f, "
2838 "%7.1f, %7.1f, %7.1f, %7.1f, %7.1f",
2841 if (Chi2Match < Chi2Max) {
2845 Chi2Max = Chi2Match;
2848 iSel2HitInd = iHitInd3;
2850 LOG(debug) << Form(
"better Sel2 0x%08x with Chi2 %7.1f, x %7.1f, "
2851 "Deltax %7.1f, y %7.1f, Deltay %7.1f",
2886 if (
fDetIdMap.size() > 3 && dMulD > 0) {
2887 Double_t dDTLEvt = dTAv -
dTLEvt;
2892 LOG(info) <<
"StartSpillTime for " <<
iNspills
2893 << Form(
". spill set to %f ns after %7.4f s, at event %d with "
2894 "MulD %2.0f, MulDet %d, DTLE %7.4f s ",
2901 LOG(debug) <<
"SpillStartTime not available, abort Anatestbeam ";
2905 if (dMul0 > dM0Max || dMul4 > dM4Max || dMulD > dMDMax || dMulS2 > dM4Max) {
2907 LOG(debug) << Form(
"<D> Muls %4.0f, %4.0f, %4.0f, %4.0f, Matches %d", dMulD, dMul0, dMul4, dMulS2, iNbMatchedHits);
2912 Double_t dDutTMean = 0.;
2913 Double_t dDutTMean2 = 0.;
2914 Int_t iNDutHits = vDutHit.size();
2915 for (
Int_t i = 0; i < iNDutHits; i++) {
2916 dDutTMean += vDutHit[i]->GetTime();
2917 dDutTMean2 += vDutHit[i]->GetTime() * vDutHit[i]->GetTime();
2919 dDutTMean /= (Double_t) vDutHit.size();
2920 dDutTMean2 /= (Double_t) vDutHit.size();
2921 Double_t dDutTSig = TMath::Sqrt(dDutTMean2 - dDutTMean * dDutTMean);
2923 Double_t dRefTMean = 0.;
2924 Double_t dRefTMean2 = 0.;
2925 Int_t iNRefHits = vRefHit.size();
2926 for (
Int_t i = 0; i < iNRefHits; i++) {
2927 dRefTMean += vRefHit[i]->GetTime();
2928 dRefTMean2 += vRefHit[i]->GetTime() * vRefHit[i]->GetTime();
2930 dRefTMean /= (Double_t) vRefHit.size();
2931 dRefTMean2 /= (Double_t) vRefHit.size();
2932 Double_t dRefTSig = TMath::Sqrt(dRefTMean2 - dRefTMean * dRefTMean);
2935 for (
Int_t i = 0; i < iNDutHits - 1; i++) {
2936 for (
Int_t j = i + 1; j < iNDutHits; j++) {
2937 fhDutDXDYDT->Fill(vDutHit[j]->GetX() - vDutHit[i]->GetX(), vDutHit[j]->GetY() - vDutHit[i]->GetY(),
2938 vDutHit[j]->GetTime() - vDutHit[i]->GetTime());
2941 for (
Int_t i = 0; i < iNRefHits - 1; i++) {
2942 for (
Int_t j = i + 1; j < iNRefHits; j++) {
2943 fhRefDXDYDT->Fill(vRefHit[j]->GetX() - vRefHit[i]->GetX(), vRefHit[j]->GetY() - vRefHit[i]->GetY(),
2944 vRefHit[j]->GetTime() - vRefHit[i]->GetTime());
2956 LOG(debug) << Form(
" FoundMatches: %d with first chi2s = %12.1f, %12.1f, %12.1f, %12.1f", iNbMatchedHits, Chi2List[0],
2957 Chi2List[1], Chi2List[2], Chi2List[3])
2958 << Form(
", Muls %4.0f, %4.0f, %4.0f", dMulD, dMul0, dMul4);
2973 LOG(debug) << Form(
" Found valid selector ");
2985 Double_t dTimeSinceLastDutHit = 0.;
2996 gGeoManager->GetCurrentNode();
2997 gGeoManager->MasterToLocal(hitpos1, hitpos1_local);
2999 fhXY0D4sel->Fill(hitpos1_local[0], hitpos1_local[1]);
3003 if (iDutCh < 0 || iDutCh >
fiDutNch - 1) {
3004 LOG(debug) <<
"Predicted ch " << iDutCh <<
" from x = " << hitpos1_local[0]
3006 if (iDutCh < 0) iDutCh = 0;
3011 for (
Int_t iDutChtest = iDutCh; iDutChtest < iDutCh + 1; iDutChtest++) {
3012 if (iDutChtest < 0) iDutChtest = 0;
3015 std::list<CbmTofHit*>::iterator itL =
3019 for (
Int_t i = 0; i < iNDutHits; i++) {
3020 LOG(debug1) <<
"Inspect " << i <<
" for address match " << (*itL)->GetAddress() <<
" - "
3021 << vDutHit[i]->GetAddress();
3022 if ((*itL)->GetAddress() == vDutHit[i]->GetAddress()) {
3023 LOG(debug) <<
"iDutCh hit was added to DTLH from Mul " << iNDutHits;
3029 dTimeSinceLastDutHit = TMath::Max(0., TMath::Log10(pHitRef->
GetTime() - (*itL)->GetTime()));
3033 dTimeSinceLastDutHit = 9.9;
3036 LOG(debug) << Form(
" DTLH for iDutCh %02d Mul %03d: %6.1f from size %lu, ref %12.0f ", iDutCh, iNDutHits,
3037 dTimeSinceLastDutHit,
3054 hitpos2[0] = pHitRef->
GetX();
3055 hitpos2[1] = pHitRef->
GetY();
3056 hitpos2[2] = pHitRef->
GetZ();
3057 gGeoManager->GetCurrentNode();
3058 gGeoManager->MasterToLocal(hitpos2, hitpos2_local);
3059 fhXY4D4sel->Fill(hitpos2_local[0], hitpos2_local[1]);
3061 if (NULL != pHitSel2) {
3066 gGeoManager->FindNode(fChannelInfo3->
GetX(), fChannelInfo3->
GetY(), fChannelInfo3->
GetZ());
3067 hitpos3[0] = pHitSel2->
GetX();
3068 hitpos3[1] = pHitSel2->
GetY();
3069 hitpos3[2] = pHitSel2->
GetZ();
3070 gGeoManager->GetCurrentNode();
3071 gGeoManager->MasterToLocal(hitpos3, hitpos3_local);
3085 Int_t iMatchedRealTrackLink(-1);
3086 std::set<Int_t> RealTrackLinkSet;
3092 Int_t iNSelHitTupleHits(3);
3098 for (
Int_t iMRefHitTrackLink = 0; iMRefHitTrackLink < tMRefHitTrackMatch->
GetNofLinks();
3099 iMRefHitTrackLink++) {
3100 tSelHitTupleTrackMatch.
AddLink(tMRefHitTrackMatch->
GetLink(iMRefHitTrackLink));
3103 for (
Int_t iSel2HitTrackLink = 0; iSel2HitTrackLink < tSel2HitTrackMatch->
GetNofLinks();
3104 iSel2HitTrackLink++) {
3105 tSelHitTupleTrackMatch.
AddLink(tSel2HitTrackMatch->
GetLink(iSel2HitTrackLink));
3108 for (
Int_t iBRefHitTrackLink = 0; iBRefHitTrackLink < tBRefHitTrackMatch->
GetNofLinks();
3109 iBRefHitTrackLink++) {
3110 tSelHitTupleTrackMatch.
AddLink(tBRefHitTrackMatch->
GetLink(iBRefHitTrackLink));
3114 Double_t dSelHitTupleMaxTrackLinkWeight = tSelHitTupleMatchedTrackLink.
GetWeight();
3116 for (
Int_t iSelHitTupleTrackLink = 0; iSelHitTupleTrackLink < tSelHitTupleTrackMatch.
GetNofLinks();
3117 iSelHitTupleTrackLink++) {
3118 const CbmLink& tSelHitTupleTrackLink = tSelHitTupleTrackMatch.
GetLink(iSelHitTupleTrackLink);
3120 if (dSelHitTupleMaxTrackLinkWeight == tSelHitTupleTrackLink.
GetWeight()
3121 && -1 < tSelHitTupleTrackLink.
GetIndex()) {
3122 iMatchedRealTrackLink = tSelHitTupleTrackLink.
GetIndex();
3123 RealTrackLinkSet.emplace(tSelHitTupleTrackLink.
GetIndex());
3127 Int_t iNTrueTupleHits =
static_cast<Int_t>(dSelHitTupleMaxTrackLinkWeight);
3135 tSelHitTupleTrackMatch.
SetNofWrongHits(iNSelHitTupleHits - iNTrueTupleHits);
3143 if (-1 < iMatchedRealTrackLink) {
3146 bGoodTrackSel = kTRUE;
3158 if (bGoodTrackSel) {
3159 TGeoNode* tNode(NULL);
3160 TGeoMedium* tMedium(NULL);
3161 TGeoMaterial* tMaterial(NULL);
3163 const char* cMaterialName;
3165 const char* cSelRefTrackPdgName;
3166 const char* cSelRefTrackProcessName;
3168 Bool_t bSelRefTrack(kFALSE);
3170 for (
auto const& iTrack : RealTrackLinkSet) {
3175 tMedium = tNode->GetMedium();
3176 tMaterial = tMedium->GetMaterial();
3181 bSelRefTrack = kTRUE;
3200 if (iNbMatchedHits > 0) {
3202 LOG(debug) << Form(
"best match D4 (%d): 0x%p, 0x%p in ch 0x%08x, 0x%08x: "
3203 "%12.1f < %12.1f ?",
3204 iNbMatchedHits, pChi2Hit1[0], pChi2Hit2[0], pChi2Hit1[0]->GetAddress(),
3205 pChi2Hit2[0]->GetAddress(), Chi2List[0],
fdChi2Lim);
3207 if (NULL != pHitSel2) {
fhXYSel2D4best->Fill(hitpos3_local[0], hitpos3_local[1]); }
3209 pHit1 = pChi2Hit1[0];
3210 pHit2 = pChi2Hit2[0];
3212 if (pHit2 != pHitRef) {
3213 LOG(debug) <<
" selector hit does not match reference hit for best "
3215 << Chi2List[0] << Form(
", ref found in Addr 0x%08x ", pHitRef->
GetAddress());
3216 for (iM0 = 1; iM0 < iNbMatchedHits; iM0++) {
3217 if (pHitRef == pChi2Hit2[iM0]) {
3218 LOG(debug) <<
" found reference hit for best match, chi2new " << Chi2List[iM0];
3219 pHit1 = pChi2Hit1[iM0];
3220 pHit2 = pChi2Hit2[iM0];
3224 if (iM0 == iNbMatchedHits) {
3225 LOG(debug) << Form(
"no valid match in %d hits for Addr 0x%08x found ", iNbMatchedHits, pHitRef->
GetAddress());
3226 if (fair::Logger::Logging(fair::Severity::debug1)) LOG(fatal) <<
"Check for consistency!";
3244 Double_t xPos1 = pHit1->
GetX();
3245 Double_t yPos1 = pHit1->
GetY();
3246 Double_t zPos1 = pHit1->
GetZ();
3247 Double_t tof1 = pHit1->
GetTime();
3248 Double_t dzscal = 1.;
3251 Double_t xPos2 = dzscal * pHit2->
GetX();
3252 Double_t yPos2 = dzscal * pHit2->
GetY();
3253 Double_t tof2 = pHit2->
GetTime();
3256 TMath::Sqrt(TMath::Power(pHit1->
GetX() - pHit2->
GetX(), 2) + TMath::Power(pHit1->
GetY() - pHit2->
GetY(), 2)
3257 + TMath::Power(pHit1->
GetZ() - pHit2->
GetZ(), 2));
3260 Double_t dCluSize0 = digiMatch1->
GetNofLinks() / 2.;
3263 Double_t dCluSize4 = digiMatch2->
GetNofLinks() / 2.;
3267 gGeoManager->FindNode(fChannelInfo2->
GetX(), fChannelInfo2->
GetY(), fChannelInfo2->
GetZ());
3269 hitpos2[0] = pHit2->
GetX();
3270 hitpos2[1] = pHit2->
GetY();
3271 hitpos2[2] = pHit2->
GetZ();
3276 gGeoManager->MasterToLocal(hitpos2, hitpos2_local);
3279 Double_t dInvVel = dTofD4 / pHitRef->
GetR();
3280 Double_t dDTexp = dDist * dInvVel;
3283 Double_t dTot0 = 0.;
3290 dTot0 += pDig0->
GetTot();
3291 LOG(debug1) << Form(
" dTot of hit 0x%08x: digind %d add %f -> sum %f", iDetId1, iDigInd0, pDig0->
GetTot(),
3297 Double_t dTot4 = 0.;
3305 dTot4 += pDig0->
GetTot();
3306 LOG(debug1) << Form(
" dTot of hit 0x%08x: digind %d add %f -> sum %f", iDetId1, iDigInd0, pDig0->
GetTot(),
3311 Double_t dTcor = 0.;
3328 Double_t dToD = (tof1 - tof2 - dTcor -
fdDTMean);
3332 Bool_t bGoodSelDutMatch(kFALSE);
3338 if (bGoodTrackSel) {
3341 Double_t dSelHitTupleMaxTrackLinkWeight = (tSelHitTupleTrackMatch.
GetMatchedLink()).GetWeight();
3344 for (
Int_t iSelHitTupleTrackLink = 0; iSelHitTupleTrackLink < tSelHitTupleTrackMatch.
GetNofLinks();
3345 iSelHitTupleTrackLink++) {
3346 const CbmLink& tSelHitTupleTrackLink = tSelHitTupleTrackMatch.
GetLink(iSelHitTupleTrackLink);
3348 if (dSelHitTupleMaxTrackLinkWeight == tSelHitTupleTrackLink.
GetWeight()) {
3349 for (
Int_t iDutHitTrackLink = 0; iDutHitTrackLink < tDutHitTrackMatch->
GetNofLinks();
3350 iDutHitTrackLink++) {
3351 const CbmLink& tDutHitTrackLink = tDutHitTrackMatch->
GetLink(iDutHitTrackLink);
3353 if (tSelHitTupleTrackLink == tDutHitTrackLink) {
3354 bGoodSelDutMatch = kTRUE;
3360 if (bGoodSelDutMatch) {
break; }
3384 if (
fiDut != iDut) LOG(fatal) <<
"inconsistent Dut - type " << iDut <<
" != " <<
fiDut;
3387 if (iDutCh != iCh) LOG(debug) <<
"Inconsistent Dut strip #: " << iCh <<
" != " << iDutCh;
3388 fhDTLH_DStrip->Fill((Double_t) iCh, (Double_t)(iCh - iDutCh));
3392 fhXX04->Fill(xPos1, xPos2);
3393 fhYY04->Fill(yPos1, yPos2);
3394 fhXY04->Fill(xPos1, yPos2);
3395 fhYX04->Fill(yPos1, xPos2);
3396 fhTT04->Fill(tof1, tof1 - tof2);
3421 if (dInvVel > 0.)
fhVelD4best->Fill(1. / dInvVel);
3427 fhXY4D4best->Fill(hitpos2_local[0], hitpos2_local[1]);
3444 LOG(debug) << Form(
" dTot of hit 0x%08x: digind %d add %f -> sum %f", iDetId2, iDigInd0, pDig0->
GetTot(),
3460 LOG(debug1) << Form(
" dTot of hit 0x%08x: digind %d add %f -> sum %f", iDetId1, iDigInd0, pDig0->
GetTot(),
3473 gGeoManager->FindNode(fChannelInfo1->
GetX(), fChannelInfo1->
GetY(), fChannelInfo1->
GetZ());
3475 hitpos1[0] = pHit1->
GetX();
3476 hitpos1[1] = pHit1->
GetY();
3477 hitpos1[2] = pHit1->
GetZ();
3479 gGeoManager->GetCurrentNode();
3480 gGeoManager->MasterToLocal(hitpos1, hitpos1_local);
3482 fhXY0D4best->Fill(hitpos1_local[0], hitpos1_local[1]);
3483 fhXX04D4best->Fill(hitpos1_local[0], hitpos2_local[0]);
3484 fhYY04D4best->Fill(hitpos1_local[1], hitpos2_local[1]);
3508 if (bGoodTrackSel) {
3540 if (-1 < iFileIndex && -1 < iEventIndex && -1 < iArrayIndex) {
3541 Double_t dMCEventStartTime(0.);
3572 if (pHit1->
GetZ() < pHit2->
GetZ()) { dSign = -1.; }
3573 Double_t dDutMCPointDelay(0.);
3574 Double_t dMRefMCPointDelay(0.);
3576 dDutMCPointDelay = 0.5
3580 dMRefMCPointDelay = 0.5
3586 tof2 + dSign * dDTexp - tDutHitMatchedPoint->GetTime() - dMCEventStartTime
3587 - dMRefMCPointDelay);
3589 tof1 - tDutHitMatchedPoint->GetTime() - dMCEventStartTime
3590 - dDutMCPointDelay);
3595 if (iNbMatchedHits > 1) {
3596 LOG(debug) << Form(
" Matches>1: %d with first chi2s = %12.1f, %12.1f, %12.1f, %12.1f", iNbMatchedHits,
3597 Chi2List[0], Chi2List[1], Chi2List[2], Chi2List[3]);
3599 for (
Int_t iM = 0; iM < iNbMatchedHits; iM++) {
3600 LOG(debug) << Form(
" Match: %d (%d) with ids = 0x%08x, 0x%08x - 0x%08x, 0x%08x", iM, iNbMatchedHits,
3603 if (pChi2Hit1[iM] != pHit1 && pChi2Hit2[iM] != pHit2) {
3605 LOG(debug) << Form(
" second best match D4 at %d (%d): chi2 %f ", iM, iNbMatchedHits, Chi2List[iM]);
3607 if (Chi2List[iM] > 1.E3)
break;
3609 pHit3 = pChi2Hit1[iM];
3610 pHit4 = pChi2Hit2[iM];
3622 gGeoManager->FindNode(fChannelInfo4->
GetX(), fChannelInfo4->
GetY(), fChannelInfo4->
GetZ());
3624 hitpos4[0] = pChi2Hit2[iM]->
GetX();
3625 hitpos4[1] = pChi2Hit2[iM]->
GetY();
3626 hitpos4[2] = pChi2Hit2[iM]->
GetZ();
3630 gGeoManager->MasterToLocal(hitpos4, hitpos4_local);
3636 Double_t xPos3 = dzscal * pChi2Hit1[iM]->
GetX();
3637 Double_t yPos3 = dzscal * pChi2Hit1[iM]->
GetY();
3638 Double_t tof3 = pChi2Hit1[iM]->
GetTime();
3641 Double_t xPos4 = dzscal * pChi2Hit2[iM]->
GetX();
3642 Double_t yPos4 = dzscal * pChi2Hit2[iM]->
GetY();
3643 Double_t tof4 = pChi2Hit2[iM]->
GetTime();
3645 Double_t dDist34 = TMath::Sqrt(TMath::Power(pHit3->
GetX() - pHit4->
GetX(), 2)
3646 + TMath::Power(pHit3->
GetY() - pHit4->
GetY(), 2)
3647 + TMath::Power(pHit3->
GetZ() - pHit4->
GetZ(), 2));
3657 Double_t dInvVel4 = dTofD44 / pHitRef->
GetR();
3658 Double_t dDTexp4 = dDist34 * dInvVel4;
3659 Double_t dTcor4 = 0.;
3669 Double_t dToD34 = (tof3 - tof4 - dTcor4 -
fdDTMean);
3672 if (dInvVel4 > 0.)
fhVelD4sbest->Fill(1000. / dInvVel4);
3694 dTot4 += pDig0->
GetTot();
3695 LOG(debug) << Form(
" dTot4 of hit 0x%08x: digind %d add %f -> sum %f", iDetId2, iDigInd0,
3704 Double_t dTot3 = 0.;
3710 dTot3 += pDig0->
GetTot();
3711 LOG(debug) << Form(
" dTot of hit 0x%08x: digind %d add %f -> sum %f", iDetId1, iDigInd0,
3721 gGeoManager->FindNode(fChannelInfo3->
GetX(), fChannelInfo3->
GetY(), fChannelInfo3->
GetZ());
3723 hitpos3[0] = pChi2Hit1[iM]->
GetX();
3724 hitpos3[1] = pChi2Hit1[iM]->
GetY();
3725 hitpos3[2] = pChi2Hit1[iM]->
GetZ();
3727 gGeoManager->GetCurrentNode();
3728 gGeoManager->MasterToLocal(hitpos3, hitpos3_local);
3731 fhDTY0D4sbest->Fill(hitpos3_local[1], tof4 - tof4 - dTcor4);
3745 fhDT04DX0_2->Fill(hitpos1_local[0] - hitpos3_local[0], dToD34);
3746 fhDT04DY0_2->Fill(hitpos1_local[1] - hitpos3_local[1], dToD34);
3749 fhDT04DX4_2->Fill(hitpos2_local[0] - hitpos4_local[0], dToD34);
3750 fhDT04DY4_2->Fill(hitpos2_local[1] - hitpos4_local[1], dToD34);
3753 fhDT04DX0_1->Fill(hitpos1_local[0] - hitpos3_local[0], dToD);
3754 fhDT04DY0_1->Fill(hitpos1_local[1] - hitpos3_local[1], dToD);
3757 fhDT04DX4_1->Fill(hitpos2_local[0] - hitpos4_local[0], dToD);
3758 fhDT04DY4_1->Fill(hitpos2_local[1] - hitpos4_local[1], dToD);
3791 Int_t iSelHitTupleDutHitMatchMul(0);
3792 Int_t iSelHitTupleDutHitMatchAccMul(0);
3794 for (
Int_t iMatch = 0; iMatch < iNbMatchedHits; iMatch++) {
3795 if (pHitRef == pChi2Hit2[iMatch]) {
3796 iSelHitTupleDutHitMatchMul++;
3798 if (
fdChi2Lim > Chi2List[iMatch]) { iSelHitTupleDutHitMatchAccMul++; }
3814 Double_t hitpos[3], hitpos_local[3];
3844 Bool_t bSelTrackletFound(kFALSE);
3845 Int_t iBestTrklFitIndex(-1);
3846 Double_t dBestTrklFitRedChiSq(1.E300);
3852 LOG(debug) << Form(
"Tracklet analysis of %d tracklets from %d stations", iNbTofTracks, NStations);
3855 if (dMul0 <= dM0Max && dMul4 <= dM4Max && dMulD <= dMDMax && dMulS2 <= dM4Max)
3856 if (iNbTofTracks > 0) {
3863 gGeoManager->GetCurrentNode();
3866 LOG(debug) << Form(
"Tracklet analysis of %d tracks and %d Dut Hits ", iNbTofTracks, (
int) vDutHit.size());
3868 std::vector<std::map<Double_t, Int_t>> vTrkMap;
3869 std::vector<std::map<Double_t, Int_t>> vHitMap;
3871 vTrkMap.resize(vDutHit.size());
3872 vHitMap.resize(iNbTofTracks);
3874 std::multimap<Double_t, std::pair<Int_t, Int_t>> RedChiSqTrackletDutHitPair;
3875 std::map<Int_t, std::pair<Int_t, Double_t>> TrackletMatchedDutHitRedChiSq;
3877 for (
Int_t iTrk = 0; iTrk < iNbTofTracks; iTrk++) {
3879 if (NULL == pTrk)
continue;
3881 if (dBestTrklFitRedChiSq > pTrk->
GetChiSq()) {
3882 dBestTrklFitRedChiSq = pTrk->
GetChiSq();
3883 iBestTrklFitIndex = iTrk;
3887 for (
Int_t iTrk = 0; iTrk < iNbTofTracks; iTrk++) {
3889 if (NULL == pTrk)
continue;
4010 if (iTrk != iBestTrklFitIndex) {
continue; }
4017 LOG(fatal) <<
"DUT hit found already attached to a tracklet in "
4018 "'AttachDutHitToTracklet' mode!";
4021 Int_t iSelTrklDutHitMatchMul(0);
4022 Int_t iSelTrklDutHitMatchAccMul(0);
4024 Double_t dXex = pTrk->
GetFitX(dDutzPos);
4025 Double_t dYex = pTrk->
GetFitY(dDutzPos);
4026 Double_t dTex = pTrk->
GetFitT(dDutzPos);
4028 for (
auto const& iHit : DutHitSet) {
4031 Double_t dRedChiSq = (TMath::Power(TMath::Abs(dTex - tHit->
GetTime()) /
GetSigT(1), 2)
4032 + TMath::Power(TMath::Abs(dXex - tHit->
GetX()) /
GetSigX(1), 2)
4033 + TMath::Power(TMath::Abs(dYex - tHit->
GetY()) /
GetSigY(1), 2))
4036 RedChiSqTrackletDutHitPair.emplace(dRedChiSq, std::make_pair(iTrk, iHit));
4039 iSelTrklDutHitMatchMul++;
4041 if (dRedChiSq <
fSIGLIM) { iSelTrklDutHitMatchAccMul++; }
4054 bSelTrackletFound = kTRUE;
4067 for (
auto itChi2Map = RedChiSqTrackletDutHitPair.cbegin(); itChi2Map != RedChiSqTrackletDutHitPair.cend();) {
4068 Double_t dRedChiSq = itChi2Map->first;
4069 Int_t iUsedTracklet = itChi2Map->second.first;
4070 Int_t iUsedHit = itChi2Map->second.second;
4072 TrackletMatchedDutHitRedChiSq.emplace(iUsedTracklet, std::make_pair(iUsedHit, dRedChiSq));
4074 Bool_t bFoundNextUniqueMatch(kFALSE);
4076 for (
auto itSubMap = ++itChi2Map; itSubMap != RedChiSqTrackletDutHitPair.cend();) {
4077 Int_t iTracklet = itSubMap->second.first;
4082 if (iUsedTracklet == iTracklet)
4084 itSubMap = RedChiSqTrackletDutHitPair.erase(itSubMap);
4087 if (!bFoundNextUniqueMatch) {
4088 itChi2Map = itSubMap;
4089 bFoundNextUniqueMatch = kTRUE;
4096 if (!bFoundNextUniqueMatch) { itChi2Map = RedChiSqTrackletDutHitPair.cend(); }
4103 for (
Int_t iTrk = 0; iTrk < iNbTofTracks; iTrk++) {
4105 if (NULL == pTrk)
continue;
4106 if (pTrk->
GetNofHits() < NStations - 1)
continue;
4111 if (iTrk != iBestTrklFitIndex) {
continue; }
4115 Double_t dDelTLH = 11.;
4117 hitpos[0] = pTrk->
GetFitX(dDutzPos);
4118 hitpos[1] = pTrk->
GetFitY(dDutzPos);
4119 hitpos[2] = dDutzPos;
4121 gGeoManager->MasterToLocal(hitpos, hitpos_local);
4129 Double_t LHpos[3], LHpos_local[3];
4131 if (
fhLHTime.size() >
static_cast<size_t>(iDet)) {
4132 Int_t iBin =
fhLHTime[iDet]->FindBin(hitpos_local[0], hitpos_local[1]);
4135 if (iBin <= 0 || iBin >
fhLHTime[iDet]->GetNbinsX() *
fhLHTime[iDet]->GetNbinsY()) {
4136 LOG(debug) <<
"Invalid bin number for reading fhLHTime, det " << iDet <<
": " << iBin <<
", " << dTLH;
4140 pLHit =
fvLHit[iDet][iBinA];
4142 if (NULL != pLHit) {
4143 dTLH =
fhLHTime[iDet]->GetBinContent(iBin);
4145 LOG(fatal) <<
" LHTime mismatch for Det " << iDet <<
", Bin " << iBin
4146 << Form(
": %f - %f = %f", pLHit->
GetTime(), dTLH, pLHit->
GetTime() - dTLH);
4151 Double_t dTLLH = dTLH;
4152 Int_t iRow = iBin / iNbinsX + 1;
4153 Int_t iCol = iBin % iNbinsX;
4156 if (
fhLHTime[iDet]->GetBinContent(iBin - 1) > dTLLH) {
4157 pLLHit =
fvLHit[iDet][iBinA - 1];
4161 for (
Int_t iBLL = iBin - iNbinsX - 1; iBLL < iBin - iNbinsX + 1; iBLL++) {
4162 if (
fhLHTime[iDet]->GetBinContent(iBLL) > dTLLH) {
4163 pLLHit =
fvLHit[iDet][iBLL - 1];
4168 if (iRow < iNbinsX - 1) {
4169 for (
Int_t iBLL = iBin + iNbinsX - 1; iBLL < iBin + iNbinsX + 1; iBLL++) {
4170 if (
fhLHTime[iDet]->GetBinContent(iBLL) > dTLLH) {
4171 pLLHit =
fvLHit[iDet][iBLL - 1];
4177 if (iCol < iNbinsX - 1) {
4178 if (
fhLHTime[iDet]->GetBinContent(iBin + 1) > dTLLH) {
4179 pLLHit =
fvLHit[iDet][iBin];
4183 for (
Int_t iBLL = iBin - iNbinsX + 1; iBLL < iBin - iNbinsX + 2; iBLL++) {
4184 if (
fhLHTime[iDet]->GetBinContent(iBLL) > dTLLH) {
4185 pLLHit =
fvLHit[iDet][iBLL - 1];
4190 if (iRow < iNbinsX - 1) {
4191 for (
Int_t iBLL = iBin + iNbinsX + 1; iBLL < iBin + iNbinsX + 2; iBLL++) {
4192 if (
fhLHTime[iDet]->GetBinContent(iBLL) > dTLLH) {
4193 pLLHit =
fvLHit[iDet][iBLL - 1];
4204 if (dTLH > 0) dDelTLH = TMath::Log10(pTrk->
GetFitT(dDutzPos) - dTLH);
4211 LHpos[0] = pLHit->
GetX();
4212 LHpos[1] = pLHit->
GetY();
4213 LHpos[2] = pLHit->
GetZ();
4214 gGeoManager->MasterToLocal(LHpos, LHpos_local);
4217 LOG(info) << Form(
" expect hit at %f in %d. spill got TLH = %f, DelT %f for "
4218 "Det %d at x %6.2f, y %6.2f, bin %d from x %6.2f, y %6.2f",
4219 pTrk->
GetTime(),
iNspills, dTLH, dDelTLH, iDet, hitpos_local[0], hitpos_local[1],
4220 iBin, LHpos_local[0], LHpos_local[1]);
4223 LOG(info) << Form(
" Trkl with %d hits expect Dut hit at %f in %d. spill after "
4224 "TLH = %f, LogDelT %f for Det %d in Bin %d at x %6.2f, y %6.2f",
4226 hitpos_local[0], hitpos_local[1]);
4229 Bool_t bGoodSelTracklet(kFALSE);
4230 Bool_t bGoodSelTrackletDutMatch(kFALSE);
4232 auto itDutHitMatch = TrackletMatchedDutHitRedChiSq.find(iTrk);
4236 if (dTt > 0.) dVel = 1. / dTt;
4242 Int_t iMatchedRealTrackLink(-1);
4243 std::set<Int_t> RealTrackLinkSet;
4248 Double_t dSelTrackletMaxTrackLinkWeight = tLink.
GetWeight();
4250 for (
Int_t iSelTrackletTrackLink = 0; iSelTrackletTrackLink < tTrackletAccTrackMatch->
GetNofLinks();
4251 iSelTrackletTrackLink++) {
4252 const CbmLink& tSelTrackletTrackLink = tTrackletAccTrackMatch->
GetLink(iSelTrackletTrackLink);
4254 if (dSelTrackletMaxTrackLinkWeight == tSelTrackletTrackLink.
GetWeight()
4255 && -1 < tSelTrackletTrackLink.
GetIndex()) {
4256 iMatchedRealTrackLink = tSelTrackletTrackLink.
GetIndex();
4257 RealTrackLinkSet.emplace(tSelTrackletTrackLink.
GetIndex());
4267 if (-1 < iMatchedRealTrackLink) {
4270 bGoodSelTracklet = kTRUE;
4280 if (bGoodSelTracklet) {
4281 TGeoNode* tNode(NULL);
4282 TGeoMedium* tMedium(NULL);
4283 TGeoMaterial* tMaterial(NULL);
4285 const char* cMaterialName;
4287 const char* cSelRefTrackPdgName;
4288 const char* cSelRefTrackProcessName;
4290 Bool_t bSelRefTrack(kFALSE);
4292 for (
auto const& iTrack : RealTrackLinkSet) {
4297 tMedium = tNode->GetMedium();
4298 tMaterial = tMedium->GetMaterial();
4302 if (0 == std::strcmp(
"target", cMaterialName)
4304 bSelRefTrack = kTRUE;
4320 if (itDutHitMatch != TrackletMatchedDutHitRedChiSq.end()) {
4321 Int_t iDutHitIndex = itDutHitMatch->second.first;
4326 for (
Int_t iSelTrackletTrackLink = 0;
4327 iSelTrackletTrackLink < tTrackletAccTrackMatch->
GetNofLinks(); iSelTrackletTrackLink++) {
4328 const CbmLink& tSelTrackletTrackLink = tTrackletAccTrackMatch->
GetLink(iSelTrackletTrackLink);
4330 if (dSelTrackletMaxTrackLinkWeight == tSelTrackletTrackLink.
GetWeight()) {
4331 for (
Int_t iDutHitTrackLink = 0; iDutHitTrackLink < tDutHitTrackMatch->
GetNofLinks();
4332 iDutHitTrackLink++) {
4333 const CbmLink& tDutHitTrackLink = tDutHitTrackMatch->
GetLink(iDutHitTrackLink);
4335 if (tSelTrackletTrackLink == tDutHitTrackLink) {
4336 bGoodSelTrackletDutMatch = kTRUE;
4342 if (bGoodSelTrackletDutMatch) {
break; }
4345 if (bGoodSelTrackletDutMatch) {
4361 && itDutHitMatch != TrackletMatchedDutHitRedChiSq.end() && itDutHitMatch->second.second <
fSIGLIM)) {
4362 LOG(debug) << Form(
" Event %d : process complete Trkl %d, HMul %d, iDet %d ",
fEvents, iTrk,
4367 Int_t iDutHitIndex(-1);
4369 iDutHitIndex = itDutHitMatch->second.first;
4378 if (NULL == pHit) LOG(warning) <<
"Dut not found in full length track";
4411 if (NULL != digiMatch)
4423 if (pDig0->
GetTot() > dTot) {
4432 LOG(error) <<
"no Tof Digis";
4434 LOG(error) <<
"no Tof Digi Match";
4447 fhDutXYDX->Fill(hitpos_local[0], hitpos_local[1], dDX);
4448 fhDutXYDY->Fill(hitpos_local[0], hitpos_local[1], dDY);
4449 fhDutXYDT->Fill(hitpos_local[0], hitpos_local[1], dDTB);
4457 if (bGoodSelTracklet) {
4493 if (-1 < iFileIndex && -1 < iEventIndex && -1 < iArrayIndex) {
4494 Double_t dMCEventStartTime(0.);
4500 tDutHitMatchedPoint =
4519 - dMCEventStartTime);
4521 pHit->
GetTime() - tDutHitMatchedPoint->GetTime() - dMCEventStartTime);
4548 if (NULL != pLHit) {
4551 Double_t dTot0 = 0.;
4558 dTot0 += pDig0->
GetTot();
4566 Double_t dDDH = TMath::Sqrt(TMath::Power(hitpos_local[0] - LHpos_local[0], 2.)
4567 + TMath::Power(hitpos_local[1] - LHpos_local[1], 2.));
4570 hitpos[0] = pTrk->
GetFitX(dDutzPos);
4571 hitpos[1] = pTrk->
GetFitY(dDutzPos);
4572 hitpos[2] = dDutzPos;
4573 gGeoManager->MasterToLocal(hitpos, hitpos_local);
4574 Double_t dDD = TMath::Sqrt(TMath::Power(hitpos_local[0] - LHpos_local[0], 2.)
4575 + TMath::Power(hitpos_local[1] - LHpos_local[1], 2.));
4588 && itDutHitMatch != TrackletMatchedDutHitRedChiSq.end() && !(itDutHitMatch->second.second <
fSIGLIM)) {
4603 && itDutHitMatch == TrackletMatchedDutHitRedChiSq.end())) {
4605 LOG(info) << Form(
" Missed hit at %f, TLH = %f, LogDelT %f for Det %d at x "
4606 "%6.2f, y %6.2f, bin %d from x %6.2f, y %6.2f",
4607 pTrk->
GetTime(), dTLH, dDelTLH, iDet, hitpos_local[0], hitpos_local[1], iBinA,
4608 hitpos[0], hitpos[1]);
4617 Int_t iGet4 = ((
Int_t) hitpos_local[0] + 16) % 8 + 1;
4623 if (NULL != pLHit) {
4624 LHpos[0] = pLHit->
GetX();
4625 LHpos[1] = pLHit->
GetY();
4626 LHpos[2] = pLHit->
GetZ();
4627 gGeoManager->MasterToLocal(LHpos, LHpos_local);
4628 Double_t dDD = TMath::Sqrt(TMath::Power(hitpos_local[0] - LHpos_local[0], 2.)
4629 + TMath::Power(hitpos_local[1] - LHpos_local[1], 2.));
4642 for (
auto itChi2Map = TrackletMatchedDutHitRedChiSq.cbegin();
4643 itChi2Map != TrackletMatchedDutHitRedChiSq.cend();) {
4644 Double_t dRedChiSq = itChi2Map->second.second;
4646 if (dRedChiSq <
fSIGLIM) { ++itChi2Map; }
4648 itChi2Map = TrackletMatchedDutHitRedChiSq.erase(itChi2Map);
4659 for (
Int_t iHitInd = 0; iHitInd < iNbTofHits; iHitInd++) {
4661 if (NULL == pHit)
continue;
4669 hitpos[0] = pHit->
GetX();
4670 hitpos[1] = pHit->
GetY();
4671 hitpos[2] = pHit->
GetZ();
4672 gGeoManager->MasterToLocal(hitpos, hitpos_local);
4674 if (
static_cast<size_t>(iDet) >=
fhLHTime.size()) {
4675 LOG(warning) <<
" LHdeb: invalid iDet index " << iDet <<
" of " <<
fhLHTime.size();
4679 Int_t iBin =
fhLHTime[iDet]->FindBin(hitpos_local[0], hitpos_local[1]);
4680 Int_t iBinA = iBin - 1;
4682 LOG(info) << Form(
"Insert Dut hit for Det %d, Bin %d, x %f, y %f, poi ", iDet, iBinA, hitpos_local[0],
4686 if (iBin <= 0 || iBin >
fhLHTime[iDet]->GetNbinsX() *
fhLHTime[iDet]->GetNbinsY()) {
4687 LOG(debug) <<
"Invalid bin number for fhLHTime, det " << iDet <<
": " << iBin;
4695 if (NULL !=
fvLHit[iDet][iBinA]) {
4701 fvLHit[iDet][iBinA]->Delete();
4707 LOG(info) << Form(
"Store hit 0x%08x at x %6.3f, y %6.3f, bin %d, "
4708 "time %f in det Id 0x%08x, #%d",
4709 fvLHit[iDet][iBinA]->GetAddress(), hitpos_local[0], hitpos_local[1], iBinA,
4710 pHit->
GetTime(), iDetId, iDet);
4717 if (bSelTrackletFound) {
4729 std::map<std::tuple<Int_t, Int_t, Int_t>, std::map<Int_t, Int_t>> CounterNCellHits;
4739 CounterNCellHits[std::make_tuple(iModuleType, iModuleIndex, iCounterIndex)][iCellIndex]++;
4761 if (dMul0 <= dM0Max && dMul4 <= dM4Max && dMulD <= dMDMax && dMulS2 <= dM4Max) {
4762 std::vector<Int_t> RefTrackSet;
4764 TGeoNode* tNode(NULL);
4765 TGeoMedium* tMedium(NULL);
4766 TGeoMaterial* tMaterial(NULL);
4768 const char* cMaterialName;
4770 std::multimap<Double_t, std::pair<Int_t, Int_t>> RedChiSqTrackDutHitPair;
4771 std::map<Int_t, std::pair<Int_t, Double_t>> TrackMatchedDutHitRedChiSq;
4772 Int_t iSelMCTrack(-1);
4773 Int_t iSelMCTrackDutHitMatchMul(0);
4774 Int_t iSelMCTrackDutHitMatchAccMul(0);
4776 for (
Int_t iTrack = 0; iTrack <
fAccTracks->GetEntriesFast(); iTrack++) {
4781 tMedium = tNode->GetMedium();
4782 tMaterial = tMedium->GetMaterial();
4786 if (0 == std::strcmp(
"target", cMaterialName)
4789 for (
Int_t iPoint = 0; iPoint < tAccTrackPointMatch->
GetNofLinks(); iPoint++) {
4797 Double_t dMCEventStartTime(0.);
4811 for (
auto const& iHit : DutHitSet) {
4814 Double_t dRedChiSq =
4815 (TMath::Power(TMath::Abs(tPoint->GetTime() + dMCEventStartTime - tHit->
GetTime()) /
GetSigT(2), 2)
4816 + TMath::Power(TMath::Abs(tPoint->GetX() - tHit->
GetX()) /
GetSigX(2), 2)
4817 + TMath::Power(TMath::Abs(tPoint->GetY() - tHit->
GetY()) /
GetSigY(2), 2))
4820 RedChiSqTrackDutHitPair.emplace(dRedChiSq, std::make_pair(iTrack, iHit));
4823 RefTrackSet.push_back(iTrack);
4834 if (RefTrackSet.size()) { iSelMCTrack = RefTrackSet.at(gRandom->Integer(RefTrackSet.size())); }
4837 for (
auto const& Chi2MapElement : RedChiSqTrackDutHitPair) {
4838 Double_t dRedChiSq = Chi2MapElement.first;
4839 Int_t iTrackIndex = Chi2MapElement.second.first;
4841 if (iTrackIndex == iSelMCTrack) {
4842 iSelMCTrackDutHitMatchMul++;
4844 if (dRedChiSq <
fdMCSIGLIM) { iSelMCTrackDutHitMatchAccMul++; }
4860 for (
auto itChi2Map = RedChiSqTrackDutHitPair.cbegin(); itChi2Map != RedChiSqTrackDutHitPair.cend();) {
4861 Double_t dRedChiSq = itChi2Map->first;
4862 Int_t iUsedTrack = itChi2Map->second.first;
4863 Int_t iUsedHit = itChi2Map->second.second;
4865 TrackMatchedDutHitRedChiSq.emplace(iUsedTrack, std::make_pair(iUsedHit, dRedChiSq));
4867 Bool_t bFoundNextUniqueMatch(kFALSE);
4869 for (
auto itSubMap = ++itChi2Map; itSubMap != RedChiSqTrackDutHitPair.cend();) {
4870 Int_t iTrack = itSubMap->second.first;
4875 if (iUsedTrack == iTrack)
4877 itSubMap = RedChiSqTrackDutHitPair.erase(itSubMap);
4880 if (!bFoundNextUniqueMatch) {
4881 itChi2Map = itSubMap;
4882 bFoundNextUniqueMatch = kTRUE;
4889 if (!bFoundNextUniqueMatch) { itChi2Map = RedChiSqTrackDutHitPair.cend(); }
4893 if (-1 < iSelMCTrack) {
4894 auto itDutHitMatch = TrackMatchedDutHitRedChiSq.find(iSelMCTrack);
4896 if (itDutHitMatch != TrackMatchedDutHitRedChiSq.end()) {
4897 Double_t dRedChiSq = itDutHitMatch->second.second;
4898 Int_t iDutHit = itDutHitMatch->second.first;
4905 Double_t dMCEventStartTime(0.);
4908 for (
Int_t iPoint = 0; iPoint < tTrackPointMatch->
GetNofLinks(); iPoint++) {
4930 Bool_t bGoodSelDutMatch(kFALSE);
4933 for (
Int_t iDutHitTrackLink = 0; iDutHitTrackLink < tDutHitTrackMatch->
GetNofLinks(); iDutHitTrackLink++) {
4934 const CbmLink& tDutHitTrackLink = tDutHitTrackMatch->
GetLink(iDutHitTrackLink);
4936 if (tDutHitTrackLink.
GetIndex() == iSelMCTrack) {
4937 bGoodSelDutMatch = kTRUE;
4969 tHit->
GetTime() - tPoint->GetTime() - dMCEventStartTime);
4990 for (
auto itChi2Map = TrackMatchedDutHitRedChiSq.cbegin(); itChi2Map != TrackMatchedDutHitRedChiSq.cend();) {
4991 Double_t dRedChiSq = itChi2Map->second.second;
4995 itChi2Map = TrackMatchedDutHitRedChiSq.erase(itChi2Map);
5020 FairMCEventHeader* tMCEventHeader(NULL);
5021 Double_t dMCEventStartTime(0.);
5028 tMCEventHeader =
dynamic_cast<FairMCEventHeader*
>(
fMCEventHeader->
Get(iFileID, iEventID));
5044 TGeoNode* tNode(NULL);
5045 TGeoMedium* tMedium(NULL);
5046 TGeoMaterial* tMaterial(NULL);
5048 const char* cPdgName;
5049 const char* cMaterialName;
5050 const char* cProcessName;
5052 Double_t dLocalTrackStart[3] = {0., 0., 0.};
5053 Double_t dGlobalTrackStart[3] = {0., 0., 0.};
5054 Double_t dLocalPoint[3] = {0., 0., 0.};
5055 Double_t dGlobalPoint[3] = {0., 0., 0.};
5057 std::map<std::tuple<Int_t, Int_t, Int_t>,
Int_t> CounterNAccTracks;
5058 std::map<std::tuple<Int_t, Int_t, Int_t>,
Int_t> CounterNAccRefTracks;
5059 std::map<std::tuple<Int_t, Int_t, Int_t>,
Int_t> CounterNAccRndmTracks;
5060 std::map<std::tuple<Int_t, Int_t, Int_t>,
Int_t> CounterNAccDomTracks;
5061 std::map<std::tuple<Int_t, Int_t, Int_t>,
Int_t> CounterNRecRefTracks;
5062 std::map<std::tuple<Int_t, Int_t, Int_t>,
Int_t> CounterNPureRefTracks;
5064 std::map<std::tuple<Int_t, Int_t, Int_t>, std::map<Int_t, Int_t>> CounterNCellAccRefTracks;
5067 Double_t dRefPVRecoT(0.);
5068 Double_t dRefPVRecoX(0.);
5069 Double_t dRefPVRecoY(0.);
5070 Int_t iRefPVRecoN(0);
5072 for (
Int_t iTrack = 0; iTrack <
fAccTracks->GetEntriesFast(); iTrack++) {
5073 Bool_t bIsAccRefTrack(kFALSE);
5077 CbmMatch* tAccTrackTrackletMatch(NULL);
5082 dGlobalTrackStart[0] = tAccTrack->
GetStartX();
5083 dGlobalTrackStart[1] = tAccTrack->
GetStartY();
5084 dGlobalTrackStart[2] = tAccTrack->
GetStartZ();
5086 tNode = gGeoManager->FindNode(dGlobalTrackStart[0], dGlobalTrackStart[1], dGlobalTrackStart[2]);
5087 tMedium = tNode->GetMedium();
5088 tMaterial = tMedium->GetMaterial();
5098 bIsAccRefTrack = kTRUE;
5142 1. / tTracklet->
GetTt()
5143 - tAccTrack->
GetP() / tAccTrack->
GetEnergy() * TMath::Ccgs() * 1.e-9);
5163 dRefPVRecoT += iRefPVRecoW * tTracklet->
GetFitT(0.);
5164 dRefPVRecoX += iRefPVRecoW * tTracklet->
GetFitX(0.);
5165 dRefPVRecoY += iRefPVRecoW * tTracklet->
GetFitY(0.);
5166 iRefPVRecoN += iRefPVRecoW;
5197 for (
Int_t iPoint = 0; iPoint < tAccTrackPointMatch->
GetNofLinks(); iPoint++) {
5214 auto CounterID = std::make_tuple(iModuleType, iModuleIndex, iCounterIndex);
5216 CounterNAccTracks[CounterID]++;
5219 if (bIsAccRefTrack) {
5220 CounterNAccRefTracks[CounterID]++;
5224 dGlobalPoint[0] = tPoint->GetX();
5225 dGlobalPoint[1] = tPoint->GetY();
5226 dGlobalPoint[2] = tPoint->GetZ();
5227 gGeoManager->MasterToLocal(dGlobalPoint, dLocalPoint);
5233 Int_t iCellIndex(-1);
5236 +
static_cast<Double_t
>(iNCounterCells) / 2.);
5240 +
static_cast<Double_t
>(iNCounterCells) / 2.);
5243 CounterNCellAccRefTracks[CounterID][iCellIndex]++;
5260 if (-1 < iHitIndex) {
5261 CounterNRecRefTracks[CounterID]++;
5272 for (
Int_t iHitTrackLink = 0; iHitTrackLink < tHitTrackMatch->
GetNofLinks(); iHitTrackLink++) {
5274 CounterNPureRefTracks[CounterID]++;
5284 tModuleNode->GetMatrix()->MasterToLocal(dGlobalTrackStart, dLocalTrackStart);
5286 if (tModuleNode->GetVolume()->Contains(dLocalTrackStart)) {
5290 CounterNAccDomTracks[CounterID]++;
5293 if (!bIsAccRefTrack) {
5297 CounterNAccRndmTracks[CounterID]++;
5304 if (0 < iRefPVRecoN) {
5305 dRefPVRecoT /= iRefPVRecoN;
5306 dRefPVRecoX /= iRefPVRecoN;
5307 dRefPVRecoY /= iRefPVRecoN;
5317 std::set<CbmLink> tMatchedAccTracks;
5319 for (
Int_t iTracklet = 0; iTracklet <
fTofTrackColl->GetEntriesFast(); iTracklet++) {
5331 dGlobalTrackStart[0] = tAccTrack->
GetStartX();
5332 dGlobalTrackStart[1] = tAccTrack->
GetStartY();
5333 dGlobalTrackStart[2] = tAccTrack->
GetStartZ();
5335 tNode = gGeoManager->FindNode(dGlobalTrackStart[0], dGlobalTrackStart[1], dGlobalTrackStart[2]);
5336 tMedium = tNode->GetMedium();
5337 tMaterial = tMedium->GetMaterial();
5346 if (0 == std::strcmp(
"target", cMaterialName)
5399 auto const& CounterID = CounterModuleNode.first;
5400 Int_t iModuleType = std::get<0>(CounterID);
5402 Int_t iCounterIndex = std::get<2>(CounterID);
5412 CounterNRecRefTracks[CounterID]);
5414 CounterNAccRefTracks[CounterID]);
5416 CounterNPureRefTracks[CounterID]);
5419 Int_t iCounterHitMul(0);
5420 Int_t iCounterRefTrackMul(0);
5422 for (
Int_t iCell = 0; iCell < iNCounterCells; iCell++) {
5424 iCounterRefTrackMul += CounterNCellAccRefTracks[CounterID][iCell];
5425 iCounterHitMul += CounterNCellHits[CounterID][iCell];
5435 auto const& CounterID = CounterModuleNode.first;
5436 Int_t iModuleType = std::get<0>(CounterID);
5438 Int_t iCounterIndex = std::get<2>(CounterID);
5441 for (
Int_t iCell = 0; iCell < iNCounterCells; iCell++) {