16 return track_particle.
summaryValue(tmp, summary_type) ?
static_cast<int>(
tmp) : -1;
42 ATH_MSG_DEBUG(
"Filling Histograms for " << name() <<
" ... " );
75 auto monitor_expectNextToInnermost =
Monitored::Collection(
"expectNextToInnermostHit", *track_particles,
79 fill(
m_monGroupName.value(),monitor_pt,monitor_eta, monitor_pixelHits, monitor_innermostHits, monitor_nextToInnermostHits,
80 monitor_expectInnermost, monitor_expectNextToInnermost);
81 return StatusCode::SUCCESS;
85 std::optional<ActsTrk::TrackContainer::ConstTrackProxy> optional_track =
getActsTrack(track_particle);
86 if ( not optional_track.has_value() ) {
87 ATH_MSG_WARNING(
"Invalid track link for particle " << track_particle.index());
88 return StatusCode::SUCCESS;
91 ActsTrk::TrackContainer::ConstTrackProxy track = optional_track.value();
92 std::array<uint8_t, Acts::toUnderlying(Acts::TrackStateFlag::NumFlags)+1> counts{};
94 const ActsTrk::TrackContainer::ConstTrackProxy::IndexType
95 lastMeasurementIndex = track.tipIndex();
97 track.container().trackStateContainer().visitBackwards(lastMeasurementIndex,
98 [&counts] (
const typename ActsTrk::TrackStateBackend::ConstTrackStateProxy &state) ->
void
100 auto flags = state.typeFlags();
101 ++counts[Acts::toUnderlying(Acts::TrackStateFlag::NumFlags)];
103 for (
unsigned int flag_i=0; flag_i<Acts::toUnderlying(Acts::TrackStateFlag::NumFlags); ++flag_i) {
104 if (flags.test(flag_i)) {
105 if (flag_i == Acts::toUnderlying(Acts::TrackStateFlag::IsHole)) {
106 if (!state.hasReferenceSurface() || !state.referenceSurface().isSensitive())
continue;
113 auto monitor_states =
Monitored::Scalar<int>(
"States",counts[Acts::toUnderlying(Acts::TrackStateFlag::NumFlags)]);
114 auto monitor_measurement =
Monitored::Scalar<int>(
"Measurements",counts[Acts::toUnderlying(Acts::TrackStateFlag::HasMeasurement)]);
115 auto monitor_parameter =
Monitored::Scalar<int>(
"Parameters",counts[Acts::toUnderlying(Acts::TrackStateFlag::HasParameters)]);
116 auto monitor_outlier =
Monitored::Scalar<int>(
"Outliers",counts[Acts::toUnderlying(Acts::TrackStateFlag::IsOutlier)]);
117 auto monitor_hole =
Monitored::Scalar<int>(
"Holes",counts[Acts::toUnderlying(Acts::TrackStateFlag::IsHole)]);
118 auto monitor_material =
Monitored::Scalar<int>(
"MaterialStates",counts[Acts::toUnderlying(Acts::TrackStateFlag::HasMaterial)]);
119 auto monitor_sharedHit =
Monitored::Scalar<int>(
"SharedHits",counts[Acts::toUnderlying(Acts::TrackStateFlag::IsSharedHit)]);
122 monitor_states, monitor_measurement, monitor_parameter, monitor_outlier, monitor_hole,
123 monitor_material, monitor_sharedHit);
124 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
virtual StatusCode initialize() override
initialize
TrackParticleAnalysisAlg(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode fillHistograms(const EventContext &ctx) const override
adds event to the monitoring histograms
Gaudi::Property< bool > m_monitorTrackStateCounts
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_tracksKey
Gaudi::Property< std::string > m_monGroupName
StatusCode monitorTrackStateCounts(const xAOD::TrackParticle &track_particle) const
virtual StatusCode initialize() override
initialize
AthMonitorAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Declare a monitored scalar variable.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type cptr()
Dereference the pointer.
bool summaryValue(uint8_t &value, const SummaryType &information) const
Accessor for TrackSummary values.
virtual double pt() const override final
The transverse momentum ( ) of the particle.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
void fill(const ToolHandle< GenericMonitoringTool > &groupHandle, std::vector< std::reference_wrapper< Monitored::IMonitoredVariable > > &&variables) const
Fills a vector of variables to a group by reference.
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
std::optional< ActsTrk::TrackContainer::ConstTrackProxy > getActsTrack(const xAOD::TrackParticle &trkPart)
Return the proxy to the Acts track from which the track particle was made frome.
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
TrackParticle_v1 TrackParticle
Reference the current persistent version:
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".
SummaryType
Enumerates the different types of information stored in Summary.
@ expectInnermostPixelLayerHit
Do we expect a 0th-layer barrel hit for this track?
@ numberOfNextToInnermostPixelLayerHits
these are the hits in the 1st pixel barrel layer
@ expectNextToInnermostPixelLayerHit
Do we expect a 1st-layer barrel hit for this track?
@ numberOfInnermostPixelLayerHits
these are the hits in the 0th pixel barrel layer
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].