ATLAS Offline Software
Public Member Functions | Protected Member Functions | List of all members
ActsTrk::RandomProtoTrackCreator Class Reference

#include <RandomProtoTrackCreator.h>

Inheritance diagram for ActsTrk::RandomProtoTrackCreator:
Collaboration diagram for ActsTrk::RandomProtoTrackCreator:

Public Member Functions

 RandomProtoTrackCreator (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual ~RandomProtoTrackCreator ()=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. More...
 

Protected Member Functions

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

Detailed Description

Definition at line 15 of file RandomProtoTrackCreator.h.

Constructor & Destructor Documentation

◆ RandomProtoTrackCreator()

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

Definition at line 9 of file RandomProtoTrackCreator.cxx.

11  : base_class(type,name,parent){
12 }

◆ ~RandomProtoTrackCreator()

virtual ActsTrk::RandomProtoTrackCreator::~RandomProtoTrackCreator ( )
virtualdefault

Member Function Documentation

◆ findProtoTracks()

StatusCode ActsTrk::RandomProtoTrackCreator::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 13 of file RandomProtoTrackCreator.cxx.

16  {
17  // Sample N random hits for example
18  std::vector<ActsTrk::ATLASUncalibSourceLink> dummyPoints;
19  size_t nPix = 1;
20  size_t nStrip = 7;
21  for (size_t k = 0; k < nPix; ++k){
22  auto index = rand() % pixelContainer.size();
23  dummyPoints.push_back(makeATLASUncalibSourceLink(&pixelContainer, index, ctx));
24  }
25 
26 
27  for (size_t k = 0; k < nStrip; ++k){
28  auto index = rand() % stripContainer.size();
29  dummyPoints.push_back(makeATLASUncalibSourceLink(&stripContainer, index, ctx));
30  }
31 
32  ATH_MSG_DEBUG("Made a proto-track with " <<dummyPoints.size()<<" random clusters");
33 
34 
35  // Make the intput perigee
36  auto inputPerigee = makeDummyParams(dummyPoints[0]);
37 
38  // and add to the list (will only make one prototrack per event for now)
39  foundProtoTracks.push_back({dummyPoints,std::move(inputPerigee)});
40 
41  return StatusCode::SUCCESS;
42 }

◆ getMeasurementPos()

Amg::Vector3D ActsTrk::RandomProtoTrackCreator::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 44 of file RandomProtoTrackCreator.cxx.

44  {
46  return dynamic_cast <const xAOD::PixelCluster*>(theMeas)->globalPosition().cast<double>();
47  } else if (theMeas->type() == xAOD::UncalibMeasType::StripClusterType){
48  return dynamic_cast<const xAOD::StripCluster*>(theMeas)->globalPosition().cast<double>();
49  }
50  return Amg::Vector3D::Zero();
51 }

◆ makeDummyParams()

std::unique_ptr< Acts::BoundTrackParameters > ActsTrk::RandomProtoTrackCreator::makeDummyParams ( const ActsTrk::ATLASUncalibSourceLink 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 54 of file RandomProtoTrackCreator.cxx.

54  {
55 
56  const xAOD::UncalibratedMeasurement* measurement = &getUncalibratedMeasurement(firstPRD);
57  using namespace Acts::UnitLiterals;
58  std::shared_ptr<const Acts::Surface> actsSurface = Acts::Surface::makeShared<Acts::PerigeeSurface>(
59  Acts::Vector3(0., 0., 0.));
60  Acts::BoundVector params;
61 
62  auto globalPos = getMeasurementPos(measurement);
63 
64  // No, this is not a physically correct parameter estimate!
65  // We just want a placeholder to point in roughly the expected direction...
66  // A real track finder would do something more reasonable here.
67  params << 0., 0.,
68  globalPos.phi(), globalPos.theta(),
69  1. / (1000000000. * 1_MeV), 0.;
70 
71 
72  // Covariance - let's be honest and say we have no clue ;-)
73  Acts::BoundSquareMatrix cov = Acts::BoundSquareMatrix::Identity();
74  cov *= 100000;
75 
76  return std::make_unique<Acts::BoundTrackParameters>(actsSurface, params,
78 
79 }

The documentation for this class was generated from the following files:
index
Definition: index.py:1
xAOD::UncalibMeasType::StripClusterType
@ StripClusterType
plotBeamSpotVxVal.cov
cov
Definition: plotBeamSpotVxVal.py:201
xAOD::pion
@ pion
Definition: TrackingPrimitives.h:196
xAOD::UncalibratedMeasurement_v1
Definition: UncalibratedMeasurement_v1.h:13
ActsTrk::makeATLASUncalibSourceLink
ATLASUncalibSourceLink makeATLASUncalibSourceLink(const xAOD::UncalibratedMeasurementContainer *container, std::size_t index, [[maybe_unused]] const EventContext &ctx)
Definition: ATLASSourceLink.h:30
LArG4FSStartPointFilter.rand
rand
Definition: LArG4FSStartPointFilter.py:80
xAOD::UncalibratedMeasurement_v1::type
virtual xAOD::UncalibMeasType type() const =0
Returns the type of the measurement type as a simple enumeration.
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
test_pyathena.parent
parent
Definition: test_pyathena.py:15
xAOD::StripCluster_v1
Definition: StripCluster_v1.h:17
ActsTrk::RandomProtoTrackCreator::getMeasurementPos
Amg::Vector3D getMeasurementPos(const xAOD::UncalibratedMeasurement *theMeas) const
get the global position for an uncalibrated measurement - delegates to the specialisation
Definition: RandomProtoTrackCreator.cxx:44
ActsTrk::RandomProtoTrackCreator::makeDummyParams
std::unique_ptr< Acts::BoundTrackParameters > makeDummyParams(const ActsTrk::ATLASUncalibSourceLink &firstPRD) const
creates a random, dummy set of parameters Warning: This is not a real parameter estimate.
Definition: RandomProtoTrackCreator.cxx:54
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
ActsTrk::getUncalibratedMeasurement
const xAOD::UncalibratedMeasurement & getUncalibratedMeasurement(const ATLASUncalibSourceLink &source_link)
Definition: ATLASSourceLink.h:26
xAOD::TauJetParameters::nStrip
@ nStrip
Get number of strips.
Definition: TauDefs.h:204
xAOD::PixelCluster_v1
Definition: PixelCluster_v1.h:17
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
PowhegControl_ttFCNC_NLO.params
params
Definition: PowhegControl_ttFCNC_NLO.py:226
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
xAOD::UncalibMeasType::PixelClusterType
@ PixelClusterType
fitman.k
k
Definition: fitman.py:528
generate::Zero
void Zero(TH1D *hin)
Definition: generate.cxx:32