38 : base_class(t, n, p),
57 StatusCode
sc = AlgTool::initialize();
86 m_treeName = (std::string(
"SeedTree_")+name());
91 m_outputTree->Branch(
"eventNumber", &m_eventNumber,
"eventNumber/L");
132 return AlgTool::finalize();
145 if (not data.initialized)
150 data.trigger =
false;
152 data.iteration = iteration;
156 data.checketa = data.dzdrmin > 1.;
166 data.i_ITkSpacePointForSeed = data.l_ITkSpacePointForSeed.begin();
183 if (!prd_to_track_map.
isValid()) {
186 prd_to_track_map_cptr = prd_to_track_map.
cptr();
190 if (spacepointsStrip.
isValid()) {
203 int radiusBin =
static_cast<int>(sps->
radius() * oneOverBinSizeR);
204 if (radiusBin > maxBinR)
207 data.r_ITkSorted[radiusBin].push_back(sps);
209 ++data.r_map[radiusBin];
211 if (data.r_map[radiusBin] == 1)
212 data.r_index[data.nr++] = radiusBin;
221 if (spacepointsOverlap.
isValid()) {
233 int radiusBin =
static_cast<int>(sps->
radius() * oneOverBinSizeR);
234 if (radiusBin > maxBinR)
237 data.r_ITkSorted[radiusBin].push_back(sps);
239 ++data.r_map[radiusBin];
241 if (data.r_map[radiusBin] == 1)
242 data.r_index[data.nr++] = radiusBin;
261 if (!prd_to_track_map.
isValid()) {
264 prd_to_track_map_cptr = prd_to_track_map.
cptr();
268 if (spacepointsPixel.
isValid()) {
288 int radiusBin =
static_cast<int>(sps->
radius() * oneOverBinSizeR);
290 if (radiusBin > maxBinR)
294 data.r_ITkSorted[radiusBin].push_back(sps);
296 ++data.r_map[radiusBin];
299 if (data.r_map[radiusBin] == 1)
300 data.r_index[data.nr++] = radiusBin;
314 const std::vector<IdentifierHash> &vPixel,
const std::vector<IdentifierHash> &vStrip)
const
319 if (not data.initialized)
323 data.trigger =
false;
328 data.checketa =
false;
335 data.i_ITkSpacePointForSeed = data.l_ITkSpacePointForSeed.begin();
342 if (!prd_to_track_map.
isValid())
346 prd_to_track_map_cptr = prd_to_track_map.
cptr();
351 if (
m_pixel && !vPixel.empty())
355 if (spacepointsPixel.
isValid())
363 const auto *w = spacepointsPixel->indexFindPtr(l);
372 int ir =
static_cast<int>(sps->
radius() * oneOverBinSizeR);
375 data.r_ITkSorted[
ir].push_back(sps);
377 if (data.r_map[
ir] == 1)
378 data.r_index[data.nr++] =
ir;
387 if (
m_strip && !vStrip.empty())
392 if (spacepointsStrip.
isValid())
399 const auto *w = spacepointsStrip->indexFindPtr(l);
408 int ir =
static_cast<int>(sps->
radius() * oneOverBinSizeR);
411 data.r_ITkSorted[
ir].push_back(sps);
413 if (data.r_map[
ir] == 1)
414 data.r_index[data.nr++] =
ir;
426 const std::vector<IdentifierHash> &vPixel,
const std::vector<IdentifierHash> &vStrip,
const IRoiDescriptor &IRD)
const
428 constexpr float twoPi = 2. *
M_PI;
433 double dzdrmin = 1. / std::tan(2. * std::atan(std::exp(-IRD.
etaMinus())));
434 double dzdrmax = 1. / std::tan(2. * std::atan(std::exp(-IRD.
etaPlus())));
436 data.zminB = IRD.
zedMinus() - data.zbeam[0];
437 data.zmaxB = IRD.
zedPlus() - data.zbeam[0];
438 data.zminU = data.zminB + 550. * dzdrmin;
439 data.zmaxU = data.zmaxB + 550. * dzdrmax;
444 data.ftrig = (fmin + fmax) * .5;
445 data.ftrigW = (fmax - fmin) * .5;
456 ATH_MSG_WARNING(
"ITk::SiSpacePointsSeedMaker::find2Sp not implemented!");
466 if (not data.initialized)
477 if (lv.begin() != lv.end())
485 if (newv || !data.state || data.nspoint != 3 || data.mode != mode || data.nlist)
487 data.i_ITkSeedEnd = data.i_ITkSeeds.begin();
501 data.i_ITkSeed = data.i_ITkSeeds.begin();
503 if (msgLvl(MSG::DEBUG))
517 if (not data.initialized)
525 data.zminU = ZVertex[0];
528 data.zmaxU = ZVertex[1];
534 if (lv.begin() != lv.end())
542 if (newv || !data.state || data.nspoint != 3 || data.mode != mode || data.nlist)
544 data.i_ITkSeedEnd = data.i_ITkSeeds.begin();
557 data.i_ITkSeed = data.i_ITkSeeds.begin();
559 if (msgLvl(MSG::DEBUG))
575 if (not data.initialized)
585 if (lv.begin() != lv.end())
589 if (newv || !data.state || data.nspoint != 4 || data.mode != mode || data.nlist)
591 data.i_ITkSeedEnd = data.i_ITkSeeds.begin();
602 data.i_ITkSeed = data.i_ITkSeeds.begin();
604 if (msgLvl(MSG::DEBUG))
630 for (
int i=0; i<n; ++i) s2.append(
" ");
634 for (
int i=0; i<n; ++i) s3.append(
" ");
638 for (
int i=0; i<n; ++i) s4.append(
" ");
642 for (
int i=0; i<n; ++i) s5.append(
" ");
645 out<<
"|---------------------------------------------------------------------|"
664 out<<
"| maxSizeSP | "
667 out<<
"| pTmin (mev) | "
668 <<std::setw(12)<<std::setprecision(5)<<
m_ptmin
670 out<<
"| max radius SP | "
671 <<std::setw(12)<<std::setprecision(5)<<
m_r_rmax
673 out<<
"| radius step | "
674 <<std::setw(12)<<std::setprecision(5)<<
m_binSizeR
676 out<<
"| min Z-vertex position | "
677 <<std::setw(12)<<std::setprecision(5)<<
m_zmin
679 out<<
"| max Z-vertex position | "
680 <<std::setw(12)<<std::setprecision(5)<<
m_zmax
682 out<<
"| min space points dR SSS | "
683 <<std::setw(12)<<std::setprecision(5)<<
m_drminSSS
685 out<<
"| max space points dR SSS | "
686 <<std::setw(12)<<std::setprecision(5)<<
m_drmaxSSS
688 out<<
"| min space points dR PPP | "
689 <<std::setw(12)<<std::setprecision(5)<<
m_drminPPP
691 out<<
"| max space points dR PPP | "
692 <<std::setw(12)<<std::setprecision(5)<<
m_drmaxPPP
694 out<<
"| max dZ impact | "
695 <<std::setw(12)<<std::setprecision(5)<<
m_dzver
697 out<<
"| max dZ/dR impact | "
698 <<std::setw(12)<<std::setprecision(5)<<
m_dzdrver
700 out<<
"| max impact | "
703 out<<
"| max impact sss | "
706 out<<
"|---------------------------------------------------------------------|"
708 out<<
"| Beam X center | "
709 <<std::setw(12)<<std::setprecision(5)<<data.xbeam[0]
711 out<<
"| Beam Y center | "
712 <<std::setw(12)<<std::setprecision(5)<<data.ybeam[0]
714 out<<
"| Beam Z center | "
715 <<std::setw(12)<<std::setprecision(5)<<data.zbeam[0]
717 out<<
"| Beam X-axis direction | "
718 <<std::setw(12)<<std::setprecision(5)<<data.xbeam[1]
719 <<std::setw(12)<<std::setprecision(5)<<data.xbeam[2]
720 <<std::setw(12)<<std::setprecision(5)<<data.xbeam[3]
722 out<<
"| Beam Y-axis direction | "
723 <<std::setw(12)<<std::setprecision(5)<<data.ybeam[1]
724 <<std::setw(12)<<std::setprecision(5)<<data.ybeam[2]
725 <<std::setw(12)<<std::setprecision(5)<<data.ybeam[3]
727 out<<
"| Beam Z-axis direction | "
728 <<std::setw(12)<<std::setprecision(5)<<data.zbeam[1]
729 <<std::setw(12)<<std::setprecision(5)<<data.zbeam[2]
730 <<std::setw(12)<<std::setprecision(5)<<data.zbeam[3]
732 out<<
"|---------------------------------------------------------------------|"
745 out<<
"|---------------------------------------------------------------------|"
748 <<std::setw(12)<<data.ns
751 <<std::setw(12)<<data.nsaz
754 <<std::setw(12)<<data.nsazv
757 <<std::setw(12)<<data.i_ITkSeeds.size()
759 out<<
"|---------------------------------------------------------------------|"
774 data.i_ITkSeedEnd = data.i_ITkSeeds.begin();
776 if (data.mode == 2 || data.mode == 3 || data.mode == 5 || data.mode == 6)
779 data.i_ITkSeed = data.i_ITkSeeds.begin();
790 unsigned int s1 = data.l_vertex.size();
791 unsigned int s2 = lV.size();
794 data.isvertex =
false;
797 if (s1 == 0 && s2 == 0)
801 data.l_vertex.clear();
807 data.isvertex =
true;
810 data.l_vertex.insert(
static_cast<float>(v.position().z()));
815 data.zminU = (*data.l_vertex.begin()) - 20.;
818 data.zmaxU = (*data.l_vertex.rbegin()) + 20.;
869 constexpr float twoPi = 2. *
M_PI;
873 const float inverseSizePhiMax =
static_cast<float>(nPhiBinsMax) / twoPi;
874 constexpr float inverseSizePhiMin = 10. / twoPi;
927 const float inverseBinSizePhiVertexMax =
static_cast<float>(nPhiBinsVertexMax)/twoPi;
948 std::array<int, arraySizePhiZ> &nNeighbourCellsTop,
949 std::array<std::array<int, arraySizeNeighbourBins>,
arraySizePhiZ> &neighbourCellsBottom,
950 std::array<std::array<int, arraySizeNeighbourBins>,
arraySizePhiZ> &neighbourCellsTop,
951 int maxPhiBin,
bool isSSS)
958 for (
int phiBin = 0; phiBin <= maxPhiBin; ++phiBin)
961 int phiBelow = phiBin - 1;
962 if (phiBelow < 0) phiBelow = maxPhiBin;
964 int phiAbove = phiBin + 1;
965 if (phiAbove > maxPhiBin) phiAbove = 0;
977 nNeighbourCellsBottom[twoDbinSamePhi] = 3;
978 nNeighbourCellsTop[twoDbinSamePhi] = 3;
980 neighbourCellsBottom[twoDbinSamePhi][0] = twoDbinSamePhi;
981 neighbourCellsTop[twoDbinSamePhi][0] = twoDbinSamePhi;
983 neighbourCellsBottom[twoDbinSamePhi][1] = twoDbinLowerPhi;
984 neighbourCellsTop[twoDbinSamePhi][1] = twoDbinLowerPhi;
986 neighbourCellsBottom[twoDbinSamePhi][2] = twoDbinHigherPhi;
987 neighbourCellsTop[twoDbinSamePhi][2] = twoDbinHigherPhi;
999 nNeighbourCellsTop[twoDbinSamePhi] = 9;
1003 neighbourCellsTop[twoDbinSamePhi][3] = twoDbinSamePhi + 1;
1004 neighbourCellsTop[twoDbinSamePhi][4] = twoDbinLowerPhi + 1;
1005 neighbourCellsTop[twoDbinSamePhi][5] = twoDbinHigherPhi + 1;
1006 neighbourCellsTop[twoDbinSamePhi][6] = twoDbinSamePhi - 1;
1007 neighbourCellsTop[twoDbinSamePhi][7] = twoDbinLowerPhi - 1;
1008 neighbourCellsTop[twoDbinSamePhi][8] = twoDbinHigherPhi - 1;
1016 nNeighbourCellsBottom[twoDbinSamePhi] = 6;
1017 neighbourCellsBottom[twoDbinSamePhi][3] = twoDbinSamePhi - 1;
1018 neighbourCellsBottom[twoDbinSamePhi][4] = twoDbinLowerPhi - 1;
1019 neighbourCellsBottom[twoDbinSamePhi][5] = twoDbinHigherPhi - 1;
1028 nNeighbourCellsTop[twoDbinSamePhi] = 6;
1029 neighbourCellsTop[twoDbinSamePhi][3] = twoDbinSamePhi + 1;
1030 neighbourCellsTop[twoDbinSamePhi][4] = twoDbinLowerPhi + 1;
1031 neighbourCellsTop[twoDbinSamePhi][5] = twoDbinHigherPhi + 1;
1041 nNeighbourCellsBottom[twoDbinSamePhi] = 6;
1042 neighbourCellsBottom[twoDbinSamePhi][3] = twoDbinSamePhi + 1;
1043 neighbourCellsBottom[twoDbinSamePhi][4] = twoDbinLowerPhi + 1;
1044 neighbourCellsBottom[twoDbinSamePhi][5] = twoDbinHigherPhi + 1;
1050 nNeighbourCellsTop[twoDbinSamePhi] = 6;
1051 neighbourCellsTop[twoDbinSamePhi][3] = twoDbinSamePhi - 1;
1052 neighbourCellsTop[twoDbinSamePhi][4] = twoDbinLowerPhi - 1;
1053 neighbourCellsTop[twoDbinSamePhi][5] = twoDbinHigherPhi - 1;
1067 nNeighbourCellsBottom[twoDbinSamePhi] = 9;
1068 neighbourCellsBottom[twoDbinSamePhi][6] = twoDbinSamePhi + 2;
1069 neighbourCellsBottom[twoDbinSamePhi][7] = twoDbinLowerPhi + 2;
1070 neighbourCellsBottom[twoDbinSamePhi][8] = twoDbinHigherPhi + 2;
1074 nNeighbourCellsBottom[twoDbinSamePhi] = 9;
1075 neighbourCellsBottom[twoDbinSamePhi][6] = twoDbinSamePhi - 2;
1076 neighbourCellsBottom[twoDbinSamePhi][7] = twoDbinLowerPhi - 2;
1077 neighbourCellsBottom[twoDbinSamePhi][8] = twoDbinHigherPhi - 2;
1089 std::array<std::array<int, arraySizeNeighbourBinsVertex>,
arraySizePhiZV> &neighbourCells,
1092 for (
int phiBin=0; phiBin<=maxPhiBin; ++phiBin) {
1094 int phiBinBelow = phiBin-1;
1095 if (phiBinBelow<0) phiBinBelow=maxPhiBin;
1097 int phiBinTop = phiBin+1;
1098 if (phiBinTop>maxPhiBin) phiBinTop=0;
1104 int twoDbinLowerPhi = phiBinBelow*
arraySizeZV+zbin;
1105 int twoDbinHigherPhi = phiBinTop*
arraySizeZV+zbin;
1108 nNeighbourCells[twoDbinSamePhi] = 3;
1109 neighbourCells[twoDbinSamePhi][0] = twoDbinSamePhi;
1110 neighbourCells[twoDbinSamePhi][1] = twoDbinLowerPhi;
1111 neighbourCells[twoDbinSamePhi][2] = twoDbinHigherPhi;
1115 nNeighbourCells[twoDbinSamePhi] = 6;
1116 neighbourCells[twoDbinSamePhi][3] = twoDbinSamePhi-1;
1117 neighbourCells[twoDbinSamePhi][4] = twoDbinLowerPhi-1;
1118 neighbourCells[twoDbinSamePhi][5] = twoDbinHigherPhi-1;
1122 nNeighbourCells[twoDbinSamePhi] = 6;
1123 neighbourCells[twoDbinSamePhi][3] = twoDbinSamePhi+1;
1124 neighbourCells[twoDbinSamePhi][4] = twoDbinLowerPhi+1;
1125 neighbourCells[twoDbinSamePhi][5] = twoDbinHigherPhi+1;
1136 float Rm = pTmin / .6;
1144 float worstCaseD0 = maxd0;
1148 float sI = std::abs(std::asin(worstCaseD0 / Rmin) - std::asin(worstCaseD0 / Rmax));
1149 float sF = std::abs(std::asin(std::min(1., Rmax / (2. * Rm))) -
1150 std::asin(std::min(1., Rmin / (2. * Rm))));
1163 double tx = std::tan(beamSpotHandle->beamTilt(0));
1164 double ty = std::tan(beamSpotHandle->beamTilt(1));
1166 double phi = std::atan2(ty, tx);
1167 double theta = std::acos(1. / std::sqrt(1. + tx * tx + ty * ty));
1168 double sinTheta = std::sin(
theta);
1169 double cosTheta = std::cos(
theta);
1170 double sinPhi = std::sin(
phi);
1171 double cosPhi = std::cos(
phi);
1173 data.xbeam[0] =
static_cast<float>(cb.x());
1174 data.xbeam[1] =
static_cast<float>(cosTheta * cosPhi * cosPhi + sinPhi * sinPhi);
1175 data.xbeam[2] =
static_cast<float>(cosTheta * sinPhi * cosPhi - sinPhi * cosPhi);
1176 data.xbeam[3] = -
static_cast<float>(sinTheta * cosPhi);
1178 data.ybeam[0] =
static_cast<float>(cb.y());
1179 data.ybeam[1] =
static_cast<float>(cosTheta * cosPhi * sinPhi - sinPhi * cosPhi);
1180 data.ybeam[2] =
static_cast<float>(cosTheta * sinPhi * sinPhi + cosPhi * cosPhi);
1181 data.ybeam[3] = -
static_cast<float>(sinTheta * sinPhi);
1183 data.zbeam[0] =
static_cast<float>(cb.z());
1184 data.zbeam[1] =
static_cast<float>(sinTheta * cosPhi);
1185 data.zbeam[2] =
static_cast<float>(sinTheta * sinPhi);
1186 data.zbeam[3] =
static_cast<float>(cosTheta);
1194 r[0] =
static_cast<float>(
sp->globalPosition().
x()) - data.xbeam[0];
1195 r[1] =
static_cast<float>(
sp->globalPosition().
y()) - data.ybeam[0];
1196 r[2] =
static_cast<float>(
sp->globalPosition().
z()) - data.zbeam[0];
1205 constexpr float twoPi = 2. *
M_PI;
1207 int firstRadialBin = 0;
1208 int lastRadialBin = 0;
1209 bool endcap =
false;
1224 const std::map<float, int> ztoBin{
1243 for (
int radialBin = data.r_first; radialBin <
m_nBinsR; ++radialBin)
1246 if (!data.r_map[radialBin])
1250 std::vector<SiSpacePointForSeed *>::iterator SP_first = data.r_ITkSorted[radialBin].begin();
1251 if (isPixel && (*SP_first)->spacepoint->clusterList().second)
1255 if (firstRadialBin == 0)
1256 firstRadialBin = radialBin;
1257 lastRadialBin = radialBin;
1265 float Phi = SP->phi();
1268 int phiBin =
static_cast<int>(Phi * inverseBinSizePhi);
1274 else if (phiBin > nPhiBins)
1280 endcap = (std::abs(Z) > 1490);
1288 auto bound = ztoBin.lower_bound(Z);
1290 if (bound == ztoBin.end())
1294 zBin = bound->second;
1302 data.rfz_ITkSorted[twoDbin].push_back(SP);
1307 if (!data.rfz_map[twoDbin]++)
1308 data.rfz_index[data.nrfz++] = twoDbin;
1318 if (data.rfz_ITkSorted[twoDbin].size() > 1) {
1354 r[3] = float(
Tp(0, 2));
1355 r[4] = float(
Tp(1, 2));
1356 r[5] = float(
Tp(2, 2));
1373 std::pair<Amg::Vector3D, Amg::Vector3D> e0 =
1375 std::pair<Amg::Vector3D, Amg::Vector3D> e1 =
1386 r[3] = float(b0[0]);
1387 r[4] = float(b0[1]);
1388 r[5] = float(b0[2]);
1391 r[6] = float(b1[0]);
1392 r[7] = float(b1[1]);
1393 r[8] = float(b1[2]);
1396 r[9] = float(d02[0]);
1397 r[10] = float(d02[1]);
1398 r[11] = float(d02[2]);
1401 r[12] = float(
s0[0]) - data.xbeam[0];
1402 r[13] = float(
s0[1]) - data.ybeam[0];
1403 r[14] = float(
s0[2]) - data.zbeam[0];
1412 for (
int i = 0; i < data.nrfz; ++i)
1414 int n = data.rfz_index[i];
1415 data.rfz_map[n] = 0;
1416 data.rfz_ITkSorted[n].clear();
1419 for (
int i = 0; i < data.nrfzv; ++i)
1421 int n = data.rfzv_index[i];
1422 data.rfzv_map[n] = 0;
1423 data.rfzv_ITkSorted[n].clear();
1426 for (
int i = 0; i < data.nr; ++i) {
1427 int n = data.r_index[i];
1429 data.r_ITkSorted[n].clear();
1447 ATH_MSG_WARNING(
"ITk::SiSpacePointsSeedMaker::production2Sp not implemented!");
1478 const std::array<int, arraySizeZ> zBinIndex_SSS{5, 6, 4, 7, 3, 8, 2, 9, 1, 10, 0};
1479 const std::array<int, arraySizeZ> zBinIndex_PPP_fast{0, 10, 1, 9, 2, 8, 5, 3, 7, 4, 6};
1480 const std::array<int, arraySizeZ> zBinIndex_PPP_long{0, 1, 2, 3, 10, 9, 8, 7, 5, 4, 6};
1481 const auto zBinIndex_PPP =
m_fastTracking ? zBinIndex_PPP_fast : zBinIndex_PPP_long;
1485 const auto zBinIndex = isPixel ? zBinIndex_PPP : zBinIndex_SSS;
1487 const float RTmax[11] = { 80., 200., 200., 200., 250., 250., 250., 200., 200., 200., 80.};
1488 const float RTmin[11] = { 40., 40., 70., 70., 70., 70., 70., 70., 70., 40., 40.};
1498 std::array<int, arraySizePhiZ> nNeighbourCellsBottom{};
1499 std::array<int, arraySizePhiZ> nNeighbourCellsTop{};
1501 std::array<std::array<int, arraySizeNeighbourBins>,
arraySizePhiZ> neighbourCellsBottom{};
1504 std::array<std::array<int, arraySizeNeighbourBins>,
arraySizePhiZ> neighbourCellsTop{};
1526 data.endlist =
true;
1529 for (
int phiBin = data.fNmin; phiBin <= nPhiBins; ++phiBin)
1546 data.RTmax = RTmax[ zBinIndex[
z] ];
1547 data.RTmin = RTmin[ zBinIndex[
z] ];
1553 if (!data.rfz_map[phiZbin])
1558 int numberBottomCells = 0;
1559 int numberTopCells = 0;
1565 for (
int neighbourCellNumber = 0; neighbourCellNumber < nNeighbourCellsBottom[phiZbin]; ++neighbourCellNumber)
1568 int theNeighbourCell = neighbourCellsBottom[phiZbin][neighbourCellNumber];
1570 if (!data.rfz_map[theNeighbourCell])
1574 iter_bottomCands[numberBottomCells] = data.rfz_ITkSorted[theNeighbourCell].begin();
1576 iter_endBottomCands[numberBottomCells++] = data.rfz_ITkSorted[theNeighbourCell].end();
1583 for (
int neighbourCellNumber = 0; neighbourCellNumber < nNeighbourCellsTop[phiZbin]; ++neighbourCellNumber)
1586 int theNeighbourCell = neighbourCellsTop[phiZbin][neighbourCellNumber];
1588 if (!data.rfz_map[theNeighbourCell])
1592 iter_topCands[numberTopCells] = data.rfz_ITkSorted[theNeighbourCell].begin();
1594 iter_endTopCands[numberTopCells++] = data.rfz_ITkSorted[theNeighbourCell].end();
1601 production3SpPPP(data, iter_bottomCands, iter_endBottomCands, iter_topCands, iter_endTopCands, numberBottomCells, numberTopCells, nseed);
1603 production3SpSSS(data, iter_bottomCands, iter_endBottomCands, iter_topCands, iter_endTopCands, numberBottomCells, numberTopCells, nseed);
1606 production3SpTrigger(data, iter_bottomCands, iter_endBottomCands, iter_topCands, iter_endTopCands, numberBottomCells, numberTopCells, nseed);
1617 data.endlist =
false;
1618 data.fNmin = phiBin + 1;
1624 data.endlist =
true;
1636 const int numberBottomCells,
const int numberTopCells,
int &nseed)
const
1646 std::vector<SiSpacePointForSeed *>::iterator iter_centralSP = iter_bottomCands[0];
1655 for (; iter_centralSP != iter_endBottomCands[0]; ++iter_centralSP)
1657 if((*iter_centralSP)->radius() > data.RTmin)
break;
1662 iter_topCands[0] = iter_centralSP;
1666 const float &ipt2K = data.ipt2K;
1667 const float &ipt2C = data.ipt2C;
1668 const float &COFK = data.COFK;
1670 const float &zmax = data.zmaxU;
1671 const float &dzdrmax = data.dzdrmax;
1672 data.ITkCmSp.clear();
1676 size_t SPcapacity = data.ITkSP.size();
1679 for (; iter_centralSP != iter_endBottomCands[0]; ++iter_centralSP)
1681 const float &R = (*iter_centralSP)->radius();
1687 const float &
X = (*iter_centralSP)->x();
1688 const float &Y = (*iter_centralSP)->y();
1689 const float &Z = (*iter_centralSP)->z();
1693 double absZ = std::abs(Z);
1697 float covr0 = (*iter_centralSP)->covr();
1698 float covz0 = (*iter_centralSP)->covz();
1702 float VR = maxd0cut / (R * R);
1713 for (
int cell = 0; cell < numberTopCells; ++cell)
1715 std::vector<SiSpacePointForSeed *>::iterator iter_otherSP = iter_topCands[cell], iter_otherSPend = iter_endTopCands[cell];
1716 if (iter_otherSP == iter_otherSPend)
continue;
1718 for(; iter_otherSP!=iter_otherSPend; ++iter_otherSP) {
1719 if(( (*iter_otherSP)->radius()- R ) >=
m_drminPPP)
break;
1721 iter_topCands[cell]=iter_otherSP;
1724 for (; iter_otherSP != iter_endTopCands[cell]; ++iter_otherSP)
1727 float Rt = (*iter_otherSP)->radius();
1730 const float dz = (*iter_otherSP)->z() - Z;
1731 const float dZdR = dz / dR;
1734 const float z0 = Z - R * dZdR;
1735 if (std::abs(z0) > zmax)
1738 float dx = (*iter_otherSP)->x() -
X;
1739 float dy = (*iter_otherSP)->y() - Y;
1740 float x = dx * ax + dy * ay;
1741 float y = dy * ax - dx * ay;
1742 float dxy =
x *
x +
y *
y;
1743 float r2 = 1. / dxy;
1747 if (std::abs(R *
y) > maxd0cut *
x)
1750 y < 0. ? V0 = VR : V0 = -VR;
1751 float A = (v - V0) / (u + 1. / R);
1752 float B = V0 +
A / R;
1753 if ((B * B) > (ipt2K * (1. +
A *
A)))
1757 const float dr = std::sqrt(r2);
1758 const float tz = dz * dr;
1760 if (std::abs(tz) > dzdrmax)
1764 data.ITkSP[Nt] = (*iter_otherSP);
1768 data.Er[Nt] = ((covz0 + (*iter_otherSP)->covz()) + (tz * tz) * (covr0 + (*iter_otherSP)->covr())) * r2;
1769 data.ITkSP[Nt]->setDR(std::sqrt(dxy + dz * dz));
1770 data.ITkSP[Nt]->setDZDR(dZdR);
1771 data.Tn[Nt].Fl = tz;
1772 data.Tn[Nt].In = Nt;
1777 if (++Nt == SPcapacity)
1779 size_t increment = 50;
1781 SPcapacity = data.ITkSP.size();
1796 for (
int cell = 0; cell < numberBottomCells; ++cell)
1799 std::vector<SiSpacePointForSeed*>::iterator iter_otherSP = iter_bottomCands[cell];
1801 for(; iter_otherSP!=iter_endBottomCands[cell]; ++iter_otherSP) {
1802 if( (R - (*iter_otherSP)->radius()) <=
m_drmaxPPP)
break;
1804 iter_bottomCands[cell]=iter_otherSP;
1807 for (; iter_otherSP != iter_endBottomCands[cell]; ++iter_otherSP)
1810 const float &Rb = (*iter_otherSP)->radius();
1817 const float dz = Z - (*iter_otherSP)->z();
1818 const float dZdR = dz / dR;
1821 const float z0 = Z - R * dZdR;
1822 if (std::abs(z0) > zmax)
1825 float dx = (*iter_otherSP)->x() -
X;
1826 float dy = (*iter_otherSP)->y() - Y;
1827 float x = dx * ax + dy * ay;
1828 float y = dy * ax - dx * ay;
1829 float dxy = (
x *
x +
y *
y );
1830 float r2 = 1. / dxy;
1834 if (std::abs(R *
y) > -maxd0cut *
x)
1837 y > 0. ? V0 = VR : V0 = -VR;
1838 float A = (v - V0) / (u + 1. / R);
1839 float B = V0 +
A / R;
1840 if ((B * B) > (ipt2K * (1. +
A *
A)))
1844 const float dr = std::sqrt(r2);
1845 const float tz = dz * dr;
1847 if (std::abs(tz) > dzdrmax)
1851 if (
m_fastTracking && (*iter_otherSP)->radius() < 45. && std::abs(tz) > 1.5)
1855 data.ITkSP[Nb] = (*iter_otherSP);
1859 data.Er[Nb] = ((covz0 + (*iter_otherSP)->covz()) + (tz * tz) * (covr0 + (*iter_otherSP)->covr())) * r2;
1860 data.ITkSP[Nb]->setDR(std::sqrt(dxy + dz * dz));
1861 data.ITkSP[Nb]->setDZDR(dZdR);
1862 data.Tn[Nb].Fl = tz;
1863 data.Tn[Nb].In = Nb;
1868 if (++Nb == SPcapacity)
1870 size_t increment = 50;
1872 SPcapacity = data.ITkSP.size();
1883 sort(data.Tn,Nt,Nb-Nt);
1886 data.nOneSeedsQ = 0;
1887 data.ITkMapOneSeeds.clear();
1888 data.ITkMapOneSeedsQ.clear();
1893 for (
size_t ib = Nt; ib < Nb; ++ib)
1900 float Tzb = data.Tn[ib].Fl;
1901 int b = data.Tn[ib].In;
1903 float Rb2r = data.R[b] * covr0;
1904 float Rb2z = data.R[b] * covz0;
1905 float Erb = data.Er[b];
1906 float Vb = data.V[b];
1907 float Ub = data.U[b];
1908 float Tzb2 = (1. + Tzb * Tzb);
1909 float sTzb2 = std::sqrt(Tzb2);
1911 float sigmaSquaredScatteringPtDependent = Tzb2 * COFK;
1912 float sigmaSquaredScatteringMinPt = Tzb2 * ipt2C;
1915 float d0max = maxd0cut;
1918 if (data.ITkSP[b]->radius() >
m_rmaxPPP){
1921 if (data.nOneSeedsQ)
1925 for (
size_t it = it0; it < Nt; ++it)
1928 int t = data.Tn[it].In;
1929 float Tzt = data.Tn[it].Fl;
1937 float meanOneOverTanThetaSquare = Tzb * Tzt;
1940 float sigmaSquaredSpacePointErrors = Erb + data.Er[t]
1941 + 2 * Rb2z * data.R[t]
1942 + 2 * Rb2r * data.R[t] * meanOneOverTanThetaSquare;
1945 float remainingSquaredDelta = (Tzb - Tzt) * (Tzb - Tzt) - sigmaSquaredSpacePointErrors;
1949 if (remainingSquaredDelta - sigmaSquaredScatteringMinPt > 0)
1979 float dU = data.U[t] - Ub;
1982 float A = (data.V[t] - Vb) / dU;
1983 float onePlusAsquare = 1. +
A *
A;
1984 float B = Vb -
A * Ub;
1985 float BSquare = B * B;
1999 if (BSquare > ipt2K * onePlusAsquare)
2001 if (remainingSquaredDelta * onePlusAsquare > BSquare * sigmaSquaredScatteringPtDependent)
2025 float d0 = std::abs((
A - B * R) * R);
2031 float dr = data.R[b];
2032 if (data.R[t] < data.R[b])
2037 data.ITkSP[t]->setScorePenalty(std::abs((Tzb - Tzt) / (dr * sTzb2)));
2038 data.ITkSP[t]->setParam(d0);
2041 data.ITkCmSp.emplace_back(B / std::sqrt(onePlusAsquare), data.ITkSP[t]);
2043 if (data.ITkCmSp.size() == 500)
2050 if (data.ITkCmSp.size() > Nc)
2054 data.ITkCmSp.clear();
2058 nseed += data.fillOneSeeds;
2072 const int numberBottomCells,
const int numberTopCells,
int &nseed)
const
2082 std::vector<SiSpacePointForSeed *>::iterator iter_centralSP = iter_bottomCands[0];
2083 std::vector<SiSpacePointForSeed *>::iterator iter_otherSP;
2092 for (; iter_centralSP != iter_endBottomCands[0]; ++iter_centralSP)
2094 if((*iter_centralSP)->radius() > data.RTmin)
break;
2099 iter_topCands[0] = iter_centralSP;
2103 const float ipt2K = data.ipt2K;
2104 const float ipt2C = data.ipt2C;
2105 const float COFK = data.COFK;
2107 const float zmax = data.zmaxU;
2108 data.ITkCmSp.clear();
2112 size_t SPcapacity = data.ITkSP.size();
2115 for (; iter_centralSP != iter_endBottomCands[0]; ++iter_centralSP)
2118 const float &R = (*iter_centralSP)->radius();
2120 if(R > data.RTmax)
break;
2123 const float &
X = (*iter_centralSP)->x();
2124 const float &Y = (*iter_centralSP)->y();
2125 const float &Z = (*iter_centralSP)->z();
2129 double absZ = std::abs(Z);
2140 for (
int cell = 0; cell < numberTopCells; ++cell)
2143 for (iter_otherSP = iter_topCands[cell]; iter_otherSP != iter_endTopCands[cell]; ++iter_otherSP)
2146 float Rt = (*iter_otherSP)->radius();
2151 iter_topCands[cell] = iter_otherSP;
2154 for (iter_otherSP = iter_topCands[cell]; iter_otherSP != iter_endTopCands[cell]; ++iter_otherSP)
2158 float Rt = (*iter_otherSP)->radius();
2164 const float dz = (*iter_otherSP)->z() - Z;
2165 const float dZdR = dz / dR;
2169 const float z0 = Z - R * dZdR;
2170 if (std::abs(dz) >
m_dzmaxSSS || std::abs(z0) > zmax)
2176 const float ax =
X*Ri;
2177 const float ay = Y*Ri;
2179 float dx = (*iter_otherSP)->x() -
X;
2180 float dy = (*iter_otherSP)->y() - Y;
2181 float x = dx * ax + dy * ay;
2182 float y = dy * ax - dx * ay;
2184 if(std::abs(R*
y) > maxd0cut *
x) {
2185 float r2 = 1. / (
x *
x +
y *
y);
2188 const float V0 = (
y < 0.) ? VR: -VR;
2189 float A = (v-V0)/(u+Ri) ;
2191 if((B*B) > (ipt2K*(1.+
A*
A)))
continue;
2196 data.ITkSP[Nt] = (*iter_otherSP);
2197 data.ITkSP[Nt]->setDZDR(dZdR);
2201 if (++Nt == SPcapacity)
2203 data.resizeSPCont();
2204 SPcapacity = data.ITkSP.size();
2220 for (
int cell = 0; cell < numberBottomCells; ++cell)
2223 for(iter_otherSP=iter_bottomCands[cell]; iter_otherSP!=iter_endBottomCands[cell]; ++iter_otherSP) {
2224 if((R-(*iter_otherSP)->radius()) <=
m_drmaxSSS)
break;
2226 iter_bottomCands[cell]=iter_otherSP;
2229 for (; iter_otherSP != iter_endBottomCands[cell]; ++iter_otherSP)
2233 const float &Rb = (*iter_otherSP)->radius();
2240 const float dz = Z - (*iter_otherSP)->z();
2241 const float dZdR = dz / dR;
2245 const float z0 = Z - R * dZdR;
2246 if (std::abs(dz) >
m_dzmaxSSS || std::abs(z0) > zmax)
2252 const float ax =
X*Ri;
2253 const float ay = Y*Ri;
2255 float dx = (*iter_otherSP)->x() -
X;
2256 float dy = (*iter_otherSP)->y() - Y;
2257 float x = dx * ax + dy * ay;
2258 float y = dy * ax - dx * ay;
2260 if(std::abs(R*
y) > -maxd0cut *
x) {
2261 float r2 = 1. / (
x *
x +
y *
y);
2264 const float V0 = (
y < 0.) ? VR: -VR;
2265 float A = (v-V0)/(u+Ri) ;
2267 if((B*B) > (ipt2K*(1.+
A*
A)))
continue;
2272 data.ITkSP[Nb] = (*iter_otherSP);
2273 data.ITkSP[Nb]->setDZDR(dZdR);
2277 if (++Nb == SPcapacity)
2279 data.resizeSPCont();
2280 SPcapacity = data.ITkSP.size();
2290 float covr0 = (*iter_centralSP)->covr();
2291 float covz0 = (*iter_centralSP)->covz();
2299 for (
size_t i = 0; i < Nb; ++i)
2306 float dx =
sp->x() -
X;
2307 float dy =
sp->y() - Y;
2308 float dz =
sp->z() - Z;
2309 float x = dx * ax + dy * ay;
2310 float y = dy * ax - dx * ay;
2313 float r2 = 1. / (
x *
x +
y *
y);
2315 float dr = std::sqrt(r2);
2329 data.Zo[i] = Z - R * tz;
2333 data.Er[i] = ((covz0 +
sp->covz()) + (tz * tz) * (covr0 +
sp->covr())) * r2;
2337 data.nOneSeedsQ = 0;
2338 data.ITkMapOneSeeds.clear();
2339 data.ITkMapOneSeedsQ.clear();
2343 for (
size_t b = Nt; b < Nb; ++b)
2347 float Zob = data.Zo[b];
2348 float Tzb = data.Tz[b];
2349 float Rb2r = data.R[b] * covr0;
2350 float Rb2z = data.R[b] * covz0;
2351 float Erb = data.Er[b];
2352 float Vb = data.V[b];
2353 float Ub = data.U[b];
2354 float Tzb2 = (1. + Tzb * Tzb);
2355 float sTzb2 = std::sqrt(Tzb2);
2356 float Se = 1. / std::sqrt(Tzb2);
2357 float Ce = Se * Tzb;
2361 float sigmaSquaredScatteringPtDependent = Tzb2 * COFK;
2362 float sigmaSquaredScatteringMinPt = Tzb2 * ipt2C;
2365 float d0max = maxd0cut;
2368 for (
size_t t = 0; t < Nt; ++t)
2395 float dU0 = data.U[t] - Ub;
2398 float A0 = (data.V[t] - Vb) / dU0;
2400 float Cn = Ce * std::sqrt(1. + A0 * A0);
2402 float dn[3] = {Sx - Sy * A0, Sx * A0 + Sy, Cn};
2404 if (!(*iter_centralSP)->coordinates(dn, rn))
2409 float B0 = 2. * (Vb - A0 * Ub);
2410 float Cb = 1. -
B0 * data.Y[b];
2411 float Sb = A0 +
B0 * data.X[b];
2412 float db[3] = {Sx * Cb - Sy * Sb, Sx * Sb + Sy * Cb, Cn};
2414 if (!data.ITkSP[b]->coordinates(db, rb))
2419 float Ct = 1. -
B0 * data.Y[t];
2420 float St = A0 +
B0 * data.X[t];
2421 float dt[3] = {Sx * Ct - Sy * St, Sx * St + Sy * Ct, Cn};
2423 if (!data.ITkSP[t]->coordinates(dt, rt))
2426 float xb = rb[0] - rn[0];
2427 float yb = rb[1] - rn[1];
2428 float zb = rb[2] - rn[2];
2429 float xt = rt[0] - rn[0];
2430 float yt = rt[1] - rn[1];
2431 float zt = rt[2] - rn[2];
2433 float rb2 = 1. / (xb * xb + yb * yb);
2434 float rt2 = 1. / (
xt *
xt +
yt *
yt);
2436 float tb = -zb * std::sqrt(rb2);
2437 float tz =
zt * std::sqrt(rt2);
2445 float meanOneOverTanTheta = (tb + tz) / 2.;
2448 float sigmaSquaredSpacePointErrors = Erb + data.Er[t]
2449 + 2 * Rb2z * data.R[t]
2450 + 2 * Rb2r * data.R[t] * meanOneOverTanTheta * meanOneOverTanTheta;
2453 float remainingSquaredDelta = (tb - tz) * (tb - tz) - sigmaSquaredSpacePointErrors;
2457 if (remainingSquaredDelta - sigmaSquaredScatteringMinPt > 0)
2460 float Rn = std::sqrt(rn[0] * rn[0] + rn[1] * rn[1]);
2461 float Ax = rn[0] / Rn;
2462 float Ay = rn[1] / Rn;
2464 float ub = (xb * Ax + yb * Ay) * rb2;
2465 float vb = (yb * Ax - xb * Ay) * rb2;
2466 float ut = (
xt * Ax +
yt * Ay) * rt2;
2467 float vt = (
yt * Ax -
xt * Ay) * rt2;
2472 float A = (vt - vb) / dU;
2473 float onePlusAsquare = 1. +
A *
A;
2474 float B = vb -
A * ub;
2475 float BSquare = B * B;
2489 if (BSquare > ipt2K * onePlusAsquare || remainingSquaredDelta * onePlusAsquare > BSquare * sigmaSquaredScatteringPtDependent)
2508 float d0 = std::abs((
A - B * Rn) * Rn);
2514 float dr = std::sqrt(1 / rb2);
2515 if (data.R[t] < data.R[b])
2516 dr = std::sqrt(1 / rt2);
2520 data.ITkSP[t]->setScorePenalty(std::abs((tb - tz) / (dr * sTzb2)));
2521 data.ITkSP[t]->setParam(d0);
2523 data.ITkSP[t]->setDR(DR);
2526 data.ITkCmSp.emplace_back(B / std::sqrt(onePlusAsquare), data.ITkSP[t]);
2528 if (data.ITkCmSp.size() == 500)
2534 if (!data.ITkCmSp.empty())
2541 nseed += data.fillOneSeeds;
2555 const int ,
const int ,
int &)
const
2557 ATH_MSG_WARNING(
"ITk::SiSpacePointsSeedMaker::production3SpTrigger not implemented!");
2569 float worstQualityInMap = std::numeric_limits<float>::min();
2571 if (!data.ITkMapOneSeeds.empty())
2573 std::multimap<float, SiSpacePointsProSeed *>::reverse_iterator l = data.ITkMapOneSeeds.rbegin();
2574 worstQualityInMap = (*l).first;
2575 worstSeedSoFar = (*l).second;
2579 if (data.nOneSeeds < data.maxSeedsPerSP
2582 || (
m_useSeedConfirmation && data.keepAllConfirmedSeeds && worstQualityInMap <= seedCandidateQuality &&
isConfirmedSeed(p1, p3, seedCandidateQuality) && data.nOneSeeds < data.seedPerSpCapacity)
2587 data.ITkOneSeeds[data.nOneSeeds].set(p1, p2, p3,
z);
2588 data.ITkMapOneSeeds.insert(std::make_pair(seedCandidateQuality, &data.ITkOneSeeds[data.nOneSeeds]));
2593 else if (worstQualityInMap > seedCandidateQuality)
2596 worstSeedSoFar->
set(p1, p2, p3,
z);
2598 std::multimap<float, SiSpacePointsProSeed *>::iterator
2599 i = data.ITkMapOneSeeds.insert(std::make_pair(seedCandidateQuality, worstSeedSoFar));
2601 for (++i; i != data.ITkMapOneSeeds.end(); ++i)
2603 if ((*i).second == worstSeedSoFar)
2605 data.ITkMapOneSeeds.erase(i);
2618 float worstQualityInMap = std::numeric_limits<float>::min();
2620 if (!data.ITkMapOneSeedsQ.empty())
2622 std::multimap<float, SiSpacePointsProSeed *>::reverse_iterator l = data.ITkMapOneSeedsQ.rbegin();
2623 worstQualityInMap = (*l).first;
2624 worstSeedSoFar = (*l).second;
2628 if (data.nOneSeedsQ < data.maxSeedsPerSP
2631 || (
m_useSeedConfirmation && data.keepAllConfirmedSeeds && worstQualityInMap <= seedCandidateQuality &&
isConfirmedSeed(p1, p3, seedCandidateQuality) && data.nOneSeedsQ < data.seedPerSpCapacity)
2636 data.ITkOneSeedsQ[data.nOneSeedsQ].set(p1, p2, p3,
z);
2637 data.ITkMapOneSeedsQ.insert(std::make_pair(seedCandidateQuality, &data.ITkOneSeedsQ[data.nOneSeedsQ]));
2642 else if (worstQualityInMap > seedCandidateQuality)
2645 worstSeedSoFar->
set(p1, p2, p3,
z);
2647 std::multimap<float, SiSpacePointsProSeed *>::iterator
2648 i = data.ITkMapOneSeedsQ.insert(std::make_pair(seedCandidateQuality, worstSeedSoFar));
2650 for (++i; i != data.ITkMapOneSeedsQ.end(); ++i)
2652 if ((*i).second == worstSeedSoFar)
2654 data.ITkMapOneSeedsQ.erase(i);
2669 const float dC = .00003;
2674 std::vector<std::pair<float, SiSpacePointForSeed *>>
::iterator j, jn, i = data.ITkCmSp.begin(), ie = data.ITkCmSp.end();
2677 for (; i != ie; ++i)
2679 float u = (*i).second->param();
2680 bool pixt = !(*i).second->spacepoint->clusterList().second;
2681 if (pixt && std::abs(SPb->
z() - (*i).second->z()) >
m_dzmaxPPP)
2685 float Ri = (*i).second->radius();
2686 float Ci1 = (*i).first - dC;
2687 float Ci2 = (*i).first + dC;
2697 for (j = jn; j != ie; ++j)
2701 if ((*j).first < Ci1)
2707 if ((*j).first > Ci2)
2709 if ((*j).second->sur() == Sui)
2712 float Rj = (*j).second->radius();
2713 if (std::abs(Rj - Ri) <
m_drmin)
2724 if ((Rma - Rmi) > 20.)
2740 newOneSeed(data, SPb, SP0, (*i).second, Zob, u);
2742 data.ITkCmSp.clear();
2755 data.fillOneSeeds = 0;
2757 std::multimap<float, SiSpacePointsProSeed *>::iterator it_seedCandidate = data.ITkMapOneSeeds.begin();
2758 std::multimap<float, SiSpacePointsProSeed *>::iterator it_endSeedCandidates = data.ITkMapOneSeeds.end();
2760 if (data.nOneSeedsQ){
2761 it_seedCandidate = data.ITkMapOneSeedsQ.begin();
2762 it_endSeedCandidates = data.ITkMapOneSeedsQ.end();
2766 if (it_seedCandidate == it_endSeedCandidates)
2772 for (; it_seedCandidate != it_endSeedCandidates; ++it_seedCandidate)
2776 float quality = (*it_seedCandidate).first;
2777 theSeed = (*it_seedCandidate).second;
2784 if (data.i_ITkSeedEnd != data.i_ITkSeeds.end())
2786 theSeed = &(*data.i_ITkSeedEnd++);
2787 *theSeed = *(*it_seedCandidate).second;
2792 data.i_ITkSeeds.emplace_back(*(*it_seedCandidate).second);
2795 data.i_ITkSeedEnd = data.i_ITkSeeds.end();
2798 ++data.fillOneSeeds;
2805 if (not data.initialized)
2808 if (data.nspoint == 3)
2813 if (data.i_ITkSeed == data.i_ITkSeedEnd)
2822 if (data.i_ITkSeed == data.i_ITkSeedEnd)
2827 }
while (!(*data.i_ITkSeed++).set3(data.seedOutput, 1./(1000. * data.K)));
2829 return &data.seedOutput;
2834 if (data.i_ITkSeed == data.i_ITkSeedEnd)
2838 if (data.i_ITkSeed == data.i_ITkSeedEnd)
2841 (*data.i_ITkSeed++).set2(data.seedOutput);
2842 return &data.seedOutput;
2848 float Zv,
float R,
float T)
const
2850 if (Zv < data.zminU || Zv > data.zmaxU)
2855 float dZmin = std::numeric_limits<float>::max();
2856 for (
const float &v : data.l_vertex)
2858 float dZ = std::abs(v - Zv);
2872 std::array<float, 15>
r;
2888 float z = (std::abs(
r[2]) +
m_zmax);
2889 float x =
r[0] * data.dzdrmin;
2890 float y =
r[1] * data.dzdrmin;
2891 if ((
z *
z) < (
x *
x +
y *
y))
2897 float R2 =
r[0] *
r[0] +
r[1] *
r[1];
2901 if (std::abs(
r[2]) -
m_zmax > data.dzdrmax * std::sqrt(R2))
2905 if (usePixStripInform)
2907 if (!
sp->clusterList().second)
2916 if (data.i_ITkSpacePointForSeed != data.l_ITkSpacePointForSeed.end())
2919 sps = &(*data.i_ITkSpacePointForSeed++);
2927 data.l_ITkSpacePointForSeed.emplace_back(
sp,
r);
2929 sps = &(data.l_ITkSpacePointForSeed.back());
2931 data.i_ITkSpacePointForSeed = data.l_ITkSpacePointForSeed.end();
2946 if (data.i_ITkSeedEnd != data.i_ITkSeeds.end())
2949 s->set(p1, p2, p3,
z);
2953 data.i_ITkSeeds.emplace_back(p1, p2, p3,
z);
2954 data.i_ITkSeedEnd = data.i_ITkSeeds.end();
2962 seedArrayPerSPSize = 50;
2976 double magField[3]{0, 0, 0};
2977 double globalPos[3] = {10., 10., 0.};
2982 if (fieldCondObj ==
nullptr) {
3002 data.K = 2. / (300. * magField[2]);
3004 data.K = 2. / (300. * 5.);
3011 data.ipt2K =
m_ipt2 / (data.K * data.K);
3014 data.COFK =
m_COF * (data.K * data.K);
3016 data.bField[0] = magField[0];
3017 data.bField[1] = magField[1];
3018 data.bField[2] = magField[2];
3038 static const float curvatureInterval = .00003;
3041 if (data.ITkCmSp.size() > 2)
3044 std::vector<std::pair<float, SiSpacePointForSeed *>>
::iterator it_otherSP;
3045 std::vector<std::pair<float, SiSpacePointForSeed *>>
::iterator it_commonTopSP = data.ITkCmSp.begin(), ie = data.ITkCmSp.end();
3046 std::vector<std::pair<float, SiSpacePointForSeed *>>
::iterator it_startInnerLoop = it_commonTopSP;
3051 for (; it_commonTopSP != ie; ++it_commonTopSP)
3057 float seedIP = SPt->
param();
3060 float minCurvature = (*it_commonTopSP).first - curvatureInterval;
3061 float maxCurvature = (*it_commonTopSP).first + curvatureInterval;
3069 for (it_otherSP = it_startInnerLoop; it_otherSP != ie; ++it_otherSP)
3072 if (it_otherSP == it_commonTopSP)
3076 if ((*it_otherSP).first < minCurvature)
3078 it_startInnerLoop = it_otherSP;
3079 ++it_startInnerLoop;
3083 if ((*it_otherSP).first > maxCurvature)
3086 float L = (*it_otherSP).second->dR();
3089 for (; k != NT; ++k)
3091 if (std::abs(L - Lt[k]) < 20.)
3103 float Q = seedIP - float(NT) * 100.;
3109 data.ITkCmSp.clear();
3125 static const float curvatureInterval = .00003;
3128 if (data.ITkCmSp.size() > 2)
3131 std::vector<std::pair<float, SiSpacePointForSeed *>>
::iterator it_otherSP;
3132 std::vector<std::pair<float, SiSpacePointForSeed *>>
::iterator it_commonTopSP = data.ITkCmSp.begin(), ie = data.ITkCmSp.end();
3133 std::vector<std::pair<float, SiSpacePointForSeed *>>
::iterator it_startInnerLoop = it_commonTopSP;
3138 float Rb = 2. * SPb->
radius();
3145 bool Qm = Rb < 120. || std::abs(Zob) > 150.;
3148 for (; it_commonTopSP != ie; ++it_commonTopSP)
3154 float seedIP = SPt->
param();
3157 float minCurvature = (*it_commonTopSP).first - curvatureInterval;
3158 float maxCurvature = (*it_commonTopSP).first + curvatureInterval;
3166 for (it_otherSP = it_startInnerLoop; it_otherSP != ie; ++it_otherSP)
3169 if (it_otherSP == it_commonTopSP)
3173 if ((*it_otherSP).first < minCurvature)
3175 it_startInnerLoop = it_otherSP;
3176 ++it_startInnerLoop;
3180 if ((*it_otherSP).first > maxCurvature)
3183 float L = (*it_otherSP).second->dR();
3186 for (; k != NT; ++k)
3188 if (std::abs(L - Lt[k]) < 20.)
3200 if (dN < 0 || (data.nOneSeedsQ && !dN))
3202 if (Qm && !dN && seedIP > 1.)
3206 float Q = 100. * seedIP + (std::abs(Zob) - float(NT) * 100.);
3218 if (SPmin && !data.nOneSeedsQ)
3219 newOneSeed(data, SPb, SP0, SPmin, Zob, Qmin);
3220 data.ITkCmSp.clear();
3227 static const float curvatureInterval = .00003;
3229 float bottomSPQuality = SPb->
quality();
3230 float centralSPQuality = SP0->
quality();
3233 if (data.ITkCmSp.size() > 2)
3236 float bottomR = SPb->
radius();
3237 float bottomZ = SPb->
z();
3239 std::vector<std::pair<float, SiSpacePointForSeed *>>
::iterator it_otherSP;
3240 std::vector<std::pair<float, SiSpacePointForSeed *>>
::iterator it_commonTopSP = data.ITkCmSp.begin(), ie = data.ITkCmSp.end();
3241 std::vector<std::pair<float, SiSpacePointForSeed *>>
::iterator it_startInnerLoop = it_commonTopSP;
3244 for (; it_commonTopSP != ie; ++it_commonTopSP)
3249 float seedIP = SPt->
param();
3251 float originalSeedQuality = seedQuality;
3256 float topR = SPt->
radius();
3257 float topZ = SPt->
z();
3259 float Zot = std::abs(topR - bottomR) > 10e-9 ? bottomZ - (bottomR - originalSeedQuality) * ((topZ - bottomZ) / (topR - bottomR)) : bottomZ;
3261 float theta1 = std::abs(topR - bottomR) > 10e-9 ? std::atan2(topR - bottomR, topZ - bottomZ) : 0.;
3262 float eta1 = theta1 > 0 ? -std::log(std::tan(.5 * theta1)) : 0.;
3264 float theta0 = seedIP > 0 ? std::atan2(seedIP, Zot) : 0;
3265 float eta0 = theta0 > 0 ? -std::log(std::tan(.5 * theta0)) : 0.;
3267 float deltaEta = std::abs(eta1 - eta0);
3269 float f = std::min(0.5, originalSeedQuality / 200.);
3270 seedQuality *= (1 - f) / 300.;
3271 seedQuality += f * deltaEta / 2.5;
3278 float radiusTopSP = SPt->
radius();
3280 float minCurvature = (*it_commonTopSP).first - curvatureInterval;
3281 float maxCurvature = (*it_commonTopSP).first + curvatureInterval;
3291 if (!bottomSPisPixel)
3294 else if (topSPisPixel)
3303 for (it_otherSP = it_startInnerLoop; it_otherSP != ie; ++it_otherSP)
3306 if (it_otherSP == it_commonTopSP)
3310 if ((*it_otherSP).first < minCurvature)
3312 it_startInnerLoop = it_otherSP;
3313 ++it_startInnerLoop;
3317 if ((*it_otherSP).first > maxCurvature)
3320 if ((*it_otherSP).second->sur() == surfaceTopSP)
3323 float radiusOtherSP = (*it_otherSP).second->radius();
3333 if (seedQuality > data.maxScore)
3338 if (bottomSPisPixel != topSPisPixel)
3340 if (seedQuality > 0. ||
3341 (seedQuality > bottomSPQuality && seedQuality > centralSPQuality && seedQuality > SPt->
quality()))
3351 if (!bottomSPisPixel)
3353 if (seedIP > maxdImpact)
3357 newOneSeed(data, SPb, SP0, SPt, Zob, seedQuality);
3359 data.ITkCmSp.clear();
3378 return (quality < 0.);
3386 if(track !=
nullptr) {
3387 m_trackPt = (track->trackParameters()->front()->pT())/1000.f;
3388 m_trackEta = std::abs(track->trackParameters()->front()->eta());
3395 m_z0 = seed->zVertex();
3396 m_eta = seed->eta();
3410 m_dzdr_b = seed->dzdr_b();
3411 m_dzdr_t = seed->dzdr_t();
3413 m_givesTrack = !(track ==
nullptr);
3414 m_eventNumber = eventNumber;
Scalar phi() const
phi method
Scalar theta() const
theta method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x,...)
#define ATH_MSG_WARNING(x,...)
virtual void lock()=0
Interface to allow an object to lock itself when made const in SG.
Define macros for attributes used to control the static checker.
void getInitializedCache(MagField::AtlasFieldCache &cache) const
get B field cache for evaluation as a function of 2-d or 3-d position.
Describes the API of the Region of Ineterest geometry.
virtual double phiPlus() const =0
extreme phi values
virtual double zedPlus() const =0
the zed and eta values at the most forward and most rear ends of the RoI
virtual double phiMinus() const =0
virtual double zedMinus() const =0
virtual double etaMinus() const =0
virtual double etaPlus() const =0
const Trk::SpacePoint * spacepoint
float scorePenalty() const
const Trk::Surface * sur() const
distance between top and central SP
float dR() const
penalty term in the seed score
void set(const Trk::SpacePoint *, std::span< float const, 15 >)
SiSpacePointForSeed * spacepoint2()
SiSpacePointForSeed * spacepoint0()
void set(SiSpacePointForSeed *&, SiSpacePointForSeed *&, SiSpacePointForSeed *&, float)
IntegerProperty m_maxsize
SG::ReadHandleKey< SpacePointContainer > m_spacepointsPixel
float m_seedScoreThresholdSSSConfirmationSeed
max (score is assigned negative sign) score for SSS seeds with confirmation seed requirement.
static MsgStream & dumpEvent(EventData &data, MsgStream &out)
float m_inverseBinSizePhiSSS
bool isZCompatible(EventData &data, float Zv, float R, float T) const
std::array< std::array< int, arraySizeNeighbourBins >, arraySizePhiZ > m_neighbourCellsBottomSSS
void newOneSeedWithCurvaturesComparisonPPP(EventData &data, SiSpacePointForSeed *&SPb, SiSpacePointForSeed *&SP0, float Zob) const
std::array< int, arraySizePhiZ > m_nNeighbourCellsTopSSS
static void pixInform(const Trk::SpacePoint *sp, float *r)
void fillLists(EventData &data) const
ServiceHandle< ITHistSvc > m_thistSvc
Flag to write validation ntuples. Turned off by default.
BooleanProperty m_fastTracking
virtual MsgStream & dump(EventData &data, MsgStream &out) const override
virtual StatusCode finalize() override
FloatProperty m_maxdImpact
SiSpacePointForSeed * newSpacePoint(EventData &data, const Trk::SpacePoint *const &sp) const
Create a SiSpacePointForSeed from the space point.
virtual const InDet::SiSpacePointsSeed * next(const EventContext &ctx, EventData &data) const override
void production3SpPPP(EventData &data, std::array< std::vector< SiSpacePointForSeed * >::iterator, arraySizeNeighbourBins > &iter_bottomCands, std::array< std::vector< SiSpacePointForSeed * >::iterator, arraySizeNeighbourBins > &iter_endBottomCands, std::array< std::vector< SiSpacePointForSeed * >::iterator, arraySizeNeighbourBins > &iter_topCands, std::array< std::vector< SiSpacePointForSeed * >::iterator, arraySizeNeighbourBins > &iter_endTopCands, const int numberBottomCells, const int numberTopCells, int &nseed) const
bool isConfirmedSeed(const SiSpacePointForSeed *bottomSP, const SiSpacePointForSeed *topSP, float quality) const
Helper method to determine if a seed is 'confirmed' - this means that a second seed exists with compa...
FloatProperty m_maxdImpactSSS
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
IntegerProperty m_maxOneSizePPP
void newOneSeed(EventData &data, SiSpacePointForSeed *&, SiSpacePointForSeed *&, SiSpacePointForSeed *&, float, float) const
BooleanProperty m_optimisePhiBinning
static void buildConnectionMapsVertex(std::array< int, arraySizePhiZV > &nNeighbourCells, std::array< std::array< int, arraySizeNeighbourBinsVertex >, arraySizePhiZV > &neighbourCells, int maxPhiBin)
Build maps for radius-azimuthal-Z sorted collections for Z Similar logic to the above,...
static float azimuthalStep(const float pTmin, const float maxd0, const float Rmin, const float Rmax)
Determine the expected azimuthal trajectory displacement in phi in presence of the magnetic field for...
virtual StatusCode initialize() override
void newOneSeedWithCurvaturesComparison(EventData &data, SiSpacePointForSeed *&, SiSpacePointForSeed *&, float) const
void production3SpTrigger(EventData &, std::array< std::vector< SiSpacePointForSeed * >::iterator, arraySizeNeighbourBins > &, std::array< std::vector< SiSpacePointForSeed * >::iterator, arraySizeNeighbourBins > &, std::array< std::vector< SiSpacePointForSeed * >::iterator, arraySizeNeighbourBins > &, std::array< std::vector< SiSpacePointForSeed * >::iterator, arraySizeNeighbourBins > &, const int, const int, int &) const
as above, but for the trigger
std::array< int, arraySizePhiZ > m_nNeighbourCellsBottomSSS
BooleanProperty m_alwaysKeepConfirmedStripSeeds
IntegerProperty m_maxOneSizeSSS
FloatProperty m_seedScoreBonusSSS
BooleanProperty m_useSeedConfirmation
void findNext(EventData &data) const
bool newVertices(EventData &data, const std::list< Trk::Vertex > &) const
FloatProperty m_seedScoreBonusConfirmationSeed
@ arraySizeZ
capacity of the 1D z arrays
@ arraySizeNeighbourBins
array size to store neighbouring phi-z-regions in the seed finding
@ arraySizePhiV
array size in phi for vertexing
@ arraySizeZV
array size in z for vertexing
@ arraySizePhiZV
array size in phi-Z 2D for the vertexing
@ arraySizePhi
capacity of the 1D phi arrays
@ arraySizePhiZ
capacity for the 2D phi-z arrays
float m_inverseBinSizePhiPPP
cache the inverse bin size in phi which we use - needed to evaluate phi bin locations
virtual void writeNtuple(const InDet::SiSpacePointsSeed *seed, const Trk::Track *track, int seedType, long eventNumber) const override
void production3Sp(EventData &data) const
bool isUsed(const Trk::SpacePoint *, const Trk::PRDtoTrackMap &prd_to_track_map) const
std::array< std::array< int, arraySizeNeighbourBins >, arraySizePhiZ > m_neighbourCellsBottomPPP
mapping of neighbour cells in the 2D phi-z binning to consider for the "bottom SP" search for central...
virtual void findVSp(const EventContext &ctx, EventData &data, const std::list< Trk::Vertex > &lv) const override
with variable number space points with or without vertex constraint Variable means (2,...
static void newSeed(EventData &data, SiSpacePointForSeed *&, SiSpacePointForSeed *&, float)
IntegerProperty m_maxsizeSP
void newOneSeedQ(EventData &data, SiSpacePointForSeed *&, SiSpacePointForSeed *&, SiSpacePointForSeed *&, float, float) const
SG::ReadHandleKey< Trk::PRDtoTrackMap > m_prdToTrackMap
SiSpacePointsSeedMaker()=delete
int m_maxPhiBinPPP
number of bins in phi
void sort(std::vector< InDet::FloatInt > &s, int start, int size) const
float m_d0 ATLAS_THREAD_SAFE
static void fillSeeds(EventData &data)
IntegerProperty m_maxOneSize
std::array< int, arraySizePhiZ > m_nNeighbourCellsTopPPP
number of neighbouring phi-z bins to consider when looking for "top SP" candidates for each phi-z bin
void newOneSeedWithCurvaturesComparisonSSS(EventData &data, SiSpacePointForSeed *&SPb, SiSpacePointForSeed *&SP0, float Zob) const
This creates all possible seeds with the passed central and bottom SP, using all top SP candidates wh...
std::array< std::array< int, arraySizeNeighbourBinsVertex >, arraySizePhiZV > m_neighboursVertexPhiZ
FloatProperty m_dImpactCutSlopeUnconfirmedSSS
MsgStream & dumpConditions(EventData &data, MsgStream &out) const
virtual void find2Sp(EventData &data, const std::list< Trk::Vertex > &lv) const override
with two space points with or without vertex constraint
float m_inverseBinSizePhiVertex
float m_seedScoreThresholdPPPConfirmationSeed
Seed score thresholds defined based on the modifiers defined as configurables above.
BooleanProperty m_alwaysKeepConfirmedPixelSeeds
FloatProperty m_seedScoreBonusPPP
std::array< int, arraySizePhiZ > m_nNeighbourCellsBottomPPP
arrays associating bins to each other for SP formation
static void stripInform(EventData &data, const Trk::SpacePoint *sp, float *r)
std::array< std::array< int, arraySizeNeighbourBins >, arraySizePhiZ > m_neighbourCellsTopSSS
virtual bool getWriteNtupleBoolProperty() const override
std::array< int, arraySizePhiZV > m_nNeighboursVertexPhiZ
SG::ReadHandleKey< SpacePointOverlapCollection > m_spacepointsOverlap
virtual void newEvent(const EventContext &ctx, EventData &data, int iteration) const override
Gaudi::Property< bool > m_writeNtuple
SG::ReadHandleKey< SpacePointContainer > m_spacepointsStrip
static void convertToBeamFrameWork(EventData &data, const Trk::SpacePoint *, float *)
void production3SpSSS(EventData &data, std::array< std::vector< SiSpacePointForSeed * >::iterator, arraySizeNeighbourBins > &iter_bottomCands, std::array< std::vector< SiSpacePointForSeed * >::iterator, arraySizeNeighbourBins > &iter_endBottomCands, std::array< std::vector< SiSpacePointForSeed * >::iterator, arraySizeNeighbourBins > &iter_topCands, std::array< std::vector< SiSpacePointForSeed * >::iterator, arraySizeNeighbourBins > &iter_endTopCands, const int numberBottomCells, const int numberTopCells, int &nseed) const
: Seed production from space points.
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > m_fieldCondObjInputKey
void initializeEventData(EventData &data, const EventContext &ctx) const
std::array< std::array< int, arraySizeNeighbourBins >, arraySizePhiZ > m_neighbourCellsTopPPP
mapping of neighbour cells in the 2D phi-z binning to consider for the "top SP" search for central SP...
virtual void newRegion(const EventContext &ctx, EventData &data, const std::vector< IdentifierHash > &vPixel, const std::vector< IdentifierHash > &vStrip) const override
void newOneSeedWithCurvaturesComparisonSeedConfirmation(EventData &data, SiSpacePointForSeed *&SPb, SiSpacePointForSeed *&SP0, float Zob) const
FloatProperty m_dImpactCutSlopeUnconfirmedPPP
void buildBeamFrameWork(EventData &data) const
static void erase(EventData &data)
virtual void find3Sp(const EventContext &ctx, EventData &data, const std::list< Trk::Vertex > &lv) const override
with three space points with or without vertex constraint
int m_nBinsR
number of bins in the radial coordinate
static void buildConnectionMaps(std::array< int, arraySizePhiZ > &nNeighbourCellsBottom, std::array< int, arraySizePhiZ > &nNeighbourCellsTop, std::array< std::array< int, arraySizeNeighbourBins >, arraySizePhiZ > &neighbourCellsBottom, std::array< std::array< int, arraySizeNeighbourBins >, arraySizePhiZ > &neighbourCellsTop, int maxPhiBin, bool isSSS)
void production2Sp(EventData &data) const
BooleanProperty m_checketa
BooleanProperty m_useOverlap
This is a "hash" representation of an Identifier.
Class to hold geometrical description of a silicon detector element.
Class to represent a position in the natural frame of a silicon sensor, for Pixel and SCT For Pixel: ...
Trk::Surface & surface()
Element Surface.
@ ITk
ITk::SiSpacePointsSeedMaker.
Local cache for magnetic field (based on MagFieldServices/AtlasFieldSvcTLS.h).
bool solenoidOn() const
status of the magnets
void getFieldZR(const double *ATH_RESTRICT xyz, double *ATH_RESTRICT bxyz, double *ATH_RESTRICT deriv=nullptr)
get B field valaue on the z-r plane at given position works only inside the solenoid.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type cptr()
Dereference the pointer.
const std::pair< const PrepRawData *, const PrepRawData * > & clusterList() const
return the pair of cluster pointers by reference
Abstract Base Class for tracking surfaces.
const Amg::Transform3D & transform() const
Returns HepGeom::Transform3D by reference.
This class is a simplest representation of a vertex candidate.
int ir
counter of the current depth
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
InDet::SiSpacePointsSeedMakerEventData EventData
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
hold the test vectors and ease the comparison