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

#include <TrackToTrackParticleCnvAlg.h>

Inheritance diagram for ActsTrk::TrackToTrackParticleCnvAlg:

Public Member Functions

 TrackToTrackParticleCnvAlg (const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode initialize () override
virtual StatusCode execute (const EventContext &ctx) const override
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

enum class  expressionStrategy { DontRecalculate , BeamLine , Vertex }
using Stepper = Acts::EigenStepper<>
using Navigator = Acts::Navigator
using Propagator = Acts::Propagator<Stepper, Navigator>
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

Acts::BoundTrackParameters parametersAtPerigee (const EventContext &ctx, const typename ActsTrk::TrackContainer::ConstTrackProxy &track, const Acts::PerigeeSurface &perigee_surface) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Static Private Member Functions

static std::shared_ptr< Acts::PerigeeSurface > makePerigeeSurface (const InDet::BeamSpotData *beamspotptr)
static std::shared_ptr< Acts::PerigeeSurface > makePerigeeSurface (const xAOD::Vertex &)
static xAOD::ParticleHypothesis convertParticleHypothesis (Acts::PdgParticle abs_pdg_id)
static void initParticleHypothesisMap ()

Private Attributes

ToolHandle< ActsTrk::IExtrapolationToolm_extrapolationTool {this, "ExtrapolationTool", ""}
PublicToolHandle< ActsTrk::ITrackingGeometryToolm_trackingGeometryTool {this, "TrackingGeometryTool", "ActsTrackingGeometryTool"}
SG::ReadHandleKeyArray< ActsTrk::TrackContainerm_tracksContainerKey {this, "ACTSTracksLocation", {},"Track collection (ActsTrk variant)"}
SG::ReadCondHandleKey< InDet::BeamSpotDatam_beamSpotKey {this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot or empty." }
SG::ReadCondHandleKey< AtlasFieldCacheCondObjm_fieldCacheCondObjInputKey {this,"AtlasFieldCacheCondObj","fieldCondObj", "Name of the Magnetic Field conditions object key" }
SG::ReadCondHandleKeyArray< InDetDD::SiDetectorElementCollectionm_siDetEleCollKey {this, "SiDetectorElementCollections", {}, "Pixel and strip element collections to get geometry information about measurements."}
Gaudi::Property< std::vector< unsigned int > > m_siDetEleCollToMeasurementType {this, "SiDetEleCollToMeasurementType",{}, "One value per si detector collection: Pixel = 1, Strip = 2"}
SG::ReadHandleKey< xAOD::VertexContainerm_vertexHandle {this, "VertexContainerKey", "", "Name of the Primary Vertex Container"}
SG::WriteHandleKey< xAOD::TrackParticleContainerm_trackParticlesOutKey {this, "TrackParticlesOutKey","", "Name of the produced track particle collection" }
SG::WriteDecorHandleKey< xAOD::TrackParticleContainerm_decorator_actsTracks {this, "ActsTrackLink", "actsTrack"}
Gaudi::Property< double > m_paramExtrapolationParLimit {this, "ExtrapolationPathLimit",std::numeric_limits<double>::max(), "PathLimit for extrapolating track parameters." }
Gaudi::Property< bool > m_firstAndLastParamOnly {this, "FirstAndLastParameterOnly",true, "Only convert the first and the last parameter." }
Gaudi::Property< bool > m_computeExpectedLayerPattern {this, "ComputeExpectedLayerPattern",true, "Compute the expected layer pattern. CPU expensive" }
Gaudi::Property< bool > m_expectIfPixelContributes {this, "expectIfPixelContribution",true, "Only expect pixel hits if there are pixel hits on track." }
Gaudi::Property< double > m_pixelExpectLayerPathLimitInMM
Gaudi::Property< std::string > m_perigeeExpression {this, "PerigeeExpression", "DontRecalculate"}
expressionStrategy m_expression_strategy {expressionStrategy::BeamLine}
std::unique_ptr< Propagatorm_propagator
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

Static Private Attributes

static std::vector< std::pair< Acts::PdgParticle, xAOD::ParticleHypothesis > > s_actsHypothesisToxAOD ATLAS_THREAD_SAFE

Detailed Description

Definition at line 50 of file TrackToTrackParticleCnvAlg.h.

Member Typedef Documentation

◆ Navigator

using ActsTrk::TrackToTrackParticleCnvAlg::Navigator = Acts::Navigator
private

Definition at line 63 of file TrackToTrackParticleCnvAlg.h.

◆ Propagator

Definition at line 64 of file TrackToTrackParticleCnvAlg.h.

◆ Stepper

using ActsTrk::TrackToTrackParticleCnvAlg::Stepper = Acts::EigenStepper<>
private

Definition at line 62 of file TrackToTrackParticleCnvAlg.h.

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Member Enumeration Documentation

◆ expressionStrategy

Enumerator
DontRecalculate 
BeamLine 
Vertex 

Definition at line 113 of file TrackToTrackParticleCnvAlg.h.

113{DontRecalculate, BeamLine, Vertex};
boost::graph_traits< boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS > >::vertex_descriptor Vertex
@ BeamLine
Parameter defined at the Vertex/Beamline.

Constructor & Destructor Documentation

◆ TrackToTrackParticleCnvAlg()

ActsTrk::TrackToTrackParticleCnvAlg::TrackToTrackParticleCnvAlg ( const std::string & name,
ISvcLocator * pSvcLocator )

Definition at line 124 of file TrackToTrackParticleCnvAlg.cxx.

126 : AthReentrantAlgorithm(name, pSvcLocator)
127 {
128 }

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}

◆ convertParticleHypothesis()

xAOD::ParticleHypothesis ActsTrk::TrackToTrackParticleCnvAlg::convertParticleHypothesis ( Acts::PdgParticle abs_pdg_id)
inlinestaticprivate

Definition at line 125 of file TrackToTrackParticleCnvAlg.h.

125 {
126 std::vector<std::pair<Acts::PdgParticle, xAOD::ParticleHypothesis> >::const_iterator
127 iter = std::find_if(s_actsHypothesisToxAOD.begin(),
128 s_actsHypothesisToxAOD.end(),
129 [abs_pdg_id](const std::pair<Acts::PdgParticle, xAOD::ParticleHypothesis> &elm) {
130 return abs_pdg_id == elm.first;
131 });
132 return (iter != s_actsHypothesisToxAOD.end() ? iter->second : xAOD::noHypothesis);
133}
@ noHypothesis
For material collection.

◆ 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 ActsTrk::TrackToTrackParticleCnvAlg::execute ( const EventContext & ctx) const
overridevirtual

Definition at line 201 of file TrackToTrackParticleCnvAlg.cxx.

202 {
203 SG::WriteHandle<xAOD::TrackParticleContainer> wh_track_particles( m_trackParticlesOutKey, ctx);
204 if (wh_track_particles.record(std::make_unique<xAOD::TrackParticleContainer>(),
205 std::make_unique<xAOD::TrackParticleAuxContainer>()).isFailure()) {
206 ATH_MSG_ERROR("Failed to record track particle container with key " << m_trackParticlesOutKey.key() );
207 return StatusCode::FAILURE;
208 }
209
210 SG::WriteDecorHandle<xAOD::TrackParticleContainer, ElementLink<ActsTrk::TrackContainer>> trackLink(m_decorator_actsTracks, ctx);
211
212 xAOD::TrackParticleContainer *track_particles = wh_track_particles.ptr();
213
214 const InDet::BeamSpotData *beamspot_data {nullptr};
215 const xAOD::VertexContainer *vertexContainer {nullptr};
216 const xAOD::Vertex* primaryVertex {nullptr};
217
219 SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle = SG::makeHandle( m_beamSpotKey, ctx );
220 ATH_CHECK(beamSpotHandle.isValid());
221 beamspot_data = beamSpotHandle.cptr();
222 }
223
225 SG::ReadHandle<xAOD::VertexContainer> vertexHandle = SG::makeHandle( m_vertexHandle, ctx );
226 ATH_CHECK( vertexHandle.isValid() );
227 vertexContainer = vertexHandle.cptr();
228 if (vertexContainer->size() == 0) {
229 ATH_MSG_ERROR("Retrieved an empty vertex container. This is totally wrong!");
230 return StatusCode::FAILURE;
231 }
232
233 for(const xAOD::Vertex* vtx : *vertexContainer) {
234 if(vtx->vertexType() == xAOD::VxType::PriVtx) {
235 primaryVertex = vtx;
236 break;
237 }
238 }
239
240 if (not primaryVertex) {
241 ATH_MSG_WARNING("Requested to compute track particles wrt primary vertex, but no primary vertex is found. Using dummy vertex");
242 primaryVertex = vertexContainer->front();
243 }
244 }
245
246 std::size_t nTracks = 0ul;
247 std::vector<const ActsTrk::TrackContainer *> trackContainers;
248 for (const SG::ReadHandleKey<ActsTrk::TrackContainer>& handleKey : m_tracksContainerKey) {
249 SG::ReadHandle<ActsTrk::TrackContainer> handle = SG::makeHandle( handleKey, ctx );
250 ATH_CHECK(handle.isValid());
251 trackContainers.push_back( handle.cptr() );
252 nTracks += trackContainers.back()->size();
253 }
254
255 // Fast Insertion Trick
256 std::vector<xAOD::TrackParticle*> toAddParticles;
257 toAddParticles.reserve(nTracks);
258 for (std::size_t i(0); i<nTracks; ++i) {
259 toAddParticles.push_back( new xAOD::TrackParticle() );
260 }
261 track_particles->insert(track_particles->end(),
262 toAddParticles.begin(),
263 toAddParticles.end());
264
265 SG::ReadCondHandle<AtlasFieldCacheCondObj> fieldHandle = SG::makeHandle( m_fieldCacheCondObjInputKey, ctx );
266 ATH_CHECK(fieldHandle.isValid());
267 const AtlasFieldCacheCondObj *field_cond_data = fieldHandle.cptr();
268 MagField::AtlasFieldCache fieldCache;
269 field_cond_data->getInitializedCache(fieldCache);
270
271 const GeometryContext &gctx = m_trackingGeometryTool->getNominalGeometryContext();
272 std::shared_ptr<Acts::PerigeeSurface> perigee_surface {nullptr};
274 perigee_surface = makePerigeeSurface(beamspot_data);
276 perigee_surface = makePerigeeSurface(*primaryVertex);
277 }
278
279 std::array<const InDetDD::SiDetectorElementCollection *,ActsTrk::detail::to_underlying(xAOD::UncalibMeasType::nTypes)> siDetEleColl {};
280 for (unsigned int idx=0; idx <m_siDetEleCollToMeasurementType.size(); ++idx ) {
281 SG::ReadCondHandle<InDetDD::SiDetectorElementCollection> detHandle = SG::makeHandle( m_siDetEleCollKey[idx], ctx );
282 ATH_CHECK(detHandle.isValid());
283 siDetEleColl[m_siDetEleCollToMeasurementType[idx] ] = detHandle.cptr();
284 }
285
286 static const std::array<unsigned short, ActsTrk::detail::to_underlying(xAOD::UncalibMeasType::nTypes)>
287 measurementToSummaryType ATLAS_THREAD_SAFE (makeMeasurementToSummaryTypeMap());
288
289
290
291 // re-used temporaries
292 std::vector<float> tmp_cov_vector;
293 std::vector<ActsTrk::TrackStateBackend::ConstTrackStateProxy::IndexType > tmp_param_state_idx;
294 tmp_param_state_idx.reserve(30);
295 Amg::Vector3D magnFieldVect;
296 std::vector<std::vector<float>> parametersVec;
297 ActsTrk::detail::HitSummaryData hitInfo;
298
299 unsigned int converted_track_states=0;
300
301 std::size_t particleCounter = 0ul;
302 using namespace Acts::UnitLiterals;
303 for (const ActsTrk::TrackContainer *tracksContainer : trackContainers) {
304
305 bool precalculatedLayerPattern = detail::ExpectedLayerPatternHelper::exists(*tracksContainer);
306
307 for (const typename ActsTrk::TrackContainer::ConstTrackProxy track : *tracksContainer) {
308 xAOD::TrackParticle *track_particle = track_particles->at(particleCounter++);
309
310 // convert defining parameters
311 // @TODO add support for other modes available in the legacy converter : wrt a vertex, origin, beamspot ?
312 Acts::BoundTrackParameters perigeeParam = [&] {
314 // If the strategy is "DontRecalculate", we will take the reference surface as is
315 // from the track finding without modification. Consult track finding configuration to
316 // find out what that is.
317 return track.createParametersAtReference();
318 }
319 else {
320 return parametersAtPerigee(ctx, track, *perigee_surface);
321 }
322 }();
323
324 Acts::BoundVector boundParams = perigeeParam.parameters();
325 track_particle->setDefiningParameters(boundParams[Acts::eBoundLoc0],
326 boundParams[Acts::eBoundLoc1],
327 boundParams[Acts::eBoundPhi],
328 boundParams[Acts::eBoundTheta],
329 boundParams[Acts::eBoundQOverP] * 1_MeV);
330
331 if (perigeeParam.covariance().has_value()) {
332 // only use the 5x5 sub-matrix of the full covariance matrix
333 lowerTriangleToVectorScaleLastRow(perigeeParam.covariance().value(),tmp_cov_vector,5, 1_MeV);
334 track_particle->setDefiningParametersCovMatrixVec(tmp_cov_vector);
335 }
336 // optional beam tilt
337 if (beamspot_data) {
338 track_particle->setBeamlineTiltX(beamspot_data->beamTilt(0));
339 track_particle->setBeamlineTiltY(beamspot_data->beamTilt(1));
340 }
341
342 // fit info, quality
343 track_particle->setFitQuality(track.chi2(), track.nDoF());
344 track_particle->setPatternRecognitionInfo( (1ul << xAOD::SiSPSeededFinder) );
345 track_particle->setTrackFitter(xAOD::KalmanFitter);
346
347 const Acts::ParticleHypothesis &hypothesis = track.particleHypothesis();
348 track_particle->setParticleHypothesis(convertParticleHypothesis( hypothesis.absolutePdg() ));
349 constexpr float inv_1_MeV = 1/1_MeV;
350 // gather track state indices for parameter conversion
351 // @TODO add support for muons
352
353 // xAOD::UncalibMeasType::underlying_type is expected to be the number of UncalibMeasTypes
356
357 ActsTrk::detail::SumOfValues chi2_stat;
358 gatherTrackSummaryData(*tracksContainer,
359 track,
360 siDetEleColl,
361 measurementToSummaryType,
362 chi2_stat,
363 hitInfo,
364 tmp_param_state_idx,
365 specialHitCounts);
366
367 // Muon
368 // MdtDriftCircleType = 3
369 // RpcStripType = 4,
370 // TgcStripType = 5,
371 // MMClusterType = 6,
372 // sTgcStripType = 7,
373
374 // pixel summaries
375 std::array< std::tuple< uint8_t, uint8_t, uint8_t, bool >, 4> copy_summary {
376 std::make_tuple(static_cast<uint8_t>(ActsTrk::detail::HitSummaryData::pixelTotal),
378 static_cast<uint8_t>(xAOD::numberOfPixelHits),
379 false),
380
381 std::make_tuple(static_cast<uint8_t>(ActsTrk::detail::HitSummaryData::pixelBarrelFlat),
384 true),
385
389 true),
390
391 std::make_tuple(static_cast<uint8_t>(ActsTrk::detail::HitSummaryData::pixelEndcap),
394 true) };
395
396 for (auto [src_region, dest_xaod_summary_layer, dest_xaod_summary_hits, add_outlier] : copy_summary ) {
397 setSummaryValue(*track_particle,
399 static_cast<xAOD::SummaryType>(dest_xaod_summary_layer));
400 setSummaryValue(*track_particle,
402 + ( add_outlier
404 : 0),
405 static_cast<xAOD::SummaryType>(dest_xaod_summary_hits));
406 }
407 setSummaryValue(*track_particle,
411 setSummaryValue(*track_particle,
414 setSummaryValue(*track_particle,
420 setSummaryValue(*track_particle,
424 setSummaryValue(*track_particle,
427 setSummaryValue(*track_particle,
430 setSummaryValue(*track_particle,
433 setSummaryValue(*track_particle,
437 setSummaryValue(*track_particle,
440
441
442 std::array<unsigned int,4> expect_layer_pattern{};
443 if (precalculatedLayerPattern) {
444 // We have a pre-calculated layer pattern from track finding, use as is
445 expect_layer_pattern = detail::ExpectedLayerPatternHelper::get(track);
446 }
447 else {
448 // Only check if computeExpectedLayerPattern is true. TODO:: move this computation to the track finding to avoid calling propagator steps here.
449 // Do not expect pixel hits if there are not contributing pixel hits in the flat barrel and expectIfPixelContributes is true
450 expect_layer_pattern = (m_computeExpectedLayerPattern.value()
451 && (!m_expectIfPixelContributes.value()
455 perigeeParam,
456 m_pixelExpectLayerPathLimitInMM.value() * Acts::UnitConstants::mm)
457 : std::array<unsigned int,4> {0u,0u, 0u,0u} );
458 }
459
460 // @TODO consider end-caps for inner most pixel hits ?
461 setSummaryValue(*track_particle,
462 static_cast<uint8_t>((expect_layer_pattern[0] & (1<<0)) != 0 ),
464 setSummaryValue(*track_particle,
465 static_cast<uint8_t>((expect_layer_pattern[0] & (1<<1)) != 0 ),
467 setSummaryValue(*track_particle,
470 setSummaryValue(*track_particle,
473 setSummaryValue(*track_particle,
476 setSummaryValue(*track_particle,
479 setSummaryValue(*track_particle,
482 setSummaryValue(*track_particle,
485
486 // Strip summaries
487 setSummaryValue(*track_particle,
490 setSummaryValue(*track_particle,
493 setSummaryValue(*track_particle,
496 setSummaryValue(*track_particle,
499
500 double biased_chi2_variance = chi2_stat.biasedVariance();
501 setSummaryValue(*track_particle,
502 static_cast<uint8_t> (biased_chi2_variance>0.
503 ? std::min(static_cast<unsigned int>(std::sqrt(biased_chi2_variance) * 100),255u)
504 : 0u),
506
507 setSummaryValue(*track_particle,
511
512
513 // @TODO slect states for which parameters are stored
514 if (m_firstAndLastParamOnly && tmp_param_state_idx.size()>2) {
515 tmp_param_state_idx[1]=tmp_param_state_idx.back();
516 tmp_param_state_idx.erase(tmp_param_state_idx.begin()+2,tmp_param_state_idx.end());
517 }
518
519 // store track parameters and covariances for slected states
520 parametersVec.clear();
521 parametersVec.reserve(tmp_param_state_idx.size());
522
523 for(std::vector<ActsTrk::TrackStateBackend::ConstTrackStateProxy::IndexType>::const_reverse_iterator
524 idx_iter = tmp_param_state_idx.rbegin();
525 idx_iter != tmp_param_state_idx.rend();
526 ++idx_iter) {
527 // for(ActsTrk::TrackStateBackend::ConstTrackStateProxy::IndexType idx : tmp_param_state_idx) {
528 ActsTrk::TrackStateBackend::ConstTrackStateProxy
529 state = tracksContainer->trackStateContainer().getTrackState(*idx_iter);
530 const Acts::BoundTrackParameters actsParam = track.createParametersFromState(state);
531
532 Acts::Vector3 position = actsParam.position(gctx.context());
533 Acts::Vector3 momentum = actsParam.momentum();
534
535 // scaling from Acts momentume units (GeV) to Athena Units (MeV)
536 for (unsigned int i=0; i<momentum.rows(); ++i) {
537 momentum(i) *= inv_1_MeV;
538 }
539
540
541 if (actsParam.covariance()) {
542 Acts::MagneticFieldContext mfContext = m_extrapolationTool->getMagneticFieldContext(ctx);
543 Acts::GeometryContext tgContext = gctx.context();
544
545 magnFieldVect.setZero();
546 fieldCache.getField(position.data(), magnFieldVect.data());
547 // scaling from Athena magnetic field units kT to Acts units T
548 {
549 using namespace Acts::UnitLiterals;
550 magnFieldVect *= 1000_T;
551 }
552
553 auto curvilinear_cov_result = ActsTrk::detail::convertActsBoundCovToCurvilinearParam(tgContext, actsParam, magnFieldVect, hypothesis);
554 if (curvilinear_cov_result.has_value()) {
555 Acts::BoundSquareMatrix &curvilinear_cov = curvilinear_cov_result.value();
556
557 // convert q/p components from GeV (Acts) to MeV (Athena)
558 for (unsigned int col_i=0; col_i<4; ++col_i) {
559 curvilinear_cov(col_i,4) *= 1_MeV;
560 curvilinear_cov(4,col_i) *= 1_MeV;
561 }
562 curvilinear_cov(4,4) *= (1_MeV * 1_MeV);
563
564 std::size_t param_idx = parametersVec.size();
565 // only use the 5x5 sub-matrix of the full covariance matrix
566 lowerTriangleToVector(curvilinear_cov,tmp_cov_vector,5);
567 if (tmp_cov_vector.size() != 15) {
568 ATH_MSG_ERROR("Invalid size of lower triangle cov " << tmp_cov_vector.size() << " != 15"
569 << " input matrix : " << curvilinear_cov.rows() << " x " << curvilinear_cov.cols() );
570 }
571 track_particle->setTrackParameterCovarianceMatrix(param_idx, tmp_cov_vector);
572 }
573 }
574 parametersVec.emplace_back(std::vector<float>{
575 static_cast<float>(position[0]),static_cast<float>(position[1]),static_cast<float>(position[2]),
576 static_cast<float>(momentum[0]),static_cast<float>(momentum[1]),static_cast<float>(momentum[2]) });
577 ++converted_track_states;
578
579
580 }
581 for (const std::vector<float> &param : parametersVec) {
582 if (param.size() != 6) {
583 ATH_MSG_ERROR("Invalid size of param element " << param.size() << " != 6" );
584 }
585 }
586
587 track_particle->setTrackParameters(parametersVec);
588
589 // add element to link to the correspond track
590 trackLink(*track_particle)
591 = ElementLink<ActsTrk::TrackContainer>( tracksContainer,
592 track.index() );
593 ATH_CHECK( (trackLink(*track_particle)).isValid() );
594 }
595 }
596 ATH_MSG_DEBUG( "Converted " << nTracks << " acts tracks into " << track_particles->size()
597 << " track particles with parameters for " << converted_track_states << " track states.");
598
599 return StatusCode::SUCCESS;
600 }
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
Definition AtlasPID.h:878
static std::vector< std::pair< Acts::PdgParticle, xAOD::ParticleHypothesis > > s_actsHypothesisToxAOD ATLAS_THREAD_SAFE
static xAOD::ParticleHypothesis convertParticleHypothesis(Acts::PdgParticle abs_pdg_id)
static std::shared_ptr< Acts::PerigeeSurface > makePerigeeSurface(const InDet::BeamSpotData *beamspotptr)
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_decorator_actsTracks
SG::ReadCondHandleKeyArray< InDetDD::SiDetectorElementCollection > m_siDetEleCollKey
Gaudi::Property< double > m_pixelExpectLayerPathLimitInMM
Acts::BoundTrackParameters parametersAtPerigee(const EventContext &ctx, const typename ActsTrk::TrackContainer::ConstTrackProxy &track, const Acts::PerigeeSurface &perigee_surface) const
SG::WriteHandleKey< xAOD::TrackParticleContainer > m_trackParticlesOutKey
Gaudi::Property< std::vector< unsigned int > > m_siDetEleCollToMeasurementType
PublicToolHandle< ActsTrk::ITrackingGeometryTool > m_trackingGeometryTool
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexHandle
ToolHandle< ActsTrk::IExtrapolationTool > m_extrapolationTool
SG::ReadHandleKeyArray< ActsTrk::TrackContainer > m_tracksContainerKey
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > m_fieldCacheCondObjInputKey
DetectorRegion
Regions for which hit counts are computed.
uint8_t contributingSharedHits(DetectorRegion region) const
return the number of shared hits in a certain detector region.
uint8_t sum(DetectorRegion region, uint8_t layer) const
return the total number of hits, outliers, and/or shared hits in the givrn detector region and layer.
uint8_t contributingOutlierHits(DetectorRegion region) const
return the number of outliers in a certain detector region.
uint8_t contributingHits(DetectorRegion region) const
return the number of hits in a certain detector region.
uint8_t contributingLayers(DetectorRegion region) const
return the number of layers contributing to the hit collection in the given detector region.
void getInitializedCache(MagField::AtlasFieldCache &cache) const
get B field cache for evaluation as a function of 2-d or 3-d position.
const T * at(size_type n) const
Access an element, as an rvalue.
iterator insert(iterator position, value_type pElem)
Add a new element to the collection.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
float beamTilt(int i) const noexcept
Returns the beam sigma for the i+3-th error matrix element (the 'tilt')
void getField(const double *ATH_RESTRICT xyz, double *ATH_RESTRICT bxyz, double *ATH_RESTRICT deriv=nullptr)
get B field value at given position xyz[3] is in mm, bxyz[3] is in kT if deriv[9] is given,...
const_pointer_type cptr()
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type cptr()
Dereference the pointer.
void setTrackParameterCovarianceMatrix(unsigned int index, std::vector< float > &cov)
Set the cov matrix of the parameter at 'index', using a vector of floats.
void setTrackParameters(std::vector< std::vector< float > > &parameters)
Set the parameters via the passed vector of vectors.
void setBeamlineTiltX(float tiltX)
void setFitQuality(float chiSquared, float numberDoF)
Set the 'Fit Quality' information.
void setBeamlineTiltY(float tiltY)
void setDefiningParameters(float d0, float z0, float phi0, float theta, float qOverP)
Set the defining parameters.
void setParticleHypothesis(const ParticleHypothesis hypo)
Method for setting the particle type, using the ParticleHypothesis enum.
void setTrackFitter(const TrackFitter fitter)
Method for setting the fitter, using the TrackFitter enum.
void setPatternRecognitionInfo(const std::bitset< xAOD::NumberOfTrackRecoInfo > &patternReco)
Method setting the pattern recognition algorithm, using a bitset.
void setDefiningParametersCovMatrixVec(const std::vector< float > &cov)
void gatherTrackSummaryData(const ActsTrk::TrackContainer &tracksContainer, const typename ActsTrk::TrackContainer::ConstTrackProxy &track, const std::array< const InDetDD::SiDetectorElementCollection *, to_underlying(xAOD::UncalibMeasType::nTypes)> &siDetEleColl, const std::array< unsigned short, to_underlying(xAOD::UncalibMeasType::nTypes)> &measurement_to_summary_type, SumOfValues &chi2_stat_out, HitSummaryData &hit_info_out, std::vector< ActsTrk::TrackStateBackend::ConstTrackStateProxy::IndexType > &param_state_idx_out, std::array< std::array< uint8_t, to_underlying(HitCategory::N)>, to_underlying(xAOD::UncalibMeasType::nTypes)> &special_hit_counts_out)
Helper to gather track summary information from the track states of the specified track.
constexpr std::underlying_type< T_EnumClass >::type to_underlying(T_EnumClass an_enum)
Helper to convert class enum into an integer.
std::array< unsigned int, 4 > expectedLayerPattern(const EventContext &ctx, const IExtrapolationTool &extrapolator, const Acts::BoundTrackParameters &perigee_parameters, double pathLimit)
Extrapolate from the perigee outwards and gather information which detector layers should have hits.
std::optional< Acts::BoundMatrix > convertActsBoundCovToCurvilinearParam(const Acts::GeometryContext &tgContext, const Acts::BoundTrackParameters &param, const Acts::Vector3 &magnFieldVect, const Acts::ParticleHypothesis &particle_hypothesis)
Convert the covariance of the given Acts track parameters into curvilinear parameterisation.
Eigen::Matrix< double, 3, 1 > Vector3D
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
unsigned long ul
@ PriVtx
Primary vertex.
@ KalmanFitter
tracks produced by the Kalman Fitter
TrackParticle_v1 TrackParticle
Reference the current persistent version:
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".
Vertex_v1 Vertex
Define the latest version of the vertex class.
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".
SummaryType
Enumerates the different types of information stored in Summary.
@ numberOfInnermostPixelLayerSharedEndcapHits
number of Pixel 0th layer endcap hits shared by several tracks.
@ expectInnermostPixelLayerHit
Do we expect a 0th-layer barrel hit for this track?
@ numberOfPixelHoles
number of pixel layers on track with absence of hits [unit8_t].
@ numberOfInnermostPixelLayerEndcapHits
these are the hits in the 0th pixel layer endcap [unit8_t].
@ numberOfNextToInnermostPixelLayerSharedHits
number of Pixel 1st layer barrel hits shared by several tracks.
@ numberOfNextToInnermostPixelLayerSharedEndcapHits
number of Pixel 1st layer endcap hits shared by several tracks.
@ numberOfContribPixelLayers
number of contributing layers of the pixel detector [unit8_t].
@ standardDeviationOfChi2OS
100 times the standard deviation of the chi2 from the surfaces [unit8_t].
@ numberOfInnermostPixelLayerEndcapOutliers
number of 0th layer endcap outliers
@ numberOfInnermostPixelLayerSharedHits
number of Pixel 0th layer barrel hits shared by several tracks.
@ numberOfPixelOutliers
these are the pixel outliers, including the b-layer [unit8_t].
@ numberOfContribPixelBarrelFlatLayers
number of contributing barrel flat layers of the pixel detector [unit8_t].
@ numberOfNextToInnermostPixelLayerHits
these are the hits in the 1st pixel barrel layer
@ numberOfContribPixelBarrelInclinedLayers
number of contributing barrel inclined layers of the pixel detector [unit8_t].
@ numberOfPixelEndcapHits
these are the pixel hits, in the endcap layers [unit8_t].
@ numberOfInnermostPixelLayerOutliers
number of 0th layer barrel outliers
@ numberOfOutliersOnTrack
number of measurements flaged as outliers in TSOS [unit8_t].
@ numberOfNextToInnermostPixelLayerEndcapHits
these are the hits in the 0.5th and 1st pixel layer endcap rings [unit8_t].
@ expectNextToInnermostPixelLayerHit
Do we expect a 1st-layer barrel hit for this track?
@ numberOfContribPixelEndcap
number of contributing endcap layers of the pixel detector [unit8_t].
@ numberOfNextToInnermostPixelLayerEndcapOutliers
number of 1st layer endcap disk outliers
@ numberOfSCTHits
number of hits in SCT [unit8_t].
@ numberOfPixelBarrelInclinedHits
these are the pixel hits, in the barrel inclined layers [unit8_t].
@ numberOfSCTOutliers
number of SCT outliers [unit8_t].
@ numberOfPixelBarrelFlatHits
these are the pixel hits, in the barrel flat layers [unit8_t].
@ numberOfInnermostPixelLayerHits
these are the hits in the 0th pixel barrel layer
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].
@ numberOfPixelSharedHits
number of Pixel all-layer hits shared by several tracks [unit8_t].
@ numberOfSCTSharedHits
number of SCT hits shared by several tracks [unit8_t].
@ numberOfNextToInnermostPixelLayerOutliers
number of 1st pixel layer barrel outliers
@ numberOfSCTHoles
number of SCT holes [unit8_t].
@ SiSPSeededFinder
Tracks from SiSPSeedFinder.
static std::array< unsigned int, 4 > get(const track_proxy_t &track)
static bool exists(track_container_t &trackContainer)

◆ 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

◆ initialize()

StatusCode ActsTrk::TrackToTrackParticleCnvAlg::initialize ( )
overridevirtual

Definition at line 130 of file TrackToTrackParticleCnvAlg.cxx.

131 {
132 std::vector<std::string> supportedStrategies {"BeamLine", "Vertex"};
133 bool isAllowedStrategy = false;
134 for (const std::string& strategy : supportedStrategies) {
135 if (m_perigeeExpression != strategy) continue;
136 isAllowedStrategy = true;
137 break;
138 }
139 ATH_MSG_DEBUG("- perigeeExpression: " << m_perigeeExpression.value());
140 if (not isAllowedStrategy) {
141 ATH_MSG_ERROR("Wrong configuration of the Track to Track Particle Cnv algorithm: perigeeExpression is not supported");
142 return StatusCode::FAILURE;
143 }
144
148 else return StatusCode::FAILURE;
149
151 ATH_CHECK( m_tracksContainerKey.initialize() );
152 ATH_CHECK( m_trackParticlesOutKey.initialize() );
156
158 ATH_CHECK(m_decorator_actsTracks.initialize());
159
160 ATH_CHECK( m_extrapolationTool.retrieve() ); // for extrapolation to beamline
161
162 // propagator for conversion to curvilnear parameters
163 {
164 auto logger = makeActsAthenaLogger(this, "Prop");
165
166 Navigator::Config cfg{m_trackingGeometryTool->trackingGeometry()};
167 cfg.resolvePassive = false;
168 cfg.resolveMaterial = true;
169 cfg.resolveSensitive = true;
170 auto navigtor_logger = logger->cloneWithSuffix("Navigator");
171 m_propagator = std::make_unique<Propagator>(Stepper(std::make_shared<ATLASMagneticFieldWrapper>()),
172 Navigator(cfg,std::move(navigtor_logger)),
173 std::move(logger));
174 }
175
176 // for layer/module-type information per hit
177 ATH_CHECK( m_siDetEleCollKey.initialize() );
179 unsigned int collection_idx=0;
180 for (int type : m_siDetEleCollToMeasurementType ) {
181 if (type <1 || type >2) {
182 ATH_MSG_ERROR("Invalid measurement type (" << type << ") given for collection " << collection_idx << " : "
183 << m_siDetEleCollKey[collection_idx].key()
184 << ". Expected 1 for pixel, 2 for strips.");
185 return StatusCode::FAILURE;
186 }
187 ++collection_idx;
188 }
189 }
190 else {
191 ATH_MSG_ERROR("Expected exactly one value in SiDetEleCollToMeasurementType per SiDetectorElementCollection. But got "
192 << m_siDetEleCollToMeasurementType.size() << " instead of " << m_siDetEleCollKey.size() << ".");
193 return StatusCode::FAILURE;
194 }
195
197
198 return StatusCode::SUCCESS;
199 }
std::unique_ptr< const Acts::Logger > makeActsAthenaLogger(IMessageSvc *svc, const std::string &name, int level, std::optional< std::string > parent_name)
Gaudi::Property< std::string > m_perigeeExpression
static Root::TMsgLogger logger("iLumiCalc")

◆ initParticleHypothesisMap()

void ActsTrk::TrackToTrackParticleCnvAlg::initParticleHypothesisMap ( )
staticprivate

Definition at line 110 of file TrackToTrackParticleCnvAlg.cxx.

110 {
111 if (s_actsHypothesisToxAOD.empty()) {
112 s_actsHypothesisToxAOD.reserve(7);
113 s_actsHypothesisToxAOD.push_back( std::make_pair( Acts::eElectron , xAOD::electron) );
114 s_actsHypothesisToxAOD.push_back( std::make_pair( Acts::eMuon , xAOD::muon) );
115 s_actsHypothesisToxAOD.push_back( std::make_pair( Acts::ePionPlus , xAOD::pion) );
116 s_actsHypothesisToxAOD.push_back( std::make_pair( Acts::eProton , xAOD::proton) );
117 s_actsHypothesisToxAOD.push_back( std::make_pair( Acts::ePionZero , xAOD::pi0) );
118 s_actsHypothesisToxAOD.push_back( std::make_pair( Acts::eNeutron , xAOD::neutron) );
119 s_actsHypothesisToxAOD.push_back( std::make_pair( Acts::eGamma , xAOD::photon) );
120 }
121 }
@ pi0
for Fatras usage
@ neutron
for Fatras usage

◆ 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()

◆ makePerigeeSurface() [1/2]

std::shared_ptr< Acts::PerigeeSurface > ActsTrk::TrackToTrackParticleCnvAlg::makePerigeeSurface ( const InDet::BeamSpotData * beamspotptr)
staticprivate

Definition at line 602 of file TrackToTrackParticleCnvAlg.cxx.

602 {
603 // @from TrackToVertex::trackAtBeamline
604 Acts::Vector3 beamspot(0., 0., 0.);
605 float tiltx = 0.0;
606 float tilty = 0.0;
607 if (beamspot_data) {
608 beamspot = Acts::Vector3(beamspot_data->beamVtx().position());
609 tiltx = beamspot_data->beamTilt(0);
610 tilty = beamspot_data->beamTilt(1);
611 }
612 Acts::Translation3 translation(beamspot);
613 Acts::Transform3 transform( translation * Acts::RotationMatrix3::Identity() );
614 transform *= Acts::AngleAxis3(tilty, Acts::Vector3(0.,1.,0.));
615 transform *= Acts::AngleAxis3(tiltx, Acts::Vector3(1.,0.,0.));
616 return Acts::Surface::makeShared<Acts::PerigeeSurface>(transform);
617 }
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.

◆ makePerigeeSurface() [2/2]

std::shared_ptr< Acts::PerigeeSurface > ActsTrk::TrackToTrackParticleCnvAlg::makePerigeeSurface ( const xAOD::Vertex & vertex)
staticprivate

Definition at line 619 of file TrackToTrackParticleCnvAlg.cxx.

619 {
620 Acts::Translation3 translation(Acts::Vector3(vertex.position()));
621 Acts::Transform3 transform( translation * Acts::RotationMatrix3::Identity() );
622 return Acts::Surface::makeShared<Acts::PerigeeSurface>(transform);
623 }

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

◆ parametersAtPerigee()

Acts::BoundTrackParameters ActsTrk::TrackToTrackParticleCnvAlg::parametersAtPerigee ( const EventContext & ctx,
const typename ActsTrk::TrackContainer::ConstTrackProxy & track,
const Acts::PerigeeSurface & perigee_surface ) const
private

Definition at line 625 of file TrackToTrackParticleCnvAlg.cxx.

627 {
628 const Acts::BoundTrackParameters trackParam = track.createParametersAtReference();
629
630 std::optional<const Acts::BoundTrackParameters>
631 perigeeParam = m_extrapolationTool->propagate(ctx,
632 trackParam,
633 perigee_surface,
634 Acts::Direction::Backward(), // @TODO try forward if backward fails ?
636 if (!perigeeParam.has_value()) {
637 ATH_MSG_WARNING( "Failed to extrapolate to perigee, started from \n" << trackParam << " " << trackParam.referenceSurface().name() );
638
639 return trackParam;
640 }
641 else {
642 ATH_MSG_DEBUG( "Succeeded to extrapolate to perigee ");
643 return perigeeParam.value();
644 }
645 }
Gaudi::Property< double > m_paramExtrapolationParLimit

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

◆ ATLAS_THREAD_SAFE

std::vector<std::pair<Acts::PdgParticle, xAOD::ParticleHypothesis> > s_actsHypothesisToxAOD ActsTrk::TrackToTrackParticleCnvAlg::ATLAS_THREAD_SAFE
staticprivate

Definition at line 118 of file TrackToTrackParticleCnvAlg.h.

◆ m_beamSpotKey

SG::ReadCondHandleKey<InDet::BeamSpotData> ActsTrk::TrackToTrackParticleCnvAlg::m_beamSpotKey {this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot or empty." }
private

Definition at line 80 of file TrackToTrackParticleCnvAlg.h.

81{this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot or empty." };

◆ m_computeExpectedLayerPattern

Gaudi::Property<bool> ActsTrk::TrackToTrackParticleCnvAlg::m_computeExpectedLayerPattern {this, "ComputeExpectedLayerPattern",true, "Compute the expected layer pattern. CPU expensive" }
private

Definition at line 102 of file TrackToTrackParticleCnvAlg.h.

103{this, "ComputeExpectedLayerPattern",true, "Compute the expected layer pattern. CPU expensive" };

◆ m_decorator_actsTracks

SG::WriteDecorHandleKey<xAOD::TrackParticleContainer> ActsTrk::TrackToTrackParticleCnvAlg::m_decorator_actsTracks {this, "ActsTrackLink", "actsTrack"}
private

Definition at line 95 of file TrackToTrackParticleCnvAlg.h.

96{this, "ActsTrackLink", "actsTrack"};

◆ 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_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_expectIfPixelContributes

Gaudi::Property<bool> ActsTrk::TrackToTrackParticleCnvAlg::m_expectIfPixelContributes {this, "expectIfPixelContribution",true, "Only expect pixel hits if there are pixel hits on track." }
private

Definition at line 104 of file TrackToTrackParticleCnvAlg.h.

105{this, "expectIfPixelContribution",true, "Only expect pixel hits if there are pixel hits on track." };

◆ m_expression_strategy

expressionStrategy ActsTrk::TrackToTrackParticleCnvAlg::m_expression_strategy {expressionStrategy::BeamLine}
private

◆ 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> ActsTrk::TrackToTrackParticleCnvAlg::m_extrapolationTool {this, "ExtrapolationTool", ""}
private

Definition at line 72 of file TrackToTrackParticleCnvAlg.h.

73{this, "ExtrapolationTool", ""};

◆ m_fieldCacheCondObjInputKey

SG::ReadCondHandleKey<AtlasFieldCacheCondObj> ActsTrk::TrackToTrackParticleCnvAlg::m_fieldCacheCondObjInputKey {this,"AtlasFieldCacheCondObj","fieldCondObj", "Name of the Magnetic Field conditions object key" }
private

Definition at line 82 of file TrackToTrackParticleCnvAlg.h.

83{this,"AtlasFieldCacheCondObj","fieldCondObj", "Name of the Magnetic Field conditions object key" };

◆ m_firstAndLastParamOnly

Gaudi::Property<bool> ActsTrk::TrackToTrackParticleCnvAlg::m_firstAndLastParamOnly {this, "FirstAndLastParameterOnly",true, "Only convert the first and the last parameter." }
private

Definition at line 100 of file TrackToTrackParticleCnvAlg.h.

101{this, "FirstAndLastParameterOnly",true, "Only convert the first and the last parameter." };

◆ m_paramExtrapolationParLimit

Gaudi::Property<double> ActsTrk::TrackToTrackParticleCnvAlg::m_paramExtrapolationParLimit {this, "ExtrapolationPathLimit",std::numeric_limits<double>::max(), "PathLimit for extrapolating track parameters." }
private

Definition at line 98 of file TrackToTrackParticleCnvAlg.h.

99{this, "ExtrapolationPathLimit",std::numeric_limits<double>::max(), "PathLimit for extrapolating track parameters." }; // @TODO (unit?mm?)

◆ m_perigeeExpression

Gaudi::Property<std::string> ActsTrk::TrackToTrackParticleCnvAlg::m_perigeeExpression {this, "PerigeeExpression", "DontRecalculate"}
private

Definition at line 111 of file TrackToTrackParticleCnvAlg.h.

111{this, "PerigeeExpression", "DontRecalculate"};

◆ m_pixelExpectLayerPathLimitInMM

Gaudi::Property<double> ActsTrk::TrackToTrackParticleCnvAlg::m_pixelExpectLayerPathLimitInMM
private
Initial value:
{this, "PixelExpectLayerPathLimitInMM",1000,
"PathLimit for extrapolating to get the expected pixel layer pattern in mm." }

Definition at line 107 of file TrackToTrackParticleCnvAlg.h.

108 {this, "PixelExpectLayerPathLimitInMM",1000,
109 "PathLimit for extrapolating to get the expected pixel layer pattern in mm." };

◆ m_propagator

std::unique_ptr<Propagator> ActsTrk::TrackToTrackParticleCnvAlg::m_propagator
private

Definition at line 116 of file TrackToTrackParticleCnvAlg.h.

◆ m_siDetEleCollKey

SG::ReadCondHandleKeyArray<InDetDD::SiDetectorElementCollection> ActsTrk::TrackToTrackParticleCnvAlg::m_siDetEleCollKey {this, "SiDetectorElementCollections", {}, "Pixel and strip element collections to get geometry information about measurements."}
private

Definition at line 85 of file TrackToTrackParticleCnvAlg.h.

86{this, "SiDetectorElementCollections", {}, "Pixel and strip element collections to get geometry information about measurements."};

◆ m_siDetEleCollToMeasurementType

Gaudi::Property<std::vector<unsigned int> > ActsTrk::TrackToTrackParticleCnvAlg::m_siDetEleCollToMeasurementType {this, "SiDetEleCollToMeasurementType",{}, "One value per si detector collection: Pixel = 1, Strip = 2"}
private

Definition at line 87 of file TrackToTrackParticleCnvAlg.h.

88{this, "SiDetEleCollToMeasurementType",{}, "One value per si detector collection: Pixel = 1, Strip = 2"};

◆ m_trackingGeometryTool

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

Definition at line 75 of file TrackToTrackParticleCnvAlg.h.

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

◆ m_trackParticlesOutKey

SG::WriteHandleKey<xAOD::TrackParticleContainer> ActsTrk::TrackToTrackParticleCnvAlg::m_trackParticlesOutKey {this, "TrackParticlesOutKey","", "Name of the produced track particle collection" }
private

Definition at line 92 of file TrackToTrackParticleCnvAlg.h.

93{this, "TrackParticlesOutKey","", "Name of the produced track particle collection" };

◆ m_tracksContainerKey

SG::ReadHandleKeyArray<ActsTrk::TrackContainer> ActsTrk::TrackToTrackParticleCnvAlg::m_tracksContainerKey {this, "ACTSTracksLocation", {},"Track collection (ActsTrk variant)"}
private

Definition at line 78 of file TrackToTrackParticleCnvAlg.h.

79{this, "ACTSTracksLocation", {},"Track collection (ActsTrk variant)"};

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vertexHandle

SG::ReadHandleKey<xAOD::VertexContainer> ActsTrk::TrackToTrackParticleCnvAlg::m_vertexHandle {this, "VertexContainerKey", "", "Name of the Primary Vertex Container"}
private

Definition at line 90 of file TrackToTrackParticleCnvAlg.h.

91{this, "VertexContainerKey", "", "Name of the Primary Vertex Container"};

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