28 m_fOvU =
new std::vector<Float_t>();
29 m_fOvV =
new std::vector<Float_t>();
30 m_iNU =
new std::vector<Int_t>();
31 m_iNV =
new std::vector<Int_t>();
36 iLayer =
new std::vector<Int_t>();
65 m_fOvU =
new std::vector<Float_t>();
66 m_fOvV =
new std::vector<Float_t>();
67 m_iNU =
new std::vector<Int_t>();
68 m_iNV =
new std::vector<Int_t>();
79 m_iFibSel[iLayer] =
new std::vector<Int_t>(*
obj.m_iFibSel[iLayer]);
97 for (
int i = 0;
i < nLayers;
i++)
122 for (
int iLayer = 0; iLayer < nLayers; iLayer++)
125 m_iFibSel[iLayer] =
new std::vector<Int_t>();
151 if (iLayer!=
nullptr) {
delete iLayer; iLayer=
nullptr;}
167 for (Int_t iPot=0; iPot<
RPOTSCNT; iPot++)
173 m_faMD[iPot][iLayer][iFiber] = faMD[iPot][iLayer][iFiber];
174 m_fbMD[iPot][iLayer][iFiber] = fbMD[iPot][iLayer][iFiber];
181 return StatusCode::SUCCESS;
191 std::list<MDHIT>::const_iterator iter;
192 for (iter=ListMDHits.begin(); iter!=ListMDHits.end(); ++iter)
199 m_MapLayers.insert(std::pair<int, FIBERS>((*iter).iPlate, structFibers));
200 m_MapLayers[(*iter).iPlate].ListFibers.push_back((*iter).iFiber);
202 else m_MapLayers[(*iter).iPlate].ListFibers.push_back((*iter).iFiber);
207 std::vector<double> b_p, b_n;
208 std::vector<double> Ov_p, Ov_n;
209 std::vector<int> Num_p, Num_n;
211 std::vector<int> iTrackMatch[2];
232 Reco_Track(b_p, b_n, Ov_p, Ov_n, Num_p, Num_n, FSel_n, FSel_p, iTrackMatch);
237 std::vector<Int_t> MaxTrackID;
238 Int_t iTmpMaxTrackID = -1;
241 while (iCntSort<(Int_t)b_p.size())
244 for (Int_t
i=0;
i<(Int_t)b_p.size();
i++)
247 Bool_t MaxUsed=
false;
249 for (
int j : MaxTrackID)
251 if (
i==j) {MaxUsed =
true;
break;}
254 if (((Num_p[
i]+Num_n[
i])>iMaxSum) && (!MaxUsed))
256 iMaxSum = Num_p[
i]+Num_n[
i];
260 MaxTrackID.push_back(iTmpMaxTrackID);
267 for (
int i : MaxTrackID)
277 m_iNU->push_back(Num_p[
i]);
278 m_iNV->push_back(Num_n[
i]);
295 m_iFibSel[2*iPlate]->push_back(FSel_p[iPlate][
i]);
296 m_iFibSel[2*iPlate+1]->push_back(FSel_n[iPlate][
i]);
341 return StatusCode::SUCCESS;
348 Int_t iTrackNum=0, iSize=0;
349 std::fill_n(&fRecXPos[0],
sizeof(fRecXPos)/
sizeof(Float_t), -9999.0);
350 std::fill_n(&fRecYPos[0],
sizeof(fRecYPos)/
sizeof(Float_t), -9999.0);
355 for (Int_t
i=0;
i<iTrackNum;
i++)
361 return StatusCode::SUCCESS;
372 Float_t fXInter, fYInter;
378 for (
int & iBin : iOver)
407 const unsigned int thisSideLayer = iLayer*2+iSideFlag;
408 const unsigned int thisLayer = 2*iLayer+iFiberSide;
409 const std::list<int> & thisFiberContainer =
m_MapLayers[thisLayer].ListFibers;
410 for (
const auto & thisFiber:thisFiberContainer)
417 FibCen = (fYInter-fSign*fXInter)/sqrt(2.0);
420 for (Int_t iBin=0; iBin<480; iBin++)
422 iOver[(
int)((FibCen-0.24)*1000)+iBin+36000]++;
437 Float_t fXInter, fYInter;
443 for (
int & iBin : iOver)
451 for (UInt_t j=0; j<FiberHit[iLayer].size(); j++)
453 iHit = FiberHit[iLayer][j];
459 FibCen = (fYInter-fSign*fXInter)/sqrt(2.0);
462 for (Int_t iBin=0; iBin<480; iBin++)
464 iOver[(
int)((FibCen-0.24)*1000)+iBin+36000]++;
478 std::vector<int> iSizePlateau;
486 for (Int_t
i=0;
i<72000;
i++)
488 if (iOver[
i]>iNumFib) iNumFib=iOver[
i];
494 for (Int_t
i=0;
i<72000;
i++)
496 if (iOver[
i]==iNumFib)
498 iSizePlateau.push_back(
i);
503 p_min = -36.0 +
double(iSizePlateau.front())*1
e-3;
504 p_tmp_min = iSizePlateau.front();
506 p_max = -36.0 +
double(iSizePlateau.back())*1
e-3;
510 Int_t full_width = iSizePlateau.size();
512 for (Int_t
i=0;
i<full_width;
i++)
514 if (iSizePlateau[full_width-
i-1]-p_tmp_min < 500)
517 p_max = -36.0 +
double(iSizePlateau[full_width-
i-1])*1
e-3;
526 fb = fbRef+(p_min+p_max)/sqrt(2.0);
544 Float_t b_pos, b_neg;
545 Float_t
x,
y, x_tmp, y_tmp;
547 Float_t dist_x, dist_y;
563 x= (b_pos-b_neg)/2.0;
564 y= (b_neg+b_pos)/2.0;
566 for (
int & iLayer : iFSel) iLayer = 9999;
598 const unsigned int thisSideLayer = iLayer*2+iSideFlag;
599 const unsigned int thisLayer = 2*iLayer+iFiberSide;
600 const std::list<int> & thisFiberContainer =
m_MapLayers[thisLayer].ListFibers;
601 for (
const auto & thisFiber:thisFiberContainer)
603 if (thisFiber != 9999)
608 dist_x = TMath::Abs(
x-x_tmp);
609 dist_y = TMath::Abs(
y-y_tmp);
611 dist_full = sqrt(dist_x*dist_x+dist_y*dist_y);
612 fib_dist = sqrt(TMath::Power((dist_x+dist_y)/2.0,2)-TMath::Power(dist_full/2.0,2));
614 if (fib_dist <= min_dist)
617 iFSel[iLayer] = thisFiber;
659 std::vector<double> &Ov_p, std::vector<double> &Ov_n,
660 std::vector<int> &Num_p, std::vector<int> &Num_n,
662 std::vector<int> (&iTrackMatch)[2])
698 int iNumUFiberHits = 0;
699 int iNumVFiberHits = 0;
718 Fiber_MB_n[iLayer].clear();
719 const unsigned int thisLayer=2*iLayer+1;
720 const std::list<int> & thisFiberContainer =
m_MapLayers[thisLayer].ListFibers;
721 for (
const auto & thisFiber:thisFiberContainer)
724 Fiber_MB_n[iLayer].push_back(thisFiber);
740 Find_Proj(Over_p, b_ref_n, b_pos, OvU, NumU);
747 Fiber_MB_tmp[
i].clear();
748 Fiber_MB_tmp[
i].push_back(FSel_pos_tmp[
i]);
764 for (
unsigned int i=0;
i<Fiber_MB_n[iLayer].size();
i++)
766 m_MapLayers[2*iLayer+1].ListFibers.push_back(Fiber_MB_n[iLayer][
i]);
800 Find_Proj(Over_n, b_ref_p, b_neg, OvV, NumV);
813 Find_Proj(Over_p, b_neg, b_pos, OvU, NumU);
819 Find_Proj(Over_n, b_pos, b_neg, OvV, NumV);
828 Find_Proj(Over_p, b_neg, b_pos, OvU, NumU);
834 Find_Proj(Over_n, b_pos, b_neg, OvV, NumV);
837 b_p.push_back(b_pos);
839 Num_p.push_back(NumU);
841 b_n.push_back(b_neg);
843 Num_n.push_back(NumV);
845 iTrackMatch[0].push_back(cnt_step_U);
846 iTrackMatch[1].push_back(cnt_step_V);
859 FSel_n[iLayer].push_back(FSel_neg[iLayer]);
861 FSel_p[iLayer].push_back(FSel_pos_tmp[iLayer]);
893 const unsigned int thisLayer=2*iLayer+1;
894 const std::list<int> & thisFiberContainer =
m_MapLayers[thisLayer].ListFibers;
895 for (
const auto & thisFiber:thisFiberContainer)
897 if (thisFiber == (
int)FSel_neg[iLayer])
938 for (; itBeg != itEnd; ++itBeg)
940 if (*itBeg == (
int)FSel_pos_tmp[iLayer])
975 for (; itBeg != itEnd; ++itBeg)
977 if (*itBeg == (
int)FSel_pos_tmp[iLayer])
1015 std::fill_n(&fOvU[0],
sizeof(fOvU)/
sizeof(Float_t), -9999.0);
1016 std::fill_n(&fOvV[0],
sizeof(fOvV)/
sizeof(Float_t), -9999.0);
1017 std::fill_n(&iNumU[0],
sizeof(iNumU)/
sizeof(Int_t), -9999);
1018 std::fill_n(&iNumV[0],
sizeof(iNumV)/
sizeof(Int_t), -9999);
1019 std::fill_n(&iFibSel[0][0],
sizeof(iFibSel)/
sizeof(Int_t), -9999);
1025 iSize = ((Int_t)iLayer->size() > iSize)? iLayer->size() : iSize;
1028 for (Int_t iTrack=0; iTrack<iTrackNum; iTrack++)
1032 iFibSel[iTrack][iLayer] =
m_iFibSel[iLayer]->at(iTrack);
1040 for (Int_t iTrack=0; iTrack<iTrackNum; iTrack++)
1042 fOvU[iTrack] =
m_fOvU->at(iTrack);
1043 fOvV[iTrack] =
m_fOvV->at(iTrack);
1050 for (Int_t iTrack=0; iTrack<iTrackNum; iTrack++)
1052 iNumU[iTrack] =
m_iNU->at(iTrack);
1053 iNumV[iTrack] =
m_iNV->at(iTrack);