165 return StatusCode::FAILURE;
177 ATH_MSG_ERROR(
"m_pGeometryReader: unable to record to StoreGate");
195 return StatusCode::SUCCESS;
203 std::list<eRPotName>::const_iterator iterRPName;
206 std::list<MDHIT> ListMDHits;
207 std::list<ODHIT> ListODHits;
231 return StatusCode::SUCCESS;
238 return StatusCode::SUCCESS;
249 std::string strAlgoMD;
255 eRPName = *iterRPName;
268 std::string strAlgoOD;
274 eRPName = *iterRPName;
321 return StatusCode::SUCCESS;
331 return StatusCode::SUCCESS;
364 if(
sc.isFailure() || !mcGen)
366 return StatusCode::FAILURE;
372 for(;mcGenBeg!=mcGenEnd;++mcGenBeg)
376 MDHit.
iRPot = ((*mcGenBeg)->getStation());
377 MDHit.
iPlate = ((*mcGenBeg)->getPlate());
378 MDHit.
iFiber = ((*mcGenBeg)->getFiber());
380 ListMDHits.push_back(MDHit);
384 if(
sc.isFailure() || !mcODGen)
386 return StatusCode::FAILURE;
392 for(;mcODGenBeg!=mcODGenEnd;++mcODGenBeg)
395 ODHit.
iRPot = ((*mcODGenBeg)->getStation());
396 ODHit.
iPlate = ((*mcODGenBeg)->getPlate());
397 ODHit.
iSide = ((*mcODGenBeg)->getSide());
398 ODHit.
iFiber = ((*mcODGenBeg)->getFiber());
400 ListODHits.push_back(ODHit);
405 return StatusCode::SUCCESS;
412 Int_t nPlateID, nFiberID;
417 std::list<eRPotName>::const_iterator iterRPName;
432 eRPName = *iterRPName;
442 m_faMD[eRPName-1][2*nPlateID+1][nFiberID] = FiberParams.
fSlope;
443 m_fbMD[eRPName-1][2*nPlateID+1][nFiberID] = FiberParams.
fOffset;
444 m_fzMD[eRPName-1][2*nPlateID+1][nFiberID] = FiberParams.
fZPos;
455 m_faMD[eRPName-1][2*nPlateID][nFiberID] = FiberParams.
fSlope;
456 m_fbMD[eRPName-1][2*nPlateID][nFiberID] = FiberParams.
fOffset;
457 m_fzMD[eRPName-1][2*nPlateID][nFiberID] = FiberParams.
fZPos;
469 for (nPlateID = 0; nPlateID <
ODPLATESCNT; nPlateID++)
471 for (nFiberID = 0; nFiberID <
ODFIBERSCNT; nFiberID++)
476 m_faOD[eRPName-1][nPlateID][0][nFiberID+15] = FiberParams.
fSlope;
477 m_fbOD[eRPName-1][nPlateID][0][nFiberID+15] = FiberParams.
fOffset;
478 m_fzOD[eRPName-1][nPlateID][0][nFiberID+15] = FiberParams.
fZPos;
488 m_faOD[eRPName-1][nPlateID][0][nFiberID] = FiberParams.
fSlope;
489 m_fbOD[eRPName-1][nPlateID][0][nFiberID] = FiberParams.
fOffset;
490 m_fzOD[eRPName-1][nPlateID][0][nFiberID] = FiberParams.
fZPos;
502 m_faOD[eRPName-1][nPlateID][1][14-nFiberID] = FiberParams.
fSlope;
503 m_fbOD[eRPName-1][nPlateID][1][14-nFiberID] = FiberParams.
fOffset;
504 m_fzOD[eRPName-1][nPlateID][1][14-nFiberID] = FiberParams.
fZPos;
508 m_faOD[eRPName-1][nPlateID][1][nFiberID+15] = FiberParams.
fSlope;
509 m_fbOD[eRPName-1][nPlateID][1][nFiberID+15] = FiberParams.
fOffset;
510 m_fzOD[eRPName-1][nPlateID][1][nFiberID+15] = FiberParams.
fZPos;
523 m_faOD[eRPName-1][nPlateID][1][29-nFiberID] = FiberParams.
fSlope;
524 m_fbOD[eRPName-1][nPlateID][1][29-nFiberID] = FiberParams.
fOffset;
525 m_fzOD[eRPName-1][nPlateID][1][29-nFiberID] = FiberParams.
fZPos;
529 m_faOD[eRPName-1][nPlateID][1][nFiberID] = FiberParams.
fSlope;
530 m_fbOD[eRPName-1][nPlateID][1][nFiberID] = FiberParams.
fOffset;
531 m_fzOD[eRPName-1][nPlateID][1][nFiberID] = FiberParams.
fZPos;
552 ATH_MSG_DEBUG(
"begin ALFA_LocRec::StoreReconstructionGeometry()");
554 Int_t iLayer, iFiber, iPlate, iSide;
555 Float_t fParamB, fZ, fSlope;
558 pFile = fopen(szDataDestination,
"w");
559 if(pFile==NULL)
return false;
560 fprintf(pFile,
"xxxxxxxxxxxxxxxxxxx\n");
563 fprintf(pFile,
"20\n");
568 fSlope=
m_faMD[eRPName-1][iLayer][iFiber];
569 fParamB=
m_fbMD[eRPName-1][iLayer][iFiber];
570 fZ=
m_fzMD[eRPName-1][iLayer][iFiber];
572 fprintf(pFile,
" %2d %2d %7.5f %7.4f %7.3f\n", iLayer+1, iFiber+1, fSlope, fParamB, fZ);
578 fprintf(pFile,
"6\n");
585 fSlope=
m_faOD[eRPName-1][iPlate][iSide][iFiber];
586 fParamB=
m_fbOD[eRPName-1][iPlate][iSide][iFiber];
587 fZ=
m_fzOD[eRPName-1][iPlate][iSide][iFiber];
589 fprintf(pFile,
" %2d %2d %7.5f %7.4f %7.3f\n", (2*iPlate+iSide+1), iFiber+1, fSlope, fParamB, fZ);
596 ATH_MSG_DEBUG(
"end ALFA_LocRec::StoreReconstructionGeometry()");
608 std::list<eRPotName>::const_iterator iterRPName;
618 ATH_MSG_DEBUG(
"The ALFA Fiber geometry was stored in the "<<szFilename<<
" file");
623 ATH_MSG_DEBUG(
"The ALFA Fiber geometry was stored in the "<<szFilename<<
" file");
628 ATH_MSG_DEBUG(
"The ALFA Fiber geometry was stored in the "<<szFilename<<
" file");
642 ATH_MSG_DEBUG(
"The ODFiber geometry was stored in the "<<szFilename<<
" file");
647 ATH_MSG_DEBUG(
"The ODFiber geometry was stored in the "<<szFilename<<
" file");
652 ATH_MSG_DEBUG(
"The ODFiber geometry was stored in the "<<szFilename<<
" file");
670 std::list<ODRESULT> listODResults;
671 listODResults.clear();
672 Float_t fRecPosX = -9999.0;
673 Float_t fRecPosY = -9999.0;
675 std::map<string, int> mapRecoMethods;
676 mapRecoMethods.clear();
677 mapRecoMethods.insert(std::pair<string, int>(
"ODTracking", 1));
678 mapRecoMethods.insert(std::pair<string, int>(
"MDTracking", 2));
679 mapRecoMethods.insert(std::pair<string, int>(
"MDOverlap", 3));
680 mapRecoMethods.insert(std::pair<string, int>(
"CenterGravity", 4));
681 mapRecoMethods.insert(std::pair<string, int>(
"MDMultiple", 5));
682 mapRecoMethods.insert(std::pair<string, int>(
"HalfReco", 6));
683 mapRecoMethods.insert(std::pair<string, int>(
"MDGap", 7));
684 mapRecoMethods.insert(std::pair<string, int>(
"EdgeMethod", 8));
686 std::vector<int> vecFibSel;
689 switch(mapRecoMethods[strAlgo])
699 std::list<ODRESULT>::const_iterator iter;
700 for(iter=listODResults.begin(); iter!=listODResults.end(); ++iter)
702 ODResults.
iSide = (*iter).iSide;
703 ODResults.
fRecPos = (*iter).fRecPos;
704 ODResults.
fOverY = (*iter).fOverY;
705 ODResults.
iNumY = (*iter).iNumY;
707 if ((ODResults.
fRecPos != -9999.0))
710 std::fill_n(&iFibSel[0][0],
sizeof(iFibSel)/
sizeof(Int_t), -9999);
716 vecFibSel.push_back(iFibSel[ODResults.
iSide][iPlate]);
730 sc = pMDTracking->
Execute(eRPName-1, ListMDHits);
731 sc = pMDTracking->
Finalize(fRecPosX, fRecPosY);
733 if (fRecPosX!=-9999.0 && fRecPosY!=-9999.0)
736 Int_t iNumU = 0, iNumV = 0;
737 Float_t fOverlapU = -9999.0, fOverlapV = -9999.0;
738 std::fill_n(&iFibSel[0],
sizeof(iFibSel)/
sizeof(Int_t), -9999);
740 pMDTracking->
GetData(iNumU, iNumV, fOverlapU, fOverlapV, iFibSel);
742 for (
int & iLayer : iFibSel)
744 vecFibSel.push_back(iLayer);
759 sc = pMDOverlap->
Finalize(fRecPosX, fRecPosY);
762 Int_t iNumU = 0, iNumV = 0;
763 Float_t fOverlapU = -9999.0, fOverlapV = -9999.0;
764 std::fill_n(&iFibSel[0],
sizeof(iFibSel)/
sizeof(Int_t), -9999);
767 if (fRecPosX!=-9999 && fRecPosY!=-9999)
770 for (
int & iLayer : iFibSel)
772 vecFibSel.push_back(iLayer);
787 sc = pCenterGravity->
Finalize(fRecPosX, fRecPosY);
790 Int_t iNumU = 0, iNumV = 0;
791 Float_t fOverlapU = -9999.0, fOverlapV = -9999.0;
792 std::fill_n(&iFibSel[0],
sizeof(iFibSel)/
sizeof(Int_t), -9999);
794 pCenterGravity->
GetData(iFibSel);
795 if (fRecPosX!=-9999 && fRecPosY!=-9999)
798 for (
int & iLayer : iFibSel)
800 vecFibSel.push_back(iLayer);
806 delete pCenterGravity;
818 sc = pMDMultiple->
Finalize(fRecPosX, fRecPosY);
822 std::fill_n(&iFibSel[0][0],
sizeof(iFibSel)/
sizeof(Int_t), -9999);
823 std::fill_n(&fOverU[0],
sizeof(fOverU)/
sizeof(Float_t), -9999.0);
824 std::fill_n(&fOverV[0],
sizeof(fOverV)/
sizeof(Float_t), -9999.0);
825 memset(&iNumU, 0,
sizeof(iNumU));
826 memset(&iNumV, 0,
sizeof(iNumV));
828 pMDMultiple->
GetData(iNumU, iNumV, fOverU, fOverV, iFibSel);
829 for (Int_t iTrack=0; iTrack<
NTRACK; iTrack++)
831 if (fRecPosX[iTrack] != -9999.0 && fRecPosY[iTrack] != -9999.0)
836 vecFibSel.push_back(iFibSel[iTrack][iLayer]);
851 Int_t iNumU[2] = {0, 0};
852 Int_t iNumV[2] = {0, 0};
855 Float_t fOverlapU[2] = {-9999, -9999};
856 Float_t fOverlapV[2] = {-9999, -9999};
857 Float_t fRecPosX[2] = {-9999, -9999};
858 Float_t fRecPosY[2] = {-9999, -9999};
861 std::fill_n(&iFibSel[0],
sizeof(iFibSel)/
sizeof(Int_t), -9999);
863 std::vector<int> vecFibSel0;
864 std::vector<int> vecFibSel1;
868 if (eRPName==1 || eRPName==3 || eRPName==6 || eRPName==8)
880 sc = pHalfReco->
Execute(eRPName-1, ListMDHits);
881 sc = pHalfReco->
Finalize(fRecPosX[0], fRecPosY[0]);
883 pHalfReco->
GetData(iNumU[0], iNumV[0], fOverlapU[0], fOverlapV[0], iFibSel);
885 for (
int & iLayer : iFibSel)
887 vecFibSel0.push_back(iLayer);
891 sc = pHalfReco->
Execute(eRPName-1, ListMDHits);
892 sc = pHalfReco->
Finalize(fRecPosX[1], fRecPosY[1]);
894 pHalfReco->
GetData(iNumU[1], iNumV[1], fOverlapU[1], fOverlapV[1], iFibSel);
896 for (
int & iLayer : iFibSel)
898 vecFibSel1.push_back(iLayer);
901 if (fRecPosX[0]!=-9999.0 && fRecPosY[0]!=-9999.0 && fRecPosX[1]!=-9999.0 && fRecPosY[1]!=-9999.0)
924 std::fill_n(&iFibSel[0],
sizeof(iFibSel)/
sizeof(Int_t), -9999);
925 std::fill_n(&fOverU[0],
sizeof(fOverU)/
sizeof(Float_t), -9999.0);
926 std::fill_n(&fOverV[0],
sizeof(fOverV)/
sizeof(Float_t), -9999.0);
928 pMDGap->
GetData(iNumU, iNumV, fOverU, fOverV, iFibSel);
929 for (Int_t iTrack=0; iTrack<
NTRACK; iTrack++)
931 if (fRecPosX[iTrack] != -9999.0 && fRecPosY[iTrack] != -9999.0)
934 for (
int & iLayer : iFibSel)
936 vecFibSel.push_back(iLayer);
957 std::fill_n(&iFibSel[0],
sizeof(iFibSel)/
sizeof(Int_t), -9999);
958 std::fill_n(&fOverU[0],
sizeof(fOverU)/
sizeof(Float_t), -9999.0);
959 std::fill_n(&fOverV[0],
sizeof(fOverV)/
sizeof(Float_t), -9999.0);
962 std::vector<ALFA_EdgeMethod::Track> tracks;
965 for (UInt_t iTrack=0; iTrack<tracks.size(); iTrack++)
967 pEdgeMethod->
selectedFibers(eRPName - 1, tracks.at(iTrack), iFibSel);
969 iNumU[iTrack] = tracks.at(iTrack).first.second;
970 iNumV[iTrack] = tracks.at(iTrack).second.second;
971 fOverU[iTrack] = tracks.at(iTrack).first.first.second;
972 fOverV[iTrack] = tracks.at(iTrack).second.first.second;
973 fRecPosX[iTrack] = 0.5*TMath::Sqrt2()*(-tracks.at(iTrack).first.first.first-tracks.at(iTrack).second.first.first);
974 fRecPosY[iTrack] = 0.5*TMath::Sqrt2()*(-tracks.at(iTrack).first.first.first+tracks.at(iTrack).second.first.first);
976 if (fRecPosX[iTrack] != -9999.0 && fRecPosY[iTrack] != -9999.0)
979 for (
int & iLayer : iFibSel)
981 vecFibSel.push_back(iLayer);
989 sc = StatusCode::SUCCESS;
995 std::cout <<
"strAlgo: " << strAlgo << std::endl;
996 return StatusCode::SUCCESS;
1021 ATH_MSG_DEBUG(
"MD - LocRecEv collection was recorded in StoreGate");
1046 ATH_MSG_DEBUG(
"OD - LocRecEv collection is recorded in StoreGate");