From 09da1b8faa8c2901d78b10befcd960f59add0a43 Mon Sep 17 00:00:00 2001 From: Elvire Bouvier Date: Thu, 23 Jan 2014 17:25:56 +0100 Subject: [PATCH 01/26] semi-leptonic ttbar and single top --- HLTriggerOffline/Top/BuildFile.xml | 3 + .../Top/interface/HLTEfficiencyCalculator.h | 145 --- .../Top/interface/TopHLTDQMHelper.h | 395 -------- .../interface/TopSingleLeptonHLTValidation.h | 168 ++++ .../Top/interface/TopValidation.h | 238 ----- .../Top/python/HLTTopPostVal_cff.py | 127 --- .../Top/python/HLTTopQualityTester_cfi.py | 14 - .../Top/python/PostProcessor_cfi.py | 62 -- .../Top/python/singletopHLTEventDQM_cfi.py | 315 ------- .../python/singletopHLTEventValidation_cfi.py | 53 ++ .../Top/python/topDiLeptonHLTEventDQM_cfi.py | 639 ------------- HLTriggerOffline/Top/python/topHLTDQM_cff.py | 20 - .../Top/python/topHLTValidation_cff.py | 17 + .../python/topSingleLeptonHLTEventDQM_cfi.py | 843 ----------------- .../topSingleLeptonHLTEventValidation_cfi.py | 53 ++ .../Top/python/topvalidation_cfi.py | 17 - HLTriggerOffline/Top/python/triggerEff_cfi.py | 8 - .../Top/src/HLTEfficiencyCalculator.cc | 82 -- HLTriggerOffline/Top/src/TopHLTDQMHelper.cc | 149 --- .../Top/src/TopHLTDiLeptonOfflineDQM.cc | 738 --------------- .../Top/src/TopHLTDiLeptonOfflineDQM.h | 316 ------- .../Top/src/TopHLTSingleLeptonDQM.cc | 736 --------------- .../Top/src/TopHLTSingleLeptonDQM.h | 278 ------ .../Top/src/TopSingleLeptonHLTValidation.cc | 235 +++++ HLTriggerOffline/Top/src/TopValidation.cc | 859 ------------------ HLTriggerOffline/Top/src/plugins.cc | 11 - 26 files changed, 529 insertions(+), 5992 deletions(-) delete mode 100644 HLTriggerOffline/Top/interface/HLTEfficiencyCalculator.h delete mode 100644 HLTriggerOffline/Top/interface/TopHLTDQMHelper.h create mode 100644 HLTriggerOffline/Top/interface/TopSingleLeptonHLTValidation.h delete mode 100644 HLTriggerOffline/Top/interface/TopValidation.h delete mode 100644 HLTriggerOffline/Top/python/HLTTopPostVal_cff.py delete mode 100644 HLTriggerOffline/Top/python/HLTTopQualityTester_cfi.py delete mode 100644 HLTriggerOffline/Top/python/PostProcessor_cfi.py delete mode 100644 HLTriggerOffline/Top/python/singletopHLTEventDQM_cfi.py create mode 100644 HLTriggerOffline/Top/python/singletopHLTEventValidation_cfi.py delete mode 100644 HLTriggerOffline/Top/python/topDiLeptonHLTEventDQM_cfi.py delete mode 100644 HLTriggerOffline/Top/python/topHLTDQM_cff.py create mode 100644 HLTriggerOffline/Top/python/topHLTValidation_cff.py delete mode 100644 HLTriggerOffline/Top/python/topSingleLeptonHLTEventDQM_cfi.py create mode 100644 HLTriggerOffline/Top/python/topSingleLeptonHLTEventValidation_cfi.py delete mode 100644 HLTriggerOffline/Top/python/topvalidation_cfi.py delete mode 100644 HLTriggerOffline/Top/python/triggerEff_cfi.py delete mode 100644 HLTriggerOffline/Top/src/HLTEfficiencyCalculator.cc delete mode 100644 HLTriggerOffline/Top/src/TopHLTDQMHelper.cc delete mode 100644 HLTriggerOffline/Top/src/TopHLTDiLeptonOfflineDQM.cc delete mode 100644 HLTriggerOffline/Top/src/TopHLTDiLeptonOfflineDQM.h delete mode 100644 HLTriggerOffline/Top/src/TopHLTSingleLeptonDQM.cc delete mode 100644 HLTriggerOffline/Top/src/TopHLTSingleLeptonDQM.h create mode 100644 HLTriggerOffline/Top/src/TopSingleLeptonHLTValidation.cc delete mode 100644 HLTriggerOffline/Top/src/TopValidation.cc delete mode 100644 HLTriggerOffline/Top/src/plugins.cc diff --git a/HLTriggerOffline/Top/BuildFile.xml b/HLTriggerOffline/Top/BuildFile.xml index fc07887bd8741..0ec2cbc261b7d 100644 --- a/HLTriggerOffline/Top/BuildFile.xml +++ b/HLTriggerOffline/Top/BuildFile.xml @@ -1,8 +1,11 @@ + + + diff --git a/HLTriggerOffline/Top/interface/HLTEfficiencyCalculator.h b/HLTriggerOffline/Top/interface/HLTEfficiencyCalculator.h deleted file mode 100644 index bb162ab74836e..0000000000000 --- a/HLTriggerOffline/Top/interface/HLTEfficiencyCalculator.h +++ /dev/null @@ -1,145 +0,0 @@ - -#ifndef HLTriggerOffline_HLTEffCalculator_H -#define HLTriggerOffline_HLTEffCalculator_H - - -// system include files -#include -#include - -// user include files -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/MakerMacros.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -#include "DataFormats/Common/interface/Ref.h" -#include "DataFormats/Common/interface/DetSetVector.h" -#include "DataFormats/Candidate/interface/Candidate.h" -#include "DataFormats/JetReco/interface/Jet.h" -#include "DataFormats/JetReco/interface/CaloJetCollection.h" -#include "DataFormats/TrackReco/interface/Track.h" -#include "DataFormats/TrackReco/interface/TrackExtra.h" - -#include "DataFormats/MuonReco/interface/MuonFwd.h" -#include "DataFormats/MuonReco/interface/Muon.h" - -#include "DataFormats/Candidate/interface/Candidate.h" -#include "DataFormats/RecoCandidate/interface/RecoCandidate.h" -#include "DataFormats/Common/interface/Handle.h" -#include "DataFormats/Common/interface/TriggerResults.h" -#include "DataFormats/Common/interface/RefToBase.h" -#include "HLTrigger/HLTfilters/interface/HLTHighLevel.h" -#include "DataFormats/EgammaCandidates/interface/GsfElectron.h" -#include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h" - -#include "DataFormats/EgammaCandidates/interface/Electron.h" -#include "DataFormats/EgammaCandidates/interface/ElectronFwd.h" -#include "DataFormats/EgammaReco/interface/SuperCluster.h" -#include "DataFormats/EgammaReco/interface/BasicCluster.h" -#include "DataFormats/EgammaReco/interface/BasicClusterFwd.h" - -#include "FWCore/ServiceRegistry/interface/Service.h" - -#include "HLTriggerOffline/Top/interface/TopHLTDQMHelper.h" - - -#include "TDirectory.h" -#include "TH1F.h" -#include "TVector3.h" -#include "TLorentzVector.h" -#include -#include -#include -#include -#include -#include "TFile.h" -#include "TH1.h" - -class EfficiencyHandler{ -public: - EfficiencyHandler(std::string Name, const std::vector& pathnames, int verb = 0):name(Name),verbosity(verb){ - int nPaths = (int)pathnames.size(); - efficiencies= new TH1D(name.c_str(),"efficiencies per path",nPaths,-0.5,(double)nPaths-0.5); - std::stringstream s; - for(int i = 0; i < nPaths; i++){ - pathNames.push_back(pathnames.at(i)); - efficiencies->GetXaxis()->SetBinLabel(i+1,pathnames.at(i).c_str()); - s.str(""); - s<<"path_"<Fill(0); - if(verbosity > 0) - std::cout<Fill(0); - } - } - void WriteAll(TDirectory * d){ - if(d == NULL){ - std::cout<<"NULL directory! Cannot write!"<GetXaxis()->GetNbins() != (int)denominator.size()){ - std::cout<<"HLT path numbers mismatch!"<GetEntries(); - eff= eff/(double)denominator.at(s)->GetEntries(); - efficiencies->SetBinContent(s+1, eff); - } - (d->mkdir(std::string(name+"_BareNumberHists").c_str()))->cd(); - for(unsigned int s = 0; s < pathNames.size(); s++){ - numerator.at(s)->Write(); - denominator.at(s)->Write(); - } - d->cd(); - efficiencies->Write(); - d->cd(); - } -private: - TH1* efficiencies; - std::vector numerator; //now just a number holder. for possible extention in future - std::vector denominator; //now just a number holder. for possible extention in future - std::string name; - std::vector pathNames; - int verbosity; -}; - -// -// class decleration -// - -class HLTEffCalculator : public edm::EDAnalyzer { -public: - explicit HLTEffCalculator(const edm::ParameterSet&); - ~HLTEffCalculator(); - - -private: - virtual void beginJob() ; - virtual void analyze(const edm::Event&, const edm::EventSetup&); - virtual void endJob() ; - - // edm::Service fs; - - - // ----------member data --------------------------- - - std::string outputFileName ; - EfficiencyHandler * myEffHandler; - edm::InputTag HLTresCollection; - int verbosity ; - edm::EDGetTokenT HLTresCollectionToken_; -}; - - -#endif diff --git a/HLTriggerOffline/Top/interface/TopHLTDQMHelper.h b/HLTriggerOffline/Top/interface/TopHLTDQMHelper.h deleted file mode 100644 index a5835bbff164f..0000000000000 --- a/HLTriggerOffline/Top/interface/TopHLTDQMHelper.h +++ /dev/null @@ -1,395 +0,0 @@ -#ifndef TOPHLTDQMHELPERS -#define TOPHLTDQMHELPERS - -#include -#include -#include -//#include -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Common/interface/TriggerNames.h" -#include "DataFormats/Common/interface/TriggerResults.h" -#include "DataFormats/VertexReco/interface/Vertex.h" -#include "DataFormats/RecoCandidate/interface/RecoCandidate.h" - -#include "FWCore/Framework/interface/ConsumesCollector.h" -#include "FWCore/Framework/interface/EDConsumerBase.h" -/*Originally from DQM/Physics package, written by Roger Wolf and Jeremy Andrea*/ -/** - \fn acceptTopHLTDQMHelpers.h "HLTriggerOffline/Top/interface/TopHLTDQMHelpers.h" - - \brief Helper function to determine trigger accepts. - - Helper function to determine trigger accept for given TriggerResults and - a given TriggerPath(s). -*/ - -inline bool -acceptHLT(const edm::Event& event, const edm::TriggerResults& triggerTable, const std::string& triggerPath) -{ - bool passed=false; - const edm::TriggerNames& triggerNames = event.triggerNames(triggerTable); - for(unsigned int i=0; i& triggerPaths) -{ - bool passed=false; - for(unsigned int j=0; j& jets); - /// calculate top quark mass estimate - double massTopQuark(const std::vector& jets); - /// calculate W boson transverse mass estimate -/* double tmassWBoson(const T& mu, const reco::CaloMET& met, const reco::Jet& b); - /// calculate top quark transverse mass estimate - double tmassTopQuark(const T& mu, const reco::CaloMET& met, const reco::Jet& b); - /// calculate mlb estimate - double masslb(const T& mu, const reco::CaloMET& met, const reco::Jet& b);*/ - - /// calculate W boson transverse mass estimate - double tmassWBoson(reco::RecoCandidate* mu, const reco::MET& met, const reco::Jet& b); - /// calculate top quark transverse mass estimate - double tmassTopQuark(reco::RecoCandidate* mu, const reco::MET& met, const reco::Jet& b); - /// calculate mlb estimate - double masslb(reco::RecoCandidate* mu, const reco::MET& met, const reco::Jet& b); - - private: - /// do the calculation; this is called only once per event by the first - /// function call to return a mass estimate. The once calculated values - /// are cached afterwards - void operator()(const std::vector& jets); - void operator()(const reco::Jet& bJet, reco::RecoCandidate* lepton, const reco::MET& met); - private: - /// indicate failed associations - bool failed_; - /// max. number of jets to be considered - int maxNJets_; - /// paramater of the w boson mass - double wMass_; - /// cache of w boson mass estimate - double massWBoson_; - /// cache of top quark mass estimate - double massTopQuark_; - /// cache of W boson transverse mass estimate - double tmassWBoson_; - /// cache of top quark transverse mass estimate - double tmassTopQuark_; - /// cache of mlb estimate - double mlb_; - - -}; - - -#include "DataFormats/JetReco/interface/JetID.h" -#include "DataFormats/JetReco/interface/PFJet.h" -#include "DataFormats/JetReco/interface/CaloJet.h" -#include "DataFormats/BTauReco/interface/JetTag.h" -#include "DataFormats/Common/interface/ValueMap.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "JetMETCorrections/Objects/interface/JetCorrector.h" -#include "DataFormats/EgammaCandidates/interface/GsfElectron.h" -#include "CommonTools/Utils/interface/StringCutObjectSelector.h" -#include "JetMETCorrections/Objects/interface/JetCorrectionsRecord.h" -#include "DataFormats/RecoCandidate/interface/RecoCandidate.h" - -/** - \class SelectionStep TopHLTDQMHelpers.h "HLTriggerOffline/Top/interface/TopHLTDQMHelpers.h" - - \brief Templated helper class to allow a selection on a certain object collection. - - Templated helper class to allow a selection on a certain object collection, which may - be monitored by a separate class afterwards. The class wraps and slightly extends the - features of the StringCutParser to allow also to apply event based selections, according - to a minimal or maximal number of elements in the collection after the object selection - has been applied. It takes an edm::ParameterSet in the constructor, which should contain - the following elements: - - - src : the input collection (mandatory). - - select : the selection string (mandatory). - - min : whether there is a min value on which to reject the whole event after - the selection (optional). - - max : whether there is a max value on which to reject the whole event after - the selection (optional). - - electronId : input tag of an electronId association map and selection pattern - (optional). - - jetCorrector : label of jet corrector (optional). - - jetBTagger : parameters defining the btag algorithm and working point of choice - (optional). - - jetID : parameters defining the jetID value map and selection (optional). - - - The parameters _src_ and _select_ are mandatory. The parameters _min_ and _max_ are - optional. The parameters _electronId_ and _jetCorrector_ are optional. They are added - to keep the possibility to apply selections on id'ed electrons or on corrected jets. - They may be omitted in the PSet for simplification reasons if not needed at any time. - They are not effiective for other object collections but electrons or jets. If none - of the two parameters _min_ or _max_ is found in the event the select function returns - true if at least one object fullfilled the requirements. - - The class has one template value, which is the object collection to apply the selection - on. This has to be parsed to the StringCutParser class. The function select is overrided - for jets to circumvent problems with the template specialisation. Note that for MET not - type1 or muon corrections are supported on reco candidates. -*/ - -template -class SelectionStepHLT { -public: - /// default constructor - SelectionStepHLT(const edm::ParameterSet& cfg, edm::ConsumesCollector && iC); - /// default destructor - ~SelectionStepHLT(){}; - - /// apply selection - bool select(const edm::Event& event); - /// apply selection override for jets - bool select(const edm::Event& event, const edm::EventSetup& setup); - bool selectVertex(const edm::Event& event); -private: - /// input collection - edm::InputTag src_; - edm::EDGetTokenT< edm::View > srcToken_; - /// min/max for object multiplicity - int min_, max_; - /// electronId label as extra selection type - edm::InputTag electronId_; - edm::EDGetTokenT< edm::ValueMap > electronIdToken_; - /// electronId pattern we expect the following pattern: - /// 0: fails - /// 1: passes electron ID only - /// 2: passes electron Isolation only - /// 3: passes electron ID and Isolation only - /// 4: passes conversion rejection - /// 5: passes conversion rejection and ID - /// 6: passes conversion rejection and Isolation - /// 7: passes the whole selection - /// As described on https://twiki.cern.ch/twiki/bin/view/CMS/SimpleCutBasedEleID - int eidPattern_; - /// jet corrector as extra selection type - std::string jetCorrector_; - /// choice for b-tag as extra selection type - edm::InputTag btagLabel_; - edm::EDGetTokenT btagToken_; - /// choice of b-tag working point as extra selection type - double btagWorkingPoint_; - /// jetID as an extra selection type - edm::InputTag jetIDLabel_; - edm::EDGetTokenT jetIDToken_; - - edm::InputTag pvs_; - edm::EDGetTokenT > pvsToken_; - - /// string cut selector - StringCutObjectSelector select_; - /// selection string on the jetID - StringCutObjectSelector* jetIDSelect_; -}; - -/// default constructor -template -SelectionStepHLT::SelectionStepHLT(const edm::ParameterSet& cfg, edm::ConsumesCollector && iC) : - src_( cfg.getParameter( "src" )), - select_( cfg.getParameter("select")), - jetIDSelect_(0) -{ - srcToken_ = iC.consumes< edm::View >(cfg.getParameter("src")); - pvsToken_ = iC.consumes< edm::View >(cfg.getParameter("pvs")); - // construct min/max if the corresponding params - // exist otherwise they are initialized with -1 - cfg.exists("min") ? min_= cfg.getParameter("min") : min_= -1; - cfg.exists("max") ? max_= cfg.getParameter("max") : max_= -1; - // read electron extras if they exist - if(cfg.existsAs("electronId")){ - edm::ParameterSet elecId=cfg.getParameter("electronId"); - electronId_= elecId.getParameter("src"); - electronIdToken_= iC.consumes< edm::ValueMap >(elecId.getParameter("src")); - eidPattern_= elecId.getParameter("pattern"); - } - // read jet corrector label if it exists - if(cfg.exists("jetCorrector")){ jetCorrector_= cfg.getParameter("jetCorrector"); } - // read btag information if it exists - if(cfg.existsAs("jetBTagger")){ - edm::ParameterSet jetBTagger=cfg.getParameter("jetBTagger"); - btagLabel_=jetBTagger.getParameter("label"); - btagToken_= iC.consumes(jetBTagger.getParameter("label")); - btagWorkingPoint_=jetBTagger.getParameter("workingPoint"); - } - // read jetID information if it exists - if(cfg.existsAs("jetID")){ - edm::ParameterSet jetID=cfg.getParameter("jetID"); - jetIDLabel_ =jetID.getParameter("label"); - jetIDToken_= iC.consumes(jetID.getParameter("label")); - jetIDSelect_= new StringCutObjectSelector(jetID.getParameter("select")); - } -} - -/// apply selection -template -bool SelectionStepHLT::select(const edm::Event& event) -{ - // fetch input collection - edm::Handle > src; - if( !event.getByToken(srcToken_, src) ) return false; - - // load electronId value map if configured such - edm::Handle > electronId; - if(!electronId_.label().empty()) { - if( !event.getByToken(electronIdToken_, electronId) ) return false; - } - - // determine multiplicity of selected objects - int n=0; - for(typename edm::View::const_iterator obj=src->begin(); obj!=src->end(); ++obj){ - // special treatment for electrons - if(dynamic_cast(&*obj)){ - unsigned int idx = obj-src->begin(); - if( electronId_.label().empty() ? true : ((int)(*electronId)[src->refAt(idx)] & eidPattern_) ){ - if(select_(*obj))++n; - } - } - // normal treatment - else{ - if(select_(*obj))++n; - } - } - bool accept=(min_>=0 ? n>=min_:true) && (max_>=0 ? n<=max_:true); - return (min_<0 && max_<0) ? (n>0):accept; -} -template -bool SelectionStepHLT::selectVertex(const edm::Event& event) -{ - // fetch input collection - edm::Handle > src; - if( !event.getByToken(srcToken_, src) ) return false; - - // load electronId value map if configured such - edm::Handle > electronId; - if(!electronId_.label().empty()) { - if( !event.getByToken(electronIdToken_, electronId) ) return false; - } - - // determine multiplicity of selected objects - int n=0; - for(typename edm::View::const_iterator obj=src->begin(); obj!=src->end(); ++obj){ - - if(select_(*obj))++n; - } - bool accept=(min_>=0 ? n>=min_:true) && (max_>=0 ? n<=max_:true); - return (min_<0 && max_<0) ? (n>0):accept; -} - -/// apply selection (w/o using the template class Object), override for jets -template -bool SelectionStepHLT::select(const edm::Event& event, const edm::EventSetup& setup) -{ - // fetch input collection - edm::Handle > src; - if( !event.getByToken(srcToken_, src) ) return false; - - // load btag collection if configured such - // NOTE that the JetTagCollection needs an - // edm::View to reco::Jets; we have to add - // another Handle bjets for this purpose - edm::Handle > bjets; - edm::Handle btagger; - edm::Handle > pvertex; - if(!btagLabel_.label().empty()){ - if( !event.getByToken(srcToken_, bjets) ) return false; - if( !event.getByToken(btagToken_, btagger) ) return false; - if( !event.getByToken(pvsToken_, pvertex) ) return false; - } - - // load jetID value map if configured such - edm::Handle jetID; - if(jetIDSelect_){ - if( !event.getByToken(jetIDToken_, jetID) ) return false; - - } - - // load jet corrector if configured such - const JetCorrector* corrector=0; - if(!jetCorrector_.empty()){ - // check whether a jet correcto is in the event setup or not - if(setup.find( edm::eventsetup::EventSetupRecordKey::makeKey() )){ - corrector = JetCorrector::getJetCorrector(jetCorrector_, setup); - } - else{ - edm::LogVerbatim( "TopDQMHelpers" ) - << "\n" - << "------------------------------------------------------------------------------------- \n" - << " No JetCorrectionsRecord available from EventSetup: \n" - << " - Jets will not be corrected. \n" - << " - If you want to change this add the following lines to your cfg file \n" - << " \n" - << " ## load jet corrections \n" - << " process.load(\"JetMETCorrections.Configuration.JetCorrectionServicesAllAlgos_cff\") \n" - << " process.prefer(\"ak5CaloL2L3\") \n" - << " \n" - << "------------------------------------------------------------------------------------- \n"; - } - } - // determine multiplicity of selected objects - int n=0; - for(typename edm::View::const_iterator obj=src->begin(); obj!=src->end(); ++obj){ - // check for chosen btag discriminator to be above the - // corresponding working point if configured such - unsigned int idx = obj-src->begin(); - if( btagLabel_.label().empty() ? true : (*btagger)[bjets->refAt(idx)]>btagWorkingPoint_ ){ - bool passedJetID=true; - // check jetID for calo jets - if( jetIDSelect_ && dynamic_cast(src->refAt(idx).get())){ - passedJetID=(*jetIDSelect_)((*jetID)[src->refAt(idx)]); - } - if(passedJetID){ - // scale jet energy if configured such - Object jet=*obj; jet.scaleEnergy(corrector ? corrector->correction(*obj) : 1.); - if(select_(jet))++n; - } - } - } - bool accept=(min_>=0 ? n>=min_:true) && (max_>=0 ? n<=max_:true); - return (min_<0 && max_<0) ? (n>0):accept; -} - -#endif diff --git a/HLTriggerOffline/Top/interface/TopSingleLeptonHLTValidation.h b/HLTriggerOffline/Top/interface/TopSingleLeptonHLTValidation.h new file mode 100644 index 0000000000000..cc4b84a765a36 --- /dev/null +++ b/HLTriggerOffline/Top/interface/TopSingleLeptonHLTValidation.h @@ -0,0 +1,168 @@ +// -*- C++ -*- +// +// Package: HLTriggerOffline/Top +// Class: TopSingleLeptonHLTValidation +// +/**\class TopSingleLeptonHLTValidation TopSingleLeptonHLTValidation.h HLTriggerOffline/Top/interface/TopSingleLeptonHLTValidation.h + + Description: compute efficiencies of trigger paths on offline reco selection with respect to pt and eta + + Implementation: + harvesting +*/ +// +// Original Author: Elvire Bouvier +// Created: Thu, 16 Jan 2014 16:27:35 GMT +// +// +#ifndef TOPSINGLELEPTONHLTVALIDATION +#define TOPSINGLELEPTONHLTVALIDATION + +// system include files +#include + +// user include files +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/EDAnalyzer.h" + +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/MakerMacros.h" + +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ServiceRegistry/interface/Service.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" + +#include "DQMServices/Core/interface/DQMStore.h" +#include "DQMServices/Core/interface/MonitorElement.h" + +#include "DataFormats/EgammaCandidates/interface/GsfElectron.h" +#include "DataFormats/MuonReco/interface/Muon.h" +#include "DataFormats/JetReco/interface/Jet.h" +#include "HLTrigger/HLTcore/interface/HLTConfigProvider.h" +#include "DataFormats/Common/interface/TriggerResults.h" +#include "TH1.h" + +// +// class declaration +// + +class TopSingleLeptonHLTValidation : public edm::EDAnalyzer { + public: + explicit TopSingleLeptonHLTValidation(const edm::ParameterSet&); + ~TopSingleLeptonHLTValidation(); + + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + + + private: + virtual void beginJob() override; + virtual void analyze(const edm::Event&, const edm::EventSetup&) override; + virtual void endJob() override; + + //virtual void beginRun(edm::Run const&, edm::EventSetup const&) override; + virtual void endRun(edm::Run const&, edm::EventSetup const&) override; + //virtual void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override; + //virtual void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override; + + // ----------member data --------------------------- + // DQM + DQMStore* dbe_; + std::string sDir_; + MonitorElement* hEffLeptonPt; + MonitorElement* hEffLeptonEta; + MonitorElement* hEffJetPt; + MonitorElement* hEffJetEta; + // Electrons + const reco::GsfElectron *elec_; + std::string sElectrons_; + edm::EDGetTokenT< edm::View > tokElectrons_; + double ptElectrons_; + double etaElectrons_; + double isoElectrons_; + unsigned int minElectrons_; + // Muons + const reco::Muon *mu_; + std::string sMuons_; + edm::EDGetTokenT< edm::View > tokMuons_; + double ptMuons_; + double etaMuons_; + double isoMuons_; + unsigned int minMuons_; + // Jets + const reco::Jet *jet_; + std::string sJets_; + edm::EDGetTokenT< edm::View > tokJets_; + double ptJets_; + double etaJets_; + unsigned int minJets_; + // Trigger + std::string sTrigger_; + edm::EDGetTokenT tokTrigger_; + std::vector vsPaths_; + // Histos + bool isAll_ = false; + TH1F *hDenLeptonPt = new TH1F("PtLeptonAll", "PtLeptonAll", 50, 0., 250.); + TH1F *hDenLeptonEta = new TH1F("EtaLeptonAll", "EtaLeptonAll", 30, -3. , 3.); + TH1F *hDenJetPt = new TH1F("PtLastJetAll", "PtLastJetAll", 60, 0., 300.); + TH1F *hDenJetEta = new TH1F("EtaLastJetAll", "EtaLastJetAll", 30, -3., 3.); + bool isSel_ = false; + TH1F *hNumLeptonPt = new TH1F("PtLeptonSel", "PtLeptonSel", 50, 0., 250.); + TH1F *hNumLeptonEta = new TH1F("EtaLeptonSel", "EtaLeptonSel", 30, -3. , 3.); + TH1F *hNumJetPt = new TH1F("PtLastJetSel", "PtLastJetSel", 60, 0., 300.); + TH1F *hNumJetEta = new TH1F("EtaLastJetSel", "EtaLastJetSel", 30, -3., 3.); +}; + +// +// constants, enums and typedefs +// + +// +// static data member definitions +// + +// +// constructors and destructor +// +TopSingleLeptonHLTValidation::TopSingleLeptonHLTValidation(const edm::ParameterSet& iConfig) : + sDir_(iConfig.getUntrackedParameter("sDir","HLTValidation/Top/Efficiencies/")), + sElectrons_(iConfig.getUntrackedParameter("sElectrons","gsfElectrons")), + ptElectrons_(iConfig.getUntrackedParameter("ptElectrons",0.)), + etaElectrons_(iConfig.getUntrackedParameter("etaElectrons",0.)), + isoElectrons_(iConfig.getUntrackedParameter("isoElectrons",0.)), + minElectrons_(iConfig.getUntrackedParameter("minElectrons",0)), + sMuons_(iConfig.getUntrackedParameter("sMuons","muons")), + ptMuons_(iConfig.getUntrackedParameter("ptMuons",0.)), + etaMuons_(iConfig.getUntrackedParameter("etaMuons",0.)), + isoMuons_(iConfig.getUntrackedParameter("isoMuons",0.)), + minMuons_(iConfig.getUntrackedParameter("minMuons",0)), + sJets_(iConfig.getUntrackedParameter("sJets","ak5PFJets")), + ptJets_(iConfig.getUntrackedParameter("ptJets",0.)), + etaJets_(iConfig.getUntrackedParameter("etaJets",0.)), + minJets_(iConfig.getUntrackedParameter("minJets",0)), + sTrigger_(iConfig.getUntrackedParameter("sTrigger","TriggerResults")), + vsPaths_(iConfig.getUntrackedParameter< std::vector >("vsPaths")) + +{ + dbe_ = edm::Service().operator->(); + // Electrons + tokElectrons_ = consumes< edm::View >(edm::InputTag(sElectrons_)); + // Muons + tokMuons_ = consumes< edm::View >(edm::InputTag(sMuons_)); + // Jets + tokJets_ = consumes< edm::View >(edm::InputTag(sJets_)); + // Trigger + tokTrigger_ = consumes(edm::InputTag(sTrigger_)); +} + + +TopSingleLeptonHLTValidation::~TopSingleLeptonHLTValidation() +{ + + // do anything here that needs to be done at desctruction time + // (e.g. close files, deallocate resources etc.) + +} +#endif + +//define this as a plug-in +DEFINE_FWK_MODULE(TopSingleLeptonHLTValidation); diff --git a/HLTriggerOffline/Top/interface/TopValidation.h b/HLTriggerOffline/Top/interface/TopValidation.h deleted file mode 100644 index d5cd826a071db..0000000000000 --- a/HLTriggerOffline/Top/interface/TopValidation.h +++ /dev/null @@ -1,238 +0,0 @@ - -#ifndef HLTriggerOffline_TopValidation_H -#define HLTriggerOffline_TopValidation_H - - -// system include files -#include -#include - -// user include files -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/MakerMacros.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -#include "DataFormats/Common/interface/Ref.h" -#include "DataFormats/Common/interface/DetSetVector.h" -#include "DataFormats/Candidate/interface/Candidate.h" -#include "DataFormats/JetReco/interface/Jet.h" -#include "DataFormats/JetReco/interface/CaloJetCollection.h" -#include "DataFormats/TrackReco/interface/Track.h" -#include "DataFormats/TrackReco/interface/TrackExtra.h" -//#include "DataFormats/CaloTowers/interface/CaloTowerCollection.h" - -#include "DataFormats/MuonReco/interface/MuonFwd.h" -#include "DataFormats/MuonReco/interface/Muon.h" -/*#include "DataFormats/METReco/interface/MET.h" -#include "DataFormats/METReco/interface/CaloMETCollection.h" -#include "DataFormats/METReco/interface/GenMET.h" -#include "DataFormats/METReco/interface/GenMETCollection.h" */ - -//#include "SimDataFormats/HepMCProduct/interface/HepMCProduct.h" - -#include -#include "DataFormats/Candidate/interface/Candidate.h" -#include "DataFormats/RecoCandidate/interface/RecoCandidate.h" - - - -//#include "DataFormats/VertexReco/interface/Vertex.h" -//#include "RecoVertex/PrimaryVertexProducer/interface/PrimaryVertexSorter.h" -#include "DataFormats/Common/interface/Handle.h" -#include "DataFormats/Common/interface/TriggerResults.h" -#include "DataFormats/Common/interface/RefToBase.h" -#include "HLTrigger/HLTfilters/interface/HLTHighLevel.h" -#include "DataFormats/EgammaCandidates/interface/GsfElectron.h" -#include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h" - -#include "DataFormats/EgammaCandidates/interface/Electron.h" -#include "DataFormats/EgammaCandidates/interface/ElectronFwd.h" -#include "DataFormats/EgammaReco/interface/SuperCluster.h" -#include "DataFormats/EgammaReco/interface/BasicCluster.h" -#include "DataFormats/EgammaReco/interface/BasicClusterFwd.h" - -#include "FWCore/ServiceRegistry/interface/Service.h" -//#include "PhysicsTools/UtilAlgos/interface/TFileService.h" - - -//Include DQM core -#include "DQMServices/Core/interface/DQMStore.h" -#include "DQMServices/Core/interface/MonitorElement.h" - - -#include "TH1F.h" -#include "TVector3.h" -#include "TLorentzVector.h" -#include -#include -#include -#include -#include -#include "TFile.h" - - - -class TH1F; - -// -// class decleration -// - -class TopValidation : public edm::EDAnalyzer { -public: - explicit TopValidation(const edm::ParameterSet&); - ~TopValidation(); - - -private: - virtual void beginJob() ; - virtual void analyze(const edm::Event&, const edm::EventSetup&); - virtual void endJob() ; - - // edm::Service fs; - - - // ----------member data --------------------------- - - std::string fOutputFileName ; - - std::string outFile_, outputFileName; - - bool outputMEsInRootFile; - - edm::InputTag offlineElectrons; - - edm::ParameterSet parameters; - - DQMStore* dbe; - - ///// eta and pt histos //// - - // semimu events - - MonitorElement* eta_off_mu; - MonitorElement* pt_off_mu; - - - // dimu events - - MonitorElement* eta_off_dimu1; - MonitorElement* pt_off_dimu1; - MonitorElement* eta_off_dimu2; - MonitorElement* pt_off_dimu2; - -// semiel events - - MonitorElement* eta_off_el; - MonitorElement* pt_off_el; - - - //diel events - - MonitorElement* eta_off_diel1; - MonitorElement* pt_off_diel1; - MonitorElement* eta_off_diel2; - MonitorElement* pt_off_diel2; - - // emu events - - MonitorElement* eta_off_emu_muon; - MonitorElement* pt_off_emu_muon; - MonitorElement* eta_off_emu_electron; - MonitorElement* pt_off_emu_electron; - - - //// 4jets + 1muon eff monitoring - MonitorElement* ptmuon_4jet1muSel; - MonitorElement* etamuon_4jet1muSel; - MonitorElement* Njets_4jet1muSel; - MonitorElement* ptmuon_4jet1muSel_hltmu9; - MonitorElement* etamuon_4jet1muSel_hltmu9; - MonitorElement* Njets_4jet1muSel_hltmu9; - -////////////////// - - MonitorElement* h_ptmu1_trig[100]; - MonitorElement* h_etamu1_trig[100]; - MonitorElement* h_ptel1_trig[100]; - MonitorElement* h_etael1_trig[100]; - - MonitorElement* h_ptmu1_trig_dimu[100]; - MonitorElement* h_etamu1_trig_dimu[100]; - MonitorElement* h_ptel1_trig_diel[100]; - MonitorElement* h_etael1_trig_diel[100]; - - MonitorElement* h_ptmu1_trig_em[100]; - MonitorElement* h_etamu1_trig_em[100]; - MonitorElement* h_ptel1_trig_em[100]; - MonitorElement* h_etael1_trig_em[100]; - - /***********/ - - MonitorElement* hlt_bitmu_hist_reco ; - MonitorElement* h_mu_reco; - MonitorElement* hlt_bitmu_hist_gen ; - MonitorElement* h_mu_gen; - - MonitorElement* h_jet_reco; - MonitorElement* hlt_bitjet_hist_reco; - - MonitorElement* h_jet_reco_el; - MonitorElement* hlt_bitjet_hist_reco_el; - - MonitorElement* h_jet_gen; - MonitorElement* hlt_bitjet_hist_gen; - - MonitorElement* h_jet_gen_el; - MonitorElement* hlt_bitjet_hist_gen_el; - - MonitorElement* hlt_bitel_hist_reco; - MonitorElement* h_el_reco; - MonitorElement* hlt_bitel_hist_gen; - MonitorElement* h_el_gen; - - MonitorElement* et_off_jet_mu; - MonitorElement* eta_off_jet_mu; - MonitorElement* njets_off_mu; - MonitorElement* et_off_jet_el; - MonitorElement* eta_off_jet_el; - MonitorElement* njets_off_el; - MonitorElement* h_etjet1_trig_mu[100]; - MonitorElement* h_etajet1_trig_mu[100]; - MonitorElement* h_etjet1_trig_el[100]; - MonitorElement* h_etajet1_trig_el[100]; - - MonitorElement* events_acc_off_electron; - MonitorElement* events_acc_off_muon; - - - - - edm::InputTag inputTag_; - std::vector hlt_bitnames; - std::vector hlt_bitnamesMu; - std::vector hlt_bitnamesEg; - std::vector hlt_bitnamesJet; - - - //Just a tag for better file organization - std::string triggerTag_; - - - // Top folder in root file - std::string FolderName_; - std::stringstream topFolder; - - edm::EDGetTokenT muonsToken_; - edm::EDGetTokenT ctfWithMaterialTracksToken_; - edm::EDGetTokenT iterativeCone5CaloJetsToken_; - edm::EDGetTokenT offlineElectronsToken_; - edm::EDGetTokenT inputTagToken_; - edm::EDGetTokenT genParticlesToken_; - -}; - - -#endif diff --git a/HLTriggerOffline/Top/python/HLTTopPostVal_cff.py b/HLTriggerOffline/Top/python/HLTTopPostVal_cff.py deleted file mode 100644 index f3e695cbbf71b..0000000000000 --- a/HLTriggerOffline/Top/python/HLTTopPostVal_cff.py +++ /dev/null @@ -1,127 +0,0 @@ -import FWCore.ParameterSet.Config as cms -from HLTriggerOffline.Top.PostProcessor_cfi import * - -hltTopPostSemimu = HLTTopPostProcessor.clone() - -hltTopPostSemimu.subDirs = ['HLT/Top/Semileptonic_muon'] -hltTopPostSemimu.efficiency = ( - # "TrigEFF 'my title; my x-label; my y-label' pt_trig_off_mu pt_off_mu", - "EffVsPt_HLT_Mu9 'HLT_Mu9 ; p_{T #mu}; Trigger_Efficiency' Muon1Pt_M_HLT_Mu9 Muon1Pt_M", - "EffVsEta_HLT_Mu9 'HLT_Mu9 ; #eta_{#mu}; Trigger_Efficiency' Muon1Eta_M_HLT_Mu9 Muon1Eta_M", - "EffVsPt_HLT_Mu15 'HLT_Mu15 ; p_{T #mu}; Trigger_Efficiency' Muon1Pt_M_HLT_Mu15 Muon1Pt_M", - "EffVsEta_HLT_Mu15 'HLT_Mu15 ; #eta_{#mu}; Trigger_Efficiency' Muon1Eta_M_HLT_Mu15 Muon1Eta_M", - "EffVsPt_HLT_IsoMu9 'HLT_IsoMu9 ; p_{T #mu}; Trigger_Efficiency' Muon1Pt_M_HLT_IsoMu9 Muon1Pt_M", - "EffVsEta_HLT_IsoMu9 'HLT_IsoMu9 ; #eta_{#mu}; Trigger_Efficiency' Muon1Eta_M_HLT_IsoMu9 Muon1Eta_M", - - "Efficiencies_MuonTriggers_gen 'HLT efficiency wrt mc acceptance ; ; Trigger Efficiency' genmuHLT genMuonEvents", - "Efficiencies_MuonTriggers 'HLT efficiency wrt acc+offline ; ; Trigger Efficiency' muHLT MuonEvents", - - ) - -hltTopPostSemiel = HLTTopPostProcessor.clone() - -hltTopPostSemiel.subDirs = ['HLT/Top/Semileptonic_electron'] -hltTopPostSemiel.efficiency = ( - # "TrigEFF 'my title; my x-label; my y-label' pt_trig_off_mu pt_off_mu", - "EffVsPt_HLT_Ele15_SW_L1R 'HLT_Ele15_SW_L1R ; p_{T e}; Trigger_Efficiency' Electron1Pt_E_HLT_Ele15_SW_L1R Electron1Pt_E", - "EffVsEta_HLT_Ele15_SW_L1R 'HLT_Ele15_SW_L1R ; #eta_{e}; Trigger_Efficiency' Electron1Eta_E_HLT_Ele15_SW_L1R Electron1Eta_E", - "EffVsPt_HLT_Ele15_SW_LooseTrackIso_L1R 'HLT_Ele15_SW_LooseTrackIso_L1R ; p_{T e}; Trigger_Efficiency' Electron1Pt_E_HLT_Ele15_SW_LooseTrackIso_L1R Electron1Pt_E", - "EffVsEta_HLT_Ele15_SW_LooseTrackIso_L1R 'HLT_Ele15_SW_LooseTrackIso_L1R ; #eta_{e}; Trigger_Efficiency' Electron1Eta_E_HLT_Ele15_SW_LooseTrackIso_L1R Electron1Eta_E", - - "Efficiencies_Electrontriggers 'HLT efficiency wrt acc+offline ; ; Trigger Efficiency' elHLT ElectronEvents", - "Efficiencies_Electrontriggers_gen 'HLT efficiency wrt mc acceptance ; ; Trigger Efficiency' genelHLT genElectronEvents" - #### - ) - - ################## - -hltTopPostDimu = HLTTopPostProcessor.clone() - -hltTopPostDimu.subDirs = ['HLT/Top/Dileptonic_muon'] -hltTopPostDimu.efficiency = ( - # "TrigEFF 'my title; my x-label; my y-label' pt_trig_off_mu pt_off_mu", - "EffVsPt_HLT_Mu9_MM 'HLT_Mu9 ; p_{T #mu 1}; Trigger_Efficiency' Muon1Pt_MM_HLT_Mu9 Muon1Pt_MM", - "EffVsEta_HLT_Mu9_MM 'HLT_Mu9 ; #eta_{#mu 1}; Trigger_Efficiency' Muon1Eta_MM_HLT_Mu9 Muon1Eta_MM", - "EffVsPt_HLT_Mu15_MM 'HLT_Mu15 ; p_{T #mu 1}; Trigger_Efficiency' Muon1Pt_MM_HLT_Mu15 Muon1Pt_MM", - "EffVsEta_HLT_Mu15_MM 'HLT_Mu15 ; #eta_{#mu 1}; Trigger_Efficiency' Muon1Eta_MM_HLT_Mu15 Muon1Eta_MM", - "EffVsPt_HLT_IsoMu9_MM 'HLT_IsoMu9 ; p_{T #mu 1}; Trigger_Efficiency' Muon1Pt_MM_HLT_IsoMu9 Muon1Pt_MM", - "EffVsEta_HLT_IsoMu9_MM 'HLT_IsoMu9 ; #eta_{#mu 1}; Trigger_Efficiency' Muon1Eta_MM_HLT_IsoMu9 Muon1Eta_MM", - "EffVsPt_HLT_DoubleMu3_MM 'HLT_DoubleMu3 ; p_{T #mu 1}; Trigger_Efficiency' Muon1Pt_MM_HLT_DoubleMu3 Muon1Pt_MM", - "EffVsEta_HLT_DoubleMu3_MM 'HLT_DoubleMu3 ; #eta_{#mu 1}; Trigger_Efficiency' Muon1Eta_MM_HLT_DoubleMu3 Muon1Eta_MM", - - ) - -hltTopPostDiel = HLTTopPostProcessor.clone() - -hltTopPostDiel.subDirs = ['HLT/Top/Dileptonic_electron'] -hltTopPostDiel.efficiency = ( - # "TrigEFF 'my title; my x-label; my y-label' pt_trig_off_mu pt_off_mu", - "EffVsPt_HLT_Ele15_SW_L1R_EE 'HLT_Ele15_SW_L1R ; p_{T e 1}; Trigger_Efficiency' Electron1Pt_EE_HLT_Ele15_SW_L1R Electron1Pt_EE", - "EffVsEta_HLT_Ele15_SW_L1R_EE 'HLT_Ele15_SW_L1R ; #eta_{e 1}; Trigger_Efficiency' Electron1Eta_EE_HLT_Ele15_SW_L1R Electron1Eta_EE", - "EffVsPt_HLT_Ele15_SW_LooseTrackIso_L1R_EE 'HLT_Ele15_SW_LooseTrackIso_L1R ; p_{T e 1}; Trigger_Efficiency' Electron1Pt_EE_HLT_Ele15_SW_LooseTrackIso_L1R Electron1Pt_EE", - "EffVsEta_HLT_Ele15_SW_LooseTrackIso_L1R_EE 'HLT_Ele15_SW_LooseTrackIso_L1R ; #eta_{e 1}; Trigger_Efficiency' Electron1Eta_EE_HLT_Ele15_SW_LooseTrackIso_L1R Electron1Eta_EE", - "EffVsPt_HLT_DoubleEle10_SW_L1R_EE 'HLT_DoubleEle10_SW_L1R ; p_{T e 1}; Trigger_Efficiency' Electron1Pt_EE_HLT_DoubleEle10_SW_L1R Electron1Pt_EE", - "EffVsEta_HLT_DoubleEle10_SW_L1R_EE 'HLT_DoubleEle10_SW_L1R ; #eta_{e 1}; Trigger_Efficiency' Electron1Eta_EE_HLT_DoubleEle10_SW_L1R Electron1Eta_EE", - - ) - -hltTopPostEmu = HLTTopPostProcessor.clone() - -hltTopPostEmu.subDirs = ['HLT/Top/Dileptonic_emu'] -hltTopPostEmu.efficiency = ( - # "TrigEFF 'my title; my x-label; my y-label' pt_trig_off_mu pt_off_mu", - "EffVsPt_HLT_Mu9_EM 'HLT_Mu9 ; p_{T #mu }; Trigger_Efficiency' Muon1Pt_EM_HLT_Mu9 Muon1Pt_EM", - "EffVsEta_HLT_Mu9_EM 'HLT_Mu9 ; #eta_{#mu }; Trigger_Efficiency' Muon1Eta_EM_HLT_Mu9 Muon1Eta_EM", - "EffVsPt_HLT_Mu15_EM 'HLT_Mu15 ; p_{T #mu }; Trigger_Efficiency' Muon1Pt_EM_HLT_Mu15 Muon1Pt_EM", - "EffVsEta_HLT_Mu15_EM 'HLT_Mu15 ; #eta_{#mu }; Trigger_Efficiency' Muon1Eta_EM_HLT_Mu15 Muon1Eta_EM", - "EffVsPt_HLT_IsoMu9_EM 'HLT_IsoMu9 ; p_{T #mu }; Trigger_Efficiency' Muon1Pt_EM_HLT_IsoMu9 Muon1Pt_EM", - "EffVsEta_HLT_IsoMu9_EM 'HLT_IsoMu9 ; #eta_{#mu }; Trigger_Efficiency' Muon1Eta_EM_HLT_IsoMu9 Muon1Eta_EM", - "EffVsPt_HLT_Ele15_SW_L1R_EM 'HLT_Ele15_SW_L1R ; p_{T e }; Trigger_Efficiency' Electron1Pt_EM_HLT_Ele15_SW_L1R Electron1Pt_EM", - "EffVsEta_HLT_Ele15_SW_L1R_EM 'HLT_Ele15_SW_L1R ; #eta_{e }; Trigger_Efficiency' Electron1Eta_EM_HLT_Ele15_SW_L1R Electron1Eta_EM", - "EffVsPt_HLT_Ele15_SW_LooseTrackIso_L1R_EM 'HLT_Ele15_SW_LooseTrackIso_L1R ; p_{T e }; Trigger_Efficiency' Electron1Pt_EM_HLT_Ele15_SW_LooseTrackIso_L1R Electron1Pt_EM", - "EffVsEta_HLT_Ele15_SW_LooseTrackIso_L1R_EM 'HLT_Ele15_SW_LooseTrackIso_L1R ; #eta_{e }; Trigger_Efficiency' Electron1Eta_EM_HLT_Ele15_SW_LooseTrackIso_L1R Electron1Eta_EM", - - ) - -hltTopPostJet = HLTTopPostProcessor.clone() - -hltTopPostJet.subDirs = ['HLT/Top/Jets'] -hltTopPostJet.efficiency = ( - # "TrigEFF 'my title; my x-label; my y-label' pt_trig_off_mu pt_off_mu", - # "EffVsEt_HLT_QuadJet30 'HLT_QuadJet30 ; E_{T jet}; Trigger_Efficiency' Jet1Et_M_HLT_QuadJet30 Jet1Et_M", - "Efficiencies_jetTriggers_semimu 'HLT efficiency wrt acc+offline ; ; Trigger Efficiency' numer denom", - # "EffVsEta_HLT_QuadJet30 'HLT_QuadJet30 ; #eta_{ jet}; Trigger_Efficiency' Jet1Eta_M_HLT_QuadJet30 Jet1Eta_M", - - - "Efficiencies_jetTriggers_semiel 'HLT efficiency wrt acc+offline ; ; Trigger Efficiency' numer_el denom_el", - # "EffVsEt_HLT_QuadJet30_el 'HLT_QuadJet30 ; E_{T jet}; Trigger_Efficiency' Jet1Et_E_HLT_QuadJet30 Jet1Et_E", - # "EffVsEta_HLT_QuadJet30_el 'HLT_QuadJet30 ; #eta_{ jet}; Trigger_Efficiency' Jet1Eta_E_HLT_QuadJet30 Jet1Eta_M", - - ) - - -hltTopPost4Jets = HLTTopPostProcessor.clone() - -hltTopPost4Jets.subDirs = ['HLT/Top/4JetsPlus1MuonToCompareWithData'] -hltTopPost4Jets.efficiency = ( - # "TrigEFF 'my title; my x-label; my y-label' pt_trig_off_mu pt_off_mu", - "EffVsPt_HLTMu9_4Jets1MuonMon 'HLT_Mu9 ; p_{T #mu }; Trigger_Efficiency' Muon1Pt_4Jets1MuonHLTMu9Mon Muon1Pt_4Jets1MuonMon", - "EffVsEta_HLTMu9_4Jets1MuonMon 'HLT_Mu9 ; #eta_{#mu }; Trigger_Efficiency' Muon1Eta_4Jets1MuonHLTMu9Mon Muon1Eta_4Jets1MuonMon", - "EffVsNJets_HLTMu9_4Jets1MuonMon 'HLT_Mu9 ; Jet multiplicity; Trigger_Efficiency' NJets_4Jets1MuonHLTMu9Mon NJets_4Jets1MuonMon", - - ) - - - - - -HLTTopPostVal = cms.Sequence( - hltTopPostSemimu * - hltTopPostSemiel * - hltTopPostDimu * - hltTopPostDiel * - hltTopPostEmu * - hltTopPostJet * - hltTopPost4Jets - -) diff --git a/HLTriggerOffline/Top/python/HLTTopQualityTester_cfi.py b/HLTriggerOffline/Top/python/HLTTopQualityTester_cfi.py deleted file mode 100644 index d6b25fc44532c..0000000000000 --- a/HLTriggerOffline/Top/python/HLTTopQualityTester_cfi.py +++ /dev/null @@ -1,14 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -hltTopQualityTester = cms.EDAnalyzer("QualityTester", - qtList = cms.untracked.FileInPath( - 'HLTriggerOffline/Top/data/HLTTopQualityTest.xml' - ), - #reportThreshold = cms.untracked.string('black'), - prescaleFactor = cms.untracked.int32(1), - getQualityTestsFromFile = cms.untracked.bool(True), - qtestOnEndJob = cms.untracked.bool(True), - qtestOnEndLumi = cms.untracked.bool(False), - testInEventloop = cms.untracked.bool(False), - verboseQT = cms.untracked.bool(False) -) diff --git a/HLTriggerOffline/Top/python/PostProcessor_cfi.py b/HLTriggerOffline/Top/python/PostProcessor_cfi.py deleted file mode 100644 index 97bd60dc26ec0..0000000000000 --- a/HLTriggerOffline/Top/python/PostProcessor_cfi.py +++ /dev/null @@ -1,62 +0,0 @@ -import FWCore.ParameterSet.Config as cms - - -HLTTopPostProcessor = cms.EDAnalyzer("DQMGenericClient", - subDirs = cms.untracked.vstring('HLT/Top/'), - verbose = cms.untracked.uint32(0), # Set to 2 for all messages - outputFileName = cms.untracked.string(''), - commands = cms.vstring(''), - resolution = cms.vstring(''), - efficiency = cms.vstring( - # "TrigEFF 'my title; my x-label; my y-label' pt_trig_off_mu pt_off_mu", - "EffVsPt_HLT_Mu9 'HLT_Mu9 ; p_{T #mu}; Trigger_Efficiency' Muon1Pt_M_HLT_Mu9 Muon1Pt_M", - "EffVsEta_HLT_Mu9 'HLT_Mu9 ; #eta_{#mu}; Trigger_Efficiency' Muon1Eta_M_HLT_Mu9 Muon1Eta_M", - "EffVsPt_HLT_Mu15 'HLT_Mu15 ; p_{T #mu}; Trigger_Efficiency' Muon1Pt_M_HLT_Mu15 Muon1Pt_M", - "EffVsEta_HLT_Mu15 'HLT_Mu15 ; #eta_{#mu}; Trigger_Efficiency' Muon1Eta_M_HLT_Mu15 Muon1Eta_M", - "EffVsPt_HLT_IsoMu9 'HLT_IsoMu9 ; p_{T #mu}; Trigger_Efficiency' Muon1Pt_M_HLT_IsoMu9 Muon1Pt_M", - "EffVsEta_HLT_IsoMu9 'HLT_IsoMu9 ; #eta_{#mu}; Trigger_Efficiency' Muon1Eta_M_HLT_IsoMu9 Muon1Eta_M", - "EffVsPt_HLT_Ele15_SW_L1R 'HLT_Ele15_SW_L1R ; p_{T e}; Trigger_Efficiency' Electron1Pt_E_HLT_Ele15_SW_L1R Electron1Pt_E", - "EffVsEta_HLT_Ele15_SW_L1R 'HLT_Ele15_SW_L1R ; #eta_{e}; Trigger_Efficiency' Electron1Eta_E_HLT_Ele15_SW_L1R Electron1Eta_E", - "EffVsPt_HLT_Ele15_SW_LooseTrackIso_L1R 'HLT_Ele15_SW_LooseTrackIso_L1R ; p_{T e}; Trigger_Efficiency' Electron1Pt_E_HLT_Ele15_SW_LooseTrackIso_L1R Electron1Pt_E", - "EffVsEta_HLT_Ele15_SW_LooseTrackIso_L1R 'HLT_Ele15_SW_LooseTrackIso_L1R ; #eta_{e}; Trigger_Efficiency' Electron1Eta_E_HLT_Ele15_SW_LooseTrackIso_L1R Electron1Eta_E", - "EffVsPt_HLT_Mu9_MM 'HLT_Mu9 ; p_{T #mu 1}; Trigger_Efficiency' Muon1Pt_MM_HLT_Mu9 Muon1Pt_MM", - "EffVsEta_HLT_Mu9_MM 'HLT_Mu9 ; #eta_{#mu 1}; Trigger_Efficiency' Muon1Eta_MM_HLT_Mu9 Muon1Eta_MM", - "EffVsPt_HLT_Mu15_MM 'HLT_Mu15 ; p_{T #mu 1}; Trigger_Efficiency' Muon1Pt_MM_HLT_Mu15 Muon1Pt_MM", - "EffVsEta_HLT_Mu15_MM 'HLT_Mu15 ; #eta_{#mu 1}; Trigger_Efficiency' Muon1Eta_MM_HLT_Mu15 Muon1Eta_MM", - "EffVsPt_HLT_IsoMu9_MM 'HLT_IsoMu9 ; p_{T #mu 1}; Trigger_Efficiency' Muon1Pt_MM_HLT_IsoMu9 Muon1Pt_MM", - "EffVsEta_HLT_IsoMu9_MM 'HLT_IsoMu9 ; #eta_{#mu 1}; Trigger_Efficiency' Muon1Eta_MM_HLT_IsoMu9 Muon1Eta_MM", - "EffVsPt_HLT_DoubleMu3_MM 'HLT_DoubleMu3 ; p_{T #mu 1}; Trigger_Efficiency' Muon1Pt_MM_HLT_DoubleMu3 Muon1Pt_MM", - "EffVsEta_HLT_DoubleMu3_MM 'HLT_DoubleMu3 ; #eta_{#mu 1}; Trigger_Efficiency' Muon1Eta_MM_HLT_DoubleMu3 Muon1Eta_MM", - "EffVsPt_HLT_Ele15_SW_L1R_EE 'HLT_Ele15_SW_L1R ; p_{T e 1}; Trigger_Efficiency' Electron1Pt_EE_HLT_Ele15_SW_L1R Electron1Pt_EE", - "EffVsEta_HLT_Ele15_SW_L1R_EE 'HLT_Ele15_SW_L1R ; #eta_{e 1}; Trigger_Efficiency' Electron1Eta_EE_HLT_Ele15_SW_L1R Electron1Eta_EE", - "EffVsPt_HLT_Ele15_SW_LooseTrackIso_L1R_EE 'HLT_Ele15_SW_LooseTrackIso_L1R ; p_{T e 1}; Trigger_Efficiency' Electron1Pt_EE_HLT_Ele15_SW_LooseTrackIso_L1R Electron1Pt_EE", - "EffVsEta_HLT_Ele15_SW_LooseTrackIso_L1R_EE 'HLT_Ele15_SW_LooseTrackIso_L1R ; #eta_{e 1}; Trigger_Efficiency' Electron1Eta_EE_HLT_Ele15_SW_LooseTrackIso_L1R Electron1Eta_EE", - "EffVsPt_HLT_DoubleEle10_SW_L1R_EE 'HLT_DoubleEle10_SW_L1R ; p_{T e 1}; Trigger_Efficiency' Electron1Pt_EE_HLT_DoubleEle10_SW_L1R Electron1Pt_EE", - "EffVsEta_HLT_DoubleEle10_SW_L1R_EE 'HLT_DoubleEle10_SW_L1R ; #eta_{e 1}; Trigger_Efficiency' Electron1Eta_EE_HLT_DoubleEle10_SW_L1R Electron1Eta_EE", - "EffVsPt_HLT_Mu9_EM 'HLT_Mu9 ; p_{T #mu }; Trigger_Efficiency' Muon1Pt_EM_HLT_Mu9 Muon1Pt_EM", - "EffVsEta_HLT_Mu9_EM 'HLT_Mu9 ; #eta_{#mu }; Trigger_Efficiency' Muon1Eta_EM_HLT_Mu9 Muon1Eta_EM", - "EffVsPt_HLT_Mu15_EM 'HLT_Mu15 ; p_{T #mu }; Trigger_Efficiency' Muon1Pt_EM_HLT_Mu15 Muon1Pt_EM", - "EffVsEta_HLT_Mu15_EM 'HLT_Mu15 ; #eta_{#mu }; Trigger_Efficiency' Muon1Eta_EM_HLT_Mu15 Muon1Eta_EM", - "EffVsPt_HLT_IsoMu9_EM 'HLT_IsoMu9 ; p_{T #mu }; Trigger_Efficiency' Muon1Pt_EM_HLT_IsoMu9 Muon1Pt_EM", - "EffVsEta_HLT_IsoMu9_EM 'HLT_IsoMu9 ; #eta_{#mu }; Trigger_Efficiency' Muon1Eta_EM_HLT_IsoMu9 Muon1Eta_EM", - "EffVsPt_HLT_Ele15_SW_L1R_EM 'HLT_Ele15_SW_L1R ; p_{T e }; Trigger_Efficiency' Electron1Pt_EM_HLT_Ele15_SW_L1R Electron1Pt_EM", - "EffVsEta_HLT_Ele15_SW_L1R_EM 'HLT_Ele15_SW_L1R ; #eta_{e }; Trigger_Efficiency' Electron1Eta_EM_HLT_Ele15_SW_L1R Electron1Eta_EM", - "EffVsPt_HLT_Ele15_SW_LooseTrackIso_L1R_EM 'HLT_Ele15_SW_LooseTrackIso_L1R ; p_{T e }; Trigger_Efficiency' Electron1Pt_EM_HLT_Ele15_SW_LooseTrackIso_L1R Electron1Pt_EM", - "EffVsEta_HLT_Ele15_SW_LooseTrackIso_L1R_EM 'HLT_Ele15_SW_LooseTrackIso_L1R ; #eta_{e }; Trigger_Efficiency' Electron1Eta_EM_HLT_Ele15_SW_LooseTrackIso_L1R Electron1Eta_EM", - ##### - "Efficiencies_muontriggers 'HLT efficiency wrt offline ; eff ; Trigger Efficiency' muHLT MuonEvents", - - "Efficiencies_muontriggers_gen 'HLT efficiency wrt mc ; eff ; Trigger Efficiency' genmuHLT genMuonEvents", - #### - - - "Efficiencies_jettriggers_semimu 'HLT efficiency wrt offline ; eff ; Trigger Efficiency' numer denom", - - "Efficiencies_electrontriggers 'HLT efficiency wrt offline ; eff ; Trigger Efficiency' elHLT ElectronEvents", - - "Efficiencies_electrontriggers_gen 'HLT efficiency wrt mc ; eff ; Trigger Efficiency' genelHLT genElectronEvents" - #### - - ) -) - diff --git a/HLTriggerOffline/Top/python/singletopHLTEventDQM_cfi.py b/HLTriggerOffline/Top/python/singletopHLTEventDQM_cfi.py deleted file mode 100644 index 474ffbc0713ea..0000000000000 --- a/HLTriggerOffline/Top/python/singletopHLTEventDQM_cfi.py +++ /dev/null @@ -1,315 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -SingleTopSingleMuonTriggerDQM = cms.EDAnalyzer("TopHLTSingleLeptonDQM", - ## ------------------------------------------------------ - ## SETUP - ## - ## configuration of the MonitoringEnsemble(s) - ## [mandatory] : optional PSets may be omitted - ## - setup = cms.PSet( - ## sub-directory to write the monitor histograms to - ## [mandatory] : should not be changed w/o explicit - ## communication to TopCom! - directory = cms.string("HLTriggerOffline/SingleTop/SingleTopMuonTriggerDQM/"), - ## [mandatory] - sources = cms.PSet( - muons = cms.InputTag("muons"), - elecs = cms.InputTag("gedGsfElectrons"), - jets = cms.InputTag("ak5CaloJets"), - mets = cms.VInputTag("met", "tcMet", "pfMet"), - pvs = cms.InputTag("offlinePrimaryVertices") - - ), - ## [optional] : when omitted the verbosity level is set to STANDARD - monitoring = cms.PSet( - verbosity = cms.string("DEBUG") - ), - ## [optional] : when omitted all monitoring plots for primary vertices - ## will be filled w/o extras - pvExtras = cms.PSet( - ## when omitted electron plots will be filled w/o additional pre- - ## selection of the primary vertex candidates - select = cms.string("abs(x)<1. & abs(y)<1. & abs(z)<20. & tracksSize>3 & !isFake") - ), - ## [optional] : when omitted all monitoring plots for muons - ## will be filled w/o extras - muonExtras = cms.PSet( - ## when omitted muon plots will be filled w/o additional pre- - ## selection of the muon candidates - select = cms.string("pt>20 & abs(eta)<2.1 & isGlobalMuon & innerTrack.numberOfValidHits>10 & globalTrack.normalizedChi2>-1 & globalTrack.normalizedChi2<10 & (isolationR03.sumPt+isolationR03.emEt+isolationR03.hadEt)/pt<0.1"), - ## when omitted isolated muon multiplicity plot will be equi- - ## valent to inclusive muon multiplicity plot - isolation = cms.string("(isolationR03.sumPt+isolationR03.emEt+isolationR03.hadEt)/pt<0.1") - ), - ## [optional] : when omitted all monitoring plots for jets - ## will be filled w/o extras - jetExtras = cms.PSet( - ## when omitted monitor plots for pt will be filled from uncorrected - ## jets - jetCorrector = cms.string("ak5PFL2L3"), - ## when omitted monitor plots will be filled w/o additional cut on - ## jetID - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - ## when omitted no extra selection will be applied on jets before - ## filling the monitor histograms; if jetCorrector is present the - ## selection will be applied to corrected jets - select = cms.string("pt>30 & abs(eta)<4.5& emEnergyFraction>0.01"), - ## when omitted monitor histograms for b-tagging will not be filled - jetBTaggers = cms.PSet( - trackCountingEff = cms.PSet( - label = cms.InputTag("trackCountingHighEffBJetTags" ), - workingPoint = cms.double(1.25) - ), - trackCountingPur = cms.PSet( - label = cms.InputTag("trackCountingHighPurBJetTags" ), - workingPoint = cms.double(3.00) - ), - secondaryVertex = cms.PSet( - label = cms.InputTag("simpleSecondaryVertexHighEffBJetTags"), - workingPoint = cms.double(2.05) - ) - ), - ), - ## [optional] : when omitted no mass window will be applied - ## for the W mass before filling the event monitoring plots - massExtras = cms.PSet( - lowerEdge = cms.double( 70.), - upperEdge = cms.double(110.) - ), - ## [optional] : when omitted the monitoring plots for triggering - ## will be empty - triggerExtras = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - paths = cms.vstring(['HLT_Mu3:HLT_QuadJet15U', - 'HLT_Mu5:HLT_QuadJet15U', - 'HLT_Mu7:HLT_QuadJet15U', - 'HLT_Mu9:HLT_QuadJet15U', - 'HLT_Mu11:HLT_QuadJet15U']) - ) - ), - ## ------------------------------------------------------ - ## PRESELECTION - ## - ## setup of the event preselection, which will not - ## be monitored - ## [mandatory] : but may be empty - ## - preselection = cms.PSet( - trigger = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - select = cms.vstring(['HLT_Iso10Mu20_eta2p1_CentralCaloJet30_BTagIPIter_v1'])#ONLY ONE PATH - ), - ## [optional] : when omitted no preselection is applied - vertex = cms.PSet( - src = cms.InputTag("offlinePrimaryVertices"), - select = cms.string('abs(x)<1. & abs(y)<1. & abs(z)<20. & tracksSize>3 & !isFake') - ) - ), - ## ------------------------------------------------------ - ## SELECTION - ## - ## monitor histrograms are filled after each selection - ## step, the selection is applied in the order defined - ## by this vector - ## [mandatory] : may be empty or contain an arbitrary - ## number of PSets - selection = cms.VPSet( - cms.PSet( - label = cms.string("Hlt:step0"), - src = cms.InputTag(""), - select = cms.string(""), - min = cms.int32(0), - max = cms.int32(0), - ), - cms.PSet( - label = cms.string("muons:step1"), - src = cms.InputTag("muons"), - select = cms.string("pt>20 & abs(eta)<2.1 & isGlobalMuon & innerTrack.numberOfValidHits>10 & globalTrack.normalizedChi2>-1 & globalTrack.normalizedChi2<10 & (isolationR03.sumPt+isolationR03.emEt+isolationR03.hadEt)/pt<0.1"), - min = cms.int32(1), - max = cms.int32(1), - ), - cms.PSet( - label = cms.string("jets/calo:step2"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5PFL2L3"), - select = cms.string("pt>30 & abs(eta)<4.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(1), - ), - cms.PSet( - label = cms.string("jets/calo:step3"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5PFL2L3"), - select = cms.string("pt>30 & abs(eta)<4.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(2), - ), - ) -) - -SingleTopSingleElectronTriggerDQM = cms.EDAnalyzer("TopHLTSingleLeptonDQM", - ## ------------------------------------------------------ - ## SETUP - ## - ## configuration of the MonitoringEnsemble(s) - ## [mandatory] : optional PSets may be omitted - ## - setup = cms.PSet( - ## sub-directory to write the monitor histograms to - ## [mandatory] : should not be changed w/o explicit - ## communication to TopCom! - directory = cms.string("HLTriggerOffline/SingleTop/SingleTopElectronTriggerDQM/"), - ## [mandatory] - sources = cms.PSet( - muons = cms.InputTag("muons"), - elecs = cms.InputTag("gedGsfElectrons"), - jets = cms.InputTag("ak5CaloJets"), - mets = cms.VInputTag("met", "tcMet", "pfMet"), - pvs = cms.InputTag("offlinePrimaryVertices") - - ), - ## [optional] : when omitted the verbosity level is set to STANDARD - monitoring = cms.PSet( - verbosity = cms.string("DEBUG") - ), - ## [optional] : when omitted all monitoring plots for primary vertices - ## will be filled w/o extras - pvExtras = cms.PSet( - ## when omitted electron plots will be filled w/o additional pre- - ## selection of the primary vertex candidates - select = cms.string("abs(x)<1. & abs(y)<1. & abs(z)<20. & tracksSize>3 & !isFake") - ), - ## [optional] : when omitted all monitoring plots for muons - ## will be filled w/o extras - muonExtras = cms.PSet( - ## when omitted muon plots will be filled w/o additional pre- - ## selection of the muon candidates - select = cms.string("pt>20 & abs(eta)<2.1 & isGlobalMuon & innerTrack.numberOfValidHits>10 & globalTrack.normalizedChi2>-1 & globalTrack.normalizedChi2<10 & (isolationR03.sumPt+isolationR03.emEt+isolationR03.hadEt)/pt<0.1"), - ## when omitted isolated muon multiplicity plot will be equi- - ## valent to inclusive muon multiplicity plot - isolation = cms.string("(isolationR03.sumPt+isolationR03.emEt+isolationR03.hadEt)/pt<0.1") - ), - ## [optional] : when omitted all monitoring plots for jets - ## will be filled w/o extras - jetExtras = cms.PSet( - ## when omitted monitor plots for pt will be filled from uncorrected - ## jets - jetCorrector = cms.string("ak5PFL2L3"), - ## when omitted monitor plots will be filled w/o additional cut on - ## jetID - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - ## when omitted no extra selection will be applied on jets before - ## filling the monitor histograms; if jetCorrector is present the - ## selection will be applied to corrected jets - select = cms.string("pt>30 & abs(eta)<4.5& emEnergyFraction>0.01"), - ## when omitted monitor histograms for b-tagging will not be filled - jetBTaggers = cms.PSet( - trackCountingEff = cms.PSet( - label = cms.InputTag("trackCountingHighEffBJetTags" ), - workingPoint = cms.double(1.25) - ), - trackCountingPur = cms.PSet( - label = cms.InputTag("trackCountingHighPurBJetTags" ), - workingPoint = cms.double(3.00) - ), - secondaryVertex = cms.PSet( - label = cms.InputTag("simpleSecondaryVertexHighEffBJetTags"), - workingPoint = cms.double(2.05) - ) - ), - ), - ## [optional] : when omitted no mass window will be applied - ## for the W mass before filling the event monitoring plots - massExtras = cms.PSet( - lowerEdge = cms.double( 70.), - upperEdge = cms.double(110.) - ), - ## [optional] : when omitted the monitoring plots for triggering - ## will be empty - triggerExtras = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - paths = cms.vstring(['HLT_Mu3:HLT_QuadJet15U', - 'HLT_Mu5:HLT_QuadJet15U', - 'HLT_Mu7:HLT_QuadJet15U', - 'HLT_Mu9:HLT_QuadJet15U', - 'HLT_Mu11:HLT_QuadJet15U']) - ) - ), - ## ------------------------------------------------------ - ## PRESELECTION - ## - ## setup of the event preselection, which will not - ## be monitored - ## [mandatory] : but may be empty - ## - preselection = cms.PSet( - trigger = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - select = cms.vstring(['HLT_Iso10Mu20_eta2p1_CentralCaloJet30_BTagIPIter_v1'])#ONLY ONE PATH - ), - ## [optional] : when omitted no preselection is applied - vertex = cms.PSet( - src = cms.InputTag("offlinePrimaryVertices"), - select = cms.string('abs(x)<1. & abs(y)<1. & abs(z)<20. & tracksSize>3 & !isFake') - ) - ), - ## ------------------------------------------------------ - ## SELECTION - ## - ## monitor histrograms are filled after each selection - ## step, the selection is applied in the order defined - ## by this vector - ## [mandatory] : may be empty or contain an arbitrary - ## number of PSets - selection = cms.VPSet( - cms.PSet( - label = cms.string("Hlt:step0"), - src = cms.InputTag(""), - select = cms.string(""), - min = cms.int32(0), - max = cms.int32(0), - ), - cms.PSet( - label = cms.string("muons:step1"), - src = cms.InputTag("muons"), - select = cms.string("pt>20 & abs(eta)<2.1 & isGlobalMuon & innerTrack.numberOfValidHits>10 & globalTrack.normalizedChi2>-1 & globalTrack.normalizedChi2<10 & (isolationR03.sumPt+isolationR03.emEt+isolationR03.hadEt)/pt<0.1"), - min = cms.int32(1), - max = cms.int32(1), - ), - cms.PSet( - label = cms.string("jets/calo:step2"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5PFL2L3"), - select = cms.string("pt>30 & abs(eta)<4.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(1), - ), - cms.PSet( - label = cms.string("jets/calo:step3"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>30 & abs(eta)<4.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(2), - ), - ) -) diff --git a/HLTriggerOffline/Top/python/singletopHLTEventValidation_cfi.py b/HLTriggerOffline/Top/python/singletopHLTEventValidation_cfi.py new file mode 100644 index 0000000000000..3960ae9a6e845 --- /dev/null +++ b/HLTriggerOffline/Top/python/singletopHLTEventValidation_cfi.py @@ -0,0 +1,53 @@ +import FWCore.ParameterSet.Config as cms + +# single top muonique +SingleTopSingleMuonHLTValidation = cms.EDAnalyzer('TopSingleLeptonHLTValidation', + # Directory + sDir = cms.untracked.string('HLTValidation/SingleTop/SingleMuon/'), + # Electrons + sElectrons = cms.untracked.string('gsfElectrons'), + ptElectrons = cms.untracked.double(30.), + etaElectrons = cms.untracked.double(2.5), + isoElectrons = cms.untracked.double(0.1), + minElectrons = cms.untracked.uint32(0), + # Muons + sMuons = cms.untracked.string('muons'), + ptMuons = cms.untracked.double(26.), + etaMuons = cms.untracked.double(2.1), + isoMuons = cms.untracked.double(0.12), + minMuons = cms.untracked.uint32(1), + # Jets + sJets = cms.untracked.string('ak5PFJets'), + ptJets = cms.untracked.double(40.), + etaJets = cms.untracked.double(5.), + minJets = cms.untracked.uint32(2), + # Trigger + sTrigger = cms.untracked.string("TriggerResults"), + vsPaths = cms.untracked.vstring(['HLT_IsoMu17_eta2p1_TriCentralPFNoPUJet45_35_25','HLT_IsoMu17_eta2p1_TriCentralPFNoPUJet30']), +) + +# single top electronique +SingleTopSingleElectronHLTValidation = cms.EDAnalyzer('TopSingleLeptonHLTValidation', + # Directory + sDir = cms.untracked.string('HLTValidation/SingleTop/SingleElectron/'), + # Electrons + sElectrons = cms.untracked.string('gsfElectrons'), + ptElectrons = cms.untracked.double(30.), + etaElectrons = cms.untracked.double(2.5), + isoElectrons = cms.untracked.double(0.1), + minElectrons = cms.untracked.uint32(1), + # Muons + sMuons = cms.untracked.string('muons'), + ptMuons = cms.untracked.double(26.), + etaMuons = cms.untracked.double(2.1), + isoMuons = cms.untracked.double(0.12), + minMuons = cms.untracked.uint32(0), + # Jets + sJets = cms.untracked.string('ak5PFJets'), + ptJets = cms.untracked.double(40.), + etaJets = cms.untracked.double(5.), + minJets = cms.untracked.uint32(2), + # Trigger + sTrigger = cms.untracked.string("TriggerResults"), + vsPaths = cms.untracked.vstring(['HLT_Ele25_CaloIdVT_CaloIsoVL_TrkIdVL_TrkIsoT_TriCentralPFNoPUJet45_35_25','HLT_Ele25_CaloIdVT_CaloIsoVL_TrkIdVL_TrkIsoT_TriCentralPFNoPUJet30']), +) diff --git a/HLTriggerOffline/Top/python/topDiLeptonHLTEventDQM_cfi.py b/HLTriggerOffline/Top/python/topDiLeptonHLTEventDQM_cfi.py deleted file mode 100644 index 49b0aeb46320d..0000000000000 --- a/HLTriggerOffline/Top/python/topDiLeptonHLTEventDQM_cfi.py +++ /dev/null @@ -1,639 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -topDiLeptonTriggerDQM = cms.EDAnalyzer("TopHLTDiLeptonOfflineDQM", - ## ------------------------------------------------------ - ## SETUP - ## - ## configuration of the MonitoringEnsemble(s) - ## [mandatory] : optional PSets may be omitted - ## - setup = cms.PSet( - ## sub-directory to write the monitor histograms to - ## [mandatory] : should not be changed w/o explicit - ## communication to TopCom! - directory = cms.string("Physics/Top/TopDiLeptonDQM/"), - - ## [mandatory] - sources = cms.PSet( - muons = cms.InputTag("muons"), - elecs = cms.InputTag("gedGsfElectrons"), - jets = cms.InputTag("ak5CaloJets"), - mets = cms.VInputTag("met", "tcMet", "pfMet") - ), - ## [optional] : when omitted the verbosity level is set to STANDARD - monitoring = cms.PSet( - verbosity = cms.string("DEBUG") - ), - ## [optional] : when omitted all monitoring plots for electrons - ## will be filled w/o extras - elecExtras = cms.PSet( - ## when omitted electron plots will be filled w/o cut on electronId - electronId = cms.PSet( - src = cms.InputTag("simpleEleId70cIso"), - #src = cms.InputTag("eidRobustLoose"), - pattern = cms.int32(1) - ), - ## when omitted electron plots will be filled w/o additional pre- - ## selection of the electron candidates - select = cms.string("pt>10. && abs(eta)<2.4 && abs(gsfTrack.d0)<1. && abs(gsfTrack.dz)<20."), - ## when omitted isolated electron multiplicity plot will be equi- - ## valent to inclusive electron multiplicity plot - isolation = cms.string("(dr03TkSumPt+dr03EcalRecHitSumEt+dr03HcalTowerSumEt)/pt<0.2"), - ), - ## [optional] : when omitted all monitoring plots for muons - ## will be filled w/o extras - muonExtras = cms.PSet( - ## when omitted muon plots will be filled w/o additional pre- - ## selection of the muon candidates - select = cms.string("pt>10. && abs(eta)<2.4 && abs(globalTrack.d0)<1. && abs(globalTrack.dz)<20."), - ## when omitted isolated muon multiplicity plot will be equi- - ## valent to inclusive muon multiplicity plot - isolation = cms.string("(isolationR03.sumPt+isolationR03.emEt+isolationR03.hadEt)/pt<0.2"), - ), - ## [optional] : when omitted all monitoring plots for jets will - ## be filled from uncorrected jets - jetExtras = cms.PSet( - ## when omitted monitor plots for pt will be filled from uncorrected - ## jets - jetCorrector = cms.string("ak5CaloL2L3"), - ## when omitted monitor plots will be filled w/o additional cut on - ## jetID - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - ## when omitted no extra selection will be applied on jets before - ## filling the monitor histograms; if jetCorrector is present the - ## selection will be applied to corrected jets - select = cms.string("pt>30. & abs(eta)<2.4 & emEnergyFraction>0.01"), - ), - ## [optional] : when omitted no mass window will be applied - ## for the same flavor lepton monitoring plots - massExtras = cms.PSet( - lowerEdge = cms.double( 76.0), - upperEdge = cms.double(106.0) - ), - ## [optional] : when omitted all monitoring plots for triggering - ## will be empty - #triggerExtras = cms.PSet( - #src = cms.InputTag("TriggerResults","","HLT"), - #pathsELECMU = cms.vstring([ 'HLT_Mu9:HLT_Ele15_SW_L1R', - #'HLT_Mu15:HLT_Ele15_SW_L1R', - #'HLT_DoubleMu3:HLT_Ele15_SW_L1R', - #'HLT_Ele15_SW_L1R:HLT_Mu9', - #'HLT_Ele15_SW_L1R:HLT_DoubleMu3']), - #pathsDIMUON = cms.vstring([ 'HLT_Mu15:HLT_Mu9', - #'HLT_DoubleMu3:HLT_Mu9', - #'HLT_Mu9:HLT_DoubleMu3', - #'HLT_Mu15:HLT_DoubleMu3']) - #) - ), - - ## ------------------------------------------------------ - ## PRESELECTION - ## - ## setup of the event preselection, which will not - ## be monitored - ## [mandatory] : but may be empty - ## - preselection = cms.PSet( - ## [optional] : when omitted no preselection is applied - trigger = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - select = cms.vstring(['HLT_Mu9','HLT_Ele15_SW_L1R','HLT_DoubleMu3']) - ), - ## [optional] : when omitted no preselection is applied - vertex = cms.PSet( - src = cms.InputTag("offlinePrimaryVertices"), - select = cms.string('abs(x)<1. && abs(y)<1. && abs(z)<20. && tracksSize>3 && !isFake') - ) - ), - - ## ------------------------------------------------------ - ## SELECTION - ## - ## monitor histrograms are filled after each selection - ## step, the selection is applied in the order defined - ## by this vector - ## [mandatory] : may be empty or contain an arbitrary - ## number of PSets as given below: - ## - selection = cms.VPSet( - #cms.PSet( - ### [mandatory] : 'jets' defines the objects to - ### select on, 'step0' labels the histograms; - ### instead of 'step0' you can choose any label - #label = cms.string("empty:step0") - #), - cms.PSet( - label = cms.string("Hlt:step0"), - src = cms.InputTag(""), - select = cms.string(""), - min = cms.int32(0), - max = cms.int32(0), - ), - - cms.PSet( - label = cms.string("muons:step1"), - src = cms.InputTag("muons"), - select = cms.string("pt>20 & abs(eta)<2.4 & isGlobalMuon & innerTrack.numberOfValidHits>10 & globalTrack.normalizedChi2>-1 & globalTrack.normalizedChi2<10"), - min = cms.int32(2), - max = cms.int32(2), - ), - cms.PSet( - label = cms.string("jets/calo:step2"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>30. & abs(eta)<2.4 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(2), - #max = cms.int32(2), - ) - ) -) - - - -DiMuonDQM = cms.EDAnalyzer("TopHLTDiLeptonOfflineDQM", - ## ------------------------------------------------------ - ## SETUP - ## - ## configuration of the MonitoringEnsemble(s) - ## [mandatory] : optional PSets may be omitted - ## - setup = cms.PSet( - ## sub-directory to write the monitor histograms to - ## [mandatory] : should not be changed w/o explicit - ## communication to TopCom! - directory = cms.string("Physics/Top/TopDiMuonDQM/"), - - ## [mandatory] - sources = cms.PSet( - muons = cms.InputTag("muons"), - elecs = cms.InputTag("gedGsfElectrons"), - jets = cms.InputTag("ak5CaloJets"), - mets = cms.VInputTag("met", "tcMet", "pfMet") - ), - ## [optional] : when omitted the verbosity level is set to STANDARD - monitoring = cms.PSet( - verbosity = cms.string("DEBUG") - ), - ## [optional] : when omitted all monitoring plots for electrons - ## will be filled w/o extras - elecExtras = cms.PSet( - ## when omitted electron plots will be filled w/o cut on electronId - electronId = cms.PSet( - src = cms.InputTag("simpleEleId70cIso"), - #src = cms.InputTag("eidRobustLoose"), - pattern = cms.int32(1) - ), - ## when omitted electron plots will be filled w/o additional pre- - ## selection of the electron candidates - select = cms.string("pt>500. && abs(eta)<2.4 && abs(gsfTrack.d0)<1. && abs(gsfTrack.dz)<20."), - ## when omitted isolated electron multiplicity plot will be equi- - ## valent to inclusive electron multiplicity plot - isolation = cms.string("(dr03TkSumPt+dr03EcalRecHitSumEt+dr03HcalTowerSumEt)/pt<0.2"), - ), - ## [optional] : when omitted all monitoring plots for muons - ## will be filled w/o extras - muonExtras = cms.PSet( - ## when omitted muon plots will be filled w/o additional pre- - ## selection of the muon candidates - select = cms.string("pt>20. && abs(eta)<2.4 && abs(globalTrack.d0)<1. && abs(globalTrack.dz)<20."), - ## when omitted isolated muon multiplicity plot will be equi- - ## valent to inclusive muon multiplicity plot - isolation = cms.string("(isolationR03.sumPt+isolationR03.emEt+isolationR03.hadEt)/pt<0.2"), - ), - ## [optional] : when omitted all monitoring plots for jets will - ## be filled from uncorrected jets - jetExtras = cms.PSet( - ## when omitted monitor plots for pt will be filled from uncorrected - ## jets - jetCorrector = cms.string("ak5CaloL2L3"), - ## when omitted monitor plots will be filled w/o additional cut on - ## jetID - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - ## when omitted no extra selection will be applied on jets before - ## filling the monitor histograms; if jetCorrector is present the - ## selection will be applied to corrected jets - select = cms.string("pt>30. & abs(eta)<2.4 & emEnergyFraction>0.01"), - ), - ## [optional] : when omitted no mass window will be applied - ## for the same flavor lepton monitoring plots - massExtras = cms.PSet( - lowerEdge = cms.double( 76.0), - upperEdge = cms.double(106.0) - ), - ## [optional] : when omitted all monitoring plots for triggering - ## will be empty - #triggerExtras = cms.PSet( - #src = cms.InputTag("TriggerResults","","HLT"), - #pathsELECMU = cms.vstring([ 'HLT_Mu9:HLT_Ele15_SW_L1R', - #'HLT_Mu15:HLT_Ele15_SW_L1R', - #'HLT_DoubleMu3:HLT_Ele15_SW_L1R', - #'HLT_Ele15_SW_L1R:HLT_Mu9', - #'HLT_Ele15_SW_L1R:HLT_DoubleMu3']), - #pathsDIMUON = cms.vstring([ 'HLT_Mu15:HLT_Mu9', - #'HLT_DoubleMu3:HLT_Mu9', - #'HLT_Mu9:HLT_DoubleMu3', - #'HLT_Mu15:HLT_DoubleMu3']) - #) - ), - - ## ------------------------------------------------------ - ## PRESELECTION - ## - ## setup of the event preselection, which will not - ## be monitored - ## [mandatory] : but may be empty - ## - preselection = cms.PSet( - ## [optional] : when omitted no preselection is applied - trigger = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - select = cms.vstring(['HLT_Mu9','HLT_Ele15_SW_L1R','HLT_DoubleMu3']) - ), - ## [optional] : when omitted no preselection is applied - vertex = cms.PSet( - src = cms.InputTag("offlinePrimaryVertices"), - select = cms.string('abs(x)<1. && abs(y)<1. && abs(z)<20. && tracksSize>3 && !isFake') - ) - ), - - ## ------------------------------------------------------ - ## SELECTION - ## - ## monitor histrograms are filled after each selection - ## step, the selection is applied in the order defined - ## by this vector - ## [mandatory] : may be empty or contain an arbitrary - ## number of PSets as given below: - ## - selection = cms.VPSet( - #cms.PSet( - ### [mandatory] : 'jets' defines the objects to - ### select on, 'step0' labels the histograms; - ### instead of 'step0' you can choose any label - #label = cms.string("empty:step0") - #), - cms.PSet( - label = cms.string("Hlt:step0"), - src = cms.InputTag(""), - select = cms.string(""), - min = cms.int32(0), - max = cms.int32(0), - ), - - cms.PSet( - label = cms.string("muons:step1"), - src = cms.InputTag("muons"), - select = cms.string("pt>20 & abs(eta)<2.4 & isGlobalMuon & innerTrack.numberOfValidHits>10 & globalTrack.normalizedChi2>-1 & globalTrack.normalizedChi2<10"), - min = cms.int32(2), - max = cms.int32(2), - ), - cms.PSet( - label = cms.string("jets/calo:step2"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>30. & abs(eta)<2.4 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(2), - #max = cms.int32(2), - ), - ), -) - -DiElectronDQM = cms.EDAnalyzer("TopHLTDiLeptonOfflineDQM", - ## ------------------------------------------------------ - ## SETUP - ## - ## configuration of the MonitoringEnsemble(s) - ## [mandatory] : optional PSets may be omitted - ## - setup = cms.PSet( - ## sub-directory to write the monitor histograms to - ## [mandatory] : should not be changed w/o explicit - ## communication to TopCom! - directory = cms.string("Physics/Top/TopDiElectronDQM/"), - - ## [mandatory] - sources = cms.PSet( - muons = cms.InputTag("muons"), - elecs = cms.InputTag("gedGsfElectrons"), - jets = cms.InputTag("ak5CaloJets"), - mets = cms.VInputTag("met", "tcMet", "pfMet") - ), - ## [optional] : when omitted the verbosity level is set to STANDARD - monitoring = cms.PSet( - verbosity = cms.string("DEBUG") - ), - ## [optional] : when omitted all monitoring plots for electrons - ## will be filled w/o extras - elecExtras = cms.PSet( - ## when omitted electron plots will be filled w/o cut on electronId - electronId = cms.PSet( - src = cms.InputTag("simpleEleId70cIso"), - #src = cms.InputTag("eidRobustLoose"), - pattern = cms.int32(1) - ), - ## when omitted electron plots will be filled w/o additional pre- - ## selection of the electron candidates - select = cms.string("pt>10. && abs(eta)<2.4 && abs(gsfTrack.d0)<1. && abs(gsfTrack.dz)<20."), - ## when omitted isolated electron multiplicity plot will be equi- - ## valent to inclusive electron multiplicity plot - isolation = cms.string("(dr03TkSumPt+dr03EcalRecHitSumEt+dr03HcalTowerSumEt)/pt<0.2"), - ), - ## [optional] : when omitted all monitoring plots for muons - ## will be filled w/o extras - muonExtras = cms.PSet( - ## when omitted muon plots will be filled w/o additional pre- - ## selection of the muon candidates - select = cms.string("pt>500. && abs(eta)<2.4 && abs(globalTrack.d0)<1. && abs(globalTrack.dz)<20."), - ## when omitted isolated muon multiplicity plot will be equi- - ## valent to inclusive muon multiplicity plot - isolation = cms.string("(isolationR03.sumPt+isolationR03.emEt+isolationR03.hadEt)/pt<0.2"), - ), - ## [optional] : when omitted all monitoring plots for jets will - ## be filled from uncorrected jets - jetExtras = cms.PSet( - ## when omitted monitor plots for pt will be filled from uncorrected - ## jets - jetCorrector = cms.string("ak5CaloL2L3"), - ## when omitted monitor plots will be filled w/o additional cut on - ## jetID - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - ## when omitted no extra selection will be applied on jets before - ## filling the monitor histograms; if jetCorrector is present the - ## selection will be applied to corrected jets - select = cms.string("pt>30. & abs(eta)<2.4 & emEnergyFraction>0.01"), - ), - ## [optional] : when omitted no mass window will be applied - ## for the same flavor lepton monitoring plots - massExtras = cms.PSet( - lowerEdge = cms.double( 76.0), - upperEdge = cms.double(106.0) - ), - ## [optional] : when omitted all monitoring plots for triggering - ## will be empty - #triggerExtras = cms.PSet( - #src = cms.InputTag("TriggerResults","","HLT"), - #pathsELECMU = cms.vstring([ 'HLT_Mu9:HLT_Ele15_SW_L1R', - #'HLT_Mu15:HLT_Ele15_SW_L1R', - #'HLT_DoubleMu3:HLT_Ele15_SW_L1R', - #'HLT_Ele15_SW_L1R:HLT_Mu9', - #'HLT_Ele15_SW_L1R:HLT_DoubleMu3']), - #pathsDIMUON = cms.vstring([ 'HLT_Mu15:HLT_Mu9', - #'HLT_DoubleMu3:HLT_Mu9', - #'HLT_Mu9:HLT_DoubleMu3', - #'HLT_Mu15:HLT_DoubleMu3']) - #) - ), - - ## ------------------------------------------------------ - ## PRESELECTION - ## - ## setup of the event preselection, which will not - ## be monitored - ## [mandatory] : but may be empty - ## - preselection = cms.PSet( - ## [optional] : when omitted no preselection is applied - trigger = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - select = cms.vstring(['HLT_Mu9','HLT_Ele15_SW_L1R','HLT_DoubleMu3']) - ), - ## [optional] : when omitted no preselection is applied - vertex = cms.PSet( - src = cms.InputTag("offlinePrimaryVertices"), - select = cms.string('abs(x)<1. && abs(y)<1. && abs(z)<20. && tracksSize>3 && !isFake') - ) - ), - - ## ------------------------------------------------------ - ## SELECTION - ## - ## monitor histrograms are filled after each selection - ## step, the selection is applied in the order defined - ## by this vector - ## [mandatory] : may be empty or contain an arbitrary - ## number of PSets as given below: - ## - selection = cms.VPSet( - #cms.PSet( - ### [mandatory] : 'jets' defines the objects to - ### select on, 'step0' labels the histograms; - ### instead of 'step0' you can choose any label - #label = cms.string("empty:step0") - #), - cms.PSet( - label = cms.string("Hlt:step0"), - src = cms.InputTag(""), - select = cms.string(""), - min = cms.int32(0), - max = cms.int32(0), - ), - - cms.PSet( - label = cms.string("elecs:step1"), - src = cms.InputTag("gedGsfElectrons"), - electronId = cms.PSet( - src = cms.InputTag("simpleEleId70cIso"), - pattern = cms.int32(1) - ), - select = cms.string("pt>20 & abs(eta)<2.4 & (dr03TkSumPt+dr03EcalRecHitSumEt+dr03HcalTowerSumEt)/pt<0.17"), - min = cms.int32(2), - max = cms.int32(2), - ), - cms.PSet( - label = cms.string("jets/calo:step2"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>30. & abs(eta)<2.4 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(2), - #max = cms.int32(2), - ), - ), -) - -ElecMuonDQM = cms.EDAnalyzer("TopHLTDiLeptonOfflineDQM", - ## ------------------------------------------------------ - ## SETUP - ## - ## configuration of the MonitoringEnsemble(s) - ## [mandatory] : optional PSets may be omitted - ## - setup = cms.PSet( - ## sub-directory to write the monitor histograms to - ## [mandatory] : should not be changed w/o explicit - ## communication to TopCom! - directory = cms.string("Physics/Top/TopElecMuonDQM/"), - - ## [mandatory] - sources = cms.PSet( - muons = cms.InputTag("muons"), - elecs = cms.InputTag("gedGsfElectrons"), - jets = cms.InputTag("ak5CaloJets"), - mets = cms.VInputTag("met", "tcMet", "pfMet") - ), - ## [optional] : when omitted the verbosity level is set to STANDARD - monitoring = cms.PSet( - verbosity = cms.string("DEBUG") - ), - ## [optional] : when omitted all monitoring plots for electrons - ## will be filled w/o extras - elecExtras = cms.PSet( - ## when omitted electron plots will be filled w/o cut on electronId - electronId = cms.PSet( - src = cms.InputTag("simpleEleId70cIso"), - #src = cms.InputTag("eidRobustLoose"), - pattern = cms.int32(1) - ), - ## when omitted electron plots will be filled w/o additional pre- - ## selection of the electron candidates - select = cms.string("pt>10. && abs(eta)<2.4 && abs(gsfTrack.d0)<1. && abs(gsfTrack.dz)<20."), - ## when omitted isolated electron multiplicity plot will be equi- - ## valent to inclusive electron multiplicity plot - isolation = cms.string("(dr03TkSumPt+dr03EcalRecHitSumEt+dr03HcalTowerSumEt)/pt<0.2"), - ), - ## [optional] : when omitted all monitoring plots for muons - ## will be filled w/o extras - muonExtras = cms.PSet( - ## when omitted muon plots will be filled w/o additional pre- - ## selection of the muon candidates - select = cms.string("pt>10. && abs(eta)<2.4 && abs(globalTrack.d0)<1. && abs(globalTrack.dz)<20."), - ## when omitted isolated muon multiplicity plot will be equi- - ## valent to inclusive muon multiplicity plot - isolation = cms.string("(isolationR03.sumPt+isolationR03.emEt+isolationR03.hadEt)/pt<0.2"), - ), - ## [optional] : when omitted all monitoring plots for jets will - ## be filled from uncorrected jets - jetExtras = cms.PSet( - ## when omitted monitor plots for pt will be filled from uncorrected - ## jets - jetCorrector = cms.string("ak5CaloL2L3"), - ## when omitted monitor plots will be filled w/o additional cut on - ## jetID - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - ## when omitted no extra selection will be applied on jets before - ## filling the monitor histograms; if jetCorrector is present the - ## selection will be applied to corrected jets - select = cms.string("pt>30. & abs(eta)<2.4 & emEnergyFraction>0.01"), - ), - ## [optional] : when omitted no mass window will be applied - ## for the same flavor lepton monitoring plots - massExtras = cms.PSet( - lowerEdge = cms.double( 76.0), - upperEdge = cms.double(106.0) - ), - ## [optional] : when omitted all monitoring plots for triggering - ## will be empty - #triggerExtras = cms.PSet( - #src = cms.InputTag("TriggerResults","","HLT"), - #pathsELECMU = cms.vstring([ 'HLT_Mu9:HLT_Ele15_SW_L1R', - #'HLT_Mu15:HLT_Ele15_SW_L1R', - #'HLT_DoubleMu3:HLT_Ele15_SW_L1R', - #'HLT_Ele15_SW_L1R:HLT_Mu9', - #'HLT_Ele15_SW_L1R:HLT_DoubleMu3']), - #pathsDIMUON = cms.vstring([ 'HLT_Mu15:HLT_Mu9', - #'HLT_DoubleMu3:HLT_Mu9', - #'HLT_Mu9:HLT_DoubleMu3', - #'HLT_Mu15:HLT_DoubleMu3']) - #) - ), - - ## ------------------------------------------------------ - ## PRESELECTION - ## - ## setup of the event preselection, which will not - ## be monitored - ## [mandatory] : but may be empty - ## - preselection = cms.PSet( - ## [optional] : when omitted no preselection is applied - trigger = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - select = cms.vstring(['HLT_Mu9','HLT_Ele15_SW_L1R','HLT_DoubleMu3']) - ), - ## [optional] : when omitted no preselection is applied - vertex = cms.PSet( - src = cms.InputTag("offlinePrimaryVertices"), - select = cms.string('abs(x)<1. && abs(y)<1. && abs(z)<20. && tracksSize>3 && !isFake') - ) - ), - - ## ------------------------------------------------------ - ## SELECTION - ## - ## monitor histrograms are filled after each selection - ## step, the selection is applied in the order defined - ## by this vector - ## [mandatory] : may be empty or contain an arbitrary - ## number of PSets as given below: - ## - selection = cms.VPSet( - #cms.PSet( - ### [mandatory] : 'jets' defines the objects to - ### select on, 'step0' labels the histograms; - ### instead of 'step0' you can choose any label - #label = cms.string("empty:step0") - #), - cms.PSet( - label = cms.string("Hlt:step0"), - src = cms.InputTag(""), - select = cms.string(""), - min = cms.int32(0), - max = cms.int32(0), - ), - - cms.PSet( - label = cms.string("muons:step1"), - src = cms.InputTag("muons"), - select = cms.string("pt>20 & abs(eta)<2.4 & isGlobalMuon & innerTrack.numberOfValidHits>10 & globalTrack.normalizedChi2>-1 & globalTrack.normalizedChi2<10"), - min = cms.int32(1), - max = cms.int32(1), - ), - cms.PSet( - label = cms.string("elecs:step2"), - src = cms.InputTag("gedGsfElectrons"), - electronId = cms.PSet( - src = cms.InputTag("simpleEleId70cIso"), - pattern = cms.int32(1) - ), - select = cms.string("pt>20 & abs(eta)<2.4 & (dr03TkSumPt+dr03EcalRecHitSumEt+dr03HcalTowerSumEt)/pt<0.17"), - min = cms.int32(1), - max = cms.int32(1), - ), - cms.PSet( - label = cms.string("jets/calo:step3"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>30. & abs(eta)<2.4 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(2), - #max = cms.int32(2), - ), - ), -) - diff --git a/HLTriggerOffline/Top/python/topHLTDQM_cff.py b/HLTriggerOffline/Top/python/topHLTDQM_cff.py deleted file mode 100644 index 6a6a02b7032d6..0000000000000 --- a/HLTriggerOffline/Top/python/topHLTDQM_cff.py +++ /dev/null @@ -1,20 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -from HLTriggerOffline.Top.topDiLeptonHLTEventDQM_cfi import * -from HLTriggerOffline.Top.topSingleLeptonHLTEventDQM_cfi import * -from HLTriggerOffline.Top.singletopHLTEventDQM_cfi import * -from HLTriggerOffline.Top.topvalidation_cfi import * -from JetMETCorrections.Configuration.JetCorrectionProducersAllAlgos_cff import * - - - -topHLTDQM = cms.Sequence( - DiMuonDQM - *DiElectronDQM - *ElecMuonDQM - *topSingleMuonMediumTriggerDQM - *topSingleElectronMediumTriggerDQM - *SingleTopSingleMuonTriggerDQM - *SingleTopSingleElectronTriggerDQM - ) - diff --git a/HLTriggerOffline/Top/python/topHLTValidation_cff.py b/HLTriggerOffline/Top/python/topHLTValidation_cff.py new file mode 100644 index 0000000000000..ac322628a1414 --- /dev/null +++ b/HLTriggerOffline/Top/python/topHLTValidation_cff.py @@ -0,0 +1,17 @@ +import FWCore.ParameterSet.Config as cms + +#from HLTriggerOffline.Top.topDiLeptonHLTEventValidation_cfi import * +from HLTriggerOffline.Top.topSingleLeptonHLTEventValidation_cfi import * +from HLTriggerOffline.Top.singletopHLTEventValidation_cfi import * + +topHLTriggerValidation = cms.Sequence( +# DiMuonHLTValidation +# *DiElectronHLTValidation +# *ElecMuonHLTValidation +# * + topSingleMuonHLTValidation + *topSingleElectronHLTValidation + *SingleTopSingleMuonHLTValidation + *SingleTopSingleElectronHLTValidation + ) + diff --git a/HLTriggerOffline/Top/python/topSingleLeptonHLTEventDQM_cfi.py b/HLTriggerOffline/Top/python/topSingleLeptonHLTEventDQM_cfi.py deleted file mode 100644 index 9d46ce90e9497..0000000000000 --- a/HLTriggerOffline/Top/python/topSingleLeptonHLTEventDQM_cfi.py +++ /dev/null @@ -1,843 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -topSingleLeptonTriggerDQM = cms.EDAnalyzer("TopHLTSingleLeptonDQM", - ## ------------------------------------------------------ - ## SETUP - ## - ## configuration of the MonitoringEnsemble(s) - ## [mandatory] : optional PSets may be omitted - ## - setup = cms.PSet( - ## sub-directory to write the monitor histograms to - ## [mandatory] : should not be changed w/o explicit - ## communication to TopCom! - directory = cms.string("HLTriggerOffline/Top/TopSingleLeptonTriggerDQM/"), - ## [mandatory] - sources = cms.PSet( - muons = cms.InputTag("muons"), - elecs = cms.InputTag("gedGsfElectrons"), - jets = cms.InputTag("ak5CaloJets"), - mets = cms.VInputTag("met", "tcMet", "pfMet"), - pvs = cms.InputTag("offlinePrimaryVertices") - ), - ## [optional] : when omitted the verbosity level is set to STANDARD - monitoring = cms.PSet( - verbosity = cms.string("DEBUG") - ), - ## [optional] : when omitted all monitoring plots for primary vertices - ## will be filled w/o extras - pvExtras = cms.PSet( - ## when omitted electron plots will be filled w/o additional pre- - ## selection of the primary vertex candidates - select = cms.string("abs(x)<1. & abs(y)<1. & abs(z)<20. & tracksSize>3 & !isFake") - ), - ## [optional] : when omitted all monitoring plots for electrons - ## will be filled w/o extras - elecExtras = cms.PSet( - ## when omitted electron plots will be filled w/o cut on electronId - electronId = cms.PSet( src = cms.InputTag("eidRobustLoose"), pattern = cms.int32(1) ), - ## when omitted electron plots will be filled w/o additional pre- - ## selection of the electron candidates - select = cms.string("pt>15 & abs(eta)<2.5 & abs(gsfTrack.d0)<1 & abs(gsfTrack.dz)<20"), - ## when omitted isolated electron multiplicity plot will be equi- - ## valent to inclusive electron multiplicity plot - isolation = cms.string("(dr03TkSumPt+dr04EcalRecHitSumEt+dr04HcalTowerSumEt)/pt<0.1"), - ), - ## [optional] : when omitted all monitoring plots for muons - ## will be filled w/o extras - muonExtras = cms.PSet( - ## when omitted muon plots will be filled w/o additional pre- - ## selection of the muon candidates - select = cms.string("pt>10 & abs(eta)<2.1 & isGlobalMuon & abs(globalTrack.d0)<1 & abs(globalTrack.dz)<20"), - ## when omitted isolated muon multiplicity plot will be equi- - ## valent to inclusive muon multiplicity plot - isolation = cms.string("(isolationR03.sumPt+isolationR03.emEt+isolationR03.hadEt)/pt<0.1"), - ), - ## [optional] : when omitted all monitoring plots for jets will - ## be filled from uncorrected jets - jetExtras = cms.PSet( - ## when omitted monitor plots for pt will be filled from uncorrected - ## jets - jetCorrector = cms.string("ak5CaloL2L3"), - ## when omitted monitor plots will be filled w/o additional cut on - ## jetID - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - ## when omitted no extra selection will be applied on jets before - ## filling the monitor histograms; if jetCorrector is present the - ## selection will be applied to corrected jets - select = cms.string("pt>15 & abs(eta)<2.5 & emEnergyFraction>0.01"), - ), - ## [optional] : when omitted no mass window will be applied - ## for the W mass befor filling the event monitoring plots - massExtras = cms.PSet( - lowerEdge = cms.double( 70.), - upperEdge = cms.double(110.) - ), - ## [optional] : when omitted the monitoring plots for triggering - ## will be empty - triggerExtras = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - paths = cms.vstring(['HLT_Mu3:HLT_QuadJet15U', - 'HLT_Mu5:HLT_QuadJet15U', - 'HLT_Mu7:HLT_QuadJet15U', - 'HLT_Mu9:HLT_QuadJet15U']) - ) - ), - ## ------------------------------------------------------ - ## PRESELECTION - ## - ## setup of the event preselection, which will not - ## be monitored - ## [mandatory] : but may be empty - ## - preselection = cms.PSet( - trigger = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - select = cms.vstring(['HLT_Iso10Mu20_eta2p1_CentralPFJet30_BTagIPIter_v1'])#ONLY ONE PATH - ), - ## [optional] : when omitted no preselection is applied - vertex = cms.PSet( - src = cms.InputTag("offlinePrimaryVertices"), - select = cms.string('abs(x)<1. & abs(y)<1. & abs(z)<20. & tracksSize>3 & !isFake') - ) - ), - ## ------------------------------------------------------ - ## SELECTION - ## - ## monitor histrograms are filled after each selection - ## step, the selection is applied in the order defined - ## by this vector - ## [mandatory] : may be empty or contain an arbitrary - ## number of PSets - ## - selection = cms.VPSet( - cms.PSet( - label = cms.string("Hlt:step0"), - src = cms.InputTag(""), - select = cms.string(""), - min = cms.int32(0), - max = cms.int32(0), - ), - cms.PSet( - label = cms.string("jets/calo:step1"), - src = cms.InputTag("ak5CaloJets"), - select = cms.string("pt>20 & abs(eta)<2.1 & 0.051 & restrictedEMF<1") - ), - min = cms.int32(2), - ), - ) -) - -topSingleMuonLooseTriggerDQM = cms.EDAnalyzer("TopHLTSingleLeptonDQM", - ## ------------------------------------------------------ - ## SETUP - ## - ## configuration of the MonitoringEnsemble(s) - ## [mandatory] : optional PSets may be omitted - ## - setup = cms.PSet( - ## sub-directory to write the monitor histograms to - ## [mandatory] : should not be changed w/o explicit - ## communication to TopCom! - directory = cms.string("HLTriggerOffline/Top/TopSingleMuonLooseTriggerDQM/"), - ## [mandatory] - sources = cms.PSet( - muons = cms.InputTag("muons"), - elecs = cms.InputTag("gedGsfElectrons"), - jets = cms.InputTag("ak5CaloJets"), - mets = cms.VInputTag("met", "tcMet", "pfMet"), - pvs = cms.InputTag("offlinePrimaryVertices") - ), - ## [optional] : when omitted the verbosity level is set to STANDARD - monitoring = cms.PSet( - verbosity = cms.string("DEBUG") - ), - pvExtras = cms.PSet( - ## when omitted electron plots will be filled w/o additional pre- - ## selection of the primary vertex candidates - select = cms.string("abs(x)<1. & abs(y)<1. & abs(z)<20. & tracksSize>3 & !isFake") - ), - ## [optional] : when omitted all monitoring plots for muons - ## will be filled w/o extras - muonExtras = cms.PSet( - ## when omitted muon plots will be filled w/o additional pre- - ## selection of the muon candidates - select = cms.string("pt > 10 & abs(eta)<2.1 & isGlobalMuon & innerTrack.numberOfValidHits>10 & globalTrack.normalizedChi2>-1 & globalTrack.normalizedChi2<10"), - ## when omitted isolated muon multiplicity plot will be equi- - ## valent to inclusive muon multiplicity plot - isolation = cms.string("(isolationR03.sumPt+isolationR03.emEt+isolationR03.hadEt)/pt<0.1") - ), - ## [optional] : when omitted all monitoring plots for jets - ## will be filled w/o extras - jetExtras = cms.PSet( - ## when omitted monitor plots for pt will be filled from uncorrected - ## jets - jetCorrector = cms.string("ak5CaloL2L3"), - ## when omitted monitor plots will be filled w/o additional cut on - ## jetID - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - ## when omitted no extra selection will be applied on jets before - ## filling the monitor histograms; if jetCorrector is present the - ## selection will be applied to corrected jets - select = cms.string("pt>15 & abs(eta)<2.5 & emEnergyFraction>0.01"), - ## when omitted monitor histograms for b-tagging will not be filled - jetBTaggers = cms.PSet( - trackCountingEff = cms.PSet( - label = cms.InputTag("trackCountingHighEffBJetTags" ), - workingPoint = cms.double(1.25) - ), - trackCountingPur = cms.PSet( - label = cms.InputTag("trackCountingHighPurBJetTags" ), - workingPoint = cms.double(3.00) - ), - secondaryVertex = cms.PSet( - label = cms.InputTag("simpleSecondaryVertexHighEffBJetTags"), - workingPoint = cms.double(2.05) - ) - ), - ), - ## [optional] : when omitted no mass window will be applied - ## for the W mass befor filling the event monitoring plots - massExtras = cms.PSet( - lowerEdge = cms.double( 70.), - upperEdge = cms.double(110.) - ), - ## [optional] : when omitted the monitoring plots for triggering - ## will be empty - triggerExtras = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - paths = cms.vstring(['HLT_Mu3:HLT_QuadJet15U', - 'HLT_Mu5:HLT_QuadJet15U', - 'HLT_Mu7:HLT_QuadJet15U', - 'HLT_Mu9:HLT_QuadJet15U', - 'HLT_Mu11:HLT_QuadJet15U']) - ) - ), - ## ------------------------------------------------------ - ## PRESELECTION - ## - ## setup of the event preselection, which will not - ## be monitored - ## [mandatory] : but may be empty - ## - preselection = cms.PSet( - trigger = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - select = cms.vstring(['HLT_Iso10Mu20_eta2p1_CentralPFJet30_BTagIPIter_v1'])#ONLY ONE PATH - ), - ## [optional] : when omitted no preselection is applied - vertex = cms.PSet( - src = cms.InputTag("offlinePrimaryVertices"), - select = cms.string('abs(x)<1. & abs(y)<1. & abs(z)<20. & tracksSize>3 & !isFake') - ) - ), - ## ------------------------------------------------------ - ## SELECTION - ## - ## monitor histrograms are filled after each selection - ## step, the selection is applied in the order defined - ## by this vector - ## [mandatory] : may be empty or contain an arbitrary - ## number of PSets - selection = cms.VPSet( - cms.PSet( - label = cms.string("Hlt:step0"), - src = cms.InputTag(""), - select = cms.string(""), - min = cms.int32(0), - max = cms.int32(0), - ), - cms.PSet( - label = cms.string("muons:step1"), - src = cms.InputTag("muons"), - select = cms.string("pt>10 & abs(eta)<2.1 & isGlobalMuon & innerTrack.numberOfValidHits>10 & globalTrack.normalizedChi2>-1 & globalTrack.normalizedChi2<10"), - min = cms.int32(1), - ), - cms.PSet( - label = cms.string("jets/calo:step2"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>15 & abs(eta)<2.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(1), - ), - cms.PSet( - label = cms.string("jets/calo:step3"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>15 & abs(eta)<2.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(2), - ), - cms.PSet( - label = cms.string("jets/calo:step4"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>15 & abs(eta)<2.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(3), - ), - cms.PSet( - label = cms.string("jets/calo:step5"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>15 & abs(eta)<2.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(4), - ), - ) -) -topSingleMuonMediumTriggerDQM = cms.EDAnalyzer("TopHLTSingleLeptonDQM", - ## ------------------------------------------------------ - ## SETUP - ## - ## configuration of the MonitoringEnsemble(s) - ## [mandatory] : optional PSets may be omitted - ## - setup = cms.PSet( - ## sub-directory to write the monitor histograms to - ## [mandatory] : should not be changed w/o explicit - ## communication to TopCom! - directory = cms.string("HLTriggerOffline/Top/TopSingleMuonMediumTriggerDQM/"), - ## [mandatory] - sources = cms.PSet( - muons = cms.InputTag("muons"), - elecs = cms.InputTag("gedGsfElectrons"), - jets = cms.InputTag("ak5CaloJets"), - mets = cms.VInputTag("met", "tcMet", "pfMet"), - pvs = cms.InputTag("offlinePrimaryVertices") - - ), - ## [optional] : when omitted the verbosity level is set to STANDARD - monitoring = cms.PSet( - verbosity = cms.string("DEBUG") - ), - ## [optional] : when omitted all monitoring plots for primary vertices - ## will be filled w/o extras - pvExtras = cms.PSet( - ## when omitted electron plots will be filled w/o additional pre- - ## selection of the primary vertex candidates - select = cms.string("abs(x)<1. & abs(y)<1. & abs(z)<20. & tracksSize>3 & !isFake") - ), - ## [optional] : when omitted all monitoring plots for muons - ## will be filled w/o extras - muonExtras = cms.PSet( - ## when omitted muon plots will be filled w/o additional pre- - ## selection of the muon candidates - select = cms.string("pt>20 & abs(eta)<2.1 & isGlobalMuon & innerTrack.numberOfValidHits>10 & globalTrack.normalizedChi2>-1 & globalTrack.normalizedChi2<10 & (isolationR03.sumPt+isolationR03.emEt+isolationR03.hadEt)/pt<0.1"), - ## when omitted isolated muon multiplicity plot will be equi- - ## valent to inclusive muon multiplicity plot - isolation = cms.string("(isolationR03.sumPt+isolationR03.emEt+isolationR03.hadEt)/pt<0.1") - ), - ## [optional] : when omitted all monitoring plots for jets - ## will be filled w/o extras - jetExtras = cms.PSet( - ## when omitted monitor plots for pt will be filled from uncorrected - ## jets - jetCorrector = cms.string("ak5CaloL2L3"), - ## when omitted monitor plots will be filled w/o additional cut on - ## jetID - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - ## when omitted no extra selection will be applied on jets before - ## filling the monitor histograms; if jetCorrector is present the - ## selection will be applied to corrected jets - select = cms.string("pt>30 & abs(eta)<2.5& emEnergyFraction>0.01"), - ## when omitted monitor histograms for b-tagging will not be filled - jetBTaggers = cms.PSet( - trackCountingEff = cms.PSet( - label = cms.InputTag("trackCountingHighEffBJetTags" ), - workingPoint = cms.double(1.25) - ), - trackCountingPur = cms.PSet( - label = cms.InputTag("trackCountingHighPurBJetTags" ), - workingPoint = cms.double(3.00) - ), - secondaryVertex = cms.PSet( - label = cms.InputTag("simpleSecondaryVertexHighEffBJetTags"), - workingPoint = cms.double(2.05) - ) - ), - ), - ## [optional] : when omitted no mass window will be applied - ## for the W mass before filling the event monitoring plots - massExtras = cms.PSet( - lowerEdge = cms.double( 70.), - upperEdge = cms.double(110.) - ), - ## [optional] : when omitted the monitoring plots for triggering - ## will be empty - triggerExtras = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - paths = cms.vstring(['HLT_Mu3:HLT_QuadJet15U', - 'HLT_Mu5:HLT_QuadJet15U', - 'HLT_Mu7:HLT_QuadJet15U', - 'HLT_Mu9:HLT_QuadJet15U', - 'HLT_Mu11:HLT_QuadJet15U']) - ) - ), - ## ------------------------------------------------------ - ## PRESELECTION - ## - ## setup of the event preselection, which will not - ## be monitored - ## [mandatory] : but may be empty - ## - preselection = cms.PSet( - trigger = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - select = cms.vstring(['HLT_Iso10Mu20_eta2p1_CentralPFJet30_BTagIPIter_v1'])#ONLY ONE PATH - ), - ## [optional] : when omitted no preselection is applied - vertex = cms.PSet( - src = cms.InputTag("offlinePrimaryVertices"), - select = cms.string('abs(x)<1. & abs(y)<1. & abs(z)<20. & tracksSize>3 & !isFake') - ) - ), - ## ------------------------------------------------------ - ## SELECTION - ## - ## monitor histrograms are filled after each selection - ## step, the selection is applied in the order defined - ## by this vector - ## [mandatory] : may be empty or contain an arbitrary - ## number of PSets - selection = cms.VPSet( - cms.PSet( - label = cms.string("Hlt:step0"), - src = cms.InputTag(""), - select = cms.string(""), - min = cms.int32(0), - max = cms.int32(0), - ), - cms.PSet( - label = cms.string("muons:step1"), - src = cms.InputTag("muons"), - select = cms.string("pt>20 & abs(eta)<2.1 & isGlobalMuon & innerTrack.numberOfValidHits>10 & globalTrack.normalizedChi2>-1 & globalTrack.normalizedChi2<10 & (isolationR03.sumPt+isolationR03.emEt+isolationR03.hadEt)/pt<0.1"), - min = cms.int32(1), - max = cms.int32(1), - ), - cms.PSet( - label = cms.string("jets/calo:step2"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>30 & abs(eta)<2.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(1), - ), - cms.PSet( - label = cms.string("jets/calo:step3"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>30 & abs(eta)<2.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(2), - ), - cms.PSet( - label = cms.string("jets/calo:step4"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>30 & abs(eta)<2.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(3), - ), - cms.PSet( - label = cms.string("jets/calo:step5"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>30 & abs(eta)<2.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(4), - ), - ) -) - -topSingleElectronLooseTriggerDQM = cms.EDAnalyzer("TopHLTSingleLeptonDQM", - ## ------------------------------------------------------ - ## SETUP - ## - ## configuration of the MonitoringEnsemble(s) - ## [mandatory] : optional PSets may be omitted - ## - setup = cms.PSet( - ## sub-directory to write the monitor histograms to - ## [mandatory] : should not be changed w/o explicit - ## communication to TopCom! - directory = cms.string("HLTriggerOffline/Top/TopSingleElectronLooseTriggerDQM/"), - ## [mandatory] - sources = cms.PSet( - muons = cms.InputTag("muons"), - elecs = cms.InputTag("gedGsfElectrons"), - jets = cms.InputTag("ak5CaloJets"), - mets = cms.VInputTag("met", "tcMet", "pfMet"), - pvs = cms.InputTag("offlinePrimaryVertices") - - ), - ## [optional] : when omitted the verbosity level is set to STANDARD - monitoring = cms.PSet( - verbosity = cms.string("DEBUG") - ), - ## [optional] : when omitted all monitoring plots for primary vertices - ## will be filled w/o extras - pvExtras = cms.PSet( - ## when omitted electron plots will be filled w/o additional pre- - ## selection of the primary vertex candidates - select = cms.string("abs(x)<1. & abs(y)<1. & abs(z)<20. & tracksSize>3 & !isFake") - ), - ## [optional] : when omitted all monitoring plots for electrons - ## will be filled w/o extras - elecExtras = cms.PSet( - ## when omitted electron plots will be filled w/o cut on electronId - electronId = cms.PSet( src = cms.InputTag("simpleEleId70cIso"), pattern = cms.int32(1) ), - ## when omitted electron plots will be filled w/o additional pre- - ## selection of the electron candidates - select = cms.string("pt>30 & abs(eta)<2.5"), - ## when omitted isolated electron multiplicity plot will be equi- - ## valent to inclusive electron multiplicity plot - isolation = cms.string("(dr03TkSumPt+dr03EcalRecHitSumEt+dr03HcalTowerSumEt)/pt<0.1"), - ), - ## [optional] : when omitted all monitoring plots for jets - ## will be filled w/o extras - jetExtras = cms.PSet( - ## when omitted monitor plots for pt will be filled from uncorrected - ## jets - jetCorrector = cms.string("ak5CaloL2L3"), - ## when omitted monitor plots will be filled w/o additional cut on - ## jetID - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - ## when omitted no extra selection will be applied on jets before - ## filling the monitor histograms; if jetCorrector is present the - ## selection will be applied to corrected jets - select = cms.string("pt>15 & abs(eta)<2.5 & emEnergyFraction>0.01"), - ## when omitted monitor histograms for b-tagging will not be filled - jetBTaggers = cms.PSet( - trackCountingEff = cms.PSet( - label = cms.InputTag("trackCountingHighEffBJetTags" ), - workingPoint = cms.double(1.25) - ), - trackCountingPur = cms.PSet( - label = cms.InputTag("trackCountingHighPurBJetTags" ), - workingPoint = cms.double(3.00) - ), - secondaryVertex = cms.PSet( - label = cms.InputTag("simpleSecondaryVertexHighEffBJetTags"), - workingPoint = cms.double(2.05) - ) - ), - ), - ## [optional] : when omitted no mass window will be applied - ## for the W mass before filling the event monitoring plots - massExtras = cms.PSet( - lowerEdge = cms.double( 70.), - upperEdge = cms.double(110.) - ), - ## [optional] : when omitted the monitoring plots for triggering - ## will be empty - triggerExtras = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - paths = cms.vstring(['HLT_Ele15_LW_L1R:HLT_QuadJetU15']) - ) - ), - ## ------------------------------------------------------ - ## PRESELECTION - ## - ## setup of the event preselection, which will not - ## be monitored - ## [mandatory] : but may be empty - ## - preselection = cms.PSet( - trigger = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - select = cms.vstring(['HLT_Iso10Mu20_eta2p1_CentralPFJet30_BTagIPIter_v1'])#ONLY ONE PATH - ), - ## [optional] : when omitted no preselection is applied - vertex = cms.PSet( - src = cms.InputTag("offlinePrimaryVertices"), - select = cms.string('abs(x)<1. & abs(y)<1. & abs(z)<20. & tracksSize>3 & !isFake') - ) - ), - ## ------------------------------------------------------ - ## SELECTION - ## - ## monitor histrograms are filled after each selection - ## step, the selection is applied in the order defined - ## by this vector - ## [mandatory] : may be empty or contain an arbitrary - ## number of PSets - selection = cms.VPSet( - cms.PSet( - label = cms.string("Hlt:step0"), - src = cms.InputTag(""), - select = cms.string(""), - min = cms.int32(0), - max = cms.int32(0), - ), - cms.PSet( - label = cms.string("elecs:step1"), - src = cms.InputTag("gedGsfElectrons"), - electronId = cms.PSet( src = cms.InputTag("simpleEleId70cIso"), pattern = cms.int32(1) ), - select = cms.string("pt>15 & abs(eta)<2.5"), - min = cms.int32(1), - ), - cms.PSet( - label = cms.string("jets/calo:step2"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>15 & abs(eta)<2.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(1), - ), - cms.PSet( - label = cms.string("jets/calo:step3"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>15 & abs(eta)<2.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(2), - ), - cms.PSet( - label = cms.string("jets/calo:step4"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>15 & abs(eta)<2.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(3), - ), - cms.PSet( - label = cms.string("jets/calo:step5"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>15 & abs(eta)<2.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(4), - ), - ) -) - -topSingleElectronMediumTriggerDQM = cms.EDAnalyzer("TopHLTSingleLeptonDQM", - ## ------------------------------------------------------ - ## SETUP - ## - ## configuration of the MonitoringEnsemble(s) - ## [mandatory] : optional PSets may be omitted - ## - setup = cms.PSet( - ## sub-directory to write the monitor histograms to - ## [mandatory] : should not be changed w/o explicit - ## communication to TopCom! - directory = cms.string("HLTriggerOffline/Top/TopSingleElectronMediumTriggerDQM/"), - ## [mandatory] - sources = cms.PSet( - muons = cms.InputTag("muons"), - elecs = cms.InputTag("gedGsfElectrons"), - jets = cms.InputTag("ak5CaloJets"), - mets = cms.VInputTag("met", "tcMet", "pfMet"), - pvs = cms.InputTag("offlinePrimaryVertices") - - ), - ## [optional] : when omitted the verbosity level is set to STANDARD - monitoring = cms.PSet( - verbosity = cms.string("DEBUG") - ), - ## [optional] : when omitted all monitoring plots for primary vertices - ## will be filled w/o extras - pvExtras = cms.PSet( - ## when omitted electron plots will be filled w/o additional pre- - ## selection of the primary vertex candidates - select = cms.string("abs(x)<1. & abs(y)<1. & abs(z)<20. & tracksSize>3 & !isFake") - ), - ## [optional] : when omitted all monitoring plots for electrons - ## will be filled w/o extras - elecExtras = cms.PSet( - ## when omitted electron plots will be filled w/o cut on electronId - electronId = cms.PSet( src = cms.InputTag("simpleEleId70cIso"), pattern = cms.int32(1) ), - ## when omitted electron plots will be filled w/o additional pre- - ## selection of the electron candidates - select = cms.string("pt>25 & abs(eta)<2.5 & (dr03TkSumPt+dr03EcalRecHitSumEt+dr03HcalTowerSumEt)/pt<0.1"), - ## when omitted isolated electron multiplicity plot will be equi- - ## valent to inclusive electron multiplicity plot - isolation = cms.string("(dr03TkSumPt+dr03EcalRecHitSumEt+dr03HcalTowerSumEt)/pt<0.1"), - ), - ## [optional] : when omitted all monitoring plots for jets - ## will be filled w/o extras - jetExtras = cms.PSet( - ## when omitted monitor plots for pt will be filled from uncorrected - ## jets - jetCorrector = cms.string("ak5CaloL2L3"), - ## when omitted monitor plots will be filled w/o additional cut on - ## jetID - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - ## when omitted no extra selection will be applied on jets before - ## filling the monitor histograms; if jetCorrector is present the - ## selection will be applied to corrected jets - select = cms.string("pt>15 & abs(eta)<2.5 & emEnergyFraction>0.01"), - ## when omitted monitor histograms for b-tagging will not be filled - jetBTaggers = cms.PSet( - trackCountingEff = cms.PSet( - label = cms.InputTag("trackCountingHighEffBJetTags" ), - workingPoint = cms.double(1.25) - ), - trackCountingPur = cms.PSet( - label = cms.InputTag("trackCountingHighPurBJetTags" ), - workingPoint = cms.double(3.00) - ), - secondaryVertex = cms.PSet( - label = cms.InputTag("simpleSecondaryVertexHighEffBJetTags"), - workingPoint = cms.double(2.05) - ) - ), - ), - ## [optional] : when omitted no mass window will be applied - ## for the W mass before filling the event monitoring plots - massExtras = cms.PSet( - lowerEdge = cms.double( 70.), - upperEdge = cms.double(110.) - ), - ## [optional] : when omitted the monitoring plots for triggering - ## will be empty - triggerExtras = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - paths = cms.vstring([ 'HLT_Ele15_LW_L1R:HLT_QuadJetU15']) - ) - ), - ## ------------------------------------------------------ - ## PRESELECTION - ## - ## setup of the event preselection, which will not - ## be monitored - ## [mandatory] : but may be empty - ## - preselection = cms.PSet( - trigger = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - select = cms.vstring(['HLT_Iso10Mu20_eta2p1_CentralPFJet30_BTagIPIter_v1'])#ONLY ONE PATH - ), - ## [optional] : when omitted no preselection is applied - vertex = cms.PSet( - src = cms.InputTag("offlinePrimaryVertices"), - select = cms.string('abs(x)<1. & abs(y)<1. & abs(z)<20. & tracksSize>3 & !isFake') - ) - ), - ## ------------------------------------------------------ - ## SELECTION - ## - ## monitor histrograms are filled after each selection - ## step, the selection is applied in the order defined - ## by this vector - ## [mandatory] : may be empty or contain an arbitrary - ## number of PSets - selection = cms.VPSet( - cms.PSet( - label = cms.string("Hlt:step0"), - src = cms.InputTag(""), - select = cms.string(""), - min = cms.int32(0), - max = cms.int32(0), - ), - cms.PSet( - label = cms.string("elecs:step1"), - src = cms.InputTag("gedGsfElectrons"), - electronId = cms.PSet( src = cms.InputTag("simpleEleId70cIso"), pattern = cms.int32(1) ), - select = cms.string("pt>25 & abs(eta)<2.5 & (dr03TkSumPt+dr03EcalRecHitSumEt+dr03HcalTowerSumEt)/pt<0.1"), - min = cms.int32(1), - max = cms.int32(1), - ), - cms.PSet( - label = cms.string("jets/calo:step2"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>15 & abs(eta)<2.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(1), - ), - cms.PSet( - label = cms.string("jets/calo:step3"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>15 & abs(eta)<2.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(2), - ), - cms.PSet( - label = cms.string("jets/calo:step4"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>15 & abs(eta)<2.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(3), - ), - cms.PSet( - label = cms.string("jets/calo:step5"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>15 & abs(eta)<2.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(4), - ), - ) -) diff --git a/HLTriggerOffline/Top/python/topSingleLeptonHLTEventValidation_cfi.py b/HLTriggerOffline/Top/python/topSingleLeptonHLTEventValidation_cfi.py new file mode 100644 index 0000000000000..069e65eb958f4 --- /dev/null +++ b/HLTriggerOffline/Top/python/topSingleLeptonHLTEventValidation_cfi.py @@ -0,0 +1,53 @@ +import FWCore.ParameterSet.Config as cms + +# ttbar semi muonique +topSingleMuonHLTValidation = cms.EDAnalyzer('TopSingleLeptonHLTValidation', + # Directory + sDir = cms.untracked.string('HLTValidation/Top/SemiMuonic/'), + # Electrons + sElectrons = cms.untracked.string('gsfElectrons'), + ptElectrons = cms.untracked.double(30.), + etaElectrons = cms.untracked.double(2.5), + isoElectrons = cms.untracked.double(0.1), + minElectrons = cms.untracked.uint32(0), + # Muons + sMuons = cms.untracked.string('muons'), + ptMuons = cms.untracked.double(26.), + etaMuons = cms.untracked.double(2.1), + isoMuons = cms.untracked.double(0.12), + minMuons = cms.untracked.uint32(1), + # Jets + sJets = cms.untracked.string('ak5PFJets'), + ptJets = cms.untracked.double(20.), + etaJets = cms.untracked.double(2.5), + minJets = cms.untracked.uint32(4), + # Trigger + sTrigger = cms.untracked.string("TriggerResults"), + vsPaths = cms.untracked.vstring(['HLT_IsoMu17_eta2p1_TriCentralPFNoPUJet45_35_25','HLT_IsoMu17_eta2p1_TriCentralPFNoPUJet30']), +) + +# ttbar semi electronique +topSingleElectronHLTValidation = cms.EDAnalyzer('TopSingleLeptonHLTValidation', + # Directory + sDir = cms.untracked.string('HLTValidation/Top/SemiElectronic/'), + # Electrons + sElectrons = cms.untracked.string('gsfElectrons'), + ptElectrons = cms.untracked.double(30.), + etaElectrons = cms.untracked.double(2.5), + isoElectrons = cms.untracked.double(0.1), + minElectrons = cms.untracked.uint32(1), + # Muons + sMuons = cms.untracked.string('muons'), + ptMuons = cms.untracked.double(26.), + etaMuons = cms.untracked.double(2.1), + isoMuons = cms.untracked.double(0.12), + minMuons = cms.untracked.uint32(0), + # Jets + sJets = cms.untracked.string('ak5PFJets'), + ptJets = cms.untracked.double(20.), + etaJets = cms.untracked.double(2.5), + minJets = cms.untracked.uint32(4), + # Trigger + sTrigger = cms.untracked.string("TriggerResults"), + vsPaths = cms.untracked.vstring(['HLT_Ele25_CaloIdVT_CaloIsoVL_TrkIdVL_TrkIsoT_TriCentralPFNoPUJet45_35_25','HLT_Ele25_CaloIdVT_CaloIsoVL_TrkIdVL_TrkIsoT_TriCentralPFNoPUJet30']), +) diff --git a/HLTriggerOffline/Top/python/topvalidation_cfi.py b/HLTriggerOffline/Top/python/topvalidation_cfi.py deleted file mode 100644 index a3870fe5c1ad8..0000000000000 --- a/HLTriggerOffline/Top/python/topvalidation_cfi.py +++ /dev/null @@ -1,17 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -HLTTopVal = cms.EDAnalyzer("TopValidation", - OutputMEsInRootFile = cms.bool(False), - TriggerResultsCollection = cms.InputTag("TriggerResults","","HLT"), - hltPaths = cms.vstring('HLT_Mu9','HLT_Mu15','HLT_IsoMu9','HLT_DoubleMu3','HLT_Ele15_SW_L1R', - 'HLT_Ele15_SW_LooseTrackIso_L1R','HLT_DoubleEle10_SW_L1R'), - hltMuonPaths = cms.vstring('HLT_Mu9','HLT_Mu15','HLT_IsoMu9','HLT_DoubleMu3'), - hltEgPaths = cms.vstring('HLT_Ele15_SW_L1R','HLT_Ele15_SW_LooseTrackIso_L1R','HLT_DoubleEle10_SW_L1R'), - hltJetPaths = cms.vstring('HLT_QuadJet30'), - - OutputFileName = cms.string(''), - # DQMFolder = cms.untracked.string("HLT/Top") - FolderName = cms.string("HLT/Top/"), - offlineElectrons = cms.InputTag('gedGsfElectrons') - - ) diff --git a/HLTriggerOffline/Top/python/triggerEff_cfi.py b/HLTriggerOffline/Top/python/triggerEff_cfi.py deleted file mode 100644 index a065304d4d5b6..0000000000000 --- a/HLTriggerOffline/Top/python/triggerEff_cfi.py +++ /dev/null @@ -1,8 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -HLTEff = cms.EDAnalyzer("HLTEffCalculator", - TriggerResCollection = cms.InputTag("TriggerResults","","HLT"), - hltPaths = cms.vstring('HLT_IsoMu24_v15','HLT_IsoMu24_eta2p1_v13','HLT_IsoMu30_v9'), - OutputFileName = cms.string("triggerEfficiency.root"), - verbosity = cms.untracked.int32(0) - ) diff --git a/HLTriggerOffline/Top/src/HLTEfficiencyCalculator.cc b/HLTriggerOffline/Top/src/HLTEfficiencyCalculator.cc deleted file mode 100644 index 060159c0cda61..0000000000000 --- a/HLTriggerOffline/Top/src/HLTEfficiencyCalculator.cc +++ /dev/null @@ -1,82 +0,0 @@ -// -*- C++ -*- -// -// Class: HLTEffCalculator -// -/**\class HLTEffCalculator HLTEffCalculator.cc DQM/HLTEffCalculator/src/HLTEffCalculator.cc - - Description: - - Implementation: - -*/ -// -// Original Author: Abideh Jafari -// Created: Wed Aug 01 09:06:32 CEST 2012 -// -// - - -#include "HLTriggerOffline/Top/interface/HLTEfficiencyCalculator.h" -#include "FWCore/Common/interface/TriggerNames.h" -#include "TFile.h" - - -HLTEffCalculator::HLTEffCalculator(const edm::ParameterSet& iConfig) - -{ - - - outputFileName = iConfig.getParameter("OutputFileName"); - HLTresCollection = iConfig.getParameter("TriggerResCollection"); - verbosity = iConfig.getUntrackedParameter("verbosity",0); - myEffHandler = new EfficiencyHandler("TopHLTs", iConfig.getParameter >("hltPaths"), verbosity); - HLTresCollectionToken_ = consumes(iConfig.getParameter("TriggerResCollection")); -} - -HLTEffCalculator::~HLTEffCalculator() -{ - - // do anything here that needs to be done at desctruction time - // (e.g. close files, deallocate resources etc.) - -} - - -// -// member functions -// - - -// ------------ method called to for each event ------------ -void -HLTEffCalculator::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) -{ - using namespace edm; - - - // Trigger - Handle trh; - iEvent.getByToken(HLTresCollectionToken_,trh); - if( ! trh.isValid() ) { - LogDebug("") << "HL TriggerResults with label ["+HLTresCollection.encode()+"] not found!"; - return; - } - myEffHandler->Fill(iEvent,*trh); - -} - - - -// ------------ method called once each job just before starting event loop ------------ -void -HLTEffCalculator::beginJob() -{} - -// ------------ method called once each job just after ending the event loop ------------ -void -HLTEffCalculator::endJob() { - TFile * F = new TFile(outputFileName.c_str(),"recreate"); - myEffHandler->WriteAll(F); - F->Save(); -} - diff --git a/HLTriggerOffline/Top/src/TopHLTDQMHelper.cc b/HLTriggerOffline/Top/src/TopHLTDQMHelper.cc deleted file mode 100644 index bbd4502892535..0000000000000 --- a/HLTriggerOffline/Top/src/TopHLTDQMHelper.cc +++ /dev/null @@ -1,149 +0,0 @@ -#include "HLTriggerOffline/Top/interface/TopHLTDQMHelper.h" -#include -/*Originally from DQM/Physics package, written by Roger Wolf and Jeremy Andrea*/ - -using namespace std; - -CalculateHLT::CalculateHLT(int maxNJets, double wMass): - failed_(false), maxNJets_(maxNJets), wMass_(wMass), massWBoson_(-1.), massTopQuark_(-1.),tmassWBoson_(-1),tmassTopQuark_(-1),mlb_(-1) -{ -} - - -double -CalculateHLT::massWBoson(const std::vector& jets) -{ - if(!failed_&& massWBoson_<0) operator()(jets); return massWBoson_; -} - - -double -CalculateHLT::massTopQuark(const std::vector& jets) -{ - if(!failed_&& massTopQuark_<0) operator()(jets); return massTopQuark_; -} - -/* -double -Calculate::tmassWBoson(const T& mu, const reco::MET& met, const reco::Jet& b) -{ - if(!failed_&& tmassWBoson_<0) operator()(b,mu,met); return tmassWBoson_; -} - - -double -Calculate::masslb(const T& mu, const reco::MET& met, const reco::Jet& b) -{ - if(!failed_&& mlb_<0) operator()(b,mu,met); return mlb_; -} - - -double -Calculate::tmassTopQuark(const T& lepton, const reco::MET& met, const reco::Jet& b) -{ - if(!failed_&& tmassTopQuark_<0) operator()(b,lepton,met); return tmassTopQuark_; -} - - -void Calculate::operator()( const reco::Jet& bJet, const T& lepton, const reco::MET& met){ - reco::Particle::LorentzVector WT = lepton.p4() + met.p4(); - tmassWBoson_ = sqrt((WT.px()*WT.px()) + (WT.py()*WT.py())); - reco::Particle::LorentzVector topT = WT + bJet.p4(); - tmassTopQuark_ = sqrt((topT.px()*topT.px()) + (topT.py()*topT.py())); - reco::Particle::LorentzVector lb = bJet.p4() + lepton.p4(); - mlb_ = lb.mass(); -}*/ - - -double -CalculateHLT::tmassWBoson(reco::RecoCandidate* mu, const reco::MET& met, const reco::Jet& b) -{ - if(!failed_&& tmassWBoson_<0) operator()(b,mu,met); return tmassWBoson_; -} - - -double -CalculateHLT::masslb(reco::RecoCandidate* mu, const reco::MET& met, const reco::Jet& b) -{ - if(!failed_&& mlb_<0) operator()(b,mu,met); return mlb_; -} - - -double -CalculateHLT::tmassTopQuark(reco::RecoCandidate* lepton, const reco::MET& met, const reco::Jet& b) -{ - if(!failed_&& tmassTopQuark_<0) operator()(b,lepton,met); return tmassTopQuark_; -} - - -void CalculateHLT::operator()( const reco::Jet& bJet, reco::RecoCandidate* lepton, const reco::MET& met){ - double metT = sqrt(pow(met.px(),2) + pow(met.py(),2)); - double lepT = sqrt(pow(lepton->px(),2) + pow(lepton->py(),2)); - double bT = sqrt(pow(bJet.px(),2) + pow(bJet.py(),2)); - reco::Particle::LorentzVector WT = lepton->p4() + met.p4(); - cout<<"in calculate:\n\t"<pt()<<"\t"<p4(); - mlb_ = lb.mass(); -} - - -void -CalculateHLT::operator()(const std::vector& jets) -{ - - if(maxNJets_<0) maxNJets_=jets.size(); - failed_= jets.size()<(unsigned int) maxNJets_; - if( failed_){ return; } - - // associate those jets with maximum pt of the vectorial - // sum to the hadronic decay chain - double maxPt=-1.; - std::vector maxPtIndices; - maxPtIndices.push_back(-1); - maxPtIndices.push_back(-1); - maxPtIndices.push_back(-1); - for(int idx=0; idx wMassIndices; - wMassIndices.push_back(-1); - wMassIndices.push_back(-1); - for(unsigned idx=0; idxmaxPtIndices[jdx] ) continue; - reco::Particle::LorentzVector sum = jets[maxPtIndices[idx]].p4()+jets[maxPtIndices[jdx]].p4(); - if( wDist<0. || wDist>fabs(sum.mass()-wMass_) ){ - wDist=fabs(sum.mass()-wMass_); - wMassIndices.clear(); - wMassIndices.push_back(maxPtIndices[idx]); - wMassIndices.push_back(maxPtIndices[jdx]); - } - } - } - massWBoson_= (jets[wMassIndices[0]].p4()+ - jets[wMassIndices[1]].p4()).mass(); -} - - - diff --git a/HLTriggerOffline/Top/src/TopHLTDiLeptonOfflineDQM.cc b/HLTriggerOffline/Top/src/TopHLTDiLeptonOfflineDQM.cc deleted file mode 100644 index e866bfe3073bd..0000000000000 --- a/HLTriggerOffline/Top/src/TopHLTDiLeptonOfflineDQM.cc +++ /dev/null @@ -1,738 +0,0 @@ -//#include -#include "JetMETCorrections/Objects/interface/JetCorrectionsRecord.h" -#include "DataFormats/JetReco/interface/CaloJet.h" -#include "DataFormats/BTauReco/interface/JetTag.h" -#include "HLTriggerOffline/Top/src/TopHLTDiLeptonOfflineDQM.h" -#include "DataFormats/JetReco/interface/PFJet.h" -#include "HLTriggerOffline/Top/interface/TopHLTDQMHelper.h" - -/*Originally from DQM/Physics by R. Wolf and J. Andrea*/ - -namespace TopDiLeptonOffline { - - MonitorEnsemble::MonitorEnsemble(const char* label, const edm::ParameterSet& cfg) : - label_(label), eidPattern_(0), elecIso_(0), elecSelect_(0), muonIso_(0), muonSelect_(0), jetIDSelect_(0), - lowerEdge_(-1.), upperEdge_(-1.), elecMuLogged_(0), diMuonLogged_(0), diElecLogged_(0) - { - // sources have to be given; this PSet is not optional - edm::ParameterSet sources=cfg.getParameter("sources"); - muons_= sources.getParameter("muons"); - elecs_= sources.getParameter("elecs"); - jets_ = sources.getParameter("jets" ); - mets_ = sources.getParameter >("mets" ); - - // elecExtras are optional; they may be omitted or empty - if( cfg.existsAs("elecExtras") ){ - edm::ParameterSet elecExtras=cfg.getParameter("elecExtras"); - // select is optional; in case it's not found no - // selection will be applied - if( elecExtras.existsAs("select") ){ - elecSelect_= new StringCutObjectSelector(elecExtras.getParameter("select")); - } - // isolation is optional; in case it's not found no - // isolation will be applied - if( elecExtras.existsAs("isolation") ){ - elecIso_= new StringCutObjectSelector(elecExtras.getParameter("isolation")); - } - // electronId is optional; in case it's not found the - // InputTag will remain empty - if( elecExtras.existsAs("electronId") ){ - edm::ParameterSet elecId=elecExtras.getParameter("electronId"); - electronId_= elecId.getParameter("src"); - eidPattern_= elecId.getParameter("pattern"); - } - } - // muonExtras are optional; they may be omitted or empty - if( cfg.existsAs("muonExtras") ){ - edm::ParameterSet muonExtras=cfg.getParameter("muonExtras"); - // select is optional; in case it's not found no - // selection will be applied - if( muonExtras.existsAs("select") ){ - muonSelect_= new StringCutObjectSelector(muonExtras.getParameter("select")); - } - // isolation is optional; in case it's not found no - // isolation will be applied - if( muonExtras.existsAs("isolation") ){ - muonIso_= new StringCutObjectSelector(muonExtras.getParameter("isolation")); - } - } - // jetExtras are optional; they may be omitted or empty - if( cfg.existsAs("jetExtras") ){ - edm::ParameterSet jetExtras=cfg.getParameter("jetExtras"); - // jetCorrector is optional; in case it's not found - // the InputTag will remain empty - if( jetExtras.existsAs("jetCorrector") ){ - jetCorrector_= jetExtras.getParameter("jetCorrector"); - } - // read jetID information if it exists - if(jetExtras.existsAs("jetID")){ - edm::ParameterSet jetID=jetExtras.getParameter("jetID"); - jetIDLabel_ =jetID.getParameter("label"); - jetIDSelect_= new StringCutObjectSelector(jetID.getParameter("select")); - } - // select is optional; in case it's not found no - // selection will be applied (only implemented for - // CaloJets at the moment) - if( jetExtras.existsAs("select") ){ - jetSelect_= jetExtras.getParameter("select"); - } - } - // triggerExtras are optional; they may be omitted or empty - if( cfg.existsAs("triggerExtras") ){ - edm::ParameterSet triggerExtras=cfg.getParameter("triggerExtras"); - triggerTable_=triggerExtras.getParameter("src"); - elecMuPaths_ =triggerExtras.getParameter >("pathsELECMU"); - diMuonPaths_ =triggerExtras.getParameter >("pathsDIMUON"); - } - // massExtras is optional; in case it's not found no mass - // window cuts are applied for the same flavor monitor - // histograms - if( cfg.existsAs("massExtras") ){ - edm::ParameterSet massExtras=cfg.getParameter("massExtras"); - lowerEdge_= massExtras.getParameter("lowerEdge"); - upperEdge_= massExtras.getParameter("upperEdge"); - } - - // setup the verbosity level for booking histograms; - // per default the verbosity level will be set to - // STANDARD. This will also be the chosen level in - // the case when the monitoring PSet is not found - verbosity_=STANDARD; - if( cfg.existsAs("monitoring") ){ - edm::ParameterSet monitoring=cfg.getParameter("monitoring"); - if(monitoring.getParameter("verbosity") == "DEBUG" ) - verbosity_= DEBUG; - if(monitoring.getParameter("verbosity") == "VERBOSE" ) - verbosity_= VERBOSE; - if(monitoring.getParameter("verbosity") == "STANDARD") - verbosity_= STANDARD; - } - // and don't forget to do the histogram booking - book(cfg.getParameter("directory")); - } - - void - MonitorEnsemble::book(std::string directory) - { - //set up the current directory path - std::string current(directory); current+=label_; - store_=edm::Service().operator->(); - store_->setCurrentFolder(current); - - // determine number of bins for trigger monitoring - unsigned int nElecMu=elecMuPaths_.size(); - unsigned int nDiMuon=diMuonPaths_.size(); - - // --- [STANDARD] --- // - //Run Number - hists_["RunNumb_" ] = store_->book1D("RunNumber" , "Run Nr." , 1.e4, 1.5e5, 3.e5); - // invariant mass of opposite charge lepton pair (only filled for same flavor) - hists_["invMass_" ] = store_->book1D("InvMass" , "M(lep1, lep2)" , 80, 0., 320.); - // invariant mass of opposite charge lepton pair (only filled for same flavor) - hists_["invMassLog_" ] = store_->book1D("InvMassLog" , "log_{10}(M(lep1, lep2))" , 80, .1, 2.5); - // invariant mass of same charge lepton pair (log10 for low mass region, only filled for same flavor) - hists_["invMassWC_" ] = store_->book1D("InvMassWC" , "M_{WC}(L1, L2)" , 80, 0., 320.); - // invariant mass of same charge lepton pair (log10 for low mass region, only filled for same flavor) - hists_["invMassWCLog_"] = store_->book1D("InvMassLogWC", "log_{10}(M_{WC})" , 80, .1, 2.5); - // decay channel [1]: muon/muon, [2]:elec/elec, [3]:elec/muon - hists_["decayChannel_"] = store_->book1D("DecayChannel", "Decay Channel" , 3, 0, 3); - // trigger efficiency estimates for the electron muon channel - hists_["elecMuEff_" ] = store_->book1D("ElecMuEff" , "Eff(e/#mu paths)" , nElecMu, 0., nElecMu); - // monitored trigger occupancy for the electron muon channel - hists_["elecMuMon_" ] = store_->book1D("ElecMuMon" , "Mon(e/#mu paths)" , nElecMu, 0., nElecMu); - // trigger efficiency estimates for the di muon channel - hists_["diMuonEff_" ] = store_->book1D("DiMuonEff" , "Eff(#mu/#mu paths)" , nDiMuon, 0., nDiMuon); - // monitored trigger occupancy for the di muon channel - hists_["diMuonMon_" ] = store_->book1D("DiMuonMon" , "Mon(#mu/#mu paths)" , nDiMuon, 0., nDiMuon); - // pt of the leading lepton - hists_["lep1Pt_" ] = store_->book1D("Lep1Pt" , "pt(lep1)" , 50, 0., 200.); - // pt of the 2. leading lepton - hists_["lep2Pt_" ] = store_->book1D("Lep2Pt" , "pt(lep2)" , 50, 0., 200.); - // multiplicity of jets with pt>30 (corrected to L2+L3) - hists_["jetMult_" ] = store_->book1D("JetMult" , "N_{30}(jet)" , 21, -0.5, 20.5); - // MET (calo) - hists_["metCalo_" ] = store_->book1D("METCalo" , "MET_{Calo}" , 50, 0., 200.); - - // set bin labels for trigger monitoring - triggerBinLabels(std::string("elecMu"), elecMuPaths_); - triggerBinLabels(std::string("diMuon"), diMuonPaths_); - // set bin labels for decayChannel_ - hists_["decayChannel_"]->setBinLabel( 1, "#mu e" , 1); - hists_["decayChannel_"]->setBinLabel( 2, "#mu #mu", 1); - hists_["decayChannel_"]->setBinLabel( 3, "e e" , 1); - - if( verbosity_==STANDARD) return; - - // --- [VERBOSE] --- // - // mean eta of the candidate leptons - hists_["sumEtaL1L2_" ] = store_->book1D("SumEtaL1L2" , "<#eta>(lep1, lep2)" , 100, -5., 5.); - // deltaEta between the 2 candidate leptons - hists_["dEtaL1L2_" ] = store_->book1D("DEtaL1L2" , "#Delta#eta(lep1,lep2)" , 80, -4., 4.); - // deltaPhi between the 2 candidate leptons - hists_["dPhiL1L2_" ] = store_->book1D("DPhiL1L2" , "#Delta#phi(lep1,lep2)" , 64, -3.2, 3.2); - // pt of the candidate electron (depending on the decay channel) - hists_["elecPt_" ] = store_->book1D("ElecPt" , "pt(e)" , 50, 0., 200.); - // relative isolation of the candidate electron (depending on the decay channel) - hists_["elecRelIso_" ] = store_->book1D("ElecRelIso" , "Iso_{Rel}(e)" , 50, 0., 1.); - // pt of the canddiate muon (depending on the decay channel) - hists_["muonPt_" ] = store_->book1D("MuonPt" , "pt(#mu)" , 50, 0., 200.); - // relative isolation of the candidate muon (depending on the decay channel) - hists_["muonRelIso_" ] = store_->book1D("MuonRelIso" , "Iso_{Rel}(#mu)" , 50, 0., 1.); - // pt of the 1. leading jet (corrected to L2+L3) - hists_["jet1Pt_" ] = store_->book1D("Jet1Pt" , "pt_{L2L3}(jet1)" , 60, 0., 300.); - // pt of the 2. leading jet (corrected to L2+L3) - hists_["jet2Pt_" ] = store_->book1D("Jet2Pt" , "pt_{L2L3}(jet2)" , 60, 0., 300.); - // MET (PF) - hists_["metPflow_" ] = store_->book1D("METPflow" , "MET_{Pflow}" , 50, 0., 200.); - // MET (TC) - hists_["metTC_" ] = store_->book1D("METTC" , "MET_{TC}" , 50, 0., 200.); - // dz for muons (to suppress cosmis) - hists_["muonDelZ_" ] = store_->book1D("MuonDelZ" , "d_{z}(#mu)" , 50, -25., 25.); - // dxy for muons (to suppress cosmics) - hists_["muonDelXY_" ] = store_->book2D("MuonDelXY" , "d_{xy}(#mu)" , 50, -1., 1., 50, -1., 1.); - // lepton multiplicity after std isolation - hists_["lepMultIso_" ] = store_->book2D("LepMultIso" , "N_{Iso}(e) vs N_{Iso}(#mu)" , 5, 0., 5., 5, 0., 5.); - - // set axes titles for dxy for muons - hists_["muonDelXY_" ]->setAxisTitle( "x [cm]", 1); hists_["muonDelXY_" ]->setAxisTitle( "y [cm]", 2); - // set axes titles for lepton multiplicity after std isolation - hists_["lepMultIso_" ]->setAxisTitle( "N_{Iso}(#mu)", 1); hists_["lepMultIso_" ]->setAxisTitle( "N_{Iso}(elec)", 2); - - if( verbosity_==VERBOSE) return; - - // --- [DEBUG] --- // - // electron multiplicity after std isolation - hists_["elecMultIso_" ] = store_->book1D("ElecMultIso" , "N_{Iso}(e)" , 11, -0.5, 10.5); - // muon multiplicity after std isolation - hists_["muonMultIso_" ] = store_->book1D("MuonMultIso" , "N_{Iso}(#mu)" , 11, -0.5, 10.5); - // calo isolation of the candidate muon (depending on the decay channel) - hists_["muonCalIso_" ] = store_->book1D("MuonCalIso" , "Iso_{Cal}(#mu)" , 50, 0., 1.); - // track isolation of the candidate muon (depending on the decay channel) - hists_["muonTrkIso_" ] = store_->book1D("MuonTrkIso" , "Iso_{Trk}(#mu)" , 50, 0., 1.); - // calo isolation of the candidate electron (depending on the decay channel) - hists_["elecCalIso_" ] = store_->book1D("ElecCalIso" , "Iso_{Cal}(e)" , 50, 0., 1.); - // track isolation of the candidate electron (depending on the decay channel) - hists_["elecTrkIso_" ] = store_->book1D("ElecTrkIso" , "Iso_{Trk}(e)" , 50, 0., 1.); - // eta of the leading jet - hists_["jet1Eta_" ] = store_->book1D("Jet1Eta" , "#eta(jet1)" , 30, -5., 5.); - // eta of the 2. leading jet - hists_["jet2Eta_" ] = store_->book1D("Jet2Eta" , "#eta(jet2)" , 30, -5., 5.); - // pt of the 1. leading jet (not corrected) - hists_["jet1PtRaw_" ] = store_->book1D("Jet1PtRaw" , "pt_{Raw}(jet1)" , 60, 0., 300.); - // pt of the 2. leading jet (not corrected) - hists_["jet2PtRaw_" ] = store_->book1D("Jet2PtRaw" , "pt_{Raw}(jet2)" , 60, 0., 300.); - // deltaEta between the 2 leading jets - hists_["dEtaJet1Jet2_"] = store_->book1D("DEtaJet1Jet2", "#Delta#eta(jet1,jet2)" , 80, -4., 4.); - // deltaEta between the lepton and the leading jet - hists_["dEtaJet1Lep1_"] = store_->book1D("DEtaJet1Lep1", "#Delta#eta(jet1,lep1)" , 80, -4., 4.); - // deltaEta between the lepton and MET - hists_["dEtaLep1MET_" ] = store_->book1D("DEtaLep1MET" , "#Delta#eta(lep1,MET)" , 80, -4., 4.); - // deltaEta between leading jet and MET - hists_["dEtaJet1MET_" ] = store_->book1D("DEtaJet1MET" , "#Delta#eta(jet1,MET)" , 80, -4., 4.); - // deltaPhi of 2 leading jets - hists_["dPhiJet1Jet2_"] = store_->book1D("DPhiJet1Jet2", "#Delta#phi(jet1,jet2)" , 64, -3.2, 3.2); - // deltaPhi of 1. lepton and 1. jet - hists_["dPhiJet1Lep1_"] = store_->book1D("DPhiJet1Lep1", "#Delta#phi(jet1,lep1)" , 64, -3.2, 3.2); - // deltaPhi of 1. lepton and MET - hists_["dPhiLep1MET_" ] = store_->book1D("DPhiLep1MET" , "#Delta#phi(lep1,MET)" , 64, -3.2, 3.2); - // deltaPhi of 1. jet and MET - hists_["dPhiJet1MET_" ] = store_->book1D("DPhiJet1MET" , "#Delta#phi(jet1,MET)" , 64, -3.2, 3.2); - // selected dimuon events - hists_["diMuonLogger_"] = store_->book2D("DiMuonLogger", "Logged DiMuon Events" , 8, 0., 8., 10, 0., 10.); - // selected dielec events - hists_["diElecLogger_"] = store_->book2D("DiElecLogger", "Logged DiElec Events" , 8, 0., 8., 10, 0., 10.); - // selected elemu events - hists_["elecMuLogger_"] = store_->book2D("ElecMuLogger", "Logged ElecMu Events" , 8, 0., 8., 10, 0., 10.); - - // set bin labels for trigger monitoring - loggerBinLabels(std::string("diMuonLogger_")); - loggerBinLabels(std::string("diElecLogger_")); - loggerBinLabels(std::string("elecMuLogger_")); - return; - } - - void - MonitorEnsemble::fill(const edm::Event& event, const edm::EventSetup& setup, - edm::Handle triggerTable, edm::Handle > muons, - edm::Handle > electronId, edm::Handle > elecs, - edm::Handle > jets, edm::Handle jetID, - std::vector< edm::Handle > > mets) - { - // fetch trigger event if configured such - if(!triggerTable_.label().empty()) { - if( !triggerTable.isValid() ) return; - } - - /* - ------------------------------------------------------------ - - Run and Inst. Luminosity information (Inst. Lumi. filled now with a dummy value=5.0) - - ------------------------------------------------------------ - */ - - if (!event.eventAuxiliary().run()) return; - fill("RunNumb_", event.eventAuxiliary().run()); - - double dummy=5.; fill("InstLumi_", dummy); - - - /* - ------------------------------------------------------------ - - Muon Selection - - ------------------------------------------------------------ - */ - - // buffer isolated muons - std::vector isoMuons; - - if( !muons.isValid() ) return; - - for(edm::View::const_iterator muon=muons->begin(); muon!=muons->end(); ++muon){ - // restrict to globalMuons - if( muon->isGlobalMuon() ){ - fill("muonDelZ_" , muon->globalTrack()->vz()); - fill("muonDelXY_", muon->globalTrack()->vx(), muon->globalTrack()->vy()); - // apply preselection - if(!muonSelect_ || (*muonSelect_)(*muon)){ - double isolationTrk = muon->pt()/(muon->pt()+muon->isolationR03().sumPt); - double isolationCal = muon->pt()/(muon->pt()+muon->isolationR03().emEt+muon->isolationR03().hadEt); - double isolationRel = (muon->isolationR03().sumPt+muon->isolationR03().emEt+muon->isolationR03().hadEt)/muon->pt(); - fill("muonTrkIso_" , isolationTrk); fill("muonCalIso_" , isolationCal); fill("muonRelIso_" , isolationRel); - if(!muonIso_ || (*muonIso_)(*muon)) isoMuons.push_back(&(*muon)); - } - } - } - fill("muonMultIso_", isoMuons.size()); - - /* - ------------------------------------------------------------ - - Electron Selection - - ------------------------------------------------------------ - */ - - // buffer isolated electronss - std::vector isoElecs; - if(!electronId_.label().empty()) { - if( !electronId.isValid() ) return; - } - - if( !elecs.isValid() ) return; - - for(edm::View::const_iterator elec=elecs->begin(); elec!=elecs->end(); ++elec){ - // restrict to electrons with good electronId - int idx = elec-elecs->begin(); - if( electronId_.label().empty() ? true : ((int)(*electronId)[elecs->refAt(idx)] & eidPattern_) ){ - // apply preselection - if(!elecSelect_ || (*elecSelect_)(*elec)){ - double isolationTrk = elec->pt()/(elec->pt()+elec->dr03TkSumPt()); - double isolationCal = elec->pt()/(elec->pt()+elec->dr03EcalRecHitSumEt()+elec->dr03HcalTowerSumEt()); - double isolationRel = (elec->dr03TkSumPt()+elec->dr03EcalRecHitSumEt()+elec->dr03HcalTowerSumEt())/elec->pt(); - fill("elecTrkIso_" , isolationTrk); fill("elecCalIso_" , isolationCal); fill("elecRelIso_" , isolationRel); - if(!elecIso_ || (*elecIso_)(*elec)) isoElecs.push_back(&(*elec)); - } - } - } - fill("elecMultIso_", isoElecs.size()); - - /* - ------------------------------------------------------------ - - Jet Selection - - ------------------------------------------------------------ - */ - - const JetCorrector* corrector=0; - if(!jetCorrector_.empty()){ - // check whether a jet correcto is in the event setup or not - if(setup.find( edm::eventsetup::EventSetupRecordKey::makeKey() )){ - corrector = JetCorrector::getJetCorrector(jetCorrector_, setup); - } - else{ - edm::LogVerbatim( "TopHLTDiLeptonOfflineDQM" ) - << "\n" - << "------------------------------------------------------------------------------------- \n" - << " No JetCorrectionsRecord available from EventSetup: \n" - << " - Jets will not be corrected. \n" - << " - If you want to change this add the following lines to your cfg file: \n" - << " \n" - << " ## load jet corrections \n" - << " process.load(\"JetMETCorrections.Configuration.JetCorrectionServicesAllAlgos_cff\") \n" - << " process.prefer(\"ak5CaloL2L3\") \n" - << " \n" - << "------------------------------------------------------------------------------------- \n"; - } - } - - unsigned int mult=0; - // buffer leadingJets - std::vector leadingJets; - if( !jets.isValid() ) return; - - if(jetIDSelect_){ - if( !jetID.isValid() ) return; - } - - for(edm::View::const_iterator jet=jets->begin(); jet!=jets->end(); ++jet){ - unsigned int idx=jet-jets->begin(); - if( jetIDSelect_ && dynamic_cast(jets->refAt(idx).get())){ - if(!(*jetIDSelect_)((*jetID)[jets->refAt(idx)])) continue; - } - // chekc additional jet selection for calo, pf and bare reco jets - if(dynamic_cast(&*jet)){ - reco::CaloJet sel = dynamic_cast(*jet); sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.); - StringCutObjectSelector jetSelect(jetSelect_); if(!jetSelect(sel)){ continue;} - } - else if(dynamic_cast(&*jet)){ - reco::PFJet sel= dynamic_cast(*jet); sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.); - StringCutObjectSelector jetSelect(jetSelect_); if(!jetSelect(sel)) continue; - } - else{ - reco::Jet sel = *jet; sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.); - StringCutObjectSelector jetSelect(jetSelect_); if(!jetSelect(sel)) continue; - } - // check for overlaps - bool overlap=false; - for(std::vector::const_iterator elec=isoElecs.begin(); elec!=isoElecs.end(); ++elec){ - if(reco::deltaR((*elec)->eta(), (*elec)->phi(), jet->eta(), jet->phi())<0.4){overlap=true; break;} - } if(overlap){continue;} - // prepare jet to fill monitor histograms - reco::Jet monitorJet=*jet; monitorJet.scaleEnergy(corrector ? corrector->correction(*jet) : 1.); - ++mult; // determine jet multiplicity - if(idx==0) { - leadingJets.push_back(monitorJet); - fill("jet1Pt_" , monitorJet.pt()); - fill("jet1PtRaw_" , jet->pt() ); - fill("jet1Eta_" , jet->eta()); - } - if(idx==1) { - leadingJets.push_back(monitorJet); - fill("jet2Pt_" , monitorJet.pt()); - fill("jet2PtRaw_" , jet->pt() ); - fill("jet2Eta_" , jet->eta()); - } - } - if(leadingJets.size()>1){ - fill("dEtaJet1Jet2_" , leadingJets[0].eta()-leadingJets[1].eta()); - fill("dPhiJet1Jet2_" , reco::deltaPhi(leadingJets[0].phi(), leadingJets[1].phi())); - if( !isoMuons.empty() ){ - if( isoElecs.empty() || isoMuons[0]->pt()>isoElecs[0]->pt() ){ - fill("dEtaJet1Lep1_" , isoMuons[0]->eta()-leadingJets[0].eta()); - fill("dPhiJet1Lep1_" , reco::deltaPhi(isoMuons[0]->phi() , leadingJets[0].phi())); - } - } - if( !isoElecs.empty() ){ - if( isoMuons.empty() || isoElecs[0]->pt()>isoMuons[0]->pt() ){ - fill("dEtaJet1Lep1_" , isoElecs[0]->eta()-leadingJets[0].eta()); - fill("dPhiJet1Lep1_" , reco::deltaPhi(isoElecs[0]->phi() , leadingJets[0].phi())); - } - } - } - fill("jetMult_", mult); - - /* - ------------------------------------------------------------ - - MET Selection - - ------------------------------------------------------------ - */ - - // buffer for event logging - reco::MET caloMET; - //for(std::vector::const_iterator met_=mets_.begin(); met_!=mets_.end(); ++met_){ - //for( met_=mets_.begin(); met_!=mets_.end(); ++met_){ - for( int i=0; i > met = mets[i]; - if( !met.isValid() ) continue; - - if(met->begin()!=met->end()){ - unsigned int idx=i; - if(idx==0){ - caloMET=*met->begin(); - fill("metCalo_", met->begin()->et()); - if(!leadingJets.empty()){ - fill("dEtaJet1MET_" , leadingJets[0].eta()-met->begin()->eta()); - fill("dPhiJet1MET_" , reco::deltaPhi(leadingJets[0].phi(), met->begin()->phi())); - } - if( !isoMuons.empty() ){ - if( isoElecs.empty() || isoMuons[0]->pt()>isoElecs[0]->pt() ){ - fill("dEtaLep1MET_" , isoMuons[0]->eta()-met->begin()->eta()); - fill("dPhiLep1MET_" , reco::deltaPhi(isoMuons[0]->phi(), met->begin()->phi())); - } - } - if( !isoElecs.empty() ){ - if( isoMuons.empty() || isoElecs[0]->pt()>isoMuons[0]->pt() ){ - fill("dEtaLep1MET_" , isoElecs[0]->eta()-met->begin()->eta()); - fill("dPhiLep1MET_" , reco::deltaPhi(isoElecs[0]->phi(), met->begin()->phi())); - } - } - } - if(idx==1){ fill("metTC_" , met->begin()->et());} - if(idx==2){ fill("metPflow_", met->begin()->et());} - } - } - - - /* - ------------------------------------------------------------ - - Event Monitoring - - ------------------------------------------------------------ - */ - - // check number of isolated leptons - fill("lepMultIso_", isoMuons.size(), isoElecs.size()); - // ELECMU channel - if( decayChannel(isoMuons, isoElecs) == ELECMU ){ - fill("decayChannel_", 0.5); - double mass = (isoElecs[0]->p4()+isoMuons[0]->p4()).mass(); - if( (lowerEdge_==-1. && upperEdge_==-1.) || (lowerEdge_eta()-isoMuons[0]->eta()); - fill("sumEtaL1L2_", (isoElecs[0]->eta()+isoMuons[0]->eta())/2); - fill("dPhiL1L2_" , reco::deltaPhi(isoElecs[0]->phi(), isoMuons[0]->eta())); - fill("elecPt_", isoElecs[0]->pt()); fill("muonPt_", isoMuons[0]->pt()); - fill("lep1Pt_", isoElecs[0]->pt()>isoMuons[0]->pt() ? isoElecs[0]->pt() : isoMuons[0]->pt()); - fill("lep2Pt_", isoElecs[0]->pt()>isoMuons[0]->pt() ? isoMuons[0]->pt() : isoElecs[0]->pt()); - // fill plots for trigger monitoring - if(!triggerTable_.label().empty()) fill(event, *triggerTable, "elecMu", elecMuPaths_); - if(elecMuLogged_<=hists_.find("elecMuLogger_")->second->getNbinsY()){ - // log runnumber, lumi block, event number & some - // more pysics infomation for interesting events - fill("elecMuLogger_", 0.5, elecMuLogged_+0.5, event.eventAuxiliary().run()); - fill("elecMuLogger_", 1.5, elecMuLogged_+0.5, event.eventAuxiliary().luminosityBlock()); - fill("elecMuLogger_", 2.5, elecMuLogged_+0.5, event.eventAuxiliary().event()); - fill("elecMuLogger_", 3.5, elecMuLogged_+0.5, isoMuons[0]->pt()); - fill("elecMuLogger_", 4.5, elecMuLogged_+0.5, isoElecs[0]->pt()); - if(leadingJets.size()>0) fill("elecMuLogger_", 5.5, elecMuLogged_+0.5, leadingJets[0].pt()); - if(leadingJets.size()>1) fill("elecMuLogger_", 6.5, elecMuLogged_+0.5, leadingJets[1].pt()); - fill("elecMuLogger_", 7.5, elecMuLogged_+0.5, caloMET.et()); - ++elecMuLogged_; - } - } - } - - // DIMUON channel - if( decayChannel(isoMuons, isoElecs) == DIMUON ){ - fill("decayChannel_", 1.5); - int charge = isoMuons[0]->charge()*isoMuons[1]->charge(); - double mass = (isoMuons[0]->p4()+isoMuons[1]->p4()).mass(); - - fill(charge<0 ? "invMass_" : "invMassWC_" , mass ); - fill(charge<0 ? "invMassLog_" : "invMassWCLog_" , log10(mass)); - if((lowerEdge_==-1. && upperEdge_==-1.) || (lowerEdge_eta()-isoMuons[1]->eta() ); - fill("sumEtaL1L2_", (isoMuons[0]->eta()+isoMuons[1]->eta())/2); - fill("dPhiL1L2_", reco::deltaPhi(isoMuons[0]->phi(),isoMuons[1]->phi()) ); - fill("muonPt_", isoMuons[0]->pt()); fill("muonPt_", isoMuons[1]->pt()); - fill("lep1Pt_", isoMuons[0]->pt()); fill("lep2Pt_", isoMuons[1]->pt()); - // fill plots for trigger monitoring - if(!triggerTable_.label().empty()) fill(event, *triggerTable, "diMuon", diMuonPaths_); - if(diMuonLogged_<=hists_.find("diMuonLogger_")->second->getNbinsY()){ - // log runnumber, lumi block, event number & some - // more pysics infomation for interesting events - fill("diMuonLogger_", 0.5, diMuonLogged_+0.5, event.eventAuxiliary().run()); - fill("diMuonLogger_", 1.5, diMuonLogged_+0.5, event.eventAuxiliary().luminosityBlock()); - fill("diMuonLogger_", 2.5, diMuonLogged_+0.5, event.eventAuxiliary().event()); - fill("diMuonLogger_", 3.5, diMuonLogged_+0.5, isoMuons[0]->pt()); - fill("diMuonLogger_", 4.5, diMuonLogged_+0.5, isoMuons[1]->pt()); - if(leadingJets.size()>0) fill("diMuonLogger_", 5.5, diMuonLogged_+0.5, leadingJets[0].pt()); - if(leadingJets.size()>1) fill("diMuonLogger_", 6.5, diMuonLogged_+0.5, leadingJets[1].pt()); - fill("diMuonLogger_", 7.5, diMuonLogged_+0.5, caloMET.et()); - ++diMuonLogged_; - } - } - } - - // DIELEC channel - if( decayChannel(isoMuons, isoElecs) == DIELEC ){ - fill("decayChannel_", 2.5); - int charge = isoElecs[0]->charge()*isoElecs[1]->charge(); - double mass = (isoElecs[0]->p4()+isoElecs[1]->p4()).mass(); - fill(charge<0 ? "invMass_" : "invMassWC_" , mass ); - fill(charge<0 ? "invMassLog_" : "invMassWCLog_" , log10(mass)); - if((lowerEdge_==-1. && upperEdge_==-1.) || (lowerEdge_eta()-isoElecs[1]->eta() ); - fill("sumEtaL1L2_", (isoElecs[0]->eta()+isoElecs[1]->eta())/2); - fill("dPhiL1L2_" , reco::deltaPhi(isoElecs[0]->phi(),isoElecs[1]->phi()) ); - fill("elecPt_", isoElecs[0]->pt()); fill("elecPt_", isoElecs[1]->pt()); - fill("lep1Pt_", isoElecs[0]->pt()); fill("lep2Pt_", isoElecs[1]->pt()); - if(diElecLogged_<=hists_.find("diElecLogger_")->second->getNbinsY()){ - // log runnumber, lumi block, event number & some - // more pysics infomation for interesting events - fill("diElecLogger_", 0.5, diElecLogged_+0.5, event.eventAuxiliary().run()); - fill("diElecLogger_", 1.5, diElecLogged_+0.5, event.eventAuxiliary().luminosityBlock()); - fill("diElecLogger_", 2.5, diElecLogged_+0.5, event.eventAuxiliary().event()); - fill("diElecLogger_", 3.5, diElecLogged_+0.5, isoElecs[0]->pt()); - fill("diElecLogger_", 4.5, diElecLogged_+0.5, isoElecs[1]->pt()); - if(leadingJets.size()>0) fill("diElecLogger_", 5.5, diElecLogged_+0.5, leadingJets[0].pt()); - if(leadingJets.size()>1) fill("diElecLogger_", 6.5, diElecLogged_+0.5, leadingJets[1].pt()); - fill("diElecLogger_", 7.5, diElecLogged_+0.5, caloMET.et()); - ++diElecLogged_; - } - } - } - } - -} - -TopHLTDiLeptonOfflineDQM::TopHLTDiLeptonOfflineDQM(const edm::ParameterSet& cfg): triggerTable_(""), vertex_(""), vertexSelect_(0), beamspotSelect_(0) -{ - edm::ParameterSet sources=cfg.getParameter("sources"); - muonsToken_ = consumes< edm::View >(sources.getParameter("muons")); - elecsToken_ = consumes< edm::View >(sources.getParameter("elecs")); - jetsToken_ = consumes< edm::View >(sources.getParameter("jets" )); - - metsTemp_ = sources.getParameter >("mets" ); - - metsTokens_.resize( metsTemp_.size() ); - for( int i=0; i >(metsTemp_[i]); - - // configure the preselection - edm::ParameterSet presel=cfg.getParameter("preselection"); - if( presel.existsAs("trigger") ){ - edm::ParameterSet trigger=presel.getParameter("trigger"); - triggerTable_=trigger.getParameter("src"); - triggerTableToken_ = consumes(trigger.getParameter("src")); - triggerPaths_=trigger.getParameter >("select"); - } - if( presel.existsAs("vertex" ) ){ - edm::ParameterSet vertex=presel.getParameter("vertex"); - vertex_= vertex.getParameter("src"); - vertexToken_= consumes< std::vector >(vertex.getParameter("src")); - vertexSelect_= new StringCutObjectSelector(vertex.getParameter("select")); - } - if( presel.existsAs("beamspot" ) ){ - edm::ParameterSet beamspot=presel.getParameter("beamspot"); - beamspot_= beamspot.getParameter("src"); - beamspotToken_= consumes(beamspot.getParameter("src")); - beamspotSelect_= new StringCutObjectSelector(beamspot.getParameter("select")); - } - - // elecExtras are optional; they may be omitted or empty - if( cfg.existsAs("elecExtras") ){ - edm::ParameterSet elecExtras=cfg.getParameter("elecExtras"); - // electronId is optional; in case it's not found the - // InputTag will remain empty - if( elecExtras.existsAs("electronId") ){ - edm::ParameterSet elecId=elecExtras.getParameter("electronId"); - electronIdToken_= consumes< edm::ValueMap >(elecId.getParameter("src")); - } - } - - // jetExtras are optional; they may be omitted or empty - if( cfg.existsAs("jetExtras") ){ - edm::ParameterSet jetExtras=cfg.getParameter("jetExtras"); - // read jetID information if it exists - if(jetExtras.existsAs("jetID")){ - edm::ParameterSet jetID=jetExtras.getParameter("jetID"); - jetIDToken_ = consumes(jetID.getParameter("label")); - } - } - - // conifgure the selection - std::vector sel=cfg.getParameter >("selection"); - for(unsigned int i=0; i("label")); - selection_[selectionStep(selectionOrder_.back())] = std::make_pair(sel.at(i), new TopDiLeptonOffline::MonitorEnsemble(selectionStep(selectionOrder_.back()).c_str(), cfg.getParameter("setup"))); - } -} - -void -TopHLTDiLeptonOfflineDQM::analyze(const edm::Event& event, const edm::EventSetup& setup) -{ - edm::Handle triggerTable; - edm::Handle > vertex; - edm::Handle beamspot; - - edm::Handle > muons; - event.getByToken(muonsToken_, muons); - - edm::Handle > electronId; - event.getByToken(electronIdToken_, electronId); - - edm::Handle > elecs; - event.getByToken(elecsToken_, elecs); - - edm::Handle > jets; - event.getByToken(jetsToken_, jets); - - edm::Handle jetID; - event.getByToken(jetIDToken_, jetID); - - std::vector< edm::Handle > > mets; - for( int i=0; iempty() || !(*vertexSelect_)(vertex->front())) return; - } - if(!beamspot_.label().empty()){ - if( !event.getByToken(beamspotToken_, beamspot) ) return; - if(!(*beamspotSelect_)(*beamspot)) return; - } - - // apply selection steps - for(std::vector::const_iterator selIt=selectionOrder_.begin(); selIt!=selectionOrder_.end(); ++selIt){ - std::string key = selectionStep(*selIt), type = objectType(*selIt); - if(selection_.find(key)!=selection_.end()){ - if(type=="empty"){ - selection_[key].second->fill(event, setup, triggerTable, muons, electronId, elecs, jets, jetID, mets); - } - if(type=="Hlt" ){ -// cout<<"HLT filled"<fill(event, setup, triggerTable, muons, electronId, elecs, jets, jetID, mets); - } - if(type=="muons"){ - SelectionStepHLT step(selection_[key].first, consumesCollector()); - if(step.select(event)){ - selection_[key].second->fill(event, setup, triggerTable, muons, electronId, elecs, jets, jetID, mets); - } else break; - } - if(type=="elecs"){ - SelectionStepHLT step(selection_[key].first, consumesCollector()); - if(step.select(event)){ - selection_[key].second->fill(event, setup, triggerTable, muons, electronId, elecs, jets, jetID, mets); - } else break; - } - if(type=="jets" ){ - SelectionStepHLT step(selection_[key].first, consumesCollector()); - if(step.select(event, setup)){ - selection_[key].second->fill(event, setup, triggerTable, muons, electronId, elecs, jets, jetID, mets); - } else break; - } - if(type=="jets/pf" ){ - SelectionStepHLT step(selection_[key].first, consumesCollector()); - if(step.select(event, setup)){ - selection_[key].second->fill(event, setup, triggerTable, muons, electronId, elecs, jets, jetID, mets); - } else break; - } - if(type=="jets/calo" ){ - SelectionStepHLT step(selection_[key].first, consumesCollector()); - if(step.select(event, setup)){ - selection_[key].second->fill(event, setup, triggerTable, muons, electronId, elecs, jets, jetID, mets); - } else break; - } - if(type=="met" ){ - SelectionStepHLT step(selection_[key].first, consumesCollector()); - if(step.select(event)){ - selection_[key].second->fill(event, setup, triggerTable, muons, electronId, elecs, jets, jetID, mets); - } else break; - } - } - } -} - - diff --git a/HLTriggerOffline/Top/src/TopHLTDiLeptonOfflineDQM.h b/HLTriggerOffline/Top/src/TopHLTDiLeptonOfflineDQM.h deleted file mode 100644 index d3b422b7e864c..0000000000000 --- a/HLTriggerOffline/Top/src/TopHLTDiLeptonOfflineDQM.h +++ /dev/null @@ -1,316 +0,0 @@ -#ifndef TOPDILEPTONOFFLINEDQM -#define TOPDILEPTONOFFLINEDQM - -#include -#include - -#include "FWCore/Framework/interface/Event.h" -#include "DQMServices/Core/interface/DQMStore.h" -#include "DQMServices/Core/interface/MonitorElement.h" - -#include "DataFormats/Math/interface/deltaR.h" -#include "DataFormats/JetReco/interface/Jet.h" -#include "HLTriggerOffline/Top/interface/TopHLTDQMHelper.h" -#include "DataFormats/MuonReco/interface/Muon.h" -#include "DataFormats/Common/interface/ValueMap.h" -#include "DataFormats/METReco/interface/CaloMET.h" -#include "JetMETCorrections/Objects/interface/JetCorrector.h" -#include "DataFormats/EgammaCandidates/interface/GsfElectron.h" - - -#include "DataFormats/MuonReco/interface/MuonFwd.h" -#include "DataFormats/MuonReco/interface/Muon.h" - -/*Originally from DQM/Physics by R. Wolf and J. Andrea*/ - -/** - \class MonitorEnsemble TopDQMHelpers.h "DQM/Physics/interface/TopDQMHelpers.h" - - \brief Helper class to define histograms for monitoring of muon/electron/jet/met quantities. - - Helper class to contain histograms for the monitoring of muon/electron/jet/met quantities. - This class can be instantiated several times after several event selection steps. It can - be used to fill histograms in three different granularity levels according to STANDARD - (<10 histograms), VERBOSE(<20 histograms), DEBUG(<30 histgorams). Note that for the sake - of simplicity and to force the analyst to keep the number of histograms to be monitored - small the MonitorEnsemble class contains the histograms for all objects at once. It should - not contain much more than 10 histograms though in the STANDARD configuration, as these - histograms will be monitored at each SelectionStep. Monitoring of histograms after selec- - tion steps within the same object collection needs to be implemented within the Monitor- - Ensemble. It will not be covered by the SelectionStep class. -*/ - -namespace TopDiLeptonOffline { - - class MonitorEnsemble { - public: - /// different verbosity levels - enum Level{ STANDARD, VERBOSE, DEBUG }; - /// make clear which LorentzVector to use - /// for jet, electrons and muon buffering - typedef reco::LeafCandidate::LorentzVector LorentzVector; - /// different decay channels - enum DecayChannel{ NONE, DIMUON, DIELEC, ELECMU }; - - public: - /// default contructor - MonitorEnsemble(const char* label, const edm::ParameterSet& cfg); - /// default destructor - ~MonitorEnsemble(){}; - - /// book histograms in subdirectory _directory_ - void book(std::string directory); - /// fill monitor histograms with electronId and jetCorrections - //void fill(const edm::Event& event, const edm::EventSetup& setup); - void fill(const edm::Event& event, const edm::EventSetup& setup, edm::Handle triggerTable, edm::Handle > muons, edm::Handle > electronId, edm::Handle > elecs, edm::Handle > jets, edm::Handle jetID, std::vector< edm::Handle > > mets); - - private: - /// deduce monitorPath from label, the label is expected - /// to be of type 'selectionPath:monitorPath' - std::string monitorPath(const std::string& label) const { return label.substr(label.find(':')+1); }; - /// deduce selectionPath from label, the label is - /// expected to be of type 'selectionPath:monitorPath' - std::string selectionPath(const std::string& label) const { return label.substr(0, label.find(':')); }; - /// determine dileptonic decay channel - DecayChannel decayChannel(const std::vector& muons, const std::vector& elecs) const; - - /// set labels for event logging histograms - void loggerBinLabels(std::string hist); - /// set configurable labels for trigger monitoring histograms - void triggerBinLabels(std::string channel, const std::vector& labels); - /// fill trigger monitoring histograms - void fill(const edm::Event& event, const edm::TriggerResults& triggerTable, std::string channel, const std::vector& labels) const; - - /// check if histogram was booked - bool booked(const std::string histName) const { return hists_.find(histName.c_str())!=hists_.end(); }; - /// fill histogram if it had been booked before - void fill(const std::string histName, double value) const { if(booked(histName.c_str())) hists_.find(histName.c_str())->second->Fill(value); }; - /// fill histogram if it had been booked before (2-dim version) - void fill(const std::string histName, double xValue, double yValue) const { if(booked(histName.c_str())) hists_.find(histName.c_str())->second->Fill(xValue, yValue); }; - /// fill histogram if it had been booked before (2-dim version) - void fill(const std::string histName, double xValue, double yValue, double zValue) const { if(booked(histName.c_str())) hists_.find(histName.c_str())->second->Fill(xValue, yValue, zValue); }; - - private: - /// verbosity level for booking - Level verbosity_; - /// instance label - std::string label_; - /// input sources for monitoring - edm::InputTag elecs_, muons_, jets_; - - /// considers a vector of METs - std::vector mets_; - - /// trigger table - edm::InputTag triggerTable_; - /// trigger paths for monitoring, expected - /// to be of form signalPath:MonitorPath - std::vector elecMuPaths_; - /// trigger paths for di muon channel - std::vector diMuonPaths_; - - /// electronId label - edm::InputTag electronId_; - /// electronId pattern we expect the following pattern: - /// 0: fails - /// 1: passes electron ID only - /// 2: passes electron Isolation only - /// 3: passes electron ID and Isolation only - /// 4: passes conversion rejection - /// 5: passes conversion rejection and ID - /// 6: passes conversion rejection and Isolation - /// 7: passes the whole selection - /// As described on https://twiki.cern.ch/twiki/bin/view/CMS/SimpleCutBasedEleID - int eidPattern_; - /// extra isolation criterion on electron - StringCutObjectSelector* elecIso_; - /// extra selection on electrons - StringCutObjectSelector* elecSelect_; - - /// extra isolation criterion on muon - StringCutObjectSelector* muonIso_; - /// extra selection on muons - StringCutObjectSelector* muonSelect_; - - /// jetCorrector - std::string jetCorrector_; - /// jetID as an extra selection type - edm::InputTag jetIDLabel_; - /// extra jetID selection on calo jets - StringCutObjectSelector* jetIDSelect_; - /// extra selection on jets (here given as std::string as it depends - /// on the the jet type, which selections are valid and which not) - std::string jetSelect_; - /// mass window upper and lower edge - double lowerEdge_, upperEdge_; - - /// number of logged interesting events - int elecMuLogged_, diMuonLogged_, diElecLogged_; - /// storage manager - DQMStore* store_; - /// histogram container - std::map hists_; - }; - - inline void - MonitorEnsemble::loggerBinLabels(std::string hist) - { - // set axes titles for selected events - hists_[hist.c_str()]->getTH1()->SetOption("TEXT"); - hists_[hist.c_str()]->setBinLabel( 1 , "Run" , 1); - hists_[hist.c_str()]->setBinLabel( 2 , "Block" , 1); - hists_[hist.c_str()]->setBinLabel( 3 , "Event" , 1); - hists_[hist.c_str()]->setBinLabel( 6 , "pt_{L2L3}(jet1)" , 1); - hists_[hist.c_str()]->setBinLabel( 7 , "pt_{L2L3}(jet2)" , 1); - hists_[hist.c_str()]->setBinLabel( 8 , "MET_{Calo}" , 1); - hists_[hist.c_str()]->setAxisTitle("logged evts" , 2); - - if(hist=="diMuonLogger_"){ - hists_[hist.c_str()]->setBinLabel( 4 , "pt(muon)" , 1); - hists_[hist.c_str()]->setBinLabel( 5 , "pt(muon)" , 1); - } - if(hist=="diElecLogger_"){ - hists_[hist.c_str()]->setBinLabel( 4 , "pt(elec)" , 1); - hists_[hist.c_str()]->setBinLabel( 5 , "pt(elec)" , 1); - } - if(hist=="elecMuLogger_"){ - hists_[hist.c_str()]->setBinLabel( 4 , "pt(elec)" , 1); - hists_[hist.c_str()]->setBinLabel( 5 , "pt(muon)" , 1); - } - } - - inline void - MonitorEnsemble::triggerBinLabels(std::string channel, const std::vector& labels) - { - for(unsigned int idx=0; idxsetBinLabel( idx+1, "["+monitorPath(labels[idx])+"]", 1); - hists_[(channel+"Eff_").c_str()]->setBinLabel( idx+1, "["+selectionPath(labels[idx])+"]|["+monitorPath(labels[idx])+"]", 1); - } - } - - inline void - MonitorEnsemble::fill(const edm::Event& event, const edm::TriggerResults& triggerTable, std::string channel, const std::vector& labels) const - { - for(unsigned int idx=0; idxsecond->getBinContent(idx+1); - double value = hists_.find((channel+"Eff_").c_str())->second->getBinContent(idx+1); - fill((channel+"Eff_").c_str(), idx+0.5, 1./evts*(acceptHLT(event, triggerTable, selectionPath(labels[idx]))-value)); - } - } - } - - inline MonitorEnsemble::DecayChannel - MonitorEnsemble::decayChannel(const std::vector& muons, const std::vector& elecs) const - { - DecayChannel type=NONE; - if( muons.size()>1 ){ type=DIMUON; } else if( elecs.size()>1 ){ type=DIELEC; } else if( !elecs.empty() && !muons.empty() ){ type=ELECMU; } - return type; - } - -} - -#include - -#include "FWCore/Framework/interface/EDAnalyzer.h" -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/ServiceRegistry/interface/Service.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -#include "FWCore/Common/interface/TriggerNames.h" -#include "DataFormats/BeamSpot/interface/BeamSpot.h" -#include "DataFormats/VertexReco/interface/Vertex.h" -#include "DataFormats/Common/interface/TriggerResults.h" - -/** - \class TopHLTDiLeptonOfflineDQM TopHLTDiLeptonOfflineDQM.h "DQM/Physics/plugins/TopHLTDiLeptonOfflineDQM.h" - - \brief Module to apply a monitored selection of top like events in the di-leptonic channel - - Plugin to apply a monitored selection of top like events with some minimal flexibility - in the number and definition of the selection steps. To achieve this flexibility it - employes the SelectionStep class. The MonitorEnsemble class is used to provide a well - defined set of histograms to be monitored after each selection step. The SelectionStep - class provides a flexible and intuitive selection via the StringCutParser. SelectionStep - and MonitorEnsemble classes are interleaved. The monitoring starts after a preselection - step (which is not monitored in the context of this module) with an instance of the - MonitorEnsemble class. The following objects are supported for selection: - - - jets : of type reco::Jet - - elecs : of type reco::GsfElectron - - muons : of type reco::Muon - - met : of type reco::MET - - These types have to be present as prefix of the selection step paramter _label_ separated - from the rest of the label by a ':' (e.g. in the form "jets:step0"). The class expects - selection labels of this type. They will be disentangled by the private helper functions - _objectType_ and _seletionStep_ as declared below. -*/ - -/// define MonitorEnsembple to be used -//using TopDiLeptonOffline::MonitorEnsemble; - -class TopHLTDiLeptonOfflineDQM : public edm::EDAnalyzer { - public: - /// default constructor - TopHLTDiLeptonOfflineDQM(const edm::ParameterSet& cfg); - /// default destructor - ~TopHLTDiLeptonOfflineDQM(){ - if( beamspotSelect_ ) delete beamspotSelect_; - if( vertexSelect_ ) delete vertexSelect_; - } - - /// do this during the event loop - virtual void analyze(const edm::Event& event, const edm::EventSetup& setup); - - private: - /// deduce object type from ParameterSet label, the label - /// is expected to be of type 'objectType:selectionStep' - std::string objectType(const std::string& label) { return label.substr(0, label.find(':')); }; - /// deduce selection step from ParameterSet label, the - /// label is expected to be of type 'objectType:selectionStep' - std::string selectionStep(const std::string& label) { return label.substr(label.find(':')+1); }; - - private: - /// trigger table - edm::InputTag triggerTable_; - /// trigger paths - std::vector triggerPaths_; - /// primary vertex - edm::InputTag vertex_; - /// string cut selector - StringCutObjectSelector* vertexSelect_; - /// beamspot - edm::InputTag beamspot_; - /// string cut selector - StringCutObjectSelector* beamspotSelect_; - - /// needed to guarantee the selection order as defined by the order of - /// ParameterSets in the _selection_ vector as defined in the config - std::vector selectionOrder_; - /// this is the heart component of the plugin; std::string keeps a label - /// the selection step for later identification, edm::ParameterSet keeps - /// the configuration of the selection for the SelectionStep class, - /// MonitoringEnsemble keeps an instance of the MonitorEnsemble class to - /// be filled _after_ each selection step - std::map > selection_; - - std::vector metsTemp_; - - edm::EDGetTokenT< edm::View > muonsToken_; - edm::EDGetTokenT< edm::View > elecsToken_; - edm::EDGetTokenT< edm::View > jetsToken_; - - edm::EDGetTokenT< edm::ValueMap > electronIdToken_; - edm::EDGetTokenT jetIDToken_; - - edm::EDGetTokenT triggerTableToken_; - edm::EDGetTokenT< std::vector > vertexToken_; - edm::EDGetTokenT beamspotToken_; - - std::vector< edm::EDGetTokenT< edm::View > > metsTokens_; -}; - -#endif diff --git a/HLTriggerOffline/Top/src/TopHLTSingleLeptonDQM.cc b/HLTriggerOffline/Top/src/TopHLTSingleLeptonDQM.cc deleted file mode 100644 index 1ed370ab6b280..0000000000000 --- a/HLTriggerOffline/Top/src/TopHLTSingleLeptonDQM.cc +++ /dev/null @@ -1,736 +0,0 @@ -#include "JetMETCorrections/Objects/interface/JetCorrectionsRecord.h" -#include "DataFormats/JetReco/interface/CaloJet.h" -#include "DataFormats/BTauReco/interface/JetTag.h" -#include "DataFormats/JetReco/interface/PFJet.h" -#include "DataFormats/Math/interface/deltaR.h" -#include "TopHLTSingleLeptonDQM.h" -#include "HLTriggerOffline/Top/interface/TopHLTDQMHelper.h" -#include -/*Originally from DQM/Physics by R. Wolf and J. Andrea*/ -using namespace std; -namespace TopHLTSingleLepton { - - // maximal number of leading jets - // to be used for top mass estimate - static const unsigned int MAXJETS = 4; - // nominal mass of the W boson to - // be used for the top mass estimate - static const double WMASS = 80.4; - - MonitorEnsemble::MonitorEnsemble(const char* label, const edm::ParameterSet& cfg) : - label_(label), elecIso_(0), elecSelect_(0), pvSelect_(0), muonIso_(0), muonSelect_(0), jetIDSelect_(0), includeBTag_(false), lowerEdge_(-1.), upperEdge_(-1.), logged_(0) - { - // sources have to be given; this PSet is not optional - edm::ParameterSet sources=cfg.getParameter("sources"); - muons_= sources.getParameter("muons"); - elecs_= sources.getParameter("elecs"); - jets_ = sources.getParameter("jets" ); - mets_ = sources.getParameter >("mets" ); - pvs_ = sources.getParameter("pvs" ); - // electronExtras are optional; they may be omitted or - // empty - if( cfg.existsAs("elecExtras") ){ - edm::ParameterSet elecExtras=cfg.getParameter("elecExtras"); - // select is optional; in case it's not found no - // selection will be applied - if( elecExtras.existsAs("select") ){ - elecSelect_= new StringCutObjectSelector(elecExtras.getParameter("select")); - } - // isolation is optional; in case it's not found no - // isolation will be applied - if( elecExtras.existsAs("isolation") ){ - elecIso_= new StringCutObjectSelector(elecExtras.getParameter("isolation")); - } - // electronId is optional; in case it's not found the - // InputTag will remain empty - if( elecExtras.existsAs("electronId") ){ - edm::ParameterSet elecId=elecExtras.getParameter("electronId"); - electronId_= elecId.getParameter("src"); - eidPattern_= elecId.getParameter("pattern"); - } - } - // pvExtras are opetional; they may be omitted or empty - if(cfg.existsAs("pvExtras")){ - edm::ParameterSet pvExtras=cfg.getParameter("pvExtras"); - // select is optional; in case it's not found no - // selection will be applied - if( pvExtras.existsAs("select") ){ - pvSelect_= new StringCutObjectSelector(pvExtras.getParameter("select")); - } - } - // muonExtras are optional; they may be omitted or empty - if( cfg.existsAs("muonExtras") ){ - edm::ParameterSet muonExtras=cfg.getParameter("muonExtras"); - // select is optional; in case it's not found no - // selection will be applied - if( muonExtras.existsAs("select") ){ - muonSelect_= new StringCutObjectSelector(muonExtras.getParameter("select")); - } - // isolation is optional; in case it's not found no - // isolation will be applied - if( muonExtras.existsAs("isolation") ){ - muonIso_= new StringCutObjectSelector(muonExtras.getParameter("isolation")); - } - } - - // jetExtras are optional; they may be omitted or - // empty - if( cfg.existsAs("jetExtras") ){ - edm::ParameterSet jetExtras=cfg.getParameter("jetExtras"); - // jetCorrector is optional; in case it's not found - // the InputTag will remain empty - if( jetExtras.existsAs("jetCorrector") ){ - jetCorrector_= jetExtras.getParameter("jetCorrector"); - } - // read jetID information if it exists - if(jetExtras.existsAs("jetID")){ - edm::ParameterSet jetID=jetExtras.getParameter("jetID"); - jetIDLabel_ =jetID.getParameter("label"); - jetIDSelect_= new StringCutObjectSelector(jetID.getParameter("select")); - } - // select is optional; in case it's not found no - // selection will be applied (only implemented for - // CaloJets at the moment) - if( jetExtras.existsAs("select") ){ - jetSelect_= jetExtras.getParameter("select"); - } - // jetBDiscriminators are optional; in case they are - // not found the InputTag will remain empty; they - // consist of pairs of edm::JetFlavorAssociation's & - // corresponding working points - includeBTag_=jetExtras.existsAs("jetBTaggers"); - if( includeBTag_ ){ - edm::ParameterSet btagEff=jetExtras.getParameter("jetBTaggers").getParameter("trackCountingEff"); - btagEff_= btagEff.getParameter("label"); btagEffWP_= btagEff.getParameter("workingPoint"); - edm::ParameterSet btagPur=jetExtras.getParameter("jetBTaggers").getParameter("trackCountingPur"); - btagPur_= btagPur.getParameter("label"); btagPurWP_= btagPur.getParameter("workingPoint"); - edm::ParameterSet btagVtx=jetExtras.getParameter("jetBTaggers").getParameter("secondaryVertex" ); - btagVtx_= btagVtx.getParameter("label"); btagVtxWP_= btagVtx.getParameter("workingPoint"); - } - } - - // triggerExtras are optional; they may be omitted or empty - if( cfg.existsAs("triggerExtras") ){ - edm::ParameterSet triggerExtras=cfg.getParameter("triggerExtras"); - triggerTable_=triggerExtras.getParameter("src"); - triggerPaths_=triggerExtras.getParameter >("paths"); - } - - // massExtras is optional; in case it's not found no mass - // window cuts are applied for the same flavor monitor - // histograms - if( cfg.existsAs("massExtras") ){ - edm::ParameterSet massExtras=cfg.getParameter("massExtras"); - lowerEdge_= massExtras.getParameter("lowerEdge"); - upperEdge_= massExtras.getParameter("upperEdge"); - } - - // setup the verbosity level for booking histograms; - // per default the verbosity level will be set to - // STANDARD. This will also be the chosen level in - // the case when the monitoring PSet is not found - verbosity_=STANDARD; - if( cfg.existsAs("monitoring") ){ - edm::ParameterSet monitoring=cfg.getParameter("monitoring"); - if(monitoring.getParameter("verbosity") == "DEBUG" ) - verbosity_= DEBUG; - if(monitoring.getParameter("verbosity") == "VERBOSE" ) - verbosity_= VERBOSE; - if(monitoring.getParameter("verbosity") == "STANDARD") - verbosity_= STANDARD; - } - // and don't forget to do the histogram booking - book(cfg.getParameter("directory")); - } - - void - MonitorEnsemble::book(std::string directory) - { - //set up the current directory path - std::string current(directory); current+=label_; - store_=edm::Service().operator->(); - store_->setCurrentFolder(current); - - // determine number of bins for trigger monitoring - unsigned int nPaths=triggerPaths_.size(); - - // --- [STANDARD] --- // - // number of selected primary vertices - hists_["pvMult_" ] = store_->book1D("PvMult" , "N_{pvs}" , 100, 0., 100.); - // pt of the leading muon - hists_["muonPt_" ] = store_->book1D("MuonPt" , "pt(#mu)" , 50, 0., 250.); - // muon multiplicity before std isolation - hists_["muonMult_" ] = store_->book1D("MuonMult" , "N_{All}(#mu)" , 10, 0., 10.); - // muon multiplicity after std isolation - hists_["muonMultIso_"] = store_->book1D("MuonMultIso", "N_{Iso}(#mu)" , 10, 0., 10.); - // pt of the leading electron - hists_["elecPt_" ] = store_->book1D("ElecPt" , "pt(e)" , 50, 0., 250.); - // electron multiplicity before std isolation - hists_["elecMult_" ] = store_->book1D("ElecMult" , "N_{All}(e)" , 10, 0., 10.); - // electron multiplicity after std isolation - hists_["elecMultIso_"] = store_->book1D("ElecMultIso", "N_{Iso}(e)" , 10, 0., 10.); - // multiplicity of jets with pt>20 (corrected to L2+L3) - hists_["jetMult_" ] = store_->book1D("JetMult" , "N_{30}(jet)" , 10, 0., 10.); - // trigger efficiency estimates for single lepton triggers - hists_["triggerEff_" ] = store_->book1D("TriggerEff" , "Eff(trigger)" , nPaths, 0., nPaths); - // monitored trigger occupancy for single lepton triggers - hists_["triggerMon_" ] = store_->book1D("TriggerMon" , "Mon(trigger)" , nPaths, 0., nPaths); - // MET (calo) - hists_["metCalo_" ] = store_->book1D("METCalo" , "MET_{Calo}" , 50, 0., 200.); - // W mass estimate - hists_["massW_" ] = store_->book1D("MassW" , "M(W)" , 60, 0., 300.); - // Top mass estimate - hists_["massTop_" ] = store_->book1D("MassTop" , "M(Top)" , 50, 0., 500.); - // Mlb mu - hists_["mMub_" ] = store_->book1D("mMub" , "m_{#mub}" , 50, 0., 500.); - // W mass transverse estimate mu - hists_["MTWm_" ] = store_->book1D("MTWm" , "M_{T}^{W}(#mu)" , 60, 0., 300.); - // Top mass transverse estimate mu - hists_["mMTT_" ] = store_->book1D("mMTT" , "M_{T}^{t}(#mu)" , 50, 0., 500.); - - // Mlb e - hists_["mEb_" ] = store_->book1D("mEb" , "m_{eb}" , 50, 0., 500.); - // W mass transverse estimate e - hists_["MTWe_" ] = store_->book1D("MTWe" , "M_{T}^{W}(e)" , 60, 0., 300.); - // Top mass transverse estimate e - hists_["eMTT_" ] = store_->book1D("eMTT" , "M_{T}^{t}(e)" , 50, 0., 500.); - - - - - // set bin labels for trigger monitoring - triggerBinLabels(std::string("trigger"), triggerPaths_); - - if( verbosity_==STANDARD) return; - - // --- [VERBOSE] --- // - // eta of the leading muon - hists_["muonEta_" ] = store_->book1D("MuonEta" , "#eta(#mu)" , 30, -3., 3.); - // std isolation variable of the leading muon - hists_["muonRelIso_" ] = store_->book1D("MuonRelIso" , "Iso_{Rel}(#mu)" , 50, 0., 1.); - // eta of the leading electron - hists_["elecEta_" ] = store_->book1D("ElecEta" , "#eta(e)" , 30, -3., 3.); - // std isolation variable of the leading electron - hists_["elecRelIso_" ] = store_->book1D("ElecRelIso" , "Iso_{Rel}(e)" , 50, 0., 1.); - // multiplicity of btagged jets (for track counting high efficiency) with pt(L2L3)>30 - hists_["jetMultBEff_"] = store_->book1D("JetMultBEff", "N_{30}(b/eff)" , 10, 0., 10.); - // btag discriminator for track counting high efficiency for jets with pt(L2L3)>30 - hists_["jetBDiscEff_"] = store_->book1D("JetBDiscEff", "Disc_{b/eff}(jet)", 100, 0., 10.); - // pt of the 1. leading jet (corrected to L2+L3) - hists_["jet1Pt_" ] = store_->book1D("Jet1Pt" , "pt_{L2L3}(jet1)" , 60, 0., 300.); - // pt of the 2. leading jet (corrected to L2+L3) - hists_["jet2Pt_" ] = store_->book1D("Jet2Pt" , "pt_{L2L3}(jet2)" , 60, 0., 300.); - // pt of the 3. leading jet (corrected to L2+L3) - hists_["jet3Pt_" ] = store_->book1D("Jet3Pt" , "pt_{L2L3}(jet3)" , 60, 0., 300.); - // pt of the 4. leading jet (corrected to L2+L3) - hists_["jet4Pt_" ] = store_->book1D("Jet4Pt" , "pt_{L2L3}(jet4)" , 60, 0., 300.); - // eta of the 1. - hists_["jet1Eta_" ] = store_->book1D("Jet1Eta" , "#eta(jet1)" , 30, -3., 3.); - // eta of the 2. - hists_["jet2Eta_" ] = store_->book1D("Jet2Eta" , "#eta(jet2)" , 30, -3., 3.); - // eta of the 3. - hists_["jet3Eta_" ] = store_->book1D("Jet3Eta" , "#eta(jet3)" , 30, -3., 3.); - // eta of the 4. - hists_["jet4Eta_" ] = store_->book1D("Jet4Eta" , "#eta(jet4)" , 30, -3., 3.); - // MET (tc) - hists_["metTC_" ] = store_->book1D("METTC" , "MET_{TC}" , 50, 0., 200.); - // MET (pflow) - hists_["metPflow_" ] = store_->book1D("METPflow" , "MET_{Pflow}" , 50, 0., 200.); - // dz for muons (to suppress cosmis) - hists_["muonDelZ_" ] = store_->book1D("MuonDelZ" , "d_{z}(#mu)" , 50, -25., 25.); - // dxy for muons (to suppress cosmics) - hists_["muonDelXY_" ] = store_->book2D("MuonDelXY" , "d_{xy}(#mu)" , 50, -0.1, 0.1, 50, -0.1, 0.1); - - // set axes titles for dxy for muons - hists_["muonDelXY_" ]->setAxisTitle( "x [cm]", 1); hists_["muonDelXY_" ]->setAxisTitle( "y [cm]", 2); - - if( verbosity_==VERBOSE) return; - - // --- [DEBUG] --- // - // relative muon isolation in tracker for the leading muon - hists_["muonTrkIso_" ] = store_->book1D("MuonTrkIso" , "Iso_{Trk}(#mu)" , 50, 0., 1.); - // relative muon isolation in ecal+hcal for the leading muon - hists_["muonCalIso_" ] = store_->book1D("MuonCalIso" , "Iso_{Ecal}(#mu)" , 50, 0., 1.); - // relative electron isolation in tracker for the leading electron - hists_["elecTrkIso_" ] = store_->book1D("ElecTrkIso" , "Iso_{Trk}(e)" , 50, 0., 1.); - // relative electron isolation in ecal+hcal for the leading electron - hists_["elecCalIso_" ] = store_->book1D("ElecCalIso" , "Iso_{Ecal}(e)" , 50, 0., 1.); - // multiplicity of btagged jets (for track counting high purity) with pt(L2L3)>30 - hists_["jetMultBPur_"] = store_->book1D("JetMultBPur", "N_{30}(b/pur)" , 10, 0., 10.); - // btag discriminator for track counting high purity - hists_["jetBDiscPur_"] = store_->book1D("JetBDiscPur", "Disc_{b/pur}(Jet)", 100, 0., 10.); - // multiplicity of btagged jets (for simple secondary vertex) with pt(L2L3)>30 - hists_["jetMultBVtx_"] = store_->book1D("JetMultBVtx", "N_{30}(b/vtx)" , 10, 0., 10.); - // btag discriminator for simple secondary vertex - hists_["jetBDiscVtx_"] = store_->book1D("JetBDiscVtx", "Disc_{b/vtx}(Jet)", 35, -1., 6.); - // pt of the 1. leading jet (uncorrected) - hists_["jet1PtRaw_" ] = store_->book1D("Jet1PtRaw" , "pt_{Raw}(jet1)" , 60, 0., 300.); - // pt of the 2. leading jet (uncorrected) - hists_["jet2PtRaw_" ] = store_->book1D("Jet2PtRaw" , "pt_{Raw}(jet2)" , 60, 0., 300.); - // pt of the 3. leading jet (uncorrected) - hists_["jet3PtRaw_" ] = store_->book1D("Jet3PtRaw" , "pt_{Raw}(jet3)" , 60, 0., 300.); - // pt of the 4. leading jet (uncorrected) - hists_["jet4PtRaw_" ] = store_->book1D("Jet4PtRaw" , "pt_{Raw}(jet4)" , 60, 0., 300.); - // selected events - hists_["eventLogger_"] = store_->book2D("EventLogger", "Logged Events" , 9, 0., 9., 10, 0., 10.); - - // set axes titles for selected events - hists_["eventLogger_"]->getTH1()->SetOption("TEXT"); - hists_["eventLogger_"]->setBinLabel( 1 , "Run" , 1); - hists_["eventLogger_"]->setBinLabel( 2 , "Block" , 1); - hists_["eventLogger_"]->setBinLabel( 3 , "Event" , 1); - hists_["eventLogger_"]->setBinLabel( 4 , "pt_{L2L3}(jet1)" , 1); - hists_["eventLogger_"]->setBinLabel( 5 , "pt_{L2L3}(jet2)" , 1); - hists_["eventLogger_"]->setBinLabel( 6 , "pt_{L2L3}(jet3)" , 1); - hists_["eventLogger_"]->setBinLabel( 7 , "pt_{L2L3}(jet4)" , 1); - hists_["eventLogger_"]->setBinLabel( 8 , "M_{W}" , 1); - hists_["eventLogger_"]->setBinLabel( 9 , "M_{Top}" , 1); - hists_["eventLogger_"]->setAxisTitle("logged evts" , 2); - return; - } - - void - MonitorEnsemble::fill(const edm::Event& event, const edm::EventSetup& setup, - edm::Handle triggerTable, edm::Handle > pvs, - edm::Handle > muons, edm::Handle > electronId, - edm::Handle > elecs, edm::Handle > jets, - edm::Handle jetID, edm::Handle btagEff, - edm::Handle btagPur, edm::Handle btagVtx, - std::vector< edm::Handle > > mets) - { - // fetch trigger event if configured such - if(!triggerTable_.label().empty()) { - if( !triggerTable.isValid() ) return; - } - - /* - ------------------------------------------------------------ - - Primary Vertex Monitoring - - ------------------------------------------------------------ - */ - // fill monitoring plots for primary verices - if( !pvs.isValid() ) return; - unsigned int pvMult = 0; - for(edm::View::const_iterator pv=pvs->begin(); pv!=pvs->end(); ++pv){ - if(!pvSelect_ || (*pvSelect_)(*pv)) - pvMult++; - } - fill("pvMult_", pvMult ); - - /* - ------------------------------------------------------------ - - Electron Monitoring - - ------------------------------------------------------------ - */ - - // check availability of electron id - if(!electronId_.label().empty()) { - if( !electronId.isValid() ) return; - } - - if( !elecs.isValid() ) return; - - // loop electron collection - unsigned int eMult=0, eMultIso=0; - std::vector isoElecs; - reco::GsfElectron e; - for(edm::View::const_iterator elec=elecs->begin(); elec!=elecs->end(); ++elec){ - unsigned int idx = elec-elecs->begin(); - // restrict to electrons with good electronId - if( electronId_.label().empty() ? true : ((int)(*electronId)[elecs->refAt(idx)] & eidPattern_) ){ - if(!elecSelect_ || (*elecSelect_)(*elec)){ - double isolationTrk = elec->pt()/(elec->pt()+elec->dr03TkSumPt()); - double isolationCal = elec->pt()/(elec->pt()+elec->dr03EcalRecHitSumEt()+elec->dr03HcalTowerSumEt()); - double isolationRel = (elec->dr03TkSumPt()+elec->dr03EcalRecHitSumEt()+elec->dr03HcalTowerSumEt())/elec->pt(); - if( eMult==0 ){ - // restrict to the leading electron - fill("elecPt_" , elec->pt() ); - fill("elecEta_", elec->eta()); - fill("elecRelIso_" , isolationRel ); - fill("elecTrkIso_" , isolationTrk ); - fill("elecCalIso_" , isolationCal ); - } - // in addition to the multiplicity counter buffer the iso - // electron candidates for later overlap check with jets - ++eMult; if(!elecIso_ || (*elecIso_)(*elec)){ if(eMultIso == 0) e = *elec; isoElecs.push_back(&(*elec)); ++eMultIso;} - } - } - } - fill("elecMult_", eMult ); - fill("elecMultIso_", eMultIso); - - /* - ------------------------------------------------------------ - - Muon Monitoring - - ------------------------------------------------------------ - */ - - // fill monitoring plots for muons - unsigned int mMult=0, mMultIso=0; - - if( !muons.isValid() ) return; - - reco::Muon mu; - for(edm::View::const_iterator muon=muons->begin(); muon!=muons->end(); ++muon){ - // restrict to globalMuons - if( muon->isGlobalMuon() ){ - fill("muonDelZ_" , muon->globalTrack()->vz()); - fill("muonDelXY_", muon->globalTrack()->vx(), muon->globalTrack()->vy()); - // apply preselection - if(!muonSelect_ || (*muonSelect_)(*muon)){ - double isolationTrk = muon->pt()/(muon->pt()+muon->isolationR03().sumPt); - double isolationCal = muon->pt()/(muon->pt()+muon->isolationR03().emEt+muon->isolationR03().hadEt); - double isolationRel = (muon->isolationR03().sumPt+muon->isolationR03().emEt+muon->isolationR03().hadEt)/muon->pt(); - if( mMult==0 ){ - // restrict to leading muon - fill("muonPt_" , muon->pt() ); - fill("muonEta_" , muon->eta()); - fill("muonRelIso_" , isolationRel ); - fill("muonTrkIso_" , isolationTrk ); - fill("muonCalIso_" , isolationCal ); - } - ++mMult; if(!muonIso_ || (*muonIso_)(*muon)) {if(mMultIso == 0) mu = *muon; ++mMultIso;} - } - } - } - fill("muonMult_", mMult ); - fill("muonMultIso_", mMultIso); - - /* - ------------------------------------------------------------ - - Jet Monitoring - - ------------------------------------------------------------ - */ - - // check availability of the btaggers - if( includeBTag_ ){ - if( !btagEff.isValid() ) return; - if( !btagPur.isValid() ) return; - if( !btagVtx.isValid() ) return; - } - // load jet corrector if configured such - const JetCorrector* corrector=0; - if(!jetCorrector_.empty()){ - // check whether a jet correcto is in the event setup or not - if(setup.find( edm::eventsetup::EventSetupRecordKey::makeKey() )){ - corrector = JetCorrector::getJetCorrector(jetCorrector_, setup); - } - else{ - edm::LogVerbatim( "TopHLTSingleLeptonDQM" ) - << "\n" - << "------------------------------------------------------------------------------------- \n" - << " No JetCorrectionsRecord available from EventSetup: \n" - << " - Jets will not be corrected. \n" - << " - If you want to change this add the following lines to your cfg file: \n" - << " \n" - << " ## load jet corrections \n" - << " process.load(\"JetMETCorrections.Configuration.JetCorrectionServicesAllAlgos_cff\") \n" - << " process.prefer(\"ak5CaloL2L3\") \n" - << " \n" - << "------------------------------------------------------------------------------------- \n"; - } - } - - // loop jet collection - std::vector correctedJets; - unsigned int mult=0, multBEff=0, multBPur=0, multBVtx=0; - - if( !jets.isValid() ) return; - - if(jetIDSelect_){ - if( !jetID.isValid() ) return; - } - - reco::Jet bJetCand; - for(edm::View::const_iterator jet=jets->begin(); jet!=jets->end(); ++jet){ - // check jetID for calo jets - unsigned int idx = jet-jets->begin(); - if( jetIDSelect_ && dynamic_cast(jets->refAt(idx).get())){ - if(!(*jetIDSelect_)((*jetID)[jets->refAt(idx)])) continue; - } - // chekc additional jet selection for calo, pf and bare reco jets - if(dynamic_cast(&*jet)){ - reco::CaloJet sel = dynamic_cast(*jet); sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.); - StringCutObjectSelector jetSelect(jetSelect_); if(!jetSelect(sel)){ continue;} - } - else if(dynamic_cast(&*jet)){ - reco::PFJet sel= dynamic_cast(*jet); sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.); - StringCutObjectSelector jetSelect(jetSelect_); if(!jetSelect(sel)) continue; - } - else{ - reco::Jet sel = *jet; sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.); - StringCutObjectSelector jetSelect(jetSelect_); if(!jetSelect(sel)) continue; - } - // check for overlaps -- comment this to be synchronous with the selection - //bool overlap=false; - //for(std::vector::const_iterator elec=isoElecs.begin(); elec!=isoElecs.end(); ++elec){ - // if(reco::deltaR((*elec)->eta(), (*elec)->phi(), jet->eta(), jet->phi())<0.4){overlap=true; break;} - //} if(overlap){continue;} - - // prepare jet to fill monitor histograms - reco::Jet monitorJet = *jet; monitorJet.scaleEnergy(corrector ? corrector->correction(*jet) : 1.); - correctedJets.push_back(monitorJet); - ++mult; // determine jet multiplicity - if( includeBTag_ ){ - // fill b-discriminators - edm::RefToBase jetRef = jets->refAt(idx); - fill("jetBDiscEff_", (*btagEff)[jetRef]); if( (*btagEff)[jetRef]>btagEffWP_ ) ++multBEff; - fill("jetBDiscPur_", (*btagPur)[jetRef]); if( (*btagPur)[jetRef]>btagPurWP_ ) {if(multBPur == 0) bJetCand = *jet; ++multBPur;} - fill("jetBDiscVtx_", (*btagVtx)[jetRef]); if( (*btagVtx)[jetRef]>btagVtxWP_ ) ++multBVtx; - } - // fill pt (raw or L2L3) for the leading four jets - if(idx==0) {fill("jet1Pt_" , monitorJet.pt()); fill("jet1PtRaw_", jet->pt() ); fill("jet1Eta_" , monitorJet.eta());} - if(idx==1) {fill("jet2Pt_" , monitorJet.pt()); fill("jet2PtRaw_", jet->pt() ); fill("jet2Eta_" , monitorJet.eta());} - if(idx==2) {fill("jet3Pt_" , monitorJet.pt()); fill("jet3PtRaw_", jet->pt() ); fill("jet3Eta_" , monitorJet.eta());} - if(idx==3) {fill("jet4Pt_" , monitorJet.pt()); fill("jet4PtRaw_", jet->pt() ); fill("jet4Eta_" , monitorJet.eta());} - } - fill("jetMult_" , mult ); - fill("jetMultBEff_", multBEff); - fill("jetMultBPur_", multBPur); - fill("jetMultBVtx_", multBVtx); - - /* - ------------------------------------------------------------ - - MET Monitoring - - ------------------------------------------------------------ - */ - - // fill monitoring histograms for met - reco::MET mET; - for( int i=0; i > met = mets[i]; - if( !met.isValid() ) continue; - if(met->begin()!=met->end()){ - unsigned int idx=i; - if(idx==0) fill("metCalo_" , met->begin()->et()); - if(idx==1) fill("metTC_" , met->begin()->et()); - if(idx==2) fill("metPflow_", met->begin()->et()); - mET = *(met->begin()); - } - } - - /* - ------------------------------------------------------------ - - Event Monitoring - - ------------------------------------------------------------ - */ - - // fill W boson and top mass estimates - CalculateHLT eventKinematics(MAXJETS, WMASS); - double wMass = eventKinematics.massWBoson (correctedJets); - double topMass = eventKinematics.massTopQuark(correctedJets); - if(wMass>=0 && topMass>=0) {fill("massW_" , wMass ); fill("massTop_" , topMass);} - // fill plots for trigger monitoring - if((lowerEdge_==-1. && upperEdge_==-1.) || (lowerEdge_second->getNbinsY()){ - // log runnumber, lumi block, event number & some - // more pysics infomation for interesting events - fill("eventLogger_", 0.5, logged_+0.5, event.eventAuxiliary().run()); - fill("eventLogger_", 1.5, logged_+0.5, event.eventAuxiliary().luminosityBlock()); - fill("eventLogger_", 2.5, logged_+0.5, event.eventAuxiliary().event()); - if(correctedJets.size()>0) fill("eventLogger_", 3.5, logged_+0.5, correctedJets[0].pt()); - if(correctedJets.size()>1) fill("eventLogger_", 4.5, logged_+0.5, correctedJets[1].pt()); - if(correctedJets.size()>2) fill("eventLogger_", 5.5, logged_+0.5, correctedJets[2].pt()); - if(correctedJets.size()>3) fill("eventLogger_", 6.5, logged_+0.5, correctedJets[3].pt()); - fill("eventLogger_", 7.5, logged_+0.5, wMass ); - fill("eventLogger_", 8.5, logged_+0.5, topMass); - ++logged_; - } - } - if(multBPur != 0 && mMultIso == 1 ){ - cout<("sources"); - muonsToken_ = consumes< edm::View >(sources.getParameter("muons")); - elecsToken_ = consumes< edm::View >(sources.getParameter("elecs")); - jetsToken_ = consumes< edm::View >(sources.getParameter("jets" )); - pvsToken_ = consumes< edm::View >(sources.getParameter("pvs" )); - - metsTemp_ = sources.getParameter >("mets" ); - - metsTokens_.resize( metsTemp_.size() ); - for( int i=0; i >(metsTemp_[i]); - - // configure preselection - edm::ParameterSet presel=cfg.getParameter("preselection"); - if( presel.existsAs("trigger") ){ - edm::ParameterSet trigger=presel.getParameter("trigger"); - triggerTable_=trigger.getParameter("src"); - triggerPaths_=trigger.getParameter >("select"); - } - if( presel.existsAs("vertex" ) ){ - edm::ParameterSet vertex=presel.getParameter("vertex"); - vertex_= vertex.getParameter("src"); - vertexToken_= consumes< std::vector >(vertex.getParameter("src")); - vertexSelect_= new StringCutObjectSelector(vertex.getParameter("select")); - } - if( presel.existsAs("beamspot" ) ){ - edm::ParameterSet beamspot=presel.getParameter("beamspot"); - beamspot_= beamspot.getParameter("src"); - beamspotToken_= consumes(beamspot.getParameter("src")); - beamspotSelect_= new StringCutObjectSelector(beamspot.getParameter("select")); - } - - // elecExtras are optional; they may be omitted or empty - if( cfg.existsAs("elecExtras") ){ - edm::ParameterSet elecExtras=cfg.getParameter("elecExtras"); - // electronId is optional; in case it's not found the - // InputTag will remain empty - if( elecExtras.existsAs("electronId") ){ - edm::ParameterSet elecId=elecExtras.getParameter("electronId"); - electronIdToken_= consumes< edm::ValueMap >(elecId.getParameter("src")); - } - } - - // jetExtras are optional; they may be omitted or empty - if( cfg.existsAs("jetExtras") ){ - edm::ParameterSet jetExtras=cfg.getParameter("jetExtras"); - // read jetID information if it exists - if(jetExtras.existsAs("jetID")){ - edm::ParameterSet jetID=jetExtras.getParameter("jetID"); - jetIDToken_ = consumes(jetID.getParameter("label")); - } - } - - // conifgure the selection - std::vector sel=cfg.getParameter >("selection"); - for(unsigned int i=0; i("label")); - selection_[selectionStep(selectionOrder_.back())] = std::make_pair(sel.at(i), new TopHLTSingleLepton::MonitorEnsemble(selectionStep(selectionOrder_.back()).c_str(), cfg.getParameter("setup"))); - } -} - -void -TopHLTSingleLeptonDQM::analyze(const edm::Event& event, const edm::EventSetup& setup) -{ - - edm::Handle triggerTable; - edm::Handle > vertex; - edm::Handle beamspot; - - edm::Handle > pvs; - event.getByToken(pvsToken_, pvs); - - edm::Handle > muons; - event.getByToken(muonsToken_, muons); - - edm::Handle > electronId; - event.getByToken(electronIdToken_, electronId); - - edm::Handle > elecs; - event.getByToken(elecsToken_, elecs); - - edm::Handle > jets; - event.getByToken(jetsToken_, jets); - - edm::Handle jetID; - event.getByToken(jetIDToken_, jetID); - - - edm::Handle btagEff, btagPur, btagVtx; - event.getByToken(btagEffToken_, btagEff); - event.getByToken(btagPurToken_, btagPur); - event.getByToken(btagVtxToken_, btagVtx); - - std::vector< edm::Handle > > mets; - for( int i=0; iempty() || !(*vertexSelect_)(vertex->front())) return; - } - if(!beamspot_.label().empty()){ - if( !event.getByToken(beamspotToken_, beamspot) ) return; - if(!(*beamspotSelect_)(*beamspot)) return; - } - - - // apply selection steps - unsigned int passed=0; - for(std::vector::const_iterator selIt=selectionOrder_.begin(); selIt!=selectionOrder_.end(); ++selIt){ - std::string key = selectionStep(*selIt), type = objectType(*selIt); - if(selection_.find(key)!=selection_.end()){ - if(type=="empty"){ - selection_[key].second->fill(event, setup, triggerTable, pvs, muons, electronId, elecs, jets, jetID, btagEff, btagPur, btagVtx, mets); - } - if(type=="Hlt" ){ -// cout<<"HLT filled"<fill(event, setup, triggerTable, pvs, muons, electronId, elecs, jets, jetID, btagEff, btagPur, btagVtx, mets); - } - if(type=="muons"){ -// cout<<"Good Mu found"< step(selection_[key].first, consumesCollector()); - if(step.select(event)){ ++passed; - selection_[key].second->fill(event, setup, triggerTable, pvs, muons, electronId, elecs, jets, jetID, btagEff, btagPur, btagVtx, mets); - } else break; - } - if(type=="elecs"){ - SelectionStepHLT step(selection_[key].first, consumesCollector()); - if(step.select(event)){ ++passed; - selection_[key].second->fill(event, setup, triggerTable, pvs, muons, electronId, elecs, jets, jetID, btagEff, btagPur, btagVtx, mets); - } else break; - } - if(type=="jets" ){ - SelectionStepHLT step(selection_[key].first, consumesCollector()); - if(step.select(event, setup)){ ++passed; - selection_[key].second->fill(event, setup, triggerTable, pvs, muons, electronId, elecs, jets, jetID, btagEff, btagPur, btagVtx, mets); - } else break; - } - if(type=="jets/pf" ){ - SelectionStepHLT step(selection_[key].first, consumesCollector()); - if(step.select(event, setup)){ ++passed; - selection_[key].second->fill(event, setup, triggerTable, pvs, muons, electronId, elecs, jets, jetID, btagEff, btagPur, btagVtx, mets); - } else break; - } - if(type=="jets/calo" ){ -// cout<<"Jet found!"< step(selection_[key].first, consumesCollector()); - if(step.select(event, setup)){ ++passed; - selection_[key].second->fill(event, setup, triggerTable, pvs, muons, electronId, elecs, jets, jetID, btagEff, btagPur, btagVtx, mets); - } else break; - } - if(type=="met" ){ - SelectionStepHLT step(selection_[key].first, consumesCollector()); - if(step.select(event)){ ++passed; - selection_[key].second->fill(event, setup, triggerTable, pvs, muons, electronId, elecs, jets, jetID, btagEff, btagPur, btagVtx, mets); - } else break; - } - } - } -} - - diff --git a/HLTriggerOffline/Top/src/TopHLTSingleLeptonDQM.h b/HLTriggerOffline/Top/src/TopHLTSingleLeptonDQM.h deleted file mode 100644 index ea65c8f658ead..0000000000000 --- a/HLTriggerOffline/Top/src/TopHLTSingleLeptonDQM.h +++ /dev/null @@ -1,278 +0,0 @@ -#ifndef TOPSINGLELEPTONDQM -#define TOPSINGLELEPTONDQM - -#include -#include - -#include "FWCore/Framework/interface/Event.h" -#include "DQMServices/Core/interface/DQMStore.h" -#include "DQMServices/Core/interface/MonitorElement.h" - -#include "DataFormats/JetReco/interface/Jet.h" -#include "HLTriggerOffline/Top/interface/TopHLTDQMHelper.h" -#include "DataFormats/MuonReco/interface/Muon.h" -#include "DataFormats/Common/interface/ValueMap.h" -#include "DataFormats/METReco/interface/CaloMET.h" -#include "JetMETCorrections/Objects/interface/JetCorrector.h" -#include "DataFormats/EgammaCandidates/interface/GsfElectron.h" -#include "DataFormats/VertexReco/interface/Vertex.h" -/*Originally from DQM/Physics by R. Wolf and J. Andrea*/ - -/** - \class MonitorEnsemble TopDQMHelpers.h "DQM/Physics/interface/TopDQMHelpers.h" - - \brief Helper class to define histograms for monitoring of muon/electron/jet/met quantities. - - Helper class to contain histograms for the monitoring of muon/electron/jet/met quantities. - This class can be instantiated several times after several event selection steps. It can - be used to fill histograms in three different granularity levels according to STANDARD - (<10 histograms), VERBOSE(<20 histograms), DEBUG(<30 histgorams). Note that for the sake - of simplicity and to force the analyst to keep the number of histograms to be monitored - small the MonitorEnsemble class contains the histograms for all objects at once. It should - not contain much more than 10 histograms though in the STANDARD configuration, as these - histograms will be monitored at each SelectionStep. Monitoring of histograms after selec- - tion steps within the same object collection needs to be implemented within the Monitor- - Ensemble. It will not be covered by the SelectionStep class. -*/ - -namespace TopHLTSingleLepton { - - class MonitorEnsemble { - public: - /// different verbosity levels - enum Level{ STANDARD, VERBOSE, DEBUG }; - - public: - /// default contructor - MonitorEnsemble(const char* label, const edm::ParameterSet& cfg); - /// default destructor - ~MonitorEnsemble(){}; - - /// book histograms in subdirectory _directory_ - void book(std::string directory); - /// fill monitor histograms with electronId and jetCorrections - void fill(const edm::Event& event, const edm::EventSetup& setup, edm::Handle triggerTable, edm::Handle > pvs, edm::Handle > muons, edm::Handle > electronId, edm::Handle > elecs, edm::Handle > jets, edm::Handle jetID, edm::Handle btagEff, edm::Handle btagPur, edm::Handle btagVtx, std::vector< edm::Handle > > mets); - - private: - /// deduce monitorPath from label, the label is expected - /// to be of type 'selectionPath:monitorPath' - std::string monitorPath(const std::string& label) const { return label.substr(label.find(':')+1); }; - /// deduce selectionPath from label, the label is - /// expected to be of type 'selectionPath:monitorPath' - std::string selectionPath(const std::string& label) const { return label.substr(0, label.find(':')); }; - - /// set configurable labels for trigger monitoring histograms - void triggerBinLabels(std::string channel, const std::vector& labels); - /// fill trigger monitoring histograms - void fill(const edm::Event& event, const edm::TriggerResults& triggerTable, std::string channel, const std::vector& labels) const; - - /// check if histogram was booked - bool booked(const std::string histName) const { return hists_.find(histName.c_str())!=hists_.end(); }; - /// fill histogram if it had been booked before - void fill(const std::string histName, double value) const { if(booked(histName.c_str())) hists_.find(histName.c_str())->second->Fill(value); }; - /// fill histogram if it had been booked before (2-dim version) - void fill(const std::string histName, double xValue, double yValue) const { if(booked(histName.c_str())) hists_.find(histName.c_str())->second->Fill(xValue, yValue); }; - /// fill histogram if it had been booked before (2-dim version) - void fill(const std::string histName, double xValue, double yValue, double zValue) const { if(booked(histName.c_str())) hists_.find(histName.c_str())->second->Fill(xValue, yValue, zValue); }; - - private: - /// verbosity level for booking - Level verbosity_; - /// instance label - std::string label_; - /// considers a vector of METs - std::vector mets_; - /// input sources for monitoring - edm::InputTag elecs_, muons_, jets_, pvs_; - - /// trigger table - edm::InputTag triggerTable_; - /// trigger paths for monitoring, expected - /// to be of form signalPath:MonitorPath - std::vector triggerPaths_; - - /// electronId label - edm::InputTag electronId_; - /// electronId pattern we expect the following pattern: - /// 0: fails - /// 1: passes electron ID only - /// 2: passes electron Isolation only - /// 3: passes electron ID and Isolation only - /// 4: passes conversion rejection - /// 5: passes conversion rejection and ID - /// 6: passes conversion rejection and Isolation - /// 7: passes the whole selection - /// As described on https://twiki.cern.ch/twiki/bin/view/CMS/SimpleCutBasedEleID - int eidPattern_; - /// extra isolation criterion on electron - StringCutObjectSelector* elecIso_; - /// extra selection on electrons - StringCutObjectSelector* elecSelect_; - - /// extra selection on primary vertices; meant to investigate the pile-up effect - StringCutObjectSelector* pvSelect_; - - /// extra isolation criterion on muon - StringCutObjectSelector* muonIso_; - /// extra selection on muons - StringCutObjectSelector* muonSelect_; - - /// jetCorrector - std::string jetCorrector_; - /// jetID as an extra selection type - edm::InputTag jetIDLabel_; - /// extra jetID selection on calo jets - StringCutObjectSelector* jetIDSelect_; - /// extra selection on jets (here given as std::string as it depends - /// on the the jet type, which selections are valid and which not) - std::string jetSelect_; - /// include btag information or not - /// to be determined from the cfg - bool includeBTag_; - /// btag discriminator labels - edm::InputTag btagEff_, btagPur_, btagVtx_; - /// btag working points - double btagEffWP_, btagPurWP_, btagVtxWP_; - /// mass window upper and lower edge - double lowerEdge_, upperEdge_; - - /// number of logged interesting events - int logged_; - /// storage manager - DQMStore* store_; - /// histogram container - std::map hists_; - }; - - inline void - MonitorEnsemble::triggerBinLabels(std::string channel, const std::vector& labels) - { - for(unsigned int idx=0; idxsetBinLabel( idx+1, "["+monitorPath(labels[idx])+"]", 1); - hists_[(channel+"Eff_").c_str()]->setBinLabel( idx+1, "["+selectionPath(labels[idx])+"]|["+monitorPath(labels[idx])+"]", 1); - } - } - - inline void - MonitorEnsemble::fill(const edm::Event& event, const edm::TriggerResults& triggerTable, std::string channel, const std::vector& labels) const - { - for(unsigned int idx=0; idxsecond->getBinContent(idx+1); - double value = hists_.find((channel+"Eff_").c_str())->second->getBinContent(idx+1); - fill((channel+"Eff_").c_str(), idx+0.5, 1./evts*(acceptHLT(event, triggerTable, selectionPath(labels[idx]))-value)); - } - } - } - -} - -#include - -#include "DQM/Physics/interface/TopDQMHelpers.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/ServiceRegistry/interface/Service.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -#include "FWCore/Common/interface/TriggerNames.h" -#include "DataFormats/BeamSpot/interface/BeamSpot.h" -#include "DataFormats/VertexReco/interface/Vertex.h" -#include "DataFormats/Common/interface/TriggerResults.h" - -/** - \class TopHLTSingleLeptonDQM TopHLTSingleLeptonDQM.h "DQM/Physics/plugins/TopHLTSingleLeptonDQM.h" - - \brief Module to apply a monitored selection of top like events in the semi-leptonic channel - - Plugin to apply a monitored selection of top like events with some minimal flexibility - in the number and definition of the selection steps. To achieve this flexibility it - employes the SelectionStep class. The MonitorEnsemble class is used to provide a well - defined set of histograms to be monitored after each selection step. The SelectionStep - class provides a flexible and intuitive selection via the StringCutParser. SelectionStep - and MonitorEnsemble classes are interleaved. The monitoring starts after a preselection - step (which is not monitored in the context of this module) with an instance of the - MonitorEnsemble class. The following objects are supported for selection: - - - jets : of type reco::Jet (jets), reco::CaloJet (jets/calo) or reco::PFJet (jets/pflow) - - elecs : of type reco::GsfElectron - - muons : of type reco::Muon - - met : of type reco::MET - - These types have to be present as prefix of the selection step paramter _label_ separated - from the rest of the label by a ':' (e.g. in the form "jets:step0"). The class expects - selection labels of this type. They will be disentangled by the private helper functions - _objectType_ and _seletionStep_ as declared below. -*/ - -/// define MonitorEnsembple to be used -//using TopHLTSingleLepton::MonitorEnsemble; - -class TopHLTSingleLeptonDQM : public edm::EDAnalyzer { - public: - /// default constructor - TopHLTSingleLeptonDQM(const edm::ParameterSet& cfg); - /// default destructor - ~TopHLTSingleLeptonDQM(){ - if( vertexSelect_ ) delete vertexSelect_; - if( beamspotSelect_ ) delete beamspotSelect_; - }; - - /// do this during the event loop - virtual void analyze(const edm::Event& event, const edm::EventSetup& setup); - - private: - /// deduce object type from ParameterSet label, the label - /// is expected to be of type 'objectType:selectionStep' - std::string objectType(const std::string& label) { return label.substr(0, label.find(':')); }; - /// deduce selection step from ParameterSet label, the - /// label is expected to be of type 'objectType:selectionStep' - std::string selectionStep(const std::string& label) { return label.substr(label.find(':')+1); }; - - private: - /// trigger table - edm::InputTag triggerTable_; - /// trigger paths - std::vector triggerPaths_; - /// primary vertex - edm::InputTag vertex_; - /// string cut selector - StringCutObjectSelector* vertexSelect_; - - /// beamspot - edm::InputTag beamspot_; - /// string cut selector - StringCutObjectSelector* beamspotSelect_; - - /// needed to guarantee the selection order as defined by the order of - /// ParameterSets in the _selection_ vector as defined in the config - std::vector selectionOrder_; - /// this is the heart component of the plugin; std::string keeps a label - /// the selection step for later identification, edm::ParameterSet keeps - /// the configuration of the selection for the SelectionStep class, - /// MonitoringEnsemble keeps an instance of the MonitorEnsemble class to - /// be filled _after_ each selection step - std::map > selection_; - - std::vector metsTemp_; - - edm::EDGetTokenT< edm::View > muonsToken_; - edm::EDGetTokenT< edm::View > elecsToken_; - edm::EDGetTokenT< edm::View > jetsToken_; - - edm::EDGetTokenT< edm::ValueMap > electronIdToken_; - edm::EDGetTokenT jetIDToken_; - - edm::EDGetTokenT triggerTableToken_; - edm::EDGetTokenT< std::vector > vertexToken_; - edm::EDGetTokenT< edm::View > pvsToken_; - edm::EDGetTokenT beamspotToken_; - - edm::EDGetTokenT btagEffToken_, btagPurToken_, btagVtxToken_; - - std::vector< edm::EDGetTokenT< edm::View > > metsTokens_; -}; - -#endif diff --git a/HLTriggerOffline/Top/src/TopSingleLeptonHLTValidation.cc b/HLTriggerOffline/Top/src/TopSingleLeptonHLTValidation.cc new file mode 100644 index 0000000000000..69d399eb3e0d2 --- /dev/null +++ b/HLTriggerOffline/Top/src/TopSingleLeptonHLTValidation.cc @@ -0,0 +1,235 @@ +// -*- C++ -*- +// +// Package: HLTriggerOffline/Top +// Class: TopSingleLeptonHLTValidation +// +/**\class TopSingleLeptonHLTValidation TopSingleLeptonHLTValidation.cc HLTriggerOffline/Top/src/TopSingleLeptonHLTValidation.cc + +Description: + + Description: compute efficiencies of trigger paths on offline reco selection with respect to pt and eta + +Implementation: + harvesting +*/ +// +// Original Author: Elvire Bouvier +// Created: Thu, 16 Jan 2014 16:27:35 GMT +// +// +#include "HLTriggerOffline/Top/interface/TopSingleLeptonHLTValidation.h" + +// system include files +#include + +// user include files +#include "FWCore/Framework/interface/Frameworkfwd.h" + +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/MakerMacros.h" + +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ServiceRegistry/interface/Service.h" + +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "HLTrigger/HLTcore/interface/HLTConfigProvider.h" +#include "FWCore/Common/interface/TriggerNames.h" +#include "TString.h" +#include "DataFormats/MuonReco/interface/MuonPFIsolation.h" +// +// member functions +// + +// ------------ method called for each event ------------ + void +TopSingleLeptonHLTValidation::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) +{ + using namespace edm; + + isAll_ = false; isSel_ = false; + + // Electrons + Handle< edm::View > electrons; + iEvent.getByToken(tokElectrons_,electrons); + unsigned int nGoodE = 0; + for(edm::View::const_iterator e = electrons->begin(); e != electrons->end(); ++e){ + if (e->pt() < ptElectrons_) continue; + if (fabs(e->eta()) > etaElectrons_) continue; + if ((e->dr03TkSumPt()+e->dr03EcalRecHitSumEt()+e->dr03HcalTowerSumEt())/e->pt() > isoElectrons_ ) continue; + nGoodE++; + if (nGoodE == 1) elec_ = &(*e); + } + // Muons + Handle< edm::View > muons; + iEvent.getByToken(tokMuons_,muons); + unsigned int nGoodM = 0; + for(edm::View::const_iterator m = muons->begin(); m != muons->end(); ++m){ + if (!m->isPFMuon() || !m->isGlobalMuon()) continue; + if (m->pt() < ptMuons_) continue; + if (fabs(m->eta()) > etaMuons_) continue; + if (((m->pfIsolationR04()).sumChargedHadronPt+(m->pfIsolationR04()).sumPhotonEt+(m->pfIsolationR04()).sumNeutralHadronEt)/m->pt() > isoMuons_ ) continue; + nGoodM++; + if (nGoodM == 1) mu_ = &(*m); + } + // Jets + Handle< edm::View > jets; + iEvent.getByToken(tokJets_,jets); + unsigned int nGoodJ = 0; + if (minJets_ == 4) { + for(edm::View::const_iterator j = jets->begin(); j != jets->end(); ++j){ + if (nGoodJ < 1 && j->pt() < 55) continue; + if (nGoodJ < 2 && j->pt() < 45) continue; + if (nGoodJ < 3 && j->pt() < 35) continue; + if (nGoodJ >= 3 && j->pt() < 20) continue; + if (fabs(j->eta()) > etaJets_) continue; + nGoodJ++; + if (nGoodJ == minJets_) jet_ = &(*j); + } + } + else { + for(edm::View::const_iterator j = jets->begin(); j != jets->end(); ++j){ + if (j->pt() < ptJets_) continue; + if (fabs(j->eta()) > etaJets_) continue; + nGoodJ++; + if (nGoodJ == minJets_) jet_ = &(*j); + } + } + + if (nGoodE >= minElectrons_ && nGoodM >= minMuons_ && nGoodJ >= minJets_) isAll_ = true; + + //Trigger + Handle triggerTable; + iEvent.getByToken(tokTrigger_,triggerTable); + const edm::TriggerNames& triggerNames = iEvent.triggerNames(*triggerTable); + for (unsigned int i=0; i 0) { + hDenLeptonPt->Fill(elec_->pt()); + hDenLeptonEta->Fill(elec_->eta()); + } + if (minMuons_ > 0) { + hDenLeptonPt->Fill(mu_->pt()); + hDenLeptonEta->Fill(mu_->eta()); + } + hDenJetPt->Fill(jet_->pt()); + hDenJetEta->Fill(jet_->eta()); + } + if (isSel_) { + if (minElectrons_ > 0) { + hNumLeptonPt->Fill(elec_->pt()); + hNumLeptonEta->Fill(elec_->eta()); + } + if (minMuons_ > 0) { + hNumLeptonPt->Fill(mu_->pt()); + hNumLeptonEta->Fill(mu_->eta()); + } + hNumJetPt->Fill(jet_->pt()); + hNumJetEta->Fill(jet_->eta()); + } + } +} + + +// ------------ method called once each job just before starting event loop ------------ + void +TopSingleLeptonHLTValidation::beginJob() +{ +} + +// ------------ method called once each job just after ending the event loop ------------ + void +TopSingleLeptonHLTValidation::endJob() +{ +} + +// ------------ method called when starting to processes a run ------------ +/* + void + TopSingleLeptonHLTValidation::beginRun(edm::Run const&, edm::EventSetup const&) + { + } + */ + +// ------------ method called when ending the processing of a run ------------ + + void +TopSingleLeptonHLTValidation::endRun(edm::Run const&, edm::EventSetup const&) +{ + dbe_->setCurrentFolder(sDir_); + hEffLeptonPt = dbe_->book1D("EfficiencyVsPtLepton", "EfficiencyVsPtLepton", 50, 0., 250.); + hEffLeptonEta = dbe_->book1D("EfficiencyVsEtaLepton", "EfficiencyVsEtaLepton", 30, -3. , 3.); + hEffJetPt = dbe_->book1D("EfficiencyVsPtLastJet", "EfficiencyVsPtLastJet", 60, 0., 300.); + hEffJetEta = dbe_->book1D("EfficiencyVsEtaLastJet", "EfficiencyVsEtaLastJet", 30, -3., 3.); + + //------ Efficiency wrt + // lepton pt + for (int iBin = 1; iBin <= hNumLeptonPt->GetNbinsX(); ++iBin) + { + if(hDenLeptonPt->GetBinContent(iBin) == 0) + hEffLeptonPt->setBinContent(iBin, 0.); + else + hEffLeptonPt->setBinContent(iBin, hNumLeptonPt->GetBinContent(iBin) / hDenLeptonPt->GetBinContent(iBin)); + } + // lepton eta + for (int iBin = 1; iBin <= hNumLeptonEta->GetNbinsX(); ++iBin) + { + if(hDenLeptonEta->GetBinContent(iBin) == 0) + hEffLeptonEta->setBinContent(iBin, 0.); + else + hEffLeptonEta->setBinContent(iBin, hNumLeptonEta->GetBinContent(iBin) / hDenLeptonEta->GetBinContent(iBin)); + } + // jet pt + for (int iBin = 1; iBin <= hNumJetPt->GetNbinsX(); ++iBin) + { + if(hDenJetPt->GetBinContent(iBin) == 0) + hEffJetPt->setBinContent(iBin, 0.); + else + hEffJetPt->setBinContent(iBin, hNumJetPt->GetBinContent(iBin) / hDenJetPt->GetBinContent(iBin)); + } + // jet eta + for (int iBin = 1; iBin <= hNumJetEta->GetNbinsX(); ++iBin) + { + if(hDenJetEta->GetBinContent(iBin) == 0) + hEffJetEta->setBinContent(iBin, 0.); + else + hEffJetEta->setBinContent(iBin, hNumJetEta->GetBinContent(iBin) / hDenJetEta->GetBinContent(iBin)); + } +} + + +// ------------ method called when starting to processes a luminosity block ------------ +/* + void + TopSingleLeptonHLTValidation::beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) + { + } + */ + +// ------------ method called when ending the processing of a luminosity block ------------ +/* + void + TopSingleLeptonHLTValidation::endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) + { + } + */ + +// ------------ method fills 'descriptions' with the allowed parameters for the module ------------ +void +TopSingleLeptonHLTValidation::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + //The following says we do not know what parameters are allowed so do no validation + // Please change this to state exactly what you do use, even if it is no parameters + edm::ParameterSetDescription desc; + desc.setUnknown(); + descriptions.addDefault(desc); +} + diff --git a/HLTriggerOffline/Top/src/TopValidation.cc b/HLTriggerOffline/Top/src/TopValidation.cc deleted file mode 100644 index 482cb55da7767..0000000000000 --- a/HLTriggerOffline/Top/src/TopValidation.cc +++ /dev/null @@ -1,859 +0,0 @@ -// -*- C++ -*- -// -// Package: TopValidation -// Class: TopValidation -// -/**\class TopValidation TopValidation.cc DQM/TopValidation/src/TopValidation.cc - - Description: - - Implementation: - -*/ -// -// Original Author: Patricia LOBELLE PARDO () -// Created: Tue Sep 23 11:06:32 CEST 2008 -// -// - - -# include "HLTriggerOffline/Top/interface/TopValidation.h" -#include "FWCore/Common/interface/TriggerNames.h" - - - -TopValidation::TopValidation(const edm::ParameterSet& iConfig) - -{ - - - inputTag_ = iConfig.getParameter("TriggerResultsCollection"); - hlt_bitnames = iConfig.getParameter >("hltPaths"); - hlt_bitnamesMu = iConfig.getParameter >("hltMuonPaths"); - hlt_bitnamesEg = iConfig.getParameter >("hltEgPaths"); - hlt_bitnamesJet = iConfig.getParameter >("hltJetPaths"); - // triggerTag_ = iConfig.getUntrackedParameter("DQMFolder","HLT/Top"); - outputFileName = iConfig.getParameter("OutputFileName"); - outputMEsInRootFile = iConfig.getParameter("OutputMEsInRootFile"); - FolderName_ = iConfig.getParameter("FolderName"); - offlineElectrons = iConfig.getParameter("offlineElectrons"); - - topFolder << FolderName_ ; - - muonsToken_ = consumes(std::string("muons")); - ctfWithMaterialTracksToken_ = consumes(std::string("ctfWithMaterialTracks")); - iterativeCone5CaloJetsToken_ = consumes(std::string("iterativeCone5CaloJets")); - offlineElectronsToken_ = consumes(iConfig.getParameter("offlineElectrons")); - inputTagToken_ = consumes(iConfig.getParameter("TriggerResultsCollection")); - genParticlesToken_ = consumes(std::string("genParticles")); - -} - - -TopValidation::~TopValidation() -{ - - // do anything here that needs to be done at desctruction time - // (e.g. close files, deallocate resources etc.) - -} - - -// -// member functions -// - - -// ------------ method called to for each event ------------ -void -TopValidation::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) -{ - using namespace edm; - - - // muon collection - Handle muonsH; - iEvent.getByToken(muonsToken_, muonsH); - - // tracks collection - Handle tracks; - iEvent.getByToken(ctfWithMaterialTracksToken_, tracks); - - - // get calo jet collection - Handle jetsHandle; - iEvent.getByToken(iterativeCone5CaloJetsToken_, jetsHandle); - - - // electron collection - Handle electronsH; - iEvent.getByToken(offlineElectronsToken_,electronsH); - - // Trigger - Handle trh; - iEvent.getByToken(inputTagToken_,trh); - if( ! trh.isValid() ) { - LogDebug("") << "HL TriggerResults with label ["+inputTag_.encode()+"] not found!"; - return; - } - - - - const edm::TriggerNames & triggerNames = iEvent.triggerNames(*trh); - - ////////////////////////////////// - // generation info - ///////////////////////////////// - - //bool topevent = false; - - int ntop = 0; - int ngenel = 0; - int ngenmu = 0; - int ngentau = 0; - int ngenlep = 0; - int nmuaccept= 0; - int nelaccept= 0; - - // Gen Particles Collection - Handle genParticles; - iEvent.getByToken(genParticlesToken_, genParticles); - - for (size_t i=0; i < genParticles->size(); ++i){ - const reco::Candidate & p = (*genParticles)[i]; - int id = p.pdgId(); - int st = p.status(); - - if (abs(id) == 6 && st == 3) ntop++; - - if (st==3 && abs(id)==11) { - ngenel++; - if ( p.pt()>10 && fabs(p.eta())<2.4) nelaccept++; - } - - if (st==3 && abs(id)==13) { - ngenmu++; - if ( p.pt()>10 && fabs(p.eta())<2.4) nmuaccept++; - } - - if (st==3 && abs(id)==15) ngentau++; - if (st==3 && ( abs(id)==11 || abs(id)==13 || abs(id)==15)) ngenlep++; - - } - - // if (ntop == 2) topevent = true; - - - - // if (topevent){ - - //////////////////////////// - //////// Muons - ///////////////////////////////// - - //Muon Collection to use - std::map muonMap; - - for (size_t i = 0; i< muonsH->size(); ++i){ - if ( (*muonsH)[i].isGlobalMuon() && (*muonsH)[i].pt()>15 && fabs((*muonsH)[i].eta())<2.1){ - muonMap[(*muonsH)[i].pt()] = (*muonsH)[i]; - } - } - - //Muon selection - bool TwoMuonsAccepted = false; - - std::vector selected_muons; - reco::Muon muon1,muon2; - - for( std::map::reverse_iterator rit=muonMap.rbegin(); rit!=muonMap.rend(); ++rit){ - selected_muons.push_back( (*rit).second ); - } - - if (selected_muons.size()==1) muon1 = selected_muons[0]; - - if (selected_muons.size()>1){ - muon1 = selected_muons[0]; - muon2 = selected_muons[1]; - } - - - if( selected_muons.size()>1 && muon1.pt() >20 && muon1.charge()*muon2.charge()<0 ) TwoMuonsAccepted = true; - - - ////////////////////////////////// - ///////// Electrons - /////////////////////////////////////// - - //Electron Collection to use - std::map electronMap; - - for (size_t i = 0; isize();++i){ - if( (*electronsH)[i].pt()>15 && fabs( (*electronsH)[i].eta() )<2.4) { - electronMap[(*electronsH)[i].pt()] = (*electronsH)[i]; - } - } - - //Electron selection - bool TwoElectronsAccepted = false; - - std::vector selected_electrons; - reco::GsfElectron electron1, electron2; - - for( std::map::reverse_iterator rit=electronMap.rbegin(); rit!=electronMap.rend(); ++rit){ - selected_electrons.push_back( (*rit).second ); - } - - if (selected_electrons.size()==1) electron1 = selected_electrons[0]; - - if (selected_electrons.size()>1){ - - electron1 = selected_electrons[0]; - electron2 = selected_electrons[1]; - } - - - if( selected_electrons.size()>1 && electron1.pt() >20 && electron1.charge()*electron2.charge()<0 ) TwoElectronsAccepted = true; - - - - ///////////////////////////////// - ////////// Jets - ///////////////////////////////// - - //Jet Collection to use - - // Raw jets - const reco::CaloJetCollection *jets = jetsHandle.product(); - reco::CaloJetCollection::const_iterator jet; - - int n_jets_20=0; - - for (jet = jets->begin(); jet != jets->end(); jet++){ - // if (fabs(jet->eta()) <2.4 && jet->et() > 20) n_jets_20++; - // if (fabs(jet->eta()) <2.4 && jet->et() > 13) n_jets_20++; - if (fabs(jet->eta()) <2.4 && jet->et() > 13) n_jets_20++; - } - - -//// sort jets by et - /* std::map jetMap; - - for (size_t i = 0; isize();++i){ - if ((*jetsHandle)[i].et()>13 && fabs( (*jetsHandle)[i].eta())<2.4){ - - - jetMap[(*jetsHandle)[i].et()] = (*jetsHandle)[i]; - } - } - - std::vector selected_jets; - reco::CaloJet jet1, jet2; - - for( std::map::reverse_iterator rit=jetMap.rbegin(); rit!=jetMap.rend(); ++rit){ - selected_jets.push_back( (*rit).second ); - } - - if (selected_jets.size()>1){ - jet1 = selected_jets[0]; - jet2 = selected_jets[1]; - } - -*/ - -////////////////////////////////////////////////////////// -///// -//// "Offline" selection -///// -///////////////////////////////////////////////// - - - - bool offline_mu = false; - bool offline_dimu = false; - bool offline_el = false; - bool offline_diel = false; - bool offline_emu = false; - - - if ( selected_muons.size()>0 && muon1.pt()>20 && n_jets_20>1) offline_mu=true; - if ( TwoMuonsAccepted && n_jets_20>1) offline_dimu=true; - if ( selected_electrons.size()>0 && electron1.pt()>20 && n_jets_20>1) offline_el=true; - if ( TwoElectronsAccepted && n_jets_20>1) offline_diel=true; - if ( selected_muons.size()>0 && selected_electrons.size()>0 && (muon1.pt()>20 || electron1.pt()>20) && (muon1.charge()!= electron1.charge()) && n_jets_20>1) offline_emu=true; - - - - - ////////////////////////////// - // store fired bits - /////////////////////////////// - - int wtrig_[100] ={0}; - int wtrig_m[100] ={0}; - int wtrig_eg[100]={0}; - int wtrig_jet[100]={0}; - - bool HLTQuadJet30 = false; - bool HLTMu9 = false; - - - int n_hlt_bits = hlt_bitnames.size(); - int n_hlt_bits_mu = hlt_bitnamesMu.size(); - int n_hlt_bits_eg = hlt_bitnamesEg.size(); - int n_hlt_bits_jet= hlt_bitnamesJet.size(); - - const unsigned int n_TriggerResults( trh.product()->size()); - - for (unsigned int itrig=0; itrig< n_TriggerResults; ++itrig) { - - /////////// - if (triggerNames.triggerName(itrig) == "HLT_QuadJet30"){ - if ( trh.product()->accept( itrig ) ) HLTQuadJet30=true; - } - if (triggerNames.triggerName(itrig) == "HLT_Mu9"){ - if ( trh.product()->accept( itrig ) ) HLTMu9=true; - } - ////////////////// - if (trh.product()->accept(itrig)) { - - for (int i=0;iFill(1,1); - if (ngenlep==1 && ngenmu==1) events_acc_off_muon->Fill(2,1); - events_acc_off_electron->Fill(1,1); - if (ngenlep==1 && ngenel==1) events_acc_off_electron->Fill(2,1); - - /// **** tt->munubjjb ***** - - - - if ( ngenlep==1 && ngenmu==1 && nmuaccept==1){ //Select events within acceptance - - events_acc_off_muon->Fill(3,1); - - for (int j=0;jFill(j+1); - if (wtrig_m[j]==1) { - hlt_bitmu_hist_gen->Fill(j+1); - } - } - - for (int it=0; itFill(it+1); - if (wtrig_jet[it]==1) { - hlt_bitjet_hist_gen->Fill(it+1); - } - } - - - // Efficiencies wrt MC + offline - if (offline_mu){ - - events_acc_off_muon->Fill(4,1); - - // et_off_jet_mu -> Fill(jet1.et()); - // eta_off_jet_mu-> Fill(jet1.eta()); - - for (int it=0; itFill(it+1); - if (wtrig_jet[it]==1) { - hlt_bitjet_hist_reco->Fill(it+1); - // h_etjet1_trig_mu[it]->Fill(jet1.et()); - // h_etajet1_trig_mu[it]->Fill(jet1.eta()); - - - } - - } - - eta_off_mu->Fill(muon1.eta()); - pt_off_mu-> Fill(muon1.pt()); - - for (int j=0;jFill(j+1); - if (wtrig_m[j]==1) { - h_ptmu1_trig[j]->Fill(muon1.pt()); - h_etamu1_trig[j]->Fill(muon1.eta()); - hlt_bitmu_hist_reco->Fill(j+1); - } - } - - } - } - - - -///////// 4jets+1muon efficiency monitoring - - if (HLTQuadJet30){ // events firing the 4jet30 trigger - - if (offline_mu){ // events with 1 rec muon+ 2jets - - ptmuon_4jet1muSel->Fill(muon1.pt()); - etamuon_4jet1muSel->Fill(muon1.eta()); - Njets_4jet1muSel->Fill(n_jets_20); - - if (HLTMu9){ - - ptmuon_4jet1muSel_hltmu9->Fill(muon1.pt()); - etamuon_4jet1muSel_hltmu9->Fill(muon1.eta()); - Njets_4jet1muSel_hltmu9->Fill(n_jets_20); - } - } - } - - -//////////////////////////// - - - // ***** tt->enubjjb ***** - if ( ngenlep==1 && ngenel==1 && nelaccept==1){ - - events_acc_off_electron->Fill(3,1); - - for (int j=0;jFill(j+1); - if (wtrig_eg[j]==1) { - hlt_bitel_hist_gen->Fill(j+1); - } - } - - for (int it=0; itFill(it+1); - if (wtrig_jet[it]==1) { - hlt_bitjet_hist_gen_el->Fill(it+1); - } - } - - // Efficiencies wrt mc + offline - if (offline_el){ - - events_acc_off_electron->Fill(4,1); - - /*/// jets - et_off_jet_el -> Fill(jet1.et()); - eta_off_jet_el-> Fill(jet1.eta());*/ - - for (int it=0; itFill(it+1); - if (wtrig_jet[it]==1) { - hlt_bitjet_hist_reco_el->Fill(it+1); - // h_etjet1_trig_el[it]->Fill(jet1.et()); - // h_etajet1_trig_el[it]->Fill(jet1.eta()); - } - - } - - - /// - eta_off_el->Fill(electron1.eta()); - pt_off_el->Fill(electron1.pt()); - - for (int k=0;kFill(k+1); - - if (wtrig_eg[k]==1) { - h_ptel1_trig[k]->Fill(electron1.pt()); - h_etael1_trig[k]->Fill(electron1.eta()); - hlt_bitel_hist_reco->Fill(k+1); - } - } - - } - } - - - - // ****** tt->munubmunub ***** - if ( ngenlep==2 && ngenmu==2 && nmuaccept==2){ - - - // Efficiencies wrt mc+offline - if (offline_dimu){ - - eta_off_dimu1->Fill(muon1.eta()); - eta_off_dimu2->Fill(muon2.eta()); - pt_off_dimu1->Fill(muon1.pt()); - pt_off_dimu2->Fill(muon2.pt()); - - for (int j=0;jFill(muon1.pt()); - h_etamu1_trig_dimu[j]->Fill(muon1.eta()); - } - } - } - } - - - - // ***** tt->enubenub ***** - if ( ngenlep==2 && ngenel==2 && nelaccept==2){ - - - // Efficiencies wrt mc+offline - if (offline_diel){ - - eta_off_diel1->Fill(electron1.eta()); - eta_off_diel2->Fill(electron2.eta()); - pt_off_diel1->Fill(electron1.pt()); - pt_off_diel2->Fill(electron2.pt()); - - for (int k=0;kFill(electron1.pt()); - h_etael1_trig_diel[k]->Fill(electron1.eta()); - } - } - - } - } - - - // ***** tt->enubmunub - if ( ngenlep==2 && ngenel==1 && ngenmu==1 && nmuaccept==1 && nelaccept==1){ // tt->e mu events passing acceptance - - - // Efficiencies wrt mc+offline - if (offline_emu){ - - eta_off_emu_muon->Fill(muon1.eta()); - pt_off_emu_muon->Fill(muon1.pt()); - eta_off_emu_electron->Fill(electron1.eta()); - pt_off_emu_electron->Fill(electron1.pt()); - - for (int i=0;iFill(electron1.pt()); - h_etael1_trig_em[i]->Fill(electron1.eta()); - h_ptmu1_trig_em[i]->Fill(muon1.pt()); - h_etamu1_trig_em[i]->Fill(muon1.eta()); - } - } - - } - } - - - //////////////////////////////////////////////////////////////// - //} - -} - - - -// ------------ method called once each job just before starting event loop ------------ -void -TopValidation::beginJob() -{ - - dbe = edm::Service().operator->(); - - //dbe->setCurrentFolder("HLT/Top"); - //dbe->setCurrentFolder(triggerTag_); - - - - - //////////////////////////////////////////// - ////// histos lepton pt, eta for events passing hlt, efficiencies - ///////////////////////////////////////////// - - - dbe->setCurrentFolder(topFolder.str()+"Semileptonic_muon"); - - hlt_bitmu_hist_reco = dbe->book1D("muHLT","muHLT",hlt_bitnamesMu.size(),0.5,hlt_bitnamesMu.size()+0.5); - h_mu_reco = dbe->book1D("MuonEvents","MuonEvents",hlt_bitnamesMu.size(),0.5,hlt_bitnamesMu.size()+0.5); - - hlt_bitmu_hist_gen = dbe->book1D("genmuHLT","genmuHLT",hlt_bitnamesMu.size(),0.5,hlt_bitnamesMu.size()+0.5); - h_mu_gen = dbe->book1D("genMuonEvents","genMuonEvents",hlt_bitnamesMu.size(),0.5,hlt_bitnamesMu.size()+0.5); - - events_acc_off_muon = dbe->book1D("NEvents_acc_off","NEvents_acc_off",4,0.5,4.5); - events_acc_off_muon -> setBinLabel(1,"Total Events"); - events_acc_off_muon -> setBinLabel(2,"Gen semimuon"); - events_acc_off_muon -> setBinLabel(3,"Acceptance"); - events_acc_off_muon -> setBinLabel(4,"Acceptance+offline"); - - - dbe->setCurrentFolder(topFolder.str()+"Semileptonic_electron"); - - hlt_bitel_hist_reco = dbe->book1D("elHLT","elHLT",hlt_bitnamesEg.size(),0.5,hlt_bitnamesEg.size()+0.5); - h_el_reco = dbe->book1D("ElectronEvents","ElectronEvents",hlt_bitnamesEg.size(),0.5,hlt_bitnamesEg.size()+0.5); - - - hlt_bitel_hist_gen = dbe->book1D("genelHLT","genelHLT",hlt_bitnamesEg.size(),0.5,hlt_bitnamesEg.size()+0.5); - h_el_gen = dbe->book1D("genElectronEvents","genElectronEvents",hlt_bitnamesEg.size(),0.5,hlt_bitnamesEg.size()+0.5); - - - events_acc_off_electron = dbe->book1D("NEvents_acc_off","NEvents_acc_off",4,0.5,4.5); - events_acc_off_electron -> setBinLabel(1,"Total Events"); - events_acc_off_electron -> setBinLabel(2,"Gen semielectron"); - events_acc_off_electron -> setBinLabel(3,"Acceptance"); - events_acc_off_electron -> setBinLabel(4,"Acceptance+offline"); - - - dbe->setCurrentFolder(topFolder.str()+"Jets"); - - h_jet_reco = dbe->book1D("denom","denom",hlt_bitnamesJet.size(),0.5,hlt_bitnamesJet.size()+0.5); - hlt_bitjet_hist_reco = dbe->book1D("numer","numer",hlt_bitnamesJet.size(),0.5,hlt_bitnamesJet.size()+0.5); - - h_jet_reco_el = dbe->book1D("denom_el","denom_el",hlt_bitnamesJet.size(),0.5,hlt_bitnamesJet.size()+0.5); - hlt_bitjet_hist_reco_el = dbe->book1D("numer_el","numer_el",hlt_bitnamesJet.size(),0.5,hlt_bitnamesJet.size()+0.5); - - /// - h_jet_gen = dbe->book1D("denom_gen","denom_gen",hlt_bitnamesJet.size(),0.5,hlt_bitnamesJet.size()+0.5); - hlt_bitjet_hist_gen = dbe->book1D("numer_gen","numer_gen",hlt_bitnamesJet.size(),0.5,hlt_bitnamesJet.size()+0.5); - - h_jet_gen_el = dbe->book1D("denom_el_gen","denom_el_gen",hlt_bitnamesJet.size(),0.5,hlt_bitnamesJet.size()+0.5); - hlt_bitjet_hist_gen_el = dbe->book1D("numer_el_gen","numer_el_gen",hlt_bitnamesJet.size(),0.5,hlt_bitnamesJet.size()+0.5); - - - ///////// - /* et_off_jet_mu = dbe->book1D ("Jet1Et_M","Jet1Et_M",51,0.0,150.0); - et_off_jet_el = dbe->book1D ("Jet1Et_E","Jet1Et_E",51,0.0,150.0); - eta_off_jet_mu = dbe->book1D ("Jet1Eta_M","Jet1Eta_M",51,-2.5,2.5); - eta_off_jet_el = dbe->book1D ("Jet1Eta_E","Jet1Eta_E",51,-2.5,2.5); - njets_off_mu = dbe->book1D ("NJets_M","NJets_M",11,-0.5,10.5); - njets_off_el = dbe->book1D ("NJets_E","NJets_E",11,-0.5,10.5); - - - - - for (size_t j=0;j setBinLabel(j+1,hlt_bitnamesJet[j].c_str()); - h_jet_reco -> setBinLabel(j+1,hlt_bitnamesJet[j].c_str()); - h_jet_reco_el -> setBinLabel(j+1,hlt_bitnamesJet[j].c_str()); - h_etjet1_trig_mu[j] = dbe->book1D((histname_etjet).c_str(),(hlt_bitnamesJet[j]+"jetEt_M").c_str(),51,0.0,150.); - h_etjet1_trig_el[j] = dbe->book1D((histname_etjet_el).c_str(),(hlt_bitnamesJet[j]+"jetEt_E").c_str(),51,0.0,150.); - h_etajet1_trig_mu[j] = dbe->book1D((histname_etajet).c_str(),(hlt_bitnamesJet[j]+"jetEta_M").c_str(),51,-2.5,2.5); - h_etajet1_trig_el[j] = dbe->book1D((histname_etajet_el).c_str(),(hlt_bitnamesJet[j]+"jetEta_E").c_str(),51,-2.5,2.5); - - - } - */ - - - - dbe->setCurrentFolder(topFolder.str()+"Dileptonic_emu"); - - - for (size_t j=0;jbook1D((histname_ptmu_em).c_str(),(hlt_bitnames[j]+"_muonPt_EM").c_str(),40,0.0,150.); - h_etamu1_trig_em[j] = dbe->book1D((histname_etamu_em).c_str(),(hlt_bitnames[j]+"_muonEta_EM").c_str(),51,-2.5,2.5); - - h_ptel1_trig_em[j] = dbe->book1D((histname_ptel_em).c_str(),(hlt_bitnames[j]+"_electronPt_EM").c_str(),40,0.0,150.); - h_etael1_trig_em[j] = dbe->book1D((histname_etael_em).c_str(),(hlt_bitnames[j]+"_electronEta_EM").c_str(),51,-2.5,2.5); - - } - - - - - for (size_t jj=0;jjsetCurrentFolder(topFolder.str()+"Semileptonic_muon"); - h_ptmu1_trig[jj] = dbe->book1D((histname_ptmu).c_str(),(hlt_bitnamesMu[jj]+"muonPt_M").c_str(),40,0.0,150.); - h_etamu1_trig[jj] = dbe->book1D((histname_etamu).c_str(),(hlt_bitnamesMu[jj]+"muonEta_M").c_str(),51,-2.5,2.5); - - hlt_bitmu_hist_reco -> setBinLabel(jj+1,hlt_bitnamesMu[jj].c_str()); - h_mu_reco -> setBinLabel(jj+1,hlt_bitnamesMu[jj].c_str()); - - hlt_bitmu_hist_gen -> setBinLabel(jj+1,hlt_bitnamesMu[jj].c_str()); - h_mu_gen -> setBinLabel(jj+1,hlt_bitnamesMu[jj].c_str()); - - dbe->setCurrentFolder(topFolder.str()+"Dileptonic_muon"); - h_ptmu1_trig_dimu[jj] = dbe->book1D((histname_ptmu_dimu).c_str(),(hlt_bitnamesMu[jj]+"muon1Pt_MM").c_str(),40,0.0,150.); - h_etamu1_trig_dimu[jj] = dbe->book1D((histname_etamu_dimu).c_str(),(hlt_bitnamesMu[jj]+"muon1Pt_MM").c_str(),51,-2.5,2.5); - - - - - } - - - - - - - for (size_t k=0;ksetCurrentFolder(topFolder.str()+"Semileptonic_electron"); - - h_ptel1_trig[k] = dbe->book1D((histname_ptel).c_str(),(hlt_bitnamesEg[k]+"electronPt_E").c_str(),40,0.0,150.); - h_etael1_trig[k] = dbe->book1D((histname_etael).c_str(),(hlt_bitnamesEg[k]+"electronEta_E").c_str(),51,-2.5,2.5); - - hlt_bitel_hist_reco -> setBinLabel(k+1,hlt_bitnamesEg[k].c_str()); - h_el_reco -> setBinLabel(k+1,hlt_bitnamesEg[k].c_str()); - - hlt_bitel_hist_gen -> setBinLabel(k+1,hlt_bitnamesEg[k].c_str()); - h_el_gen -> setBinLabel(k+1,hlt_bitnamesEg[k].c_str()); - - - dbe->setCurrentFolder(topFolder.str()+"Dileptonic_electron"); - h_ptel1_trig_diel[k] = dbe->book1D((histname_ptel_diel).c_str(),(hlt_bitnamesEg[k]+"electron1Pt_EE").c_str(),40,0.0,150.); - h_etael1_trig_diel[k] = dbe->book1D((histname_etael_diel).c_str(),(hlt_bitnamesEg[k]+"electron1Eta_EE").c_str(),51,-2.5,2.5); - - - - - - } - - - -///////////////////////////////////////// -/// histos lepton pt, eta -//////////////////////////////////////////7 - - - // 4 jets+1mu eff monitoring - - dbe->setCurrentFolder(topFolder.str()+"4JetsPlus1MuonToCompareWithData"); - - ptmuon_4jet1muSel = dbe->book1D ("Muon1Pt_4Jets1MuonMon", "Muon1Pt_4Jets1MuonMon",40, 0.0,150.0); - etamuon_4jet1muSel = dbe->book1D ("Muon1Eta_4Jets1MuonMon","Muon1Eta_4Jets1MuonMon",51, -2.5,2.5); - Njets_4jet1muSel = dbe->book1D ("NJets_4Jets1MuonMon", "NJets_4Jets1MuonMon",11, -0.5,10.5); - - ptmuon_4jet1muSel_hltmu9 = dbe->book1D ("Muon1Pt_4Jets1MuonHLTMu9Mon", "Muon1Pt_4Jets1MuonHLTMu9Mon",40, 0.0,150.0); - etamuon_4jet1muSel_hltmu9 = dbe->book1D ("Muon1Eta_4Jets1MuonHLTMu9Mon","Muon1Eta_4Jets1MuonHLTMu9Mon",51, -2.5,2.5); - Njets_4jet1muSel_hltmu9 = dbe->book1D ("NJets_4Jets1MuonHLTMu9Mon", "NJets_4Jets1MuonHLTMu9Mon",11, -0.5,10.5); - - - - //semimu events - dbe->setCurrentFolder(topFolder.str()+"Semileptonic_muon"); - - - - eta_off_mu = dbe->book1D ("Muon1Eta_M","Muon1Eta_M",51,-2.5,2.5); - pt_off_mu = dbe->book1D ("Muon1Pt_M","Muon1Pt_M",40,0.0,150.0); - - - //semiel events - dbe->setCurrentFolder(topFolder.str()+"Semileptonic_electron"); - - eta_off_el = dbe->book1D ("Electron1Eta_E","Electron1Eta_E",51,-2.5,2.5); - pt_off_el = dbe->book1D ("Electron1Pt_E","Electron1Pt_E",40,0.0,150.0); - - - - //dimu events - dbe->setCurrentFolder(topFolder.str()+"Dileptonic_muon"); - - - eta_off_dimu1 = dbe->book1D ("Muon1Eta_MM","Muon1Eta_MM",51,-2.5,2.5); - pt_off_dimu1 = dbe->book1D ("Muon1Pt_MM","Muon1Pt_MM",40,0.0,150.0); - eta_off_dimu2 = dbe->book1D ("Muon2Eta_MM","Muon2Eta_MM",51,-2.5,2.5); - pt_off_dimu2 = dbe->book1D ("Muon2Pt_MM","Muon2Pt_MM",40,0.0,150.0); - - - - //diel events - dbe->setCurrentFolder(topFolder.str()+"Dileptonic_electron"); - - - eta_off_diel1 = dbe->book1D ("Electron1Eta_EE","Electron1Eta_EE",51,-2.5,2.5); - pt_off_diel1 = dbe->book1D ("Electron1Pt_EE","Electron1Pt_EE",40,0.0,150.0); - eta_off_diel2 = dbe->book1D ("Electron2Eta_EE","Electron2Eta_EE",51,-2.5,2.5); - pt_off_diel2 = dbe->book1D ("Electron2Pt_EE","Electron2Pt_EE",40,0.0,150.0); - - - //emu events - dbe->setCurrentFolder(topFolder.str()+"Dileptonic_emu"); - - - - eta_off_emu_muon = dbe->book1D ("Muon1Eta_EM","Muon1Eta_EM",51,-2.5,2.5); - pt_off_emu_muon = dbe->book1D ("Muon1Pt_EM","Muon1Pt_EM",40,0.0,150.0); - - eta_off_emu_electron = dbe->book1D ("Electron1Eta_EM","Electron1Eta_EM",51,-2.5,2.5); - pt_off_emu_electron = dbe->book1D ("Electron1Pt_EM","Electron1Pt_EM",40,0.0,150.0); - - - - - return ; - - -} - -// ------------ method called once each job just after ending the event loop ------------ -void -TopValidation::endJob() { -//Write DQM thing.. - // outFile_ = "prueba"; - //if(outFile_.size()>0) - - - // if (&*edm::Service()) edm::Service()->save (outFile_); - if(outputMEsInRootFile){ - dbe->showDirStructure(); - dbe->save(outputFileName); - } - - - - - - return ; -} - -//define this as a plug-in -//DEFINE_FWK_MODULE(TopValidation); diff --git a/HLTriggerOffline/Top/src/plugins.cc b/HLTriggerOffline/Top/src/plugins.cc deleted file mode 100644 index 37599d59910e7..0000000000000 --- a/HLTriggerOffline/Top/src/plugins.cc +++ /dev/null @@ -1,11 +0,0 @@ -#include "FWCore/PluginManager/interface/ModuleDef.h" -#include "FWCore/Framework/interface/MakerMacros.h" -#include "HLTriggerOffline/Top/interface/TopValidation.h" -#include "HLTriggerOffline/Top/src/TopHLTDiLeptonOfflineDQM.h" -#include "HLTriggerOffline/Top/src/TopHLTSingleLeptonDQM.h" -#include "HLTriggerOffline/Top/interface/HLTEfficiencyCalculator.h" - -DEFINE_FWK_MODULE(TopValidation); -DEFINE_FWK_MODULE(TopHLTDiLeptonOfflineDQM); -DEFINE_FWK_MODULE(TopHLTSingleLeptonDQM); -DEFINE_FWK_MODULE(HLTEffCalculator); From a6a0efa8fef97e45f275483a76ca9ad313dc0313 Mon Sep 17 00:00:00 2001 From: Elvire Bouvier Date: Thu, 23 Jan 2014 19:35:46 +0100 Subject: [PATCH 02/26] dileptonic ttbar --- .../Top/interface/TopDiLeptonHLTValidation.h | 173 +++++++++++++ .../topDiLeptonHLTEventValidation_cfi.py | 79 ++++++ .../Top/python/topHLTValidation_cff.py | 11 +- .../Top/src/TopDiLeptonHLTValidation.cc | 241 ++++++++++++++++++ 4 files changed, 498 insertions(+), 6 deletions(-) create mode 100644 HLTriggerOffline/Top/interface/TopDiLeptonHLTValidation.h create mode 100644 HLTriggerOffline/Top/python/topDiLeptonHLTEventValidation_cfi.py create mode 100644 HLTriggerOffline/Top/src/TopDiLeptonHLTValidation.cc diff --git a/HLTriggerOffline/Top/interface/TopDiLeptonHLTValidation.h b/HLTriggerOffline/Top/interface/TopDiLeptonHLTValidation.h new file mode 100644 index 0000000000000..0d03be755be65 --- /dev/null +++ b/HLTriggerOffline/Top/interface/TopDiLeptonHLTValidation.h @@ -0,0 +1,173 @@ +// -*- C++ -*- +// +// Package: HLTriggerOffline/Top +// Class: TopDiLeptonHLTValidation +// +/**\class TopDiLeptonHLTValidation TopDiLeptonHLTValidation.h HLTriggerOffline/Top/TopDiLeptonHLTValidation.h + + Description: + + Description: compute efficiencies of trigger paths on offline reco selection with respect to pt and eta + + Implementation: + harvesting + +*/ +// +// Original Author: Elvire Bouvier +// Created: Thu, 16 Jan 2014 16:27:35 GMT +// +// +#ifndef TOPDILEPTONHLTVALIDATION +#define TOPDILEPTONHLTVALIDATION + +// system include files +#include + +// user include files +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/EDAnalyzer.h" + +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/MakerMacros.h" + +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ServiceRegistry/interface/Service.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" + +#include "DQMServices/Core/interface/DQMStore.h" +#include "DQMServices/Core/interface/MonitorElement.h" + +#include "DataFormats/EgammaCandidates/interface/GsfElectron.h" +#include "DataFormats/MuonReco/interface/Muon.h" +#include "DataFormats/JetReco/interface/Jet.h" +#include "HLTrigger/HLTcore/interface/HLTConfigProvider.h" +#include "DataFormats/Common/interface/TriggerResults.h" +#include "TH1.h" + +// +// class declaration +// + +class TopDiLeptonHLTValidation : public edm::EDAnalyzer { + public: + explicit TopDiLeptonHLTValidation(const edm::ParameterSet&); + ~TopDiLeptonHLTValidation(); + + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + + + private: + virtual void beginJob() override; + virtual void analyze(const edm::Event&, const edm::EventSetup&) override; + virtual void endJob() override; + + //virtual void beginRun(edm::Run const&, edm::EventSetup const&) override; + virtual void endRun(edm::Run const&, edm::EventSetup const&) override; + //virtual void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override; + //virtual void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override; + + // ----------member data --------------------------- + // DQM + DQMStore* dbe_; + std::string sDir_; + MonitorElement* hEffLeptonPt; + MonitorElement* hEffLeptonEta; + MonitorElement* hEffJetPt; + MonitorElement* hEffJetEta; + // Electrons + const reco::GsfElectron *elec1_; + const reco::GsfElectron *elec2_; + std::string sElectrons_; + edm::EDGetTokenT< edm::View > tokElectrons_; + double ptElectrons_; + double etaElectrons_; + double isoElectrons_; + unsigned int minElectrons_; + // Muons + const reco::Muon *mu1_; + const reco::Muon *mu2_; + std::string sMuons_; + edm::EDGetTokenT< edm::View > tokMuons_; + double ptMuons_; + double etaMuons_; + double isoMuons_; + unsigned int minMuons_; + // Jets + const reco::Jet *jet_; + std::string sJets_; + edm::EDGetTokenT< edm::View > tokJets_; + double ptJets_; + double etaJets_; + unsigned int minJets_; + // Trigger + std::string sTrigger_; + edm::EDGetTokenT tokTrigger_; + std::vector vsPaths_; + // Histos + bool isAll_ = false; + TH1F *hDenLeptonPt = new TH1F("PtLeptonAll", "PtLeptonAll", 50, 0., 250.); + TH1F *hDenLeptonEta = new TH1F("EtaLeptonAll", "EtaLeptonAll", 30, -3. , 3.); + TH1F *hDenJetPt = new TH1F("PtLastJetAll", "PtLastJetAll", 60, 0., 300.); + TH1F *hDenJetEta = new TH1F("EtaLastJetAll", "EtaLastJetAll", 30, -3., 3.); + bool isSel_ = false; + TH1F *hNumLeptonPt = new TH1F("PtLeptonSel", "PtLeptonSel", 50, 0., 250.); + TH1F *hNumLeptonEta = new TH1F("EtaLeptonSel", "EtaLeptonSel", 30, -3. , 3.); + TH1F *hNumJetPt = new TH1F("PtLastJetSel", "PtLastJetSel", 60, 0., 300.); + TH1F *hNumJetEta = new TH1F("EtaLastJetSel", "EtaLastJetSel", 30, -3., 3.); +}; + +// +// constants, enums and typedefs +// + +// +// static data member definitions +// + +// +// constructors and destructor +// +TopDiLeptonHLTValidation::TopDiLeptonHLTValidation(const edm::ParameterSet& iConfig) : + sDir_(iConfig.getUntrackedParameter("sDir","Validation/Top/Efficiencies/")), + sElectrons_(iConfig.getUntrackedParameter("sElectrons","gsfElectrons")), + ptElectrons_(iConfig.getUntrackedParameter("ptElectrons",0.)), + etaElectrons_(iConfig.getUntrackedParameter("etaElectrons",0.)), + isoElectrons_(iConfig.getUntrackedParameter("isoElectrons",0.)), + minElectrons_(iConfig.getUntrackedParameter("minElectrons",0)), + sMuons_(iConfig.getUntrackedParameter("sMuons","muons")), + ptMuons_(iConfig.getUntrackedParameter("ptMuons",0.)), + etaMuons_(iConfig.getUntrackedParameter("etaMuons",0.)), + isoMuons_(iConfig.getUntrackedParameter("isoMuons",0.)), + minMuons_(iConfig.getUntrackedParameter("minMuons",0)), + sJets_(iConfig.getUntrackedParameter("sJets","ak5PFJets")), + ptJets_(iConfig.getUntrackedParameter("ptJets",0.)), + etaJets_(iConfig.getUntrackedParameter("etaJets",0.)), + minJets_(iConfig.getUntrackedParameter("minJets",0)), + sTrigger_(iConfig.getUntrackedParameter("sTrigger","TriggerResults")), + vsPaths_(iConfig.getUntrackedParameter< std::vector >("vsPaths")) + +{ + dbe_ = edm::Service().operator->(); + // Electrons + tokElectrons_ = consumes< edm::View >(edm::InputTag(sElectrons_)); + // Muons + tokMuons_ = consumes< edm::View >(edm::InputTag(sMuons_)); + // Jets + tokJets_ = consumes< edm::View >(edm::InputTag(sJets_)); + // Trigger + tokTrigger_ = consumes(edm::InputTag(sTrigger_)); +} + + +TopDiLeptonHLTValidation::~TopDiLeptonHLTValidation() +{ + + // do anything here that needs to be done at desctruction time + // (e.g. close files, deallocate resources etc.) + +} +#endif + +//define this as a plug-in +DEFINE_FWK_MODULE(TopDiLeptonHLTValidation); diff --git a/HLTriggerOffline/Top/python/topDiLeptonHLTEventValidation_cfi.py b/HLTriggerOffline/Top/python/topDiLeptonHLTEventValidation_cfi.py new file mode 100644 index 0000000000000..9aa78cb24c845 --- /dev/null +++ b/HLTriggerOffline/Top/python/topDiLeptonHLTEventValidation_cfi.py @@ -0,0 +1,79 @@ +import FWCore.ParameterSet.Config as cms + +# ttbar dimuon +DiMuonHLTValidation = cms.EDAnalyzer('TopDiLeptonHLTValidation', + # Directory + sDir = cms.untracked.string('HLTValidation/Top/DiMuon/'), + # Electrons + sElectrons = cms.untracked.string('gsfElectrons'), + ptElectrons = cms.untracked.double(20.), + etaElectrons = cms.untracked.double(2.5), + isoElectrons = cms.untracked.double(0.15), + minElectrons = cms.untracked.uint32(0), + # Muons + sMuons = cms.untracked.string('muons'), + ptMuons = cms.untracked.double(20.), + etaMuons = cms.untracked.double(2.4), + isoMuons = cms.untracked.double(0.2), + minMuons = cms.untracked.uint32(2), + # Jets + sJets = cms.untracked.string('ak5PFJets'), + ptJets = cms.untracked.double(30.), + etaJets = cms.untracked.double(2.5), + minJets = cms.untracked.uint32(2), + # Trigger + sTrigger = cms.untracked.string("TriggerResults"), + vsPaths = cms.untracked.vstring(['HLT_Mu17_Mu8','HLT_Mu17_TkMu8']), +) + +# ttbar dielec +DiElectronHLTValidation = cms.EDAnalyzer('TopDiLeptonHLTValidation', + # Directory + sDir = cms.untracked.string('HLTValidation/Top/DiElectron/'), + # Electrons + sElectrons = cms.untracked.string('gsfElectrons'), + ptElectrons = cms.untracked.double(20.), + etaElectrons = cms.untracked.double(2.5), + isoElectrons = cms.untracked.double(0.15), + minElectrons = cms.untracked.uint32(2), + # Muons + sMuons = cms.untracked.string('muons'), + ptMuons = cms.untracked.double(20.), + etaMuons = cms.untracked.double(2.4), + isoMuons = cms.untracked.double(0.2), + minMuons = cms.untracked.uint32(0), + # Jets + sJets = cms.untracked.string('ak5PFJets'), + ptJets = cms.untracked.double(30.), + etaJets = cms.untracked.double(2.5), + minJets = cms.untracked.uint32(2), + # Trigger + sTrigger = cms.untracked.string("TriggerResults"), + vsPaths = cms.untracked.vstring(['HLT_Ele17_CaloIdT_CaloIsoVL_TrkIdVL_TrkIsoVL_Ele8_CaloIdT_CaloIsoVL_TrkIdVL_TrkIsoVL']), +) + +# ttbar elec-muon +ElecMuonHLTValidation = cms.EDAnalyzer('TopDiLeptonHLTValidation', + # Directory + sDir = cms.untracked.string('HLTValidation/Top/ElecMuon/'), + # Electrons + sElectrons = cms.untracked.string('gsfElectrons'), + ptElectrons = cms.untracked.double(20.), + etaElectrons = cms.untracked.double(2.5), + isoElectrons = cms.untracked.double(0.15), + minElectrons = cms.untracked.uint32(1), + # Muons + sMuons = cms.untracked.string('muons'), + ptMuons = cms.untracked.double(20.), + etaMuons = cms.untracked.double(2.4), + isoMuons = cms.untracked.double(0.2), + minMuons = cms.untracked.uint32(1), + # Jets + sJets = cms.untracked.string('ak5PFJets'), + ptJets = cms.untracked.double(30.), + etaJets = cms.untracked.double(2.5), + minJets = cms.untracked.uint32(2), + # Trigger + sTrigger = cms.untracked.string("TriggerResults"), + vsPaths = cms.untracked.vstring(['HLT_Mu17_Ele8_CaloIdT_CaloIsoVL_TrkIdVL_TrkIsoVL','HLT_Mu8_Ele17_CaloIdT_CaloIsoVL_TrkIdVL_TrkIsoVL']), +) diff --git a/HLTriggerOffline/Top/python/topHLTValidation_cff.py b/HLTriggerOffline/Top/python/topHLTValidation_cff.py index ac322628a1414..0ec3291396363 100644 --- a/HLTriggerOffline/Top/python/topHLTValidation_cff.py +++ b/HLTriggerOffline/Top/python/topHLTValidation_cff.py @@ -1,15 +1,14 @@ import FWCore.ParameterSet.Config as cms -#from HLTriggerOffline.Top.topDiLeptonHLTEventValidation_cfi import * +from HLTriggerOffline.Top.topDiLeptonHLTEventValidation_cfi import * from HLTriggerOffline.Top.topSingleLeptonHLTEventValidation_cfi import * from HLTriggerOffline.Top.singletopHLTEventValidation_cfi import * topHLTriggerValidation = cms.Sequence( -# DiMuonHLTValidation -# *DiElectronHLTValidation -# *ElecMuonHLTValidation -# * - topSingleMuonHLTValidation + DiMuonHLTValidation + *DiElectronHLTValidation + *ElecMuonHLTValidation + *topSingleMuonHLTValidation *topSingleElectronHLTValidation *SingleTopSingleMuonHLTValidation *SingleTopSingleElectronHLTValidation diff --git a/HLTriggerOffline/Top/src/TopDiLeptonHLTValidation.cc b/HLTriggerOffline/Top/src/TopDiLeptonHLTValidation.cc new file mode 100644 index 0000000000000..2684663706885 --- /dev/null +++ b/HLTriggerOffline/Top/src/TopDiLeptonHLTValidation.cc @@ -0,0 +1,241 @@ +// -*- C++ -*- +// +// Package: HLTriggerOffline/Top +// Class: TopDiLeptonHLTValidation +// +/**\class TopDiLeptonHLTValidation TopDiLeptonHLTValidation.cc HLTriggerOffline/Top/src/TopDiLeptonHLTValidation.cc + +Description: + + Description: compute efficiencies of trigger paths on offline reco selection with respect to pt and eta + +Implementation: + harvesting + +*/ +// +// Original Author: Elvire Bouvier +// Created: Thu, 16 Jan 2014 16:27:35 GMT +// +// +#include "HLTriggerOffline/Top/interface/TopDiLeptonHLTValidation.h" + +// system include files +#include + +// user include files +#include "FWCore/Framework/interface/Frameworkfwd.h" + +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/MakerMacros.h" + +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ServiceRegistry/interface/Service.h" + +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "HLTrigger/HLTcore/interface/HLTConfigProvider.h" +#include "FWCore/Common/interface/TriggerNames.h" +#include "TString.h" +#include "DataFormats/MuonReco/interface/MuonPFIsolation.h" +// +// member functions +// + +// ------------ method called for each event ------------ + void +TopDiLeptonHLTValidation::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) +{ + using namespace edm; + + isAll_ = false; isSel_ = false; + + // Electrons + Handle< edm::View > electrons; + iEvent.getByToken(tokElectrons_,electrons); + unsigned int nGoodE = 0; + for(edm::View::const_iterator e = electrons->begin(); e != electrons->end(); ++e){ + if (e->pt() < ptElectrons_) continue; + if (fabs(e->eta()) > etaElectrons_) continue; + if ((e->dr03TkSumPt()+e->dr03EcalRecHitSumEt()+e->dr03HcalTowerSumEt())/e->pt() > isoElectrons_ ) continue; + nGoodE++; + if (nGoodE == 1) elec1_ = &(*e); + if (nGoodE == 2) elec2_ = &(*e); + } + // Muons + Handle< edm::View > muons; + iEvent.getByToken(tokMuons_,muons); + unsigned int nGoodM = 0; + for(edm::View::const_iterator m = muons->begin(); m != muons->end(); ++m){ + if (!m->isPFMuon() || (!m->isGlobalMuon() && !m->isTrackerMuon())) continue; + if (m->pt() < ptMuons_) continue; + if (fabs(m->eta()) > etaMuons_) continue; + if (((m->pfIsolationR04()).sumChargedHadronPt+(m->pfIsolationR04()).sumPhotonEt+(m->pfIsolationR04()).sumNeutralHadronEt)/m->pt() > isoMuons_ ) continue; + nGoodM++; + if (nGoodM == 1) mu1_ = &(*m); + if (nGoodM == 2) mu2_ = &(*m); + } + // Jets + Handle< edm::View > jets; + iEvent.getByToken(tokJets_,jets); + unsigned int nGoodJ = 0; + for(edm::View::const_iterator j = jets->begin(); j != jets->end(); ++j){ + if (j->pt() < ptJets_) continue; + if (fabs(j->eta()) > etaJets_) continue; + nGoodJ++; + if (nGoodJ == minJets_) jet_ = &(*j); + } + + if (nGoodE >= minElectrons_ && nGoodM >= minMuons_ && nGoodJ >= minJets_) isAll_ = true; + + //Trigger + Handle triggerTable; + iEvent.getByToken(tokTrigger_,triggerTable); + const edm::TriggerNames& triggerNames = iEvent.triggerNames(*triggerTable); + for (unsigned int i=0; i 0) { + hDenLeptonPt->Fill(elec1_->pt()); + hDenLeptonEta->Fill(elec1_->eta()); + } + if (minElectrons_ > 1) { + hDenLeptonPt->Fill(elec2_->pt()); + hDenLeptonEta->Fill(elec2_->eta()); + } + if (minMuons_ > 0) { + hDenLeptonPt->Fill(mu1_->pt()); + hDenLeptonEta->Fill(mu1_->eta()); + } + if (minMuons_ > 1) { + hDenLeptonPt->Fill(mu2_->pt()); + hDenLeptonEta->Fill(mu2_->eta()); + } + hDenJetPt->Fill(jet_->pt()); + hDenJetEta->Fill(jet_->eta()); + } + if (isSel_) { + if (minElectrons_ > 0) { + hNumLeptonPt->Fill(elec1_->pt()); + hNumLeptonEta->Fill(elec1_->eta()); + } + if (minElectrons_ > 1) { + hNumLeptonPt->Fill(elec2_->pt()); + hNumLeptonEta->Fill(elec2_->eta()); + } + if (minMuons_ > 0) { + hNumLeptonPt->Fill(mu1_->pt()); + hNumLeptonEta->Fill(mu1_->eta()); + } + if (minMuons_ > 1) { + hNumLeptonPt->Fill(mu2_->pt()); + hNumLeptonEta->Fill(mu2_->eta()); + } + hNumJetPt->Fill(jet_->pt()); + hNumJetEta->Fill(jet_->eta()); + } + } +} + + +// ------------ method called once each job just before starting event loop ------------ + void +TopDiLeptonHLTValidation::beginJob() +{ +} + +// ------------ method called once each job just after ending the event loop ------------ + void +TopDiLeptonHLTValidation::endJob() +{ +} + +// ------------ method called when starting to processes a run ------------ +/* + void + TopDiLeptonHLTValidation::beginRun(edm::Run const&, edm::EventSetup const&) + { + } + */ + +// ------------ method called when ending the processing of a run ------------ + + void +TopDiLeptonHLTValidation::endRun(edm::Run const&, edm::EventSetup const&) +{ + dbe_->setCurrentFolder(sDir_); + hEffLeptonPt = dbe_->book1D("EfficiencyVsPtLepton", "EfficiencyVsPtLepton", 50, 0., 250.); + hEffLeptonEta = dbe_->book1D("EfficiencyVsEtaLepton", "EfficiencyVsEtaLepton", 30, -3. , 3.); + hEffJetPt = dbe_->book1D("EfficiencyVsPtLastJet", "EfficiencyVsPtLastJet", 60, 0., 300.); + hEffJetEta = dbe_->book1D("EfficiencyVsEtaLastJet", "EfficiencyVsEtaLastJet", 30, -3., 3.); + + //------ Efficiency wrt + // lepton pt + for (int iBin = 1; iBin <= hNumLeptonPt->GetNbinsX(); ++iBin) + { + if(hDenLeptonPt->GetBinContent(iBin) == 0) + hEffLeptonPt->setBinContent(iBin, 0.); + else + hEffLeptonPt->setBinContent(iBin, hNumLeptonPt->GetBinContent(iBin) / hDenLeptonPt->GetBinContent(iBin)); + } + // lepton eta + for (int iBin = 1; iBin <= hNumLeptonEta->GetNbinsX(); ++iBin) + { + if(hDenLeptonEta->GetBinContent(iBin) == 0) + hEffLeptonEta->setBinContent(iBin, 0.); + else + hEffLeptonEta->setBinContent(iBin, hNumLeptonEta->GetBinContent(iBin) / hDenLeptonEta->GetBinContent(iBin)); + } + // jet pt + for (int iBin = 1; iBin <= hNumJetPt->GetNbinsX(); ++iBin) + { + if(hDenJetPt->GetBinContent(iBin) == 0) + hEffJetPt->setBinContent(iBin, 0.); + else + hEffJetPt->setBinContent(iBin, hNumJetPt->GetBinContent(iBin) / hDenJetPt->GetBinContent(iBin)); + } + // jet eta + for (int iBin = 1; iBin <= hNumJetEta->GetNbinsX(); ++iBin) + { + if(hDenJetEta->GetBinContent(iBin) == 0) + hEffJetEta->setBinContent(iBin, 0.); + else + hEffJetEta->setBinContent(iBin, hNumJetEta->GetBinContent(iBin) / hDenJetEta->GetBinContent(iBin)); + } +} + + +// ------------ method called when starting to processes a luminosity block ------------ +/* + void + TopDiLeptonHLTValidation::beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) + { + } + */ + +// ------------ method called when ending the processing of a luminosity block ------------ +/* + void + TopDiLeptonHLTValidation::endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) + { + } + */ + +// ------------ method fills 'descriptions' with the allowed parameters for the module ------------ +void +TopDiLeptonHLTValidation::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + //The following says we do not know what parameters are allowed so do no validation + // Please change this to state exactly what you do use, even if it is no parameters + edm::ParameterSetDescription desc; + desc.setUnknown(); + descriptions.addDefault(desc); +} + From b87fb9b9191dfc5494b6759b3bd8fb19d9da2751 Mon Sep 17 00:00:00 2001 From: Elvire Bouvier Date: Thu, 23 Jan 2014 19:36:24 +0100 Subject: [PATCH 03/26] calling new sequences --- .../Common/python/HLTValidationHarvest_cff.py | 8 ++++---- HLTriggerOffline/Common/python/HLTValidationQT_cff.py | 2 -- HLTriggerOffline/Common/python/HLTValidation_cff.py | 10 +++++----- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/HLTriggerOffline/Common/python/HLTValidationHarvest_cff.py b/HLTriggerOffline/Common/python/HLTValidationHarvest_cff.py index 173b39d6fe5fb..560f398062f09 100644 --- a/HLTriggerOffline/Common/python/HLTValidationHarvest_cff.py +++ b/HLTriggerOffline/Common/python/HLTValidationHarvest_cff.py @@ -1,7 +1,7 @@ from HLTriggerOffline.Tau.Validation.HLTTauPostValidation_cfi import * from HLTriggerOffline.Muon.HLTMuonPostVal_cff import * from HLTriggerOffline.Egamma.EgammaPostProcessor_cfi import * -from HLTriggerOffline.Top.HLTTopPostVal_cff import * +from HLTriggerOffline.Top.topHLTValidation_cff import * from HLTriggerOffline.Common.FourVectorHLTriggerOfflineClient_cfi import * from HLTriggerOffline.HeavyFlavor.heavyFlavorValidationHarvestingSequence_cff import * from HLTriggerOffline.JetMET.Validation.JetMETPostProcessor_cff import * @@ -16,7 +16,7 @@ HLTMuonPostVal +HLTTauPostVal +EgammaPostVal - +HLTTopPostVal + +topHLTriggerValidation +hltriggerFourVectorClient +heavyFlavorValidationHarvestingSequence +JetMETPostVal @@ -32,7 +32,7 @@ +HLTTauPostVal +EgammaPostVal +hltriggerFourVectorClient - +HLTTopPostVal + +topHLTriggerValidation +heavyFlavorValidationHarvestingSequence +JetMETPostVal #+HLTAlCaPostVal @@ -42,7 +42,7 @@ hltpostvalidation_preprod = cms.Sequence( HLTTauPostVal - +HLTTopPostVal + +topHLTriggerValidation +hltriggerFourVectorClient +heavyFlavorValidationHarvestingSequence +SusyExoPostVal diff --git a/HLTriggerOffline/Common/python/HLTValidationQT_cff.py b/HLTriggerOffline/Common/python/HLTValidationQT_cff.py index 32b5093f29cf2..ff07c6291137d 100644 --- a/HLTriggerOffline/Common/python/HLTValidationQT_cff.py +++ b/HLTriggerOffline/Common/python/HLTValidationQT_cff.py @@ -3,7 +3,6 @@ #from HLTriggerOffline.Common.HLTValidationQTExample_cfi import * from HLTriggerOffline.Muon.HLTMuonQualityTester_cfi import * from HLTriggerOffline.Tau.Validation.HLTTauQualityTests_cff import * -from HLTriggerOffline.Top.HLTTopQualityTester_cfi import * from HLTriggerOffline.Higgs.HLTHiggsQualityTester_cfi import * from HLTriggerOffline.JetMET.Validation.HLTJetMETQualityTester_cfi import * from HLTriggerOffline.SUSYBSM.HLTSusyExoQualityTester_cfi import * @@ -13,7 +12,6 @@ hltMuonQualityTester + hltTauRelvalQualityTests + hltHiggsQualityTester - + hltTopQualityTester + hltJetMetQualityTester + hltSusyExoQualityTester ) diff --git a/HLTriggerOffline/Common/python/HLTValidation_cff.py b/HLTriggerOffline/Common/python/HLTValidation_cff.py index 09e050055a1eb..6dbe0e4a4f5fe 100644 --- a/HLTriggerOffline/Common/python/HLTValidation_cff.py +++ b/HLTriggerOffline/Common/python/HLTValidation_cff.py @@ -1,7 +1,6 @@ from HLTriggerOffline.Muon.HLTMuonVal_cff import * from HLTriggerOffline.Tau.Validation.HLTTauValidation_cff import * from HLTriggerOffline.Egamma.EgammaValidationAutoConf_cff import * -from HLTriggerOffline.Top.topvalidation_cfi import * from HLTriggerOffline.Common.FourVectorHLTriggerOffline_cff import * from HLTriggerOffline.HeavyFlavor.heavyFlavorValidationSequence_cff import * from HLTriggerOffline.JetMET.Validation.HLTJetMETValidation_cff import * @@ -14,6 +13,7 @@ # from DQMOffline.Trigger.DQMOffline_Trigger_cff.py import * from DQMOffline.Trigger.HLTTauDQMOffline_cff import * from DQMOffline.Trigger.EgHLTOfflineSource_cfi import * +from DQMOffline.Trigger.topHLTOfflineDQM_cff import * #from DQMOffline.Trigger.MuonTrigRateAnalyzer_cfi import * # online dqm: from DQMOffline.Trigger.HLTMonTau_cfi import * @@ -27,7 +27,7 @@ HLTMuonVal +HLTTauVal +egammaValidationSequence - +HLTTopVal + +topHLTriggerOfflineDQM +HLTFourVector +heavyFlavorValidationSequence +HLTJetMETValSeq @@ -48,7 +48,7 @@ HLTMuonVal_FastSim +HLTTauValFS +egammaValidationSequenceFS - +HLTTopVal + +topHLTriggerOfflineDQM +HLTFourVector +heavyFlavorValidationSequence +HLTJetMETValSeq @@ -59,7 +59,7 @@ hltvalidation_preprod = cms.Sequence( HLTTauVal - +HLTTopVal + +topHLTriggerOfflineDQM +HLTFourVector +heavyFlavorValidationSequence +HLTSusyExoValSeq @@ -68,7 +68,7 @@ hltvalidation_preprod_fastsim = cms.Sequence( HLTTauVal - +HLTTopVal + +topHLTriggerOfflineDQM +HLTFourVector +heavyFlavorValidationSequence +HLTSusyExoValSeq_FastSim From 6fb4a01aee6fa800829a694927060ca6394fb1d1 Mon Sep 17 00:00:00 2001 From: Elvire Bouvier Date: Mon, 27 Jan 2014 15:06:00 +0100 Subject: [PATCH 04/26] removing replication between preprod and validation --- HLTriggerOffline/Common/python/HLTValidation_cff.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/HLTriggerOffline/Common/python/HLTValidation_cff.py b/HLTriggerOffline/Common/python/HLTValidation_cff.py index 6dbe0e4a4f5fe..b3e53a9b9ce0b 100644 --- a/HLTriggerOffline/Common/python/HLTValidation_cff.py +++ b/HLTriggerOffline/Common/python/HLTValidation_cff.py @@ -17,7 +17,7 @@ #from DQMOffline.Trigger.MuonTrigRateAnalyzer_cfi import * # online dqm: from DQMOffline.Trigger.HLTMonTau_cfi import * - + # additional producer sequence prior to hltvalidation # to evacuate producers/filters from the EndPath hltassociation = cms.Sequence( egammaSelectors ) @@ -59,7 +59,6 @@ hltvalidation_preprod = cms.Sequence( HLTTauVal - +topHLTriggerOfflineDQM +HLTFourVector +heavyFlavorValidationSequence +HLTSusyExoValSeq @@ -68,7 +67,6 @@ hltvalidation_preprod_fastsim = cms.Sequence( HLTTauVal - +topHLTriggerOfflineDQM +HLTFourVector +heavyFlavorValidationSequence +HLTSusyExoValSeq_FastSim From 6b9bbb6df8672f05585843708d29aa38f7383906 Mon Sep 17 00:00:00 2001 From: Elvire Bouvier Date: Thu, 30 Jan 2014 14:31:32 +0100 Subject: [PATCH 05/26] change of structure to match DQM specificities --- .../Common/python/HLTValidationHarvest_cff.py | 7 +- .../Common/python/HLTValidation_cff.py | 3 + .../Top/interface/TopDiLeptonHLTValidation.h | 41 +++---- .../interface/TopSingleLeptonHLTValidation.h | 40 +++--- .../python/singletopHLTEventValidation_cfi.py | 4 +- .../topDiLeptonHLTEventValidation_cfi.py | 6 +- .../topSingleLeptonHLTEventValidation_cfi.py | 4 +- .../Top/src/TopDiLeptonHLTValidation.cc | 110 ++++------------- .../Top/src/TopSingleLeptonHLTValidation.cc | 115 ++++-------------- 9 files changed, 92 insertions(+), 238 deletions(-) diff --git a/HLTriggerOffline/Common/python/HLTValidationHarvest_cff.py b/HLTriggerOffline/Common/python/HLTValidationHarvest_cff.py index 560f398062f09..f5b36ec54dff0 100644 --- a/HLTriggerOffline/Common/python/HLTValidationHarvest_cff.py +++ b/HLTriggerOffline/Common/python/HLTValidationHarvest_cff.py @@ -1,7 +1,7 @@ from HLTriggerOffline.Tau.Validation.HLTTauPostValidation_cfi import * from HLTriggerOffline.Muon.HLTMuonPostVal_cff import * from HLTriggerOffline.Egamma.EgammaPostProcessor_cfi import * -from HLTriggerOffline.Top.topHLTValidation_cff import * +from HLTriggerOffline.Top.topHLTValidationHarvest_cff import * from HLTriggerOffline.Common.FourVectorHLTriggerOfflineClient_cfi import * from HLTriggerOffline.HeavyFlavor.heavyFlavorValidationHarvestingSequence_cff import * from HLTriggerOffline.JetMET.Validation.JetMETPostProcessor_cff import * @@ -16,7 +16,7 @@ HLTMuonPostVal +HLTTauPostVal +EgammaPostVal - +topHLTriggerValidation + +topHLTriggerValidationHarvest +hltriggerFourVectorClient +heavyFlavorValidationHarvestingSequence +JetMETPostVal @@ -32,7 +32,7 @@ +HLTTauPostVal +EgammaPostVal +hltriggerFourVectorClient - +topHLTriggerValidation + +topHLTriggerValidationHarvest +heavyFlavorValidationHarvestingSequence +JetMETPostVal #+HLTAlCaPostVal @@ -42,7 +42,6 @@ hltpostvalidation_preprod = cms.Sequence( HLTTauPostVal - +topHLTriggerValidation +hltriggerFourVectorClient +heavyFlavorValidationHarvestingSequence +SusyExoPostVal diff --git a/HLTriggerOffline/Common/python/HLTValidation_cff.py b/HLTriggerOffline/Common/python/HLTValidation_cff.py index b3e53a9b9ce0b..947d788681f00 100644 --- a/HLTriggerOffline/Common/python/HLTValidation_cff.py +++ b/HLTriggerOffline/Common/python/HLTValidation_cff.py @@ -7,6 +7,7 @@ #from HLTriggerOffline.special.hltAlCaVal_cff import * from HLTriggerOffline.SUSYBSM.SusyExoValidation_cff import * from HLTriggerOffline.Higgs.HiggsValidation_cff import * +from HLTriggerOffline.Top.topHLTValidation_cff import * # offline dqm: @@ -28,6 +29,7 @@ +HLTTauVal +egammaValidationSequence +topHLTriggerOfflineDQM + +topHLTriggerValidation +HLTFourVector +heavyFlavorValidationSequence +HLTJetMETValSeq @@ -49,6 +51,7 @@ +HLTTauValFS +egammaValidationSequenceFS +topHLTriggerOfflineDQM + +topHLTriggerValidation +HLTFourVector +heavyFlavorValidationSequence +HLTJetMETValSeq diff --git a/HLTriggerOffline/Top/interface/TopDiLeptonHLTValidation.h b/HLTriggerOffline/Top/interface/TopDiLeptonHLTValidation.h index 0d03be755be65..6203493140655 100644 --- a/HLTriggerOffline/Top/interface/TopDiLeptonHLTValidation.h +++ b/HLTriggerOffline/Top/interface/TopDiLeptonHLTValidation.h @@ -26,7 +26,8 @@ // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" +//#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "DQMServices/Core/interface/DQMEDAnalyzer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" @@ -43,13 +44,13 @@ #include "DataFormats/JetReco/interface/Jet.h" #include "HLTrigger/HLTcore/interface/HLTConfigProvider.h" #include "DataFormats/Common/interface/TriggerResults.h" -#include "TH1.h" +//#include "TH1.h" // // class declaration // -class TopDiLeptonHLTValidation : public edm::EDAnalyzer { +class TopDiLeptonHLTValidation : public DQMEDAnalyzer { public: explicit TopDiLeptonHLTValidation(const edm::ParameterSet&); ~TopDiLeptonHLTValidation(); @@ -58,23 +59,20 @@ class TopDiLeptonHLTValidation : public edm::EDAnalyzer { private: - virtual void beginJob() override; virtual void analyze(const edm::Event&, const edm::EventSetup&) override; - virtual void endJob() override; - - //virtual void beginRun(edm::Run const&, edm::EventSetup const&) override; - virtual void endRun(edm::Run const&, edm::EventSetup const&) override; - //virtual void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override; - //virtual void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override; + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; // ----------member data --------------------------- // DQM - DQMStore* dbe_; std::string sDir_; - MonitorElement* hEffLeptonPt; - MonitorElement* hEffLeptonEta; - MonitorElement* hEffJetPt; - MonitorElement* hEffJetEta; + MonitorElement* hNumLeptonPt; + MonitorElement* hDenLeptonPt; + MonitorElement* hNumLeptonEta; + MonitorElement* hDenLeptonEta; + MonitorElement* hNumJetPt; + MonitorElement* hDenJetPt; + MonitorElement* hNumJetEta; + MonitorElement* hDenJetEta; // Electrons const reco::GsfElectron *elec1_; const reco::GsfElectron *elec2_; @@ -104,17 +102,9 @@ class TopDiLeptonHLTValidation : public edm::EDAnalyzer { std::string sTrigger_; edm::EDGetTokenT tokTrigger_; std::vector vsPaths_; - // Histos + // Flags bool isAll_ = false; - TH1F *hDenLeptonPt = new TH1F("PtLeptonAll", "PtLeptonAll", 50, 0., 250.); - TH1F *hDenLeptonEta = new TH1F("EtaLeptonAll", "EtaLeptonAll", 30, -3. , 3.); - TH1F *hDenJetPt = new TH1F("PtLastJetAll", "PtLastJetAll", 60, 0., 300.); - TH1F *hDenJetEta = new TH1F("EtaLastJetAll", "EtaLastJetAll", 30, -3., 3.); bool isSel_ = false; - TH1F *hNumLeptonPt = new TH1F("PtLeptonSel", "PtLeptonSel", 50, 0., 250.); - TH1F *hNumLeptonEta = new TH1F("EtaLeptonSel", "EtaLeptonSel", 30, -3. , 3.); - TH1F *hNumJetPt = new TH1F("PtLastJetSel", "PtLastJetSel", 60, 0., 300.); - TH1F *hNumJetEta = new TH1F("EtaLastJetSel", "EtaLastJetSel", 30, -3., 3.); }; // @@ -148,7 +138,6 @@ TopDiLeptonHLTValidation::TopDiLeptonHLTValidation(const edm::ParameterSet& iCon vsPaths_(iConfig.getUntrackedParameter< std::vector >("vsPaths")) { - dbe_ = edm::Service().operator->(); // Electrons tokElectrons_ = consumes< edm::View >(edm::InputTag(sElectrons_)); // Muons @@ -156,7 +145,7 @@ TopDiLeptonHLTValidation::TopDiLeptonHLTValidation(const edm::ParameterSet& iCon // Jets tokJets_ = consumes< edm::View >(edm::InputTag(sJets_)); // Trigger - tokTrigger_ = consumes(edm::InputTag(sTrigger_)); + tokTrigger_ = consumes(edm::InputTag(sTrigger_, "", "HLT")); } diff --git a/HLTriggerOffline/Top/interface/TopSingleLeptonHLTValidation.h b/HLTriggerOffline/Top/interface/TopSingleLeptonHLTValidation.h index cc4b84a765a36..6a8f1bddc2e07 100644 --- a/HLTriggerOffline/Top/interface/TopSingleLeptonHLTValidation.h +++ b/HLTriggerOffline/Top/interface/TopSingleLeptonHLTValidation.h @@ -23,7 +23,7 @@ // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "DQMServices/Core/interface/DQMEDAnalyzer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" @@ -40,13 +40,13 @@ #include "DataFormats/JetReco/interface/Jet.h" #include "HLTrigger/HLTcore/interface/HLTConfigProvider.h" #include "DataFormats/Common/interface/TriggerResults.h" -#include "TH1.h" +//#include "TH1.h" // // class declaration // -class TopSingleLeptonHLTValidation : public edm::EDAnalyzer { +class TopSingleLeptonHLTValidation : public DQMEDAnalyzer { public: explicit TopSingleLeptonHLTValidation(const edm::ParameterSet&); ~TopSingleLeptonHLTValidation(); @@ -55,23 +55,20 @@ class TopSingleLeptonHLTValidation : public edm::EDAnalyzer { private: - virtual void beginJob() override; virtual void analyze(const edm::Event&, const edm::EventSetup&) override; - virtual void endJob() override; - - //virtual void beginRun(edm::Run const&, edm::EventSetup const&) override; - virtual void endRun(edm::Run const&, edm::EventSetup const&) override; - //virtual void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override; - //virtual void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override; + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; // ----------member data --------------------------- // DQM - DQMStore* dbe_; std::string sDir_; - MonitorElement* hEffLeptonPt; - MonitorElement* hEffLeptonEta; - MonitorElement* hEffJetPt; - MonitorElement* hEffJetEta; + MonitorElement* hNumLeptonPt; + MonitorElement* hDenLeptonPt; + MonitorElement* hNumLeptonEta; + MonitorElement* hDenLeptonEta; + MonitorElement* hNumJetPt; + MonitorElement* hDenJetPt; + MonitorElement* hNumJetEta; + MonitorElement* hDenJetEta; // Electrons const reco::GsfElectron *elec_; std::string sElectrons_; @@ -99,17 +96,9 @@ class TopSingleLeptonHLTValidation : public edm::EDAnalyzer { std::string sTrigger_; edm::EDGetTokenT tokTrigger_; std::vector vsPaths_; - // Histos + // Flags bool isAll_ = false; - TH1F *hDenLeptonPt = new TH1F("PtLeptonAll", "PtLeptonAll", 50, 0., 250.); - TH1F *hDenLeptonEta = new TH1F("EtaLeptonAll", "EtaLeptonAll", 30, -3. , 3.); - TH1F *hDenJetPt = new TH1F("PtLastJetAll", "PtLastJetAll", 60, 0., 300.); - TH1F *hDenJetEta = new TH1F("EtaLastJetAll", "EtaLastJetAll", 30, -3., 3.); bool isSel_ = false; - TH1F *hNumLeptonPt = new TH1F("PtLeptonSel", "PtLeptonSel", 50, 0., 250.); - TH1F *hNumLeptonEta = new TH1F("EtaLeptonSel", "EtaLeptonSel", 30, -3. , 3.); - TH1F *hNumJetPt = new TH1F("PtLastJetSel", "PtLastJetSel", 60, 0., 300.); - TH1F *hNumJetEta = new TH1F("EtaLastJetSel", "EtaLastJetSel", 30, -3., 3.); }; // @@ -143,7 +132,6 @@ TopSingleLeptonHLTValidation::TopSingleLeptonHLTValidation(const edm::ParameterS vsPaths_(iConfig.getUntrackedParameter< std::vector >("vsPaths")) { - dbe_ = edm::Service().operator->(); // Electrons tokElectrons_ = consumes< edm::View >(edm::InputTag(sElectrons_)); // Muons @@ -151,7 +139,7 @@ TopSingleLeptonHLTValidation::TopSingleLeptonHLTValidation(const edm::ParameterS // Jets tokJets_ = consumes< edm::View >(edm::InputTag(sJets_)); // Trigger - tokTrigger_ = consumes(edm::InputTag(sTrigger_)); + tokTrigger_ = consumes(edm::InputTag(sTrigger_, "", "HLT")); } diff --git a/HLTriggerOffline/Top/python/singletopHLTEventValidation_cfi.py b/HLTriggerOffline/Top/python/singletopHLTEventValidation_cfi.py index 3960ae9a6e845..479ea170e93c9 100644 --- a/HLTriggerOffline/Top/python/singletopHLTEventValidation_cfi.py +++ b/HLTriggerOffline/Top/python/singletopHLTEventValidation_cfi.py @@ -5,7 +5,7 @@ # Directory sDir = cms.untracked.string('HLTValidation/SingleTop/SingleMuon/'), # Electrons - sElectrons = cms.untracked.string('gsfElectrons'), + sElectrons = cms.untracked.string('gedGsfElectrons'), ptElectrons = cms.untracked.double(30.), etaElectrons = cms.untracked.double(2.5), isoElectrons = cms.untracked.double(0.1), @@ -31,7 +31,7 @@ # Directory sDir = cms.untracked.string('HLTValidation/SingleTop/SingleElectron/'), # Electrons - sElectrons = cms.untracked.string('gsfElectrons'), + sElectrons = cms.untracked.string('gedGsfElectrons'), ptElectrons = cms.untracked.double(30.), etaElectrons = cms.untracked.double(2.5), isoElectrons = cms.untracked.double(0.1), diff --git a/HLTriggerOffline/Top/python/topDiLeptonHLTEventValidation_cfi.py b/HLTriggerOffline/Top/python/topDiLeptonHLTEventValidation_cfi.py index 9aa78cb24c845..a7cf48a93c441 100644 --- a/HLTriggerOffline/Top/python/topDiLeptonHLTEventValidation_cfi.py +++ b/HLTriggerOffline/Top/python/topDiLeptonHLTEventValidation_cfi.py @@ -5,7 +5,7 @@ # Directory sDir = cms.untracked.string('HLTValidation/Top/DiMuon/'), # Electrons - sElectrons = cms.untracked.string('gsfElectrons'), + sElectrons = cms.untracked.string('gedGsfElectrons'), ptElectrons = cms.untracked.double(20.), etaElectrons = cms.untracked.double(2.5), isoElectrons = cms.untracked.double(0.15), @@ -31,7 +31,7 @@ # Directory sDir = cms.untracked.string('HLTValidation/Top/DiElectron/'), # Electrons - sElectrons = cms.untracked.string('gsfElectrons'), + sElectrons = cms.untracked.string('gedGsfElectrons'), ptElectrons = cms.untracked.double(20.), etaElectrons = cms.untracked.double(2.5), isoElectrons = cms.untracked.double(0.15), @@ -57,7 +57,7 @@ # Directory sDir = cms.untracked.string('HLTValidation/Top/ElecMuon/'), # Electrons - sElectrons = cms.untracked.string('gsfElectrons'), + sElectrons = cms.untracked.string('gedGsfElectrons'), ptElectrons = cms.untracked.double(20.), etaElectrons = cms.untracked.double(2.5), isoElectrons = cms.untracked.double(0.15), diff --git a/HLTriggerOffline/Top/python/topSingleLeptonHLTEventValidation_cfi.py b/HLTriggerOffline/Top/python/topSingleLeptonHLTEventValidation_cfi.py index 069e65eb958f4..36fbfebd6c6f8 100644 --- a/HLTriggerOffline/Top/python/topSingleLeptonHLTEventValidation_cfi.py +++ b/HLTriggerOffline/Top/python/topSingleLeptonHLTEventValidation_cfi.py @@ -5,7 +5,7 @@ # Directory sDir = cms.untracked.string('HLTValidation/Top/SemiMuonic/'), # Electrons - sElectrons = cms.untracked.string('gsfElectrons'), + sElectrons = cms.untracked.string('gedGsfElectrons'), ptElectrons = cms.untracked.double(30.), etaElectrons = cms.untracked.double(2.5), isoElectrons = cms.untracked.double(0.1), @@ -31,7 +31,7 @@ # Directory sDir = cms.untracked.string('HLTValidation/Top/SemiElectronic/'), # Electrons - sElectrons = cms.untracked.string('gsfElectrons'), + sElectrons = cms.untracked.string('gedGsfElectrons'), ptElectrons = cms.untracked.double(30.), etaElectrons = cms.untracked.double(2.5), isoElectrons = cms.untracked.double(0.1), diff --git a/HLTriggerOffline/Top/src/TopDiLeptonHLTValidation.cc b/HLTriggerOffline/Top/src/TopDiLeptonHLTValidation.cc index 2684663706885..d64cfedac123e 100644 --- a/HLTriggerOffline/Top/src/TopDiLeptonHLTValidation.cc +++ b/HLTriggerOffline/Top/src/TopDiLeptonHLTValidation.cc @@ -7,10 +7,10 @@ Description: - Description: compute efficiencies of trigger paths on offline reco selection with respect to pt and eta +Description: compute efficiencies of trigger paths on offline reco selection with respect to pt and eta Implementation: - harvesting +harvesting */ // @@ -51,7 +51,8 @@ TopDiLeptonHLTValidation::analyze(const edm::Event& iEvent, const edm::EventSetu // Electrons Handle< edm::View > electrons; - iEvent.getByToken(tokElectrons_,electrons); + if (!iEvent.getByToken(tokElectrons_,electrons)) + edm::LogWarning("TopDiLeptonHLTValidation") << "Electrons collection not found \n"; unsigned int nGoodE = 0; for(edm::View::const_iterator e = electrons->begin(); e != electrons->end(); ++e){ if (e->pt() < ptElectrons_) continue; @@ -63,7 +64,8 @@ TopDiLeptonHLTValidation::analyze(const edm::Event& iEvent, const edm::EventSetu } // Muons Handle< edm::View > muons; - iEvent.getByToken(tokMuons_,muons); + if (!iEvent.getByToken(tokMuons_,muons)) + edm::LogWarning("TopDiLeptonHLTValidation") << "Muons collection not found \n"; unsigned int nGoodM = 0; for(edm::View::const_iterator m = muons->begin(); m != muons->end(); ++m){ if (!m->isPFMuon() || (!m->isGlobalMuon() && !m->isTrackerMuon())) continue; @@ -76,7 +78,8 @@ TopDiLeptonHLTValidation::analyze(const edm::Event& iEvent, const edm::EventSetu } // Jets Handle< edm::View > jets; - iEvent.getByToken(tokJets_,jets); + if (!iEvent.getByToken(tokJets_,jets)) + edm::LogWarning("TopDiLeptonHLTValidation") << "Jets collection not found \n"; unsigned int nGoodJ = 0; for(edm::View::const_iterator j = jets->begin(); j != jets->end(); ++j){ if (j->pt() < ptJets_) continue; @@ -89,7 +92,8 @@ TopDiLeptonHLTValidation::analyze(const edm::Event& iEvent, const edm::EventSetu //Trigger Handle triggerTable; - iEvent.getByToken(tokTrigger_,triggerTable); + if (!iEvent.getByToken(tokTrigger_,triggerTable)) + edm::LogWarning("TopDiLeptonHLTValidation") << "Trigger collection not found \n"; const edm::TriggerNames& triggerNames = iEvent.triggerNames(*triggerTable); for (unsigned int i=0; isetCurrentFolder(sDir_); - hEffLeptonPt = dbe_->book1D("EfficiencyVsPtLepton", "EfficiencyVsPtLepton", 50, 0., 250.); - hEffLeptonEta = dbe_->book1D("EfficiencyVsEtaLepton", "EfficiencyVsEtaLepton", 30, -3. , 3.); - hEffJetPt = dbe_->book1D("EfficiencyVsPtLastJet", "EfficiencyVsPtLastJet", 60, 0., 300.); - hEffJetEta = dbe_->book1D("EfficiencyVsEtaLastJet", "EfficiencyVsEtaLastJet", 30, -3., 3.); - - //------ Efficiency wrt - // lepton pt - for (int iBin = 1; iBin <= hNumLeptonPt->GetNbinsX(); ++iBin) - { - if(hDenLeptonPt->GetBinContent(iBin) == 0) - hEffLeptonPt->setBinContent(iBin, 0.); - else - hEffLeptonPt->setBinContent(iBin, hNumLeptonPt->GetBinContent(iBin) / hDenLeptonPt->GetBinContent(iBin)); - } - // lepton eta - for (int iBin = 1; iBin <= hNumLeptonEta->GetNbinsX(); ++iBin) - { - if(hDenLeptonEta->GetBinContent(iBin) == 0) - hEffLeptonEta->setBinContent(iBin, 0.); - else - hEffLeptonEta->setBinContent(iBin, hNumLeptonEta->GetBinContent(iBin) / hDenLeptonEta->GetBinContent(iBin)); - } - // jet pt - for (int iBin = 1; iBin <= hNumJetPt->GetNbinsX(); ++iBin) - { - if(hDenJetPt->GetBinContent(iBin) == 0) - hEffJetPt->setBinContent(iBin, 0.); - else - hEffJetPt->setBinContent(iBin, hNumJetPt->GetBinContent(iBin) / hDenJetPt->GetBinContent(iBin)); - } - // jet eta - for (int iBin = 1; iBin <= hNumJetEta->GetNbinsX(); ++iBin) - { - if(hDenJetEta->GetBinContent(iBin) == 0) - hEffJetEta->setBinContent(iBin, 0.); - else - hEffJetEta->setBinContent(iBin, hNumJetEta->GetBinContent(iBin) / hDenJetEta->GetBinContent(iBin)); - } + dbe.setCurrentFolder(sDir_); + hDenLeptonPt = dbe.book1D("PtLeptonAll", "PtLeptonAll", 50, 0., 250.); + hDenLeptonEta = dbe.book1D("EtaLeptonAll", "EtaLeptonAll", 30, -3. , 3.); + hDenJetPt = dbe.book1D("PtLastJetAll", "PtLastJetAll", 60, 0., 300.); + hDenJetEta = dbe.book1D("EtaLastJetAll", "EtaLastJetAll", 30, -3., 3.); + hNumLeptonPt = dbe.book1D("PtLeptonSel", "PtLeptonSel", 50, 0., 250.); + hNumLeptonEta = dbe.book1D("EtaLeptonSel", "EtaLeptonSel", 30, -3. , 3.); + hNumJetPt = dbe.book1D("PtLastJetSel", "PtLastJetSel", 60, 0., 300.); + hNumJetEta = dbe.book1D("EtaLastJetSel", "EtaLastJetSel", 30, -3., 3.); } - -// ------------ method called when starting to processes a luminosity block ------------ -/* - void - TopDiLeptonHLTValidation::beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) - { - } - */ - -// ------------ method called when ending the processing of a luminosity block ------------ -/* - void - TopDiLeptonHLTValidation::endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) - { - } - */ - // ------------ method fills 'descriptions' with the allowed parameters for the module ------------ void TopDiLeptonHLTValidation::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { diff --git a/HLTriggerOffline/Top/src/TopSingleLeptonHLTValidation.cc b/HLTriggerOffline/Top/src/TopSingleLeptonHLTValidation.cc index 69d399eb3e0d2..bf3913c5d4db2 100644 --- a/HLTriggerOffline/Top/src/TopSingleLeptonHLTValidation.cc +++ b/HLTriggerOffline/Top/src/TopSingleLeptonHLTValidation.cc @@ -7,10 +7,10 @@ Description: - Description: compute efficiencies of trigger paths on offline reco selection with respect to pt and eta +Description: compute efficiencies of trigger paths on offline reco selection with respect to pt and eta Implementation: - harvesting +harvesting */ // // Original Author: Elvire Bouvier @@ -43,14 +43,15 @@ // ------------ method called for each event ------------ void TopSingleLeptonHLTValidation::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) -{ +{ using namespace edm; isAll_ = false; isSel_ = false; // Electrons Handle< edm::View > electrons; - iEvent.getByToken(tokElectrons_,electrons); + if (!iEvent.getByToken(tokElectrons_,electrons)) + edm::LogWarning("TopSingleLeptonHLTValidation") << "Electrons collection not found \n"; unsigned int nGoodE = 0; for(edm::View::const_iterator e = electrons->begin(); e != electrons->end(); ++e){ if (e->pt() < ptElectrons_) continue; @@ -61,7 +62,8 @@ TopSingleLeptonHLTValidation::analyze(const edm::Event& iEvent, const edm::Event } // Muons Handle< edm::View > muons; - iEvent.getByToken(tokMuons_,muons); + if (!iEvent.getByToken(tokMuons_,muons)) + edm::LogWarning("TopSingleLeptonHLTValidation") << "Muons collection not found \n"; unsigned int nGoodM = 0; for(edm::View::const_iterator m = muons->begin(); m != muons->end(); ++m){ if (!m->isPFMuon() || !m->isGlobalMuon()) continue; @@ -73,7 +75,8 @@ TopSingleLeptonHLTValidation::analyze(const edm::Event& iEvent, const edm::Event } // Jets Handle< edm::View > jets; - iEvent.getByToken(tokJets_,jets); + if (!iEvent.getByToken(tokJets_,jets)) + edm::LogWarning("TopSingleLeptonHLTValidation") << "Jets collection not found \n"; unsigned int nGoodJ = 0; if (minJets_ == 4) { for(edm::View::const_iterator j = jets->begin(); j != jets->end(); ++j){ @@ -97,19 +100,22 @@ TopSingleLeptonHLTValidation::analyze(const edm::Event& iEvent, const edm::Event if (nGoodE >= minElectrons_ && nGoodM >= minMuons_ && nGoodJ >= minJets_) isAll_ = true; + //Trigger Handle triggerTable; - iEvent.getByToken(tokTrigger_,triggerTable); + if (!iEvent.getByToken(tokTrigger_,triggerTable)) + edm::LogWarning("TopSingleLeptonHLTValidation") << "Trigger collection not found \n"; const edm::TriggerNames& triggerNames = iEvent.triggerNames(*triggerTable); for (unsigned int i=0; isetCurrentFolder(sDir_); - hEffLeptonPt = dbe_->book1D("EfficiencyVsPtLepton", "EfficiencyVsPtLepton", 50, 0., 250.); - hEffLeptonEta = dbe_->book1D("EfficiencyVsEtaLepton", "EfficiencyVsEtaLepton", 30, -3. , 3.); - hEffJetPt = dbe_->book1D("EfficiencyVsPtLastJet", "EfficiencyVsPtLastJet", 60, 0., 300.); - hEffJetEta = dbe_->book1D("EfficiencyVsEtaLastJet", "EfficiencyVsEtaLastJet", 30, -3., 3.); - - //------ Efficiency wrt - // lepton pt - for (int iBin = 1; iBin <= hNumLeptonPt->GetNbinsX(); ++iBin) - { - if(hDenLeptonPt->GetBinContent(iBin) == 0) - hEffLeptonPt->setBinContent(iBin, 0.); - else - hEffLeptonPt->setBinContent(iBin, hNumLeptonPt->GetBinContent(iBin) / hDenLeptonPt->GetBinContent(iBin)); - } - // lepton eta - for (int iBin = 1; iBin <= hNumLeptonEta->GetNbinsX(); ++iBin) - { - if(hDenLeptonEta->GetBinContent(iBin) == 0) - hEffLeptonEta->setBinContent(iBin, 0.); - else - hEffLeptonEta->setBinContent(iBin, hNumLeptonEta->GetBinContent(iBin) / hDenLeptonEta->GetBinContent(iBin)); - } - // jet pt - for (int iBin = 1; iBin <= hNumJetPt->GetNbinsX(); ++iBin) - { - if(hDenJetPt->GetBinContent(iBin) == 0) - hEffJetPt->setBinContent(iBin, 0.); - else - hEffJetPt->setBinContent(iBin, hNumJetPt->GetBinContent(iBin) / hDenJetPt->GetBinContent(iBin)); - } - // jet eta - for (int iBin = 1; iBin <= hNumJetEta->GetNbinsX(); ++iBin) - { - if(hDenJetEta->GetBinContent(iBin) == 0) - hEffJetEta->setBinContent(iBin, 0.); - else - hEffJetEta->setBinContent(iBin, hNumJetEta->GetBinContent(iBin) / hDenJetEta->GetBinContent(iBin)); - } + dbe.setCurrentFolder(sDir_); + hDenLeptonPt = dbe.book1D("PtLeptonAll", "PtLeptonAll", 50, 0., 250.); + hDenLeptonEta = dbe.book1D("EtaLeptonAll", "EtaLeptonAll", 30, -3. , 3.); + hDenJetPt = dbe.book1D("PtLastJetAll", "PtLastJetAll", 60, 0., 300.); + hDenJetEta = dbe.book1D("EtaLastJetAll", "EtaLastJetAll", 30, -3., 3.); + hNumLeptonPt = dbe.book1D("PtLeptonSel", "PtLeptonSel", 50, 0., 250.); + hNumLeptonEta = dbe.book1D("EtaLeptonSel", "EtaLeptonSel", 30, -3. , 3.); + hNumJetPt = dbe.book1D("PtLastJetSel", "PtLastJetSel", 60, 0., 300.); + hNumJetEta = dbe.book1D("EtaLastJetSel", "EtaLastJetSel", 30, -3., 3.); } -// ------------ method called when starting to processes a luminosity block ------------ -/* - void - TopSingleLeptonHLTValidation::beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) - { - } - */ - -// ------------ method called when ending the processing of a luminosity block ------------ -/* - void - TopSingleLeptonHLTValidation::endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) - { - } - */ - // ------------ method fills 'descriptions' with the allowed parameters for the module ------------ void TopSingleLeptonHLTValidation::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { From 448ca65e7bd65d280a1815f22847d2f6655ca6fe Mon Sep 17 00:00:00 2001 From: Elvire Bouvier Date: Tue, 11 Feb 2014 11:36:38 +0100 Subject: [PATCH 06/26] fix JetCorrections bug --- .../Trigger/python/topHLTOfflineDQM_cff.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 DQMOffline/Trigger/python/topHLTOfflineDQM_cff.py diff --git a/DQMOffline/Trigger/python/topHLTOfflineDQM_cff.py b/DQMOffline/Trigger/python/topHLTOfflineDQM_cff.py new file mode 100644 index 0000000000000..ec12e277218fc --- /dev/null +++ b/DQMOffline/Trigger/python/topHLTOfflineDQM_cff.py @@ -0,0 +1,19 @@ +import FWCore.ParameterSet.Config as cms + +from DQMOffline.Trigger.topDiLeptonHLTEventDQM_cfi import * +from DQMOffline.Trigger.topSingleLeptonHLTEventDQM_cfi import * +from DQMOffline.Trigger.singletopHLTEventDQM_cfi import * +#from JetMETCorrections.Configuration.JetCorrectionProducersAllAlgos_cff import * + + + +topHLTriggerOfflineDQM = cms.Sequence( + DiMuonHLTOfflineDQM + *DiElectronHLTOfflineDQM + *ElecMuonHLTOfflineDQM + *topSingleMuonHLTOfflineDQM + *topSingleElectronHLTOfflineDQM + *SingleTopSingleMuonHLTOfflineDQM + *SingleTopSingleElectronHLTOfflineDQM + ) + From a8ddde9c34dad4e17fab171e71d5883bd3c493b8 Mon Sep 17 00:00:00 2001 From: Elvire Bouvier Date: Wed, 12 Feb 2014 12:10:41 +0100 Subject: [PATCH 07/26] the missing file --- .../Top/python/topHLTValidationHarvest_cff.py | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 HLTriggerOffline/Top/python/topHLTValidationHarvest_cff.py diff --git a/HLTriggerOffline/Top/python/topHLTValidationHarvest_cff.py b/HLTriggerOffline/Top/python/topHLTValidationHarvest_cff.py new file mode 100644 index 0000000000000..34f4ed727b45a --- /dev/null +++ b/HLTriggerOffline/Top/python/topHLTValidationHarvest_cff.py @@ -0,0 +1,89 @@ +import FWCore.ParameterSet.Config as cms + +DiMuonHLTValidationHarvest = cms.EDAnalyzer("DQMGenericClient", + subDirs = cms.untracked.vstring("HLTValidation/Top/DiMuon"), + efficiency = cms.vstring( + "hEffLeptonEta 'Efficiency vs Eta Lepton ' EtaLeptonSel EtaLeptonAll ", + "hEffLeptonPt 'Efficiency vs Pt Lepton' PtLeptonSel PtLeptonAll ", + "hEffLastJetEta 'Efficiency vs Eta Last Jet' EtaLastJetSel EtaLastJetAll", + "hEffLastJetPt 'Efficiency vs Pt Last Jet' PtLastJetSel PtLastJetAll" + ), + resolution = cms.vstring(""), + ) + +DiElectronHLTValidationHarvest = cms.EDAnalyzer("DQMGenericClient", + subDirs = cms.untracked.vstring("HLTValidation/Top/DiElectron"), + efficiency = cms.vstring( + "hEffLeptonEta 'Efficiency vs Eta Lepton ' EtaLeptonSel EtaLeptonAll ", + "hEffLeptonPt 'Efficiency vs Pt Lepton' PtLeptonSel PtLeptonAll ", + "hEffLastJetEta 'Efficiency vs Eta Last Jet' EtaLastJetSel EtaLastJetAll", + "hEffLastJetPt 'Efficiency vs Pt Last Jet' PtLastJetSel PtLastJetAll" + ), + resolution = cms.vstring(""), + ) + +ElecMuonHLTValidationHarvest = cms.EDAnalyzer("DQMGenericClient", + subDirs = cms.untracked.vstring("HLTValidation/Top/ElecMuon"), + efficiency = cms.vstring( + "hEffLeptonEta 'Efficiency vs Eta Lepton ' EtaLeptonSel EtaLeptonAll ", + "hEffLeptonPt 'Efficiency vs Pt Lepton' PtLeptonSel PtLeptonAll ", + "hEffLastJetEta 'Efficiency vs Eta Last Jet' EtaLastJetSel EtaLastJetAll", + "hEffLastJetPt 'Efficiency vs Pt Last Jet' PtLastJetSel PtLastJetAll" + ), + resolution = cms.vstring(""), + ) + +topSingleMuonHLTValidationHarvest = cms.EDAnalyzer("DQMGenericClient", + subDirs = cms.untracked.vstring("HLTValidation/Top/SemiMuonic"), + efficiency = cms.vstring( + "hEffLeptonEta 'Efficiency vs Eta Lepton ' EtaLeptonSel EtaLeptonAll ", + "hEffLeptonPt 'Efficiency vs Pt Lepton' PtLeptonSel PtLeptonAll ", + "hEffLastJetEta 'Efficiency vs Eta Last Jet' EtaLastJetSel EtaLastJetAll", + "hEffLastJetPt 'Efficiency vs Pt Last Jet' PtLastJetSel PtLastJetAll" + ), + resolution = cms.vstring(""), + ) + +topSingleElectronHLTValidationHarvest = cms.EDAnalyzer("DQMGenericClient", + subDirs = cms.untracked.vstring("HLTValidation/Top/SemiElectronic"), + efficiency = cms.vstring( + "hEffLeptonEta 'Efficiency vs Eta Lepton ' EtaLeptonSel EtaLeptonAll ", + "hEffLeptonPt 'Efficiency vs Pt Lepton' PtLeptonSel PtLeptonAll ", + "hEffLastJetEta 'Efficiency vs Eta Last Jet' EtaLastJetSel EtaLastJetAll", + "hEffLastJetPt 'Efficiency vs Pt Last Jet' PtLastJetSel PtLastJetAll" + ), + resolution = cms.vstring(""), + ) + +SingleTopSingleMuonHLTValidationHarvest = cms.EDAnalyzer("DQMGenericClient", + subDirs = cms.untracked.vstring("HLTValidation/SingleTop/SingleMuon"), + efficiency = cms.vstring( + "hEffLeptonEta 'Efficiency vs Eta Lepton ' EtaLeptonSel EtaLeptonAll ", + "hEffLeptonPt 'Efficiency vs Pt Lepton' PtLeptonSel PtLeptonAll ", + "hEffLastJetEta 'Efficiency vs Eta Last Jet' EtaLastJetSel EtaLastJetAll", + "hEffLastJetPt 'Efficiency vs Pt Last Jet' PtLastJetSel PtLastJetAll" + ), + resolution = cms.vstring(""), + ) + +SingleTopSingleElectronHLTValidationHarvest = cms.EDAnalyzer("DQMGenericClient", + subDirs = cms.untracked.vstring("HLTValidation/SingleTop/SingleElectron"), + efficiency = cms.vstring( + "hEffLeptonEta 'Efficiency vs Eta Lepton ' EtaLeptonSel EtaLeptonAll ", + "hEffLeptonPt 'Efficiency vs Pt Lepton' PtLeptonSel PtLeptonAll ", + "hEffLastJetEta 'Efficiency vs Eta Last Jet' EtaLastJetSel EtaLastJetAll", + "hEffLastJetPt 'Efficiency vs Pt Last Jet' PtLastJetSel PtLastJetAll" + ), + resolution = cms.vstring(""), + ) + +topHLTriggerValidationHarvest = cms.Sequence( + DiMuonHLTValidationHarvest + *DiElectronHLTValidationHarvest + *ElecMuonHLTValidationHarvest + *topSingleMuonHLTValidationHarvest + *topSingleElectronHLTValidationHarvest + *SingleTopSingleMuonHLTValidationHarvest + *SingleTopSingleElectronHLTValidationHarvest + ) + From 8a25c46ec7e90d41517953d83c6a97d06f697b37 Mon Sep 17 00:00:00 2001 From: wmtan Date: Wed, 19 Feb 2014 11:55:08 -0600 Subject: [PATCH 08/26] fix ExceptionToActionTable lifetime --- Mixing/Base/src/PileUp.cc | 2 +- Mixing/Base/src/SecondaryEventProvider.cc | 5 +++-- Mixing/Base/src/SecondaryEventProvider.h | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Mixing/Base/src/PileUp.cc b/Mixing/Base/src/PileUp.cc index 07a4a1182419d..cc05e79452d9b 100644 --- a/Mixing/Base/src/PileUp.cc +++ b/Mixing/Base/src/PileUp.cc @@ -62,7 +62,7 @@ namespace edm { if(pset.existsAs >("producers", true)) { std::vector producers = pset.getParameter >("producers"); - provider_.reset(new SecondaryEventProvider(producers, *productRegistry_, ExceptionToActionTable(), processConfiguration_)); + provider_.reset(new SecondaryEventProvider(producers, *productRegistry_, processConfiguration_)); } productRegistry_->setFrozen(); diff --git a/Mixing/Base/src/SecondaryEventProvider.cc b/Mixing/Base/src/SecondaryEventProvider.cc index 6a727f08ab44c..4369bcebef260 100644 --- a/Mixing/Base/src/SecondaryEventProvider.cc +++ b/Mixing/Base/src/SecondaryEventProvider.cc @@ -1,4 +1,5 @@ #include "Mixing/Base/src/SecondaryEventProvider.h" +#include "FWCore/Framework/interface/ExceptionActions.h" #include "FWCore/Framework/src/PreallocationConfiguration.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/Utilities/interface/StreamID.h" @@ -6,9 +7,9 @@ namespace edm { SecondaryEventProvider::SecondaryEventProvider(std::vector& psets, ProductRegistry& preg, - ExceptionToActionTable const& actions, boost::shared_ptr processConfiguration) : - workerManager_(boost::shared_ptr(new ActivityRegistry), actions) { + exceptionToActionTable_(new ExceptionToActionTable), + workerManager_(boost::shared_ptr(new ActivityRegistry), *exceptionToActionTable_) { std::vector shouldBeUsedLabels; std::set unscheduledLabels; const PreallocationConfiguration preallocConfig; diff --git a/Mixing/Base/src/SecondaryEventProvider.h b/Mixing/Base/src/SecondaryEventProvider.h index 39bdf2c6e9e46..617442d8be440 100644 --- a/Mixing/Base/src/SecondaryEventProvider.h +++ b/Mixing/Base/src/SecondaryEventProvider.h @@ -2,11 +2,11 @@ #define Mixing_Base_SecondaryEventProvider_h #include "FWCore/Framework/interface/WorkerManager.h" - #include "FWCore/Framework/interface/Frameworkfwd.h" #include "boost/shared_ptr.hpp" +#include #include #include @@ -17,7 +17,6 @@ namespace edm { public: SecondaryEventProvider(std::vector& psets, ProductRegistry& pregistry, - ExceptionToActionTable const& actions, boost::shared_ptr processConfiguration); void beginRun(RunPrincipal& run, const edm::EventSetup& setup, ModuleCallingContext const*); @@ -32,6 +31,7 @@ namespace edm { void endJob() {workerManager_.endJob();} private: + std::unique_ptr exceptionToActionTable_; WorkerManager workerManager_; }; } From 8b5642cc47bca27a1b6e699c2a8e79f397a2c0a0 Mon Sep 17 00:00:00 2001 From: Elvire Bouvier Date: Thu, 23 Jan 2014 17:25:56 +0100 Subject: [PATCH 09/26] semi-leptonic ttbar and single top --- HLTriggerOffline/Top/BuildFile.xml | 3 + .../Top/interface/HLTEfficiencyCalculator.h | 145 --- .../Top/interface/TopHLTDQMHelper.h | 395 -------- .../interface/TopSingleLeptonHLTValidation.h | 168 ++++ .../Top/interface/TopValidation.h | 238 ----- .../Top/python/HLTTopPostVal_cff.py | 127 --- .../Top/python/HLTTopQualityTester_cfi.py | 14 - .../Top/python/PostProcessor_cfi.py | 62 -- .../Top/python/singletopHLTEventDQM_cfi.py | 315 ------- .../python/singletopHLTEventValidation_cfi.py | 53 ++ .../Top/python/topDiLeptonHLTEventDQM_cfi.py | 639 ------------- HLTriggerOffline/Top/python/topHLTDQM_cff.py | 20 - .../Top/python/topHLTValidation_cff.py | 17 + .../python/topSingleLeptonHLTEventDQM_cfi.py | 843 ----------------- .../topSingleLeptonHLTEventValidation_cfi.py | 53 ++ .../Top/python/topvalidation_cfi.py | 17 - HLTriggerOffline/Top/python/triggerEff_cfi.py | 8 - .../Top/src/HLTEfficiencyCalculator.cc | 82 -- HLTriggerOffline/Top/src/TopHLTDQMHelper.cc | 149 --- .../Top/src/TopHLTDiLeptonOfflineDQM.cc | 738 --------------- .../Top/src/TopHLTDiLeptonOfflineDQM.h | 316 ------- .../Top/src/TopHLTSingleLeptonDQM.cc | 736 --------------- .../Top/src/TopHLTSingleLeptonDQM.h | 278 ------ .../Top/src/TopSingleLeptonHLTValidation.cc | 235 +++++ HLTriggerOffline/Top/src/TopValidation.cc | 859 ------------------ HLTriggerOffline/Top/src/plugins.cc | 11 - 26 files changed, 529 insertions(+), 5992 deletions(-) delete mode 100644 HLTriggerOffline/Top/interface/HLTEfficiencyCalculator.h delete mode 100644 HLTriggerOffline/Top/interface/TopHLTDQMHelper.h create mode 100644 HLTriggerOffline/Top/interface/TopSingleLeptonHLTValidation.h delete mode 100644 HLTriggerOffline/Top/interface/TopValidation.h delete mode 100644 HLTriggerOffline/Top/python/HLTTopPostVal_cff.py delete mode 100644 HLTriggerOffline/Top/python/HLTTopQualityTester_cfi.py delete mode 100644 HLTriggerOffline/Top/python/PostProcessor_cfi.py delete mode 100644 HLTriggerOffline/Top/python/singletopHLTEventDQM_cfi.py create mode 100644 HLTriggerOffline/Top/python/singletopHLTEventValidation_cfi.py delete mode 100644 HLTriggerOffline/Top/python/topDiLeptonHLTEventDQM_cfi.py delete mode 100644 HLTriggerOffline/Top/python/topHLTDQM_cff.py create mode 100644 HLTriggerOffline/Top/python/topHLTValidation_cff.py delete mode 100644 HLTriggerOffline/Top/python/topSingleLeptonHLTEventDQM_cfi.py create mode 100644 HLTriggerOffline/Top/python/topSingleLeptonHLTEventValidation_cfi.py delete mode 100644 HLTriggerOffline/Top/python/topvalidation_cfi.py delete mode 100644 HLTriggerOffline/Top/python/triggerEff_cfi.py delete mode 100644 HLTriggerOffline/Top/src/HLTEfficiencyCalculator.cc delete mode 100644 HLTriggerOffline/Top/src/TopHLTDQMHelper.cc delete mode 100644 HLTriggerOffline/Top/src/TopHLTDiLeptonOfflineDQM.cc delete mode 100644 HLTriggerOffline/Top/src/TopHLTDiLeptonOfflineDQM.h delete mode 100644 HLTriggerOffline/Top/src/TopHLTSingleLeptonDQM.cc delete mode 100644 HLTriggerOffline/Top/src/TopHLTSingleLeptonDQM.h create mode 100644 HLTriggerOffline/Top/src/TopSingleLeptonHLTValidation.cc delete mode 100644 HLTriggerOffline/Top/src/TopValidation.cc delete mode 100644 HLTriggerOffline/Top/src/plugins.cc diff --git a/HLTriggerOffline/Top/BuildFile.xml b/HLTriggerOffline/Top/BuildFile.xml index fc07887bd8741..0ec2cbc261b7d 100644 --- a/HLTriggerOffline/Top/BuildFile.xml +++ b/HLTriggerOffline/Top/BuildFile.xml @@ -1,8 +1,11 @@ + + + diff --git a/HLTriggerOffline/Top/interface/HLTEfficiencyCalculator.h b/HLTriggerOffline/Top/interface/HLTEfficiencyCalculator.h deleted file mode 100644 index bb162ab74836e..0000000000000 --- a/HLTriggerOffline/Top/interface/HLTEfficiencyCalculator.h +++ /dev/null @@ -1,145 +0,0 @@ - -#ifndef HLTriggerOffline_HLTEffCalculator_H -#define HLTriggerOffline_HLTEffCalculator_H - - -// system include files -#include -#include - -// user include files -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/MakerMacros.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -#include "DataFormats/Common/interface/Ref.h" -#include "DataFormats/Common/interface/DetSetVector.h" -#include "DataFormats/Candidate/interface/Candidate.h" -#include "DataFormats/JetReco/interface/Jet.h" -#include "DataFormats/JetReco/interface/CaloJetCollection.h" -#include "DataFormats/TrackReco/interface/Track.h" -#include "DataFormats/TrackReco/interface/TrackExtra.h" - -#include "DataFormats/MuonReco/interface/MuonFwd.h" -#include "DataFormats/MuonReco/interface/Muon.h" - -#include "DataFormats/Candidate/interface/Candidate.h" -#include "DataFormats/RecoCandidate/interface/RecoCandidate.h" -#include "DataFormats/Common/interface/Handle.h" -#include "DataFormats/Common/interface/TriggerResults.h" -#include "DataFormats/Common/interface/RefToBase.h" -#include "HLTrigger/HLTfilters/interface/HLTHighLevel.h" -#include "DataFormats/EgammaCandidates/interface/GsfElectron.h" -#include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h" - -#include "DataFormats/EgammaCandidates/interface/Electron.h" -#include "DataFormats/EgammaCandidates/interface/ElectronFwd.h" -#include "DataFormats/EgammaReco/interface/SuperCluster.h" -#include "DataFormats/EgammaReco/interface/BasicCluster.h" -#include "DataFormats/EgammaReco/interface/BasicClusterFwd.h" - -#include "FWCore/ServiceRegistry/interface/Service.h" - -#include "HLTriggerOffline/Top/interface/TopHLTDQMHelper.h" - - -#include "TDirectory.h" -#include "TH1F.h" -#include "TVector3.h" -#include "TLorentzVector.h" -#include -#include -#include -#include -#include -#include "TFile.h" -#include "TH1.h" - -class EfficiencyHandler{ -public: - EfficiencyHandler(std::string Name, const std::vector& pathnames, int verb = 0):name(Name),verbosity(verb){ - int nPaths = (int)pathnames.size(); - efficiencies= new TH1D(name.c_str(),"efficiencies per path",nPaths,-0.5,(double)nPaths-0.5); - std::stringstream s; - for(int i = 0; i < nPaths; i++){ - pathNames.push_back(pathnames.at(i)); - efficiencies->GetXaxis()->SetBinLabel(i+1,pathnames.at(i).c_str()); - s.str(""); - s<<"path_"<Fill(0); - if(verbosity > 0) - std::cout<Fill(0); - } - } - void WriteAll(TDirectory * d){ - if(d == NULL){ - std::cout<<"NULL directory! Cannot write!"<GetXaxis()->GetNbins() != (int)denominator.size()){ - std::cout<<"HLT path numbers mismatch!"<GetEntries(); - eff= eff/(double)denominator.at(s)->GetEntries(); - efficiencies->SetBinContent(s+1, eff); - } - (d->mkdir(std::string(name+"_BareNumberHists").c_str()))->cd(); - for(unsigned int s = 0; s < pathNames.size(); s++){ - numerator.at(s)->Write(); - denominator.at(s)->Write(); - } - d->cd(); - efficiencies->Write(); - d->cd(); - } -private: - TH1* efficiencies; - std::vector numerator; //now just a number holder. for possible extention in future - std::vector denominator; //now just a number holder. for possible extention in future - std::string name; - std::vector pathNames; - int verbosity; -}; - -// -// class decleration -// - -class HLTEffCalculator : public edm::EDAnalyzer { -public: - explicit HLTEffCalculator(const edm::ParameterSet&); - ~HLTEffCalculator(); - - -private: - virtual void beginJob() ; - virtual void analyze(const edm::Event&, const edm::EventSetup&); - virtual void endJob() ; - - // edm::Service fs; - - - // ----------member data --------------------------- - - std::string outputFileName ; - EfficiencyHandler * myEffHandler; - edm::InputTag HLTresCollection; - int verbosity ; - edm::EDGetTokenT HLTresCollectionToken_; -}; - - -#endif diff --git a/HLTriggerOffline/Top/interface/TopHLTDQMHelper.h b/HLTriggerOffline/Top/interface/TopHLTDQMHelper.h deleted file mode 100644 index a5835bbff164f..0000000000000 --- a/HLTriggerOffline/Top/interface/TopHLTDQMHelper.h +++ /dev/null @@ -1,395 +0,0 @@ -#ifndef TOPHLTDQMHELPERS -#define TOPHLTDQMHELPERS - -#include -#include -#include -//#include -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Common/interface/TriggerNames.h" -#include "DataFormats/Common/interface/TriggerResults.h" -#include "DataFormats/VertexReco/interface/Vertex.h" -#include "DataFormats/RecoCandidate/interface/RecoCandidate.h" - -#include "FWCore/Framework/interface/ConsumesCollector.h" -#include "FWCore/Framework/interface/EDConsumerBase.h" -/*Originally from DQM/Physics package, written by Roger Wolf and Jeremy Andrea*/ -/** - \fn acceptTopHLTDQMHelpers.h "HLTriggerOffline/Top/interface/TopHLTDQMHelpers.h" - - \brief Helper function to determine trigger accepts. - - Helper function to determine trigger accept for given TriggerResults and - a given TriggerPath(s). -*/ - -inline bool -acceptHLT(const edm::Event& event, const edm::TriggerResults& triggerTable, const std::string& triggerPath) -{ - bool passed=false; - const edm::TriggerNames& triggerNames = event.triggerNames(triggerTable); - for(unsigned int i=0; i& triggerPaths) -{ - bool passed=false; - for(unsigned int j=0; j& jets); - /// calculate top quark mass estimate - double massTopQuark(const std::vector& jets); - /// calculate W boson transverse mass estimate -/* double tmassWBoson(const T& mu, const reco::CaloMET& met, const reco::Jet& b); - /// calculate top quark transverse mass estimate - double tmassTopQuark(const T& mu, const reco::CaloMET& met, const reco::Jet& b); - /// calculate mlb estimate - double masslb(const T& mu, const reco::CaloMET& met, const reco::Jet& b);*/ - - /// calculate W boson transverse mass estimate - double tmassWBoson(reco::RecoCandidate* mu, const reco::MET& met, const reco::Jet& b); - /// calculate top quark transverse mass estimate - double tmassTopQuark(reco::RecoCandidate* mu, const reco::MET& met, const reco::Jet& b); - /// calculate mlb estimate - double masslb(reco::RecoCandidate* mu, const reco::MET& met, const reco::Jet& b); - - private: - /// do the calculation; this is called only once per event by the first - /// function call to return a mass estimate. The once calculated values - /// are cached afterwards - void operator()(const std::vector& jets); - void operator()(const reco::Jet& bJet, reco::RecoCandidate* lepton, const reco::MET& met); - private: - /// indicate failed associations - bool failed_; - /// max. number of jets to be considered - int maxNJets_; - /// paramater of the w boson mass - double wMass_; - /// cache of w boson mass estimate - double massWBoson_; - /// cache of top quark mass estimate - double massTopQuark_; - /// cache of W boson transverse mass estimate - double tmassWBoson_; - /// cache of top quark transverse mass estimate - double tmassTopQuark_; - /// cache of mlb estimate - double mlb_; - - -}; - - -#include "DataFormats/JetReco/interface/JetID.h" -#include "DataFormats/JetReco/interface/PFJet.h" -#include "DataFormats/JetReco/interface/CaloJet.h" -#include "DataFormats/BTauReco/interface/JetTag.h" -#include "DataFormats/Common/interface/ValueMap.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "JetMETCorrections/Objects/interface/JetCorrector.h" -#include "DataFormats/EgammaCandidates/interface/GsfElectron.h" -#include "CommonTools/Utils/interface/StringCutObjectSelector.h" -#include "JetMETCorrections/Objects/interface/JetCorrectionsRecord.h" -#include "DataFormats/RecoCandidate/interface/RecoCandidate.h" - -/** - \class SelectionStep TopHLTDQMHelpers.h "HLTriggerOffline/Top/interface/TopHLTDQMHelpers.h" - - \brief Templated helper class to allow a selection on a certain object collection. - - Templated helper class to allow a selection on a certain object collection, which may - be monitored by a separate class afterwards. The class wraps and slightly extends the - features of the StringCutParser to allow also to apply event based selections, according - to a minimal or maximal number of elements in the collection after the object selection - has been applied. It takes an edm::ParameterSet in the constructor, which should contain - the following elements: - - - src : the input collection (mandatory). - - select : the selection string (mandatory). - - min : whether there is a min value on which to reject the whole event after - the selection (optional). - - max : whether there is a max value on which to reject the whole event after - the selection (optional). - - electronId : input tag of an electronId association map and selection pattern - (optional). - - jetCorrector : label of jet corrector (optional). - - jetBTagger : parameters defining the btag algorithm and working point of choice - (optional). - - jetID : parameters defining the jetID value map and selection (optional). - - - The parameters _src_ and _select_ are mandatory. The parameters _min_ and _max_ are - optional. The parameters _electronId_ and _jetCorrector_ are optional. They are added - to keep the possibility to apply selections on id'ed electrons or on corrected jets. - They may be omitted in the PSet for simplification reasons if not needed at any time. - They are not effiective for other object collections but electrons or jets. If none - of the two parameters _min_ or _max_ is found in the event the select function returns - true if at least one object fullfilled the requirements. - - The class has one template value, which is the object collection to apply the selection - on. This has to be parsed to the StringCutParser class. The function select is overrided - for jets to circumvent problems with the template specialisation. Note that for MET not - type1 or muon corrections are supported on reco candidates. -*/ - -template -class SelectionStepHLT { -public: - /// default constructor - SelectionStepHLT(const edm::ParameterSet& cfg, edm::ConsumesCollector && iC); - /// default destructor - ~SelectionStepHLT(){}; - - /// apply selection - bool select(const edm::Event& event); - /// apply selection override for jets - bool select(const edm::Event& event, const edm::EventSetup& setup); - bool selectVertex(const edm::Event& event); -private: - /// input collection - edm::InputTag src_; - edm::EDGetTokenT< edm::View > srcToken_; - /// min/max for object multiplicity - int min_, max_; - /// electronId label as extra selection type - edm::InputTag electronId_; - edm::EDGetTokenT< edm::ValueMap > electronIdToken_; - /// electronId pattern we expect the following pattern: - /// 0: fails - /// 1: passes electron ID only - /// 2: passes electron Isolation only - /// 3: passes electron ID and Isolation only - /// 4: passes conversion rejection - /// 5: passes conversion rejection and ID - /// 6: passes conversion rejection and Isolation - /// 7: passes the whole selection - /// As described on https://twiki.cern.ch/twiki/bin/view/CMS/SimpleCutBasedEleID - int eidPattern_; - /// jet corrector as extra selection type - std::string jetCorrector_; - /// choice for b-tag as extra selection type - edm::InputTag btagLabel_; - edm::EDGetTokenT btagToken_; - /// choice of b-tag working point as extra selection type - double btagWorkingPoint_; - /// jetID as an extra selection type - edm::InputTag jetIDLabel_; - edm::EDGetTokenT jetIDToken_; - - edm::InputTag pvs_; - edm::EDGetTokenT > pvsToken_; - - /// string cut selector - StringCutObjectSelector select_; - /// selection string on the jetID - StringCutObjectSelector* jetIDSelect_; -}; - -/// default constructor -template -SelectionStepHLT::SelectionStepHLT(const edm::ParameterSet& cfg, edm::ConsumesCollector && iC) : - src_( cfg.getParameter( "src" )), - select_( cfg.getParameter("select")), - jetIDSelect_(0) -{ - srcToken_ = iC.consumes< edm::View >(cfg.getParameter("src")); - pvsToken_ = iC.consumes< edm::View >(cfg.getParameter("pvs")); - // construct min/max if the corresponding params - // exist otherwise they are initialized with -1 - cfg.exists("min") ? min_= cfg.getParameter("min") : min_= -1; - cfg.exists("max") ? max_= cfg.getParameter("max") : max_= -1; - // read electron extras if they exist - if(cfg.existsAs("electronId")){ - edm::ParameterSet elecId=cfg.getParameter("electronId"); - electronId_= elecId.getParameter("src"); - electronIdToken_= iC.consumes< edm::ValueMap >(elecId.getParameter("src")); - eidPattern_= elecId.getParameter("pattern"); - } - // read jet corrector label if it exists - if(cfg.exists("jetCorrector")){ jetCorrector_= cfg.getParameter("jetCorrector"); } - // read btag information if it exists - if(cfg.existsAs("jetBTagger")){ - edm::ParameterSet jetBTagger=cfg.getParameter("jetBTagger"); - btagLabel_=jetBTagger.getParameter("label"); - btagToken_= iC.consumes(jetBTagger.getParameter("label")); - btagWorkingPoint_=jetBTagger.getParameter("workingPoint"); - } - // read jetID information if it exists - if(cfg.existsAs("jetID")){ - edm::ParameterSet jetID=cfg.getParameter("jetID"); - jetIDLabel_ =jetID.getParameter("label"); - jetIDToken_= iC.consumes(jetID.getParameter("label")); - jetIDSelect_= new StringCutObjectSelector(jetID.getParameter("select")); - } -} - -/// apply selection -template -bool SelectionStepHLT::select(const edm::Event& event) -{ - // fetch input collection - edm::Handle > src; - if( !event.getByToken(srcToken_, src) ) return false; - - // load electronId value map if configured such - edm::Handle > electronId; - if(!electronId_.label().empty()) { - if( !event.getByToken(electronIdToken_, electronId) ) return false; - } - - // determine multiplicity of selected objects - int n=0; - for(typename edm::View::const_iterator obj=src->begin(); obj!=src->end(); ++obj){ - // special treatment for electrons - if(dynamic_cast(&*obj)){ - unsigned int idx = obj-src->begin(); - if( electronId_.label().empty() ? true : ((int)(*electronId)[src->refAt(idx)] & eidPattern_) ){ - if(select_(*obj))++n; - } - } - // normal treatment - else{ - if(select_(*obj))++n; - } - } - bool accept=(min_>=0 ? n>=min_:true) && (max_>=0 ? n<=max_:true); - return (min_<0 && max_<0) ? (n>0):accept; -} -template -bool SelectionStepHLT::selectVertex(const edm::Event& event) -{ - // fetch input collection - edm::Handle > src; - if( !event.getByToken(srcToken_, src) ) return false; - - // load electronId value map if configured such - edm::Handle > electronId; - if(!electronId_.label().empty()) { - if( !event.getByToken(electronIdToken_, electronId) ) return false; - } - - // determine multiplicity of selected objects - int n=0; - for(typename edm::View::const_iterator obj=src->begin(); obj!=src->end(); ++obj){ - - if(select_(*obj))++n; - } - bool accept=(min_>=0 ? n>=min_:true) && (max_>=0 ? n<=max_:true); - return (min_<0 && max_<0) ? (n>0):accept; -} - -/// apply selection (w/o using the template class Object), override for jets -template -bool SelectionStepHLT::select(const edm::Event& event, const edm::EventSetup& setup) -{ - // fetch input collection - edm::Handle > src; - if( !event.getByToken(srcToken_, src) ) return false; - - // load btag collection if configured such - // NOTE that the JetTagCollection needs an - // edm::View to reco::Jets; we have to add - // another Handle bjets for this purpose - edm::Handle > bjets; - edm::Handle btagger; - edm::Handle > pvertex; - if(!btagLabel_.label().empty()){ - if( !event.getByToken(srcToken_, bjets) ) return false; - if( !event.getByToken(btagToken_, btagger) ) return false; - if( !event.getByToken(pvsToken_, pvertex) ) return false; - } - - // load jetID value map if configured such - edm::Handle jetID; - if(jetIDSelect_){ - if( !event.getByToken(jetIDToken_, jetID) ) return false; - - } - - // load jet corrector if configured such - const JetCorrector* corrector=0; - if(!jetCorrector_.empty()){ - // check whether a jet correcto is in the event setup or not - if(setup.find( edm::eventsetup::EventSetupRecordKey::makeKey() )){ - corrector = JetCorrector::getJetCorrector(jetCorrector_, setup); - } - else{ - edm::LogVerbatim( "TopDQMHelpers" ) - << "\n" - << "------------------------------------------------------------------------------------- \n" - << " No JetCorrectionsRecord available from EventSetup: \n" - << " - Jets will not be corrected. \n" - << " - If you want to change this add the following lines to your cfg file \n" - << " \n" - << " ## load jet corrections \n" - << " process.load(\"JetMETCorrections.Configuration.JetCorrectionServicesAllAlgos_cff\") \n" - << " process.prefer(\"ak5CaloL2L3\") \n" - << " \n" - << "------------------------------------------------------------------------------------- \n"; - } - } - // determine multiplicity of selected objects - int n=0; - for(typename edm::View::const_iterator obj=src->begin(); obj!=src->end(); ++obj){ - // check for chosen btag discriminator to be above the - // corresponding working point if configured such - unsigned int idx = obj-src->begin(); - if( btagLabel_.label().empty() ? true : (*btagger)[bjets->refAt(idx)]>btagWorkingPoint_ ){ - bool passedJetID=true; - // check jetID for calo jets - if( jetIDSelect_ && dynamic_cast(src->refAt(idx).get())){ - passedJetID=(*jetIDSelect_)((*jetID)[src->refAt(idx)]); - } - if(passedJetID){ - // scale jet energy if configured such - Object jet=*obj; jet.scaleEnergy(corrector ? corrector->correction(*obj) : 1.); - if(select_(jet))++n; - } - } - } - bool accept=(min_>=0 ? n>=min_:true) && (max_>=0 ? n<=max_:true); - return (min_<0 && max_<0) ? (n>0):accept; -} - -#endif diff --git a/HLTriggerOffline/Top/interface/TopSingleLeptonHLTValidation.h b/HLTriggerOffline/Top/interface/TopSingleLeptonHLTValidation.h new file mode 100644 index 0000000000000..cc4b84a765a36 --- /dev/null +++ b/HLTriggerOffline/Top/interface/TopSingleLeptonHLTValidation.h @@ -0,0 +1,168 @@ +// -*- C++ -*- +// +// Package: HLTriggerOffline/Top +// Class: TopSingleLeptonHLTValidation +// +/**\class TopSingleLeptonHLTValidation TopSingleLeptonHLTValidation.h HLTriggerOffline/Top/interface/TopSingleLeptonHLTValidation.h + + Description: compute efficiencies of trigger paths on offline reco selection with respect to pt and eta + + Implementation: + harvesting +*/ +// +// Original Author: Elvire Bouvier +// Created: Thu, 16 Jan 2014 16:27:35 GMT +// +// +#ifndef TOPSINGLELEPTONHLTVALIDATION +#define TOPSINGLELEPTONHLTVALIDATION + +// system include files +#include + +// user include files +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/EDAnalyzer.h" + +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/MakerMacros.h" + +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ServiceRegistry/interface/Service.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" + +#include "DQMServices/Core/interface/DQMStore.h" +#include "DQMServices/Core/interface/MonitorElement.h" + +#include "DataFormats/EgammaCandidates/interface/GsfElectron.h" +#include "DataFormats/MuonReco/interface/Muon.h" +#include "DataFormats/JetReco/interface/Jet.h" +#include "HLTrigger/HLTcore/interface/HLTConfigProvider.h" +#include "DataFormats/Common/interface/TriggerResults.h" +#include "TH1.h" + +// +// class declaration +// + +class TopSingleLeptonHLTValidation : public edm::EDAnalyzer { + public: + explicit TopSingleLeptonHLTValidation(const edm::ParameterSet&); + ~TopSingleLeptonHLTValidation(); + + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + + + private: + virtual void beginJob() override; + virtual void analyze(const edm::Event&, const edm::EventSetup&) override; + virtual void endJob() override; + + //virtual void beginRun(edm::Run const&, edm::EventSetup const&) override; + virtual void endRun(edm::Run const&, edm::EventSetup const&) override; + //virtual void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override; + //virtual void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override; + + // ----------member data --------------------------- + // DQM + DQMStore* dbe_; + std::string sDir_; + MonitorElement* hEffLeptonPt; + MonitorElement* hEffLeptonEta; + MonitorElement* hEffJetPt; + MonitorElement* hEffJetEta; + // Electrons + const reco::GsfElectron *elec_; + std::string sElectrons_; + edm::EDGetTokenT< edm::View > tokElectrons_; + double ptElectrons_; + double etaElectrons_; + double isoElectrons_; + unsigned int minElectrons_; + // Muons + const reco::Muon *mu_; + std::string sMuons_; + edm::EDGetTokenT< edm::View > tokMuons_; + double ptMuons_; + double etaMuons_; + double isoMuons_; + unsigned int minMuons_; + // Jets + const reco::Jet *jet_; + std::string sJets_; + edm::EDGetTokenT< edm::View > tokJets_; + double ptJets_; + double etaJets_; + unsigned int minJets_; + // Trigger + std::string sTrigger_; + edm::EDGetTokenT tokTrigger_; + std::vector vsPaths_; + // Histos + bool isAll_ = false; + TH1F *hDenLeptonPt = new TH1F("PtLeptonAll", "PtLeptonAll", 50, 0., 250.); + TH1F *hDenLeptonEta = new TH1F("EtaLeptonAll", "EtaLeptonAll", 30, -3. , 3.); + TH1F *hDenJetPt = new TH1F("PtLastJetAll", "PtLastJetAll", 60, 0., 300.); + TH1F *hDenJetEta = new TH1F("EtaLastJetAll", "EtaLastJetAll", 30, -3., 3.); + bool isSel_ = false; + TH1F *hNumLeptonPt = new TH1F("PtLeptonSel", "PtLeptonSel", 50, 0., 250.); + TH1F *hNumLeptonEta = new TH1F("EtaLeptonSel", "EtaLeptonSel", 30, -3. , 3.); + TH1F *hNumJetPt = new TH1F("PtLastJetSel", "PtLastJetSel", 60, 0., 300.); + TH1F *hNumJetEta = new TH1F("EtaLastJetSel", "EtaLastJetSel", 30, -3., 3.); +}; + +// +// constants, enums and typedefs +// + +// +// static data member definitions +// + +// +// constructors and destructor +// +TopSingleLeptonHLTValidation::TopSingleLeptonHLTValidation(const edm::ParameterSet& iConfig) : + sDir_(iConfig.getUntrackedParameter("sDir","HLTValidation/Top/Efficiencies/")), + sElectrons_(iConfig.getUntrackedParameter("sElectrons","gsfElectrons")), + ptElectrons_(iConfig.getUntrackedParameter("ptElectrons",0.)), + etaElectrons_(iConfig.getUntrackedParameter("etaElectrons",0.)), + isoElectrons_(iConfig.getUntrackedParameter("isoElectrons",0.)), + minElectrons_(iConfig.getUntrackedParameter("minElectrons",0)), + sMuons_(iConfig.getUntrackedParameter("sMuons","muons")), + ptMuons_(iConfig.getUntrackedParameter("ptMuons",0.)), + etaMuons_(iConfig.getUntrackedParameter("etaMuons",0.)), + isoMuons_(iConfig.getUntrackedParameter("isoMuons",0.)), + minMuons_(iConfig.getUntrackedParameter("minMuons",0)), + sJets_(iConfig.getUntrackedParameter("sJets","ak5PFJets")), + ptJets_(iConfig.getUntrackedParameter("ptJets",0.)), + etaJets_(iConfig.getUntrackedParameter("etaJets",0.)), + minJets_(iConfig.getUntrackedParameter("minJets",0)), + sTrigger_(iConfig.getUntrackedParameter("sTrigger","TriggerResults")), + vsPaths_(iConfig.getUntrackedParameter< std::vector >("vsPaths")) + +{ + dbe_ = edm::Service().operator->(); + // Electrons + tokElectrons_ = consumes< edm::View >(edm::InputTag(sElectrons_)); + // Muons + tokMuons_ = consumes< edm::View >(edm::InputTag(sMuons_)); + // Jets + tokJets_ = consumes< edm::View >(edm::InputTag(sJets_)); + // Trigger + tokTrigger_ = consumes(edm::InputTag(sTrigger_)); +} + + +TopSingleLeptonHLTValidation::~TopSingleLeptonHLTValidation() +{ + + // do anything here that needs to be done at desctruction time + // (e.g. close files, deallocate resources etc.) + +} +#endif + +//define this as a plug-in +DEFINE_FWK_MODULE(TopSingleLeptonHLTValidation); diff --git a/HLTriggerOffline/Top/interface/TopValidation.h b/HLTriggerOffline/Top/interface/TopValidation.h deleted file mode 100644 index d5cd826a071db..0000000000000 --- a/HLTriggerOffline/Top/interface/TopValidation.h +++ /dev/null @@ -1,238 +0,0 @@ - -#ifndef HLTriggerOffline_TopValidation_H -#define HLTriggerOffline_TopValidation_H - - -// system include files -#include -#include - -// user include files -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/MakerMacros.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -#include "DataFormats/Common/interface/Ref.h" -#include "DataFormats/Common/interface/DetSetVector.h" -#include "DataFormats/Candidate/interface/Candidate.h" -#include "DataFormats/JetReco/interface/Jet.h" -#include "DataFormats/JetReco/interface/CaloJetCollection.h" -#include "DataFormats/TrackReco/interface/Track.h" -#include "DataFormats/TrackReco/interface/TrackExtra.h" -//#include "DataFormats/CaloTowers/interface/CaloTowerCollection.h" - -#include "DataFormats/MuonReco/interface/MuonFwd.h" -#include "DataFormats/MuonReco/interface/Muon.h" -/*#include "DataFormats/METReco/interface/MET.h" -#include "DataFormats/METReco/interface/CaloMETCollection.h" -#include "DataFormats/METReco/interface/GenMET.h" -#include "DataFormats/METReco/interface/GenMETCollection.h" */ - -//#include "SimDataFormats/HepMCProduct/interface/HepMCProduct.h" - -#include -#include "DataFormats/Candidate/interface/Candidate.h" -#include "DataFormats/RecoCandidate/interface/RecoCandidate.h" - - - -//#include "DataFormats/VertexReco/interface/Vertex.h" -//#include "RecoVertex/PrimaryVertexProducer/interface/PrimaryVertexSorter.h" -#include "DataFormats/Common/interface/Handle.h" -#include "DataFormats/Common/interface/TriggerResults.h" -#include "DataFormats/Common/interface/RefToBase.h" -#include "HLTrigger/HLTfilters/interface/HLTHighLevel.h" -#include "DataFormats/EgammaCandidates/interface/GsfElectron.h" -#include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h" - -#include "DataFormats/EgammaCandidates/interface/Electron.h" -#include "DataFormats/EgammaCandidates/interface/ElectronFwd.h" -#include "DataFormats/EgammaReco/interface/SuperCluster.h" -#include "DataFormats/EgammaReco/interface/BasicCluster.h" -#include "DataFormats/EgammaReco/interface/BasicClusterFwd.h" - -#include "FWCore/ServiceRegistry/interface/Service.h" -//#include "PhysicsTools/UtilAlgos/interface/TFileService.h" - - -//Include DQM core -#include "DQMServices/Core/interface/DQMStore.h" -#include "DQMServices/Core/interface/MonitorElement.h" - - -#include "TH1F.h" -#include "TVector3.h" -#include "TLorentzVector.h" -#include -#include -#include -#include -#include -#include "TFile.h" - - - -class TH1F; - -// -// class decleration -// - -class TopValidation : public edm::EDAnalyzer { -public: - explicit TopValidation(const edm::ParameterSet&); - ~TopValidation(); - - -private: - virtual void beginJob() ; - virtual void analyze(const edm::Event&, const edm::EventSetup&); - virtual void endJob() ; - - // edm::Service fs; - - - // ----------member data --------------------------- - - std::string fOutputFileName ; - - std::string outFile_, outputFileName; - - bool outputMEsInRootFile; - - edm::InputTag offlineElectrons; - - edm::ParameterSet parameters; - - DQMStore* dbe; - - ///// eta and pt histos //// - - // semimu events - - MonitorElement* eta_off_mu; - MonitorElement* pt_off_mu; - - - // dimu events - - MonitorElement* eta_off_dimu1; - MonitorElement* pt_off_dimu1; - MonitorElement* eta_off_dimu2; - MonitorElement* pt_off_dimu2; - -// semiel events - - MonitorElement* eta_off_el; - MonitorElement* pt_off_el; - - - //diel events - - MonitorElement* eta_off_diel1; - MonitorElement* pt_off_diel1; - MonitorElement* eta_off_diel2; - MonitorElement* pt_off_diel2; - - // emu events - - MonitorElement* eta_off_emu_muon; - MonitorElement* pt_off_emu_muon; - MonitorElement* eta_off_emu_electron; - MonitorElement* pt_off_emu_electron; - - - //// 4jets + 1muon eff monitoring - MonitorElement* ptmuon_4jet1muSel; - MonitorElement* etamuon_4jet1muSel; - MonitorElement* Njets_4jet1muSel; - MonitorElement* ptmuon_4jet1muSel_hltmu9; - MonitorElement* etamuon_4jet1muSel_hltmu9; - MonitorElement* Njets_4jet1muSel_hltmu9; - -////////////////// - - MonitorElement* h_ptmu1_trig[100]; - MonitorElement* h_etamu1_trig[100]; - MonitorElement* h_ptel1_trig[100]; - MonitorElement* h_etael1_trig[100]; - - MonitorElement* h_ptmu1_trig_dimu[100]; - MonitorElement* h_etamu1_trig_dimu[100]; - MonitorElement* h_ptel1_trig_diel[100]; - MonitorElement* h_etael1_trig_diel[100]; - - MonitorElement* h_ptmu1_trig_em[100]; - MonitorElement* h_etamu1_trig_em[100]; - MonitorElement* h_ptel1_trig_em[100]; - MonitorElement* h_etael1_trig_em[100]; - - /***********/ - - MonitorElement* hlt_bitmu_hist_reco ; - MonitorElement* h_mu_reco; - MonitorElement* hlt_bitmu_hist_gen ; - MonitorElement* h_mu_gen; - - MonitorElement* h_jet_reco; - MonitorElement* hlt_bitjet_hist_reco; - - MonitorElement* h_jet_reco_el; - MonitorElement* hlt_bitjet_hist_reco_el; - - MonitorElement* h_jet_gen; - MonitorElement* hlt_bitjet_hist_gen; - - MonitorElement* h_jet_gen_el; - MonitorElement* hlt_bitjet_hist_gen_el; - - MonitorElement* hlt_bitel_hist_reco; - MonitorElement* h_el_reco; - MonitorElement* hlt_bitel_hist_gen; - MonitorElement* h_el_gen; - - MonitorElement* et_off_jet_mu; - MonitorElement* eta_off_jet_mu; - MonitorElement* njets_off_mu; - MonitorElement* et_off_jet_el; - MonitorElement* eta_off_jet_el; - MonitorElement* njets_off_el; - MonitorElement* h_etjet1_trig_mu[100]; - MonitorElement* h_etajet1_trig_mu[100]; - MonitorElement* h_etjet1_trig_el[100]; - MonitorElement* h_etajet1_trig_el[100]; - - MonitorElement* events_acc_off_electron; - MonitorElement* events_acc_off_muon; - - - - - edm::InputTag inputTag_; - std::vector hlt_bitnames; - std::vector hlt_bitnamesMu; - std::vector hlt_bitnamesEg; - std::vector hlt_bitnamesJet; - - - //Just a tag for better file organization - std::string triggerTag_; - - - // Top folder in root file - std::string FolderName_; - std::stringstream topFolder; - - edm::EDGetTokenT muonsToken_; - edm::EDGetTokenT ctfWithMaterialTracksToken_; - edm::EDGetTokenT iterativeCone5CaloJetsToken_; - edm::EDGetTokenT offlineElectronsToken_; - edm::EDGetTokenT inputTagToken_; - edm::EDGetTokenT genParticlesToken_; - -}; - - -#endif diff --git a/HLTriggerOffline/Top/python/HLTTopPostVal_cff.py b/HLTriggerOffline/Top/python/HLTTopPostVal_cff.py deleted file mode 100644 index f3e695cbbf71b..0000000000000 --- a/HLTriggerOffline/Top/python/HLTTopPostVal_cff.py +++ /dev/null @@ -1,127 +0,0 @@ -import FWCore.ParameterSet.Config as cms -from HLTriggerOffline.Top.PostProcessor_cfi import * - -hltTopPostSemimu = HLTTopPostProcessor.clone() - -hltTopPostSemimu.subDirs = ['HLT/Top/Semileptonic_muon'] -hltTopPostSemimu.efficiency = ( - # "TrigEFF 'my title; my x-label; my y-label' pt_trig_off_mu pt_off_mu", - "EffVsPt_HLT_Mu9 'HLT_Mu9 ; p_{T #mu}; Trigger_Efficiency' Muon1Pt_M_HLT_Mu9 Muon1Pt_M", - "EffVsEta_HLT_Mu9 'HLT_Mu9 ; #eta_{#mu}; Trigger_Efficiency' Muon1Eta_M_HLT_Mu9 Muon1Eta_M", - "EffVsPt_HLT_Mu15 'HLT_Mu15 ; p_{T #mu}; Trigger_Efficiency' Muon1Pt_M_HLT_Mu15 Muon1Pt_M", - "EffVsEta_HLT_Mu15 'HLT_Mu15 ; #eta_{#mu}; Trigger_Efficiency' Muon1Eta_M_HLT_Mu15 Muon1Eta_M", - "EffVsPt_HLT_IsoMu9 'HLT_IsoMu9 ; p_{T #mu}; Trigger_Efficiency' Muon1Pt_M_HLT_IsoMu9 Muon1Pt_M", - "EffVsEta_HLT_IsoMu9 'HLT_IsoMu9 ; #eta_{#mu}; Trigger_Efficiency' Muon1Eta_M_HLT_IsoMu9 Muon1Eta_M", - - "Efficiencies_MuonTriggers_gen 'HLT efficiency wrt mc acceptance ; ; Trigger Efficiency' genmuHLT genMuonEvents", - "Efficiencies_MuonTriggers 'HLT efficiency wrt acc+offline ; ; Trigger Efficiency' muHLT MuonEvents", - - ) - -hltTopPostSemiel = HLTTopPostProcessor.clone() - -hltTopPostSemiel.subDirs = ['HLT/Top/Semileptonic_electron'] -hltTopPostSemiel.efficiency = ( - # "TrigEFF 'my title; my x-label; my y-label' pt_trig_off_mu pt_off_mu", - "EffVsPt_HLT_Ele15_SW_L1R 'HLT_Ele15_SW_L1R ; p_{T e}; Trigger_Efficiency' Electron1Pt_E_HLT_Ele15_SW_L1R Electron1Pt_E", - "EffVsEta_HLT_Ele15_SW_L1R 'HLT_Ele15_SW_L1R ; #eta_{e}; Trigger_Efficiency' Electron1Eta_E_HLT_Ele15_SW_L1R Electron1Eta_E", - "EffVsPt_HLT_Ele15_SW_LooseTrackIso_L1R 'HLT_Ele15_SW_LooseTrackIso_L1R ; p_{T e}; Trigger_Efficiency' Electron1Pt_E_HLT_Ele15_SW_LooseTrackIso_L1R Electron1Pt_E", - "EffVsEta_HLT_Ele15_SW_LooseTrackIso_L1R 'HLT_Ele15_SW_LooseTrackIso_L1R ; #eta_{e}; Trigger_Efficiency' Electron1Eta_E_HLT_Ele15_SW_LooseTrackIso_L1R Electron1Eta_E", - - "Efficiencies_Electrontriggers 'HLT efficiency wrt acc+offline ; ; Trigger Efficiency' elHLT ElectronEvents", - "Efficiencies_Electrontriggers_gen 'HLT efficiency wrt mc acceptance ; ; Trigger Efficiency' genelHLT genElectronEvents" - #### - ) - - ################## - -hltTopPostDimu = HLTTopPostProcessor.clone() - -hltTopPostDimu.subDirs = ['HLT/Top/Dileptonic_muon'] -hltTopPostDimu.efficiency = ( - # "TrigEFF 'my title; my x-label; my y-label' pt_trig_off_mu pt_off_mu", - "EffVsPt_HLT_Mu9_MM 'HLT_Mu9 ; p_{T #mu 1}; Trigger_Efficiency' Muon1Pt_MM_HLT_Mu9 Muon1Pt_MM", - "EffVsEta_HLT_Mu9_MM 'HLT_Mu9 ; #eta_{#mu 1}; Trigger_Efficiency' Muon1Eta_MM_HLT_Mu9 Muon1Eta_MM", - "EffVsPt_HLT_Mu15_MM 'HLT_Mu15 ; p_{T #mu 1}; Trigger_Efficiency' Muon1Pt_MM_HLT_Mu15 Muon1Pt_MM", - "EffVsEta_HLT_Mu15_MM 'HLT_Mu15 ; #eta_{#mu 1}; Trigger_Efficiency' Muon1Eta_MM_HLT_Mu15 Muon1Eta_MM", - "EffVsPt_HLT_IsoMu9_MM 'HLT_IsoMu9 ; p_{T #mu 1}; Trigger_Efficiency' Muon1Pt_MM_HLT_IsoMu9 Muon1Pt_MM", - "EffVsEta_HLT_IsoMu9_MM 'HLT_IsoMu9 ; #eta_{#mu 1}; Trigger_Efficiency' Muon1Eta_MM_HLT_IsoMu9 Muon1Eta_MM", - "EffVsPt_HLT_DoubleMu3_MM 'HLT_DoubleMu3 ; p_{T #mu 1}; Trigger_Efficiency' Muon1Pt_MM_HLT_DoubleMu3 Muon1Pt_MM", - "EffVsEta_HLT_DoubleMu3_MM 'HLT_DoubleMu3 ; #eta_{#mu 1}; Trigger_Efficiency' Muon1Eta_MM_HLT_DoubleMu3 Muon1Eta_MM", - - ) - -hltTopPostDiel = HLTTopPostProcessor.clone() - -hltTopPostDiel.subDirs = ['HLT/Top/Dileptonic_electron'] -hltTopPostDiel.efficiency = ( - # "TrigEFF 'my title; my x-label; my y-label' pt_trig_off_mu pt_off_mu", - "EffVsPt_HLT_Ele15_SW_L1R_EE 'HLT_Ele15_SW_L1R ; p_{T e 1}; Trigger_Efficiency' Electron1Pt_EE_HLT_Ele15_SW_L1R Electron1Pt_EE", - "EffVsEta_HLT_Ele15_SW_L1R_EE 'HLT_Ele15_SW_L1R ; #eta_{e 1}; Trigger_Efficiency' Electron1Eta_EE_HLT_Ele15_SW_L1R Electron1Eta_EE", - "EffVsPt_HLT_Ele15_SW_LooseTrackIso_L1R_EE 'HLT_Ele15_SW_LooseTrackIso_L1R ; p_{T e 1}; Trigger_Efficiency' Electron1Pt_EE_HLT_Ele15_SW_LooseTrackIso_L1R Electron1Pt_EE", - "EffVsEta_HLT_Ele15_SW_LooseTrackIso_L1R_EE 'HLT_Ele15_SW_LooseTrackIso_L1R ; #eta_{e 1}; Trigger_Efficiency' Electron1Eta_EE_HLT_Ele15_SW_LooseTrackIso_L1R Electron1Eta_EE", - "EffVsPt_HLT_DoubleEle10_SW_L1R_EE 'HLT_DoubleEle10_SW_L1R ; p_{T e 1}; Trigger_Efficiency' Electron1Pt_EE_HLT_DoubleEle10_SW_L1R Electron1Pt_EE", - "EffVsEta_HLT_DoubleEle10_SW_L1R_EE 'HLT_DoubleEle10_SW_L1R ; #eta_{e 1}; Trigger_Efficiency' Electron1Eta_EE_HLT_DoubleEle10_SW_L1R Electron1Eta_EE", - - ) - -hltTopPostEmu = HLTTopPostProcessor.clone() - -hltTopPostEmu.subDirs = ['HLT/Top/Dileptonic_emu'] -hltTopPostEmu.efficiency = ( - # "TrigEFF 'my title; my x-label; my y-label' pt_trig_off_mu pt_off_mu", - "EffVsPt_HLT_Mu9_EM 'HLT_Mu9 ; p_{T #mu }; Trigger_Efficiency' Muon1Pt_EM_HLT_Mu9 Muon1Pt_EM", - "EffVsEta_HLT_Mu9_EM 'HLT_Mu9 ; #eta_{#mu }; Trigger_Efficiency' Muon1Eta_EM_HLT_Mu9 Muon1Eta_EM", - "EffVsPt_HLT_Mu15_EM 'HLT_Mu15 ; p_{T #mu }; Trigger_Efficiency' Muon1Pt_EM_HLT_Mu15 Muon1Pt_EM", - "EffVsEta_HLT_Mu15_EM 'HLT_Mu15 ; #eta_{#mu }; Trigger_Efficiency' Muon1Eta_EM_HLT_Mu15 Muon1Eta_EM", - "EffVsPt_HLT_IsoMu9_EM 'HLT_IsoMu9 ; p_{T #mu }; Trigger_Efficiency' Muon1Pt_EM_HLT_IsoMu9 Muon1Pt_EM", - "EffVsEta_HLT_IsoMu9_EM 'HLT_IsoMu9 ; #eta_{#mu }; Trigger_Efficiency' Muon1Eta_EM_HLT_IsoMu9 Muon1Eta_EM", - "EffVsPt_HLT_Ele15_SW_L1R_EM 'HLT_Ele15_SW_L1R ; p_{T e }; Trigger_Efficiency' Electron1Pt_EM_HLT_Ele15_SW_L1R Electron1Pt_EM", - "EffVsEta_HLT_Ele15_SW_L1R_EM 'HLT_Ele15_SW_L1R ; #eta_{e }; Trigger_Efficiency' Electron1Eta_EM_HLT_Ele15_SW_L1R Electron1Eta_EM", - "EffVsPt_HLT_Ele15_SW_LooseTrackIso_L1R_EM 'HLT_Ele15_SW_LooseTrackIso_L1R ; p_{T e }; Trigger_Efficiency' Electron1Pt_EM_HLT_Ele15_SW_LooseTrackIso_L1R Electron1Pt_EM", - "EffVsEta_HLT_Ele15_SW_LooseTrackIso_L1R_EM 'HLT_Ele15_SW_LooseTrackIso_L1R ; #eta_{e }; Trigger_Efficiency' Electron1Eta_EM_HLT_Ele15_SW_LooseTrackIso_L1R Electron1Eta_EM", - - ) - -hltTopPostJet = HLTTopPostProcessor.clone() - -hltTopPostJet.subDirs = ['HLT/Top/Jets'] -hltTopPostJet.efficiency = ( - # "TrigEFF 'my title; my x-label; my y-label' pt_trig_off_mu pt_off_mu", - # "EffVsEt_HLT_QuadJet30 'HLT_QuadJet30 ; E_{T jet}; Trigger_Efficiency' Jet1Et_M_HLT_QuadJet30 Jet1Et_M", - "Efficiencies_jetTriggers_semimu 'HLT efficiency wrt acc+offline ; ; Trigger Efficiency' numer denom", - # "EffVsEta_HLT_QuadJet30 'HLT_QuadJet30 ; #eta_{ jet}; Trigger_Efficiency' Jet1Eta_M_HLT_QuadJet30 Jet1Eta_M", - - - "Efficiencies_jetTriggers_semiel 'HLT efficiency wrt acc+offline ; ; Trigger Efficiency' numer_el denom_el", - # "EffVsEt_HLT_QuadJet30_el 'HLT_QuadJet30 ; E_{T jet}; Trigger_Efficiency' Jet1Et_E_HLT_QuadJet30 Jet1Et_E", - # "EffVsEta_HLT_QuadJet30_el 'HLT_QuadJet30 ; #eta_{ jet}; Trigger_Efficiency' Jet1Eta_E_HLT_QuadJet30 Jet1Eta_M", - - ) - - -hltTopPost4Jets = HLTTopPostProcessor.clone() - -hltTopPost4Jets.subDirs = ['HLT/Top/4JetsPlus1MuonToCompareWithData'] -hltTopPost4Jets.efficiency = ( - # "TrigEFF 'my title; my x-label; my y-label' pt_trig_off_mu pt_off_mu", - "EffVsPt_HLTMu9_4Jets1MuonMon 'HLT_Mu9 ; p_{T #mu }; Trigger_Efficiency' Muon1Pt_4Jets1MuonHLTMu9Mon Muon1Pt_4Jets1MuonMon", - "EffVsEta_HLTMu9_4Jets1MuonMon 'HLT_Mu9 ; #eta_{#mu }; Trigger_Efficiency' Muon1Eta_4Jets1MuonHLTMu9Mon Muon1Eta_4Jets1MuonMon", - "EffVsNJets_HLTMu9_4Jets1MuonMon 'HLT_Mu9 ; Jet multiplicity; Trigger_Efficiency' NJets_4Jets1MuonHLTMu9Mon NJets_4Jets1MuonMon", - - ) - - - - - -HLTTopPostVal = cms.Sequence( - hltTopPostSemimu * - hltTopPostSemiel * - hltTopPostDimu * - hltTopPostDiel * - hltTopPostEmu * - hltTopPostJet * - hltTopPost4Jets - -) diff --git a/HLTriggerOffline/Top/python/HLTTopQualityTester_cfi.py b/HLTriggerOffline/Top/python/HLTTopQualityTester_cfi.py deleted file mode 100644 index d6b25fc44532c..0000000000000 --- a/HLTriggerOffline/Top/python/HLTTopQualityTester_cfi.py +++ /dev/null @@ -1,14 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -hltTopQualityTester = cms.EDAnalyzer("QualityTester", - qtList = cms.untracked.FileInPath( - 'HLTriggerOffline/Top/data/HLTTopQualityTest.xml' - ), - #reportThreshold = cms.untracked.string('black'), - prescaleFactor = cms.untracked.int32(1), - getQualityTestsFromFile = cms.untracked.bool(True), - qtestOnEndJob = cms.untracked.bool(True), - qtestOnEndLumi = cms.untracked.bool(False), - testInEventloop = cms.untracked.bool(False), - verboseQT = cms.untracked.bool(False) -) diff --git a/HLTriggerOffline/Top/python/PostProcessor_cfi.py b/HLTriggerOffline/Top/python/PostProcessor_cfi.py deleted file mode 100644 index 97bd60dc26ec0..0000000000000 --- a/HLTriggerOffline/Top/python/PostProcessor_cfi.py +++ /dev/null @@ -1,62 +0,0 @@ -import FWCore.ParameterSet.Config as cms - - -HLTTopPostProcessor = cms.EDAnalyzer("DQMGenericClient", - subDirs = cms.untracked.vstring('HLT/Top/'), - verbose = cms.untracked.uint32(0), # Set to 2 for all messages - outputFileName = cms.untracked.string(''), - commands = cms.vstring(''), - resolution = cms.vstring(''), - efficiency = cms.vstring( - # "TrigEFF 'my title; my x-label; my y-label' pt_trig_off_mu pt_off_mu", - "EffVsPt_HLT_Mu9 'HLT_Mu9 ; p_{T #mu}; Trigger_Efficiency' Muon1Pt_M_HLT_Mu9 Muon1Pt_M", - "EffVsEta_HLT_Mu9 'HLT_Mu9 ; #eta_{#mu}; Trigger_Efficiency' Muon1Eta_M_HLT_Mu9 Muon1Eta_M", - "EffVsPt_HLT_Mu15 'HLT_Mu15 ; p_{T #mu}; Trigger_Efficiency' Muon1Pt_M_HLT_Mu15 Muon1Pt_M", - "EffVsEta_HLT_Mu15 'HLT_Mu15 ; #eta_{#mu}; Trigger_Efficiency' Muon1Eta_M_HLT_Mu15 Muon1Eta_M", - "EffVsPt_HLT_IsoMu9 'HLT_IsoMu9 ; p_{T #mu}; Trigger_Efficiency' Muon1Pt_M_HLT_IsoMu9 Muon1Pt_M", - "EffVsEta_HLT_IsoMu9 'HLT_IsoMu9 ; #eta_{#mu}; Trigger_Efficiency' Muon1Eta_M_HLT_IsoMu9 Muon1Eta_M", - "EffVsPt_HLT_Ele15_SW_L1R 'HLT_Ele15_SW_L1R ; p_{T e}; Trigger_Efficiency' Electron1Pt_E_HLT_Ele15_SW_L1R Electron1Pt_E", - "EffVsEta_HLT_Ele15_SW_L1R 'HLT_Ele15_SW_L1R ; #eta_{e}; Trigger_Efficiency' Electron1Eta_E_HLT_Ele15_SW_L1R Electron1Eta_E", - "EffVsPt_HLT_Ele15_SW_LooseTrackIso_L1R 'HLT_Ele15_SW_LooseTrackIso_L1R ; p_{T e}; Trigger_Efficiency' Electron1Pt_E_HLT_Ele15_SW_LooseTrackIso_L1R Electron1Pt_E", - "EffVsEta_HLT_Ele15_SW_LooseTrackIso_L1R 'HLT_Ele15_SW_LooseTrackIso_L1R ; #eta_{e}; Trigger_Efficiency' Electron1Eta_E_HLT_Ele15_SW_LooseTrackIso_L1R Electron1Eta_E", - "EffVsPt_HLT_Mu9_MM 'HLT_Mu9 ; p_{T #mu 1}; Trigger_Efficiency' Muon1Pt_MM_HLT_Mu9 Muon1Pt_MM", - "EffVsEta_HLT_Mu9_MM 'HLT_Mu9 ; #eta_{#mu 1}; Trigger_Efficiency' Muon1Eta_MM_HLT_Mu9 Muon1Eta_MM", - "EffVsPt_HLT_Mu15_MM 'HLT_Mu15 ; p_{T #mu 1}; Trigger_Efficiency' Muon1Pt_MM_HLT_Mu15 Muon1Pt_MM", - "EffVsEta_HLT_Mu15_MM 'HLT_Mu15 ; #eta_{#mu 1}; Trigger_Efficiency' Muon1Eta_MM_HLT_Mu15 Muon1Eta_MM", - "EffVsPt_HLT_IsoMu9_MM 'HLT_IsoMu9 ; p_{T #mu 1}; Trigger_Efficiency' Muon1Pt_MM_HLT_IsoMu9 Muon1Pt_MM", - "EffVsEta_HLT_IsoMu9_MM 'HLT_IsoMu9 ; #eta_{#mu 1}; Trigger_Efficiency' Muon1Eta_MM_HLT_IsoMu9 Muon1Eta_MM", - "EffVsPt_HLT_DoubleMu3_MM 'HLT_DoubleMu3 ; p_{T #mu 1}; Trigger_Efficiency' Muon1Pt_MM_HLT_DoubleMu3 Muon1Pt_MM", - "EffVsEta_HLT_DoubleMu3_MM 'HLT_DoubleMu3 ; #eta_{#mu 1}; Trigger_Efficiency' Muon1Eta_MM_HLT_DoubleMu3 Muon1Eta_MM", - "EffVsPt_HLT_Ele15_SW_L1R_EE 'HLT_Ele15_SW_L1R ; p_{T e 1}; Trigger_Efficiency' Electron1Pt_EE_HLT_Ele15_SW_L1R Electron1Pt_EE", - "EffVsEta_HLT_Ele15_SW_L1R_EE 'HLT_Ele15_SW_L1R ; #eta_{e 1}; Trigger_Efficiency' Electron1Eta_EE_HLT_Ele15_SW_L1R Electron1Eta_EE", - "EffVsPt_HLT_Ele15_SW_LooseTrackIso_L1R_EE 'HLT_Ele15_SW_LooseTrackIso_L1R ; p_{T e 1}; Trigger_Efficiency' Electron1Pt_EE_HLT_Ele15_SW_LooseTrackIso_L1R Electron1Pt_EE", - "EffVsEta_HLT_Ele15_SW_LooseTrackIso_L1R_EE 'HLT_Ele15_SW_LooseTrackIso_L1R ; #eta_{e 1}; Trigger_Efficiency' Electron1Eta_EE_HLT_Ele15_SW_LooseTrackIso_L1R Electron1Eta_EE", - "EffVsPt_HLT_DoubleEle10_SW_L1R_EE 'HLT_DoubleEle10_SW_L1R ; p_{T e 1}; Trigger_Efficiency' Electron1Pt_EE_HLT_DoubleEle10_SW_L1R Electron1Pt_EE", - "EffVsEta_HLT_DoubleEle10_SW_L1R_EE 'HLT_DoubleEle10_SW_L1R ; #eta_{e 1}; Trigger_Efficiency' Electron1Eta_EE_HLT_DoubleEle10_SW_L1R Electron1Eta_EE", - "EffVsPt_HLT_Mu9_EM 'HLT_Mu9 ; p_{T #mu }; Trigger_Efficiency' Muon1Pt_EM_HLT_Mu9 Muon1Pt_EM", - "EffVsEta_HLT_Mu9_EM 'HLT_Mu9 ; #eta_{#mu }; Trigger_Efficiency' Muon1Eta_EM_HLT_Mu9 Muon1Eta_EM", - "EffVsPt_HLT_Mu15_EM 'HLT_Mu15 ; p_{T #mu }; Trigger_Efficiency' Muon1Pt_EM_HLT_Mu15 Muon1Pt_EM", - "EffVsEta_HLT_Mu15_EM 'HLT_Mu15 ; #eta_{#mu }; Trigger_Efficiency' Muon1Eta_EM_HLT_Mu15 Muon1Eta_EM", - "EffVsPt_HLT_IsoMu9_EM 'HLT_IsoMu9 ; p_{T #mu }; Trigger_Efficiency' Muon1Pt_EM_HLT_IsoMu9 Muon1Pt_EM", - "EffVsEta_HLT_IsoMu9_EM 'HLT_IsoMu9 ; #eta_{#mu }; Trigger_Efficiency' Muon1Eta_EM_HLT_IsoMu9 Muon1Eta_EM", - "EffVsPt_HLT_Ele15_SW_L1R_EM 'HLT_Ele15_SW_L1R ; p_{T e }; Trigger_Efficiency' Electron1Pt_EM_HLT_Ele15_SW_L1R Electron1Pt_EM", - "EffVsEta_HLT_Ele15_SW_L1R_EM 'HLT_Ele15_SW_L1R ; #eta_{e }; Trigger_Efficiency' Electron1Eta_EM_HLT_Ele15_SW_L1R Electron1Eta_EM", - "EffVsPt_HLT_Ele15_SW_LooseTrackIso_L1R_EM 'HLT_Ele15_SW_LooseTrackIso_L1R ; p_{T e }; Trigger_Efficiency' Electron1Pt_EM_HLT_Ele15_SW_LooseTrackIso_L1R Electron1Pt_EM", - "EffVsEta_HLT_Ele15_SW_LooseTrackIso_L1R_EM 'HLT_Ele15_SW_LooseTrackIso_L1R ; #eta_{e }; Trigger_Efficiency' Electron1Eta_EM_HLT_Ele15_SW_LooseTrackIso_L1R Electron1Eta_EM", - ##### - "Efficiencies_muontriggers 'HLT efficiency wrt offline ; eff ; Trigger Efficiency' muHLT MuonEvents", - - "Efficiencies_muontriggers_gen 'HLT efficiency wrt mc ; eff ; Trigger Efficiency' genmuHLT genMuonEvents", - #### - - - "Efficiencies_jettriggers_semimu 'HLT efficiency wrt offline ; eff ; Trigger Efficiency' numer denom", - - "Efficiencies_electrontriggers 'HLT efficiency wrt offline ; eff ; Trigger Efficiency' elHLT ElectronEvents", - - "Efficiencies_electrontriggers_gen 'HLT efficiency wrt mc ; eff ; Trigger Efficiency' genelHLT genElectronEvents" - #### - - ) -) - diff --git a/HLTriggerOffline/Top/python/singletopHLTEventDQM_cfi.py b/HLTriggerOffline/Top/python/singletopHLTEventDQM_cfi.py deleted file mode 100644 index 474ffbc0713ea..0000000000000 --- a/HLTriggerOffline/Top/python/singletopHLTEventDQM_cfi.py +++ /dev/null @@ -1,315 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -SingleTopSingleMuonTriggerDQM = cms.EDAnalyzer("TopHLTSingleLeptonDQM", - ## ------------------------------------------------------ - ## SETUP - ## - ## configuration of the MonitoringEnsemble(s) - ## [mandatory] : optional PSets may be omitted - ## - setup = cms.PSet( - ## sub-directory to write the monitor histograms to - ## [mandatory] : should not be changed w/o explicit - ## communication to TopCom! - directory = cms.string("HLTriggerOffline/SingleTop/SingleTopMuonTriggerDQM/"), - ## [mandatory] - sources = cms.PSet( - muons = cms.InputTag("muons"), - elecs = cms.InputTag("gedGsfElectrons"), - jets = cms.InputTag("ak5CaloJets"), - mets = cms.VInputTag("met", "tcMet", "pfMet"), - pvs = cms.InputTag("offlinePrimaryVertices") - - ), - ## [optional] : when omitted the verbosity level is set to STANDARD - monitoring = cms.PSet( - verbosity = cms.string("DEBUG") - ), - ## [optional] : when omitted all monitoring plots for primary vertices - ## will be filled w/o extras - pvExtras = cms.PSet( - ## when omitted electron plots will be filled w/o additional pre- - ## selection of the primary vertex candidates - select = cms.string("abs(x)<1. & abs(y)<1. & abs(z)<20. & tracksSize>3 & !isFake") - ), - ## [optional] : when omitted all monitoring plots for muons - ## will be filled w/o extras - muonExtras = cms.PSet( - ## when omitted muon plots will be filled w/o additional pre- - ## selection of the muon candidates - select = cms.string("pt>20 & abs(eta)<2.1 & isGlobalMuon & innerTrack.numberOfValidHits>10 & globalTrack.normalizedChi2>-1 & globalTrack.normalizedChi2<10 & (isolationR03.sumPt+isolationR03.emEt+isolationR03.hadEt)/pt<0.1"), - ## when omitted isolated muon multiplicity plot will be equi- - ## valent to inclusive muon multiplicity plot - isolation = cms.string("(isolationR03.sumPt+isolationR03.emEt+isolationR03.hadEt)/pt<0.1") - ), - ## [optional] : when omitted all monitoring plots for jets - ## will be filled w/o extras - jetExtras = cms.PSet( - ## when omitted monitor plots for pt will be filled from uncorrected - ## jets - jetCorrector = cms.string("ak5PFL2L3"), - ## when omitted monitor plots will be filled w/o additional cut on - ## jetID - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - ## when omitted no extra selection will be applied on jets before - ## filling the monitor histograms; if jetCorrector is present the - ## selection will be applied to corrected jets - select = cms.string("pt>30 & abs(eta)<4.5& emEnergyFraction>0.01"), - ## when omitted monitor histograms for b-tagging will not be filled - jetBTaggers = cms.PSet( - trackCountingEff = cms.PSet( - label = cms.InputTag("trackCountingHighEffBJetTags" ), - workingPoint = cms.double(1.25) - ), - trackCountingPur = cms.PSet( - label = cms.InputTag("trackCountingHighPurBJetTags" ), - workingPoint = cms.double(3.00) - ), - secondaryVertex = cms.PSet( - label = cms.InputTag("simpleSecondaryVertexHighEffBJetTags"), - workingPoint = cms.double(2.05) - ) - ), - ), - ## [optional] : when omitted no mass window will be applied - ## for the W mass before filling the event monitoring plots - massExtras = cms.PSet( - lowerEdge = cms.double( 70.), - upperEdge = cms.double(110.) - ), - ## [optional] : when omitted the monitoring plots for triggering - ## will be empty - triggerExtras = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - paths = cms.vstring(['HLT_Mu3:HLT_QuadJet15U', - 'HLT_Mu5:HLT_QuadJet15U', - 'HLT_Mu7:HLT_QuadJet15U', - 'HLT_Mu9:HLT_QuadJet15U', - 'HLT_Mu11:HLT_QuadJet15U']) - ) - ), - ## ------------------------------------------------------ - ## PRESELECTION - ## - ## setup of the event preselection, which will not - ## be monitored - ## [mandatory] : but may be empty - ## - preselection = cms.PSet( - trigger = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - select = cms.vstring(['HLT_Iso10Mu20_eta2p1_CentralCaloJet30_BTagIPIter_v1'])#ONLY ONE PATH - ), - ## [optional] : when omitted no preselection is applied - vertex = cms.PSet( - src = cms.InputTag("offlinePrimaryVertices"), - select = cms.string('abs(x)<1. & abs(y)<1. & abs(z)<20. & tracksSize>3 & !isFake') - ) - ), - ## ------------------------------------------------------ - ## SELECTION - ## - ## monitor histrograms are filled after each selection - ## step, the selection is applied in the order defined - ## by this vector - ## [mandatory] : may be empty or contain an arbitrary - ## number of PSets - selection = cms.VPSet( - cms.PSet( - label = cms.string("Hlt:step0"), - src = cms.InputTag(""), - select = cms.string(""), - min = cms.int32(0), - max = cms.int32(0), - ), - cms.PSet( - label = cms.string("muons:step1"), - src = cms.InputTag("muons"), - select = cms.string("pt>20 & abs(eta)<2.1 & isGlobalMuon & innerTrack.numberOfValidHits>10 & globalTrack.normalizedChi2>-1 & globalTrack.normalizedChi2<10 & (isolationR03.sumPt+isolationR03.emEt+isolationR03.hadEt)/pt<0.1"), - min = cms.int32(1), - max = cms.int32(1), - ), - cms.PSet( - label = cms.string("jets/calo:step2"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5PFL2L3"), - select = cms.string("pt>30 & abs(eta)<4.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(1), - ), - cms.PSet( - label = cms.string("jets/calo:step3"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5PFL2L3"), - select = cms.string("pt>30 & abs(eta)<4.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(2), - ), - ) -) - -SingleTopSingleElectronTriggerDQM = cms.EDAnalyzer("TopHLTSingleLeptonDQM", - ## ------------------------------------------------------ - ## SETUP - ## - ## configuration of the MonitoringEnsemble(s) - ## [mandatory] : optional PSets may be omitted - ## - setup = cms.PSet( - ## sub-directory to write the monitor histograms to - ## [mandatory] : should not be changed w/o explicit - ## communication to TopCom! - directory = cms.string("HLTriggerOffline/SingleTop/SingleTopElectronTriggerDQM/"), - ## [mandatory] - sources = cms.PSet( - muons = cms.InputTag("muons"), - elecs = cms.InputTag("gedGsfElectrons"), - jets = cms.InputTag("ak5CaloJets"), - mets = cms.VInputTag("met", "tcMet", "pfMet"), - pvs = cms.InputTag("offlinePrimaryVertices") - - ), - ## [optional] : when omitted the verbosity level is set to STANDARD - monitoring = cms.PSet( - verbosity = cms.string("DEBUG") - ), - ## [optional] : when omitted all monitoring plots for primary vertices - ## will be filled w/o extras - pvExtras = cms.PSet( - ## when omitted electron plots will be filled w/o additional pre- - ## selection of the primary vertex candidates - select = cms.string("abs(x)<1. & abs(y)<1. & abs(z)<20. & tracksSize>3 & !isFake") - ), - ## [optional] : when omitted all monitoring plots for muons - ## will be filled w/o extras - muonExtras = cms.PSet( - ## when omitted muon plots will be filled w/o additional pre- - ## selection of the muon candidates - select = cms.string("pt>20 & abs(eta)<2.1 & isGlobalMuon & innerTrack.numberOfValidHits>10 & globalTrack.normalizedChi2>-1 & globalTrack.normalizedChi2<10 & (isolationR03.sumPt+isolationR03.emEt+isolationR03.hadEt)/pt<0.1"), - ## when omitted isolated muon multiplicity plot will be equi- - ## valent to inclusive muon multiplicity plot - isolation = cms.string("(isolationR03.sumPt+isolationR03.emEt+isolationR03.hadEt)/pt<0.1") - ), - ## [optional] : when omitted all monitoring plots for jets - ## will be filled w/o extras - jetExtras = cms.PSet( - ## when omitted monitor plots for pt will be filled from uncorrected - ## jets - jetCorrector = cms.string("ak5PFL2L3"), - ## when omitted monitor plots will be filled w/o additional cut on - ## jetID - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - ## when omitted no extra selection will be applied on jets before - ## filling the monitor histograms; if jetCorrector is present the - ## selection will be applied to corrected jets - select = cms.string("pt>30 & abs(eta)<4.5& emEnergyFraction>0.01"), - ## when omitted monitor histograms for b-tagging will not be filled - jetBTaggers = cms.PSet( - trackCountingEff = cms.PSet( - label = cms.InputTag("trackCountingHighEffBJetTags" ), - workingPoint = cms.double(1.25) - ), - trackCountingPur = cms.PSet( - label = cms.InputTag("trackCountingHighPurBJetTags" ), - workingPoint = cms.double(3.00) - ), - secondaryVertex = cms.PSet( - label = cms.InputTag("simpleSecondaryVertexHighEffBJetTags"), - workingPoint = cms.double(2.05) - ) - ), - ), - ## [optional] : when omitted no mass window will be applied - ## for the W mass before filling the event monitoring plots - massExtras = cms.PSet( - lowerEdge = cms.double( 70.), - upperEdge = cms.double(110.) - ), - ## [optional] : when omitted the monitoring plots for triggering - ## will be empty - triggerExtras = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - paths = cms.vstring(['HLT_Mu3:HLT_QuadJet15U', - 'HLT_Mu5:HLT_QuadJet15U', - 'HLT_Mu7:HLT_QuadJet15U', - 'HLT_Mu9:HLT_QuadJet15U', - 'HLT_Mu11:HLT_QuadJet15U']) - ) - ), - ## ------------------------------------------------------ - ## PRESELECTION - ## - ## setup of the event preselection, which will not - ## be monitored - ## [mandatory] : but may be empty - ## - preselection = cms.PSet( - trigger = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - select = cms.vstring(['HLT_Iso10Mu20_eta2p1_CentralCaloJet30_BTagIPIter_v1'])#ONLY ONE PATH - ), - ## [optional] : when omitted no preselection is applied - vertex = cms.PSet( - src = cms.InputTag("offlinePrimaryVertices"), - select = cms.string('abs(x)<1. & abs(y)<1. & abs(z)<20. & tracksSize>3 & !isFake') - ) - ), - ## ------------------------------------------------------ - ## SELECTION - ## - ## monitor histrograms are filled after each selection - ## step, the selection is applied in the order defined - ## by this vector - ## [mandatory] : may be empty or contain an arbitrary - ## number of PSets - selection = cms.VPSet( - cms.PSet( - label = cms.string("Hlt:step0"), - src = cms.InputTag(""), - select = cms.string(""), - min = cms.int32(0), - max = cms.int32(0), - ), - cms.PSet( - label = cms.string("muons:step1"), - src = cms.InputTag("muons"), - select = cms.string("pt>20 & abs(eta)<2.1 & isGlobalMuon & innerTrack.numberOfValidHits>10 & globalTrack.normalizedChi2>-1 & globalTrack.normalizedChi2<10 & (isolationR03.sumPt+isolationR03.emEt+isolationR03.hadEt)/pt<0.1"), - min = cms.int32(1), - max = cms.int32(1), - ), - cms.PSet( - label = cms.string("jets/calo:step2"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5PFL2L3"), - select = cms.string("pt>30 & abs(eta)<4.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(1), - ), - cms.PSet( - label = cms.string("jets/calo:step3"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>30 & abs(eta)<4.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(2), - ), - ) -) diff --git a/HLTriggerOffline/Top/python/singletopHLTEventValidation_cfi.py b/HLTriggerOffline/Top/python/singletopHLTEventValidation_cfi.py new file mode 100644 index 0000000000000..3960ae9a6e845 --- /dev/null +++ b/HLTriggerOffline/Top/python/singletopHLTEventValidation_cfi.py @@ -0,0 +1,53 @@ +import FWCore.ParameterSet.Config as cms + +# single top muonique +SingleTopSingleMuonHLTValidation = cms.EDAnalyzer('TopSingleLeptonHLTValidation', + # Directory + sDir = cms.untracked.string('HLTValidation/SingleTop/SingleMuon/'), + # Electrons + sElectrons = cms.untracked.string('gsfElectrons'), + ptElectrons = cms.untracked.double(30.), + etaElectrons = cms.untracked.double(2.5), + isoElectrons = cms.untracked.double(0.1), + minElectrons = cms.untracked.uint32(0), + # Muons + sMuons = cms.untracked.string('muons'), + ptMuons = cms.untracked.double(26.), + etaMuons = cms.untracked.double(2.1), + isoMuons = cms.untracked.double(0.12), + minMuons = cms.untracked.uint32(1), + # Jets + sJets = cms.untracked.string('ak5PFJets'), + ptJets = cms.untracked.double(40.), + etaJets = cms.untracked.double(5.), + minJets = cms.untracked.uint32(2), + # Trigger + sTrigger = cms.untracked.string("TriggerResults"), + vsPaths = cms.untracked.vstring(['HLT_IsoMu17_eta2p1_TriCentralPFNoPUJet45_35_25','HLT_IsoMu17_eta2p1_TriCentralPFNoPUJet30']), +) + +# single top electronique +SingleTopSingleElectronHLTValidation = cms.EDAnalyzer('TopSingleLeptonHLTValidation', + # Directory + sDir = cms.untracked.string('HLTValidation/SingleTop/SingleElectron/'), + # Electrons + sElectrons = cms.untracked.string('gsfElectrons'), + ptElectrons = cms.untracked.double(30.), + etaElectrons = cms.untracked.double(2.5), + isoElectrons = cms.untracked.double(0.1), + minElectrons = cms.untracked.uint32(1), + # Muons + sMuons = cms.untracked.string('muons'), + ptMuons = cms.untracked.double(26.), + etaMuons = cms.untracked.double(2.1), + isoMuons = cms.untracked.double(0.12), + minMuons = cms.untracked.uint32(0), + # Jets + sJets = cms.untracked.string('ak5PFJets'), + ptJets = cms.untracked.double(40.), + etaJets = cms.untracked.double(5.), + minJets = cms.untracked.uint32(2), + # Trigger + sTrigger = cms.untracked.string("TriggerResults"), + vsPaths = cms.untracked.vstring(['HLT_Ele25_CaloIdVT_CaloIsoVL_TrkIdVL_TrkIsoT_TriCentralPFNoPUJet45_35_25','HLT_Ele25_CaloIdVT_CaloIsoVL_TrkIdVL_TrkIsoT_TriCentralPFNoPUJet30']), +) diff --git a/HLTriggerOffline/Top/python/topDiLeptonHLTEventDQM_cfi.py b/HLTriggerOffline/Top/python/topDiLeptonHLTEventDQM_cfi.py deleted file mode 100644 index 49b0aeb46320d..0000000000000 --- a/HLTriggerOffline/Top/python/topDiLeptonHLTEventDQM_cfi.py +++ /dev/null @@ -1,639 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -topDiLeptonTriggerDQM = cms.EDAnalyzer("TopHLTDiLeptonOfflineDQM", - ## ------------------------------------------------------ - ## SETUP - ## - ## configuration of the MonitoringEnsemble(s) - ## [mandatory] : optional PSets may be omitted - ## - setup = cms.PSet( - ## sub-directory to write the monitor histograms to - ## [mandatory] : should not be changed w/o explicit - ## communication to TopCom! - directory = cms.string("Physics/Top/TopDiLeptonDQM/"), - - ## [mandatory] - sources = cms.PSet( - muons = cms.InputTag("muons"), - elecs = cms.InputTag("gedGsfElectrons"), - jets = cms.InputTag("ak5CaloJets"), - mets = cms.VInputTag("met", "tcMet", "pfMet") - ), - ## [optional] : when omitted the verbosity level is set to STANDARD - monitoring = cms.PSet( - verbosity = cms.string("DEBUG") - ), - ## [optional] : when omitted all monitoring plots for electrons - ## will be filled w/o extras - elecExtras = cms.PSet( - ## when omitted electron plots will be filled w/o cut on electronId - electronId = cms.PSet( - src = cms.InputTag("simpleEleId70cIso"), - #src = cms.InputTag("eidRobustLoose"), - pattern = cms.int32(1) - ), - ## when omitted electron plots will be filled w/o additional pre- - ## selection of the electron candidates - select = cms.string("pt>10. && abs(eta)<2.4 && abs(gsfTrack.d0)<1. && abs(gsfTrack.dz)<20."), - ## when omitted isolated electron multiplicity plot will be equi- - ## valent to inclusive electron multiplicity plot - isolation = cms.string("(dr03TkSumPt+dr03EcalRecHitSumEt+dr03HcalTowerSumEt)/pt<0.2"), - ), - ## [optional] : when omitted all monitoring plots for muons - ## will be filled w/o extras - muonExtras = cms.PSet( - ## when omitted muon plots will be filled w/o additional pre- - ## selection of the muon candidates - select = cms.string("pt>10. && abs(eta)<2.4 && abs(globalTrack.d0)<1. && abs(globalTrack.dz)<20."), - ## when omitted isolated muon multiplicity plot will be equi- - ## valent to inclusive muon multiplicity plot - isolation = cms.string("(isolationR03.sumPt+isolationR03.emEt+isolationR03.hadEt)/pt<0.2"), - ), - ## [optional] : when omitted all monitoring plots for jets will - ## be filled from uncorrected jets - jetExtras = cms.PSet( - ## when omitted monitor plots for pt will be filled from uncorrected - ## jets - jetCorrector = cms.string("ak5CaloL2L3"), - ## when omitted monitor plots will be filled w/o additional cut on - ## jetID - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - ## when omitted no extra selection will be applied on jets before - ## filling the monitor histograms; if jetCorrector is present the - ## selection will be applied to corrected jets - select = cms.string("pt>30. & abs(eta)<2.4 & emEnergyFraction>0.01"), - ), - ## [optional] : when omitted no mass window will be applied - ## for the same flavor lepton monitoring plots - massExtras = cms.PSet( - lowerEdge = cms.double( 76.0), - upperEdge = cms.double(106.0) - ), - ## [optional] : when omitted all monitoring plots for triggering - ## will be empty - #triggerExtras = cms.PSet( - #src = cms.InputTag("TriggerResults","","HLT"), - #pathsELECMU = cms.vstring([ 'HLT_Mu9:HLT_Ele15_SW_L1R', - #'HLT_Mu15:HLT_Ele15_SW_L1R', - #'HLT_DoubleMu3:HLT_Ele15_SW_L1R', - #'HLT_Ele15_SW_L1R:HLT_Mu9', - #'HLT_Ele15_SW_L1R:HLT_DoubleMu3']), - #pathsDIMUON = cms.vstring([ 'HLT_Mu15:HLT_Mu9', - #'HLT_DoubleMu3:HLT_Mu9', - #'HLT_Mu9:HLT_DoubleMu3', - #'HLT_Mu15:HLT_DoubleMu3']) - #) - ), - - ## ------------------------------------------------------ - ## PRESELECTION - ## - ## setup of the event preselection, which will not - ## be monitored - ## [mandatory] : but may be empty - ## - preselection = cms.PSet( - ## [optional] : when omitted no preselection is applied - trigger = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - select = cms.vstring(['HLT_Mu9','HLT_Ele15_SW_L1R','HLT_DoubleMu3']) - ), - ## [optional] : when omitted no preselection is applied - vertex = cms.PSet( - src = cms.InputTag("offlinePrimaryVertices"), - select = cms.string('abs(x)<1. && abs(y)<1. && abs(z)<20. && tracksSize>3 && !isFake') - ) - ), - - ## ------------------------------------------------------ - ## SELECTION - ## - ## monitor histrograms are filled after each selection - ## step, the selection is applied in the order defined - ## by this vector - ## [mandatory] : may be empty or contain an arbitrary - ## number of PSets as given below: - ## - selection = cms.VPSet( - #cms.PSet( - ### [mandatory] : 'jets' defines the objects to - ### select on, 'step0' labels the histograms; - ### instead of 'step0' you can choose any label - #label = cms.string("empty:step0") - #), - cms.PSet( - label = cms.string("Hlt:step0"), - src = cms.InputTag(""), - select = cms.string(""), - min = cms.int32(0), - max = cms.int32(0), - ), - - cms.PSet( - label = cms.string("muons:step1"), - src = cms.InputTag("muons"), - select = cms.string("pt>20 & abs(eta)<2.4 & isGlobalMuon & innerTrack.numberOfValidHits>10 & globalTrack.normalizedChi2>-1 & globalTrack.normalizedChi2<10"), - min = cms.int32(2), - max = cms.int32(2), - ), - cms.PSet( - label = cms.string("jets/calo:step2"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>30. & abs(eta)<2.4 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(2), - #max = cms.int32(2), - ) - ) -) - - - -DiMuonDQM = cms.EDAnalyzer("TopHLTDiLeptonOfflineDQM", - ## ------------------------------------------------------ - ## SETUP - ## - ## configuration of the MonitoringEnsemble(s) - ## [mandatory] : optional PSets may be omitted - ## - setup = cms.PSet( - ## sub-directory to write the monitor histograms to - ## [mandatory] : should not be changed w/o explicit - ## communication to TopCom! - directory = cms.string("Physics/Top/TopDiMuonDQM/"), - - ## [mandatory] - sources = cms.PSet( - muons = cms.InputTag("muons"), - elecs = cms.InputTag("gedGsfElectrons"), - jets = cms.InputTag("ak5CaloJets"), - mets = cms.VInputTag("met", "tcMet", "pfMet") - ), - ## [optional] : when omitted the verbosity level is set to STANDARD - monitoring = cms.PSet( - verbosity = cms.string("DEBUG") - ), - ## [optional] : when omitted all monitoring plots for electrons - ## will be filled w/o extras - elecExtras = cms.PSet( - ## when omitted electron plots will be filled w/o cut on electronId - electronId = cms.PSet( - src = cms.InputTag("simpleEleId70cIso"), - #src = cms.InputTag("eidRobustLoose"), - pattern = cms.int32(1) - ), - ## when omitted electron plots will be filled w/o additional pre- - ## selection of the electron candidates - select = cms.string("pt>500. && abs(eta)<2.4 && abs(gsfTrack.d0)<1. && abs(gsfTrack.dz)<20."), - ## when omitted isolated electron multiplicity plot will be equi- - ## valent to inclusive electron multiplicity plot - isolation = cms.string("(dr03TkSumPt+dr03EcalRecHitSumEt+dr03HcalTowerSumEt)/pt<0.2"), - ), - ## [optional] : when omitted all monitoring plots for muons - ## will be filled w/o extras - muonExtras = cms.PSet( - ## when omitted muon plots will be filled w/o additional pre- - ## selection of the muon candidates - select = cms.string("pt>20. && abs(eta)<2.4 && abs(globalTrack.d0)<1. && abs(globalTrack.dz)<20."), - ## when omitted isolated muon multiplicity plot will be equi- - ## valent to inclusive muon multiplicity plot - isolation = cms.string("(isolationR03.sumPt+isolationR03.emEt+isolationR03.hadEt)/pt<0.2"), - ), - ## [optional] : when omitted all monitoring plots for jets will - ## be filled from uncorrected jets - jetExtras = cms.PSet( - ## when omitted monitor plots for pt will be filled from uncorrected - ## jets - jetCorrector = cms.string("ak5CaloL2L3"), - ## when omitted monitor plots will be filled w/o additional cut on - ## jetID - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - ## when omitted no extra selection will be applied on jets before - ## filling the monitor histograms; if jetCorrector is present the - ## selection will be applied to corrected jets - select = cms.string("pt>30. & abs(eta)<2.4 & emEnergyFraction>0.01"), - ), - ## [optional] : when omitted no mass window will be applied - ## for the same flavor lepton monitoring plots - massExtras = cms.PSet( - lowerEdge = cms.double( 76.0), - upperEdge = cms.double(106.0) - ), - ## [optional] : when omitted all monitoring plots for triggering - ## will be empty - #triggerExtras = cms.PSet( - #src = cms.InputTag("TriggerResults","","HLT"), - #pathsELECMU = cms.vstring([ 'HLT_Mu9:HLT_Ele15_SW_L1R', - #'HLT_Mu15:HLT_Ele15_SW_L1R', - #'HLT_DoubleMu3:HLT_Ele15_SW_L1R', - #'HLT_Ele15_SW_L1R:HLT_Mu9', - #'HLT_Ele15_SW_L1R:HLT_DoubleMu3']), - #pathsDIMUON = cms.vstring([ 'HLT_Mu15:HLT_Mu9', - #'HLT_DoubleMu3:HLT_Mu9', - #'HLT_Mu9:HLT_DoubleMu3', - #'HLT_Mu15:HLT_DoubleMu3']) - #) - ), - - ## ------------------------------------------------------ - ## PRESELECTION - ## - ## setup of the event preselection, which will not - ## be monitored - ## [mandatory] : but may be empty - ## - preselection = cms.PSet( - ## [optional] : when omitted no preselection is applied - trigger = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - select = cms.vstring(['HLT_Mu9','HLT_Ele15_SW_L1R','HLT_DoubleMu3']) - ), - ## [optional] : when omitted no preselection is applied - vertex = cms.PSet( - src = cms.InputTag("offlinePrimaryVertices"), - select = cms.string('abs(x)<1. && abs(y)<1. && abs(z)<20. && tracksSize>3 && !isFake') - ) - ), - - ## ------------------------------------------------------ - ## SELECTION - ## - ## monitor histrograms are filled after each selection - ## step, the selection is applied in the order defined - ## by this vector - ## [mandatory] : may be empty or contain an arbitrary - ## number of PSets as given below: - ## - selection = cms.VPSet( - #cms.PSet( - ### [mandatory] : 'jets' defines the objects to - ### select on, 'step0' labels the histograms; - ### instead of 'step0' you can choose any label - #label = cms.string("empty:step0") - #), - cms.PSet( - label = cms.string("Hlt:step0"), - src = cms.InputTag(""), - select = cms.string(""), - min = cms.int32(0), - max = cms.int32(0), - ), - - cms.PSet( - label = cms.string("muons:step1"), - src = cms.InputTag("muons"), - select = cms.string("pt>20 & abs(eta)<2.4 & isGlobalMuon & innerTrack.numberOfValidHits>10 & globalTrack.normalizedChi2>-1 & globalTrack.normalizedChi2<10"), - min = cms.int32(2), - max = cms.int32(2), - ), - cms.PSet( - label = cms.string("jets/calo:step2"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>30. & abs(eta)<2.4 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(2), - #max = cms.int32(2), - ), - ), -) - -DiElectronDQM = cms.EDAnalyzer("TopHLTDiLeptonOfflineDQM", - ## ------------------------------------------------------ - ## SETUP - ## - ## configuration of the MonitoringEnsemble(s) - ## [mandatory] : optional PSets may be omitted - ## - setup = cms.PSet( - ## sub-directory to write the monitor histograms to - ## [mandatory] : should not be changed w/o explicit - ## communication to TopCom! - directory = cms.string("Physics/Top/TopDiElectronDQM/"), - - ## [mandatory] - sources = cms.PSet( - muons = cms.InputTag("muons"), - elecs = cms.InputTag("gedGsfElectrons"), - jets = cms.InputTag("ak5CaloJets"), - mets = cms.VInputTag("met", "tcMet", "pfMet") - ), - ## [optional] : when omitted the verbosity level is set to STANDARD - monitoring = cms.PSet( - verbosity = cms.string("DEBUG") - ), - ## [optional] : when omitted all monitoring plots for electrons - ## will be filled w/o extras - elecExtras = cms.PSet( - ## when omitted electron plots will be filled w/o cut on electronId - electronId = cms.PSet( - src = cms.InputTag("simpleEleId70cIso"), - #src = cms.InputTag("eidRobustLoose"), - pattern = cms.int32(1) - ), - ## when omitted electron plots will be filled w/o additional pre- - ## selection of the electron candidates - select = cms.string("pt>10. && abs(eta)<2.4 && abs(gsfTrack.d0)<1. && abs(gsfTrack.dz)<20."), - ## when omitted isolated electron multiplicity plot will be equi- - ## valent to inclusive electron multiplicity plot - isolation = cms.string("(dr03TkSumPt+dr03EcalRecHitSumEt+dr03HcalTowerSumEt)/pt<0.2"), - ), - ## [optional] : when omitted all monitoring plots for muons - ## will be filled w/o extras - muonExtras = cms.PSet( - ## when omitted muon plots will be filled w/o additional pre- - ## selection of the muon candidates - select = cms.string("pt>500. && abs(eta)<2.4 && abs(globalTrack.d0)<1. && abs(globalTrack.dz)<20."), - ## when omitted isolated muon multiplicity plot will be equi- - ## valent to inclusive muon multiplicity plot - isolation = cms.string("(isolationR03.sumPt+isolationR03.emEt+isolationR03.hadEt)/pt<0.2"), - ), - ## [optional] : when omitted all monitoring plots for jets will - ## be filled from uncorrected jets - jetExtras = cms.PSet( - ## when omitted monitor plots for pt will be filled from uncorrected - ## jets - jetCorrector = cms.string("ak5CaloL2L3"), - ## when omitted monitor plots will be filled w/o additional cut on - ## jetID - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - ## when omitted no extra selection will be applied on jets before - ## filling the monitor histograms; if jetCorrector is present the - ## selection will be applied to corrected jets - select = cms.string("pt>30. & abs(eta)<2.4 & emEnergyFraction>0.01"), - ), - ## [optional] : when omitted no mass window will be applied - ## for the same flavor lepton monitoring plots - massExtras = cms.PSet( - lowerEdge = cms.double( 76.0), - upperEdge = cms.double(106.0) - ), - ## [optional] : when omitted all monitoring plots for triggering - ## will be empty - #triggerExtras = cms.PSet( - #src = cms.InputTag("TriggerResults","","HLT"), - #pathsELECMU = cms.vstring([ 'HLT_Mu9:HLT_Ele15_SW_L1R', - #'HLT_Mu15:HLT_Ele15_SW_L1R', - #'HLT_DoubleMu3:HLT_Ele15_SW_L1R', - #'HLT_Ele15_SW_L1R:HLT_Mu9', - #'HLT_Ele15_SW_L1R:HLT_DoubleMu3']), - #pathsDIMUON = cms.vstring([ 'HLT_Mu15:HLT_Mu9', - #'HLT_DoubleMu3:HLT_Mu9', - #'HLT_Mu9:HLT_DoubleMu3', - #'HLT_Mu15:HLT_DoubleMu3']) - #) - ), - - ## ------------------------------------------------------ - ## PRESELECTION - ## - ## setup of the event preselection, which will not - ## be monitored - ## [mandatory] : but may be empty - ## - preselection = cms.PSet( - ## [optional] : when omitted no preselection is applied - trigger = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - select = cms.vstring(['HLT_Mu9','HLT_Ele15_SW_L1R','HLT_DoubleMu3']) - ), - ## [optional] : when omitted no preselection is applied - vertex = cms.PSet( - src = cms.InputTag("offlinePrimaryVertices"), - select = cms.string('abs(x)<1. && abs(y)<1. && abs(z)<20. && tracksSize>3 && !isFake') - ) - ), - - ## ------------------------------------------------------ - ## SELECTION - ## - ## monitor histrograms are filled after each selection - ## step, the selection is applied in the order defined - ## by this vector - ## [mandatory] : may be empty or contain an arbitrary - ## number of PSets as given below: - ## - selection = cms.VPSet( - #cms.PSet( - ### [mandatory] : 'jets' defines the objects to - ### select on, 'step0' labels the histograms; - ### instead of 'step0' you can choose any label - #label = cms.string("empty:step0") - #), - cms.PSet( - label = cms.string("Hlt:step0"), - src = cms.InputTag(""), - select = cms.string(""), - min = cms.int32(0), - max = cms.int32(0), - ), - - cms.PSet( - label = cms.string("elecs:step1"), - src = cms.InputTag("gedGsfElectrons"), - electronId = cms.PSet( - src = cms.InputTag("simpleEleId70cIso"), - pattern = cms.int32(1) - ), - select = cms.string("pt>20 & abs(eta)<2.4 & (dr03TkSumPt+dr03EcalRecHitSumEt+dr03HcalTowerSumEt)/pt<0.17"), - min = cms.int32(2), - max = cms.int32(2), - ), - cms.PSet( - label = cms.string("jets/calo:step2"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>30. & abs(eta)<2.4 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(2), - #max = cms.int32(2), - ), - ), -) - -ElecMuonDQM = cms.EDAnalyzer("TopHLTDiLeptonOfflineDQM", - ## ------------------------------------------------------ - ## SETUP - ## - ## configuration of the MonitoringEnsemble(s) - ## [mandatory] : optional PSets may be omitted - ## - setup = cms.PSet( - ## sub-directory to write the monitor histograms to - ## [mandatory] : should not be changed w/o explicit - ## communication to TopCom! - directory = cms.string("Physics/Top/TopElecMuonDQM/"), - - ## [mandatory] - sources = cms.PSet( - muons = cms.InputTag("muons"), - elecs = cms.InputTag("gedGsfElectrons"), - jets = cms.InputTag("ak5CaloJets"), - mets = cms.VInputTag("met", "tcMet", "pfMet") - ), - ## [optional] : when omitted the verbosity level is set to STANDARD - monitoring = cms.PSet( - verbosity = cms.string("DEBUG") - ), - ## [optional] : when omitted all monitoring plots for electrons - ## will be filled w/o extras - elecExtras = cms.PSet( - ## when omitted electron plots will be filled w/o cut on electronId - electronId = cms.PSet( - src = cms.InputTag("simpleEleId70cIso"), - #src = cms.InputTag("eidRobustLoose"), - pattern = cms.int32(1) - ), - ## when omitted electron plots will be filled w/o additional pre- - ## selection of the electron candidates - select = cms.string("pt>10. && abs(eta)<2.4 && abs(gsfTrack.d0)<1. && abs(gsfTrack.dz)<20."), - ## when omitted isolated electron multiplicity plot will be equi- - ## valent to inclusive electron multiplicity plot - isolation = cms.string("(dr03TkSumPt+dr03EcalRecHitSumEt+dr03HcalTowerSumEt)/pt<0.2"), - ), - ## [optional] : when omitted all monitoring plots for muons - ## will be filled w/o extras - muonExtras = cms.PSet( - ## when omitted muon plots will be filled w/o additional pre- - ## selection of the muon candidates - select = cms.string("pt>10. && abs(eta)<2.4 && abs(globalTrack.d0)<1. && abs(globalTrack.dz)<20."), - ## when omitted isolated muon multiplicity plot will be equi- - ## valent to inclusive muon multiplicity plot - isolation = cms.string("(isolationR03.sumPt+isolationR03.emEt+isolationR03.hadEt)/pt<0.2"), - ), - ## [optional] : when omitted all monitoring plots for jets will - ## be filled from uncorrected jets - jetExtras = cms.PSet( - ## when omitted monitor plots for pt will be filled from uncorrected - ## jets - jetCorrector = cms.string("ak5CaloL2L3"), - ## when omitted monitor plots will be filled w/o additional cut on - ## jetID - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - ## when omitted no extra selection will be applied on jets before - ## filling the monitor histograms; if jetCorrector is present the - ## selection will be applied to corrected jets - select = cms.string("pt>30. & abs(eta)<2.4 & emEnergyFraction>0.01"), - ), - ## [optional] : when omitted no mass window will be applied - ## for the same flavor lepton monitoring plots - massExtras = cms.PSet( - lowerEdge = cms.double( 76.0), - upperEdge = cms.double(106.0) - ), - ## [optional] : when omitted all monitoring plots for triggering - ## will be empty - #triggerExtras = cms.PSet( - #src = cms.InputTag("TriggerResults","","HLT"), - #pathsELECMU = cms.vstring([ 'HLT_Mu9:HLT_Ele15_SW_L1R', - #'HLT_Mu15:HLT_Ele15_SW_L1R', - #'HLT_DoubleMu3:HLT_Ele15_SW_L1R', - #'HLT_Ele15_SW_L1R:HLT_Mu9', - #'HLT_Ele15_SW_L1R:HLT_DoubleMu3']), - #pathsDIMUON = cms.vstring([ 'HLT_Mu15:HLT_Mu9', - #'HLT_DoubleMu3:HLT_Mu9', - #'HLT_Mu9:HLT_DoubleMu3', - #'HLT_Mu15:HLT_DoubleMu3']) - #) - ), - - ## ------------------------------------------------------ - ## PRESELECTION - ## - ## setup of the event preselection, which will not - ## be monitored - ## [mandatory] : but may be empty - ## - preselection = cms.PSet( - ## [optional] : when omitted no preselection is applied - trigger = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - select = cms.vstring(['HLT_Mu9','HLT_Ele15_SW_L1R','HLT_DoubleMu3']) - ), - ## [optional] : when omitted no preselection is applied - vertex = cms.PSet( - src = cms.InputTag("offlinePrimaryVertices"), - select = cms.string('abs(x)<1. && abs(y)<1. && abs(z)<20. && tracksSize>3 && !isFake') - ) - ), - - ## ------------------------------------------------------ - ## SELECTION - ## - ## monitor histrograms are filled after each selection - ## step, the selection is applied in the order defined - ## by this vector - ## [mandatory] : may be empty or contain an arbitrary - ## number of PSets as given below: - ## - selection = cms.VPSet( - #cms.PSet( - ### [mandatory] : 'jets' defines the objects to - ### select on, 'step0' labels the histograms; - ### instead of 'step0' you can choose any label - #label = cms.string("empty:step0") - #), - cms.PSet( - label = cms.string("Hlt:step0"), - src = cms.InputTag(""), - select = cms.string(""), - min = cms.int32(0), - max = cms.int32(0), - ), - - cms.PSet( - label = cms.string("muons:step1"), - src = cms.InputTag("muons"), - select = cms.string("pt>20 & abs(eta)<2.4 & isGlobalMuon & innerTrack.numberOfValidHits>10 & globalTrack.normalizedChi2>-1 & globalTrack.normalizedChi2<10"), - min = cms.int32(1), - max = cms.int32(1), - ), - cms.PSet( - label = cms.string("elecs:step2"), - src = cms.InputTag("gedGsfElectrons"), - electronId = cms.PSet( - src = cms.InputTag("simpleEleId70cIso"), - pattern = cms.int32(1) - ), - select = cms.string("pt>20 & abs(eta)<2.4 & (dr03TkSumPt+dr03EcalRecHitSumEt+dr03HcalTowerSumEt)/pt<0.17"), - min = cms.int32(1), - max = cms.int32(1), - ), - cms.PSet( - label = cms.string("jets/calo:step3"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>30. & abs(eta)<2.4 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(2), - #max = cms.int32(2), - ), - ), -) - diff --git a/HLTriggerOffline/Top/python/topHLTDQM_cff.py b/HLTriggerOffline/Top/python/topHLTDQM_cff.py deleted file mode 100644 index 6a6a02b7032d6..0000000000000 --- a/HLTriggerOffline/Top/python/topHLTDQM_cff.py +++ /dev/null @@ -1,20 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -from HLTriggerOffline.Top.topDiLeptonHLTEventDQM_cfi import * -from HLTriggerOffline.Top.topSingleLeptonHLTEventDQM_cfi import * -from HLTriggerOffline.Top.singletopHLTEventDQM_cfi import * -from HLTriggerOffline.Top.topvalidation_cfi import * -from JetMETCorrections.Configuration.JetCorrectionProducersAllAlgos_cff import * - - - -topHLTDQM = cms.Sequence( - DiMuonDQM - *DiElectronDQM - *ElecMuonDQM - *topSingleMuonMediumTriggerDQM - *topSingleElectronMediumTriggerDQM - *SingleTopSingleMuonTriggerDQM - *SingleTopSingleElectronTriggerDQM - ) - diff --git a/HLTriggerOffline/Top/python/topHLTValidation_cff.py b/HLTriggerOffline/Top/python/topHLTValidation_cff.py new file mode 100644 index 0000000000000..ac322628a1414 --- /dev/null +++ b/HLTriggerOffline/Top/python/topHLTValidation_cff.py @@ -0,0 +1,17 @@ +import FWCore.ParameterSet.Config as cms + +#from HLTriggerOffline.Top.topDiLeptonHLTEventValidation_cfi import * +from HLTriggerOffline.Top.topSingleLeptonHLTEventValidation_cfi import * +from HLTriggerOffline.Top.singletopHLTEventValidation_cfi import * + +topHLTriggerValidation = cms.Sequence( +# DiMuonHLTValidation +# *DiElectronHLTValidation +# *ElecMuonHLTValidation +# * + topSingleMuonHLTValidation + *topSingleElectronHLTValidation + *SingleTopSingleMuonHLTValidation + *SingleTopSingleElectronHLTValidation + ) + diff --git a/HLTriggerOffline/Top/python/topSingleLeptonHLTEventDQM_cfi.py b/HLTriggerOffline/Top/python/topSingleLeptonHLTEventDQM_cfi.py deleted file mode 100644 index 9d46ce90e9497..0000000000000 --- a/HLTriggerOffline/Top/python/topSingleLeptonHLTEventDQM_cfi.py +++ /dev/null @@ -1,843 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -topSingleLeptonTriggerDQM = cms.EDAnalyzer("TopHLTSingleLeptonDQM", - ## ------------------------------------------------------ - ## SETUP - ## - ## configuration of the MonitoringEnsemble(s) - ## [mandatory] : optional PSets may be omitted - ## - setup = cms.PSet( - ## sub-directory to write the monitor histograms to - ## [mandatory] : should not be changed w/o explicit - ## communication to TopCom! - directory = cms.string("HLTriggerOffline/Top/TopSingleLeptonTriggerDQM/"), - ## [mandatory] - sources = cms.PSet( - muons = cms.InputTag("muons"), - elecs = cms.InputTag("gedGsfElectrons"), - jets = cms.InputTag("ak5CaloJets"), - mets = cms.VInputTag("met", "tcMet", "pfMet"), - pvs = cms.InputTag("offlinePrimaryVertices") - ), - ## [optional] : when omitted the verbosity level is set to STANDARD - monitoring = cms.PSet( - verbosity = cms.string("DEBUG") - ), - ## [optional] : when omitted all monitoring plots for primary vertices - ## will be filled w/o extras - pvExtras = cms.PSet( - ## when omitted electron plots will be filled w/o additional pre- - ## selection of the primary vertex candidates - select = cms.string("abs(x)<1. & abs(y)<1. & abs(z)<20. & tracksSize>3 & !isFake") - ), - ## [optional] : when omitted all monitoring plots for electrons - ## will be filled w/o extras - elecExtras = cms.PSet( - ## when omitted electron plots will be filled w/o cut on electronId - electronId = cms.PSet( src = cms.InputTag("eidRobustLoose"), pattern = cms.int32(1) ), - ## when omitted electron plots will be filled w/o additional pre- - ## selection of the electron candidates - select = cms.string("pt>15 & abs(eta)<2.5 & abs(gsfTrack.d0)<1 & abs(gsfTrack.dz)<20"), - ## when omitted isolated electron multiplicity plot will be equi- - ## valent to inclusive electron multiplicity plot - isolation = cms.string("(dr03TkSumPt+dr04EcalRecHitSumEt+dr04HcalTowerSumEt)/pt<0.1"), - ), - ## [optional] : when omitted all monitoring plots for muons - ## will be filled w/o extras - muonExtras = cms.PSet( - ## when omitted muon plots will be filled w/o additional pre- - ## selection of the muon candidates - select = cms.string("pt>10 & abs(eta)<2.1 & isGlobalMuon & abs(globalTrack.d0)<1 & abs(globalTrack.dz)<20"), - ## when omitted isolated muon multiplicity plot will be equi- - ## valent to inclusive muon multiplicity plot - isolation = cms.string("(isolationR03.sumPt+isolationR03.emEt+isolationR03.hadEt)/pt<0.1"), - ), - ## [optional] : when omitted all monitoring plots for jets will - ## be filled from uncorrected jets - jetExtras = cms.PSet( - ## when omitted monitor plots for pt will be filled from uncorrected - ## jets - jetCorrector = cms.string("ak5CaloL2L3"), - ## when omitted monitor plots will be filled w/o additional cut on - ## jetID - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - ## when omitted no extra selection will be applied on jets before - ## filling the monitor histograms; if jetCorrector is present the - ## selection will be applied to corrected jets - select = cms.string("pt>15 & abs(eta)<2.5 & emEnergyFraction>0.01"), - ), - ## [optional] : when omitted no mass window will be applied - ## for the W mass befor filling the event monitoring plots - massExtras = cms.PSet( - lowerEdge = cms.double( 70.), - upperEdge = cms.double(110.) - ), - ## [optional] : when omitted the monitoring plots for triggering - ## will be empty - triggerExtras = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - paths = cms.vstring(['HLT_Mu3:HLT_QuadJet15U', - 'HLT_Mu5:HLT_QuadJet15U', - 'HLT_Mu7:HLT_QuadJet15U', - 'HLT_Mu9:HLT_QuadJet15U']) - ) - ), - ## ------------------------------------------------------ - ## PRESELECTION - ## - ## setup of the event preselection, which will not - ## be monitored - ## [mandatory] : but may be empty - ## - preselection = cms.PSet( - trigger = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - select = cms.vstring(['HLT_Iso10Mu20_eta2p1_CentralPFJet30_BTagIPIter_v1'])#ONLY ONE PATH - ), - ## [optional] : when omitted no preselection is applied - vertex = cms.PSet( - src = cms.InputTag("offlinePrimaryVertices"), - select = cms.string('abs(x)<1. & abs(y)<1. & abs(z)<20. & tracksSize>3 & !isFake') - ) - ), - ## ------------------------------------------------------ - ## SELECTION - ## - ## monitor histrograms are filled after each selection - ## step, the selection is applied in the order defined - ## by this vector - ## [mandatory] : may be empty or contain an arbitrary - ## number of PSets - ## - selection = cms.VPSet( - cms.PSet( - label = cms.string("Hlt:step0"), - src = cms.InputTag(""), - select = cms.string(""), - min = cms.int32(0), - max = cms.int32(0), - ), - cms.PSet( - label = cms.string("jets/calo:step1"), - src = cms.InputTag("ak5CaloJets"), - select = cms.string("pt>20 & abs(eta)<2.1 & 0.051 & restrictedEMF<1") - ), - min = cms.int32(2), - ), - ) -) - -topSingleMuonLooseTriggerDQM = cms.EDAnalyzer("TopHLTSingleLeptonDQM", - ## ------------------------------------------------------ - ## SETUP - ## - ## configuration of the MonitoringEnsemble(s) - ## [mandatory] : optional PSets may be omitted - ## - setup = cms.PSet( - ## sub-directory to write the monitor histograms to - ## [mandatory] : should not be changed w/o explicit - ## communication to TopCom! - directory = cms.string("HLTriggerOffline/Top/TopSingleMuonLooseTriggerDQM/"), - ## [mandatory] - sources = cms.PSet( - muons = cms.InputTag("muons"), - elecs = cms.InputTag("gedGsfElectrons"), - jets = cms.InputTag("ak5CaloJets"), - mets = cms.VInputTag("met", "tcMet", "pfMet"), - pvs = cms.InputTag("offlinePrimaryVertices") - ), - ## [optional] : when omitted the verbosity level is set to STANDARD - monitoring = cms.PSet( - verbosity = cms.string("DEBUG") - ), - pvExtras = cms.PSet( - ## when omitted electron plots will be filled w/o additional pre- - ## selection of the primary vertex candidates - select = cms.string("abs(x)<1. & abs(y)<1. & abs(z)<20. & tracksSize>3 & !isFake") - ), - ## [optional] : when omitted all monitoring plots for muons - ## will be filled w/o extras - muonExtras = cms.PSet( - ## when omitted muon plots will be filled w/o additional pre- - ## selection of the muon candidates - select = cms.string("pt > 10 & abs(eta)<2.1 & isGlobalMuon & innerTrack.numberOfValidHits>10 & globalTrack.normalizedChi2>-1 & globalTrack.normalizedChi2<10"), - ## when omitted isolated muon multiplicity plot will be equi- - ## valent to inclusive muon multiplicity plot - isolation = cms.string("(isolationR03.sumPt+isolationR03.emEt+isolationR03.hadEt)/pt<0.1") - ), - ## [optional] : when omitted all monitoring plots for jets - ## will be filled w/o extras - jetExtras = cms.PSet( - ## when omitted monitor plots for pt will be filled from uncorrected - ## jets - jetCorrector = cms.string("ak5CaloL2L3"), - ## when omitted monitor plots will be filled w/o additional cut on - ## jetID - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - ## when omitted no extra selection will be applied on jets before - ## filling the monitor histograms; if jetCorrector is present the - ## selection will be applied to corrected jets - select = cms.string("pt>15 & abs(eta)<2.5 & emEnergyFraction>0.01"), - ## when omitted monitor histograms for b-tagging will not be filled - jetBTaggers = cms.PSet( - trackCountingEff = cms.PSet( - label = cms.InputTag("trackCountingHighEffBJetTags" ), - workingPoint = cms.double(1.25) - ), - trackCountingPur = cms.PSet( - label = cms.InputTag("trackCountingHighPurBJetTags" ), - workingPoint = cms.double(3.00) - ), - secondaryVertex = cms.PSet( - label = cms.InputTag("simpleSecondaryVertexHighEffBJetTags"), - workingPoint = cms.double(2.05) - ) - ), - ), - ## [optional] : when omitted no mass window will be applied - ## for the W mass befor filling the event monitoring plots - massExtras = cms.PSet( - lowerEdge = cms.double( 70.), - upperEdge = cms.double(110.) - ), - ## [optional] : when omitted the monitoring plots for triggering - ## will be empty - triggerExtras = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - paths = cms.vstring(['HLT_Mu3:HLT_QuadJet15U', - 'HLT_Mu5:HLT_QuadJet15U', - 'HLT_Mu7:HLT_QuadJet15U', - 'HLT_Mu9:HLT_QuadJet15U', - 'HLT_Mu11:HLT_QuadJet15U']) - ) - ), - ## ------------------------------------------------------ - ## PRESELECTION - ## - ## setup of the event preselection, which will not - ## be monitored - ## [mandatory] : but may be empty - ## - preselection = cms.PSet( - trigger = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - select = cms.vstring(['HLT_Iso10Mu20_eta2p1_CentralPFJet30_BTagIPIter_v1'])#ONLY ONE PATH - ), - ## [optional] : when omitted no preselection is applied - vertex = cms.PSet( - src = cms.InputTag("offlinePrimaryVertices"), - select = cms.string('abs(x)<1. & abs(y)<1. & abs(z)<20. & tracksSize>3 & !isFake') - ) - ), - ## ------------------------------------------------------ - ## SELECTION - ## - ## monitor histrograms are filled after each selection - ## step, the selection is applied in the order defined - ## by this vector - ## [mandatory] : may be empty or contain an arbitrary - ## number of PSets - selection = cms.VPSet( - cms.PSet( - label = cms.string("Hlt:step0"), - src = cms.InputTag(""), - select = cms.string(""), - min = cms.int32(0), - max = cms.int32(0), - ), - cms.PSet( - label = cms.string("muons:step1"), - src = cms.InputTag("muons"), - select = cms.string("pt>10 & abs(eta)<2.1 & isGlobalMuon & innerTrack.numberOfValidHits>10 & globalTrack.normalizedChi2>-1 & globalTrack.normalizedChi2<10"), - min = cms.int32(1), - ), - cms.PSet( - label = cms.string("jets/calo:step2"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>15 & abs(eta)<2.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(1), - ), - cms.PSet( - label = cms.string("jets/calo:step3"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>15 & abs(eta)<2.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(2), - ), - cms.PSet( - label = cms.string("jets/calo:step4"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>15 & abs(eta)<2.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(3), - ), - cms.PSet( - label = cms.string("jets/calo:step5"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>15 & abs(eta)<2.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(4), - ), - ) -) -topSingleMuonMediumTriggerDQM = cms.EDAnalyzer("TopHLTSingleLeptonDQM", - ## ------------------------------------------------------ - ## SETUP - ## - ## configuration of the MonitoringEnsemble(s) - ## [mandatory] : optional PSets may be omitted - ## - setup = cms.PSet( - ## sub-directory to write the monitor histograms to - ## [mandatory] : should not be changed w/o explicit - ## communication to TopCom! - directory = cms.string("HLTriggerOffline/Top/TopSingleMuonMediumTriggerDQM/"), - ## [mandatory] - sources = cms.PSet( - muons = cms.InputTag("muons"), - elecs = cms.InputTag("gedGsfElectrons"), - jets = cms.InputTag("ak5CaloJets"), - mets = cms.VInputTag("met", "tcMet", "pfMet"), - pvs = cms.InputTag("offlinePrimaryVertices") - - ), - ## [optional] : when omitted the verbosity level is set to STANDARD - monitoring = cms.PSet( - verbosity = cms.string("DEBUG") - ), - ## [optional] : when omitted all monitoring plots for primary vertices - ## will be filled w/o extras - pvExtras = cms.PSet( - ## when omitted electron plots will be filled w/o additional pre- - ## selection of the primary vertex candidates - select = cms.string("abs(x)<1. & abs(y)<1. & abs(z)<20. & tracksSize>3 & !isFake") - ), - ## [optional] : when omitted all monitoring plots for muons - ## will be filled w/o extras - muonExtras = cms.PSet( - ## when omitted muon plots will be filled w/o additional pre- - ## selection of the muon candidates - select = cms.string("pt>20 & abs(eta)<2.1 & isGlobalMuon & innerTrack.numberOfValidHits>10 & globalTrack.normalizedChi2>-1 & globalTrack.normalizedChi2<10 & (isolationR03.sumPt+isolationR03.emEt+isolationR03.hadEt)/pt<0.1"), - ## when omitted isolated muon multiplicity plot will be equi- - ## valent to inclusive muon multiplicity plot - isolation = cms.string("(isolationR03.sumPt+isolationR03.emEt+isolationR03.hadEt)/pt<0.1") - ), - ## [optional] : when omitted all monitoring plots for jets - ## will be filled w/o extras - jetExtras = cms.PSet( - ## when omitted monitor plots for pt will be filled from uncorrected - ## jets - jetCorrector = cms.string("ak5CaloL2L3"), - ## when omitted monitor plots will be filled w/o additional cut on - ## jetID - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - ## when omitted no extra selection will be applied on jets before - ## filling the monitor histograms; if jetCorrector is present the - ## selection will be applied to corrected jets - select = cms.string("pt>30 & abs(eta)<2.5& emEnergyFraction>0.01"), - ## when omitted monitor histograms for b-tagging will not be filled - jetBTaggers = cms.PSet( - trackCountingEff = cms.PSet( - label = cms.InputTag("trackCountingHighEffBJetTags" ), - workingPoint = cms.double(1.25) - ), - trackCountingPur = cms.PSet( - label = cms.InputTag("trackCountingHighPurBJetTags" ), - workingPoint = cms.double(3.00) - ), - secondaryVertex = cms.PSet( - label = cms.InputTag("simpleSecondaryVertexHighEffBJetTags"), - workingPoint = cms.double(2.05) - ) - ), - ), - ## [optional] : when omitted no mass window will be applied - ## for the W mass before filling the event monitoring plots - massExtras = cms.PSet( - lowerEdge = cms.double( 70.), - upperEdge = cms.double(110.) - ), - ## [optional] : when omitted the monitoring plots for triggering - ## will be empty - triggerExtras = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - paths = cms.vstring(['HLT_Mu3:HLT_QuadJet15U', - 'HLT_Mu5:HLT_QuadJet15U', - 'HLT_Mu7:HLT_QuadJet15U', - 'HLT_Mu9:HLT_QuadJet15U', - 'HLT_Mu11:HLT_QuadJet15U']) - ) - ), - ## ------------------------------------------------------ - ## PRESELECTION - ## - ## setup of the event preselection, which will not - ## be monitored - ## [mandatory] : but may be empty - ## - preselection = cms.PSet( - trigger = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - select = cms.vstring(['HLT_Iso10Mu20_eta2p1_CentralPFJet30_BTagIPIter_v1'])#ONLY ONE PATH - ), - ## [optional] : when omitted no preselection is applied - vertex = cms.PSet( - src = cms.InputTag("offlinePrimaryVertices"), - select = cms.string('abs(x)<1. & abs(y)<1. & abs(z)<20. & tracksSize>3 & !isFake') - ) - ), - ## ------------------------------------------------------ - ## SELECTION - ## - ## monitor histrograms are filled after each selection - ## step, the selection is applied in the order defined - ## by this vector - ## [mandatory] : may be empty or contain an arbitrary - ## number of PSets - selection = cms.VPSet( - cms.PSet( - label = cms.string("Hlt:step0"), - src = cms.InputTag(""), - select = cms.string(""), - min = cms.int32(0), - max = cms.int32(0), - ), - cms.PSet( - label = cms.string("muons:step1"), - src = cms.InputTag("muons"), - select = cms.string("pt>20 & abs(eta)<2.1 & isGlobalMuon & innerTrack.numberOfValidHits>10 & globalTrack.normalizedChi2>-1 & globalTrack.normalizedChi2<10 & (isolationR03.sumPt+isolationR03.emEt+isolationR03.hadEt)/pt<0.1"), - min = cms.int32(1), - max = cms.int32(1), - ), - cms.PSet( - label = cms.string("jets/calo:step2"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>30 & abs(eta)<2.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(1), - ), - cms.PSet( - label = cms.string("jets/calo:step3"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>30 & abs(eta)<2.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(2), - ), - cms.PSet( - label = cms.string("jets/calo:step4"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>30 & abs(eta)<2.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(3), - ), - cms.PSet( - label = cms.string("jets/calo:step5"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>30 & abs(eta)<2.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(4), - ), - ) -) - -topSingleElectronLooseTriggerDQM = cms.EDAnalyzer("TopHLTSingleLeptonDQM", - ## ------------------------------------------------------ - ## SETUP - ## - ## configuration of the MonitoringEnsemble(s) - ## [mandatory] : optional PSets may be omitted - ## - setup = cms.PSet( - ## sub-directory to write the monitor histograms to - ## [mandatory] : should not be changed w/o explicit - ## communication to TopCom! - directory = cms.string("HLTriggerOffline/Top/TopSingleElectronLooseTriggerDQM/"), - ## [mandatory] - sources = cms.PSet( - muons = cms.InputTag("muons"), - elecs = cms.InputTag("gedGsfElectrons"), - jets = cms.InputTag("ak5CaloJets"), - mets = cms.VInputTag("met", "tcMet", "pfMet"), - pvs = cms.InputTag("offlinePrimaryVertices") - - ), - ## [optional] : when omitted the verbosity level is set to STANDARD - monitoring = cms.PSet( - verbosity = cms.string("DEBUG") - ), - ## [optional] : when omitted all monitoring plots for primary vertices - ## will be filled w/o extras - pvExtras = cms.PSet( - ## when omitted electron plots will be filled w/o additional pre- - ## selection of the primary vertex candidates - select = cms.string("abs(x)<1. & abs(y)<1. & abs(z)<20. & tracksSize>3 & !isFake") - ), - ## [optional] : when omitted all monitoring plots for electrons - ## will be filled w/o extras - elecExtras = cms.PSet( - ## when omitted electron plots will be filled w/o cut on electronId - electronId = cms.PSet( src = cms.InputTag("simpleEleId70cIso"), pattern = cms.int32(1) ), - ## when omitted electron plots will be filled w/o additional pre- - ## selection of the electron candidates - select = cms.string("pt>30 & abs(eta)<2.5"), - ## when omitted isolated electron multiplicity plot will be equi- - ## valent to inclusive electron multiplicity plot - isolation = cms.string("(dr03TkSumPt+dr03EcalRecHitSumEt+dr03HcalTowerSumEt)/pt<0.1"), - ), - ## [optional] : when omitted all monitoring plots for jets - ## will be filled w/o extras - jetExtras = cms.PSet( - ## when omitted monitor plots for pt will be filled from uncorrected - ## jets - jetCorrector = cms.string("ak5CaloL2L3"), - ## when omitted monitor plots will be filled w/o additional cut on - ## jetID - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - ## when omitted no extra selection will be applied on jets before - ## filling the monitor histograms; if jetCorrector is present the - ## selection will be applied to corrected jets - select = cms.string("pt>15 & abs(eta)<2.5 & emEnergyFraction>0.01"), - ## when omitted monitor histograms for b-tagging will not be filled - jetBTaggers = cms.PSet( - trackCountingEff = cms.PSet( - label = cms.InputTag("trackCountingHighEffBJetTags" ), - workingPoint = cms.double(1.25) - ), - trackCountingPur = cms.PSet( - label = cms.InputTag("trackCountingHighPurBJetTags" ), - workingPoint = cms.double(3.00) - ), - secondaryVertex = cms.PSet( - label = cms.InputTag("simpleSecondaryVertexHighEffBJetTags"), - workingPoint = cms.double(2.05) - ) - ), - ), - ## [optional] : when omitted no mass window will be applied - ## for the W mass before filling the event monitoring plots - massExtras = cms.PSet( - lowerEdge = cms.double( 70.), - upperEdge = cms.double(110.) - ), - ## [optional] : when omitted the monitoring plots for triggering - ## will be empty - triggerExtras = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - paths = cms.vstring(['HLT_Ele15_LW_L1R:HLT_QuadJetU15']) - ) - ), - ## ------------------------------------------------------ - ## PRESELECTION - ## - ## setup of the event preselection, which will not - ## be monitored - ## [mandatory] : but may be empty - ## - preselection = cms.PSet( - trigger = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - select = cms.vstring(['HLT_Iso10Mu20_eta2p1_CentralPFJet30_BTagIPIter_v1'])#ONLY ONE PATH - ), - ## [optional] : when omitted no preselection is applied - vertex = cms.PSet( - src = cms.InputTag("offlinePrimaryVertices"), - select = cms.string('abs(x)<1. & abs(y)<1. & abs(z)<20. & tracksSize>3 & !isFake') - ) - ), - ## ------------------------------------------------------ - ## SELECTION - ## - ## monitor histrograms are filled after each selection - ## step, the selection is applied in the order defined - ## by this vector - ## [mandatory] : may be empty or contain an arbitrary - ## number of PSets - selection = cms.VPSet( - cms.PSet( - label = cms.string("Hlt:step0"), - src = cms.InputTag(""), - select = cms.string(""), - min = cms.int32(0), - max = cms.int32(0), - ), - cms.PSet( - label = cms.string("elecs:step1"), - src = cms.InputTag("gedGsfElectrons"), - electronId = cms.PSet( src = cms.InputTag("simpleEleId70cIso"), pattern = cms.int32(1) ), - select = cms.string("pt>15 & abs(eta)<2.5"), - min = cms.int32(1), - ), - cms.PSet( - label = cms.string("jets/calo:step2"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>15 & abs(eta)<2.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(1), - ), - cms.PSet( - label = cms.string("jets/calo:step3"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>15 & abs(eta)<2.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(2), - ), - cms.PSet( - label = cms.string("jets/calo:step4"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>15 & abs(eta)<2.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(3), - ), - cms.PSet( - label = cms.string("jets/calo:step5"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>15 & abs(eta)<2.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(4), - ), - ) -) - -topSingleElectronMediumTriggerDQM = cms.EDAnalyzer("TopHLTSingleLeptonDQM", - ## ------------------------------------------------------ - ## SETUP - ## - ## configuration of the MonitoringEnsemble(s) - ## [mandatory] : optional PSets may be omitted - ## - setup = cms.PSet( - ## sub-directory to write the monitor histograms to - ## [mandatory] : should not be changed w/o explicit - ## communication to TopCom! - directory = cms.string("HLTriggerOffline/Top/TopSingleElectronMediumTriggerDQM/"), - ## [mandatory] - sources = cms.PSet( - muons = cms.InputTag("muons"), - elecs = cms.InputTag("gedGsfElectrons"), - jets = cms.InputTag("ak5CaloJets"), - mets = cms.VInputTag("met", "tcMet", "pfMet"), - pvs = cms.InputTag("offlinePrimaryVertices") - - ), - ## [optional] : when omitted the verbosity level is set to STANDARD - monitoring = cms.PSet( - verbosity = cms.string("DEBUG") - ), - ## [optional] : when omitted all monitoring plots for primary vertices - ## will be filled w/o extras - pvExtras = cms.PSet( - ## when omitted electron plots will be filled w/o additional pre- - ## selection of the primary vertex candidates - select = cms.string("abs(x)<1. & abs(y)<1. & abs(z)<20. & tracksSize>3 & !isFake") - ), - ## [optional] : when omitted all monitoring plots for electrons - ## will be filled w/o extras - elecExtras = cms.PSet( - ## when omitted electron plots will be filled w/o cut on electronId - electronId = cms.PSet( src = cms.InputTag("simpleEleId70cIso"), pattern = cms.int32(1) ), - ## when omitted electron plots will be filled w/o additional pre- - ## selection of the electron candidates - select = cms.string("pt>25 & abs(eta)<2.5 & (dr03TkSumPt+dr03EcalRecHitSumEt+dr03HcalTowerSumEt)/pt<0.1"), - ## when omitted isolated electron multiplicity plot will be equi- - ## valent to inclusive electron multiplicity plot - isolation = cms.string("(dr03TkSumPt+dr03EcalRecHitSumEt+dr03HcalTowerSumEt)/pt<0.1"), - ), - ## [optional] : when omitted all monitoring plots for jets - ## will be filled w/o extras - jetExtras = cms.PSet( - ## when omitted monitor plots for pt will be filled from uncorrected - ## jets - jetCorrector = cms.string("ak5CaloL2L3"), - ## when omitted monitor plots will be filled w/o additional cut on - ## jetID - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - ## when omitted no extra selection will be applied on jets before - ## filling the monitor histograms; if jetCorrector is present the - ## selection will be applied to corrected jets - select = cms.string("pt>15 & abs(eta)<2.5 & emEnergyFraction>0.01"), - ## when omitted monitor histograms for b-tagging will not be filled - jetBTaggers = cms.PSet( - trackCountingEff = cms.PSet( - label = cms.InputTag("trackCountingHighEffBJetTags" ), - workingPoint = cms.double(1.25) - ), - trackCountingPur = cms.PSet( - label = cms.InputTag("trackCountingHighPurBJetTags" ), - workingPoint = cms.double(3.00) - ), - secondaryVertex = cms.PSet( - label = cms.InputTag("simpleSecondaryVertexHighEffBJetTags"), - workingPoint = cms.double(2.05) - ) - ), - ), - ## [optional] : when omitted no mass window will be applied - ## for the W mass before filling the event monitoring plots - massExtras = cms.PSet( - lowerEdge = cms.double( 70.), - upperEdge = cms.double(110.) - ), - ## [optional] : when omitted the monitoring plots for triggering - ## will be empty - triggerExtras = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - paths = cms.vstring([ 'HLT_Ele15_LW_L1R:HLT_QuadJetU15']) - ) - ), - ## ------------------------------------------------------ - ## PRESELECTION - ## - ## setup of the event preselection, which will not - ## be monitored - ## [mandatory] : but may be empty - ## - preselection = cms.PSet( - trigger = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - select = cms.vstring(['HLT_Iso10Mu20_eta2p1_CentralPFJet30_BTagIPIter_v1'])#ONLY ONE PATH - ), - ## [optional] : when omitted no preselection is applied - vertex = cms.PSet( - src = cms.InputTag("offlinePrimaryVertices"), - select = cms.string('abs(x)<1. & abs(y)<1. & abs(z)<20. & tracksSize>3 & !isFake') - ) - ), - ## ------------------------------------------------------ - ## SELECTION - ## - ## monitor histrograms are filled after each selection - ## step, the selection is applied in the order defined - ## by this vector - ## [mandatory] : may be empty or contain an arbitrary - ## number of PSets - selection = cms.VPSet( - cms.PSet( - label = cms.string("Hlt:step0"), - src = cms.InputTag(""), - select = cms.string(""), - min = cms.int32(0), - max = cms.int32(0), - ), - cms.PSet( - label = cms.string("elecs:step1"), - src = cms.InputTag("gedGsfElectrons"), - electronId = cms.PSet( src = cms.InputTag("simpleEleId70cIso"), pattern = cms.int32(1) ), - select = cms.string("pt>25 & abs(eta)<2.5 & (dr03TkSumPt+dr03EcalRecHitSumEt+dr03HcalTowerSumEt)/pt<0.1"), - min = cms.int32(1), - max = cms.int32(1), - ), - cms.PSet( - label = cms.string("jets/calo:step2"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>15 & abs(eta)<2.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(1), - ), - cms.PSet( - label = cms.string("jets/calo:step3"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>15 & abs(eta)<2.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(2), - ), - cms.PSet( - label = cms.string("jets/calo:step4"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>15 & abs(eta)<2.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(3), - ), - cms.PSet( - label = cms.string("jets/calo:step5"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>15 & abs(eta)<2.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(4), - ), - ) -) diff --git a/HLTriggerOffline/Top/python/topSingleLeptonHLTEventValidation_cfi.py b/HLTriggerOffline/Top/python/topSingleLeptonHLTEventValidation_cfi.py new file mode 100644 index 0000000000000..069e65eb958f4 --- /dev/null +++ b/HLTriggerOffline/Top/python/topSingleLeptonHLTEventValidation_cfi.py @@ -0,0 +1,53 @@ +import FWCore.ParameterSet.Config as cms + +# ttbar semi muonique +topSingleMuonHLTValidation = cms.EDAnalyzer('TopSingleLeptonHLTValidation', + # Directory + sDir = cms.untracked.string('HLTValidation/Top/SemiMuonic/'), + # Electrons + sElectrons = cms.untracked.string('gsfElectrons'), + ptElectrons = cms.untracked.double(30.), + etaElectrons = cms.untracked.double(2.5), + isoElectrons = cms.untracked.double(0.1), + minElectrons = cms.untracked.uint32(0), + # Muons + sMuons = cms.untracked.string('muons'), + ptMuons = cms.untracked.double(26.), + etaMuons = cms.untracked.double(2.1), + isoMuons = cms.untracked.double(0.12), + minMuons = cms.untracked.uint32(1), + # Jets + sJets = cms.untracked.string('ak5PFJets'), + ptJets = cms.untracked.double(20.), + etaJets = cms.untracked.double(2.5), + minJets = cms.untracked.uint32(4), + # Trigger + sTrigger = cms.untracked.string("TriggerResults"), + vsPaths = cms.untracked.vstring(['HLT_IsoMu17_eta2p1_TriCentralPFNoPUJet45_35_25','HLT_IsoMu17_eta2p1_TriCentralPFNoPUJet30']), +) + +# ttbar semi electronique +topSingleElectronHLTValidation = cms.EDAnalyzer('TopSingleLeptonHLTValidation', + # Directory + sDir = cms.untracked.string('HLTValidation/Top/SemiElectronic/'), + # Electrons + sElectrons = cms.untracked.string('gsfElectrons'), + ptElectrons = cms.untracked.double(30.), + etaElectrons = cms.untracked.double(2.5), + isoElectrons = cms.untracked.double(0.1), + minElectrons = cms.untracked.uint32(1), + # Muons + sMuons = cms.untracked.string('muons'), + ptMuons = cms.untracked.double(26.), + etaMuons = cms.untracked.double(2.1), + isoMuons = cms.untracked.double(0.12), + minMuons = cms.untracked.uint32(0), + # Jets + sJets = cms.untracked.string('ak5PFJets'), + ptJets = cms.untracked.double(20.), + etaJets = cms.untracked.double(2.5), + minJets = cms.untracked.uint32(4), + # Trigger + sTrigger = cms.untracked.string("TriggerResults"), + vsPaths = cms.untracked.vstring(['HLT_Ele25_CaloIdVT_CaloIsoVL_TrkIdVL_TrkIsoT_TriCentralPFNoPUJet45_35_25','HLT_Ele25_CaloIdVT_CaloIsoVL_TrkIdVL_TrkIsoT_TriCentralPFNoPUJet30']), +) diff --git a/HLTriggerOffline/Top/python/topvalidation_cfi.py b/HLTriggerOffline/Top/python/topvalidation_cfi.py deleted file mode 100644 index a3870fe5c1ad8..0000000000000 --- a/HLTriggerOffline/Top/python/topvalidation_cfi.py +++ /dev/null @@ -1,17 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -HLTTopVal = cms.EDAnalyzer("TopValidation", - OutputMEsInRootFile = cms.bool(False), - TriggerResultsCollection = cms.InputTag("TriggerResults","","HLT"), - hltPaths = cms.vstring('HLT_Mu9','HLT_Mu15','HLT_IsoMu9','HLT_DoubleMu3','HLT_Ele15_SW_L1R', - 'HLT_Ele15_SW_LooseTrackIso_L1R','HLT_DoubleEle10_SW_L1R'), - hltMuonPaths = cms.vstring('HLT_Mu9','HLT_Mu15','HLT_IsoMu9','HLT_DoubleMu3'), - hltEgPaths = cms.vstring('HLT_Ele15_SW_L1R','HLT_Ele15_SW_LooseTrackIso_L1R','HLT_DoubleEle10_SW_L1R'), - hltJetPaths = cms.vstring('HLT_QuadJet30'), - - OutputFileName = cms.string(''), - # DQMFolder = cms.untracked.string("HLT/Top") - FolderName = cms.string("HLT/Top/"), - offlineElectrons = cms.InputTag('gedGsfElectrons') - - ) diff --git a/HLTriggerOffline/Top/python/triggerEff_cfi.py b/HLTriggerOffline/Top/python/triggerEff_cfi.py deleted file mode 100644 index a065304d4d5b6..0000000000000 --- a/HLTriggerOffline/Top/python/triggerEff_cfi.py +++ /dev/null @@ -1,8 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -HLTEff = cms.EDAnalyzer("HLTEffCalculator", - TriggerResCollection = cms.InputTag("TriggerResults","","HLT"), - hltPaths = cms.vstring('HLT_IsoMu24_v15','HLT_IsoMu24_eta2p1_v13','HLT_IsoMu30_v9'), - OutputFileName = cms.string("triggerEfficiency.root"), - verbosity = cms.untracked.int32(0) - ) diff --git a/HLTriggerOffline/Top/src/HLTEfficiencyCalculator.cc b/HLTriggerOffline/Top/src/HLTEfficiencyCalculator.cc deleted file mode 100644 index 060159c0cda61..0000000000000 --- a/HLTriggerOffline/Top/src/HLTEfficiencyCalculator.cc +++ /dev/null @@ -1,82 +0,0 @@ -// -*- C++ -*- -// -// Class: HLTEffCalculator -// -/**\class HLTEffCalculator HLTEffCalculator.cc DQM/HLTEffCalculator/src/HLTEffCalculator.cc - - Description: - - Implementation: - -*/ -// -// Original Author: Abideh Jafari -// Created: Wed Aug 01 09:06:32 CEST 2012 -// -// - - -#include "HLTriggerOffline/Top/interface/HLTEfficiencyCalculator.h" -#include "FWCore/Common/interface/TriggerNames.h" -#include "TFile.h" - - -HLTEffCalculator::HLTEffCalculator(const edm::ParameterSet& iConfig) - -{ - - - outputFileName = iConfig.getParameter("OutputFileName"); - HLTresCollection = iConfig.getParameter("TriggerResCollection"); - verbosity = iConfig.getUntrackedParameter("verbosity",0); - myEffHandler = new EfficiencyHandler("TopHLTs", iConfig.getParameter >("hltPaths"), verbosity); - HLTresCollectionToken_ = consumes(iConfig.getParameter("TriggerResCollection")); -} - -HLTEffCalculator::~HLTEffCalculator() -{ - - // do anything here that needs to be done at desctruction time - // (e.g. close files, deallocate resources etc.) - -} - - -// -// member functions -// - - -// ------------ method called to for each event ------------ -void -HLTEffCalculator::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) -{ - using namespace edm; - - - // Trigger - Handle trh; - iEvent.getByToken(HLTresCollectionToken_,trh); - if( ! trh.isValid() ) { - LogDebug("") << "HL TriggerResults with label ["+HLTresCollection.encode()+"] not found!"; - return; - } - myEffHandler->Fill(iEvent,*trh); - -} - - - -// ------------ method called once each job just before starting event loop ------------ -void -HLTEffCalculator::beginJob() -{} - -// ------------ method called once each job just after ending the event loop ------------ -void -HLTEffCalculator::endJob() { - TFile * F = new TFile(outputFileName.c_str(),"recreate"); - myEffHandler->WriteAll(F); - F->Save(); -} - diff --git a/HLTriggerOffline/Top/src/TopHLTDQMHelper.cc b/HLTriggerOffline/Top/src/TopHLTDQMHelper.cc deleted file mode 100644 index 6c7772c9fcba7..0000000000000 --- a/HLTriggerOffline/Top/src/TopHLTDQMHelper.cc +++ /dev/null @@ -1,149 +0,0 @@ -#include "HLTriggerOffline/Top/interface/TopHLTDQMHelper.h" -#include -/*Originally from DQM/Physics package, written by Roger Wolf and Jeremy Andrea*/ - -using namespace std; - -CalculateHLT::CalculateHLT(int maxNJets, double wMass): - failed_(false), maxNJets_(maxNJets), wMass_(wMass), massWBoson_(-1.), massTopQuark_(-1.),tmassWBoson_(-1),tmassTopQuark_(-1),mlb_(-1) -{ -} - - -double -CalculateHLT::massWBoson(const std::vector& jets) -{ - if(!failed_&& massWBoson_<0) operator()(jets); return massWBoson_; -} - - -double -CalculateHLT::massTopQuark(const std::vector& jets) -{ - if(!failed_&& massTopQuark_<0) operator()(jets); return massTopQuark_; -} - -/* -double -Calculate::tmassWBoson(const T& mu, const reco::MET& met, const reco::Jet& b) -{ - if(!failed_&& tmassWBoson_<0) operator()(b,mu,met); return tmassWBoson_; -} - - -double -Calculate::masslb(const T& mu, const reco::MET& met, const reco::Jet& b) -{ - if(!failed_&& mlb_<0) operator()(b,mu,met); return mlb_; -} - - -double -Calculate::tmassTopQuark(const T& lepton, const reco::MET& met, const reco::Jet& b) -{ - if(!failed_&& tmassTopQuark_<0) operator()(b,lepton,met); return tmassTopQuark_; -} - - -void Calculate::operator()( const reco::Jet& bJet, const T& lepton, const reco::MET& met){ - reco::Particle::LorentzVector WT = lepton.p4() + met.p4(); - tmassWBoson_ = sqrt((WT.px()*WT.px()) + (WT.py()*WT.py())); - reco::Particle::LorentzVector topT = WT + bJet.p4(); - tmassTopQuark_ = sqrt((topT.px()*topT.px()) + (topT.py()*topT.py())); - reco::Particle::LorentzVector lb = bJet.p4() + lepton.p4(); - mlb_ = lb.mass(); -}*/ - - -double -CalculateHLT::tmassWBoson(reco::RecoCandidate* mu, const reco::MET& met, const reco::Jet& b) -{ - if(!failed_&& tmassWBoson_<0) operator()(b,mu,met); return tmassWBoson_; -} - - -double -CalculateHLT::masslb(reco::RecoCandidate* mu, const reco::MET& met, const reco::Jet& b) -{ - if(!failed_&& mlb_<0) operator()(b,mu,met); return mlb_; -} - - -double -CalculateHLT::tmassTopQuark(reco::RecoCandidate* lepton, const reco::MET& met, const reco::Jet& b) -{ - if(!failed_&& tmassTopQuark_<0) operator()(b,lepton,met); return tmassTopQuark_; -} - - -void CalculateHLT::operator()( const reco::Jet& bJet, reco::RecoCandidate* lepton, const reco::MET& met){ - double metT = sqrt(pow(met.px(),2) + pow(met.py(),2)); - double lepT = sqrt(pow(lepton->px(),2) + pow(lepton->py(),2)); - double bT = sqrt(pow(bJet.px(),2) + pow(bJet.py(),2)); - reco::Particle::LorentzVector WT = lepton->p4() + met.p4(); - // cout<<"in calculate:\n\t"<pt()<<"\t"<p4(); - mlb_ = lb.mass(); -} - - -void -CalculateHLT::operator()(const std::vector& jets) -{ - - if(maxNJets_<0) maxNJets_=jets.size(); - failed_= jets.size()<(unsigned int) maxNJets_; - if( failed_){ return; } - - // associate those jets with maximum pt of the vectorial - // sum to the hadronic decay chain - double maxPt=-1.; - std::vector maxPtIndices; - maxPtIndices.push_back(-1); - maxPtIndices.push_back(-1); - maxPtIndices.push_back(-1); - for(int idx=0; idx wMassIndices; - wMassIndices.push_back(-1); - wMassIndices.push_back(-1); - for(unsigned idx=0; idxmaxPtIndices[jdx] ) continue; - reco::Particle::LorentzVector sum = jets[maxPtIndices[idx]].p4()+jets[maxPtIndices[jdx]].p4(); - if( wDist<0. || wDist>fabs(sum.mass()-wMass_) ){ - wDist=fabs(sum.mass()-wMass_); - wMassIndices.clear(); - wMassIndices.push_back(maxPtIndices[idx]); - wMassIndices.push_back(maxPtIndices[jdx]); - } - } - } - massWBoson_= (jets[wMassIndices[0]].p4()+ - jets[wMassIndices[1]].p4()).mass(); -} - - - diff --git a/HLTriggerOffline/Top/src/TopHLTDiLeptonOfflineDQM.cc b/HLTriggerOffline/Top/src/TopHLTDiLeptonOfflineDQM.cc deleted file mode 100644 index 0d01a22762391..0000000000000 --- a/HLTriggerOffline/Top/src/TopHLTDiLeptonOfflineDQM.cc +++ /dev/null @@ -1,738 +0,0 @@ -//#include -#include "JetMETCorrections/Objects/interface/JetCorrectionsRecord.h" -#include "DataFormats/JetReco/interface/CaloJet.h" -#include "DataFormats/BTauReco/interface/JetTag.h" -#include "HLTriggerOffline/Top/src/TopHLTDiLeptonOfflineDQM.h" -#include "DataFormats/JetReco/interface/PFJet.h" -#include "HLTriggerOffline/Top/interface/TopHLTDQMHelper.h" - -/*Originally from DQM/Physics by R. Wolf and J. Andrea*/ - -namespace TopHLTDiLeptonOffline { - - MonitorEnsemble::MonitorEnsemble(const char* label, const edm::ParameterSet& cfg) : - label_(label), eidPattern_(0), elecIso_(0), elecSelect_(0), muonIso_(0), muonSelect_(0), jetIDSelect_(0), - lowerEdge_(-1.), upperEdge_(-1.), elecMuLogged_(0), diMuonLogged_(0), diElecLogged_(0) - { - // sources have to be given; this PSet is not optional - edm::ParameterSet sources=cfg.getParameter("sources"); - muons_= sources.getParameter("muons"); - elecs_= sources.getParameter("elecs"); - jets_ = sources.getParameter("jets" ); - mets_ = sources.getParameter >("mets" ); - - // elecExtras are optional; they may be omitted or empty - if( cfg.existsAs("elecExtras") ){ - edm::ParameterSet elecExtras=cfg.getParameter("elecExtras"); - // select is optional; in case it's not found no - // selection will be applied - if( elecExtras.existsAs("select") ){ - elecSelect_= new StringCutObjectSelector(elecExtras.getParameter("select")); - } - // isolation is optional; in case it's not found no - // isolation will be applied - if( elecExtras.existsAs("isolation") ){ - elecIso_= new StringCutObjectSelector(elecExtras.getParameter("isolation")); - } - // electronId is optional; in case it's not found the - // InputTag will remain empty - if( elecExtras.existsAs("electronId") ){ - edm::ParameterSet elecId=elecExtras.getParameter("electronId"); - electronId_= elecId.getParameter("src"); - eidPattern_= elecId.getParameter("pattern"); - } - } - // muonExtras are optional; they may be omitted or empty - if( cfg.existsAs("muonExtras") ){ - edm::ParameterSet muonExtras=cfg.getParameter("muonExtras"); - // select is optional; in case it's not found no - // selection will be applied - if( muonExtras.existsAs("select") ){ - muonSelect_= new StringCutObjectSelector(muonExtras.getParameter("select")); - } - // isolation is optional; in case it's not found no - // isolation will be applied - if( muonExtras.existsAs("isolation") ){ - muonIso_= new StringCutObjectSelector(muonExtras.getParameter("isolation")); - } - } - // jetExtras are optional; they may be omitted or empty - if( cfg.existsAs("jetExtras") ){ - edm::ParameterSet jetExtras=cfg.getParameter("jetExtras"); - // jetCorrector is optional; in case it's not found - // the InputTag will remain empty - if( jetExtras.existsAs("jetCorrector") ){ - jetCorrector_= jetExtras.getParameter("jetCorrector"); - } - // read jetID information if it exists - if(jetExtras.existsAs("jetID")){ - edm::ParameterSet jetID=jetExtras.getParameter("jetID"); - jetIDLabel_ =jetID.getParameter("label"); - jetIDSelect_= new StringCutObjectSelector(jetID.getParameter("select")); - } - // select is optional; in case it's not found no - // selection will be applied (only implemented for - // CaloJets at the moment) - if( jetExtras.existsAs("select") ){ - jetSelect_= jetExtras.getParameter("select"); - } - } - // triggerExtras are optional; they may be omitted or empty - if( cfg.existsAs("triggerExtras") ){ - edm::ParameterSet triggerExtras=cfg.getParameter("triggerExtras"); - triggerTable_=triggerExtras.getParameter("src"); - elecMuPaths_ =triggerExtras.getParameter >("pathsELECMU"); - diMuonPaths_ =triggerExtras.getParameter >("pathsDIMUON"); - } - // massExtras is optional; in case it's not found no mass - // window cuts are applied for the same flavor monitor - // histograms - if( cfg.existsAs("massExtras") ){ - edm::ParameterSet massExtras=cfg.getParameter("massExtras"); - lowerEdge_= massExtras.getParameter("lowerEdge"); - upperEdge_= massExtras.getParameter("upperEdge"); - } - - // setup the verbosity level for booking histograms; - // per default the verbosity level will be set to - // STANDARD. This will also be the chosen level in - // the case when the monitoring PSet is not found - verbosity_=STANDARD; - if( cfg.existsAs("monitoring") ){ - edm::ParameterSet monitoring=cfg.getParameter("monitoring"); - if(monitoring.getParameter("verbosity") == "DEBUG" ) - verbosity_= DEBUG; - if(monitoring.getParameter("verbosity") == "VERBOSE" ) - verbosity_= VERBOSE; - if(monitoring.getParameter("verbosity") == "STANDARD") - verbosity_= STANDARD; - } - // and don't forget to do the histogram booking - book(cfg.getParameter("directory")); - } - - void - MonitorEnsemble::book(std::string directory) - { - //set up the current directory path - std::string current(directory); current+=label_; - store_=edm::Service().operator->(); - store_->setCurrentFolder(current); - - // determine number of bins for trigger monitoring - unsigned int nElecMu=elecMuPaths_.size(); - unsigned int nDiMuon=diMuonPaths_.size(); - - // --- [STANDARD] --- // - //Run Number - hists_["RunNumb_" ] = store_->book1D("RunNumber" , "Run Nr." , 1.e4, 1.5e5, 3.e5); - // invariant mass of opposite charge lepton pair (only filled for same flavor) - hists_["invMass_" ] = store_->book1D("InvMass" , "M(lep1, lep2)" , 80, 0., 320.); - // invariant mass of opposite charge lepton pair (only filled for same flavor) - hists_["invMassLog_" ] = store_->book1D("InvMassLog" , "log_{10}(M(lep1, lep2))" , 80, .1, 2.5); - // invariant mass of same charge lepton pair (log10 for low mass region, only filled for same flavor) - hists_["invMassWC_" ] = store_->book1D("InvMassWC" , "M_{WC}(L1, L2)" , 80, 0., 320.); - // invariant mass of same charge lepton pair (log10 for low mass region, only filled for same flavor) - hists_["invMassWCLog_"] = store_->book1D("InvMassLogWC", "log_{10}(M_{WC})" , 80, .1, 2.5); - // decay channel [1]: muon/muon, [2]:elec/elec, [3]:elec/muon - hists_["decayChannel_"] = store_->book1D("DecayChannel", "Decay Channel" , 3, 0, 3); - // trigger efficiency estimates for the electron muon channel - hists_["elecMuEff_" ] = store_->book1D("ElecMuEff" , "Eff(e/#mu paths)" , nElecMu, 0., nElecMu); - // monitored trigger occupancy for the electron muon channel - hists_["elecMuMon_" ] = store_->book1D("ElecMuMon" , "Mon(e/#mu paths)" , nElecMu, 0., nElecMu); - // trigger efficiency estimates for the di muon channel - hists_["diMuonEff_" ] = store_->book1D("DiMuonEff" , "Eff(#mu/#mu paths)" , nDiMuon, 0., nDiMuon); - // monitored trigger occupancy for the di muon channel - hists_["diMuonMon_" ] = store_->book1D("DiMuonMon" , "Mon(#mu/#mu paths)" , nDiMuon, 0., nDiMuon); - // pt of the leading lepton - hists_["lep1Pt_" ] = store_->book1D("Lep1Pt" , "pt(lep1)" , 50, 0., 200.); - // pt of the 2. leading lepton - hists_["lep2Pt_" ] = store_->book1D("Lep2Pt" , "pt(lep2)" , 50, 0., 200.); - // multiplicity of jets with pt>30 (corrected to L2+L3) - hists_["jetMult_" ] = store_->book1D("JetMult" , "N_{30}(jet)" , 21, -0.5, 20.5); - // MET (calo) - hists_["metCalo_" ] = store_->book1D("METCalo" , "MET_{Calo}" , 50, 0., 200.); - - // set bin labels for trigger monitoring - triggerBinLabels(std::string("elecMu"), elecMuPaths_); - triggerBinLabels(std::string("diMuon"), diMuonPaths_); - // set bin labels for decayChannel_ - hists_["decayChannel_"]->setBinLabel( 1, "#mu e" , 1); - hists_["decayChannel_"]->setBinLabel( 2, "#mu #mu", 1); - hists_["decayChannel_"]->setBinLabel( 3, "e e" , 1); - - if( verbosity_==STANDARD) return; - - // --- [VERBOSE] --- // - // mean eta of the candidate leptons - hists_["sumEtaL1L2_" ] = store_->book1D("SumEtaL1L2" , "<#eta>(lep1, lep2)" , 100, -5., 5.); - // deltaEta between the 2 candidate leptons - hists_["dEtaL1L2_" ] = store_->book1D("DEtaL1L2" , "#Delta#eta(lep1,lep2)" , 80, -4., 4.); - // deltaPhi between the 2 candidate leptons - hists_["dPhiL1L2_" ] = store_->book1D("DPhiL1L2" , "#Delta#phi(lep1,lep2)" , 64, -3.2, 3.2); - // pt of the candidate electron (depending on the decay channel) - hists_["elecPt_" ] = store_->book1D("ElecPt" , "pt(e)" , 50, 0., 200.); - // relative isolation of the candidate electron (depending on the decay channel) - hists_["elecRelIso_" ] = store_->book1D("ElecRelIso" , "Iso_{Rel}(e)" , 50, 0., 1.); - // pt of the canddiate muon (depending on the decay channel) - hists_["muonPt_" ] = store_->book1D("MuonPt" , "pt(#mu)" , 50, 0., 200.); - // relative isolation of the candidate muon (depending on the decay channel) - hists_["muonRelIso_" ] = store_->book1D("MuonRelIso" , "Iso_{Rel}(#mu)" , 50, 0., 1.); - // pt of the 1. leading jet (corrected to L2+L3) - hists_["jet1Pt_" ] = store_->book1D("Jet1Pt" , "pt_{L2L3}(jet1)" , 60, 0., 300.); - // pt of the 2. leading jet (corrected to L2+L3) - hists_["jet2Pt_" ] = store_->book1D("Jet2Pt" , "pt_{L2L3}(jet2)" , 60, 0., 300.); - // MET (PF) - hists_["metPflow_" ] = store_->book1D("METPflow" , "MET_{Pflow}" , 50, 0., 200.); - // MET (TC) - hists_["metTC_" ] = store_->book1D("METTC" , "MET_{TC}" , 50, 0., 200.); - // dz for muons (to suppress cosmis) - hists_["muonDelZ_" ] = store_->book1D("MuonDelZ" , "d_{z}(#mu)" , 50, -25., 25.); - // dxy for muons (to suppress cosmics) - hists_["muonDelXY_" ] = store_->book2D("MuonDelXY" , "d_{xy}(#mu)" , 50, -1., 1., 50, -1., 1.); - // lepton multiplicity after std isolation - hists_["lepMultIso_" ] = store_->book2D("LepMultIso" , "N_{Iso}(e) vs N_{Iso}(#mu)" , 5, 0., 5., 5, 0., 5.); - - // set axes titles for dxy for muons - hists_["muonDelXY_" ]->setAxisTitle( "x [cm]", 1); hists_["muonDelXY_" ]->setAxisTitle( "y [cm]", 2); - // set axes titles for lepton multiplicity after std isolation - hists_["lepMultIso_" ]->setAxisTitle( "N_{Iso}(#mu)", 1); hists_["lepMultIso_" ]->setAxisTitle( "N_{Iso}(elec)", 2); - - if( verbosity_==VERBOSE) return; - - // --- [DEBUG] --- // - // electron multiplicity after std isolation - hists_["elecMultIso_" ] = store_->book1D("ElecMultIso" , "N_{Iso}(e)" , 11, -0.5, 10.5); - // muon multiplicity after std isolation - hists_["muonMultIso_" ] = store_->book1D("MuonMultIso" , "N_{Iso}(#mu)" , 11, -0.5, 10.5); - // calo isolation of the candidate muon (depending on the decay channel) - hists_["muonCalIso_" ] = store_->book1D("MuonCalIso" , "Iso_{Cal}(#mu)" , 50, 0., 1.); - // track isolation of the candidate muon (depending on the decay channel) - hists_["muonTrkIso_" ] = store_->book1D("MuonTrkIso" , "Iso_{Trk}(#mu)" , 50, 0., 1.); - // calo isolation of the candidate electron (depending on the decay channel) - hists_["elecCalIso_" ] = store_->book1D("ElecCalIso" , "Iso_{Cal}(e)" , 50, 0., 1.); - // track isolation of the candidate electron (depending on the decay channel) - hists_["elecTrkIso_" ] = store_->book1D("ElecTrkIso" , "Iso_{Trk}(e)" , 50, 0., 1.); - // eta of the leading jet - hists_["jet1Eta_" ] = store_->book1D("Jet1Eta" , "#eta(jet1)" , 30, -5., 5.); - // eta of the 2. leading jet - hists_["jet2Eta_" ] = store_->book1D("Jet2Eta" , "#eta(jet2)" , 30, -5., 5.); - // pt of the 1. leading jet (not corrected) - hists_["jet1PtRaw_" ] = store_->book1D("Jet1PtRaw" , "pt_{Raw}(jet1)" , 60, 0., 300.); - // pt of the 2. leading jet (not corrected) - hists_["jet2PtRaw_" ] = store_->book1D("Jet2PtRaw" , "pt_{Raw}(jet2)" , 60, 0., 300.); - // deltaEta between the 2 leading jets - hists_["dEtaJet1Jet2_"] = store_->book1D("DEtaJet1Jet2", "#Delta#eta(jet1,jet2)" , 80, -4., 4.); - // deltaEta between the lepton and the leading jet - hists_["dEtaJet1Lep1_"] = store_->book1D("DEtaJet1Lep1", "#Delta#eta(jet1,lep1)" , 80, -4., 4.); - // deltaEta between the lepton and MET - hists_["dEtaLep1MET_" ] = store_->book1D("DEtaLep1MET" , "#Delta#eta(lep1,MET)" , 80, -4., 4.); - // deltaEta between leading jet and MET - hists_["dEtaJet1MET_" ] = store_->book1D("DEtaJet1MET" , "#Delta#eta(jet1,MET)" , 80, -4., 4.); - // deltaPhi of 2 leading jets - hists_["dPhiJet1Jet2_"] = store_->book1D("DPhiJet1Jet2", "#Delta#phi(jet1,jet2)" , 64, -3.2, 3.2); - // deltaPhi of 1. lepton and 1. jet - hists_["dPhiJet1Lep1_"] = store_->book1D("DPhiJet1Lep1", "#Delta#phi(jet1,lep1)" , 64, -3.2, 3.2); - // deltaPhi of 1. lepton and MET - hists_["dPhiLep1MET_" ] = store_->book1D("DPhiLep1MET" , "#Delta#phi(lep1,MET)" , 64, -3.2, 3.2); - // deltaPhi of 1. jet and MET - hists_["dPhiJet1MET_" ] = store_->book1D("DPhiJet1MET" , "#Delta#phi(jet1,MET)" , 64, -3.2, 3.2); - // selected dimuon events - hists_["diMuonLogger_"] = store_->book2D("DiMuonLogger", "Logged DiMuon Events" , 8, 0., 8., 10, 0., 10.); - // selected dielec events - hists_["diElecLogger_"] = store_->book2D("DiElecLogger", "Logged DiElec Events" , 8, 0., 8., 10, 0., 10.); - // selected elemu events - hists_["elecMuLogger_"] = store_->book2D("ElecMuLogger", "Logged ElecMu Events" , 8, 0., 8., 10, 0., 10.); - - // set bin labels for trigger monitoring - loggerBinLabels(std::string("diMuonLogger_")); - loggerBinLabels(std::string("diElecLogger_")); - loggerBinLabels(std::string("elecMuLogger_")); - return; - } - - void - MonitorEnsemble::fill(const edm::Event& event, const edm::EventSetup& setup, - edm::Handle triggerTable, edm::Handle > muons, - edm::Handle > electronId, edm::Handle > elecs, - edm::Handle > jets, edm::Handle jetID, - std::vector< edm::Handle > > mets) - { - // fetch trigger event if configured such - if(!triggerTable_.label().empty()) { - if( !triggerTable.isValid() ) return; - } - - /* - ------------------------------------------------------------ - - Run and Inst. Luminosity information (Inst. Lumi. filled now with a dummy value=5.0) - - ------------------------------------------------------------ - */ - - if (!event.eventAuxiliary().run()) return; - fill("RunNumb_", event.eventAuxiliary().run()); - - double dummy=5.; fill("InstLumi_", dummy); - - - /* - ------------------------------------------------------------ - - Muon Selection - - ------------------------------------------------------------ - */ - - // buffer isolated muons - std::vector isoMuons; - - if( !muons.isValid() ) return; - - for(edm::View::const_iterator muon=muons->begin(); muon!=muons->end(); ++muon){ - // restrict to globalMuons - if( muon->isGlobalMuon() ){ - fill("muonDelZ_" , muon->globalTrack()->vz()); - fill("muonDelXY_", muon->globalTrack()->vx(), muon->globalTrack()->vy()); - // apply preselection - if(!muonSelect_ || (*muonSelect_)(*muon)){ - double isolationTrk = muon->pt()/(muon->pt()+muon->isolationR03().sumPt); - double isolationCal = muon->pt()/(muon->pt()+muon->isolationR03().emEt+muon->isolationR03().hadEt); - double isolationRel = (muon->isolationR03().sumPt+muon->isolationR03().emEt+muon->isolationR03().hadEt)/muon->pt(); - fill("muonTrkIso_" , isolationTrk); fill("muonCalIso_" , isolationCal); fill("muonRelIso_" , isolationRel); - if(!muonIso_ || (*muonIso_)(*muon)) isoMuons.push_back(&(*muon)); - } - } - } - fill("muonMultIso_", isoMuons.size()); - - /* - ------------------------------------------------------------ - - Electron Selection - - ------------------------------------------------------------ - */ - - // buffer isolated electronss - std::vector isoElecs; - if(!electronId_.label().empty()) { - if( !electronId.isValid() ) return; - } - - if( !elecs.isValid() ) return; - - for(edm::View::const_iterator elec=elecs->begin(); elec!=elecs->end(); ++elec){ - // restrict to electrons with good electronId - int idx = elec-elecs->begin(); - if( electronId_.label().empty() ? true : ((int)(*electronId)[elecs->refAt(idx)] & eidPattern_) ){ - // apply preselection - if(!elecSelect_ || (*elecSelect_)(*elec)){ - double isolationTrk = elec->pt()/(elec->pt()+elec->dr03TkSumPt()); - double isolationCal = elec->pt()/(elec->pt()+elec->dr03EcalRecHitSumEt()+elec->dr03HcalTowerSumEt()); - double isolationRel = (elec->dr03TkSumPt()+elec->dr03EcalRecHitSumEt()+elec->dr03HcalTowerSumEt())/elec->pt(); - fill("elecTrkIso_" , isolationTrk); fill("elecCalIso_" , isolationCal); fill("elecRelIso_" , isolationRel); - if(!elecIso_ || (*elecIso_)(*elec)) isoElecs.push_back(&(*elec)); - } - } - } - fill("elecMultIso_", isoElecs.size()); - - /* - ------------------------------------------------------------ - - Jet Selection - - ------------------------------------------------------------ - */ - - const JetCorrector* corrector=0; - if(!jetCorrector_.empty()){ - // check whether a jet correcto is in the event setup or not - if(setup.find( edm::eventsetup::EventSetupRecordKey::makeKey() )){ - corrector = JetCorrector::getJetCorrector(jetCorrector_, setup); - } - else{ - edm::LogVerbatim( "TopHLTDiLeptonOfflineDQM" ) - << "\n" - << "------------------------------------------------------------------------------------- \n" - << " No JetCorrectionsRecord available from EventSetup: \n" - << " - Jets will not be corrected. \n" - << " - If you want to change this add the following lines to your cfg file: \n" - << " \n" - << " ## load jet corrections \n" - << " process.load(\"JetMETCorrections.Configuration.JetCorrectionServicesAllAlgos_cff\") \n" - << " process.prefer(\"ak5CaloL2L3\") \n" - << " \n" - << "------------------------------------------------------------------------------------- \n"; - } - } - - unsigned int mult=0; - // buffer leadingJets - std::vector leadingJets; - if( !jets.isValid() ) return; - - if(jetIDSelect_){ - if( !jetID.isValid() ) return; - } - - for(edm::View::const_iterator jet=jets->begin(); jet!=jets->end(); ++jet){ - unsigned int idx=jet-jets->begin(); - if( jetIDSelect_ && dynamic_cast(jets->refAt(idx).get())){ - if(!(*jetIDSelect_)((*jetID)[jets->refAt(idx)])) continue; - } - // chekc additional jet selection for calo, pf and bare reco jets - if(dynamic_cast(&*jet)){ - reco::CaloJet sel = dynamic_cast(*jet); sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.); - StringCutObjectSelector jetSelect(jetSelect_); if(!jetSelect(sel)){ continue;} - } - else if(dynamic_cast(&*jet)){ - reco::PFJet sel= dynamic_cast(*jet); sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.); - StringCutObjectSelector jetSelect(jetSelect_); if(!jetSelect(sel)) continue; - } - else{ - reco::Jet sel = *jet; sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.); - StringCutObjectSelector jetSelect(jetSelect_); if(!jetSelect(sel)) continue; - } - // check for overlaps - bool overlap=false; - for(std::vector::const_iterator elec=isoElecs.begin(); elec!=isoElecs.end(); ++elec){ - if(reco::deltaR((*elec)->eta(), (*elec)->phi(), jet->eta(), jet->phi())<0.4){overlap=true; break;} - } if(overlap){continue;} - // prepare jet to fill monitor histograms - reco::Jet monitorJet=*jet; monitorJet.scaleEnergy(corrector ? corrector->correction(*jet) : 1.); - ++mult; // determine jet multiplicity - if(idx==0) { - leadingJets.push_back(monitorJet); - fill("jet1Pt_" , monitorJet.pt()); - fill("jet1PtRaw_" , jet->pt() ); - fill("jet1Eta_" , jet->eta()); - } - if(idx==1) { - leadingJets.push_back(monitorJet); - fill("jet2Pt_" , monitorJet.pt()); - fill("jet2PtRaw_" , jet->pt() ); - fill("jet2Eta_" , jet->eta()); - } - } - if(leadingJets.size()>1){ - fill("dEtaJet1Jet2_" , leadingJets[0].eta()-leadingJets[1].eta()); - fill("dPhiJet1Jet2_" , reco::deltaPhi(leadingJets[0].phi(), leadingJets[1].phi())); - if( !isoMuons.empty() ){ - if( isoElecs.empty() || isoMuons[0]->pt()>isoElecs[0]->pt() ){ - fill("dEtaJet1Lep1_" , isoMuons[0]->eta()-leadingJets[0].eta()); - fill("dPhiJet1Lep1_" , reco::deltaPhi(isoMuons[0]->phi() , leadingJets[0].phi())); - } - } - if( !isoElecs.empty() ){ - if( isoMuons.empty() || isoElecs[0]->pt()>isoMuons[0]->pt() ){ - fill("dEtaJet1Lep1_" , isoElecs[0]->eta()-leadingJets[0].eta()); - fill("dPhiJet1Lep1_" , reco::deltaPhi(isoElecs[0]->phi() , leadingJets[0].phi())); - } - } - } - fill("jetMult_", mult); - - /* - ------------------------------------------------------------ - - MET Selection - - ------------------------------------------------------------ - */ - - // buffer for event logging - reco::MET caloMET; - //for(std::vector::const_iterator met_=mets_.begin(); met_!=mets_.end(); ++met_){ - //for( met_=mets_.begin(); met_!=mets_.end(); ++met_){ - for( int i=0; i > met = mets[i]; - if( !met.isValid() ) continue; - - if(met->begin()!=met->end()){ - unsigned int idx=i; - if(idx==0){ - caloMET=*met->begin(); - fill("metCalo_", met->begin()->et()); - if(!leadingJets.empty()){ - fill("dEtaJet1MET_" , leadingJets[0].eta()-met->begin()->eta()); - fill("dPhiJet1MET_" , reco::deltaPhi(leadingJets[0].phi(), met->begin()->phi())); - } - if( !isoMuons.empty() ){ - if( isoElecs.empty() || isoMuons[0]->pt()>isoElecs[0]->pt() ){ - fill("dEtaLep1MET_" , isoMuons[0]->eta()-met->begin()->eta()); - fill("dPhiLep1MET_" , reco::deltaPhi(isoMuons[0]->phi(), met->begin()->phi())); - } - } - if( !isoElecs.empty() ){ - if( isoMuons.empty() || isoElecs[0]->pt()>isoMuons[0]->pt() ){ - fill("dEtaLep1MET_" , isoElecs[0]->eta()-met->begin()->eta()); - fill("dPhiLep1MET_" , reco::deltaPhi(isoElecs[0]->phi(), met->begin()->phi())); - } - } - } - if(idx==1){ fill("metTC_" , met->begin()->et());} - if(idx==2){ fill("metPflow_", met->begin()->et());} - } - } - - - /* - ------------------------------------------------------------ - - Event Monitoring - - ------------------------------------------------------------ - */ - - // check number of isolated leptons - fill("lepMultIso_", isoMuons.size(), isoElecs.size()); - // ELECMU channel - if( decayChannel(isoMuons, isoElecs) == ELECMU ){ - fill("decayChannel_", 0.5); - double mass = (isoElecs[0]->p4()+isoMuons[0]->p4()).mass(); - if( (lowerEdge_==-1. && upperEdge_==-1.) || (lowerEdge_eta()-isoMuons[0]->eta()); - fill("sumEtaL1L2_", (isoElecs[0]->eta()+isoMuons[0]->eta())/2); - fill("dPhiL1L2_" , reco::deltaPhi(isoElecs[0]->phi(), isoMuons[0]->eta())); - fill("elecPt_", isoElecs[0]->pt()); fill("muonPt_", isoMuons[0]->pt()); - fill("lep1Pt_", isoElecs[0]->pt()>isoMuons[0]->pt() ? isoElecs[0]->pt() : isoMuons[0]->pt()); - fill("lep2Pt_", isoElecs[0]->pt()>isoMuons[0]->pt() ? isoMuons[0]->pt() : isoElecs[0]->pt()); - // fill plots for trigger monitoring - if(!triggerTable_.label().empty()) fill(event, *triggerTable, "elecMu", elecMuPaths_); - if(elecMuLogged_<=hists_.find("elecMuLogger_")->second->getNbinsY()){ - // log runnumber, lumi block, event number & some - // more pysics infomation for interesting events - fill("elecMuLogger_", 0.5, elecMuLogged_+0.5, event.eventAuxiliary().run()); - fill("elecMuLogger_", 1.5, elecMuLogged_+0.5, event.eventAuxiliary().luminosityBlock()); - fill("elecMuLogger_", 2.5, elecMuLogged_+0.5, event.eventAuxiliary().event()); - fill("elecMuLogger_", 3.5, elecMuLogged_+0.5, isoMuons[0]->pt()); - fill("elecMuLogger_", 4.5, elecMuLogged_+0.5, isoElecs[0]->pt()); - if(leadingJets.size()>0) fill("elecMuLogger_", 5.5, elecMuLogged_+0.5, leadingJets[0].pt()); - if(leadingJets.size()>1) fill("elecMuLogger_", 6.5, elecMuLogged_+0.5, leadingJets[1].pt()); - fill("elecMuLogger_", 7.5, elecMuLogged_+0.5, caloMET.et()); - ++elecMuLogged_; - } - } - } - - // DIMUON channel - if( decayChannel(isoMuons, isoElecs) == DIMUON ){ - fill("decayChannel_", 1.5); - int charge = isoMuons[0]->charge()*isoMuons[1]->charge(); - double mass = (isoMuons[0]->p4()+isoMuons[1]->p4()).mass(); - - fill(charge<0 ? "invMass_" : "invMassWC_" , mass ); - fill(charge<0 ? "invMassLog_" : "invMassWCLog_" , log10(mass)); - if((lowerEdge_==-1. && upperEdge_==-1.) || (lowerEdge_eta()-isoMuons[1]->eta() ); - fill("sumEtaL1L2_", (isoMuons[0]->eta()+isoMuons[1]->eta())/2); - fill("dPhiL1L2_", reco::deltaPhi(isoMuons[0]->phi(),isoMuons[1]->phi()) ); - fill("muonPt_", isoMuons[0]->pt()); fill("muonPt_", isoMuons[1]->pt()); - fill("lep1Pt_", isoMuons[0]->pt()); fill("lep2Pt_", isoMuons[1]->pt()); - // fill plots for trigger monitoring - if(!triggerTable_.label().empty()) fill(event, *triggerTable, "diMuon", diMuonPaths_); - if(diMuonLogged_<=hists_.find("diMuonLogger_")->second->getNbinsY()){ - // log runnumber, lumi block, event number & some - // more pysics infomation for interesting events - fill("diMuonLogger_", 0.5, diMuonLogged_+0.5, event.eventAuxiliary().run()); - fill("diMuonLogger_", 1.5, diMuonLogged_+0.5, event.eventAuxiliary().luminosityBlock()); - fill("diMuonLogger_", 2.5, diMuonLogged_+0.5, event.eventAuxiliary().event()); - fill("diMuonLogger_", 3.5, diMuonLogged_+0.5, isoMuons[0]->pt()); - fill("diMuonLogger_", 4.5, diMuonLogged_+0.5, isoMuons[1]->pt()); - if(leadingJets.size()>0) fill("diMuonLogger_", 5.5, diMuonLogged_+0.5, leadingJets[0].pt()); - if(leadingJets.size()>1) fill("diMuonLogger_", 6.5, diMuonLogged_+0.5, leadingJets[1].pt()); - fill("diMuonLogger_", 7.5, diMuonLogged_+0.5, caloMET.et()); - ++diMuonLogged_; - } - } - } - - // DIELEC channel - if( decayChannel(isoMuons, isoElecs) == DIELEC ){ - fill("decayChannel_", 2.5); - int charge = isoElecs[0]->charge()*isoElecs[1]->charge(); - double mass = (isoElecs[0]->p4()+isoElecs[1]->p4()).mass(); - fill(charge<0 ? "invMass_" : "invMassWC_" , mass ); - fill(charge<0 ? "invMassLog_" : "invMassWCLog_" , log10(mass)); - if((lowerEdge_==-1. && upperEdge_==-1.) || (lowerEdge_eta()-isoElecs[1]->eta() ); - fill("sumEtaL1L2_", (isoElecs[0]->eta()+isoElecs[1]->eta())/2); - fill("dPhiL1L2_" , reco::deltaPhi(isoElecs[0]->phi(),isoElecs[1]->phi()) ); - fill("elecPt_", isoElecs[0]->pt()); fill("elecPt_", isoElecs[1]->pt()); - fill("lep1Pt_", isoElecs[0]->pt()); fill("lep2Pt_", isoElecs[1]->pt()); - if(diElecLogged_<=hists_.find("diElecLogger_")->second->getNbinsY()){ - // log runnumber, lumi block, event number & some - // more pysics infomation for interesting events - fill("diElecLogger_", 0.5, diElecLogged_+0.5, event.eventAuxiliary().run()); - fill("diElecLogger_", 1.5, diElecLogged_+0.5, event.eventAuxiliary().luminosityBlock()); - fill("diElecLogger_", 2.5, diElecLogged_+0.5, event.eventAuxiliary().event()); - fill("diElecLogger_", 3.5, diElecLogged_+0.5, isoElecs[0]->pt()); - fill("diElecLogger_", 4.5, diElecLogged_+0.5, isoElecs[1]->pt()); - if(leadingJets.size()>0) fill("diElecLogger_", 5.5, diElecLogged_+0.5, leadingJets[0].pt()); - if(leadingJets.size()>1) fill("diElecLogger_", 6.5, diElecLogged_+0.5, leadingJets[1].pt()); - fill("diElecLogger_", 7.5, diElecLogged_+0.5, caloMET.et()); - ++diElecLogged_; - } - } - } - } - -} - -TopHLTDiLeptonOfflineDQM::TopHLTDiLeptonOfflineDQM(const edm::ParameterSet& cfg): triggerTable_(""), vertex_(""), vertexSelect_(0), beamspotSelect_(0) -{ - edm::ParameterSet sources=cfg.getParameter("sources"); - muonsToken_ = consumes< edm::View >(sources.getParameter("muons")); - elecsToken_ = consumes< edm::View >(sources.getParameter("elecs")); - jetsToken_ = consumes< edm::View >(sources.getParameter("jets" )); - - metsTemp_ = sources.getParameter >("mets" ); - - metsTokens_.resize( metsTemp_.size() ); - for( int i=0; i >(metsTemp_[i]); - - // configure the preselection - edm::ParameterSet presel=cfg.getParameter("preselection"); - if( presel.existsAs("trigger") ){ - edm::ParameterSet trigger=presel.getParameter("trigger"); - triggerTable_=trigger.getParameter("src"); - triggerTableToken_ = consumes(trigger.getParameter("src")); - triggerPaths_=trigger.getParameter >("select"); - } - if( presel.existsAs("vertex" ) ){ - edm::ParameterSet vertex=presel.getParameter("vertex"); - vertex_= vertex.getParameter("src"); - vertexToken_= consumes< std::vector >(vertex.getParameter("src")); - vertexSelect_= new StringCutObjectSelector(vertex.getParameter("select")); - } - if( presel.existsAs("beamspot" ) ){ - edm::ParameterSet beamspot=presel.getParameter("beamspot"); - beamspot_= beamspot.getParameter("src"); - beamspotToken_= consumes(beamspot.getParameter("src")); - beamspotSelect_= new StringCutObjectSelector(beamspot.getParameter("select")); - } - - // elecExtras are optional; they may be omitted or empty - if( cfg.existsAs("elecExtras") ){ - edm::ParameterSet elecExtras=cfg.getParameter("elecExtras"); - // electronId is optional; in case it's not found the - // InputTag will remain empty - if( elecExtras.existsAs("electronId") ){ - edm::ParameterSet elecId=elecExtras.getParameter("electronId"); - electronIdToken_= consumes< edm::ValueMap >(elecId.getParameter("src")); - } - } - - // jetExtras are optional; they may be omitted or empty - if( cfg.existsAs("jetExtras") ){ - edm::ParameterSet jetExtras=cfg.getParameter("jetExtras"); - // read jetID information if it exists - if(jetExtras.existsAs("jetID")){ - edm::ParameterSet jetID=jetExtras.getParameter("jetID"); - jetIDToken_ = consumes(jetID.getParameter("label")); - } - } - - // conifgure the selection - std::vector sel=cfg.getParameter >("selection"); - for(unsigned int i=0; i("label")); - selection_[selectionStep(selectionOrder_.back())] = std::make_pair(sel.at(i), new TopHLTDiLeptonOffline::MonitorEnsemble(selectionStep(selectionOrder_.back()).c_str(), cfg.getParameter("setup"))); - } -} - -void -TopHLTDiLeptonOfflineDQM::analyze(const edm::Event& event, const edm::EventSetup& setup) -{ - edm::Handle triggerTable; - edm::Handle > vertex; - edm::Handle beamspot; - - edm::Handle > muons; - event.getByToken(muonsToken_, muons); - - edm::Handle > electronId; - event.getByToken(electronIdToken_, electronId); - - edm::Handle > elecs; - event.getByToken(elecsToken_, elecs); - - edm::Handle > jets; - event.getByToken(jetsToken_, jets); - - edm::Handle jetID; - event.getByToken(jetIDToken_, jetID); - - std::vector< edm::Handle > > mets; - for( int i=0; iempty() || !(*vertexSelect_)(vertex->front())) return; - } - if(!beamspot_.label().empty()){ - if( !event.getByToken(beamspotToken_, beamspot) ) return; - if(!(*beamspotSelect_)(*beamspot)) return; - } - - // apply selection steps - for(std::vector::const_iterator selIt=selectionOrder_.begin(); selIt!=selectionOrder_.end(); ++selIt){ - std::string key = selectionStep(*selIt), type = objectType(*selIt); - if(selection_.find(key)!=selection_.end()){ - if(type=="empty"){ - selection_[key].second->fill(event, setup, triggerTable, muons, electronId, elecs, jets, jetID, mets); - } - if(type=="Hlt" ){ -// cout<<"HLT filled"<fill(event, setup, triggerTable, muons, electronId, elecs, jets, jetID, mets); - } - if(type=="muons"){ - SelectionStepHLT step(selection_[key].first, consumesCollector()); - if(step.select(event)){ - selection_[key].second->fill(event, setup, triggerTable, muons, electronId, elecs, jets, jetID, mets); - } else break; - } - if(type=="elecs"){ - SelectionStepHLT step(selection_[key].first, consumesCollector()); - if(step.select(event)){ - selection_[key].second->fill(event, setup, triggerTable, muons, electronId, elecs, jets, jetID, mets); - } else break; - } - if(type=="jets" ){ - SelectionStepHLT step(selection_[key].first, consumesCollector()); - if(step.select(event, setup)){ - selection_[key].second->fill(event, setup, triggerTable, muons, electronId, elecs, jets, jetID, mets); - } else break; - } - if(type=="jets/pf" ){ - SelectionStepHLT step(selection_[key].first, consumesCollector()); - if(step.select(event, setup)){ - selection_[key].second->fill(event, setup, triggerTable, muons, electronId, elecs, jets, jetID, mets); - } else break; - } - if(type=="jets/calo" ){ - SelectionStepHLT step(selection_[key].first, consumesCollector()); - if(step.select(event, setup)){ - selection_[key].second->fill(event, setup, triggerTable, muons, electronId, elecs, jets, jetID, mets); - } else break; - } - if(type=="met" ){ - SelectionStepHLT step(selection_[key].first, consumesCollector()); - if(step.select(event)){ - selection_[key].second->fill(event, setup, triggerTable, muons, electronId, elecs, jets, jetID, mets); - } else break; - } - } - } -} - - diff --git a/HLTriggerOffline/Top/src/TopHLTDiLeptonOfflineDQM.h b/HLTriggerOffline/Top/src/TopHLTDiLeptonOfflineDQM.h deleted file mode 100644 index 6968efae7440f..0000000000000 --- a/HLTriggerOffline/Top/src/TopHLTDiLeptonOfflineDQM.h +++ /dev/null @@ -1,316 +0,0 @@ -#ifndef TOPHLTDILEPTONOFFLINEDQM -#define TOPHLTDILEPTONOFFLINEDQM - -#include -#include - -#include "FWCore/Framework/interface/Event.h" -#include "DQMServices/Core/interface/DQMStore.h" -#include "DQMServices/Core/interface/MonitorElement.h" - -#include "DataFormats/Math/interface/deltaR.h" -#include "DataFormats/JetReco/interface/Jet.h" -#include "HLTriggerOffline/Top/interface/TopHLTDQMHelper.h" -#include "DataFormats/MuonReco/interface/Muon.h" -#include "DataFormats/Common/interface/ValueMap.h" -#include "DataFormats/METReco/interface/CaloMET.h" -#include "JetMETCorrections/Objects/interface/JetCorrector.h" -#include "DataFormats/EgammaCandidates/interface/GsfElectron.h" - - -#include "DataFormats/MuonReco/interface/MuonFwd.h" -#include "DataFormats/MuonReco/interface/Muon.h" - -/*Originally from DQM/Physics by R. Wolf and J. Andrea*/ - -/** - \class MonitorEnsemble TopDQMHelpers.h "DQM/Physics/interface/TopDQMHelpers.h" - - \brief Helper class to define histograms for monitoring of muon/electron/jet/met quantities. - - Helper class to contain histograms for the monitoring of muon/electron/jet/met quantities. - This class can be instantiated several times after several event selection steps. It can - be used to fill histograms in three different granularity levels according to STANDARD - (<10 histograms), VERBOSE(<20 histograms), DEBUG(<30 histgorams). Note that for the sake - of simplicity and to force the analyst to keep the number of histograms to be monitored - small the MonitorEnsemble class contains the histograms for all objects at once. It should - not contain much more than 10 histograms though in the STANDARD configuration, as these - histograms will be monitored at each SelectionStep. Monitoring of histograms after selec- - tion steps within the same object collection needs to be implemented within the Monitor- - Ensemble. It will not be covered by the SelectionStep class. -*/ - -namespace TopHLTDiLeptonOffline { - - class MonitorEnsemble { - public: - /// different verbosity levels - enum Level{ STANDARD, VERBOSE, DEBUG }; - /// make clear which LorentzVector to use - /// for jet, electrons and muon buffering - typedef reco::LeafCandidate::LorentzVector LorentzVector; - /// different decay channels - enum DecayChannel{ NONE, DIMUON, DIELEC, ELECMU }; - - public: - /// default contructor - MonitorEnsemble(const char* label, const edm::ParameterSet& cfg); - /// default destructor - ~MonitorEnsemble(){}; - - /// book histograms in subdirectory _directory_ - void book(std::string directory); - /// fill monitor histograms with electronId and jetCorrections - //void fill(const edm::Event& event, const edm::EventSetup& setup); - void fill(const edm::Event& event, const edm::EventSetup& setup, edm::Handle triggerTable, edm::Handle > muons, edm::Handle > electronId, edm::Handle > elecs, edm::Handle > jets, edm::Handle jetID, std::vector< edm::Handle > > mets); - - private: - /// deduce monitorPath from label, the label is expected - /// to be of type 'selectionPath:monitorPath' - std::string monitorPath(const std::string& label) const { return label.substr(label.find(':')+1); }; - /// deduce selectionPath from label, the label is - /// expected to be of type 'selectionPath:monitorPath' - std::string selectionPath(const std::string& label) const { return label.substr(0, label.find(':')); }; - /// determine dileptonic decay channel - DecayChannel decayChannel(const std::vector& muons, const std::vector& elecs) const; - - /// set labels for event logging histograms - void loggerBinLabels(std::string hist); - /// set configurable labels for trigger monitoring histograms - void triggerBinLabels(std::string channel, const std::vector& labels); - /// fill trigger monitoring histograms - void fill(const edm::Event& event, const edm::TriggerResults& triggerTable, std::string channel, const std::vector& labels) const; - - /// check if histogram was booked - bool booked(const std::string histName) const { return hists_.find(histName.c_str())!=hists_.end(); }; - /// fill histogram if it had been booked before - void fill(const std::string histName, double value) const { if(booked(histName.c_str())) hists_.find(histName.c_str())->second->Fill(value); }; - /// fill histogram if it had been booked before (2-dim version) - void fill(const std::string histName, double xValue, double yValue) const { if(booked(histName.c_str())) hists_.find(histName.c_str())->second->Fill(xValue, yValue); }; - /// fill histogram if it had been booked before (2-dim version) - void fill(const std::string histName, double xValue, double yValue, double zValue) const { if(booked(histName.c_str())) hists_.find(histName.c_str())->second->Fill(xValue, yValue, zValue); }; - - private: - /// verbosity level for booking - Level verbosity_; - /// instance label - std::string label_; - /// input sources for monitoring - edm::InputTag elecs_, muons_, jets_; - - /// considers a vector of METs - std::vector mets_; - - /// trigger table - edm::InputTag triggerTable_; - /// trigger paths for monitoring, expected - /// to be of form signalPath:MonitorPath - std::vector elecMuPaths_; - /// trigger paths for di muon channel - std::vector diMuonPaths_; - - /// electronId label - edm::InputTag electronId_; - /// electronId pattern we expect the following pattern: - /// 0: fails - /// 1: passes electron ID only - /// 2: passes electron Isolation only - /// 3: passes electron ID and Isolation only - /// 4: passes conversion rejection - /// 5: passes conversion rejection and ID - /// 6: passes conversion rejection and Isolation - /// 7: passes the whole selection - /// As described on https://twiki.cern.ch/twiki/bin/view/CMS/SimpleCutBasedEleID - int eidPattern_; - /// extra isolation criterion on electron - StringCutObjectSelector* elecIso_; - /// extra selection on electrons - StringCutObjectSelector* elecSelect_; - - /// extra isolation criterion on muon - StringCutObjectSelector* muonIso_; - /// extra selection on muons - StringCutObjectSelector* muonSelect_; - - /// jetCorrector - std::string jetCorrector_; - /// jetID as an extra selection type - edm::InputTag jetIDLabel_; - /// extra jetID selection on calo jets - StringCutObjectSelector* jetIDSelect_; - /// extra selection on jets (here given as std::string as it depends - /// on the the jet type, which selections are valid and which not) - std::string jetSelect_; - /// mass window upper and lower edge - double lowerEdge_, upperEdge_; - - /// number of logged interesting events - int elecMuLogged_, diMuonLogged_, diElecLogged_; - /// storage manager - DQMStore* store_; - /// histogram container - std::map hists_; - }; - - inline void - MonitorEnsemble::loggerBinLabels(std::string hist) - { - // set axes titles for selected events - hists_[hist.c_str()]->getTH1()->SetOption("TEXT"); - hists_[hist.c_str()]->setBinLabel( 1 , "Run" , 1); - hists_[hist.c_str()]->setBinLabel( 2 , "Block" , 1); - hists_[hist.c_str()]->setBinLabel( 3 , "Event" , 1); - hists_[hist.c_str()]->setBinLabel( 6 , "pt_{L2L3}(jet1)" , 1); - hists_[hist.c_str()]->setBinLabel( 7 , "pt_{L2L3}(jet2)" , 1); - hists_[hist.c_str()]->setBinLabel( 8 , "MET_{Calo}" , 1); - hists_[hist.c_str()]->setAxisTitle("logged evts" , 2); - - if(hist=="diMuonLogger_"){ - hists_[hist.c_str()]->setBinLabel( 4 , "pt(muon)" , 1); - hists_[hist.c_str()]->setBinLabel( 5 , "pt(muon)" , 1); - } - if(hist=="diElecLogger_"){ - hists_[hist.c_str()]->setBinLabel( 4 , "pt(elec)" , 1); - hists_[hist.c_str()]->setBinLabel( 5 , "pt(elec)" , 1); - } - if(hist=="elecMuLogger_"){ - hists_[hist.c_str()]->setBinLabel( 4 , "pt(elec)" , 1); - hists_[hist.c_str()]->setBinLabel( 5 , "pt(muon)" , 1); - } - } - - inline void - MonitorEnsemble::triggerBinLabels(std::string channel, const std::vector& labels) - { - for(unsigned int idx=0; idxsetBinLabel( idx+1, "["+monitorPath(labels[idx])+"]", 1); - hists_[(channel+"Eff_").c_str()]->setBinLabel( idx+1, "["+selectionPath(labels[idx])+"]|["+monitorPath(labels[idx])+"]", 1); - } - } - - inline void - MonitorEnsemble::fill(const edm::Event& event, const edm::TriggerResults& triggerTable, std::string channel, const std::vector& labels) const - { - for(unsigned int idx=0; idxsecond->getBinContent(idx+1); - double value = hists_.find((channel+"Eff_").c_str())->second->getBinContent(idx+1); - fill((channel+"Eff_").c_str(), idx+0.5, 1./evts*(acceptHLT(event, triggerTable, selectionPath(labels[idx]))-value)); - } - } - } - - inline MonitorEnsemble::DecayChannel - MonitorEnsemble::decayChannel(const std::vector& muons, const std::vector& elecs) const - { - DecayChannel type=NONE; - if( muons.size()>1 ){ type=DIMUON; } else if( elecs.size()>1 ){ type=DIELEC; } else if( !elecs.empty() && !muons.empty() ){ type=ELECMU; } - return type; - } - -} - -#include - -#include "FWCore/Framework/interface/EDAnalyzer.h" -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/ServiceRegistry/interface/Service.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -#include "FWCore/Common/interface/TriggerNames.h" -#include "DataFormats/BeamSpot/interface/BeamSpot.h" -#include "DataFormats/VertexReco/interface/Vertex.h" -#include "DataFormats/Common/interface/TriggerResults.h" - -/** - \class TopHLTDiLeptonOfflineDQM TopHLTDiLeptonOfflineDQM.h "DQM/Physics/plugins/TopHLTDiLeptonOfflineDQM.h" - - \brief Module to apply a monitored selection of top like events in the di-leptonic channel - - Plugin to apply a monitored selection of top like events with some minimal flexibility - in the number and definition of the selection steps. To achieve this flexibility it - employes the SelectionStep class. The MonitorEnsemble class is used to provide a well - defined set of histograms to be monitored after each selection step. The SelectionStep - class provides a flexible and intuitive selection via the StringCutParser. SelectionStep - and MonitorEnsemble classes are interleaved. The monitoring starts after a preselection - step (which is not monitored in the context of this module) with an instance of the - MonitorEnsemble class. The following objects are supported for selection: - - - jets : of type reco::Jet - - elecs : of type reco::GsfElectron - - muons : of type reco::Muon - - met : of type reco::MET - - These types have to be present as prefix of the selection step paramter _label_ separated - from the rest of the label by a ':' (e.g. in the form "jets:step0"). The class expects - selection labels of this type. They will be disentangled by the private helper functions - _objectType_ and _seletionStep_ as declared below. -*/ - -/// define MonitorEnsembple to be used -//using TopDiLeptonOffline::MonitorEnsemble; - -class TopHLTDiLeptonOfflineDQM : public edm::EDAnalyzer { - public: - /// default constructor - TopHLTDiLeptonOfflineDQM(const edm::ParameterSet& cfg); - /// default destructor - ~TopHLTDiLeptonOfflineDQM(){ - if( beamspotSelect_ ) delete beamspotSelect_; - if( vertexSelect_ ) delete vertexSelect_; - } - - /// do this during the event loop - virtual void analyze(const edm::Event& event, const edm::EventSetup& setup); - - private: - /// deduce object type from ParameterSet label, the label - /// is expected to be of type 'objectType:selectionStep' - std::string objectType(const std::string& label) { return label.substr(0, label.find(':')); }; - /// deduce selection step from ParameterSet label, the - /// label is expected to be of type 'objectType:selectionStep' - std::string selectionStep(const std::string& label) { return label.substr(label.find(':')+1); }; - - private: - /// trigger table - edm::InputTag triggerTable_; - /// trigger paths - std::vector triggerPaths_; - /// primary vertex - edm::InputTag vertex_; - /// string cut selector - StringCutObjectSelector* vertexSelect_; - /// beamspot - edm::InputTag beamspot_; - /// string cut selector - StringCutObjectSelector* beamspotSelect_; - - /// needed to guarantee the selection order as defined by the order of - /// ParameterSets in the _selection_ vector as defined in the config - std::vector selectionOrder_; - /// this is the heart component of the plugin; std::string keeps a label - /// the selection step for later identification, edm::ParameterSet keeps - /// the configuration of the selection for the SelectionStep class, - /// MonitoringEnsemble keeps an instance of the MonitorEnsemble class to - /// be filled _after_ each selection step - std::map > selection_; - - std::vector metsTemp_; - - edm::EDGetTokenT< edm::View > muonsToken_; - edm::EDGetTokenT< edm::View > elecsToken_; - edm::EDGetTokenT< edm::View > jetsToken_; - - edm::EDGetTokenT< edm::ValueMap > electronIdToken_; - edm::EDGetTokenT jetIDToken_; - - edm::EDGetTokenT triggerTableToken_; - edm::EDGetTokenT< std::vector > vertexToken_; - edm::EDGetTokenT beamspotToken_; - - std::vector< edm::EDGetTokenT< edm::View > > metsTokens_; -}; - -#endif diff --git a/HLTriggerOffline/Top/src/TopHLTSingleLeptonDQM.cc b/HLTriggerOffline/Top/src/TopHLTSingleLeptonDQM.cc deleted file mode 100644 index 5841f1df380bf..0000000000000 --- a/HLTriggerOffline/Top/src/TopHLTSingleLeptonDQM.cc +++ /dev/null @@ -1,736 +0,0 @@ -#include "JetMETCorrections/Objects/interface/JetCorrectionsRecord.h" -#include "DataFormats/JetReco/interface/CaloJet.h" -#include "DataFormats/BTauReco/interface/JetTag.h" -#include "DataFormats/JetReco/interface/PFJet.h" -#include "DataFormats/Math/interface/deltaR.h" -#include "TopHLTSingleLeptonDQM.h" -#include "HLTriggerOffline/Top/interface/TopHLTDQMHelper.h" -#include -/*Originally from DQM/Physics by R. Wolf and J. Andrea*/ -using namespace std; -namespace TopHLTSingleLepton { - - // maximal number of leading jets - // to be used for top mass estimate - static const unsigned int MAXJETS = 4; - // nominal mass of the W boson to - // be used for the top mass estimate - static const double WMASS = 80.4; - - MonitorEnsemble::MonitorEnsemble(const char* label, const edm::ParameterSet& cfg) : - label_(label), elecIso_(0), elecSelect_(0), pvSelect_(0), muonIso_(0), muonSelect_(0), jetIDSelect_(0), includeBTag_(false), lowerEdge_(-1.), upperEdge_(-1.), logged_(0) - { - // sources have to be given; this PSet is not optional - edm::ParameterSet sources=cfg.getParameter("sources"); - muons_= sources.getParameter("muons"); - elecs_= sources.getParameter("elecs"); - jets_ = sources.getParameter("jets" ); - mets_ = sources.getParameter >("mets" ); - pvs_ = sources.getParameter("pvs" ); - // electronExtras are optional; they may be omitted or - // empty - if( cfg.existsAs("elecExtras") ){ - edm::ParameterSet elecExtras=cfg.getParameter("elecExtras"); - // select is optional; in case it's not found no - // selection will be applied - if( elecExtras.existsAs("select") ){ - elecSelect_= new StringCutObjectSelector(elecExtras.getParameter("select")); - } - // isolation is optional; in case it's not found no - // isolation will be applied - if( elecExtras.existsAs("isolation") ){ - elecIso_= new StringCutObjectSelector(elecExtras.getParameter("isolation")); - } - // electronId is optional; in case it's not found the - // InputTag will remain empty - if( elecExtras.existsAs("electronId") ){ - edm::ParameterSet elecId=elecExtras.getParameter("electronId"); - electronId_= elecId.getParameter("src"); - eidPattern_= elecId.getParameter("pattern"); - } - } - // pvExtras are opetional; they may be omitted or empty - if(cfg.existsAs("pvExtras")){ - edm::ParameterSet pvExtras=cfg.getParameter("pvExtras"); - // select is optional; in case it's not found no - // selection will be applied - if( pvExtras.existsAs("select") ){ - pvSelect_= new StringCutObjectSelector(pvExtras.getParameter("select")); - } - } - // muonExtras are optional; they may be omitted or empty - if( cfg.existsAs("muonExtras") ){ - edm::ParameterSet muonExtras=cfg.getParameter("muonExtras"); - // select is optional; in case it's not found no - // selection will be applied - if( muonExtras.existsAs("select") ){ - muonSelect_= new StringCutObjectSelector(muonExtras.getParameter("select")); - } - // isolation is optional; in case it's not found no - // isolation will be applied - if( muonExtras.existsAs("isolation") ){ - muonIso_= new StringCutObjectSelector(muonExtras.getParameter("isolation")); - } - } - - // jetExtras are optional; they may be omitted or - // empty - if( cfg.existsAs("jetExtras") ){ - edm::ParameterSet jetExtras=cfg.getParameter("jetExtras"); - // jetCorrector is optional; in case it's not found - // the InputTag will remain empty - if( jetExtras.existsAs("jetCorrector") ){ - jetCorrector_= jetExtras.getParameter("jetCorrector"); - } - // read jetID information if it exists - if(jetExtras.existsAs("jetID")){ - edm::ParameterSet jetID=jetExtras.getParameter("jetID"); - jetIDLabel_ =jetID.getParameter("label"); - jetIDSelect_= new StringCutObjectSelector(jetID.getParameter("select")); - } - // select is optional; in case it's not found no - // selection will be applied (only implemented for - // CaloJets at the moment) - if( jetExtras.existsAs("select") ){ - jetSelect_= jetExtras.getParameter("select"); - } - // jetBDiscriminators are optional; in case they are - // not found the InputTag will remain empty; they - // consist of pairs of edm::JetFlavorAssociation's & - // corresponding working points - includeBTag_=jetExtras.existsAs("jetBTaggers"); - if( includeBTag_ ){ - edm::ParameterSet btagEff=jetExtras.getParameter("jetBTaggers").getParameter("trackCountingEff"); - btagEff_= btagEff.getParameter("label"); btagEffWP_= btagEff.getParameter("workingPoint"); - edm::ParameterSet btagPur=jetExtras.getParameter("jetBTaggers").getParameter("trackCountingPur"); - btagPur_= btagPur.getParameter("label"); btagPurWP_= btagPur.getParameter("workingPoint"); - edm::ParameterSet btagVtx=jetExtras.getParameter("jetBTaggers").getParameter("secondaryVertex" ); - btagVtx_= btagVtx.getParameter("label"); btagVtxWP_= btagVtx.getParameter("workingPoint"); - } - } - - // triggerExtras are optional; they may be omitted or empty - if( cfg.existsAs("triggerExtras") ){ - edm::ParameterSet triggerExtras=cfg.getParameter("triggerExtras"); - triggerTable_=triggerExtras.getParameter("src"); - triggerPaths_=triggerExtras.getParameter >("paths"); - } - - // massExtras is optional; in case it's not found no mass - // window cuts are applied for the same flavor monitor - // histograms - if( cfg.existsAs("massExtras") ){ - edm::ParameterSet massExtras=cfg.getParameter("massExtras"); - lowerEdge_= massExtras.getParameter("lowerEdge"); - upperEdge_= massExtras.getParameter("upperEdge"); - } - - // setup the verbosity level for booking histograms; - // per default the verbosity level will be set to - // STANDARD. This will also be the chosen level in - // the case when the monitoring PSet is not found - verbosity_=STANDARD; - if( cfg.existsAs("monitoring") ){ - edm::ParameterSet monitoring=cfg.getParameter("monitoring"); - if(monitoring.getParameter("verbosity") == "DEBUG" ) - verbosity_= DEBUG; - if(monitoring.getParameter("verbosity") == "VERBOSE" ) - verbosity_= VERBOSE; - if(monitoring.getParameter("verbosity") == "STANDARD") - verbosity_= STANDARD; - } - // and don't forget to do the histogram booking - book(cfg.getParameter("directory")); - } - - void - MonitorEnsemble::book(std::string directory) - { - //set up the current directory path - std::string current(directory); current+=label_; - store_=edm::Service().operator->(); - store_->setCurrentFolder(current); - - // determine number of bins for trigger monitoring - unsigned int nPaths=triggerPaths_.size(); - - // --- [STANDARD] --- // - // number of selected primary vertices - hists_["pvMult_" ] = store_->book1D("PvMult" , "N_{pvs}" , 100, 0., 100.); - // pt of the leading muon - hists_["muonPt_" ] = store_->book1D("MuonPt" , "pt(#mu)" , 50, 0., 250.); - // muon multiplicity before std isolation - hists_["muonMult_" ] = store_->book1D("MuonMult" , "N_{All}(#mu)" , 10, 0., 10.); - // muon multiplicity after std isolation - hists_["muonMultIso_"] = store_->book1D("MuonMultIso", "N_{Iso}(#mu)" , 10, 0., 10.); - // pt of the leading electron - hists_["elecPt_" ] = store_->book1D("ElecPt" , "pt(e)" , 50, 0., 250.); - // electron multiplicity before std isolation - hists_["elecMult_" ] = store_->book1D("ElecMult" , "N_{All}(e)" , 10, 0., 10.); - // electron multiplicity after std isolation - hists_["elecMultIso_"] = store_->book1D("ElecMultIso", "N_{Iso}(e)" , 10, 0., 10.); - // multiplicity of jets with pt>20 (corrected to L2+L3) - hists_["jetMult_" ] = store_->book1D("JetMult" , "N_{30}(jet)" , 10, 0., 10.); - // trigger efficiency estimates for single lepton triggers - hists_["triggerEff_" ] = store_->book1D("TriggerEff" , "Eff(trigger)" , nPaths, 0., nPaths); - // monitored trigger occupancy for single lepton triggers - hists_["triggerMon_" ] = store_->book1D("TriggerMon" , "Mon(trigger)" , nPaths, 0., nPaths); - // MET (calo) - hists_["metCalo_" ] = store_->book1D("METCalo" , "MET_{Calo}" , 50, 0., 200.); - // W mass estimate - hists_["massW_" ] = store_->book1D("MassW" , "M(W)" , 60, 0., 300.); - // Top mass estimate - hists_["massTop_" ] = store_->book1D("MassTop" , "M(Top)" , 50, 0., 500.); - // Mlb mu - hists_["mMub_" ] = store_->book1D("mMub" , "m_{#mub}" , 50, 0., 500.); - // W mass transverse estimate mu - hists_["MTWm_" ] = store_->book1D("MTWm" , "M_{T}^{W}(#mu)" , 60, 0., 300.); - // Top mass transverse estimate mu - hists_["mMTT_" ] = store_->book1D("mMTT" , "M_{T}^{t}(#mu)" , 50, 0., 500.); - - // Mlb e - hists_["mEb_" ] = store_->book1D("mEb" , "m_{eb}" , 50, 0., 500.); - // W mass transverse estimate e - hists_["MTWe_" ] = store_->book1D("MTWe" , "M_{T}^{W}(e)" , 60, 0., 300.); - // Top mass transverse estimate e - hists_["eMTT_" ] = store_->book1D("eMTT" , "M_{T}^{t}(e)" , 50, 0., 500.); - - - - - // set bin labels for trigger monitoring - triggerBinLabels(std::string("trigger"), triggerPaths_); - - if( verbosity_==STANDARD) return; - - // --- [VERBOSE] --- // - // eta of the leading muon - hists_["muonEta_" ] = store_->book1D("MuonEta" , "#eta(#mu)" , 30, -3., 3.); - // std isolation variable of the leading muon - hists_["muonRelIso_" ] = store_->book1D("MuonRelIso" , "Iso_{Rel}(#mu)" , 50, 0., 1.); - // eta of the leading electron - hists_["elecEta_" ] = store_->book1D("ElecEta" , "#eta(e)" , 30, -3., 3.); - // std isolation variable of the leading electron - hists_["elecRelIso_" ] = store_->book1D("ElecRelIso" , "Iso_{Rel}(e)" , 50, 0., 1.); - // multiplicity of btagged jets (for track counting high efficiency) with pt(L2L3)>30 - hists_["jetMultBEff_"] = store_->book1D("JetMultBEff", "N_{30}(b/eff)" , 10, 0., 10.); - // btag discriminator for track counting high efficiency for jets with pt(L2L3)>30 - hists_["jetBDiscEff_"] = store_->book1D("JetBDiscEff", "Disc_{b/eff}(jet)", 100, 0., 10.); - // pt of the 1. leading jet (corrected to L2+L3) - hists_["jet1Pt_" ] = store_->book1D("Jet1Pt" , "pt_{L2L3}(jet1)" , 60, 0., 300.); - // pt of the 2. leading jet (corrected to L2+L3) - hists_["jet2Pt_" ] = store_->book1D("Jet2Pt" , "pt_{L2L3}(jet2)" , 60, 0., 300.); - // pt of the 3. leading jet (corrected to L2+L3) - hists_["jet3Pt_" ] = store_->book1D("Jet3Pt" , "pt_{L2L3}(jet3)" , 60, 0., 300.); - // pt of the 4. leading jet (corrected to L2+L3) - hists_["jet4Pt_" ] = store_->book1D("Jet4Pt" , "pt_{L2L3}(jet4)" , 60, 0., 300.); - // eta of the 1. - hists_["jet1Eta_" ] = store_->book1D("Jet1Eta" , "#eta(jet1)" , 30, -3., 3.); - // eta of the 2. - hists_["jet2Eta_" ] = store_->book1D("Jet2Eta" , "#eta(jet2)" , 30, -3., 3.); - // eta of the 3. - hists_["jet3Eta_" ] = store_->book1D("Jet3Eta" , "#eta(jet3)" , 30, -3., 3.); - // eta of the 4. - hists_["jet4Eta_" ] = store_->book1D("Jet4Eta" , "#eta(jet4)" , 30, -3., 3.); - // MET (tc) - hists_["metTC_" ] = store_->book1D("METTC" , "MET_{TC}" , 50, 0., 200.); - // MET (pflow) - hists_["metPflow_" ] = store_->book1D("METPflow" , "MET_{Pflow}" , 50, 0., 200.); - // dz for muons (to suppress cosmis) - hists_["muonDelZ_" ] = store_->book1D("MuonDelZ" , "d_{z}(#mu)" , 50, -25., 25.); - // dxy for muons (to suppress cosmics) - hists_["muonDelXY_" ] = store_->book2D("MuonDelXY" , "d_{xy}(#mu)" , 50, -0.1, 0.1, 50, -0.1, 0.1); - - // set axes titles for dxy for muons - hists_["muonDelXY_" ]->setAxisTitle( "x [cm]", 1); hists_["muonDelXY_" ]->setAxisTitle( "y [cm]", 2); - - if( verbosity_==VERBOSE) return; - - // --- [DEBUG] --- // - // relative muon isolation in tracker for the leading muon - hists_["muonTrkIso_" ] = store_->book1D("MuonTrkIso" , "Iso_{Trk}(#mu)" , 50, 0., 1.); - // relative muon isolation in ecal+hcal for the leading muon - hists_["muonCalIso_" ] = store_->book1D("MuonCalIso" , "Iso_{Ecal}(#mu)" , 50, 0., 1.); - // relative electron isolation in tracker for the leading electron - hists_["elecTrkIso_" ] = store_->book1D("ElecTrkIso" , "Iso_{Trk}(e)" , 50, 0., 1.); - // relative electron isolation in ecal+hcal for the leading electron - hists_["elecCalIso_" ] = store_->book1D("ElecCalIso" , "Iso_{Ecal}(e)" , 50, 0., 1.); - // multiplicity of btagged jets (for track counting high purity) with pt(L2L3)>30 - hists_["jetMultBPur_"] = store_->book1D("JetMultBPur", "N_{30}(b/pur)" , 10, 0., 10.); - // btag discriminator for track counting high purity - hists_["jetBDiscPur_"] = store_->book1D("JetBDiscPur", "Disc_{b/pur}(Jet)", 100, 0., 10.); - // multiplicity of btagged jets (for simple secondary vertex) with pt(L2L3)>30 - hists_["jetMultBVtx_"] = store_->book1D("JetMultBVtx", "N_{30}(b/vtx)" , 10, 0., 10.); - // btag discriminator for simple secondary vertex - hists_["jetBDiscVtx_"] = store_->book1D("JetBDiscVtx", "Disc_{b/vtx}(Jet)", 35, -1., 6.); - // pt of the 1. leading jet (uncorrected) - hists_["jet1PtRaw_" ] = store_->book1D("Jet1PtRaw" , "pt_{Raw}(jet1)" , 60, 0., 300.); - // pt of the 2. leading jet (uncorrected) - hists_["jet2PtRaw_" ] = store_->book1D("Jet2PtRaw" , "pt_{Raw}(jet2)" , 60, 0., 300.); - // pt of the 3. leading jet (uncorrected) - hists_["jet3PtRaw_" ] = store_->book1D("Jet3PtRaw" , "pt_{Raw}(jet3)" , 60, 0., 300.); - // pt of the 4. leading jet (uncorrected) - hists_["jet4PtRaw_" ] = store_->book1D("Jet4PtRaw" , "pt_{Raw}(jet4)" , 60, 0., 300.); - // selected events - hists_["eventLogger_"] = store_->book2D("EventLogger", "Logged Events" , 9, 0., 9., 10, 0., 10.); - - // set axes titles for selected events - hists_["eventLogger_"]->getTH1()->SetOption("TEXT"); - hists_["eventLogger_"]->setBinLabel( 1 , "Run" , 1); - hists_["eventLogger_"]->setBinLabel( 2 , "Block" , 1); - hists_["eventLogger_"]->setBinLabel( 3 , "Event" , 1); - hists_["eventLogger_"]->setBinLabel( 4 , "pt_{L2L3}(jet1)" , 1); - hists_["eventLogger_"]->setBinLabel( 5 , "pt_{L2L3}(jet2)" , 1); - hists_["eventLogger_"]->setBinLabel( 6 , "pt_{L2L3}(jet3)" , 1); - hists_["eventLogger_"]->setBinLabel( 7 , "pt_{L2L3}(jet4)" , 1); - hists_["eventLogger_"]->setBinLabel( 8 , "M_{W}" , 1); - hists_["eventLogger_"]->setBinLabel( 9 , "M_{Top}" , 1); - hists_["eventLogger_"]->setAxisTitle("logged evts" , 2); - return; - } - - void - MonitorEnsemble::fill(const edm::Event& event, const edm::EventSetup& setup, - edm::Handle triggerTable, edm::Handle > pvs, - edm::Handle > muons, edm::Handle > electronId, - edm::Handle > elecs, edm::Handle > jets, - edm::Handle jetID, edm::Handle btagEff, - edm::Handle btagPur, edm::Handle btagVtx, - std::vector< edm::Handle > > mets) - { - // fetch trigger event if configured such - if(!triggerTable_.label().empty()) { - if( !triggerTable.isValid() ) return; - } - - /* - ------------------------------------------------------------ - - Primary Vertex Monitoring - - ------------------------------------------------------------ - */ - // fill monitoring plots for primary verices - if( !pvs.isValid() ) return; - unsigned int pvMult = 0; - for(edm::View::const_iterator pv=pvs->begin(); pv!=pvs->end(); ++pv){ - if(!pvSelect_ || (*pvSelect_)(*pv)) - pvMult++; - } - fill("pvMult_", pvMult ); - - /* - ------------------------------------------------------------ - - Electron Monitoring - - ------------------------------------------------------------ - */ - - // check availability of electron id - if(!electronId_.label().empty()) { - if( !electronId.isValid() ) return; - } - - if( !elecs.isValid() ) return; - - // loop electron collection - unsigned int eMult=0, eMultIso=0; - std::vector isoElecs; - reco::GsfElectron e; - for(edm::View::const_iterator elec=elecs->begin(); elec!=elecs->end(); ++elec){ - unsigned int idx = elec-elecs->begin(); - // restrict to electrons with good electronId - if( electronId_.label().empty() ? true : ((int)(*electronId)[elecs->refAt(idx)] & eidPattern_) ){ - if(!elecSelect_ || (*elecSelect_)(*elec)){ - double isolationTrk = elec->pt()/(elec->pt()+elec->dr03TkSumPt()); - double isolationCal = elec->pt()/(elec->pt()+elec->dr03EcalRecHitSumEt()+elec->dr03HcalTowerSumEt()); - double isolationRel = (elec->dr03TkSumPt()+elec->dr03EcalRecHitSumEt()+elec->dr03HcalTowerSumEt())/elec->pt(); - if( eMult==0 ){ - // restrict to the leading electron - fill("elecPt_" , elec->pt() ); - fill("elecEta_", elec->eta()); - fill("elecRelIso_" , isolationRel ); - fill("elecTrkIso_" , isolationTrk ); - fill("elecCalIso_" , isolationCal ); - } - // in addition to the multiplicity counter buffer the iso - // electron candidates for later overlap check with jets - ++eMult; if(!elecIso_ || (*elecIso_)(*elec)){ if(eMultIso == 0) e = *elec; isoElecs.push_back(&(*elec)); ++eMultIso;} - } - } - } - fill("elecMult_", eMult ); - fill("elecMultIso_", eMultIso); - - /* - ------------------------------------------------------------ - - Muon Monitoring - - ------------------------------------------------------------ - */ - - // fill monitoring plots for muons - unsigned int mMult=0, mMultIso=0; - - if( !muons.isValid() ) return; - - reco::Muon mu; - for(edm::View::const_iterator muon=muons->begin(); muon!=muons->end(); ++muon){ - // restrict to globalMuons - if( muon->isGlobalMuon() ){ - fill("muonDelZ_" , muon->globalTrack()->vz()); - fill("muonDelXY_", muon->globalTrack()->vx(), muon->globalTrack()->vy()); - // apply preselection - if(!muonSelect_ || (*muonSelect_)(*muon)){ - double isolationTrk = muon->pt()/(muon->pt()+muon->isolationR03().sumPt); - double isolationCal = muon->pt()/(muon->pt()+muon->isolationR03().emEt+muon->isolationR03().hadEt); - double isolationRel = (muon->isolationR03().sumPt+muon->isolationR03().emEt+muon->isolationR03().hadEt)/muon->pt(); - if( mMult==0 ){ - // restrict to leading muon - fill("muonPt_" , muon->pt() ); - fill("muonEta_" , muon->eta()); - fill("muonRelIso_" , isolationRel ); - fill("muonTrkIso_" , isolationTrk ); - fill("muonCalIso_" , isolationCal ); - } - ++mMult; if(!muonIso_ || (*muonIso_)(*muon)) {if(mMultIso == 0) mu = *muon; ++mMultIso;} - } - } - } - fill("muonMult_", mMult ); - fill("muonMultIso_", mMultIso); - - /* - ------------------------------------------------------------ - - Jet Monitoring - - ------------------------------------------------------------ - */ - - // check availability of the btaggers - if( includeBTag_ ){ - if( !btagEff.isValid() ) return; - if( !btagPur.isValid() ) return; - if( !btagVtx.isValid() ) return; - } - // load jet corrector if configured such - const JetCorrector* corrector=0; - if(!jetCorrector_.empty()){ - // check whether a jet correcto is in the event setup or not - if(setup.find( edm::eventsetup::EventSetupRecordKey::makeKey() )){ - corrector = JetCorrector::getJetCorrector(jetCorrector_, setup); - } - else{ - edm::LogVerbatim( "TopHLTSingleLeptonDQM" ) - << "\n" - << "------------------------------------------------------------------------------------- \n" - << " No JetCorrectionsRecord available from EventSetup: \n" - << " - Jets will not be corrected. \n" - << " - If you want to change this add the following lines to your cfg file: \n" - << " \n" - << " ## load jet corrections \n" - << " process.load(\"JetMETCorrections.Configuration.JetCorrectionServicesAllAlgos_cff\") \n" - << " process.prefer(\"ak5CaloL2L3\") \n" - << " \n" - << "------------------------------------------------------------------------------------- \n"; - } - } - - // loop jet collection - std::vector correctedJets; - unsigned int mult=0, multBEff=0, multBPur=0, multBVtx=0; - - if( !jets.isValid() ) return; - - if(jetIDSelect_){ - if( !jetID.isValid() ) return; - } - - reco::Jet bJetCand; - for(edm::View::const_iterator jet=jets->begin(); jet!=jets->end(); ++jet){ - // check jetID for calo jets - unsigned int idx = jet-jets->begin(); - if( jetIDSelect_ && dynamic_cast(jets->refAt(idx).get())){ - if(!(*jetIDSelect_)((*jetID)[jets->refAt(idx)])) continue; - } - // chekc additional jet selection for calo, pf and bare reco jets - if(dynamic_cast(&*jet)){ - reco::CaloJet sel = dynamic_cast(*jet); sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.); - StringCutObjectSelector jetSelect(jetSelect_); if(!jetSelect(sel)){ continue;} - } - else if(dynamic_cast(&*jet)){ - reco::PFJet sel= dynamic_cast(*jet); sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.); - StringCutObjectSelector jetSelect(jetSelect_); if(!jetSelect(sel)) continue; - } - else{ - reco::Jet sel = *jet; sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.); - StringCutObjectSelector jetSelect(jetSelect_); if(!jetSelect(sel)) continue; - } - // check for overlaps -- comment this to be synchronous with the selection - //bool overlap=false; - //for(std::vector::const_iterator elec=isoElecs.begin(); elec!=isoElecs.end(); ++elec){ - // if(reco::deltaR((*elec)->eta(), (*elec)->phi(), jet->eta(), jet->phi())<0.4){overlap=true; break;} - //} if(overlap){continue;} - - // prepare jet to fill monitor histograms - reco::Jet monitorJet = *jet; monitorJet.scaleEnergy(corrector ? corrector->correction(*jet) : 1.); - correctedJets.push_back(monitorJet); - ++mult; // determine jet multiplicity - if( includeBTag_ ){ - // fill b-discriminators - edm::RefToBase jetRef = jets->refAt(idx); - fill("jetBDiscEff_", (*btagEff)[jetRef]); if( (*btagEff)[jetRef]>btagEffWP_ ) ++multBEff; - fill("jetBDiscPur_", (*btagPur)[jetRef]); if( (*btagPur)[jetRef]>btagPurWP_ ) {if(multBPur == 0) bJetCand = *jet; ++multBPur;} - fill("jetBDiscVtx_", (*btagVtx)[jetRef]); if( (*btagVtx)[jetRef]>btagVtxWP_ ) ++multBVtx; - } - // fill pt (raw or L2L3) for the leading four jets - if(idx==0) {fill("jet1Pt_" , monitorJet.pt()); fill("jet1PtRaw_", jet->pt() ); fill("jet1Eta_" , monitorJet.eta());} - if(idx==1) {fill("jet2Pt_" , monitorJet.pt()); fill("jet2PtRaw_", jet->pt() ); fill("jet2Eta_" , monitorJet.eta());} - if(idx==2) {fill("jet3Pt_" , monitorJet.pt()); fill("jet3PtRaw_", jet->pt() ); fill("jet3Eta_" , monitorJet.eta());} - if(idx==3) {fill("jet4Pt_" , monitorJet.pt()); fill("jet4PtRaw_", jet->pt() ); fill("jet4Eta_" , monitorJet.eta());} - } - fill("jetMult_" , mult ); - fill("jetMultBEff_", multBEff); - fill("jetMultBPur_", multBPur); - fill("jetMultBVtx_", multBVtx); - - /* - ------------------------------------------------------------ - - MET Monitoring - - ------------------------------------------------------------ - */ - - // fill monitoring histograms for met - reco::MET mET; - for( int i=0; i > met = mets[i]; - if( !met.isValid() ) continue; - if(met->begin()!=met->end()){ - unsigned int idx=i; - if(idx==0) fill("metCalo_" , met->begin()->et()); - if(idx==1) fill("metTC_" , met->begin()->et()); - if(idx==2) fill("metPflow_", met->begin()->et()); - mET = *(met->begin()); - } - } - - /* - ------------------------------------------------------------ - - Event Monitoring - - ------------------------------------------------------------ - */ - - // fill W boson and top mass estimates - CalculateHLT eventKinematics(MAXJETS, WMASS); - double wMass = eventKinematics.massWBoson (correctedJets); - double topMass = eventKinematics.massTopQuark(correctedJets); - if(wMass>=0 && topMass>=0) {fill("massW_" , wMass ); fill("massTop_" , topMass);} - // fill plots for trigger monitoring - if((lowerEdge_==-1. && upperEdge_==-1.) || (lowerEdge_second->getNbinsY()){ - // log runnumber, lumi block, event number & some - // more pysics infomation for interesting events - fill("eventLogger_", 0.5, logged_+0.5, event.eventAuxiliary().run()); - fill("eventLogger_", 1.5, logged_+0.5, event.eventAuxiliary().luminosityBlock()); - fill("eventLogger_", 2.5, logged_+0.5, event.eventAuxiliary().event()); - if(correctedJets.size()>0) fill("eventLogger_", 3.5, logged_+0.5, correctedJets[0].pt()); - if(correctedJets.size()>1) fill("eventLogger_", 4.5, logged_+0.5, correctedJets[1].pt()); - if(correctedJets.size()>2) fill("eventLogger_", 5.5, logged_+0.5, correctedJets[2].pt()); - if(correctedJets.size()>3) fill("eventLogger_", 6.5, logged_+0.5, correctedJets[3].pt()); - fill("eventLogger_", 7.5, logged_+0.5, wMass ); - fill("eventLogger_", 8.5, logged_+0.5, topMass); - ++logged_; - } - } - if(multBPur != 0 && mMultIso == 1 ){ - // cout<("sources"); - muonsToken_ = consumes< edm::View >(sources.getParameter("muons")); - elecsToken_ = consumes< edm::View >(sources.getParameter("elecs")); - jetsToken_ = consumes< edm::View >(sources.getParameter("jets" )); - pvsToken_ = consumes< edm::View >(sources.getParameter("pvs" )); - - metsTemp_ = sources.getParameter >("mets" ); - - metsTokens_.resize( metsTemp_.size() ); - for( int i=0; i >(metsTemp_[i]); - - // configure preselection - edm::ParameterSet presel=cfg.getParameter("preselection"); - if( presel.existsAs("trigger") ){ - edm::ParameterSet trigger=presel.getParameter("trigger"); - triggerTable_=trigger.getParameter("src"); - triggerPaths_=trigger.getParameter >("select"); - } - if( presel.existsAs("vertex" ) ){ - edm::ParameterSet vertex=presel.getParameter("vertex"); - vertex_= vertex.getParameter("src"); - vertexToken_= consumes< std::vector >(vertex.getParameter("src")); - vertexSelect_= new StringCutObjectSelector(vertex.getParameter("select")); - } - if( presel.existsAs("beamspot" ) ){ - edm::ParameterSet beamspot=presel.getParameter("beamspot"); - beamspot_= beamspot.getParameter("src"); - beamspotToken_= consumes(beamspot.getParameter("src")); - beamspotSelect_= new StringCutObjectSelector(beamspot.getParameter("select")); - } - - // elecExtras are optional; they may be omitted or empty - if( cfg.existsAs("elecExtras") ){ - edm::ParameterSet elecExtras=cfg.getParameter("elecExtras"); - // electronId is optional; in case it's not found the - // InputTag will remain empty - if( elecExtras.existsAs("electronId") ){ - edm::ParameterSet elecId=elecExtras.getParameter("electronId"); - electronIdToken_= consumes< edm::ValueMap >(elecId.getParameter("src")); - } - } - - // jetExtras are optional; they may be omitted or empty - if( cfg.existsAs("jetExtras") ){ - edm::ParameterSet jetExtras=cfg.getParameter("jetExtras"); - // read jetID information if it exists - if(jetExtras.existsAs("jetID")){ - edm::ParameterSet jetID=jetExtras.getParameter("jetID"); - jetIDToken_ = consumes(jetID.getParameter("label")); - } - } - - // conifgure the selection - std::vector sel=cfg.getParameter >("selection"); - for(unsigned int i=0; i("label")); - selection_[selectionStep(selectionOrder_.back())] = std::make_pair(sel.at(i), new TopHLTSingleLepton::MonitorEnsemble(selectionStep(selectionOrder_.back()).c_str(), cfg.getParameter("setup"))); - } -} - -void -TopHLTSingleLeptonDQM::analyze(const edm::Event& event, const edm::EventSetup& setup) -{ - - edm::Handle triggerTable; - edm::Handle > vertex; - edm::Handle beamspot; - - edm::Handle > pvs; - event.getByToken(pvsToken_, pvs); - - edm::Handle > muons; - event.getByToken(muonsToken_, muons); - - edm::Handle > electronId; - event.getByToken(electronIdToken_, electronId); - - edm::Handle > elecs; - event.getByToken(elecsToken_, elecs); - - edm::Handle > jets; - event.getByToken(jetsToken_, jets); - - edm::Handle jetID; - event.getByToken(jetIDToken_, jetID); - - - edm::Handle btagEff, btagPur, btagVtx; - event.getByToken(btagEffToken_, btagEff); - event.getByToken(btagPurToken_, btagPur); - event.getByToken(btagVtxToken_, btagVtx); - - std::vector< edm::Handle > > mets; - for( int i=0; iempty() || !(*vertexSelect_)(vertex->front())) return; - } - if(!beamspot_.label().empty()){ - if( !event.getByToken(beamspotToken_, beamspot) ) return; - if(!(*beamspotSelect_)(*beamspot)) return; - } - - - // apply selection steps - unsigned int passed=0; - for(std::vector::const_iterator selIt=selectionOrder_.begin(); selIt!=selectionOrder_.end(); ++selIt){ - std::string key = selectionStep(*selIt), type = objectType(*selIt); - if(selection_.find(key)!=selection_.end()){ - if(type=="empty"){ - selection_[key].second->fill(event, setup, triggerTable, pvs, muons, electronId, elecs, jets, jetID, btagEff, btagPur, btagVtx, mets); - } - if(type=="Hlt" ){ -// cout<<"HLT filled"<fill(event, setup, triggerTable, pvs, muons, electronId, elecs, jets, jetID, btagEff, btagPur, btagVtx, mets); - } - if(type=="muons"){ -// cout<<"Good Mu found"< step(selection_[key].first, consumesCollector()); - if(step.select(event)){ ++passed; - selection_[key].second->fill(event, setup, triggerTable, pvs, muons, electronId, elecs, jets, jetID, btagEff, btagPur, btagVtx, mets); - } else break; - } - if(type=="elecs"){ - SelectionStepHLT step(selection_[key].first, consumesCollector()); - if(step.select(event)){ ++passed; - selection_[key].second->fill(event, setup, triggerTable, pvs, muons, electronId, elecs, jets, jetID, btagEff, btagPur, btagVtx, mets); - } else break; - } - if(type=="jets" ){ - SelectionStepHLT step(selection_[key].first, consumesCollector()); - if(step.select(event, setup)){ ++passed; - selection_[key].second->fill(event, setup, triggerTable, pvs, muons, electronId, elecs, jets, jetID, btagEff, btagPur, btagVtx, mets); - } else break; - } - if(type=="jets/pf" ){ - SelectionStepHLT step(selection_[key].first, consumesCollector()); - if(step.select(event, setup)){ ++passed; - selection_[key].second->fill(event, setup, triggerTable, pvs, muons, electronId, elecs, jets, jetID, btagEff, btagPur, btagVtx, mets); - } else break; - } - if(type=="jets/calo" ){ -// cout<<"Jet found!"< step(selection_[key].first, consumesCollector()); - if(step.select(event, setup)){ ++passed; - selection_[key].second->fill(event, setup, triggerTable, pvs, muons, electronId, elecs, jets, jetID, btagEff, btagPur, btagVtx, mets); - } else break; - } - if(type=="met" ){ - SelectionStepHLT step(selection_[key].first, consumesCollector()); - if(step.select(event)){ ++passed; - selection_[key].second->fill(event, setup, triggerTable, pvs, muons, electronId, elecs, jets, jetID, btagEff, btagPur, btagVtx, mets); - } else break; - } - } - } -} - - diff --git a/HLTriggerOffline/Top/src/TopHLTSingleLeptonDQM.h b/HLTriggerOffline/Top/src/TopHLTSingleLeptonDQM.h deleted file mode 100644 index ea65c8f658ead..0000000000000 --- a/HLTriggerOffline/Top/src/TopHLTSingleLeptonDQM.h +++ /dev/null @@ -1,278 +0,0 @@ -#ifndef TOPSINGLELEPTONDQM -#define TOPSINGLELEPTONDQM - -#include -#include - -#include "FWCore/Framework/interface/Event.h" -#include "DQMServices/Core/interface/DQMStore.h" -#include "DQMServices/Core/interface/MonitorElement.h" - -#include "DataFormats/JetReco/interface/Jet.h" -#include "HLTriggerOffline/Top/interface/TopHLTDQMHelper.h" -#include "DataFormats/MuonReco/interface/Muon.h" -#include "DataFormats/Common/interface/ValueMap.h" -#include "DataFormats/METReco/interface/CaloMET.h" -#include "JetMETCorrections/Objects/interface/JetCorrector.h" -#include "DataFormats/EgammaCandidates/interface/GsfElectron.h" -#include "DataFormats/VertexReco/interface/Vertex.h" -/*Originally from DQM/Physics by R. Wolf and J. Andrea*/ - -/** - \class MonitorEnsemble TopDQMHelpers.h "DQM/Physics/interface/TopDQMHelpers.h" - - \brief Helper class to define histograms for monitoring of muon/electron/jet/met quantities. - - Helper class to contain histograms for the monitoring of muon/electron/jet/met quantities. - This class can be instantiated several times after several event selection steps. It can - be used to fill histograms in three different granularity levels according to STANDARD - (<10 histograms), VERBOSE(<20 histograms), DEBUG(<30 histgorams). Note that for the sake - of simplicity and to force the analyst to keep the number of histograms to be monitored - small the MonitorEnsemble class contains the histograms for all objects at once. It should - not contain much more than 10 histograms though in the STANDARD configuration, as these - histograms will be monitored at each SelectionStep. Monitoring of histograms after selec- - tion steps within the same object collection needs to be implemented within the Monitor- - Ensemble. It will not be covered by the SelectionStep class. -*/ - -namespace TopHLTSingleLepton { - - class MonitorEnsemble { - public: - /// different verbosity levels - enum Level{ STANDARD, VERBOSE, DEBUG }; - - public: - /// default contructor - MonitorEnsemble(const char* label, const edm::ParameterSet& cfg); - /// default destructor - ~MonitorEnsemble(){}; - - /// book histograms in subdirectory _directory_ - void book(std::string directory); - /// fill monitor histograms with electronId and jetCorrections - void fill(const edm::Event& event, const edm::EventSetup& setup, edm::Handle triggerTable, edm::Handle > pvs, edm::Handle > muons, edm::Handle > electronId, edm::Handle > elecs, edm::Handle > jets, edm::Handle jetID, edm::Handle btagEff, edm::Handle btagPur, edm::Handle btagVtx, std::vector< edm::Handle > > mets); - - private: - /// deduce monitorPath from label, the label is expected - /// to be of type 'selectionPath:monitorPath' - std::string monitorPath(const std::string& label) const { return label.substr(label.find(':')+1); }; - /// deduce selectionPath from label, the label is - /// expected to be of type 'selectionPath:monitorPath' - std::string selectionPath(const std::string& label) const { return label.substr(0, label.find(':')); }; - - /// set configurable labels for trigger monitoring histograms - void triggerBinLabels(std::string channel, const std::vector& labels); - /// fill trigger monitoring histograms - void fill(const edm::Event& event, const edm::TriggerResults& triggerTable, std::string channel, const std::vector& labels) const; - - /// check if histogram was booked - bool booked(const std::string histName) const { return hists_.find(histName.c_str())!=hists_.end(); }; - /// fill histogram if it had been booked before - void fill(const std::string histName, double value) const { if(booked(histName.c_str())) hists_.find(histName.c_str())->second->Fill(value); }; - /// fill histogram if it had been booked before (2-dim version) - void fill(const std::string histName, double xValue, double yValue) const { if(booked(histName.c_str())) hists_.find(histName.c_str())->second->Fill(xValue, yValue); }; - /// fill histogram if it had been booked before (2-dim version) - void fill(const std::string histName, double xValue, double yValue, double zValue) const { if(booked(histName.c_str())) hists_.find(histName.c_str())->second->Fill(xValue, yValue, zValue); }; - - private: - /// verbosity level for booking - Level verbosity_; - /// instance label - std::string label_; - /// considers a vector of METs - std::vector mets_; - /// input sources for monitoring - edm::InputTag elecs_, muons_, jets_, pvs_; - - /// trigger table - edm::InputTag triggerTable_; - /// trigger paths for monitoring, expected - /// to be of form signalPath:MonitorPath - std::vector triggerPaths_; - - /// electronId label - edm::InputTag electronId_; - /// electronId pattern we expect the following pattern: - /// 0: fails - /// 1: passes electron ID only - /// 2: passes electron Isolation only - /// 3: passes electron ID and Isolation only - /// 4: passes conversion rejection - /// 5: passes conversion rejection and ID - /// 6: passes conversion rejection and Isolation - /// 7: passes the whole selection - /// As described on https://twiki.cern.ch/twiki/bin/view/CMS/SimpleCutBasedEleID - int eidPattern_; - /// extra isolation criterion on electron - StringCutObjectSelector* elecIso_; - /// extra selection on electrons - StringCutObjectSelector* elecSelect_; - - /// extra selection on primary vertices; meant to investigate the pile-up effect - StringCutObjectSelector* pvSelect_; - - /// extra isolation criterion on muon - StringCutObjectSelector* muonIso_; - /// extra selection on muons - StringCutObjectSelector* muonSelect_; - - /// jetCorrector - std::string jetCorrector_; - /// jetID as an extra selection type - edm::InputTag jetIDLabel_; - /// extra jetID selection on calo jets - StringCutObjectSelector* jetIDSelect_; - /// extra selection on jets (here given as std::string as it depends - /// on the the jet type, which selections are valid and which not) - std::string jetSelect_; - /// include btag information or not - /// to be determined from the cfg - bool includeBTag_; - /// btag discriminator labels - edm::InputTag btagEff_, btagPur_, btagVtx_; - /// btag working points - double btagEffWP_, btagPurWP_, btagVtxWP_; - /// mass window upper and lower edge - double lowerEdge_, upperEdge_; - - /// number of logged interesting events - int logged_; - /// storage manager - DQMStore* store_; - /// histogram container - std::map hists_; - }; - - inline void - MonitorEnsemble::triggerBinLabels(std::string channel, const std::vector& labels) - { - for(unsigned int idx=0; idxsetBinLabel( idx+1, "["+monitorPath(labels[idx])+"]", 1); - hists_[(channel+"Eff_").c_str()]->setBinLabel( idx+1, "["+selectionPath(labels[idx])+"]|["+monitorPath(labels[idx])+"]", 1); - } - } - - inline void - MonitorEnsemble::fill(const edm::Event& event, const edm::TriggerResults& triggerTable, std::string channel, const std::vector& labels) const - { - for(unsigned int idx=0; idxsecond->getBinContent(idx+1); - double value = hists_.find((channel+"Eff_").c_str())->second->getBinContent(idx+1); - fill((channel+"Eff_").c_str(), idx+0.5, 1./evts*(acceptHLT(event, triggerTable, selectionPath(labels[idx]))-value)); - } - } - } - -} - -#include - -#include "DQM/Physics/interface/TopDQMHelpers.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/ServiceRegistry/interface/Service.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -#include "FWCore/Common/interface/TriggerNames.h" -#include "DataFormats/BeamSpot/interface/BeamSpot.h" -#include "DataFormats/VertexReco/interface/Vertex.h" -#include "DataFormats/Common/interface/TriggerResults.h" - -/** - \class TopHLTSingleLeptonDQM TopHLTSingleLeptonDQM.h "DQM/Physics/plugins/TopHLTSingleLeptonDQM.h" - - \brief Module to apply a monitored selection of top like events in the semi-leptonic channel - - Plugin to apply a monitored selection of top like events with some minimal flexibility - in the number and definition of the selection steps. To achieve this flexibility it - employes the SelectionStep class. The MonitorEnsemble class is used to provide a well - defined set of histograms to be monitored after each selection step. The SelectionStep - class provides a flexible and intuitive selection via the StringCutParser. SelectionStep - and MonitorEnsemble classes are interleaved. The monitoring starts after a preselection - step (which is not monitored in the context of this module) with an instance of the - MonitorEnsemble class. The following objects are supported for selection: - - - jets : of type reco::Jet (jets), reco::CaloJet (jets/calo) or reco::PFJet (jets/pflow) - - elecs : of type reco::GsfElectron - - muons : of type reco::Muon - - met : of type reco::MET - - These types have to be present as prefix of the selection step paramter _label_ separated - from the rest of the label by a ':' (e.g. in the form "jets:step0"). The class expects - selection labels of this type. They will be disentangled by the private helper functions - _objectType_ and _seletionStep_ as declared below. -*/ - -/// define MonitorEnsembple to be used -//using TopHLTSingleLepton::MonitorEnsemble; - -class TopHLTSingleLeptonDQM : public edm::EDAnalyzer { - public: - /// default constructor - TopHLTSingleLeptonDQM(const edm::ParameterSet& cfg); - /// default destructor - ~TopHLTSingleLeptonDQM(){ - if( vertexSelect_ ) delete vertexSelect_; - if( beamspotSelect_ ) delete beamspotSelect_; - }; - - /// do this during the event loop - virtual void analyze(const edm::Event& event, const edm::EventSetup& setup); - - private: - /// deduce object type from ParameterSet label, the label - /// is expected to be of type 'objectType:selectionStep' - std::string objectType(const std::string& label) { return label.substr(0, label.find(':')); }; - /// deduce selection step from ParameterSet label, the - /// label is expected to be of type 'objectType:selectionStep' - std::string selectionStep(const std::string& label) { return label.substr(label.find(':')+1); }; - - private: - /// trigger table - edm::InputTag triggerTable_; - /// trigger paths - std::vector triggerPaths_; - /// primary vertex - edm::InputTag vertex_; - /// string cut selector - StringCutObjectSelector* vertexSelect_; - - /// beamspot - edm::InputTag beamspot_; - /// string cut selector - StringCutObjectSelector* beamspotSelect_; - - /// needed to guarantee the selection order as defined by the order of - /// ParameterSets in the _selection_ vector as defined in the config - std::vector selectionOrder_; - /// this is the heart component of the plugin; std::string keeps a label - /// the selection step for later identification, edm::ParameterSet keeps - /// the configuration of the selection for the SelectionStep class, - /// MonitoringEnsemble keeps an instance of the MonitorEnsemble class to - /// be filled _after_ each selection step - std::map > selection_; - - std::vector metsTemp_; - - edm::EDGetTokenT< edm::View > muonsToken_; - edm::EDGetTokenT< edm::View > elecsToken_; - edm::EDGetTokenT< edm::View > jetsToken_; - - edm::EDGetTokenT< edm::ValueMap > electronIdToken_; - edm::EDGetTokenT jetIDToken_; - - edm::EDGetTokenT triggerTableToken_; - edm::EDGetTokenT< std::vector > vertexToken_; - edm::EDGetTokenT< edm::View > pvsToken_; - edm::EDGetTokenT beamspotToken_; - - edm::EDGetTokenT btagEffToken_, btagPurToken_, btagVtxToken_; - - std::vector< edm::EDGetTokenT< edm::View > > metsTokens_; -}; - -#endif diff --git a/HLTriggerOffline/Top/src/TopSingleLeptonHLTValidation.cc b/HLTriggerOffline/Top/src/TopSingleLeptonHLTValidation.cc new file mode 100644 index 0000000000000..69d399eb3e0d2 --- /dev/null +++ b/HLTriggerOffline/Top/src/TopSingleLeptonHLTValidation.cc @@ -0,0 +1,235 @@ +// -*- C++ -*- +// +// Package: HLTriggerOffline/Top +// Class: TopSingleLeptonHLTValidation +// +/**\class TopSingleLeptonHLTValidation TopSingleLeptonHLTValidation.cc HLTriggerOffline/Top/src/TopSingleLeptonHLTValidation.cc + +Description: + + Description: compute efficiencies of trigger paths on offline reco selection with respect to pt and eta + +Implementation: + harvesting +*/ +// +// Original Author: Elvire Bouvier +// Created: Thu, 16 Jan 2014 16:27:35 GMT +// +// +#include "HLTriggerOffline/Top/interface/TopSingleLeptonHLTValidation.h" + +// system include files +#include + +// user include files +#include "FWCore/Framework/interface/Frameworkfwd.h" + +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/MakerMacros.h" + +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ServiceRegistry/interface/Service.h" + +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "HLTrigger/HLTcore/interface/HLTConfigProvider.h" +#include "FWCore/Common/interface/TriggerNames.h" +#include "TString.h" +#include "DataFormats/MuonReco/interface/MuonPFIsolation.h" +// +// member functions +// + +// ------------ method called for each event ------------ + void +TopSingleLeptonHLTValidation::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) +{ + using namespace edm; + + isAll_ = false; isSel_ = false; + + // Electrons + Handle< edm::View > electrons; + iEvent.getByToken(tokElectrons_,electrons); + unsigned int nGoodE = 0; + for(edm::View::const_iterator e = electrons->begin(); e != electrons->end(); ++e){ + if (e->pt() < ptElectrons_) continue; + if (fabs(e->eta()) > etaElectrons_) continue; + if ((e->dr03TkSumPt()+e->dr03EcalRecHitSumEt()+e->dr03HcalTowerSumEt())/e->pt() > isoElectrons_ ) continue; + nGoodE++; + if (nGoodE == 1) elec_ = &(*e); + } + // Muons + Handle< edm::View > muons; + iEvent.getByToken(tokMuons_,muons); + unsigned int nGoodM = 0; + for(edm::View::const_iterator m = muons->begin(); m != muons->end(); ++m){ + if (!m->isPFMuon() || !m->isGlobalMuon()) continue; + if (m->pt() < ptMuons_) continue; + if (fabs(m->eta()) > etaMuons_) continue; + if (((m->pfIsolationR04()).sumChargedHadronPt+(m->pfIsolationR04()).sumPhotonEt+(m->pfIsolationR04()).sumNeutralHadronEt)/m->pt() > isoMuons_ ) continue; + nGoodM++; + if (nGoodM == 1) mu_ = &(*m); + } + // Jets + Handle< edm::View > jets; + iEvent.getByToken(tokJets_,jets); + unsigned int nGoodJ = 0; + if (minJets_ == 4) { + for(edm::View::const_iterator j = jets->begin(); j != jets->end(); ++j){ + if (nGoodJ < 1 && j->pt() < 55) continue; + if (nGoodJ < 2 && j->pt() < 45) continue; + if (nGoodJ < 3 && j->pt() < 35) continue; + if (nGoodJ >= 3 && j->pt() < 20) continue; + if (fabs(j->eta()) > etaJets_) continue; + nGoodJ++; + if (nGoodJ == minJets_) jet_ = &(*j); + } + } + else { + for(edm::View::const_iterator j = jets->begin(); j != jets->end(); ++j){ + if (j->pt() < ptJets_) continue; + if (fabs(j->eta()) > etaJets_) continue; + nGoodJ++; + if (nGoodJ == minJets_) jet_ = &(*j); + } + } + + if (nGoodE >= minElectrons_ && nGoodM >= minMuons_ && nGoodJ >= minJets_) isAll_ = true; + + //Trigger + Handle triggerTable; + iEvent.getByToken(tokTrigger_,triggerTable); + const edm::TriggerNames& triggerNames = iEvent.triggerNames(*triggerTable); + for (unsigned int i=0; i 0) { + hDenLeptonPt->Fill(elec_->pt()); + hDenLeptonEta->Fill(elec_->eta()); + } + if (minMuons_ > 0) { + hDenLeptonPt->Fill(mu_->pt()); + hDenLeptonEta->Fill(mu_->eta()); + } + hDenJetPt->Fill(jet_->pt()); + hDenJetEta->Fill(jet_->eta()); + } + if (isSel_) { + if (minElectrons_ > 0) { + hNumLeptonPt->Fill(elec_->pt()); + hNumLeptonEta->Fill(elec_->eta()); + } + if (minMuons_ > 0) { + hNumLeptonPt->Fill(mu_->pt()); + hNumLeptonEta->Fill(mu_->eta()); + } + hNumJetPt->Fill(jet_->pt()); + hNumJetEta->Fill(jet_->eta()); + } + } +} + + +// ------------ method called once each job just before starting event loop ------------ + void +TopSingleLeptonHLTValidation::beginJob() +{ +} + +// ------------ method called once each job just after ending the event loop ------------ + void +TopSingleLeptonHLTValidation::endJob() +{ +} + +// ------------ method called when starting to processes a run ------------ +/* + void + TopSingleLeptonHLTValidation::beginRun(edm::Run const&, edm::EventSetup const&) + { + } + */ + +// ------------ method called when ending the processing of a run ------------ + + void +TopSingleLeptonHLTValidation::endRun(edm::Run const&, edm::EventSetup const&) +{ + dbe_->setCurrentFolder(sDir_); + hEffLeptonPt = dbe_->book1D("EfficiencyVsPtLepton", "EfficiencyVsPtLepton", 50, 0., 250.); + hEffLeptonEta = dbe_->book1D("EfficiencyVsEtaLepton", "EfficiencyVsEtaLepton", 30, -3. , 3.); + hEffJetPt = dbe_->book1D("EfficiencyVsPtLastJet", "EfficiencyVsPtLastJet", 60, 0., 300.); + hEffJetEta = dbe_->book1D("EfficiencyVsEtaLastJet", "EfficiencyVsEtaLastJet", 30, -3., 3.); + + //------ Efficiency wrt + // lepton pt + for (int iBin = 1; iBin <= hNumLeptonPt->GetNbinsX(); ++iBin) + { + if(hDenLeptonPt->GetBinContent(iBin) == 0) + hEffLeptonPt->setBinContent(iBin, 0.); + else + hEffLeptonPt->setBinContent(iBin, hNumLeptonPt->GetBinContent(iBin) / hDenLeptonPt->GetBinContent(iBin)); + } + // lepton eta + for (int iBin = 1; iBin <= hNumLeptonEta->GetNbinsX(); ++iBin) + { + if(hDenLeptonEta->GetBinContent(iBin) == 0) + hEffLeptonEta->setBinContent(iBin, 0.); + else + hEffLeptonEta->setBinContent(iBin, hNumLeptonEta->GetBinContent(iBin) / hDenLeptonEta->GetBinContent(iBin)); + } + // jet pt + for (int iBin = 1; iBin <= hNumJetPt->GetNbinsX(); ++iBin) + { + if(hDenJetPt->GetBinContent(iBin) == 0) + hEffJetPt->setBinContent(iBin, 0.); + else + hEffJetPt->setBinContent(iBin, hNumJetPt->GetBinContent(iBin) / hDenJetPt->GetBinContent(iBin)); + } + // jet eta + for (int iBin = 1; iBin <= hNumJetEta->GetNbinsX(); ++iBin) + { + if(hDenJetEta->GetBinContent(iBin) == 0) + hEffJetEta->setBinContent(iBin, 0.); + else + hEffJetEta->setBinContent(iBin, hNumJetEta->GetBinContent(iBin) / hDenJetEta->GetBinContent(iBin)); + } +} + + +// ------------ method called when starting to processes a luminosity block ------------ +/* + void + TopSingleLeptonHLTValidation::beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) + { + } + */ + +// ------------ method called when ending the processing of a luminosity block ------------ +/* + void + TopSingleLeptonHLTValidation::endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) + { + } + */ + +// ------------ method fills 'descriptions' with the allowed parameters for the module ------------ +void +TopSingleLeptonHLTValidation::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + //The following says we do not know what parameters are allowed so do no validation + // Please change this to state exactly what you do use, even if it is no parameters + edm::ParameterSetDescription desc; + desc.setUnknown(); + descriptions.addDefault(desc); +} + diff --git a/HLTriggerOffline/Top/src/TopValidation.cc b/HLTriggerOffline/Top/src/TopValidation.cc deleted file mode 100644 index 482cb55da7767..0000000000000 --- a/HLTriggerOffline/Top/src/TopValidation.cc +++ /dev/null @@ -1,859 +0,0 @@ -// -*- C++ -*- -// -// Package: TopValidation -// Class: TopValidation -// -/**\class TopValidation TopValidation.cc DQM/TopValidation/src/TopValidation.cc - - Description: - - Implementation: - -*/ -// -// Original Author: Patricia LOBELLE PARDO () -// Created: Tue Sep 23 11:06:32 CEST 2008 -// -// - - -# include "HLTriggerOffline/Top/interface/TopValidation.h" -#include "FWCore/Common/interface/TriggerNames.h" - - - -TopValidation::TopValidation(const edm::ParameterSet& iConfig) - -{ - - - inputTag_ = iConfig.getParameter("TriggerResultsCollection"); - hlt_bitnames = iConfig.getParameter >("hltPaths"); - hlt_bitnamesMu = iConfig.getParameter >("hltMuonPaths"); - hlt_bitnamesEg = iConfig.getParameter >("hltEgPaths"); - hlt_bitnamesJet = iConfig.getParameter >("hltJetPaths"); - // triggerTag_ = iConfig.getUntrackedParameter("DQMFolder","HLT/Top"); - outputFileName = iConfig.getParameter("OutputFileName"); - outputMEsInRootFile = iConfig.getParameter("OutputMEsInRootFile"); - FolderName_ = iConfig.getParameter("FolderName"); - offlineElectrons = iConfig.getParameter("offlineElectrons"); - - topFolder << FolderName_ ; - - muonsToken_ = consumes(std::string("muons")); - ctfWithMaterialTracksToken_ = consumes(std::string("ctfWithMaterialTracks")); - iterativeCone5CaloJetsToken_ = consumes(std::string("iterativeCone5CaloJets")); - offlineElectronsToken_ = consumes(iConfig.getParameter("offlineElectrons")); - inputTagToken_ = consumes(iConfig.getParameter("TriggerResultsCollection")); - genParticlesToken_ = consumes(std::string("genParticles")); - -} - - -TopValidation::~TopValidation() -{ - - // do anything here that needs to be done at desctruction time - // (e.g. close files, deallocate resources etc.) - -} - - -// -// member functions -// - - -// ------------ method called to for each event ------------ -void -TopValidation::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) -{ - using namespace edm; - - - // muon collection - Handle muonsH; - iEvent.getByToken(muonsToken_, muonsH); - - // tracks collection - Handle tracks; - iEvent.getByToken(ctfWithMaterialTracksToken_, tracks); - - - // get calo jet collection - Handle jetsHandle; - iEvent.getByToken(iterativeCone5CaloJetsToken_, jetsHandle); - - - // electron collection - Handle electronsH; - iEvent.getByToken(offlineElectronsToken_,electronsH); - - // Trigger - Handle trh; - iEvent.getByToken(inputTagToken_,trh); - if( ! trh.isValid() ) { - LogDebug("") << "HL TriggerResults with label ["+inputTag_.encode()+"] not found!"; - return; - } - - - - const edm::TriggerNames & triggerNames = iEvent.triggerNames(*trh); - - ////////////////////////////////// - // generation info - ///////////////////////////////// - - //bool topevent = false; - - int ntop = 0; - int ngenel = 0; - int ngenmu = 0; - int ngentau = 0; - int ngenlep = 0; - int nmuaccept= 0; - int nelaccept= 0; - - // Gen Particles Collection - Handle genParticles; - iEvent.getByToken(genParticlesToken_, genParticles); - - for (size_t i=0; i < genParticles->size(); ++i){ - const reco::Candidate & p = (*genParticles)[i]; - int id = p.pdgId(); - int st = p.status(); - - if (abs(id) == 6 && st == 3) ntop++; - - if (st==3 && abs(id)==11) { - ngenel++; - if ( p.pt()>10 && fabs(p.eta())<2.4) nelaccept++; - } - - if (st==3 && abs(id)==13) { - ngenmu++; - if ( p.pt()>10 && fabs(p.eta())<2.4) nmuaccept++; - } - - if (st==3 && abs(id)==15) ngentau++; - if (st==3 && ( abs(id)==11 || abs(id)==13 || abs(id)==15)) ngenlep++; - - } - - // if (ntop == 2) topevent = true; - - - - // if (topevent){ - - //////////////////////////// - //////// Muons - ///////////////////////////////// - - //Muon Collection to use - std::map muonMap; - - for (size_t i = 0; i< muonsH->size(); ++i){ - if ( (*muonsH)[i].isGlobalMuon() && (*muonsH)[i].pt()>15 && fabs((*muonsH)[i].eta())<2.1){ - muonMap[(*muonsH)[i].pt()] = (*muonsH)[i]; - } - } - - //Muon selection - bool TwoMuonsAccepted = false; - - std::vector selected_muons; - reco::Muon muon1,muon2; - - for( std::map::reverse_iterator rit=muonMap.rbegin(); rit!=muonMap.rend(); ++rit){ - selected_muons.push_back( (*rit).second ); - } - - if (selected_muons.size()==1) muon1 = selected_muons[0]; - - if (selected_muons.size()>1){ - muon1 = selected_muons[0]; - muon2 = selected_muons[1]; - } - - - if( selected_muons.size()>1 && muon1.pt() >20 && muon1.charge()*muon2.charge()<0 ) TwoMuonsAccepted = true; - - - ////////////////////////////////// - ///////// Electrons - /////////////////////////////////////// - - //Electron Collection to use - std::map electronMap; - - for (size_t i = 0; isize();++i){ - if( (*electronsH)[i].pt()>15 && fabs( (*electronsH)[i].eta() )<2.4) { - electronMap[(*electronsH)[i].pt()] = (*electronsH)[i]; - } - } - - //Electron selection - bool TwoElectronsAccepted = false; - - std::vector selected_electrons; - reco::GsfElectron electron1, electron2; - - for( std::map::reverse_iterator rit=electronMap.rbegin(); rit!=electronMap.rend(); ++rit){ - selected_electrons.push_back( (*rit).second ); - } - - if (selected_electrons.size()==1) electron1 = selected_electrons[0]; - - if (selected_electrons.size()>1){ - - electron1 = selected_electrons[0]; - electron2 = selected_electrons[1]; - } - - - if( selected_electrons.size()>1 && electron1.pt() >20 && electron1.charge()*electron2.charge()<0 ) TwoElectronsAccepted = true; - - - - ///////////////////////////////// - ////////// Jets - ///////////////////////////////// - - //Jet Collection to use - - // Raw jets - const reco::CaloJetCollection *jets = jetsHandle.product(); - reco::CaloJetCollection::const_iterator jet; - - int n_jets_20=0; - - for (jet = jets->begin(); jet != jets->end(); jet++){ - // if (fabs(jet->eta()) <2.4 && jet->et() > 20) n_jets_20++; - // if (fabs(jet->eta()) <2.4 && jet->et() > 13) n_jets_20++; - if (fabs(jet->eta()) <2.4 && jet->et() > 13) n_jets_20++; - } - - -//// sort jets by et - /* std::map jetMap; - - for (size_t i = 0; isize();++i){ - if ((*jetsHandle)[i].et()>13 && fabs( (*jetsHandle)[i].eta())<2.4){ - - - jetMap[(*jetsHandle)[i].et()] = (*jetsHandle)[i]; - } - } - - std::vector selected_jets; - reco::CaloJet jet1, jet2; - - for( std::map::reverse_iterator rit=jetMap.rbegin(); rit!=jetMap.rend(); ++rit){ - selected_jets.push_back( (*rit).second ); - } - - if (selected_jets.size()>1){ - jet1 = selected_jets[0]; - jet2 = selected_jets[1]; - } - -*/ - -////////////////////////////////////////////////////////// -///// -//// "Offline" selection -///// -///////////////////////////////////////////////// - - - - bool offline_mu = false; - bool offline_dimu = false; - bool offline_el = false; - bool offline_diel = false; - bool offline_emu = false; - - - if ( selected_muons.size()>0 && muon1.pt()>20 && n_jets_20>1) offline_mu=true; - if ( TwoMuonsAccepted && n_jets_20>1) offline_dimu=true; - if ( selected_electrons.size()>0 && electron1.pt()>20 && n_jets_20>1) offline_el=true; - if ( TwoElectronsAccepted && n_jets_20>1) offline_diel=true; - if ( selected_muons.size()>0 && selected_electrons.size()>0 && (muon1.pt()>20 || electron1.pt()>20) && (muon1.charge()!= electron1.charge()) && n_jets_20>1) offline_emu=true; - - - - - ////////////////////////////// - // store fired bits - /////////////////////////////// - - int wtrig_[100] ={0}; - int wtrig_m[100] ={0}; - int wtrig_eg[100]={0}; - int wtrig_jet[100]={0}; - - bool HLTQuadJet30 = false; - bool HLTMu9 = false; - - - int n_hlt_bits = hlt_bitnames.size(); - int n_hlt_bits_mu = hlt_bitnamesMu.size(); - int n_hlt_bits_eg = hlt_bitnamesEg.size(); - int n_hlt_bits_jet= hlt_bitnamesJet.size(); - - const unsigned int n_TriggerResults( trh.product()->size()); - - for (unsigned int itrig=0; itrig< n_TriggerResults; ++itrig) { - - /////////// - if (triggerNames.triggerName(itrig) == "HLT_QuadJet30"){ - if ( trh.product()->accept( itrig ) ) HLTQuadJet30=true; - } - if (triggerNames.triggerName(itrig) == "HLT_Mu9"){ - if ( trh.product()->accept( itrig ) ) HLTMu9=true; - } - ////////////////// - if (trh.product()->accept(itrig)) { - - for (int i=0;iFill(1,1); - if (ngenlep==1 && ngenmu==1) events_acc_off_muon->Fill(2,1); - events_acc_off_electron->Fill(1,1); - if (ngenlep==1 && ngenel==1) events_acc_off_electron->Fill(2,1); - - /// **** tt->munubjjb ***** - - - - if ( ngenlep==1 && ngenmu==1 && nmuaccept==1){ //Select events within acceptance - - events_acc_off_muon->Fill(3,1); - - for (int j=0;jFill(j+1); - if (wtrig_m[j]==1) { - hlt_bitmu_hist_gen->Fill(j+1); - } - } - - for (int it=0; itFill(it+1); - if (wtrig_jet[it]==1) { - hlt_bitjet_hist_gen->Fill(it+1); - } - } - - - // Efficiencies wrt MC + offline - if (offline_mu){ - - events_acc_off_muon->Fill(4,1); - - // et_off_jet_mu -> Fill(jet1.et()); - // eta_off_jet_mu-> Fill(jet1.eta()); - - for (int it=0; itFill(it+1); - if (wtrig_jet[it]==1) { - hlt_bitjet_hist_reco->Fill(it+1); - // h_etjet1_trig_mu[it]->Fill(jet1.et()); - // h_etajet1_trig_mu[it]->Fill(jet1.eta()); - - - } - - } - - eta_off_mu->Fill(muon1.eta()); - pt_off_mu-> Fill(muon1.pt()); - - for (int j=0;jFill(j+1); - if (wtrig_m[j]==1) { - h_ptmu1_trig[j]->Fill(muon1.pt()); - h_etamu1_trig[j]->Fill(muon1.eta()); - hlt_bitmu_hist_reco->Fill(j+1); - } - } - - } - } - - - -///////// 4jets+1muon efficiency monitoring - - if (HLTQuadJet30){ // events firing the 4jet30 trigger - - if (offline_mu){ // events with 1 rec muon+ 2jets - - ptmuon_4jet1muSel->Fill(muon1.pt()); - etamuon_4jet1muSel->Fill(muon1.eta()); - Njets_4jet1muSel->Fill(n_jets_20); - - if (HLTMu9){ - - ptmuon_4jet1muSel_hltmu9->Fill(muon1.pt()); - etamuon_4jet1muSel_hltmu9->Fill(muon1.eta()); - Njets_4jet1muSel_hltmu9->Fill(n_jets_20); - } - } - } - - -//////////////////////////// - - - // ***** tt->enubjjb ***** - if ( ngenlep==1 && ngenel==1 && nelaccept==1){ - - events_acc_off_electron->Fill(3,1); - - for (int j=0;jFill(j+1); - if (wtrig_eg[j]==1) { - hlt_bitel_hist_gen->Fill(j+1); - } - } - - for (int it=0; itFill(it+1); - if (wtrig_jet[it]==1) { - hlt_bitjet_hist_gen_el->Fill(it+1); - } - } - - // Efficiencies wrt mc + offline - if (offline_el){ - - events_acc_off_electron->Fill(4,1); - - /*/// jets - et_off_jet_el -> Fill(jet1.et()); - eta_off_jet_el-> Fill(jet1.eta());*/ - - for (int it=0; itFill(it+1); - if (wtrig_jet[it]==1) { - hlt_bitjet_hist_reco_el->Fill(it+1); - // h_etjet1_trig_el[it]->Fill(jet1.et()); - // h_etajet1_trig_el[it]->Fill(jet1.eta()); - } - - } - - - /// - eta_off_el->Fill(electron1.eta()); - pt_off_el->Fill(electron1.pt()); - - for (int k=0;kFill(k+1); - - if (wtrig_eg[k]==1) { - h_ptel1_trig[k]->Fill(electron1.pt()); - h_etael1_trig[k]->Fill(electron1.eta()); - hlt_bitel_hist_reco->Fill(k+1); - } - } - - } - } - - - - // ****** tt->munubmunub ***** - if ( ngenlep==2 && ngenmu==2 && nmuaccept==2){ - - - // Efficiencies wrt mc+offline - if (offline_dimu){ - - eta_off_dimu1->Fill(muon1.eta()); - eta_off_dimu2->Fill(muon2.eta()); - pt_off_dimu1->Fill(muon1.pt()); - pt_off_dimu2->Fill(muon2.pt()); - - for (int j=0;jFill(muon1.pt()); - h_etamu1_trig_dimu[j]->Fill(muon1.eta()); - } - } - } - } - - - - // ***** tt->enubenub ***** - if ( ngenlep==2 && ngenel==2 && nelaccept==2){ - - - // Efficiencies wrt mc+offline - if (offline_diel){ - - eta_off_diel1->Fill(electron1.eta()); - eta_off_diel2->Fill(electron2.eta()); - pt_off_diel1->Fill(electron1.pt()); - pt_off_diel2->Fill(electron2.pt()); - - for (int k=0;kFill(electron1.pt()); - h_etael1_trig_diel[k]->Fill(electron1.eta()); - } - } - - } - } - - - // ***** tt->enubmunub - if ( ngenlep==2 && ngenel==1 && ngenmu==1 && nmuaccept==1 && nelaccept==1){ // tt->e mu events passing acceptance - - - // Efficiencies wrt mc+offline - if (offline_emu){ - - eta_off_emu_muon->Fill(muon1.eta()); - pt_off_emu_muon->Fill(muon1.pt()); - eta_off_emu_electron->Fill(electron1.eta()); - pt_off_emu_electron->Fill(electron1.pt()); - - for (int i=0;iFill(electron1.pt()); - h_etael1_trig_em[i]->Fill(electron1.eta()); - h_ptmu1_trig_em[i]->Fill(muon1.pt()); - h_etamu1_trig_em[i]->Fill(muon1.eta()); - } - } - - } - } - - - //////////////////////////////////////////////////////////////// - //} - -} - - - -// ------------ method called once each job just before starting event loop ------------ -void -TopValidation::beginJob() -{ - - dbe = edm::Service().operator->(); - - //dbe->setCurrentFolder("HLT/Top"); - //dbe->setCurrentFolder(triggerTag_); - - - - - //////////////////////////////////////////// - ////// histos lepton pt, eta for events passing hlt, efficiencies - ///////////////////////////////////////////// - - - dbe->setCurrentFolder(topFolder.str()+"Semileptonic_muon"); - - hlt_bitmu_hist_reco = dbe->book1D("muHLT","muHLT",hlt_bitnamesMu.size(),0.5,hlt_bitnamesMu.size()+0.5); - h_mu_reco = dbe->book1D("MuonEvents","MuonEvents",hlt_bitnamesMu.size(),0.5,hlt_bitnamesMu.size()+0.5); - - hlt_bitmu_hist_gen = dbe->book1D("genmuHLT","genmuHLT",hlt_bitnamesMu.size(),0.5,hlt_bitnamesMu.size()+0.5); - h_mu_gen = dbe->book1D("genMuonEvents","genMuonEvents",hlt_bitnamesMu.size(),0.5,hlt_bitnamesMu.size()+0.5); - - events_acc_off_muon = dbe->book1D("NEvents_acc_off","NEvents_acc_off",4,0.5,4.5); - events_acc_off_muon -> setBinLabel(1,"Total Events"); - events_acc_off_muon -> setBinLabel(2,"Gen semimuon"); - events_acc_off_muon -> setBinLabel(3,"Acceptance"); - events_acc_off_muon -> setBinLabel(4,"Acceptance+offline"); - - - dbe->setCurrentFolder(topFolder.str()+"Semileptonic_electron"); - - hlt_bitel_hist_reco = dbe->book1D("elHLT","elHLT",hlt_bitnamesEg.size(),0.5,hlt_bitnamesEg.size()+0.5); - h_el_reco = dbe->book1D("ElectronEvents","ElectronEvents",hlt_bitnamesEg.size(),0.5,hlt_bitnamesEg.size()+0.5); - - - hlt_bitel_hist_gen = dbe->book1D("genelHLT","genelHLT",hlt_bitnamesEg.size(),0.5,hlt_bitnamesEg.size()+0.5); - h_el_gen = dbe->book1D("genElectronEvents","genElectronEvents",hlt_bitnamesEg.size(),0.5,hlt_bitnamesEg.size()+0.5); - - - events_acc_off_electron = dbe->book1D("NEvents_acc_off","NEvents_acc_off",4,0.5,4.5); - events_acc_off_electron -> setBinLabel(1,"Total Events"); - events_acc_off_electron -> setBinLabel(2,"Gen semielectron"); - events_acc_off_electron -> setBinLabel(3,"Acceptance"); - events_acc_off_electron -> setBinLabel(4,"Acceptance+offline"); - - - dbe->setCurrentFolder(topFolder.str()+"Jets"); - - h_jet_reco = dbe->book1D("denom","denom",hlt_bitnamesJet.size(),0.5,hlt_bitnamesJet.size()+0.5); - hlt_bitjet_hist_reco = dbe->book1D("numer","numer",hlt_bitnamesJet.size(),0.5,hlt_bitnamesJet.size()+0.5); - - h_jet_reco_el = dbe->book1D("denom_el","denom_el",hlt_bitnamesJet.size(),0.5,hlt_bitnamesJet.size()+0.5); - hlt_bitjet_hist_reco_el = dbe->book1D("numer_el","numer_el",hlt_bitnamesJet.size(),0.5,hlt_bitnamesJet.size()+0.5); - - /// - h_jet_gen = dbe->book1D("denom_gen","denom_gen",hlt_bitnamesJet.size(),0.5,hlt_bitnamesJet.size()+0.5); - hlt_bitjet_hist_gen = dbe->book1D("numer_gen","numer_gen",hlt_bitnamesJet.size(),0.5,hlt_bitnamesJet.size()+0.5); - - h_jet_gen_el = dbe->book1D("denom_el_gen","denom_el_gen",hlt_bitnamesJet.size(),0.5,hlt_bitnamesJet.size()+0.5); - hlt_bitjet_hist_gen_el = dbe->book1D("numer_el_gen","numer_el_gen",hlt_bitnamesJet.size(),0.5,hlt_bitnamesJet.size()+0.5); - - - ///////// - /* et_off_jet_mu = dbe->book1D ("Jet1Et_M","Jet1Et_M",51,0.0,150.0); - et_off_jet_el = dbe->book1D ("Jet1Et_E","Jet1Et_E",51,0.0,150.0); - eta_off_jet_mu = dbe->book1D ("Jet1Eta_M","Jet1Eta_M",51,-2.5,2.5); - eta_off_jet_el = dbe->book1D ("Jet1Eta_E","Jet1Eta_E",51,-2.5,2.5); - njets_off_mu = dbe->book1D ("NJets_M","NJets_M",11,-0.5,10.5); - njets_off_el = dbe->book1D ("NJets_E","NJets_E",11,-0.5,10.5); - - - - - for (size_t j=0;j setBinLabel(j+1,hlt_bitnamesJet[j].c_str()); - h_jet_reco -> setBinLabel(j+1,hlt_bitnamesJet[j].c_str()); - h_jet_reco_el -> setBinLabel(j+1,hlt_bitnamesJet[j].c_str()); - h_etjet1_trig_mu[j] = dbe->book1D((histname_etjet).c_str(),(hlt_bitnamesJet[j]+"jetEt_M").c_str(),51,0.0,150.); - h_etjet1_trig_el[j] = dbe->book1D((histname_etjet_el).c_str(),(hlt_bitnamesJet[j]+"jetEt_E").c_str(),51,0.0,150.); - h_etajet1_trig_mu[j] = dbe->book1D((histname_etajet).c_str(),(hlt_bitnamesJet[j]+"jetEta_M").c_str(),51,-2.5,2.5); - h_etajet1_trig_el[j] = dbe->book1D((histname_etajet_el).c_str(),(hlt_bitnamesJet[j]+"jetEta_E").c_str(),51,-2.5,2.5); - - - } - */ - - - - dbe->setCurrentFolder(topFolder.str()+"Dileptonic_emu"); - - - for (size_t j=0;jbook1D((histname_ptmu_em).c_str(),(hlt_bitnames[j]+"_muonPt_EM").c_str(),40,0.0,150.); - h_etamu1_trig_em[j] = dbe->book1D((histname_etamu_em).c_str(),(hlt_bitnames[j]+"_muonEta_EM").c_str(),51,-2.5,2.5); - - h_ptel1_trig_em[j] = dbe->book1D((histname_ptel_em).c_str(),(hlt_bitnames[j]+"_electronPt_EM").c_str(),40,0.0,150.); - h_etael1_trig_em[j] = dbe->book1D((histname_etael_em).c_str(),(hlt_bitnames[j]+"_electronEta_EM").c_str(),51,-2.5,2.5); - - } - - - - - for (size_t jj=0;jjsetCurrentFolder(topFolder.str()+"Semileptonic_muon"); - h_ptmu1_trig[jj] = dbe->book1D((histname_ptmu).c_str(),(hlt_bitnamesMu[jj]+"muonPt_M").c_str(),40,0.0,150.); - h_etamu1_trig[jj] = dbe->book1D((histname_etamu).c_str(),(hlt_bitnamesMu[jj]+"muonEta_M").c_str(),51,-2.5,2.5); - - hlt_bitmu_hist_reco -> setBinLabel(jj+1,hlt_bitnamesMu[jj].c_str()); - h_mu_reco -> setBinLabel(jj+1,hlt_bitnamesMu[jj].c_str()); - - hlt_bitmu_hist_gen -> setBinLabel(jj+1,hlt_bitnamesMu[jj].c_str()); - h_mu_gen -> setBinLabel(jj+1,hlt_bitnamesMu[jj].c_str()); - - dbe->setCurrentFolder(topFolder.str()+"Dileptonic_muon"); - h_ptmu1_trig_dimu[jj] = dbe->book1D((histname_ptmu_dimu).c_str(),(hlt_bitnamesMu[jj]+"muon1Pt_MM").c_str(),40,0.0,150.); - h_etamu1_trig_dimu[jj] = dbe->book1D((histname_etamu_dimu).c_str(),(hlt_bitnamesMu[jj]+"muon1Pt_MM").c_str(),51,-2.5,2.5); - - - - - } - - - - - - - for (size_t k=0;ksetCurrentFolder(topFolder.str()+"Semileptonic_electron"); - - h_ptel1_trig[k] = dbe->book1D((histname_ptel).c_str(),(hlt_bitnamesEg[k]+"electronPt_E").c_str(),40,0.0,150.); - h_etael1_trig[k] = dbe->book1D((histname_etael).c_str(),(hlt_bitnamesEg[k]+"electronEta_E").c_str(),51,-2.5,2.5); - - hlt_bitel_hist_reco -> setBinLabel(k+1,hlt_bitnamesEg[k].c_str()); - h_el_reco -> setBinLabel(k+1,hlt_bitnamesEg[k].c_str()); - - hlt_bitel_hist_gen -> setBinLabel(k+1,hlt_bitnamesEg[k].c_str()); - h_el_gen -> setBinLabel(k+1,hlt_bitnamesEg[k].c_str()); - - - dbe->setCurrentFolder(topFolder.str()+"Dileptonic_electron"); - h_ptel1_trig_diel[k] = dbe->book1D((histname_ptel_diel).c_str(),(hlt_bitnamesEg[k]+"electron1Pt_EE").c_str(),40,0.0,150.); - h_etael1_trig_diel[k] = dbe->book1D((histname_etael_diel).c_str(),(hlt_bitnamesEg[k]+"electron1Eta_EE").c_str(),51,-2.5,2.5); - - - - - - } - - - -///////////////////////////////////////// -/// histos lepton pt, eta -//////////////////////////////////////////7 - - - // 4 jets+1mu eff monitoring - - dbe->setCurrentFolder(topFolder.str()+"4JetsPlus1MuonToCompareWithData"); - - ptmuon_4jet1muSel = dbe->book1D ("Muon1Pt_4Jets1MuonMon", "Muon1Pt_4Jets1MuonMon",40, 0.0,150.0); - etamuon_4jet1muSel = dbe->book1D ("Muon1Eta_4Jets1MuonMon","Muon1Eta_4Jets1MuonMon",51, -2.5,2.5); - Njets_4jet1muSel = dbe->book1D ("NJets_4Jets1MuonMon", "NJets_4Jets1MuonMon",11, -0.5,10.5); - - ptmuon_4jet1muSel_hltmu9 = dbe->book1D ("Muon1Pt_4Jets1MuonHLTMu9Mon", "Muon1Pt_4Jets1MuonHLTMu9Mon",40, 0.0,150.0); - etamuon_4jet1muSel_hltmu9 = dbe->book1D ("Muon1Eta_4Jets1MuonHLTMu9Mon","Muon1Eta_4Jets1MuonHLTMu9Mon",51, -2.5,2.5); - Njets_4jet1muSel_hltmu9 = dbe->book1D ("NJets_4Jets1MuonHLTMu9Mon", "NJets_4Jets1MuonHLTMu9Mon",11, -0.5,10.5); - - - - //semimu events - dbe->setCurrentFolder(topFolder.str()+"Semileptonic_muon"); - - - - eta_off_mu = dbe->book1D ("Muon1Eta_M","Muon1Eta_M",51,-2.5,2.5); - pt_off_mu = dbe->book1D ("Muon1Pt_M","Muon1Pt_M",40,0.0,150.0); - - - //semiel events - dbe->setCurrentFolder(topFolder.str()+"Semileptonic_electron"); - - eta_off_el = dbe->book1D ("Electron1Eta_E","Electron1Eta_E",51,-2.5,2.5); - pt_off_el = dbe->book1D ("Electron1Pt_E","Electron1Pt_E",40,0.0,150.0); - - - - //dimu events - dbe->setCurrentFolder(topFolder.str()+"Dileptonic_muon"); - - - eta_off_dimu1 = dbe->book1D ("Muon1Eta_MM","Muon1Eta_MM",51,-2.5,2.5); - pt_off_dimu1 = dbe->book1D ("Muon1Pt_MM","Muon1Pt_MM",40,0.0,150.0); - eta_off_dimu2 = dbe->book1D ("Muon2Eta_MM","Muon2Eta_MM",51,-2.5,2.5); - pt_off_dimu2 = dbe->book1D ("Muon2Pt_MM","Muon2Pt_MM",40,0.0,150.0); - - - - //diel events - dbe->setCurrentFolder(topFolder.str()+"Dileptonic_electron"); - - - eta_off_diel1 = dbe->book1D ("Electron1Eta_EE","Electron1Eta_EE",51,-2.5,2.5); - pt_off_diel1 = dbe->book1D ("Electron1Pt_EE","Electron1Pt_EE",40,0.0,150.0); - eta_off_diel2 = dbe->book1D ("Electron2Eta_EE","Electron2Eta_EE",51,-2.5,2.5); - pt_off_diel2 = dbe->book1D ("Electron2Pt_EE","Electron2Pt_EE",40,0.0,150.0); - - - //emu events - dbe->setCurrentFolder(topFolder.str()+"Dileptonic_emu"); - - - - eta_off_emu_muon = dbe->book1D ("Muon1Eta_EM","Muon1Eta_EM",51,-2.5,2.5); - pt_off_emu_muon = dbe->book1D ("Muon1Pt_EM","Muon1Pt_EM",40,0.0,150.0); - - eta_off_emu_electron = dbe->book1D ("Electron1Eta_EM","Electron1Eta_EM",51,-2.5,2.5); - pt_off_emu_electron = dbe->book1D ("Electron1Pt_EM","Electron1Pt_EM",40,0.0,150.0); - - - - - return ; - - -} - -// ------------ method called once each job just after ending the event loop ------------ -void -TopValidation::endJob() { -//Write DQM thing.. - // outFile_ = "prueba"; - //if(outFile_.size()>0) - - - // if (&*edm::Service()) edm::Service()->save (outFile_); - if(outputMEsInRootFile){ - dbe->showDirStructure(); - dbe->save(outputFileName); - } - - - - - - return ; -} - -//define this as a plug-in -//DEFINE_FWK_MODULE(TopValidation); diff --git a/HLTriggerOffline/Top/src/plugins.cc b/HLTriggerOffline/Top/src/plugins.cc deleted file mode 100644 index 37599d59910e7..0000000000000 --- a/HLTriggerOffline/Top/src/plugins.cc +++ /dev/null @@ -1,11 +0,0 @@ -#include "FWCore/PluginManager/interface/ModuleDef.h" -#include "FWCore/Framework/interface/MakerMacros.h" -#include "HLTriggerOffline/Top/interface/TopValidation.h" -#include "HLTriggerOffline/Top/src/TopHLTDiLeptonOfflineDQM.h" -#include "HLTriggerOffline/Top/src/TopHLTSingleLeptonDQM.h" -#include "HLTriggerOffline/Top/interface/HLTEfficiencyCalculator.h" - -DEFINE_FWK_MODULE(TopValidation); -DEFINE_FWK_MODULE(TopHLTDiLeptonOfflineDQM); -DEFINE_FWK_MODULE(TopHLTSingleLeptonDQM); -DEFINE_FWK_MODULE(HLTEffCalculator); From eb067740cd46b7bad17a0be942fd6f8f3ae8386c Mon Sep 17 00:00:00 2001 From: Elvire Bouvier Date: Thu, 23 Jan 2014 19:35:46 +0100 Subject: [PATCH 10/26] dileptonic ttbar --- .../Top/interface/TopDiLeptonHLTValidation.h | 173 +++++++++++++ .../topDiLeptonHLTEventValidation_cfi.py | 79 ++++++ .../Top/python/topHLTValidation_cff.py | 11 +- .../Top/src/TopDiLeptonHLTValidation.cc | 241 ++++++++++++++++++ 4 files changed, 498 insertions(+), 6 deletions(-) create mode 100644 HLTriggerOffline/Top/interface/TopDiLeptonHLTValidation.h create mode 100644 HLTriggerOffline/Top/python/topDiLeptonHLTEventValidation_cfi.py create mode 100644 HLTriggerOffline/Top/src/TopDiLeptonHLTValidation.cc diff --git a/HLTriggerOffline/Top/interface/TopDiLeptonHLTValidation.h b/HLTriggerOffline/Top/interface/TopDiLeptonHLTValidation.h new file mode 100644 index 0000000000000..0d03be755be65 --- /dev/null +++ b/HLTriggerOffline/Top/interface/TopDiLeptonHLTValidation.h @@ -0,0 +1,173 @@ +// -*- C++ -*- +// +// Package: HLTriggerOffline/Top +// Class: TopDiLeptonHLTValidation +// +/**\class TopDiLeptonHLTValidation TopDiLeptonHLTValidation.h HLTriggerOffline/Top/TopDiLeptonHLTValidation.h + + Description: + + Description: compute efficiencies of trigger paths on offline reco selection with respect to pt and eta + + Implementation: + harvesting + +*/ +// +// Original Author: Elvire Bouvier +// Created: Thu, 16 Jan 2014 16:27:35 GMT +// +// +#ifndef TOPDILEPTONHLTVALIDATION +#define TOPDILEPTONHLTVALIDATION + +// system include files +#include + +// user include files +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/EDAnalyzer.h" + +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/MakerMacros.h" + +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ServiceRegistry/interface/Service.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" + +#include "DQMServices/Core/interface/DQMStore.h" +#include "DQMServices/Core/interface/MonitorElement.h" + +#include "DataFormats/EgammaCandidates/interface/GsfElectron.h" +#include "DataFormats/MuonReco/interface/Muon.h" +#include "DataFormats/JetReco/interface/Jet.h" +#include "HLTrigger/HLTcore/interface/HLTConfigProvider.h" +#include "DataFormats/Common/interface/TriggerResults.h" +#include "TH1.h" + +// +// class declaration +// + +class TopDiLeptonHLTValidation : public edm::EDAnalyzer { + public: + explicit TopDiLeptonHLTValidation(const edm::ParameterSet&); + ~TopDiLeptonHLTValidation(); + + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + + + private: + virtual void beginJob() override; + virtual void analyze(const edm::Event&, const edm::EventSetup&) override; + virtual void endJob() override; + + //virtual void beginRun(edm::Run const&, edm::EventSetup const&) override; + virtual void endRun(edm::Run const&, edm::EventSetup const&) override; + //virtual void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override; + //virtual void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override; + + // ----------member data --------------------------- + // DQM + DQMStore* dbe_; + std::string sDir_; + MonitorElement* hEffLeptonPt; + MonitorElement* hEffLeptonEta; + MonitorElement* hEffJetPt; + MonitorElement* hEffJetEta; + // Electrons + const reco::GsfElectron *elec1_; + const reco::GsfElectron *elec2_; + std::string sElectrons_; + edm::EDGetTokenT< edm::View > tokElectrons_; + double ptElectrons_; + double etaElectrons_; + double isoElectrons_; + unsigned int minElectrons_; + // Muons + const reco::Muon *mu1_; + const reco::Muon *mu2_; + std::string sMuons_; + edm::EDGetTokenT< edm::View > tokMuons_; + double ptMuons_; + double etaMuons_; + double isoMuons_; + unsigned int minMuons_; + // Jets + const reco::Jet *jet_; + std::string sJets_; + edm::EDGetTokenT< edm::View > tokJets_; + double ptJets_; + double etaJets_; + unsigned int minJets_; + // Trigger + std::string sTrigger_; + edm::EDGetTokenT tokTrigger_; + std::vector vsPaths_; + // Histos + bool isAll_ = false; + TH1F *hDenLeptonPt = new TH1F("PtLeptonAll", "PtLeptonAll", 50, 0., 250.); + TH1F *hDenLeptonEta = new TH1F("EtaLeptonAll", "EtaLeptonAll", 30, -3. , 3.); + TH1F *hDenJetPt = new TH1F("PtLastJetAll", "PtLastJetAll", 60, 0., 300.); + TH1F *hDenJetEta = new TH1F("EtaLastJetAll", "EtaLastJetAll", 30, -3., 3.); + bool isSel_ = false; + TH1F *hNumLeptonPt = new TH1F("PtLeptonSel", "PtLeptonSel", 50, 0., 250.); + TH1F *hNumLeptonEta = new TH1F("EtaLeptonSel", "EtaLeptonSel", 30, -3. , 3.); + TH1F *hNumJetPt = new TH1F("PtLastJetSel", "PtLastJetSel", 60, 0., 300.); + TH1F *hNumJetEta = new TH1F("EtaLastJetSel", "EtaLastJetSel", 30, -3., 3.); +}; + +// +// constants, enums and typedefs +// + +// +// static data member definitions +// + +// +// constructors and destructor +// +TopDiLeptonHLTValidation::TopDiLeptonHLTValidation(const edm::ParameterSet& iConfig) : + sDir_(iConfig.getUntrackedParameter("sDir","Validation/Top/Efficiencies/")), + sElectrons_(iConfig.getUntrackedParameter("sElectrons","gsfElectrons")), + ptElectrons_(iConfig.getUntrackedParameter("ptElectrons",0.)), + etaElectrons_(iConfig.getUntrackedParameter("etaElectrons",0.)), + isoElectrons_(iConfig.getUntrackedParameter("isoElectrons",0.)), + minElectrons_(iConfig.getUntrackedParameter("minElectrons",0)), + sMuons_(iConfig.getUntrackedParameter("sMuons","muons")), + ptMuons_(iConfig.getUntrackedParameter("ptMuons",0.)), + etaMuons_(iConfig.getUntrackedParameter("etaMuons",0.)), + isoMuons_(iConfig.getUntrackedParameter("isoMuons",0.)), + minMuons_(iConfig.getUntrackedParameter("minMuons",0)), + sJets_(iConfig.getUntrackedParameter("sJets","ak5PFJets")), + ptJets_(iConfig.getUntrackedParameter("ptJets",0.)), + etaJets_(iConfig.getUntrackedParameter("etaJets",0.)), + minJets_(iConfig.getUntrackedParameter("minJets",0)), + sTrigger_(iConfig.getUntrackedParameter("sTrigger","TriggerResults")), + vsPaths_(iConfig.getUntrackedParameter< std::vector >("vsPaths")) + +{ + dbe_ = edm::Service().operator->(); + // Electrons + tokElectrons_ = consumes< edm::View >(edm::InputTag(sElectrons_)); + // Muons + tokMuons_ = consumes< edm::View >(edm::InputTag(sMuons_)); + // Jets + tokJets_ = consumes< edm::View >(edm::InputTag(sJets_)); + // Trigger + tokTrigger_ = consumes(edm::InputTag(sTrigger_)); +} + + +TopDiLeptonHLTValidation::~TopDiLeptonHLTValidation() +{ + + // do anything here that needs to be done at desctruction time + // (e.g. close files, deallocate resources etc.) + +} +#endif + +//define this as a plug-in +DEFINE_FWK_MODULE(TopDiLeptonHLTValidation); diff --git a/HLTriggerOffline/Top/python/topDiLeptonHLTEventValidation_cfi.py b/HLTriggerOffline/Top/python/topDiLeptonHLTEventValidation_cfi.py new file mode 100644 index 0000000000000..9aa78cb24c845 --- /dev/null +++ b/HLTriggerOffline/Top/python/topDiLeptonHLTEventValidation_cfi.py @@ -0,0 +1,79 @@ +import FWCore.ParameterSet.Config as cms + +# ttbar dimuon +DiMuonHLTValidation = cms.EDAnalyzer('TopDiLeptonHLTValidation', + # Directory + sDir = cms.untracked.string('HLTValidation/Top/DiMuon/'), + # Electrons + sElectrons = cms.untracked.string('gsfElectrons'), + ptElectrons = cms.untracked.double(20.), + etaElectrons = cms.untracked.double(2.5), + isoElectrons = cms.untracked.double(0.15), + minElectrons = cms.untracked.uint32(0), + # Muons + sMuons = cms.untracked.string('muons'), + ptMuons = cms.untracked.double(20.), + etaMuons = cms.untracked.double(2.4), + isoMuons = cms.untracked.double(0.2), + minMuons = cms.untracked.uint32(2), + # Jets + sJets = cms.untracked.string('ak5PFJets'), + ptJets = cms.untracked.double(30.), + etaJets = cms.untracked.double(2.5), + minJets = cms.untracked.uint32(2), + # Trigger + sTrigger = cms.untracked.string("TriggerResults"), + vsPaths = cms.untracked.vstring(['HLT_Mu17_Mu8','HLT_Mu17_TkMu8']), +) + +# ttbar dielec +DiElectronHLTValidation = cms.EDAnalyzer('TopDiLeptonHLTValidation', + # Directory + sDir = cms.untracked.string('HLTValidation/Top/DiElectron/'), + # Electrons + sElectrons = cms.untracked.string('gsfElectrons'), + ptElectrons = cms.untracked.double(20.), + etaElectrons = cms.untracked.double(2.5), + isoElectrons = cms.untracked.double(0.15), + minElectrons = cms.untracked.uint32(2), + # Muons + sMuons = cms.untracked.string('muons'), + ptMuons = cms.untracked.double(20.), + etaMuons = cms.untracked.double(2.4), + isoMuons = cms.untracked.double(0.2), + minMuons = cms.untracked.uint32(0), + # Jets + sJets = cms.untracked.string('ak5PFJets'), + ptJets = cms.untracked.double(30.), + etaJets = cms.untracked.double(2.5), + minJets = cms.untracked.uint32(2), + # Trigger + sTrigger = cms.untracked.string("TriggerResults"), + vsPaths = cms.untracked.vstring(['HLT_Ele17_CaloIdT_CaloIsoVL_TrkIdVL_TrkIsoVL_Ele8_CaloIdT_CaloIsoVL_TrkIdVL_TrkIsoVL']), +) + +# ttbar elec-muon +ElecMuonHLTValidation = cms.EDAnalyzer('TopDiLeptonHLTValidation', + # Directory + sDir = cms.untracked.string('HLTValidation/Top/ElecMuon/'), + # Electrons + sElectrons = cms.untracked.string('gsfElectrons'), + ptElectrons = cms.untracked.double(20.), + etaElectrons = cms.untracked.double(2.5), + isoElectrons = cms.untracked.double(0.15), + minElectrons = cms.untracked.uint32(1), + # Muons + sMuons = cms.untracked.string('muons'), + ptMuons = cms.untracked.double(20.), + etaMuons = cms.untracked.double(2.4), + isoMuons = cms.untracked.double(0.2), + minMuons = cms.untracked.uint32(1), + # Jets + sJets = cms.untracked.string('ak5PFJets'), + ptJets = cms.untracked.double(30.), + etaJets = cms.untracked.double(2.5), + minJets = cms.untracked.uint32(2), + # Trigger + sTrigger = cms.untracked.string("TriggerResults"), + vsPaths = cms.untracked.vstring(['HLT_Mu17_Ele8_CaloIdT_CaloIsoVL_TrkIdVL_TrkIsoVL','HLT_Mu8_Ele17_CaloIdT_CaloIsoVL_TrkIdVL_TrkIsoVL']), +) diff --git a/HLTriggerOffline/Top/python/topHLTValidation_cff.py b/HLTriggerOffline/Top/python/topHLTValidation_cff.py index ac322628a1414..0ec3291396363 100644 --- a/HLTriggerOffline/Top/python/topHLTValidation_cff.py +++ b/HLTriggerOffline/Top/python/topHLTValidation_cff.py @@ -1,15 +1,14 @@ import FWCore.ParameterSet.Config as cms -#from HLTriggerOffline.Top.topDiLeptonHLTEventValidation_cfi import * +from HLTriggerOffline.Top.topDiLeptonHLTEventValidation_cfi import * from HLTriggerOffline.Top.topSingleLeptonHLTEventValidation_cfi import * from HLTriggerOffline.Top.singletopHLTEventValidation_cfi import * topHLTriggerValidation = cms.Sequence( -# DiMuonHLTValidation -# *DiElectronHLTValidation -# *ElecMuonHLTValidation -# * - topSingleMuonHLTValidation + DiMuonHLTValidation + *DiElectronHLTValidation + *ElecMuonHLTValidation + *topSingleMuonHLTValidation *topSingleElectronHLTValidation *SingleTopSingleMuonHLTValidation *SingleTopSingleElectronHLTValidation diff --git a/HLTriggerOffline/Top/src/TopDiLeptonHLTValidation.cc b/HLTriggerOffline/Top/src/TopDiLeptonHLTValidation.cc new file mode 100644 index 0000000000000..2684663706885 --- /dev/null +++ b/HLTriggerOffline/Top/src/TopDiLeptonHLTValidation.cc @@ -0,0 +1,241 @@ +// -*- C++ -*- +// +// Package: HLTriggerOffline/Top +// Class: TopDiLeptonHLTValidation +// +/**\class TopDiLeptonHLTValidation TopDiLeptonHLTValidation.cc HLTriggerOffline/Top/src/TopDiLeptonHLTValidation.cc + +Description: + + Description: compute efficiencies of trigger paths on offline reco selection with respect to pt and eta + +Implementation: + harvesting + +*/ +// +// Original Author: Elvire Bouvier +// Created: Thu, 16 Jan 2014 16:27:35 GMT +// +// +#include "HLTriggerOffline/Top/interface/TopDiLeptonHLTValidation.h" + +// system include files +#include + +// user include files +#include "FWCore/Framework/interface/Frameworkfwd.h" + +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/MakerMacros.h" + +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ServiceRegistry/interface/Service.h" + +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "HLTrigger/HLTcore/interface/HLTConfigProvider.h" +#include "FWCore/Common/interface/TriggerNames.h" +#include "TString.h" +#include "DataFormats/MuonReco/interface/MuonPFIsolation.h" +// +// member functions +// + +// ------------ method called for each event ------------ + void +TopDiLeptonHLTValidation::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) +{ + using namespace edm; + + isAll_ = false; isSel_ = false; + + // Electrons + Handle< edm::View > electrons; + iEvent.getByToken(tokElectrons_,electrons); + unsigned int nGoodE = 0; + for(edm::View::const_iterator e = electrons->begin(); e != electrons->end(); ++e){ + if (e->pt() < ptElectrons_) continue; + if (fabs(e->eta()) > etaElectrons_) continue; + if ((e->dr03TkSumPt()+e->dr03EcalRecHitSumEt()+e->dr03HcalTowerSumEt())/e->pt() > isoElectrons_ ) continue; + nGoodE++; + if (nGoodE == 1) elec1_ = &(*e); + if (nGoodE == 2) elec2_ = &(*e); + } + // Muons + Handle< edm::View > muons; + iEvent.getByToken(tokMuons_,muons); + unsigned int nGoodM = 0; + for(edm::View::const_iterator m = muons->begin(); m != muons->end(); ++m){ + if (!m->isPFMuon() || (!m->isGlobalMuon() && !m->isTrackerMuon())) continue; + if (m->pt() < ptMuons_) continue; + if (fabs(m->eta()) > etaMuons_) continue; + if (((m->pfIsolationR04()).sumChargedHadronPt+(m->pfIsolationR04()).sumPhotonEt+(m->pfIsolationR04()).sumNeutralHadronEt)/m->pt() > isoMuons_ ) continue; + nGoodM++; + if (nGoodM == 1) mu1_ = &(*m); + if (nGoodM == 2) mu2_ = &(*m); + } + // Jets + Handle< edm::View > jets; + iEvent.getByToken(tokJets_,jets); + unsigned int nGoodJ = 0; + for(edm::View::const_iterator j = jets->begin(); j != jets->end(); ++j){ + if (j->pt() < ptJets_) continue; + if (fabs(j->eta()) > etaJets_) continue; + nGoodJ++; + if (nGoodJ == minJets_) jet_ = &(*j); + } + + if (nGoodE >= minElectrons_ && nGoodM >= minMuons_ && nGoodJ >= minJets_) isAll_ = true; + + //Trigger + Handle triggerTable; + iEvent.getByToken(tokTrigger_,triggerTable); + const edm::TriggerNames& triggerNames = iEvent.triggerNames(*triggerTable); + for (unsigned int i=0; i 0) { + hDenLeptonPt->Fill(elec1_->pt()); + hDenLeptonEta->Fill(elec1_->eta()); + } + if (minElectrons_ > 1) { + hDenLeptonPt->Fill(elec2_->pt()); + hDenLeptonEta->Fill(elec2_->eta()); + } + if (minMuons_ > 0) { + hDenLeptonPt->Fill(mu1_->pt()); + hDenLeptonEta->Fill(mu1_->eta()); + } + if (minMuons_ > 1) { + hDenLeptonPt->Fill(mu2_->pt()); + hDenLeptonEta->Fill(mu2_->eta()); + } + hDenJetPt->Fill(jet_->pt()); + hDenJetEta->Fill(jet_->eta()); + } + if (isSel_) { + if (minElectrons_ > 0) { + hNumLeptonPt->Fill(elec1_->pt()); + hNumLeptonEta->Fill(elec1_->eta()); + } + if (minElectrons_ > 1) { + hNumLeptonPt->Fill(elec2_->pt()); + hNumLeptonEta->Fill(elec2_->eta()); + } + if (minMuons_ > 0) { + hNumLeptonPt->Fill(mu1_->pt()); + hNumLeptonEta->Fill(mu1_->eta()); + } + if (minMuons_ > 1) { + hNumLeptonPt->Fill(mu2_->pt()); + hNumLeptonEta->Fill(mu2_->eta()); + } + hNumJetPt->Fill(jet_->pt()); + hNumJetEta->Fill(jet_->eta()); + } + } +} + + +// ------------ method called once each job just before starting event loop ------------ + void +TopDiLeptonHLTValidation::beginJob() +{ +} + +// ------------ method called once each job just after ending the event loop ------------ + void +TopDiLeptonHLTValidation::endJob() +{ +} + +// ------------ method called when starting to processes a run ------------ +/* + void + TopDiLeptonHLTValidation::beginRun(edm::Run const&, edm::EventSetup const&) + { + } + */ + +// ------------ method called when ending the processing of a run ------------ + + void +TopDiLeptonHLTValidation::endRun(edm::Run const&, edm::EventSetup const&) +{ + dbe_->setCurrentFolder(sDir_); + hEffLeptonPt = dbe_->book1D("EfficiencyVsPtLepton", "EfficiencyVsPtLepton", 50, 0., 250.); + hEffLeptonEta = dbe_->book1D("EfficiencyVsEtaLepton", "EfficiencyVsEtaLepton", 30, -3. , 3.); + hEffJetPt = dbe_->book1D("EfficiencyVsPtLastJet", "EfficiencyVsPtLastJet", 60, 0., 300.); + hEffJetEta = dbe_->book1D("EfficiencyVsEtaLastJet", "EfficiencyVsEtaLastJet", 30, -3., 3.); + + //------ Efficiency wrt + // lepton pt + for (int iBin = 1; iBin <= hNumLeptonPt->GetNbinsX(); ++iBin) + { + if(hDenLeptonPt->GetBinContent(iBin) == 0) + hEffLeptonPt->setBinContent(iBin, 0.); + else + hEffLeptonPt->setBinContent(iBin, hNumLeptonPt->GetBinContent(iBin) / hDenLeptonPt->GetBinContent(iBin)); + } + // lepton eta + for (int iBin = 1; iBin <= hNumLeptonEta->GetNbinsX(); ++iBin) + { + if(hDenLeptonEta->GetBinContent(iBin) == 0) + hEffLeptonEta->setBinContent(iBin, 0.); + else + hEffLeptonEta->setBinContent(iBin, hNumLeptonEta->GetBinContent(iBin) / hDenLeptonEta->GetBinContent(iBin)); + } + // jet pt + for (int iBin = 1; iBin <= hNumJetPt->GetNbinsX(); ++iBin) + { + if(hDenJetPt->GetBinContent(iBin) == 0) + hEffJetPt->setBinContent(iBin, 0.); + else + hEffJetPt->setBinContent(iBin, hNumJetPt->GetBinContent(iBin) / hDenJetPt->GetBinContent(iBin)); + } + // jet eta + for (int iBin = 1; iBin <= hNumJetEta->GetNbinsX(); ++iBin) + { + if(hDenJetEta->GetBinContent(iBin) == 0) + hEffJetEta->setBinContent(iBin, 0.); + else + hEffJetEta->setBinContent(iBin, hNumJetEta->GetBinContent(iBin) / hDenJetEta->GetBinContent(iBin)); + } +} + + +// ------------ method called when starting to processes a luminosity block ------------ +/* + void + TopDiLeptonHLTValidation::beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) + { + } + */ + +// ------------ method called when ending the processing of a luminosity block ------------ +/* + void + TopDiLeptonHLTValidation::endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) + { + } + */ + +// ------------ method fills 'descriptions' with the allowed parameters for the module ------------ +void +TopDiLeptonHLTValidation::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + //The following says we do not know what parameters are allowed so do no validation + // Please change this to state exactly what you do use, even if it is no parameters + edm::ParameterSetDescription desc; + desc.setUnknown(); + descriptions.addDefault(desc); +} + From 59f042f2f7939adb108c533cef28bdc1fcbe2b0a Mon Sep 17 00:00:00 2001 From: Elvire Bouvier Date: Thu, 23 Jan 2014 19:36:24 +0100 Subject: [PATCH 11/26] calling new sequences --- .../Common/python/HLTValidationHarvest_cff.py | 8 ++++---- HLTriggerOffline/Common/python/HLTValidationQT_cff.py | 2 -- HLTriggerOffline/Common/python/HLTValidation_cff.py | 10 +++++----- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/HLTriggerOffline/Common/python/HLTValidationHarvest_cff.py b/HLTriggerOffline/Common/python/HLTValidationHarvest_cff.py index 173b39d6fe5fb..560f398062f09 100644 --- a/HLTriggerOffline/Common/python/HLTValidationHarvest_cff.py +++ b/HLTriggerOffline/Common/python/HLTValidationHarvest_cff.py @@ -1,7 +1,7 @@ from HLTriggerOffline.Tau.Validation.HLTTauPostValidation_cfi import * from HLTriggerOffline.Muon.HLTMuonPostVal_cff import * from HLTriggerOffline.Egamma.EgammaPostProcessor_cfi import * -from HLTriggerOffline.Top.HLTTopPostVal_cff import * +from HLTriggerOffline.Top.topHLTValidation_cff import * from HLTriggerOffline.Common.FourVectorHLTriggerOfflineClient_cfi import * from HLTriggerOffline.HeavyFlavor.heavyFlavorValidationHarvestingSequence_cff import * from HLTriggerOffline.JetMET.Validation.JetMETPostProcessor_cff import * @@ -16,7 +16,7 @@ HLTMuonPostVal +HLTTauPostVal +EgammaPostVal - +HLTTopPostVal + +topHLTriggerValidation +hltriggerFourVectorClient +heavyFlavorValidationHarvestingSequence +JetMETPostVal @@ -32,7 +32,7 @@ +HLTTauPostVal +EgammaPostVal +hltriggerFourVectorClient - +HLTTopPostVal + +topHLTriggerValidation +heavyFlavorValidationHarvestingSequence +JetMETPostVal #+HLTAlCaPostVal @@ -42,7 +42,7 @@ hltpostvalidation_preprod = cms.Sequence( HLTTauPostVal - +HLTTopPostVal + +topHLTriggerValidation +hltriggerFourVectorClient +heavyFlavorValidationHarvestingSequence +SusyExoPostVal diff --git a/HLTriggerOffline/Common/python/HLTValidationQT_cff.py b/HLTriggerOffline/Common/python/HLTValidationQT_cff.py index 32b5093f29cf2..ff07c6291137d 100644 --- a/HLTriggerOffline/Common/python/HLTValidationQT_cff.py +++ b/HLTriggerOffline/Common/python/HLTValidationQT_cff.py @@ -3,7 +3,6 @@ #from HLTriggerOffline.Common.HLTValidationQTExample_cfi import * from HLTriggerOffline.Muon.HLTMuonQualityTester_cfi import * from HLTriggerOffline.Tau.Validation.HLTTauQualityTests_cff import * -from HLTriggerOffline.Top.HLTTopQualityTester_cfi import * from HLTriggerOffline.Higgs.HLTHiggsQualityTester_cfi import * from HLTriggerOffline.JetMET.Validation.HLTJetMETQualityTester_cfi import * from HLTriggerOffline.SUSYBSM.HLTSusyExoQualityTester_cfi import * @@ -13,7 +12,6 @@ hltMuonQualityTester + hltTauRelvalQualityTests + hltHiggsQualityTester - + hltTopQualityTester + hltJetMetQualityTester + hltSusyExoQualityTester ) diff --git a/HLTriggerOffline/Common/python/HLTValidation_cff.py b/HLTriggerOffline/Common/python/HLTValidation_cff.py index 09e050055a1eb..6dbe0e4a4f5fe 100644 --- a/HLTriggerOffline/Common/python/HLTValidation_cff.py +++ b/HLTriggerOffline/Common/python/HLTValidation_cff.py @@ -1,7 +1,6 @@ from HLTriggerOffline.Muon.HLTMuonVal_cff import * from HLTriggerOffline.Tau.Validation.HLTTauValidation_cff import * from HLTriggerOffline.Egamma.EgammaValidationAutoConf_cff import * -from HLTriggerOffline.Top.topvalidation_cfi import * from HLTriggerOffline.Common.FourVectorHLTriggerOffline_cff import * from HLTriggerOffline.HeavyFlavor.heavyFlavorValidationSequence_cff import * from HLTriggerOffline.JetMET.Validation.HLTJetMETValidation_cff import * @@ -14,6 +13,7 @@ # from DQMOffline.Trigger.DQMOffline_Trigger_cff.py import * from DQMOffline.Trigger.HLTTauDQMOffline_cff import * from DQMOffline.Trigger.EgHLTOfflineSource_cfi import * +from DQMOffline.Trigger.topHLTOfflineDQM_cff import * #from DQMOffline.Trigger.MuonTrigRateAnalyzer_cfi import * # online dqm: from DQMOffline.Trigger.HLTMonTau_cfi import * @@ -27,7 +27,7 @@ HLTMuonVal +HLTTauVal +egammaValidationSequence - +HLTTopVal + +topHLTriggerOfflineDQM +HLTFourVector +heavyFlavorValidationSequence +HLTJetMETValSeq @@ -48,7 +48,7 @@ HLTMuonVal_FastSim +HLTTauValFS +egammaValidationSequenceFS - +HLTTopVal + +topHLTriggerOfflineDQM +HLTFourVector +heavyFlavorValidationSequence +HLTJetMETValSeq @@ -59,7 +59,7 @@ hltvalidation_preprod = cms.Sequence( HLTTauVal - +HLTTopVal + +topHLTriggerOfflineDQM +HLTFourVector +heavyFlavorValidationSequence +HLTSusyExoValSeq @@ -68,7 +68,7 @@ hltvalidation_preprod_fastsim = cms.Sequence( HLTTauVal - +HLTTopVal + +topHLTriggerOfflineDQM +HLTFourVector +heavyFlavorValidationSequence +HLTSusyExoValSeq_FastSim From fb44d95ffd0ae4c19b1dcbb27e06c1f5f898947a Mon Sep 17 00:00:00 2001 From: Elvire Bouvier Date: Mon, 27 Jan 2014 15:06:00 +0100 Subject: [PATCH 12/26] removing replication between preprod and validation --- HLTriggerOffline/Common/python/HLTValidation_cff.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/HLTriggerOffline/Common/python/HLTValidation_cff.py b/HLTriggerOffline/Common/python/HLTValidation_cff.py index 6dbe0e4a4f5fe..b3e53a9b9ce0b 100644 --- a/HLTriggerOffline/Common/python/HLTValidation_cff.py +++ b/HLTriggerOffline/Common/python/HLTValidation_cff.py @@ -17,7 +17,7 @@ #from DQMOffline.Trigger.MuonTrigRateAnalyzer_cfi import * # online dqm: from DQMOffline.Trigger.HLTMonTau_cfi import * - + # additional producer sequence prior to hltvalidation # to evacuate producers/filters from the EndPath hltassociation = cms.Sequence( egammaSelectors ) @@ -59,7 +59,6 @@ hltvalidation_preprod = cms.Sequence( HLTTauVal - +topHLTriggerOfflineDQM +HLTFourVector +heavyFlavorValidationSequence +HLTSusyExoValSeq @@ -68,7 +67,6 @@ hltvalidation_preprod_fastsim = cms.Sequence( HLTTauVal - +topHLTriggerOfflineDQM +HLTFourVector +heavyFlavorValidationSequence +HLTSusyExoValSeq_FastSim From 62a18374b170b99ebf1d558d2f574cf9a8838c60 Mon Sep 17 00:00:00 2001 From: Elvire Bouvier Date: Thu, 30 Jan 2014 14:31:32 +0100 Subject: [PATCH 13/26] change of structure to match DQM specificities --- .../Common/python/HLTValidationHarvest_cff.py | 7 +- .../Common/python/HLTValidation_cff.py | 3 + .../Top/interface/TopDiLeptonHLTValidation.h | 41 +++---- .../interface/TopSingleLeptonHLTValidation.h | 40 +++--- .../python/singletopHLTEventValidation_cfi.py | 4 +- .../topDiLeptonHLTEventValidation_cfi.py | 6 +- .../topSingleLeptonHLTEventValidation_cfi.py | 4 +- .../Top/src/TopDiLeptonHLTValidation.cc | 110 ++++------------- .../Top/src/TopSingleLeptonHLTValidation.cc | 115 ++++-------------- 9 files changed, 92 insertions(+), 238 deletions(-) diff --git a/HLTriggerOffline/Common/python/HLTValidationHarvest_cff.py b/HLTriggerOffline/Common/python/HLTValidationHarvest_cff.py index 560f398062f09..f5b36ec54dff0 100644 --- a/HLTriggerOffline/Common/python/HLTValidationHarvest_cff.py +++ b/HLTriggerOffline/Common/python/HLTValidationHarvest_cff.py @@ -1,7 +1,7 @@ from HLTriggerOffline.Tau.Validation.HLTTauPostValidation_cfi import * from HLTriggerOffline.Muon.HLTMuonPostVal_cff import * from HLTriggerOffline.Egamma.EgammaPostProcessor_cfi import * -from HLTriggerOffline.Top.topHLTValidation_cff import * +from HLTriggerOffline.Top.topHLTValidationHarvest_cff import * from HLTriggerOffline.Common.FourVectorHLTriggerOfflineClient_cfi import * from HLTriggerOffline.HeavyFlavor.heavyFlavorValidationHarvestingSequence_cff import * from HLTriggerOffline.JetMET.Validation.JetMETPostProcessor_cff import * @@ -16,7 +16,7 @@ HLTMuonPostVal +HLTTauPostVal +EgammaPostVal - +topHLTriggerValidation + +topHLTriggerValidationHarvest +hltriggerFourVectorClient +heavyFlavorValidationHarvestingSequence +JetMETPostVal @@ -32,7 +32,7 @@ +HLTTauPostVal +EgammaPostVal +hltriggerFourVectorClient - +topHLTriggerValidation + +topHLTriggerValidationHarvest +heavyFlavorValidationHarvestingSequence +JetMETPostVal #+HLTAlCaPostVal @@ -42,7 +42,6 @@ hltpostvalidation_preprod = cms.Sequence( HLTTauPostVal - +topHLTriggerValidation +hltriggerFourVectorClient +heavyFlavorValidationHarvestingSequence +SusyExoPostVal diff --git a/HLTriggerOffline/Common/python/HLTValidation_cff.py b/HLTriggerOffline/Common/python/HLTValidation_cff.py index b3e53a9b9ce0b..947d788681f00 100644 --- a/HLTriggerOffline/Common/python/HLTValidation_cff.py +++ b/HLTriggerOffline/Common/python/HLTValidation_cff.py @@ -7,6 +7,7 @@ #from HLTriggerOffline.special.hltAlCaVal_cff import * from HLTriggerOffline.SUSYBSM.SusyExoValidation_cff import * from HLTriggerOffline.Higgs.HiggsValidation_cff import * +from HLTriggerOffline.Top.topHLTValidation_cff import * # offline dqm: @@ -28,6 +29,7 @@ +HLTTauVal +egammaValidationSequence +topHLTriggerOfflineDQM + +topHLTriggerValidation +HLTFourVector +heavyFlavorValidationSequence +HLTJetMETValSeq @@ -49,6 +51,7 @@ +HLTTauValFS +egammaValidationSequenceFS +topHLTriggerOfflineDQM + +topHLTriggerValidation +HLTFourVector +heavyFlavorValidationSequence +HLTJetMETValSeq diff --git a/HLTriggerOffline/Top/interface/TopDiLeptonHLTValidation.h b/HLTriggerOffline/Top/interface/TopDiLeptonHLTValidation.h index 0d03be755be65..6203493140655 100644 --- a/HLTriggerOffline/Top/interface/TopDiLeptonHLTValidation.h +++ b/HLTriggerOffline/Top/interface/TopDiLeptonHLTValidation.h @@ -26,7 +26,8 @@ // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" +//#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "DQMServices/Core/interface/DQMEDAnalyzer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" @@ -43,13 +44,13 @@ #include "DataFormats/JetReco/interface/Jet.h" #include "HLTrigger/HLTcore/interface/HLTConfigProvider.h" #include "DataFormats/Common/interface/TriggerResults.h" -#include "TH1.h" +//#include "TH1.h" // // class declaration // -class TopDiLeptonHLTValidation : public edm::EDAnalyzer { +class TopDiLeptonHLTValidation : public DQMEDAnalyzer { public: explicit TopDiLeptonHLTValidation(const edm::ParameterSet&); ~TopDiLeptonHLTValidation(); @@ -58,23 +59,20 @@ class TopDiLeptonHLTValidation : public edm::EDAnalyzer { private: - virtual void beginJob() override; virtual void analyze(const edm::Event&, const edm::EventSetup&) override; - virtual void endJob() override; - - //virtual void beginRun(edm::Run const&, edm::EventSetup const&) override; - virtual void endRun(edm::Run const&, edm::EventSetup const&) override; - //virtual void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override; - //virtual void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override; + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; // ----------member data --------------------------- // DQM - DQMStore* dbe_; std::string sDir_; - MonitorElement* hEffLeptonPt; - MonitorElement* hEffLeptonEta; - MonitorElement* hEffJetPt; - MonitorElement* hEffJetEta; + MonitorElement* hNumLeptonPt; + MonitorElement* hDenLeptonPt; + MonitorElement* hNumLeptonEta; + MonitorElement* hDenLeptonEta; + MonitorElement* hNumJetPt; + MonitorElement* hDenJetPt; + MonitorElement* hNumJetEta; + MonitorElement* hDenJetEta; // Electrons const reco::GsfElectron *elec1_; const reco::GsfElectron *elec2_; @@ -104,17 +102,9 @@ class TopDiLeptonHLTValidation : public edm::EDAnalyzer { std::string sTrigger_; edm::EDGetTokenT tokTrigger_; std::vector vsPaths_; - // Histos + // Flags bool isAll_ = false; - TH1F *hDenLeptonPt = new TH1F("PtLeptonAll", "PtLeptonAll", 50, 0., 250.); - TH1F *hDenLeptonEta = new TH1F("EtaLeptonAll", "EtaLeptonAll", 30, -3. , 3.); - TH1F *hDenJetPt = new TH1F("PtLastJetAll", "PtLastJetAll", 60, 0., 300.); - TH1F *hDenJetEta = new TH1F("EtaLastJetAll", "EtaLastJetAll", 30, -3., 3.); bool isSel_ = false; - TH1F *hNumLeptonPt = new TH1F("PtLeptonSel", "PtLeptonSel", 50, 0., 250.); - TH1F *hNumLeptonEta = new TH1F("EtaLeptonSel", "EtaLeptonSel", 30, -3. , 3.); - TH1F *hNumJetPt = new TH1F("PtLastJetSel", "PtLastJetSel", 60, 0., 300.); - TH1F *hNumJetEta = new TH1F("EtaLastJetSel", "EtaLastJetSel", 30, -3., 3.); }; // @@ -148,7 +138,6 @@ TopDiLeptonHLTValidation::TopDiLeptonHLTValidation(const edm::ParameterSet& iCon vsPaths_(iConfig.getUntrackedParameter< std::vector >("vsPaths")) { - dbe_ = edm::Service().operator->(); // Electrons tokElectrons_ = consumes< edm::View >(edm::InputTag(sElectrons_)); // Muons @@ -156,7 +145,7 @@ TopDiLeptonHLTValidation::TopDiLeptonHLTValidation(const edm::ParameterSet& iCon // Jets tokJets_ = consumes< edm::View >(edm::InputTag(sJets_)); // Trigger - tokTrigger_ = consumes(edm::InputTag(sTrigger_)); + tokTrigger_ = consumes(edm::InputTag(sTrigger_, "", "HLT")); } diff --git a/HLTriggerOffline/Top/interface/TopSingleLeptonHLTValidation.h b/HLTriggerOffline/Top/interface/TopSingleLeptonHLTValidation.h index cc4b84a765a36..6a8f1bddc2e07 100644 --- a/HLTriggerOffline/Top/interface/TopSingleLeptonHLTValidation.h +++ b/HLTriggerOffline/Top/interface/TopSingleLeptonHLTValidation.h @@ -23,7 +23,7 @@ // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "DQMServices/Core/interface/DQMEDAnalyzer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" @@ -40,13 +40,13 @@ #include "DataFormats/JetReco/interface/Jet.h" #include "HLTrigger/HLTcore/interface/HLTConfigProvider.h" #include "DataFormats/Common/interface/TriggerResults.h" -#include "TH1.h" +//#include "TH1.h" // // class declaration // -class TopSingleLeptonHLTValidation : public edm::EDAnalyzer { +class TopSingleLeptonHLTValidation : public DQMEDAnalyzer { public: explicit TopSingleLeptonHLTValidation(const edm::ParameterSet&); ~TopSingleLeptonHLTValidation(); @@ -55,23 +55,20 @@ class TopSingleLeptonHLTValidation : public edm::EDAnalyzer { private: - virtual void beginJob() override; virtual void analyze(const edm::Event&, const edm::EventSetup&) override; - virtual void endJob() override; - - //virtual void beginRun(edm::Run const&, edm::EventSetup const&) override; - virtual void endRun(edm::Run const&, edm::EventSetup const&) override; - //virtual void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override; - //virtual void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override; + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; // ----------member data --------------------------- // DQM - DQMStore* dbe_; std::string sDir_; - MonitorElement* hEffLeptonPt; - MonitorElement* hEffLeptonEta; - MonitorElement* hEffJetPt; - MonitorElement* hEffJetEta; + MonitorElement* hNumLeptonPt; + MonitorElement* hDenLeptonPt; + MonitorElement* hNumLeptonEta; + MonitorElement* hDenLeptonEta; + MonitorElement* hNumJetPt; + MonitorElement* hDenJetPt; + MonitorElement* hNumJetEta; + MonitorElement* hDenJetEta; // Electrons const reco::GsfElectron *elec_; std::string sElectrons_; @@ -99,17 +96,9 @@ class TopSingleLeptonHLTValidation : public edm::EDAnalyzer { std::string sTrigger_; edm::EDGetTokenT tokTrigger_; std::vector vsPaths_; - // Histos + // Flags bool isAll_ = false; - TH1F *hDenLeptonPt = new TH1F("PtLeptonAll", "PtLeptonAll", 50, 0., 250.); - TH1F *hDenLeptonEta = new TH1F("EtaLeptonAll", "EtaLeptonAll", 30, -3. , 3.); - TH1F *hDenJetPt = new TH1F("PtLastJetAll", "PtLastJetAll", 60, 0., 300.); - TH1F *hDenJetEta = new TH1F("EtaLastJetAll", "EtaLastJetAll", 30, -3., 3.); bool isSel_ = false; - TH1F *hNumLeptonPt = new TH1F("PtLeptonSel", "PtLeptonSel", 50, 0., 250.); - TH1F *hNumLeptonEta = new TH1F("EtaLeptonSel", "EtaLeptonSel", 30, -3. , 3.); - TH1F *hNumJetPt = new TH1F("PtLastJetSel", "PtLastJetSel", 60, 0., 300.); - TH1F *hNumJetEta = new TH1F("EtaLastJetSel", "EtaLastJetSel", 30, -3., 3.); }; // @@ -143,7 +132,6 @@ TopSingleLeptonHLTValidation::TopSingleLeptonHLTValidation(const edm::ParameterS vsPaths_(iConfig.getUntrackedParameter< std::vector >("vsPaths")) { - dbe_ = edm::Service().operator->(); // Electrons tokElectrons_ = consumes< edm::View >(edm::InputTag(sElectrons_)); // Muons @@ -151,7 +139,7 @@ TopSingleLeptonHLTValidation::TopSingleLeptonHLTValidation(const edm::ParameterS // Jets tokJets_ = consumes< edm::View >(edm::InputTag(sJets_)); // Trigger - tokTrigger_ = consumes(edm::InputTag(sTrigger_)); + tokTrigger_ = consumes(edm::InputTag(sTrigger_, "", "HLT")); } diff --git a/HLTriggerOffline/Top/python/singletopHLTEventValidation_cfi.py b/HLTriggerOffline/Top/python/singletopHLTEventValidation_cfi.py index 3960ae9a6e845..479ea170e93c9 100644 --- a/HLTriggerOffline/Top/python/singletopHLTEventValidation_cfi.py +++ b/HLTriggerOffline/Top/python/singletopHLTEventValidation_cfi.py @@ -5,7 +5,7 @@ # Directory sDir = cms.untracked.string('HLTValidation/SingleTop/SingleMuon/'), # Electrons - sElectrons = cms.untracked.string('gsfElectrons'), + sElectrons = cms.untracked.string('gedGsfElectrons'), ptElectrons = cms.untracked.double(30.), etaElectrons = cms.untracked.double(2.5), isoElectrons = cms.untracked.double(0.1), @@ -31,7 +31,7 @@ # Directory sDir = cms.untracked.string('HLTValidation/SingleTop/SingleElectron/'), # Electrons - sElectrons = cms.untracked.string('gsfElectrons'), + sElectrons = cms.untracked.string('gedGsfElectrons'), ptElectrons = cms.untracked.double(30.), etaElectrons = cms.untracked.double(2.5), isoElectrons = cms.untracked.double(0.1), diff --git a/HLTriggerOffline/Top/python/topDiLeptonHLTEventValidation_cfi.py b/HLTriggerOffline/Top/python/topDiLeptonHLTEventValidation_cfi.py index 9aa78cb24c845..a7cf48a93c441 100644 --- a/HLTriggerOffline/Top/python/topDiLeptonHLTEventValidation_cfi.py +++ b/HLTriggerOffline/Top/python/topDiLeptonHLTEventValidation_cfi.py @@ -5,7 +5,7 @@ # Directory sDir = cms.untracked.string('HLTValidation/Top/DiMuon/'), # Electrons - sElectrons = cms.untracked.string('gsfElectrons'), + sElectrons = cms.untracked.string('gedGsfElectrons'), ptElectrons = cms.untracked.double(20.), etaElectrons = cms.untracked.double(2.5), isoElectrons = cms.untracked.double(0.15), @@ -31,7 +31,7 @@ # Directory sDir = cms.untracked.string('HLTValidation/Top/DiElectron/'), # Electrons - sElectrons = cms.untracked.string('gsfElectrons'), + sElectrons = cms.untracked.string('gedGsfElectrons'), ptElectrons = cms.untracked.double(20.), etaElectrons = cms.untracked.double(2.5), isoElectrons = cms.untracked.double(0.15), @@ -57,7 +57,7 @@ # Directory sDir = cms.untracked.string('HLTValidation/Top/ElecMuon/'), # Electrons - sElectrons = cms.untracked.string('gsfElectrons'), + sElectrons = cms.untracked.string('gedGsfElectrons'), ptElectrons = cms.untracked.double(20.), etaElectrons = cms.untracked.double(2.5), isoElectrons = cms.untracked.double(0.15), diff --git a/HLTriggerOffline/Top/python/topSingleLeptonHLTEventValidation_cfi.py b/HLTriggerOffline/Top/python/topSingleLeptonHLTEventValidation_cfi.py index 069e65eb958f4..36fbfebd6c6f8 100644 --- a/HLTriggerOffline/Top/python/topSingleLeptonHLTEventValidation_cfi.py +++ b/HLTriggerOffline/Top/python/topSingleLeptonHLTEventValidation_cfi.py @@ -5,7 +5,7 @@ # Directory sDir = cms.untracked.string('HLTValidation/Top/SemiMuonic/'), # Electrons - sElectrons = cms.untracked.string('gsfElectrons'), + sElectrons = cms.untracked.string('gedGsfElectrons'), ptElectrons = cms.untracked.double(30.), etaElectrons = cms.untracked.double(2.5), isoElectrons = cms.untracked.double(0.1), @@ -31,7 +31,7 @@ # Directory sDir = cms.untracked.string('HLTValidation/Top/SemiElectronic/'), # Electrons - sElectrons = cms.untracked.string('gsfElectrons'), + sElectrons = cms.untracked.string('gedGsfElectrons'), ptElectrons = cms.untracked.double(30.), etaElectrons = cms.untracked.double(2.5), isoElectrons = cms.untracked.double(0.1), diff --git a/HLTriggerOffline/Top/src/TopDiLeptonHLTValidation.cc b/HLTriggerOffline/Top/src/TopDiLeptonHLTValidation.cc index 2684663706885..d64cfedac123e 100644 --- a/HLTriggerOffline/Top/src/TopDiLeptonHLTValidation.cc +++ b/HLTriggerOffline/Top/src/TopDiLeptonHLTValidation.cc @@ -7,10 +7,10 @@ Description: - Description: compute efficiencies of trigger paths on offline reco selection with respect to pt and eta +Description: compute efficiencies of trigger paths on offline reco selection with respect to pt and eta Implementation: - harvesting +harvesting */ // @@ -51,7 +51,8 @@ TopDiLeptonHLTValidation::analyze(const edm::Event& iEvent, const edm::EventSetu // Electrons Handle< edm::View > electrons; - iEvent.getByToken(tokElectrons_,electrons); + if (!iEvent.getByToken(tokElectrons_,electrons)) + edm::LogWarning("TopDiLeptonHLTValidation") << "Electrons collection not found \n"; unsigned int nGoodE = 0; for(edm::View::const_iterator e = electrons->begin(); e != electrons->end(); ++e){ if (e->pt() < ptElectrons_) continue; @@ -63,7 +64,8 @@ TopDiLeptonHLTValidation::analyze(const edm::Event& iEvent, const edm::EventSetu } // Muons Handle< edm::View > muons; - iEvent.getByToken(tokMuons_,muons); + if (!iEvent.getByToken(tokMuons_,muons)) + edm::LogWarning("TopDiLeptonHLTValidation") << "Muons collection not found \n"; unsigned int nGoodM = 0; for(edm::View::const_iterator m = muons->begin(); m != muons->end(); ++m){ if (!m->isPFMuon() || (!m->isGlobalMuon() && !m->isTrackerMuon())) continue; @@ -76,7 +78,8 @@ TopDiLeptonHLTValidation::analyze(const edm::Event& iEvent, const edm::EventSetu } // Jets Handle< edm::View > jets; - iEvent.getByToken(tokJets_,jets); + if (!iEvent.getByToken(tokJets_,jets)) + edm::LogWarning("TopDiLeptonHLTValidation") << "Jets collection not found \n"; unsigned int nGoodJ = 0; for(edm::View::const_iterator j = jets->begin(); j != jets->end(); ++j){ if (j->pt() < ptJets_) continue; @@ -89,7 +92,8 @@ TopDiLeptonHLTValidation::analyze(const edm::Event& iEvent, const edm::EventSetu //Trigger Handle triggerTable; - iEvent.getByToken(tokTrigger_,triggerTable); + if (!iEvent.getByToken(tokTrigger_,triggerTable)) + edm::LogWarning("TopDiLeptonHLTValidation") << "Trigger collection not found \n"; const edm::TriggerNames& triggerNames = iEvent.triggerNames(*triggerTable); for (unsigned int i=0; isetCurrentFolder(sDir_); - hEffLeptonPt = dbe_->book1D("EfficiencyVsPtLepton", "EfficiencyVsPtLepton", 50, 0., 250.); - hEffLeptonEta = dbe_->book1D("EfficiencyVsEtaLepton", "EfficiencyVsEtaLepton", 30, -3. , 3.); - hEffJetPt = dbe_->book1D("EfficiencyVsPtLastJet", "EfficiencyVsPtLastJet", 60, 0., 300.); - hEffJetEta = dbe_->book1D("EfficiencyVsEtaLastJet", "EfficiencyVsEtaLastJet", 30, -3., 3.); - - //------ Efficiency wrt - // lepton pt - for (int iBin = 1; iBin <= hNumLeptonPt->GetNbinsX(); ++iBin) - { - if(hDenLeptonPt->GetBinContent(iBin) == 0) - hEffLeptonPt->setBinContent(iBin, 0.); - else - hEffLeptonPt->setBinContent(iBin, hNumLeptonPt->GetBinContent(iBin) / hDenLeptonPt->GetBinContent(iBin)); - } - // lepton eta - for (int iBin = 1; iBin <= hNumLeptonEta->GetNbinsX(); ++iBin) - { - if(hDenLeptonEta->GetBinContent(iBin) == 0) - hEffLeptonEta->setBinContent(iBin, 0.); - else - hEffLeptonEta->setBinContent(iBin, hNumLeptonEta->GetBinContent(iBin) / hDenLeptonEta->GetBinContent(iBin)); - } - // jet pt - for (int iBin = 1; iBin <= hNumJetPt->GetNbinsX(); ++iBin) - { - if(hDenJetPt->GetBinContent(iBin) == 0) - hEffJetPt->setBinContent(iBin, 0.); - else - hEffJetPt->setBinContent(iBin, hNumJetPt->GetBinContent(iBin) / hDenJetPt->GetBinContent(iBin)); - } - // jet eta - for (int iBin = 1; iBin <= hNumJetEta->GetNbinsX(); ++iBin) - { - if(hDenJetEta->GetBinContent(iBin) == 0) - hEffJetEta->setBinContent(iBin, 0.); - else - hEffJetEta->setBinContent(iBin, hNumJetEta->GetBinContent(iBin) / hDenJetEta->GetBinContent(iBin)); - } + dbe.setCurrentFolder(sDir_); + hDenLeptonPt = dbe.book1D("PtLeptonAll", "PtLeptonAll", 50, 0., 250.); + hDenLeptonEta = dbe.book1D("EtaLeptonAll", "EtaLeptonAll", 30, -3. , 3.); + hDenJetPt = dbe.book1D("PtLastJetAll", "PtLastJetAll", 60, 0., 300.); + hDenJetEta = dbe.book1D("EtaLastJetAll", "EtaLastJetAll", 30, -3., 3.); + hNumLeptonPt = dbe.book1D("PtLeptonSel", "PtLeptonSel", 50, 0., 250.); + hNumLeptonEta = dbe.book1D("EtaLeptonSel", "EtaLeptonSel", 30, -3. , 3.); + hNumJetPt = dbe.book1D("PtLastJetSel", "PtLastJetSel", 60, 0., 300.); + hNumJetEta = dbe.book1D("EtaLastJetSel", "EtaLastJetSel", 30, -3., 3.); } - -// ------------ method called when starting to processes a luminosity block ------------ -/* - void - TopDiLeptonHLTValidation::beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) - { - } - */ - -// ------------ method called when ending the processing of a luminosity block ------------ -/* - void - TopDiLeptonHLTValidation::endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) - { - } - */ - // ------------ method fills 'descriptions' with the allowed parameters for the module ------------ void TopDiLeptonHLTValidation::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { diff --git a/HLTriggerOffline/Top/src/TopSingleLeptonHLTValidation.cc b/HLTriggerOffline/Top/src/TopSingleLeptonHLTValidation.cc index 69d399eb3e0d2..bf3913c5d4db2 100644 --- a/HLTriggerOffline/Top/src/TopSingleLeptonHLTValidation.cc +++ b/HLTriggerOffline/Top/src/TopSingleLeptonHLTValidation.cc @@ -7,10 +7,10 @@ Description: - Description: compute efficiencies of trigger paths on offline reco selection with respect to pt and eta +Description: compute efficiencies of trigger paths on offline reco selection with respect to pt and eta Implementation: - harvesting +harvesting */ // // Original Author: Elvire Bouvier @@ -43,14 +43,15 @@ // ------------ method called for each event ------------ void TopSingleLeptonHLTValidation::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) -{ +{ using namespace edm; isAll_ = false; isSel_ = false; // Electrons Handle< edm::View > electrons; - iEvent.getByToken(tokElectrons_,electrons); + if (!iEvent.getByToken(tokElectrons_,electrons)) + edm::LogWarning("TopSingleLeptonHLTValidation") << "Electrons collection not found \n"; unsigned int nGoodE = 0; for(edm::View::const_iterator e = electrons->begin(); e != electrons->end(); ++e){ if (e->pt() < ptElectrons_) continue; @@ -61,7 +62,8 @@ TopSingleLeptonHLTValidation::analyze(const edm::Event& iEvent, const edm::Event } // Muons Handle< edm::View > muons; - iEvent.getByToken(tokMuons_,muons); + if (!iEvent.getByToken(tokMuons_,muons)) + edm::LogWarning("TopSingleLeptonHLTValidation") << "Muons collection not found \n"; unsigned int nGoodM = 0; for(edm::View::const_iterator m = muons->begin(); m != muons->end(); ++m){ if (!m->isPFMuon() || !m->isGlobalMuon()) continue; @@ -73,7 +75,8 @@ TopSingleLeptonHLTValidation::analyze(const edm::Event& iEvent, const edm::Event } // Jets Handle< edm::View > jets; - iEvent.getByToken(tokJets_,jets); + if (!iEvent.getByToken(tokJets_,jets)) + edm::LogWarning("TopSingleLeptonHLTValidation") << "Jets collection not found \n"; unsigned int nGoodJ = 0; if (minJets_ == 4) { for(edm::View::const_iterator j = jets->begin(); j != jets->end(); ++j){ @@ -97,19 +100,22 @@ TopSingleLeptonHLTValidation::analyze(const edm::Event& iEvent, const edm::Event if (nGoodE >= minElectrons_ && nGoodM >= minMuons_ && nGoodJ >= minJets_) isAll_ = true; + //Trigger Handle triggerTable; - iEvent.getByToken(tokTrigger_,triggerTable); + if (!iEvent.getByToken(tokTrigger_,triggerTable)) + edm::LogWarning("TopSingleLeptonHLTValidation") << "Trigger collection not found \n"; const edm::TriggerNames& triggerNames = iEvent.triggerNames(*triggerTable); for (unsigned int i=0; isetCurrentFolder(sDir_); - hEffLeptonPt = dbe_->book1D("EfficiencyVsPtLepton", "EfficiencyVsPtLepton", 50, 0., 250.); - hEffLeptonEta = dbe_->book1D("EfficiencyVsEtaLepton", "EfficiencyVsEtaLepton", 30, -3. , 3.); - hEffJetPt = dbe_->book1D("EfficiencyVsPtLastJet", "EfficiencyVsPtLastJet", 60, 0., 300.); - hEffJetEta = dbe_->book1D("EfficiencyVsEtaLastJet", "EfficiencyVsEtaLastJet", 30, -3., 3.); - - //------ Efficiency wrt - // lepton pt - for (int iBin = 1; iBin <= hNumLeptonPt->GetNbinsX(); ++iBin) - { - if(hDenLeptonPt->GetBinContent(iBin) == 0) - hEffLeptonPt->setBinContent(iBin, 0.); - else - hEffLeptonPt->setBinContent(iBin, hNumLeptonPt->GetBinContent(iBin) / hDenLeptonPt->GetBinContent(iBin)); - } - // lepton eta - for (int iBin = 1; iBin <= hNumLeptonEta->GetNbinsX(); ++iBin) - { - if(hDenLeptonEta->GetBinContent(iBin) == 0) - hEffLeptonEta->setBinContent(iBin, 0.); - else - hEffLeptonEta->setBinContent(iBin, hNumLeptonEta->GetBinContent(iBin) / hDenLeptonEta->GetBinContent(iBin)); - } - // jet pt - for (int iBin = 1; iBin <= hNumJetPt->GetNbinsX(); ++iBin) - { - if(hDenJetPt->GetBinContent(iBin) == 0) - hEffJetPt->setBinContent(iBin, 0.); - else - hEffJetPt->setBinContent(iBin, hNumJetPt->GetBinContent(iBin) / hDenJetPt->GetBinContent(iBin)); - } - // jet eta - for (int iBin = 1; iBin <= hNumJetEta->GetNbinsX(); ++iBin) - { - if(hDenJetEta->GetBinContent(iBin) == 0) - hEffJetEta->setBinContent(iBin, 0.); - else - hEffJetEta->setBinContent(iBin, hNumJetEta->GetBinContent(iBin) / hDenJetEta->GetBinContent(iBin)); - } + dbe.setCurrentFolder(sDir_); + hDenLeptonPt = dbe.book1D("PtLeptonAll", "PtLeptonAll", 50, 0., 250.); + hDenLeptonEta = dbe.book1D("EtaLeptonAll", "EtaLeptonAll", 30, -3. , 3.); + hDenJetPt = dbe.book1D("PtLastJetAll", "PtLastJetAll", 60, 0., 300.); + hDenJetEta = dbe.book1D("EtaLastJetAll", "EtaLastJetAll", 30, -3., 3.); + hNumLeptonPt = dbe.book1D("PtLeptonSel", "PtLeptonSel", 50, 0., 250.); + hNumLeptonEta = dbe.book1D("EtaLeptonSel", "EtaLeptonSel", 30, -3. , 3.); + hNumJetPt = dbe.book1D("PtLastJetSel", "PtLastJetSel", 60, 0., 300.); + hNumJetEta = dbe.book1D("EtaLastJetSel", "EtaLastJetSel", 30, -3., 3.); } -// ------------ method called when starting to processes a luminosity block ------------ -/* - void - TopSingleLeptonHLTValidation::beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) - { - } - */ - -// ------------ method called when ending the processing of a luminosity block ------------ -/* - void - TopSingleLeptonHLTValidation::endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) - { - } - */ - // ------------ method fills 'descriptions' with the allowed parameters for the module ------------ void TopSingleLeptonHLTValidation::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { From 3c79ed507750151f73e460b7db2975be2c244dcf Mon Sep 17 00:00:00 2001 From: Elvire Bouvier Date: Tue, 11 Feb 2014 11:36:38 +0100 Subject: [PATCH 14/26] fix JetCorrections bug --- DQMOffline/Trigger/python/topHLTOfflineDQM_cff.py | 1 - 1 file changed, 1 deletion(-) diff --git a/DQMOffline/Trigger/python/topHLTOfflineDQM_cff.py b/DQMOffline/Trigger/python/topHLTOfflineDQM_cff.py index 44be7a1806f43..c5053b6d3ed40 100644 --- a/DQMOffline/Trigger/python/topHLTOfflineDQM_cff.py +++ b/DQMOffline/Trigger/python/topHLTOfflineDQM_cff.py @@ -3,7 +3,6 @@ from DQMOffline.Trigger.topDiLeptonHLTEventDQM_cfi import * from DQMOffline.Trigger.topSingleLeptonHLTEventDQM_cfi import * from DQMOffline.Trigger.singletopHLTEventDQM_cfi import * -from JetMETCorrections.Configuration.JetCorrectionProducersAllAlgos_cff import * From 5bfa1881a12982732e23dc546c63933671d3d155 Mon Sep 17 00:00:00 2001 From: Elvire Bouvier Date: Wed, 12 Feb 2014 12:10:41 +0100 Subject: [PATCH 15/26] the missing file --- .../Top/python/topHLTValidationHarvest_cff.py | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 HLTriggerOffline/Top/python/topHLTValidationHarvest_cff.py diff --git a/HLTriggerOffline/Top/python/topHLTValidationHarvest_cff.py b/HLTriggerOffline/Top/python/topHLTValidationHarvest_cff.py new file mode 100644 index 0000000000000..34f4ed727b45a --- /dev/null +++ b/HLTriggerOffline/Top/python/topHLTValidationHarvest_cff.py @@ -0,0 +1,89 @@ +import FWCore.ParameterSet.Config as cms + +DiMuonHLTValidationHarvest = cms.EDAnalyzer("DQMGenericClient", + subDirs = cms.untracked.vstring("HLTValidation/Top/DiMuon"), + efficiency = cms.vstring( + "hEffLeptonEta 'Efficiency vs Eta Lepton ' EtaLeptonSel EtaLeptonAll ", + "hEffLeptonPt 'Efficiency vs Pt Lepton' PtLeptonSel PtLeptonAll ", + "hEffLastJetEta 'Efficiency vs Eta Last Jet' EtaLastJetSel EtaLastJetAll", + "hEffLastJetPt 'Efficiency vs Pt Last Jet' PtLastJetSel PtLastJetAll" + ), + resolution = cms.vstring(""), + ) + +DiElectronHLTValidationHarvest = cms.EDAnalyzer("DQMGenericClient", + subDirs = cms.untracked.vstring("HLTValidation/Top/DiElectron"), + efficiency = cms.vstring( + "hEffLeptonEta 'Efficiency vs Eta Lepton ' EtaLeptonSel EtaLeptonAll ", + "hEffLeptonPt 'Efficiency vs Pt Lepton' PtLeptonSel PtLeptonAll ", + "hEffLastJetEta 'Efficiency vs Eta Last Jet' EtaLastJetSel EtaLastJetAll", + "hEffLastJetPt 'Efficiency vs Pt Last Jet' PtLastJetSel PtLastJetAll" + ), + resolution = cms.vstring(""), + ) + +ElecMuonHLTValidationHarvest = cms.EDAnalyzer("DQMGenericClient", + subDirs = cms.untracked.vstring("HLTValidation/Top/ElecMuon"), + efficiency = cms.vstring( + "hEffLeptonEta 'Efficiency vs Eta Lepton ' EtaLeptonSel EtaLeptonAll ", + "hEffLeptonPt 'Efficiency vs Pt Lepton' PtLeptonSel PtLeptonAll ", + "hEffLastJetEta 'Efficiency vs Eta Last Jet' EtaLastJetSel EtaLastJetAll", + "hEffLastJetPt 'Efficiency vs Pt Last Jet' PtLastJetSel PtLastJetAll" + ), + resolution = cms.vstring(""), + ) + +topSingleMuonHLTValidationHarvest = cms.EDAnalyzer("DQMGenericClient", + subDirs = cms.untracked.vstring("HLTValidation/Top/SemiMuonic"), + efficiency = cms.vstring( + "hEffLeptonEta 'Efficiency vs Eta Lepton ' EtaLeptonSel EtaLeptonAll ", + "hEffLeptonPt 'Efficiency vs Pt Lepton' PtLeptonSel PtLeptonAll ", + "hEffLastJetEta 'Efficiency vs Eta Last Jet' EtaLastJetSel EtaLastJetAll", + "hEffLastJetPt 'Efficiency vs Pt Last Jet' PtLastJetSel PtLastJetAll" + ), + resolution = cms.vstring(""), + ) + +topSingleElectronHLTValidationHarvest = cms.EDAnalyzer("DQMGenericClient", + subDirs = cms.untracked.vstring("HLTValidation/Top/SemiElectronic"), + efficiency = cms.vstring( + "hEffLeptonEta 'Efficiency vs Eta Lepton ' EtaLeptonSel EtaLeptonAll ", + "hEffLeptonPt 'Efficiency vs Pt Lepton' PtLeptonSel PtLeptonAll ", + "hEffLastJetEta 'Efficiency vs Eta Last Jet' EtaLastJetSel EtaLastJetAll", + "hEffLastJetPt 'Efficiency vs Pt Last Jet' PtLastJetSel PtLastJetAll" + ), + resolution = cms.vstring(""), + ) + +SingleTopSingleMuonHLTValidationHarvest = cms.EDAnalyzer("DQMGenericClient", + subDirs = cms.untracked.vstring("HLTValidation/SingleTop/SingleMuon"), + efficiency = cms.vstring( + "hEffLeptonEta 'Efficiency vs Eta Lepton ' EtaLeptonSel EtaLeptonAll ", + "hEffLeptonPt 'Efficiency vs Pt Lepton' PtLeptonSel PtLeptonAll ", + "hEffLastJetEta 'Efficiency vs Eta Last Jet' EtaLastJetSel EtaLastJetAll", + "hEffLastJetPt 'Efficiency vs Pt Last Jet' PtLastJetSel PtLastJetAll" + ), + resolution = cms.vstring(""), + ) + +SingleTopSingleElectronHLTValidationHarvest = cms.EDAnalyzer("DQMGenericClient", + subDirs = cms.untracked.vstring("HLTValidation/SingleTop/SingleElectron"), + efficiency = cms.vstring( + "hEffLeptonEta 'Efficiency vs Eta Lepton ' EtaLeptonSel EtaLeptonAll ", + "hEffLeptonPt 'Efficiency vs Pt Lepton' PtLeptonSel PtLeptonAll ", + "hEffLastJetEta 'Efficiency vs Eta Last Jet' EtaLastJetSel EtaLastJetAll", + "hEffLastJetPt 'Efficiency vs Pt Last Jet' PtLastJetSel PtLastJetAll" + ), + resolution = cms.vstring(""), + ) + +topHLTriggerValidationHarvest = cms.Sequence( + DiMuonHLTValidationHarvest + *DiElectronHLTValidationHarvest + *ElecMuonHLTValidationHarvest + *topSingleMuonHLTValidationHarvest + *topSingleElectronHLTValidationHarvest + *SingleTopSingleMuonHLTValidationHarvest + *SingleTopSingleElectronHLTValidationHarvest + ) + From ef1f8aaaf30ae0ccae190dec88425d48dd258df4 Mon Sep 17 00:00:00 2001 From: Elvire Bouvier Date: Thu, 23 Jan 2014 17:25:56 +0100 Subject: [PATCH 16/26] semi-leptonic ttbar and single top --- HLTriggerOffline/Top/BuildFile.xml | 3 + .../Top/interface/HLTEfficiencyCalculator.h | 145 --- .../Top/interface/TopHLTDQMHelper.h | 395 -------- .../interface/TopSingleLeptonHLTValidation.h | 168 ++++ .../Top/interface/TopValidation.h | 238 ----- .../Top/python/HLTTopPostVal_cff.py | 127 --- .../Top/python/HLTTopQualityTester_cfi.py | 14 - .../Top/python/PostProcessor_cfi.py | 62 -- .../Top/python/singletopHLTEventDQM_cfi.py | 315 ------- .../python/singletopHLTEventValidation_cfi.py | 53 ++ .../Top/python/topDiLeptonHLTEventDQM_cfi.py | 639 ------------- HLTriggerOffline/Top/python/topHLTDQM_cff.py | 20 - .../Top/python/topHLTValidation_cff.py | 17 + .../python/topSingleLeptonHLTEventDQM_cfi.py | 843 ----------------- .../topSingleLeptonHLTEventValidation_cfi.py | 53 ++ .../Top/python/topvalidation_cfi.py | 17 - HLTriggerOffline/Top/python/triggerEff_cfi.py | 8 - .../Top/src/HLTEfficiencyCalculator.cc | 82 -- HLTriggerOffline/Top/src/TopHLTDQMHelper.cc | 149 --- .../Top/src/TopHLTDiLeptonOfflineDQM.cc | 738 --------------- .../Top/src/TopHLTDiLeptonOfflineDQM.h | 316 ------- .../Top/src/TopHLTSingleLeptonDQM.cc | 736 --------------- .../Top/src/TopHLTSingleLeptonDQM.h | 278 ------ .../Top/src/TopSingleLeptonHLTValidation.cc | 235 +++++ HLTriggerOffline/Top/src/TopValidation.cc | 859 ------------------ HLTriggerOffline/Top/src/plugins.cc | 11 - 26 files changed, 529 insertions(+), 5992 deletions(-) delete mode 100644 HLTriggerOffline/Top/interface/HLTEfficiencyCalculator.h delete mode 100644 HLTriggerOffline/Top/interface/TopHLTDQMHelper.h create mode 100644 HLTriggerOffline/Top/interface/TopSingleLeptonHLTValidation.h delete mode 100644 HLTriggerOffline/Top/interface/TopValidation.h delete mode 100644 HLTriggerOffline/Top/python/HLTTopPostVal_cff.py delete mode 100644 HLTriggerOffline/Top/python/HLTTopQualityTester_cfi.py delete mode 100644 HLTriggerOffline/Top/python/PostProcessor_cfi.py delete mode 100644 HLTriggerOffline/Top/python/singletopHLTEventDQM_cfi.py create mode 100644 HLTriggerOffline/Top/python/singletopHLTEventValidation_cfi.py delete mode 100644 HLTriggerOffline/Top/python/topDiLeptonHLTEventDQM_cfi.py delete mode 100644 HLTriggerOffline/Top/python/topHLTDQM_cff.py create mode 100644 HLTriggerOffline/Top/python/topHLTValidation_cff.py delete mode 100644 HLTriggerOffline/Top/python/topSingleLeptonHLTEventDQM_cfi.py create mode 100644 HLTriggerOffline/Top/python/topSingleLeptonHLTEventValidation_cfi.py delete mode 100644 HLTriggerOffline/Top/python/topvalidation_cfi.py delete mode 100644 HLTriggerOffline/Top/python/triggerEff_cfi.py delete mode 100644 HLTriggerOffline/Top/src/HLTEfficiencyCalculator.cc delete mode 100644 HLTriggerOffline/Top/src/TopHLTDQMHelper.cc delete mode 100644 HLTriggerOffline/Top/src/TopHLTDiLeptonOfflineDQM.cc delete mode 100644 HLTriggerOffline/Top/src/TopHLTDiLeptonOfflineDQM.h delete mode 100644 HLTriggerOffline/Top/src/TopHLTSingleLeptonDQM.cc delete mode 100644 HLTriggerOffline/Top/src/TopHLTSingleLeptonDQM.h create mode 100644 HLTriggerOffline/Top/src/TopSingleLeptonHLTValidation.cc delete mode 100644 HLTriggerOffline/Top/src/TopValidation.cc delete mode 100644 HLTriggerOffline/Top/src/plugins.cc diff --git a/HLTriggerOffline/Top/BuildFile.xml b/HLTriggerOffline/Top/BuildFile.xml index fc07887bd8741..0ec2cbc261b7d 100644 --- a/HLTriggerOffline/Top/BuildFile.xml +++ b/HLTriggerOffline/Top/BuildFile.xml @@ -1,8 +1,11 @@ + + + diff --git a/HLTriggerOffline/Top/interface/HLTEfficiencyCalculator.h b/HLTriggerOffline/Top/interface/HLTEfficiencyCalculator.h deleted file mode 100644 index bb162ab74836e..0000000000000 --- a/HLTriggerOffline/Top/interface/HLTEfficiencyCalculator.h +++ /dev/null @@ -1,145 +0,0 @@ - -#ifndef HLTriggerOffline_HLTEffCalculator_H -#define HLTriggerOffline_HLTEffCalculator_H - - -// system include files -#include -#include - -// user include files -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/MakerMacros.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -#include "DataFormats/Common/interface/Ref.h" -#include "DataFormats/Common/interface/DetSetVector.h" -#include "DataFormats/Candidate/interface/Candidate.h" -#include "DataFormats/JetReco/interface/Jet.h" -#include "DataFormats/JetReco/interface/CaloJetCollection.h" -#include "DataFormats/TrackReco/interface/Track.h" -#include "DataFormats/TrackReco/interface/TrackExtra.h" - -#include "DataFormats/MuonReco/interface/MuonFwd.h" -#include "DataFormats/MuonReco/interface/Muon.h" - -#include "DataFormats/Candidate/interface/Candidate.h" -#include "DataFormats/RecoCandidate/interface/RecoCandidate.h" -#include "DataFormats/Common/interface/Handle.h" -#include "DataFormats/Common/interface/TriggerResults.h" -#include "DataFormats/Common/interface/RefToBase.h" -#include "HLTrigger/HLTfilters/interface/HLTHighLevel.h" -#include "DataFormats/EgammaCandidates/interface/GsfElectron.h" -#include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h" - -#include "DataFormats/EgammaCandidates/interface/Electron.h" -#include "DataFormats/EgammaCandidates/interface/ElectronFwd.h" -#include "DataFormats/EgammaReco/interface/SuperCluster.h" -#include "DataFormats/EgammaReco/interface/BasicCluster.h" -#include "DataFormats/EgammaReco/interface/BasicClusterFwd.h" - -#include "FWCore/ServiceRegistry/interface/Service.h" - -#include "HLTriggerOffline/Top/interface/TopHLTDQMHelper.h" - - -#include "TDirectory.h" -#include "TH1F.h" -#include "TVector3.h" -#include "TLorentzVector.h" -#include -#include -#include -#include -#include -#include "TFile.h" -#include "TH1.h" - -class EfficiencyHandler{ -public: - EfficiencyHandler(std::string Name, const std::vector& pathnames, int verb = 0):name(Name),verbosity(verb){ - int nPaths = (int)pathnames.size(); - efficiencies= new TH1D(name.c_str(),"efficiencies per path",nPaths,-0.5,(double)nPaths-0.5); - std::stringstream s; - for(int i = 0; i < nPaths; i++){ - pathNames.push_back(pathnames.at(i)); - efficiencies->GetXaxis()->SetBinLabel(i+1,pathnames.at(i).c_str()); - s.str(""); - s<<"path_"<Fill(0); - if(verbosity > 0) - std::cout<Fill(0); - } - } - void WriteAll(TDirectory * d){ - if(d == NULL){ - std::cout<<"NULL directory! Cannot write!"<GetXaxis()->GetNbins() != (int)denominator.size()){ - std::cout<<"HLT path numbers mismatch!"<GetEntries(); - eff= eff/(double)denominator.at(s)->GetEntries(); - efficiencies->SetBinContent(s+1, eff); - } - (d->mkdir(std::string(name+"_BareNumberHists").c_str()))->cd(); - for(unsigned int s = 0; s < pathNames.size(); s++){ - numerator.at(s)->Write(); - denominator.at(s)->Write(); - } - d->cd(); - efficiencies->Write(); - d->cd(); - } -private: - TH1* efficiencies; - std::vector numerator; //now just a number holder. for possible extention in future - std::vector denominator; //now just a number holder. for possible extention in future - std::string name; - std::vector pathNames; - int verbosity; -}; - -// -// class decleration -// - -class HLTEffCalculator : public edm::EDAnalyzer { -public: - explicit HLTEffCalculator(const edm::ParameterSet&); - ~HLTEffCalculator(); - - -private: - virtual void beginJob() ; - virtual void analyze(const edm::Event&, const edm::EventSetup&); - virtual void endJob() ; - - // edm::Service fs; - - - // ----------member data --------------------------- - - std::string outputFileName ; - EfficiencyHandler * myEffHandler; - edm::InputTag HLTresCollection; - int verbosity ; - edm::EDGetTokenT HLTresCollectionToken_; -}; - - -#endif diff --git a/HLTriggerOffline/Top/interface/TopHLTDQMHelper.h b/HLTriggerOffline/Top/interface/TopHLTDQMHelper.h deleted file mode 100644 index a5835bbff164f..0000000000000 --- a/HLTriggerOffline/Top/interface/TopHLTDQMHelper.h +++ /dev/null @@ -1,395 +0,0 @@ -#ifndef TOPHLTDQMHELPERS -#define TOPHLTDQMHELPERS - -#include -#include -#include -//#include -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Common/interface/TriggerNames.h" -#include "DataFormats/Common/interface/TriggerResults.h" -#include "DataFormats/VertexReco/interface/Vertex.h" -#include "DataFormats/RecoCandidate/interface/RecoCandidate.h" - -#include "FWCore/Framework/interface/ConsumesCollector.h" -#include "FWCore/Framework/interface/EDConsumerBase.h" -/*Originally from DQM/Physics package, written by Roger Wolf and Jeremy Andrea*/ -/** - \fn acceptTopHLTDQMHelpers.h "HLTriggerOffline/Top/interface/TopHLTDQMHelpers.h" - - \brief Helper function to determine trigger accepts. - - Helper function to determine trigger accept for given TriggerResults and - a given TriggerPath(s). -*/ - -inline bool -acceptHLT(const edm::Event& event, const edm::TriggerResults& triggerTable, const std::string& triggerPath) -{ - bool passed=false; - const edm::TriggerNames& triggerNames = event.triggerNames(triggerTable); - for(unsigned int i=0; i& triggerPaths) -{ - bool passed=false; - for(unsigned int j=0; j& jets); - /// calculate top quark mass estimate - double massTopQuark(const std::vector& jets); - /// calculate W boson transverse mass estimate -/* double tmassWBoson(const T& mu, const reco::CaloMET& met, const reco::Jet& b); - /// calculate top quark transverse mass estimate - double tmassTopQuark(const T& mu, const reco::CaloMET& met, const reco::Jet& b); - /// calculate mlb estimate - double masslb(const T& mu, const reco::CaloMET& met, const reco::Jet& b);*/ - - /// calculate W boson transverse mass estimate - double tmassWBoson(reco::RecoCandidate* mu, const reco::MET& met, const reco::Jet& b); - /// calculate top quark transverse mass estimate - double tmassTopQuark(reco::RecoCandidate* mu, const reco::MET& met, const reco::Jet& b); - /// calculate mlb estimate - double masslb(reco::RecoCandidate* mu, const reco::MET& met, const reco::Jet& b); - - private: - /// do the calculation; this is called only once per event by the first - /// function call to return a mass estimate. The once calculated values - /// are cached afterwards - void operator()(const std::vector& jets); - void operator()(const reco::Jet& bJet, reco::RecoCandidate* lepton, const reco::MET& met); - private: - /// indicate failed associations - bool failed_; - /// max. number of jets to be considered - int maxNJets_; - /// paramater of the w boson mass - double wMass_; - /// cache of w boson mass estimate - double massWBoson_; - /// cache of top quark mass estimate - double massTopQuark_; - /// cache of W boson transverse mass estimate - double tmassWBoson_; - /// cache of top quark transverse mass estimate - double tmassTopQuark_; - /// cache of mlb estimate - double mlb_; - - -}; - - -#include "DataFormats/JetReco/interface/JetID.h" -#include "DataFormats/JetReco/interface/PFJet.h" -#include "DataFormats/JetReco/interface/CaloJet.h" -#include "DataFormats/BTauReco/interface/JetTag.h" -#include "DataFormats/Common/interface/ValueMap.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "JetMETCorrections/Objects/interface/JetCorrector.h" -#include "DataFormats/EgammaCandidates/interface/GsfElectron.h" -#include "CommonTools/Utils/interface/StringCutObjectSelector.h" -#include "JetMETCorrections/Objects/interface/JetCorrectionsRecord.h" -#include "DataFormats/RecoCandidate/interface/RecoCandidate.h" - -/** - \class SelectionStep TopHLTDQMHelpers.h "HLTriggerOffline/Top/interface/TopHLTDQMHelpers.h" - - \brief Templated helper class to allow a selection on a certain object collection. - - Templated helper class to allow a selection on a certain object collection, which may - be monitored by a separate class afterwards. The class wraps and slightly extends the - features of the StringCutParser to allow also to apply event based selections, according - to a minimal or maximal number of elements in the collection after the object selection - has been applied. It takes an edm::ParameterSet in the constructor, which should contain - the following elements: - - - src : the input collection (mandatory). - - select : the selection string (mandatory). - - min : whether there is a min value on which to reject the whole event after - the selection (optional). - - max : whether there is a max value on which to reject the whole event after - the selection (optional). - - electronId : input tag of an electronId association map and selection pattern - (optional). - - jetCorrector : label of jet corrector (optional). - - jetBTagger : parameters defining the btag algorithm and working point of choice - (optional). - - jetID : parameters defining the jetID value map and selection (optional). - - - The parameters _src_ and _select_ are mandatory. The parameters _min_ and _max_ are - optional. The parameters _electronId_ and _jetCorrector_ are optional. They are added - to keep the possibility to apply selections on id'ed electrons or on corrected jets. - They may be omitted in the PSet for simplification reasons if not needed at any time. - They are not effiective for other object collections but electrons or jets. If none - of the two parameters _min_ or _max_ is found in the event the select function returns - true if at least one object fullfilled the requirements. - - The class has one template value, which is the object collection to apply the selection - on. This has to be parsed to the StringCutParser class. The function select is overrided - for jets to circumvent problems with the template specialisation. Note that for MET not - type1 or muon corrections are supported on reco candidates. -*/ - -template -class SelectionStepHLT { -public: - /// default constructor - SelectionStepHLT(const edm::ParameterSet& cfg, edm::ConsumesCollector && iC); - /// default destructor - ~SelectionStepHLT(){}; - - /// apply selection - bool select(const edm::Event& event); - /// apply selection override for jets - bool select(const edm::Event& event, const edm::EventSetup& setup); - bool selectVertex(const edm::Event& event); -private: - /// input collection - edm::InputTag src_; - edm::EDGetTokenT< edm::View > srcToken_; - /// min/max for object multiplicity - int min_, max_; - /// electronId label as extra selection type - edm::InputTag electronId_; - edm::EDGetTokenT< edm::ValueMap > electronIdToken_; - /// electronId pattern we expect the following pattern: - /// 0: fails - /// 1: passes electron ID only - /// 2: passes electron Isolation only - /// 3: passes electron ID and Isolation only - /// 4: passes conversion rejection - /// 5: passes conversion rejection and ID - /// 6: passes conversion rejection and Isolation - /// 7: passes the whole selection - /// As described on https://twiki.cern.ch/twiki/bin/view/CMS/SimpleCutBasedEleID - int eidPattern_; - /// jet corrector as extra selection type - std::string jetCorrector_; - /// choice for b-tag as extra selection type - edm::InputTag btagLabel_; - edm::EDGetTokenT btagToken_; - /// choice of b-tag working point as extra selection type - double btagWorkingPoint_; - /// jetID as an extra selection type - edm::InputTag jetIDLabel_; - edm::EDGetTokenT jetIDToken_; - - edm::InputTag pvs_; - edm::EDGetTokenT > pvsToken_; - - /// string cut selector - StringCutObjectSelector select_; - /// selection string on the jetID - StringCutObjectSelector* jetIDSelect_; -}; - -/// default constructor -template -SelectionStepHLT::SelectionStepHLT(const edm::ParameterSet& cfg, edm::ConsumesCollector && iC) : - src_( cfg.getParameter( "src" )), - select_( cfg.getParameter("select")), - jetIDSelect_(0) -{ - srcToken_ = iC.consumes< edm::View >(cfg.getParameter("src")); - pvsToken_ = iC.consumes< edm::View >(cfg.getParameter("pvs")); - // construct min/max if the corresponding params - // exist otherwise they are initialized with -1 - cfg.exists("min") ? min_= cfg.getParameter("min") : min_= -1; - cfg.exists("max") ? max_= cfg.getParameter("max") : max_= -1; - // read electron extras if they exist - if(cfg.existsAs("electronId")){ - edm::ParameterSet elecId=cfg.getParameter("electronId"); - electronId_= elecId.getParameter("src"); - electronIdToken_= iC.consumes< edm::ValueMap >(elecId.getParameter("src")); - eidPattern_= elecId.getParameter("pattern"); - } - // read jet corrector label if it exists - if(cfg.exists("jetCorrector")){ jetCorrector_= cfg.getParameter("jetCorrector"); } - // read btag information if it exists - if(cfg.existsAs("jetBTagger")){ - edm::ParameterSet jetBTagger=cfg.getParameter("jetBTagger"); - btagLabel_=jetBTagger.getParameter("label"); - btagToken_= iC.consumes(jetBTagger.getParameter("label")); - btagWorkingPoint_=jetBTagger.getParameter("workingPoint"); - } - // read jetID information if it exists - if(cfg.existsAs("jetID")){ - edm::ParameterSet jetID=cfg.getParameter("jetID"); - jetIDLabel_ =jetID.getParameter("label"); - jetIDToken_= iC.consumes(jetID.getParameter("label")); - jetIDSelect_= new StringCutObjectSelector(jetID.getParameter("select")); - } -} - -/// apply selection -template -bool SelectionStepHLT::select(const edm::Event& event) -{ - // fetch input collection - edm::Handle > src; - if( !event.getByToken(srcToken_, src) ) return false; - - // load electronId value map if configured such - edm::Handle > electronId; - if(!electronId_.label().empty()) { - if( !event.getByToken(electronIdToken_, electronId) ) return false; - } - - // determine multiplicity of selected objects - int n=0; - for(typename edm::View::const_iterator obj=src->begin(); obj!=src->end(); ++obj){ - // special treatment for electrons - if(dynamic_cast(&*obj)){ - unsigned int idx = obj-src->begin(); - if( electronId_.label().empty() ? true : ((int)(*electronId)[src->refAt(idx)] & eidPattern_) ){ - if(select_(*obj))++n; - } - } - // normal treatment - else{ - if(select_(*obj))++n; - } - } - bool accept=(min_>=0 ? n>=min_:true) && (max_>=0 ? n<=max_:true); - return (min_<0 && max_<0) ? (n>0):accept; -} -template -bool SelectionStepHLT::selectVertex(const edm::Event& event) -{ - // fetch input collection - edm::Handle > src; - if( !event.getByToken(srcToken_, src) ) return false; - - // load electronId value map if configured such - edm::Handle > electronId; - if(!electronId_.label().empty()) { - if( !event.getByToken(electronIdToken_, electronId) ) return false; - } - - // determine multiplicity of selected objects - int n=0; - for(typename edm::View::const_iterator obj=src->begin(); obj!=src->end(); ++obj){ - - if(select_(*obj))++n; - } - bool accept=(min_>=0 ? n>=min_:true) && (max_>=0 ? n<=max_:true); - return (min_<0 && max_<0) ? (n>0):accept; -} - -/// apply selection (w/o using the template class Object), override for jets -template -bool SelectionStepHLT::select(const edm::Event& event, const edm::EventSetup& setup) -{ - // fetch input collection - edm::Handle > src; - if( !event.getByToken(srcToken_, src) ) return false; - - // load btag collection if configured such - // NOTE that the JetTagCollection needs an - // edm::View to reco::Jets; we have to add - // another Handle bjets for this purpose - edm::Handle > bjets; - edm::Handle btagger; - edm::Handle > pvertex; - if(!btagLabel_.label().empty()){ - if( !event.getByToken(srcToken_, bjets) ) return false; - if( !event.getByToken(btagToken_, btagger) ) return false; - if( !event.getByToken(pvsToken_, pvertex) ) return false; - } - - // load jetID value map if configured such - edm::Handle jetID; - if(jetIDSelect_){ - if( !event.getByToken(jetIDToken_, jetID) ) return false; - - } - - // load jet corrector if configured such - const JetCorrector* corrector=0; - if(!jetCorrector_.empty()){ - // check whether a jet correcto is in the event setup or not - if(setup.find( edm::eventsetup::EventSetupRecordKey::makeKey() )){ - corrector = JetCorrector::getJetCorrector(jetCorrector_, setup); - } - else{ - edm::LogVerbatim( "TopDQMHelpers" ) - << "\n" - << "------------------------------------------------------------------------------------- \n" - << " No JetCorrectionsRecord available from EventSetup: \n" - << " - Jets will not be corrected. \n" - << " - If you want to change this add the following lines to your cfg file \n" - << " \n" - << " ## load jet corrections \n" - << " process.load(\"JetMETCorrections.Configuration.JetCorrectionServicesAllAlgos_cff\") \n" - << " process.prefer(\"ak5CaloL2L3\") \n" - << " \n" - << "------------------------------------------------------------------------------------- \n"; - } - } - // determine multiplicity of selected objects - int n=0; - for(typename edm::View::const_iterator obj=src->begin(); obj!=src->end(); ++obj){ - // check for chosen btag discriminator to be above the - // corresponding working point if configured such - unsigned int idx = obj-src->begin(); - if( btagLabel_.label().empty() ? true : (*btagger)[bjets->refAt(idx)]>btagWorkingPoint_ ){ - bool passedJetID=true; - // check jetID for calo jets - if( jetIDSelect_ && dynamic_cast(src->refAt(idx).get())){ - passedJetID=(*jetIDSelect_)((*jetID)[src->refAt(idx)]); - } - if(passedJetID){ - // scale jet energy if configured such - Object jet=*obj; jet.scaleEnergy(corrector ? corrector->correction(*obj) : 1.); - if(select_(jet))++n; - } - } - } - bool accept=(min_>=0 ? n>=min_:true) && (max_>=0 ? n<=max_:true); - return (min_<0 && max_<0) ? (n>0):accept; -} - -#endif diff --git a/HLTriggerOffline/Top/interface/TopSingleLeptonHLTValidation.h b/HLTriggerOffline/Top/interface/TopSingleLeptonHLTValidation.h new file mode 100644 index 0000000000000..cc4b84a765a36 --- /dev/null +++ b/HLTriggerOffline/Top/interface/TopSingleLeptonHLTValidation.h @@ -0,0 +1,168 @@ +// -*- C++ -*- +// +// Package: HLTriggerOffline/Top +// Class: TopSingleLeptonHLTValidation +// +/**\class TopSingleLeptonHLTValidation TopSingleLeptonHLTValidation.h HLTriggerOffline/Top/interface/TopSingleLeptonHLTValidation.h + + Description: compute efficiencies of trigger paths on offline reco selection with respect to pt and eta + + Implementation: + harvesting +*/ +// +// Original Author: Elvire Bouvier +// Created: Thu, 16 Jan 2014 16:27:35 GMT +// +// +#ifndef TOPSINGLELEPTONHLTVALIDATION +#define TOPSINGLELEPTONHLTVALIDATION + +// system include files +#include + +// user include files +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/EDAnalyzer.h" + +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/MakerMacros.h" + +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ServiceRegistry/interface/Service.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" + +#include "DQMServices/Core/interface/DQMStore.h" +#include "DQMServices/Core/interface/MonitorElement.h" + +#include "DataFormats/EgammaCandidates/interface/GsfElectron.h" +#include "DataFormats/MuonReco/interface/Muon.h" +#include "DataFormats/JetReco/interface/Jet.h" +#include "HLTrigger/HLTcore/interface/HLTConfigProvider.h" +#include "DataFormats/Common/interface/TriggerResults.h" +#include "TH1.h" + +// +// class declaration +// + +class TopSingleLeptonHLTValidation : public edm::EDAnalyzer { + public: + explicit TopSingleLeptonHLTValidation(const edm::ParameterSet&); + ~TopSingleLeptonHLTValidation(); + + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + + + private: + virtual void beginJob() override; + virtual void analyze(const edm::Event&, const edm::EventSetup&) override; + virtual void endJob() override; + + //virtual void beginRun(edm::Run const&, edm::EventSetup const&) override; + virtual void endRun(edm::Run const&, edm::EventSetup const&) override; + //virtual void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override; + //virtual void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override; + + // ----------member data --------------------------- + // DQM + DQMStore* dbe_; + std::string sDir_; + MonitorElement* hEffLeptonPt; + MonitorElement* hEffLeptonEta; + MonitorElement* hEffJetPt; + MonitorElement* hEffJetEta; + // Electrons + const reco::GsfElectron *elec_; + std::string sElectrons_; + edm::EDGetTokenT< edm::View > tokElectrons_; + double ptElectrons_; + double etaElectrons_; + double isoElectrons_; + unsigned int minElectrons_; + // Muons + const reco::Muon *mu_; + std::string sMuons_; + edm::EDGetTokenT< edm::View > tokMuons_; + double ptMuons_; + double etaMuons_; + double isoMuons_; + unsigned int minMuons_; + // Jets + const reco::Jet *jet_; + std::string sJets_; + edm::EDGetTokenT< edm::View > tokJets_; + double ptJets_; + double etaJets_; + unsigned int minJets_; + // Trigger + std::string sTrigger_; + edm::EDGetTokenT tokTrigger_; + std::vector vsPaths_; + // Histos + bool isAll_ = false; + TH1F *hDenLeptonPt = new TH1F("PtLeptonAll", "PtLeptonAll", 50, 0., 250.); + TH1F *hDenLeptonEta = new TH1F("EtaLeptonAll", "EtaLeptonAll", 30, -3. , 3.); + TH1F *hDenJetPt = new TH1F("PtLastJetAll", "PtLastJetAll", 60, 0., 300.); + TH1F *hDenJetEta = new TH1F("EtaLastJetAll", "EtaLastJetAll", 30, -3., 3.); + bool isSel_ = false; + TH1F *hNumLeptonPt = new TH1F("PtLeptonSel", "PtLeptonSel", 50, 0., 250.); + TH1F *hNumLeptonEta = new TH1F("EtaLeptonSel", "EtaLeptonSel", 30, -3. , 3.); + TH1F *hNumJetPt = new TH1F("PtLastJetSel", "PtLastJetSel", 60, 0., 300.); + TH1F *hNumJetEta = new TH1F("EtaLastJetSel", "EtaLastJetSel", 30, -3., 3.); +}; + +// +// constants, enums and typedefs +// + +// +// static data member definitions +// + +// +// constructors and destructor +// +TopSingleLeptonHLTValidation::TopSingleLeptonHLTValidation(const edm::ParameterSet& iConfig) : + sDir_(iConfig.getUntrackedParameter("sDir","HLTValidation/Top/Efficiencies/")), + sElectrons_(iConfig.getUntrackedParameter("sElectrons","gsfElectrons")), + ptElectrons_(iConfig.getUntrackedParameter("ptElectrons",0.)), + etaElectrons_(iConfig.getUntrackedParameter("etaElectrons",0.)), + isoElectrons_(iConfig.getUntrackedParameter("isoElectrons",0.)), + minElectrons_(iConfig.getUntrackedParameter("minElectrons",0)), + sMuons_(iConfig.getUntrackedParameter("sMuons","muons")), + ptMuons_(iConfig.getUntrackedParameter("ptMuons",0.)), + etaMuons_(iConfig.getUntrackedParameter("etaMuons",0.)), + isoMuons_(iConfig.getUntrackedParameter("isoMuons",0.)), + minMuons_(iConfig.getUntrackedParameter("minMuons",0)), + sJets_(iConfig.getUntrackedParameter("sJets","ak5PFJets")), + ptJets_(iConfig.getUntrackedParameter("ptJets",0.)), + etaJets_(iConfig.getUntrackedParameter("etaJets",0.)), + minJets_(iConfig.getUntrackedParameter("minJets",0)), + sTrigger_(iConfig.getUntrackedParameter("sTrigger","TriggerResults")), + vsPaths_(iConfig.getUntrackedParameter< std::vector >("vsPaths")) + +{ + dbe_ = edm::Service().operator->(); + // Electrons + tokElectrons_ = consumes< edm::View >(edm::InputTag(sElectrons_)); + // Muons + tokMuons_ = consumes< edm::View >(edm::InputTag(sMuons_)); + // Jets + tokJets_ = consumes< edm::View >(edm::InputTag(sJets_)); + // Trigger + tokTrigger_ = consumes(edm::InputTag(sTrigger_)); +} + + +TopSingleLeptonHLTValidation::~TopSingleLeptonHLTValidation() +{ + + // do anything here that needs to be done at desctruction time + // (e.g. close files, deallocate resources etc.) + +} +#endif + +//define this as a plug-in +DEFINE_FWK_MODULE(TopSingleLeptonHLTValidation); diff --git a/HLTriggerOffline/Top/interface/TopValidation.h b/HLTriggerOffline/Top/interface/TopValidation.h deleted file mode 100644 index d5cd826a071db..0000000000000 --- a/HLTriggerOffline/Top/interface/TopValidation.h +++ /dev/null @@ -1,238 +0,0 @@ - -#ifndef HLTriggerOffline_TopValidation_H -#define HLTriggerOffline_TopValidation_H - - -// system include files -#include -#include - -// user include files -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/MakerMacros.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -#include "DataFormats/Common/interface/Ref.h" -#include "DataFormats/Common/interface/DetSetVector.h" -#include "DataFormats/Candidate/interface/Candidate.h" -#include "DataFormats/JetReco/interface/Jet.h" -#include "DataFormats/JetReco/interface/CaloJetCollection.h" -#include "DataFormats/TrackReco/interface/Track.h" -#include "DataFormats/TrackReco/interface/TrackExtra.h" -//#include "DataFormats/CaloTowers/interface/CaloTowerCollection.h" - -#include "DataFormats/MuonReco/interface/MuonFwd.h" -#include "DataFormats/MuonReco/interface/Muon.h" -/*#include "DataFormats/METReco/interface/MET.h" -#include "DataFormats/METReco/interface/CaloMETCollection.h" -#include "DataFormats/METReco/interface/GenMET.h" -#include "DataFormats/METReco/interface/GenMETCollection.h" */ - -//#include "SimDataFormats/HepMCProduct/interface/HepMCProduct.h" - -#include -#include "DataFormats/Candidate/interface/Candidate.h" -#include "DataFormats/RecoCandidate/interface/RecoCandidate.h" - - - -//#include "DataFormats/VertexReco/interface/Vertex.h" -//#include "RecoVertex/PrimaryVertexProducer/interface/PrimaryVertexSorter.h" -#include "DataFormats/Common/interface/Handle.h" -#include "DataFormats/Common/interface/TriggerResults.h" -#include "DataFormats/Common/interface/RefToBase.h" -#include "HLTrigger/HLTfilters/interface/HLTHighLevel.h" -#include "DataFormats/EgammaCandidates/interface/GsfElectron.h" -#include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h" - -#include "DataFormats/EgammaCandidates/interface/Electron.h" -#include "DataFormats/EgammaCandidates/interface/ElectronFwd.h" -#include "DataFormats/EgammaReco/interface/SuperCluster.h" -#include "DataFormats/EgammaReco/interface/BasicCluster.h" -#include "DataFormats/EgammaReco/interface/BasicClusterFwd.h" - -#include "FWCore/ServiceRegistry/interface/Service.h" -//#include "PhysicsTools/UtilAlgos/interface/TFileService.h" - - -//Include DQM core -#include "DQMServices/Core/interface/DQMStore.h" -#include "DQMServices/Core/interface/MonitorElement.h" - - -#include "TH1F.h" -#include "TVector3.h" -#include "TLorentzVector.h" -#include -#include -#include -#include -#include -#include "TFile.h" - - - -class TH1F; - -// -// class decleration -// - -class TopValidation : public edm::EDAnalyzer { -public: - explicit TopValidation(const edm::ParameterSet&); - ~TopValidation(); - - -private: - virtual void beginJob() ; - virtual void analyze(const edm::Event&, const edm::EventSetup&); - virtual void endJob() ; - - // edm::Service fs; - - - // ----------member data --------------------------- - - std::string fOutputFileName ; - - std::string outFile_, outputFileName; - - bool outputMEsInRootFile; - - edm::InputTag offlineElectrons; - - edm::ParameterSet parameters; - - DQMStore* dbe; - - ///// eta and pt histos //// - - // semimu events - - MonitorElement* eta_off_mu; - MonitorElement* pt_off_mu; - - - // dimu events - - MonitorElement* eta_off_dimu1; - MonitorElement* pt_off_dimu1; - MonitorElement* eta_off_dimu2; - MonitorElement* pt_off_dimu2; - -// semiel events - - MonitorElement* eta_off_el; - MonitorElement* pt_off_el; - - - //diel events - - MonitorElement* eta_off_diel1; - MonitorElement* pt_off_diel1; - MonitorElement* eta_off_diel2; - MonitorElement* pt_off_diel2; - - // emu events - - MonitorElement* eta_off_emu_muon; - MonitorElement* pt_off_emu_muon; - MonitorElement* eta_off_emu_electron; - MonitorElement* pt_off_emu_electron; - - - //// 4jets + 1muon eff monitoring - MonitorElement* ptmuon_4jet1muSel; - MonitorElement* etamuon_4jet1muSel; - MonitorElement* Njets_4jet1muSel; - MonitorElement* ptmuon_4jet1muSel_hltmu9; - MonitorElement* etamuon_4jet1muSel_hltmu9; - MonitorElement* Njets_4jet1muSel_hltmu9; - -////////////////// - - MonitorElement* h_ptmu1_trig[100]; - MonitorElement* h_etamu1_trig[100]; - MonitorElement* h_ptel1_trig[100]; - MonitorElement* h_etael1_trig[100]; - - MonitorElement* h_ptmu1_trig_dimu[100]; - MonitorElement* h_etamu1_trig_dimu[100]; - MonitorElement* h_ptel1_trig_diel[100]; - MonitorElement* h_etael1_trig_diel[100]; - - MonitorElement* h_ptmu1_trig_em[100]; - MonitorElement* h_etamu1_trig_em[100]; - MonitorElement* h_ptel1_trig_em[100]; - MonitorElement* h_etael1_trig_em[100]; - - /***********/ - - MonitorElement* hlt_bitmu_hist_reco ; - MonitorElement* h_mu_reco; - MonitorElement* hlt_bitmu_hist_gen ; - MonitorElement* h_mu_gen; - - MonitorElement* h_jet_reco; - MonitorElement* hlt_bitjet_hist_reco; - - MonitorElement* h_jet_reco_el; - MonitorElement* hlt_bitjet_hist_reco_el; - - MonitorElement* h_jet_gen; - MonitorElement* hlt_bitjet_hist_gen; - - MonitorElement* h_jet_gen_el; - MonitorElement* hlt_bitjet_hist_gen_el; - - MonitorElement* hlt_bitel_hist_reco; - MonitorElement* h_el_reco; - MonitorElement* hlt_bitel_hist_gen; - MonitorElement* h_el_gen; - - MonitorElement* et_off_jet_mu; - MonitorElement* eta_off_jet_mu; - MonitorElement* njets_off_mu; - MonitorElement* et_off_jet_el; - MonitorElement* eta_off_jet_el; - MonitorElement* njets_off_el; - MonitorElement* h_etjet1_trig_mu[100]; - MonitorElement* h_etajet1_trig_mu[100]; - MonitorElement* h_etjet1_trig_el[100]; - MonitorElement* h_etajet1_trig_el[100]; - - MonitorElement* events_acc_off_electron; - MonitorElement* events_acc_off_muon; - - - - - edm::InputTag inputTag_; - std::vector hlt_bitnames; - std::vector hlt_bitnamesMu; - std::vector hlt_bitnamesEg; - std::vector hlt_bitnamesJet; - - - //Just a tag for better file organization - std::string triggerTag_; - - - // Top folder in root file - std::string FolderName_; - std::stringstream topFolder; - - edm::EDGetTokenT muonsToken_; - edm::EDGetTokenT ctfWithMaterialTracksToken_; - edm::EDGetTokenT iterativeCone5CaloJetsToken_; - edm::EDGetTokenT offlineElectronsToken_; - edm::EDGetTokenT inputTagToken_; - edm::EDGetTokenT genParticlesToken_; - -}; - - -#endif diff --git a/HLTriggerOffline/Top/python/HLTTopPostVal_cff.py b/HLTriggerOffline/Top/python/HLTTopPostVal_cff.py deleted file mode 100644 index f3e695cbbf71b..0000000000000 --- a/HLTriggerOffline/Top/python/HLTTopPostVal_cff.py +++ /dev/null @@ -1,127 +0,0 @@ -import FWCore.ParameterSet.Config as cms -from HLTriggerOffline.Top.PostProcessor_cfi import * - -hltTopPostSemimu = HLTTopPostProcessor.clone() - -hltTopPostSemimu.subDirs = ['HLT/Top/Semileptonic_muon'] -hltTopPostSemimu.efficiency = ( - # "TrigEFF 'my title; my x-label; my y-label' pt_trig_off_mu pt_off_mu", - "EffVsPt_HLT_Mu9 'HLT_Mu9 ; p_{T #mu}; Trigger_Efficiency' Muon1Pt_M_HLT_Mu9 Muon1Pt_M", - "EffVsEta_HLT_Mu9 'HLT_Mu9 ; #eta_{#mu}; Trigger_Efficiency' Muon1Eta_M_HLT_Mu9 Muon1Eta_M", - "EffVsPt_HLT_Mu15 'HLT_Mu15 ; p_{T #mu}; Trigger_Efficiency' Muon1Pt_M_HLT_Mu15 Muon1Pt_M", - "EffVsEta_HLT_Mu15 'HLT_Mu15 ; #eta_{#mu}; Trigger_Efficiency' Muon1Eta_M_HLT_Mu15 Muon1Eta_M", - "EffVsPt_HLT_IsoMu9 'HLT_IsoMu9 ; p_{T #mu}; Trigger_Efficiency' Muon1Pt_M_HLT_IsoMu9 Muon1Pt_M", - "EffVsEta_HLT_IsoMu9 'HLT_IsoMu9 ; #eta_{#mu}; Trigger_Efficiency' Muon1Eta_M_HLT_IsoMu9 Muon1Eta_M", - - "Efficiencies_MuonTriggers_gen 'HLT efficiency wrt mc acceptance ; ; Trigger Efficiency' genmuHLT genMuonEvents", - "Efficiencies_MuonTriggers 'HLT efficiency wrt acc+offline ; ; Trigger Efficiency' muHLT MuonEvents", - - ) - -hltTopPostSemiel = HLTTopPostProcessor.clone() - -hltTopPostSemiel.subDirs = ['HLT/Top/Semileptonic_electron'] -hltTopPostSemiel.efficiency = ( - # "TrigEFF 'my title; my x-label; my y-label' pt_trig_off_mu pt_off_mu", - "EffVsPt_HLT_Ele15_SW_L1R 'HLT_Ele15_SW_L1R ; p_{T e}; Trigger_Efficiency' Electron1Pt_E_HLT_Ele15_SW_L1R Electron1Pt_E", - "EffVsEta_HLT_Ele15_SW_L1R 'HLT_Ele15_SW_L1R ; #eta_{e}; Trigger_Efficiency' Electron1Eta_E_HLT_Ele15_SW_L1R Electron1Eta_E", - "EffVsPt_HLT_Ele15_SW_LooseTrackIso_L1R 'HLT_Ele15_SW_LooseTrackIso_L1R ; p_{T e}; Trigger_Efficiency' Electron1Pt_E_HLT_Ele15_SW_LooseTrackIso_L1R Electron1Pt_E", - "EffVsEta_HLT_Ele15_SW_LooseTrackIso_L1R 'HLT_Ele15_SW_LooseTrackIso_L1R ; #eta_{e}; Trigger_Efficiency' Electron1Eta_E_HLT_Ele15_SW_LooseTrackIso_L1R Electron1Eta_E", - - "Efficiencies_Electrontriggers 'HLT efficiency wrt acc+offline ; ; Trigger Efficiency' elHLT ElectronEvents", - "Efficiencies_Electrontriggers_gen 'HLT efficiency wrt mc acceptance ; ; Trigger Efficiency' genelHLT genElectronEvents" - #### - ) - - ################## - -hltTopPostDimu = HLTTopPostProcessor.clone() - -hltTopPostDimu.subDirs = ['HLT/Top/Dileptonic_muon'] -hltTopPostDimu.efficiency = ( - # "TrigEFF 'my title; my x-label; my y-label' pt_trig_off_mu pt_off_mu", - "EffVsPt_HLT_Mu9_MM 'HLT_Mu9 ; p_{T #mu 1}; Trigger_Efficiency' Muon1Pt_MM_HLT_Mu9 Muon1Pt_MM", - "EffVsEta_HLT_Mu9_MM 'HLT_Mu9 ; #eta_{#mu 1}; Trigger_Efficiency' Muon1Eta_MM_HLT_Mu9 Muon1Eta_MM", - "EffVsPt_HLT_Mu15_MM 'HLT_Mu15 ; p_{T #mu 1}; Trigger_Efficiency' Muon1Pt_MM_HLT_Mu15 Muon1Pt_MM", - "EffVsEta_HLT_Mu15_MM 'HLT_Mu15 ; #eta_{#mu 1}; Trigger_Efficiency' Muon1Eta_MM_HLT_Mu15 Muon1Eta_MM", - "EffVsPt_HLT_IsoMu9_MM 'HLT_IsoMu9 ; p_{T #mu 1}; Trigger_Efficiency' Muon1Pt_MM_HLT_IsoMu9 Muon1Pt_MM", - "EffVsEta_HLT_IsoMu9_MM 'HLT_IsoMu9 ; #eta_{#mu 1}; Trigger_Efficiency' Muon1Eta_MM_HLT_IsoMu9 Muon1Eta_MM", - "EffVsPt_HLT_DoubleMu3_MM 'HLT_DoubleMu3 ; p_{T #mu 1}; Trigger_Efficiency' Muon1Pt_MM_HLT_DoubleMu3 Muon1Pt_MM", - "EffVsEta_HLT_DoubleMu3_MM 'HLT_DoubleMu3 ; #eta_{#mu 1}; Trigger_Efficiency' Muon1Eta_MM_HLT_DoubleMu3 Muon1Eta_MM", - - ) - -hltTopPostDiel = HLTTopPostProcessor.clone() - -hltTopPostDiel.subDirs = ['HLT/Top/Dileptonic_electron'] -hltTopPostDiel.efficiency = ( - # "TrigEFF 'my title; my x-label; my y-label' pt_trig_off_mu pt_off_mu", - "EffVsPt_HLT_Ele15_SW_L1R_EE 'HLT_Ele15_SW_L1R ; p_{T e 1}; Trigger_Efficiency' Electron1Pt_EE_HLT_Ele15_SW_L1R Electron1Pt_EE", - "EffVsEta_HLT_Ele15_SW_L1R_EE 'HLT_Ele15_SW_L1R ; #eta_{e 1}; Trigger_Efficiency' Electron1Eta_EE_HLT_Ele15_SW_L1R Electron1Eta_EE", - "EffVsPt_HLT_Ele15_SW_LooseTrackIso_L1R_EE 'HLT_Ele15_SW_LooseTrackIso_L1R ; p_{T e 1}; Trigger_Efficiency' Electron1Pt_EE_HLT_Ele15_SW_LooseTrackIso_L1R Electron1Pt_EE", - "EffVsEta_HLT_Ele15_SW_LooseTrackIso_L1R_EE 'HLT_Ele15_SW_LooseTrackIso_L1R ; #eta_{e 1}; Trigger_Efficiency' Electron1Eta_EE_HLT_Ele15_SW_LooseTrackIso_L1R Electron1Eta_EE", - "EffVsPt_HLT_DoubleEle10_SW_L1R_EE 'HLT_DoubleEle10_SW_L1R ; p_{T e 1}; Trigger_Efficiency' Electron1Pt_EE_HLT_DoubleEle10_SW_L1R Electron1Pt_EE", - "EffVsEta_HLT_DoubleEle10_SW_L1R_EE 'HLT_DoubleEle10_SW_L1R ; #eta_{e 1}; Trigger_Efficiency' Electron1Eta_EE_HLT_DoubleEle10_SW_L1R Electron1Eta_EE", - - ) - -hltTopPostEmu = HLTTopPostProcessor.clone() - -hltTopPostEmu.subDirs = ['HLT/Top/Dileptonic_emu'] -hltTopPostEmu.efficiency = ( - # "TrigEFF 'my title; my x-label; my y-label' pt_trig_off_mu pt_off_mu", - "EffVsPt_HLT_Mu9_EM 'HLT_Mu9 ; p_{T #mu }; Trigger_Efficiency' Muon1Pt_EM_HLT_Mu9 Muon1Pt_EM", - "EffVsEta_HLT_Mu9_EM 'HLT_Mu9 ; #eta_{#mu }; Trigger_Efficiency' Muon1Eta_EM_HLT_Mu9 Muon1Eta_EM", - "EffVsPt_HLT_Mu15_EM 'HLT_Mu15 ; p_{T #mu }; Trigger_Efficiency' Muon1Pt_EM_HLT_Mu15 Muon1Pt_EM", - "EffVsEta_HLT_Mu15_EM 'HLT_Mu15 ; #eta_{#mu }; Trigger_Efficiency' Muon1Eta_EM_HLT_Mu15 Muon1Eta_EM", - "EffVsPt_HLT_IsoMu9_EM 'HLT_IsoMu9 ; p_{T #mu }; Trigger_Efficiency' Muon1Pt_EM_HLT_IsoMu9 Muon1Pt_EM", - "EffVsEta_HLT_IsoMu9_EM 'HLT_IsoMu9 ; #eta_{#mu }; Trigger_Efficiency' Muon1Eta_EM_HLT_IsoMu9 Muon1Eta_EM", - "EffVsPt_HLT_Ele15_SW_L1R_EM 'HLT_Ele15_SW_L1R ; p_{T e }; Trigger_Efficiency' Electron1Pt_EM_HLT_Ele15_SW_L1R Electron1Pt_EM", - "EffVsEta_HLT_Ele15_SW_L1R_EM 'HLT_Ele15_SW_L1R ; #eta_{e }; Trigger_Efficiency' Electron1Eta_EM_HLT_Ele15_SW_L1R Electron1Eta_EM", - "EffVsPt_HLT_Ele15_SW_LooseTrackIso_L1R_EM 'HLT_Ele15_SW_LooseTrackIso_L1R ; p_{T e }; Trigger_Efficiency' Electron1Pt_EM_HLT_Ele15_SW_LooseTrackIso_L1R Electron1Pt_EM", - "EffVsEta_HLT_Ele15_SW_LooseTrackIso_L1R_EM 'HLT_Ele15_SW_LooseTrackIso_L1R ; #eta_{e }; Trigger_Efficiency' Electron1Eta_EM_HLT_Ele15_SW_LooseTrackIso_L1R Electron1Eta_EM", - - ) - -hltTopPostJet = HLTTopPostProcessor.clone() - -hltTopPostJet.subDirs = ['HLT/Top/Jets'] -hltTopPostJet.efficiency = ( - # "TrigEFF 'my title; my x-label; my y-label' pt_trig_off_mu pt_off_mu", - # "EffVsEt_HLT_QuadJet30 'HLT_QuadJet30 ; E_{T jet}; Trigger_Efficiency' Jet1Et_M_HLT_QuadJet30 Jet1Et_M", - "Efficiencies_jetTriggers_semimu 'HLT efficiency wrt acc+offline ; ; Trigger Efficiency' numer denom", - # "EffVsEta_HLT_QuadJet30 'HLT_QuadJet30 ; #eta_{ jet}; Trigger_Efficiency' Jet1Eta_M_HLT_QuadJet30 Jet1Eta_M", - - - "Efficiencies_jetTriggers_semiel 'HLT efficiency wrt acc+offline ; ; Trigger Efficiency' numer_el denom_el", - # "EffVsEt_HLT_QuadJet30_el 'HLT_QuadJet30 ; E_{T jet}; Trigger_Efficiency' Jet1Et_E_HLT_QuadJet30 Jet1Et_E", - # "EffVsEta_HLT_QuadJet30_el 'HLT_QuadJet30 ; #eta_{ jet}; Trigger_Efficiency' Jet1Eta_E_HLT_QuadJet30 Jet1Eta_M", - - ) - - -hltTopPost4Jets = HLTTopPostProcessor.clone() - -hltTopPost4Jets.subDirs = ['HLT/Top/4JetsPlus1MuonToCompareWithData'] -hltTopPost4Jets.efficiency = ( - # "TrigEFF 'my title; my x-label; my y-label' pt_trig_off_mu pt_off_mu", - "EffVsPt_HLTMu9_4Jets1MuonMon 'HLT_Mu9 ; p_{T #mu }; Trigger_Efficiency' Muon1Pt_4Jets1MuonHLTMu9Mon Muon1Pt_4Jets1MuonMon", - "EffVsEta_HLTMu9_4Jets1MuonMon 'HLT_Mu9 ; #eta_{#mu }; Trigger_Efficiency' Muon1Eta_4Jets1MuonHLTMu9Mon Muon1Eta_4Jets1MuonMon", - "EffVsNJets_HLTMu9_4Jets1MuonMon 'HLT_Mu9 ; Jet multiplicity; Trigger_Efficiency' NJets_4Jets1MuonHLTMu9Mon NJets_4Jets1MuonMon", - - ) - - - - - -HLTTopPostVal = cms.Sequence( - hltTopPostSemimu * - hltTopPostSemiel * - hltTopPostDimu * - hltTopPostDiel * - hltTopPostEmu * - hltTopPostJet * - hltTopPost4Jets - -) diff --git a/HLTriggerOffline/Top/python/HLTTopQualityTester_cfi.py b/HLTriggerOffline/Top/python/HLTTopQualityTester_cfi.py deleted file mode 100644 index d6b25fc44532c..0000000000000 --- a/HLTriggerOffline/Top/python/HLTTopQualityTester_cfi.py +++ /dev/null @@ -1,14 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -hltTopQualityTester = cms.EDAnalyzer("QualityTester", - qtList = cms.untracked.FileInPath( - 'HLTriggerOffline/Top/data/HLTTopQualityTest.xml' - ), - #reportThreshold = cms.untracked.string('black'), - prescaleFactor = cms.untracked.int32(1), - getQualityTestsFromFile = cms.untracked.bool(True), - qtestOnEndJob = cms.untracked.bool(True), - qtestOnEndLumi = cms.untracked.bool(False), - testInEventloop = cms.untracked.bool(False), - verboseQT = cms.untracked.bool(False) -) diff --git a/HLTriggerOffline/Top/python/PostProcessor_cfi.py b/HLTriggerOffline/Top/python/PostProcessor_cfi.py deleted file mode 100644 index 97bd60dc26ec0..0000000000000 --- a/HLTriggerOffline/Top/python/PostProcessor_cfi.py +++ /dev/null @@ -1,62 +0,0 @@ -import FWCore.ParameterSet.Config as cms - - -HLTTopPostProcessor = cms.EDAnalyzer("DQMGenericClient", - subDirs = cms.untracked.vstring('HLT/Top/'), - verbose = cms.untracked.uint32(0), # Set to 2 for all messages - outputFileName = cms.untracked.string(''), - commands = cms.vstring(''), - resolution = cms.vstring(''), - efficiency = cms.vstring( - # "TrigEFF 'my title; my x-label; my y-label' pt_trig_off_mu pt_off_mu", - "EffVsPt_HLT_Mu9 'HLT_Mu9 ; p_{T #mu}; Trigger_Efficiency' Muon1Pt_M_HLT_Mu9 Muon1Pt_M", - "EffVsEta_HLT_Mu9 'HLT_Mu9 ; #eta_{#mu}; Trigger_Efficiency' Muon1Eta_M_HLT_Mu9 Muon1Eta_M", - "EffVsPt_HLT_Mu15 'HLT_Mu15 ; p_{T #mu}; Trigger_Efficiency' Muon1Pt_M_HLT_Mu15 Muon1Pt_M", - "EffVsEta_HLT_Mu15 'HLT_Mu15 ; #eta_{#mu}; Trigger_Efficiency' Muon1Eta_M_HLT_Mu15 Muon1Eta_M", - "EffVsPt_HLT_IsoMu9 'HLT_IsoMu9 ; p_{T #mu}; Trigger_Efficiency' Muon1Pt_M_HLT_IsoMu9 Muon1Pt_M", - "EffVsEta_HLT_IsoMu9 'HLT_IsoMu9 ; #eta_{#mu}; Trigger_Efficiency' Muon1Eta_M_HLT_IsoMu9 Muon1Eta_M", - "EffVsPt_HLT_Ele15_SW_L1R 'HLT_Ele15_SW_L1R ; p_{T e}; Trigger_Efficiency' Electron1Pt_E_HLT_Ele15_SW_L1R Electron1Pt_E", - "EffVsEta_HLT_Ele15_SW_L1R 'HLT_Ele15_SW_L1R ; #eta_{e}; Trigger_Efficiency' Electron1Eta_E_HLT_Ele15_SW_L1R Electron1Eta_E", - "EffVsPt_HLT_Ele15_SW_LooseTrackIso_L1R 'HLT_Ele15_SW_LooseTrackIso_L1R ; p_{T e}; Trigger_Efficiency' Electron1Pt_E_HLT_Ele15_SW_LooseTrackIso_L1R Electron1Pt_E", - "EffVsEta_HLT_Ele15_SW_LooseTrackIso_L1R 'HLT_Ele15_SW_LooseTrackIso_L1R ; #eta_{e}; Trigger_Efficiency' Electron1Eta_E_HLT_Ele15_SW_LooseTrackIso_L1R Electron1Eta_E", - "EffVsPt_HLT_Mu9_MM 'HLT_Mu9 ; p_{T #mu 1}; Trigger_Efficiency' Muon1Pt_MM_HLT_Mu9 Muon1Pt_MM", - "EffVsEta_HLT_Mu9_MM 'HLT_Mu9 ; #eta_{#mu 1}; Trigger_Efficiency' Muon1Eta_MM_HLT_Mu9 Muon1Eta_MM", - "EffVsPt_HLT_Mu15_MM 'HLT_Mu15 ; p_{T #mu 1}; Trigger_Efficiency' Muon1Pt_MM_HLT_Mu15 Muon1Pt_MM", - "EffVsEta_HLT_Mu15_MM 'HLT_Mu15 ; #eta_{#mu 1}; Trigger_Efficiency' Muon1Eta_MM_HLT_Mu15 Muon1Eta_MM", - "EffVsPt_HLT_IsoMu9_MM 'HLT_IsoMu9 ; p_{T #mu 1}; Trigger_Efficiency' Muon1Pt_MM_HLT_IsoMu9 Muon1Pt_MM", - "EffVsEta_HLT_IsoMu9_MM 'HLT_IsoMu9 ; #eta_{#mu 1}; Trigger_Efficiency' Muon1Eta_MM_HLT_IsoMu9 Muon1Eta_MM", - "EffVsPt_HLT_DoubleMu3_MM 'HLT_DoubleMu3 ; p_{T #mu 1}; Trigger_Efficiency' Muon1Pt_MM_HLT_DoubleMu3 Muon1Pt_MM", - "EffVsEta_HLT_DoubleMu3_MM 'HLT_DoubleMu3 ; #eta_{#mu 1}; Trigger_Efficiency' Muon1Eta_MM_HLT_DoubleMu3 Muon1Eta_MM", - "EffVsPt_HLT_Ele15_SW_L1R_EE 'HLT_Ele15_SW_L1R ; p_{T e 1}; Trigger_Efficiency' Electron1Pt_EE_HLT_Ele15_SW_L1R Electron1Pt_EE", - "EffVsEta_HLT_Ele15_SW_L1R_EE 'HLT_Ele15_SW_L1R ; #eta_{e 1}; Trigger_Efficiency' Electron1Eta_EE_HLT_Ele15_SW_L1R Electron1Eta_EE", - "EffVsPt_HLT_Ele15_SW_LooseTrackIso_L1R_EE 'HLT_Ele15_SW_LooseTrackIso_L1R ; p_{T e 1}; Trigger_Efficiency' Electron1Pt_EE_HLT_Ele15_SW_LooseTrackIso_L1R Electron1Pt_EE", - "EffVsEta_HLT_Ele15_SW_LooseTrackIso_L1R_EE 'HLT_Ele15_SW_LooseTrackIso_L1R ; #eta_{e 1}; Trigger_Efficiency' Electron1Eta_EE_HLT_Ele15_SW_LooseTrackIso_L1R Electron1Eta_EE", - "EffVsPt_HLT_DoubleEle10_SW_L1R_EE 'HLT_DoubleEle10_SW_L1R ; p_{T e 1}; Trigger_Efficiency' Electron1Pt_EE_HLT_DoubleEle10_SW_L1R Electron1Pt_EE", - "EffVsEta_HLT_DoubleEle10_SW_L1R_EE 'HLT_DoubleEle10_SW_L1R ; #eta_{e 1}; Trigger_Efficiency' Electron1Eta_EE_HLT_DoubleEle10_SW_L1R Electron1Eta_EE", - "EffVsPt_HLT_Mu9_EM 'HLT_Mu9 ; p_{T #mu }; Trigger_Efficiency' Muon1Pt_EM_HLT_Mu9 Muon1Pt_EM", - "EffVsEta_HLT_Mu9_EM 'HLT_Mu9 ; #eta_{#mu }; Trigger_Efficiency' Muon1Eta_EM_HLT_Mu9 Muon1Eta_EM", - "EffVsPt_HLT_Mu15_EM 'HLT_Mu15 ; p_{T #mu }; Trigger_Efficiency' Muon1Pt_EM_HLT_Mu15 Muon1Pt_EM", - "EffVsEta_HLT_Mu15_EM 'HLT_Mu15 ; #eta_{#mu }; Trigger_Efficiency' Muon1Eta_EM_HLT_Mu15 Muon1Eta_EM", - "EffVsPt_HLT_IsoMu9_EM 'HLT_IsoMu9 ; p_{T #mu }; Trigger_Efficiency' Muon1Pt_EM_HLT_IsoMu9 Muon1Pt_EM", - "EffVsEta_HLT_IsoMu9_EM 'HLT_IsoMu9 ; #eta_{#mu }; Trigger_Efficiency' Muon1Eta_EM_HLT_IsoMu9 Muon1Eta_EM", - "EffVsPt_HLT_Ele15_SW_L1R_EM 'HLT_Ele15_SW_L1R ; p_{T e }; Trigger_Efficiency' Electron1Pt_EM_HLT_Ele15_SW_L1R Electron1Pt_EM", - "EffVsEta_HLT_Ele15_SW_L1R_EM 'HLT_Ele15_SW_L1R ; #eta_{e }; Trigger_Efficiency' Electron1Eta_EM_HLT_Ele15_SW_L1R Electron1Eta_EM", - "EffVsPt_HLT_Ele15_SW_LooseTrackIso_L1R_EM 'HLT_Ele15_SW_LooseTrackIso_L1R ; p_{T e }; Trigger_Efficiency' Electron1Pt_EM_HLT_Ele15_SW_LooseTrackIso_L1R Electron1Pt_EM", - "EffVsEta_HLT_Ele15_SW_LooseTrackIso_L1R_EM 'HLT_Ele15_SW_LooseTrackIso_L1R ; #eta_{e }; Trigger_Efficiency' Electron1Eta_EM_HLT_Ele15_SW_LooseTrackIso_L1R Electron1Eta_EM", - ##### - "Efficiencies_muontriggers 'HLT efficiency wrt offline ; eff ; Trigger Efficiency' muHLT MuonEvents", - - "Efficiencies_muontriggers_gen 'HLT efficiency wrt mc ; eff ; Trigger Efficiency' genmuHLT genMuonEvents", - #### - - - "Efficiencies_jettriggers_semimu 'HLT efficiency wrt offline ; eff ; Trigger Efficiency' numer denom", - - "Efficiencies_electrontriggers 'HLT efficiency wrt offline ; eff ; Trigger Efficiency' elHLT ElectronEvents", - - "Efficiencies_electrontriggers_gen 'HLT efficiency wrt mc ; eff ; Trigger Efficiency' genelHLT genElectronEvents" - #### - - ) -) - diff --git a/HLTriggerOffline/Top/python/singletopHLTEventDQM_cfi.py b/HLTriggerOffline/Top/python/singletopHLTEventDQM_cfi.py deleted file mode 100644 index 474ffbc0713ea..0000000000000 --- a/HLTriggerOffline/Top/python/singletopHLTEventDQM_cfi.py +++ /dev/null @@ -1,315 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -SingleTopSingleMuonTriggerDQM = cms.EDAnalyzer("TopHLTSingleLeptonDQM", - ## ------------------------------------------------------ - ## SETUP - ## - ## configuration of the MonitoringEnsemble(s) - ## [mandatory] : optional PSets may be omitted - ## - setup = cms.PSet( - ## sub-directory to write the monitor histograms to - ## [mandatory] : should not be changed w/o explicit - ## communication to TopCom! - directory = cms.string("HLTriggerOffline/SingleTop/SingleTopMuonTriggerDQM/"), - ## [mandatory] - sources = cms.PSet( - muons = cms.InputTag("muons"), - elecs = cms.InputTag("gedGsfElectrons"), - jets = cms.InputTag("ak5CaloJets"), - mets = cms.VInputTag("met", "tcMet", "pfMet"), - pvs = cms.InputTag("offlinePrimaryVertices") - - ), - ## [optional] : when omitted the verbosity level is set to STANDARD - monitoring = cms.PSet( - verbosity = cms.string("DEBUG") - ), - ## [optional] : when omitted all monitoring plots for primary vertices - ## will be filled w/o extras - pvExtras = cms.PSet( - ## when omitted electron plots will be filled w/o additional pre- - ## selection of the primary vertex candidates - select = cms.string("abs(x)<1. & abs(y)<1. & abs(z)<20. & tracksSize>3 & !isFake") - ), - ## [optional] : when omitted all monitoring plots for muons - ## will be filled w/o extras - muonExtras = cms.PSet( - ## when omitted muon plots will be filled w/o additional pre- - ## selection of the muon candidates - select = cms.string("pt>20 & abs(eta)<2.1 & isGlobalMuon & innerTrack.numberOfValidHits>10 & globalTrack.normalizedChi2>-1 & globalTrack.normalizedChi2<10 & (isolationR03.sumPt+isolationR03.emEt+isolationR03.hadEt)/pt<0.1"), - ## when omitted isolated muon multiplicity plot will be equi- - ## valent to inclusive muon multiplicity plot - isolation = cms.string("(isolationR03.sumPt+isolationR03.emEt+isolationR03.hadEt)/pt<0.1") - ), - ## [optional] : when omitted all monitoring plots for jets - ## will be filled w/o extras - jetExtras = cms.PSet( - ## when omitted monitor plots for pt will be filled from uncorrected - ## jets - jetCorrector = cms.string("ak5PFL2L3"), - ## when omitted monitor plots will be filled w/o additional cut on - ## jetID - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - ## when omitted no extra selection will be applied on jets before - ## filling the monitor histograms; if jetCorrector is present the - ## selection will be applied to corrected jets - select = cms.string("pt>30 & abs(eta)<4.5& emEnergyFraction>0.01"), - ## when omitted monitor histograms for b-tagging will not be filled - jetBTaggers = cms.PSet( - trackCountingEff = cms.PSet( - label = cms.InputTag("trackCountingHighEffBJetTags" ), - workingPoint = cms.double(1.25) - ), - trackCountingPur = cms.PSet( - label = cms.InputTag("trackCountingHighPurBJetTags" ), - workingPoint = cms.double(3.00) - ), - secondaryVertex = cms.PSet( - label = cms.InputTag("simpleSecondaryVertexHighEffBJetTags"), - workingPoint = cms.double(2.05) - ) - ), - ), - ## [optional] : when omitted no mass window will be applied - ## for the W mass before filling the event monitoring plots - massExtras = cms.PSet( - lowerEdge = cms.double( 70.), - upperEdge = cms.double(110.) - ), - ## [optional] : when omitted the monitoring plots for triggering - ## will be empty - triggerExtras = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - paths = cms.vstring(['HLT_Mu3:HLT_QuadJet15U', - 'HLT_Mu5:HLT_QuadJet15U', - 'HLT_Mu7:HLT_QuadJet15U', - 'HLT_Mu9:HLT_QuadJet15U', - 'HLT_Mu11:HLT_QuadJet15U']) - ) - ), - ## ------------------------------------------------------ - ## PRESELECTION - ## - ## setup of the event preselection, which will not - ## be monitored - ## [mandatory] : but may be empty - ## - preselection = cms.PSet( - trigger = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - select = cms.vstring(['HLT_Iso10Mu20_eta2p1_CentralCaloJet30_BTagIPIter_v1'])#ONLY ONE PATH - ), - ## [optional] : when omitted no preselection is applied - vertex = cms.PSet( - src = cms.InputTag("offlinePrimaryVertices"), - select = cms.string('abs(x)<1. & abs(y)<1. & abs(z)<20. & tracksSize>3 & !isFake') - ) - ), - ## ------------------------------------------------------ - ## SELECTION - ## - ## monitor histrograms are filled after each selection - ## step, the selection is applied in the order defined - ## by this vector - ## [mandatory] : may be empty or contain an arbitrary - ## number of PSets - selection = cms.VPSet( - cms.PSet( - label = cms.string("Hlt:step0"), - src = cms.InputTag(""), - select = cms.string(""), - min = cms.int32(0), - max = cms.int32(0), - ), - cms.PSet( - label = cms.string("muons:step1"), - src = cms.InputTag("muons"), - select = cms.string("pt>20 & abs(eta)<2.1 & isGlobalMuon & innerTrack.numberOfValidHits>10 & globalTrack.normalizedChi2>-1 & globalTrack.normalizedChi2<10 & (isolationR03.sumPt+isolationR03.emEt+isolationR03.hadEt)/pt<0.1"), - min = cms.int32(1), - max = cms.int32(1), - ), - cms.PSet( - label = cms.string("jets/calo:step2"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5PFL2L3"), - select = cms.string("pt>30 & abs(eta)<4.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(1), - ), - cms.PSet( - label = cms.string("jets/calo:step3"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5PFL2L3"), - select = cms.string("pt>30 & abs(eta)<4.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(2), - ), - ) -) - -SingleTopSingleElectronTriggerDQM = cms.EDAnalyzer("TopHLTSingleLeptonDQM", - ## ------------------------------------------------------ - ## SETUP - ## - ## configuration of the MonitoringEnsemble(s) - ## [mandatory] : optional PSets may be omitted - ## - setup = cms.PSet( - ## sub-directory to write the monitor histograms to - ## [mandatory] : should not be changed w/o explicit - ## communication to TopCom! - directory = cms.string("HLTriggerOffline/SingleTop/SingleTopElectronTriggerDQM/"), - ## [mandatory] - sources = cms.PSet( - muons = cms.InputTag("muons"), - elecs = cms.InputTag("gedGsfElectrons"), - jets = cms.InputTag("ak5CaloJets"), - mets = cms.VInputTag("met", "tcMet", "pfMet"), - pvs = cms.InputTag("offlinePrimaryVertices") - - ), - ## [optional] : when omitted the verbosity level is set to STANDARD - monitoring = cms.PSet( - verbosity = cms.string("DEBUG") - ), - ## [optional] : when omitted all monitoring plots for primary vertices - ## will be filled w/o extras - pvExtras = cms.PSet( - ## when omitted electron plots will be filled w/o additional pre- - ## selection of the primary vertex candidates - select = cms.string("abs(x)<1. & abs(y)<1. & abs(z)<20. & tracksSize>3 & !isFake") - ), - ## [optional] : when omitted all monitoring plots for muons - ## will be filled w/o extras - muonExtras = cms.PSet( - ## when omitted muon plots will be filled w/o additional pre- - ## selection of the muon candidates - select = cms.string("pt>20 & abs(eta)<2.1 & isGlobalMuon & innerTrack.numberOfValidHits>10 & globalTrack.normalizedChi2>-1 & globalTrack.normalizedChi2<10 & (isolationR03.sumPt+isolationR03.emEt+isolationR03.hadEt)/pt<0.1"), - ## when omitted isolated muon multiplicity plot will be equi- - ## valent to inclusive muon multiplicity plot - isolation = cms.string("(isolationR03.sumPt+isolationR03.emEt+isolationR03.hadEt)/pt<0.1") - ), - ## [optional] : when omitted all monitoring plots for jets - ## will be filled w/o extras - jetExtras = cms.PSet( - ## when omitted monitor plots for pt will be filled from uncorrected - ## jets - jetCorrector = cms.string("ak5PFL2L3"), - ## when omitted monitor plots will be filled w/o additional cut on - ## jetID - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - ## when omitted no extra selection will be applied on jets before - ## filling the monitor histograms; if jetCorrector is present the - ## selection will be applied to corrected jets - select = cms.string("pt>30 & abs(eta)<4.5& emEnergyFraction>0.01"), - ## when omitted monitor histograms for b-tagging will not be filled - jetBTaggers = cms.PSet( - trackCountingEff = cms.PSet( - label = cms.InputTag("trackCountingHighEffBJetTags" ), - workingPoint = cms.double(1.25) - ), - trackCountingPur = cms.PSet( - label = cms.InputTag("trackCountingHighPurBJetTags" ), - workingPoint = cms.double(3.00) - ), - secondaryVertex = cms.PSet( - label = cms.InputTag("simpleSecondaryVertexHighEffBJetTags"), - workingPoint = cms.double(2.05) - ) - ), - ), - ## [optional] : when omitted no mass window will be applied - ## for the W mass before filling the event monitoring plots - massExtras = cms.PSet( - lowerEdge = cms.double( 70.), - upperEdge = cms.double(110.) - ), - ## [optional] : when omitted the monitoring plots for triggering - ## will be empty - triggerExtras = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - paths = cms.vstring(['HLT_Mu3:HLT_QuadJet15U', - 'HLT_Mu5:HLT_QuadJet15U', - 'HLT_Mu7:HLT_QuadJet15U', - 'HLT_Mu9:HLT_QuadJet15U', - 'HLT_Mu11:HLT_QuadJet15U']) - ) - ), - ## ------------------------------------------------------ - ## PRESELECTION - ## - ## setup of the event preselection, which will not - ## be monitored - ## [mandatory] : but may be empty - ## - preselection = cms.PSet( - trigger = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - select = cms.vstring(['HLT_Iso10Mu20_eta2p1_CentralCaloJet30_BTagIPIter_v1'])#ONLY ONE PATH - ), - ## [optional] : when omitted no preselection is applied - vertex = cms.PSet( - src = cms.InputTag("offlinePrimaryVertices"), - select = cms.string('abs(x)<1. & abs(y)<1. & abs(z)<20. & tracksSize>3 & !isFake') - ) - ), - ## ------------------------------------------------------ - ## SELECTION - ## - ## monitor histrograms are filled after each selection - ## step, the selection is applied in the order defined - ## by this vector - ## [mandatory] : may be empty or contain an arbitrary - ## number of PSets - selection = cms.VPSet( - cms.PSet( - label = cms.string("Hlt:step0"), - src = cms.InputTag(""), - select = cms.string(""), - min = cms.int32(0), - max = cms.int32(0), - ), - cms.PSet( - label = cms.string("muons:step1"), - src = cms.InputTag("muons"), - select = cms.string("pt>20 & abs(eta)<2.1 & isGlobalMuon & innerTrack.numberOfValidHits>10 & globalTrack.normalizedChi2>-1 & globalTrack.normalizedChi2<10 & (isolationR03.sumPt+isolationR03.emEt+isolationR03.hadEt)/pt<0.1"), - min = cms.int32(1), - max = cms.int32(1), - ), - cms.PSet( - label = cms.string("jets/calo:step2"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5PFL2L3"), - select = cms.string("pt>30 & abs(eta)<4.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(1), - ), - cms.PSet( - label = cms.string("jets/calo:step3"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>30 & abs(eta)<4.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(2), - ), - ) -) diff --git a/HLTriggerOffline/Top/python/singletopHLTEventValidation_cfi.py b/HLTriggerOffline/Top/python/singletopHLTEventValidation_cfi.py new file mode 100644 index 0000000000000..3960ae9a6e845 --- /dev/null +++ b/HLTriggerOffline/Top/python/singletopHLTEventValidation_cfi.py @@ -0,0 +1,53 @@ +import FWCore.ParameterSet.Config as cms + +# single top muonique +SingleTopSingleMuonHLTValidation = cms.EDAnalyzer('TopSingleLeptonHLTValidation', + # Directory + sDir = cms.untracked.string('HLTValidation/SingleTop/SingleMuon/'), + # Electrons + sElectrons = cms.untracked.string('gsfElectrons'), + ptElectrons = cms.untracked.double(30.), + etaElectrons = cms.untracked.double(2.5), + isoElectrons = cms.untracked.double(0.1), + minElectrons = cms.untracked.uint32(0), + # Muons + sMuons = cms.untracked.string('muons'), + ptMuons = cms.untracked.double(26.), + etaMuons = cms.untracked.double(2.1), + isoMuons = cms.untracked.double(0.12), + minMuons = cms.untracked.uint32(1), + # Jets + sJets = cms.untracked.string('ak5PFJets'), + ptJets = cms.untracked.double(40.), + etaJets = cms.untracked.double(5.), + minJets = cms.untracked.uint32(2), + # Trigger + sTrigger = cms.untracked.string("TriggerResults"), + vsPaths = cms.untracked.vstring(['HLT_IsoMu17_eta2p1_TriCentralPFNoPUJet45_35_25','HLT_IsoMu17_eta2p1_TriCentralPFNoPUJet30']), +) + +# single top electronique +SingleTopSingleElectronHLTValidation = cms.EDAnalyzer('TopSingleLeptonHLTValidation', + # Directory + sDir = cms.untracked.string('HLTValidation/SingleTop/SingleElectron/'), + # Electrons + sElectrons = cms.untracked.string('gsfElectrons'), + ptElectrons = cms.untracked.double(30.), + etaElectrons = cms.untracked.double(2.5), + isoElectrons = cms.untracked.double(0.1), + minElectrons = cms.untracked.uint32(1), + # Muons + sMuons = cms.untracked.string('muons'), + ptMuons = cms.untracked.double(26.), + etaMuons = cms.untracked.double(2.1), + isoMuons = cms.untracked.double(0.12), + minMuons = cms.untracked.uint32(0), + # Jets + sJets = cms.untracked.string('ak5PFJets'), + ptJets = cms.untracked.double(40.), + etaJets = cms.untracked.double(5.), + minJets = cms.untracked.uint32(2), + # Trigger + sTrigger = cms.untracked.string("TriggerResults"), + vsPaths = cms.untracked.vstring(['HLT_Ele25_CaloIdVT_CaloIsoVL_TrkIdVL_TrkIsoT_TriCentralPFNoPUJet45_35_25','HLT_Ele25_CaloIdVT_CaloIsoVL_TrkIdVL_TrkIsoT_TriCentralPFNoPUJet30']), +) diff --git a/HLTriggerOffline/Top/python/topDiLeptonHLTEventDQM_cfi.py b/HLTriggerOffline/Top/python/topDiLeptonHLTEventDQM_cfi.py deleted file mode 100644 index 49b0aeb46320d..0000000000000 --- a/HLTriggerOffline/Top/python/topDiLeptonHLTEventDQM_cfi.py +++ /dev/null @@ -1,639 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -topDiLeptonTriggerDQM = cms.EDAnalyzer("TopHLTDiLeptonOfflineDQM", - ## ------------------------------------------------------ - ## SETUP - ## - ## configuration of the MonitoringEnsemble(s) - ## [mandatory] : optional PSets may be omitted - ## - setup = cms.PSet( - ## sub-directory to write the monitor histograms to - ## [mandatory] : should not be changed w/o explicit - ## communication to TopCom! - directory = cms.string("Physics/Top/TopDiLeptonDQM/"), - - ## [mandatory] - sources = cms.PSet( - muons = cms.InputTag("muons"), - elecs = cms.InputTag("gedGsfElectrons"), - jets = cms.InputTag("ak5CaloJets"), - mets = cms.VInputTag("met", "tcMet", "pfMet") - ), - ## [optional] : when omitted the verbosity level is set to STANDARD - monitoring = cms.PSet( - verbosity = cms.string("DEBUG") - ), - ## [optional] : when omitted all monitoring plots for electrons - ## will be filled w/o extras - elecExtras = cms.PSet( - ## when omitted electron plots will be filled w/o cut on electronId - electronId = cms.PSet( - src = cms.InputTag("simpleEleId70cIso"), - #src = cms.InputTag("eidRobustLoose"), - pattern = cms.int32(1) - ), - ## when omitted electron plots will be filled w/o additional pre- - ## selection of the electron candidates - select = cms.string("pt>10. && abs(eta)<2.4 && abs(gsfTrack.d0)<1. && abs(gsfTrack.dz)<20."), - ## when omitted isolated electron multiplicity plot will be equi- - ## valent to inclusive electron multiplicity plot - isolation = cms.string("(dr03TkSumPt+dr03EcalRecHitSumEt+dr03HcalTowerSumEt)/pt<0.2"), - ), - ## [optional] : when omitted all monitoring plots for muons - ## will be filled w/o extras - muonExtras = cms.PSet( - ## when omitted muon plots will be filled w/o additional pre- - ## selection of the muon candidates - select = cms.string("pt>10. && abs(eta)<2.4 && abs(globalTrack.d0)<1. && abs(globalTrack.dz)<20."), - ## when omitted isolated muon multiplicity plot will be equi- - ## valent to inclusive muon multiplicity plot - isolation = cms.string("(isolationR03.sumPt+isolationR03.emEt+isolationR03.hadEt)/pt<0.2"), - ), - ## [optional] : when omitted all monitoring plots for jets will - ## be filled from uncorrected jets - jetExtras = cms.PSet( - ## when omitted monitor plots for pt will be filled from uncorrected - ## jets - jetCorrector = cms.string("ak5CaloL2L3"), - ## when omitted monitor plots will be filled w/o additional cut on - ## jetID - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - ## when omitted no extra selection will be applied on jets before - ## filling the monitor histograms; if jetCorrector is present the - ## selection will be applied to corrected jets - select = cms.string("pt>30. & abs(eta)<2.4 & emEnergyFraction>0.01"), - ), - ## [optional] : when omitted no mass window will be applied - ## for the same flavor lepton monitoring plots - massExtras = cms.PSet( - lowerEdge = cms.double( 76.0), - upperEdge = cms.double(106.0) - ), - ## [optional] : when omitted all monitoring plots for triggering - ## will be empty - #triggerExtras = cms.PSet( - #src = cms.InputTag("TriggerResults","","HLT"), - #pathsELECMU = cms.vstring([ 'HLT_Mu9:HLT_Ele15_SW_L1R', - #'HLT_Mu15:HLT_Ele15_SW_L1R', - #'HLT_DoubleMu3:HLT_Ele15_SW_L1R', - #'HLT_Ele15_SW_L1R:HLT_Mu9', - #'HLT_Ele15_SW_L1R:HLT_DoubleMu3']), - #pathsDIMUON = cms.vstring([ 'HLT_Mu15:HLT_Mu9', - #'HLT_DoubleMu3:HLT_Mu9', - #'HLT_Mu9:HLT_DoubleMu3', - #'HLT_Mu15:HLT_DoubleMu3']) - #) - ), - - ## ------------------------------------------------------ - ## PRESELECTION - ## - ## setup of the event preselection, which will not - ## be monitored - ## [mandatory] : but may be empty - ## - preselection = cms.PSet( - ## [optional] : when omitted no preselection is applied - trigger = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - select = cms.vstring(['HLT_Mu9','HLT_Ele15_SW_L1R','HLT_DoubleMu3']) - ), - ## [optional] : when omitted no preselection is applied - vertex = cms.PSet( - src = cms.InputTag("offlinePrimaryVertices"), - select = cms.string('abs(x)<1. && abs(y)<1. && abs(z)<20. && tracksSize>3 && !isFake') - ) - ), - - ## ------------------------------------------------------ - ## SELECTION - ## - ## monitor histrograms are filled after each selection - ## step, the selection is applied in the order defined - ## by this vector - ## [mandatory] : may be empty or contain an arbitrary - ## number of PSets as given below: - ## - selection = cms.VPSet( - #cms.PSet( - ### [mandatory] : 'jets' defines the objects to - ### select on, 'step0' labels the histograms; - ### instead of 'step0' you can choose any label - #label = cms.string("empty:step0") - #), - cms.PSet( - label = cms.string("Hlt:step0"), - src = cms.InputTag(""), - select = cms.string(""), - min = cms.int32(0), - max = cms.int32(0), - ), - - cms.PSet( - label = cms.string("muons:step1"), - src = cms.InputTag("muons"), - select = cms.string("pt>20 & abs(eta)<2.4 & isGlobalMuon & innerTrack.numberOfValidHits>10 & globalTrack.normalizedChi2>-1 & globalTrack.normalizedChi2<10"), - min = cms.int32(2), - max = cms.int32(2), - ), - cms.PSet( - label = cms.string("jets/calo:step2"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>30. & abs(eta)<2.4 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(2), - #max = cms.int32(2), - ) - ) -) - - - -DiMuonDQM = cms.EDAnalyzer("TopHLTDiLeptonOfflineDQM", - ## ------------------------------------------------------ - ## SETUP - ## - ## configuration of the MonitoringEnsemble(s) - ## [mandatory] : optional PSets may be omitted - ## - setup = cms.PSet( - ## sub-directory to write the monitor histograms to - ## [mandatory] : should not be changed w/o explicit - ## communication to TopCom! - directory = cms.string("Physics/Top/TopDiMuonDQM/"), - - ## [mandatory] - sources = cms.PSet( - muons = cms.InputTag("muons"), - elecs = cms.InputTag("gedGsfElectrons"), - jets = cms.InputTag("ak5CaloJets"), - mets = cms.VInputTag("met", "tcMet", "pfMet") - ), - ## [optional] : when omitted the verbosity level is set to STANDARD - monitoring = cms.PSet( - verbosity = cms.string("DEBUG") - ), - ## [optional] : when omitted all monitoring plots for electrons - ## will be filled w/o extras - elecExtras = cms.PSet( - ## when omitted electron plots will be filled w/o cut on electronId - electronId = cms.PSet( - src = cms.InputTag("simpleEleId70cIso"), - #src = cms.InputTag("eidRobustLoose"), - pattern = cms.int32(1) - ), - ## when omitted electron plots will be filled w/o additional pre- - ## selection of the electron candidates - select = cms.string("pt>500. && abs(eta)<2.4 && abs(gsfTrack.d0)<1. && abs(gsfTrack.dz)<20."), - ## when omitted isolated electron multiplicity plot will be equi- - ## valent to inclusive electron multiplicity plot - isolation = cms.string("(dr03TkSumPt+dr03EcalRecHitSumEt+dr03HcalTowerSumEt)/pt<0.2"), - ), - ## [optional] : when omitted all monitoring plots for muons - ## will be filled w/o extras - muonExtras = cms.PSet( - ## when omitted muon plots will be filled w/o additional pre- - ## selection of the muon candidates - select = cms.string("pt>20. && abs(eta)<2.4 && abs(globalTrack.d0)<1. && abs(globalTrack.dz)<20."), - ## when omitted isolated muon multiplicity plot will be equi- - ## valent to inclusive muon multiplicity plot - isolation = cms.string("(isolationR03.sumPt+isolationR03.emEt+isolationR03.hadEt)/pt<0.2"), - ), - ## [optional] : when omitted all monitoring plots for jets will - ## be filled from uncorrected jets - jetExtras = cms.PSet( - ## when omitted monitor plots for pt will be filled from uncorrected - ## jets - jetCorrector = cms.string("ak5CaloL2L3"), - ## when omitted monitor plots will be filled w/o additional cut on - ## jetID - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - ## when omitted no extra selection will be applied on jets before - ## filling the monitor histograms; if jetCorrector is present the - ## selection will be applied to corrected jets - select = cms.string("pt>30. & abs(eta)<2.4 & emEnergyFraction>0.01"), - ), - ## [optional] : when omitted no mass window will be applied - ## for the same flavor lepton monitoring plots - massExtras = cms.PSet( - lowerEdge = cms.double( 76.0), - upperEdge = cms.double(106.0) - ), - ## [optional] : when omitted all monitoring plots for triggering - ## will be empty - #triggerExtras = cms.PSet( - #src = cms.InputTag("TriggerResults","","HLT"), - #pathsELECMU = cms.vstring([ 'HLT_Mu9:HLT_Ele15_SW_L1R', - #'HLT_Mu15:HLT_Ele15_SW_L1R', - #'HLT_DoubleMu3:HLT_Ele15_SW_L1R', - #'HLT_Ele15_SW_L1R:HLT_Mu9', - #'HLT_Ele15_SW_L1R:HLT_DoubleMu3']), - #pathsDIMUON = cms.vstring([ 'HLT_Mu15:HLT_Mu9', - #'HLT_DoubleMu3:HLT_Mu9', - #'HLT_Mu9:HLT_DoubleMu3', - #'HLT_Mu15:HLT_DoubleMu3']) - #) - ), - - ## ------------------------------------------------------ - ## PRESELECTION - ## - ## setup of the event preselection, which will not - ## be monitored - ## [mandatory] : but may be empty - ## - preselection = cms.PSet( - ## [optional] : when omitted no preselection is applied - trigger = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - select = cms.vstring(['HLT_Mu9','HLT_Ele15_SW_L1R','HLT_DoubleMu3']) - ), - ## [optional] : when omitted no preselection is applied - vertex = cms.PSet( - src = cms.InputTag("offlinePrimaryVertices"), - select = cms.string('abs(x)<1. && abs(y)<1. && abs(z)<20. && tracksSize>3 && !isFake') - ) - ), - - ## ------------------------------------------------------ - ## SELECTION - ## - ## monitor histrograms are filled after each selection - ## step, the selection is applied in the order defined - ## by this vector - ## [mandatory] : may be empty or contain an arbitrary - ## number of PSets as given below: - ## - selection = cms.VPSet( - #cms.PSet( - ### [mandatory] : 'jets' defines the objects to - ### select on, 'step0' labels the histograms; - ### instead of 'step0' you can choose any label - #label = cms.string("empty:step0") - #), - cms.PSet( - label = cms.string("Hlt:step0"), - src = cms.InputTag(""), - select = cms.string(""), - min = cms.int32(0), - max = cms.int32(0), - ), - - cms.PSet( - label = cms.string("muons:step1"), - src = cms.InputTag("muons"), - select = cms.string("pt>20 & abs(eta)<2.4 & isGlobalMuon & innerTrack.numberOfValidHits>10 & globalTrack.normalizedChi2>-1 & globalTrack.normalizedChi2<10"), - min = cms.int32(2), - max = cms.int32(2), - ), - cms.PSet( - label = cms.string("jets/calo:step2"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>30. & abs(eta)<2.4 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(2), - #max = cms.int32(2), - ), - ), -) - -DiElectronDQM = cms.EDAnalyzer("TopHLTDiLeptonOfflineDQM", - ## ------------------------------------------------------ - ## SETUP - ## - ## configuration of the MonitoringEnsemble(s) - ## [mandatory] : optional PSets may be omitted - ## - setup = cms.PSet( - ## sub-directory to write the monitor histograms to - ## [mandatory] : should not be changed w/o explicit - ## communication to TopCom! - directory = cms.string("Physics/Top/TopDiElectronDQM/"), - - ## [mandatory] - sources = cms.PSet( - muons = cms.InputTag("muons"), - elecs = cms.InputTag("gedGsfElectrons"), - jets = cms.InputTag("ak5CaloJets"), - mets = cms.VInputTag("met", "tcMet", "pfMet") - ), - ## [optional] : when omitted the verbosity level is set to STANDARD - monitoring = cms.PSet( - verbosity = cms.string("DEBUG") - ), - ## [optional] : when omitted all monitoring plots for electrons - ## will be filled w/o extras - elecExtras = cms.PSet( - ## when omitted electron plots will be filled w/o cut on electronId - electronId = cms.PSet( - src = cms.InputTag("simpleEleId70cIso"), - #src = cms.InputTag("eidRobustLoose"), - pattern = cms.int32(1) - ), - ## when omitted electron plots will be filled w/o additional pre- - ## selection of the electron candidates - select = cms.string("pt>10. && abs(eta)<2.4 && abs(gsfTrack.d0)<1. && abs(gsfTrack.dz)<20."), - ## when omitted isolated electron multiplicity plot will be equi- - ## valent to inclusive electron multiplicity plot - isolation = cms.string("(dr03TkSumPt+dr03EcalRecHitSumEt+dr03HcalTowerSumEt)/pt<0.2"), - ), - ## [optional] : when omitted all monitoring plots for muons - ## will be filled w/o extras - muonExtras = cms.PSet( - ## when omitted muon plots will be filled w/o additional pre- - ## selection of the muon candidates - select = cms.string("pt>500. && abs(eta)<2.4 && abs(globalTrack.d0)<1. && abs(globalTrack.dz)<20."), - ## when omitted isolated muon multiplicity plot will be equi- - ## valent to inclusive muon multiplicity plot - isolation = cms.string("(isolationR03.sumPt+isolationR03.emEt+isolationR03.hadEt)/pt<0.2"), - ), - ## [optional] : when omitted all monitoring plots for jets will - ## be filled from uncorrected jets - jetExtras = cms.PSet( - ## when omitted monitor plots for pt will be filled from uncorrected - ## jets - jetCorrector = cms.string("ak5CaloL2L3"), - ## when omitted monitor plots will be filled w/o additional cut on - ## jetID - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - ## when omitted no extra selection will be applied on jets before - ## filling the monitor histograms; if jetCorrector is present the - ## selection will be applied to corrected jets - select = cms.string("pt>30. & abs(eta)<2.4 & emEnergyFraction>0.01"), - ), - ## [optional] : when omitted no mass window will be applied - ## for the same flavor lepton monitoring plots - massExtras = cms.PSet( - lowerEdge = cms.double( 76.0), - upperEdge = cms.double(106.0) - ), - ## [optional] : when omitted all monitoring plots for triggering - ## will be empty - #triggerExtras = cms.PSet( - #src = cms.InputTag("TriggerResults","","HLT"), - #pathsELECMU = cms.vstring([ 'HLT_Mu9:HLT_Ele15_SW_L1R', - #'HLT_Mu15:HLT_Ele15_SW_L1R', - #'HLT_DoubleMu3:HLT_Ele15_SW_L1R', - #'HLT_Ele15_SW_L1R:HLT_Mu9', - #'HLT_Ele15_SW_L1R:HLT_DoubleMu3']), - #pathsDIMUON = cms.vstring([ 'HLT_Mu15:HLT_Mu9', - #'HLT_DoubleMu3:HLT_Mu9', - #'HLT_Mu9:HLT_DoubleMu3', - #'HLT_Mu15:HLT_DoubleMu3']) - #) - ), - - ## ------------------------------------------------------ - ## PRESELECTION - ## - ## setup of the event preselection, which will not - ## be monitored - ## [mandatory] : but may be empty - ## - preselection = cms.PSet( - ## [optional] : when omitted no preselection is applied - trigger = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - select = cms.vstring(['HLT_Mu9','HLT_Ele15_SW_L1R','HLT_DoubleMu3']) - ), - ## [optional] : when omitted no preselection is applied - vertex = cms.PSet( - src = cms.InputTag("offlinePrimaryVertices"), - select = cms.string('abs(x)<1. && abs(y)<1. && abs(z)<20. && tracksSize>3 && !isFake') - ) - ), - - ## ------------------------------------------------------ - ## SELECTION - ## - ## monitor histrograms are filled after each selection - ## step, the selection is applied in the order defined - ## by this vector - ## [mandatory] : may be empty or contain an arbitrary - ## number of PSets as given below: - ## - selection = cms.VPSet( - #cms.PSet( - ### [mandatory] : 'jets' defines the objects to - ### select on, 'step0' labels the histograms; - ### instead of 'step0' you can choose any label - #label = cms.string("empty:step0") - #), - cms.PSet( - label = cms.string("Hlt:step0"), - src = cms.InputTag(""), - select = cms.string(""), - min = cms.int32(0), - max = cms.int32(0), - ), - - cms.PSet( - label = cms.string("elecs:step1"), - src = cms.InputTag("gedGsfElectrons"), - electronId = cms.PSet( - src = cms.InputTag("simpleEleId70cIso"), - pattern = cms.int32(1) - ), - select = cms.string("pt>20 & abs(eta)<2.4 & (dr03TkSumPt+dr03EcalRecHitSumEt+dr03HcalTowerSumEt)/pt<0.17"), - min = cms.int32(2), - max = cms.int32(2), - ), - cms.PSet( - label = cms.string("jets/calo:step2"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>30. & abs(eta)<2.4 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(2), - #max = cms.int32(2), - ), - ), -) - -ElecMuonDQM = cms.EDAnalyzer("TopHLTDiLeptonOfflineDQM", - ## ------------------------------------------------------ - ## SETUP - ## - ## configuration of the MonitoringEnsemble(s) - ## [mandatory] : optional PSets may be omitted - ## - setup = cms.PSet( - ## sub-directory to write the monitor histograms to - ## [mandatory] : should not be changed w/o explicit - ## communication to TopCom! - directory = cms.string("Physics/Top/TopElecMuonDQM/"), - - ## [mandatory] - sources = cms.PSet( - muons = cms.InputTag("muons"), - elecs = cms.InputTag("gedGsfElectrons"), - jets = cms.InputTag("ak5CaloJets"), - mets = cms.VInputTag("met", "tcMet", "pfMet") - ), - ## [optional] : when omitted the verbosity level is set to STANDARD - monitoring = cms.PSet( - verbosity = cms.string("DEBUG") - ), - ## [optional] : when omitted all monitoring plots for electrons - ## will be filled w/o extras - elecExtras = cms.PSet( - ## when omitted electron plots will be filled w/o cut on electronId - electronId = cms.PSet( - src = cms.InputTag("simpleEleId70cIso"), - #src = cms.InputTag("eidRobustLoose"), - pattern = cms.int32(1) - ), - ## when omitted electron plots will be filled w/o additional pre- - ## selection of the electron candidates - select = cms.string("pt>10. && abs(eta)<2.4 && abs(gsfTrack.d0)<1. && abs(gsfTrack.dz)<20."), - ## when omitted isolated electron multiplicity plot will be equi- - ## valent to inclusive electron multiplicity plot - isolation = cms.string("(dr03TkSumPt+dr03EcalRecHitSumEt+dr03HcalTowerSumEt)/pt<0.2"), - ), - ## [optional] : when omitted all monitoring plots for muons - ## will be filled w/o extras - muonExtras = cms.PSet( - ## when omitted muon plots will be filled w/o additional pre- - ## selection of the muon candidates - select = cms.string("pt>10. && abs(eta)<2.4 && abs(globalTrack.d0)<1. && abs(globalTrack.dz)<20."), - ## when omitted isolated muon multiplicity plot will be equi- - ## valent to inclusive muon multiplicity plot - isolation = cms.string("(isolationR03.sumPt+isolationR03.emEt+isolationR03.hadEt)/pt<0.2"), - ), - ## [optional] : when omitted all monitoring plots for jets will - ## be filled from uncorrected jets - jetExtras = cms.PSet( - ## when omitted monitor plots for pt will be filled from uncorrected - ## jets - jetCorrector = cms.string("ak5CaloL2L3"), - ## when omitted monitor plots will be filled w/o additional cut on - ## jetID - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - ## when omitted no extra selection will be applied on jets before - ## filling the monitor histograms; if jetCorrector is present the - ## selection will be applied to corrected jets - select = cms.string("pt>30. & abs(eta)<2.4 & emEnergyFraction>0.01"), - ), - ## [optional] : when omitted no mass window will be applied - ## for the same flavor lepton monitoring plots - massExtras = cms.PSet( - lowerEdge = cms.double( 76.0), - upperEdge = cms.double(106.0) - ), - ## [optional] : when omitted all monitoring plots for triggering - ## will be empty - #triggerExtras = cms.PSet( - #src = cms.InputTag("TriggerResults","","HLT"), - #pathsELECMU = cms.vstring([ 'HLT_Mu9:HLT_Ele15_SW_L1R', - #'HLT_Mu15:HLT_Ele15_SW_L1R', - #'HLT_DoubleMu3:HLT_Ele15_SW_L1R', - #'HLT_Ele15_SW_L1R:HLT_Mu9', - #'HLT_Ele15_SW_L1R:HLT_DoubleMu3']), - #pathsDIMUON = cms.vstring([ 'HLT_Mu15:HLT_Mu9', - #'HLT_DoubleMu3:HLT_Mu9', - #'HLT_Mu9:HLT_DoubleMu3', - #'HLT_Mu15:HLT_DoubleMu3']) - #) - ), - - ## ------------------------------------------------------ - ## PRESELECTION - ## - ## setup of the event preselection, which will not - ## be monitored - ## [mandatory] : but may be empty - ## - preselection = cms.PSet( - ## [optional] : when omitted no preselection is applied - trigger = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - select = cms.vstring(['HLT_Mu9','HLT_Ele15_SW_L1R','HLT_DoubleMu3']) - ), - ## [optional] : when omitted no preselection is applied - vertex = cms.PSet( - src = cms.InputTag("offlinePrimaryVertices"), - select = cms.string('abs(x)<1. && abs(y)<1. && abs(z)<20. && tracksSize>3 && !isFake') - ) - ), - - ## ------------------------------------------------------ - ## SELECTION - ## - ## monitor histrograms are filled after each selection - ## step, the selection is applied in the order defined - ## by this vector - ## [mandatory] : may be empty or contain an arbitrary - ## number of PSets as given below: - ## - selection = cms.VPSet( - #cms.PSet( - ### [mandatory] : 'jets' defines the objects to - ### select on, 'step0' labels the histograms; - ### instead of 'step0' you can choose any label - #label = cms.string("empty:step0") - #), - cms.PSet( - label = cms.string("Hlt:step0"), - src = cms.InputTag(""), - select = cms.string(""), - min = cms.int32(0), - max = cms.int32(0), - ), - - cms.PSet( - label = cms.string("muons:step1"), - src = cms.InputTag("muons"), - select = cms.string("pt>20 & abs(eta)<2.4 & isGlobalMuon & innerTrack.numberOfValidHits>10 & globalTrack.normalizedChi2>-1 & globalTrack.normalizedChi2<10"), - min = cms.int32(1), - max = cms.int32(1), - ), - cms.PSet( - label = cms.string("elecs:step2"), - src = cms.InputTag("gedGsfElectrons"), - electronId = cms.PSet( - src = cms.InputTag("simpleEleId70cIso"), - pattern = cms.int32(1) - ), - select = cms.string("pt>20 & abs(eta)<2.4 & (dr03TkSumPt+dr03EcalRecHitSumEt+dr03HcalTowerSumEt)/pt<0.17"), - min = cms.int32(1), - max = cms.int32(1), - ), - cms.PSet( - label = cms.string("jets/calo:step3"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>30. & abs(eta)<2.4 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(2), - #max = cms.int32(2), - ), - ), -) - diff --git a/HLTriggerOffline/Top/python/topHLTDQM_cff.py b/HLTriggerOffline/Top/python/topHLTDQM_cff.py deleted file mode 100644 index 6a6a02b7032d6..0000000000000 --- a/HLTriggerOffline/Top/python/topHLTDQM_cff.py +++ /dev/null @@ -1,20 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -from HLTriggerOffline.Top.topDiLeptonHLTEventDQM_cfi import * -from HLTriggerOffline.Top.topSingleLeptonHLTEventDQM_cfi import * -from HLTriggerOffline.Top.singletopHLTEventDQM_cfi import * -from HLTriggerOffline.Top.topvalidation_cfi import * -from JetMETCorrections.Configuration.JetCorrectionProducersAllAlgos_cff import * - - - -topHLTDQM = cms.Sequence( - DiMuonDQM - *DiElectronDQM - *ElecMuonDQM - *topSingleMuonMediumTriggerDQM - *topSingleElectronMediumTriggerDQM - *SingleTopSingleMuonTriggerDQM - *SingleTopSingleElectronTriggerDQM - ) - diff --git a/HLTriggerOffline/Top/python/topHLTValidation_cff.py b/HLTriggerOffline/Top/python/topHLTValidation_cff.py new file mode 100644 index 0000000000000..ac322628a1414 --- /dev/null +++ b/HLTriggerOffline/Top/python/topHLTValidation_cff.py @@ -0,0 +1,17 @@ +import FWCore.ParameterSet.Config as cms + +#from HLTriggerOffline.Top.topDiLeptonHLTEventValidation_cfi import * +from HLTriggerOffline.Top.topSingleLeptonHLTEventValidation_cfi import * +from HLTriggerOffline.Top.singletopHLTEventValidation_cfi import * + +topHLTriggerValidation = cms.Sequence( +# DiMuonHLTValidation +# *DiElectronHLTValidation +# *ElecMuonHLTValidation +# * + topSingleMuonHLTValidation + *topSingleElectronHLTValidation + *SingleTopSingleMuonHLTValidation + *SingleTopSingleElectronHLTValidation + ) + diff --git a/HLTriggerOffline/Top/python/topSingleLeptonHLTEventDQM_cfi.py b/HLTriggerOffline/Top/python/topSingleLeptonHLTEventDQM_cfi.py deleted file mode 100644 index 9d46ce90e9497..0000000000000 --- a/HLTriggerOffline/Top/python/topSingleLeptonHLTEventDQM_cfi.py +++ /dev/null @@ -1,843 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -topSingleLeptonTriggerDQM = cms.EDAnalyzer("TopHLTSingleLeptonDQM", - ## ------------------------------------------------------ - ## SETUP - ## - ## configuration of the MonitoringEnsemble(s) - ## [mandatory] : optional PSets may be omitted - ## - setup = cms.PSet( - ## sub-directory to write the monitor histograms to - ## [mandatory] : should not be changed w/o explicit - ## communication to TopCom! - directory = cms.string("HLTriggerOffline/Top/TopSingleLeptonTriggerDQM/"), - ## [mandatory] - sources = cms.PSet( - muons = cms.InputTag("muons"), - elecs = cms.InputTag("gedGsfElectrons"), - jets = cms.InputTag("ak5CaloJets"), - mets = cms.VInputTag("met", "tcMet", "pfMet"), - pvs = cms.InputTag("offlinePrimaryVertices") - ), - ## [optional] : when omitted the verbosity level is set to STANDARD - monitoring = cms.PSet( - verbosity = cms.string("DEBUG") - ), - ## [optional] : when omitted all monitoring plots for primary vertices - ## will be filled w/o extras - pvExtras = cms.PSet( - ## when omitted electron plots will be filled w/o additional pre- - ## selection of the primary vertex candidates - select = cms.string("abs(x)<1. & abs(y)<1. & abs(z)<20. & tracksSize>3 & !isFake") - ), - ## [optional] : when omitted all monitoring plots for electrons - ## will be filled w/o extras - elecExtras = cms.PSet( - ## when omitted electron plots will be filled w/o cut on electronId - electronId = cms.PSet( src = cms.InputTag("eidRobustLoose"), pattern = cms.int32(1) ), - ## when omitted electron plots will be filled w/o additional pre- - ## selection of the electron candidates - select = cms.string("pt>15 & abs(eta)<2.5 & abs(gsfTrack.d0)<1 & abs(gsfTrack.dz)<20"), - ## when omitted isolated electron multiplicity plot will be equi- - ## valent to inclusive electron multiplicity plot - isolation = cms.string("(dr03TkSumPt+dr04EcalRecHitSumEt+dr04HcalTowerSumEt)/pt<0.1"), - ), - ## [optional] : when omitted all monitoring plots for muons - ## will be filled w/o extras - muonExtras = cms.PSet( - ## when omitted muon plots will be filled w/o additional pre- - ## selection of the muon candidates - select = cms.string("pt>10 & abs(eta)<2.1 & isGlobalMuon & abs(globalTrack.d0)<1 & abs(globalTrack.dz)<20"), - ## when omitted isolated muon multiplicity plot will be equi- - ## valent to inclusive muon multiplicity plot - isolation = cms.string("(isolationR03.sumPt+isolationR03.emEt+isolationR03.hadEt)/pt<0.1"), - ), - ## [optional] : when omitted all monitoring plots for jets will - ## be filled from uncorrected jets - jetExtras = cms.PSet( - ## when omitted monitor plots for pt will be filled from uncorrected - ## jets - jetCorrector = cms.string("ak5CaloL2L3"), - ## when omitted monitor plots will be filled w/o additional cut on - ## jetID - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - ## when omitted no extra selection will be applied on jets before - ## filling the monitor histograms; if jetCorrector is present the - ## selection will be applied to corrected jets - select = cms.string("pt>15 & abs(eta)<2.5 & emEnergyFraction>0.01"), - ), - ## [optional] : when omitted no mass window will be applied - ## for the W mass befor filling the event monitoring plots - massExtras = cms.PSet( - lowerEdge = cms.double( 70.), - upperEdge = cms.double(110.) - ), - ## [optional] : when omitted the monitoring plots for triggering - ## will be empty - triggerExtras = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - paths = cms.vstring(['HLT_Mu3:HLT_QuadJet15U', - 'HLT_Mu5:HLT_QuadJet15U', - 'HLT_Mu7:HLT_QuadJet15U', - 'HLT_Mu9:HLT_QuadJet15U']) - ) - ), - ## ------------------------------------------------------ - ## PRESELECTION - ## - ## setup of the event preselection, which will not - ## be monitored - ## [mandatory] : but may be empty - ## - preselection = cms.PSet( - trigger = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - select = cms.vstring(['HLT_Iso10Mu20_eta2p1_CentralPFJet30_BTagIPIter_v1'])#ONLY ONE PATH - ), - ## [optional] : when omitted no preselection is applied - vertex = cms.PSet( - src = cms.InputTag("offlinePrimaryVertices"), - select = cms.string('abs(x)<1. & abs(y)<1. & abs(z)<20. & tracksSize>3 & !isFake') - ) - ), - ## ------------------------------------------------------ - ## SELECTION - ## - ## monitor histrograms are filled after each selection - ## step, the selection is applied in the order defined - ## by this vector - ## [mandatory] : may be empty or contain an arbitrary - ## number of PSets - ## - selection = cms.VPSet( - cms.PSet( - label = cms.string("Hlt:step0"), - src = cms.InputTag(""), - select = cms.string(""), - min = cms.int32(0), - max = cms.int32(0), - ), - cms.PSet( - label = cms.string("jets/calo:step1"), - src = cms.InputTag("ak5CaloJets"), - select = cms.string("pt>20 & abs(eta)<2.1 & 0.051 & restrictedEMF<1") - ), - min = cms.int32(2), - ), - ) -) - -topSingleMuonLooseTriggerDQM = cms.EDAnalyzer("TopHLTSingleLeptonDQM", - ## ------------------------------------------------------ - ## SETUP - ## - ## configuration of the MonitoringEnsemble(s) - ## [mandatory] : optional PSets may be omitted - ## - setup = cms.PSet( - ## sub-directory to write the monitor histograms to - ## [mandatory] : should not be changed w/o explicit - ## communication to TopCom! - directory = cms.string("HLTriggerOffline/Top/TopSingleMuonLooseTriggerDQM/"), - ## [mandatory] - sources = cms.PSet( - muons = cms.InputTag("muons"), - elecs = cms.InputTag("gedGsfElectrons"), - jets = cms.InputTag("ak5CaloJets"), - mets = cms.VInputTag("met", "tcMet", "pfMet"), - pvs = cms.InputTag("offlinePrimaryVertices") - ), - ## [optional] : when omitted the verbosity level is set to STANDARD - monitoring = cms.PSet( - verbosity = cms.string("DEBUG") - ), - pvExtras = cms.PSet( - ## when omitted electron plots will be filled w/o additional pre- - ## selection of the primary vertex candidates - select = cms.string("abs(x)<1. & abs(y)<1. & abs(z)<20. & tracksSize>3 & !isFake") - ), - ## [optional] : when omitted all monitoring plots for muons - ## will be filled w/o extras - muonExtras = cms.PSet( - ## when omitted muon plots will be filled w/o additional pre- - ## selection of the muon candidates - select = cms.string("pt > 10 & abs(eta)<2.1 & isGlobalMuon & innerTrack.numberOfValidHits>10 & globalTrack.normalizedChi2>-1 & globalTrack.normalizedChi2<10"), - ## when omitted isolated muon multiplicity plot will be equi- - ## valent to inclusive muon multiplicity plot - isolation = cms.string("(isolationR03.sumPt+isolationR03.emEt+isolationR03.hadEt)/pt<0.1") - ), - ## [optional] : when omitted all monitoring plots for jets - ## will be filled w/o extras - jetExtras = cms.PSet( - ## when omitted monitor plots for pt will be filled from uncorrected - ## jets - jetCorrector = cms.string("ak5CaloL2L3"), - ## when omitted monitor plots will be filled w/o additional cut on - ## jetID - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - ## when omitted no extra selection will be applied on jets before - ## filling the monitor histograms; if jetCorrector is present the - ## selection will be applied to corrected jets - select = cms.string("pt>15 & abs(eta)<2.5 & emEnergyFraction>0.01"), - ## when omitted monitor histograms for b-tagging will not be filled - jetBTaggers = cms.PSet( - trackCountingEff = cms.PSet( - label = cms.InputTag("trackCountingHighEffBJetTags" ), - workingPoint = cms.double(1.25) - ), - trackCountingPur = cms.PSet( - label = cms.InputTag("trackCountingHighPurBJetTags" ), - workingPoint = cms.double(3.00) - ), - secondaryVertex = cms.PSet( - label = cms.InputTag("simpleSecondaryVertexHighEffBJetTags"), - workingPoint = cms.double(2.05) - ) - ), - ), - ## [optional] : when omitted no mass window will be applied - ## for the W mass befor filling the event monitoring plots - massExtras = cms.PSet( - lowerEdge = cms.double( 70.), - upperEdge = cms.double(110.) - ), - ## [optional] : when omitted the monitoring plots for triggering - ## will be empty - triggerExtras = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - paths = cms.vstring(['HLT_Mu3:HLT_QuadJet15U', - 'HLT_Mu5:HLT_QuadJet15U', - 'HLT_Mu7:HLT_QuadJet15U', - 'HLT_Mu9:HLT_QuadJet15U', - 'HLT_Mu11:HLT_QuadJet15U']) - ) - ), - ## ------------------------------------------------------ - ## PRESELECTION - ## - ## setup of the event preselection, which will not - ## be monitored - ## [mandatory] : but may be empty - ## - preselection = cms.PSet( - trigger = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - select = cms.vstring(['HLT_Iso10Mu20_eta2p1_CentralPFJet30_BTagIPIter_v1'])#ONLY ONE PATH - ), - ## [optional] : when omitted no preselection is applied - vertex = cms.PSet( - src = cms.InputTag("offlinePrimaryVertices"), - select = cms.string('abs(x)<1. & abs(y)<1. & abs(z)<20. & tracksSize>3 & !isFake') - ) - ), - ## ------------------------------------------------------ - ## SELECTION - ## - ## monitor histrograms are filled after each selection - ## step, the selection is applied in the order defined - ## by this vector - ## [mandatory] : may be empty or contain an arbitrary - ## number of PSets - selection = cms.VPSet( - cms.PSet( - label = cms.string("Hlt:step0"), - src = cms.InputTag(""), - select = cms.string(""), - min = cms.int32(0), - max = cms.int32(0), - ), - cms.PSet( - label = cms.string("muons:step1"), - src = cms.InputTag("muons"), - select = cms.string("pt>10 & abs(eta)<2.1 & isGlobalMuon & innerTrack.numberOfValidHits>10 & globalTrack.normalizedChi2>-1 & globalTrack.normalizedChi2<10"), - min = cms.int32(1), - ), - cms.PSet( - label = cms.string("jets/calo:step2"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>15 & abs(eta)<2.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(1), - ), - cms.PSet( - label = cms.string("jets/calo:step3"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>15 & abs(eta)<2.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(2), - ), - cms.PSet( - label = cms.string("jets/calo:step4"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>15 & abs(eta)<2.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(3), - ), - cms.PSet( - label = cms.string("jets/calo:step5"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>15 & abs(eta)<2.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(4), - ), - ) -) -topSingleMuonMediumTriggerDQM = cms.EDAnalyzer("TopHLTSingleLeptonDQM", - ## ------------------------------------------------------ - ## SETUP - ## - ## configuration of the MonitoringEnsemble(s) - ## [mandatory] : optional PSets may be omitted - ## - setup = cms.PSet( - ## sub-directory to write the monitor histograms to - ## [mandatory] : should not be changed w/o explicit - ## communication to TopCom! - directory = cms.string("HLTriggerOffline/Top/TopSingleMuonMediumTriggerDQM/"), - ## [mandatory] - sources = cms.PSet( - muons = cms.InputTag("muons"), - elecs = cms.InputTag("gedGsfElectrons"), - jets = cms.InputTag("ak5CaloJets"), - mets = cms.VInputTag("met", "tcMet", "pfMet"), - pvs = cms.InputTag("offlinePrimaryVertices") - - ), - ## [optional] : when omitted the verbosity level is set to STANDARD - monitoring = cms.PSet( - verbosity = cms.string("DEBUG") - ), - ## [optional] : when omitted all monitoring plots for primary vertices - ## will be filled w/o extras - pvExtras = cms.PSet( - ## when omitted electron plots will be filled w/o additional pre- - ## selection of the primary vertex candidates - select = cms.string("abs(x)<1. & abs(y)<1. & abs(z)<20. & tracksSize>3 & !isFake") - ), - ## [optional] : when omitted all monitoring plots for muons - ## will be filled w/o extras - muonExtras = cms.PSet( - ## when omitted muon plots will be filled w/o additional pre- - ## selection of the muon candidates - select = cms.string("pt>20 & abs(eta)<2.1 & isGlobalMuon & innerTrack.numberOfValidHits>10 & globalTrack.normalizedChi2>-1 & globalTrack.normalizedChi2<10 & (isolationR03.sumPt+isolationR03.emEt+isolationR03.hadEt)/pt<0.1"), - ## when omitted isolated muon multiplicity plot will be equi- - ## valent to inclusive muon multiplicity plot - isolation = cms.string("(isolationR03.sumPt+isolationR03.emEt+isolationR03.hadEt)/pt<0.1") - ), - ## [optional] : when omitted all monitoring plots for jets - ## will be filled w/o extras - jetExtras = cms.PSet( - ## when omitted monitor plots for pt will be filled from uncorrected - ## jets - jetCorrector = cms.string("ak5CaloL2L3"), - ## when omitted monitor plots will be filled w/o additional cut on - ## jetID - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - ## when omitted no extra selection will be applied on jets before - ## filling the monitor histograms; if jetCorrector is present the - ## selection will be applied to corrected jets - select = cms.string("pt>30 & abs(eta)<2.5& emEnergyFraction>0.01"), - ## when omitted monitor histograms for b-tagging will not be filled - jetBTaggers = cms.PSet( - trackCountingEff = cms.PSet( - label = cms.InputTag("trackCountingHighEffBJetTags" ), - workingPoint = cms.double(1.25) - ), - trackCountingPur = cms.PSet( - label = cms.InputTag("trackCountingHighPurBJetTags" ), - workingPoint = cms.double(3.00) - ), - secondaryVertex = cms.PSet( - label = cms.InputTag("simpleSecondaryVertexHighEffBJetTags"), - workingPoint = cms.double(2.05) - ) - ), - ), - ## [optional] : when omitted no mass window will be applied - ## for the W mass before filling the event monitoring plots - massExtras = cms.PSet( - lowerEdge = cms.double( 70.), - upperEdge = cms.double(110.) - ), - ## [optional] : when omitted the monitoring plots for triggering - ## will be empty - triggerExtras = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - paths = cms.vstring(['HLT_Mu3:HLT_QuadJet15U', - 'HLT_Mu5:HLT_QuadJet15U', - 'HLT_Mu7:HLT_QuadJet15U', - 'HLT_Mu9:HLT_QuadJet15U', - 'HLT_Mu11:HLT_QuadJet15U']) - ) - ), - ## ------------------------------------------------------ - ## PRESELECTION - ## - ## setup of the event preselection, which will not - ## be monitored - ## [mandatory] : but may be empty - ## - preselection = cms.PSet( - trigger = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - select = cms.vstring(['HLT_Iso10Mu20_eta2p1_CentralPFJet30_BTagIPIter_v1'])#ONLY ONE PATH - ), - ## [optional] : when omitted no preselection is applied - vertex = cms.PSet( - src = cms.InputTag("offlinePrimaryVertices"), - select = cms.string('abs(x)<1. & abs(y)<1. & abs(z)<20. & tracksSize>3 & !isFake') - ) - ), - ## ------------------------------------------------------ - ## SELECTION - ## - ## monitor histrograms are filled after each selection - ## step, the selection is applied in the order defined - ## by this vector - ## [mandatory] : may be empty or contain an arbitrary - ## number of PSets - selection = cms.VPSet( - cms.PSet( - label = cms.string("Hlt:step0"), - src = cms.InputTag(""), - select = cms.string(""), - min = cms.int32(0), - max = cms.int32(0), - ), - cms.PSet( - label = cms.string("muons:step1"), - src = cms.InputTag("muons"), - select = cms.string("pt>20 & abs(eta)<2.1 & isGlobalMuon & innerTrack.numberOfValidHits>10 & globalTrack.normalizedChi2>-1 & globalTrack.normalizedChi2<10 & (isolationR03.sumPt+isolationR03.emEt+isolationR03.hadEt)/pt<0.1"), - min = cms.int32(1), - max = cms.int32(1), - ), - cms.PSet( - label = cms.string("jets/calo:step2"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>30 & abs(eta)<2.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(1), - ), - cms.PSet( - label = cms.string("jets/calo:step3"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>30 & abs(eta)<2.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(2), - ), - cms.PSet( - label = cms.string("jets/calo:step4"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>30 & abs(eta)<2.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(3), - ), - cms.PSet( - label = cms.string("jets/calo:step5"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>30 & abs(eta)<2.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(4), - ), - ) -) - -topSingleElectronLooseTriggerDQM = cms.EDAnalyzer("TopHLTSingleLeptonDQM", - ## ------------------------------------------------------ - ## SETUP - ## - ## configuration of the MonitoringEnsemble(s) - ## [mandatory] : optional PSets may be omitted - ## - setup = cms.PSet( - ## sub-directory to write the monitor histograms to - ## [mandatory] : should not be changed w/o explicit - ## communication to TopCom! - directory = cms.string("HLTriggerOffline/Top/TopSingleElectronLooseTriggerDQM/"), - ## [mandatory] - sources = cms.PSet( - muons = cms.InputTag("muons"), - elecs = cms.InputTag("gedGsfElectrons"), - jets = cms.InputTag("ak5CaloJets"), - mets = cms.VInputTag("met", "tcMet", "pfMet"), - pvs = cms.InputTag("offlinePrimaryVertices") - - ), - ## [optional] : when omitted the verbosity level is set to STANDARD - monitoring = cms.PSet( - verbosity = cms.string("DEBUG") - ), - ## [optional] : when omitted all monitoring plots for primary vertices - ## will be filled w/o extras - pvExtras = cms.PSet( - ## when omitted electron plots will be filled w/o additional pre- - ## selection of the primary vertex candidates - select = cms.string("abs(x)<1. & abs(y)<1. & abs(z)<20. & tracksSize>3 & !isFake") - ), - ## [optional] : when omitted all monitoring plots for electrons - ## will be filled w/o extras - elecExtras = cms.PSet( - ## when omitted electron plots will be filled w/o cut on electronId - electronId = cms.PSet( src = cms.InputTag("simpleEleId70cIso"), pattern = cms.int32(1) ), - ## when omitted electron plots will be filled w/o additional pre- - ## selection of the electron candidates - select = cms.string("pt>30 & abs(eta)<2.5"), - ## when omitted isolated electron multiplicity plot will be equi- - ## valent to inclusive electron multiplicity plot - isolation = cms.string("(dr03TkSumPt+dr03EcalRecHitSumEt+dr03HcalTowerSumEt)/pt<0.1"), - ), - ## [optional] : when omitted all monitoring plots for jets - ## will be filled w/o extras - jetExtras = cms.PSet( - ## when omitted monitor plots for pt will be filled from uncorrected - ## jets - jetCorrector = cms.string("ak5CaloL2L3"), - ## when omitted monitor plots will be filled w/o additional cut on - ## jetID - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - ## when omitted no extra selection will be applied on jets before - ## filling the monitor histograms; if jetCorrector is present the - ## selection will be applied to corrected jets - select = cms.string("pt>15 & abs(eta)<2.5 & emEnergyFraction>0.01"), - ## when omitted monitor histograms for b-tagging will not be filled - jetBTaggers = cms.PSet( - trackCountingEff = cms.PSet( - label = cms.InputTag("trackCountingHighEffBJetTags" ), - workingPoint = cms.double(1.25) - ), - trackCountingPur = cms.PSet( - label = cms.InputTag("trackCountingHighPurBJetTags" ), - workingPoint = cms.double(3.00) - ), - secondaryVertex = cms.PSet( - label = cms.InputTag("simpleSecondaryVertexHighEffBJetTags"), - workingPoint = cms.double(2.05) - ) - ), - ), - ## [optional] : when omitted no mass window will be applied - ## for the W mass before filling the event monitoring plots - massExtras = cms.PSet( - lowerEdge = cms.double( 70.), - upperEdge = cms.double(110.) - ), - ## [optional] : when omitted the monitoring plots for triggering - ## will be empty - triggerExtras = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - paths = cms.vstring(['HLT_Ele15_LW_L1R:HLT_QuadJetU15']) - ) - ), - ## ------------------------------------------------------ - ## PRESELECTION - ## - ## setup of the event preselection, which will not - ## be monitored - ## [mandatory] : but may be empty - ## - preselection = cms.PSet( - trigger = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - select = cms.vstring(['HLT_Iso10Mu20_eta2p1_CentralPFJet30_BTagIPIter_v1'])#ONLY ONE PATH - ), - ## [optional] : when omitted no preselection is applied - vertex = cms.PSet( - src = cms.InputTag("offlinePrimaryVertices"), - select = cms.string('abs(x)<1. & abs(y)<1. & abs(z)<20. & tracksSize>3 & !isFake') - ) - ), - ## ------------------------------------------------------ - ## SELECTION - ## - ## monitor histrograms are filled after each selection - ## step, the selection is applied in the order defined - ## by this vector - ## [mandatory] : may be empty or contain an arbitrary - ## number of PSets - selection = cms.VPSet( - cms.PSet( - label = cms.string("Hlt:step0"), - src = cms.InputTag(""), - select = cms.string(""), - min = cms.int32(0), - max = cms.int32(0), - ), - cms.PSet( - label = cms.string("elecs:step1"), - src = cms.InputTag("gedGsfElectrons"), - electronId = cms.PSet( src = cms.InputTag("simpleEleId70cIso"), pattern = cms.int32(1) ), - select = cms.string("pt>15 & abs(eta)<2.5"), - min = cms.int32(1), - ), - cms.PSet( - label = cms.string("jets/calo:step2"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>15 & abs(eta)<2.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(1), - ), - cms.PSet( - label = cms.string("jets/calo:step3"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>15 & abs(eta)<2.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(2), - ), - cms.PSet( - label = cms.string("jets/calo:step4"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>15 & abs(eta)<2.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(3), - ), - cms.PSet( - label = cms.string("jets/calo:step5"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>15 & abs(eta)<2.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(4), - ), - ) -) - -topSingleElectronMediumTriggerDQM = cms.EDAnalyzer("TopHLTSingleLeptonDQM", - ## ------------------------------------------------------ - ## SETUP - ## - ## configuration of the MonitoringEnsemble(s) - ## [mandatory] : optional PSets may be omitted - ## - setup = cms.PSet( - ## sub-directory to write the monitor histograms to - ## [mandatory] : should not be changed w/o explicit - ## communication to TopCom! - directory = cms.string("HLTriggerOffline/Top/TopSingleElectronMediumTriggerDQM/"), - ## [mandatory] - sources = cms.PSet( - muons = cms.InputTag("muons"), - elecs = cms.InputTag("gedGsfElectrons"), - jets = cms.InputTag("ak5CaloJets"), - mets = cms.VInputTag("met", "tcMet", "pfMet"), - pvs = cms.InputTag("offlinePrimaryVertices") - - ), - ## [optional] : when omitted the verbosity level is set to STANDARD - monitoring = cms.PSet( - verbosity = cms.string("DEBUG") - ), - ## [optional] : when omitted all monitoring plots for primary vertices - ## will be filled w/o extras - pvExtras = cms.PSet( - ## when omitted electron plots will be filled w/o additional pre- - ## selection of the primary vertex candidates - select = cms.string("abs(x)<1. & abs(y)<1. & abs(z)<20. & tracksSize>3 & !isFake") - ), - ## [optional] : when omitted all monitoring plots for electrons - ## will be filled w/o extras - elecExtras = cms.PSet( - ## when omitted electron plots will be filled w/o cut on electronId - electronId = cms.PSet( src = cms.InputTag("simpleEleId70cIso"), pattern = cms.int32(1) ), - ## when omitted electron plots will be filled w/o additional pre- - ## selection of the electron candidates - select = cms.string("pt>25 & abs(eta)<2.5 & (dr03TkSumPt+dr03EcalRecHitSumEt+dr03HcalTowerSumEt)/pt<0.1"), - ## when omitted isolated electron multiplicity plot will be equi- - ## valent to inclusive electron multiplicity plot - isolation = cms.string("(dr03TkSumPt+dr03EcalRecHitSumEt+dr03HcalTowerSumEt)/pt<0.1"), - ), - ## [optional] : when omitted all monitoring plots for jets - ## will be filled w/o extras - jetExtras = cms.PSet( - ## when omitted monitor plots for pt will be filled from uncorrected - ## jets - jetCorrector = cms.string("ak5CaloL2L3"), - ## when omitted monitor plots will be filled w/o additional cut on - ## jetID - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - ## when omitted no extra selection will be applied on jets before - ## filling the monitor histograms; if jetCorrector is present the - ## selection will be applied to corrected jets - select = cms.string("pt>15 & abs(eta)<2.5 & emEnergyFraction>0.01"), - ## when omitted monitor histograms for b-tagging will not be filled - jetBTaggers = cms.PSet( - trackCountingEff = cms.PSet( - label = cms.InputTag("trackCountingHighEffBJetTags" ), - workingPoint = cms.double(1.25) - ), - trackCountingPur = cms.PSet( - label = cms.InputTag("trackCountingHighPurBJetTags" ), - workingPoint = cms.double(3.00) - ), - secondaryVertex = cms.PSet( - label = cms.InputTag("simpleSecondaryVertexHighEffBJetTags"), - workingPoint = cms.double(2.05) - ) - ), - ), - ## [optional] : when omitted no mass window will be applied - ## for the W mass before filling the event monitoring plots - massExtras = cms.PSet( - lowerEdge = cms.double( 70.), - upperEdge = cms.double(110.) - ), - ## [optional] : when omitted the monitoring plots for triggering - ## will be empty - triggerExtras = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - paths = cms.vstring([ 'HLT_Ele15_LW_L1R:HLT_QuadJetU15']) - ) - ), - ## ------------------------------------------------------ - ## PRESELECTION - ## - ## setup of the event preselection, which will not - ## be monitored - ## [mandatory] : but may be empty - ## - preselection = cms.PSet( - trigger = cms.PSet( - src = cms.InputTag("TriggerResults","","HLT"), - select = cms.vstring(['HLT_Iso10Mu20_eta2p1_CentralPFJet30_BTagIPIter_v1'])#ONLY ONE PATH - ), - ## [optional] : when omitted no preselection is applied - vertex = cms.PSet( - src = cms.InputTag("offlinePrimaryVertices"), - select = cms.string('abs(x)<1. & abs(y)<1. & abs(z)<20. & tracksSize>3 & !isFake') - ) - ), - ## ------------------------------------------------------ - ## SELECTION - ## - ## monitor histrograms are filled after each selection - ## step, the selection is applied in the order defined - ## by this vector - ## [mandatory] : may be empty or contain an arbitrary - ## number of PSets - selection = cms.VPSet( - cms.PSet( - label = cms.string("Hlt:step0"), - src = cms.InputTag(""), - select = cms.string(""), - min = cms.int32(0), - max = cms.int32(0), - ), - cms.PSet( - label = cms.string("elecs:step1"), - src = cms.InputTag("gedGsfElectrons"), - electronId = cms.PSet( src = cms.InputTag("simpleEleId70cIso"), pattern = cms.int32(1) ), - select = cms.string("pt>25 & abs(eta)<2.5 & (dr03TkSumPt+dr03EcalRecHitSumEt+dr03HcalTowerSumEt)/pt<0.1"), - min = cms.int32(1), - max = cms.int32(1), - ), - cms.PSet( - label = cms.string("jets/calo:step2"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>15 & abs(eta)<2.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(1), - ), - cms.PSet( - label = cms.string("jets/calo:step3"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>15 & abs(eta)<2.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(2), - ), - cms.PSet( - label = cms.string("jets/calo:step4"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>15 & abs(eta)<2.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(3), - ), - cms.PSet( - label = cms.string("jets/calo:step5"), - src = cms.InputTag("ak5CaloJets"), - jetCorrector = cms.string("ak5CaloL2L3"), - select = cms.string("pt>15 & abs(eta)<2.5 & emEnergyFraction>0.01"), - jetID = cms.PSet( - label = cms.InputTag("ak5JetID"), - select = cms.string("fHPD < 0.98 & n90Hits>1 & restrictedEMF<1") - ), - min = cms.int32(4), - ), - ) -) diff --git a/HLTriggerOffline/Top/python/topSingleLeptonHLTEventValidation_cfi.py b/HLTriggerOffline/Top/python/topSingleLeptonHLTEventValidation_cfi.py new file mode 100644 index 0000000000000..069e65eb958f4 --- /dev/null +++ b/HLTriggerOffline/Top/python/topSingleLeptonHLTEventValidation_cfi.py @@ -0,0 +1,53 @@ +import FWCore.ParameterSet.Config as cms + +# ttbar semi muonique +topSingleMuonHLTValidation = cms.EDAnalyzer('TopSingleLeptonHLTValidation', + # Directory + sDir = cms.untracked.string('HLTValidation/Top/SemiMuonic/'), + # Electrons + sElectrons = cms.untracked.string('gsfElectrons'), + ptElectrons = cms.untracked.double(30.), + etaElectrons = cms.untracked.double(2.5), + isoElectrons = cms.untracked.double(0.1), + minElectrons = cms.untracked.uint32(0), + # Muons + sMuons = cms.untracked.string('muons'), + ptMuons = cms.untracked.double(26.), + etaMuons = cms.untracked.double(2.1), + isoMuons = cms.untracked.double(0.12), + minMuons = cms.untracked.uint32(1), + # Jets + sJets = cms.untracked.string('ak5PFJets'), + ptJets = cms.untracked.double(20.), + etaJets = cms.untracked.double(2.5), + minJets = cms.untracked.uint32(4), + # Trigger + sTrigger = cms.untracked.string("TriggerResults"), + vsPaths = cms.untracked.vstring(['HLT_IsoMu17_eta2p1_TriCentralPFNoPUJet45_35_25','HLT_IsoMu17_eta2p1_TriCentralPFNoPUJet30']), +) + +# ttbar semi electronique +topSingleElectronHLTValidation = cms.EDAnalyzer('TopSingleLeptonHLTValidation', + # Directory + sDir = cms.untracked.string('HLTValidation/Top/SemiElectronic/'), + # Electrons + sElectrons = cms.untracked.string('gsfElectrons'), + ptElectrons = cms.untracked.double(30.), + etaElectrons = cms.untracked.double(2.5), + isoElectrons = cms.untracked.double(0.1), + minElectrons = cms.untracked.uint32(1), + # Muons + sMuons = cms.untracked.string('muons'), + ptMuons = cms.untracked.double(26.), + etaMuons = cms.untracked.double(2.1), + isoMuons = cms.untracked.double(0.12), + minMuons = cms.untracked.uint32(0), + # Jets + sJets = cms.untracked.string('ak5PFJets'), + ptJets = cms.untracked.double(20.), + etaJets = cms.untracked.double(2.5), + minJets = cms.untracked.uint32(4), + # Trigger + sTrigger = cms.untracked.string("TriggerResults"), + vsPaths = cms.untracked.vstring(['HLT_Ele25_CaloIdVT_CaloIsoVL_TrkIdVL_TrkIsoT_TriCentralPFNoPUJet45_35_25','HLT_Ele25_CaloIdVT_CaloIsoVL_TrkIdVL_TrkIsoT_TriCentralPFNoPUJet30']), +) diff --git a/HLTriggerOffline/Top/python/topvalidation_cfi.py b/HLTriggerOffline/Top/python/topvalidation_cfi.py deleted file mode 100644 index a3870fe5c1ad8..0000000000000 --- a/HLTriggerOffline/Top/python/topvalidation_cfi.py +++ /dev/null @@ -1,17 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -HLTTopVal = cms.EDAnalyzer("TopValidation", - OutputMEsInRootFile = cms.bool(False), - TriggerResultsCollection = cms.InputTag("TriggerResults","","HLT"), - hltPaths = cms.vstring('HLT_Mu9','HLT_Mu15','HLT_IsoMu9','HLT_DoubleMu3','HLT_Ele15_SW_L1R', - 'HLT_Ele15_SW_LooseTrackIso_L1R','HLT_DoubleEle10_SW_L1R'), - hltMuonPaths = cms.vstring('HLT_Mu9','HLT_Mu15','HLT_IsoMu9','HLT_DoubleMu3'), - hltEgPaths = cms.vstring('HLT_Ele15_SW_L1R','HLT_Ele15_SW_LooseTrackIso_L1R','HLT_DoubleEle10_SW_L1R'), - hltJetPaths = cms.vstring('HLT_QuadJet30'), - - OutputFileName = cms.string(''), - # DQMFolder = cms.untracked.string("HLT/Top") - FolderName = cms.string("HLT/Top/"), - offlineElectrons = cms.InputTag('gedGsfElectrons') - - ) diff --git a/HLTriggerOffline/Top/python/triggerEff_cfi.py b/HLTriggerOffline/Top/python/triggerEff_cfi.py deleted file mode 100644 index a065304d4d5b6..0000000000000 --- a/HLTriggerOffline/Top/python/triggerEff_cfi.py +++ /dev/null @@ -1,8 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -HLTEff = cms.EDAnalyzer("HLTEffCalculator", - TriggerResCollection = cms.InputTag("TriggerResults","","HLT"), - hltPaths = cms.vstring('HLT_IsoMu24_v15','HLT_IsoMu24_eta2p1_v13','HLT_IsoMu30_v9'), - OutputFileName = cms.string("triggerEfficiency.root"), - verbosity = cms.untracked.int32(0) - ) diff --git a/HLTriggerOffline/Top/src/HLTEfficiencyCalculator.cc b/HLTriggerOffline/Top/src/HLTEfficiencyCalculator.cc deleted file mode 100644 index 060159c0cda61..0000000000000 --- a/HLTriggerOffline/Top/src/HLTEfficiencyCalculator.cc +++ /dev/null @@ -1,82 +0,0 @@ -// -*- C++ -*- -// -// Class: HLTEffCalculator -// -/**\class HLTEffCalculator HLTEffCalculator.cc DQM/HLTEffCalculator/src/HLTEffCalculator.cc - - Description: - - Implementation: - -*/ -// -// Original Author: Abideh Jafari -// Created: Wed Aug 01 09:06:32 CEST 2012 -// -// - - -#include "HLTriggerOffline/Top/interface/HLTEfficiencyCalculator.h" -#include "FWCore/Common/interface/TriggerNames.h" -#include "TFile.h" - - -HLTEffCalculator::HLTEffCalculator(const edm::ParameterSet& iConfig) - -{ - - - outputFileName = iConfig.getParameter("OutputFileName"); - HLTresCollection = iConfig.getParameter("TriggerResCollection"); - verbosity = iConfig.getUntrackedParameter("verbosity",0); - myEffHandler = new EfficiencyHandler("TopHLTs", iConfig.getParameter >("hltPaths"), verbosity); - HLTresCollectionToken_ = consumes(iConfig.getParameter("TriggerResCollection")); -} - -HLTEffCalculator::~HLTEffCalculator() -{ - - // do anything here that needs to be done at desctruction time - // (e.g. close files, deallocate resources etc.) - -} - - -// -// member functions -// - - -// ------------ method called to for each event ------------ -void -HLTEffCalculator::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) -{ - using namespace edm; - - - // Trigger - Handle trh; - iEvent.getByToken(HLTresCollectionToken_,trh); - if( ! trh.isValid() ) { - LogDebug("") << "HL TriggerResults with label ["+HLTresCollection.encode()+"] not found!"; - return; - } - myEffHandler->Fill(iEvent,*trh); - -} - - - -// ------------ method called once each job just before starting event loop ------------ -void -HLTEffCalculator::beginJob() -{} - -// ------------ method called once each job just after ending the event loop ------------ -void -HLTEffCalculator::endJob() { - TFile * F = new TFile(outputFileName.c_str(),"recreate"); - myEffHandler->WriteAll(F); - F->Save(); -} - diff --git a/HLTriggerOffline/Top/src/TopHLTDQMHelper.cc b/HLTriggerOffline/Top/src/TopHLTDQMHelper.cc deleted file mode 100644 index 6c7772c9fcba7..0000000000000 --- a/HLTriggerOffline/Top/src/TopHLTDQMHelper.cc +++ /dev/null @@ -1,149 +0,0 @@ -#include "HLTriggerOffline/Top/interface/TopHLTDQMHelper.h" -#include -/*Originally from DQM/Physics package, written by Roger Wolf and Jeremy Andrea*/ - -using namespace std; - -CalculateHLT::CalculateHLT(int maxNJets, double wMass): - failed_(false), maxNJets_(maxNJets), wMass_(wMass), massWBoson_(-1.), massTopQuark_(-1.),tmassWBoson_(-1),tmassTopQuark_(-1),mlb_(-1) -{ -} - - -double -CalculateHLT::massWBoson(const std::vector& jets) -{ - if(!failed_&& massWBoson_<0) operator()(jets); return massWBoson_; -} - - -double -CalculateHLT::massTopQuark(const std::vector& jets) -{ - if(!failed_&& massTopQuark_<0) operator()(jets); return massTopQuark_; -} - -/* -double -Calculate::tmassWBoson(const T& mu, const reco::MET& met, const reco::Jet& b) -{ - if(!failed_&& tmassWBoson_<0) operator()(b,mu,met); return tmassWBoson_; -} - - -double -Calculate::masslb(const T& mu, const reco::MET& met, const reco::Jet& b) -{ - if(!failed_&& mlb_<0) operator()(b,mu,met); return mlb_; -} - - -double -Calculate::tmassTopQuark(const T& lepton, const reco::MET& met, const reco::Jet& b) -{ - if(!failed_&& tmassTopQuark_<0) operator()(b,lepton,met); return tmassTopQuark_; -} - - -void Calculate::operator()( const reco::Jet& bJet, const T& lepton, const reco::MET& met){ - reco::Particle::LorentzVector WT = lepton.p4() + met.p4(); - tmassWBoson_ = sqrt((WT.px()*WT.px()) + (WT.py()*WT.py())); - reco::Particle::LorentzVector topT = WT + bJet.p4(); - tmassTopQuark_ = sqrt((topT.px()*topT.px()) + (topT.py()*topT.py())); - reco::Particle::LorentzVector lb = bJet.p4() + lepton.p4(); - mlb_ = lb.mass(); -}*/ - - -double -CalculateHLT::tmassWBoson(reco::RecoCandidate* mu, const reco::MET& met, const reco::Jet& b) -{ - if(!failed_&& tmassWBoson_<0) operator()(b,mu,met); return tmassWBoson_; -} - - -double -CalculateHLT::masslb(reco::RecoCandidate* mu, const reco::MET& met, const reco::Jet& b) -{ - if(!failed_&& mlb_<0) operator()(b,mu,met); return mlb_; -} - - -double -CalculateHLT::tmassTopQuark(reco::RecoCandidate* lepton, const reco::MET& met, const reco::Jet& b) -{ - if(!failed_&& tmassTopQuark_<0) operator()(b,lepton,met); return tmassTopQuark_; -} - - -void CalculateHLT::operator()( const reco::Jet& bJet, reco::RecoCandidate* lepton, const reco::MET& met){ - double metT = sqrt(pow(met.px(),2) + pow(met.py(),2)); - double lepT = sqrt(pow(lepton->px(),2) + pow(lepton->py(),2)); - double bT = sqrt(pow(bJet.px(),2) + pow(bJet.py(),2)); - reco::Particle::LorentzVector WT = lepton->p4() + met.p4(); - // cout<<"in calculate:\n\t"<pt()<<"\t"<p4(); - mlb_ = lb.mass(); -} - - -void -CalculateHLT::operator()(const std::vector& jets) -{ - - if(maxNJets_<0) maxNJets_=jets.size(); - failed_= jets.size()<(unsigned int) maxNJets_; - if( failed_){ return; } - - // associate those jets with maximum pt of the vectorial - // sum to the hadronic decay chain - double maxPt=-1.; - std::vector maxPtIndices; - maxPtIndices.push_back(-1); - maxPtIndices.push_back(-1); - maxPtIndices.push_back(-1); - for(int idx=0; idx wMassIndices; - wMassIndices.push_back(-1); - wMassIndices.push_back(-1); - for(unsigned idx=0; idxmaxPtIndices[jdx] ) continue; - reco::Particle::LorentzVector sum = jets[maxPtIndices[idx]].p4()+jets[maxPtIndices[jdx]].p4(); - if( wDist<0. || wDist>fabs(sum.mass()-wMass_) ){ - wDist=fabs(sum.mass()-wMass_); - wMassIndices.clear(); - wMassIndices.push_back(maxPtIndices[idx]); - wMassIndices.push_back(maxPtIndices[jdx]); - } - } - } - massWBoson_= (jets[wMassIndices[0]].p4()+ - jets[wMassIndices[1]].p4()).mass(); -} - - - diff --git a/HLTriggerOffline/Top/src/TopHLTDiLeptonOfflineDQM.cc b/HLTriggerOffline/Top/src/TopHLTDiLeptonOfflineDQM.cc deleted file mode 100644 index 0d01a22762391..0000000000000 --- a/HLTriggerOffline/Top/src/TopHLTDiLeptonOfflineDQM.cc +++ /dev/null @@ -1,738 +0,0 @@ -//#include -#include "JetMETCorrections/Objects/interface/JetCorrectionsRecord.h" -#include "DataFormats/JetReco/interface/CaloJet.h" -#include "DataFormats/BTauReco/interface/JetTag.h" -#include "HLTriggerOffline/Top/src/TopHLTDiLeptonOfflineDQM.h" -#include "DataFormats/JetReco/interface/PFJet.h" -#include "HLTriggerOffline/Top/interface/TopHLTDQMHelper.h" - -/*Originally from DQM/Physics by R. Wolf and J. Andrea*/ - -namespace TopHLTDiLeptonOffline { - - MonitorEnsemble::MonitorEnsemble(const char* label, const edm::ParameterSet& cfg) : - label_(label), eidPattern_(0), elecIso_(0), elecSelect_(0), muonIso_(0), muonSelect_(0), jetIDSelect_(0), - lowerEdge_(-1.), upperEdge_(-1.), elecMuLogged_(0), diMuonLogged_(0), diElecLogged_(0) - { - // sources have to be given; this PSet is not optional - edm::ParameterSet sources=cfg.getParameter("sources"); - muons_= sources.getParameter("muons"); - elecs_= sources.getParameter("elecs"); - jets_ = sources.getParameter("jets" ); - mets_ = sources.getParameter >("mets" ); - - // elecExtras are optional; they may be omitted or empty - if( cfg.existsAs("elecExtras") ){ - edm::ParameterSet elecExtras=cfg.getParameter("elecExtras"); - // select is optional; in case it's not found no - // selection will be applied - if( elecExtras.existsAs("select") ){ - elecSelect_= new StringCutObjectSelector(elecExtras.getParameter("select")); - } - // isolation is optional; in case it's not found no - // isolation will be applied - if( elecExtras.existsAs("isolation") ){ - elecIso_= new StringCutObjectSelector(elecExtras.getParameter("isolation")); - } - // electronId is optional; in case it's not found the - // InputTag will remain empty - if( elecExtras.existsAs("electronId") ){ - edm::ParameterSet elecId=elecExtras.getParameter("electronId"); - electronId_= elecId.getParameter("src"); - eidPattern_= elecId.getParameter("pattern"); - } - } - // muonExtras are optional; they may be omitted or empty - if( cfg.existsAs("muonExtras") ){ - edm::ParameterSet muonExtras=cfg.getParameter("muonExtras"); - // select is optional; in case it's not found no - // selection will be applied - if( muonExtras.existsAs("select") ){ - muonSelect_= new StringCutObjectSelector(muonExtras.getParameter("select")); - } - // isolation is optional; in case it's not found no - // isolation will be applied - if( muonExtras.existsAs("isolation") ){ - muonIso_= new StringCutObjectSelector(muonExtras.getParameter("isolation")); - } - } - // jetExtras are optional; they may be omitted or empty - if( cfg.existsAs("jetExtras") ){ - edm::ParameterSet jetExtras=cfg.getParameter("jetExtras"); - // jetCorrector is optional; in case it's not found - // the InputTag will remain empty - if( jetExtras.existsAs("jetCorrector") ){ - jetCorrector_= jetExtras.getParameter("jetCorrector"); - } - // read jetID information if it exists - if(jetExtras.existsAs("jetID")){ - edm::ParameterSet jetID=jetExtras.getParameter("jetID"); - jetIDLabel_ =jetID.getParameter("label"); - jetIDSelect_= new StringCutObjectSelector(jetID.getParameter("select")); - } - // select is optional; in case it's not found no - // selection will be applied (only implemented for - // CaloJets at the moment) - if( jetExtras.existsAs("select") ){ - jetSelect_= jetExtras.getParameter("select"); - } - } - // triggerExtras are optional; they may be omitted or empty - if( cfg.existsAs("triggerExtras") ){ - edm::ParameterSet triggerExtras=cfg.getParameter("triggerExtras"); - triggerTable_=triggerExtras.getParameter("src"); - elecMuPaths_ =triggerExtras.getParameter >("pathsELECMU"); - diMuonPaths_ =triggerExtras.getParameter >("pathsDIMUON"); - } - // massExtras is optional; in case it's not found no mass - // window cuts are applied for the same flavor monitor - // histograms - if( cfg.existsAs("massExtras") ){ - edm::ParameterSet massExtras=cfg.getParameter("massExtras"); - lowerEdge_= massExtras.getParameter("lowerEdge"); - upperEdge_= massExtras.getParameter("upperEdge"); - } - - // setup the verbosity level for booking histograms; - // per default the verbosity level will be set to - // STANDARD. This will also be the chosen level in - // the case when the monitoring PSet is not found - verbosity_=STANDARD; - if( cfg.existsAs("monitoring") ){ - edm::ParameterSet monitoring=cfg.getParameter("monitoring"); - if(monitoring.getParameter("verbosity") == "DEBUG" ) - verbosity_= DEBUG; - if(monitoring.getParameter("verbosity") == "VERBOSE" ) - verbosity_= VERBOSE; - if(monitoring.getParameter("verbosity") == "STANDARD") - verbosity_= STANDARD; - } - // and don't forget to do the histogram booking - book(cfg.getParameter("directory")); - } - - void - MonitorEnsemble::book(std::string directory) - { - //set up the current directory path - std::string current(directory); current+=label_; - store_=edm::Service().operator->(); - store_->setCurrentFolder(current); - - // determine number of bins for trigger monitoring - unsigned int nElecMu=elecMuPaths_.size(); - unsigned int nDiMuon=diMuonPaths_.size(); - - // --- [STANDARD] --- // - //Run Number - hists_["RunNumb_" ] = store_->book1D("RunNumber" , "Run Nr." , 1.e4, 1.5e5, 3.e5); - // invariant mass of opposite charge lepton pair (only filled for same flavor) - hists_["invMass_" ] = store_->book1D("InvMass" , "M(lep1, lep2)" , 80, 0., 320.); - // invariant mass of opposite charge lepton pair (only filled for same flavor) - hists_["invMassLog_" ] = store_->book1D("InvMassLog" , "log_{10}(M(lep1, lep2))" , 80, .1, 2.5); - // invariant mass of same charge lepton pair (log10 for low mass region, only filled for same flavor) - hists_["invMassWC_" ] = store_->book1D("InvMassWC" , "M_{WC}(L1, L2)" , 80, 0., 320.); - // invariant mass of same charge lepton pair (log10 for low mass region, only filled for same flavor) - hists_["invMassWCLog_"] = store_->book1D("InvMassLogWC", "log_{10}(M_{WC})" , 80, .1, 2.5); - // decay channel [1]: muon/muon, [2]:elec/elec, [3]:elec/muon - hists_["decayChannel_"] = store_->book1D("DecayChannel", "Decay Channel" , 3, 0, 3); - // trigger efficiency estimates for the electron muon channel - hists_["elecMuEff_" ] = store_->book1D("ElecMuEff" , "Eff(e/#mu paths)" , nElecMu, 0., nElecMu); - // monitored trigger occupancy for the electron muon channel - hists_["elecMuMon_" ] = store_->book1D("ElecMuMon" , "Mon(e/#mu paths)" , nElecMu, 0., nElecMu); - // trigger efficiency estimates for the di muon channel - hists_["diMuonEff_" ] = store_->book1D("DiMuonEff" , "Eff(#mu/#mu paths)" , nDiMuon, 0., nDiMuon); - // monitored trigger occupancy for the di muon channel - hists_["diMuonMon_" ] = store_->book1D("DiMuonMon" , "Mon(#mu/#mu paths)" , nDiMuon, 0., nDiMuon); - // pt of the leading lepton - hists_["lep1Pt_" ] = store_->book1D("Lep1Pt" , "pt(lep1)" , 50, 0., 200.); - // pt of the 2. leading lepton - hists_["lep2Pt_" ] = store_->book1D("Lep2Pt" , "pt(lep2)" , 50, 0., 200.); - // multiplicity of jets with pt>30 (corrected to L2+L3) - hists_["jetMult_" ] = store_->book1D("JetMult" , "N_{30}(jet)" , 21, -0.5, 20.5); - // MET (calo) - hists_["metCalo_" ] = store_->book1D("METCalo" , "MET_{Calo}" , 50, 0., 200.); - - // set bin labels for trigger monitoring - triggerBinLabels(std::string("elecMu"), elecMuPaths_); - triggerBinLabels(std::string("diMuon"), diMuonPaths_); - // set bin labels for decayChannel_ - hists_["decayChannel_"]->setBinLabel( 1, "#mu e" , 1); - hists_["decayChannel_"]->setBinLabel( 2, "#mu #mu", 1); - hists_["decayChannel_"]->setBinLabel( 3, "e e" , 1); - - if( verbosity_==STANDARD) return; - - // --- [VERBOSE] --- // - // mean eta of the candidate leptons - hists_["sumEtaL1L2_" ] = store_->book1D("SumEtaL1L2" , "<#eta>(lep1, lep2)" , 100, -5., 5.); - // deltaEta between the 2 candidate leptons - hists_["dEtaL1L2_" ] = store_->book1D("DEtaL1L2" , "#Delta#eta(lep1,lep2)" , 80, -4., 4.); - // deltaPhi between the 2 candidate leptons - hists_["dPhiL1L2_" ] = store_->book1D("DPhiL1L2" , "#Delta#phi(lep1,lep2)" , 64, -3.2, 3.2); - // pt of the candidate electron (depending on the decay channel) - hists_["elecPt_" ] = store_->book1D("ElecPt" , "pt(e)" , 50, 0., 200.); - // relative isolation of the candidate electron (depending on the decay channel) - hists_["elecRelIso_" ] = store_->book1D("ElecRelIso" , "Iso_{Rel}(e)" , 50, 0., 1.); - // pt of the canddiate muon (depending on the decay channel) - hists_["muonPt_" ] = store_->book1D("MuonPt" , "pt(#mu)" , 50, 0., 200.); - // relative isolation of the candidate muon (depending on the decay channel) - hists_["muonRelIso_" ] = store_->book1D("MuonRelIso" , "Iso_{Rel}(#mu)" , 50, 0., 1.); - // pt of the 1. leading jet (corrected to L2+L3) - hists_["jet1Pt_" ] = store_->book1D("Jet1Pt" , "pt_{L2L3}(jet1)" , 60, 0., 300.); - // pt of the 2. leading jet (corrected to L2+L3) - hists_["jet2Pt_" ] = store_->book1D("Jet2Pt" , "pt_{L2L3}(jet2)" , 60, 0., 300.); - // MET (PF) - hists_["metPflow_" ] = store_->book1D("METPflow" , "MET_{Pflow}" , 50, 0., 200.); - // MET (TC) - hists_["metTC_" ] = store_->book1D("METTC" , "MET_{TC}" , 50, 0., 200.); - // dz for muons (to suppress cosmis) - hists_["muonDelZ_" ] = store_->book1D("MuonDelZ" , "d_{z}(#mu)" , 50, -25., 25.); - // dxy for muons (to suppress cosmics) - hists_["muonDelXY_" ] = store_->book2D("MuonDelXY" , "d_{xy}(#mu)" , 50, -1., 1., 50, -1., 1.); - // lepton multiplicity after std isolation - hists_["lepMultIso_" ] = store_->book2D("LepMultIso" , "N_{Iso}(e) vs N_{Iso}(#mu)" , 5, 0., 5., 5, 0., 5.); - - // set axes titles for dxy for muons - hists_["muonDelXY_" ]->setAxisTitle( "x [cm]", 1); hists_["muonDelXY_" ]->setAxisTitle( "y [cm]", 2); - // set axes titles for lepton multiplicity after std isolation - hists_["lepMultIso_" ]->setAxisTitle( "N_{Iso}(#mu)", 1); hists_["lepMultIso_" ]->setAxisTitle( "N_{Iso}(elec)", 2); - - if( verbosity_==VERBOSE) return; - - // --- [DEBUG] --- // - // electron multiplicity after std isolation - hists_["elecMultIso_" ] = store_->book1D("ElecMultIso" , "N_{Iso}(e)" , 11, -0.5, 10.5); - // muon multiplicity after std isolation - hists_["muonMultIso_" ] = store_->book1D("MuonMultIso" , "N_{Iso}(#mu)" , 11, -0.5, 10.5); - // calo isolation of the candidate muon (depending on the decay channel) - hists_["muonCalIso_" ] = store_->book1D("MuonCalIso" , "Iso_{Cal}(#mu)" , 50, 0., 1.); - // track isolation of the candidate muon (depending on the decay channel) - hists_["muonTrkIso_" ] = store_->book1D("MuonTrkIso" , "Iso_{Trk}(#mu)" , 50, 0., 1.); - // calo isolation of the candidate electron (depending on the decay channel) - hists_["elecCalIso_" ] = store_->book1D("ElecCalIso" , "Iso_{Cal}(e)" , 50, 0., 1.); - // track isolation of the candidate electron (depending on the decay channel) - hists_["elecTrkIso_" ] = store_->book1D("ElecTrkIso" , "Iso_{Trk}(e)" , 50, 0., 1.); - // eta of the leading jet - hists_["jet1Eta_" ] = store_->book1D("Jet1Eta" , "#eta(jet1)" , 30, -5., 5.); - // eta of the 2. leading jet - hists_["jet2Eta_" ] = store_->book1D("Jet2Eta" , "#eta(jet2)" , 30, -5., 5.); - // pt of the 1. leading jet (not corrected) - hists_["jet1PtRaw_" ] = store_->book1D("Jet1PtRaw" , "pt_{Raw}(jet1)" , 60, 0., 300.); - // pt of the 2. leading jet (not corrected) - hists_["jet2PtRaw_" ] = store_->book1D("Jet2PtRaw" , "pt_{Raw}(jet2)" , 60, 0., 300.); - // deltaEta between the 2 leading jets - hists_["dEtaJet1Jet2_"] = store_->book1D("DEtaJet1Jet2", "#Delta#eta(jet1,jet2)" , 80, -4., 4.); - // deltaEta between the lepton and the leading jet - hists_["dEtaJet1Lep1_"] = store_->book1D("DEtaJet1Lep1", "#Delta#eta(jet1,lep1)" , 80, -4., 4.); - // deltaEta between the lepton and MET - hists_["dEtaLep1MET_" ] = store_->book1D("DEtaLep1MET" , "#Delta#eta(lep1,MET)" , 80, -4., 4.); - // deltaEta between leading jet and MET - hists_["dEtaJet1MET_" ] = store_->book1D("DEtaJet1MET" , "#Delta#eta(jet1,MET)" , 80, -4., 4.); - // deltaPhi of 2 leading jets - hists_["dPhiJet1Jet2_"] = store_->book1D("DPhiJet1Jet2", "#Delta#phi(jet1,jet2)" , 64, -3.2, 3.2); - // deltaPhi of 1. lepton and 1. jet - hists_["dPhiJet1Lep1_"] = store_->book1D("DPhiJet1Lep1", "#Delta#phi(jet1,lep1)" , 64, -3.2, 3.2); - // deltaPhi of 1. lepton and MET - hists_["dPhiLep1MET_" ] = store_->book1D("DPhiLep1MET" , "#Delta#phi(lep1,MET)" , 64, -3.2, 3.2); - // deltaPhi of 1. jet and MET - hists_["dPhiJet1MET_" ] = store_->book1D("DPhiJet1MET" , "#Delta#phi(jet1,MET)" , 64, -3.2, 3.2); - // selected dimuon events - hists_["diMuonLogger_"] = store_->book2D("DiMuonLogger", "Logged DiMuon Events" , 8, 0., 8., 10, 0., 10.); - // selected dielec events - hists_["diElecLogger_"] = store_->book2D("DiElecLogger", "Logged DiElec Events" , 8, 0., 8., 10, 0., 10.); - // selected elemu events - hists_["elecMuLogger_"] = store_->book2D("ElecMuLogger", "Logged ElecMu Events" , 8, 0., 8., 10, 0., 10.); - - // set bin labels for trigger monitoring - loggerBinLabels(std::string("diMuonLogger_")); - loggerBinLabels(std::string("diElecLogger_")); - loggerBinLabels(std::string("elecMuLogger_")); - return; - } - - void - MonitorEnsemble::fill(const edm::Event& event, const edm::EventSetup& setup, - edm::Handle triggerTable, edm::Handle > muons, - edm::Handle > electronId, edm::Handle > elecs, - edm::Handle > jets, edm::Handle jetID, - std::vector< edm::Handle > > mets) - { - // fetch trigger event if configured such - if(!triggerTable_.label().empty()) { - if( !triggerTable.isValid() ) return; - } - - /* - ------------------------------------------------------------ - - Run and Inst. Luminosity information (Inst. Lumi. filled now with a dummy value=5.0) - - ------------------------------------------------------------ - */ - - if (!event.eventAuxiliary().run()) return; - fill("RunNumb_", event.eventAuxiliary().run()); - - double dummy=5.; fill("InstLumi_", dummy); - - - /* - ------------------------------------------------------------ - - Muon Selection - - ------------------------------------------------------------ - */ - - // buffer isolated muons - std::vector isoMuons; - - if( !muons.isValid() ) return; - - for(edm::View::const_iterator muon=muons->begin(); muon!=muons->end(); ++muon){ - // restrict to globalMuons - if( muon->isGlobalMuon() ){ - fill("muonDelZ_" , muon->globalTrack()->vz()); - fill("muonDelXY_", muon->globalTrack()->vx(), muon->globalTrack()->vy()); - // apply preselection - if(!muonSelect_ || (*muonSelect_)(*muon)){ - double isolationTrk = muon->pt()/(muon->pt()+muon->isolationR03().sumPt); - double isolationCal = muon->pt()/(muon->pt()+muon->isolationR03().emEt+muon->isolationR03().hadEt); - double isolationRel = (muon->isolationR03().sumPt+muon->isolationR03().emEt+muon->isolationR03().hadEt)/muon->pt(); - fill("muonTrkIso_" , isolationTrk); fill("muonCalIso_" , isolationCal); fill("muonRelIso_" , isolationRel); - if(!muonIso_ || (*muonIso_)(*muon)) isoMuons.push_back(&(*muon)); - } - } - } - fill("muonMultIso_", isoMuons.size()); - - /* - ------------------------------------------------------------ - - Electron Selection - - ------------------------------------------------------------ - */ - - // buffer isolated electronss - std::vector isoElecs; - if(!electronId_.label().empty()) { - if( !electronId.isValid() ) return; - } - - if( !elecs.isValid() ) return; - - for(edm::View::const_iterator elec=elecs->begin(); elec!=elecs->end(); ++elec){ - // restrict to electrons with good electronId - int idx = elec-elecs->begin(); - if( electronId_.label().empty() ? true : ((int)(*electronId)[elecs->refAt(idx)] & eidPattern_) ){ - // apply preselection - if(!elecSelect_ || (*elecSelect_)(*elec)){ - double isolationTrk = elec->pt()/(elec->pt()+elec->dr03TkSumPt()); - double isolationCal = elec->pt()/(elec->pt()+elec->dr03EcalRecHitSumEt()+elec->dr03HcalTowerSumEt()); - double isolationRel = (elec->dr03TkSumPt()+elec->dr03EcalRecHitSumEt()+elec->dr03HcalTowerSumEt())/elec->pt(); - fill("elecTrkIso_" , isolationTrk); fill("elecCalIso_" , isolationCal); fill("elecRelIso_" , isolationRel); - if(!elecIso_ || (*elecIso_)(*elec)) isoElecs.push_back(&(*elec)); - } - } - } - fill("elecMultIso_", isoElecs.size()); - - /* - ------------------------------------------------------------ - - Jet Selection - - ------------------------------------------------------------ - */ - - const JetCorrector* corrector=0; - if(!jetCorrector_.empty()){ - // check whether a jet correcto is in the event setup or not - if(setup.find( edm::eventsetup::EventSetupRecordKey::makeKey() )){ - corrector = JetCorrector::getJetCorrector(jetCorrector_, setup); - } - else{ - edm::LogVerbatim( "TopHLTDiLeptonOfflineDQM" ) - << "\n" - << "------------------------------------------------------------------------------------- \n" - << " No JetCorrectionsRecord available from EventSetup: \n" - << " - Jets will not be corrected. \n" - << " - If you want to change this add the following lines to your cfg file: \n" - << " \n" - << " ## load jet corrections \n" - << " process.load(\"JetMETCorrections.Configuration.JetCorrectionServicesAllAlgos_cff\") \n" - << " process.prefer(\"ak5CaloL2L3\") \n" - << " \n" - << "------------------------------------------------------------------------------------- \n"; - } - } - - unsigned int mult=0; - // buffer leadingJets - std::vector leadingJets; - if( !jets.isValid() ) return; - - if(jetIDSelect_){ - if( !jetID.isValid() ) return; - } - - for(edm::View::const_iterator jet=jets->begin(); jet!=jets->end(); ++jet){ - unsigned int idx=jet-jets->begin(); - if( jetIDSelect_ && dynamic_cast(jets->refAt(idx).get())){ - if(!(*jetIDSelect_)((*jetID)[jets->refAt(idx)])) continue; - } - // chekc additional jet selection for calo, pf and bare reco jets - if(dynamic_cast(&*jet)){ - reco::CaloJet sel = dynamic_cast(*jet); sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.); - StringCutObjectSelector jetSelect(jetSelect_); if(!jetSelect(sel)){ continue;} - } - else if(dynamic_cast(&*jet)){ - reco::PFJet sel= dynamic_cast(*jet); sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.); - StringCutObjectSelector jetSelect(jetSelect_); if(!jetSelect(sel)) continue; - } - else{ - reco::Jet sel = *jet; sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.); - StringCutObjectSelector jetSelect(jetSelect_); if(!jetSelect(sel)) continue; - } - // check for overlaps - bool overlap=false; - for(std::vector::const_iterator elec=isoElecs.begin(); elec!=isoElecs.end(); ++elec){ - if(reco::deltaR((*elec)->eta(), (*elec)->phi(), jet->eta(), jet->phi())<0.4){overlap=true; break;} - } if(overlap){continue;} - // prepare jet to fill monitor histograms - reco::Jet monitorJet=*jet; monitorJet.scaleEnergy(corrector ? corrector->correction(*jet) : 1.); - ++mult; // determine jet multiplicity - if(idx==0) { - leadingJets.push_back(monitorJet); - fill("jet1Pt_" , monitorJet.pt()); - fill("jet1PtRaw_" , jet->pt() ); - fill("jet1Eta_" , jet->eta()); - } - if(idx==1) { - leadingJets.push_back(monitorJet); - fill("jet2Pt_" , monitorJet.pt()); - fill("jet2PtRaw_" , jet->pt() ); - fill("jet2Eta_" , jet->eta()); - } - } - if(leadingJets.size()>1){ - fill("dEtaJet1Jet2_" , leadingJets[0].eta()-leadingJets[1].eta()); - fill("dPhiJet1Jet2_" , reco::deltaPhi(leadingJets[0].phi(), leadingJets[1].phi())); - if( !isoMuons.empty() ){ - if( isoElecs.empty() || isoMuons[0]->pt()>isoElecs[0]->pt() ){ - fill("dEtaJet1Lep1_" , isoMuons[0]->eta()-leadingJets[0].eta()); - fill("dPhiJet1Lep1_" , reco::deltaPhi(isoMuons[0]->phi() , leadingJets[0].phi())); - } - } - if( !isoElecs.empty() ){ - if( isoMuons.empty() || isoElecs[0]->pt()>isoMuons[0]->pt() ){ - fill("dEtaJet1Lep1_" , isoElecs[0]->eta()-leadingJets[0].eta()); - fill("dPhiJet1Lep1_" , reco::deltaPhi(isoElecs[0]->phi() , leadingJets[0].phi())); - } - } - } - fill("jetMult_", mult); - - /* - ------------------------------------------------------------ - - MET Selection - - ------------------------------------------------------------ - */ - - // buffer for event logging - reco::MET caloMET; - //for(std::vector::const_iterator met_=mets_.begin(); met_!=mets_.end(); ++met_){ - //for( met_=mets_.begin(); met_!=mets_.end(); ++met_){ - for( int i=0; i > met = mets[i]; - if( !met.isValid() ) continue; - - if(met->begin()!=met->end()){ - unsigned int idx=i; - if(idx==0){ - caloMET=*met->begin(); - fill("metCalo_", met->begin()->et()); - if(!leadingJets.empty()){ - fill("dEtaJet1MET_" , leadingJets[0].eta()-met->begin()->eta()); - fill("dPhiJet1MET_" , reco::deltaPhi(leadingJets[0].phi(), met->begin()->phi())); - } - if( !isoMuons.empty() ){ - if( isoElecs.empty() || isoMuons[0]->pt()>isoElecs[0]->pt() ){ - fill("dEtaLep1MET_" , isoMuons[0]->eta()-met->begin()->eta()); - fill("dPhiLep1MET_" , reco::deltaPhi(isoMuons[0]->phi(), met->begin()->phi())); - } - } - if( !isoElecs.empty() ){ - if( isoMuons.empty() || isoElecs[0]->pt()>isoMuons[0]->pt() ){ - fill("dEtaLep1MET_" , isoElecs[0]->eta()-met->begin()->eta()); - fill("dPhiLep1MET_" , reco::deltaPhi(isoElecs[0]->phi(), met->begin()->phi())); - } - } - } - if(idx==1){ fill("metTC_" , met->begin()->et());} - if(idx==2){ fill("metPflow_", met->begin()->et());} - } - } - - - /* - ------------------------------------------------------------ - - Event Monitoring - - ------------------------------------------------------------ - */ - - // check number of isolated leptons - fill("lepMultIso_", isoMuons.size(), isoElecs.size()); - // ELECMU channel - if( decayChannel(isoMuons, isoElecs) == ELECMU ){ - fill("decayChannel_", 0.5); - double mass = (isoElecs[0]->p4()+isoMuons[0]->p4()).mass(); - if( (lowerEdge_==-1. && upperEdge_==-1.) || (lowerEdge_eta()-isoMuons[0]->eta()); - fill("sumEtaL1L2_", (isoElecs[0]->eta()+isoMuons[0]->eta())/2); - fill("dPhiL1L2_" , reco::deltaPhi(isoElecs[0]->phi(), isoMuons[0]->eta())); - fill("elecPt_", isoElecs[0]->pt()); fill("muonPt_", isoMuons[0]->pt()); - fill("lep1Pt_", isoElecs[0]->pt()>isoMuons[0]->pt() ? isoElecs[0]->pt() : isoMuons[0]->pt()); - fill("lep2Pt_", isoElecs[0]->pt()>isoMuons[0]->pt() ? isoMuons[0]->pt() : isoElecs[0]->pt()); - // fill plots for trigger monitoring - if(!triggerTable_.label().empty()) fill(event, *triggerTable, "elecMu", elecMuPaths_); - if(elecMuLogged_<=hists_.find("elecMuLogger_")->second->getNbinsY()){ - // log runnumber, lumi block, event number & some - // more pysics infomation for interesting events - fill("elecMuLogger_", 0.5, elecMuLogged_+0.5, event.eventAuxiliary().run()); - fill("elecMuLogger_", 1.5, elecMuLogged_+0.5, event.eventAuxiliary().luminosityBlock()); - fill("elecMuLogger_", 2.5, elecMuLogged_+0.5, event.eventAuxiliary().event()); - fill("elecMuLogger_", 3.5, elecMuLogged_+0.5, isoMuons[0]->pt()); - fill("elecMuLogger_", 4.5, elecMuLogged_+0.5, isoElecs[0]->pt()); - if(leadingJets.size()>0) fill("elecMuLogger_", 5.5, elecMuLogged_+0.5, leadingJets[0].pt()); - if(leadingJets.size()>1) fill("elecMuLogger_", 6.5, elecMuLogged_+0.5, leadingJets[1].pt()); - fill("elecMuLogger_", 7.5, elecMuLogged_+0.5, caloMET.et()); - ++elecMuLogged_; - } - } - } - - // DIMUON channel - if( decayChannel(isoMuons, isoElecs) == DIMUON ){ - fill("decayChannel_", 1.5); - int charge = isoMuons[0]->charge()*isoMuons[1]->charge(); - double mass = (isoMuons[0]->p4()+isoMuons[1]->p4()).mass(); - - fill(charge<0 ? "invMass_" : "invMassWC_" , mass ); - fill(charge<0 ? "invMassLog_" : "invMassWCLog_" , log10(mass)); - if((lowerEdge_==-1. && upperEdge_==-1.) || (lowerEdge_eta()-isoMuons[1]->eta() ); - fill("sumEtaL1L2_", (isoMuons[0]->eta()+isoMuons[1]->eta())/2); - fill("dPhiL1L2_", reco::deltaPhi(isoMuons[0]->phi(),isoMuons[1]->phi()) ); - fill("muonPt_", isoMuons[0]->pt()); fill("muonPt_", isoMuons[1]->pt()); - fill("lep1Pt_", isoMuons[0]->pt()); fill("lep2Pt_", isoMuons[1]->pt()); - // fill plots for trigger monitoring - if(!triggerTable_.label().empty()) fill(event, *triggerTable, "diMuon", diMuonPaths_); - if(diMuonLogged_<=hists_.find("diMuonLogger_")->second->getNbinsY()){ - // log runnumber, lumi block, event number & some - // more pysics infomation for interesting events - fill("diMuonLogger_", 0.5, diMuonLogged_+0.5, event.eventAuxiliary().run()); - fill("diMuonLogger_", 1.5, diMuonLogged_+0.5, event.eventAuxiliary().luminosityBlock()); - fill("diMuonLogger_", 2.5, diMuonLogged_+0.5, event.eventAuxiliary().event()); - fill("diMuonLogger_", 3.5, diMuonLogged_+0.5, isoMuons[0]->pt()); - fill("diMuonLogger_", 4.5, diMuonLogged_+0.5, isoMuons[1]->pt()); - if(leadingJets.size()>0) fill("diMuonLogger_", 5.5, diMuonLogged_+0.5, leadingJets[0].pt()); - if(leadingJets.size()>1) fill("diMuonLogger_", 6.5, diMuonLogged_+0.5, leadingJets[1].pt()); - fill("diMuonLogger_", 7.5, diMuonLogged_+0.5, caloMET.et()); - ++diMuonLogged_; - } - } - } - - // DIELEC channel - if( decayChannel(isoMuons, isoElecs) == DIELEC ){ - fill("decayChannel_", 2.5); - int charge = isoElecs[0]->charge()*isoElecs[1]->charge(); - double mass = (isoElecs[0]->p4()+isoElecs[1]->p4()).mass(); - fill(charge<0 ? "invMass_" : "invMassWC_" , mass ); - fill(charge<0 ? "invMassLog_" : "invMassWCLog_" , log10(mass)); - if((lowerEdge_==-1. && upperEdge_==-1.) || (lowerEdge_eta()-isoElecs[1]->eta() ); - fill("sumEtaL1L2_", (isoElecs[0]->eta()+isoElecs[1]->eta())/2); - fill("dPhiL1L2_" , reco::deltaPhi(isoElecs[0]->phi(),isoElecs[1]->phi()) ); - fill("elecPt_", isoElecs[0]->pt()); fill("elecPt_", isoElecs[1]->pt()); - fill("lep1Pt_", isoElecs[0]->pt()); fill("lep2Pt_", isoElecs[1]->pt()); - if(diElecLogged_<=hists_.find("diElecLogger_")->second->getNbinsY()){ - // log runnumber, lumi block, event number & some - // more pysics infomation for interesting events - fill("diElecLogger_", 0.5, diElecLogged_+0.5, event.eventAuxiliary().run()); - fill("diElecLogger_", 1.5, diElecLogged_+0.5, event.eventAuxiliary().luminosityBlock()); - fill("diElecLogger_", 2.5, diElecLogged_+0.5, event.eventAuxiliary().event()); - fill("diElecLogger_", 3.5, diElecLogged_+0.5, isoElecs[0]->pt()); - fill("diElecLogger_", 4.5, diElecLogged_+0.5, isoElecs[1]->pt()); - if(leadingJets.size()>0) fill("diElecLogger_", 5.5, diElecLogged_+0.5, leadingJets[0].pt()); - if(leadingJets.size()>1) fill("diElecLogger_", 6.5, diElecLogged_+0.5, leadingJets[1].pt()); - fill("diElecLogger_", 7.5, diElecLogged_+0.5, caloMET.et()); - ++diElecLogged_; - } - } - } - } - -} - -TopHLTDiLeptonOfflineDQM::TopHLTDiLeptonOfflineDQM(const edm::ParameterSet& cfg): triggerTable_(""), vertex_(""), vertexSelect_(0), beamspotSelect_(0) -{ - edm::ParameterSet sources=cfg.getParameter("sources"); - muonsToken_ = consumes< edm::View >(sources.getParameter("muons")); - elecsToken_ = consumes< edm::View >(sources.getParameter("elecs")); - jetsToken_ = consumes< edm::View >(sources.getParameter("jets" )); - - metsTemp_ = sources.getParameter >("mets" ); - - metsTokens_.resize( metsTemp_.size() ); - for( int i=0; i >(metsTemp_[i]); - - // configure the preselection - edm::ParameterSet presel=cfg.getParameter("preselection"); - if( presel.existsAs("trigger") ){ - edm::ParameterSet trigger=presel.getParameter("trigger"); - triggerTable_=trigger.getParameter("src"); - triggerTableToken_ = consumes(trigger.getParameter("src")); - triggerPaths_=trigger.getParameter >("select"); - } - if( presel.existsAs("vertex" ) ){ - edm::ParameterSet vertex=presel.getParameter("vertex"); - vertex_= vertex.getParameter("src"); - vertexToken_= consumes< std::vector >(vertex.getParameter("src")); - vertexSelect_= new StringCutObjectSelector(vertex.getParameter("select")); - } - if( presel.existsAs("beamspot" ) ){ - edm::ParameterSet beamspot=presel.getParameter("beamspot"); - beamspot_= beamspot.getParameter("src"); - beamspotToken_= consumes(beamspot.getParameter("src")); - beamspotSelect_= new StringCutObjectSelector(beamspot.getParameter("select")); - } - - // elecExtras are optional; they may be omitted or empty - if( cfg.existsAs("elecExtras") ){ - edm::ParameterSet elecExtras=cfg.getParameter("elecExtras"); - // electronId is optional; in case it's not found the - // InputTag will remain empty - if( elecExtras.existsAs("electronId") ){ - edm::ParameterSet elecId=elecExtras.getParameter("electronId"); - electronIdToken_= consumes< edm::ValueMap >(elecId.getParameter("src")); - } - } - - // jetExtras are optional; they may be omitted or empty - if( cfg.existsAs("jetExtras") ){ - edm::ParameterSet jetExtras=cfg.getParameter("jetExtras"); - // read jetID information if it exists - if(jetExtras.existsAs("jetID")){ - edm::ParameterSet jetID=jetExtras.getParameter("jetID"); - jetIDToken_ = consumes(jetID.getParameter("label")); - } - } - - // conifgure the selection - std::vector sel=cfg.getParameter >("selection"); - for(unsigned int i=0; i("label")); - selection_[selectionStep(selectionOrder_.back())] = std::make_pair(sel.at(i), new TopHLTDiLeptonOffline::MonitorEnsemble(selectionStep(selectionOrder_.back()).c_str(), cfg.getParameter("setup"))); - } -} - -void -TopHLTDiLeptonOfflineDQM::analyze(const edm::Event& event, const edm::EventSetup& setup) -{ - edm::Handle triggerTable; - edm::Handle > vertex; - edm::Handle beamspot; - - edm::Handle > muons; - event.getByToken(muonsToken_, muons); - - edm::Handle > electronId; - event.getByToken(electronIdToken_, electronId); - - edm::Handle > elecs; - event.getByToken(elecsToken_, elecs); - - edm::Handle > jets; - event.getByToken(jetsToken_, jets); - - edm::Handle jetID; - event.getByToken(jetIDToken_, jetID); - - std::vector< edm::Handle > > mets; - for( int i=0; iempty() || !(*vertexSelect_)(vertex->front())) return; - } - if(!beamspot_.label().empty()){ - if( !event.getByToken(beamspotToken_, beamspot) ) return; - if(!(*beamspotSelect_)(*beamspot)) return; - } - - // apply selection steps - for(std::vector::const_iterator selIt=selectionOrder_.begin(); selIt!=selectionOrder_.end(); ++selIt){ - std::string key = selectionStep(*selIt), type = objectType(*selIt); - if(selection_.find(key)!=selection_.end()){ - if(type=="empty"){ - selection_[key].second->fill(event, setup, triggerTable, muons, electronId, elecs, jets, jetID, mets); - } - if(type=="Hlt" ){ -// cout<<"HLT filled"<fill(event, setup, triggerTable, muons, electronId, elecs, jets, jetID, mets); - } - if(type=="muons"){ - SelectionStepHLT step(selection_[key].first, consumesCollector()); - if(step.select(event)){ - selection_[key].second->fill(event, setup, triggerTable, muons, electronId, elecs, jets, jetID, mets); - } else break; - } - if(type=="elecs"){ - SelectionStepHLT step(selection_[key].first, consumesCollector()); - if(step.select(event)){ - selection_[key].second->fill(event, setup, triggerTable, muons, electronId, elecs, jets, jetID, mets); - } else break; - } - if(type=="jets" ){ - SelectionStepHLT step(selection_[key].first, consumesCollector()); - if(step.select(event, setup)){ - selection_[key].second->fill(event, setup, triggerTable, muons, electronId, elecs, jets, jetID, mets); - } else break; - } - if(type=="jets/pf" ){ - SelectionStepHLT step(selection_[key].first, consumesCollector()); - if(step.select(event, setup)){ - selection_[key].second->fill(event, setup, triggerTable, muons, electronId, elecs, jets, jetID, mets); - } else break; - } - if(type=="jets/calo" ){ - SelectionStepHLT step(selection_[key].first, consumesCollector()); - if(step.select(event, setup)){ - selection_[key].second->fill(event, setup, triggerTable, muons, electronId, elecs, jets, jetID, mets); - } else break; - } - if(type=="met" ){ - SelectionStepHLT step(selection_[key].first, consumesCollector()); - if(step.select(event)){ - selection_[key].second->fill(event, setup, triggerTable, muons, electronId, elecs, jets, jetID, mets); - } else break; - } - } - } -} - - diff --git a/HLTriggerOffline/Top/src/TopHLTDiLeptonOfflineDQM.h b/HLTriggerOffline/Top/src/TopHLTDiLeptonOfflineDQM.h deleted file mode 100644 index 6968efae7440f..0000000000000 --- a/HLTriggerOffline/Top/src/TopHLTDiLeptonOfflineDQM.h +++ /dev/null @@ -1,316 +0,0 @@ -#ifndef TOPHLTDILEPTONOFFLINEDQM -#define TOPHLTDILEPTONOFFLINEDQM - -#include -#include - -#include "FWCore/Framework/interface/Event.h" -#include "DQMServices/Core/interface/DQMStore.h" -#include "DQMServices/Core/interface/MonitorElement.h" - -#include "DataFormats/Math/interface/deltaR.h" -#include "DataFormats/JetReco/interface/Jet.h" -#include "HLTriggerOffline/Top/interface/TopHLTDQMHelper.h" -#include "DataFormats/MuonReco/interface/Muon.h" -#include "DataFormats/Common/interface/ValueMap.h" -#include "DataFormats/METReco/interface/CaloMET.h" -#include "JetMETCorrections/Objects/interface/JetCorrector.h" -#include "DataFormats/EgammaCandidates/interface/GsfElectron.h" - - -#include "DataFormats/MuonReco/interface/MuonFwd.h" -#include "DataFormats/MuonReco/interface/Muon.h" - -/*Originally from DQM/Physics by R. Wolf and J. Andrea*/ - -/** - \class MonitorEnsemble TopDQMHelpers.h "DQM/Physics/interface/TopDQMHelpers.h" - - \brief Helper class to define histograms for monitoring of muon/electron/jet/met quantities. - - Helper class to contain histograms for the monitoring of muon/electron/jet/met quantities. - This class can be instantiated several times after several event selection steps. It can - be used to fill histograms in three different granularity levels according to STANDARD - (<10 histograms), VERBOSE(<20 histograms), DEBUG(<30 histgorams). Note that for the sake - of simplicity and to force the analyst to keep the number of histograms to be monitored - small the MonitorEnsemble class contains the histograms for all objects at once. It should - not contain much more than 10 histograms though in the STANDARD configuration, as these - histograms will be monitored at each SelectionStep. Monitoring of histograms after selec- - tion steps within the same object collection needs to be implemented within the Monitor- - Ensemble. It will not be covered by the SelectionStep class. -*/ - -namespace TopHLTDiLeptonOffline { - - class MonitorEnsemble { - public: - /// different verbosity levels - enum Level{ STANDARD, VERBOSE, DEBUG }; - /// make clear which LorentzVector to use - /// for jet, electrons and muon buffering - typedef reco::LeafCandidate::LorentzVector LorentzVector; - /// different decay channels - enum DecayChannel{ NONE, DIMUON, DIELEC, ELECMU }; - - public: - /// default contructor - MonitorEnsemble(const char* label, const edm::ParameterSet& cfg); - /// default destructor - ~MonitorEnsemble(){}; - - /// book histograms in subdirectory _directory_ - void book(std::string directory); - /// fill monitor histograms with electronId and jetCorrections - //void fill(const edm::Event& event, const edm::EventSetup& setup); - void fill(const edm::Event& event, const edm::EventSetup& setup, edm::Handle triggerTable, edm::Handle > muons, edm::Handle > electronId, edm::Handle > elecs, edm::Handle > jets, edm::Handle jetID, std::vector< edm::Handle > > mets); - - private: - /// deduce monitorPath from label, the label is expected - /// to be of type 'selectionPath:monitorPath' - std::string monitorPath(const std::string& label) const { return label.substr(label.find(':')+1); }; - /// deduce selectionPath from label, the label is - /// expected to be of type 'selectionPath:monitorPath' - std::string selectionPath(const std::string& label) const { return label.substr(0, label.find(':')); }; - /// determine dileptonic decay channel - DecayChannel decayChannel(const std::vector& muons, const std::vector& elecs) const; - - /// set labels for event logging histograms - void loggerBinLabels(std::string hist); - /// set configurable labels for trigger monitoring histograms - void triggerBinLabels(std::string channel, const std::vector& labels); - /// fill trigger monitoring histograms - void fill(const edm::Event& event, const edm::TriggerResults& triggerTable, std::string channel, const std::vector& labels) const; - - /// check if histogram was booked - bool booked(const std::string histName) const { return hists_.find(histName.c_str())!=hists_.end(); }; - /// fill histogram if it had been booked before - void fill(const std::string histName, double value) const { if(booked(histName.c_str())) hists_.find(histName.c_str())->second->Fill(value); }; - /// fill histogram if it had been booked before (2-dim version) - void fill(const std::string histName, double xValue, double yValue) const { if(booked(histName.c_str())) hists_.find(histName.c_str())->second->Fill(xValue, yValue); }; - /// fill histogram if it had been booked before (2-dim version) - void fill(const std::string histName, double xValue, double yValue, double zValue) const { if(booked(histName.c_str())) hists_.find(histName.c_str())->second->Fill(xValue, yValue, zValue); }; - - private: - /// verbosity level for booking - Level verbosity_; - /// instance label - std::string label_; - /// input sources for monitoring - edm::InputTag elecs_, muons_, jets_; - - /// considers a vector of METs - std::vector mets_; - - /// trigger table - edm::InputTag triggerTable_; - /// trigger paths for monitoring, expected - /// to be of form signalPath:MonitorPath - std::vector elecMuPaths_; - /// trigger paths for di muon channel - std::vector diMuonPaths_; - - /// electronId label - edm::InputTag electronId_; - /// electronId pattern we expect the following pattern: - /// 0: fails - /// 1: passes electron ID only - /// 2: passes electron Isolation only - /// 3: passes electron ID and Isolation only - /// 4: passes conversion rejection - /// 5: passes conversion rejection and ID - /// 6: passes conversion rejection and Isolation - /// 7: passes the whole selection - /// As described on https://twiki.cern.ch/twiki/bin/view/CMS/SimpleCutBasedEleID - int eidPattern_; - /// extra isolation criterion on electron - StringCutObjectSelector* elecIso_; - /// extra selection on electrons - StringCutObjectSelector* elecSelect_; - - /// extra isolation criterion on muon - StringCutObjectSelector* muonIso_; - /// extra selection on muons - StringCutObjectSelector* muonSelect_; - - /// jetCorrector - std::string jetCorrector_; - /// jetID as an extra selection type - edm::InputTag jetIDLabel_; - /// extra jetID selection on calo jets - StringCutObjectSelector* jetIDSelect_; - /// extra selection on jets (here given as std::string as it depends - /// on the the jet type, which selections are valid and which not) - std::string jetSelect_; - /// mass window upper and lower edge - double lowerEdge_, upperEdge_; - - /// number of logged interesting events - int elecMuLogged_, diMuonLogged_, diElecLogged_; - /// storage manager - DQMStore* store_; - /// histogram container - std::map hists_; - }; - - inline void - MonitorEnsemble::loggerBinLabels(std::string hist) - { - // set axes titles for selected events - hists_[hist.c_str()]->getTH1()->SetOption("TEXT"); - hists_[hist.c_str()]->setBinLabel( 1 , "Run" , 1); - hists_[hist.c_str()]->setBinLabel( 2 , "Block" , 1); - hists_[hist.c_str()]->setBinLabel( 3 , "Event" , 1); - hists_[hist.c_str()]->setBinLabel( 6 , "pt_{L2L3}(jet1)" , 1); - hists_[hist.c_str()]->setBinLabel( 7 , "pt_{L2L3}(jet2)" , 1); - hists_[hist.c_str()]->setBinLabel( 8 , "MET_{Calo}" , 1); - hists_[hist.c_str()]->setAxisTitle("logged evts" , 2); - - if(hist=="diMuonLogger_"){ - hists_[hist.c_str()]->setBinLabel( 4 , "pt(muon)" , 1); - hists_[hist.c_str()]->setBinLabel( 5 , "pt(muon)" , 1); - } - if(hist=="diElecLogger_"){ - hists_[hist.c_str()]->setBinLabel( 4 , "pt(elec)" , 1); - hists_[hist.c_str()]->setBinLabel( 5 , "pt(elec)" , 1); - } - if(hist=="elecMuLogger_"){ - hists_[hist.c_str()]->setBinLabel( 4 , "pt(elec)" , 1); - hists_[hist.c_str()]->setBinLabel( 5 , "pt(muon)" , 1); - } - } - - inline void - MonitorEnsemble::triggerBinLabels(std::string channel, const std::vector& labels) - { - for(unsigned int idx=0; idxsetBinLabel( idx+1, "["+monitorPath(labels[idx])+"]", 1); - hists_[(channel+"Eff_").c_str()]->setBinLabel( idx+1, "["+selectionPath(labels[idx])+"]|["+monitorPath(labels[idx])+"]", 1); - } - } - - inline void - MonitorEnsemble::fill(const edm::Event& event, const edm::TriggerResults& triggerTable, std::string channel, const std::vector& labels) const - { - for(unsigned int idx=0; idxsecond->getBinContent(idx+1); - double value = hists_.find((channel+"Eff_").c_str())->second->getBinContent(idx+1); - fill((channel+"Eff_").c_str(), idx+0.5, 1./evts*(acceptHLT(event, triggerTable, selectionPath(labels[idx]))-value)); - } - } - } - - inline MonitorEnsemble::DecayChannel - MonitorEnsemble::decayChannel(const std::vector& muons, const std::vector& elecs) const - { - DecayChannel type=NONE; - if( muons.size()>1 ){ type=DIMUON; } else if( elecs.size()>1 ){ type=DIELEC; } else if( !elecs.empty() && !muons.empty() ){ type=ELECMU; } - return type; - } - -} - -#include - -#include "FWCore/Framework/interface/EDAnalyzer.h" -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/ServiceRegistry/interface/Service.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -#include "FWCore/Common/interface/TriggerNames.h" -#include "DataFormats/BeamSpot/interface/BeamSpot.h" -#include "DataFormats/VertexReco/interface/Vertex.h" -#include "DataFormats/Common/interface/TriggerResults.h" - -/** - \class TopHLTDiLeptonOfflineDQM TopHLTDiLeptonOfflineDQM.h "DQM/Physics/plugins/TopHLTDiLeptonOfflineDQM.h" - - \brief Module to apply a monitored selection of top like events in the di-leptonic channel - - Plugin to apply a monitored selection of top like events with some minimal flexibility - in the number and definition of the selection steps. To achieve this flexibility it - employes the SelectionStep class. The MonitorEnsemble class is used to provide a well - defined set of histograms to be monitored after each selection step. The SelectionStep - class provides a flexible and intuitive selection via the StringCutParser. SelectionStep - and MonitorEnsemble classes are interleaved. The monitoring starts after a preselection - step (which is not monitored in the context of this module) with an instance of the - MonitorEnsemble class. The following objects are supported for selection: - - - jets : of type reco::Jet - - elecs : of type reco::GsfElectron - - muons : of type reco::Muon - - met : of type reco::MET - - These types have to be present as prefix of the selection step paramter _label_ separated - from the rest of the label by a ':' (e.g. in the form "jets:step0"). The class expects - selection labels of this type. They will be disentangled by the private helper functions - _objectType_ and _seletionStep_ as declared below. -*/ - -/// define MonitorEnsembple to be used -//using TopDiLeptonOffline::MonitorEnsemble; - -class TopHLTDiLeptonOfflineDQM : public edm::EDAnalyzer { - public: - /// default constructor - TopHLTDiLeptonOfflineDQM(const edm::ParameterSet& cfg); - /// default destructor - ~TopHLTDiLeptonOfflineDQM(){ - if( beamspotSelect_ ) delete beamspotSelect_; - if( vertexSelect_ ) delete vertexSelect_; - } - - /// do this during the event loop - virtual void analyze(const edm::Event& event, const edm::EventSetup& setup); - - private: - /// deduce object type from ParameterSet label, the label - /// is expected to be of type 'objectType:selectionStep' - std::string objectType(const std::string& label) { return label.substr(0, label.find(':')); }; - /// deduce selection step from ParameterSet label, the - /// label is expected to be of type 'objectType:selectionStep' - std::string selectionStep(const std::string& label) { return label.substr(label.find(':')+1); }; - - private: - /// trigger table - edm::InputTag triggerTable_; - /// trigger paths - std::vector triggerPaths_; - /// primary vertex - edm::InputTag vertex_; - /// string cut selector - StringCutObjectSelector* vertexSelect_; - /// beamspot - edm::InputTag beamspot_; - /// string cut selector - StringCutObjectSelector* beamspotSelect_; - - /// needed to guarantee the selection order as defined by the order of - /// ParameterSets in the _selection_ vector as defined in the config - std::vector selectionOrder_; - /// this is the heart component of the plugin; std::string keeps a label - /// the selection step for later identification, edm::ParameterSet keeps - /// the configuration of the selection for the SelectionStep class, - /// MonitoringEnsemble keeps an instance of the MonitorEnsemble class to - /// be filled _after_ each selection step - std::map > selection_; - - std::vector metsTemp_; - - edm::EDGetTokenT< edm::View > muonsToken_; - edm::EDGetTokenT< edm::View > elecsToken_; - edm::EDGetTokenT< edm::View > jetsToken_; - - edm::EDGetTokenT< edm::ValueMap > electronIdToken_; - edm::EDGetTokenT jetIDToken_; - - edm::EDGetTokenT triggerTableToken_; - edm::EDGetTokenT< std::vector > vertexToken_; - edm::EDGetTokenT beamspotToken_; - - std::vector< edm::EDGetTokenT< edm::View > > metsTokens_; -}; - -#endif diff --git a/HLTriggerOffline/Top/src/TopHLTSingleLeptonDQM.cc b/HLTriggerOffline/Top/src/TopHLTSingleLeptonDQM.cc deleted file mode 100644 index 5841f1df380bf..0000000000000 --- a/HLTriggerOffline/Top/src/TopHLTSingleLeptonDQM.cc +++ /dev/null @@ -1,736 +0,0 @@ -#include "JetMETCorrections/Objects/interface/JetCorrectionsRecord.h" -#include "DataFormats/JetReco/interface/CaloJet.h" -#include "DataFormats/BTauReco/interface/JetTag.h" -#include "DataFormats/JetReco/interface/PFJet.h" -#include "DataFormats/Math/interface/deltaR.h" -#include "TopHLTSingleLeptonDQM.h" -#include "HLTriggerOffline/Top/interface/TopHLTDQMHelper.h" -#include -/*Originally from DQM/Physics by R. Wolf and J. Andrea*/ -using namespace std; -namespace TopHLTSingleLepton { - - // maximal number of leading jets - // to be used for top mass estimate - static const unsigned int MAXJETS = 4; - // nominal mass of the W boson to - // be used for the top mass estimate - static const double WMASS = 80.4; - - MonitorEnsemble::MonitorEnsemble(const char* label, const edm::ParameterSet& cfg) : - label_(label), elecIso_(0), elecSelect_(0), pvSelect_(0), muonIso_(0), muonSelect_(0), jetIDSelect_(0), includeBTag_(false), lowerEdge_(-1.), upperEdge_(-1.), logged_(0) - { - // sources have to be given; this PSet is not optional - edm::ParameterSet sources=cfg.getParameter("sources"); - muons_= sources.getParameter("muons"); - elecs_= sources.getParameter("elecs"); - jets_ = sources.getParameter("jets" ); - mets_ = sources.getParameter >("mets" ); - pvs_ = sources.getParameter("pvs" ); - // electronExtras are optional; they may be omitted or - // empty - if( cfg.existsAs("elecExtras") ){ - edm::ParameterSet elecExtras=cfg.getParameter("elecExtras"); - // select is optional; in case it's not found no - // selection will be applied - if( elecExtras.existsAs("select") ){ - elecSelect_= new StringCutObjectSelector(elecExtras.getParameter("select")); - } - // isolation is optional; in case it's not found no - // isolation will be applied - if( elecExtras.existsAs("isolation") ){ - elecIso_= new StringCutObjectSelector(elecExtras.getParameter("isolation")); - } - // electronId is optional; in case it's not found the - // InputTag will remain empty - if( elecExtras.existsAs("electronId") ){ - edm::ParameterSet elecId=elecExtras.getParameter("electronId"); - electronId_= elecId.getParameter("src"); - eidPattern_= elecId.getParameter("pattern"); - } - } - // pvExtras are opetional; they may be omitted or empty - if(cfg.existsAs("pvExtras")){ - edm::ParameterSet pvExtras=cfg.getParameter("pvExtras"); - // select is optional; in case it's not found no - // selection will be applied - if( pvExtras.existsAs("select") ){ - pvSelect_= new StringCutObjectSelector(pvExtras.getParameter("select")); - } - } - // muonExtras are optional; they may be omitted or empty - if( cfg.existsAs("muonExtras") ){ - edm::ParameterSet muonExtras=cfg.getParameter("muonExtras"); - // select is optional; in case it's not found no - // selection will be applied - if( muonExtras.existsAs("select") ){ - muonSelect_= new StringCutObjectSelector(muonExtras.getParameter("select")); - } - // isolation is optional; in case it's not found no - // isolation will be applied - if( muonExtras.existsAs("isolation") ){ - muonIso_= new StringCutObjectSelector(muonExtras.getParameter("isolation")); - } - } - - // jetExtras are optional; they may be omitted or - // empty - if( cfg.existsAs("jetExtras") ){ - edm::ParameterSet jetExtras=cfg.getParameter("jetExtras"); - // jetCorrector is optional; in case it's not found - // the InputTag will remain empty - if( jetExtras.existsAs("jetCorrector") ){ - jetCorrector_= jetExtras.getParameter("jetCorrector"); - } - // read jetID information if it exists - if(jetExtras.existsAs("jetID")){ - edm::ParameterSet jetID=jetExtras.getParameter("jetID"); - jetIDLabel_ =jetID.getParameter("label"); - jetIDSelect_= new StringCutObjectSelector(jetID.getParameter("select")); - } - // select is optional; in case it's not found no - // selection will be applied (only implemented for - // CaloJets at the moment) - if( jetExtras.existsAs("select") ){ - jetSelect_= jetExtras.getParameter("select"); - } - // jetBDiscriminators are optional; in case they are - // not found the InputTag will remain empty; they - // consist of pairs of edm::JetFlavorAssociation's & - // corresponding working points - includeBTag_=jetExtras.existsAs("jetBTaggers"); - if( includeBTag_ ){ - edm::ParameterSet btagEff=jetExtras.getParameter("jetBTaggers").getParameter("trackCountingEff"); - btagEff_= btagEff.getParameter("label"); btagEffWP_= btagEff.getParameter("workingPoint"); - edm::ParameterSet btagPur=jetExtras.getParameter("jetBTaggers").getParameter("trackCountingPur"); - btagPur_= btagPur.getParameter("label"); btagPurWP_= btagPur.getParameter("workingPoint"); - edm::ParameterSet btagVtx=jetExtras.getParameter("jetBTaggers").getParameter("secondaryVertex" ); - btagVtx_= btagVtx.getParameter("label"); btagVtxWP_= btagVtx.getParameter("workingPoint"); - } - } - - // triggerExtras are optional; they may be omitted or empty - if( cfg.existsAs("triggerExtras") ){ - edm::ParameterSet triggerExtras=cfg.getParameter("triggerExtras"); - triggerTable_=triggerExtras.getParameter("src"); - triggerPaths_=triggerExtras.getParameter >("paths"); - } - - // massExtras is optional; in case it's not found no mass - // window cuts are applied for the same flavor monitor - // histograms - if( cfg.existsAs("massExtras") ){ - edm::ParameterSet massExtras=cfg.getParameter("massExtras"); - lowerEdge_= massExtras.getParameter("lowerEdge"); - upperEdge_= massExtras.getParameter("upperEdge"); - } - - // setup the verbosity level for booking histograms; - // per default the verbosity level will be set to - // STANDARD. This will also be the chosen level in - // the case when the monitoring PSet is not found - verbosity_=STANDARD; - if( cfg.existsAs("monitoring") ){ - edm::ParameterSet monitoring=cfg.getParameter("monitoring"); - if(monitoring.getParameter("verbosity") == "DEBUG" ) - verbosity_= DEBUG; - if(monitoring.getParameter("verbosity") == "VERBOSE" ) - verbosity_= VERBOSE; - if(monitoring.getParameter("verbosity") == "STANDARD") - verbosity_= STANDARD; - } - // and don't forget to do the histogram booking - book(cfg.getParameter("directory")); - } - - void - MonitorEnsemble::book(std::string directory) - { - //set up the current directory path - std::string current(directory); current+=label_; - store_=edm::Service().operator->(); - store_->setCurrentFolder(current); - - // determine number of bins for trigger monitoring - unsigned int nPaths=triggerPaths_.size(); - - // --- [STANDARD] --- // - // number of selected primary vertices - hists_["pvMult_" ] = store_->book1D("PvMult" , "N_{pvs}" , 100, 0., 100.); - // pt of the leading muon - hists_["muonPt_" ] = store_->book1D("MuonPt" , "pt(#mu)" , 50, 0., 250.); - // muon multiplicity before std isolation - hists_["muonMult_" ] = store_->book1D("MuonMult" , "N_{All}(#mu)" , 10, 0., 10.); - // muon multiplicity after std isolation - hists_["muonMultIso_"] = store_->book1D("MuonMultIso", "N_{Iso}(#mu)" , 10, 0., 10.); - // pt of the leading electron - hists_["elecPt_" ] = store_->book1D("ElecPt" , "pt(e)" , 50, 0., 250.); - // electron multiplicity before std isolation - hists_["elecMult_" ] = store_->book1D("ElecMult" , "N_{All}(e)" , 10, 0., 10.); - // electron multiplicity after std isolation - hists_["elecMultIso_"] = store_->book1D("ElecMultIso", "N_{Iso}(e)" , 10, 0., 10.); - // multiplicity of jets with pt>20 (corrected to L2+L3) - hists_["jetMult_" ] = store_->book1D("JetMult" , "N_{30}(jet)" , 10, 0., 10.); - // trigger efficiency estimates for single lepton triggers - hists_["triggerEff_" ] = store_->book1D("TriggerEff" , "Eff(trigger)" , nPaths, 0., nPaths); - // monitored trigger occupancy for single lepton triggers - hists_["triggerMon_" ] = store_->book1D("TriggerMon" , "Mon(trigger)" , nPaths, 0., nPaths); - // MET (calo) - hists_["metCalo_" ] = store_->book1D("METCalo" , "MET_{Calo}" , 50, 0., 200.); - // W mass estimate - hists_["massW_" ] = store_->book1D("MassW" , "M(W)" , 60, 0., 300.); - // Top mass estimate - hists_["massTop_" ] = store_->book1D("MassTop" , "M(Top)" , 50, 0., 500.); - // Mlb mu - hists_["mMub_" ] = store_->book1D("mMub" , "m_{#mub}" , 50, 0., 500.); - // W mass transverse estimate mu - hists_["MTWm_" ] = store_->book1D("MTWm" , "M_{T}^{W}(#mu)" , 60, 0., 300.); - // Top mass transverse estimate mu - hists_["mMTT_" ] = store_->book1D("mMTT" , "M_{T}^{t}(#mu)" , 50, 0., 500.); - - // Mlb e - hists_["mEb_" ] = store_->book1D("mEb" , "m_{eb}" , 50, 0., 500.); - // W mass transverse estimate e - hists_["MTWe_" ] = store_->book1D("MTWe" , "M_{T}^{W}(e)" , 60, 0., 300.); - // Top mass transverse estimate e - hists_["eMTT_" ] = store_->book1D("eMTT" , "M_{T}^{t}(e)" , 50, 0., 500.); - - - - - // set bin labels for trigger monitoring - triggerBinLabels(std::string("trigger"), triggerPaths_); - - if( verbosity_==STANDARD) return; - - // --- [VERBOSE] --- // - // eta of the leading muon - hists_["muonEta_" ] = store_->book1D("MuonEta" , "#eta(#mu)" , 30, -3., 3.); - // std isolation variable of the leading muon - hists_["muonRelIso_" ] = store_->book1D("MuonRelIso" , "Iso_{Rel}(#mu)" , 50, 0., 1.); - // eta of the leading electron - hists_["elecEta_" ] = store_->book1D("ElecEta" , "#eta(e)" , 30, -3., 3.); - // std isolation variable of the leading electron - hists_["elecRelIso_" ] = store_->book1D("ElecRelIso" , "Iso_{Rel}(e)" , 50, 0., 1.); - // multiplicity of btagged jets (for track counting high efficiency) with pt(L2L3)>30 - hists_["jetMultBEff_"] = store_->book1D("JetMultBEff", "N_{30}(b/eff)" , 10, 0., 10.); - // btag discriminator for track counting high efficiency for jets with pt(L2L3)>30 - hists_["jetBDiscEff_"] = store_->book1D("JetBDiscEff", "Disc_{b/eff}(jet)", 100, 0., 10.); - // pt of the 1. leading jet (corrected to L2+L3) - hists_["jet1Pt_" ] = store_->book1D("Jet1Pt" , "pt_{L2L3}(jet1)" , 60, 0., 300.); - // pt of the 2. leading jet (corrected to L2+L3) - hists_["jet2Pt_" ] = store_->book1D("Jet2Pt" , "pt_{L2L3}(jet2)" , 60, 0., 300.); - // pt of the 3. leading jet (corrected to L2+L3) - hists_["jet3Pt_" ] = store_->book1D("Jet3Pt" , "pt_{L2L3}(jet3)" , 60, 0., 300.); - // pt of the 4. leading jet (corrected to L2+L3) - hists_["jet4Pt_" ] = store_->book1D("Jet4Pt" , "pt_{L2L3}(jet4)" , 60, 0., 300.); - // eta of the 1. - hists_["jet1Eta_" ] = store_->book1D("Jet1Eta" , "#eta(jet1)" , 30, -3., 3.); - // eta of the 2. - hists_["jet2Eta_" ] = store_->book1D("Jet2Eta" , "#eta(jet2)" , 30, -3., 3.); - // eta of the 3. - hists_["jet3Eta_" ] = store_->book1D("Jet3Eta" , "#eta(jet3)" , 30, -3., 3.); - // eta of the 4. - hists_["jet4Eta_" ] = store_->book1D("Jet4Eta" , "#eta(jet4)" , 30, -3., 3.); - // MET (tc) - hists_["metTC_" ] = store_->book1D("METTC" , "MET_{TC}" , 50, 0., 200.); - // MET (pflow) - hists_["metPflow_" ] = store_->book1D("METPflow" , "MET_{Pflow}" , 50, 0., 200.); - // dz for muons (to suppress cosmis) - hists_["muonDelZ_" ] = store_->book1D("MuonDelZ" , "d_{z}(#mu)" , 50, -25., 25.); - // dxy for muons (to suppress cosmics) - hists_["muonDelXY_" ] = store_->book2D("MuonDelXY" , "d_{xy}(#mu)" , 50, -0.1, 0.1, 50, -0.1, 0.1); - - // set axes titles for dxy for muons - hists_["muonDelXY_" ]->setAxisTitle( "x [cm]", 1); hists_["muonDelXY_" ]->setAxisTitle( "y [cm]", 2); - - if( verbosity_==VERBOSE) return; - - // --- [DEBUG] --- // - // relative muon isolation in tracker for the leading muon - hists_["muonTrkIso_" ] = store_->book1D("MuonTrkIso" , "Iso_{Trk}(#mu)" , 50, 0., 1.); - // relative muon isolation in ecal+hcal for the leading muon - hists_["muonCalIso_" ] = store_->book1D("MuonCalIso" , "Iso_{Ecal}(#mu)" , 50, 0., 1.); - // relative electron isolation in tracker for the leading electron - hists_["elecTrkIso_" ] = store_->book1D("ElecTrkIso" , "Iso_{Trk}(e)" , 50, 0., 1.); - // relative electron isolation in ecal+hcal for the leading electron - hists_["elecCalIso_" ] = store_->book1D("ElecCalIso" , "Iso_{Ecal}(e)" , 50, 0., 1.); - // multiplicity of btagged jets (for track counting high purity) with pt(L2L3)>30 - hists_["jetMultBPur_"] = store_->book1D("JetMultBPur", "N_{30}(b/pur)" , 10, 0., 10.); - // btag discriminator for track counting high purity - hists_["jetBDiscPur_"] = store_->book1D("JetBDiscPur", "Disc_{b/pur}(Jet)", 100, 0., 10.); - // multiplicity of btagged jets (for simple secondary vertex) with pt(L2L3)>30 - hists_["jetMultBVtx_"] = store_->book1D("JetMultBVtx", "N_{30}(b/vtx)" , 10, 0., 10.); - // btag discriminator for simple secondary vertex - hists_["jetBDiscVtx_"] = store_->book1D("JetBDiscVtx", "Disc_{b/vtx}(Jet)", 35, -1., 6.); - // pt of the 1. leading jet (uncorrected) - hists_["jet1PtRaw_" ] = store_->book1D("Jet1PtRaw" , "pt_{Raw}(jet1)" , 60, 0., 300.); - // pt of the 2. leading jet (uncorrected) - hists_["jet2PtRaw_" ] = store_->book1D("Jet2PtRaw" , "pt_{Raw}(jet2)" , 60, 0., 300.); - // pt of the 3. leading jet (uncorrected) - hists_["jet3PtRaw_" ] = store_->book1D("Jet3PtRaw" , "pt_{Raw}(jet3)" , 60, 0., 300.); - // pt of the 4. leading jet (uncorrected) - hists_["jet4PtRaw_" ] = store_->book1D("Jet4PtRaw" , "pt_{Raw}(jet4)" , 60, 0., 300.); - // selected events - hists_["eventLogger_"] = store_->book2D("EventLogger", "Logged Events" , 9, 0., 9., 10, 0., 10.); - - // set axes titles for selected events - hists_["eventLogger_"]->getTH1()->SetOption("TEXT"); - hists_["eventLogger_"]->setBinLabel( 1 , "Run" , 1); - hists_["eventLogger_"]->setBinLabel( 2 , "Block" , 1); - hists_["eventLogger_"]->setBinLabel( 3 , "Event" , 1); - hists_["eventLogger_"]->setBinLabel( 4 , "pt_{L2L3}(jet1)" , 1); - hists_["eventLogger_"]->setBinLabel( 5 , "pt_{L2L3}(jet2)" , 1); - hists_["eventLogger_"]->setBinLabel( 6 , "pt_{L2L3}(jet3)" , 1); - hists_["eventLogger_"]->setBinLabel( 7 , "pt_{L2L3}(jet4)" , 1); - hists_["eventLogger_"]->setBinLabel( 8 , "M_{W}" , 1); - hists_["eventLogger_"]->setBinLabel( 9 , "M_{Top}" , 1); - hists_["eventLogger_"]->setAxisTitle("logged evts" , 2); - return; - } - - void - MonitorEnsemble::fill(const edm::Event& event, const edm::EventSetup& setup, - edm::Handle triggerTable, edm::Handle > pvs, - edm::Handle > muons, edm::Handle > electronId, - edm::Handle > elecs, edm::Handle > jets, - edm::Handle jetID, edm::Handle btagEff, - edm::Handle btagPur, edm::Handle btagVtx, - std::vector< edm::Handle > > mets) - { - // fetch trigger event if configured such - if(!triggerTable_.label().empty()) { - if( !triggerTable.isValid() ) return; - } - - /* - ------------------------------------------------------------ - - Primary Vertex Monitoring - - ------------------------------------------------------------ - */ - // fill monitoring plots for primary verices - if( !pvs.isValid() ) return; - unsigned int pvMult = 0; - for(edm::View::const_iterator pv=pvs->begin(); pv!=pvs->end(); ++pv){ - if(!pvSelect_ || (*pvSelect_)(*pv)) - pvMult++; - } - fill("pvMult_", pvMult ); - - /* - ------------------------------------------------------------ - - Electron Monitoring - - ------------------------------------------------------------ - */ - - // check availability of electron id - if(!electronId_.label().empty()) { - if( !electronId.isValid() ) return; - } - - if( !elecs.isValid() ) return; - - // loop electron collection - unsigned int eMult=0, eMultIso=0; - std::vector isoElecs; - reco::GsfElectron e; - for(edm::View::const_iterator elec=elecs->begin(); elec!=elecs->end(); ++elec){ - unsigned int idx = elec-elecs->begin(); - // restrict to electrons with good electronId - if( electronId_.label().empty() ? true : ((int)(*electronId)[elecs->refAt(idx)] & eidPattern_) ){ - if(!elecSelect_ || (*elecSelect_)(*elec)){ - double isolationTrk = elec->pt()/(elec->pt()+elec->dr03TkSumPt()); - double isolationCal = elec->pt()/(elec->pt()+elec->dr03EcalRecHitSumEt()+elec->dr03HcalTowerSumEt()); - double isolationRel = (elec->dr03TkSumPt()+elec->dr03EcalRecHitSumEt()+elec->dr03HcalTowerSumEt())/elec->pt(); - if( eMult==0 ){ - // restrict to the leading electron - fill("elecPt_" , elec->pt() ); - fill("elecEta_", elec->eta()); - fill("elecRelIso_" , isolationRel ); - fill("elecTrkIso_" , isolationTrk ); - fill("elecCalIso_" , isolationCal ); - } - // in addition to the multiplicity counter buffer the iso - // electron candidates for later overlap check with jets - ++eMult; if(!elecIso_ || (*elecIso_)(*elec)){ if(eMultIso == 0) e = *elec; isoElecs.push_back(&(*elec)); ++eMultIso;} - } - } - } - fill("elecMult_", eMult ); - fill("elecMultIso_", eMultIso); - - /* - ------------------------------------------------------------ - - Muon Monitoring - - ------------------------------------------------------------ - */ - - // fill monitoring plots for muons - unsigned int mMult=0, mMultIso=0; - - if( !muons.isValid() ) return; - - reco::Muon mu; - for(edm::View::const_iterator muon=muons->begin(); muon!=muons->end(); ++muon){ - // restrict to globalMuons - if( muon->isGlobalMuon() ){ - fill("muonDelZ_" , muon->globalTrack()->vz()); - fill("muonDelXY_", muon->globalTrack()->vx(), muon->globalTrack()->vy()); - // apply preselection - if(!muonSelect_ || (*muonSelect_)(*muon)){ - double isolationTrk = muon->pt()/(muon->pt()+muon->isolationR03().sumPt); - double isolationCal = muon->pt()/(muon->pt()+muon->isolationR03().emEt+muon->isolationR03().hadEt); - double isolationRel = (muon->isolationR03().sumPt+muon->isolationR03().emEt+muon->isolationR03().hadEt)/muon->pt(); - if( mMult==0 ){ - // restrict to leading muon - fill("muonPt_" , muon->pt() ); - fill("muonEta_" , muon->eta()); - fill("muonRelIso_" , isolationRel ); - fill("muonTrkIso_" , isolationTrk ); - fill("muonCalIso_" , isolationCal ); - } - ++mMult; if(!muonIso_ || (*muonIso_)(*muon)) {if(mMultIso == 0) mu = *muon; ++mMultIso;} - } - } - } - fill("muonMult_", mMult ); - fill("muonMultIso_", mMultIso); - - /* - ------------------------------------------------------------ - - Jet Monitoring - - ------------------------------------------------------------ - */ - - // check availability of the btaggers - if( includeBTag_ ){ - if( !btagEff.isValid() ) return; - if( !btagPur.isValid() ) return; - if( !btagVtx.isValid() ) return; - } - // load jet corrector if configured such - const JetCorrector* corrector=0; - if(!jetCorrector_.empty()){ - // check whether a jet correcto is in the event setup or not - if(setup.find( edm::eventsetup::EventSetupRecordKey::makeKey() )){ - corrector = JetCorrector::getJetCorrector(jetCorrector_, setup); - } - else{ - edm::LogVerbatim( "TopHLTSingleLeptonDQM" ) - << "\n" - << "------------------------------------------------------------------------------------- \n" - << " No JetCorrectionsRecord available from EventSetup: \n" - << " - Jets will not be corrected. \n" - << " - If you want to change this add the following lines to your cfg file: \n" - << " \n" - << " ## load jet corrections \n" - << " process.load(\"JetMETCorrections.Configuration.JetCorrectionServicesAllAlgos_cff\") \n" - << " process.prefer(\"ak5CaloL2L3\") \n" - << " \n" - << "------------------------------------------------------------------------------------- \n"; - } - } - - // loop jet collection - std::vector correctedJets; - unsigned int mult=0, multBEff=0, multBPur=0, multBVtx=0; - - if( !jets.isValid() ) return; - - if(jetIDSelect_){ - if( !jetID.isValid() ) return; - } - - reco::Jet bJetCand; - for(edm::View::const_iterator jet=jets->begin(); jet!=jets->end(); ++jet){ - // check jetID for calo jets - unsigned int idx = jet-jets->begin(); - if( jetIDSelect_ && dynamic_cast(jets->refAt(idx).get())){ - if(!(*jetIDSelect_)((*jetID)[jets->refAt(idx)])) continue; - } - // chekc additional jet selection for calo, pf and bare reco jets - if(dynamic_cast(&*jet)){ - reco::CaloJet sel = dynamic_cast(*jet); sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.); - StringCutObjectSelector jetSelect(jetSelect_); if(!jetSelect(sel)){ continue;} - } - else if(dynamic_cast(&*jet)){ - reco::PFJet sel= dynamic_cast(*jet); sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.); - StringCutObjectSelector jetSelect(jetSelect_); if(!jetSelect(sel)) continue; - } - else{ - reco::Jet sel = *jet; sel.scaleEnergy(corrector ? corrector->correction(*jet) : 1.); - StringCutObjectSelector jetSelect(jetSelect_); if(!jetSelect(sel)) continue; - } - // check for overlaps -- comment this to be synchronous with the selection - //bool overlap=false; - //for(std::vector::const_iterator elec=isoElecs.begin(); elec!=isoElecs.end(); ++elec){ - // if(reco::deltaR((*elec)->eta(), (*elec)->phi(), jet->eta(), jet->phi())<0.4){overlap=true; break;} - //} if(overlap){continue;} - - // prepare jet to fill monitor histograms - reco::Jet monitorJet = *jet; monitorJet.scaleEnergy(corrector ? corrector->correction(*jet) : 1.); - correctedJets.push_back(monitorJet); - ++mult; // determine jet multiplicity - if( includeBTag_ ){ - // fill b-discriminators - edm::RefToBase jetRef = jets->refAt(idx); - fill("jetBDiscEff_", (*btagEff)[jetRef]); if( (*btagEff)[jetRef]>btagEffWP_ ) ++multBEff; - fill("jetBDiscPur_", (*btagPur)[jetRef]); if( (*btagPur)[jetRef]>btagPurWP_ ) {if(multBPur == 0) bJetCand = *jet; ++multBPur;} - fill("jetBDiscVtx_", (*btagVtx)[jetRef]); if( (*btagVtx)[jetRef]>btagVtxWP_ ) ++multBVtx; - } - // fill pt (raw or L2L3) for the leading four jets - if(idx==0) {fill("jet1Pt_" , monitorJet.pt()); fill("jet1PtRaw_", jet->pt() ); fill("jet1Eta_" , monitorJet.eta());} - if(idx==1) {fill("jet2Pt_" , monitorJet.pt()); fill("jet2PtRaw_", jet->pt() ); fill("jet2Eta_" , monitorJet.eta());} - if(idx==2) {fill("jet3Pt_" , monitorJet.pt()); fill("jet3PtRaw_", jet->pt() ); fill("jet3Eta_" , monitorJet.eta());} - if(idx==3) {fill("jet4Pt_" , monitorJet.pt()); fill("jet4PtRaw_", jet->pt() ); fill("jet4Eta_" , monitorJet.eta());} - } - fill("jetMult_" , mult ); - fill("jetMultBEff_", multBEff); - fill("jetMultBPur_", multBPur); - fill("jetMultBVtx_", multBVtx); - - /* - ------------------------------------------------------------ - - MET Monitoring - - ------------------------------------------------------------ - */ - - // fill monitoring histograms for met - reco::MET mET; - for( int i=0; i > met = mets[i]; - if( !met.isValid() ) continue; - if(met->begin()!=met->end()){ - unsigned int idx=i; - if(idx==0) fill("metCalo_" , met->begin()->et()); - if(idx==1) fill("metTC_" , met->begin()->et()); - if(idx==2) fill("metPflow_", met->begin()->et()); - mET = *(met->begin()); - } - } - - /* - ------------------------------------------------------------ - - Event Monitoring - - ------------------------------------------------------------ - */ - - // fill W boson and top mass estimates - CalculateHLT eventKinematics(MAXJETS, WMASS); - double wMass = eventKinematics.massWBoson (correctedJets); - double topMass = eventKinematics.massTopQuark(correctedJets); - if(wMass>=0 && topMass>=0) {fill("massW_" , wMass ); fill("massTop_" , topMass);} - // fill plots for trigger monitoring - if((lowerEdge_==-1. && upperEdge_==-1.) || (lowerEdge_second->getNbinsY()){ - // log runnumber, lumi block, event number & some - // more pysics infomation for interesting events - fill("eventLogger_", 0.5, logged_+0.5, event.eventAuxiliary().run()); - fill("eventLogger_", 1.5, logged_+0.5, event.eventAuxiliary().luminosityBlock()); - fill("eventLogger_", 2.5, logged_+0.5, event.eventAuxiliary().event()); - if(correctedJets.size()>0) fill("eventLogger_", 3.5, logged_+0.5, correctedJets[0].pt()); - if(correctedJets.size()>1) fill("eventLogger_", 4.5, logged_+0.5, correctedJets[1].pt()); - if(correctedJets.size()>2) fill("eventLogger_", 5.5, logged_+0.5, correctedJets[2].pt()); - if(correctedJets.size()>3) fill("eventLogger_", 6.5, logged_+0.5, correctedJets[3].pt()); - fill("eventLogger_", 7.5, logged_+0.5, wMass ); - fill("eventLogger_", 8.5, logged_+0.5, topMass); - ++logged_; - } - } - if(multBPur != 0 && mMultIso == 1 ){ - // cout<("sources"); - muonsToken_ = consumes< edm::View >(sources.getParameter("muons")); - elecsToken_ = consumes< edm::View >(sources.getParameter("elecs")); - jetsToken_ = consumes< edm::View >(sources.getParameter("jets" )); - pvsToken_ = consumes< edm::View >(sources.getParameter("pvs" )); - - metsTemp_ = sources.getParameter >("mets" ); - - metsTokens_.resize( metsTemp_.size() ); - for( int i=0; i >(metsTemp_[i]); - - // configure preselection - edm::ParameterSet presel=cfg.getParameter("preselection"); - if( presel.existsAs("trigger") ){ - edm::ParameterSet trigger=presel.getParameter("trigger"); - triggerTable_=trigger.getParameter("src"); - triggerPaths_=trigger.getParameter >("select"); - } - if( presel.existsAs("vertex" ) ){ - edm::ParameterSet vertex=presel.getParameter("vertex"); - vertex_= vertex.getParameter("src"); - vertexToken_= consumes< std::vector >(vertex.getParameter("src")); - vertexSelect_= new StringCutObjectSelector(vertex.getParameter("select")); - } - if( presel.existsAs("beamspot" ) ){ - edm::ParameterSet beamspot=presel.getParameter("beamspot"); - beamspot_= beamspot.getParameter("src"); - beamspotToken_= consumes(beamspot.getParameter("src")); - beamspotSelect_= new StringCutObjectSelector(beamspot.getParameter("select")); - } - - // elecExtras are optional; they may be omitted or empty - if( cfg.existsAs("elecExtras") ){ - edm::ParameterSet elecExtras=cfg.getParameter("elecExtras"); - // electronId is optional; in case it's not found the - // InputTag will remain empty - if( elecExtras.existsAs("electronId") ){ - edm::ParameterSet elecId=elecExtras.getParameter("electronId"); - electronIdToken_= consumes< edm::ValueMap >(elecId.getParameter("src")); - } - } - - // jetExtras are optional; they may be omitted or empty - if( cfg.existsAs("jetExtras") ){ - edm::ParameterSet jetExtras=cfg.getParameter("jetExtras"); - // read jetID information if it exists - if(jetExtras.existsAs("jetID")){ - edm::ParameterSet jetID=jetExtras.getParameter("jetID"); - jetIDToken_ = consumes(jetID.getParameter("label")); - } - } - - // conifgure the selection - std::vector sel=cfg.getParameter >("selection"); - for(unsigned int i=0; i("label")); - selection_[selectionStep(selectionOrder_.back())] = std::make_pair(sel.at(i), new TopHLTSingleLepton::MonitorEnsemble(selectionStep(selectionOrder_.back()).c_str(), cfg.getParameter("setup"))); - } -} - -void -TopHLTSingleLeptonDQM::analyze(const edm::Event& event, const edm::EventSetup& setup) -{ - - edm::Handle triggerTable; - edm::Handle > vertex; - edm::Handle beamspot; - - edm::Handle > pvs; - event.getByToken(pvsToken_, pvs); - - edm::Handle > muons; - event.getByToken(muonsToken_, muons); - - edm::Handle > electronId; - event.getByToken(electronIdToken_, electronId); - - edm::Handle > elecs; - event.getByToken(elecsToken_, elecs); - - edm::Handle > jets; - event.getByToken(jetsToken_, jets); - - edm::Handle jetID; - event.getByToken(jetIDToken_, jetID); - - - edm::Handle btagEff, btagPur, btagVtx; - event.getByToken(btagEffToken_, btagEff); - event.getByToken(btagPurToken_, btagPur); - event.getByToken(btagVtxToken_, btagVtx); - - std::vector< edm::Handle > > mets; - for( int i=0; iempty() || !(*vertexSelect_)(vertex->front())) return; - } - if(!beamspot_.label().empty()){ - if( !event.getByToken(beamspotToken_, beamspot) ) return; - if(!(*beamspotSelect_)(*beamspot)) return; - } - - - // apply selection steps - unsigned int passed=0; - for(std::vector::const_iterator selIt=selectionOrder_.begin(); selIt!=selectionOrder_.end(); ++selIt){ - std::string key = selectionStep(*selIt), type = objectType(*selIt); - if(selection_.find(key)!=selection_.end()){ - if(type=="empty"){ - selection_[key].second->fill(event, setup, triggerTable, pvs, muons, electronId, elecs, jets, jetID, btagEff, btagPur, btagVtx, mets); - } - if(type=="Hlt" ){ -// cout<<"HLT filled"<fill(event, setup, triggerTable, pvs, muons, electronId, elecs, jets, jetID, btagEff, btagPur, btagVtx, mets); - } - if(type=="muons"){ -// cout<<"Good Mu found"< step(selection_[key].first, consumesCollector()); - if(step.select(event)){ ++passed; - selection_[key].second->fill(event, setup, triggerTable, pvs, muons, electronId, elecs, jets, jetID, btagEff, btagPur, btagVtx, mets); - } else break; - } - if(type=="elecs"){ - SelectionStepHLT step(selection_[key].first, consumesCollector()); - if(step.select(event)){ ++passed; - selection_[key].second->fill(event, setup, triggerTable, pvs, muons, electronId, elecs, jets, jetID, btagEff, btagPur, btagVtx, mets); - } else break; - } - if(type=="jets" ){ - SelectionStepHLT step(selection_[key].first, consumesCollector()); - if(step.select(event, setup)){ ++passed; - selection_[key].second->fill(event, setup, triggerTable, pvs, muons, electronId, elecs, jets, jetID, btagEff, btagPur, btagVtx, mets); - } else break; - } - if(type=="jets/pf" ){ - SelectionStepHLT step(selection_[key].first, consumesCollector()); - if(step.select(event, setup)){ ++passed; - selection_[key].second->fill(event, setup, triggerTable, pvs, muons, electronId, elecs, jets, jetID, btagEff, btagPur, btagVtx, mets); - } else break; - } - if(type=="jets/calo" ){ -// cout<<"Jet found!"< step(selection_[key].first, consumesCollector()); - if(step.select(event, setup)){ ++passed; - selection_[key].second->fill(event, setup, triggerTable, pvs, muons, electronId, elecs, jets, jetID, btagEff, btagPur, btagVtx, mets); - } else break; - } - if(type=="met" ){ - SelectionStepHLT step(selection_[key].first, consumesCollector()); - if(step.select(event)){ ++passed; - selection_[key].second->fill(event, setup, triggerTable, pvs, muons, electronId, elecs, jets, jetID, btagEff, btagPur, btagVtx, mets); - } else break; - } - } - } -} - - diff --git a/HLTriggerOffline/Top/src/TopHLTSingleLeptonDQM.h b/HLTriggerOffline/Top/src/TopHLTSingleLeptonDQM.h deleted file mode 100644 index ea65c8f658ead..0000000000000 --- a/HLTriggerOffline/Top/src/TopHLTSingleLeptonDQM.h +++ /dev/null @@ -1,278 +0,0 @@ -#ifndef TOPSINGLELEPTONDQM -#define TOPSINGLELEPTONDQM - -#include -#include - -#include "FWCore/Framework/interface/Event.h" -#include "DQMServices/Core/interface/DQMStore.h" -#include "DQMServices/Core/interface/MonitorElement.h" - -#include "DataFormats/JetReco/interface/Jet.h" -#include "HLTriggerOffline/Top/interface/TopHLTDQMHelper.h" -#include "DataFormats/MuonReco/interface/Muon.h" -#include "DataFormats/Common/interface/ValueMap.h" -#include "DataFormats/METReco/interface/CaloMET.h" -#include "JetMETCorrections/Objects/interface/JetCorrector.h" -#include "DataFormats/EgammaCandidates/interface/GsfElectron.h" -#include "DataFormats/VertexReco/interface/Vertex.h" -/*Originally from DQM/Physics by R. Wolf and J. Andrea*/ - -/** - \class MonitorEnsemble TopDQMHelpers.h "DQM/Physics/interface/TopDQMHelpers.h" - - \brief Helper class to define histograms for monitoring of muon/electron/jet/met quantities. - - Helper class to contain histograms for the monitoring of muon/electron/jet/met quantities. - This class can be instantiated several times after several event selection steps. It can - be used to fill histograms in three different granularity levels according to STANDARD - (<10 histograms), VERBOSE(<20 histograms), DEBUG(<30 histgorams). Note that for the sake - of simplicity and to force the analyst to keep the number of histograms to be monitored - small the MonitorEnsemble class contains the histograms for all objects at once. It should - not contain much more than 10 histograms though in the STANDARD configuration, as these - histograms will be monitored at each SelectionStep. Monitoring of histograms after selec- - tion steps within the same object collection needs to be implemented within the Monitor- - Ensemble. It will not be covered by the SelectionStep class. -*/ - -namespace TopHLTSingleLepton { - - class MonitorEnsemble { - public: - /// different verbosity levels - enum Level{ STANDARD, VERBOSE, DEBUG }; - - public: - /// default contructor - MonitorEnsemble(const char* label, const edm::ParameterSet& cfg); - /// default destructor - ~MonitorEnsemble(){}; - - /// book histograms in subdirectory _directory_ - void book(std::string directory); - /// fill monitor histograms with electronId and jetCorrections - void fill(const edm::Event& event, const edm::EventSetup& setup, edm::Handle triggerTable, edm::Handle > pvs, edm::Handle > muons, edm::Handle > electronId, edm::Handle > elecs, edm::Handle > jets, edm::Handle jetID, edm::Handle btagEff, edm::Handle btagPur, edm::Handle btagVtx, std::vector< edm::Handle > > mets); - - private: - /// deduce monitorPath from label, the label is expected - /// to be of type 'selectionPath:monitorPath' - std::string monitorPath(const std::string& label) const { return label.substr(label.find(':')+1); }; - /// deduce selectionPath from label, the label is - /// expected to be of type 'selectionPath:monitorPath' - std::string selectionPath(const std::string& label) const { return label.substr(0, label.find(':')); }; - - /// set configurable labels for trigger monitoring histograms - void triggerBinLabels(std::string channel, const std::vector& labels); - /// fill trigger monitoring histograms - void fill(const edm::Event& event, const edm::TriggerResults& triggerTable, std::string channel, const std::vector& labels) const; - - /// check if histogram was booked - bool booked(const std::string histName) const { return hists_.find(histName.c_str())!=hists_.end(); }; - /// fill histogram if it had been booked before - void fill(const std::string histName, double value) const { if(booked(histName.c_str())) hists_.find(histName.c_str())->second->Fill(value); }; - /// fill histogram if it had been booked before (2-dim version) - void fill(const std::string histName, double xValue, double yValue) const { if(booked(histName.c_str())) hists_.find(histName.c_str())->second->Fill(xValue, yValue); }; - /// fill histogram if it had been booked before (2-dim version) - void fill(const std::string histName, double xValue, double yValue, double zValue) const { if(booked(histName.c_str())) hists_.find(histName.c_str())->second->Fill(xValue, yValue, zValue); }; - - private: - /// verbosity level for booking - Level verbosity_; - /// instance label - std::string label_; - /// considers a vector of METs - std::vector mets_; - /// input sources for monitoring - edm::InputTag elecs_, muons_, jets_, pvs_; - - /// trigger table - edm::InputTag triggerTable_; - /// trigger paths for monitoring, expected - /// to be of form signalPath:MonitorPath - std::vector triggerPaths_; - - /// electronId label - edm::InputTag electronId_; - /// electronId pattern we expect the following pattern: - /// 0: fails - /// 1: passes electron ID only - /// 2: passes electron Isolation only - /// 3: passes electron ID and Isolation only - /// 4: passes conversion rejection - /// 5: passes conversion rejection and ID - /// 6: passes conversion rejection and Isolation - /// 7: passes the whole selection - /// As described on https://twiki.cern.ch/twiki/bin/view/CMS/SimpleCutBasedEleID - int eidPattern_; - /// extra isolation criterion on electron - StringCutObjectSelector* elecIso_; - /// extra selection on electrons - StringCutObjectSelector* elecSelect_; - - /// extra selection on primary vertices; meant to investigate the pile-up effect - StringCutObjectSelector* pvSelect_; - - /// extra isolation criterion on muon - StringCutObjectSelector* muonIso_; - /// extra selection on muons - StringCutObjectSelector* muonSelect_; - - /// jetCorrector - std::string jetCorrector_; - /// jetID as an extra selection type - edm::InputTag jetIDLabel_; - /// extra jetID selection on calo jets - StringCutObjectSelector* jetIDSelect_; - /// extra selection on jets (here given as std::string as it depends - /// on the the jet type, which selections are valid and which not) - std::string jetSelect_; - /// include btag information or not - /// to be determined from the cfg - bool includeBTag_; - /// btag discriminator labels - edm::InputTag btagEff_, btagPur_, btagVtx_; - /// btag working points - double btagEffWP_, btagPurWP_, btagVtxWP_; - /// mass window upper and lower edge - double lowerEdge_, upperEdge_; - - /// number of logged interesting events - int logged_; - /// storage manager - DQMStore* store_; - /// histogram container - std::map hists_; - }; - - inline void - MonitorEnsemble::triggerBinLabels(std::string channel, const std::vector& labels) - { - for(unsigned int idx=0; idxsetBinLabel( idx+1, "["+monitorPath(labels[idx])+"]", 1); - hists_[(channel+"Eff_").c_str()]->setBinLabel( idx+1, "["+selectionPath(labels[idx])+"]|["+monitorPath(labels[idx])+"]", 1); - } - } - - inline void - MonitorEnsemble::fill(const edm::Event& event, const edm::TriggerResults& triggerTable, std::string channel, const std::vector& labels) const - { - for(unsigned int idx=0; idxsecond->getBinContent(idx+1); - double value = hists_.find((channel+"Eff_").c_str())->second->getBinContent(idx+1); - fill((channel+"Eff_").c_str(), idx+0.5, 1./evts*(acceptHLT(event, triggerTable, selectionPath(labels[idx]))-value)); - } - } - } - -} - -#include - -#include "DQM/Physics/interface/TopDQMHelpers.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/ServiceRegistry/interface/Service.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -#include "FWCore/Common/interface/TriggerNames.h" -#include "DataFormats/BeamSpot/interface/BeamSpot.h" -#include "DataFormats/VertexReco/interface/Vertex.h" -#include "DataFormats/Common/interface/TriggerResults.h" - -/** - \class TopHLTSingleLeptonDQM TopHLTSingleLeptonDQM.h "DQM/Physics/plugins/TopHLTSingleLeptonDQM.h" - - \brief Module to apply a monitored selection of top like events in the semi-leptonic channel - - Plugin to apply a monitored selection of top like events with some minimal flexibility - in the number and definition of the selection steps. To achieve this flexibility it - employes the SelectionStep class. The MonitorEnsemble class is used to provide a well - defined set of histograms to be monitored after each selection step. The SelectionStep - class provides a flexible and intuitive selection via the StringCutParser. SelectionStep - and MonitorEnsemble classes are interleaved. The monitoring starts after a preselection - step (which is not monitored in the context of this module) with an instance of the - MonitorEnsemble class. The following objects are supported for selection: - - - jets : of type reco::Jet (jets), reco::CaloJet (jets/calo) or reco::PFJet (jets/pflow) - - elecs : of type reco::GsfElectron - - muons : of type reco::Muon - - met : of type reco::MET - - These types have to be present as prefix of the selection step paramter _label_ separated - from the rest of the label by a ':' (e.g. in the form "jets:step0"). The class expects - selection labels of this type. They will be disentangled by the private helper functions - _objectType_ and _seletionStep_ as declared below. -*/ - -/// define MonitorEnsembple to be used -//using TopHLTSingleLepton::MonitorEnsemble; - -class TopHLTSingleLeptonDQM : public edm::EDAnalyzer { - public: - /// default constructor - TopHLTSingleLeptonDQM(const edm::ParameterSet& cfg); - /// default destructor - ~TopHLTSingleLeptonDQM(){ - if( vertexSelect_ ) delete vertexSelect_; - if( beamspotSelect_ ) delete beamspotSelect_; - }; - - /// do this during the event loop - virtual void analyze(const edm::Event& event, const edm::EventSetup& setup); - - private: - /// deduce object type from ParameterSet label, the label - /// is expected to be of type 'objectType:selectionStep' - std::string objectType(const std::string& label) { return label.substr(0, label.find(':')); }; - /// deduce selection step from ParameterSet label, the - /// label is expected to be of type 'objectType:selectionStep' - std::string selectionStep(const std::string& label) { return label.substr(label.find(':')+1); }; - - private: - /// trigger table - edm::InputTag triggerTable_; - /// trigger paths - std::vector triggerPaths_; - /// primary vertex - edm::InputTag vertex_; - /// string cut selector - StringCutObjectSelector* vertexSelect_; - - /// beamspot - edm::InputTag beamspot_; - /// string cut selector - StringCutObjectSelector* beamspotSelect_; - - /// needed to guarantee the selection order as defined by the order of - /// ParameterSets in the _selection_ vector as defined in the config - std::vector selectionOrder_; - /// this is the heart component of the plugin; std::string keeps a label - /// the selection step for later identification, edm::ParameterSet keeps - /// the configuration of the selection for the SelectionStep class, - /// MonitoringEnsemble keeps an instance of the MonitorEnsemble class to - /// be filled _after_ each selection step - std::map > selection_; - - std::vector metsTemp_; - - edm::EDGetTokenT< edm::View > muonsToken_; - edm::EDGetTokenT< edm::View > elecsToken_; - edm::EDGetTokenT< edm::View > jetsToken_; - - edm::EDGetTokenT< edm::ValueMap > electronIdToken_; - edm::EDGetTokenT jetIDToken_; - - edm::EDGetTokenT triggerTableToken_; - edm::EDGetTokenT< std::vector > vertexToken_; - edm::EDGetTokenT< edm::View > pvsToken_; - edm::EDGetTokenT beamspotToken_; - - edm::EDGetTokenT btagEffToken_, btagPurToken_, btagVtxToken_; - - std::vector< edm::EDGetTokenT< edm::View > > metsTokens_; -}; - -#endif diff --git a/HLTriggerOffline/Top/src/TopSingleLeptonHLTValidation.cc b/HLTriggerOffline/Top/src/TopSingleLeptonHLTValidation.cc new file mode 100644 index 0000000000000..69d399eb3e0d2 --- /dev/null +++ b/HLTriggerOffline/Top/src/TopSingleLeptonHLTValidation.cc @@ -0,0 +1,235 @@ +// -*- C++ -*- +// +// Package: HLTriggerOffline/Top +// Class: TopSingleLeptonHLTValidation +// +/**\class TopSingleLeptonHLTValidation TopSingleLeptonHLTValidation.cc HLTriggerOffline/Top/src/TopSingleLeptonHLTValidation.cc + +Description: + + Description: compute efficiencies of trigger paths on offline reco selection with respect to pt and eta + +Implementation: + harvesting +*/ +// +// Original Author: Elvire Bouvier +// Created: Thu, 16 Jan 2014 16:27:35 GMT +// +// +#include "HLTriggerOffline/Top/interface/TopSingleLeptonHLTValidation.h" + +// system include files +#include + +// user include files +#include "FWCore/Framework/interface/Frameworkfwd.h" + +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/MakerMacros.h" + +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ServiceRegistry/interface/Service.h" + +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "HLTrigger/HLTcore/interface/HLTConfigProvider.h" +#include "FWCore/Common/interface/TriggerNames.h" +#include "TString.h" +#include "DataFormats/MuonReco/interface/MuonPFIsolation.h" +// +// member functions +// + +// ------------ method called for each event ------------ + void +TopSingleLeptonHLTValidation::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) +{ + using namespace edm; + + isAll_ = false; isSel_ = false; + + // Electrons + Handle< edm::View > electrons; + iEvent.getByToken(tokElectrons_,electrons); + unsigned int nGoodE = 0; + for(edm::View::const_iterator e = electrons->begin(); e != electrons->end(); ++e){ + if (e->pt() < ptElectrons_) continue; + if (fabs(e->eta()) > etaElectrons_) continue; + if ((e->dr03TkSumPt()+e->dr03EcalRecHitSumEt()+e->dr03HcalTowerSumEt())/e->pt() > isoElectrons_ ) continue; + nGoodE++; + if (nGoodE == 1) elec_ = &(*e); + } + // Muons + Handle< edm::View > muons; + iEvent.getByToken(tokMuons_,muons); + unsigned int nGoodM = 0; + for(edm::View::const_iterator m = muons->begin(); m != muons->end(); ++m){ + if (!m->isPFMuon() || !m->isGlobalMuon()) continue; + if (m->pt() < ptMuons_) continue; + if (fabs(m->eta()) > etaMuons_) continue; + if (((m->pfIsolationR04()).sumChargedHadronPt+(m->pfIsolationR04()).sumPhotonEt+(m->pfIsolationR04()).sumNeutralHadronEt)/m->pt() > isoMuons_ ) continue; + nGoodM++; + if (nGoodM == 1) mu_ = &(*m); + } + // Jets + Handle< edm::View > jets; + iEvent.getByToken(tokJets_,jets); + unsigned int nGoodJ = 0; + if (minJets_ == 4) { + for(edm::View::const_iterator j = jets->begin(); j != jets->end(); ++j){ + if (nGoodJ < 1 && j->pt() < 55) continue; + if (nGoodJ < 2 && j->pt() < 45) continue; + if (nGoodJ < 3 && j->pt() < 35) continue; + if (nGoodJ >= 3 && j->pt() < 20) continue; + if (fabs(j->eta()) > etaJets_) continue; + nGoodJ++; + if (nGoodJ == minJets_) jet_ = &(*j); + } + } + else { + for(edm::View::const_iterator j = jets->begin(); j != jets->end(); ++j){ + if (j->pt() < ptJets_) continue; + if (fabs(j->eta()) > etaJets_) continue; + nGoodJ++; + if (nGoodJ == minJets_) jet_ = &(*j); + } + } + + if (nGoodE >= minElectrons_ && nGoodM >= minMuons_ && nGoodJ >= minJets_) isAll_ = true; + + //Trigger + Handle triggerTable; + iEvent.getByToken(tokTrigger_,triggerTable); + const edm::TriggerNames& triggerNames = iEvent.triggerNames(*triggerTable); + for (unsigned int i=0; i 0) { + hDenLeptonPt->Fill(elec_->pt()); + hDenLeptonEta->Fill(elec_->eta()); + } + if (minMuons_ > 0) { + hDenLeptonPt->Fill(mu_->pt()); + hDenLeptonEta->Fill(mu_->eta()); + } + hDenJetPt->Fill(jet_->pt()); + hDenJetEta->Fill(jet_->eta()); + } + if (isSel_) { + if (minElectrons_ > 0) { + hNumLeptonPt->Fill(elec_->pt()); + hNumLeptonEta->Fill(elec_->eta()); + } + if (minMuons_ > 0) { + hNumLeptonPt->Fill(mu_->pt()); + hNumLeptonEta->Fill(mu_->eta()); + } + hNumJetPt->Fill(jet_->pt()); + hNumJetEta->Fill(jet_->eta()); + } + } +} + + +// ------------ method called once each job just before starting event loop ------------ + void +TopSingleLeptonHLTValidation::beginJob() +{ +} + +// ------------ method called once each job just after ending the event loop ------------ + void +TopSingleLeptonHLTValidation::endJob() +{ +} + +// ------------ method called when starting to processes a run ------------ +/* + void + TopSingleLeptonHLTValidation::beginRun(edm::Run const&, edm::EventSetup const&) + { + } + */ + +// ------------ method called when ending the processing of a run ------------ + + void +TopSingleLeptonHLTValidation::endRun(edm::Run const&, edm::EventSetup const&) +{ + dbe_->setCurrentFolder(sDir_); + hEffLeptonPt = dbe_->book1D("EfficiencyVsPtLepton", "EfficiencyVsPtLepton", 50, 0., 250.); + hEffLeptonEta = dbe_->book1D("EfficiencyVsEtaLepton", "EfficiencyVsEtaLepton", 30, -3. , 3.); + hEffJetPt = dbe_->book1D("EfficiencyVsPtLastJet", "EfficiencyVsPtLastJet", 60, 0., 300.); + hEffJetEta = dbe_->book1D("EfficiencyVsEtaLastJet", "EfficiencyVsEtaLastJet", 30, -3., 3.); + + //------ Efficiency wrt + // lepton pt + for (int iBin = 1; iBin <= hNumLeptonPt->GetNbinsX(); ++iBin) + { + if(hDenLeptonPt->GetBinContent(iBin) == 0) + hEffLeptonPt->setBinContent(iBin, 0.); + else + hEffLeptonPt->setBinContent(iBin, hNumLeptonPt->GetBinContent(iBin) / hDenLeptonPt->GetBinContent(iBin)); + } + // lepton eta + for (int iBin = 1; iBin <= hNumLeptonEta->GetNbinsX(); ++iBin) + { + if(hDenLeptonEta->GetBinContent(iBin) == 0) + hEffLeptonEta->setBinContent(iBin, 0.); + else + hEffLeptonEta->setBinContent(iBin, hNumLeptonEta->GetBinContent(iBin) / hDenLeptonEta->GetBinContent(iBin)); + } + // jet pt + for (int iBin = 1; iBin <= hNumJetPt->GetNbinsX(); ++iBin) + { + if(hDenJetPt->GetBinContent(iBin) == 0) + hEffJetPt->setBinContent(iBin, 0.); + else + hEffJetPt->setBinContent(iBin, hNumJetPt->GetBinContent(iBin) / hDenJetPt->GetBinContent(iBin)); + } + // jet eta + for (int iBin = 1; iBin <= hNumJetEta->GetNbinsX(); ++iBin) + { + if(hDenJetEta->GetBinContent(iBin) == 0) + hEffJetEta->setBinContent(iBin, 0.); + else + hEffJetEta->setBinContent(iBin, hNumJetEta->GetBinContent(iBin) / hDenJetEta->GetBinContent(iBin)); + } +} + + +// ------------ method called when starting to processes a luminosity block ------------ +/* + void + TopSingleLeptonHLTValidation::beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) + { + } + */ + +// ------------ method called when ending the processing of a luminosity block ------------ +/* + void + TopSingleLeptonHLTValidation::endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) + { + } + */ + +// ------------ method fills 'descriptions' with the allowed parameters for the module ------------ +void +TopSingleLeptonHLTValidation::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + //The following says we do not know what parameters are allowed so do no validation + // Please change this to state exactly what you do use, even if it is no parameters + edm::ParameterSetDescription desc; + desc.setUnknown(); + descriptions.addDefault(desc); +} + diff --git a/HLTriggerOffline/Top/src/TopValidation.cc b/HLTriggerOffline/Top/src/TopValidation.cc deleted file mode 100644 index 482cb55da7767..0000000000000 --- a/HLTriggerOffline/Top/src/TopValidation.cc +++ /dev/null @@ -1,859 +0,0 @@ -// -*- C++ -*- -// -// Package: TopValidation -// Class: TopValidation -// -/**\class TopValidation TopValidation.cc DQM/TopValidation/src/TopValidation.cc - - Description: - - Implementation: - -*/ -// -// Original Author: Patricia LOBELLE PARDO () -// Created: Tue Sep 23 11:06:32 CEST 2008 -// -// - - -# include "HLTriggerOffline/Top/interface/TopValidation.h" -#include "FWCore/Common/interface/TriggerNames.h" - - - -TopValidation::TopValidation(const edm::ParameterSet& iConfig) - -{ - - - inputTag_ = iConfig.getParameter("TriggerResultsCollection"); - hlt_bitnames = iConfig.getParameter >("hltPaths"); - hlt_bitnamesMu = iConfig.getParameter >("hltMuonPaths"); - hlt_bitnamesEg = iConfig.getParameter >("hltEgPaths"); - hlt_bitnamesJet = iConfig.getParameter >("hltJetPaths"); - // triggerTag_ = iConfig.getUntrackedParameter("DQMFolder","HLT/Top"); - outputFileName = iConfig.getParameter("OutputFileName"); - outputMEsInRootFile = iConfig.getParameter("OutputMEsInRootFile"); - FolderName_ = iConfig.getParameter("FolderName"); - offlineElectrons = iConfig.getParameter("offlineElectrons"); - - topFolder << FolderName_ ; - - muonsToken_ = consumes(std::string("muons")); - ctfWithMaterialTracksToken_ = consumes(std::string("ctfWithMaterialTracks")); - iterativeCone5CaloJetsToken_ = consumes(std::string("iterativeCone5CaloJets")); - offlineElectronsToken_ = consumes(iConfig.getParameter("offlineElectrons")); - inputTagToken_ = consumes(iConfig.getParameter("TriggerResultsCollection")); - genParticlesToken_ = consumes(std::string("genParticles")); - -} - - -TopValidation::~TopValidation() -{ - - // do anything here that needs to be done at desctruction time - // (e.g. close files, deallocate resources etc.) - -} - - -// -// member functions -// - - -// ------------ method called to for each event ------------ -void -TopValidation::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) -{ - using namespace edm; - - - // muon collection - Handle muonsH; - iEvent.getByToken(muonsToken_, muonsH); - - // tracks collection - Handle tracks; - iEvent.getByToken(ctfWithMaterialTracksToken_, tracks); - - - // get calo jet collection - Handle jetsHandle; - iEvent.getByToken(iterativeCone5CaloJetsToken_, jetsHandle); - - - // electron collection - Handle electronsH; - iEvent.getByToken(offlineElectronsToken_,electronsH); - - // Trigger - Handle trh; - iEvent.getByToken(inputTagToken_,trh); - if( ! trh.isValid() ) { - LogDebug("") << "HL TriggerResults with label ["+inputTag_.encode()+"] not found!"; - return; - } - - - - const edm::TriggerNames & triggerNames = iEvent.triggerNames(*trh); - - ////////////////////////////////// - // generation info - ///////////////////////////////// - - //bool topevent = false; - - int ntop = 0; - int ngenel = 0; - int ngenmu = 0; - int ngentau = 0; - int ngenlep = 0; - int nmuaccept= 0; - int nelaccept= 0; - - // Gen Particles Collection - Handle genParticles; - iEvent.getByToken(genParticlesToken_, genParticles); - - for (size_t i=0; i < genParticles->size(); ++i){ - const reco::Candidate & p = (*genParticles)[i]; - int id = p.pdgId(); - int st = p.status(); - - if (abs(id) == 6 && st == 3) ntop++; - - if (st==3 && abs(id)==11) { - ngenel++; - if ( p.pt()>10 && fabs(p.eta())<2.4) nelaccept++; - } - - if (st==3 && abs(id)==13) { - ngenmu++; - if ( p.pt()>10 && fabs(p.eta())<2.4) nmuaccept++; - } - - if (st==3 && abs(id)==15) ngentau++; - if (st==3 && ( abs(id)==11 || abs(id)==13 || abs(id)==15)) ngenlep++; - - } - - // if (ntop == 2) topevent = true; - - - - // if (topevent){ - - //////////////////////////// - //////// Muons - ///////////////////////////////// - - //Muon Collection to use - std::map muonMap; - - for (size_t i = 0; i< muonsH->size(); ++i){ - if ( (*muonsH)[i].isGlobalMuon() && (*muonsH)[i].pt()>15 && fabs((*muonsH)[i].eta())<2.1){ - muonMap[(*muonsH)[i].pt()] = (*muonsH)[i]; - } - } - - //Muon selection - bool TwoMuonsAccepted = false; - - std::vector selected_muons; - reco::Muon muon1,muon2; - - for( std::map::reverse_iterator rit=muonMap.rbegin(); rit!=muonMap.rend(); ++rit){ - selected_muons.push_back( (*rit).second ); - } - - if (selected_muons.size()==1) muon1 = selected_muons[0]; - - if (selected_muons.size()>1){ - muon1 = selected_muons[0]; - muon2 = selected_muons[1]; - } - - - if( selected_muons.size()>1 && muon1.pt() >20 && muon1.charge()*muon2.charge()<0 ) TwoMuonsAccepted = true; - - - ////////////////////////////////// - ///////// Electrons - /////////////////////////////////////// - - //Electron Collection to use - std::map electronMap; - - for (size_t i = 0; isize();++i){ - if( (*electronsH)[i].pt()>15 && fabs( (*electronsH)[i].eta() )<2.4) { - electronMap[(*electronsH)[i].pt()] = (*electronsH)[i]; - } - } - - //Electron selection - bool TwoElectronsAccepted = false; - - std::vector selected_electrons; - reco::GsfElectron electron1, electron2; - - for( std::map::reverse_iterator rit=electronMap.rbegin(); rit!=electronMap.rend(); ++rit){ - selected_electrons.push_back( (*rit).second ); - } - - if (selected_electrons.size()==1) electron1 = selected_electrons[0]; - - if (selected_electrons.size()>1){ - - electron1 = selected_electrons[0]; - electron2 = selected_electrons[1]; - } - - - if( selected_electrons.size()>1 && electron1.pt() >20 && electron1.charge()*electron2.charge()<0 ) TwoElectronsAccepted = true; - - - - ///////////////////////////////// - ////////// Jets - ///////////////////////////////// - - //Jet Collection to use - - // Raw jets - const reco::CaloJetCollection *jets = jetsHandle.product(); - reco::CaloJetCollection::const_iterator jet; - - int n_jets_20=0; - - for (jet = jets->begin(); jet != jets->end(); jet++){ - // if (fabs(jet->eta()) <2.4 && jet->et() > 20) n_jets_20++; - // if (fabs(jet->eta()) <2.4 && jet->et() > 13) n_jets_20++; - if (fabs(jet->eta()) <2.4 && jet->et() > 13) n_jets_20++; - } - - -//// sort jets by et - /* std::map jetMap; - - for (size_t i = 0; isize();++i){ - if ((*jetsHandle)[i].et()>13 && fabs( (*jetsHandle)[i].eta())<2.4){ - - - jetMap[(*jetsHandle)[i].et()] = (*jetsHandle)[i]; - } - } - - std::vector selected_jets; - reco::CaloJet jet1, jet2; - - for( std::map::reverse_iterator rit=jetMap.rbegin(); rit!=jetMap.rend(); ++rit){ - selected_jets.push_back( (*rit).second ); - } - - if (selected_jets.size()>1){ - jet1 = selected_jets[0]; - jet2 = selected_jets[1]; - } - -*/ - -////////////////////////////////////////////////////////// -///// -//// "Offline" selection -///// -///////////////////////////////////////////////// - - - - bool offline_mu = false; - bool offline_dimu = false; - bool offline_el = false; - bool offline_diel = false; - bool offline_emu = false; - - - if ( selected_muons.size()>0 && muon1.pt()>20 && n_jets_20>1) offline_mu=true; - if ( TwoMuonsAccepted && n_jets_20>1) offline_dimu=true; - if ( selected_electrons.size()>0 && electron1.pt()>20 && n_jets_20>1) offline_el=true; - if ( TwoElectronsAccepted && n_jets_20>1) offline_diel=true; - if ( selected_muons.size()>0 && selected_electrons.size()>0 && (muon1.pt()>20 || electron1.pt()>20) && (muon1.charge()!= electron1.charge()) && n_jets_20>1) offline_emu=true; - - - - - ////////////////////////////// - // store fired bits - /////////////////////////////// - - int wtrig_[100] ={0}; - int wtrig_m[100] ={0}; - int wtrig_eg[100]={0}; - int wtrig_jet[100]={0}; - - bool HLTQuadJet30 = false; - bool HLTMu9 = false; - - - int n_hlt_bits = hlt_bitnames.size(); - int n_hlt_bits_mu = hlt_bitnamesMu.size(); - int n_hlt_bits_eg = hlt_bitnamesEg.size(); - int n_hlt_bits_jet= hlt_bitnamesJet.size(); - - const unsigned int n_TriggerResults( trh.product()->size()); - - for (unsigned int itrig=0; itrig< n_TriggerResults; ++itrig) { - - /////////// - if (triggerNames.triggerName(itrig) == "HLT_QuadJet30"){ - if ( trh.product()->accept( itrig ) ) HLTQuadJet30=true; - } - if (triggerNames.triggerName(itrig) == "HLT_Mu9"){ - if ( trh.product()->accept( itrig ) ) HLTMu9=true; - } - ////////////////// - if (trh.product()->accept(itrig)) { - - for (int i=0;iFill(1,1); - if (ngenlep==1 && ngenmu==1) events_acc_off_muon->Fill(2,1); - events_acc_off_electron->Fill(1,1); - if (ngenlep==1 && ngenel==1) events_acc_off_electron->Fill(2,1); - - /// **** tt->munubjjb ***** - - - - if ( ngenlep==1 && ngenmu==1 && nmuaccept==1){ //Select events within acceptance - - events_acc_off_muon->Fill(3,1); - - for (int j=0;jFill(j+1); - if (wtrig_m[j]==1) { - hlt_bitmu_hist_gen->Fill(j+1); - } - } - - for (int it=0; itFill(it+1); - if (wtrig_jet[it]==1) { - hlt_bitjet_hist_gen->Fill(it+1); - } - } - - - // Efficiencies wrt MC + offline - if (offline_mu){ - - events_acc_off_muon->Fill(4,1); - - // et_off_jet_mu -> Fill(jet1.et()); - // eta_off_jet_mu-> Fill(jet1.eta()); - - for (int it=0; itFill(it+1); - if (wtrig_jet[it]==1) { - hlt_bitjet_hist_reco->Fill(it+1); - // h_etjet1_trig_mu[it]->Fill(jet1.et()); - // h_etajet1_trig_mu[it]->Fill(jet1.eta()); - - - } - - } - - eta_off_mu->Fill(muon1.eta()); - pt_off_mu-> Fill(muon1.pt()); - - for (int j=0;jFill(j+1); - if (wtrig_m[j]==1) { - h_ptmu1_trig[j]->Fill(muon1.pt()); - h_etamu1_trig[j]->Fill(muon1.eta()); - hlt_bitmu_hist_reco->Fill(j+1); - } - } - - } - } - - - -///////// 4jets+1muon efficiency monitoring - - if (HLTQuadJet30){ // events firing the 4jet30 trigger - - if (offline_mu){ // events with 1 rec muon+ 2jets - - ptmuon_4jet1muSel->Fill(muon1.pt()); - etamuon_4jet1muSel->Fill(muon1.eta()); - Njets_4jet1muSel->Fill(n_jets_20); - - if (HLTMu9){ - - ptmuon_4jet1muSel_hltmu9->Fill(muon1.pt()); - etamuon_4jet1muSel_hltmu9->Fill(muon1.eta()); - Njets_4jet1muSel_hltmu9->Fill(n_jets_20); - } - } - } - - -//////////////////////////// - - - // ***** tt->enubjjb ***** - if ( ngenlep==1 && ngenel==1 && nelaccept==1){ - - events_acc_off_electron->Fill(3,1); - - for (int j=0;jFill(j+1); - if (wtrig_eg[j]==1) { - hlt_bitel_hist_gen->Fill(j+1); - } - } - - for (int it=0; itFill(it+1); - if (wtrig_jet[it]==1) { - hlt_bitjet_hist_gen_el->Fill(it+1); - } - } - - // Efficiencies wrt mc + offline - if (offline_el){ - - events_acc_off_electron->Fill(4,1); - - /*/// jets - et_off_jet_el -> Fill(jet1.et()); - eta_off_jet_el-> Fill(jet1.eta());*/ - - for (int it=0; itFill(it+1); - if (wtrig_jet[it]==1) { - hlt_bitjet_hist_reco_el->Fill(it+1); - // h_etjet1_trig_el[it]->Fill(jet1.et()); - // h_etajet1_trig_el[it]->Fill(jet1.eta()); - } - - } - - - /// - eta_off_el->Fill(electron1.eta()); - pt_off_el->Fill(electron1.pt()); - - for (int k=0;kFill(k+1); - - if (wtrig_eg[k]==1) { - h_ptel1_trig[k]->Fill(electron1.pt()); - h_etael1_trig[k]->Fill(electron1.eta()); - hlt_bitel_hist_reco->Fill(k+1); - } - } - - } - } - - - - // ****** tt->munubmunub ***** - if ( ngenlep==2 && ngenmu==2 && nmuaccept==2){ - - - // Efficiencies wrt mc+offline - if (offline_dimu){ - - eta_off_dimu1->Fill(muon1.eta()); - eta_off_dimu2->Fill(muon2.eta()); - pt_off_dimu1->Fill(muon1.pt()); - pt_off_dimu2->Fill(muon2.pt()); - - for (int j=0;jFill(muon1.pt()); - h_etamu1_trig_dimu[j]->Fill(muon1.eta()); - } - } - } - } - - - - // ***** tt->enubenub ***** - if ( ngenlep==2 && ngenel==2 && nelaccept==2){ - - - // Efficiencies wrt mc+offline - if (offline_diel){ - - eta_off_diel1->Fill(electron1.eta()); - eta_off_diel2->Fill(electron2.eta()); - pt_off_diel1->Fill(electron1.pt()); - pt_off_diel2->Fill(electron2.pt()); - - for (int k=0;kFill(electron1.pt()); - h_etael1_trig_diel[k]->Fill(electron1.eta()); - } - } - - } - } - - - // ***** tt->enubmunub - if ( ngenlep==2 && ngenel==1 && ngenmu==1 && nmuaccept==1 && nelaccept==1){ // tt->e mu events passing acceptance - - - // Efficiencies wrt mc+offline - if (offline_emu){ - - eta_off_emu_muon->Fill(muon1.eta()); - pt_off_emu_muon->Fill(muon1.pt()); - eta_off_emu_electron->Fill(electron1.eta()); - pt_off_emu_electron->Fill(electron1.pt()); - - for (int i=0;iFill(electron1.pt()); - h_etael1_trig_em[i]->Fill(electron1.eta()); - h_ptmu1_trig_em[i]->Fill(muon1.pt()); - h_etamu1_trig_em[i]->Fill(muon1.eta()); - } - } - - } - } - - - //////////////////////////////////////////////////////////////// - //} - -} - - - -// ------------ method called once each job just before starting event loop ------------ -void -TopValidation::beginJob() -{ - - dbe = edm::Service().operator->(); - - //dbe->setCurrentFolder("HLT/Top"); - //dbe->setCurrentFolder(triggerTag_); - - - - - //////////////////////////////////////////// - ////// histos lepton pt, eta for events passing hlt, efficiencies - ///////////////////////////////////////////// - - - dbe->setCurrentFolder(topFolder.str()+"Semileptonic_muon"); - - hlt_bitmu_hist_reco = dbe->book1D("muHLT","muHLT",hlt_bitnamesMu.size(),0.5,hlt_bitnamesMu.size()+0.5); - h_mu_reco = dbe->book1D("MuonEvents","MuonEvents",hlt_bitnamesMu.size(),0.5,hlt_bitnamesMu.size()+0.5); - - hlt_bitmu_hist_gen = dbe->book1D("genmuHLT","genmuHLT",hlt_bitnamesMu.size(),0.5,hlt_bitnamesMu.size()+0.5); - h_mu_gen = dbe->book1D("genMuonEvents","genMuonEvents",hlt_bitnamesMu.size(),0.5,hlt_bitnamesMu.size()+0.5); - - events_acc_off_muon = dbe->book1D("NEvents_acc_off","NEvents_acc_off",4,0.5,4.5); - events_acc_off_muon -> setBinLabel(1,"Total Events"); - events_acc_off_muon -> setBinLabel(2,"Gen semimuon"); - events_acc_off_muon -> setBinLabel(3,"Acceptance"); - events_acc_off_muon -> setBinLabel(4,"Acceptance+offline"); - - - dbe->setCurrentFolder(topFolder.str()+"Semileptonic_electron"); - - hlt_bitel_hist_reco = dbe->book1D("elHLT","elHLT",hlt_bitnamesEg.size(),0.5,hlt_bitnamesEg.size()+0.5); - h_el_reco = dbe->book1D("ElectronEvents","ElectronEvents",hlt_bitnamesEg.size(),0.5,hlt_bitnamesEg.size()+0.5); - - - hlt_bitel_hist_gen = dbe->book1D("genelHLT","genelHLT",hlt_bitnamesEg.size(),0.5,hlt_bitnamesEg.size()+0.5); - h_el_gen = dbe->book1D("genElectronEvents","genElectronEvents",hlt_bitnamesEg.size(),0.5,hlt_bitnamesEg.size()+0.5); - - - events_acc_off_electron = dbe->book1D("NEvents_acc_off","NEvents_acc_off",4,0.5,4.5); - events_acc_off_electron -> setBinLabel(1,"Total Events"); - events_acc_off_electron -> setBinLabel(2,"Gen semielectron"); - events_acc_off_electron -> setBinLabel(3,"Acceptance"); - events_acc_off_electron -> setBinLabel(4,"Acceptance+offline"); - - - dbe->setCurrentFolder(topFolder.str()+"Jets"); - - h_jet_reco = dbe->book1D("denom","denom",hlt_bitnamesJet.size(),0.5,hlt_bitnamesJet.size()+0.5); - hlt_bitjet_hist_reco = dbe->book1D("numer","numer",hlt_bitnamesJet.size(),0.5,hlt_bitnamesJet.size()+0.5); - - h_jet_reco_el = dbe->book1D("denom_el","denom_el",hlt_bitnamesJet.size(),0.5,hlt_bitnamesJet.size()+0.5); - hlt_bitjet_hist_reco_el = dbe->book1D("numer_el","numer_el",hlt_bitnamesJet.size(),0.5,hlt_bitnamesJet.size()+0.5); - - /// - h_jet_gen = dbe->book1D("denom_gen","denom_gen",hlt_bitnamesJet.size(),0.5,hlt_bitnamesJet.size()+0.5); - hlt_bitjet_hist_gen = dbe->book1D("numer_gen","numer_gen",hlt_bitnamesJet.size(),0.5,hlt_bitnamesJet.size()+0.5); - - h_jet_gen_el = dbe->book1D("denom_el_gen","denom_el_gen",hlt_bitnamesJet.size(),0.5,hlt_bitnamesJet.size()+0.5); - hlt_bitjet_hist_gen_el = dbe->book1D("numer_el_gen","numer_el_gen",hlt_bitnamesJet.size(),0.5,hlt_bitnamesJet.size()+0.5); - - - ///////// - /* et_off_jet_mu = dbe->book1D ("Jet1Et_M","Jet1Et_M",51,0.0,150.0); - et_off_jet_el = dbe->book1D ("Jet1Et_E","Jet1Et_E",51,0.0,150.0); - eta_off_jet_mu = dbe->book1D ("Jet1Eta_M","Jet1Eta_M",51,-2.5,2.5); - eta_off_jet_el = dbe->book1D ("Jet1Eta_E","Jet1Eta_E",51,-2.5,2.5); - njets_off_mu = dbe->book1D ("NJets_M","NJets_M",11,-0.5,10.5); - njets_off_el = dbe->book1D ("NJets_E","NJets_E",11,-0.5,10.5); - - - - - for (size_t j=0;j setBinLabel(j+1,hlt_bitnamesJet[j].c_str()); - h_jet_reco -> setBinLabel(j+1,hlt_bitnamesJet[j].c_str()); - h_jet_reco_el -> setBinLabel(j+1,hlt_bitnamesJet[j].c_str()); - h_etjet1_trig_mu[j] = dbe->book1D((histname_etjet).c_str(),(hlt_bitnamesJet[j]+"jetEt_M").c_str(),51,0.0,150.); - h_etjet1_trig_el[j] = dbe->book1D((histname_etjet_el).c_str(),(hlt_bitnamesJet[j]+"jetEt_E").c_str(),51,0.0,150.); - h_etajet1_trig_mu[j] = dbe->book1D((histname_etajet).c_str(),(hlt_bitnamesJet[j]+"jetEta_M").c_str(),51,-2.5,2.5); - h_etajet1_trig_el[j] = dbe->book1D((histname_etajet_el).c_str(),(hlt_bitnamesJet[j]+"jetEta_E").c_str(),51,-2.5,2.5); - - - } - */ - - - - dbe->setCurrentFolder(topFolder.str()+"Dileptonic_emu"); - - - for (size_t j=0;jbook1D((histname_ptmu_em).c_str(),(hlt_bitnames[j]+"_muonPt_EM").c_str(),40,0.0,150.); - h_etamu1_trig_em[j] = dbe->book1D((histname_etamu_em).c_str(),(hlt_bitnames[j]+"_muonEta_EM").c_str(),51,-2.5,2.5); - - h_ptel1_trig_em[j] = dbe->book1D((histname_ptel_em).c_str(),(hlt_bitnames[j]+"_electronPt_EM").c_str(),40,0.0,150.); - h_etael1_trig_em[j] = dbe->book1D((histname_etael_em).c_str(),(hlt_bitnames[j]+"_electronEta_EM").c_str(),51,-2.5,2.5); - - } - - - - - for (size_t jj=0;jjsetCurrentFolder(topFolder.str()+"Semileptonic_muon"); - h_ptmu1_trig[jj] = dbe->book1D((histname_ptmu).c_str(),(hlt_bitnamesMu[jj]+"muonPt_M").c_str(),40,0.0,150.); - h_etamu1_trig[jj] = dbe->book1D((histname_etamu).c_str(),(hlt_bitnamesMu[jj]+"muonEta_M").c_str(),51,-2.5,2.5); - - hlt_bitmu_hist_reco -> setBinLabel(jj+1,hlt_bitnamesMu[jj].c_str()); - h_mu_reco -> setBinLabel(jj+1,hlt_bitnamesMu[jj].c_str()); - - hlt_bitmu_hist_gen -> setBinLabel(jj+1,hlt_bitnamesMu[jj].c_str()); - h_mu_gen -> setBinLabel(jj+1,hlt_bitnamesMu[jj].c_str()); - - dbe->setCurrentFolder(topFolder.str()+"Dileptonic_muon"); - h_ptmu1_trig_dimu[jj] = dbe->book1D((histname_ptmu_dimu).c_str(),(hlt_bitnamesMu[jj]+"muon1Pt_MM").c_str(),40,0.0,150.); - h_etamu1_trig_dimu[jj] = dbe->book1D((histname_etamu_dimu).c_str(),(hlt_bitnamesMu[jj]+"muon1Pt_MM").c_str(),51,-2.5,2.5); - - - - - } - - - - - - - for (size_t k=0;ksetCurrentFolder(topFolder.str()+"Semileptonic_electron"); - - h_ptel1_trig[k] = dbe->book1D((histname_ptel).c_str(),(hlt_bitnamesEg[k]+"electronPt_E").c_str(),40,0.0,150.); - h_etael1_trig[k] = dbe->book1D((histname_etael).c_str(),(hlt_bitnamesEg[k]+"electronEta_E").c_str(),51,-2.5,2.5); - - hlt_bitel_hist_reco -> setBinLabel(k+1,hlt_bitnamesEg[k].c_str()); - h_el_reco -> setBinLabel(k+1,hlt_bitnamesEg[k].c_str()); - - hlt_bitel_hist_gen -> setBinLabel(k+1,hlt_bitnamesEg[k].c_str()); - h_el_gen -> setBinLabel(k+1,hlt_bitnamesEg[k].c_str()); - - - dbe->setCurrentFolder(topFolder.str()+"Dileptonic_electron"); - h_ptel1_trig_diel[k] = dbe->book1D((histname_ptel_diel).c_str(),(hlt_bitnamesEg[k]+"electron1Pt_EE").c_str(),40,0.0,150.); - h_etael1_trig_diel[k] = dbe->book1D((histname_etael_diel).c_str(),(hlt_bitnamesEg[k]+"electron1Eta_EE").c_str(),51,-2.5,2.5); - - - - - - } - - - -///////////////////////////////////////// -/// histos lepton pt, eta -//////////////////////////////////////////7 - - - // 4 jets+1mu eff monitoring - - dbe->setCurrentFolder(topFolder.str()+"4JetsPlus1MuonToCompareWithData"); - - ptmuon_4jet1muSel = dbe->book1D ("Muon1Pt_4Jets1MuonMon", "Muon1Pt_4Jets1MuonMon",40, 0.0,150.0); - etamuon_4jet1muSel = dbe->book1D ("Muon1Eta_4Jets1MuonMon","Muon1Eta_4Jets1MuonMon",51, -2.5,2.5); - Njets_4jet1muSel = dbe->book1D ("NJets_4Jets1MuonMon", "NJets_4Jets1MuonMon",11, -0.5,10.5); - - ptmuon_4jet1muSel_hltmu9 = dbe->book1D ("Muon1Pt_4Jets1MuonHLTMu9Mon", "Muon1Pt_4Jets1MuonHLTMu9Mon",40, 0.0,150.0); - etamuon_4jet1muSel_hltmu9 = dbe->book1D ("Muon1Eta_4Jets1MuonHLTMu9Mon","Muon1Eta_4Jets1MuonHLTMu9Mon",51, -2.5,2.5); - Njets_4jet1muSel_hltmu9 = dbe->book1D ("NJets_4Jets1MuonHLTMu9Mon", "NJets_4Jets1MuonHLTMu9Mon",11, -0.5,10.5); - - - - //semimu events - dbe->setCurrentFolder(topFolder.str()+"Semileptonic_muon"); - - - - eta_off_mu = dbe->book1D ("Muon1Eta_M","Muon1Eta_M",51,-2.5,2.5); - pt_off_mu = dbe->book1D ("Muon1Pt_M","Muon1Pt_M",40,0.0,150.0); - - - //semiel events - dbe->setCurrentFolder(topFolder.str()+"Semileptonic_electron"); - - eta_off_el = dbe->book1D ("Electron1Eta_E","Electron1Eta_E",51,-2.5,2.5); - pt_off_el = dbe->book1D ("Electron1Pt_E","Electron1Pt_E",40,0.0,150.0); - - - - //dimu events - dbe->setCurrentFolder(topFolder.str()+"Dileptonic_muon"); - - - eta_off_dimu1 = dbe->book1D ("Muon1Eta_MM","Muon1Eta_MM",51,-2.5,2.5); - pt_off_dimu1 = dbe->book1D ("Muon1Pt_MM","Muon1Pt_MM",40,0.0,150.0); - eta_off_dimu2 = dbe->book1D ("Muon2Eta_MM","Muon2Eta_MM",51,-2.5,2.5); - pt_off_dimu2 = dbe->book1D ("Muon2Pt_MM","Muon2Pt_MM",40,0.0,150.0); - - - - //diel events - dbe->setCurrentFolder(topFolder.str()+"Dileptonic_electron"); - - - eta_off_diel1 = dbe->book1D ("Electron1Eta_EE","Electron1Eta_EE",51,-2.5,2.5); - pt_off_diel1 = dbe->book1D ("Electron1Pt_EE","Electron1Pt_EE",40,0.0,150.0); - eta_off_diel2 = dbe->book1D ("Electron2Eta_EE","Electron2Eta_EE",51,-2.5,2.5); - pt_off_diel2 = dbe->book1D ("Electron2Pt_EE","Electron2Pt_EE",40,0.0,150.0); - - - //emu events - dbe->setCurrentFolder(topFolder.str()+"Dileptonic_emu"); - - - - eta_off_emu_muon = dbe->book1D ("Muon1Eta_EM","Muon1Eta_EM",51,-2.5,2.5); - pt_off_emu_muon = dbe->book1D ("Muon1Pt_EM","Muon1Pt_EM",40,0.0,150.0); - - eta_off_emu_electron = dbe->book1D ("Electron1Eta_EM","Electron1Eta_EM",51,-2.5,2.5); - pt_off_emu_electron = dbe->book1D ("Electron1Pt_EM","Electron1Pt_EM",40,0.0,150.0); - - - - - return ; - - -} - -// ------------ method called once each job just after ending the event loop ------------ -void -TopValidation::endJob() { -//Write DQM thing.. - // outFile_ = "prueba"; - //if(outFile_.size()>0) - - - // if (&*edm::Service()) edm::Service()->save (outFile_); - if(outputMEsInRootFile){ - dbe->showDirStructure(); - dbe->save(outputFileName); - } - - - - - - return ; -} - -//define this as a plug-in -//DEFINE_FWK_MODULE(TopValidation); diff --git a/HLTriggerOffline/Top/src/plugins.cc b/HLTriggerOffline/Top/src/plugins.cc deleted file mode 100644 index 37599d59910e7..0000000000000 --- a/HLTriggerOffline/Top/src/plugins.cc +++ /dev/null @@ -1,11 +0,0 @@ -#include "FWCore/PluginManager/interface/ModuleDef.h" -#include "FWCore/Framework/interface/MakerMacros.h" -#include "HLTriggerOffline/Top/interface/TopValidation.h" -#include "HLTriggerOffline/Top/src/TopHLTDiLeptonOfflineDQM.h" -#include "HLTriggerOffline/Top/src/TopHLTSingleLeptonDQM.h" -#include "HLTriggerOffline/Top/interface/HLTEfficiencyCalculator.h" - -DEFINE_FWK_MODULE(TopValidation); -DEFINE_FWK_MODULE(TopHLTDiLeptonOfflineDQM); -DEFINE_FWK_MODULE(TopHLTSingleLeptonDQM); -DEFINE_FWK_MODULE(HLTEffCalculator); From a87e9e6e177c3595bf59e5e88d8e82c805667369 Mon Sep 17 00:00:00 2001 From: Elvire Bouvier Date: Thu, 23 Jan 2014 19:35:46 +0100 Subject: [PATCH 17/26] dileptonic ttbar --- .../Top/interface/TopDiLeptonHLTValidation.h | 173 +++++++++++++ .../topDiLeptonHLTEventValidation_cfi.py | 79 ++++++ .../Top/python/topHLTValidation_cff.py | 11 +- .../Top/src/TopDiLeptonHLTValidation.cc | 241 ++++++++++++++++++ 4 files changed, 498 insertions(+), 6 deletions(-) create mode 100644 HLTriggerOffline/Top/interface/TopDiLeptonHLTValidation.h create mode 100644 HLTriggerOffline/Top/python/topDiLeptonHLTEventValidation_cfi.py create mode 100644 HLTriggerOffline/Top/src/TopDiLeptonHLTValidation.cc diff --git a/HLTriggerOffline/Top/interface/TopDiLeptonHLTValidation.h b/HLTriggerOffline/Top/interface/TopDiLeptonHLTValidation.h new file mode 100644 index 0000000000000..0d03be755be65 --- /dev/null +++ b/HLTriggerOffline/Top/interface/TopDiLeptonHLTValidation.h @@ -0,0 +1,173 @@ +// -*- C++ -*- +// +// Package: HLTriggerOffline/Top +// Class: TopDiLeptonHLTValidation +// +/**\class TopDiLeptonHLTValidation TopDiLeptonHLTValidation.h HLTriggerOffline/Top/TopDiLeptonHLTValidation.h + + Description: + + Description: compute efficiencies of trigger paths on offline reco selection with respect to pt and eta + + Implementation: + harvesting + +*/ +// +// Original Author: Elvire Bouvier +// Created: Thu, 16 Jan 2014 16:27:35 GMT +// +// +#ifndef TOPDILEPTONHLTVALIDATION +#define TOPDILEPTONHLTVALIDATION + +// system include files +#include + +// user include files +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/EDAnalyzer.h" + +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/MakerMacros.h" + +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ServiceRegistry/interface/Service.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" + +#include "DQMServices/Core/interface/DQMStore.h" +#include "DQMServices/Core/interface/MonitorElement.h" + +#include "DataFormats/EgammaCandidates/interface/GsfElectron.h" +#include "DataFormats/MuonReco/interface/Muon.h" +#include "DataFormats/JetReco/interface/Jet.h" +#include "HLTrigger/HLTcore/interface/HLTConfigProvider.h" +#include "DataFormats/Common/interface/TriggerResults.h" +#include "TH1.h" + +// +// class declaration +// + +class TopDiLeptonHLTValidation : public edm::EDAnalyzer { + public: + explicit TopDiLeptonHLTValidation(const edm::ParameterSet&); + ~TopDiLeptonHLTValidation(); + + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + + + private: + virtual void beginJob() override; + virtual void analyze(const edm::Event&, const edm::EventSetup&) override; + virtual void endJob() override; + + //virtual void beginRun(edm::Run const&, edm::EventSetup const&) override; + virtual void endRun(edm::Run const&, edm::EventSetup const&) override; + //virtual void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override; + //virtual void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override; + + // ----------member data --------------------------- + // DQM + DQMStore* dbe_; + std::string sDir_; + MonitorElement* hEffLeptonPt; + MonitorElement* hEffLeptonEta; + MonitorElement* hEffJetPt; + MonitorElement* hEffJetEta; + // Electrons + const reco::GsfElectron *elec1_; + const reco::GsfElectron *elec2_; + std::string sElectrons_; + edm::EDGetTokenT< edm::View > tokElectrons_; + double ptElectrons_; + double etaElectrons_; + double isoElectrons_; + unsigned int minElectrons_; + // Muons + const reco::Muon *mu1_; + const reco::Muon *mu2_; + std::string sMuons_; + edm::EDGetTokenT< edm::View > tokMuons_; + double ptMuons_; + double etaMuons_; + double isoMuons_; + unsigned int minMuons_; + // Jets + const reco::Jet *jet_; + std::string sJets_; + edm::EDGetTokenT< edm::View > tokJets_; + double ptJets_; + double etaJets_; + unsigned int minJets_; + // Trigger + std::string sTrigger_; + edm::EDGetTokenT tokTrigger_; + std::vector vsPaths_; + // Histos + bool isAll_ = false; + TH1F *hDenLeptonPt = new TH1F("PtLeptonAll", "PtLeptonAll", 50, 0., 250.); + TH1F *hDenLeptonEta = new TH1F("EtaLeptonAll", "EtaLeptonAll", 30, -3. , 3.); + TH1F *hDenJetPt = new TH1F("PtLastJetAll", "PtLastJetAll", 60, 0., 300.); + TH1F *hDenJetEta = new TH1F("EtaLastJetAll", "EtaLastJetAll", 30, -3., 3.); + bool isSel_ = false; + TH1F *hNumLeptonPt = new TH1F("PtLeptonSel", "PtLeptonSel", 50, 0., 250.); + TH1F *hNumLeptonEta = new TH1F("EtaLeptonSel", "EtaLeptonSel", 30, -3. , 3.); + TH1F *hNumJetPt = new TH1F("PtLastJetSel", "PtLastJetSel", 60, 0., 300.); + TH1F *hNumJetEta = new TH1F("EtaLastJetSel", "EtaLastJetSel", 30, -3., 3.); +}; + +// +// constants, enums and typedefs +// + +// +// static data member definitions +// + +// +// constructors and destructor +// +TopDiLeptonHLTValidation::TopDiLeptonHLTValidation(const edm::ParameterSet& iConfig) : + sDir_(iConfig.getUntrackedParameter("sDir","Validation/Top/Efficiencies/")), + sElectrons_(iConfig.getUntrackedParameter("sElectrons","gsfElectrons")), + ptElectrons_(iConfig.getUntrackedParameter("ptElectrons",0.)), + etaElectrons_(iConfig.getUntrackedParameter("etaElectrons",0.)), + isoElectrons_(iConfig.getUntrackedParameter("isoElectrons",0.)), + minElectrons_(iConfig.getUntrackedParameter("minElectrons",0)), + sMuons_(iConfig.getUntrackedParameter("sMuons","muons")), + ptMuons_(iConfig.getUntrackedParameter("ptMuons",0.)), + etaMuons_(iConfig.getUntrackedParameter("etaMuons",0.)), + isoMuons_(iConfig.getUntrackedParameter("isoMuons",0.)), + minMuons_(iConfig.getUntrackedParameter("minMuons",0)), + sJets_(iConfig.getUntrackedParameter("sJets","ak5PFJets")), + ptJets_(iConfig.getUntrackedParameter("ptJets",0.)), + etaJets_(iConfig.getUntrackedParameter("etaJets",0.)), + minJets_(iConfig.getUntrackedParameter("minJets",0)), + sTrigger_(iConfig.getUntrackedParameter("sTrigger","TriggerResults")), + vsPaths_(iConfig.getUntrackedParameter< std::vector >("vsPaths")) + +{ + dbe_ = edm::Service().operator->(); + // Electrons + tokElectrons_ = consumes< edm::View >(edm::InputTag(sElectrons_)); + // Muons + tokMuons_ = consumes< edm::View >(edm::InputTag(sMuons_)); + // Jets + tokJets_ = consumes< edm::View >(edm::InputTag(sJets_)); + // Trigger + tokTrigger_ = consumes(edm::InputTag(sTrigger_)); +} + + +TopDiLeptonHLTValidation::~TopDiLeptonHLTValidation() +{ + + // do anything here that needs to be done at desctruction time + // (e.g. close files, deallocate resources etc.) + +} +#endif + +//define this as a plug-in +DEFINE_FWK_MODULE(TopDiLeptonHLTValidation); diff --git a/HLTriggerOffline/Top/python/topDiLeptonHLTEventValidation_cfi.py b/HLTriggerOffline/Top/python/topDiLeptonHLTEventValidation_cfi.py new file mode 100644 index 0000000000000..9aa78cb24c845 --- /dev/null +++ b/HLTriggerOffline/Top/python/topDiLeptonHLTEventValidation_cfi.py @@ -0,0 +1,79 @@ +import FWCore.ParameterSet.Config as cms + +# ttbar dimuon +DiMuonHLTValidation = cms.EDAnalyzer('TopDiLeptonHLTValidation', + # Directory + sDir = cms.untracked.string('HLTValidation/Top/DiMuon/'), + # Electrons + sElectrons = cms.untracked.string('gsfElectrons'), + ptElectrons = cms.untracked.double(20.), + etaElectrons = cms.untracked.double(2.5), + isoElectrons = cms.untracked.double(0.15), + minElectrons = cms.untracked.uint32(0), + # Muons + sMuons = cms.untracked.string('muons'), + ptMuons = cms.untracked.double(20.), + etaMuons = cms.untracked.double(2.4), + isoMuons = cms.untracked.double(0.2), + minMuons = cms.untracked.uint32(2), + # Jets + sJets = cms.untracked.string('ak5PFJets'), + ptJets = cms.untracked.double(30.), + etaJets = cms.untracked.double(2.5), + minJets = cms.untracked.uint32(2), + # Trigger + sTrigger = cms.untracked.string("TriggerResults"), + vsPaths = cms.untracked.vstring(['HLT_Mu17_Mu8','HLT_Mu17_TkMu8']), +) + +# ttbar dielec +DiElectronHLTValidation = cms.EDAnalyzer('TopDiLeptonHLTValidation', + # Directory + sDir = cms.untracked.string('HLTValidation/Top/DiElectron/'), + # Electrons + sElectrons = cms.untracked.string('gsfElectrons'), + ptElectrons = cms.untracked.double(20.), + etaElectrons = cms.untracked.double(2.5), + isoElectrons = cms.untracked.double(0.15), + minElectrons = cms.untracked.uint32(2), + # Muons + sMuons = cms.untracked.string('muons'), + ptMuons = cms.untracked.double(20.), + etaMuons = cms.untracked.double(2.4), + isoMuons = cms.untracked.double(0.2), + minMuons = cms.untracked.uint32(0), + # Jets + sJets = cms.untracked.string('ak5PFJets'), + ptJets = cms.untracked.double(30.), + etaJets = cms.untracked.double(2.5), + minJets = cms.untracked.uint32(2), + # Trigger + sTrigger = cms.untracked.string("TriggerResults"), + vsPaths = cms.untracked.vstring(['HLT_Ele17_CaloIdT_CaloIsoVL_TrkIdVL_TrkIsoVL_Ele8_CaloIdT_CaloIsoVL_TrkIdVL_TrkIsoVL']), +) + +# ttbar elec-muon +ElecMuonHLTValidation = cms.EDAnalyzer('TopDiLeptonHLTValidation', + # Directory + sDir = cms.untracked.string('HLTValidation/Top/ElecMuon/'), + # Electrons + sElectrons = cms.untracked.string('gsfElectrons'), + ptElectrons = cms.untracked.double(20.), + etaElectrons = cms.untracked.double(2.5), + isoElectrons = cms.untracked.double(0.15), + minElectrons = cms.untracked.uint32(1), + # Muons + sMuons = cms.untracked.string('muons'), + ptMuons = cms.untracked.double(20.), + etaMuons = cms.untracked.double(2.4), + isoMuons = cms.untracked.double(0.2), + minMuons = cms.untracked.uint32(1), + # Jets + sJets = cms.untracked.string('ak5PFJets'), + ptJets = cms.untracked.double(30.), + etaJets = cms.untracked.double(2.5), + minJets = cms.untracked.uint32(2), + # Trigger + sTrigger = cms.untracked.string("TriggerResults"), + vsPaths = cms.untracked.vstring(['HLT_Mu17_Ele8_CaloIdT_CaloIsoVL_TrkIdVL_TrkIsoVL','HLT_Mu8_Ele17_CaloIdT_CaloIsoVL_TrkIdVL_TrkIsoVL']), +) diff --git a/HLTriggerOffline/Top/python/topHLTValidation_cff.py b/HLTriggerOffline/Top/python/topHLTValidation_cff.py index ac322628a1414..0ec3291396363 100644 --- a/HLTriggerOffline/Top/python/topHLTValidation_cff.py +++ b/HLTriggerOffline/Top/python/topHLTValidation_cff.py @@ -1,15 +1,14 @@ import FWCore.ParameterSet.Config as cms -#from HLTriggerOffline.Top.topDiLeptonHLTEventValidation_cfi import * +from HLTriggerOffline.Top.topDiLeptonHLTEventValidation_cfi import * from HLTriggerOffline.Top.topSingleLeptonHLTEventValidation_cfi import * from HLTriggerOffline.Top.singletopHLTEventValidation_cfi import * topHLTriggerValidation = cms.Sequence( -# DiMuonHLTValidation -# *DiElectronHLTValidation -# *ElecMuonHLTValidation -# * - topSingleMuonHLTValidation + DiMuonHLTValidation + *DiElectronHLTValidation + *ElecMuonHLTValidation + *topSingleMuonHLTValidation *topSingleElectronHLTValidation *SingleTopSingleMuonHLTValidation *SingleTopSingleElectronHLTValidation diff --git a/HLTriggerOffline/Top/src/TopDiLeptonHLTValidation.cc b/HLTriggerOffline/Top/src/TopDiLeptonHLTValidation.cc new file mode 100644 index 0000000000000..2684663706885 --- /dev/null +++ b/HLTriggerOffline/Top/src/TopDiLeptonHLTValidation.cc @@ -0,0 +1,241 @@ +// -*- C++ -*- +// +// Package: HLTriggerOffline/Top +// Class: TopDiLeptonHLTValidation +// +/**\class TopDiLeptonHLTValidation TopDiLeptonHLTValidation.cc HLTriggerOffline/Top/src/TopDiLeptonHLTValidation.cc + +Description: + + Description: compute efficiencies of trigger paths on offline reco selection with respect to pt and eta + +Implementation: + harvesting + +*/ +// +// Original Author: Elvire Bouvier +// Created: Thu, 16 Jan 2014 16:27:35 GMT +// +// +#include "HLTriggerOffline/Top/interface/TopDiLeptonHLTValidation.h" + +// system include files +#include + +// user include files +#include "FWCore/Framework/interface/Frameworkfwd.h" + +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/MakerMacros.h" + +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ServiceRegistry/interface/Service.h" + +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "HLTrigger/HLTcore/interface/HLTConfigProvider.h" +#include "FWCore/Common/interface/TriggerNames.h" +#include "TString.h" +#include "DataFormats/MuonReco/interface/MuonPFIsolation.h" +// +// member functions +// + +// ------------ method called for each event ------------ + void +TopDiLeptonHLTValidation::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) +{ + using namespace edm; + + isAll_ = false; isSel_ = false; + + // Electrons + Handle< edm::View > electrons; + iEvent.getByToken(tokElectrons_,electrons); + unsigned int nGoodE = 0; + for(edm::View::const_iterator e = electrons->begin(); e != electrons->end(); ++e){ + if (e->pt() < ptElectrons_) continue; + if (fabs(e->eta()) > etaElectrons_) continue; + if ((e->dr03TkSumPt()+e->dr03EcalRecHitSumEt()+e->dr03HcalTowerSumEt())/e->pt() > isoElectrons_ ) continue; + nGoodE++; + if (nGoodE == 1) elec1_ = &(*e); + if (nGoodE == 2) elec2_ = &(*e); + } + // Muons + Handle< edm::View > muons; + iEvent.getByToken(tokMuons_,muons); + unsigned int nGoodM = 0; + for(edm::View::const_iterator m = muons->begin(); m != muons->end(); ++m){ + if (!m->isPFMuon() || (!m->isGlobalMuon() && !m->isTrackerMuon())) continue; + if (m->pt() < ptMuons_) continue; + if (fabs(m->eta()) > etaMuons_) continue; + if (((m->pfIsolationR04()).sumChargedHadronPt+(m->pfIsolationR04()).sumPhotonEt+(m->pfIsolationR04()).sumNeutralHadronEt)/m->pt() > isoMuons_ ) continue; + nGoodM++; + if (nGoodM == 1) mu1_ = &(*m); + if (nGoodM == 2) mu2_ = &(*m); + } + // Jets + Handle< edm::View > jets; + iEvent.getByToken(tokJets_,jets); + unsigned int nGoodJ = 0; + for(edm::View::const_iterator j = jets->begin(); j != jets->end(); ++j){ + if (j->pt() < ptJets_) continue; + if (fabs(j->eta()) > etaJets_) continue; + nGoodJ++; + if (nGoodJ == minJets_) jet_ = &(*j); + } + + if (nGoodE >= minElectrons_ && nGoodM >= minMuons_ && nGoodJ >= minJets_) isAll_ = true; + + //Trigger + Handle triggerTable; + iEvent.getByToken(tokTrigger_,triggerTable); + const edm::TriggerNames& triggerNames = iEvent.triggerNames(*triggerTable); + for (unsigned int i=0; i 0) { + hDenLeptonPt->Fill(elec1_->pt()); + hDenLeptonEta->Fill(elec1_->eta()); + } + if (minElectrons_ > 1) { + hDenLeptonPt->Fill(elec2_->pt()); + hDenLeptonEta->Fill(elec2_->eta()); + } + if (minMuons_ > 0) { + hDenLeptonPt->Fill(mu1_->pt()); + hDenLeptonEta->Fill(mu1_->eta()); + } + if (minMuons_ > 1) { + hDenLeptonPt->Fill(mu2_->pt()); + hDenLeptonEta->Fill(mu2_->eta()); + } + hDenJetPt->Fill(jet_->pt()); + hDenJetEta->Fill(jet_->eta()); + } + if (isSel_) { + if (minElectrons_ > 0) { + hNumLeptonPt->Fill(elec1_->pt()); + hNumLeptonEta->Fill(elec1_->eta()); + } + if (minElectrons_ > 1) { + hNumLeptonPt->Fill(elec2_->pt()); + hNumLeptonEta->Fill(elec2_->eta()); + } + if (minMuons_ > 0) { + hNumLeptonPt->Fill(mu1_->pt()); + hNumLeptonEta->Fill(mu1_->eta()); + } + if (minMuons_ > 1) { + hNumLeptonPt->Fill(mu2_->pt()); + hNumLeptonEta->Fill(mu2_->eta()); + } + hNumJetPt->Fill(jet_->pt()); + hNumJetEta->Fill(jet_->eta()); + } + } +} + + +// ------------ method called once each job just before starting event loop ------------ + void +TopDiLeptonHLTValidation::beginJob() +{ +} + +// ------------ method called once each job just after ending the event loop ------------ + void +TopDiLeptonHLTValidation::endJob() +{ +} + +// ------------ method called when starting to processes a run ------------ +/* + void + TopDiLeptonHLTValidation::beginRun(edm::Run const&, edm::EventSetup const&) + { + } + */ + +// ------------ method called when ending the processing of a run ------------ + + void +TopDiLeptonHLTValidation::endRun(edm::Run const&, edm::EventSetup const&) +{ + dbe_->setCurrentFolder(sDir_); + hEffLeptonPt = dbe_->book1D("EfficiencyVsPtLepton", "EfficiencyVsPtLepton", 50, 0., 250.); + hEffLeptonEta = dbe_->book1D("EfficiencyVsEtaLepton", "EfficiencyVsEtaLepton", 30, -3. , 3.); + hEffJetPt = dbe_->book1D("EfficiencyVsPtLastJet", "EfficiencyVsPtLastJet", 60, 0., 300.); + hEffJetEta = dbe_->book1D("EfficiencyVsEtaLastJet", "EfficiencyVsEtaLastJet", 30, -3., 3.); + + //------ Efficiency wrt + // lepton pt + for (int iBin = 1; iBin <= hNumLeptonPt->GetNbinsX(); ++iBin) + { + if(hDenLeptonPt->GetBinContent(iBin) == 0) + hEffLeptonPt->setBinContent(iBin, 0.); + else + hEffLeptonPt->setBinContent(iBin, hNumLeptonPt->GetBinContent(iBin) / hDenLeptonPt->GetBinContent(iBin)); + } + // lepton eta + for (int iBin = 1; iBin <= hNumLeptonEta->GetNbinsX(); ++iBin) + { + if(hDenLeptonEta->GetBinContent(iBin) == 0) + hEffLeptonEta->setBinContent(iBin, 0.); + else + hEffLeptonEta->setBinContent(iBin, hNumLeptonEta->GetBinContent(iBin) / hDenLeptonEta->GetBinContent(iBin)); + } + // jet pt + for (int iBin = 1; iBin <= hNumJetPt->GetNbinsX(); ++iBin) + { + if(hDenJetPt->GetBinContent(iBin) == 0) + hEffJetPt->setBinContent(iBin, 0.); + else + hEffJetPt->setBinContent(iBin, hNumJetPt->GetBinContent(iBin) / hDenJetPt->GetBinContent(iBin)); + } + // jet eta + for (int iBin = 1; iBin <= hNumJetEta->GetNbinsX(); ++iBin) + { + if(hDenJetEta->GetBinContent(iBin) == 0) + hEffJetEta->setBinContent(iBin, 0.); + else + hEffJetEta->setBinContent(iBin, hNumJetEta->GetBinContent(iBin) / hDenJetEta->GetBinContent(iBin)); + } +} + + +// ------------ method called when starting to processes a luminosity block ------------ +/* + void + TopDiLeptonHLTValidation::beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) + { + } + */ + +// ------------ method called when ending the processing of a luminosity block ------------ +/* + void + TopDiLeptonHLTValidation::endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) + { + } + */ + +// ------------ method fills 'descriptions' with the allowed parameters for the module ------------ +void +TopDiLeptonHLTValidation::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + //The following says we do not know what parameters are allowed so do no validation + // Please change this to state exactly what you do use, even if it is no parameters + edm::ParameterSetDescription desc; + desc.setUnknown(); + descriptions.addDefault(desc); +} + From 33492c4507e85e44beb02277b82e4c7e9f371048 Mon Sep 17 00:00:00 2001 From: Elvire Bouvier Date: Thu, 23 Jan 2014 19:36:24 +0100 Subject: [PATCH 18/26] calling new sequences --- .../Common/python/HLTValidationHarvest_cff.py | 8 ++++---- HLTriggerOffline/Common/python/HLTValidationQT_cff.py | 2 -- HLTriggerOffline/Common/python/HLTValidation_cff.py | 10 +++++----- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/HLTriggerOffline/Common/python/HLTValidationHarvest_cff.py b/HLTriggerOffline/Common/python/HLTValidationHarvest_cff.py index 173b39d6fe5fb..560f398062f09 100644 --- a/HLTriggerOffline/Common/python/HLTValidationHarvest_cff.py +++ b/HLTriggerOffline/Common/python/HLTValidationHarvest_cff.py @@ -1,7 +1,7 @@ from HLTriggerOffline.Tau.Validation.HLTTauPostValidation_cfi import * from HLTriggerOffline.Muon.HLTMuonPostVal_cff import * from HLTriggerOffline.Egamma.EgammaPostProcessor_cfi import * -from HLTriggerOffline.Top.HLTTopPostVal_cff import * +from HLTriggerOffline.Top.topHLTValidation_cff import * from HLTriggerOffline.Common.FourVectorHLTriggerOfflineClient_cfi import * from HLTriggerOffline.HeavyFlavor.heavyFlavorValidationHarvestingSequence_cff import * from HLTriggerOffline.JetMET.Validation.JetMETPostProcessor_cff import * @@ -16,7 +16,7 @@ HLTMuonPostVal +HLTTauPostVal +EgammaPostVal - +HLTTopPostVal + +topHLTriggerValidation +hltriggerFourVectorClient +heavyFlavorValidationHarvestingSequence +JetMETPostVal @@ -32,7 +32,7 @@ +HLTTauPostVal +EgammaPostVal +hltriggerFourVectorClient - +HLTTopPostVal + +topHLTriggerValidation +heavyFlavorValidationHarvestingSequence +JetMETPostVal #+HLTAlCaPostVal @@ -42,7 +42,7 @@ hltpostvalidation_preprod = cms.Sequence( HLTTauPostVal - +HLTTopPostVal + +topHLTriggerValidation +hltriggerFourVectorClient +heavyFlavorValidationHarvestingSequence +SusyExoPostVal diff --git a/HLTriggerOffline/Common/python/HLTValidationQT_cff.py b/HLTriggerOffline/Common/python/HLTValidationQT_cff.py index 32b5093f29cf2..ff07c6291137d 100644 --- a/HLTriggerOffline/Common/python/HLTValidationQT_cff.py +++ b/HLTriggerOffline/Common/python/HLTValidationQT_cff.py @@ -3,7 +3,6 @@ #from HLTriggerOffline.Common.HLTValidationQTExample_cfi import * from HLTriggerOffline.Muon.HLTMuonQualityTester_cfi import * from HLTriggerOffline.Tau.Validation.HLTTauQualityTests_cff import * -from HLTriggerOffline.Top.HLTTopQualityTester_cfi import * from HLTriggerOffline.Higgs.HLTHiggsQualityTester_cfi import * from HLTriggerOffline.JetMET.Validation.HLTJetMETQualityTester_cfi import * from HLTriggerOffline.SUSYBSM.HLTSusyExoQualityTester_cfi import * @@ -13,7 +12,6 @@ hltMuonQualityTester + hltTauRelvalQualityTests + hltHiggsQualityTester - + hltTopQualityTester + hltJetMetQualityTester + hltSusyExoQualityTester ) diff --git a/HLTriggerOffline/Common/python/HLTValidation_cff.py b/HLTriggerOffline/Common/python/HLTValidation_cff.py index 09e050055a1eb..6dbe0e4a4f5fe 100644 --- a/HLTriggerOffline/Common/python/HLTValidation_cff.py +++ b/HLTriggerOffline/Common/python/HLTValidation_cff.py @@ -1,7 +1,6 @@ from HLTriggerOffline.Muon.HLTMuonVal_cff import * from HLTriggerOffline.Tau.Validation.HLTTauValidation_cff import * from HLTriggerOffline.Egamma.EgammaValidationAutoConf_cff import * -from HLTriggerOffline.Top.topvalidation_cfi import * from HLTriggerOffline.Common.FourVectorHLTriggerOffline_cff import * from HLTriggerOffline.HeavyFlavor.heavyFlavorValidationSequence_cff import * from HLTriggerOffline.JetMET.Validation.HLTJetMETValidation_cff import * @@ -14,6 +13,7 @@ # from DQMOffline.Trigger.DQMOffline_Trigger_cff.py import * from DQMOffline.Trigger.HLTTauDQMOffline_cff import * from DQMOffline.Trigger.EgHLTOfflineSource_cfi import * +from DQMOffline.Trigger.topHLTOfflineDQM_cff import * #from DQMOffline.Trigger.MuonTrigRateAnalyzer_cfi import * # online dqm: from DQMOffline.Trigger.HLTMonTau_cfi import * @@ -27,7 +27,7 @@ HLTMuonVal +HLTTauVal +egammaValidationSequence - +HLTTopVal + +topHLTriggerOfflineDQM +HLTFourVector +heavyFlavorValidationSequence +HLTJetMETValSeq @@ -48,7 +48,7 @@ HLTMuonVal_FastSim +HLTTauValFS +egammaValidationSequenceFS - +HLTTopVal + +topHLTriggerOfflineDQM +HLTFourVector +heavyFlavorValidationSequence +HLTJetMETValSeq @@ -59,7 +59,7 @@ hltvalidation_preprod = cms.Sequence( HLTTauVal - +HLTTopVal + +topHLTriggerOfflineDQM +HLTFourVector +heavyFlavorValidationSequence +HLTSusyExoValSeq @@ -68,7 +68,7 @@ hltvalidation_preprod_fastsim = cms.Sequence( HLTTauVal - +HLTTopVal + +topHLTriggerOfflineDQM +HLTFourVector +heavyFlavorValidationSequence +HLTSusyExoValSeq_FastSim From 989301a453cac6dfd5e8a6010b1e6d73c30b97e9 Mon Sep 17 00:00:00 2001 From: Elvire Bouvier Date: Mon, 27 Jan 2014 15:06:00 +0100 Subject: [PATCH 19/26] removing replication between preprod and validation --- HLTriggerOffline/Common/python/HLTValidation_cff.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/HLTriggerOffline/Common/python/HLTValidation_cff.py b/HLTriggerOffline/Common/python/HLTValidation_cff.py index 6dbe0e4a4f5fe..b3e53a9b9ce0b 100644 --- a/HLTriggerOffline/Common/python/HLTValidation_cff.py +++ b/HLTriggerOffline/Common/python/HLTValidation_cff.py @@ -17,7 +17,7 @@ #from DQMOffline.Trigger.MuonTrigRateAnalyzer_cfi import * # online dqm: from DQMOffline.Trigger.HLTMonTau_cfi import * - + # additional producer sequence prior to hltvalidation # to evacuate producers/filters from the EndPath hltassociation = cms.Sequence( egammaSelectors ) @@ -59,7 +59,6 @@ hltvalidation_preprod = cms.Sequence( HLTTauVal - +topHLTriggerOfflineDQM +HLTFourVector +heavyFlavorValidationSequence +HLTSusyExoValSeq @@ -68,7 +67,6 @@ hltvalidation_preprod_fastsim = cms.Sequence( HLTTauVal - +topHLTriggerOfflineDQM +HLTFourVector +heavyFlavorValidationSequence +HLTSusyExoValSeq_FastSim From 5ecc0c81c371333e949577ffa5ace8524927a5ca Mon Sep 17 00:00:00 2001 From: Elvire Bouvier Date: Thu, 30 Jan 2014 14:31:32 +0100 Subject: [PATCH 20/26] change of structure to match DQM specificities --- .../Common/python/HLTValidationHarvest_cff.py | 7 +- .../Common/python/HLTValidation_cff.py | 3 + .../Top/interface/TopDiLeptonHLTValidation.h | 41 +++---- .../interface/TopSingleLeptonHLTValidation.h | 40 +++--- .../python/singletopHLTEventValidation_cfi.py | 4 +- .../topDiLeptonHLTEventValidation_cfi.py | 6 +- .../topSingleLeptonHLTEventValidation_cfi.py | 4 +- .../Top/src/TopDiLeptonHLTValidation.cc | 110 ++++------------- .../Top/src/TopSingleLeptonHLTValidation.cc | 115 ++++-------------- 9 files changed, 92 insertions(+), 238 deletions(-) diff --git a/HLTriggerOffline/Common/python/HLTValidationHarvest_cff.py b/HLTriggerOffline/Common/python/HLTValidationHarvest_cff.py index 560f398062f09..f5b36ec54dff0 100644 --- a/HLTriggerOffline/Common/python/HLTValidationHarvest_cff.py +++ b/HLTriggerOffline/Common/python/HLTValidationHarvest_cff.py @@ -1,7 +1,7 @@ from HLTriggerOffline.Tau.Validation.HLTTauPostValidation_cfi import * from HLTriggerOffline.Muon.HLTMuonPostVal_cff import * from HLTriggerOffline.Egamma.EgammaPostProcessor_cfi import * -from HLTriggerOffline.Top.topHLTValidation_cff import * +from HLTriggerOffline.Top.topHLTValidationHarvest_cff import * from HLTriggerOffline.Common.FourVectorHLTriggerOfflineClient_cfi import * from HLTriggerOffline.HeavyFlavor.heavyFlavorValidationHarvestingSequence_cff import * from HLTriggerOffline.JetMET.Validation.JetMETPostProcessor_cff import * @@ -16,7 +16,7 @@ HLTMuonPostVal +HLTTauPostVal +EgammaPostVal - +topHLTriggerValidation + +topHLTriggerValidationHarvest +hltriggerFourVectorClient +heavyFlavorValidationHarvestingSequence +JetMETPostVal @@ -32,7 +32,7 @@ +HLTTauPostVal +EgammaPostVal +hltriggerFourVectorClient - +topHLTriggerValidation + +topHLTriggerValidationHarvest +heavyFlavorValidationHarvestingSequence +JetMETPostVal #+HLTAlCaPostVal @@ -42,7 +42,6 @@ hltpostvalidation_preprod = cms.Sequence( HLTTauPostVal - +topHLTriggerValidation +hltriggerFourVectorClient +heavyFlavorValidationHarvestingSequence +SusyExoPostVal diff --git a/HLTriggerOffline/Common/python/HLTValidation_cff.py b/HLTriggerOffline/Common/python/HLTValidation_cff.py index b3e53a9b9ce0b..947d788681f00 100644 --- a/HLTriggerOffline/Common/python/HLTValidation_cff.py +++ b/HLTriggerOffline/Common/python/HLTValidation_cff.py @@ -7,6 +7,7 @@ #from HLTriggerOffline.special.hltAlCaVal_cff import * from HLTriggerOffline.SUSYBSM.SusyExoValidation_cff import * from HLTriggerOffline.Higgs.HiggsValidation_cff import * +from HLTriggerOffline.Top.topHLTValidation_cff import * # offline dqm: @@ -28,6 +29,7 @@ +HLTTauVal +egammaValidationSequence +topHLTriggerOfflineDQM + +topHLTriggerValidation +HLTFourVector +heavyFlavorValidationSequence +HLTJetMETValSeq @@ -49,6 +51,7 @@ +HLTTauValFS +egammaValidationSequenceFS +topHLTriggerOfflineDQM + +topHLTriggerValidation +HLTFourVector +heavyFlavorValidationSequence +HLTJetMETValSeq diff --git a/HLTriggerOffline/Top/interface/TopDiLeptonHLTValidation.h b/HLTriggerOffline/Top/interface/TopDiLeptonHLTValidation.h index 0d03be755be65..6203493140655 100644 --- a/HLTriggerOffline/Top/interface/TopDiLeptonHLTValidation.h +++ b/HLTriggerOffline/Top/interface/TopDiLeptonHLTValidation.h @@ -26,7 +26,8 @@ // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" +//#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "DQMServices/Core/interface/DQMEDAnalyzer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" @@ -43,13 +44,13 @@ #include "DataFormats/JetReco/interface/Jet.h" #include "HLTrigger/HLTcore/interface/HLTConfigProvider.h" #include "DataFormats/Common/interface/TriggerResults.h" -#include "TH1.h" +//#include "TH1.h" // // class declaration // -class TopDiLeptonHLTValidation : public edm::EDAnalyzer { +class TopDiLeptonHLTValidation : public DQMEDAnalyzer { public: explicit TopDiLeptonHLTValidation(const edm::ParameterSet&); ~TopDiLeptonHLTValidation(); @@ -58,23 +59,20 @@ class TopDiLeptonHLTValidation : public edm::EDAnalyzer { private: - virtual void beginJob() override; virtual void analyze(const edm::Event&, const edm::EventSetup&) override; - virtual void endJob() override; - - //virtual void beginRun(edm::Run const&, edm::EventSetup const&) override; - virtual void endRun(edm::Run const&, edm::EventSetup const&) override; - //virtual void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override; - //virtual void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override; + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; // ----------member data --------------------------- // DQM - DQMStore* dbe_; std::string sDir_; - MonitorElement* hEffLeptonPt; - MonitorElement* hEffLeptonEta; - MonitorElement* hEffJetPt; - MonitorElement* hEffJetEta; + MonitorElement* hNumLeptonPt; + MonitorElement* hDenLeptonPt; + MonitorElement* hNumLeptonEta; + MonitorElement* hDenLeptonEta; + MonitorElement* hNumJetPt; + MonitorElement* hDenJetPt; + MonitorElement* hNumJetEta; + MonitorElement* hDenJetEta; // Electrons const reco::GsfElectron *elec1_; const reco::GsfElectron *elec2_; @@ -104,17 +102,9 @@ class TopDiLeptonHLTValidation : public edm::EDAnalyzer { std::string sTrigger_; edm::EDGetTokenT tokTrigger_; std::vector vsPaths_; - // Histos + // Flags bool isAll_ = false; - TH1F *hDenLeptonPt = new TH1F("PtLeptonAll", "PtLeptonAll", 50, 0., 250.); - TH1F *hDenLeptonEta = new TH1F("EtaLeptonAll", "EtaLeptonAll", 30, -3. , 3.); - TH1F *hDenJetPt = new TH1F("PtLastJetAll", "PtLastJetAll", 60, 0., 300.); - TH1F *hDenJetEta = new TH1F("EtaLastJetAll", "EtaLastJetAll", 30, -3., 3.); bool isSel_ = false; - TH1F *hNumLeptonPt = new TH1F("PtLeptonSel", "PtLeptonSel", 50, 0., 250.); - TH1F *hNumLeptonEta = new TH1F("EtaLeptonSel", "EtaLeptonSel", 30, -3. , 3.); - TH1F *hNumJetPt = new TH1F("PtLastJetSel", "PtLastJetSel", 60, 0., 300.); - TH1F *hNumJetEta = new TH1F("EtaLastJetSel", "EtaLastJetSel", 30, -3., 3.); }; // @@ -148,7 +138,6 @@ TopDiLeptonHLTValidation::TopDiLeptonHLTValidation(const edm::ParameterSet& iCon vsPaths_(iConfig.getUntrackedParameter< std::vector >("vsPaths")) { - dbe_ = edm::Service().operator->(); // Electrons tokElectrons_ = consumes< edm::View >(edm::InputTag(sElectrons_)); // Muons @@ -156,7 +145,7 @@ TopDiLeptonHLTValidation::TopDiLeptonHLTValidation(const edm::ParameterSet& iCon // Jets tokJets_ = consumes< edm::View >(edm::InputTag(sJets_)); // Trigger - tokTrigger_ = consumes(edm::InputTag(sTrigger_)); + tokTrigger_ = consumes(edm::InputTag(sTrigger_, "", "HLT")); } diff --git a/HLTriggerOffline/Top/interface/TopSingleLeptonHLTValidation.h b/HLTriggerOffline/Top/interface/TopSingleLeptonHLTValidation.h index cc4b84a765a36..6a8f1bddc2e07 100644 --- a/HLTriggerOffline/Top/interface/TopSingleLeptonHLTValidation.h +++ b/HLTriggerOffline/Top/interface/TopSingleLeptonHLTValidation.h @@ -23,7 +23,7 @@ // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "DQMServices/Core/interface/DQMEDAnalyzer.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/MakerMacros.h" @@ -40,13 +40,13 @@ #include "DataFormats/JetReco/interface/Jet.h" #include "HLTrigger/HLTcore/interface/HLTConfigProvider.h" #include "DataFormats/Common/interface/TriggerResults.h" -#include "TH1.h" +//#include "TH1.h" // // class declaration // -class TopSingleLeptonHLTValidation : public edm::EDAnalyzer { +class TopSingleLeptonHLTValidation : public DQMEDAnalyzer { public: explicit TopSingleLeptonHLTValidation(const edm::ParameterSet&); ~TopSingleLeptonHLTValidation(); @@ -55,23 +55,20 @@ class TopSingleLeptonHLTValidation : public edm::EDAnalyzer { private: - virtual void beginJob() override; virtual void analyze(const edm::Event&, const edm::EventSetup&) override; - virtual void endJob() override; - - //virtual void beginRun(edm::Run const&, edm::EventSetup const&) override; - virtual void endRun(edm::Run const&, edm::EventSetup const&) override; - //virtual void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override; - //virtual void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) override; + void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override; // ----------member data --------------------------- // DQM - DQMStore* dbe_; std::string sDir_; - MonitorElement* hEffLeptonPt; - MonitorElement* hEffLeptonEta; - MonitorElement* hEffJetPt; - MonitorElement* hEffJetEta; + MonitorElement* hNumLeptonPt; + MonitorElement* hDenLeptonPt; + MonitorElement* hNumLeptonEta; + MonitorElement* hDenLeptonEta; + MonitorElement* hNumJetPt; + MonitorElement* hDenJetPt; + MonitorElement* hNumJetEta; + MonitorElement* hDenJetEta; // Electrons const reco::GsfElectron *elec_; std::string sElectrons_; @@ -99,17 +96,9 @@ class TopSingleLeptonHLTValidation : public edm::EDAnalyzer { std::string sTrigger_; edm::EDGetTokenT tokTrigger_; std::vector vsPaths_; - // Histos + // Flags bool isAll_ = false; - TH1F *hDenLeptonPt = new TH1F("PtLeptonAll", "PtLeptonAll", 50, 0., 250.); - TH1F *hDenLeptonEta = new TH1F("EtaLeptonAll", "EtaLeptonAll", 30, -3. , 3.); - TH1F *hDenJetPt = new TH1F("PtLastJetAll", "PtLastJetAll", 60, 0., 300.); - TH1F *hDenJetEta = new TH1F("EtaLastJetAll", "EtaLastJetAll", 30, -3., 3.); bool isSel_ = false; - TH1F *hNumLeptonPt = new TH1F("PtLeptonSel", "PtLeptonSel", 50, 0., 250.); - TH1F *hNumLeptonEta = new TH1F("EtaLeptonSel", "EtaLeptonSel", 30, -3. , 3.); - TH1F *hNumJetPt = new TH1F("PtLastJetSel", "PtLastJetSel", 60, 0., 300.); - TH1F *hNumJetEta = new TH1F("EtaLastJetSel", "EtaLastJetSel", 30, -3., 3.); }; // @@ -143,7 +132,6 @@ TopSingleLeptonHLTValidation::TopSingleLeptonHLTValidation(const edm::ParameterS vsPaths_(iConfig.getUntrackedParameter< std::vector >("vsPaths")) { - dbe_ = edm::Service().operator->(); // Electrons tokElectrons_ = consumes< edm::View >(edm::InputTag(sElectrons_)); // Muons @@ -151,7 +139,7 @@ TopSingleLeptonHLTValidation::TopSingleLeptonHLTValidation(const edm::ParameterS // Jets tokJets_ = consumes< edm::View >(edm::InputTag(sJets_)); // Trigger - tokTrigger_ = consumes(edm::InputTag(sTrigger_)); + tokTrigger_ = consumes(edm::InputTag(sTrigger_, "", "HLT")); } diff --git a/HLTriggerOffline/Top/python/singletopHLTEventValidation_cfi.py b/HLTriggerOffline/Top/python/singletopHLTEventValidation_cfi.py index 3960ae9a6e845..479ea170e93c9 100644 --- a/HLTriggerOffline/Top/python/singletopHLTEventValidation_cfi.py +++ b/HLTriggerOffline/Top/python/singletopHLTEventValidation_cfi.py @@ -5,7 +5,7 @@ # Directory sDir = cms.untracked.string('HLTValidation/SingleTop/SingleMuon/'), # Electrons - sElectrons = cms.untracked.string('gsfElectrons'), + sElectrons = cms.untracked.string('gedGsfElectrons'), ptElectrons = cms.untracked.double(30.), etaElectrons = cms.untracked.double(2.5), isoElectrons = cms.untracked.double(0.1), @@ -31,7 +31,7 @@ # Directory sDir = cms.untracked.string('HLTValidation/SingleTop/SingleElectron/'), # Electrons - sElectrons = cms.untracked.string('gsfElectrons'), + sElectrons = cms.untracked.string('gedGsfElectrons'), ptElectrons = cms.untracked.double(30.), etaElectrons = cms.untracked.double(2.5), isoElectrons = cms.untracked.double(0.1), diff --git a/HLTriggerOffline/Top/python/topDiLeptonHLTEventValidation_cfi.py b/HLTriggerOffline/Top/python/topDiLeptonHLTEventValidation_cfi.py index 9aa78cb24c845..a7cf48a93c441 100644 --- a/HLTriggerOffline/Top/python/topDiLeptonHLTEventValidation_cfi.py +++ b/HLTriggerOffline/Top/python/topDiLeptonHLTEventValidation_cfi.py @@ -5,7 +5,7 @@ # Directory sDir = cms.untracked.string('HLTValidation/Top/DiMuon/'), # Electrons - sElectrons = cms.untracked.string('gsfElectrons'), + sElectrons = cms.untracked.string('gedGsfElectrons'), ptElectrons = cms.untracked.double(20.), etaElectrons = cms.untracked.double(2.5), isoElectrons = cms.untracked.double(0.15), @@ -31,7 +31,7 @@ # Directory sDir = cms.untracked.string('HLTValidation/Top/DiElectron/'), # Electrons - sElectrons = cms.untracked.string('gsfElectrons'), + sElectrons = cms.untracked.string('gedGsfElectrons'), ptElectrons = cms.untracked.double(20.), etaElectrons = cms.untracked.double(2.5), isoElectrons = cms.untracked.double(0.15), @@ -57,7 +57,7 @@ # Directory sDir = cms.untracked.string('HLTValidation/Top/ElecMuon/'), # Electrons - sElectrons = cms.untracked.string('gsfElectrons'), + sElectrons = cms.untracked.string('gedGsfElectrons'), ptElectrons = cms.untracked.double(20.), etaElectrons = cms.untracked.double(2.5), isoElectrons = cms.untracked.double(0.15), diff --git a/HLTriggerOffline/Top/python/topSingleLeptonHLTEventValidation_cfi.py b/HLTriggerOffline/Top/python/topSingleLeptonHLTEventValidation_cfi.py index 069e65eb958f4..36fbfebd6c6f8 100644 --- a/HLTriggerOffline/Top/python/topSingleLeptonHLTEventValidation_cfi.py +++ b/HLTriggerOffline/Top/python/topSingleLeptonHLTEventValidation_cfi.py @@ -5,7 +5,7 @@ # Directory sDir = cms.untracked.string('HLTValidation/Top/SemiMuonic/'), # Electrons - sElectrons = cms.untracked.string('gsfElectrons'), + sElectrons = cms.untracked.string('gedGsfElectrons'), ptElectrons = cms.untracked.double(30.), etaElectrons = cms.untracked.double(2.5), isoElectrons = cms.untracked.double(0.1), @@ -31,7 +31,7 @@ # Directory sDir = cms.untracked.string('HLTValidation/Top/SemiElectronic/'), # Electrons - sElectrons = cms.untracked.string('gsfElectrons'), + sElectrons = cms.untracked.string('gedGsfElectrons'), ptElectrons = cms.untracked.double(30.), etaElectrons = cms.untracked.double(2.5), isoElectrons = cms.untracked.double(0.1), diff --git a/HLTriggerOffline/Top/src/TopDiLeptonHLTValidation.cc b/HLTriggerOffline/Top/src/TopDiLeptonHLTValidation.cc index 2684663706885..d64cfedac123e 100644 --- a/HLTriggerOffline/Top/src/TopDiLeptonHLTValidation.cc +++ b/HLTriggerOffline/Top/src/TopDiLeptonHLTValidation.cc @@ -7,10 +7,10 @@ Description: - Description: compute efficiencies of trigger paths on offline reco selection with respect to pt and eta +Description: compute efficiencies of trigger paths on offline reco selection with respect to pt and eta Implementation: - harvesting +harvesting */ // @@ -51,7 +51,8 @@ TopDiLeptonHLTValidation::analyze(const edm::Event& iEvent, const edm::EventSetu // Electrons Handle< edm::View > electrons; - iEvent.getByToken(tokElectrons_,electrons); + if (!iEvent.getByToken(tokElectrons_,electrons)) + edm::LogWarning("TopDiLeptonHLTValidation") << "Electrons collection not found \n"; unsigned int nGoodE = 0; for(edm::View::const_iterator e = electrons->begin(); e != electrons->end(); ++e){ if (e->pt() < ptElectrons_) continue; @@ -63,7 +64,8 @@ TopDiLeptonHLTValidation::analyze(const edm::Event& iEvent, const edm::EventSetu } // Muons Handle< edm::View > muons; - iEvent.getByToken(tokMuons_,muons); + if (!iEvent.getByToken(tokMuons_,muons)) + edm::LogWarning("TopDiLeptonHLTValidation") << "Muons collection not found \n"; unsigned int nGoodM = 0; for(edm::View::const_iterator m = muons->begin(); m != muons->end(); ++m){ if (!m->isPFMuon() || (!m->isGlobalMuon() && !m->isTrackerMuon())) continue; @@ -76,7 +78,8 @@ TopDiLeptonHLTValidation::analyze(const edm::Event& iEvent, const edm::EventSetu } // Jets Handle< edm::View > jets; - iEvent.getByToken(tokJets_,jets); + if (!iEvent.getByToken(tokJets_,jets)) + edm::LogWarning("TopDiLeptonHLTValidation") << "Jets collection not found \n"; unsigned int nGoodJ = 0; for(edm::View::const_iterator j = jets->begin(); j != jets->end(); ++j){ if (j->pt() < ptJets_) continue; @@ -89,7 +92,8 @@ TopDiLeptonHLTValidation::analyze(const edm::Event& iEvent, const edm::EventSetu //Trigger Handle triggerTable; - iEvent.getByToken(tokTrigger_,triggerTable); + if (!iEvent.getByToken(tokTrigger_,triggerTable)) + edm::LogWarning("TopDiLeptonHLTValidation") << "Trigger collection not found \n"; const edm::TriggerNames& triggerNames = iEvent.triggerNames(*triggerTable); for (unsigned int i=0; isetCurrentFolder(sDir_); - hEffLeptonPt = dbe_->book1D("EfficiencyVsPtLepton", "EfficiencyVsPtLepton", 50, 0., 250.); - hEffLeptonEta = dbe_->book1D("EfficiencyVsEtaLepton", "EfficiencyVsEtaLepton", 30, -3. , 3.); - hEffJetPt = dbe_->book1D("EfficiencyVsPtLastJet", "EfficiencyVsPtLastJet", 60, 0., 300.); - hEffJetEta = dbe_->book1D("EfficiencyVsEtaLastJet", "EfficiencyVsEtaLastJet", 30, -3., 3.); - - //------ Efficiency wrt - // lepton pt - for (int iBin = 1; iBin <= hNumLeptonPt->GetNbinsX(); ++iBin) - { - if(hDenLeptonPt->GetBinContent(iBin) == 0) - hEffLeptonPt->setBinContent(iBin, 0.); - else - hEffLeptonPt->setBinContent(iBin, hNumLeptonPt->GetBinContent(iBin) / hDenLeptonPt->GetBinContent(iBin)); - } - // lepton eta - for (int iBin = 1; iBin <= hNumLeptonEta->GetNbinsX(); ++iBin) - { - if(hDenLeptonEta->GetBinContent(iBin) == 0) - hEffLeptonEta->setBinContent(iBin, 0.); - else - hEffLeptonEta->setBinContent(iBin, hNumLeptonEta->GetBinContent(iBin) / hDenLeptonEta->GetBinContent(iBin)); - } - // jet pt - for (int iBin = 1; iBin <= hNumJetPt->GetNbinsX(); ++iBin) - { - if(hDenJetPt->GetBinContent(iBin) == 0) - hEffJetPt->setBinContent(iBin, 0.); - else - hEffJetPt->setBinContent(iBin, hNumJetPt->GetBinContent(iBin) / hDenJetPt->GetBinContent(iBin)); - } - // jet eta - for (int iBin = 1; iBin <= hNumJetEta->GetNbinsX(); ++iBin) - { - if(hDenJetEta->GetBinContent(iBin) == 0) - hEffJetEta->setBinContent(iBin, 0.); - else - hEffJetEta->setBinContent(iBin, hNumJetEta->GetBinContent(iBin) / hDenJetEta->GetBinContent(iBin)); - } + dbe.setCurrentFolder(sDir_); + hDenLeptonPt = dbe.book1D("PtLeptonAll", "PtLeptonAll", 50, 0., 250.); + hDenLeptonEta = dbe.book1D("EtaLeptonAll", "EtaLeptonAll", 30, -3. , 3.); + hDenJetPt = dbe.book1D("PtLastJetAll", "PtLastJetAll", 60, 0., 300.); + hDenJetEta = dbe.book1D("EtaLastJetAll", "EtaLastJetAll", 30, -3., 3.); + hNumLeptonPt = dbe.book1D("PtLeptonSel", "PtLeptonSel", 50, 0., 250.); + hNumLeptonEta = dbe.book1D("EtaLeptonSel", "EtaLeptonSel", 30, -3. , 3.); + hNumJetPt = dbe.book1D("PtLastJetSel", "PtLastJetSel", 60, 0., 300.); + hNumJetEta = dbe.book1D("EtaLastJetSel", "EtaLastJetSel", 30, -3., 3.); } - -// ------------ method called when starting to processes a luminosity block ------------ -/* - void - TopDiLeptonHLTValidation::beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) - { - } - */ - -// ------------ method called when ending the processing of a luminosity block ------------ -/* - void - TopDiLeptonHLTValidation::endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) - { - } - */ - // ------------ method fills 'descriptions' with the allowed parameters for the module ------------ void TopDiLeptonHLTValidation::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { diff --git a/HLTriggerOffline/Top/src/TopSingleLeptonHLTValidation.cc b/HLTriggerOffline/Top/src/TopSingleLeptonHLTValidation.cc index 69d399eb3e0d2..bf3913c5d4db2 100644 --- a/HLTriggerOffline/Top/src/TopSingleLeptonHLTValidation.cc +++ b/HLTriggerOffline/Top/src/TopSingleLeptonHLTValidation.cc @@ -7,10 +7,10 @@ Description: - Description: compute efficiencies of trigger paths on offline reco selection with respect to pt and eta +Description: compute efficiencies of trigger paths on offline reco selection with respect to pt and eta Implementation: - harvesting +harvesting */ // // Original Author: Elvire Bouvier @@ -43,14 +43,15 @@ // ------------ method called for each event ------------ void TopSingleLeptonHLTValidation::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) -{ +{ using namespace edm; isAll_ = false; isSel_ = false; // Electrons Handle< edm::View > electrons; - iEvent.getByToken(tokElectrons_,electrons); + if (!iEvent.getByToken(tokElectrons_,electrons)) + edm::LogWarning("TopSingleLeptonHLTValidation") << "Electrons collection not found \n"; unsigned int nGoodE = 0; for(edm::View::const_iterator e = electrons->begin(); e != electrons->end(); ++e){ if (e->pt() < ptElectrons_) continue; @@ -61,7 +62,8 @@ TopSingleLeptonHLTValidation::analyze(const edm::Event& iEvent, const edm::Event } // Muons Handle< edm::View > muons; - iEvent.getByToken(tokMuons_,muons); + if (!iEvent.getByToken(tokMuons_,muons)) + edm::LogWarning("TopSingleLeptonHLTValidation") << "Muons collection not found \n"; unsigned int nGoodM = 0; for(edm::View::const_iterator m = muons->begin(); m != muons->end(); ++m){ if (!m->isPFMuon() || !m->isGlobalMuon()) continue; @@ -73,7 +75,8 @@ TopSingleLeptonHLTValidation::analyze(const edm::Event& iEvent, const edm::Event } // Jets Handle< edm::View > jets; - iEvent.getByToken(tokJets_,jets); + if (!iEvent.getByToken(tokJets_,jets)) + edm::LogWarning("TopSingleLeptonHLTValidation") << "Jets collection not found \n"; unsigned int nGoodJ = 0; if (minJets_ == 4) { for(edm::View::const_iterator j = jets->begin(); j != jets->end(); ++j){ @@ -97,19 +100,22 @@ TopSingleLeptonHLTValidation::analyze(const edm::Event& iEvent, const edm::Event if (nGoodE >= minElectrons_ && nGoodM >= minMuons_ && nGoodJ >= minJets_) isAll_ = true; + //Trigger Handle triggerTable; - iEvent.getByToken(tokTrigger_,triggerTable); + if (!iEvent.getByToken(tokTrigger_,triggerTable)) + edm::LogWarning("TopSingleLeptonHLTValidation") << "Trigger collection not found \n"; const edm::TriggerNames& triggerNames = iEvent.triggerNames(*triggerTable); for (unsigned int i=0; isetCurrentFolder(sDir_); - hEffLeptonPt = dbe_->book1D("EfficiencyVsPtLepton", "EfficiencyVsPtLepton", 50, 0., 250.); - hEffLeptonEta = dbe_->book1D("EfficiencyVsEtaLepton", "EfficiencyVsEtaLepton", 30, -3. , 3.); - hEffJetPt = dbe_->book1D("EfficiencyVsPtLastJet", "EfficiencyVsPtLastJet", 60, 0., 300.); - hEffJetEta = dbe_->book1D("EfficiencyVsEtaLastJet", "EfficiencyVsEtaLastJet", 30, -3., 3.); - - //------ Efficiency wrt - // lepton pt - for (int iBin = 1; iBin <= hNumLeptonPt->GetNbinsX(); ++iBin) - { - if(hDenLeptonPt->GetBinContent(iBin) == 0) - hEffLeptonPt->setBinContent(iBin, 0.); - else - hEffLeptonPt->setBinContent(iBin, hNumLeptonPt->GetBinContent(iBin) / hDenLeptonPt->GetBinContent(iBin)); - } - // lepton eta - for (int iBin = 1; iBin <= hNumLeptonEta->GetNbinsX(); ++iBin) - { - if(hDenLeptonEta->GetBinContent(iBin) == 0) - hEffLeptonEta->setBinContent(iBin, 0.); - else - hEffLeptonEta->setBinContent(iBin, hNumLeptonEta->GetBinContent(iBin) / hDenLeptonEta->GetBinContent(iBin)); - } - // jet pt - for (int iBin = 1; iBin <= hNumJetPt->GetNbinsX(); ++iBin) - { - if(hDenJetPt->GetBinContent(iBin) == 0) - hEffJetPt->setBinContent(iBin, 0.); - else - hEffJetPt->setBinContent(iBin, hNumJetPt->GetBinContent(iBin) / hDenJetPt->GetBinContent(iBin)); - } - // jet eta - for (int iBin = 1; iBin <= hNumJetEta->GetNbinsX(); ++iBin) - { - if(hDenJetEta->GetBinContent(iBin) == 0) - hEffJetEta->setBinContent(iBin, 0.); - else - hEffJetEta->setBinContent(iBin, hNumJetEta->GetBinContent(iBin) / hDenJetEta->GetBinContent(iBin)); - } + dbe.setCurrentFolder(sDir_); + hDenLeptonPt = dbe.book1D("PtLeptonAll", "PtLeptonAll", 50, 0., 250.); + hDenLeptonEta = dbe.book1D("EtaLeptonAll", "EtaLeptonAll", 30, -3. , 3.); + hDenJetPt = dbe.book1D("PtLastJetAll", "PtLastJetAll", 60, 0., 300.); + hDenJetEta = dbe.book1D("EtaLastJetAll", "EtaLastJetAll", 30, -3., 3.); + hNumLeptonPt = dbe.book1D("PtLeptonSel", "PtLeptonSel", 50, 0., 250.); + hNumLeptonEta = dbe.book1D("EtaLeptonSel", "EtaLeptonSel", 30, -3. , 3.); + hNumJetPt = dbe.book1D("PtLastJetSel", "PtLastJetSel", 60, 0., 300.); + hNumJetEta = dbe.book1D("EtaLastJetSel", "EtaLastJetSel", 30, -3., 3.); } -// ------------ method called when starting to processes a luminosity block ------------ -/* - void - TopSingleLeptonHLTValidation::beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) - { - } - */ - -// ------------ method called when ending the processing of a luminosity block ------------ -/* - void - TopSingleLeptonHLTValidation::endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) - { - } - */ - // ------------ method fills 'descriptions' with the allowed parameters for the module ------------ void TopSingleLeptonHLTValidation::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { From b8b3782ff7055b5ae9de70e05bf63516942c3936 Mon Sep 17 00:00:00 2001 From: Elvire Bouvier Date: Tue, 11 Feb 2014 11:36:38 +0100 Subject: [PATCH 21/26] fix JetCorrections bug --- DQMOffline/Trigger/python/topHLTOfflineDQM_cff.py | 1 - 1 file changed, 1 deletion(-) diff --git a/DQMOffline/Trigger/python/topHLTOfflineDQM_cff.py b/DQMOffline/Trigger/python/topHLTOfflineDQM_cff.py index 44be7a1806f43..c5053b6d3ed40 100644 --- a/DQMOffline/Trigger/python/topHLTOfflineDQM_cff.py +++ b/DQMOffline/Trigger/python/topHLTOfflineDQM_cff.py @@ -3,7 +3,6 @@ from DQMOffline.Trigger.topDiLeptonHLTEventDQM_cfi import * from DQMOffline.Trigger.topSingleLeptonHLTEventDQM_cfi import * from DQMOffline.Trigger.singletopHLTEventDQM_cfi import * -from JetMETCorrections.Configuration.JetCorrectionProducersAllAlgos_cff import * From a6face1ababf5ab997a9ebf0cb3555ca6a36a111 Mon Sep 17 00:00:00 2001 From: Elvire Bouvier Date: Wed, 12 Feb 2014 12:10:41 +0100 Subject: [PATCH 22/26] the missing file --- .../Top/python/topHLTValidationHarvest_cff.py | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 HLTriggerOffline/Top/python/topHLTValidationHarvest_cff.py diff --git a/HLTriggerOffline/Top/python/topHLTValidationHarvest_cff.py b/HLTriggerOffline/Top/python/topHLTValidationHarvest_cff.py new file mode 100644 index 0000000000000..34f4ed727b45a --- /dev/null +++ b/HLTriggerOffline/Top/python/topHLTValidationHarvest_cff.py @@ -0,0 +1,89 @@ +import FWCore.ParameterSet.Config as cms + +DiMuonHLTValidationHarvest = cms.EDAnalyzer("DQMGenericClient", + subDirs = cms.untracked.vstring("HLTValidation/Top/DiMuon"), + efficiency = cms.vstring( + "hEffLeptonEta 'Efficiency vs Eta Lepton ' EtaLeptonSel EtaLeptonAll ", + "hEffLeptonPt 'Efficiency vs Pt Lepton' PtLeptonSel PtLeptonAll ", + "hEffLastJetEta 'Efficiency vs Eta Last Jet' EtaLastJetSel EtaLastJetAll", + "hEffLastJetPt 'Efficiency vs Pt Last Jet' PtLastJetSel PtLastJetAll" + ), + resolution = cms.vstring(""), + ) + +DiElectronHLTValidationHarvest = cms.EDAnalyzer("DQMGenericClient", + subDirs = cms.untracked.vstring("HLTValidation/Top/DiElectron"), + efficiency = cms.vstring( + "hEffLeptonEta 'Efficiency vs Eta Lepton ' EtaLeptonSel EtaLeptonAll ", + "hEffLeptonPt 'Efficiency vs Pt Lepton' PtLeptonSel PtLeptonAll ", + "hEffLastJetEta 'Efficiency vs Eta Last Jet' EtaLastJetSel EtaLastJetAll", + "hEffLastJetPt 'Efficiency vs Pt Last Jet' PtLastJetSel PtLastJetAll" + ), + resolution = cms.vstring(""), + ) + +ElecMuonHLTValidationHarvest = cms.EDAnalyzer("DQMGenericClient", + subDirs = cms.untracked.vstring("HLTValidation/Top/ElecMuon"), + efficiency = cms.vstring( + "hEffLeptonEta 'Efficiency vs Eta Lepton ' EtaLeptonSel EtaLeptonAll ", + "hEffLeptonPt 'Efficiency vs Pt Lepton' PtLeptonSel PtLeptonAll ", + "hEffLastJetEta 'Efficiency vs Eta Last Jet' EtaLastJetSel EtaLastJetAll", + "hEffLastJetPt 'Efficiency vs Pt Last Jet' PtLastJetSel PtLastJetAll" + ), + resolution = cms.vstring(""), + ) + +topSingleMuonHLTValidationHarvest = cms.EDAnalyzer("DQMGenericClient", + subDirs = cms.untracked.vstring("HLTValidation/Top/SemiMuonic"), + efficiency = cms.vstring( + "hEffLeptonEta 'Efficiency vs Eta Lepton ' EtaLeptonSel EtaLeptonAll ", + "hEffLeptonPt 'Efficiency vs Pt Lepton' PtLeptonSel PtLeptonAll ", + "hEffLastJetEta 'Efficiency vs Eta Last Jet' EtaLastJetSel EtaLastJetAll", + "hEffLastJetPt 'Efficiency vs Pt Last Jet' PtLastJetSel PtLastJetAll" + ), + resolution = cms.vstring(""), + ) + +topSingleElectronHLTValidationHarvest = cms.EDAnalyzer("DQMGenericClient", + subDirs = cms.untracked.vstring("HLTValidation/Top/SemiElectronic"), + efficiency = cms.vstring( + "hEffLeptonEta 'Efficiency vs Eta Lepton ' EtaLeptonSel EtaLeptonAll ", + "hEffLeptonPt 'Efficiency vs Pt Lepton' PtLeptonSel PtLeptonAll ", + "hEffLastJetEta 'Efficiency vs Eta Last Jet' EtaLastJetSel EtaLastJetAll", + "hEffLastJetPt 'Efficiency vs Pt Last Jet' PtLastJetSel PtLastJetAll" + ), + resolution = cms.vstring(""), + ) + +SingleTopSingleMuonHLTValidationHarvest = cms.EDAnalyzer("DQMGenericClient", + subDirs = cms.untracked.vstring("HLTValidation/SingleTop/SingleMuon"), + efficiency = cms.vstring( + "hEffLeptonEta 'Efficiency vs Eta Lepton ' EtaLeptonSel EtaLeptonAll ", + "hEffLeptonPt 'Efficiency vs Pt Lepton' PtLeptonSel PtLeptonAll ", + "hEffLastJetEta 'Efficiency vs Eta Last Jet' EtaLastJetSel EtaLastJetAll", + "hEffLastJetPt 'Efficiency vs Pt Last Jet' PtLastJetSel PtLastJetAll" + ), + resolution = cms.vstring(""), + ) + +SingleTopSingleElectronHLTValidationHarvest = cms.EDAnalyzer("DQMGenericClient", + subDirs = cms.untracked.vstring("HLTValidation/SingleTop/SingleElectron"), + efficiency = cms.vstring( + "hEffLeptonEta 'Efficiency vs Eta Lepton ' EtaLeptonSel EtaLeptonAll ", + "hEffLeptonPt 'Efficiency vs Pt Lepton' PtLeptonSel PtLeptonAll ", + "hEffLastJetEta 'Efficiency vs Eta Last Jet' EtaLastJetSel EtaLastJetAll", + "hEffLastJetPt 'Efficiency vs Pt Last Jet' PtLastJetSel PtLastJetAll" + ), + resolution = cms.vstring(""), + ) + +topHLTriggerValidationHarvest = cms.Sequence( + DiMuonHLTValidationHarvest + *DiElectronHLTValidationHarvest + *ElecMuonHLTValidationHarvest + *topSingleMuonHLTValidationHarvest + *topSingleElectronHLTValidationHarvest + *SingleTopSingleMuonHLTValidationHarvest + *SingleTopSingleElectronHLTValidationHarvest + ) + From b964145af0e50aa54124bec0dde9de09645e36c9 Mon Sep 17 00:00:00 2001 From: Elvire Bouvier Date: Thu, 23 Jan 2014 17:25:56 +0100 Subject: [PATCH 23/26] semi-leptonic ttbar and single top --- HLTriggerOffline/Top/interface/TopSingleLeptonHLTValidation.h | 1 - HLTriggerOffline/Top/src/TopSingleLeptonHLTValidation.cc | 1 - 2 files changed, 2 deletions(-) diff --git a/HLTriggerOffline/Top/interface/TopSingleLeptonHLTValidation.h b/HLTriggerOffline/Top/interface/TopSingleLeptonHLTValidation.h index 6a8f1bddc2e07..d19df03957149 100644 --- a/HLTriggerOffline/Top/interface/TopSingleLeptonHLTValidation.h +++ b/HLTriggerOffline/Top/interface/TopSingleLeptonHLTValidation.h @@ -40,7 +40,6 @@ #include "DataFormats/JetReco/interface/Jet.h" #include "HLTrigger/HLTcore/interface/HLTConfigProvider.h" #include "DataFormats/Common/interface/TriggerResults.h" -//#include "TH1.h" // // class declaration diff --git a/HLTriggerOffline/Top/src/TopSingleLeptonHLTValidation.cc b/HLTriggerOffline/Top/src/TopSingleLeptonHLTValidation.cc index bf3913c5d4db2..a237260b20048 100644 --- a/HLTriggerOffline/Top/src/TopSingleLeptonHLTValidation.cc +++ b/HLTriggerOffline/Top/src/TopSingleLeptonHLTValidation.cc @@ -100,7 +100,6 @@ TopSingleLeptonHLTValidation::analyze(const edm::Event& iEvent, const edm::Event if (nGoodE >= minElectrons_ && nGoodM >= minMuons_ && nGoodJ >= minJets_) isAll_ = true; - //Trigger Handle triggerTable; if (!iEvent.getByToken(tokTrigger_,triggerTable)) From c86661c5ee9c0aee9aec6ecb7e3c5eec3cf2894e Mon Sep 17 00:00:00 2001 From: Elvire Bouvier Date: Thu, 23 Jan 2014 19:35:46 +0100 Subject: [PATCH 24/26] dileptonic ttbar --- HLTriggerOffline/Top/interface/TopDiLeptonHLTValidation.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/HLTriggerOffline/Top/interface/TopDiLeptonHLTValidation.h b/HLTriggerOffline/Top/interface/TopDiLeptonHLTValidation.h index 6203493140655..2da9c591a8705 100644 --- a/HLTriggerOffline/Top/interface/TopDiLeptonHLTValidation.h +++ b/HLTriggerOffline/Top/interface/TopDiLeptonHLTValidation.h @@ -26,7 +26,6 @@ // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" -//#include "FWCore/Framework/interface/EDAnalyzer.h" #include "DQMServices/Core/interface/DQMEDAnalyzer.h" #include "FWCore/Framework/interface/Event.h" @@ -44,7 +43,6 @@ #include "DataFormats/JetReco/interface/Jet.h" #include "HLTrigger/HLTcore/interface/HLTConfigProvider.h" #include "DataFormats/Common/interface/TriggerResults.h" -//#include "TH1.h" // // class declaration From 96b24d51163ac122699bccaf81cb4214b3c895d6 Mon Sep 17 00:00:00 2001 From: Elvire Bouvier Date: Thu, 30 Jan 2014 14:31:32 +0100 Subject: [PATCH 25/26] change of structure to match DQM specificities --- HLTriggerOffline/Top/src/TopSingleLeptonHLTValidation.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/HLTriggerOffline/Top/src/TopSingleLeptonHLTValidation.cc b/HLTriggerOffline/Top/src/TopSingleLeptonHLTValidation.cc index a237260b20048..bf3913c5d4db2 100644 --- a/HLTriggerOffline/Top/src/TopSingleLeptonHLTValidation.cc +++ b/HLTriggerOffline/Top/src/TopSingleLeptonHLTValidation.cc @@ -100,6 +100,7 @@ TopSingleLeptonHLTValidation::analyze(const edm::Event& iEvent, const edm::Event if (nGoodE >= minElectrons_ && nGoodM >= minMuons_ && nGoodJ >= minJets_) isAll_ = true; + //Trigger Handle triggerTable; if (!iEvent.getByToken(tokTrigger_,triggerTable)) From 07697d36af73d43a2ef8ca87900b316983fdc12d Mon Sep 17 00:00:00 2001 From: Elvire Bouvier Date: Wed, 12 Feb 2014 12:10:41 +0100 Subject: [PATCH 26/26] rebase