19 void SetHits(
Hit *hit1,
Hit *hit2);
29 void SetMatchedGenHardon();
30 bool IsMatchedGenHadron();
47 _matched_genhadron =
false;
55 _deta = _hit2->
Eta() - _hit1->Eta();
57 _matched_genhadron =
false;
67 _deta = _hit2->
Eta() - _hit1->Eta();
69 _matched_genhadron =
false;
87 float Tracklet::tklVtxZ() {
return (_hit1->posZ() - _hit1->rho() * (_hit2->posZ() - _hit1->posZ()) / (_hit2->rho() - _hit1->rho())); }
97 _matched_genhadron =
true;
109 vector<vector<Hit *>> layers = {{}, {}};
114 float PV_x, PV_y, PV_z, TruthPV_x, TruthPV_y,
TruthPV_z;
119 vector<float> prototkl_eta,
prototkl_phi, prototkl_deta, prototkl_dphi, prototkl_dR;
120 vector<float> recotklraw_eta,
recotklraw_phi, recotklraw_deta, recotklraw_dphi, recotklraw_dR;
121 vector<float> recotklgm_eta,
recotklgm_phi, recotklgm_deta, recotklgm_dphi, recotklgm_dR;
122 vector<float>
GenHadron_Pt, GenHadron_eta, GenHadron_phi, GenHadron_E, GenHadron_matched_Pt, GenHadron_matched_eta, GenHadron_matched_phi, GenHadron_matched_E;
127 outTree->Branch(
"event", &tkldata.
event);
128 outTree->Branch(
"NClusLayer1", &tkldata.
NClusLayer1);
129 outTree->Branch(
"NPrototkl", &tkldata.
NPrototkl);
133 outTree->Branch(
"PV_x", &tkldata.
PV_x);
134 outTree->Branch(
"PV_y", &tkldata.
PV_y);
135 outTree->Branch(
"PV_z", &tkldata.
PV_z);
136 outTree->Branch(
"trig", &tkldata.
trig);
137 outTree->Branch(
"clusPhi", &tkldata.
clusphi);
138 outTree->Branch(
"clusEta", &tkldata.
cluseta);
139 outTree->Branch(
"clusPhiSize", &tkldata.
clusphisize);
140 outTree->Branch(
"clusZSize", &tkldata.
cluszsize);
145 outTree->Branch(
"prototkl_dR", &tkldata.
prototkl_dR);
155 outTree->Branch(
"TruthPV_x", &tkldata.
TruthPV_x);
156 outTree->Branch(
"TruthPV_y", &tkldata.
TruthPV_y);
157 outTree->Branch(
"TruthPV_z", &tkldata.
TruthPV_z);
158 outTree->Branch(
"pu0_sel", &tkldata.
pu0_sel);
159 outTree->Branch(
"process", &tkldata.
process);
168 outTree->Branch(
"GenHadron_E", &tkldata.
GenHadron_E);
178 for (
size_t i = 0;
i < tkldata.
layers.size();
i++)
214 float Cut_dR = cutdr;
218 for (
auto ihitl1 : tkldata.
layers[0])
220 for (
auto ihitl2 : tkldata.
layers[1])
226 float dEta = ihitl2->Eta() - ihitl1->Eta();
227 float dPhi =
deltaPhi(ihitl2->Phi(), ihitl1->Phi());
228 float dR = sqrt(dEta * dEta + dPhi * dPhi);
256 if (tkl->Hit1()->IsMatchedTkl() || tkl->Hit2()->IsMatchedTkl())
263 tkl->Hit1()->SetMatchedTkl();
264 tkl->Hit2()->SetMatchedTkl();
281 if (tkl->IsMatchedGenHadron())
285 if (ghadron->IsMatchedToRecotkl() || tkl->IsMatchedGenHadron())
288 if (
deltaR(tkl->Eta(), tkl->Phi(), ghadron->Eta(), ghadron->Phi()) > 0.1)
292 tkl->SetMatchedGenHardon();
293 ghadron->SetMatchedToRecotkl();
294 tkl->SetGenHadron(ghadron);