-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconversionTools.h
102 lines (76 loc) · 2.86 KB
/
conversionTools.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#include <iostream>
#include <vector>
#include "Math/Point3D.h"
#include "Math/LorentzVector.h"
#include "Math/VectorUtil.h"
/*
Example of how to use this code:
//electron loop
for(unsigned int elidx = 0; elidx < els_p4().size(); elidx++) {
vector<ConversionInfo> v_convInfos = getConversionInfos(elidx, evt_bField(), 0.45);
ConversionInfo blah = findBestConversionMatch(v_convInfos);
cout << "Electron Pt: " << els_p4()[elidx].Pt() << endl;
cout << "dist: " << blah.dist() << endl;
cout << "dcot: " << blah.dcot() << endl;
cout << "flag: " << blah.flag() << endl;
cout << "rad. of conv" << blah.radiusOfConversion() << endl;
}
*/
typedef ROOT::Math::PositionVector3D<ROOT::Math::Cartesian3D<double> > XYZPoint;
typedef ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<float> > LorentzVector;
class ConversionInfo
{
public:
// constuct
ConversionInfo();
ConversionInfo
(
double p_dist,
double p_dcot,
double p_radiusOfConversion,
const XYZPoint& p_pointOfConversion,
int p_ctfPartnerIndex,
int p_gsfPartnerIndex,
int p_deltaMissingHits,
int p_flag
);
// destroy
~ConversionInfo();
// members
double dist() const {return dist_ ; }
double dcot() const {return dcot_ ; }
double radiusOfConversion() const { return radiusOfConversion_ ; }
int ctfPartnerIndex() const { return ctfPartnerIndex_; }
int gsfPartnerIndex() const { return gsfPartnerIndex_; }
XYZPoint pointOfConversion() const { return pointOfConversion_ ; }
//if the partner track is found in the CTF track collection,
//we return a ref to the CTF partner track
int deltaMissingHits() const { return deltaMissingHits_ ; }
//if(flag == 0) //Partner track found in the CTF collection using the electron's CTF track
//if(flag == 1) //Partner track found in the CTF collection using the electron's GSF track
//if(flag == 2) //Partner track found in the GSF collection using the electron's CTF track
//if(flag == 3) //Partner track found in the GSF collection using the electron's GSF track
int flag() const { return flag_ ; }
private:
double dist_;
double dcot_;
double radiusOfConversion_;
XYZPoint pointOfConversion_;
int ctfPartnerIndex_;
int gsfPartnerIndex_;
int deltaMissingHits_;
int flag_;
} ;
ConversionInfo getConversionInfo(const LorentzVector el_tk_p4,
const int el_charge,
const float el_d0,
const float el_dz,
const LorentzVector cand_p4,
const int cand_charge,
const float cand_d0,
const double bFieldAtOrigin);
ConversionInfo arbitrateConversionPartnersbyR(const std::vector<ConversionInfo>& v_convCandidates);
ConversionInfo findBestConversionMatch(const std::vector<ConversionInfo>& v_convCandidates);
std::vector<ConversionInfo> getConversionInfos(const int gsfElectronIdx,
const double bFieldAtOrigin,
const double minFracSharedHits);