38 HLTFilter_(iConfig.getParameter<vector<
string>>(
"HLTFilter")),
39 HLTPath_(iConfig.getParameter<vector<
string>>(
"HLTPath")) {
102 for (
unsigned int ip = 0; ip <
HLTPath.size(); ip++) {
103 int N_Triggers = trigResults->
size();
105 for (
int i_Trig = 0; i_Trig < N_Triggers; ++i_Trig) {
106 if (!trigResults->
accept(i_Trig))
109 if (TrigPath.find(
HLTPath[ip]) != std::string::npos)
118 std::vector<string> Seed) {
121 using namespace reco;
128 std::vector<std::array<float, 5>> max_per_trigger;
130 for (
unsigned int ipath = 0; ipath < Seed.size(); ipath++) {
131 std::vector<std::array<float, 5>> tot_tr_obj_pt_eta_phi;
132 if (!triggerObjectsSummary.
isValid())
134 size_t filterIndex = (*triggerObjectsSummary).filterIndex(
InputTag(Seed[ipath],
"",
"HLT"));
136 if (filterIndex < (*triggerObjectsSummary).sizeFilters()) {
138 for (
size_t j = 0;
j <
keys.size();
j++) {
140 std::array<float, 5> tr_obj_pt_eta_phi;
141 if (fabs(foundObject.
id()) != 13)
143 tr_obj_pt_eta_phi[0] = foundObject.
pt();
144 tr_obj_pt_eta_phi[1] = foundObject.
eta();
145 tr_obj_pt_eta_phi[2] = foundObject.
phi();
146 tr_obj_pt_eta_phi[3] = foundObject.
id() / fabs(foundObject.
id());
147 tot_tr_obj_pt_eta_phi.push_back(tr_obj_pt_eta_phi);
151 if (!tot_tr_obj_pt_eta_phi.empty()) {
152 std::sort(tot_tr_obj_pt_eta_phi.begin(),
153 tot_tr_obj_pt_eta_phi.end(),
154 [](
const std::array<float, 5>&
a,
const std::array<float, 5>&
b) {
return a[0] >
b[0]; });
155 max_per_trigger.push_back(tot_tr_obj_pt_eta_phi.at(0));
160 std::sort(max_per_trigger.begin(),
161 max_per_trigger.end(),
162 [](
const std::array<float, 5>&
a,
const std::array<float, 5>&
b) {
return a[0] >
b[0]; });
163 return max_per_trigger.at(0);
170 using namespace reco;
245 bool isFake =
vtx.isFake();
272 if (deltaRmu < MuTrgMatchCone && SelectedMu_DR > deltaRmu) {
278 bool tight =
false, soft =
false;
283 const Track* mutrack =
mu.bestTrack();
290 auto muTrack = std::make_shared<reco::Track>(*mutrack);
305 unsigned int count_el = -1;
318 const Track* eltrack = el.bestTrack();
323 auto ElTrack = std::make_shared<reco::Track>(*eltrack);
326 el_pt.push_back(eltrack->
pt());
344 if (trk.charge() == 0)
358 auto cleanTrack = std::make_shared<reco::Track>(trk);
369 TLorentzVector vel1, vel2;
370 std::vector<std::shared_ptr<reco::Track>> cleanedObjects;
374 cleanedObjects.push_back(vec);
379 cleanedObjects.push_back(vec);
382 if (cleanedObjects.empty())
385 for (
auto&
obj : cleanedObjects) {
387 unsigned int iobj = &
obj - &cleanedObjects[0];
389 float massLep = 0.0005;
400 vel1.SetPtEtaPhiM(
obj->pt(),
obj->eta(),
obj->phi(), massLep);
406 if (
obj->charge() * trk2->charge() == 1)
410 vel2.SetPtEtaPhiM(trk2->pt(), trk2->eta(), trk2->phi(), massLep);
427 float InvMassLepLep = (vel1 + vel2).M();
430 auto trantrk2 = std::make_shared<reco::TransientTrack>(
reco::TransientTrack(*trk2, &(*bFieldHandle)));
431 std::vector<reco::TransientTrack> tempTracks;
432 tempTracks.reserve(2);
433 tempTracks.push_back(*tranobj);
434 tempTracks.push_back(*trantrk2);
435 LLvertex = theKalmanFitter.
vertex(tempTracks);
446 -1 * ((theBeamSpot->
y0() - LLvertex.
position().
y()) +
451 float tempCos = vperp.Dot(pperp) / (vperp.R() * pperp.R());
467 auto tranobj = std::make_shared<reco::TransientTrack>(
reco::TransientTrack(*objtrk, &(*bFieldHandle)));
468 auto tranpair = std::make_shared<reco::TransientTrack>(
reco::TransientTrack(*pairtrk, &(*bFieldHandle)));
470 float massLep = 0.0005;
473 vel1.SetPtEtaPhiM(objtrk->pt(), objtrk->eta(), objtrk->phi(), massLep);
474 vel2.SetPtEtaPhiM(pairtrk->pt(), pairtrk->eta(), pairtrk->phi(), massLep);
477 if (trk->charge() == objtrk->charge() &&
487 vK.SetPtEtaPhiM(trk->pt(), trk->eta(), trk->phi(), 0.493);
489 float InvMass = (vel1 + vel2 + vK).M();
492 if ((vel1 + vel2 + vK).Pt() <
PtB_Cut)
494 auto trantrk = std::make_shared<reco::TransientTrack>(
reco::TransientTrack(*trk, &(*bFieldHandle)));
495 std::vector<reco::TransientTrack> tempTracks;
496 tempTracks.reserve(3);
497 tempTracks.push_back(*tranobj);
498 tempTracks.push_back(*tranpair);
499 tempTracks.push_back(*trantrk);
500 LLvertex = theKalmanFitter.
vertex(tempTracks);
508 -1 * ((theBeamSpot->
y0() - LLvertex.
position().
y()) +
511 math::XYZVector pperp((vel1 + vel2 + vK).Px(), (vel1 + vel2 + vK).Py(), 0);
513 float tempCos = vperp.Dot(pperp) / (vperp.R() * pperp.R());