243 tnp_(iConfig.getParameter<
bool>("
tnp")),
244 L3_(iConfig.getParameter<
int>("
L3")),
248 Jpsi_(iConfig.getParameter<
int>("
Jpsi")),
251 enum_(iConfig.getParameter<
int>("
enum")),
321 istnp =
"Tag_and_Probe/";
336 histname = trMuPh +
"Pt";
337 histtitle = trMuPh +
"_P_{t}";
341 histname = trMuPh +
"Phi";
342 histtitle = trMuPh +
"Phi";
346 histname = trMuPh +
"Eta";
347 histtitle = trMuPh +
"_Eta";
359 histname = trMuPh +
"1Pt";
360 histtitle = trMuPh +
"1_P_{t}";
364 histname = trMuPh +
"1Phi";
365 histtitle = trMuPh +
"1Phi";
369 histname = trMuPh +
"1Eta";
370 histtitle = trMuPh +
"1_Eta";
374 histname = trMuPh +
"2Pt";
375 histtitle = trMuPh +
"2_P_{t}";
379 histname = trMuPh +
"2Phi";
380 histtitle = trMuPh +
"2Phi";
384 histname = trMuPh +
"2Eta";
385 histtitle = trMuPh +
"2_Eta";
396 histname = trMuPh +
"3Eta";
397 histtitle = trMuPh +
"3Eta";
401 histname = trMuPh +
"3Pt";
402 histtitle = trMuPh +
"3_P_{t}";
406 histname = trMuPh +
"3Phi";
407 histtitle = trMuPh +
"3Phi";
412 histname =
"DiMuEta";
413 histtitle =
"DiMuEta";
418 histtitle =
"DiMu_P_{t}";
422 histname =
"DiMuPhi";
423 histtitle =
"DiMuPhi";
429 histtitle =
"DiMudR";
434 histname =
"DiMuMass";
435 histtitle =
"DiMuMass";
439 }
else if (
enum_ == 8) {
440 histname =
"DiMuProb";
441 histtitle =
"DiMuProb";
445 histname =
"DiMuPVcos";
446 histtitle =
"DiMuPVcos";
451 histtitle =
"DiMuDS";
455 histname =
"DiMuDCA";
456 histtitle =
"DiMuDCA";
502 double PrescaleWeight = 1.0;
515 std::vector<reco::Muon> tagMuons;
516 for (
auto const&
m : *muoHandle) {
520 tagMuons.push_back(
m);
523 for (
int i = 0;
i <
int(tagMuons.size());
i++) {
524 for (
auto const&
m : *muoHandle) {
527 if ((tagMuons[
i].
pt() ==
m.pt()))
552 for (
auto const&
m : *muoHandle) {
558 for (
auto const& m1 : *muoHandle) {
559 if (!(m1.pt() >
m.pt()))
572 if (
m.charge() * m1.charge() > 0)
579 std::vector<reco::TransientTrack> j_tks;
582 j_tks.push_back(mu1TT);
583 j_tks.push_back(mu2TT);
590 if ((jpsivertex.
chi2() >= 0) && (jpsivertex.
ndof() > 0))
591 dimuonCL = TMath::Prob(jpsivertex.
chi2(), jpsivertex.
ndof());
596 -1 * ((vertexBeamSpot.
x0() - jVertex.
x()) + (jVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dxdz()),
597 -1 * ((vertexBeamSpot.
y0() - jVertex.
y()) + (jVertex.
z() - vertexBeamSpot.
z0()) * vertexBeamSpot.
dydz()),
600 float jpsi_cos = vperpj.Dot(jpperp) / (vperpj.R() * jpperp.R());
609 double DiMuMass = (m1.p4() +
m.p4()).M();
795 for (
auto const&
m2 : *muoHandle) {
796 if (
m2.pt() ==
m.pt())
798 if (
m2.pt() == m1.pt())
837 if (!phHandle->empty())
838 for (
auto const&
p : *phHandle) {
869 if ((displacementFromBeamspotJpsi.
perp() /
sqrt(jerr.
rerr(displacementFromBeamspotJpsi))) <
minDS)
888 sqrt(jerr.
rerr(displacementFromBeamspotJpsi)));
901 displacementFromBeamspotJpsi.
perp() /
sqrt(jerr.
rerr(displacementFromBeamspotJpsi)), PrescaleWeight);
915 if (fabs(jpsi_cos) <
mincos)
917 if ((displacementFromBeamspotJpsi.
perp() /
sqrt(jerr.
rerr(displacementFromBeamspotJpsi))) <
minDS)
921 for (
auto const&
t : *trHandle) {
936 double e1 =
sqrt(
m.momentum().Mag2() + MuMass2);
937 double e2 =
sqrt(m1.momentum().Mag2() + MuMass2);
946 std::vector<reco::TransientTrack> t_tks;
947 t_tks.push_back(mu1TT);
948 t_tks.push_back(mu2TT);
949 t_tks.push_back(trTT);
968 float jpsiKcos = vperp.Dot(pperp) / (vperp.R() * pperp.R());
971 if (fabs(jpsiKcos) <
mincos)
973 if ((displacementFromBeamspot.
perp() /
sqrt(
err.rerr(displacementFromBeamspot))) <
minDS)
999 if (trHandle.isValid())
1000 for (
auto const&
t : *trHandle) {
1015 double e2 =
sqrt(m1.momentum().Mag2() + MuMass2);
1023 std::vector<reco::TransientTrack> t_tks;
1024 t_tks.push_back(mu2TT);
1025 t_tks.push_back(trTT);
1070 if (fabs(jpsi_cos) <
mincos)
1072 if (displacementFromBeamspotJpsi.
perp() /
sqrt(jerr.
rerr(displacementFromBeamspotJpsi)) <
minDS)
1075 if (trHandle.isValid())
1076 for (
auto const&
t : *trHandle) {
1084 for (
auto const&
t1 : *trHandle) {
1085 if (&
t - &(*trHandle)[0] >= &
t1 - &(*trHandle)[0])
1106 double e1 =
sqrt(
m.momentum().Mag2() + MuMass2);
1107 double e2 =
sqrt(m1.momentum().Mag2() + MuMass2);
1124 std::vector<reco::TransientTrack> t_tks;
1125 t_tks.push_back(mu1TT);
1126 t_tks.push_back(mu2TT);
1127 t_tks.push_back(trTT);
1128 t_tks.push_back(tr1TT);
1138 m.px() + m1.px() + itrk1.
px() + itrk2.
px(),
m.py() + m1.py() + itrk1.
py() + itrk2.
py(), 0.);
1148 float jpsiKcos = vperp.Dot(pperp) / (vperp.R() * pperp.R());
1151 if (fabs(jpsiKcos) <
mincos)
1153 if ((displacementFromBeamspot.
perp() /
sqrt(
err.rerr(displacementFromBeamspot))) <
minDS)
1195 desc.add<
bool>(
"requireValidHLTPaths",
true);
1205 "isPFMuon & isGlobalMuon & innerTrack.hitPattern.trackerLayersWithMeasurement>5 & "
1206 "innerTrack.hitPattern.numberOfValidPixelHits> 0");
1209 "isGlobalMuon && isPFMuon && isTrackerMuon && abs(eta) < 2.4 && innerTrack.hitPattern.numberOfValidPixelHits > 0 "
1210 "&& innerTrack.hitPattern.trackerLayersWithMeasurement > 5 && globalTrack.hitPattern.numberOfValidMuonHits > 0 "
1211 "&& globalTrack.normalizedChi2 < 10");
1213 "isPFMuon & isGlobalMuon & innerTrack.hitPattern.trackerLayersWithMeasurement>5 & "
1214 "innerTrack.hitPattern.numberOfValidPixelHits> 0");
1218 desc.add<
int>(
"nmuons", 1);
1219 desc.add<
bool>(
"tnp",
false);
1220 desc.add<
int>(
"L3", 0);
1221 desc.add<
int>(
"ptCut", 0);
1222 desc.add<
int>(
"displaced", 0);
1223 desc.add<
int>(
"trOrMu", 0);
1224 desc.add<
int>(
"Jpsi", 0);
1225 desc.add<
int>(
"Upsilon", 0);
1226 desc.add<
int>(
"enum", 1);
1227 desc.add<
int>(
"seagull", 1);
1228 desc.add<
double>(
"maxmass", 3.596);
1229 desc.add<
double>(
"minmass", 2.596);
1230 desc.add<
double>(
"maxmassJpsi", 3.2);
1231 desc.add<
double>(
"minmassJpsi", 3.);
1232 desc.add<
double>(
"maxmassUpsilon", 10.0);
1233 desc.add<
double>(
"minmassUpsilon", 8.8);
1234 desc.add<
double>(
"maxmassTkTk", 10);
1235 desc.add<
double>(
"minmassTkTk", 0);
1236 desc.add<
double>(
"maxmassJpsiTk", 5.46);
1237 desc.add<
double>(
"minmassJpsiTk", 5.1);
1238 desc.add<
double>(
"kaon_mass", 0.493677);
1239 desc.add<
double>(
"mu_mass", 0.1056583745);
1240 desc.add<
double>(
"min_dR", 0.001);
1241 desc.add<
double>(
"max_dR", 1.4);
1242 desc.add<
double>(
"minprob", 0.005);
1243 desc.add<
double>(
"mincos", 0.95);
1244 desc.add<
double>(
"minDS", 3.);
1245 desc.add<
unsigned int>(
"stageL1Trigger", 1);
1296 histoPSet.add<std::vector<double>>(
"ptBinning", {-0.5, 0, 2, 4, 8, 10, 12, 16, 20, 25, 30, 35, 40, 50});
1297 histoPSet.add<std::vector<double>>(
"dMuPtBinning", {6, 8, 12, 16, 20, 25, 30, 35, 40, 50, 70});
1298 histoPSet.add<std::vector<double>>(
"probBinning",
1299 {0.01, 0.02, 0.04, 0.06, 0.08, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0});
1312 descriptions.
add(
"bphMonitoring",
desc);
1316 const std::string trigger_name_tmp = partialName.substr(0, partialName.find(
"v*"));
1319 for (
unsigned int i = 0;
i < Ntriggers;
i++) {
1321 if (trigger_name.find(trigger_name_tmp) != std::string::npos)
1325 return trigger_name;
1328 template <
typename T>
1343 unsigned int fIdx = 0;
1344 for (
unsigned int i = 0;
i < Nmodules;
i++) {
1345 const unsigned int tmp_fIdx =
1347 if (tmp_fIdx < handleTriggerEvent->sizeFilters())
1373 int PrescaleHLT_num = 1;
1374 int PrescaleHLT_den = 1;
1375 double Prescale_num = 1;
1376 double L1P = 1, HLTP = 1;
1378 std::vector<bool> theSame_den;
1379 std::vector<bool> theSame_num;
1383 if (PrescaleHLT_den > 0 && PrescaleHLT_num > 0)
1384 HLTP = PrescaleHLT_num / std::__gcd(PrescaleHLT_num, PrescaleHLT_den);
1404 if (l1_num == l1_den && l1_nump >= 1)
1410 theSame_den.push_back(
flag);
1426 if (l1_den == l1_num && l1_denp >= 1)
1432 theSame_num.push_back(
flag);
1437 if (theSame_num.size() == theSame_den.size()) {
1438 for (
size_t i = 0;
i < theSame_num.size(); ++
i) {
1439 if ((!theSame_num.at(
i)) || (!theSame_den.at(
i))) {
1446 if (
flag && (theSame_num.size() == theSame_den.size())) {
1460 Prescale_num *= 1 - (1.0 / (l1));
1462 if (Prescale_num != 1)
1463 Prescale_num = 1.0 / (1 - Prescale_num);