-
Notifications
You must be signed in to change notification settings - Fork 72
Expand file tree
/
Copy pathTrackInspectAlg.h
More file actions
110 lines (93 loc) · 4.25 KB
/
TrackInspectAlg.h
File metadata and controls
110 lines (93 loc) · 4.25 KB
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#ifndef HITSCANPROCESSOR_H
#define HITSCANPROCESSOR_H
#include "k4FWCore/DataHandle.h"
#include "GaudiKernel/Algorithm.h"
#include "edm4hep/TrackCollection.h"
#if __has_include("edm4hep/TrackerHit3D.h")
#include "edm4hep/TrackerHit3D.h"
#else
#include "edm4hep/TrackerHit.h"
namespace edm4hep {
using TrackerHit3D = edm4hep::TrackerHit;
} // namespace edm4hep
#endif
#include "edm4hep/MCParticle.h"
#include "edm4hep/MCParticleCollection.h"
#include "edm4hep/SimTrackerHitCollection.h"
#if __has_include("edm4hep/TrackerHit3DCollection.h")
#include "edm4hep/TrackerHit3DCollection.h"
#else
#include "edm4hep/TrackerHitCollection.h"
namespace edm4hep {
using TrackerHit3DCollection = edm4hep::TrackerHitCollection;
} // namespace edm4hep
#endif
#include "edm4hep/MCRecoTrackerAssociationCollection.h"
#include "GaudiKernel/NTuple.h"
class TrackInspectAlg : public Algorithm {
public :
TrackInspectAlg(const std::string& name, ISvcLocator* pSvcLocator);
~TrackInspectAlg(){};
StatusCode initialize() override;
StatusCode execute() override;
StatusCode finalize() override;
private :
// TruthMatchProcessor
DataHandle<edm4hep::TrackCollection> _inTrackColHdl{"InputTrackCollection", Gaudi::DataHandle::Reader, this};
DataHandle<edm4hep::MCParticleCollection> _inMCParticleColHdl{"InputMCParticleCollection", Gaudi::DataHandle::Reader, this};
DataHandle<edm4hep::MCRecoTrackerAssociationCollection> _TPCRelColHdl{"TPCTrackerHitRelations", Gaudi::DataHandle::Reader, this};
DataHandle<edm4hep::MCRecoTrackerAssociationCollection> _VXDRelColHdl{"VXDTrackerHitRelations", Gaudi::DataHandle::Reader, this};
DataHandle<edm4hep::MCRecoTrackerAssociationCollection> _SITRelColHdl{"SITTrackerHitRelations", Gaudi::DataHandle::Reader, this};
DataHandle<edm4hep::MCRecoTrackerAssociationCollection> _SETRelColHdl{"SETTrackerHitRelations", Gaudi::DataHandle::Reader, this};
DataHandle<edm4hep::MCRecoTrackerAssociationCollection> _FTDRelColHdl{"FTDTrackerHitRelations", Gaudi::DataHandle::Reader, this};
Gaudi::Property<double> _weight{this, "Weight", 0.5};
Gaudi::Property<bool> _useTPC{this, "useTPC", true};
Gaudi::Property<bool> _useVXD{this, "useVXD", true};
Gaudi::Property<bool> _useSIT{this, "useSIT", true};
Gaudi::Property<bool> _useSET{this, "useSET", true};
Gaudi::Property<bool> _useFTD{this, "useFTD", true};
std::map<std::pair<edm4hep::TrackerHit3D, edm4hep::MCParticle>, double> hitmap;
std::vector<std::tuple<edm4hep::MCParticle, edm4hep::Track, double>> matchvec;
double match(edm4hep::MCParticle, edm4hep::Track);
void initializeRelationCollections(std::vector<const edm4hep::MCRecoTrackerAssociationCollection*> &relCols);
int _nEvt;
std::string m_thisName;
// TrackingEfficiency
void Fill(edm4hep::MCParticle, edm4hep::Track);
std::vector<edm4hep::Track> MCParticleTrackAssociator(edm4hep::MCParticle);
std::map<edm4hep::MCParticle, std::vector<edm4hep::SimTrackerHit>> mcpHitMap;
std::string treeFileName;
NTuple::Tuple* m_tuple;
NTuple::Item<long> m_nParticles;
NTuple::Array<double> vx;
NTuple::Array<double> vy;
NTuple::Array<double> vz;
NTuple::Array<double> ex;
NTuple::Array<double> ey;
NTuple::Array<double> ez;
NTuple::Array<double> Omega;
NTuple::Array<double> D0;
NTuple::Array<double> Z0;
NTuple::Array<double> Phi;
NTuple::Array<double> TanLambda;
NTuple::Array<double> TRUEPX;
NTuple::Array<double> TRUEPY;
NTuple::Array<double> TRUEPZ;
NTuple::Array<double> TRUEPE;
NTuple::Array<double> TRUEPT;
NTuple::Array<double> TRUEP;
NTuple::Array<double> TRUEETA;
NTuple::Array<double> TRUEY;
NTuple::Array<double> TRUETHETA;
NTuple::Array<int> eventNumber;
NTuple::Array<int> particleNumber;
NTuple::Array<int> totalCandidates;
NTuple::Array<int> nCandidate;
NTuple::Array<int> pid;
NTuple::Array<int> nHits;
NTuple::Array<int> WMSelectionVariable;
// TTree tree;
// TTree tuple;
// TFile treeFile;
};
#endif