310 edm::LogInfo(
"BTVHLTOfflineSource") <<
"TriggerResults not found, skipping event";
322 edm::LogInfo(
"BTVHLTOfflineSource") <<
"TriggerEvent not found, skipping event";
348 cout <<
"Run = " <<
iEvent.id().run() <<
", LS = " <<
iEvent.luminosityBlock()
349 <<
", Event = " <<
iEvent.id().event() << endl;
360 edm::LogInfo(
"BTVHLTOfflineSource") <<
"Path " <<
v.getPath() <<
" not in menu, skipping event";
365 edm::LogInfo(
"BTVHLTOfflineSource") <<
"Path " <<
v.getPath() <<
" not accepted, skipping event";
369 if (
v.getTriggerType() ==
"PF") {
376 if ((
v.getTriggerType() ==
"PF" &&
pfTags.isValid()) ||
378 const auto& iter = (
v.getTriggerType() ==
"PF") ?
pfTags->begin() :
caloTags->begin();
380 float Discr_online = iter->second;
381 if (Discr_online < 0)
382 Discr_online = -0.05;
384 v.Discr->Fill(Discr_online);
385 v.Pt->Fill(iter->first->pt());
386 v.Eta->Fill(iter->first->eta());
388 if (offlineJetTagHandlerb.
isValid()) {
389 for (
auto const& iterOffb : *offlineJetTagHandlerb) {
390 float DR =
reco::deltaR(iterOffb.first->eta(), iterOffb.first->phi(), iter->first->eta(), iter->first->phi());
392 float Discr_offline = iterOffb.second;
395 if (offlineJetTagHandlerbb.
isValid()) {
396 for (
auto const& iterOffbb : *offlineJetTagHandlerbb) {
398 iterOffbb.first->eta(), iterOffbb.first->phi(), iter->first->eta(), iter->first->phi());
400 Discr_offline += iterOffbb.second;
406 if (Discr_offline < 0)
407 Discr_offline = -0.05;
408 v.Discr_HLTvsRECO->Fill(Discr_online, Discr_offline);
409 v.Discr_HLTMinusRECO->Fill(Discr_online - Discr_offline);
411 v.Discr_turnon_loose.denominator->Fill(Discr_offline);
412 v.Discr_turnon_medium.denominator->Fill(Discr_offline);
413 v.Discr_turnon_tight.denominator->Fill(Discr_offline);
416 v.Discr_turnon_loose.numerator->Fill(Discr_offline);
418 v.Discr_turnon_medium.numerator->Fill(Discr_offline);
420 v.Discr_turnon_tight.numerator->Fill(Discr_offline);
427 bool pfSVTagCollValid = (
v.getTriggerType() ==
"PF" && jetSVTagsCollPF.
isValid());
428 bool caloSVTagCollValid = (
v.getTriggerType() ==
"Calo" && jetSVTagsCollCalo.
isValid());
429 if (offlineIPTagHandle.
isValid() && (pfSVTagCollValid || caloSVTagCollValid)) {
430 std::vector<float> offlineIP3D;
431 std::vector<float> offlineIP3DSig;
433 iter->first->eta(), iter->first->phi(), offlineIPTagHandle, offlineIP3D, offlineIP3DSig);
434 std::vector<const reco::Track*> onlineTracks;
435 std::vector<float> onlineIP3D;
436 std::vector<float> onlineIP3DSig;
437 if (pfSVTagCollValid)
438 onlineTracks = getOnlineBTagTracks<SVTagInfo>(
439 iter->first->eta(), iter->first->phi(), jetSVTagsCollPF, onlineIP3D, onlineIP3DSig);
440 if (caloSVTagCollValid)
441 onlineTracks = getOnlineBTagTracks<reco::SecondaryVertexTagInfo>(
442 iter->first->eta(), iter->first->phi(), jetSVTagsCollCalo, onlineIP3D, onlineIP3DSig);
444 for (
unsigned int iOffTrk = 0; iOffTrk < offlineTracks.size(); ++iOffTrk) {
445 const reco::Track* offTrk = offlineTracks.at(iOffTrk);
446 bool hasMatch =
false;
447 float offTrkEta = offTrk->
eta();
448 float offTrkPhi = offTrk->
phi();
451 float DR =
reco::deltaR(offTrkEta, offTrkPhi, onTrk->eta(), onTrk->phi());
457 float offTrkPt = offTrk->
pt();
458 v.OnlineTrkEff_Pt.denominator->Fill(offTrkPt);
460 v.OnlineTrkEff_Pt.numerator->Fill(offTrkPt);
462 v.OnlineTrkEff_Eta.denominator->Fill(offTrkEta);
464 v.OnlineTrkEff_Eta.numerator->Fill(offTrkEta);
466 v.OnlineTrkEff_3d_ip_distance.denominator->Fill(offlineIP3D.at(iOffTrk));
468 v.OnlineTrkEff_3d_ip_distance.numerator->Fill(offlineIP3D.at(iOffTrk));
470 v.OnlineTrkEff_3d_ip_sig.denominator->Fill(offlineIP3DSig.at(iOffTrk));
472 v.OnlineTrkEff_3d_ip_sig.numerator->Fill(offlineIP3DSig.at(iOffTrk));
475 for (
unsigned int iOnTrk = 0; iOnTrk < onlineTracks.size(); ++iOnTrk) {
476 const reco::Track* onTrk = onlineTracks.at(iOnTrk);
477 bool hasMatch =
false;
478 float onTrkEta = onTrk->
eta();
479 float onTrkPhi = onTrk->
phi();
488 float onTrkPt = onTrk->
pt();
489 v.OnlineTrkFake_Pt.denominator->Fill(onTrkPt);
491 v.OnlineTrkFake_Pt.numerator->Fill(onTrkPt);
493 v.OnlineTrkFake_Eta.denominator->Fill(onTrkEta);
495 v.OnlineTrkFake_Eta.numerator->Fill(onTrkEta);
497 v.OnlineTrkFake_3d_ip_distance.denominator->Fill(onlineIP3D.at(iOnTrk));
499 v.OnlineTrkFake_3d_ip_distance.numerator->Fill(onlineIP3D.at(iOnTrk));
501 v.OnlineTrkFake_3d_ip_sig.denominator->Fill(onlineIP3DSig.at(iOnTrk));
503 v.OnlineTrkFake_3d_ip_sig.numerator->Fill(onlineIP3DSig.at(iOnTrk));
507 if (
v.getTriggerType() ==
"PF") {
513 v.PVz->Fill(VertexHandler->begin()->z());
514 if (offlineVertexHandler.
isValid()) {
515 v.PVz_HLTMinusRECO->Fill(VertexHandler->begin()->z() - offlineVertexHandler->begin()->z());
524 v.fastPVz->Fill(VertexHandler->begin()->z());
525 if (offlineVertexHandler.
isValid()) {
526 v.fastPVz_HLTMinusRECO->Fill(VertexHandler->begin()->z() - offlineVertexHandler->begin()->z());
547 if ((
v.getTriggerType() ==
"PF" && shallowTagInfosPf.
isValid()) ||
548 (
v.getTriggerType() ==
"Calo" && shallowTagInfosCalo.
isValid())) {
549 const auto& shallowTagInfoCollection = (
v.getTriggerType() ==
"PF") ? shallowTagInfosPf : shallowTagInfosCalo;
550 for (
const auto& shallowTagInfo : *shallowTagInfoCollection) {
551 const auto& tagVars = shallowTagInfo.taggingVariables();
555 v.h_jetNSecondaryVertices->Fill(tagVar);
556 v.n_vtx->Fill(tagVar);
560 v.n_sel_tracks->Fill(tagVar);
561 v.h_jetNSelectedTracks->Fill(tagVar);
565 v.h_jet_pt->Fill(tagVar);
569 v.h_jet_eta->Fill(tagVar);
573 v.h_trackSumJetEtRatio->Fill(tagVar);
577 v.h_trackSumJetDeltaR->Fill(tagVar);
581 v.h_vertexCategory->Fill(tagVar);
585 v.h_trackSip2dValAboveCharm->Fill(tagVar);
589 v.h_trackSip2dSigAboveCharm->Fill(tagVar);
593 v.h_trackSip3dValAboveCharm->Fill(tagVar);
597 v.h_trackSip3dSigAboveCharm->Fill(tagVar);
601 v.h_jetNTracksEtaRel->Fill(tagVar);
616 for (
unsigned i_trk = 0; i_trk <
trackEtaRel.size(); i_trk++) {
624 for (
unsigned i_trk = 0; i_trk <
trackPtRel.size(); i_trk++) {
628 for (
unsigned i_trk = 0; i_trk <
trackDeltaR.size(); i_trk++) {
632 for (
unsigned i_trk = 0; i_trk <
trackPtRatio.size(); i_trk++) {
640 for (
unsigned i_trk = 0; i_trk <
trackSip3dVal.size(); i_trk++) {
643 v.h_3d_ip_distance->Fill(
val);
644 v.h_3d_ip_error->Fill(
val / sig);
645 v.h_3d_ip_sig->Fill(sig);
652 v.vtx_mass->Fill(tagVar);
655 v.n_vtx_trks->Fill(tagVar);
659 v.h_vertexEnergyRatio->Fill(tagVar);
663 v.h_vertexJetDeltaR->Fill(tagVar);
667 v.h_flightDistance2dVal->Fill(tagVar);
671 v.h_flightDistance2dSig->Fill(tagVar);
675 v.h_flightDistance3dVal->Fill(tagVar);
679 v.h_flightDistance3dSig->Fill(tagVar);
edm::EDGetTokenT< std::vector< SVTagInfo > > SVTagInfosTokenPf_
edm::EDGetTokenT< std::vector< reco::ShallowTagInfo > > shallowTagInfosTokenCalo_
edm::EDGetTokenT< reco::JetTagCollection > pfTagsToken_
edm::EDGetTokenT< reco::JetTagCollection > offlineDiscrTokenb_
edm::EDGetTokenT< std::vector< reco::Vertex > > hltCaloPVToken_
edm::EDGetTokenT< std::vector< reco::SecondaryVertexTagInfo > > SVTagInfosTokenCalo_
edm::EDGetTokenT< std::vector< reco::Vertex > > offlinePVToken_
edm::EDGetTokenT< trigger::TriggerEvent > triggerSummaryFUToken
double pt() const
track transverse momentum
edm::Handle< reco::JetTagCollection > pfTags
double phi() const
azimuthal angle of momentum vector
PathInfoCollection hltPathsAll_
static std::string const triggerResults
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
edm::EDGetTokenT< reco::JetTagCollection > offlineDiscrTokenbb_
edm::EDGetTokenT< std::vector< reco::Vertex > > hltFastPVToken_
Log< level::Info, false > LogInfo
double eta() const
pseudorapidity of momentum vector
edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken
edm::EDGetTokenT< std::vector< reco::Vertex > > hltPFPVToken_
float turnon_threshold_loose_
std::vector< const reco::Track * > getOfflineBTagTracks(float hltJetEta, float hltJetPhi, edm::Handle< edm::View< reco::BaseTagInfo >> offlineIPTagHandle, std::vector< float > &offlineIP3D, std::vector< float > &offlineIP3DSig)
edm::EDGetTokenT< trigger::TriggerEvent > triggerSummaryToken
edm::EDGetTokenT< edm::View< reco::BaseTagInfo > > offlineIPToken_
edm::EDGetTokenT< std::vector< reco::ShallowTagInfo > > shallowTagInfosTokenPf_
edm::Handle< reco::JetTagCollection > caloTags
edm::EDGetTokenT< reco::JetTagCollection > caloTagsToken_
float turnon_threshold_tight_
edm::EDGetTokenT< edm::TriggerResults > triggerResultsFUToken
float turnon_threshold_medium_