ATLAS Offline Software
Loading...
Searching...
No Matches
ActsTrk::StripSpacePointFormationToolBase Class Referenceabstract

Common machinery for producing strip space points. More...

#include <StripSpacePointFormationToolBase.h>

Inheritance diagram for ActsTrk::StripSpacePointFormationToolBase:
Collaboration diagram for ActsTrk::StripSpacePointFormationToolBase:

Public Member Functions

AthAlgTool methods
virtual ~StripSpacePointFormationToolBase ()=default
virtual StatusCode initialize () override

Protected Attributes

Id helpers
const SCT_IDm_stripId {}
Configuration flags
Gaudi::Property< bool > m_allClusters {this, "AllClusters", false, "Process all clusters without limits."}
Gaudi::Property< bool > m_isITk {this, "isITk", true, "True if running in ITk"}

Private Attributes

tool handles
ToolHandle< ISiLorentzAngleToolm_lorentzAngleTool
 Using Lorentz angle tool.

Cut parameters

The following are ranges within which clusters must lie to make a spacepoint.

Opposite and eta neighbours clusters must lie within range of each other. Phi clusters must lie in region of each wafer separately.

Gaudi::Property< float > m_stripLengthTolerance {this, "StripLengthTolerance", 0.01}
Gaudi::Property< float > m_stripGapParameter {this, "StripGapParameter", 0.0015, "Recommend 0.001 - 0.0015 for ITK geometry"}
Gaudi::Property< float > m_overlapLimitOpposite {this, "OverlapLimitOpposite", 2.8, "Overlap limit for opposite-neighbour."}
Gaudi::Property< float > m_overlapLimitPhi {this, "OverlapLimitPhi", 5.64, "Overlap limit for phi-neighbours."}
Gaudi::Property< float > m_overlapLimitEtaMin {this, "OverlapLimitEtaMin", 1.68, "Low overlap limit for eta-neighbours."}
Gaudi::Property< float > m_overlapLimitEtaMax {this, "OverlapLimitEtaMax", 3.0, "High overlap limit for eta-neighbours."}
Gaudi::Property< bool > m_useSCTLayerDep_OverlapCuts {this,"useSCTLayerDep_OverlapCuts", true}

Production of space points

virtual StatusCode produceSpacePoints (const EventContext &ctx, const xAOD::StripClusterContainer &clusterContainer, const InDet::SiElementPropertiesTable &properties, const InDetDD::SiDetectorElementCollection &elements, const Amg::Vector3D &beamSpotVertex, std::vector< StripSP > &spacePoints, std::vector< StripSP > &overlapSpacePoints, bool processOverlaps, const std::vector< IdentifierHash > &hashesToProcess, const ContainerAccessor< xAOD::StripCluster, IdentifierHash, 1 > &stripAccessor) const override
virtual StatusCode makeStripSpacePoint (std::vector< StripSP > &collection, const StripInformationHelper &firstInfo, const StripInformationHelper &secondInfo, const Amg::Vector3D &beamSpotVertex, bool isEndcap, double limit, double slimit) const =0
 Compute the space point position for a compatible pair of strips and, if it satisfies the geometrical requirements, append it to the collection.
static StripSP makeStripSP (const Eigen::Matrix< double, 3, 1 > &globalPosition, const StripInformationHelper &firstInfo, const StripInformationHelper &secondInfo, bool isEndcap)
 Fill the StripSP payload that is common to all implementations, i.e.
StatusCode fillStripSpacePoints (const std::array< const InDetDD::SiDetectorElement *, nNeighbours > &neighbourElements, const std::array< std::vector< std::pair< const xAOD::StripCluster *, size_t > >, nNeighbours > &neighbourClusters, const std::array< double, 14 > &overlapExtents, const Amg::Vector3D &beamSpotVertex, std::vector< StripSP > &spacePoints, std::vector< StripSP > &overlapSpacePoints) const
void updateRange (const InDetDD::SiDetectorElement *element1, const InDetDD::SiDetectorElement *element2, double &stripLengthGapTolerance, double &min, double &max) const
double offset (const InDetDD::SiDetectorElement *element1, const InDetDD::SiDetectorElement *element2, double &stripLengthGapTolerance) const
void correctPolarRange (const InDetDD::SiDetectorElement *element, double &min, double &max, size_t &minStrip, size_t &maxStrip) const
std::pair< Amg::Vector3D, Amg::Vector3DgetStripEnds (const xAOD::StripCluster *cluster, const InDetDD::SiDetectorElement *element, size_t &stripIndex) const

Detailed Description

Common machinery for producing strip space points.

Strip space points are made by combining clusters from pairs of overlapping detectors. The access to overlapping detector elements is possible using the ContainerAccessor. The user can choose just to process the detector element and its opposite on the stereo layer, or also to consider overlaps with the four nearest neighbours of the opposite elements.

This base class owns the neighbour search, the compatibility windows and the strip geometry helpers. Computing the space point position from a compatible pair of strips is left to the derived class, see makeStripSpacePoint.

Space points are then recorded to storegate as StripSP

Definition at line 38 of file StripSpacePointFormationToolBase.h.

Constructor & Destructor Documentation

◆ ~StripSpacePointFormationToolBase()

virtual ActsTrk::StripSpacePointFormationToolBase::~StripSpacePointFormationToolBase ( )
virtualdefault

Member Function Documentation

◆ correctPolarRange()

void ActsTrk::StripSpacePointFormationToolBase::correctPolarRange ( const InDetDD::SiDetectorElement * element,
double & min,
double & max,
size_t & minStrip,
size_t & maxStrip ) const
private

Definition at line 452 of file StripSpacePointFormationToolBase.cxx.

457 {
458 // for Inner Detector SCT, gap = 0 in config.
459 if (element->isBarrel() or (not m_isITk))
460 return;
461
462 // design for endcap modules
463 const InDetDD::StripStereoAnnulusDesign *design
464 = dynamic_cast<const InDetDD::StripStereoAnnulusDesign *> (&element->design());
465 if ( design==nullptr ) {
466 ATH_MSG_FATAL( "Invalid strip annulus design for module with identifier/identifierHash " << element->identify() << "/" << element->identifyHash());
467 return;
468 }
469
470 // converting min and max from cartesian reference frame to polar frame
471 auto firstPosition = (design->localPositionOfCell(design->strip1Dim(0, 0))+
472 design->localPositionOfCell(design->strip1Dim(design->diodesInRow(0)-1, 0)))*0.5;
473
474 double radius = firstPosition.xEta();
475
476 InDetDD::SiCellId minCellId = element->cellIdOfPosition(InDetDD::SiLocalPosition(radius, min, 0.));
477 InDetDD::SiCellId maxCellId = element->cellIdOfPosition(InDetDD::SiLocalPosition(radius, max, 0.));
478
479 if (not minCellId.isValid()) {
480 minCellId = InDetDD::SiCellId(0);
481 }
482
483 if (not maxCellId.isValid()) {
484 maxCellId = InDetDD::SiCellId(design->diodesInRow(0)-1);
485 }
486
487 minStrip = minCellId.strip();
488 maxStrip = maxCellId.strip();
489
490 // re-evaluate min and max in polar coordinate
491 min = std::atan2(min, radius);
492 max = std::atan2(max, radius);
493 }
#define ATH_MSG_FATAL(x,...)
#define min(a, b)
Definition cfImp.cxx:40
#define max(a, b)
Definition cfImp.cxx:41
int strip() const
Get strip number. Equivalent to phiIndex().
Definition SiCellId.h:131
bool isValid() const
Test if its in a valid state.
Definition SiCellId.h:136
virtual const SiDetectorDesign & design() const override final
access to the local description (inline):
SiCellId cellIdOfPosition(const Amg::Vector2D &localPos) const
As in previous method but returns SiCellId.
virtual IdentifierHash identifyHash() const override final
identifier hash (inline)
virtual Identifier identify() const override final
identifier of this detector element (inline)
virtual int strip1Dim(int strip, int row) const override
only relevant for SCT.
virtual SiLocalPosition localPositionOfCell(const SiCellId &cellId) const override
id -> position
virtual int diodesInRow(const int row) const override

◆ fillStripSpacePoints()

StatusCode ActsTrk::StripSpacePointFormationToolBase::fillStripSpacePoints ( const std::array< const InDetDD::SiDetectorElement *, nNeighbours > & neighbourElements,
const std::array< std::vector< std::pair< const xAOD::StripCluster *, size_t > >, nNeighbours > & neighbourClusters,
const std::array< double, 14 > & overlapExtents,
const Amg::Vector3D & beamSpotVertex,
std::vector< StripSP > & spacePoints,
std::vector< StripSP > & overlapSpacePoints ) const
private

Definition at line 179 of file StripSpacePointFormationToolBase.cxx.

186 {
187
188 // Build space points from pairs of clusters on compatible detector elements.
189 // For the opposite and eta-overlapping elements the two clusters must be within
190 // the phi distance window of each other. For the phi-overlapping elements both
191 // clusters must additionally sit on the matching edges of their own modules.
192
193 constexpr int otherSideIndex{1};
194 constexpr int maxEtaIndex{3};
195 std::array<int, nNeighbours-1> elementIndex{};
196 int nElements = 0;
197
198 // For the nNeighbours sides, fill elementIndex with the indices of the existing elements.
199 // Same the number of elements in nElements to loop on the later on
200 for(int n=1; n!=nNeighbours; ++n) {
201 if(elements[n]) {
202 elementIndex[nElements++] = n;
203 }
204 }
205 // return if all detector elements are nullptr
206 if(!nElements) return StatusCode::SUCCESS;
207
208 // trigger element and clusters
209 const InDetDD::SiDetectorElement* element = elements[0];
210 bool isEndcap = element->isEndcap();
211
212 std::vector<StripInformationHelper> stripInfos;
213 stripInfos.reserve(clusters[0].size());
214
215 // loop on all clusters on the trigger detector element and save the related information
216 for (auto& cluster_index : clusters[0]) {
217 size_t stripIndex = -1;
218 auto ends = getStripEnds(cluster_index.first, element, stripIndex);
219 const auto& localPos = cluster_index.first->localPosition<1>();
220 StripInformationHelper stripInfo(cluster_index.first->identifierHash(), ends.first, ends.second, beamSpotVertex, localPos(0, 0), cluster_index.second, stripIndex);
221 stripInfos.push_back( std::move(stripInfo) );
222 }
223
224 double limit = 1. + m_stripLengthTolerance;
225 double slimit = 0.;
226
227 if(not m_allClusters) {
228 // Start processing the opposite side and the eta overlapping elements
229 int n = 0;
230 for(; n < nElements; ++n) {
231 int currentIndex = elementIndex[n];
232 if(currentIndex > maxEtaIndex) break;
233
234 // get the detector element and the IdentifierHash
235 const InDetDD::SiDetectorElement* currentElement = elements[currentIndex];
236
237 // retrieve the range
238 double min = overlapExtents[currentIndex*2-2];
239 double max = overlapExtents[currentIndex*2-1];
240
241 size_t minStrip, maxStrip = 0;
242
243 if (m_stripGapParameter != 0.) {
244 updateRange(element, currentElement, slimit, min, max);
245 correctPolarRange(element, min, max, minStrip, maxStrip);
246 }
247
248 StripInformationHelper currentStripInfo;
249 for (auto& cluster_index : clusters[currentIndex]) {
250 bool processed = false;
251 const auto& currentLocalPos = cluster_index.first->localPosition<1>();
252
253 for(auto& stripInfo : stripInfos) {
254 double diff = currentLocalPos(0, 0)-stripInfo.locX();
255 // In negative endcap, local z is opposite of positive endcap
256 // need to invert the difference for proper comparison
257 if( m_stripId->barrel_ec(currentElement->identify())<0 ) diff = -diff;
258
259 if(diff < min || diff > max) continue;
260
261 if (not processed) {
262 processed = true;
263 size_t currentStripIndex = 0;
264 auto ends = getStripEnds(cluster_index.first, currentElement, currentStripIndex);
265 currentStripInfo.set(cluster_index.first->identifierHash(), ends.first, ends.second, beamSpotVertex, currentLocalPos(0, 0), cluster_index.second, currentStripIndex);
266 }
267
268 // depending on the index you are processing, you save the space point in the correct container
269 if (currentIndex==otherSideIndex) {
270 ATH_CHECK( makeStripSpacePoint(spacePoints, stripInfo, currentStripInfo, beamSpotVertex, isEndcap, limit, slimit) );
271 } else {
272 ATH_CHECK( makeStripSpacePoint(overlapSpacePoints, stripInfo, currentStripInfo, beamSpotVertex, isEndcap, limit, slimit) );
273 }
274 }
275 }
276 }
277 // process the phi overlapping elements
278 // if possible n starts from 4
279 for(; n < nElements; ++n) {
280 int currentIndex = elementIndex[n];
281 const InDetDD::SiDetectorElement* currentElement = elements[currentIndex];
282
283 double min = overlapExtents[4*currentIndex-10];
284 double max = overlapExtents[4*currentIndex- 9];
285
286 std::size_t minStrip = 0;
287 std::size_t maxStrip = 0;
288
289 if (m_stripGapParameter != 0.) {
290 updateRange(element, currentElement, slimit, min, max);
291 correctPolarRange(element, min, max, minStrip, maxStrip);
292 }
293
294 std::vector<StripInformationHelper*> stripPhiInfos;
295 stripPhiInfos.reserve(stripInfos.size());
296
297 for(auto& stripInfo : stripInfos) {
298 auto stripIndex = stripInfo.stripIndex();
299 auto localPosition = stripInfo.locX();
300 auto centralValue = localPosition;
301 auto minValue = min;
302 auto maxValue = max;
303 if (isEndcap and m_isITk) { // for Inner Detector SCT, use the same cut as barrel
304 centralValue = stripIndex;
307 }
308
309 if (minValue <= centralValue and centralValue <= maxValue) {
310 stripPhiInfos.push_back(&stripInfo);
311 }
312 }
313 // continue if you have no cluster from the phi overlapping region of the trigger element
314 if(stripPhiInfos.empty()) continue;
315
316 min = overlapExtents[4*currentIndex-8];
317 max = overlapExtents[4*currentIndex-7];
318
319 if (m_stripGapParameter != 0.) {
320 updateRange(element, currentElement, slimit, min, max);
321 correctPolarRange(currentElement, min, max, minStrip, maxStrip);
322 }
323
324 for (auto& cluster_index : clusters[currentIndex]) {
325 const auto& currentLocalPos = cluster_index.first->localPosition<1>();
326
327 size_t currentStripIndex = 0;
328 auto ends = getStripEnds(cluster_index.first, currentElement, currentStripIndex);
329 StripInformationHelper currentStripInfo(cluster_index.first->identifierHash(), ends.first, ends.second, beamSpotVertex, currentLocalPos(0, 0), cluster_index.second, currentStripIndex);
330 auto centralValue = currentLocalPos(0, 0);
331 auto minValue = min;
332 auto maxValue = max;
333 if (isEndcap and m_isITk) { // for Inner Detector SCT, use the same cut as barrel
334 centralValue = currentStripIndex;
337 }
338
339 if (centralValue < minValue or centralValue > maxValue)
340 continue;
341
342 for(auto& stripInfo : stripPhiInfos) {
343 ATH_CHECK( makeStripSpacePoint(overlapSpacePoints, *stripInfo, currentStripInfo, beamSpotVertex, isEndcap, limit, slimit) );
344 }
345 }
346 }
347 return StatusCode::SUCCESS;
348 }
349
350 for(int n=0; n!=nElements; ++n) {
351
352 int currentIndex = elementIndex[n];
353 const InDetDD::SiDetectorElement* currentElement = elements[currentIndex];
354
355 if (m_stripGapParameter != 0.) {
356 offset(element, currentElement, slimit);
357 }
358
359 for (auto& cluster_index : clusters[currentIndex]) {
360 size_t currentStripIndex = 0;
361 auto ends = getStripEnds(cluster_index.first, element, currentStripIndex);
362 const auto& currentLocalPos = cluster_index.first->localPosition<1>();
363 StripInformationHelper currentStripInfo(cluster_index.first->identifierHash(), ends.first, ends.second, beamSpotVertex, currentLocalPos(0, 0), cluster_index.second, currentStripIndex);
364
365 for(auto& stripInfo : stripInfos) {
366 // depending on the index you are processing, you save the space point in the correct container
367 if (currentIndex==otherSideIndex) {
368 ATH_CHECK( makeStripSpacePoint(spacePoints, stripInfo, currentStripInfo, beamSpotVertex, isEndcap, limit, slimit) );
369 } else {
370 ATH_CHECK( makeStripSpacePoint(overlapSpacePoints, stripInfo, currentStripInfo, beamSpotVertex, isEndcap, limit, slimit) );
371 }
372 }
373 }
374 }
375 return StatusCode::SUCCESS;
376 }
#define ATH_CHECK
Evaluate an expression and check for errors.
#define maxValue(current, test)
#define minValue(current, test)
void diff(const Jet &rJet1, const Jet &rJet2, std::map< std::string, double > varDiff)
Difference between jets - Non-Class function required by trigger.
Definition Jet.cxx:631
size_t size() const
Number of registered mappings.
virtual StatusCode makeStripSpacePoint(std::vector< StripSP > &collection, const StripInformationHelper &firstInfo, const StripInformationHelper &secondInfo, const Amg::Vector3D &beamSpotVertex, bool isEndcap, double limit, double slimit) const =0
Compute the space point position for a compatible pair of strips and, if it satisfies the geometrical...
void correctPolarRange(const InDetDD::SiDetectorElement *element, double &min, double &max, size_t &minStrip, size_t &maxStrip) const
std::pair< Amg::Vector3D, Amg::Vector3D > getStripEnds(const xAOD::StripCluster *cluster, const InDetDD::SiDetectorElement *element, size_t &stripIndex) const
void updateRange(const InDetDD::SiDetectorElement *element1, const InDetDD::SiDetectorElement *element2, double &stripLengthGapTolerance, double &min, double &max) const
double offset(const InDetDD::SiDetectorElement *element1, const InDetDD::SiDetectorElement *element2, double &stripLengthGapTolerance) const

◆ getStripEnds()

std::pair< Amg::Vector3D, Amg::Vector3D > ActsTrk::StripSpacePointFormationToolBase::getStripEnds ( const xAOD::StripCluster * cluster,
const InDetDD::SiDetectorElement * element,
size_t & stripIndex ) const
private

Definition at line 496 of file StripSpacePointFormationToolBase.cxx.

499 {
500 const Eigen::Matrix<float,1,1>& localPos = cluster->localPosition<1>();
501
502 if (element->isEndcap() and m_isITk) {
503 // design for endcap modules
504 const InDetDD::StripStereoAnnulusDesign *design
505 = dynamic_cast<const InDetDD::StripStereoAnnulusDesign *> (&element->design());
506 if ( design==nullptr ) {
507 ATH_MSG_FATAL( "Invalid strip annulus design for module with identifier/identifierHash " << element->identify() << "/" << element->identifyHash());
508 return std::pair<Amg::Vector3D, Amg::Vector3D >();
509 }
510
511 // calculate phi pitch for evaluating the strip index
512 double phiPitchPhi = design->phiWidth()/design->diodesInRow(0);
513 stripIndex = -std::floor(localPos(0, 0) / phiPitchPhi) + design->diodesInRow(0) *0.5 - 0.5;
514
515 std::pair<Amg::Vector3D, Amg::Vector3D > ends = {
516 element->globalPosition(design->stripPosAtR(stripIndex, 0, design->minR())),
517 element->globalPosition(design->stripPosAtR(stripIndex, 0, design->maxR()))
518 };
519 return ends;
520
521 }
522
523 InDetDD::SiLocalPosition localPosition(0., localPos(0, 0), 0.);
524 std::pair<Amg::Vector3D, Amg::Vector3D > ends(element->endsOfStrip(localPosition));
525
526 return ends;
527 }
std::pair< Amg::Vector3D, Amg::Vector3D > endsOfStrip(const Amg::Vector2D &position) const
Special method for SCT to retrieve the two ends of a "strip" Returned coordinates are in global frame...
HepGeom::Point3D< double > globalPosition(const HepGeom::Point3D< double > &localPos) const
transform a reconstruction local position into a global position (inline):
SiLocalPosition stripPosAtR(int strip, int row, double r) const
ConstVectorMap< N > localPosition() const
Returns the local position of the measurement.

◆ initialize()

StatusCode ActsTrk::StripSpacePointFormationToolBase::initialize ( )
overridevirtual

Reimplemented in ActsTrk::CoreStripSpacePointFormationTool.

Definition at line 16 of file StripSpacePointFormationToolBase.cxx.

16 {
17
18 ATH_CHECK(detStore()->retrieve(m_stripId,"SCT_ID"));
19
20 ATH_CHECK(m_lorentzAngleTool.retrieve());
21
23 ATH_MSG_INFO("Use SCT SP overlap cuts based on layer number parity");
24
25 return StatusCode::SUCCESS;
26 }
#define ATH_MSG_INFO(x,...)
ToolHandle< ISiLorentzAngleTool > m_lorentzAngleTool
Using Lorentz angle tool.

◆ makeStripSP()

StripSP ActsTrk::StripSpacePointFormationToolBase::makeStripSP ( const Eigen::Matrix< double, 3, 1 > & globalPosition,
const StripInformationHelper & firstInfo,
const StripInformationHelper & secondInfo,
bool isEndcap )
staticprotected

Fill the StripSP payload that is common to all implementations, i.e.

everything except the global position.

Definition at line 378 of file StripSpacePointFormationToolBase.cxx.

382 {
383 // evaluation of the local covariance
384 // Lines taken from SCT_SpacePoint::setupLocalCovarianceSCT()
385 constexpr float deltaY = 0.0004; // roughly pitch of SCT (80 mu) / sqrt(12)
386 constexpr float covTerm = 1600.*deltaY;
387
388 Eigen::Matrix<float, 2, 1> variance(0.1f, 8.f*covTerm);
389 // Swap r/z covariance terms for endcap clusters
390 if ( isEndcap )
391 std::swap( variance(0, 0), variance(1, 0) );
392
393 // evaluation of measurement details
394 double topHalfStripLength = 0.5*firstInfo.stripDirection().norm();
395 Eigen::Matrix<double, 3, 1> topStripDirection = -firstInfo.stripDirection()/(2.*topHalfStripLength);
396 Eigen::Matrix<double, 3, 1> topStripCenter = 0.5*firstInfo.trajDirection();
397
398 double bottomHalfStripLength = 0.5*secondInfo.stripDirection().norm();
399 Eigen::Matrix<double, 3, 1> bottomStripDirection = -secondInfo.stripDirection()/(2.*bottomHalfStripLength);
400
401 Eigen::Matrix<double, 3, 1> stripCenterDistance = firstInfo.stripCenter() - secondInfo.stripCenter();
402
403 StripSP toAdd;
404 toAdd.idHashes = {firstInfo.idHash(), secondInfo.idHash()};
405 toAdd.globPos = globalPosition.cast<float>();
406 toAdd.cov_r = variance(0,0);
407 toAdd.cov_z = variance(1,0);
408 toAdd.measurementIndexes = std::array<std::size_t,2> ({firstInfo.clusterIndex(), secondInfo.clusterIndex()});
409 toAdd.topHalfStripLength = static_cast<float>(topHalfStripLength);
410 toAdd.bottomHalfStripLength = static_cast<float>(bottomHalfStripLength);
411 toAdd.topStripDirection = topStripDirection.cast<float>();
412 toAdd.bottomStripDirection = bottomStripDirection.cast<float>();
413 toAdd.stripCenterDistance = stripCenterDistance.cast<float>();
414 toAdd.topStripCenter = topStripCenter.cast<float>();
415
416 return toAdd;
417 }
void swap(ElementLinkVector< DOBJ > &lhs, ElementLinkVector< DOBJ > &rhs)

◆ makeStripSpacePoint()

virtual StatusCode ActsTrk::StripSpacePointFormationToolBase::makeStripSpacePoint ( std::vector< StripSP > & collection,
const StripInformationHelper & firstInfo,
const StripInformationHelper & secondInfo,
const Amg::Vector3D & beamSpotVertex,
bool isEndcap,
double limit,
double slimit ) const
protectedpure virtual

Compute the space point position for a compatible pair of strips and, if it satisfies the geometrical requirements, append it to the collection.

Parameters
collectionthe collection the space point is appended to
firstInfostrip information of the trigger element cluster
secondInfostrip information of the other element cluster
beamSpotVertexthe vertex the trajectory is assumed to originate from
isEndcaptrue if the trigger element is in the endcap
limit1 + StripLengthTolerance
slimitstrip length gap tolerance, from offset()

Implemented in ActsTrk::CoreStripSpacePointFormationTool, and ActsTrk::StripSpacePointFormationTool.

◆ offset()

double ActsTrk::StripSpacePointFormationToolBase::offset ( const InDetDD::SiDetectorElement * element1,
const InDetDD::SiDetectorElement * element2,
double & stripLengthGapTolerance ) const
private

Definition at line 419 of file StripSpacePointFormationToolBase.cxx.

422 {
423 const Amg::Transform3D& T1 = element1->transform();
424 const Amg::Transform3D& T2 = element2->transform();
425 Amg::Vector3D C = element1->center() ;
426 bool isAnnulus = (element1->design().shape() == InDetDD::Annulus);
427
428 double x12 = T1(0,0)*T2(0,0)+T1(1,0)*T2(1,0)+T1(2,0)*T2(2,0);
429 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));
430 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);
431
432 double dm = (m_stripGapParameter*r)*std::abs(s*x12);
433 double d = isAnnulus ? dm/.04 : dm/std::sqrt((1.-x12)*(1.+x12));
434
435 if (std::abs(T1(2,2)) > 0.7) d*=(r/std::abs(T1(2,3)));
436
437 stripLengthGapTolerance = d;
438
439 return dm;
440 }
virtual const Amg::Transform3D & transform() const override final
Return local to global transform.
virtual const Amg::Vector3D & center() const override final
Center in global coordinates.
int r
Definition globals.cxx:22
struct color C
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 3, 1 > Vector3D

◆ produceSpacePoints()

StatusCode ActsTrk::StripSpacePointFormationToolBase::produceSpacePoints ( const EventContext & ctx,
const xAOD::StripClusterContainer & clusterContainer,
const InDet::SiElementPropertiesTable & properties,
const InDetDD::SiDetectorElementCollection & elements,
const Amg::Vector3D & beamSpotVertex,
std::vector< StripSP > & spacePoints,
std::vector< StripSP > & overlapSpacePoints,
bool processOverlaps,
const std::vector< IdentifierHash > & hashesToProcess,
const ContainerAccessor< xAOD::StripCluster, IdentifierHash, 1 > & stripAccessor ) const
overridevirtual

For each trigger element collect the neighbouring elements, their clusters and the compatibility windows, then hand them to fillStripSpacePoints. Element slots: [0] trigger, [1] opposite, [2]-[3] eta overlaps, [4]-[5] phi overlaps. overlapExtents holds the windows: [0,1] opposite, [2..5] eta, [6..13] phi. Clusters of a given element are reached through the ContainerAccessor.

Definition at line 28 of file StripSpacePointFormationToolBase.cxx.

38 {
44
45 const auto hashesProc = (hashesToProcess.size() > 0 ? hashesToProcess : stripAccessor.allIdentifiers());
46
47 //factor out floating point conversions
48 double overlapLimitOpposite = m_overlapLimitOpposite;
49 double overlapLimitPhi = m_overlapLimitPhi;
50 double overlapLimitEtaMin = m_overlapLimitEtaMin;
51 double overlapLimitEtaMax = m_overlapLimitEtaMax;
52
53 for (auto& idHash : hashesProc) {
54 const InDetDD::SiDetectorElement* thisElement = elements.getDetectorElement(idHash);
55 if ( not thisElement->isStereo() ) {
56 // Retrieve the neighbours of the detector element
57 const std::vector<IdentifierHash>* others(properties.neighbours(idHash));
58 if (others==nullptr || others->empty() )
59 continue;
60
61 // This flag is use to trigger if the search should be performed.
62 // In case there are no clusters on the neighbours of the selected
63 // detector element, the flag stays false.
64 bool search=false;
65 size_t neighbour = 0;
66 while (not search and neighbour<others->size() ) {
67 search = stripAccessor.isIdentifierPresent(others->at(neighbour));
68 neighbour++;
69 }
70 if (not search)
71 continue;
72
73 // prepare clusters, indices and modules for space point formation
74 std::array<std::vector<std::pair<const xAOD::StripCluster*, size_t>>, nNeighbours> neighbourClusters{};
75 std::array<const InDetDD::SiDetectorElement*, nNeighbours> neighbourElements{};
76
77 auto groupStart = clusterContainer.begin();
78 // Get the detector element and range for the idHash
79 neighbourElements[0] = thisElement;
80 for (auto& this_range : stripAccessor.rangesForIdentifierDirect(idHash)) {
81 for (auto start=this_range.first; start!=this_range.second; start++) {
82 size_t position = std::distance(groupStart, start);
83 neighbourClusters[0].push_back(std::make_pair(*start, position));
84 }
85 }
86
87 Identifier thisId = thisElement->identify();
88
89 // define overlap extends before building space points
90 std::array<double, 14> overlapExtents{};
91 // Default case: you test the opposite element and the overlapping in phi (total 3 elements)
92 int Nmax = 4;
93
94 // In the barrel, test the eta overlaps as well (total 5 elements)
95 if (m_stripId->is_barrel(thisId))
96 Nmax = 6;
97
98 // You can remove all the overlaps if requested.
99 // Here you test only the opposite element
100 if(not processOverlaps) Nmax = 2;
101 //factor double conversion outside of loop
102 double hwidth(static_cast<double>(properties.halfWidth(idHash)));
103 int n = 0;
104
105
106 // The order of the elements in others is such that you first get the opposite element,
107 // the overlapping in phi and then the overlapping in eta
108 // For this reason you need to re-order the indices, since the SiSpacePointMakerTool will process
109 // first the eta overlaps and then the phi ones
110 const std::array<size_t, nNeighbours> neigbourIndices{ThisOne, Opposite, EtaMinus, EtaPlus, PhiMinus, PhiPlus};
111
112 for (const auto& otherHash : *others) {
113
114 if(++n==Nmax) break;
115
116 if(not stripAccessor.isIdentifierPresent(otherHash))
117 continue;
118
119 const InDetDD::SiDetectorElement* otherElement = elements.getDetectorElement(otherHash);
120
121 neighbourElements[neigbourIndices[n]] = otherElement;
122 for (auto& this_range : stripAccessor.rangesForIdentifierDirect(otherHash)) {
123 for (auto start=this_range.first; start!=this_range.second; start++) {
124 size_t position = std::distance(groupStart, start);
125 neighbourClusters[neigbourIndices[n]].push_back(std::make_pair(*start, position));
126 }
127 }
128
129 switch (n) {
130 case Opposite: {
131 overlapExtents[ 0] = -overlapLimitOpposite;
132 overlapExtents[ 1] = overlapLimitOpposite;
133 break;
134 }
135 case PhiMinus: {
136 overlapExtents[ 6] =-hwidth;
137 overlapExtents[ 7] =-hwidth+overlapLimitPhi;
138 overlapExtents[ 8] = hwidth-overlapLimitPhi;
139 overlapExtents[ 9] = hwidth;
140 break;
141 }
142 case PhiPlus: {
143 overlapExtents[10] = hwidth-overlapLimitPhi;
144 overlapExtents[11] = hwidth;
145 overlapExtents[12] =-hwidth;
146 overlapExtents[13] =-hwidth+overlapLimitPhi;
147 break;
148 }
149 case EtaMinus: {
150 overlapExtents[ 2] = overlapLimitEtaMin;
151 overlapExtents[ 3] = overlapLimitEtaMax;
152 if (m_useSCTLayerDep_OverlapCuts && (m_stripId->layer_disk(thisId) & 1) != 0) {
153 overlapExtents[ 2] =-overlapLimitEtaMax;
154 overlapExtents[ 3] =-overlapLimitEtaMin;
155 }
156 break;
157 }
158 default: {
159 overlapExtents[ 4] = overlapLimitEtaMin;
160 overlapExtents[ 5] = overlapLimitEtaMax;
161 if (m_useSCTLayerDep_OverlapCuts && (m_stripId->layer_disk(thisId) & 1) == 0) {
162 overlapExtents[ 4] = -overlapLimitEtaMax;
163 overlapExtents[ 5] = -overlapLimitEtaMin;
164 }
165 break;
166 }
167 }
168 }
169
170 // producing and filling space points
171 ATH_CHECK( fillStripSpacePoints(neighbourElements, neighbourClusters, overlapExtents, beamSpotVertex,
172 spacePoints, overlapSpacePoints) );
173 }
174 }
175 return StatusCode::SUCCESS;
176 }
StatusCode fillStripSpacePoints(const std::array< const InDetDD::SiDetectorElement *, nNeighbours > &neighbourElements, const std::array< std::vector< std::pair< const xAOD::StripCluster *, size_t > >, nNeighbours > &neighbourClusters, const std::array< double, 14 > &overlapExtents, const Amg::Vector3D &beamSpotVertex, std::vector< StripSP > &spacePoints, std::vector< StripSP > &overlapSpacePoints) const
const boost::container::small_vector< Range, inline_size > rangesForIdentifierDirect(const identifier_t &identifier) const
Function to return the list of ranges corresponding to a given identifier.
std::vector< identifier_t > allIdentifiers() const
Function to return all available identifier (i.e. keys in the map).
bool isIdentifierPresent(const identifier_t &identifier) const
Function to verify if a given identifier is present in the map, i.e.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
const SiDetectorElement * getDetectorElement(const IdentifierHash &hash) const
bool isStereo() const
Check if it is the stereo side (useful for SCT).
void search(TDirectory *td, const std::string &s, std::string cwd, node *n)
recursive directory search for TH1 and TH2 and TProfiles
Definition hcg.cxx:743
const Amg::Vector3D & position() const
Method to retrieve the position of the Intersection.

◆ updateRange()

void ActsTrk::StripSpacePointFormationToolBase::updateRange ( const InDetDD::SiDetectorElement * element1,
const InDetDD::SiDetectorElement * element2,
double & stripLengthGapTolerance,
double & min,
double & max ) const
private

Definition at line 442 of file StripSpacePointFormationToolBase.cxx.

446 {
447 double dm = offset(element1, element2, stripLengthGapTolerance);
448 min -= dm;
449 max += dm;
450 }

Member Data Documentation

◆ m_allClusters

Gaudi::Property< bool > ActsTrk::StripSpacePointFormationToolBase::m_allClusters {this, "AllClusters", false, "Process all clusters without limits."}
protected

Definition at line 95 of file StripSpacePointFormationToolBase.h.

95{this, "AllClusters", false, "Process all clusters without limits."};

◆ m_isITk

Gaudi::Property<bool> ActsTrk::StripSpacePointFormationToolBase::m_isITk {this, "isITk", true, "True if running in ITk"}
protected

Definition at line 96 of file StripSpacePointFormationToolBase.h.

96{this, "isITk", true, "True if running in ITk"};

◆ m_lorentzAngleTool

ToolHandle<ISiLorentzAngleTool> ActsTrk::StripSpacePointFormationToolBase::m_lorentzAngleTool
private
Initial value:
{this, "LorentzAngleTool", "",
"Tool to retreive Lorentz angle of SCT"}

Using Lorentz angle tool.

Definition at line 137 of file StripSpacePointFormationToolBase.h.

137 {this, "LorentzAngleTool", "",
138 "Tool to retreive Lorentz angle of SCT"};

◆ m_overlapLimitEtaMax

Gaudi::Property< float > ActsTrk::StripSpacePointFormationToolBase::m_overlapLimitEtaMax {this, "OverlapLimitEtaMax", 3.0, "High overlap limit for eta-neighbours."}
private

Definition at line 150 of file StripSpacePointFormationToolBase.h.

150{this, "OverlapLimitEtaMax", 3.0, "High overlap limit for eta-neighbours."};

◆ m_overlapLimitEtaMin

Gaudi::Property< float > ActsTrk::StripSpacePointFormationToolBase::m_overlapLimitEtaMin {this, "OverlapLimitEtaMin", 1.68, "Low overlap limit for eta-neighbours."}
private

Definition at line 149 of file StripSpacePointFormationToolBase.h.

149{this, "OverlapLimitEtaMin", 1.68, "Low overlap limit for eta-neighbours."};

◆ m_overlapLimitOpposite

Gaudi::Property< float > ActsTrk::StripSpacePointFormationToolBase::m_overlapLimitOpposite {this, "OverlapLimitOpposite", 2.8, "Overlap limit for opposite-neighbour."}
private

Definition at line 147 of file StripSpacePointFormationToolBase.h.

147{this, "OverlapLimitOpposite", 2.8, "Overlap limit for opposite-neighbour."};

◆ m_overlapLimitPhi

Gaudi::Property< float > ActsTrk::StripSpacePointFormationToolBase::m_overlapLimitPhi {this, "OverlapLimitPhi", 5.64, "Overlap limit for phi-neighbours."}
private

Definition at line 148 of file StripSpacePointFormationToolBase.h.

148{this, "OverlapLimitPhi", 5.64, "Overlap limit for phi-neighbours."};

◆ m_stripGapParameter

Gaudi::Property< float > ActsTrk::StripSpacePointFormationToolBase::m_stripGapParameter {this, "StripGapParameter", 0.0015, "Recommend 0.001 - 0.0015 for ITK geometry"}
protected

Definition at line 102 of file StripSpacePointFormationToolBase.h.

102{this, "StripGapParameter", 0.0015, "Recommend 0.001 - 0.0015 for ITK geometry"};

◆ m_stripId

const SCT_ID* ActsTrk::StripSpacePointFormationToolBase::m_stripId {}
protected

Definition at line 90 of file StripSpacePointFormationToolBase.h.

90{};

◆ m_stripLengthTolerance

Gaudi::Property< float > ActsTrk::StripSpacePointFormationToolBase::m_stripLengthTolerance {this, "StripLengthTolerance", 0.01}
protected

Definition at line 101 of file StripSpacePointFormationToolBase.h.

101{this, "StripLengthTolerance", 0.01};

◆ m_useSCTLayerDep_OverlapCuts

Gaudi::Property< bool > ActsTrk::StripSpacePointFormationToolBase::m_useSCTLayerDep_OverlapCuts {this,"useSCTLayerDep_OverlapCuts", true}
private

Definition at line 151 of file StripSpacePointFormationToolBase.h.

151{this,"useSCTLayerDep_OverlapCuts", true};

The documentation for this class was generated from the following files: