ATLAS Offline Software
Loading...
Searching...
No Matches
InDetPRD_Provider.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
6// InDetPRD_Provider.h, (c) ATLAS Detector software
8
9#ifndef INDET_INDETASSOCIATIONTOOLS_INDETPRDPROVIDER_H
10#define INDET_INDETASSOCIATIONTOOLS_INDETPRDPROVIDER_H 1
11
12// Gaudi
14#include "GaudiKernel/ToolHandle.h"
15// InDet includes; these are needed (cannot be fwd declared) for template type deduction
19// Trk includes
23
25
28
29class AtlasDetectorID;
30class PixelID;
31class SCT_ID;
32class TRT_ID;
33class Identifier;
34class IdentifierHash;
35namespace InDet {
36
44
45 class InDetPRD_Provider : public AthAlgTool, virtual public Trk::IPRD_Provider {
46
47 public:
48 //** Constructor with parameters */
49 InDetPRD_Provider( const std::string& t, const std::string& n, const IInterface* p );
50
52 StatusCode initialize();
53
55 StatusCode finalize();
56
58 const Trk::PrepRawData* prdFromIdentifier(const Identifier& ide, size_t& ndof ) const;
59
60 private:
62 template < class PrdT > const Trk::PrepRawData* prdFromIdentifierContainer(
64 const Identifier& ideh, const IdentifierHash& ideHash ) const
65 {
66 // find the collection
67 const Trk::PrepRawDataCollection< PrdT >* prdCollection = cont.indexFindPtr(ideHash);
68 if ( prdCollection == nullptr ){
69 ATH_MSG_VERBOSE("PRD Collection to IdentifierHash could not be found. Return 0.");
70 return 0;
71 }
72 // search for the PRD in the collection --- do a loop, can be done better with std::find probably
73 const PrdT* prd = 0;
74 // iterate through the collections
75 typename Trk::PrepRawDataCollection< PrdT >::const_iterator prdIter = prdCollection->begin();
76 typename Trk::PrepRawDataCollection< PrdT >::const_iterator prdIterE = prdCollection->end();
77 for ( ; prdIter != prdIterE; ++prdIter ){
78 if ( (*prdIter)->identify() == ideh ){
79 prd = (*prdIter);
80 break;
81 }
82 }
83 // return what you have
84 return prd;
85 }
86
88
92 // For P->T converter of Pixel Clusters
93 SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_pixelDetEleCollKey{this, "PixelDetEleCollKey", "PixelDetectorElementCollection", "Key of SiDetectorElementCollection for Pixel"};
94
98 // For P->T converter of SCT_Clusters
99 SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_SCTDetEleCollKey{this, "SCTDetEleCollKey", "SCT_DetectorElementCollection", "Key of SiDetectorElementCollection for SCT"};
100
104
105 };
106
107
108} // end of namespace
109
110#endif // INDET_INDETASSOCIATIONTOOLS_INDETPRDPROVIDER_H
#define ATH_MSG_VERBOSE(x)
Property holding a SG store/key/clid from which a ReadHandle is made.
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
This is a "hash" representation of an Identifier.
SG::ReadHandleKey< PixelClusterContainer > m_pixClusterContainerKey
StatusCode finalize()
finalize
const Trk::PrepRawData * prdFromIdentifier(const Identifier &ide, size_t &ndof) const
return the Prd given the Identifier - make a HashId out of the Id and return the associated PRD
SG::ReadHandleKey< SCT_ClusterContainer > m_sctClusterContainerKey
InDetPRD_Provider(const std::string &t, const std::string &n, const IInterface *p)
StatusCode initialize()
Athena algtool's Hooks.
SG::ReadHandleKey< TRT_DriftCircleContainer > m_trtDriftCircleContainerKey
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_SCTDetEleCollKey
const Trk::PrepRawData * prdFromIdentifierContainer(const Trk::PrepRawDataContainer< Trk::PrepRawDataCollection< PrdT > > &cont, const Identifier &ideh, const IdentifierHash &ideHash) const
templated method since used for Pixel/SCT/TRT
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_pixelDetEleCollKey
const PixelID * m_pixIdHelper
Helper to detect type of sub-detector from PRD->identify().
const AtlasDetectorID * m_idHelper
This is an Identifier helper class for the Pixel subdetector.
Definition PixelID.h:67
This is an Identifier helper class for the SCT subdetector.
Definition SCT_ID.h:68
Property holding a SG store/key/clid from which a ReadHandle is made.
This is an Identifier helper class for the TRT subdetector.
Definition TRT_ID.h:82
Simple interface that takes an identifier and find the associated PRD from an Identifyable container.
Primary Vertex Finder.