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

#include <StripClusterTruthDecoratorAlg.h>

Inheritance diagram for ActsTrk::StripClusterTruthDecoratorAlg:
Collaboration diagram for ActsTrk::StripClusterTruthDecoratorAlg:

Public Member Functions

 StripClusterTruthDecoratorAlg (const std::string &name, ISvcLocator *pSvcLocator)
virtual ~StripClusterTruthDecoratorAlg ()=default
virtual StatusCode initialize () override
virtual StatusCode execute (const EventContext &ctx) const override
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
virtual void setFilterPassed (bool state, const EventContext &ctx) const
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

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

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

StatusCode labelMeasurementToKeep (const EventContext &ctx, const xAOD::StripClusterContainer &clusters, std::vector< bool > &labels) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

SG::ReadHandleKey< xAOD::StripClusterContainerm_clustercontainer_key {this,"ClusterContainer", "", "Input Strip Cluster container"}
SG::ReadHandleKey< MeasurementToTruthParticleAssociationm_associationMap_key {this,"AssociationMapOut", "", "Association map between measurements and truth particles"}
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollectionm_stripDetEleCollKey {this, "StripDetectorElements", "ITkStripDetectorElementCollection"}
SG::ReadHandleKeyArray< xAOD::TrackParticleContainerm_trackParticlesKey {this, "TrackParticles", {}, "Input xAOD::TrackParticles"}
SG::WriteHandleKey< xAOD::TrackMeasurementValidationContainerm_write_xaod_key {this,"MeasurementContainer","", "Output Strip Validation Clusters"}
SG::WriteDecorHandleKey< xAOD::StripClusterContainerm_trackMeasurement_link {this, "MeasurementLink", m_clustercontainer_key, "validationMeasurementLink"}
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainerm_measurement_truth_indices {this, "MeasurementTruthIndices", m_write_xaod_key, "truth_index"}
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainerm_measurement_truth_barcodes {this, "MeasurementTruthBarcode", m_write_xaod_key, "truth_barcode"}
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainerm_measurement_detectorElementID {this, "MeasurementDetectorElementID", m_write_xaod_key, "detectorElementID"}
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainerm_measurement_waferID {this, "MeasurementWaferID", m_write_xaod_key, "waferID"}
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainerm_measurement_bec {this, "MeasurementBEC", m_write_xaod_key, "bec"}
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainerm_measurement_layer {this, "MeasurementLayer", m_write_xaod_key, "layer"}
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainerm_measurement_sizePhi {this, "MeasurementSizePhi", m_write_xaod_key, "sizePhi"}
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainerm_measurement_sizeZ {this, "MeasurementSizeZ", m_write_xaod_key, "sizeZ"}
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainerm_measurement_SiWidth {this, "MeasurementSiWidth", m_write_xaod_key, "SiWidth"}
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainerm_measurement_eta_module {this, "MeasurementEtaModule", m_write_xaod_key, "eta_module"}
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainerm_measurement_phi_module {this, "MeasurementPhiModule", m_write_xaod_key, "phi_module"}
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainerm_measurement_omegax {this, "MeasurementOmegaX", m_write_xaod_key, "omegax"}
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainerm_measurement_omegay {this, "MeasurementOmegaY", m_write_xaod_key, "omegay"}
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainerm_measurement_LorentzShift {this, "MeasurementLorentzShift", m_write_xaod_key, "LorentzShift"}
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainerm_measurement_centroid_xphi {this, "MeasurementCentroidXphi", m_write_xaod_key, "centroid_xphi"}
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainerm_measurement_centroid_xeta {this, "MeasurementCentroidXeta", m_write_xaod_key, "centroid_xeta"}
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainerm_measurement_side {this, "MeasurementSide", m_write_xaod_key, "side"}
Gaudi::Property< bool > m_useTruthInfo {this, "UseTruthInfo", true}
Gaudi::Property< bool > m_keepOnlyOnTrackMeasurements {this, "KeepOnlyOnTrackMeasurements", false, "Keep on on-track measurements instead of the full collection"}
const SCT_IDm_stripHelper {nullptr}
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default).
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default).
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 38 of file StripClusterTruthDecoratorAlg.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ StripClusterTruthDecoratorAlg()

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

Definition at line 15 of file StripClusterTruthDecoratorAlg.cxx.

16 :
17 AthReentrantAlgorithm(name, pSvcLocator)
18 {}

◆ ~StripClusterTruthDecoratorAlg()

virtual ActsTrk::StripClusterTruthDecoratorAlg::~StripClusterTruthDecoratorAlg ( )
virtualdefault

Member Function Documentation

◆ cardinality()

unsigned int AthCommonReentrantAlgorithm< Gaudi::Algorithm >::cardinality ( ) const
overridevirtualinherited

Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.

Override this to return 0 for reentrant algorithms.

Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.

62{
63 return 0;
64}

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

Definition at line 62 of file StripClusterTruthDecoratorAlg.cxx.

62 {
63
64 SG::ReadHandle<xAOD::StripClusterContainer> StripClusterContainer = SG::makeHandle(m_clustercontainer_key,ctx);
66 const xAOD::StripClusterContainer *stripClusters = StripClusterContainer.cptr();
67
68 SG::ReadCondHandle<InDetDD::SiDetectorElementCollection> stripDetEleHandle = SG::makeHandle( m_stripDetEleCollKey, ctx );
69 ATH_CHECK(stripDetEleHandle.isValid());
70 const InDetDD::SiDetectorElementCollection* stripElements = stripDetEleHandle.cptr();
71
72 const ActsTrk::MeasurementToTruthParticleAssociation* measToTruth(nullptr);
73 if (m_useTruthInfo) {
74 SG::ReadHandle<ActsTrk::MeasurementToTruthParticleAssociation> measToTruthHandle = SG::makeHandle(m_associationMap_key,ctx);
75 ATH_CHECK( measToTruthHandle.isValid());
76 measToTruth = measToTruthHandle.ptr();
77 }
78
79 // Setup outputs
80 // Create the xAOD container and its auxiliary store:
81 SG::WriteHandle<xAOD::TrackMeasurementValidationContainer> xaod = SG::makeHandle( m_write_xaod_key,ctx );
82 ATH_CHECK(xaod.record(std::make_unique<xAOD::TrackMeasurementValidationContainer>(),
83 std::make_unique<xAOD::TrackMeasurementValidationAuxContainer>()));
84
85 SG::WriteDecorHandle<xAOD::StripClusterContainer,
87
88 SG::WriteDecorHandle<xAOD::TrackMeasurementValidationContainer, std::uint64_t> decor_detectorElementID ( m_measurement_detectorElementID, ctx );
89 SG::WriteDecorHandle<xAOD::TrackMeasurementValidationContainer, int> decor_waferID ( m_measurement_waferID, ctx );
90 SG::WriteDecorHandle<xAOD::TrackMeasurementValidationContainer, int> decor_bec ( m_measurement_bec, ctx );
91 SG::WriteDecorHandle<xAOD::TrackMeasurementValidationContainer, int> decor_layer ( m_measurement_layer, ctx );
92 SG::WriteDecorHandle<xAOD::TrackMeasurementValidationContainer, int> decor_sizePhi ( m_measurement_sizePhi, ctx );
93 SG::WriteDecorHandle<xAOD::TrackMeasurementValidationContainer, int> decor_sizeZ ( m_measurement_sizeZ, ctx );
94 SG::WriteDecorHandle<xAOD::TrackMeasurementValidationContainer, int> decor_SiWidth( m_measurement_SiWidth, ctx );
95 SG::WriteDecorHandle<xAOD::TrackMeasurementValidationContainer, int> decor_eta_module ( m_measurement_eta_module, ctx );
96 SG::WriteDecorHandle<xAOD::TrackMeasurementValidationContainer, int> decor_phi_module ( m_measurement_phi_module, ctx );
97 SG::WriteDecorHandle<xAOD::TrackMeasurementValidationContainer, float> decor_omegax ( m_measurement_omegax, ctx );
98 SG::WriteDecorHandle<xAOD::TrackMeasurementValidationContainer, float> decor_omegay ( m_measurement_omegay, ctx );
99 SG::WriteDecorHandle<xAOD::TrackMeasurementValidationContainer, float> decor_LorentzShift ( m_measurement_LorentzShift, ctx );
100 SG::WriteDecorHandle<xAOD::TrackMeasurementValidationContainer, float> decor_centroid_xphi ( m_measurement_centroid_xphi, ctx );
101 SG::WriteDecorHandle<xAOD::TrackMeasurementValidationContainer, float> decor_centroid_xeta ( m_measurement_centroid_xeta, ctx );
102 SG::WriteDecorHandle<xAOD::TrackMeasurementValidationContainer, int> decor_side ( m_measurement_side, ctx );
103
104 // collection
105 std::vector<bool> keepClusterCollection {};
106 ATH_CHECK( labelMeasurementToKeep(ctx, *stripClusters, keepClusterCollection) );
107 xAOD::TrackMeasurementValidationContainer *measurements = xaod.ptr();
108
109 // loop over collection and convert to xAOD::TrackMeasurementValidation
110 for (std::size_t i(0); i<stripClusters->size(); ++i) {
111 if (not keepClusterCollection[i]) continue;
112 const xAOD::StripCluster* cluster = stripClusters->at(i);
113
114 measurements->push_back( new xAOD::TrackMeasurementValidation() );
115 xAOD::TrackMeasurementValidation* measurement = measurements->back();
117 measurements->back()->index() );
118 ATH_CHECK( mlink.isValid() );
119 decorator_measurement_link(*cluster) = std::move(mlink);
120
121 xAOD::DetectorIdentType clusterId = cluster->identifier();
122 xAOD::DetectorIDHashType hashId = cluster->identifierHash();
123
124 const InDetDD::SiDetectorElement *element = stripElements->getDetectorElement(hashId);
125 if ( not element ) {
126 ATH_MSG_FATAL( "Invalid strip detector element for hash " << hashId );
127 return StatusCode::FAILURE;
128 }
129
131 rdoList = cluster->rdoList();
132 std::vector< std::uint64_t > rdoIdentifierList;
133 rdoIdentifierList.reserve(rdoList.size());
134 for( Identifier::value_type hitIdentifierValue : rdoList ){
135 rdoIdentifierList.push_back( hitIdentifierValue );
136 }
137
138 //Set Identifier
139 measurement->setIdentifier( clusterId );
140 measurement->setRdoIdentifierList(std::move(rdoIdentifierList));
141
142 //Set Global Position
143 auto gpos = cluster->globalPosition();
144 measurement->setGlobalPosition(gpos.x(), gpos.y(), gpos.z());
145
146 // Set local position and error matrix
147 auto locpos = cluster->localPosition<1>();
148 measurement->setLocalPosition(locpos[0], locpos[1]);
149
150 auto localCov = cluster->localCovariance<1>();
151 measurement->setLocalPositionError( localCov(0,0), 0., 0. );
152
153 const Identifier waferId = m_stripHelper->wafer_id(hashId);
154 decor_detectorElementID(*measurement) = hashId;
155 decor_waferID(*measurement) = waferId.get_compact();
156 decor_bec(*measurement) = m_stripHelper->barrel_ec(waferId);
157 decor_layer(*measurement) = m_stripHelper->layer_disk(waferId);
158 decor_sizePhi(*measurement) = cluster->channelsInPhi();
159 decor_sizeZ(*measurement) = 0;
160 decor_SiWidth(*measurement) = cluster->channelsInPhi();
161 decor_eta_module(*measurement) = m_stripHelper->eta_module(waferId);
162 decor_phi_module(*measurement) = m_stripHelper->phi_module(waferId);
163 decor_omegax(*measurement) = 0;
164 decor_omegay(*measurement) = 0;
165 decor_LorentzShift(*measurement) = 0;
166 decor_centroid_xphi(*measurement) = 0;
167 decor_centroid_xeta(*measurement) = 0;
168 decor_side(*measurement) = m_stripHelper->side(waferId);
169 }
170
171
172 // Get a list of all true particle contributing to the cluster
173 if (m_useTruthInfo) {
174 SG::WriteDecorHandle<xAOD::TrackMeasurementValidationContainer, std::vector<unsigned int>> decor_truth_indices( m_measurement_truth_indices, ctx );
175 SG::WriteDecorHandle<xAOD::TrackMeasurementValidationContainer, std::vector<unsigned int>> decor_truth_barcode( m_measurement_truth_barcodes, ctx );
176
177 std::size_t measurementIndex = 0;
178 for (std::size_t i(0); i<stripClusters->size(); ++i) {
179 if (not keepClusterCollection[i]) continue;
180 const xAOD::StripCluster* cluster = stripClusters->at(i);
181 xAOD::TrackMeasurementValidation* measurement = measurements->at(measurementIndex);
182
183 // Check the two match
184 if (cluster->identifier() != measurement->identifier()) {
185 ATH_MSG_ERROR("Cluster and Measurement are not matching!");
186 return StatusCode::FAILURE;
187 }
188
189 if (cluster->index() >= measToTruth->size()) {
190 ATH_MSG_ERROR("PRD index "<< cluster->index() << " not present in the measurement to truth vector with size " << measToTruth->size());
191 return StatusCode::FAILURE;
192 }
193
194 auto tps = measToTruth->at(cluster->index());
195
196 std::vector<unsigned int> tp_indices;
197 std::vector<unsigned int> tp_barcodes;
198 for (auto tp : tps) {
199 tp_indices.push_back(tp->index());
200 tp_barcodes.push_back(HepMC::uniqueID(tp));
201 }
202
203 decor_truth_indices(*measurement) = std::move(tp_indices);
204 decor_truth_barcode(*measurement) = std::move(tp_barcodes);
205 ++measurementIndex;
206 } // loop on clusters
207 }
208
209 ATH_MSG_DEBUG( " recorded StripPrepData objects: size " << measurements->size() );
210 return StatusCode::SUCCESS;
211 }
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_FATAL(x)
#define ATH_MSG_DEBUG(x)
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_stripDetEleCollKey
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainer > m_measurement_phi_module
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainer > m_measurement_SiWidth
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainer > m_measurement_layer
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainer > m_measurement_eta_module
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainer > m_measurement_centroid_xeta
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainer > m_measurement_detectorElementID
SG::ReadHandleKey< xAOD::StripClusterContainer > m_clustercontainer_key
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainer > m_measurement_side
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainer > m_measurement_waferID
SG::WriteHandleKey< xAOD::TrackMeasurementValidationContainer > m_write_xaod_key
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainer > m_measurement_sizePhi
SG::WriteDecorHandleKey< xAOD::StripClusterContainer > m_trackMeasurement_link
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainer > m_measurement_LorentzShift
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainer > m_measurement_sizeZ
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainer > m_measurement_omegay
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainer > m_measurement_centroid_xphi
StatusCode labelMeasurementToKeep(const EventContext &ctx, const xAOD::StripClusterContainer &clusters, std::vector< bool > &labels) const
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainer > m_measurement_omegax
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainer > m_measurement_bec
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainer > m_measurement_truth_barcodes
SG::ReadHandleKey< MeasurementToTruthParticleAssociation > m_associationMap_key
SG::WriteDecorHandleKey< xAOD::TrackMeasurementValidationContainer > m_measurement_truth_indices
const T * back() const
Access the last element in the collection as an rvalue.
const T * at(size_type n) const
Access an element, as an rvalue.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
value_type get_compact() const
Get the compact id.
const SiDetectorElement * getDetectorElement(const IdentifierHash &hash) const
const_pointer_type cptr()
const_pointer_type ptr()
Dereference the pointer.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
pointer_type ptr()
Dereference the pointer.
ConstVectorMap< 3 > globalPosition() const
Returns the global position of the strip cluster.
SG::ConstAccessor< SG::JaggedVecElt< Identifier::value_type > >::element_type rdoList() const
Returns the list of identifiers of the channels building the cluster.
int channelsInPhi() const
Returns the dimensions of the cluster in numbers of channels in phi (x), respectively.
void setRdoIdentifierList(const std::vector< uint64_t > &rdoIdentifierList)
Sets the list of RDO identifiers.
void setLocalPositionError(float localXError, float localYError, float localXYCorrelation)
Sets the local position error.
void setLocalPosition(float localX, float localY)
Sets the local position.
void setIdentifier(uint64_t identifier)
Sets the identifier.
void setGlobalPosition(float globalX, float globalY, float globalZ)
Sets the global position.
ConstMatrixMap< N > localCovariance() const
Returns the local covariance of the measurement.
DetectorIDHashType identifierHash() const
Returns the IdentifierHash of the measurement (corresponds to the detector element IdentifierHash).
DetectorIdentType identifier() const
Returns the full Identifier of the measurement.
ConstVectorMap< N > localPosition() const
Returns the local position of the measurement.
int uniqueID(const T &p)
SG::ConstAccessor< T, ALLOC > ConstAccessor
Definition AuxElement.h:570
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
TrackMeasurementValidation_v1 TrackMeasurementValidation
Reference the current persistent version:
StripCluster_v1 StripCluster
Define the version of the strip cluster class.
long unsigned int DetectorIdentType
StripClusterContainer_v1 StripClusterContainer
Define the version of the strip cluster container.
TrackMeasurementValidationContainer_v1 TrackMeasurementValidationContainer
Definition of the current "TrackMeasurementValidation container version".
unsigned int DetectorIDHashType
@ detector ID element hash

◆ extraDeps_update_handler()

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

Add StoreName to extra input/output deps as needed.

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

◆ extraOutputDeps()

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

Return the list of extra output dependencies.

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

Definition at line 94 of file AthCommonReentrantAlgorithm.cxx.

88{
89 // If we didn't find any symlinks to add, just return the collection
90 // from the base class. Otherwise, return the extended collection.
91 if (!m_extendedExtraObjects.empty()) {
93 }
95}
An algorithm that can be simultaneously executed in multiple threads.

◆ filterPassed()

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

Definition at line 96 of file AthCommonReentrantAlgorithm.h.

96 {
97 return execState( ctx ).filterPassed();
98 }
virtual bool filterPassed(const EventContext &ctx) const

◆ initialize()

StatusCode ActsTrk::StripClusterTruthDecoratorAlg::initialize ( )
overridevirtual

Definition at line 21 of file StripClusterTruthDecoratorAlg.cxx.

21 {
22 ATH_MSG_DEBUG("Initialize " << name() << " ...");
23
24 // Read keys
27 ATH_CHECK(m_stripDetEleCollKey.initialize());
28
29 // Tracks only needed if we want on track clusters only
31
32 // Write keys
33 ATH_CHECK(m_write_xaod_key.initialize());
34
35 // Decorator
37
40
42 ATH_CHECK(m_measurement_waferID.initialize());
43 ATH_CHECK(m_measurement_bec.initialize());
44 ATH_CHECK(m_measurement_layer.initialize());
45 ATH_CHECK(m_measurement_sizePhi.initialize());
46 ATH_CHECK(m_measurement_sizeZ.initialize());
47 ATH_CHECK(m_measurement_SiWidth.initialize());
50 ATH_CHECK(m_measurement_omegax.initialize());
51 ATH_CHECK(m_measurement_omegay.initialize());
55 ATH_CHECK(m_measurement_side.initialize());
56
57 ATH_CHECK(detStore()->retrieve(m_stripHelper, "SCT_ID"));
58
59 return StatusCode::SUCCESS;
60 }
SG::ReadHandleKeyArray< xAOD::TrackParticleContainer > m_trackParticlesKey
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()

◆ labelMeasurementToKeep()

StatusCode ActsTrk::StripClusterTruthDecoratorAlg::labelMeasurementToKeep ( const EventContext & ctx,
const xAOD::StripClusterContainer & clusters,
std::vector< bool > & labels ) const
private

Definition at line 213 of file StripClusterTruthDecoratorAlg.cxx.

216{
217 labels.clear();
219 labels.resize(clusters.size(), true);
220 return StatusCode::SUCCESS;
221 }
222 labels.resize(clusters.size(), false);
223
224
225 // get the tracks
226 for (const SG::ReadHandleKey<xAOD::TrackParticleContainer>& trackParticlesKey : m_trackParticlesKey) {
227 SG::ReadHandle<xAOD::TrackParticleContainer> trackParticleHandle = SG::makeHandle( trackParticlesKey, ctx );
228 ATH_CHECK(trackParticleHandle.isValid());
229 const xAOD::TrackParticleContainer* trackParticles = trackParticleHandle.cptr();
230
231 for (const xAOD::TrackParticle* trackParticle : *trackParticles) {
232
233 std::optional<ActsTrk::TrackContainer::ConstTrackProxy> optional_track = getActsTrack(*trackParticle);
234 if ( not optional_track.has_value() ) {
235 ATH_MSG_ERROR("Invalid track link for particle " << trackParticle->index());
236 return StatusCode::FAILURE;
237 }
238 ActsTrk::TrackContainer::ConstTrackProxy track = optional_track.value();
239
240 // loop on track states
241 track.container().trackStateContainer()
242 .visitBackwards(track.tipIndex(),
243 [&labels]
244 (const typename ActsTrk::TrackContainer::ConstTrackStateProxy& state)
245 {
246 auto flags = state.typeFlags();
247 if (not flags.hasMeasurement()) return;
248
249 auto sl = state.getUncalibratedSourceLink().template get<ATLASUncalibSourceLink>();
250 if (sl == nullptr) return;
251
252 const xAOD::UncalibratedMeasurement &cluster = getUncalibratedMeasurement(sl);
253 if (cluster.type() != xAOD::UncalibMeasType::StripClusterType) return;
254 labels.at(cluster.index()) = true;
255 });
256 } // loop on tracks
257 } // loop on read handle keys
258
259 return StatusCode::SUCCESS;
260}
const_pointer_type cptr()
Dereference the pointer.
std::optional< ActsTrk::TrackContainer::ConstTrackProxy > getActsTrack(const xAOD::TrackParticle &trkPart)
Return the proxy to the Acts track from which the track particle was made frome.
Definition Decoration.cxx:9
TrackParticle_v1 TrackParticle
Reference the current persistent version:
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".

◆ 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 AthCommonReentrantAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Definition at line 100 of file AthCommonReentrantAlgorithm.h.

100 {
102 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const

◆ sysExecute()

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

Execute an algorithm.

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

Definition at line 85 of file AthCommonReentrantAlgorithm.cxx.

75{
76 return BaseAlg::sysExecute (ctx);
77}

◆ sysInitialize()

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

Override sysInitialize.

Override sysInitialize from the base class.

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

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

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

Reimplemented in HypoBase, and InputMakerBase.

Definition at line 61 of file AthCommonReentrantAlgorithm.cxx.

105 {
107
108 if (sc.isFailure()) {
109 return sc;
110 }
111
112 ServiceHandle<ICondSvc> cs("CondSvc",name());
113 for (auto h : outputHandles()) {
114 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
115 // do this inside the loop so we don't create the CondSvc until needed
116 if ( cs.retrieve().isFailure() ) {
117 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
118 return StatusCode::SUCCESS;
119 }
120 if (cs->regHandle(this,*h).isFailure()) {
122 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
123 << " with CondSvc");
124 }
125 }
126 }
127 return sc;
128}
#define ATH_MSG_WARNING(x)
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

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

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }

Member Data Documentation

◆ m_associationMap_key

SG::ReadHandleKey<MeasurementToTruthParticleAssociation> ActsTrk::StripClusterTruthDecoratorAlg::m_associationMap_key {this,"AssociationMapOut", "", "Association map between measurements and truth particles"}
private

Definition at line 56 of file StripClusterTruthDecoratorAlg.h.

56{this,"AssociationMapOut", "", "Association map between measurements and truth particles"};

◆ m_clustercontainer_key

SG::ReadHandleKey<xAOD::StripClusterContainer> ActsTrk::StripClusterTruthDecoratorAlg::m_clustercontainer_key {this,"ClusterContainer", "", "Input Strip Cluster container"}
private

Definition at line 55 of file StripClusterTruthDecoratorAlg.h.

55{this,"ClusterContainer", "", "Input Strip Cluster container"};

◆ 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 AthCommonReentrantAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 114 of file AthCommonReentrantAlgorithm.h.

◆ m_keepOnlyOnTrackMeasurements

Gaudi::Property<bool> ActsTrk::StripClusterTruthDecoratorAlg::m_keepOnlyOnTrackMeasurements {this, "KeepOnlyOnTrackMeasurements", false, "Keep on on-track measurements instead of the full collection"}
private

Definition at line 85 of file StripClusterTruthDecoratorAlg.h.

85{this, "KeepOnlyOnTrackMeasurements", false, "Keep on on-track measurements instead of the full collection"};

◆ m_measurement_bec

SG::WriteDecorHandleKey<xAOD::TrackMeasurementValidationContainer> ActsTrk::StripClusterTruthDecoratorAlg::m_measurement_bec {this, "MeasurementBEC", m_write_xaod_key, "bec"}
private

Definition at line 70 of file StripClusterTruthDecoratorAlg.h.

70{this, "MeasurementBEC", m_write_xaod_key, "bec"};

◆ m_measurement_centroid_xeta

SG::WriteDecorHandleKey<xAOD::TrackMeasurementValidationContainer> ActsTrk::StripClusterTruthDecoratorAlg::m_measurement_centroid_xeta {this, "MeasurementCentroidXeta", m_write_xaod_key, "centroid_xeta"}
private

Definition at line 81 of file StripClusterTruthDecoratorAlg.h.

81{this, "MeasurementCentroidXeta", m_write_xaod_key, "centroid_xeta"};

◆ m_measurement_centroid_xphi

SG::WriteDecorHandleKey<xAOD::TrackMeasurementValidationContainer> ActsTrk::StripClusterTruthDecoratorAlg::m_measurement_centroid_xphi {this, "MeasurementCentroidXphi", m_write_xaod_key, "centroid_xphi"}
private

Definition at line 80 of file StripClusterTruthDecoratorAlg.h.

80{this, "MeasurementCentroidXphi", m_write_xaod_key, "centroid_xphi"};

◆ m_measurement_detectorElementID

SG::WriteDecorHandleKey<xAOD::TrackMeasurementValidationContainer> ActsTrk::StripClusterTruthDecoratorAlg::m_measurement_detectorElementID {this, "MeasurementDetectorElementID", m_write_xaod_key, "detectorElementID"}
private

Definition at line 68 of file StripClusterTruthDecoratorAlg.h.

68{this, "MeasurementDetectorElementID", m_write_xaod_key, "detectorElementID"};

◆ m_measurement_eta_module

SG::WriteDecorHandleKey<xAOD::TrackMeasurementValidationContainer> ActsTrk::StripClusterTruthDecoratorAlg::m_measurement_eta_module {this, "MeasurementEtaModule", m_write_xaod_key, "eta_module"}
private

Definition at line 75 of file StripClusterTruthDecoratorAlg.h.

75{this, "MeasurementEtaModule", m_write_xaod_key, "eta_module"};

◆ m_measurement_layer

SG::WriteDecorHandleKey<xAOD::TrackMeasurementValidationContainer> ActsTrk::StripClusterTruthDecoratorAlg::m_measurement_layer {this, "MeasurementLayer", m_write_xaod_key, "layer"}
private

Definition at line 71 of file StripClusterTruthDecoratorAlg.h.

71{this, "MeasurementLayer", m_write_xaod_key, "layer"};

◆ m_measurement_LorentzShift

SG::WriteDecorHandleKey<xAOD::TrackMeasurementValidationContainer> ActsTrk::StripClusterTruthDecoratorAlg::m_measurement_LorentzShift {this, "MeasurementLorentzShift", m_write_xaod_key, "LorentzShift"}
private

Definition at line 79 of file StripClusterTruthDecoratorAlg.h.

79{this, "MeasurementLorentzShift", m_write_xaod_key, "LorentzShift"};

◆ m_measurement_omegax

SG::WriteDecorHandleKey<xAOD::TrackMeasurementValidationContainer> ActsTrk::StripClusterTruthDecoratorAlg::m_measurement_omegax {this, "MeasurementOmegaX", m_write_xaod_key, "omegax"}
private

Definition at line 77 of file StripClusterTruthDecoratorAlg.h.

77{this, "MeasurementOmegaX", m_write_xaod_key, "omegax"};

◆ m_measurement_omegay

SG::WriteDecorHandleKey<xAOD::TrackMeasurementValidationContainer> ActsTrk::StripClusterTruthDecoratorAlg::m_measurement_omegay {this, "MeasurementOmegaY", m_write_xaod_key, "omegay"}
private

Definition at line 78 of file StripClusterTruthDecoratorAlg.h.

78{this, "MeasurementOmegaY", m_write_xaod_key, "omegay"};

◆ m_measurement_phi_module

SG::WriteDecorHandleKey<xAOD::TrackMeasurementValidationContainer> ActsTrk::StripClusterTruthDecoratorAlg::m_measurement_phi_module {this, "MeasurementPhiModule", m_write_xaod_key, "phi_module"}
private

Definition at line 76 of file StripClusterTruthDecoratorAlg.h.

76{this, "MeasurementPhiModule", m_write_xaod_key, "phi_module"};

◆ m_measurement_side

SG::WriteDecorHandleKey<xAOD::TrackMeasurementValidationContainer> ActsTrk::StripClusterTruthDecoratorAlg::m_measurement_side {this, "MeasurementSide", m_write_xaod_key, "side"}
private

Definition at line 82 of file StripClusterTruthDecoratorAlg.h.

82{this, "MeasurementSide", m_write_xaod_key, "side"};

◆ m_measurement_SiWidth

SG::WriteDecorHandleKey<xAOD::TrackMeasurementValidationContainer> ActsTrk::StripClusterTruthDecoratorAlg::m_measurement_SiWidth {this, "MeasurementSiWidth", m_write_xaod_key, "SiWidth"}
private

Definition at line 74 of file StripClusterTruthDecoratorAlg.h.

74{this, "MeasurementSiWidth", m_write_xaod_key, "SiWidth"};

◆ m_measurement_sizePhi

SG::WriteDecorHandleKey<xAOD::TrackMeasurementValidationContainer> ActsTrk::StripClusterTruthDecoratorAlg::m_measurement_sizePhi {this, "MeasurementSizePhi", m_write_xaod_key, "sizePhi"}
private

Definition at line 72 of file StripClusterTruthDecoratorAlg.h.

72{this, "MeasurementSizePhi", m_write_xaod_key, "sizePhi"};

◆ m_measurement_sizeZ

SG::WriteDecorHandleKey<xAOD::TrackMeasurementValidationContainer> ActsTrk::StripClusterTruthDecoratorAlg::m_measurement_sizeZ {this, "MeasurementSizeZ", m_write_xaod_key, "sizeZ"}
private

Definition at line 73 of file StripClusterTruthDecoratorAlg.h.

73{this, "MeasurementSizeZ", m_write_xaod_key, "sizeZ"};

◆ m_measurement_truth_barcodes

SG::WriteDecorHandleKey<xAOD::TrackMeasurementValidationContainer> ActsTrk::StripClusterTruthDecoratorAlg::m_measurement_truth_barcodes {this, "MeasurementTruthBarcode", m_write_xaod_key, "truth_barcode"}
private

Definition at line 66 of file StripClusterTruthDecoratorAlg.h.

66{this, "MeasurementTruthBarcode", m_write_xaod_key, "truth_barcode"};

◆ m_measurement_truth_indices

SG::WriteDecorHandleKey<xAOD::TrackMeasurementValidationContainer> ActsTrk::StripClusterTruthDecoratorAlg::m_measurement_truth_indices {this, "MeasurementTruthIndices", m_write_xaod_key, "truth_index"}
private

Definition at line 65 of file StripClusterTruthDecoratorAlg.h.

65{this, "MeasurementTruthIndices", m_write_xaod_key, "truth_index"};

◆ m_measurement_waferID

SG::WriteDecorHandleKey<xAOD::TrackMeasurementValidationContainer> ActsTrk::StripClusterTruthDecoratorAlg::m_measurement_waferID {this, "MeasurementWaferID", m_write_xaod_key, "waferID"}
private

Definition at line 69 of file StripClusterTruthDecoratorAlg.h.

69{this, "MeasurementWaferID", m_write_xaod_key, "waferID"};

◆ m_stripDetEleCollKey

SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> ActsTrk::StripClusterTruthDecoratorAlg::m_stripDetEleCollKey {this, "StripDetectorElements", "ITkStripDetectorElementCollection"}
private

Definition at line 57 of file StripClusterTruthDecoratorAlg.h.

57{this, "StripDetectorElements", "ITkStripDetectorElementCollection"};

◆ m_stripHelper

const SCT_ID* ActsTrk::StripClusterTruthDecoratorAlg::m_stripHelper {nullptr}
private

Definition at line 87 of file StripClusterTruthDecoratorAlg.h.

87{nullptr};

◆ m_trackMeasurement_link

SG::WriteDecorHandleKey< xAOD::StripClusterContainer > ActsTrk::StripClusterTruthDecoratorAlg::m_trackMeasurement_link {this, "MeasurementLink", m_clustercontainer_key, "validationMeasurementLink"}
private

Definition at line 63 of file StripClusterTruthDecoratorAlg.h.

63{this, "MeasurementLink", m_clustercontainer_key, "validationMeasurementLink"};

◆ m_trackParticlesKey

SG::ReadHandleKeyArray< xAOD::TrackParticleContainer > ActsTrk::StripClusterTruthDecoratorAlg::m_trackParticlesKey {this, "TrackParticles", {}, "Input xAOD::TrackParticles"}
private

Definition at line 59 of file StripClusterTruthDecoratorAlg.h.

59{this, "TrackParticles", {}, "Input xAOD::TrackParticles"};

◆ m_useTruthInfo

Gaudi::Property<bool> ActsTrk::StripClusterTruthDecoratorAlg::m_useTruthInfo {this, "UseTruthInfo", true}
private

Definition at line 84 of file StripClusterTruthDecoratorAlg.h.

84{this, "UseTruthInfo", true};

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.

◆ m_write_xaod_key

SG::WriteHandleKey<xAOD::TrackMeasurementValidationContainer> ActsTrk::StripClusterTruthDecoratorAlg::m_write_xaod_key {this,"MeasurementContainer","", "Output Strip Validation Clusters"}
private

Definition at line 61 of file StripClusterTruthDecoratorAlg.h.

61{this,"MeasurementContainer","", "Output Strip Validation Clusters"};

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