CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes
BTVHLTOfflineSource Class Reference
Inheritance diagram for BTVHLTOfflineSource:

Classes

class  PathInfo
 
class  PathInfoCollection
 

Public Member Functions

 BTVHLTOfflineSource (const edm::ParameterSet &)
 
 ~BTVHLTOfflineSource () override
 

Private Types

typedef reco::TemplatedSecondaryVertexTagInfo< reco::CandIPTagInfo, reco::VertexCompositePtrCandidateSVTagInfo
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &run, edm::EventSetup const &c) override
 
void dqmBeginRun (edm::Run const &run, edm::EventSetup const &c) override
 
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)
 
template<class Base >
std::vector< const reco::Track * > getOnlineBTagTracks (float hltJetEta, float hltJetPhi, edm::Handle< std::vector< Base >> jetSVTagsColl, std::vector< float > &onlineIP3D, std::vector< float > &onlineIP3DSig)
 

Private Attributes

std::vector< std::pair< std::string, std::string > > custompathnamepairs_
 
std::string dirname_
 
float dRTrackMatch_
 
HLTConfigProvider hltConfig_
 
PathInfoCollection hltPathsAll_
 
edm::EDGetTokenT< std::vector< reco::Vertex > > hltPFPVToken_
 
float maxDecayLength_
 
float maxJetDistance_
 
float minDecayLength_
 
float minJetDistance_
 
edm::EDGetTokenT< reco::JetTagCollectionofflineDiscrTokenb_
 
edm::EDGetTokenT< edm::View< reco::BaseTagInfo > > offlineIPToken_
 
edm::EDGetTokenT< std::vector< reco::Vertex > > offlinePVToken_
 
edm::Handle< reco::JetTagCollectionpfTags
 
edm::EDGetTokenT< reco::JetTagCollectionpfTagsToken_
 
std::string processname_
 
edm::EDGetTokenT< std::vector< reco::ShallowTagInfo > > shallowTagInfosTokenPf_
 
edm::EDGetTokenT< std::vector< SVTagInfo > > SVTagInfosTokenPf_
 
edm::EDGetTokenT< edm::TriggerResultstriggerResultsFUToken
 
edm::InputTag triggerResultsLabel_
 
edm::EDGetTokenT< edm::TriggerResultstriggerResultsToken
 
edm::EDGetTokenT< trigger::TriggerEventtriggerSummaryFUToken
 
edm::InputTag triggerSummaryLabel_
 
edm::EDGetTokenT< trigger::TriggerEventtriggerSummaryToken
 
float turnon_threshold_loose_
 
float turnon_threshold_medium_
 
float turnon_threshold_tight_
 
bool verbose_
 

Detailed Description

Definition at line 48 of file BTVHLTOfflineSource.cc.

Member Typedef Documentation

◆ SVTagInfo

Definition at line 62 of file BTVHLTOfflineSource.cc.

Constructor & Destructor Documentation

◆ BTVHLTOfflineSource()

BTVHLTOfflineSource::BTVHLTOfflineSource ( const edm::ParameterSet iConfig)
explicit

Definition at line 242 of file BTVHLTOfflineSource.cc.

References custompathnamepairs_, edm::ParameterSet::getParameter(), castor_dqm_sourceclient_file_cfg::path, Skims_PA_cff::paths, and AlCaHLTBitMon_QueryRunRegistry::string.

243  : dirname_(iConfig.getUntrackedParameter("dirname", std::string("HLT/BTV/"))),
244  processname_(iConfig.getParameter<std::string>("processname")),
245  verbose_(iConfig.getUntrackedParameter<bool>("verbose", false)),
246  triggerSummaryLabel_(iConfig.getParameter<edm::InputTag>("triggerSummaryLabel")),
247  triggerResultsLabel_(iConfig.getParameter<edm::InputTag>("triggerResultsLabel")),
248  turnon_threshold_loose_(iConfig.getParameter<double>("turnon_threshold_loose")),
249  turnon_threshold_medium_(iConfig.getParameter<double>("turnon_threshold_medium")),
250  turnon_threshold_tight_(iConfig.getParameter<double>("turnon_threshold_tight")),
251  offlineDiscrTokenb_(consumes<reco::JetTagCollection>(iConfig.getParameter<edm::InputTag>("offlineDiscrLabelb"))),
252  offlineIPToken_(consumes<View<BaseTagInfo>>(iConfig.getParameter<edm::InputTag>("offlineIPLabel"))),
253 
254  hltPFPVToken_(consumes<std::vector<reco::Vertex>>(iConfig.getParameter<edm::InputTag>("hltPFPVLabel"))),
255  offlinePVToken_(consumes<std::vector<reco::Vertex>>(iConfig.getParameter<edm::InputTag>("offlinePVLabel"))),
256  triggerResultsToken(consumes<edm::TriggerResults>(triggerResultsLabel_)),
257  triggerResultsFUToken(consumes<edm::TriggerResults>(
259  triggerSummaryToken(consumes<trigger::TriggerEvent>(triggerSummaryLabel_)),
260  triggerSummaryFUToken(consumes<trigger::TriggerEvent>(
263  consumes<vector<reco::ShallowTagInfo>>(edm::InputTag("hltDeepCombinedSecondaryVertexBJetTagsInfos"))),
264  SVTagInfosTokenPf_(consumes<std::vector<SVTagInfo>>(edm::InputTag("hltDeepSecondaryVertexTagInfosPF"))),
265  pfTagsToken_(consumes<reco::JetTagCollection>(iConfig.getParameter<edm::InputTag>("onlineDiscrLabelPF"))),
266  minDecayLength_(iConfig.getParameter<double>("minDecayLength")),
267  maxDecayLength_(iConfig.getParameter<double>("maxDecayLength")),
268  minJetDistance_(iConfig.getParameter<double>("minJetDistance")),
269  maxJetDistance_(iConfig.getParameter<double>("maxJetDistance")),
270  dRTrackMatch_(iConfig.getParameter<double>("dRTrackMatch")) {
271  std::vector<edm::ParameterSet> paths = iConfig.getParameter<std::vector<edm::ParameterSet>>("pathPairs");
272  for (const auto& path : paths) {
273  custompathnamepairs_.push_back(
274  make_pair(path.getParameter<std::string>("pathname"), path.getParameter<std::string>("pathtype")));
275  }
276 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::EDGetTokenT< std::vector< SVTagInfo > > SVTagInfosTokenPf_
std::string const & instance() const
Definition: InputTag.h:37
edm::EDGetTokenT< reco::JetTagCollection > pfTagsToken_
edm::EDGetTokenT< reco::JetTagCollection > offlineDiscrTokenb_
std::string const & label() const
Definition: InputTag.h:36
edm::EDGetTokenT< std::vector< reco::Vertex > > offlinePVToken_
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< trigger::TriggerEvent > triggerSummaryFUToken
edm::InputTag triggerResultsLabel_
edm::InputTag triggerSummaryLabel_
edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken
edm::EDGetTokenT< std::vector< reco::Vertex > > hltPFPVToken_
std::vector< std::pair< std::string, std::string > > custompathnamepairs_
edm::EDGetTokenT< trigger::TriggerEvent > triggerSummaryToken
edm::EDGetTokenT< edm::View< reco::BaseTagInfo > > offlineIPToken_
edm::EDGetTokenT< std::vector< reco::ShallowTagInfo > > shallowTagInfosTokenPf_
edm::EDGetTokenT< edm::TriggerResults > triggerResultsFUToken

◆ ~BTVHLTOfflineSource()

BTVHLTOfflineSource::~BTVHLTOfflineSource ( )
overridedefault

Member Function Documentation

◆ analyze()

void BTVHLTOfflineSource::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

offline

Definition at line 297 of file BTVHLTOfflineSource.cc.

References gather_cfg::cout, reco::deltaR(), ChannelAssignment_cfi::DR, dRTrackMatch_, reco::TrackBase::eta(), reco::btau::flightDistance2dSig, reco::btau::flightDistance2dVal, reco::btau::flightDistance3dSig, reco::btau::flightDistance3dVal, getOfflineBTagTracks(), hltPathsAll_, hltPFPVToken_, iEvent, edm::HandleBase::isValid(), reco::btau::jetEta, reco::btau::jetNSecondaryVertices, reco::btau::jetNSelectedTracks, reco::btau::jetNTracksEtaRel, reco::btau::jetPt, offlineDiscrTokenb_, offlineIPToken_, offlinePVToken_, pfTags, pfTagsToken_, reco::TrackBase::phi(), reco::TrackBase::pt(), shallowTagInfosTokenPf_, SVTagInfosTokenPf_, reco::btau::trackDecayLenVal, reco::btau::trackDeltaR, reco::btau::trackEtaRel, reco::btau::trackJetDistVal, reco::btau::trackPtRatio, reco::btau::trackPtRel, reco::btau::trackSip2dSig, reco::btau::trackSip2dSigAboveCharm, reco::btau::trackSip2dValAboveCharm, reco::btau::trackSip3dSig, reco::btau::trackSip3dSigAboveCharm, reco::btau::trackSip3dVal, reco::btau::trackSip3dValAboveCharm, reco::btau::trackSumJetDeltaR, reco::btau::trackSumJetEtRatio, L1TEGammaOffline_cfi::triggerNames, triggerResults, triggerResultsFUToken, triggerResultsToken, triggerSummaryFUToken, triggerSummaryToken, turnon_threshold_loose_, turnon_threshold_medium_, turnon_threshold_tight_, findQualityFiles::v, heppy_batch::val, verbose_, reco::btau::vertexCategory, reco::btau::vertexEnergyRatio, reco::btau::vertexJetDeltaR, reco::btau::vertexMass, and reco::btau::vertexNTracks.

297  {
300  if (!triggerResults.isValid()) {
302  if (!triggerResults.isValid()) {
303  edm::LogInfo("BTVHLTOfflineSource") << "TriggerResults not found, skipping event";
304  return;
305  }
306  }
307 
308  const edm::TriggerNames& triggerNames = iEvent.triggerNames(*triggerResults);
309 
311  iEvent.getByToken(triggerSummaryToken, triggerObj);
312  if (!triggerObj.isValid()) {
313  iEvent.getByToken(triggerSummaryFUToken, triggerObj);
314  if (!triggerObj.isValid()) {
315  edm::LogInfo("BTVHLTOfflineSource") << "TriggerEvent not found, skipping event";
316  return;
317  }
318  }
319 
321  iEvent.getByToken(pfTagsToken_, pfTags);
322 
323  Handle<reco::VertexCollection> VertexHandler;
324 
325  Handle<reco::JetTagCollection> offlineJetTagHandlerb;
326  iEvent.getByToken(offlineDiscrTokenb_, offlineJetTagHandlerb);
327 
328  Handle<View<BaseTagInfo>> offlineIPTagHandle;
329  iEvent.getByToken(offlineIPToken_, offlineIPTagHandle);
330 
331  Handle<reco::VertexCollection> offlineVertexHandler;
332  iEvent.getByToken(offlinePVToken_, offlineVertexHandler);
333 
334  if (verbose_ && iEvent.id().event() % 10000 == 0)
335  cout << "Run = " << iEvent.id().run() << ", LS = " << iEvent.luminosityBlock()
336  << ", Event = " << iEvent.id().event() << endl;
337 
338  if (!triggerResults.isValid())
339  return;
340 
341  edm::Handle<std::vector<SVTagInfo>> jetSVTagsCollPF;
342 
343  for (auto& v : hltPathsAll_) {
344  unsigned index = triggerNames.triggerIndex(v.getPath());
345  if (!(index < triggerNames.size())) {
346  edm::LogInfo("BTVHLTOfflineSource") << "Path " << v.getPath() << " not in menu, skipping event";
347  continue;
348  }
349 
350  if (!triggerResults->accept(index)) {
351  edm::LogInfo("BTVHLTOfflineSource") << "Path " << v.getPath() << " not accepted, skipping event";
352  continue;
353  }
354 
355  iEvent.getByToken(SVTagInfosTokenPf_, jetSVTagsCollPF);
356 
357  // PF and Calo btagging
358  if (v.getTriggerType() == "PF" && pfTags.isValid()) {
359  const auto& iter = pfTags->begin();
360 
361  float Discr_online = iter->second;
362  if (Discr_online < 0)
363  Discr_online = -0.05;
364 
365  v.Discr->Fill(Discr_online);
366  v.Pt->Fill(iter->first->pt());
367  v.Eta->Fill(iter->first->eta());
368 
369  if (offlineJetTagHandlerb.isValid()) {
370  for (auto const& iterOffb : *offlineJetTagHandlerb) {
371  float DR = reco::deltaR(iterOffb.first->eta(), iterOffb.first->phi(), iter->first->eta(), iter->first->phi());
372  if (DR < 0.3) {
373  float Discr_offline = iterOffb.second;
374  float Pt_offline = iterOffb.first->pt();
375  float Eta_offline = iterOffb.first->eta();
376  float Phi_offline = iterOffb.first->phi();
377 
378  if (Discr_offline < 0)
379  Discr_offline = -0.05;
380  v.Discr_HLTvsRECO->Fill(Discr_online, Discr_offline);
381  v.Discr_HLTMinusRECO->Fill(Discr_online - Discr_offline);
382 
383  v.Discr_turnon_loose.denominator->Fill(Discr_offline);
384  v.Discr_turnon_medium.denominator->Fill(Discr_offline);
385  v.Discr_turnon_tight.denominator->Fill(Discr_offline);
386 
387  v.Pt_turnon_loose.denominator->Fill(Pt_offline);
388  v.Pt_turnon_medium.denominator->Fill(Pt_offline);
389  v.Pt_turnon_tight.denominator->Fill(Pt_offline);
390 
391  v.Eta_turnon_loose.denominator->Fill(Eta_offline);
392  v.Eta_turnon_medium.denominator->Fill(Eta_offline);
393  v.Eta_turnon_tight.denominator->Fill(Eta_offline);
394 
395  v.Phi_turnon_loose.denominator->Fill(Phi_offline);
396  v.Phi_turnon_medium.denominator->Fill(Phi_offline);
397  v.Phi_turnon_tight.denominator->Fill(Phi_offline);
398 
399  if (Discr_online > turnon_threshold_loose_) {
400  v.Discr_turnon_loose.numerator->Fill(Discr_offline);
401  v.Pt_turnon_loose.numerator->Fill(Pt_offline);
402  v.Eta_turnon_loose.numerator->Fill(Eta_offline);
403  v.Phi_turnon_loose.numerator->Fill(Phi_offline);
404  }
405  if (Discr_online > turnon_threshold_medium_) {
406  v.Discr_turnon_medium.numerator->Fill(Discr_offline);
407  v.Pt_turnon_medium.numerator->Fill(Pt_offline);
408  v.Eta_turnon_medium.numerator->Fill(Eta_offline);
409  v.Phi_turnon_medium.numerator->Fill(Phi_offline);
410  }
411  if (Discr_online > turnon_threshold_tight_) {
412  v.Discr_turnon_tight.numerator->Fill(Discr_offline);
413  v.Pt_turnon_tight.numerator->Fill(Pt_offline);
414  v.Eta_turnon_tight.numerator->Fill(Eta_offline);
415  v.Phi_turnon_tight.numerator->Fill(Phi_offline);
416  }
417 
418  break;
419  }
420  }
421  }
422 
423  bool pfSVTagCollValid = (v.getTriggerType() == "PF" && jetSVTagsCollPF.isValid());
424  if (offlineIPTagHandle.isValid() && pfSVTagCollValid) {
425  std::vector<float> offlineIP3D;
426  std::vector<float> offlineIP3DSig;
427  std::vector<const reco::Track*> offlineTracks = getOfflineBTagTracks(
428  iter->first->eta(), iter->first->phi(), offlineIPTagHandle, offlineIP3D, offlineIP3DSig);
429  std::vector<const reco::Track*> onlineTracks;
430  std::vector<float> onlineIP3D;
431  std::vector<float> onlineIP3DSig;
432  if (pfSVTagCollValid)
433  onlineTracks = getOnlineBTagTracks<SVTagInfo>(
434  iter->first->eta(), iter->first->phi(), jetSVTagsCollPF, onlineIP3D, onlineIP3DSig);
435 
436  for (unsigned int iOffTrk = 0; iOffTrk < offlineTracks.size(); ++iOffTrk) {
437  const reco::Track* offTrk = offlineTracks.at(iOffTrk);
438  bool hasMatch = false;
439  float offTrkEta = offTrk->eta();
440  float offTrkPhi = offTrk->phi();
441 
442  for (const reco::Track* onTrk : onlineTracks) {
443  float DR = reco::deltaR(offTrkEta, offTrkPhi, onTrk->eta(), onTrk->phi());
444  if (DR < dRTrackMatch_) {
445  hasMatch = true;
446  }
447  }
448 
449  float offTrkPt = offTrk->pt();
450  v.OnlineTrkEff_Pt.denominator->Fill(offTrkPt);
451  if (hasMatch)
452  v.OnlineTrkEff_Pt.numerator->Fill(offTrkPt);
453 
454  v.OnlineTrkEff_Eta.denominator->Fill(offTrkEta);
455  if (hasMatch)
456  v.OnlineTrkEff_Eta.numerator->Fill(offTrkEta);
457 
458  v.OnlineTrkEff_3d_ip_distance.denominator->Fill(offlineIP3D.at(iOffTrk));
459  if (hasMatch)
460  v.OnlineTrkEff_3d_ip_distance.numerator->Fill(offlineIP3D.at(iOffTrk));
461 
462  v.OnlineTrkEff_3d_ip_sig.denominator->Fill(offlineIP3DSig.at(iOffTrk));
463  if (hasMatch)
464  v.OnlineTrkEff_3d_ip_sig.numerator->Fill(offlineIP3DSig.at(iOffTrk));
465  }
466 
467  for (unsigned int iOnTrk = 0; iOnTrk < onlineTracks.size(); ++iOnTrk) {
468  const reco::Track* onTrk = onlineTracks.at(iOnTrk);
469  bool hasMatch = false;
470  float onTrkEta = onTrk->eta();
471  float onTrkPhi = onTrk->phi();
472 
473  for (const reco::Track* offTrk : offlineTracks) {
474  float DR = reco::deltaR(onTrkEta, onTrkPhi, offTrk->eta(), offTrk->phi());
475  if (DR < dRTrackMatch_) {
476  hasMatch = true;
477  }
478  }
479 
480  float onTrkPt = onTrk->pt();
481  v.OnlineTrkFake_Pt.denominator->Fill(onTrkPt);
482  if (!hasMatch)
483  v.OnlineTrkFake_Pt.numerator->Fill(onTrkPt);
484 
485  v.OnlineTrkFake_Eta.denominator->Fill(onTrkEta);
486  if (!hasMatch)
487  v.OnlineTrkFake_Eta.numerator->Fill(onTrkEta);
488 
489  v.OnlineTrkFake_3d_ip_distance.denominator->Fill(onlineIP3D.at(iOnTrk));
490  if (!hasMatch)
491  v.OnlineTrkFake_3d_ip_distance.numerator->Fill(onlineIP3D.at(iOnTrk));
492 
493  v.OnlineTrkFake_3d_ip_sig.denominator->Fill(onlineIP3DSig.at(iOnTrk));
494  if (!hasMatch)
495  v.OnlineTrkFake_3d_ip_sig.numerator->Fill(onlineIP3DSig.at(iOnTrk));
496  }
497  }
498 
499  iEvent.getByToken(hltPFPVToken_, VertexHandler);
500  if (VertexHandler.isValid()) {
501  v.PVz->Fill(VertexHandler->begin()->z());
502  if (offlineVertexHandler.isValid()) {
503  v.PVz_HLTMinusRECO->Fill(VertexHandler->begin()->z() - offlineVertexHandler->begin()->z());
504  }
505  }
506  } // PFTagsValid
507 
508  // additional plots from tag info collections
510 
512  iEvent.getByToken(shallowTagInfosTokenPf_, shallowTagInfosPf);
513 
514  // edm::Handle<std::vector<reco::TemplatedSecondaryVertexTagInfo<reco::IPTagInfo<edm::RefVector<std::vector<reco::Track>, reco::Track, edm::refhelper::FindUsingAdvance<std::vector<reco::Track>, reco::Track> >, reco::JTATagInfo>, reco::Vertex> > > caloTagInfos;
515  // iEvent.getByToken(caloTagInfosToken_, caloTagInfos);
516 
517  // edm::Handle<std::vector<reco::TemplatedSecondaryVertexTagInfo<reco::IPTagInfo<edm::RefVector<std::vector<reco::Track>, reco::Track, edm::refhelper::FindUsingAdvance<std::vector<reco::Track>, reco::Track> >, reco::JTATagInfo>, reco::Vertex> > > pfTagInfos;
518  // iEvent.getByToken(pfTagInfosToken_, pfTagInfos);
519 
520  // first try to get info from shallowTagInfos ...
521  if (v.getTriggerType() == "PF" && shallowTagInfosPf.isValid()) {
522  const auto& shallowTagInfoCollection = shallowTagInfosPf;
523  for (const auto& shallowTagInfo : *shallowTagInfoCollection) {
524  const auto& tagVars = shallowTagInfo.taggingVariables();
525 
526  // n secondary vertices and n selected tracks
527  for (const auto& tagVar : tagVars.getList(reco::btau::jetNSecondaryVertices, false)) {
528  v.h_jetNSecondaryVertices->Fill(tagVar);
529  v.n_vtx->Fill(tagVar);
530  }
531 
532  for (const auto& tagVar : tagVars.getList(reco::btau::jetNSelectedTracks, false)) {
533  v.n_sel_tracks->Fill(tagVar);
534  v.h_jetNSelectedTracks->Fill(tagVar);
535  }
536 
537  for (const auto& tagVar : tagVars.getList(reco::btau::jetPt, false)) {
538  v.h_jet_pt->Fill(tagVar);
539  }
540 
541  for (const auto& tagVar : tagVars.getList(reco::btau::jetEta, false)) {
542  v.h_jet_eta->Fill(tagVar);
543  }
544 
545  for (const auto& tagVar : tagVars.getList(reco::btau::trackSumJetEtRatio, false)) {
546  v.h_trackSumJetEtRatio->Fill(tagVar);
547  }
548 
549  for (const auto& tagVar : tagVars.getList(reco::btau::trackSumJetDeltaR, false)) {
550  v.h_trackSumJetDeltaR->Fill(tagVar);
551  }
552 
553  for (const auto& tagVar : tagVars.getList(reco::btau::vertexCategory, false)) {
554  v.h_vertexCategory->Fill(tagVar);
555  }
556 
557  for (const auto& tagVar : tagVars.getList(reco::btau::trackSip2dValAboveCharm, false)) {
558  v.h_trackSip2dValAboveCharm->Fill(tagVar);
559  }
560 
561  for (const auto& tagVar : tagVars.getList(reco::btau::trackSip2dSigAboveCharm, false)) {
562  v.h_trackSip2dSigAboveCharm->Fill(tagVar);
563  }
564 
565  for (const auto& tagVar : tagVars.getList(reco::btau::trackSip3dValAboveCharm, false)) {
566  v.h_trackSip3dValAboveCharm->Fill(tagVar);
567  }
568 
569  for (const auto& tagVar : tagVars.getList(reco::btau::trackSip3dSigAboveCharm, false)) {
570  v.h_trackSip3dSigAboveCharm->Fill(tagVar);
571  }
572 
573  for (const auto& tagVar : tagVars.getList(reco::btau::jetNTracksEtaRel, false)) {
574  v.h_jetNTracksEtaRel->Fill(tagVar);
575  }
576 
577  // impact parameter
578  // and new info
579  const auto& trackSip3dVal = tagVars.getList(reco::btau::trackSip3dVal, false);
580  const auto& trackSip3dSig = tagVars.getList(reco::btau::trackSip3dSig, false);
581  const auto& trackJetDistVal = tagVars.getList(reco::btau::trackJetDistVal, false);
582  const auto& trackPtRel = tagVars.getList(reco::btau::trackPtRel, false);
583  const auto& trackSip2dSig = tagVars.getList(reco::btau::trackSip2dSig, false);
584  const auto& trackDeltaR = tagVars.getList(reco::btau::trackDeltaR, false);
585  const auto& trackPtRatio = tagVars.getList(reco::btau::trackPtRatio, false);
586  const auto& trackDecayLenVal = tagVars.getList(reco::btau::trackDecayLenVal, false);
587  const auto& trackEtaRel = tagVars.getList(reco::btau::trackEtaRel, false);
588 
589  for (unsigned i_trk = 0; i_trk < trackEtaRel.size(); i_trk++) {
590  v.h_trackEtaRel->Fill(trackEtaRel[i_trk]);
591  }
592 
593  for (unsigned i_trk = 0; i_trk < trackJetDistVal.size(); i_trk++) {
594  v.h_trackJetDistVal->Fill(trackJetDistVal[i_trk]);
595  }
596 
597  for (unsigned i_trk = 0; i_trk < trackPtRel.size(); i_trk++) {
598  v.h_trackPtRel->Fill(trackPtRel[i_trk]);
599  }
600 
601  for (unsigned i_trk = 0; i_trk < trackDeltaR.size(); i_trk++) {
602  v.h_trackDeltaR->Fill(trackDeltaR[i_trk]);
603  }
604 
605  for (unsigned i_trk = 0; i_trk < trackPtRatio.size(); i_trk++) {
606  v.h_trackPtRatio->Fill(trackPtRatio[i_trk]);
607  }
608 
609  for (unsigned i_trk = 0; i_trk < trackDecayLenVal.size(); i_trk++) {
610  v.h_trackDecayLenVal->Fill(trackDecayLenVal[i_trk]);
611  }
612 
613  for (unsigned i_trk = 0; i_trk < trackSip3dVal.size(); i_trk++) {
614  float val = trackSip3dVal[i_trk];
615  float sig = trackSip3dSig[i_trk];
616  v.h_3d_ip_distance->Fill(val);
617  v.h_3d_ip_error->Fill(val / sig);
618  v.h_3d_ip_sig->Fill(sig);
619 
620  v.h_trackSip2dSig->Fill(trackSip2dSig[i_trk]);
621  }
622 
623  // vertex mass and tracks per vertex
624  for (const auto& tagVar : tagVars.getList(reco::btau::vertexMass, false)) {
625  v.vtx_mass->Fill(tagVar);
626  }
627  for (const auto& tagVar : tagVars.getList(reco::btau::vertexNTracks, false)) {
628  v.n_vtx_trks->Fill(tagVar);
629  }
630 
631  for (const auto& tagVar : tagVars.getList(reco::btau::vertexEnergyRatio, false)) {
632  v.h_vertexEnergyRatio->Fill(tagVar);
633  }
634 
635  for (const auto& tagVar : tagVars.getList(reco::btau::vertexJetDeltaR, false)) {
636  v.h_vertexJetDeltaR->Fill(tagVar);
637  }
638 
639  for (const auto& tagVar : tagVars.getList(reco::btau::flightDistance2dVal, false)) {
640  v.h_flightDistance2dVal->Fill(tagVar);
641  }
642 
643  for (const auto& tagVar : tagVars.getList(reco::btau::flightDistance2dSig, false)) {
644  v.h_flightDistance2dSig->Fill(tagVar);
645  }
646 
647  for (const auto& tagVar : tagVars.getList(reco::btau::flightDistance3dVal, false)) {
648  v.h_flightDistance3dVal->Fill(tagVar);
649  }
650 
651  for (const auto& tagVar : tagVars.getList(reco::btau::flightDistance3dSig, false)) {
652  v.h_flightDistance3dSig->Fill(tagVar);
653  }
654 
655  // // track N total/pixel hits
656  // for (const auto & tagVar : tagVars.getList(reco::btau::trackNPixelHits, false)) {
657  // v.n_pixel_hits->Fill(tagVar);}
658  // for (const auto & tagVar : tagVars.getList(reco::btau::trackNTotalHits, false)) {
659  // v.n_total_hits->Fill(tagVar);}
660  }
661  }
662 
663  // ... otherwise from usual tag infos.
664  // else
665  // if ( (v.getTriggerType() == "PF" && pfTagInfos.isValid())
666  // || (v.getTriggerType() == "Calo" && caloTagInfos.isValid()) )
667  // {
668  // const auto & DiscrTagInfoCollection = (v.getTriggerType() == "PF") ? pfTagInfos : caloTagInfos;
669 
670  // // loop over secondary vertex tag infos
671  // for (const auto & DiscrTagInfo : *DiscrTagInfoCollection) {
672  // v.n_vtx->Fill(DiscrTagInfo.nVertexCandidates());
673  // v.n_sel_tracks->Fill(DiscrTagInfo.nSelectedTracks());
674 
675  // // loop over selected tracks in each tag info
676  // for (unsigned i_trk=0; i_trk < DiscrTagInfo.nSelectedTracks(); i_trk++) {
677  // const auto & ip3d = DiscrTagInfo.trackIPData(i_trk).ip3d;
678  // v.h_3d_ip_distance->Fill(ip3d.value());
679  // v.h_3d_ip_error->Fill(ip3d.error());
680  // v.h_3d_ip_sig->Fill(ip3d.significance());
681  // }
682 
683  // // loop over vertex candidates in each tag info
684  // for (unsigned i_sv=0; i_sv < DiscrTagInfo.nVertexCandidates(); i_sv++) {
685  // const auto & sv = DiscrTagInfo.secondaryVertex(i_sv);
686  // v.vtx_mass->Fill(sv.p4().mass());
687  // v.n_vtx_trks->Fill(sv.nTracks());
688 
689  // // loop over tracks for number of pixel and total hits
690  // const auto & trkIPTagInfo = DiscrTagInfo.trackIPTagInfoRef().get();
691  // for (const auto & trk : trkIPTagInfo->selectedTracks()) {
692  // v.n_pixel_hits->Fill(trk.get()->hitPattern().numberOfValidPixelHits());
693  // v.n_total_hits->Fill(trk.get()->hitPattern().numberOfValidHits());
694  // }
695  // }
696  // }
697  // }
698  } //end paths loop
699 }
edm::EDGetTokenT< std::vector< SVTagInfo > > SVTagInfosTokenPf_
edm::EDGetTokenT< reco::JetTagCollection > pfTagsToken_
edm::EDGetTokenT< reco::JetTagCollection > offlineDiscrTokenb_
edm::EDGetTokenT< std::vector< reco::Vertex > > offlinePVToken_
edm::EDGetTokenT< trigger::TriggerEvent > triggerSummaryFUToken
double pt() const
track transverse momentum
Definition: TrackBase.h:637
int iEvent
Definition: GenABIO.cc:224
edm::Handle< reco::JetTagCollection > pfTags
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:649
PathInfoCollection hltPathsAll_
static std::string const triggerResults
Definition: EdmProvDump.cc:47
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:30
Log< level::Info, false > LogInfo
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:652
edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken
edm::EDGetTokenT< std::vector< reco::Vertex > > hltPFPVToken_
bool isValid() const
Definition: HandleBase.h:70
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::EDGetTokenT< edm::TriggerResults > triggerResultsFUToken

◆ bookHistograms()

void BTVHLTOfflineSource::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  run,
edm::EventSetup const &  c 
)
overrideprivate

Definition at line 783 of file BTVHLTOfflineSource.cc.

References dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), dirname_, hltPathsAll_, HLTConfigProvider::removeVersion(), dqm::implementation::NavigatorBase::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, runGCPTkAlMap::title, and findQualityFiles::v.

783  {
784  iBooker.setCurrentFolder(dirname_);
785  for (auto& v : hltPathsAll_) {
786  std::string trgPathName = HLTConfigProvider::removeVersion(v.getPath());
787  std::string subdirName = dirname_ + "/" + trgPathName + v.getTriggerType();
788  std::string trigPath = "(" + trgPathName + ")";
789  iBooker.setCurrentFolder(subdirName);
790 
791  std::string labelname("HLT");
792  std::string histoname(labelname + "");
793  std::string title(labelname + "");
794 
795  histoname = labelname + "_Discr";
796  title = labelname + "_Discr " + trigPath;
797  v.Discr = iBooker.book1D(histoname.c_str(), title.c_str(), 110, -0.1, 1);
798 
799  histoname = labelname + "_Pt";
800  title = labelname + "_Pt " + trigPath;
801  v.Pt = iBooker.book1D(histoname.c_str(), title.c_str(), 100, 0, 400);
802 
803  histoname = labelname + "_Eta";
804  title = labelname + "_Eta " + trigPath;
805  v.Eta = iBooker.book1D(histoname.c_str(), title.c_str(), 60, -3.0, 3.0);
806 
807  histoname = "HLTvsRECO_Discr";
808  title = "online discr vs offline discr " + trigPath;
809  v.Discr_HLTvsRECO = iBooker.book2D(histoname.c_str(), title.c_str(), 110, -0.1, 1, 110, -0.1, 1);
810 
811  histoname = "HLTMinusRECO_Discr";
812  title = "online discr minus offline discr " + trigPath;
813  v.Discr_HLTMinusRECO = iBooker.book1D(histoname.c_str(), title.c_str(), 100, -1, 1);
814 
815  histoname = "Turnon_loose_Discr";
816  title = "turn-on with loose threshold " + trigPath;
817  v.bookME(iBooker, v.Discr_turnon_loose, histoname, title, 22, -0.1, 1.);
818 
819  histoname = "Turnon_medium_Discr";
820  title = "turn-on with medium threshold " + trigPath;
821  v.bookME(iBooker, v.Discr_turnon_medium, histoname, title, 22, -0.1, 1.);
822 
823  histoname = "Turnon_tight_Discr";
824  title = "turn-on with tight threshold " + trigPath;
825  v.bookME(iBooker, v.Discr_turnon_tight, histoname, title, 22, -0.1, 1.);
826 
827  histoname = "Turnon_loose_Pt";
828  title = "turn-on with loose threshold " + trigPath;
829  v.bookME(iBooker, v.Pt_turnon_loose, histoname, title, 50, 0., 500.);
830 
831  histoname = "Turnon_medium_Pt";
832  title = "turn-on with medium threshold " + trigPath;
833  v.bookME(iBooker, v.Pt_turnon_medium, histoname, title, 50, 0., 500.);
834 
835  histoname = "Turnon_tight_Pt";
836  title = "turn-on with tight threshold " + trigPath;
837  v.bookME(iBooker, v.Pt_turnon_tight, histoname, title, 50, 0., 500.);
838 
839  histoname = "Turnon_loose_Eta";
840  title = "turn-on with loose threshold " + trigPath;
841  v.bookME(iBooker, v.Eta_turnon_loose, histoname, title, 60, -3., 3.);
842 
843  histoname = "Turnon_medium_Eta";
844  title = "turn-on with medium threshold " + trigPath;
845  v.bookME(iBooker, v.Eta_turnon_medium, histoname, title, 60, -3., 3.);
846 
847  histoname = "Turnon_tight_Eta";
848  title = "turn-on with tight threshold " + trigPath;
849  v.bookME(iBooker, v.Eta_turnon_tight, histoname, title, 60, -3., 3.);
850 
851  histoname = "Turnon_loose_Phi";
852  title = "turn-on with loose threshold " + trigPath;
853  v.bookME(iBooker, v.Phi_turnon_loose, histoname, title, 60, -3., 3.);
854 
855  histoname = "Turnon_medium_Phi";
856  title = "turn-on with medium threshold " + trigPath;
857  v.bookME(iBooker, v.Phi_turnon_medium, histoname, title, 60, -3., 3.);
858 
859  histoname = "Turnon_tight_Phi";
860  title = "turn-on with tight threshold " + trigPath;
861  v.bookME(iBooker, v.Phi_turnon_tight, histoname, title, 60, -3., 3.);
862 
863  histoname = labelname + "_PVz";
864  title = "online z(PV) " + trigPath;
865  v.PVz = iBooker.book1D(histoname.c_str(), title.c_str(), 80, -20, 20);
866 
867  histoname = labelname + "_fastPVz";
868  title = "online z(fastPV) " + trigPath;
869  v.fastPVz = iBooker.book1D(histoname.c_str(), title.c_str(), 80, -20, 20);
870 
871  histoname = "HLTMinusRECO_PVz";
872  title = "online z(PV) - offline z(PV) " + trigPath;
873  v.PVz_HLTMinusRECO = iBooker.book1D(histoname.c_str(), title.c_str(), 200, -0.5, 0.5);
874 
875  histoname = "HLTMinusRECO_fastPVz";
876  title = "online z(fastPV) - offline z(PV) " + trigPath;
877  v.fastPVz_HLTMinusRECO = iBooker.book1D(histoname.c_str(), title.c_str(), 100, -2, 2);
878 
879  histoname = "n_vtx";
880  title = "N vertex candidates " + trigPath;
881  v.n_vtx = iBooker.book1D(histoname.c_str(), title.c_str(), 10, -0.5, 9.5);
882 
883  histoname = "vtx_mass";
884  title = "secondary vertex mass (GeV)" + trigPath;
885  v.vtx_mass = iBooker.book1D(histoname.c_str(), title.c_str(), 20, 0, 10);
886 
887  histoname = "n_vtx_trks";
888  title = "N tracks associated to secondary vertex" + trigPath;
889  v.n_vtx_trks = iBooker.book1D(histoname.c_str(), title.c_str(), 20, -0.5, 19.5);
890 
891  histoname = "n_sel_tracks";
892  title = "N selected tracks" + trigPath;
893  v.n_sel_tracks = iBooker.book1D(histoname.c_str(), title.c_str(), 25, -0.5, 24.5);
894 
895  histoname = "3d_ip_distance";
896  title = "3D IP distance of tracks (cm)" + trigPath;
897  v.h_3d_ip_distance = iBooker.book1D(histoname.c_str(), title.c_str(), 40, -0.1, 0.1);
898 
899  histoname = "3d_ip_error";
900  title = "3D IP error of tracks (cm)" + trigPath;
901  v.h_3d_ip_error = iBooker.book1D(histoname.c_str(), title.c_str(), 40, 0., 0.1);
902 
903  histoname = "3d_ip_sig";
904  title = "3D IP significance of tracks (cm)" + trigPath;
905  v.h_3d_ip_sig = iBooker.book1D(histoname.c_str(), title.c_str(), 40, -40, 40);
906 
907  //new
908  histoname = "jetNSecondaryVertices";
909  title = "jet N Secondary Vertices" + trigPath;
910  v.h_jetNSecondaryVertices = iBooker.book1D(histoname.c_str(), title.c_str(), 10, -0.5, 9.5);
911 
912  histoname = "jet_pt";
913  title = "jet pt" + trigPath;
914  v.h_jet_pt = iBooker.book1D(histoname.c_str(), title.c_str(), 100, -0.1, 100);
915 
916  histoname = "jet_eta";
917  title = "jet eta" + trigPath;
918  v.h_jet_eta = iBooker.book1D(histoname.c_str(), title.c_str(), 100, -2.5, 2.5);
919 
920  histoname = "trackSumJetEtRatio";
921  title = "trackSumJetEtRatio" + trigPath;
922  v.h_trackSumJetEtRatio = iBooker.book1D(histoname.c_str(), title.c_str(), 100, -0.1, 1.5);
923 
924  histoname = "trackSip2dValAboveCharm";
925  title = "trackSip2dSigAboveCharm" + trigPath;
926  v.h_trackSip2dSigAboveCharm = iBooker.book1D(histoname.c_str(), title.c_str(), 100, -0.2, 0.2);
927 
928  histoname = "trackSip2dSigAboveCharm";
929  title = "trackSip2dSigAboveCharm" + trigPath;
930  v.h_trackSip2dValAboveCharm = iBooker.book1D(histoname.c_str(), title.c_str(), 100, -50, 50);
931 
932  histoname = "trackSip3dValAboveCharm";
933  title = "trackSip3dValAboveCharm" + trigPath;
934  v.h_trackSip3dValAboveCharm = iBooker.book1D(histoname.c_str(), title.c_str(), 100, -0.2, 0.2);
935 
936  histoname = "trackSip3dSigAboveCharm";
937  title = "trackSip3dSigAboveCharm" + trigPath;
938  v.h_trackSip3dSigAboveCharm = iBooker.book1D(histoname.c_str(), title.c_str(), 100, -50, 50);
939 
940  histoname = "jetNSelectedTracks";
941  title = "jet N Selected Tracks" + trigPath;
942  v.h_jetNSelectedTracks = iBooker.book1D(histoname.c_str(), title.c_str(), 42, -1.5, 40.5);
943 
944  histoname = "jetNTracksEtaRel";
945  title = "jetNTracksEtaRel" + trigPath;
946  v.h_jetNTracksEtaRel = iBooker.book1D(histoname.c_str(), title.c_str(), 42, -1.5, 40.5);
947 
948  histoname = "vertexCategory";
949  title = "vertex category" + trigPath;
950  v.h_vertexCategory = iBooker.book1D(histoname.c_str(), title.c_str(), 4, -1.5, 2.5);
951 
952  histoname = "trackSumJetDeltaR";
953  title = "trackSumJetDeltaR" + trigPath;
954  v.h_trackSumJetDeltaR = iBooker.book1D(histoname.c_str(), title.c_str(), 100, -0.1, 0.35);
955 
956  //new 2 below
957  histoname = "trackJetDistVal";
958  title = "trackJetDistVal" + trigPath;
959  v.h_trackJetDistVal = iBooker.book1D(histoname.c_str(), title.c_str(), 100, -1, 0.01);
960 
961  histoname = "trackPtRel";
962  title = "track pt rel" + trigPath;
963  v.h_trackPtRel = iBooker.book1D(histoname.c_str(), title.c_str(), 100, -0.1, 7);
964 
965  histoname = "trackDeltaR";
966  title = "trackDeltaR" + trigPath;
967  v.h_trackDeltaR = iBooker.book1D(histoname.c_str(), title.c_str(), 160, -0.05, .47);
968 
969  histoname = "trackPtRatio";
970  title = "trackPtRatio" + trigPath;
971  v.h_trackPtRatio = iBooker.book1D(histoname.c_str(), title.c_str(), 100, -0.01, 0.3);
972 
973  histoname = "trackSip2dSig";
974  title = "trackSip2dSig" + trigPath;
975  v.h_trackSip2dSig = iBooker.book1D(histoname.c_str(), title.c_str(), 100, -55, 55);
976 
977  histoname = "trackDecayLenVal";
978  title = "trackDecayLenVal" + trigPath;
979  v.h_trackDecayLenVal = iBooker.book1D(histoname.c_str(), title.c_str(), 100, -0.1, 22);
980 
981  histoname = "trackEtaRel";
982  title = "trackEtaRel" + trigPath;
983  v.h_trackEtaRel = iBooker.book1D(histoname.c_str(), title.c_str(), 31, 0, 30);
984 
985  //new 3 below
986  histoname = "vertexEnergyRatio";
987  title = "vertexEnergyRatio" + trigPath;
988  v.h_vertexEnergyRatio = iBooker.book1D(histoname.c_str(), title.c_str(), 100, -0.1, 3);
989 
990  histoname = "vertexJetDeltaR";
991  title = "vertexJetDeltaR" + trigPath;
992  v.h_vertexJetDeltaR = iBooker.book1D(histoname.c_str(), title.c_str(), 100, -0.01, 0.4);
993 
994  histoname = "flightDistance2dVal";
995  title = "flightDistance2dVal" + trigPath;
996  v.h_flightDistance2dVal = iBooker.book1D(histoname.c_str(), title.c_str(), 100, -0.1, 5);
997 
998  histoname = "flightDistance2dSig";
999  title = "flightDistance2dSig" + trigPath;
1000  v.h_flightDistance2dSig = iBooker.book1D(histoname.c_str(), title.c_str(), 100, -10, 150);
1001 
1002  histoname = "flightDistance3dVal";
1003  title = "flightDistance3dVal" + trigPath;
1004  v.h_flightDistance3dVal = iBooker.book1D(histoname.c_str(), title.c_str(), 100, -0.1, 5);
1005 
1006  histoname = "flightDistance3dSig";
1007  title = "flightDistance3dSig" + trigPath;
1008  v.h_flightDistance3dSig = iBooker.book1D(histoname.c_str(), title.c_str(), 100, -10, 150);
1009 
1010  //end new
1011 
1012  histoname = "OnlineTrkEff_Pt";
1013  title = "Relative Online Trk Efficiency vs Pt " + trigPath;
1014  v.bookME(iBooker, v.OnlineTrkEff_Pt, histoname, title, 50, -0.5, 20.);
1015 
1016  histoname = "OnlineTrkEff_Eta";
1017  title = "Relative Online Trk Efficiency vs Eta " + trigPath;
1018  v.bookME(iBooker, v.OnlineTrkEff_Eta, histoname, title, 60, -3.0, 3.0);
1019 
1020  histoname = "OnlineTrkEff_3d_ip_distance";
1021  title = "Relative Online Trk Efficiency vs IP3D " + trigPath;
1022  v.bookME(iBooker, v.OnlineTrkEff_3d_ip_distance, histoname, title, 40, -0.1, 0.1);
1023 
1024  histoname = "OnlineTrkEff_3d_ip_sig";
1025  title = "Relative Online Trk Efficiency vs IP3D significance " + trigPath;
1026  v.bookME(iBooker, v.OnlineTrkEff_3d_ip_sig, histoname, title, 40, -40, 40);
1027 
1028  histoname = "OnlineTrkFake_Pt";
1029  title = "Relative Online Trk Fake Rate vs Pt " + trigPath;
1030  v.bookME(iBooker, v.OnlineTrkFake_Pt, histoname, title, 50, -0.5, 20.);
1031 
1032  histoname = "OnlineTrkFake_Eta";
1033  title = "Relative Online Trk Fake Rate vs Eta " + trigPath;
1034  v.bookME(iBooker, v.OnlineTrkFake_Eta, histoname, title, 60, -3.0, 3.0);
1035 
1036  histoname = "OnlineTrkFake_3d_ip_distance";
1037  title = "Relative Online Trk Fake Rate vs IP3D " + trigPath;
1038  v.bookME(iBooker, v.OnlineTrkFake_3d_ip_distance, histoname, title, 40, -0.1, 0.1);
1039 
1040  histoname = "OnlineTrkFake_3d_ip_sig";
1041  title = "Relative Online Trk Fake Rate vs IP3D significance " + trigPath;
1042  v.bookME(iBooker, v.OnlineTrkFake_3d_ip_sig, histoname, title, 40, -40, 40);
1043 
1044  // histoname = "n_pixel_hits";
1045  // title = "N pixel hits"+trigPath;
1046  // v.n_pixel_hits = iBooker.book1D(histoname.c_str(), title.c_str(), 16, -0.5, 15.5);
1047 
1048  // histoname = "n_total_hits";
1049  // title = "N hits"+trigPath;
1050  // v.n_total_hits = iBooker.book1D(histoname.c_str(), title.c_str(), 40, -0.5, 39.5);
1051  }
1052 }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
static const std::string removeVersion(const std::string &trigger)
PathInfoCollection hltPathsAll_
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:221
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98

◆ dqmBeginRun()

void BTVHLTOfflineSource::dqmBeginRun ( edm::Run const &  run,
edm::EventSetup const &  c 
)
overrideprivate

Definition at line 280 of file BTVHLTOfflineSource.cc.

References DummyCfis::c, custompathnamepairs_, hltConfig_, hltPathsAll_, heavyIonCSV_trainingSettings::idx, HLTConfigProvider::init(), LogDebug, BTVHLTOfflineSource_cfi::pathname, processname_, writedatasetfile::run, HLTConfigProvider::size(), and HLTConfigProvider::triggerName().

280  {
281  bool changed = true;
282  if (!hltConfig_.init(run, c, processname_, changed)) {
283  LogDebug("BTVHLTOfflineSource") << "HLTConfigProvider failed to initialize.";
284  }
285 
286  for (unsigned int idx = 0; idx != hltConfig_.size(); ++idx) {
287  const auto& pathname = hltConfig_.triggerName(idx);
288 
289  for (const auto& custompathnamepair : custompathnamepairs_) {
290  if (pathname.find(custompathnamepair.first) != std::string::npos) {
291  hltPathsAll_.push_back(PathInfo(1, pathname, "dummy", processname_, 0, custompathnamepair.second));
292  }
293  }
294  }
295 }
const std::string & triggerName(unsigned int triggerIndex) const
unsigned int size() const
number of trigger paths in trigger table
PathInfoCollection hltPathsAll_
HLTConfigProvider hltConfig_
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
std::vector< std::pair< std::string, std::string > > custompathnamepairs_
#define LogDebug(id)

◆ getOfflineBTagTracks()

std::vector< const reco::Track * > BTVHLTOfflineSource::getOfflineBTagTracks ( float  hltJetEta,
float  hltJetPhi,
edm::Handle< edm::View< reco::BaseTagInfo >>  offlineIPTagHandle,
std::vector< float > &  offlineIP3D,
std::vector< float > &  offlineIP3DSig 
)
private

Definition at line 701 of file BTVHLTOfflineSource.cc.

References listHistos::decayLength, reco::deltaR(), ChannelAssignment_cfi::DR, Exception, reco::btag::IP2DSig, electrons_cff::ip3d, mag(), maxDecayLength_, maxJetDistance_, minDecayLength_, minJetDistance_, dqmiodumpmetadata::n, MetAnalyzer::pv(), TrackCollections2monitor_cff::selectedTracks, dumpRecoGeometry_cfg::tagInfo, reco::btag::toTrack(), and HLT_2024v13_cff::track.

Referenced by analyze().

705  {
706  std::vector<const reco::Track*> offlineTracks;
707 
708  for (auto const& iterOffIP : *offlineIPTagHandle) {
709  float DR = reco::deltaR(iterOffIP.jet()->eta(), iterOffIP.jet()->phi(), hltJetEta, hltJetPhi);
710 
711  if (DR > 0.3)
712  continue;
713 
715  dynamic_cast<const reco::IPTagInfo<vector<reco::CandidatePtr>, reco::JetTagInfo>*>(&iterOffIP);
716 
717  if (!tagInfo) {
718  throw cms::Exception("Configuration")
719  << "BTagPerformanceAnalyzer: Extended TagInfo not of type TrackIPTagInfo. " << std::endl;
720  }
721 
722  const GlobalPoint pv(tagInfo->primaryVertex()->position().x(),
723  tagInfo->primaryVertex()->position().y(),
724  tagInfo->primaryVertex()->position().z());
725 
726  const std::vector<reco::btag::TrackIPData>& ip = tagInfo->impactParameterData();
727 
728  std::vector<std::size_t> sortedIndices = tagInfo->sortedIndexes(reco::btag::IP2DSig);
729  std::vector<reco::CandidatePtr> sortedTracks = tagInfo->sortedTracks(sortedIndices);
730  std::vector<std::size_t> selectedIndices;
731  vector<reco::CandidatePtr> selectedTracks;
732  for (unsigned int n = 0; n != sortedIndices.size(); ++n) {
733  double decayLength = (ip[sortedIndices[n]].closestToJetAxis - pv).mag();
734  double jetDistance = ip[sortedIndices[n]].distanceToJetAxis.value();
735  if (decayLength > minDecayLength_ && decayLength < maxDecayLength_ && fabs(jetDistance) >= minJetDistance_ &&
736  fabs(jetDistance) < maxJetDistance_) {
737  selectedIndices.push_back(sortedIndices[n]);
738  selectedTracks.push_back(sortedTracks[n]);
739  }
740  }
741 
742  for (unsigned int n = 0; n != selectedIndices.size(); ++n) {
744  offlineTracks.push_back(track);
745  offlineIP3D.push_back(ip[n].ip3d.value());
746  offlineIP3DSig.push_back(ip[n].ip3d.significance());
747  }
748  }
749  return offlineTracks;
750 }
const reco::Track * toTrack(const reco::TrackBaseRef &t)
Definition: IPTagInfo.h:24
def pv(vc)
Definition: MetAnalyzer.py:7
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:30
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())

◆ getOnlineBTagTracks()

template<class Base >
std::vector< const reco::Track * > BTVHLTOfflineSource::getOnlineBTagTracks ( float  hltJetEta,
float  hltJetPhi,
edm::Handle< std::vector< Base >>  jetSVTagsColl,
std::vector< float > &  onlineIP3D,
std::vector< float > &  onlineIP3DSig 
)
private

Definition at line 753 of file BTVHLTOfflineSource.cc.

References reco::deltaR(), ChannelAssignment_cfi::DR, electrons_cff::ip3d, and reco::btag::toTrack().

757  {
758  std::vector<const reco::Track*> onlineTracks;
759 
760  for (auto iterTI = jetSVTagsColl->begin(); iterTI != jetSVTagsColl->end(); ++iterTI) {
761  float DR = reco::deltaR(iterTI->jet()->eta(), iterTI->jet()->phi(), hltJetEta, hltJetPhi);
762  if (DR > 0.3)
763  continue;
764 
765  const auto& ipInfo = *(iterTI->trackIPTagInfoRef().get());
766  const std::vector<reco::btag::TrackIPData>& ip = ipInfo.impactParameterData();
767 
768  unsigned int trackSize = ipInfo.selectedTracks().size();
769  for (unsigned int itt = 0; itt < trackSize; ++itt) {
770  const auto ptrackRef = (ipInfo.selectedTracks()[itt]);
771 
772  if (ptrackRef.isAvailable()) {
773  const reco::Track* ptrackPtr = reco::btag::toTrack(ptrackRef);
774  onlineTracks.push_back(ptrackPtr);
775  onlineIP3D.push_back(ip[itt].ip3d.value());
776  onlineIP3DSig.push_back(ip[itt].ip3d.significance());
777  }
778  }
779  }
780  return onlineTracks;
781 }
const reco::Track * toTrack(const reco::TrackBaseRef &t)
Definition: IPTagInfo.h:24
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:30

Member Data Documentation

◆ custompathnamepairs_

std::vector<std::pair<std::string, std::string> > BTVHLTOfflineSource::custompathnamepairs_
private

Definition at line 79 of file BTVHLTOfflineSource.cc.

Referenced by BTVHLTOfflineSource(), and dqmBeginRun().

◆ dirname_

std::string BTVHLTOfflineSource::dirname_
private

Definition at line 75 of file BTVHLTOfflineSource.cc.

Referenced by bookHistograms().

◆ dRTrackMatch_

float BTVHLTOfflineSource::dRTrackMatch_
private

Definition at line 110 of file BTVHLTOfflineSource.cc.

Referenced by analyze().

◆ hltConfig_

HLTConfigProvider BTVHLTOfflineSource::hltConfig_
private

Definition at line 112 of file BTVHLTOfflineSource.cc.

Referenced by dqmBeginRun().

◆ hltPathsAll_

PathInfoCollection BTVHLTOfflineSource::hltPathsAll_
private

Definition at line 234 of file BTVHLTOfflineSource.cc.

Referenced by analyze(), bookHistograms(), and dqmBeginRun().

◆ hltPFPVToken_

edm::EDGetTokenT<std::vector<reco::Vertex> > BTVHLTOfflineSource::hltPFPVToken_
private

Definition at line 91 of file BTVHLTOfflineSource.cc.

Referenced by analyze().

◆ maxDecayLength_

float BTVHLTOfflineSource::maxDecayLength_
private

Definition at line 107 of file BTVHLTOfflineSource.cc.

Referenced by getOfflineBTagTracks().

◆ maxJetDistance_

float BTVHLTOfflineSource::maxJetDistance_
private

Definition at line 109 of file BTVHLTOfflineSource.cc.

Referenced by getOfflineBTagTracks().

◆ minDecayLength_

float BTVHLTOfflineSource::minDecayLength_
private

Definition at line 106 of file BTVHLTOfflineSource.cc.

Referenced by getOfflineBTagTracks().

◆ minJetDistance_

float BTVHLTOfflineSource::minJetDistance_
private

Definition at line 108 of file BTVHLTOfflineSource.cc.

Referenced by getOfflineBTagTracks().

◆ offlineDiscrTokenb_

edm::EDGetTokenT<reco::JetTagCollection> BTVHLTOfflineSource::offlineDiscrTokenb_
private

Definition at line 88 of file BTVHLTOfflineSource.cc.

Referenced by analyze().

◆ offlineIPToken_

edm::EDGetTokenT<edm::View<reco::BaseTagInfo> > BTVHLTOfflineSource::offlineIPToken_
private

Definition at line 89 of file BTVHLTOfflineSource.cc.

Referenced by analyze().

◆ offlinePVToken_

edm::EDGetTokenT<std::vector<reco::Vertex> > BTVHLTOfflineSource::offlinePVToken_
private

Definition at line 92 of file BTVHLTOfflineSource.cc.

Referenced by analyze().

◆ pfTags

edm::Handle<reco::JetTagCollection> BTVHLTOfflineSource::pfTags
private

Definition at line 104 of file BTVHLTOfflineSource.cc.

Referenced by analyze().

◆ pfTagsToken_

edm::EDGetTokenT<reco::JetTagCollection> BTVHLTOfflineSource::pfTagsToken_
private

Definition at line 103 of file BTVHLTOfflineSource.cc.

Referenced by analyze().

◆ processname_

std::string BTVHLTOfflineSource::processname_
private

Definition at line 76 of file BTVHLTOfflineSource.cc.

Referenced by dqmBeginRun().

◆ shallowTagInfosTokenPf_

edm::EDGetTokenT<std::vector<reco::ShallowTagInfo> > BTVHLTOfflineSource::shallowTagInfosTokenPf_
private

Definition at line 99 of file BTVHLTOfflineSource.cc.

Referenced by analyze().

◆ SVTagInfosTokenPf_

edm::EDGetTokenT<std::vector<SVTagInfo> > BTVHLTOfflineSource::SVTagInfosTokenPf_
private

Definition at line 101 of file BTVHLTOfflineSource.cc.

Referenced by analyze().

◆ triggerResultsFUToken

edm::EDGetTokenT<edm::TriggerResults> BTVHLTOfflineSource::triggerResultsFUToken
private

Definition at line 95 of file BTVHLTOfflineSource.cc.

Referenced by analyze().

◆ triggerResultsLabel_

edm::InputTag BTVHLTOfflineSource::triggerResultsLabel_
private

Definition at line 82 of file BTVHLTOfflineSource.cc.

◆ triggerResultsToken

edm::EDGetTokenT<edm::TriggerResults> BTVHLTOfflineSource::triggerResultsToken
private

Definition at line 94 of file BTVHLTOfflineSource.cc.

Referenced by analyze().

◆ triggerSummaryFUToken

edm::EDGetTokenT<trigger::TriggerEvent> BTVHLTOfflineSource::triggerSummaryFUToken
private

Definition at line 97 of file BTVHLTOfflineSource.cc.

Referenced by analyze().

◆ triggerSummaryLabel_

edm::InputTag BTVHLTOfflineSource::triggerSummaryLabel_
private

Definition at line 81 of file BTVHLTOfflineSource.cc.

◆ triggerSummaryToken

edm::EDGetTokenT<trigger::TriggerEvent> BTVHLTOfflineSource::triggerSummaryToken
private

Definition at line 96 of file BTVHLTOfflineSource.cc.

Referenced by analyze().

◆ turnon_threshold_loose_

float BTVHLTOfflineSource::turnon_threshold_loose_
private

Definition at line 84 of file BTVHLTOfflineSource.cc.

Referenced by analyze().

◆ turnon_threshold_medium_

float BTVHLTOfflineSource::turnon_threshold_medium_
private

Definition at line 85 of file BTVHLTOfflineSource.cc.

Referenced by analyze().

◆ turnon_threshold_tight_

float BTVHLTOfflineSource::turnon_threshold_tight_
private

Definition at line 86 of file BTVHLTOfflineSource.cc.

Referenced by analyze().

◆ verbose_

bool BTVHLTOfflineSource::verbose_
private

Definition at line 77 of file BTVHLTOfflineSource.cc.

Referenced by analyze().