38 : base_class(t, n, p),
42 m_treeFolder(
"/valNtuples/")
57 StatusCode
sc = AlgTool::initialize();
86 m_treeName = (std::string(
"SeedTree_")+name());
87 std::replace( m_treeName.begin(), m_treeName.end(),
'.',
'_' );
89 m_outputTree =
new TTree( m_treeName.c_str() ,
"SeedMakerValTool");
91 m_outputTree->Branch(
"eventNumber", &m_eventNumber,
"eventNumber/L");
116 TString fullTreeName = m_treeFolder + m_treeName;
132 return AlgTool::finalize();
145 if (not
data.initialized)
150 data.trigger =
false;
152 data.iteration = iteration;
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);
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);
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())));
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();
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{};
1500 std::array<std::array<int, arraySizeNeighbourBins>,
arraySizePhiZ> neighbourCellsBottom{};
1501 std::array<std::array<int, arraySizeNeighbourBins>,
arraySizePhiZ> neighbourCellsTop{};
1523 data.endlist =
true;
1526 for (
int phiBin =
data.fNmin; phiBin <= nPhiBins; ++phiBin)
1543 data.RTmax = RTmax[ zBinIndex[
z] ];
1544 data.RTmin = RTmin[ zBinIndex[
z] ];
1550 if (!
data.rfz_map[phiZbin])
1555 int numberBottomCells = 0;
1556 int numberTopCells = 0;
1562 for (
int neighbourCellNumber = 0; neighbourCellNumber < nNeighbourCellsBottom[phiZbin]; ++neighbourCellNumber)
1565 int theNeighbourCell = neighbourCellsBottom[phiZbin][neighbourCellNumber];
1567 if (!
data.rfz_map[theNeighbourCell])
1570 iter_bottomCands[numberBottomCells] =
data.rfz_ITkSorted[theNeighbourCell].begin();
1571 iter_endBottomCands[numberBottomCells++] =
data.rfz_ITkSorted[theNeighbourCell].end();
1578 for (
int neighbourCellNumber = 0; neighbourCellNumber < nNeighbourCellsTop[phiZbin]; ++neighbourCellNumber)
1581 int theNeighbourCell = neighbourCellsTop[phiZbin][neighbourCellNumber];
1583 if (!
data.rfz_map[theNeighbourCell])
1586 iter_topCands[numberTopCells] =
data.rfz_ITkSorted[theNeighbourCell].begin();
1587 iter_endTopCands[numberTopCells++] =
data.rfz_ITkSorted[theNeighbourCell].end();
1594 production3SpPPP(
data, iter_bottomCands, iter_endBottomCands, iter_topCands, iter_endTopCands, numberBottomCells, numberTopCells, nseed);
1596 production3SpSSS(
data, iter_bottomCands, iter_endBottomCands, iter_topCands, iter_endTopCands, numberBottomCells, numberTopCells, nseed);
1599 production3SpTrigger(
data, iter_bottomCands, iter_endBottomCands, iter_topCands, iter_endTopCands, numberBottomCells, numberTopCells, nseed);
1610 data.endlist =
false;
1611 data.fNmin = phiBin + 1;
1617 data.endlist =
true;
1629 const int numberBottomCells,
const int numberTopCells,
int &nseed)
const
1639 std::vector<SiSpacePointForSeed *>::iterator iter_centralSP = iter_bottomCands[0];
1648 for (; iter_centralSP != iter_endBottomCands[0]; ++iter_centralSP)
1650 if((*iter_centralSP)->radius() >
data.RTmin)
break;
1655 iter_topCands[0] = iter_centralSP;
1659 const float &ipt2K =
data.ipt2K;
1660 const float &ipt2C =
data.ipt2C;
1661 const float &COFK =
data.COFK;
1663 const float &zmax =
data.zmaxU;
1664 const float &dzdrmax =
data.dzdrmax;
1665 data.ITkCmSp.clear();
1669 size_t SPcapacity =
data.ITkSP.size();
1672 for (; iter_centralSP != iter_endBottomCands[0]; ++iter_centralSP)
1674 const float &R = (*iter_centralSP)->radius();
1680 const float &X = (*iter_centralSP)->x();
1681 const float &Y = (*iter_centralSP)->y();
1682 const float &Z = (*iter_centralSP)->z();
1686 double absZ = std::abs(Z);
1690 float covr0 = (*iter_centralSP)->covr();
1691 float covz0 = (*iter_centralSP)->covz();
1695 float VR = maxd0cut / (R * R);
1706 for (
int cell = 0; cell < numberTopCells; ++cell)
1708 std::vector<SiSpacePointForSeed *>::iterator iter_otherSP = iter_topCands[cell], iter_otherSPend = iter_endTopCands[cell];
1709 if (iter_otherSP == iter_otherSPend)
continue;
1711 for(; iter_otherSP!=iter_otherSPend; ++iter_otherSP) {
1712 if(( (*iter_otherSP)->radius()- R ) >=
m_drminPPP)
break;
1714 iter_topCands[cell]=iter_otherSP;
1717 for (; iter_otherSP != iter_endTopCands[cell]; ++iter_otherSP)
1720 float Rt = (*iter_otherSP)->radius();
1723 const float dz = (*iter_otherSP)->z() - Z;
1724 const float dZdR = dz / dR;
1727 const float z0 = Z - R * dZdR;
1728 if (std::abs(z0) > zmax)
1731 float dx = (*iter_otherSP)->x() - X;
1732 float dy = (*iter_otherSP)->y() - Y;
1733 float x = dx * ax + dy * ay;
1734 float y = dy * ax - dx * ay;
1735 float dxy =
x *
x +
y *
y;
1736 float r2 = 1. / dxy;
1740 if (std::abs(R *
y) > maxd0cut *
x)
1743 y < 0. ? V0 = VR : V0 = -VR;
1744 float A = (v - V0) / (u + 1. / R);
1745 float B = V0 +
A / R;
1746 if ((B * B) > (ipt2K * (1. +
A *
A)))
1750 const float dr = std::sqrt(r2);
1751 const float tz = dz * dr;
1753 if (std::abs(tz) > dzdrmax)
1757 data.ITkSP[Nt] = (*iter_otherSP);
1761 data.Er[Nt] = ((covz0 + (*iter_otherSP)->covz()) + (tz * tz) * (covr0 + (*iter_otherSP)->covr())) * r2;
1762 data.ITkSP[Nt]->setDR(std::sqrt(dxy + dz * dz));
1763 data.ITkSP[Nt]->setDZDR(dZdR);
1764 data.Tn[Nt].Fl = tz;
1765 data.Tn[Nt].In = Nt;
1770 if (++Nt == SPcapacity)
1772 size_t increment = 50;
1774 SPcapacity =
data.ITkSP.size();
1789 for (
int cell = 0; cell < numberBottomCells; ++cell)
1792 std::vector<SiSpacePointForSeed*>::iterator iter_otherSP = iter_bottomCands[cell];
1794 for(; iter_otherSP!=iter_endBottomCands[cell]; ++iter_otherSP) {
1795 if( (R - (*iter_otherSP)->radius()) <=
m_drmaxPPP)
break;
1797 iter_bottomCands[cell]=iter_otherSP;
1800 for (; iter_otherSP != iter_endBottomCands[cell]; ++iter_otherSP)
1803 const float &Rb = (*iter_otherSP)->radius();
1810 const float dz = Z - (*iter_otherSP)->z();
1811 const float dZdR = dz / dR;
1814 const float z0 = Z - R * dZdR;
1815 if (std::abs(z0) > zmax)
1818 float dx = (*iter_otherSP)->x() - X;
1819 float dy = (*iter_otherSP)->y() - Y;
1820 float x = dx * ax + dy * ay;
1821 float y = dy * ax - dx * ay;
1822 float dxy = (
x *
x +
y *
y );
1823 float r2 = 1. / dxy;
1827 if (std::abs(R *
y) > -maxd0cut *
x)
1830 y > 0. ? V0 = VR : V0 = -VR;
1831 float A = (v - V0) / (u + 1. / R);
1832 float B = V0 +
A / R;
1833 if ((B * B) > (ipt2K * (1. +
A *
A)))
1837 const float dr = std::sqrt(r2);
1838 const float tz = dz * dr;
1840 if (std::abs(tz) > dzdrmax)
1844 if (
m_fastTracking && (*iter_otherSP)->radius() < 45. && std::abs(tz) > 1.5)
1848 data.ITkSP[Nb] = (*iter_otherSP);
1852 data.Er[Nb] = ((covz0 + (*iter_otherSP)->covz()) + (tz * tz) * (covr0 + (*iter_otherSP)->covr())) * r2;
1853 data.ITkSP[Nb]->setDR(std::sqrt(dxy + dz * dz));
1854 data.ITkSP[Nb]->setDZDR(dZdR);
1855 data.Tn[Nb].Fl = tz;
1856 data.Tn[Nb].In = Nb;
1861 if (++Nb == SPcapacity)
1863 size_t increment = 50;
1865 SPcapacity =
data.ITkSP.size();
1879 data.nOneSeedsQ = 0;
1880 data.ITkMapOneSeeds.clear();
1881 data.ITkMapOneSeedsQ.clear();
1886 for (
size_t ib = Nt; ib < Nb; ++ib)
1893 float Tzb =
data.Tn[ib].Fl;
1894 int b =
data.Tn[ib].In;
1896 float Rb2r =
data.R[b] * covr0;
1897 float Rb2z =
data.R[b] * covz0;
1898 float Erb =
data.Er[b];
1899 float Vb =
data.V[b];
1900 float Ub =
data.U[b];
1901 float Tzb2 = (1. + Tzb * Tzb);
1902 float sTzb2 = std::sqrt(Tzb2);
1904 float sigmaSquaredScatteringPtDependent = Tzb2 * COFK;
1905 float sigmaSquaredScatteringMinPt = Tzb2 * ipt2C;
1908 float d0max = maxd0cut;
1914 if (
data.nOneSeedsQ)
1918 for (
size_t it = it0; it < Nt; ++it)
1921 int t =
data.Tn[it].In;
1922 float Tzt =
data.Tn[it].Fl;
1930 float meanOneOverTanThetaSquare = Tzb * Tzt;
1933 float sigmaSquaredSpacePointErrors = Erb +
data.Er[t]
1934 + 2 * Rb2z *
data.R[t]
1935 + 2 * Rb2r *
data.R[t] * meanOneOverTanThetaSquare;
1938 float remainingSquaredDelta = (Tzb - Tzt) * (Tzb - Tzt) - sigmaSquaredSpacePointErrors;
1942 if (remainingSquaredDelta - sigmaSquaredScatteringMinPt > 0)
1972 float dU =
data.U[t] - Ub;
1975 float A = (
data.V[t] - Vb) / dU;
1976 float onePlusAsquare = 1. +
A *
A;
1977 float B = Vb -
A * Ub;
1978 float BSquare = B * B;
1992 if (BSquare > ipt2K * onePlusAsquare)
1994 if (remainingSquaredDelta * onePlusAsquare > BSquare * sigmaSquaredScatteringPtDependent)
2018 float d0 = std::abs((
A - B * R) * R);
2024 float dr =
data.R[b];
2030 data.ITkSP[t]->setScorePenalty(std::abs((Tzb - Tzt) / (dr * sTzb2)));
2031 data.ITkSP[t]->setParam(d0);
2034 data.ITkCmSp.emplace_back(B / std::sqrt(onePlusAsquare),
data.ITkSP[t]);
2036 if (
data.ITkCmSp.size() == 500)
2043 if (
data.ITkCmSp.size() > Nc)
2047 data.ITkCmSp.clear();
2051 nseed +=
data.fillOneSeeds;
2065 const int numberBottomCells,
const int numberTopCells,
int &nseed)
const
2075 std::vector<SiSpacePointForSeed *>::iterator iter_centralSP = iter_bottomCands[0];
2076 std::vector<SiSpacePointForSeed *>::iterator iter_otherSP;
2085 for (; iter_centralSP != iter_endBottomCands[0]; ++iter_centralSP)
2087 if((*iter_centralSP)->radius() >
data.RTmin)
break;
2092 iter_topCands[0] = iter_centralSP;
2096 const float ipt2K =
data.ipt2K;
2097 const float ipt2C =
data.ipt2C;
2098 const float COFK =
data.COFK;
2100 const float zmax =
data.zmaxU;
2101 data.ITkCmSp.clear();
2105 size_t SPcapacity =
data.ITkSP.size();
2108 for (; iter_centralSP != iter_endBottomCands[0]; ++iter_centralSP)
2111 const float &R = (*iter_centralSP)->radius();
2113 if(R >
data.RTmax)
break;
2116 const float &X = (*iter_centralSP)->x();
2117 const float &Y = (*iter_centralSP)->y();
2118 const float &Z = (*iter_centralSP)->z();
2122 double absZ = std::abs(Z);
2133 for (
int cell = 0; cell < numberTopCells; ++cell)
2136 for (iter_otherSP = iter_topCands[cell]; iter_otherSP != iter_endTopCands[cell]; ++iter_otherSP)
2139 float Rt = (*iter_otherSP)->radius();
2144 iter_topCands[cell] = iter_otherSP;
2147 for (iter_otherSP = iter_topCands[cell]; iter_otherSP != iter_endTopCands[cell]; ++iter_otherSP)
2151 float Rt = (*iter_otherSP)->radius();
2157 const float dz = (*iter_otherSP)->z() - Z;
2158 const float dZdR = dz / dR;
2162 const float z0 = Z - R * dZdR;
2163 if (std::abs(dz) >
m_dzmaxSSS || std::abs(z0) > zmax)
2169 const float ax = X*Ri;
2170 const float ay = Y*Ri;
2172 float dx = (*iter_otherSP)->x() - X;
2173 float dy = (*iter_otherSP)->y() - Y;
2174 float x = dx * ax + dy * ay;
2175 float y = dy * ax - dx * ay;
2177 if(std::abs(R*
y) > maxd0cut *
x) {
2178 float r2 = 1. / (
x *
x +
y *
y);
2181 const float V0 = (
y < 0.) ? VR: -VR;
2182 float A = (v-V0)/(u+Ri) ;
2184 if((B*B) > (ipt2K*(1.+
A*
A)))
continue;
2189 data.ITkSP[Nt] = (*iter_otherSP);
2190 data.ITkSP[Nt]->setDZDR(dZdR);
2194 if (++Nt == SPcapacity)
2196 data.resizeSPCont();
2197 SPcapacity =
data.ITkSP.size();
2213 for (
int cell = 0; cell < numberBottomCells; ++cell)
2216 for(iter_otherSP=iter_bottomCands[cell]; iter_otherSP!=iter_endBottomCands[cell]; ++iter_otherSP) {
2217 if((R-(*iter_otherSP)->radius()) <=
m_drmaxSSS)
break;
2219 iter_bottomCands[cell]=iter_otherSP;
2222 for (; iter_otherSP != iter_endBottomCands[cell]; ++iter_otherSP)
2226 const float &Rb = (*iter_otherSP)->radius();
2233 const float dz = Z - (*iter_otherSP)->z();
2234 const float dZdR = dz / dR;
2238 const float z0 = Z - R * dZdR;
2239 if (std::abs(dz) >
m_dzmaxSSS || std::abs(z0) > zmax)
2245 const float ax = X*Ri;
2246 const float ay = Y*Ri;
2248 float dx = (*iter_otherSP)->x() - X;
2249 float dy = (*iter_otherSP)->y() - Y;
2250 float x = dx * ax + dy * ay;
2251 float y = dy * ax - dx * ay;
2253 if(std::abs(R*
y) > -maxd0cut *
x) {
2254 float r2 = 1. / (
x *
x +
y *
y);
2257 const float V0 = (
y < 0.) ? VR: -VR;
2258 float A = (v-V0)/(u+Ri) ;
2260 if((B*B) > (ipt2K*(1.+
A*
A)))
continue;
2265 data.ITkSP[Nb] = (*iter_otherSP);
2266 data.ITkSP[Nb]->setDZDR(dZdR);
2270 if (++Nb == SPcapacity)
2272 data.resizeSPCont();
2273 SPcapacity =
data.ITkSP.size();
2283 float covr0 = (*iter_centralSP)->covr();
2284 float covz0 = (*iter_centralSP)->covz();
2292 for (
size_t i = 0; i < Nb; ++i)
2299 float dx =
sp->x() - X;
2300 float dy =
sp->y() - Y;
2301 float dz =
sp->z() - Z;
2302 float x = dx * ax + dy * ay;
2303 float y = dy * ax - dx * ay;
2306 float r2 = 1. / (
x *
x +
y *
y);
2308 float dr = std::sqrt(r2);
2322 data.Zo[i] = Z - R * tz;
2326 data.Er[i] = ((covz0 +
sp->covz()) + (tz * tz) * (covr0 +
sp->covr())) * r2;
2330 data.nOneSeedsQ = 0;
2331 data.ITkMapOneSeeds.clear();
2332 data.ITkMapOneSeedsQ.clear();
2336 for (
size_t b = Nt; b < Nb; ++b)
2340 float Zob =
data.Zo[b];
2341 float Tzb =
data.Tz[b];
2342 float Rb2r =
data.R[b] * covr0;
2343 float Rb2z =
data.R[b] * covz0;
2344 float Erb =
data.Er[b];
2345 float Vb =
data.V[b];
2346 float Ub =
data.U[b];
2347 float Tzb2 = (1. + Tzb * Tzb);
2348 float sTzb2 = std::sqrt(Tzb2);
2349 float Se = 1. / std::sqrt(Tzb2);
2350 float Ce = Se * Tzb;
2354 float sigmaSquaredScatteringPtDependent = Tzb2 * COFK;
2355 float sigmaSquaredScatteringMinPt = Tzb2 * ipt2C;
2358 float d0max = maxd0cut;
2361 for (
size_t t = 0; t < Nt; ++t)
2388 float dU0 =
data.U[t] - Ub;
2391 float A0 = (
data.V[t] - Vb) / dU0;
2393 float Cn = Ce * std::sqrt(1. + A0 * A0);
2395 float dn[3] = {Sx - Sy * A0, Sx * A0 + Sy, Cn};
2397 if (!(*iter_centralSP)->coordinates(dn, rn))
2402 float B0 = 2. * (Vb - A0 * Ub);
2403 float Cb = 1. -
B0 *
data.Y[b];
2404 float Sb = A0 +
B0 *
data.X[b];
2405 float db[3] = {Sx * Cb - Sy * Sb, Sx * Sb + Sy * Cb, Cn};
2407 if (!
data.ITkSP[b]->coordinates(db, rb))
2412 float Ct = 1. -
B0 *
data.Y[t];
2413 float St = A0 +
B0 *
data.X[t];
2414 float dt[3] = {Sx * Ct - Sy * St, Sx * St + Sy * Ct, Cn};
2416 if (!
data.ITkSP[t]->coordinates(dt, rt))
2419 float xb = rb[0] - rn[0];
2420 float yb = rb[1] - rn[1];
2421 float zb = rb[2] - rn[2];
2422 float xt = rt[0] - rn[0];
2423 float yt = rt[1] - rn[1];
2424 float zt = rt[2] - rn[2];
2426 float rb2 = 1. / (xb * xb + yb * yb);
2427 float rt2 = 1. / (
xt *
xt +
yt *
yt);
2429 float tb = -zb * std::sqrt(rb2);
2430 float tz =
zt * std::sqrt(rt2);
2438 float meanOneOverTanTheta = (tb + tz) / 2.;
2441 float sigmaSquaredSpacePointErrors = Erb +
data.Er[t]
2442 + 2 * Rb2z *
data.R[t]
2443 + 2 * Rb2r *
data.R[t] * meanOneOverTanTheta * meanOneOverTanTheta;
2446 float remainingSquaredDelta = (tb - tz) * (tb - tz) - sigmaSquaredSpacePointErrors;
2450 if (remainingSquaredDelta - sigmaSquaredScatteringMinPt > 0)
2453 float Rn = std::sqrt(rn[0] * rn[0] + rn[1] * rn[1]);
2454 float Ax = rn[0] / Rn;
2455 float Ay = rn[1] / Rn;
2457 float ub = (xb * Ax + yb * Ay) * rb2;
2458 float vb = (yb * Ax - xb * Ay) * rb2;
2459 float ut = (
xt * Ax +
yt * Ay) * rt2;
2460 float vt = (
yt * Ax -
xt * Ay) * rt2;
2465 float A = (vt - vb) / dU;
2466 float onePlusAsquare = 1. +
A *
A;
2467 float B = vb -
A * ub;
2468 float BSquare = B * B;
2482 if (BSquare > ipt2K * onePlusAsquare || remainingSquaredDelta * onePlusAsquare > BSquare * sigmaSquaredScatteringPtDependent)
2501 float d0 = std::abs((
A - B * Rn) * Rn);
2507 float dr = std::sqrt(1 / rb2);
2509 dr = std::sqrt(1 / rt2);
2513 data.ITkSP[t]->setScorePenalty(std::abs((tb - tz) / (dr * sTzb2)));
2514 data.ITkSP[t]->setParam(d0);
2516 data.ITkSP[t]->setDR(DR);
2519 data.ITkCmSp.emplace_back(B / std::sqrt(onePlusAsquare),
data.ITkSP[t]);
2521 if (
data.ITkCmSp.size() == 500)
2527 if (!
data.ITkCmSp.empty())
2534 nseed +=
data.fillOneSeeds;
2548 const int ,
const int ,
int &)
const
2550 ATH_MSG_WARNING(
"ITk::SiSpacePointsSeedMaker::production3SpTrigger not implemented!");
2562 float worstQualityInMap = std::numeric_limits<float>::min();
2564 if (!
data.ITkMapOneSeeds.empty())
2566 std::multimap<float, SiSpacePointsProSeed *>::reverse_iterator l =
data.ITkMapOneSeeds.rbegin();
2567 worstQualityInMap = (*l).first;
2568 worstSeedSoFar = (*l).second;
2572 if (
data.nOneSeeds <
data.maxSeedsPerSP
2580 data.ITkOneSeeds[
data.nOneSeeds].set(p1, p2, p3,
z);
2581 data.ITkMapOneSeeds.insert(std::make_pair(seedCandidateQuality, &
data.ITkOneSeeds[
data.nOneSeeds]));
2586 else if (worstQualityInMap > seedCandidateQuality)
2589 worstSeedSoFar->
set(p1, p2, p3,
z);
2591 std::multimap<float, SiSpacePointsProSeed *>::iterator
2592 i =
data.ITkMapOneSeeds.insert(std::make_pair(seedCandidateQuality, worstSeedSoFar));
2594 for (++i; i !=
data.ITkMapOneSeeds.end(); ++i)
2596 if ((*i).second == worstSeedSoFar)
2598 data.ITkMapOneSeeds.erase(i);
2611 float worstQualityInMap = std::numeric_limits<float>::min();
2613 if (!
data.ITkMapOneSeedsQ.empty())
2615 std::multimap<float, SiSpacePointsProSeed *>::reverse_iterator l =
data.ITkMapOneSeedsQ.rbegin();
2616 worstQualityInMap = (*l).first;
2617 worstSeedSoFar = (*l).second;
2621 if (
data.nOneSeedsQ <
data.maxSeedsPerSP
2629 data.ITkOneSeedsQ[
data.nOneSeedsQ].set(p1, p2, p3,
z);
2630 data.ITkMapOneSeedsQ.insert(std::make_pair(seedCandidateQuality, &
data.ITkOneSeedsQ[
data.nOneSeedsQ]));
2635 else if (worstQualityInMap > seedCandidateQuality)
2638 worstSeedSoFar->
set(p1, p2, p3,
z);
2640 std::multimap<float, SiSpacePointsProSeed *>::iterator
2641 i =
data.ITkMapOneSeedsQ.insert(std::make_pair(seedCandidateQuality, worstSeedSoFar));
2643 for (++i; i !=
data.ITkMapOneSeedsQ.end(); ++i)
2645 if ((*i).second == worstSeedSoFar)
2647 data.ITkMapOneSeedsQ.erase(i);
2662 const float dC = .00003;
2667 std::vector<std::pair<float, SiSpacePointForSeed *>>
::iterator j, jn, i =
data.ITkCmSp.begin(), ie =
data.ITkCmSp.end();
2670 for (; i != ie; ++i)
2672 float u = (*i).second->param();
2673 bool pixt = !(*i).second->spacepoint->clusterList().second;
2674 if (pixt && std::abs(SPb->
z() - (*i).second->z()) >
m_dzmaxPPP)
2678 float Ri = (*i).second->radius();
2679 float Ci1 = (*i).first - dC;
2680 float Ci2 = (*i).first + dC;
2690 for (j = jn; j != ie; ++j)
2694 if ((*j).first < Ci1)
2700 if ((*j).first > Ci2)
2702 if ((*j).second->sur() == Sui)
2705 float Rj = (*j).second->radius();
2706 if (std::abs(Rj - Ri) <
m_drmin)
2717 if ((Rma - Rmi) > 20.)
2735 data.ITkCmSp.clear();
2748 data.fillOneSeeds = 0;
2750 std::multimap<float, SiSpacePointsProSeed *>::iterator it_seedCandidate =
data.ITkMapOneSeeds.begin();
2751 std::multimap<float, SiSpacePointsProSeed *>::iterator it_endSeedCandidates =
data.ITkMapOneSeeds.end();
2753 if (
data.nOneSeedsQ){
2754 it_seedCandidate =
data.ITkMapOneSeedsQ.begin();
2755 it_endSeedCandidates =
data.ITkMapOneSeedsQ.end();
2759 if (it_seedCandidate == it_endSeedCandidates)
2765 for (; it_seedCandidate != it_endSeedCandidates; ++it_seedCandidate)
2769 float quality = (*it_seedCandidate).first;
2770 theSeed = (*it_seedCandidate).second;
2777 if (
data.i_ITkSeedEnd !=
data.i_ITkSeeds.end())
2779 theSeed = &(*
data.i_ITkSeedEnd++);
2780 *theSeed = *(*it_seedCandidate).second;
2785 data.i_ITkSeeds.emplace_back(*(*it_seedCandidate).second);
2786 theSeed = &(
data.i_ITkSeeds.back());
2787 data.i_ITkSeedEnd =
data.i_ITkSeeds.end();
2790 ++
data.fillOneSeeds;
2797 if (not
data.initialized)
2800 if (
data.nspoint == 3)
2805 if (
data.i_ITkSeed ==
data.i_ITkSeedEnd)
2814 if (
data.i_ITkSeed ==
data.i_ITkSeedEnd)
2819 }
while (!(*
data.i_ITkSeed++).set3(
data.seedOutput, 1./(1000. *
data.K)));
2821 return &
data.seedOutput;
2826 if (
data.i_ITkSeed ==
data.i_ITkSeedEnd)
2830 if (
data.i_ITkSeed ==
data.i_ITkSeedEnd)
2833 (*
data.i_ITkSeed++).set2(
data.seedOutput);
2834 return &
data.seedOutput;
2840 float Zv,
float R,
float T)
const
2842 if (Zv < data.zminU || Zv >
data.zmaxU)
2847 float dZmin = std::numeric_limits<float>::max();
2848 for (
const float &v :
data.l_vertex)
2850 float dZ = std::abs(v - Zv);
2864 std::array<float, 15>
r;
2880 float z = (std::abs(
r[2]) +
m_zmax);
2881 float x =
r[0] *
data.dzdrmin;
2882 float y =
r[1] *
data.dzdrmin;
2883 if ((
z *
z) < (
x *
x +
y *
y))
2889 float R2 =
r[0] *
r[0] +
r[1] *
r[1];
2893 if (std::abs(
r[2]) -
m_zmax >
data.dzdrmax * std::sqrt(R2))
2897 if (usePixStripInform)
2899 if (!
sp->clusterList().second)
2908 if (
data.i_ITkSpacePointForSeed !=
data.l_ITkSpacePointForSeed.end())
2911 sps = &(*
data.i_ITkSpacePointForSeed++);
2919 data.l_ITkSpacePointForSeed.emplace_back(
sp,
r);
2921 sps = &(
data.l_ITkSpacePointForSeed.back());
2923 data.i_ITkSpacePointForSeed =
data.l_ITkSpacePointForSeed.end();
2938 if (
data.i_ITkSeedEnd !=
data.i_ITkSeeds.end())
2941 s->set(p1, p2, p3,
z);
2945 data.i_ITkSeeds.emplace_back(p1, p2, p3,
z);
2946 data.i_ITkSeedEnd =
data.i_ITkSeeds.end();
2954 seedArrayPerSPSize = 50;
2968 double magField[3]{0, 0, 0};
2969 double globalPos[3] = {10., 10., 0.};
2974 if (fieldCondObj ==
nullptr) {
2994 data.K = 2. / (300. * magField[2]);
2996 data.K = 2. / (300. * 5.);
3008 data.bField[0] = magField[0];
3009 data.bField[1] = magField[1];
3010 data.bField[2] = magField[2];
3030 static const float curvatureInterval = .00003;
3033 if (
data.ITkCmSp.size() > 2)
3036 std::vector<std::pair<float, SiSpacePointForSeed *>>
::iterator it_otherSP;
3037 std::vector<std::pair<float, SiSpacePointForSeed *>>
::iterator it_commonTopSP =
data.ITkCmSp.begin(), ie =
data.ITkCmSp.end();
3038 std::vector<std::pair<float, SiSpacePointForSeed *>>
::iterator it_startInnerLoop = it_commonTopSP;
3043 for (; it_commonTopSP != ie; ++it_commonTopSP)
3049 float seedIP = SPt->
param();
3052 float minCurvature = (*it_commonTopSP).first - curvatureInterval;
3053 float maxCurvature = (*it_commonTopSP).first + curvatureInterval;
3061 for (it_otherSP = it_startInnerLoop; it_otherSP != ie; ++it_otherSP)
3064 if (it_otherSP == it_commonTopSP)
3068 if ((*it_otherSP).first < minCurvature)
3070 it_startInnerLoop = it_otherSP;
3071 ++it_startInnerLoop;
3075 if ((*it_otherSP).first > maxCurvature)
3078 float L = (*it_otherSP).second->dR();
3081 for (; k != NT; ++k)
3083 if (std::abs(L - Lt[k]) < 20.)
3095 float Q = seedIP - float(NT) * 100.;
3101 data.ITkCmSp.clear();
3117 static const float curvatureInterval = .00003;
3120 if (
data.ITkCmSp.size() > 2)
3123 std::vector<std::pair<float, SiSpacePointForSeed *>>
::iterator it_otherSP;
3124 std::vector<std::pair<float, SiSpacePointForSeed *>>
::iterator it_commonTopSP =
data.ITkCmSp.begin(), ie =
data.ITkCmSp.end();
3125 std::vector<std::pair<float, SiSpacePointForSeed *>>
::iterator it_startInnerLoop = it_commonTopSP;
3130 float Rb = 2. * SPb->
radius();
3137 bool Qm = Rb < 120. || std::abs(Zob) > 150.;
3140 for (; it_commonTopSP != ie; ++it_commonTopSP)
3146 float seedIP = SPt->
param();
3149 float minCurvature = (*it_commonTopSP).first - curvatureInterval;
3150 float maxCurvature = (*it_commonTopSP).first + curvatureInterval;
3158 for (it_otherSP = it_startInnerLoop; it_otherSP != ie; ++it_otherSP)
3161 if (it_otherSP == it_commonTopSP)
3165 if ((*it_otherSP).first < minCurvature)
3167 it_startInnerLoop = it_otherSP;
3168 ++it_startInnerLoop;
3172 if ((*it_otherSP).first > maxCurvature)
3175 float L = (*it_otherSP).second->dR();
3178 for (; k != NT; ++k)
3180 if (std::abs(L - Lt[k]) < 20.)
3192 if (dN < 0 || (
data.nOneSeedsQ && !dN))
3194 if (Qm && !dN && seedIP > 1.)
3198 float Q = 100. * seedIP + (std::abs(Zob) - float(NT) * 100.);
3210 if (SPmin && !
data.nOneSeedsQ)
3212 data.ITkCmSp.clear();
3219 static const float curvatureInterval = .00003;
3221 float bottomSPQuality = SPb->
quality();
3222 float centralSPQuality = SP0->
quality();
3225 if (
data.ITkCmSp.size() > 2)
3228 float bottomR = SPb->
radius();
3229 float bottomZ = SPb->
z();
3231 std::vector<std::pair<float, SiSpacePointForSeed *>>
::iterator it_otherSP;
3232 std::vector<std::pair<float, SiSpacePointForSeed *>>
::iterator it_commonTopSP =
data.ITkCmSp.begin(), ie =
data.ITkCmSp.end();
3233 std::vector<std::pair<float, SiSpacePointForSeed *>>
::iterator it_startInnerLoop = it_commonTopSP;
3236 for (; it_commonTopSP != ie; ++it_commonTopSP)
3241 float seedIP = SPt->
param();
3243 float originalSeedQuality = seedQuality;
3248 float topR = SPt->
radius();
3249 float topZ = SPt->
z();
3251 float Zot = std::abs(topR - bottomR) > 10e-9 ? bottomZ - (bottomR - originalSeedQuality) * ((topZ - bottomZ) / (topR - bottomR)) : bottomZ;
3253 float theta1 = std::abs(topR - bottomR) > 10e-9 ? std::atan2(topR - bottomR, topZ - bottomZ) : 0.;
3254 float eta1 = theta1 > 0 ? -std::log(std::tan(.5 * theta1)) : 0.;
3256 float theta0 = seedIP > 0 ? std::atan2(seedIP, Zot) : 0;
3257 float eta0 = theta0 > 0 ? -std::log(std::tan(.5 * theta0)) : 0.;
3259 float deltaEta = std::abs(eta1 - eta0);
3261 float f = std::min(0.5, originalSeedQuality / 200.);
3262 seedQuality *= (1 - f) / 300.;
3263 seedQuality += f * deltaEta / 2.5;
3270 float radiusTopSP = SPt->
radius();
3272 float minCurvature = (*it_commonTopSP).first - curvatureInterval;
3273 float maxCurvature = (*it_commonTopSP).first + curvatureInterval;
3283 if (!bottomSPisPixel)
3286 else if (topSPisPixel)
3295 for (it_otherSP = it_startInnerLoop; it_otherSP != ie; ++it_otherSP)
3298 if (it_otherSP == it_commonTopSP)
3302 if ((*it_otherSP).first < minCurvature)
3304 it_startInnerLoop = it_otherSP;
3305 ++it_startInnerLoop;
3309 if ((*it_otherSP).first > maxCurvature)
3312 if ((*it_otherSP).second->sur() == surfaceTopSP)
3315 float radiusOtherSP = (*it_otherSP).second->radius();
3325 if (seedQuality >
data.maxScore)
3330 if (bottomSPisPixel != topSPisPixel)
3332 if (seedQuality > 0. ||
3333 (seedQuality > bottomSPQuality && seedQuality > centralSPQuality && seedQuality > SPt->
quality()))
3343 if (!bottomSPisPixel)
3345 if (seedIP > maxdImpact)
3351 data.ITkCmSp.clear();
3370 return (quality < 0.);
3376 std::lock_guard<std::mutex> lock(
m_mutex);
3378 if(track !=
nullptr) {
3379 m_trackPt = (track->trackParameters()->front()->pT())/1000.f;
3380 m_trackEta = std::abs(track->trackParameters()->front()->eta());
3387 m_z0 = seed->zVertex();
3388 m_eta = seed->eta();
3402 m_dzdr_b = seed->dzdr_b();
3403 m_dzdr_t = seed->dzdr_t();
3405 m_givesTrack = !(track ==
nullptr);
3406 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_WARNING(x)
char data[hepevt_bytes_allocation_ATLAS]
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
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
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
static void stripInform(EventData &data, const Trk::SpacePoint *sp, float *r)
void initializeEventData(EventData &data, const EventContext &ctx) const
std::string m_treeName ATLAS_THREAD_SAFE
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