ATLAS Offline Software
Loading...
Searching...
No Matches
Trk::ExtrapolatorComparisonTest Class Reference

The ExtrapolatorComparisonTest Algorithm runs a number of n test extrapolations from randomly distributed Track Parameters to reference surfcas within. More...

#include <ExtrapolatorComparisonTest.h>

Inheritance diagram for Trk::ExtrapolatorComparisonTest:
Collaboration diagram for Trk::ExtrapolatorComparisonTest:

Classes

struct  ActsTrackWrapper
 Wrapper code for Acts track parameters, to provide a position() method without the need of explicitly passing the Acts::GeometryContext. More...

Public Member Functions

 ExtrapolatorComparisonTest (const std::string &name, ISvcLocator *pSvcLocator)
 Standard Athena-Algorithm Constructor.
 ~ExtrapolatorComparisonTest ()
 Default Destructor.
StatusCode initialize () override
 standard Athena-Algorithm method
StatusCode execute (const EventContext &ctx) const override
 standard Athena-Algorithm method
StatusCode finalize () override
 standard Athena-Algorithm method
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
virtual void setFilterPassed (bool state, const EventContext &ctx) const
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

void generatePerigee (std::vector< perigeeParameters > &parameters)
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

ToolHandle< ActsTrk::IExtrapolationToolm_extrapolationTool {this, "ExtrapolationTool", "ActsExtrapolationTool"}
 The ACTS ExtrapolationTool to be retrieved.
ToolHandle< Trk::IExtrapolatorm_atlasExtrapolator {this, "Extrapolator", "Trk::Extrapolator/AtlasExtrapolator"}
 The ATLAS Extrapolator to be retrieved.
PublicToolHandle< ActsTrk::ITrackingGeometryToolm_trackingGeometryTool {this, "TrackingGeometryTool", "ActsTrackingGeometryTool"}
DoubleProperty m_sigmaD0 {this, "StartPerigeeSigmaD0", 17.*Gaudi::Units::micrometer}
DoubleProperty m_sigmaZ0 {this, "StartPerigeeSigmaZ0", 50.*Gaudi::Units::micrometer}
DoubleProperty m_minPhi {this, "StartPerigeeMinPhi", -M_PI}
DoubleProperty m_maxPhi {this, "StartPerigeeMaxPhi", M_PI}
DoubleProperty m_minEta {this, "StartPerigeeMinEta", -3.}
DoubleProperty m_maxEta {this, "StartPerigeeMaxEta", 3.}
DoubleProperty m_minPt {this, "StartPerigeeMinPt", 0.5*Gaudi::Units::GeV}
DoubleProperty m_maxPt {this, "StartPerigeeMaxPt", 50000*Gaudi::Units::GeV}
IntegerProperty m_particleType {this, "ParticleType", 2, "the particle type for the extrap."}
unsigned int m_referenceSurfaces = 0
 member variables for algorithm properties:
DoubleArrayProperty m_referenceSurfaceRadius {this, "ReferenceSurfaceRadius", {}}
DoubleArrayProperty m_referenceSurfaceHalflength {this, "ReferenceSurfaceHalfZ", {}}
std::vector< double > m_referenceSurfaceNegativeBoundary
std::vector< double > m_referenceSurfacePositiveBoundary
std::vector< std::vector< const Trk::Surface * > > m_atlasReferenceSurfaceTriples
std::vector< std::vector< std::shared_ptr< const Acts::Surface > > > m_actsReferenceSurfaceTriples
IntegerProperty m_eventsPerExecute {this, "EventsPerExecute", 1}
ServiceHandle< PropResultRootWriterSvcm_atlasPropResultWriterSvc {this, "ATLASPropResultRootWriter", "ATLASPropResultRootWriterSvc"}
ServiceHandle< PropResultRootWriterSvcm_actsPropResultWriterSvc {this, "ACTSPropResultRootWriter", "ACTSPropResultRootWriterSvc"}
ServiceHandle< IAthRNGSvcm_rndmSvc {this, "RndmSvc", "AthRNGSvc"}
ATHRNG::RNGWrapperm_randomEngine = nullptr
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

The ExtrapolatorComparisonTest Algorithm runs a number of n test extrapolations from randomly distributed Track Parameters to reference surfcas within.

  • a) the Inner Detector if DetFlags.ID_On()
  • b) the Calorimeter if DetFlags.Calo_On()
  • c) the Muon System if DetFlags.Muon_On()

It uses and compares the output obtaining using the ATLAS Extrapolator and the ACTS Extrapolation

Definition at line 71 of file ExtrapolatorComparisonTest.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ ExtrapolatorComparisonTest()

Trk::ExtrapolatorComparisonTest::ExtrapolatorComparisonTest ( const std::string & name,
ISvcLocator * pSvcLocator )

Standard Athena-Algorithm Constructor.

Definition at line 50 of file ExtrapolatorComparisonTest.cxx.

50 :
51 AthReentrantAlgorithm(name,pSvcLocator) {}

◆ ~ExtrapolatorComparisonTest()

Trk::ExtrapolatorComparisonTest::~ExtrapolatorComparisonTest ( )

Default Destructor.

Definition at line 55 of file ExtrapolatorComparisonTest.cxx.

56{
57 // cleanup of the Trk::Surfaces
58 for (const auto& surfaceTriple : m_atlasReferenceSurfaceTriples) {
59 for (const auto* surface : surfaceTriple) {
60 delete surface;
61 }
62 }
63}
std::vector< std::vector< const Trk::Surface * > > m_atlasReferenceSurfaceTriples

Member Function Documentation

◆ cardinality()

unsigned int AthCommonReentrantAlgorithm< Gaudi::Algorithm >::cardinality ( ) const
overridevirtualinherited

Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.

Override this to return 0 for reentrant algorithms.

Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.

64{
65 return 0;
66}

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode Trk::ExtrapolatorComparisonTest::execute ( const EventContext & ctx) const
override

standard Athena-Algorithm method

Definition at line 140 of file ExtrapolatorComparisonTest.cxx.

140 {
141
142 float milliseconds_to_seconds = 1000.;
143
144 // generate perigees with random number generator
145 CLHEP::HepRandomEngine* engine = m_randomEngine->getEngine(ctx);
146
147 std::vector<perigeeParameters> parameters = {};
148 for (int ext = 0; ext<m_eventsPerExecute; ext++) {
149 // generate with random number generator
150 double d0 = CLHEP::RandGauss::shoot(engine) * m_sigmaD0;
151 double z0 = CLHEP::RandGauss::shoot(engine) * m_sigmaZ0;
152 double phi = m_minPhi + (m_maxPhi-m_minPhi)* CLHEP::RandFlat::shoot(engine);
153 double eta = m_minEta + CLHEP::RandFlat::shoot(engine)*(m_maxEta-m_minEta);
154 double pt = m_minPt + CLHEP::RandFlat::shoot(engine)*(m_maxPt-m_minPt);
155 double charge = (CLHEP::RandFlat::shoot(engine) > 0.5 ) ? -1. : 1.;
156 parameters.emplace_back(d0, z0, phi, eta, pt, charge);
157 }
158
159 int n_extraps = 0;
160 auto start = xclock::now();
161 for (auto& perigee : parameters) {
162
163 Acts::Vector3 momentum(perigee.m_pt * std::cos(perigee.m_phi), perigee.m_pt * std::sin(perigee.m_phi), perigee.m_pt * std::sinh(perigee.m_eta));
164 double theta = Acts::VectorHelpers::theta(momentum);
165 double qOverP = perigee.m_charge / momentum.norm();
166
167 const Trk::PerigeeSurface atlPerigeeSurface;
168 auto atlPerigee = std::make_unique<Trk::Perigee>(perigee.m_d0, perigee.m_z0, perigee.m_phi, theta, qOverP, atlPerigeeSurface);
169
170 for (unsigned int surface = 0; surface < m_atlasReferenceSurfaceTriples.size(); surface++) {
171 n_extraps++;
172
173 double negRef = m_referenceSurfaceNegativeBoundary.at(surface);
174 double posRef = m_referenceSurfacePositiveBoundary.at(surface);
175
176 // decide which reference surface to take
177 int refSurface = theta < posRef ? 2 : 1;
178 refSurface = theta > negRef ? 0 : 1;
179
180 const Trk::Surface* destinationSurface = m_atlasReferenceSurfaceTriples.at(surface).at(refSurface);
181
182 ATH_MSG_VERBOSE("Starting extrapolation " << n_extraps << " from : " << *atlPerigee << " to : " << *destinationSurface);
183
184 auto start_fwd = xclock::now();
185 auto destParameters =
186 m_atlasExtrapolator->extrapolate(
187 ctx,
188 *atlPerigee,
189 *destinationSurface,
191 true,
192 static_cast<Trk::ParticleHypothesis>(m_particleType.value()));
193 auto end_fwd = xclock::now();
194 float ms_fwd = std::chrono::duration_cast<std::chrono::milliseconds>(end_fwd-start_fwd).count();
195
196 if (destParameters) {
197 ATH_MSG_VERBOSE(" ATLAS Extrapolator succeded!! --> Forward" );
198 ATH_MSG_VERBOSE(" [ intersection ] with surface at (x,y,z) = " << destParameters->position().x() << ", " << destParameters->position().y() << ", " << destParameters->position().z() );
199 ATH_MSG_VERBOSE(" [ intersection ] parameters: " << destParameters->parameters() );
200 ATH_MSG_VERBOSE(" [ intersection ] cov matrix: " << destParameters->covariance() );
201
202 // now try backward extrapolation
203 auto start_bkw = xclock::now();
204 auto finalperigee =
205 m_atlasExtrapolator->extrapolate(
206 ctx,
207 *destParameters,
208 atlPerigee->associatedSurface(),
210 true,
211 static_cast<Trk::ParticleHypothesis>(m_particleType.value()));
212 auto end_bkw = xclock::now();
213 float ms_bkw = std::chrono::duration_cast<std::chrono::milliseconds>(end_bkw-start_bkw).count();
214
215 if (finalperigee) {
216 ATH_MSG_VERBOSE(" ATLAS Extrapolator succeded!! --> Backward" );
217 ATH_MSG_VERBOSE(" [extrapolation to perigee] input: " << atlPerigee->parameters() );
218 ATH_MSG_VERBOSE(" [extrapolation to perigee] output: " << finalperigee->parameters() );
219 ATH_MSG_VERBOSE(" [extrapolation to perigee] cov matrix: " << finalperigee->covariance() );
220
221 } else if (!finalperigee) {
222 ATH_MSG_DEBUG(" ATLAS Extrapolation to perigee failed for input parameters: " << destParameters->parameters());
223 }
224
225 m_atlasPropResultWriterSvc->write<Trk::TrackParameters>(atlPerigee.get(), destParameters.get(), ms_fwd, finalperigee.get(), ms_bkw);
226 } else if (!destParameters) {
227 ATH_MSG_DEBUG(" ATLAS Extrapolation not successful! " );
228 m_atlasPropResultWriterSvc->write<Trk::TrackParameters>(atlPerigee.get());
229 }
230 }
231 }
232 auto end = xclock::now();
233 auto secs = std::chrono::duration_cast<std::chrono::milliseconds>(end-start).count() / milliseconds_to_seconds;
234 double secs_per_ex = secs / n_extraps;
235
236 ATH_MSG_INFO("ATLAS : Time for " << n_extraps << " iterations: " << secs << "s (" << secs_per_ex << "s per extrapolation)");
237
238 n_extraps = 0;
239 start = xclock::now();
240 for (auto& perigee : parameters) {
241 Acts::Vector3 momentum(perigee.m_pt * std::cos(perigee.m_phi), perigee.m_pt * std::sin(perigee.m_phi), perigee.m_pt * std::sinh(perigee.m_eta));
242 double theta = Acts::VectorHelpers::theta(momentum);
243 double qOverP = perigee.m_charge / momentum.norm();
244
245 std::shared_ptr<Acts::PerigeeSurface> actsPerigeeSurface = Acts::Surface::makeShared<Acts::PerigeeSurface>(Acts::Vector3(0, 0, 0));
246 double t = 0.;
247 Acts::BoundVector pars;
248 //cppcheck-suppress constStatement
249 pars << perigee.m_d0, perigee.m_z0, perigee.m_phi, theta, qOverP, t;
250 std::optional<Acts::BoundSquareMatrix> cov = std::nullopt;
251
252 // Perigee, no alignment -> default geo context
253 const ActsTrk::GeometryContext& gctx = m_trackingGeometryTool->getNominalGeometryContext();
254 auto anygctx = gctx.context();
255 const auto* startParameters = new const Acts::GenericBoundTrackParameters(std::move(actsPerigeeSurface), pars, std::move(cov), Acts::ParticleHypothesis::pion());
256
257 for (unsigned int surface = 0; surface < m_actsReferenceSurfaceTriples.size(); surface++) {
258 n_extraps++;
259
260 double negRef = m_referenceSurfaceNegativeBoundary.at(surface);
261 double posRef = m_referenceSurfacePositiveBoundary.at(surface);
262
263 // decide which reference surface to take
264 int refSurface = theta < posRef ? 2 : 1;
265 refSurface = theta > negRef ? 0 : 1;
266
267 auto destinationSurface = m_actsReferenceSurfaceTriples.at(surface).at(refSurface);
268
269 ATH_MSG_VERBOSE("Starting extrapolation " << n_extraps << " from : " << pars << " to : " << destinationSurface);
270
271 auto start_fwd = xclock::now();
272 auto destParameters = m_extrapolationTool->propagate(ctx, *startParameters, *destinationSurface, Acts::Direction::Forward());
273 auto end_fwd = xclock::now();
274 float ms_fwd = std::chrono::duration_cast<std::chrono::milliseconds>(end_fwd-start_fwd).count();
275
276 if (destParameters) {
277 ATH_MSG_VERBOSE(" ACTS Extrapolator succeded!! --> Forward" );
278 ATH_MSG_VERBOSE(" [ intersection ] with surface at (x,y,z) = " << destParameters->position(anygctx).x() << ", " << destParameters->position(anygctx).y() << ", " << destParameters->position(anygctx).z() );
279 ATH_MSG_VERBOSE(" [ intersection ] parameters: " << destParameters->parameters() );
280 ATH_MSG_VERBOSE(" [ intersection ] cov matrix: " << *destParameters->covariance() );
281
282 // now try backward extrapolation
283 auto start_bkw = xclock::now();
284 auto finalperigee = m_extrapolationTool->propagate(ctx, *destParameters, startParameters->referenceSurface(), Acts::Direction::Backward());
285 auto end_bkw = xclock::now();
286 float ms_bkw = std::chrono::duration_cast<std::chrono::milliseconds>(end_bkw-start_bkw).count();
287
288 if (finalperigee) {
289 ATH_MSG_VERBOSE(" ACTS Extrapolator succeded!! --> Backward" );
290 ATH_MSG_VERBOSE(" [extrapolation to perigee] input: " << startParameters->parameters() );
291 ATH_MSG_VERBOSE(" [extrapolation to perigee] output: " << finalperigee->parameters() );
292 ATH_MSG_VERBOSE(" [extrapolation to perigee] cov matrix: " << *finalperigee->covariance() );
293
294 } else if (!finalperigee) {
295 ATH_MSG_DEBUG(" ACTS Extrapolation to perigee failed for input parameters: " << destParameters->parameters());
296 }
297
298 // Construct wrappers for Acts track parameters
299 auto startWrapper = std::make_unique<ActsTrackWrapper>(startParameters, anygctx);
300 auto destWrapper = std::make_unique<ActsTrackWrapper>(&destParameters.value(), anygctx);
301 auto finalWrapper = std::make_unique<ActsTrackWrapper>(&finalperigee.value(), anygctx);
302
303 m_actsPropResultWriterSvc->write<ActsTrackWrapper>(startWrapper.get(), destWrapper.get(), ms_fwd, finalWrapper.get(), ms_bkw);
304
305 } else if (!destParameters) {
306 ATH_MSG_DEBUG(" ACTS Extrapolation not successful! " );
307 auto startWrapper = std::make_unique<ActsTrackWrapper>(startParameters, anygctx);
308 m_actsPropResultWriterSvc->write<ActsTrackWrapper>(startWrapper.get());
309 }
310 }
311 delete startParameters;
312 }
313
314 end = xclock::now();
315 secs = std::chrono::duration_cast<std::chrono::milliseconds>(end-start).count() / milliseconds_to_seconds;
316 secs_per_ex = secs / n_extraps;
317
318 ATH_MSG_INFO("ACTS : Time for " << n_extraps << " iterations: " << secs << "s (" << secs_per_ex << "s per extrapolation)");
319
320 return StatusCode::SUCCESS;
321}
Scalar eta() const
pseudorapidity method
#define ATH_MSG_INFO(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
double charge(const T &p)
Definition AtlasPID.h:997
Acts::GeometryContext context() const
ToolHandle< ActsTrk::IExtrapolationTool > m_extrapolationTool
The ACTS ExtrapolationTool to be retrieved.
ServiceHandle< PropResultRootWriterSvc > m_actsPropResultWriterSvc
ServiceHandle< PropResultRootWriterSvc > m_atlasPropResultWriterSvc
std::vector< double > m_referenceSurfacePositiveBoundary
std::vector< std::vector< std::shared_ptr< const Acts::Surface > > > m_actsReferenceSurfaceTriples
PublicToolHandle< ActsTrk::ITrackingGeometryTool > m_trackingGeometryTool
std::vector< double > m_referenceSurfaceNegativeBoundary
ToolHandle< Trk::IExtrapolator > m_atlasExtrapolator
The ATLAS Extrapolator to be retrieved.
@ oppositeMomentum
@ alongMomentum
@ theta
Definition ParamDefs.h:66
@ qOverP
perigee
Definition ParamDefs.h:67
@ phi
Definition ParamDefs.h:75
@ d0
Definition ParamDefs.h:63
@ z0
Definition ParamDefs.h:64
ParticleHypothesis
Enumeration for Particle hypothesis respecting the interaction with material.
ParametersBase< TrackParametersDim, Charged > TrackParameters
Wrapper code for Acts track parameters, to provide a position() method without the need of explicitly...

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthCommonReentrantAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 94 of file AthCommonReentrantAlgorithm.cxx.

90{
91 // If we didn't find any symlinks to add, just return the collection
92 // from the base class. Otherwise, return the extended collection.
93 if (!m_extendedExtraObjects.empty()) {
95 }
97}
An algorithm that can be simultaneously executed in multiple threads.

◆ filterPassed()

virtual bool AthCommonReentrantAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Definition at line 96 of file AthCommonReentrantAlgorithm.h.

96 {
97 return execState( ctx ).filterPassed();
98 }
virtual bool filterPassed(const EventContext &ctx) const

◆ finalize()

StatusCode Trk::ExtrapolatorComparisonTest::finalize ( )
override

standard Athena-Algorithm method

Definition at line 132 of file ExtrapolatorComparisonTest.cxx.

133{
134 // Code entered here will be executed once at the end of the program run.
135 return StatusCode::SUCCESS;
136}

◆ generatePerigee()

void Trk::ExtrapolatorComparisonTest::generatePerigee ( std::vector< perigeeParameters > & parameters)
private

◆ initialize()

StatusCode Trk::ExtrapolatorComparisonTest::initialize ( )
override

standard Athena-Algorithm method

Definition at line 68 of file ExtrapolatorComparisonTest.cxx.

69{
70 // Code entered here will be executed once at program start.
71
72 ATH_MSG_INFO(" initialize()");
73
74 ATH_CHECK( m_extrapolationTool.retrieve() );
75 ATH_CHECK( m_atlasExtrapolator.retrieve() );
77
78 // Create the destination surfaces for extrapolation
79 // --> you need the Trk::Surfaces and the Acts::Surfaces
81 // assign the size
83 // loop over it and create the
84 for (unsigned int surface = 0; surface < m_referenceSurfaces; surface++) {
85
86 double radius = m_referenceSurfaceRadius[surface];
87 double halfZ = m_referenceSurfaceHalflength[surface];
88
89 // create the Surface triplet
90 std::vector< const Trk::Surface*> trkSurfaceTriplet;
91 trkSurfaceTriplet.push_back(new Trk::DiscSurface (Amg::Transform3D(Amg::Translation3D(0.,0., halfZ)), 0.,radius));
92 trkSurfaceTriplet.push_back(new Trk::CylinderSurface(Amg::Transform3D(Amg::Translation3D(0.,0., 0.)),radius, halfZ));
93 trkSurfaceTriplet.push_back(new Trk::DiscSurface (Amg::Transform3D(Amg::Translation3D(0.,0.,-halfZ)), 0.,radius));
94 ATH_MSG_INFO("Creating Trk::Surface at: R " << radius << " Z " << halfZ);
95 m_atlasReferenceSurfaceTriples.push_back(trkSurfaceTriplet);
96
97 // create the Surface triplet
98 std::vector<std::shared_ptr<const Acts::Surface>> actsSurfaceTriplet;
99
100 Acts::Transform3 posTransf(Acts::Transform3::Identity()*Acts::Translation3(Acts::Vector3(0.,0., halfZ)));
101 Acts::Transform3 cTransf(Acts::Transform3::Identity()*Acts::Translation3(Acts::Vector3(0.,0., 0.)));
102 Acts::Transform3 negTransf(Acts::Transform3::Identity()*Acts::Translation3(Acts::Vector3(0.,0.,-halfZ)));
103
104 auto posSurface = Acts::Surface::makeShared<Acts::DiscSurface> (posTransf , 0.,radius);
105 auto cSurface = Acts::Surface::makeShared<Acts::CylinderSurface>( cTransf ,radius, halfZ);
106 auto negSurface = Acts::Surface::makeShared<Acts::DiscSurface> (negTransf , 0.,radius);
107
108 actsSurfaceTriplet.push_back(posSurface);
109 actsSurfaceTriplet.push_back(cSurface );
110 actsSurfaceTriplet.push_back(negSurface);
111 ATH_MSG_INFO("Creating Acts::Surface at: R " << radius << " Z " << halfZ);
112 m_actsReferenceSurfaceTriples.push_back(actsSurfaceTriplet);
113
114 m_referenceSurfaceNegativeBoundary.push_back(atan2(radius,-halfZ));
115 m_referenceSurfacePositiveBoundary.push_back(atan2(radius, halfZ));
116 }
117 } else {
118 ATH_MSG_WARNING("Not compatible size of ReferenceSurfaceRadius and ReferenceSurfaceHalfZ!! Returning FAILURE!");
119 return StatusCode::FAILURE;
120 }
121
124 ATH_CHECK( m_rndmSvc.retrieve() );
125 m_randomEngine = m_rndmSvc->getEngine (this, "ExtrapolatorComparisonTest");
126
127 return StatusCode::SUCCESS;
128}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
unsigned int m_referenceSurfaces
member variables for algorithm properties:
Eigen::Affine3d Transform3D
Eigen::Translation< double, 3 > Translation3D
double halfZ(const Acts::VolumeBounds &bounds)
Returns the half-Z length for the parsed volume bounds (Trapezoid/ Cuboid)

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ isClonable()

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setFilterPassed()

virtual void AthCommonReentrantAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Definition at line 100 of file AthCommonReentrantAlgorithm.h.

100 {
102 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const

◆ sysExecute()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Definition at line 85 of file AthCommonReentrantAlgorithm.cxx.

77{
78 return BaseAlg::sysExecute (ctx);
79}

◆ sysInitialize()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in HypoBase, and InputMakerBase.

Definition at line 61 of file AthCommonReentrantAlgorithm.cxx.

107 {
109
110 if (sc.isFailure()) {
111 return sc;
112 }
113
114 ServiceHandle<ICondSvc> cs("CondSvc",name());
115 for (auto h : outputHandles()) {
116 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
117 // do this inside the loop so we don't create the CondSvc until needed
118 if ( cs.retrieve().isFailure() ) {
119 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
120 return StatusCode::SUCCESS;
121 }
122 if (cs->regHandle(this,*h).isFailure()) {
124 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
125 << " with CondSvc");
126 }
127 }
128 }
129 return sc;
130}
#define ATH_MSG_ERROR(x)
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }

Member Data Documentation

◆ m_actsPropResultWriterSvc

ServiceHandle<PropResultRootWriterSvc> Trk::ExtrapolatorComparisonTest::m_actsPropResultWriterSvc {this, "ACTSPropResultRootWriter", "ACTSPropResultRootWriterSvc"}
private

Definition at line 158 of file ExtrapolatorComparisonTest.h.

159{this, "ACTSPropResultRootWriter", "ACTSPropResultRootWriterSvc"};

◆ m_actsReferenceSurfaceTriples

std::vector< std::vector< std::shared_ptr<const Acts::Surface> > > Trk::ExtrapolatorComparisonTest::m_actsReferenceSurfaceTriples
private

Definition at line 152 of file ExtrapolatorComparisonTest.h.

◆ m_atlasExtrapolator

ToolHandle<Trk::IExtrapolator> Trk::ExtrapolatorComparisonTest::m_atlasExtrapolator {this, "Extrapolator", "Trk::Extrapolator/AtlasExtrapolator"}
private

The ATLAS Extrapolator to be retrieved.

Definition at line 120 of file ExtrapolatorComparisonTest.h.

120{this, "Extrapolator", "Trk::Extrapolator/AtlasExtrapolator"};

◆ m_atlasPropResultWriterSvc

ServiceHandle<PropResultRootWriterSvc> Trk::ExtrapolatorComparisonTest::m_atlasPropResultWriterSvc {this, "ATLASPropResultRootWriter", "ATLASPropResultRootWriterSvc"}
private

Definition at line 156 of file ExtrapolatorComparisonTest.h.

157{this, "ATLASPropResultRootWriter", "ATLASPropResultRootWriterSvc"};

◆ m_atlasReferenceSurfaceTriples

std::vector< std::vector<const Trk::Surface*> > Trk::ExtrapolatorComparisonTest::m_atlasReferenceSurfaceTriples
private

Definition at line 151 of file ExtrapolatorComparisonTest.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_eventsPerExecute

IntegerProperty Trk::ExtrapolatorComparisonTest::m_eventsPerExecute {this, "EventsPerExecute", 1}
private

Definition at line 154 of file ExtrapolatorComparisonTest.h.

154{this, "EventsPerExecute", 1};

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonReentrantAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 114 of file AthCommonReentrantAlgorithm.h.

◆ m_extrapolationTool

ToolHandle<ActsTrk::IExtrapolationTool> Trk::ExtrapolatorComparisonTest::m_extrapolationTool {this, "ExtrapolationTool", "ActsExtrapolationTool"}
private

The ACTS ExtrapolationTool to be retrieved.

Definition at line 117 of file ExtrapolatorComparisonTest.h.

117{this, "ExtrapolationTool", "ActsExtrapolationTool"};

◆ m_maxEta

DoubleProperty Trk::ExtrapolatorComparisonTest::m_maxEta {this, "StartPerigeeMaxEta", 3.}
private

Definition at line 131 of file ExtrapolatorComparisonTest.h.

131{this, "StartPerigeeMaxEta", 3.};

◆ m_maxPhi

DoubleProperty Trk::ExtrapolatorComparisonTest::m_maxPhi {this, "StartPerigeeMaxPhi", M_PI}
private

Definition at line 129 of file ExtrapolatorComparisonTest.h.

129{this, "StartPerigeeMaxPhi", M_PI};
#define M_PI

◆ m_maxPt

DoubleProperty Trk::ExtrapolatorComparisonTest::m_maxPt {this, "StartPerigeeMaxPt", 50000*Gaudi::Units::GeV}
private

Definition at line 134 of file ExtrapolatorComparisonTest.h.

135{this, "StartPerigeeMaxPt", 50000*Gaudi::Units::GeV};

◆ m_minEta

DoubleProperty Trk::ExtrapolatorComparisonTest::m_minEta {this, "StartPerigeeMinEta", -3.}
private

Definition at line 130 of file ExtrapolatorComparisonTest.h.

130{this, "StartPerigeeMinEta", -3.};

◆ m_minPhi

DoubleProperty Trk::ExtrapolatorComparisonTest::m_minPhi {this, "StartPerigeeMinPhi", -M_PI}
private

Definition at line 128 of file ExtrapolatorComparisonTest.h.

128{this, "StartPerigeeMinPhi", -M_PI};

◆ m_minPt

DoubleProperty Trk::ExtrapolatorComparisonTest::m_minPt {this, "StartPerigeeMinPt", 0.5*Gaudi::Units::GeV}
private

Definition at line 132 of file ExtrapolatorComparisonTest.h.

133{this, "StartPerigeeMinPt", 0.5*Gaudi::Units::GeV};

◆ m_particleType

IntegerProperty Trk::ExtrapolatorComparisonTest::m_particleType {this, "ParticleType", 2, "the particle type for the extrap."}
private

Definition at line 137 of file ExtrapolatorComparisonTest.h.

138{this, "ParticleType", 2, "the particle type for the extrap."};

◆ m_randomEngine

ATHRNG::RNGWrapper* Trk::ExtrapolatorComparisonTest::m_randomEngine = nullptr
private

Definition at line 161 of file ExtrapolatorComparisonTest.h.

◆ m_referenceSurfaceHalflength

DoubleArrayProperty Trk::ExtrapolatorComparisonTest::m_referenceSurfaceHalflength {this, "ReferenceSurfaceHalfZ", {}}
private

Definition at line 145 of file ExtrapolatorComparisonTest.h.

146{this, "ReferenceSurfaceHalfZ", {}};

◆ m_referenceSurfaceNegativeBoundary

std::vector<double> Trk::ExtrapolatorComparisonTest::m_referenceSurfaceNegativeBoundary
private

Definition at line 148 of file ExtrapolatorComparisonTest.h.

◆ m_referenceSurfacePositiveBoundary

std::vector<double> Trk::ExtrapolatorComparisonTest::m_referenceSurfacePositiveBoundary
private

Definition at line 149 of file ExtrapolatorComparisonTest.h.

◆ m_referenceSurfaceRadius

DoubleArrayProperty Trk::ExtrapolatorComparisonTest::m_referenceSurfaceRadius {this, "ReferenceSurfaceRadius", {}}
private

Definition at line 143 of file ExtrapolatorComparisonTest.h.

144{this, "ReferenceSurfaceRadius", {}};

◆ m_referenceSurfaces

unsigned int Trk::ExtrapolatorComparisonTest::m_referenceSurfaces = 0
private

member variables for algorithm properties:

Definition at line 141 of file ExtrapolatorComparisonTest.h.

◆ m_rndmSvc

ServiceHandle<IAthRNGSvc> Trk::ExtrapolatorComparisonTest::m_rndmSvc {this, "RndmSvc", "AthRNGSvc"}
private

Definition at line 160 of file ExtrapolatorComparisonTest.h.

160{this, "RndmSvc", "AthRNGSvc"};

◆ m_sigmaD0

DoubleProperty Trk::ExtrapolatorComparisonTest::m_sigmaD0 {this, "StartPerigeeSigmaD0", 17.*Gaudi::Units::micrometer}
private

Definition at line 124 of file ExtrapolatorComparisonTest.h.

125{this, "StartPerigeeSigmaD0", 17.*Gaudi::Units::micrometer};

◆ m_sigmaZ0

DoubleProperty Trk::ExtrapolatorComparisonTest::m_sigmaZ0 {this, "StartPerigeeSigmaZ0", 50.*Gaudi::Units::micrometer}
private

Definition at line 126 of file ExtrapolatorComparisonTest.h.

127{this, "StartPerigeeSigmaZ0", 50.*Gaudi::Units::micrometer};

◆ m_trackingGeometryTool

PublicToolHandle<ActsTrk::ITrackingGeometryTool> Trk::ExtrapolatorComparisonTest::m_trackingGeometryTool {this, "TrackingGeometryTool", "ActsTrackingGeometryTool"}
private

Definition at line 122 of file ExtrapolatorComparisonTest.h.

122{this, "TrackingGeometryTool", "ActsTrackingGeometryTool"};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


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