ATLAS Offline Software
TrackValidationNtupleWriter.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // TrackValidationNtupleWriter.h, (c) ATLAS Detector software
8 
9 #ifndef TRK_TRACKVALIDATIONNTUPLEWRITER_H
10 #define TRK_TRACKVALIDATIONNTUPLEWRITER_H
11 
12 // Gaudi includes
14 #include "GaudiKernel/ToolHandle.h"
15 
19 
20 class TrackTruth;
21 class TTree;
22 
24 
25 namespace Trk {
26 
27 class Track;
28 class ITruthToTrack; // Produces perigee track parameters from generated parameters
29 class IGenParticleJetFinder;
30 class ITrackSelectorTool;
31 class ITrackValidationNtupleTool;
32 class IValidationNtupleTool;
33 class IGenParticleSelector;
34 class ITruthNtupleTool;
35 class IJetTruthNtupleTool;
36 class ITrackTruthClassifier;
37 class IEventPropertyNtupleTool;
38 class ValidationTrackTruthData;
39 class Vertex;
40 
49  public:
51  TrackValidationNtupleWriter(const std::string& name, ISvcLocator* pSvcLocator);
54 
61 
62 
63 protected:
66  //const Trk::TrackParameters* associateTruthToTrack( const Track*, const TrackCollection*, const TrackTruth*& );
67  StatusCode writeTrackData(unsigned int trackColIndex,
68  std::vector<Trk::ValidationTrackTruthData>& truthData,
69  const Trk::Vertex* primaryVertex = NULL);
70 
72  StatusCode writeTrackParticleData(unsigned int trackParticleColIndex);
73 
74  ToolHandleArray<Trk::ITrackValidationNtupleTool> m_ValidationNtupleTools;
75  ToolHandle<Trk::IValidationNtupleTool> m_ValTrkParticleNtupleTool;
76  ToolHandle<Trk::ITruthNtupleTool> m_truthNtupleTool;
77  ToolHandle<Trk::IJetTruthNtupleTool> m_jetTruthNtupleTool;
78  ToolHandleArray<Trk::ITrackTruthClassifier> m_trackTruthClassifierHandles;
79  std::vector<const Trk::ITrackTruthClassifier*> m_trackTruthClassifiers;
80  ToolHandleArray<Trk::IEventPropertyNtupleTool> m_eventPropertyNtupleHandles;
81  std::vector<Trk::IEventPropertyNtupleTool*> m_eventPropertyNtupleTools;
82 
83  std::vector<std::string> m_inputTrackCollection;
84  std::vector<std::string> m_inputTrackParticleCollection;
85  std::vector<std::string> m_trackTruthCollectionName;
88  std::string m_ntupleFileName;
89  std::string m_ntupleDirName;
90 
91  ToolHandle<Trk::ITruthToTrack> m_truthToTrack;
92  ToolHandle<Trk::ITrackSelectorTool> m_trackSelector;
93  ToolHandle<Trk::IGenParticleSelector> m_genPartSelector;
94  ToolHandle<Trk::IGenParticleJetFinder> m_genJetFinder;
96  bool m_doTruth;
98 
100  std::vector<unsigned int> m_nTrackTreeRecords;
101  std::vector<TTree*> m_trees;
103 };
104 
105 } // close of namespace
106 
107 #endif // TRK_TRACKVALIDATIONNTUPLEWRITER_H
108 
Trk::TrackValidationNtupleWriter::finalize
StatusCode finalize()
standard Athena-Algorithm method
Definition: TrackValidationNtupleWriter.cxx:732
Trk::Vertex
Definition: Tracking/TrkEvent/VxVertex/VxVertex/Vertex.h:26
Trk::TrackValidationNtupleWriter::m_inputTrackCollection
std::vector< std::string > m_inputTrackCollection
name of the TrackCollection
Definition: TrackValidationNtupleWriter.h:83
TrackParameters.h
xAOD::Vertex
Vertex_v1 Vertex
Define the latest version of the vertex class.
Definition: Event/xAOD/xAODTracking/xAODTracking/Vertex.h:16
Trk::TrackValidationNtupleWriter::m_eventLinkTree
TTree * m_eventLinkTree
pointer to event-wise ntuple trees (one for all input track collections + truth)
Definition: TrackValidationNtupleWriter.h:102
Trk::TrackValidationNtupleWriter::writeTrackParticleData
StatusCode writeTrackParticleData(unsigned int trackParticleColIndex)
method to write track particle data to Ntuple.
Definition: TrackValidationNtupleWriter.cxx:677
Trk::TrackValidationNtupleWriter::m_ValidationNtupleTools
ToolHandleArray< Trk::ITrackValidationNtupleTool > m_ValidationNtupleTools
set of tools for writing Trk::Track into the Ntuple
Definition: TrackValidationNtupleWriter.h:74
HepMC::GenParticlePtr
GenParticle * GenParticlePtr
Definition: GenParticle.h:37
Trk::TrackValidationNtupleWriter::execute
StatusCode execute()
standard Athena-Algorithm method
Definition: TrackValidationNtupleWriter.cxx:318
GenParticle_fwd.h
Trk::TrackValidationNtupleWriter::m_doTruth
bool m_doTruth
Switch to turn on / off truth.
Definition: TrackValidationNtupleWriter.h:96
Trk::TrackValidationNtupleWriter::m_inputTrackParticleCollection
std::vector< std::string > m_inputTrackParticleCollection
name of the TrackParticleCollection
Definition: TrackValidationNtupleWriter.h:84
Trk::TrackValidationNtupleWriter::~TrackValidationNtupleWriter
~TrackValidationNtupleWriter()
Default Destructor.
Trk::TrackValidationNtupleWriter::m_visibleParticleWithoutTruth
HepMC::GenParticlePtr m_visibleParticleWithoutTruth
Switch to turn on/pff recording track particle trees into Ntuple.
Definition: TrackValidationNtupleWriter.h:99
Trk::TrackValidationNtupleWriter::m_ntupleFileName
std::string m_ntupleFileName
jobOption: Ntuple file name
Definition: TrackValidationNtupleWriter.h:88
AthAlgorithm.h
Trk::TrackValidationNtupleWriter::initialize
StatusCode initialize()
standard Athena-Algorithm method
Definition: TrackValidationNtupleWriter.cxx:110
Trk::TrackValidationNtupleWriter::m_inputPrimaryVertexCollection
std::string m_inputPrimaryVertexCollection
SG key of the input primary vertex collection (used by the track selector)
Definition: TrackValidationNtupleWriter.h:87
Trk::TrackValidationNtupleWriter::m_eventPropertyNtupleTools
std::vector< Trk::IEventPropertyNtupleTool * > m_eventPropertyNtupleTools
list of event property tools
Definition: TrackValidationNtupleWriter.h:81
Trk::TrackValidationNtupleWriter::m_eventPropertyNtupleHandles
ToolHandleArray< Trk::IEventPropertyNtupleTool > m_eventPropertyNtupleHandles
jobO: list of event property tools
Definition: TrackValidationNtupleWriter.h:80
TrackTruthCollection.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TrackCollection.h
Trk::TrackValidationNtupleWriter
Definition: TrackValidationNtupleWriter.h:48
Trk::TrackValidationNtupleWriter::m_ValTrkParticleNtupleTool
ToolHandle< Trk::IValidationNtupleTool > m_ValTrkParticleNtupleTool
Tool for writting Rec::TrackParticle into the Ntuple – OBSOLETE.
Definition: TrackValidationNtupleWriter.h:75
Trk::TrackValidationNtupleWriter::m_genPartSelector
ToolHandle< Trk::IGenParticleSelector > m_genPartSelector
Tool handle to the Trk::IGenParticleSelector.
Definition: TrackValidationNtupleWriter.h:93
AthAlgorithm
Definition: AthAlgorithm.h:47
Trk::TrackValidationNtupleWriter::TrackValidationNtupleWriter
TrackValidationNtupleWriter(const std::string &name, ISvcLocator *pSvcLocator)
Standard Athena-Algorithm Constructor.
Definition: TrackValidationNtupleWriter.cxx:45
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Trk::TrackValidationNtupleWriter::m_trackTruthClassifierHandles
ToolHandleArray< Trk::ITrackTruthClassifier > m_trackTruthClassifierHandles
jobO: list of truth classifiers
Definition: TrackValidationNtupleWriter.h:78
Trk::TrackValidationNtupleWriter::m_ntupleDirName
std::string m_ntupleDirName
jobOption: Ntuple directory name
Definition: TrackValidationNtupleWriter.h:89
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
Trk::TrackValidationNtupleWriter::m_trackSelector
ToolHandle< Trk::ITrackSelectorTool > m_trackSelector
Tool handle to the Trk::ITrackSelectorTool.
Definition: TrackValidationNtupleWriter.h:92
Trk::TrackValidationNtupleWriter::m_genJetFinder
ToolHandle< Trk::IGenParticleJetFinder > m_genJetFinder
Tool to find jets.
Definition: TrackValidationNtupleWriter.h:94
TrackTruth
MC particle associated with a reco track + the quality of match.
Definition: TrackTruth.h:14
Trk::TrackValidationNtupleWriter::m_truthNtupleTool
ToolHandle< Trk::ITruthNtupleTool > m_truthNtupleTool
Definition: TrackValidationNtupleWriter.h:76
Trk::TrackValidationNtupleWriter::writeTrackData
StatusCode writeTrackData(unsigned int trackColIndex, std::vector< Trk::ValidationTrackTruthData > &truthData, const Trk::Vertex *primaryVertex=NULL)
< following methods and atributes are used in derived class TrigTrackValidationNtupleWriter Private m...
Definition: TrackValidationNtupleWriter.cxx:525
Trk::TrackValidationNtupleWriter::m_jetTruthNtupleTool
ToolHandle< Trk::IJetTruthNtupleTool > m_jetTruthNtupleTool
Definition: TrackValidationNtupleWriter.h:77
Trk::TrackValidationNtupleWriter::m_McEventCollectionName
std::string m_McEventCollectionName
name of the McEventCollection
Definition: TrackValidationNtupleWriter.h:86
Trk::TrackValidationNtupleWriter::m_trackTruthCollectionName
std::vector< std::string > m_trackTruthCollectionName
name of the TrackTruthCollection
Definition: TrackValidationNtupleWriter.h:85
Trk::TrackValidationNtupleWriter::m_trees
std::vector< TTree * > m_trees
Pointer to the NTuple trees (one for each input track collection)
Definition: TrackValidationNtupleWriter.h:101
Trk::TrackValidationNtupleWriter::m_nTrackTreeRecords
std::vector< unsigned int > m_nTrackTreeRecords
Definition: TrackValidationNtupleWriter.h:100
Trk::TrackValidationNtupleWriter::m_truthToTrack
ToolHandle< Trk::ITruthToTrack > m_truthToTrack
Tool handle to the Trk::TruthToTrack tool.
Definition: TrackValidationNtupleWriter.h:91
Track
Definition: TriggerChamberClusterOnTrackCreator.h:21
Trk::TrackValidationNtupleWriter::m_trackTruthClassifiers
std::vector< const Trk::ITrackTruthClassifier * > m_trackTruthClassifiers
the truth classifiers
Definition: TrackValidationNtupleWriter.h:79
Trk::TrackValidationNtupleWriter::m_doTrackParticle
bool m_doTrackParticle
Definition: TrackValidationNtupleWriter.h:97
Trk::TrackValidationNtupleWriter::m_useExternalEventLinkTree
bool m_useExternalEventLinkTree
if TVNW should make event tree itself or assume CBNT does
Definition: TrackValidationNtupleWriter.h:95