286 cout <<
"CbmTofTests::Finish up with " <<
fEvents <<
" analyzed events " << endl;
288 Double_t dEvtRate = 1. /
fEvents;
289 Double_t dIntRate = 1.E7;
290 Double_t dOptLinkCapa = 2.5;
291 Double_t dOptLinkAvBw = 0.8;
292 Double_t dKiloByte = 1024;
293 Double_t dMegaByte = 1024 * dKiloByte;
294 Double_t dGigaByte = 1024 * dMegaByte;
296 cout <<
"<I> Normalisation factors " << dIntRate * dEvtRate <<
" [1/s], " << dOptLinkCapa * dOptLinkAvBw
297 <<
" [GByte/s]" << endl;
310 fhOptLnkRpc->Scale(dIntRate * dEvtRate / dGigaByte / (dOptLinkCapa * dOptLinkAvBw));
311 fhOptLnkSm->Scale(dIntRate * dEvtRate / dGigaByte / (dOptLinkCapa * dOptLinkAvBw));
312 fhOptLnkType->Scale(dIntRate * dEvtRate / dGigaByte / (dOptLinkCapa * dOptLinkAvBw));
472 TDirectory* oldir = gDirectory;
476 fhTestingTime =
new TH1I(
"TofDigiBdf_TestingTime",
"Time needed to for the test processing in each event; Time [s]",
493 Double_t xrange = 750.;
494 Double_t yrange = 500.;
495 Double_t zmin = 950.;
496 Double_t zmax = 1100.;
499 Int_t iNbBinThetaX = 1200;
500 Double_t dThetaXMin = -60.0;
501 Double_t dThetaXMax = 60.0;
502 Int_t iNbBinThetaY = 800;
503 Double_t dThetaYMin = -40.0;
504 Double_t dThetaYMax = 40.0;
513 Int_t iNbBinPhi = 180;
514 Double_t dPhiMin = 0;
515 Double_t dPhiMax = TMath::Pi() * 90 / 180;
516 Int_t iNbBinTheta = 180;
517 Double_t dThetaMin = -TMath::Pi();
518 Double_t dThetaMax = TMath::Pi();
522 fhPointMapXY =
new TH2D(
"TofTests_PointsMapXY",
"Position of the Tof Points; X[cm]; Y[cm]; # [Points]", nbinx,
523 -xrange, xrange, nbiny, -yrange, yrange);
524 fhPointMapXZ =
new TH2D(
"TofTests_PointsMapXZ",
"Position of the Tof Points; X[cm]; Z[cm]; # [Points]", nbinx,
525 -xrange, xrange, nbinz, zmin, zmax);
526 fhPointMapYZ =
new TH2D(
"TofTests_PointsMapYZ",
"Position of the Tof Points; Y[cm]; Z[cm]; # [Points]", nbiny,
527 -yrange, yrange, nbinz, zmin, zmax);
529 "Position of the Tof Points; #theta_{x}[Deg.]; "
530 "#theta_{y}[Deg.]; # [Points]",
531 iNbBinThetaX, dThetaXMin, dThetaXMax, iNbBinThetaY, dThetaYMin, dThetaYMax);
532 fhPointMapSph =
new TH2D(
"TofTests_PointsMapSph",
"Position of the Tof Points; #theta[rad.]; #phi[rad.]; # [Points]",
533 iNbBinTheta, dThetaMin, dThetaMax, iNbBinPhi, dPhiMin, dPhiMax);
535 fhDigiMapXY =
new TH2D(
"TofTests_DigisMapXY",
"Position of the Tof Digis; X[cm]; Y[cm]; # [Digi]", nbinx, -xrange,
536 xrange, nbiny, -yrange, yrange);
537 fhDigiMapXZ =
new TH2D(
"TofTests_DigisMapXZ",
"Position of the Tof Digis; X[cm]; Z[cm]; # [Digi]", nbinx, -xrange,
538 xrange, nbinz, zmin, zmax);
539 fhDigiMapYZ =
new TH2D(
"TofTests_DigisMapYZ",
"Position of the Tof Digis; Y[cm]; Z[cm]; # [Digi]", nbiny, -yrange,
540 yrange, nbinz, zmin, zmax);
542 new TH2D(
"TofTests_DigisMapAng",
"Position of the Tof Digis; #theta_{x}[Deg.]; #theta_{y}[Deg.]; # [Digi]",
543 iNbBinThetaX, dThetaXMin, dThetaXMax, iNbBinThetaY, dThetaYMin, dThetaYMax);
544 fhDigiMapSph =
new TH2D(
"TofTests_DigisMapSph",
"Position of the Tof Digis; #theta[rad.]; #phi[rad.]; # [Points]",
545 iNbBinTheta, dThetaMin, dThetaMax, iNbBinPhi, dPhiMin, dPhiMax);
548 fhHitMapXY =
new TH2D(
"TofTests_HitsMapXY",
"Position of the Tof Hits; X[cm]; Y[cm]; # [Hits]", nbinx, -xrange,
549 xrange, nbiny, -yrange, yrange);
550 fhHitMapXZ =
new TH2D(
"TofTests_HitsMapXZ",
"Position of the Tof Hits; X[cm]; Z[cm]; # [Hits]", nbinx, -xrange,
551 xrange, nbinz, zmin, zmax);
552 fhHitMapYZ =
new TH2D(
"TofTests_HitsMapYZ",
"Position of the Tof Hits; Y[cm]; Z[cm]; # [Hits]", nbiny, -yrange,
553 yrange, nbinz, zmin, zmax);
555 new TH2D(
"TofTests_HitsMapAng",
"Position of the Tof Hits; #theta_{x}[Deg.]; #theta_{y}[Deg.]; # [Hits]",
556 iNbBinThetaX, dThetaXMin, dThetaXMax, iNbBinThetaY, dThetaYMin, dThetaYMax);
557 fhHitMapSph =
new TH2D(
"TofTests_HitsMapSph",
"Position of the Tof Hits; #theta[rad.]; #phi[rad.]; # [Points]",
558 iNbBinTheta, dThetaMin, dThetaMax, iNbBinPhi, dPhiMin, dPhiMax);
562 fhFluxMap =
new TH2D(
"TofTests_FluxMap",
"Tof Point rate as function of position; X[cm]; Y[cm]; Flux [1/(s*cm^2)]",
563 nbinx, -xrange, xrange, nbiny, -yrange, yrange);
565 new TH2D(
"TofTests_DigisFluxMap",
"Tof Hit rate as function of position; X[cm]; Y[cm]; Flux [Digi/(s*cm^2)]", nbinx,
566 -xrange, xrange, nbiny, -yrange, yrange);
568 new TH2D(
"TofTests_HitsFluxMap",
"Tof Hit rate as function of position; X[cm]; Y[cm]; Flux [Hits/(s*cm^2)]", nbinx,
569 -xrange, xrange, nbiny, -yrange, yrange);
571 new TH1D(
"TofTests_DigiRateCh",
"Digi rate per channel; Channel []; Rate [1/s]", 2 *
iNbChTot, 0, 2 *
iNbChTot);
572 fhDataRateCh =
new TH1D(
"TofTests_DataRateCh",
"Data rate per channel; Channel []; Data Rate [kB/s]", 2 *
iNbChTot, 0,
577 new TH1D(
"TofTests_DataRateType",
"Data rate per SM; SM Type[]; Rate [GB/s]", iNbSmTypes, 0, iNbSmTypes);
579 new TH1D(
"TofTests_DataPerEvt",
"Data per event for the full wall; Event Size [kB]", 1000, 0, 1000.0);
581 "Possible data reduction per event for the full "
582 "wall; Event Size Reduction [kB]",
587 new TH1D(
"TofTests_OptLnkRpc",
"Number of optical links needed per RPC; RPC []",
iNbRpcTot, 0,
iNbRpcTot);
588 fhOptLnkSm =
new TH1D(
"TofTests_OptLnkSm",
"Number of optical links needed per SM; SM []; Optical Links []",
iNbSmTot,
591 new TH1D(
"TofTests_OptLnkType",
"Number of optical links needed per SM type; SM Type[]; Optical Links []",
592 iNbSmTypes, 0, iNbSmTypes);
595 fhTofRes =
new TH1I(
"TofTests_TimeRes",
"Time difference between TofHits and TofPoint; tMcPoint -tTofHit [ns]", 5000,
598 "Time difference between TofHits and TofPoint, only "
599 "1 MC Track/Point per Hit; tMcPoint -tTofHit [ns]",
602 fhTofPosDifX =
new TH2D(
"TofTests_PosDifX",
"Position Accuracy of the Tof Hits in X; X[cm]; PtX - HitX[cm]; # [Hits]",
603 nbinx, -xrange, xrange, 200, -50, 50);
604 fhTofPosDifY =
new TH2D(
"TofTests_PosDifY",
"Position Accuracy of the Tof Hits in Y; Y[cm]; PtY - HitY[cm]; # [Hits]",
605 nbiny, -yrange, yrange, 200, -50, 50);
606 fhTofPosDifZ =
new TH2D(
"TofTests_PosDifZ",
"Position Accuracy of the Tof Hits in Z; Z[cm]; PtZ - HitZ[cm]; # [Hits]",
607 600, 950, 1100, 200, -10, 10);
609 "Position Accuracy of the Tof Hits in X, hits from single MC "
610 "point; Pt X[cm]; PtX - HitX[cm]; # [Hits]",
611 nbinx, -xrange, xrange, 500, -50, 50);
613 "Position Accuracy of the Tof Hits in X, hits from single MC "
614 "point; Pt Y[cm]; PtX - HitX[cm]; # [Hits]",
615 nbiny, -yrange, yrange, 500, -50, 50);
617 "Position Accuracy of the Tof Hits in X, hits from single MC "
618 "point; Pt Z[cm]; PtX - HitX[cm]; # [Hits]",
619 nbinz, zmin, zmax, 500, -50, 50);
621 "Position Accuracy of the Tof Hits in Y, hits from single MC "
622 "point; Pt Y[cm]; PtY - HitY[cm]; # [Hits]",
623 nbiny, -yrange, yrange, 500, -50, 50);
625 "Position Accuracy of the Tof Hits in Z, hits from single MC "
626 "point; Pt Z[cm]; PtZ - HitZ[cm]; # [Hits]",
627 600, 950, 1100, 200, -10, 10);
629 "Position Accuracy of the Tof Hits in Z, hits from single MC "
630 "point; PtX - HitX[cm]; PtZ - HitZ[cm]; # [Hits]",
631 200, -50, 50, 200, -10, 10);
633 fhTofBadXPosSing =
new TH2D(
"TofTests_BadXPosSing",
"Position of the Tof Hits; X[cm]; Y[cm]; # [Hits]", nbinx,
634 -xrange, xrange, nbiny, -yrange, yrange);
635 fhTofBadYPosSing =
new TH2D(
"TofTests_BadYPosSing",
"Position of the Tof Hits; X[cm]; Y[cm]; # [Hits]", nbinx,
636 -xrange, xrange, nbiny, -yrange, yrange);
637 fhTofBadZPosSing =
new TH2D(
"TofTests_BadZPosSing",
"Position of the Tof Hits; X[cm]; Y[cm]; # [Hits]", nbinx,
638 -xrange, xrange, nbiny, -yrange, yrange);
640 fhTofEff =
new TH1I(
"TofTests_TofEff",
641 "Fraction of tracks reaching Tof producing a non mixed "
642 "TofHit; # non-mixed Hits/ # Tof Tracks []",
645 "Fraction of TofHits built from more than 1 McTrack; "
646 "# mixed Hits/ # Hits []",
649 gDirectory->cd(oldir->GetPath());
658 Int_t iDataSizeHit = 48;
666 Int_t iNbTracks, iNbTofPts, iNbTofDigis, iNbTofHits;
674 Int_t iNbTofTracks = 0;
675 Int_t iNbTofTracksPrim = 0;
676 for (Int_t iTrkInd = 0; iTrkInd < iNbTracks; iTrkInd++) {
685 for (Int_t iPntInd = 0; iPntInd < iNbTofPts; iPntInd++) {
691 pTofPoint->Position(vPntPos);
693 Double_t dX = vPntPos.X();
694 Double_t dY = vPntPos.Y();
695 Double_t dZ = vPntPos.Z();
702 Double_t dThetaX = TMath::ATan2(dX, dZ) * 180.0 / TMath::Pi();
703 Double_t dThetaY = TMath::ATan2(dY, dZ) * 180.0 / TMath::Pi();
706 Double_t dPhi = TMath::ATan2(TMath::Sqrt(dX * dX + dY * dY), dZ);
707 Double_t dTheta = TMath::ATan2(dY, dX);
712 Double_t dTotalDataSize = 0;
715 for (Int_t iDigInd = 0; iDigInd < iNbTofDigis; iDigInd++) {
718 Int_t iSmType = pDigi->
GetType();
719 Int_t iSm = pDigi->
GetSm();
720 Int_t iRpc = pDigi->
GetRpc();
737 Double_t dThetaX = TMath::ATan2(dX, dZ) * 180.0 / TMath::Pi();
738 Double_t dThetaY = TMath::ATan2(dY, dZ) * 180.0 / TMath::Pi();
741 Double_t dPhi = TMath::ATan2(TMath::Sqrt(dX * dX + dY * dY), dZ);
742 Double_t dTheta = TMath::ATan2(dY, dX);
745 Int_t iGlobalChan = iCh +
fvRpcChOffs[iSmType][iSm][iRpc];
746 Int_t iGlobalRpc = iRpc +
fvSmRpcOffs[iSmType][iSm];
756 dTotalDataSize += iDataSizeHit;
763 Int_t iNbMixedHits = 0;
764 for (Int_t iHitInd = 0; iHitInd < iNbTofHits; iHitInd++) {
771 Double_t dX = pTofHit->
GetX();
772 Double_t dY = pTofHit->
GetY();
773 Double_t dZ = pTofHit->
GetZ();
780 Double_t dThetaX = TMath::ATan2(dX, dZ) * 180.0 / TMath::Pi();
781 Double_t dThetaY = TMath::ATan2(dY, dZ) * 180.0 / TMath::Pi();
784 Double_t dPhi = TMath::ATan2(TMath::Sqrt(dX * dX + dY * dY), dZ);
785 Double_t dTheta = TMath::ATan2(dY, dX);
800 if (1 == iNbPntHit) {
808 if (pPt->GetX() - pTofHit->
GetX() < -0.7 || 0.7 < pPt->GetX() - pTofHit->
GetX())
811 if (pPt->GetY() - pTofHit->
GetY() < -2.0 || 2.0 < pPt->GetY() - pTofHit->
GetY())
814 if (pPt->GetZ() - pTofHit->
GetZ() < -0.6 || 0.6 < pPt->GetZ() - pTofHit->
GetZ())
824 if (0 < iNbTofHits)
fhTofMixing->Fill(iNbMixedHits / iNbTofHits);