ATLAS Offline Software
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 
29 class AtlasDetectorID;
30 class PixelID;
31 class SCT_ID;
32 class TRT_ID;
33 class Identifier;
34 class IdentifierHash;
35 namespace InDet {
36 
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 
53 
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 
91  {this, "PixelClusterContainer", ""};
92  // For P->T converter of Pixel Clusters
93  SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_pixelDetEleCollKey{this, "PixelDetEleCollKey", "PixelDetectorElementCollection", "Key of SiDetectorElementCollection for Pixel"};
94 
97  {this, "SCT_ClusterContainer", ""};
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 
103  {this, "TRT_DriftCircleContainer", ""};
104 
105  };
106 
107 
108 } // end of namespace
109 
110 #endif // INDET_INDETASSOCIATIONTOOLS_INDETPRDPROVIDER_H
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
IDTPM::ndof
float ndof(const U &p)
Definition: TrackParametersHelper.h:132
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
PrepRawDataCollection.h
InDet
Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
InDet::InDetPRD_Provider::prdFromIdentifier
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
Definition: InDetPRD_Provider.cxx:69
Trk::PrepRawDataCollection
Definition: PrepRawDataCollection.h:36
InDet::InDetPRD_Provider::prdFromIdentifierContainer
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
Definition: InDetPRD_Provider.h:62
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
SG::ReadHandleKey< PixelClusterContainer >
PrepRawDataContainer.h
InDet::InDetPRD_Provider::m_trtIdHelper
const TRT_ID * m_trtIdHelper
Definition: InDetPRD_Provider.h:101
InDet::InDetPRD_Provider::InDetPRD_Provider
InDetPRD_Provider(const std::string &t, const std::string &n, const IInterface *p)
Definition: InDetPRD_Provider.cxx:26
InDet::InDetPRD_Provider::m_pixelDetEleCollKey
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_pixelDetEleCollKey
Definition: InDetPRD_Provider.h:93
Trk::IPRD_Provider
Simple interface that takes an identifier and find the associated PRD from an Identifyable container.
Definition: IPRD_Provider.h:33
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
InDet::InDetPRD_Provider::m_pixIdHelper
const PixelID * m_pixIdHelper
Helper to detect type of sub-detector from PRD->identify().
Definition: InDetPRD_Provider.h:89
InDet::InDetPRD_Provider::finalize
StatusCode finalize()
finalize
Definition: InDetPRD_Provider.cxx:62
beamspotman.n
n
Definition: beamspotman.py:731
InDet::InDetPRD_Provider::initialize
StatusCode initialize()
Athena algtool's Hooks.
Definition: InDetPRD_Provider.cxx:37
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
InDet::InDetPRD_Provider::m_trtDriftCircleContainerKey
SG::ReadHandleKey< TRT_DriftCircleContainer > m_trtDriftCircleContainerKey
Definition: InDetPRD_Provider.h:103
ReadCondHandleKey.h
Trk::PrepRawData
Definition: PrepRawData.h:62
TRT_DriftCircleContainer.h
PixelClusterContainer.h
SiDetectorElementCollection.h
DataVector< PrepRawDataT >::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection >
InDet::InDetPRD_Provider::m_SCTDetEleCollKey
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_SCTDetEleCollKey
Definition: InDetPRD_Provider.h:99
TRT_ID
Definition: TRT_ID.h:84
IPRD_Provider.h
SCT_ID
Definition: SCT_ID.h:68
Trk::PrepRawDataContainer
Definition: PrepRawDataContainer.h:26
SCT_ClusterContainer.h
InDet::InDetPRD_Provider::m_pixClusterContainerKey
SG::ReadHandleKey< PixelClusterContainer > m_pixClusterContainerKey
Definition: InDetPRD_Provider.h:91
InDet::InDetPRD_Provider
Definition: InDetPRD_Provider.h:45
AthAlgTool
Definition: AthAlgTool.h:26
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
PixelID
Definition: PixelID.h:67
AtlasDetectorID
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
Definition: AtlasDetectorID.h:57
DataVector< PrepRawDataT >::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
InDet::InDetPRD_Provider::m_sctClusterContainerKey
SG::ReadHandleKey< SCT_ClusterContainer > m_sctClusterContainerKey
Definition: InDetPRD_Provider.h:97
InDet::InDetPRD_Provider::m_idHelper
const AtlasDetectorID * m_idHelper
Definition: InDetPRD_Provider.h:87
InDet::InDetPRD_Provider::m_sctIdHelper
const SCT_ID * m_sctIdHelper
Definition: InDetPRD_Provider.h:95
Identifier
Definition: IdentifierFieldParser.cxx:14