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());
95 for (
auto& idHash : hashesProc) {
99 const std::vector<IdentifierHash>* others(
properties.neighbours(idHash));
100 if (others==
nullptr || others->empty() )
107 size_t neighbour = 0;
108 while (not
search and neighbour<others->
size() ) {
116 std::array<std::vector<std::pair<const xAOD::StripCluster*, size_t>>,
nNeighbours> neighbourClusters{};
117 std::array<const InDetDD::SiDetectorElement*, nNeighbours> neighbourElements{};
119 auto groupStart = clusterContainer.
begin();
121 neighbourElements[0] = thisElement;
125 neighbourClusters[0].push_back(std::make_pair(*
start, position));
132 std::array<double, 14> overlapExtents{};
142 if(not processOverlaps) Nmax = 2;
144 double hwidth(
static_cast<double>(
properties.halfWidth(idHash)));
154 for (
const auto& otherHash : *others) {
163 neighbourElements[neigbourIndices[
n]] = otherElement;
167 neighbourClusters[neigbourIndices[
n]].push_back(std::make_pair(*
start, position));
173 overlapExtents[ 0] = -overlapLimitOpposite;
174 overlapExtents[ 1] = overlapLimitOpposite;
178 overlapExtents[ 6] =-hwidth;
179 overlapExtents[ 7] =-hwidth+overlapLimitPhi;
180 overlapExtents[ 8] = hwidth-overlapLimitPhi;
181 overlapExtents[ 9] = hwidth;
185 overlapExtents[10] = hwidth-overlapLimitPhi;
186 overlapExtents[11] = hwidth;
187 overlapExtents[12] =-hwidth;
188 overlapExtents[13] =-hwidth+overlapLimitPhi;
192 overlapExtents[ 2] = overlapLimitEtaMin;
193 overlapExtents[ 3] = overlapLimitEtaMax;
195 overlapExtents[ 2] =-overlapLimitEtaMax;
196 overlapExtents[ 3] =-overlapLimitEtaMin;
201 overlapExtents[ 4] = overlapLimitEtaMin;
202 overlapExtents[ 5] = overlapLimitEtaMax;
204 overlapExtents[ 4] = -overlapLimitEtaMax;
205 overlapExtents[ 5] = -overlapLimitEtaMin;
217 return StatusCode::SUCCESS;
222 const std::array<const InDetDD::SiDetectorElement*, nNeighbours>& elements,
224 const std::array<double, 14>& overlapExtents,
227 std::vector<StripSP>& overlapSpacePoints )
const
251 constexpr
int otherSideIndex{1};
252 constexpr
int maxEtaIndex{3};
260 elementIndex[nElements++] =
n;
264 if(!nElements)
return StatusCode::SUCCESS;
268 bool isEndcap = element->
isEndcap();
270 std::vector<StripInformationHelper> stripInfos;
274 for (
auto& cluster_index :
clusters[0]) {
275 size_t stripIndex = -1;
276 auto ends =
getStripEnds(cluster_index.first, element, stripIndex);
277 const auto& localPos = cluster_index.first->localPosition<1>();
278 StripInformationHelper stripInfo(cluster_index.first->identifierHash(), ends.first, ends.second, beamSpotVertex, localPos(0, 0), cluster_index.second, stripIndex);
279 stripInfos.push_back( std::move(stripInfo) );
288 for(;
n < nElements; ++
n) {
289 int currentIndex = elementIndex[
n];
290 if(currentIndex > maxEtaIndex)
break;
296 double min = overlapExtents[currentIndex*2-2];
297 double max = overlapExtents[currentIndex*2-1];
307 for (
auto& cluster_index :
clusters[currentIndex]) {
308 bool processed =
false;
309 const auto& currentLocalPos = cluster_index.first->localPosition<1>();
311 for(
auto& stripInfo : stripInfos) {
312 double diff = currentLocalPos(0, 0)-stripInfo.locX();
317 if(diff < min || diff >
max)
continue;
321 size_t currentStripIndex = 0;
322 auto ends =
getStripEnds(cluster_index.first, currentElement, currentStripIndex);
323 currentStripInfo.
set(cluster_index.first->identifierHash(), ends.first, ends.second, beamSpotVertex, currentLocalPos(0, 0), cluster_index.second, currentStripIndex);
327 if (currentIndex==otherSideIndex) {
337 for(;
n < nElements; ++
n) {
338 int currentIndex = elementIndex[
n];
341 double min = overlapExtents[4*currentIndex-10];
342 double max = overlapExtents[4*currentIndex- 9];
352 std::vector<StripInformationHelper*> stripPhiInfos;
353 stripPhiInfos.reserve(stripInfos.size());
355 for(
auto& stripInfo : stripInfos) {
356 auto stripIndex = stripInfo.stripIndex();
357 auto localPosition = stripInfo.locX();
358 auto centralValue = localPosition;
362 centralValue = stripIndex;
368 stripPhiInfos.push_back(&stripInfo);
372 if(stripPhiInfos.empty())
continue;
374 min = overlapExtents[4*currentIndex-8];
375 max = overlapExtents[4*currentIndex-7];
382 for (
auto& cluster_index :
clusters[currentIndex]) {
383 const auto& currentLocalPos = cluster_index.first->localPosition<1>();
385 size_t currentStripIndex = 0;
386 auto ends =
getStripEnds(cluster_index.first, currentElement, currentStripIndex);
387 StripInformationHelper currentStripInfo(cluster_index.first->identifierHash(), ends.first, ends.second, beamSpotVertex, currentLocalPos(0, 0), cluster_index.second, currentStripIndex);
388 auto centralValue = currentLocalPos(0, 0);
392 centralValue = currentStripIndex;
397 if (centralValue < minValue or centralValue >
maxValue)
400 for(
auto& stripInfo : stripPhiInfos) {
405 return StatusCode::SUCCESS;
408 for(
int n=0;
n!=nElements; ++
n) {
410 int currentIndex = elementIndex[
n];
414 offset(element, currentElement, slimit);
417 for (
auto& cluster_index :
clusters[currentIndex]) {
418 size_t currentStripIndex = 0;
419 auto ends =
getStripEnds(cluster_index.first, element, currentStripIndex);
420 const auto& currentLocalPos = cluster_index.first->localPosition<1>();
421 StripInformationHelper currentStripInfo(cluster_index.first->identifierHash(), ends.first, ends.second, beamSpotVertex, currentLocalPos(0, 0), cluster_index.second, currentStripIndex);
423 for(
auto& stripInfo : stripInfos) {
425 if (currentIndex==otherSideIndex) {
433 return StatusCode::SUCCESS;
437 std::vector<StripSP>& collection,
448 if(std::abs(
a) > (std::abs(
b)*
l0)) {
449 return StatusCode::SUCCESS;
456 if(std::abs(
c) > (std::abs(
d)*
l1)) {
457 return StatusCode::SUCCESS;
467 double dmn = (
n-1.)*cs;
468 if(dmn >
dm)
dm = dmn;
471 return StatusCode::SUCCESS;
476 double dmn = -(1.+
n)*cs;
477 if(dmn >
dm)
dm = dmn;
480 return StatusCode::SUCCESS;
489 constexpr
float deltaY = 0.0004;
490 constexpr
float covTerm = 1600.*
deltaY;
492 Eigen::Matrix<float, 2, 1> variance(0.1
f, 8.
f*covTerm);
495 std::swap( variance(0, 0), variance(1, 0) );
498 double topHalfStripLength = 0.5*firstInfo.
stripDirection().norm();
499 Eigen::Matrix<double, 3, 1> topStripDirection = -firstInfo.
stripDirection()/(2.*topHalfStripLength);
500 Eigen::Matrix<double, 3, 1> topStripCenter = 0.5*firstInfo.
trajDirection();
502 double bottomHalfStripLength = 0.5*secondInfo.
stripDirection().norm();
503 Eigen::Matrix<double, 3, 1> bottomStripDirection = -secondInfo.
stripDirection()/(2.*bottomHalfStripLength);
511 toAdd.globPos = globalPosition.cast<
float>();
512 toAdd.cov_r = variance(0,0);
513 toAdd.cov_z = variance(1,0);
515 toAdd.topHalfStripLength =
static_cast<float>(topHalfStripLength);
516 toAdd.bottomHalfStripLength =
static_cast<float>(bottomHalfStripLength);
517 toAdd.topStripDirection = topStripDirection.cast<
float>();
518 toAdd.bottomStripDirection = bottomStripDirection.cast<
float>();
519 toAdd.stripCenterDistance = stripCenterDistance.cast<
float>();
520 toAdd.topStripCenter = topStripCenter.cast<
float>();
522 collection.push_back(std::move(
toAdd));
524 return StatusCode::SUCCESS;
529 double& stripLengthGapTolerance)
const
536 double x12 = T1(0,0)*T2(0,0)+T1(1,0)*T2(1,0)+T1(2,0)*T2(2,0);
537 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));
538 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);
541 double d = isAnnulus ?
dm/.04 :
dm/std::sqrt((1.-x12)*(1.+x12));
543 if (std::abs(T1(2,2)) > 0.7)
d*=(
r/std::abs(T1(2,3)));
545 stripLengthGapTolerance =
d;
552 double& stripLengthGapTolerance,
553 double&
min,
double&
max)
const
555 double dm =
offset(element1, element2, stripLengthGapTolerance);
573 if ( design==
nullptr ) {
582 double radius = firstPosition.xEta();
603 std::pair<Amg::Vector3D, Amg::Vector3D >
606 size_t& stripIndex)
const
608 const Eigen::Matrix<float,1,1>& localPos = cluster->
localPosition<1>();
614 if ( design==
nullptr ) {
616 return std::pair<Amg::Vector3D, Amg::Vector3D >();
621 stripIndex = -std::floor(localPos(0, 0) / phiPitchPhi) + design->
diodesInRow(0) *0.5 - 0.5;
623 std::pair<Amg::Vector3D, Amg::Vector3D > ends = {
632 std::pair<Amg::Vector3D, Amg::Vector3D > ends(element->
endsOfStrip(localPosition));