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< StoreGateSvcStoreGateSvc_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
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

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_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_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::PixelDetectorManagerm_pixelManager {nullptr}
const InDetDD::SCT_DetectorManagerm_stripManager {nullptr}
const SCT_IDm_stripID {nullptr}
ToolHandle< ISiLorentzAngleToolm_lorentzAngleTool
ToolHandle< ISiLorentzAngleToolm_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
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::SpacePointContainerm_monitoredSpacepointsKey
SG::ReadHandleKey< xAOD::SpacePointContainerm_referenceSpacepointsKey
SG::ReadHandleKey< xAOD::PixelClusterContainerm_monitoredPixelClustersKey
SG::ReadHandleKey< xAOD::StripClusterContainerm_monitoredStripClustersKey
SG::ReadHandleKey< xAOD::PixelClusterContainerm_referencePixelClustersKey
SG::ReadHandleKey< xAOD::StripClusterContainerm_referenceStripClustersKey

Detailed Description

Definition at line 51 of file ActsClusterComparisonAlg.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

◆ 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 58 of file ActsClusterComparisonAlg.cxx.

59{
60
61
62 // Create per-event data structures
63 std::unordered_map<const xAOD::PixelCluster*, const xAOD::PixelCluster*>
64 pixel_cluster_matches;
65
66 std::unordered_map<const xAOD::StripCluster*, const xAOD::StripCluster*>
67 strip_cluster_matches;
68
69
70 ATH_CHECK(validateClusters(ctx, pixel_cluster_matches, strip_cluster_matches));
71
73 ATH_CHECK(validatePixelSpacepoints(ctx, pixel_cluster_matches));
74
75 return StatusCode::SUCCESS;
76}
#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 909 of file ActsClusterComparisonAlg.cxx.

910{
911
912 ATH_MSG_INFO("Validation summary: ");
913
914 // Print cluster statistics
916 "============================================================");
917 ATH_MSG_INFO("PIXEL CLUSTER MATCHING STATISTICS: ");
918 ATH_MSG_INFO(" Total matched clusters: " << m_matched_pixel);
919 ATH_MSG_INFO(" Clusters with pos diff > 1 sigma: "
920 << m_pixel_pos_diff_1sig << " ("
921 << (m_matched_pixel.value() > 0
922 ? 100.0 * m_pixel_pos_diff_1sig.value() / m_matched_pixel.value()
923 : 0.0)
924 << "%)");
925 ATH_MSG_INFO(" Clusters with pos diff > 0.5 sigma: "
926 << m_pixel_pos_diff_0p5sig << " ("
927 << (m_matched_pixel.value() > 0
928 ? 100.0 * m_pixel_pos_diff_0p5sig.value() / m_matched_pixel.value()
929 : 0.0)
930 << "%)");
931 ATH_MSG_INFO(" Clusters with pos diff > 0.25 sigma: "
932 << m_pixel_pos_diff_0p25sig << " ("
933 << (m_matched_pixel.value() > 0
934 ? 100.0 * m_pixel_pos_diff_0p25sig.value() / m_matched_pixel.value()
935 : 0.0)
936 << "%)");
938 "============================================================");
940 "============================================================");
941 ATH_MSG_INFO("STRIP CLUSTER MATCHING STATISTICS:");
942 ATH_MSG_INFO(" Total matched clusters: " << m_matched_strip);
943 ATH_MSG_INFO(" Clusters with pos diff > 1 sigma: "
944 << m_strip_pos_diff_1sig << " ("
945 << (m_matched_strip.value() > 0
946 ? 100.0 * m_strip_pos_diff_1sig.value() / m_matched_strip.value()
947 : 0.0)
948 << "%)");
949 ATH_MSG_INFO(" Clusters with pos diff > 0.5 sigma: "
950 << m_strip_pos_diff_0p5sig << " ("
951 << (m_matched_strip.value() > 0
952 ? 100.0 * m_strip_pos_diff_0p5sig.value() / m_matched_strip.value()
953 : 0.0)
954 << "%)");
955 ATH_MSG_INFO(" Clusters with pos diff > 0.25 sigma: "
956 << m_strip_pos_diff_0p25sig << " ("
957 << (m_matched_strip.value() > 0
958 ? 100.0 * m_strip_pos_diff_0p25sig.value() / m_matched_strip.value()
959 : 0.0)
960 << "%)");
962 "============================================================");
963
965 ATH_MSG_INFO("============================================================");
966 ATH_MSG_INFO("PIXEL SPACEPOINT MATCHING STATISTICS:");
967 ATH_MSG_INFO(" Total monitored spacepoints: " << m_nMonSp);
968 ATH_MSG_INFO(" Total reference spacepoints: " << m_nRefSp);
969 ATH_MSG_INFO(" Matched spacepoints: " << m_nMatchedSp);
970 ATH_MSG_INFO(" Unmatched monitored spacepoints: " << m_nUnmatchedMonSp);
971 ATH_MSG_INFO(" Unmatched reference spacepoints: " << m_nUnmatchedRefSp);
972 ATH_MSG_INFO("============================================================");
973 ATH_MSG_INFO("SPACEPOINT POSITION COMPARISON:");
974 ATH_MSG_INFO(" Spacepoints with global pos diff > 1 mm: "
975 << m_nSpPosDiff1mm << " ("
976 << (m_nMatchedSp.value() > 0 ? 100.0 * m_nSpPosDiff1mm.value() / m_nMatchedSp.value() : 0.0)
977 << "%)");
978 ATH_MSG_INFO(" Spacepoints with global pos diff > 5 mm: "
979 << m_nSpPosDiff5mm << " ("
980 << (m_nMatchedSp.value() > 0 ? 100.0 * m_nSpPosDiff5mm.value() / m_nMatchedSp.value() : 0.0)
981 << "%)");
982 ATH_MSG_INFO("============================================================");
983 ATH_MSG_INFO("SPACEPOINT VARIANCE COMPARISON:");
984 ATH_MSG_INFO(" Spacepoints with >10% variance R difference: "
985 << m_nSpVarRDiff << " ("
986 << (m_nMatchedSp.value() > 0 ? 100.0 * m_nSpVarRDiff.value() / m_nMatchedSp.value() : 0.0)
987 << "%)");
988 ATH_MSG_INFO(" Spacepoints with >10% variance Z difference: "
989 << m_nSpVarZDiff << " ("
990 << (m_nMatchedSp.value() > 0 ? 100.0 * m_nSpVarZDiff.value() / m_nMatchedSp.value() : 0.0)
991 << "%)");
992 ATH_MSG_INFO("============================================================");
993 }
994
995 return StatusCode::SUCCESS;
996}
#define ATH_MSG_INFO(x)
Gaudi::Accumulators::Counter m_nMatchedSp
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_matched_strip
Gaudi::Accumulators::Counter m_pixel_pos_diff_0p5sig

◆ initialize()

StatusCode ActsTrk::ActsClusterComparisonAlg::initialize ( )
overridevirtual

Initialize the algorithm.

Definition at line 33 of file ActsClusterComparisonAlg.cxx.

34{
35 ATH_MSG_INFO("ActsClusterComparisonAlg::initialize");
36
39
40 ATH_CHECK(detStore()->retrieve(m_stripID, "SCT_ID"));
41
42 ATH_CHECK(m_lorentzAngleTool.retrieve());
44
47
50
53
54 ATH_MSG_INFO("ActsClusterComparisonAlg::initialize complete");
55 return StatusCode::SUCCESS;
56}
SG::ReadHandleKey< xAOD::PixelClusterContainer > m_referencePixelClustersKey
ToolHandle< ISiLorentzAngleTool > m_pixelLorentzAngleTool
ToolHandle< ISiLorentzAngleTool > m_lorentzAngleTool
SG::ReadHandleKey< xAOD::SpacePointContainer > m_monitoredSpacepointsKey
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
const InDetDD::SCT_DetectorManager * m_stripManager
SG::ReadHandleKey< xAOD::SpacePointContainer > m_referenceSpacepointsKey
Gaudi::Property< std::string > m_pixelManagerKey
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 }

◆ msg()

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msgLvl()

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

Definition at line 30 of file AthCommonMsg.h.

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

◆ outputHandles()

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

Return this algorithm's output handles.

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

◆ renounce()

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

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setFilterPassed()

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

Set filter decision:

Reimplemented in AthFilterAlgorithm.

Definition at line 99 of file AthCommonAlgorithm.h.

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

◆ sysExecute()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Reimplemented in AthAnalysisAlgorithm.

Definition at line 80 of file AthCommonAlgorithm.cxx.

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

◆ sysInitialize()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, AthHistogramAlgorithm, HypoBase, InputMakerBase, and PyAthena::Alg.

Definition at line 60 of file AthCommonAlgorithm.cxx.

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

◆ 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 227 of file ActsClusterComparisonAlg.cxx.

229{
230
232 "============================================================");
233 // retrieve the clusters in form of xAOD containers
234 ATH_MSG_INFO("Reading monitored clusters: " << m_monitoredPixelClustersKey.key()
235 << " and "
237 ATH_MSG_INFO("Reading reference clusters: " << m_referencePixelClustersKey.key()
238 << " and "
241 "============================================================");
242
243 SG::ReadHandle<xAOD::PixelClusterContainer> monitoredPixelClustersHandle =
245 ATH_CHECK(monitoredPixelClustersHandle.isValid());
246 const xAOD::PixelClusterContainer* monitoredPixelClusters =
247 monitoredPixelClustersHandle.cptr();
248
249 SG::ReadHandle<xAOD::StripClusterContainer> monitoredStripClustersHandle =
251 ATH_CHECK(monitoredStripClustersHandle.isValid());
252 const xAOD::StripClusterContainer* monitoredStripClusters =
253 monitoredStripClustersHandle.cptr();
254
255 SG::ReadHandle<xAOD::PixelClusterContainer> referencePixelClustersHandle =
257 ATH_CHECK(referencePixelClustersHandle.isValid());
258 const xAOD::PixelClusterContainer* referencePixelClusters =
259 referencePixelClustersHandle.cptr();
260
261 SG::ReadHandle<xAOD::StripClusterContainer> referenceStripClustersHandle =
263 ATH_CHECK(referenceStripClustersHandle.isValid());
264 const xAOD::StripClusterContainer* referenceStripClusters =
265 referenceStripClustersHandle.cptr();
266
267 size_t t_n_pixel = monitoredPixelClusters->size();
268 size_t t_n_strip = monitoredStripClusters->size();
269 size_t a_n_pixel = referencePixelClusters->size();
270 size_t a_n_strip = referenceStripClusters->size();
271
272 ATH_MSG_DEBUG(" Monitored/reference pixel clusters " << t_n_pixel << " / "
273 << a_n_pixel);
274 ATH_MSG_DEBUG(" Monitored/reference strip clusters " << t_n_strip << " / "
275 << a_n_strip);
276
277 if (t_n_pixel != a_n_pixel) {
278 ATH_MSG_DEBUG("[ERROR] mismatched pixel cluster numbers found!");
279 ATH_MSG_DEBUG(" Monitored/reference clusters " << t_n_pixel << " / "
280 << a_n_pixel);
281 }
282 if (t_n_strip != a_n_strip) {
283 ATH_MSG_DEBUG("[ERROR] mismatched strip cluster numbers found!");
284 ATH_MSG_DEBUG(" Monitored/reference clusters " << t_n_strip << " / "
285 << a_n_strip);
286 }
287
288 // Group by module
289 std::map<std::string, std::vector<const xAOD::PixelCluster*>>
290 monitored_pixel_map, reference_pixel_map;
291 std::map<std::string, std::vector<const xAOD::StripCluster*>>
292 monitored_strip_map, reference_strip_map;
293
294 for (const auto* c : *monitoredPixelClusters) {
295 monitored_pixel_map[std::to_string(c->identifierHash())].push_back(c);
296 }
297 for (const auto* c : *monitoredStripClusters) {
298 monitored_strip_map[std::to_string(c->identifierHash())].push_back(c);
299 }
300 for (const auto* c : *referencePixelClusters) {
301 reference_pixel_map[std::to_string(c->identifierHash())].push_back(c);
302 }
303 for (const auto* c : *referenceStripClusters) {
304 reference_strip_map[std::to_string(c->identifierHash())].push_back(c);
305 }
306
307 // Collect all module IDs
308 std::set<std::string> pixel_modules, strip_modules;
309 for (const auto& [key, _] : monitored_pixel_map)
310 pixel_modules.insert(key);
311 for (const auto& [key, _] : reference_pixel_map)
312 pixel_modules.insert(key);
313 for (const auto& [key, _] : monitored_strip_map)
314 strip_modules.insert(key);
315 for (const auto& [key, _] : reference_strip_map)
316 strip_modules.insert(key);
317
318 int pixel_unequal = 0, strip_unequal = 0;
319 int matched_pixel = 0, matched_strip = 0;
320 int pixel_pos_diff_0p5sig = 0;
321 int pixel_pos_diff_0p25sig = 0;
322 int pixel_pos_diff_1sig = 0;
323 int strip_pos_diff_0p5sig = 0;
324 int strip_pos_diff_0p25sig = 0;
325 int strip_pos_diff_1sig = 0;
326
327 ATH_MSG_DEBUG("Pixel/Strip modules " << pixel_modules.size() << " / "
328 << strip_modules.size());
329 ATH_MSG_DEBUG("Pixel cluster validation: ");
331 "============================================================");
332
333 // Process pixel modules
334 for (const auto& hid : pixel_modules) {
335 auto& tpixel = monitored_pixel_map[hid];
336 auto& apixel = reference_pixel_map[hid];
337
338 if (tpixel.empty() && apixel.empty())
339 continue;
340
341 if (tpixel.size() != apixel.size()) {
342 std::cout << "\n[ERROR] Pixel Module " << hid
343 << ": mismatched clusters found!" << std::endl;
344 std::cout << " Reference found " << apixel.size()
345 << " and monitored found " << tpixel.size() << " clusters!"
346 << std::endl;
347 pixel_unequal++;
348 continue;
349 }
350
351 std::vector<
352 std::pair<const xAOD::PixelCluster*, const xAOD::PixelCluster*>>
353 pixel_pairs;
354 matchPixelClusters(tpixel, apixel, hid, pixel_pairs);
355
356 matched_pixel += pixel_pairs.size();
357
358 // Add matched pairs and check position differences
359 for (const auto& pair : pixel_pairs) {
360 const xAOD::PixelCluster* monitored_cluster = pair.first;
361 const xAOD::PixelCluster* reference_cluster = pair.second;
362
363 (pixel_cluster_matches)[pair.first] = pair.second;
364
365 // Calculate local position difference
366 double l_dx = monitored_cluster->localPosition<2>()[Trk::locX] -
367 reference_cluster->localPosition<2>()[Trk::locX];
368 double l_dy = monitored_cluster->localPosition<2>()[Trk::locY] -
369 reference_cluster->localPosition<2>()[Trk::locY];
370 double l_pos_diff = std::sqrt(l_dx * l_dx + l_dy * l_dy);
371
372 // Calculate global position difference
373 float g_dx = (monitored_cluster->globalPosition()).x() -
374 (reference_cluster->globalPosition()).x();
375 float g_dy = (monitored_cluster->globalPosition()).y() -
376 (reference_cluster->globalPosition()).y();
377 float g_dz = (monitored_cluster->globalPosition()).z() -
378 (reference_cluster->globalPosition()).z();
379 float g_pos_diff =
380 std::sqrt(g_dx * g_dx + g_dy * g_dy + g_dz * g_dz);
381
382 // Calculate error difference
383 Eigen::Matrix<float, 2, 2> monitored_cov =
384 monitored_cluster->localCovariance<2>();
385 Eigen::Matrix<float, 2, 2> reference_cov =
386 reference_cluster->localCovariance<2>();
387
388 const InDetDD::SiDetectorElement* monitored_element =
389 m_pixelManager->getDetectorElement(
390 monitored_cluster->identifierHash());
391 const InDetDD::PixelModuleDesign& design =
392 static_cast<const InDetDD::PixelModuleDesign&>(
393 monitored_element->design());
394
395 if (std::abs(l_dx / (std::sqrt(monitored_cov(0, 0)))) > 0.25 ||
396 std::abs(l_dy / (std::sqrt(monitored_cov(1, 1)))) > 0.25) {
397 pixel_pos_diff_0p25sig++;
398
399 const Identifier monitored_Pixel_ModuleID =
400 monitored_element->identify();
401 double monitored_lorentz_shift =
402 m_pixelLorentzAngleTool->getLorentzShift(
403 monitored_element->identifyHash(), eventContext);
404
405
406
407 ATH_MSG_DEBUG("Detailed print of cluster discrepancy: ");
408 ATH_MSG_DEBUG("On module: " << monitored_Pixel_ModuleID);
409 ATH_MSG_DEBUG("Lorentz shift: " << std::fixed << std::setprecision(9) << monitored_lorentz_shift);
410
411 ATH_MSG_DEBUG("Local position: ");
413 " Monitored: ("
414 << monitored_cluster->localPosition<2>()[Trk::locX] << ", "
415 << monitored_cluster->localPosition<2>()[Trk::locY] << ")");
416 ATH_MSG_DEBUG(" Reference: ("
417 << reference_cluster->localPosition<2>()[Trk::locX] << ", "
418 << reference_cluster->localPosition<2>()[Trk::locY]
419 << ")");
420 ATH_MSG_DEBUG(" Δx = " << l_dx << ", Δy = " << l_dy
421 << ", Δr = " << l_pos_diff);
422 ATH_MSG_DEBUG("Cluster cov: ");
423 ATH_MSG_DEBUG(" Monitored: (" << monitored_cov(0, 0) << ", "
424 << monitored_cov(1, 1) << ")");
425 ATH_MSG_DEBUG(" Reference: (" << reference_cov(0, 0) << ", "
426 << reference_cov(1, 1) << ")");
427 ATH_MSG_DEBUG(" Δx = " << monitored_cov(0, 0) - reference_cov(0, 0)
428 << ", Δy = "
429 << monitored_cov(1, 1) - reference_cov(1, 1));
430
431
432 const auto& rdoListRange = monitored_cluster->rdoList();
433 std::vector<Identifier> monitored_rdoList(
434 rdoListRange.begin(), rdoListRange.end());
435 for (auto rdoIter : monitored_rdoList) {
436 const InDetDD::SiCellId& chargeCellId =
437 monitored_element->cellIdFromIdentifier(rdoIter);
438 std::array<InDetDD::PixelDiodeTree::CellIndexType, 2>
440 chargeCellId.phiIndex(), chargeCellId.etaIndex());
441
442 InDetDD::PixelDiodeTree::DiodeProxyWithPosition si_param(
443 design.diodeProxyFromIdxCachePosition(diode_idx));
444 ATH_MSG_DEBUG("hit id for this cell: "
445 << chargeCellId
446 << ", position: " << si_param.position()[0]
447 << ", " << si_param.position()[1]);
448 }
449
450 // Calculate width difference
451 ATH_MSG_DEBUG("Cluster width: ");
452 ATH_MSG_DEBUG(" Monitored phi/eta channels, eta width: ("
453 << monitored_cluster->channelsInPhi() << ", "
454 << monitored_cluster->channelsInEta() << ", "
455 << monitored_cluster->widthInEta() << ")");
456 ATH_MSG_DEBUG(" Reference phi/eta channels, eta width: ("
457 << reference_cluster->channelsInPhi() << ", "
458 << reference_cluster->channelsInEta() << ", "
459 << reference_cluster->widthInEta() << ")");
460
461 ATH_MSG_DEBUG(" Δphi = " << monitored_cluster->channelsInPhi() -
462 reference_cluster->channelsInPhi()
463 << ", Δeta = "
464 << monitored_cluster->channelsInEta() -
465 reference_cluster->channelsInEta()
466 << ", Δwidth = "
467 << monitored_cluster->widthInEta() -
468 reference_cluster->widthInEta());
469 }
470 if (std::abs(l_dx / (std::sqrt(monitored_cov(0, 0)))) > 0.5 ||
471 std::abs(l_dy / (std::sqrt(monitored_cov(1, 1)))) > 0.5) {
472 pixel_pos_diff_0p5sig++;
473 }
474 if (std::abs(l_dx / (std::sqrt(monitored_cov(0, 0)))) > 1 ||
475 std::abs(l_dy / (std::sqrt(monitored_cov(1, 1)))) > 1) {
476 pixel_pos_diff_1sig++;
477 }
478
479
480 ATH_MSG_VERBOSE("Global position: ");
481 ATH_MSG_VERBOSE(" Monitored: ("
482 << (monitored_cluster->globalPosition()).x() << ", "
483 << (monitored_cluster->globalPosition()).y() << ", "
484 << (monitored_cluster->globalPosition()).z() << ")");
485 ATH_MSG_VERBOSE(" Reference: ("
486 << (reference_cluster->globalPosition()).x() << ", "
487 << (reference_cluster->globalPosition()).y() << ", "
488 << (reference_cluster->globalPosition()).z() << ")");
489 ATH_MSG_VERBOSE(" Δx = " << g_dx << ", Δy = " << g_dy << ", Δz = "
490 << g_dz << ", Δr = " << g_pos_diff);
491
492 }
493 }
494
496 "============================================================");
497 ATH_MSG_DEBUG("Strip cluster validation: ");
499 "============================================================");
500 // Process strip modules
501 for (const auto& hid : strip_modules) {
502 auto& tstrip = monitored_strip_map[hid];
503 auto& astrip = reference_strip_map[hid];
504
505 if (tstrip.empty() && astrip.empty())
506 continue;
507
508 if (tstrip.size() != astrip.size()) {
509 ATH_MSG_DEBUG("\n[ERROR] Strip Module "
510 << hid << ": mismatched clusters found!");
511 ATH_MSG_DEBUG(" Reference found " << astrip.size()
512 << " and monitored found "
513 << tstrip.size() << " clusters!");
514 strip_unequal++;
515 continue;
516 }
517
518 std::vector<
519 std::pair<const xAOD::StripCluster*, const xAOD::StripCluster*>>
520 strip_pairs;
521 matchStripClusters(tstrip, astrip, hid, strip_pairs);
522
523 matched_strip += strip_pairs.size();
524
525 // Add matched pairs and check position differences
526 for (const auto& pair : strip_pairs) {
527 const xAOD::StripCluster* monitored_cluster = pair.first;
528 const xAOD::StripCluster* reference_cluster = pair.second;
529
530 (strip_cluster_matches)[pair.first] = pair.second;
531
532 // Calculate position difference
533 double pos_diff = monitored_cluster->localPosition<1>()[Trk::locX] -
534 reference_cluster->localPosition<1>()[Trk::locX];
535
536
537 // Calculate error difference
538 Eigen::Matrix<float, 1, 1> monitored_cov =
539 monitored_cluster->localCovariance<1>();
540 Eigen::Matrix<float, 1, 1> reference_cov =
541 reference_cluster->localCovariance<1>();
542
543 const InDetDD::SiDetectorElement* monitored_element =
544 m_stripManager->getDetectorElement(monitored_cluster->identifierHash());
545
546
547 if (std::abs(pos_diff / (std::sqrt(monitored_cov(0, 0)))) > 0.25) {
548 strip_pos_diff_0p25sig++;
549
550 int side = m_stripID->side(monitored_element->identify());
551 const Identifier strip_moduleID = m_stripID->module_id(monitored_element->identify());
552 const IdentifierHash Strip_ModuleHash = m_stripID->wafer_hash(strip_moduleID);
553 double monitored_lorentz_shift =
554 m_lorentzAngleTool->getLorentzShift(Strip_ModuleHash + side, eventContext);
555
556 ATH_MSG_DEBUG("Detailed print of cluster discrepancy: ");
557 ATH_MSG_DEBUG("On module: " << strip_moduleID << ", side: " << m_stripID->side(monitored_element->identify()));
558 ATH_MSG_DEBUG("Lorentz shift: " << std::fixed << std::setprecision(9) << monitored_lorentz_shift);
559
560 ATH_MSG_DEBUG("Local position: ");
562 " Monitored: ("
563 << monitored_cluster->localPosition<1>()[Trk::locX] << ")");
564 ATH_MSG_DEBUG(" Reference: ("
565 << reference_cluster->localPosition<1>()[Trk::locX] << ")");
566 ATH_MSG_DEBUG(" Δx = " << pos_diff );
567 ATH_MSG_DEBUG("Cluster cov: ");
568 ATH_MSG_DEBUG(" Monitored: (" << monitored_cov(0, 0) << ")");
569 ATH_MSG_DEBUG(" Reference: (" << reference_cov(0, 0) << ")");
570 ATH_MSG_DEBUG(" Δx = " << monitored_cov(0, 0) - reference_cov(0, 0));
571
572 const auto& rdoListRange = monitored_cluster->rdoList();
573 std::vector<Identifier> monitored_rdoList(
574 rdoListRange.begin(), rdoListRange.end());
575
576 if (monitored_element->isBarrel()) {
577 const InDetDD::SCT_BarrelModuleSideDesign* s_design = (static_cast<const InDetDD::SCT_BarrelModuleSideDesign*>(&monitored_element->design()));
578
579 for (auto rdoIter : monitored_rdoList) {
580 const InDetDD::SiCellId& chargeCellId =
581 monitored_element->cellIdFromIdentifier(rdoIter);
582 InDetDD::SiLocalPosition si_pos =
583 s_design->localPositionOfCell(chargeCellId);
584 Amg::Vector2D loc_pos(si_pos.xPhi(), si_pos.xEta());
585 ATH_MSG_DEBUG("hit id for this cell: "
586 << chargeCellId
587 << ", position: " << loc_pos[0]
588 << ", " << loc_pos[1]);
589 }
590
591 }else{
592
593 const InDetDD::StripStereoAnnulusDesign* annulus_design = (static_cast<const InDetDD::StripStereoAnnulusDesign*>(&monitored_element->design()));
594
595 for (auto rdoIter : monitored_rdoList) {
596 const InDetDD::SiCellId& chargeCellId =
597 monitored_element->cellIdFromIdentifier(rdoIter);
598
599 InDetDD::SiLocalPosition si_pos =
600 annulus_design->localPositionOfCell(chargeCellId);
601 Amg::Vector2D loc_pos(si_pos.xPhi(), si_pos.xEta());
602 ATH_MSG_DEBUG("hit id for this cell: "
603 << chargeCellId
604 << ", posiiton: " << loc_pos[0]
605 << ", " << loc_pos[1]);
606 }
607
608 }
609
610 // Calculate width difference
611 ATH_MSG_DEBUG("Cluster width: ");
612 ATH_MSG_DEBUG(" Monitored phi channels: ("
613 << monitored_cluster->channelsInPhi() << ")");
614 ATH_MSG_DEBUG(" Reference phi channels: ("
615 << reference_cluster->channelsInPhi() << ")");
616
617 ATH_MSG_DEBUG(" Δphi = " << monitored_cluster->channelsInPhi() -
618 reference_cluster->channelsInPhi());
619
620 }
621 if (std::abs(pos_diff / (std::sqrt(monitored_cov(0, 0)))) > 0.5) {
622 strip_pos_diff_0p5sig++;
623 }
624 if (std::abs(pos_diff / (std::sqrt(monitored_cov(0, 0)))) > 1) {
625 strip_pos_diff_1sig++;
626 }
627
628 }
629 }
630
632 "============================================================");
633
634 // Print statistics
636 "============================================================");
637 ATH_MSG_DEBUG("PIXEL CLUSTER MATCHING STATISTICS: ");
638 ATH_MSG_DEBUG(" Total matched clusters: " << matched_pixel);
639 ATH_MSG_DEBUG(" Clusters with pos diff > 1 sigma: "
640 << pixel_pos_diff_1sig << " ("
641 << (matched_pixel > 0
642 ? 100.0 * pixel_pos_diff_1sig / matched_pixel
643 : 0.0)
644 << "%)");
645 ATH_MSG_DEBUG(" Clusters with pos diff > 0.5 sigma: "
646 << pixel_pos_diff_0p5sig << " ("
647 << (matched_pixel > 0
648 ? 100.0 * pixel_pos_diff_0p5sig / matched_pixel
649 : 0.0)
650 << "%)");
651 ATH_MSG_DEBUG(" Clusters with pos diff > 0.25 sigma: "
652 << pixel_pos_diff_0p25sig << " ("
653 << (matched_pixel > 0
654 ? 100.0 * pixel_pos_diff_0p25sig / matched_pixel
655 : 0.0)
656 << "%)");
658 "============================================================");
660 "============================================================");
661 ATH_MSG_DEBUG("STRIP CLUSTER MATCHING STATISTICS:");
662 ATH_MSG_DEBUG(" Total matched clusters: " << matched_strip);
663 ATH_MSG_DEBUG(" Clusters with pos diff > 1 sigma: "
664 << strip_pos_diff_1sig << " ("
665 << (matched_strip > 0
666 ? 100.0 * strip_pos_diff_1sig / matched_strip
667 : 0.0)
668 << "%)");
669 ATH_MSG_DEBUG(" Clusters with pos diff > 0.5 sigma: "
670 << strip_pos_diff_0p5sig << " ("
671 << (matched_strip > 0
672 ? 100.0 * strip_pos_diff_0p5sig / matched_strip
673 : 0.0)
674 << "%)");
675 ATH_MSG_DEBUG(" Clusters with pos diff > 0.25 sigma: "
676 << strip_pos_diff_0p25sig << " ("
677 << (matched_strip > 0
678 ? 100.0 * strip_pos_diff_0p25sig / matched_strip
679 : 0.0)
680 << "%)");
682 "============================================================");
683
684 m_pixel_unequal += pixel_unequal;
685 m_strip_unequal += strip_unequal;
686 m_matched_pixel += matched_pixel;
687 m_matched_strip += matched_strip;
688 m_pixel_pos_diff_1sig += pixel_pos_diff_1sig;
689 m_pixel_pos_diff_0p5sig += pixel_pos_diff_0p5sig;
690 m_pixel_pos_diff_0p25sig += pixel_pos_diff_0p25sig;
691 m_strip_pos_diff_1sig += strip_pos_diff_1sig;
692 m_strip_pos_diff_0p5sig += strip_pos_diff_0p5sig;
693 m_strip_pos_diff_0p25sig += strip_pos_diff_0p25sig;
694
695 return StatusCode::SUCCESS;
696}
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
Gaudi::Accumulators::Counter m_pixel_unequal
Gaudi::Accumulators::Counter m_strip_unequal
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
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type cptr()
Dereference the pointer.
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)
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)
Eigen::Matrix< double, 2, 1 > Vector2D
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
@ locY
local cartesian
Definition ParamDefs.h:38
@ locX
Definition ParamDefs.h:37
PixelClusterContainer_v1 PixelClusterContainer
Define the version of the pixel cluster container.
StripCluster_v1 StripCluster
Define the version of the strip cluster class.
StripClusterContainer_v1 StripClusterContainer
Define the version of the strip cluster container.
PixelCluster_v1 PixelCluster
Define the version of the pixel cluster class.

◆ 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 698 of file ActsClusterComparisonAlg.cxx.

700{
701
702 // retrieve the spacepoints in form of xAOD containers
704 "Reading monitored spacepoints: " << m_monitoredSpacepointsKey.key());
705 ATH_MSG_INFO("Reading reference spacepoints: " << m_referenceSpacepointsKey.key());
706
707 SG::ReadHandle<xAOD::SpacePointContainer> monitoredSpacepointsHandle =
709 ATH_CHECK(monitoredSpacepointsHandle.isValid());
710 const xAOD::SpacePointContainer* monitoredSpacepoints =
711 monitoredSpacepointsHandle.cptr();
712
713 SG::ReadHandle<xAOD::SpacePointContainer> referenceSpacepointsHandle =
715 ATH_CHECK(referenceSpacepointsHandle.isValid());
716 const xAOD::SpacePointContainer* referenceSpacepoints =
717 referenceSpacepointsHandle.cptr();
718
719 size_t t_n_sp = monitoredSpacepoints->size();
720 size_t a_n_sp = referenceSpacepoints->size();
721
722 ATH_MSG_DEBUG(" Monitored/reference spacepoints " << t_n_sp << " / " << a_n_sp);
723
724 if (t_n_sp != a_n_sp) {
725 ATH_MSG_DEBUG("[ERROR] mismatched spacepoint numbers found!");
726 ATH_MSG_DEBUG(" Monitored/reference spacepoints " << t_n_sp << " / "
727 << a_n_sp);
728 }
729
730 // Now match spacepoints based on their constituent clusters
731 int matched_sp = 0;
732 int unmatched_monitored_sp = 0;
733 int unmatched_reference_sp = 0;
734 int sp_global_pos_diff_1mm = 0;
735 int sp_global_pos_diff_5mm = 0;
736 int sp_variance_r_diff = 0;
737 int sp_variance_z_diff = 0;
738
739 std::vector<std::pair<const xAOD::SpacePoint*, const xAOD::SpacePoint*>>
740 sp_matches;
741 std::set<const xAOD::SpacePoint*> matched_reference_sp;
742
743 for (const auto* monitored_sp : *monitoredSpacepoints) {
744
745 const auto& monitored_measurements = monitored_sp->measurements();
746
747 // Find matching ACTS spacepoint by comparing cluster content
748 bool found_match = false;
749 for (const auto* reference_sp : *referenceSpacepoints) {
750
751 const auto& reference_measurements = reference_sp->measurements();
752
753 // Check if measurements sizes match
754 if (monitored_measurements.size() != reference_measurements.size())
755 continue;
756
757 // Check if all clusters match
758 bool all_clusters_match = true;
759 for (size_t i = 0; i < monitored_measurements.size(); ++i) {
760 const xAOD::UncalibratedMeasurement* monitored_meas =
761 monitored_measurements[i];
762 const xAOD::UncalibratedMeasurement* reference_meas =
763 reference_measurements[i];
764
765 // Try pixel cluster matching
766 auto monitored_pixel =
767 dynamic_cast<const xAOD::PixelCluster*>(monitored_meas);
768 auto reference_pixel =
769 dynamic_cast<const xAOD::PixelCluster*>(reference_meas);
770
771 if (monitored_pixel && reference_pixel) {
772 auto it = pixel_cluster_matches.find(monitored_pixel);
773 if (it == pixel_cluster_matches.end() ||
774 it->second != reference_pixel) {
775 all_clusters_match = false;
776 break;
777 }
778 } else {
779 // Only pixel spacepoints are supported for now
780 ATH_MSG_WARNING("Non-pixel measurement in spacepoint comparison — "
781 "strip spacepoints are not yet handled, skipping pair");
782 all_clusters_match = false;
783 break;
784 }
785 }
786
787 if (all_clusters_match) {
788
789 // Found matching spacepoint pair
790 matched_sp++;
791 sp_matches.push_back(std::make_pair(monitored_sp, reference_sp));
792 matched_reference_sp.insert(reference_sp);
793 found_match = true;
794
795 break;
796 }
797 }
798
799 if (!found_match) {
800 unmatched_monitored_sp++;
801 }
802 }
803
804 for (auto& sp_pair : sp_matches) {
805
806 const xAOD::SpacePoint* monitored_sp = sp_pair.first;
807 const xAOD::SpacePoint* reference_sp = sp_pair.second;
808
809 double dx = monitored_sp->x() - reference_sp->x();
810 double dy = monitored_sp->y() - reference_sp->y();
811 double dz = monitored_sp->z() - reference_sp->z();
812 double pos_diff = std::sqrt(dx * dx + dy * dy + dz * dz);
813
814 // Calculate global position difference
815 ATH_MSG_DEBUG("Spacepoint global position: ");
816 ATH_MSG_DEBUG(" Monitored: (" << monitored_sp->x() << ", " << monitored_sp->y()
817 << ", " << monitored_sp->z() << ")");
818 ATH_MSG_DEBUG(" Reference: (" << reference_sp->x() << ", " << reference_sp->y()
819 << ", " << reference_sp->z() << ")");
820 ATH_MSG_DEBUG(" Δx = " << dx << ", Δy = " << dy << ", Δz = " << dz
821 << ", Δr = " << pos_diff);
822
823 if (pos_diff > 1.0)
824 sp_global_pos_diff_1mm++;
825 if (pos_diff > 5.0)
826 sp_global_pos_diff_5mm++;
827
828 // Calculate covariance difference
829 ATH_MSG_DEBUG("Spacepoint cov and radius: ");
830 ATH_MSG_DEBUG(" Monitored r/z and radius: ("
831 << monitored_sp->varianceR() << ", "
832 << monitored_sp->varianceZ() << ", " << monitored_sp->radius()
833 << ")");
834 ATH_MSG_DEBUG(" Reference r/z and radius: (" << reference_sp->varianceR() << ", "
835 << reference_sp->varianceZ() << ", "
836 << reference_sp->radius() << ")");
837 ATH_MSG_DEBUG(" Δcov_r = "
838 << monitored_sp->varianceR() - reference_sp->varianceR()
839 << ", Δcov_z = "
840 << monitored_sp->varianceZ() - reference_sp->varianceZ()
841 << ", Δradius = "
842 << monitored_sp->radius() - reference_sp->radius());
843
844 if (reference_sp->varianceR() > 0 &&
845 std::abs(monitored_sp->varianceR() - reference_sp->varianceR()) /
846 reference_sp->varianceR() > 0.1)
847 sp_variance_r_diff++;
848 if (reference_sp->varianceZ() > 0 &&
849 std::abs(monitored_sp->varianceZ() - reference_sp->varianceZ()) /
850 reference_sp->varianceZ() > 0.1)
851 sp_variance_z_diff++;
852
853 }
854
855 unmatched_reference_sp = referenceSpacepoints->size() - matched_reference_sp.size();
856
857 // Print statistics
859 "============================================================");
860 ATH_MSG_INFO("SPACEPOINT MATCHING STATISTICS:");
861 ATH_MSG_INFO(" Total monitored spacepoints: " << t_n_sp);
862 ATH_MSG_INFO(" Total reference spacepoints: " << a_n_sp);
863 ATH_MSG_INFO(" Matched spacepoints: " << matched_sp);
864 ATH_MSG_INFO(" Unmatched monitored spacepoints: " << unmatched_monitored_sp);
865 ATH_MSG_INFO(" Unmatched reference spacepoints: " << unmatched_reference_sp);
867 "============================================================");
868 ATH_MSG_INFO("SPACEPOINT POSITION COMPARISON:");
870 " Spacepoints with global pos diff > 1 mm: "
871 << sp_global_pos_diff_1mm << " ("
872 << (matched_sp > 0 ? 100.0 * sp_global_pos_diff_1mm / matched_sp : 0.0)
873 << "%)");
875 " Spacepoints with global pos diff > 5 mm: "
876 << sp_global_pos_diff_5mm << " ("
877 << (matched_sp > 0 ? 100.0 * sp_global_pos_diff_5mm / matched_sp : 0.0)
878 << "%)");
880 "============================================================");
881 ATH_MSG_INFO("SPACEPOINT VARIANCE COMPARISON:");
883 " Spacepoints with >10% variance R difference: "
884 << sp_variance_r_diff << " ("
885 << (matched_sp > 0 ? 100.0 * sp_variance_r_diff / matched_sp : 0.0)
886 << "%)");
888 " Spacepoints with >10% variance Z difference: "
889 << sp_variance_z_diff << " ("
890 << (matched_sp > 0 ? 100.0 * sp_variance_z_diff / matched_sp : 0.0)
891 << "%)");
893 "============================================================");
894
895
896 m_nMonSp += t_n_sp;
897 m_nRefSp += a_n_sp;
898 m_nMatchedSp += matched_sp;
899 m_nUnmatchedMonSp += unmatched_monitored_sp;
900 m_nUnmatchedRefSp += unmatched_reference_sp;
901 m_nSpPosDiff1mm += sp_global_pos_diff_1mm;
902 m_nSpPosDiff5mm += sp_global_pos_diff_5mm;
903 m_nSpVarRDiff += sp_variance_r_diff;
904 m_nSpVarZDiff += sp_variance_z_diff;
905
906 return StatusCode::SUCCESS;
907}
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 68 of file ActsClusterComparisonAlg.h.

68 {
69 this, "checkSpacepoints", false,
70 "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 393 of file AthCommonDataStore.h.

◆ m_evtStore

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

Pointer to StoreGate (event store by default).

Definition at line 390 of file AthCommonDataStore.h.

◆ m_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_lorentzAngleTool

ToolHandle<ISiLorentzAngleTool> ActsTrk::ActsClusterComparisonAlg::m_lorentzAngleTool
private
Initial value:
{
this, "LorentzAngleTool", "SiLorentzAngleTool",
"Tool to retrieve Lorentz angle"}

Definition at line 131 of file ActsClusterComparisonAlg.h.

131 {
132 this, "LorentzAngleTool", "SiLorentzAngleTool",
133 "Tool to retrieve Lorentz angle"};

◆ m_matched_pixel

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

Definition at line 104 of file ActsClusterComparisonAlg.h.

◆ m_matched_strip

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

Definition at line 105 of file ActsClusterComparisonAlg.h.

◆ m_monitoredPixelClustersKey

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

Definition at line 83 of file ActsClusterComparisonAlg.h.

83 {
84 this, "monitoredPixelClustersKey", "xAODPixelClustersFromTracccCluster",
85 "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 75 of file ActsClusterComparisonAlg.h.

75 {
76 this, "monitoredSpacepointsKey", "xAODSpacepointsFromTracccCluster",
77 "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 87 of file ActsClusterComparisonAlg.h.

87 {
88 this, "monitoredStripClustersKey", "xAODStripClustersFromTracccCluster",
89 "Input monitored strip clusters"};

◆ m_nMatchedSp

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

Definition at line 116 of file ActsClusterComparisonAlg.h.

◆ m_nMonSp

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

Definition at line 114 of file ActsClusterComparisonAlg.h.

◆ m_nRefSp

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

Definition at line 115 of file ActsClusterComparisonAlg.h.

◆ m_nSpPosDiff1mm

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

Definition at line 119 of file ActsClusterComparisonAlg.h.

◆ m_nSpPosDiff5mm

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

Definition at line 120 of file ActsClusterComparisonAlg.h.

◆ m_nSpVarRDiff

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

Definition at line 121 of file ActsClusterComparisonAlg.h.

◆ m_nSpVarZDiff

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

Definition at line 122 of file ActsClusterComparisonAlg.h.

◆ m_nUnmatchedMonSp

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

Definition at line 117 of file ActsClusterComparisonAlg.h.

◆ m_nUnmatchedRefSp

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

Definition at line 118 of file ActsClusterComparisonAlg.h.

◆ m_pixel_pos_diff_0p25sig

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

Definition at line 108 of file ActsClusterComparisonAlg.h.

◆ m_pixel_pos_diff_0p5sig

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

Definition at line 107 of file ActsClusterComparisonAlg.h.

◆ m_pixel_pos_diff_1sig

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

Definition at line 106 of file ActsClusterComparisonAlg.h.

◆ m_pixel_unequal

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

Definition at line 102 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 134 of file ActsClusterComparisonAlg.h.

134 {
135 this, "PixelLorentzAngleTool", "",
136 "Tool to retreive Lorentz angle of Pixel"};

◆ m_pixelManager

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

Definition at line 128 of file ActsClusterComparisonAlg.h.

128{nullptr};

◆ m_pixelManagerKey

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

Definition at line 124 of file ActsClusterComparisonAlg.h.

124 {
125 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 91 of file ActsClusterComparisonAlg.h.

91 {
92 this, "referencePixelClustersKey", "ITkPixelClusters",
93 "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 79 of file ActsClusterComparisonAlg.h.

79 {
80 this, "referenceSpacepointsKey", "ITkPixelSpacePoints",
81 "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 95 of file ActsClusterComparisonAlg.h.

95 {
96 this, "referenceStripClustersKey", "ITkStripClusters",
97 "Input reference strip clusters"};

◆ m_strip_pos_diff_0p25sig

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

Definition at line 111 of file ActsClusterComparisonAlg.h.

◆ m_strip_pos_diff_0p5sig

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

Definition at line 110 of file ActsClusterComparisonAlg.h.

◆ m_strip_pos_diff_1sig

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

Definition at line 109 of file ActsClusterComparisonAlg.h.

◆ m_strip_unequal

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

Definition at line 103 of file ActsClusterComparisonAlg.h.

◆ m_stripID

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

Definition at line 130 of file ActsClusterComparisonAlg.h.

130{nullptr};

◆ m_stripManager

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

Definition at line 129 of file ActsClusterComparisonAlg.h.

129{nullptr};

◆ m_stripManagerKey

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

Definition at line 126 of file ActsClusterComparisonAlg.h.

126 {
127 this, "StripManager", "ITkStrip"};

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


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