ATLAS Offline Software
TrackAnalysisInfoWriteTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef INDETTRACKPERFMON_TRACKANALYSISINFOWRITETOOL_H
6 #define INDETTRACKPERFMON_TRACKANALYSISINFOWRITETOOL_H
7 
15 #include "AsgTools/AsgTool.h"
17 #include "StoreGate/WriteHandle.h"
18 
20 #include "xAODCore/BaseContainer.h"
21 
23 #include <string>
24 #include <vector>
25 
28 
29 
30 namespace IDTPM {
31 
33  template< typename coll_t >
35 
36  template< typename coll_t >
37  using VecEL_t = std::vector< EL_t< coll_t > >;
38 
39  template< typename coll_t >
40  using Vec_t = std::vector< typename coll_t::const_value_type >;
41 
42  using VecF_t = std::vector< float >;
43 
44  template< typename Tcoll_t, typename Rcoll_t >
45  using MatchInfo_t = std::tuple< VecEL_t<Tcoll_t>, VecEL_t<Rcoll_t>, VecF_t >;
46 
50 
51 
53  public virtual asg::IAsgTool,
54  public asg::AsgTool {
55 
57 
58  public:
59 
61  TrackAnalysisInfoWriteTool( const std::string& name );
62 
64  virtual ~TrackAnalysisInfoWriteTool() = default;
65 
67  virtual StatusCode initialize() override;
68 
72  TrackAnalysisCollections& trkAnaColls,
73  const std::string& chain = "",
74  unsigned int roiIdx = 0,
75  const std::string& roiStr = "" ) const;
76 
78  std::string printInfo(
80 
81  private:
82 
84  template< typename Tcoll_t, typename Rcoll_t >
86  const Vec_t< Tcoll_t >& Tvec,
87  const Vec_t< Rcoll_t >& Rvec,
88  const Tcoll_t* Tcoll,
89  const Rcoll_t* Rcoll,
90  const ITrackMatchingLookup* matches ) const;
91 
93  template< typename Tcoll_t, typename Rcoll_t >
94  std::string printMatchInfo(
95  const VecEL_t< Tcoll_t >& testVec,
96  const VecEL_t< Rcoll_t >& refVec,
97  const VecF_t& distVec ) const;
98 
99  StringProperty m_anaTag{ this, "AnaTag", "", "Track analysis tag" };
100 
101  SmartIF<ITrackAnalysisDefinitionSvc> m_trkAnaDefSvc;
102 
103  }; // class TrackAnalysisInfoWriteTool
104 
105 } // namespace IDTPM
106 
108 
109 #endif // > !INDETTRACKPERFMON_TRACKANALYSISINFOWRITETOOL_H
IDTPM::Vec_t
std::vector< typename coll_t::const_value_type > Vec_t
Definition: TrackAnalysisInfoWriteTool.h:40
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
ITrackAnalysisDefinitionSvc.h
IDTPM::MatchInfo_t
std::tuple< VecEL_t< Tcoll_t >, VecEL_t< Rcoll_t >, VecF_t > MatchInfo_t
Definition: TrackAnalysisInfoWriteTool.h:45
runLayerRecalibration.chain
chain
Definition: runLayerRecalibration.py:175
IDTPM::TrackAnalysisCollections
Definition: TrackAnalysisCollections.h:46
IDTPM::TrackAnalysisInfoWriteTool::initialize
virtual StatusCode initialize() override
RoiSelectionTool methods.
Definition: TrackAnalysisInfoWriteTool.cxx:34
IDTPM::TrackAnalysisInfoWriteTool::TrackAnalysisInfoWriteTool
TrackAnalysisInfoWriteTool(const std::string &name)
Constructor.
Definition: TrackAnalysisInfoWriteTool.cxx:26
IDTPM::VecEL_t
std::vector< EL_t< coll_t > > VecEL_t
Definition: TrackAnalysisInfoWriteTool.h:37
asg::IAsgTool
Base class for the dual-use tool interface classes.
Definition: IAsgTool.h:41
IDTPM::TrackAnalysisInfoWriteTool::printMatchInfo
std::string printMatchInfo(const VecEL_t< Tcoll_t > &testVec, const VecEL_t< Rcoll_t > &refVec, const VecF_t &distVec) const
Print match info (for debug)
IDTPM::TrackAnalysisInfoWriteTool::m_anaTag
StringProperty m_anaTag
Definition: TrackAnalysisInfoWriteTool.h:99
WriteHandle.h
Handle class for recording to StoreGate.
IDTPM::TrackAnalysisInfoWriteTool::~TrackAnalysisInfoWriteTool
virtual ~TrackAnalysisInfoWriteTool()=default
Destructor.
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
parseDir.wh
wh
Definition: parseDir.py:46
IDTPM::VecF_t
std::vector< float > VecF_t
Definition: TrackAnalysisInfoWriteTool.h:42
TrackAnalysisInfoWriteTool.icc
IDTPM::TrackAnalysisInfoWriteTool
Definition: TrackAnalysisInfoWriteTool.h:54
IDTPM::TrackAnalysisInfoWriteTool::printInfo
std::string printInfo(SG::WriteHandle< xAOD::BaseContainer > &wh) const
Print info (for debug)
Definition: TrackAnalysisInfoWriteTool.cxx:136
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
IDTPM::TrackAnalysisInfoWriteTool::getMatchInfo
MatchInfo_t< Tcoll_t, Rcoll_t > getMatchInfo(const Vec_t< Tcoll_t > &Tvec, const Vec_t< Rcoll_t > &Rvec, const Tcoll_t *Tcoll, const Rcoll_t *Rcoll, const ITrackMatchingLookup *matches) const
getMatchInfo
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
BaseContainer.h
IDTPM::TrackAnalysisInfoWriteTool::ASG_TOOL_CLASS
ASG_TOOL_CLASS(TrackAnalysisInfoWriteTool, IAsgTool)
IDTPM::ITrackMatchingLookup
Definition: ITrackMatchingLookup.h:30
IDTPM
Athena include(s).
Definition: IPlotsDefinitionSvc.h:25
AsgTool.h
IDTPM::TrackAnalysisInfoWriteTool::write
StatusCode write(SG::WriteHandle< xAOD::BaseContainer > &wh, TrackAnalysisCollections &trkAnaColls, const std::string &chain="", unsigned int roiIdx=0, const std::string &roiStr="") const
Main writing function.
Definition: TrackAnalysisInfoWriteTool.cxx:51
IDTPM::TrackAnalysisInfoWriteTool::m_trkAnaDefSvc
SmartIF< ITrackAnalysisDefinitionSvc > m_trkAnaDefSvc
Definition: TrackAnalysisInfoWriteTool.h:101