14 : dr2_(
std::
pow(iConfig.getParameter<double>(
"maxDeltaR"), 2)),
15 cut_(iConfig.getParameter<double>(
"maxPull")),
16 diagOnly_(iConfig.getParameter<
bool>(
"diagonalElementsOnly")),
17 useVertex_(iConfig.getParameter<
bool>(
"useVertexVariables")) {
19 if (
track ==
"standAloneMuon")
21 else if (
track ==
"combinedMuon")
23 else if (
track ==
"track")
27 <<
"MatcherByPullsAlgorithm: track '" <<
track <<
"' is not known\n"
28 <<
"Allowed values are: 'track', 'combinedMuon', 'standAloneMuon' (as per reco::RecoCandidate object)\n";
49 double pull = ROOT::Math::Similarity(
diff, invCov);
51 std::cout <<
"Tk charge/pt/eta/phi/vx/vy/vz " << tk.
charge() <<
"\t" << tk.
pt() <<
"\t" << tk.
eta() <<
"\t" << tk.
phi() <<
"\t" << tk.
vx() <<
"\t" << tk.
vy() <<
"\t" << tk.
vz() << std::endl;
52 std::cout <<
"MC charge/pt/eta/phi/vx/vy/vz " <<
c.charge() <<
"\t" <<
c.pt() <<
"\t" <<
c.eta() <<
"\t" <<
c.phi() <<
"\t" <<
c.vx() <<
"\t" <<
c.vy() <<
"\t" <<
c.vz() << std::endl;
55 for (
size_t i = 0;
i < 5; ++
i) {
61 for (
size_t i = 0;
i < 5; ++
i) {
66 std::cout <<
"Pull: " << pull << std::endl;
68 return std::pair<bool, float>(pull <
cut_, pull);
70 return std::pair<bool, float>(
false, 9e9);
74 const std::vector<reco::GenParticle> &
cands,
75 const std::vector<uint8_t> &good)
const {
77 return (tk ==
nullptr ? std::pair<int, float>(-1, 9e9) :
match(*tk,
cands, good));
81 const std::vector<reco::GenParticle> &
cands,
82 const std::vector<uint8_t> &good)
const {
83 std::pair<int, float> best(-1, 9e9);
87 for (
int i = 0,
n =
cands.size();
i <
n; ++
i) {
91 if (
m.first && (
m.second < best.second)) {
93 best.second =
m.second;
100 const std::vector<reco::GenParticle> &
cands,
101 const std::vector<uint8_t> &good,
102 std::vector<std::pair<double, int> > &matchesToFill)
const {
109 const std::vector<reco::GenParticle> &
cands,
110 const std::vector<uint8_t> &good,
111 std::vector<std::pair<double, int> > &matchesToFill)
const {
114 for (
int i = 0,
n =
cands.size();
i <
n; ++
i) {
117 std::pair<bool, double>
m =
match(tk,
cands[
i], invCov);
119 matchesToFill.push_back(std::make_pair(
m.second,
i));
121 std::sort(matchesToFill.begin(), matchesToFill.end());
134 return muon.standAloneMuon().isNonnull() ?
muon.standAloneMuon().get() :
nullptr;
136 return muon.combinedMuon().isNonnull() ?
muon.combinedMuon().get() :
nullptr;
138 return muon.track().isNonnull() ?
muon.track().get() :
nullptr;
147 for (
size_t i = 0;
i < 5; ++
i) {
148 for (
size_t j =
i + 1;
j < 5; ++
j) {
162 invCov.Place_at(momCov, 0, 0);