548 for (Int_t iT = 0; iT < iNbSmTypes; iT++) {
551 for (Int_t iRpc = 0; iRpc < iNbRpc; iRpc++)
562 for (Int_t iSmType = 0; iSmType < iNbSmTypes; iSmType++) {
565 fvCPTOff[iSmType].resize(iNbSm * iNbRpc);
567 fvCPWalk[iSmType].resize(iNbSm * iNbRpc);
569 for (Int_t iSm = 0; iSm < iNbSm; iSm++) {
570 for (Int_t iRpc = 0; iRpc < iNbRpc; iRpc++) {
577 for (Int_t iTrg = 0; iTrg <
iNTrg; iTrg++)
578 fvCPDelTof[iSmType][iSm * iNbRpc + iRpc][iBx][iTrg] = 0.;
582 fvCPTOff[iSmType][iSm * iNbRpc + iRpc].resize(iNbChan);
583 fvCPTotGain[iSmType][iSm * iNbRpc + iRpc].resize(iNbChan);
584 fvCPWalk[iSmType][iSm * iNbRpc + iRpc].resize(iNbChan);
586 for (Int_t iCh = 0; iCh < iNbChan; iCh++) {
587 fvCPTOff[iSmType][iSm * iNbRpc + iRpc][iCh].resize(nbSide);
588 fvCPTotGain[iSmType][iSm * iNbRpc + iRpc][iCh].resize(nbSide);
589 fvCPWalk[iSmType][iSm * iNbRpc + iRpc][iCh].resize(nbSide);
590 for (Int_t iSide = 0; iSide < nbSide; iSide++) {
591 fvCPTOff[iSmType][iSm * iNbRpc + iRpc][iCh][iSide] = 0.;
592 fvCPTotGain[iSmType][iSm * iNbRpc + iRpc][iCh][iSide] = 1.;
595 fvCPWalk[iSmType][iSm * iNbRpc + iRpc][iCh][iSide][iWx] = 0.;
603 LOG(info) <<
"CbmTofSimpClusterizer::InitCalibParameter: defaults set";
607 TFile* oldFile = gFile;
608 TDirectory* oldDir = gDirectory;
611 LOG(info) <<
"CbmTofSimpClusterizer::InitCalibParameter: read histos from "
619 LOG(error) <<
"CbmTofSimpClusterizer::InitCalibParameter: "
629 for (Int_t iSmType = 0; iSmType < iNbSmTypes; iSmType++) {
632 for (Int_t iSm = 0; iSm < iNbSm; iSm++)
633 for (Int_t iRpc = 0; iRpc < iNbRpc; iRpc++) {
635 (TH2F*) gDirectory->FindObjectAny(Form(
"cl_CorSmT%01d_sm%03d_rpc%03d_Pos_pfx", iSmType, iSm, iRpc));
636 TH2F* htempTOff_pfx =
637 (TH2F*) gDirectory->FindObjectAny(Form(
"cl_CorSmT%01d_sm%03d_rpc%03d_TOff_pfx", iSmType, iSm, iRpc));
639 (TH2F*) gDirectory->FindObjectAny(Form(
"cl_CorSmT%01d_sm%03d_rpc%03d_Tot_pfx", iSmType, iSm, iRpc));
640 if (NULL != htempPos_pfx && NULL != htempTOff_pfx && NULL != htempTot_pfx) {
642 Int_t iNbinTot = htempTot_pfx->GetNbinsX();
643 for (Int_t iCh = 0; iCh < iNbCh; iCh++) {
644 Double_t YMean = ((TProfile*) htempPos_pfx)->GetBinContent(iCh + 1);
645 Double_t TMean = ((TProfile*) htempTOff_pfx)->GetBinContent(iCh + 1);
647 fvCPTOff[iSmType][iSm * iNbRpc + iRpc][iCh][0] += -dTYOff + TMean;
648 fvCPTOff[iSmType][iSm * iNbRpc + iRpc][iCh][1] += +dTYOff + TMean;
650 Double_t TotMean = ((TProfile*) htempTot_pfx)->GetBinContent(iCh + 1);
655 LOG(debug1) <<
"CbmTofSimpClusterizer::InitCalibParameter:"
656 <<
" SmT " << iSmType <<
" Sm " << iSm <<
" Rpc " << iRpc <<
" Ch " << iCh <<
": YMean "
657 << YMean <<
", TMean " << TMean <<
" -> " <<
fvCPTOff[iSmType][iSm * iNbRpc + iRpc][iCh][0]
658 <<
", " <<
fvCPTOff[iSmType][iSm * iNbRpc + iRpc][iCh][1] <<
", "
659 <<
fvCPTotGain[iSmType][iSm * iNbRpc + iRpc][iCh][0] <<
", NbinTot " << iNbinTot;
661 TH1D* htempWalk0 = (TH1D*) gDirectory->FindObjectAny(
662 Form(
"Cor_SmT%01d_sm%03d_rpc%03d_Ch%03d_S0_Walk_px", iSmType, iSm, iRpc, iCh));
663 TH1D* htempWalk1 = (TH1D*) gDirectory->FindObjectAny(
664 Form(
"Cor_SmT%01d_sm%03d_rpc%03d_Ch%03d_S1_Walk_px", iSmType, iSm, iRpc, iCh));
665 if (NULL != htempWalk0 && NULL != htempWalk1) {
666 LOG(info) <<
"Initialize Walk correction for "
667 << Form(
" SmT%01d_sm%03d_rpc%03d_Ch%03d", iSmType, iSm, iRpc, iCh);
669 LOG(error) <<
"CbmTofSimpClusterizer::InitCalibParameter: "
670 "Inconsistent Walk histograms";
672 fvCPWalk[iSmType][iSm * iNbRpc + iRpc][iCh][0][iBin] = htempWalk0->GetBinContent(iBin + 1);
673 fvCPWalk[iSmType][iSm * iNbRpc + iRpc][iCh][1][iBin] = htempWalk1->GetBinContent(iBin + 1);
674 LOG(debug1) << Form(
" SmT%01d_sm%03d_rpc%03d_Ch%03d bin %d walk %f ", iSmType, iSm, iRpc, iCh, iBin,
675 fvCPWalk[iSmType][iSm * iNbRpc + iRpc][iCh][0][iBin]);
681 LOG(error) <<
" Histos " << Form(
"cl_SmT%01d_sm%03d_rpc%03d_XXX", iSmType, iSm, iRpc) <<
" not found. ";
683 for (Int_t iTrg = 0; iTrg <
iNTrg; iTrg++) {
684 TH1D* htmpDelTof = (TH1D*) gDirectory->FindObjectAny(
685 Form(
"cl_CorSmT%01d_sm%03d_rpc%03d_Trg%02d_DelTof", iSmType, iSm, iRpc, iTrg));
686 if (NULL == htmpDelTof) {
687 LOG(info) <<
" Histos " << Form(
"cl_CorSmT%01d_sm%03d_rpc%03d_Trg%02d_DelTof", iSmType, iSm, iRpc, iTrg)
691 LOG(info) <<
" Load DelTof from histos "
692 << Form(
"cl_CorSmT%01d_sm%03d_rpc%03d_Trg%02d_DelTof", iSmType, iSm, iRpc, iTrg) <<
".";
694 fvCPDelTof[iSmType][iSm * iNbRpc + iRpc][iBx][iTrg] += htmpDelTof->GetBinContent(iBx + 1);
698 TDirectory* curdir = gDirectory;
699 gDirectory->cd(oldDir->GetPath());
701 (TH1D*) htmpDelTof->Clone(Form(
"cl_CorSmT%01d_sm%03d_rpc%03d_Trg%02d_DelTof", iSmType, iSm, iRpc, iTrg));
703 LOG(info) <<
" copy histo " << h1DelTof->GetName() <<
" to directory " << oldDir->GetName();
705 gDirectory->cd(curdir->GetPath());
715 LOG(info) <<
"CbmTofSimpClusterizer::InitCalibParameter: initialization done";
816 TDirectory* oldir = gDirectory;
819 new TH1I(
"TofSimpClus_ClustBuildTime",
"Time needed to build clusters in each event; Time [s]", 4000, 0.0, 4.0);
821 "Mean Number of TofHit per Mc Track; Nb TofHits/Nb MC Tracks []", 2000, 0.0, 20.0);
824 "Distribution of the Number of MCPoints associated "
825 "to each TofHit; Nb MCPoint []",
829 "Time resolution for TofHits containing Digis from a single MC "
830 "Track; t(1st Mc Point) -tTofHit [ns]",
833 "Time resolution for TofHits containing Digis from a single MC "
834 "Track; (1st Mc Point) -tTofHit [ns]",
835 5000, -25.0, 25.0, 6, 0, 6);
837 "Time resolution for TofHits containing Digis from a single MC "
838 "Track; t(1st Mc Point) -tTofHit [ps]",
839 2000, 0.0, 50000.0, 2000, 0.0, 50000.0);
843 "Time resolution for TofHits containing Digis from a single "
844 "TofPoint; tMcPoint -tTofHit [ns]",
847 "Time resolution for TofHits containing Digis from a single "
848 "TofPoint; tMcPoint -tTofHit [ns]",
849 5000, -25.0, 25.0, 6, 0, 6);
851 "Time resolution for TofHits containing Digis "
852 "from a single TofPoint; tMcPoint -tTofHit [ps]",
853 2000, 0.0, 50000.0, 2000, 0.0, 50000.0);
856 new TH1I(
"TofSimpClus_ClusterSize",
"Cluster Size distribution; Cluster Size [Strips]", 100, 0.5, 100.5);
858 new TH2I(
"TofSimpClus_ClusterSizeType",
859 "Cluster Size distribution in each (SM type, Rpc) pair; Cluster "
860 "Size [Strips]; 10*SM Type + Rpc Index []",
864 "Number of MC tracks generating the cluster; MC Tracks multiplicity []", 100, 0.5, 100.5);
866 "Cluster Size distribution as function of Number of MC tracks generating "
867 "the cluster; Cluster Size [Strips]; MC tracks mul. []",
868 100, 0.5, 100.5, 100, 0.5, 100.5);
870 "Position of Clusters with only 1 MC tracks "
871 "generating the cluster; X [cm]; Y [cm]",
872 1500, -750, 750, 1000, -500, 500);
874 "Position of Clusters with >1 MC tracks "
875 "generating the cluster; X [cm]; Y [cm]",
876 1500, -750, 750, 1000, -500, 500);
878 new TH2D(
"TofSimpClus_AllTrkMulPos",
"Position of all clusters generating the cluster; X [cm]; Y [cm]", 1500,
879 -750, 750, 1000, -500, 500);
881 "Probability of having a cluster with multiple tracks as "
882 "function of position; X [cm]; Y [cm]; Prob. [%]",
883 1500, -750, 750, 1000, -500, 500);
887 "Space difference along channel direction between Digi pairs on "
888 "adjacent channels; PosCh i - Pos Ch i+1 [cm]",
891 "Time difference between Digi pairs on adjacent channels; "
892 "0.5*(tDigiA + tDigiA)chi - 0.5*(tDigiA + tDigiA)chi+1 [ns]",
895 "Distance between Digi pairs on adjacent channels; PosCh i - Pos Ch i+1 "
896 "[cm along ch]; 0.5*(tDigiA + tDigiA)chi - 0.5*(tDigiA + tDigiA)chi+1 [ns]",
897 5000, -10.0, 10.0, 2000, -5.0, 5.0);
900 "Position difference between Point and Hit as function of Cluster "
901 "Size; Cluster Size [Strips]; dX [cm]",
902 100, 0.5, 100.5, 500, -50, 50);
904 "Position difference between Point and Hit as function of Cluster "
905 "Size; Cluster Size [Strips]; dY [cm]",
906 100, 0.5, 100.5, 500, -50, 50);
908 "Position difference between Point and Hit as "
909 "function of Channel dif; Ch Dif [Strips]; dX [cm]",
910 101, -50.5, 50.5, 500, -50, 50);
912 "Position difference between Point and Hit as "
913 "function of Channel Dif; Ch Dif [Strips]; dY [cm]",
914 101, -50.5, 50.5, 500, -50, 50);
917 "How many time per event the 2 digis on a channel "
918 "were of the same side ; Counts/Event []",
920 fhNbDigiPerChan =
new TH1I(
"TofSimpClus_NbDigiPerChan",
"Nb of Digis per channel; Nb Digis []", 100, 0.0, 100.0);
922 gDirectory->cd(oldir->GetPath());
1112 Double_t dEventTime = 0.;
1127 LOG(debug) <<
" BuildCluster with MaxTimeDist " << dMaxTimeDist <<
", MaxSpaceDist " << dMaxSpaceDist;
1136 LOG(debug) <<
"Number of TOF digis: " << nDigis;
1139 UInt_t digiIndex = -1;
1140 for (Int_t iDigi = 0; iDigi < nDigis; iDigi++) {
1145 LOG(debug1) <<
"CbmTofSimpClusterizer::BuildClusters: " << digiIndex <<
" " << pDigi <<
" " << pDigi->
GetType()
1147 << Form(
"T %6.2f, Tot %6.1f ", pDigi->
GetTime(), pDigi->
GetTot());
1158 .push_back(digiIndex);
1171 Int_t iWx = (Int_t)((pDigi->
GetTot() -
TOTMin / 2.) / dTotBinSize);
1172 if (0 > iWx) iWx = 0;
1174 Double_t dDTot = (pDigi->
GetTot() -
TOTMin / 2.) / dTotBinSize - (Double_t) iWx - 0.5;
1200 LOG(info) <<
"CbmTofSimpClusterizer::BuildClusters: CalDigi " << digiIndex <<
", T " << pDigi->
GetType()
1206 <<
", Walk " << iWx <<
": "
1210 LOG(info) <<
" dDTot " << dDTot <<
" BinSize: " << dTotBinSize <<
", CPWalk "
1219 <<
" -> dWT = " << dWT;
1223 LOG(debug) <<
"CbmTofSimpBeamClusterizer::BuildClusters: Skip Digi "
1250 Double_t dWeightedTime = 0.0;
1251 Double_t dWeightedPosX = 0.0;
1252 Double_t dWeightedPosY = 0.0;
1253 Double_t dWeightedPosZ = 0.0;
1254 Double_t dWeightedTimeErr = 0.0;
1255 Double_t dWeightsSum = 0.0;
1256 std::vector<CbmTofPoint*>
vPtsRef;
1259 Int_t iTrafoCell = -1;
1260 Int_t iNbChanInHit = 0;
1262 Int_t iLastChan = -1;
1264 Double_t dLastPosY = 0.0;
1265 Double_t dLastTime = 0.0;
1267 Double_t dPosX = 0.0;
1268 Double_t dPosY = 0.0;
1269 Double_t dPosZ = 0.0;
1270 Double_t dTime = 0.0;
1271 Double_t dTotS = 0.0;
1275 gGeoManager->CdTop();
1277 for (Int_t iSmType = 0; iSmType < iNbSmTypes; iSmType++) {
1280 for (Int_t iSm = 0; iSm < iNbSm; iSm++)
1281 for (Int_t iRpc = 0; iRpc < iNbRpc; iRpc++) {
1284 LOG(debug2) <<
"CbmTofSimpClusterizer::BuildClusters: RPC - Loop "
1285 << Form(
" %3d %3d %3d %3d ", iSmType, iSm, iRpc, iChType);
1290 dWeightedTime = 0.0;
1291 dWeightedPosX = 0.0;
1292 dWeightedPosY = 0.0;
1293 dWeightedPosZ = 0.0;
1294 dWeightedTimeErr = 0.0;
1305 LOG(debug2) <<
"CbmTofSimpClusterizer::BuildClusters: ChanOrient "
1314 for (Int_t iCh = 0; iCh < iNbCh; iCh++) {
1315 LOG(debug3) <<
"CbmTofSimpClusterizer::BuildClusters: VDigisize"
1316 << Form(
" T %3d Sm %3d R %3d Ch %3d Size %3zu ", iSmType, iSm, iRpc, iCh,
1322 LOG(debug2) <<
"CbmTofSimpClusterizer::BuildClusters: digis processing "
1324 << Form(
" SmT %3d Sm %3d Rpc %3d Ch %3d # %3zu ", iSmType, iSm, iRpc, iCh,
1333 while ((
fStorDigiExp[iSmType][iSm * iNbRpc + iRpc][iCh][0])->GetSide()
1334 == (
fStorDigiExp[iSmType][iSm * iNbRpc + iRpc][iCh][1])->GetSide()) {
1337 LOG(debug) <<
"CbmTofSimpClusterizer::BuildClusters: SameSide Hits! "
1339 << (
fStorDigiExp[iSmType][iSm * iNbRpc + iRpc][iCh][0])->GetTime() <<
", "
1340 << (
fStorDigiExp[iSmType][iSm * iNbRpc + iRpc][iCh][1])->GetTime() <<
", DeltaT "
1341 << (
fStorDigiExp[iSmType][iSm * iNbRpc + iRpc][iCh][1])->GetTime()
1342 - (
fStorDigiExp[iSmType][iSm * iNbRpc + iRpc][iCh][0])->GetTime();
1343 LOG(debug2) <<
" SameSide Erase fStor entries(d) " << iSmType <<
", SR " << iSm * iNbRpc + iRpc
1346 fStorDigiExp[iSmType][iSm * iNbRpc + iRpc][iCh].begin());
1348 fStorDigiInd[iSmType][iSm * iNbRpc + iRpc][iCh].begin());
1353 LOG(debug2) <<
"CbmTofSimpClusterizer::BuildClusters: digis processing "
1355 << Form(
" SmT %3d Sm %3d Rpc %3d Ch %3d # %3zu ", iSmType, iSm, iRpc, iCh,
1370 LOG(error) <<
"CbmTofSimpClusterizer::BuildClusters: no "
1372 << Form(
" %3d %3d %3d %3d 0x%08x 0x%08x ", iSmType, iSm, iRpc, iCh, iChId, iUCellId);
1375 LOG(debug1) <<
"CbmTofSimpClusterizer::BuildClusters:"
1376 << Form(
" T %3d Sm %3d R %3d Ch %3d size %3zu ", iSmType, iSm, iRpc, iCh,
1378 << Form(
" ChId: 0x%08x 0x%08x %p", iChId, iUCellId,
fChannelInfo);
1401 if (NULL == fTrafoCell) {
1407 LOG(debug1) << Form(
" Node at (%6.1f,%6.1f,%6.1f) : %p, info %p, %p",
fChannelInfo->
GetX(),
1432 fStorDigiExp[iSmType][iSm * iNbRpc + iRpc][iCh].begin());
1434 fStorDigiInd[iSmType][iSm * iNbRpc + iRpc][iCh].begin());
1438 LOG(debug1) <<
"CbmTofSimpClusterizer::BuildClusters: NbChanInHit"
1439 << Form(
" %3d %3d %3d %p %2.0f Time %6.1f PosY %5.1f Svel "
1441 iNbChanInHit, iCh, iLastChan, xDigiA, xDigiA->
GetSide(), dTime, dPosY,
1443 << Form(
", Offs %5.1f, %5.1f",
fvCPTOff[iSmType][iSm * iNbRpc + iRpc][iCh][0],
1444 fvCPTOff[iSmType][iSm * iNbRpc + iRpc][iCh][1]);
1447 if (0 < iNbChanInHit) {
1450 if (iLastChan == iCh - 1) {
1458 if (TMath::Abs(dTime - dLastTime) < dMaxTimeDist && iLastChan == iCh - 1
1459 && TMath::Abs(dPosY - dLastPosY) < dMaxSpaceDist) {
1461 dWeightedTime += dTime * dTotS;
1462 dWeightedPosX += dPosX * dTotS;
1463 dWeightedPosY += dPosY * dTotS;
1464 dWeightedPosZ += dPosZ * dTotS;
1465 dWeightedTimeErr += dTotS * dTotS;
1466 dWeightsSum += dTotS;
1503 LOG(debug1) <<
" Add Digi and erase fStor entries(a): NbChanInHit " << iNbChanInHit <<
", "
1504 << iSmType <<
", SR " << iSm * iNbRpc + iRpc <<
", Ch" << iCh;
1507 fStorDigiExp[iSmType][iSm * iNbRpc + iRpc][iCh].begin());
1509 fStorDigiExp[iSmType][iSm * iNbRpc + iRpc][iCh].begin());
1511 fStorDigiInd[iSmType][iSm * iNbRpc + iRpc][iCh].begin());
1513 fStorDigiInd[iSmType][iSm * iNbRpc + iRpc][iCh].begin());
1518 dWeightedTime /= dWeightsSum;
1519 dWeightedPosX /= dWeightsSum;
1520 dWeightedPosY /= dWeightsSum;
1521 dWeightedPosZ /= dWeightsSum;
1527 Double_t hitpos_local[3];
1531 gGeoManager->FindNode(fTrafoCell->
GetX(), fTrafoCell->
GetY(), fTrafoCell->
GetZ());
1532 TGeoNode* cNode = gGeoManager->GetCurrentNode();
1534 TGeoRotation rotMatrix(*gGeoManager->GetCurrentMatrix());
1536 hitpos[0] = fTrafoCell->
GetX();
1537 hitpos[1] = fTrafoCell->
GetY();
1538 hitpos[2] = fTrafoCell->
GetZ();
1539 gGeoManager->MasterToLocal(hitpos, hitpos_local);
1540 LOG(debug1) << Form(
" Node0 at (%6.1f,%6.1f,%6.1f) : "
1541 "(%6.1f,%6.1f,%6.1f) pointer %p",
1543 hitpos_local[0], hitpos_local[1], hitpos_local[2], tNode);
1545 hitpos_local[0] += dWeightedPosX;
1546 hitpos_local[1] += dWeightedPosY;
1547 hitpos_local[2] += dWeightedPosZ;
1549 gGeoManager->LocalToMaster(hitpos_local, hitpos);
1550 LOG(debug1) << Form(
" LTM for node %p, info %p: "
1551 "(%6.1f,%6.1f,%6.1f) ->(%6.1f,%6.1f,%6.1f)",
1552 cNode,
fChannelInfo, hitpos_local[0], hitpos_local[1], hitpos_local[2],
1553 hitpos[0], hitpos[1], hitpos[2]);
1555 TVector3 hitPos(hitpos[0], hitpos[1], hitpos[2]);
1560 Double_t hiterr_local[3];
1568 / TMath::Sqrt(12.0);
1570 rotMatrix.LocalToMaster(hiterr_local, hiterr);
1572 TVector3 hitPosErr(fabs(hiterr[0]), fabs(hiterr[1]), fabs(hiterr[2]));
1578 if (iChm < 0 || iChm > iNbCh) {
1579 LOG(debug) <<
"CbmTofSimpClusterizer::BuildClusters: "
1580 "Invalid mean channel";
1585 LOG(debug) <<
"CbmTofSimpClusterizer::BuildClusters: Save Hit "
1586 << Form(
" %3d %3d 0x%08x %3d %3d %3d %f %f",
fiNbHits, iNbChanInHit, iDetId, iCh,
1587 iLastChan, iRefId, dWeightedTime, dWeightedPosY)
1588 <<
", DigiSize: " <<
vDigiIndRef.size() <<
", DigiInds: ";
1596 new ((*fTofHitsColl)[hitIndex])
1610 new ((*fTofDigiMatchColl)[hitIndex])
CbmMatch(*digiMatch);
1620 fvdX[iSmType][iRpc].push_back(dWeightedPosX);
1621 fvdY[iSmType][iRpc].push_back(dWeightedPosY);
1631 dWeightedTime = dTime * dTotS;
1632 dWeightedPosX = dPosX * dTotS;
1633 dWeightedPosY = dPosY * dTotS;
1634 dWeightedPosZ = dPosZ * dTotS;
1635 dWeightedTimeErr = dTotS * dTotS;
1636 dWeightsSum = dTotS;
1641 LOG(debug4) <<
" Next fStor Digi " << iSmType <<
", SR " << iSm * iNbRpc + iRpc <<
", Ch" << iCh
1642 <<
", Dig0 " << (
fStorDigiInd[iSmType][iSm * iNbRpc + iRpc][iCh][0]) <<
", Dig1 "
1643 << (
fStorDigiInd[iSmType][iSm * iNbRpc + iRpc][iCh][1]);
1647 LOG(debug3) <<
" Erase fStor entries(b) " << iSmType <<
", SR " << iSm * iNbRpc + iRpc <<
", Ch"
1650 fStorDigiExp[iSmType][iSm * iNbRpc + iRpc][iCh].begin());
1652 fStorDigiExp[iSmType][iSm * iNbRpc + iRpc][iCh].begin());
1654 fStorDigiInd[iSmType][iSm * iNbRpc + iRpc][iCh].begin());
1656 fStorDigiInd[iSmType][iSm * iNbRpc + iRpc][iCh].begin());
1672 LOG(debug1) <<
"CbmTofSimpClusterizer::BuildClusters: 1.Hit on "
1674 << iCh <<
", time: " << dTime <<
", x: " << dPosX <<
", y: " << dPosY
1675 <<
", Tot: " << dTotS;
1678 dWeightedTime = dTime * dTotS;
1679 dWeightedPosX = dPosX * dTotS;
1680 dWeightedPosY = dPosY * dTotS;
1681 dWeightedPosZ = dPosZ * dTotS;
1682 dWeightedTimeErr = dTotS * dTotS;
1683 dWeightsSum = dTotS;
1691 LOG(debug2) <<
" Erase fStor entries(c) " << iSmType <<
", SR " << iSm * iNbRpc + iRpc <<
", Ch"
1694 fStorDigiExp[iSmType][iSm * iNbRpc + iRpc][iCh].begin());
1696 fStorDigiExp[iSmType][iSm * iNbRpc + iRpc][iCh].begin());
1698 fStorDigiInd[iSmType][iSm * iNbRpc + iRpc][iCh].begin());
1700 fStorDigiInd[iSmType][iSm * iNbRpc + iRpc][iCh].begin());
1719 fStorDigiExp[iSmType][iSm * iNbRpc + iRpc][iCh].clear();
1720 fStorDigiInd[iSmType][iSm * iNbRpc + iRpc][iCh].clear();
1722 LOG(debug2) <<
"CbmTofSimpClusterizer::BuildClusters: finished V-RPC"
1723 << Form(
" %3d %3d %3d %d", iSmType, iSm, iRpc,
fTofHitsColl->GetEntriesFast());
1727 LOG(fatal) <<
"CbmTofSimpClusterizer::BuildClusters => Cluster building "
1728 <<
"from digis to hits not implemented for pads, Sm type " << iSmType <<
" Rpc " << iRpc;
1729 return std::make_pair(0, 0);
1734 if (0 < iNbChanInHit) {
1735 LOG(debug1) <<
"CbmTofSimpClusterizer::BuildClusters: Process cluster " << iNbChanInHit;
1739 LOG(debug1) <<
"CbmTofSimpClusterizer::BuildClusters: H-Hit ";
1742 LOG(debug2) <<
"CbmTofSimpClusterizer::BuildClusters: V-Hit ";
1744 dWeightedTime /= dWeightsSum;
1745 dWeightedPosX /= dWeightsSum;
1746 dWeightedPosY /= dWeightsSum;
1747 dWeightedPosZ /= dWeightsSum;
1753 Double_t hitpos_local[3];
1757 gGeoManager->FindNode(fTrafoCell->
GetX(), fTrafoCell->
GetY(), fTrafoCell->
GetZ());
1759 gGeoManager->GetCurrentNode();
1761 TGeoRotation rotMatrix(*gGeoManager->GetCurrentMatrix());
1763 hitpos[0] = fTrafoCell->
GetX();
1764 hitpos[1] = fTrafoCell->
GetY();
1765 hitpos[2] = fTrafoCell->
GetZ();
1766 gGeoManager->MasterToLocal(hitpos, hitpos_local);
1767 LOG(debug1) << Form(
" Node0 at (%6.1f,%6.1f,%6.1f) : (%6.1f,%6.1f,%6.1f)",
fChannelInfo->
GetX(),
1771 hitpos_local[0] += dWeightedPosX;
1772 hitpos_local[1] += dWeightedPosY;
1773 hitpos_local[2] += dWeightedPosZ;
1775 gGeoManager->LocalToMaster(hitpos_local, hitpos);
1776 LOG(debug1) << Form(
" LTM for V-node %p, info %p, tra %p: (%6.1f,%6.1f,%6.1f) "
1777 "->(%6.1f,%6.1f,%6.1f) [(%6.1f,%6.1f,%6.1f)]",
1778 tNode,
fChannelInfo, fTrafoCell, hitpos_local[0], hitpos_local[1], hitpos_local[2],
1779 hitpos[0], hitpos[1], hitpos[2], fTrafoCell->
GetX(), fTrafoCell->
GetY(),
1780 fTrafoCell->
GetZ());
1782 TVector3 hitPos(hitpos[0], hitpos[1], hitpos[2]);
1786 Double_t hiterr_local[3];
1789 hiterr_local[0] = fTrafoCell->
GetSizex() / TMath::Sqrt(12.0);
1793 / TMath::Sqrt(12.0);
1795 rotMatrix.LocalToMaster(hiterr_local, hiterr);
1797 TVector3 hitPosErr(fabs(hiterr[0]), fabs(hiterr[1]), fabs(hiterr[2]));
1818 if (iChm < 0 || iChm > iNbCh) {
1819 LOG(debug) <<
"CbmTofSimpClusterizer::BuildClusters: Invalid "
1821 << iChm <<
"(" << iNbCh <<
")";
1826 LOG(debug) <<
"CbmTofSimpClusterizer::BuildClusters: Save V-Hit "
1828 << Form(
" %3d %3d %3d %3d %3d ",
fiNbHits, iNbChanInHit, iDetId, iLastChan,
1832 LOG(debug) <<
", DigiInds: ";
1841 new ((*fTofHitsColl)[hitIndex])
1852 new ((*fTofDigiMatchColl)[hitIndex])
CbmMatch(*digiMatch);
1862 fvdX[iSmType][iRpc].push_back(dWeightedPosX);
1863 fvdY[iSmType][iRpc].push_back(dWeightedPosY);
1873 LOG(debug4) <<
" Fini-A " << Form(
" %3d %3d %3d ", iSmType, iSm, iRpc);
1875 LOG(debug3) <<
" Fini-B " << Form(
" %3d ", iSmType);
1879 LOG(error) <<
" Compressed Digis not implemented ... ";
1881 return std::make_pair(nDigis, nHits);