ATLAS Offline Software
Loading...
Searching...
No Matches
InDet::InDetToXAODSpacePointConversion Class Reference

#include <InDetToXAODSpacePointConversion.h>

Inheritance diagram for InDet::InDetToXAODSpacePointConversion:
Collaboration diagram for InDet::InDetToXAODSpacePointConversion:

Public Member Functions

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

Protected Member Functions

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 convertPixel (const EventContext &ctx, xAOD::PixelClusterContainer *cluster_xaod_container) const
StatusCode convertStrip (const EventContext &ctx, xAOD::StripClusterContainer *cluster_xaod_container, std::unordered_map< Identifier, std::size_t > &mapClusters) const
StatusCode convertStripOverlap (const EventContext &ctx, xAOD::StripClusterContainer *cluster_xaod_container, std::unordered_map< Identifier, std::size_t > &mapClusters) 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< ::SpacePointContainerm_inSpacepointsPixel
SG::ReadHandleKey< ::SpacePointContainerm_inSpacepointsStrip
SG::ReadHandleKey< ::SpacePointOverlapCollectionm_inSpacepointsOverlap
SG::WriteHandleKey< xAOD::PixelClusterContainerm_outClustersPixel
SG::WriteHandleKey< xAOD::StripClusterContainerm_outClustersStrip
SG::WriteHandleKey< xAOD::SpacePointContainerm_outSpacepointsPixel
SG::WriteHandleKey< xAOD::SpacePointContainerm_outSpacepointsStrip
SG::WriteHandleKey< xAOD::SpacePointContainerm_outSpacepointsOverlap
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollectionm_pixelDetEleCollKey {this, "PixelDetEleCollKey", "ITkPixelDetectorElementCollection", "Key of SiDetectorElementCollection for Pixel"}
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollectionm_stripDetEleCollKey {this, "StripDetEleCollKey", "ITkStripDetectorElementCollection", "Key of SiDetectorElementCollection for Strip"}
Gaudi::Property< bool > m_convertClusters {this, "ConvertClusters", false}
Gaudi::Property< bool > m_processPixel {this, "ProcessPixel", true}
Gaudi::Property< bool > m_processStrip {this, "ProcessStrip", true}
const PixelIDm_pixelID {nullptr}
const SCT_IDm_stripID {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 30 of file InDetToXAODSpacePointConversion.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

◆ InDetToXAODSpacePointConversion()

InDet::InDetToXAODSpacePointConversion::InDetToXAODSpacePointConversion ( const std::string & name,
ISvcLocator * pSvcLocator )

Constructor with parameters:

Definition at line 17 of file InDetToXAODSpacePointConversion.cxx.

19 : AthReentrantAlgorithm(name, pSvcLocator)
20 {}

Member Function Documentation

◆ convertPixel()

StatusCode InDet::InDetToXAODSpacePointConversion::convertPixel ( const EventContext & ctx,
xAOD::PixelClusterContainer * cluster_xaod_container ) const
private

Definition at line 94 of file InDetToXAODSpacePointConversion.cxx.

96 {
97 static const SG::AuxElement::Accessor< ElementLink< ::SpacePointCollection > > linkAcc("pixelSpacePointLink");
98
99 const InDetDD::SiDetectorElementCollection* pixElements = nullptr;
100 if (m_convertClusters) {
101 SG::ReadCondHandle<InDetDD::SiDetectorElementCollection> pixelDetEleHandle = SG::makeHandle(m_pixelDetEleCollKey, ctx);
102 if (not pixelDetEleHandle.isValid()) {
103 ATH_MSG_FATAL(m_pixelDetEleCollKey.fullKey() << " is not available.");
104 return StatusCode::FAILURE;
105 }
106 pixElements = pixelDetEleHandle.cptr();
107 }
108
109 // Input
110 SG::ReadHandle< ::SpacePointContainer > pixel_handle = SG::makeHandle( m_inSpacepointsPixel, ctx );
111 ATH_CHECK( pixel_handle.isValid() );
112 const ::SpacePointContainer* pixel_container = pixel_handle.cptr();
113
114 // Output
115 std::unique_ptr< xAOD::SpacePointContainer > pixel_xaod_container = std::make_unique< xAOD::SpacePointContainer >(SG::VIEW_ELEMENTS, SG::ALWAYS_TRACK_INDICES);
116 std::unique_ptr< xAOD::SpacePointAuxContainer > pixel_xaod_aux_container = std::make_unique< xAOD::SpacePointAuxContainer >();
117 pixel_xaod_container->setStore( pixel_xaod_aux_container.get() );
118
119 size_t nsp = 0;
120 for (const ::SpacePointCollection *spc : *pixel_container) {
121 nsp += spc->size();
122 }
123 DataPool<xAOD::SpacePoint> pool (nsp);
124 pixel_xaod_container->push_new (nsp, [&pool](){return pool.nextElementPtr();});
125 size_t isp = 0;
126
127 // Conversion
128 for (const ::SpacePointCollection *spc : *pixel_container) {
129 for (const Trk::SpacePoint *sp : *spc) {
130 const InDet::PixelSpacePoint *indetSP = dynamic_cast<const InDet::PixelSpacePoint *>(sp);
131 if (!indetSP)[[unlikely]] continue;
132 xAOD::SpacePoint* pixel_sp = pixel_xaod_container->at (isp++);
134
135 // Also make cluster object, if requested
136 if (m_convertClusters) {
137 const std::pair<const Trk::PrepRawData*, const Trk::PrepRawData*>& clusterList = sp->clusterList();
138 const InDet::PixelCluster* theCluster = dynamic_cast<const InDet::PixelCluster*>(clusterList.first);
139 if (theCluster == nullptr) {
140 ATH_MSG_FATAL("Cannot cast InDet::PixelCluster");
141 }
142
143 auto clusterId = clusterList.first->identify();
144 const InDetDD::SiDetectorElement *element = pixElements->getDetectorElement(m_pixelID->wafer_hash(m_pixelID->wafer_id(clusterId)));
145 if ( element == nullptr ) {
146 ATH_MSG_FATAL( "Invalid pixel detector element for cluster identifier " << clusterId );
147 return StatusCode::FAILURE;
148 }
149
150 xAOD::PixelCluster * pixelCl = new xAOD::PixelCluster();
151 cluster_xaod_container->push_back(pixelCl);
152 ATH_CHECK( TrackingUtilities::convertInDetToXaodCluster(*theCluster, *element, *pixelCl) );
153 pixel_sp->setMeasurements( {cluster_xaod_container->back()} );
154 }
155
156 // Add link to this space point
158 linkAcc(*pixel_sp) = link;
159 }
160 }
161
162 // Store
163 SG::WriteHandle< xAOD::SpacePointContainer > pixel_xaod_handle = SG::makeHandle( m_outSpacepointsPixel, ctx );
164 ATH_CHECK( pixel_xaod_handle.record( std::move(pixel_xaod_container), std::move(pixel_xaod_aux_container) ) );
165
166 return StatusCode::SUCCESS;
167 }
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_FATAL(x,...)
static Double_t sp
const T * back() const
Access the last element in the collection as an rvalue.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
const SiDetectorElement * getDetectorElement(const IdentifierHash &hash) const
SG::WriteHandleKey< xAOD::SpacePointContainer > m_outSpacepointsPixel
SG::ReadHandleKey< ::SpacePointContainer > m_inSpacepointsPixel
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_pixelDetEleCollKey
const_pointer_type cptr()
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type cptr()
Dereference the pointer.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
void setMeasurements(std::vector< const xAOD::UncalibratedMeasurement * > &&value)
Sets the index of the measurements.
pointer & link(pointer p) const
Return a reference to the link for an element.
@ ALWAYS_TRACK_INDICES
Always track indices, regardless of the setting of the ownership policy.
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
StatusCode convertTrkToXaodPixelSpacePoint(const InDet::PixelSpacePoint &trkSpacePoint, xAOD::SpacePoint &xaodSpacePoint)
StatusCode convertInDetToXaodCluster(const InDet::PixelCluster &indetCluster, const InDetDD::SiDetectorElement &element, xAOD::PixelCluster &xaodCluster)
PixelCluster_v1 PixelCluster
Define the version of the pixel cluster class.
#define unlikely(x)

◆ convertStrip()

StatusCode InDet::InDetToXAODSpacePointConversion::convertStrip ( const EventContext & ctx,
xAOD::StripClusterContainer * cluster_xaod_container,
std::unordered_map< Identifier, std::size_t > & mapClusters ) const
private

Definition at line 169 of file InDetToXAODSpacePointConversion.cxx.

172 {
173 const InDetDD::SiDetectorElementCollection* stripElements = nullptr;
174 if (m_convertClusters) {
175 SG::ReadCondHandle<InDetDD::SiDetectorElementCollection> stripDetEleHandle(m_stripDetEleCollKey, ctx);
176 if (not stripDetEleHandle.isValid()) {
177 ATH_MSG_FATAL(m_stripDetEleCollKey.fullKey() << " is not available.");
178 return StatusCode::FAILURE;
179 }
180 stripElements = stripDetEleHandle.cptr();
181 }
182
183 static const SG::AuxElement::Accessor< ElementLink< ::SpacePointCollection > > linkAcc("sctSpacePointLink");
184
185 // Input
186 SG::ReadHandle< ::SpacePointContainer > strip_handle = SG::makeHandle( m_inSpacepointsStrip, ctx );
187 ATH_CHECK( strip_handle.isValid() );
188 const ::SpacePointContainer* strip_container = strip_handle.cptr();
189
190 // Output
191 std::unique_ptr< xAOD::SpacePointContainer > strip_xaod_container = std::make_unique< xAOD::SpacePointContainer >();
192 std::unique_ptr< xAOD::SpacePointAuxContainer > strip_xaod_aux_container = std::make_unique< xAOD::SpacePointAuxContainer >();
193 strip_xaod_container->setStore( strip_xaod_aux_container.get() );
194
195 strip_xaod_container->reserve(strip_container->size());
196 strip_xaod_aux_container->reserve(strip_container->size());
197
198 // Conversion
199 for (const ::SpacePointCollection *spc : *strip_container) {
200 for (const Trk::SpacePoint *sp : *spc) {
201 const InDet::SCT_SpacePoint *indetSP = static_cast<const InDet::SCT_SpacePoint *>(sp);
202
203 strip_xaod_container->push_back( new xAOD::SpacePoint() );
204 ATH_CHECK( TrackingUtilities::convertTrkToXaodStripSpacePoint(*indetSP, *strip_xaod_container->back()) );
205
206 // Also make cluster object, if requested
207 if (m_convertClusters) {
208 const std::pair<const Trk::PrepRawData*, const Trk::PrepRawData*>& clusterList = sp->clusterList();
209 const InDet::SCT_Cluster* theCluster1 = dynamic_cast<const InDet::SCT_Cluster*>(clusterList.first);
210 const InDet::SCT_Cluster* theCluster2 = dynamic_cast<const InDet::SCT_Cluster*>(clusterList.second);
211 if (theCluster1 == nullptr or
212 theCluster2 == nullptr) {
213 ATH_MSG_FATAL("Cannot cast InDet::SCT_Cluster");
214 }
215
216 auto clusterId1 = clusterList.first->identify();
217 auto clusterId2 = clusterList.second->identify();
218 const InDetDD::SiDetectorElement *element1 = stripElements->getDetectorElement(m_stripID->wafer_hash(m_stripID->wafer_id(clusterId1)));
219 const InDetDD::SiDetectorElement *element2 = stripElements->getDetectorElement(m_stripID->wafer_hash(m_stripID->wafer_id(clusterId2)));
220 if ( element1 == nullptr ) {
221 ATH_MSG_FATAL( "Invalid strip detector element for cluster (1) identifiers " << clusterId1 );
222 return StatusCode::FAILURE;
223 }
224 if ( element2 == nullptr ) {
225 ATH_MSG_FATAL( "Invalid strip detector element for cluster (2) identifiers " << clusterId2 );
226 return StatusCode::FAILURE;
227 }
228 //tries to insert an entry with key clusterId. Returns false and does nothing if the key already exists.
229 auto insertEntry = [&mapClusters, cluster_xaod_container](const auto & clusterId)-> bool{
230 const auto & [p,inserted] = mapClusters.try_emplace(clusterId, cluster_xaod_container->size());
231 return inserted;
232 };
233 // if cluster is not there, add entry and add cluster to container
234 if (insertEntry(clusterId1)){
235 xAOD::StripCluster * stripCl1 = new xAOD::StripCluster();
236 cluster_xaod_container->push_back(stripCl1);
237 ATH_CHECK( TrackingUtilities::convertInDetToXaodCluster(*theCluster1, *element1, *stripCl1) );
238 }
239 if (insertEntry(clusterId2)) {
240 xAOD::StripCluster * stripCl2 = new xAOD::StripCluster();
241 cluster_xaod_container->push_back(stripCl2);
242 ATH_CHECK( TrackingUtilities::convertInDetToXaodCluster(*theCluster2, *element2, *stripCl2) );
243 }
244 // Get the clusters so that we can add a link to them
245 xAOD::StripCluster * stripCl1 = cluster_xaod_container->at(mapClusters[clusterId1]);
246 xAOD::StripCluster * stripCl2 = cluster_xaod_container->at(mapClusters[clusterId2]);
247 strip_xaod_container->back()->setMeasurements( {stripCl1, stripCl2} );
248 }
249
250 // Add link to this space point
252 linkAcc(*strip_xaod_container->back()) = link;
253 }
254 }
255
256 // Store
257 SG::WriteHandle< xAOD::SpacePointContainer > strip_xaod_handle = SG::makeHandle( m_outSpacepointsStrip, ctx );
258 ATH_CHECK( strip_xaod_handle.record( std::move(strip_xaod_container), std::move(strip_xaod_aux_container) ) );
259
260 return StatusCode::SUCCESS;
261 }
const T * at(size_type n) const
Access an element, as an rvalue.
size_type size() const noexcept
Returns the number of elements in the collection.
SG::ReadHandleKey< ::SpacePointContainer > m_inSpacepointsStrip
SG::WriteHandleKey< xAOD::SpacePointContainer > m_outSpacepointsStrip
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_stripDetEleCollKey
StatusCode convertTrkToXaodStripSpacePoint(const InDet::SCT_SpacePoint &trkSpacePoint, xAOD::SpacePoint &xaodSpacePoint)
StripCluster_v1 StripCluster
Define the version of the strip cluster class.

◆ convertStripOverlap()

StatusCode InDet::InDetToXAODSpacePointConversion::convertStripOverlap ( const EventContext & ctx,
xAOD::StripClusterContainer * cluster_xaod_container,
std::unordered_map< Identifier, std::size_t > & mapClusters ) const
private

Definition at line 264 of file InDetToXAODSpacePointConversion.cxx.

267 {
268 const InDetDD::SiDetectorElementCollection* stripElements = nullptr;
269 if (m_convertClusters) {
270 SG::ReadCondHandle<InDetDD::SiDetectorElementCollection> stripDetEleHandle(m_stripDetEleCollKey, ctx);
271 if (not stripDetEleHandle.isValid()) {
272 ATH_MSG_FATAL(m_stripDetEleCollKey.fullKey() << " is not available.");
273 return StatusCode::FAILURE;
274 }
275 stripElements = stripDetEleHandle.cptr();
276 }
277
278 // Inputs
279 SG::ReadHandle< ::SpacePointOverlapCollection > strip_overlap_handle = SG::makeHandle( m_inSpacepointsOverlap, ctx );
280 ATH_CHECK( strip_overlap_handle.isValid() );
281 const ::SpacePointOverlapCollection* strip_overlap_container = strip_overlap_handle.cptr();
282
283 // Outputs
284 std::unique_ptr< xAOD::SpacePointContainer > strip_overlap_xaod_container = std::make_unique< xAOD::SpacePointContainer >();
285 std::unique_ptr< xAOD::SpacePointAuxContainer > strip_overlap_xaod_aux_container = std::make_unique< xAOD::SpacePointAuxContainer >();
286 strip_overlap_xaod_container->setStore( strip_overlap_xaod_aux_container.get() );
287
288 strip_overlap_xaod_container->reserve(strip_overlap_container->size());
289 strip_overlap_xaod_aux_container->reserve(strip_overlap_container->size());
290
291 // Conversion
292 static const SG::AuxElement::Accessor< ElementLink< ::SpacePointOverlapCollection > > stripSpacePointLinkAcc("stripOverlapSpacePointLink");
293
294 for (const Trk::SpacePoint *sp : *strip_overlap_container) {
295 const InDet::SCT_SpacePoint *indetSP = dynamic_cast<const InDet::SCT_SpacePoint *>(sp);
296 if (not indetSP)[[unlikely]] {
297 continue;
298 }
299 strip_overlap_xaod_container->push_back( new xAOD::SpacePoint() );
300 ATH_CHECK( TrackingUtilities::convertTrkToXaodStripSpacePoint(*indetSP, *strip_overlap_xaod_container->back()) );
301
302 // Also make cluster object, if requested
303 if (m_convertClusters) {
304 const std::pair<const Trk::PrepRawData*, const Trk::PrepRawData*>& clusterList = sp->clusterList();
305 const InDet::SCT_Cluster* theCluster1 = dynamic_cast<const InDet::SCT_Cluster*>(clusterList.first);
306 const InDet::SCT_Cluster* theCluster2 = dynamic_cast<const InDet::SCT_Cluster*>(clusterList.second);
307 if (theCluster1 == nullptr or
308 theCluster2 == nullptr) [[unlikely]]{
309 ATH_MSG_FATAL("Cannot cast InDet::SCT_Cluster");
310 }
311
312 auto clusterId1 = clusterList.first->identify();
313 auto clusterId2 = clusterList.second->identify();
314 const InDetDD::SiDetectorElement *element1 = stripElements->getDetectorElement(m_stripID->wafer_hash(m_stripID->wafer_id(clusterId1)));
315 const InDetDD::SiDetectorElement *element2 = stripElements->getDetectorElement(m_stripID->wafer_hash(m_stripID->wafer_id(clusterId2)));
316
317 if ( element1 == nullptr ) {
318 ATH_MSG_FATAL( "Invalid strip detector element for cluster (1) identifiers " << clusterId1 );
319 return StatusCode::FAILURE;
320 }
321 if ( element2 == nullptr ) {
322 ATH_MSG_FATAL( "Invalid strip detector element for cluster (2) identifiers " << clusterId2 );
323 return StatusCode::FAILURE;
324 }
325 //tries to insert an entry with key clusterId. Returns false and does nothing if the key already exists.
326 auto insertEntry = [&mapClusters, cluster_xaod_container](const auto & clusterId)-> bool{
327 const auto & [p,inserted] = mapClusters.try_emplace(clusterId, cluster_xaod_container->size());
328 return inserted;
329 };
330 if (insertEntry(clusterId1)) {
331 xAOD::StripCluster * stripCl1 = new xAOD::StripCluster();
332 cluster_xaod_container->push_back(stripCl1);
333 ATH_CHECK( TrackingUtilities::convertInDetToXaodCluster(*theCluster1, *element1, *stripCl1) );
334 }
335 if (insertEntry(clusterId2)) {
336 xAOD::StripCluster * stripCl2 = new xAOD::StripCluster();
337 cluster_xaod_container->push_back(stripCl2);
338 ATH_CHECK( TrackingUtilities::convertInDetToXaodCluster(*theCluster2, *element2, *stripCl2) );
339 }
340
341 xAOD::StripCluster * stripCl1 = cluster_xaod_container->at(mapClusters[clusterId1]);
342 xAOD::StripCluster * stripCl2 = cluster_xaod_container->at(mapClusters[clusterId2]);
343 strip_overlap_xaod_container->back()->setMeasurements( {stripCl1, stripCl2} );
344 }
345
346 ElementLink< ::SpacePointOverlapCollection > TrkLink(sp, *strip_overlap_container);
347 stripSpacePointLinkAcc( *strip_overlap_xaod_container->back() ) = TrkLink;
348 }
349
350 // Store
351 SG::WriteHandle< xAOD::SpacePointContainer > strip_overlap_xaod_handle = SG::makeHandle( m_outSpacepointsOverlap, ctx );
352 ATH_CHECK( strip_overlap_xaod_handle.record( std::move(strip_overlap_xaod_container), std::move(strip_overlap_xaod_aux_container) ) );
353
354 return StatusCode::SUCCESS;
355 }
SG::WriteHandleKey< xAOD::SpacePointContainer > m_outSpacepointsOverlap
SG::ReadHandleKey< ::SpacePointOverlapCollection > m_inSpacepointsOverlap

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

Definition at line 48 of file InDetToXAODSpacePointConversion.cxx.

49 {
50 ATH_MSG_DEBUG("Executing " << name() << " ...");
51
52 // Cluster Containers if requested
53 std::unique_ptr< xAOD::PixelClusterContainer > pixel_cluster_xaod_container = std::make_unique< xAOD::PixelClusterContainer >();
54 std::unique_ptr< xAOD::PixelClusterAuxContainer > pixel_cluster_xaod_aux_container = std::make_unique< xAOD::PixelClusterAuxContainer >();
55 pixel_cluster_xaod_container->setStore( pixel_cluster_xaod_aux_container.get() );
56
57 std::unique_ptr< xAOD::StripClusterContainer > strip_cluster_xaod_container = std::make_unique< xAOD::StripClusterContainer >();
58 std::unique_ptr< xAOD::StripClusterAuxContainer > strip_cluster_xaod_aux_container = std::make_unique< xAOD::StripClusterAuxContainer >();
59 strip_cluster_xaod_container->setStore( strip_cluster_xaod_aux_container.get() );
60
61 // Convert
62 if (m_processPixel.value()) {
63 ATH_CHECK( convertPixel(ctx, pixel_cluster_xaod_container.get()) );
64 }
65
66 if (m_processStrip.value()) {
67 std::unordered_map<Identifier, std::size_t> mapClusters{};
69 strip_cluster_xaod_container.get(),
70 mapClusters) );
72 strip_cluster_xaod_container.get(),
73 mapClusters) );
74 }
75
76 // Save optional clusters
78 if (m_processPixel.value()) {
79 SG::WriteHandle< xAOD::PixelClusterContainer > pixel_cluster_xaod_handle = SG::makeHandle( m_outClustersPixel, ctx );
80 ATH_CHECK( pixel_cluster_xaod_handle.record( std::move(pixel_cluster_xaod_container),
81 std::move(pixel_cluster_xaod_aux_container) ) );
82 }
83
84 if (m_processStrip.value()) {
85 SG::WriteHandle< xAOD::StripClusterContainer > strip_cluster_xaod_handle = SG::makeHandle( m_outClustersStrip, ctx );
86 ATH_CHECK( strip_cluster_xaod_handle.record( std::move(strip_cluster_xaod_container),
87 std::move(strip_cluster_xaod_aux_container) ) );
88 }
89 }
90
91 return StatusCode::SUCCESS;
92 }
#define ATH_MSG_DEBUG(x,...)
StatusCode convertPixel(const EventContext &ctx, xAOD::PixelClusterContainer *cluster_xaod_container) const
SG::WriteHandleKey< xAOD::PixelClusterContainer > m_outClustersPixel
StatusCode convertStrip(const EventContext &ctx, xAOD::StripClusterContainer *cluster_xaod_container, std::unordered_map< Identifier, std::size_t > &mapClusters) const
StatusCode convertStripOverlap(const EventContext &ctx, xAOD::StripClusterContainer *cluster_xaod_container, std::unordered_map< Identifier, std::size_t > &mapClusters) const
SG::WriteHandleKey< xAOD::StripClusterContainer > m_outClustersStrip

◆ extraDeps_update_handler()

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

Add StoreName to extra input/output deps as needed.

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

◆ extraOutputDeps()

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

Return the list of extra output dependencies.

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

Definition at line 89 of file AthCommonAlgorithm.cxx.

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

◆ filterPassed()

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

Get filter decision:

Definition at line 93 of file AthCommonAlgorithm.h.

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

◆ initialize()

StatusCode InDet::InDetToXAODSpacePointConversion::initialize ( )
overridevirtual

Definition at line 22 of file InDetToXAODSpacePointConversion.cxx.

23 {
24 ATH_MSG_DEBUG("Initializing " << name() << " ...");
25
29
33
36
39
41 ATH_CHECK(detStore()->retrieve(m_pixelID,"PixelID"));
42 ATH_CHECK(detStore()->retrieve(m_stripID,"SCT_ID"));
43 }
44
45 return StatusCode::SUCCESS;
46 }
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 }

Member Data Documentation

◆ m_convertClusters

Gaudi::Property<bool> InDet::InDetToXAODSpacePointConversion::m_convertClusters {this, "ConvertClusters", false}
private

Definition at line 75 of file InDetToXAODSpacePointConversion.h.

75{this, "ConvertClusters", false};

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

SG::ReadHandleKey< ::SpacePointOverlapCollection > InDet::InDetToXAODSpacePointConversion::m_inSpacepointsOverlap
private
Initial value:
{this, "InputStripOverlapSpacePointsName", "ITkOverlapSpacePoints",
"Input Strip overlap space points container"}

Definition at line 57 of file InDetToXAODSpacePointConversion.h.

57 {this, "InputStripOverlapSpacePointsName", "ITkOverlapSpacePoints",
58 "Input Strip overlap space points container"};

◆ m_inSpacepointsPixel

SG::ReadHandleKey< ::SpacePointContainer > InDet::InDetToXAODSpacePointConversion::m_inSpacepointsPixel
private
Initial value:
{this, "InputPixelSpacePointsName", "ITkPixelSpacePoints",
"Input Pixel space points container"}

Definition at line 53 of file InDetToXAODSpacePointConversion.h.

53 {this, "InputPixelSpacePointsName", "ITkPixelSpacePoints",
54 "Input Pixel space points container"};

◆ m_inSpacepointsStrip

SG::ReadHandleKey< ::SpacePointContainer > InDet::InDetToXAODSpacePointConversion::m_inSpacepointsStrip
private
Initial value:
{this, "InputStripSpacePointsName", "ITkStripSpacePoints",
"Input Strip space points container"}

Definition at line 55 of file InDetToXAODSpacePointConversion.h.

55 {this, "InputStripSpacePointsName", "ITkStripSpacePoints",
56 "Input Strip space points container"};

◆ m_outClustersPixel

SG::WriteHandleKey< xAOD::PixelClusterContainer > InDet::InDetToXAODSpacePointConversion::m_outClustersPixel
private
Initial value:
{this, "OutputPixelClustersName", "ITkPixelClusters",
"Output Pixel cluster container"}

Definition at line 60 of file InDetToXAODSpacePointConversion.h.

60 {this, "OutputPixelClustersName", "ITkPixelClusters",
61 "Output Pixel cluster container"};

◆ m_outClustersStrip

SG::WriteHandleKey< xAOD::StripClusterContainer > InDet::InDetToXAODSpacePointConversion::m_outClustersStrip
private
Initial value:
{this, "OutputStripClustersName", "ITkStripClusters",
"Output Strip cluster container"}

Definition at line 62 of file InDetToXAODSpacePointConversion.h.

62 {this, "OutputStripClustersName", "ITkStripClusters",
63 "Output Strip cluster container"};

◆ m_outSpacepointsOverlap

SG::WriteHandleKey< xAOD::SpacePointContainer > InDet::InDetToXAODSpacePointConversion::m_outSpacepointsOverlap
private
Initial value:
{this, "OutputStripOverlapSpacePointsName", "ITkStripOverlapSpacePoints",
"Output Strip Overlap space points container"}

Definition at line 69 of file InDetToXAODSpacePointConversion.h.

69 {this, "OutputStripOverlapSpacePointsName", "ITkStripOverlapSpacePoints",
70 "Output Strip Overlap space points container"};

◆ m_outSpacepointsPixel

SG::WriteHandleKey< xAOD::SpacePointContainer > InDet::InDetToXAODSpacePointConversion::m_outSpacepointsPixel
private
Initial value:
{this, "OutputPixelSpacePointsName", "ITkPixelSpacePoints",
"Output Pixel space points container"}

Definition at line 65 of file InDetToXAODSpacePointConversion.h.

65 {this, "OutputPixelSpacePointsName", "ITkPixelSpacePoints",
66 "Output Pixel space points container"};

◆ m_outSpacepointsStrip

SG::WriteHandleKey< xAOD::SpacePointContainer > InDet::InDetToXAODSpacePointConversion::m_outSpacepointsStrip
private
Initial value:
{this, "OutputStripSpacePointsName", "ITkStripSpacePoints",
"Output Strip space points container"}

Definition at line 67 of file InDetToXAODSpacePointConversion.h.

67 {this, "OutputStripSpacePointsName", "ITkStripSpacePoints",
68 "Output Strip space points container"};

◆ m_pixelDetEleCollKey

SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> InDet::InDetToXAODSpacePointConversion::m_pixelDetEleCollKey {this, "PixelDetEleCollKey", "ITkPixelDetectorElementCollection", "Key of SiDetectorElementCollection for Pixel"}
private

Definition at line 72 of file InDetToXAODSpacePointConversion.h.

72{this, "PixelDetEleCollKey", "ITkPixelDetectorElementCollection", "Key of SiDetectorElementCollection for Pixel"};

◆ m_pixelID

const PixelID* InDet::InDetToXAODSpacePointConversion::m_pixelID {nullptr}
private

Definition at line 79 of file InDetToXAODSpacePointConversion.h.

79{nullptr};

◆ m_processPixel

Gaudi::Property<bool> InDet::InDetToXAODSpacePointConversion::m_processPixel {this, "ProcessPixel", true}
private

Definition at line 76 of file InDetToXAODSpacePointConversion.h.

76{this, "ProcessPixel", true};

◆ m_processStrip

Gaudi::Property<bool> InDet::InDetToXAODSpacePointConversion::m_processStrip {this, "ProcessStrip", true}
private

Definition at line 77 of file InDetToXAODSpacePointConversion.h.

77{this, "ProcessStrip", true};

◆ m_stripDetEleCollKey

SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> InDet::InDetToXAODSpacePointConversion::m_stripDetEleCollKey {this, "StripDetEleCollKey", "ITkStripDetectorElementCollection", "Key of SiDetectorElementCollection for Strip"}
private

Definition at line 73 of file InDetToXAODSpacePointConversion.h.

73{this, "StripDetEleCollKey", "ITkStripDetectorElementCollection", "Key of SiDetectorElementCollection for Strip"};

◆ m_stripID

const SCT_ID* InDet::InDetToXAODSpacePointConversion::m_stripID {nullptr}
private

Definition at line 80 of file InDetToXAODSpacePointConversion.h.

80{nullptr};

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