ATLAS Offline Software
ITrkEventCnvTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TRKEVENTCNVTOOLS_ITRKEVENTCNVTOOL
6 #define TRKEVENTCNVTOOLS_ITRKEVENTCNVTOOL
7 
8 
9 #include "GaudiKernel/IAlgTool.h"
10 
11 #include "AthLinks/ElementLink.h"
12 #include "StoreGate/StoreGateSvc.h"
14 
15 #include "GaudiKernel/ServiceHandle.h"
16 #include "GaudiKernel/IMessageSvc.h"
17 #include "GaudiKernel/MsgStream.h"
18 
19 class Identifier;
20 class IdentifierHash;
21 
22 namespace Trk
23 {
24 
25 class TrkDetElementBase;
26 class PrepRawData;
27 class RIO_OnTrack;
28 
29 
30 class ITrkEventCnvTool : virtual public IAlgTool
31  {
32  public:
34  typedef std::string ELKey_t;
35  typedef unsigned int ELIndex_t;
36 
38 
39 
41  m_storeGate ( "StoreGateSvc", "ITrkEventCnvTool" ),
42  m_msgSvc ( "MessageSvc", "ITrkEventCnvTool" )
43  {
44 // m_log(&(*m_msgSvc), name() );
45  }
46 
48  virtual void checkRoT( const Trk::RIO_OnTrack& rioOnTrack ) const =0;
49 
54  virtual std::pair<const Trk::TrkDetElementBase*, const Trk::PrepRawData*>
55  getLinks( Trk::RIO_OnTrack& rioOnTrack ) const = 0;
56 
58  template <class CONT, class ROT> void prepareRIO_OnTrackElementLink(ROT* rot) const;
59 
61  template <class CONT, class ROT>
62  void prepareRIO_OnTrackElementLink(const ROT* rot,
63  ELKey_t& key,
64  ELIndex_t& index) const;
65 
67  template <class CONT, class ROT> bool getHashAndIndex(const ROT* rot,
68  const SG::ReadHandleKey<CONT>& contName,
69  typename ElementLink<CONT>::index_type& hashAndIndex) const;
70 
78  virtual void prepareRIO_OnTrack( Trk::RIO_OnTrack* rot) const =0;
79 
82  virtual void prepareRIO_OnTrackLink( const Trk::RIO_OnTrack* rot,
83  ELKey_t& key,
84  ELIndex_t& index ) const =0;
85 
87  virtual void recreateRIO_OnTrack( Trk::RIO_OnTrack *RoT ) const =0;
88 
90  virtual const Trk::TrkDetElementBase* getDetectorElement(const Identifier& id, const IdentifierHash& idHash) const =0;
91 
93  virtual const Trk::TrkDetElementBase* getDetectorElement(const Identifier& id) const =0;
94 
95  virtual void setRoT_Values(std::pair<const Trk::TrkDetElementBase *, const Trk::PrepRawData *>& pair, Trk::RIO_OnTrack *RoT ) const;
96 
97  private:
100 };
101 }
102 
104 
105 #endif
106 
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
Trk::ITrkEventCnvTool::DeclareInterfaceID
DeclareInterfaceID(ITrkEventCnvTool, 1, 0)
Trk::ITrkEventCnvTool::getLinks
virtual std::pair< const Trk::TrkDetElementBase *, const Trk::PrepRawData * > getLinks(Trk::RIO_OnTrack &rioOnTrack) const =0
This method must use the passed RIO_OnTrack to recover pointers The PrepRawData pointer will only be ...
index
Definition: index.py:1
Trk::ITrkEventCnvTool::m_storeGate
ServiceHandle< StoreGateSvc > m_storeGate
Definition: ITrkEventCnvTool.h:98
Trk::RIO_OnTrack
Definition: RIO_OnTrack.h:70
Trk::TrkDetElementBase
Definition: TrkDetElementBase.h:52
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
Trk::ITrkEventCnvTool::ELIndex_t
unsigned int ELIndex_t
Definition: ITrkEventCnvTool.h:35
Trk::ITrkEventCnvTool::prepareRIO_OnTrackElementLink
void prepareRIO_OnTrackElementLink(ROT *rot) const
This templated method will set the EL for the passed RIO_OnTrack.
Trk::ITrkEventCnvTool::m_msgSvc
ServiceHandle< IMessageSvc > m_msgSvc
Definition: ITrkEventCnvTool.h:99
Trk::ITrkEventCnvTool::prepareRIO_OnTrack
virtual void prepareRIO_OnTrack(Trk::RIO_OnTrack *rot) const =0
Take the passed RoT and prepare the PRD ElementLink for writing to disk.
Trk::ITrkEventCnvTool::getHashAndIndex
bool getHashAndIndex(const ROT *rot, const SG::ReadHandleKey< CONT > &contName, typename ElementLink< CONT >::index_type &hashAndIndex) const
This templated method will return the hashAndIndex of the passed RIO_OnTrack.
Trk::ITrkEventCnvTool
Definition: ITrkEventCnvTool.h:31
Trk::ITrkEventCnvTool::setRoT_Values
virtual void setRoT_Values(std::pair< const Trk::TrkDetElementBase *, const Trk::PrepRawData * > &pair, Trk::RIO_OnTrack *RoT) const
ITrkEventCnvTool.icc
Trk::ITrkEventCnvTool::getDetectorElement
virtual const Trk::TrkDetElementBase * getDetectorElement(const Identifier &id) const =0
Returns the detectorElement associated with this Identifier.
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::ITrkEventCnvTool::prepareRIO_OnTrackElementLink
void prepareRIO_OnTrackElementLink(const ROT *rot, ELKey_t &key, ELIndex_t &index) const
This templated method will find EL components for the passed RIO_OnTrack.
Trk::MeasurementBaseType::RIO_OnTrack
@ RIO_OnTrack
Definition: MeasurementBase.h:49
Trk::ITrkEventCnvTool::recreateRIO_OnTrack
virtual void recreateRIO_OnTrack(Trk::RIO_OnTrack *RoT) const =0
Take the passed RoT and recreate it (i.e.
Trk::ITrkEventCnvTool::ELKey_t
std::string ELKey_t
Key and index types used for an EL to IdentifiableContainer.
Definition: ITrkEventCnvTool.h:34
Trk::ITrkEventCnvTool::ITrkEventCnvTool
ITrkEventCnvTool()
Definition: ITrkEventCnvTool.h:40
Trk::ITrkEventCnvTool::getDetectorElement
virtual const Trk::TrkDetElementBase * getDetectorElement(const Identifier &id, const IdentifierHash &idHash) const =0
Returns the detectorElement associated with this Identifier & Hash.
Trk::ITrkEventCnvTool::prepareRIO_OnTrackLink
virtual void prepareRIO_OnTrackLink(const Trk::RIO_OnTrack *rot, ELKey_t &key, ELIndex_t &index) const =0
Similar, but just return the EL components rather then changing ROT.
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
StoreGateSvc.h
Trk::ITrkEventCnvTool::checkRoT
virtual void checkRoT(const Trk::RIO_OnTrack &rioOnTrack) const =0
check the passed RIO_OnTrack to make sure it is correctly filled
ServiceHandle< StoreGateSvc >
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
Identifier
Definition: IdentifierFieldParser.cxx:14