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 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
 Get filter decision:
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 Set filter decision:
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.
ServiceHandle< ActsTrk::ITrackingGeometrySvcm_trackingGeometrySvc {this, "TrackingGeometrySvc", "ActsTrackingGeometrySvc"}
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.

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

Member Function Documentation

◆ 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 138 of file ExtrapolatorComparisonTest.cxx.

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

54{
55 // If we didn't find any symlinks to add, just return the collection
56 // from the base class. Otherwise, return the extended collection.
57 if (!m_extendedExtraObjects.empty()) {
59 }
61}
Common base class for algorithms.

◆ filterPassed()

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

Get filter decision:

Definition at line 93 of file AthCommonAlgorithm.h.

93 {
94 return execState( ctx ).filterPassed();
95 }
virtual bool filterPassed(const EventContext &ctx) const
Get filter decision:

◆ finalize()

StatusCode Trk::ExtrapolatorComparisonTest::finalize ( )
override

standard Athena-Algorithm method

Definition at line 131 of file ExtrapolatorComparisonTest.cxx.

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

◆ generatePerigee()

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

◆ initialize()

StatusCode Trk::ExtrapolatorComparisonTest::initialize ( )
override

standard Athena-Algorithm method

Definition at line 66 of file ExtrapolatorComparisonTest.cxx.

66 {
67 // Code entered here will be executed once at program start.
68
69 ATH_MSG_INFO(" initialize()");
70
74
75 // Create the destination surfaces for extrapolation
76 // --> you need the Trk::Surfaces and the Acts::Surfaces
78 // assign the size
80 // loop over it and create the
81 for (unsigned int surface = 0; surface < m_referenceSurfaces; surface++) {
82 double radius = m_referenceSurfaceRadius[surface];
83 double halfZ = m_referenceSurfaceHalflength[surface];
84
85 // create the Surface triplet
86 std::vector< const Trk::Surface*> trkSurfaceTriplet;
87 trkSurfaceTriplet.push_back(new Trk::DiscSurface(Amg::Transform3D(Amg::Translation3D(0., 0., halfZ)), 0.,
88 radius));
89 trkSurfaceTriplet.push_back(new Trk::CylinderSurface(Amg::Transform3D(Amg::Translation3D(0., 0., 0.)), radius,
90 halfZ));
91 trkSurfaceTriplet.push_back(new Trk::DiscSurface(Amg::Transform3D(Amg::Translation3D(0., 0., -halfZ)), 0.,
92 radius));
93 ATH_MSG_INFO("Creating Trk::Surface at: R " << radius << " Z " << halfZ);
94 m_atlasReferenceSurfaceTriples.push_back(std::move(trkSurfaceTriplet));
95
96 // create the Surface triplet
97 std::vector<std::shared_ptr<const Acts::Surface> > actsSurfaceTriplet;
98
99 Acts::Transform3 posTransf(Acts::Transform3::Identity() * Acts::Translation3(Acts::Vector3(0., 0., halfZ)));
100 Acts::Transform3 cTransf(Acts::Transform3::Identity() * Acts::Translation3(Acts::Vector3(0., 0., 0.)));
101 Acts::Transform3 negTransf(Acts::Transform3::Identity() * Acts::Translation3(Acts::Vector3(0., 0., -halfZ)));
102
103 auto posSurface = Acts::Surface::makeShared<Acts::DiscSurface> (posTransf, 0., radius);
104 auto cSurface = Acts::Surface::makeShared<Acts::CylinderSurface>(cTransf, radius, halfZ);
105 auto negSurface = Acts::Surface::makeShared<Acts::DiscSurface> (negTransf, 0., radius);
106
107 actsSurfaceTriplet.push_back(posSurface);
108 actsSurfaceTriplet.push_back(cSurface);
109 actsSurfaceTriplet.push_back(negSurface);
110 ATH_MSG_INFO("Creating Acts::Surface at: R " << radius << " Z " << halfZ);
111 m_actsReferenceSurfaceTriples.push_back(std::move(actsSurfaceTriplet));
112
113 m_referenceSurfaceNegativeBoundary.push_back(atan2(radius, -halfZ));
114 m_referenceSurfacePositiveBoundary.push_back(atan2(radius, halfZ));
115 }
116 } else {
117 ATH_MSG_WARNING("Not compatible size of ReferenceSurfaceRadius and ReferenceSurfaceHalfZ!! Returning FAILURE!");
118 return StatusCode::FAILURE;
119 }
120
123 ATH_CHECK(m_rndmSvc.retrieve());
124 m_randomEngine = m_rndmSvc->getEngine(this, "ExtrapolatorComparisonTest");
125
126 return StatusCode::SUCCESS;
127}
#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()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::isClonable ( ) const
inlineoverridevirtualinherited

Specify if the algorithm is clonable.

Only relevant for non-reentrant algorithms. Actual number of clones needs to be set via the "Cardinality" property.

Reimplemented in AFP_DigiTop, AlgB, AlgT, BCM_Digitization, CscDigitBuilder, CscDigitToCscRDO, G4AtlasAlg, G4RunAlg, HGTD_Digitization, HiveAlgBase, InDet::GNNSeedingTrackMaker, InDet::SCT_Clusterization, InDet::SiSPGNNTrackMaker, InDet::SiSPSeededTrackFinder, InDet::SiTrackerSpacePointFinder, ISF::SimKernelMT, ITk::StripDigitization, ITkPixelCablingAlg, ITkStripCablingAlg, LArHitEMapMaker, LArTTL1Maker, LUCID_DigiTop, LVL1::L1TopoSimulation, MergeCalibHits, MergeGenericMuonSimHitColl, MergeHijingPars, MergeMcEventCollection, MergeTrackRecordCollection, MergeTruthJets, MergeTruthParticles, MuonDigitizer, PileUpMTAlg, PixelDigitization, RoIBResultToxAOD, SCT_ByteStreamErrorsTestAlg, SCT_CablingCondAlgFromCoraCool, SCT_CablingCondAlgFromText, SCT_ConditionsParameterTestAlg, SCT_ConditionsSummaryTestAlg, SCT_ConfigurationConditionsTestAlg, SCT_Digitization, SCT_FlaggedConditionTestAlg, SCT_LinkMaskingTestAlg, SCT_MajorityConditionsTestAlg, SCT_ModuleVetoTestAlg, SCT_MonitorConditionsTestAlg, SCT_PrepDataToxAOD, SCT_RawDataToxAOD, SCT_ReadCalibChipDataTestAlg, SCT_ReadCalibDataTestAlg, SCT_RODVetoTestAlg, SCT_SensorsTestAlg, SCT_SiliconConditionsTestAlg, SCT_StripVetoTestAlg, SCT_TdaqEnabledTestAlg, SCT_TestCablingAlg, SCTEventFlagWriter, SCTRawDataProvider, SCTSiLorentzAngleTestAlg, SCTSiPropertiesTestAlg, SGInputLoader, Simulation::BeamEffectsAlg, TileHitVecToCnt, TileMuonFitter, TilePulseForTileMuonReceiver, TileRawChannelMaker, TRTDigitization, and ZDC_DigiTop.

Definition at line 68 of file AthCommonAlgorithm.h.

68 {
69 return true;
70 }

◆ 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 AthCommonAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Set filter decision:

Reimplemented in AthFilterAlgorithm.

Definition at line 99 of file AthCommonAlgorithm.h.

99 {
101 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const
Set filter decision:

◆ sysExecute()

StatusCode AthCommonAlgorithm< 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.

Reimplemented in AthAnalysisAlgorithm.

Definition at line 80 of file AthCommonAlgorithm.cxx.

41{
42 return BaseAlg::sysExecute (ctx);
43}

◆ sysInitialize()

StatusCode AthCommonAlgorithm< 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 AthAnalysisAlgorithm, AthFilterAlgorithm, AthHistogramAlgorithm, HypoBase, InputMakerBase, and PyAthena::Alg.

Definition at line 60 of file AthCommonAlgorithm.cxx.

71 {
73
74 if (sc.isFailure()) {
75 return sc;
76 }
77
78 ServiceHandle<ICondSvc> cs("CondSvc",name());
79 for (auto h : outputHandles()) {
80 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
81 // do this inside the loop so we don't create the CondSvc until needed
82 if ( cs.retrieve().isFailure() ) {
83 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
85 }
86 if (cs->regHandle(this,*h).isFailure()) {
88 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
89 << " with CondSvc");
90 }
91 }
92 }
93 return sc;
94}
virtual StatusCode sysInitialize() override
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 AthCommonAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

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

Empty if no symlinks were found.

Definition at line 108 of file AthCommonAlgorithm.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_trackingGeometrySvc

ServiceHandle<ActsTrk::ITrackingGeometrySvc> Trk::ExtrapolatorComparisonTest::m_trackingGeometrySvc {this, "TrackingGeometrySvc", "ActsTrackingGeometrySvc"}
private

Definition at line 122 of file ExtrapolatorComparisonTest.h.

122{this, "TrackingGeometrySvc", "ActsTrackingGeometrySvc"};

◆ 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: