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

#include <ActsClusterComparisonAlg.h>

Inheritance diagram for ActsTrk::ActsClusterComparisonAlg:
Collaboration diagram for ActsTrk::ActsClusterComparisonAlg:

Public Member Functions

virtual StatusCode initialize () override
 Initialize the algorithm.
virtual StatusCode execute (const EventContext &ctx) const override
 Execute the algorithm.
virtual StatusCode finalize () override
 Finalize the algorithm.
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
 Get filter decision:
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 Set filter decision:
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

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

Private Types

typedef ServiceHandle< StoreGateSvc > StoreGateSvc_t

Private Member Functions

StatusCode validateClusters (const EventContext &eventContext, std::unordered_map< const xAOD::PixelCluster *, const xAOD::PixelCluster * > &pixel_cluster_matches, std::unordered_map< const xAOD::StripCluster *, const xAOD::StripCluster * > &strip_cluster_matches) const
StatusCode validatePixelSpacepoints (const EventContext &eventContext, std::unordered_map< const xAOD::PixelCluster *, const xAOD::PixelCluster * > &pixel_cluster_matches) const
void matchPixelClusters (std::vector< const xAOD::PixelCluster * > &monitored_list, std::vector< const xAOD::PixelCluster * > &reference_list, const std::string &module_id, std::vector< std::pair< const xAOD::PixelCluster *, const xAOD::PixelCluster * > > &pairs) const
void matchStripClusters (std::vector< const xAOD::StripCluster * > &monitored_list, std::vector< const xAOD::StripCluster * > &reference_list, const std::string &module_id, std::vector< std::pair< const xAOD::StripCluster *, const xAOD::StripCluster * > > &pairs) const
std::optional< std::pair< float, float > > tracccLorentzShift (const Identifier &athenaId, const traccc::detector_conditions_description::host &cond) const
 Lorentz shift stored in the traccc host conditions object for the given Athena module (side).
std::optional< std::array< float, 2 > > tracccCellPosition (const Identifier &athenaId, unsigned int channel0, unsigned int channel1, const traccc::detector_design_description::host &design, const traccc::detector_conditions_description::host &cond) const
 Centre of the traccc readout bin (channel0, channel1) on the given Athena module, computed like traccc::details::position_from_cell from the host design description.
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

Gaudi::Property< std::string > m_monDesignObjectName
SG::ReadCondHandleKey< traccc::detector_conditions_description::host > m_monCondKey
Gaudi::Accumulators::Counter m_pixel_unequal
Gaudi::Accumulators::Counter m_strip_unequal
Gaudi::Accumulators::Counter m_matched_pixel
Gaudi::Accumulators::Counter m_matched_strip
Gaudi::Accumulators::Counter m_pix_unmatched_mon
Gaudi::Accumulators::Counter m_pix_unmatched_ref
Gaudi::Accumulators::Counter m_strip_unmatched_mon
Gaudi::Accumulators::Counter m_strip_unmatched_ref
Gaudi::Accumulators::Counter m_pixel_pos_diff_1sig
Gaudi::Accumulators::Counter m_pixel_pos_diff_0p5sig
Gaudi::Accumulators::Counter m_pixel_pos_diff_0p25sig
Gaudi::Accumulators::Counter m_strip_pos_diff_1sig
Gaudi::Accumulators::Counter m_strip_pos_diff_0p5sig
Gaudi::Accumulators::Counter m_strip_pos_diff_0p25sig
Gaudi::Accumulators::Counter m_strip_pos_diff_barrel
Gaudi::Accumulators::Counter m_strip_pos_diff_EC
Gaudi::Accumulators::Counter m_nMonSp
Gaudi::Accumulators::Counter m_nRefSp
Gaudi::Accumulators::Counter m_nMatchedSp
Gaudi::Accumulators::Counter m_nUnmatchedMonSp
Gaudi::Accumulators::Counter m_nUnmatchedRefSp
Gaudi::Accumulators::Counter m_nSpPosDiff1mm
Gaudi::Accumulators::Counter m_nSpPosDiff5mm
Gaudi::Accumulators::Counter m_nSpVarRDiff
Gaudi::Accumulators::Counter m_nSpVarZDiff
Gaudi::Property< std::string > m_pixelManagerKey
Gaudi::Property< std::string > m_stripManagerKey
const InDetDD::PixelDetectorManager * m_pixelManager {nullptr}
const InDetDD::SCT_DetectorManager * m_stripManager {nullptr}
const SCT_ID * m_stripID {nullptr}
ToolHandle< ISiLorentzAngleTool > m_stripLorentzAngleTool
ToolHandle< ISiLorentzAngleTool > m_pixelLorentzAngleTool
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
The detector description service providing the Athena<->Detray ID map
Gaudi::Property< std::string > m_geoIdMappingObjectName {this, "GeoIdMapping", "", "ID mapping between the three detector description realms."}
const ActsTrk::GeometryIdMapping * m_idMapping {nullptr}
Boolean varibale turning on/off spacepoint validation

{@

Gaudi::Property< bool > m_checkSpacepoints
Names of input monitored and reference pixel/strip/spacepoint collections

{@

SG::ReadHandleKey< xAOD::SpacePointContainer > m_monitoredSpacepointsKey
SG::ReadHandleKey< xAOD::SpacePointContainer > m_referenceSpacepointsKey
SG::ReadHandleKey< xAOD::PixelClusterContainer > m_monitoredPixelClustersKey
SG::ReadHandleKey< xAOD::StripClusterContainer > m_monitoredStripClustersKey
SG::ReadHandleKey< xAOD::PixelClusterContainer > m_referencePixelClustersKey
SG::ReadHandleKey< xAOD::StripClusterContainer > m_referenceStripClustersKey

Detailed Description

Definition at line 58 of file ActsClusterComparisonAlg.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 376 of file AthCommonDataStore.h.

Member Function Documentation

◆ declareGaudiProperty()

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

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

Definition at line 156 of file AthCommonDataStore.h.

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

◆ declareProperty()

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

Definition at line 145 of file AthCommonDataStore.h.

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

◆ detStore()

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

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

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

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

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

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode ActsTrk::ActsClusterComparisonAlg::execute ( const EventContext & ctx) const
overridevirtual

Execute the algorithm.

Definition at line 64 of file ActsClusterComparisonAlg.cxx.

65{
66
67
68 // Create per-event data structures
69 std::unordered_map<const xAOD::PixelCluster*, const xAOD::PixelCluster*>
70 pixel_cluster_matches;
71
72 std::unordered_map<const xAOD::StripCluster*, const xAOD::StripCluster*>
73 strip_cluster_matches;
74
75
76 ATH_CHECK(validateClusters(ctx, pixel_cluster_matches, strip_cluster_matches));
77
79 ATH_CHECK(validatePixelSpacepoints(ctx, pixel_cluster_matches));
80
81 return StatusCode::SUCCESS;
82}
#define ATH_CHECK
Evaluate an expression and check for errors.
StatusCode validateClusters(const EventContext &eventContext, std::unordered_map< const xAOD::PixelCluster *, const xAOD::PixelCluster * > &pixel_cluster_matches, std::unordered_map< const xAOD::StripCluster *, const xAOD::StripCluster * > &strip_cluster_matches) const
StatusCode validatePixelSpacepoints(const EventContext &eventContext, std::unordered_map< const xAOD::PixelCluster *, const xAOD::PixelCluster * > &pixel_cluster_matches) const

◆ extraDeps_update_handler()

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

Add StoreName to extra input/output deps as needed.

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

◆ extraOutputDeps()

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

Return the list of extra output dependencies.

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

Definition at line 89 of file AthCommonAlgorithm.cxx.

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

◆ filterPassed()

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

Get filter decision:

Definition at line 93 of file AthCommonAlgorithm.h.

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

◆ finalize()

StatusCode ActsTrk::ActsClusterComparisonAlg::finalize ( )
overridevirtual

Finalize the algorithm.

Definition at line 1064 of file ActsClusterComparisonAlg.cxx.

1065{
1066
1067 // Print cluster statistics
1068 ATH_MSG_INFO("Validation Summary");
1069 ATH_MSG_INFO("ValSum ============================================================");
1070 ATH_MSG_INFO("ValSum PIXEL CLUSTER MATCHING STATISTICS: ");
1071 ATH_MSG_INFO("ValSum Total unmatched clusters mon/ref: " << m_pix_unmatched_mon << " / " << m_pix_unmatched_ref);
1072 ATH_MSG_INFO("ValSum Total matched clusters: " << m_matched_pixel);
1073 ATH_MSG_INFO("ValSum Clusters with pos diff > 1 sigma: "
1074 << m_pixel_pos_diff_1sig << " ("
1075 << (m_matched_pixel.value() > 0
1076 ? 100.0 * m_pixel_pos_diff_1sig.value() / m_matched_pixel.value()
1077 : 0.0)
1078 << "%)");
1079 ATH_MSG_INFO("ValSum Clusters with pos diff > 0.5 sigma: "
1080 << m_pixel_pos_diff_0p5sig << " ("
1081 << (m_matched_pixel.value() > 0
1082 ? 100.0 * m_pixel_pos_diff_0p5sig.value() / m_matched_pixel.value()
1083 : 0.0)
1084 << "%)");
1085 ATH_MSG_INFO("ValSum Clusters with pos diff > 0.25 sigma: "
1086 << m_pixel_pos_diff_0p25sig << " ("
1087 << (m_matched_pixel.value() > 0
1088 ? 100.0 * m_pixel_pos_diff_0p25sig.value() / m_matched_pixel.value()
1089 : 0.0)
1090 << "%)");
1091 ATH_MSG_INFO("ValSum ============================================================");
1092 ATH_MSG_INFO("ValSum ============================================================");
1093 ATH_MSG_INFO("ValSum STRIP CLUSTER MATCHING STATISTICS:");
1094 ATH_MSG_INFO("ValSum Total unmatched clusters mon/ref: " << m_strip_unmatched_mon << " / " << m_strip_unmatched_ref);
1095 ATH_MSG_INFO("ValSum Total matched clusters: " << m_matched_strip);
1096 ATH_MSG_INFO("ValSum Clusters with pos diff > 1 sigma: "
1097 << m_strip_pos_diff_1sig << " ("
1098 << (m_matched_strip.value() > 0
1099 ? 100.0 * m_strip_pos_diff_1sig.value() / m_matched_strip.value()
1100 : 0.0)
1101 << "%)");
1102 ATH_MSG_INFO("ValSum Clusters with pos diff > 0.5 sigma: "
1103 << m_strip_pos_diff_0p5sig << " ("
1104 << (m_matched_strip.value() > 0
1105 ? 100.0 * m_strip_pos_diff_0p5sig.value() / m_matched_strip.value()
1106 : 0.0)
1107 << "%)");
1108 ATH_MSG_INFO("ValSum Clusters with pos diff > 0.25 sigma: "
1109 << m_strip_pos_diff_0p25sig << " ("
1110 << (m_matched_strip.value() > 0
1111 ? 100.0 * m_strip_pos_diff_0p25sig.value() / m_matched_strip.value()
1112 : 0.0)
1113 << "%)");
1114 ATH_MSG_INFO("ValSum Distribution of clusters with poss diff > 0.25 sigma (barrel/EC): "
1116 ATH_MSG_INFO("ValSum ============================================================");
1117
1119 ATH_MSG_INFO("ValSum ============================================================");
1120 ATH_MSG_INFO("ValSum PIXEL SPACEPOINT MATCHING STATISTICS:");
1121 ATH_MSG_INFO("ValSum Total monitored spacepoints: " << m_nMonSp);
1122 ATH_MSG_INFO("ValSum Total reference spacepoints: " << m_nRefSp);
1123 ATH_MSG_INFO("ValSum Matched spacepoints: " << m_nMatchedSp);
1124 ATH_MSG_INFO("ValSum Unmatched monitored spacepoints: " << m_nUnmatchedMonSp);
1125 ATH_MSG_INFO("ValSum Unmatched reference spacepoints: " << m_nUnmatchedRefSp);
1126 ATH_MSG_INFO("ValSum ============================================================");
1127 ATH_MSG_INFO("ValSum SPACEPOINT POSITION COMPARISON:");
1128 ATH_MSG_INFO("ValSum Spacepoints with global pos diff > 1 mm: "
1129 << m_nSpPosDiff1mm << " ("
1130 << (m_nMatchedSp.value() > 0 ? 100.0 * m_nSpPosDiff1mm.value() / m_nMatchedSp.value() : 0.0)
1131 << "%)");
1132 ATH_MSG_INFO("ValSum Spacepoints with global pos diff > 5 mm: "
1133 << m_nSpPosDiff5mm << " ("
1134 << (m_nMatchedSp.value() > 0 ? 100.0 * m_nSpPosDiff5mm.value() / m_nMatchedSp.value() : 0.0)
1135 << "%)");
1136 ATH_MSG_INFO("ValSum ============================================================");
1137 ATH_MSG_INFO("ValSum SPACEPOINT VARIANCE COMPARISON:");
1138 ATH_MSG_INFO("ValSum Spacepoints with >10% variance R difference: "
1139 << m_nSpVarRDiff << " ("
1140 << (m_nMatchedSp.value() > 0 ? 100.0 * m_nSpVarRDiff.value() / m_nMatchedSp.value() : 0.0)
1141 << "%)");
1142 ATH_MSG_INFO("ValSum Spacepoints with >10% variance Z difference: "
1143 << m_nSpVarZDiff << " ("
1144 << (m_nMatchedSp.value() > 0 ? 100.0 * m_nSpVarZDiff.value() / m_nMatchedSp.value() : 0.0)
1145 << "%)");
1146 ATH_MSG_INFO("ValSum ============================================================");
1147 }
1148
1149 return StatusCode::SUCCESS;
1150}
#define ATH_MSG_INFO(x,...)
Gaudi::Accumulators::Counter m_nMatchedSp
Gaudi::Accumulators::Counter m_pix_unmatched_mon
Gaudi::Accumulators::Counter m_strip_pos_diff_barrel
Gaudi::Accumulators::Counter m_strip_pos_diff_EC
Gaudi::Accumulators::Counter m_strip_unmatched_ref
Gaudi::Accumulators::Counter m_nUnmatchedRefSp
Gaudi::Accumulators::Counter m_pixel_pos_diff_0p25sig
Gaudi::Accumulators::Counter m_nSpPosDiff5mm
Gaudi::Accumulators::Counter m_strip_pos_diff_0p5sig
Gaudi::Accumulators::Counter m_nSpVarRDiff
Gaudi::Accumulators::Counter m_matched_pixel
Gaudi::Accumulators::Counter m_nSpVarZDiff
Gaudi::Accumulators::Counter m_nSpPosDiff1mm
Gaudi::Accumulators::Counter m_strip_pos_diff_0p25sig
Gaudi::Accumulators::Counter m_nUnmatchedMonSp
Gaudi::Accumulators::Counter m_strip_pos_diff_1sig
Gaudi::Accumulators::Counter m_pixel_pos_diff_1sig
Gaudi::Accumulators::Counter m_strip_unmatched_mon
Gaudi::Accumulators::Counter m_matched_strip
Gaudi::Accumulators::Counter m_pix_unmatched_ref
Gaudi::Accumulators::Counter m_pixel_pos_diff_0p5sig

◆ initialize()

StatusCode ActsTrk::ActsClusterComparisonAlg::initialize ( )
overridevirtual

Initialize the algorithm.

Definition at line 35 of file ActsClusterComparisonAlg.cxx.

36{
37 ATH_MSG_INFO("ActsClusterComparisonAlg::initialize");
38
41
42 ATH_CHECK(detStore()->retrieve(m_stripID, "SCT_ID"));
43
45
48
51
54
55 ATH_CHECK(m_monCondKey.initialize());
56
59
60 ATH_MSG_INFO("ActsClusterComparisonAlg::initialize complete");
61 return StatusCode::SUCCESS;
62}
SG::ReadHandleKey< xAOD::PixelClusterContainer > m_referencePixelClustersKey
ToolHandle< ISiLorentzAngleTool > m_pixelLorentzAngleTool
SG::ReadHandleKey< xAOD::SpacePointContainer > m_monitoredSpacepointsKey
const ActsTrk::GeometryIdMapping * m_idMapping
SG::ReadHandleKey< xAOD::StripClusterContainer > m_referenceStripClustersKey
SG::ReadHandleKey< xAOD::PixelClusterContainer > m_monitoredPixelClustersKey
Gaudi::Property< std::string > m_stripManagerKey
const InDetDD::PixelDetectorManager * m_pixelManager
SG::ReadHandleKey< xAOD::StripClusterContainer > m_monitoredStripClustersKey
ToolHandle< ISiLorentzAngleTool > m_stripLorentzAngleTool
const InDetDD::SCT_DetectorManager * m_stripManager
SG::ReadCondHandleKey< traccc::detector_conditions_description::host > m_monCondKey
SG::ReadHandleKey< xAOD::SpacePointContainer > m_referenceSpacepointsKey
Gaudi::Property< std::string > m_pixelManagerKey
Gaudi::Property< std::string > m_geoIdMappingObjectName
const ServiceHandle< StoreGateSvc > & detStore() const

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

◆ matchPixelClusters()

void ActsTrk::ActsClusterComparisonAlg::matchPixelClusters ( std::vector< const xAOD::PixelCluster * > & monitored_list,
std::vector< const xAOD::PixelCluster * > & reference_list,
const std::string & module_id,
std::vector< std::pair< const xAOD::PixelCluster *, const xAOD::PixelCluster * > > & pairs ) const
private

Definition at line 85 of file ActsClusterComparisonAlg.cxx.

91{
92
93 // Extract RDO sets
94 std::vector<std::set<Identifier>> monitored_rdo_sets;
95 std::vector<std::set<Identifier>> reference_rdo_sets;
96
97 for (const auto* c : monitored_list) {
98 const auto& rdoListRange = c->rdoList();
99 std::vector<Identifier> rdoList(rdoListRange.begin(), rdoListRange.end());
100 monitored_rdo_sets.emplace_back(rdoList.begin(), rdoList.end());
101 }
102
103 for (const auto* c : reference_list) {
104 const auto& rdoListRange = c->rdoList();
105 std::vector<Identifier> rdoList(rdoListRange.begin(), rdoListRange.end());
106 reference_rdo_sets.emplace_back(rdoList.begin(), rdoList.end());
107 }
108
109 // Match clusters
110 std::vector<std::pair<int, int>> matched_pairs;
111 std::vector<int> unmatched_monitored;
112 std::set<int> unmatched_reference;
113
114 for (size_t j = 0; j < reference_rdo_sets.size(); ++j) {
115 unmatched_reference.insert(j);
116 }
117
118 for (size_t i = 0; i < monitored_rdo_sets.size(); ++i) {
119
120 bool found_match = false;
121 for (size_t j = 0; j < reference_rdo_sets.size(); ++j) {
122 if (monitored_rdo_sets[i] == reference_rdo_sets[j]) {
123 matched_pairs.emplace_back(i, j);
124 pairs.emplace_back(monitored_list.at(i), reference_list.at(j));
125 found_match = true;
126 unmatched_reference.erase(j);
127 break;
128 }
129 }
130 if (!found_match) {
131 unmatched_monitored.push_back(i);
132 }
133 }
134
135 // Report mismatches
136 if (!unmatched_monitored.empty() || !unmatched_reference.empty()) {
137 ATH_MSG_DEBUG("[ERROR] Module " << module_id
138 << ": cluster mismatch detected!");
139 if (!unmatched_monitored.empty()) {
140 ATH_MSG_DEBUG(" Unmatched monitored clusters ("
141 << unmatched_monitored.size() << "):");
142 for (int i : unmatched_monitored) {
143 ATH_MSG_DEBUG(" - #" << i);
144 const xAOD::PixelCluster* monitored_cluster = monitored_list.at(i);
145 const auto& monitored_cov = monitored_cluster->localCovariance<1>();
146
147 ATH_MSG_DEBUG("Detailed print of cluster: ");
148
149 ATH_MSG_DEBUG("Local position: ");
151 " Monitored: ("
152 << monitored_cluster->localPosition<2>()[Trk::locX] << ", "
153 << monitored_cluster->localPosition<2>()[Trk::locY] << ")");
154
155 ATH_MSG_DEBUG("Cluster cov: ");
156 ATH_MSG_DEBUG(" Monitored: (" << monitored_cov(0, 0) << ", "
157 << monitored_cov(1, 1) << ")");
158 }
159 m_pix_unmatched_mon+= unmatched_monitored.size();
160 }
161 if (!unmatched_reference.empty()) {
162 ATH_MSG_DEBUG(" Unmatched reference clusters (" << unmatched_reference.size()
163 << "):");
164 for (int j : unmatched_reference) {
165 ATH_MSG_DEBUG(" - #" << j);
166 const xAOD::PixelCluster* reference_cluster = reference_list.at(j);
167 const auto& reference_cov = reference_cluster->localCovariance<1>();
168
169 ATH_MSG_DEBUG("Detailed print of cluster: ");
170
171 ATH_MSG_DEBUG("Local position: ");
172
173 ATH_MSG_DEBUG(" Reference: ("
174 << reference_cluster->localPosition<2>()[Trk::locX] << ", "
175 << reference_cluster->localPosition<2>()[Trk::locY]
176 << ")");
177
178 ATH_MSG_DEBUG("Cluster cov: ");
179
180 ATH_MSG_DEBUG(" Reference: (" << reference_cov(0, 0) << ", "
181 << reference_cov(1, 1) << ")");
182 }
183 m_pix_unmatched_ref+= unmatched_reference.size();
184 }
185 ATH_MSG_DEBUG("------------------------------------------------------------");
186 }
187}
#define ATH_MSG_DEBUG(x,...)
ConstMatrixMap< N > localCovariance() const
Returns the local covariance of the measurement.
ConstVectorMap< N > localPosition() const
Returns the local position of the measurement.
float j(const xAOD::IParticle &, const xAOD::TrackMeasurementValidation &hit, const Eigen::Matrix3d &jab_inv)
@ locY
local cartesian
Definition ParamDefs.h:38
@ locX
Definition ParamDefs.h:37
PixelCluster_v1 PixelCluster
Define the version of the pixel cluster class.

◆ matchStripClusters()

void ActsTrk::ActsClusterComparisonAlg::matchStripClusters ( std::vector< const xAOD::StripCluster * > & monitored_list,
std::vector< const xAOD::StripCluster * > & reference_list,
const std::string & module_id,
std::vector< std::pair< const xAOD::StripCluster *, const xAOD::StripCluster * > > & pairs ) const
private

Definition at line 190 of file ActsClusterComparisonAlg.cxx.

196{
197
198 // Extract RDO sets
199 std::vector<std::set<Identifier>> monitored_rdo_sets;
200 std::vector<std::set<Identifier>> reference_rdo_sets;
201
202 for (const auto* c : monitored_list) {
203 const auto& rdoListRange = c->rdoList();
204 std::vector<Identifier> rdoList(rdoListRange.begin(), rdoListRange.end());
205 monitored_rdo_sets.emplace_back(rdoList.begin(), rdoList.end());
206 }
207
208 for (const auto* c : reference_list) {
209 const auto& rdoListRange = c->rdoList();
210 std::vector<Identifier> rdoList(rdoListRange.begin(), rdoListRange.end());
211 reference_rdo_sets.emplace_back(rdoList.begin(), rdoList.end());
212 }
213
214 // Match clusters
215 std::vector<std::pair<int, int>> matched_pairs;
216 std::vector<int> unmatched_monitored;
217 std::set<int> unmatched_reference;
218
219 for (size_t j = 0; j < reference_rdo_sets.size(); ++j) {
220 unmatched_reference.insert(j);
221 }
222
223 for (size_t i = 0; i < monitored_rdo_sets.size(); ++i) {
224 bool found_match = false;
225 for (size_t j = 0; j < reference_rdo_sets.size(); ++j) {
226 if (monitored_rdo_sets[i] == reference_rdo_sets[j]) {
227 matched_pairs.emplace_back(i, j);
228 pairs.emplace_back(monitored_list.at(i), reference_list.at(j));
229 found_match = true;
230 unmatched_reference.erase(j);
231 break;
232 }
233 }
234 if (!found_match) {
235 unmatched_monitored.push_back(i);
236 }
237 }
238
239 // Report mismatches
240 if (!unmatched_monitored.empty() || !unmatched_reference.empty()) {
241 ATH_MSG_DEBUG("[ERROR] Module " << module_id
242 << ": cluster mismatch detected!");
243 if (!unmatched_monitored.empty()) {
244 ATH_MSG_DEBUG(" Unmatched monitored clusters ("
245 << unmatched_monitored.size() << "):");
246 for (int i : unmatched_monitored) {
247 ATH_MSG_DEBUG(" - #" << i);
248 const xAOD::StripCluster* monitored_cluster = monitored_list.at(i);
249 const auto& monitored_cov = monitored_cluster->localCovariance<1>();
250
251 ATH_MSG_DEBUG("Detailed print of cluster: ");
252
253 ATH_MSG_DEBUG("Local position: ");
255 " Monitored: ("
256 << monitored_cluster->localPosition<1>()[Trk::locX] << ")");
257
258 ATH_MSG_DEBUG("Cluster cov: ");
259 ATH_MSG_DEBUG(" Monitored: (" << monitored_cov(0, 0) << ")");
260 }
261 m_strip_unmatched_mon+= unmatched_monitored.size();
262 }
263 if (!unmatched_reference.empty()) {
264 ATH_MSG_DEBUG(" Unmatched reference clusters (" << unmatched_reference.size()
265 << "):");
266 for (int j : unmatched_reference) {
267 ATH_MSG_DEBUG(" - #" << j);
268 const xAOD::StripCluster* reference_cluster = reference_list.at(j);
269 const auto& reference_cov = reference_cluster->localCovariance<1>();
270
271 ATH_MSG_DEBUG("Detailed print of cluster: ");
272
273 ATH_MSG_DEBUG("Local position: ");
274
275 ATH_MSG_DEBUG(" Reference: ("
276 << reference_cluster->localPosition<1>()[Trk::locX] << ")");
277
278 ATH_MSG_DEBUG("Cluster cov: ");
279
280 ATH_MSG_DEBUG(" Reference: (" << reference_cov(0, 0) << ")");
281 }
282 m_strip_unmatched_ref+= unmatched_reference.size();
283 }
284 ATH_MSG_DEBUG("------------------------------------------------------------");
285 }
286}
StripCluster_v1 StripCluster
Define the version of the strip cluster class.

◆ msg()

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msgLvl()

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

Definition at line 30 of file AthCommonMsg.h.

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

◆ outputHandles()

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

Return this algorithm's output handles.

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

◆ renounce()

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

Definition at line 368 of file AthCommonDataStore.h.

369 {
370 h.renounce();
372 }
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 352 of file AthCommonDataStore.h.

352 {
354 }

◆ setFilterPassed()

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

Set filter decision:

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

◆ tracccCellPosition()

std::optional< std::array< float, 2 > > ActsTrk::ActsClusterComparisonAlg::tracccCellPosition ( const Identifier & athenaId,
unsigned int channel0,
unsigned int channel1,
const traccc::detector_design_description::host & design,
const traccc::detector_conditions_description::host & cond ) const
private

Centre of the traccc readout bin (channel0, channel1) on the given Athena module, computed like traccc::details::position_from_cell from the host design description.

Definition at line 300 of file ActsClusterComparisonAlg.cxx.

304{
305 const auto detrayId = m_idMapping->athenaToDetray(athenaId);
306 if (!detrayId) return std::nullopt;
307 const auto condIndex = m_idMapping->detrayToDetDescIndex(*detrayId);
308 if (!condIndex || *condIndex >= cond.size()) return std::nullopt;
309 const unsigned int designIndex = cond.module_to_design_id()[*condIndex];
310 if (designIndex >= design.size()) return std::nullopt;
311 const auto& edgesX = design.bin_edges_x()[designIndex];
312 const auto& edgesY = design.bin_edges_y()[designIndex];
313 if (channel0 + 1 >= edgesX.size() || channel1 + 1 >= edgesY.size()) return std::nullopt;
314 return std::array<float, 2>{
315 0.5f * static_cast<float>(edgesX[channel0] + edgesX[channel0 + 1]),
316 0.5f * static_cast<float>(edgesY[channel1] + edgesY[channel1 + 1])};
317}

◆ tracccLorentzShift()

std::optional< std::pair< float, float > > ActsTrk::ActsClusterComparisonAlg::tracccLorentzShift ( const Identifier & athenaId,
const traccc::detector_conditions_description::host & cond ) const
private

Lorentz shift stored in the traccc host conditions object for the given Athena module (side).

Definition at line 288 of file ActsClusterComparisonAlg.cxx.

291{
292 const auto detrayId = m_idMapping->athenaToDetray(athenaId);
293 if (!detrayId) return std::nullopt;
294 const auto condIndex = m_idMapping->detrayToDetDescIndex(*detrayId);
295 if (!condIndex || *condIndex >= cond.size()) return std::nullopt;
296 const auto& shift = cond.measurement_translation()[*condIndex];
297 return std::make_pair(static_cast<float>(shift[0]), static_cast<float>(shift[1]));
298}
virtual void shift(size_t pos, ptrdiff_t offs) override
Shift the elements of the container.

◆ updateVHKA()

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

Definition at line 298 of file AthCommonDataStore.h.

298 {
299 for (auto &a : m_vhka) {
301 for (auto k : keys) {
302 k->setOwner(this);
303 }
304 }
305 }

◆ validateClusters()

StatusCode ActsTrk::ActsClusterComparisonAlg::validateClusters ( const EventContext & eventContext,
std::unordered_map< const xAOD::PixelCluster *, const xAOD::PixelCluster * > & pixel_cluster_matches,
std::unordered_map< const xAOD::StripCluster *, const xAOD::StripCluster * > & strip_cluster_matches ) const
private

Definition at line 319 of file ActsClusterComparisonAlg.cxx.

321{
322
324 "============================================================");
325 // retrieve the clusters in form of xAOD containers
326 ATH_MSG_INFO("Reading monitored clusters: " << m_monitoredPixelClustersKey.key()
327 << " and "
329 ATH_MSG_INFO("Reading reference clusters: " << m_referencePixelClustersKey.key()
330 << " and "
333 "============================================================");
334
335 SG::ReadHandle<xAOD::PixelClusterContainer> monitoredPixelClustersHandle =
337 ATH_CHECK(monitoredPixelClustersHandle.isValid());
338 const xAOD::PixelClusterContainer* monitoredPixelClusters =
339 monitoredPixelClustersHandle.cptr();
340
341 SG::ReadHandle<xAOD::StripClusterContainer> monitoredStripClustersHandle =
343 ATH_CHECK(monitoredStripClustersHandle.isValid());
344 const xAOD::StripClusterContainer* monitoredStripClusters =
345 monitoredStripClustersHandle.cptr();
346
347 SG::ReadHandle<xAOD::PixelClusterContainer> referencePixelClustersHandle =
349 ATH_CHECK(referencePixelClustersHandle.isValid());
350 const xAOD::PixelClusterContainer* referencePixelClusters =
351 referencePixelClustersHandle.cptr();
352
353 SG::ReadHandle<xAOD::StripClusterContainer> referenceStripClustersHandle =
355 ATH_CHECK(referenceStripClustersHandle.isValid());
356 const xAOD::StripClusterContainer* referenceStripClusters =
357 referenceStripClustersHandle.cptr();
358
359 const traccc::detector_design_description::host* monDesign = nullptr;
360 ATH_CHECK(detStore()->retrieve(monDesign, m_monDesignObjectName.value()));
361
362 const traccc::detector_conditions_description::host* monCond{};
363 ATH_CHECK(SG::get(monCond,m_monCondKey, eventContext));
364
365 size_t t_n_pixel = monitoredPixelClusters->size();
366 size_t t_n_strip = monitoredStripClusters->size();
367 size_t a_n_pixel = referencePixelClusters->size();
368 size_t a_n_strip = referenceStripClusters->size();
369
370 ATH_MSG_DEBUG(" Monitored/reference pixel clusters " << t_n_pixel << " / "
371 << a_n_pixel);
372 ATH_MSG_DEBUG(" Monitored/reference strip clusters " << t_n_strip << " / "
373 << a_n_strip);
374
375 if (t_n_pixel != a_n_pixel) {
376 ATH_MSG_ERROR("Mismatched pixel cluster numbers found!");
377 ATH_MSG_ERROR(" Monitored/reference clusters " << t_n_pixel << " / "
378 << a_n_pixel);
379 return StatusCode::FAILURE;
380 }
381 if (t_n_strip != a_n_strip) {
382 ATH_MSG_ERROR("Mismatched strip cluster numbers found!");
383 ATH_MSG_ERROR(" Monitored/reference clusters " << t_n_strip << " / "
384 << a_n_strip);
385 return StatusCode::FAILURE;
386 }
387
388 // Group by module
389 std::map<std::string, std::vector<const xAOD::PixelCluster*>>
390 monitored_pixel_map, reference_pixel_map;
391 std::map<std::string, std::vector<const xAOD::StripCluster*>>
392 monitored_strip_map, reference_strip_map;
393
394 for (const auto* c : *monitoredPixelClusters) {
395 monitored_pixel_map[std::to_string(c->identifierHash())].push_back(c);
396 }
397 for (const auto* c : *monitoredStripClusters) {
398 monitored_strip_map[std::to_string(c->identifierHash())].push_back(c);
399 }
400 for (const auto* c : *referencePixelClusters) {
401 reference_pixel_map[std::to_string(c->identifierHash())].push_back(c);
402 }
403 for (const auto* c : *referenceStripClusters) {
404 reference_strip_map[std::to_string(c->identifierHash())].push_back(c);
405 }
406
407 // Collect all module IDs
408 std::set<std::string> pixel_modules, strip_modules;
409 for (const auto& [key, _] : monitored_pixel_map)
410 pixel_modules.insert(key);
411 for (const auto& [key, _] : reference_pixel_map)
412 pixel_modules.insert(key);
413 for (const auto& [key, _] : monitored_strip_map)
414 strip_modules.insert(key);
415 for (const auto& [key, _] : reference_strip_map)
416 strip_modules.insert(key);
417
418 int pixel_unequal = 0, strip_unequal = 0;
419 int matched_pixel = 0, matched_strip = 0;
420 int pixel_pos_diff_0p5sig = 0;
421 int pixel_pos_diff_0p25sig = 0;
422 int pixel_pos_diff_1sig = 0;
423 int strip_pos_diff_0p5sig = 0;
424 int strip_pos_diff_0p25sig = 0;
425 int strip_pos_diff_1sig = 0;
426 int strip_pos_diff_barrel = 0;
427 int strip_pos_diff_EC = 0;
428
429 ATH_MSG_DEBUG("Pixel/Strip modules " << pixel_modules.size() << " / "
430 << strip_modules.size());
431 ATH_MSG_DEBUG("Pixel cluster validation: ");
433 "============================================================");
434
435 // Process pixel modules
436 for (const auto& hid : pixel_modules) {
437 auto& tpixel = monitored_pixel_map[hid];
438 auto& apixel = reference_pixel_map[hid];
439
440 if (tpixel.empty() && apixel.empty())
441 continue;
442
443 if (tpixel.size() != apixel.size()) {
444 ATH_MSG_DEBUG("[ERROR] Pixel Module " << hid
445 << ": mismatched clusters found!");
446 ATH_MSG_DEBUG(" Reference found " << apixel.size()
447 << " and monitored found " << tpixel.size() << " clusters!");
448 pixel_unequal++;
449 continue;
450 }
451
452 std::vector<
453 std::pair<const xAOD::PixelCluster*, const xAOD::PixelCluster*>>
454 pixel_pairs;
455 matchPixelClusters(tpixel, apixel, hid, pixel_pairs);
456
457 matched_pixel += pixel_pairs.size();
458
459 // Add matched pairs and check position differences
460 for (const auto& pair : pixel_pairs) {
461 const xAOD::PixelCluster* monitored_cluster = pair.first;
462 const xAOD::PixelCluster* reference_cluster = pair.second;
463
464 (pixel_cluster_matches)[pair.first] = pair.second;
465
466 // Calculate local position difference
467 double l_dx = monitored_cluster->localPosition<2>()[Trk::locX] -
468 reference_cluster->localPosition<2>()[Trk::locX];
469 double l_dy = monitored_cluster->localPosition<2>()[Trk::locY] -
470 reference_cluster->localPosition<2>()[Trk::locY];
471 double l_pos_diff = std::sqrt(l_dx * l_dx + l_dy * l_dy);
472
473 // Calculate global position difference
474 float g_dx = (monitored_cluster->globalPosition()).x() -
475 (reference_cluster->globalPosition()).x();
476 float g_dy = (monitored_cluster->globalPosition()).y() -
477 (reference_cluster->globalPosition()).y();
478 float g_dz = (monitored_cluster->globalPosition()).z() -
479 (reference_cluster->globalPosition()).z();
480 float g_pos_diff =
481 std::sqrt(g_dx * g_dx + g_dy * g_dy + g_dz * g_dz);
482
483 // Calculate error difference
484 Eigen::Matrix<float, 2, 2> monitored_cov =
485 monitored_cluster->localCovariance<2>();
486 Eigen::Matrix<float, 2, 2> reference_cov =
487 reference_cluster->localCovariance<2>();
488
489 const InDetDD::SiDetectorElement* monitored_element =
490 m_pixelManager->getDetectorElement(
491 monitored_cluster->identifierHash());
492 const InDetDD::PixelModuleDesign& design =
493 static_cast<const InDetDD::PixelModuleDesign&>(
494 monitored_element->design());
495
496 const Identifier monitored_Pixel_ModuleID =
497 monitored_element->identify();
498 double monitored_lorentz_shift =
499 m_pixelLorentzAngleTool->getLorentzShift(
500 monitored_element->identifyHash(), eventContext);
501
502
503 if (std::abs(l_dx / (std::sqrt(reference_cov(0, 0)))) > 0.25 ||
504 std::abs(l_dy / (std::sqrt(reference_cov(1, 1)))) > 0.25) {
505 pixel_pos_diff_0p25sig++;
506
507 ATH_MSG_DEBUG("Detailed print of cluster discrepancy: ");
508 ATH_MSG_DEBUG("On module: " << monitored_Pixel_ModuleID);
509 ATH_MSG_DEBUG("Lorentz shift: " << std::fixed << std::setprecision(9) << monitored_lorentz_shift);
510 if (auto tracccShift = tracccLorentzShift(monitored_Pixel_ModuleID, *monCond)) {
511 ATH_MSG_DEBUG("Lorentz shift (traccc conditions): " << tracccShift->first);
512 ATH_MSG_DEBUG(" Δshift = " << tracccShift->first - monitored_lorentz_shift);
513 } else {
514 ATH_MSG_DEBUG("Lorentz shift (traccc conditions): not found for module " << monitored_Pixel_ModuleID);
515 }
516
517
518 ATH_MSG_DEBUG("Local position: ");
520 " Monitored: ("
521 << monitored_cluster->localPosition<2>()[Trk::locX] << ", "
522 << monitored_cluster->localPosition<2>()[Trk::locY] << ")");
523 ATH_MSG_DEBUG(" Reference: ("
524 << reference_cluster->localPosition<2>()[Trk::locX] << ", "
525 << reference_cluster->localPosition<2>()[Trk::locY]
526 << ")");
527 ATH_MSG_DEBUG(" Δx = " << l_dx << ", Δy = " << l_dy
528 << ", Δr = " << l_pos_diff);
529 ATH_MSG_DEBUG("Cluster cov: ");
530 ATH_MSG_DEBUG(" Monitored: (" << monitored_cov(0, 0) << ", "
531 << monitored_cov(1, 1) << ")");
532 ATH_MSG_DEBUG(" Reference: (" << reference_cov(0, 0) << ", "
533 << reference_cov(1, 1) << ")");
534 ATH_MSG_DEBUG(" Δx = " << monitored_cov(0, 0) - reference_cov(0, 0)
535 << ", Δy = "
536 << monitored_cov(1, 1) - reference_cov(1, 1));
537
538
539 const auto& rdoListRange = monitored_cluster->rdoList();
540 std::vector<Identifier> monitored_rdoList(
541 rdoListRange.begin(), rdoListRange.end());
542 for (auto rdoIter : monitored_rdoList) {
543 const InDetDD::SiCellId& chargeCellId =
544 monitored_element->cellIdFromIdentifier(rdoIter);
545 std::array<InDetDD::PixelDiodeTree::CellIndexType, 2>
547 chargeCellId.phiIndex(), chargeCellId.etaIndex());
548
549 InDetDD::PixelDiodeTree::DiodeProxyWithPosition si_param(
550 design.diodeProxyFromIdxCachePosition(diode_idx));
551 ATH_MSG_DEBUG("hit id for this cell: "
552 << chargeCellId
553 << ", position: " << si_param.position()[0]
554 << ", " << si_param.position()[1]);
555 // traccc cells use channel0 = phi index, channel1 = eta index for pixels
556 if (auto tracccPos = tracccCellPosition(monitored_Pixel_ModuleID,
557 chargeCellId.phiIndex(), chargeCellId.etaIndex(),
558 *monDesign, *monCond)) {
559 ATH_MSG_DEBUG(" traccc position for this cell: " << (*tracccPos)[0]
560 << ", " << (*tracccPos)[1]
561 << " (Δ = " << (*tracccPos)[0] - si_param.position()[0]
562 << ", " << (*tracccPos)[1] - si_param.position()[1] << ")");
563 } else {
564 ATH_MSG_DEBUG(" traccc position for this cell: not found");
565 }
566 }
567
568 // Calculate width difference
569 ATH_MSG_DEBUG("Cluster width: ");
570 ATH_MSG_DEBUG(" Monitored phi/eta channels, eta width: ("
571 << monitored_cluster->channelsInPhi() << ", "
572 << monitored_cluster->channelsInEta() << ", "
573 << monitored_cluster->widthInEta() << ")");
574 ATH_MSG_DEBUG(" Reference phi/eta channels, eta width: ("
575 << reference_cluster->channelsInPhi() << ", "
576 << reference_cluster->channelsInEta() << ", "
577 << reference_cluster->widthInEta() << ")");
578
579 ATH_MSG_DEBUG(" Δphi = " << monitored_cluster->channelsInPhi() -
580 reference_cluster->channelsInPhi()
581 << ", Δeta = "
582 << monitored_cluster->channelsInEta() -
583 reference_cluster->channelsInEta()
584 << ", Δwidth = "
585 << monitored_cluster->widthInEta() -
586 reference_cluster->widthInEta());
587 }
588 if (std::abs(l_dx / (std::sqrt(reference_cov(0, 0)))) > 0.5 ||
589 std::abs(l_dy / (std::sqrt(reference_cov(1, 1)))) > 0.5) {
590 pixel_pos_diff_0p5sig++;
591 }
592 if (std::abs(l_dx / (std::sqrt(reference_cov(0, 0)))) > 1 ||
593 std::abs(l_dy / (std::sqrt(reference_cov(1, 1)))) > 1) {
594 pixel_pos_diff_1sig++;
595 }
596
597
598 ATH_MSG_VERBOSE("Global position: ");
599 ATH_MSG_VERBOSE(" Monitored: ("
600 << (monitored_cluster->globalPosition()).x() << ", "
601 << (monitored_cluster->globalPosition()).y() << ", "
602 << (monitored_cluster->globalPosition()).z() << ")");
603 ATH_MSG_VERBOSE(" Reference: ("
604 << (reference_cluster->globalPosition()).x() << ", "
605 << (reference_cluster->globalPosition()).y() << ", "
606 << (reference_cluster->globalPosition()).z() << ")");
607 ATH_MSG_VERBOSE(" Δx = " << g_dx << ", Δy = " << g_dy << ", Δz = "
608 << g_dz << ", Δr = " << g_pos_diff);
609
610 }
611 }
612
614 "============================================================");
615 ATH_MSG_DEBUG("Strip cluster validation: ");
617 "============================================================");
618 // Process strip modules
619 for (const auto& hid : strip_modules) {
620 auto& tstrip = monitored_strip_map[hid];
621 auto& astrip = reference_strip_map[hid];
622
623 if (tstrip.empty() && astrip.empty())
624 continue;
625
626 if (tstrip.size() != astrip.size()) {
627 ATH_MSG_DEBUG("[ERROR] Strip Module "
628 << hid << ": mismatched clusters found!");
629 ATH_MSG_DEBUG(" Reference found " << astrip.size()
630 << " and monitored found "
631 << tstrip.size() << " clusters!");
632 strip_unequal++;
633 continue;
634 }
635
636 std::vector<
637 std::pair<const xAOD::StripCluster*, const xAOD::StripCluster*>>
638 strip_pairs;
639 matchStripClusters(tstrip, astrip, hid, strip_pairs);
640
641 matched_strip += strip_pairs.size();
642
643 // Add matched pairs and check position differences
644 for (const auto& pair : strip_pairs) {
645 const xAOD::StripCluster* monitored_cluster = pair.first;
646 const xAOD::StripCluster* reference_cluster = pair.second;
647
648 (strip_cluster_matches)[pair.first] = pair.second;
649
650 // Calculate position difference
651 double pos_diff = monitored_cluster->localPosition<1>()[Trk::locX] -
652 reference_cluster->localPosition<1>()[Trk::locX];
653
654
655 // Calculate error difference
656 Eigen::Matrix<float, 1, 1> monitored_cov =
657 monitored_cluster->localCovariance<1>();
658 Eigen::Matrix<float, 1, 1> reference_cov =
659 reference_cluster->localCovariance<1>();
660
661 const InDetDD::SiDetectorElement* monitored_element =
662 m_stripManager->getDetectorElement(monitored_cluster->identifierHash());
663
664
665 if (std::abs(pos_diff / (std::sqrt(reference_cov(0, 0)))) > 0.25) {
666 strip_pos_diff_0p25sig++;
667
668 int side = m_stripID->side(monitored_element->identify());
669 const Identifier strip_moduleID = m_stripID->module_id(monitored_element->identify());
670
671 if (m_stripID->barrel_ec(strip_moduleID) == 0) strip_pos_diff_barrel++;
672 else strip_pos_diff_EC++;
673
674 const IdentifierHash Strip_ModuleHash = m_stripID->wafer_hash(strip_moduleID);
675 double monitored_lorentz_shift =
676 m_stripLorentzAngleTool->getLorentzShift(Strip_ModuleHash + side, eventContext);
677
678 ATH_MSG_DEBUG("Detailed print of cluster discrepancy: ");
679 ATH_MSG_DEBUG("On module: " << strip_moduleID << ", side: " << m_stripID->side(monitored_element->identify()));
680 ATH_MSG_DEBUG("Lorentz shift: " << std::fixed << std::setprecision(9) << monitored_lorentz_shift);
681 // conditions object is keyed by the wafer (side) id, as in DeviceDetectorDescriptionCondAlg
682 const Identifier strip_waferID = m_stripID->wafer_id(Strip_ModuleHash + side);
683 if (auto tracccShift = tracccLorentzShift(strip_waferID, *monCond)) {
684 ATH_MSG_DEBUG("Lorentz shift (traccc conditions): " << tracccShift->first);
685 ATH_MSG_DEBUG(" Δshift = " << tracccShift->first - monitored_lorentz_shift);
686 } else {
687 ATH_MSG_DEBUG("Lorentz shift (traccc conditions): not found for wafer " << strip_waferID);
688 }
689
690 ATH_MSG_DEBUG("Local position: ");
692 " Monitored: ("
693 << monitored_cluster->localPosition<1>()[Trk::locX] << ")");
694 ATH_MSG_DEBUG(" Reference: ("
695 << reference_cluster->localPosition<1>()[Trk::locX] << ")");
696 ATH_MSG_DEBUG(" Δx = " << pos_diff );
697 ATH_MSG_DEBUG("Cluster cov: ");
698 ATH_MSG_DEBUG(" Monitored: (" << monitored_cov(0, 0) << ")");
699 ATH_MSG_DEBUG(" Reference: (" << reference_cov(0, 0) << ")");
700 ATH_MSG_DEBUG(" Δx = " << monitored_cov(0, 0) - reference_cov(0, 0));
701
702 const auto& rdoListRange = monitored_cluster->rdoList();
703 std::vector<Identifier> monitored_rdoList(
704 rdoListRange.begin(), rdoListRange.end());
705
706 if (monitored_element->isBarrel()) {
707 const InDetDD::SCT_BarrelModuleSideDesign* s_design = (static_cast<const InDetDD::SCT_BarrelModuleSideDesign*>(&monitored_element->design()));
708
709 for (auto rdoIter : monitored_rdoList) {
710 const InDetDD::SiCellId& chargeCellId =
711 monitored_element->cellIdFromIdentifier(rdoIter);
712 InDetDD::SiLocalPosition si_pos =
713 s_design->localPositionOfCell(chargeCellId);
714 Amg::Vector2D loc_pos(si_pos.xPhi(), si_pos.xEta());
715 ATH_MSG_DEBUG("hit id for this cell: "
716 << chargeCellId
717 << ", position: " << loc_pos[0]
718 << ", " << loc_pos[1]);
719 // barrel: traccc channel0 = strip, measured coordinate is local x
720 const int strip = m_stripID->strip(rdoIter);
721 if (auto tracccPos = tracccCellPosition(strip_waferID, strip, 0, *monDesign, *monCond)) {
722 ATH_MSG_DEBUG(" traccc position for this cell (strip " << strip << "): "
723 << (*tracccPos)[0]
724 << " (Δ = " << (*tracccPos)[0] - loc_pos[0] << ")");
725 } else {
726 ATH_MSG_DEBUG(" traccc position for this cell (strip " << strip << "): not found");
727 }
728 }
729
730 }else{
731
732 const InDetDD::StripStereoAnnulusDesign* annulus_design = (static_cast<const InDetDD::StripStereoAnnulusDesign*>(&monitored_element->design()));
733
734 for (auto rdoIter : monitored_rdoList) {
735 const InDetDD::SiCellId& chargeCellId =
736 monitored_element->cellIdFromIdentifier(rdoIter);
737
738 InDetDD::SiLocalPosition si_pos =
739 annulus_design->localPositionOfCell(chargeCellId);
740 Amg::Vector2D loc_pos(si_pos.xPhi(), si_pos.xEta());
741 // polar-coordinate position, i.e. the frame the cluster localPosition is stored in
742 const InDetDD::SiLocalPosition pc_pos =
743 annulus_design->localPositionOfCellPC(chargeCellId);
744 ATH_MSG_DEBUG("hit id for this cell: "
745 << chargeCellId
746 << ", position: " << loc_pos[0]
747 << ", " << loc_pos[1]
748 << ", polar (phi, r): " << pc_pos.xPhi()
749 << ", " << pc_pos.xEta());
750 // endcap: traccc channel1 = strip, measured coordinate is local y (phi)
751 const int strip = m_stripID->strip(rdoIter);
752 if (auto tracccPos = tracccCellPosition(strip_waferID, 0, strip, *monDesign, *monCond)) {
753 ATH_MSG_DEBUG(" traccc position for this cell (strip " << strip << "): "
754 << (*tracccPos)[1]
755 << " (Δphi = " << (*tracccPos)[1] - pc_pos.xPhi() << ")");
756 } else {
757 ATH_MSG_DEBUG(" traccc position for this cell (strip " << strip << "): not found");
758 }
759 }
760
761 }
762
763 // Calculate width difference
764 ATH_MSG_DEBUG("Cluster width: ");
765 ATH_MSG_DEBUG(" Monitored phi channels: ("
766 << monitored_cluster->channelsInPhi() << ")");
767 ATH_MSG_DEBUG(" Reference phi channels: ("
768 << reference_cluster->channelsInPhi() << ")");
769
770 ATH_MSG_DEBUG(" Δphi = " << monitored_cluster->channelsInPhi() -
771 reference_cluster->channelsInPhi());
772
773 }
774 if (std::abs(pos_diff / (std::sqrt(reference_cov(0, 0)))) > 0.5) {
775 strip_pos_diff_0p5sig++;
776 }
777 if (std::abs(pos_diff / (std::sqrt(reference_cov(0, 0)))) > 1) {
778 strip_pos_diff_1sig++;
779 }
780
781 }
782 }
783
785 "============================================================");
786
787 // Print statistics
789 "============================================================");
790 ATH_MSG_DEBUG("PIXEL CLUSTER MATCHING STATISTICS: ");
791 ATH_MSG_DEBUG(" Total matched clusters: " << matched_pixel);
792 ATH_MSG_DEBUG(" Clusters with pos diff > 1 sigma: "
793 << pixel_pos_diff_1sig << " ("
794 << (matched_pixel > 0
795 ? 100.0 * pixel_pos_diff_1sig / matched_pixel
796 : 0.0)
797 << "%)");
798 ATH_MSG_DEBUG(" Clusters with pos diff > 0.5 sigma: "
799 << pixel_pos_diff_0p5sig << " ("
800 << (matched_pixel > 0
801 ? 100.0 * pixel_pos_diff_0p5sig / matched_pixel
802 : 0.0)
803 << "%)");
804 ATH_MSG_DEBUG(" Clusters with pos diff > 0.25 sigma: "
805 << pixel_pos_diff_0p25sig << " ("
806 << (matched_pixel > 0
807 ? 100.0 * pixel_pos_diff_0p25sig / matched_pixel
808 : 0.0)
809 << "%)");
811 "============================================================");
813 "============================================================");
814 ATH_MSG_DEBUG("STRIP CLUSTER MATCHING STATISTICS:");
815 ATH_MSG_DEBUG(" Total matched clusters: " << matched_strip);
816 ATH_MSG_DEBUG(" Clusters with pos diff > 1 sigma: "
817 << strip_pos_diff_1sig << " ("
818 << (matched_strip > 0
819 ? 100.0 * strip_pos_diff_1sig / matched_strip
820 : 0.0)
821 << "%)");
822 ATH_MSG_DEBUG(" Clusters with pos diff > 0.5 sigma: "
823 << strip_pos_diff_0p5sig << " ("
824 << (matched_strip > 0
825 ? 100.0 * strip_pos_diff_0p5sig / matched_strip
826 : 0.0)
827 << "%)");
828 ATH_MSG_DEBUG(" Clusters with pos diff > 0.25 sigma: "
829 << strip_pos_diff_0p25sig << " ("
830 << (matched_strip > 0
831 ? 100.0 * strip_pos_diff_0p25sig / matched_strip
832 : 0.0)
833 << "%)");
835 "============================================================");
836
837 m_pixel_unequal += pixel_unequal;
838 m_strip_unequal += strip_unequal;
839 m_matched_pixel += matched_pixel;
840 m_matched_strip += matched_strip;
841 m_pixel_pos_diff_1sig += pixel_pos_diff_1sig;
842 m_pixel_pos_diff_0p5sig += pixel_pos_diff_0p5sig;
843 m_pixel_pos_diff_0p25sig += pixel_pos_diff_0p25sig;
844 m_strip_pos_diff_1sig += strip_pos_diff_1sig;
845 m_strip_pos_diff_0p5sig += strip_pos_diff_0p5sig;
846 m_strip_pos_diff_0p25sig += strip_pos_diff_0p25sig;
847 m_strip_pos_diff_EC += strip_pos_diff_EC;
848 m_strip_pos_diff_barrel += strip_pos_diff_barrel;
849
850 return StatusCode::SUCCESS;
851}
#define ATH_MSG_VERBOSE(x,...)
void matchPixelClusters(std::vector< const xAOD::PixelCluster * > &monitored_list, std::vector< const xAOD::PixelCluster * > &reference_list, const std::string &module_id, std::vector< std::pair< const xAOD::PixelCluster *, const xAOD::PixelCluster * > > &pairs) const
Gaudi::Accumulators::Counter m_pixel_unequal
std::optional< std::pair< float, float > > tracccLorentzShift(const Identifier &athenaId, const traccc::detector_conditions_description::host &cond) const
Lorentz shift stored in the traccc host conditions object for the given Athena module (side).
Gaudi::Property< std::string > m_monDesignObjectName
std::optional< std::array< float, 2 > > tracccCellPosition(const Identifier &athenaId, unsigned int channel0, unsigned int channel1, const traccc::detector_design_description::host &design, const traccc::detector_conditions_description::host &cond) const
Centre of the traccc readout bin (channel0, channel1) on the given Athena module, computed like tracc...
Gaudi::Accumulators::Counter m_strip_unequal
void matchStripClusters(std::vector< const xAOD::StripCluster * > &monitored_list, std::vector< const xAOD::StripCluster * > &reference_list, const std::string &module_id, std::vector< std::pair< const xAOD::StripCluster *, const xAOD::StripCluster * > > &pairs) const
size_type size() const noexcept
Returns the number of elements in the collection.
static constexpr std::array< PixelDiodeTree::CellIndexType, 2 > makeCellIndex(T local_x_idx, T local_y_idx)
Create a 2D cell index from the indices in local-x (phi, row) and local-y (eta, column) direction.
PixelDiodeTree::DiodeProxyWithPosition diodeProxyFromIdxCachePosition(const std::array< PixelDiodeTree::IndexType, 2 > &idx) const
virtual SiLocalPosition localPositionOfCell(const SiCellId &cellId) const
id -> position
int phiIndex() const
Get phi index. Equivalent to strip().
Definition SiCellId.h:122
int etaIndex() const
Get eta index.
Definition SiCellId.h:114
virtual SiCellId cellIdFromIdentifier(const Identifier &identifier) const override final
SiCellId from Identifier.
virtual const SiDetectorDesign & design() const override final
access to the local description (inline):
double xPhi() const
position along phi direction:
double xEta() const
position along eta direction:
virtual IdentifierHash identifyHash() const override final
identifier hash (inline)
virtual Identifier identify() const override final
identifier of this detector element (inline)
virtual SiLocalPosition localPositionOfCell(const SiCellId &cellId) const override
id -> position
SiLocalPosition localPositionOfCellPC(const SiCellId &cellId) const
This is for debugging only.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type cptr()
Dereference the pointer.
Eigen::Matrix< double, 2, 1 > Vector2D
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
PixelClusterContainer_v1 PixelClusterContainer
Define the version of the pixel cluster container.
StripClusterContainer_v1 StripClusterContainer
Define the version of the strip cluster container.

◆ validatePixelSpacepoints()

StatusCode ActsTrk::ActsClusterComparisonAlg::validatePixelSpacepoints ( const EventContext & eventContext,
std::unordered_map< const xAOD::PixelCluster *, const xAOD::PixelCluster * > & pixel_cluster_matches ) const
private

Definition at line 853 of file ActsClusterComparisonAlg.cxx.

855{
856
857 // retrieve the spacepoints in form of xAOD containers
859 "Reading monitored spacepoints: " << m_monitoredSpacepointsKey.key());
860 ATH_MSG_INFO("Reading reference spacepoints: " << m_referenceSpacepointsKey.key());
861
862 SG::ReadHandle<xAOD::SpacePointContainer> monitoredSpacepointsHandle =
864 ATH_CHECK(monitoredSpacepointsHandle.isValid());
865 const xAOD::SpacePointContainer* monitoredSpacepoints =
866 monitoredSpacepointsHandle.cptr();
867
868 SG::ReadHandle<xAOD::SpacePointContainer> referenceSpacepointsHandle =
870 ATH_CHECK(referenceSpacepointsHandle.isValid());
871 const xAOD::SpacePointContainer* referenceSpacepoints =
872 referenceSpacepointsHandle.cptr();
873
874 size_t t_n_sp = monitoredSpacepoints->size();
875 size_t a_n_sp = referenceSpacepoints->size();
876
877 ATH_MSG_DEBUG(" Monitored/reference spacepoints " << t_n_sp << " / " << a_n_sp);
878
879 if (t_n_sp != a_n_sp) {
880 ATH_MSG_DEBUG("[ERROR] mismatched spacepoint numbers found!");
881 ATH_MSG_DEBUG(" Monitored/reference spacepoints " << t_n_sp << " / "
882 << a_n_sp);
883 }
884
885 // Now match spacepoints based on their constituent clusters
886 int matched_sp = 0;
887 int unmatched_monitored_sp = 0;
888 int unmatched_reference_sp = 0;
889 int sp_global_pos_diff_1mm = 0;
890 int sp_global_pos_diff_5mm = 0;
891 int sp_variance_r_diff = 0;
892 int sp_variance_z_diff = 0;
893
894 std::vector<std::pair<const xAOD::SpacePoint*, const xAOD::SpacePoint*>>
895 sp_matches;
896 std::set<const xAOD::SpacePoint*> matched_reference_sp;
897
898 for (const auto* monitored_sp : *monitoredSpacepoints) {
899
900 const auto& monitored_measurements = monitored_sp->measurements();
901
902 // Find matching ACTS spacepoint by comparing cluster content
903 bool found_match = false;
904 for (const auto* reference_sp : *referenceSpacepoints) {
905
906 const auto& reference_measurements = reference_sp->measurements();
907
908 // Check if measurements sizes match
909 if (monitored_measurements.size() != reference_measurements.size())
910 continue;
911
912 // Check if all clusters match
913 bool all_clusters_match = true;
914 for (size_t i = 0; i < monitored_measurements.size(); ++i) {
915 const xAOD::UncalibratedMeasurement* monitored_meas =
916 monitored_measurements[i];
917 const xAOD::UncalibratedMeasurement* reference_meas =
918 reference_measurements[i];
919
920 // Try pixel cluster matching
921 auto monitored_pixel =
922 dynamic_cast<const xAOD::PixelCluster*>(monitored_meas);
923 auto reference_pixel =
924 dynamic_cast<const xAOD::PixelCluster*>(reference_meas);
925
926 if (monitored_pixel && reference_pixel) {
927 auto it = pixel_cluster_matches.find(monitored_pixel);
928 if (it == pixel_cluster_matches.end() ||
929 it->second != reference_pixel) {
930 all_clusters_match = false;
931 break;
932 }
933 } else {
934 // Only pixel spacepoints are supported for now
935 ATH_MSG_WARNING("Non-pixel measurement in spacepoint comparison — "
936 "strip spacepoints are not yet handled, skipping pair");
937 all_clusters_match = false;
938 break;
939 }
940 }
941
942 if (all_clusters_match) {
943
944 // Found matching spacepoint pair
945 matched_sp++;
946 sp_matches.push_back(std::make_pair(monitored_sp, reference_sp));
947 matched_reference_sp.insert(reference_sp);
948 found_match = true;
949
950 break;
951 }
952 }
953
954 if (!found_match) {
955 unmatched_monitored_sp++;
956 }
957 }
958
959 for (auto& sp_pair : sp_matches) {
960
961 const xAOD::SpacePoint* monitored_sp = sp_pair.first;
962 const xAOD::SpacePoint* reference_sp = sp_pair.second;
963
964 double dx = monitored_sp->x() - reference_sp->x();
965 double dy = monitored_sp->y() - reference_sp->y();
966 double dz = monitored_sp->z() - reference_sp->z();
967 double pos_diff = std::sqrt(dx * dx + dy * dy + dz * dz);
968
969 // Calculate global position difference
970 ATH_MSG_DEBUG("Spacepoint global position: ");
971 ATH_MSG_DEBUG(" Monitored: (" << monitored_sp->x() << ", " << monitored_sp->y()
972 << ", " << monitored_sp->z() << ")");
973 ATH_MSG_DEBUG(" Reference: (" << reference_sp->x() << ", " << reference_sp->y()
974 << ", " << reference_sp->z() << ")");
975 ATH_MSG_DEBUG(" Δx = " << dx << ", Δy = " << dy << ", Δz = " << dz
976 << ", Δr = " << pos_diff);
977
978 if (pos_diff > 1.0)
979 sp_global_pos_diff_1mm++;
980 if (pos_diff > 5.0)
981 sp_global_pos_diff_5mm++;
982
983 // Calculate covariance difference
984 ATH_MSG_DEBUG("Spacepoint cov and radius: ");
985 ATH_MSG_DEBUG(" Monitored r/z and radius: ("
986 << monitored_sp->varianceR() << ", "
987 << monitored_sp->varianceZ() << ", " << monitored_sp->radius()
988 << ")");
989 ATH_MSG_DEBUG(" Reference r/z and radius: (" << reference_sp->varianceR() << ", "
990 << reference_sp->varianceZ() << ", "
991 << reference_sp->radius() << ")");
992 ATH_MSG_DEBUG(" Δcov_r = "
993 << monitored_sp->varianceR() - reference_sp->varianceR()
994 << ", Δcov_z = "
995 << monitored_sp->varianceZ() - reference_sp->varianceZ()
996 << ", Δradius = "
997 << monitored_sp->radius() - reference_sp->radius());
998
999 if (reference_sp->varianceR() > 0 &&
1000 std::abs(monitored_sp->varianceR() - reference_sp->varianceR()) /
1001 reference_sp->varianceR() > 0.1)
1002 sp_variance_r_diff++;
1003 if (reference_sp->varianceZ() > 0 &&
1004 std::abs(monitored_sp->varianceZ() - reference_sp->varianceZ()) /
1005 reference_sp->varianceZ() > 0.1)
1006 sp_variance_z_diff++;
1007
1008 }
1009
1010 unmatched_reference_sp = referenceSpacepoints->size() - matched_reference_sp.size();
1011
1012 // Print statistics
1014 "============================================================");
1015 ATH_MSG_INFO("SPACEPOINT MATCHING STATISTICS:");
1016 ATH_MSG_INFO(" Total monitored spacepoints: " << t_n_sp);
1017 ATH_MSG_INFO(" Total reference spacepoints: " << a_n_sp);
1018 ATH_MSG_INFO(" Matched spacepoints: " << matched_sp);
1019 ATH_MSG_INFO(" Unmatched monitored spacepoints: " << unmatched_monitored_sp);
1020 ATH_MSG_INFO(" Unmatched reference spacepoints: " << unmatched_reference_sp);
1022 "============================================================");
1023 ATH_MSG_INFO("SPACEPOINT POSITION COMPARISON:");
1025 " Spacepoints with global pos diff > 1 mm: "
1026 << sp_global_pos_diff_1mm << " ("
1027 << (matched_sp > 0 ? 100.0 * sp_global_pos_diff_1mm / matched_sp : 0.0)
1028 << "%)");
1030 " Spacepoints with global pos diff > 5 mm: "
1031 << sp_global_pos_diff_5mm << " ("
1032 << (matched_sp > 0 ? 100.0 * sp_global_pos_diff_5mm / matched_sp : 0.0)
1033 << "%)");
1035 "============================================================");
1036 ATH_MSG_INFO("SPACEPOINT VARIANCE COMPARISON:");
1038 " Spacepoints with >10% variance R difference: "
1039 << sp_variance_r_diff << " ("
1040 << (matched_sp > 0 ? 100.0 * sp_variance_r_diff / matched_sp : 0.0)
1041 << "%)");
1043 " Spacepoints with >10% variance Z difference: "
1044 << sp_variance_z_diff << " ("
1045 << (matched_sp > 0 ? 100.0 * sp_variance_z_diff / matched_sp : 0.0)
1046 << "%)");
1048 "============================================================");
1049
1050
1051 m_nMonSp += t_n_sp;
1052 m_nRefSp += a_n_sp;
1053 m_nMatchedSp += matched_sp;
1054 m_nUnmatchedMonSp += unmatched_monitored_sp;
1055 m_nUnmatchedRefSp += unmatched_reference_sp;
1056 m_nSpPosDiff1mm += sp_global_pos_diff_1mm;
1057 m_nSpPosDiff5mm += sp_global_pos_diff_5mm;
1058 m_nSpVarRDiff += sp_variance_r_diff;
1059 m_nSpVarZDiff += sp_variance_z_diff;
1060
1061 return StatusCode::SUCCESS;
1062}
float varianceZ() const
float varianceR() const
Returns the variances.
float z() const
float y() const
float x() const
float radius() const
SpacePointContainer_v1 SpacePointContainer
Define the version of the space point container.
UncalibratedMeasurement_v1 UncalibratedMeasurement
Define the version of the uncalibrated measurement class.

Member Data Documentation

◆ m_checkSpacepoints

Gaudi::Property<bool> ActsTrk::ActsClusterComparisonAlg::m_checkSpacepoints
private
Initial value:
{
this, "checkSpacepoints", false,
"If you also want to validate spacepounts."}

Definition at line 108 of file ActsClusterComparisonAlg.h.

108 {
109 this, "checkSpacepoints", false,
110 "If you also want to validate spacepounts."};

◆ m_detStore

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

Pointer to StoreGate (detector store by default).

Definition at line 381 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 378 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_geoIdMappingObjectName

Gaudi::Property<std::string> ActsTrk::ActsClusterComparisonAlg::m_geoIdMappingObjectName {this, "GeoIdMapping", "", "ID mapping between the three detector description realms."}
private

Definition at line 103 of file ActsClusterComparisonAlg.h.

103{this, "GeoIdMapping", "", "ID mapping between the three detector description realms."};

◆ m_idMapping

const ActsTrk::GeometryIdMapping* ActsTrk::ActsClusterComparisonAlg::m_idMapping {nullptr}
private

Definition at line 104 of file ActsClusterComparisonAlg.h.

104{nullptr};

◆ m_matched_pixel

Gaudi::Accumulators::Counter ActsTrk::ActsClusterComparisonAlg::m_matched_pixel
mutableprivate

Definition at line 144 of file ActsClusterComparisonAlg.h.

◆ m_matched_strip

Gaudi::Accumulators::Counter ActsTrk::ActsClusterComparisonAlg::m_matched_strip
mutableprivate

Definition at line 145 of file ActsClusterComparisonAlg.h.

◆ m_monCondKey

SG::ReadCondHandleKey<traccc::detector_conditions_description::host> ActsTrk::ActsClusterComparisonAlg::m_monCondKey
private
Initial value:
{
this, "TracccCondKey", "DeviceDetectorDescriptionHostCond",
"Key for reading the candidate host conditions object"}

Definition at line 99 of file ActsClusterComparisonAlg.h.

99 {
100 this, "TracccCondKey", "DeviceDetectorDescriptionHostCond",
101 "Key for reading the candidate host conditions object"};

◆ m_monDesignObjectName

Gaudi::Property<std::string> ActsTrk::ActsClusterComparisonAlg::m_monDesignObjectName
private
Initial value:
{
this, "TracccDesignObjectName", "", "Candidate host design object in detStore"}

Definition at line 97 of file ActsClusterComparisonAlg.h.

97 {
98 this, "TracccDesignObjectName", "", "Candidate host design object in detStore"};

◆ m_monitoredPixelClustersKey

SG::ReadHandleKey<xAOD::PixelClusterContainer> ActsTrk::ActsClusterComparisonAlg::m_monitoredPixelClustersKey
private
Initial value:
{
this, "monitoredPixelClustersKey", "xAODPixelClustersFromTracccCluster",
"Input monitored pixel clusters"}

Definition at line 123 of file ActsClusterComparisonAlg.h.

123 {
124 this, "monitoredPixelClustersKey", "xAODPixelClustersFromTracccCluster",
125 "Input monitored pixel clusters"};

◆ m_monitoredSpacepointsKey

SG::ReadHandleKey<xAOD::SpacePointContainer> ActsTrk::ActsClusterComparisonAlg::m_monitoredSpacepointsKey
private
Initial value:
{
this, "monitoredSpacepointsKey", "xAODSpacepointsFromTracccCluster",
"Input monitored spacepoints"}

Definition at line 115 of file ActsClusterComparisonAlg.h.

115 {
116 this, "monitoredSpacepointsKey", "xAODSpacepointsFromTracccCluster",
117 "Input monitored spacepoints"};

◆ m_monitoredStripClustersKey

SG::ReadHandleKey<xAOD::StripClusterContainer> ActsTrk::ActsClusterComparisonAlg::m_monitoredStripClustersKey
private
Initial value:
{
this, "monitoredStripClustersKey", "xAODStripClustersFromTracccCluster",
"Input monitored strip clusters"}

Definition at line 127 of file ActsClusterComparisonAlg.h.

127 {
128 this, "monitoredStripClustersKey", "xAODStripClustersFromTracccCluster",
129 "Input monitored strip clusters"};

◆ m_nMatchedSp

Gaudi::Accumulators::Counter ActsTrk::ActsClusterComparisonAlg::m_nMatchedSp
mutableprivate

Definition at line 162 of file ActsClusterComparisonAlg.h.

◆ m_nMonSp

Gaudi::Accumulators::Counter ActsTrk::ActsClusterComparisonAlg::m_nMonSp
mutableprivate

Definition at line 160 of file ActsClusterComparisonAlg.h.

◆ m_nRefSp

Gaudi::Accumulators::Counter ActsTrk::ActsClusterComparisonAlg::m_nRefSp
mutableprivate

Definition at line 161 of file ActsClusterComparisonAlg.h.

◆ m_nSpPosDiff1mm

Gaudi::Accumulators::Counter ActsTrk::ActsClusterComparisonAlg::m_nSpPosDiff1mm
mutableprivate

Definition at line 165 of file ActsClusterComparisonAlg.h.

◆ m_nSpPosDiff5mm

Gaudi::Accumulators::Counter ActsTrk::ActsClusterComparisonAlg::m_nSpPosDiff5mm
mutableprivate

Definition at line 166 of file ActsClusterComparisonAlg.h.

◆ m_nSpVarRDiff

Gaudi::Accumulators::Counter ActsTrk::ActsClusterComparisonAlg::m_nSpVarRDiff
mutableprivate

Definition at line 167 of file ActsClusterComparisonAlg.h.

◆ m_nSpVarZDiff

Gaudi::Accumulators::Counter ActsTrk::ActsClusterComparisonAlg::m_nSpVarZDiff
mutableprivate

Definition at line 168 of file ActsClusterComparisonAlg.h.

◆ m_nUnmatchedMonSp

Gaudi::Accumulators::Counter ActsTrk::ActsClusterComparisonAlg::m_nUnmatchedMonSp
mutableprivate

Definition at line 163 of file ActsClusterComparisonAlg.h.

◆ m_nUnmatchedRefSp

Gaudi::Accumulators::Counter ActsTrk::ActsClusterComparisonAlg::m_nUnmatchedRefSp
mutableprivate

Definition at line 164 of file ActsClusterComparisonAlg.h.

◆ m_pix_unmatched_mon

Gaudi::Accumulators::Counter ActsTrk::ActsClusterComparisonAlg::m_pix_unmatched_mon
mutableprivate

Definition at line 146 of file ActsClusterComparisonAlg.h.

◆ m_pix_unmatched_ref

Gaudi::Accumulators::Counter ActsTrk::ActsClusterComparisonAlg::m_pix_unmatched_ref
mutableprivate

Definition at line 147 of file ActsClusterComparisonAlg.h.

◆ m_pixel_pos_diff_0p25sig

Gaudi::Accumulators::Counter ActsTrk::ActsClusterComparisonAlg::m_pixel_pos_diff_0p25sig
mutableprivate

Definition at line 152 of file ActsClusterComparisonAlg.h.

◆ m_pixel_pos_diff_0p5sig

Gaudi::Accumulators::Counter ActsTrk::ActsClusterComparisonAlg::m_pixel_pos_diff_0p5sig
mutableprivate

Definition at line 151 of file ActsClusterComparisonAlg.h.

◆ m_pixel_pos_diff_1sig

Gaudi::Accumulators::Counter ActsTrk::ActsClusterComparisonAlg::m_pixel_pos_diff_1sig
mutableprivate

Definition at line 150 of file ActsClusterComparisonAlg.h.

◆ m_pixel_unequal

Gaudi::Accumulators::Counter ActsTrk::ActsClusterComparisonAlg::m_pixel_unequal
mutableprivate

Definition at line 142 of file ActsClusterComparisonAlg.h.

◆ m_pixelLorentzAngleTool

ToolHandle<ISiLorentzAngleTool> ActsTrk::ActsClusterComparisonAlg::m_pixelLorentzAngleTool
private
Initial value:
{
this, "PixelLorentzAngleTool", "",
"Tool to retreive Lorentz angle of Pixel"}

Definition at line 180 of file ActsClusterComparisonAlg.h.

180 {
181 this, "PixelLorentzAngleTool", "",
182 "Tool to retreive Lorentz angle of Pixel"};

◆ m_pixelManager

const InDetDD::PixelDetectorManager* ActsTrk::ActsClusterComparisonAlg::m_pixelManager {nullptr}
private

Definition at line 174 of file ActsClusterComparisonAlg.h.

174{nullptr};

◆ m_pixelManagerKey

Gaudi::Property<std::string> ActsTrk::ActsClusterComparisonAlg::m_pixelManagerKey
private
Initial value:
{
this, "PixelManager", "ITkPixel"}

Definition at line 170 of file ActsClusterComparisonAlg.h.

170 {
171 this, "PixelManager", "ITkPixel"};

◆ m_referencePixelClustersKey

SG::ReadHandleKey<xAOD::PixelClusterContainer> ActsTrk::ActsClusterComparisonAlg::m_referencePixelClustersKey
private
Initial value:
{
this, "referencePixelClustersKey", "ITkPixelClusters",
"Input reference pixel clusters"}

Definition at line 131 of file ActsClusterComparisonAlg.h.

131 {
132 this, "referencePixelClustersKey", "ITkPixelClusters",
133 "Input reference pixel clusters"};

◆ m_referenceSpacepointsKey

SG::ReadHandleKey<xAOD::SpacePointContainer> ActsTrk::ActsClusterComparisonAlg::m_referenceSpacepointsKey
private
Initial value:
{
this, "referenceSpacepointsKey", "ITkPixelSpacePoints",
"Input reference spacepoints"}

Definition at line 119 of file ActsClusterComparisonAlg.h.

119 {
120 this, "referenceSpacepointsKey", "ITkPixelSpacePoints",
121 "Input reference spacepoints"};

◆ m_referenceStripClustersKey

SG::ReadHandleKey<xAOD::StripClusterContainer> ActsTrk::ActsClusterComparisonAlg::m_referenceStripClustersKey
private
Initial value:
{
this, "referenceStripClustersKey", "ITkStripClusters",
"Input reference strip clusters"}

Definition at line 135 of file ActsClusterComparisonAlg.h.

135 {
136 this, "referenceStripClustersKey", "ITkStripClusters",
137 "Input reference strip clusters"};

◆ m_strip_pos_diff_0p25sig

Gaudi::Accumulators::Counter ActsTrk::ActsClusterComparisonAlg::m_strip_pos_diff_0p25sig
mutableprivate

Definition at line 155 of file ActsClusterComparisonAlg.h.

◆ m_strip_pos_diff_0p5sig

Gaudi::Accumulators::Counter ActsTrk::ActsClusterComparisonAlg::m_strip_pos_diff_0p5sig
mutableprivate

Definition at line 154 of file ActsClusterComparisonAlg.h.

◆ m_strip_pos_diff_1sig

Gaudi::Accumulators::Counter ActsTrk::ActsClusterComparisonAlg::m_strip_pos_diff_1sig
mutableprivate

Definition at line 153 of file ActsClusterComparisonAlg.h.

◆ m_strip_pos_diff_barrel

Gaudi::Accumulators::Counter ActsTrk::ActsClusterComparisonAlg::m_strip_pos_diff_barrel
mutableprivate

Definition at line 156 of file ActsClusterComparisonAlg.h.

◆ m_strip_pos_diff_EC

Gaudi::Accumulators::Counter ActsTrk::ActsClusterComparisonAlg::m_strip_pos_diff_EC
mutableprivate

Definition at line 157 of file ActsClusterComparisonAlg.h.

◆ m_strip_unequal

Gaudi::Accumulators::Counter ActsTrk::ActsClusterComparisonAlg::m_strip_unequal
mutableprivate

Definition at line 143 of file ActsClusterComparisonAlg.h.

◆ m_strip_unmatched_mon

Gaudi::Accumulators::Counter ActsTrk::ActsClusterComparisonAlg::m_strip_unmatched_mon
mutableprivate

Definition at line 148 of file ActsClusterComparisonAlg.h.

◆ m_strip_unmatched_ref

Gaudi::Accumulators::Counter ActsTrk::ActsClusterComparisonAlg::m_strip_unmatched_ref
mutableprivate

Definition at line 149 of file ActsClusterComparisonAlg.h.

◆ m_stripID

const SCT_ID* ActsTrk::ActsClusterComparisonAlg::m_stripID {nullptr}
private

Definition at line 176 of file ActsClusterComparisonAlg.h.

176{nullptr};

◆ m_stripLorentzAngleTool

ToolHandle<ISiLorentzAngleTool> ActsTrk::ActsClusterComparisonAlg::m_stripLorentzAngleTool
private
Initial value:
{
this, "StripLorentzAngleTool", "SiLorentzAngleTool",
"Tool to retrieve Lorentz angle of Strip"}

Definition at line 177 of file ActsClusterComparisonAlg.h.

177 {
178 this, "StripLorentzAngleTool", "SiLorentzAngleTool",
179 "Tool to retrieve Lorentz angle of Strip"};

◆ m_stripManager

const InDetDD::SCT_DetectorManager* ActsTrk::ActsClusterComparisonAlg::m_stripManager {nullptr}
private

Definition at line 175 of file ActsClusterComparisonAlg.h.

175{nullptr};

◆ m_stripManagerKey

Gaudi::Property<std::string> ActsTrk::ActsClusterComparisonAlg::m_stripManagerKey
private
Initial value:
{
this, "StripManager", "ITkStrip"}

Definition at line 172 of file ActsClusterComparisonAlg.h.

172 {
173 this, "StripManager", "ITkStrip"};

◆ m_varHandleArraysDeclared

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

Definition at line 387 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 386 of file AthCommonDataStore.h.


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