ATLAS Offline Software
Loading...
Searching...
No Matches
MuonTrackStatisticsTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef MUONTRACKSTATISTICSTOOL_MUONTRACKSTATISTICSTOOL_H
6#define MUONTRACKSTATISTICSTOOL_MUONTRACKSTATISTICSTOOL_H
7
8#include <string>
9
11#include "GaudiKernel/ServiceHandle.h"
12#include "GaudiKernel/ToolHandle.h"
17
18/* namespace Muon { */
19/* class IMuonEDMHelperSvc; */
20/* } */
21
22/* namespace Trk { */
23/* class ITruthToTrack; */
24/* } */
25
26static const InterfaceID IID_MuonTrackStatisticsTool("MuonTrackStatisticsTool", 1, 0);
27
29public:
30 // AlgTool Constructor
31 MuonTrackStatisticsTool(const std::string&, const std::string&, const IInterface*);
33
34 // tool interface
35 static const InterfaceID& interfaceID() { return IID_MuonTrackStatisticsTool; }
36
37 // Gaudi algorithm hooks
38 StatusCode initialize();
39 StatusCode finalize();
40 // statistics to be counted
42 TrackCounters(const std::string & trkLoc) :
43 trackLocation(trkLoc),
44 nEvents(0),
45 nTracks(0),
46 nHits(0),
47 nEtaHits(0),
48 nEtaTrig(0),
49 nPhiHits(0),
50 nScatter(0),
51 nHoles(0),
52 nPsudo(0),
53 summedchi2(0) {}
54
55 std::string trackLocation;
58 int nHits;
63 int nHoles;
64 int nPsudo;
65 double summedchi2;
66 };
67
69 TruthTrackCounters(const std::string & trkLoc) : trackLocation(trkLoc), nEvents(0), nTracks(0) {
70 for (unsigned int i = 0; i < 3; i++) {
71 nPIXELhits[i] = 0;
72 nSCThits[i] = 0;
73 nTRThits[i] = 0;
74 nMDThits[i] = 0;
75 nRPChits[i] = 0;
76 nTGChits[i] = 0;
77 nCSChits[i] = 0;
78 }
79 };
80
81 std::string trackLocation;
84 int nPIXELhits[3];
85 int nSCThits[3];
86 int nTRThits[3];
87 int nMDThits[3];
88 int nRPChits[3];
89 int nTGChits[3];
90 int nCSChits[3];
91 };
92
93 // function to access tracks and update counters
94 // First function is an interface to MuonTrackStatisticsAlg, which passes in the retrieved collection from SG and the name, which it
95 // uses to find the appropriate counter The counter and collection are then passed to the 2nd function, which does the updating
96 StatusCode updateTrackCounters(const std::string& name, const TrackCollection* tracks);
97 StatusCode updateTrackCounters(TrackCounters& counters, const TrackCollection& tracks);
98
99 StatusCode updateTruthTrackCounters(const std::string& name, const DetailedTrackTruthCollection* truthMap);
100 StatusCode updateTruthTrackCounters(TruthTrackCounters& counters, const DetailedTrackTruthCollection& TruthMap);
101
102 void addTrackCounters(const std::string& trkLoc);
103 // void addTruthTrackCounters( std::string trkLoc ) const;
104 std::string printTrackCounters() const;
105
106private:
107 // access to Id Helpers
108 ServiceHandle<Muon::IMuonEDMHelperSvc> m_edmHelperSvc{this, "edmHelper", "Muon::MuonEDMHelperSvc/MuonEDMHelperSvc",
109 "Handle to the service providing the IMuonEDMHelperSvc interface"};
110
112
113 std::vector<MuonTrackStatisticsTool::TrackCounters*> m_allCounters;
114 std::vector<MuonTrackStatisticsTool::TruthTrackCounters*> m_allTruthCounters;
115
116 void storeTruthTracks(void);
117};
118
119#endif // MUONTRACKSTATISTICSTOOL_MUONTRACKSTATISTICSTOOL_H
Extrapolation for HepMC particles.
static const InterfaceID IID_MuonTrackStatisticsTool("MuonTrackStatisticsTool", 1, 0)
DataVector< Trk::Track > TrackCollection
This typedef represents a collection of Trk::Track objects.
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
void addTrackCounters(const std::string &trkLoc)
std::vector< MuonTrackStatisticsTool::TrackCounters * > m_allCounters
StatusCode updateTrackCounters(const std::string &name, const TrackCollection *tracks)
StatusCode updateTruthTrackCounters(const std::string &name, const DetailedTrackTruthCollection *truthMap)
ServiceHandle< Muon::IMuonEDMHelperSvc > m_edmHelperSvc
std::vector< MuonTrackStatisticsTool::TruthTrackCounters * > m_allTruthCounters
static const InterfaceID & interfaceID()
MuonTrackStatisticsTool(const std::string &, const std::string &, const IInterface *)