forked from sPHENIX-Collaboration/coresoftware
/
QAG4SimulationTracking.h
88 lines (68 loc) · 2.43 KB
/
QAG4SimulationTracking.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#ifndef QA_QAG4SimulationTracking_H
#define QA_QAG4SimulationTracking_H
#include <g4eval/SvtxEvalStack.h>
#include <trackbase/TrkrDefs.h> // for cluskey
#include <fun4all/SubsysReco.h>
#include <memory>
#include <set>
#include <string>
#include <utility>
class PHCompositeNode;
class SvtxTrackMap;
class PHG4Hit;
class PHG4HitContainer;
class TrkrHitSetContainer;
class PHG4TruthInfoContainer;
class TrkrClusterContainer;
class TrkrClusterHitAssoc;
class TrkrHitTruthAssoc;
/// \class QAG4SimulationTracking
class QAG4SimulationTracking : public SubsysReco
{
public:
QAG4SimulationTracking(const std::string &name = "QAG4SimulationTracking");
virtual ~QAG4SimulationTracking() = default;
int Init(PHCompositeNode *topNode);
int InitRun(PHCompositeNode *topNode);
int process_event(PHCompositeNode *topNode);
// common prefix for QA histograms
std::string get_histo_prefix();
//! If added, only process truth particle associated with the selected list of EmbeddingIDs
//! Call multiple times to add multiple EmbeddingIDs
//! For EmbeddingID<0, all negative embedding IDs are accepted for pile up events.
void addEmbeddingID(int embeddingID);
//! range of the truth track eta to be analyzed
void setEtaRange(double low, double high)
{
m_etaRange.first = low;
m_etaRange.second = high;
}
//! only count unique truth<->reco track pair in tracking efficiency
void setUniqueTrackingMatch(bool b)
{
m_uniqueTrackingMatch = b;
}
private:
/// load nodes
int load_nodes(PHCompositeNode *);
// get geant hits associated to a cluster
using G4HitSet = std::set<PHG4Hit *>;
G4HitSet find_g4hits(TrkrDefs::cluskey) const;
std::unique_ptr<SvtxEvalStack> m_svtxEvalStack;
std::set<int> m_embeddingIDs;
//! range of the truth track eta to be analyzed
std::pair<double, double> m_etaRange = {-1, 1};
//! only count unique truth<->reco track pair in tracking efficiency
bool m_uniqueTrackingMatch = true;
PHG4TruthInfoContainer *m_truthContainer = nullptr;
SvtxTrackMap *m_trackMap = nullptr;
TrkrHitSetContainer *m_hitsets = nullptr;
TrkrClusterContainer *m_cluster_map = nullptr;
TrkrClusterHitAssoc *m_cluster_hit_map = nullptr;
TrkrHitTruthAssoc *m_hit_truth_map = nullptr;
PHG4HitContainer *m_g4hits_tpc = nullptr;
PHG4HitContainer *m_g4hits_intt = nullptr;
PHG4HitContainer *m_g4hits_mvtx = nullptr;
PHG4HitContainer *m_g4hits_micromegas = nullptr;
};
#endif // QA_QAG4SimulationTracking_H