17 const std::string&
name,
29 ATH_MSG_INFO(
"Use SCT SP overlap cuts based on layer number parity");
31 return StatusCode::SUCCESS;
40 std::vector<StripSP>& overlapSpacePoints,
42 const std::vector<IdentifierHash>& hashesToProcess,
87 const auto hashesProc = (hashesToProcess.size() > 0 ? hashesToProcess : stripAccessor.
allIdentifiers());
88 for (
auto& idHash : hashesProc) {
92 const std::vector<IdentifierHash>* others(
properties.neighbours(idHash));
93 if (others==
nullptr || others->empty() )
100 size_t neighbour = 0;
101 while (not
search and neighbour<others->
size() ) {
109 std::array<std::vector<std::pair<const xAOD::StripCluster*, size_t>>,
nNeighbours> neighbourClusters{};
110 std::array<const InDetDD::SiDetectorElement*, nNeighbours> neighbourElements{};
112 auto groupStart = clusterContainer.
begin();
114 neighbourElements[0] = thisElement;
118 neighbourClusters[0].push_back(std::make_pair(*
start, position));
125 std::array<double, 14> overlapExtents{};
135 if(not processOverlaps) Nmax = 2;
147 for (
const auto& otherHash : *others) {
156 neighbourElements[neigbourIndices[
n]] = otherElement;
160 neighbourClusters[neigbourIndices[
n]].push_back(std::make_pair(*
start, position));
171 overlapExtents[ 6] =-hwidth;
174 overlapExtents[ 9] = hwidth;
179 overlapExtents[11] = hwidth;
180 overlapExtents[12] =-hwidth;
210 return StatusCode::SUCCESS;
215 const std::array<const InDetDD::SiDetectorElement*, nNeighbours>& elements,
217 const std::array<double, 14>& overlapExtents,
220 std::vector<StripSP>& overlapSpacePoints )
const
244 constexpr
int otherSideIndex{1};
245 constexpr
int maxEtaIndex{3};
253 elementIndex[nElements++] =
n;
257 if(!nElements)
return StatusCode::SUCCESS;
261 bool isEndcap = element->
isEndcap();
263 std::vector<StripInformationHelper> stripInfos;
267 for (
auto& cluster_index :
clusters[0]) {
268 size_t stripIndex = -1;
269 auto ends =
getStripEnds(cluster_index.first, element, stripIndex);
270 const auto& localPos = cluster_index.first->localPosition<1>();
271 StripInformationHelper stripInfo(cluster_index.first->identifierHash(), ends.first, ends.second, beamSpotVertex, localPos(0, 0), cluster_index.second, stripIndex);
272 stripInfos.push_back( std::move(stripInfo) );
281 for(;
n < nElements; ++
n) {
282 int currentIndex = elementIndex[
n];
283 if(currentIndex > maxEtaIndex)
break;
289 double min = overlapExtents[currentIndex*2-2];
290 double max = overlapExtents[currentIndex*2-1];
300 for (
auto& cluster_index :
clusters[currentIndex]) {
301 bool processed =
false;
302 const auto& currentLocalPos = cluster_index.first->localPosition<1>();
304 for(
auto& stripInfo : stripInfos) {
305 double diff = currentLocalPos(0, 0)-stripInfo.locX();
310 if(diff < min || diff >
max)
continue;
314 size_t currentStripIndex = 0;
315 auto ends =
getStripEnds(cluster_index.first, currentElement, currentStripIndex);
316 currentStripInfo.
set(cluster_index.first->identifierHash(), ends.first, ends.second, beamSpotVertex, currentLocalPos(0, 0), cluster_index.second, currentStripIndex);
320 if (currentIndex==otherSideIndex) {
330 for(;
n < nElements; ++
n) {
331 int currentIndex = elementIndex[
n];
334 double min = overlapExtents[4*currentIndex-10];
335 double max = overlapExtents[4*currentIndex- 9];
345 std::vector<StripInformationHelper*> stripPhiInfos;
346 stripPhiInfos.reserve(stripInfos.size());
348 for(
auto& stripInfo : stripInfos) {
349 auto stripIndex = stripInfo.stripIndex();
350 auto localPosition = stripInfo.locX();
351 auto centralValue = localPosition;
355 centralValue = stripIndex;
361 stripPhiInfos.push_back(&stripInfo);
365 if(stripPhiInfos.empty())
continue;
367 min = overlapExtents[4*currentIndex-8];
368 max = overlapExtents[4*currentIndex-7];
375 for (
auto& cluster_index :
clusters[currentIndex]) {
376 const auto& currentLocalPos = cluster_index.first->localPosition<1>();
378 size_t currentStripIndex = 0;
379 auto ends =
getStripEnds(cluster_index.first, currentElement, currentStripIndex);
380 StripInformationHelper currentStripInfo(cluster_index.first->identifierHash(), ends.first, ends.second, beamSpotVertex, currentLocalPos(0, 0), cluster_index.second, currentStripIndex);
381 auto centralValue = currentLocalPos(0, 0);
385 centralValue = currentStripIndex;
390 if (centralValue < minValue or centralValue >
maxValue)
393 for(
auto& stripInfo : stripPhiInfos) {
398 return StatusCode::SUCCESS;
401 for(
int n=0;
n!=nElements; ++
n) {
403 int currentIndex = elementIndex[
n];
407 offset(element, currentElement, slimit);
410 for (
auto& cluster_index :
clusters[currentIndex]) {
411 size_t currentStripIndex = 0;
412 auto ends =
getStripEnds(cluster_index.first, element, currentStripIndex);
413 const auto& currentLocalPos = cluster_index.first->localPosition<1>();
414 StripInformationHelper currentStripInfo(cluster_index.first->identifierHash(), ends.first, ends.second, beamSpotVertex, currentLocalPos(0, 0), cluster_index.second, currentStripIndex);
416 for(
auto& stripInfo : stripInfos) {
418 if (currentIndex==otherSideIndex) {
426 return StatusCode::SUCCESS;
430 std::vector<StripSP>& collection,
441 if(std::abs(
a) > (std::abs(
b)*
l0)) {
442 return StatusCode::SUCCESS;
449 if(std::abs(
c) > (std::abs(
d)*
l1)) {
450 return StatusCode::SUCCESS;
460 double dmn = (
n-1.)*cs;
461 if(dmn >
dm)
dm = dmn;
464 return StatusCode::SUCCESS;
469 double dmn = -(1.+
n)*cs;
470 if(dmn >
dm)
dm = dmn;
473 return StatusCode::SUCCESS;
483 float covTerm = 1600.*
deltaY;
485 Eigen::Matrix<float, 2, 1> variance(0.1, 8.*covTerm);
488 std::swap( variance(0, 0), variance(1, 0) );
492 Eigen::Matrix<double, 3, 1> topStripDirection = -firstInfo.
stripDirection()/(2.*topHalfStripLength);
493 Eigen::Matrix<double, 3, 1> topStripCenter = 0.5*firstInfo.
trajDirection();
495 float bottomHalfStripLength = 0.5*secondInfo.
stripDirection().norm();
496 Eigen::Matrix<double, 3, 1> bottomStripDirection = -secondInfo.
stripDirection()/(2.*bottomHalfStripLength);
505 toAdd.globPos = globalPosition.cast<
float>();
506 toAdd.cov_r = variance(0,0);
507 toAdd.cov_z = variance(1,0);
508 toAdd.measurementIndexes = measIndexes;
509 toAdd.topHalfStripLength = topHalfStripLength;
510 toAdd.bottomHalfStripLength = bottomHalfStripLength;
511 toAdd.topStripDirection = topStripDirection.cast<
float>();
512 toAdd.bottomStripDirection = bottomStripDirection.cast<
float>();
513 toAdd.stripCenterDistance = stripCenterDistance.cast<
float>();
514 toAdd.topStripCenter = topStripCenter.cast<
float>();
516 collection.push_back(
toAdd);
518 return StatusCode::SUCCESS;
523 double& stripLengthGapTolerance)
const
530 double x12 = T1(0,0)*T2(0,0)+T1(1,0)*T2(1,0)+T1(2,0)*T2(2,0);
531 double r = isAnnulus ? std::sqrt(C[0]*C[0]+C[1]*C[1]) : std::sqrt(T1(0,3)*T1(0,3)+T1(1,3)*T1(1,3));
532 double s = (T1(0,3)-T2(0,3))*T1(0,2)+(T1(1,3)-T2(1,3))*T1(1,2)+(T1(2,3)-T2(2,3))*T1(2,2);
535 double d = isAnnulus ?
dm/.04 :
dm/std::sqrt((1.-x12)*(1.+x12));
537 if (std::abs(T1(2,2)) > 0.7)
d*=(
r/std::abs(T1(2,3)));
539 stripLengthGapTolerance =
d;
546 double& stripLengthGapTolerance,
547 double&
min,
double&
max)
const
549 double dm =
offset(element1, element2, stripLengthGapTolerance);
566 if ( design==
nullptr ) {
575 double radius = firstPosition.xEta();
596 std::pair<Amg::Vector3D, Amg::Vector3D >
599 size_t& stripIndex)
const
601 const Eigen::Matrix<float,1,1>& localPos = cluster->localPosition<1>();
607 if ( design==
nullptr ) {
609 return std::pair<Amg::Vector3D, Amg::Vector3D >();
614 stripIndex = -std::floor(localPos(0, 0) / phiPitchPhi) + design->
diodesInRow(0) *0.5 - 0.5;
616 std::pair<Amg::Vector3D, Amg::Vector3D > ends = {
625 std::pair<Amg::Vector3D, Amg::Vector3D > ends(element->
endsOfStrip(localPosition));