CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes
HLTBTagPerformanceAnalyzer Class Reference

#include <HLTBTagPerformanceAnalyzer.h>

Inheritance diagram for HLTBTagPerformanceAnalyzer:
one::DQMEDAnalyzer< T > one::dqmimplementation::DQMBaseClass< T... >

Classes

struct  JetRefCompare
 

Public Member Functions

void dqmBeginRun (const edm::Run &iRun, const edm::EventSetup &iSetup) override
 
 HLTBTagPerformanceAnalyzer (const edm::ParameterSet &)
 
 ~HLTBTagPerformanceAnalyzer () override
 
- Public Member Functions inherited from one::DQMEDAnalyzer< T >
 DQMEDAnalyzer ()=default
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer< T... > &&)=delete
 
 ~DQMEDAnalyzer () override=default
 

Private Types

typedef unsigned int flavour_t
 
typedef std::vector< flavour_tflavours_t
 
enum  HCALSpecials { HEP17, HEP18, HEM17 }
 
typedef std::map< edm::RefToBase< reco::Jet >, float, JetRefCompareJetTagMap
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &ibooker, edm::Run const &iRun, edm::EventSetup const &iSetup) override
 

Private Attributes

std::vector< bool > _isfoundHLTs
 other class variable More...
 
std::vector< std::string > folders
 DQM folder handle. More...
 
std::vector< std::map< std::string, MonitorElement * > > H1_
 
std::vector< std::map< std::string, std::map< HCALSpecials, MonitorElement * > > > H1mod_
 
std::vector< std::map< std::string, MonitorElement * > > H2_
 
std::vector< std::map< std::string, MonitorElement * > > H2Eta_
 
std::vector< std::map< std::string, MonitorElement * > > H2EtaPhi_
 
std::vector< std::map< std::string, MonitorElement * > > H2EtaPhi_threshold_
 
std::vector< std::map< std::string, std::map< HCALSpecials, MonitorElement * > > > H2mod_
 
std::vector< std::map< std::string, MonitorElement * > > H2Phi_
 
std::map< HLTBTagPerformanceAnalyzer::HCALSpecials, std::string > HCALSpecialsNames
 
HLTConfigProvider hltConfigProvider_
 
std::string hltConfigProvider_Label
 
std::vector< int > hltPathIndexs_
 
std::vector< std::string > hltPathNames_
 
edm::EDGetTokenT< edm::TriggerResultshlTriggerResults_
 
std::string hlTriggerResults_Label
 
std::vector< edm::EDGetTokenT< reco::JetTagCollection > > JetTagCollection_
 
std::vector< std::string > JetTagCollection_Label
 
edm::EDConsumerBase::Labels label
 
std::vector< flavours_tm_mcFlavours
 
std::vector< std::string > m_mcLabels
 
bool m_mcMatching
 
edm::EDGetTokenT< reco::JetFlavourMatchingCollectionm_mcPartons
 
std::string m_mcPartons_Label
 
double m_mcRadius
 
std::string mainFolder_
 
edm::Handle< std::vector< reco::ShallowTagInfo > > shallowTagInfosPf
 
edm::EDGetTokenT< std::vector< reco::ShallowTagInfo > > shallowTagInfosTokenPf_
 
bool triggerConfChanged_
 

Detailed Description

Code used to produce DQM validation plots for b-tag at HLT. It plots the 1D distribution of the b-tag discriminant for all,b,c,lights,g jets And it plots the 2D distribution of the b-tag discriminant for all,b,c,lights,g jets vs pT

Definition at line 43 of file HLTBTagPerformanceAnalyzer.h.

Member Typedef Documentation

typedef unsigned int HLTBTagPerformanceAnalyzer::flavour_t
private

Definition at line 82 of file HLTBTagPerformanceAnalyzer.h.

typedef std::vector<flavour_t> HLTBTagPerformanceAnalyzer::flavours_t
private

Definition at line 83 of file HLTBTagPerformanceAnalyzer.h.

Definition at line 59 of file HLTBTagPerformanceAnalyzer.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

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

Definition at line 65 of file HLTBTagPerformanceAnalyzer.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterNamesForType(), mps_fire::i, label, edm::EDConsumerBase::labelsForToken(), CaloTowersParam_cfi::mc, AlCaHLTBitMon_QueryRunRegistry::string, GlobalPosition_Frontier_DevDB_cff::tag, and edm::vector_transform().

65  {
66  mainFolder_ = iConfig.getParameter<std::string>("mainFolder");
67  hlTriggerResults_ = consumes<edm::TriggerResults>(iConfig.getParameter<InputTag>("TriggerResults"));
69  edm::vector_transform(iConfig.getParameter<std::vector<edm::InputTag>>("JetTag"),
70  [this](edm::InputTag const &tag) { return mayConsume<reco::JetTagCollection>(tag); });
71  // shallowTagInfosTokenCalo_ =
72  // consumes<std::vector<reco::ShallowTagInfo> >
73  // (edm::InputTag("hltDeepCombinedSecondaryVertexBJetTagsInfosCalo"));
75  consumes<std::vector<reco::ShallowTagInfo>>(edm::InputTag("hltDeepCombinedSecondaryVertexBJetTagsInfos"));
76  m_mcPartons = consumes<JetFlavourMatchingCollection>(iConfig.getParameter<InputTag>("mcPartons"));
77  hltPathNames_ = iConfig.getParameter<std::vector<std::string>>("HLTPathNames");
78  edm::ParameterSet mc = iConfig.getParameter<edm::ParameterSet>("mcFlavours");
79  m_mcLabels = mc.getParameterNamesForType<std::vector<unsigned int>>();
80 
81  EDConsumerBase::labelsForToken(m_mcPartons, label);
83 
84  for (unsigned int i = 0; i < JetTagCollection_.size(); i++) {
85  EDConsumerBase::labelsForToken(JetTagCollection_[i], label);
87  }
88 
89  EDConsumerBase::labelsForToken(hlTriggerResults_, label);
91 
92  for (unsigned int i = 0; i < m_mcLabels.size(); ++i)
93  m_mcFlavours.push_back(mc.getParameter<std::vector<unsigned int>>(m_mcLabels[i]));
94  m_mcMatching = m_mcPartons_Label != "none";
95 
96  m_mcRadius = 0.3;
97 
98  HCALSpecialsNames[HEP17] = "HEP17";
99  HCALSpecialsNames[HEP18] = "HEP18";
100  HCALSpecialsNames[HEM17] = "HEM17";
101 }
T getParameter(std::string const &) const
std::vector< std::string > m_mcLabels
edm::EDGetTokenT< std::vector< reco::ShallowTagInfo > > shallowTagInfosTokenPf_
std::vector< flavours_t > m_mcFlavours
char const * module
Definition: ProductLabels.h:5
edm::EDGetTokenT< reco::JetFlavourMatchingCollection > m_mcPartons
auto vector_transform(std::vector< InputType > const &input, Function predicate) -> std::vector< typename std::remove_cv< typename std::remove_reference< decltype(predicate(input.front()))>::type >::type >
Definition: transform.h:11
std::map< HLTBTagPerformanceAnalyzer::HCALSpecials, std::string > HCALSpecialsNames
std::vector< std::string > hltPathNames_
std::vector< edm::EDGetTokenT< reco::JetTagCollection > > JetTagCollection_
edm::EDConsumerBase::Labels label
std::vector< std::string > JetTagCollection_Label
edm::EDGetTokenT< edm::TriggerResults > hlTriggerResults_
HLTBTagPerformanceAnalyzer::~HLTBTagPerformanceAnalyzer ( )
override

Definition at line 103 of file HLTBTagPerformanceAnalyzer.cc.

103  {
104  // do anything here that needs to be done at desctruction time
105  // (e.g. close files, deallocate resources etc.)
106 }

Member Function Documentation

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

for flavour

if MCOK

for BtagJT

Definition at line 149 of file HLTBTagPerformanceAnalyzer.cc.

References funct::abs(), edm::HLTGlobalStatus::accept(), edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::begin(), reco::TaggingVariableList::begin(), closestJet(), MillePedeFileConverter_cfg::e, relativeConstraints::empty, edm::AssociationVector< KeyRefProd, CVal, KeyRef, SizeType, KeyReferenceHelper >::end(), reco::TaggingVariableList::end(), mps_splice::entry, cppFunctionSkipper::exception, spr::find(), GenHFHadronMatcher_cff::flavour, edm::Event::getByToken(), mps_fire::i, info(), edm::HandleBase::isValid(), keepSet, label, funct::m, edm::Handle< T >::product(), AlCaHLTBitMon_QueryRunRegistry::string, reco::TaggingVariableTokens, and edm::triggerResults().

149  {
150  bool trigRes = false;
151  bool MCOK = false;
152  using namespace edm;
153 
154  // get triggerResults
155  Handle<TriggerResults> TriggerResulsHandler;
157  if (hlTriggerResults_Label.empty() || hlTriggerResults_Label == "NULL") {
158  edm::LogInfo("NoTriggerResults") << "TriggerResults ==> Empty";
159  return;
160  }
161  iEvent.getByToken(hlTriggerResults_, TriggerResulsHandler);
162  if (TriggerResulsHandler.isValid())
163  trigRes = true;
164  if (!trigRes) {
165  edm::LogInfo("NoTriggerResults") << "TriggerResults ==> not readable";
166  return;
167  }
168  const TriggerResults &triggerResults = *(TriggerResulsHandler.product());
169 
170  // get partons
171  if (m_mcMatching && !m_mcPartons_Label.empty() && m_mcPartons_Label != "NULL") {
172  iEvent.getByToken(m_mcPartons, h_mcPartons);
173  if (h_mcPartons.isValid())
174  MCOK = true;
175  }
176 
177  // fill the 1D and 2D DQM plot
178  Handle<reco::JetTagCollection> JetTagHandler;
179  for (unsigned int ind = 0; ind < hltPathNames_.size(); ind++) {
180  bool BtagOK = false;
182  if (!_isfoundHLTs[ind])
183  continue; // if the hltPath is not in the event, skip the event
184  if (!triggerResults.accept(hltPathIndexs_[ind]))
185  continue; // if the hltPath was not accepted skip the event
186 
187  // get JetTagCollection
188  if (!JetTagCollection_Label[ind].empty() && JetTagCollection_Label[ind] != "NULL") {
189  iEvent.getByToken(JetTagCollection_[ind], JetTagHandler);
191  // iEvent.getByToken(shallowTagInfosTokenCalo_,
192  // shallowTagInfosCalo);
193  if (JetTagHandler.isValid())
194  BtagOK = true;
195  }
196 
197  // fill JetTag map
198  if (BtagOK)
199  for (auto iter = JetTagHandler->begin(); iter != JetTagHandler->end(); iter++) {
200  JetTag.insert(JetTagMap::value_type(iter->first, iter->second));
201  }
202  else {
203  edm::LogInfo("NoCollection") << "Collection " << JetTagCollection_Label[ind] << " ==> not found";
204  return;
205  }
206  // fill Inputs for All
207  if (shallowTagInfosPf.isValid()) {
208  for (auto &info : *(shallowTagInfosPf)) {
209  TaggingVariableList vars = info.taggingVariables();
210  for (auto entry = vars.begin(); entry != vars.end(); ++entry) {
211  if (keepSet.find(TaggingVariableTokens[entry->first]) !=
212  keepSet.end()) { // if Input name in defined list to keep
213  try {
214  H1_.at(ind)[TaggingVariableTokens[entry->first]]->Fill(std::fmax(0.0, entry->second));
215  } catch (const std::exception &e) {
216  continue;
217  }
218  } else
219  continue;
220  }
221  }
222  } else {
223  edm::LogInfo("NoCollection") << "No shallowTagInfosPf collection";
224  }
225  // fill tagging
226  for (auto &BtagJT : JetTag) {
227  std::map<HCALSpecials, bool> inmodule;
228  inmodule[HEP17] = (BtagJT.first->phi() >= -0.87) && (BtagJT.first->phi() < -0.52) && (BtagJT.first->eta() > 1.3);
229  inmodule[HEP18] = (BtagJT.first->phi() >= -0.52) && (BtagJT.first->phi() < -0.17) && (BtagJT.first->eta() > 1.3);
230  inmodule[HEM17] = (BtagJT.first->phi() >= -0.87) && (BtagJT.first->phi() < -0.52) && (BtagJT.first->eta() < -1.3);
231 
232  // fill 1D btag plot for 'all'
233  H1_.at(ind)[JetTagCollection_Label[ind]]->Fill(std::fmax(0.0, BtagJT.second));
234  for (auto i : HCALSpecialsNames) {
235  if (inmodule[i.first])
236  H1mod_.at(ind)[JetTagCollection_Label[ind]][i.first]->Fill(std::fmax(0.0, BtagJT.second));
237  }
238  if (MCOK) {
239  int m = closestJet(BtagJT.first, *h_mcPartons, m_mcRadius);
240  unsigned int flavour = (m != -1) ? abs((*h_mcPartons)[m].second.getFlavour()) : 0;
241  for (unsigned int i = 0; i < m_mcLabels.size(); ++i) {
242  std::string flavour_str = m_mcLabels[i];
243  flavours_t flav_collection = m_mcFlavours[i];
244  auto it = std::find(flav_collection.begin(), flav_collection.end(), flavour);
245  if (it == flav_collection.end())
246  continue;
248  label += flavour_str;
249  H1_.at(ind)[label]->Fill(std::fmax(0.0, BtagJT.second)); // fill 1D btag plot for 'b,c,uds'
250  for (auto j : HCALSpecialsNames) {
251  if (inmodule[j.first])
252  H1mod_.at(ind)[label][j.first]->Fill(
253  std::fmax(0.0, BtagJT.second)); // fill 1D btag plot for 'b,c,uds' in
254  // modules (HEP17 etc.)
255  }
256  label = JetTagCollection_Label[ind] + "___";
257  label += flavour_str;
258  std::string labelEta = label;
259  std::string labelPhi = label;
260  std::string labelEtaPhi = label;
261  std::string labelEtaPhi_threshold = label;
262  label += "_disc_pT";
263  H2_.at(ind)[label]->Fill(std::fmax(0.0, BtagJT.second),
264  BtagJT.first->pt()); // fill 2D btag, jetPt plot for 'b,c,uds'
265  for (auto j : HCALSpecialsNames) {
266  if (inmodule[j.first])
267  H2mod_.at(ind)[label][j.first]->Fill(std::fmax(0.0, BtagJT.second), BtagJT.first->pt());
268  }
269  labelEta += "_disc_eta";
270  H2Eta_.at(ind)[labelEta]->Fill(std::fmax(0.0, BtagJT.second),
271  BtagJT.first->eta()); // fill 2D btag, jetEta plot for 'b,c,uds'
272  labelPhi += "_disc_phi";
273  H2Phi_.at(ind)[labelPhi]->Fill(std::fmax(0.0, BtagJT.second),
274  BtagJT.first->phi()); // fill 2D btag, jetPhi plot for 'b,c,uds'
275  labelEtaPhi += "_eta_phi";
276  H2EtaPhi_.at(ind)[labelEtaPhi]->Fill(BtagJT.first->eta(),
277  BtagJT.first->phi()); // fill 2D btag, jetPhi plot for 'b,c,uds'
278  labelEtaPhi_threshold += "_eta_phi_disc05";
279  if (BtagJT.second > 0.5) {
280  H2EtaPhi_threshold_.at(ind)[labelEtaPhi_threshold]->Fill(
281  BtagJT.first->eta(),
282  BtagJT.first->phi()); // fill 2D btag, jetPhi plot for 'b,c,uds'
283  }
284  }
285  }
286  }
287  } // for triggers
288 }
std::vector< std::map< std::string, std::map< HCALSpecials, MonitorElement * > > > H2mod_
std::vector< flavour_t > flavours_t
static const TGPicture * info(bool iBackgroundIsBlack)
const char *const TaggingVariableTokens[]
std::vector< std::string > m_mcLabels
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
std::vector< std::map< std::string, MonitorElement * > > H2EtaPhi_threshold_
JetFloatAssociation::value_type JetTag
Definition: JetTag.h:17
bool accept() const
Has at least one path accepted the event?
edm::Handle< std::vector< reco::ShallowTagInfo > > shallowTagInfosPf
const_iterator end() const
const_iterator begin() const
edm::EDGetTokenT< std::vector< reco::ShallowTagInfo > > shallowTagInfosTokenPf_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
std::vector< std::map< std::string, MonitorElement * > > H2_
std::map< edm::RefToBase< reco::Jet >, float, JetRefCompare > JetTagMap
std::vector< std::map< std::string, MonitorElement * > > H1_
int closestJet(const RefToBase< reco::Jet > jet, const edm::AssociationVector< T, V > &association, double distance)
const_iterator end() const
std::vector< flavours_t > m_mcFlavours
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static std::string const triggerResults
Definition: EdmProvDump.cc:45
bool isValid() const
Definition: HandleBase.h:74
std::vector< std::map< std::string, MonitorElement * > > H2EtaPhi_
edm::EDGetTokenT< reco::JetFlavourMatchingCollection > m_mcPartons
std::vector< std::map< std::string, MonitorElement * > > H2Eta_
std::map< HLTBTagPerformanceAnalyzer::HCALSpecials, std::string > HCALSpecialsNames
T const * product() const
Definition: Handle.h:74
std::vector< std::map< std::string, MonitorElement * > > H2Phi_
std::vector< std::string > hltPathNames_
HLT enums.
std::vector< std::map< std::string, std::map< HCALSpecials, MonitorElement * > > > H1mod_
std::vector< edm::EDGetTokenT< reco::JetTagCollection > > JetTagCollection_
std::set< std::string > keepSet
edm::EDConsumerBase::Labels label
vars
Definition: DeepTauId.cc:77
std::vector< bool > _isfoundHLTs
other class variable
std::vector< std::string > JetTagCollection_Label
const_iterator begin() const
edm::EDGetTokenT< edm::TriggerResults > hlTriggerResults_
void HLTBTagPerformanceAnalyzer::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprivate

---——— method called once each job just before starting event loop

for mc.size()

for hltPathNames_.size()

Definition at line 292 of file HLTBTagPerformanceAnalyzer.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), DEFINE_FWK_MODULE, relativeConstraints::empty, ALCARECOTkAlBeamHalo_cff::etaMax, GenHFHadronMatcher_cff::flavour, mps_fire::i, keepSetJet, keepSetTrack, keepSetVtx, label, M_PI, genParticles_cff::map, AlignmentTrackSelector_cfi::phiMax, phimin, MonitorElement::setAxisTitle(), DQMStore::IBooker::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, and reco::TaggingVariableTokens.

294  {
295  // book the DQM plots for each path and for each flavour
296  using namespace std;
297  assert(hltPathNames_.size() == JetTagCollection_.size());
298  std::string dqmFolder;
299  for (unsigned int ind = 0; ind < hltPathNames_.size(); ind++) {
300  float btagL = 0.;
301  float btagU = 1.;
302  int btagBins = 100;
303  dqmFolder = Form("%s/Discriminator/%s", mainFolder_.c_str(), hltPathNames_[ind].c_str());
304  H1_.push_back(std::map<std::string, MonitorElement *>());
305  H2_.push_back(std::map<std::string, MonitorElement *>());
306  H1mod_.push_back(std::map<std::string, std::map<HCALSpecials, MonitorElement *>>());
307  H2mod_.push_back(std::map<std::string, std::map<HCALSpecials, MonitorElement *>>());
308  H2Eta_.push_back(std::map<std::string, MonitorElement *>());
309  H2Phi_.push_back(std::map<std::string, MonitorElement *>());
310  H2EtaPhi_.push_back(std::map<std::string, MonitorElement *>());
311  H2EtaPhi_threshold_.push_back(std::map<std::string, MonitorElement *>());
312  ibooker.setCurrentFolder(dqmFolder);
313 
314  // book 1D btag plot for 'all'
315  if (!JetTagCollection_Label[ind].empty() && JetTagCollection_Label[ind] != "NULL") {
316  H1_.back()[JetTagCollection_Label[ind]] = ibooker.book1D(
317  JetTagCollection_Label[ind] + "_all", JetTagCollection_Label[ind] + "_all", btagBins, btagL, btagU);
318  H1_.back()[JetTagCollection_Label[ind]]->setAxisTitle(JetTagCollection_Label[ind] + "discriminant", 1);
319  // Input storing
320  ibooker.setCurrentFolder(dqmFolder + "/inputs");
321  ibooker.setCurrentFolder(dqmFolder + "/inputs/Jet");
322  for (int i = 0; i < 100; i++) {
323  if (keepSetJet.find(TaggingVariableTokens[i]) != keepSetJet.end()) { // if input name in defined set
325  H1_.back()[inpt] = ibooker.book1D(inpt, inpt, 105, -5, 100.);
326  H1_.back()[inpt]->setAxisTitle(inpt, 1);
327  } else
328  continue;
329  }
330  ibooker.setCurrentFolder(dqmFolder + "/inputs/Track");
331  for (int i = 0; i < 100; i++) {
332  if (keepSetTrack.find(TaggingVariableTokens[i]) != keepSetTrack.end()) { // if input name in defined set
334  H1_.back()[inpt] = ibooker.book1D(inpt, inpt, 105, -5, 100.);
335  H1_.back()[inpt]->setAxisTitle(inpt, 1);
336  } else
337  continue;
338  }
339  ibooker.setCurrentFolder(dqmFolder + "/inputs/Vertex");
340  for (int i = 0; i < 100; i++) {
341  if (keepSetVtx.find(TaggingVariableTokens[i]) != keepSetVtx.end()) { // if input name in defined set
343  H1_.back()[inpt] = ibooker.book1D(inpt, inpt, 105, -5, 100.);
344  H1_.back()[inpt]->setAxisTitle(inpt, 1);
345  } else
346  continue;
347  }
348 
349  for (auto i : HCALSpecialsNames) {
350  ibooker.setCurrentFolder(dqmFolder + "/" + i.second);
351  H1mod_.back()[JetTagCollection_Label[ind]][i.first] = ibooker.book1D(
352  JetTagCollection_Label[ind] + "_all", JetTagCollection_Label[ind] + "_all", btagBins, btagL, btagU);
353  H1mod_.back()[JetTagCollection_Label[ind]][i.first]->setAxisTitle(JetTagCollection_Label[ind] + "discriminant",
354  1);
355  }
356  ibooker.setCurrentFolder(dqmFolder);
357  }
358  int nBinsPt = 60;
359  double pTmin = 30;
360  double pTMax = 330;
361  int nBinsPhi = 54;
362  double phimin = -M_PI;
363  double phiMax = M_PI;
364  int nBinsEta = 40;
365  double etamin = -2.4;
366  double etaMax = 2.4;
367 
368  for (unsigned int i = 0; i < m_mcLabels.size(); ++i) {
371  std::string labelEta;
372  std::string labelPhi;
373  std::string labelEtaPhi;
374  std::string labelEtaPhi_threshold;
375  if (!JetTagCollection_Label[ind].empty() && JetTagCollection_Label[ind] != "NULL") {
376  label = JetTagCollection_Label[ind] + "__";
377  label += flavour;
378 
379  // book 1D btag plot for 'b,c,light,g'
380  H1_.back()[label] = ibooker.book1D(
381  label, Form("%s %s", JetTagCollection_Label[ind].c_str(), flavour.c_str()), btagBins, btagL, btagU);
382  H1_.back()[label]->setAxisTitle("disc", 1);
383  for (auto j : HCALSpecialsNames) {
384  ibooker.setCurrentFolder(dqmFolder + "/" + j.second);
385  H1mod_.back()[label][j.first] = ibooker.book1D(
386  label, Form("%s %s", JetTagCollection_Label[ind].c_str(), flavour.c_str()), btagBins, btagL, btagU);
387  H1mod_.back()[label][j.first]->setAxisTitle("disc", 1);
388  }
389  ibooker.setCurrentFolder(dqmFolder);
390  label = JetTagCollection_Label[ind] + "___";
391  labelEta = label;
392  labelPhi = label;
393  labelEtaPhi = label;
394  labelEtaPhi_threshold = label;
395  label += flavour + "_disc_pT";
396  labelEta += flavour + "_disc_eta";
397  labelPhi += flavour + "_disc_phi";
398  labelEtaPhi += flavour + "_eta_phi";
399  labelEtaPhi_threshold += flavour + "_eta_phi_disc05";
400 
401  // book 2D btag plot for 'b,c,light,g'
402  H2_.back()[label] = ibooker.book2D(label, label, btagBins, btagL, btagU, nBinsPt, pTmin, pTMax);
403  H2_.back()[label]->setAxisTitle("pT", 2);
404  H2_.back()[label]->setAxisTitle("disc", 1);
405  for (auto j : HCALSpecialsNames) {
406  ibooker.setCurrentFolder(dqmFolder + "/" + j.second);
407  H2mod_.back()[label][j.first] = ibooker.book2D(label, label, btagBins, btagL, btagU, nBinsPt, pTmin, pTMax);
408  H2mod_.back()[label][j.first]->setAxisTitle("pT", 2);
409  H2mod_.back()[label][j.first]->setAxisTitle("disc", 1);
410  }
411  ibooker.setCurrentFolder(dqmFolder);
412  H2Eta_.back()[labelEta] = ibooker.book2D(labelEta, labelEta, btagBins, btagL, btagU, nBinsEta, etamin, etaMax);
413  H2Eta_.back()[labelEta]->setAxisTitle("eta", 2);
414  H2Eta_.back()[labelEta]->setAxisTitle("disc", 1);
415  H2Phi_.back()[labelPhi] = ibooker.book2D(labelPhi, labelPhi, btagBins, btagL, btagU, nBinsPhi, phimin, phiMax);
416  H2Phi_.back()[labelPhi]->setAxisTitle("phi", 2);
417  H2Phi_.back()[labelPhi]->setAxisTitle("disc", 1);
418  H2EtaPhi_.back()[labelEtaPhi] =
419  ibooker.book2D(labelEtaPhi, labelEtaPhi, nBinsEta, etamin, etaMax, nBinsPhi, phimin, phiMax);
420  H2EtaPhi_.back()[labelEtaPhi]->setAxisTitle("phi", 2);
421  H2EtaPhi_.back()[labelEtaPhi]->setAxisTitle("eta", 1);
422  H2EtaPhi_threshold_.back()[labelEtaPhi_threshold] = ibooker.book2D(
423  labelEtaPhi_threshold, labelEtaPhi_threshold, nBinsEta, etamin, etaMax, nBinsPhi, phimin, phiMax);
424  H2EtaPhi_threshold_.back()[labelEtaPhi_threshold]->setAxisTitle("phi", 2);
425  H2EtaPhi_threshold_.back()[labelEtaPhi_threshold]->setAxisTitle("eta", 1);
426  }
427  }
428  }
429 }
std::vector< std::map< std::string, std::map< HCALSpecials, MonitorElement * > > > H2mod_
const char *const TaggingVariableTokens[]
std::vector< std::string > m_mcLabels
std::set< std::string > keepSetTrack
std::vector< std::map< std::string, MonitorElement * > > H2EtaPhi_threshold_
std::vector< std::map< std::string, MonitorElement * > > H2_
std::set< std::string > keepSetVtx
std::vector< std::map< std::string, MonitorElement * > > H1_
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:268
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
std::vector< std::map< std::string, MonitorElement * > > H2EtaPhi_
#define M_PI
std::vector< std::map< std::string, MonitorElement * > > H2Eta_
std::map< HLTBTagPerformanceAnalyzer::HCALSpecials, std::string > HCALSpecialsNames
std::vector< std::map< std::string, MonitorElement * > > H2Phi_
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:109
std::vector< std::string > hltPathNames_
std::vector< std::map< std::string, std::map< HCALSpecials, MonitorElement * > > > H1mod_
std::vector< edm::EDGetTokenT< reco::JetTagCollection > > JetTagCollection_
edm::EDConsumerBase::Labels label
std::vector< std::string > JetTagCollection_Label
std::set< std::string > keepSetJet
void HLTBTagPerformanceAnalyzer::dqmBeginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
override

Definition at line 108 of file HLTBTagPerformanceAnalyzer.cc.

References begin, end, runEdmFileComparison::found, createfilelist::int, keepSet, keepSetJet, keepSetTrack, keepSetVtx, label, and edm::EDConsumerBase::labelsForToken().

108  {
109  // Make a combined set of inputs avaiable
110  std::set_union(std::begin(keepSetJet),
114  std::inserter(keepSet, std::begin(keepSet)));
115  std::set_union(std::begin(keepSet),
116  std::end(keepSet),
119  std::inserter(keepSet, std::begin(keepSet)));
120  triggerConfChanged_ = true;
121  EDConsumerBase::labelsForToken(hlTriggerResults_, label);
122 
124  const std::vector<std::string> &allHltPathNames = hltConfigProvider_.triggerNames();
125 
126  // fill hltPathIndexs_ with the trigger number of each hltPathNames_
127  for (size_t trgs = 0; trgs < hltPathNames_.size(); trgs++) {
128  unsigned int found = 1;
129  int it_mem = -1;
130  for (size_t it = 0; it < allHltPathNames.size(); ++it) {
131  found = allHltPathNames.at(it).find(hltPathNames_[trgs]);
132  if (found == 0) {
133  it_mem = (int)it;
134  }
135  } // for allallHltPathNames
136  hltPathIndexs_.push_back(it_mem);
137  } // for hltPathNames_
138 
139  // fill _isfoundHLTs for each hltPathNames_
140  for (size_t trgs = 0; trgs < hltPathNames_.size(); trgs++) {
141  if (hltPathIndexs_[trgs] < 0) {
142  _isfoundHLTs.push_back(false);
143  } else {
144  _isfoundHLTs.push_back(true);
145  }
146  }
147 }
std::set< std::string > keepSetTrack
const std::vector< std::string > & triggerNames() const
names of trigger paths
char const * process
Definition: ProductLabels.h:7
std::set< std::string > keepSetVtx
#define end
Definition: vmac.h:39
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
std::vector< std::string > hltPathNames_
#define begin
Definition: vmac.h:32
std::set< std::string > keepSet
edm::EDConsumerBase::Labels label
std::vector< bool > _isfoundHLTs
other class variable
std::set< std::string > keepSetJet
edm::EDGetTokenT< edm::TriggerResults > hlTriggerResults_

Member Data Documentation

std::vector<bool> HLTBTagPerformanceAnalyzer::_isfoundHLTs
private

other class variable

Definition at line 78 of file HLTBTagPerformanceAnalyzer.h.

std::vector<std::string> HLTBTagPerformanceAnalyzer::folders
private

DQM folder handle.

Definition at line 92 of file HLTBTagPerformanceAnalyzer.h.

std::vector<std::map<std::string, MonitorElement *> > HLTBTagPerformanceAnalyzer::H1_
private

Definition at line 95 of file HLTBTagPerformanceAnalyzer.h.

std::vector<std::map<std::string, std::map<HCALSpecials, MonitorElement *> > > HLTBTagPerformanceAnalyzer::H1mod_
private

Definition at line 96 of file HLTBTagPerformanceAnalyzer.h.

std::vector<std::map<std::string, MonitorElement *> > HLTBTagPerformanceAnalyzer::H2_
private

Definition at line 97 of file HLTBTagPerformanceAnalyzer.h.

std::vector<std::map<std::string, MonitorElement *> > HLTBTagPerformanceAnalyzer::H2Eta_
private

Definition at line 99 of file HLTBTagPerformanceAnalyzer.h.

std::vector<std::map<std::string, MonitorElement *> > HLTBTagPerformanceAnalyzer::H2EtaPhi_
private

Definition at line 100 of file HLTBTagPerformanceAnalyzer.h.

std::vector<std::map<std::string, MonitorElement *> > HLTBTagPerformanceAnalyzer::H2EtaPhi_threshold_
private

Definition at line 101 of file HLTBTagPerformanceAnalyzer.h.

std::vector<std::map<std::string, std::map<HCALSpecials, MonitorElement *> > > HLTBTagPerformanceAnalyzer::H2mod_
private

Definition at line 98 of file HLTBTagPerformanceAnalyzer.h.

std::vector<std::map<std::string, MonitorElement *> > HLTBTagPerformanceAnalyzer::H2Phi_
private

Definition at line 102 of file HLTBTagPerformanceAnalyzer.h.

std::map<HLTBTagPerformanceAnalyzer::HCALSpecials, std::string> HLTBTagPerformanceAnalyzer::HCALSpecialsNames
private

Definition at line 110 of file HLTBTagPerformanceAnalyzer.h.

HLTConfigProvider HLTBTagPerformanceAnalyzer::hltConfigProvider_
private

Definition at line 67 of file HLTBTagPerformanceAnalyzer.h.

std::string HLTBTagPerformanceAnalyzer::hltConfigProvider_Label
private

Definition at line 109 of file HLTBTagPerformanceAnalyzer.h.

std::vector<int> HLTBTagPerformanceAnalyzer::hltPathIndexs_
private

Definition at line 79 of file HLTBTagPerformanceAnalyzer.h.

std::vector<std::string> HLTBTagPerformanceAnalyzer::hltPathNames_
private

Definition at line 66 of file HLTBTagPerformanceAnalyzer.h.

edm::EDGetTokenT<edm::TriggerResults> HLTBTagPerformanceAnalyzer::hlTriggerResults_
private

Definition at line 64 of file HLTBTagPerformanceAnalyzer.h.

std::string HLTBTagPerformanceAnalyzer::hlTriggerResults_Label
private

Definition at line 108 of file HLTBTagPerformanceAnalyzer.h.

std::vector<edm::EDGetTokenT<reco::JetTagCollection> > HLTBTagPerformanceAnalyzer::JetTagCollection_
private

Definition at line 69 of file HLTBTagPerformanceAnalyzer.h.

std::vector<std::string> HLTBTagPerformanceAnalyzer::JetTagCollection_Label
private

Definition at line 107 of file HLTBTagPerformanceAnalyzer.h.

edm::EDConsumerBase::Labels HLTBTagPerformanceAnalyzer::label
private
std::vector<flavours_t> HLTBTagPerformanceAnalyzer::m_mcFlavours
private

Definition at line 87 of file HLTBTagPerformanceAnalyzer.h.

std::vector<std::string> HLTBTagPerformanceAnalyzer::m_mcLabels
private

Definition at line 86 of file HLTBTagPerformanceAnalyzer.h.

bool HLTBTagPerformanceAnalyzer::m_mcMatching
private

Definition at line 89 of file HLTBTagPerformanceAnalyzer.h.

edm::EDGetTokenT<reco::JetFlavourMatchingCollection> HLTBTagPerformanceAnalyzer::m_mcPartons
private

Definition at line 85 of file HLTBTagPerformanceAnalyzer.h.

std::string HLTBTagPerformanceAnalyzer::m_mcPartons_Label
private

Definition at line 106 of file HLTBTagPerformanceAnalyzer.h.

double HLTBTagPerformanceAnalyzer::m_mcRadius
private

Definition at line 88 of file HLTBTagPerformanceAnalyzer.h.

std::string HLTBTagPerformanceAnalyzer::mainFolder_
private

Definition at line 65 of file HLTBTagPerformanceAnalyzer.h.

edm::Handle<std::vector<reco::ShallowTagInfo> > HLTBTagPerformanceAnalyzer::shallowTagInfosPf
private

Definition at line 75 of file HLTBTagPerformanceAnalyzer.h.

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

Definition at line 72 of file HLTBTagPerformanceAnalyzer.h.

bool HLTBTagPerformanceAnalyzer::triggerConfChanged_
private

Definition at line 68 of file HLTBTagPerformanceAnalyzer.h.