ATLAS Offline Software
Loading...
Searching...
No Matches
ActsTrk::RandomProtoTrackCreatorTool Class Reference

#include <RandomProtoTrackCreatorTool.h>

Inheritance diagram for ActsTrk::RandomProtoTrackCreatorTool:
Collaboration diagram for ActsTrk::RandomProtoTrackCreatorTool:

Public Member Functions

 RandomProtoTrackCreatorTool (const std::string &type, const std::string &name, const IInterface *parent)
virtual ~RandomProtoTrackCreatorTool ()=default
virtual StatusCode findProtoTracks (const EventContext &ctx, const xAOD::PixelClusterContainer &pixelContainer, const xAOD::StripClusterContainer &stripContainer, std::vector< ActsTrk::ProtoTrack > &foundProtoTracks) const override final
 EF-style pattern recognition to create prototracks.

Protected Member Functions

std::unique_ptr< Acts::BoundTrackParameters > makeDummyParams (const xAOD::UncalibratedMeasurement *firstPRD) const
 creates a random, dummy set of parameters Warning: This is not a real parameter estimate.
Amg::Vector3D getMeasurementPos (const xAOD::UncalibratedMeasurement *theMeas) const
 get the global position for an uncalibrated measurement - delegates to the specialisation

Detailed Description

Definition at line 14 of file RandomProtoTrackCreatorTool.h.

Constructor & Destructor Documentation

◆ RandomProtoTrackCreatorTool()

ActsTrk::RandomProtoTrackCreatorTool::RandomProtoTrackCreatorTool ( const std::string & type,
const std::string & name,
const IInterface * parent )

Definition at line 10 of file RandomProtoTrackCreatorTool.cxx.

13 : base_class(type,name,parent)
14{}

◆ ~RandomProtoTrackCreatorTool()

virtual ActsTrk::RandomProtoTrackCreatorTool::~RandomProtoTrackCreatorTool ( )
virtualdefault

Member Function Documentation

◆ findProtoTracks()

StatusCode ActsTrk::RandomProtoTrackCreatorTool::findProtoTracks ( const EventContext & ctx,
const xAOD::PixelClusterContainer & pixelContainer,
const xAOD::StripClusterContainer & stripContainer,
std::vector< ActsTrk::ProtoTrack > & foundProtoTracks ) const
finaloverridevirtual

EF-style pattern recognition to create prototracks.

Parameters
ctxEvent context
pixelContainerpixel cluster
stripContainersct cluster
foundProtoTracksvector to hold the found proto tracks - will be populated by the method. Method will not discard existing content

Definition at line 16 of file RandomProtoTrackCreatorTool.cxx.

19 {
20 // Sample N random hits for example
21 ATH_MSG_VERBOSE("Generate a random proto track in "<<ctx.eventID()<<" from "<<pixelContainer.size()<<" pixel measurements "
22 <<", "<<stripContainer.size()<<" strip measurements");
23 std::vector<const xAOD::UncalibratedMeasurement*> dummyPoints;
24 size_t nPix = 1;
25 size_t nStrip = 7;
26 for (size_t k = 0; k < nPix; ++k){
27 auto index = rand() % pixelContainer.size();
28 dummyPoints.push_back(pixelContainer.at(index));
29 }
30
31
32 for (size_t k = 0; k < nStrip; ++k){
33 auto index = rand() % stripContainer.size();
34 dummyPoints.push_back(stripContainer.at(index));
35 }
36
37 ATH_MSG_DEBUG("Made a proto-track with " <<dummyPoints.size()<<" random clusters");
38
39
40 // Make the intput perigee
41 auto inputPerigee = makeDummyParams(dummyPoints[0]);
42
43 // and add to the list (will only make one prototrack per event for now)
44 foundProtoTracks.push_back({dummyPoints,std::move(inputPerigee)});
45
46 return StatusCode::SUCCESS;
47}
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
std::unique_ptr< Acts::BoundTrackParameters > makeDummyParams(const xAOD::UncalibratedMeasurement *firstPRD) const
creates a random, dummy set of parameters Warning: This is not a real parameter estimate.
str index
Definition DeMoScan.py:362
@ nStrip
Get number of strips.
Definition TauDefs.h:204

◆ getMeasurementPos()

Amg::Vector3D ActsTrk::RandomProtoTrackCreatorTool::getMeasurementPos ( const xAOD::UncalibratedMeasurement * theMeas) const
protected

get the global position for an uncalibrated measurement - delegates to the specialisation

Parameters
theMeasuncalibrated measurement

Definition at line 49 of file RandomProtoTrackCreatorTool.cxx.

49 {
51 return dynamic_cast <const xAOD::PixelCluster*>(theMeas)->globalPosition().cast<double>();
52 } else if (theMeas->type() == xAOD::UncalibMeasType::StripClusterType){
53 return dynamic_cast<const xAOD::StripCluster*>(theMeas)->globalPosition().cast<double>();
54 }
55 return Amg::Vector3D::Zero();
56}
virtual xAOD::UncalibMeasType type() const =0
Returns the type of the measurement type as a simple enumeration.
StripCluster_v1 StripCluster
Define the version of the strip cluster class.
PixelCluster_v1 PixelCluster
Define the version of the pixel cluster class.

◆ makeDummyParams()

std::unique_ptr< Acts::BoundTrackParameters > ActsTrk::RandomProtoTrackCreatorTool::makeDummyParams ( const xAOD::UncalibratedMeasurement * firstPRD) const
protected

creates a random, dummy set of parameters Warning: This is not a real parameter estimate.

Should only serve as a placeholder. Use with care

Parameters
firstPRDFirst hit on our proto track
Returns
a set of dummy params - just pointing from the origin in a straight line to our hit

Definition at line 59 of file RandomProtoTrackCreatorTool.cxx.

59 {
60
61 using namespace Acts::UnitLiterals;
62 std::shared_ptr<const Acts::Surface> actsSurface = Acts::Surface::makeShared<Acts::PerigeeSurface>(
63 Acts::Vector3::Zero());
64 Acts::BoundVector params;
65
66 auto globalPos = getMeasurementPos(measurement);
67
68 // No, this is not a physically correct parameter estimate!
69 // We just want a placeholder to point in roughly the expected direction...
70 // A real track finder would do something more reasonable here.
71 params << 0., 0.,
72 globalPos.phi(), globalPos.theta(),
73 1. / (1000000000. * 1_MeV), 0.;
74
75
76 // Covariance - let's be honest and say we have no clue ;-)
77 Acts::BoundMatrix cov = Acts::BoundMatrix::Identity();
78 cov *= 100000;
79
80 return std::make_unique<Acts::BoundTrackParameters>(actsSurface, params,
81 cov, Acts::ParticleHypothesis::pion());
82
83}
Amg::Vector3D getMeasurementPos(const xAOD::UncalibratedMeasurement *theMeas) const
get the global position for an uncalibrated measurement - delegates to the specialisation

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