CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 }
 

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 61 of file HLTHiggsSubAnalysis.h.

Member Enumeration Documentation

anonymous enum
Enumerator
GEN 
RECO 

Definition at line 64 of file HLTHiggsSubAnalysis.h.

Constructor & Destructor Documentation

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

Definition at line 31 of file HLTHiggsSubAnalysis.cc.

References _analysisname, _bookHtPlots, _cutMaxEta, _cutMinPt, _genCut, _hltPathsToCheck, _HtJetEtaMax, _HtJetPtMin, _minCandidates, _NminOneCuts, _parametersHt, _puSummaryInfo, _recCut, _recLabels, _useNminOneCuts, bookobjects(), edm::ParameterSet::exists(), edm::ParameterSet::existsAs(), cmsRelvalreport::exit, edm::ParameterSet::getParameter(), EVTColContainer::getTypeString(), edm::ParameterSet::getUntrackedParameter(), NptPlots, and AlCaHLTBitMon_QueryRunRegistry::string.

33  :
34  _pset(pset),
35  _analysisname(analysisname),
36  _minCandidates(0),
37  _HtJetPtMin(0),
38  _HtJetEtaMax(0),
39  _hltProcessName(pset.getParameter<std::string>("hltProcessName")),
40  _histDirectory(pset.getParameter<std::string>("histDirectory")),
43  _recoHtJetLabel(iC.consumes<reco::PFJetCollection>(pset.getUntrackedParameter<std::string>("recoHtJetLabel","ak4PFJetsCHS"))),
44  _parametersEta(pset.getParameter<std::vector<double> >("parametersEta")),
45  _parametersPhi(pset.getParameter<std::vector<double> >("parametersPhi")),
46  _parametersPu(pset.getParameter<std::vector<double> >("parametersPu")),
47  _parametersHt(0),
48  _parametersTurnOn(pset.getParameter<std::vector<double> >("parametersTurnOn")),
50  _genJetSelector(0),
59  _NminOneCuts(0),
61 {
62  // Specific parameters for this analysis
63  edm::ParameterSet anpset = pset.getParameter<edm::ParameterSet>(analysisname);
64  // Collections labels (but genparticles already initialized)
65  // initializing _recLabels data member)
66  this->bookobjects( anpset, iC );
67  // Generic objects: Initialization of cuts
68  for(std::map<unsigned int,std::string>::const_iterator it = _recLabels.begin();
69  it != _recLabels.end(); ++it)
70  {
71  const std::string objStr = EVTColContainer::getTypeString(it->first);
72  _genCut[it->first] = pset.getParameter<std::string>( objStr+"_genCut" );
73  _recCut[it->first] = pset.getParameter<std::string>( objStr+"_recCut" );
74  _cutMinPt[it->first] = pset.getParameter<double>( objStr+"_cutMinPt" );
75  _cutMaxEta[it->first] = pset.getParameter<double>( objStr+"_cutMaxEta" );
76  }
77  //--- Updating parameters if has to be modified for this particular specific analysis
78  for(std::map<unsigned int,std::string>::const_iterator it = _recLabels.begin();
79  it != _recLabels.end(); ++it)
80  {
81  const std::string objStr = EVTColContainer::getTypeString(it->first);
82  if(anpset.existsAs<std::string>( objStr+"_genCut", false))
83  {
84  _genCut[it->first] = anpset.getUntrackedParameter<std::string>( objStr+"_genCut" );
85  }
86  if(anpset.existsAs<std::string>( objStr+"_recCut", false))
87  {
88  _recCut[it->first] = anpset.getUntrackedParameter<std::string>( objStr+"_recCut" );
89  }
90  if(anpset.existsAs<double>( objStr+"_cutMinPt" , false) )
91  {
92  _cutMinPt[it->first] = anpset.getUntrackedParameter<double>( objStr+"_cutMinPt" );
93  }
94  if(anpset.existsAs<double>( objStr+"_cutMaxEta" ,false) )
95  {
96  _cutMaxEta[it->first] = anpset.getUntrackedParameter<double>( objStr+"_cutMaxEta" );
97  }
98  }
99  _hltPathsToCheck = anpset.getParameter<std::vector<std::string> >("hltPathsToCheck");
100  _minCandidates = anpset.getParameter<unsigned int>("minCandidates");
101 
102  std::vector<double> default_parametersHt;
103  default_parametersHt.push_back(100);
104  default_parametersHt.push_back(0);
105  default_parametersHt.push_back(1000);
106  _parametersHt = pset.getUntrackedParameter<std::vector<double> >("parametersHt",default_parametersHt);
107 
108  _HtJetPtMin = anpset.getUntrackedParameter<double>("HtJetPtMin", -1);
109  _HtJetEtaMax = anpset.getUntrackedParameter<double>("HtJetEtaMax", -1);
110 
111  if( _HtJetPtMin>0 && _HtJetEtaMax>0 ) _bookHtPlots = true;
112  else _bookHtPlots = false;
113 
114  if( pset.exists("pileUpInfoLabel") )
115  {
116  _puSummaryInfo = iC.consumes<std::vector< PileupSummaryInfo > >(pset.getParameter<std::string>("pileUpInfoLabel"));
117  }
118 
119  if( anpset.existsAs<std::vector<double>>( "NminOneCuts" , false) )
120  {
121  _NminOneCuts = anpset.getUntrackedParameter<std::vector<double> >("NminOneCuts");
122  if( _NminOneCuts.size() < 9 + _minCandidates ) {
123  edm::LogError("HiggsValidation") << "In HLTHiggsSubAnalysis::HLTHiggsSubAnalysis, "
124  << "Incoherence found in the python configuration file!!\nThe SubAnalysis '"
125  << _analysisname << "' has a vector NminOneCuts with size "
126  << _NminOneCuts.size() << ", while it needs to be at least of size "
127  << (9 + _minCandidates) << ".";
128  exit(-1);
129  }
130  for(std::vector<double>::const_iterator it = _NminOneCuts.begin(); it != _NminOneCuts.end(); ++it)
131  {
132  if( *it ) {
133  _useNminOneCuts = true;
134  break;
135  }
136  }
137  }
138  NptPlots = ( _useNminOneCuts ? _minCandidates : 2 );
139 }
std::vector< double > _parametersTurnOn
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
StringCutObjectSelector< reco::CaloMET > * _recCaloMETSelector
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:184
edm::EDGetTokenT< reco::GenParticleCollection > _genParticleLabel
std::map< unsigned int, std::string > _genCut
gen/rec objects cuts
edm::EDGetTokenT< reco::PFJetCollection > _recoHtJetLabel
unsigned int _minCandidates
The minimum number of reco/gen candidates needed by the analysis.
std::vector< double > _NminOneCuts
std::vector< GenJet > GenJetCollection
collection of GenJet objects
edm::ParameterSet _pset
bool exists(std::string const &parameterName) const
checks if a parameter exists
StringCutObjectSelector< reco::PFMET > * _recPFMETSelector
edm::EDGetTokenT< reco::GenJetCollection > _genJetLabel
std::vector< double > _parametersPu
StringCutObjectSelector< reco::Track > * _recTrackSelector
std::map< unsigned int, std::string > _recCut
StringCutObjectSelector< reco::GenJet > * _genJetSelector
edm::EDGetTokenT< std::vector< PileupSummaryInfo > > _puSummaryInfo
std::map< unsigned int, std::string > _recLabels
std::map< unsigned int, double > _cutMinPt
StringCutObjectSelector< reco::PFTau > * _recPFTauSelector
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.
std::map< unsigned int, double > _cutMaxEta
void bookobjects(const edm::ParameterSet &anpset, edm::ConsumesCollector &iC)
StringCutObjectSelector< reco::Photon > * _recPhotonSelector
StringCutObjectSelector< reco::PFJet > * _recPFJetSelector
static const std::string getTypeString(const unsigned int &objtype)
Tranform types into strings.
StringCutObjectSelector< reco::GsfElectron > * _recElecSelector
HLTHiggsSubAnalysis::~HLTHiggsSubAnalysis ( )

Definition at line 141 of file HLTHiggsSubAnalysis.cc.

References _genJetSelector, _genSelectorMap, _recCaloMETSelector, _recElecSelector, _recMuonSelector, _recPFJetSelector, _recPFMETSelector, _recPFTauSelector, _recPhotonSelector, _recTrackSelector, and python.multivaluedict::map().

142 {
143  for(std::map<unsigned int,StringCutObjectSelector<reco::GenParticle>* >::iterator it = _genSelectorMap.begin();
144  it != _genSelectorMap.end(); ++it)
145  {
146  delete it->second;
147  it->second =0;
148  }
149  delete _genJetSelector;
150  _genJetSelector =0;
151  delete _recMuonSelector;
152  _recMuonSelector =0;
153  delete _recElecSelector;
154  _recElecSelector =0;
155  delete _recPhotonSelector;
157  delete _recCaloMETSelector;
159  delete _recPFMETSelector;
161  delete _recPFTauSelector;
163  delete _recPFJetSelector;
165  delete _recTrackSelector;
167 }
StringCutObjectSelector< reco::CaloMET > * _recCaloMETSelector
StringCutObjectSelector< reco::PFMET > * _recPFMETSelector
StringCutObjectSelector< reco::Track > * _recTrackSelector
std::map< unsigned int, StringCutObjectSelector< reco::GenParticle > * > _genSelectorMap
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

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

Definition at line 363 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(), eta(), fillHist(), GEN, EVTColContainer::genJets, EVTColContainer::genParticles, edm::Event::getByToken(), EVTColContainer::getTypeString(), i, initAndInsertJets(), initobjects(), InitSelector(), insertcandidates(), edm::HandleBase::isValid(), j, python.multivaluedict::map(), NptPlots, passJetCuts(), passOtherCuts(), EVTColContainer::PFJET, EVTColContainer::PFMET, phi, EnergyCorrector::pt, RECO, python.multivaluedict::sort(), source, AlCaHLTBitMon_QueryRunRegistry::string, groupFilesInBlocks::temp, edm::TriggerNames::triggerIndex(), edm::Event::triggerNames(), EVTColContainer::triggerResults, and trigNames.

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

Definition at line 170 of file HLTHiggsSubAnalysis.cc.

171 {
172 }
void HLTHiggsSubAnalysis::beginRun ( const edm::Run iRun,
const edm::EventSetup iEventSetup 
)

Definition at line 176 of file HLTHiggsSubAnalysis.cc.

References _analysisname, _analyzers, _hltConfig, _hltPaths, _hltPathsToCheck, _hltProcessName, _NminOneCuts, _pset, _recLabels, _shortpath2long, cmsRelvalreport::exit, spr::find(), newFWLiteAna::found, getObjectsType(), EVTColContainer::getTypeString(), i, HLTConfigProvider::init(), j, LogDebug, LogTrace, NptPlots, cmsHarvester::path, chain::pattern, AlCaHLTBitMon_QueryRunRegistry::string, and HLTConfigProvider::triggerNames().

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

Definition at line 904 of file HLTHiggsSubAnalysis.cc.

References _elements, _parametersEta, _parametersPhi, _parametersTurnOn, DQMStore::IBooker::book1D(), prof2calltree::edges, EVTColContainer::getTypeString(), h, i, bookConverter::max, min(), mergeVDriftHistosByStation::name, EVTColContainer::PFJET, EVTColContainer::PFMET, source, AlCaHLTBitMon_QueryRunRegistry::string, and indexGen::title.

Referenced by bookHistograms().

906 {
907  std::string sourceUpper = source;
908  sourceUpper[0] = std::toupper(sourceUpper[0]);
909  std::string name = source + objType + variable ;
910  TH1F * h = 0;
911 
912  if(variable.find("MaxPt") != std::string::npos)
913  {
914  std::string desc;
915  if (variable == "MaxPt1") desc = "Leading";
916  else if (variable == "MaxPt2") desc = "Next-to-Leading";
917  else desc = variable.substr(5,6) + "th Leading";
918  std::string title = "pT of " + desc + " " + sourceUpper + " " + objType;
919  const size_t nBinsStandard = _parametersTurnOn.size() - 1;
920  size_t nBins = nBinsStandard;
921  float * edges = new float[nBinsStandard + 1];
922  for(size_t i = 0; i < nBinsStandard + 1; i++)
923  {
924  edges[i] = _parametersTurnOn[i];
925  }
926 
928  if( objType == jetObj ) {
929  const size_t nBinsJets = 25;
930  nBins = nBinsJets;
931  delete [] edges;
932  edges = new float[nBinsJets+1];
933  for(size_t i = 0; i < nBinsJets + 1; i++)
934  {
935  edges[i] = i*10;
936  }
937  }
939  const size_t nBinsJets = 30;
940  nBins = nBinsJets;
941  delete [] edges;
942  edges = new float[nBinsJets+1];
943  for(size_t i = 0; i < nBinsJets + 1; i++)
944  {
945  edges[i] = i*10;
946  }
947  }
948  h = new TH1F(name.c_str(), title.c_str(), nBins, edges);
949  delete [] edges;
950  }
951  else if( variable == "dEtaqq" ){
952  std::string title = "#Delta #eta_{qq} of " + sourceUpper + " " + objType;
953  int nBins = 20;
954  double min = 0;
955  double max = 4.8;
956  h = new TH1F(name.c_str(), title.c_str(), nBins, min, max);
957  }
958  else if ( variable == "mqq" ){
959  std::string title = "m_{qq} of " + sourceUpper + " " + objType;
960  int nBins = 20;
961  double min = 0;
962  double max = 1000;
963  h = new TH1F(name.c_str(), title.c_str(), nBins, min, max);
964  }
965  else if ( variable == "dPhibb" ){
966  std::string title = "#Delta #phi_{bb} of " + sourceUpper + " " + objType;
967  int nBins = 10;
968  double min = 0;
969  double max = 3.1416;
970  h = new TH1F(name.c_str(), title.c_str(), nBins, min, max);
971  }
972  else if ( variable == "CSV1" ){
973  std::string title = "CSV1 of " + sourceUpper + " " + objType;
974  int nBins = 20;
975  double min = 0;
976  double max = 1;
977  h = new TH1F(name.c_str(), title.c_str(), nBins, min, max);
978  }
979  else if ( variable == "CSV2" ){
980  std::string title = "CSV2 of " + sourceUpper + " " + objType;
981  int nBins = 20;
982  double min = 0;
983  double max = 1;
984  h = new TH1F(name.c_str(), title.c_str(), nBins, min, max);
985  }
986  else if ( variable == "CSV3" ){
987  std::string title = "CSV3 of " + sourceUpper + " " + objType;
988  int nBins = 20;
989  double min = 0;
990  double max = 1;
991  h = new TH1F(name.c_str(), title.c_str(), nBins, min, max);
992  }
993  else if ( variable == "maxCSV" ){
994  std::string title = "max CSV of " + sourceUpper + " " + objType;
995  int nBins = 20;
996  double min = 0;
997  double max = 1;
998  h = new TH1F(name.c_str(), title.c_str(), nBins, min, max);
999  }
1000  else
1001  {
1002  std::string symbol = (variable == "Eta") ? "#eta" : "#phi";
1003  std::string title = symbol + " of " + sourceUpper + " " + objType;
1004  std::vector<double> params = (variable == "Eta") ? _parametersEta : _parametersPhi;
1005 
1006  int nBins = (int)params[0];
1007  double min = params[1];
1008  double max = params[2];
1009  h = new TH1F(name.c_str(), title.c_str(), nBins, min, max);
1010  }
1011  h->Sumw2();
1012  _elements[name] = ibooker.book1D(name, h);
1013  delete h;
1014 }
std::vector< double > _parametersTurnOn
int i
Definition: DBlmapReader.cc:9
std::map< std::string, MonitorElement * > _elements
dictionary edges
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
T min(T a, T b)
Definition: MathUtil.h:58
std::vector< double > _parametersPhi
std::vector< double > _parametersEta
Some kinematical parameters.
static const std::string getTypeString(const unsigned int &objtype)
Tranform types into strings.
static std::string const source
Definition: EdmProvDump.cc:43
void HLTHiggsSubAnalysis::bookHistograms ( DQMStore::IBooker ibooker)

Definition at line 263 of file HLTHiggsSubAnalysis.cc.

References _analysisname, _analyzers, _bookHtPlots, _elements, _histDirectory, _hltPathsToCheck, _NminOneCuts, _parametersHt, _parametersPu, _recLabels, _useNminOneCuts, DQMStore::IBooker::book1D(), bookHist(), EVTColContainer::getTypeString(), i, j, NptPlots, cmsHarvester::path, EVTColContainer::PFJET, DQMStore::IBooker::setCurrentFolder(), source, and AlCaHLTBitMon_QueryRunRegistry::string.

264 {
265  std::string baseDir = _histDirectory+"/"+_analysisname+"/";
266  ibooker.setCurrentFolder(baseDir);
267  // Book the gen/reco analysis-dependent histograms (denominators)
268  std::vector<std::string> sources(2);
269  sources[0] = "gen";
270  sources[1] = "rec";
271 
272  for(std::map<unsigned int,std::string>::const_iterator it = _recLabels.begin();
273  it != _recLabels.end(); ++it)
274  {
275  const std::string objStr = EVTColContainer::getTypeString(it->first);
276  TString maxPt;
277 
278  for(size_t i = 0; i < sources.size(); i++)
279  {
280  std::string source = sources[i];
281  if( _useNminOneCuts && it->first == EVTColContainer::PFJET) {
282  if( source == "gen" ) continue;
283  else {
284  // N-1 jet plots (dEtaqq, mqq, dPhibb, CSV1, maxCSV_jets, maxCSV_E, PFMET, pt1, pt2, pt3, pt4)
285  if( _NminOneCuts[0] ) bookHist(source, objStr, "dEtaqq", ibooker);
286  if( _NminOneCuts[1] ) bookHist(source, objStr, "mqq", ibooker);
287  if( _NminOneCuts[2] ) bookHist(source, objStr, "dPhibb", ibooker);
288  if( _NminOneCuts[3] ) {
289  if ( _NminOneCuts[6] ) bookHist(source, objStr, "maxCSV", ibooker);
290  else bookHist(source, objStr, "CSV1", ibooker);
291  }
292  if( _NminOneCuts[4] ) bookHist(source, objStr, "CSV2", ibooker);
293  if( _NminOneCuts[5] ) bookHist(source, objStr, "CSV3", ibooker);
294  }
295  }
296 
297  bookHist(source, objStr, "Eta", ibooker);
298  bookHist(source, objStr, "Phi", ibooker);
299  for( unsigned int i=0; i < NptPlots; i++ )
300  {
301  maxPt = "MaxPt";
302  maxPt += i+1;
303  bookHist(source, objStr, maxPt.Data(), ibooker);
304  }
305  }
306  }
307 
308  // Call the bookHistograms (which books all the path dependent histograms)
309  for(std::vector<HLTHiggsPlotter>::iterator it = _analyzers.begin();
310  it != _analyzers.end(); ++it)
311  {
312  it->bookHistograms(ibooker, _useNminOneCuts);
313  }
314  //booking the histograms for overall trigger efficiencies
315  for(size_t i = 0; i < sources.size(); i++)
316  {
317  std::string nameGlobalEfficiency = "SummaryPaths_"+_analysisname+"_"+sources[i];
318 
319  _elements[nameGlobalEfficiency] = ibooker.book1D(nameGlobalEfficiency.c_str(),nameGlobalEfficiency.c_str(),_hltPathsToCheck.size(), 0, _hltPathsToCheck.size());
320 
321  std::string nameGlobalEfficiencyPassing= nameGlobalEfficiency+"_passingHLT";
322  _elements[nameGlobalEfficiencyPassing] = ibooker.book1D(nameGlobalEfficiencyPassing.c_str(),nameGlobalEfficiencyPassing.c_str(),_hltPathsToCheck.size(), 0, _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  _elements[nameVtxPlot] = ibooker.book1D(nameVtxPlot.c_str(), titlePu.c_str(), nBinsPu, minPu, maxPu);
339  if( _bookHtPlots ) _elements[nameHtPlot] = ibooker.book1D(nameHtPlot.c_str(), titleHt.c_str(), nBinsHt, minHt, maxHt);
340  for (size_t j = 0 ; j < _hltPathsToCheck.size() ; j++){
341  //declare the efficiency vs interaction plots
343  std::string shortpath = path;
344  if(path.rfind("_v") < path.length())
345  {
346  shortpath = path.substr(0, path.rfind("_v"));
347  }
348  std::string titlePassingPu = "nb of interations in the event passing path " + shortpath;
349  _elements[nameVtxPlot+"_"+shortpath] = ibooker.book1D(nameVtxPlot+"_"+shortpath, titlePassingPu.c_str(), nBinsPu, minPu, maxPu);
350 
351  std::string titlePassingHt = "sum of jet pT in the event passing path " + shortpath;
352  if( _bookHtPlots ) _elements[nameHtPlot+"_"+shortpath] = ibooker.book1D(nameHtPlot+"_"+shortpath, titlePassingHt.c_str(), nBinsHt, minHt, maxHt);
353 
354  //fill the bin labels of the summary plot
355  _elements[nameGlobalEfficiency]->setBinLabel(j+1,shortpath);
356  _elements[nameGlobalEfficiencyPassing]->setBinLabel(j+1,shortpath);
357  }
358  }
359 }
int i
Definition: DBlmapReader.cc:9
std::map< std::string, MonitorElement * > _elements
std::vector< double > _NminOneCuts
std::vector< double > _parametersPu
tuple path
else: Piece not in the list, fine.
std::vector< HLTHiggsPlotter > _analyzers
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
int j
Definition: DBlmapReader.cc:9
std::map< unsigned int, std::string > _recLabels
void bookHist(const std::string &source, const std::string &objType, const std::string &variable, DQMStore::IBooker &)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
std::vector< double > _parametersHt
std::vector< std::string > _hltPathsToCheck
the hlt paths with regular expressions
static const std::string getTypeString(const unsigned int &objtype)
Tranform types into strings.
static std::string const source
Definition: EdmProvDump.cc:43
void HLTHiggsSubAnalysis::bookobjects ( const edm::ParameterSet anpset,
edm::ConsumesCollector iC 
)
private

Definition at line 756 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().

757 {
758  if( anpset.exists("recMuonLabel") )
759  {
760  _recLabels[EVTColContainer::MUON] = anpset.getParameter<std::string>("recMuonLabel");
763  }
764  if( anpset.exists("recElecLabel") )
765  {
766  _recLabels[EVTColContainer::ELEC] = anpset.getParameter<std::string>("recElecLabel");
769  }
770  if( anpset.exists("recPhotonLabel") )
771  {
772  _recLabels[EVTColContainer::PHOTON] = anpset.getParameter<std::string>("recPhotonLabel");
775  }
776  if( anpset.exists("recCaloMETLabel") )
777  {
778  _recLabels[EVTColContainer::CALOMET] = anpset.getParameter<std::string>("recCaloMETLabel");
781  }
782  if( anpset.exists("recPFMETLabel") )
783  {
784  _recLabels[EVTColContainer::PFMET] = anpset.getParameter<std::string>("recPFMETLabel");
787  }
788  if( anpset.exists("recPFTauLabel") )
789  {
790  _recLabels[EVTColContainer::PFTAU] = anpset.getParameter<std::string>("recPFTauLabel");
793  }
794  if( anpset.exists("recJetLabel") )
795  {
796  _recLabels[EVTColContainer::PFJET] = anpset.getParameter<std::string>("recJetLabel");
798  if( anpset.exists("jetTagLabel") )
800  _genJetSelector = 0;
801  }
802  /*if( anpset.exists("recTrackLabel") )
803  {
804  _recLabels[EVTColContainer::TRACK] = anpset.getParameter<std::string>("recTrackLabel");
805  _genSelectorMap[EVTColContainer::TRACK] = 0 ;
806  }*/
807 
808  if( _recLabels.size() < 1 )
809  {
810  edm::LogError("HiggsValidation") << "HLTHiggsSubAnalysis::bookobjects, "
811  << "Not included any object (recMuonLabel, recElecLabel, ...) "
812  << "in the analysis " << _analysisname;
813  return;
814  }
815 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getParameter(std::string const &) const
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
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
std::map< unsigned int, StringCutObjectSelector< reco::GenParticle > * > _genSelectorMap
StringCutObjectSelector< reco::GenJet > * _genJetSelector
std::map< unsigned int, std::string > _recLabels
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
void HLTHiggsSubAnalysis::fillHist ( const std::string &  source,
const std::string &  objType,
const std::string &  variable,
const float &  value 
)
private

Definition at line 1016 of file HLTHiggsSubAnalysis.cc.

References _elements, mergeVDriftHistosByStation::name, source, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by analyze().

1018 {
1019  std::string sourceUpper = source;
1020  sourceUpper[0] = toupper(sourceUpper[0]);
1021  std::string name = source + objType + variable ;
1022 
1023  _elements[name]->Fill(value);
1024 }
std::map< std::string, MonitorElement * > _elements
static std::string const source
Definition: EdmProvDump.cc:43
const std::vector< unsigned int > HLTHiggsSubAnalysis::getObjectsType ( const std::string &  hltpath) const

Extract what objects need this analysis.

Definition at line 719 of file HLTHiggsSubAnalysis.cc.

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

Referenced by beginRun().

720 {
721  static const unsigned int objSize = 7;
722  static const unsigned int objtriggernames[] = {
726 // EVTColContainer::TRACK, // Note is tracker muon
731  };
732 
733  std::set<unsigned int> objsType;
734  // The object to deal has to be entered via the config .py
735  for(unsigned int i = 0; i < objSize; ++i)
736  {
737  std::string objTypeStr = EVTColContainer::getTypeString( objtriggernames[i] );
738  // Check if it is needed this object for this trigger
739  if( ! TString(hltPath).Contains(objTypeStr) )
740  {
741  if( (objtriggernames[i] == EVTColContainer::PFJET && TString(hltPath).Contains("CSV") ) || // fix for ZnnHbb PFJET
742  (objtriggernames[i] == EVTColContainer::PFMET && TString(hltPath).Contains("MHT")) ) // fix for ZnnHbb PFMET
743  objsType.insert(objtriggernames[i]);
744  continue;
745  }
746  if( objtriggernames[i] == EVTColContainer::CALOMET && (TString(hltPath).Contains("PFMET") || TString(hltPath).Contains("MHT") ) ) continue; // fix for PFMET
747 
748  objsType.insert(objtriggernames[i]);
749  }
750 
751  return std::vector<unsigned int>(objsType.begin(),objsType.end());
752 }
int i
Definition: DBlmapReader.cc:9
static const std::string getTypeString(const unsigned int &objtype)
Tranform types into strings.
void HLTHiggsSubAnalysis::initAndInsertJets ( const edm::Event iEvent,
EVTColContainer cols,
std::vector< MatchStruct > *  matches 
)
private

Definition at line 1069 of file HLTHiggsSubAnalysis.cc.

References _recLabelsPFJet, _recPFJetSelector, _recTagPFJet, _useNminOneCuts, edm::Event::getByToken(), EVTColContainer::PFJET, edm::Handle< T >::product(), and EVTColContainer::set().

Referenced by analyze().

1071 {
1073  iEvent.getByToken(_recLabelsPFJet, PFJetHandle);
1074  cols->set(PFJetHandle.product());
1075 
1077  if( _useNminOneCuts ) {
1078  iEvent.getByToken(_recTagPFJet, JetTagHandle);
1079  }
1080 
1081  for(reco::PFJetCollection::const_iterator it = PFJetHandle->begin();
1082  it != PFJetHandle->end(); ++it)
1083  {
1084  reco::PFJetRef jetRef(PFJetHandle, it - PFJetHandle->begin());
1085  reco::JetBaseRef jetBaseRef(jetRef);
1086 
1087  if(_recPFJetSelector->operator()(*it))
1088  {
1089  if( _useNminOneCuts)
1090  {
1091  float bTag = (*(JetTagHandle.product()))[jetBaseRef];
1092  matches->push_back(MatchStruct(&*it,EVTColContainer::PFJET, bTag));
1093  }
1094  else {
1095  matches->push_back(MatchStruct(&*it,EVTColContainer::PFJET));
1096  }
1097  }
1098  }
1099 }
edm::EDGetTokenT< reco::PFJetCollection > _recLabelsPFJet
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:446
edm::EDGetTokenT< reco::JetTagCollection > _recTagPFJet
void set(const reco::MuonCollection *v)
Setter: multiple overloaded function.
T const * product() const
Definition: Handle.h:81
StringCutObjectSelector< reco::PFJet > * _recPFJetSelector
void HLTHiggsSubAnalysis::initobjects ( const edm::Event iEvent,
EVTColContainer col 
)
private

Definition at line 817 of file HLTHiggsSubAnalysis.cc.

References _genJetLabel, _genParticleLabel, _recLabels, _recLabelsCaloMET, _recLabelsElec, _recLabelsMuon, _recLabelsPFMET, _recLabelsPFTau, _recLabelsPhoton, _trigResultsTag, _useNminOneCuts, EVTColContainer::CALOMET, EVTColContainer::ELEC, EVTColContainer::genJets, EVTColContainer::genParticles, edm::Event::getByToken(), EVTColContainer::isCommonInit(), edm::HandleBase::isValid(), EVTColContainer::MUON, EVTColContainer::PFJET, EVTColContainer::PFMET, EVTColContainer::PFTAU, EVTColContainer::PHOTON, edm::Handle< T >::product(), EVTColContainer::set(), and EVTColContainer::triggerResults.

Referenced by analyze().

818 {
819  /*if( col != 0 && col->isAllInit() )
820  {
821  // Already init, not needed to do nothing
822  return;
823  }*/
824  if( ! col->isCommonInit() )
825  {
826  // extract the trigger results (path info, pass,...)
828  iEvent.getByToken(_trigResultsTag,trigResults);
829  if( trigResults.isValid() )
830  {
831  col->triggerResults = trigResults.product();
832  }
833 
834  // GenParticle collection if is there (genJets only if there need to be jets)
836  iEvent.getByToken(_genParticleLabel,genPart);
837  if( genPart.isValid() )
838  {
839  col->genParticles = genPart.product();
840  }
841  }
842 
843  for(std::map<unsigned int,std::string>::iterator it = _recLabels.begin();
844  it != _recLabels.end(); ++it)
845  {
846  if( it->first == EVTColContainer::MUON )
847  {
849  iEvent.getByToken(_recLabelsMuon, theHandle);
850  col->set(theHandle.product());
851  }
852  else if( it->first == EVTColContainer::ELEC )
853  {
855  iEvent.getByToken(_recLabelsElec, theHandle);
856  col->set(theHandle.product());
857  }
858  else if( it->first == EVTColContainer::PHOTON )
859  {
861  iEvent.getByToken(_recLabelsPhoton, theHandle);
862  col->set(theHandle.product());
863  }
864  else if( it->first == EVTColContainer::CALOMET )
865  {
867  iEvent.getByToken(_recLabelsCaloMET, theHandle);
868  col->set(theHandle.product());
869  }
870  else if( it->first == EVTColContainer::PFMET )
871  {
873  iEvent.getByToken(_recLabelsPFMET, theHandle);
874  col->set(theHandle.product());
875  }
876  else if( it->first == EVTColContainer::PFTAU )
877  {
879  iEvent.getByToken(_recLabelsPFTau, theHandle);
880  col->set(theHandle.product());
881  }
882  // 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
883  else if( it->first == EVTColContainer::PFJET )
884  {
885  if( ! _useNminOneCuts) {
886  // GenJet collection
888  iEvent.getByToken(_genJetLabel,genJet);
889  if( genJet.isValid() )
890  {
891  col->genJets = genJet.product();
892  }
893  }
894  }
895  else
896  {
897  edm::LogError("HiggsValidation") << "HLTHiggsSubAnalysis::initobjects "
898  << " NOT IMPLEMENTED (yet) ERROR: '" << it->second << "'";
899  //return; ??
900  }
901  }
902 }
edm::EDGetTokenT< reco::PFMETCollection > _recLabelsPFMET
edm::EDGetTokenT< reco::GenParticleCollection > _genParticleLabel
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:446
edm::EDGetTokenT< reco::PFTauCollection > _recLabelsPFTau
const reco::GenParticleCollection * genParticles
edm::EDGetTokenT< reco::GenJetCollection > _genJetLabel
edm::EDGetTokenT< reco::PhotonCollection > _recLabelsPhoton
edm::EDGetTokenT< reco::CaloMETCollection > _recLabelsCaloMET
void set(const reco::MuonCollection *v)
Setter: multiple overloaded function.
const reco::GenJetCollection * genJets
std::map< unsigned int, std::string > _recLabels
bool isValid() const
Definition: HandleBase.h:76
edm::EDGetTokenT< edm::TriggerResults > _trigResultsTag
edm::EDGetTokenT< reco::GsfElectronCollection > _recLabelsElec
T const * product() const
Definition: Handle.h:81
edm::EDGetTokenT< reco::MuonCollection > _recLabelsMuon
const edm::TriggerResults * triggerResults
void HLTHiggsSubAnalysis::InitSelector ( const unsigned int &  objtype)
private

Definition at line 1029 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().

1030 {
1031  if( objtype == EVTColContainer::MUON && _recMuonSelector == 0 )
1032  {
1034  }
1035  else if( objtype == EVTColContainer::ELEC && _recElecSelector == 0)
1036  {
1038  }
1039  else if( objtype == EVTColContainer::PHOTON && _recPhotonSelector == 0)
1040  {
1042  }
1043  else if( objtype == EVTColContainer::CALOMET && _recCaloMETSelector == 0)
1044  {
1046  }
1047  else if( objtype == EVTColContainer::PFMET && _recPFMETSelector == 0)
1048  {
1050  }
1051  else if( objtype == EVTColContainer::PFTAU && _recPFTauSelector == 0 )
1052  {
1054  }
1055  else if( objtype == EVTColContainer::PFJET && _recPFJetSelector == 0 )
1056  {
1058  }
1059  /*else if( objtype == EVTColContainer::TRACK && _recTrackSelector == 0)
1060  {
1061  _recTrackSelector = new StringCutObjectSelector<reco::Track>(_recCut[objtype]);
1062  }*/
1063 /* else
1064  {
1065 FIXME: ERROR NO IMPLEMENTADO
1066  }*/
1067 }
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
void HLTHiggsSubAnalysis::insertcandidates ( const unsigned int &  objtype,
const EVTColContainer col,
std::vector< MatchStruct > *  matches 
)
private

Definition at line 1189 of file HLTHiggsSubAnalysis.cc.

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

Referenced by analyze().

1191 {
1192  if( objType == EVTColContainer::MUON )
1193  {
1194  for(size_t i = 0; i < cols->muons->size(); i++)
1195  {
1196  if(_recMuonSelector->operator()(cols->muons->at(i)))
1197  {
1198  matches->push_back(MatchStruct(&cols->muons->at(i),objType));
1199  }
1200  }
1201  }
1202  else if( objType == EVTColContainer::ELEC )
1203  {
1204  for(size_t i = 0; i < cols->electrons->size(); i++)
1205  {
1206  if(_recElecSelector->operator()(cols->electrons->at(i)))
1207  {
1208  matches->push_back(MatchStruct(&cols->electrons->at(i),objType));
1209  }
1210  }
1211  }
1212  else if( objType == EVTColContainer::PHOTON )
1213  {
1214  for(size_t i = 0; i < cols->photons->size(); i++)
1215  {
1216  if(_recPhotonSelector->operator()(cols->photons->at(i)))
1217  {
1218  matches->push_back(MatchStruct(&cols->photons->at(i),objType));
1219  }
1220  }
1221  }
1222  else if( objType == EVTColContainer::CALOMET )
1223  {
1224  for(size_t i = 0; i < cols->caloMETs->size(); i++)
1225  {
1226  if(_recCaloMETSelector->operator()(cols->caloMETs->at(i)))
1227  {
1228  matches->push_back(MatchStruct(&cols->caloMETs->at(i),objType));
1229  }
1230  }
1231  }
1232  else if( objType == EVTColContainer::PFMET )
1233  {
1234  for(size_t i = 0; i < cols->pfMETs->size(); i++)
1235  {
1236  if(_recPFMETSelector->operator()(cols->pfMETs->at(i)))
1237  {
1238  matches->push_back(MatchStruct(&cols->pfMETs->at(i),objType));
1239  }
1240  }
1241  }
1242  else if( objType == EVTColContainer::PFTAU )
1243  {
1244  for(size_t i = 0; i < cols->pfTaus->size(); i++)
1245  {
1246  if(_recPFTauSelector->operator()(cols->pfTaus->at(i)))
1247  {
1248  matches->push_back(MatchStruct(&cols->pfTaus->at(i),objType));
1249  }
1250  }
1251  }
1252 // else if( objType == EVTColContainer::PFJET )
1253 // {
1254 // already inserted
1255 // }
1256  /*else if( objType == EVTColContainer::TRACK )
1257  {
1258  for(size_t i = 0; i < cols->tracks->size(); i++)
1259  {
1260  if(_recTrackSelector->operator()(cols->tracks->at(i)))
1261  {
1262  matches->push_back(MatchStruct(&cols->tracks->at(i),objType));
1263  }
1264  }
1265  }*/
1266  /*
1267  else FIXME: Control errores
1268  {
1269  }
1270  */
1271 }
int i
Definition: DBlmapReader.cc:9
StringCutObjectSelector< reco::CaloMET > * _recCaloMETSelector
StringCutObjectSelector< reco::PFMET > * _recPFMETSelector
StringCutObjectSelector< reco::PFTau > * _recPFTauSelector
StringCutObjectSelector< reco::Muon > * _recMuonSelector
StringCutObjectSelector< reco::Photon > * _recPhotonSelector
StringCutObjectSelector< reco::GsfElectron > * _recElecSelector
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 1101 of file HLTHiggsSubAnalysis.cc.

References _NminOneCuts, eta(), i, NptPlots, phi, python.multivaluedict::sort(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by analyze().

1102 { //dEtaqq, mqq, dPhibb, CSV1, CSV2, CSV3, maxCSV_jets, maxCSV_E, PFMET, pt1, pt2, pt3, pt4
1103 
1104  // Perform pt cuts
1105  std::sort(matches->begin(), matches->end(), matchesByDescendingPt());
1106  TString maxPt;
1107  for( unsigned int i=0; i < NptPlots; i++ )
1108  {
1109  maxPt = "MaxPt";
1110  maxPt += i+1;
1111  if( (*matches)[i].pt > _NminOneCuts[9+i] ) jetCutResult[maxPt.Data()] = true;
1112  else jetCutResult[maxPt.Data()] = false;
1113  }
1114 
1115  unsigned int NbTag = ( (_NminOneCuts[0] || _NminOneCuts[1]) ? 4 : 8 );
1116  if( matches->size() < NbTag ) NbTag = matches->size();
1117  // Perform b-tag ordered cuts
1118  std::sort(matches->begin(), matches->begin()+NbTag, matchesByDescendingBtag());
1119 
1120  if( _NminOneCuts[0] ) {
1121  dEtaqq = fabs((*matches)[2].eta - (*matches)[3].eta);
1122  if( dEtaqq > _NminOneCuts[0] ) jetCutResult["dEtaqq"] = true;
1123  else jetCutResult["dEtaqq"] = false;
1124  }
1125 
1126  if( _NminOneCuts[1] ) {
1127  mqq = ((*matches)[2].lorentzVector + (*matches)[3].lorentzVector).M();
1128  if( mqq > _NminOneCuts[1] ) jetCutResult["mqq"] = true;
1129  else jetCutResult["mqq"] = false;
1130  }
1131 
1132  if( _NminOneCuts[2] ) {
1133  dPhibb = fmod(fabs((*matches)[0].phi - (*matches)[1].phi),3.1416);
1134  if( dPhibb < _NminOneCuts[2] ) jetCutResult["dPhibb"] = true;
1135  else jetCutResult["dPhibb"] = false;
1136  }
1137 
1138  if( _NminOneCuts[4] ) {
1139  CSV2 = (*matches)[1].bTag;
1140  std::string nameCSV2plot = "CSV2";
1141 
1142  if( CSV2 > _NminOneCuts[4] ) jetCutResult[nameCSV2plot] = true;
1143  else jetCutResult[nameCSV2plot] = false;
1144  }
1145 
1146  if( _NminOneCuts[5] ) {
1147  CSV3 = (*matches)[2].bTag;
1148  std::string nameCSV3plot = "CSV3";
1149 
1150  if( CSV3 > _NminOneCuts[5] ) jetCutResult[nameCSV3plot] = true;
1151  else jetCutResult[nameCSV3plot] = false;
1152  }
1153 
1154 
1155  if( _NminOneCuts[3] ) {
1156  CSV1 = (*matches)[0].bTag;
1157  std::string nameCSVplot = "CSV1";
1158  if ( _NminOneCuts[6] ) nameCSVplot = "maxCSV";
1159 
1160  if( CSV1 > _NminOneCuts[3] ) jetCutResult[nameCSVplot] = true;
1161  else jetCutResult[nameCSVplot] = false;
1162 
1163  // max(CSV)
1164  if( _NminOneCuts[6] ) {
1165  std::sort(matches->begin(), matches->end(), matchesByDescendingPt());
1166  CSV1 = (*matches)[0].bTag;
1167  unsigned int Njets = (unsigned int) _NminOneCuts[6];
1168  if ( _NminOneCuts[6] > matches->size()) Njets = matches->size();
1169  for(unsigned int i=1; i < (unsigned int) Njets ; ++i) {
1170  if( (*matches)[i].bTag > CSV1 && (*matches)[i].pt > _NminOneCuts[7] ) CSV1 = (*matches)[i].bTag;
1171  }
1172  }
1173  }
1174 }
int i
Definition: DBlmapReader.cc:9
std::vector< double > _NminOneCuts
T eta() const
Helper structure to order MatchStruct.
Definition: MatchStruct.cc:82
Definition: DDAxes.h:10
void HLTHiggsSubAnalysis::passOtherCuts ( const std::vector< MatchStruct > &  matches,
std::map< std::string, bool > &  jetCutResult 
)
private

Definition at line 1176 of file HLTHiggsSubAnalysis.cc.

References _NminOneCuts, and EVTColContainer::PFMET.

Referenced by analyze().

1176  {
1177  if( _NminOneCuts[8] ) {
1178  jetCutResult["PFMET"] = false;
1179  for(std::vector<MatchStruct>::const_iterator it = matches.begin(); it != matches.end(); ++it)
1180  {
1181  if( it->objType == EVTColContainer::PFMET ) {
1182  if( it->pt > _NminOneCuts[8] ) jetCutResult["PFMET"] = true;
1183  break;
1184  }
1185  }
1186  }
1187 }
std::vector< double > _NminOneCuts

Member Data Documentation

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

Definition at line 175 of file HLTHiggsSubAnalysis.h.

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

bool HLTHiggsSubAnalysis::_bookHtPlots
private

Definition at line 110 of file HLTHiggsSubAnalysis.h.

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

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

Definition at line 149 of file HLTHiggsSubAnalysis.h.

Referenced by HLTHiggsSubAnalysis().

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

Definition at line 148 of file HLTHiggsSubAnalysis.h.

Referenced by HLTHiggsSubAnalysis().

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

Definition at line 150 of file HLTHiggsSubAnalysis.h.

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

Definition at line 151 of file HLTHiggsSubAnalysis.h.

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

Definition at line 178 of file HLTHiggsSubAnalysis.h.

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

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

gen/rec objects cuts

Definition at line 153 of file HLTHiggsSubAnalysis.h.

Referenced by analyze(), and HLTHiggsSubAnalysis().

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

Definition at line 126 of file HLTHiggsSubAnalysis.h.

Referenced by analyze(), and initobjects().

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

Definition at line 159 of file HLTHiggsSubAnalysis.h.

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

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

Definition at line 125 of file HLTHiggsSubAnalysis.h.

Referenced by initobjects().

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 158 of file HLTHiggsSubAnalysis.h.

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

std::string HLTHiggsSubAnalysis::_histDirectory
private

Definition at line 113 of file HLTHiggsSubAnalysis.h.

Referenced by bookHistograms().

HLTConfigProvider HLTHiggsSubAnalysis::_hltConfig
private

Definition at line 177 of file HLTHiggsSubAnalysis.h.

Referenced by beginRun().

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

the hlt paths found in the hltConfig

Definition at line 118 of file HLTHiggsSubAnalysis.h.

Referenced by beginRun().

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

the hlt paths with regular expressions

Definition at line 116 of file HLTHiggsSubAnalysis.h.

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

std::string HLTHiggsSubAnalysis::_hltProcessName
private

Definition at line 112 of file HLTHiggsSubAnalysis.h.

Referenced by beginRun().

double HLTHiggsSubAnalysis::_HtJetEtaMax
private

Definition at line 108 of file HLTHiggsSubAnalysis.h.

Referenced by analyze(), and HLTHiggsSubAnalysis().

double HLTHiggsSubAnalysis::_HtJetPtMin
private

Definition at line 107 of file HLTHiggsSubAnalysis.h.

Referenced by analyze(), and HLTHiggsSubAnalysis().

unsigned int HLTHiggsSubAnalysis::_minCandidates
private

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

Definition at line 105 of file HLTHiggsSubAnalysis.h.

Referenced by analyze(), and HLTHiggsSubAnalysis().

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

Some kinematical parameters.

Definition at line 141 of file HLTHiggsSubAnalysis.h.

Referenced by bookHist().

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

Definition at line 144 of file HLTHiggsSubAnalysis.h.

Referenced by bookHistograms(), and HLTHiggsSubAnalysis().

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

Definition at line 142 of file HLTHiggsSubAnalysis.h.

Referenced by bookHist().

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

Definition at line 143 of file HLTHiggsSubAnalysis.h.

Referenced by bookHistograms().

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

Definition at line 145 of file HLTHiggsSubAnalysis.h.

Referenced by bookHist().

edm::ParameterSet HLTHiggsSubAnalysis::_pset
private

Definition at line 100 of file HLTHiggsSubAnalysis.h.

Referenced by beginRun().

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

Definition at line 138 of file HLTHiggsSubAnalysis.h.

Referenced by analyze(), and HLTHiggsSubAnalysis().

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

Definition at line 162 of file HLTHiggsSubAnalysis.h.

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

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

Definition at line 154 of file HLTHiggsSubAnalysis.h.

Referenced by HLTHiggsSubAnalysis(), and InitSelector().

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

Definition at line 161 of file HLTHiggsSubAnalysis.h.

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

std::map<unsigned int,std::string> HLTHiggsSubAnalysis::_recLabels
private
edm::EDGetTokenT<reco::CaloMETCollection> HLTHiggsSubAnalysis::_recLabelsCaloMET
private

Definition at line 133 of file HLTHiggsSubAnalysis.h.

Referenced by bookobjects(), and initobjects().

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

Definition at line 131 of file HLTHiggsSubAnalysis.h.

Referenced by bookobjects(), and initobjects().

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

Definition at line 130 of file HLTHiggsSubAnalysis.h.

Referenced by bookobjects(), and initobjects().

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

Definition at line 136 of file HLTHiggsSubAnalysis.h.

Referenced by bookobjects(), and initAndInsertJets().

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

Definition at line 134 of file HLTHiggsSubAnalysis.h.

Referenced by bookobjects(), and initobjects().

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

Definition at line 135 of file HLTHiggsSubAnalysis.h.

Referenced by bookobjects(), and initobjects().

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

Definition at line 132 of file HLTHiggsSubAnalysis.h.

Referenced by bookobjects(), and initobjects().

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

Definition at line 160 of file HLTHiggsSubAnalysis.h.

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

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

Definition at line 127 of file HLTHiggsSubAnalysis.h.

Referenced by analyze().

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

Definition at line 166 of file HLTHiggsSubAnalysis.h.

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

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

Definition at line 163 of file HLTHiggsSubAnalysis.h.

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

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

Definition at line 164 of file HLTHiggsSubAnalysis.h.

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

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

Definition at line 165 of file HLTHiggsSubAnalysis.h.

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

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

Definition at line 137 of file HLTHiggsSubAnalysis.h.

Referenced by bookobjects(), and initAndInsertJets().

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

Definition at line 167 of file HLTHiggsSubAnalysis.h.

Referenced by ~HLTHiggsSubAnalysis().

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

Relation between the short version of a path.

Definition at line 121 of file HLTHiggsSubAnalysis.h.

Referenced by analyze(), and beginRun().

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

Definition at line 146 of file HLTHiggsSubAnalysis.h.

Referenced by initobjects().

bool HLTHiggsSubAnalysis::_useNminOneCuts
private
unsigned int HLTHiggsSubAnalysis::NptPlots
private