166 using namespace reco;
171 : dirname_(iConfig.getUntrackedParameter(
"dirname",
std::
string(
"HLT/BTV/"))),
172 processname_(iConfig.getParameter<
std::
string>(
"processname")),
173 verbose_(iConfig.getUntrackedParameter<
bool>(
"verbose",
false)),
174 triggerSummaryLabel_(iConfig.getParameter<
edm::
InputTag>(
"triggerSummaryLabel")),
175 triggerResultsLabel_(iConfig.getParameter<
edm::
InputTag>(
"triggerResultsLabel")),
176 turnon_threshold_loose_(iConfig.getParameter<double>(
"turnon_threshold_loose")),
177 turnon_threshold_medium_(iConfig.getParameter<double>(
"turnon_threshold_medium")),
178 turnon_threshold_tight_(iConfig.getParameter<double>(
"turnon_threshold_tight")),
180 offlineDiscrTokenbb_(
192 shallowTagInfosTokenCalo_(
194 shallowTagInfosTokenPf_(
198 std::vector<edm::ParameterSet>
paths = iConfig.
getParameter<std::vector<edm::ParameterSet> >(
"pathPairs");
210 LogDebug(
"BTVHLTOfflineSource") <<
"HLTConfigProvider failed to initialize.";
217 if (
pathname.find(custompathnamepair.first) != std::string::npos) {
230 edm::LogInfo(
"BTVHLTOfflineSource") <<
"TriggerResults not found, skipping event";
242 edm::LogInfo(
"BTVHLTOfflineSource") <<
"TriggerEvent not found, skipping event";
265 cout <<
"Run = " <<
iEvent.id().run() <<
", LS = " <<
iEvent.luminosityBlock()
266 <<
", Event = " <<
iEvent.id().event() << endl;
278 if ((
v.getTriggerType() ==
"PF" &&
pfTags.isValid()) ||
280 const auto& iter = (
v.getTriggerType() ==
"PF") ?
pfTags->begin() :
caloTags->begin();
282 float Discr_online = iter->second;
283 if (Discr_online < 0)
284 Discr_online = -0.05;
286 v.Discr->Fill(Discr_online);
287 v.Pt->Fill(iter->first->pt());
288 v.Eta->Fill(iter->first->eta());
290 if (offlineJetTagHandlerb.
isValid()) {
291 for (
auto const& iterOffb : *offlineJetTagHandlerb) {
292 float DR =
reco::deltaR(iterOffb.first->eta(), iterOffb.first->phi(), iter->first->eta(), iter->first->phi());
294 float Discr_offline = iterOffb.second;
297 if (offlineJetTagHandlerbb.
isValid()) {
298 for (
auto const& iterOffbb : *offlineJetTagHandlerbb) {
300 iterOffbb.first->eta(), iterOffbb.first->phi(), iter->first->eta(), iter->first->phi());
302 Discr_offline += iterOffbb.second;
308 if (Discr_offline < 0)
309 Discr_offline = -0.05;
310 v.Discr_HLTvsRECO->Fill(Discr_online, Discr_offline);
311 v.Discr_HLTMinusRECO->Fill(Discr_online - Discr_offline);
313 v.Discr_turnon_loose.denominator->Fill(Discr_offline);
314 v.Discr_turnon_medium.denominator->Fill(Discr_offline);
315 v.Discr_turnon_tight.denominator->Fill(Discr_offline);
318 v.Discr_turnon_loose.numerator->Fill(Discr_offline);
320 v.Discr_turnon_medium.numerator->Fill(Discr_offline);
322 v.Discr_turnon_tight.numerator->Fill(Discr_offline);
329 if (
v.getTriggerType() ==
"PF") {
335 v.PVz->Fill(VertexHandler->begin()->z());
336 if (offlineVertexHandler.
isValid()) {
337 v.PVz_HLTMinusRECO->Fill(VertexHandler->begin()->z() - offlineVertexHandler->begin()->z());
346 v.fastPVz->Fill(VertexHandler->begin()->z());
347 if (offlineVertexHandler.
isValid()) {
348 v.fastPVz_HLTMinusRECO->Fill(VertexHandler->begin()->z() - offlineVertexHandler->begin()->z());
369 if ((
v.getTriggerType() ==
"PF" && shallowTagInfosPf.
isValid()) ||
370 (
v.getTriggerType() ==
"Calo" && shallowTagInfosCalo.
isValid())) {
371 const auto& shallowTagInfoCollection = (
v.getTriggerType() ==
"PF") ? shallowTagInfosPf : shallowTagInfosCalo;
372 for (
const auto& shallowTagInfo : *shallowTagInfoCollection) {
373 const auto& tagVars = shallowTagInfo.taggingVariables();
377 v.n_vtx->Fill(tagVar);
380 v.n_sel_tracks->Fill(tagVar);
386 for (
unsigned i_trk = 0; i_trk <
trackSip3dVal.size(); i_trk++) {
389 v.h_3d_ip_distance->Fill(
val);
390 v.h_3d_ip_error->Fill(
val / sig);
391 v.h_3d_ip_sig->Fill(sig);
396 v.vtx_mass->Fill(tagVar);
399 v.n_vtx_trks->Fill(tagVar);
454 iBooker.setCurrentFolder(subdirName);
460 histoname = labelname +
"_Discr";
461 title = labelname +
"_Discr " + trigPath;
462 v.Discr = iBooker.book1D(histoname.c_str(),
title.c_str(), 110, -0.1, 1);
464 histoname = labelname +
"_Pt";
465 title = labelname +
"_Pt " + trigPath;
466 v.Pt = iBooker.book1D(histoname.c_str(),
title.c_str(), 100, 0, 400);
468 histoname = labelname +
"_Eta";
469 title = labelname +
"_Eta " + trigPath;
470 v.Eta = iBooker.book1D(histoname.c_str(),
title.c_str(), 60, -3.0, 3.0);
472 histoname =
"HLTvsRECO_Discr";
473 title =
"online discr vs offline discr " + trigPath;
474 v.Discr_HLTvsRECO = iBooker.book2D(histoname.c_str(),
title.c_str(), 110, -0.1, 1, 110, -0.1, 1);
476 histoname =
"HLTMinusRECO_Discr";
477 title =
"online discr minus offline discr " + trigPath;
478 v.Discr_HLTMinusRECO = iBooker.book1D(histoname.c_str(),
title.c_str(), 100, -1, 1);
480 histoname =
"Turnon_loose_Discr";
481 title =
"turn-on with loose threshold " + trigPath;
482 v.bookME(iBooker,
v.Discr_turnon_loose, histoname,
title, 22, -0.1, 1.);
484 histoname =
"Turnon_medium_Discr";
485 title =
"turn-on with medium threshold " + trigPath;
486 v.bookME(iBooker,
v.Discr_turnon_medium, histoname,
title, 22, -0.1, 1.);
488 histoname =
"Turnon_tight_Discr";
489 title =
"turn-on with tight threshold " + trigPath;
490 v.bookME(iBooker,
v.Discr_turnon_tight, histoname,
title, 22, -0.1, 1.);
492 histoname = labelname +
"_PVz";
493 title =
"online z(PV) " + trigPath;
494 v.PVz = iBooker.book1D(histoname.c_str(),
title.c_str(), 80, -20, 20);
496 histoname = labelname +
"_fastPVz";
497 title =
"online z(fastPV) " + trigPath;
498 v.fastPVz = iBooker.book1D(histoname.c_str(),
title.c_str(), 80, -20, 20);
500 histoname =
"HLTMinusRECO_PVz";
501 title =
"online z(PV) - offline z(PV) " + trigPath;
502 v.PVz_HLTMinusRECO = iBooker.book1D(histoname.c_str(),
title.c_str(), 200, -0.5, 0.5);
504 histoname =
"HLTMinusRECO_fastPVz";
505 title =
"online z(fastPV) - offline z(PV) " + trigPath;
506 v.fastPVz_HLTMinusRECO = iBooker.book1D(histoname.c_str(),
title.c_str(), 100, -2, 2);
509 title =
"N vertex candidates " + trigPath;
510 v.n_vtx = iBooker.book1D(histoname.c_str(),
title.c_str(), 10, -0.5, 9.5);
512 histoname =
"vtx_mass";
513 title =
"secondary vertex mass (GeV)" + trigPath;
514 v.vtx_mass = iBooker.book1D(histoname.c_str(),
title.c_str(), 20, 0, 10);
516 histoname =
"n_vtx_trks";
517 title =
"N tracks associated to secondary vertex" + trigPath;
518 v.n_vtx_trks = iBooker.book1D(histoname.c_str(),
title.c_str(), 20, -0.5, 19.5);
520 histoname =
"n_sel_tracks";
521 title =
"N selected tracks" + trigPath;
522 v.n_sel_tracks = iBooker.book1D(histoname.c_str(),
title.c_str(), 25, -0.5, 24.5);
524 histoname =
"3d_ip_distance";
525 title =
"3D IP distance of tracks (cm)" + trigPath;
526 v.h_3d_ip_distance = iBooker.book1D(histoname.c_str(),
title.c_str(), 40, -0.1, 0.1);
528 histoname =
"3d_ip_error";
529 title =
"3D IP error of tracks (cm)" + trigPath;
530 v.h_3d_ip_error = iBooker.book1D(histoname.c_str(),
title.c_str(), 40, 0., 0.1);
532 histoname =
"3d_ip_sig";
533 title =
"3D IP significance of tracks (cm)" + trigPath;
534 v.h_3d_ip_sig = iBooker.book1D(histoname.c_str(),
title.c_str(), 40, -40, 40);