ATLAS Offline Software
Loading...
Searching...
No Matches
TritonTracccTrackMaker Class Reference

TritonTracccTrackMaker is an algorithm that uses the Traccc-algorithm to reconstruct tracks from cells. More...

#include <TritonTracccTrackMaker.h>

Inheritance diagram for TritonTracccTrackMaker:

Public Member Functions

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

StatusCode serializeCells (const traccc::edm::silicon_cell_collection::const_device &cells, std::vector< uint8_t > &out) const
std::unordered_map< int64_t, int > readAndConvertClusters (const EventContext &eventContext) const
StatusCode convertInDetToXaodCluster (const InDet::PixelCluster &indetCluster, const InDetDD::SiDetectorElement &element, xAOD::PixelCluster &xaodCluster) const
StatusCode convertInDetToXaodCluster (const InDet::SCT_Cluster &indetCluster, const InDetDD::SiDetectorElement &element, xAOD::StripCluster &xaodCluster) const
const Acts::Surface * actsSurfaceFromAtlasId (const Identifier &atlasID) const
Acts::BoundMatrix buildBoundCovariance (const LocalMeasurementInfoInTracks &state) const
std::optional< Acts::BoundTrackParameters > convertToActsParameters (const LocalMeasurementInfoInTracks &state) const
StatusCode convertTracks (EventContext const &eventContext, std::vector< TracccTrackParameters > &trackParams, std::vector< LocalMeasurementInfoInTracks > &measInfo, const std::unordered_map< int64_t, int > &cluster_map, unsigned &nb_output_tracks) const
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.

Protected Attributes

SG::ReadHandleKey< traccc::edm::silicon_cell_collection::const_view > m_tracccCellsKey
const PixelIDm_pixelID {nullptr}
const SCT_IDm_stripID {nullptr}
SG::WriteHandleKey< ActsTrk::TrackContainerm_ActsTracccTrackContainerKey
ActsTrk::MutableTrackContainerHandlesHelper m_tracksBackendHandlesHelper
Trk::PdgToParticleHypothesis m_pdgToParticleHypothesis
std::shared_ptr< const Acts::TrackingGeometry > m_trackingGeometry
const ActsTrk::DetectorElementToActsGeometryIdMapm_detEleToGeoIdMap {nullptr}
ToolHandle< ITracccTritonToolm_tracccTrackingTool
ServiceHandle< ActsTrk::ITrackingGeometrySvcm_trackingGeometrySvc
ActsTrk::ContextUtility m_ctxProvider {this}
 Utility to fetch the geometry, magnetic field and calibration context in the event.
StringProperty m_featureNames
std::vector< std::string > m_featureNamesVec
Gaudi::Property< bool > m_doTruth
 Truth association for plotting and debugging.
SG::ReadHandleKey< ActsTrk::MeasurementToTruthParticleAssociationm_pixelClustersToTruth
SG::ReadHandleKey< ActsTrk::MeasurementToTruthParticleAssociationm_stripClustersToTruth
SG::ReadHandleKey< InDet::PixelClusterContainer > m_inputPixelClusterContainerKey
SG::ReadHandleKey< InDet::SCT_ClusterContainer > m_inputStripClusterContainerKey
SG::WriteHandleKey< xAOD::PixelClusterContainerm_xAODPixelClusterFromInDetClusterKey
SG::WriteHandleKey< xAOD::StripClusterContainerm_xAODStripClusterFromInDetClusterKey
SG::WriteHandleKey< xAOD::SpacePointContainerm_xAODSpacepointFromInDetClusterKey
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollectionm_pixelDetEleCollKey
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollectionm_stripDetEleCollKey

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

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

TritonTracccTrackMaker is an algorithm that uses the Traccc-algorithm to reconstruct tracks from cells.

Cells are sent to a Traccc backend using Triton and tracks are sent back.

Author
miles.nosp@m..cb@.nosp@m.cern..nosp@m.ch

Definition at line 67 of file TritonTracccTrackMaker.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Member Function Documentation

◆ actsSurfaceFromAtlasId()

const Acts::Surface * TritonTracccTrackMaker::actsSurfaceFromAtlasId ( const Identifier & atlasID) const
protected

Definition at line 422 of file TritonTracccTrackMaker.cxx.

424{
425 const bool isPixel = m_pixelID->is_pixel(atlasID);
426 const IdentifierHash hash = isPixel ? m_pixelID->wafer_hash(atlasID)
427 : m_stripID->wafer_hash(atlasID);
428 const auto measType = isPixel ? xAOD::UncalibMeasType::PixelClusterType
430
431 const auto geoKey = ActsTrk::makeDetectorElementKey(
432 measType, static_cast<unsigned int>(hash));
433 const auto it = m_detEleToGeoIdMap->find(geoKey);
434 if (it != m_detEleToGeoIdMap->end()) {
435 const Acts::Surface* surface = m_trackingGeometry->findSurface(
437 if (surface) {
438 return surface;
439 }
440 }
441 ATH_MSG_DEBUG("No Acts surface corresponding to this ATLAS id: " << atlasID);
442 return nullptr;
443}
#define ATH_MSG_DEBUG(x,...)
std::shared_ptr< const Acts::TrackingGeometry > m_trackingGeometry
const ActsTrk::DetectorElementToActsGeometryIdMap * m_detEleToGeoIdMap
DetectorElementKey makeDetectorElementKey(xAOD::UncalibMeasType meas_type, unsigned int identifier_hash)
static const Acts::GeometryIdentifier & getValue(const value_type &element)

◆ buildBoundCovariance()

Acts::BoundMatrix TritonTracccTrackMaker::buildBoundCovariance ( const LocalMeasurementInfoInTracks & state) const
protected

Definition at line 445 of file TritonTracccTrackMaker.cxx.

447{
448 // traccc's model output is in Acts-native units
449 Acts::BoundMatrix cov = Acts::BoundMatrix::Zero();
450 for (unsigned int i = 0; i < 5; i++) {
451 for (unsigned int j = 0; j < 5; j++) {
452 size_t index = i * 5 + j;
453 cov(i, j) = state.covariances[index];
454 }
455 }
456
457 // traccc does not fit the time parameter (yet). Give it a
458 // large placeholder uncertainty instead of leaving it at zero.
459 constexpr double kUnconstrainedTimeVariance = 1e6;
460 cov(Acts::eBoundTime, Acts::eBoundTime) = kUnconstrainedTimeVariance;
461
462 return cov;
463}
str index
Definition DeMoScan.py:362
float j(const xAOD::IParticle &, const xAOD::TrackMeasurementValidation &hit, const Eigen::Matrix3d &jab_inv)
std::vector< float > covariances

◆ convertInDetToXaodCluster() [1/2]

StatusCode TritonTracccTrackMaker::convertInDetToXaodCluster ( const InDet::PixelCluster & indetCluster,
const InDetDD::SiDetectorElement & element,
xAOD::PixelCluster & xaodCluster ) const
protected

Definition at line 336 of file TritonTracccTrackMaker.cxx.

339{
340 IdentifierHash idHash = element.identifyHash();
341
342 auto localPos = indetCluster.localPosition();
343 auto localCov = indetCluster.localCovariance();
344
345 xAOD::MeasVector<2> localPosition = xAOD::toStorage(localPos);
346
347 xAOD::MeasMatrix<2> localCovariance;
348 localCovariance.setZero();
349 localCovariance(0, 0) = localCov(0, 0);
350 localCovariance(1, 1) = localCov(1, 1);
351
352 auto globalPos = indetCluster.globalPosition();
353 Eigen::Matrix<float, 3, 1> globalPosition(globalPos.x(), globalPos.y(),
354 globalPos.z());
355
356 const auto& RDOs = indetCluster.rdoList();
357 const auto& ToTs = indetCluster.totList();
358 const auto& charges = indetCluster.chargeList();
359 const auto& width = indetCluster.width();
360 //coverity[UNINIT]
361 xaodCluster.setMeasurement<2>(idHash, localPosition, localCovariance);
362 xaodCluster.setIdentifier(indetCluster.identify().get_compact());
363 xaodCluster.setRDOlist(RDOs);
364 xaodCluster.globalPosition() = globalPosition;
365 xaodCluster.setToTlist(ToTs);
366 xaodCluster.setChargelist(charges);
367 xaodCluster.setLVL1A(indetCluster.LVL1A());
368 xaodCluster.setChannelsInPhiEta(width.colRow()[0], width.colRow()[1]);
369 xaodCluster.setWidthInEta(static_cast<float>(width.widthPhiRZ()[1]));
370
371 return StatusCode::SUCCESS;
372}
const double width
value_type get_compact() const
Get the compact id.
virtual IdentifierHash identifyHash() const override final
identifier hash (inline)
const Amg::Vector3D & globalPosition() const
return global position reference
const InDet::SiWidth & width() const
return width class reference
const Amg::Vector2D & localPosition() const
return the local position reference
Identifier identify() const
return the identifier
const Amg::MatrixX & localCovariance() const
return const ref to the error matrix
const std::vector< Identifier > & rdoList() const
return the List of rdo identifiers (pointers)
void setChannelsInPhiEta(int channelsInPhi, int channelsInEta)
Sets the dimensions of the cluster in numbers of channels in phi (x) and eta (y) directions.
ConstVectorMap< 3 > globalPosition() const
Returns the global position of the pixel cluster.
void setChargelist(const std::vector< float > &charges)
Sets the list of charges of the channels building the cluster.
void setToTlist(const std::vector< int > &tots)
Sets the list of ToT of the channels building the cluster.
void setLVL1A(int lvl1a)
Sets the LVL1 accept.
void setRDOlist(const std::vector< Identifier > &rdolist)
Sets the list of identifiers of the channels building the cluster.
void setWidthInEta(float widthInEta)
Sets the width of the cluster in eta (y) direction.
void setMeasurement(const DetectorIDHashType idHash, MeasVector< N > locPos, MeasMatrix< N > locCov)
Sets IdentifierHash, local position and local covariance of the measurement.
void setIdentifier(const DetectorIdentType measId)
Sets the full Identifier of the measurement.
Eigen::Matrix< float, N, N > MeasMatrix
Eigen::Matrix< float, N, 1 > MeasVector
Abrivation of the Matrix & Covariance definitions.
MeasVector< N > toStorage(const AmgVector(N)&amgVec)
Converts the double precision of the AmgVector into the floating point storage precision of the MeasV...

◆ convertInDetToXaodCluster() [2/2]

StatusCode TritonTracccTrackMaker::convertInDetToXaodCluster ( const InDet::SCT_Cluster & indetCluster,
const InDetDD::SiDetectorElement & element,
xAOD::StripCluster & xaodCluster ) const
protected

Definition at line 374 of file TritonTracccTrackMaker.cxx.

377{
378 constexpr double one_over_twelve = 1. / 12.;
379 IdentifierHash idHash = element.identifyHash();
380
381 auto localPos = indetCluster.localPosition();
382
383 xAOD::MeasVector<1> localPosition;
384 xAOD::MeasMatrix<1> localCovariance;
385 localCovariance.setZero();
386
387 if (element.isBarrel()) {
388 localPosition(0, 0) = localPos.x();
389 localCovariance(0, 0) =
390 element.phiPitch() * element.phiPitch() * one_over_twelve;
391 } else {
392 InDetDD::SiCellId cellId = element.cellIdOfPosition(localPos);
393 const InDetDD::StripStereoAnnulusDesign* design =
394 dynamic_cast<const InDetDD::StripStereoAnnulusDesign*>(
395 &element.design());
396 if (design == nullptr) {
397 return StatusCode::FAILURE;
398 }
399 InDetDD::SiLocalPosition localInPolar =
400 design->localPositionOfCellPC(cellId);
401 localPosition(0, 0) = localInPolar.xPhi();
402 localCovariance(0, 0) =
403 design->phiPitchPhi() * design->phiPitchPhi() * one_over_twelve;
404 }
405
406 auto globalPos = indetCluster.globalPosition();
407 Eigen::Matrix<float, 3, 1> globalPosition(globalPos.x(), globalPos.y(),
408 globalPos.z());
409
410 const auto& RDOs = indetCluster.rdoList();
411 const auto& width = indetCluster.width();
412 //coverity[UNINIT]
413 xaodCluster.setMeasurement<1>(idHash, localPosition, localCovariance);
414 xaodCluster.setIdentifier(indetCluster.identify().get_compact());
415 xaodCluster.setRDOlist(RDOs);
416 xaodCluster.globalPosition() = globalPosition;
417 xaodCluster.setChannelsInPhi(width.colRow()[0]);
418
419 return StatusCode::SUCCESS;
420}
static constexpr double one_over_twelve
virtual const SiDetectorDesign & design() const override final
access to the local description (inline):
double phiPitch() const
Pitch (inline methods).
double xPhi() const
position along phi direction:
SiCellId cellIdOfPosition(const Amg::Vector2D &localPos) const
As in previous method but returns SiCellId.
double phiPitchPhi(const SiLocalPosition &localPosition) const
SiLocalPosition localPositionOfCellPC(const SiCellId &cellId) const
This is for debugging only.
ConstVectorMap< 3 > globalPosition() const
Returns the global position of the strip cluster.
void setRDOlist(const std::vector< Identifier > &rdolist)
Sets the list of identifiers of the channels building the cluster.
void setChannelsInPhi(int channelsInPhi)
Sets the dimensions of the cluster in numbers of channels in phi (x).

◆ convertToActsParameters()

std::optional< Acts::BoundTrackParameters > TritonTracccTrackMaker::convertToActsParameters ( const LocalMeasurementInfoInTracks & state) const
protected

Definition at line 466 of file TritonTracccTrackMaker.cxx.

468{
469 using namespace Acts::UnitLiterals;
470 std::shared_ptr<const Acts::Surface> actsSurface;
471 Acts::BoundVector params{};
472
473 Identifier const atlas_ID(static_cast<Identifier::value_type>(state.athena_id[0]));
474
475 // get the associated surface
476 const Acts::Surface* surface = actsSurfaceFromAtlasId(atlas_ID);
477 if (!surface) {
478 return std::nullopt;
479 }
480 actsSurface = surface->getSharedPtr();
481
482 // Construct track parameters
483 ATH_MSG_VERBOSE("Constructing track parameters for this state");
484 params << state.local_x[0], state.local_y[0],
485 state.phi[0], state.theta[0], state.qop[0], state.time[0];
486
487 Acts::BoundMatrix const cov = buildBoundCovariance(state);
488
489 Acts::ParticleHypothesis hypothesis{Acts::ParticleHypothesis::pion()};
490
491 return Acts::BoundTrackParameters(actsSurface, params, cov, hypothesis);
492}
#define ATH_MSG_VERBOSE(x,...)
const Acts::Surface * actsSurfaceFromAtlasId(const Identifier &atlasID) const
Acts::BoundMatrix buildBoundCovariance(const LocalMeasurementInfoInTracks &state) const
std::vector< int64_t > athena_id

◆ convertTracks()

StatusCode TritonTracccTrackMaker::convertTracks ( EventContext const & eventContext,
std::vector< TracccTrackParameters > & trackParams,
std::vector< LocalMeasurementInfoInTracks > & measInfo,
const std::unordered_map< int64_t, int > & cluster_map,
unsigned & nb_output_tracks ) const
protected

Definition at line 494 of file TritonTracccTrackMaker.cxx.

500{
501 nb_output_tracks = 0;
502
503 Acts::VectorTrackContainer track_backend;
504 Acts::VectorMultiTrajectory track_state_backend;
505 ActsTrk::MutableTrackContainer track_container(
506 std::move(track_backend), std::move(track_state_backend));
507
508 SG::WriteHandle<ActsTrk::TrackContainer> trackContainerHandle(
509 m_ActsTracccTrackContainerKey, eventContext);
510
511 Acts::GeometryContext tgContext = m_ctxProvider.getGeometryContext(eventContext);
512
513 if (m_doTruth) {
514 ATH_MSG_DEBUG("Will map truth");
515 ATH_MSG_DEBUG("retrieving cluster container keys: "
518 }
519
520 // Debug stats
521 float chi2_min = std::numeric_limits<float>::max();
522 float chi2_max = std::numeric_limits<float>::min();
523
524 float ndf_min = std::numeric_limits<float>::max();
525 float ndf_max = std::numeric_limits<float>::min();
526
527 unsigned meas_min = std::numeric_limits<unsigned>::max();
528 unsigned meas_max = std::numeric_limits<unsigned>::min();
529
530 int excluded_ndf = 0;
531 int excluded_no_sp = 0;
532 int excluded_weird_state = 0;
533
534 for (std::size_t i = 0; i < trackParams.size(); i++) {
535 auto fit_res = trackParams.at(i);
536 auto& states = measInfo.at(i);
537 if (states.local_x.size() < 1) {
538 excluded_no_sp += 1;
539 continue;
540 }
541
542 // In Acts ndf, aka nDoF, is unsigned int. This makes sure the number is
543 // safe to cast; exclude the track otherwise.
544 if (fit_res.ndf >
545 static_cast<float>(std::numeric_limits<unsigned int>::max()) ||
546 fit_res.ndf <
547 static_cast<float>(std::numeric_limits<unsigned int>::min())) {
548 excluded_ndf += 1;
549 continue;
550 }
551
552 // Create the MutableTrack and add the parameters
553 auto actsTrack = track_container.makeTrack();
554 enum TrackValidity { VALID, INVALID_STATE, INVALID_GLOBAL };
555 TrackValidity track_validity = VALID;
556
557
558 actsTrack.chi2() = fit_res.chi2;
559 actsTrack.nDoF() = fit_res.ndf;
560
561 Acts::TrackStatePropMask const mask =
562 Acts::TrackStatePropMask::Smoothed;
563
564 bool first_state = true;
565 for (size_t j = 0; j < states.local_x.size(); ++j) {
566 auto actsTSOS = actsTrack.appendTrackState(mask);
567
568 // Build a measurement struct for this state
569 LocalMeasurementInfoInTracks singleState;
570 singleState.local_x = {states.local_x[j]};
571 singleState.local_y = {states.local_y[j]};
572 singleState.phi = {states.phi[j]};
573 singleState.theta = {states.theta[j]};
574 singleState.qop = {states.qop[j]};
575 singleState.time = {states.time[j]};
576 singleState.covariances = {};
577 for (size_t k = 0; k < 25; ++k) {
578 singleState.covariances.push_back(states.covariances[j * 25 + k]);
579 }
580 singleState.athena_id = {states.athena_id[j]};
581
582 std::optional<Acts::BoundTrackParameters> params_opt =
583 convertToActsParameters(singleState);
584 if (!params_opt.has_value()) {
585 // if the measurement was "buggy", the whole track is dismissed.
587 "convertToActsParameters failed: track state is weird");
588 track_validity = INVALID_STATE;
589 break;
590
591 }
592
593 Acts::BoundTrackParameters const& parameters = params_opt.value();
594 ATH_MSG_DEBUG("Track parameters: " << parameters.parameters());
595
596 if (m_doTruth) {
597 SG::ReadHandle<xAOD::PixelClusterContainer> pixelClustersHandle(
598 m_xAODPixelClusterFromInDetClusterKey.key(), eventContext);
599 ATH_CHECK(pixelClustersHandle.isValid());
600 const xAOD::PixelClusterContainer* inputPixelClusters =
601 pixelClustersHandle.cptr();
602
603 SG::ReadHandle<xAOD::StripClusterContainer> stripClustersHandle(
604 m_xAODStripClusterFromInDetClusterKey.key(), eventContext);
605 ATH_CHECK(stripClustersHandle.isValid());
606 const xAOD::StripClusterContainer* inputStripClusters =
607 stripClustersHandle.cptr();
608
609 // match measurement to the cluster container
610 int cl_index = -1;
611 if (auto it = cluster_map.find(states.athena_id[j]);
612 it != cluster_map.end()) {
613 cl_index = it->second;
614 } else {
615 return StatusCode::FAILURE;
616 }
617
618 // Determine detector type from athena_id
619 Identifier id(static_cast<Identifier::value_type>(states.athena_id[j]));
620 bool isPixel = m_pixelID->is_pixel(id);
621
622 const xAOD::UncalibratedMeasurement* umeas = nullptr;
623 if (isPixel) {
624 umeas = inputPixelClusters->at(cl_index);
625 } else {
626 umeas = inputStripClusters->at(cl_index);
627 }
628
629 actsTSOS.setUncalibratedSourceLink(
631 }
632
633 // This is the conversion of global track parameters
634 // Because Traccc does not do backpropagation yet,
635 // we do not have the reference surface ie the perigee.
636 // So for now we will set the global track params with
637 // the reference surface being the surface of first measurement
638 // and enable back propagation during ACTS->xAOD conversion
639 // this will find the pergee and re-set the global trk params.
640 if (first_state) {
641 // This is the first track state, so we need to set the track
642 // global parameters
643
644 std::optional<Acts::BoundTrackParameters> params_gl =
645 convertToActsParameters(singleState);
646
647 if (!params_gl.has_value()) {
648 // if the params are "buggy", the whole track is dismissed.
650 "convertToActsParameters failed: track state is weird");
651 track_validity = INVALID_GLOBAL;
652 break;
653 }
654
655 Acts::BoundTrackParameters const& parameters_gl =
656 params_gl.value();
657
658 ATH_MSG_VERBOSE("First state of track.");
659 actsTrack.parameters() = parameters_gl.parameters();
660 actsTrack.covariance() = *parameters_gl.covariance();
661 actsTrack.setReferenceSurface(
662 parameters_gl.referenceSurface().getSharedPtr());
663 first_state = false;
664
665 }
666
667 actsTSOS.setReferenceSurface(
668 parameters.referenceSurface().getSharedPtr());
669 actsTSOS.smoothed() = parameters.parameters();
670 actsTSOS.smoothedCovariance() = *parameters.covariance();
671 // Mark this state as a measurement for temporary efficiency matching
672 actsTSOS.typeFlags().setIsMeasurement();
673 if (!(actsTSOS.hasSmoothed() &&
674 actsTSOS.hasReferenceSurface())) {
676 "TrackState does not have smoothed state ["
677 << actsTSOS.hasSmoothed()
678 << "] or reference surface ["
679 << actsTSOS.hasReferenceSurface() << "].");
680 } else {
682 "TrackState has smoothed state and reference "
683 "surface.");
684 }
685 }
686
687 // ATH_MSG_INFO("Done with states of this track.");
688 if (track_validity == INVALID_STATE) {
689 ATH_MSG_INFO("excluding track " << i << " for weird state");
690 excluded_weird_state += 1;
691 track_container.removeTrack(actsTrack.index());
692 } else if (track_validity == INVALID_GLOBAL) {
693 ATH_MSG_INFO("excluding track " << i
694 << " for weird global params");
695 track_container.removeTrack(actsTrack.index());
696 }
697
698
699 // Debug stats
700 chi2_min = std::min(fit_res.chi2, chi2_min);
701 chi2_max = std::max(fit_res.chi2, chi2_max);
702 ndf_min = std::min(fit_res.ndf, ndf_min);
703 ndf_max = std::max(fit_res.ndf, ndf_max);
704 meas_min = std::min<unsigned>(states.local_x.size(), meas_min);
705 meas_max = std::max<unsigned>(states.local_x.size(), meas_max);
706 }
707
708 nb_output_tracks = track_container.size();
709 ATH_MSG_DEBUG("Wrote out "<< nb_output_tracks << " tracks from " << trackParams.size() << " candidates"
710 << ", excluded:"
711 << " no sp: " << excluded_no_sp
712 << ", weird sp: " << excluded_weird_state
713 << ", ndf: " << excluded_ndf
714 );
715
716 Acts::ConstVectorTrackContainer ctrack_backend(
717 std::move(track_container.container()));
718 Acts::ConstVectorMultiTrajectory ctrack_state_backend(
719 std::move(track_container.trackStateContainer()));
720 std::unique_ptr<ActsTrk::TrackContainer> ctrack_container =
721 std::make_unique<ActsTrk::TrackContainer>(
722 std::move(ctrack_backend), std::move(ctrack_state_backend));
723
724 ATH_CHECK(trackContainerHandle.record(std::move(ctrack_container)));
725
726 return StatusCode::SUCCESS;
727}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x,...)
static Acts::SourceLink pack(const Ptr_t &measurement)
Pack the measurement type pointer to an Acts::SourceLink including the intermediate conversion into a...
const T * at(size_type n) const
Access an element, as an rvalue.
SG::WriteHandleKey< ActsTrk::TrackContainer > m_ActsTracccTrackContainerKey
ActsTrk::ContextUtility m_ctxProvider
Utility to fetch the geometry, magnetic field and calibration context in the event.
SG::WriteHandleKey< xAOD::PixelClusterContainer > m_xAODPixelClusterFromInDetClusterKey
std::optional< Acts::BoundTrackParameters > convertToActsParameters(const LocalMeasurementInfoInTracks &state) const
Gaudi::Property< bool > m_doTruth
Truth association for plotting and debugging.
SG::WriteHandleKey< xAOD::StripClusterContainer > m_xAODStripClusterFromInDetClusterKey
Acts::TrackContainer< MutableTrackBackend, MutableTrackStateBackend, Acts::detail::ValueHolder > MutableTrackContainer
PixelClusterContainer_v1 PixelClusterContainer
Define the version of the pixel cluster container.
UncalibratedMeasurement_v1 UncalibratedMeasurement
Define the version of the uncalibrated measurement class.
StripClusterContainer_v1 StripClusterContainer
Define the version of the strip cluster container.

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

Definition at line 72 of file TritonTracccTrackMaker.cxx.

73{
74
75 // fill cells struct for sending to traccc
76 auto cell_start = std::chrono::high_resolution_clock::now();
77
78 // Read the cells produced by RDOtoTracccCellConverterAlg.
79 auto cells_handle = SG::makeHandle(m_tracccCellsKey, ctx);
80 ATH_CHECK(cells_handle.isValid());
81
82 traccc::edm::silicon_cell_collection::const_device cells{*cells_handle};
83
84 std::vector<uint8_t> cells_buffer;
85 ATH_CHECK(serializeCells(cells, cells_buffer));
86
87 auto cell_end = std::chrono::high_resolution_clock::now();
88 std::chrono::duration<double, std::milli> cell_time = cell_end - cell_start;
89 ATH_MSG_INFO("Cell reading time: " << cell_time.count() << " ms");
90
91 std::unordered_map<int64_t, int> cluster_map;
92 if (m_doTruth)
93 {
94 cluster_map = readAndConvertClusters(ctx);
95 }
96
97 // create output containers
98 std::vector<TracccTrackParameters> TracccTrackParams;
99 std::vector<LocalMeasurementInfoInTracks> TracccMeasurementsInfoInTracks;
100
101 // Run the inference
102 auto traccc_start = std::chrono::high_resolution_clock::now();
103 ATH_CHECK(m_tracccTrackingTool->getTracks(cells_buffer, TracccTrackParams, TracccMeasurementsInfoInTracks));
104 auto traccc_end = std::chrono::high_resolution_clock::now();
105 std::chrono::duration<double, std::milli> traccc_time = traccc_end - traccc_start;
106 ATH_MSG_INFO("Traccc total inference time: " << traccc_time.count() << " ms");
107
108 // convert to ACTs tracks
109 unsigned int nb_output_tracks = 0;
110 auto convert_start = std::chrono::high_resolution_clock::now();
111 ATH_CHECK(convertTracks(ctx, TracccTrackParams, TracccMeasurementsInfoInTracks,
112 cluster_map, nb_output_tracks));
113 auto convert_end = std::chrono::high_resolution_clock::now();
114 std::chrono::duration<double, std::milli> convert_time = convert_end - convert_start;
115 ATH_MSG_INFO("Traccc total conversion time: " << convert_time.count() << " ms");
116
117 return StatusCode::SUCCESS;
118}
StatusCode serializeCells(const traccc::edm::silicon_cell_collection::const_device &cells, std::vector< uint8_t > &out) const
std::unordered_map< int64_t, int > readAndConvertClusters(const EventContext &eventContext) const
StatusCode convertTracks(EventContext const &eventContext, std::vector< TracccTrackParameters > &trackParams, std::vector< LocalMeasurementInfoInTracks > &measInfo, const std::unordered_map< int64_t, int > &cluster_map, unsigned &nb_output_tracks) const
SG::ReadHandleKey< traccc::edm::silicon_cell_collection::const_view > m_tracccCellsKey
ToolHandle< ITracccTritonTool > m_tracccTrackingTool
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())

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

◆ initialize()

StatusCode TritonTracccTrackMaker::initialize ( )
overridevirtual

Definition at line 15 of file TritonTracccTrackMaker.cxx.

16{
17 // input handles / tools
18 ATH_CHECK(detStore()->retrieve(m_pixelID, "PixelID"));
19 ATH_CHECK(detStore()->retrieve(m_stripID, "SCT_ID"));
20
21 ATH_CHECK(m_tracccCellsKey.initialize());
22
23 // output container
25
29
30 // geometry helper for output
31 if (!m_trackingGeometrySvc.empty()) {
33 m_trackingGeometry = m_trackingGeometrySvc->trackingGeometry();
34 if (!m_trackingGeometry) {
35 ATH_MSG_DEBUG("Null Acts::TrackingGeometry from tracking geometry service");
36 return StatusCode::FAILURE;
37 }
38
40 if (!m_detEleToGeoIdMap) {
41 ATH_MSG_DEBUG("Null detector element to Acts geometry ID map from "
42 "tracking geometry service");
43 return StatusCode::FAILURE;
44 }
45 }
46
47 // tools
49
51
52 // Initialize condition handle keys
53 ATH_CHECK(m_pixelDetEleCollKey.initialize());
54 ATH_CHECK(m_stripDetEleCollKey.initialize());
55
56 // Initialize cluster container keys
62
63 // Initialize truth association keys if needed
66
67 ATH_CHECK(m_ctxProvider.initialize());
68
69 return StatusCode::SUCCESS;
70}
const ServiceHandle< StoreGateSvc > & detStore() const
SG::ReadHandleKey< InDet::SCT_ClusterContainer > m_inputStripClusterContainerKey
ServiceHandle< ActsTrk::ITrackingGeometrySvc > m_trackingGeometrySvc
ActsTrk::MutableTrackContainerHandlesHelper m_tracksBackendHandlesHelper
SG::WriteHandleKey< xAOD::SpacePointContainer > m_xAODSpacepointFromInDetClusterKey
SG::ReadHandleKey< InDet::PixelClusterContainer > m_inputPixelClusterContainerKey
SG::ReadHandleKey< ActsTrk::MeasurementToTruthParticleAssociation > m_stripClustersToTruth
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_stripDetEleCollKey
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_pixelDetEleCollKey
std::vector< std::string > m_featureNamesVec
SG::ReadHandleKey< ActsTrk::MeasurementToTruthParticleAssociation > m_pixelClustersToTruth
std::string prefixFromTrackContainerName(const std::string &tracks)
Parse TrackContainer name to get the prefix for backends The name has to contain XYZTracks,...
std::vector< std::string > tokenize(std::string_view the_str, std::string_view delimiters)
Splits the string into smaller substrings.

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

◆ readAndConvertClusters()

std::unordered_map< int64_t, int > TritonTracccTrackMaker::readAndConvertClusters ( const EventContext & eventContext) const
protected

Definition at line 173 of file TritonTracccTrackMaker.cxx.

175{
176 int nPix = 0;
177 int nStrip = 0;
178 std::unordered_map<int64_t, int> traccc_to_xaod_cluster_map;
179
180 ATH_MSG_INFO("Converting InDet clusters to xAOD");
181 SG::WriteHandle<xAOD::PixelClusterContainer>
182 xAODPixelContainerFromInDetClusters(
184 if ((xAODPixelContainerFromInDetClusters.record(
185 std::make_unique<xAOD::PixelClusterContainer>(),
186 std::make_unique<xAOD::PixelClusterAuxContainer>()))
187 .isFailure()) {
189 "Could not record xAOD Pixel container from InDet Clusters");
190 throw std::runtime_error(
191 "creation of xAOD Pixel container from InDet Clusters failed");
192 }
193
194 SG::WriteHandle<xAOD::StripClusterContainer>
195 xAODStripContainerFromInDetClusters(
197 if ((xAODStripContainerFromInDetClusters.record(
198 std::make_unique<xAOD::StripClusterContainer>(),
199 std::make_unique<xAOD::StripClusterAuxContainer>()))
200 .isFailure()) {
202 "Could not record xAOD Strip container from InDet Clusters");
203 throw std::runtime_error(
204 "creation of xAOD Strip container from InDet Clusters failed");
205 }
206
207 SG::ReadCondHandle<InDetDD::SiDetectorElementCollection> pixelDetEleHandle(
208 m_pixelDetEleCollKey, eventContext);
209
210 const InDetDD::SiDetectorElementCollection* pixElements{};
211 if (SG::get(pixElements, m_pixelDetEleCollKey, eventContext).isFailure() ||
212 pixElements == nullptr) {
213 ATH_MSG_FATAL(m_pixelDetEleCollKey.fullKey() << " is not available.");
214 std::ostringstream errMsg;
215 errMsg << m_pixelDetEleCollKey.fullKey() << " is not available.";
216 throw std::runtime_error(errMsg.str());
217 }
218
219 SG::ReadCondHandle<InDetDD::SiDetectorElementCollection> stripDetEleHandle(
220 m_stripDetEleCollKey, eventContext);
221 const InDetDD::SiDetectorElementCollection* stripElements(
222 *stripDetEleHandle);
223 if (not stripDetEleHandle.isValid() or stripElements == nullptr) {
224 ATH_MSG_FATAL(m_stripDetEleCollKey.fullKey() << " is not available.");
225 std::ostringstream errMsg;
226 errMsg << m_stripDetEleCollKey.fullKey() << " is not available.";
227 throw std::runtime_error(errMsg.str());
228 }
229
230 SG::WriteHandle<xAOD::SpacePointContainer>
231 xAODSpacepointContainerFromInDetClusters(
233 if (xAODSpacepointContainerFromInDetClusters
234 .record(std::make_unique<xAOD::SpacePointContainer>(),
235 std::make_unique<xAOD::SpacePointAuxContainer>())
236 .isFailure()) {
237 throw std::runtime_error(
238 "creation of InDet spacepoint containers failed");
239 }
240
241 ATH_MSG_DEBUG("Reading clusters");
242
243 const InDet::PixelClusterContainer* inputPixelClusterContainer{};
244 if (SG::get(inputPixelClusterContainer, m_inputPixelClusterContainerKey,
245 eventContext)
246 .isFailure() ||
247 inputPixelClusterContainer == nullptr) {
249 << " is not available.");
250 std::ostringstream errMsg;
251 errMsg << m_inputPixelClusterContainerKey.fullKey()
252 << " is not available.";
253 throw std::runtime_error(errMsg.str());
254 }
255
256 for (const auto* const clusterCollection : *inputPixelClusterContainer) {
257 if (!clusterCollection)
258 continue;
259 for (const auto* const theCluster : *clusterCollection) {
260
261 const InDetDD::SiDetectorElement* element =
262 theCluster->detectorElement();
263 const Identifier Pixel_ModuleID = element->identify();
264
265 auto pixelCl = xAODPixelContainerFromInDetClusters->push_back(
266 std::make_unique<xAOD::PixelCluster>());
267 if ((convertInDetToXaodCluster(*theCluster, *element, *pixelCl))
268 .isFailure()) {
269 ATH_MSG_FATAL("Could not convert InDet pixel cluster to xAOD");
270 throw std::runtime_error(
271 "conversion of InDet pixel cluster to xAOD failed");
272 }
273
274 auto xaod_sp = xAODSpacepointContainerFromInDetClusters->push_back(
275 std::make_unique<xAOD::SpacePoint>());
276 const IdentifierHash Pixel_ModuleHash =
277 m_pixelID->wafer_hash(Pixel_ModuleID);
278
279 xAOD::MeasVector<2> globalVariance(xAOD::MeasVector<2>::Zero());
280 xAOD::MeasVector<3> globalPosition{xAOD::toStorage(theCluster->globalPosition())};
281
282 xaod_sp->setSpacePoint(Pixel_ModuleHash, globalPosition,
283 globalVariance(0, 0), globalVariance(1, 0),
284 {pixelCl});
285
286 size_t index = xAODPixelContainerFromInDetClusters->size() - 1;
287 traccc_to_xaod_cluster_map[Pixel_ModuleID.get_compact()] = index;
288
289 nPix++;
290 }
291 }
292 ATH_MSG_DEBUG("Read " << nPix << " pixel clusters");
293
294 const InDet::SCT_ClusterContainer* inputStripClusterContainer{};
295 if (SG::get(inputStripClusterContainer, m_inputStripClusterContainerKey,
296 eventContext)
297 .isFailure() ||
298 inputStripClusterContainer == nullptr) {
300 << " is not available.");
301 std::ostringstream errMsg;
302 errMsg << m_inputStripClusterContainerKey.fullKey()
303 << " is not available.";
304 throw std::runtime_error(errMsg.str());
305 }
306
307 for (const auto* const clusterCollection : *inputStripClusterContainer) {
308 if (!clusterCollection)
309 continue;
310 for (const auto* const theCluster : *clusterCollection) {
311
312 const InDetDD::SiDetectorElement* element =
313 theCluster->detectorElement();
314 const Identifier Strip_ModuleID = element->identify();
315
316 xAOD::StripCluster* stripCl = new xAOD::StripCluster();
317 xAODStripContainerFromInDetClusters->push_back(stripCl);
318 if ((convertInDetToXaodCluster(*theCluster, *element, *stripCl))
319 .isFailure()) {
320 ATH_MSG_FATAL("Could not convert InDet strip cluster to xAOD");
321 throw std::runtime_error(
322 "conversion of InDet strip cluster to xAOD failed");
323 }
324 size_t index = xAODStripContainerFromInDetClusters->size() - 1;
325 traccc_to_xaod_cluster_map[Strip_ModuleID.get_compact()] = index;
326
327 nStrip++;
328 }
329 }
330
331 ATH_MSG_DEBUG("Read " << nStrip << " strip clusters");
332
333 return traccc_to_xaod_cluster_map;
334}
#define ATH_MSG_FATAL(x,...)
virtual Identifier identify() const override final
identifier of this detector element (inline)
Trk::PrepRawDataContainer< SCT_ClusterCollection > SCT_ClusterContainer
Trk::PrepRawDataContainer< PixelClusterCollection > PixelClusterContainer
StatusCode convertInDetToXaodCluster(const InDet::PixelCluster &indetCluster, const InDetDD::SiDetectorElement &element, xAOD::PixelCluster &xaodCluster) const
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
@ nStrip
Get number of strips.
Definition TauDefs.h:204
StripCluster_v1 StripCluster
Define the version of the strip cluster class.

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

◆ serializeCells()

StatusCode TritonTracccTrackMaker::serializeCells ( const traccc::edm::silicon_cell_collection::const_device & cells,
std::vector< uint8_t > & out ) const
protected

Definition at line 137 of file TritonTracccTrackMaker.cxx.

140{
141 const uint64_t nCells = cells.size();
142
143 // Reserve: 8-byte header + 5 columns * (4 or 4-byte scalars) per cell.
144 out.clear();
145 out.reserve(sizeof(uint64_t) + nCells * (3 * sizeof(uint32_t) + 2 * sizeof(float)));
146
147 // Header: number of cells.
148 appendBytes(out, nCells);
149
150 // SoA column blocks, in silicon_cell_collection column order.
151 for (uint64_t i = 0; i < nCells; ++i) {
152 appendBytes(out, static_cast<uint32_t>(cells.channel0()[i]));
153 }
154 for (uint64_t i = 0; i < nCells; ++i) {
155 appendBytes(out, static_cast<uint32_t>(cells.channel1()[i]));
156 }
157 for (uint64_t i = 0; i < nCells; ++i) {
158 appendBytes(out, static_cast<float>(cells.activation()[i]));
159 }
160 for (uint64_t i = 0; i < nCells; ++i) {
161 appendBytes(out, static_cast<float>(cells.time()[i]));
162 }
163 for (uint64_t i = 0; i < nCells; ++i) {
164 appendBytes(out, static_cast<uint32_t>(cells.module_index()[i]));
165 }
166
167 ATH_MSG_DEBUG("Serialized " << nCells << " traccc cells into "
168 << out.size() << " bytes");
169
170 return StatusCode::SUCCESS;
171}
void appendBytes(std::vector< uint8_t > &out, const uint64_t &value)
setRawEt setRawPhi nCells
setEventNumber uint32_t

◆ 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}
#define ATH_MSG_ERROR(x,...)
#define ATH_MSG_WARNING(x,...)
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_ActsTracccTrackContainerKey

SG::WriteHandleKey<ActsTrk::TrackContainer> TritonTracccTrackMaker::m_ActsTracccTrackContainerKey
protected
Initial value:
{
this, "TracccTracks", "TracccTracks",
"Output track collection (ActsTrk variant)"}

@name Output helpers

Definition at line 113 of file TritonTracccTrackMaker.h.

113 {
114 this, "TracccTracks", "TracccTracks",
115 "Output track collection (ActsTrk variant)"};

◆ m_ctxProvider

ActsTrk::ContextUtility TritonTracccTrackMaker::m_ctxProvider {this}
protected

Utility to fetch the geometry, magnetic field and calibration context in the event.

Definition at line 154 of file TritonTracccTrackMaker.h.

154{this};

◆ m_detEleToGeoIdMap

const ActsTrk::DetectorElementToActsGeometryIdMap* TritonTracccTrackMaker::m_detEleToGeoIdMap {nullptr}
protected

Definition at line 123 of file TritonTracccTrackMaker.h.

123{nullptr};

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

Gaudi::Property<bool> TritonTracccTrackMaker::m_doTruth
protected
Initial value:
{
this, "doTruth", true,
"Create output containers and link to truth"}

Truth association for plotting and debugging.

Definition at line 162 of file TritonTracccTrackMaker.h.

162 {
163 this, "doTruth", true,
164 "Create output containers and link to truth"};

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

StringProperty TritonTracccTrackMaker::m_featureNames
protected
Initial value:
{this, "FeatureNames",
"geometry_id,measurement_id,channel0,channel1,timestamp,value"}

Definition at line 156 of file TritonTracccTrackMaker.h.

156 {this, "FeatureNames",
157 "geometry_id,measurement_id,channel0,channel1,timestamp,value"};

◆ m_featureNamesVec

std::vector<std::string> TritonTracccTrackMaker::m_featureNamesVec
protected

Definition at line 158 of file TritonTracccTrackMaker.h.

◆ m_inputPixelClusterContainerKey

SG::ReadHandleKey<InDet::PixelClusterContainer> TritonTracccTrackMaker::m_inputPixelClusterContainerKey
protected
Initial value:
{
this, "InputPixelClustersName", "ITkPixelClusters",
"name of the input InDet pixel cluster container"}

Definition at line 179 of file TritonTracccTrackMaker.h.

179 {
180 this, "InputPixelClustersName", "ITkPixelClusters",
181 "name of the input InDet pixel cluster container"};

◆ m_inputStripClusterContainerKey

SG::ReadHandleKey<InDet::SCT_ClusterContainer> TritonTracccTrackMaker::m_inputStripClusterContainerKey
protected
Initial value:
{
this, "InputStripClustersName", "ITkStripClusters",
"name of the input InDet strip cluster container"}

Definition at line 183 of file TritonTracccTrackMaker.h.

183 {
184 this, "InputStripClustersName", "ITkStripClusters",
185 "name of the input InDet strip cluster container"};

◆ m_pdgToParticleHypothesis

Trk::PdgToParticleHypothesis TritonTracccTrackMaker::m_pdgToParticleHypothesis
protected

Definition at line 120 of file TritonTracccTrackMaker.h.

◆ m_pixelClustersToTruth

SG::ReadHandleKey<ActsTrk::MeasurementToTruthParticleAssociation> TritonTracccTrackMaker::m_pixelClustersToTruth
protected
Initial value:
{
this, "PixelClustersToTruthParticlesMap",
"PixelClustersForTruthSeedingToTruthParticlesMap",
"Association map from pixel measurements to generator particles."}

Definition at line 167 of file TritonTracccTrackMaker.h.

167 {
168 this, "PixelClustersToTruthParticlesMap",
169 "PixelClustersForTruthSeedingToTruthParticlesMap",
170 "Association map from pixel measurements to generator particles."};

◆ m_pixelDetEleCollKey

SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> TritonTracccTrackMaker::m_pixelDetEleCollKey
protected
Initial value:
{this, "PixelDetEleCollKey",
"ITkPixelDetectorElementCollection",
"Key of SiDetectorElementCollection for Pixel"}

Definition at line 204 of file TritonTracccTrackMaker.h.

204 {this, "PixelDetEleCollKey",
205 "ITkPixelDetectorElementCollection",
206 "Key of SiDetectorElementCollection for Pixel"};

◆ m_pixelID

const PixelID* TritonTracccTrackMaker::m_pixelID {nullptr}
protected

Definition at line 91 of file TritonTracccTrackMaker.h.

91{nullptr};

◆ m_stripClustersToTruth

SG::ReadHandleKey<ActsTrk::MeasurementToTruthParticleAssociation> TritonTracccTrackMaker::m_stripClustersToTruth
protected
Initial value:
{
this, "StripClustersToTruthParticlesMap",
"StripClustersForTruthSeedingToTruthParticlesMap",
"Association map from strip measurements to generator particles."}

Definition at line 173 of file TritonTracccTrackMaker.h.

173 {
174 this, "StripClustersToTruthParticlesMap",
175 "StripClustersForTruthSeedingToTruthParticlesMap",
176 "Association map from strip measurements to generator particles."};

◆ m_stripDetEleCollKey

SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> TritonTracccTrackMaker::m_stripDetEleCollKey
protected
Initial value:
{this, "StripDetEleCollKey",
"ITkStripDetectorElementCollection",
"Key of SiDetectorElementCollection for Strip"}

Definition at line 208 of file TritonTracccTrackMaker.h.

208 {this, "StripDetEleCollKey",
209 "ITkStripDetectorElementCollection",
210 "Key of SiDetectorElementCollection for Strip"};

◆ m_stripID

const SCT_ID* TritonTracccTrackMaker::m_stripID {nullptr}
protected

Definition at line 92 of file TritonTracccTrackMaker.h.

92{nullptr};

◆ m_tracccCellsKey

SG::ReadHandleKey<traccc::edm::silicon_cell_collection::const_view> TritonTracccTrackMaker::m_tracccCellsKey
protected
Initial value:
{
this, "TracccCells", "TracccCells",
"Input traccc cell collection (from RDOtoTracccCellConverterAlg)"}

@name Input helpers

Definition at line 83 of file TritonTracccTrackMaker.h.

83 {
84 this, "TracccCells", "TracccCells",
85 "Input traccc cell collection (from RDOtoTracccCellConverterAlg)"};

◆ m_tracccTrackingTool

ToolHandle<ITracccTritonTool> TritonTracccTrackMaker::m_tracccTrackingTool
protected
Initial value:
{
this, "TracccTritonTool", "TracccTritonTool"}

@name Tool handles

Definition at line 146 of file TritonTracccTrackMaker.h.

146 {
147 this, "TracccTritonTool", "TracccTritonTool"};

◆ m_trackingGeometry

std::shared_ptr<const Acts::TrackingGeometry> TritonTracccTrackMaker::m_trackingGeometry
protected

Definition at line 122 of file TritonTracccTrackMaker.h.

◆ m_trackingGeometrySvc

ServiceHandle<ActsTrk::ITrackingGeometrySvc> TritonTracccTrackMaker::m_trackingGeometrySvc
protected
Initial value:
{
this, "TrackingGeometrySvc", "ActsTrackingGeometrySvc"}

Definition at line 149 of file TritonTracccTrackMaker.h.

149 {
150 this, "TrackingGeometrySvc", "ActsTrackingGeometrySvc"};

◆ m_tracksBackendHandlesHelper

ActsTrk::MutableTrackContainerHandlesHelper TritonTracccTrackMaker::m_tracksBackendHandlesHelper
protected
Initial value:
{
this}

Definition at line 118 of file TritonTracccTrackMaker.h.

118 {
119 this};

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

◆ m_xAODPixelClusterFromInDetClusterKey

SG::WriteHandleKey<xAOD::PixelClusterContainer> TritonTracccTrackMaker::m_xAODPixelClusterFromInDetClusterKey
protected
Initial value:
{
this, "xAODPixelClusterFromInDetClusterKey",
"xAODPixelClustersFromInDetCluster",
"InDet cluster->xAOD PixelClusters Container"}

Definition at line 188 of file TritonTracccTrackMaker.h.

188 {
189 this, "xAODPixelClusterFromInDetClusterKey",
190 "xAODPixelClustersFromInDetCluster",
191 "InDet cluster->xAOD PixelClusters Container"};

◆ m_xAODSpacepointFromInDetClusterKey

SG::WriteHandleKey<xAOD::SpacePointContainer> TritonTracccTrackMaker::m_xAODSpacepointFromInDetClusterKey
protected
Initial value:
{
this, "xAODSpacepointFromInDetClusterKey",
"xAODSpacepointFromInDetCluster",
"InDet cluster->xAOD Spacepoint Container"}

Definition at line 198 of file TritonTracccTrackMaker.h.

198 {
199 this, "xAODSpacepointFromInDetClusterKey",
200 "xAODSpacepointFromInDetCluster",
201 "InDet cluster->xAOD Spacepoint Container"};

◆ m_xAODStripClusterFromInDetClusterKey

SG::WriteHandleKey<xAOD::StripClusterContainer> TritonTracccTrackMaker::m_xAODStripClusterFromInDetClusterKey
protected
Initial value:
{
this, "xAODStripClusterFromInDetClusterKey",
"xAODStripClustersFromInDetCluster",
"InDet cluster ->xAOD StripClusters Container"}

Definition at line 193 of file TritonTracccTrackMaker.h.

193 {
194 this, "xAODStripClusterFromInDetClusterKey",
195 "xAODStripClustersFromInDetCluster",
196 "InDet cluster ->xAOD StripClusters Container"};

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