CMS 3D CMS Logo

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

#include <HLTHiggsSubAnalysis.h>

Public Types

enum  { GEN, RECO }
 
typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 

Public Member Functions

void analyze (const edm::Event &iEvent, const edm::EventSetup &iEventSetup, EVTColContainer *cols)
 
void beginJob ()
 
void beginRun (const edm::Run &iRun, const edm::EventSetup &iEventSetup)
 
void bookHistograms (DQMStore::IBooker &)
 
const std::vector< unsigned int > getObjectsType (const std::string &hltpath) const
 Extract what objects need this analysis. More...
 
 HLTHiggsSubAnalysis (const edm::ParameterSet &pset, const std::string &analysisname, edm::ConsumesCollector &&iC)
 
 ~HLTHiggsSubAnalysis ()
 

Private Member Functions

void bookHist (const std::string &source, const std::string &objType, const std::string &variable, DQMStore::IBooker &)
 
void bookobjects (const edm::ParameterSet &anpset, edm::ConsumesCollector &iC)
 
void fillHist (const std::string &source, const std::string &objType, const std::string &variable, const float &value)
 
void initAndInsertJets (const edm::Event &iEvent, EVTColContainer *cols, std::vector< MatchStruct > *matches)
 
void initobjects (const edm::Event &iEvent, EVTColContainer *col)
 
void InitSelector (const unsigned int &objtype)
 
void insertcandidates (const unsigned int &objtype, const EVTColContainer *col, std::vector< MatchStruct > *matches)
 
void passJetCuts (std::vector< MatchStruct > *matches, std::map< std::string, bool > &jetCutResult, float &dEtaqq, float &mqq, float &dPhibb, float &CSV1, float &CSV2, float &CSV3)
 
void passOtherCuts (const std::vector< MatchStruct > &matches, std::map< std::string, bool > &jetCutResult)
 

Private Attributes

std::string _analysisname
 
std::vector< HLTHiggsPlotter_analyzers
 
bool _bookHtPlots
 
std::map< unsigned int, double > _cutMaxEta
 
std::map< unsigned int, double > _cutMinPt
 
std::map< unsigned int, unsigned int > _cutMotherId
 
std::map< unsigned int, std::vector< double > > _cutsDr
 
std::map< std::string, MonitorElement * > _elements
 
std::map< unsigned int, std::string > _genCut
 gen/rec objects cuts More...
 
edm::EDGetTokenT< reco::GenJetCollection_genJetLabel
 
StringCutObjectSelector< reco::GenJet > * _genJetSelector
 
edm::EDGetTokenT< reco::GenParticleCollection_genParticleLabel
 
std::map< unsigned int, StringCutObjectSelector< reco::GenParticle > * > _genSelectorMap
 
std::string _histDirectory
 
HLTConfigProvider _hltConfig
 
std::set< std::string > _hltPaths
 the hlt paths found in the hltConfig More...
 
std::vector< std::string > _hltPathsToCheck
 the hlt paths with regular expressions More...
 
std::string _hltProcessName
 
double _HtJetEtaMax
 
double _HtJetPtMin
 
unsigned int _minCandidates
 The minimum number of reco/gen candidates needed by the analysis. More...
 
std::vector< double > _NminOneCuts
 
std::vector< double > _parametersEta
 Some kinematical parameters. More...
 
std::vector< double > _parametersHt
 
std::vector< double > _parametersPhi
 
std::vector< double > _parametersPu
 
std::vector< double > _parametersTurnOn
 
edm::ParameterSet _pset
 
edm::EDGetTokenT< std::vector< PileupSummaryInfo > > _puSummaryInfo
 
StringCutObjectSelector< reco::CaloMET > * _recCaloMETSelector
 
std::map< unsigned int, std::string > _recCut
 
StringCutObjectSelector< reco::GsfElectron > * _recElecSelector
 
std::map< unsigned int, std::string > _recLabels
 
edm::EDGetTokenT< reco::CaloMETCollection_recLabelsCaloMET
 
edm::EDGetTokenT< reco::GsfElectronCollection_recLabelsElec
 
edm::EDGetTokenT< reco::MuonCollection_recLabelsMuon
 
edm::EDGetTokenT< reco::PFJetCollection_recLabelsPFJet
 
edm::EDGetTokenT< reco::PFMETCollection_recLabelsPFMET
 
edm::EDGetTokenT< reco::PFTauCollection_recLabelsPFTau
 
edm::EDGetTokenT< reco::PhotonCollection_recLabelsPhoton
 
StringCutObjectSelector< reco::Muon > * _recMuonSelector
 
edm::EDGetTokenT< reco::PFJetCollection_recoHtJetLabel
 
StringCutObjectSelector< reco::PFJet > * _recPFJetSelector
 
StringCutObjectSelector< reco::PFMET > * _recPFMETSelector
 
StringCutObjectSelector< reco::PFTau > * _recPFTauSelector
 
StringCutObjectSelector< reco::Photon > * _recPhotonSelector
 
edm::EDGetTokenT< reco::JetTagCollection_recTagPFJet
 
StringCutObjectSelector< reco::Track > * _recTrackSelector
 
std::map< std::string, std::string > _shortpath2long
 Relation between the short version of a path. More...
 
edm::EDGetTokenT< edm::TriggerResults_trigResultsTag
 
bool _useNminOneCuts
 
unsigned int NptPlots
 

Detailed Description

Generate histograms for trigger efficiencies Higgs related Documentation available on the CMS TWiki: https://twiki.cern.ch/twiki/bin/view/CMS/HiggsWGHLTValidate

Author
J. Duarte Campderros (based and adapted on J. Klukas, M. Vander Donckt and J. Alcaraz code from the HLTriggerOffline/Muon package)

Definition at line 58 of file HLTHiggsSubAnalysis.h.

Member Typedef Documentation

◆ DQMStore

Definition at line 60 of file HLTHiggsSubAnalysis.h.

◆ MonitorElement

Definition at line 61 of file HLTHiggsSubAnalysis.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
GEN 
RECO 

Definition at line 63 of file HLTHiggsSubAnalysis.h.

Constructor & Destructor Documentation

◆ HLTHiggsSubAnalysis()

HLTHiggsSubAnalysis::HLTHiggsSubAnalysis ( const edm::ParameterSet pset,
const std::string &  analysisname,
edm::ConsumesCollector &&  iC 
)

Definition at line 28 of file HLTHiggsSubAnalysis.cc.

References _analysisname, _bookHtPlots, _cutMaxEta, _cutMinPt, _genCut, _hltPathsToCheck, _HtJetEtaMax, _HtJetPtMin, _minCandidates, _NminOneCuts, _parametersHt, _parametersTurnOn, _pset, _puSummaryInfo, _recCut, _recLabels, _useNminOneCuts, edm::ParameterSet::addParameter(), bookobjects(), edm::ParameterSet::exists(), edm::ParameterSet::existsAs(), beamvalidation::exit(), edm::ParameterSet::getParameter(), EVTColContainer::getTypeString(), edm::ParameterSet::getUntrackedParameter(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, NptPlots, muonDTDigis_cfi::pset, and AlCaHLTBitMon_QueryRunRegistry::string.

31  : _pset(pset),
32  _analysisname(analysisname),
33  _minCandidates(0),
34  _HtJetPtMin(0),
35  _HtJetEtaMax(0),
36  _hltProcessName(pset.getParameter<std::string>("hltProcessName")),
37  _histDirectory(pset.getParameter<std::string>("histDirectory")),
38  _genParticleLabel(iC.consumes<reco::GenParticleCollection>(pset.getParameter<std::string>("genParticleLabel"))),
39  _genJetLabel(iC.consumes<reco::GenJetCollection>(pset.getParameter<std::string>("genJetLabel"))),
41  pset.getUntrackedParameter<std::string>("recoHtJetLabel", "ak4PFJetsCHS"))),
42  _parametersEta(pset.getParameter<std::vector<double>>("parametersEta")),
43  _parametersPhi(pset.getParameter<std::vector<double>>("parametersPhi")),
44  _parametersPu(pset.getParameter<std::vector<double>>("parametersPu")),
45  _parametersHt(0),
46  _parametersTurnOn(pset.getParameter<std::vector<double>>("parametersTurnOn")),
48  _genJetSelector(nullptr),
49  _recMuonSelector(nullptr),
50  _recElecSelector(nullptr),
51  _recCaloMETSelector(nullptr),
52  _recPFMETSelector(nullptr),
53  _recPFTauSelector(nullptr),
54  _recPhotonSelector(nullptr),
55  _recPFJetSelector(nullptr),
56  _recTrackSelector(nullptr),
57  _NminOneCuts(0),
58  _useNminOneCuts(false) {
59  // Specific parameters for this analysis
60  edm::ParameterSet anpset = pset.getParameter<edm::ParameterSet>(analysisname);
61  // Collections labels (but genparticles already initialized)
62  // initializing _recLabels data member)
63  if (anpset.exists("parametersTurnOn")) {
64  _parametersTurnOn = anpset.getParameter<std::vector<double>>("parametersTurnOn");
65  _pset.addParameter("parametersTurnOn", _parametersTurnOn);
66  }
67  this->bookobjects(anpset, iC);
68  // Generic objects: Initialization of cuts
69  for (std::map<unsigned int, std::string>::const_iterator it = _recLabels.begin(); it != _recLabels.end(); ++it) {
70  const std::string objStr = EVTColContainer::getTypeString(it->first);
71  _genCut[it->first] = pset.getParameter<std::string>(objStr + "_genCut");
72  _recCut[it->first] = pset.getParameter<std::string>(objStr + "_recCut");
73  _cutMinPt[it->first] = pset.getParameter<double>(objStr + "_cutMinPt");
74  _cutMaxEta[it->first] = pset.getParameter<double>(objStr + "_cutMaxEta");
75  }
76  //--- Updating parameters if has to be modified for this particular specific analysis
77  for (std::map<unsigned int, std::string>::const_iterator it = _recLabels.begin(); it != _recLabels.end(); ++it) {
78  const std::string objStr = EVTColContainer::getTypeString(it->first);
79  if (anpset.existsAs<std::string>(objStr + "_genCut", false)) {
80  _genCut[it->first] = anpset.getUntrackedParameter<std::string>(objStr + "_genCut");
81  }
82  if (anpset.existsAs<std::string>(objStr + "_recCut", false)) {
83  _recCut[it->first] = anpset.getUntrackedParameter<std::string>(objStr + "_recCut");
84  }
85  if (anpset.existsAs<double>(objStr + "_cutMinPt", false)) {
86  _cutMinPt[it->first] = anpset.getUntrackedParameter<double>(objStr + "_cutMinPt");
87  }
88  if (anpset.existsAs<double>(objStr + "_cutMaxEta", false)) {
89  _cutMaxEta[it->first] = anpset.getUntrackedParameter<double>(objStr + "_cutMaxEta");
90  }
91  }
92  _hltPathsToCheck = anpset.getParameter<std::vector<std::string>>("hltPathsToCheck");
93  _minCandidates = anpset.getParameter<unsigned int>("minCandidates");
94 
95  std::vector<double> default_parametersHt;
96  default_parametersHt.push_back(100);
97  default_parametersHt.push_back(0);
98  default_parametersHt.push_back(1000);
99  _parametersHt = pset.getUntrackedParameter<std::vector<double>>("parametersHt", default_parametersHt);
100 
101  _HtJetPtMin = anpset.getUntrackedParameter<double>("HtJetPtMin", -1);
102  _HtJetEtaMax = anpset.getUntrackedParameter<double>("HtJetEtaMax", -1);
103 
104  if (_HtJetPtMin > 0 && _HtJetEtaMax > 0)
105  _bookHtPlots = true;
106  else
107  _bookHtPlots = false;
108 
109  if (pset.exists("pileUpInfoLabel")) {
110  _puSummaryInfo = iC.consumes<std::vector<PileupSummaryInfo>>(pset.getParameter<std::string>("pileUpInfoLabel"));
111  }
112 
113  if (anpset.existsAs<std::vector<double>>("NminOneCuts", false)) {
114  _NminOneCuts = anpset.getUntrackedParameter<std::vector<double>>("NminOneCuts");
115  if (_NminOneCuts.size() < 9 + _minCandidates) {
116  edm::LogError("HiggsValidation") << "In HLTHiggsSubAnalysis::HLTHiggsSubAnalysis, "
117  << "Incoherence found in the python configuration file!!\nThe SubAnalysis '"
118  << _analysisname << "' has a vector NminOneCuts with size "
119  << _NminOneCuts.size() << ", while it needs to be at least of size "
120  << (9 + _minCandidates) << ".";
121  exit(-1);
122  }
123  if ((_NminOneCuts[0] || _NminOneCuts[1]) && _minCandidates < 4) {
124  edm::LogError("HiggsValidation") << "In HLTHiggsSubAnalysis::HLTHiggsSubAnalysis, "
125  << "Incoherence found in the python configuration file!!\nThe SubAnalysis '"
126  << _analysisname
127  << "' has a vector NminOneCuts with a dEtaqq of mqq cut on the least b-tagged "
128  "jets of the first 4 jets while only requiring "
129  << _minCandidates << " jets.";
130  exit(-1);
131  }
132  if (_NminOneCuts[5] && _minCandidates < 3) {
133  edm::LogError("HiggsValidation") << "In HLTHiggsSubAnalysis::HLTHiggsSubAnalysis, "
134  << "Incoherence found in the python configuration file!!\nThe SubAnalysis '"
135  << _analysisname
136  << "' has a vector NminOneCuts with a CSV3 cut while only requiring "
137  << _minCandidates << " jets.";
138  exit(-1);
139  }
140  if ((_NminOneCuts[2] || _NminOneCuts[4]) && _minCandidates < 2) {
141  edm::LogError("HiggsValidation") << "In HLTHiggsSubAnalysis::HLTHiggsSubAnalysis, "
142  << "Incoherence found in the python configuration file!!\nThe SubAnalysis '"
143  << _analysisname
144  << "' has a vector NminOneCuts with a dPhibb or CSV2 cut using the second most "
145  "b-tagged jet while only requiring "
146  << _minCandidates << " jet.";
147  exit(-1);
148  }
149  for (std::vector<double>::const_iterator it = _NminOneCuts.begin(); it != _NminOneCuts.end(); ++it) {
150  if (*it) {
151  _useNminOneCuts = true;
152  break;
153  }
154  }
155  }
156  // NptPlots = ( _useNminOneCuts ? _minCandidates : 2 );
158 }
std::vector< double > _parametersTurnOn
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
StringCutObjectSelector< reco::CaloMET > * _recCaloMETSelector
edm::EDGetTokenT< reco::GenParticleCollection > _genParticleLabel
edm::EDGetTokenT< reco::PFJetCollection > _recoHtJetLabel
unsigned int _minCandidates
The minimum number of reco/gen candidates needed by the analysis.
std::vector< double > _NminOneCuts
bool exists(std::string const &parameterName) const
checks if a parameter exists
std::vector< GenJet > GenJetCollection
collection of GenJet objects
edm::ParameterSet _pset
StringCutObjectSelector< reco::PFMET > * _recPFMETSelector
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:172
Log< level::Error, false > LogError
edm::EDGetTokenT< reco::GenJetCollection > _genJetLabel
std::map< unsigned int, std::string > _recCut
std::vector< double > _parametersPu
T getUntrackedParameter(std::string const &, T const &) const
StringCutObjectSelector< reco::Track > * _recTrackSelector
StringCutObjectSelector< reco::GenJet > * _genJetSelector
std::map< unsigned int, std::string > _genCut
gen/rec objects cuts
edm::EDGetTokenT< std::vector< PileupSummaryInfo > > _puSummaryInfo
void addParameter(std::string const &name, T const &value)
Definition: ParameterSet.h:136
std::map< unsigned int, double > _cutMaxEta
StringCutObjectSelector< reco::PFTau > * _recPFTauSelector
std::map< unsigned int, double > _cutMinPt
edm::EDGetTokenT< edm::TriggerResults > _trigResultsTag
std::vector< double > _parametersHt
StringCutObjectSelector< reco::Muon > * _recMuonSelector
std::vector< PFJet > PFJetCollection
collection of PFJet objects
std::vector< double > _parametersPhi
std::vector< std::string > _hltPathsToCheck
the hlt paths with regular expressions
std::vector< double > _parametersEta
Some kinematical parameters.
void bookobjects(const edm::ParameterSet &anpset, edm::ConsumesCollector &iC)
StringCutObjectSelector< reco::Photon > * _recPhotonSelector
std::map< unsigned int, std::string > _recLabels
StringCutObjectSelector< reco::PFJet > * _recPFJetSelector
static const std::string getTypeString(const unsigned int &objtype)
Tranform types into strings.
StringCutObjectSelector< reco::GsfElectron > * _recElecSelector
def exit(msg="")

◆ ~HLTHiggsSubAnalysis()

HLTHiggsSubAnalysis::~HLTHiggsSubAnalysis ( )

Definition at line 160 of file HLTHiggsSubAnalysis.cc.

References _genJetSelector, _genSelectorMap, _recCaloMETSelector, _recElecSelector, _recMuonSelector, _recPFJetSelector, _recPFMETSelector, _recPFTauSelector, _recPhotonSelector, _recTrackSelector, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, and genParticles_cff::map.

160  {
161  for (std::map<unsigned int, StringCutObjectSelector<reco::GenParticle>*>::iterator it = _genSelectorMap.begin();
162  it != _genSelectorMap.end();
163  ++it) {
164  delete it->second;
165  it->second = nullptr;
166  }
167  delete _genJetSelector;
168  _genJetSelector = nullptr;
169  delete _recMuonSelector;
170  _recMuonSelector = nullptr;
171  delete _recElecSelector;
172  _recElecSelector = nullptr;
173  delete _recPhotonSelector;
174  _recPhotonSelector = nullptr;
175  delete _recCaloMETSelector;
176  _recCaloMETSelector = nullptr;
177  delete _recPFMETSelector;
178  _recPFMETSelector = nullptr;
179  delete _recPFTauSelector;
180  _recPFTauSelector = nullptr;
181  delete _recPFJetSelector;
182  _recPFJetSelector = nullptr;
183  delete _recTrackSelector;
184  _recTrackSelector = nullptr;
185 }
StringCutObjectSelector< reco::CaloMET > * _recCaloMETSelector
StringCutObjectSelector< reco::PFMET > * _recPFMETSelector
std::map< unsigned int, StringCutObjectSelector< reco::GenParticle > * > _genSelectorMap
StringCutObjectSelector< reco::Track > * _recTrackSelector
StringCutObjectSelector< reco::GenJet > * _genJetSelector
StringCutObjectSelector< reco::PFTau > * _recPFTauSelector
StringCutObjectSelector< reco::Muon > * _recMuonSelector
StringCutObjectSelector< reco::Photon > * _recPhotonSelector
StringCutObjectSelector< reco::PFJet > * _recPFJetSelector
StringCutObjectSelector< reco::GsfElectron > * _recElecSelector

Member Function Documentation

◆ analyze()

void HLTHiggsSubAnalysis::analyze ( const edm::Event iEvent,
const edm::EventSetup iEventSetup,
EVTColContainer cols 
)

Definition at line 366 of file HLTHiggsSubAnalysis.cc.

References _analysisname, _analyzers, _bookHtPlots, _elements, _genCut, _genJetLabel, _genJetSelector, _genSelectorMap, _hltPathsToCheck, _HtJetEtaMax, _HtJetPtMin, _minCandidates, _NminOneCuts, _puSummaryInfo, _recLabels, _recoHtJetLabel, _shortpath2long, _useNminOneCuts, edm::HLTGlobalStatus::accept(), cms::cuda::co, PVValHelper::eta, fillHist(), GEN, EVTColContainer::genJets, EVTColContainer::genParticles, EVTColContainer::getTypeString(), TriggerAnalyzer::hltPath, mps_fire::i, iEvent, initAndInsertJets(), initobjects(), InitSelector(), insertcandidates(), edm::HandleBase::isValid(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, dqmiolumiharvest::j, genParticles_cff::map, oniaPATMuonsWithTrigger_cff::matches, PV_cfg::maxPt, NptPlots, electrons_cff::objType, passJetCuts(), passOtherCuts(), EVTColContainer::PFJET, EVTColContainer::PFMET, phi, DiDispStaMuonMonitor_cfi::pt, RECO, jetUpdater_cfi::sort, source, AlCaHLTBitMon_QueryRunRegistry::string, groupFilesInBlocks::temp, EVTColContainer::triggerResults, and trigNames.

366  {
367  // Initialize the collection (the ones which hasn't been initialiazed yet)
368  this->initobjects(iEvent, cols);
369  // utility map
370  std::map<unsigned int, std::string> u2str;
371  u2str[GEN] = "gen";
372  u2str[RECO] = "rec";
373 
374  std::map<unsigned int, double> Htmap;
375  Htmap[GEN] = 0.;
376  Htmap[RECO] = 0.;
377 
379  iEvent.getByToken(_puSummaryInfo, puInfo);
380  int nbMCvtx = -1;
381  if (puInfo.isValid()) {
382  std::vector<PileupSummaryInfo>::const_iterator PVI;
383  for (PVI = puInfo->begin(); PVI != puInfo->end(); ++PVI) {
384  if (PVI->getBunchCrossing() == 0) {
385  nbMCvtx = PVI->getPU_NumInteractions();
386  break;
387  }
388  }
389  }
390 
391  // Extract the match structure containing the gen/reco candidates (electron, muons,...)
392  // common to all the SubAnalysis
393  //---- Generation
394  // Make each good gen object into the base cand for a MatchStruct
395  std::vector<MatchStruct>* matches = new std::vector<MatchStruct>;
396  // bool alreadyMu = false;
397  for (std::map<unsigned int, std::string>::iterator it = _recLabels.begin(); it != _recLabels.end(); ++it) {
398  // Use genJets for jet matchstructs
399  if (it->first == EVTColContainer::PFJET) {
400  // Skip genJets for N-1 plots
401  if (!_useNminOneCuts) {
402  // Initialize selectors when first event
403  if (!_genJetSelector) {
405  }
406  for (size_t i = 0; i < cols->genJets->size(); ++i) {
407  if (_genJetSelector->operator()(cols->genJets->at(i))) {
408  matches->push_back(MatchStruct(&cols->genJets->at(i), it->first));
409  }
410  }
411  }
412  }
413  // Use genParticles
414  else {
415  // Avoiding the TkMu and Mu case
416  /* if( alreadyMu )
417  {
418  continue;
419  }*/
420  // Initialize selectors when first event
421  if (!_genSelectorMap[it->first]) {
423  }
424 
425  for (size_t i = 0; i < cols->genParticles->size(); ++i) {
426  if (_genSelectorMap[it->first]->operator()(cols->genParticles->at(i))) {
427  matches->push_back(MatchStruct(&cols->genParticles->at(i), it->first));
428  }
429  }
430  /* if( it->first == EVTColContainer::MUON || it->first == EVTColContainer::TRACK )
431  {
432  alreadyMu = true;
433  }*/
434  }
435  }
436  // Sort the MatchStructs by pT for later filling of turn-on curve
437  std::sort(matches->begin(), matches->end(), matchesByDescendingPt());
438 
439  // Map to reference the source (gen/reco) with the recoCandidates
440  std::map<unsigned int, std::vector<MatchStruct>> sourceMatchMap; // To be a pointer to delete
441  // --- Storing the generating candidates
442  sourceMatchMap[GEN] = *matches;
443 
444  // Reuse the vector
445  matches->clear();
446  // --- same for RECO objects
447 
448  // Different treatment for jets (b-tag)
449  std::map<std::string, bool> nMinOne;
450  std::map<std::string, bool> jetCutResult;
451  float dEtaqq;
452  float mqq;
453  float dPhibb;
454  float CSV1;
455  float CSV2;
456  float CSV3;
457  bool passAllCuts = false;
458  if (_recLabels.find(EVTColContainer::PFJET) != _recLabels.end()) {
459  // Initialize jet selector
461  // Initialize and insert pfJets
462  this->initAndInsertJets(iEvent, cols, matches);
463  // Make sure to skip events that don't have enough jets
464  if (matches->size() < NptPlots) {
465  delete matches;
466  return;
467  }
468  // Cuts on multiple jet events (RECO)
469  if (_useNminOneCuts) {
470  this->passJetCuts(matches, jetCutResult, dEtaqq, mqq, dPhibb, CSV1, CSV2, CSV3);
471  }
472  }
473  // Extraction of the objects candidates
474  for (std::map<unsigned int, std::string>::iterator it = _recLabels.begin(); it != _recLabels.end(); ++it) {
475  // Reco selectors (the function takes into account if it was instantiated
476  // before or not
477  this->InitSelector(it->first);
478  // -- Storing the matches
479  this->insertcandidates(it->first, cols, matches);
480  }
481 
482  // Sort the MatchStructs by pT for later filling of turn-on curve
483  std::sort(matches->begin(), matches->end(), matchesByDescendingPt());
484 
485  if (_useNminOneCuts) {
486  // Check non-jet N-1 Cuts
487  this->passOtherCuts(*matches, jetCutResult);
488 
489  // Make N-1 booleans from jetCutResults
490  for (std::map<std::string, bool>::const_iterator it = jetCutResult.begin(); it != jetCutResult.end(); ++it) {
491  nMinOne[it->first] = true;
492  for (std::map<std::string, bool>::const_iterator it2 = jetCutResult.begin(); it2 != jetCutResult.end(); ++it2) {
493  //ignore CSV2,CSV3 cut plotting CSV1
494  if (it->first == "CSV1" && it2->first == "CSV3")
495  continue;
496  if (it->first == "CSV1" && it2->first == "CSV2")
497  continue;
498 
499  //ignore CSV3 plotting cut CSV2
500  if (it->first == "CSV2" && it2->first == "CSV3")
501  continue;
502 
503  if (it->first != it2->first && !(it2->second)) {
504  nMinOne[it->first] = false;
505  break;
506  }
507  }
508  }
509  bool temp = false;
510  for (std::map<std::string, bool>::const_iterator it = nMinOne.begin(); it != nMinOne.end(); ++it) {
511  if (temp && it->second) {
512  passAllCuts = true;
513  break;
514  }
515  if (it->second)
516  temp = true;
517  }
518  }
519 
520  // --- Storing the reco candidates
521  sourceMatchMap[RECO] = *matches;
522  // --- All the objects are in place
523  delete matches;
524 
525  // -- Trigger Results
526  const edm::TriggerNames& trigNames = iEvent.triggerNames(*(cols->triggerResults));
527 
528  if (_bookHtPlots) {
530  iEvent.getByToken(_recoHtJetLabel, recoJet);
531  if (recoJet.isValid()) {
532  for (reco::PFJetCollection::const_iterator iJet = recoJet->begin(); iJet != recoJet->end(); iJet++) {
533  double pt = iJet->pt();
534  double eta = iJet->eta();
535  if (pt > _HtJetPtMin && fabs(eta) < _HtJetEtaMax) {
536  Htmap[RECO] += pt;
537  }
538  }
539  }
540 
542  iEvent.getByToken(_genJetLabel, genJet);
543  if (genJet.isValid()) {
544  for (reco::GenJetCollection::const_iterator iJet = genJet->begin(); iJet != genJet->end(); iJet++) {
545  double pt = iJet->pt();
546  double eta = iJet->eta();
547  if (pt > _HtJetPtMin && fabs(eta) < _HtJetEtaMax) {
548  Htmap[GEN] += pt;
549  }
550  }
551  }
552  }
553 
554  // Filling the histograms if pass the minimum amount of candidates needed by the analysis:
555  // GEN + RECO CASE in the same loop
556  for (std::map<unsigned int, std::vector<MatchStruct>>::iterator it = sourceMatchMap.begin();
557  it != sourceMatchMap.end();
558  ++it) {
559  // it->first: gen/reco it->second: matches (std::vector<MatchStruc>)
560  if (it->second.size() < _minCandidates) // FIXME: A bug is potentially here: what about the mixed channels?
561  {
562  continue;
563  }
564 
565  // Filling the gen/reco objects (eff-denominators):
566  // Just the first two different ones, if there are more
567  std::map<unsigned int, int>* countobjects = new std::map<unsigned int, int>;
568  // Initializing the count of the used object
569  for (std::map<unsigned int, std::string>::iterator co = _recLabels.begin(); co != _recLabels.end(); ++co) {
570  if (!(_useNminOneCuts && co->first == EVTColContainer::PFJET && it->first == GEN)) // genJets are not there
571  countobjects->insert(std::pair<unsigned int, int>(co->first, 0));
572  }
573  int counttotal = 0;
574  const int totalobjectssize2 = NptPlots * countobjects->size();
575  for (size_t j = 0; j < it->second.size(); ++j) {
576  const unsigned int objType = it->second[j].objType;
578 
579  float pt = (it->second)[j].pt;
580  float eta = (it->second)[j].eta;
581  float phi = (it->second)[j].phi;
582 
583  // PFMET N-1 cut
584  if (_useNminOneCuts && objType == EVTColContainer::PFMET && _NminOneCuts[8] && !nMinOne["PFMET"]) {
585  continue;
586  }
587 
588  TString maxPt;
589  if ((unsigned)(*countobjects)[objType] < NptPlots) {
590  maxPt = "MaxPt";
591  maxPt += (*countobjects)[objType] + 1;
593  if (nMinOne[maxPt.Data()]) {
594  this->fillHist(u2str[it->first], objTypeStr, maxPt.Data(), pt);
595  }
596  } else {
597  this->fillHist(u2str[it->first], objTypeStr, maxPt.Data(), pt);
598  }
599  // Filled the high pt ...
600  ++((*countobjects)[objType]);
601  ++counttotal;
602  } else {
603  if ((unsigned)(*countobjects)[objType] < _minCandidates) { // To get correct results for HZZ
604  ++((*countobjects)[objType]);
605  ++counttotal;
606  } else
607  continue; // Otherwise too many entries in Eta and Phi distributions
608  }
609 
610  // Jet N-1 Cuts
612  if (passAllCuts) {
613  this->fillHist(u2str[it->first], objTypeStr, "Eta", eta);
614  this->fillHist(u2str[it->first], objTypeStr, "Phi", phi);
615  }
616  } else {
617  this->fillHist(u2str[it->first], objTypeStr, "Eta", eta);
618  this->fillHist(u2str[it->first], objTypeStr, "Phi", phi);
619  }
620 
621  // Already the minimum two objects has been filled, get out...
622  if (counttotal == totalobjectssize2) {
623  break;
624  }
625  }
626  delete countobjects;
627 
628  if (_useNminOneCuts && it->first == RECO) {
629  if (_NminOneCuts[0] && nMinOne["dEtaqq"]) {
630  this->fillHist(u2str[it->first], EVTColContainer::getTypeString(EVTColContainer::PFJET), "dEtaqq", dEtaqq);
631  }
632  if (_NminOneCuts[1] && nMinOne["mqq"]) {
633  this->fillHist(u2str[it->first], EVTColContainer::getTypeString(EVTColContainer::PFJET), "mqq", mqq);
634  }
635  if (_NminOneCuts[2] && nMinOne["dPhibb"]) {
636  this->fillHist(u2str[it->first], EVTColContainer::getTypeString(EVTColContainer::PFJET), "dPhibb", dPhibb);
637  }
638  if (_NminOneCuts[3]) {
639  std::string nameCSVplot = "CSV1";
640  if (_NminOneCuts[6])
641  nameCSVplot = "maxCSV";
642  if (nMinOne[nameCSVplot])
643  this->fillHist(u2str[it->first], EVTColContainer::getTypeString(EVTColContainer::PFJET), nameCSVplot, CSV1);
644  }
645  if (_NminOneCuts[4] && nMinOne["CSV2"]) {
646  this->fillHist(u2str[it->first], EVTColContainer::getTypeString(EVTColContainer::PFJET), "CSV2", CSV2);
647  }
648  if (_NminOneCuts[5] && nMinOne["CSV3"]) {
649  this->fillHist(u2str[it->first], EVTColContainer::getTypeString(EVTColContainer::PFJET), "CSV3", CSV3);
650  }
651  }
652 
653  //fill the efficiency vs nb of interactions
654  std::string nameVtxPlot = "trueVtxDist_" + _analysisname + "_" + u2str[it->first];
655  if ((!_useNminOneCuts) || it->first == RECO)
656  _elements[nameVtxPlot]->Fill(nbMCvtx);
657 
658  //fill the efficiency vs sum pT of jets
659  std::string nameHtPlot = "HtDist_" + _analysisname + "_" + u2str[it->first];
660  if (_bookHtPlots)
661  _elements[nameHtPlot]->Fill(Htmap[it->first]);
662 
663  // Calling to the plotters analysis (where the evaluation of the different trigger paths are done)
664  std::string SummaryName = "SummaryPaths_" + _analysisname + "_" + u2str[it->first];
665  const std::string source = u2str[it->first];
666  for (std::vector<HLTHiggsPlotter>::iterator an = _analyzers.begin(); an != _analyzers.end(); ++an) {
667  const std::string hltPath = _shortpath2long[an->gethltpath()];
668  const std::string fillShortPath = an->gethltpath();
669  const bool ispassTrigger = cols->triggerResults->accept(trigNames.triggerIndex(hltPath));
670 
671  if (_useNminOneCuts) {
672  an->analyze(ispassTrigger, source, it->second, nMinOne, dEtaqq, mqq, dPhibb, CSV1, CSV2, CSV3, passAllCuts);
673  } else {
674  an->analyze(ispassTrigger, source, it->second, _minCandidates);
675  }
676 
677  int refOfThePath = -1;
678  for (size_t itePath = 0; itePath < _hltPathsToCheck.size(); itePath++) {
679  refOfThePath++;
680  if (TString(hltPath).Contains(_hltPathsToCheck[itePath]))
681  break;
682  }
683  _elements[SummaryName]->Fill(refOfThePath);
684  if (ispassTrigger) {
685  _elements[SummaryName + "_passingHLT"]->Fill(refOfThePath, 1);
686  if ((!_useNminOneCuts) || it->first == RECO)
687  _elements[nameVtxPlot + "_" + fillShortPath]->Fill(nbMCvtx);
688  if (_bookHtPlots)
689  _elements[nameHtPlot + "_" + fillShortPath]->Fill(Htmap[it->first]);
690  } else {
691  _elements[SummaryName + "_passingHLT"]->Fill(refOfThePath, 0);
692  }
693  }
694  }
695 }
bool accept() const
Has at least one path accepted the event?
void InitSelector(const unsigned int &objtype)
std::map< std::string, std::string > _shortpath2long
Relation between the short version of a path.
void passJetCuts(std::vector< MatchStruct > *matches, std::map< std::string, bool > &jetCutResult, float &dEtaqq, float &mqq, float &dPhibb, float &CSV1, float &CSV2, float &CSV3)
void initobjects(const edm::Event &iEvent, EVTColContainer *col)
edm::EDGetTokenT< reco::PFJetCollection > _recoHtJetLabel
unsigned int _minCandidates
The minimum number of reco/gen candidates needed by the analysis.
std::map< std::string, MonitorElement * > _elements
std::vector< double > _NminOneCuts
const reco::GenParticleCollection * genParticles
edm::EDGetTokenT< reco::GenJetCollection > _genJetLabel
std::map< unsigned int, StringCutObjectSelector< reco::GenParticle > * > _genSelectorMap
__host__ __device__ VT * co
Definition: prefixScan.h:47
void passOtherCuts(const std::vector< MatchStruct > &matches, std::map< std::string, bool > &jetCutResult)
int iEvent
Definition: GenABIO.cc:224
const reco::GenJetCollection * genJets
StringCutObjectSelector< reco::GenJet > * _genJetSelector
std::map< unsigned int, std::string > _genCut
gen/rec objects cuts
void initAndInsertJets(const edm::Event &iEvent, EVTColContainer *cols, std::vector< MatchStruct > *matches)
edm::EDGetTokenT< std::vector< PileupSummaryInfo > > _puSummaryInfo
std::vector< HLTHiggsPlotter > _analyzers
static const char *const trigNames[]
Definition: EcalDumpRaw.cc:57
void fillHist(const std::string &source, const std::string &objType, const std::string &variable, const float &value)
maxPt
Definition: PV_cfg.py:224
Helper structure to order MatchStruct.
Definition: MatchStruct.h:58
bool isValid() const
Definition: HandleBase.h:70
void insertcandidates(const unsigned int &objtype, const EVTColContainer *col, std::vector< MatchStruct > *matches)
std::vector< std::string > _hltPathsToCheck
the hlt paths with regular expressions
std::map< unsigned int, std::string > _recLabels
static const std::string getTypeString(const unsigned int &objtype)
Tranform types into strings.
const edm::TriggerResults * triggerResults
static std::string const source
Definition: EdmProvDump.cc:49

◆ beginJob()

void HLTHiggsSubAnalysis::beginJob ( void  )

Definition at line 187 of file HLTHiggsSubAnalysis.cc.

187 {}

◆ beginRun()

void HLTHiggsSubAnalysis::beginRun ( const edm::Run iRun,
const edm::EventSetup iEventSetup 
)

Definition at line 189 of file HLTHiggsSubAnalysis.cc.

References _analysisname, _analyzers, _hltConfig, _hltPaths, _hltPathsToCheck, _hltProcessName, _NminOneCuts, _pset, _recLabels, _shortpath2long, ramdisk_dqm_sourceclient-live_cfg::analyzer, beamvalidation::exit(), spr::find(), newFWLiteAna::found, getObjectsType(), EVTColContainer::getTypeString(), mps_fire::i, HLTConfigProvider::init(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, dqmiolumiharvest::j, LogDebug, LogTrace, NptPlots, castor_dqm_sourceclient_file_cfg::path, topSingleLeptonDQM_PU_cfi::pattern, AlCaHLTBitMon_QueryRunRegistry::string, and HLTConfigProvider::triggerNames().

189  {
190  // Initialize the confighlt
191  bool changedConfig;
192  if (!_hltConfig.init(iRun, iSetup, _hltProcessName, changedConfig)) {
193  edm::LogError("HiggsValidations") << "HLTHiggsSubAnalysis::beginRun: "
194  << "Initializtion of HLTConfigProvider failed!!";
195  }
196 
197  // Parse the input paths to get them if there are in the table
198  // and associate them the last filter of the path (in order to extract the
199  _hltPaths.clear();
200  for (size_t i = 0; i < _hltPathsToCheck.size(); ++i) {
201  bool found = false;
202  TPRegexp pattern(_hltPathsToCheck[i]);
203  for (size_t j = 0; j < _hltConfig.triggerNames().size(); ++j) {
204  std::string thetriggername = _hltConfig.triggerNames()[j];
205  if (TString(thetriggername).Contains(pattern)) {
206  _hltPaths.insert(thetriggername);
207  found = true;
208  }
209  }
210  if (!found) {
211  LogDebug("HiggsValidations") << "HLTHiggsSubAnalysis::beginRun, In " << _analysisname
212  << " subfolder NOT found the path: '" << _hltPathsToCheck[i] << "*'";
213  }
214  }
215 
216  LogTrace("HiggsValidation") << "SubAnalysis: " << _analysisname << "\nHLT Trigger Paths found >>>";
217  // Initialize the plotters (analysers for each trigger path)
218  _analyzers.clear();
219  for (std::set<std::string>::iterator iPath = _hltPaths.begin(); iPath != _hltPaths.end(); ++iPath) {
220  // Avoiding the dependence of the version number for
221  // the trigger paths
222  const std::string& path = *iPath;
223  std::string shortpath = path;
224  if (path.rfind("_v") < path.length()) {
225  shortpath = path.substr(0, path.rfind("_v"));
226  }
227  _shortpath2long[shortpath] = path;
228 
229  // Objects needed by the HLT path
230  const std::vector<unsigned int> objsNeedHLT = this->getObjectsType(shortpath);
231  // Sanity check: the object needed by a trigger path should be
232  // introduced by the user via config python (_recLabels datamember)
233  std::vector<unsigned int> userInstantiate;
234  for (std::map<unsigned int, std::string>::iterator it = _recLabels.begin(); it != _recLabels.end(); ++it) {
235  userInstantiate.push_back(it->first);
236  }
237  for (std::vector<unsigned int>::const_iterator it = objsNeedHLT.begin(); it != objsNeedHLT.end(); ++it) {
238  if (std::find(userInstantiate.begin(), userInstantiate.end(), *it) == userInstantiate.end()) {
239  edm::LogError("HiggsValidation") << "In HLTHiggsSubAnalysis::beginRun, "
240  << "Incoherence found in the python configuration file!!\nThe SubAnalysis '"
241  << _analysisname << "' has been asked to evaluate the trigger path '"
242  << shortpath << "' (found it in 'hltPathsToCheck') BUT this path"
243  << " needs a '" << EVTColContainer::getTypeString(*it)
244  << "' which has not been instantiate ('recVariableLabels'"
245  << ")";
246  exit(-1);
247  }
248  }
249  LogTrace("HiggsValidation") << " --- " << shortpath;
250 
251  // the hlt path, the objects (elec,muons,photons,...)
252  // needed to evaluate the path are the argumens of the plotter
253  HLTHiggsPlotter analyzer(_pset, shortpath, objsNeedHLT, NptPlots, _NminOneCuts);
254  _analyzers.push_back(analyzer);
255  }
256 }
std::map< std::string, std::string > _shortpath2long
Relation between the short version of a path.
std::vector< double > _NminOneCuts
edm::ParameterSet _pset
std::set< std::string > _hltPaths
the hlt paths found in the hltConfig
Log< level::Error, false > LogError
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
HLTConfigProvider _hltConfig
#define LogTrace(id)
std::vector< HLTHiggsPlotter > _analyzers
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
const std::vector< std::string > & triggerNames() const
names of trigger paths
std::vector< std::string > _hltPathsToCheck
the hlt paths with regular expressions
std::map< unsigned int, std::string > _recLabels
const std::vector< unsigned int > getObjectsType(const std::string &hltpath) const
Extract what objects need this analysis.
static const std::string getTypeString(const unsigned int &objtype)
Tranform types into strings.
#define LogDebug(id)
def exit(msg="")

◆ bookHist()

void HLTHiggsSubAnalysis::bookHist ( const std::string &  source,
const std::string &  objType,
const std::string &  variable,
DQMStore::IBooker ibooker 
)
private

Definition at line 858 of file HLTHiggsSubAnalysis.cc.

References _elements, _parametersEta, _parametersPhi, _parametersTurnOn, dqm::implementation::IBooker::book1D(), submitPVResolutionJobs::desc, SelectiveReadoutTask_cfi::edges, EVTColContainer::getTypeString(), h, mps_fire::i, createfilelist::int, SiStripPI::max, SiStripPI::min, Skims_PA_cff::name, seedmultiplicitymonitor_newtracking_cfi::nBins, electrons_cff::objType, submitPVValidationJobs::params, EVTColContainer::PFJET, EVTColContainer::PFMET, source, AlCaHLTBitMon_QueryRunRegistry::string, runGCPTkAlMap::title, and taus_updatedMVAIds_cff::variable.

Referenced by bookHistograms().

861  {
862  std::string sourceUpper = source;
863  sourceUpper[0] = std::toupper(sourceUpper[0]);
865  TH1F* h = nullptr;
866 
867  if (variable.find("MaxPt") != std::string::npos) {
869  if (variable == "MaxPt1")
870  desc = "Leading";
871  else if (variable == "MaxPt2")
872  desc = "Next-to-Leading";
873  else
874  desc = variable.substr(5, 6) + "th Leading";
875  std::string title = "pT of " + desc + " " + sourceUpper + " " + objType;
876  const size_t nBinsStandard = _parametersTurnOn.size() - 1;
877  size_t nBins = nBinsStandard;
878  float* edges = new float[nBinsStandard + 1];
879  for (size_t i = 0; i < nBinsStandard + 1; i++) {
881  }
882 
884  if (objType == jetObj) {
885  const size_t nBinsJets = 25;
886  nBins = nBinsJets;
887  delete[] edges;
888  edges = new float[nBinsJets + 1];
889  for (size_t i = 0; i < nBinsJets + 1; i++) {
890  edges[i] = i * 10;
891  }
892  }
894  const size_t nBinsJets = 30;
895  nBins = nBinsJets;
896  delete[] edges;
897  edges = new float[nBinsJets + 1];
898  for (size_t i = 0; i < nBinsJets + 1; i++) {
899  edges[i] = i * 10;
900  }
901  }
902  h = new TH1F(name.c_str(), title.c_str(), nBins, edges);
903  delete[] edges;
904  } else if (variable == "dEtaqq") {
905  std::string title = "#Delta #eta_{qq} of " + sourceUpper + " " + objType;
906  int nBins = 20;
907  double min = 0;
908  double max = 4.8;
909  h = new TH1F(name.c_str(), title.c_str(), nBins, min, max);
910  } else if (variable == "mqq") {
911  std::string title = "m_{qq} of " + sourceUpper + " " + objType;
912  int nBins = 20;
913  double min = 0;
914  double max = 1000;
915  h = new TH1F(name.c_str(), title.c_str(), nBins, min, max);
916  } else if (variable == "dPhibb") {
917  std::string title = "#Delta #phi_{bb} of " + sourceUpper + " " + objType;
918  int nBins = 10;
919  double min = 0;
920  double max = 3.1416;
921  h = new TH1F(name.c_str(), title.c_str(), nBins, min, max);
922  } else if (variable == "CSV1") {
923  std::string title = "CSV1 of " + sourceUpper + " " + objType;
924  int nBins = 20;
925  double min = 0;
926  double max = 1;
927  h = new TH1F(name.c_str(), title.c_str(), nBins, min, max);
928  } else if (variable == "CSV2") {
929  std::string title = "CSV2 of " + sourceUpper + " " + objType;
930  int nBins = 20;
931  double min = 0;
932  double max = 1;
933  h = new TH1F(name.c_str(), title.c_str(), nBins, min, max);
934  } else if (variable == "CSV3") {
935  std::string title = "CSV3 of " + sourceUpper + " " + objType;
936  int nBins = 20;
937  double min = 0;
938  double max = 1;
939  h = new TH1F(name.c_str(), title.c_str(), nBins, min, max);
940  } else if (variable == "maxCSV") {
941  std::string title = "max CSV of " + sourceUpper + " " + objType;
942  int nBins = 20;
943  double min = 0;
944  double max = 1;
945  h = new TH1F(name.c_str(), title.c_str(), nBins, min, max);
946  } else {
947  std::string symbol = (variable == "Eta") ? "#eta" : "#phi";
948  std::string title = symbol + " of " + sourceUpper + " " + objType;
949  std::vector<double> params = (variable == "Eta") ? _parametersEta : _parametersPhi;
950 
951  int nBins = (int)params[0];
952  double min = params[1];
953  double max = params[2];
954  h = new TH1F(name.c_str(), title.c_str(), nBins, min, max);
955  }
956  h->Sumw2();
957  _elements[name] = ibooker.book1D(name, h);
958  delete h;
959 }
std::vector< double > _parametersTurnOn
std::map< std::string, MonitorElement * > _elements
std::vector< double > _parametersPhi
std::vector< double > _parametersEta
Some kinematical parameters.
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
static const std::string getTypeString(const unsigned int &objtype)
Tranform types into strings.
static std::string const source
Definition: EdmProvDump.cc:49

◆ bookHistograms()

void HLTHiggsSubAnalysis::bookHistograms ( DQMStore::IBooker ibooker)

Definition at line 258 of file HLTHiggsSubAnalysis.cc.

References _analysisname, _analyzers, _bookHtPlots, _elements, _histDirectory, _hltPathsToCheck, _NminOneCuts, _parametersHt, _parametersPu, _recLabels, _useNminOneCuts, ALCARECODTCalibSynchDQM_cff::baseDir, dqm::implementation::IBooker::book1D(), bookHist(), EVTColContainer::getTypeString(), mps_fire::i, createfilelist::int, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, dqmiolumiharvest::j, PV_cfg::maxPt, MTVHistoProducerAlgoForTrackerBlock_cfi::maxPu, HLT_2024v10_cff::minHt, MTVHistoProducerAlgoForTrackerBlock_cfi::minPu, NptPlots, castor_dqm_sourceclient_file_cfg::path, EVTColContainer::PFJET, dqm::implementation::NavigatorBase::setCurrentFolder(), source, CalibrationSummaryClient_cfi::sources, and AlCaHLTBitMon_QueryRunRegistry::string.

258  {
260  ibooker.setCurrentFolder(baseDir);
261  // Book the gen/reco analysis-dependent histograms (denominators)
262  std::vector<std::string> sources(2);
263  sources[0] = "gen";
264  sources[1] = "rec";
265 
266  for (std::map<unsigned int, std::string>::const_iterator it = _recLabels.begin(); it != _recLabels.end(); ++it) {
267  const std::string objStr = EVTColContainer::getTypeString(it->first);
268  TString maxPt;
269 
270  for (size_t i = 0; i < sources.size(); i++) {
272  if (_useNminOneCuts && it->first == EVTColContainer::PFJET) {
273  if (source == "gen")
274  continue;
275  else {
276  // N-1 jet plots (dEtaqq, mqq, dPhibb, CSV1, maxCSV_jets, maxCSV_E, PFMET, pt1, pt2, pt3, pt4)
277  if (_NminOneCuts[0])
278  bookHist(source, objStr, "dEtaqq", ibooker);
279  if (_NminOneCuts[1])
280  bookHist(source, objStr, "mqq", ibooker);
281  if (_NminOneCuts[2])
282  bookHist(source, objStr, "dPhibb", ibooker);
283  if (_NminOneCuts[3]) {
284  if (_NminOneCuts[6])
285  bookHist(source, objStr, "maxCSV", ibooker);
286  else
287  bookHist(source, objStr, "CSV1", ibooker);
288  }
289  if (_NminOneCuts[4])
290  bookHist(source, objStr, "CSV2", ibooker);
291  if (_NminOneCuts[5])
292  bookHist(source, objStr, "CSV3", ibooker);
293  }
294  }
295 
296  bookHist(source, objStr, "Eta", ibooker);
297  bookHist(source, objStr, "Phi", ibooker);
298  for (unsigned int i = 0; i < NptPlots; i++) {
299  maxPt = "MaxPt";
300  maxPt += i + 1;
301  bookHist(source, objStr, maxPt.Data(), ibooker);
302  }
303  }
304  }
305 
306  // Call the bookHistograms (which books all the path dependent histograms)
307  for (std::vector<HLTHiggsPlotter>::iterator it = _analyzers.begin(); it != _analyzers.end(); ++it) {
308  it->bookHistograms(ibooker, _useNminOneCuts);
309  }
310  //booking the histograms for overall trigger efficiencies
311  for (size_t i = 0; i < sources.size(); i++) {
312  std::string nameGlobalEfficiency = "SummaryPaths_" + _analysisname + "_" + sources[i];
313 
314  _elements[nameGlobalEfficiency] = ibooker.book1D(
315  nameGlobalEfficiency.c_str(), nameGlobalEfficiency.c_str(), _hltPathsToCheck.size(), 0, _hltPathsToCheck.size());
316 
317  std::string nameGlobalEfficiencyPassing = nameGlobalEfficiency + "_passingHLT";
318  _elements[nameGlobalEfficiencyPassing] = ibooker.book1D(nameGlobalEfficiencyPassing.c_str(),
319  nameGlobalEfficiencyPassing.c_str(),
320  _hltPathsToCheck.size(),
321  0,
322  _hltPathsToCheck.size());
323 
324  std::string titlePu = "nb of interations in the event";
325  std::string nameVtxPlot = "trueVtxDist_" + _analysisname + "_" + sources[i];
326  std::vector<double> paramsPu = _parametersPu;
327  int nBinsPu = (int)paramsPu[0];
328  double minPu = paramsPu[1];
329  double maxPu = paramsPu[2];
330 
331  std::string titleHt = "sum of jet pT in the event";
332  std::string nameHtPlot = "HtDist_" + _analysisname + "_" + sources[i];
333  std::vector<double> paramsHt = _parametersHt;
334  int nBinsHt = (int)paramsHt[0];
335  double minHt = paramsHt[1];
336  double maxHt = paramsHt[2];
337 
338  if ((!_useNminOneCuts) || sources[i] == "rec")
339  _elements[nameVtxPlot] = ibooker.book1D(nameVtxPlot.c_str(), titlePu.c_str(), nBinsPu, minPu, maxPu);
340  if (_bookHtPlots)
341  _elements[nameHtPlot] = ibooker.book1D(nameHtPlot.c_str(), titleHt.c_str(), nBinsHt, minHt, maxHt);
342  for (size_t j = 0; j < _hltPathsToCheck.size(); j++) {
343  //declare the efficiency vs interaction plots
345  std::string shortpath = path;
346  if (path.rfind("_v") < path.length()) {
347  shortpath = path.substr(0, path.rfind("_v"));
348  }
349  std::string titlePassingPu = "nb of interations in the event passing path " + shortpath;
350  if ((!_useNminOneCuts) || sources[i] == "rec")
351  _elements[nameVtxPlot + "_" + shortpath] =
352  ibooker.book1D(nameVtxPlot + "_" + shortpath, titlePassingPu.c_str(), nBinsPu, minPu, maxPu);
353 
354  std::string titlePassingHt = "sum of jet pT in the event passing path " + shortpath;
355  if (_bookHtPlots)
356  _elements[nameHtPlot + "_" + shortpath] =
357  ibooker.book1D(nameHtPlot + "_" + shortpath, titlePassingHt.c_str(), nBinsHt, minHt, maxHt);
358 
359  //fill the bin labels of the summary plot
360  _elements[nameGlobalEfficiency]->setBinLabel(j + 1, shortpath);
361  _elements[nameGlobalEfficiencyPassing]->setBinLabel(j + 1, shortpath);
362  }
363  }
364 }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
std::map< std::string, MonitorElement * > _elements
std::vector< double > _NminOneCuts
std::vector< double > _parametersPu
std::vector< HLTHiggsPlotter > _analyzers
void bookHist(const std::string &source, const std::string &objType, const std::string &variable, DQMStore::IBooker &)
std::vector< double > _parametersHt
maxPt
Definition: PV_cfg.py:224
std::vector< std::string > _hltPathsToCheck
the hlt paths with regular expressions
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
std::map< unsigned int, std::string > _recLabels
static const std::string getTypeString(const unsigned int &objtype)
Tranform types into strings.
static std::string const source
Definition: EdmProvDump.cc:49

◆ bookobjects()

void HLTHiggsSubAnalysis::bookobjects ( const edm::ParameterSet anpset,
edm::ConsumesCollector iC 
)
private

Definition at line 740 of file HLTHiggsSubAnalysis.cc.

References _analysisname, _genJetSelector, _genSelectorMap, _recLabels, _recLabelsCaloMET, _recLabelsElec, _recLabelsMuon, _recLabelsPFJet, _recLabelsPFMET, _recLabelsPFTau, _recLabelsPhoton, _recTagPFJet, EVTColContainer::CALOMET, edm::ConsumesCollector::consumes(), EVTColContainer::ELEC, edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), EVTColContainer::MUON, EVTColContainer::PFJET, EVTColContainer::PFMET, EVTColContainer::PFTAU, EVTColContainer::PHOTON, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by HLTHiggsSubAnalysis().

740  {
741  if (anpset.exists("recMuonLabel")) {
742  _recLabels[EVTColContainer::MUON] = anpset.getParameter<std::string>("recMuonLabel");
745  }
746  if (anpset.exists("recElecLabel")) {
747  _recLabels[EVTColContainer::ELEC] = anpset.getParameter<std::string>("recElecLabel");
750  }
751  if (anpset.exists("recPhotonLabel")) {
752  _recLabels[EVTColContainer::PHOTON] = anpset.getParameter<std::string>("recPhotonLabel");
755  }
756  if (anpset.exists("recCaloMETLabel")) {
757  _recLabels[EVTColContainer::CALOMET] = anpset.getParameter<std::string>("recCaloMETLabel");
760  }
761  if (anpset.exists("recPFMETLabel")) {
762  _recLabels[EVTColContainer::PFMET] = anpset.getParameter<std::string>("recPFMETLabel");
765  }
766  if (anpset.exists("recPFTauLabel")) {
767  _recLabels[EVTColContainer::PFTAU] = anpset.getParameter<std::string>("recPFTauLabel");
770  }
771  if (anpset.exists("recJetLabel")) {
772  _recLabels[EVTColContainer::PFJET] = anpset.getParameter<std::string>("recJetLabel");
774  if (anpset.exists("jetTagLabel"))
776  _genJetSelector = nullptr;
777  }
778  /*if( anpset.exists("recTrackLabel") )
779  {
780  _recLabels[EVTColContainer::TRACK] = anpset.getParameter<std::string>("recTrackLabel");
781  _genSelectorMap[EVTColContainer::TRACK] = 0 ;
782  }*/
783 
784  if (_recLabels.empty()) {
785  edm::LogError("HiggsValidation") << "HLTHiggsSubAnalysis::bookobjects, "
786  << "Not included any object (recMuonLabel, recElecLabel, ...) "
787  << "in the analysis " << _analysisname;
788  return;
789  }
790 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
std::vector< PFTau > PFTauCollection
collection of PFTau objects
Definition: PFTauFwd.h:9
edm::EDGetTokenT< reco::PFMETCollection > _recLabelsPFMET
edm::EDGetTokenT< reco::PFJetCollection > _recLabelsPFJet
edm::EDGetTokenT< reco::PFTauCollection > _recLabelsPFTau
bool exists(std::string const &parameterName) const
checks if a parameter exists
Log< level::Error, false > LogError
std::map< unsigned int, StringCutObjectSelector< reco::GenParticle > * > _genSelectorMap
edm::EDGetTokenT< reco::JetTagCollection > _recTagPFJet
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
std::vector< Muon > MuonCollection
collection of Muon objects
Definition: MuonFwd.h:9
edm::EDGetTokenT< reco::PhotonCollection > _recLabelsPhoton
edm::EDGetTokenT< reco::CaloMETCollection > _recLabelsCaloMET
StringCutObjectSelector< reco::GenJet > * _genJetSelector
std::vector< reco::CaloMET > CaloMETCollection
collection of CaloMET objects
edm::EDGetTokenT< reco::GsfElectronCollection > _recLabelsElec
std::vector< Photon > PhotonCollection
collectin of Photon objects
Definition: PhotonFwd.h:9
std::vector< PFJet > PFJetCollection
collection of PFJet objects
edm::EDGetTokenT< reco::MuonCollection > _recLabelsMuon
std::vector< reco::PFMET > PFMETCollection
collection of PFMET objects
std::map< unsigned int, std::string > _recLabels

◆ fillHist()

void HLTHiggsSubAnalysis::fillHist ( const std::string &  source,
const std::string &  objType,
const std::string &  variable,
const float &  value 
)
private

Definition at line 961 of file HLTHiggsSubAnalysis.cc.

References _elements, Skims_PA_cff::name, electrons_cff::objType, source, AlCaHLTBitMon_QueryRunRegistry::string, and taus_updatedMVAIds_cff::variable.

Referenced by analyze().

964  {
965  std::string sourceUpper = source;
966  sourceUpper[0] = toupper(sourceUpper[0]);
968 
969  _elements[name]->Fill(value);
970 }
std::map< std::string, MonitorElement * > _elements
Definition: value.py:1
static std::string const source
Definition: EdmProvDump.cc:49

◆ getObjectsType()

const std::vector< unsigned int > HLTHiggsSubAnalysis::getObjectsType ( const std::string &  hltpath) const

Extract what objects need this analysis.

Definition at line 698 of file HLTHiggsSubAnalysis.cc.

References EVTColContainer::CALOMET, EVTColContainer::ELEC, EVTColContainer::getTypeString(), TriggerAnalyzer::hltPath, mps_fire::i, EVTColContainer::MUON, EVTColContainer::PFJET, EVTColContainer::PFMET, EVTColContainer::PFTAU, EVTColContainer::PHOTON, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by beginRun().

698  {
699  static const unsigned int objSize = 7;
700  static const unsigned int objtriggernames[] = {EVTColContainer::MUON,
703  // EVTColContainer::TRACK, // Note is tracker muon
708 
709  std::set<unsigned int> objsType;
710  // The object to deal has to be entered via the config .py
711  for (unsigned int i = 0; i < objSize; ++i) {
712  std::string objTypeStr = EVTColContainer::getTypeString(objtriggernames[i]);
713  // Check if it is needed this object for this trigger
714  if (!TString(hltPath).Contains(objTypeStr)) {
715  if ((objtriggernames[i] == EVTColContainer::PFJET &&
716  TString(hltPath).Contains("WHbbBoost")) || // fix for HLT_Ele27_WPLoose_Gsf_WHbbBoost_v
717  (objtriggernames[i] == EVTColContainer::PFJET && TString(hltPath).Contains("CSV")) || // fix for ZnnHbb PFJET
718  (objtriggernames[i] == EVTColContainer::PFMET && TString(hltPath).Contains("MHT")) || // fix for ZnnHbb PFMET
719  (objtriggernames[i] == EVTColContainer::PHOTON && TString(hltPath).Contains("Diphoton"))) {
720  objsType.insert(objtriggernames[i]); //case of the New Diphoton paths
721  }
722  continue;
723  }
724  if ((objtriggernames[i] == EVTColContainer::CALOMET &&
725  (TString(hltPath).Contains("PFMET") || TString(hltPath).Contains("MHT"))) || // fix for PFMET
726  (objtriggernames[i] == EVTColContainer::PFJET && TString(hltPath).Contains("JetIdCleaned") &&
727  !TString(hltPath).Contains(TRegexp("Jet[^I]"))) || // fix for Htaunu
728  (objtriggernames[i] == EVTColContainer::MUON && TString(hltPath).Contains("METNoMu"))) // fix for VBFHToInv
729  {
730  continue;
731  }
732 
733  objsType.insert(objtriggernames[i]);
734  }
735 
736  return std::vector<unsigned int>(objsType.begin(), objsType.end());
737 }
static const std::string getTypeString(const unsigned int &objtype)
Tranform types into strings.

◆ initAndInsertJets()

void HLTHiggsSubAnalysis::initAndInsertJets ( const edm::Event iEvent,
EVTColContainer cols,
std::vector< MatchStruct > *  matches 
)
private

Definition at line 999 of file HLTHiggsSubAnalysis.cc.

References _recLabelsPFJet, _recPFJetSelector, _recTagPFJet, _useNminOneCuts, TtFullHadHypKinFit_cfi::bTag, iEvent, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, oniaPATMuonsWithTrigger_cff::matches, EVTColContainer::PFJET, edm::Handle< T >::product(), and EVTColContainer::set().

Referenced by analyze().

1001  {
1003  iEvent.getByToken(_recLabelsPFJet, PFJetHandle);
1004  cols->set(PFJetHandle.product());
1005 
1007  if (_useNminOneCuts) {
1008  iEvent.getByToken(_recTagPFJet, JetTagHandle);
1009  }
1010 
1011  for (reco::PFJetCollection::const_iterator it = PFJetHandle->begin(); it != PFJetHandle->end(); ++it) {
1012  reco::PFJetRef jetRef(PFJetHandle, it - PFJetHandle->begin());
1013  reco::JetBaseRef jetBaseRef(jetRef);
1014 
1015  if (_recPFJetSelector->operator()(*it)) {
1016  if (_useNminOneCuts) {
1017  float bTag = (*(JetTagHandle.product()))[jetBaseRef];
1019  } else {
1020  matches->push_back(MatchStruct(&*it, EVTColContainer::PFJET));
1021  }
1022  }
1023  }
1024 }
edm::EDGetTokenT< reco::PFJetCollection > _recLabelsPFJet
T const * product() const
Definition: Handle.h:70
edm::EDGetTokenT< reco::JetTagCollection > _recTagPFJet
void set(const reco::MuonCollection *v)
Setter: multiple overloaded function.
int iEvent
Definition: GenABIO.cc:224
StringCutObjectSelector< reco::PFJet > * _recPFJetSelector

◆ initobjects()

void HLTHiggsSubAnalysis::initobjects ( const edm::Event iEvent,
EVTColContainer col 
)
private

Definition at line 792 of file HLTHiggsSubAnalysis.cc.

References _genJetLabel, _genParticleLabel, _recLabels, _recLabelsCaloMET, _recLabelsElec, _recLabelsMuon, _recLabelsPFMET, _recLabelsPFTau, _recLabelsPhoton, _trigResultsTag, _useNminOneCuts, EVTColContainer::CALOMET, cuy::col, EVTColContainer::ELEC, iEvent, edm::HandleBase::isValid(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, EVTColContainer::MUON, EVTColContainer::PFJET, EVTColContainer::PFMET, EVTColContainer::PFTAU, EVTColContainer::PHOTON, and edm::Handle< T >::product().

Referenced by analyze().

792  {
793  /*if( col != 0 && col->isAllInit() )
794  {
795  // Already init, not needed to do nothing
796  return;
797  }*/
798  if (!col->isCommonInit()) {
799  // extract the trigger results (path info, pass,...)
801  iEvent.getByToken(_trigResultsTag, trigResults);
802  if (trigResults.isValid()) {
803  col->triggerResults = trigResults.product();
804  }
805 
806  // GenParticle collection if is there (genJets only if there need to be jets)
808  iEvent.getByToken(_genParticleLabel, genPart);
809  if (genPart.isValid()) {
810  col->genParticles = genPart.product();
811  }
812  }
813 
814  for (std::map<unsigned int, std::string>::iterator it = _recLabels.begin(); it != _recLabels.end(); ++it) {
815  if (it->first == EVTColContainer::MUON) {
817  iEvent.getByToken(_recLabelsMuon, theHandle);
818  col->set(theHandle.product());
819  } else if (it->first == EVTColContainer::ELEC) {
821  iEvent.getByToken(_recLabelsElec, theHandle);
822  col->set(theHandle.product());
823  } else if (it->first == EVTColContainer::PHOTON) {
825  iEvent.getByToken(_recLabelsPhoton, theHandle);
826  col->set(theHandle.product());
827  } else if (it->first == EVTColContainer::CALOMET) {
829  iEvent.getByToken(_recLabelsCaloMET, theHandle);
830  col->set(theHandle.product());
831  } else if (it->first == EVTColContainer::PFMET) {
833  iEvent.getByToken(_recLabelsPFMET, theHandle);
834  col->set(theHandle.product());
835  } else if (it->first == EVTColContainer::PFTAU) {
837  iEvent.getByToken(_recLabelsPFTau, theHandle);
838  col->set(theHandle.product());
839  }
840  // PFJets loaded in seperate function initAndInsertJets because they need to be combined with the btags using the Handle (not the product) and for ordering them seperately in the MatchStruct's
841  else if (it->first == EVTColContainer::PFJET) {
842  if (!_useNminOneCuts) {
843  // GenJet collection
845  iEvent.getByToken(_genJetLabel, genJet);
846  if (genJet.isValid()) {
847  col->genJets = genJet.product();
848  }
849  }
850  } else {
851  edm::LogError("HiggsValidation") << "HLTHiggsSubAnalysis::initobjects "
852  << " NOT IMPLEMENTED (yet) ERROR: '" << it->second << "'";
853  //return; ??
854  }
855  }
856 }
edm::EDGetTokenT< reco::PFMETCollection > _recLabelsPFMET
edm::EDGetTokenT< reco::GenParticleCollection > _genParticleLabel
edm::EDGetTokenT< reco::PFTauCollection > _recLabelsPFTau
T const * product() const
Definition: Handle.h:70
Log< level::Error, false > LogError
edm::EDGetTokenT< reco::GenJetCollection > _genJetLabel
edm::EDGetTokenT< reco::PhotonCollection > _recLabelsPhoton
edm::EDGetTokenT< reco::CaloMETCollection > _recLabelsCaloMET
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< edm::TriggerResults > _trigResultsTag
edm::EDGetTokenT< reco::GsfElectronCollection > _recLabelsElec
bool isValid() const
Definition: HandleBase.h:70
edm::EDGetTokenT< reco::MuonCollection > _recLabelsMuon
col
Definition: cuy.py:1009
std::map< unsigned int, std::string > _recLabels

◆ InitSelector()

void HLTHiggsSubAnalysis::InitSelector ( const unsigned int &  objtype)
private

Definition at line 973 of file HLTHiggsSubAnalysis.cc.

References _recCaloMETSelector, _recCut, _recElecSelector, _recMuonSelector, _recPFJetSelector, _recPFMETSelector, _recPFTauSelector, _recPhotonSelector, EVTColContainer::CALOMET, EVTColContainer::ELEC, EVTColContainer::MUON, EVTColContainer::PFJET, EVTColContainer::PFMET, EVTColContainer::PFTAU, and EVTColContainer::PHOTON.

Referenced by analyze().

973  {
974  if (objtype == EVTColContainer::MUON && _recMuonSelector == nullptr) {
976  } else if (objtype == EVTColContainer::ELEC && _recElecSelector == nullptr) {
978  } else if (objtype == EVTColContainer::PHOTON && _recPhotonSelector == nullptr) {
980  } else if (objtype == EVTColContainer::CALOMET && _recCaloMETSelector == nullptr) {
982  } else if (objtype == EVTColContainer::PFMET && _recPFMETSelector == nullptr) {
984  } else if (objtype == EVTColContainer::PFTAU && _recPFTauSelector == nullptr) {
986  } else if (objtype == EVTColContainer::PFJET && _recPFJetSelector == nullptr) {
988  }
989  /*else if( objtype == EVTColContainer::TRACK && _recTrackSelector == 0)
990  {
991  _recTrackSelector = new StringCutObjectSelector<reco::Track>(_recCut[objtype]);
992  }*/
993  /* else
994  {
995 FIXME: ERROR NO IMPLEMENTADO
996  }*/
997 }
StringCutObjectSelector< reco::CaloMET > * _recCaloMETSelector
StringCutObjectSelector< reco::PFMET > * _recPFMETSelector
std::map< unsigned int, std::string > _recCut
StringCutObjectSelector< reco::PFTau > * _recPFTauSelector
StringCutObjectSelector< reco::Muon > * _recMuonSelector
StringCutObjectSelector< reco::Photon > * _recPhotonSelector
StringCutObjectSelector< reco::PFJet > * _recPFJetSelector
StringCutObjectSelector< reco::GsfElectron > * _recElecSelector

◆ insertcandidates()

void HLTHiggsSubAnalysis::insertcandidates ( const unsigned int &  objtype,
const EVTColContainer col,
std::vector< MatchStruct > *  matches 
)
private

Definition at line 1141 of file HLTHiggsSubAnalysis.cc.

References _recCaloMETSelector, _recElecSelector, _recMuonSelector, _recPFMETSelector, _recPFTauSelector, _recPhotonSelector, EVTColContainer::CALOMET, EVTColContainer::caloMETs, EVTColContainer::ELEC, EVTColContainer::electrons, mps_fire::i, oniaPATMuonsWithTrigger_cff::matches, EVTColContainer::MUON, EVTColContainer::muons, electrons_cff::objType, EVTColContainer::PFMET, EVTColContainer::pfMETs, EVTColContainer::PFTAU, EVTColContainer::pfTaus, EVTColContainer::PHOTON, and EVTColContainer::photons.

Referenced by analyze().

1143  {
1144  if (objType == EVTColContainer::MUON) {
1145  for (size_t i = 0; i < cols->muons->size(); i++) {
1146  if (_recMuonSelector->operator()(cols->muons->at(i))) {
1147  matches->push_back(MatchStruct(&cols->muons->at(i), objType));
1148  }
1149  }
1150  } else if (objType == EVTColContainer::ELEC) {
1151  for (size_t i = 0; i < cols->electrons->size(); i++) {
1152  if (_recElecSelector->operator()(cols->electrons->at(i))) {
1153  matches->push_back(MatchStruct(&cols->electrons->at(i), objType));
1154  }
1155  }
1156  } else if (objType == EVTColContainer::PHOTON) {
1157  for (size_t i = 0; i < cols->photons->size(); i++) {
1158  if (_recPhotonSelector->operator()(cols->photons->at(i))) {
1159  matches->push_back(MatchStruct(&cols->photons->at(i), objType));
1160  }
1161  }
1162  } else if (objType == EVTColContainer::CALOMET) {
1163  for (size_t i = 0; i < cols->caloMETs->size(); i++) {
1164  if (_recCaloMETSelector->operator()(cols->caloMETs->at(i))) {
1165  matches->push_back(MatchStruct(&cols->caloMETs->at(i), objType));
1166  }
1167  }
1168  } else if (objType == EVTColContainer::PFMET) {
1169  for (size_t i = 0; i < cols->pfMETs->size(); i++) {
1170  if (_recPFMETSelector->operator()(cols->pfMETs->at(i))) {
1171  matches->push_back(MatchStruct(&cols->pfMETs->at(i), objType));
1172  }
1173  }
1174  } else if (objType == EVTColContainer::PFTAU) {
1175  for (size_t i = 0; i < cols->pfTaus->size(); i++) {
1176  if (_recPFTauSelector->operator()(cols->pfTaus->at(i))) {
1177  matches->push_back(MatchStruct(&cols->pfTaus->at(i), objType));
1178  }
1179  }
1180  }
1181  // else if( objType == EVTColContainer::PFJET )
1182  // {
1183  // already inserted
1184  // }
1185  /*else if( objType == EVTColContainer::TRACK )
1186  {
1187  for(size_t i = 0; i < cols->tracks->size(); i++)
1188  {
1189  if(_recTrackSelector->operator()(cols->tracks->at(i)))
1190  {
1191  matches->push_back(MatchStruct(&cols->tracks->at(i),objType));
1192  }
1193  }
1194  }*/
1195  /*
1196  else FIXME: Control errores
1197  {
1198  }
1199  */
1200 }
StringCutObjectSelector< reco::CaloMET > * _recCaloMETSelector
StringCutObjectSelector< reco::PFMET > * _recPFMETSelector
StringCutObjectSelector< reco::PFTau > * _recPFTauSelector
StringCutObjectSelector< reco::Muon > * _recMuonSelector
StringCutObjectSelector< reco::Photon > * _recPhotonSelector
StringCutObjectSelector< reco::GsfElectron > * _recElecSelector

◆ passJetCuts()

void HLTHiggsSubAnalysis::passJetCuts ( std::vector< MatchStruct > *  matches,
std::map< std::string, bool > &  jetCutResult,
float &  dEtaqq,
float &  mqq,
float &  dPhibb,
float &  CSV1,
float &  CSV2,
float &  CSV3 
)
private

Definition at line 1026 of file HLTHiggsSubAnalysis.cc.

References _NminOneCuts, PVValHelper::eta, mps_fire::i, createfilelist::int, oniaPATMuonsWithTrigger_cff::matches, PV_cfg::maxPt, ECF_cff::Njets, NptPlots, phi, jetUpdater_cfi::sort, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by analyze().

1034  { //dEtaqq, mqq, dPhibb, CSV1, CSV2, CSV3, maxCSV_jets, maxCSV_E, PFMET, pt1, pt2, pt3, pt4
1035 
1036  // Perform pt cuts
1037  std::sort(matches->begin(), matches->end(), matchesByDescendingPt());
1038  TString maxPt;
1039  for (unsigned int i = 0; i < NptPlots; i++) {
1040  maxPt = "MaxPt";
1041  maxPt += i + 1;
1042  if ((*matches)[i].pt > _NminOneCuts[9 + i])
1043  jetCutResult[maxPt.Data()] = true;
1044  else
1045  jetCutResult[maxPt.Data()] = false;
1046  }
1047 
1048  unsigned int NbTag = ((_NminOneCuts[0] || _NminOneCuts[1]) ? 4 : 8);
1049  if (matches->size() < NbTag)
1050  NbTag = matches->size();
1051  // Perform b-tag ordered cuts
1052  std::sort(matches->begin(), matches->begin() + NbTag, matchesByDescendingBtag());
1053 
1054  if (_NminOneCuts[0]) {
1055  jetCutResult["dEtaqq"] = false;
1056  if (matches->size() > 2) {
1057  dEtaqq = fabs((*matches)[2].eta - (*matches)[3].eta);
1058  if (dEtaqq > _NminOneCuts[0])
1059  jetCutResult["dEtaqq"] = true;
1060  }
1061  }
1062 
1063  if (_NminOneCuts[1]) {
1064  jetCutResult["mqq"] = false;
1065  if (matches->size() > 2) {
1066  mqq = ((*matches)[2].lorentzVector + (*matches)[3].lorentzVector).M();
1067  if (mqq > _NminOneCuts[1])
1068  jetCutResult["mqq"] = true;
1069  }
1070  }
1071 
1072  if (_NminOneCuts[2]) {
1073  jetCutResult["dPhibb"] = false;
1074  if (matches->size() > 1) {
1075  dPhibb = fmod(fabs((*matches)[0].phi - (*matches)[1].phi), 3.1416);
1076  if (dPhibb < _NminOneCuts[2])
1077  jetCutResult["dPhibb"] = true;
1078  }
1079  }
1080 
1081  if (_NminOneCuts[4]) {
1082  std::string nameCSV2plot = "CSV2";
1083  jetCutResult[nameCSV2plot] = false;
1084  if (matches->size() > 1) {
1085  CSV2 = (*matches)[1].bTag;
1086  if (CSV2 > _NminOneCuts[4])
1087  jetCutResult[nameCSV2plot] = true;
1088  }
1089  }
1090 
1091  if (_NminOneCuts[5]) {
1092  std::string nameCSV3plot = "CSV3";
1093  jetCutResult[nameCSV3plot] = false;
1094  if (matches->size() > 2) {
1095  CSV3 = (*matches)[2].bTag;
1096  if (CSV3 > _NminOneCuts[5])
1097  jetCutResult[nameCSV3plot] = true;
1098  }
1099  }
1100 
1101  if (_NminOneCuts[3]) {
1102  CSV1 = (*matches)[0].bTag;
1103  std::string nameCSVplot = "CSV1";
1104  if (_NminOneCuts[6])
1105  nameCSVplot = "maxCSV";
1106 
1107  if (CSV1 > _NminOneCuts[3])
1108  jetCutResult[nameCSVplot] = true;
1109  else
1110  jetCutResult[nameCSVplot] = false;
1111 
1112  // max(CSV)
1113  if (_NminOneCuts[6]) {
1114  std::sort(matches->begin(), matches->end(), matchesByDescendingPt());
1115  CSV1 = (*matches)[0].bTag;
1116  unsigned int Njets = (unsigned int)_NminOneCuts[6];
1117  if (_NminOneCuts[6] > matches->size())
1118  Njets = matches->size();
1119  for (unsigned int i = 1; i < (unsigned int)Njets; ++i) {
1120  if ((*matches)[i].bTag > CSV1 && (*matches)[i].pt > _NminOneCuts[7])
1121  CSV1 = (*matches)[i].bTag;
1122  }
1123  }
1124  }
1125 }
std::vector< double > _NminOneCuts
maxPt
Definition: PV_cfg.py:224
Helper structure to order MatchStruct.
Definition: MatchStruct.h:58

◆ passOtherCuts()

void HLTHiggsSubAnalysis::passOtherCuts ( const std::vector< MatchStruct > &  matches,
std::map< std::string, bool > &  jetCutResult 
)
private

Definition at line 1127 of file HLTHiggsSubAnalysis.cc.

References _NminOneCuts, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, oniaPATMuonsWithTrigger_cff::matches, and EVTColContainer::PFMET.

Referenced by analyze().

1128  {
1129  if (_NminOneCuts[8]) {
1130  jetCutResult["PFMET"] = false;
1131  for (std::vector<MatchStruct>::const_iterator it = matches.begin(); it != matches.end(); ++it) {
1132  if (it->objType == EVTColContainer::PFMET) {
1133  if (it->pt > _NminOneCuts[8])
1134  jetCutResult["PFMET"] = true;
1135  break;
1136  }
1137  }
1138  }
1139 }
std::vector< double > _NminOneCuts

Member Data Documentation

◆ _analysisname

std::string HLTHiggsSubAnalysis::_analysisname
private

◆ _analyzers

std::vector<HLTHiggsPlotter> HLTHiggsSubAnalysis::_analyzers
private

Definition at line 169 of file HLTHiggsSubAnalysis.h.

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

◆ _bookHtPlots

bool HLTHiggsSubAnalysis::_bookHtPlots
private

Definition at line 104 of file HLTHiggsSubAnalysis.h.

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

◆ _cutMaxEta

std::map<unsigned int, double> HLTHiggsSubAnalysis::_cutMaxEta
private

Definition at line 143 of file HLTHiggsSubAnalysis.h.

Referenced by HLTHiggsSubAnalysis().

◆ _cutMinPt

std::map<unsigned int, double> HLTHiggsSubAnalysis::_cutMinPt
private

Definition at line 142 of file HLTHiggsSubAnalysis.h.

Referenced by HLTHiggsSubAnalysis().

◆ _cutMotherId

std::map<unsigned int, unsigned int> HLTHiggsSubAnalysis::_cutMotherId
private

Definition at line 144 of file HLTHiggsSubAnalysis.h.

◆ _cutsDr

std::map<unsigned int, std::vector<double> > HLTHiggsSubAnalysis::_cutsDr
private

Definition at line 145 of file HLTHiggsSubAnalysis.h.

◆ _elements

std::map<std::string, MonitorElement *> HLTHiggsSubAnalysis::_elements
private

Definition at line 172 of file HLTHiggsSubAnalysis.h.

Referenced by analyze(), bookHist(), bookHistograms(), and fillHist().

◆ _genCut

std::map<unsigned int, std::string> HLTHiggsSubAnalysis::_genCut
private

gen/rec objects cuts

Definition at line 147 of file HLTHiggsSubAnalysis.h.

Referenced by analyze(), and HLTHiggsSubAnalysis().

◆ _genJetLabel

edm::EDGetTokenT<reco::GenJetCollection> HLTHiggsSubAnalysis::_genJetLabel
private

Definition at line 120 of file HLTHiggsSubAnalysis.h.

Referenced by analyze(), and initobjects().

◆ _genJetSelector

StringCutObjectSelector<reco::GenJet>* HLTHiggsSubAnalysis::_genJetSelector
private

Definition at line 153 of file HLTHiggsSubAnalysis.h.

Referenced by analyze(), bookobjects(), and ~HLTHiggsSubAnalysis().

◆ _genParticleLabel

edm::EDGetTokenT<reco::GenParticleCollection> HLTHiggsSubAnalysis::_genParticleLabel
private

Definition at line 119 of file HLTHiggsSubAnalysis.h.

Referenced by initobjects().

◆ _genSelectorMap

std::map<unsigned int, StringCutObjectSelector<reco::GenParticle> *> HLTHiggsSubAnalysis::_genSelectorMap
private

The concrete String selectors (use the string cuts introduced via the config python)

Definition at line 152 of file HLTHiggsSubAnalysis.h.

Referenced by analyze(), bookobjects(), and ~HLTHiggsSubAnalysis().

◆ _histDirectory

std::string HLTHiggsSubAnalysis::_histDirectory
private

Definition at line 107 of file HLTHiggsSubAnalysis.h.

Referenced by bookHistograms().

◆ _hltConfig

HLTConfigProvider HLTHiggsSubAnalysis::_hltConfig
private

Definition at line 171 of file HLTHiggsSubAnalysis.h.

Referenced by beginRun().

◆ _hltPaths

std::set<std::string> HLTHiggsSubAnalysis::_hltPaths
private

the hlt paths found in the hltConfig

Definition at line 112 of file HLTHiggsSubAnalysis.h.

Referenced by beginRun().

◆ _hltPathsToCheck

std::vector<std::string> HLTHiggsSubAnalysis::_hltPathsToCheck
private

the hlt paths with regular expressions

Definition at line 110 of file HLTHiggsSubAnalysis.h.

Referenced by analyze(), beginRun(), bookHistograms(), and HLTHiggsSubAnalysis().

◆ _hltProcessName

std::string HLTHiggsSubAnalysis::_hltProcessName
private

Definition at line 106 of file HLTHiggsSubAnalysis.h.

Referenced by beginRun().

◆ _HtJetEtaMax

double HLTHiggsSubAnalysis::_HtJetEtaMax
private

Definition at line 102 of file HLTHiggsSubAnalysis.h.

Referenced by analyze(), and HLTHiggsSubAnalysis().

◆ _HtJetPtMin

double HLTHiggsSubAnalysis::_HtJetPtMin
private

Definition at line 101 of file HLTHiggsSubAnalysis.h.

Referenced by analyze(), and HLTHiggsSubAnalysis().

◆ _minCandidates

unsigned int HLTHiggsSubAnalysis::_minCandidates
private

The minimum number of reco/gen candidates needed by the analysis.

Definition at line 99 of file HLTHiggsSubAnalysis.h.

Referenced by analyze(), and HLTHiggsSubAnalysis().

◆ _NminOneCuts

std::vector<double> HLTHiggsSubAnalysis::_NminOneCuts
private

◆ _parametersEta

std::vector<double> HLTHiggsSubAnalysis::_parametersEta
private

Some kinematical parameters.

Definition at line 135 of file HLTHiggsSubAnalysis.h.

Referenced by bookHist().

◆ _parametersHt

std::vector<double> HLTHiggsSubAnalysis::_parametersHt
private

Definition at line 138 of file HLTHiggsSubAnalysis.h.

Referenced by bookHistograms(), and HLTHiggsSubAnalysis().

◆ _parametersPhi

std::vector<double> HLTHiggsSubAnalysis::_parametersPhi
private

Definition at line 136 of file HLTHiggsSubAnalysis.h.

Referenced by bookHist().

◆ _parametersPu

std::vector<double> HLTHiggsSubAnalysis::_parametersPu
private

Definition at line 137 of file HLTHiggsSubAnalysis.h.

Referenced by bookHistograms().

◆ _parametersTurnOn

std::vector<double> HLTHiggsSubAnalysis::_parametersTurnOn
private

Definition at line 139 of file HLTHiggsSubAnalysis.h.

Referenced by bookHist(), and HLTHiggsSubAnalysis().

◆ _pset

edm::ParameterSet HLTHiggsSubAnalysis::_pset
private

Definition at line 94 of file HLTHiggsSubAnalysis.h.

Referenced by beginRun(), and HLTHiggsSubAnalysis().

◆ _puSummaryInfo

edm::EDGetTokenT<std::vector<PileupSummaryInfo> > HLTHiggsSubAnalysis::_puSummaryInfo
private

Definition at line 132 of file HLTHiggsSubAnalysis.h.

Referenced by analyze(), and HLTHiggsSubAnalysis().

◆ _recCaloMETSelector

StringCutObjectSelector<reco::CaloMET>* HLTHiggsSubAnalysis::_recCaloMETSelector
private

Definition at line 156 of file HLTHiggsSubAnalysis.h.

Referenced by InitSelector(), insertcandidates(), and ~HLTHiggsSubAnalysis().

◆ _recCut

std::map<unsigned int, std::string> HLTHiggsSubAnalysis::_recCut
private

Definition at line 148 of file HLTHiggsSubAnalysis.h.

Referenced by HLTHiggsSubAnalysis(), and InitSelector().

◆ _recElecSelector

StringCutObjectSelector<reco::GsfElectron>* HLTHiggsSubAnalysis::_recElecSelector
private

Definition at line 155 of file HLTHiggsSubAnalysis.h.

Referenced by InitSelector(), insertcandidates(), and ~HLTHiggsSubAnalysis().

◆ _recLabels

std::map<unsigned int, std::string> HLTHiggsSubAnalysis::_recLabels
private

◆ _recLabelsCaloMET

edm::EDGetTokenT<reco::CaloMETCollection> HLTHiggsSubAnalysis::_recLabelsCaloMET
private

Definition at line 127 of file HLTHiggsSubAnalysis.h.

Referenced by bookobjects(), and initobjects().

◆ _recLabelsElec

edm::EDGetTokenT<reco::GsfElectronCollection> HLTHiggsSubAnalysis::_recLabelsElec
private

Definition at line 125 of file HLTHiggsSubAnalysis.h.

Referenced by bookobjects(), and initobjects().

◆ _recLabelsMuon

edm::EDGetTokenT<reco::MuonCollection> HLTHiggsSubAnalysis::_recLabelsMuon
private

Definition at line 124 of file HLTHiggsSubAnalysis.h.

Referenced by bookobjects(), and initobjects().

◆ _recLabelsPFJet

edm::EDGetTokenT<reco::PFJetCollection> HLTHiggsSubAnalysis::_recLabelsPFJet
private

Definition at line 130 of file HLTHiggsSubAnalysis.h.

Referenced by bookobjects(), and initAndInsertJets().

◆ _recLabelsPFMET

edm::EDGetTokenT<reco::PFMETCollection> HLTHiggsSubAnalysis::_recLabelsPFMET
private

Definition at line 128 of file HLTHiggsSubAnalysis.h.

Referenced by bookobjects(), and initobjects().

◆ _recLabelsPFTau

edm::EDGetTokenT<reco::PFTauCollection> HLTHiggsSubAnalysis::_recLabelsPFTau
private

Definition at line 129 of file HLTHiggsSubAnalysis.h.

Referenced by bookobjects(), and initobjects().

◆ _recLabelsPhoton

edm::EDGetTokenT<reco::PhotonCollection> HLTHiggsSubAnalysis::_recLabelsPhoton
private

Definition at line 126 of file HLTHiggsSubAnalysis.h.

Referenced by bookobjects(), and initobjects().

◆ _recMuonSelector

StringCutObjectSelector<reco::Muon>* HLTHiggsSubAnalysis::_recMuonSelector
private

Definition at line 154 of file HLTHiggsSubAnalysis.h.

Referenced by InitSelector(), insertcandidates(), and ~HLTHiggsSubAnalysis().

◆ _recoHtJetLabel

edm::EDGetTokenT<reco::PFJetCollection> HLTHiggsSubAnalysis::_recoHtJetLabel
private

Definition at line 121 of file HLTHiggsSubAnalysis.h.

Referenced by analyze().

◆ _recPFJetSelector

StringCutObjectSelector<reco::PFJet>* HLTHiggsSubAnalysis::_recPFJetSelector
private

Definition at line 160 of file HLTHiggsSubAnalysis.h.

Referenced by initAndInsertJets(), InitSelector(), and ~HLTHiggsSubAnalysis().

◆ _recPFMETSelector

StringCutObjectSelector<reco::PFMET>* HLTHiggsSubAnalysis::_recPFMETSelector
private

Definition at line 157 of file HLTHiggsSubAnalysis.h.

Referenced by InitSelector(), insertcandidates(), and ~HLTHiggsSubAnalysis().

◆ _recPFTauSelector

StringCutObjectSelector<reco::PFTau>* HLTHiggsSubAnalysis::_recPFTauSelector
private

Definition at line 158 of file HLTHiggsSubAnalysis.h.

Referenced by InitSelector(), insertcandidates(), and ~HLTHiggsSubAnalysis().

◆ _recPhotonSelector

StringCutObjectSelector<reco::Photon>* HLTHiggsSubAnalysis::_recPhotonSelector
private

Definition at line 159 of file HLTHiggsSubAnalysis.h.

Referenced by InitSelector(), insertcandidates(), and ~HLTHiggsSubAnalysis().

◆ _recTagPFJet

edm::EDGetTokenT<reco::JetTagCollection> HLTHiggsSubAnalysis::_recTagPFJet
private

Definition at line 131 of file HLTHiggsSubAnalysis.h.

Referenced by bookobjects(), and initAndInsertJets().

◆ _recTrackSelector

StringCutObjectSelector<reco::Track>* HLTHiggsSubAnalysis::_recTrackSelector
private

Definition at line 161 of file HLTHiggsSubAnalysis.h.

Referenced by ~HLTHiggsSubAnalysis().

◆ _shortpath2long

std::map<std::string, std::string> HLTHiggsSubAnalysis::_shortpath2long
private

Relation between the short version of a path.

Definition at line 115 of file HLTHiggsSubAnalysis.h.

Referenced by analyze(), and beginRun().

◆ _trigResultsTag

edm::EDGetTokenT<edm::TriggerResults> HLTHiggsSubAnalysis::_trigResultsTag
private

Definition at line 140 of file HLTHiggsSubAnalysis.h.

Referenced by initobjects().

◆ _useNminOneCuts

bool HLTHiggsSubAnalysis::_useNminOneCuts
private

◆ NptPlots

unsigned int HLTHiggsSubAnalysis::NptPlots
private