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

#include <InDetToXAODSpacePointConversion.h>

Inheritance 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 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 convertPixel (const EventContext &ctx, xAOD::PixelClusterContainer *cluster_xaod_container) const
StatusCode convertStrip (const EventContext &ctx, const Amg::Vector3D &vertex, xAOD::StripClusterContainer *cluster_xaod_container, std::unordered_map< Identifier, std::size_t > &mapClusters) const
StatusCode convertStripOverlap (const EventContext &ctx, const Amg::Vector3D &vertex, 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::ReadCondHandleKey< InDet::BeamSpotDatam_beamSpotKey
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 32 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

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

64{
65 return 0;
66}

◆ convertPixel()

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

Definition at line 101 of file InDetToXAODSpacePointConversion.cxx.

103 {
104 static const SG::AuxElement::Accessor< ElementLink< ::SpacePointCollection > > linkAcc("pixelSpacePointLink");
105
106 const InDetDD::SiDetectorElementCollection* pixElements = nullptr;
107 if (m_convertClusters) {
108 SG::ReadCondHandle<InDetDD::SiDetectorElementCollection> pixelDetEleHandle = SG::makeHandle(m_pixelDetEleCollKey, ctx);
109 if (not pixelDetEleHandle.isValid()) {
110 ATH_MSG_FATAL(m_pixelDetEleCollKey.fullKey() << " is not available.");
111 return StatusCode::FAILURE;
112 }
113 pixElements = pixelDetEleHandle.cptr();
114 }
115
116 // Input
117 SG::ReadHandle< ::SpacePointContainer > pixel_handle = SG::makeHandle( m_inSpacepointsPixel, ctx );
118 ATH_CHECK( pixel_handle.isValid() );
119 const ::SpacePointContainer* pixel_container = pixel_handle.cptr();
120
121 // Output
122 std::unique_ptr< xAOD::SpacePointContainer > pixel_xaod_container = std::make_unique< xAOD::SpacePointContainer >(SG::VIEW_ELEMENTS, SG::ALWAYS_TRACK_INDICES);
123 std::unique_ptr< xAOD::SpacePointAuxContainer > pixel_xaod_aux_container = std::make_unique< xAOD::SpacePointAuxContainer >();
124 pixel_xaod_container->setStore( pixel_xaod_aux_container.get() );
125
126 size_t nsp = 0;
127 for (const ::SpacePointCollection *spc : *pixel_container) {
128 nsp += spc->size();
129 }
130 DataPool<xAOD::SpacePoint> pool (nsp);
131 pixel_xaod_container->push_new (nsp, [&pool](){return pool.nextElementPtr();});
132 size_t isp = 0;
133
134 // Conversion
135 for (const ::SpacePointCollection *spc : *pixel_container) {
136 for (const Trk::SpacePoint *sp : *spc) {
137 const InDet::PixelSpacePoint *indetSP = dynamic_cast<const InDet::PixelSpacePoint *>(sp);
138
139 xAOD::SpacePoint* pixel_sp = pixel_xaod_container->at (isp++);
141
142 // Also make cluster object, if requested
143 if (m_convertClusters) {
144 const std::pair<const Trk::PrepRawData*, const Trk::PrepRawData*>& clusterList = sp->clusterList();
145 const InDet::PixelCluster* theCluster = dynamic_cast<const InDet::PixelCluster*>(clusterList.first);
146 if (theCluster == nullptr) {
147 ATH_MSG_FATAL("Cannot cast InDet::PixelCluster");
148 }
149
150 auto clusterId = clusterList.first->identify();
151 const InDetDD::SiDetectorElement *element = pixElements->getDetectorElement(m_pixelID->wafer_hash(m_pixelID->wafer_id(clusterId)));
152 if ( element == nullptr ) {
153 ATH_MSG_FATAL( "Invalid pixel detector element for cluster identifier " << clusterId );
154 return StatusCode::FAILURE;
155 }
156
157 xAOD::PixelCluster * pixelCl = new xAOD::PixelCluster();
158 cluster_xaod_container->push_back(pixelCl);
159 ATH_CHECK( TrackingUtilities::convertInDetToXaodCluster(*theCluster, *element, *pixelCl) );
160 pixel_sp->setMeasurements( {cluster_xaod_container->back()} );
161 }
162
163 // Add link to this space point
164 ElementLink< ::SpacePointCollection > link(indetSP, *spc);
165 linkAcc(*pixel_sp) = link;
166 }
167 }
168
169 // Store
170 SG::WriteHandle< xAOD::SpacePointContainer > pixel_xaod_handle = SG::makeHandle( m_outSpacepointsPixel, ctx );
171 ATH_CHECK( pixel_xaod_handle.record( std::move(pixel_xaod_container), std::move(pixel_xaod_aux_container) ) );
172
173 return StatusCode::SUCCESS;
174 }
#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
SG::Accessor< T, ALLOC > Accessor
Definition AuxElement.h:572
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.
@ 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.

◆ convertStrip()

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

Definition at line 176 of file InDetToXAODSpacePointConversion.cxx.

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

◆ convertStripOverlap()

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

Definition at line 272 of file InDetToXAODSpacePointConversion.cxx.

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

51 {
52 ATH_MSG_DEBUG("Executing " << name() << " ...");
53
54 // Conds
55 SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandle { m_beamSpotKey, ctx };
56 const InDet::BeamSpotData* beamSpot = *beamSpotHandle;
57 auto vertex = beamSpot->beamVtx().position();
58
59 // Cluster Containers if requested
60 std::unique_ptr< xAOD::PixelClusterContainer > pixel_cluster_xaod_container = std::make_unique< xAOD::PixelClusterContainer >();
61 std::unique_ptr< xAOD::PixelClusterAuxContainer > pixel_cluster_xaod_aux_container = std::make_unique< xAOD::PixelClusterAuxContainer >();
62 pixel_cluster_xaod_container->setStore( pixel_cluster_xaod_aux_container.get() );
63
64 std::unique_ptr< xAOD::StripClusterContainer > strip_cluster_xaod_container = std::make_unique< xAOD::StripClusterContainer >();
65 std::unique_ptr< xAOD::StripClusterAuxContainer > strip_cluster_xaod_aux_container = std::make_unique< xAOD::StripClusterAuxContainer >();
66 strip_cluster_xaod_container->setStore( strip_cluster_xaod_aux_container.get() );
67
68 // Convert
69 if (m_processPixel.value()) {
70 ATH_CHECK( convertPixel(ctx, pixel_cluster_xaod_container.get()) );
71 }
72
73 if (m_processStrip.value()) {
74 std::unordered_map<Identifier, std::size_t> mapClusters{};
75 ATH_CHECK( convertStrip(ctx, vertex,
76 strip_cluster_xaod_container.get(),
77 mapClusters) );
78 ATH_CHECK( convertStripOverlap(ctx, vertex,
79 strip_cluster_xaod_container.get(),
80 mapClusters) );
81 }
82
83 // Save optional clusters
85 if (m_processPixel.value()) {
86 SG::WriteHandle< xAOD::PixelClusterContainer > pixel_cluster_xaod_handle = SG::makeHandle( m_outClustersPixel, ctx );
87 ATH_CHECK( pixel_cluster_xaod_handle.record( std::move(pixel_cluster_xaod_container),
88 std::move(pixel_cluster_xaod_aux_container) ) );
89 }
90
91 if (m_processStrip.value()) {
92 SG::WriteHandle< xAOD::StripClusterContainer > strip_cluster_xaod_handle = SG::makeHandle( m_outClustersStrip, ctx );
93 ATH_CHECK( strip_cluster_xaod_handle.record( std::move(strip_cluster_xaod_container),
94 std::move(strip_cluster_xaod_aux_container) ) );
95 }
96 }
97
98 return StatusCode::SUCCESS;
99 }
#define ATH_MSG_DEBUG(x)
StatusCode convertPixel(const EventContext &ctx, xAOD::PixelClusterContainer *cluster_xaod_container) const
StatusCode convertStripOverlap(const EventContext &ctx, const Amg::Vector3D &vertex, xAOD::StripClusterContainer *cluster_xaod_container, std::unordered_map< Identifier, std::size_t > &mapClusters) const
SG::WriteHandleKey< xAOD::PixelClusterContainer > m_outClustersPixel
SG::WriteHandleKey< xAOD::StripClusterContainer > m_outClustersStrip
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
StatusCode convertStrip(const EventContext &ctx, const Amg::Vector3D &vertex, xAOD::StripClusterContainer *cluster_xaod_container, std::unordered_map< Identifier, std::size_t > &mapClusters) const
AthConfigFlags beamSpot(AthConfigFlags flags, str instanceName, str recoMode)

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

90{
91 // If we didn't find any symlinks to add, just return the collection
92 // from the base class. Otherwise, return the extended collection.
93 if (!m_extendedExtraObjects.empty()) {
95 }
97}
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 InDet::InDetToXAODSpacePointConversion::initialize ( )
overridevirtual

Definition at line 22 of file InDetToXAODSpacePointConversion.cxx.

23 {
24 ATH_MSG_DEBUG("Initializing " << name() << " ...");
25
26 ATH_CHECK( m_beamSpotKey.initialize() );
27
31
35
38
41
43 ATH_CHECK(detStore()->retrieve(m_pixelID,"PixelID"));
45 }
46
47 return StatusCode::SUCCESS;
48 }
const ServiceHandle< StoreGateSvc > & detStore() const
retrieve(aClass, aKey=None)
Definition PyKernel.py:110

◆ 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()

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

77{
78 return BaseAlg::sysExecute (ctx);
79}

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

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

SG::ReadCondHandleKey<InDet::BeamSpotData> InDet::InDetToXAODSpacePointConversion::m_beamSpotKey
private
Initial value:
{ this, "BeamSpotKey", "BeamSpotData",
"SG key for beam spot" }

Definition at line 57 of file InDetToXAODSpacePointConversion.h.

57 { this, "BeamSpotKey", "BeamSpotData",
58 "SG key for beam spot" };

◆ m_convertClusters

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

Definition at line 82 of file InDetToXAODSpacePointConversion.h.

82{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 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_inSpacepointsOverlap

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

Definition at line 64 of file InDetToXAODSpacePointConversion.h.

64 {this, "InputStripOverlapSpacePointsName", "ITkOverlapSpacePoints",
65 "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 60 of file InDetToXAODSpacePointConversion.h.

60 {this, "InputPixelSpacePointsName", "ITkPixelSpacePoints",
61 "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 62 of file InDetToXAODSpacePointConversion.h.

62 {this, "InputStripSpacePointsName", "ITkStripSpacePoints",
63 "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 67 of file InDetToXAODSpacePointConversion.h.

67 {this, "OutputPixelClustersName", "ITkPixelClusters",
68 "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 69 of file InDetToXAODSpacePointConversion.h.

69 {this, "OutputStripClustersName", "ITkStripClusters",
70 "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 76 of file InDetToXAODSpacePointConversion.h.

76 {this, "OutputStripOverlapSpacePointsName", "ITkStripOverlapSpacePoints",
77 "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 72 of file InDetToXAODSpacePointConversion.h.

72 {this, "OutputPixelSpacePointsName", "ITkPixelSpacePoints",
73 "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 74 of file InDetToXAODSpacePointConversion.h.

74 {this, "OutputStripSpacePointsName", "ITkStripSpacePoints",
75 "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 79 of file InDetToXAODSpacePointConversion.h.

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

◆ m_pixelID

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

Definition at line 86 of file InDetToXAODSpacePointConversion.h.

86{nullptr};

◆ m_processPixel

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

Definition at line 83 of file InDetToXAODSpacePointConversion.h.

83{this, "ProcessPixel", true};

◆ m_processStrip

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

Definition at line 84 of file InDetToXAODSpacePointConversion.h.

84{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 80 of file InDetToXAODSpacePointConversion.h.

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

◆ m_stripID

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

Definition at line 87 of file InDetToXAODSpacePointConversion.h.

87{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: