From dd40da72b1a52921cbebb0ae3882c55fb1d1d496 Mon Sep 17 00:00:00 2001 From: gflouris Date: Thu, 4 Feb 2016 20:10:04 +0100 Subject: [PATCH 01/48] Modifications for HLT76 --- .../plugins/ProcessedTreeProducerBTag.cc | 128 ++++++++---------- .../plugins/ProcessedTreeProducerBTag.h | 65 ++++++--- AnalysisFW/src/QCDPFJetBTag.cc | 1 + AnalysisFW/src/classes.h | 1 + AnalysisFW/src/classes_def.xml | 1 + ...cessedTreeProducer_dataPAT25ns_BTag_cfg.py | 87 ++++++------ 6 files changed, 156 insertions(+), 127 deletions(-) create mode 100644 AnalysisFW/src/QCDPFJetBTag.cc diff --git a/AnalysisFW/plugins/ProcessedTreeProducerBTag.cc b/AnalysisFW/plugins/ProcessedTreeProducerBTag.cc index 398ad5951c4..40b4c28d862 100644 --- a/AnalysisFW/plugins/ProcessedTreeProducerBTag.cc +++ b/AnalysisFW/plugins/ProcessedTreeProducerBTag.cc @@ -19,37 +19,10 @@ #include "FWCore/Common/interface/TriggerNames.h" #include "FWCore/Common/interface/TriggerResultsByName.h" -#include "DataFormats/VertexReco/interface/Vertex.h" -#include "DataFormats/VertexReco/interface/VertexFwd.h" -#include "DataFormats/Common/interface/Handle.h" -#include "DataFormats/Math/interface/deltaR.h" -#include "DataFormats/JetReco/interface/Jet.h" -#include "DataFormats/JetReco/interface/PFJet.h" -#include "DataFormats/JetReco/interface/PFJetCollection.h" -#include "DataFormats/JetReco/interface/GenJet.h" -#include "DataFormats/JetReco/interface/GenJetCollection.h" -#include "DataFormats/JetReco/interface/JetExtendedAssociation.h" -#include "DataFormats/JetReco/interface/JetID.h" -#include "DataFormats/METReco/interface/HcalNoiseSummary.h" -#include "DataFormats/BeamSpot/interface/BeamSpot.h" -#include "DataFormats/TrackReco/interface/TrackFwd.h" - -#include "DataFormats/PatCandidates/interface/MET.h" -#include "DataFormats/PatCandidates/interface/PackedCandidate.h" - -#include "SimDataFormats/GeneratorProducts/interface/GenEventInfoProduct.h" -#include "SimDataFormats/PileupSummaryInfo/interface/PileupSummaryInfo.h" - -#include "CondFormats/JetMETObjects/interface/JetCorrectorParameters.h" -#include "JetMETCorrections/Objects/interface/JetCorrectionsRecord.h" - -#include "PhysicsTools/PatUtils/interface/bJetSelector.h" -#include "PhysicsTools/PatExamples/interface/BTagPerformance.h" -#include "PhysicsTools/PatExamples/interface/PatBTagCommonHistos.h" - -#include "DataFormats/Math/interface/deltaR.h" - -ProcessedTreeProducerBTag::ProcessedTreeProducerBTag(edm::ParameterSet const& cfg) + +ProcessedTreeProducerBTag::ProcessedTreeProducerBTag(edm::ParameterSet const& cfg): +hltPrescale_(cfg, consumesCollector(), *this) + { // mPFJECservice = cfg.getParameter ("pfjecService"); mPFPayloadName = cfg.getParameter ("PFPayloadName"); @@ -62,25 +35,32 @@ ProcessedTreeProducerBTag::ProcessedTreeProducerBTag(edm::ParameterSet const& cf mMinJJMass = cfg.getParameter ("minJJMass"); mMaxY = cfg.getParameter ("maxY"); mMinNPFJets = cfg.getParameter ("minNPFJets"); - mOfflineVertices = cfg.getParameter ("offlineVertices"); - mPFJetsName = cfg.getParameter ("pfjets"); - mPFJetsNameCHS = cfg.getParameter ("pfjetschs"); - mSrcCaloRho = cfg.getParameter ("srcCaloRho"); - mSrcPFRho = cfg.getParameter ("srcPFRho"); + mOfflineVertices =(consumes(cfg.getParameter("offlineVertices"))); + mPFJetsName = consumes >(cfg.getParameter("pfjets")); + mPFJetsNameCHS = consumes >(cfg.getParameter("pfjetschs")); + mSrcCaloRho = consumes(cfg.getParameter("srcCaloRho")); + mSrcPFRho = consumes(cfg.getParameter("srcPFRho")); mPFMET =(consumes(cfg.getParameter("pfmet"))); - mSrcPU = cfg.getUntrackedParameter ("srcPU",edm::InputTag("addPileupInfo")); - mGenJetsName = cfg.getUntrackedParameter ("genjets",edm::InputTag("")); + mSrcPU = consumes >(cfg.getParameter("srcPU")); + mGenJetsName = consumes(cfg.getParameter("genjets")); mPrintTriggerMenu = cfg.getUntrackedParameter ("printTriggerMenu",false); mIsMCarlo = cfg.getUntrackedParameter ("isMCarlo",false); mUseGenInfo = cfg.getUntrackedParameter ("useGenInfo",false); mMinGenPt = cfg.getUntrackedParameter ("minGenPt",30); processName_ = cfg.getParameter ("processName"); triggerNames_ = cfg.getParameter > ("triggerName"); - triggerResultsTag_ = cfg.getParameter ("triggerResults"); - triggerEventTag_ = cfg.getParameter ("triggerEvent"); + triggerResultsTag_ = consumes(cfg.getParameter("triggerResults")); + triggerEventTag_ = consumes(cfg.getParameter("triggerEvent")); mPFJECUncSrc = cfg.getParameter ("jecUncSrc"); mPFJECUncSrcCHS = cfg.getParameter ("jecUncSrcCHS"); mPFJECUncSrcNames = cfg.getParameter > ("jecUncSrcNames"); + mofflineBeamSpot = consumes(cfg.getParameter("offlineBeamSpot")); + noiseSummaryToken = consumes(cfg.getParameter("noiseSummary")); + noiseSummary_NoMinZToken = consumes(cfg.getParameter("noiseSummary_NoMinZ")); + genParticlesToken = consumes(cfg.getParameter("genParticles")); + generatorToken = consumes(cfg.getParameter("generator")); + + } ////////////////////////////////////////////////////////////////////////////////////////// void ProcessedTreeProducerBTag::beginJob() @@ -89,11 +69,11 @@ void ProcessedTreeProducerBTag::beginJob() mEvent = new QCDEvent(); mTree->Branch("events","QCDEvent",&mEvent); mTriggerNamesHisto = fs->make("TriggerNames","TriggerNames",1,0,1); - mTriggerNamesHisto->SetBit(TH1::kCanRebin); + //mTriggerNamesHisto->SetBit(TH1::kCanRebin); for(unsigned i=0;iFill(triggerNames_[i].c_str(),1); mTriggerPassHisto = fs->make("TriggerPass","TriggerPass",1,0,1); - mTriggerPassHisto->SetBit(TH1::kCanRebin); + //mTriggerPassHisto->SetBit(TH1::kCanRebin); isPFJecUncSet_ = false; isPFJecUncSetCHS_ = false; } @@ -105,7 +85,7 @@ void ProcessedTreeProducerBTag::endJob() void ProcessedTreeProducerBTag::beginRun(edm::Run const & iRun, edm::EventSetup const& iSetup) { bool changed(true); - if (hltConfig_.init(iRun,iSetup,processName_,changed)) { + if (hltConfig_.init(iRun,iSetup,processName_,changed) && hltPrescale_.init(iRun, iSetup, processName_, changed) ) { if (changed) { // check if trigger names in (new) config cout<<"New trigger menu found !!!"< beamSpot; - event.getByLabel("offlineBeamSpot", beamSpot); + event.getByToken(mofflineBeamSpot, beamSpot); if (beamSpot.isValid()) mEvtHdr.setBS(beamSpot->x0(),beamSpot->y0(),beamSpot->z0()); else @@ -157,15 +137,13 @@ void ProcessedTreeProducerBTag::analyze(edm::Event const& event, edm::EventSetup //-------------- HCAL Noise Summary ----------------------------- - Handle noiseSummary; - Handle noiseSummary_NoMinZ; + edm::Handle noiseSummary; + edm::Handle noiseSummary_NoMinZ; if (!mIsMCarlo) { - // event.getByLabel(mHBHENoiseFilter,noiseSummary); - event.getByLabel(edm::InputTag("HBHENoiseFilterResultProducer","HBHENoiseFilterResult"), noiseSummary); + event.getByToken(noiseSummaryToken, noiseSummary); mEvtHdr.setHCALNoise(*noiseSummary); - - event.getByLabel(edm::InputTag("HBHENoiseFilterResultProducerNoMinZ","HBHENoiseFilterResult"), noiseSummary_NoMinZ); + event.getByToken(noiseSummary_NoMinZToken, noiseSummary_NoMinZ); mEvtHdr.setHCALNoiseNoMinZ(*noiseSummary_NoMinZ); } @@ -173,21 +151,24 @@ void ProcessedTreeProducerBTag::analyze(edm::Event const& event, edm::EventSetup mEvtHdr.setHCALNoise(true); mEvtHdr.setHCALNoiseNoMinZ(true); } + + //-------------- Trigger Info ----------------------------------- - event.getByLabel(triggerResultsTag_,triggerResultsHandle_); + event.getByToken(triggerResultsTag_,triggerResultsHandle_); if (!triggerResultsHandle_.isValid()) { cout << "ProcessedTreeProducerBTag::analyze: Error in getting TriggerResults product from Event!" << endl; return; } - event.getByLabel(triggerEventTag_,triggerEventHandle_); + event.getByToken(triggerEventTag_,triggerEventHandle_); if (!triggerEventHandle_.isValid()) { cout << "ProcessedTreeProducerBTag::analyze: Error in getting TriggerEvent product from Event!" << endl; return; } + vector L1Prescales,HLTPrescales,Fired; vector > mL1Objects,mHLTObjects; // sanity check - assert(triggerResultsHandle_->size() == hltConfig_.size()); + //assert(triggerResultsHandle_->size() == hltConfig_.size()); //------ loop over all trigger names --------- for(unsigned itrig=0;itrig vvL1,vvHLT; if (triggerIndex_[itrig] < hltConfig_.size()) { accept = triggerResultsHandle_->accept(triggerIndex_[itrig]); -// const std::pair prescales(hltConfig_.prescaleValues(event,iSetup,triggerNames_[itrig])); + //const std::pair prescales(hltPrescale_.prescaleValues(event,iSetup,triggerNames_[itrig])); + //const std::pair prescales(hltConfig_.prescaleValues(event,iSetup,triggerNames_[itrig])); // const std::pair prescales(hltConfig_.prescaleValues(event,iSetup,triggerNames_[itrig])); + //preL1 = prescales.first; + //preHLT = prescales.second; ///In detail //get prescale info from hltConfig_ - std::pair >,int> detailedPrescaleInfo = hltConfig_.prescaleValuesInDetail(event, iSetup, triggerNames_[itrig]); + std::pair >,int> detailedPrescaleInfo = hltPrescale_.prescaleValuesInDetail(event, iSetup, triggerNames_[itrig]); preHLT = detailedPrescaleInfo.second ; + // save l1 prescale values in standalone vector std::vector l1prescalevals; for( size_t varind = 0; varind < detailedPrescaleInfo.first.size(); varind++ ){ - l1prescalevals.push_back(detailedPrescaleInfo.first.at(varind).second); - + l1prescalevals.push_back(detailedPrescaleInfo.first.at(varind).second); } + // find and save minimum l1 prescale of any ORed L1 that seeds the HLT std::vector::iterator result = std::min_element(std::begin(l1prescalevals), std::end(l1prescalevals)); size_t minind = std::distance(std::begin(l1prescalevals), result); // sometimes there are no L1s associated with a HLT. In that case, this branch stores -1 for the l1prescale - //l1prescales->push_back( minind < l1prescalevals.size() ? l1prescalevals.at(minind) : -1 ); preL1 = minind < l1prescalevals.size() ? l1prescalevals.at(minind) : -1 ; ///end in detail -// preL1 = prescales.first; -/// preHLT = prescales.second; + if (!accept) tmpFired = 0; else { @@ -280,7 +263,7 @@ void ProcessedTreeProducerBTag::analyze(edm::Event const& event, edm::EventSetup //-------------- Vertex Info ----------------------------------- Handle recVtxs; - event.getByLabel(mOfflineVertices,recVtxs); + event.getByToken(mOfflineVertices,recVtxs); //------------- reject events without reco vertices ------------ int VtxGood(0); bool isPVgood(false); @@ -304,23 +287,24 @@ void ProcessedTreeProducerBTag::analyze(edm::Event const& event, edm::EventSetup mEvtHdr.setPV(isPVgood,PVndof,PVx,PVy,PVz); //-------------- Rho ------------------------------------------------ Handle rhoCalo; - event.getByLabel(mSrcCaloRho,rhoCalo); + event.getByToken(mSrcCaloRho,rhoCalo); Handle rhoPF; - event.getByLabel(mSrcPFRho,rhoPF); + event.getByToken(mSrcPFRho,rhoPF); mEvtHdr.setRho(*rhoCalo,*rhoPF); //-------------- Generator Info ------------------------------------- Handle hEventInfo; //-------------- Simulated PU Info ---------------------------------- Handle > PupInfo; if (mIsMCarlo && mUseGenInfo) { - event.getByLabel("generator", hEventInfo); + //event.getByToken("generator", hEventInfo); + event.getByToken(generatorToken, hEventInfo); if(hEventInfo->hasBinningValues()) mEvtHdr.setPthat(hEventInfo->binningValues()[0]); else mEvtHdr.setPthat(0); mEvtHdr.setWeight(hEventInfo->weight()); - event.getByLabel(mSrcPU, PupInfo); + event.getByToken(mSrcPU, PupInfo); std::vector::const_iterator PUI; int nbx = PupInfo->size(); int ootpuEarly(0),ootpuLate(0),intpu(0); @@ -369,7 +353,7 @@ void ProcessedTreeProducerBTag::analyze(edm::Event const& event, edm::EventSetup Handle genjets; if (mIsMCarlo) { - event.getByLabel(mGenJetsName,genjets); + event.getByToken(mGenJetsName,genjets); for(GenJetCollection::const_iterator i_gen = genjets->begin(); i_gen != genjets->end(); i_gen++) { if (i_gen->pt() > mMinGenPt && fabs(i_gen->y()) < mMaxY) { mGenJets.push_back(i_gen->p4()); @@ -391,10 +375,10 @@ void ProcessedTreeProducerBTag::analyze(edm::Event const& event, edm::EventSetup //----------- PFJets non CHS part ------------------------- edm::Handle > patjets; - event.getByLabel(mPFJetsName,patjets); + event.getByToken(mPFJetsName,patjets); /*edm::Handle btagDiscriminators; - event.getByLabel("pfCombinedInclusiveSecondaryVertexV2BJetTags", btagDiscriminators); */ + event.getByToken("pfCombinedInclusiveSecondaryVertexV2BJetTags", btagDiscriminators); */ for(edm::View::const_iterator i_pfjet=patjets->begin(); i_pfjet!=patjets->end(); ++i_pfjet) { @@ -607,7 +591,7 @@ void ProcessedTreeProducerBTag::analyze(edm::Event const& event, edm::EventSetup //----------- PFJets CHS part ------------------------- edm::Handle > patjetschs; - event.getByLabel(mPFJetsNameCHS,patjetschs); + event.getByToken(mPFJetsNameCHS,patjetschs); for(edm::View::const_iterator i_pfjetchs=patjetschs->begin(); i_pfjetchs!=patjetschs->end(); ++i_pfjetchs) { @@ -839,7 +823,8 @@ int ProcessedTreeProducerBTag::getMatchedPartonGen(edm::Event const& event,GenJe bool switchC=0; edm::Handle genParticles; - event.getByLabel ("genParticles", genParticles); + //event.getByToken ("genParticles", genParticles); + event.getByToken (genParticlesToken, genParticles); for (size_t i = 0; i < genParticles->size (); ++i) { const GenParticle & genIt = (*genParticles)[i]; @@ -870,7 +855,8 @@ int ProcessedTreeProducerBTag::getMatchedHadronGen(edm::Event const& event,GenJe int jetFlavour=-100; edm::Handle genParticles; - event.getByLabel ("genParticles", genParticles); + //event.getByToken ("genParticles", genParticles); + event.getByToken (genParticlesToken, genParticles); for (size_t i = 0; i < genParticles->size (); ++i) { const GenParticle & genIt = (*genParticles)[i]; diff --git a/AnalysisFW/plugins/ProcessedTreeProducerBTag.h b/AnalysisFW/plugins/ProcessedTreeProducerBTag.h index 5a3d7fff142..d3a0e58c4b6 100644 --- a/AnalysisFW/plugins/ProcessedTreeProducerBTag.h +++ b/AnalysisFW/plugins/ProcessedTreeProducerBTag.h @@ -1,26 +1,50 @@ #ifndef ProcessedTreeProducerBTag_h #define ProcessedTreeProducerBTag_h +#include "SMPJ/AnalysisFW/interface/QCDJet.h" +#include "SMPJ/AnalysisFW/interface/QCDEvent.h" +#include "SMPJ/AnalysisFW/interface/QCDEventHdr.h" +#include "SMPJ/AnalysisFW/interface/QCDPFJet.h" +#include "SMPJ/AnalysisFW/interface/QCDPFJetBTag.h" +#include "SMPJ/AnalysisFW/interface/QCDMET.h" + + #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EDAnalyzer.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "HLTrigger/HLTcore/interface/HLTConfigProvider.h" +#include "HLTrigger/HLTcore/interface/HLTPrescaleProvider.h" #include "DataFormats/Common/interface/TriggerResults.h" #include "DataFormats/HLTReco/interface/TriggerEvent.h" #include "JetMETCorrections/Objects/interface/JetCorrector.h" #include "CondFormats/JetMETObjects/interface/JetCorrectionUncertainty.h" #include "DataFormats/PatCandidates/interface/Jet.h" #include "DataFormats/PatCandidates/interface/JetCorrFactors.h" -#include "SMPJ/AnalysisFW/interface/QCDJet.h" -#include "SMPJ/AnalysisFW/interface/QCDEvent.h" -#include "SMPJ/AnalysisFW/interface/QCDEventHdr.h" -#include "SMPJ/AnalysisFW/interface/QCDPFJet.h" -#include "SMPJ/AnalysisFW/interface/QCDPFJetBTag.h" -#include "SMPJ/AnalysisFW/interface/QCDMET.h" +#include "CondFormats/JetMETObjects/interface/JetCorrectorParameters.h" +#include "JetMETCorrections/Objects/interface/JetCorrectionsRecord.h" #include "FWCore/ServiceRegistry/interface/Service.h" #include "CommonTools/UtilAlgos/interface/TFileService.h" #include "DataFormats/PatCandidates/interface/MET.h" #include "DataFormats/PatCandidates/interface/PackedCandidate.h" +#include "DataFormats/VertexReco/interface/Vertex.h" +#include "DataFormats/VertexReco/interface/VertexFwd.h" +#include "DataFormats/Common/interface/Handle.h" +#include "DataFormats/Math/interface/deltaR.h" +#include "DataFormats/JetReco/interface/PFJet.h" +#include "DataFormats/JetReco/interface/PFJetCollection.h" +#include "DataFormats/JetReco/interface/GenJet.h" +#include "DataFormats/JetReco/interface/GenJetCollection.h" +#include "DataFormats/JetReco/interface/JetExtendedAssociation.h" +#include "DataFormats/JetReco/interface/JetID.h" +#include "DataFormats/METReco/interface/HcalNoiseSummary.h" +#include "DataFormats/BeamSpot/interface/BeamSpot.h" +#include "DataFormats/TrackReco/interface/TrackFwd.h" +#include "SimDataFormats/GeneratorProducts/interface/GenEventInfoProduct.h" +#include "SimDataFormats/PileupSummaryInfo/interface/PileupSummaryInfo.h" +#include "PhysicsTools/PatUtils/interface/bJetSelector.h" +#include "PhysicsTools/PatExamples/interface/BTagPerformance.h" +#include "PhysicsTools/PatExamples/interface/PatBTagCommonHistos.h" +#include "DataFormats/Math/interface/deltaR.h" using namespace edm; using namespace reco; @@ -63,26 +87,32 @@ class ProcessedTreeProducerBTag : public edm::EDAnalyzer std::vector mPFJECUncSrcNames; std::vector mBDiscriminators; // ---- non CHS jet input tag ----- // - edm::InputTag mPFJetsName; + edm::EDGetTokenT > mPFJetsName; // ----CHS jet input tag ----- // - edm::InputTag mPFJetsNameCHS; - edm::InputTag mGenJetsName; - edm::InputTag mOfflineVertices; - edm::InputTag mSrcCaloRho; - edm::InputTag mSrcPFRho; - edm::InputTag mSrcPU; - //edm::InputTag mPFMET; - edm::EDGetTokenT mPFMET; + edm::EDGetTokenT > mPFJetsNameCHS; + edm::EDGetTokenT mGenJetsName; + edm::EDGetTokenT mOfflineVertices; + edm::EDGetTokenT mSrcCaloRho; + edm::EDGetTokenT mSrcPFRho; + edm::EDGetTokenT > mSrcPU; + edm::EDGetTokenT mofflineBeamSpot; + edm::EDGetTokenT mPFMET; + edm::EDGetTokenT noiseSummaryToken; + edm::EDGetTokenT noiseSummary_NoMinZToken; + edm::EDGetTokenT genParticlesToken; + edm::EDGetTokenT generatorToken; + //edm::InputTag mHBHENoiseFilter; //---- TRIGGER ------------------------- std::string processName_; std::vector triggerNames_; std::vector triggerIndex_; - edm::InputTag triggerResultsTag_; - edm::InputTag triggerEventTag_; + edm::EDGetTokenT triggerResultsTag_; + edm::EDGetTokenT triggerEventTag_; edm::Handle triggerResultsHandle_; edm::Handle triggerEventHandle_; HLTConfigProvider hltConfig_; + HLTPrescaleProvider hltPrescale_; //---- CORRECTORS ---------------------- const JetCorrector *mPFJEC; // ---- non CHS jet uncertainty ------ // @@ -103,6 +133,7 @@ class ProcessedTreeProducerBTag : public edm::EDAnalyzer int getMatchedPartonGen(edm::Event const& event, GenJetCollection::const_iterator i_gen); int getMatchedHadronGen(edm::Event const& event, GenJetCollection::const_iterator i_gen); + }; #endif diff --git a/AnalysisFW/src/QCDPFJetBTag.cc b/AnalysisFW/src/QCDPFJetBTag.cc new file mode 100644 index 00000000000..2783d0e92be --- /dev/null +++ b/AnalysisFW/src/QCDPFJetBTag.cc @@ -0,0 +1 @@ +#include "SMPJ/AnalysisFW/interface/QCDPFJetBTag.h" diff --git a/AnalysisFW/src/classes.h b/AnalysisFW/src/classes.h index b47428a8572..3cab218b872 100644 --- a/AnalysisFW/src/classes.h +++ b/AnalysisFW/src/classes.h @@ -4,6 +4,7 @@ #include "SMPJ/AnalysisFW/interface/QCDPFJet.h" #include "SMPJ/AnalysisFW/interface/QCDEvent.h" #include "SMPJ/AnalysisFW/interface/QCDEventHdr.h" +#include "SMPJ/AnalysisFW/interface/QCDPFJetBTag.h" QCDMET qcdmet; QCDJet qcdjet; diff --git a/AnalysisFW/src/classes_def.xml b/AnalysisFW/src/classes_def.xml index b105d803752..6fceeea34ea 100644 --- a/AnalysisFW/src/classes_def.xml +++ b/AnalysisFW/src/classes_def.xml @@ -6,5 +6,6 @@ + diff --git a/AnalysisFW/test/ProcessedTreeProducer_dataPAT25ns_BTag_cfg.py b/AnalysisFW/test/ProcessedTreeProducer_dataPAT25ns_BTag_cfg.py index 151d042e2d6..8dd99d3cd9b 100644 --- a/AnalysisFW/test/ProcessedTreeProducer_dataPAT25ns_BTag_cfg.py +++ b/AnalysisFW/test/ProcessedTreeProducer_dataPAT25ns_BTag_cfg.py @@ -3,10 +3,10 @@ import FWCore.ParameterSet.Config as cms from RecoJets.Configuration.RecoPFJets_cff import ak4PFJets, ak4PFJetsCHS -from RecoJets.Configuration.RecoGenJets_cff import ak4GenJets +#from RecoJets.Configuration.RecoGenJets_cff import ak4GenJets from RecoJets.JetProducers.SubJetParameters_cfi import SubJetParameters from RecoJets.JetProducers.PFJetParameters_cfi import * -from RecoJets.JetProducers.GenJetParameters_cfi import * +#from RecoJets.JetProducers.GenJetParameters_cfi import * from RecoJets.JetProducers.AnomalousCellParameters_cfi import * from PhysicsTools.PatAlgos.producersLayer1.patCandidates_cff import * from PhysicsTools.PatAlgos.selectionLayer1.jetSelector_cfi import selectedPatJets @@ -32,16 +32,15 @@ process.load("Configuration.EventContent.EventContent_cff") process.load('Configuration.StandardSequences.GeometryRecoDB_cff') process.load('Configuration.StandardSequences.MagneticField_38T_cff') -process.load('RecoJets.Configuration.GenJetParticles_cff') -process.load('RecoJets.Configuration.RecoGenJets_cff') +#process.load('RecoJets.Configuration.GenJetParticles_cff') +#process.load('RecoJets.Configuration.RecoGenJets_cff') process.load('RecoJets.JetProducers.TrackJetParameters_cfi') process.load('RecoJets.JetProducers.PileupJetIDParams_cfi') process.load("PhysicsTools.PatAlgos.patSequences_cff") #process.load("PhysicsTools.PatAlgos.slimming.pileupJetId_cfi") -#process.GlobalTag.globaltag = "74X_dataRun2_Prompt_v4" -process.GlobalTag.globaltag = "74X_dataRun2_v5" +process.GlobalTag.globaltag = "76X_dataRun2_v15" ##-------------------- Import the JEC services ----------------------- process.load('JetMETCorrections.Configuration.DefaultJEC_cff') @@ -55,7 +54,8 @@ #'root://xrootd.unl.edu//store/data/Run2015D/JetHT/AOD/PromptReco-v3/000/256/630/00000/BC44672C-345F-E511-BEA5-02163E0141FB.root' #'root://xrootd.unl.edu//store/data/Run2015C/JetHT/AOD/PromptReco-v1/000/253/890/00000/24D029CE-2741-E511-B0AF-02163E014604.root' #'root://xrootd.unl.edu//store/data/Run2015D/JetHT/AOD/PromptReco-v3/000/256/674/00000/36D872F3-F95E-E511-870B-02163E013539.root' -'root://xrootd.unl.edu//store/data/Run2015D/JetHT/AOD/PromptReco-v3/000/256/729/00000/5C1F5529-F65F-E511-9B8C-02163E0145D9.root' +#'root://xrootd.unl.edu//store/data/Run2015D/JetHT/AOD/PromptReco-v3/000/256/729/00000/5C1F5529-F65F-E511-9B8C-02163E0145D9.root' + 'file:/afs/cern.ch/work/g/gflouris/Ntuples_13TeV/CMSSW_7_6_3/src/SMPJ/AnalysisFW/test/5C1F5529-F65F-E511-9B8C-02163E0145D9.root' ) process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(100)) @@ -80,8 +80,11 @@ def jetToolbox( proc, jetType, jetSequence,PUMethod='', bTagDiscriminators = Non elemToKeep = [] print 'Running processes with: '+str(jetALGO)+' PF '+PUMethod+' jet algorithm with radius parameter '+str(jetSize) + if(size=='7') : + JETCorrPayload = 'AK8PF'+PUMethod.lower() + else : + JETCorrPayload = 'AK'+size+'PF'+PUMethod.lower() - JETCorrPayload = 'AK'+size+'PF'+PUMethod.lower() JETCorrLevels = ['L1FastJet', 'L2Relative', 'L3Absolute','L2L3Residual'] #JETCorrLevels = [] #No JEC corrections JEC = ( JETCorrPayload, JETCorrLevels , 'None') @@ -97,9 +100,9 @@ def jetToolbox( proc, jetType, jetSequence,PUMethod='', bTagDiscriminators = Non tvLabel = '' toolsUsed = [] - proc.load('RecoJets.Configuration.GenJetParticles_cff') - setattr( proc, jetalgo+'GenJetsNoNu', ak4GenJets.clone( src = 'genParticlesForJetsNoNu', rParam = jetSize, jetAlgorithm = algorithm ) ) - jetSeq += getattr(proc, jetalgo+'GenJetsNoNu' ) + #proc.load('RecoJets.Configuration.GenJetParticles_cff') + #setattr( proc, jetalgo+'GenJetsNoNu', ak4GenJets.clone( src = 'genParticlesForJetsNoNu', rParam = jetSize, jetAlgorithm = algorithm ) ) + #jetSeq += getattr(proc, jetalgo+'GenJetsNoNu' ) proc.load('CommonTools.ParticleFlow.pfNoPileUpJME_cff') #### Creating PATjets @@ -137,7 +140,7 @@ def jetToolbox( proc, jetType, jetSequence,PUMethod='', bTagDiscriminators = Non jetCorrections = JEC, #( 'AK'+size+'PFchs', cms.vstring( ['L1FastJet', 'L2Relative', 'L3Absolute']), 'None'), pfCandidates = cms.InputTag( 'particleFlow' ), #'packedPFCandidates'), svSource = cms.InputTag('inclusiveCandidateSecondaryVertices'), - genJetCollection = cms.InputTag( jetalgo+'GenJetsNoNu'), + #genJetCollection = cms.InputTag( ''), pvSource = cms.InputTag( 'offlinePrimaryVertices' ), #'offlineSlimmedPrimaryVertices'), jetTrackAssociation = True, @@ -167,7 +170,7 @@ def jetToolbox( proc, jetType, jetSequence,PUMethod='', bTagDiscriminators = Non #getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod).userData.userFloats.src += [jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator:fullDiscriminant'] #getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod).userData.userInts.src += [jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator:cutbasedId',jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator:fullId'] - getattr(proc,'patJetPartons').particles = cms.InputTag( 'genParticles' ) #'prunedGenParticles') + #getattr(proc,'patJetPartons').particles = cms.InputTag( 'genParticles' ) #'prunedGenParticles') setattr(proc, 'selectedPatJets'+jetALGO+'PF'+PUMethod, selectedPatJets.clone( src = 'patJets'+jetALGO+'PF'+PUMethod ) ) setattr(proc, jetSequence, jetSeq) @@ -196,6 +199,11 @@ def jetToolbox( proc, jetType, jetSequence,PUMethod='', bTagDiscriminators = Non process.patJets.addAssociatedTracks = True process.ak4 = cms.EDAnalyzer('ProcessedTreeProducerBTag', + noiseSummary = cms.InputTag("HBHENoiseFilterResultProducer","HBHENoiseFilterResult"), + noiseSummary_NoMinZ = cms.InputTag("HBHENoiseFilterResultProducerNoMinZ","HBHENoiseFilterResult"), + genParticles = cms.InputTag('genParticles'), + generator = cms.InputTag('generator'), + offlineBeamSpot = cms.InputTag('offlineBeamSpot'), ## jet collections ########################### pfjets = cms.InputTag('selectedPatJetsAK4PF'), pfjetschs = cms.InputTag('selectedPatJetsAK4PFCHS'), @@ -203,7 +211,7 @@ def jetToolbox( proc, jetType, jetSequence,PUMethod='', bTagDiscriminators = Non pfchsjetpuid = cms.string('AK4PFCHSpileupJetIdEvaluator:fullDiscriminant'), ## MET collection #### pfmet = cms.InputTag('patMETs'), - genjets = cms.untracked.InputTag('ak4GenJetsNoNu'), + genjets = cms.InputTag('ak4GenJetsNoNu'), ## database entry for the uncertainties ###### PFPayloadName = cms.string('AK4PF'), PFPayloadNameCHS= cms.string('AK4PFchs'), @@ -217,36 +225,37 @@ def jetToolbox( proc, jetType, jetSequence,PUMethod='', bTagDiscriminators = Non ## rho ####################################### srcCaloRho = cms.InputTag('fixedGridRhoFastjetAllCalo'), srcPFRho = cms.InputTag('fixedGridRhoFastjetAll'), - srcPU = cms.untracked.InputTag('addPileupInfo'), + srcPU = cms.InputTag('addPileupInfo'), ## preselection cuts ######################### maxY = cms.double(5.0), minPFPt = cms.double(20), minNPFJets = cms.int32(1), minGenPt = cms.untracked.double(20), minJJMass = cms.double(-1), - isMCarlo = cms.untracked.bool(False), - useGenInfo = cms.untracked.bool(False), + isMCarlo = cms.untracked.bool(False), + useGenInfo = cms.untracked.bool(False), ## trigger ################################### printTriggerMenu = cms.untracked.bool(True), processName = cms.string('HLT'), - triggerName = cms.vstring('HLT_PFJet40_v3','HLT_PFJet60_v3', 'HLT_PFJet80_v3', 'HLT_PFJet140_v3', 'HLT_PFJet200_v3', 'HLT_PFJet260_v3','HLT_PFJet320_v3', 'HLT_PFJet400_v3', 'HLT_PFJet450_v3','HLT_PFJet500_v3','HLT_PFHT600_v3','HLT_PFHT650_v3','HLT_PFHT800_v2','HLT_PFHT200_v2','HLT_PFHT250_v2','HLT_PFHT300_v2','HLT_PFHT350_v3','HLT_PFHT400_v2','HLT_PFHT475_v2','HLT_ZeroBias_v2','HLT_AK4PFJet30_v3','HLT_AK4PFJet50_v3','HLT_AK4PFJet80_v3','HLT_AK4PFJet100_v3'), + triggerName = cms.vstring('HLT_PFJet40_v3','HLT_PFJet60_v3', 'HLT_PFJet80_v3', 'HLT_PFJet140_v3', 'HLT_PFJet200_v3', 'HLT_PFJet260_v3','HLT_PFJet320_v3', 'HLT_PFJet400_v3', 'HLT_PFJet450_v3','HLT_PFJet500_v3', + 'HLT_PFHT200_v2','HLT_PFHT250_v2','HLT_PFHT300_v2','HLT_PFHT350_v3','HLT_PFHT400_v2','HLT_PFHT475_v2','HLT_PFHT600_v3','HLT_PFHT650_v3','HLT_PFHT800_v2','HLT_ZeroBias_v2','HLT_AK4PFJet30_v3','HLT_AK4PFJet50_v3','HLT_AK4PFJet80_v3','HLT_AK4PFJet100_v3'), triggerResults = cms.InputTag("TriggerResults","","HLT"), triggerEvent = cms.InputTag("hltTriggerSummaryAOD","","HLT"), ## jec services ############################## #pfjecService = cms.string('ak7PFL1FastL2L3Residual'), ) -jetToolbox( process, 'ak8', 'ak8JetSubs','CHS') -jetToolbox( process, 'ak8', 'ak8JetSubs') +# jetToolbox( process, 'ak8', 'ak8JetSubs','CHS') +# jetToolbox( process, 'ak8', 'ak8JetSubs') -process.ak8 = process.ak4.clone( - pfjets = cms.InputTag('selectedPatJetsAK8PF'), - pfjetschs = cms.InputTag('selectedPatJetsAK8PFCHS'), - pfpujetid = cms.string('AK8PFpileupJetIdEvaluator:fullDiscriminant'), - pfchsjetpuid = cms.string('AK8PFCHSpileupJetIdEvaluator:fullDiscriminant'), - PFPayloadName = cms.string('AK8PF'), - PFPayloadNameCHS= cms.string('AK8PFchs'), -) +# process.ak8 = process.ak4.clone( +# pfjets = cms.InputTag('selectedPatJetsAK8PF'), +# pfjetschs = cms.InputTag('selectedPatJetsAK8PFCHS'), +# pfpujetid = cms.string('AK8PFpileupJetIdEvaluator:fullDiscriminant'), +# pfchsjetpuid = cms.string('AK8PFCHSpileupJetIdEvaluator:fullDiscriminant'), +# PFPayloadName = cms.string('AK8PF'), +# PFPayloadNameCHS= cms.string('AK8PFchs'), +# ) jetToolbox( process, 'ak7', 'ak7JetSubs','CHS') jetToolbox( process, 'ak7', 'ak7JetSubs') @@ -260,17 +269,17 @@ def jetToolbox( proc, jetType, jetSequence,PUMethod='', bTagDiscriminators = Non PFPayloadNameCHS= cms.string('AK7PFchs'), ) -jetToolbox( process, 'ak5', 'ak5JetSubs','CHS') -jetToolbox( process, 'ak5', 'ak5JetSubs') - -process.ak5 = process.ak4.clone( - pfjets = cms.InputTag('selectedPatJetsAK5PF'), - pfjetschs = cms.InputTag('selectedPatJetsAK5PFCHS'), - pfpujetid = cms.string('AK5PFpileupJetIdEvaluator:fullDiscriminant'), - pfchsjetpuid = cms.string('AK5PFCHSpileupJetIdEvaluator:fullDiscriminant'), - PFPayloadName = cms.string('AK5PF'), - PFPayloadNameCHS= cms.string('AK5PFchs'), -) +# jetToolbox( process, 'ak5', 'ak5JetSubs','CHS') +# jetToolbox( process, 'ak5', 'ak5JetSubs') + +# process.ak5 = process.ak4.clone( +# pfjets = cms.InputTag('selectedPatJetsAK5PF'), +# pfjetschs = cms.InputTag('selectedPatJetsAK5PFCHS'), +# pfpujetid = cms.string('AK5PFpileupJetIdEvaluator:fullDiscriminant'), +# pfchsjetpuid = cms.string('AK5PFCHSpileupJetIdEvaluator:fullDiscriminant'), +# PFPayloadName = cms.string('AK5PF'), +# PFPayloadNameCHS= cms.string('AK5PFchs'), +# ) ############# hlt filter ######################### process.hltFilter = cms.EDFilter('HLTHighLevel', From 5e490f4c69e5824865823d1e3de9750295cb04d7 Mon Sep 17 00:00:00 2001 From: gflouris Date: Thu, 4 Feb 2016 20:18:45 +0100 Subject: [PATCH 02/48] rm all for first version in 76 --- AnalysisFW/plugins/Analysis_Template_MC.cc | 208 ----- AnalysisFW/plugins/Analysis_Template_MC.h | 83 -- AnalysisFW/plugins/JECs.h | 445 --------- AnalysisFW/plugins/NewTreeAnalyzer.cc | 878 ------------------ AnalysisFW/plugins/NewTreeAnalyzer.h | 216 ----- AnalysisFW/plugins/ProcessedTreeProducer.cc | 732 --------------- AnalysisFW/plugins/ProcessedTreeProducer.h | 102 -- .../plugins/ProcessedTreeProducerGEN.cc | 85 -- AnalysisFW/plugins/ProcessedTreeProducerGEN.h | 46 - .../plugins/ProcessedTreeProducerPFCalo.cc | 554 ----------- .../plugins/ProcessedTreeProducerPFCalo.h | 90 -- .../plugins/ProcessedTreeProducer_miniAOD.cc | 810 ---------------- .../plugins/ProcessedTreeProducer_miniAOD.h | 140 --- AnalysisFW/test/Analysis_Template_Data.py | 45 - AnalysisFW/test/Analysis_Template_MC.py | 46 - .../test/ProcessedTreeProducerGEN_mc_cfg.py | 32 - ...rocessedTreeProducer_dataPAT_SQLite_cfg.py | 421 --------- .../test/ProcessedTreeProducer_dataPAT_cfg.py | 314 ------- .../ProcessedTreeProducer_dataPFCalo_cfg.py | 116 --- .../test/ProcessedTreeProducer_data_cfg.py | 137 --- .../ProcessedTreeProducer_mcPAT_SQLite_cfg.py | 349 ------- .../test/ProcessedTreeProducer_mcPAT_cfg.py | 285 ------ ...ProcessedTreeProducer_mcPAT_miniAOD_cfg.py | 253 ----- .../test/ProcessedTreeProducer_mc_cfg.py | 89 -- AnalysisFW/test/globaltag_to_txt.py | 20 - 25 files changed, 6496 deletions(-) delete mode 100644 AnalysisFW/plugins/Analysis_Template_MC.cc delete mode 100644 AnalysisFW/plugins/Analysis_Template_MC.h delete mode 100644 AnalysisFW/plugins/JECs.h delete mode 100644 AnalysisFW/plugins/NewTreeAnalyzer.cc delete mode 100644 AnalysisFW/plugins/NewTreeAnalyzer.h delete mode 100644 AnalysisFW/plugins/ProcessedTreeProducer.cc delete mode 100644 AnalysisFW/plugins/ProcessedTreeProducer.h delete mode 100644 AnalysisFW/plugins/ProcessedTreeProducerGEN.cc delete mode 100644 AnalysisFW/plugins/ProcessedTreeProducerGEN.h delete mode 100644 AnalysisFW/plugins/ProcessedTreeProducerPFCalo.cc delete mode 100644 AnalysisFW/plugins/ProcessedTreeProducerPFCalo.h delete mode 100644 AnalysisFW/plugins/ProcessedTreeProducer_miniAOD.cc delete mode 100644 AnalysisFW/plugins/ProcessedTreeProducer_miniAOD.h delete mode 100644 AnalysisFW/test/Analysis_Template_Data.py delete mode 100644 AnalysisFW/test/Analysis_Template_MC.py delete mode 100644 AnalysisFW/test/ProcessedTreeProducerGEN_mc_cfg.py delete mode 100644 AnalysisFW/test/ProcessedTreeProducer_dataPAT_SQLite_cfg.py delete mode 100644 AnalysisFW/test/ProcessedTreeProducer_dataPAT_cfg.py delete mode 100644 AnalysisFW/test/ProcessedTreeProducer_dataPFCalo_cfg.py delete mode 100644 AnalysisFW/test/ProcessedTreeProducer_data_cfg.py delete mode 100644 AnalysisFW/test/ProcessedTreeProducer_mcPAT_SQLite_cfg.py delete mode 100644 AnalysisFW/test/ProcessedTreeProducer_mcPAT_cfg.py delete mode 100644 AnalysisFW/test/ProcessedTreeProducer_mcPAT_miniAOD_cfg.py delete mode 100644 AnalysisFW/test/ProcessedTreeProducer_mc_cfg.py delete mode 100644 AnalysisFW/test/globaltag_to_txt.py diff --git a/AnalysisFW/plugins/Analysis_Template_MC.cc b/AnalysisFW/plugins/Analysis_Template_MC.cc deleted file mode 100644 index dbd282d4751..00000000000 --- a/AnalysisFW/plugins/Analysis_Template_MC.cc +++ /dev/null @@ -1,208 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "TMath.h" -#include "TRandom.h" -#include "TFile.h" - -#include "SMPJ/AnalysisFW/plugins/Analysis_Template_MC.h" - -#include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/MakerMacros.h" - -using namespace std; - -//---------------------------- Constructor Of The Class TriggerTurnOn -------------------------- // -Analysis_Template_MC::Analysis_Template_MC(edm::ParameterSet const& cfg) -{ - mFileName = cfg.getParameter ("filename"); - mTreeName = cfg.getParameter ("treename"); - mDirName = cfg.getParameter ("dirname"); - - mGlobalTag = cfg.getParameter ("pseudoglobaltag"); - mjettype = cfg.getParameter ("jettype"); - - mMinPt = cfg.getParameter ("minPt"); - mYMax = cfg.getParameter ("ymax"); - mJetID = cfg.getParameter ("JetID"); - - mprintOk = cfg.getParameter ("printOk"); - - mIsMCarlo = cfg.getUntrackedParameter ("isMCarlo"); - mJECUncSrcNames = cfg.getParameter > ("jecUncSrcNames"); -} - -//------------------------------ Declaration Of The Function beginjob() ------------------------// -void Analysis_Template_MC::beginJob() - { - - mInf = TFile::Open(mFileName.c_str()); - mDir = (TDirectoryFile*)mInf->Get(mDirName.c_str()); - mTree = (TTree*)mDir->Get(mTreeName.c_str()); - Event = new QCDEvent(); - TBranch *branch = mTree->GetBranch("events"); - branch->SetAddress(&Event); - - //------------------ Init jec constructor --------------------------- // - jecs = new JECs(mIsMCarlo, mGlobalTag, mjettype); - - //------------------ Histogram Booking --------------------------- // - num_of_Vtx = fs->make("num_of_Vtx","num_of_Vtx",100,0.,100.); - num_of_VtxGood = fs->make("num_of_VtxGood","num_of_VtxGood",100,0.,100.); - - mc_pthat = fs->make("mc_pthat","mc_pthat",200,0.,2000.); - mc_pthat_weighted = fs->make("mc_pthat_weighted","mc_pthat_weighted",200,0.,2000.); - mc_pthat_weighted->Sumw2(); - - - pt0_GENJet = fs->make("pt0_GENJet","pt0_GENJet",200,0.,2000.); pt0_GENJet->Sumw2(); - pt1_GENJet = fs->make("pt1_GENJet","pt1_GENJet",200,0.,2000.); pt1_GENJet->Sumw2(); - y0_GENJet = fs->make("y0_GENJet","y0_GENJet",60,-3.,3.); y0_GENJet->Sumw2(); - y1_GENJet = fs->make("y1_GENJet","y1_GENJet",60,-3.,3.); y1_GENJet->Sumw2(); - phi0_GENJet = fs->make("phi0_GENJet","phi0_GENJet",60, -TMath::Pi(),TMath::Pi()); phi0_GENJet->Sumw2(); - phi1_GENJet = fs->make("phi1_GENJet","phi1_GENJet",60, -TMath::Pi(),TMath::Pi()); phi1_GENJet->Sumw2(); - - } // end of function beginJob() - - - - - - //------------------------ endjob() function declaration ---------------------- // - void Analysis_Template_MC::endJob() - { - mInf->Close(); - - - - - } // closing endJob() - - - - - - //--------------------------- analyze() fuction declaration ------------------ // -void Analysis_Template_MC::analyze(edm::Event const& iEvent, edm::EventSetup const& iSetup) - { - - unsigned NEntries = mTree->GetEntries(); - cout<<"Reading TREE: "< decade) - cout<<10*k<<" %"<GetEntry(l); - - ///pthat & mc_weight - float pthat = Event->evtHdr().pthat(); - float mc_weight = Event->evtHdr().weight(); - if(mprintOk==1) printf("\npthat=%f mc_weight=%e\n",pthat,mc_weight); - hweight=mc_weight; - mc_pthat->Fill(pthat); - mc_pthat_weighted->Fill(pthat,hweight); - - ///////////////////////////////////////////////////////////////////////////////////////////// - ///Examine GenJets - unsigned n_genJets = Event->nGenJets(); - - - /// Dump all GEN jets - if(mprintOk==1){ - printf("Number of GENJets=%d\n",n_genJets); - for(unsigned j=0; jgenjet(j).pt(),Event->genjet(j).Rapidity(),Event->genjet(j).phi()); - } - } - - ///Apply Jet cuts. Very General to all existing GEN Jets - int GENjet_ok[100]; for(int ii=0;ii<100;++ii){GENjet_ok[ii]=0;} - - for(unsigned j=0; j< n_genJets; ++j){ - if(Event->genjet(j).pt()genjet(j).Rapidity())>mYMax) continue; - GENjet_ok[j]=1; - } - - - - /// Keep events where leading Jet[0] and Jet[1] survived cuts - if((GENjet_ok[0]==1)&&(GENjet_ok[1]==1)) { - - ///////////////////////////////////// Measurement with Gen Jets /////////////////////////////////////////////////// - - float ptmax_gen=Event->genjet(0).pt(); - - if((ptmax_gen>=200.)){ - pt0_GENJet->Fill(Event->genjet(0).pt(),hweight); - pt1_GENJet->Fill(Event->genjet(1).pt(),hweight); - y0_GENJet->Fill(Event->genjet(0).Rapidity(),hweight); - y1_GENJet->Fill(Event->genjet(1).Rapidity(),hweight); - phi0_GENJet->Fill(Event->genjet(0).phi(),hweight); - phi1_GENJet->Fill(Event->genjet(1).phi(),hweight); - - } - - - } //end of GEN Jets - - - ///////////////////////////////////////////////////////////////////////////////////////////// - /// PFJets - /////////////////////////////////////////////Vertex!!!!///////////////////////////////////// - unsigned n_PFJets = Event->nPFJets(); - - jecs->JEC_corrections(Event, n_PFJets, mIsMCarlo); - - - /// Vertex selection - if(mprintOk==1) cout<<"Vertex info: numVtx="<evtHdr().nVtx()<<" numVtxGood="<evtHdr().nVtxGood()<<" isPVgood()="<evtHdr().isPVgood()<<" pfRho="<evtHdr().pfRho()<Fill(Event->evtHdr().nVtx()); - /// Keep events with PVgood - if (Event->evtHdr().isPVgood() != 1) continue; - - num_of_VtxGood->Fill(Event->evtHdr().nVtxGood()); - - /// Dump all jets No cuts only isPVgood() - if(mprintOk==1){ - printf("Number of PFJets=%d\n",n_PFJets); - for(unsigned j=0; jpfjet(j).ptCor(),Event->pfjet(j).y(),Event->pfjet(j).phi(),Event->pfjet(j).cor(),Event->pfjet(j).tightID()); - } - } - -} // end of event loop - - -} // closing analyze() function - - - -Analysis_Template_MC::~Analysis_Template_MC() -{ -} - - -DEFINE_FWK_MODULE(Analysis_Template_MC); - diff --git a/AnalysisFW/plugins/Analysis_Template_MC.h b/AnalysisFW/plugins/Analysis_Template_MC.h deleted file mode 100644 index a6155fb0b63..00000000000 --- a/AnalysisFW/plugins/Analysis_Template_MC.h +++ /dev/null @@ -1,83 +0,0 @@ -#ifndef My_azimuthal_MC_h -#define My_azimuthal_MC_h - -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "SMPJ/AnalysisFW/interface/QCDJet.h" -#include "SMPJ/AnalysisFW/interface/QCDEvent.h" -#include "SMPJ/AnalysisFW/interface/QCDEventHdr.h" -#include "SMPJ/AnalysisFW/interface/QCDCaloJet.h" -#include "SMPJ/AnalysisFW/interface/QCDPFJet.h" -#include "SMPJ/AnalysisFW/interface/QCDMET.h" -#include "FWCore/ServiceRegistry/interface/Service.h" -#include "CommonTools/UtilAlgos/interface/TFileService.h" - -#include "SMPJ/AnalysisFW/plugins/JECs.h" - - -#include "TTree.h" -#include "TH1F.h" -#include "TFile.h" -#include "TProfile.h" -#include -#include -using namespace edm; -using namespace std; - - - -class Analysis_Template_MC : public edm::EDAnalyzer - { - - //typedef reco::Particle::LorentzVector LorentzVector; - - public: - explicit Analysis_Template_MC(edm::ParameterSet const& cfg); - virtual void beginJob(); - virtual void analyze(edm::Event const& iEvent, edm::EventSetup const& iSetup); - virtual void endJob(); - virtual ~Analysis_Template_MC(); - - - private: - //---- configurable parameters -------- - std::string mFileName,mTreeName,mDirName, mGlobalTag, mjettype; - double mMinPt, mYMax; - int mJetID; // looseID==1 tightID==2 - int mprintOk; // noPrint=0 Print=1 - bool mIsMCarlo; - std::vector mJECUncSrcNames; - - edm::Service fs; - TTree *mTree; - TFile *mInf, *mPuf; - TDirectoryFile *mDir; - - //---- TREE variable -------- - QCDEvent *Event; - - //---- JECs variable -------- - JECs *jecs; - - //--------- Histogram Declaration --------------------// - // Vertices - TH1F *num_of_Vtx; - TH1F *num_of_VtxGood; - - TH1F *mc_pthat; - TH1F *mc_pthat_weighted; - - - ///Measurement Gen jets - TH1F *pt0_GENJet; - TH1F *pt1_GENJet; - TH1F *y0_GENJet; - TH1F *y1_GENJet; - TH1F *phi0_GENJet; - TH1F *phi1_GENJet; - - }; - -#endif - diff --git a/AnalysisFW/plugins/JECs.h b/AnalysisFW/plugins/JECs.h deleted file mode 100644 index 074e4daa647..00000000000 --- a/AnalysisFW/plugins/JECs.h +++ /dev/null @@ -1,445 +0,0 @@ -#ifndef JECs_h -#define JECs_h -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "SMPJ/AnalysisFW/interface/QCDJet.h" - -#include "CondFormats/JetMETObjects/interface/FactorizedJetCorrector.h" -#include "CondFormats/JetMETObjects/interface/JetCorrectorParameters.h" -#include "CondFormats/JetMETObjects/interface/JetCorrectionUncertainty.h" - -using namespace edm; -using namespace std; - - - -class JECs { - - typedef reco::Particle::LorentzVector LorentzVector; - - public: - JECs(bool IsMCarlo, string GlobalTag, string JETTYPE, string jecUncSrc, vector jecUncSrcNames); - - static bool sort_pfjets(QCDPFJet j1, QCDPFJet j2) { - return j1.ptCor() > j2.ptCor(); - } - - static bool sort_calojets(QCDCaloJet j1, QCDCaloJet j2) { - return j1.ptCor() > j2.ptCor(); - } - - JetCorrectorParameters *L1Fast, *L2Relative, *L3Absolute, *L2L3Residual; - vector vecL1Fast, vecL2Relative, vecL3Absolute, vecL2L3Residual; - FactorizedJetCorrector *jecL1Fast, *jecL2Relative, *jecL3Absolute, *jecL2L3Residual; - JetCorrectionUncertainty *mPFUnc; - JetCorrectionUncertainty *mCaloUnc; - - JetCorrectorParameters *par; - JetCorrectionUncertainty *tmpUnc; - std::vector mPFUncSrc; - std::vector mCaloUncSrc; - std::vector mJECUncSrcNames; - - virtual void JEC_corrections(QCDEvent *Event, unsigned n_PFJets, bool IsMCarlo, vector jecUncSrcNames){ - - - // ---- declaration of the vector of jets ---- // - vector mPFJets; mPFJets.clear(); - - // ----- looping over the number of jets in the event ---- // - for(unsigned iJet = 0; iJet < n_PFJets; iJet++) - { - vector JecFactors; JecFactors.clear(); - QCDPFJet pfjet; - pfjet = Event->pfjet(iJet); // ----- accessing the uncorrected jet in the event for non-chs jet----- // - - // ---- Old JEC factor ----- // - double oldJecFactor = pfjet.cor(); - - LorentzVector oldJetP4= pfjet.p4(); // ---- accessing the 4-vector of the jet ---- // - TLorentzVector tmpJet; - tmpJet.SetPxPyPzE(oldJetP4.px(), oldJetP4.py(), oldJetP4.pz(), oldJetP4.energy()); - - TLorentzVector UnCorrectedJet = tmpJet * (1./oldJecFactor); // --- obtaining the uncorrected jet 4-vector by scaling down by the old jec factor --- // - //TLorentzVector UnCorrectedJet = tmpJet; ///Jets are already uncorrected - // ---- Evaluating the L1Fast correction factor ---- // - jecL1Fast->setJetPt(UnCorrectedJet.Pt()); - jecL1Fast->setJetA(pfjet.area()); - jecL1Fast->setRho(Event->evtHdr().pfRho()); - jecL1Fast->setJetEta(UnCorrectedJet.Eta()); - //std::cout<getCorrection(); - //cout<<"L1Fast Cor Factor = "<setJetPt(tmpJetL1FastCorrected.Pt()); - jecL2Relative->setJetEta(tmpJetL1FastCorrected.Eta()); - - double corFactorL2Relative = jecL2Relative->getCorrection(); - //cout<<"L2Relative Cor Factor"<setJetPt(tmpJetL1FastL2RelativeCorrected.Pt()); - jecL3Absolute->setJetEta(tmpJetL1FastL2RelativeCorrected.Eta()); - - double corFactorL3Absolute = jecL3Absolute->getCorrection(); - //cout<<"L3Absolute Cor Factor"<setJetPt(tmpJetL1FastL2RelativeL3AbsoluteCorrected.Pt()); - jecL2L3Residual->setJetEta(tmpJetL1FastL2RelativeL3AbsoluteCorrected.Eta()); - - corFactorL2L3Residual = jecL2L3Residual->getCorrection(); - //cout<<"L2L3Rsidual Cor Factor"< uncSrc(0); - mPFUnc->setJetEta(pfjet.eta()); - mPFUnc->setJetPt(pfjet.pt()); - unc = mPFUnc->getUncertainty(true); - - for(unsigned isrc=0;isrcsetJetEta(pfjet.eta()); - mPFUncSrc[isrc]->setJetPt(pfjet.pt()); - float unc1 = mPFUncSrc[isrc]->getUncertainty(true); - uncSrc.push_back(unc1); - } // for(unsigned isrc=0;isrcsetPFJets(mPFJets); - } - - virtual void JEC_CHScorrections(QCDEvent *Event, unsigned n_PFJetsCHS, bool IsMCarlo, vector jecUncSrcNames){ - - // ---- declaration of the vector of jets ---- // - vector mPFJetsCHS; mPFJetsCHS.clear(); - - // ----- looping over the number of jets in the event ---- // - for(unsigned iJet = 0; iJet < n_PFJetsCHS; iJet++) - { - vector JecFactors; JecFactors.clear(); - QCDPFJet pfjetchs; - pfjetchs = Event->pfjetchs(iJet); // ----- accessing the uncorrected jet in the event for non-chs jet----- // - - // ---- Old JEC factor ----- // - double oldJecFactor = pfjetchs.cor(); - - LorentzVector oldJetP4 = pfjetchs.p4(); // ---- accessing the 4-vector of the jet ---- // - TLorentzVector tmpJet; - tmpJet.SetPxPyPzE(oldJetP4.px(), oldJetP4.py(), oldJetP4.pz(), oldJetP4.energy()); - - TLorentzVector UnCorrectedJet = tmpJet * (1./oldJecFactor); // --- obtaining the uncorrected jet 4-vector by scaling down by the old jec factor --- // - //TLorentzVector UnCorrectedJet = tmpJet; ///Jets are already uncorrected - // ---- Evaluating the L1Fast correction factor ---- // - jecL1Fast->setJetPt(UnCorrectedJet.Pt()); - jecL1Fast->setJetA(pfjetchs.area()); - jecL1Fast->setRho(Event->evtHdr().pfRho()); - jecL1Fast->setJetEta(UnCorrectedJet.Eta()); - //std::cout<getCorrection(); - //cout<<"L1Fast Cor Factor = "<setJetPt(tmpJetL1FastCorrected.Pt()); - jecL2Relative->setJetEta(tmpJetL1FastCorrected.Eta()); - - double corFactorL2Relative = jecL2Relative->getCorrection(); - //cout<<"L2Relative Cor Factor"<setJetPt(tmpJetL1FastL2RelativeCorrected.Pt()); - jecL3Absolute->setJetEta(tmpJetL1FastL2RelativeCorrected.Eta()); - - double corFactorL3Absolute = jecL3Absolute->getCorrection(); - //cout<<"L3Absolute Cor Factor"<setJetPt(tmpJetL1FastL2RelativeL3AbsoluteCorrected.Pt()); - jecL2L3Residual->setJetEta(tmpJetL1FastL2RelativeL3AbsoluteCorrected.Eta()); - - corFactorL2L3Residual = jecL2L3Residual->getCorrection(); - //cout<<"L2L3Rsidual Cor Factor"< uncSrc(0); - mPFUnc->setJetEta(pfjetchs.eta()); - mPFUnc->setJetPt(pfjetchs.pt()); - unc = mPFUnc->getUncertainty(true); - -// - for(unsigned isrc=0;isrcsetJetEta(pfjetchs.eta()); - mPFUncSrc[isrc]->setJetPt(pfjetchs.pt()); - float unc1 = mPFUncSrc[isrc]->getUncertainty(true); - uncSrc.push_back(unc1); - } // for(unsigned isrc=0;isrcsetPFJetsCHS(mPFJetsCHS); - } - - virtual void JEC_Calocorrections(QCDEvent *Event, unsigned n_CaloJets, bool IsMCarlo){ - - // ---- declaration of the vector of jets ---- // - vector mCaloJets; mCaloJets.clear(); - - // ----- looping over the number of jets in the event ---- // - for(unsigned iJet = 0; iJet < n_CaloJets; iJet++) - { - vector JecFactors; JecFactors.clear(); - QCDCaloJet calojet; - calojet = Event->calojet(iJet); // ----- accessing the uncorrected jet in the event for non-chs jet----- // - - // ---- Old JEC factor ----- // - //double oldJecFactor = calojet.cor(); - - LorentzVector oldJetP4 = calojet.p4(); // ---- accessing the 4-vector of the jet ---- // - TLorentzVector tmpJet; - tmpJet.SetPxPyPzE(oldJetP4.px(), oldJetP4.py(), oldJetP4.pz(), oldJetP4.energy()); - - //TLorentzVector UnCorrectedJet = tmpJet * (1./oldJecFactor); // --- obtaining the uncorrected jet 4-vector by scaling down by the old jec factor --- // - TLorentzVector UnCorrectedJet = tmpJet; ///Jets are already uncorrected - // ---- Evaluating the L1Fast correction factor ---- // - jecL1Fast->setJetPt(UnCorrectedJet.Pt()); - jecL1Fast->setJetA(calojet.area()); - jecL1Fast->setRho(Event->evtHdr().caloRho()); - jecL1Fast->setJetEta(UnCorrectedJet.Eta()); - //std::cout<getCorrection(); - //cout<<"L1Fast Cor Factor = "<setJetPt(tmpJetL1FastCorrected.Pt()); - jecL2Relative->setJetEta(tmpJetL1FastCorrected.Eta()); - - double corFactorL2Relative = jecL2Relative->getCorrection(); - //cout<<"L2Relative Cor Factor"<setJetPt(tmpJetL1FastL2RelativeCorrected.Pt()); - jecL3Absolute->setJetEta(tmpJetL1FastL2RelativeCorrected.Eta()); - - double corFactorL3Absolute = jecL3Absolute->getCorrection(); - //cout<<"L3Absolute Cor Factor"<setJetPt(tmpJetL1FastL2RelativeL3AbsoluteCorrected.Pt()); - jecL2L3Residual->setJetEta(tmpJetL1FastL2RelativeL3AbsoluteCorrected.Eta()); - - corFactorL2L3Residual = jecL2L3Residual->getCorrection(); - //cout<<"L2L3Rsidual Cor Factor"< uncSrc(0); -// mCaloUnc->setJetEta(calojet.eta()); -// mCaloUnc->setJetPt(calojet.pt()); -// unc = mCaloUnc->getUncertainty(true); -// -// for(unsigned isrc=0;isrcsetJetEta(calojet.eta()); -// mCaloUncSrc[isrc]->setJetPt(calojet.pt()); -// float unc1 = mCaloUncSrc[isrc]->getUncertainty(true); -// uncSrc.push_back(unc1); -// } // for(unsigned isrc=0;isrcsetCaloJets(mCaloJets); - } -}; - -JECs::JECs(bool IsMCarlo, string GlobalTag, string JETTYPE, string jecUncSrc, vector mJECUncSrcNames){ - - string file_data_mc = "DATA"; - if(IsMCarlo) file_data_mc = "MC"; - - L1Fast = new JetCorrectorParameters("../data/"+GlobalTag+"/"+GlobalTag+"_"+file_data_mc+"_L1FastJet_"+JETTYPE+".txt"); - L2Relative = new JetCorrectorParameters("../data/"+GlobalTag+"/"+GlobalTag+"_"+file_data_mc+"_L2Relative_"+JETTYPE+".txt"); - L3Absolute = new JetCorrectorParameters("../data/"+GlobalTag+"/"+GlobalTag+"_"+file_data_mc+"_L3Absolute_"+JETTYPE+".txt"); - if(!IsMCarlo) - L2L3Residual = new JetCorrectorParameters("../data/"+GlobalTag+"/"+GlobalTag+"_DATA_L2L3Residual_"+JETTYPE+".txt"); - - vecL1Fast.push_back(*L1Fast); - vecL2Relative.push_back(*L2Relative); - vecL3Absolute.push_back(*L3Absolute); - if(!IsMCarlo) - vecL2L3Residual.push_back(*L2L3Residual); - - - jecL1Fast = new FactorizedJetCorrector(vecL1Fast); - jecL2Relative = new FactorizedJetCorrector(vecL2Relative); - jecL3Absolute = new FactorizedJetCorrector(vecL3Absolute); - if(!IsMCarlo) - jecL2L3Residual = new FactorizedJetCorrector(vecL2L3Residual); - - ///Read Uncertainty txt files - mPFUnc = new JetCorrectionUncertainty("../data/"+GlobalTag+"/"+GlobalTag+"_"+file_data_mc+"_Uncertainty_"+JETTYPE+".txt"); - - for(unsigned isrc=0;isrc -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "SMPJ/AnalysisFW/plugins/NewTreeAnalyzer.h" - - - - -//---------------------------- Constructor Of The Class NewTreeAnalyzer -------------------------- // -NewTreeAnalyzer::NewTreeAnalyzer(edm::ParameterSet const& cfg) -{ - mFileName = cfg.getParameter ("filename"); - mPuFileName = cfg.getParameter ("pileupfile"); - mPuTrigName = cfg.getParameter ("pileuptrig"); - mTreeName = cfg.getParameter ("treename"); - mDirName = cfg.getParameter ("dirname"); - mIsMCarlo = cfg.getUntrackedParameter ("isMCarlo"); - mIsCHS = cfg.getUntrackedParameter ("isCHS"); - mPFPayloadNameA = cfg.getParameter ("PFPayloadName"); - mPFPayloadNameCHSA = cfg.getParameter ("PFPayloadNameCHS"); - mPFJECUncSrcA = cfg.getParameter ("jecUncSrc"); - mPFJECUncSrcCHSA = cfg.getParameter ("jecUncSrcCHS"); - mJECL1FastFile = cfg.getParameter ("jecL1FastFile"); - mJECL1FastFileCHS = cfg.getParameter ("jecL1FastFileCHS"); - mJECL2RelativeFile = cfg.getParameter ("jecL2RelativeFile"); - mJECL2RelativeFileCHS = cfg.getParameter ("jecL2RelativeFileCHS"); - mJECL3AbsoluteFile = cfg.getParameter ("jecL3AbsoluteFile"); - mJECL3AbsoluteFileCHS = cfg.getParameter ("jecL3AbsoluteFileCHS"); - mJECL2L3ResidualFile = cfg.getParameter ("jecL2L3ResidualFile"); - mJECL2L3ResidualFileCHS = cfg.getParameter ("jecL2L3ResidualFileCHS"); - mJECUncSrcNames = cfg.getParameter > ("jecUncSrcNames"); -} - -//------------------------------ Declaration Of The Function beginjob() ------------------------// -void NewTreeAnalyzer::beginJob() - { - - mInf = TFile::Open(mFileName.c_str()); - mDir = (TDirectoryFile*)mInf->Get(mDirName.c_str()); - mTree = (TTree*)mDir->Get(mTreeName.c_str()); - Event = new QCDEvent(); - TBranch *branch = mTree->GetBranch("events"); - branch->SetAddress(&Event); - isPFJecUncSet_ = false; - - // --- Initializing the jet correctors ---- // - if(mIsCHS) { - L1Fast = new JetCorrectorParameters(mJECL1FastFileCHS.c_str()); - L2Relative = new JetCorrectorParameters(mJECL2RelativeFileCHS.c_str()); - L3Absolute = new JetCorrectorParameters(mJECL3AbsoluteFileCHS.c_str()); - if(!mIsMCarlo) - L2L3Residual = new JetCorrectorParameters(mJECL2L3ResidualFileCHS.c_str()); - } // if(mIsCHS) - else { - L1Fast = new JetCorrectorParameters(mJECL1FastFile.c_str()); - L2Relative = new JetCorrectorParameters(mJECL2RelativeFile.c_str()); - L3Absolute = new JetCorrectorParameters(mJECL3AbsoluteFile.c_str()); - if(!mIsMCarlo) - L2L3Residual = new JetCorrectorParameters(mJECL2L3ResidualFile.c_str()); - } // else -- non-chs - - vecL1Fast.push_back(*L1Fast); - vecL2Relative.push_back(*L2Relative); - vecL3Absolute.push_back(*L3Absolute); - if(!mIsMCarlo) - vecL2L3Residual.push_back(*L2L3Residual); - - jecL1Fast = new FactorizedJetCorrector(vecL1Fast); - jecL2Relative = new FactorizedJetCorrector(vecL2Relative); - jecL3Absolute = new FactorizedJetCorrector(vecL3Absolute); - if(!mIsMCarlo) - jecL2L3Residual = new FactorizedJetCorrector(vecL2L3Residual); - - - if(!mIsMCarlo) { - //------------------------- Initializing The Trigger Variables -------------------------- // - for (int i=0; iGet("TriggerNames"); - // ------------ Assigning An Integer To Each Trigger Path---------------// - for(int ibin=0;ibinGetNbinsX();ibin++) { - TString ss(hTrigNames->GetXaxis()->GetBinLabel(ibin+1)); - - for (int ii=0; ii "<make(name,name,nx[k],&x[k][0]); - - sprintf(name, "PtDown__eta%i_unc%s_%i_v%i",k+1,mJECUncSrcNames[i].c_str(),HLTJetPtN[m],n+3); - PFPtDown[k][i][m][n] = fs->make(name,name,nx[k],&x[k][0]); - } // for (int n=0; nmake(name,name,nx[k],&x[k][0]); - - sprintf(name, "BetavsPT_Trig%i_v%i_eta%i", HLTJetPtN[m],n+3, k+1); - BetavsPT[m][n][k] = fs->make(name, name, nx[k],&x[k][0], 100,0,1); - } // for (int n=0; nmake(name,name,nx[k],&x[k][0]); - PFJet0[m][n][k][r]->Sumw2(); - - sprintf(name, "PFJet1_%i_v%i_eta%i_PU%i", HLTJetPtN[m],n+3,k+1,r); - PFJet1[m][n][k][r] = fs->make(name,name,nx[k],&x[k][0]); - PFJet1[m][n][k][r]->Sumw2(); - } - } // for (int r=0; rmake(name,name,30,0,1); - ChHadFr[m][n][k]->Sumw2(); - - sprintf(name,"NuHadFrac_Jet%i_v%i_eta%i",HLTJetPtN[m],n+3,k+1); - NuHadFr[m][n][k] = fs->make(name,name,30,0,1); - NuHadFr[m][n][k]->Sumw2(); - - sprintf(name,"PhFrac_Jet%i_v%i_eta%i",HLTJetPtN[m],n+3,k+1); - PhFr[m][n][k] = fs->make(name,name,30,0,1); - PhFr[m][n][k]->Sumw2(); - - sprintf(name,"ElFrac_Jet%i_v%i_eta%i",HLTJetPtN[m],n+3,k+1); - ElFr[m][n][k] = fs->make(name,name,30,0,1); - ElFr[m][n][k]->Sumw2(); - - sprintf(name,"MuFrac_Jet%i_v%i_eta%i",HLTJetPtN[m],n+3,k+1); - MuFr[m][n][k] = fs->make(name,name,30,0,1); - MuFr[m][n][k]->Sumw2(); - - //-------------------- Histogram For Spectrum Construction ---------------// - sprintf(name, "PFJet_%i_v%i_eta%i", HLTJetPtN[m],n+3,k+1); - PFJet[m][n][k] = fs->make(name,name,nx[k],&x[k][0]); - PFJet[m][n][k]->Sumw2(); - - sprintf(name, "PFJetYield_%i_v%i_eta%i", HLTJetPtN[m],n+3,k+1); - PFJetYield[m][n][k] = fs->make(name,name,nx[k],&x[k][0]); - PFJetYield[m][n][k]->Sumw2(); - - sprintf(name, "PFJet_L1Fast_%i_v%i_eta%i", HLTJetPtN[m],n+3,k+1); - PFJetPt_L1Fast[m][n][k] = fs->make(name,name,nx[k],&x[k][0],0,5); - PFJetPt_L1Fast[m][n][k]->Sumw2(); - - sprintf(name, "PFJet_L2Relative_%i_v%i_eta%i", HLTJetPtN[m],n+3,k+1); - PFJetPt_L2Relative[m][n][k] = fs->make(name,name,nx[k],&x[k][0],0,5); - PFJetPt_L2Relative[m][n][k]->Sumw2(); - - sprintf(name, "PFJet_L3Absolute_%i_v%i_eta%i", HLTJetPtN[m],n+3,k+1); - PFJetPt_L3Absolute[m][n][k] = fs->make(name,name,nx[k],&x[k][0],0,5); - PFJetPt_L3Absolute[m][n][k]->Sumw2(); - - sprintf(name, "PFJet_L2L3Residual_%i_v%i_eta%i", HLTJetPtN[m],n+3,k+1); - PFJetPt_L2L3Residual[m][n][k] = fs->make(name,name,nx[k],&x[k][0],0,5); - PFJetPt_L2L3Residual[m][n][k]->Sumw2(); - - sprintf(name, "PFJet_TotalJEC_%i_v%i_eta%i", HLTJetPtN[m],n+3,k+1); - PFJetPt_TotalJEC[m][n][k] = fs->make(name,name,nx[k],&x[k][0],0,5); - PFJetPt_TotalJEC[m][n][k]->Sumw2(); - - - if(mIsMCarlo) { - sprintf(name, "PFJetGen_%i_v%i_eta%i", HLTJetPtN[m],n+3,k+1); - PFJetGen[m][n][k] = fs->make(name,name,nx[k],&x[k][0]); - PFJetGen[m][n][k]->Sumw2(); - } - - if(!mIsMCarlo) { - for(int r=0; rmake(name,name,nx[k],&x[k][0]); - PFJetPU[m][n][k][r]->Sumw2(); - } // for(int r=0; rmake(name,name,nx[k],&x[k][0]); - TagJet[m][n][k]->Sumw2(); - - sprintf(name, "ProbeJet_%i_v%i_eta%i", HLTJetPtN[m],n+3,k+1); - ProbeJet[m][n][k] = fs->make(name,name,nx[k],&x[k][0]); - ProbeJet[m][n][k]->Sumw2(); - } // for (int k=0; kmake(name,name,400,0.2,1.8); - PtRes[k][i]->Sumw2(); - - sprintf(name, "AvgX_eta%i_bin%i", k+1, i+1); - AvgX_Pt[k][i] = fs->make(name,name,n1x[k],0,n1x[k],0,3000); - AvgX_Pt[k][i]->Sumw2(); - } // for(int i=0; imake(name,name,nx[k],&x[k][0]); - GenJet[k]->Sumw2(); - - sprintf(name, "Unfolding_GenPt_YBin%i", k+1); - Unfolding_GenPt[k] = fs->make(name,name,nGenx[k],&xGen[k][0]); - Unfolding_GenPt[k]->Sumw2(); - - sprintf(name, "Unfolding_RecoPt_YBin%i", k+1); - Unfolding_RecoPt[k] = fs->make(name,name,nGenx[k],&xGen[k][0]); - Unfolding_RecoPt[k]->Sumw2(); - - sprintf(name, "Unfolding_RecoGenPt_YBin%i", k+1); - Unfolding_RecoGenPt[k] = fs->make(name,name,nGenx[k],&xGen[k][0], nGenx[k],&xGen[k][0]); - Unfolding_RecoGenPt[k]->Sumw2(); - } // if(mIsMCarlo) - } //for (int k=0; k Get(mPuTrigName.c_str()); - -/* for(int i=20; i<65; i++) - { - dataPU->SetBinContent(i,0); - } */ - - for(int i=0; i<600; i++) - { - WSummer2012.push_back(Summer2012[i]); - WData2012.push_back(dataPU->GetBinContent(i+1)); - } // for(int i=0; i<60; i++) - - LumiReWeighting(WSummer2012,WData2012); - - -} // void NewTreeAnalyzer::beginJob() - - -void NewTreeAnalyzer::endJob() - { - mInf->Close(); - -} // void NewTreeAnalyzer::endJob() - -//------------------------ PU Weight Computation ------------------// -double NewTreeAnalyzer::puweight(float npv) - { - int bin = weights_->GetXaxis()->FindBin( npv ); - return weights_->GetBinContent( bin ); - } - -// --------------------- PU Reweighting Function -------------------- // -void NewTreeAnalyzer::LumiReWeighting( std::vector< float > MC_distr, std::vector< float > Lumi_distr) - { - // no histograms for input: use vectors - // now, make histograms out of them: - - // first, check they are the same size... - - if( MC_distr.size() != Lumi_distr.size() ){ - - std::cerr <<"ERROR: LumiReWeighting: input vectors have different sizes. Quitting... \n"; - return; - - } - - Int_t NBins = MC_distr.size(); - - /* MC_distr_ = fs->make("MC_distr","MC dist",NBins,-0.5, float(NBins)-0.5); - Data_distr_ = fs->make("Data_distr","Data dist",NBins,-0.5, float(NBins)-0.5); - - weights_ = fs->make("luminumer","luminumer",NBins,-0.5, float(NBins)-0.5); - den = fs->make("lumidenom","lumidenom",NBins,-0.5, float(NBins)-0.5); */ - - MC_distr_ = fs->make("MC_distr","MC dist",NBins,-0.5, 59.5); - Data_distr_ = fs->make("Data_distr","Data dist",NBins,-0.5, 59.5); - - weights_ = fs->make("luminumer","luminumer",NBins,-0.5, 59.5); - den = fs->make("lumidenom","lumidenom",NBins,-0.5, 59.5); - - for(int ibin = 1; ibinSetBinContent(ibin, Lumi_distr[ibin-1]); - Data_distr_->SetBinContent(ibin, Lumi_distr[ibin-1]); - den->SetBinContent(ibin,MC_distr[ibin-1]); - MC_distr_->SetBinContent(ibin,MC_distr[ibin-1]); - } - - // check integrals, make sure things are normalized - float deltaH = weights_->Integral(); - if(fabs(1.0 - deltaH) > 0.02 ) { //*OOPS*... - weights_->Scale( 1.0/ deltaH ); - Data_distr_->Scale( 1.0/ deltaH ); - } - float deltaMC = den->Integral(); - if(fabs(1.0 - deltaMC) > 0.02 ) { - den->Scale(1.0/ deltaMC ); - MC_distr_->Scale(1.0/ deltaMC ); - } - - weights_->Divide( den ); // so now the average weight should be 1.0 - - if(mIsMCarlo) { - std::cout << " Lumi/Pileup Reweighting: Computed Weights per In-Time Nint " << std::endl; - - for(int ibin = 1; ibinGetBinContent(ibin) << std::endl; - } - } // if(mIsMCarlo) - - } //void NewTreeAnalyzer::LumiReWeighting - - //--------------------------- analyze() fuction declaration ------------------ // -void NewTreeAnalyzer::analyze(edm::Event const& iEvent, edm::EventSetup const& iSetup) - { - unsigned NEntries = mTree->GetEntries(); - cout<<"Reading TREE: "< decade) - cout<<10*k<<" %"<GetEntry(l); - double wt1 = 1.0, wtpu = 1.0 ; - if(mIsMCarlo) { - wt1 = Event->evtHdr().weight(); - wtpu = puweight(Event->evtHdr().trpu()); - } // if(mIsMCarlo) - double wt = wt1*wtpu; -// cout<<"wt = "<setJetPt(tmpJetL1FastL2RelativeCorrected.Pt()); - jecL3Absolute->setJetEta(tmpJetL1FastL2RelativeCorrected.Eta()); - - double corFactorL3Absolute = jecL3Absolute->getCorrection(); - //cout<<"L3Absolute Cor Factor"<setJetPt(tmpJetL1FastL2RelativeL3AbsoluteCorrected.Pt()); - jecL2L3Residual->setJetEta(tmpJetL1FastL2RelativeL3AbsoluteCorrected.Eta()); - - corFactorL2L3Residual = jecL2L3Residual->getCorrection(); - //cout<<"L2L3Rsidual Cor Factor"<= 20) - mPFJets.push_back(newpfjet); - } // for(int iJet = 0; iJet < NJets; iJet++) - - // ----- pT sorting the PF jets ------- // - sort(mPFJets.begin(),mPFJets.end(),sort_pfjets); - - // ----- Initializing for JEC uncertainty sources -------------- // - - std::string mPFPayloadName, mPFJECUncSrc ; - if(mIsCHS) { - mPFPayloadName = mPFPayloadNameCHSA; - mPFJECUncSrc = mPFJECUncSrcCHSA; - } - else { - mPFPayloadName = mPFPayloadNameA; - mPFJECUncSrc = mPFJECUncSrcA; - } // else - - // cout<<"pfpayload name = "<().get(mPFPayloadName,PFJetCorParColl); - JetCorrectorParameters const& PFJetCorPar = (*PFJetCorParColl)["Uncertainty"]; - mPFUnc = new JetCorrectionUncertainty(PFJetCorPar); - if (mPFJECUncSrc != "") { - for(unsigned isrc=0;isrcnL1Obj(ihltj[i][j]); l1iobj++ ) - { - if (Event->l1obj(ihltj[i][j],l1iobj).pt() > ATrig[i+1]) - { - l1cut = true ; - } // if (Event->l1obj(ihltj[i][j],l1iobj).pt() > ATrig[i+1]) - } // for ( unsigned l1iobj=0; l1iobjnL1Obj(ihltj[i][j]); l1iobj++ ) - - - //------------ HLT Threshold Checking For HLTObj ------------------ // - for ( unsigned hltiobj=0; hltiobjnHLTObj(ihltj[i][j]); hltiobj++ ) - { - if (Event->hltobj(ihltj[i][j],hltiobj).pt() > HLTJetPtN[i+1]) - { - hltcut = true ; - } // if (Event->hltobj(ihltj[i][j],hltiobj).pt() > HLTJetPtN[i+1]) - - } // for ( unsigned hltiobj=0; hltiobjnHLTObj(ihltj[i][j]); hltiobj++ ) - - } // if(!mIsMCarlo) - - - // ---- starting the loop over newly corrected jets ----- // - for(int iJet = 0; iJet < (int)mPFJets.size(); iJet++) - { - QCDPFJet thisJet = mPFJets[iJet]; - - bool cutID =(thisJet.tightID() && (thisJet.cemf() < 0.9) && (thisJet.muf() < 0.9) && (thisJet.nhf() < 0.9) && (thisJet.nemf() < 0.9) && - (Event->pfmet().met_o_sumet()<0.3) && (Event->evtHdr().pfRho()<100) && (Event->evtHdr().isPVgood())); - - if(cutID) { - - for (int k=0; k= EtabinN[k]) && (fabs(thisJet.y())evtHdr().nVtxGood()>VertexN[r])&&(Event->evtHdr().nVtxGood()<=VertexN[r+1])) { - PFJet0[i][j][k][r] -> Fill(thisJet.ptCor(),wt); - // cout<<"weight = "< Fill(thisJet.ptCor(),wt); - } // if(l1cut && hltcut) - - // cout<<"Uncertainty factor = "<pfjet(p).uncSrc(16)<evtHdr().nVtxGood()>VertexN[r])&&(Event->evtHdr().nVtxGood()<=VertexN[r+1])) - } // for (int r=0; rHLTJetPtT[i]) { - //------------------------- Fill Of JetID variable -------------------// - ChHadFr[i][j][k] ->Fill(thisJet.chf(),wt); - NuHadFr[i][j][k] ->Fill(thisJet.nhf(),wt); - PhFr[i][j][k] ->Fill(thisJet.nemf(),wt); - ElFr[i][j][k] ->Fill(thisJet.cemf(),wt); - MuFr[i][j][k] ->Fill(thisJet.muf(),wt); - //----------------------- Fill For Data-MC --------------------------// - //PFJet2[i][j][k] -> Fill(Event->pfjet(p).ptCor(),wt); - //PFJet2Eta[i][j][k] -> Fill(Event->pfjet(p).eta(),wt); - //PFJet2Phi[i][j][k] -> Fill(Event->pfjet(p).phi(),wt); - } // if(Event->pfjet(p).ptCor()>HLTJetPtT[i]) - - //-------------- Filling Histogram For Spectrum --------------------// - if(thisJet.ptCor()>=HLTJetPtS[i] && thisJet.ptCor() Fill(thisJet.ptCor(),prescalej[i][j]); - PFJetYield[i][j][k] -> Fill(thisJet.ptCor(),wt1); - // --- Filling the JEC factors ----- // - PFJetPt_L1Fast[i][j][k] -> Fill(thisJet.ptCor(),thisJet.jecLabels(0)); - PFJetPt_L2Relative[i][j][k] -> Fill(thisJet.ptCor(),thisJet.jecLabels(1)); - PFJetPt_L3Absolute[i][j][k] -> Fill(thisJet.ptCor(),thisJet.jecLabels(2)); - PFJetPt_L2L3Residual[i][j][k] -> Fill(thisJet.ptCor(),thisJet.jecLabels(3)); - PFJetPt_TotalJEC[i][j][k] -> Fill(thisJet.ptCor(),thisJet.jecLabels(4)); - - if(!mIsMCarlo) - BetavsPT[i][j][k]->Fill(thisJet.ptCor(),thisJet.beta(),prescalej[i][j]); - } // if(Event->pfjet(p).ptCor()>=HLTJetPtS[i] && Event->pfjet(p).ptCor()=HLTJetPtS[i] && thisJet.genpt() Fill(thisJet.genpt(),wt1); - } - } - - if(!mIsMCarlo){ - for(int r=0; revtHdr().nVtxGood()>=PUBin[r]) && (Event->evtHdr().nVtxGood()=HLTJetPtS[i] && thisJet.ptCor() Fill(thisJet.ptCor(),prescalej[i][j]); - } // if(Event->pfjet(p).ptCor()>=HLTJetPtS[i] && Event->pfjet(p).ptCor()evtHdr().nVtxGood()>=PUBin[r]) && (Event->evtHdr().nVtxGood()=HLTJetPtS[i] && thisJet.ptCor() Fill(thisJet.ptCor(),wt); - } - - - //---- jec uncertainty -------------- - double unc1(0.0); - vector uncSrc(0); - if (mPFPayloadName != "") { - mPFUnc->setJetEta(thisJet.eta()); - mPFUnc->setJetPt(thisJet.ptCor()); - unc1 = mPFUnc->getUncertainty(true); - } - - if (mPFJECUncSrc != "") { - for(unsigned isrc=0;isrcsetJetEta(thisJet.eta()); - mPFUncSrc[isrc]->setJetPt(thisJet.ptCor()); - float unc = mPFUncSrc[isrc]->getUncertainty(true); - uncSrc.push_back(unc); - double ptUp = (1+unc)*thisJet.ptCor(); - double ptDown = (1-unc)*thisJet.ptCor(); - - if(ptUp>=HLTJetPtS[i] && ptUpFill(ptUp,wt); - } // if(ptUp>=HLTJetPtS[i] && ptUp=HLTJetPtS[i] && ptDownFill(ptDown,wt); - } - } // for(unsigned isrc=0;isrc= EtabinN[k]) && (fabs(thisJet.y())=2){ - //----------------------- JetID Efficiency Tag and Probe ---------------------// - int irand = (gRandom->Uniform()>0.5) ? 0 : 1; - int irand2 = (irand+1)%2; - - QCDPFJet jet1 = mPFJets[irand] ; - QCDPFJet jet2 = mPFJets[irand2]; - - bool cutID2=((jet1.cemf() < 0.9) && (jet1.muf() < 0.9) && (jet1.nhf() < 0.9) && (jet1.nemf() < 0.9) && (Event->pfmet().met_o_sumet()<0.3) ); - - double dphi = DeltaPhi(jet1.phi(),jet2.phi()); - - if(cutID2 && (dphi>2.7)) { - - for (int k=0; k= EtabinN[k]) && (fabs(jet2.y())=HLTJetPtS[i] && jet2.ptCor()Fill(jet2.ptCor(),prescalej[i][j]); - - if(jet2.tightID() && (jet2.cemf() < 0.9) && (jet2.muf() < 0.9) && (jet2.nhf() < 0.9) && (jet2.nemf() < 0.9)) { - ProbeJet[i][j][k]->Fill(jet2.ptCor(),prescalej[i][j]); - } // if(Event->pfjet(irand2).tightID()) - - } // if(Event->pfjet(irand2).ptCor()>=HLTJetPtS[i] && Event->pfjet(irand2).ptCor()pfjet(irand).tightID() && (fabs(Event->pfjet(irand).y())<1.3)) - - } // if ((fabs(Event->pfjet(irand2).y())>= EtabinN[k]) && (fabs(Event->pfjet(irand2).y())2.7)) - } // if(!mIsMCarlo) - - - - //---------------- Jet Resolution for MC ---------------// - if(i==0 && j==0) { // --- run the tag and probe part only once in MC, i.e. 1-trigger-1-version --- // - if(mIsMCarlo) { - - for (int iJet = 0; iJet < (int)mPFJets.size(); iJet++) - { - - QCDPFJet thisJet = mPFJets[iJet]; - - bool cutID=(thisJet.tightID() && (thisJet.cemf() < 0.9) && (thisJet.muf() < 0.9) && (thisJet.nhf() < 0.9) && (thisJet.nemf() < 0.9) && (Event->pfmet().met_o_sumet()<0.3)); - - if(cutID) { - for (int k=0; k= EtabinN[k]) && (fabs(thisJet.y())x1[k][m]) && (thisJet.genpt()Fill(thisJet.ptCor()/thisJet.genpt()); - AvgX_Pt[k][m] ->Fill(m,thisJet.genpt()); - } // if((Event->pfjet(p).genpt()>Ptbin1[m]) && (Event->pfjet(p).genpt()Fill(thisJet.genpt()); - Unfolding_RecoPt[k]->Fill(thisJet.ptCor()); - Unfolding_RecoGenPt[k]->Fill(thisJet.ptCor(), thisJet.genpt()); - - } // if ((fabs(Event->pfjet(p).y())>= EtabinN[k]) && (fabs(Event->pfjet(p).y())nPFJets();p++) - - // ------------------------------- Unbiased GenJet Pt Distribution ------------------// - for (unsigned p=0;pnGenJets();p++) - { - for (int k=0; kgenjet(p).y())>= EtabinN[k]) && (fabs(Event->genjet(p).y())Fill(Event->genjet(p).pt()); - } // if ((fabs(Event->genjet(p).y())>= EtabinN[k]) && (fabs(Event->genjet(p).y())nGenJets();p++) - - } // if(mIsMCarlo) - - } // if(i==0 && j==0) - - - } //if (hltPassj[i][j]) - } // for (int j=0; j -#include -using namespace edm; -using namespace std; - - int HLTJetPtN[7] = {40,80,140,200,260,320,400}; - double HLTJetPtS[7] = {56,133,220,300,395,507,5000}; - double HLTJetPtT[7] = {80,130,200,260,330,400,520}; - int ATrig[7] = {16,36,68,92,128,128,128} ; - double EtabinN[7] = {0.0,0.5,1.0,1.5,2.0,2.5,3.0}; - float metHT[4] = {0.0, 0.3, 0.9, 1.0}; - int PUBin[8] = {0,5,10,15,20,25,30,40}; - - unsigned NEVENTSN = 100000; - double dR = 0.5; - const int nbin1 = 50, nbin2 = 20, nbin3 = 39; - double ptMin = 20; - const double Ptbin1[nbin3+1] = {30,45,60,75,90,114,133,153,174,196,220,245,272,300,330,362,395,430,468,507,548,592,638,686,737,790,846,905,967,1032,1101,1172,1248,1327,1410,1497,1588,1784,2000,2116}; - -// const int nx[6] = {39,36,33,30,25,19}; - const int nx[6] = {39,39,38,34,27,23}; - const int nGenx[6] = {45,45,44,40,33,26}; - const int n1x[6] = {47,47,46,42,35,28}; - -const double x[6][50]= { - {56,64,74,84,97,114,133,153,174,196,220,245,272,300,330,362,395,430,468,507,548,592,638,686,737,790,846,905,967,1032,1101,1172,1248,1327,1410,1497,1588,1784,2116,2500}, - - {56,64,74,84,97,114,133,153,174,196,220,245,272,300,330,362,395,430,468,507,548,592,638,686,737,790,846,905,967,1032,1101,1172,1248,1327,1410,1497,1588,1784,2116,2500}, - - {56,64,74,84,97,114,133,153,174,196,220,245,272,300,330,362,395,430,468,507,548,592,638,686,737,790,846,905,967,1032,1101,1172,1248,1327,1410,1497,1588,1784,2116}, - - {56,64,74,84,97,114,133,153,174,196,220,245,272,300,330,362,395,430,468,507,548,592,638,686,737,790,846,905,967,1032,1101,1172,1248,1327,1410}, - - {56,64,74,84,97,114,133,153,174,196,220,245,272,300,330,362,395,430,468,507,548,592,638,686,737,790,846,905}, - - {56,64,74,84,97,114,133,153,174,196,220,245,272,300,330,362,395,430,468,507,548,592,638,686} - }; - -const double x1[6][50]= { - {18,21,24,28,32,37,43,49,56,64,74,84,97,114,133,153,174,196,220,245,272,300,330,362,395,430,468,507,548,592,638,686,737,790,846,905,967,1032,1101,1172,1248,1327,1410,1497,1588,1784,2116,2500}, - - {18,21,24,28,32,37,43,49,56,64,74,84,97,114,133,153,174,196,220,245,272,300,330,362,395,430,468,507,548,592,638,686,737,790,846,905,967,1032,1101,1172,1248,1327,1410,1497,1588,1784,2116,2500}, - - {18,21,24,28,32,37,43,49,56,64,74,84,97,114,133,153,174,196,220,245,272,300,330,362,395,430,468,507,548,592,638,686,737,790,846,905,967,1032,1101,1172,1248,1327,1410,1497,1588,1784,2116}, - - {18,21,24,28,32,37,43,49,56,64,74,84,97,114,133,153,174,196,220,245,272,300,330,362,395,430,468,507,548,592,638,686,737,790,846,905,967,1032,1101,1172,1248,1327,1410}, - - {18,21,24,28,32,37,43,49,56,64,74,84,97,114,133,153,174,196,220,245,272,300,330,362,395,430,468,507,548,592,638,686,737,790,846,905}, - - {18,21,24,28,32,37,43,49,56,64,74,84,97,114,133,153,174,196,220,245,272,300,330,362,395,430,468,507,548} - }; - -const double xGen[6][50]= { - {28,32,37,43,49,56,64,74,84,97,114,133,153,174,196,220,245,272,300,330,362,395,430,468,507,548,592,638,686,737,790,846, - 905,967,1032,1101,1172,1248,1327,1410,1497,1588,1784,2116,2500, 3000}, - - {28,32,37,43,49,56,64,74,84,97,114,133,153,174,196,220,245,272,300,330,362,395,430,468,507,548,592,638,686,737,790,846, - 905,967,1032,1101,1172,1248,1327,1410,1497,1588,1784,2116,2500, 3000}, - - {28,32,37,43,49,56,64,74,84,97,114,133,153,174,196,220,245,272,300,330,362,395,430,468,507,548,592,638,686,737,790,846, - 905,967,1032,1101,1172,1248,1327,1410,1497,1588,1784,2116, 2500}, - - {28,32,37,43,49,56,64,74,84,97,114,133,153,174,196,220,245,272,300,330,362,395,430,468,507,548,592,638,686,737,790,846, - 905,967,1032,1101,1172,1248,1327,1410, 1497}, - - {28,32,37,43,49,56,64,74,84,97,114,133,153,174,196,220,245,272,300,330,362,395,430,468,507,548,592,638,686,737,790,846, - 905, 967}, - - {28,32,37,43,49,56,64,74,84,97,114,133,153,174,196,220,245,272,300,330,362,395,430,468,507,548, 592} - }; - -int VertexN[4] = {0,10,13,10000}; - - double DeltaPhi(double phi1, double phi2) - { - if (fabs(phi1 - phi2) <= M_PI) - { - return ( fabs(phi1 - phi2) ) ; - } - - else - { - return (2*M_PI - fabs(phi1 - phi2)); - } - - } - - - -class NewTreeAnalyzer : public edm::EDAnalyzer - { - public: - explicit NewTreeAnalyzer(edm::ParameterSet const& cfg); - virtual void beginJob(); - virtual void analyze(edm::Event const& iEvent, edm::EventSetup const& iSetup); - virtual void endJob(); - virtual ~NewTreeAnalyzer(); - typedef reco::Particle::LorentzVector LorentzVector; - private: - int mJetID,mHCALNoise,mNEvents; - static const int nJetTrig = 7, nJetVersn = 7, nMuonTrig = 10 , nMuonVersn = 10, nEtabin = 6, nvtx = 3, - nMetBin = 6, nUnc = 52, nPU = 7; - double mMinPt; - std::vector mRefTrigIndex; - std::vector mEtabin,mL1Pt,mHLTPt,mVertex; - std::vector mRefTriggerJet,mRefTriggerMuon; - std::string mFileName,mTreeName,mDirName,mPuFileName,mPuTrigName; - std::string mPFPayloadNameA, mPFPayloadNameCHSA, mPFJECUncSrcA, mPFJECUncSrcCHSA; - std::string mJECL1FastFile, mJECL1FastFileCHS, mJECL2RelativeFile, mJECL2RelativeFileCHS, - mJECL3AbsoluteFile, mJECL3AbsoluteFileCHS, mJECL2L3ResidualFile, mJECL2L3ResidualFileCHS; - static bool sort_pfjets(QCDPFJet j1, QCDPFJet j2) { - return j1.ptCor() > j2.ptCor(); - } - - // char mPuTrigName; - - - // ---- Jet Corrector Parameter ---- // - JetCorrectorParameters *L1Fast, *L2Relative, *L3Absolute, *L2L3Residual; - vector vecL1Fast, vecL2Relative, vecL3Absolute, vecL2L3Residual; - FactorizedJetCorrector *jecL1Fast, *jecL2Relative, *jecL3Absolute, *jecL2L3Residual; - - // ======== ***************** ======= // - edm::Service fs; - TTree *mTree; - TFile *mInf, *mPuf; - TDirectoryFile *mDir; - bool mIsMCarlo, mIsCHS, isPFJecUncSet_; - std::vector mJECUncSrcNames; - // - jec unc sources ----// - JetCorrectionUncertainty *mPFUnc; - std::vector mPFUncSrc; - - //---- TREE variable -------- - QCDEvent *Event; - - TString HLTJet[nJetTrig][nJetVersn], HLTMuon[nMuonTrig][nMuonVersn]; - - char name[200],title[200],trigtitle[200]; - - int ihltj[nJetTrig][nJetVersn] ,prescalej[nJetTrig][nJetVersn]; - - bool hltPassj[nJetTrig][nJetVersn], hltPassm[nMuonTrig][nMuonVersn]; - - //------- PU Reweighting Function ------------// - void LumiReWeighting( std::vector< float > MC_distr, std::vector< float > Lumi_distr); - TH1F *weights_, *MC_distr_, *Data_distr_, *den; - double puweight(float npv); - std::vector WSummer2012; - std::vector WData2012; - - - //--------- Histogram Declaration --------------------// - - TH1F *PFPt[nEtabin][nJetTrig][nJetVersn], *PFPtUp[nEtabin][nUnc][nJetTrig][nJetVersn], *PFPtDown[nEtabin][nUnc][nJetTrig][nJetVersn]; - - TH1F *PFPt_Tot[nEtabin], *PFPtUp_Tot[nEtabin][nUnc], *PFPtDown_Tot[nEtabin][nUnc], *PFPtUp_Ratio_Tot[nEtabin][nUnc], *PFPtDown_Ratio_Tot[nEtabin][nUnc]; - - - TH1F *PFJet0[nJetTrig][nJetVersn][nEtabin][nvtx] , *PFJet1[nJetTrig][nJetVersn][nEtabin][nvtx], *PFJet2[nJetTrig][nJetVersn][nEtabin], *PFJet2Eta[nJetTrig][nJetVersn][nEtabin], *PFJet2Phi[nJetTrig][nJetVersn][nEtabin]; - TH1F *PFJetMJJ0[nJetTrig][nJetVersn][nEtabin][nvtx] , *PFJetMJJ1[nJetTrig][nJetVersn][nEtabin][nvtx]; - - TH1F *PFJet[nJetTrig][nJetVersn][nEtabin], *PFJetYield[nJetTrig][nJetVersn][nEtabin], *PFJetL[nJetTrig][nJetVersn], *PFJetGen[nJetTrig][nJetVersn][nEtabin]; - - TH1F *PFJetPU[nJetTrig][nJetVersn][nEtabin][nPU]; - - TH1F *ChHadFr[nJetTrig][nJetVersn][nEtabin], *NuHadFr[nJetTrig][nJetVersn][nEtabin], *PhFr[nJetTrig][nJetVersn][nEtabin], *ElFr[nJetTrig][nJetVersn][nEtabin], *MuFr[nJetTrig][nJetVersn][nEtabin] ; - TH1F *ChHadFrPT[nJetTrig][nJetVersn][nEtabin], *NuHadFrPT[nJetTrig][nJetVersn][nEtabin], *PhFrPT[nJetTrig][nJetVersn][nEtabin], *ElFrPT[nJetTrig][nJetVersn][nEtabin], *MuFrPT[nJetTrig][nJetVersn][nEtabin] ; - - - TH2F* PrescalevsRun[nJetTrig][nJetVersn], *BetavsPT[nJetTrig][nJetVersn][nEtabin]; TH1F *MetHT[nJetTrig][nJetVersn], *NPV[nJetTrig][nJetVersn]; - - TH1F *TagJet[nJetTrig][nJetVersn][nEtabin], *ProbeJet[nJetTrig][nJetVersn][nEtabin], *PV, *GenJet[nEtabin]; - TH1F *Unfolding_GenPt[nEtabin], *Unfolding_RecoPt[nEtabin]; - TH2F *Unfolding_RecoGenPt[nEtabin]; - TH1F *PtRes[nEtabin][nbin1], *hAux[nJetTrig][nJetVersn][nEtabin], *hAux1[nJetTrig][nJetVersn][nEtabin]; // Auxiliary histos fo jet fraction - TH1F *MPFEventPT[nJetTrig][nJetVersn][nEtabin], *MPFEventCountPT[nJetTrig][nJetVersn][nEtabin][100]; - TProfile *AvgX_Pt[nEtabin][nbin1], *AvgCHF_NPV[nJetTrig][nJetVersn][nEtabin], *AvgNHF_NPV[nJetTrig][nJetVersn][nEtabin], *AvgPHF_NPV[nJetTrig][nJetVersn][nEtabin]; - TProfile *PFJetPt_L1Fast[nJetTrig][nJetVersn][nEtabin], *PFJetPt_L2Relative[nJetTrig][nJetVersn][nEtabin], *PFJetPt_L3Absolute[nJetTrig][nJetVersn][nEtabin], - *PFJetPt_L2L3Residual[nJetTrig][nJetVersn][nEtabin], *PFJetPt_TotalJEC[nJetTrig][nJetVersn][nEtabin]; - - }; - -#endif diff --git a/AnalysisFW/plugins/ProcessedTreeProducer.cc b/AnalysisFW/plugins/ProcessedTreeProducer.cc deleted file mode 100644 index 17a7bf5ba11..00000000000 --- a/AnalysisFW/plugins/ProcessedTreeProducer.cc +++ /dev/null @@ -1,732 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include "TTree.h" -#include -#include -#include - -#include "SMPJ/AnalysisFW/plugins/ProcessedTreeProducer.h" -#include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/Framework/interface/ESHandle.h" -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/MakerMacros.h" -#include "FWCore/Common/interface/TriggerNames.h" -#include "FWCore/Common/interface/TriggerResultsByName.h" - -#include "DataFormats/VertexReco/interface/Vertex.h" -#include "DataFormats/VertexReco/interface/VertexFwd.h" -#include "DataFormats/Common/interface/Handle.h" -#include "DataFormats/Math/interface/deltaR.h" -#include "DataFormats/JetReco/interface/Jet.h" -#include "DataFormats/JetReco/interface/PFJet.h" -#include "DataFormats/JetReco/interface/PFJetCollection.h" -#include "DataFormats/JetReco/interface/GenJet.h" -#include "DataFormats/JetReco/interface/GenJetCollection.h" -#include "DataFormats/JetReco/interface/JetExtendedAssociation.h" -#include "DataFormats/JetReco/interface/JetID.h" -#include "DataFormats/METReco/interface/HcalNoiseSummary.h" -#include "DataFormats/BeamSpot/interface/BeamSpot.h" -#include "DataFormats/TrackReco/interface/TrackFwd.h" - -#include "DataFormats/PatCandidates/interface/MET.h" -#include "DataFormats/PatCandidates/interface/PackedCandidate.h" - -#include "SimDataFormats/GeneratorProducts/interface/GenEventInfoProduct.h" -#include "SimDataFormats/PileupSummaryInfo/interface/PileupSummaryInfo.h" - -#include "CondFormats/JetMETObjects/interface/JetCorrectorParameters.h" -#include "JetMETCorrections/Objects/interface/JetCorrectionsRecord.h" - -ProcessedTreeProducer::ProcessedTreeProducer(edm::ParameterSet const& cfg) -{ -// mPFJECservice = cfg.getParameter ("pfjecService"); - mPFPayloadName = cfg.getParameter ("PFPayloadName"); - mPFPayloadNameCHS = cfg.getParameter ("PFPayloadNameCHS"); - pfpujetid = cfg.getParameter ("pfpujetid"); - pfchsjetpuid = cfg.getParameter ("pfchsjetpuid"); - mGoodVtxNdof = cfg.getParameter ("goodVtxNdof"); - mGoodVtxZ = cfg.getParameter ("goodVtxZ"); - mMinPFPt = cfg.getParameter ("minPFPt"); - mMinJJMass = cfg.getParameter ("minJJMass"); - mMaxY = cfg.getParameter ("maxY"); - mMinNPFJets = cfg.getParameter ("minNPFJets"); - mOfflineVertices = cfg.getParameter ("offlineVertices"); - mPFJetsName = cfg.getParameter ("pfjets"); - mPFJetsNameCHS = cfg.getParameter ("pfjetschs"); - mSrcCaloRho = cfg.getParameter ("srcCaloRho"); - mSrcPFRho = cfg.getParameter ("srcPFRho"); - mPFMET =(consumes(cfg.getParameter("pfmet"))); - mSrcPU = cfg.getUntrackedParameter ("srcPU",edm::InputTag("addPileupInfo")); - mGenJetsName = cfg.getUntrackedParameter ("genjets",edm::InputTag("")); - mPrintTriggerMenu = cfg.getUntrackedParameter ("printTriggerMenu",false); - mIsMCarlo = cfg.getUntrackedParameter ("isMCarlo",false); - mUseGenInfo = cfg.getUntrackedParameter ("useGenInfo",false); - mMinGenPt = cfg.getUntrackedParameter ("minGenPt",30); - processName_ = cfg.getParameter ("processName"); - triggerNames_ = cfg.getParameter > ("triggerName"); - triggerResultsTag_ = cfg.getParameter ("triggerResults"); - triggerEventTag_ = cfg.getParameter ("triggerEvent"); - mPFJECUncSrc = cfg.getParameter ("jecUncSrc"); - mPFJECUncSrcCHS = cfg.getParameter ("jecUncSrcCHS"); - mPFJECUncSrcNames = cfg.getParameter > ("jecUncSrcNames"); -} -////////////////////////////////////////////////////////////////////////////////////////// -void ProcessedTreeProducer::beginJob() -{ - mTree = fs->make("ProcessedTree","ProcessedTree"); - mEvent = new QCDEvent(); - mTree->Branch("events","QCDEvent",&mEvent); - mTriggerNamesHisto = fs->make("TriggerNames","TriggerNames",1,0,1); - mTriggerNamesHisto->SetBit(TH1::kCanRebin); - for(unsigned i=0;iFill(triggerNames_[i].c_str(),1); - mTriggerPassHisto = fs->make("TriggerPass","TriggerPass",1,0,1); - mTriggerPassHisto->SetBit(TH1::kCanRebin); - isPFJecUncSet_ = false; - isPFJecUncSetCHS_ = false; -} -////////////////////////////////////////////////////////////////////////////////////////// -void ProcessedTreeProducer::endJob() -{ -} -////////////////////////////////////////////////////////////////////////////////////////// -void ProcessedTreeProducer::beginRun(edm::Run const & iRun, edm::EventSetup const& iSetup) -{ - bool changed(true); - if (hltConfig_.init(iRun,iSetup,processName_,changed)) { - if (changed) { - // check if trigger names in (new) config - cout<<"New trigger menu found !!!"<= n) - cout<<"does not exist in the current menu"< mPFJets; - vector mPFJetsCHS; - vector mGenJets; - QCDEventHdr mEvtHdr; - QCDMET mPFMet; - - - //-------------- Basic Event Info ------------------------------ - mEvtHdr.setRun(event.id().run()); - mEvtHdr.setEvt(event.id().event()); - mEvtHdr.setLumi(event.luminosityBlock()); - mEvtHdr.setBunch(event.bunchCrossing()); - //-------------- Beam Spot -------------------------------------- - Handle beamSpot; - event.getByLabel("offlineBeamSpot", beamSpot); - if (beamSpot.isValid()) - mEvtHdr.setBS(beamSpot->x0(),beamSpot->y0(),beamSpot->z0()); - else - mEvtHdr.setBS(-999,-999,-999); - - - //-------------- HCAL Noise Summary ----------------------------- - Handle noiseSummary; - Handle noiseSummary_NoMinZ; - - if (!mIsMCarlo) { - // event.getByLabel(mHBHENoiseFilter,noiseSummary); - event.getByLabel(edm::InputTag("HBHENoiseFilterResultProducer","HBHENoiseFilterResult"), noiseSummary); - mEvtHdr.setHCALNoise(*noiseSummary); - - event.getByLabel(edm::InputTag("HBHENoiseFilterResultProducerNoMinZ","HBHENoiseFilterResult"), noiseSummary_NoMinZ); - mEvtHdr.setHCALNoiseNoMinZ(*noiseSummary_NoMinZ); - - } - else{ - mEvtHdr.setHCALNoise(true); - mEvtHdr.setHCALNoiseNoMinZ(true); - } - //-------------- Trigger Info ----------------------------------- - event.getByLabel(triggerResultsTag_,triggerResultsHandle_); - if (!triggerResultsHandle_.isValid()) { - cout << "ProcessedTreeProducer::analyze: Error in getting TriggerResults product from Event!" << endl; - return; - } - event.getByLabel(triggerEventTag_,triggerEventHandle_); - if (!triggerEventHandle_.isValid()) { - cout << "ProcessedTreeProducer::analyze: Error in getting TriggerEvent product from Event!" << endl; - return; - } - vector L1Prescales,HLTPrescales,Fired; - vector > mL1Objects,mHLTObjects; - // sanity check - assert(triggerResultsHandle_->size() == hltConfig_.size()); - //------ loop over all trigger names --------- - for(unsigned itrig=0;itrig vvL1,vvHLT; - if (triggerIndex_[itrig] < hltConfig_.size()) { - accept = triggerResultsHandle_->accept(triggerIndex_[itrig]); -// const std::pair prescales(hltConfig_.prescaleValues(event,iSetup,triggerNames_[itrig])); - -///In detail - //get prescale info from hltConfig_ - std::pair >,int> detailedPrescaleInfo = hltConfig_.prescaleValuesInDetail(event, iSetup, triggerNames_[itrig]); - preHLT = detailedPrescaleInfo.second ; - // save l1 prescale values in standalone vector - std::vector l1prescalevals; - for( size_t varind = 0; varind < detailedPrescaleInfo.first.size(); varind++ ){ - l1prescalevals.push_back(detailedPrescaleInfo.first.at(varind).second); - - } - - // find and save minimum l1 prescale of any ORed L1 that seeds the HLT - std::vector::iterator result = std::min_element(std::begin(l1prescalevals), std::end(l1prescalevals)); - size_t minind = std::distance(std::begin(l1prescalevals), result); - // sometimes there are no L1s associated with a HLT. In that case, this branch stores -1 for the l1prescale - //l1prescales->push_back( minind < l1prescalevals.size() ? l1prescalevals.at(minind) : -1 ); - preL1 = minind < l1prescalevals.size() ? l1prescalevals.at(minind) : -1 ; -///end in detail -// preL1 = prescales.first; -/// preHLT = prescales.second; - if (!accept) - tmpFired = 0; - else { - mTriggerPassHisto->Fill(triggerNames_[itrig].c_str(),1); - tmpFired = 1; - } - //--------- modules on this trigger path-------------- - const vector& moduleLabels(hltConfig_.moduleLabels(triggerIndex_[itrig])); - const unsigned int moduleIndex(triggerResultsHandle_->index(triggerIndex_[itrig])); - bool foundL1(false); - for(unsigned int j=0; j<=moduleIndex; ++j) { - const string& moduleLabel(moduleLabels[j]); - const string moduleType(hltConfig_.moduleType(moduleLabel)); - //--------check whether the module is packed up in TriggerEvent product - const unsigned int filterIndex(triggerEventHandle_->filterIndex(InputTag(moduleLabel,"",processName_))); - if (filterIndexsizeFilters()) { - const Vids& VIDS (triggerEventHandle_->filterIds(filterIndex)); - const Keys& KEYS(triggerEventHandle_->filterKeys(filterIndex)); - const size_type nI(VIDS.size()); - const size_type nK(KEYS.size()); - assert(nI==nK); - const size_type n(max(nI,nK)); - const TriggerObjectCollection& TOC(triggerEventHandle_->getObjects()); - if (foundL1) { - for(size_type i=0; i!=n; ++i) { - const TriggerObject& TO(TOC[KEYS[i]]); - TLorentzVector P4; - P4.SetPtEtaPhiM(TO.pt(),TO.eta(),TO.phi(),TO.mass()); - LorentzVector qcdhltobj(P4.Px(),P4.Py(),P4.Pz(),P4.E()); - vvHLT.push_back(qcdhltobj); - //cout<setTrigDecision(Fired); - mEvent->setPrescales(L1Prescales,HLTPrescales); - mEvent->setL1Obj(mL1Objects); - mEvent->setHLTObj(mHLTObjects); - - - //-------------- Vertex Info ----------------------------------- - Handle recVtxs; - event.getByLabel(mOfflineVertices,recVtxs); - //------------- reject events without reco vertices ------------ - int VtxGood(0); - bool isPVgood(false); - float PVx(0),PVy(0),PVz(0),PVndof(0); - for(VertexCollection::const_iterator i_vtx = recVtxs->begin(); i_vtx != recVtxs->end(); i_vtx++) { - int index = i_vtx-recVtxs->begin(); - if (index == 0) { - PVx = i_vtx->x(); - PVy = i_vtx->y(); - PVz = i_vtx->z(); - PVndof = i_vtx->ndof(); - } - if (!(i_vtx->isFake()) && i_vtx->ndof() >= mGoodVtxNdof && fabs(i_vtx->z()) <= mGoodVtxZ) { - if (index == 0) { - isPVgood = true; - } - VtxGood++; - } - } - mEvtHdr.setVertices(recVtxs->size(),VtxGood); - mEvtHdr.setPV(isPVgood,PVndof,PVx,PVy,PVz); - //-------------- Rho ------------------------------------------------ - Handle rhoCalo; - event.getByLabel(mSrcCaloRho,rhoCalo); - Handle rhoPF; - event.getByLabel(mSrcPFRho,rhoPF); - mEvtHdr.setRho(*rhoCalo,*rhoPF); - //-------------- Generator Info ------------------------------------- - Handle hEventInfo; - //-------------- Simulated PU Info ---------------------------------- - Handle > PupInfo; - if (mIsMCarlo && mUseGenInfo) { - event.getByLabel("generator", hEventInfo); - if(hEventInfo->hasBinningValues()) - mEvtHdr.setPthat(hEventInfo->binningValues()[0]); - else - mEvtHdr.setPthat(0); - - mEvtHdr.setWeight(hEventInfo->weight()); - event.getByLabel(mSrcPU, PupInfo); - std::vector::const_iterator PUI; - int nbx = PupInfo->size(); - int ootpuEarly(0),ootpuLate(0),intpu(0); - float Tnpv = -1.; // new variable for computing pileup weight factor for the event - - for(PUI = PupInfo->begin(); PUI != PupInfo->end(); ++PUI) { - if (PUI->getBunchCrossing() < 0) - ootpuEarly += PUI->getPU_NumInteractions(); - else if (PUI->getBunchCrossing() > 0) - ootpuLate += PUI->getPU_NumInteractions(); - else { - intpu += PUI->getPU_NumInteractions(); - Tnpv = PUI->getTrueNumInteractions(); - } - } - - mEvtHdr.setPU(nbx,ootpuEarly,ootpuLate,intpu); - mEvtHdr.setTrPu(Tnpv); - } - else { - mEvtHdr.setPthat(0); - mEvtHdr.setWeight(0); - mEvtHdr.setPU(0,0,0,0); - mEvtHdr.setTrPu(0); - } - - - //---------------- Jets --------------------------------------------- - //mPFJEC = JetCorrector::getJetCorrector(mPFJECservice,iSetup); - //event.getByToken(mvaFullPUDiscriminantToken_ ,puJetIdMva); - edm::ESHandle PFJetCorParColl; - if (mPFPayloadName != "" && !isPFJecUncSet_){ - iSetup.get().get(mPFPayloadName,PFJetCorParColl); - JetCorrectorParameters const& PFJetCorPar = (*PFJetCorParColl)["Uncertainty"]; - mPFUnc = new JetCorrectionUncertainty(PFJetCorPar); - if (mPFJECUncSrc != "") { - for(unsigned isrc=0;isrc genjets; - if (mIsMCarlo) { - event.getByLabel(mGenJetsName,genjets); - for(GenJetCollection::const_iterator i_gen = genjets->begin(); i_gen != genjets->end(); i_gen++) { - if (i_gen->pt() > mMinGenPt && fabs(i_gen->y()) < mMaxY) { - mGenJets.push_back(i_gen->p4()); - } - } - } - - //----------- PFJets non CHS part ------------------------- - - edm::Handle > patjets; - event.getByLabel(mPFJetsName,patjets); - - - for(edm::View::const_iterator i_pfjet=patjets->begin(); i_pfjet!=patjets->end(); ++i_pfjet) - { - QCDPFJet qcdpfjet; - - if(i_pfjet->isPFJet() ){ - - double scale = 1./i_pfjet->jecFactor(0); // --- the value of the JEC factor - - //---- preselection ----------------- - if (fabs(i_pfjet->y()) > mMaxY) continue; - - //---- vertex association ----------- - //---- get the vector of tracks ----- - reco::TrackRefVector vTrks(i_pfjet->associatedTracks()); - float sumTrkPt(0.0),sumTrkPtBeta(0.0),sumTrkPtBetaStar(0.0),beta(0.0),betaStar(0.0); - int mpuTrk(0), mlvTrk(0); // # of pile-up tracks & lead-vertex tracks ## Juska - int mjtTrk(0); // multiplicity of _all_ tracks in jet (also vtx-unassociated!) ## Juska - - //---- loop over the tracks of the jet ---- - //std::cout << "starting the loop yo!" << std::endl; // debug - //std::cout << "vTrks.size()" << vTrks.size() << std::endl; - for(reco::TrackRefVector::const_iterator i_trk = vTrks.begin(); i_trk != vTrks.end(); i_trk++) { - if (recVtxs->size() == 0) break; - sumTrkPt += (*i_trk)->pt(); - mjtTrk++; //Juska - //---- loop over all vertices ---------------------------- - for(unsigned ivtx = 0;ivtx < recVtxs->size();ivtx++) { - //---- loop over the tracks associated with the vertex --- - if (!((*recVtxs)[ivtx].isFake()) && (*recVtxs)[ivtx].ndof() >= mGoodVtxNdof && fabs((*recVtxs)[ivtx].z()) <= mGoodVtxZ) { - for(reco::Vertex::trackRef_iterator i_vtxTrk = (*recVtxs)[ivtx].tracks_begin(); i_vtxTrk != (*recVtxs)[ivtx].tracks_end(); ++i_vtxTrk) { - //---- match the jet track to the track from the vertex ---- - reco::TrackRef trkRef(i_vtxTrk->castTo()); - //---- check if the tracks match ------------------------- - if (trkRef == (*i_trk)) { - if (ivtx == 0) { - sumTrkPtBeta += (*i_trk)->pt(); - mlvTrk++; //Juska - } - else { - sumTrkPtBetaStar += (*i_trk)->pt(); - mpuTrk++; //Juska - } - break; - } // if (trkRef == (*i_trk)) - } // for(reco::Vertex::trackRef_iterator i_vtxTrk = (*recVtxs)[ivtx].tracks_begin(); i_vtxTrk != (*recVtxs)[ivtx].tracks_end(); ++i_vtxTrk) - } // if (!((*recVtxs)[ivtx].isFake()) && (*recVtxs)[ivtx].ndof() >= mGoodVtxNdof && fabs((*recVtxs)[ivtx].z()) <= mGoodVtxZ) - } // for(unsigned ivtx = 0;ivtx < recVtxs->size();ivtx++) - } // for(reco::TrackRefVector::const_iterator i_trk = vTrks.begin(); i_trk != vTrks.end(); i_trk++) - if (sumTrkPt > 0) { - beta = sumTrkPtBeta/sumTrkPt; - betaStar = sumTrkPtBetaStar/sumTrkPt; - } //if (sumTrkPt > 0) - qcdpfjet.setBeta(beta); - qcdpfjet.setBetaStar(betaStar); - - //---- jec uncertainty -------------- - double unc(0.0); - vector uncSrc(0); - if (mPFPayloadName != "") { - mPFUnc->setJetEta(i_pfjet->eta()); - mPFUnc->setJetPt(i_pfjet->pt()); - unc = mPFUnc->getUncertainty(true); - } // if (mPFPayloadName != "") - if (mPFJECUncSrc != "") { - for(unsigned isrc=0;isrcsetJetEta(i_pfjet->eta()); - mPFUncSrc[isrc]->setJetPt(i_pfjet->pt()); - float unc1 = mPFUncSrc[isrc]->getUncertainty(true); - uncSrc.push_back(unc1); - } // for(unsigned isrc=0;isrcp4()); - qcdpfjet.setCor(scale); - qcdpfjet.setUnc(unc); - qcdpfjet.setUncSrc(uncSrc); - qcdpfjet.setArea(i_pfjet->jetArea()); - - double chf = i_pfjet->chargedHadronEnergyFraction(); - double nhf = i_pfjet->neutralHadronEnergyFraction(); //+ i_pfjet->HFHadronEnergyFraction(); - double nemf = i_pfjet->neutralEmEnergyFraction(); // equals to old phf with HF info included - //double elf = i_pfjet->electronEnergyFraction(); equals to cemf - double cemf = i_pfjet->chargedEmEnergyFraction(); - double muf = i_pfjet->muonEnergyFraction(); - double hf_hf = i_pfjet->HFHadronEnergyFraction(); - double hf_phf= i_pfjet->HFEMEnergyFraction(); - - int hf_hm = i_pfjet->HFHadronMultiplicity(); - int hf_phm = i_pfjet->HFEMMultiplicity(); - int chm = i_pfjet->chargedHadronMultiplicity(); - int nhm = i_pfjet->neutralHadronMultiplicity(); - int phm = i_pfjet->photonMultiplicity(); - int elm = i_pfjet->electronMultiplicity(); - int mum = i_pfjet->muonMultiplicity(); - int npr = i_pfjet->chargedMultiplicity() + i_pfjet->neutralMultiplicity(); - //bool looseID = (npr>1 && phf<0.99 && nhf<0.99 && ((fabs(i_pfjet->eta())<=2.4 && elf<0.99 && chf>0 && chm>0) || fabs(i_pfjet->eta())>2.4)); - //bool tightID = (npr>1 && phf<0.99 && nhf<0.99 && ((fabs(i_pfjet->eta())<=2.4 && nhf<0.9 && phf<0.9 && elf<0.99 && chf>0 && chm>0) || fabs(i_pfjet->eta())>2.4)); - // https://twiki.cern.ch/twiki/bin/viewauth/CMS/JetID - float eta = i_pfjet->eta(); - int cm = i_pfjet->chargedMultiplicity(); - bool looseID = (nhf<0.99 && nemf<0.99 && npr>1 && muf<0.8) && ((fabs(eta) <= 2.4 && chf>0 && cm>0 && cemf<0.99) || fabs(eta)>2.4); - bool tightID = (nhf<0.90 && nemf<0.90 && npr>1 && muf<0.8) && ((fabs(eta)<=2.4 && chf>0 && cm>0 && cemf<0.90) || fabs(eta)>2.4); - - qcdpfjet.setLooseID(looseID); - qcdpfjet.setTightID(tightID); - qcdpfjet.setFrac(chf,nhf,nemf,cemf,muf); - qcdpfjet.setMulti(npr,chm,nhm,phm,elm,mum); - qcdpfjet.setHFFrac(hf_hf,hf_phf); - qcdpfjet.setHFMulti(hf_hm,hf_phm); - - double hof = i_pfjet->hoEnergyFraction(); // Juska - qcdpfjet.setVtxInfo(mpuTrk,mlvTrk,mjtTrk); - qcdpfjet.setHO(hof); - - float pileupJetId = -999; - if ( i_pfjet->hasUserFloat(pfpujetid) ) pileupJetId = i_pfjet->userFloat(pfpujetid); - qcdpfjet.SetPUJetId(pileupJetId); - - if (mIsMCarlo) { - GenJetCollection::const_iterator i_matched; - float rmin(999); - for(GenJetCollection::const_iterator i_gen = genjets->begin(); i_gen != genjets->end(); i_gen++) { - double deltaR = reco::deltaR(*i_pfjet,*i_gen); - if (deltaR < rmin) { - rmin = deltaR; - i_matched = i_gen; - } - } - if (genjets->size() == 0) { - LorentzVector tmpP4(0.0,0.0,0.0,0.0); - qcdpfjet.setGen(tmpP4,0); - } - else - qcdpfjet.setGen(i_matched->p4(),rmin); - } // if (mIsMCarlo) - else { - LorentzVector tmpP4(0.0,0.0,0.0,0.0); - qcdpfjet.setGen(tmpP4,0); - } - if (qcdpfjet.pt() >= mMinPFPt && qcdpfjet.ptCor() >= mMinPFPt/2.) - mPFJets.push_back(qcdpfjet); - - - - } // if(iJet->isPFJet() ) - } // --- end of non chs patjet iterator loop -------------------- // - -// ========================******************************************===================== // - - // -------- CHS Uncertainty part ----------------// - edm::ESHandle PFJetCorParCollCHS; - if (mPFPayloadNameCHS != "" && !isPFJecUncSetCHS_){ - iSetup.get().get(mPFPayloadNameCHS,PFJetCorParCollCHS); - JetCorrectorParameters const& PFJetCorParCHS = (*PFJetCorParCollCHS)["Uncertainty"]; - mPFUncCHS = new JetCorrectionUncertainty(PFJetCorParCHS); - if (mPFJECUncSrcCHS != "") { - for(unsigned isrc=0;isrc > patjetschs; - event.getByLabel(mPFJetsNameCHS,patjetschs); - - for(edm::View::const_iterator i_pfjetchs=patjetschs->begin(); i_pfjetchs!=patjetschs->end(); ++i_pfjetchs) - { - QCDPFJet qcdpfjetchs; - - if(i_pfjetchs->isPFJet() ){ - - double scaleCHS = 1./i_pfjetchs->jecFactor(0); // --- the value of the JEC factor - - //---- preselection ----------------- - if (fabs(i_pfjetchs->y()) > mMaxY) continue; - - //---- vertex association ----------- - //---- get the vector of tracks ----- - reco::TrackRefVector vTrksCHS(i_pfjetchs->associatedTracks()); - float sumTrkPtCHS(0.0),sumTrkPtBetaCHS(0.0),sumTrkPtBetaStarCHS(0.0),betaCHS(0.0),betaStarCHS(0.0); - - // Dunno how useful these are in chs jets... - int mpuTrk(0), mlvTrk(0); // # of pile-up tracks & lead-vertex tracks ## Juska - int mjtTrk(0); // multiplicity of _all_ tracks in jet (also vtx-unassociated!) ## Juska - - //---- loop over the tracks of the jet ---- - - for(reco::TrackRefVector::const_iterator i_trkchs = vTrksCHS.begin(); i_trkchs != vTrksCHS.end(); i_trkchs++) { - if (recVtxs->size() == 0) break; - sumTrkPtCHS += (*i_trkchs)->pt(); - mjtTrk++; //Juska - //---- loop over all vertices ---------------------------- - for(unsigned ivtx = 0;ivtx < recVtxs->size();ivtx++) { - //---- loop over the tracks associated with the vertex --- - if (!((*recVtxs)[ivtx].isFake()) && (*recVtxs)[ivtx].ndof() >= mGoodVtxNdof && fabs((*recVtxs)[ivtx].z()) <= mGoodVtxZ) { - for(reco::Vertex::trackRef_iterator i_vtxTrk = (*recVtxs)[ivtx].tracks_begin(); i_vtxTrk != (*recVtxs)[ivtx].tracks_end(); ++i_vtxTrk) { - //---- match the chsjet track to the track from the vertex ---- - reco::TrackRef trkRef(i_vtxTrk->castTo()); - //---- check if the tracks match ------------------------- - if (trkRef == (*i_trkchs)) { - if (ivtx == 0) { - sumTrkPtBetaCHS += (*i_trkchs)->pt(); - mlvTrk++; //Juska - } - else { - sumTrkPtBetaStarCHS += (*i_trkchs)->pt(); - mpuTrk++; //Juska - } - break; - } // if (trkRef == (*i_trk)) - } // for(reco::Vertex::trackRef_iterator i_vtxTrk = (*recVtxs)[ivtx].tracks_begin(); i_vtxTrk != (*recVtxs)[ivtx].tracks_end(); ++i_vtxTrk) - } // if (!((*recVtxs)[ivtx].isFake()) && (*recVtxs)[ivtx].ndof() >= mGoodVtxNdof && fabs((*recVtxs)[ivtx].z()) <= mGoodVtxZ) - } // for(unsigned ivtx = 0;ivtx < recVtxs->size();ivtx++) - } // for(reco::TrackRefVector::const_iterator i_trk = vTrks.begin(); i_trk != vTrks.end(); i_trk++) - if (sumTrkPtCHS > 0) { - betaCHS = sumTrkPtBetaCHS/sumTrkPtCHS; - betaStarCHS = sumTrkPtBetaStarCHS/sumTrkPtCHS; - } //if (sumTrkPt > 0) - qcdpfjetchs.setBeta(betaCHS); - qcdpfjetchs.setBetaStar(betaStarCHS); - - //---- jec uncertainty -------------- - double uncCHS(0.0); - vector uncSrcCHS(0); - if (mPFPayloadNameCHS != "") { - mPFUncCHS->setJetEta(i_pfjetchs->eta()); - mPFUncCHS->setJetPt(i_pfjetchs->pt()); - uncCHS = mPFUncCHS->getUncertainty(true); - } // if (mPFPayloadName != "") - if (mPFJECUncSrcCHS != "") { - for(unsigned isrc=0;isrcsetJetEta(i_pfjetchs->eta()); - mPFUncSrcCHS[isrc]->setJetPt(i_pfjetchs->pt()); - float unc1 = mPFUncSrcCHS[isrc]->getUncertainty(true); - uncSrcCHS.push_back(unc1); - } // for(unsigned isrc=0;isrcp4()); - qcdpfjetchs.setCor(scaleCHS); - qcdpfjetchs.setUnc(uncCHS); - qcdpfjetchs.setUncSrc(uncSrcCHS); - qcdpfjetchs.setArea(i_pfjetchs->jetArea()); - - double chf = i_pfjetchs->chargedHadronEnergyFraction(); - double nhf = i_pfjetchs->neutralHadronEnergyFraction();// + i_pfjetchs->HFHadronEnergyFraction(); - double nemf = i_pfjetchs->neutralEmEnergyFraction(); // equals to deprecated phf but has HF info too - double cemf = i_pfjetchs->chargedEmEnergyFraction(); // equals to deprecated elf - double muf = i_pfjetchs->muonEnergyFraction(); - double hf_hf = i_pfjetchs->HFHadronEnergyFraction(); - double hf_phf= i_pfjetchs->HFEMEnergyFraction(); - int hf_hm = i_pfjetchs->HFHadronMultiplicity(); - int hf_phm = i_pfjetchs->HFEMMultiplicity(); - int chm = i_pfjetchs->chargedHadronMultiplicity(); - int nhm = i_pfjetchs->neutralHadronMultiplicity(); - int phm = i_pfjetchs->photonMultiplicity(); - int elm = i_pfjetchs->electronMultiplicity(); - int mum = i_pfjetchs->muonMultiplicity(); - int npr = i_pfjetchs->chargedMultiplicity() + i_pfjetchs->neutralMultiplicity(); - //bool looseID = (npr>1 && phf<0.99 && nhf<0.99 && ((fabs(i_pfjetchs->eta())<=2.4 && elf<0.99 && chf>0 && chm>0) || fabs(i_pfjetchs->eta())>2.4)); - //bool tightID = (npr>1 && phf<0.99 && nhf<0.99 && ((fabs(i_pfjetchs->eta())<=2.4 && nhf<0.9 && phf<0.9 && elf<0.99 && chf>0 && chm>0) || fabs(i_pfjetchs->eta())>2.4)); - // https://twiki.cern.ch/twiki/bin/viewauth/CMS/JetID - float eta = i_pfjetchs->eta(); - int cm = i_pfjetchs->chargedMultiplicity(); - bool looseID = (nhf<0.99 && nemf<0.99 && npr>1 && muf<0.8) && ((fabs(eta) <= 2.4 && chf>0 && cm>0 && cemf<0.99) || fabs(eta)>2.4); - bool tightID = (nhf<0.90 && nemf<0.90 && npr>1 && muf<0.8) && ((fabs(eta)<=2.4 && chf>0 && cm>0 && cemf<0.90) || fabs(eta)>2.4); - - qcdpfjetchs.setLooseID(looseID); - qcdpfjetchs.setTightID(tightID); - qcdpfjetchs.setFrac(chf,nhf,nemf,cemf,muf); - qcdpfjetchs.setMulti(npr,chm,nhm,phm,elm,mum); - qcdpfjetchs.setHFFrac(hf_hf,hf_phf); - qcdpfjetchs.setHFMulti(hf_hm,hf_phm); - - - double hof = i_pfjetchs->hoEnergyFraction(); // Juska - qcdpfjetchs.setVtxInfo(mpuTrk,mlvTrk,mjtTrk); - qcdpfjetchs.setHO(hof); - - float pileupJetId = -999; - if ( i_pfjetchs->hasUserFloat(pfchsjetpuid) ) { pileupJetId = i_pfjetchs->userFloat(pfchsjetpuid);} - qcdpfjetchs.SetPUJetId(pileupJetId); - - if (mIsMCarlo) { - GenJetCollection::const_iterator i_matchedchs; - float rmin(999); - for(GenJetCollection::const_iterator i_gen = genjets->begin(); i_gen != genjets->end(); i_gen++) { - double deltaR = reco::deltaR(*i_pfjetchs,*i_gen); - if (deltaR < rmin) { - rmin = deltaR; - i_matchedchs = i_gen; - } - } - if (genjets->size() == 0) { - LorentzVector tmpP4(0.0,0.0,0.0,0.0); - qcdpfjetchs.setGen(tmpP4,0); - } - else - qcdpfjetchs.setGen(i_matchedchs->p4(),rmin); - } // if (mIsMCarlo) - else { - LorentzVector tmpP4(0.0,0.0,0.0,0.0); - qcdpfjetchs.setGen(tmpP4,0); - } - if (qcdpfjetchs.pt() >= mMinPFPt) - mPFJetsCHS.push_back(qcdpfjetchs); - - - } // if(i_pfjetchs->isPFJet() ) - } // for(edm::View::const_iterator i_pfjetchs=patjetschs->begin(); i_pfjetchs!=patjetschs->end(); ++i_pfjetchs) - - - //---------------- met --------------------------------------------- - Handle pfmet; - event.getByToken(mPFMET, pfmet); - const pat::MET &met = pfmet->front(); - mPFMet.setVar(met.et(),met.sumEt(),met.phi()); - - - //-------------- fill the tree ------------------------------------- - sort(mPFJets.begin(),mPFJets.end(),sort_pfjets); - mEvent->setEvtHdr(mEvtHdr); - mEvent->setPFJets(mPFJets); - mEvent->setPFJetsCHS(mPFJetsCHS); // -- later substitute chs jets - mEvent->setGenJets(mGenJets); - mEvent->setPFMET(mPFMet); - mEvent->setL1Obj(mL1Objects); - mEvent->setHLTObj(mHLTObjects); - if ((mEvent->nPFJetsCHS() >= (unsigned)mMinNPFJets) ) { - if ((mEvent->pfmjjcor(0) >= mMinJJMass) ) { - // cout<<"Feeling tree ----"<Fill(); - } - } - //if (mPFPayloadName != "") { - //delete mPFUnc; - //delete mPFUncSrc; - //} - - - -} -////////////////////////////////////////////////////////////////////////////////////////// -ProcessedTreeProducer::~ProcessedTreeProducer() -{ -} - -DEFINE_FWK_MODULE(ProcessedTreeProducer); diff --git a/AnalysisFW/plugins/ProcessedTreeProducer.h b/AnalysisFW/plugins/ProcessedTreeProducer.h deleted file mode 100644 index b3d8ef5b7f3..00000000000 --- a/AnalysisFW/plugins/ProcessedTreeProducer.h +++ /dev/null @@ -1,102 +0,0 @@ -#ifndef ProcessedTreeProducer_h -#define ProcessedTreeProducer_h - -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "HLTrigger/HLTcore/interface/HLTConfigProvider.h" -#include "DataFormats/Common/interface/TriggerResults.h" -#include "DataFormats/HLTReco/interface/TriggerEvent.h" -#include "JetMETCorrections/Objects/interface/JetCorrector.h" -#include "CondFormats/JetMETObjects/interface/JetCorrectionUncertainty.h" -#include "DataFormats/PatCandidates/interface/Jet.h" -#include "DataFormats/PatCandidates/interface/JetCorrFactors.h" -#include "SMPJ/AnalysisFW/interface/QCDJet.h" -#include "SMPJ/AnalysisFW/interface/QCDEvent.h" -#include "SMPJ/AnalysisFW/interface/QCDEventHdr.h" -#include "SMPJ/AnalysisFW/interface/QCDPFJet.h" -#include "SMPJ/AnalysisFW/interface/QCDMET.h" -#include "FWCore/ServiceRegistry/interface/Service.h" -#include "CommonTools/UtilAlgos/interface/TFileService.h" -#include "DataFormats/PatCandidates/interface/MET.h" -#include "DataFormats/PatCandidates/interface/PackedCandidate.h" - -using namespace edm; -using namespace reco; -using namespace std; -using namespace trigger; - -class ProcessedTreeProducer : public edm::EDAnalyzer -{ - public: - typedef reco::Particle::LorentzVector LorentzVector; - explicit ProcessedTreeProducer(edm::ParameterSet const& cfg); - virtual void beginJob(); - virtual void beginRun(edm::Run const &, edm::EventSetup const& iSetup); - virtual void analyze(edm::Event const& evt, edm::EventSetup const& iSetup); - virtual void endJob(); - virtual ~ProcessedTreeProducer(); - private: - void buildTree(); - static bool sort_pfjets(QCDPFJet j1, QCDPFJet j2) { - return j1.ptCor() > j2.ptCor(); - } - //---- configurable parameters -------- - bool mIsMCarlo; - bool mUseGenInfo; - bool mPrintTriggerMenu; - bool isPFJecUncSet_,isPFJecUncSetCHS_; - int mGoodVtxNdof,mMinNPFJets; - double mGoodVtxZ; - double mMinPFPt,mMinPFFatPt,mMaxPFFatEta,mMinGenPt,mMaxY,mMinJJMass; - std::string mPFJECservice; - std::string mPFPayloadName; - std::string mPFPayloadNameCHS; - std::string pfpujetid; - std::string pfchsjetpuid; - - // unc file for non CHS jet ---- // - std::string mPFJECUncSrc; - // unc file for CHS jet ---- // - std::string mPFJECUncSrcCHS; - std::vector mPFJECUncSrcNames; - // ---- non CHS jet input tag ----- // - edm::InputTag mPFJetsName; - // ----CHS jet input tag ----- // - edm::InputTag mPFJetsNameCHS; - edm::InputTag mGenJetsName; - edm::InputTag mOfflineVertices; - edm::InputTag mSrcCaloRho; - edm::InputTag mSrcPFRho; - edm::InputTag mSrcPU; - //edm::InputTag mPFMET; - edm::EDGetTokenT mPFMET; - //edm::InputTag mHBHENoiseFilter; - //---- TRIGGER ------------------------- - std::string processName_; - std::vector triggerNames_; - std::vector triggerIndex_; - edm::InputTag triggerResultsTag_; - edm::InputTag triggerEventTag_; - edm::Handle triggerResultsHandle_; - edm::Handle triggerEventHandle_; - HLTConfigProvider hltConfig_; - //---- CORRECTORS ---------------------- - const JetCorrector *mPFJEC; - // ---- non CHS jet uncertainty ------ // - JetCorrectionUncertainty *mPFUnc; - // ---- non CHS jet uncertainty ------ // - JetCorrectionUncertainty *mPFUncCHS; - //------- non CHS jet uncertainty sources -------- // - std::vector mPFUncSrc; - // -------- CHS jet uncertainty sources -------- // - std::vector mPFUncSrcCHS; - - edm::Service fs; - TTree *mTree; - TH1F *mTriggerPassHisto,*mTriggerNamesHisto; - //---- TREE variables -------- - QCDEvent *mEvent; -}; - -#endif diff --git a/AnalysisFW/plugins/ProcessedTreeProducerGEN.cc b/AnalysisFW/plugins/ProcessedTreeProducerGEN.cc deleted file mode 100644 index 573247fc756..00000000000 --- a/AnalysisFW/plugins/ProcessedTreeProducerGEN.cc +++ /dev/null @@ -1,85 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include "TTree.h" -#include -#include -#include - -#include "SMPJ/AnalysisFW/plugins/ProcessedTreeProducerGEN.h" -#include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/Framework/interface/ESHandle.h" -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/MakerMacros.h" - -#include "DataFormats/Common/interface/Handle.h" -#include "DataFormats/JetReco/interface/Jet.h" -#include "DataFormats/JetReco/interface/GenJet.h" -#include "DataFormats/JetReco/interface/GenJetCollection.h" -#include "DataFormats/JetReco/interface/JetExtendedAssociation.h" -#include "DataFormats/JetReco/interface/JetID.h" -#include "SimDataFormats/GeneratorProducts/interface/GenEventInfoProduct.h" - -ProcessedTreeProducerGEN::ProcessedTreeProducerGEN(edm::ParameterSet const& cfg) -{ - mMaxY = cfg.getParameter ("maxY"); - mGenJetsName = cfg.getUntrackedParameter ("genjets",edm::InputTag("")); - mMinGenPt = cfg.getUntrackedParameter ("minGenPt",30); -} -////////////////////////////////////////////////////////////////////////////////////////// -void ProcessedTreeProducerGEN::beginJob() -{ - mTree = fs->make("ProcessedTree","ProcessedTree"); - mEvent = new QCDEvent(); - mTree->Branch("events","QCDEvent",&mEvent); -} -////////////////////////////////////////////////////////////////////////////////////////// -void ProcessedTreeProducerGEN::endJob() -{ -} -////////////////////////////////////////////////////////////////////////////////////////// -void ProcessedTreeProducerGEN::beginRun(edm::Run const & iRun, edm::EventSetup const& iSetup) -{ - -} -////////////////////////////////////////////////////////////////////////////////////////// -void ProcessedTreeProducerGEN::analyze(edm::Event const& event, edm::EventSetup const& iSetup) -{ - vector mGenJets; - QCDEventHdr mEvtHdr; - //-------------- Basic Event Info ------------------------------ - mEvtHdr.setRun(event.id().run()); - mEvtHdr.setEvt(event.id().event()); - mEvtHdr.setLumi(event.luminosityBlock()); - mEvtHdr.setBunch(event.bunchCrossing()); - //-------------- Generator Info ------------------------------------- - Handle hEventInfo; - event.getByLabel("generator", hEventInfo); - mEvtHdr.setPthat(hEventInfo->binningValues()[0]); - mEvtHdr.setWeight(hEventInfo->weight()); - - Handle genjets; - event.getByLabel(mGenJetsName,genjets); - for(GenJetCollection::const_iterator i_gen = genjets->begin(); i_gen != genjets->end(); i_gen++) { - if (i_gen->pt() > mMinGenPt && fabs(i_gen->y()) < mMaxY) { - mGenJets.push_back(i_gen->p4()); - } - } - - //-------------- fill the tree ------------------------------------- - mEvent->setEvtHdr(mEvtHdr); - mEvent->setGenJets(mGenJets); - if ( genjets->size() > 0 ) - mTree->Fill(); -} -////////////////////////////////////////////////////////////////////////////////////////// -ProcessedTreeProducerGEN::~ProcessedTreeProducerGEN() -{ -} - -DEFINE_FWK_MODULE(ProcessedTreeProducerGEN); diff --git a/AnalysisFW/plugins/ProcessedTreeProducerGEN.h b/AnalysisFW/plugins/ProcessedTreeProducerGEN.h deleted file mode 100644 index 4f448f77031..00000000000 --- a/AnalysisFW/plugins/ProcessedTreeProducerGEN.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef ProcessedTreeProducerGEN_h -#define ProcessedTreeProducerGEN_h - -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "HLTrigger/HLTcore/interface/HLTConfigProvider.h" -#include "DataFormats/Common/interface/TriggerResults.h" -#include "DataFormats/HLTReco/interface/TriggerEvent.h" -#include "SMPJ/AnalysisFW/interface/QCDJet.h" -#include "SMPJ/AnalysisFW/interface/QCDEvent.h" -#include "SMPJ/AnalysisFW/interface/QCDEventHdr.h" -#include "SMPJ/AnalysisFW/interface/QCDPFJet.h" -#include "SMPJ/AnalysisFW/interface/QCDMET.h" -#include "FWCore/ServiceRegistry/interface/Service.h" -#include "CommonTools/UtilAlgos/interface/TFileService.h" -#include "DataFormats/PatCandidates/interface/MET.h" -#include "DataFormats/PatCandidates/interface/PackedCandidate.h" - -using namespace edm; -using namespace reco; -using namespace std; -using namespace trigger; - -class ProcessedTreeProducerGEN : public edm::EDAnalyzer -{ - public: - typedef reco::Particle::LorentzVector LorentzVector; - explicit ProcessedTreeProducerGEN(edm::ParameterSet const& cfg); - virtual void beginJob(); - virtual void beginRun(edm::Run const &, edm::EventSetup const& iSetup); - virtual void analyze(edm::Event const& evt, edm::EventSetup const& iSetup); - virtual void endJob(); - virtual ~ProcessedTreeProducerGEN(); - private: - void buildTree(); - //---- configurable parameters -------- - double mMinGenPt,mMaxY; - edm::InputTag mGenJetsName; - edm::Service fs; - TTree *mTree; - //---- TREE variables -------- - QCDEvent *mEvent; -}; - -#endif diff --git a/AnalysisFW/plugins/ProcessedTreeProducerPFCalo.cc b/AnalysisFW/plugins/ProcessedTreeProducerPFCalo.cc deleted file mode 100644 index e74738fb1fe..00000000000 --- a/AnalysisFW/plugins/ProcessedTreeProducerPFCalo.cc +++ /dev/null @@ -1,554 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include "TTree.h" -#include -#include -#include - -#include "SMPJ/AnalysisFW/plugins/ProcessedTreeProducerPFCalo.h" -#include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/Framework/interface/ESHandle.h" -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/MakerMacros.h" -#include "FWCore/Common/interface/TriggerNames.h" -#include "FWCore/Common/interface/TriggerResultsByName.h" - -#include "DataFormats/VertexReco/interface/Vertex.h" -#include "DataFormats/VertexReco/interface/VertexFwd.h" -#include "DataFormats/Common/interface/Handle.h" -#include "DataFormats/Math/interface/deltaR.h" -#include "DataFormats/JetReco/interface/Jet.h" -#include "DataFormats/JetReco/interface/PFJet.h" -#include "DataFormats/JetReco/interface/PFJetCollection.h" -#include "DataFormats/JetReco/interface/CaloJet.h" -#include "DataFormats/JetReco/interface/CaloJetCollection.h" -#include "DataFormats/JetReco/interface/GenJet.h" -#include "DataFormats/JetReco/interface/GenJetCollection.h" -#include "DataFormats/JetReco/interface/JetExtendedAssociation.h" -#include "DataFormats/JetReco/interface/JetID.h" -#include "DataFormats/METReco/interface/PFMET.h" -#include "DataFormats/METReco/interface/PFMETCollection.h" -#include "DataFormats/METReco/interface/CaloMET.h" -#include "DataFormats/METReco/interface/CaloMETCollection.h" -#include "DataFormats/METReco/interface/HcalNoiseSummary.h" -#include "DataFormats/BeamSpot/interface/BeamSpot.h" -#include "DataFormats/TrackReco/interface/TrackFwd.h" - -#include "SimDataFormats/GeneratorProducts/interface/GenEventInfoProduct.h" -#include "SimDataFormats/PileupSummaryInfo/interface/PileupSummaryInfo.h" - -#include "CondFormats/JetMETObjects/interface/JetCorrectorParameters.h" -#include "JetMETCorrections/Objects/interface/JetCorrectionsRecord.h" - -ProcessedTreeProducerPFCalo::ProcessedTreeProducerPFCalo(edm::ParameterSet const& cfg) -{ - mPFJECservice = cfg.getParameter ("pfjecService"); - mCaloJECservice = cfg.getParameter ("calojecService"); - mPFPayloadName = cfg.getParameter ("PFPayloadName"); - mCaloPayloadName = cfg.getParameter ("CaloPayloadName"); - mGoodVtxNdof = cfg.getParameter ("goodVtxNdof"); - mGoodVtxZ = cfg.getParameter ("goodVtxZ"); - mMinCaloPt = cfg.getParameter ("minCaloPt"); - mMinPFPt = cfg.getParameter ("minPFPt"); - mMinJJMass = cfg.getParameter ("minJJMass"); - mMaxY = cfg.getParameter ("maxY"); - mMinNCaloJets = cfg.getParameter ("minNCaloJets"); - mMinNPFJets = cfg.getParameter ("minNPFJets"); - mCaloJetID = cfg.getParameter ("calojetID"); - mCaloJetExtender = cfg.getParameter ("calojetExtender"); - mOfflineVertices = cfg.getParameter ("offlineVertices"); - mPFJetsName = cfg.getParameter ("pfjets"); - mCaloJetsName = cfg.getParameter ("calojets"); - mSrcCaloRho = cfg.getParameter ("srcCaloRho"); - mSrcPFRho = cfg.getParameter ("srcPFRho"); - mSrcPU = cfg.getUntrackedParameter ("srcPU",edm::InputTag("addPileupInfo")); - mGenJetsName = cfg.getUntrackedParameter ("genjets",edm::InputTag("")); - mPrintTriggerMenu = cfg.getUntrackedParameter ("printTriggerMenu",false); - mIsMCarlo = cfg.getUntrackedParameter ("isMCarlo",false); - mUseGenInfo = cfg.getUntrackedParameter ("useGenInfo",false); - mMinGenPt = cfg.getUntrackedParameter ("minGenPt",30); - processName_ = cfg.getParameter ("processName"); - triggerNames_ = cfg.getParameter > ("triggerName"); - triggerResultsTag_ = cfg.getParameter ("triggerResults"); - triggerEventTag_ = cfg.getParameter ("triggerEvent"); - mPFJECUncSrc = cfg.getParameter ("jecUncSrc"); - mPFJECUncSrcNames = cfg.getParameter > ("jecUncSrcNames"); -} -////////////////////////////////////////////////////////////////////////////////////////// -void ProcessedTreeProducerPFCalo::beginJob() -{ - mTree = fs->make("ProcessedTree","ProcessedTree"); - mEvent = new QCDEvent(); - mTree->Branch("events","QCDEvent",&mEvent); - mTriggerNamesHisto = fs->make("TriggerNames","TriggerNames",1,0,1); - mTriggerNamesHisto->SetBit(TH1::kCanRebin); - for(unsigned i=0;iFill(triggerNames_[i].c_str(),1); - mTriggerPassHisto = fs->make("TriggerPass","TriggerPass",1,0,1); - mTriggerPassHisto->SetBit(TH1::kCanRebin); - isPFJecUncSet_ = false; - isCaloJecUncSet_ = false; -} -////////////////////////////////////////////////////////////////////////////////////////// -void ProcessedTreeProducerPFCalo::endJob() -{ -} -////////////////////////////////////////////////////////////////////////////////////////// -void ProcessedTreeProducerPFCalo::beginRun(edm::Run const & iRun, edm::EventSetup const& iSetup) -{ - bool changed(true); - if (hltConfig_.init(iRun,iSetup,processName_,changed)) { - if (changed) { - // check if trigger names in (new) config - cout<<"New trigger menu found !!!"<= n) - cout<<"does not exist in the current menu"< mCaloJets; - vector mPFJets; - vector tmpPFJets; - vector mGenJets; - QCDEventHdr mEvtHdr; - QCDMET mCaloMet,mPFMet; - //-------------- Basic Event Info ------------------------------ - mEvtHdr.setRun(event.id().run()); - mEvtHdr.setEvt(event.id().event()); - mEvtHdr.setLumi(event.luminosityBlock()); - mEvtHdr.setBunch(event.bunchCrossing()); - //-------------- Beam Spot -------------------------------------- - Handle beamSpot; - event.getByLabel("offlineBeamSpot", beamSpot); - if (beamSpot.isValid()) - mEvtHdr.setBS(beamSpot->x0(),beamSpot->y0(),beamSpot->z0()); - else - mEvtHdr.setBS(-999,-999,-999); - - //-------------- HCAL Noise Summary ----------------------------- - Handle noiseSummary; - if (!mIsMCarlo) { - event.getByLabel(edm::InputTag("HBHENoiseFilterResultProducer","HBHENoiseFilterResult"), noiseSummary); - mEvtHdr.setHCALNoise(*noiseSummary); - } - else - mEvtHdr.setHCALNoise(true); - //-------------- Trigger Info ----------------------------------- - event.getByLabel(triggerResultsTag_,triggerResultsHandle_); - if (!triggerResultsHandle_.isValid()) { - cout << "ProcessedTreeProducerPFCalo::analyze: Error in getting TriggerResults product from Event!" << endl; - return; - } - event.getByLabel(triggerEventTag_,triggerEventHandle_); - if (!triggerEventHandle_.isValid()) { - cout << "ProcessedTreeProducerPFCalo::analyze: Error in getting TriggerEvent product from Event!" << endl; - return; - } - vector L1Prescales,HLTPrescales,Fired; - vector > mL1Objects,mHLTObjects; - // sanity check - assert(triggerResultsHandle_->size() == hltConfig_.size()); - //------ loop over all trigger names --------- - for(unsigned itrig=0;itrig vvL1,vvHLT; - if (triggerIndex_[itrig] < hltConfig_.size()) { - accept = triggerResultsHandle_->accept(triggerIndex_[itrig]); - const std::pair prescales(hltConfig_.prescaleValues(event,iSetup,triggerNames_[itrig])); - preL1 = prescales.first; - preHLT = prescales.second; - if (!accept) - tmpFired = 0; - else { - mTriggerPassHisto->Fill(triggerNames_[itrig].c_str(),1); - tmpFired = 1; - } - //--------- modules on this trigger path-------------- - const vector& moduleLabels(hltConfig_.moduleLabels(triggerIndex_[itrig])); - const unsigned int moduleIndex(triggerResultsHandle_->index(triggerIndex_[itrig])); - bool foundL1(false); - for(unsigned int j=0; j<=moduleIndex; ++j) { - const string& moduleLabel(moduleLabels[j]); - const string moduleType(hltConfig_.moduleType(moduleLabel)); - //--------check whether the module is packed up in TriggerEvent product - const unsigned int filterIndex(triggerEventHandle_->filterIndex(InputTag(moduleLabel,"",processName_))); - if (filterIndexsizeFilters()) { - const Vids& VIDS (triggerEventHandle_->filterIds(filterIndex)); - const Keys& KEYS(triggerEventHandle_->filterKeys(filterIndex)); - const size_type nI(VIDS.size()); - const size_type nK(KEYS.size()); - assert(nI==nK); - const size_type n(max(nI,nK)); - const TriggerObjectCollection& TOC(triggerEventHandle_->getObjects()); - if (foundL1) { - for(size_type i=0; i!=n; ++i) { - const TriggerObject& TO(TOC[KEYS[i]]); - TLorentzVector P4; - P4.SetPtEtaPhiM(TO.pt(),TO.eta(),TO.phi(),TO.mass()); - LorentzVector qcdhltobj(P4.Px(),P4.Py(),P4.Pz(),P4.E()); - vvHLT.push_back(qcdhltobj); - //cout<setTrigDecision(Fired); - mEvent->setPrescales(L1Prescales,HLTPrescales); - mEvent->setL1Obj(mL1Objects); - mEvent->setHLTObj(mHLTObjects); - //-------------- Vertex Info ----------------------------------- - Handle recVtxs; - event.getByLabel(mOfflineVertices,recVtxs); - //------------- reject events without reco vertices ------------ - int VtxGood(0); - bool isPVgood(false); - float PVx(0),PVy(0),PVz(0),PVndof(0); - for(VertexCollection::const_iterator i_vtx = recVtxs->begin(); i_vtx != recVtxs->end(); i_vtx++) { - int index = i_vtx-recVtxs->begin(); - if (index == 0) { - PVx = i_vtx->x(); - PVy = i_vtx->y(); - PVz = i_vtx->z(); - PVndof = i_vtx->ndof(); - } - if (!(i_vtx->isFake()) && i_vtx->ndof() >= mGoodVtxNdof && fabs(i_vtx->z()) <= mGoodVtxZ) { - if (index == 0) { - isPVgood = true; - } - VtxGood++; - } - } - mEvtHdr.setVertices(recVtxs->size(),VtxGood); - mEvtHdr.setPV(isPVgood,PVndof,PVx,PVy,PVz); - //-------------- Rho ------------------------------------------------ - Handle rhoCalo; - event.getByLabel(mSrcCaloRho,rhoCalo); - Handle rhoPF; - event.getByLabel(mSrcPFRho,rhoPF); - mEvtHdr.setRho(*rhoCalo,*rhoPF); - //-------------- Generator Info ------------------------------------- - Handle hEventInfo; - //-------------- Simulated PU Info ---------------------------------- - Handle > PupInfo; - if (mIsMCarlo && mUseGenInfo) { - event.getByLabel("generator", hEventInfo); - mEvtHdr.setPthat(hEventInfo->binningValues()[0]); - mEvtHdr.setWeight(hEventInfo->weight()); -// event.getByLabel(mSrcPU, PupInfo); -// std::vector::const_iterator PUI; -// int nbx = PupInfo->size(); -// int ootpuEarly(0),ootpuLate(0),intpu(0); -// float Tnpv = -1.; // new variable for computing pileup weight factor for the event -// for(PUI = PupInfo->begin(); PUI != PupInfo->end(); ++PUI) { -// if (PUI->getBunchCrossing() < 0) -// ootpuEarly += PUI->getPU_NumInteractions(); -// else if (PUI->getBunchCrossing() > 0) -// ootpuLate += PUI->getPU_NumInteractions(); -// else { -// intpu += PUI->getPU_NumInteractions(); -// Tnpv = PUI->getTrueNumInteractions(); -// } -// } -// -// mEvtHdr.setPU(nbx,ootpuEarly,ootpuLate,intpu); -// mEvtHdr.setTrPu(Tnpv); - } - else { - mEvtHdr.setPthat(0); - mEvtHdr.setWeight(0); -// mEvtHdr.setPU(0,0,0,0); -// mEvtHdr.setTrPu(0); - } - //---------------- Jets --------------------------------------------- - //mPFJEC = JetCorrector::getJetCorrector(mPFJECservice,iSetup); - //mCALOJEC = JetCorrector::getJetCorrector(mCaloJECservice,iSetup); - edm::ESHandle PFJetCorParColl; - if (mPFPayloadName != "" && !isPFJecUncSet_){ - iSetup.get().get(mPFPayloadName,PFJetCorParColl); - JetCorrectorParameters const& PFJetCorPar = (*PFJetCorParColl)["Uncertainty"]; - mPFUnc = new JetCorrectionUncertainty(PFJetCorPar); - if (mPFJECUncSrc != "") { - for(unsigned isrc=0;isrc CaloJetCorParColl; - if (mCaloPayloadName != "" && !isCaloJecUncSet_){ - iSetup.get().get(mCaloPayloadName,CaloJetCorParColl); - JetCorrectorParameters const& CaloJetCorPar = (*CaloJetCorParColl)["Uncertainty"]; - mCALOUnc = new JetCorrectionUncertainty(CaloJetCorPar); - isCaloJecUncSet_ = true; - } - Handle genjets; - Handle pfjets; - Handle calojets; - Handle calojetExtender; - Handle > calojetID; - event.getByLabel(mPFJetsName,pfjets); - event.getByLabel(mCaloJetsName,calojets); - event.getByLabel(mCaloJetExtender,calojetExtender); - event.getByLabel(mCaloJetID,calojetID); - if (mIsMCarlo) { - event.getByLabel(mGenJetsName,genjets); - for(GenJetCollection::const_iterator i_gen = genjets->begin(); i_gen != genjets->end(); i_gen++) { - if (i_gen->pt() > mMinGenPt && fabs(i_gen->y()) < mMaxY) { - mGenJets.push_back(i_gen->p4()); - } - } - } - //----------- PFJets ------------------------- - for(PFJetCollection::const_iterator i_pfjet = pfjets->begin(); i_pfjet != pfjets->end(); i_pfjet++) { - QCDPFJet qcdpfjet; - //int index = i_pfjet-pfjets->begin(); - //edm::RefToBase pfjetRef(edm::Ref(pfjets,index)); - //double scale = mPFJEC->correction(*i_pfjet,event,iSetup); - //---- preselection ----------------- - if (fabs(i_pfjet->y()) > mMaxY) continue; - //---- vertex association ----------- - //---- get the vector of tracks ----- - reco::TrackRefVector vTrks(i_pfjet->getTrackRefs()); - float sumTrkPt(0.0),sumTrkPtBeta(0.0),sumTrkPtBetaStar(0.0),beta(0.0),betaStar(0.0); - //---- loop over the tracks of the jet ---- - for(reco::TrackRefVector::const_iterator i_trk = vTrks.begin(); i_trk != vTrks.end(); i_trk++) { - if (recVtxs->size() == 0) break; - sumTrkPt += (*i_trk)->pt(); - //---- loop over all vertices ---------------------------- - for(unsigned ivtx = 0;ivtx < recVtxs->size();ivtx++) { - //---- loop over the tracks associated with the vertex --- - if (!((*recVtxs)[ivtx].isFake()) && (*recVtxs)[ivtx].ndof() >= mGoodVtxNdof && fabs((*recVtxs)[ivtx].z()) <= mGoodVtxZ) { - for(reco::Vertex::trackRef_iterator i_vtxTrk = (*recVtxs)[ivtx].tracks_begin(); i_vtxTrk != (*recVtxs)[ivtx].tracks_end(); ++i_vtxTrk) { - //---- match the jet track to the track from the vertex ---- - reco::TrackRef trkRef(i_vtxTrk->castTo()); - //---- check if the tracks match ------------------------- - if (trkRef == (*i_trk)) { - if (ivtx == 0) { - sumTrkPtBeta += (*i_trk)->pt(); - } - else { - sumTrkPtBetaStar += (*i_trk)->pt(); - } - break; - } - } - } - } - } - if (sumTrkPt > 0) { - beta = sumTrkPtBeta/sumTrkPt; - betaStar = sumTrkPtBetaStar/sumTrkPt; - } - qcdpfjet.setBeta(beta); - qcdpfjet.setBetaStar(betaStar); - //---- jec uncertainty -------------- -// double unc(0.0); -// vector uncSrc(0); -// if (mPFPayloadName != "") { -// mPFUnc->setJetEta(i_pfjet->eta()); -// mPFUnc->setJetPt(scale * i_pfjet->pt()); -// unc = mPFUnc->getUncertainty(true); -// } -// if (mPFJECUncSrc != "") { -// for(unsigned isrc=0;isrcsetJetEta(i_pfjet->eta()); -// mPFUncSrc[isrc]->setJetPt(scale * i_pfjet->pt()); -// float unc1 = mPFUncSrc[isrc]->getUncertainty(true); -// uncSrc.push_back(unc1); -// } -// } - qcdpfjet.setP4(i_pfjet->p4()); - //qcdpfjet.setCor(scale); - //qcdpfjet.setUnc(unc); - //qcdpfjet.setUncSrc(uncSrc); - qcdpfjet.setArea(i_pfjet->jetArea()); - double chf = i_pfjet->chargedHadronEnergyFraction(); - double nhf = (i_pfjet->neutralHadronEnergy() + i_pfjet->HFHadronEnergy())/i_pfjet->energy(); - double phf = i_pfjet->photonEnergyFraction(); - double elf = i_pfjet->electronEnergyFraction(); - double muf = i_pfjet->muonEnergyFraction(); - double hf_hf = i_pfjet->HFHadronEnergyFraction(); - double hf_phf= i_pfjet->HFEMEnergyFraction(); - int hf_hm = i_pfjet->HFHadronMultiplicity(); - int hf_phm = i_pfjet->HFEMMultiplicity(); - int chm = i_pfjet->chargedHadronMultiplicity(); - int nhm = i_pfjet->neutralHadronMultiplicity(); - int phm = i_pfjet->photonMultiplicity(); - int elm = i_pfjet->electronMultiplicity(); - int mum = i_pfjet->muonMultiplicity(); - int npr = i_pfjet->chargedMultiplicity() + i_pfjet->neutralMultiplicity(); - bool looseID = (npr>1 && phf<0.99 && nhf<0.99 && ((fabs(i_pfjet->eta())<=2.4 && elf<0.99 && chf>0 && chm>0) || fabs(i_pfjet->eta())>2.4)); - bool tightID = (npr>1 && phf<0.99 && nhf<0.99 && ((fabs(i_pfjet->eta())<=2.4 && nhf<0.9 && phf<0.9 && elf<0.99 && chf>0 && chm>0) || fabs(i_pfjet->eta())>2.4)); - qcdpfjet.setLooseID(looseID); - qcdpfjet.setTightID(tightID); - qcdpfjet.setFrac(chf,nhf,phf,elf,muf); - qcdpfjet.setMulti(npr,chm,nhm,phm,elm,mum); - qcdpfjet.setHFFrac(hf_hf,hf_phf); - qcdpfjet.setHFMulti(hf_hm,hf_phm); - if (mIsMCarlo) { - GenJetCollection::const_iterator i_matched; - float rmin(999); - for(GenJetCollection::const_iterator i_gen = genjets->begin(); i_gen != genjets->end(); i_gen++) { - double deltaR = reco::deltaR(*i_pfjet,*i_gen); - if (deltaR < rmin) { - rmin = deltaR; - i_matched = i_gen; - } - } - if (genjets->size() == 0) { - LorentzVector tmpP4(0.0,0.0,0.0,0.0); - qcdpfjet.setGen(tmpP4,0); - } - else - qcdpfjet.setGen(i_matched->p4(),rmin); - } - else { - LorentzVector tmpP4(0.0,0.0,0.0,0.0); - qcdpfjet.setGen(tmpP4,0); - } - if (qcdpfjet.ptCor() >= mMinPFPt) - mPFJets.push_back(qcdpfjet); - if ( qcdpfjet.looseID()) - tmpPFJets.push_back(qcdpfjet); - } - //----------- CaloJets ----------------------- - for(CaloJetCollection::const_iterator i_calojet = calojets->begin(); i_calojet != calojets->end(); i_calojet++) { - int index = i_calojet-calojets->begin(); - edm::RefToBase calojetRef(edm::Ref(calojets,index)); - //double scale = mCALOJEC->correction(*i_calojet,event,iSetup); - //---- preselection ----------------- - if (fabs(i_calojet->y()) > mMaxY) continue; -/* double unc(0.0); - vector uncSrc(0); - if (mCaloPayloadName != "") { - mCALOUnc->setJetEta(i_calojet->eta()); - mCALOUnc->setJetPt(scale * i_calojet->pt()); - unc = mCALOUnc->getUncertainty(true); - }*/ - QCDCaloJet qcdcalojet; - qcdcalojet.setP4(i_calojet->p4()); - //qcdcalojet.setCor(scale); - //qcdcalojet.setUnc(unc); - //qcdcalojet.setUncSrc(uncSrc); - qcdcalojet.setArea(i_calojet->jetArea()); - double emf = i_calojet->emEnergyFraction(); - int n90hits = int((*calojetID)[calojetRef].n90Hits); - double fHPD = (*calojetID)[calojetRef].fHPD; - double fRBX = (*calojetID)[calojetRef].fRBX; - int nTrkVtx = JetExtendedAssociation::tracksAtVertexNumber(*calojetExtender,*i_calojet); - int nTrkCalo = JetExtendedAssociation::tracksAtCaloNumber(*calojetExtender,*i_calojet); - bool looseID = ((emf>0.01 || fabs(i_calojet->eta())>2.6) && (n90hits>1) && (fHPD<0.98)); - bool tightID = ((emf>0.01 || fabs(i_calojet->eta())>2.6) && (n90hits>1) && ((fHPD<0.98 && i_calojet->pt()<=25) || (fHPD<0.95 && i_calojet->pt()>25))); - qcdcalojet.setVar(emf,fHPD,fRBX,n90hits,nTrkCalo,nTrkVtx); - qcdcalojet.setLooseID(looseID); - qcdcalojet.setTightID(tightID); - if (mIsMCarlo) { - GenJetCollection::const_iterator i_matched; - float rmin(999); - for(GenJetCollection::const_iterator i_gen = genjets->begin(); i_gen != genjets->end(); i_gen++) { - double deltaR = reco::deltaR(*i_calojet,*i_gen); - if (deltaR < rmin) { - rmin = deltaR; - i_matched = i_gen; - } - } - if (genjets->size() == 0) { - LorentzVector tmpP4(0.0,0.0,0.0,0.0); - qcdcalojet.setGen(tmpP4,0); - } - else - qcdcalojet.setGen(i_matched->p4(),rmin); - } - else { - LorentzVector tmpP4(0.0,0.0,0.0,0.0); - qcdcalojet.setGen(tmpP4,0); - } - if (qcdcalojet.ptCor() >= mMinCaloPt) - mCaloJets.push_back(qcdcalojet); - } - - //---------------- met --------------------------------------------- - Handle pfmet; - Handle calomet; - event.getByLabel("pfMet",pfmet); - event.getByLabel("caloMet",calomet); - mPFMet.setVar((*pfmet)[0].et(),(*pfmet)[0].sumEt(),(*pfmet)[0].phi()); - mCaloMet.setVar((*calomet)[0].et(),(*calomet)[0].sumEt(),(*calomet)[0].phi()); - //-------------- fill the tree ------------------------------------- - sort(mCaloJets.begin(),mCaloJets.end(),sort_calojets); - sort(mPFJets.begin(),mPFJets.end(),sort_pfjets); - mEvent->setEvtHdr(mEvtHdr); - mEvent->setCaloJets(mCaloJets); - mEvent->setPFJets(mPFJets); - mEvent->setGenJets(mGenJets); - mEvent->setCaloMET(mCaloMet); - mEvent->setPFMET(mPFMet); - mEvent->setL1Obj(mL1Objects); - mEvent->setHLTObj(mHLTObjects); - if ((mEvent->nPFJets() >= (unsigned)mMinNPFJets) && (mEvent->nCaloJets() >= (unsigned)mMinNCaloJets)) { - if ((mEvent->pfmjjcor(0) >= mMinJJMass) || (mEvent->calomjjcor(0) >= mMinJJMass) ) { - mTree->Fill(); - } - } - //if (mPFPayloadName != "") { - //delete mPFUnc; - //delete mPFUncSrc; - //} - //if (mCaloPayloadName != "") - //delete mCALOUnc; -} -////////////////////////////////////////////////////////////////////////////////////////// -ProcessedTreeProducerPFCalo::~ProcessedTreeProducerPFCalo() -{ -} - -DEFINE_FWK_MODULE(ProcessedTreeProducerPFCalo); diff --git a/AnalysisFW/plugins/ProcessedTreeProducerPFCalo.h b/AnalysisFW/plugins/ProcessedTreeProducerPFCalo.h deleted file mode 100644 index f1566619326..00000000000 --- a/AnalysisFW/plugins/ProcessedTreeProducerPFCalo.h +++ /dev/null @@ -1,90 +0,0 @@ -#ifndef ProcessedTreeProducerPFCalo_h -#define ProcessedTreeProducerPFCalo_h - -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "HLTrigger/HLTcore/interface/HLTConfigProvider.h" -#include "DataFormats/Common/interface/TriggerResults.h" -#include "DataFormats/HLTReco/interface/TriggerEvent.h" -#include "JetMETCorrections/Objects/interface/JetCorrector.h" -#include "CondFormats/JetMETObjects/interface/JetCorrectionUncertainty.h" -#include "SMPJ/AnalysisFW/interface/QCDJet.h" -#include "SMPJ/AnalysisFW/interface/QCDEvent.h" -#include "SMPJ/AnalysisFW/interface/QCDEventHdr.h" -#include "SMPJ/AnalysisFW/interface/QCDPFJet.h" -#include "SMPJ/AnalysisFW/interface/QCDCaloJet.h" -#include "SMPJ/AnalysisFW/interface/QCDMET.h" -#include "FWCore/ServiceRegistry/interface/Service.h" -#include "CommonTools/UtilAlgos/interface/TFileService.h" - -using namespace edm; -using namespace reco; -using namespace std; -using namespace trigger; - -class ProcessedTreeProducerPFCalo : public edm::EDAnalyzer -{ - public: - typedef reco::Particle::LorentzVector LorentzVector; - explicit ProcessedTreeProducerPFCalo(edm::ParameterSet const& cfg); - virtual void beginJob(); - virtual void beginRun(edm::Run const &, edm::EventSetup const& iSetup); - virtual void analyze(edm::Event const& evt, edm::EventSetup const& iSetup); - virtual void endJob(); - virtual ~ProcessedTreeProducerPFCalo(); - private: - void buildTree(); - static bool sort_calojets(QCDCaloJet j1, QCDCaloJet j2) { - return j1.ptCor() > j2.ptCor(); - } - static bool sort_pfjets(QCDPFJet j1, QCDPFJet j2) { - return j1.ptCor() > j2.ptCor(); - } - //---- configurable parameters -------- - bool mIsMCarlo; - bool mUseGenInfo; - bool mPrintTriggerMenu; - bool isPFJecUncSet_,isCaloJecUncSet_; - int mGoodVtxNdof,mMinNCaloJets,mMinNPFJets; - double mGoodVtxZ; - double mMinCaloPt,mMinPFPt,mMinGenPt,mMaxY,mMinJJMass; - std::string mCaloJECservice; - std::string mPFJECservice; - std::string mPFPayloadName; - std::string mCaloPayloadName; - std::string mPFJECUncSrc; - std::vector mPFJECUncSrcNames; - edm::InputTag mCaloJetsName; - edm::InputTag mPFJetsName; - edm::InputTag mGenJetsName; - edm::InputTag mCaloJetID; - edm::InputTag mCaloJetExtender; - edm::InputTag mOfflineVertices; - edm::InputTag mSrcCaloRho; - edm::InputTag mSrcPFRho; - edm::InputTag mSrcPU; - //---- TRIGGER ------------------------- - std::string processName_; - std::vector triggerNames_; - std::vector triggerIndex_; - edm::InputTag triggerResultsTag_; - edm::InputTag triggerEventTag_; - edm::Handle triggerResultsHandle_; - edm::Handle triggerEventHandle_; - HLTConfigProvider hltConfig_; - //---- CORRECTORS ---------------------- - const JetCorrector *mPFJEC; - const JetCorrector *mCALOJEC; - JetCorrectionUncertainty *mCALOUnc; - JetCorrectionUncertainty *mPFUnc; - std::vector mPFUncSrc; - - edm::Service fs; - TTree *mTree; - TH1F *mTriggerPassHisto,*mTriggerNamesHisto; - //---- TREE variables -------- - QCDEvent *mEvent; -}; - -#endif diff --git a/AnalysisFW/plugins/ProcessedTreeProducer_miniAOD.cc b/AnalysisFW/plugins/ProcessedTreeProducer_miniAOD.cc deleted file mode 100644 index b307e552d77..00000000000 --- a/AnalysisFW/plugins/ProcessedTreeProducer_miniAOD.cc +++ /dev/null @@ -1,810 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include "TTree.h" -#include -#include -#include - -#include "SMPJ/AnalysisFW/plugins/ProcessedTreeProducer_miniAOD.h" -#include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/Framework/interface/ESHandle.h" -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/MakerMacros.h" -#include "FWCore/Common/interface/TriggerNames.h" -#include "FWCore/Common/interface/TriggerResultsByName.h" - -#include "DataFormats/VertexReco/interface/Vertex.h" -#include "DataFormats/VertexReco/interface/VertexFwd.h" -#include "DataFormats/Common/interface/Handle.h" -#include "DataFormats/Math/interface/deltaR.h" -#include "DataFormats/JetReco/interface/Jet.h" -#include "DataFormats/JetReco/interface/PFJet.h" -#include "DataFormats/JetReco/interface/PFJetCollection.h" -#include "DataFormats/JetReco/interface/CaloJet.h" -#include "DataFormats/JetReco/interface/CaloJetCollection.h" -#include "DataFormats/JetReco/interface/GenJet.h" -#include "DataFormats/JetReco/interface/GenJetCollection.h" -#include "DataFormats/JetReco/interface/JetExtendedAssociation.h" -#include "DataFormats/JetReco/interface/JetID.h" -#include "DataFormats/METReco/interface/PFMET.h" -#include "DataFormats/METReco/interface/PFMETCollection.h" -#include "DataFormats/METReco/interface/CaloMET.h" -#include "DataFormats/METReco/interface/CaloMETCollection.h" -#include "DataFormats/METReco/interface/HcalNoiseSummary.h" -#include "DataFormats/BeamSpot/interface/BeamSpot.h" -#include "DataFormats/TrackReco/interface/TrackFwd.h" - -#include "DataFormats/L1Trigger/interface/L1JetParticle.h" - -#include "DataFormats/PatCandidates/interface/MET.h" -#include "DataFormats/PatCandidates/interface/PackedCandidate.h" -#include "DataFormats/PatCandidates/interface/TriggerObjectStandAlone.h" -#include "DataFormats/PatCandidates/interface/PackedTriggerPrescales.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -#include "SimDataFormats/GeneratorProducts/interface/GenEventInfoProduct.h" -#include "SimDataFormats/PileupSummaryInfo/interface/PileupSummaryInfo.h" - -#include "CondFormats/JetMETObjects/interface/JetCorrectorParameters.h" -#include "JetMETCorrections/Objects/interface/JetCorrectionsRecord.h" - -ProcessedTreeProducer_miniAOD::ProcessedTreeProducer_miniAOD(edm::ParameterSet const& cfg)//: - //triggerBits_(consumes(cfg.getParameter("bits"))), - //triggerObjects_(consumes(cfg.getParameter("objects"))), - //triggerPrescales_(consumes(cfg.getParameter("prescales"))) - { -// mPFJECservice = cfg.getParameter ("pfjecService"); -// mCaloJECservice = cfg.getParameter ("calojecService"); - - - - mPFPayloadName = cfg.getParameter ("PFPayloadName"); - mPFPayloadNameCHS = cfg.getParameter ("PFPayloadNameCHS"); - mCaloPayloadName = cfg.getParameter ("CaloPayloadName"); - mGoodVtxNdof = cfg.getParameter ("goodVtxNdof"); - mGoodVtxZ = cfg.getParameter ("goodVtxZ"); - mMinPFPt = cfg.getParameter ("minPFPt"); - mMinPFFatPt = cfg.getParameter ("minPFFatPt"); - mMaxPFFatEta = cfg.getParameter ("maxPFFatEta"); - mMinJJMass = cfg.getParameter ("minJJMass"); - mMaxY = cfg.getParameter ("maxY"); - mMinNPFJets = cfg.getParameter ("minNPFJets"); - mOfflineVertices = cfg.getParameter ("offlineVertices"); - mPFJetsName = cfg.getParameter ("pfjets"); - mPFJetsNameCHS = cfg.getParameter ("pfjetschs"); - mSrcCaloRho = cfg.getParameter ("srcCaloRho"); - mSrcPFRho = cfg.getParameter ("srcPFRho"); - //mPFMET = cfg.getParameter ("pfmet"); - mPFMET =(consumes(cfg.getParameter("pfmet"))); - mSrcPU = cfg.getUntrackedParameter ("srcPU",edm::InputTag("addPileupInfo")); - mGenJetsName = cfg.getUntrackedParameter ("genjets",edm::InputTag("")); - mPrintTriggerMenu = cfg.getUntrackedParameter ("printTriggerMenu",false); - mIsMCarlo = cfg.getUntrackedParameter ("isMCarlo",false); - mUseGenInfo = cfg.getUntrackedParameter ("useGenInfo",false); - mMinGenPt = cfg.getUntrackedParameter ("minGenPt",30); - processName_ = cfg.getParameter ("processName"); - triggerNames_ = cfg.getParameter > ("triggerName"); - triggerResultsTag_ = cfg.getParameter ("triggerResults"); - triggerEventTag_ = cfg.getParameter ("triggerEvent"); - mPFJECUncSrc = cfg.getParameter ("jecUncSrc"); - mPFJECUncSrcCHS = cfg.getParameter ("jecUncSrcCHS"); - mPFJECUncSrcNames = cfg.getParameter > ("jecUncSrcNames"); - - cenJetLabel_ = cfg.getParameter ("cenJetLabel"); - forwJetLabel_ = cfg.getParameter ("forwJetLabel"); - - triggerBits_ = cfg.getParameter("triggerResults"); - triggerObjects_ = cfg.getParameter > ("triggerObjects"); - -} -////////////////////////////////////////////////////////////////////////////////////////// -void ProcessedTreeProducer_miniAOD::beginJob() -{ - mTree = fs->make("ProcessedTree","ProcessedTree"); - mEvent = new QCDEvent(); - mTree->Branch("events","QCDEvent",&mEvent); - mTriggerNamesHisto = fs->make("TriggerNames","TriggerNames",1,0,1); - mTriggerNamesHisto->SetBit(TH1::kCanRebin); - - //for(unsigned i=0;iFill(triggerNames_[i].c_str(),1); - mTriggerPassHisto = fs->make("TriggerPass","TriggerPass",1,0,1); - mTriggerPassHisto->SetBit(TH1::kCanRebin); - isPFJecUncSet_ = false; - isPFJecUncSetCHS_ = false; - isCaloJecUncSet_ = false; -} -////////////////////////////////////////////////////////////////////////////////////////// -void ProcessedTreeProducer_miniAOD::endJob() -{ - -} -////////////////////////////////////////////////////////////////////////////////////////// -void ProcessedTreeProducer_miniAOD::beginRun(edm::Run const & iRun, edm::EventSetup const& iSetup) -{ - bool changed(true); - if (hltConfig_.init(iRun,iSetup,processName_,changed)) { - if (changed) { - // check if trigger names in (new) config - cout<<"New trigger menu found !!!"<= n) - cout<<"does not exist in the current menu"< mPFJets; - vector mPFJetsCHS; - vector mGenJets; - QCDEventHdr mEvtHdr; - QCDMET mCaloMet,mPFMet; - - //-------------- Basic Event Info ------------------------------ - mEvtHdr.setRun(event.id().run()); - mEvtHdr.setEvt(event.id().event()); - mEvtHdr.setLumi(event.luminosityBlock()); - mEvtHdr.setBunch(event.bunchCrossing()); - //-------------- Beam Spot -------------------------------------- - Handle beamSpot; - event.getByLabel("offlineBeamSpot", beamSpot); - if (beamSpot.isValid()) - mEvtHdr.setBS(beamSpot->x0(),beamSpot->y0(),beamSpot->z0()); - else - mEvtHdr.setBS(-999,-999,-999); - - //-------------- HCAL Noise Summary ----------------------------- - Handle noiseSummary; - /* if (!mIsMCarlo) { - // event.getByLabel(mHBHENoiseFilter,noiseSummary); - event.getByLabel(edm::InputTag("HBHENoiseFilterResultProducer","HBHENoiseFilterResult"), noiseSummary); - mEvtHdr.setHCALNoise(*noiseSummary); - } - else */ - mEvtHdr.setHCALNoise(true); - - //-------------- Trigger Info ----------------------------------- - edm::Handle triggerBits; - edm::Handle triggerObjects; - edm::Handle triggerPrescales; - - event.getByLabel(triggerBits_, triggerBits); - event.getByLabel("selectedPatTrigger", triggerObjects); - event.getByLabel("patTrigger", triggerPrescales); - - - //Variables - vector L1Prescales,HLTPrescales,Fired; - vector > mL1Objects,mHLTObjects; - vector vvL1,vvHLT; - - const edm::TriggerNames &names = event.triggerNames(*triggerBits); - //std::cout << "\n === TRIGGER PATHS === " << std::endl; - for (unsigned int i = 0, n = triggerBits->size(); i < n; ++i) { - //std::cout << "Trigger " << names.triggerName(i) << - // ", prescale " << triggerPrescales->getPrescaleForIndex(i) << - // ": " << (triggerBits->accept(i) ? "PASS" : "fail (or not run)") - // << std::endl; - - L1Prescales.push_back(triggerPrescales->getPrescaleForIndex(i)); - HLTPrescales.push_back(triggerPrescales->getPrescaleForIndex(i)); - - //if(names.triggerName(i)=="HLT_PFJet260_v1"){ - if(triggerBits->accept(i)) Fired.push_back(1); - if(!triggerBits->accept(i)) Fired.push_back(0); - //} - - mTriggerNamesHisto->Fill(names.triggerName(i).c_str(),1); - - if(triggerBits->accept(i)) mTriggerPassHisto->Fill(names.triggerName(i).c_str(),1); - - } - - //std::cout << "\n === TRIGGER OBJECTS === " << std::endl; - for (pat::TriggerObjectStandAlone obj : *triggerObjects) { // note: not "const &" since we want to call unpackPathNames - - obj.unpackPathNames(names); - - //if(obj.hasPathName("HLT_PFJet260_v1", true, true )){ - - std::cout << "\t Collection: " << obj.collection() << std::endl; - std::cout << "\t Type IDs: "; - for (unsigned h = 0; h < obj.filterIds().size(); ++h) std::cout << " " << obj.filterIds()[h] ; - std::cout << std::endl; - for (unsigned h = 0; h < obj.filterLabels().size(); ++h) std::cout << " " << obj.filterLabels()[h]; - - for(size_t i=0;i pathNamesAll = obj.pathNames(false); - std::vector pathNamesLast = obj.pathNames(true); - - //} - // Print trigger object collection and type - - //std::cout << "\t Collection: " << obj.collection() << std::endl; - //std::cout << "\t Type IDs: "; - //for (unsigned h = 0; h < obj.filterIds().size(); ++h) std::cout << " " << obj.filterIds()[h] ; - //std::cout << std::endl; - // Print associated trigger filters - //std::cout << "\t Filters: "; - //for (unsigned h = 0; h < obj.filterLabels().size(); ++h) std::cout << " " << obj.filterLabels()[h]; - //std::cout << std::endl; - //std::vector pathNamesAll = obj.pathNames(false); - //std::vector pathNamesLast = obj.pathNames(true); - // Print all trigger paths, for each one record also if the object is associated to a 'l3' filter (always true for the - // definition used in the PAT trigger producer) and if it's associated to the last filter of a successfull path (which - // means that this object did cause this trigger to succeed; however, it doesn't work on some multi-object triggers) - //std::cout << "\t Paths (" << pathNamesAll.size()<<"/"< L1jetparticleCentral; - vector L1jetparticleForward; - - edm::Handle > L1JetCollectionCentral; - event.getByLabel(cenJetLabel_,L1JetCollectionCentral); - - edm::Handle > L1JetCollectionForward; - event.getByLabel(forwJetLabel_,L1JetCollectionForward); - - for(edm::View::const_iterator l1jetpart=L1JetCollectionCentral->begin(); l1jetpart!=L1JetCollectionCentral->end(); ++l1jetpart) - { - L1jetparticleCentral.push_back(l1jetpart->p4()); - mL1Objects.push_back(L1jetparticleCentral); - } - - for(edm::View::const_iterator l1jetpart=L1JetCollectionForward->begin(); l1jetpart!=L1JetCollectionForward->end(); ++l1jetpart) - { - L1jetparticleForward.push_back(l1jetpart->p4()); - mL1Objects.push_back(L1jetparticleForward); - } - - //loop over trigger names - mEvent->setTrigDecision(Fired); - mEvent->setPrescales(L1Prescales,HLTPrescales); - mEvent->setL1Obj(mL1Objects); - mEvent->setHLTObj(mHLTObjects); - - /*event.getByLabel(triggerResultsTag_,triggerResultsHandle_); - if (!triggerResultsHandle_.isValid()) { - cout << "ProcessedTreeProducer_miniAOD::analyze: Error in getting TriggerResults product from Event!" << endl; - //return; - } - event.getByLabel(triggerEventTag_,triggerEventHandle_); - if (!triggerEventHandle_.isValid()) { - cout << "ProcessedTreeProducer_miniAOD::analyze: Error in getting TriggerEvent product from Event!" << endl; - //return; - } - vector L1Prescales,HLTPrescales,Fired; - vector > mL1Objects,mHLTObjects; - // sanity check - assert(triggerResultsHandle_->size() == hltConfig_.size()); - //------ loop over all trigger names --------- - for(unsigned itrig=0;itrig vvL1,vvHLT; - if (triggerIndex_[itrig] < hltConfig_.size()) { - accept = triggerResultsHandle_->accept(triggerIndex_[itrig]); - const std::pair prescales(hltConfig_.prescaleValues(event,iSetup,triggerNames_[itrig])); - preL1 = prescales.first; - preHLT = prescales.second; - if (!accept) - tmpFired = 0; - else { - mTriggerPassHisto->Fill(triggerNames_[itrig].c_str(),1); - tmpFired = 1; - } - //--------- modules on this trigger path-------------- - const vector& moduleLabels(hltConfig_.moduleLabels(triggerIndex_[itrig])); - const unsigned int moduleIndex(triggerResultsHandle_->index(triggerIndex_[itrig])); - bool foundL1(false); - for(unsigned int j=0; j<=moduleIndex; ++j) { - const string& moduleLabel(moduleLabels[j]); - const string moduleType(hltConfig_.moduleType(moduleLabel)); - //--------check whether the module is packed up in TriggerEvent product - const unsigned int filterIndex(triggerEventHandle_->filterIndex(InputTag(moduleLabel,"",processName_))); - if (filterIndexsizeFilters()) { - const Vids& VIDS (triggerEventHandle_->filterIds(filterIndex)); - const Keys& KEYS(triggerEventHandle_->filterKeys(filterIndex)); - const size_type nI(VIDS.size()); - const size_type nK(KEYS.size()); - assert(nI==nK); - const size_type n(max(nI,nK)); - const TriggerObjectCollection& TOC(triggerEventHandle_->getObjects()); - if (foundL1) { - for(size_type i=0; i!=n; ++i) { - const TriggerObject& TO(TOC[KEYS[i]]); - TLorentzVector P4; - P4.SetPtEtaPhiM(TO.pt(),TO.eta(),TO.phi(),TO.mass()); - LorentzVector qcdhltobj(P4.Px(),P4.Py(),P4.Pz(),P4.E()); - vvHLT.push_back(qcdhltobj); - //cout<setTrigDecision(Fired); - mEvent->setPrescales(L1Prescales,HLTPrescales); - mEvent->setL1Obj(mL1Objects); - mEvent->setHLTObj(mHLTObjects);*/ - - //-------------- Vertex Info ----------------------------------- - Handle recVtxs; - event.getByLabel(mOfflineVertices,recVtxs); - //------------- reject events without reco vertices ------------ - int VtxGood(0); - bool isPVgood(false); - float PVx(0),PVy(0),PVz(0),PVndof(0); - for(VertexCollection::const_iterator i_vtx = recVtxs->begin(); i_vtx != recVtxs->end(); i_vtx++) { - int index = i_vtx-recVtxs->begin(); - if (index == 0) { - PVx = i_vtx->x(); - PVy = i_vtx->y(); - PVz = i_vtx->z(); - PVndof = i_vtx->ndof(); - } - if (!(i_vtx->isFake()) && i_vtx->ndof() >= mGoodVtxNdof && fabs(i_vtx->z()) <= mGoodVtxZ) { - if (index == 0) { - isPVgood = true; - } - VtxGood++; - } - } - mEvtHdr.setVertices(recVtxs->size(),VtxGood); - mEvtHdr.setPV(isPVgood,PVndof,PVx,PVy,PVz); - //-------------- Rho ------------------------------------------------ - Handle rhoCalo; - event.getByLabel(mSrcCaloRho,rhoCalo); - Handle rhoPF; - event.getByLabel(mSrcPFRho,rhoPF); - mEvtHdr.setRho(*rhoCalo,*rhoPF); - //-------------- Generator Info ------------------------------------- - Handle hEventInfo; - //-------------- Simulated PU Info ---------------------------------- - Handle > PupInfo; - if (mIsMCarlo && mUseGenInfo) { - event.getByLabel("generator", hEventInfo); - if(hEventInfo->hasBinningValues()) - mEvtHdr.setPthat(hEventInfo->binningValues()[0]); - else - mEvtHdr.setPthat(0); - - mEvtHdr.setWeight(hEventInfo->weight()); - event.getByLabel(mSrcPU, PupInfo); - std::vector::const_iterator PUI; - int nbx = PupInfo->size(); - int ootpuEarly(0),ootpuLate(0),intpu(0); - float Tnpv = -1.; // new variable for computing pileup weight factor for the event - - for(PUI = PupInfo->begin(); PUI != PupInfo->end(); ++PUI) { - if (PUI->getBunchCrossing() < 0) - ootpuEarly += PUI->getPU_NumInteractions(); - else if (PUI->getBunchCrossing() > 0) - ootpuLate += PUI->getPU_NumInteractions(); - else { - intpu += PUI->getPU_NumInteractions(); - Tnpv = PUI->getTrueNumInteractions(); - } - } - - mEvtHdr.setPU(nbx,ootpuEarly,ootpuLate,intpu); - mEvtHdr.setTrPu(Tnpv); - } - else { - mEvtHdr.setPthat(0); - mEvtHdr.setWeight(0); - mEvtHdr.setPU(0,0,0,0); - mEvtHdr.setTrPu(0); - } - - - //---------------- Jets --------------------------------------------- - //mPFJEC = JetCorrector::getJetCorrector(mPFJECservice,iSetup); - //mCALOJEC = JetCorrector::getJetCorrector(mCaloJECservice,iSetup); - - edm::ESHandle PFJetCorParColl; - if (mPFPayloadName != "" && !isPFJecUncSet_){ - iSetup.get().get(mPFPayloadName,PFJetCorParColl); - JetCorrectorParameters const& PFJetCorPar = (*PFJetCorParColl)["Uncertainty"]; - mPFUnc = new JetCorrectionUncertainty(PFJetCorPar); - if (mPFJECUncSrc != "") { - for(unsigned isrc=0;isrc genjets; - if (mIsMCarlo) { - event.getByLabel(mGenJetsName,genjets); - for(GenJetCollection::const_iterator i_gen = genjets->begin(); i_gen != genjets->end(); i_gen++) { - if (i_gen->pt() > mMinGenPt && fabs(i_gen->y()) < mMaxY) { - mGenJets.push_back(i_gen->p4()); - } - } - } - - //----------- PFJets non CHS part ------------------------- - - edm::Handle > patjets; - event.getByLabel(mPFJetsName,patjets); - - - for(edm::View::const_iterator i_pfjet=patjets->begin(); i_pfjet!=patjets->end(); ++i_pfjet) - { - QCDPFJet qcdpfjet; - - if(i_pfjet->isPFJet() ){ - - double scale = 1./i_pfjet->jecFactor(0); // --- the value of the JEC factor - - //---- preselection ----------------- - if (fabs(i_pfjet->y()) > mMaxY) continue; - - //---- vertex association ----------- - //---- get the vector of tracks ----- - reco::TrackRefVector vTrks(i_pfjet->associatedTracks()); - float sumTrkPt(0.0),sumTrkPtBeta(0.0),sumTrkPtBetaStar(0.0),beta(0.0),betaStar(0.0); - //---- loop over the tracks of the jet ---- - for(reco::TrackRefVector::const_iterator i_trk = vTrks.begin(); i_trk != vTrks.end(); i_trk++) { - if (recVtxs->size() == 0) break; - sumTrkPt += (*i_trk)->pt(); - //---- loop over all vertices ---------------------------- - for(unsigned ivtx = 0;ivtx < recVtxs->size();ivtx++) { - //---- loop over the tracks associated with the vertex --- - if (!((*recVtxs)[ivtx].isFake()) && (*recVtxs)[ivtx].ndof() >= mGoodVtxNdof && fabs((*recVtxs)[ivtx].z()) <= mGoodVtxZ) { - for(reco::Vertex::trackRef_iterator i_vtxTrk = (*recVtxs)[ivtx].tracks_begin(); i_vtxTrk != (*recVtxs)[ivtx].tracks_end(); ++i_vtxTrk) { - //---- match the jet track to the track from the vertex ---- - reco::TrackRef trkRef(i_vtxTrk->castTo()); - //---- check if the tracks match ------------------------- - if (trkRef == (*i_trk)) { - if (ivtx == 0) { - sumTrkPtBeta += (*i_trk)->pt(); - } - else { - sumTrkPtBetaStar += (*i_trk)->pt(); - } - break; - } // if (trkRef == (*i_trk)) - } // for(reco::Vertex::trackRef_iterator i_vtxTrk = (*recVtxs)[ivtx].tracks_begin(); i_vtxTrk != (*recVtxs)[ivtx].tracks_end(); ++i_vtxTrk) - } // if (!((*recVtxs)[ivtx].isFake()) && (*recVtxs)[ivtx].ndof() >= mGoodVtxNdof && fabs((*recVtxs)[ivtx].z()) <= mGoodVtxZ) - } // for(unsigned ivtx = 0;ivtx < recVtxs->size();ivtx++) - } // for(reco::TrackRefVector::const_iterator i_trk = vTrks.begin(); i_trk != vTrks.end(); i_trk++) - if (sumTrkPt > 0) { - beta = sumTrkPtBeta/sumTrkPt; - betaStar = sumTrkPtBetaStar/sumTrkPt; - } //if (sumTrkPt > 0) - qcdpfjet.setBeta(beta); - qcdpfjet.setBetaStar(betaStar); - - //---- jec uncertainty -------------- - double unc(0.0); - vector uncSrc(0); - if (mPFPayloadName != "") { - mPFUnc->setJetEta(i_pfjet->eta()); - mPFUnc->setJetPt(i_pfjet->pt()); - unc = mPFUnc->getUncertainty(true); - } // if (mPFPayloadName != "") - if (mPFJECUncSrc != "") { - for(unsigned isrc=0;isrcsetJetEta(i_pfjet->eta()); - mPFUncSrc[isrc]->setJetPt(i_pfjet->pt()); - float unc1 = mPFUncSrc[isrc]->getUncertainty(true); - uncSrc.push_back(unc1); - } // for(unsigned isrc=0;isrcp4()); - qcdpfjet.setCor(scale); - qcdpfjet.setUnc(unc); - qcdpfjet.setUncSrc(uncSrc); - qcdpfjet.setArea(i_pfjet->jetArea()); - - double chf = i_pfjet->chargedHadronEnergyFraction(); - double nhf = i_pfjet->neutralHadronEnergyFraction() + i_pfjet->HFHadronEnergyFraction(); -// double nhf = i_pfjet->neutralHadronEnergyFraction(); - double phf = i_pfjet->photonEnergyFraction(); - double elf = i_pfjet->electronEnergyFraction(); - double muf = i_pfjet->muonEnergyFraction(); - double hf_hf = i_pfjet->HFHadronEnergyFraction(); - double hf_phf= i_pfjet->HFEMEnergyFraction(); - int hf_hm = i_pfjet->HFHadronMultiplicity(); - int hf_phm = i_pfjet->HFEMMultiplicity(); - int chm = i_pfjet->chargedHadronMultiplicity(); - int nhm = i_pfjet->neutralHadronMultiplicity(); - int phm = i_pfjet->photonMultiplicity(); - int elm = i_pfjet->electronMultiplicity(); - int mum = i_pfjet->muonMultiplicity(); - int npr = i_pfjet->chargedMultiplicity() + i_pfjet->neutralMultiplicity(); - bool looseID = (npr>1 && phf<0.99 && nhf<0.99 && ((fabs(i_pfjet->eta())<=2.4 && elf<0.99 && chf>0 && chm>0) || fabs(i_pfjet->eta())>2.4)); - bool tightID = (npr>1 && phf<0.99 && nhf<0.99 && ((fabs(i_pfjet->eta())<=2.4 && nhf<0.9 && phf<0.9 && elf<0.99 && chf>0 && chm>0) || fabs(i_pfjet->eta())>2.4)); - qcdpfjet.setLooseID(looseID); - qcdpfjet.setTightID(tightID); - qcdpfjet.setFrac(chf,nhf,phf,elf,muf); - qcdpfjet.setMulti(npr,chm,nhm,phm,elm,mum); - qcdpfjet.setHFFrac(hf_hf,hf_phf); - qcdpfjet.setHFMulti(hf_hm,hf_phm); - - if (mIsMCarlo) { - GenJetCollection::const_iterator i_matched; - float rmin(999); - for(GenJetCollection::const_iterator i_gen = genjets->begin(); i_gen != genjets->end(); i_gen++) { - double deltaR = reco::deltaR(*i_pfjet,*i_gen); - if (deltaR < rmin) { - rmin = deltaR; - i_matched = i_gen; - } - } - if (genjets->size() == 0) { - LorentzVector tmpP4(0.0,0.0,0.0,0.0); - qcdpfjet.setGen(tmpP4,0); - } - else - qcdpfjet.setGen(i_matched->p4(),rmin); - } // if (mIsMCarlo) - else { - LorentzVector tmpP4(0.0,0.0,0.0,0.0); - qcdpfjet.setGen(tmpP4,0); - } - if (qcdpfjet.pt() >= mMinPFPt) - mPFJets.push_back(qcdpfjet); - - } // if(iJet->isPFJet() ) - } // --- end of non chs patjet iterator loop -------------------- // - -// ========================******************************************===================== // - - // -------- CHS Uncertainty part ----------------// - edm::ESHandle PFJetCorParCollCHS; - if (mPFPayloadNameCHS != "" && !isPFJecUncSetCHS_){ - iSetup.get().get(mPFPayloadNameCHS,PFJetCorParCollCHS); - JetCorrectorParameters const& PFJetCorParCHS = (*PFJetCorParCollCHS)["Uncertainty"]; - mPFUncCHS = new JetCorrectionUncertainty(PFJetCorParCHS); - if (mPFJECUncSrcCHS != "") { - for(unsigned isrc=0;isrc > patjetschs; - event.getByLabel(mPFJetsNameCHS,patjetschs); - - for(edm::View::const_iterator i_pfjetchs=patjetschs->begin(); i_pfjetchs!=patjetschs->end(); ++i_pfjetchs) - { - QCDPFJet qcdpfjetchs; - - if(i_pfjetchs->isPFJet() ){ - - double scaleCHS = 1./i_pfjetchs->jecFactor(0); // --- the value of the JEC factor - - //---- preselection ----------------- - if (fabs(i_pfjetchs->y()) > mMaxY) continue; - - //---- vertex association ----------- - //---- get the vector of tracks ----- - reco::TrackRefVector vTrksCHS(i_pfjetchs->associatedTracks()); - float sumTrkPtCHS(0.0),sumTrkPtBetaCHS(0.0),sumTrkPtBetaStarCHS(0.0),betaCHS(0.0),betaStarCHS(0.0); - //---- loop over the tracks of the jet ---- - for(reco::TrackRefVector::const_iterator i_trkchs = vTrksCHS.begin(); i_trkchs != vTrksCHS.end(); i_trkchs++) { - if (recVtxs->size() == 0) break; - sumTrkPtCHS += (*i_trkchs)->pt(); - //---- loop over all vertices ---------------------------- - for(unsigned ivtx = 0;ivtx < recVtxs->size();ivtx++) { - //---- loop over the tracks associated with the vertex --- - if (!((*recVtxs)[ivtx].isFake()) && (*recVtxs)[ivtx].ndof() >= mGoodVtxNdof && fabs((*recVtxs)[ivtx].z()) <= mGoodVtxZ) { - for(reco::Vertex::trackRef_iterator i_vtxTrk = (*recVtxs)[ivtx].tracks_begin(); i_vtxTrk != (*recVtxs)[ivtx].tracks_end(); ++i_vtxTrk) { - //---- match the chsjet track to the track from the vertex ---- - reco::TrackRef trkRef(i_vtxTrk->castTo()); - //---- check if the tracks match ------------------------- - if (trkRef == (*i_trkchs)) { - if (ivtx == 0) { - sumTrkPtBetaCHS += (*i_trkchs)->pt(); - } - else { - sumTrkPtBetaStarCHS += (*i_trkchs)->pt(); - } - break; - } // if (trkRef == (*i_trk)) - } // for(reco::Vertex::trackRef_iterator i_vtxTrk = (*recVtxs)[ivtx].tracks_begin(); i_vtxTrk != (*recVtxs)[ivtx].tracks_end(); ++i_vtxTrk) - } // if (!((*recVtxs)[ivtx].isFake()) && (*recVtxs)[ivtx].ndof() >= mGoodVtxNdof && fabs((*recVtxs)[ivtx].z()) <= mGoodVtxZ) - } // for(unsigned ivtx = 0;ivtx < recVtxs->size();ivtx++) - } // for(reco::TrackRefVector::const_iterator i_trk = vTrks.begin(); i_trk != vTrks.end(); i_trk++) - if (sumTrkPtCHS > 0) { - betaCHS = sumTrkPtBetaCHS/sumTrkPtCHS; - betaStarCHS = sumTrkPtBetaStarCHS/sumTrkPtCHS; - } //if (sumTrkPt > 0) - qcdpfjetchs.setBeta(betaCHS); - qcdpfjetchs.setBetaStar(betaStarCHS); - - //---- jec uncertainty -------------- - double uncCHS(0.0); - vector uncSrcCHS(0); - if (mPFPayloadNameCHS != "") { - mPFUncCHS->setJetEta(i_pfjetchs->eta()); - mPFUncCHS->setJetPt(i_pfjetchs->pt()); - uncCHS = mPFUncCHS->getUncertainty(true); - } // if (mPFPayloadName != "") - if (mPFJECUncSrcCHS != "") { - for(unsigned isrc=0;isrcsetJetEta(i_pfjetchs->eta()); - mPFUncSrcCHS[isrc]->setJetPt(i_pfjetchs->pt()); - float unc1 = mPFUncSrcCHS[isrc]->getUncertainty(true); - uncSrcCHS.push_back(unc1); - } // for(unsigned isrc=0;isrcp4()); - qcdpfjetchs.setCor(scaleCHS); - qcdpfjetchs.setUnc(uncCHS); - qcdpfjetchs.setUncSrc(uncSrcCHS); - qcdpfjetchs.setArea(i_pfjetchs->jetArea()); - - double chf = i_pfjetchs->chargedHadronEnergyFraction(); - double nhf = i_pfjetchs->neutralHadronEnergyFraction() + i_pfjetchs->HFHadronEnergyFraction(); -// double nhf = i_pfjetchs->neutralHadronEnergyFraction(); - double phf = i_pfjetchs->photonEnergyFraction(); - double elf = i_pfjetchs->electronEnergyFraction(); - double muf = i_pfjetchs->muonEnergyFraction(); - double hf_hf = i_pfjetchs->HFHadronEnergyFraction(); - double hf_phf= i_pfjetchs->HFEMEnergyFraction(); - int hf_hm = i_pfjetchs->HFHadronMultiplicity(); - int hf_phm = i_pfjetchs->HFEMMultiplicity(); - int chm = i_pfjetchs->chargedHadronMultiplicity(); - int nhm = i_pfjetchs->neutralHadronMultiplicity(); - int phm = i_pfjetchs->photonMultiplicity(); - int elm = i_pfjetchs->electronMultiplicity(); - int mum = i_pfjetchs->muonMultiplicity(); - int npr = i_pfjetchs->chargedMultiplicity() + i_pfjetchs->neutralMultiplicity(); - bool looseID = (npr>1 && phf<0.99 && nhf<0.99 && ((fabs(i_pfjetchs->eta())<=2.4 && elf<0.99 && chf>0 && chm>0) || fabs(i_pfjetchs->eta())>2.4)); - bool tightID = (npr>1 && phf<0.99 && nhf<0.99 && ((fabs(i_pfjetchs->eta())<=2.4 && nhf<0.9 && phf<0.9 && elf<0.99 && chf>0 && chm>0) || fabs(i_pfjetchs->eta())>2.4)); - qcdpfjetchs.setLooseID(looseID); - qcdpfjetchs.setTightID(tightID); - qcdpfjetchs.setFrac(chf,nhf,phf,elf,muf); - qcdpfjetchs.setMulti(npr,chm,nhm,phm,elm,mum); - qcdpfjetchs.setHFFrac(hf_hf,hf_phf); - qcdpfjetchs.setHFMulti(hf_hm,hf_phm); - - if (mIsMCarlo) { - GenJetCollection::const_iterator i_matchedchs; - float rmin(999); - for(GenJetCollection::const_iterator i_gen = genjets->begin(); i_gen != genjets->end(); i_gen++) { - double deltaR = reco::deltaR(*i_pfjetchs,*i_gen); - if (deltaR < rmin) { - rmin = deltaR; - i_matchedchs = i_gen; - } - } - if (genjets->size() == 0) { - LorentzVector tmpP4(0.0,0.0,0.0,0.0); - qcdpfjetchs.setGen(tmpP4,0); - } - else - qcdpfjetchs.setGen(i_matchedchs->p4(),rmin); - } // if (mIsMCarlo) - else { - LorentzVector tmpP4(0.0,0.0,0.0,0.0); - qcdpfjetchs.setGen(tmpP4,0); - } - if (qcdpfjetchs.pt() >= mMinPFPt) - mPFJetsCHS.push_back(qcdpfjetchs); - - - } // if(i_pfjetchs->isPFJet() ) - } // for(edm::View::const_iterator i_pfjetchs=patjetschs->begin(); i_pfjetchs!=patjetschs->end(); ++i_pfjetchs) - - - //---------------- met --------------------------------------------- - - //edm::EDGetTokenT metToken_; - // metToken_(consumes(iConfig.getParameter("mets"))) - Handle pfmet; - event.getByToken(mPFMET, pfmet); - const pat::MET &met = pfmet->front(); - //printf("MET: pt %5.1f, phi %+4.2f, sumEt (%.1f). genMET %.1f. MET with JES up/down: %.1f/%.1f\n", - //met.pt(), met.phi(), met.sumEt(), - //met.genMET()->pt(), - //met.shiftedPt(pat::MET::JetEnUp), met.shiftedPt(pat::MET::JetEnDown)); - //Handle pfmet; - //event.getByLabel(mPFMET,pfmet); - - mPFMet.setVar(met.et(),met.sumEt(),met.phi()); - //-------------- fill the tree ------------------------------------- - sort(mPFJets.begin(),mPFJets.end(),sort_pfjets); - mEvent->setEvtHdr(mEvtHdr); - mEvent->setPFJets(mPFJets); - mEvent->setPFJetsCHS(mPFJetsCHS); // -- later substitute chs jets - mEvent->setGenJets(mGenJets); - mEvent->setPFMET(mPFMet); -// mEvent->setL1Obj(mL1Objects); -// mEvent->setHLTObj(mHLTObjects); - if ((mEvent->nPFJetsCHS() >= (unsigned)mMinNPFJets) ) { - if ((mEvent->pfmjjcor(0) >= mMinJJMass) ) { - // cout<<"Feeling tree ----"<Fill(); - } - } - //if (mPFPayloadName != "") { - //delete mPFUnc; - //delete mPFUncSrc; - //} - //if (mCaloPayloadName != "") - //delete mCALOUnc; - - - -} -////////////////////////////////////////////////////////////////////////////////////////// -ProcessedTreeProducer_miniAOD::~ProcessedTreeProducer_miniAOD() -{ -} - -DEFINE_FWK_MODULE(ProcessedTreeProducer_miniAOD); diff --git a/AnalysisFW/plugins/ProcessedTreeProducer_miniAOD.h b/AnalysisFW/plugins/ProcessedTreeProducer_miniAOD.h deleted file mode 100644 index 6008e588867..00000000000 --- a/AnalysisFW/plugins/ProcessedTreeProducer_miniAOD.h +++ /dev/null @@ -1,140 +0,0 @@ -#ifndef ProcessedTreeProducer_miniAOD_h -#define ProcessedTreeProducer_miniAOD_h - -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "HLTrigger/HLTcore/interface/HLTConfigProvider.h" -#include "DataFormats/Common/interface/TriggerResults.h" -#include "DataFormats/HLTReco/interface/TriggerEvent.h" -#include "JetMETCorrections/Objects/interface/JetCorrector.h" -#include "CondFormats/JetMETObjects/interface/JetCorrectionUncertainty.h" -#include "DataFormats/PatCandidates/interface/Jet.h" -#include "DataFormats/PatCandidates/interface/JetCorrFactors.h" -#include "SMPJ/AnalysisFW/interface/QCDJet.h" -#include "SMPJ/AnalysisFW/interface/QCDEvent.h" -#include "SMPJ/AnalysisFW/interface/QCDEventHdr.h" -#include "SMPJ/AnalysisFW/interface/QCDCaloJet.h" -#include "SMPJ/AnalysisFW/interface/QCDPFJet.h" -#include "SMPJ/AnalysisFW/interface/QCDMET.h" -#include "FWCore/ServiceRegistry/interface/Service.h" -#include "CommonTools/UtilAlgos/interface/TFileService.h" -#include "DataFormats/PatCandidates/interface/MET.h" -#include "DataFormats/PatCandidates/interface/PackedCandidate.h" - -#include "DataFormats/L1Trigger/interface/L1JetParticle.h" - -#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/Math/interface/deltaR.h" -#include "FWCore/Common/interface/TriggerNames.h" -#include "DataFormats/Common/interface/TriggerResults.h" -#include "DataFormats/PatCandidates/interface/TriggerObjectStandAlone.h" -#include "DataFormats/PatCandidates/interface/PackedTriggerPrescales.h" - -using namespace edm; -using namespace reco; -using namespace std; -using namespace trigger; - -class ProcessedTreeProducer_miniAOD : public edm::EDAnalyzer -{ - public: - typedef reco::Particle::LorentzVector LorentzVector; - explicit ProcessedTreeProducer_miniAOD(edm::ParameterSet const& cfg); - virtual void beginJob(); - virtual void beginRun(edm::Run const &, edm::EventSetup const& iSetup); - virtual void analyze(edm::Event const& evt, edm::EventSetup const& iSetup); - virtual void endJob(); - virtual ~ProcessedTreeProducer_miniAOD(); - private: - void buildTree(); - static bool sort_calojets(QCDCaloJet j1, QCDCaloJet j2) { - return j1.ptCor() > j2.ptCor(); - } - static bool sort_pfjets(QCDPFJet j1, QCDPFJet j2) { - return j1.ptCor() > j2.ptCor(); - } - - //edm::EDGetTokenT triggerBits_; - //edm::EDGetTokenT triggerObjects_; - //edm::EDGetTokenT triggerPrescales_; - - std::vector triggerObjects_; - std::vector triggerPrescales_; - - //---- configurable parameters -------- - //bool mEventInfo; - bool mIsMCarlo; - bool mUseGenInfo; - bool mPrintTriggerMenu; - bool isPFJecUncSet_,isCaloJecUncSet_,isPFJecUncSetCHS_; - int mGoodVtxNdof,mMinNCaloJets,mMinNPFJets; - double mGoodVtxZ; - double mMinCaloPt,mMinPFPt,mMinPFFatPt,mMaxPFFatEta,mMinGenPt,mMaxY,mMinJJMass; - std::string mCaloJECservice; - std::string mPFJECservice; - std::string mPFPayloadName; - std::string mPFPayloadNameCHS; - std::string mCaloPayloadName; - // unc file for non CHS jet ---- // - std::string mPFJECUncSrc; - // unc file for CHS jet ---- // - std::string mPFJECUncSrcCHS; - std::vector mPFJECUncSrcNames; - edm::InputTag mCaloJetsName; - // ---- non CHS jet input tag ----- // - edm::InputTag mPFJetsName; - // ----CHS jet input tag ----- // - edm::InputTag mPFJetsNameCHS; - edm::InputTag mGenJetsName; - edm::InputTag mCaloJetID; - edm::InputTag mCaloJetExtender; - edm::InputTag mOfflineVertices; - edm::InputTag mSrcCaloRho; - edm::InputTag mSrcPFRho; - edm::InputTag mSrcPU; - - edm::InputTag triggerBits_; - - //edm::InputTag mPFMET; - edm::EDGetTokenT mPFMET; - - //edm::InputTag mHBHENoiseFilter; - //---- TRIGGER ------------------------- - std::string processName_; - std::vector triggerNames_; - std::vector triggerIndex_; - edm::InputTag triggerResultsTag_; - edm::InputTag triggerEventTag_; - edm::Handle triggerResultsHandle_; - edm::Handle triggerEventHandle_; - edm::InputTag cenJetLabel_; - edm::InputTag forwJetLabel_; - - HLTConfigProvider hltConfig_; - //---- CORRECTORS ---------------------- - const JetCorrector *mPFJEC; - const JetCorrector *mCALOJEC; - JetCorrectionUncertainty *mCALOUnc; - // ---- non CHS jet uncertainty ------ // - JetCorrectionUncertainty *mPFUnc; - // ---- non CHS jet uncertainty ------ // - JetCorrectionUncertainty *mPFUncCHS; - //------- non CHS jet uncertainty sources -------- // - std::vector mPFUncSrc; - // -------- CHS jet uncertainty sources -------- // - std::vector mPFUncSrcCHS; - - edm::Service fs; - TTree *mTree; - TH1F *mTriggerPassHisto,*mTriggerNamesHisto; - //---- TREE variables -------- - QCDEvent *mEvent; -}; - -#endif diff --git a/AnalysisFW/test/Analysis_Template_Data.py b/AnalysisFW/test/Analysis_Template_Data.py deleted file mode 100644 index 5a4b744c969..00000000000 --- a/AnalysisFW/test/Analysis_Template_Data.py +++ /dev/null @@ -1,45 +0,0 @@ -# -*- coding: utf-8 -*- -import FWCore.ParameterSet.Config as cms - -process = cms.Process("myprocess") -process.TFileService=cms.Service("TFileService",fileName=cms.string('My_azi_data_Run2012A_test.root')) - -##-------------------- Define the source ---------------------------- -process.maxEvents = cms.untracked.PSet( - input = cms.untracked.int32(1) - ) -process.source = cms.Source("EmptySource") - -##-------------------- User analyzer -------------------------------- -process.efficiency = cms.EDAnalyzer('Analysis_Template_Data', - - filename = cms.string('/mnt/storage/Azimuthal/Data_19thNovember2014/19thNovember2014_Run2012A.root'), - - treename = cms.string('ProcessedTree'), - dirname = cms.string('ak7'), - - minPt = cms.double(100.0), - ymax = cms.double(2.5), - JetID = cms.int32(2), - - printOk = cms.int32(1), - - - hcalNoiseFilter = cms.int32(0), - isMCarlo = cms.untracked.bool(False), - - jecUncSrcNames = cms.vstring('AbsoluteStat','AbsoluteScale','AbsoluteFlavMap', 'AbsoluteMPFBias', 'Fragmentation', 'SinglePionECAL', - 'SinglePionHCAL', 'FlavorQCD', 'TimeEta', 'TimePt', 'RelativeJEREC1', 'RelativeJEREC2', 'RelativeJERHF', - 'RelativePtBB', 'RelativePtEC1', 'RelativePtEC2', 'RelativePtHF', 'RelativeFSR', 'RelativeStatFSR', - 'RelativeStatEC2', 'RelativeStatHF', 'PileUpDataMC', 'PileUpPtRef', 'PileUpPtBB', 'PileUpPtEC1', - 'PileUpPtEC2', 'PileUpPtHF', 'PileUpMuZero', 'PileUpEnvelope', - 'SubTotalPileUp', 'SubTotalRelative', 'SubTotalPt', 'SubTotalScale', 'SubTotalAbsolute', 'SubTotalMC', 'Total','TotalNoFlavor', - 'TotalNoTime','TotalNoFlavorNoTime', - 'FlavorZJet','FlavorPhotonJet','FlavorPureGluon','FlavorPureQuark','FlavorPureCharm', - 'FlavorPureBottom','TimeRunA','TimeRunB','TimeRunC','TimeRunD','CorrelationGroupMPFInSitu', - 'CorrelationGroupIntercalibration','CorrelationGroupbJES','CorrelationGroupFlavor', - 'CorrelationGroupUncorrelated'), - ) - -process.p = cms.Path(process.efficiency) - diff --git a/AnalysisFW/test/Analysis_Template_MC.py b/AnalysisFW/test/Analysis_Template_MC.py deleted file mode 100644 index b6037bbaec0..00000000000 --- a/AnalysisFW/test/Analysis_Template_MC.py +++ /dev/null @@ -1,46 +0,0 @@ -# -*- coding: utf-8 -*- -import FWCore.ParameterSet.Config as cms - -process = cms.Process("myprocess") -process.TFileService=cms.Service("TFileService",fileName=cms.string("out_Analysis_Template_MC.root")) - -##-------------------- Define the source ---------------------------- -process.maxEvents = cms.untracked.PSet( - input = cms.untracked.int32(1) - ) -process.source = cms.Source("EmptySource") - - -##-------------------- User analyzer -------------------------------- -process.efficiency = cms.EDAnalyzer('Analysis_Template_MC', - filename = cms.string("file://./MC_ProcessedTreeProducer_2.root"), - - treename = cms.string('ProcessedTree'), - dirname = cms.string('ak7'), - - #Variables for JECs on the fly - pseudoglobaltag = cms.string('PHYS14_V4'), #Make sure that the name is the same as in data direcotry - jettype = cms.string('AK7PF'), #AKXPF or AKXPFchs - this is only for JECs - # - - minPt = cms.double(100.0), - ymax = cms.double(2.5), - JetID = cms.int32(2), - - printOk = cms.int32(0), - - #xsection = cms.double(10360000.0), - #mcevents = cms.double(52000000), - - isMCarlo = cms.untracked.bool(True), - jecUncSrcNames = cms.vstring('Absolute','HighPtExtra','SinglePionECAL','SinglePionHCAL','FlavorQCD', - 'Time','RelativeJEREC1','RelativeJEREC2','RelativeJERHF','RelativePtBB', - 'RelativePtEC1','RelativePtEC2','RelativePtHF','RelativeFSR','RelativeStatEC2', - 'RelativeStatHF','PileUpDataMC','PileUpPtBB','PileUpPtEC','PileUpPtHF','PileUpBias', - 'TotalNoFlavor', 'FlavorZJet','FlavorPhotonJet','FlavorPureGluon','FlavorPureQuark', - 'FlavorPureCharm','FlavorPureBottom', - 'SubTotalPileUp','SubTotalRelative','SubTotalPt','SubTotalMC','Total'), - -) - -process.p = cms.Path(process.efficiency) diff --git a/AnalysisFW/test/ProcessedTreeProducerGEN_mc_cfg.py b/AnalysisFW/test/ProcessedTreeProducerGEN_mc_cfg.py deleted file mode 100644 index cd4e552e8bb..00000000000 --- a/AnalysisFW/test/ProcessedTreeProducerGEN_mc_cfg.py +++ /dev/null @@ -1,32 +0,0 @@ -# -*- coding: utf-8 -*- - -import FWCore.ParameterSet.Config as cms - -process = cms.Process("Ntuplizer") -process.load("Configuration.EventContent.EventContent_cff") - -inFiles = cms.untracked.vstring( -'file:///mnt/storage/gflouris/MC_13TeV/Pythia8_CUETM1_Flat/QCD_Pt_15to5000_CUETM1_Flat_13TeV_pythia8_cffGEN_1.root' #Pythia -) -process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(-1)) -process.source = cms.Source("PoolSource", fileNames = inFiles ) - -process.load('FWCore.MessageLogger.MessageLogger_cfi') -process.MessageLogger.cerr.FwkReport.reportEvery = 10000 -process.load('CommonTools.UtilAlgos.TFileService_cfi') -process.TFileService.fileName=cms.string('MC_ProcessedTreeProducerGEN.root') - -process.ak5 = cms.EDAnalyzer('ProcessedTreeProducerGEN', - genjets = cms.untracked.InputTag('ak5GenJets'), - ## preselection cuts ######################### - maxY = cms.double(5.0), - minGenPt = cms.untracked.double(20), -) - - -process.ak7 = process.ak5.clone( - genjets = cms.untracked.InputTag('ak7GenJets'), -) - -process.p = cms.Path( process.ak5*process.ak7) - diff --git a/AnalysisFW/test/ProcessedTreeProducer_dataPAT_SQLite_cfg.py b/AnalysisFW/test/ProcessedTreeProducer_dataPAT_SQLite_cfg.py deleted file mode 100644 index e10df4379b3..00000000000 --- a/AnalysisFW/test/ProcessedTreeProducer_dataPAT_SQLite_cfg.py +++ /dev/null @@ -1,421 +0,0 @@ -## import skeleton process -from PhysicsTools.PatAlgos.patTemplate_cfg import * - -runOnMC = False - -process.source.fileNames = [ - "root://eoscms//eos/cms//store/data/Run2012B/DoubleElectron/AOD/PromptReco-v1/000/193/928/FA473C01-D39C-E111-B74F-003048D2BCA2.root" - ] - -if runOnMC: - process.GlobalTag.globaltag = cms.string('START53_V27::All') -else: - process.GlobalTag.globaltag = cms.string('FT53_V21A_AN6::All') - - -### ----------------------------- loading for the sqlite file ------------------------- #### -process.load("CondCore.DBCommon.CondDBCommon_cfi") -from CondCore.DBCommon.CondDBSetup_cfi import * -process.jec = cms.ESSource("PoolDBESSource", - DBParameters = cms.PSet( - messageLevel = cms.untracked.int32(0) - ), - timetype = cms.string('runnumber'), - toGet = cms.VPSet( - cms.PSet( - record = cms.string('JetCorrectionsRecord'), - tag = cms.string('JetCorrectorParametersCollection_Winter14_V5_DATA_AK5PFchs'), - # tag = cms.string('JetCorrectorParametersCollection_Summer12_V7_MC_AK5PF'), - label = cms.untracked.string('AK5PFchs') - ), - cms.PSet( - record = cms.string('JetCorrectionsRecord'), - tag = cms.string('JetCorrectorParametersCollection_Winter14_V5_DATA_AK7PFchs'), - # tag = cms.string('JetCorrectorParametersCollection_Summer12_V7_MC_AK7PF'), - label = cms.untracked.string('AK7PFchs') - ), - cms.PSet( - record = cms.string('JetCorrectionsRecord'), - tag = cms.string('JetCorrectorParametersCollection_Winter14_V5_DATA_AK5PF'), - # tag = cms.string('JetCorrectorParametersCollection_Summer12_V7_MC_AK5PF'), - label = cms.untracked.string('AK5PF') - ), - cms.PSet( - record = cms.string('JetCorrectionsRecord'), - tag = cms.string('JetCorrectorParametersCollection_Winter14_V5_DATA_AK7PF'), - # tag = cms.string('JetCorrectorParametersCollection_Summer12_V7_MC_AK7PF'), - label = cms.untracked.string('AK7PF') - ), - cms.PSet( - record = cms.string('JetCorrectionsRecord'), - tag = cms.string('JetCorrectorParametersCollection_Winter14_V5_DATA_AK5Calo'), - # tag = cms.string('JetCorrectorParametersCollection_Summer12_V7_MC_AK5Calo'), - label = cms.untracked.string('AK5Calo') - ), - cms.PSet( - record = cms.string('JetCorrectionsRecord'), - tag = cms.string('JetCorrectorParametersCollection_Winter14_V5_DATA_AK7Calo'), - # tag = cms.string('JetCorrectorParametersCollection_Summer12_V7_MC_AK7Calo'), - label = cms.untracked.string('AK7Calo') - ), - #.................................................. - ## here you add as many jet types as you need - ## note that the tag name is specific for the particular sqlite file - ), - connect = cms.string('sqlite:Winter14_V5_DATA.db') - # uncomment above tag lines and this comment to use MC JEC - # connect = cms.string('sqlite:Summer12_V7_MC.db') -) -## add an es_prefer statement to resolve a possible conflict from simultaneous connection to a global tag -process.es_prefer_jec = cms.ESPrefer('PoolDBESSource','jec') - - -##--------------------- ******************************************************************** --------------------------- ## - - -# load the PAT config -process.load("RecoTauTag.Configuration.RecoPFTauTag_cff") # re-run tau discriminators (new version) -process.load("PhysicsTools.PatAlgos.patSequences_cff") -process.load('Configuration.StandardSequences.Reconstruction_cff') -process.load('RecoJets.Configuration.RecoPFJets_cff') -process.load('RecoJets.Configuration.RecoJets_cff') -process.load('RecoJets.JetProducers.TrackJetParameters_cfi') -process.load('JetMETCorrections.Configuration.DefaultJEC_cff') -process.load('CommonTools.RecoAlgos.HBHENoiseFilterResultProducer_cfi') - - -# Configure PAT to use PF2PAT instead of AOD sources -# this function will modify the PAT sequences. -from PhysicsTools.PatAlgos.tools.pfTools import * -from PhysicsTools.PatAlgos.tools.coreTools import * -from PhysicsTools.PatAlgos.tools.metTools import * -from PhysicsTools.PatAlgos.tools.jetTools import * -from PhysicsTools.PatAlgos.tools.coreTools import * -from PhysicsTools.SelectorUtils.pvSelector_cfi import pvSelector - - -##--------- good primary vertices --------------- -#process.goodOfflinePrimaryVertices = cms.EDFilter( -# "PrimaryVertexObjectFilter", -# filterParams = pvSelector.clone( minNdof = cms.double(4.0), maxZ = cms.double(24.0) ), -# src=cms.InputTag('offlinePrimaryVertices') -# ) - -process.goodOfflinePrimaryVertices = cms.EDFilter( - "VertexSelector", - filter = cms.bool(False), - src = cms.InputTag("offlinePrimaryVertices"), - cut = cms.string("!isFake && ndof > 4 && abs(z) <= 24 && position.rho < 2") - ) - - -process.ak5PFJets.doAreaFastjet = True -process.ak7PFJets.doAreaFastjet = True -process.kt6PFJets.doRhoFastjet = True - - - -# Configure PAT to use PF2PAT instead of AOD sources -# this function will modify the PAT sequences. -from PhysicsTools.PatAlgos.tools.pfTools import * - -# An empty postfix means that only PF2PAT is run, -# otherwise both standard PAT and PF2PAT are run. In the latter case PF2PAT -# collections have standard names + postfix (e.g. patElectronPFlow) -postfix = "CHS" -jetAlgo = "AK5" -#usePF2PAT(process,runPF2PAT=True, jetAlgo=jetAlgo, runOnMC=runOnMC, postfix=postfix) -usePF2PAT(process,runPF2PAT=True, jetAlgo=jetAlgo, runOnMC=False, postfix=postfix, - jetCorrections=('AK5PFchs', ['L1FastJet','L2Relative','L3Absolute','L2L3Residual']), - pvCollection=cms.InputTag('goodOfflinePrimaryVertices'), - typeIMetCorrections=True - ) -process.pfPileUpCHS.checkClosestZVertex = False -process.pfPileUpCHS.Enable = True -process.pfPileUpCHS.Vertices = cms.InputTag('goodOfflinePrimaryVertices') -process.pfJetsCHS.doAreaFastjet = True -process.pfJetsCHS.doRhoFastjet = False - - - -process.kt6PFJetsCHS = process.kt6PFJets.clone( - src = cms.InputTag('pfNoElectron'+postfix), - doAreaFastjet = cms.bool(True), - doRhoFastjet = cms.bool(True) - ) - -process.kt6PFJetsISO = process.kt6PFJets.clone( - Rho_EtaMax = cms.double(2.4) - ) - -#getattr(process,"patPF2PATSequence"+postfix).replace( -# getattr(process,"pfNoElectron"+postfix), -# getattr(process,"pfNoElectron"+postfix)*process.kt6PFJetsCHS) - - -#----- recommendation from JES: use the standard rho for CHS ------ -#process.patJetCorrFactorsCHS.rho = cms.InputTag("kt6PFJetsCHS", "rho") - - -#------------- Running a second PF2PAT for Ak7chs jets ----------------# -postfix2 = "CHS7" -jetAlgo2 = "AK7" -usePF2PAT(process,runPF2PAT=True, jetAlgo=jetAlgo2, runOnMC=False, postfix=postfix2, - jetCorrections=('AK7PFchs', ['L1FastJet','L2Relative','L3Absolute','L2L3Residual']), - pvCollection=cms.InputTag('goodOfflinePrimaryVertices'), - typeIMetCorrections=True - ) - -# --- modifying the pfpileup+postfix2 -------------------- # -process.pfPileUpCHS7.checkClosestZVertex = False -process.pfPileUpCHS7.Enable = True -process.pfPileUpCHS7.Vertices = cms.InputTag('goodOfflinePrimaryVertices') -process.pfJetsCHS7.doAreaFastjet = True -process.pfJetsCHS7.doRhoFastjet = False - -process.ak5PFJets.doAreaFastjet = True -process.ak7PFJets.doAreaFastjet = True -process.kt6PFJets.doRhoFastjet = True - -#----- recommendation from JES: use the standard rho for CHS ------ -#process.patJetCorrFactorsCHS7.rho = cms.InputTag("kt6PFJetsCHS", "rho") - -# to use tau-cleaned jet collection uncomment the following: -getattr(process,"pfNoTau"+postfix).enable = True -getattr(process,"pfNoTau"+postfix2).enable = True - -#------ removing the MC matching and let it run -------# -if not runOnMC: - removeMCMatchingPF2PAT( process, '' ) - runOnData(process) - - -# ------------- Adding Ak5 and Ak7 jet collection to process ------------- # -addPfMET(process, 'PF') -# ------- Adding non CHS jets to process ------// -addJetCollection(process,cms.InputTag('ak5PFJets'), - 'AK5', 'PFCorr', - doJTA = True, - doBTagging = False, - jetCorrLabel = ('AK5PF', cms.vstring(['L1FastJet','L2Relative','L3Absolute','L2L3Residual'])), - doType1MET = True, - doL1Cleaning = True, - doL1Counters = False, -# genJetCollection=cms.InputTag("ak7GenJets"), - doJetID = True, - jetIdLabel = "ak5" - ) - -addJetCollection(process,cms.InputTag('ak7PFJets'), - 'AK7', 'PFCorr', - doJTA = True, - doBTagging = False, - jetCorrLabel = ('AK7PF', cms.vstring(['L1FastJet','L2Relative','L3Absolute','L2L3Residual'])), - doType1MET = True, - doL1Cleaning = True, - doL1Counters = False, -# genJetCollection=cms.InputTag("ak7GenJets"), - doJetID = True, - jetIdLabel = "ak7" - ) - -#process.patJetCorrFactorsAK5PFcorr.primaryVertices = cms.InputTag('goodOfflinePrimaryVertices') -#process.patJetCorrFactorsAK5PFcorr.rho = cms.InputTag("kt6PFJetsCHS", "rho") -#for icorr in [process.patJetCorrFactorsAK5PFcorr, -# process.patJetCorrFactorsAK7PFcorr -# ] : -# icorr.rho = cms.InputTag("kt6PFJets", "rho") -# icorr.primaryVertices = cms.InputTag('goodOfflinePrimaryVertices') - - - -##################### Calorimeter Noise Filters ############## -#----------- hcal laser event filter 2012 -------------- # -from EventFilter.HcalRawToDigi.hcallasereventfilter2012_cfi import hcallasereventfilter2012 -process.hcalLaserEventFilter2012 = hcallasereventfilter2012.clone() -#----------- HBHE noise filter ---------------------# -from CommonTools.RecoAlgos.HBHENoiseFilterResultProducer_cfi import HBHENoiseFilterResultProducer -process.HBHENoiseFilter = HBHENoiseFilterResultProducer.clone() -#----------- hcal laser event filter -------------- # -from RecoMET.METFilters.hcalLaserEventFilter_cfi import hcalLaserEventFilter -process.hcalLaserEventFilter = hcalLaserEventFilter.clone() -process.hcalLaserEventFilter.vetoByRunEventNumber=cms.untracked.bool(False) -process.hcalLaserEventFilter.vetoByHBHEOccupancy=cms.untracked.bool(True) -process.hcalLaserEventFilter.taggingMode = cms.bool(True) -#---------- ecal dead cell filter ------------# -from RecoMET.METFilters.EcalDeadCellTriggerPrimitiveFilter_cfi import EcalDeadCellTriggerPrimitiveFilter -process.EcalDeadCellTriggerPrimitiveFilter = EcalDeadCellTriggerPrimitiveFilter.clone() -process.EcalDeadCellTriggerPrimitiveFilter.tpDigiCollection = cms.InputTag("ecalTPSkimNA") -process.EcalDeadCellTriggerPrimitiveFilter.taggingMode = cms.bool(True) -#-------- The EE bad SuperCrystal filter -------# -from RecoMET.METFilters.eeBadScFilter_cfi import eeBadScFilter -process.eeBadScFilter = eeBadScFilter.clone() -process.eeBadScFilter.taggingMode = cms.bool(True) -# ------- The Halo Filter ----------------- # -from RecoMET.METFilters.CSCTightHaloFilter_cfi import CSCTightHaloFilter -process.CSCBasedHaloFilter = CSCTightHaloFilter.clone() -# -------- The Tracking failure filter ------# -from RecoMET.METFilters.trackingFailureFilter_cfi import trackingFailureFilter -process.trackingFailureFilter = trackingFailureFilter.clone() -process.trackingFailureFilter.VertexSource = cms.InputTag('goodOfflinePrimaryVertices') -# --------------- The scrapping filter ------------# -process.scrapingVeto = cms.EDFilter("FilterOutScraping", - applyfilter = cms.untracked.bool (True), - debugOn = cms.untracked.bool (False), - numtrack = cms.untracked.uint32(10), - thresh = cms.untracked.double(0.25) - ) - - -################### declaring the EDAnalyzer ##############################3 - -process.ak7 = cms.EDAnalyzer('ProcessedTreeProducer', - ## jet collections ########################### - pfjets = cms.InputTag('selectedPatJetsAK7PFCorr'), - pfjetschs = cms.InputTag('selectedPatJetsCHS7'), - ## MET collection #### - pfmet = cms.InputTag('pfMETCHS7'), - ## database entry for the uncertainties ###### - PFPayloadName = cms.string('AK7PF'), - PFPayloadNameCHS= cms.string('AK7PFchs'), - CaloPayloadName = cms.string('AK7Calo'), - jecUncSrc = cms.string('Winter14_V5_DATA_UncertaintySources_AK7PF.txt'), - jecUncSrcCHS = cms.string('Winter14_V5_DATA_UncertaintySources_AK7PFchs.txt'), - jecUncSrcNames = cms.vstring('AbsoluteStat','AbsoluteScale','AbsoluteFlavMap','AbsoluteMPFBias','HighPtExtra','SinglePionECAL', - 'SinglePionHCAL','FlavorQCD','TimeEta','TimePt','RelativeJEREC1','RelativeJEREC2','RelativeJERHF', - 'RelativePtBB','RelativePtEC1','RelativePtEC2','RelativePtHF','RelativeFSR','RelativeStatEC2', - 'RelativeStatHF','PileUpDataMC','PileUpPtRef','PileUpPtBB','PileUpPtEC1','PileUpPtEC2','PileUpPtHF', - 'PileUpMuZero','PileUpEnvelope', - 'SubTotalPileUp','SubTotalRelative','SubTotalPt','SubTotalScale','SubTotalMC','Total','TotalNoFlavor', - 'TotalNoTime','TotalNoFlavorNoTime', - 'FlavorZJet','FlavorPhotonJet','FlavorPureGluon','FlavorPureQuark','FlavorPureCharm', - 'FlavorPureBottom','TimeRunA','TimeRunB','TimeRunC','TimeRunD','CorrelationGroupMPFInSitu', - 'CorrelationGroupIntercalibration','CorrelationGroupbJES','CorrelationGroupFlavor', - 'CorrelationGroupUncorrelated'), - - ## set the conditions for good Vtx counting ## - offlineVertices = cms.InputTag('goodOfflinePrimaryVertices'), - goodVtxNdof = cms.double(4), - goodVtxZ = cms.double(24), - ## rho ####################################### - srcCaloRho = cms.InputTag('kt6CaloJets','rho'), - srcPFRho = cms.InputTag('kt6PFJets','rho'), - ## preselection cuts ######################### - maxY = cms.double(5.0), - minPFPt = cms.double(20), - minPFFatPt = cms.double(10), - maxPFFatEta = cms.double(2.5), - minNPFJets = cms.int32(1), - minJJMass = cms.double(-1), - isMCarlo = cms.untracked.bool(runOnMC), - ## trigger ################################### - printTriggerMenu = cms.untracked.bool(True), - processName = cms.string('HLT'), - triggerName = cms.vstring('HLT_PFJet40_v3','HLT_PFJet40_v4','HLT_PFJet40_v5','HLT_PFJet40_v6','HLT_PFJet40_v7','HLT_PFJet40_v8','HLT_PFJet40_v9', - 'HLT_PFJet80_v3','HLT_PFJet80_v4','HLT_PFJet80_v5','HLT_PFJet80_v6','HLT_PFJet80_v7','HLT_PFJet80_v8','HLT_PFJet80_v9', - 'HLT_PFJet140_v3','HLT_PFJet140_v4','HLT_PFJet140_v5','HLT_PFJet140_v6','HLT_PFJet140_v7','HLT_PFJet140_v8','HLT_PFJet140_v9', - 'HLT_PFJet200_v3','HLT_PFJet200_v4','HLT_PFJet200_v5','HLT_PFJet200_v6','HLT_PFJet200_v7','HLT_PFJet200_v8','HLT_PFJet200_v9', - 'HLT_PFJet260_v3','HLT_PFJet260_v4','HLT_PFJet260_v5','HLT_PFJet260_v6','HLT_PFJet260_v7','HLT_PFJet260_v8','HLT_PFJet260_v9', - 'HLT_PFJet320_v3','HLT_PFJet320_v4','HLT_PFJet320_v5','HLT_PFJet320_v6','HLT_PFJet320_v7','HLT_PFJet320_v8','HLT_PFJet320_v9', - 'HLT_PFJet400_v3','HLT_PFJet400_v4','HLT_PFJet400_v5','HLT_PFJet400_v6','HLT_PFJet400_v7','HLT_PFJet400_v8','HLT_PFJet400_v9' - # 'HLT_IsoMu24_eta2p1_v11', 'HLT_IsoMu24_eta2p1_v12', 'HLT_IsoMu24_eta2p1_v13', 'HLT_IsoMu24_eta2p1_v14', 'HLT_IsoMu24_eta2p1_v15' - ), - triggerResults = cms.InputTag("TriggerResults","","HLT"), - triggerEvent = cms.InputTag("hltTriggerSummaryAOD","","HLT"), - ## jec services ############################## - #pfjecService = cms.string('ak7PFL1FastL2L3Residual'), - #calojecService = cms.string('ak7CaloL1FastL2L3Residual') -) - -process.ak5 = process.ak7.clone( - - ## jet collections ########################### - pfjets = cms.InputTag('selectedPatJetsAK5PFCorr'), - pfjetschs = cms.InputTag('selectedPatJetsCHS'), - ## MET collection #### - pfmet = cms.InputTag('pfMETCHS'), - ## database entry for the uncertainties ###### - PFPayloadName = cms.string('AK5PF'), - PFPayloadNameCHS= cms.string('AK5PFchs'), - CaloPayloadName = cms.string('AK5Calo'), - jecUncSrc = cms.string('Winter14_V5_DATA_UncertaintySources_AK5PF.txt'), - jecUncSrcCHS = cms.string('Winter14_V5_DATA_UncertaintySources_AK5PFchs.txt'), - printTriggerMenu = False -) - - -############# hlt filter ######################### -process.hltFilter = cms.EDFilter('HLTHighLevel', - TriggerResultsTag = cms.InputTag('TriggerResults','','HLT'), - HLTPaths = cms.vstring( - 'HLT_PFJet40_v*','HLT_PFJet80_v*','HLT_PFJet140_v*','HLT_PFJet200_v*','HLT_PFJet260_v*','HLT_PFJet320_v*','HLT_PFJet400_v*'#, 'HLT_IsoMu24_eta2p1_v*' - ), - eventSetupPathsKey = cms.string(''), - andOr = cms.bool(True), #----- True = OR, False = AND between the HLTPaths - throw = cms.bool(False) -) - - -# Let it run -process.p = cms.Path( - process.goodOfflinePrimaryVertices* - process.hltFilter * - process.hcalLaserEventFilter2012 * - process.hcalLaserEventFilter * -# process.HBHENoiseFilter * - process.EcalDeadCellTriggerPrimitiveFilter * - process.eeBadScFilter * - process.CSCBasedHaloFilter * - process.trackingFailureFilter * - process.scrapingVeto * - process.patDefaultSequence * - getattr(process,"patPF2PATSequence"+postfix) * - getattr(process,"patPF2PATSequence"+postfix2) * - process.ak5 * - process.ak7 -# second PF2PAT -# + getattr(process,"patPF2PATSequence"+postfix2) -) -#if not postfix == "": -# process.p += process.recoTauClassicHPSSequence # re-run tau discriminators (new version) -# process.p += process.patDefaultSequence - -# Add PF2PAT output to the created file -#from PhysicsTools.PatAlgos.patEventContent_cff import patEventContentNoCleaning -#process.out.outputCommands = cms.untracked.vstring('drop *', -# 'keep recoPFCandidates_particleFlow_*_*', -# *patEventContentNoCleaning ) - - -# top projections in PF2PAT: -getattr(process,"pfNoPileUp"+postfix).enable = True -getattr(process,"pfNoMuon"+postfix).enable = True -getattr(process,"pfNoElectron"+postfix).enable = True -getattr(process,"pfNoTau"+postfix).enable = False -getattr(process,"pfNoJet"+postfix).enable = True - -# verbose flags for the PF2PAT modules -getattr(process,"pfNoMuon"+postfix).verbose = False - -## ------------------------------------------------------ -# In addition you usually want to change the following -# parameters: -## ------------------------------------------------------ -# -# process.GlobalTag.globaltag = ... ## (according to https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideFrontierConditions) -# ## -# process.source.fileNames = ... ## (e.g. 'file:AOD.root') -# ## -process.maxEvents.input = -1 -# -process.MessageLogger.cerr.FwkReport.reportEvery = 1000 ## -# process.out.outputCommands = [ ... ] ## (e.g. taken from PhysicsTools/PatAlgos/python/patEventContent_cff.py) -# -############# processed tree producer ################## -process.TFileService = cms.Service("TFileService",fileName = cms.string('ProcessedTree_data.root')) - -#process.out.fileName = 'patTuple_PATandPF2PAT.root' -# ## -process.options.wantSummary = False ## (to suppress the long output at the end of the job) - -del process.outpath diff --git a/AnalysisFW/test/ProcessedTreeProducer_dataPAT_cfg.py b/AnalysisFW/test/ProcessedTreeProducer_dataPAT_cfg.py deleted file mode 100644 index d28b590f3a5..00000000000 --- a/AnalysisFW/test/ProcessedTreeProducer_dataPAT_cfg.py +++ /dev/null @@ -1,314 +0,0 @@ -# -*- coding: utf-8 -*- - -import FWCore.ParameterSet.Config as cms - -import FWCore.ParameterSet.Config as cms - -from RecoJets.Configuration.RecoPFJets_cff import ak4PFJets, ak4PFJetsCHS -from RecoJets.Configuration.RecoGenJets_cff import ak4GenJets -from RecoJets.JetProducers.SubJetParameters_cfi import SubJetParameters -from RecoJets.JetProducers.PFJetParameters_cfi import * -from RecoJets.JetProducers.GenJetParameters_cfi import * -from RecoJets.JetProducers.AnomalousCellParameters_cfi import * -from PhysicsTools.PatAlgos.producersLayer1.patCandidates_cff import * -from PhysicsTools.PatAlgos.selectionLayer1.jetSelector_cfi import selectedPatJets -from PhysicsTools.PatAlgos.tools.jetTools import * -#from PhysicsTools.PatAlgos.producersLayer1.metProducer_cfi import patMETs -from PhysicsTools.PatAlgos.patSequences_cff import * -#nnfrom PhysicsTools.PatAlgos.tools.metTools import addMETCollection -from RecoJets.JetProducers.pileupjetidproducer_cfi import * - - - -## Modified version of jetToolBox from https://github.com/cms-jet/jetToolbox -## Options for PUMethod: Puppi, CS, SK, CHS -def jetToolbox( proc, jetType, jetSequence,PUMethod=''): - - JETCorrPayload='None' - JETCorrLevels = [ 'None' ] - #JECLevels = [ 'L1Offset', 'L1FastJet', 'L1JPTOffset', 'L2Relative', 'L3Absolute', 'L5Falvour', 'L7Parton' ] - - algorithm='AntiKt' # CambridgeAachen' , 'Kt' - size = jetType[-1:] #[-1:] takes the last char from string 'akX' - jetSize = float('0.'+jetType[-1:]) - jetALGO = jetType.upper() - jetalgo = jetType.lower() - elemToKeep = [] - - print 'Running processes with: '+str(jetALGO)+' PF '+PUMethod+' jet algorithm with radius parameter '+str(jetSize) - - JETCorrPayload = 'AK'+size+'PF'+PUMethod.lower() - JETCorrLevels = ['L1FastJet', 'L2Relative', 'L3Absolute','L2L3Residual'] - #JETCorrLevels = [] #No JEC corrections - JEC = ( JETCorrPayload, JETCorrLevels , 'None') - - - ################################################################################# - ####### Toolbox start - ################################################################################# - - elemToKeep = [] - jetSeq = cms.Sequence() - genParticlesLabel = '' - pvLabel = '' - tvLabel = '' - toolsUsed = [] - - proc.load('RecoJets.Configuration.GenJetParticles_cff') - setattr( proc, jetalgo+'GenJetsNoNu', ak4GenJets.clone( src = 'genParticlesForJetsNoNu', rParam = jetSize, jetAlgorithm = algorithm ) ) - jetSeq += getattr(proc, jetalgo+'GenJetsNoNu' ) - - proc.load('CommonTools.ParticleFlow.pfNoPileUpJME_cff') - #### Creating PATjets - if( PUMethod=='CHS') : - setattr( proc, jetalgo+'PFJetsCHS', ak4PFJets.clone( rParam = jetSize, jetAlgorithm = algorithm ) ) - jetSeq += getattr(proc, jetalgo+'PFJetsCHS' ) - - setattr( proc, jetalgo+'PFJetsCHS', - ak4PFJetsCHS.clone( - doAreaFastjet = True, - rParam = jetSize, - jetAlgorithm = algorithm ) ) - jetSeq += getattr(proc, jetalgo+'PFJetsCHS' ) - - else : - setattr( proc, jetalgo+'PFJets', ak4PFJets.clone( rParam = jetSize, jetAlgorithm = algorithm ) ) - jetSeq += getattr(proc, jetalgo+'PFJets' ) - - setattr( proc, jetalgo+'PFJets', - ak4PFJets.clone( - doAreaFastjet = True, - rParam = jetSize, - jetAlgorithm = algorithm ) ) - jetSeq += getattr(proc, jetalgo+'PFJets' ) - PUMethod='' - - - addJetCollection( - proc, - labelName = jetALGO+'PF'+PUMethod, - jetSource = cms.InputTag( jetalgo+'PFJets'+PUMethod), - algo = jetalgo, - rParam = jetSize, - jetCorrections = JEC, #( 'AK'+size+'PFchs', cms.vstring( ['L1FastJet', 'L2Relative', 'L3Absolute']), 'None'), - pfCandidates = cms.InputTag( 'particleFlow' ), #'packedPFCandidates'), - svSource = cms.InputTag('slimmedSecondaryVertices'), - genJetCollection = cms.InputTag( jetalgo+'GenJetsNoNu'), - pvSource = cms.InputTag( 'offlinePrimaryVertices' ), #'offlineSlimmedPrimaryVertices'), - jetTrackAssociation = True, - - ) - - setattr( proc, jetALGO+'PF'+PUMethod+'pileupJetIdCalculator', - pileupJetIdCalculator.clone( - jets = cms.InputTag(jetalgo+'PFJets'+PUMethod), - rho = cms.InputTag("fixedGridRhoFastjetAll"), - vertexes = cms.InputTag('offlinePrimaryVertices'), - applyJec = cms.bool(True), - inputIsCorrected = cms.bool(False) - )) - - setattr( proc, jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator', - pileupJetIdEvaluator.clone( - jetids = cms.InputTag(jetALGO+'PF'+PUMethod+'pileupJetIdCalculator'), - jets = cms.InputTag(jetalgo+'PFJets'+PUMethod), - rho = cms.InputTag("fixedGridRhoFastjetAll"), - vertexes = cms.InputTag('offlinePrimaryVertices'), - applyJec = cms.bool(True), - inputIsCorrected = cms.bool(False) - - ) - ) - - getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod).userData.userFloats.src += [jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator:fullDiscriminant'] - getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod).userData.userInts.src += [jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator:cutbasedId',jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator:fullId'] - - getattr(proc,'patJetPartons').particles = cms.InputTag( 'genParticles' ) #'prunedGenParticles') - setattr(proc, 'selectedPatJets'+jetALGO+'PF'+PUMethod, selectedPatJets.clone( src = 'patJets'+jetALGO+'PF'+PUMethod ) ) - setattr(proc, jetSequence, jetSeq) - - - - -# -*- coding: utf-8 -*- -import FWCore.ParameterSet.Config as cms - -process = cms.Process("Ntuplizer") -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -#! Conditions -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_condDBv2_cff") -process.load("Configuration.EventContent.EventContent_cff") -process.load('Configuration.StandardSequences.Geometry_cff') -process.load('Configuration.StandardSequences.MagneticField_38T_cff') -process.load('RecoJets.Configuration.GenJetParticles_cff') -process.load('RecoJets.Configuration.RecoGenJets_cff') -process.load('RecoJets.JetProducers.TrackJetParameters_cfi') -process.load('RecoJets.JetProducers.PileupJetIDParams_cfi') - -process.load("PhysicsTools.PatAlgos.slimming.pileupJetId_cfi") - -process.GlobalTag.globaltag = "74X_dataRun2_Prompt_v0" - -##-------------------- Import the JEC services ----------------------- -process.load('JetMETCorrections.Configuration.DefaultJEC_cff') - -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -#! Input -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -inFiles = cms.untracked.vstring( -#'file:///mnt/storage/gflouris/08C07BB6-376F-E411-BE9F-C4346BC7EE18.root' #Madgraph PHYS14 -#'file://./2430A1EC-00FA-E411-8641-0025905A7786.root' #Pythia -'root://xrootd.unl.edu//store/data/Run2015B/JetHT/AOD/PromptReco-v1/000/251/164/00000/F210DFFE-A726-E511-84D3-02163E0133D1.root' -#'file:///afs/cern.ch/work/g/gflouris/public/SMPJ_AnalysisFW/08C07BB6-376F-E411-BE9F-C4346BC7EE18.root' - - ) -process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(100)) -process.source = cms.Source("PoolSource", fileNames = inFiles ) - - -jetToolbox( process, 'ak4', 'ak4JetSubs') -jetToolbox( process, 'ak4', 'ak4JetSubs','CHS') - - -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -#! Services -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -process.load('FWCore.MessageLogger.MessageLogger_cfi') -process.MessageLogger.cerr.FwkReport.reportEvery = 100 -process.load('CommonTools.UtilAlgos.TFileService_cfi') -process.TFileService.fileName=cms.string('DATA_ProcessedTreeProducer_2.root') - - -#process.load("PhysicsTools.PatAlgos.producersLayer1.patCandidates_cff") -#process.load("PhysicsTools.PatAlgos.selectionLayer1.selectedPatCandidates_cff") -#from PhysicsTools.PatAlgos.tools.metTools import addMETCollection -#addMETCollection(process,'patMETPF','pfMetT1') -#patMETs.addGenMet = cms.bool(False) -#patMETs.genMETSource = cms.InputTag("") - -process.ak4 = cms.EDAnalyzer('ProcessedTreeProducer', - ## jet collections ########################### - pfjets = cms.InputTag('selectedPatJetsAK4PF'), - pfjetschs = cms.InputTag('selectedPatJetsAK4PFCHS'), - pfpujetid = cms.string('AK4PFpileupJetIdEvaluator:fullDiscriminant'), - pfchsjetpuid = cms.string('AK4PFCHSpileupJetIdEvaluator:fullDiscriminant'), - ## MET collection #### - pfmet = cms.InputTag('patMETs'), - genjets = cms.untracked.InputTag('ak4GenJetsNoNu'), - ## database entry for the uncertainties ###### - PFPayloadName = cms.string('AK4PF'), - PFPayloadNameCHS= cms.string('AK4PFchs'), - jecUncSrc = cms.string(''), - jecUncSrcCHS = cms.string(''), - jecUncSrcNames = cms.vstring(''), - ## set the conditions for good Vtx counting ## - offlineVertices = cms.InputTag('offlinePrimaryVertices'), - goodVtxNdof = cms.double(4), - goodVtxZ = cms.double(24), - ## rho ####################################### - srcCaloRho = cms.InputTag('fixedGridRhoFastjetAllCalo'), - srcPFRho = cms.InputTag('fixedGridRhoFastjetAll'), - srcPU = cms.untracked.InputTag('addPileupInfo'), - ## preselection cuts ######################### - maxY = cms.double(5.0), - minPFPt = cms.double(20), - minNPFJets = cms.int32(1), - minGenPt = cms.untracked.double(20), - minJJMass = cms.double(-1), - isMCarlo = cms.untracked.bool(False), - useGenInfo = cms.untracked.bool(False), - ## trigger ################################### - printTriggerMenu = cms.untracked.bool(True), - processName = cms.string('HLT'), - triggerName = cms.vstring('HLT_PFJet40_v2','HLT_PFJet60_v2', 'HLT_PFJet80_v2', 'HLT_PFJet140_v2', 'HLT_PFJet200_v2', 'HLT_PFJet260_v2', - 'HLT_PFJet320_v2', 'HLT_PFJet400_v2', 'HLT_PFJet450_v2', 'HLT_PFJet500_v2' - ), - triggerResults = cms.InputTag("TriggerResults","","HLT"), - triggerEvent = cms.InputTag("hltTriggerSummaryAOD","","HLT"), - ## jec services ############################## - #pfjecService = cms.string('ak7PFL1FastL2L3Residual'), -) - - -jetToolbox( process, 'ak8', 'ak8JetSubs','CHS') -jetToolbox( process, 'ak8', 'ak8JetSubs') - -process.ak8 = process.ak4.clone( - pfjets = cms.InputTag('selectedPatJetsAK8PF'), - pfjetschs = cms.InputTag('selectedPatJetsAK8PFCHS'), - pfpujetid = cms.string('AK8PFpileupJetIdEvaluator:fullDiscriminant'), - pfchsjetpuid = cms.string('AK8PFCHSpileupJetIdEvaluator:fullDiscriminant'), - PFPayloadName = cms.string('AK8PF'), - PFPayloadNameCHS= cms.string('AK8PFchs'), -) - -jetToolbox( process, 'ak7', 'ak7JetSubs','CHS') -jetToolbox( process, 'ak7', 'ak7JetSubs') - -process.ak7 = process.ak4.clone( - pfjets = cms.InputTag('selectedPatJetsAK7PF'), - pfjetschs = cms.InputTag('selectedPatJetsAK7PFCHS'), - pfpujetid = cms.string('AK7PFpileupJetIdEvaluator:fullDiscriminant'), - pfchsjetpuid = cms.string('AK7PFCHSpileupJetIdEvaluator:fullDiscriminant'), - PFPayloadName = cms.string('AK7PF'), - PFPayloadNameCHS= cms.string('AK7PFchs'), -) - -jetToolbox( process, 'ak5', 'ak5JetSubs','CHS') -jetToolbox( process, 'ak5', 'ak5JetSubs') - -process.ak5 = process.ak4.clone( - pfjets = cms.InputTag('selectedPatJetsAK5PF'), - pfjetschs = cms.InputTag('selectedPatJetsAK5PFCHS'), - pfpujetid = cms.string('AK5PFpileupJetIdEvaluator:fullDiscriminant'), - pfchsjetpuid = cms.string('AK5PFCHSpileupJetIdEvaluator:fullDiscriminant'), - PFPayloadName = cms.string('AK5PF'), - PFPayloadNameCHS= cms.string('AK5PFchs'), -) - -############# hlt filter ######################### -process.hltFilter = cms.EDFilter('HLTHighLevel', - TriggerResultsTag = cms.InputTag('TriggerResults','','HLT'), - HLTPaths = cms.vstring('HLT_PFJet40_v2','HLT_PFJet60_v2', 'HLT_PFJet80_v2', 'HLT_PFJet140_v2', 'HLT_PFJet200_v2', 'HLT_PFJet260_v2','HLT_PFJet320_v2', 'HLT_PFJet400_v2', 'HLT_PFJet450_v2', 'HLT_PFJet500_v2'), - eventSetupPathsKey = cms.string(''), - andOr = cms.bool(True), #----- True = OR, False = AND between the HLTPaths - throw = cms.bool(False) -) - -##MET Filters -process.load('RecoMET.METFilters.CSCTightHaloFilter_cfi') -process.load('CommonTools.RecoAlgos.HBHENoiseFilterResultProducer_cfi') - -process.HBHENoiseFilterResultProducerNoMinZ = process.HBHENoiseFilterResultProducer.clone(minZeros = cms.int32(99999)) - - -process.goodVertices = cms.EDFilter("VertexSelector", - filter = cms.bool(False), - src = cms.InputTag("offlinePrimaryVertices"), - cut = cms.string("!isFake && ndof >= 4 && abs(z) <= 24 && position.rho <= 2"), -) -process.load('RecoMET.METFilters.trackingFailureFilter_cfi') - - - - -##Type1 patMET Producer -process.load('PhysicsTools.PatAlgos.recoLayer0.metCorrections_cff') -process.load('PhysicsTools.PatAlgos.producersLayer1.metProducer_cfi') -process.patMETs.addGenMET = cms.bool(False) -#Try scheduled processs -process.path = cms.Path(process.goodVertices*process.trackingFailureFilter* - process.hltFilter* - process.HBHENoiseFilterResultProducer* - process.HBHENoiseFilterResultProducerNoMinZ* - process.patMETCorrections*process.patMETs* - process.ak4 *process.ak5*process.ak7*process.ak8) - - -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -#! Output and Log -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(False) ) -process.options.allowUnscheduled = cms.untracked.bool(True) diff --git a/AnalysisFW/test/ProcessedTreeProducer_dataPFCalo_cfg.py b/AnalysisFW/test/ProcessedTreeProducer_dataPFCalo_cfg.py deleted file mode 100644 index 6a857bdfc83..00000000000 --- a/AnalysisFW/test/ProcessedTreeProducer_dataPFCalo_cfg.py +++ /dev/null @@ -1,116 +0,0 @@ -# -*- coding: utf-8 -*- -import FWCore.ParameterSet.Config as cms - -process = cms.Process("Ntuplizer") -process.load('FWCore.MessageService.MessageLogger_cfi') -##-------------------- Communicate with the DB ----------------------- -process.load('Configuration.StandardSequences.Services_cff') -process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') -process.GlobalTag.globaltag = 'MCRUN2_74_V9A::All' -process.load('Configuration.StandardSequences.MagneticField_38T_cff') -process.load('Configuration.Geometry.GeometryIdeal_cff') -process.load('RecoJets.Configuration.RecoPFJets_cff') -process.load('RecoJets.Configuration.RecoJets_cff') -process.load('CommonTools/RecoAlgos/HBHENoiseFilterResultProducer_cfi') -##-------------------- Import the JEC services ----------------------- -process.load('JetMETCorrections.Configuration.DefaultJEC_cff') -#-------- HCAL Laser Filter ------# -process.load("RecoMET.METFilters.hcalLaserEventFilter_cfi") -process.load('EventFilter.HcalRawToDigi.hcallasereventfilter2012_cfi') -#rocess.load('EventFilter.HcalRawToDigi.hcallaserhbhehffilter2012_cfi') -## The ECAL dead cell trigger primitive filter _______________________________|| -process.load('RecoMET.METFilters.EcalDeadCellTriggerPrimitiveFilter_cfi') -## The EE bad SuperCrystal filter ____________________________________________|| -process.load('RecoMET.METFilters.eeBadScFilter_cfi') -## TRACKING Filter -process.load('RecoMET.METFilters.trackingFailureFilter_cfi') -## The ECAL laser correction filter -process.load('RecoMET.METFilters.ecalLaserCorrFilter_cfi') - -############# Set the number of events ############# -process.maxEvents = cms.untracked.PSet( - input = cms.untracked.int32(-1) -) -############# Format MessageLogger ################# -process.MessageLogger.cerr.FwkReport.reportEvery = 1000 -############# Define the source file ############### -process.source = cms.Source("PoolSource", -# fileNames = cms.untracked.vstring('/store/data/Run2012C/JetHT/AOD/PromptReco-v2/000/198/941/221BEAC8-7ACF-E111-8A3D-E0CB4E4408E7.root') - #fileNames = cms.untracked.vstring('root://eoscms//eos/cms//store/data/Run2012D/SingleMu/AOD/22Jan2013-v1/20000/F893D87B-1585-E211-B143-001EC9D8D973.root') - fileNames = cms.untracked.vstring('file://./CE5DBB3C-170B-E511-A908-02163E01473C.root') - - -) -############# processed tree producer ################## -process.TFileService = cms.Service("TFileService",fileName = cms.string('DATA_ProcessedTreePFCalo.root')) - -process.ak4 = cms.EDAnalyzer('ProcessedTreeProducerPFCalo', - ## jet collections ########################### - pfjets = cms.InputTag('ak4PFJets'), - calojets = cms.InputTag('ak4CaloJets'), - ## database entry for the uncertainties ###### - #PFPayloadName = cms.string('AK4PF'), - #CaloPayloadName = cms.string('AK4Calo'), - PFPayloadName = cms.string(''), - CaloPayloadName = cms.string(''), - jecUncSrc = cms.string(''), - jecUncSrcNames = cms.vstring(''), - - ## calojet ID and extender for the JTA ####### - calojetID = cms.InputTag('ak4JetID'), - calojetExtender = cms.InputTag('ak4JetExtender'), - ## set the conditions for good Vtx counting ## - offlineVertices = cms.InputTag('offlinePrimaryVertices'), - goodVtxNdof = cms.double(4), - goodVtxZ = cms.double(24), - ## rho ####################################### - srcCaloRho = cms.InputTag('fixedGridRhoFastjetAllCalo'), - srcPFRho = cms.InputTag('fixedGridRhoFastjetAll'), - ## preselection cuts ######################### - maxY = cms.double(5.0), - minPFPt = cms.double(20), - minPFFatPt = cms.double(10), - maxPFFatEta = cms.double(2.5), - minCaloPt = cms.double(20), - minNPFJets = cms.int32(1), - minNCaloJets = cms.int32(1), - minJJMass = cms.double(-1), - ## trigger ################################### - printTriggerMenu = cms.untracked.bool(True), - processName = cms.string('HLT'), - triggerName = cms.vstring('HLT_L1SingleJet36_v1','HLT_L1SingleJet68_v1','HLT_ZeroBias_part0_v1','HLT_ZeroBias_part1_v1','HLT_ZeroBias_part3_v1','HLT_ZeroBias_part4_v1','HLT_ZeroBias_part5_v1'), - triggerResults = cms.InputTag("TriggerResults","","HLT"), - triggerEvent = cms.InputTag("hltTriggerSummaryAOD","","HLT"), - ## jec services ############################## - pfjecService = cms.string('ak4PFL1FastL2L3Residual'), - calojecService = cms.string('ak4CaloL1FastL2L3Residual') -) - -############# hlt filter ######################### -process.hltFilter = cms.EDFilter('HLTHighLevel', - TriggerResultsTag = cms.InputTag('TriggerResults','','HLT'), - HLTPaths = cms.vstring( - 'HLT_PFJet40_v*','HLT_PFJet80_v*','HLT_PFJet140_v*','HLT_PFJet200_v*','HLT_PFJet260_v*','HLT_PFJet320_v*','HLT_PFJet400_v*', 'HLT_IsoMu24_eta2p1_v*' - ), - eventSetupPathsKey = cms.string(''), - andOr = cms.bool(True), #----- True = OR, False = AND between the HLTPaths - throw = cms.bool(False) -) - -process.hltMuFilter = cms.EDFilter('HLTHighLevel', - TriggerResultsTag = cms.InputTag('TriggerResults','','HLT'), - HLTPaths = cms.vstring( - 'HLT_IsoMu24_eta2p1_v*' - ), - eventSetupPathsKey = cms.string(''), - andOr = cms.bool(True), #----- True = OR, False = AND between the HLTPaths - throw = cms.bool(False) -) - - - -#process.path = cms.Path(process.hltFilter * process.HBHENoiseFilterResultProducer * process.hcalLaserEventFilter * -#process.hcallasereventfilter2012 * #process.hcallaserhbhehffilter2012 * -#process.EcalDeadCellTriggerPrimitiveFilter * process.eeBadScFilter process.ak4) -process.path = cms.Path(process.HBHENoiseFilterResultProducer*process.EcalDeadCellTriggerPrimitiveFilter * process.eeBadScFilter *process.ak4) - diff --git a/AnalysisFW/test/ProcessedTreeProducer_data_cfg.py b/AnalysisFW/test/ProcessedTreeProducer_data_cfg.py deleted file mode 100644 index c1787fda765..00000000000 --- a/AnalysisFW/test/ProcessedTreeProducer_data_cfg.py +++ /dev/null @@ -1,137 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -process = cms.Process("Ana") -process.load('FWCore.MessageService.MessageLogger_cfi') -##-------------------- Communicate with the DB ----------------------- -process.load('Configuration.StandardSequences.Services_cff') -process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') -process.GlobalTag.globaltag = 'FT_53_V21_AN6::All' -process.load('Configuration.StandardSequences.MagneticField_38T_cff') -process.load('Configuration.Geometry.GeometryIdeal_cff') -process.load('RecoJets.Configuration.RecoPFJets_cff') -process.load('RecoJets.Configuration.RecoJets_cff') -process.load('CommonTools/RecoAlgos/HBHENoiseFilterResultProducer_cfi') -##-------------------- Import the JEC services ----------------------- -process.load('JetMETCorrections.Configuration.DefaultJEC_cff') -#-------- HCAL Laser Filter ------# -process.load("RecoMET.METFilters.hcalLaserEventFilter_cfi") -process.load('EventFilter.HcalRawToDigi.hcallasereventfilter2012_cfi') -#process.load('EventFilter.HcalRawToDigi.hcallaserhbhehffilter2012_cfi') -## The ECAL dead cell trigger primitive filter _______________________________|| -process.load('RecoMET.METFilters.EcalDeadCellTriggerPrimitiveFilter_cfi') -## The EE bad SuperCrystal filter ____________________________________________|| -process.load('RecoMET.METFilters.eeBadScFilter_cfi') -## TRACKING Filter -process.load('RecoMET.METFilters.trackingFailureFilter_cfi') -## The ECAL laser correction filter -process.load('RecoMET.METFilters.ecalLaserCorrFilter_cfi') - -############# Set the number of events ############# -process.maxEvents = cms.untracked.PSet( - input = cms.untracked.int32(-1) -) -############# Format MessageLogger ################# -process.MessageLogger.cerr.FwkReport.reportEvery = 10 -############# Define the source file ############### -process.source = cms.Source("PoolSource", -# fileNames = cms.untracked.vstring('/store/data/Run2012C/JetHT/AOD/PromptReco-v2/000/198/941/221BEAC8-7ACF-E111-8A3D-E0CB4E4408E7.root') - fileNames = cms.untracked.vstring('root://eoscms//eos/cms//store/data/Run2012D/SingleMu/AOD/22Jan2013-v1/20000/F893D87B-1585-E211-B143-001EC9D8D973.root') -) -############# processed tree producer ################## -process.TFileService = cms.Service("TFileService",fileName = cms.string('ProcessedTree_data.root')) - -process.ak7 = cms.EDAnalyzer('ProcessedTreeProducer', - ## jet collections ########################### - pfjets = cms.InputTag('ak7PFJets'), - calojets = cms.InputTag('ak7CaloJets'), - ## database entry for the uncertainties ###### - PFPayloadName = cms.string('AK7PF'), - CaloPayloadName = cms.string('AK7Calo'), - jecUncSrc = cms.string('Summer13_V4_DATA_UncertaintySources_AK7PF.txt'), - jecUncSrcNames = cms.vstring('Absolute','HighPtExtra','SinglePionECAL','SinglePionHCAL','FlavorQCD', - 'Time','RelativeJEREC1','RelativeJEREC2','RelativeJERHF','RelativePtBB', - 'RelativePtEC1','RelativePtEC2','RelativePtHF','RelativeFSR','RelativeStatEC2', - 'RelativeStatHF','PileUpDataMC','PileUpPtBB','PileUpPtEC','PileUpPtHF','PileUpBias', - 'SubTotalPileUp','SubTotalRelative','SubTotalPt','SubTotalMC','Total','TotalNoFlavor', - 'FlavorZJet','FlavorPhotonJet','FlavorPureGluon','FlavorPureQuark','FlavorPureCharm', - 'FlavorPureBottom'), - - ## calojet ID and extender for the JTA ####### - calojetID = cms.InputTag('ak7JetID'), - calojetExtender = cms.InputTag('ak7JetExtender'), - ## set the conditions for good Vtx counting ## - offlineVertices = cms.InputTag('offlinePrimaryVertices'), - goodVtxNdof = cms.double(4), - goodVtxZ = cms.double(24), - ## rho ####################################### - srcCaloRho = cms.InputTag('kt6CaloJets','rho'), - srcPFRho = cms.InputTag('kt6PFJets','rho'), - ## preselection cuts ######################### - maxY = cms.double(5.0), - minPFPt = cms.double(20), - minPFFatPt = cms.double(10), - maxPFFatEta = cms.double(2.5), - minCaloPt = cms.double(20), - minNPFJets = cms.int32(1), - minNCaloJets = cms.int32(1), - minJJMass = cms.double(-1), - ## trigger ################################### - printTriggerMenu = cms.untracked.bool(True), - processName = cms.string('HLT'), - triggerName = cms.vstring('HLT_PFJet40_v3','HLT_PFJet40_v4','HLT_PFJet40_v5','HLT_PFJet40_v6','HLT_PFJet40_v7','HLT_PFJet40_v8','HLT_PFJet40_v9', - 'HLT_PFJet80_v3','HLT_PFJet80_v4','HLT_PFJet80_v5','HLT_PFJet80_v6','HLT_PFJet80_v7','HLT_PFJet80_v8','HLT_PFJet80_v9', - 'HLT_PFJet140_v3','HLT_PFJet140_v4','HLT_PFJet140_v5','HLT_PFJet140_v6','HLT_PFJet140_v7','HLT_PFJet140_v8','HLT_PFJet140_v9', - 'HLT_PFJet200_v3','HLT_PFJet200_v4','HLT_PFJet200_v5','HLT_PFJet200_v6','HLT_PFJet200_v7','HLT_PFJet200_v8','HLT_PFJet200_v9', - 'HLT_PFJet260_v3','HLT_PFJet260_v4','HLT_PFJet260_v5','HLT_PFJet260_v6','HLT_PFJet260_v7','HLT_PFJet260_v8','HLT_PFJet260_v9', - 'HLT_PFJet320_v3','HLT_PFJet320_v4','HLT_PFJet320_v5','HLT_PFJet320_v6','HLT_PFJet320_v7','HLT_PFJet320_v8','HLT_PFJet320_v9', - 'HLT_PFJet400_v3','HLT_PFJet400_v4','HLT_PFJet400_v5','HLT_PFJet400_v6','HLT_PFJet400_v7','HLT_PFJet400_v8','HLT_PFJet400_v9', - 'HLT_IsoMu24_eta2p1_v11', 'HLT_IsoMu24_eta2p1_v12', 'HLT_IsoMu24_eta2p1_v13', 'HLT_IsoMu24_eta2p1_v14', 'HLT_IsoMu24_eta2p1_v15' - ), - triggerResults = cms.InputTag("TriggerResults","","HLT"), - triggerEvent = cms.InputTag("hltTriggerSummaryAOD","","HLT"), - ## jec services ############################## - pfjecService = cms.string('ak7PFL1FastL2L3Residual'), - calojecService = cms.string('ak7CaloL1FastL2L3Residual') -) - -process.ak5 = process.ak7.clone( - pfjets = 'ak5PFJets', - calojets = 'ak5CaloJets', - PFPayloadName = 'AK5PF', - CaloPayloadName = 'AK5Calo', - jecUncSrc = 'Summer13_V4_DATA_UncertaintySources_AK5PF.txt', - calojetID = 'ak5JetID', - calojetExtender = 'ak5JetExtender', - pfjecService = 'ak5PFL1FastL2L3Residual', - calojecService = 'ak5CaloL1FastL2L3Residual', - printTriggerMenu = False -) - -############# hlt filter ######################### -process.hltFilter = cms.EDFilter('HLTHighLevel', - TriggerResultsTag = cms.InputTag('TriggerResults','','HLT'), - HLTPaths = cms.vstring( - 'HLT_PFJet40_v*','HLT_PFJet80_v*','HLT_PFJet140_v*','HLT_PFJet200_v*','HLT_PFJet260_v*','HLT_PFJet320_v*','HLT_PFJet400_v*', 'HLT_IsoMu24_eta2p1_v*' - ), - eventSetupPathsKey = cms.string(''), - andOr = cms.bool(True), #----- True = OR, False = AND between the HLTPaths - throw = cms.bool(False) -) - -process.hltMuFilter = cms.EDFilter('HLTHighLevel', - TriggerResultsTag = cms.InputTag('TriggerResults','','HLT'), - HLTPaths = cms.vstring( - 'HLT_IsoMu24_eta2p1_v*' - ), - eventSetupPathsKey = cms.string(''), - andOr = cms.bool(True), #----- True = OR, False = AND between the HLTPaths - throw = cms.bool(False) -) - - - -process.path = cms.Path(process.hltFilter * process.HBHENoiseFilterResultProducer * process.hcalLaserEventFilter * -process.hcallasereventfilter2012 * #process.hcallaserhbhehffilter2012 * -process.EcalDeadCellTriggerPrimitiveFilter * process.eeBadScFilter * process.ak5 * process.ak7) - - diff --git a/AnalysisFW/test/ProcessedTreeProducer_mcPAT_SQLite_cfg.py b/AnalysisFW/test/ProcessedTreeProducer_mcPAT_SQLite_cfg.py deleted file mode 100644 index 72da2e4abe2..00000000000 --- a/AnalysisFW/test/ProcessedTreeProducer_mcPAT_SQLite_cfg.py +++ /dev/null @@ -1,349 +0,0 @@ -## import skeleton process -from PhysicsTools.PatAlgos.patTemplate_cfg import * - -runOnMC = True - -process.source.fileNames = [ - "root://eoscms//eos/cms/store/mc/Summer12/DYJetsToLL_M-50_TuneZ2Star_8TeV-madgraph-tarball/AODSIM/TestGED_START53_V6-v1/0000/CC17C457-89AC-E111-A4EC-002481E15070.root" - ] - - -if runOnMC: - process.GlobalTag.globaltag = cms.string('START53_V27::All') -else: - process.GlobalTag.globaltag = cms.string('FT53_V21A_AN6::All') - - -### ----------------------------- loading for the sqlite file ------------------------- #### -process.load("CondCore.DBCommon.CondDBCommon_cfi") -from CondCore.DBCommon.CondDBSetup_cfi import * -process.jec = cms.ESSource("PoolDBESSource", - DBParameters = cms.PSet( - messageLevel = cms.untracked.int32(0) - ), - timetype = cms.string('runnumber'), - toGet = cms.VPSet( - cms.PSet( - record = cms.string('JetCorrectionsRecord'), - tag = cms.string('JetCorrectorParametersCollection_Winter14_V5_MC_AK5PFchs'), - # tag = cms.string('JetCorrectorParametersCollection_Summer12_V7_MC_AK5PF'), - label = cms.untracked.string('AK5PFchs') - ), - cms.PSet( - record = cms.string('JetCorrectionsRecord'), - tag = cms.string('JetCorrectorParametersCollection_Winter14_V5_MC_AK7PFchs'), - # tag = cms.string('JetCorrectorParametersCollection_Summer12_V7_MC_AK7PF'), - label = cms.untracked.string('AK7PFchs') - ), - cms.PSet( - record = cms.string('JetCorrectionsRecord'), - tag = cms.string('JetCorrectorParametersCollection_Winter14_V5_MC_AK5PF'), - # tag = cms.string('JetCorrectorParametersCollection_Summer12_V7_MC_AK5PF'), - label = cms.untracked.string('AK5PF') - ), - cms.PSet( - record = cms.string('JetCorrectionsRecord'), - tag = cms.string('JetCorrectorParametersCollection_Winter14_V5_MC_AK7PF'), - # tag = cms.string('JetCorrectorParametersCollection_Summer12_V7_MC_AK7PF'), - label = cms.untracked.string('AK7PF') - ), - cms.PSet( - record = cms.string('JetCorrectionsRecord'), - tag = cms.string('JetCorrectorParametersCollection_Winter14_V5_MC_AK5Calo'), - # tag = cms.string('JetCorrectorParametersCollection_Summer12_V7_MC_AK5Calo'), - label = cms.untracked.string('AK5Calo') - ), - cms.PSet( - record = cms.string('JetCorrectionsRecord'), - tag = cms.string('JetCorrectorParametersCollection_Winter14_V5_MC_AK7Calo'), - # tag = cms.string('JetCorrectorParametersCollection_Summer12_V7_MC_AK7Calo'), - label = cms.untracked.string('AK7Calo') - ), - #.................................................. - ## here you add as many jet types as you need - ## note that the tag name is specific for the particular sqlite file - ), - connect = cms.string('sqlite:Winter14_V5_MC.db') - # uncomment above tag lines and this comment to use MC JEC - # connect = cms.string('sqlite:Summer12_V7_MC.db') -) -## add an es_prefer statement to resolve a possible conflict from simultaneous connection to a global tag -process.es_prefer_jec = cms.ESPrefer('PoolDBESSource','jec') - - -##--------------------- ******************************************************************** --------------------------- ## - - -# load the PAT config -process.load("RecoTauTag.Configuration.RecoPFTauTag_cff") # re-run tau discriminators (new version) -process.load("PhysicsTools.PatAlgos.patSequences_cff") -process.load('Configuration.StandardSequences.Reconstruction_cff') -process.load('RecoJets.Configuration.RecoPFJets_cff') -process.load('RecoJets.Configuration.RecoJets_cff') -process.load('RecoJets.JetProducers.TrackJetParameters_cfi') -process.load('JetMETCorrections.Configuration.DefaultJEC_cff') -process.load('CommonTools.RecoAlgos.HBHENoiseFilterResultProducer_cfi') - - -# Configure PAT to use PF2PAT instead of AOD sources -# this function will modify the PAT sequences. -from PhysicsTools.PatAlgos.tools.pfTools import * -from PhysicsTools.PatAlgos.tools.coreTools import * -from PhysicsTools.PatAlgos.tools.metTools import * -from PhysicsTools.PatAlgos.tools.jetTools import * -from PhysicsTools.PatAlgos.tools.coreTools import * -from PhysicsTools.SelectorUtils.pvSelector_cfi import pvSelector - - -##--------- good primary vertices --------------- -#process.goodOfflinePrimaryVertices = cms.EDFilter( -# "PrimaryVertexObjectFilter", -# filterParams = pvSelector.clone( minNdof = cms.double(4.0), maxZ = cms.double(24.0) ), -# src=cms.InputTag('offlinePrimaryVertices') -# ) - -process.goodOfflinePrimaryVertices = cms.EDFilter( - "VertexSelector", - filter = cms.bool(False), - src = cms.InputTag("offlinePrimaryVertices"), - cut = cms.string("!isFake && ndof > 4 && abs(z) <= 24 && position.rho < 2") - ) - - -process.ak5PFJets.doAreaFastjet = True -process.ak7PFJets.doAreaFastjet = True -process.kt6PFJets.doRhoFastjet = True - - - -# Configure PAT to use PF2PAT instead of AOD sources -# this function will modify the PAT sequences. -from PhysicsTools.PatAlgos.tools.pfTools import * - -# An empty postfix means that only PF2PAT is run, -# otherwise both standard PAT and PF2PAT are run. In the latter case PF2PAT -# collections have standard names + postfix (e.g. patElectronPFlow) -postfix = "CHS" -jetAlgo = "AK5" -#usePF2PAT(process,runPF2PAT=True, jetAlgo=jetAlgo, runOnMC=runOnMC, postfix=postfix) -usePF2PAT(process,runPF2PAT=True, jetAlgo=jetAlgo, runOnMC=runOnMC, postfix=postfix, - jetCorrections=('AK5PFchs', ['L1FastJet','L2Relative','L3Absolute']), - pvCollection=cms.InputTag('goodOfflinePrimaryVertices'), - typeIMetCorrections=True - ) -process.pfPileUpCHS.checkClosestZVertex = False -process.pfPileUpCHS.Enable = True -process.pfPileUpCHS.Vertices = cms.InputTag('goodOfflinePrimaryVertices') -process.pfJetsCHS.doAreaFastjet = True -process.pfJetsCHS.doRhoFastjet = False - - - -process.kt6PFJetsCHS = process.kt6PFJets.clone( - src = cms.InputTag('pfNoElectron'+postfix), - doAreaFastjet = cms.bool(True), - doRhoFastjet = cms.bool(True) - ) - -process.kt6PFJetsISO = process.kt6PFJets.clone( - Rho_EtaMax = cms.double(2.4) - ) - -getattr(process,"patPF2PATSequence"+postfix).replace( - getattr(process,"pfNoElectron"+postfix), - getattr(process,"pfNoElectron"+postfix)*process.kt6PFJetsCHS) - - -#----- recommendation from JES: use the standard rho for CHS ------ -#process.patJetCorrFactorsCHS.rho = cms.InputTag("kt6PFJetsCHS", "rho") - - -#------------- Running a second PF2PAT for Ak7chs jets ----------------# -postfix2 = "CHS7" -jetAlgo2 = "AK7" -usePF2PAT(process,runPF2PAT=True, jetAlgo=jetAlgo2, runOnMC=runOnMC, postfix=postfix2, - jetCorrections=('AK7PFchs', ['L1FastJet','L2Relative','L3Absolute']), - pvCollection=cms.InputTag('goodOfflinePrimaryVertices'), - typeIMetCorrections=True - ) - -# --- modifying the pfpileup+postfix2 -------------------- # -process.pfPileUpCHS7.checkClosestZVertex = False -process.pfPileUpCHS7.Enable = True -process.pfPileUpCHS7.Vertices = cms.InputTag('goodOfflinePrimaryVertices') -process.pfJetsCHS7.doAreaFastjet = True -process.pfJetsCHS7.doRhoFastjet = False - -process.ak5PFJets.doAreaFastjet = True -process.ak7PFJets.doAreaFastjet = True -process.kt6PFJets.doRhoFastjet = True - -#----- recommendation from JES: use the standard rho for CHS ------ -#process.patJetCorrFactorsCHS7.rho = cms.InputTag("kt6PFJetsCHS", "rho") - -# to use tau-cleaned jet collection uncomment the following: -getattr(process,"pfNoTau"+postfix).enable = True -getattr(process,"pfNoTau"+postfix2).enable = True - -#------ removing the MC matching and let it run -------# -if not runOnMC: - removeMCMatchingPF2PAT( process, '' ) - runOnData(process) - - -# ------------- Adding Ak5 and Ak7 jet collection to process ------------- # -addPfMET(process, 'PF') -# ------- Adding non CHS jets to process ------// -addJetCollection(process,cms.InputTag('ak5PFJets'), - 'AK5', 'PFCorr', - doJTA = True, - doBTagging = False, - jetCorrLabel = ('AK5PF', cms.vstring(['L1FastJet','L2Relative','L3Absolute'])), - doType1MET = True, - doL1Cleaning = True, - doL1Counters = False, - genJetCollection=cms.InputTag("ak5GenJets"), - doJetID = True, - jetIdLabel = "ak5" - ) - -addJetCollection(process,cms.InputTag('ak7PFJets'), - 'AK7', 'PFCorr', - doJTA = True, - doBTagging = False, - jetCorrLabel = ('AK7PF', cms.vstring(['L1FastJet','L2Relative','L3Absolute'])), - doType1MET = True, - doL1Cleaning = True, - doL1Counters = False, - genJetCollection=cms.InputTag("ak7GenJets"), - doJetID = True, - jetIdLabel = "ak7" - ) - -#process.patJetCorrFactorsAK5PFcorr.primaryVertices = cms.InputTag('goodOfflinePrimaryVertices') -#process.patJetCorrFactorsAK5PFcorr.rho = cms.InputTag("kt6PFJetsCHS", "rho") -#for icorr in [process.patJetCorrFactorsAK5PFcorr, -# process.patJetCorrFactorsAK7PFcorr -# ] : -# icorr.rho = cms.InputTag("kt6PFJets", "rho") -# icorr.primaryVertices = cms.InputTag('goodOfflinePrimaryVertices') - - - - - -################### declaring the EDAnalyzer ##############################3 - -process.ak7 = cms.EDAnalyzer('ProcessedTreeProducer', - ## jet collections ########################### - pfjets = cms.InputTag('selectedPatJetsAK7PFCorr'), - pfjetschs = cms.InputTag('selectedPatJetsCHS7'), - genjets = cms.untracked.InputTag('ak7GenJets'), - ## MET collection #### - pfmet = cms.InputTag('pfMETCHS7'), - ## database entry for the uncertainties ###### - PFPayloadName = cms.string(''), - PFPayloadNameCHS= cms.string(''), - CaloPayloadName = cms.string(''), - jecUncSrc = cms.string(''), - jecUncSrcCHS = cms.string(''), - jecUncSrcNames = cms.vstring(''), - srcPU = cms.untracked.InputTag('addPileupInfo'), - ## set the conditions for good Vtx counting ## - offlineVertices = cms.InputTag('goodOfflinePrimaryVertices'), - goodVtxNdof = cms.double(4), - goodVtxZ = cms.double(24), - ## rho ####################################### - srcCaloRho = cms.InputTag('kt6CaloJets','rho'), - srcPFRho = cms.InputTag('kt6PFJets','rho'), - ## preselection cuts ######################### - maxY = cms.double(5.0), - minPFPt = cms.double(20), - minPFFatPt = cms.double(10), - maxPFFatEta = cms.double(2.5), - minNPFJets = cms.int32(1), - minJJMass = cms.double(-1), - isMCarlo = cms.untracked.bool(runOnMC), - useGenInfo = cms.untracked.bool(True), - ## trigger ################################### - printTriggerMenu = cms.untracked.bool(True), - processName = cms.string('HLT'), - triggerName = cms.vstring('HLT_PFJet40_v3','HLT_PFJet40_v4','HLT_PFJet40_v5','HLT_PFJet40_v6','HLT_PFJet40_v7','HLT_PFJet40_v8','HLT_PFJet40_v9' - # 'HLT_IsoMu24_eta2p1_v11', 'HLT_IsoMu24_eta2p1_v12', 'HLT_IsoMu24_eta2p1_v13', 'HLT_IsoMu24_eta2p1_v14', 'HLT_IsoMu24_eta2p1_v15' - ), - triggerResults = cms.InputTag("TriggerResults","","HLT"), - triggerEvent = cms.InputTag("hltTriggerSummaryAOD","","HLT"), - ## jec services ############################## - #pfjecService = cms.string('ak7PFL1FastL2L3Residual'), - #calojecService = cms.string('ak7CaloL1FastL2L3Residual') -) - -process.ak5 = process.ak7.clone( - - ## jet collections ########################### - pfjets = cms.InputTag('selectedPatJetsAK5PFCorr'), - pfjetschs = cms.InputTag('selectedPatJetsCHS'), - genjets = cms.untracked.InputTag('ak5GenJets'), - ## MET collection #### - pfmet = cms.InputTag('pfMETCHS'), - ## database entry for the uncertainties ###### - printTriggerMenu = False -) - - - - -# Let it run -process.p = cms.Path( - process.goodOfflinePrimaryVertices* - process.patDefaultSequence * - getattr(process,"patPF2PATSequence"+postfix) * - getattr(process,"patPF2PATSequence"+postfix2) * - process.ak5 * - process.ak7 -# second PF2PAT -# + getattr(process,"patPF2PATSequence"+postfix2) -) -#if not postfix == "": -# process.p += process.recoTauClassicHPSSequence # re-run tau discriminators (new version) -# process.p += process.patDefaultSequence - -# Add PF2PAT output to the created file -#from PhysicsTools.PatAlgos.patEventContent_cff import patEventContentNoCleaning -#process.out.outputCommands = cms.untracked.vstring('drop *', -# 'keep recoPFCandidates_particleFlow_*_*', -# *patEventContentNoCleaning ) - - -# top projections in PF2PAT: -getattr(process,"pfNoPileUp"+postfix).enable = True -getattr(process,"pfNoMuon"+postfix).enable = True -getattr(process,"pfNoElectron"+postfix).enable = True -getattr(process,"pfNoTau"+postfix).enable = False -getattr(process,"pfNoJet"+postfix).enable = True - -# verbose flags for the PF2PAT modules -getattr(process,"pfNoMuon"+postfix).verbose = False - -## ------------------------------------------------------ -# In addition you usually want to change the following -# parameters: -## ------------------------------------------------------ -# -# process.GlobalTag.globaltag = ... ## (according to https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideFrontierConditions) -# ## -# process.source.fileNames = ... ## (e.g. 'file:AOD.root') -# ## -process.maxEvents.input = 1000 -# -process.MessageLogger.cerr.FwkReport.reportEvery = 100 ## -# process.out.outputCommands = [ ... ] ## (e.g. taken from PhysicsTools/PatAlgos/python/patEventContent_cff.py) -# -############# processed tree producer ################## -process.TFileService = cms.Service("TFileService",fileName = cms.string('ProcessedTree_mc.root')) - -#process.out.fileName = 'patTuple_PATandPF2PAT.root' -# ## -process.options.wantSummary = False ## (to suppress the long output at the end of the job) - -del process.outpath diff --git a/AnalysisFW/test/ProcessedTreeProducer_mcPAT_cfg.py b/AnalysisFW/test/ProcessedTreeProducer_mcPAT_cfg.py deleted file mode 100644 index 9b67d03051d..00000000000 --- a/AnalysisFW/test/ProcessedTreeProducer_mcPAT_cfg.py +++ /dev/null @@ -1,285 +0,0 @@ -# -*- coding: utf-8 -*- - -import FWCore.ParameterSet.Config as cms - -import FWCore.ParameterSet.Config as cms - -from RecoJets.Configuration.RecoPFJets_cff import ak4PFJets, ak4PFJetsCHS -from RecoJets.Configuration.RecoGenJets_cff import ak4GenJets -from RecoJets.JetProducers.SubJetParameters_cfi import SubJetParameters -from RecoJets.JetProducers.PFJetParameters_cfi import * -from RecoJets.JetProducers.GenJetParameters_cfi import * -from RecoJets.JetProducers.AnomalousCellParameters_cfi import * -from PhysicsTools.PatAlgos.producersLayer1.patCandidates_cff import * -from PhysicsTools.PatAlgos.selectionLayer1.jetSelector_cfi import selectedPatJets -from PhysicsTools.PatAlgos.tools.jetTools import * -from PhysicsTools.PatAlgos.producersLayer1.metProducer_cfi import patMETs -from PhysicsTools.PatAlgos.patSequences_cff import * -from PhysicsTools.PatAlgos.tools.metTools import * -from RecoJets.JetProducers.pileupjetidproducer_cfi import * - - - -## Modified version of jetToolBox from https://github.com/cms-jet/jetToolbox -## Options for PUMethod: Puppi, CS, SK, CHS -def jetToolbox( proc, jetType, jetSequence,PUMethod=''): - - JETCorrPayload='None' - JETCorrLevels = [ 'None' ] - #JECLevels = [ 'L1Offset', 'L1FastJet', 'L1JPTOffset', 'L2Relative', 'L3Absolute', 'L5Falvour', 'L7Parton' ] - - algorithm='AntiKt' # CambridgeAachen' , 'Kt' - size = jetType[-1:] #[-1:] takes the last char from string 'akX' - jetSize = float('0.'+jetType[-1:]) - jetALGO = jetType.upper() - jetalgo = jetType.lower() - elemToKeep = [] - - print 'Running processes with: '+str(jetALGO)+' PF '+PUMethod+' jet algorithm with radius parameter '+str(jetSize) - - JETCorrPayload = 'AK'+size+'PFchs' - JETCorrLevels = ['L1FastJet', 'L2Relative', 'L3Absolute'] - #JETCorrLevels = [] #No JEC corrections - JEC = ( JETCorrPayload, JETCorrLevels , 'None') - - - ################################################################################# - ####### Toolbox start - ################################################################################# - - elemToKeep = [] - jetSeq = cms.Sequence() - genParticlesLabel = '' - pvLabel = '' - tvLabel = '' - toolsUsed = [] - - proc.load('RecoJets.Configuration.GenJetParticles_cff') - setattr( proc, jetalgo+'GenJetsNoNu', ak4GenJets.clone( src = 'genParticlesForJetsNoNu', rParam = jetSize, jetAlgorithm = algorithm ) ) - jetSeq += getattr(proc, jetalgo+'GenJetsNoNu' ) - - proc.load('CommonTools.ParticleFlow.pfNoPileUpJME_cff') - #### Creating PATjets - if( PUMethod=='CHS') : - setattr( proc, jetalgo+'PFJetsCHS', ak4PFJets.clone( rParam = jetSize, jetAlgorithm = algorithm ) ) - jetSeq += getattr(proc, jetalgo+'PFJetsCHS' ) - - setattr( proc, jetalgo+'PFJetsCHS', - ak4PFJetsCHS.clone( - doAreaFastjet = True, - rParam = jetSize, - jetAlgorithm = algorithm ) ) - jetSeq += getattr(proc, jetalgo+'PFJetsCHS' ) - - else : - setattr( proc, jetalgo+'PFJets', ak4PFJets.clone( rParam = jetSize, jetAlgorithm = algorithm ) ) - jetSeq += getattr(proc, jetalgo+'PFJets' ) - - setattr( proc, jetalgo+'PFJets', - ak4PFJets.clone( - doAreaFastjet = True, - rParam = jetSize, - jetAlgorithm = algorithm ) ) - jetSeq += getattr(proc, jetalgo+'PFJets' ) - PUMethod='' - - - addJetCollection( - proc, - labelName = jetALGO+'PF'+PUMethod, - jetSource = cms.InputTag( jetalgo+'PFJets'+PUMethod), - algo = jetalgo, - rParam = jetSize, - jetCorrections = JEC, #( 'AK'+size+'PFchs', cms.vstring( ['L1FastJet', 'L2Relative', 'L3Absolute']), 'None'), - pfCandidates = cms.InputTag( 'particleFlow' ), #'packedPFCandidates'), - svSource = cms.InputTag('slimmedSecondaryVertices'), - genJetCollection = cms.InputTag( jetalgo+'GenJetsNoNu'), - pvSource = cms.InputTag( 'offlinePrimaryVertices' ), #'offlineSlimmedPrimaryVertices'), - jetTrackAssociation = True, - - ) - - setattr( proc, jetALGO+'PF'+PUMethod+'pileupJetIdCalculator', - pileupJetIdCalculator.clone( - jets = cms.InputTag(jetalgo+'PFJets'+PUMethod), - rho = cms.InputTag("fixedGridRhoFastjetAll"), - vertexes = cms.InputTag('offlinePrimaryVertices') - - )) - - setattr( proc, jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator', - pileupJetIdEvaluator.clone( - jetids = cms.InputTag(jetALGO+'PF'+PUMethod+'pileupJetIdCalculator'), - jets = cms.InputTag(jetalgo+'PFJets'+PUMethod), - rho = cms.InputTag("fixedGridRhoFastjetAll"), - vertexes = cms.InputTag('offlinePrimaryVertices') - ) - ) - - getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod).userData.userFloats.src += [jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator:fullDiscriminant'] - getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod).userData.userInts.src += [jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator:cutbasedId',jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator:fullId'] - - getattr(proc,'patJetPartons').particles = cms.InputTag( 'genParticles' ) #'prunedGenParticles') - setattr(proc, 'selectedPatJets'+jetALGO+'PF'+PUMethod, selectedPatJets.clone( src = 'patJets'+jetALGO+'PF'+PUMethod ) ) - setattr(proc, jetSequence, jetSeq) - - - - -# -*- coding: utf-8 -*- -import FWCore.ParameterSet.Config as cms - - - -process = cms.Process("Ntuplizer") -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -#! Conditions -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") -process.load("Configuration.EventContent.EventContent_cff") -process.load('Configuration.StandardSequences.Geometry_cff') -process.load('Configuration.StandardSequences.MagneticField_38T_cff') -process.load('RecoJets.Configuration.GenJetParticles_cff') -process.load('RecoJets.Configuration.RecoGenJets_cff') -process.load('RecoJets.JetProducers.TrackJetParameters_cfi') -process.load('RecoJets.JetProducers.PileupJetIDParams_cfi') - -process.load("PhysicsTools.PatAlgos.slimming.pileupJetId_cfi") - -#process.GlobalTag.globaltag = "PHYS14_25_V2::All" #Mad - -process.GlobalTag.globaltag = "MCRUN2_74_V9A::All" #Pythia - - - -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -#! Input -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -inFiles = cms.untracked.vstring( -#'file:///mnt/storage/gflouris/08C07BB6-376F-E411-BE9F-C4346BC7EE18.root' #Madgraph PHYS14 -'file://./2430A1EC-00FA-E411-8641-0025905A7786.root' #Pythia -#'file:///afs/cern.ch/work/g/gflouris/public/SMPJ_AnalysisFW/08C07BB6-376F-E411-BE9F-C4346BC7EE18.root' - ) -process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(200)) -process.source = cms.Source("PoolSource", fileNames = inFiles ) - - -jetToolbox( process, 'ak4', 'ak4JetSubs') -jetToolbox( process, 'ak4', 'ak4JetSubs','CHS') - - -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -#! Services -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -process.load('FWCore.MessageLogger.MessageLogger_cfi') -process.MessageLogger.cerr.FwkReport.reportEvery = 100 -process.load('CommonTools.UtilAlgos.TFileService_cfi') -process.TFileService.fileName=cms.string('MC_ProcessedTreeProducer_2.root') - - -process.load("PhysicsTools.PatAlgos.producersLayer1.patCandidates_cff") -process.load("PhysicsTools.PatAlgos.selectionLayer1.selectedPatCandidates_cff") - -addMETCollection(process,'patMETPF','pfMetT1') - -process.ak4 = cms.EDAnalyzer('ProcessedTreeProducer', - ## jet collections ########################### - pfjets = cms.InputTag('selectedPatJetsAK4PF'), - pfjetschs = cms.InputTag('selectedPatJetsAK4PFCHS'), - pfpujetid = cms.string('AK4PFpileupJetIdEvaluator:fullDiscriminant'), - pfchsjetpuid = cms.string('AK4PFCHSpileupJetIdEvaluator:fullDiscriminant'), - ## MET collection #### - pfmet = cms.InputTag('patMETs'), - genjets = cms.untracked.InputTag('ak4GenJetsNoNu'), - ## database entry for the uncertainties ###### - PFPayloadName = cms.string(''), - PFPayloadNameCHS= cms.string(''), - jecUncSrc = cms.string(''), - jecUncSrcCHS = cms.string(''), - jecUncSrcNames = cms.vstring(''), - ## set the conditions for good Vtx counting ## - offlineVertices = cms.InputTag('offlinePrimaryVertices'), - goodVtxNdof = cms.double(4), - goodVtxZ = cms.double(24), - ## rho ####################################### - srcCaloRho = cms.InputTag('fixedGridRhoFastjetAllCalo'), - srcPFRho = cms.InputTag('fixedGridRhoFastjetAll'), - srcPU = cms.untracked.InputTag('addPileupInfo'), - ## preselection cuts ######################### - maxY = cms.double(5.0), - minPFPt = cms.double(20), - minNPFJets = cms.int32(1), - minGenPt = cms.untracked.double(20), - minJJMass = cms.double(-1), - isMCarlo = cms.untracked.bool(True), - useGenInfo = cms.untracked.bool(True), - ## trigger ################################### - printTriggerMenu = cms.untracked.bool(True), - processName = cms.string('HLT'), - triggerName = cms.vstring('HLT_PFJet40_v1','HLT_PFJet60_v1', 'HLT_PFJet80_v1', 'HLT_PFJet140_v1', 'HLT_PFJet200_v1', 'HLT_PFJet260_v1', - 'HLT_PFJet320_v1', 'HLT_PFJet400_v1', 'HLT_PFJet450_v1', 'HLT_PFJet500_v1' - ), - triggerResults = cms.InputTag("TriggerResults","","HLT"), - triggerEvent = cms.InputTag("hltTriggerSummaryAOD","","HLT"), - ## jec services ############################## - #pfjecService = cms.string('ak7PFL1FastL2L3Residual'), -) - - -jetToolbox( process, 'ak8', 'ak8JetSubs','CHS') -jetToolbox( process, 'ak8', 'ak8JetSubs') - -process.ak8 = process.ak4.clone( - pfjets = cms.InputTag('selectedPatJetsAK8PF'), - pfjetschs = cms.InputTag('selectedPatJetsAK8PFCHS'), - pfpujetid = cms.string('AK8PFpileupJetIdEvaluator:fullDiscriminant'), - pfchsjetpuid = cms.string('AK8PFCHSpileupJetIdEvaluator:fullDiscriminant'), - - ## MET collection #### - pfmet = cms.InputTag('patMETs'), - genjets = cms.untracked.InputTag('ak8GenJets'), -) - -jetToolbox( process, 'ak7', 'ak5JetSubs','CHS') -jetToolbox( process, 'ak7', 'ak7JetSubs') - -process.ak7GenJets = process.ak5GenJets.clone() -process.ak7GenJets.rParam = cms.double(0.7) - -process.ak7 = process.ak4.clone( - pfjets = cms.InputTag('selectedPatJetsAK7PF'), - pfjetschs = cms.InputTag('selectedPatJetsAK7PFCHS'), - pfpujetid = cms.string('AK7PFpileupJetIdEvaluator:fullDiscriminant'), - pfchsjetpuid = cms.string('AK7PFCHSpileupJetIdEvaluator:fullDiscriminant'), - - ## MET collection #### - pfmet = cms.InputTag('patMETs'), - genjets = cms.untracked.InputTag('ak7GenJetsNoNu'), -) - -jetToolbox( process, 'ak5', 'ak5JetSubs','CHS') -jetToolbox( process, 'ak5', 'ak5JetSubs') - -process.ak5GenJets = process.ak5GenJets.clone() -process.ak5GenJets.rParam = cms.double(0.5) - -process.ak5 = process.ak4.clone( - pfjets = cms.InputTag('selectedPatJetsAK5PF'), - pfjetschs = cms.InputTag('selectedPatJetsAK5PFCHS'), - pfpujetid = cms.string('AK5PFpileupJetIdEvaluator:fullDiscriminant'), - pfchsjetpuid = cms.string('AK5PFCHSpileupJetIdEvaluator:fullDiscriminant'), - ## MET collection #### - pfmet = cms.InputTag('patMETs'), - genjets = cms.untracked.InputTag('ak5GenJetsNoNu'), -) - -#Try scheduled processs -process.p = cms.Path( process.ak4*process.ak5*process.ak7*process.ak8 ) - - -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -#! Output and Log -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(False) ) -process.options.allowUnscheduled = cms.untracked.bool(True) diff --git a/AnalysisFW/test/ProcessedTreeProducer_mcPAT_miniAOD_cfg.py b/AnalysisFW/test/ProcessedTreeProducer_mcPAT_miniAOD_cfg.py deleted file mode 100644 index a9b5f1c0d86..00000000000 --- a/AnalysisFW/test/ProcessedTreeProducer_mcPAT_miniAOD_cfg.py +++ /dev/null @@ -1,253 +0,0 @@ -# -*- coding: utf-8 -*- - -import FWCore.ParameterSet.Config as cms - -import FWCore.ParameterSet.Config as cms - -from RecoJets.Configuration.RecoPFJets_cff import ak4PFJets, ak4PFJetsCHS -from RecoJets.Configuration.RecoGenJets_cff import ak4GenJets -from RecoJets.JetProducers.SubJetParameters_cfi import SubJetParameters -from RecoJets.JetProducers.PFJetParameters_cfi import * -from RecoJets.JetProducers.GenJetParameters_cfi import * -from RecoJets.JetProducers.AnomalousCellParameters_cfi import * -from RecoJets.JetProducers.CATopJetParameters_cfi import * -from PhysicsTools.PatAlgos.producersLayer1.patCandidates_cff import * -from PhysicsTools.PatAlgos.selectionLayer1.jetSelector_cfi import selectedPatJets -from PhysicsTools.PatAlgos.tools.jetTools import addJetCollection - - -## Modified version of jetToolBox from https://github.com/cms-jet/jetToolbox -## Options for PUMethod: Puppi, CS, SK, CHS -def jetToolbox( proc, jetType, jetSequence,PUMethod=''): - JETCorrPayload='None' - JETCorrLevels = [ 'None' ] - #JECLevels = [ 'L1Offset', 'L1FastJet', 'L1JPTOffset', 'L2Relative', 'L3Absolute', 'L5Falvour', 'L7Parton' ] - - algorithm='AntiKt' # CambridgeAachen' , 'Kt' - size = jetType[-1:] #[-1:] takes the last char from string 'akX' - jetSize = float('0.'+jetType[-1:]) - jetALGO = jetType.upper() - jetalgo = jetType.lower() - - print 'Running processes with: '+str(jetALGO)+' PF '+PUMethod+' jet algorithm with radius parameter '+str(jetSize) - - JETCorrPayload = 'AK'+size+'PFchs' - #JETCorrLevels = ['L1FastJet', 'L2Relative', 'L3Absolute'] - JETCorrLevels = [] #No JEC corrections - JEC = ( JETCorrPayload, JETCorrLevels , 'None') - - ################################################################################# - ####### Toolbox start - ################################################################################# - - elemToKeep = [] - jetSeq = cms.Sequence() - genParticlesLabel = '' - pvLabel = '' - tvLabel = '' - toolsUsed = [] - - #### For MiniAOD - genParticlesLabel = 'prunedGenParticles' - pvLabel = 'offlineSlimmedPrimaryVertices' - svLabel = 'slimmedSecondaryVertices' - tvLabel = 'unpackedTracksAndVertices' - pfCand = 'packedPFCandidates' - - setattr( proc, 'chs', cms.EDFilter('CandPtrSelector', src = cms.InputTag('packedPFCandidates'), cut = cms.string('fromPV')) ) - jetSeq += getattr(proc, 'chs') - - - ### Filter out neutrinos from packed GenParticles - #setattr( proc, 'packedGenParticlesForJets', - #cms.EDFilter("CandPtrSelector", - #src = cms.InputTag("packedGenParticles"), - #cut = cms.string("abs(pdgId) != 12 && abs(pdgId) != 14 && abs(pdgId) != 16") - #)) - #jetSeq += getattr(proc, 'packedGenParticlesForJets' ) - - setattr( proc, jetalgo+'GenJets', - ak4GenJets.clone( src = 'packedGenParticles', #'packedGenParticlesForJets', - rParam = jetSize, - jetAlgorithm = algorithm ) ) - jetSeq += getattr(proc, jetalgo+'GenJets' ) - #fixedGridRhoFastjetAll.pfCandidatesTag = 'packedPFCandidates' - - #for Inclusive Vertex Finder - proc.load('PhysicsTools.PatAlgos.slimming.unpackedTracksAndVertices_cfi') - - - #### Creating PATjets - if 'CHS' in PUMethod: - setattr( proc, jetalgo+'PFJetsCHS', - ak4PFJetsCHS.clone( - doAreaFastjet = True, - rParam = jetSize, - jetAlgorithm = algorithm ) ) - getattr( proc, jetalgo+'PFJetsCHS').src = 'chs' - jetSeq += getattr(proc, jetalgo+'PFJetsCHS' ) - else: - PUMethod = '' - setattr( proc, jetalgo+'PFJets', - ak4PFJets.clone( - doAreaFastjet = True, - rParam = jetSize, - jetAlgorithm = algorithm ) ) - getattr( proc, jetalgo+'PFJets').src = 'packedPFCandidates' - jetSeq += getattr(proc, jetalgo+'PFJets' ) - - addJetCollection( - proc, - labelName = jetALGO+'PF'+PUMethod, - jetSource = cms.InputTag( jetalgo+'PFJets'+PUMethod), - algo = jetalgo, - rParam = jetSize, - jetCorrections = JEC, #( 'AK'+size+'PFchs', cms.vstring( ['L1FastJet', 'L2Relative', 'L3Absolute']), 'None'), - pfCandidates = cms.InputTag( pfCand ), #'packedPFCandidates'), - svSource = cms.InputTag( svLabel ), #'slimmedSecondaryVertices'), - genJetCollection = cms.InputTag( jetalgo+'GenJets'), - pvSource = cms.InputTag( pvLabel )#'offlineSlimmedPrimaryVertices'), - ) - - getattr( proc, 'patJetCorrFactors'+jetALGO+'PF'+PUMethod ).primaryVertices = pvLabel #'offlineSlimmedPrimaryVertices' - #getattr( proc, 'jetTracksAssociatorAtVertex'+jetALGO+'PF'+PUMethod ).tracks = tvLabel # 'unpackedTracksAndVertices' - - getattr(proc,'patJetPartons').particles = cms.InputTag( genParticlesLabel ) #'prunedGenParticles') - getattr(proc,'patJetPartonMatch'+jetALGO+'PF'+PUMethod).matched = cms.InputTag( genParticlesLabel ) #'prunedGenParticles') - if hasattr(proc,'pfInclusiveSecondaryVertexFinderTagInfos'+jetALGO+'PF'+PUMethod): - getattr(proc,'pfInclusiveSecondaryVertexFinderTagInfos'+jetALGO+'PF'+PUMethod).extSVCollection = cms.InputTag( svLabel ) #'slimmedSecondaryVertices') - getattr(proc,'patJets'+jetALGO+'PF'+PUMethod).addAssociatedTracks = cms.bool(False) # needs to be disabled since there is no track collection present in MiniAOD - getattr(proc,'patJets'+jetALGO+'PF'+PUMethod).addJetCharge = cms.bool(False) # needs to be disabled since there is no track collection present in MiniAOD - - elemToKeep += [ 'keep *_selectedPatJets'+jetALGO+'PF'+PUMethod+'_*_*' ] - #elemToKeep += [ 'drop *_selectedPatJets'+jetALGO+'PF'+PUMethod+'_calo*_*' ] - #elemToKeep += [ 'drop *_selectedPatJets'+jetALGO+'PF'+PUMethod+'_tagInfos_*' ] - - ### "return" - setattr(proc, jetSequence, jetSeq) - #getattr(proc, outputFile).outputCommands += elemToKeep - -process = cms.Process("Ntuplizer") -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -#! Conditions -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff") -process.load("Configuration.EventContent.EventContent_cff") -process.load('Configuration.StandardSequences.Geometry_cff') -process.load('Configuration.StandardSequences.MagneticField_38T_cff') -process.load('RecoJets.Configuration.GenJetParticles_cff') -process.load('RecoJets.Configuration.RecoGenJets_cff') - -process.GlobalTag.globaltag = "PHYS14_25_V2::All" - - -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -#! Input -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -inFiles = cms.untracked.vstring( -'file:///mnt/storage/gflouris/12FCC45C-5D78-E411-BEB2-00261894388B.root' -#'file:///afs/cern.ch/work/g/gflouris/public/SMPJ_AnalysisFW/08C07BB6-376F-E411-BE9F-C4346BC7EE18.root' - ) -process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(1000)) -process.source = cms.Source("PoolSource", fileNames = inFiles ) - -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -#! Services -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -process.load('FWCore.MessageLogger.MessageLogger_cfi') -process.MessageLogger.cerr.FwkReport.reportEvery = 100 -process.load('CommonTools.UtilAlgos.TFileService_cfi') -process.TFileService.fileName=cms.string('MC_ProcessedTreeProducer_miniAOD_2.root') - -jetToolbox( process, 'ak4', 'ak4JetSubs', PUMethod='') -jetToolbox( process, 'ak4', 'ak4JetSubs', PUMethod='CHS') - -process.ak4 = cms.EDAnalyzer('ProcessedTreeProducer_miniAOD', - ## jet collections ########################### - pfjets = cms.InputTag('selectedPatJetsAK7PF'), - pfjetschs = cms.InputTag('selectedPatJetsAK7PFCHS'), - ## MET collection #### - pfmet = cms.InputTag('slimmedMETs'), - genjets = cms.untracked.InputTag('ak4GenJets'), - ## database entry for the uncertainties ###### - PFPayloadName = cms.string(''), - PFPayloadNameCHS= cms.string(''), - CaloPayloadName = cms.string(''), - jecUncSrc = cms.string(''), - jecUncSrcCHS = cms.string(''), - jecUncSrcNames = cms.vstring(''), - ## set the conditions for good Vtx counting ## - offlineVertices = cms.InputTag('offlineSlimmedPrimaryVertices'), - goodVtxNdof = cms.double(4), - goodVtxZ = cms.double(24), - ## rho ####################################### - srcCaloRho = cms.InputTag('fixedGridRhoFastjetAll'), - srcPFRho = cms.InputTag('fixedGridRhoFastjetAllCalo'), - srcPU = cms.untracked.InputTag('addPileupInfo'), - ## preselection cuts ######################### - maxY = cms.double(5.0), - minPFPt = cms.double(20), - minPFFatPt = cms.double(10), - maxPFFatEta = cms.double(2.5), - minNPFJets = cms.int32(1), - minGenPt = cms.untracked.double(20), - minJJMass = cms.double(-1), - isMCarlo = cms.untracked.bool(True), - useGenInfo = cms.untracked.bool(True), - ## trigger ################################### - printTriggerMenu = cms.untracked.bool(True), - processName = cms.string('HLT'), - triggerName = cms.vstring('HLT_PFJet260_v1'), - triggerResults = cms.InputTag("TriggerResults","","HLT"), - triggerEvent = cms.InputTag("hltTriggerSummaryAOD","","HLT"), - ## jec services ############################## - #pfjecService = cms.string('ak7PFL1FastL2L3Residual'), - #calojecService = cms.string('ak7CaloL1FastL2L3Residual') -) - - -jetToolbox( process, 'ak8', 'ak8JetSubs','CHS') -jetToolbox( process, 'ak8', 'ak8JetSubs') - -process.ak8GenJets = process.ak4GenJets.clone() -process.ak8GenJets.rParam = cms.double(0.8) - -process.ak8 = process.ak4.clone( - pfjets = cms.InputTag('selectedPatJetsAK8PF'), - pfjetschs = cms.InputTag('selectedPatJetsAK8PFCHS'), - genjets = cms.untracked.InputTag('ak8GenJets'), -) -jetToolbox( process, 'ak7', 'ak7JetSubs', PUMethod='CHS') -jetToolbox( process, 'ak7', 'ak7JetSubs', PUMethod='') - -process.ak7GenJets = process.ak4GenJets.clone() -process.ak7GenJets.rParam = cms.double(0.7) - -process.ak7 = process.ak4.clone( - pfjets = cms.InputTag('selectedPatJetsAK7PF'), - pfjetschs = cms.InputTag('selectedPatJetsAK7PFCHS'), - genjets = cms.untracked.InputTag('ak7GenJets'), -) - -jetToolbox( process, 'ak5', 'ak5JetSubs','CHS') -jetToolbox( process, 'ak5', 'ak5JetSubs') - -process.ak5GenJets = process.ak5GenJets.clone() -process.ak5GenJets.rParam = cms.double(0.5) - -process.ak5 = process.ak4.clone( - pfjets = cms.InputTag('selectedPatJetsAK5PFCHS'), - pfjetschs = cms.InputTag('selectedPatJetsAK5PFCHS'), - genjets = cms.untracked.InputTag('ak5GenJets'), -) - - -process.p = cms.Path( process.ak4*process.ak7*process.ak5*process.ak7*process.ak8 ) - - -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -#! Output and Log -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(False) ) -process.options.allowUnscheduled = cms.untracked.bool(True) diff --git a/AnalysisFW/test/ProcessedTreeProducer_mc_cfg.py b/AnalysisFW/test/ProcessedTreeProducer_mc_cfg.py deleted file mode 100644 index ae70afcda86..00000000000 --- a/AnalysisFW/test/ProcessedTreeProducer_mc_cfg.py +++ /dev/null @@ -1,89 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -process = cms.Process("Ana") -process.load('FWCore.MessageService.MessageLogger_cfi') -##-------------------- Communicate with the DB ----------------------- -process.load('Configuration.StandardSequences.Services_cff') -process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') -process.GlobalTag.globaltag = 'START53_V24::All' -process.load('Configuration.StandardSequences.MagneticField_38T_cff') -process.load('Configuration.Geometry.GeometryIdeal_cff') -process.load('RecoJets.Configuration.RecoPFJets_cff') -process.load('RecoJets.Configuration.RecoJets_cff') -##-------------------- Import the JEC services ----------------------- -process.load('JetMETCorrections.Configuration.DefaultJEC_cff') -############# Set the number of events ############# -process.maxEvents = cms.untracked.PSet( - input = cms.untracked.int32(100) -) -############# Format MessageLogger ################# -process.MessageLogger.cerr.FwkReport.reportEvery = 10 -############# Define the source file ############### -process.source = cms.Source("PoolSource", - fileNames = cms.untracked.vstring( - '/store/relval/CMSSW_5_3_16/RelValPyquen_DiJet_pt80to120_2760GeV/GEN-SIM-RECO/PU_STARTHI53_LV1_mar03-v2/00000/1E3919E7-74A3-E311-B9A3-0025904C5DE0.root' - ) -) -############# processed tree producer ################## -process.TFileService = cms.Service("TFileService",fileName = cms.string('ProcessedTree_mc.root')) - -process.ak7 = cms.EDAnalyzer('ProcessedTreeProducer', - ## jet collections ########################### - pfjets = cms.InputTag('ak7PFJets'), - calojets = cms.InputTag('ak7CaloJets'), - genjets = cms.untracked.InputTag('ak7GenJets'), - ## database entry for the uncertainties ###### - PFPayloadName = cms.string(''), - CaloPayloadName = cms.string(''), - jecUncSrc = cms.string(''), - jecUncSrcNames = cms.vstring(''), - ## calojet ID and extender for the JTA ####### - calojetID = cms.InputTag('ak7JetID'), - calojetExtender = cms.InputTag('ak7JetExtender'), - ## set the conditions for good Vtx counting ## - offlineVertices = cms.InputTag('offlinePrimaryVertices'), - goodVtxNdof = cms.double(4), - goodVtxZ = cms.double(24), - ## rho ####################################### - srcCaloRho = cms.InputTag('kt6CaloJets','rho'), - srcPFRho = cms.InputTag('kt6PFJets','rho'), - ## MC $ Generator flags ###################### - isMCarlo = cms.untracked.bool(True), - useGenInfo = cms.untracked.bool(True), - ## simulated PU ############################## - srcPU = cms.untracked.InputTag('addPileupInfo'), - ## preselection cuts ######################### - maxY = cms.double(5.0), - minPFPt = cms.double(20), - minPFFatPt = cms.double(10), - maxPFFatEta = cms.double(2.5), - minCaloPt = cms.double(20), - minGenPt = cms.untracked.double(20), - minNPFJets = cms.int32(1), - minNCaloJets = cms.int32(1), - minJJMass = cms.double(-1), - ## trigger ################################### - printTriggerMenu = cms.untracked.bool(True), - processName = cms.string('HLT'), - triggerName = cms.vstring('HLT_PFJet40_v2','HLT_PFJet80_v2','HLT_PFJet140_v2','HLT_PFJet200_v2','HLT_PFJet260_v2','HLT_PFJet320_v2','HLT_PFJet400_v2'), - triggerResults = cms.InputTag("TriggerResults","","HLT"), - triggerEvent = cms.InputTag("hltTriggerSummaryAOD","","HLT"), - ## jec services ############################## - pfjecService = cms.string('ak7PFL1FastL2L3'), - calojecService = cms.string('ak7CaloL1FastL2L3') -) - -process.ak5 = process.ak7.clone( - pfjets = 'ak5PFJets', - calojets = 'ak5CaloJets', - genjets = 'ak5GenJets', - calojetID = 'ak5JetID', - calojetExtender = 'ak5JetExtender', - pfjecService = 'ak5PFL1FastL2L3', - calojecService = 'ak5CaloL1FastL2L3', - printTriggerMenu = False -) - -process.path = cms.Path(process.ak7 * process.ak5) - - diff --git a/AnalysisFW/test/globaltag_to_txt.py b/AnalysisFW/test/globaltag_to_txt.py deleted file mode 100644 index 21561565087..00000000000 --- a/AnalysisFW/test/globaltag_to_txt.py +++ /dev/null @@ -1,20 +0,0 @@ -import FWCore.ParameterSet.Config as cms -process = cms.Process("jectxt") -process.load('Configuration.StandardSequences.Services_cff') -process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') -# define your favorite global tag -process.GlobalTag.globaltag = 'MCRUN2_74_V9A::All' -process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(1)) -process.source = cms.Source("EmptySource") -process.readAK4PF = cms.EDAnalyzer('JetCorrectorDBReader', - # below is the communication to the database - payloadName = cms.untracked.string('AK4PF'), - # this is used ONLY for the name of the printed txt files. You can use any name that you like, - # but it is recommended to use the GT name that you retrieved the files from. - globalTag = cms.untracked.string('MCRUN2_74_V9A'), - printScreen = cms.untracked.bool(False), - createTextFile = cms.untracked.bool(True) -) -process.readAK7PF = process.readAK4PF.clone(payloadName = 'AK7PF') -process.p = cms.Path(process.readAK4PF * process.readAK7PF) - From 06fe03975cdcc67b60617ac5bcf9c01083567315 Mon Sep 17 00:00:00 2001 From: Paolo Date: Thu, 18 Feb 2016 17:09:44 +0100 Subject: [PATCH 03/48] 76X --- AnalysisFW/interface/MyElectron.h | 87 +++++ AnalysisFW/interface/MyMuon.h | 87 +++++ AnalysisFW/interface/QCDEvent.h | 17 + AnalysisFW/interface/QCDPFJetBTag.h | 9 + .../plugins/ProcessedTreeProducerBTag.cc | 182 ++++++---- .../plugins/ProcessedTreeProducerBTag.h | 78 ++--- AnalysisFW/src/MyElectron.cc | 1 + AnalysisFW/src/MyElectron.cc~ | 1 + AnalysisFW/src/MyMuon.cc | 1 + AnalysisFW/src/QCDEvent.cc | 16 + AnalysisFW/src/classes.h | 5 +- AnalysisFW/src/classes_def.xml | 4 +- ...rocessedTreeProducer_MCPAT25ns_BTag_cfg.py | 291 ++++++++++++++++ ...dTreeProducer_dataPAT25ns_BTag_RunC_cfg.py | 323 ++++++++++++++++++ ...cessedTreeProducer_dataPAT25ns_BTag_cfg.py | 101 +++--- AnalysisFW/test/crabDataAODBTag.py | 27 ++ AnalysisFW/test/crabDataAODBTagRunC.py | 28 ++ AnalysisFW/test/crabMC-madgraphSlices.py | 33 ++ AnalysisFW/test/crabMC-pythia8Slices.py | 39 +++ 19 files changed, 1164 insertions(+), 166 deletions(-) create mode 100644 AnalysisFW/interface/MyElectron.h create mode 100644 AnalysisFW/interface/MyMuon.h create mode 100644 AnalysisFW/src/MyElectron.cc create mode 100644 AnalysisFW/src/MyElectron.cc~ create mode 100644 AnalysisFW/src/MyMuon.cc create mode 100644 AnalysisFW/test/ProcessedTreeProducer_MCPAT25ns_BTag_cfg.py create mode 100644 AnalysisFW/test/ProcessedTreeProducer_dataPAT25ns_BTag_RunC_cfg.py create mode 100644 AnalysisFW/test/crabDataAODBTag.py create mode 100644 AnalysisFW/test/crabDataAODBTagRunC.py create mode 100644 AnalysisFW/test/crabMC-madgraphSlices.py create mode 100644 AnalysisFW/test/crabMC-pythia8Slices.py diff --git a/AnalysisFW/interface/MyElectron.h b/AnalysisFW/interface/MyElectron.h new file mode 100644 index 00000000000..deb26c8a981 --- /dev/null +++ b/AnalysisFW/interface/MyElectron.h @@ -0,0 +1,87 @@ + //Author P. Gunnellini + +#ifndef MyElectron_h +#define MyElectron_h +#include "DataFormats/PatCandidates/interface/Electron.h" +//-------- Generic Jet class for QCD analyses --------------- +class MyElectron +{ + public: + typedef reco::Particle::LorentzVector LorentzVector; + //------------ Constructor ------------------------------ + MyElectron() {} + //------------ Destructor ------------------------------- + ~MyElectron() {} + //------------ Sett methods ----------------------------- + void setP4(LorentzVector fP4) {P4_ = fP4;} + void setGen(LorentzVector fP4, float fgenR) {genP4_ = fP4;genR_ = fgenR;} + void setCor(float fCor) {cor_ = fCor;} + void setUnc(float fUnc) {unc_ = fUnc;} + void setUncSrc(std::vector fUncSrc) {uncSrc_ = fUncSrc;} + //New Instructions + void setElectronDxyVertex(double fDxyVertex) {DxyVertex_ = fDxyVertex;} + void setElectronDzVertex(double fDzVertex) {DzVertex_ = fDzVertex;} + void setPDGId(double fPDGID) {PDGID_ = fPDGID;} + void setPfIso(double fPfIso) {PfIso_ = fPfIso;} + + void setChargedHadronIos(double fChargedHadronIso) {fChargedHadronIso = ChargedHadronIso_;} + void setNeutralHadronIso(double fNeutralHadronIso) {fNeutralHadronIso = NeutralHadronIso_;} + void setPhotonIso(double fPhotonIso) {fPhotonIso = PhotonIso_;} + void setPuChargedHadronIso(double fPuChargedHadronIso) {fPuChargedHadronIso = PuChargedHadronIso_;} + + //------------ Get methods ------------------------------ + const LorentzVector& p4() const {return P4_;} + const LorentzVector& genp4() const {return genP4_;} + float pt() const {return P4_.pt()/cor_;} + float genpt() const {return genP4_.pt();} + float geneta() const {return genP4_.eta();} + float genR() const {return genR_;} + float ptCor() const {return P4_.pt();} + float e() const {return P4_.energy()/cor_;} + float eCor() const {return P4_.energy();} + float eta() const {return P4_.eta();} + float y() const {return P4_.Rapidity();} + float phi() const {return P4_.phi();} + float mass() const {return P4_.mass();} + float cor() const {return cor_;} + float unc() const {return unc_;} + float uncSrc(int i) const {return uncSrc_[i];} + + float Iso() const {return PfIso_;} + float pdgId() const {return PDGID_;} + float ElectronDZVertex() const {return DzVertex_;} + float ElectronDxyVertex() const {return DxyVertex_;} + + // int nParticles() const {return pfParticles_.size();} + // const LorentzVector& getPFParticles(int i) const {return pfParticles_[i];} + private: + //------ jet 4-momentum vector------------------ + LorentzVector P4_; + //------ matched genjet 4-momentum vector------- + LorentzVector genP4_; + //------ matching radius ----------------------- + float genR_; + //------ jec factor ---------------------------- + float cor_; + // ----- All components of JEC Factor ---------- + std::vector jecLabels_; + //------ jec uncertainty ----------------------- + float unc_; + //------ jec uncertainty sources --------------- + std::vector uncSrc_; + //------ jet area ------------------------------ + float area_; + + //Electron Vertices + double DxyVertex_; + double DzVertex_; + double PDGID_; + double PfIso_; + + double PuChargedHadronIso_; + double ChargedHadronIso_; + double NeutralHadronIso_; + double PhotonIso_; + + }; +#endif diff --git a/AnalysisFW/interface/MyMuon.h b/AnalysisFW/interface/MyMuon.h new file mode 100644 index 00000000000..fc9e4da6ceb --- /dev/null +++ b/AnalysisFW/interface/MyMuon.h @@ -0,0 +1,87 @@ + //Author P. Gunnellini + +#ifndef MyMuon_h +#define MyMuon_h +#include "DataFormats/PatCandidates/interface/Muon.h" +//-------- Generic Jet class for QCD analyses --------------- +class MyMuon +{ + public: + typedef reco::Particle::LorentzVector LorentzVector; + //------------ Constructor ------------------------------ + MyMuon() {} + //------------ Destructor ------------------------------- + ~MyMuon() {} + //------------ Sett methods ----------------------------- + void setP4(LorentzVector fP4) {P4_ = fP4;} + void setGen(LorentzVector fP4, float fgenR) {genP4_ = fP4;genR_ = fgenR;} + void setCor(float fCor) {cor_ = fCor;} + void setUnc(float fUnc) {unc_ = fUnc;} + void setUncSrc(std::vector fUncSrc) {uncSrc_ = fUncSrc;} + //New Instructions + void setMuonDxyVertex(double fDxyVertex) {DxyVertex_ = fDxyVertex;} + void setMuonDzVertex(double fDzVertex) {DzVertex_ = fDzVertex;} + void setPDGId(double fPDGID) {PDGID_ = fPDGID;} + void setPfIso(double fPfIso) {PfIso_ = fPfIso;} + + void setChargedHadronIso(double fChargedHadronIso) {fChargedHadronIso = ChargedHadronIso_;} + void setNeutralHadronIso(double fNeutralHadronIso) {fNeutralHadronIso = NeutralHadronIso_;} + void setPhotonIso(double fPhotonIso) {fPhotonIso = PhotonIso_;} + void setPuChargedHadronIso(double fPuChargedHadronIso) {fPuChargedHadronIso = PuChargedHadronIso_;} + + //------------ Get methods ------------------------------ + const LorentzVector& p4() const {return P4_;} + const LorentzVector& genp4() const {return genP4_;} + float pt() const {return P4_.pt()/cor_;} + float genpt() const {return genP4_.pt();} + float geneta() const {return genP4_.eta();} + float genR() const {return genR_;} + float ptCor() const {return P4_.pt();} + float e() const {return P4_.energy()/cor_;} + float eCor() const {return P4_.energy();} + float eta() const {return P4_.eta();} + float y() const {return P4_.Rapidity();} + float phi() const {return P4_.phi();} + float mass() const {return P4_.mass();} + float cor() const {return cor_;} + float unc() const {return unc_;} + float uncSrc(int i) const {return uncSrc_[i];} + + float Iso() const {return PfIso_;} + float pdgId() const {return PDGID_;} + float MuonDZVertex() const {return DzVertex_;} + float MuonDxyVertex() const {return DxyVertex_;} + + // int nParticles() const {return pfParticles_.size();} + // const LorentzVector& getPFParticles(int i) const {return pfParticles_[i];} + private: + //------ jet 4-momentum vector------------------ + LorentzVector P4_; + //------ matched genjet 4-momentum vector------- + LorentzVector genP4_; + //------ matching radius ----------------------- + float genR_; + //------ jec factor ---------------------------- + float cor_; + // ----- All components of JEC Factor ---------- + std::vector jecLabels_; + //------ jec uncertainty ----------------------- + float unc_; + //------ jec uncertainty sources --------------- + std::vector uncSrc_; + //------ jet area ------------------------------ + float area_; + + //Muon Vertices + double DxyVertex_; + double DzVertex_; + double PDGID_; + double PfIso_; + + double PuChargedHadronIso_; + double ChargedHadronIso_; + double NeutralHadronIso_; + double PhotonIso_; + + }; +#endif diff --git a/AnalysisFW/interface/QCDEvent.h b/AnalysisFW/interface/QCDEvent.h index 10e00256a96..a43f610059f 100644 --- a/AnalysisFW/interface/QCDEvent.h +++ b/AnalysisFW/interface/QCDEvent.h @@ -7,6 +7,8 @@ #include "SMPJ/AnalysisFW/interface/QCDMET.h" #include "SMPJ/AnalysisFW/interface/QCDCaloJet.h" #include "SMPJ/AnalysisFW/interface/QCDPFJet.h" +#include "SMPJ/AnalysisFW/interface/MyElectron.h" +#include "SMPJ/AnalysisFW/interface/MyMuon.h" #include "SMPJ/AnalysisFW/interface/QCDEventHdr.h" #include "DataFormats/JetReco/interface/Jet.h" #include @@ -22,10 +24,14 @@ class QCDEvent //------------ Set methods ------------------------------ void setCaloMET(const QCDMET& fCaloMET) {CaloMet_ = fCaloMET;} void setPFMET(const QCDMET& fPFMET) {PFMet_ = fPFMET;} + void setMvaMET(const QCDMET& fMvaMET) {MvaMet_ = fMvaMET;} void setEvtHdr(const QCDEventHdr& fEvtHdr) {EvtHdr_ = fEvtHdr;} void setCaloJets(const std::vector& fCaloJets); void setPFJets(const std::vector& fPFJets); void setPFJetsCHS(const std::vector& fPFJetsCHS); + void setElectrons(const std::vector& fElectron); + void setMuons(const std::vector& fMuon); + //void setFatJets(const std::vector& fFatJets); void setGenJets(const std::vector& fGenJets); void setL1Obj(const std::vector >& fL1Obj); @@ -52,6 +58,8 @@ class QCDEvent int preL1(int i) const {return L1Prescale_[i];} int preHLT(int i) const {return HLTPrescale_[i];} float pfmjj(); + unsigned int nMuons() const {return mMuon_.size();} + unsigned int nEelctrons() const {return mElectron_.size();} float GenJetFlavour(int i) const {return genFlavour_[i];} float GenHadronJetFlavour(int i) const {return genFlavourHadron_[i];} @@ -68,6 +76,7 @@ class QCDEvent float calomjjgen(); const QCDMET& calomet() const {return CaloMet_;} const QCDMET& pfmet() const {return PFMet_;} + const QCDMET& mvamet() const {return MvaMet_;} const LorentzVector& hltobj(int itrig, int iobj) const {return (HLTObj_[itrig])[iobj];} const LorentzVector& l1obj(int itrig, int iobj) const {return (L1Obj_[itrig])[iobj];} const LorentzVector& genjet(int i) const {return GenJets_[i];} @@ -77,6 +86,9 @@ class QCDEvent const QCDCaloJet& calojet(int i) const {return CaloJets_[i];} const QCDEventHdr& evtHdr() const {return EvtHdr_;} + const MyMuon& muon(int i) const {return mMuon_[i];} + const MyElectron& electron(int i) const {return mElectron_[i];} + const std::vector>& HLTObj() const {return HLTObj_;} const std::vector& trigPathList() const {return triggerList_;} const std::vector>& filterIdList() const {return filterIdList_;} @@ -92,6 +104,7 @@ class QCDEvent QCDMET CaloMet_; //---- PF met object ------------------------------------------- QCDMET PFMet_; + QCDMET MvaMet_; //---- trigger decision vector --------------------------------- std::vector TriggerDecision_; std::vector triggerList_; @@ -116,5 +129,9 @@ class QCDEvent std::vector genFlavour_; std::vector genFlavourHadron_; + //MyMuons + std::vector mMuon_; + std::vector mElectron_; + }; #endif diff --git a/AnalysisFW/interface/QCDPFJetBTag.h b/AnalysisFW/interface/QCDPFJetBTag.h index 9cd325e6338..c197495f412 100644 --- a/AnalysisFW/interface/QCDPFJetBTag.h +++ b/AnalysisFW/interface/QCDPFJetBTag.h @@ -19,6 +19,8 @@ class QCDPFJetBTag : public QCDJet { void setPositiveNegativeCSV(float fcsvpfpositive, float fcsvpfnegative) { CSVpfPositive_ = fcsvpfpositive; CSVpfNegative_ = fcsvpfnegative;} + void setTagRecommended(float recommend1, float recommend2, float recommend3) { recommend1_ = recommend1; recommend2_ = recommend2; recommend3_ = recommend3; } + void setFlavour(float fpartonflavour, float fhadronflavour) {partonFlavour_ = fpartonflavour; hadronFlavour_ = fhadronflavour;} //------------ Get methods ------------------------------ @@ -46,6 +48,10 @@ class QCDPFJetBTag : public QCDJet { float partonflavour() const {return partonFlavour_;} float hadronflavour() const {return hadronFlavour_;} + float pfJetProbabilityBJetTags() const {return recommend1_;} + float pfCombinedInclusiveSecondaryVertexV2BJetTags() const {return recommend2_;} + float pfCombinedMVAV2BJetTags() const {return recommend2_;} + private: float TCHE_; float TCHP_; @@ -69,6 +75,9 @@ class QCDPFJetBTag : public QCDJet { float partonFlavour_; float hadronFlavour_; + float recommend1_; + float recommend2_; + float recommend3_; }; #endif diff --git a/AnalysisFW/plugins/ProcessedTreeProducerBTag.cc b/AnalysisFW/plugins/ProcessedTreeProducerBTag.cc index 40b4c28d862..59292484959 100644 --- a/AnalysisFW/plugins/ProcessedTreeProducerBTag.cc +++ b/AnalysisFW/plugins/ProcessedTreeProducerBTag.cc @@ -19,13 +19,59 @@ #include "FWCore/Common/interface/TriggerNames.h" #include "FWCore/Common/interface/TriggerResultsByName.h" +#include "DataFormats/VertexReco/interface/Vertex.h" +#include "DataFormats/VertexReco/interface/VertexFwd.h" +#include "DataFormats/Common/interface/Handle.h" +#include "DataFormats/Math/interface/deltaR.h" +#include "DataFormats/JetReco/interface/Jet.h" +#include "DataFormats/JetReco/interface/PFJet.h" +#include "DataFormats/JetReco/interface/PFJetCollection.h" +#include "DataFormats/JetReco/interface/GenJet.h" +#include "DataFormats/JetReco/interface/GenJetCollection.h" +#include "DataFormats/JetReco/interface/JetExtendedAssociation.h" +#include "DataFormats/JetReco/interface/JetID.h" +#include "DataFormats/METReco/interface/HcalNoiseSummary.h" +#include "DataFormats/BeamSpot/interface/BeamSpot.h" +#include "DataFormats/TrackReco/interface/TrackFwd.h" + +#include "DataFormats/PatCandidates/interface/TriggerObjectStandAlone.h" +#include "DataFormats/PatCandidates/interface/PackedTriggerPrescales.h" +#include "HLTrigger/HLTcore/interface/HLTPrescaleProvider.h" +#include "HLTrigger/HLTcore/interface/HLTConfigProvider.h" + +#include "DataFormats/PatCandidates/interface/MET.h" +#include "DataFormats/PatCandidates/interface/PackedCandidate.h" + +#include "SimDataFormats/GeneratorProducts/interface/GenEventInfoProduct.h" +#include "SimDataFormats/PileupSummaryInfo/interface/PileupSummaryInfo.h" + +#include "CondFormats/JetMETObjects/interface/JetCorrectorParameters.h" +#include "JetMETCorrections/Objects/interface/JetCorrectionsRecord.h" + +#include "PhysicsTools/PatUtils/interface/bJetSelector.h" +#include "PhysicsTools/PatExamples/interface/BTagPerformance.h" +#include "PhysicsTools/PatExamples/interface/PatBTagCommonHistos.h" + +#include "DataFormats/Math/interface/deltaR.h" ProcessedTreeProducerBTag::ProcessedTreeProducerBTag(edm::ParameterSet const& cfg): -hltPrescale_(cfg, consumesCollector(), *this) - + mOfflineVertices(mayConsume(cfg.getParameter("offlineVertices"))), + mBeamSpot(mayConsume(cfg.getParameter("beamSpot"))), + //mPFJetsName(mayConsume(cfg.getParameter("pfjets"))), + //mPFJetsNameCHS(mayConsume(cfg.getParameter("pfjetschs"))), + mSrcCaloRho(mayConsume(cfg.getParameter("srcCaloRho"))), + mSrcPFRho(mayConsume(cfg.getParameter("srcPFRho"))), + mPFMET(mayConsume(cfg.getParameter("pfmet"))), + mGenJetsName(mayConsume(cfg.getUntrackedParameter("genjets",edm::InputTag("")))), + triggerResultsTag_(mayConsume(cfg.getParameter("triggerResults"))), + triggerEventTag_(mayConsume(cfg.getParameter("triggerEvent"))), + mHBHENoiseFilterResultLabel(mayConsume(cfg.getParameter("HBHENoiseFilterResultLabel"))), + mHBHENoiseFilterResultNoMinZLabel(mayConsume(cfg.getParameter("HBHENoiseFilterResultNoMinZLabel"))), + mSrcPU(mayConsume >(cfg.getUntrackedParameter("srcPULabel"))), + hltPrescale_(cfg, consumesCollector(), *this)// ",edm::InputTag("addPileupInfo")))) { // mPFJECservice = cfg.getParameter ("pfjecService"); - mPFPayloadName = cfg.getParameter ("PFPayloadName"); + mPFPayloadName = cfg.getParameter("PFPayloadName"); mPFPayloadNameCHS = cfg.getParameter ("PFPayloadNameCHS"); pfpujetid = cfg.getParameter ("pfpujetid"); pfchsjetpuid = cfg.getParameter ("pfchsjetpuid"); @@ -35,32 +81,27 @@ hltPrescale_(cfg, consumesCollector(), *this) mMinJJMass = cfg.getParameter ("minJJMass"); mMaxY = cfg.getParameter ("maxY"); mMinNPFJets = cfg.getParameter ("minNPFJets"); - mOfflineVertices =(consumes(cfg.getParameter("offlineVertices"))); - mPFJetsName = consumes >(cfg.getParameter("pfjets")); - mPFJetsNameCHS = consumes >(cfg.getParameter("pfjetschs")); - mSrcCaloRho = consumes(cfg.getParameter("srcCaloRho")); - mSrcPFRho = consumes(cfg.getParameter("srcPFRho")); - mPFMET =(consumes(cfg.getParameter("pfmet"))); - mSrcPU = consumes >(cfg.getParameter("srcPU")); - mGenJetsName = consumes(cfg.getParameter("genjets")); + //mOfflineVertices = cfg.getParameter ("offlineVertices"); mPrintTriggerMenu = cfg.getUntrackedParameter ("printTriggerMenu",false); mIsMCarlo = cfg.getUntrackedParameter ("isMCarlo",false); mUseGenInfo = cfg.getUntrackedParameter ("useGenInfo",false); mMinGenPt = cfg.getUntrackedParameter ("minGenPt",30); processName_ = cfg.getParameter ("processName"); triggerNames_ = cfg.getParameter > ("triggerName"); - triggerResultsTag_ = consumes(cfg.getParameter("triggerResults")); - triggerEventTag_ = consumes(cfg.getParameter("triggerEvent")); mPFJECUncSrc = cfg.getParameter ("jecUncSrc"); mPFJECUncSrcCHS = cfg.getParameter ("jecUncSrcCHS"); mPFJECUncSrcNames = cfg.getParameter > ("jecUncSrcNames"); - mofflineBeamSpot = consumes(cfg.getParameter("offlineBeamSpot")); - noiseSummaryToken = consumes(cfg.getParameter("noiseSummary")); - noiseSummary_NoMinZToken = consumes(cfg.getParameter("noiseSummary_NoMinZ")); - genParticlesToken = consumes(cfg.getParameter("genParticles")); - generatorToken = consumes(cfg.getParameter("generator")); - - + mPFJetsName = consumes >(cfg.getParameter("pfjets")); + mPFJetsNameCHS = consumes >(cfg.getParameter("pfjetschs")); + mhEventInfo = consumes(cfg.getParameter("EventInfo")); + mgenParticles = consumes(cfg.getParameter("GenParticles")); + //mPFJetsName = cfg.getParameter ("pfjets"); + //mPFJetsNameCHS = cfg.getParameter ("pfjetschs"); + //mSrcPU = cfg.getUntrackedParameter ("srcPU",edm::InputTag("addPileupInfo")); + //triggerResultsTag_ = cfg.getParameter ("triggerResults"); + //triggerEventTag_ = cfg.getParameter ("triggerEvent"); + //New additions + //beamSpot_(consumes(cfg.getParameter("offlineBeamSpot"))); } ////////////////////////////////////////////////////////////////////////////////////////// void ProcessedTreeProducerBTag::beginJob() @@ -69,11 +110,11 @@ void ProcessedTreeProducerBTag::beginJob() mEvent = new QCDEvent(); mTree->Branch("events","QCDEvent",&mEvent); mTriggerNamesHisto = fs->make("TriggerNames","TriggerNames",1,0,1); - //mTriggerNamesHisto->SetBit(TH1::kCanRebin); + mTriggerNamesHisto->SetBit(TH1::kUserContour); for(unsigned i=0;iFill(triggerNames_[i].c_str(),1); mTriggerPassHisto = fs->make("TriggerPass","TriggerPass",1,0,1); - //mTriggerPassHisto->SetBit(TH1::kCanRebin); + mTriggerPassHisto->SetBit(TH1::kUserContour); isPFJecUncSet_ = false; isPFJecUncSetCHS_ = false; } @@ -85,7 +126,7 @@ void ProcessedTreeProducerBTag::endJob() void ProcessedTreeProducerBTag::beginRun(edm::Run const & iRun, edm::EventSetup const& iSetup) { bool changed(true); - if (hltConfig_.init(iRun,iSetup,processName_,changed) && hltPrescale_.init(iRun, iSetup, processName_, changed) ) { + if (hltConfig_.init(iRun,iSetup,processName_,changed) && hltPrescale_.init(iRun, iSetup, processName_, changed) ) { if (changed) { // check if trigger names in (new) config cout<<"New trigger menu found !!!"< beamSpot; - event.getByToken(mofflineBeamSpot, beamSpot); + event.getByToken(mBeamSpot,beamSpot); if (beamSpot.isValid()) mEvtHdr.setBS(beamSpot->x0(),beamSpot->y0(),beamSpot->z0()); else @@ -137,22 +177,23 @@ void ProcessedTreeProducerBTag::analyze(edm::Event const& event, edm::EventSetup //-------------- HCAL Noise Summary ----------------------------- - edm::Handle noiseSummary; - edm::Handle noiseSummary_NoMinZ; + Handle noiseSummary; + Handle noiseSummary_NoMinZ; if (!mIsMCarlo) { - event.getByToken(noiseSummaryToken, noiseSummary); - mEvtHdr.setHCALNoise(*noiseSummary); - event.getByToken(noiseSummary_NoMinZToken, noiseSummary_NoMinZ); - mEvtHdr.setHCALNoiseNoMinZ(*noiseSummary_NoMinZ); + // event.getByLabel(mHBHENoiseFilter,noiseSummary); + event.getByToken(mHBHENoiseFilterResultLabel, noiseSummary); + //event.getByToken(mHBHENoiseFilterResultProducer, noiseSummary); + mEvtHdr.setHCALNoise(*noiseSummary); + event.getByToken(mHBHENoiseFilterResultNoMinZLabel, noiseSummary_NoMinZ); + mEvtHdr.setHCALNoiseNoMinZ(*noiseSummary_NoMinZ); + } else{ mEvtHdr.setHCALNoise(true); mEvtHdr.setHCALNoiseNoMinZ(true); } - - //-------------- Trigger Info ----------------------------------- event.getByToken(triggerResultsTag_,triggerResultsHandle_); if (!triggerResultsHandle_.isValid()) { @@ -164,11 +205,10 @@ void ProcessedTreeProducerBTag::analyze(edm::Event const& event, edm::EventSetup cout << "ProcessedTreeProducerBTag::analyze: Error in getting TriggerEvent product from Event!" << endl; return; } - vector L1Prescales,HLTPrescales,Fired; vector > mL1Objects,mHLTObjects; // sanity check - //assert(triggerResultsHandle_->size() == hltConfig_.size()); + assert(triggerResultsHandle_->size() == hltConfig_.size()); //------ loop over all trigger names --------- for(unsigned itrig=0;itrig vvL1,vvHLT; if (triggerIndex_[itrig] < hltConfig_.size()) { accept = triggerResultsHandle_->accept(triggerIndex_[itrig]); - //const std::pair prescales(hltPrescale_.prescaleValues(event,iSetup,triggerNames_[itrig])); - - //const std::pair prescales(hltConfig_.prescaleValues(event,iSetup,triggerNames_[itrig])); // const std::pair prescales(hltConfig_.prescaleValues(event,iSetup,triggerNames_[itrig])); - //preL1 = prescales.first; - //preHLT = prescales.second; -///In detail - //get prescale info from hltConfig_ - std::pair >,int> detailedPrescaleInfo = hltPrescale_.prescaleValuesInDetail(event, iSetup, triggerNames_[itrig]); - preHLT = detailedPrescaleInfo.second ; - - // save l1 prescale values in standalone vector - std::vector l1prescalevals; - for( size_t varind = 0; varind < detailedPrescaleInfo.first.size(); varind++ ){ - l1prescalevals.push_back(detailedPrescaleInfo.first.at(varind).second); - } + // const std::pair prescales(hltConfig_.prescaleValues(event,iSetup,triggerNames_[itrig])); + ///In detail + //get prescale info from hltConfig_ + + std::pair >,int> detailedPrescaleInfo = hltPrescale_.prescaleValuesInDetail(event, iSetup, triggerNames_[itrig]); + preHLT = detailedPrescaleInfo.second ; - // find and save minimum l1 prescale of any ORed L1 that seeds the HLT - std::vector::iterator result = std::min_element(std::begin(l1prescalevals), std::end(l1prescalevals)); - size_t minind = std::distance(std::begin(l1prescalevals), result); - // sometimes there are no L1s associated with a HLT. In that case, this branch stores -1 for the l1prescale - preL1 = minind < l1prescalevals.size() ? l1prescalevals.at(minind) : -1 ; -///end in detail - + // save l1 prescale values in standalone vector + std::vector l1prescalevals; + for( size_t varind = 0; varind < detailedPrescaleInfo.first.size(); varind++ ){ + l1prescalevals.push_back(detailedPrescaleInfo.first.at(varind).second); + } + + //find and save minimum l1 prescale of any ORed L1 that seeds the HLT + std::vector::iterator result = std::min_element(std::begin(l1prescalevals), std::end(l1prescalevals)); + size_t minind = std::distance(std::begin(l1prescalevals), result); + // sometimes there are no L1s associated with a HLT. In that case, this branch stores -1 for the l1prescale + preL1 = minind < l1prescalevals.size() ? l1prescalevals.at(minind) : -1 ;//commented for 76X + + ///end in detail if (!accept) tmpFired = 0; else { mTriggerPassHisto->Fill(triggerNames_[itrig].c_str(),1); tmpFired = 1; } + //--------- modules on this trigger path-------------- const vector& moduleLabels(hltConfig_.moduleLabels(triggerIndex_[itrig])); const unsigned int moduleIndex(triggerResultsHandle_->index(triggerIndex_[itrig])); @@ -296,8 +334,7 @@ void ProcessedTreeProducerBTag::analyze(edm::Event const& event, edm::EventSetup //-------------- Simulated PU Info ---------------------------------- Handle > PupInfo; if (mIsMCarlo && mUseGenInfo) { - //event.getByToken("generator", hEventInfo); - event.getByToken(generatorToken, hEventInfo); + event.getByToken(mhEventInfo, hEventInfo); if(hEventInfo->hasBinningValues()) mEvtHdr.setPthat(hEventInfo->binningValues()[0]); else @@ -373,12 +410,12 @@ void ProcessedTreeProducerBTag::analyze(edm::Event const& event, edm::EventSetup } //----------- PFJets non CHS part ------------------------- - + edm::Handle > patjets; event.getByToken(mPFJetsName,patjets); /*edm::Handle btagDiscriminators; - event.getByToken("pfCombinedInclusiveSecondaryVertexV2BJetTags", btagDiscriminators); */ + event.getByLabel("pfCombinedInclusiveSecondaryVertexV2BJetTags", btagDiscriminators); */ for(edm::View::const_iterator i_pfjet=patjets->begin(); i_pfjet!=patjets->end(); ++i_pfjet) { @@ -506,6 +543,11 @@ void ProcessedTreeProducerBTag::analyze(edm::Event const& event, edm::EventSetup double CSVpfPositive = i_pfjet->bDiscriminator("pfPositiveCombinedSecondaryVertexBJetTags"); double CSVpfNegative = i_pfjet->bDiscriminator("pfNegativeCombinedSecondaryVertexBJetTags"); + + //the three recommended + double pfJetProbabilityBJetTags=i_pfjet->bDiscriminator("pfJetProbabilityBJetTags"); + double pfCombinedInclusiveSecondaryVertexV2BJetTags= i_pfjet->bDiscriminator("pfCombinedInclusiveSecondaryVertexV2BJetTags"); + double pfCombinedMVAV2BJetTags=i_pfjet->bDiscriminator("pfCombinedMVAV2BJetTags"); qcdpfjet.setLooseID(looseID); qcdpfjet.setTightID(tightID); @@ -513,7 +555,7 @@ void ProcessedTreeProducerBTag::analyze(edm::Event const& event, edm::EventSetup qcdpfjet.setMulti(npr,chm,nhm,phm,elm,mum); qcdpfjet.setHFFrac(hf_hf,hf_phf); qcdpfjet.setHFMulti(hf_hm,hf_phm); - + float partonFlavour=-100; float hadronFlavour=-100; @@ -536,6 +578,7 @@ void ProcessedTreeProducerBTag::analyze(edm::Event const& event, edm::EventSetup qcdpfjet.setSimpleSecondaryVertexTag(SimpleSecVertexHE,SimpleSecVertexHP,SimpleSecVertexHEpf,SimpleSecVertexHPpf); qcdpfjet.setCombinedSecondaryVertexTag(CSV,CSVpf,CinclSVpf,CSVSoftLeptonpf,CMVApf); qcdpfjet.setPositiveNegativeCSV(CSVpfPositive,CSVpfNegative); + qcdpfjet.setTagRecommended(pfJetProbabilityBJetTags,pfCombinedInclusiveSecondaryVertexV2BJetTags,pfCombinedMVAV2BJetTags); float pileupJetId = -999; if ( i_pfjet->hasUserFloat(pfpujetid) ) pileupJetId = i_pfjet->userFloat(pfpujetid); @@ -731,6 +774,12 @@ void ProcessedTreeProducerBTag::analyze(edm::Event const& event, edm::EventSetup double CSVpfPositive = i_pfjetchs->bDiscriminator("pfPositiveCombinedSecondaryVertexBJetTags"); double CSVpfNegative = i_pfjetchs->bDiscriminator("pfNegativeCombinedSecondaryVertexBJetTags"); + //the three recommended + + double pfJetProbabilityBJetTags=i_pfjetchs->bDiscriminator("pfJetProbabilityBJetTags"); + double pfCombinedInclusiveSecondaryVertexV2BJetTags= i_pfjetchs->bDiscriminator("pfCombinedInclusiveSecondaryVertexV2BJetTags"); + double pfCombinedMVAV2BJetTags=i_pfjetchs->bDiscriminator("pfCombinedMVAV2BJetTags"); + float partonFlavour=-100; float hadronFlavour=-100; @@ -747,7 +796,8 @@ void ProcessedTreeProducerBTag::analyze(edm::Event const& event, edm::EventSetup qcdpfjetchs.setSimpleSecondaryVertexTag(SimpleSecVertexHE,SimpleSecVertexHP,SimpleSecVertexHEpf,SimpleSecVertexHPpf); qcdpfjetchs.setCombinedSecondaryVertexTag(CSV,CSVpf,CinclSVpf,CSVSoftLeptonpf,CMVApf); qcdpfjetchs.setPositiveNegativeCSV(CSVpfPositive,CSVpfNegative); - + qcdpfjetchs.setTagRecommended(pfJetProbabilityBJetTags,pfCombinedInclusiveSecondaryVertexV2BJetTags,pfCombinedMVAV2BJetTags); + float pileupJetId = -999; if ( i_pfjetchs->hasUserFloat(pfchsjetpuid) ) { pileupJetId = i_pfjetchs->userFloat(pfchsjetpuid);} qcdpfjetchs.SetPUJetId(pileupJetId); @@ -823,8 +873,7 @@ int ProcessedTreeProducerBTag::getMatchedPartonGen(edm::Event const& event,GenJe bool switchC=0; edm::Handle genParticles; - //event.getByToken ("genParticles", genParticles); - event.getByToken (genParticlesToken, genParticles); + event.getByToken(mgenParticles, genParticles); for (size_t i = 0; i < genParticles->size (); ++i) { const GenParticle & genIt = (*genParticles)[i]; @@ -855,8 +904,7 @@ int ProcessedTreeProducerBTag::getMatchedHadronGen(edm::Event const& event,GenJe int jetFlavour=-100; edm::Handle genParticles; - //event.getByToken ("genParticles", genParticles); - event.getByToken (genParticlesToken, genParticles); + event.getByToken(mgenParticles, genParticles); for (size_t i = 0; i < genParticles->size (); ++i) { const GenParticle & genIt = (*genParticles)[i]; diff --git a/AnalysisFW/plugins/ProcessedTreeProducerBTag.h b/AnalysisFW/plugins/ProcessedTreeProducerBTag.h index d3a0e58c4b6..75ed07c5d67 100644 --- a/AnalysisFW/plugins/ProcessedTreeProducerBTag.h +++ b/AnalysisFW/plugins/ProcessedTreeProducerBTag.h @@ -1,50 +1,32 @@ #ifndef ProcessedTreeProducerBTag_h #define ProcessedTreeProducerBTag_h -#include "SMPJ/AnalysisFW/interface/QCDJet.h" -#include "SMPJ/AnalysisFW/interface/QCDEvent.h" -#include "SMPJ/AnalysisFW/interface/QCDEventHdr.h" -#include "SMPJ/AnalysisFW/interface/QCDPFJet.h" -#include "SMPJ/AnalysisFW/interface/QCDPFJetBTag.h" -#include "SMPJ/AnalysisFW/interface/QCDMET.h" - - #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EDAnalyzer.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "HLTrigger/HLTcore/interface/HLTConfigProvider.h" -#include "HLTrigger/HLTcore/interface/HLTPrescaleProvider.h" #include "DataFormats/Common/interface/TriggerResults.h" #include "DataFormats/HLTReco/interface/TriggerEvent.h" #include "JetMETCorrections/Objects/interface/JetCorrector.h" #include "CondFormats/JetMETObjects/interface/JetCorrectionUncertainty.h" #include "DataFormats/PatCandidates/interface/Jet.h" #include "DataFormats/PatCandidates/interface/JetCorrFactors.h" -#include "CondFormats/JetMETObjects/interface/JetCorrectorParameters.h" -#include "JetMETCorrections/Objects/interface/JetCorrectionsRecord.h" +#include "SMPJ/AnalysisFW/interface/QCDJet.h" +#include "SMPJ/AnalysisFW/interface/QCDEvent.h" +#include "SMPJ/AnalysisFW/interface/QCDEventHdr.h" +#include "SMPJ/AnalysisFW/interface/QCDPFJet.h" +#include "SMPJ/AnalysisFW/interface/QCDPFJetBTag.h" +#include "SMPJ/AnalysisFW/interface/QCDMET.h" #include "FWCore/ServiceRegistry/interface/Service.h" #include "CommonTools/UtilAlgos/interface/TFileService.h" #include "DataFormats/PatCandidates/interface/MET.h" #include "DataFormats/PatCandidates/interface/PackedCandidate.h" -#include "DataFormats/VertexReco/interface/Vertex.h" -#include "DataFormats/VertexReco/interface/VertexFwd.h" -#include "DataFormats/Common/interface/Handle.h" -#include "DataFormats/Math/interface/deltaR.h" -#include "DataFormats/JetReco/interface/PFJet.h" -#include "DataFormats/JetReco/interface/PFJetCollection.h" -#include "DataFormats/JetReco/interface/GenJet.h" -#include "DataFormats/JetReco/interface/GenJetCollection.h" -#include "DataFormats/JetReco/interface/JetExtendedAssociation.h" -#include "DataFormats/JetReco/interface/JetID.h" -#include "DataFormats/METReco/interface/HcalNoiseSummary.h" -#include "DataFormats/BeamSpot/interface/BeamSpot.h" -#include "DataFormats/TrackReco/interface/TrackFwd.h" -#include "SimDataFormats/GeneratorProducts/interface/GenEventInfoProduct.h" #include "SimDataFormats/PileupSummaryInfo/interface/PileupSummaryInfo.h" -#include "PhysicsTools/PatUtils/interface/bJetSelector.h" -#include "PhysicsTools/PatExamples/interface/BTagPerformance.h" -#include "PhysicsTools/PatExamples/interface/PatBTagCommonHistos.h" -#include "DataFormats/Math/interface/deltaR.h" +#include "SimDataFormats/GeneratorProducts/interface/GenEventInfoProduct.h" +#include "HLTrigger/HLTcore/interface/HLTPrescaleProvider.h" + +#include "DataFormats/VertexReco/interface/VertexFwd.h" +#include "DataFormats/VertexReco/interface/Vertex.h" using namespace edm; using namespace reco; @@ -78,7 +60,7 @@ class ProcessedTreeProducerBTag : public edm::EDAnalyzer std::string mPFPayloadName; std::string mPFPayloadNameCHS; std::string pfpujetid; - std::string pfchsjetpuid; + std::string pfchsjetpuid; // unc file for non CHS jet ---- // std::string mPFJECUncSrc; @@ -87,32 +69,37 @@ class ProcessedTreeProducerBTag : public edm::EDAnalyzer std::vector mPFJECUncSrcNames; std::vector mBDiscriminators; // ---- non CHS jet input tag ----- // - edm::EDGetTokenT > mPFJetsName; + edm::EDGetTokenT mOfflineVertices; + edm::EDGetTokenT mBeamSpot; + edm::EDGetTokenT >mPFJetsName; + edm::EDGetTokenT >mPFJetsNameCHS; + edm::EDGetTokenT mhEventInfo; // ----CHS jet input tag ----- // - edm::EDGetTokenT > mPFJetsNameCHS; - edm::EDGetTokenT mGenJetsName; - edm::EDGetTokenT mOfflineVertices; - edm::EDGetTokenT mSrcCaloRho; - edm::EDGetTokenT mSrcPFRho; - edm::EDGetTokenT > mSrcPU; - edm::EDGetTokenT mofflineBeamSpot; - edm::EDGetTokenT mPFMET; - edm::EDGetTokenT noiseSummaryToken; - edm::EDGetTokenT noiseSummary_NoMinZToken; - edm::EDGetTokenT genParticlesToken; - edm::EDGetTokenT generatorToken; + //edm::InputTag mPFJetsName; + //edm::InputTag mPFJetsNameCHS; + edm::EDGetTokenT mSrcCaloRho; + edm::EDGetTokenT mSrcPFRho; + //edm::InputTag triggerResultsTag_; + //edm::InputTag triggerEventTag_; + //edm::InputTag mPFMET; + edm::EDGetTokenT mPFMET; + edm::EDGetTokenT mGenJetsName; + edm::EDGetTokenT mgenParticles; //edm::InputTag mHBHENoiseFilter; //---- TRIGGER ------------------------- std::string processName_; std::vector triggerNames_; std::vector triggerIndex_; - edm::EDGetTokenT triggerResultsTag_; + //edm::InputTag mSrcPU; + edm::EDGetTokenT triggerResultsTag_; edm::EDGetTokenT triggerEventTag_; + edm::EDGetTokenT mHBHENoiseFilterResultLabel; + edm::EDGetTokenT mHBHENoiseFilterResultNoMinZLabel; + edm::EDGetTokenT > mSrcPU; edm::Handle triggerResultsHandle_; edm::Handle triggerEventHandle_; HLTConfigProvider hltConfig_; - HLTPrescaleProvider hltPrescale_; //---- CORRECTORS ---------------------- const JetCorrector *mPFJEC; // ---- non CHS jet uncertainty ------ // @@ -133,6 +120,7 @@ class ProcessedTreeProducerBTag : public edm::EDAnalyzer int getMatchedPartonGen(edm::Event const& event, GenJetCollection::const_iterator i_gen); int getMatchedHadronGen(edm::Event const& event, GenJetCollection::const_iterator i_gen); + HLTPrescaleProvider hltPrescale_; }; diff --git a/AnalysisFW/src/MyElectron.cc b/AnalysisFW/src/MyElectron.cc new file mode 100644 index 00000000000..10956914a4e --- /dev/null +++ b/AnalysisFW/src/MyElectron.cc @@ -0,0 +1 @@ +#include "SMPJ/AnalysisFW/interface/MyElectron.h" diff --git a/AnalysisFW/src/MyElectron.cc~ b/AnalysisFW/src/MyElectron.cc~ new file mode 100644 index 00000000000..55f03cb32ba --- /dev/null +++ b/AnalysisFW/src/MyElectron.cc~ @@ -0,0 +1 @@ +#include "SMPJ/AnalysisFW/interface/MyMuon.h" diff --git a/AnalysisFW/src/MyMuon.cc b/AnalysisFW/src/MyMuon.cc new file mode 100644 index 00000000000..55f03cb32ba --- /dev/null +++ b/AnalysisFW/src/MyMuon.cc @@ -0,0 +1 @@ +#include "SMPJ/AnalysisFW/interface/MyMuon.h" diff --git a/AnalysisFW/src/QCDEvent.cc b/AnalysisFW/src/QCDEvent.cc index 7527b8e6ca2..a245429bc50 100644 --- a/AnalysisFW/src/QCDEvent.cc +++ b/AnalysisFW/src/QCDEvent.cc @@ -35,6 +35,22 @@ void QCDEvent::setPFJetsCHS(const std::vector& fPFJetsCHS) PFJetsCHS_.push_back(fPFJetsCHS[i]); } } +//--------------------------------------------------- +void QCDEvent::setElectrons(const std::vector& fElectrons) +{ + mElectron_.clear(); + for(unsigned i=0;i& fMuon) +{ + mMuon_.clear(); + for(unsigned i=0;i& fFatJets) diff --git a/AnalysisFW/src/classes.h b/AnalysisFW/src/classes.h index 3cab218b872..989bb897e32 100644 --- a/AnalysisFW/src/classes.h +++ b/AnalysisFW/src/classes.h @@ -4,7 +4,8 @@ #include "SMPJ/AnalysisFW/interface/QCDPFJet.h" #include "SMPJ/AnalysisFW/interface/QCDEvent.h" #include "SMPJ/AnalysisFW/interface/QCDEventHdr.h" -#include "SMPJ/AnalysisFW/interface/QCDPFJetBTag.h" +#include "SMPJ/AnalysisFW/interface/MyMuon.h" +#include "SMPJ/AnalysisFW/interface/MyElectron.h" QCDMET qcdmet; QCDJet qcdjet; @@ -13,3 +14,5 @@ QCDPFJet qcdpfjet; QCDPFJetBTag qcdpfjetbtag; QCDEvent qcdevent; QCDEventHdr qcdeventhdr; +MyMuon mymuon; +MyElectron myelectron; diff --git a/AnalysisFW/src/classes_def.xml b/AnalysisFW/src/classes_def.xml index 6fceeea34ea..46d428f0748 100644 --- a/AnalysisFW/src/classes_def.xml +++ b/AnalysisFW/src/classes_def.xml @@ -2,10 +2,12 @@ + + + - diff --git a/AnalysisFW/test/ProcessedTreeProducer_MCPAT25ns_BTag_cfg.py b/AnalysisFW/test/ProcessedTreeProducer_MCPAT25ns_BTag_cfg.py new file mode 100644 index 00000000000..1029f89750e --- /dev/null +++ b/AnalysisFW/test/ProcessedTreeProducer_MCPAT25ns_BTag_cfg.py @@ -0,0 +1,291 @@ +# -*- coding: utf-8 -*- + +import FWCore.ParameterSet.Config as cms + +from RecoJets.Configuration.RecoPFJets_cff import ak4PFJets, ak4PFJetsCHS +from RecoJets.Configuration.RecoGenJets_cff import ak4GenJets +from RecoJets.JetProducers.SubJetParameters_cfi import SubJetParameters +from RecoJets.JetProducers.PFJetParameters_cfi import * +from RecoJets.JetProducers.GenJetParameters_cfi import * +from RecoJets.JetProducers.AnomalousCellParameters_cfi import * +from PhysicsTools.PatAlgos.producersLayer1.patCandidates_cff import * +from PhysicsTools.PatAlgos.selectionLayer1.jetSelector_cfi import selectedPatJets +from PhysicsTools.PatAlgos.tools.jetTools import * +#from PhysicsTools.PatAlgos.producersLayer1.metProducer_cfi import patMETs +from PhysicsTools.PatAlgos.patSequences_cff import * +#nnfrom PhysicsTools.PatAlgos.tools.metTools import addMETCollection +#from RecoJets.JetProducers.pileupjetidproducer_cfi import * +from PhysicsTools.PatAlgos.patTemplate_cfg import * +from PhysicsTools.PatAlgos.tools.jetTools import * + +## Modified version of jetToolBox from https://github.com/cms-jet/jetToolbox +## Options for PUMethod: Puppi, CS, SK, CHS + +# -*- coding: utf-8 -*- +import FWCore.ParameterSet.Config as cms + +process = cms.Process("Ntuplizer") +#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +#! Conditions +#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_condDBv2_cff") +process.load("Configuration.EventContent.EventContent_cff") +process.load('Configuration.StandardSequences.GeometryRecoDB_cff') +process.load('Configuration.StandardSequences.MagneticField_38T_cff') +process.load('RecoJets.Configuration.GenJetParticles_cff') +process.load('RecoJets.Configuration.RecoGenJets_cff') +process.load('RecoJets.JetProducers.TrackJetParameters_cfi') +process.load('RecoJets.JetProducers.PileupJetIDParams_cfi') +process.load("PhysicsTools.PatAlgos.patSequences_cff") + +#process.load("PhysicsTools.PatAlgos.slimming.pileupJetId_cfi") +from Configuration.AlCa.GlobalTag import GlobalTag +#process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:mc', '') +process.GlobalTag.globaltag = "76X_mcRun2_asymptotic_v12" + +##-------------------- Import the JEC services ----------------------- +process.load('JetMETCorrections.Configuration.DefaultJEC_cff') + +#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +#! Input +#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +inFiles = cms.untracked.vstring( +'file:/afs/cern.ch/work/e/eeren/public/04E758F7-34F9-E411-AFF0-002618FDA259.root' + ) + +process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(100)) +process.source = cms.Source("PoolSource", fileNames = inFiles ) + +def jetToolbox( proc, jetType, jetSequence,PUMethod='', bTagDiscriminators = None): + + JETCorrPayload='None' + JETCorrLevels = [ 'None' ] + bTagDiscriminators = ['trackCountingHighEffBJetTags','trackCountingHighPurBJetTags','pfTrackCountingHighEffBJetTags','pfTrackCountingHighPurBJetTags','softPFMuonByIP3dBJetTags','softPFElectronByIP3dBJetTags','softPFMuonBJetTags','softPFElectronBJetTags','simpleSecondaryVertexHighEffBJetTags','simpleSecondaryVertexHighPurBJetTags','pfSimpleSecondaryVertexHighEffBJetTags','pfSimpleSecondaryVertexHighPurBJetTags','combinedSecondaryVertexBJetTags','pfCombinedSecondaryVertexBJetTags','pfCombinedInclusiveSecondaryVertexBJetTags','pfCombinedMVABJetTags','pfCombinedSecondaryVertexSoftLeptonBJetTags','pfPositiveCombinedSecondaryVertexBJetTags','pfNegativeCombinedSecondaryVertexBJetTags','pfCombinedInclusiveSecondaryVertexV2BJetTags','pfCombinedMVAV2BJetTags','pfJetProbabilityBJetTags'] + GetJetMCFlavour = ['True'] + #JECLevels = [ 'L1Offset', 'L1FastJet', 'L1JPTOffset', 'L2Relative', 'L3Absolute', 'L5Falvour', 'L7Parton' ] + + algorithm='AntiKt' # CambridgeAachen' , 'Kt' + size = jetType[-1:] #[-1:] takes the last char from string 'akX' + jetSize = float('0.'+jetType[-1:]) + jetALGO = jetType.upper() + jetalgo = jetType.lower() + elemToKeep = [] + + print 'Running processes with: '+str(jetALGO)+' PF '+PUMethod+' jet algorithm with radius parameter '+str(jetSize) + + JETCorrPayload = 'AK'+size+'PF'+PUMethod.lower() + JETCorrLevels = ['L1FastJet', 'L2Relative', 'L3Absolute','L2L3Residual'] + #JETCorrLevels = [] #No JEC corrections + JEC = ( JETCorrPayload, JETCorrLevels , 'None') + + ################################################################################# + ####### Toolbox start + ################################################################################# + + elemToKeep = [] + jetSeq = cms.Sequence() + genParticlesLabel = '' + pvLabel = '' + tvLabel = '' + toolsUsed = [] + + proc.load('RecoJets.Configuration.GenJetParticles_cff') + setattr( proc, jetalgo+'GenJetsNoNu', ak4GenJets.clone( src = 'genParticlesForJetsNoNu', rParam = jetSize, jetAlgorithm = algorithm ) ) + jetSeq += getattr(proc, jetalgo+'GenJetsNoNu' ) + + proc.load('CommonTools.ParticleFlow.pfNoPileUpJME_cff') + #### Creating PATjets + if( PUMethod=='CHS') : + setattr( proc, jetalgo+'PFJetsCHS', ak4PFJets.clone( rParam = jetSize, jetAlgorithm = algorithm ) ) + jetSeq += getattr(proc, jetalgo+'PFJetsCHS' ) + + setattr( proc, jetalgo+'PFJetsCHS', + ak4PFJetsCHS.clone( + doAreaFastjet = True, + rParam = jetSize, + jetAlgorithm = algorithm ) ) + jetSeq += getattr(proc, jetalgo+'PFJetsCHS' ) + + else : + setattr( proc, jetalgo+'PFJets', ak4PFJets.clone( rParam = jetSize, jetAlgorithm = algorithm ) ) + jetSeq += getattr(proc, jetalgo+'PFJets' ) + + setattr( proc, jetalgo+'PFJets', + ak4PFJets.clone( + doAreaFastjet = True, + rParam = jetSize, + jetAlgorithm = algorithm ) ) + jetSeq += getattr(proc, jetalgo+'PFJets' ) + PUMethod='' + + + addJetCollection( + proc, + labelName = jetALGO+'PF'+PUMethod, + jetSource = cms.InputTag( jetalgo+'PFJets'+PUMethod), + algo = jetalgo, + btagDiscriminators = bTagDiscriminators, + rParam = jetSize, + jetCorrections = JEC, #( 'AK'+size+'PFchs', cms.vstring( ['L1FastJet', 'L2Relative', 'L3Absolute']), 'None'), + pfCandidates = cms.InputTag( 'particleFlow' ), #'packedPFCandidates'), + svSource = cms.InputTag('inclusiveCandidateSecondaryVertices'), + genJetCollection = cms.InputTag( jetalgo+'GenJetsNoNu'), + pvSource = cms.InputTag( 'offlinePrimaryVertices' ), #'offlineSlimmedPrimaryVertices'), + jetTrackAssociation = True, + + ) + + #setattr( proc, jetALGO+'PF'+PUMethod+'pileupJetIdCalculator', +# pileupJetIdCalculator.clone( +# jets = cms.InputTag(jetalgo+'PFJets'+PUMethod), +# rho = cms.InputTag("fixedGridRhoFastjetAll"), +# vertexes = cms.InputTag('offlinePrimaryVertices'), +# applyJec = cms.bool(True), +# inputIsCorrected = cms.bool(False) +# )) + +# setattr( proc, jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator', +# pileupJetIdEvaluator.clone( +# jetids = cms.InputTag(jetALGO+'PF'+PUMethod+'pileupJetIdCalculator'), +# jets = cms.InputTag(jetalgo+'PFJets'+PUMethod), +# rho = cms.InputTag("fixedGridRhoFastjetAll"), +# vertexes = cms.InputTag('offlinePrimaryVertices'), +# applyJec = cms.bool(True), +# inputIsCorrected = cms.bool(False) +# +# ) +# ) + + #getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod).userData.userFloats.src += [jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator:fullDiscriminant'] + #getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod).userData.userInts.src += [jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator:cutbasedId',jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator:fullId'] + + getattr(proc,'patJetPartons').particles = cms.InputTag( 'genParticles' ) #'prunedGenParticles') + setattr(proc, 'selectedPatJets'+jetALGO+'PF'+PUMethod, selectedPatJets.clone( src = 'patJets'+jetALGO+'PF'+PUMethod ) ) + setattr(proc, jetSequence, jetSeq) + +jetToolbox( process, 'ak4', 'ak4JetSubs') +jetToolbox( process, 'ak4', 'ak4JetSubs','CHS') + +#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +#! Services +#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +process.load('FWCore.MessageLogger.MessageLogger_cfi') +process.MessageLogger.cerr.FwkReport.reportEvery = 100 +process.load('CommonTools.UtilAlgos.TFileService_cfi') +process.TFileService.fileName=cms.string('MC_ProcessedTreeProducer_2.root') + +# PAT Layer 1 +#process.load("PhysicsTools.PatAlgos.patLayer0_cff") # need to load this +#process.load("PhysicsTools.PatAlgos.patLayer1_cff") # even if we run only layer 1 + +process.load("PhysicsTools.PatAlgos.producersLayer1.patCandidates_cff") +process.load("PhysicsTools.PatAlgos.selectionLayer1.selectedPatCandidates_cff") +#from PhysicsTools.PatAlgos.tools.metTools import addMETCollection +#addMETCollection(process,'patMETPF','pfMetT1') +#patMETs.addGenMet = cms.bool(False) +#patMETs.genMETSource = cms.InputTag("") +process.patJets.addTagInfos = True +process.patJets.getJetMCFlavour = True + +process.ak4 = cms.EDAnalyzer('ProcessedTreeProducerBTag', + ## jet collections ########################### + pfjets = cms.InputTag('selectedPatJetsAK4PF'), + pfjetschs = cms.InputTag('selectedPatJetsAK4PFCHS'), + pfpujetid = cms.string('AK4PFpileupJetIdEvaluator:fullDiscriminant'), + pfchsjetpuid = cms.string('AK4PFCHSpileupJetIdEvaluator:fullDiscriminant'), + ## MET collection #### + pfmet = cms.InputTag('patMETs'), + genjets = cms.untracked.InputTag('ak4GenJetsNoNu'), + ## database entry for the uncertainties ###### + PFPayloadName = cms.string('AK4PF'), + PFPayloadNameCHS= cms.string('AK4PFchs'), + jecUncSrc = cms.string(''), + jecUncSrcCHS = cms.string(''), + jecUncSrcNames = cms.vstring(''), + ## set the conditions for good Vtx counting ## + offlineVertices = cms.InputTag('offlinePrimaryVertices'), + goodVtxNdof = cms.double(4), + goodVtxZ = cms.double(24), + ## rho ####################################### + srcCaloRho = cms.InputTag('fixedGridRhoFastjetAllCalo'), + srcPFRho = cms.InputTag('fixedGridRhoFastjetAll'), + srcPULabel = cms.untracked.InputTag('addPileupInfo'), + ## preselection cuts ######################### + maxY = cms.double(5.0), + minPFPt = cms.double(20), + minNPFJets = cms.int32(1), + minGenPt = cms.untracked.double(20), + minJJMass = cms.double(-1), + isMCarlo = cms.untracked.bool(True), + useGenInfo = cms.untracked.bool(True), + ## trigger ################################### + printTriggerMenu = cms.untracked.bool(False), + processName = cms.string('HLT'), + triggerName = cms.vstring(''), + triggerResults = cms.InputTag("TriggerResults","","HLT"), + triggerEvent = cms.InputTag("hltTriggerSummaryAOD","","HLT"), + ## jec services ############################## + HBHENoiseFilterResultLabel = cms.InputTag("HBHENoiseFilterResultProducer", "HBHENoiseFilterResult"), + HBHENoiseFilterResultNoMinZLabel = cms.InputTag("HBHENoiseFilterResultProducerNoMinZ", "HBHENoiseFilterResult"), + EventInfo = cms.InputTag("generator"), + GenParticles = cms.InputTag("genParticles"), + beamSpot = cms.InputTag('offlineBeamSpot'), + #pfjecService = cms.string('ak7PFL1FastL2L3Residual'), +) + +jetToolbox( process, 'ak8', 'ak8JetSubs','CHS') +jetToolbox( process, 'ak8', 'ak8JetSubs') + +process.ak8 = process.ak4.clone( + pfjets = cms.InputTag('selectedPatJetsAK8PF'), + pfjetschs = cms.InputTag('selectedPatJetsAK8PFCHS'), + pfpujetid = cms.string('AK8PFpileupJetIdEvaluator:fullDiscriminant'), + pfchsjetpuid = cms.string('AK8PFCHSpileupJetIdEvaluator:fullDiscriminant'), + PFPayloadName = cms.string('AK8PF'), + PFPayloadNameCHS= cms.string('AK8PFchs'), +) + +jetToolbox( process, 'ak7', 'ak7JetSubs','CHS') +jetToolbox( process, 'ak7', 'ak7JetSubs') + +process.ak7 = process.ak4.clone( + pfjets = cms.InputTag('selectedPatJetsAK7PF'), + pfjetschs = cms.InputTag('selectedPatJetsAK7PFCHS'), + pfpujetid = cms.string('AK7PFpileupJetIdEvaluator:fullDiscriminant'), + pfchsjetpuid = cms.string('AK7PFCHSpileupJetIdEvaluator:fullDiscriminant'), + PFPayloadName = cms.string('AK7PF'), + PFPayloadNameCHS= cms.string('AK7PFchs'), +) + +jetToolbox( process, 'ak5', 'ak5JetSubs','CHS') +jetToolbox( process, 'ak5', 'ak5JetSubs') + +process.ak5 = process.ak4.clone( + pfjets = cms.InputTag('selectedPatJetsAK5PF'), + pfjetschs = cms.InputTag('selectedPatJetsAK5PFCHS'), + pfpujetid = cms.string('AK5PFpileupJetIdEvaluator:fullDiscriminant'), + pfchsjetpuid = cms.string('AK5PFCHSpileupJetIdEvaluator:fullDiscriminant'), + PFPayloadName = cms.string('AK5PF'), + PFPayloadNameCHS= cms.string('AK5PFchs'), +) + +process.goodVertices = cms.EDFilter("VertexSelector", + filter = cms.bool(False), + src = cms.InputTag("offlinePrimaryVertices"), + cut = cms.string("!isFake && ndof >= 4 && abs(z) <= 24 && position.rho <= 2"), +) +process.load('RecoMET.METFilters.trackingFailureFilter_cfi') + +##Type1 patMET Producer +process.load('PhysicsTools.PatAlgos.recoLayer0.metCorrections_cff') +process.load('PhysicsTools.PatAlgos.producersLayer1.metProducer_cfi') +process.patMETs.addGenMET = cms.bool(False) +#Try scheduled processs +process.path = cms.Path(process.ak4*process.ak7) + +#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +#! Output and Log +#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(False) ) +process.options.allowUnscheduled = cms.untracked.bool(True) diff --git a/AnalysisFW/test/ProcessedTreeProducer_dataPAT25ns_BTag_RunC_cfg.py b/AnalysisFW/test/ProcessedTreeProducer_dataPAT25ns_BTag_RunC_cfg.py new file mode 100644 index 00000000000..2b1f2c93fa2 --- /dev/null +++ b/AnalysisFW/test/ProcessedTreeProducer_dataPAT25ns_BTag_RunC_cfg.py @@ -0,0 +1,323 @@ +# -*- coding: utf-8 -*- + +import FWCore.ParameterSet.Config as cms + +from RecoJets.Configuration.RecoPFJets_cff import ak4PFJets, ak4PFJetsCHS +from RecoJets.Configuration.RecoGenJets_cff import ak4GenJets +from RecoJets.JetProducers.SubJetParameters_cfi import SubJetParameters +from RecoJets.JetProducers.PFJetParameters_cfi import * +from RecoJets.JetProducers.GenJetParameters_cfi import * +from RecoJets.JetProducers.AnomalousCellParameters_cfi import * +from PhysicsTools.PatAlgos.producersLayer1.patCandidates_cff import * +from PhysicsTools.PatAlgos.selectionLayer1.jetSelector_cfi import selectedPatJets +from PhysicsTools.PatAlgos.tools.jetTools import * +#from PhysicsTools.PatAlgos.producersLayer1.metProducer_cfi import patMETs +from PhysicsTools.PatAlgos.patSequences_cff import * +#nnfrom PhysicsTools.PatAlgos.tools.metTools import addMETCollection +#from RecoJets.JetProducers.pileupjetidproducer_cfi import * +from PhysicsTools.PatAlgos.patTemplate_cfg import * +from PhysicsTools.PatAlgos.tools.jetTools import * + +## Modified version of jetToolBox from https://github.com/cms-jet/jetToolbox +## Options for PUMethod: Puppi, CS, SK, CHS + +# -*- coding: utf-8 -*- +import FWCore.ParameterSet.Config as cms + +process = cms.Process("Ntuplizer") +#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +#! Conditions +#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_condDBv2_cff") +process.load("Configuration.EventContent.EventContent_cff") +process.load('Configuration.StandardSequences.GeometryRecoDB_cff') +process.load('Configuration.StandardSequences.MagneticField_38T_cff') +process.load('RecoJets.Configuration.GenJetParticles_cff') +process.load('RecoJets.Configuration.RecoGenJets_cff') +process.load('RecoJets.JetProducers.TrackJetParameters_cfi') +process.load('RecoJets.JetProducers.PileupJetIDParams_cfi') +process.load("PhysicsTools.PatAlgos.patSequences_cff") + +#process.load("PhysicsTools.PatAlgos.slimming.pileupJetId_cfi") + +#process.GlobalTag.globaltag = "74X_dataRun2_Prompt_v4" +process.GlobalTag.globaltag = "76X_dataRun2_v5" + +##-------------------- Import the JEC services ----------------------- +process.load('JetMETCorrections.Configuration.DefaultJEC_cff') + +#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +#! Input +#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +inFiles = cms.untracked.vstring( +#'root://xrootd.unl.edu//store/data/Run2015D/JetHT/AOD/PromptReco-v4/000/258/159/00000/00F952BC-D16B-E511-B784-02163E0144F2.root' +#'root://xrootd.unl.edu//store/data/Run2015D/JetHT/AOD/PromptReco-v3/000/256/630/00000/BC44672C-345F-E511-BEA5-02163E0141FB.root' +#'root://xrootd.unl.edu//store/data/Run2015C/JetHT/AOD/PromptReco-v1/000/253/890/00000/24D029CE-2741-E511-B0AF-02163E014604.root' +#'root://xrootd.unl.edu//store/data/Run2015D/JetHT/AOD/PromptReco-v3/000/256/674/00000/36D872F3-F95E-E511-870B-02163E013539.root' +#'root://xrootd.unl.edu//store/data/Run2015D/JetHT/AOD/PromptReco-v3/000/256/729/00000/5C1F5529-F65F-E511-9B8C-02163E0145D9.root' +'root://xrootd.unl.edu//store/data/Run2015C/JetHT/AOD/PromptReco-v1/000/253/890/00000/24D029CE-2741-E511-B0AF-02163E014604.root' + ) + +process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(10000)) +process.source = cms.Source("PoolSource", fileNames = inFiles ) + +def jetToolbox( proc, jetType, jetSequence,PUMethod='', bTagDiscriminators = None): + + JETCorrPayload='None' + JETCorrLevels = [ 'None' ] + bTagDiscriminators = ['trackCountingHighEffBJetTags','trackCountingHighPurBJetTags','pfTrackCountingHighEffBJetTags','pfTrackCountingHighPurBJetTags','softPFMuonByIP3dBJetTags','softPFElectronByIP3dBJetTags','softPFMuonBJetTags','softPFElectronBJetTags','simpleSecondaryVertexHighEffBJetTags','simpleSecondaryVertexHighPurBJetTags','pfSimpleSecondaryVertexHighEffBJetTags','pfSimpleSecondaryVertexHighPurBJetTags','combinedSecondaryVertexBJetTags','pfCombinedSecondaryVertexSoftLeptonBJetTags','pfPositiveCombinedSecondaryVertexBJetTags','pfNegativeCombinedSecondaryVertexBJetTags'] +#,'pfCombinedSecondaryVertexBJetTags','pfCombinedMVABJetTags','pfCombinedSecondaryVertexSoftLeptonBJetTags','pfPositiveCombinedSecondaryVertexBJetTags','pfNegativeCombinedSecondaryVertexBJetTags'] +#,'pfCombinedInclusiveSecondaryVertexBJetTags' + + #GetJetMCFlavour = ['True'] + #JECLevels = [ 'L1Offset', 'L1FastJet', 'L1JPTOffset', 'L2Relative', 'L3Absolute', 'L5Falvour', 'L7Parton' ] + + algorithm='AntiKt' # CambridgeAachen' , 'Kt' + size = jetType[-1:] #[-1:] takes the last char from string 'akX' + jetSize = float('0.'+jetType[-1:]) + jetALGO = jetType.upper() + jetalgo = jetType.lower() + elemToKeep = [] + + print 'Running processes with: '+str(jetALGO)+' PF '+PUMethod+' jet algorithm with radius parameter '+str(jetSize) + + JETCorrPayload = 'AK'+size+'PF'+PUMethod.lower() + JETCorrLevels = ['L1FastJet', 'L2Relative', 'L3Absolute','L2L3Residual'] + #JETCorrLevels = [] #No JEC corrections + JEC = ( JETCorrPayload, JETCorrLevels , 'None') + + ################################################################################# + ####### Toolbox start + ################################################################################# + + elemToKeep = [] + jetSeq = cms.Sequence() + genParticlesLabel = '' + pvLabel = '' + tvLabel = '' + toolsUsed = [] + + proc.load('RecoJets.Configuration.GenJetParticles_cff') + setattr( proc, jetalgo+'GenJetsNoNu', ak4GenJets.clone( src = 'genParticlesForJetsNoNu', rParam = jetSize, jetAlgorithm = algorithm ) ) + jetSeq += getattr(proc, jetalgo+'GenJetsNoNu' ) + + proc.load('CommonTools.ParticleFlow.pfNoPileUpJME_cff') + #### Creating PATjets + if( PUMethod=='CHS') : + setattr( proc, jetalgo+'PFJetsCHS', ak4PFJets.clone( rParam = jetSize, jetAlgorithm = algorithm ) ) + jetSeq += getattr(proc, jetalgo+'PFJetsCHS' ) + + setattr( proc, jetalgo+'PFJetsCHS', + ak4PFJetsCHS.clone( + doAreaFastjet = True, + rParam = jetSize, + jetAlgorithm = algorithm ) ) + jetSeq += getattr(proc, jetalgo+'PFJetsCHS' ) + + else : + setattr( proc, jetalgo+'PFJets', ak4PFJets.clone( rParam = jetSize, jetAlgorithm = algorithm ) ) + jetSeq += getattr(proc, jetalgo+'PFJets' ) + + setattr( proc, jetalgo+'PFJets', + ak4PFJets.clone( + doAreaFastjet = True, + rParam = jetSize, + jetAlgorithm = algorithm ) ) + jetSeq += getattr(proc, jetalgo+'PFJets' ) + PUMethod='' + + + addJetCollection( + proc, + labelName = jetALGO+'PF'+PUMethod, + jetSource = cms.InputTag( jetalgo+'PFJets'+PUMethod), + algo = jetalgo, + btagDiscriminators = bTagDiscriminators, + rParam = jetSize, + jetCorrections = JEC, #( 'AK'+size+'PFchs', cms.vstring( ['L1FastJet', 'L2Relative', 'L3Absolute']), 'None'), + pfCandidates = cms.InputTag( 'particleFlow' ), #'packedPFCandidates'), + svSource = cms.InputTag('inclusiveCandidateSecondaryVertices'), + genJetCollection = cms.InputTag( jetalgo+'GenJetsNoNu'), + pvSource = cms.InputTag( 'offlinePrimaryVertices' ), #'offlineSlimmedPrimaryVertices'), + jetTrackAssociation = True, + + ) + + #setattr( proc, jetALGO+'PF'+PUMethod+'pileupJetIdCalculator', +# pileupJetIdCalculator.clone( +# jets = cms.InputTag(jetalgo+'PFJets'+PUMethod), +# rho = cms.InputTag("fixedGridRhoFastjetAll"), +# vertexes = cms.InputTag('offlinePrimaryVertices'), +# applyJec = cms.bool(True), +# inputIsCorrected = cms.bool(False) +# )) + +# setattr( proc, jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator', +# pileupJetIdEvaluator.clone( +# jetids = cms.InputTag(jetALGO+'PF'+PUMethod+'pileupJetIdCalculator'), +# jets = cms.InputTag(jetalgo+'PFJets'+PUMethod), +# rho = cms.InputTag("fixedGridRhoFastjetAll"), +# vertexes = cms.InputTag('offlinePrimaryVertices'), +# applyJec = cms.bool(True), +# inputIsCorrected = cms.bool(False) +# +# ) +# ) + + #getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod).userData.userFloats.src += [jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator:fullDiscriminant'] + #getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod).userData.userInts.src += [jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator:cutbasedId',jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator:fullId'] + + getattr(proc,'patJetPartons').particles = cms.InputTag( 'genParticles' ) #'prunedGenParticles') + setattr(proc, 'selectedPatJets'+jetALGO+'PF'+PUMethod, selectedPatJets.clone( src = 'patJets'+jetALGO+'PF'+PUMethod ) ) + setattr(proc, jetSequence, jetSeq) + +jetToolbox( process, 'ak4', 'ak4JetSubs') +jetToolbox( process, 'ak4', 'ak4JetSubs','CHS') + +#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +#! Services +#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +process.load('FWCore.MessageLogger.MessageLogger_cfi') +process.MessageLogger.cerr.FwkReport.reportEvery = 100 +process.load('CommonTools.UtilAlgos.TFileService_cfi') +process.TFileService.fileName=cms.string('DATA_ProcessedTreeProducer_2.root') + +# PAT Layer 1 +#process.load("PhysicsTools.PatAlgos.patLayer0_cff") # need to load this +#process.load("PhysicsTools.PatAlgos.patLayer1_cff") # even if we run only layer 1 + +process.load("PhysicsTools.PatAlgos.producersLayer1.patCandidates_cff") +process.load("PhysicsTools.PatAlgos.selectionLayer1.selectedPatCandidates_cff") +#from PhysicsTools.PatAlgos.tools.metTools import addMETCollection +#addMETCollection(process,'patMETPF','pfMetT1') +#patMETs.addGenMet = cms.bool(False) +#patMETs.genMETSource = cms.InputTag("") +process.patJets.addTagInfos = True +process.patJets.addAssociatedTracks = True + +process.ak4 = cms.EDAnalyzer('ProcessedTreeProducerBTag', + ## jet collections ########################### + pfjets = cms.InputTag('selectedPatJetsAK4PF'), + pfjetschs = cms.InputTag('selectedPatJetsAK4PFCHS'), + pfpujetid = cms.string('AK4PFpileupJetIdEvaluator:fullDiscriminant'), + pfchsjetpuid = cms.string('AK4PFCHSpileupJetIdEvaluator:fullDiscriminant'), + ## MET collection #### + pfmet = cms.InputTag('patMETs'), + genjets = cms.untracked.InputTag('ak4GenJetsNoNu'), + ## database entry for the uncertainties ###### + PFPayloadName = cms.string('AK4PF'), + PFPayloadNameCHS= cms.string('AK4PFchs'), + jecUncSrc = cms.string(''), + jecUncSrcCHS = cms.string(''), + jecUncSrcNames = cms.vstring(''), + ## set the conditions for good Vtx counting ## + offlineVertices = cms.InputTag('offlinePrimaryVertices'), + beamSpot = cms.InputTag('offlineBeamSpot'), + goodVtxNdof = cms.double(4), + goodVtxZ = cms.double(24), + ## rho ####################################### + srcCaloRho = cms.InputTag('fixedGridRhoFastjetAllCalo'), + srcPFRho = cms.InputTag('fixedGridRhoFastjetAll'), + srcPULabel = cms.untracked.InputTag('addPileupInfo','addPileupInfo'), + ## preselection cuts ######################### + maxY = cms.double(5.0), + minPFPt = cms.double(20), + minNPFJets = cms.int32(1), + minGenPt = cms.untracked.double(20), + minJJMass = cms.double(-1), + isMCarlo = cms.untracked.bool(False), + useGenInfo = cms.untracked.bool(False), + ## trigger ################################### + printTriggerMenu = cms.untracked.bool(True), + processName = cms.string('HLT'), + triggerName = cms.vstring('HLT_PFJet40_v2','HLT_PFJet60_v2', 'HLT_PFJet80_v2', 'HLT_PFJet140_v2', 'HLT_PFJet200_v2', 'HLT_PFJet260_v2','HLT_PFJet320_v2', 'HLT_PFJet400_v2', 'HLT_PFJet450_v2','HLT_PFJet500_v2','HLT_PFHT600_v2','HLT_PFHT650_v2','HLT_PFHT800_v1','HLT_PFHT200_v1','HLT_PFHT250_v1','HLT_PFHT300_v1','HLT_PFHT350_v2','HLT_PFHT400_v1','HLT_PFHT475_v1','HLT_ZeroBias_v2'), + triggerResults = cms.InputTag("TriggerResults","","HLT"), + triggerEvent = cms.InputTag("hltTriggerSummaryAOD","","HLT"), + ## jec services ############################## + #new tokens + EventInfo = cms.InputTag("generator"), + GenParticles = cms.InputTag("genparticles"), + HBHENoiseFilterResultLabel = cms.InputTag("HBHENoiseFilterResultProducer", "HBHENoiseFilterResult"), + HBHENoiseFilterResultNoMinZLabel = cms.InputTag("HBHENoiseFilterResultProducerNoMinZ", "HBHENoiseFilterResult"), + #pfjecService = cms.string('ak7PFL1FastL2L3Residual'), +) + +jetToolbox( process, 'ak8', 'ak8JetSubs','CHS') +jetToolbox( process, 'ak8', 'ak8JetSubs') + +process.ak8 = process.ak4.clone( + pfjets = cms.InputTag('selectedPatJetsAK8PF'), + pfjetschs = cms.InputTag('selectedPatJetsAK8PFCHS'), + pfpujetid = cms.string('AK8PFpileupJetIdEvaluator:fullDiscriminant'), + pfchsjetpuid = cms.string('AK8PFCHSpileupJetIdEvaluator:fullDiscriminant'), + PFPayloadName = cms.string('AK8PF'), + PFPayloadNameCHS= cms.string('AK8PFchs'), +) + +jetToolbox( process, 'ak7', 'ak7JetSubs','CHS') +jetToolbox( process, 'ak7', 'ak7JetSubs') + +process.ak7 = process.ak4.clone( + pfjets = cms.InputTag('selectedPatJetsAK7PF'), + pfjetschs = cms.InputTag('selectedPatJetsAK7PFCHS'), + pfpujetid = cms.string('AK7PFpileupJetIdEvaluator:fullDiscriminant'), + pfchsjetpuid = cms.string('AK7PFCHSpileupJetIdEvaluator:fullDiscriminant'), + PFPayloadName = cms.string('AK7PF'), + PFPayloadNameCHS= cms.string('AK7PFchs'), +) + +jetToolbox( process, 'ak5', 'ak5JetSubs','CHS') +jetToolbox( process, 'ak5', 'ak5JetSubs') + +process.ak5 = process.ak4.clone( + pfjets = cms.InputTag('selectedPatJetsAK5PF'), + pfjetschs = cms.InputTag('selectedPatJetsAK5PFCHS'), + pfpujetid = cms.string('AK5PFpileupJetIdEvaluator:fullDiscriminant'), + pfchsjetpuid = cms.string('AK5PFCHSpileupJetIdEvaluator:fullDiscriminant'), + PFPayloadName = cms.string('AK5PF'), + PFPayloadNameCHS= cms.string('AK5PFchs'), +) + +############# hlt filter ######################### +process.hltFilter = cms.EDFilter('HLTHighLevel', + TriggerResultsTag = cms.InputTag('TriggerResults','','HLT'), + HLTPaths = cms.vstring('HLT_PFJet40_v3','HLT_PFJet60_v3', 'HLT_PFJet80_v3', 'HLT_PFJet140_v3', 'HLT_PFJet200_v3', 'HLT_PFJet260_v3','HLT_PFJet320_v3', 'HLT_PFJet400_v3', 'HLT_PFJet450_v3','HLT_PFJet500_v3','HLT_PFHT600_v3','HLT_PFHT650_v3','HLT_PFHT800_v2','HLT_PFHT200_v2','HLT_PFHT250_v2','HLT_PFHT300_v2','HLT_PFHT350_v3','HLT_PFHT400_v2','HLT_PFHT475_v2','HLT_ZeroBias_v2','HLT_AK4PFJet30_v3','HLT_AK4PFJet50_v3','HLT_AK4PFJet80_v3','HLT_AK4PFJet100_v3','HLT_PFJet40_v4','HLT_PFJet60_v4', 'HLT_PFJet80_v4', 'HLT_PFJet140_v4', 'HLT_PFJet200_v4', 'HLT_PFJet260_v4','HLT_PFJet320_v4', 'HLT_PFJet400_v4', 'HLT_PFJet450_v4','HLT_PFJet500_v4'), + eventSetupPathsKey = cms.string(''), + andOr = cms.bool(True), #----- True = OR, False = AND between the HLTPaths + throw = cms.bool(False) +) + +##MET Filters +process.load('RecoMET.METFilters.CSCTightHaloFilter_cfi') +process.load('CommonTools.RecoAlgos.HBHENoiseFilterResultProducer_cfi') + +process.HBHENoiseFilterResultProducerNoMinZ = process.HBHENoiseFilterResultProducer.clone(minZeros = cms.int32(99999)) + + +process.goodVertices = cms.EDFilter("VertexSelector", + filter = cms.bool(False), + src = cms.InputTag("offlinePrimaryVertices"), + cut = cms.string("!isFake && ndof >= 4 && abs(z) <= 24 && position.rho <= 2"), +) +process.load('RecoMET.METFilters.trackingFailureFilter_cfi') + +##Type1 patMET Producer +process.load('PhysicsTools.PatAlgos.recoLayer0.metCorrections_cff') +process.load('PhysicsTools.PatAlgos.producersLayer1.metProducer_cfi') +process.patMETs.addGenMET = cms.bool(False) +#Try scheduled processs +process.path = cms.Path(process.goodVertices*process.trackingFailureFilter* + process.hltFilter* + process.HBHENoiseFilterResultProducer* + process.HBHENoiseFilterResultProducerNoMinZ* + process.patMETCorrections*process.patMETs#process.patDefaultSequence* + #*process.ak4 *process.ak5*process.ak7*process.ak8) + *process.ak4*process.ak7) + + +#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +#! Output and Log +#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(False) ) +process.options.allowUnscheduled = cms.untracked.bool(True) diff --git a/AnalysisFW/test/ProcessedTreeProducer_dataPAT25ns_BTag_cfg.py b/AnalysisFW/test/ProcessedTreeProducer_dataPAT25ns_BTag_cfg.py index 8dd99d3cd9b..48f06e17974 100644 --- a/AnalysisFW/test/ProcessedTreeProducer_dataPAT25ns_BTag_cfg.py +++ b/AnalysisFW/test/ProcessedTreeProducer_dataPAT25ns_BTag_cfg.py @@ -3,10 +3,10 @@ import FWCore.ParameterSet.Config as cms from RecoJets.Configuration.RecoPFJets_cff import ak4PFJets, ak4PFJetsCHS -#from RecoJets.Configuration.RecoGenJets_cff import ak4GenJets +from RecoJets.Configuration.RecoGenJets_cff import ak4GenJets from RecoJets.JetProducers.SubJetParameters_cfi import SubJetParameters from RecoJets.JetProducers.PFJetParameters_cfi import * -#from RecoJets.JetProducers.GenJetParameters_cfi import * +from RecoJets.JetProducers.GenJetParameters_cfi import * from RecoJets.JetProducers.AnomalousCellParameters_cfi import * from PhysicsTools.PatAlgos.producersLayer1.patCandidates_cff import * from PhysicsTools.PatAlgos.selectionLayer1.jetSelector_cfi import selectedPatJets @@ -32,15 +32,16 @@ process.load("Configuration.EventContent.EventContent_cff") process.load('Configuration.StandardSequences.GeometryRecoDB_cff') process.load('Configuration.StandardSequences.MagneticField_38T_cff') -#process.load('RecoJets.Configuration.GenJetParticles_cff') -#process.load('RecoJets.Configuration.RecoGenJets_cff') +process.load('RecoJets.Configuration.GenJetParticles_cff') +process.load('RecoJets.Configuration.RecoGenJets_cff') process.load('RecoJets.JetProducers.TrackJetParameters_cfi') process.load('RecoJets.JetProducers.PileupJetIDParams_cfi') process.load("PhysicsTools.PatAlgos.patSequences_cff") #process.load("PhysicsTools.PatAlgos.slimming.pileupJetId_cfi") -process.GlobalTag.globaltag = "76X_dataRun2_v15" +#process.GlobalTag.globaltag = "74X_dataRun2_Prompt_v4" +process.GlobalTag.globaltag = "76X_dataRun2_v5" ##-------------------- Import the JEC services ----------------------- process.load('JetMETCorrections.Configuration.DefaultJEC_cff') @@ -55,7 +56,7 @@ #'root://xrootd.unl.edu//store/data/Run2015C/JetHT/AOD/PromptReco-v1/000/253/890/00000/24D029CE-2741-E511-B0AF-02163E014604.root' #'root://xrootd.unl.edu//store/data/Run2015D/JetHT/AOD/PromptReco-v3/000/256/674/00000/36D872F3-F95E-E511-870B-02163E013539.root' #'root://xrootd.unl.edu//store/data/Run2015D/JetHT/AOD/PromptReco-v3/000/256/729/00000/5C1F5529-F65F-E511-9B8C-02163E0145D9.root' - 'file:/afs/cern.ch/work/g/gflouris/Ntuples_13TeV/CMSSW_7_6_3/src/SMPJ/AnalysisFW/test/5C1F5529-F65F-E511-9B8C-02163E0145D9.root' +'file:2E97A695-7DA8-E511-AB7C-001D09FDD6AB.root' ) process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(100)) @@ -65,8 +66,7 @@ def jetToolbox( proc, jetType, jetSequence,PUMethod='', bTagDiscriminators = Non JETCorrPayload='None' JETCorrLevels = [ 'None' ] - bTagDiscriminators = ['trackCountingHighEffBJetTags','trackCountingHighPurBJetTags','pfTrackCountingHighEffBJetTags','pfTrackCountingHighPurBJetTags','softPFMuonByIP3dBJetTags','softPFElectronByIP3dBJetTags','softPFMuonBJetTags','softPFElectronBJetTags','simpleSecondaryVertexHighEffBJetTags','simpleSecondaryVertexHighPurBJetTags','pfSimpleSecondaryVertexHighEffBJetTags','pfSimpleSecondaryVertexHighPurBJetTags','combinedSecondaryVertexBJetTags','pfCombinedSecondaryVertexSoftLeptonBJetTags','pfPositiveCombinedSecondaryVertexBJetTags','pfNegativeCombinedSecondaryVertexBJetTags'] -#,'pfCombinedSecondaryVertexBJetTags','pfCombinedMVABJetTags','pfCombinedSecondaryVertexSoftLeptonBJetTags','pfPositiveCombinedSecondaryVertexBJetTags','pfNegativeCombinedSecondaryVertexBJetTags'] + bTagDiscriminators = ['trackCountingHighEffBJetTags','trackCountingHighPurBJetTags','pfTrackCountingHighEffBJetTags','pfTrackCountingHighPurBJetTags','softPFMuonByIP3dBJetTags','softPFElectronByIP3dBJetTags','softPFMuonBJetTags','softPFElectronBJetTags','simpleSecondaryVertexHighEffBJetTags','simpleSecondaryVertexHighPurBJetTags','pfSimpleSecondaryVertexHighEffBJetTags','pfSimpleSecondaryVertexHighPurBJetTags','combinedSecondaryVertexBJetTags','pfCombinedSecondaryVertexSoftLeptonBJetTags','pfPositiveCombinedSecondaryVertexBJetTags','pfNegativeCombinedSecondaryVertexBJetTags','pfCombinedInclusiveSecondaryVertexV2BJetTags','pfCombinedMVAV2BJetTags','pfJetProbabilityBJetTags'] #,'pfCombinedInclusiveSecondaryVertexBJetTags' #GetJetMCFlavour = ['True'] @@ -80,11 +80,8 @@ def jetToolbox( proc, jetType, jetSequence,PUMethod='', bTagDiscriminators = Non elemToKeep = [] print 'Running processes with: '+str(jetALGO)+' PF '+PUMethod+' jet algorithm with radius parameter '+str(jetSize) - if(size=='7') : - JETCorrPayload = 'AK8PF'+PUMethod.lower() - else : - JETCorrPayload = 'AK'+size+'PF'+PUMethod.lower() + JETCorrPayload = 'AK'+size+'PF'+PUMethod.lower() JETCorrLevels = ['L1FastJet', 'L2Relative', 'L3Absolute','L2L3Residual'] #JETCorrLevels = [] #No JEC corrections JEC = ( JETCorrPayload, JETCorrLevels , 'None') @@ -100,9 +97,9 @@ def jetToolbox( proc, jetType, jetSequence,PUMethod='', bTagDiscriminators = Non tvLabel = '' toolsUsed = [] - #proc.load('RecoJets.Configuration.GenJetParticles_cff') - #setattr( proc, jetalgo+'GenJetsNoNu', ak4GenJets.clone( src = 'genParticlesForJetsNoNu', rParam = jetSize, jetAlgorithm = algorithm ) ) - #jetSeq += getattr(proc, jetalgo+'GenJetsNoNu' ) + proc.load('RecoJets.Configuration.GenJetParticles_cff') + setattr( proc, jetalgo+'GenJetsNoNu', ak4GenJets.clone( src = 'genParticlesForJetsNoNu', rParam = jetSize, jetAlgorithm = algorithm ) ) + jetSeq += getattr(proc, jetalgo+'GenJetsNoNu' ) proc.load('CommonTools.ParticleFlow.pfNoPileUpJME_cff') #### Creating PATjets @@ -140,7 +137,7 @@ def jetToolbox( proc, jetType, jetSequence,PUMethod='', bTagDiscriminators = Non jetCorrections = JEC, #( 'AK'+size+'PFchs', cms.vstring( ['L1FastJet', 'L2Relative', 'L3Absolute']), 'None'), pfCandidates = cms.InputTag( 'particleFlow' ), #'packedPFCandidates'), svSource = cms.InputTag('inclusiveCandidateSecondaryVertices'), - #genJetCollection = cms.InputTag( ''), + genJetCollection = cms.InputTag( jetalgo+'GenJetsNoNu'), pvSource = cms.InputTag( 'offlinePrimaryVertices' ), #'offlineSlimmedPrimaryVertices'), jetTrackAssociation = True, @@ -170,7 +167,7 @@ def jetToolbox( proc, jetType, jetSequence,PUMethod='', bTagDiscriminators = Non #getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod).userData.userFloats.src += [jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator:fullDiscriminant'] #getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod).userData.userInts.src += [jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator:cutbasedId',jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator:fullId'] - #getattr(proc,'patJetPartons').particles = cms.InputTag( 'genParticles' ) #'prunedGenParticles') + getattr(proc,'patJetPartons').particles = cms.InputTag( 'genParticles' ) #'prunedGenParticles') setattr(proc, 'selectedPatJets'+jetALGO+'PF'+PUMethod, selectedPatJets.clone( src = 'patJets'+jetALGO+'PF'+PUMethod ) ) setattr(proc, jetSequence, jetSeq) @@ -199,11 +196,6 @@ def jetToolbox( proc, jetType, jetSequence,PUMethod='', bTagDiscriminators = Non process.patJets.addAssociatedTracks = True process.ak4 = cms.EDAnalyzer('ProcessedTreeProducerBTag', - noiseSummary = cms.InputTag("HBHENoiseFilterResultProducer","HBHENoiseFilterResult"), - noiseSummary_NoMinZ = cms.InputTag("HBHENoiseFilterResultProducerNoMinZ","HBHENoiseFilterResult"), - genParticles = cms.InputTag('genParticles'), - generator = cms.InputTag('generator'), - offlineBeamSpot = cms.InputTag('offlineBeamSpot'), ## jet collections ########################### pfjets = cms.InputTag('selectedPatJetsAK4PF'), pfjetschs = cms.InputTag('selectedPatJetsAK4PFCHS'), @@ -211,7 +203,7 @@ def jetToolbox( proc, jetType, jetSequence,PUMethod='', bTagDiscriminators = Non pfchsjetpuid = cms.string('AK4PFCHSpileupJetIdEvaluator:fullDiscriminant'), ## MET collection #### pfmet = cms.InputTag('patMETs'), - genjets = cms.InputTag('ak4GenJetsNoNu'), + genjets = cms.untracked.InputTag('ak4GenJetsNoNu'), ## database entry for the uncertainties ###### PFPayloadName = cms.string('AK4PF'), PFPayloadNameCHS= cms.string('AK4PFchs'), @@ -220,42 +212,47 @@ def jetToolbox( proc, jetType, jetSequence,PUMethod='', bTagDiscriminators = Non jecUncSrcNames = cms.vstring(''), ## set the conditions for good Vtx counting ## offlineVertices = cms.InputTag('offlinePrimaryVertices'), + beamSpot = cms.InputTag('offlineBeamSpot'), goodVtxNdof = cms.double(4), goodVtxZ = cms.double(24), ## rho ####################################### srcCaloRho = cms.InputTag('fixedGridRhoFastjetAllCalo'), srcPFRho = cms.InputTag('fixedGridRhoFastjetAll'), - srcPU = cms.InputTag('addPileupInfo'), + srcPULabel = cms.untracked.InputTag('addPileupInfo','addPileupInfo'), ## preselection cuts ######################### maxY = cms.double(5.0), minPFPt = cms.double(20), minNPFJets = cms.int32(1), minGenPt = cms.untracked.double(20), minJJMass = cms.double(-1), - isMCarlo = cms.untracked.bool(False), - useGenInfo = cms.untracked.bool(False), + isMCarlo = cms.untracked.bool(False), + useGenInfo = cms.untracked.bool(False), ## trigger ################################### printTriggerMenu = cms.untracked.bool(True), processName = cms.string('HLT'), - triggerName = cms.vstring('HLT_PFJet40_v3','HLT_PFJet60_v3', 'HLT_PFJet80_v3', 'HLT_PFJet140_v3', 'HLT_PFJet200_v3', 'HLT_PFJet260_v3','HLT_PFJet320_v3', 'HLT_PFJet400_v3', 'HLT_PFJet450_v3','HLT_PFJet500_v3', - 'HLT_PFHT200_v2','HLT_PFHT250_v2','HLT_PFHT300_v2','HLT_PFHT350_v3','HLT_PFHT400_v2','HLT_PFHT475_v2','HLT_PFHT600_v3','HLT_PFHT650_v3','HLT_PFHT800_v2','HLT_ZeroBias_v2','HLT_AK4PFJet30_v3','HLT_AK4PFJet50_v3','HLT_AK4PFJet80_v3','HLT_AK4PFJet100_v3'), + triggerName = cms.vstring('HLT_PFJet40_v3','HLT_PFJet60_v3', 'HLT_PFJet80_v3', 'HLT_PFJet140_v3', 'HLT_PFJet200_v3', 'HLT_PFJet260_v3','HLT_PFJet320_v3', 'HLT_PFJet400_v3', 'HLT_PFJet450_v3','HLT_PFJet500_v3','HLT_PFHT600_v3','HLT_PFHT650_v3','HLT_PFHT800_v2','HLT_PFHT200_v2','HLT_PFHT250_v2','HLT_PFHT300_v2','HLT_PFHT350_v3','HLT_PFHT400_v2','HLT_PFHT475_v2','HLT_ZeroBias_v2','HLT_AK4PFJet30_v3','HLT_AK4PFJet50_v3','HLT_AK4PFJet80_v3','HLT_AK4PFJet100_v3','HLT_PFJet40_v4','HLT_PFJet60_v4', 'HLT_PFJet80_v4', 'HLT_PFJet140_v4', 'HLT_PFJet200_v4', 'HLT_PFJet260_v4','HLT_PFJet320_v4', 'HLT_PFJet400_v4', 'HLT_PFJet450_v4','HLT_PFJet500_v4'), triggerResults = cms.InputTag("TriggerResults","","HLT"), triggerEvent = cms.InputTag("hltTriggerSummaryAOD","","HLT"), ## jec services ############################## + #new tokens + EventInfo = cms.InputTag("generator"), + GenParticles = cms.InputTag("genparticles"), + HBHENoiseFilterResultLabel = cms.InputTag("HBHENoiseFilterResultProducer", "HBHENoiseFilterResult"), + HBHENoiseFilterResultNoMinZLabel = cms.InputTag("HBHENoiseFilterResultProducerNoMinZ", "HBHENoiseFilterResult"), #pfjecService = cms.string('ak7PFL1FastL2L3Residual'), ) -# jetToolbox( process, 'ak8', 'ak8JetSubs','CHS') -# jetToolbox( process, 'ak8', 'ak8JetSubs') +jetToolbox( process, 'ak8', 'ak8JetSubs','CHS') +jetToolbox( process, 'ak8', 'ak8JetSubs') -# process.ak8 = process.ak4.clone( -# pfjets = cms.InputTag('selectedPatJetsAK8PF'), -# pfjetschs = cms.InputTag('selectedPatJetsAK8PFCHS'), -# pfpujetid = cms.string('AK8PFpileupJetIdEvaluator:fullDiscriminant'), -# pfchsjetpuid = cms.string('AK8PFCHSpileupJetIdEvaluator:fullDiscriminant'), -# PFPayloadName = cms.string('AK8PF'), -# PFPayloadNameCHS= cms.string('AK8PFchs'), -# ) +process.ak8 = process.ak4.clone( + pfjets = cms.InputTag('selectedPatJetsAK8PF'), + pfjetschs = cms.InputTag('selectedPatJetsAK8PFCHS'), + pfpujetid = cms.string('AK8PFpileupJetIdEvaluator:fullDiscriminant'), + pfchsjetpuid = cms.string('AK8PFCHSpileupJetIdEvaluator:fullDiscriminant'), + PFPayloadName = cms.string('AK8PF'), + PFPayloadNameCHS= cms.string('AK8PFchs'), +) jetToolbox( process, 'ak7', 'ak7JetSubs','CHS') jetToolbox( process, 'ak7', 'ak7JetSubs') @@ -269,22 +266,22 @@ def jetToolbox( proc, jetType, jetSequence,PUMethod='', bTagDiscriminators = Non PFPayloadNameCHS= cms.string('AK7PFchs'), ) -# jetToolbox( process, 'ak5', 'ak5JetSubs','CHS') -# jetToolbox( process, 'ak5', 'ak5JetSubs') +jetToolbox( process, 'ak5', 'ak5JetSubs','CHS') +jetToolbox( process, 'ak5', 'ak5JetSubs') -# process.ak5 = process.ak4.clone( -# pfjets = cms.InputTag('selectedPatJetsAK5PF'), -# pfjetschs = cms.InputTag('selectedPatJetsAK5PFCHS'), -# pfpujetid = cms.string('AK5PFpileupJetIdEvaluator:fullDiscriminant'), -# pfchsjetpuid = cms.string('AK5PFCHSpileupJetIdEvaluator:fullDiscriminant'), -# PFPayloadName = cms.string('AK5PF'), -# PFPayloadNameCHS= cms.string('AK5PFchs'), -# ) +process.ak5 = process.ak4.clone( + pfjets = cms.InputTag('selectedPatJetsAK5PF'), + pfjetschs = cms.InputTag('selectedPatJetsAK5PFCHS'), + pfpujetid = cms.string('AK5PFpileupJetIdEvaluator:fullDiscriminant'), + pfchsjetpuid = cms.string('AK5PFCHSpileupJetIdEvaluator:fullDiscriminant'), + PFPayloadName = cms.string('AK5PF'), + PFPayloadNameCHS= cms.string('AK5PFchs'), +) ############# hlt filter ######################### process.hltFilter = cms.EDFilter('HLTHighLevel', TriggerResultsTag = cms.InputTag('TriggerResults','','HLT'), - HLTPaths = cms.vstring('HLT_PFJet40_v3','HLT_PFJet60_v3', 'HLT_PFJet80_v3', 'HLT_PFJet140_v3', 'HLT_PFJet200_v3', 'HLT_PFJet260_v3','HLT_PFJet320_v3', 'HLT_PFJet400_v3', 'HLT_PFJet450_v3','HLT_PFJet500_v3','HLT_PFHT600_v3','HLT_PFHT650_v3','HLT_PFHT800_v2','HLT_PFHT200_v2','HLT_PFHT250_v2','HLT_PFHT300_v2','HLT_PFHT350_v3','HLT_PFHT400_v2','HLT_PFHT475_v2','HLT_ZeroBias_v2','HLT_AK4PFJet30_v3','HLT_AK4PFJet50_v3','HLT_AK4PFJet80_v3','HLT_AK4PFJet100_v3'), + HLTPaths = cms.vstring('HLT_PFJet40_v3','HLT_PFJet60_v3', 'HLT_PFJet80_v3', 'HLT_PFJet140_v3', 'HLT_PFJet200_v3', 'HLT_PFJet260_v3','HLT_PFJet320_v3', 'HLT_PFJet400_v3', 'HLT_PFJet450_v3','HLT_PFJet500_v3','HLT_PFHT600_v3','HLT_PFHT650_v3','HLT_PFHT800_v2','HLT_PFHT200_v2','HLT_PFHT250_v2','HLT_PFHT300_v2','HLT_PFHT350_v3','HLT_PFHT400_v2','HLT_PFHT475_v2','HLT_ZeroBias_v2','HLT_AK4PFJet30_v3','HLT_AK4PFJet50_v3','HLT_AK4PFJet80_v3','HLT_AK4PFJet100_v3','HLT_PFJet40_v4','HLT_PFJet60_v4', 'HLT_PFJet80_v4', 'HLT_PFJet140_v4', 'HLT_PFJet200_v4', 'HLT_PFJet260_v4','HLT_PFJet320_v4', 'HLT_PFJet400_v4', 'HLT_PFJet450_v4','HLT_PFJet500_v4'), eventSetupPathsKey = cms.string(''), andOr = cms.bool(True), #----- True = OR, False = AND between the HLTPaths throw = cms.bool(False) @@ -313,9 +310,9 @@ def jetToolbox( proc, jetType, jetSequence,PUMethod='', bTagDiscriminators = Non process.hltFilter* process.HBHENoiseFilterResultProducer* process.HBHENoiseFilterResultProducerNoMinZ* - process.patMETCorrections*process.patMETs*#process.patDefaultSequence* - #process.ak4 *process.ak5*process.ak7*process.ak8) - process.ak4*process.ak7) + process.patMETCorrections*process.patMETs#process.patDefaultSequence* + #*process.ak4 *process.ak5*process.ak7*process.ak8) + *process.ak4*process.ak7) #!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! diff --git a/AnalysisFW/test/crabDataAODBTag.py b/AnalysisFW/test/crabDataAODBTag.py new file mode 100644 index 00000000000..bdc75ba5283 --- /dev/null +++ b/AnalysisFW/test/crabDataAODBTag.py @@ -0,0 +1,27 @@ +from WMCore.Configuration import Configuration +config = Configuration() + +config.section_("User") +config.User.voGroup = 'dcms' + +config.section_("General") +config.General.requestName = 'JetData-July2015-MagnField-Run2015D_25ns-BTag-76X-ReReco-v3' +config.General.workArea = 'JetDataWithJsonFile-MagnField-Run2015D_25ns-BTag-76X-ReReco-v3' + +config.section_("JobType") +config.JobType.pluginName = 'Analysis' +config.JobType.psetName = 'ProcessedTreeProducer_dataPAT25ns_BTag_cfg.py' + +config.section_("Data") +config.Data.inputDataset = '/JetHT/Run2015D-16Dec2015-v1/AOD' +#config.Data.inputDataset = '/JetHT/Run2015D-16Dec2015-v1/AOD' +#config.Data.inputDataset = '/JetHT/Run2015C_25ns-05Oct2015-v1/AOD ' +config.Data.splitting = 'LumiBased' #LumiBased' +config.Data.unitsPerJob = 10 +config.Data.lumiMask = 'Cert_13TeV_16Dec2015ReReco_Collisions15_25ns_JSON.txt' +config.Data.runRange = '246908-260627' # '193093-194075' +config.Data.outputDatasetTag = 'CRAB3_JetData-25ns-Run2015D_v3-BTag-76X-ReReco-v3' + +config.section_("Site") +config.Site.storageSite = "T2_DE_DESY" +#config.Site.whitelist = ['T2_DE_DESY'] diff --git a/AnalysisFW/test/crabDataAODBTagRunC.py b/AnalysisFW/test/crabDataAODBTagRunC.py new file mode 100644 index 00000000000..622ef431ed4 --- /dev/null +++ b/AnalysisFW/test/crabDataAODBTagRunC.py @@ -0,0 +1,28 @@ +from WMCore.Configuration import Configuration +config = Configuration() + +config.section_("User") +config.User.voGroup = 'dcms' + +config.section_("General") +config.General.requestName = 'JetData-July2015-MagnField-Run2015C_25ns-BTag-76X-16Dec-v3' +config.General.workArea = 'JetDataWithJsonFile-MagnField-Run2015C_25ns-BTag-76X-16Dec-v3' + +config.section_("JobType") +config.JobType.pluginName = 'Analysis' +config.JobType.psetName = 'ProcessedTreeProducer_dataPAT25ns_BTag_RunC_cfg.py' + +config.section_("Data") +#config.Data.inputDataset = '/JetHT/Run2015D-PromptReco-v3/AOD' +#config.Data.inputDataset = '/JetHT/Run2015D-PromptReco-v4/AOD' +config.Data.inputDataset = '/JetHT/Run2015C_25ns-16Dec2015-v1/AOD' +config.Data.splitting = 'LumiBased' #LumiBased' +config.Data.unitsPerJob = 10 +#config.Data.lumiMask = 'Cert_246908-251883_13TeV_PromptReco_Collisions15_JSON_v3.txt' +#config.Data.lumiMask = 'Cert_254833_13TeV_PromptReco_Collisions15_JSON.txt' +config.Data.lumiMask = 'Cert_246908-260627_13TeV_PromptReco_Collisions15_25ns_JSON_v2.txt' +config.Data.runRange = '246908-260627' # '193093-194075' +config.Data.outputDatasetTag = 'CRAB3_JetData-December2015-25ns-Run2015C-BTag-76X-16Dec-v3' + +config.section_("Site") +config.Site.storageSite = "T2_DE_DESY" diff --git a/AnalysisFW/test/crabMC-madgraphSlices.py b/AnalysisFW/test/crabMC-madgraphSlices.py new file mode 100644 index 00000000000..a85ad47ff6c --- /dev/null +++ b/AnalysisFW/test/crabMC-madgraphSlices.py @@ -0,0 +1,33 @@ +from WMCore.Configuration import Configuration +config = Configuration() + +config.section_("User") +config.User.voGroup = 'dcms' + +config.section_("General") +config.General.requestName = 'MadgraphP8Ntuples-January2016-Slice100-200-76X' +config.General.workArea = 'MadgraphP8Ntuples-January2016-TuneCUETM1-Slice100-200GeV-76X' + +config.section_("JobType") +config.JobType.pluginName = 'Analysis' +config.JobType.psetName = 'ProcessedTreeProducer_MCPAT25ns_BTag_cfg.py' + +config.section_("Data") +config.Data.inputDataset = '/QCD_HT100to200_TuneCUETP8M1_13TeV-madgraphMLM-pythia8/RunIIFall15DR76-PU25nsData2015v1_76X_mcRun2_asymptotic_v12-v1/AODSIM' +config.Data.splitting = 'EventAwareLumiBased' #LumiBased' +config.Data.unitsPerJob = 12000 +config.Data.outputDatasetTag = 'CRAB3_MadgraphP8NtuplesTuneCUETM1-January2016-Slice100-200GeV-76X' + +config.section_("Site") +config.Site.storageSite = "T2_DE_DESY" + +#/QCD_HT1000to1500_TuneCUETP8M1_13TeV-madgraphMLM-pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v2/AODSIM +#/QCD_HT100to200_TuneCUETP8M1_13TeV-madgraphMLM-pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v2/AODSIM +#/QCD_HT1500to2000_TuneCUETP8M1_13TeV-madgraphMLM-pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/AODSIM +#/QCD_HT2000toInf_TuneCUETP8M1_13TeV-madgraphMLM-pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/AODSIM +#/QCD_HT2000toInf_TuneCUETP8M1_13TeV-madgraphMLM-pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9_ext1-v1/AODSIM +#/QCD_HT200to300_TuneCUETP8M1_13TeV-madgraphMLM-pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v2/AODSIM +#/QCD_HT300to500_TuneCUETP8M1_13TeV-madgraphMLM-pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v2/AODSIM +#/QCD_HT500to700_TuneCUETP8M1_13TeV-madgraphMLM-pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/AODSIM +#/QCD_HT500to700_TuneCUETP8M1_13TeV-madgraphMLM-pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9_ext1-v3/AODSIM +#/QCD_HT700to1000_TuneCUETP8M1_13TeV-madgraphMLM-pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/AODSIM diff --git a/AnalysisFW/test/crabMC-pythia8Slices.py b/AnalysisFW/test/crabMC-pythia8Slices.py new file mode 100644 index 00000000000..57b863813bc --- /dev/null +++ b/AnalysisFW/test/crabMC-pythia8Slices.py @@ -0,0 +1,39 @@ +from WMCore.Configuration import Configuration +config = Configuration() + +config.section_("User") +config.User.voGroup = 'dcms' + +config.section_("General") +config.General.requestName = 'Pythia8-25ns-Ntuples-January2016-Slice30-50GeV-v2' +config.General.workArea = 'Pythia8-25ns-Ntuples-January2016-TuneCUETM1-Slice30-50GeV-v2' + +config.section_("JobType") +config.JobType.pluginName = 'Analysis' +config.JobType.psetName = 'ProcessedTreeProducer_MCPAT25ns_BTag_cfg.py' + +config.section_("Data") +config.Data.inputDataset = '/QCD_Pt_30to50_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v2/AODSIM' +config.Data.splitting = 'EventAwareLumiBased' #LumiBased' +config.Data.unitsPerJob = 12000 +config.Data.outputDatasetTag = 'CRAB3_Pythia8-25ns-NtuplesTuneCUETM1-January2016-Slice30-50GeV-v2' + +config.section_("Site") +config.Site.storageSite = "T2_DE_DESY" + +#/QCD_Pt_15to30_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v2/AODSIM +#/QCD_Pt_30to50_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v2/AODSIM +#/QCD_Pt_50to80_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v2/AODSIM + +#/QCD_Pt_80to120_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/AODSIM +#/QCD_Pt_120to170_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/AODSIM +#/QCD_Pt_170to300_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v2/AODSIM +#/QCD_Pt_300to470_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/AODSIM +#/QCD_Pt_470to600_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v2/AODSIM +#/QCD_Pt_600to800_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v3/AODSIM +#/QCD_Pt_800to1000_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v2/AODSIM +#/QCD_Pt_1000to1400_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/AODSIM +#/QCD_Pt_1400to1800_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/AODSIM +#/QCD_Pt_1800to2400_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/AODSIM +#/QCD_Pt_2400to3200_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/AODSIM +#/QCD_Pt_3200toInf_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/AODSIM From 9a230bc6b4e1763d30f73eacffba10af09ea1b1d Mon Sep 17 00:00:00 2001 From: pgunnell Date: Tue, 23 Feb 2016 09:44:18 +0100 Subject: [PATCH 04/48] Create AnalysisTemplate.h --- AnalysisFW/plugins/AnalysisTemplate.h | 426 ++++++++++++++++++++++++++ 1 file changed, 426 insertions(+) create mode 100644 AnalysisFW/plugins/AnalysisTemplate.h diff --git a/AnalysisFW/plugins/AnalysisTemplate.h b/AnalysisFW/plugins/AnalysisTemplate.h new file mode 100644 index 00000000000..e681c6883ac --- /dev/null +++ b/AnalysisFW/plugins/AnalysisTemplate.h @@ -0,0 +1,426 @@ +#ifndef My_azimuthal_MC_h +#define My_azimuthal_MC_h + +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "SMPJ/AnalysisFW/interface/QCDJet.h" +#include "SMPJ/AnalysisFW/interface/QCDEvent.h" +#include "SMPJ/AnalysisFW/interface/QCDEventHdr.h" +#include "SMPJ/AnalysisFW/interface/QCDCaloJet.h" +#include "SMPJ/AnalysisFW/interface/QCDPFJet.h" +#include "SMPJ/AnalysisFW/interface/QCDMET.h" +#include "FWCore/ServiceRegistry/interface/Service.h" +#include "CommonTools/UtilAlgos/interface/TFileService.h" +//#include "PhysicsTools/Utilities/interface/LumiReweighting.h" +#include "TTree.h" +#include "TH1F.h" +#include "TH2F.h" +#include "TFile.h" +#include "TProfile.h" +#include +#include +using namespace edm; +using namespace std; + +#include "SMPJ/AnalysisFW/plugins/JECs.h" +//#include "SMPJ/AnalysisFW/plugins/JECs_S15.h" + +//#include "../Unfolding/RooUnfold-1.1.1/src/RooUnfold.h" +//#include "../Unfolding/RooUnfold-1.1.1/src/RooUnfoldResponse.h" + + +class Analysis_Template_MC : public edm::EDAnalyzer + { + public: + explicit Analysis_Template_MC(edm::ParameterSet const& cfg); + virtual void beginJob(); + virtual void analyze(edm::Event const& iEvent, edm::EventSetup const& iSetup); + virtual void endJob(); + virtual ~Analysis_Template_MC(); + + private: + //---- configurable parameters -------- + std::string mjettype,mGlobalTag,mTreeName,mDirName; + std::vector mFileName; + double mMinPt, mYMax; + int mJetID; // looseID==1 tightID==2 + int mprintOk; // noPrint=0 Print=1 + int mMCSlice; // noPrint=0 Print=1 + bool mIsMCarlo; + bool mPUReweighting; + bool mLowPileUp; + std::vector mJECUncSrcNames; + string mJECUncSrc; + + edm::Service fs; + //std::vector *mTree; + //std::vector *mInf; + TFile *mPuf,*mInf; + TTree *mTree; + //std::vector *mDir; + TDirectoryFile *mDir; + + //---- TREE variable -------- + QCDEvent *Event; + + JECs *jecs; + + //--------- Histogram Declaration --------------------// + // Vertices + TH1F *num_of_Vtx; + TH1F *num_of_VtxGood; + + TH1F *mc_pthat; + TH1F *mc_pthat_weighted; + + ///Measurement Gen jets + TH1F *pt0_GENJet; + TH1F *pt1_GENJet; + TH1F *y0_GENJet; + TH1F *y1_GENJet; + TH1F *phi0_GENJet; + TH1F *phi1_GENJet; + + TH1F *Multiplicity_GENJet; + + ///Measurement Det jets + TH1F *pt0_DETJet; + TH1F *pt1_DETJet; + TH1F *pt0_DETJetUncor; + TH1F *pt1_DETJetUncor; + TH1F *y0_DETJet; + TH1F *y1_DETJet; + TH1F *phi0_DETJet; + TH1F *phi1_DETJet; + + TH1F *Multiplicity_DETJet; + + TH1F *pt0_DETInclJet; + TH1F *pt0_DETInclJetUncor; + TH1F *y0_DETInclJet; + TH1F *phi0_DETInclJet; + + // Purity and stability + TH1F *PF_MatchedInclusiveJets; + TH1F *Gen_MatchedInclusiveJets; + TH2F *TwoD_MatchedInclusiveJets; + TH1F *PF_FakeInclusiveJets; + + TH1F *Gen_MissInclusiveJets; + TH1F *DeltaR_Jets; + + TH2F *PileUpVSVertex; + + TH1F *AcceptancePtJets; + TH1F *PurityPtJets; + TH1F *BackgroundPtJets; + TH1F *StabilityPtJets; + + TH1F *AcceptancePtJets_1bin; + TH1F *PurityPtJets_1bin; + TH1F *AcceptancePtJets_2bin; + TH1F *PurityPtJets_2bin; + TH1F *AcceptancePtJets_3bin; + TH1F *PurityPtJets_3bin; + TH1F *AcceptancePtJets_4bin; + TH1F *PurityPtJets_4bin; + TH1F *AcceptancePtJets_5bin; + TH1F *PurityPtJets_5bin; + TH1F *AcceptancePtJets_6bin; + TH1F *PurityPtJets_6bin; + TH1F *AcceptancePtJets_7bin; + TH1F *PurityPtJets_7bin; + + TH1F *BackgroundPtJets_1bin; + TH1F *StabilityPtJets_1bin; + TH1F *BackgroundPtJets_2bin; + TH1F *StabilityPtJets_2bin; + TH1F *BackgroundPtJets_3bin; + TH1F *StabilityPtJets_3bin; + TH1F *BackgroundPtJets_4bin; + TH1F *StabilityPtJets_4bin; + TH1F *BackgroundPtJets_5bin; + TH1F *StabilityPtJets_5bin; + TH1F *BackgroundPtJets_6bin; + TH1F *StabilityPtJets_6bin; + TH1F *BackgroundPtJets_7bin; + TH1F *StabilityPtJets_7bin; + + TH1F* pt_DETInclJet_1bin; + TH1F* pt_DETInclJet_2bin; + TH1F* pt_DETInclJet_3bin; + TH1F* pt_DETInclJet_4bin; + TH1F* pt_DETInclJet_5bin; + TH1F* pt_DETInclJet_6bin; + TH1F* pt_DETInclJet_7bin; + + TH1F* pt_DETInclJetCrossSectNorm_1bin; + TH1F* pt_DETInclJetCrossSectNorm_2bin; + TH1F* pt_DETInclJetCrossSectNorm_3bin; + TH1F* pt_DETInclJetCrossSectNorm_4bin; + TH1F* pt_DETInclJetCrossSectNorm_5bin; + TH1F* pt_DETInclJetCrossSectNorm_6bin; + TH1F* pt_DETInclJetCrossSectNorm_7bin; + + TH1F* pt_GENInclJetCrossSectNorm_1bin; + TH1F* pt_GENInclJetCrossSectNorm_2bin; + TH1F* pt_GENInclJetCrossSectNorm_3bin; + TH1F* pt_GENInclJetCrossSectNorm_4bin; + TH1F* pt_GENInclJetCrossSectNorm_5bin; + TH1F* pt_GENInclJetCrossSectNorm_6bin; + TH1F* pt_GENInclJetCrossSectNorm_7bin; + + TH1F* pt_DETInclJet60_1bin; + TH1F* pt_DETInclJet60_2bin; + TH1F* pt_DETInclJet60_3bin; + TH1F* pt_DETInclJet60_4bin; + TH1F* pt_DETInclJet60_5bin; + TH1F* pt_DETInclJet60_6bin; + TH1F* pt_DETInclJet60_7bin; + + TH1F* pt_DETInclJet80_1bin; + TH1F* pt_DETInclJet80_2bin; + TH1F* pt_DETInclJet80_3bin; + TH1F* pt_DETInclJet80_4bin; + TH1F* pt_DETInclJet80_5bin; + TH1F* pt_DETInclJet80_6bin; + TH1F* pt_DETInclJet80_7bin; + + TH1F* pt_DETInclJet140_1bin; + TH1F* pt_DETInclJet140_2bin; + TH1F* pt_DETInclJet140_3bin; + TH1F* pt_DETInclJet140_4bin; + TH1F* pt_DETInclJet140_5bin; + TH1F* pt_DETInclJet140_6bin; + TH1F* pt_DETInclJet140_7bin; + + TH1F* pt_DETInclJet200_1bin; + TH1F* pt_DETInclJet200_2bin; + TH1F* pt_DETInclJet200_3bin; + TH1F* pt_DETInclJet200_4bin; + TH1F* pt_DETInclJet200_5bin; + TH1F* pt_DETInclJet200_6bin; + TH1F* pt_DETInclJet200_7bin; + + TH1F* pt_DETInclJet260_1bin; + TH1F* pt_DETInclJet260_2bin; + TH1F* pt_DETInclJet260_3bin; + TH1F* pt_DETInclJet260_4bin; + TH1F* pt_DETInclJet260_5bin; + TH1F* pt_DETInclJet260_6bin; + TH1F* pt_DETInclJet260_7bin; + + TH1F* pt_DETInclJet320_1bin; + TH1F* pt_DETInclJet320_2bin; + TH1F* pt_DETInclJet320_3bin; + TH1F* pt_DETInclJet320_4bin; + TH1F* pt_DETInclJet320_5bin; + TH1F* pt_DETInclJet320_6bin; + TH1F* pt_DETInclJet320_7bin; + + TH1F* pt_DETInclJet400_1bin; + TH1F* pt_DETInclJet400_2bin; + TH1F* pt_DETInclJet400_3bin; + TH1F* pt_DETInclJet400_4bin; + TH1F* pt_DETInclJet400_5bin; + TH1F* pt_DETInclJet400_6bin; + TH1F* pt_DETInclJet400_7bin; + + TH1F* pt_DETInclJet450_1bin; + TH1F* pt_DETInclJet450_2bin; + TH1F* pt_DETInclJet450_3bin; + TH1F* pt_DETInclJet450_4bin; + TH1F* pt_DETInclJet450_5bin; + TH1F* pt_DETInclJet450_6bin; + TH1F* pt_DETInclJet450_7bin; + + TH1F* pt_GENInclJet_1bin; + TH1F* pt_GENInclJet_2bin; + TH1F* pt_GENInclJet_3bin; + TH1F* pt_GENInclJet_4bin; + TH1F* pt_GENInclJet_5bin; + TH1F* pt_GENInclJet_6bin; + TH1F* pt_GENInclJet_7bin; + + TH1F* PF_MatchedInclusiveJets_1bin; + TH1F* PF_MatchedInclusiveJets_2bin; + TH1F* PF_MatchedInclusiveJets_3bin; + TH1F* PF_MatchedInclusiveJets_4bin; + TH1F* PF_MatchedInclusiveJets_5bin; + TH1F* PF_MatchedInclusiveJets_6bin; + TH1F* PF_MatchedInclusiveJets_7bin; + + TH1F* Gen_MatchedInclusiveJets_1bin; + TH1F* Gen_MatchedInclusiveJets_2bin; + TH1F* Gen_MatchedInclusiveJets_3bin; + TH1F* Gen_MatchedInclusiveJets_4bin; + TH1F* Gen_MatchedInclusiveJets_5bin; + TH1F* Gen_MatchedInclusiveJets_6bin; + TH1F* Gen_MatchedInclusiveJets_7bin; + + TH1F* PF_FakeInclusiveJets_1bin; + TH1F* PF_FakeInclusiveJets_2bin; + TH1F* PF_FakeInclusiveJets_3bin; + TH1F* PF_FakeInclusiveJets_4bin; + TH1F* PF_FakeInclusiveJets_5bin; + TH1F* PF_FakeInclusiveJets_6bin; + TH1F* PF_FakeInclusiveJets_7bin; + + TH1F* Gen_MissInclusiveJets_1bin; + TH1F* Gen_MissInclusiveJets_2bin; + TH1F* Gen_MissInclusiveJets_3bin; + TH1F* Gen_MissInclusiveJets_4bin; + TH1F* Gen_MissInclusiveJets_5bin; + TH1F* Gen_MissInclusiveJets_6bin; + TH1F* Gen_MissInclusiveJets_7bin; + + TH2F *TwoD_MatchedInclusiveJets_1bin; + TH2F *TwoD_MatchedInclusiveJets_2bin; + TH2F *TwoD_MatchedInclusiveJets_3bin; + TH2F *TwoD_MatchedInclusiveJets_4bin; + TH2F *TwoD_MatchedInclusiveJets_5bin; + TH2F *TwoD_MatchedInclusiveJets_6bin; + TH2F *TwoD_MatchedInclusiveJets_7bin; + + TH1F* Resolution1D; + TH1F* ResolutionForward1D; + + TProfile *ResolutionTagAndProbe; + + TProfile *ResolutionInclusiveJets; + TProfile *ResolutionInclusiveJets_1bin; + TProfile *ResolutionInclusiveJets_2bin; + TProfile *ResolutionInclusiveJets_3bin; + TProfile *ResolutionInclusiveJets_4bin; + TProfile *ResolutionInclusiveJets_5bin; + TProfile *ResolutionInclusiveJets_6bin; + TProfile *ResolutionInclusiveJets_7bin; + + TH1F *hist_leading_pt_emulated_Jet60; + TH1F *hist_leading_pt_all_Jet60; + TH1F *hist_leading_eta_emulated_Jet60; + TH1F *hist_leading_eta_all_Jet60; + TH1F *hist_leading_pt_HLT_Jet60U_eff; + TH1F *hist_leading_eta_HLT_Jet60U_eff; + + TH1F *hist_leading_pt_emulated_Jet80; + TH1F *hist_leading_pt_all_Jet80; + TH1F *hist_leading_eta_emulated_Jet80; + TH1F *hist_leading_eta_all_Jet80; + TH1F *hist_leading_pt_HLT_Jet80U_eff; + TH1F *hist_leading_eta_HLT_Jet80U_eff; + + TH1F *hist_leading_pt_emulated_Jet140; + TH1F *hist_leading_pt_all_Jet140; + TH1F *hist_leading_eta_emulated_Jet140; + TH1F *hist_leading_eta_all_Jet140; + TH1F *hist_leading_pt_HLT_Jet140U_eff; + TH1F *hist_leading_eta_HLT_Jet140U_eff; + + TH1F *hist_leading_pt_emulated_Jet200; + TH1F *hist_leading_pt_all_Jet200; + TH1F *hist_leading_eta_emulated_Jet200; + TH1F *hist_leading_eta_all_Jet200; + TH1F *hist_leading_pt_HLT_Jet200U_eff; + TH1F *hist_leading_eta_HLT_Jet200U_eff; + + TH1F *hist_leading_pt_emulated_Jet260; + TH1F *hist_leading_pt_all_Jet260; + TH1F *hist_leading_eta_emulated_Jet260; + TH1F *hist_leading_eta_all_Jet260; + TH1F *hist_leading_pt_HLT_Jet260U_eff; + TH1F *hist_leading_eta_HLT_Jet260U_eff; + + TH1F *hist_leading_pt_emulated_Jet320; + TH1F *hist_leading_pt_all_Jet320; + TH1F *hist_leading_eta_emulated_Jet320; + TH1F *hist_leading_eta_all_Jet320; + TH1F *hist_leading_pt_HLT_Jet320U_eff; + TH1F *hist_leading_eta_HLT_Jet320U_eff; + + TH1F *hist_leading_pt_emulated_Jet400; + TH1F *hist_leading_pt_all_Jet400; + TH1F *hist_leading_eta_emulated_Jet400; + TH1F *hist_leading_eta_all_Jet400; + TH1F *hist_leading_pt_HLT_Jet400U_eff; + TH1F *hist_leading_eta_HLT_Jet400U_eff; + + TH1F *hist_leading_pt_emulated_Jet450; + TH1F *hist_leading_pt_all_Jet450; + TH1F *hist_leading_eta_emulated_Jet450; + TH1F *hist_leading_eta_all_Jet450; + TH1F *hist_leading_pt_HLT_Jet450U_eff; + TH1F *hist_leading_eta_HLT_Jet450U_eff; + + TH1F *hist_leading_pt_emulated_Jet500; + TH1F *hist_leading_pt_all_Jet500; + TH1F *hist_leading_eta_emulated_Jet500; + TH1F *hist_leading_eta_all_Jet500; + TH1F *hist_leading_pt_HLT_Jet500U_eff; + TH1F *hist_leading_eta_HLT_Jet500U_eff; + + TH1F* TagAndProbeEff; + TH1F* TagAndProbeNum; + TH1F* TagAndProbeDen; + + TH1F* pt_DETInclJetUP_1bin; + TH1F* pt_DETInclJetUP_2bin; + TH1F* pt_DETInclJetUP_3bin; + TH1F* pt_DETInclJetUP_4bin; + TH1F* pt_DETInclJetUP_5bin; + TH1F* pt_DETInclJetUP_6bin; + TH1F* pt_DETInclJetUP_7bin; + + TH1F* pt_DETInclJetDOWN_1bin; + TH1F* pt_DETInclJetDOWN_2bin; + TH1F* pt_DETInclJetDOWN_3bin; + TH1F* pt_DETInclJetDOWN_4bin; + TH1F* pt_DETInclJetDOWN_5bin; + TH1F* pt_DETInclJetDOWN_6bin; + TH1F* pt_DETInclJetDOWN_7bin; + + TH1F* Chargedhf0_DETJet; + TH1F* Chargedef0_DETJet; + TH1F* Neutralhf0_DETJet; + TH1F* Photonef0_DETJet; + TH1F* Hadronef0_DETJet; + TH1F* Muonef0_DETJet; + TH1F* Electromagneticef0_DETJet; + + TH1F* ChargedhMultiplicity0_DETJet; + TH1F* ChargedeMultiplicity0_DETJet; + TH1F* NeutralhMultiplicity0_DETJet; + TH1F* PhotoneMultiplicity0_DETJet; + TH1F* HadroneMultiplicity0_DETJet; + TH1F* MuoneMultiplicity0_DETJet; + TH1F* ElectromagneticeMultiplicity0_DETJet; + + TH1F* Emf0_DETJet; + TH1F* Hpd0_DETJet; + TH1F* Chf0_DETJet; + TH1F* Nhf0_DETJet; + TH1F* Pef0_DETJet; + TH1F* Eef0_DETJet; + TH1F* Mef0_DETJet; + + TH1F* TruePileUpMC; + TH1F* TruePileUpMCInteger; + TH1F* TruePileUpDataInteger; + + TH1F* MET_DET; + TH1F* METPhi_DET; + TH1F* FractionMET_DET; + + /*RooUnfoldResponse resp_jetpt1etabin; + RooUnfoldResponse resp_jetpt2etabin; + RooUnfoldResponse resp_jetpt3etabin; + RooUnfoldResponse resp_jetpt4etabin; + RooUnfoldResponse resp_jetpt5etabin; + RooUnfoldResponse resp_jetpt6etabin; + RooUnfoldResponse resp_jetpt7etabin;*/ + + }; + +#endif + From 0f99d181e90cb726fbc5b3ab8f4acb2ce2222962 Mon Sep 17 00:00:00 2001 From: pgunnell Date: Tue, 23 Feb 2016 09:44:44 +0100 Subject: [PATCH 05/48] Create AnalysisTemplate.cc --- AnalysisFW/plugins/AnalysisTemplate.cc | 2281 ++++++++++++++++++++++++ 1 file changed, 2281 insertions(+) create mode 100644 AnalysisFW/plugins/AnalysisTemplate.cc diff --git a/AnalysisFW/plugins/AnalysisTemplate.cc b/AnalysisFW/plugins/AnalysisTemplate.cc new file mode 100644 index 00000000000..87b2023978a --- /dev/null +++ b/AnalysisFW/plugins/AnalysisTemplate.cc @@ -0,0 +1,2281 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "TMath.h" +#include "TRandom.h" + +#include "parsePileUpJSON2.h" +#include "SMPJ/AnalysisFW/plugins/Analysis_Template_MC.h" +#include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/MakerMacros.h" + +//#include "../Unfolding/RooUnfold-1.1.1/src/RooUnfold.h" +//#include "../Unfolding/RooUnfold-1.1.1/src/RooUnfoldResponse.h" + +using namespace std; + +//---------------------------- Constructor Of The Class TriggerTurnOn -------------------------- // +Analysis_Template_MC::Analysis_Template_MC(edm::ParameterSet const& cfg) +{ + mFileName = cfg.getParameter> ("filename"); + mTreeName = cfg.getParameter ("treename"); + mDirName = cfg.getParameter ("dirname"); + + mMinPt = cfg.getParameter ("minPt"); + mYMax = cfg.getParameter ("ymax"); + mJetID = cfg.getParameter ("JetID"); + + mprintOk = cfg.getParameter ("printOk"); + + // mIsMCarlo = cfg.getUntrackedParameter ("isMCarlo"); + // mJECUncSrcNames = cfg.getParameter > ("jecUncSrcNames"); + //jecs = new JECs(mIsMCarlo, mGlobalTag, mjettype); + mGlobalTag = cfg.getParameter ("pseudoglobaltag"); + mjettype = cfg.getParameter ("jettype"); + + mIsMCarlo = cfg.getUntrackedParameter ("isMCarlo"); + mJECUncSrcNames = cfg.getParameter > ("jecUncSrcNames"); + mJECUncSrc = cfg.getParameter ("jecUncSrc"); + + mMCSlice= cfg.getParameter("MCSlice"); + mPUReweighting= cfg.getUntrackedParameter("PUReweighting"); + mLowPileUp= cfg.getUntrackedParameter("LowPileUp"); + +} + +//------------------------------ Declaration Of The Function beginjob() ------------------------// +void Analysis_Template_MC::beginJob() + { + + //for(unsigned i=0;iGet(mDirName.c_str()); + //TTree* mTreeFirst=(TTree*)mDir->Get(mTreeName.c_str()); + //mTree.push_back(mTreeFirst) + //Event = new QCDEvent(); + //TBranch *branch = mTree[i]->GetBranch("events"); + //branch->SetAddress(&Event); + //} + + //jecs = new JECs(mIsMCarlo, mGlobalTag, mjettype,mJECUncSrcNames); + + //Pt binning + double Ptbinning[81] = {0, 1, 5, 6, 8, 10, 12, 15, 18, 21, 24, 28, 32, 37, 43, 49, 56, 64, 74, 84,97, 114, 133, 153, 174, 196, 220, 245, 272, 300, 330, 362, 395, 430, 468,507, 548, 592, 638, 686, 737, 790, 846, 905, 967,1032, 1101, 1172, 1248, 1327, 1410, 1497, 1588, 1684, 1784, 1890, 2000,2116, 2238, 2366, 2500, 2640, 2787, 2941, 3103, 3273, 3450, 3637, 3832,4037, 4252, 4477, 4713, 4961, 5220, 5492, 5777, 6076, 6389, 6717, 7000}; + + int Ptbins=80; + + //------------------ Histogram Booking --------------------------- // + num_of_Vtx = fs->make("num_of_Vtx","num_of_Vtx",100,0.,100.); + num_of_VtxGood = fs->make("num_of_VtxGood","num_of_VtxGood",100,0.,100.); + + mc_pthat = fs->make("mc_pthat","mc_pthat",200,0.,2000.); + mc_pthat_weighted = fs->make("mc_pthat_weighted","mc_pthat_weighted",100,0.,2000.); + mc_pthat_weighted->Sumw2(); + + pt0_GENJet = fs->make("pt0_GENJet","pt0_GENJet",Ptbins,Ptbinning); pt0_GENJet->Sumw2(); + pt1_GENJet = fs->make("pt1_GENJet","pt1_GENJet",Ptbins,Ptbinning); pt1_GENJet->Sumw2(); + y0_GENJet = fs->make("y0_GENJet","y0_GENJet",60,-5.,5.); y0_GENJet->Sumw2(); + y1_GENJet = fs->make("y1_GENJet","y1_GENJet",60,-5.,5.); y1_GENJet->Sumw2(); + phi0_GENJet = fs->make("phi0_GENJet","phi0_GENJet",60, -TMath::Pi(),TMath::Pi()); phi0_GENJet->Sumw2(); + phi1_GENJet = fs->make("phi1_GENJet","phi1_GENJet",60, -TMath::Pi(),TMath::Pi()); phi1_GENJet->Sumw2(); + + pt0_DETJet = fs->make("pt0_DETJet","pt0_DETJet",Ptbins,Ptbinning); pt0_DETJet->Sumw2(); + pt1_DETJet = fs->make("pt1_DETJet","pt1_DETJet",Ptbins,Ptbinning); pt1_DETJet->Sumw2(); + pt0_DETJetUncor = fs->make("pt0_DETJetUncor","pt0_DETJetUncor",Ptbins,Ptbinning); pt0_DETJetUncor->Sumw2(); + pt1_DETJetUncor = fs->make("pt1_DETJetUncor","pt1_DETJetUncor",Ptbins,Ptbinning); pt1_DETJetUncor->Sumw2(); + y0_DETJet = fs->make("y0_DETJet","y0_DETJet",60,-5.,5.); y0_DETJet->Sumw2(); + y1_DETJet = fs->make("y1_DETJet","y1_DETJet",60,-5.,5.); y1_DETJet->Sumw2(); + phi0_DETJet = fs->make("phi0_DETJet","phi0_DETJet",60, -TMath::Pi(),TMath::Pi()); phi0_DETJet->Sumw2(); + phi1_DETJet = fs->make("phi1_DETJet","phi1_DETJet",60, -TMath::Pi(),TMath::Pi()); phi1_DETJet->Sumw2(); + + Multiplicity_DETJet = fs->make("Multiplicity_DETJet","Multiplicity_DETJet",21, -0.5,20.5); Multiplicity_DETJet->Sumw2(); + Multiplicity_GENJet = fs->make("Multiplicity_GENJet","Multiplicity_GENJet",21, -0.5,20.5); Multiplicity_GENJet->Sumw2(); + + pt0_DETInclJet = fs->make("pt0_DETInclJet","pt0_DETInclJet",Ptbins,Ptbinning); pt0_DETInclJet->Sumw2(); + pt0_DETInclJetUncor = fs->make("pt0_DETInclJetUncor","pt0_DETInclJetUncor",Ptbins,Ptbinning); pt0_DETInclJetUncor->Sumw2(); + y0_DETInclJet = fs->make("y0_DETInclJet","y0_DETInclJet",60,-5.,5.); y0_DETInclJet->Sumw2(); + phi0_DETInclJet = fs->make("phi0_DETInclJet","phi0_DETInclJet",60, -TMath::Pi(),TMath::Pi()); phi0_DETInclJet->Sumw2(); + + PF_MatchedInclusiveJets = fs->make("PF_MatchedInclusiveJets","PF_MatchedInclusiveJets",Ptbins,Ptbinning); PF_MatchedInclusiveJets->Sumw2(); + Gen_MatchedInclusiveJets = fs->make("Gen_MatchedInclusiveJets","Gen_MatchedInclusiveJets",Ptbins,Ptbinning); Gen_MatchedInclusiveJets->Sumw2(); + TwoD_MatchedInclusiveJets = fs->make("TwoD_MatchedInclusiveJets","TwoD_MatchedInclusiveJets",Ptbins,Ptbinning,Ptbins,Ptbinning); TwoD_MatchedInclusiveJets->Sumw2(); + PF_FakeInclusiveJets = fs->make("PF_FakeInclusiveJets","PF_FakeInclusiveJets",Ptbins,Ptbinning); PF_FakeInclusiveJets->Sumw2(); + Gen_MissInclusiveJets = fs->make("Gen_MissInclusiveJets","Gen_MissInclusiveJets",Ptbins,Ptbinning); Gen_MissInclusiveJets->Sumw2(); + + PileUpVSVertex = fs->make("PileUpVSVertex","PileUpVSVertex",31,-0.5,30.5,31,-0.5,30.5); PileUpVSVertex->Sumw2(); + + DeltaR_Jets = fs->make("DeltaR_Jets","DeltaR_Jets",20, 0,10); DeltaR_Jets->Sumw2(); + + AcceptancePtJets= fs->make("AcceptancePtJets","AcceptancePtJets",Ptbins,Ptbinning); AcceptancePtJets->Sumw2(); + PurityPtJets= fs->make("PurityPtJets","PurityPtJets",Ptbins,Ptbinning); PurityPtJets->Sumw2(); + BackgroundPtJets= fs->make("BackgroundPtJets","BackgroundPtJets",Ptbins,Ptbinning); BackgroundPtJets->Sumw2(); + StabilityPtJets= fs->make("StabilityPtJets","StabilityPtJets",Ptbins,Ptbinning); StabilityPtJets->Sumw2(); + + AcceptancePtJets_1bin= fs->make("AcceptancePtJets_1bin","AcceptancePtJets_1bin",Ptbins,Ptbinning); + PurityPtJets_1bin= fs->make("PurityPtJets_1bin","PurityPtJets_1bin",Ptbins,Ptbinning); + AcceptancePtJets_2bin= fs->make("AcceptancePtJets_2bin","AcceptancePtJets_2bin",Ptbins,Ptbinning); + PurityPtJets_2bin= fs->make("PurityPtJets_2bin","PurityPtJets_2bin",Ptbins,Ptbinning); + AcceptancePtJets_3bin= fs->make("AcceptancePtJets_3bin","AcceptancePtJets_3bin",Ptbins,Ptbinning); + PurityPtJets_3bin= fs->make("PurityPtJets_3bin","PurityPtJets_3bin",Ptbins,Ptbinning); + AcceptancePtJets_4bin= fs->make("AcceptancePtJets_4bin","AcceptancePtJets_4bin",Ptbins,Ptbinning); + PurityPtJets_4bin= fs->make("PurityPtJets_4bin","PurityPtJets_4bin",Ptbins,Ptbinning); + AcceptancePtJets_5bin= fs->make("AcceptancePtJets_5bin","AcceptancePtJets_5bin",Ptbins,Ptbinning); + PurityPtJets_5bin= fs->make("PurityPtJets_5bin","PurityPtJets_5bin",Ptbins,Ptbinning); + AcceptancePtJets_6bin= fs->make("AcceptancePtJets_6bin","AcceptancePtJets_6bin",Ptbins,Ptbinning); + PurityPtJets_6bin= fs->make("PurityPtJets_6bin","PurityPtJets_6bin",Ptbins,Ptbinning); + AcceptancePtJets_7bin= fs->make("AcceptancePtJets_7bin","AcceptancePtJets_7bin",Ptbins,Ptbinning); + PurityPtJets_7bin= fs->make("PurityPtJets_7bin","PurityPtJets_7bin",Ptbins,Ptbinning); + + BackgroundPtJets_1bin= fs->make("BackgroundPtJets_1bin","BackgroundPtJets_1bin",Ptbins,Ptbinning); + StabilityPtJets_1bin= fs->make("StabilityPtJets_1bin","StabilityPtJets_1bin",Ptbins,Ptbinning); + BackgroundPtJets_2bin= fs->make("BackgroundPtJets_2bin","BackgroundPtJets_2bin",Ptbins,Ptbinning); + StabilityPtJets_2bin= fs->make("StabilityPtJets_2bin","StabilityPtJets_2bin",Ptbins,Ptbinning); + BackgroundPtJets_3bin= fs->make("BackgroundPtJets_3bin","BackgroundPtJets_3bin",Ptbins,Ptbinning); + StabilityPtJets_3bin= fs->make("StabilityPtJets_3bin","StabilityPtJets_3bin",Ptbins,Ptbinning); + BackgroundPtJets_4bin= fs->make("BackgroundPtJets_4bin","BackgroundPtJets_4bin",Ptbins,Ptbinning); + StabilityPtJets_4bin= fs->make("StabilityPtJets_4bin","StabilityPtJets_4bin",Ptbins,Ptbinning); + BackgroundPtJets_5bin= fs->make("BackgroundPtJets_5bin","BackgroundPtJets_5bin",Ptbins,Ptbinning); + StabilityPtJets_5bin= fs->make("StabilityPtJets_5bin","StabilityPtJets_5bin",Ptbins,Ptbinning); + BackgroundPtJets_6bin= fs->make("BackgroundPtJets_6bin","BackgroundPtJets_6bin",Ptbins,Ptbinning); + StabilityPtJets_6bin= fs->make("StabilityPtJets_6bin","StabilityPtJets_6bin",Ptbins,Ptbinning); + BackgroundPtJets_7bin= fs->make("BackgroundPtJets_7bin","BackgroundPtJets_7bin",Ptbins,Ptbinning); + StabilityPtJets_7bin= fs->make("StabilityPtJets_7bin","StabilityPtJets_7bin",Ptbins,Ptbinning); + + pt_DETInclJet_1bin = fs->make("pt_DETInclJet_1bin","pt_DETInclJet_1bin",Ptbins,Ptbinning); pt_DETInclJet_1bin->Sumw2(); + pt_DETInclJet_2bin = fs->make("pt_DETInclJet_2bin","pt_DETInclJet_2bin",Ptbins,Ptbinning); pt_DETInclJet_2bin->Sumw2(); + pt_DETInclJet_3bin = fs->make("pt_DETInclJet_3bin","pt_DETInclJet_3bin",Ptbins,Ptbinning); pt_DETInclJet_3bin->Sumw2(); + pt_DETInclJet_4bin = fs->make("pt_DETInclJet_4bin","pt_DETInclJet_4bin",Ptbins,Ptbinning); pt_DETInclJet_4bin->Sumw2(); + pt_DETInclJet_5bin = fs->make("pt_DETInclJet_5bin","pt_DETInclJet_5bin",Ptbins,Ptbinning); pt_DETInclJet_5bin->Sumw2(); + pt_DETInclJet_6bin = fs->make("pt_DETInclJet_6bin","pt_DETInclJet_6bin",Ptbins,Ptbinning); pt_DETInclJet_6bin->Sumw2(); + pt_DETInclJet_7bin = fs->make("pt_DETInclJet_7bin","pt_DETInclJet_7bin",Ptbins,Ptbinning); pt_DETInclJet_7bin->Sumw2(); + + pt_DETInclJetCrossSectNorm_1bin = fs->make("pt_DETInclJetCrossSectNorm_1bin","pt_DETInclJetCrossSectNorm_1bin",Ptbins,Ptbinning); pt_DETInclJetCrossSectNorm_1bin->Sumw2(); + pt_DETInclJetCrossSectNorm_2bin = fs->make("pt_DETInclJetCrossSectNorm_2bin","pt_DETInclJetCrossSectNorm_2bin",Ptbins,Ptbinning); pt_DETInclJetCrossSectNorm_2bin->Sumw2(); + pt_DETInclJetCrossSectNorm_3bin = fs->make("pt_DETInclJetCrossSectNorm_3bin","pt_DETInclJetCrossSectNorm_3bin",Ptbins,Ptbinning); pt_DETInclJetCrossSectNorm_3bin->Sumw2(); + pt_DETInclJetCrossSectNorm_4bin = fs->make("pt_DETInclJetCrossSectNorm_4bin","pt_DETInclJetCrossSectNorm_4bin",Ptbins,Ptbinning); pt_DETInclJetCrossSectNorm_4bin->Sumw2(); + pt_DETInclJetCrossSectNorm_5bin = fs->make("pt_DETInclJetCrossSectNorm_5bin","pt_DETInclJetCrossSectNorm_5bin",Ptbins,Ptbinning); pt_DETInclJetCrossSectNorm_5bin->Sumw2(); + pt_DETInclJetCrossSectNorm_6bin = fs->make("pt_DETInclJetCrossSectNorm_6bin","pt_DETInclJetCrossSectNorm_6bin",Ptbins,Ptbinning); pt_DETInclJetCrossSectNorm_6bin->Sumw2(); + pt_DETInclJetCrossSectNorm_7bin = fs->make("pt_DETInclJetCrossSectNorm_7bin","pt_DETInclJetCrossSectNorm_7bin",Ptbins,Ptbinning); pt_DETInclJetCrossSectNorm_7bin->Sumw2(); + + pt_DETInclJet60_1bin = fs->make("pt_DETInclJet60_1bin","pt_DETInclJet60_1bin",Ptbins,Ptbinning); pt_DETInclJet60_1bin->Sumw2(); + pt_DETInclJet60_2bin = fs->make("pt_DETInclJet60_2bin","pt_DETInclJet60_2bin",Ptbins,Ptbinning); pt_DETInclJet60_2bin->Sumw2(); + pt_DETInclJet60_3bin = fs->make("pt_DETInclJet60_3bin","pt_DETInclJet60_3bin",Ptbins,Ptbinning); pt_DETInclJet60_3bin->Sumw2(); + pt_DETInclJet60_4bin = fs->make("pt_DETInclJet60_4bin","pt_DETInclJet60_4bin",Ptbins,Ptbinning); pt_DETInclJet60_4bin->Sumw2(); + pt_DETInclJet60_5bin = fs->make("pt_DETInclJet60_5bin","pt_DETInclJet60_5bin",Ptbins,Ptbinning); pt_DETInclJet60_5bin->Sumw2(); + pt_DETInclJet60_6bin = fs->make("pt_DETInclJet60_6bin","pt_DETInclJet60_6bin",Ptbins,Ptbinning); pt_DETInclJet60_6bin->Sumw2(); + pt_DETInclJet60_7bin = fs->make("pt_DETInclJet60_7bin","pt_DETInclJet60_7bin",Ptbins,Ptbinning); pt_DETInclJet60_7bin->Sumw2(); + + pt_DETInclJet80_1bin = fs->make("pt_DETInclJet80_1bin","pt_DETInclJet80_1bin",Ptbins,Ptbinning); pt_DETInclJet80_1bin->Sumw2(); + pt_DETInclJet80_2bin = fs->make("pt_DETInclJet80_2bin","pt_DETInclJet80_2bin",Ptbins,Ptbinning); pt_DETInclJet80_2bin->Sumw2(); + pt_DETInclJet80_3bin = fs->make("pt_DETInclJet80_3bin","pt_DETInclJet80_3bin",Ptbins,Ptbinning); pt_DETInclJet80_3bin->Sumw2(); + pt_DETInclJet80_4bin = fs->make("pt_DETInclJet80_4bin","pt_DETInclJet80_4bin",Ptbins,Ptbinning); pt_DETInclJet80_4bin->Sumw2(); + pt_DETInclJet80_5bin = fs->make("pt_DETInclJet80_5bin","pt_DETInclJet80_5bin",Ptbins,Ptbinning); pt_DETInclJet80_5bin->Sumw2(); + pt_DETInclJet80_6bin = fs->make("pt_DETInclJet80_6bin","pt_DETInclJet80_6bin",Ptbins,Ptbinning); pt_DETInclJet80_6bin->Sumw2(); + pt_DETInclJet80_7bin = fs->make("pt_DETInclJet80_7bin","pt_DETInclJet80_7bin",Ptbins,Ptbinning); pt_DETInclJet80_7bin->Sumw2(); + + pt_DETInclJet140_1bin = fs->make("pt_DETInclJet140_1bin","pt_DETInclJet140_1bin",Ptbins,Ptbinning); pt_DETInclJet140_1bin->Sumw2(); + pt_DETInclJet140_2bin = fs->make("pt_DETInclJet140_2bin","pt_DETInclJet140_2bin",Ptbins,Ptbinning); pt_DETInclJet140_2bin->Sumw2(); + pt_DETInclJet140_3bin = fs->make("pt_DETInclJet140_3bin","pt_DETInclJet140_3bin",Ptbins,Ptbinning); pt_DETInclJet140_3bin->Sumw2(); + pt_DETInclJet140_4bin = fs->make("pt_DETInclJet140_4bin","pt_DETInclJet140_4bin",Ptbins,Ptbinning); pt_DETInclJet140_4bin->Sumw2(); + pt_DETInclJet140_5bin = fs->make("pt_DETInclJet140_5bin","pt_DETInclJet140_5bin",Ptbins,Ptbinning); pt_DETInclJet140_5bin->Sumw2(); + pt_DETInclJet140_6bin = fs->make("pt_DETInclJet140_6bin","pt_DETInclJet140_6bin",Ptbins,Ptbinning); pt_DETInclJet140_6bin->Sumw2(); + pt_DETInclJet140_7bin = fs->make("pt_DETInclJet140_7bin","pt_DETInclJet140_7bin",Ptbins,Ptbinning); pt_DETInclJet140_7bin->Sumw2(); + + pt_DETInclJet200_1bin = fs->make("pt_DETInclJet200_1bin","pt_DETInclJet200_1bin",Ptbins,Ptbinning); pt_DETInclJet200_1bin->Sumw2(); + pt_DETInclJet200_2bin = fs->make("pt_DETInclJet200_2bin","pt_DETInclJet200_2bin",Ptbins,Ptbinning); pt_DETInclJet200_2bin->Sumw2(); + pt_DETInclJet200_3bin = fs->make("pt_DETInclJet200_3bin","pt_DETInclJet200_3bin",Ptbins,Ptbinning); pt_DETInclJet200_3bin->Sumw2(); + pt_DETInclJet200_4bin = fs->make("pt_DETInclJet200_4bin","pt_DETInclJet200_4bin",Ptbins,Ptbinning); pt_DETInclJet200_4bin->Sumw2(); + pt_DETInclJet200_5bin = fs->make("pt_DETInclJet200_5bin","pt_DETInclJet200_5bin",Ptbins,Ptbinning); pt_DETInclJet200_5bin->Sumw2(); + pt_DETInclJet200_6bin = fs->make("pt_DETInclJet200_6bin","pt_DETInclJet200_6bin",Ptbins,Ptbinning); pt_DETInclJet200_6bin->Sumw2(); + pt_DETInclJet200_7bin = fs->make("pt_DETInclJet200_7bin","pt_DETInclJet200_7bin",Ptbins,Ptbinning); pt_DETInclJet200_7bin->Sumw2(); + + pt_DETInclJet260_1bin = fs->make("pt_DETInclJet260_1bin","pt_DETInclJet260_1bin",Ptbins,Ptbinning); pt_DETInclJet260_1bin->Sumw2(); + pt_DETInclJet260_2bin = fs->make("pt_DETInclJet260_2bin","pt_DETInclJet260_2bin",Ptbins,Ptbinning); pt_DETInclJet260_2bin->Sumw2(); + pt_DETInclJet260_3bin = fs->make("pt_DETInclJet260_3bin","pt_DETInclJet260_3bin",Ptbins,Ptbinning); pt_DETInclJet260_3bin->Sumw2(); + pt_DETInclJet260_4bin = fs->make("pt_DETInclJet260_4bin","pt_DETInclJet260_4bin",Ptbins,Ptbinning); pt_DETInclJet260_4bin->Sumw2(); + pt_DETInclJet260_5bin = fs->make("pt_DETInclJet260_5bin","pt_DETInclJet260_5bin",Ptbins,Ptbinning); pt_DETInclJet260_5bin->Sumw2(); + pt_DETInclJet260_6bin = fs->make("pt_DETInclJet260_6bin","pt_DETInclJet260_6bin",Ptbins,Ptbinning); pt_DETInclJet260_6bin->Sumw2(); + pt_DETInclJet260_7bin = fs->make("pt_DETInclJet260_7bin","pt_DETInclJet260_7bin",Ptbins,Ptbinning); pt_DETInclJet260_7bin->Sumw2(); + + pt_DETInclJet320_1bin = fs->make("pt_DETInclJet320_1bin","pt_DETInclJet320_1bin",Ptbins,Ptbinning); pt_DETInclJet320_1bin->Sumw2(); + pt_DETInclJet320_2bin = fs->make("pt_DETInclJet320_2bin","pt_DETInclJet320_2bin",Ptbins,Ptbinning); pt_DETInclJet320_2bin->Sumw2(); + pt_DETInclJet320_3bin = fs->make("pt_DETInclJet320_3bin","pt_DETInclJet320_3bin",Ptbins,Ptbinning); pt_DETInclJet320_3bin->Sumw2(); + pt_DETInclJet320_4bin = fs->make("pt_DETInclJet320_4bin","pt_DETInclJet320_4bin",Ptbins,Ptbinning); pt_DETInclJet320_4bin->Sumw2(); + pt_DETInclJet320_5bin = fs->make("pt_DETInclJet320_5bin","pt_DETInclJet320_5bin",Ptbins,Ptbinning); pt_DETInclJet320_5bin->Sumw2(); + pt_DETInclJet320_6bin = fs->make("pt_DETInclJet320_6bin","pt_DETInclJet320_6bin",Ptbins,Ptbinning); pt_DETInclJet320_6bin->Sumw2(); + pt_DETInclJet320_7bin = fs->make("pt_DETInclJet320_7bin","pt_DETInclJet320_7bin",Ptbins,Ptbinning); pt_DETInclJet320_7bin->Sumw2(); + + pt_DETInclJet400_1bin = fs->make("pt_DETInclJet400_1bin","pt_DETInclJet400_1bin",Ptbins,Ptbinning); pt_DETInclJet400_1bin->Sumw2(); + pt_DETInclJet400_2bin = fs->make("pt_DETInclJet400_2bin","pt_DETInclJet400_2bin",Ptbins,Ptbinning); pt_DETInclJet400_2bin->Sumw2(); + pt_DETInclJet400_3bin = fs->make("pt_DETInclJet400_3bin","pt_DETInclJet400_3bin",Ptbins,Ptbinning); pt_DETInclJet400_3bin->Sumw2(); + pt_DETInclJet400_4bin = fs->make("pt_DETInclJet400_4bin","pt_DETInclJet400_4bin",Ptbins,Ptbinning); pt_DETInclJet400_4bin->Sumw2(); + pt_DETInclJet400_5bin = fs->make("pt_DETInclJet400_5bin","pt_DETInclJet400_5bin",Ptbins,Ptbinning); pt_DETInclJet400_5bin->Sumw2(); + pt_DETInclJet400_6bin = fs->make("pt_DETInclJet400_6bin","pt_DETInclJet400_6bin",Ptbins,Ptbinning); pt_DETInclJet400_6bin->Sumw2(); + pt_DETInclJet400_7bin = fs->make("pt_DETInclJet400_7bin","pt_DETInclJet400_7bin",Ptbins,Ptbinning); pt_DETInclJet400_7bin->Sumw2(); + + pt_DETInclJet450_1bin = fs->make("pt_DETInclJet450_1bin","pt_DETInclJet450_1bin",Ptbins,Ptbinning); pt_DETInclJet450_1bin->Sumw2(); + pt_DETInclJet450_2bin = fs->make("pt_DETInclJet450_2bin","pt_DETInclJet450_2bin",Ptbins,Ptbinning); pt_DETInclJet450_2bin->Sumw2(); + pt_DETInclJet450_3bin = fs->make("pt_DETInclJet450_3bin","pt_DETInclJet450_3bin",Ptbins,Ptbinning); pt_DETInclJet450_3bin->Sumw2(); + pt_DETInclJet450_4bin = fs->make("pt_DETInclJet450_4bin","pt_DETInclJet450_4bin",Ptbins,Ptbinning); pt_DETInclJet450_4bin->Sumw2(); + pt_DETInclJet450_5bin = fs->make("pt_DETInclJet450_5bin","pt_DETInclJet450_5bin",Ptbins,Ptbinning); pt_DETInclJet450_5bin->Sumw2(); + pt_DETInclJet450_6bin = fs->make("pt_DETInclJet450_6bin","pt_DETInclJet450_6bin",Ptbins,Ptbinning); pt_DETInclJet450_6bin->Sumw2(); + pt_DETInclJet450_7bin = fs->make("pt_DETInclJet450_7bin","pt_DETInclJet450_7bin",Ptbins,Ptbinning); pt_DETInclJet450_7bin->Sumw2(); + + pt_GENInclJet_1bin = fs->make("pt_GENInclJet_1bin","pt_GENInclJet_1bin",Ptbins,Ptbinning); pt_GENInclJet_1bin->Sumw2(); + pt_GENInclJet_2bin = fs->make("pt_GENInclJet_2bin","pt_GENInclJet_2bin",Ptbins,Ptbinning); pt_GENInclJet_2bin->Sumw2(); + pt_GENInclJet_3bin = fs->make("pt_GENInclJet_3bin","pt_GENInclJet_3bin",Ptbins,Ptbinning); pt_GENInclJet_3bin->Sumw2(); + pt_GENInclJet_4bin = fs->make("pt_GENInclJet_4bin","pt_GENInclJet_4bin",Ptbins,Ptbinning); pt_GENInclJet_4bin->Sumw2(); + pt_GENInclJet_5bin = fs->make("pt_GENInclJet_5bin","pt_GENInclJet_5bin",Ptbins,Ptbinning); pt_GENInclJet_5bin->Sumw2(); + pt_GENInclJet_6bin = fs->make("pt_GENInclJet_6bin","pt_GENInclJet_6bin",Ptbins,Ptbinning); pt_GENInclJet_6bin->Sumw2(); + pt_GENInclJet_7bin = fs->make("pt_GENInclJet_7bin","pt_GENInclJet_7bin",Ptbins,Ptbinning); pt_GENInclJet_7bin->Sumw2(); + + pt_GENInclJetCrossSectNorm_1bin = fs->make("pt_GENInclJetCrossSectNorm_1bin","pt_GENInclJetCrossSectNorm_1bin",Ptbins,Ptbinning); pt_GENInclJetCrossSectNorm_1bin->Sumw2(); + pt_GENInclJetCrossSectNorm_2bin = fs->make("pt_GENInclJetCrossSectNorm_2bin","pt_GENInclJetCrossSectNorm_2bin",Ptbins,Ptbinning); pt_GENInclJetCrossSectNorm_2bin->Sumw2(); + pt_GENInclJetCrossSectNorm_3bin = fs->make("pt_GENInclJetCrossSectNorm_3bin","pt_GENInclJetCrossSectNorm_3bin",Ptbins,Ptbinning); pt_GENInclJetCrossSectNorm_3bin->Sumw2(); + pt_GENInclJetCrossSectNorm_4bin = fs->make("pt_GENInclJetCrossSectNorm_4bin","pt_GENInclJetCrossSectNorm_4bin",Ptbins,Ptbinning); pt_GENInclJetCrossSectNorm_4bin->Sumw2(); + pt_GENInclJetCrossSectNorm_5bin = fs->make("pt_GENInclJetCrossSectNorm_5bin","pt_GENInclJetCrossSectNorm_5bin",Ptbins,Ptbinning); pt_GENInclJetCrossSectNorm_5bin->Sumw2(); + pt_GENInclJetCrossSectNorm_6bin = fs->make("pt_GENInclJetCrossSectNorm_6bin","pt_GENInclJetCrossSectNorm_6bin",Ptbins,Ptbinning); pt_GENInclJetCrossSectNorm_6bin->Sumw2(); + pt_GENInclJetCrossSectNorm_7bin = fs->make("pt_GENInclJetCrossSectNorm_7bin","pt_GENInclJetCrossSectNorm_7bin",Ptbins,Ptbinning); pt_GENInclJetCrossSectNorm_7bin->Sumw2(); + + PF_FakeInclusiveJets_1bin = fs->make("PF_FakeInclusiveJets_1bin","PF_FakeInclusiveJets_1bin",Ptbins,Ptbinning); PF_FakeInclusiveJets_1bin->Sumw2(); + PF_FakeInclusiveJets_2bin = fs->make("PF_FakeInclusiveJets_2bin","PF_FakeInclusiveJets_2bin",Ptbins,Ptbinning); PF_FakeInclusiveJets_2bin->Sumw2(); + PF_FakeInclusiveJets_3bin = fs->make("PF_FakeInclusiveJets_3bin","PF_FakeInclusiveJets_3bin",Ptbins,Ptbinning); PF_FakeInclusiveJets_3bin->Sumw2(); + PF_FakeInclusiveJets_4bin = fs->make("PF_FakeInclusiveJets_4bin","PF_FakeInclusiveJets_4bin",Ptbins,Ptbinning); PF_FakeInclusiveJets_4bin->Sumw2(); + PF_FakeInclusiveJets_5bin = fs->make("PF_FakeInclusiveJets_5bin","PF_FakeInclusiveJets_5bin",Ptbins,Ptbinning); PF_FakeInclusiveJets_5bin->Sumw2(); + PF_FakeInclusiveJets_6bin = fs->make("PF_FakeInclusiveJets_6bin","PF_FakeInclusiveJets_6bin",Ptbins,Ptbinning); PF_FakeInclusiveJets_6bin->Sumw2(); + PF_FakeInclusiveJets_7bin = fs->make("PF_FakeInclusiveJets_7bin","PF_FakeInclusiveJets_7bin",Ptbins,Ptbinning); PF_FakeInclusiveJets_7bin->Sumw2(); + + Gen_MissInclusiveJets_1bin = fs->make("Gen_MissInclusiveJets_1bin","Gen_MissInclusiveJets_1bin",Ptbins,Ptbinning); Gen_MissInclusiveJets_1bin->Sumw2(); + Gen_MissInclusiveJets_2bin = fs->make("Gen_MissInclusiveJets_2bin","Gen_MissInclusiveJets_2bin",Ptbins,Ptbinning); Gen_MissInclusiveJets_2bin->Sumw2(); + Gen_MissInclusiveJets_3bin = fs->make("Gen_MissInclusiveJets_3bin","Gen_MissInclusiveJets_3bin",Ptbins,Ptbinning); Gen_MissInclusiveJets_3bin->Sumw2(); + Gen_MissInclusiveJets_4bin = fs->make("Gen_MissInclusiveJets_4bin","Gen_MissInclusiveJets_4bin",Ptbins,Ptbinning); Gen_MissInclusiveJets_4bin->Sumw2(); + Gen_MissInclusiveJets_5bin = fs->make("Gen_MissInclusiveJets_5bin","Gen_MissInclusiveJets_5bin",Ptbins,Ptbinning); Gen_MissInclusiveJets_5bin->Sumw2(); + Gen_MissInclusiveJets_6bin = fs->make("Gen_MissInclusiveJets_6bin","Gen_MissInclusiveJets_6bin",Ptbins,Ptbinning); Gen_MissInclusiveJets_6bin->Sumw2(); + Gen_MissInclusiveJets_7bin = fs->make("Gen_MissInclusiveJets_7bin","Gen_MissInclusiveJets_7bin",Ptbins,Ptbinning); Gen_MissInclusiveJets_7bin->Sumw2(); + + PF_MatchedInclusiveJets_1bin = fs->make("PF_MatchedInclusiveJets_1bin","PF_MatchedInclusiveJets_1bin",Ptbins,Ptbinning); PF_MatchedInclusiveJets_1bin->Sumw2(); + PF_MatchedInclusiveJets_2bin = fs->make("PF_MatchedInclusiveJets_2bin","PF_MatchedInclusiveJets_2bin",Ptbins,Ptbinning); PF_MatchedInclusiveJets_2bin->Sumw2(); + PF_MatchedInclusiveJets_3bin = fs->make("PF_MatchedInclusiveJets_3bin","PF_MatchedInclusiveJets_3bin",Ptbins,Ptbinning); PF_MatchedInclusiveJets_3bin->Sumw2(); + PF_MatchedInclusiveJets_4bin = fs->make("PF_MatchedInclusiveJets_4bin","PF_MatchedInclusiveJets_4bin",Ptbins,Ptbinning); PF_MatchedInclusiveJets_4bin->Sumw2(); + PF_MatchedInclusiveJets_5bin = fs->make("PF_MatchedInclusiveJets_5bin","PF_MatchedInclusiveJets_5bin",Ptbins,Ptbinning); PF_MatchedInclusiveJets_5bin->Sumw2(); + PF_MatchedInclusiveJets_6bin = fs->make("PF_MatchedInclusiveJets_6bin","PF_MatchedInclusiveJets_6bin",Ptbins,Ptbinning); PF_MatchedInclusiveJets_6bin->Sumw2(); + PF_MatchedInclusiveJets_7bin = fs->make("PF_MatchedInclusiveJets_7bin","PF_MatchedInclusiveJets_7bin",Ptbins,Ptbinning); PF_MatchedInclusiveJets_7bin->Sumw2(); + + Gen_MatchedInclusiveJets_1bin = fs->make("Gen_MatchedInclusiveJets_1bin","Gen_MatchedInclusiveJets_1bin",Ptbins,Ptbinning); Gen_MatchedInclusiveJets_1bin->Sumw2(); + Gen_MatchedInclusiveJets_2bin = fs->make("Gen_MatchedInclusiveJets_2bin","Gen_MatchedInclusiveJets_2bin",Ptbins,Ptbinning); Gen_MatchedInclusiveJets_2bin->Sumw2(); + Gen_MatchedInclusiveJets_3bin = fs->make("Gen_MatchedInclusiveJets_3bin","Gen_MatchedInclusiveJets_3bin",Ptbins,Ptbinning); Gen_MatchedInclusiveJets_3bin->Sumw2(); + Gen_MatchedInclusiveJets_4bin = fs->make("Gen_MatchedInclusiveJets_4bin","Gen_MatchedInclusiveJets_4bin",Ptbins,Ptbinning); Gen_MatchedInclusiveJets_4bin->Sumw2(); + Gen_MatchedInclusiveJets_5bin = fs->make("Gen_MatchedInclusiveJets_5bin","Gen_MatchedInclusiveJets_5bin",Ptbins,Ptbinning); Gen_MatchedInclusiveJets_5bin->Sumw2(); + Gen_MatchedInclusiveJets_6bin = fs->make("Gen_MatchedInclusiveJets_6bin","Gen_MatchedInclusiveJets_6bin",Ptbins,Ptbinning); Gen_MatchedInclusiveJets_6bin->Sumw2(); + Gen_MatchedInclusiveJets_7bin = fs->make("Gen_MatchedInclusiveJets_7bin","Gen_MatchedInclusiveJets_7bin",Ptbins,Ptbinning); Gen_MatchedInclusiveJets_7bin->Sumw2(); + + TwoD_MatchedInclusiveJets_1bin = fs->make("TwoD_MatchedInclusiveJets_1bin","TwoD_MatchedInclusiveJets_1bin",Ptbins,Ptbinning,Ptbins,Ptbinning); TwoD_MatchedInclusiveJets_1bin->Sumw2(); + TwoD_MatchedInclusiveJets_2bin = fs->make("TwoD_MatchedInclusiveJets_2bin","TwoD_MatchedInclusiveJets_2bin",Ptbins,Ptbinning,Ptbins,Ptbinning); TwoD_MatchedInclusiveJets_2bin->Sumw2(); + TwoD_MatchedInclusiveJets_3bin = fs->make("TwoD_MatchedInclusiveJets_3bin","TwoD_MatchedInclusiveJets_3bin",Ptbins,Ptbinning,Ptbins,Ptbinning); TwoD_MatchedInclusiveJets_3bin->Sumw2(); + TwoD_MatchedInclusiveJets_4bin = fs->make("TwoD_MatchedInclusiveJets_4bin","TwoD_MatchedInclusiveJets_4bin",Ptbins,Ptbinning,Ptbins,Ptbinning); TwoD_MatchedInclusiveJets_4bin->Sumw2(); + TwoD_MatchedInclusiveJets_5bin = fs->make("TwoD_MatchedInclusiveJets_5bin","TwoD_MatchedInclusiveJets_5bin",Ptbins,Ptbinning,Ptbins,Ptbinning); TwoD_MatchedInclusiveJets_5bin->Sumw2(); + TwoD_MatchedInclusiveJets_6bin = fs->make("TwoD_MatchedInclusiveJets_6bin","TwoD_MatchedInclusiveJets_6bin",Ptbins,Ptbinning,Ptbins,Ptbinning); TwoD_MatchedInclusiveJets_6bin->Sumw2(); + TwoD_MatchedInclusiveJets_7bin = fs->make("TwoD_MatchedInclusiveJets_7bin","TwoD_MatchedInclusiveJets_7bin",Ptbins,Ptbinning,Ptbins,Ptbinning); TwoD_MatchedInclusiveJets_7bin->Sumw2(); + + Resolution1D = fs->make("Resolution1D","Resolution1D",100,-5,5); + ResolutionForward1D = fs->make("ResolutionForward1D","ResolutionForward1D",100,-5,5); + + ResolutionInclusiveJets = fs->make("ResolutionInclusiveJets","ResolutionInclusiveJets",Ptbins,Ptbinning,0,5); + ResolutionInclusiveJets_1bin = fs->make("ResolutionInclusiveJets_1bin","ResolutionInclusiveJets_1bin",Ptbins,Ptbinning,0,5); + ResolutionInclusiveJets_2bin = fs->make("ResolutionInclusiveJets_2bin","ResolutionInclusiveJets_2bin",Ptbins,Ptbinning,0,5); + ResolutionInclusiveJets_3bin = fs->make("ResolutionInclusiveJets_3bin","ResolutionInclusiveJets_3bin",Ptbins,Ptbinning,0,5); + ResolutionInclusiveJets_4bin = fs->make("ResolutionInclusiveJets_4bin","ResolutionInclusiveJets_4bin",Ptbins,Ptbinning,0,5); + ResolutionInclusiveJets_5bin = fs->make("ResolutionInclusiveJets_5bin","ResolutionInclusiveJets_5bin",Ptbins,Ptbinning,0,5); + ResolutionInclusiveJets_6bin = fs->make("ResolutionInclusiveJets_6bin","ResolutionInclusiveJets_6bin",Ptbins,Ptbinning,0,5); + ResolutionInclusiveJets_7bin = fs->make("ResolutionInclusiveJets_7bin","ResolutionInclusiveJets_7bin",Ptbins,Ptbinning,0,5); + + ResolutionTagAndProbe = fs->make("ResolutionTagAndProbe","ResolutionTagAndProbe",Ptbins,Ptbinning,0,5); + + //trigger efficiency measurement + TagAndProbeNum= fs->make("TagAndProbeNum","TagAndProbeNum",Ptbins,Ptbinning); + TagAndProbeDen= fs->make("TagAndProbeDen","TagAndProbeDen",Ptbins,Ptbinning); + TagAndProbeEff= fs->make("TagAndProbeEff","TagAndProbeEff",Ptbins,Ptbinning); + + hist_leading_pt_emulated_Jet60= fs->make("hist_leading_pt_emulated_Jet60","hist_leading_pt_emulated_Jet60",Ptbins,Ptbinning); + hist_leading_pt_all_Jet60= fs->make("hist_leading_pt_all_Jet60","hist_leading_pt_all_Jet60",Ptbins,Ptbinning); + hist_leading_eta_emulated_Jet60= fs->make("hist_leading_eta_emulated_Jet60","hist_leading_eta_emulated_Jet60",24,-5.2,5.2); + hist_leading_eta_all_Jet60= fs->make("hist_leading_eta_all_Jet60","hist_leading_eta_all_Jet60",24,-5.2,5.2); + + hist_leading_pt_HLT_Jet60U_eff= fs->make("hist_leading_pt_HLT_Jet60U_eff","hist_leading_pt_HLT_Jet60U_eff",Ptbins,Ptbinning); + hist_leading_eta_HLT_Jet60U_eff= fs->make("hist_leading_eta_HLT_Jet60U_eff","hist_leading_eta_HLT_Jet60U_eff",24,-5.2,5.2); + + hist_leading_pt_emulated_Jet80= fs->make("hist_leading_pt_emulated_Jet80","hist_leading_pt_emulated_Jet80",Ptbins,Ptbinning); + hist_leading_pt_all_Jet80= fs->make("hist_leading_pt_all_Jet80","hist_leading_pt_all_Jet80",Ptbins,Ptbinning); + hist_leading_eta_emulated_Jet80= fs->make("hist_leading_eta_emulated_Jet80","hist_leading_eta_emulated_Jet80",24,-5.2,5.2); + hist_leading_eta_all_Jet80= fs->make("hist_leading_eta_all_Jet80","hist_leading_eta_all_Jet80",24,-5.2,5.2); + + hist_leading_pt_HLT_Jet80U_eff= fs->make("hist_leading_pt_HLT_Jet80U_eff","hist_leading_pt_HLT_Jet80U_eff",Ptbins,Ptbinning); + hist_leading_eta_HLT_Jet80U_eff= fs->make("hist_leading_eta_HLT_Jet80U_eff","hist_leading_eta_HLT_Jet80U_eff",24,-5.2,5.2); + + hist_leading_pt_emulated_Jet140= fs->make("hist_leading_pt_emulated_Jet140","hist_leading_pt_emulated_Jet140",Ptbins,Ptbinning); + hist_leading_pt_all_Jet140= fs->make("hist_leading_pt_all_Jet140","hist_leading_pt_all_Jet140",Ptbins,Ptbinning); + hist_leading_eta_emulated_Jet140= fs->make("hist_leading_eta_emulated_Jet140","hist_leading_eta_emulated_Jet140",24,-5.2,5.2); + hist_leading_eta_all_Jet140= fs->make("hist_leading_eta_all_Jet140","hist_leading_eta_all_Jet140",24,-5.2,5.2); + + hist_leading_pt_HLT_Jet140U_eff= fs->make("hist_leading_pt_HLT_Jet140U_eff","hist_leading_pt_HLT_Jet140U_eff",Ptbins,Ptbinning); + hist_leading_eta_HLT_Jet140U_eff= fs->make("hist_leading_eta_HLT_Jet140U_eff","hist_leading_eta_HLT_Jet140U_eff",24,-5.2,5.2); + + hist_leading_pt_emulated_Jet200= fs->make("hist_leading_pt_emulated_Jet200","hist_leading_pt_emulated_Jet200",Ptbins,Ptbinning); + hist_leading_pt_all_Jet200= fs->make("hist_leading_pt_all_Jet200","hist_leading_pt_all_Jet200",Ptbins,Ptbinning); + hist_leading_eta_emulated_Jet200= fs->make("hist_leading_eta_emulated_Jet200","hist_leading_eta_emulated_Jet200",24,-5.2,5.2); + hist_leading_eta_all_Jet200= fs->make("hist_leading_eta_all_Jet200","hist_leading_eta_all_Jet200",24,-5.2,5.2); + + hist_leading_pt_HLT_Jet200U_eff= fs->make("hist_leading_pt_HLT_Jet200U_eff","hist_leading_pt_HLT_Jet200U_eff",Ptbins,Ptbinning); + hist_leading_eta_HLT_Jet200U_eff= fs->make("hist_leading_eta_HLT_Jet200U_eff","hist_leading_eta_HLT_Jet200U_eff",24,-5.2,5.2); + + hist_leading_pt_emulated_Jet260= fs->make("hist_leading_pt_emulated_Jet260","hist_leading_pt_emulated_Jet260",Ptbins,Ptbinning); + hist_leading_pt_all_Jet260= fs->make("hist_leading_pt_all_Jet260","hist_leading_pt_all_Jet260",Ptbins,Ptbinning); + hist_leading_eta_emulated_Jet260= fs->make("hist_leading_eta_emulated_Jet260","hist_leading_eta_emulated_Jet260",24,-5.2,5.2); + hist_leading_eta_all_Jet260= fs->make("hist_leading_eta_all_Jet260","hist_leading_eta_all_Jet260",24,-5.2,5.2); + + hist_leading_pt_HLT_Jet260U_eff= fs->make("hist_leading_pt_HLT_Jet260U_eff","hist_leading_pt_HLT_Jet260U_eff",Ptbins,Ptbinning); + hist_leading_eta_HLT_Jet260U_eff= fs->make("hist_leading_eta_HLT_Jet260U_eff","hist_leading_eta_HLT_Jet260U_eff",24,-5.2,5.2); + + hist_leading_pt_emulated_Jet320= fs->make("hist_leading_pt_emulated_Jet320","hist_leading_pt_emulated_Jet320",Ptbins,Ptbinning); + hist_leading_pt_all_Jet320= fs->make("hist_leading_pt_all_Jet320","hist_leading_pt_all_Jet320",Ptbins,Ptbinning); + hist_leading_eta_emulated_Jet320= fs->make("hist_leading_eta_emulated_Jet320","hist_leading_eta_emulated_Jet320",24,-5.2,5.2); + hist_leading_eta_all_Jet320= fs->make("hist_leading_eta_all_Jet320","hist_leading_eta_all_Jet320",24,-5.2,5.2); + + hist_leading_pt_HLT_Jet320U_eff= fs->make("hist_leading_pt_HLT_Jet320U_eff","hist_leading_pt_HLT_Jet320U_eff",Ptbins,Ptbinning); + hist_leading_eta_HLT_Jet320U_eff= fs->make("hist_leading_eta_HLT_Jet320U_eff","hist_leading_eta_HLT_Jet320U_eff",24,-5.2,5.2); + + hist_leading_pt_emulated_Jet400= fs->make("hist_leading_pt_emulated_Jet400","hist_leading_pt_emulated_Jet400",Ptbins,Ptbinning); + hist_leading_pt_all_Jet400= fs->make("hist_leading_pt_all_Jet400","hist_leading_pt_all_Jet400",Ptbins,Ptbinning); + hist_leading_eta_emulated_Jet400= fs->make("hist_leading_eta_emulated_Jet400","hist_leading_eta_emulated_Jet400",24,-5.2,5.2); + hist_leading_eta_all_Jet400= fs->make("hist_leading_eta_all_Jet400","hist_leading_eta_all_Jet400",24,-5.2,5.2); + + hist_leading_pt_HLT_Jet400U_eff= fs->make("hist_leading_pt_HLT_Jet400U_eff","hist_leading_pt_HLT_Jet400U_eff",Ptbins,Ptbinning); + hist_leading_eta_HLT_Jet400U_eff= fs->make("hist_leading_eta_HLT_Jet400U_eff","hist_leading_eta_HLT_Jet400U_eff",24,-5.2,5.2); + + hist_leading_pt_emulated_Jet450= fs->make("hist_leading_pt_emulated_Jet450","hist_leading_pt_emulated_Jet450",Ptbins,Ptbinning); + hist_leading_pt_all_Jet450= fs->make("hist_leading_pt_all_Jet450","hist_leading_pt_all_Jet450",Ptbins,Ptbinning); + hist_leading_eta_emulated_Jet450= fs->make("hist_leading_eta_emulated_Jet450","hist_leading_eta_emulated_Jet450",24,-5.2,5.2); + hist_leading_eta_all_Jet450= fs->make("hist_leading_eta_all_Jet450","hist_leading_eta_all_Jet450",24,-5.2,5.2); + + hist_leading_pt_HLT_Jet450U_eff= fs->make("hist_leading_pt_HLT_Jet450U_eff","hist_leading_pt_HLT_Jet450U_eff",Ptbins,Ptbinning); + hist_leading_eta_HLT_Jet450U_eff= fs->make("hist_leading_eta_HLT_Jet450U_eff","hist_leading_eta_HLT_Jet450U_eff",24,-5.2,5.2); + + hist_leading_pt_emulated_Jet500= fs->make("hist_leading_pt_emulated_Jet500","hist_leading_pt_emulated_Jet500",Ptbins,Ptbinning); + hist_leading_pt_all_Jet500= fs->make("hist_leading_pt_all_Jet500","hist_leading_pt_all_Jet500",Ptbins,Ptbinning); + hist_leading_eta_emulated_Jet500= fs->make("hist_leading_eta_emulated_Jet500","hist_leading_eta_emulated_Jet500",24,-5.2,5.2); + hist_leading_eta_all_Jet500= fs->make("hist_leading_eta_all_Jet500","hist_leading_eta_all_Jet500",24,-5.2,5.2); + + hist_leading_pt_HLT_Jet500U_eff= fs->make("hist_leading_pt_HLT_Jet500U_eff","hist_leading_pt_HLT_Jet500U_eff",Ptbins,Ptbinning); + hist_leading_eta_HLT_Jet500U_eff= fs->make("hist_leading_eta_HLT_Jet500U_eff","hist_leading_eta_HLT_Jet500U_eff",24,-5.2,5.2); + + //Jet energy systematic uncertainty + pt_DETInclJetUP_1bin = fs->make("pt_DETInclJetUP_1bin","pt_DETInclJetUP_1bin",Ptbins,Ptbinning); pt_DETInclJetUP_1bin->Sumw2(); + pt_DETInclJetUP_2bin = fs->make("pt_DETInclJetUP_2bin","pt_DETInclJetUP_2bin",Ptbins,Ptbinning); pt_DETInclJetUP_2bin->Sumw2(); + pt_DETInclJetUP_3bin = fs->make("pt_DETInclJetUP_3bin","pt_DETInclJetUP_3bin",Ptbins,Ptbinning); pt_DETInclJetUP_3bin->Sumw2(); + pt_DETInclJetUP_4bin = fs->make("pt_DETInclJetUP_4bin","pt_DETInclJetUP_4bin",Ptbins,Ptbinning); pt_DETInclJetUP_4bin->Sumw2(); + pt_DETInclJetUP_5bin = fs->make("pt_DETInclJetUP_5bin","pt_DETInclJetUP_5bin",Ptbins,Ptbinning); pt_DETInclJetUP_5bin->Sumw2(); + pt_DETInclJetUP_6bin = fs->make("pt_DETInclJetUP_6bin","pt_DETInclJetUP_6bin",Ptbins,Ptbinning); pt_DETInclJetUP_6bin->Sumw2(); + pt_DETInclJetUP_7bin = fs->make("pt_DETInclJetUP_7bin","pt_DETInclJetUP_7bin",Ptbins,Ptbinning); pt_DETInclJetUP_7bin->Sumw2(); + + pt_DETInclJetDOWN_1bin = fs->make("pt_DETInclJetDOWN_1bin","pt_DETInclJetDOWN_1bin",Ptbins,Ptbinning); pt_DETInclJetDOWN_1bin->Sumw2(); + pt_DETInclJetDOWN_2bin = fs->make("pt_DETInclJetDOWN_2bin","pt_DETInclJetDOWN_2bin",Ptbins,Ptbinning); pt_DETInclJetDOWN_2bin->Sumw2(); + pt_DETInclJetDOWN_3bin = fs->make("pt_DETInclJetDOWN_3bin","pt_DETInclJetDOWN_3bin",Ptbins,Ptbinning); pt_DETInclJetDOWN_3bin->Sumw2(); + pt_DETInclJetDOWN_4bin = fs->make("pt_DETInclJetDOWN_4bin","pt_DETInclJetDOWN_4bin",Ptbins,Ptbinning); pt_DETInclJetDOWN_4bin->Sumw2(); + pt_DETInclJetDOWN_5bin = fs->make("pt_DETInclJetDOWN_5bin","pt_DETInclJetDOWN_5bin",Ptbins,Ptbinning); pt_DETInclJetDOWN_5bin->Sumw2(); + pt_DETInclJetDOWN_6bin = fs->make("pt_DETInclJetDOWN_6bin","pt_DETInclJetDOWN_6bin",Ptbins,Ptbinning); pt_DETInclJetDOWN_6bin->Sumw2(); + pt_DETInclJetDOWN_7bin = fs->make("pt_DETInclJetDOWN_7bin","pt_DETInclJetDOWN_7bin",Ptbins,Ptbinning); pt_DETInclJetDOWN_7bin->Sumw2(); + + Chargedhf0_DETJet = fs->make("Chargedhf0_DETJet","Chargedhf0_DETJet",50,0,1); Chargedhf0_DETJet->Sumw2(); + Chargedef0_DETJet = fs->make("Chargedef0_DETJet","Chargedef0_DETJet",50,0,1); Chargedef0_DETJet->Sumw2(); + Neutralhf0_DETJet = fs->make("Neutralhf0_DETJet","Neutralhf0_DETJet",50,0,1); Neutralhf0_DETJet->Sumw2(); + Photonef0_DETJet = fs->make("Photonef0_DETJet","Photonef0_DETJet",50,0,1); Photonef0_DETJet->Sumw2(); + Hadronef0_DETJet = fs->make("Hadronef0_DETJet","Hadronef0_DETJet",50,0,1); Hadronef0_DETJet->Sumw2(); + Muonef0_DETJet = fs->make("Muonef0_DETJet","Muonef0_DETJet",50,0,1); Muonef0_DETJet->Sumw2(); + Electromagneticef0_DETJet = fs->make("Electromagneticef0_DETJet","Electromagneticef0_DETJet",50,0,1); Electromagneticef0_DETJet->Sumw2(); + + ChargedhMultiplicity0_DETJet = fs->make("ChargedhMultiplicity0_DETJet","ChargedhMultiplicity0_DETJet",100,0,100); ChargedhMultiplicity0_DETJet->Sumw2(); + ChargedeMultiplicity0_DETJet = fs->make("ChargedeMultiplicity0_DETJet","ChargedeMultiplicity0_DETJet",100,0,100); ChargedeMultiplicity0_DETJet->Sumw2(); + NeutralhMultiplicity0_DETJet = fs->make("NeutralhMultiplicity0_DETJet","NeutralhMultiplicity0_DETJet",100,0,100); NeutralhMultiplicity0_DETJet->Sumw2(); + PhotoneMultiplicity0_DETJet = fs->make("PhotoneMultiplicity0_DETJet","PhotoneMultiplicity0_DETJet",100,0,100); PhotoneMultiplicity0_DETJet->Sumw2(); + HadroneMultiplicity0_DETJet = fs->make("HadroneMultiplicity0_DETJet","HadroneMultiplicity0_DETJet",100,0,100); HadroneMultiplicity0_DETJet->Sumw2(); + MuoneMultiplicity0_DETJet = fs->make("MuoneMultiplicity0_DETJet","MuoneMultiplicity0_DETJet",100,0,100); MuoneMultiplicity0_DETJet->Sumw2(); + ElectromagneticeMultiplicity0_DETJet = fs->make("ElectromagneticeMultiplicity0_DETJet","ElectromagneticeMultiplicity0_DETJet",100,0,100); ElectromagneticeMultiplicity0_DETJet->Sumw2(); + + TruePileUpMC = fs->make("TruePileUpMC","TruePileUpMC",100,0,100); TruePileUpMC->Sumw2(); + TruePileUpMCInteger = fs->make("TruePileUpMCInteger","TruePileUpMCInteger",100,0,100); TruePileUpMCInteger->Sumw2(); + + TruePileUpDataInteger = fs->make("TruePileUpDataInteger","TruePileUpDataInteger",100,0,100); TruePileUpDataInteger->Sumw2(); + + MET_DET = fs->make("MET_DET","MET_DET",500,0,2000); MET_DET->Sumw2(); + METPhi_DET = fs->make("METPhi_DET","METPhi_DET",35,-7,7); METPhi_DET->Sumw2(); + FractionMET_DET = fs->make("FractionMET_DET","FractionMET_DET",50,0,1); FractionMET_DET->Sumw2(); + + jecs = new JECs(mIsMCarlo, mGlobalTag, mjettype,mJECUncSrc,mJECUncSrcNames); + + //Unfolding + /*resp_jetpt1etabin = fs->make(pt0_DETJet,pt0_DETJet, "resp_jetpt1etabin", "jetpt1etabin"); + resp_jetpt2etabin = fs->make(pt0_DETJet,pt0_DETJet, "resp_jetpt2etabin", "jetpt2etabin"); + resp_jetpt3etabin = fs->make(pt0_DETJet,pt0_DETJet, "resp_jetpt3etabin", "jetpt3etabin"); + resp_jetpt4etabin = fs->make(pt0_DETJet,pt0_DETJet, "resp_jetpt4etabin", "jetpt4etabin"); + resp_jetpt5etabin = fs->make(pt0_DETJet,pt0_DETJet, "resp_jetpt5etabin", "jetpt5etabin"); + resp_jetpt6etabin = fs->make(pt0_DETJet,pt0_DETJet, "resp_jetpt6etabin", "jetpt6etabin"); + resp_jetpt7etabin = fs->make(pt0_DETJet,pt0_DETJet, "resp_jetpt7etabin", "jetpt7etabin");*/ + + } // end of function beginJob() + + + //------------------------ endjob() function declaration ---------------------- // + void Analysis_Template_MC::endJob() + { + + mInf->Close(); + + } // closing endJob() + + + + + + //--------------------------- analyze() fuction declaration ------------------ // +void Analysis_Template_MC::analyze(edm::Event const& iEvent, edm::EventSetup const& iSetup) + { + + cout<<" Size "<Get(mDirName.c_str()); + mTree=(TTree*)mDir->Get(mTreeName.c_str()); + + Event = new QCDEvent(); + TBranch *branch = mTree->GetBranch("events"); + branch->SetAddress(&Event); + + unsigned NEntries = mTree->GetEntries(); + cout<<"Reading TREE: "<Get("ak4/TriggerNames"); + cout<<"Finding trigger mapping: "<GetNbinsX();ibin++) { + TString ss(hTrigNames->GetXaxis()->GetBinLabel(ibin+1)); + + for (int ii=0; ii "<GetEntry(l); + + //LOW PILE-UP + + double TruePileUpInteger=0; + if(mIsMCarlo) TruePileUpInteger=Event->evtHdr().pu()/Event->evtHdr().nbx(); + + if(mIsMCarlo){ + if(mMCSlice==0){WeightMC=2022100000*Event->evtHdr().weight()/NEntriesNorm;}//flat MC + if(mMCSlice==1){ + if(ifile==0){WeightMC=61018300000*Event->evtHdr().weight()/NEntriesNorm;}//5-10 Slice + if(ifile==1){WeightMC=5887580000*Event->evtHdr().weight()/NEntriesNorm;}//10-15 Slice + if(ifile==2){WeightMC=1837410000*Event->evtHdr().weight()/NEntriesNorm;}//15-30 + if(ifile==3){WeightMC=140932000*Event->evtHdr().weight()/NEntriesNorm;}//30-50 + if(ifile==4){WeightMC=19204300*Event->evtHdr().weight()/NEntriesNorm;}//50-80 + if(ifile==5){WeightMC=2762530*Event->evtHdr().weight()/NEntriesNorm;}//80-120 + if(ifile==6){WeightMC=471100*Event->evtHdr().weight()/NEntriesNorm;}//120-170 + if(ifile==7){WeightMC=117276*Event->evtHdr().weight()/NEntriesNorm;}//170-300 + if(ifile==8){WeightMC=7823*Event->evtHdr().weight()/NEntriesNorm;}//300-470 + if(ifile==9){WeightMC=648.2*Event->evtHdr().weight()/NEntriesNorm;}//470-600 + if(ifile==10){WeightMC=186.9*Event->evtHdr().weight()/NEntriesNorm;}//600-800 + if(ifile==11){WeightMC=32.293*Event->evtHdr().weight()/NEntriesNorm;}//800-1000 + if(ifile==12){WeightMC=9.4183*Event->evtHdr().weight()/NEntriesNorm;}//1000-1400 Slice + if(ifile==13){WeightMC=0.84265*Event->evtHdr().weight()/NEntriesNorm;}//1400-1800 Slice + if(ifile==14){WeightMC=0.114943*Event->evtHdr().weight()/NEntriesNorm;}//1800-2400 Slice + if(ifile==15){WeightMC=0.00682981*Event->evtHdr().weight()/NEntriesNorm;}//2400-3200 Slice + if(ifile==16){WeightMC=0.000165445*Event->evtHdr().weight()/NEntriesNorm;}//3200 Slice + } + + + if(mPUReweighting) { + double PUValue=Event->evtHdr().pu()/Event->evtHdr().nbx(); + /*if(PUValue==0) WeightMC=WeightMC*0; + if(PUValue==1) WeightMC=WeightMC*7.15108*5.58912*7.75622; + if(PUValue==2) WeightMC=WeightMC*0.719276*0.486575*0.491436; + if(PUValue==3) WeightMC=WeightMC*3.04295*2.22316*2.7563; + if(PUValue==4) WeightMC=WeightMC*1.1615*0.864842*1.0667; + if(PUValue==5) WeightMC=WeightMC*1.1548*0.871069*1.05845; + if(PUValue==6) WeightMC=WeightMC*1.05194*0.809438*0.973934; + if(PUValue==7) WeightMC=WeightMC*1.13305*0.877764*1.0274; + if(PUValue==8) WeightMC=WeightMC*1.1113*0.87246*0.993396; + if(PUValue==9) WeightMC=WeightMC*1.12867*0.897374*0.994636; + if(PUValue==10) WeightMC=WeightMC*1.37858*1.11327*1.19816; + if(PUValue==11) WeightMC=WeightMC*0.980989*0.809113*0.843709; + if(PUValue==12) WeightMC=WeightMC*1.05204*0.892604*0.906712; + if(PUValue==13) WeightMC=WeightMC*0.988467*0.863995*0.852765; + if(PUValue==14) WeightMC=WeightMC*1.02872*0.933885*0.900774; + if(PUValue==15) WeightMC=WeightMC*1.03825*0.993352*0.937782; + if(PUValue==16) WeightMC=WeightMC*1.06262*1.08708*1.01057; + if(PUValue==17) WeightMC=WeightMC*1.03728*1.13625*1.04205; + if(PUValue==18) WeightMC=WeightMC*1.08073*1.29543*1.17618; + if(PUValue==19) WeightMC=WeightMC*0.990623*1.30234*1.17403; + if(PUValue==20) WeightMC=WeightMC*0.837278*1.22644*1.1057; + if(PUValue==21) WeightMC=WeightMC*0.98399*1.62192*1.46057; + if(PUValue==22) WeightMC=WeightMC*0.659693*1.23017*1.13012; + if(PUValue==23) WeightMC=WeightMC*0.624227*1.31342*1.22292; + if(PUValue==24) WeightMC=WeightMC*0.604303*1.41144*1.35969; + if(PUValue==25) WeightMC=WeightMC*0.368001*0.934106*0.929623; + if(PUValue==26) WeightMC=WeightMC*0.681775*1.78803*1.86664; + if(PUValue==27) WeightMC=WeightMC*0.146738*0.384705*0.417471; + if(PUValue==28) WeightMC=WeightMC*0.100275*0.248257*0.276309; + if(PUValue==29) WeightMC=WeightMC*0.0101723*0.0215978*0.0245047; + if(PUValue==30) WeightMC=WeightMC*0.0920068*0.1853*0.212557; + if(PUValue==31) WeightMC=WeightMC*0.00156869*0.00278051*0.00324063; + if(PUValue==32) WeightMC=WeightMC*0.000224117*0.000361503*0.000429415; + if(PUValue==33) WeightMC=WeightMC*5.23446e-05*9.00635e-05*0.000106457; + if(PUValue==34) WeightMC=WeightMC*0.000863209*0.00110908*0.00131942; + if(PUValue==35) WeightMC=WeightMC*1.81972e-05*2.03696e-05*2.40029e-05;*/ + + //////////////////////// MIKKO METHOD ////////////////////////////////////////////// + + //RUNB + /*if(PUValue==0) WeightMC=WeightMC*5.02417; + if(PUValue==1) WeightMC=WeightMC*0.92605; + if(PUValue==2) WeightMC=WeightMC*98.52599; + if(PUValue==3) WeightMC=WeightMC*2.74279; + if(PUValue==4) WeightMC=WeightMC*0.04558; + if(PUValue==5) WeightMC=WeightMC*0.06637; + if(PUValue==6) WeightMC=WeightMC*0.00301; + if(PUValue==7) WeightMC=WeightMC*0.00496; + if(PUValue==8) WeightMC=WeightMC*0.19185; + if(PUValue==9) WeightMC=WeightMC*0.05482; + if(PUValue==10) WeightMC=WeightMC*0.00030; + if(PUValue==11) WeightMC=WeightMC*0.00407; + if(PUValue==12) WeightMC=WeightMC*0.34996; + if(PUValue==13) WeightMC=WeightMC*0.38465; + if(PUValue==14) WeightMC=WeightMC*0.26010; + if(PUValue==15) WeightMC=WeightMC*0.00091; + if(PUValue==16) WeightMC=WeightMC*0.92053; + if(PUValue==17) WeightMC=WeightMC*0.96500; + if(PUValue==18) WeightMC=WeightMC*1.94715; + if(PUValue==19) WeightMC=WeightMC*1.00000; + if(PUValue==20) WeightMC=WeightMC*0.79781; + if(PUValue==21) WeightMC=WeightMC*1.00942; + if(PUValue==22) WeightMC=WeightMC*0.83538; + if(PUValue==23) WeightMC=WeightMC*0.91728; + if(PUValue==24) WeightMC=WeightMC*0.37085; + if(PUValue>=25) WeightMC=WeightMC*0;*/ + + //RUNC + if(PUValue==0) WeightMC=WeightMC*467.57407; + if(PUValue==1) WeightMC=WeightMC*30.31823; + if(PUValue==2) WeightMC=WeightMC*26.30839; + if(PUValue==3) WeightMC=WeightMC*6.08921; + if(PUValue==4) WeightMC=WeightMC*0; + if(PUValue==5) WeightMC=WeightMC*0; + if(PUValue==6) WeightMC=WeightMC*0.97311; + if(PUValue==7) WeightMC=WeightMC*0.12387; + if(PUValue==8) WeightMC=WeightMC*0.00199; + if(PUValue==9) WeightMC=WeightMC*0; + if(PUValue==10) WeightMC=WeightMC*0.03264; + if(PUValue==11) WeightMC=WeightMC*0.05545; + if(PUValue==12) WeightMC=WeightMC*0.01525; + if(PUValue==13) WeightMC=WeightMC*0.00746; + if(PUValue==14) WeightMC=WeightMC*0.00383; + if(PUValue==15) WeightMC=WeightMC*0.43554; + if(PUValue==16) WeightMC=WeightMC*1.45626; + if(PUValue==17) WeightMC=WeightMC*1.07330; + if(PUValue==18) WeightMC=WeightMC*1.20143; + if(PUValue==19) WeightMC=WeightMC*1; + if(PUValue==20) WeightMC=WeightMC*0.98406; + if(PUValue==21) WeightMC=WeightMC*1.51376; + if(PUValue==22) WeightMC=WeightMC*1.24476; + if(PUValue==23) WeightMC=WeightMC*1.25060; + if(PUValue==24) WeightMC=WeightMC*0.97207; + if(PUValue==25) WeightMC=WeightMC*0.47589; + if(PUValue>=26) WeightMC=WeightMC*0; + } + + hweight=WeightMC; + + } + if(hweight<0){ continue; } + + //cout<<"************************* NEW EVENT ******************************************"< decade) + cout<<10*k<<" %"<fired(ihltj[j]) > 0) { + hltPassj[j] = true; + if(Event->preL1(ihltj[j])>=0){ prescalej[j] = Event->preL1(ihltj[j]) * Event->preHLT(ihltj[j]);} + else {prescalej[j] = Event->preHLT(ihltj[j]);} + if(mprintOk==4){ + cout<preL1(ihltj[j])<<" "<< Event->preHLT(ihltj[j])<evtHdr().lumi(); + + double pthat = Event->evtHdr().pthat(); + double mc_weight = Event->evtHdr().weight(); + if(mprintOk==10) printf("\npthat=%f mc_weight=%e\n",pthat,mc_weight); + + mc_pthat->Fill(pthat); + mc_pthat_weighted->Fill(pthat,hweight); + + unsigned n_genJets = Event->nGenJets(); + unsigned n_PFJets = Event->nPFJetsCHS(); + int DetJets=0; + int DETjet_ok[100]; for(int ii=0;ii<100;++ii){DETjet_ok[ii]=0;} + + jecs->JEC_CHScorrections(Event, Event->nPFJetsCHS(), mIsMCarlo,mJECUncSrcNames); + //jecs->JEC_corrections(Event, Event->nPFJetsCHS(), mIsMCarlo,mJECUncSrcNames); + + if(mIsMCarlo){ + + ///////////////////////////////////////////////////////////////////////////////////////////// + ///Examine GenJets + + /// Dump all GEN jets + if(mprintOk==2){ + printf("Number of GENJets=%d\n",n_genJets); + for(unsigned j=0; jgenjet(j).pt(),Event->genjet(j).Rapidity(),Event->genjet(j).phi()); + } + } + + ///Apply Jet cuts. Very General to all existing GEN Jets + int GENjet_ok[100]; for(int ii=0;ii<100;++ii){GENjet_ok[ii]=0;} + + int GenJets=0; + + if(mprintOk==1) cout<<"Vertex info: numVtx="<evtHdr().nVtx()<<" numVtxGood="<evtHdr().nVtxGood()<<" isPVgood()="<evtHdr().isPVgood()<Fill(Event->evtHdr().nVtx(),hweight); + /// Keep events with PVgood + if (Event->evtHdr().isPVgood() != 1) continue; + + for(unsigned j=0; j< n_genJets; ++j){ + if(Event->genjet(j).pt()genjet(j).Rapidity())>mYMax) continue; + GENjet_ok[j]=1; + + if(Event->genjet(j).pt()>=50){ + GenJets++; + + if(fabs(Event->genjet(j).Rapidity())<=0.5) pt_GENInclJet_1bin->Fill(Event->genjet(j).pt(),hweight); + if(fabs(Event->genjet(j).Rapidity())>0.5 && fabs(Event->genjet(j).Rapidity())<=1.0) pt_GENInclJet_2bin->Fill(Event->genjet(j).pt(),hweight); + if(fabs(Event->genjet(j).Rapidity())>1.0 && fabs(Event->genjet(j).Rapidity())<=1.5) pt_GENInclJet_3bin->Fill(Event->genjet(j).pt(),hweight); + if(fabs(Event->genjet(j).Rapidity())>1.5 && fabs(Event->genjet(j).Rapidity())<=2.0) pt_GENInclJet_4bin->Fill(Event->genjet(j).pt(),hweight); + if(fabs(Event->genjet(j).Rapidity())>2.0 && fabs(Event->genjet(j).Rapidity())<=2.5) pt_GENInclJet_5bin->Fill(Event->genjet(j).pt(),hweight); + if(fabs(Event->genjet(j).Rapidity())>2.5 && fabs(Event->genjet(j).Rapidity())<=3.0) pt_GENInclJet_6bin->Fill(Event->genjet(j).pt(),hweight); + if(fabs(Event->genjet(j).Rapidity())>3.2 && fabs(Event->genjet(j).Rapidity())<=4.7) pt_GENInclJet_7bin->Fill(Event->genjet(j).pt(),hweight); + } + } + + Multiplicity_GENJet->Fill(GenJets,hweight); + + /// Keep events where leading Jet[0] and Jet[1] survived cuts + if((GENjet_ok[0]==1)&&(GENjet_ok[1]==1)) { + + ///////////////////////////////////// Measurement with Gen Jets /////////////////////////////////////////////////// + + pt0_GENJet->Fill(Event->genjet(0).pt(),hweight); + pt1_GENJet->Fill(Event->genjet(1).pt(),hweight); + y0_GENJet->Fill(Event->genjet(0).Rapidity(),hweight); + y1_GENJet->Fill(Event->genjet(1).Rapidity(),hweight); + phi0_GENJet->Fill(Event->genjet(0).phi(),hweight); + phi1_GENJet->Fill(Event->genjet(1).phi(),hweight); + + } //end of GEN Jets + + + ///////////////////////////////////////////////////////////////////////////////////////////// + /// PFJets + /////////////////////////////////////////////Vertex!!!!//////////////////////////////////////////////////////// + + /// Vertex selection + TruePileUpMC->Fill(Event->evtHdr().trpu(),hweight); + PileUpVSVertex->Fill(TruePileUpInteger,Event->evtHdr().nVtx(),hweight); + + //cout<evtHdr().pu()<<" "<evtHdr().ootpuEarly()<<" "<evtHdr().ootpuLate()<<" "<evtHdr().intpu()<<" "<evtHdr().nbx()<pfjetchs(j).ptCor(),Event->pfjetchs(j).y(),Event->pfjetchs(j).phi());} + } + + ///Apply Jet cuts. Very Deteral to all existing DET Jets + + for(unsigned j=0; j< Event->nPFJetsCHS(); ++j){ + if(Event->pfjetchs(j).ptCor()pfjetchs(j).y())>mYMax) continue; + + //if(mLowPileUp) {if (TruePileUpInteger<=5) continue;} + + //if(Event->pfjetchs(j).ptCor()>=50 && TruePileUpInteger<=10){ + if(Event->pfjetchs(j).ptCor()>=50){ + + DetJets++; + DETjet_ok[j]=1; + + pt0_DETInclJet->Fill(Event->pfjetchs(j).ptCor(),hweight); + pt0_DETInclJetUncor->Fill(Event->pfjetchs(j).pt(),hweight); + y0_DETInclJet->Fill(Event->pfjetchs(j).y(),hweight); + phi0_DETInclJet->Fill(Event->pfjetchs(j).phi(),hweight); + + //new histograms + Chargedhf0_DETJet->Fill(Event->pfjetchs(j).chf(),hweight);//charged hadron energy fraction + Neutralhf0_DETJet->Fill(Event->pfjetchs(j).nhf(),hweight);//neutral hadron energy fraction + Chargedef0_DETJet->Fill(Event->pfjetchs(j).cemf(),hweight);//charged em energy fraction + Photonef0_DETJet->Fill(Event->pfjetchs(j).nemf(),hweight);//neutral em energy fraction + Hadronef0_DETJet->Fill(Event->pfjetchs(j).hf_hf(),hweight);//hadron fraction energy fraction + Electromagneticef0_DETJet->Fill(Event->pfjetchs(j).hf_phf(),hweight);//electromagnetic fraction energy fraction + Muonef0_DETJet->Fill(Event->pfjetchs(j).muf(),hweight); //muon fraction energy fraction + + ChargedhMultiplicity0_DETJet->Fill(Event->pfjetchs(j).chm(),hweight);//charged hadron multiplicity + NeutralhMultiplicity0_DETJet->Fill(Event->pfjetchs(j).nhm(),hweight);//neutral hadron multiplicity + ChargedeMultiplicity0_DETJet->Fill(Event->pfjetchs(j).elm(),hweight);//electron em multiplicity + PhotoneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).phm(),hweight);//neutral em multiplicity + HadroneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).hf_hm(),hweight);//hadron fraction multiplicity + ElectromagneticeMultiplicity0_DETJet->Fill(Event->pfjetchs(j).hf_phm(),hweight);//electromagnetic fraction multiplicity + MuoneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).mum(),hweight); //muon fraction multiplicity + + if(fabs(Event->pfjetchs(j).y())<=0.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_1bin->Fill(Event->pfjetchs(j).ptCor(),hweight); pt_DETInclJetUP_1bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_1bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>0.5 && fabs(Event->pfjetchs(j).y())<=1.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_2bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_2bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_2bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>1.0 && fabs(Event->pfjetchs(j).y())<=1.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_3bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_3bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_3bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>1.5 && fabs(Event->pfjetchs(j).y())<=2.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_4bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_4bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_4bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>2.0 && fabs(Event->pfjetchs(j).y())<=2.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_5bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_5bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_5bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>2.5 && fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_6bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_6bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_6bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>3.2 && fabs(Event->pfjetchs(j).y())<=4.7) { + if(Event->pfjetchs(j).nemf()<0.90 && Event->pfjetchs(j).ncand()>10)//tight JETID forward region + {pt_DETInclJet_7bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_7bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_7bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + } + } + } + + if(DETjet_ok[0]==1){ + TruePileUpMCInteger->Fill(TruePileUpInteger,hweight); + num_of_VtxGood->Fill(Event->evtHdr().nVtxGood(),hweight); + + if(fabs(Event->pfjetchs(0).y())<=3.0 && Event->pfjetchs(0).tightID()){ + MET_DET->Fill(Event->pfmet().met(),hweight); + METPhi_DET->Fill(fabs(Event->pfmet().phi()),hweight); + FractionMET_DET->Fill(Event->pfmet().met_o_sumet(),hweight); + } + if(fabs(Event->pfjetchs(0).y())>3.2){ + if(Event->pfjetchs(0).nemf()<0.90 && Event->pfjetchs(0).ncand()>10){//tight JETID forward region + MET_DET->Fill(Event->pfmet().met(),hweight); + METPhi_DET->Fill(fabs(Event->pfmet().phi()),hweight); + FractionMET_DET->Fill(Event->pfmet().met_o_sumet(),hweight); + } + } + } + + /// Keep events where leading Jet[0] and Jet[1] survived cuts + if((DETjet_ok[0]==1)&&(DETjet_ok[1]==1)) { + + ///////////////////////////////////// Measurement with Det Jets /////////////////////////////////////////////////// + + pt0_DETJet->Fill(Event->pfjetchs(0).ptCor(),hweight); + pt0_DETJetUncor->Fill(Event->pfjetchs(0).pt(),hweight); + pt1_DETJet->Fill(Event->pfjetchs(1).ptCor(),hweight); + pt1_DETJetUncor->Fill(Event->pfjetchs(1).pt(),hweight); + y0_DETJet->Fill(Event->pfjetchs(0).y(),hweight); + y1_DETJet->Fill(Event->pfjetchs(1).y(),hweight); + phi0_DETJet->Fill(Event->pfjetchs(0).phi(),hweight); + phi1_DETJet->Fill(Event->pfjetchs(1).phi(),hweight); + } + + /// Vertex selection + if(mprintOk==1) cout<<"Vertex info: numVtx="<evtHdr().nVtx()<<" numVtxGood="<evtHdr().nVtxGood()<<" isPVgood()="<evtHdr().isPVgood()<<" pfRho="<evtHdr().pfRho()<nPFJetsCHS()); + for(unsigned j=0; jnPFJetsCHS(); ++j){ + printf("j=%2d pt=%8.3f ptCor=%8.3f y=%6.3f phi=%6.3f cor=%6.3f tightID=%d\n",j,Event->pfjetchs(j).pt(),Event->pfjetchs(j).ptCor(),Event->pfjetchs(j).y(),Event->pfjetchs(j).phi(),Event->pfjetchs(j).cor(),Event->pfjetchs(j).tightID()); + } + } + + // PURITY AND STABILITY + for(unsigned j=0; j< Event->nPFJetsCHS(); ++j){ + if(Event->pfjetchs(j).ptCor()pfjetchs(j).y())>mYMax) continue; + + int histoEntry=0; + double matchJet=1000; + double matchJetCounter=1000; + + for(unsigned i=0; i< n_genJets; ++i){ + if(Event->genjet(i).pt()genjet(i).Rapidity())>mYMax) continue; + + double deltaPhiMatch=Event->genjet(i).phi()-Event->pfjetchs(j).phi(); + if(deltaPhiMatch<-TMath::Pi()) deltaPhiMatch=deltaPhiMatch+2*TMath::Pi(); + if(deltaPhiMatch>TMath::Pi()) deltaPhiMatch=deltaPhiMatch-2*TMath::Pi(); + deltaPhiMatch=fabs(deltaPhiMatch); + + matchJetCounter=sqrt(pow(Event->genjet(i).Rapidity()-Event->pfjetchs(j).y(),2)+pow(deltaPhiMatch,2)); + + if(matchJetCounter<=matchJet) matchJet=matchJetCounter; + + if (matchJetCounter<0.3 && histoEntry==0){ + histoEntry=1; + PF_MatchedInclusiveJets->Fill(Event->pfjetchs(j).ptCor(),hweight); + Gen_MatchedInclusiveJets->Fill(Event->genjet(i).pt(),hweight); + TwoD_MatchedInclusiveJets->Fill(Event->pfjetchs(j).ptCor(),Event->genjet(i).pt(),hweight); + + //Separation in eta bins + if(fabs(Event->pfjetchs(j).y())<=0.5 && Event->pfjetchs(j).tightID()) { PF_MatchedInclusiveJets_1bin->Fill(Event->pfjetchs(j).ptCor(),hweight); Gen_MatchedInclusiveJets_1bin->Fill(Event->genjet(i).pt(),hweight); TwoD_MatchedInclusiveJets_1bin->Fill(Event->pfjetchs(j).ptCor(),Event->genjet(i).pt(),hweight); } + if(fabs(Event->pfjetchs(j).y())>0.5 && fabs(Event->pfjetchs(j).y())<=1.0 && Event->pfjetchs(j).tightID()) { PF_MatchedInclusiveJets_2bin->Fill(Event->pfjetchs(j).ptCor(),hweight); Gen_MatchedInclusiveJets_2bin->Fill(Event->genjet(i).pt(),hweight); TwoD_MatchedInclusiveJets_2bin->Fill(Event->pfjetchs(j).ptCor(),Event->genjet(i).pt(),hweight); } + if(fabs(Event->pfjetchs(j).y())>1.0 && fabs(Event->pfjetchs(j).y())<=1.5 && Event->pfjetchs(j).tightID()) { PF_MatchedInclusiveJets_3bin->Fill(Event->pfjetchs(j).ptCor(),hweight); Gen_MatchedInclusiveJets_3bin->Fill(Event->genjet(i).pt(),hweight); TwoD_MatchedInclusiveJets_3bin->Fill(Event->pfjetchs(j).ptCor(),Event->genjet(i).pt(),hweight); } + if(fabs(Event->pfjetchs(j).y())>1.5 && fabs(Event->pfjetchs(j).y())<=2.0 && Event->pfjetchs(j).tightID()) { PF_MatchedInclusiveJets_4bin->Fill(Event->pfjetchs(j).ptCor(),hweight); Gen_MatchedInclusiveJets_4bin->Fill(Event->genjet(i).pt(),hweight); TwoD_MatchedInclusiveJets_4bin->Fill(Event->pfjetchs(j).ptCor(),Event->genjet(i).pt(),hweight); } + if(fabs(Event->pfjetchs(j).y())>2.0 && fabs(Event->pfjetchs(j).y())<=2.5 && Event->pfjetchs(j).tightID()) { PF_MatchedInclusiveJets_5bin->Fill(Event->pfjetchs(j).ptCor(),hweight); Gen_MatchedInclusiveJets_5bin->Fill(Event->genjet(i).pt(),hweight); TwoD_MatchedInclusiveJets_5bin->Fill(Event->pfjetchs(j).ptCor(),Event->genjet(i).pt(),hweight); } + if(fabs(Event->pfjetchs(j).y())>2.5 && fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID()) { PF_MatchedInclusiveJets_6bin->Fill(Event->pfjetchs(j).ptCor(),hweight); Gen_MatchedInclusiveJets_6bin->Fill(Event->genjet(i).pt(),hweight); TwoD_MatchedInclusiveJets_6bin->Fill(Event->pfjetchs(j).ptCor(),Event->genjet(i).pt(),hweight); } + if(fabs(Event->pfjetchs(j).y())>3.2 && fabs(Event->pfjetchs(j).y())<=4.7) { + if(Event->pfjetchs(j).nemf()<0.90 && Event->pfjetchs(j).ncand()>10){//tight JETID forward region + PF_MatchedInclusiveJets_7bin->Fill(Event->pfjetchs(j).ptCor(),hweight); Gen_MatchedInclusiveJets_7bin->Fill(Event->genjet(i).pt(),hweight); TwoD_MatchedInclusiveJets_7bin->Fill(Event->pfjetchs(j).ptCor(),Event->genjet(i).pt(),hweight); } + } + + //Evaluation of resolution + double resolution=fabs(Event->pfjetchs(j).ptCor()-Event->genjet(i).pt())/Event->genjet(i).pt(); + double resolutionNoAbs=(Event->pfjetchs(j).ptCor()-Event->genjet(i).pt())/Event->genjet(i).pt(); + Resolution1D->Fill(resolutionNoAbs,hweight); + ResolutionInclusiveJets->Fill(Event->pfjetchs(j).ptCor(),resolution,hweight); + //Fill that for each eta bins + //ResolutionHistoPt1bin[0]->Fill(resolution,hweight); + + if(fabs(Event->pfjetchs(j).y())<=0.5 && Event->pfjetchs(j).tightID()) ResolutionInclusiveJets_1bin->Fill(Event->pfjetchs(j).ptCor(),resolution,hweight); + if(fabs(Event->pfjetchs(j).y())>0.5 && fabs(Event->pfjetchs(j).y())<=1.0 && Event->pfjetchs(j).tightID()) ResolutionInclusiveJets_2bin->Fill(Event->pfjetchs(j).ptCor(),resolution,hweight); + if(fabs(Event->pfjetchs(j).y())>1.0 && fabs(Event->pfjetchs(j).y())<=1.5 && Event->pfjetchs(j).tightID()) ResolutionInclusiveJets_3bin->Fill(Event->pfjetchs(j).ptCor(),resolution,hweight); + if(fabs(Event->pfjetchs(j).y())>1.5 && fabs(Event->pfjetchs(j).y())<=2.0 && Event->pfjetchs(j).tightID()) ResolutionInclusiveJets_4bin->Fill(Event->pfjetchs(j).ptCor(),resolution,hweight); + if(fabs(Event->pfjetchs(j).y())>2.0 && fabs(Event->pfjetchs(j).y())<=2.5 && Event->pfjetchs(j).tightID()) ResolutionInclusiveJets_5bin->Fill(Event->pfjetchs(j).ptCor(),resolution,hweight); + if(fabs(Event->pfjetchs(j).y())>2.5 && fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID()) ResolutionInclusiveJets_6bin->Fill(Event->pfjetchs(j).ptCor(),resolution,hweight); + if(fabs(Event->pfjetchs(j).y())>3.2 && fabs(Event->pfjetchs(j).y())<=4.7){ + if(Event->pfjetchs(j).nemf()<0.90 && Event->pfjetchs(j).ncand()>10){//tight JETID forward region + {ResolutionInclusiveJets_7bin->Fill(Event->pfjetchs(j).ptCor(),resolution,hweight); ResolutionForward1D->Fill(resolutionNoAbs,hweight);} + } + } + } + } + + DeltaR_Jets->Fill(matchJet,hweight); + + if (matchJet>0.3){ + PF_FakeInclusiveJets->Fill(Event->pfjetchs(j).ptCor(),hweight); + + if(fabs(Event->pfjetchs(j).y())<=0.5 && Event->pfjetchs(j).tightID()) PF_FakeInclusiveJets_1bin->Fill(Event->pfjetchs(j).ptCor(),hweight); + if(fabs(Event->pfjetchs(j).y())>0.5 && fabs(Event->pfjetchs(j).y())<=1.0 && Event->pfjetchs(j).tightID()) PF_FakeInclusiveJets_2bin->Fill(Event->pfjetchs(j).ptCor(),hweight); + if(fabs(Event->pfjetchs(j).y())>1.0 && fabs(Event->pfjetchs(j).y())<=1.5 && Event->pfjetchs(j).tightID()) PF_FakeInclusiveJets_3bin->Fill(Event->pfjetchs(j).ptCor(),hweight); + if(fabs(Event->pfjetchs(j).y())>1.5 && fabs(Event->pfjetchs(j).y())<=2.0 && Event->pfjetchs(j).tightID()) PF_FakeInclusiveJets_4bin->Fill(Event->pfjetchs(j).ptCor(),hweight); + if(fabs(Event->pfjetchs(j).y())>2.0 && fabs(Event->pfjetchs(j).y())<=2.5 && Event->pfjetchs(j).tightID()) PF_FakeInclusiveJets_5bin->Fill(Event->pfjetchs(j).ptCor(),hweight); + if(fabs(Event->pfjetchs(j).y())>2.5 && fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID()) PF_FakeInclusiveJets_6bin->Fill(Event->pfjetchs(j).ptCor(),hweight); + if(fabs(Event->pfjetchs(j).y())>3.2 && fabs(Event->pfjetchs(j).y())<=4.7) PF_FakeInclusiveJets_7bin->Fill(Event->pfjetchs(j).ptCor(),hweight); + + } + } + + // Missed Events at the Gen Level + for(unsigned i=0; i< n_genJets; ++i){ + if(Event->genjet(i).pt()genjet(i).Rapidity())>mYMax) continue; + double matchJet=1000; + double matchJetCounter=1000; + + for(unsigned j=0; j< Event->nPFJetsCHS(); ++j){ + if(Event->pfjetchs(j).ptCor()pfjetchs(j).y())>mYMax) continue; + + if(fabs(Event->pfjetchs(j).y())<=3.0 && !Event->pfjetchs(j).tightID()) continue; + + double deltaPhiMatch=Event->genjet(i).phi()-Event->pfjetchs(j).phi(); + if(deltaPhiMatch<-TMath::Pi()) deltaPhiMatch=deltaPhiMatch+2*TMath::Pi(); + if(deltaPhiMatch>TMath::Pi()) deltaPhiMatch=deltaPhiMatch-2*TMath::Pi(); + deltaPhiMatch=fabs(deltaPhiMatch); + + matchJetCounter=sqrt(pow(Event->genjet(i).Rapidity()-Event->pfjetchs(j).y(),2)+pow(deltaPhiMatch,2)); + if(matchJetCounter<=matchJet) matchJet=matchJetCounter; + } + + if (matchJet>0.3){ + Gen_MissInclusiveJets->Fill(Event->genjet(i).pt(),hweight); + + if(fabs(Event->genjet(i).Rapidity())<=0.5) Gen_MissInclusiveJets_1bin->Fill(Event->genjet(i).pt(),hweight); + if(fabs(Event->genjet(i).Rapidity())>0.5 && fabs(Event->genjet(i).Rapidity())<=1.0) Gen_MissInclusiveJets_2bin->Fill(Event->genjet(i).pt(),hweight); + if(fabs(Event->genjet(i).Rapidity())>1.0 && fabs(Event->genjet(i).Rapidity())<=1.5) Gen_MissInclusiveJets_3bin->Fill(Event->genjet(i).pt(),hweight); + if(fabs(Event->genjet(i).Rapidity())>1.5 && fabs(Event->genjet(i).Rapidity())<=2.0) Gen_MissInclusiveJets_4bin->Fill(Event->genjet(i).pt(),hweight); + if(fabs(Event->genjet(i).Rapidity())>2.0 && fabs(Event->genjet(i).Rapidity())<=2.5) Gen_MissInclusiveJets_5bin->Fill(Event->genjet(i).pt(),hweight); + if(fabs(Event->genjet(i).Rapidity())>2.5 && fabs(Event->genjet(i).Rapidity())<=3.0) Gen_MissInclusiveJets_6bin->Fill(Event->genjet(i).pt(),hweight); + if(fabs(Event->genjet(i).Rapidity())>3.2 && fabs(Event->genjet(i).Rapidity())<=4.7) Gen_MissInclusiveJets_7bin->Fill(Event->genjet(i).pt(),hweight); + + /*if(fabs(Event->genjet(i).y())<=0.5) { resp_jetpt1etabin->Miss(Event->genjet(i).pt(),hweight);} + if(fabs(Event->genjet(i).y())>0.5 && fabs(Event->genjet(i).y())<=1.0) { resp_jetpt2etabin->Miss(Event->genjet(i).pt(),hweight);} + if(fabs(Event->genjet(i).y())>1.0 && fabs(Event->genjet(i).y())<=1.5) { resp_jetpt3etabin->Miss(Event->genjet(i).pt(),hweight);} + if(fabs(Event->genjet(i).y())>1.5 && fabs(Event->genjet(i).y())<=2.0) { resp_jetpt4etabin->Miss(Event->genjet(i).pt(),hweight);} + if(fabs(Event->genjet(i).y())>2.0 && fabs(Event->genjet(i).y())<=2.5) { resp_jetpt5etabin->Miss(Event->genjet(i).pt(),hweight);} + if(fabs(Event->genjet(i).y())>2.5 && fabs(Event->genjet(i).y())<=3.0) { resp_jetpt6etabin->Miss(Event->genjet(i).pt(),hweight);} + if(fabs(Event->genjet(i).y())>3.2 && fabs(Event->genjet(i).y())<=4.7) { resp_jetpt7etabin->Miss(Event->genjet(i).pt(),hweight);}*/ + } + } + } + + // Trigger Ranges code + if(!mIsMCarlo){ + + double leading_pt = -10.0; + double leading_eta = -10.0; + + num_of_Vtx->Fill(Event->evtHdr().nVtx(),hweight); + /// Keep events with PVgood + + if(mprintOk==1){ + for(unsigned j=0; jnPFJets(); ++j){ + if(Event->evtHdr().runNo()==251252){ + if(Event->evtHdr().lumi()==158 && Event->evtHdr().event()==95957128) { + cout<evtHdr().event()<pfjet(j).ptCor(),Event->pfjet(j).y(),Event->pfjet(j).phi());} + if(Event->evtHdr().lumi()==158 && Event->evtHdr().event()==95734424) { + cout<evtHdr().event()<pfjet(j).ptCor(),Event->pfjet(j).y(),Event->pfjet(j).phi());} + if(Event->evtHdr().lumi()==158 && Event->evtHdr().event()==95800780) { + cout<evtHdr().event()<pfjet(j).ptCor(),Event->pfjet(j).y(),Event->pfjet(j).phi());} + } + } + } + + if (Event->evtHdr().isPVgood() != 1) continue; + + for (int j=0; jnL1Obj(ihltj[j]); l1iobj++ ) + { + //cout << "L1 object id: "< " << Event->l1obj(ihltj[j],l1iobj).pt() << " > " << ATrig[j] << endl; + if (Event->l1obj(ihltj[j],l1iobj).pt() > ATrig[j]) //threshold for L1 trigger + { + l1cut[j] = true; + } + } + + //----------------- HLT Theshold Checking --------------------------// + for ( unsigned hltiobj=0; hltiobjnHLTObj(ihltj[j]); hltiobj++ ) + { + //cout << "HLT object id: " << hltiobj << " -> " << Event->hltobj(ihltj[j],hltiobj).pt() << " > " << HLTJetPtNThres[j] << endl; + if (Event->hltobj(ihltj[j],hltiobj).pt() > HLTJetPtNThres[j]) //threshold for HLT trigger + { + hltcut[j] = true; + } + } + } + } + + //Trigger tag-and-probe + + if(Event->nPFJetsCHS()>=2) { + int selectEventsLead=0; + int selectEventsSubLead=0; + + if(fabs(Event->pfjetchs(0).eta())<1.3){ + + for ( unsigned hltiobj=0; hltiobjnHLTObj(ihltj[1]); hltiobj++ ) + { + + double deltaPhiMatch=Event->pfjetchs(0).phi()-Event->hltobj(ihltj[1],hltiobj).phi(); + if(deltaPhiMatch<-TMath::Pi()) deltaPhiMatch=deltaPhiMatch+2*TMath::Pi(); + if(deltaPhiMatch>TMath::Pi()) deltaPhiMatch=deltaPhiMatch-2*TMath::Pi(); + deltaPhiMatch=fabs(deltaPhiMatch); + + double matchJetCounter=sqrt(pow(Event->pfjetchs(0).eta()-Event->hltobj(ihltj[1],hltiobj).eta(),2)+pow(deltaPhiMatch,2)); + + if (matchJetCounter<0.5 && Event->hltobj(ihltj[1],hltiobj).pt()>10){ + double ResHLT=(Event->pfjetchs(0).ptCor()-Event->hltobj(ihltj[1],hltiobj).pt())/Event->pfjetchs(0).ptCor(); + ResolutionTagAndProbe->Fill(Event->pfjetchs(0).ptCor(),ResHLT,hweight); + } + + if (matchJetCounter<0.5 && Event->hltobj(ihltj[1],hltiobj).pt()>60){ + selectEventsLead=1; + } + + } + } + + if(fabs(Event->pfjetchs(1).eta())<1.3){ + for ( unsigned hltiobj=0; hltiobjnHLTObj(ihltj[1]); hltiobj++ ) + { + + double deltaPhiMatch=Event->pfjetchs(1).phi()-Event->hltobj(ihltj[1],hltiobj).phi(); + if(deltaPhiMatch<-TMath::Pi()) deltaPhiMatch=deltaPhiMatch+2*TMath::Pi(); + if(deltaPhiMatch>TMath::Pi()) deltaPhiMatch=deltaPhiMatch-2*TMath::Pi(); + deltaPhiMatch=fabs(deltaPhiMatch); + + double matchJetCounter=sqrt(pow(Event->pfjetchs(1).eta()-Event->hltobj(ihltj[1],hltiobj).eta(),2)+pow(deltaPhiMatch,2)); + + if (matchJetCounter<0.5 && Event->hltobj(ihltj[1],hltiobj).pt()>10){ + double ResHLT=(Event->pfjetchs(1).ptCor()-Event->hltobj(ihltj[1],hltiobj).pt())/Event->pfjetchs(1).ptCor(); + ResolutionTagAndProbe->Fill(Event->pfjetchs(1).ptCor(),ResHLT,hweight); + } + + if (matchJetCounter<0.5 && Event->hltobj(ihltj[1],hltiobj).pt()>60) //threshold for HLT trigger + { + selectEventsSubLead=1; + } + } + } + + int TriggerDenLead=0; + int TriggerDenLeadMatch=0; + int TriggerNumLead=0; + + int TriggerDenSubLead=0; + int TriggerDenSubLeadMatch=0; + int TriggerNumSubLead=0; + + if(selectEventsLead){ + + if(fabs(Event->pfjetchs(1).eta())<1.5){ + + double deltaPhiMatch=Event->pfjetchs(0).phi()-Event->pfjetchs(1).phi(); + if(deltaPhiMatch<-TMath::Pi()) deltaPhiMatch=deltaPhiMatch+2*TMath::Pi(); + if(deltaPhiMatch>TMath::Pi()) deltaPhiMatch=deltaPhiMatch-2*TMath::Pi(); + deltaPhiMatch=fabs(deltaPhiMatch); + + if(Event->nPFJetsCHS()==2 && deltaPhiMatch>2.7){TriggerDenLead=1;} + double ptBalance=0.3*(Event->pfjetchs(0).ptCor()+Event->pfjetchs(1).ptCor())/2; + if(Event->nPFJetsCHS()>2 && deltaPhiMatch>2.7 && Event->pfjetchs(2).ptCor()nHLTObj(ihltj[1]); hltiobj++ ) + { + + double deltaPhiMatch2=Event->pfjetchs(1).phi()-Event->hltobj(ihltj[1],hltiobj).phi(); + if(deltaPhiMatch2<-TMath::Pi()) deltaPhiMatch2=deltaPhiMatch2+2*TMath::Pi(); + if(deltaPhiMatch2>TMath::Pi()) deltaPhiMatch2=deltaPhiMatch2-2*TMath::Pi(); + deltaPhiMatch2=fabs(deltaPhiMatch2); + + double matchJetCounter2=sqrt(pow(Event->pfjetchs(1).eta()-Event->hltobj(ihltj[1],hltiobj).eta(),2)+pow(deltaPhiMatch2,2)); + + if (matchJetCounter2<0.2){ + TriggerDenLeadMatch=1; + if(Event->hltobj(ihltj[1],hltiobj).pt()>60){ + //cout<pfjetchs(1).ptCor()<<" "<hltobj(ihltj[1],hltiobj).pt()<pfjetchs(0).eta())<1.5){ + + double deltaPhiMatch=Event->pfjetchs(0).phi()-Event->pfjetchs(1).phi(); + if(deltaPhiMatch<-TMath::Pi()) deltaPhiMatch=deltaPhiMatch+2*TMath::Pi(); + if(deltaPhiMatch>TMath::Pi()) deltaPhiMatch=deltaPhiMatch-2*TMath::Pi(); + deltaPhiMatch=fabs(deltaPhiMatch); + + if(Event->nPFJetsCHS()==2 && deltaPhiMatch>2.7){TriggerDenSubLead=1;} + double ptBalance=0.3*(Event->pfjetchs(0).ptCor()+Event->pfjetchs(1).ptCor())/2; + if(Event->nPFJetsCHS()>2 && deltaPhiMatch>2.7 && Event->pfjetchs(2).ptCor()nHLTObj(ihltj[1]); hltiobj++ ) + { + + double deltaPhiMatch2=Event->pfjetchs(0).phi()-Event->hltobj(ihltj[1],hltiobj).phi(); + if(deltaPhiMatch2<-TMath::Pi()) deltaPhiMatch2=deltaPhiMatch2+2*TMath::Pi(); + if(deltaPhiMatch2>TMath::Pi()) deltaPhiMatch2=deltaPhiMatch2-2*TMath::Pi(); + deltaPhiMatch2=fabs(deltaPhiMatch2); + + double matchJetCounter2=sqrt(pow(Event->pfjetchs(0).eta()-Event->hltobj(ihltj[1],hltiobj).eta(),2)+pow(deltaPhiMatch2,2)); + + if(matchJetCounter2<0.2){ + TriggerDenSubLeadMatch=1; + + if(Event->hltobj(ihltj[1],hltiobj).pt()>60){ + TriggerNumSubLead=1; + } + } + } + } + } + } + + if(random==1){ + random=0; + if(TriggerDenLeadMatch){TagAndProbeDen->Fill(Event->pfjetchs(1).ptCor(),hweight);} + if(TriggerNumLead){TagAndProbeNum->Fill(Event->pfjetchs(1).ptCor(),hweight);} + } + + if(random==0){ + random=1; + if(TriggerDenSubLeadMatch){TagAndProbeDen->Fill(Event->pfjetchs(0).ptCor(),hweight);} + if(TriggerNumSubLead){TagAndProbeNum->Fill(Event->pfjetchs(0).ptCor(),hweight);} + } + } + + //end of trigger tag-and-probe + + for(unsigned int j=0; jnPFJetsCHS(); j++) { + double pt = Event->pfjetchs(j).ptCor(); + double eta = Event->pfjetchs(j).eta(); + + if (pt >= 20){ + if((Event->pfjetchs(j).tightID() && fabs(Event->pfjetchs(j).eta())<=3.0) || (fabs(Event->pfjetchs(j).eta())>3.0 && fabs(Event->pfjetchs(j).eta())<=4.7 && Event->pfjetchs(j).nemf()<0.90 && Event->pfjetchs(j).ncand()>10)) { + if (leading_pt < pt) { leading_pt = pt; leading_eta = eta; } + } + } + } + + hweight=1.; + + if(fabs(leading_eta)<1.5){ + if(hltPassj[0]){ + //if(prescalej[0]>0) hweight=hweight*prescalej[0]; + //if(prescalej[0]<0) hweight=hweight*(-prescalej[0]); + hist_leading_pt_all_Jet60->Fill(leading_pt,hweight); + hist_leading_eta_all_Jet60->Fill(leading_eta,hweight); + } + if (hltPassj[0] && hltcut[0]){ + //if(prescalej[0]>0) hweight=hweight*prescalej[0]; + //if(prescalej[0]<0) hweight=hweight*(-prescalej[0]); + hist_leading_pt_emulated_Jet60->Fill(leading_pt,hweight); + hist_leading_eta_emulated_Jet60->Fill(leading_eta,hweight); + } + + if(hltPassj[1]){ + //if(prescalej[1]>0) hweight=hweight*prescalej[1]; + //if(prescalej[1]<0) hweight=hweight*(-prescalej[1]); + hist_leading_pt_all_Jet80->Fill(leading_pt,hweight); + hist_leading_eta_all_Jet80->Fill(leading_eta,hweight); + } + if (hltPassj[1] && l1cut[1] && hltcut[1]){ + //if(prescalej[1]>0) hweight=hweight*prescalej[1]; + //if(prescalej[1]<0) hweight=hweight*(-prescalej[1]); + hist_leading_pt_emulated_Jet80->Fill(leading_pt,hweight); + hist_leading_eta_emulated_Jet80->Fill(leading_eta,hweight); + } + + if(hltPassj[2]){ + //if(prescalej[2]>0) hweight=hweight*prescalej[2]; + //if(prescalej[2]<0) hweight=hweight*(-prescalej[2]); + hist_leading_pt_all_Jet140->Fill(leading_pt,hweight); + hist_leading_eta_all_Jet140->Fill(leading_eta,hweight); + } + if (hltPassj[2] && l1cut[2] && hltcut[2]){ + //if(prescalej[2]>0) hweight=hweight*prescalej[2]; + //if(prescalej[2]<0) hweight=hweight*(-prescalej[2]); + hist_leading_pt_emulated_Jet140->Fill(leading_pt,hweight); + hist_leading_eta_emulated_Jet140->Fill(leading_eta,hweight); + } + + if(hltPassj[3]){ + //if(prescalej[3]>0) hweight=hweight*prescalej[3]; + //if(prescalej[3]<0) hweight=hweight*(-prescalej[3]); + hist_leading_pt_all_Jet200->Fill(leading_pt,hweight); + hist_leading_eta_all_Jet200->Fill(leading_eta,hweight); + } + if (hltPassj[3] && l1cut[3] && hltcut[3]){ + //if(prescalej[3]>0) hweight=hweight*prescalej[3]; + //if(prescalej[3]<0) hweight=hweight*(-prescalej[3]); + hist_leading_pt_emulated_Jet200->Fill(leading_pt,hweight); + hist_leading_eta_emulated_Jet200->Fill(leading_eta,hweight); + } + + if(hltPassj[4]){ + //if(prescalej[3]>0) hweight=hweight*prescalej[3]; + //if(prescalej[3]<0) hweight=hweight*(-prescalej[3]); + hist_leading_pt_all_Jet260->Fill(leading_pt,hweight); + hist_leading_eta_all_Jet260->Fill(leading_eta,hweight); + } + if (hltPassj[4] && l1cut[4] && hltcut[4]){ + //if(prescalej[3]>0) hweight=hweight*prescalej[3]; + //if(prescalej[3]<0) hweight=hweight*(-prescalej[3]); + hist_leading_pt_emulated_Jet260->Fill(leading_pt,hweight); + hist_leading_eta_emulated_Jet260->Fill(leading_eta,hweight); + } + + if(hltPassj[5]){ + //if(prescalej[4]>0) hweight=hweight*prescalej[4]; + //if(prescalej[4]<0) hweight=hweight*(-prescalej[4]); + hist_leading_pt_all_Jet320->Fill(leading_pt,hweight); + hist_leading_eta_all_Jet320->Fill(leading_eta,hweight); + } + if (hltPassj[5] && l1cut[5] && hltcut[5]){ + //if(prescalej[4]>0) hweight=hweight*prescalej[4]; + //if(prescalej[4]<0) hweight=hweight*(-prescalej[4]); + hist_leading_pt_emulated_Jet320->Fill(leading_pt,hweight); + hist_leading_eta_emulated_Jet320->Fill(leading_eta,hweight); + } + + if(hltPassj[6]){ + //if(prescalej[5]>0) hweight=hweight*prescalej[5]; + //if(prescalej[5]<0) hweight=hweight*(-prescalej[5]); + hist_leading_pt_all_Jet400->Fill(leading_pt,hweight); + hist_leading_eta_all_Jet400->Fill(leading_eta,hweight); + } + if (hltPassj[6] && l1cut[6] && hltcut[6]){ + //if(prescalej[5]>0) hweight=hweight*prescalej[5]; + //if(prescalej[5]<0) hweight=hweight*(-prescalej[5]); + hist_leading_pt_emulated_Jet400->Fill(leading_pt,hweight); + hist_leading_eta_emulated_Jet400->Fill(leading_eta,hweight); + } + + if(hltPassj[7]){ + //if(prescalej[6]>0) hweight=hweight*prescalej[6]; + //if(prescalej[6]<0) hweight=hweight*(-prescalej[6]); + hist_leading_pt_all_Jet450->Fill(leading_pt,hweight); + hist_leading_eta_all_Jet450->Fill(leading_eta,hweight); + } + if (hltPassj[7] && l1cut[7] && hltcut[7]){ + //if(prescalej[6]>0) hweight=hweight*prescalej[6]; + //if(prescalej[6]<0) hweight=hweight*(-prescalej[6]); + hist_leading_pt_emulated_Jet450->Fill(leading_pt,hweight); + hist_leading_eta_emulated_Jet450->Fill(leading_eta,hweight); + } + + if(hltPassj[8]){ + //if(prescalej[7]>0) hweight=hweight*prescalej[7]; + //if(prescalej[7]<0) hweight=hweight*(-prescalej[7]); + hist_leading_pt_all_Jet500->Fill(leading_pt,hweight); + hist_leading_eta_all_Jet500->Fill(leading_eta,hweight); + } + if (hltPassj[8] && l1cut[8] && hltcut[8]){ + //if(prescalej[7]>0) hweight=hweight*prescalej[7]; + //if(prescalej[7]<0) hweight=hweight*(-prescalej[7]); + hist_leading_pt_emulated_Jet500->Fill(leading_pt,hweight); + hist_leading_eta_emulated_Jet500->Fill(leading_eta,hweight); + } + } + + hweight=1.; + + for(unsigned int j=0; jnPFJetsCHS(); j++) { + if(Event->pfjetchs(j).ptCor()pfjetchs(j).y())>mYMax) continue; + + hweight=1.; + + //parsePileUpJSON2(); + double PileUpData=-10; + //PileUpData=getAvgPU(int(Event->evtHdr().runNo()),int(Event->evtHdr().lumi())); + + //cout<evtHdr().runNo())<<" "<evtHdr().lumi())<evtHdr().runNo()),int(Event->evtHdr().lumi()))<<" "<evtHdr().runNo())<<" "<evtHdr().lumi())<0) hweight=hweight*prescalej[1]; + if(prescalej[1]<0) hweight=hweight*(-prescalej[1]); + if(fabs(Event->pfjetchs(j).y())<=0.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet60_1bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + if(fabs(Event->pfjetchs(j).y())>=0.5 && fabs(Event->pfjetchs(j).y())<=1.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet60_2bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + if(fabs(Event->pfjetchs(j).y())>=1.0 && fabs(Event->pfjetchs(j).y())<=1.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet60_3bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + if(fabs(Event->pfjetchs(j).y())>=1.5 && fabs(Event->pfjetchs(j).y())<=2.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet60_4bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + if(fabs(Event->pfjetchs(j).y())>=2.0 && fabs(Event->pfjetchs(j).y())<=2.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet60_5bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + if(fabs(Event->pfjetchs(j).y())>=2.5 && fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet60_6bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + if(fabs(Event->pfjetchs(j).y())>=3.2 && fabs(Event->pfjetchs(j).y())<=4.7 && Event->pfjetchs(j).tightID()) {pt_DETInclJet60_7bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + } + + hweight=1.; + + if(hltPassj[2]){ + if(prescalej[2]>0) hweight=hweight*prescalej[2]; + if(prescalej[2]<0) hweight=hweight*(-prescalej[2]); + if(fabs(Event->pfjetchs(j).y())<=0.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet80_1bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + if(fabs(Event->pfjetchs(j).y())>=0.5 && fabs(Event->pfjetchs(j).y())<=1.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet80_2bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + if(fabs(Event->pfjetchs(j).y())>=1.0 && fabs(Event->pfjetchs(j).y())<=1.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet80_3bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + if(fabs(Event->pfjetchs(j).y())>=1.5 && fabs(Event->pfjetchs(j).y())<=2.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet80_4bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + if(fabs(Event->pfjetchs(j).y())>=2.0 && fabs(Event->pfjetchs(j).y())<=2.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet80_5bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + if(fabs(Event->pfjetchs(j).y())>=2.5 && fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet80_6bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + if(fabs(Event->pfjetchs(j).y())>=3.2 && fabs(Event->pfjetchs(j).y())<=4.7 && Event->pfjetchs(j).tightID()) {pt_DETInclJet80_7bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + } + + hweight=1.; + + if(hltPassj[3]){ + if(prescalej[3]>0) hweight=hweight*prescalej[3]; + if(prescalej[3]<0) hweight=hweight*(-prescalej[3]); + if(fabs(Event->pfjetchs(j).y())<=0.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet140_1bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + if(fabs(Event->pfjetchs(j).y())>=0.5 && fabs(Event->pfjetchs(j).y())<=1.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet140_2bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + if(fabs(Event->pfjetchs(j).y())>=1.0 && fabs(Event->pfjetchs(j).y())<=1.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet140_3bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + if(fabs(Event->pfjetchs(j).y())>=1.5 && fabs(Event->pfjetchs(j).y())<=2.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet140_4bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + if(fabs(Event->pfjetchs(j).y())>=2.0 && fabs(Event->pfjetchs(j).y())<=2.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet140_5bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + if(fabs(Event->pfjetchs(j).y())>=2.5 && fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet140_6bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + if(fabs(Event->pfjetchs(j).y())>=3.2 && fabs(Event->pfjetchs(j).y())<=4.7 && Event->pfjetchs(j).tightID()) {pt_DETInclJet140_7bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + } + + hweight=1.; + + if(hltPassj[4]){ + if(prescalej[4]>0) hweight=hweight*prescalej[4]; + if(prescalej[4]<0) hweight=hweight*(-prescalej[4]); + if(fabs(Event->pfjetchs(j).y())<=0.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet200_1bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + if(fabs(Event->pfjetchs(j).y())>=0.5 && fabs(Event->pfjetchs(j).y())<=1.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet200_2bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + if(fabs(Event->pfjetchs(j).y())>=1.0 && fabs(Event->pfjetchs(j).y())<=1.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet200_3bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + if(fabs(Event->pfjetchs(j).y())>=1.5 && fabs(Event->pfjetchs(j).y())<=2.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet200_4bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + if(fabs(Event->pfjetchs(j).y())>=2.0 && fabs(Event->pfjetchs(j).y())<=2.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet200_5bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + if(fabs(Event->pfjetchs(j).y())>=2.5 && fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet200_6bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + if(fabs(Event->pfjetchs(j).y())>=3.2 && fabs(Event->pfjetchs(j).y())<=4.7 && Event->pfjetchs(j).tightID()) {pt_DETInclJet200_7bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + } + + hweight=1.; + + if(hltPassj[5]){ + if(prescalej[5]>0) hweight=hweight*prescalej[5]; + if(prescalej[5]<0) hweight=hweight*(-prescalej[5]); + if(fabs(Event->pfjetchs(j).y())<=0.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet260_1bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + if(fabs(Event->pfjetchs(j).y())>=0.5 && fabs(Event->pfjetchs(j).y())<=1.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet260_2bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + if(fabs(Event->pfjetchs(j).y())>=1.0 && fabs(Event->pfjetchs(j).y())<=1.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet260_3bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + if(fabs(Event->pfjetchs(j).y())>=1.5 && fabs(Event->pfjetchs(j).y())<=2.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet260_4bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + if(fabs(Event->pfjetchs(j).y())>=2.0 && fabs(Event->pfjetchs(j).y())<=2.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet260_5bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + if(fabs(Event->pfjetchs(j).y())>=2.5 && fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet260_6bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + if(fabs(Event->pfjetchs(j).y())>=3.2 && fabs(Event->pfjetchs(j).y())<=4.7 && Event->pfjetchs(j).tightID()) {pt_DETInclJet260_7bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + } + + hweight=1.; + + if(hltPassj[6]){ + if(prescalej[6]>0) hweight=hweight*prescalej[6]; + if(prescalej[6]<0) hweight=hweight*(-prescalej[6]); + if(fabs(Event->pfjetchs(j).y())<=0.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet320_1bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + if(fabs(Event->pfjetchs(j).y())>=0.5 && fabs(Event->pfjetchs(j).y())<=1.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet320_2bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + if(fabs(Event->pfjetchs(j).y())>=1.0 && fabs(Event->pfjetchs(j).y())<=1.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet320_3bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + if(fabs(Event->pfjetchs(j).y())>=1.5 && fabs(Event->pfjetchs(j).y())<=2.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet320_4bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + if(fabs(Event->pfjetchs(j).y())>=2.0 && fabs(Event->pfjetchs(j).y())<=2.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet320_5bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + if(fabs(Event->pfjetchs(j).y())>=2.5 && fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet320_6bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + if(fabs(Event->pfjetchs(j).y())>=3.2 && fabs(Event->pfjetchs(j).y())<=4.7 && Event->pfjetchs(j).tightID()) {pt_DETInclJet320_7bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + } + + hweight=1.; + + if(hltPassj[7]){ + if(prescalej[7]>0) hweight=hweight*prescalej[7]; + if(prescalej[7]<0) hweight=hweight*(-prescalej[7]); + if(fabs(Event->pfjetchs(j).y())<=0.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet400_1bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + if(fabs(Event->pfjetchs(j).y())>=0.5 && fabs(Event->pfjetchs(j).y())<=1.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet400_2bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + if(fabs(Event->pfjetchs(j).y())>=1.0 && fabs(Event->pfjetchs(j).y())<=1.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet400_3bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + if(fabs(Event->pfjetchs(j).y())>=1.5 && fabs(Event->pfjetchs(j).y())<=2.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet400_4bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + if(fabs(Event->pfjetchs(j).y())>=2.0 && fabs(Event->pfjetchs(j).y())<=2.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet400_5bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + if(fabs(Event->pfjetchs(j).y())>=2.5 && fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet400_6bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + if(fabs(Event->pfjetchs(j).y())>=3.2 && fabs(Event->pfjetchs(j).y())<=4.7 && Event->pfjetchs(j).tightID()) {pt_DETInclJet400_7bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + } + + hweight=1.; + + if(hltPassj[8]){ + if(prescalej[8]>0) hweight=hweight*prescalej[8]; + if(prescalej[8]<0) hweight=hweight*(-prescalej[8]); + if(fabs(Event->pfjetchs(j).y())<=0.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet450_1bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + if(fabs(Event->pfjetchs(j).y())>=0.5 && fabs(Event->pfjetchs(j).y())<=1.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet450_2bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + if(fabs(Event->pfjetchs(j).y())>=1.0 && fabs(Event->pfjetchs(j).y())<=1.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet450_3bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + if(fabs(Event->pfjetchs(j).y())>=1.5 && fabs(Event->pfjetchs(j).y())<=2.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet450_4bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + if(fabs(Event->pfjetchs(j).y())>=2.0 && fabs(Event->pfjetchs(j).y())<=2.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet450_5bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + if(fabs(Event->pfjetchs(j).y())>=2.5 && fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet450_6bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + if(fabs(Event->pfjetchs(j).y())>=3.2 && fabs(Event->pfjetchs(j).y())<=4.7 && Event->pfjetchs(j).tightID()) {pt_DETInclJet450_7bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} + } + + hweight=1.; + + if(Event->pfjetchs(j).ptCor()>=mMinPt){ + + if(Event->pfjetchs(0).ptCor()>=mMinPt && Event->pfjetchs(0).ptCor()<114 && hltPassj[0]){ + //if(Event->pfjetchs(0).ptCor()>=mMinPt && Event->pfjetchs(0).ptCor()<137 && hltPassj[0]){ + + if(prescalej[0]>0) hweight=hweight*prescalej[0]; + if(prescalej[0]<0) hweight=hweight*(-prescalej[0]); + + if((fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID())||(fabs(Event->pfjetchs(j).y())>3.2 && Event->pfjetchs(j).nemf()<0.90 && Event->pfjetchs(j).ncand()>10)){ + DetJets++; + DETjet_ok[j]=1; + + pt0_DETInclJet->Fill(Event->pfjetchs(j).ptCor(),hweight); + pt0_DETInclJetUncor->Fill(Event->pfjetchs(j).pt(),hweight); + y0_DETInclJet->Fill(Event->pfjetchs(j).y(),hweight); + phi0_DETInclJet->Fill(Event->pfjetchs(j).phi(),hweight); + + //new histograms + Chargedhf0_DETJet->Fill(Event->pfjetchs(j).chf(),hweight);//charged hadron energy fraction + Neutralhf0_DETJet->Fill(Event->pfjetchs(j).nhf(),hweight);//neutral hadron energy fraction + Chargedef0_DETJet->Fill(Event->pfjetchs(j).cemf(),hweight);//charged em energy fraction + Photonef0_DETJet->Fill(Event->pfjetchs(j).nemf(),hweight);//neutral em energy fraction + Hadronef0_DETJet->Fill(Event->pfjetchs(j).hf_hf(),hweight);//hadron fraction energy fraction + Electromagneticef0_DETJet->Fill(Event->pfjetchs(j).hf_phf(),hweight);//electromagnetic fraction energy fraction + Muonef0_DETJet->Fill(Event->pfjetchs(j).muf(),hweight); //muon fraction energy fraction + + ChargedhMultiplicity0_DETJet->Fill(Event->pfjetchs(j).chm(),hweight);//charged hadron multiplicity + NeutralhMultiplicity0_DETJet->Fill(Event->pfjetchs(j).nhm(),hweight);//neutral hadron multiplicity + ChargedeMultiplicity0_DETJet->Fill(Event->pfjetchs(j).elm(),hweight);//electron em multiplicity + PhotoneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).phm(),hweight);//neutral em multiplicity + HadroneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).hf_hm(),hweight);//hadron fraction multiplicity + ElectromagneticeMultiplicity0_DETJet->Fill(Event->pfjetchs(j).hf_phm(),hweight);//electromagnetic fraction multiplicity + MuoneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).mum(),hweight); //muon fraction multiplicity + } + + if(Event->pfjetchs(j).ptCor()>=10){ + if(fabs(Event->pfjetchs(j).y())<=0.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_1bin->Fill(Event->pfjetchs(j).ptCor(),hweight); pt_DETInclJetUP_1bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_1bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>0.5 && fabs(Event->pfjetchs(j).y())<=1.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_2bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_2bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_2bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>1.0 && fabs(Event->pfjetchs(j).y())<=1.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_3bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_3bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_3bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>1.5 && fabs(Event->pfjetchs(j).y())<=2.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_4bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_4bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_4bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>2.0 && fabs(Event->pfjetchs(j).y())<=2.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_5bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_5bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_5bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>2.5 && fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_6bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_6bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_6bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>3.2 && fabs(Event->pfjetchs(j).y())<=4.7){ + if(Event->pfjetchs(j).nemf()<0.90 && Event->pfjetchs(j).ncand()>10)//tight JETID forward region + {pt_DETInclJet_7bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_7bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_7bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + } + } + } + + if(Event->pfjetchs(0).ptCor()>=114 && Event->pfjetchs(0).ptCor()<133 && hltPassj[1]){ + + //if(Event->pfjetchs(0).ptCor()>=137 && Event->pfjetchs(0).ptCor()<200 && hltPassj[1]){ + if(prescalej[1]>0) hweight=hweight*prescalej[1]; + if(prescalej[1]<0) hweight=hweight*(-prescalej[1]); + + bool switchFillPU=1; + if(switchFillPU){ + TruePileUpDataInteger->Fill(PileUpData,hweight); + switchFillPU=0; + } + + if((fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID())||(fabs(Event->pfjetchs(j).y())>3.2 && Event->pfjetchs(j).nemf()<0.90 && Event->pfjetchs(j).ncand()>10)){ + DetJets++; + DETjet_ok[j]=1; + + pt0_DETInclJet->Fill(Event->pfjetchs(j).ptCor(),hweight); + pt0_DETInclJetUncor->Fill(Event->pfjetchs(j).pt(),hweight); + y0_DETInclJet->Fill(Event->pfjetchs(j).y(),hweight); + phi0_DETInclJet->Fill(Event->pfjetchs(j).phi(),hweight); + + //new histograms + Chargedhf0_DETJet->Fill(Event->pfjetchs(j).chf(),hweight);//charged hadron energy fraction + Neutralhf0_DETJet->Fill(Event->pfjetchs(j).nhf(),hweight);//neutral hadron energy fraction + Chargedef0_DETJet->Fill(Event->pfjetchs(j).cemf(),hweight);//charged em energy fraction + Photonef0_DETJet->Fill(Event->pfjetchs(j).nemf(),hweight);//neutral em energy fraction + Hadronef0_DETJet->Fill(Event->pfjetchs(j).hf_hf(),hweight);//hadron fraction energy fraction + Electromagneticef0_DETJet->Fill(Event->pfjetchs(j).hf_phf(),hweight);//electromagnetic fraction energy fraction + Muonef0_DETJet->Fill(Event->pfjetchs(j).muf(),hweight); //muon fraction energy fraction + + ChargedhMultiplicity0_DETJet->Fill(Event->pfjetchs(j).chm(),hweight);//charged hadron multiplicity + NeutralhMultiplicity0_DETJet->Fill(Event->pfjetchs(j).nhm(),hweight);//neutral hadron multiplicity + ChargedeMultiplicity0_DETJet->Fill(Event->pfjetchs(j).elm(),hweight);//electron em multiplicity + PhotoneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).phm(),hweight);//neutral em multiplicity + HadroneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).hf_hm(),hweight);//hadron fraction multiplicity + ElectromagneticeMultiplicity0_DETJet->Fill(Event->pfjetchs(j).hf_phm(),hweight);//electromagnetic fraction multiplicity + MuoneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).mum(),hweight); //muon fraction multiplicity + } + + if(Event->pfjetchs(j).ptCor()>=10){ + if(fabs(Event->pfjetchs(j).y())<=0.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_1bin->Fill(Event->pfjetchs(j).ptCor(),hweight); pt_DETInclJetUP_1bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_1bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>0.5 && fabs(Event->pfjetchs(j).y())<=1.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_2bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_2bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_2bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>1.0 && fabs(Event->pfjetchs(j).y())<=1.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_3bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_3bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_3bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>1.5 && fabs(Event->pfjetchs(j).y())<=2.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_4bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_4bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_4bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>2.0 && fabs(Event->pfjetchs(j).y())<=2.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_5bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_5bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_5bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>2.5 && fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_6bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_6bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_6bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>3.2 && fabs(Event->pfjetchs(j).y())<=4.7) { + if(Event->pfjetchs(j).nemf()<0.90 && Event->pfjetchs(j).ncand()>10)//tight JETID forward region + {pt_DETInclJet_7bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_7bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_7bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + } + } + } + + if(Event->pfjetchs(0).ptCor()>=133 && Event->pfjetchs(0).ptCor()<220 && hltPassj[2]){ + //if(Event->pfjetchs(0).ptCor()>=200 && Event->pfjetchs(0).ptCor()<300 && hltPassj[2]){ + if(prescalej[2]>0) hweight=hweight*prescalej[2]; + if(prescalej[2]<0) hweight=hweight*(-prescalej[2]); + + bool switchFillPU=1; + if(switchFillPU){ + TruePileUpDataInteger->Fill(PileUpData,hweight); + switchFillPU=0; + } + + + if((fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID())||(fabs(Event->pfjetchs(j).y())>3.2 && Event->pfjetchs(j).nemf()<0.90 && Event->pfjetchs(j).ncand()>10)){ + DetJets++; + DETjet_ok[j]=1; + + pt0_DETInclJet->Fill(Event->pfjetchs(j).ptCor(),hweight); + pt0_DETInclJetUncor->Fill(Event->pfjetchs(j).pt(),hweight); + y0_DETInclJet->Fill(Event->pfjetchs(j).y(),hweight); + phi0_DETInclJet->Fill(Event->pfjetchs(j).phi(),hweight); + + //new histograms + Chargedhf0_DETJet->Fill(Event->pfjetchs(j).chf(),hweight);//charged hadron energy fraction + Neutralhf0_DETJet->Fill(Event->pfjetchs(j).nhf(),hweight);//neutral hadron energy fraction + Chargedef0_DETJet->Fill(Event->pfjetchs(j).cemf(),hweight);//charged em energy fraction + Photonef0_DETJet->Fill(Event->pfjetchs(j).nemf(),hweight);//neutral em energy fraction + Hadronef0_DETJet->Fill(Event->pfjetchs(j).hf_hf(),hweight);//hadron fraction energy fraction + Electromagneticef0_DETJet->Fill(Event->pfjetchs(j).hf_phf(),hweight);//electromagnetic fraction energy fraction + Muonef0_DETJet->Fill(Event->pfjetchs(j).muf(),hweight); //muon fraction energy fraction + + ChargedhMultiplicity0_DETJet->Fill(Event->pfjetchs(j).chm(),hweight);//charged hadron multiplicity + NeutralhMultiplicity0_DETJet->Fill(Event->pfjetchs(j).nhm(),hweight);//neutral hadron multiplicity + ChargedeMultiplicity0_DETJet->Fill(Event->pfjetchs(j).elm(),hweight);//electron em multiplicity + PhotoneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).phm(),hweight);//neutral em multiplicity + HadroneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).hf_hm(),hweight);//hadron fraction multiplicity + ElectromagneticeMultiplicity0_DETJet->Fill(Event->pfjetchs(j).hf_phm(),hweight);//electromagnetic fraction multiplicity + MuoneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).mum(),hweight); //muon fraction multiplicity + } + + if(Event->pfjetchs(j).ptCor()>=10){ + if(fabs(Event->pfjetchs(j).y())<=0.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_1bin->Fill(Event->pfjetchs(j).ptCor(),hweight); pt_DETInclJetUP_1bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_1bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>0.5 && fabs(Event->pfjetchs(j).y())<=1.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_2bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_2bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_2bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>1.0 && fabs(Event->pfjetchs(j).y())<=1.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_3bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_3bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_3bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>1.5 && fabs(Event->pfjetchs(j).y())<=2.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_4bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_4bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_4bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>2.0 && fabs(Event->pfjetchs(j).y())<=2.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_5bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_5bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_5bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>2.5 && fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_6bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_6bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_6bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>3.2 && fabs(Event->pfjetchs(j).y())<=4.7) { + if(Event->pfjetchs(j).nemf()<0.90 && Event->pfjetchs(j).ncand()>10)//tight JETID forward region + {pt_DETInclJet_7bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_7bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_7bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + } + } + } + + if(Event->pfjetchs(0).ptCor()>=220 && Event->pfjetchs(0).ptCor()<300 && hltPassj[3]){ + //if(Event->pfjetchs(0).ptCor()>=300 && Event->pfjetchs(0).ptCor()<400 && hltPassj[3]){ + if(prescalej[3]>0) hweight=hweight*prescalej[3]; + if(prescalej[3]<0) hweight=hweight*(-prescalej[3]); + + bool switchFillPU=1; + if(switchFillPU){ + TruePileUpDataInteger->Fill(PileUpData,hweight); + switchFillPU=0; + } + + if((fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID())||(fabs(Event->pfjetchs(j).y())>3.2 && Event->pfjetchs(j).nemf()<0.90 && Event->pfjetchs(j).ncand()>10)){ + DetJets++; + DETjet_ok[j]=1; + + pt0_DETInclJet->Fill(Event->pfjetchs(j).ptCor(),hweight); + pt0_DETInclJetUncor->Fill(Event->pfjetchs(j).pt(),hweight); + y0_DETInclJet->Fill(Event->pfjetchs(j).y(),hweight); + phi0_DETInclJet->Fill(Event->pfjetchs(j).phi(),hweight); + + //new histograms + Chargedhf0_DETJet->Fill(Event->pfjetchs(j).chf(),hweight);//charged hadron energy fraction + Neutralhf0_DETJet->Fill(Event->pfjetchs(j).nhf(),hweight);//neutral hadron energy fraction + Chargedef0_DETJet->Fill(Event->pfjetchs(j).cemf(),hweight);//charged em energy fraction + Photonef0_DETJet->Fill(Event->pfjetchs(j).nemf(),hweight);//neutral em energy fraction + Hadronef0_DETJet->Fill(Event->pfjetchs(j).hf_hf(),hweight);//hadron fraction energy fraction + Electromagneticef0_DETJet->Fill(Event->pfjetchs(j).hf_phf(),hweight);//electromagnetic fraction energy fraction + Muonef0_DETJet->Fill(Event->pfjetchs(j).muf(),hweight); //muon fraction energy fraction + + ChargedhMultiplicity0_DETJet->Fill(Event->pfjetchs(j).chm(),hweight);//charged hadron multiplicity + NeutralhMultiplicity0_DETJet->Fill(Event->pfjetchs(j).nhm(),hweight);//neutral hadron multiplicity + ChargedeMultiplicity0_DETJet->Fill(Event->pfjetchs(j).elm(),hweight);//electron em multiplicity + PhotoneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).phm(),hweight);//neutral em multiplicity + HadroneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).hf_hm(),hweight);//hadron fraction multiplicity + ElectromagneticeMultiplicity0_DETJet->Fill(Event->pfjetchs(j).hf_phm(),hweight);//electromagnetic fraction multiplicity + MuoneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).mum(),hweight); //muon fraction multiplicity + } + + if(Event->pfjetchs(j).ptCor()>=10){ + if(fabs(Event->pfjetchs(j).y())<=0.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_1bin->Fill(Event->pfjetchs(j).ptCor(),hweight); pt_DETInclJetUP_1bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_1bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>0.5 && fabs(Event->pfjetchs(j).y())<=1.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_2bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_2bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_2bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>1.0 && fabs(Event->pfjetchs(j).y())<=1.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_3bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_3bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_3bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>1.5 && fabs(Event->pfjetchs(j).y())<=2.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_4bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_4bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_4bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>2.0 && fabs(Event->pfjetchs(j).y())<=2.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_5bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_5bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_5bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>2.5 && fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_6bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_6bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_6bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>3.2 && fabs(Event->pfjetchs(j).y())<=4.7) { + if(Event->pfjetchs(j).nemf()<0.90 && Event->pfjetchs(j).ncand()>10)//tight JETID forward region + {pt_DETInclJet_7bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_7bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_7bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + } + } + } + + if(Event->pfjetchs(0).ptCor()>=300 && Event->pfjetchs(0).ptCor()<430 && hltPassj[4]){ + //if(Event->pfjetchs(0).ptCor()>=400 && Event->pfjetchs(0).ptCor()<500 && hltPassj[4]){ + if(prescalej[4]>0) hweight=hweight*prescalej[4]; + if(prescalej[4]<0) hweight=hweight*(-prescalej[4]); + + bool switchFillPU=1; + if(switchFillPU){ + TruePileUpDataInteger->Fill(PileUpData,hweight); + switchFillPU=0; + } + + + if((fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID())||(fabs(Event->pfjetchs(j).y())>3.2 && Event->pfjetchs(j).nemf()<0.90 && Event->pfjetchs(j).ncand()>10)){ + DetJets++; + DETjet_ok[j]=1; + + pt0_DETInclJet->Fill(Event->pfjetchs(j).ptCor(),hweight); + pt0_DETInclJetUncor->Fill(Event->pfjetchs(j).pt(),hweight); + y0_DETInclJet->Fill(Event->pfjetchs(j).y(),hweight); + phi0_DETInclJet->Fill(Event->pfjetchs(j).phi(),hweight); + + //new histograms + Chargedhf0_DETJet->Fill(Event->pfjetchs(j).chf(),hweight);//charged hadron energy fraction + Neutralhf0_DETJet->Fill(Event->pfjetchs(j).nhf(),hweight);//neutral hadron energy fraction + Chargedef0_DETJet->Fill(Event->pfjetchs(j).cemf(),hweight);//charged em energy fraction + Photonef0_DETJet->Fill(Event->pfjetchs(j).nemf(),hweight);//neutral em energy fraction + Hadronef0_DETJet->Fill(Event->pfjetchs(j).hf_hf(),hweight);//hadron fraction energy fraction + Electromagneticef0_DETJet->Fill(Event->pfjetchs(j).hf_phf(),hweight);//electromagnetic fraction energy fraction + Muonef0_DETJet->Fill(Event->pfjetchs(j).muf(),hweight); //muon fraction energy fraction + + ChargedhMultiplicity0_DETJet->Fill(Event->pfjetchs(j).chm(),hweight);//charged hadron multiplicity + NeutralhMultiplicity0_DETJet->Fill(Event->pfjetchs(j).nhm(),hweight);//neutral hadron multiplicity + ChargedeMultiplicity0_DETJet->Fill(Event->pfjetchs(j).elm(),hweight);//electron em multiplicity + PhotoneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).phm(),hweight);//neutral em multiplicity + HadroneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).hf_hm(),hweight);//hadron fraction multiplicity + ElectromagneticeMultiplicity0_DETJet->Fill(Event->pfjetchs(j).hf_phm(),hweight);//electromagnetic fraction multiplicity + MuoneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).mum(),hweight); //muon fraction multiplicity + } + + if(Event->pfjetchs(j).ptCor()>=10){ + if(fabs(Event->pfjetchs(j).y())<=0.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_1bin->Fill(Event->pfjetchs(j).ptCor(),hweight); pt_DETInclJetUP_1bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_1bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>0.5 && fabs(Event->pfjetchs(j).y())<=1.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_2bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_2bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_2bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>1.0 && fabs(Event->pfjetchs(j).y())<=1.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_3bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_3bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_3bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>1.5 && fabs(Event->pfjetchs(j).y())<=2.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_4bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_4bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_4bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>2.0 && fabs(Event->pfjetchs(j).y())<=2.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_5bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_5bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_5bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>2.5 && fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_6bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_6bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_6bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>3.2 && fabs(Event->pfjetchs(j).y())<=4.7) { + if(Event->pfjetchs(j).nemf()<0.90 && Event->pfjetchs(j).ncand()>10)//tight JETID forward region + {pt_DETInclJet_7bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_7bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_7bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + } + } + } + + if(Event->pfjetchs(0).ptCor()>=430 && Event->pfjetchs(0).ptCor()<507 && hltPassj[5]){ + //if(Event->pfjetchs(0).ptCor()>=500 && Event->pfjetchs(0).ptCor()<600 && hltPassj[5]){ + if(prescalej[5]>0) hweight=hweight*prescalej[5]; + if(prescalej[5]<0) hweight=hweight*(-prescalej[5]); + + bool switchFillPU=1; + if(switchFillPU){ + TruePileUpDataInteger->Fill(PileUpData,hweight); + switchFillPU=0; + } + + + if((fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID())||(fabs(Event->pfjetchs(j).y())>3.2 && Event->pfjetchs(j).nemf()<0.90 && Event->pfjetchs(j).ncand()>10)){ + DetJets++; + DETjet_ok[j]=1; + + pt0_DETInclJet->Fill(Event->pfjetchs(j).ptCor(),hweight); + pt0_DETInclJetUncor->Fill(Event->pfjetchs(j).pt(),hweight); + y0_DETInclJet->Fill(Event->pfjetchs(j).y(),hweight); + phi0_DETInclJet->Fill(Event->pfjetchs(j).phi(),hweight); + + //new histograms + Chargedhf0_DETJet->Fill(Event->pfjetchs(j).chf(),hweight);//charged hadron energy fraction + Neutralhf0_DETJet->Fill(Event->pfjetchs(j).nhf(),hweight);//neutral hadron energy fraction + Chargedef0_DETJet->Fill(Event->pfjetchs(j).cemf(),hweight);//charged em energy fraction + Photonef0_DETJet->Fill(Event->pfjetchs(j).nemf(),hweight);//neutral em energy fraction + Hadronef0_DETJet->Fill(Event->pfjetchs(j).hf_hf(),hweight);//hadron fraction energy fraction + Electromagneticef0_DETJet->Fill(Event->pfjetchs(j).hf_phf(),hweight);//electromagnetic fraction energy fraction + Muonef0_DETJet->Fill(Event->pfjetchs(j).muf(),hweight); //muon fraction energy fraction + + ChargedhMultiplicity0_DETJet->Fill(Event->pfjetchs(j).chm(),hweight);//charged hadron multiplicity + NeutralhMultiplicity0_DETJet->Fill(Event->pfjetchs(j).nhm(),hweight);//neutral hadron multiplicity + ChargedeMultiplicity0_DETJet->Fill(Event->pfjetchs(j).elm(),hweight);//electron em multiplicity + PhotoneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).phm(),hweight);//neutral em multiplicity + HadroneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).hf_hm(),hweight);//hadron fraction multiplicity + ElectromagneticeMultiplicity0_DETJet->Fill(Event->pfjetchs(j).hf_phm(),hweight);//electromagnetic fraction multiplicity + MuoneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).mum(),hweight); //muon fraction multiplicity + } + + if(Event->pfjetchs(j).ptCor()>=10){ + if(fabs(Event->pfjetchs(j).y())<=0.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_1bin->Fill(Event->pfjetchs(j).ptCor(),hweight); pt_DETInclJetUP_1bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_1bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>0.5 && fabs(Event->pfjetchs(j).y())<=1.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_2bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_2bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_2bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>1.0 && fabs(Event->pfjetchs(j).y())<=1.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_3bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_3bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_3bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>1.5 && fabs(Event->pfjetchs(j).y())<=2.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_4bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_4bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_4bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>2.0 && fabs(Event->pfjetchs(j).y())<=2.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_5bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_5bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_5bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>2.5 && fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_6bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_6bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_6bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>3.2 && fabs(Event->pfjetchs(j).y())<=4.7) { + if(Event->pfjetchs(j).nemf()<0.90 && Event->pfjetchs(j).ncand()>10)//tight JETID forward region + {pt_DETInclJet_7bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_7bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_7bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + } + } + } + + if(Event->pfjetchs(0).ptCor()>=507 && Event->pfjetchs(0).ptCor()<638 && hltPassj[6]){ + //if(Event->pfjetchs(0).ptCor()>=600 && Event->pfjetchs(0).ptCor()<700 && hltPassj[6]){ + if(prescalej[6]>0) hweight=hweight*prescalej[6]; + if(prescalej[6]<0) hweight=hweight*(-prescalej[6]); + + bool switchFillPU=1; + if(switchFillPU){ + TruePileUpDataInteger->Fill(PileUpData,hweight); + switchFillPU=0; + } + + + if((fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID())||(fabs(Event->pfjetchs(j).y())>3.2 && Event->pfjetchs(j).nemf()<0.90 && Event->pfjetchs(j).ncand()>10)){ + DetJets++; + DETjet_ok[j]=1; + + pt0_DETInclJet->Fill(Event->pfjetchs(j).ptCor(),hweight); + pt0_DETInclJetUncor->Fill(Event->pfjetchs(j).pt(),hweight); + y0_DETInclJet->Fill(Event->pfjetchs(j).y(),hweight); + phi0_DETInclJet->Fill(Event->pfjetchs(j).phi(),hweight); + + //new histograms + Chargedhf0_DETJet->Fill(Event->pfjetchs(j).chf(),hweight);//charged hadron energy fraction + Neutralhf0_DETJet->Fill(Event->pfjetchs(j).nhf(),hweight);//neutral hadron energy fraction + Chargedef0_DETJet->Fill(Event->pfjetchs(j).cemf(),hweight);//charged em energy fraction + Photonef0_DETJet->Fill(Event->pfjetchs(j).nemf(),hweight);//neutral em energy fraction + Hadronef0_DETJet->Fill(Event->pfjetchs(j).hf_hf(),hweight);//hadron fraction energy fraction + Electromagneticef0_DETJet->Fill(Event->pfjetchs(j).hf_phf(),hweight);//electromagnetic fraction energy fraction + Muonef0_DETJet->Fill(Event->pfjetchs(j).muf(),hweight); //muon fraction energy fraction + + ChargedhMultiplicity0_DETJet->Fill(Event->pfjetchs(j).chm(),hweight);//charged hadron multiplicity + NeutralhMultiplicity0_DETJet->Fill(Event->pfjetchs(j).nhm(),hweight);//neutral hadron multiplicity + ChargedeMultiplicity0_DETJet->Fill(Event->pfjetchs(j).elm(),hweight);//electron em multiplicity + PhotoneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).phm(),hweight);//neutral em multiplicity + HadroneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).hf_hm(),hweight);//hadron fraction multiplicity + ElectromagneticeMultiplicity0_DETJet->Fill(Event->pfjetchs(j).hf_phm(),hweight);//electromagnetic fraction multiplicity + MuoneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).mum(),hweight); //muon fraction multiplicity + } + + if(Event->pfjetchs(j).ptCor()>=10){ + if(fabs(Event->pfjetchs(j).y())<=0.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_1bin->Fill(Event->pfjetchs(j).ptCor(),hweight); pt_DETInclJetUP_1bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_1bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>0.5 && fabs(Event->pfjetchs(j).y())<=1.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_2bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_2bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_2bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>1.0 && fabs(Event->pfjetchs(j).y())<=1.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_3bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_3bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_3bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>1.5 && fabs(Event->pfjetchs(j).y())<=2.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_4bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_4bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_4bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>2.0 && fabs(Event->pfjetchs(j).y())<=2.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_5bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_5bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_5bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>2.5 && fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_6bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_6bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_6bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>3.2 && fabs(Event->pfjetchs(j).y())<=4.7) { + if(Event->pfjetchs(j).nemf()<0.90 && Event->pfjetchs(j).ncand()>10)//tight JETID forward region + {pt_DETInclJet_7bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_7bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_7bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + } + } + } + + if(Event->pfjetchs(0).ptCor()>=638 && Event->pfjetchs(0).ptCor()<737 && hltPassj[7]){ + //if(Event->pfjetchs(0).ptCor()>=700 && Event->pfjetchs(0).ptCor()<800 && hltPassj[7]){ + if(prescalej[7]>0) hweight=hweight*prescalej[7]; + if(prescalej[7]<0) hweight=hweight*(-prescalej[7]); + + bool switchFillPU=1; + if(switchFillPU){ + TruePileUpDataInteger->Fill(PileUpData,hweight); + switchFillPU=0; + } + + + if((fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID())||(fabs(Event->pfjetchs(j).y())>3.2 && Event->pfjetchs(j).nemf()<0.90 && Event->pfjetchs(j).ncand()>10)){ + DetJets++; + DETjet_ok[j]=1; + + pt0_DETInclJet->Fill(Event->pfjetchs(j).ptCor(),hweight); + pt0_DETInclJetUncor->Fill(Event->pfjetchs(j).pt(),hweight); + y0_DETInclJet->Fill(Event->pfjetchs(j).y(),hweight); + phi0_DETInclJet->Fill(Event->pfjetchs(j).phi(),hweight); + + //new histograms + Chargedhf0_DETJet->Fill(Event->pfjetchs(j).chf(),hweight);//charged hadron energy fraction + Neutralhf0_DETJet->Fill(Event->pfjetchs(j).nhf(),hweight);//neutral hadron energy fraction + Chargedef0_DETJet->Fill(Event->pfjetchs(j).cemf(),hweight);//charged em energy fraction + Photonef0_DETJet->Fill(Event->pfjetchs(j).nemf(),hweight);//neutral em energy fraction + Hadronef0_DETJet->Fill(Event->pfjetchs(j).hf_hf(),hweight);//hadron fraction energy fraction + Electromagneticef0_DETJet->Fill(Event->pfjetchs(j).hf_phf(),hweight);//electromagnetic fraction energy fraction + Muonef0_DETJet->Fill(Event->pfjetchs(j).muf(),hweight); //muon fraction energy fraction + + ChargedhMultiplicity0_DETJet->Fill(Event->pfjetchs(j).chm(),hweight);//charged hadron multiplicity + NeutralhMultiplicity0_DETJet->Fill(Event->pfjetchs(j).nhm(),hweight);//neutral hadron multiplicity + ChargedeMultiplicity0_DETJet->Fill(Event->pfjetchs(j).elm(),hweight);//electron em multiplicity + PhotoneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).phm(),hweight);//neutral em multiplicity + HadroneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).hf_hm(),hweight);//hadron fraction multiplicity + ElectromagneticeMultiplicity0_DETJet->Fill(Event->pfjetchs(j).hf_phm(),hweight);//electromagnetic fraction multiplicity + MuoneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).mum(),hweight); //muon fraction multiplicity + } + + if(Event->pfjetchs(j).ptCor()>=10){ + if(fabs(Event->pfjetchs(j).y())<=0.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_1bin->Fill(Event->pfjetchs(j).ptCor(),hweight); pt_DETInclJetUP_1bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_1bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>0.5 && fabs(Event->pfjetchs(j).y())<=1.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_2bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_2bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_2bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>1.0 && fabs(Event->pfjetchs(j).y())<=1.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_3bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_3bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_3bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>1.5 && fabs(Event->pfjetchs(j).y())<=2.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_4bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_4bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_4bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>2.0 && fabs(Event->pfjetchs(j).y())<=2.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_5bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_5bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_5bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>2.5 && fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_6bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_6bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_6bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>3.2 && fabs(Event->pfjetchs(j).y())<=4.7) { + if(Event->pfjetchs(j).nemf()<0.90 && Event->pfjetchs(j).ncand()>10)//tight JETID forward region + {pt_DETInclJet_7bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_7bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_7bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + } + } + } + + if(Event->pfjetchs(0).ptCor()>=737 && hltPassj[8]){ + //if(Event->pfjetchs(0).ptCor()>=800 && hltPassj[8]){ + if(prescalej[8]>0) hweight=hweight*prescalej[8]; + if(prescalej[8]<0) hweight=hweight*(-prescalej[8]); + + bool switchFillPU=1; + if(switchFillPU){ + TruePileUpDataInteger->Fill(PileUpData,hweight); + switchFillPU=0; + } + + + if((fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID())||(fabs(Event->pfjetchs(j).y())>3.2 && Event->pfjetchs(j).nemf()<0.90 && Event->pfjetchs(j).ncand()>10)){ + DetJets++; + DETjet_ok[j]=1; + + pt0_DETInclJet->Fill(Event->pfjetchs(j).ptCor(),hweight); + pt0_DETInclJetUncor->Fill(Event->pfjetchs(j).pt(),hweight); + y0_DETInclJet->Fill(Event->pfjetchs(j).y(),hweight); + phi0_DETInclJet->Fill(Event->pfjetchs(j).phi(),hweight); + + //new histograms + Chargedhf0_DETJet->Fill(Event->pfjetchs(j).chf(),hweight);//charged hadron energy fraction + Neutralhf0_DETJet->Fill(Event->pfjetchs(j).nhf(),hweight);//neutral hadron energy fraction + Chargedef0_DETJet->Fill(Event->pfjetchs(j).cemf(),hweight);//charged em energy fraction + Photonef0_DETJet->Fill(Event->pfjetchs(j).nemf(),hweight);//neutral em energy fraction + Hadronef0_DETJet->Fill(Event->pfjetchs(j).hf_hf(),hweight);//hadron fraction energy fraction + Electromagneticef0_DETJet->Fill(Event->pfjetchs(j).hf_phf(),hweight);//electromagnetic fraction energy fraction + Muonef0_DETJet->Fill(Event->pfjetchs(j).muf(),hweight); //muon fraction energy fraction + + ChargedhMultiplicity0_DETJet->Fill(Event->pfjetchs(j).chm(),hweight);//charged hadron multiplicity + NeutralhMultiplicity0_DETJet->Fill(Event->pfjetchs(j).nhm(),hweight);//neutral hadron multiplicity + ChargedeMultiplicity0_DETJet->Fill(Event->pfjetchs(j).elm(),hweight);//electron em multiplicity + PhotoneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).phm(),hweight);//neutral em multiplicity + HadroneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).hf_hm(),hweight);//hadron fraction multiplicity + ElectromagneticeMultiplicity0_DETJet->Fill(Event->pfjetchs(j).hf_phm(),hweight);//electromagnetic fraction multiplicity + MuoneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).mum(),hweight); //muon fraction multiplicity + } + + if(Event->pfjetchs(j).ptCor()>=10){ + if(fabs(Event->pfjetchs(j).y())<=0.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_1bin->Fill(Event->pfjetchs(j).ptCor(),hweight); pt_DETInclJetUP_1bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_1bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>0.5 && fabs(Event->pfjetchs(j).y())<=1.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_2bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_2bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_2bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>1.0 && fabs(Event->pfjetchs(j).y())<=1.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_3bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_3bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_3bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>1.5 && fabs(Event->pfjetchs(j).y())<=2.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_4bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_4bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_4bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>2.0 && fabs(Event->pfjetchs(j).y())<=2.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_5bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_5bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_5bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>2.5 && fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_6bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_6bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_6bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + if(fabs(Event->pfjetchs(j).y())>3.2 && fabs(Event->pfjetchs(j).y())<=4.7) { + if(Event->pfjetchs(j).nemf()<0.90 && Event->pfjetchs(j).ncand()>10)//tight JETID forward region + {pt_DETInclJet_7bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_7bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_7bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} + } + } + } + } + } + } + + if(DETjet_ok[0]==1 && DETjet_ok[1]==1){ + + pt0_DETJet->Fill(Event->pfjetchs(0).ptCor(),hweight); + pt0_DETJetUncor->Fill(Event->pfjetchs(0).pt(),hweight); + pt1_DETJet->Fill(Event->pfjetchs(1).ptCor(),hweight); + pt1_DETJetUncor->Fill(Event->pfjetchs(1).pt(),hweight); + y0_DETJet->Fill(Event->pfjetchs(0).y(),hweight); + y1_DETJet->Fill(Event->pfjetchs(1).y(),hweight); + phi0_DETJet->Fill(Event->pfjetchs(0).phi(),hweight); + phi1_DETJet->Fill(Event->pfjetchs(1).phi(),hweight); + } + + if(DETjet_ok[0]==1){ + + Multiplicity_DETJet->Fill(DetJets,hweight); + num_of_VtxGood->Fill(Event->evtHdr().nVtxGood(),hweight); + + if(fabs(Event->pfjetchs(0).y())<=3.0 && Event->pfjetchs(0).tightID()){ + MET_DET->Fill(Event->pfmet().met(),hweight); + METPhi_DET->Fill(fabs(Event->pfmet().phi()),hweight); + FractionMET_DET->Fill(Event->pfmet().met_o_sumet(),hweight); + } + if(fabs(Event->pfjetchs(0).y())>3.2 && Event->pfjetchs(0).nemf()<0.90 && Event->pfjetchs(0).ncand()>10){ + MET_DET->Fill(Event->pfmet().met(),hweight); + METPhi_DET->Fill(fabs(Event->pfmet().phi()),hweight); + FractionMET_DET->Fill(Event->pfmet().met_o_sumet(),hweight); + } + } + + //if(DetJets==2) {cout<evtHdr().lumi()<<" Event "<evtHdr().event()<<" Run Number "<evtHdr().runNo()<evtHdr().lumi()<<" Event "<evtHdr().event()<<" Run Number "<evtHdr().runNo()<evtHdr().lumi()<<" Event "<evtHdr().event()<<" Run Number "<evtHdr().runNo()<evtHdr().runNo()==251252){ + //if(Event->evtHdr().lumi()==158) { cout<evtHdr().event()<evtHdr().lumi()==158) { cout<evtHdr().event()<<" "<pfjetchs(0).ptCor()<<" "<pfjetchs(1).ptCor()<<" "<pfjetchs(2).ptCor()<<" "<pfjetchs(0).y()<<" "<pfjetchs(1).y()<<" "<pfjetchs(2).y()<evtHdr().lumi()==158) { cout<evtHdr().event()<<" "<pfjetchs(0).ptCor()<<" "<pfjetchs(1).ptCor()<<" "<pfjetchs(0).y()<<" "<pfjetchs(1).y()<evtHdr().lumi()==158) { cout<evtHdr().event()<<" "<pfjetchs(0).ptCor()<<" "<pfjetchs(1).ptCor()<<" "<pfjetchs(2).ptCor()<<" "<pfjetchs(0).y()<<" "<pfjetchs(1).y()<<" "<pfjetchs(2).y()<Close(); + + } + + float EntriesNumAcceptance[100][8]; + float EntriesDenAcceptance[100][8]; + float EntriesNumPurity[100][8]; + float EntriesDenPurity[100][8]; + float EntriesNumBackground[100][8]; + float EntriesDenBackground[100][8]; + float EntriesNumStability[100][8]; + float EntriesDenStability[100][8]; + + float Entries[8]; + float Errors[8]; + + for(int i=0;i<100;i++){ + for(int j=0;j<8;j++){ + EntriesNumAcceptance[i][j]=0; + EntriesDenAcceptance[i][j]=0; + EntriesNumStability[i][j]=0; + EntriesDenStability[i][j]=0; + EntriesNumBackground[i][j]=0; + EntriesDenBackground[i][j]=0; + EntriesNumPurity[i][j]=0; + EntriesDenPurity[i][j]=0; + Entries[j]=0; + Errors[j]=0; + } + } + + //Acceptance + + for(int i=1;iGetXaxis()->GetNbins()+1;i++){ + EntriesDenAcceptance[i][0]=Gen_MatchedInclusiveJets->GetBinContent(i); + EntriesDenAcceptance[i][1]=pt_GENInclJet_1bin->GetBinContent(i); + EntriesDenAcceptance[i][2]=pt_GENInclJet_2bin->GetBinContent(i); + EntriesDenAcceptance[i][3]=pt_GENInclJet_3bin->GetBinContent(i); + EntriesDenAcceptance[i][4]=pt_GENInclJet_4bin->GetBinContent(i); + EntriesDenAcceptance[i][5]=pt_GENInclJet_5bin->GetBinContent(i); + EntriesDenAcceptance[i][6]=pt_GENInclJet_6bin->GetBinContent(i); + EntriesDenAcceptance[i][7]=pt_GENInclJet_7bin->GetBinContent(i); + + for(int j=1;jGetYaxis()->GetNbins()+1;j++){ + EntriesNumAcceptance[i][0]=EntriesNumAcceptance[i][0]+TwoD_MatchedInclusiveJets->GetBinContent(j,i); + EntriesNumAcceptance[i][1]=EntriesNumAcceptance[i][1]+TwoD_MatchedInclusiveJets_1bin->GetBinContent(j,i); + EntriesNumAcceptance[i][2]=EntriesNumAcceptance[i][2]+TwoD_MatchedInclusiveJets_2bin->GetBinContent(j,i); + EntriesNumAcceptance[i][3]=EntriesNumAcceptance[i][3]+TwoD_MatchedInclusiveJets_3bin->GetBinContent(j,i); + EntriesNumAcceptance[i][4]=EntriesNumAcceptance[i][4]+TwoD_MatchedInclusiveJets_4bin->GetBinContent(j,i); + EntriesNumAcceptance[i][5]=EntriesNumAcceptance[i][5]+TwoD_MatchedInclusiveJets_5bin->GetBinContent(j,i); + EntriesNumAcceptance[i][6]=EntriesNumAcceptance[i][6]+TwoD_MatchedInclusiveJets_6bin->GetBinContent(j,i); + EntriesNumAcceptance[i][7]=EntriesNumAcceptance[i][7]+TwoD_MatchedInclusiveJets_7bin->GetBinContent(j,i); + } + + for(int j=0;j<8;j++){ + if(EntriesDenAcceptance[i][j]!=0){ + Entries[j]=EntriesNumAcceptance[i][j]/EntriesDenAcceptance[i][j]; + } + } + + AcceptancePtJets->SetBinContent(i,Entries[0]); + AcceptancePtJets->SetBinError(i,Errors[0]); + AcceptancePtJets_1bin->SetBinContent(i,Entries[1]); + AcceptancePtJets_2bin->SetBinContent(i,Entries[2]); + AcceptancePtJets_3bin->SetBinContent(i,Entries[3]); + AcceptancePtJets_4bin->SetBinContent(i,Entries[4]); + AcceptancePtJets_5bin->SetBinContent(i,Entries[5]); + AcceptancePtJets_6bin->SetBinContent(i,Entries[6]); + AcceptancePtJets_7bin->SetBinContent(i,Entries[7]); + AcceptancePtJets_1bin->SetBinError(i,Errors[0]); + AcceptancePtJets_2bin->SetBinError(i,Errors[0]); + AcceptancePtJets_3bin->SetBinError(i,Errors[0]); + AcceptancePtJets_4bin->SetBinError(i,Errors[0]); + AcceptancePtJets_5bin->SetBinError(i,Errors[0]); + AcceptancePtJets_6bin->SetBinError(i,Errors[0]); + AcceptancePtJets_7bin->SetBinError(i,Errors[0]); + } + + //Purity: matched detector and hadron level/ matched detector level + + for(int i=1;iGetXaxis()->GetNbins()+1;i++){ + EntriesNumPurity[i][0]=TwoD_MatchedInclusiveJets->GetBinContent(i,i); + + EntriesNumPurity[i][1]=TwoD_MatchedInclusiveJets_1bin->GetBinContent(i,i); + EntriesNumPurity[i][2]=TwoD_MatchedInclusiveJets_2bin->GetBinContent(i,i); + EntriesNumPurity[i][3]=TwoD_MatchedInclusiveJets_3bin->GetBinContent(i,i); + EntriesNumPurity[i][4]=TwoD_MatchedInclusiveJets_4bin->GetBinContent(i,i); + EntriesNumPurity[i][5]=TwoD_MatchedInclusiveJets_5bin->GetBinContent(i,i); + EntriesNumPurity[i][6]=TwoD_MatchedInclusiveJets_6bin->GetBinContent(i,i); + EntriesNumPurity[i][7]=TwoD_MatchedInclusiveJets_7bin->GetBinContent(i,i); + + for(int j=1;jGetYaxis()->GetNbins()+1;j++){ + EntriesDenPurity[i][0]=EntriesDenPurity[i][0]+TwoD_MatchedInclusiveJets->GetBinContent(j,i); + EntriesDenPurity[i][1]=EntriesDenPurity[i][1]+TwoD_MatchedInclusiveJets_1bin->GetBinContent(j,i); + EntriesDenPurity[i][2]=EntriesDenPurity[i][2]+TwoD_MatchedInclusiveJets_2bin->GetBinContent(j,i); + EntriesDenPurity[i][3]=EntriesDenPurity[i][3]+TwoD_MatchedInclusiveJets_3bin->GetBinContent(j,i); + EntriesDenPurity[i][4]=EntriesDenPurity[i][4]+TwoD_MatchedInclusiveJets_4bin->GetBinContent(j,i); + EntriesDenPurity[i][5]=EntriesDenPurity[i][5]+TwoD_MatchedInclusiveJets_5bin->GetBinContent(j,i); + EntriesDenPurity[i][6]=EntriesDenPurity[i][6]+TwoD_MatchedInclusiveJets_6bin->GetBinContent(j,i); + EntriesDenPurity[i][7]=EntriesDenPurity[i][7]+TwoD_MatchedInclusiveJets_7bin->GetBinContent(j,i); + } + + for(int j=0;j<8;j++){ + if(EntriesDenPurity[i][j]!=0){ + Entries[j]=EntriesNumPurity[i][j]/EntriesDenPurity[i][j]; + } + } + + PurityPtJets->SetBinContent(i,Entries[0]); + PurityPtJets_1bin->SetBinContent(i,Entries[1]); + PurityPtJets_2bin->SetBinContent(i,Entries[2]); + PurityPtJets_3bin->SetBinContent(i,Entries[3]); + PurityPtJets_4bin->SetBinContent(i,Entries[4]); + PurityPtJets_5bin->SetBinContent(i,Entries[5]); + PurityPtJets_6bin->SetBinContent(i,Entries[6]); + PurityPtJets_7bin->SetBinContent(i,Entries[7]); + + } + + //Stability:matched detector and hadron level / matched gen level + + for(int i=1;iGetXaxis()->GetNbins()+1;i++){ + EntriesNumStability[i][0]=TwoD_MatchedInclusiveJets->GetBinContent(i,i); + + EntriesNumStability[i][1]=TwoD_MatchedInclusiveJets_1bin->GetBinContent(i,i); + EntriesNumStability[i][2]=TwoD_MatchedInclusiveJets_2bin->GetBinContent(i,i); + EntriesNumStability[i][3]=TwoD_MatchedInclusiveJets_3bin->GetBinContent(i,i); + EntriesNumStability[i][4]=TwoD_MatchedInclusiveJets_4bin->GetBinContent(i,i); + EntriesNumStability[i][5]=TwoD_MatchedInclusiveJets_5bin->GetBinContent(i,i); + EntriesNumStability[i][6]=TwoD_MatchedInclusiveJets_6bin->GetBinContent(i,i); + EntriesNumStability[i][7]=TwoD_MatchedInclusiveJets_7bin->GetBinContent(i,i); + + for(int j=1;jGetYaxis()->GetNbins()+1;j++){ + EntriesDenStability[i][0]=EntriesDenStability[i][0]+TwoD_MatchedInclusiveJets->GetBinContent(i,j); + EntriesDenStability[i][1]=EntriesDenStability[i][1]+TwoD_MatchedInclusiveJets_1bin->GetBinContent(i,j); + EntriesDenStability[i][2]=EntriesDenStability[i][2]+TwoD_MatchedInclusiveJets_2bin->GetBinContent(i,j); + EntriesDenStability[i][3]=EntriesDenStability[i][3]+TwoD_MatchedInclusiveJets_3bin->GetBinContent(i,j); + EntriesDenStability[i][4]=EntriesDenStability[i][4]+TwoD_MatchedInclusiveJets_4bin->GetBinContent(i,j); + EntriesDenStability[i][5]=EntriesDenStability[i][5]+TwoD_MatchedInclusiveJets_5bin->GetBinContent(i,j); + EntriesDenStability[i][6]=EntriesDenStability[i][6]+TwoD_MatchedInclusiveJets_6bin->GetBinContent(i,j); + EntriesDenStability[i][7]=EntriesDenStability[i][7]+TwoD_MatchedInclusiveJets_7bin->GetBinContent(i,j); + } + + for(int j=0;j<8;j++){ + if(EntriesDenStability[i][j]!=0){ + Entries[j]=EntriesNumStability[i][j]/EntriesDenStability[i][j]; + } + } + + StabilityPtJets->SetBinContent(i,Entries[0]); + StabilityPtJets_1bin->SetBinContent(i,Entries[1]); + StabilityPtJets_2bin->SetBinContent(i,Entries[2]); + StabilityPtJets_3bin->SetBinContent(i,Entries[3]); + StabilityPtJets_4bin->SetBinContent(i,Entries[4]); + StabilityPtJets_5bin->SetBinContent(i,Entries[5]); + StabilityPtJets_6bin->SetBinContent(i,Entries[6]); + StabilityPtJets_7bin->SetBinContent(i,Entries[7]); + + } + + //Background + + for(int i=1;iGetXaxis()->GetNbins()+1;i++){ + EntriesDenBackground[i][0]=PF_MatchedInclusiveJets->GetBinContent(i); + + EntriesDenBackground[i][1]=pt_DETInclJet_1bin->GetBinContent(i); + EntriesDenBackground[i][2]=pt_DETInclJet_2bin->GetBinContent(i); + EntriesDenBackground[i][3]=pt_DETInclJet_3bin->GetBinContent(i); + EntriesDenBackground[i][4]=pt_DETInclJet_4bin->GetBinContent(i); + EntriesDenBackground[i][5]=pt_DETInclJet_5bin->GetBinContent(i); + EntriesDenBackground[i][6]=pt_DETInclJet_6bin->GetBinContent(i); + EntriesDenBackground[i][7]=pt_DETInclJet_7bin->GetBinContent(i); + + for(int j=1;jGetYaxis()->GetNbins()+1;j++){ + EntriesNumBackground[i][0]=EntriesNumBackground[i][0]+TwoD_MatchedInclusiveJets->GetBinContent(i,j); + + EntriesNumBackground[i][1]=EntriesNumBackground[i][1]+TwoD_MatchedInclusiveJets_1bin->GetBinContent(i,j); + EntriesNumBackground[i][2]=EntriesNumBackground[i][2]+TwoD_MatchedInclusiveJets_2bin->GetBinContent(i,j); + EntriesNumBackground[i][3]=EntriesNumBackground[i][3]+TwoD_MatchedInclusiveJets_3bin->GetBinContent(i,j); + EntriesNumBackground[i][4]=EntriesNumBackground[i][4]+TwoD_MatchedInclusiveJets_4bin->GetBinContent(i,j); + EntriesNumBackground[i][5]=EntriesNumBackground[i][5]+TwoD_MatchedInclusiveJets_5bin->GetBinContent(i,j); + EntriesNumBackground[i][6]=EntriesNumBackground[i][6]+TwoD_MatchedInclusiveJets_6bin->GetBinContent(i,j); + EntriesNumBackground[i][7]=EntriesNumBackground[i][7]+TwoD_MatchedInclusiveJets_7bin->GetBinContent(i,j); + } + + for(int j=0;j<8;j++){ + if(EntriesDenBackground[i][j]!=0){ + Entries[j]=1-EntriesNumBackground[i][j]/EntriesDenBackground[i][j]; + } + } + + BackgroundPtJets->SetBinContent(i,Entries[0]); + BackgroundPtJets_1bin->SetBinContent(i,Entries[1]); + BackgroundPtJets_2bin->SetBinContent(i,Entries[2]); + BackgroundPtJets_3bin->SetBinContent(i,Entries[3]); + BackgroundPtJets_4bin->SetBinContent(i,Entries[4]); + BackgroundPtJets_5bin->SetBinContent(i,Entries[5]); + BackgroundPtJets_6bin->SetBinContent(i,Entries[6]); + BackgroundPtJets_7bin->SetBinContent(i,Entries[7]); + + } + + int Ptbinwidth[81] = {1,1,4,1,2,2,2,3,3,3,3,4,4,5,6,6,7,8,10,10,13,17,19,20,21,22,24,25,27,28,30,32,33,35,38,39,41,44,46,48,51,53,56,59,62,65,69,71,76,79,83,87,91,96,100,106,110,116,122,128,134,140,147,154,162,170,177,187,195,205,215,225,236,248,259,272,285,299,313,328,283}; + + if(!mIsMCarlo){ + + double Entries=0; + for(int j=1;jGetXaxis()->GetNbins()+1;j++){ + Entries=pt_DETInclJet_1bin->GetBinContent(j)/(71.52*Ptbinwidth[j]); + pt_DETInclJetCrossSectNorm_1bin->SetBinContent(j,Entries); + Entries=pt_DETInclJet_2bin->GetBinContent(j)/(71.52*Ptbinwidth[j]); + pt_DETInclJetCrossSectNorm_2bin->SetBinContent(j,Entries); + Entries=pt_DETInclJet_3bin->GetBinContent(j)/(71.52*Ptbinwidth[j]); + pt_DETInclJetCrossSectNorm_3bin->SetBinContent(j,Entries); + Entries=pt_DETInclJet_4bin->GetBinContent(j)/(71.52*Ptbinwidth[j]); + pt_DETInclJetCrossSectNorm_4bin->SetBinContent(j,Entries); + Entries=pt_DETInclJet_5bin->GetBinContent(j)/(71.52*Ptbinwidth[j]); + pt_DETInclJetCrossSectNorm_5bin->SetBinContent(j,Entries); + Entries=pt_DETInclJet_6bin->GetBinContent(j)/(71.52*Ptbinwidth[j]); + pt_DETInclJetCrossSectNorm_6bin->SetBinContent(j,Entries); + Entries=pt_DETInclJet_7bin->GetBinContent(j)/(71.52*Ptbinwidth[j]); + pt_DETInclJetCrossSectNorm_7bin->SetBinContent(j,Entries); + } + } + + if(mIsMCarlo){ + + double Entries=0; + for(int j=1;jGetXaxis()->GetNbins()+1;j++){ + Entries=pt_DETInclJet_1bin->GetBinContent(j)/(Ptbinwidth[j]); + pt_DETInclJetCrossSectNorm_1bin->SetBinContent(j,Entries); + Entries=pt_DETInclJet_2bin->GetBinContent(j)/(Ptbinwidth[j]); + pt_DETInclJetCrossSectNorm_2bin->SetBinContent(j,Entries); + Entries=pt_DETInclJet_3bin->GetBinContent(j)/(Ptbinwidth[j]); + pt_DETInclJetCrossSectNorm_3bin->SetBinContent(j,Entries); + Entries=pt_DETInclJet_4bin->GetBinContent(j)/(Ptbinwidth[j]); + pt_DETInclJetCrossSectNorm_4bin->SetBinContent(j,Entries); + Entries=pt_DETInclJet_5bin->GetBinContent(j)/(Ptbinwidth[j]); + pt_DETInclJetCrossSectNorm_5bin->SetBinContent(j,Entries); + Entries=pt_DETInclJet_6bin->GetBinContent(j)/(Ptbinwidth[j]); + pt_DETInclJetCrossSectNorm_6bin->SetBinContent(j,Entries); + Entries=pt_DETInclJet_7bin->GetBinContent(j)/(Ptbinwidth[j]); + pt_DETInclJetCrossSectNorm_7bin->SetBinContent(j,Entries); + + Entries=pt_GENInclJet_1bin->GetBinContent(j)/(Ptbinwidth[j]); + pt_GENInclJetCrossSectNorm_1bin->SetBinContent(j,Entries); + Entries=pt_GENInclJet_2bin->GetBinContent(j)/(Ptbinwidth[j]); + pt_GENInclJetCrossSectNorm_2bin->SetBinContent(j,Entries); + Entries=pt_GENInclJet_3bin->GetBinContent(j)/(Ptbinwidth[j]); + pt_GENInclJetCrossSectNorm_3bin->SetBinContent(j,Entries); + Entries=pt_GENInclJet_4bin->GetBinContent(j)/(Ptbinwidth[j]); + pt_GENInclJetCrossSectNorm_4bin->SetBinContent(j,Entries); + Entries=pt_GENInclJet_5bin->GetBinContent(j)/(Ptbinwidth[j]); + pt_GENInclJetCrossSectNorm_5bin->SetBinContent(j,Entries); + Entries=pt_GENInclJet_6bin->GetBinContent(j)/(Ptbinwidth[j]); + pt_GENInclJetCrossSectNorm_6bin->SetBinContent(j,Entries); + Entries=pt_GENInclJet_7bin->GetBinContent(j)/(Ptbinwidth[j]); + pt_GENInclJetCrossSectNorm_7bin->SetBinContent(j,Entries); + } + } + + TagAndProbeEff->Divide(TagAndProbeNum,TagAndProbeDen,1.,1.,"B"); + + hist_leading_pt_HLT_Jet60U_eff->Divide(hist_leading_pt_emulated_Jet60,hist_leading_pt_all_Jet60,1.,1.,"B"); + hist_leading_eta_HLT_Jet60U_eff->Divide(hist_leading_eta_emulated_Jet60,hist_leading_eta_all_Jet60,1.,1.,"B"); + + hist_leading_pt_HLT_Jet80U_eff->Divide(hist_leading_pt_emulated_Jet80,hist_leading_pt_all_Jet80,1.,1.,"B"); + hist_leading_eta_HLT_Jet80U_eff->Divide(hist_leading_eta_emulated_Jet80,hist_leading_eta_all_Jet80,1.,1.,"B"); + + hist_leading_pt_HLT_Jet140U_eff->Divide(hist_leading_pt_emulated_Jet140,hist_leading_pt_all_Jet140,1.,1.,"B"); + hist_leading_eta_HLT_Jet140U_eff->Divide(hist_leading_eta_emulated_Jet140,hist_leading_eta_all_Jet140,1.,1.,"B"); + + hist_leading_pt_HLT_Jet200U_eff->Divide(hist_leading_pt_emulated_Jet200,hist_leading_pt_all_Jet200,1.,1.,"B"); + hist_leading_eta_HLT_Jet200U_eff->Divide(hist_leading_eta_emulated_Jet200,hist_leading_eta_all_Jet200,1.,1.,"B"); + + hist_leading_pt_HLT_Jet260U_eff->Divide(hist_leading_pt_emulated_Jet260,hist_leading_pt_all_Jet260,1.,1.,"B"); + hist_leading_eta_HLT_Jet260U_eff->Divide(hist_leading_eta_emulated_Jet260,hist_leading_eta_all_Jet260,1.,1.,"B"); + + hist_leading_pt_HLT_Jet320U_eff->Divide(hist_leading_pt_emulated_Jet320,hist_leading_pt_all_Jet320,1.,1.,"B"); + hist_leading_eta_HLT_Jet320U_eff->Divide(hist_leading_eta_emulated_Jet320,hist_leading_eta_all_Jet320,1.,1.,"B"); + + hist_leading_pt_HLT_Jet400U_eff->Divide(hist_leading_pt_emulated_Jet400,hist_leading_pt_all_Jet400,1.,1.,"B"); + hist_leading_eta_HLT_Jet400U_eff->Divide(hist_leading_eta_emulated_Jet400,hist_leading_eta_all_Jet400,1.,1.,"B"); + + hist_leading_pt_HLT_Jet450U_eff->Divide(hist_leading_pt_emulated_Jet450,hist_leading_pt_all_Jet450,1.,1.,"B"); + hist_leading_eta_HLT_Jet450U_eff->Divide(hist_leading_eta_emulated_Jet450,hist_leading_eta_all_Jet450,1.,1.,"B"); + + hist_leading_pt_HLT_Jet500U_eff->Divide(hist_leading_pt_emulated_Jet500,hist_leading_pt_all_Jet500,1.,1.,"B"); + hist_leading_eta_HLT_Jet500U_eff->Divide(hist_leading_eta_emulated_Jet500,hist_leading_eta_all_Jet500,1.,1.,"B"); + + } // closing analyze() function + + + +Analysis_Template_MC::~Analysis_Template_MC() +{ +} + + +DEFINE_FWK_MODULE(Analysis_Template_MC); + From e516d48491f1fe51f803c7ff6d30f6eb71e75f77 Mon Sep 17 00:00:00 2001 From: pgunnell Date: Tue, 23 Feb 2016 11:23:51 +0100 Subject: [PATCH 06/48] Create parsePileUpJSON2.h --- AnalysisFW/plugins/parsePileUpJSON2.h | 69 +++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 AnalysisFW/plugins/parsePileUpJSON2.h diff --git a/AnalysisFW/plugins/parsePileUpJSON2.h b/AnalysisFW/plugins/parsePileUpJSON2.h new file mode 100644 index 00000000000..98bf6152a17 --- /dev/null +++ b/AnalysisFW/plugins/parsePileUpJSON2.h @@ -0,0 +1,69 @@ +#ifndef __parsePileUpJSON2_C__ +#define __parsePileUpJSON2_C__ + +#include +#include +#include +#include +#include + +using namespace std; + +map > m_PU; + +double getAvgPU(int run, int ls) { + + return m_PU[run][ls]; +} + +///int parsePileUpJSON2(string filename="/afs/cern.ch/work/p/pgunnell/Run2Analysis/CMSSW_7_4_1_patch1/src/SMPJ/AnalysisFW/plugins/PileUp-50ns-RunBC.txt") { +int parsePileUpJSON2(string filename="/afs/cern.ch/work/p/pgunnell/Run2Analysis/CMSSW_7_4_1_patch1/src/SMPJ/AnalysisFW/plugins/RunB.txt") { + + //cout << "Opening " << filename << "..."; + + string line; + ifstream file(filename); + + if (file.is_open()){ + //cout << "ok "; + + //loop over lines in file + while ( getline(file,line) ){ + + string str, run_str, ls_str; + int delim_pos; + double PU = -1; + + if ( line.at(0) != '#' ){ + + //loop over strings in line + for (int string_num=0; (delim_pos = line.find(",")) != -1; string_num++){ + + str = line.substr(0, delim_pos); + line.erase(0, delim_pos + 1); + + if (string_num == 0) //first string holds run number + run_str = str.substr(0, str.find(":")); + + else if (string_num == 1) //second string has ls + ls_str = str.substr(0, str.find(":")); + + else if (string_num == 7) //eighth string has pu + PU = stod( str ); + } + + int run = stoi( run_str ); + int ls = stoi( ls_str ); + + m_PU[run][ls] = PU; + } + } + file.close(); + } + else + cout << "Unable to open file" << endl; + + return 0; +} + +#endif //__parsePileUpJSON2_C__ From e4c8fbcade69b0ad797c5e7b2194b6edc7ce1862 Mon Sep 17 00:00:00 2001 From: pgunnell Date: Tue, 23 Feb 2016 11:39:54 +0100 Subject: [PATCH 07/48] Rename AnalysisTemplate.cc to AnalysisTemplate_MC.cc --- .../plugins/{AnalysisTemplate.cc => AnalysisTemplate_MC.cc} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename AnalysisFW/plugins/{AnalysisTemplate.cc => AnalysisTemplate_MC.cc} (100%) diff --git a/AnalysisFW/plugins/AnalysisTemplate.cc b/AnalysisFW/plugins/AnalysisTemplate_MC.cc similarity index 100% rename from AnalysisFW/plugins/AnalysisTemplate.cc rename to AnalysisFW/plugins/AnalysisTemplate_MC.cc From cd3a5b445b3fc6ea779104af57d32a033e2bdc1e Mon Sep 17 00:00:00 2001 From: pgunnell Date: Tue, 23 Feb 2016 11:40:14 +0100 Subject: [PATCH 08/48] Rename AnalysisTemplate.h to AnalysisTemplate_MC.h --- AnalysisFW/plugins/{AnalysisTemplate.h => AnalysisTemplate_MC.h} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename AnalysisFW/plugins/{AnalysisTemplate.h => AnalysisTemplate_MC.h} (100%) diff --git a/AnalysisFW/plugins/AnalysisTemplate.h b/AnalysisFW/plugins/AnalysisTemplate_MC.h similarity index 100% rename from AnalysisFW/plugins/AnalysisTemplate.h rename to AnalysisFW/plugins/AnalysisTemplate_MC.h From 3533b4f3e559168498f036f9ac0b26776643c138 Mon Sep 17 00:00:00 2001 From: pgunnell Date: Tue, 23 Feb 2016 11:40:42 +0100 Subject: [PATCH 09/48] Create JECs.h --- AnalysisFW/plugins/JECs.h | 445 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 445 insertions(+) create mode 100644 AnalysisFW/plugins/JECs.h diff --git a/AnalysisFW/plugins/JECs.h b/AnalysisFW/plugins/JECs.h new file mode 100644 index 00000000000..074e4daa647 --- /dev/null +++ b/AnalysisFW/plugins/JECs.h @@ -0,0 +1,445 @@ +#ifndef JECs_h +#define JECs_h +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/EDAnalyzer.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "SMPJ/AnalysisFW/interface/QCDJet.h" + +#include "CondFormats/JetMETObjects/interface/FactorizedJetCorrector.h" +#include "CondFormats/JetMETObjects/interface/JetCorrectorParameters.h" +#include "CondFormats/JetMETObjects/interface/JetCorrectionUncertainty.h" + +using namespace edm; +using namespace std; + + + +class JECs { + + typedef reco::Particle::LorentzVector LorentzVector; + + public: + JECs(bool IsMCarlo, string GlobalTag, string JETTYPE, string jecUncSrc, vector jecUncSrcNames); + + static bool sort_pfjets(QCDPFJet j1, QCDPFJet j2) { + return j1.ptCor() > j2.ptCor(); + } + + static bool sort_calojets(QCDCaloJet j1, QCDCaloJet j2) { + return j1.ptCor() > j2.ptCor(); + } + + JetCorrectorParameters *L1Fast, *L2Relative, *L3Absolute, *L2L3Residual; + vector vecL1Fast, vecL2Relative, vecL3Absolute, vecL2L3Residual; + FactorizedJetCorrector *jecL1Fast, *jecL2Relative, *jecL3Absolute, *jecL2L3Residual; + JetCorrectionUncertainty *mPFUnc; + JetCorrectionUncertainty *mCaloUnc; + + JetCorrectorParameters *par; + JetCorrectionUncertainty *tmpUnc; + std::vector mPFUncSrc; + std::vector mCaloUncSrc; + std::vector mJECUncSrcNames; + + virtual void JEC_corrections(QCDEvent *Event, unsigned n_PFJets, bool IsMCarlo, vector jecUncSrcNames){ + + + // ---- declaration of the vector of jets ---- // + vector mPFJets; mPFJets.clear(); + + // ----- looping over the number of jets in the event ---- // + for(unsigned iJet = 0; iJet < n_PFJets; iJet++) + { + vector JecFactors; JecFactors.clear(); + QCDPFJet pfjet; + pfjet = Event->pfjet(iJet); // ----- accessing the uncorrected jet in the event for non-chs jet----- // + + // ---- Old JEC factor ----- // + double oldJecFactor = pfjet.cor(); + + LorentzVector oldJetP4= pfjet.p4(); // ---- accessing the 4-vector of the jet ---- // + TLorentzVector tmpJet; + tmpJet.SetPxPyPzE(oldJetP4.px(), oldJetP4.py(), oldJetP4.pz(), oldJetP4.energy()); + + TLorentzVector UnCorrectedJet = tmpJet * (1./oldJecFactor); // --- obtaining the uncorrected jet 4-vector by scaling down by the old jec factor --- // + //TLorentzVector UnCorrectedJet = tmpJet; ///Jets are already uncorrected + // ---- Evaluating the L1Fast correction factor ---- // + jecL1Fast->setJetPt(UnCorrectedJet.Pt()); + jecL1Fast->setJetA(pfjet.area()); + jecL1Fast->setRho(Event->evtHdr().pfRho()); + jecL1Fast->setJetEta(UnCorrectedJet.Eta()); + //std::cout<getCorrection(); + //cout<<"L1Fast Cor Factor = "<setJetPt(tmpJetL1FastCorrected.Pt()); + jecL2Relative->setJetEta(tmpJetL1FastCorrected.Eta()); + + double corFactorL2Relative = jecL2Relative->getCorrection(); + //cout<<"L2Relative Cor Factor"<setJetPt(tmpJetL1FastL2RelativeCorrected.Pt()); + jecL3Absolute->setJetEta(tmpJetL1FastL2RelativeCorrected.Eta()); + + double corFactorL3Absolute = jecL3Absolute->getCorrection(); + //cout<<"L3Absolute Cor Factor"<setJetPt(tmpJetL1FastL2RelativeL3AbsoluteCorrected.Pt()); + jecL2L3Residual->setJetEta(tmpJetL1FastL2RelativeL3AbsoluteCorrected.Eta()); + + corFactorL2L3Residual = jecL2L3Residual->getCorrection(); + //cout<<"L2L3Rsidual Cor Factor"< uncSrc(0); + mPFUnc->setJetEta(pfjet.eta()); + mPFUnc->setJetPt(pfjet.pt()); + unc = mPFUnc->getUncertainty(true); + + for(unsigned isrc=0;isrcsetJetEta(pfjet.eta()); + mPFUncSrc[isrc]->setJetPt(pfjet.pt()); + float unc1 = mPFUncSrc[isrc]->getUncertainty(true); + uncSrc.push_back(unc1); + } // for(unsigned isrc=0;isrcsetPFJets(mPFJets); + } + + virtual void JEC_CHScorrections(QCDEvent *Event, unsigned n_PFJetsCHS, bool IsMCarlo, vector jecUncSrcNames){ + + // ---- declaration of the vector of jets ---- // + vector mPFJetsCHS; mPFJetsCHS.clear(); + + // ----- looping over the number of jets in the event ---- // + for(unsigned iJet = 0; iJet < n_PFJetsCHS; iJet++) + { + vector JecFactors; JecFactors.clear(); + QCDPFJet pfjetchs; + pfjetchs = Event->pfjetchs(iJet); // ----- accessing the uncorrected jet in the event for non-chs jet----- // + + // ---- Old JEC factor ----- // + double oldJecFactor = pfjetchs.cor(); + + LorentzVector oldJetP4 = pfjetchs.p4(); // ---- accessing the 4-vector of the jet ---- // + TLorentzVector tmpJet; + tmpJet.SetPxPyPzE(oldJetP4.px(), oldJetP4.py(), oldJetP4.pz(), oldJetP4.energy()); + + TLorentzVector UnCorrectedJet = tmpJet * (1./oldJecFactor); // --- obtaining the uncorrected jet 4-vector by scaling down by the old jec factor --- // + //TLorentzVector UnCorrectedJet = tmpJet; ///Jets are already uncorrected + // ---- Evaluating the L1Fast correction factor ---- // + jecL1Fast->setJetPt(UnCorrectedJet.Pt()); + jecL1Fast->setJetA(pfjetchs.area()); + jecL1Fast->setRho(Event->evtHdr().pfRho()); + jecL1Fast->setJetEta(UnCorrectedJet.Eta()); + //std::cout<getCorrection(); + //cout<<"L1Fast Cor Factor = "<setJetPt(tmpJetL1FastCorrected.Pt()); + jecL2Relative->setJetEta(tmpJetL1FastCorrected.Eta()); + + double corFactorL2Relative = jecL2Relative->getCorrection(); + //cout<<"L2Relative Cor Factor"<setJetPt(tmpJetL1FastL2RelativeCorrected.Pt()); + jecL3Absolute->setJetEta(tmpJetL1FastL2RelativeCorrected.Eta()); + + double corFactorL3Absolute = jecL3Absolute->getCorrection(); + //cout<<"L3Absolute Cor Factor"<setJetPt(tmpJetL1FastL2RelativeL3AbsoluteCorrected.Pt()); + jecL2L3Residual->setJetEta(tmpJetL1FastL2RelativeL3AbsoluteCorrected.Eta()); + + corFactorL2L3Residual = jecL2L3Residual->getCorrection(); + //cout<<"L2L3Rsidual Cor Factor"< uncSrc(0); + mPFUnc->setJetEta(pfjetchs.eta()); + mPFUnc->setJetPt(pfjetchs.pt()); + unc = mPFUnc->getUncertainty(true); + +// + for(unsigned isrc=0;isrcsetJetEta(pfjetchs.eta()); + mPFUncSrc[isrc]->setJetPt(pfjetchs.pt()); + float unc1 = mPFUncSrc[isrc]->getUncertainty(true); + uncSrc.push_back(unc1); + } // for(unsigned isrc=0;isrcsetPFJetsCHS(mPFJetsCHS); + } + + virtual void JEC_Calocorrections(QCDEvent *Event, unsigned n_CaloJets, bool IsMCarlo){ + + // ---- declaration of the vector of jets ---- // + vector mCaloJets; mCaloJets.clear(); + + // ----- looping over the number of jets in the event ---- // + for(unsigned iJet = 0; iJet < n_CaloJets; iJet++) + { + vector JecFactors; JecFactors.clear(); + QCDCaloJet calojet; + calojet = Event->calojet(iJet); // ----- accessing the uncorrected jet in the event for non-chs jet----- // + + // ---- Old JEC factor ----- // + //double oldJecFactor = calojet.cor(); + + LorentzVector oldJetP4 = calojet.p4(); // ---- accessing the 4-vector of the jet ---- // + TLorentzVector tmpJet; + tmpJet.SetPxPyPzE(oldJetP4.px(), oldJetP4.py(), oldJetP4.pz(), oldJetP4.energy()); + + //TLorentzVector UnCorrectedJet = tmpJet * (1./oldJecFactor); // --- obtaining the uncorrected jet 4-vector by scaling down by the old jec factor --- // + TLorentzVector UnCorrectedJet = tmpJet; ///Jets are already uncorrected + // ---- Evaluating the L1Fast correction factor ---- // + jecL1Fast->setJetPt(UnCorrectedJet.Pt()); + jecL1Fast->setJetA(calojet.area()); + jecL1Fast->setRho(Event->evtHdr().caloRho()); + jecL1Fast->setJetEta(UnCorrectedJet.Eta()); + //std::cout<getCorrection(); + //cout<<"L1Fast Cor Factor = "<setJetPt(tmpJetL1FastCorrected.Pt()); + jecL2Relative->setJetEta(tmpJetL1FastCorrected.Eta()); + + double corFactorL2Relative = jecL2Relative->getCorrection(); + //cout<<"L2Relative Cor Factor"<setJetPt(tmpJetL1FastL2RelativeCorrected.Pt()); + jecL3Absolute->setJetEta(tmpJetL1FastL2RelativeCorrected.Eta()); + + double corFactorL3Absolute = jecL3Absolute->getCorrection(); + //cout<<"L3Absolute Cor Factor"<setJetPt(tmpJetL1FastL2RelativeL3AbsoluteCorrected.Pt()); + jecL2L3Residual->setJetEta(tmpJetL1FastL2RelativeL3AbsoluteCorrected.Eta()); + + corFactorL2L3Residual = jecL2L3Residual->getCorrection(); + //cout<<"L2L3Rsidual Cor Factor"< uncSrc(0); +// mCaloUnc->setJetEta(calojet.eta()); +// mCaloUnc->setJetPt(calojet.pt()); +// unc = mCaloUnc->getUncertainty(true); +// +// for(unsigned isrc=0;isrcsetJetEta(calojet.eta()); +// mCaloUncSrc[isrc]->setJetPt(calojet.pt()); +// float unc1 = mCaloUncSrc[isrc]->getUncertainty(true); +// uncSrc.push_back(unc1); +// } // for(unsigned isrc=0;isrcsetCaloJets(mCaloJets); + } +}; + +JECs::JECs(bool IsMCarlo, string GlobalTag, string JETTYPE, string jecUncSrc, vector mJECUncSrcNames){ + + string file_data_mc = "DATA"; + if(IsMCarlo) file_data_mc = "MC"; + + L1Fast = new JetCorrectorParameters("../data/"+GlobalTag+"/"+GlobalTag+"_"+file_data_mc+"_L1FastJet_"+JETTYPE+".txt"); + L2Relative = new JetCorrectorParameters("../data/"+GlobalTag+"/"+GlobalTag+"_"+file_data_mc+"_L2Relative_"+JETTYPE+".txt"); + L3Absolute = new JetCorrectorParameters("../data/"+GlobalTag+"/"+GlobalTag+"_"+file_data_mc+"_L3Absolute_"+JETTYPE+".txt"); + if(!IsMCarlo) + L2L3Residual = new JetCorrectorParameters("../data/"+GlobalTag+"/"+GlobalTag+"_DATA_L2L3Residual_"+JETTYPE+".txt"); + + vecL1Fast.push_back(*L1Fast); + vecL2Relative.push_back(*L2Relative); + vecL3Absolute.push_back(*L3Absolute); + if(!IsMCarlo) + vecL2L3Residual.push_back(*L2L3Residual); + + + jecL1Fast = new FactorizedJetCorrector(vecL1Fast); + jecL2Relative = new FactorizedJetCorrector(vecL2Relative); + jecL3Absolute = new FactorizedJetCorrector(vecL3Absolute); + if(!IsMCarlo) + jecL2L3Residual = new FactorizedJetCorrector(vecL2L3Residual); + + ///Read Uncertainty txt files + mPFUnc = new JetCorrectionUncertainty("../data/"+GlobalTag+"/"+GlobalTag+"_"+file_data_mc+"_Uncertainty_"+JETTYPE+".txt"); + + for(unsigned isrc=0;isrc Date: Mon, 9 May 2016 09:49:00 +0200 Subject: [PATCH 10/48] Rename AnalysisTemplate_MC.cc to Analysis_Template_MC.cc --- .../plugins/{AnalysisTemplate_MC.cc => Analysis_Template_MC.cc} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename AnalysisFW/plugins/{AnalysisTemplate_MC.cc => Analysis_Template_MC.cc} (100%) diff --git a/AnalysisFW/plugins/AnalysisTemplate_MC.cc b/AnalysisFW/plugins/Analysis_Template_MC.cc similarity index 100% rename from AnalysisFW/plugins/AnalysisTemplate_MC.cc rename to AnalysisFW/plugins/Analysis_Template_MC.cc From a7fefe1e1d7cb167a9b4f3236509c603792b9795 Mon Sep 17 00:00:00 2001 From: pgunnell Date: Mon, 9 May 2016 09:49:16 +0200 Subject: [PATCH 11/48] Rename AnalysisTemplate_MC.h to Analysis_Template_MC.h --- .../plugins/{AnalysisTemplate_MC.h => Analysis_Template_MC.h} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename AnalysisFW/plugins/{AnalysisTemplate_MC.h => Analysis_Template_MC.h} (100%) diff --git a/AnalysisFW/plugins/AnalysisTemplate_MC.h b/AnalysisFW/plugins/Analysis_Template_MC.h similarity index 100% rename from AnalysisFW/plugins/AnalysisTemplate_MC.h rename to AnalysisFW/plugins/Analysis_Template_MC.h From fdcfbba2a53b8242f9361bc8c17fd6cf7779c7b8 Mon Sep 17 00:00:00 2001 From: Paolo Date: Thu, 2 Nov 2017 09:33:29 +0100 Subject: [PATCH 12/48] ntuples_9_3X --- AnalysisFW/interface/QCDEvent.h | 62 +- AnalysisFW/interface/QCDEventHdr.h | 13 +- AnalysisFW/interface/QCDJet.h | 7 +- AnalysisFW/interface/QCDMET.h | 3 - AnalysisFW/interface/QCDPFJet.h | 46 +- .../plugins/ProcessedTreeProducerBTag.cc | 809 ++++++----------- .../plugins/ProcessedTreeProducerBTag.h | 61 +- ...16_25nsV9p2_DATA_L2L3Residual_AK8PFchs.txt | 37 + AnalysisFW/src/QCDEvent.cc | 253 ------ AnalysisFW/src/classes.h | 7 - AnalysisFW/src/classes_def.xml | 4 - AnalysisFW/test/.DS_Store | Bin 0 -> 8196 bytes AnalysisFW/test/._.DS_Store | Bin 0 -> 4096 bytes ...rocessedTreeProducer_MC2017_MiniAOD_cfg.py | 171 ++++ ...rocessedTreeProducer_MCPAT25ns_BTag_cfg.py | 51 +- ...ocessedTreeProducer_MCPAT25ns_BTag_cfg.pyc | Bin 0 -> 10626 bytes ...cessedTreeProducer_data2017_MiniAOD_cfg.py | 145 +++ ...cessedTreeProducer_dataPAT25ns_BTag_cfg.py | 113 +-- ...essedTreeProducer_dataPAT25ns_BTag_cfg.pyc | Bin 0 -> 13410 bytes ...16_25nsV9p2_DATA_L2L3Residual_AK8PFchs.txt | 37 + AnalysisFW/test/Test_cfg.py | 326 +++++++ AnalysisFW/test/crab.log | 183 ++++ AnalysisFW/test/crabDataAODBTag-RunC2016.py | 29 + AnalysisFW/test/crabDataAODBTag-RunC2016.pyc | Bin 0 -> 1279 bytes AnalysisFW/test/crabDataAODBTag.py | 20 +- AnalysisFW/test/crabDataAODBTag.pyc | Bin 0 -> 1277 bytes AnalysisFW/test/crabMC-pythia8Flat.py | 40 + AnalysisFW/test/crabMC-pythia8Flat.pyc | Bin 0 -> 1134 bytes AnalysisFW/test/jetToolbox_cff.py | 836 ++++++++++++++++++ AnalysisFW/test/jetToolbox_cff.pyc | Bin 0 -> 23685 bytes AnalysisFW/test/processedLumisRunB2016.json | 1 + AnalysisFW/test/processedLumisRunC2016.json | 1 + AnalysisFW/test/processedLumisRunD2016.json | 1 + AnalysisFW/test/processedLumisRunE2016.json | 1 + .../test/processedLumisRun_2016BCD.json | 1 + AnalysisFW/test/processedLumis_2016BCD.json | 1 + 36 files changed, 2268 insertions(+), 991 deletions(-) create mode 100644 AnalysisFW/plugins/Spring16_25nsV9p2_DATA_L2L3Residual_AK8PFchs.txt create mode 100644 AnalysisFW/test/.DS_Store create mode 100644 AnalysisFW/test/._.DS_Store create mode 100644 AnalysisFW/test/ProcessedTreeProducer_MC2017_MiniAOD_cfg.py create mode 100644 AnalysisFW/test/ProcessedTreeProducer_MCPAT25ns_BTag_cfg.pyc create mode 100644 AnalysisFW/test/ProcessedTreeProducer_data2017_MiniAOD_cfg.py create mode 100644 AnalysisFW/test/ProcessedTreeProducer_dataPAT25ns_BTag_cfg.pyc create mode 100644 AnalysisFW/test/Spring16_25nsV9p2_DATA_L2L3Residual_AK8PFchs.txt create mode 100644 AnalysisFW/test/Test_cfg.py create mode 100644 AnalysisFW/test/crab.log create mode 100644 AnalysisFW/test/crabDataAODBTag-RunC2016.py create mode 100644 AnalysisFW/test/crabDataAODBTag-RunC2016.pyc create mode 100644 AnalysisFW/test/crabDataAODBTag.pyc create mode 100644 AnalysisFW/test/crabMC-pythia8Flat.py create mode 100644 AnalysisFW/test/crabMC-pythia8Flat.pyc create mode 100644 AnalysisFW/test/jetToolbox_cff.py create mode 100644 AnalysisFW/test/jetToolbox_cff.pyc create mode 100644 AnalysisFW/test/processedLumisRunB2016.json create mode 100644 AnalysisFW/test/processedLumisRunC2016.json create mode 100644 AnalysisFW/test/processedLumisRunD2016.json create mode 100644 AnalysisFW/test/processedLumisRunE2016.json create mode 100644 AnalysisFW/test/processedLumisRun_2016BCD.json create mode 100644 AnalysisFW/test/processedLumis_2016BCD.json diff --git a/AnalysisFW/interface/QCDEvent.h b/AnalysisFW/interface/QCDEvent.h index a43f610059f..4532c3d49b5 100644 --- a/AnalysisFW/interface/QCDEvent.h +++ b/AnalysisFW/interface/QCDEvent.h @@ -5,10 +5,7 @@ #define QCDEvent_h #include "SMPJ/AnalysisFW/interface/QCDJet.h" #include "SMPJ/AnalysisFW/interface/QCDMET.h" -#include "SMPJ/AnalysisFW/interface/QCDCaloJet.h" #include "SMPJ/AnalysisFW/interface/QCDPFJet.h" -#include "SMPJ/AnalysisFW/interface/MyElectron.h" -#include "SMPJ/AnalysisFW/interface/MyMuon.h" #include "SMPJ/AnalysisFW/interface/QCDEventHdr.h" #include "DataFormats/JetReco/interface/Jet.h" #include @@ -22,116 +19,61 @@ class QCDEvent //------------ Destructor ------------------------------- ~QCDEvent(); //------------ Set methods ------------------------------ - void setCaloMET(const QCDMET& fCaloMET) {CaloMet_ = fCaloMET;} void setPFMET(const QCDMET& fPFMET) {PFMet_ = fPFMET;} - void setMvaMET(const QCDMET& fMvaMET) {MvaMet_ = fMvaMET;} void setEvtHdr(const QCDEventHdr& fEvtHdr) {EvtHdr_ = fEvtHdr;} - void setCaloJets(const std::vector& fCaloJets); - void setPFJets(const std::vector& fPFJets); void setPFJetsCHS(const std::vector& fPFJetsCHS); - void setElectrons(const std::vector& fElectron); - void setMuons(const std::vector& fMuon); - //void setFatJets(const std::vector& fFatJets); void setGenJets(const std::vector& fGenJets); - void setL1Obj(const std::vector >& fL1Obj); void setHLTObj(const std::vector >& fHLTObj); - void setFilterId(const std::vector >& filterIdList) {filterIdList_ = filterIdList;} void setPrescales(const std::vector& fPreL1, const std::vector& fPreHLT) {L1Prescale_ = fPreL1; HLTPrescale_ = fPreHLT;} void setTrigDecision(const std::vector& fTrigDecision) {TriggerDecision_ = fTrigDecision;} - void setTrigPathList(const std::vector& trigPathList) {triggerList_ = trigPathList;} void setGenFlavour(const std::vector GenFlavour){ genFlavour_= GenFlavour; } void setGenHadronFlavour(const std::vector GenFlavourHadron){ genFlavourHadron_= GenFlavourHadron; } //------------ Get methods ------------------------------- unsigned int nTriggers() const {return TriggerDecision_.size();} - unsigned int nL1Obj(int i) const {return L1Obj_[i].size();} unsigned int nHLTObj(int i) const {return HLTObj_[i].size();} - unsigned int nPFJets() const {return PFJets_.size();} unsigned int nPFJetsCHS() const {return PFJetsCHS_.size();} - //unsigned int nFatJets() const {return FatJets_.size();} - unsigned int nCaloJets() const {return CaloJets_.size();} unsigned int nGenJets() const {return GenJets_.size();} int nGoodJets(int unc, int id, float ymax, float ptmin, std::vector jets); int fired(int i) const {return TriggerDecision_[i];} int preL1(int i) const {return L1Prescale_[i];} int preHLT(int i) const {return HLTPrescale_[i];} - float pfmjj(); - unsigned int nMuons() const {return mMuon_.size();} - unsigned int nEelctrons() const {return mElectron_.size();} float GenJetFlavour(int i) const {return genFlavour_[i];} float GenHadronJetFlavour(int i) const {return genFlavourHadron_[i];} - float calomjj(); - float genmjj(); - float pfchsmjjcor(int unc); - float pfchsmjjcor(int unc,int src); - float pfmjjcor(int unc); - float pfmjjcor(int unc,int src); - //float fatmjjcor(int unc); - float calomjjcor(int unc); - float pfmjjgen(); - float calomjjgen(); - const QCDMET& calomet() const {return CaloMet_;} const QCDMET& pfmet() const {return PFMet_;} - const QCDMET& mvamet() const {return MvaMet_;} const LorentzVector& hltobj(int itrig, int iobj) const {return (HLTObj_[itrig])[iobj];} - const LorentzVector& l1obj(int itrig, int iobj) const {return (L1Obj_[itrig])[iobj];} const LorentzVector& genjet(int i) const {return GenJets_[i];} - const QCDPFJet& pfjet(int i) const {return PFJets_[i];} const QCDPFJet& pfjetchs(int i) const {return PFJetsCHS_[i];} - //const QCDJet& fatjet(int i) const {return FatJets_[i];} - const QCDCaloJet& calojet(int i) const {return CaloJets_[i];} const QCDEventHdr& evtHdr() const {return EvtHdr_;} - const MyMuon& muon(int i) const {return mMuon_[i];} - const MyElectron& electron(int i) const {return mElectron_[i];} - const std::vector>& HLTObj() const {return HLTObj_;} - const std::vector& trigPathList() const {return triggerList_;} - const std::vector>& filterIdList() const {return filterIdList_;} const std::vector& hltObjsForPath(int i) const {return HLTObj_[i];} - const std::vector& filterIdsForPath(int i) const {return filterIdList_[i];} private: - std::vector > filterIdList_; //---- event header (contains all the event info) -------------- QCDEventHdr EvtHdr_; - //---- CALO met object ----------------------------------------- - QCDMET CaloMet_; - //---- PF met object ------------------------------------------- + //---- PF met object ----------------------------------------- QCDMET PFMet_; - QCDMET MvaMet_; //---- trigger decision vector --------------------------------- std::vector TriggerDecision_; - std::vector triggerList_; //---- L1 prescale vector -------------------------------------- std::vector L1Prescale_; //---- HLT prescale vector ------------------------------------- std::vector HLTPrescale_; //---- HLT objects --------------------------------------------- std::vector > HLTObj_; - //---- L1 objects ---------------------------------------------- - std::vector > L1Obj_; //---- Genjets ------------------------------------------------- std::vector GenJets_; - //---- CaloJets ------------------------------------------------ - std::vector CaloJets_; - //---- PFJets -------------------------------------------------- - std::vector PFJets_; //---- PFJetsCHS ----------------------------------------------- std::vector PFJetsCHS_; - //---- FatJets ------------------------------------------------- - //std::vector FatJets_; + std::vector genFlavour_; std::vector genFlavourHadron_; - //MyMuons - std::vector mMuon_; - std::vector mElectron_; - }; #endif diff --git a/AnalysisFW/interface/QCDEventHdr.h b/AnalysisFW/interface/QCDEventHdr.h index 3aab6bc3164..ed241c706b2 100644 --- a/AnalysisFW/interface/QCDEventHdr.h +++ b/AnalysisFW/interface/QCDEventHdr.h @@ -2,6 +2,9 @@ //Modified by: S. Ganguly #ifndef QCDEventHdr_h #define QCDEventHdr_h +#include + +using namespace std; class QCDEventHdr { @@ -17,12 +20,12 @@ class QCDEventHdr void setBunch(int fBunch) {mBunch = fBunch;} void setPthat(float fPthat) {mPthat = fPthat;} void setWeight(float fWeight) {mWeight = fWeight;} + void setScaleWeight(const std::vector fWeightScale) {mScaleWeight = fWeightScale;} + void setPDFWeight(const std::vector fWeightPDF) {mPDFWeight = fWeightPDF;} void setRho(float fCaloRho, float fPFRho) {mCaloRho = fCaloRho; mPFRho = fPFRho;} void setVertices(int fNVtx, int fNVtxGood) {mNVtx = fNVtx; mNVtxGood = fNVtxGood;} void setPV(bool fIsPVgood, float fndof, float fx, float fy, float fz) {mIsPVgood = fIsPVgood; mPVndof = fndof; mPVx = fx; mPVy = fy; mPVz = fz;} void setBS(float fBSx, float fBSy, float fBSz) {mBSx = fBSx; mBSy = fBSy; mBSz = fBSz;} - void setHCALNoise(bool fNoise) {mHCALNoise = fNoise;} - void setHCALNoiseNoMinZ(bool fNoise) {mHCALNoiseNoMinZ = fNoise;} void setPU(int fNBX, int fOOTPUEarly, int fOOTPULate, int fINTPU) {mNBX = fNBX; mOOTPUEarly = fOOTPUEarly; mOOTPULate = fOOTPULate; mINTPU = fINTPU;} void setTrPu(float fTrPu) {mTrPu = fTrPu;} // setting the true PU //------------ Get methods ------------------------------ @@ -39,8 +42,6 @@ class QCDEventHdr int pu() const {return mOOTPUEarly+mOOTPULate+mINTPU;} float trpu() const {return mTrPu;} // get method for True number of interaction bool isPVgood() const {return mIsPVgood;} - bool hcalNoise() const {return mHCALNoise;} - bool hcalNoiseNoMinZ() const {return mHCALNoiseNoMinZ;} float PVndof() const {return mPVndof;} float PVx() const {return mPVx;} float PVy() const {return mPVy;} @@ -50,6 +51,8 @@ class QCDEventHdr float BSz() const {return mBSz;} float pthat() const {return mPthat;} float weight() const {return mWeight;} + float weightPDF(int i) const {return mScaleWeight[i];} + float weightScale(int i) const {return mPDFWeight[i];} float caloRho() const {return mCaloRho;} float pfRho() const {return mPFRho;} private: @@ -95,6 +98,8 @@ class QCDEventHdr float mPthat; //---- simulation weight ---------------------- float mWeight; + std::vector mScaleWeight; + std::vector mPDFWeight; //---- median CALO pt density ----------------- float mCaloRho; //---- median PF pt density ------------------- diff --git a/AnalysisFW/interface/QCDJet.h b/AnalysisFW/interface/QCDJet.h index cf4135c05d2..0d8778d88d9 100644 --- a/AnalysisFW/interface/QCDJet.h +++ b/AnalysisFW/interface/QCDJet.h @@ -46,9 +46,7 @@ class QCDJet float area() const {return area_;} bool looseID() const {return looseID_;} bool tightID() const {return tightID_;} - // int nParticles() const {return pfParticles_.size();} - // const LorentzVector& getPFParticles(int i) const {return pfParticles_[i];} - private: + private: //------ jet 4-momentum vector------------------ LorentzVector P4_; //------ matched genjet 4-momentum vector------- @@ -69,7 +67,6 @@ class QCDJet bool looseID_; //------ tight ID flag ------------------------- bool tightID_; - //------ LorentzVector For PF PARTICLES - // std::vector pfParticles_; + }; #endif diff --git a/AnalysisFW/interface/QCDMET.h b/AnalysisFW/interface/QCDMET.h index 800e838a6ab..2fae49aa26f 100644 --- a/AnalysisFW/interface/QCDMET.h +++ b/AnalysisFW/interface/QCDMET.h @@ -13,10 +13,8 @@ class QCDMET ~QCDMET() {} //------- Set method ------------------------------------ void setVar(float fEt, float fSumEt, float fPhi) {et_ = fEt; sumEt_ = fSumEt; phi_ = fPhi;} - void setCaloMet(float fCaloMetPt) {CaloMetPt_ = fCaloMetPt;} //------- Get methods ----------------------------------- float met() const {return et_;} - float calometpt() const {return CaloMetPt_;} float phi() const {return phi_;} float sumet() const {return sumEt_;} float met_o_sumet() const {return et_/sumEt_;} @@ -24,7 +22,6 @@ class QCDMET private: //---- size of MET vector ---------- float et_; - float CaloMetPt_; //---- sumET ----------------------- float sumEt_; //---- phi of MET vector ----------- diff --git a/AnalysisFW/interface/QCDPFJet.h b/AnalysisFW/interface/QCDPFJet.h index c7101bb7a71..343044190cf 100644 --- a/AnalysisFW/interface/QCDPFJet.h +++ b/AnalysisFW/interface/QCDPFJet.h @@ -4,9 +4,8 @@ #ifndef QCDPFJet_h #define QCDPFJet_h #include "SMPJ/AnalysisFW/interface/QCDJet.h" -#include "SMPJ/AnalysisFW/interface/QCDPFJetBTag.h" #include "TLorentzVector.h" -class QCDPFJet : public QCDPFJetBTag { +class QCDPFJet : public QCDJet { public: //------------ Constructor ------------------------------ QCDPFJet() {chf_=0;nhf_=0;nemf_=0;cemf_=0;muf_=0;chm_=0;nhm_=0;phm_=0;elm_=0;mum_=0; @@ -24,17 +23,24 @@ class QCDPFJet : public QCDPFJetBTag { void setVtxInfo(int mpuTrk, int mlvTrk, int mjtTrk) { mpuTrk_ = mpuTrk; mlvTrk_ = mlvTrk; mjtTrk_ = mjtTrk;} // Juska void setHO(float hof) {hof_ = hof;} // Juska void SetPUJetId(float pujid) { pujid_ = pujid; } - void SetCaloJetPt(float calojetpt) { calojetpt_ = calojetpt; } - void SetCaloJetEf(float calojetef) { calojetef_ = calojetef; } - - /* - void setPFParticles(std::vector& fpfFParticles) { - for(unsigned i=0; i(cfg.getParameter("offlineVertices"))), mBeamSpot(mayConsume(cfg.getParameter("beamSpot"))), - //mPFJetsName(mayConsume(cfg.getParameter("pfjets"))), - //mPFJetsNameCHS(mayConsume(cfg.getParameter("pfjetschs"))), mSrcCaloRho(mayConsume(cfg.getParameter("srcCaloRho"))), mSrcPFRho(mayConsume(cfg.getParameter("srcPFRho"))), mPFMET(mayConsume(cfg.getParameter("pfmet"))), mGenJetsName(mayConsume(cfg.getUntrackedParameter("genjets",edm::InputTag("")))), triggerResultsTag_(mayConsume(cfg.getParameter("triggerResults"))), triggerEventTag_(mayConsume(cfg.getParameter("triggerEvent"))), - mHBHENoiseFilterResultLabel(mayConsume(cfg.getParameter("HBHENoiseFilterResultLabel"))), - mHBHENoiseFilterResultNoMinZLabel(mayConsume(cfg.getParameter("HBHENoiseFilterResultNoMinZLabel"))), mSrcPU(mayConsume >(cfg.getUntrackedParameter("srcPULabel"))), hltPrescale_(cfg, consumesCollector(), *this)// ",edm::InputTag("addPileupInfo")))) { -// mPFJECservice = cfg.getParameter ("pfjecService"); - mPFPayloadName = cfg.getParameter("PFPayloadName"); - mPFPayloadNameCHS = cfg.getParameter ("PFPayloadNameCHS"); - pfpujetid = cfg.getParameter ("pfpujetid"); + mPFPayloadNameCHS = cfg.getParameter ("PFPayloadNameCHS"); + mPFJECUncSrcCHS = cfg.getParameter ("jecUncSrcCHS"); + mPFJECUncSrcNames = cfg.getParameter > ("jecUncSrcNames"); pfchsjetpuid = cfg.getParameter ("pfchsjetpuid"); mGoodVtxNdof = cfg.getParameter ("goodVtxNdof"); mGoodVtxZ = cfg.getParameter ("goodVtxZ"); mMinPFPt = cfg.getParameter ("minPFPt"); - mMinJJMass = cfg.getParameter ("minJJMass"); mMaxY = cfg.getParameter ("maxY"); mMinNPFJets = cfg.getParameter ("minNPFJets"); - //mOfflineVertices = cfg.getParameter ("offlineVertices"); mPrintTriggerMenu = cfg.getUntrackedParameter ("printTriggerMenu",false); mIsMCarlo = cfg.getUntrackedParameter ("isMCarlo",false); + mAK4 = cfg.getUntrackedParameter ("AK4",false); mUseGenInfo = cfg.getUntrackedParameter ("useGenInfo",false); mMinGenPt = cfg.getUntrackedParameter ("minGenPt",30); processName_ = cfg.getParameter ("processName"); triggerNames_ = cfg.getParameter > ("triggerName"); - mPFJECUncSrc = cfg.getParameter ("jecUncSrc"); - mPFJECUncSrcCHS = cfg.getParameter ("jecUncSrcCHS"); - mPFJECUncSrcNames = cfg.getParameter > ("jecUncSrcNames"); - mPFJetsName = consumes >(cfg.getParameter("pfjets")); mPFJetsNameCHS = consumes >(cfg.getParameter("pfjetschs")); mhEventInfo = consumes(cfg.getParameter("EventInfo")); mgenParticles = consumes(cfg.getParameter("GenParticles")); - //mPFJetsName = cfg.getParameter ("pfjets"); - //mPFJetsNameCHS = cfg.getParameter ("pfjetschs"); - //mSrcPU = cfg.getUntrackedParameter ("srcPU",edm::InputTag("addPileupInfo")); - //triggerResultsTag_ = cfg.getParameter ("triggerResults"); - //triggerEventTag_ = cfg.getParameter ("triggerEvent"); - //New additions - //beamSpot_(consumes(cfg.getParameter("offlineBeamSpot"))); + qgToken = consumes>(edm::InputTag("QGTagger", "qgLikelihood")); + jetFlavourInfosToken_ = consumes( cfg.getParameter("jetFlavourInfos")); + triggerBits_ = consumes(cfg.getParameter("triggerResults")); + triggerObjects_ = consumes(cfg.getParameter ("triggerObjects")); + triggerPrescales_ = consumes(cfg.getParameter("prescales")); + triggerPrescalesL1Max_ = consumes(cfg.getParameter("prescalesL1Max")); + triggerPrescalesL1Min_ = consumes(cfg.getParameter("prescalesL1Min")); + genEvtInfoToken = consumes(edm::InputTag("generator")); + lheEvtInfoToken = consumes(edm::InputTag("externalLHEProducer")); + saveWeights_ = cfg.getParameter("saveWeights"); } ////////////////////////////////////////////////////////////////////////////////////////// void ProcessedTreeProducerBTag::beginJob() @@ -111,12 +110,11 @@ void ProcessedTreeProducerBTag::beginJob() mTree->Branch("events","QCDEvent",&mEvent); mTriggerNamesHisto = fs->make("TriggerNames","TriggerNames",1,0,1); mTriggerNamesHisto->SetBit(TH1::kUserContour); + for(unsigned i=0;iFill(triggerNames_[i].c_str(),1); mTriggerPassHisto = fs->make("TriggerPass","TriggerPass",1,0,1); mTriggerPassHisto->SetBit(TH1::kUserContour); - isPFJecUncSet_ = false; - isPFJecUncSetCHS_ = false; } ////////////////////////////////////////////////////////////////////////////////////////// void ProcessedTreeProducerBTag::endJob() @@ -128,18 +126,7 @@ void ProcessedTreeProducerBTag::beginRun(edm::Run const & iRun, edm::EventSetup bool changed(true); if (hltConfig_.init(iRun,iSetup,processName_,changed) && hltPrescale_.init(iRun, iSetup, processName_, changed) ) { if (changed) { - // check if trigger names in (new) config - cout<<"New trigger menu found !!!"<= n) - cout<<"does not exist in the current menu"< mPFJets; vector mPFJetsCHS; vector mGenJets; vector GenFlavour; vector GenHadronFlavour; QCDEventHdr mEvtHdr; QCDMET mPFMet; + vector mPDFWeights; + vector mScaleWeights; + + bool save_event=false; //-------------- Basic Event Info ------------------------------ mEvtHdr.setRun(event.id().run()); mEvtHdr.setEvt(event.id().event()); mEvtHdr.setLumi(event.luminosityBlock()); mEvtHdr.setBunch(event.bunchCrossing()); + //-------------- Beam Spot -------------------------------------- Handle beamSpot; event.getByToken(mBeamSpot,beamSpot); @@ -175,133 +166,80 @@ void ProcessedTreeProducerBTag::analyze(edm::Event const& event, edm::EventSetup else mEvtHdr.setBS(-999,-999,-999); - - //-------------- HCAL Noise Summary ----------------------------- - Handle noiseSummary; - Handle noiseSummary_NoMinZ; - - if (!mIsMCarlo) { - // event.getByLabel(mHBHENoiseFilter,noiseSummary); - event.getByToken(mHBHENoiseFilterResultLabel, noiseSummary); - //event.getByToken(mHBHENoiseFilterResultProducer, noiseSummary); - mEvtHdr.setHCALNoise(*noiseSummary); - - event.getByToken(mHBHENoiseFilterResultNoMinZLabel, noiseSummary_NoMinZ); - mEvtHdr.setHCALNoiseNoMinZ(*noiseSummary_NoMinZ); - - } - else{ - mEvtHdr.setHCALNoise(true); - mEvtHdr.setHCALNoiseNoMinZ(true); - } //-------------- Trigger Info ----------------------------------- - event.getByToken(triggerResultsTag_,triggerResultsHandle_); - if (!triggerResultsHandle_.isValid()) { - cout << "ProcessedTreeProducerBTag::analyze: Error in getting TriggerResults product from Event!" << endl; - return; - } - event.getByToken(triggerEventTag_,triggerEventHandle_); - if (!triggerEventHandle_.isValid()) { - cout << "ProcessedTreeProducerBTag::analyze: Error in getting TriggerEvent product from Event!" << endl; - return; - } - vector L1Prescales,HLTPrescales,Fired; - vector > mL1Objects,mHLTObjects; - // sanity check - assert(triggerResultsHandle_->size() == hltConfig_.size()); - //------ loop over all trigger names --------- - for(unsigned itrig=0;itrig vvL1,vvHLT; - if (triggerIndex_[itrig] < hltConfig_.size()) { - accept = triggerResultsHandle_->accept(triggerIndex_[itrig]); - // const std::pair prescales(hltConfig_.prescaleValues(event,iSetup,triggerNames_[itrig])); - - ///In detail - //get prescale info from hltConfig_ + + edm::Handle triggerBits; + edm::Handle triggerObjects; + edm::Handle triggerPrescales; + edm::Handle triggerPrescalesL1Max; + edm::Handle triggerPrescalesL1Min; + + vector L1Prescales,HLTPrescales,Fired; + vector > mHLTObjects; + vector vvL1,vvHLT; + + if(!mIsMCarlo){ + event.getByToken(triggerBits_, triggerBits); + event.getByToken(triggerObjects_, triggerObjects); + event.getByToken(triggerPrescales_, triggerPrescales); + event.getByToken(triggerPrescalesL1Min_, triggerPrescalesL1Min); + event.getByToken(triggerPrescalesL1Max_, triggerPrescalesL1Max); + + //Variables + + const edm::TriggerNames &names = event.triggerNames(*triggerBits); + + for(unsigned int k=0;k >,int> detailedPrescaleInfo = hltPrescale_.prescaleValuesInDetail(event, iSetup, triggerNames_[itrig]); - preHLT = detailedPrescaleInfo.second ; - - // save l1 prescale values in standalone vector - std::vector l1prescalevals; - for( size_t varind = 0; varind < detailedPrescaleInfo.first.size(); varind++ ){ - l1prescalevals.push_back(detailedPrescaleInfo.first.at(varind).second); + for(unsigned int itrig=0;itrigsize();itrig++) { + //if(triggerBits->accept(itrig)) std::cout << "Trigger " << names.triggerName(itrig) << + // ", prescale " << triggerPrescales->getPrescaleForIndex(itrig) << + // ": " << (triggerBits->accept(itrig) ? "PASS" : "fail (or not run)") + // << std::endl; + + string trigger_name = string(names.triggerName(itrig)); + //--- erase the last character, i.e. the version number---- + trigger_name.pop_back(); + if (trigger_name == triggerNames_[k]) { + + HLTPrescales.push_back(triggerPrescales->getPrescaleForIndex(itrig)); + if(triggerPrescalesL1Max->getPrescaleForIndex(itrig)>triggerPrescalesL1Min->getPrescaleForIndex(itrig)) + L1Prescales.push_back(triggerPrescalesL1Max->getPrescaleForIndex(itrig)); + else L1Prescales.push_back(triggerPrescalesL1Min->getPrescaleForIndex(itrig)); + + if(triggerBits->accept(itrig)) Fired.push_back(1); + if(!triggerBits->accept(itrig)) Fired.push_back(0); + + if(triggerBits->accept(itrig)) mTriggerPassHisto->Fill(1,1); + } } - - //find and save minimum l1 prescale of any ORed L1 that seeds the HLT - std::vector::iterator result = std::min_element(std::begin(l1prescalevals), std::end(l1prescalevals)); - size_t minind = std::distance(std::begin(l1prescalevals), result); - // sometimes there are no L1s associated with a HLT. In that case, this branch stores -1 for the l1prescale - preL1 = minind < l1prescalevals.size() ? l1prescalevals.at(minind) : -1 ;//commented for 76X + } + + //std::cout << "\n === TRIGGER OBJECTS === " << std::endl; + for (pat::TriggerObjectStandAlone obj : *triggerObjects) { // note: not "const &" since we want to call unpackPathNames - ///end in detail - if (!accept) - tmpFired = 0; - else { - mTriggerPassHisto->Fill(triggerNames_[itrig].c_str(),1); - tmpFired = 1; - } - - //--------- modules on this trigger path-------------- - const vector& moduleLabels(hltConfig_.moduleLabels(triggerIndex_[itrig])); - const unsigned int moduleIndex(triggerResultsHandle_->index(triggerIndex_[itrig])); - bool foundL1(false); - for(unsigned int j=0; j<=moduleIndex; ++j) { - const string& moduleLabel(moduleLabels[j]); - const string moduleType(hltConfig_.moduleType(moduleLabel)); - //--------check whether the module is packed up in TriggerEvent product - const unsigned int filterIndex(triggerEventHandle_->filterIndex(InputTag(moduleLabel,"",processName_))); - if (filterIndexsizeFilters()) { - const Vids& VIDS (triggerEventHandle_->filterIds(filterIndex)); - const Keys& KEYS(triggerEventHandle_->filterKeys(filterIndex)); - const size_type nI(VIDS.size()); - const size_type nK(KEYS.size()); - assert(nI==nK); - const size_type n(max(nI,nK)); - const TriggerObjectCollection& TOC(triggerEventHandle_->getObjects()); - if (foundL1) { - for(size_type i=0; i!=n; ++i) { - const TriggerObject& TO(TOC[KEYS[i]]); - TLorentzVector P4; - P4.SetPtEtaPhiM(TO.pt(),TO.eta(),TO.phi(),TO.mass()); - LorentzVector qcdhltobj(P4.Px(),P4.Py(),P4.Pz(),P4.E()); - vvHLT.push_back(qcdhltobj); - //cout<setTrigDecision(Fired); - mEvent->setPrescales(L1Prescales,HLTPrescales); - mEvent->setL1Obj(mL1Objects); - mEvent->setHLTObj(mHLTObjects); + obj.unpackPathNames(names); + + TLorentzVector P4; + P4.SetPtEtaPhiM(obj.pt(),obj.eta(),obj.phi(),obj.mass()); + LorentzVector qcdhltobj(P4.Px(),P4.Py(),P4.Pz(),P4.E()); + vvHLT.push_back(qcdhltobj); + + std::vector pathNamesAll = obj.pathNames(false); + std::vector pathNamesLast = obj.pathNames(true); + + mHLTObjects.push_back(vvHLT); + } + + mEvent->setTrigDecision(Fired); + mEvent->setPrescales(L1Prescales,HLTPrescales); + mEvent->setHLTObj(mHLTObjects); + } //-------------- Vertex Info ----------------------------------- Handle recVtxs; event.getByToken(mOfflineVertices,recVtxs); + //------------- reject events without reco vertices ------------ int VtxGood(0); bool isPVgood(false); @@ -323,6 +261,7 @@ void ProcessedTreeProducerBTag::analyze(edm::Event const& event, edm::EventSetup } mEvtHdr.setVertices(recVtxs->size(),VtxGood); mEvtHdr.setPV(isPVgood,PVndof,PVx,PVy,PVz); + //-------------- Rho ------------------------------------------------ Handle rhoCalo; event.getByToken(mSrcCaloRho,rhoCalo); @@ -361,7 +300,33 @@ void ProcessedTreeProducerBTag::analyze(edm::Event const& event, edm::EventSetup mEvtHdr.setPU(nbx,ootpuEarly,ootpuLate,intpu); mEvtHdr.setTrPu(Tnpv); + + event.getByToken(genEvtInfoToken,genEvtInfo); + event.getByToken(lheEvtInfoToken,lheEvtInfo); + + float lheOriginalXWGTUP_ = lheEvtInfo->originalXWGTUP(); + + if (saveWeights_) { + for(unsigned i=0;iweights().size();i++) { + string wtid(lheEvtInfo->weights()[i].id); + float wgt(lheEvtInfo->weights()[i].wgt); + if (wtid == "1002" || wtid == "2") mScaleWeights.push_back(wgt/lheOriginalXWGTUP_); + if (wtid == "1003" || wtid == "3") mScaleWeights.push_back(wgt/lheOriginalXWGTUP_); + if (wtid == "1004" || wtid == "4") mScaleWeights.push_back(wgt/lheOriginalXWGTUP_); + if (wtid == "1005" || wtid == "5") mScaleWeights.push_back(wgt/lheOriginalXWGTUP_); + if (wtid == "1007" || wtid == "7") mScaleWeights.push_back(wgt/lheOriginalXWGTUP_); + if (wtid == "1009" || wtid == "9") mScaleWeights.push_back(wgt/lheOriginalXWGTUP_); + + if ((stoi(wtid) > 2000 && stoi(wtid) <= 2102) || (stoi(wtid) > 10 && stoi(wtid) <= 110)) { + mPDFWeights.push_back(wgt/lheOriginalXWGTUP_); + } + } + } + + mEvtHdr.setScaleWeight(mScaleWeights); + mEvtHdr.setPDFWeight(mPDFWeights); } + else { mEvtHdr.setPthat(0); mEvtHdr.setWeight(0); @@ -370,23 +335,6 @@ void ProcessedTreeProducerBTag::analyze(edm::Event const& event, edm::EventSetup } //---------------- Jets --------------------------------------------- - //mPFJEC = JetCorrector::getJetCorrector(mPFJECservice,iSetup); - //event.getByToken(mvaFullPUDiscriminantToken_ ,puJetIdMva); - edm::ESHandle PFJetCorParColl; - if (mPFPayloadName != "" && !isPFJecUncSet_){ - iSetup.get().get(mPFPayloadName,PFJetCorParColl); - JetCorrectorParameters const& PFJetCorPar = (*PFJetCorParColl)["Uncertainty"]; - mPFUnc = new JetCorrectionUncertainty(PFJetCorPar); - if (mPFJECUncSrc != "") { - for(unsigned isrc=0;isrc genjets; if (mIsMCarlo) { @@ -400,436 +348,215 @@ void ProcessedTreeProducerBTag::analyze(edm::Event const& event, edm::EventSetup //if(FlavourGen<-100) cout<pt()<<" "<eta()<<" "<phi()<pt()<<" "<eta()<<" "<phi()< theJetFlavourInfos; + event.getByToken(jetFlavourInfosToken_, theJetFlavourInfos ); + + for ( reco::JetFlavourInfoMatchingCollection::const_iterator j = theJetFlavourInfos->begin();j != theJetFlavourInfos->end();++j ) { + reco::JetFlavourInfo aInfo = (*j).second; + int FlavourGenHadron = aInfo.getHadronFlavour(); + //if(FlavourGenHadron==5) cout<pt()<<" "<eta()<<" "<phi()<<" HADRONFLAV"< > patjets; - event.getByToken(mPFJetsName,patjets); - - /*edm::Handle btagDiscriminators; - event.getByLabel("pfCombinedInclusiveSecondaryVertexV2BJetTags", btagDiscriminators); */ + //uncertainties + jet pT corrected or not (otherwise it is done) + + edm::Handle> qgHandle; + event.getByToken(qgToken, qgHandle); + + edm::Handle > patjetschs; + event.getByToken(mPFJetsNameCHS,patjetschs); + + edm::ESHandle PFJetCorParCollCHS; + + //mPFUncCHS = new JetCorrectionUncertainty(PFJetCorParCHS);//"Summer16_23Sep2016V4_MC_Uncertainty_AK8PFchs.txt"); - for(edm::View::const_iterator i_pfjet=patjets->begin(); i_pfjet!=patjets->end(); ++i_pfjet) + for(edm::View::const_iterator i_pfjetchs=patjetschs->begin(); i_pfjetchs!=patjetschs->end(); ++i_pfjetchs) { - QCDPFJet qcdpfjet; + QCDPFJet qcdpfjetchs; - if(i_pfjet->isPFJet() ){ + if(i_pfjetchs->isPFJet() ){ + + double scaleCHS = 1./i_pfjetchs->jecFactor(0); // --- the value of the JEC factor - double scale = 1./i_pfjet->jecFactor(0); // --- the value of the JEC factor - //---- preselection ----------------- - if (fabs(i_pfjet->y()) > mMaxY) continue; + if (fabs(i_pfjetchs->y()) > mMaxY) continue; + if (fabs(i_pfjetchs->pt()) < mMinPFPt) continue; + save_event=true; + //---- vertex association ----------- //---- get the vector of tracks ----- - reco::TrackRefVector vTrks(i_pfjet->associatedTracks()); - float sumTrkPt(0.0),sumTrkPtBeta(0.0),sumTrkPtBetaStar(0.0),beta(0.0),betaStar(0.0); + reco::TrackRefVector vTrksCHS(i_pfjetchs->associatedTracks()); + float sumTrkPtCHS(0.0),sumTrkPtBetaCHS(0.0),sumTrkPtBetaStarCHS(0.0),betaCHS(0.0),betaStarCHS(0.0); + + // Dunno how useful these are in chs jets... int mpuTrk(0), mlvTrk(0); // # of pile-up tracks & lead-vertex tracks ## Juska int mjtTrk(0); // multiplicity of _all_ tracks in jet (also vtx-unassociated!) ## Juska - //---- loop over the tracks of the jet ---- - //std::cout << "starting the loop yo!" << std::endl; // debug - //std::cout << "vTrks.size()" << vTrks.size() << std::endl; - for(reco::TrackRefVector::const_iterator i_trk = vTrks.begin(); i_trk != vTrks.end(); i_trk++) { + //---- loop over the tracks of the jet ---- + + for(reco::TrackRefVector::const_iterator i_trkchs = vTrksCHS.begin(); i_trkchs != vTrksCHS.end(); i_trkchs++) { if (recVtxs->size() == 0) break; - sumTrkPt += (*i_trk)->pt(); + sumTrkPtCHS += (*i_trkchs)->pt(); mjtTrk++; //Juska //---- loop over all vertices ---------------------------- for(unsigned ivtx = 0;ivtx < recVtxs->size();ivtx++) { //---- loop over the tracks associated with the vertex --- if (!((*recVtxs)[ivtx].isFake()) && (*recVtxs)[ivtx].ndof() >= mGoodVtxNdof && fabs((*recVtxs)[ivtx].z()) <= mGoodVtxZ) { for(reco::Vertex::trackRef_iterator i_vtxTrk = (*recVtxs)[ivtx].tracks_begin(); i_vtxTrk != (*recVtxs)[ivtx].tracks_end(); ++i_vtxTrk) { - //---- match the jet track to the track from the vertex ---- + //---- match the chsjet track to the track from the vertex ---- reco::TrackRef trkRef(i_vtxTrk->castTo()); //---- check if the tracks match ------------------------- - if (trkRef == (*i_trk)) { + if (trkRef == (*i_trkchs)) { if (ivtx == 0) { - sumTrkPtBeta += (*i_trk)->pt(); + sumTrkPtBetaCHS += (*i_trkchs)->pt(); mlvTrk++; //Juska } else { - sumTrkPtBetaStar += (*i_trk)->pt(); + sumTrkPtBetaStarCHS += (*i_trkchs)->pt(); mpuTrk++; //Juska } break; } // if (trkRef == (*i_trk)) } // for(reco::Vertex::trackRef_iterator i_vtxTrk = (*recVtxs)[ivtx].tracks_begin(); i_vtxTrk != (*recVtxs)[ivtx].tracks_end(); ++i_vtxTrk) } // if (!((*recVtxs)[ivtx].isFake()) && (*recVtxs)[ivtx].ndof() >= mGoodVtxNdof && fabs((*recVtxs)[ivtx].z()) <= mGoodVtxZ) - } // for(unsigned ivtx = 0;ivtx < recVtxs->size();ivtx++) + } // for(unsigned ivtx = 0;ivtx < recVtxs->size();ivtx++) } // for(reco::TrackRefVector::const_iterator i_trk = vTrks.begin(); i_trk != vTrks.end(); i_trk++) - if (sumTrkPt > 0) { - beta = sumTrkPtBeta/sumTrkPt; - betaStar = sumTrkPtBetaStar/sumTrkPt; + if (sumTrkPtCHS > 0) { + betaCHS = sumTrkPtBetaCHS/sumTrkPtCHS; + betaStarCHS = sumTrkPtBetaStarCHS/sumTrkPtCHS; } //if (sumTrkPt > 0) - qcdpfjet.setBeta(beta); - qcdpfjet.setBetaStar(betaStar); - + qcdpfjetchs.setBeta(betaCHS); + qcdpfjetchs.setBetaStar(betaStarCHS); + //---- jec uncertainty -------------- - double unc(0.0); - vector uncSrc(0); - if (mPFPayloadName != "") { - mPFUnc->setJetEta(i_pfjet->eta()); - mPFUnc->setJetPt(i_pfjet->pt()); - unc = mPFUnc->getUncertainty(true); + double uncCHS(0.0); + vector uncSrcCHS(0); + if (mPFPayloadNameCHS != "") { + iSetup.get().get(mPFPayloadNameCHS,PFJetCorParCollCHS); + JetCorrectorParameters const& PFJetCorParCHS = (*PFJetCorParCollCHS)["Uncertainty"]; + + mPFUncCHS = new JetCorrectionUncertainty(PFJetCorParCHS);//"Summer16_23Sep2016V4_MC_Uncertainty_AK8PFchs.txt"); + + mPFUncCHS->setJetEta(i_pfjetchs->eta()); + mPFUncCHS->setJetPt(i_pfjetchs->pt()); + uncCHS = mPFUncCHS->getUncertainty(true); + cout<setJetEta(i_pfjet->eta()); - mPFUncSrc[isrc]->setJetPt(i_pfjet->pt()); - float unc1 = mPFUncSrc[isrc]->getUncertainty(true); - uncSrc.push_back(unc1); + + JetCorrectorParameters const& PFJetCorParCHS = (*PFJetCorParCollCHS)["Uncertainty"]; + mPFUncSrcCHS[isrc] = new JetCorrectionUncertainty(PFJetCorParCHS);//"Summer16_23Sep2016V4_MC_Uncertainty_AK8PFchs.txt"); + + mPFUncSrcCHS[isrc]->setJetEta(i_pfjetchs->eta()); + mPFUncSrcCHS[isrc]->setJetPt(i_pfjetchs->pt()); + float unc1 = mPFUncSrcCHS[isrc]->getUncertainty(true); + uncSrcCHS.push_back(unc1); } // for(unsigned isrc=0;isrcp4()); - qcdpfjet.setCor(scale); - qcdpfjet.setUnc(unc); - qcdpfjet.setUncSrc(uncSrc); - qcdpfjet.setArea(i_pfjet->jetArea()); - - double chf = i_pfjet->chargedHadronEnergyFraction(); - double nhf = i_pfjet->neutralHadronEnergyFraction(); //+ i_pfjet->HFHadronEnergyFraction(); - double nemf = i_pfjet->neutralEmEnergyFraction(); // equals to old phf with HF info included - //double elf = i_pfjet->electronEnergyFraction(); equals to cemf - double cemf = i_pfjet->chargedEmEnergyFraction(); - double muf = i_pfjet->muonEnergyFraction(); - double hf_hf = i_pfjet->HFHadronEnergyFraction(); - double hf_phf= i_pfjet->HFEMEnergyFraction(); - - int hf_hm = i_pfjet->HFHadronMultiplicity(); - int hf_phm = i_pfjet->HFEMMultiplicity(); - int chm = i_pfjet->chargedHadronMultiplicity(); - int nhm = i_pfjet->neutralHadronMultiplicity(); - int phm = i_pfjet->photonMultiplicity(); - int elm = i_pfjet->electronMultiplicity(); - int mum = i_pfjet->muonMultiplicity(); - int npr = i_pfjet->chargedMultiplicity() + i_pfjet->neutralMultiplicity(); - //bool looseID = (npr>1 && phf<0.99 && nhf<0.99 && ((fabs(i_pfjet->eta())<=2.4 && elf<0.99 && chf>0 && chm>0) || fabs(i_pfjet->eta())>2.4)); - //bool tightID = (npr>1 && phf<0.99 && nhf<0.99 && ((fabs(i_pfjet->eta())<=2.4 && nhf<0.9 && phf<0.9 && elf<0.99 && chf>0 && chm>0) || fabs(i_pfjet->eta())>2.4)); - // https://twiki.cern.ch/twiki/bin/viewauth/CMS/JetID - float eta = i_pfjet->eta(); - int cm = i_pfjet->chargedMultiplicity(); + qcdpfjetchs.setP4(i_pfjetchs->p4()); + qcdpfjetchs.setCor(scaleCHS); + qcdpfjetchs.setUnc(uncCHS); + qcdpfjetchs.setUncSrc(uncSrcCHS); + qcdpfjetchs.setArea(i_pfjetchs->jetArea()); + + double chf = i_pfjetchs->chargedHadronEnergyFraction(); + double nhf = i_pfjetchs->neutralHadronEnergyFraction();// + i_pfjetchs->HFHadronEnergyFraction(); + double nemf = i_pfjetchs->neutralEmEnergyFraction(); // equals to deprecated phf but has HF info too + double cemf = i_pfjetchs->chargedEmEnergyFraction(); // equals to deprecated elf + double muf = i_pfjetchs->muonEnergyFraction(); + double hf_hf = i_pfjetchs->HFHadronEnergyFraction(); + double hf_phf= i_pfjetchs->HFEMEnergyFraction(); + int hf_hm = i_pfjetchs->HFHadronMultiplicity(); + int hf_phm = i_pfjetchs->HFEMMultiplicity(); + int chm = i_pfjetchs->chargedHadronMultiplicity(); + int nhm = i_pfjetchs->neutralHadronMultiplicity(); + int phm = i_pfjetchs->photonMultiplicity(); + int elm = i_pfjetchs->electronMultiplicity(); + int mum = i_pfjetchs->muonMultiplicity(); + int npr = i_pfjetchs->chargedMultiplicity() + i_pfjetchs->neutralMultiplicity(); + // https://twiki.cern.ch/twiki/bin/viewauth/CMS/JetID + float eta = i_pfjetchs->eta(); + int cm = i_pfjetchs->chargedMultiplicity(); bool looseID = (nhf<0.99 && nemf<0.99 && npr>1 && muf<0.8) && ((fabs(eta) <= 2.4 && chf>0 && cm>0 && cemf<0.99) || fabs(eta)>2.4); bool tightID = (nhf<0.90 && nemf<0.90 && npr>1 && muf<0.8) && ((fabs(eta)<=2.4 && chf>0 && cm>0 && cemf<0.90) || fabs(eta)>2.4); + + qcdpfjetchs.setLooseID(looseID); + qcdpfjetchs.setTightID(tightID); + qcdpfjetchs.setFrac(chf,nhf,nemf,cemf,muf); + qcdpfjetchs.setMulti(npr,chm,nhm,phm,elm,mum); + qcdpfjetchs.setHFFrac(hf_hf,hf_phf); + qcdpfjetchs.setHFMulti(hf_hm,hf_phm); + + double hof = i_pfjetchs->hoEnergyFraction(); // Juska + qcdpfjetchs.setVtxInfo(mpuTrk,mlvTrk,mjtTrk); + qcdpfjetchs.setHO(hof); - double TCHE = i_pfjet->bDiscriminator("trackCountingHighEffBJetTags"); - double TCHP = i_pfjet->bDiscriminator("trackCountingHighPurBJetTags"); - double TCHEpf = i_pfjet->bDiscriminator("pfTrackCountingHighEffBJetTags"); - double TCHPpf = i_pfjet->bDiscriminator("pfTrackCountingHighPurBJetTags"); - - double SoftMuonTagByIP = i_pfjet->bDiscriminator("softPFMuonByIP3dBJetTags"); - double SoftElectronTagByIP = i_pfjet->bDiscriminator("softPFElectronByIP3dBJetTags"); - double SoftMuonTag = i_pfjet->bDiscriminator("softPFMuonBJetTags"); - double SoftElectronTag = i_pfjet->bDiscriminator("softPFElectronBJetTags"); - - double SimpleSecVertexHE = i_pfjet->bDiscriminator("simpleSecondaryVertexHighEffBJetTags"); - double SimpleSecVertexHP = i_pfjet->bDiscriminator("simpleSecondaryVertexHighPurBJetTags"); - double SimpleSecVertexHEpf = i_pfjet->bDiscriminator("pfSimpleSecondaryVertexHighEffBJetTags"); - double SimpleSecVertexHPpf = i_pfjet->bDiscriminator("pfSimpleSecondaryVertexHighPurBJetTags"); - - double CSV = i_pfjet->bDiscriminator("combinedSecondaryVertexBJetTags"); - double CSVpf = i_pfjet->bDiscriminator("pfCombinedSecondaryVertexBJetTags"); - double CinclSVpf = i_pfjet->bDiscriminator("pfCombinedInclusiveSecondaryVertexBJetTags"); - double CMVApf = i_pfjet->bDiscriminator("pfCombinedMVABJetTags"); - double CSVSoftLeptonpf = i_pfjet->bDiscriminator("pfCombinedSecondaryVertexSoftLeptonBJetTags"); - - double CSVpfPositive = i_pfjet->bDiscriminator("pfPositiveCombinedSecondaryVertexBJetTags"); - double CSVpfNegative = i_pfjet->bDiscriminator("pfNegativeCombinedSecondaryVertexBJetTags"); - - //the three recommended - double pfJetProbabilityBJetTags=i_pfjet->bDiscriminator("pfJetProbabilityBJetTags"); - double pfCombinedInclusiveSecondaryVertexV2BJetTags= i_pfjet->bDiscriminator("pfCombinedInclusiveSecondaryVertexV2BJetTags"); - double pfCombinedMVAV2BJetTags=i_pfjet->bDiscriminator("pfCombinedMVAV2BJetTags"); + double pfJetProbabilityBJetTags=i_pfjetchs->bDiscriminator("pfJetProbabilityBJetTags"); + double pfCombinedInclusiveSecondaryVertexV2BJetTags= i_pfjetchs->bDiscriminator("pfCombinedInclusiveSecondaryVertexV2BJetTags"); + double pfCombinedMVAV2BJetTags=i_pfjetchs->bDiscriminator("pfCombinedMVAV2BJetTags"); - qcdpfjet.setLooseID(looseID); - qcdpfjet.setTightID(tightID); - qcdpfjet.setFrac(chf,nhf,nemf,cemf,muf); - qcdpfjet.setMulti(npr,chm,nhm,phm,elm,mum); - qcdpfjet.setHFFrac(hf_hf,hf_phf); - qcdpfjet.setHFMulti(hf_hm,hf_phm); - float partonFlavour=-100; float hadronFlavour=-100; if (mIsMCarlo && mUseGenInfo) { - partonFlavour = i_pfjet->partonFlavour(); - hadronFlavour = i_pfjet->hadronFlavour(); + partonFlavour = i_pfjetchs->partonFlavour(); + hadronFlavour = i_pfjetchs->hadronFlavour(); } + + qcdpfjetchs.setFlavour(partonFlavour,hadronFlavour); - //if(i_pfjet->pt()>114) cout<pt()<<" "<eta()<<" "<phi()<<" "<userFloat("QGTagger:qgLikelihood"); + } - double hof = i_pfjet->hoEnergyFraction(); // Juska - qcdpfjet.setVtxInfo(mpuTrk,mlvTrk,mjtTrk); - qcdpfjet.setHO(hof); + qcdpfjetchs.setQGTagger(QGTagger); //Filling B-tag infos - qcdpfjet.setTCHETag(TCHE,TCHP,TCHEpf,TCHPpf); - qcdpfjet.setSoftLeptonTag(SoftMuonTagByIP,SoftElectronTagByIP,SoftMuonTag,SoftElectronTag); - qcdpfjet.setSimpleSecondaryVertexTag(SimpleSecVertexHE,SimpleSecVertexHP,SimpleSecVertexHEpf,SimpleSecVertexHPpf); - qcdpfjet.setCombinedSecondaryVertexTag(CSV,CSVpf,CinclSVpf,CSVSoftLeptonpf,CMVApf); - qcdpfjet.setPositiveNegativeCSV(CSVpfPositive,CSVpfNegative); - qcdpfjet.setTagRecommended(pfJetProbabilityBJetTags,pfCombinedInclusiveSecondaryVertexV2BJetTags,pfCombinedMVAV2BJetTags); + qcdpfjetchs.setTagRecommended(pfJetProbabilityBJetTags,pfCombinedInclusiveSecondaryVertexV2BJetTags,pfCombinedMVAV2BJetTags); float pileupJetId = -999; - if ( i_pfjet->hasUserFloat(pfpujetid) ) pileupJetId = i_pfjet->userFloat(pfpujetid); - qcdpfjet.SetPUJetId(pileupJetId); + if ( i_pfjetchs->hasUserFloat(pfchsjetpuid) ) { pileupJetId = i_pfjetchs->userFloat(pfchsjetpuid);} + qcdpfjetchs.SetPUJetId(pileupJetId); if (mIsMCarlo) { - GenJetCollection::const_iterator i_matched; + GenJetCollection::const_iterator i_matchedchs; float rmin(999); for(GenJetCollection::const_iterator i_gen = genjets->begin(); i_gen != genjets->end(); i_gen++) { - double deltaR = reco::deltaR(*i_pfjet,*i_gen); + double deltaR = reco::deltaR(*i_pfjetchs,*i_gen); if (deltaR < rmin) { rmin = deltaR; - i_matched = i_gen; + i_matchedchs = i_gen; } } if (genjets->size() == 0) { LorentzVector tmpP4(0.0,0.0,0.0,0.0); - qcdpfjet.setGen(tmpP4,0); + qcdpfjetchs.setGen(tmpP4,0); } else - qcdpfjet.setGen(i_matched->p4(),rmin); + qcdpfjetchs.setGen(i_matchedchs->p4(),rmin); } // if (mIsMCarlo) else { LorentzVector tmpP4(0.0,0.0,0.0,0.0); - qcdpfjet.setGen(tmpP4,0); + qcdpfjetchs.setGen(tmpP4,0); } - if (qcdpfjet.pt() >= mMinPFPt && qcdpfjet.ptCor() >= mMinPFPt/2.) - mPFJets.push_back(qcdpfjet); + if (qcdpfjetchs.pt() >= mMinPFPt) + mPFJetsCHS.push_back(qcdpfjetchs); - - } // if(iJet->isPFJet() ) - } // --- end of non chs patjet iterator loop -------------------- // - - // ========================******************************************===================== // - - // -------- CHS Uncertainty part ----------------// - edm::ESHandle PFJetCorParCollCHS; - if (mPFPayloadNameCHS != "" && !isPFJecUncSetCHS_){ - iSetup.get().get(mPFPayloadNameCHS,PFJetCorParCollCHS); - JetCorrectorParameters const& PFJetCorParCHS = (*PFJetCorParCollCHS)["Uncertainty"]; - mPFUncCHS = new JetCorrectionUncertainty(PFJetCorParCHS); - if (mPFJECUncSrcCHS != "") { - for(unsigned isrc=0;isrc > patjetschs; - event.getByToken(mPFJetsNameCHS,patjetschs); - - for(edm::View::const_iterator i_pfjetchs=patjetschs->begin(); i_pfjetchs!=patjetschs->end(); ++i_pfjetchs) - { - QCDPFJet qcdpfjetchs; - - if(i_pfjetchs->isPFJet() ){ - - double scaleCHS = 1./i_pfjetchs->jecFactor(0); // --- the value of the JEC factor - - //---- preselection ----------------- - if (fabs(i_pfjetchs->y()) > mMaxY) continue; - - //---- vertex association ----------- - //---- get the vector of tracks ----- - reco::TrackRefVector vTrksCHS(i_pfjetchs->associatedTracks()); - float sumTrkPtCHS(0.0),sumTrkPtBetaCHS(0.0),sumTrkPtBetaStarCHS(0.0),betaCHS(0.0),betaStarCHS(0.0); - - // Dunno how useful these are in chs jets... - int mpuTrk(0), mlvTrk(0); // # of pile-up tracks & lead-vertex tracks ## Juska - int mjtTrk(0); // multiplicity of _all_ tracks in jet (also vtx-unassociated!) ## Juska - - //---- loop over the tracks of the jet ---- - - for(reco::TrackRefVector::const_iterator i_trkchs = vTrksCHS.begin(); i_trkchs != vTrksCHS.end(); i_trkchs++) { - if (recVtxs->size() == 0) break; - sumTrkPtCHS += (*i_trkchs)->pt(); - mjtTrk++; //Juska - //---- loop over all vertices ---------------------------- - for(unsigned ivtx = 0;ivtx < recVtxs->size();ivtx++) { - //---- loop over the tracks associated with the vertex --- - if (!((*recVtxs)[ivtx].isFake()) && (*recVtxs)[ivtx].ndof() >= mGoodVtxNdof && fabs((*recVtxs)[ivtx].z()) <= mGoodVtxZ) { - for(reco::Vertex::trackRef_iterator i_vtxTrk = (*recVtxs)[ivtx].tracks_begin(); i_vtxTrk != (*recVtxs)[ivtx].tracks_end(); ++i_vtxTrk) { - //---- match the chsjet track to the track from the vertex ---- - reco::TrackRef trkRef(i_vtxTrk->castTo()); - //---- check if the tracks match ------------------------- - if (trkRef == (*i_trkchs)) { - if (ivtx == 0) { - sumTrkPtBetaCHS += (*i_trkchs)->pt(); - mlvTrk++; //Juska - } - else { - sumTrkPtBetaStarCHS += (*i_trkchs)->pt(); - mpuTrk++; //Juska - } - break; - } // if (trkRef == (*i_trk)) - } // for(reco::Vertex::trackRef_iterator i_vtxTrk = (*recVtxs)[ivtx].tracks_begin(); i_vtxTrk != (*recVtxs)[ivtx].tracks_end(); ++i_vtxTrk) - } // if (!((*recVtxs)[ivtx].isFake()) && (*recVtxs)[ivtx].ndof() >= mGoodVtxNdof && fabs((*recVtxs)[ivtx].z()) <= mGoodVtxZ) - } // for(unsigned ivtx = 0;ivtx < recVtxs->size();ivtx++) - } // for(reco::TrackRefVector::const_iterator i_trk = vTrks.begin(); i_trk != vTrks.end(); i_trk++) - if (sumTrkPtCHS > 0) { - betaCHS = sumTrkPtBetaCHS/sumTrkPtCHS; - betaStarCHS = sumTrkPtBetaStarCHS/sumTrkPtCHS; - } //if (sumTrkPt > 0) - qcdpfjetchs.setBeta(betaCHS); - qcdpfjetchs.setBetaStar(betaStarCHS); - - //---- jec uncertainty -------------- - double uncCHS(0.0); - vector uncSrcCHS(0); - if (mPFPayloadNameCHS != "") { - mPFUncCHS->setJetEta(i_pfjetchs->eta()); - mPFUncCHS->setJetPt(i_pfjetchs->pt()); - uncCHS = mPFUncCHS->getUncertainty(true); - } // if (mPFPayloadName != "") - if (mPFJECUncSrcCHS != "") { - for(unsigned isrc=0;isrcsetJetEta(i_pfjetchs->eta()); - mPFUncSrcCHS[isrc]->setJetPt(i_pfjetchs->pt()); - float unc1 = mPFUncSrcCHS[isrc]->getUncertainty(true); - uncSrcCHS.push_back(unc1); - } // for(unsigned isrc=0;isrcp4()); - qcdpfjetchs.setCor(scaleCHS); - qcdpfjetchs.setUnc(uncCHS); - qcdpfjetchs.setUncSrc(uncSrcCHS); - qcdpfjetchs.setArea(i_pfjetchs->jetArea()); - - double chf = i_pfjetchs->chargedHadronEnergyFraction(); - double nhf = i_pfjetchs->neutralHadronEnergyFraction();// + i_pfjetchs->HFHadronEnergyFraction(); - double nemf = i_pfjetchs->neutralEmEnergyFraction(); // equals to deprecated phf but has HF info too - double cemf = i_pfjetchs->chargedEmEnergyFraction(); // equals to deprecated elf - double muf = i_pfjetchs->muonEnergyFraction(); - double hf_hf = i_pfjetchs->HFHadronEnergyFraction(); - double hf_phf= i_pfjetchs->HFEMEnergyFraction(); - int hf_hm = i_pfjetchs->HFHadronMultiplicity(); - int hf_phm = i_pfjetchs->HFEMMultiplicity(); - int chm = i_pfjetchs->chargedHadronMultiplicity(); - int nhm = i_pfjetchs->neutralHadronMultiplicity(); - int phm = i_pfjetchs->photonMultiplicity(); - int elm = i_pfjetchs->electronMultiplicity(); - int mum = i_pfjetchs->muonMultiplicity(); - int npr = i_pfjetchs->chargedMultiplicity() + i_pfjetchs->neutralMultiplicity(); - //bool looseID = (npr>1 && phf<0.99 && nhf<0.99 && ((fabs(i_pfjetchs->eta())<=2.4 && elf<0.99 && chf>0 && chm>0) || fabs(i_pfjetchs->eta())>2.4)); - //bool tightID = (npr>1 && phf<0.99 && nhf<0.99 && ((fabs(i_pfjetchs->eta())<=2.4 && nhf<0.9 && phf<0.9 && elf<0.99 && chf>0 && chm>0) || fabs(i_pfjetchs->eta())>2.4)); - // https://twiki.cern.ch/twiki/bin/viewauth/CMS/JetID - float eta = i_pfjetchs->eta(); - int cm = i_pfjetchs->chargedMultiplicity(); - bool looseID = (nhf<0.99 && nemf<0.99 && npr>1 && muf<0.8) && ((fabs(eta) <= 2.4 && chf>0 && cm>0 && cemf<0.99) || fabs(eta)>2.4); - bool tightID = (nhf<0.90 && nemf<0.90 && npr>1 && muf<0.8) && ((fabs(eta)<=2.4 && chf>0 && cm>0 && cemf<0.90) || fabs(eta)>2.4); - - qcdpfjetchs.setLooseID(looseID); - qcdpfjetchs.setTightID(tightID); - qcdpfjetchs.setFrac(chf,nhf,nemf,cemf,muf); - qcdpfjetchs.setMulti(npr,chm,nhm,phm,elm,mum); - qcdpfjetchs.setHFFrac(hf_hf,hf_phf); - qcdpfjetchs.setHFMulti(hf_hm,hf_phm); - - - double hof = i_pfjetchs->hoEnergyFraction(); // Juska - qcdpfjetchs.setVtxInfo(mpuTrk,mlvTrk,mjtTrk); - qcdpfjetchs.setHO(hof); - - double TCHE = i_pfjetchs->bDiscriminator("trackCountingHighEffBJetTags"); - double TCHP = i_pfjetchs->bDiscriminator("trackCountingHighPurBJetTags"); - double TCHEpf = i_pfjetchs->bDiscriminator("pfTrackCountingHighEffBJetTags"); - double TCHPpf = i_pfjetchs->bDiscriminator("pfTrackCountingHighPurBJetTags"); - - double SoftMuonTagByIP = i_pfjetchs->bDiscriminator("softPFMuonByIP3dBJetTags"); - double SoftElectronTagByIP = i_pfjetchs->bDiscriminator("softPFElectronByIP3dBJetTags"); - double SoftMuonTag = i_pfjetchs->bDiscriminator("softPFMuonBJetTags"); - double SoftElectronTag = i_pfjetchs->bDiscriminator("softPFElectronBJetTags"); - - double SimpleSecVertexHE = i_pfjetchs->bDiscriminator("simpleSecondaryVertexHighEffBJetTags"); - double SimpleSecVertexHP = i_pfjetchs->bDiscriminator("simpleSecondaryVertexHighPurBJetTags"); - double SimpleSecVertexHEpf = i_pfjetchs->bDiscriminator("pfSimpleSecondaryVertexHighEffBJetTags"); - double SimpleSecVertexHPpf = i_pfjetchs->bDiscriminator("pfSimpleSecondaryVertexHighPurBJetTags"); - - double CSV = i_pfjetchs->bDiscriminator("combinedSecondaryVertexBJetTags"); - double CSVpf = i_pfjetchs->bDiscriminator("pfCombinedSecondaryVertexBJetTags"); - double CinclSVpf = i_pfjetchs->bDiscriminator("pfCombinedInclusiveSecondaryVertexBJetTags"); - double CMVApf = i_pfjetchs->bDiscriminator("pfCombinedMVABJetTags"); - double CSVSoftLeptonpf = i_pfjetchs->bDiscriminator("pfCombinedSecondaryVertexSoftLeptonBJetTags"); - - double CSVpfPositive = i_pfjetchs->bDiscriminator("pfPositiveCombinedSecondaryVertexBJetTags"); - double CSVpfNegative = i_pfjetchs->bDiscriminator("pfNegativeCombinedSecondaryVertexBJetTags"); - - //the three recommended - - double pfJetProbabilityBJetTags=i_pfjetchs->bDiscriminator("pfJetProbabilityBJetTags"); - double pfCombinedInclusiveSecondaryVertexV2BJetTags= i_pfjetchs->bDiscriminator("pfCombinedInclusiveSecondaryVertexV2BJetTags"); - double pfCombinedMVAV2BJetTags=i_pfjetchs->bDiscriminator("pfCombinedMVAV2BJetTags"); - - float partonFlavour=-100; - float hadronFlavour=-100; - - if (mIsMCarlo && mUseGenInfo) { - partonFlavour = i_pfjetchs->partonFlavour(); - hadronFlavour = i_pfjetchs->hadronFlavour(); - } - - qcdpfjetchs.setFlavour(partonFlavour,hadronFlavour); - - //Filling B-tag infos - qcdpfjetchs.setTCHETag(TCHE,TCHP,TCHEpf,TCHPpf); - qcdpfjetchs.setSoftLeptonTag(SoftMuonTagByIP,SoftElectronTagByIP,SoftMuonTag,SoftElectronTag); - qcdpfjetchs.setSimpleSecondaryVertexTag(SimpleSecVertexHE,SimpleSecVertexHP,SimpleSecVertexHEpf,SimpleSecVertexHPpf); - qcdpfjetchs.setCombinedSecondaryVertexTag(CSV,CSVpf,CinclSVpf,CSVSoftLeptonpf,CMVApf); - qcdpfjetchs.setPositiveNegativeCSV(CSVpfPositive,CSVpfNegative); - qcdpfjetchs.setTagRecommended(pfJetProbabilityBJetTags,pfCombinedInclusiveSecondaryVertexV2BJetTags,pfCombinedMVAV2BJetTags); - - float pileupJetId = -999; - if ( i_pfjetchs->hasUserFloat(pfchsjetpuid) ) { pileupJetId = i_pfjetchs->userFloat(pfchsjetpuid);} - qcdpfjetchs.SetPUJetId(pileupJetId); - - if (mIsMCarlo) { - GenJetCollection::const_iterator i_matchedchs; - float rmin(999); - for(GenJetCollection::const_iterator i_gen = genjets->begin(); i_gen != genjets->end(); i_gen++) { - double deltaR = reco::deltaR(*i_pfjetchs,*i_gen); - if (deltaR < rmin) { - rmin = deltaR; - i_matchedchs = i_gen; - } - } - if (genjets->size() == 0) { - LorentzVector tmpP4(0.0,0.0,0.0,0.0); - qcdpfjetchs.setGen(tmpP4,0); - } - else - qcdpfjetchs.setGen(i_matchedchs->p4(),rmin); - } // if (mIsMCarlo) - else { - LorentzVector tmpP4(0.0,0.0,0.0,0.0); - qcdpfjetchs.setGen(tmpP4,0); - } - if (qcdpfjetchs.pt() >= mMinPFPt) - mPFJetsCHS.push_back(qcdpfjetchs); - - - } // if(i_pfjetchs->isPFJet() ) - } // for(edm::View::const_iterator i_pfjetchs=patjetschs->begin(); i_pfjetchs!=patjetschs->end(); ++i_pfjetchs) - + + } // if(i_pfjetchs->isPFJet() ) + } // for(edm::View::const_iterator i_pfjetchs=patjetschs->begin(); i_pfjetchs!=patjetschs->end(); ++i_pfjetchs) //---------------- met --------------------------------------------- Handle pfmet; @@ -837,29 +564,23 @@ void ProcessedTreeProducerBTag::analyze(edm::Event const& event, edm::EventSetup const pat::MET &met = pfmet->front(); mPFMet.setVar(met.et(),met.sumEt(),met.phi()); - //-------------- fill the tree ------------------------------------- - sort(mPFJets.begin(),mPFJets.end(),sort_pfjets); + sort(mPFJetsCHS.begin(),mPFJetsCHS.end(),sort_pfjets); mEvent->setEvtHdr(mEvtHdr); - mEvent->setPFJets(mPFJets); - mEvent->setPFJetsCHS(mPFJetsCHS); // -- later substitute chs jets - mEvent->setGenJets(mGenJets); - mEvent->setGenFlavour(GenFlavour); - mEvent->setGenHadronFlavour(GenHadronFlavour); + mEvent->setPFJetsCHS(mPFJetsCHS); + if (mIsMCarlo) { + mEvent->setGenJets(mGenJets); + //mEvent->setGenFlavour(GenFlavour); + //mEvent->setGenHadronFlavour(GenHadronFlavour); + } + mEvent->setPFMET(mPFMet); - mEvent->setL1Obj(mL1Objects); mEvent->setHLTObj(mHLTObjects); - if ((mEvent->nPFJetsCHS() >= (unsigned)mMinNPFJets) ) { - if ((mEvent->pfmjjcor(0) >= mMinJJMass) ) { - // cout<<"Feeling tree ----"<Fill(); - } - } - //if (mPFPayloadName != "") { - //delete mPFUnc; - //delete mPFUncSrc; - //} + if (save_event) { + mTree->Fill(); + } + } diff --git a/AnalysisFW/plugins/ProcessedTreeProducerBTag.h b/AnalysisFW/plugins/ProcessedTreeProducerBTag.h index 75ed07c5d67..c0d451117da 100644 --- a/AnalysisFW/plugins/ProcessedTreeProducerBTag.h +++ b/AnalysisFW/plugins/ProcessedTreeProducerBTag.h @@ -15,7 +15,6 @@ #include "SMPJ/AnalysisFW/interface/QCDEvent.h" #include "SMPJ/AnalysisFW/interface/QCDEventHdr.h" #include "SMPJ/AnalysisFW/interface/QCDPFJet.h" -#include "SMPJ/AnalysisFW/interface/QCDPFJetBTag.h" #include "SMPJ/AnalysisFW/interface/QCDMET.h" #include "FWCore/ServiceRegistry/interface/Service.h" #include "CommonTools/UtilAlgos/interface/TFileService.h" @@ -24,10 +23,19 @@ #include "SimDataFormats/PileupSummaryInfo/interface/PileupSummaryInfo.h" #include "SimDataFormats/GeneratorProducts/interface/GenEventInfoProduct.h" #include "HLTrigger/HLTcore/interface/HLTPrescaleProvider.h" +#include "SimDataFormats/GeneratorProducts/interface/LHEEventProduct.h" +#include "SimDataFormats/GeneratorProducts/interface/LHERunInfoProduct.h" +#include "DataFormats/PatCandidates/interface/TriggerObjectStandAlone.h" +#include "DataFormats/PatCandidates/interface/PackedTriggerPrescales.h" #include "DataFormats/VertexReco/interface/VertexFwd.h" #include "DataFormats/VertexReco/interface/Vertex.h" +//Hadron level definition +#include "SimDataFormats/JetMatching/interface/JetFlavourInfo.h" +#include "SimDataFormats/JetMatching/interface/JetFlavourInfoMatching.h" +#include "DataFormats/Math/interface/deltaR.h" + using namespace edm; using namespace reco; using namespace std; @@ -50,39 +58,23 @@ class ProcessedTreeProducerBTag : public edm::EDAnalyzer } //---- configurable parameters -------- bool mIsMCarlo; + bool mAK4; bool mUseGenInfo; bool mPrintTriggerMenu; - bool isPFJecUncSet_,isPFJecUncSetCHS_; int mGoodVtxNdof,mMinNPFJets; double mGoodVtxZ; - double mMinPFPt,mMinPFFatPt,mMaxPFFatEta,mMinGenPt,mMaxY,mMinJJMass; - std::string mPFJECservice; - std::string mPFPayloadName; - std::string mPFPayloadNameCHS; - std::string pfpujetid; + double mMinPFPt,mMinGenPt,mMaxY; std::string pfchsjetpuid; - // unc file for non CHS jet ---- // - std::string mPFJECUncSrc; - // unc file for CHS jet ---- // - std::string mPFJECUncSrcCHS; - std::vector mPFJECUncSrcNames; - std::vector mBDiscriminators; // ---- non CHS jet input tag ----- // edm::EDGetTokenT mOfflineVertices; edm::EDGetTokenT mBeamSpot; - edm::EDGetTokenT >mPFJetsName; edm::EDGetTokenT >mPFJetsNameCHS; edm::EDGetTokenT mhEventInfo; + edm::EDGetTokenT> qgToken; // ----CHS jet input tag ----- // - //edm::InputTag mPFJetsName; - //edm::InputTag mPFJetsNameCHS; - edm::EDGetTokenT mSrcCaloRho; edm::EDGetTokenT mSrcPFRho; - //edm::InputTag triggerResultsTag_; - //edm::InputTag triggerEventTag_; - //edm::InputTag mPFMET; edm::EDGetTokenT mPFMET; edm::EDGetTokenT mGenJetsName; edm::EDGetTokenT mgenParticles; @@ -94,18 +86,35 @@ class ProcessedTreeProducerBTag : public edm::EDAnalyzer //edm::InputTag mSrcPU; edm::EDGetTokenT triggerResultsTag_; edm::EDGetTokenT triggerEventTag_; - edm::EDGetTokenT mHBHENoiseFilterResultLabel; - edm::EDGetTokenT mHBHENoiseFilterResultNoMinZLabel; edm::EDGetTokenT > mSrcPU; edm::Handle triggerResultsHandle_; edm::Handle triggerEventHandle_; + + edm::EDGetTokenT triggerBits_; + edm::EDGetTokenT triggerObjects_; + edm::EDGetTokenT triggerPrescales_; + edm::EDGetTokenT triggerPrescalesL1Min_; + edm::EDGetTokenT triggerPrescalesL1Max_; + + edm::EDGetTokenT genEvtInfoToken; + edm::EDGetTokenT lheEvtInfoToken; + + edm::Handle genEvtInfo; + edm::Handle lheEvtInfo; + + //hadron jet definition + edm::EDGetTokenT jetFlavourInfosToken_; + + std::string mPFJECUncSrcCHS; + std::vector mPFJECUncSrcNames; + std::string mPFPayloadNameCHS; + + bool saveWeights_; + HLTConfigProvider hltConfig_; //---- CORRECTORS ---------------------- - const JetCorrector *mPFJEC; - // ---- non CHS jet uncertainty ------ // - JetCorrectionUncertainty *mPFUnc; - // ---- non CHS jet uncertainty ------ // JetCorrectionUncertainty *mPFUncCHS; + //------- non CHS jet uncertainty sources -------- // std::vector mPFUncSrc; // -------- CHS jet uncertainty sources -------- // diff --git a/AnalysisFW/plugins/Spring16_25nsV9p2_DATA_L2L3Residual_AK8PFchs.txt b/AnalysisFW/plugins/Spring16_25nsV9p2_DATA_L2L3Residual_AK8PFchs.txt new file mode 100644 index 00000000000..759f96655e9 --- /dev/null +++ b/AnalysisFW/plugins/Spring16_25nsV9p2_DATA_L2L3Residual_AK8PFchs.txt @@ -0,0 +1,37 @@ +{ 1 JetEta 1 JetPt [2]*([3]*([4]+[5]*TMath::Log(max([0],min([1],x))))*1./([6]+[7]*100./3.*(TMath::Max(0.,1.03091-0.051154*pow(x,-0.154227))-TMath::Max(0.,1.03091-0.051154*TMath::Power(208.,-0.154227)))+[8]*((1+0.04432-1.304*pow(max(30.,min(6500.,x)),-0.4624)+(0+1.724*TMath::Log(max(30.,min(6500.,x))))/x)-(1+0.04432-1.304*pow(208.,-0.4624)+(0+1.724*TMath::Log(208.))/208.)))) Correction L2Relative} + -5.191 -3.839 11 10 6500 55 240 0.996800 1.000101 1.322001 -0.051859 0.992 -0.031 0 + -3.839 -3.489 11 10 6500 55 380 0.996800 1.000101 1.172906 -0.031481 0.992 -0.031 0 + -3.489 -3.139 11 10 6500 55 640 0.996800 1.000101 1.202572 -0.051945 0.992 -0.031 0 + -3.139 -2.964 11 10 6500 55 760 0.996800 1.000101 1.399289 -0.096722 0.992 -0.031 0 + -2.964 -2.853 11 10 6500 55 670 0.996800 1.000101 1.632535 -0.110592 0.992 -0.031 0 + -2.853 -2.650 11 10 6500 55 710 0.996800 1.000101 1.256777 -0.035855 0.992 -0.031 0 + -2.650 -2.500 11 10 6500 55 900 0.996800 1.000101 1.091728 -0.014777 0.992 -0.031 0 + -2.500 -2.322 11 10 6500 55 1020 0.996800 1.000101 1.063383 -0.011839 0.992 -0.031 0 + -2.322 -2.172 11 10 6500 55 1120 0.996800 1.000101 1.025884 -0.004054 0.992 -0.031 0 + -2.172 -1.930 11 10 6500 55 1400 0.996800 1.000101 1.032040 -0.007101 0.992 -0.031 0 + -1.930 -1.653 11 10 6500 55 1630 0.996800 1.000101 1.021314 -0.005810 0.992 -0.031 0 + -1.653 -1.479 11 10 6500 55 1960 0.996800 1.000101 1.030430 -0.008819 0.992 -0.031 0 + -1.479 -1.305 11 10 6500 55 2120 0.996800 1.000101 1.007190 -0.001887 0.992 -0.031 0 + -1.305 -1.044 11 10 6500 55 2180 0.996800 1.000101 0.995596 0.003583 0.992 -0.031 0 + -1.044 -0.783 11 10 6500 55 2310 0.996800 1.000101 1.007819 -0.000155 0.992 -0.031 0 + -0.783 -0.522 11 10 6500 55 2590 0.996800 1.000101 1.013788 -0.001362 0.992 -0.031 0 + -0.522 -0.261 11 10 6500 55 2950 0.996800 1.000101 0.996912 -0.000148 0.992 -0.031 0 + -0.261 -0.000 11 10 6500 55 2810 0.996800 1.000101 0.982343 0.001198 0.992 -0.031 0 + 0.000 0.261 11 10 6500 55 2810 0.996800 1.000101 0.982343 0.001198 0.992 -0.031 0 + 0.261 0.522 11 10 6500 55 2950 0.996800 1.000101 0.996912 -0.000148 0.992 -0.031 0 + 0.522 0.783 11 10 6500 55 2590 0.996800 1.000101 1.013788 -0.001362 0.992 -0.031 0 + 0.783 1.044 11 10 6500 55 2310 0.996800 1.000101 1.007819 -0.000155 0.992 -0.031 0 + 1.044 1.305 11 10 6500 55 2180 0.996800 1.000101 0.995596 0.003583 0.992 -0.031 0 + 1.305 1.479 11 10 6500 55 2120 0.996800 1.000101 1.007190 -0.001887 0.992 -0.031 0 + 1.479 1.653 11 10 6500 55 1960 0.996800 1.000101 1.030430 -0.008819 0.992 -0.031 0 + 1.653 1.930 11 10 6500 55 1630 0.996800 1.000101 1.021314 -0.005810 0.992 -0.031 0 + 1.930 2.172 11 10 6500 55 1400 0.996800 1.000101 1.032040 -0.007101 0.992 -0.031 0 + 2.172 2.322 11 10 6500 55 1120 0.996800 1.000101 1.025884 -0.004054 0.992 -0.031 0 + 2.322 2.500 11 10 6500 55 1020 0.996800 1.000101 1.063383 -0.011839 0.992 -0.031 0 + 2.500 2.650 11 10 6500 55 900 0.996800 1.000101 1.091728 -0.014777 0.992 -0.031 0 + 2.650 2.853 11 10 6500 55 710 0.996800 1.000101 1.256777 -0.035855 0.992 -0.031 0 + 2.853 2.964 11 10 6500 55 670 0.996800 1.000101 1.632535 -0.110592 0.992 -0.031 0 + 2.964 3.139 11 10 6500 55 760 0.996800 1.000101 1.399289 -0.096722 0.992 -0.031 0 + 3.139 3.489 11 10 6500 55 640 0.996800 1.000101 1.202572 -0.051945 0.992 -0.031 0 + 3.489 3.839 11 10 6500 55 380 0.996800 1.000101 1.172906 -0.031481 0.992 -0.031 0 + 3.839 5.191 11 10 6500 55 240 0.996800 1.000101 1.322001 -0.051859 0.992 -0.031 0 diff --git a/AnalysisFW/src/QCDEvent.cc b/AnalysisFW/src/QCDEvent.cc index a245429bc50..e0fc17aa1b2 100644 --- a/AnalysisFW/src/QCDEvent.cc +++ b/AnalysisFW/src/QCDEvent.cc @@ -2,8 +2,6 @@ //--------------------------------------------------- QCDEvent::QCDEvent() { - L1Obj_.clear(); - PFJets_.clear(); PFJetsCHS_.clear(); GenJets_.clear(); } @@ -12,22 +10,6 @@ QCDEvent::~QCDEvent() { } //--------------------------------------------------- -void QCDEvent::setCaloJets(const std::vector& fCaloJets) -{ - CaloJets_.clear(); - for(unsigned i=0;i& fPFJets) -{ - PFJets_.clear(); - for(unsigned i=0;i& fPFJetsCHS) { PFJetsCHS_.clear(); @@ -35,31 +17,6 @@ void QCDEvent::setPFJetsCHS(const std::vector& fPFJetsCHS) PFJetsCHS_.push_back(fPFJetsCHS[i]); } } -//--------------------------------------------------- -void QCDEvent::setElectrons(const std::vector& fElectrons) -{ - mElectron_.clear(); - for(unsigned i=0;i& fMuon) -{ - mMuon_.clear(); - for(unsigned i=0;i& fFatJets) -//{ -// FatJets_.clear(); -// for(unsigned i=0;i& fGenJets) { @@ -69,18 +26,6 @@ void QCDEvent::setGenJets(const std::vector& fGenJets) } } //--------------------------------------------------- -void QCDEvent::setL1Obj(const std::vector >& fL1Obj) -{ - L1Obj_.clear(); - for(unsigned i=0;i vv; - for(unsigned j=0;j >& fHLTObj) { HLTObj_.clear(); @@ -93,201 +38,3 @@ void QCDEvent::setHLTObj(const std::vector >& fHLTObj } } //--------------------------------------------------- -int QCDEvent::nGoodJets(int unc, int id, float ymax, float ptmin, std::vector jets) -{ - // unc defines the uncertainty - // id defines the jet id - // ymax defines the maximum rapidity - // ptmin defines the minimum jet pt - int sign(0),counter(0); - if (unc > 0) - sign = 1; - if (unc < 0) - sign = -1; - for(unsigned i=0;i= ptmin) - counter++; - } - } - return counter; -} -//--------------------------------------------------- -float QCDEvent::genmjj() -{ - if (GenJets_.size() < 2) - return 0.0; - else { - return (GenJets_[0]+GenJets_[1]).mass(); - } -} -//--------------------------------------------------- -float QCDEvent::pfmjj() -{ - if (PFJets_.size() < 2) - return 0.0; - else { - const LorentzVector& P0 = PFJets_[0].p4(); - const LorentzVector& P1 = PFJets_[1].p4(); - return (P0+P1).mass(); - } -} -//--------------------------------------------------- -float QCDEvent::pfmjjcor(int k) -{ - int sign(0); - if (PFJets_.size() < 2) - return 0.0; - else { - if (k>0) - sign = 1; - if (k<0) - sign = -1; - const LorentzVector& P0 = PFJets_[0].p4(); - const LorentzVector& P1 = PFJets_[1].p4(); - double cor0 = PFJets_[0].cor(); - double cor1 = PFJets_[1].cor(); - double unc0 = PFJets_[0].unc(); - double unc1 = PFJets_[1].unc(); - return (cor0*(1+sign*unc0)*P0+cor1*(1+sign*unc1)*P1).mass(); - } -} -//-------------------------------------------------- -float QCDEvent::pfchsmjjcor(int k) -{ - int sign(0); - if (PFJetsCHS_.size() < 2) - return 0.0; - else { - if (k>0) - sign = 1; - if (k<0) - sign = -1; - const LorentzVector& P0 = PFJetsCHS_[0].p4(); - const LorentzVector& P1 = PFJetsCHS_[1].p4(); - double unc0 = PFJetsCHS_[0].unc(); - double unc1 = PFJetsCHS_[1].unc(); - return ((1+sign*unc0)*P0+(1+sign*unc1)*P1).mass(); - } -} - -//--------------------------------------------------- -float QCDEvent::pfmjjcor(int k,int src) -{ - int sign(0); - if (PFJets_.size() < 2) - return 0.0; - else { - if (k>0) - sign = 1; - if (k<0) - sign = -1; - const LorentzVector& P0 = PFJets_[0].p4(); - const LorentzVector& P1 = PFJets_[1].p4(); - double cor0 = PFJets_[0].cor(); - double cor1 = PFJets_[1].cor(); - double unc0 = PFJets_[0].uncSrc(src); - double unc1 = PFJets_[1].uncSrc(src); - return (cor0*(1+sign*unc0)*P0+cor1*(1+sign*unc1)*P1).mass(); - } -} -//-------------------------------------------------- -float QCDEvent::pfchsmjjcor(int k,int src) -{ - int sign(0); - if (PFJetsCHS_.size() < 2) - return 0.0; - else { - if (k>0) - sign = 1; - if (k<0) - sign = -1; - const LorentzVector& P0 = PFJets_[0].p4(); - const LorentzVector& P1 = PFJets_[1].p4(); - double unc0 = PFJets_[0].uncSrc(src); - double unc1 = PFJets_[1].uncSrc(src); - return ((1+sign*unc0)*P0+(1+sign*unc1)*P1).mass(); - } -} - - -////--------------------------------------------------- -//float QCDEvent::fatmjjcor(int k) -//{ -// int sign(0); -// if (FatJets_.size() < 2) -// return 0.0; -// else { -// if (k>0) -// sign = 1; -// if (k<0) -// sign = -1; -// const LorentzVector& P0 = FatJets_[0].p4(); -// const LorentzVector& P1 = FatJets_[1].p4(); -// double cor0 = FatJets_[0].cor(); -// double cor1 = FatJets_[1].cor(); -// double unc0 = FatJets_[0].unc(); -// double unc1 = FatJets_[1].unc(); -// return (cor0*(1+sign*unc0)*P0+cor1*(1+sign*unc1)*P1).mass(); -// } -//} -//--------------------------------------------------- -float QCDEvent::calomjj() -{ - if (CaloJets_.size() < 2) - return 0.0; - else { - const LorentzVector& P0 = CaloJets_[0].p4(); - const LorentzVector& P1 = CaloJets_[1].p4(); - return (P0+P1).mass(); - } -} -////--------------------------------------------------- -float QCDEvent::calomjjcor(int k) -{ - int sign(0); - if (CaloJets_.size() < 2) - return 0.0; - else { - if (k>0) - sign = 1; - if (k<0) - sign = -1; - const LorentzVector& P0 = CaloJets_[0].p4(); - const LorentzVector& P1 = CaloJets_[1].p4(); - double cor0 = CaloJets_[0].cor(); - double cor1 = CaloJets_[1].cor(); - double unc0 = CaloJets_[0].unc(); - double unc1 = CaloJets_[1].unc(); - return (cor0*(1+sign*unc0)*P0+cor1*(1+sign*unc1)*P1).mass(); - } -} -//--------------------------------------------------- -float QCDEvent::pfmjjgen() -{ - if (PFJets_.size() < 2) - return 0.0; - else { - const LorentzVector& P0 = PFJets_[0].genp4(); - const LorentzVector& P1 = PFJets_[1].genp4(); - return (P0+P1).mass(); - } -} -//--------------------------------------------------- -float QCDEvent::calomjjgen() -{ - if (CaloJets_.size() < 2) - return 0.0; - else { - const LorentzVector& P0 = CaloJets_[0].genp4(); - const LorentzVector& P1 = CaloJets_[1].genp4(); - return (P0+P1).mass(); - } -} - - diff --git a/AnalysisFW/src/classes.h b/AnalysisFW/src/classes.h index 989bb897e32..73550d659bc 100644 --- a/AnalysisFW/src/classes.h +++ b/AnalysisFW/src/classes.h @@ -1,18 +1,11 @@ #include "SMPJ/AnalysisFW/interface/QCDMET.h" #include "SMPJ/AnalysisFW/interface/QCDJet.h" -#include "SMPJ/AnalysisFW/interface/QCDCaloJet.h" #include "SMPJ/AnalysisFW/interface/QCDPFJet.h" #include "SMPJ/AnalysisFW/interface/QCDEvent.h" #include "SMPJ/AnalysisFW/interface/QCDEventHdr.h" -#include "SMPJ/AnalysisFW/interface/MyMuon.h" -#include "SMPJ/AnalysisFW/interface/MyElectron.h" QCDMET qcdmet; QCDJet qcdjet; -QCDCaloJet qcdcalojet; QCDPFJet qcdpfjet; -QCDPFJetBTag qcdpfjetbtag; QCDEvent qcdevent; QCDEventHdr qcdeventhdr; -MyMuon mymuon; -MyElectron myelectron; diff --git a/AnalysisFW/src/classes_def.xml b/AnalysisFW/src/classes_def.xml index 46d428f0748..11a2696e751 100644 --- a/AnalysisFW/src/classes_def.xml +++ b/AnalysisFW/src/classes_def.xml @@ -2,11 +2,7 @@ - - - - diff --git a/AnalysisFW/test/.DS_Store b/AnalysisFW/test/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..38277c3ec89f477792afe7eae0e3cb2a398be633 GIT binary patch literal 8196 zcmeHMOKclO7@p5fo83(x<0K`nLyOfYY6xj+_mL7P#YvMs6rx7t;j{@gYwxyQvDr1= zbyBDz1rP`jqT+D@2_#yehyoG^1cC!XLM@^fkSatFaN))Y2{^!se|FYY>b3_ifas1j z^UeJ8|Fg5-eBSY_8Dr?L7#YSAj4_3>K;A&bHInET`KlBPEz1Z&@ysny?axBVwmknT z@5m4_5HS!j5HS!j5HavyV1V{)k(BG~`?5DGBL*S{Zb$~i^C3l9U^c`BiNT|Tir@%9 zSV!g{QJsqlVJgIIhzk;_hZ1Bcp$tWM#DEMZdn)wHhPWV6hBJhR4}@1nctSyNbs9ev zxHDuWMrFi6#K6@I$g_KQVa_WR?4{@Tbb1l7Wp&F})GMmiAU-^<-8XvNog4LazvA`l z<*A@$8D=4@kLdpKYJJRg?aOt&FkzW73;l?p(iHaSU&IRF0Rk z4F7nZuN^6yvlKd_JLZJtSq00s{D%}(eDZwV$&=f9db?8Fc5I*TN}bGPdNW!M+j@Gq2mIz!Mbg4c0_U!bLG2?bo$#R zTqFjXwY_=XDCTvrxA>p6Z0g0e%pS2P{Na*iD)A|2m4YMEs<9y_9rIr@w#qgoQ{RQ`c7ZP56` zt|5GkpeNCiSg$Bk!oH_$QYp<^DzQ=Jx-#a`G~^KN+9s8I>evIcb~3b6>r%L(j@x>{ zw54f_mQnbSnwypMNaJ>`M~S0Loh-UDGc-d_ntKy>D*OxOh`9DWy5}D(nGRi^-?jVh zY)c|hdw12lJ|z7648t@OMQO`+$R$#>*q7`g`-&~H@7VY32lg}jmHozk2cV$=tFRhPxEbql3sPuDH?|;yt+*Y1 z=*IvCF^mc1a2QiCFarlAJctE6g;RJ5ui+ft!Mk`5AL1i9r&v{h`@%VffX}ER1sHxA zW4UVyFge(y?fZ8GxVTctF5cMGyf)Nf-{p0zS-Pbv3WOt-5h$jrh(ME9%J3!n%O!fwvG*rG^_L3Tf zj(MHz?bS$yLn>b(dv|Nu;Jd?_Y_}&>_3z2-G>PnElGsJ|HT#DB$bMqKus=vx^@yVd z3AB>1HeeGv(23iy89msEUfh9QB&)sHj{_LO7{*CnlO(Vr3G672!9p1xDwxFyJc38@ zIG(_hcn;6w1-yt?@M?|F_SXpQ?3L}Pbwe^B_I^qUasD5?{`>#HDJmicA_o4S44`gc zbfBN^t@^v9_BO>?J4N|^$|4EB1&Kij6~S?wFgT7AUjD<7>M3#+G1(9oB$9>FKmH;> Q{3ea||A70bxN#Zy3vtKC00000 literal 0 HcmV?d00001 diff --git a/AnalysisFW/test/._.DS_Store b/AnalysisFW/test/._.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..c35f5c288a879aa0f73c9c514c470f48750880ea GIT binary patch literal 4096 zcmZQz6=P>$Vqox1Ojhs@R)|o50+1L3ClDJkFz{^v(m+1nBL)UWIk*Y|peR=07!nc$ zl;DHtV5q>VXjE`C1V%$(Gz3ONU^E0qLtr!nMnhmU1V%$(Gz3ONU^E1%90H6$^FSC3 z= 4 && abs(z) <= 24 && position.rho <= 2"), +) + +#Try scheduled processs +process.path = cms.Path(process.goodVertices + *process.selectedHadronsAndPartons*process.genJetFlavourInfos + #process.patMETCorrections*process.patMETs + *process.ak4) + + +#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +#! Output and Log +#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(False) ) +process.options.allowUnscheduled = cms.untracked.bool(True) diff --git a/AnalysisFW/test/ProcessedTreeProducer_MCPAT25ns_BTag_cfg.py b/AnalysisFW/test/ProcessedTreeProducer_MCPAT25ns_BTag_cfg.py index 1029f89750e..011a3c5a6e8 100644 --- a/AnalysisFW/test/ProcessedTreeProducer_MCPAT25ns_BTag_cfg.py +++ b/AnalysisFW/test/ProcessedTreeProducer_MCPAT25ns_BTag_cfg.py @@ -17,6 +17,7 @@ #from RecoJets.JetProducers.pileupjetidproducer_cfi import * from PhysicsTools.PatAlgos.patTemplate_cfg import * from PhysicsTools.PatAlgos.tools.jetTools import * +from RecoJets.JetProducers.QGTagger_cfi import QGTagger ## Modified version of jetToolBox from https://github.com/cms-jet/jetToolbox ## Options for PUMethod: Puppi, CS, SK, CHS @@ -41,7 +42,11 @@ #process.load("PhysicsTools.PatAlgos.slimming.pileupJetId_cfi") from Configuration.AlCa.GlobalTag import GlobalTag #process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:mc', '') -process.GlobalTag.globaltag = "76X_mcRun2_asymptotic_v12" +process.GlobalTag.globaltag = "80X_mcRun2_asymptotic_2016_miniAODv2_v1" + +process.load('RecoJets.JetProducers.QGTagger_cfi') +process.QGTagger.srcJets = cms.InputTag('ak4PFJetsCHS') # Could be reco::PFJetCollection or pat::JetCollection (both AOD and miniAOD) +process.QGTagger.jetsLabel = cms.string('QGL_AK4PFchs') # Other options: see https://twiki.cern.ch/twiki/bin/viewauth/CMS/QGDataBaseVersion ##-------------------- Import the JEC services ----------------------- process.load('JetMETCorrections.Configuration.DefaultJEC_cff') @@ -51,17 +56,19 @@ #!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! inFiles = cms.untracked.vstring( -'file:/afs/cern.ch/work/e/eeren/public/04E758F7-34F9-E411-AFF0-002618FDA259.root' +'file:009A0396-C0F1-E511-BE94-0025904C67A6.root' +#'file:0274FD94-43A4-E511-BCDF-02163E01439A.root' ) -process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(100)) +process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(-1)) process.source = cms.Source("PoolSource", fileNames = inFiles ) def jetToolbox( proc, jetType, jetSequence,PUMethod='', bTagDiscriminators = None): JETCorrPayload='None' JETCorrLevels = [ 'None' ] - bTagDiscriminators = ['trackCountingHighEffBJetTags','trackCountingHighPurBJetTags','pfTrackCountingHighEffBJetTags','pfTrackCountingHighPurBJetTags','softPFMuonByIP3dBJetTags','softPFElectronByIP3dBJetTags','softPFMuonBJetTags','softPFElectronBJetTags','simpleSecondaryVertexHighEffBJetTags','simpleSecondaryVertexHighPurBJetTags','pfSimpleSecondaryVertexHighEffBJetTags','pfSimpleSecondaryVertexHighPurBJetTags','combinedSecondaryVertexBJetTags','pfCombinedSecondaryVertexBJetTags','pfCombinedInclusiveSecondaryVertexBJetTags','pfCombinedMVABJetTags','pfCombinedSecondaryVertexSoftLeptonBJetTags','pfPositiveCombinedSecondaryVertexBJetTags','pfNegativeCombinedSecondaryVertexBJetTags','pfCombinedInclusiveSecondaryVertexV2BJetTags','pfCombinedMVAV2BJetTags','pfJetProbabilityBJetTags'] + bTagDiscriminators = ['trackCountingHighEffBJetTags','trackCountingHighPurBJetTags','pfTrackCountingHighEffBJetTags','pfTrackCountingHighPurBJetTags','softPFMuonByIP3dBJetTags','softPFElectronByIP3dBJetTags','softPFMuonBJetTags','softPFElectronBJetTags','simpleSecondaryVertexHighEffBJetTags','simpleSecondaryVertexHighPurBJetTags','pfSimpleSecondaryVertexHighEffBJetTags','pfSimpleSecondaryVertexHighPurBJetTags','combinedSecondaryVertexV2BJetTags','pfCombinedSecondaryVertexV2BJetTags','pfCombinedInclusiveSecondaryVertexV2BJetTags','pfCombinedMVAV2BJetTags','pfPositiveCombinedSecondaryVertexV2BJetTags','pfNegativeCombinedSecondaryVertexV2BJetTags','pfCombinedInclusiveSecondaryVertexV2BJetTags','pfCombinedMVAV2BJetTags','pfJetProbabilityBJetTags'] + GetJetMCFlavour = ['True'] #JECLevels = [ 'L1Offset', 'L1FastJet', 'L1JPTOffset', 'L2Relative', 'L3Absolute', 'L5Falvour', 'L7Parton' ] @@ -75,7 +82,7 @@ def jetToolbox( proc, jetType, jetSequence,PUMethod='', bTagDiscriminators = Non print 'Running processes with: '+str(jetALGO)+' PF '+PUMethod+' jet algorithm with radius parameter '+str(jetSize) JETCorrPayload = 'AK'+size+'PF'+PUMethod.lower() - JETCorrLevels = ['L1FastJet', 'L2Relative', 'L3Absolute','L2L3Residual'] + JETCorrLevels = ['L1FastJet', 'L2Relative', 'L3Absolute'] #JETCorrLevels = [] #No JEC corrections JEC = ( JETCorrPayload, JETCorrLevels , 'None') @@ -160,10 +167,25 @@ def jetToolbox( proc, jetType, jetSequence,PUMethod='', bTagDiscriminators = Non #getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod).userData.userFloats.src += [jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator:fullDiscriminant'] #getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod).userData.userInts.src += [jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator:cutbasedId',jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator:fullId'] + QGjetsLabel='chs' + + setattr( proc, 'QGTagger'+jetALGO+'PF'+PUMethod, + QGTagger.clone( + srcJets = cms.InputTag(jetalgo+'PFJets'+PUMethod), # Could be reco::PFJetCollection or pat::JetCollection (both AOD and miniAOD) + jetsLabel = cms.string('QGL_AK4PF'+QGjetsLabel) # Other options (might need to add an ESSource for it): see https://twiki.cern.ch/twiki/bi + ) + ) + elemToKeep += [ 'keep *_QGTagger'+jetALGO+'PF'+PUMethod+'_*_*' ] + getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod).userData.userFloats.src += ['QGTagger'+jetALGO+'PF'+PUMethod+':qgLikelihood'] + jetSeq += getattr(proc, 'QGTagger'+jetALGO+'PF'+PUMethod ) + + toolsUsed.append( 'QGTagger'+jetALGO+'PF'+PUMethod ) + getattr(proc,'patJetPartons').particles = cms.InputTag( 'genParticles' ) #'prunedGenParticles') setattr(proc, 'selectedPatJets'+jetALGO+'PF'+PUMethod, selectedPatJets.clone( src = 'patJets'+jetALGO+'PF'+PUMethod ) ) setattr(proc, jetSequence, jetSeq) + jetToolbox( process, 'ak4', 'ak4JetSubs') jetToolbox( process, 'ak4', 'ak4JetSubs','CHS') @@ -188,6 +210,20 @@ def jetToolbox( proc, jetType, jetSequence,PUMethod='', bTagDiscriminators = Non process.patJets.addTagInfos = True process.patJets.getJetMCFlavour = True +genJetCollection = 'ak4GenJetsNoNu' +genParticleCollection = 'genParticles' + +from PhysicsTools.JetMCAlgos.HadronAndPartonSelector_cfi import selectedHadronsAndPartons +process.selectedHadronsAndPartons = selectedHadronsAndPartons.clone( + particles = genParticleCollection +) + +from PhysicsTools.JetMCAlgos.AK4PFJetsMCFlavourInfos_cfi import ak4JetFlavourInfos + +process.genJetFlavourInfos = ak4JetFlavourInfos.clone( + jets = genJetCollection, +) + process.ak4 = cms.EDAnalyzer('ProcessedTreeProducerBTag', ## jet collections ########################### pfjets = cms.InputTag('selectedPatJetsAK4PF'), @@ -203,6 +239,7 @@ def jetToolbox( proc, jetType, jetSequence,PUMethod='', bTagDiscriminators = Non jecUncSrc = cms.string(''), jecUncSrcCHS = cms.string(''), jecUncSrcNames = cms.vstring(''), + AK4 = cms.untracked.bool(True), ## set the conditions for good Vtx counting ## offlineVertices = cms.InputTag('offlinePrimaryVertices'), goodVtxNdof = cms.double(4), @@ -231,6 +268,7 @@ def jetToolbox( proc, jetType, jetSequence,PUMethod='', bTagDiscriminators = Non EventInfo = cms.InputTag("generator"), GenParticles = cms.InputTag("genParticles"), beamSpot = cms.InputTag('offlineBeamSpot'), + jetFlavourInfos = cms.InputTag("genJetFlavourInfos"), #pfjecService = cms.string('ak7PFL1FastL2L3Residual'), ) @@ -244,6 +282,7 @@ def jetToolbox( proc, jetType, jetSequence,PUMethod='', bTagDiscriminators = Non pfchsjetpuid = cms.string('AK8PFCHSpileupJetIdEvaluator:fullDiscriminant'), PFPayloadName = cms.string('AK8PF'), PFPayloadNameCHS= cms.string('AK8PFchs'), + AK4 = cms.untracked.bool(False), ) jetToolbox( process, 'ak7', 'ak7JetSubs','CHS') @@ -256,6 +295,7 @@ def jetToolbox( proc, jetType, jetSequence,PUMethod='', bTagDiscriminators = Non pfchsjetpuid = cms.string('AK7PFCHSpileupJetIdEvaluator:fullDiscriminant'), PFPayloadName = cms.string('AK7PF'), PFPayloadNameCHS= cms.string('AK7PFchs'), + AK4 = cms.untracked.bool(False), ) jetToolbox( process, 'ak5', 'ak5JetSubs','CHS') @@ -268,6 +308,7 @@ def jetToolbox( proc, jetType, jetSequence,PUMethod='', bTagDiscriminators = Non pfchsjetpuid = cms.string('AK5PFCHSpileupJetIdEvaluator:fullDiscriminant'), PFPayloadName = cms.string('AK5PF'), PFPayloadNameCHS= cms.string('AK5PFchs'), + AK4 = cms.untracked.bool(False), ) process.goodVertices = cms.EDFilter("VertexSelector", diff --git a/AnalysisFW/test/ProcessedTreeProducer_MCPAT25ns_BTag_cfg.pyc b/AnalysisFW/test/ProcessedTreeProducer_MCPAT25ns_BTag_cfg.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a910ae23ce7bb3d556157ad226fb1f9fab386d6d GIT binary patch literal 10626 zcmd5?ZGRI7*hav?Ay{CI7vu*p1`b%{2O0ddTFJnj^Pr5?BYEVJMms$+ zc+buy=gTI!%U8$;NM7Bm`%ZbC50Lz;dS*PbEzbM9H)o+yS9eu)RdscBRS(Jk9q9Yd zAO7bNzij#6LqgLevaVONh-R_aubVCFENGWa5 zFhIIr63$goza}=XLCRs4dz8Ks5)v3f-VndT!rvDb z{-uP31UJQD62viBro~}bWXD@9jKu5^eO%PO7PSYW^e~k5OCAoixkCWqWkhKr#JH<5 z^b+0Ez$6b&iPE&NqV^*pzY?2|g&Y%`Gwho8h4VzzXT|0$#F-Vfr$UYkYbMlomXW>| z&NESeE;gS7={X}k5Z2=m=@)F07eYQ1GQ(|HVuHkwm{~8)6oZgOFUlhZABQ031M-s) zd6vPa3}Q9F?JMqi7UDl=P|phkzhLlXIC`DISMA_83}UJE=xYYS98{BxpXDCRHOJsQ zgRg{KU~n-6a||wp$Zr^Y8-mLWt}v)2U*(>)kbIrNZ$mK8;CBqd(FzO}LvqZn5jH}6 z_C)zEM2Licf1>9@tmhkM`%CVDxqijqCWDbd{)R!Q|F`VOz(MT#yRh@`W1Xe2^B;sX z#bH9ot+1yY_Qc=y6BbBsm>nS<5pI}R7w;*!{A>2d z$nWaRGV;3ygOT643`Ty}WH558?-`8T%40C@DQw6?agGFpzi4Tckp3|NxvPVKE#?{t zxXWN9;70}{0Y5Pq3Ao2#B;XGWb`o$d6!6zV?jIA7yE+JXz+58%|B=B+z~3+!3HVP8 zMgsmbgOPy0Ww4WgdW$Uxc_`%X*azUx+E@Q2bP2r~e`FA@`>(|C&`8n(U`y(V_ixl0 z9!mcn2Y#;s#GH^bk>o^4@837f0pg)^PK4Q^XIo8kNgIFw! z(h3~`#j*cDK4AYJ{?^A5X!^Z)m^+X2xn;{&et#UAe^VSY2&Yf?E?Esi(tShdE4H@K zkvBcFZuyoMj1bAVMjAv@S&miqEtxm{BWmO$;=82{vs$%07Gd3QH68m0FnNoidACuq zt1Zv;ZMTsr`es9#o-A75x2#6lQkk6RHhkOifG2IjQKcov-7+0;ES1r@Ftl54-cddpGLLWbwIKcSRC-6_szGS)3*V`*tWp`nY$!5+#wq{lvmT#AHw&lpuqo*58 zISxu#gk#^Mc5+6r=lHcA_c3Ew>uA?$o;;d73Ri1&D-Jrc{O!RihVeq)^tkj!$qe9bQz}Bnp%db^${~HBr%!| z37*nI%V%V}L*s%WpNoT$z%cR`BvR;VDSwE~{Ni-UUUD~l>6O?Y;W-Y4UO_C%H*JjM zYmveZoQ2D4kCEB7aTvIENz{f#S8YTb69V};(|S47oyJn|aba z5CCa@LX<9tiZ8aw#g3BWOgOA!K7hq7Oex+A)9=nf6p^`>JLadc9OvG*S7i1q2X{+~sRYd|Mr zvr;?@&p(42=XwiV%Wi$kZdk~H+9Z8H9U16Lo_qe!;!#@Atb}-P8)c`Z?A_xgh%rvJ z5v;w>#>ObUYF6^DLKe1bg-kmOsqxpXDl)sX;FC)+!dcQTSbZOWJVD&a*GB$I^FbKB#z2b>5sO*{XDIRIGxX>)m>`TEI(}`b@4D* zXOy&OO1q`f%`m%7`@}Z8!aw;OpX;krIa5(u%ZL8zbis01F%3S-ZYkGk`Bvc~DAiBP z^l<1PThbZ#y1U-OF$*4E8T(y`s?~_n!kp_t0L3_D2#+%~&g7vLI>?-wAtwqMZl&U2zvUrf5Ehtt z7()<~BVAT0w`_BX!q!5rS)c_#$mNy73@WsOS|z(M6y>Ihs-qptYNp3aVH(SBSsE{m zGZUoI#6*$RpMPInwRbGX-gaHdrieQMFN{Vf$3TKxpd@pQwg9K56~{GolGP`Z%*ru-v6g=49OsLS1Y|YRg0(~i~W}#`nvt+bd zdrgbC6WWnx{J_?|%V|_}XjNqE%?_ z9<}|TO`FoE>g=7eBwOLTB{0$sIfg;O5A|ELCd`VOK!w=Il(#27y57!2bD~*A1hpJz zf~vG^!*o#ZsfqcuV(~-iX=$=F^{52DD{oItAUI7F*Ye8~Ay)3g1Z~?1#BPqga>KK* zqjVKoTAR;jH>PJ$y3fJ#h&k0vbB~uC;!%j&azD*MDD@)=ndmWkjm1Q7vd8E%MvQ)Z zdJ=aNSB$~LU{4Q0`jZ$i9vG>_K%(EcN57z=kv`*EvK>wtJ;@|SE*fYBpFv~L7{>S9 z^`68iC{so%dBb>V+)P|e{LFZ4@M_?)gr&qU)*M$LsxU!f-oqpJ0Rha)tl^|FtJbPZ z*Bk8+)v2}&@#FFMoo_o7tx=xm5Q&SHw~LTN`06I`*XB#7+i{xfPc;ji4#jv__ph3J zmN!Mkc@!S?rNTEIY4zm|B4j`tyUc0l!2uj5iJe%5MX=SC|5da?(l@3=@}{y4+z9DN z^&!HeeW>jk?4-AiimP}7kv^T+I7hLg;Rk0IrT}%b1^R~&i0Q%lY%D0i zHY+$tIXqy|aDkz?jm^(WQY^~ng2=>YF41T`>6B|5Bb6xT@i6I5fuUxV-!;lbWEFI_ zMiAlZ134JhcNcV0fSe;L?E6ygvp z=1s>fY`gw7fED|bC6_!~q9e#GvW`O-Ob_gQj&SK{J{_0$B;mc&F_4UdqetIdksGlW z)y+@8!hHt)jl5=KA_IY)e49Lmd7xumCp0$SCy~+62glC)Y%~DN%WJ06N2RUS=1mWB z28R{!cs5#qCXO`Z3O0p-HLKBL12uIt@hI;HT)IY0pH#`Db>8#LzmRb)>^gpu@~( zb(ra-0|t(C0B|OWf_2ceXQBvnAThKKXps)IdG$R)kzaklcPYWe9WZS>PGV`P$}L|# z!|yFy<;)!`eeYhnfuNaw^)mgK0CP)?{cu11;$?c8;U*W^cpc(xyWFd&lBfH691IzJ z^}bdazRE!^oilBx6s*QIIKNH|uvtMavJa%}8N|=d6N@frWra1WtEiNAJ+=m=A^sgaPIopgM=~Jd ziwItt(-D#Mg!LLP4X=Dh)C~()dAKNm2vz@fM{|XxHcLtylhXjKFV!eI*V6668V%CD zW4n)Kk(Xqm_gDqm`+RU!`3z9 zbo1B?99xh)Jet-ihxv(*Ma6p|xbPs^6~ALD(CJsGQ?Qzd zNW3#WZi2J7$Ga|GcyLTZ%;NV}T+J62Xac&HLSBV@Tj%C9HL8DXk*NGFydXqM8F13V zA^E~4cG+?w3^B2;eROpY6$fo@^*uNiz9rtD= 4 && abs(z) <= 24 && position.rho <= 2"), +) + +#Try scheduled processs +process.path = cms.Path(process.goodVertices + #process.patMETCorrections*process.patMETs + *process.ak4) + + +#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +#! Output and Log +#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(False) ) +process.options.allowUnscheduled = cms.untracked.bool(True) diff --git a/AnalysisFW/test/ProcessedTreeProducer_dataPAT25ns_BTag_cfg.py b/AnalysisFW/test/ProcessedTreeProducer_dataPAT25ns_BTag_cfg.py index 48f06e17974..dd29b30bfdc 100644 --- a/AnalysisFW/test/ProcessedTreeProducer_dataPAT25ns_BTag_cfg.py +++ b/AnalysisFW/test/ProcessedTreeProducer_dataPAT25ns_BTag_cfg.py @@ -17,6 +17,7 @@ #from RecoJets.JetProducers.pileupjetidproducer_cfi import * from PhysicsTools.PatAlgos.patTemplate_cfg import * from PhysicsTools.PatAlgos.tools.jetTools import * +from RecoJets.JetProducers.QGTagger_cfi import QGTagger ## Modified version of jetToolBox from https://github.com/cms-jet/jetToolbox ## Options for PUMethod: Puppi, CS, SK, CHS @@ -39,9 +40,11 @@ process.load("PhysicsTools.PatAlgos.patSequences_cff") #process.load("PhysicsTools.PatAlgos.slimming.pileupJetId_cfi") +process.load('RecoJets.JetProducers.QGTagger_cfi') +process.QGTagger.srcJets = cms.InputTag('ak4PFJetsCHS') # Could be reco::PFJetCollection or pat::JetCollection (both AOD and miniAOD) +process.QGTagger.jetsLabel = cms.string('QGL_AK4PFchs') # Other options: see https://twiki.cern.ch/twiki/bin/viewauth/CMS/QGDataBaseVersion -#process.GlobalTag.globaltag = "74X_dataRun2_Prompt_v4" -process.GlobalTag.globaltag = "76X_dataRun2_v5" +process.GlobalTag.globaltag = "80X_dataRun2_ICHEP16_repro_v0" ##-------------------- Import the JEC services ----------------------- process.load('JetMETCorrections.Configuration.DefaultJEC_cff') @@ -51,26 +54,20 @@ #!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! inFiles = cms.untracked.vstring( -#'root://xrootd.unl.edu//store/data/Run2015D/JetHT/AOD/PromptReco-v4/000/258/159/00000/00F952BC-D16B-E511-B784-02163E0144F2.root' -#'root://xrootd.unl.edu//store/data/Run2015D/JetHT/AOD/PromptReco-v3/000/256/630/00000/BC44672C-345F-E511-BEA5-02163E0141FB.root' -#'root://xrootd.unl.edu//store/data/Run2015C/JetHT/AOD/PromptReco-v1/000/253/890/00000/24D029CE-2741-E511-B0AF-02163E014604.root' -#'root://xrootd.unl.edu//store/data/Run2015D/JetHT/AOD/PromptReco-v3/000/256/674/00000/36D872F3-F95E-E511-870B-02163E013539.root' -#'root://xrootd.unl.edu//store/data/Run2015D/JetHT/AOD/PromptReco-v3/000/256/729/00000/5C1F5529-F65F-E511-9B8C-02163E0145D9.root' -'file:2E97A695-7DA8-E511-AB7C-001D09FDD6AB.root' +'file:FC972EB3-D819-E611-94F9-02163E0134F4.root' ) -process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(100)) +process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(10000)) process.source = cms.Source("PoolSource", fileNames = inFiles ) def jetToolbox( proc, jetType, jetSequence,PUMethod='', bTagDiscriminators = None): JETCorrPayload='None' JETCorrLevels = [ 'None' ] - bTagDiscriminators = ['trackCountingHighEffBJetTags','trackCountingHighPurBJetTags','pfTrackCountingHighEffBJetTags','pfTrackCountingHighPurBJetTags','softPFMuonByIP3dBJetTags','softPFElectronByIP3dBJetTags','softPFMuonBJetTags','softPFElectronBJetTags','simpleSecondaryVertexHighEffBJetTags','simpleSecondaryVertexHighPurBJetTags','pfSimpleSecondaryVertexHighEffBJetTags','pfSimpleSecondaryVertexHighPurBJetTags','combinedSecondaryVertexBJetTags','pfCombinedSecondaryVertexSoftLeptonBJetTags','pfPositiveCombinedSecondaryVertexBJetTags','pfNegativeCombinedSecondaryVertexBJetTags','pfCombinedInclusiveSecondaryVertexV2BJetTags','pfCombinedMVAV2BJetTags','pfJetProbabilityBJetTags'] -#,'pfCombinedInclusiveSecondaryVertexBJetTags' + bTagDiscriminators = ['trackCountingHighEffBJetTags','trackCountingHighPurBJetTags','pfTrackCountingHighEffBJetTags','pfTrackCountingHighPurBJetTags','softPFMuonByIP3dBJetTags','softPFElectronByIP3dBJetTags','softPFMuonBJetTags','softPFElectronBJetTags','simpleSecondaryVertexHighEffBJetTags','simpleSecondaryVertexHighPurBJetTags','pfSimpleSecondaryVertexHighEffBJetTags','pfSimpleSecondaryVertexHighPurBJetTags','combinedSecondaryVertexV2BJetTags','pfCombinedSecondaryVertexV2BJetTags','pfCombinedInclusiveSecondaryVertexV2BJetTags','pfCombinedMVAV2BJetTags','pfPositiveCombinedSecondaryVertexV2BJetTags','pfNegativeCombinedSecondaryVertexV2BJetTags','pfCombinedInclusiveSecondaryVertexV2BJetTags','pfCombinedMVAV2BJetTags','pfJetProbabilityBJetTags'] #GetJetMCFlavour = ['True'] - #JECLevels = [ 'L1Offset', 'L1FastJet', 'L1JPTOffset', 'L2Relative', 'L3Absolute', 'L5Falvour', 'L7Parton' ] + #JECLevels = [ 'L1Offset', 'L1FastJet', 'L1JPTOffset', 'L2Relative', 'L3Absolute', 'L5Falvour', 'L7Parton' ] algorithm='AntiKt' # CambridgeAachen' , 'Kt' size = jetType[-1:] #[-1:] takes the last char from string 'akX' @@ -98,7 +95,7 @@ def jetToolbox( proc, jetType, jetSequence,PUMethod='', bTagDiscriminators = Non toolsUsed = [] proc.load('RecoJets.Configuration.GenJetParticles_cff') - setattr( proc, jetalgo+'GenJetsNoNu', ak4GenJets.clone( src = 'genParticlesForJetsNoNu', rParam = jetSize, jetAlgorithm = algorithm ) ) + setattr( proc, jetalgo+'GenJetsNoNu', ak4GenJets.clone( src = 'genParticlesForJetsNoNu', rParam = jetSize, jetAlgorithm = algorithm ) ) jetSeq += getattr(proc, jetalgo+'GenJetsNoNu' ) proc.load('CommonTools.ParticleFlow.pfNoPileUpJME_cff') @@ -126,7 +123,6 @@ def jetToolbox( proc, jetType, jetSequence,PUMethod='', bTagDiscriminators = Non jetSeq += getattr(proc, jetalgo+'PFJets' ) PUMethod='' - addJetCollection( proc, labelName = jetALGO+'PF'+PUMethod, @@ -140,37 +136,34 @@ def jetToolbox( proc, jetType, jetSequence,PUMethod='', bTagDiscriminators = Non genJetCollection = cms.InputTag( jetalgo+'GenJetsNoNu'), pvSource = cms.InputTag( 'offlinePrimaryVertices' ), #'offlineSlimmedPrimaryVertices'), jetTrackAssociation = True, + ) + + getattr(proc,'patJetPartons').particles = cms.InputTag( 'genParticles' ) #'prunedGenParticles') + + QGjetsLabel='chs' + setattr( proc, 'QGTagger'+jetALGO+'PF'+PUMethod, + QGTagger.clone( + srcJets = cms.InputTag(jetalgo+'PFJets'+PUMethod), # Could be reco::PFJetCollection or pat::JetCollection (both AOD and miniAOD) + jetsLabel = cms.string('QGL_AK4PF'+QGjetsLabel) # Other options (might need to add an ESSource for it): see https://twiki.cern.ch/twiki/bin/viewauth/CMS/QGDataBaseVersion ) + ) + elemToKeep += [ 'keep *_QGTagger'+jetALGO+'PF'+PUMethod+'_*_*' ] + getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod).userData.userFloats.src += ['QGTagger'+jetALGO+'PF'+PUMethod+':qgLikelihood'] + jetSeq += getattr(proc, 'QGTagger'+jetALGO+'PF'+PUMethod ) - #setattr( proc, jetALGO+'PF'+PUMethod+'pileupJetIdCalculator', -# pileupJetIdCalculator.clone( -# jets = cms.InputTag(jetalgo+'PFJets'+PUMethod), -# rho = cms.InputTag("fixedGridRhoFastjetAll"), -# vertexes = cms.InputTag('offlinePrimaryVertices'), -# applyJec = cms.bool(True), -# inputIsCorrected = cms.bool(False) -# )) - -# setattr( proc, jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator', -# pileupJetIdEvaluator.clone( -# jetids = cms.InputTag(jetALGO+'PF'+PUMethod+'pileupJetIdCalculator'), -# jets = cms.InputTag(jetalgo+'PFJets'+PUMethod), -# rho = cms.InputTag("fixedGridRhoFastjetAll"), -# vertexes = cms.InputTag('offlinePrimaryVertices'), -# applyJec = cms.bool(True), -# inputIsCorrected = cms.bool(False) -# -# ) -# ) - - #getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod).userData.userFloats.src += [jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator:fullDiscriminant'] - #getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod).userData.userInts.src += [jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator:cutbasedId',jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator:fullId'] + toolsUsed.append( 'QGTagger'+jetALGO+'PF'+PUMethod ) + + #getattr( proc, 'selectedPatJets').userData.userFloats.src += ['QGTagger:qgLikelihood'] + #setattr(proc, 'selectedPatJets'+jetALGO+'PF'+PUMethod, selectedPatJets.clone( src = 'patJets'+jetALGO+'PF'+PUMethod ) ) + #jetSeq += getattr(proc, 'QGTagger') - getattr(proc,'patJetPartons').particles = cms.InputTag( 'genParticles' ) #'prunedGenParticles') - setattr(proc, 'selectedPatJets'+jetALGO+'PF'+PUMethod, selectedPatJets.clone( src = 'patJets'+jetALGO+'PF'+PUMethod ) ) setattr(proc, jetSequence, jetSeq) + + + + jetToolbox( process, 'ak4', 'ak4JetSubs') jetToolbox( process, 'ak4', 'ak4JetSubs','CHS') @@ -195,10 +188,13 @@ def jetToolbox( proc, jetType, jetSequence,PUMethod='', bTagDiscriminators = Non process.patJets.addTagInfos = True process.patJets.addAssociatedTracks = True +#process.out.outputCommands += ['keep *_QGTagger_*_*'] +process.load("PhysicsTools.PatAlgos.patSequences_cff") + process.ak4 = cms.EDAnalyzer('ProcessedTreeProducerBTag', ## jet collections ########################### - pfjets = cms.InputTag('selectedPatJetsAK4PF'), - pfjetschs = cms.InputTag('selectedPatJetsAK4PFCHS'), + pfjets = cms.InputTag('slimmedJets'), + pfjetschs = cms.InputTag('slimmedJets'), pfpujetid = cms.string('AK4PFpileupJetIdEvaluator:fullDiscriminant'), pfchsjetpuid = cms.string('AK4PFCHSpileupJetIdEvaluator:fullDiscriminant'), ## MET collection #### @@ -212,7 +208,7 @@ def jetToolbox( proc, jetType, jetSequence,PUMethod='', bTagDiscriminators = Non jecUncSrcNames = cms.vstring(''), ## set the conditions for good Vtx counting ## offlineVertices = cms.InputTag('offlinePrimaryVertices'), - beamSpot = cms.InputTag('offlineBeamSpot'), + beamSpot = cms.InputTag('offlineBeamSpot'), goodVtxNdof = cms.double(4), goodVtxZ = cms.double(24), ## rho ####################################### @@ -227,18 +223,20 @@ def jetToolbox( proc, jetType, jetSequence,PUMethod='', bTagDiscriminators = Non minJJMass = cms.double(-1), isMCarlo = cms.untracked.bool(False), useGenInfo = cms.untracked.bool(False), + AK4 = cms.untracked.bool(True), ## trigger ################################### printTriggerMenu = cms.untracked.bool(True), processName = cms.string('HLT'), - triggerName = cms.vstring('HLT_PFJet40_v3','HLT_PFJet60_v3', 'HLT_PFJet80_v3', 'HLT_PFJet140_v3', 'HLT_PFJet200_v3', 'HLT_PFJet260_v3','HLT_PFJet320_v3', 'HLT_PFJet400_v3', 'HLT_PFJet450_v3','HLT_PFJet500_v3','HLT_PFHT600_v3','HLT_PFHT650_v3','HLT_PFHT800_v2','HLT_PFHT200_v2','HLT_PFHT250_v2','HLT_PFHT300_v2','HLT_PFHT350_v3','HLT_PFHT400_v2','HLT_PFHT475_v2','HLT_ZeroBias_v2','HLT_AK4PFJet30_v3','HLT_AK4PFJet50_v3','HLT_AK4PFJet80_v3','HLT_AK4PFJet100_v3','HLT_PFJet40_v4','HLT_PFJet60_v4', 'HLT_PFJet80_v4', 'HLT_PFJet140_v4', 'HLT_PFJet200_v4', 'HLT_PFJet260_v4','HLT_PFJet320_v4', 'HLT_PFJet400_v4', 'HLT_PFJet450_v4','HLT_PFJet500_v4'), + triggerName = cms.vstring('HLT_PFJet40_v6','HLT_PFJet60_v6', 'HLT_PFJet80_v6', 'HLT_PFJet140_v6', 'HLT_PFJet200_v6', 'HLT_PFJet260_v6','HLT_PFJet320_v6', 'HLT_PFJet400_v6', 'HLT_PFJet450_v6','HLT_PFJet500_v6','HLT_PFJet40_v5','HLT_PFJet60_v5', 'HLT_PFJet80_v5', 'HLT_PFJet140_v5', 'HLT_PFJet200_v5', 'HLT_PFJet260_v5','HLT_PFJet320_v5', 'HLT_PFJet400_v5', 'HLT_PFJet450_v5','HLT_PFJet500_v5','HLT_PFJet40_v4','HLT_PFJet60_v4', 'HLT_PFJet80_v4', 'HLT_PFJet140_v4','HLT_PFJet200_v4','HLT_PFJet260_v4','HLT_PFJet320_v4','HLT_PFJet400_v4','HLT_PFJet450_v4','HLT_PFJet500_v4','HLT_PFHT125_v2','HLT_PFHT200_v2','HLT_PFHT250_v2','HLT_PFHT300_v2','HLT_PFHT350_v2','HLT_PFHT400_v2','HLT_PFHT475_v2','HLT_PFHT600_v2','HLT_PFHT650_v2','HLT_PFHT800_v2','HLT_PFHT900_v2','HLT_PFHT125_v3','HLT_PFHT200_v3','HLT_PFHT250_v3','HLT_PFHT300_v3','HLT_PFHT350_v3','HLT_PFHT400_v3','HLT_PFHT475_v3','HLT_PFHT600_v3','HLT_PFHT650_v3','HLT_PFHT800_v3','HLT_PFHT900_v3','HLT_PFHT125_v4','HLT_PFHT200_v4','HLT_PFHT250_v4','HLT_PFHT300_v4','HLT_PFHT350_v4','HLT_PFHT400_v4','HLT_PFHT475_v4','HLT_PFHT600_v4','HLT_PFHT650_v4','HLT_PFHT800_v4','HLT_PFHT900_v4','HLT_PFHT125_v5','HLT_PFHT200_v5','HLT_PFHT250_v5','HLT_PFHT300_v5','HLT_PFHT350_v5','HLT_PFHT400_v5','HLT_PFHT475_v5','HLT_PFHT600_v5','HLT_PFHT650_v5','HLT_PFHT800_v5','HLT_PFHT900_v5','HLT_PFHT125_v1','HLT_PFHT200_v1','HLT_PFHT250_v1','HLT_PFHT300_v1','HLT_PFHT350_v1','HLT_PFHT400_v1','HLT_PFHT475_v1','HLT_PFHT600_v1','HLT_PFHT650_v1','HLT_PFHT800_v1','HLT_PFHT900_v1','HLT_AK8PFJet40_v1','HLT_AK8PFJet60_v1','HLT_AK8PFJet80_v1','HLT_AK8PFJet140_v1','HLT_AK8PFJet200_v1','HLT_AK8PFJet260_v1','HLT_AK8PFJet320_v1','HLT_AK8PFJet400_v1','HLT_AK8PFJet450_v1','HLT_AK8PFJet500_v1','HLT_AK8PFJet40_v2','HLT_AK8PFJet60_v2','HLT_AK8PFJet80_v2','HLT_AK8PFJet140_v2','HLT_AK8PFJet200_v2','HLT_AK8PFJet260_v2','HLT_AK8PFJet320_v2','HLT_AK8PFJet400_v2','HLT_AK8PFJet450_v2','HLT_AK8PFJet500_v2'), triggerResults = cms.InputTag("TriggerResults","","HLT"), triggerEvent = cms.InputTag("hltTriggerSummaryAOD","","HLT"), ## jec services ############################## #new tokens EventInfo = cms.InputTag("generator"), - GenParticles = cms.InputTag("genparticles"), - HBHENoiseFilterResultLabel = cms.InputTag("HBHENoiseFilterResultProducer", "HBHENoiseFilterResult"), - HBHENoiseFilterResultNoMinZLabel = cms.InputTag("HBHENoiseFilterResultProducerNoMinZ", "HBHENoiseFilterResult"), + GenParticles = cms.InputTag("genparticles"), + HBHENoiseFilterResultLabel = cms.InputTag("HBHENoiseFilterResultProducer", "HBHENoiseFilterResult"), + HBHENoiseFilterResultNoMinZLabel = cms.InputTag("HBHENoiseFilterResultProducerNoMinZ", "HBHENoiseFilterResult"), + jetFlavourInfos = cms.InputTag("genJetFlavourInfos"), #pfjecService = cms.string('ak7PFL1FastL2L3Residual'), ) @@ -252,6 +250,7 @@ def jetToolbox( proc, jetType, jetSequence,PUMethod='', bTagDiscriminators = Non pfchsjetpuid = cms.string('AK8PFCHSpileupJetIdEvaluator:fullDiscriminant'), PFPayloadName = cms.string('AK8PF'), PFPayloadNameCHS= cms.string('AK8PFchs'), + AK4 = cms.untracked.bool(False), ) jetToolbox( process, 'ak7', 'ak7JetSubs','CHS') @@ -264,6 +263,7 @@ def jetToolbox( proc, jetType, jetSequence,PUMethod='', bTagDiscriminators = Non pfchsjetpuid = cms.string('AK7PFCHSpileupJetIdEvaluator:fullDiscriminant'), PFPayloadName = cms.string('AK7PF'), PFPayloadNameCHS= cms.string('AK7PFchs'), + AK4 = cms.untracked.bool(False), ) jetToolbox( process, 'ak5', 'ak5JetSubs','CHS') @@ -276,12 +276,13 @@ def jetToolbox( proc, jetType, jetSequence,PUMethod='', bTagDiscriminators = Non pfchsjetpuid = cms.string('AK5PFCHSpileupJetIdEvaluator:fullDiscriminant'), PFPayloadName = cms.string('AK5PF'), PFPayloadNameCHS= cms.string('AK5PFchs'), + AK4 = cms.untracked.bool(False), ) ############# hlt filter ######################### process.hltFilter = cms.EDFilter('HLTHighLevel', TriggerResultsTag = cms.InputTag('TriggerResults','','HLT'), - HLTPaths = cms.vstring('HLT_PFJet40_v3','HLT_PFJet60_v3', 'HLT_PFJet80_v3', 'HLT_PFJet140_v3', 'HLT_PFJet200_v3', 'HLT_PFJet260_v3','HLT_PFJet320_v3', 'HLT_PFJet400_v3', 'HLT_PFJet450_v3','HLT_PFJet500_v3','HLT_PFHT600_v3','HLT_PFHT650_v3','HLT_PFHT800_v2','HLT_PFHT200_v2','HLT_PFHT250_v2','HLT_PFHT300_v2','HLT_PFHT350_v3','HLT_PFHT400_v2','HLT_PFHT475_v2','HLT_ZeroBias_v2','HLT_AK4PFJet30_v3','HLT_AK4PFJet50_v3','HLT_AK4PFJet80_v3','HLT_AK4PFJet100_v3','HLT_PFJet40_v4','HLT_PFJet60_v4', 'HLT_PFJet80_v4', 'HLT_PFJet140_v4', 'HLT_PFJet200_v4', 'HLT_PFJet260_v4','HLT_PFJet320_v4', 'HLT_PFJet400_v4', 'HLT_PFJet450_v4','HLT_PFJet500_v4'), + HLTPaths = cms.vstring('HLT_PFJet40_v6','HLT_PFJet60_v6', 'HLT_PFJet80_v6', 'HLT_PFJet140_v6', 'HLT_PFJet200_v6', 'HLT_PFJet260_v6','HLT_PFJet320_v6', 'HLT_PFJet400_v6', 'HLT_PFJet450_v6','HLT_PFJet500_v6','HLT_PFJet40_v5','HLT_PFJet60_v5', 'HLT_PFJet80_v5', 'HLT_PFJet140_v5', 'HLT_PFJet200_v5', 'HLT_PFJet260_v5','HLT_PFJet320_v5', 'HLT_PFJet400_v5', 'HLT_PFJet450_v5','HLT_PFJet500_v5','HLT_PFJet40_v4','HLT_PFJet60_v4', 'HLT_PFJet80_v4', 'HLT_PFJet140_v4','HLT_PFJet200_v4','HLT_PFJet260_v4','HLT_PFJet320_v4','HLT_PFJet400_v4','HLT_PFJet450_v4','HLT_PFJet500_v4','HLT_PFHT125_v2','HLT_PFHT200_v2','HLT_PFHT250_v2','HLT_PFHT300_v2','HLT_PFHT350_v2','HLT_PFHT400_v2','HLT_PFHT475_v2','HLT_PFHT600_v2','HLT_PFHT650_v2','HLT_PFHT800_v2','HLT_PFHT900_v2','HLT_PFHT125_v3','HLT_PFHT200_v3','HLT_PFHT250_v3','HLT_PFHT300_v3','HLT_PFHT350_v3','HLT_PFHT400_v3','HLT_PFHT475_v3','HLT_PFHT600_v3','HLT_PFHT650_v3','HLT_PFHT800_v3','HLT_PFHT900_v3','HLT_PFHT125_v4','HLT_PFHT200_v4','HLT_PFHT250_v4','HLT_PFHT300_v4','HLT_PFHT350_v4','HLT_PFHT400_v4','HLT_PFHT475_v4','HLT_PFHT600_v4','HLT_PFHT650_v4','HLT_PFHT800_v4','HLT_PFHT900_v4','HLT_PFHT125_v5','HLT_PFHT200_v5','HLT_PFHT250_v5','HLT_PFHT300_v5','HLT_PFHT350_v5','HLT_PFHT400_v5','HLT_PFHT475_v5','HLT_PFHT600_v5','HLT_PFHT650_v5','HLT_PFHT800_v5','HLT_PFHT900_v5','HLT_AK8PFJet40_v1','HLT_AK8PFJet60_v1','HLT_AK8PFJet80_v1','HLT_AK8PFJet140_v1','HLT_AK8PFJet200_v1','HLT_AK8PFJet260_v1','HLT_AK8PFJet320_v1','HLT_AK8PFJet400_v1','HLT_AK8PFJet450_v1','HLT_AK8PFJet500_v1','HLT_AK8PFJet40_v2','HLT_AK8PFJet60_v2','HLT_AK8PFJet80_v2','HLT_AK8PFJet140_v2','HLT_AK8PFJet200_v2','HLT_AK8PFJet260_v2','HLT_AK8PFJet320_v2','HLT_AK8PFJet400_v2','HLT_AK8PFJet450_v2','HLT_AK8PFJet500_v2','HLT_PFHT125_v1','HLT_PFHT200_v1','HLT_PFHT250_v1','HLT_PFHT300_v1','HLT_PFHT350_v1','HLT_PFHT400_v1','HLT_PFHT475_v1','HLT_PFHT600_v1','HLT_PFHT650_v1','HLT_PFHT800_v1','HLT_PFHT900_v1'), eventSetupPathsKey = cms.string(''), andOr = cms.bool(True), #----- True = OR, False = AND between the HLTPaths throw = cms.bool(False) @@ -290,29 +291,37 @@ def jetToolbox( proc, jetType, jetSequence,PUMethod='', bTagDiscriminators = Non ##MET Filters process.load('RecoMET.METFilters.CSCTightHaloFilter_cfi') process.load('CommonTools.RecoAlgos.HBHENoiseFilterResultProducer_cfi') +process.load('CommonTools.RecoAlgos.HBHENoiseFilter_cfi') process.HBHENoiseFilterResultProducerNoMinZ = process.HBHENoiseFilterResultProducer.clone(minZeros = cms.int32(99999)) - process.goodVertices = cms.EDFilter("VertexSelector", filter = cms.bool(False), src = cms.InputTag("offlinePrimaryVertices"), cut = cms.string("!isFake && ndof >= 4 && abs(z) <= 24 && position.rho <= 2"), ) + process.load('RecoMET.METFilters.trackingFailureFilter_cfi') +process.load('RecoMET.METFilters.EcalDeadCellTriggerPrimitiveFilter_cfi') +process.load('RecoMET.METFilters.eeBadScFilter_cfi') +process.load('RecoMET.METFilters.BadChargedCandidateFilter_cfi') +process.load('RecoMET.METFilters.BadPFMuonFilter_cfi') +process.load('RecoMET.METFilters.globalTightHalo2016Filter_cfi') + +process.allMetFilterPaths=cms.Sequence(process.HBHENoiseFilter*process.HBHENoiseIsoFilter*process.EcalDeadCellTriggerPrimitiveFilter*process.eeBadScFilter*process.BadPFMuonFilter*process.BadChargedCandidateFilter*process.globalTightHalo2016Filter) ##Type1 patMET Producer process.load('PhysicsTools.PatAlgos.recoLayer0.metCorrections_cff') process.load('PhysicsTools.PatAlgos.producersLayer1.metProducer_cfi') process.patMETs.addGenMET = cms.bool(False) + #Try scheduled processs process.path = cms.Path(process.goodVertices*process.trackingFailureFilter* process.hltFilter* process.HBHENoiseFilterResultProducer* - process.HBHENoiseFilterResultProducerNoMinZ* - process.patMETCorrections*process.patMETs#process.patDefaultSequence* - #*process.ak4 *process.ak5*process.ak7*process.ak8) - *process.ak4*process.ak7) + process.HBHENoiseFilterResultProducerNoMinZ*process.allMetFilterPaths* + process.patMETCorrections*process.patMETs + *process.QGTagger*process.ak4*process.ak7) #!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! diff --git a/AnalysisFW/test/ProcessedTreeProducer_dataPAT25ns_BTag_cfg.pyc b/AnalysisFW/test/ProcessedTreeProducer_dataPAT25ns_BTag_cfg.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e688f23eeb81d94996faddd07c5ae2123e198978 GIT binary patch literal 13410 zcmds7d3Y38a<7>Y0t5mK2!V}lVFQaX=oS*J!4^6Zk~|&>dsjIot*IWVMQeII-6N1A zvdPME?)yGB*<^Fy_kG{@eQ)k-b0?eopUto8b+@KxB&>YEo*q=X7e46aH5I;_@W1%mQjsNY$PY^#z zn;9_Iz}!KbP4T>m3{3ecRqh#DxkxL|QvOn;>r>htTK2R6V(w+icSaOv4TV{fa|Y13wdi7ZrR~K}_W(1usWnr-Be@X1`lO3;_`H25G&D z>5J(56bD+&%q;AsVilHgSZu_&hZnu3u0RwaHe0yf%rp+Ka}{xh(DY-Py7+Y7V#o+ftZPH z;v(@9@iMVPyh41J*d<;iE)jdgW#U(fE5tr=KwKqWBfdv`pLm`4HR6vX-XMNJ{87a3 zApU6Lk0E|1@h0)>#2-ui2Jy!ce?0Lg5Pu@^ClP-#@uv`fD)FZge>(AJ5Pv4|XAyrk z@#heKF7f9Pe?IXS5Pu=@7ZHCk@s|*PDe=3Azl`|HiQi596~tdj{2t=3BK~UPuOa?g z;;$qAdg5;&{zl?&BK~ILZz29x;%_7VcH-|K{!ZfWBK~gT?;-wP;_oB=e&Qb>{z2j& zBK~38#3cNPPU9)!AC=7}bDJUlu?YF&HOQZckUy#O|5Fk8(+d7f1pX}X&*?7u`3Un1 z5#|>o%r6PcX6mds4IBjH6@HocS19rdH7Io)IM;);GE{S9e^rN#kL<507$4bRS1>-Z zzoB4!B7alC_(cAeg0*{4_vt3>6$Nn?jW)kc{5y3DDryG>e^;f(3jUsgv4X#^V65OD zC>SgFUIk+X|4_l56ohv$3jPuCAJ-|Us2vpi6O|e(_@@fS3jUdbv4VfDV65O@C>SgF zmkREr;9GUwpCkS&;=hjeK<$2epCUW{zn|p~;;6oPGe5)Tr_KBfnxAWQ92SW_@lE&?@qekpxD}&uLz5?J@H(k7<^<&@CBmJ%@ZSh| zoe$vO?1eO%!G3&Mcl)#BQ+D772Wz2`$+-(Dp+SHwG!u47hz#xsaC6l~AhK4)TD1ea z67~qoMMHELP2YCyLSS>&3bwfSq2r~Ad24COuBZyLLAC5UuR+Kybd7kWqO(-3Sb^h} zI_Cnb#8!pp>{qLHsbKq^;}x$IICcee>z0m#vtYrXkGvFJbBAZ={T zE(Kr=@Y7ifD1C1OedFj8wg-DF>p8pNjowtYfnBi8SW6{4a0=s&?Q*_vXkIxlf>Q*^ z+;k@GHuH_?1(R$0N`8K4a*+})k&<4jC6#rmcw8-DhCAmgR^e`9<-p+RT*ay+7_yFQ zSIa=%8r9VnT^wI@$u6(^PQjn|JlF5U5)Zpep5Ixvf_Sl1m#22rCE5idF{ist_TWns z)A`}s*p-E4KR5%#Q1{#NYz0=XTI$WilGSpMzcn&BmhHJRH8zr8>-IZA1r2A$=106r z1zS$GMcs^!+C{7C2ErkmLs*J1?b`Ur)xqAen|+r@hkCAF9=p=hbNOoj_|?nZy**d@ z#=3j@`p5e_E1nkwd%)t9%GJO@f@e-f7PilM)k?wEoh$-paUlEv1XK`)M0}X|2=ODtMrr~KQvX53UEoX_(Np1wCkREO9 zg}jW!4;zPMMYhP1Ck#F~6v@;4DFvI5L)}eNr6s*3`yyl?P}vEo=?1AF45cQS4=VGs z6kw$iA{rIj5>a}CwxnFztqLG)P+^OCS1N3Yka^Egpp(RxW%0w6ZRbvs#X78W4+hx` z*hSo>h;G`zmNS<2&<3pT4avDrZba^nzySrX)Cj{u3dLYVF{Bh%W$rdp2U2EKz9v|+ zoN`5{DUV(996dM|&KX}9ZKI9Y9z3EeaHD3N8l|6CG>**+v~f&_-z2lR*!IH-L41?i zaV!UMAi~i{68+F*XhJ7!<){xQM?)JXu`GIII4A;q!F+<74C?%2$1au zKQnh>44z{a6N7ILm&j=}0&(IaUKJN%X=&0~S{^GFZ^8lM3iP)p$W|*c!4r^BF6u?F zlZ+imYNd!%^Sxq_9iORsrJL)wvV9y6AxfIgF^K?hW!DiLjR}-H()~n?j`^alv(n|P zmR)-emz@L!>n|gKu{Vr%a{05 zW7+B6ob9ST2J9PN^gXv4*c$&%_fGfaY~SIk<>p!;%KzWRXt+p-!a!`+o2}yZgp5id zkY!o2OL0Iq?p2_XuQW0<6^*S_2bd|5lv=67W1&{PQWR#Hh;ZEX?sb-nvz~-!cgj;U zV-nTqa0uPiZWGoEB!;jzT(K>g3CIs*$S~}eB*3*6ZC3&pWduPO)5!eGj0bXD7Xxc) z)bR@yXVocLfmiWyb>OTc}%!WuvLOQIE#<8L`?r}`XS~!B711H+m zF;`+sI@l9|q#T&PDH+Tamx2gSC6yyd;yS!y(Z#vTLdDQMDDyFNK~42|!@lno98E4% zwc16|i9-B}QDmVIL+XSg4$aAg!8_|>qT7!q%Ac00Qz(vGeMx=p+IG3)Vm=CSbt~sD z<}a!cGluWW!d!cGY1+AKyUw!b@deo@8fX?>&oUurwOodulUNe7hn8-s!2A|geVv6U z;?`>doNRQp1IVc4G}#jY1y^nmF=Hw0LX%ABEo(hrsoFZ#7IWiN-;&rDSBzR4EonG4 zGCzJ$!6{aKs=i$rMaZsaOaQFB75F(hO}hCk7**m65*@3~a`aU(S*P`~tp^G1*f7~O z**i0Kub!RwtE&rvbVBVhsv;0c9&@uhWWvj9TkRlh%h3xYd%EM>tQNmC0YPR@T|g)4 zm;X9iT~^WWLIzjrEG&23^D1|{%3b9pI8NJjyCgFjE?F+}F~4hMW^V44{7}9--_w`J zPAe?;bioC6&CO(|x+1FaSGweIcEMAt%jNlsjdNqNM9sFc!}GlZNUm>Up5a@TI?L<2 znzBI9dC|K+47L1sikj)>)c(}ip5|0b>UioPKF#TK>659W>BG&<0+~;`HFYV~o^DMa zOr4is@JLTf>d{ORZU=t`J%>_gg`dNz!>MEV+naeT-JEU%Z+oge^LXld>dEw}W?c)E zDO5xJPGRR%7yX=Md77(^zXB&^ch2B?v6k#>3+jJ$aqj&{zj ztihuwsoe9U!}G(Ek!~}Ey_z%ngP__WPmWUZX=~lC^hn+u`#+QKKffcdsjI*RhP*X( zmZXf}l*rglL0MMax#gm4xj;^0jTlUzuSvK$>`Ei~xcH~-$f8T9Tr5{1&tbi}R6-dO zX9@^Bwr06ixjL>DtFF6sdP_lgZ(s;;m#g5vjFFTdqIV}kJY2bmOH2mAhzLt8-*mZ?M`9Yl>7h1VOx2KJyX73m;CbNb+!qkRt zm5QD^(pBsJ+fh!Cf5%_YiASV>2@D+d^Wr{%m^FcilLDyY12=)tDA3siFf}z}`Q~18 z{FxD}0zHKn_Xy~8G`Rz@2zpnQaqHl2cjQRV*rlpE(z4m}x}ZWlIX$mW4h^x2}u)XQ!Zo6J>Lr7AJ};;05XN}|Dx1d)hPZ9MYyDjGye zI21kli>efH!mT0Q+2gX-+jU3jUC_1@MbNQR&loreY zQnPvJ0ESpEXN2A3uC<0oWMZnXOATA6>d+FRS$BuR^lb>;lD=)9l;9w3pN60VL3fyV z0N7R55at<%cUK%*iqZ3|(W|y37ce#qhBgd7)P}*GY(U4B4FGnfQD}qV-4#b@gQ#Kh z8ML-+7zk|`c&H5nJK2DaEgJyrN~6#Q!@Dbv&<0V%*npPUAjc5CP96(r$wysL@~BGg zD?A{}S^;>(r=UDkLcIwuBPi~+y{;pmlKG-3zXi(`@1Fk*Naaa6lFLr~ne&H-&2uC3 z7%`YcR%LKnC6N5TwxA%Krl9c96C}K$+R|2KYeh=HQt$UFIvY}) z3C`kc`%R}zW_vN8o;%`c22@xIp4xG`qGG>lDhE?* zAXs0i51OKsY3HUzhU}r-P5GLauMvD{WDvj3q|lPS+!TamcRccyXTK;HOHp|(EV)bD zDZ%Zaq$_2iEcU!QFH}bQdQDx$x~~z3uX{dx`XV~|`ua*vTuaWymp%kZ)Jat&O3&tP zt?_$zb9Nb?N9!pSZ9;NoT~AkSnN%GZe3QNslgr8gV={o8TojMsgiTB!k7oc!PiAb? zqG6)1m(bX#R;=-InCi`5b4UMq24s6?pWjJlo8lvT{5q% zFDIF&EH0kt+$s5mWt*$6jko;qZ|m#-PTgPb%I8+$k6rtQ_#^)yChchYMCu4WE#U{P zbW28{Bh9G%H?^kfKAF~3TdJ+;V5YTse`=M^>5VAy~ baJPv)=`$H4t1aCMYoK$wxp}tvZ0dgiPBzJ; literal 0 HcmV?d00001 diff --git a/AnalysisFW/test/Spring16_25nsV9p2_DATA_L2L3Residual_AK8PFchs.txt b/AnalysisFW/test/Spring16_25nsV9p2_DATA_L2L3Residual_AK8PFchs.txt new file mode 100644 index 00000000000..759f96655e9 --- /dev/null +++ b/AnalysisFW/test/Spring16_25nsV9p2_DATA_L2L3Residual_AK8PFchs.txt @@ -0,0 +1,37 @@ +{ 1 JetEta 1 JetPt [2]*([3]*([4]+[5]*TMath::Log(max([0],min([1],x))))*1./([6]+[7]*100./3.*(TMath::Max(0.,1.03091-0.051154*pow(x,-0.154227))-TMath::Max(0.,1.03091-0.051154*TMath::Power(208.,-0.154227)))+[8]*((1+0.04432-1.304*pow(max(30.,min(6500.,x)),-0.4624)+(0+1.724*TMath::Log(max(30.,min(6500.,x))))/x)-(1+0.04432-1.304*pow(208.,-0.4624)+(0+1.724*TMath::Log(208.))/208.)))) Correction L2Relative} + -5.191 -3.839 11 10 6500 55 240 0.996800 1.000101 1.322001 -0.051859 0.992 -0.031 0 + -3.839 -3.489 11 10 6500 55 380 0.996800 1.000101 1.172906 -0.031481 0.992 -0.031 0 + -3.489 -3.139 11 10 6500 55 640 0.996800 1.000101 1.202572 -0.051945 0.992 -0.031 0 + -3.139 -2.964 11 10 6500 55 760 0.996800 1.000101 1.399289 -0.096722 0.992 -0.031 0 + -2.964 -2.853 11 10 6500 55 670 0.996800 1.000101 1.632535 -0.110592 0.992 -0.031 0 + -2.853 -2.650 11 10 6500 55 710 0.996800 1.000101 1.256777 -0.035855 0.992 -0.031 0 + -2.650 -2.500 11 10 6500 55 900 0.996800 1.000101 1.091728 -0.014777 0.992 -0.031 0 + -2.500 -2.322 11 10 6500 55 1020 0.996800 1.000101 1.063383 -0.011839 0.992 -0.031 0 + -2.322 -2.172 11 10 6500 55 1120 0.996800 1.000101 1.025884 -0.004054 0.992 -0.031 0 + -2.172 -1.930 11 10 6500 55 1400 0.996800 1.000101 1.032040 -0.007101 0.992 -0.031 0 + -1.930 -1.653 11 10 6500 55 1630 0.996800 1.000101 1.021314 -0.005810 0.992 -0.031 0 + -1.653 -1.479 11 10 6500 55 1960 0.996800 1.000101 1.030430 -0.008819 0.992 -0.031 0 + -1.479 -1.305 11 10 6500 55 2120 0.996800 1.000101 1.007190 -0.001887 0.992 -0.031 0 + -1.305 -1.044 11 10 6500 55 2180 0.996800 1.000101 0.995596 0.003583 0.992 -0.031 0 + -1.044 -0.783 11 10 6500 55 2310 0.996800 1.000101 1.007819 -0.000155 0.992 -0.031 0 + -0.783 -0.522 11 10 6500 55 2590 0.996800 1.000101 1.013788 -0.001362 0.992 -0.031 0 + -0.522 -0.261 11 10 6500 55 2950 0.996800 1.000101 0.996912 -0.000148 0.992 -0.031 0 + -0.261 -0.000 11 10 6500 55 2810 0.996800 1.000101 0.982343 0.001198 0.992 -0.031 0 + 0.000 0.261 11 10 6500 55 2810 0.996800 1.000101 0.982343 0.001198 0.992 -0.031 0 + 0.261 0.522 11 10 6500 55 2950 0.996800 1.000101 0.996912 -0.000148 0.992 -0.031 0 + 0.522 0.783 11 10 6500 55 2590 0.996800 1.000101 1.013788 -0.001362 0.992 -0.031 0 + 0.783 1.044 11 10 6500 55 2310 0.996800 1.000101 1.007819 -0.000155 0.992 -0.031 0 + 1.044 1.305 11 10 6500 55 2180 0.996800 1.000101 0.995596 0.003583 0.992 -0.031 0 + 1.305 1.479 11 10 6500 55 2120 0.996800 1.000101 1.007190 -0.001887 0.992 -0.031 0 + 1.479 1.653 11 10 6500 55 1960 0.996800 1.000101 1.030430 -0.008819 0.992 -0.031 0 + 1.653 1.930 11 10 6500 55 1630 0.996800 1.000101 1.021314 -0.005810 0.992 -0.031 0 + 1.930 2.172 11 10 6500 55 1400 0.996800 1.000101 1.032040 -0.007101 0.992 -0.031 0 + 2.172 2.322 11 10 6500 55 1120 0.996800 1.000101 1.025884 -0.004054 0.992 -0.031 0 + 2.322 2.500 11 10 6500 55 1020 0.996800 1.000101 1.063383 -0.011839 0.992 -0.031 0 + 2.500 2.650 11 10 6500 55 900 0.996800 1.000101 1.091728 -0.014777 0.992 -0.031 0 + 2.650 2.853 11 10 6500 55 710 0.996800 1.000101 1.256777 -0.035855 0.992 -0.031 0 + 2.853 2.964 11 10 6500 55 670 0.996800 1.000101 1.632535 -0.110592 0.992 -0.031 0 + 2.964 3.139 11 10 6500 55 760 0.996800 1.000101 1.399289 -0.096722 0.992 -0.031 0 + 3.139 3.489 11 10 6500 55 640 0.996800 1.000101 1.202572 -0.051945 0.992 -0.031 0 + 3.489 3.839 11 10 6500 55 380 0.996800 1.000101 1.172906 -0.031481 0.992 -0.031 0 + 3.839 5.191 11 10 6500 55 240 0.996800 1.000101 1.322001 -0.051859 0.992 -0.031 0 diff --git a/AnalysisFW/test/Test_cfg.py b/AnalysisFW/test/Test_cfg.py new file mode 100644 index 00000000000..8071c01a6f7 --- /dev/null +++ b/AnalysisFW/test/Test_cfg.py @@ -0,0 +1,326 @@ +# -*- coding: utf-8 -*- + +import FWCore.ParameterSet.Config as cms + +from RecoJets.Configuration.RecoPFJets_cff import ak4PFJets, ak4PFJetsCHS +from RecoJets.Configuration.RecoGenJets_cff import ak4GenJets +from RecoJets.JetProducers.SubJetParameters_cfi import SubJetParameters +from RecoJets.JetProducers.PFJetParameters_cfi import * +from RecoJets.JetProducers.GenJetParameters_cfi import * +from RecoJets.JetProducers.AnomalousCellParameters_cfi import * +from PhysicsTools.PatAlgos.producersLayer1.patCandidates_cff import * +from PhysicsTools.PatAlgos.selectionLayer1.jetSelector_cfi import selectedPatJets +from PhysicsTools.PatAlgos.tools.jetTools import * +#from PhysicsTools.PatAlgos.producersLayer1.metProducer_cfi import patMETs +from PhysicsTools.PatAlgos.patSequences_cff import * +#nnfrom PhysicsTools.PatAlgos.tools.metTools import addMETCollection +#from RecoJets.JetProducers.pileupjetidproducer_cfi import * +from PhysicsTools.PatAlgos.patTemplate_cfg import * +from PhysicsTools.PatAlgos.tools.jetTools import * + +## Modified version of jetToolBox from https://github.com/cms-jet/jetToolbox +## Options for PUMethod: Puppi, CS, SK, CHS + +# -*- coding: utf-8 -*- +import FWCore.ParameterSet.Config as cms + +process = cms.Process("Ntuplizer") +#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +#! Conditions +#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_condDBv2_cff") +process.load("Configuration.EventContent.EventContent_cff") +process.load('Configuration.StandardSequences.GeometryRecoDB_cff') +process.load('Configuration.StandardSequences.MagneticField_38T_cff') +process.load('RecoJets.Configuration.GenJetParticles_cff') +process.load('RecoJets.Configuration.RecoGenJets_cff') +process.load('RecoJets.JetProducers.TrackJetParameters_cfi') +process.load('RecoJets.JetProducers.PileupJetIDParams_cfi') +process.load("PhysicsTools.PatAlgos.patSequences_cff") + +#process.load("PhysicsTools.PatAlgos.slimming.pileupJetId_cfi") + +#process.GlobalTag.globaltag = "74X_dataRun2_Prompt_v4" +#process.GlobalTag.globaltag = "76X_dataRun2_v5" +process.GlobalTag.globaltag = '80X_dataRun2_Prompt_v9' + +##-------------------- Import the JEC services ----------------------- +process.load('JetMETCorrections.Configuration.DefaultJEC_cff') + +#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +#! Input +#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +inFiles = cms.untracked.vstring( +#'root://xrootd.unl.edu//store/data/Run2015D/JetHT/AOD/PromptReco-v4/000/258/159/00000/00F952BC-D16B-E511-B784-02163E0144F2.root' +#'root://xrootd.unl.edu//store/data/Run2015D/JetHT/AOD/PromptReco-v3/000/256/630/00000/BC44672C-345F-E511-BEA5-02163E0141FB.root' +#'root://xrootd.unl.edu//store/data/Run2015C/JetHT/AOD/PromptReco-v1/000/253/890/00000/24D029CE-2741-E511-B0AF-02163E014604.root' +#'root://xrootd.unl.edu//store/data/Run2015D/JetHT/AOD/PromptReco-v3/000/256/674/00000/36D872F3-F95E-E511-870B-02163E013539.root' +#'root://xrootd.unl.edu//store/data/Run2015D/JetHT/AOD/PromptReco-v3/000/256/729/00000/5C1F5529-F65F-E511-9B8C-02163E0145D9.root' +#'file:2EE7CEE1-483B-E611-B695-02163E014655.root' +'file:0CF529E9-0445-E611-8317-02163E011F22.root' + ) + +process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(10000)) +process.source = cms.Source("PoolSource", fileNames = inFiles ) + +def jetToolbox( proc, jetType, jetSequence,PUMethod='', bTagDiscriminators = None): + + JETCorrPayload='None' + JETCorrLevels = [ 'None' ] + bTagDiscriminators = ['trackCountingHighEffBJetTags','trackCountingHighPurBJetTags','pfTrackCountingHighEffBJetTags','pfTrackCountingHighPurBJetTags','softPFMuonByIP3dBJetTags','softPFElectronByIP3dBJetTags','softPFMuonBJetTags','softPFElectronBJetTags','simpleSecondaryVertexHighEffBJetTags','simpleSecondaryVertexHighPurBJetTags','pfSimpleSecondaryVertexHighEffBJetTags','pfSimpleSecondaryVertexHighPurBJetTags','combinedSecondaryVertexV2BJetTags','pfCombinedSecondaryVertexV2BJetTags','pfCombinedInclusiveSecondaryVertexV2BJetTags','pfCombinedMVAV2BJetTags','pfPositiveCombinedSecondaryVertexV2BJetTags','pfNegativeCombinedSecondaryVertexV2BJetTags','pfCombinedInclusiveSecondaryVertexV2BJetTags','pfCombinedMVAV2BJetTags','pfJetProbabilityBJetTags'] + + + + #GetJetMCFlavour = ['True'] + #JECLevels = [ 'L1Offset', 'L1FastJet', 'L1JPTOffset', 'L2Relative', 'L3Absolute', 'L5Falvour', 'L7Parton' ] + + algorithm='AntiKt' # CambridgeAachen' , 'Kt' + size = jetType[-1:] #[-1:] takes the last char from string 'akX' + jetSize = float('0.'+jetType[-1:]) + jetALGO = jetType.upper() + jetalgo = jetType.lower() + elemToKeep = [] + + print 'Running processes with: '+str(jetALGO)+' PF '+PUMethod+' jet algorithm with radius parameter '+str(jetSize) + + JETCorrPayload = 'AK'+size+'PF'+PUMethod.lower() + JETCorrLevels = ['L1FastJet', 'L2Relative', 'L3Absolute','L2L3Residual'] + #JETCorrLevels = [] #No JEC corrections + JEC = ( JETCorrPayload, JETCorrLevels , 'None') + + ################################################################################# + ####### Toolbox start + ################################################################################# + + elemToKeep = [] + jetSeq = cms.Sequence() + genParticlesLabel = '' + pvLabel = '' + tvLabel = '' + toolsUsed = [] + + proc.load('RecoJets.Configuration.GenJetParticles_cff') + setattr( proc, jetalgo+'GenJetsNoNu', ak4GenJets.clone( src = 'genParticlesForJetsNoNu', rParam = jetSize, jetAlgorithm = algorithm ) ) + jetSeq += getattr(proc, jetalgo+'GenJetsNoNu' ) + + proc.load('CommonTools.ParticleFlow.pfNoPileUpJME_cff') + #### Creating PATjets + if( PUMethod=='CHS') : + setattr( proc, jetalgo+'PFJetsCHS', ak4PFJets.clone( rParam = jetSize, jetAlgorithm = algorithm ) ) + jetSeq += getattr(proc, jetalgo+'PFJetsCHS' ) + + setattr( proc, jetalgo+'PFJetsCHS', + ak4PFJetsCHS.clone( + doAreaFastjet = True, + rParam = jetSize, + jetAlgorithm = algorithm ) ) + jetSeq += getattr(proc, jetalgo+'PFJetsCHS' ) + + else : + setattr( proc, jetalgo+'PFJets', ak4PFJets.clone( rParam = jetSize, jetAlgorithm = algorithm ) ) + jetSeq += getattr(proc, jetalgo+'PFJets' ) + + setattr( proc, jetalgo+'PFJets', + ak4PFJets.clone( + doAreaFastjet = True, + rParam = jetSize, + jetAlgorithm = algorithm ) ) + jetSeq += getattr(proc, jetalgo+'PFJets' ) + PUMethod='' + + + addJetCollection( + proc, + labelName = jetALGO+'PF'+PUMethod, + jetSource = cms.InputTag( jetalgo+'PFJets'+PUMethod), + algo = jetalgo, + btagDiscriminators = bTagDiscriminators, + rParam = jetSize, + jetCorrections = JEC, #( 'AK'+size+'PFchs', cms.vstring( ['L1FastJet', 'L2Relative', 'L3Absolute']), 'None'), + pfCandidates = cms.InputTag( 'particleFlow' ), #'packedPFCandidates'), + svSource = cms.InputTag('inclusiveCandidateSecondaryVertices'), + genJetCollection = cms.InputTag( jetalgo+'GenJetsNoNu'), + pvSource = cms.InputTag( 'offlinePrimaryVertices' ), #'offlineSlimmedPrimaryVertices'), + jetTrackAssociation = True, + + ) + + #setattr( proc, jetALGO+'PF'+PUMethod+'pileupJetIdCalculator', +# pileupJetIdCalculator.clone( +# jets = cms.InputTag(jetalgo+'PFJets'+PUMethod), +# rho = cms.InputTag("fixedGridRhoFastjetAll"), +# vertexes = cms.InputTag('offlinePrimaryVertices'), +# applyJec = cms.bool(True), +# inputIsCorrected = cms.bool(False) +# )) + +# setattr( proc, jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator', +# pileupJetIdEvaluator.clone( +# jetids = cms.InputTag(jetALGO+'PF'+PUMethod+'pileupJetIdCalculator'), +# jets = cms.InputTag(jetalgo+'PFJets'+PUMethod), +# rho = cms.InputTag("fixedGridRhoFastjetAll"), +# vertexes = cms.InputTag('offlinePrimaryVertices'), +# applyJec = cms.bool(True), +# inputIsCorrected = cms.bool(False) +# +# ) +# ) + + #getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod).userData.userFloats.src += [jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator:fullDiscriminant'] + #getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod).userData.userInts.src += [jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator:cutbasedId',jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator:fullId'] + + getattr(proc,'patJetPartons').particles = cms.InputTag( 'genParticles' ) #'prunedGenParticles') + setattr(proc, 'selectedPatJets'+jetALGO+'PF'+PUMethod, selectedPatJets.clone( src = 'patJets'+jetALGO+'PF'+PUMethod ) ) + setattr(proc, jetSequence, jetSeq) + +jetToolbox( process, 'ak4', 'ak4JetSubs') +jetToolbox( process, 'ak4', 'ak4JetSubs','CHS') + +#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +#! Services +#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +process.load('FWCore.MessageLogger.MessageLogger_cfi') +process.MessageLogger.cerr.FwkReport.reportEvery = 100 +process.load('CommonTools.UtilAlgos.TFileService_cfi') +process.TFileService.fileName=cms.string('DATA_ProcessedTreeProducer_2.root') + +# PAT Layer 1 +#process.load("PhysicsTools.PatAlgos.patLayer0_cff") # need to load this +#process.load("PhysicsTools.PatAlgos.patLayer1_cff") # even if we run only layer 1 + +process.load("PhysicsTools.PatAlgos.producersLayer1.patCandidates_cff") +process.load("PhysicsTools.PatAlgos.selectionLayer1.selectedPatCandidates_cff") +#from PhysicsTools.PatAlgos.tools.metTools import addMETCollection +#addMETCollection(process,'patMETPF','pfMetT1') +#patMETs.addGenMet = cms.bool(False) +#patMETs.genMETSource = cms.InputTag("") +process.patJets.addTagInfos = True +process.patJets.addAssociatedTracks = True + +process.ak4 = cms.EDAnalyzer('ProcessedTreeProducerBTag', + ## jet collections ########################### + pfjets = cms.InputTag('selectedPatJetsAK4PF'), + pfjetschs = cms.InputTag('selectedPatJetsAK4PFCHS'), + pfpujetid = cms.string('AK4PFpileupJetIdEvaluator:fullDiscriminant'), + pfchsjetpuid = cms.string('AK4PFCHSpileupJetIdEvaluator:fullDiscriminant'), + ## MET collection #### + pfmet = cms.InputTag('patMETs'), + genjets = cms.untracked.InputTag('ak4GenJetsNoNu'), + ## database entry for the uncertainties ###### + PFPayloadName = cms.string('AK4PF'), + PFPayloadNameCHS= cms.string('AK4PFchs'), + jecUncSrc = cms.string(''), + jecUncSrcCHS = cms.string(''), + jecUncSrcNames = cms.vstring(''), + ## set the conditions for good Vtx counting ## + offlineVertices = cms.InputTag('offlinePrimaryVertices'), + beamSpot = cms.InputTag('offlineBeamSpot'), + goodVtxNdof = cms.double(4), + goodVtxZ = cms.double(24), + ## rho ####################################### + srcCaloRho = cms.InputTag('fixedGridRhoFastjetAllCalo'), + srcPFRho = cms.InputTag('fixedGridRhoFastjetAll'), + srcPULabel = cms.untracked.InputTag('addPileupInfo','addPileupInfo'), + ## preselection cuts ######################### + maxY = cms.double(5.0), + minPFPt = cms.double(20), + minNPFJets = cms.int32(1), + minGenPt = cms.untracked.double(20), + minJJMass = cms.double(-1), + isMCarlo = cms.untracked.bool(False), + useGenInfo = cms.untracked.bool(False), + ## trigger ################################### + printTriggerMenu = cms.untracked.bool(True), + processName = cms.string('HLT'), + triggerName = cms.vstring('HLT_PFJet40_v6'), + triggerResults = cms.InputTag("TriggerResults","","HLT"), + triggerEvent = cms.InputTag("hltTriggerSummaryAOD","","HLT"), + ## jec services ############################## + #new tokens + EventInfo = cms.InputTag("generator"), + GenParticles = cms.InputTag("genparticles"), + HBHENoiseFilterResultLabel = cms.InputTag("HBHENoiseFilterResultProducer", "HBHENoiseFilterResult"), + HBHENoiseFilterResultNoMinZLabel = cms.InputTag("HBHENoiseFilterResultProducerNoMinZ", "HBHENoiseFilterResult"), + jetFlavourInfos = cms.InputTag("genJetFlavourInfos"), + #pfjecService = cms.string('ak7PFL1FastL2L3Residual'), +) + +jetToolbox( process, 'ak8', 'ak8JetSubs','CHS') +jetToolbox( process, 'ak8', 'ak8JetSubs') + +process.ak8 = process.ak4.clone( + pfjets = cms.InputTag('selectedPatJetsAK8PF'), + pfjetschs = cms.InputTag('selectedPatJetsAK8PFCHS'), + pfpujetid = cms.string('AK8PFpileupJetIdEvaluator:fullDiscriminant'), + pfchsjetpuid = cms.string('AK8PFCHSpileupJetIdEvaluator:fullDiscriminant'), + PFPayloadName = cms.string('AK8PF'), + PFPayloadNameCHS= cms.string('AK8PFchs'), +) + +jetToolbox( process, 'ak7', 'ak7JetSubs','CHS') +jetToolbox( process, 'ak7', 'ak7JetSubs') + +process.ak7 = process.ak4.clone( + pfjets = cms.InputTag('selectedPatJetsAK7PF'), + pfjetschs = cms.InputTag('selectedPatJetsAK7PFCHS'), + pfpujetid = cms.string('AK7PFpileupJetIdEvaluator:fullDiscriminant'), + pfchsjetpuid = cms.string('AK7PFCHSpileupJetIdEvaluator:fullDiscriminant'), + PFPayloadName = cms.string('AK7PF'), + PFPayloadNameCHS= cms.string('AK7PFchs'), +) + +jetToolbox( process, 'ak5', 'ak5JetSubs','CHS') +jetToolbox( process, 'ak5', 'ak5JetSubs') + +process.ak5 = process.ak4.clone( + pfjets = cms.InputTag('selectedPatJetsAK5PF'), + pfjetschs = cms.InputTag('selectedPatJetsAK5PFCHS'), + pfpujetid = cms.string('AK5PFpileupJetIdEvaluator:fullDiscriminant'), + pfchsjetpuid = cms.string('AK5PFCHSpileupJetIdEvaluator:fullDiscriminant'), + PFPayloadName = cms.string('AK5PF'), + PFPayloadNameCHS= cms.string('AK5PFchs'), +) + +############# hlt filter ######################### +process.hltFilter = cms.EDFilter('HLTHighLevel', + TriggerResultsTag = cms.InputTag('TriggerResults','','HLT'), + HLTPaths = cms.vstring('HLT_PFJet40_v6'), + eventSetupPathsKey = cms.string(''), + andOr = cms.bool(True), #----- True = OR, False = AND between the HLTPaths + throw = cms.bool(False) +) + +##MET Filters +process.load('RecoMET.METFilters.CSCTightHaloFilter_cfi') +process.load('CommonTools.RecoAlgos.HBHENoiseFilterResultProducer_cfi') + +process.HBHENoiseFilterResultProducerNoMinZ = process.HBHENoiseFilterResultProducer.clone(minZeros = cms.int32(99999)) + + +process.goodVertices = cms.EDFilter("VertexSelector", + filter = cms.bool(False), + src = cms.InputTag("offlinePrimaryVertices"), + cut = cms.string("!isFake && ndof >= 4 && abs(z) <= 24 && position.rho <= 2"), +) +process.load('RecoMET.METFilters.trackingFailureFilter_cfi') + +##Type1 patMET Producer +process.load('PhysicsTools.PatAlgos.recoLayer0.metCorrections_cff') +process.load('PhysicsTools.PatAlgos.producersLayer1.metProducer_cfi') +process.patMETs.addGenMET = cms.bool(False) +#Try scheduled processs +process.path = cms.Path(process.goodVertices*process.trackingFailureFilter* + process.hltFilter* + process.HBHENoiseFilterResultProducer* + process.HBHENoiseFilterResultProducerNoMinZ* + process.patMETCorrections*process.patMETs#process.patDefaultSequence* + #*process.ak4 *process.ak5*process.ak7*process.ak8) + *process.ak4) + + +#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +#! Output and Log +#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(False) ) +process.options.allowUnscheduled = cms.untracked.bool(True) diff --git a/AnalysisFW/test/crab.log b/AnalysisFW/test/crab.log new file mode 100644 index 00000000000..4b1e25b78b4 --- /dev/null +++ b/AnalysisFW/test/crab.log @@ -0,0 +1,183 @@ +DEBUG 2016-07-01 10:29:05,103: Executing command: 'status' +DEBUG 2016-07-01 10:29:05,103: Found CRAB cache file /afs/desy.de/user/e/eren/.crab3 +DEBUG 2016-07-01 10:29:05,111: Checking credentials +DEBUG 2016-07-01 10:29:05,111: Found proxy file /tmp/x509up_u22919 +DEBUG 2016-07-01 10:29:05,111: Getting proxy life time left +DEBUG 2016-07-01 10:29:05,814: Executing : + command : voms-proxy-info -file /tmp/x509up_u22919 -timeleft + output : 86281 + + error: Picked up _JAVA_OPTIONS: -Xmx256M + + retcode : 0 +DEBUG 2016-07-01 10:29:06,217: Executing : + command : voms-proxy-info -file /tmp/x509up_u22919 -actimeleft + output : 86280 + + error: Picked up _JAVA_OPTIONS: -Xmx256M + + retcode : 0 +DEBUG 2016-07-01 10:29:06,217: Proxy valid for 23:58:01 hours +ERROR 2016-07-01 10:29:06,218: Cannot find .requestcache file in CRAB project directory /nfs/dust/cms/user/eren/CMS/InclusiveJets/CMSSW_8_0_7/src/SMPJ/AnalysisFW/test/JetDataWithJsonFile-MagnField-Run2016B_25ns-BTag-80X-PromptReco-v1 +ERROR 2016-07-01 10:29:06,219: Caught exception +Traceback (most recent call last): + File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1606-comp/bin/crab", line 160, in + client() + File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1606-comp/bin/crab", line 146, in __call__ + self.cmd = sub_cmd(self.logger, args[1:]) + File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1606-comp/lib/python2.7/site-packages/CRABClient/Commands/SubCommand.py", line 318, in __init__ + self.loadLocalCache(proxyOptsSetPlace) + File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1606-comp/lib/python2.7/site-packages/CRABClient/Commands/SubCommand.py", line 447, in loadLocalCache + raise ex +CachefileNotFoundException: Cannot find .requestcache file in CRAB project directory /nfs/dust/cms/user/eren/CMS/InclusiveJets/CMSSW_8_0_7/src/SMPJ/AnalysisFW/test/JetDataWithJsonFile-MagnField-Run2016B_25ns-BTag-80X-PromptReco-v1 +DEBUG 2016-07-04 18:17:18,771: Executing command: 'submit' +DEBUG 2016-07-04 18:17:18,772: Found CRAB cache file /afs/desy.de/user/e/eren/.crab3 +DEBUG 2016-07-04 18:17:18,792: Checking credentials +DEBUG 2016-07-04 18:17:18,792: Found proxy file /tmp/x509up_u22919 +DEBUG 2016-07-04 18:17:18,792: Getting proxy life time left +ERROR 2016-07-04 18:17:19,095: Keyboard Interrupted +DEBUG 2016-07-04 18:17:31,174: Executing command: 'submit' +DEBUG 2016-07-04 18:17:31,174: Found CRAB cache file /afs/desy.de/user/e/eren/.crab3 +DEBUG 2016-07-04 18:17:31,181: Checking credentials +DEBUG 2016-07-04 18:17:31,182: Found proxy file /tmp/x509up_u22919 +DEBUG 2016-07-04 18:17:31,182: Getting proxy life time left +DEBUG 2016-07-04 18:17:32,085: Executing : + command : voms-proxy-info -file /tmp/x509up_u22919 -timeleft + output : 59464 + + error: Picked up _JAVA_OPTIONS: -Xmx256M + + retcode : 0 +DEBUG 2016-07-04 18:17:32,488: Executing : + command : voms-proxy-info -file /tmp/x509up_u22919 -actimeleft + output : 59464 + + error: Picked up _JAVA_OPTIONS: -Xmx256M + + retcode : 0 +DEBUG 2016-07-04 18:17:32,488: Proxy valid for 16:31:04 hours +INFO 2016-07-04 18:17:32,489: Will use CRAB configuration file crabDataAODBTag.py +DEBUG 2016-07-04 18:17:32,489: Loading CRAB configuration file. +DEBUG 2016-07-04 18:17:32,492: Will use CRAB Analysis plugin (i.e. will run an analysis job type). +ERROR 2016-07-04 18:17:32,493: Working area '/nfs/dust/cms/user/eren/CMS/InclusiveJets/CMSSW_8_0_7/src/SMPJ/AnalysisFW/test/JetDataWithJsonFile-MagnField-Run2016B_25ns-BTag-80X-PromptReco-v2/crab_JetData-June2016-MagnField-Run2016B_25ns-BTag-80X-PromptReco-v2' already exists +Please change the requestName in the config file +ERROR 2016-07-04 18:17:32,493: Caught exception +Traceback (most recent call last): + File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1606-comp/bin/crab", line 160, in + client() + File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1606-comp/bin/crab", line 146, in __call__ + self.cmd = sub_cmd(self.logger, args[1:]) + File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1606-comp/lib/python2.7/site-packages/CRABClient/Commands/submit.py", line 34, in __init__ + SubCommand.__init__(self, logger, cmdargs, disable_interspersed_args=True) + File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1606-comp/lib/python2.7/site-packages/CRABClient/Commands/SubCommand.py", line 299, in __init__ + getattr(self.configuration.General, 'requestName', None)) + File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1606-comp/lib/python2.7/site-packages/CRABClient/ClientUtilities.py", line 394, in createWorkArea + raise ConfigException("Working area '%s' already exists \nPlease change the requestName in the config file" % fullpath) +ConfigException: Working area '/nfs/dust/cms/user/eren/CMS/InclusiveJets/CMSSW_8_0_7/src/SMPJ/AnalysisFW/test/JetDataWithJsonFile-MagnField-Run2016B_25ns-BTag-80X-PromptReco-v2/crab_JetData-June2016-MagnField-Run2016B_25ns-BTag-80X-PromptReco-v2' already exists +Please change the requestName in the config file +DEBUG 2016-08-03 11:37:33,212: Executing command: 'submit' +DEBUG 2016-08-03 11:37:33,213: Found CRAB cache file /afs/cern.ch/user/p/pgunnell/.crab3 +DEBUG 2016-08-03 11:37:33,229: Checking credentials +DEBUG 2016-08-03 11:37:33,229: Found proxy file /tmp/x509up_u32627 +DEBUG 2016-08-03 11:37:33,229: Getting proxy life time left +DEBUG 2016-08-03 11:37:34,033: Executing : + command : voms-proxy-info -file /tmp/x509up_u32627 -timeleft + output : 86328 + + error: + retcode : 0 +DEBUG 2016-08-03 11:37:34,546: Executing : + command : voms-proxy-info -file /tmp/x509up_u32627 -actimeleft + output : 86328 + + error: + retcode : 0 +DEBUG 2016-08-03 11:37:34,546: Proxy valid for 23:58:48 hours +INFO 2016-08-03 11:37:34,546: Will use CRAB configuration file crabDataAODBTag.py +DEBUG 2016-08-03 11:37:34,546: Loading CRAB configuration file. +DEBUG 2016-08-03 11:37:34,547: Will use CRAB Analysis plugin (i.e. will run an analysis job type). +ERROR 2016-08-03 11:37:34,548: Working area '/afs/cern.ch/work/p/pgunnell/Run2Analysis/CMSSW_8_0_13_patch1/src/SMPJ/AnalysisFW/test/JetDataWithJsonFile-MagnField-Run2016D_25ns-BTag-80X-PromptReco-v2/crab_JetData-June2016-MagnField-Run2016D_25ns-BTag-80X-PromptReco-v2' already exists +Please change the requestName in the config file +ERROR 2016-08-03 11:37:34,548: Caught exception +Traceback (most recent call last): + File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1607.patch2/bin/crab", line 160, in + client() + File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1607.patch2/bin/crab", line 146, in __call__ + self.cmd = sub_cmd(self.logger, args[1:]) + File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1607.patch2/lib/python2.7/site-packages/CRABClient/Commands/submit.py", line 34, in __init__ + SubCommand.__init__(self, logger, cmdargs, disable_interspersed_args=True) + File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1607.patch2/lib/python2.7/site-packages/CRABClient/Commands/SubCommand.py", line 302, in __init__ + getattr(self.configuration.General, 'requestName', None)) + File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1607.patch2/lib/python2.7/site-packages/CRABClient/ClientUtilities.py", line 394, in createWorkArea + raise ConfigException("Working area '%s' already exists \nPlease change the requestName in the config file" % fullpath) +ConfigException: Working area '/afs/cern.ch/work/p/pgunnell/Run2Analysis/CMSSW_8_0_13_patch1/src/SMPJ/AnalysisFW/test/JetDataWithJsonFile-MagnField-Run2016D_25ns-BTag-80X-PromptReco-v2/crab_JetData-June2016-MagnField-Run2016D_25ns-BTag-80X-PromptReco-v2' already exists +Please change the requestName in the config file +DEBUG 2016-08-03 18:22:58,334: Executing command: 'status' +DEBUG 2016-08-03 18:22:58,334: Found CRAB cache file /afs/cern.ch/user/p/pgunnell/.crab3 +ERROR 2016-08-03 18:22:58,334: Error: JetDataWithJsonFile-MagnField-Run2016D_25ns-BTag-80X-PromptReco-v2/crab_JetData-June2016-MagnField-Run2016D_25ns-BTag-80X-PromptReco-v2/ is not a valid CRAB project directory. +ERROR 2016-08-03 18:22:58,334: Caught exception +Traceback (most recent call last): + File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1607.patch2/bin/crab", line 160, in + client() + File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1607.patch2/bin/crab", line 146, in __call__ + self.cmd = sub_cmd(self.logger, args[1:]) + File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1607.patch2/lib/python2.7/site-packages/CRABClient/Commands/SubCommand.py", line 257, in __init__ + self.validateOptions() + File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1607.patch2/lib/python2.7/site-packages/CRABClient/Commands/status.py", line 749, in validateOptions + SubCommand.validateOptions(self) + File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1607.patch2/lib/python2.7/site-packages/CRABClient/Commands/SubCommand.py", line 566, in validateOptions + raise ConfigurationException(msg) +ConfigurationException: Error: JetDataWithJsonFile-MagnField-Run2016D_25ns-BTag-80X-PromptReco-v2/crab_JetData-June2016-MagnField-Run2016D_25ns-BTag-80X-PromptReco-v2/ is not a valid CRAB project directory. +DEBUG 2016-08-03 18:23:01,830: Executing command: 'status' +DEBUG 2016-08-03 18:23:01,830: Found CRAB cache file /afs/cern.ch/user/p/pgunnell/.crab3 +ERROR 2016-08-03 18:23:01,831: Error: JetDataWithJsonFile-MagnField-Run2016D_25ns-BTag-80X-PromptReco-v2/crab_JetData-June2016-MagnField-Run2016D_25ns-BTag-80X-PromptReco-v2/ is not a valid CRAB project directory. +ERROR 2016-08-03 18:23:01,831: Caught exception +Traceback (most recent call last): + File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1607.patch2/bin/crab", line 160, in + client() + File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1607.patch2/bin/crab", line 146, in __call__ + self.cmd = sub_cmd(self.logger, args[1:]) + File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1607.patch2/lib/python2.7/site-packages/CRABClient/Commands/SubCommand.py", line 257, in __init__ + self.validateOptions() + File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1607.patch2/lib/python2.7/site-packages/CRABClient/Commands/status.py", line 749, in validateOptions + SubCommand.validateOptions(self) + File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1607.patch2/lib/python2.7/site-packages/CRABClient/Commands/SubCommand.py", line 566, in validateOptions + raise ConfigurationException(msg) +ConfigurationException: Error: JetDataWithJsonFile-MagnField-Run2016D_25ns-BTag-80X-PromptReco-v2/crab_JetData-June2016-MagnField-Run2016D_25ns-BTag-80X-PromptReco-v2/ is not a valid CRAB project directory. +DEBUG 2016-09-26 21:51:00,704: Executing command: 'submit' +DEBUG 2016-09-26 21:51:00,722: Found CRAB cache file /afs/cern.ch/user/p/pgunnell/.crab3 +DEBUG 2016-09-26 21:51:00,757: Checking credentials +DEBUG 2016-09-26 21:51:00,757: Proxy file /tmp/x509up_u32627 not found +DEBUG 2016-09-26 21:51:00,757: Creating new proxy for 24:00 hours with VO group '' and VO role 'NULL'. +DEBUG 2016-09-26 21:51:04,974: Executing : + command : voms-proxy-init -voms cms:/cms -valid 24:00 -rfc + output : None + error: None + retcode : 1 +DEBUG 2016-09-26 21:51:05,379: Executing : + command : voms-proxy-info -file /tmp/x509up_u32627 -timeleft + output : + error: Proxy not found: /tmp/x509up_u32627 (No such file or directory) + + retcode : 1 +ERROR 2016-09-26 21:51:05,379: Error while checking proxy timeleft for /tmp/x509up_u32627 +DEBUG 2016-09-26 21:51:05,789: Executing : + command : env X509_USER_PROXY=/tmp/x509up_u32627 voms-proxy-info -fqan + output : + error: Proxy not found: /tmp/x509up_u32627 (No such file or directory) + + retcode : 1 +ERROR 2016-09-26 21:51:05,790: Problems creating proxy. +ERROR 2016-09-26 21:51:05,790: Caught exception +Traceback (most recent call last): + File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1608/bin/crab", line 160, in + client() + File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1608/bin/crab", line 146, in __call__ + self.cmd = sub_cmd(self.logger, args[1:]) + File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1608/lib/python2.7/site-packages/CRABClient/Commands/submit.py", line 34, in __init__ + SubCommand.__init__(self, logger, cmdargs, disable_interspersed_args=True) + File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1608/lib/python2.7/site-packages/CRABClient/Commands/SubCommand.py", line 292, in __init__ + self.proxyCreated = self.proxy.createNewVomsProxySimple(timeLeftThreshold = 720) + File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1608/lib/python2.7/site-packages/CRABClient/CredentialInteractions.py", line 152, in createNewVomsProxySimple + raise ProxyCreationException("Problems creating proxy.") +ProxyCreationException: Problems creating proxy. diff --git a/AnalysisFW/test/crabDataAODBTag-RunC2016.py b/AnalysisFW/test/crabDataAODBTag-RunC2016.py new file mode 100644 index 00000000000..3479c5442d6 --- /dev/null +++ b/AnalysisFW/test/crabDataAODBTag-RunC2016.py @@ -0,0 +1,29 @@ +from WMCore.Configuration import Configuration +config = Configuration() + +config.section_("User") +config.User.voGroup = 'dcms' + +config.section_("General") +config.General.requestName = 'JetData-June2016-MagnField-Run2016C_25ns-BTag-80X-PromptReco-v2' +config.General.workArea = 'JetDataWithJsonFile-MagnField-Run2016C_25ns-BTag-80X-PromptReco-v2' + +config.section_("JobType") +config.JobType.pluginName = 'Analysis' +config.JobType.psetName = 'ProcessedTreeProducer_dataPAT25ns_BTag_cfg.py' +config.JobType.allowUndistributedCMSSW = True + + +config.section_("Data") +config.Data.inputDataset = '/JetHT/Run2016C-PromptReco-v2/AOD' +#config.Data.inputDataset = '/JetHT/Run2015D-16Dec2015-v2/AOD' +#config.Data.inputDataset = '/JetHT/Run2015C_25ns-05Oct2015-v2/AOD ' +config.Data.splitting = 'LumiBased' #LumiBased' +config.Data.unitsPerJob = 10 +config.Data.lumiMask = 'Cert_271036-276097_13TeV_PromptReco_Collisions16_JSON_NoL1T.txt' +config.Data.runRange = '271036-276097' # '193093-194075' +config.Data.outputDatasetTag = 'CRAB3_JetData-25ns-Run2016C_v2-BTag-80X-PromptReco-v2' + +config.section_("Site") +config.Site.storageSite = "T2_DE_DESY" +#config.Site.whitelist = ['T2_DE_DESY'] diff --git a/AnalysisFW/test/crabDataAODBTag-RunC2016.pyc b/AnalysisFW/test/crabDataAODBTag-RunC2016.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ebf70d8d2c230b8d7998d8f48693f6f22637dc3d GIT binary patch literal 1279 zcmb7D%~R7r6yLN6w6st@)Uy|dOPV$e1!o+!4T965rIQA$Ty{cs2`lL)?ruQN{8|24 z-n{7Bjj_YQgK6^mzV_w!-utEcqgnrc@i2?fpQ{4@@8FR?K@hktlpr*>(1nF8YM}>& zE-Hvt(3dJA74!gJQZ@Dx!cWS;QV}TZWrSA{SvE1ySIeZ8BB`)z2-gv*nHcD6h&D>S zSstht2OtKoUq^TYks=B779vF+=$nYFmpNOAY?S&oBCS&2F$(msSrpwe_EUtPA+n98 zyF1W6`vupo1)6Gt@KS!o;#`D^rCcq6=Uh@@6cWv)S^>`q&YLIoB&)Fb^7qB{5W-cBK4Z8>3&R)-U4|<(f2e`Wz(2sc0 zKK9ZiVG`ynyFEOdo{jN1J?#c<^-W2=i$}-hK6pI8KiI?N%*|X&X!zFs$Ba!!Q>LiW z=mHlXy@z}HdA$1^Y^6ys8+oaq?MKV^!H?83h{$ll%vI7z69fB(Fq#av>4`}5%&+R~ zH4uV+&8bx5a9*t9E)_R@K|^1Y$w0`GJZAiFLMCaEtrG%~Q>Af*Ns`{3bHbz&>@ruB zc%$ib=4(Kz0fO-?H{65cW(zV)m{N?#21d@Ak`pR`6$W_%I~s-Z#uy^!e#m30T2Ls> z)uIv*!Pf*bHKa;K7*jpFUGSlWkT+mD;gxiNO1vFiJGxCLbFw(+oF<8(OvysWK*xu; zgS)OHMdVCJlc7_Fk7tg8i8+x7FE#UkR_1Gg)q461(yY{&UeAHL34NnyFJFRaS+z>j RYUrnwR-+1573|^%vEPc@KU@F+ literal 0 HcmV?d00001 diff --git a/AnalysisFW/test/crabDataAODBTag.py b/AnalysisFW/test/crabDataAODBTag.py index bdc75ba5283..2801fb6bc95 100644 --- a/AnalysisFW/test/crabDataAODBTag.py +++ b/AnalysisFW/test/crabDataAODBTag.py @@ -5,22 +5,24 @@ config.User.voGroup = 'dcms' config.section_("General") -config.General.requestName = 'JetData-July2015-MagnField-Run2015D_25ns-BTag-76X-ReReco-v3' -config.General.workArea = 'JetDataWithJsonFile-MagnField-Run2015D_25ns-BTag-76X-ReReco-v3' +config.General.requestName = 'JetData-June2016-MagnField-Run2016D_25ns-BTag-80X-PromptReco-v2' +config.General.workArea = 'JetDataWithJsonFile-MagnField-Run2016D_25ns-BTag-80X-PromptReco-v2' config.section_("JobType") config.JobType.pluginName = 'Analysis' config.JobType.psetName = 'ProcessedTreeProducer_dataPAT25ns_BTag_cfg.py' +config.JobType.allowUndistributedCMSSW = True + config.section_("Data") -config.Data.inputDataset = '/JetHT/Run2015D-16Dec2015-v1/AOD' -#config.Data.inputDataset = '/JetHT/Run2015D-16Dec2015-v1/AOD' -#config.Data.inputDataset = '/JetHT/Run2015C_25ns-05Oct2015-v1/AOD ' +config.Data.inputDataset = '/JetHT/Run2016D-PromptReco-v2/AOD' +#config.Data.inputDataset = '/JetHT/Run2015D-16Dec2015-v2/AOD' +#config.Data.inputDataset = '/JetHT/Run2015C_25ns-05Oct2015-v2/AOD ' config.Data.splitting = 'LumiBased' #LumiBased' -config.Data.unitsPerJob = 10 -config.Data.lumiMask = 'Cert_13TeV_16Dec2015ReReco_Collisions15_25ns_JSON.txt' -config.Data.runRange = '246908-260627' # '193093-194075' -config.Data.outputDatasetTag = 'CRAB3_JetData-25ns-Run2015D_v3-BTag-76X-ReReco-v3' +config.Data.unitsPerJob = 50 +config.Data.lumiMask = 'Cert_271036-277148_13TeV_PromptReco_Collisions16_JSON_NoL1T.txt' +config.Data.runRange = '271036-277148' # '193093-194075' +config.Data.outputDatasetTag = 'CRAB3_JetData-25ns-Run2016D_v2-BTag-80X-PromptReco-v2' config.section_("Site") config.Site.storageSite = "T2_DE_DESY" diff --git a/AnalysisFW/test/crabDataAODBTag.pyc b/AnalysisFW/test/crabDataAODBTag.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f201326ab0e00976e4dcf89b7a2424f82eedc790 GIT binary patch literal 1277 zcmb7COLNmO5SEkDHfhqP4`7BH7bX|iNlG6F2FQb!$uw!laS8OIQ7zRKbz~#SEj{;V zaN{p>;{q!glj(s2j=kBpzFmFgANA_DXWyqG`ty|F|1Es#CkP6!gJOhc4mx*`!yI&v z(0K{568c<5w1n=#OUu??K=@G+SjYppy@>Dq{96&nM61+iM8 z*NcK`UH~yTeih+0MDrxj8;It4psypkTI6gXx>o3$h&Bp+%PKI#dfs%y+K&-_g6Jli zG`C=U{tKR_1DdXb=qKWmN0}s=CqgfP=S(qa6&lWzUINb%6HJm=y#am5^nhsM4l}_z zt@fTfB9S=cET*oX3F8^y&aO~yFCdY7(E8|}%4C*mpM{Bg(^0*7k15wzLzO^v%>J{D zg*8krg1eOIWoX$IB)(HzDHjYlF=R?H8c4>#pjpTyrU3i28yIldfWzTsw4L7BQO!u| zIh1-Z-}}HTMtKO{>z)jB1+tE_8SfD|fOo*Md+Ec{aA&{W+SzkE`}^&e2e`cxun%}X zKJF)R%oXfewfFFFax%u_#tgwyLeEpcEQv4yS*J;?A-3PfQD~6|JbpeXu>tq zRcH}(@ZcT1lTYL3Q?Rum!F1G5B-?&)`9AoOUIYx+@v+4Vf&2G|nO}{wAb~<=G}7kQvhk7m4HK_DoQ&wB#3= zX0$(=Os2j8q-!9!NHfblD7Uwu(wJ+_MPy-Qf@^ikB(TCFkKv9+L|t1$X2K^TV!8p1 zl1$G#0TFydAlpOfM3RV^-8I37=0b5WJ#wi$ppw`QuRJrRmwIWG3BlsnQl?;`XQAT* z+yWBdl<4rP?I{_0lhNtWE3yu!o`%JFp(GcEfWR)pOT$Tn=+z8}8?)DD^XdhNhEplk SotpUy>D0<#mBG$`5c>^N%0F}f literal 0 HcmV?d00001 diff --git a/AnalysisFW/test/crabMC-pythia8Flat.py b/AnalysisFW/test/crabMC-pythia8Flat.py new file mode 100644 index 00000000000..11b5aaebc40 --- /dev/null +++ b/AnalysisFW/test/crabMC-pythia8Flat.py @@ -0,0 +1,40 @@ +from WMCore.Configuration import Configuration +config = Configuration() + +config.section_("User") +config.User.voGroup = 'dcms' + +config.section_("General") +config.General.requestName = 'Herwig-25ns-Ntuples-July2016-Flat-v2' +config.General.workArea = 'Herwig-25ns-Ntuples-July2016-TuneCUETM1-Flat-v2' + +config.section_("JobType") +config.JobType.pluginName = 'Analysis' +config.JobType.psetName = 'ProcessedTreeProducer_MCPAT25ns_BTag_cfg.py' + +config.section_("Data") +#config.Data.inputDataset = '/QCD_Pt-15to7000_TuneCUETP8M1_Flat_13TeV_pythia8/RunIISpring16DR80-PUSpring16_magnetOn_80X_mcRun2_asymptotic_2016_v3-v1/AODSIM' +config.Data.inputDataset = '/QCD_Pt-15to7000_TuneCUETHS1_Flat_13TeV_herwigpp/RunIISpring16DR80-PUSpring16_80X_mcRun2_asymptotic_2016_v3-v1/AODSIM' +config.Data.splitting = 'EventAwareLumiBased' #LumiBased' +config.Data.unitsPerJob = 12000 +config.Data.outputDatasetTag = 'CRAB3_Herwig-25ns-NtuplesTuneCUETS1-July2016-Flat-v2' + +config.section_("Site") +config.Site.storageSite = "T2_DE_DESY" + +#/QCD_Pt_15to30_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v2/AODSIM +#/QCD_Pt_30to50_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v2/AODSIM +#/QCD_Pt_50to80_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v2/AODSIM + +#/QCD_Pt_80to120_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/AODSIM +#/QCD_Pt_120to170_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/AODSIM +#/QCD_Pt_170to300_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v2/AODSIM +#/QCD_Pt_300to470_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/AODSIM +#/QCD_Pt_470to600_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v2/AODSIM +#/QCD_Pt_600to800_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v3/AODSIM +#/QCD_Pt_800to1000_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v2/AODSIM +#/QCD_Pt_1000to1400_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/AODSIM +#/QCD_Pt_1400to1800_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/AODSIM +#/QCD_Pt_1800to2400_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/AODSIM +#/QCD_Pt_2400to3200_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/AODSIM +#/QCD_Pt_3200toInf_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/AODSIM diff --git a/AnalysisFW/test/crabMC-pythia8Flat.pyc b/AnalysisFW/test/crabMC-pythia8Flat.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2e3a027f6d52dc1bf97cb0b705c09d188a6da851 GIT binary patch literal 1134 zcmah|%Wl&^6dfm}ZPJ83-~(8&h=d%+DJ@wbMC$Y@QiAPL=w>vvr;fp~&CGSGh-Lqg zHQTQF0Jt-*sSrq5_Vs<7@qHcFf3%yoUvJL?a(C76{Td(n4Mm8zK@vh{2DvbZ!3}al z$VH9t8u?TwVU66NH>_)WiO>gCV5tn0_A;R>BwW@p)K@FeN(n0M2BA$7HgpX2wF=ZM zL8aXyv`xa6j-mdLgzZXSC*i|N->43+mxoJxlh7>^ZW6Dvg{{Ru@#+|;K^ujWrB`uO z2nKPM!V-GUBo|rIs2_209Yc~T^ce$U=D4-y9E zyf3Z)0sSK7&e^^{wyQHb(MfjcFLDm6cz&3&WFccIpP?}kS-_>_p)WW`BP;?g=-8PI zeN_qF^I1fLtEihVbm=1oOcr?1dgqMj1WbDevKPHxk5-wFJe#U=slDy<_jIb;%5%#t z(&J+<7jYWdyCZkdGbd-2Ne8_TbQU0_PnlfIa>yVKsA`?gx6Qe24d0Hu<1swK%=>em z!tk02{-&74dkl+@zju*e&oSt@!@X_#k6BjbdG=pZ)s1;EaA@Ke{5~D+}4w)x00FG8?DAE|@gbUm{Y+y7i z;2w_)brlUXQbHzJ#8vYh^pSfZ@gF4?yOI_XBJBoKOVw%RRvr~;%9BJbv|n+_a>kx_ zP6xDyYo|GbU}{@Z1eQ0RoLCj=;M@Z2+zJG{96KgbY8tbFB8#GzD(dA78JO@_YI^bs SiVdStYa1=~+{+s3clIxcX(6Qm literal 0 HcmV?d00001 diff --git a/AnalysisFW/test/jetToolbox_cff.py b/AnalysisFW/test/jetToolbox_cff.py new file mode 100644 index 00000000000..7493a1abb3b --- /dev/null +++ b/AnalysisFW/test/jetToolbox_cff.py @@ -0,0 +1,836 @@ +############################################### +#### +#### Jet Substructure Toolbox (jetToolBox) +#### Python function for easy access of +#### jet substructure tools implemented in CMS +#### +#### Alejandro Gomez Espinosa (gomez@physics.rutgers.edu) +#### +############################################### +import FWCore.ParameterSet.Config as cms + +from RecoJets.Configuration.RecoPFJets_cff import ak4PFJets, ak8PFJetsCHSSoftDrop, ak8PFJetsCHSSoftDropMass, ak8PFJetsCHSPruned, ak8PFJetsCHSPrunedMass, ak8PFJetsCHSTrimmed, ak8PFJetsCHSTrimmedMass, ak8PFJetsCHSFiltered, ak8PFJetsCHSFilteredMass, ak4PFJetsCHS, ca15PFJetsCHSMassDropFiltered, hepTopTagPFJetsCHS, ak8PFJetsCHSConstituents, puppi +from RecoJets.Configuration.RecoGenJets_cff import ak4GenJets +from RecoJets.JetProducers.SubJetParameters_cfi import SubJetParameters +from RecoJets.JetProducers.PFJetParameters_cfi import * +from RecoJets.JetProducers.GenJetParameters_cfi import * +from RecoJets.JetProducers.AnomalousCellParameters_cfi import * +from RecoJets.JetProducers.CATopJetParameters_cfi import * +from PhysicsTools.PatAlgos.producersLayer1.patCandidates_cff import * +from PhysicsTools.PatAlgos.selectionLayer1.jetSelector_cfi import selectedPatJets +from PhysicsTools.PatAlgos.tools.jetTools import addJetCollection + + +def jetToolbox( proc, jetType, jetSequence, outputFile, + newPFCollection=False, nameNewPFCollection = '', + PUMethod='CHS', + miniAOD=True, + runOnMC=True, + JETCorrPayload='', JETCorrLevels = [ 'None' ], GetJetMCFlavour=True, + Cut = '', + bTagDiscriminators = None, + bTagInfos = None, + subJETCorrPayload='', subJETCorrLevels = [ 'None' ], GetSubjetMCFlavour=True, + CutSubjet = '', + addPruning=False, zCut=0.1, rCut=0.5, addPrunedSubjets=False, + addSoftDrop=False, betaCut=0.0, zCutSD=0.1, addSoftDropSubjets=False, + addTrimming=False, rFiltTrim=0.2, ptFrac=0.03, + addFiltering=False, rfilt=0.3, nfilt=3, + addCMSTopTagger=False, + addMassDrop=False, + addHEPTopTagger=False, + addNsub=False, maxTau=4, + addNsubSubjets=False, subjetMaxTau=4, + addPUJetID=False, + addQJets=False, + addQGTagger=False, QGjetsLabel='chs', + addEnergyCorrFunc=False, ecfBeta = 1.0, maxECF=3, + ): + + runOnData = not runOnMC + if runOnData: + GetJetMCFlavour = False + GetSubjetMCFlavour = False + + ############################################################################### + ####### Verifying some inputs and defining variables + ############################################################################### + print '|---- jetToolbox: Initialyzing collection...' + if newPFCollection: print '|---- jetToolBox: Using '+ nameNewPFCollection +' as PFCandidates collection' + supportedJetAlgos = { 'ak': 'AntiKt', 'ca' : 'CambridgeAachen', 'kt' : 'Kt' } + recommendedJetAlgos = [ 'ak4', 'ak8', 'ca4', 'ca8', 'ca10' ] + payloadList = [ 'None', + 'AK1PFchs', 'AK2PFchs', 'AK3PFchs', 'AK4PFchs', 'AK5PFchs', 'AK6PFchs', 'AK7PFchs', 'AK8PFchs', 'AK9PFchs', 'AK10PFchs', + 'AK1PFPUPPI', 'AK2PFPUPPI', 'AK3PFPUPPI', 'AK4PFPUPPI', 'AK5PFPUPPI', 'AK6PFPUPPI', 'AK7PFPUPPI', 'AK8PFPUPPI', 'AK9PFPUPPI', 'AK10PFPUPPI', + 'AK1PFSK', 'AK2PFSK', 'AK3PFSK', 'AK4PFSK', 'AK5PFSK', 'AK6PFSK', 'AK7PFSK', 'AK8PFSK', 'AK9PFSK', 'AK10PFSK', + 'AK1PF', 'AK2PF', 'AK3PF', 'AK4PF', 'AK5PF', 'AK6PF', 'AK7PF', 'AK8PF', 'AK9PF', 'AK10PF' ] + JECLevels = [ 'L1Offset', 'L1FastJet', 'L1JPTOffset', 'L2Relative', 'L3Absolute', 'L5Falvour', 'L7Parton' ] + if runOnData: + JECLevels += ['L2L3Residual'] + jetAlgo = '' + algorithm = '' + size = '' + for type, tmpAlgo in supportedJetAlgos.iteritems(): + if type in jetType.lower(): + jetAlgo = type + algorithm = tmpAlgo + size = jetType.replace( type, '' ) + + jetSize = 0. + if int(size) in range(0, 20): jetSize = int(size)/10. + else: print '|---- jetToolBox: jetSize has not a valid value. Insert a number between 1 and 20 after algorithm, like: AK8' + ### Trick for uppercase/lowercase algo name + jetALGO = jetAlgo.upper()+size + jetalgo = jetAlgo.lower()+size + if jetalgo not in recommendedJetAlgos: print '|---- jetToolBox: CMS recommends the following jet algoritms: '+' '.join(recommendedJetAlgos)+'. You are using', jetalgo,'.' + + + ################################################################################# + ####### Toolbox start + ################################################################################# + + elemToKeep = [] + jetSeq = cms.Sequence() + genParticlesLabel = '' + pvLabel = '' + tvLabel = '' + toolsUsed = [] + + #### For MiniAOD + if miniAOD: + + print '|---- jetToolBox: JETTOOLBOX RUNNING ON MiniAOD FOR '+jetALGO+' JETS USING '+PUMethod + + genParticlesLabel = 'prunedGenParticles' + pvLabel = 'offlineSlimmedPrimaryVertices' + svLabel = 'slimmedSecondaryVertices' + tvLabel = 'unpackedTracksAndVertices' + muLabel = 'slimmedMuons' + elLabel = 'slimmedElectrons' + pfCand = nameNewPFCollection if newPFCollection else 'packedPFCandidates' + + if runOnMC: + ## Filter out neutrinos from packed GenParticles + setattr( proc, 'packedGenParticlesForJetsNoNu', + cms.EDFilter("CandPtrSelector", + src = cms.InputTag("packedGenParticles"), + cut = cms.string("abs(pdgId) != 12 && abs(pdgId) != 14 && abs(pdgId) != 16") + )) + jetSeq += getattr(proc, 'packedGenParticlesForJetsNoNu' ) + + setattr( proc, jetalgo+'GenJetsNoNu', + ak4GenJets.clone( src = 'packedGenParticlesForJetsNoNu', + rParam = jetSize, + jetAlgorithm = algorithm ) ) + jetSeq += getattr(proc, jetalgo+'GenJetsNoNu' ) + + #for Inclusive Vertex Finder + proc.load('PhysicsTools.PatAlgos.slimming.unpackedTracksAndVertices_cfi') + + #### For AOD + else: + print '|---- jetToolBox: JETTOOLBOX RUNNING ON AOD FOR '+jetALGO+' JETS USING '+PUMethod + + genParticlesLabel = 'genParticles' + pvLabel = 'offlinePrimaryVertices' + tvLabel = 'generalTracks' + muLabel = 'muons' + elLabel = 'gedGsfElectrons' + pfCand = nameNewPFCollection if newPFCollection else 'particleFlow' + svLabel = 'inclusiveCandidateSecondaryVertices' + + if runOnMC: + proc.load('RecoJets.Configuration.GenJetParticles_cff') + setattr( proc, jetalgo+'GenJetsNoNu', ak4GenJets.clone( src = 'genParticlesForJetsNoNu', rParam = jetSize, jetAlgorithm = algorithm ) ) + jetSeq += getattr(proc, jetalgo+'GenJetsNoNu' ) + + + + ## b-tag discriminators + if bTagDiscriminators is None: + bTagDiscriminators = [ + 'pfTrackCountingHighEffBJetTags', + 'pfTrackCountingHighPurBJetTags', + 'pfJetProbabilityBJetTags', + 'pfJetBProbabilityBJetTags', + 'pfSimpleSecondaryVertexHighEffBJetTags', + 'pfSimpleSecondaryVertexHighPurBJetTags', + 'pfCombinedSecondaryVertexV2BJetTags', + 'pfCombinedInclusiveSecondaryVertexV2BJetTags', + 'pfCombinedMVAV2BJetTags' + ] + + ### Jet Corrections + if not set(JETCorrLevels).issubset(set(JECLevels)): + if ( 'CHS' in PUMethod ) or ( 'Plain' in PUMethod ): JETCorrLevels = ['L1FastJet','L2Relative', 'L3Absolute'] + else: JETCorrLevels = [ 'L2Relative', 'L3Absolute'] + if runOnData: JETCorrLevels.append('L2L3Residual') + if not set(subJETCorrLevels).issubset(set(JECLevels)): + if ( 'CHS' in PUMethod ) or ( 'Plain' in PUMethod ): subJETCorrLevels = ['L1FastJet','L2Relative', 'L3Absolute'] + else: subJETCorrLevels = [ 'L2Relative', 'L3Absolute'] + if runOnData: subJETCorrLevels.append('L2L3Residual') + + #### Creating PATjets + tmpPfCandName = pfCand.lower() + if 'Puppi' in PUMethod: + if ('puppi' in tmpPfCandName): + srcForPFJets = pfCand + print '|---- jetToolBox: Not running puppi algorithm because keyword puppi was specified in nameNewPFCollection, but applying puppi corrections.' + else: + proc.load('CommonTools.PileupAlgos.Puppi_cff') + puppi.candName = cms.InputTag( pfCand ) + if miniAOD: puppi.vertexName = cms.InputTag('offlineSlimmedPrimaryVertices') + jetSeq += getattr(proc, 'puppi' ) + srcForPFJets = 'puppi' + + from RecoJets.JetProducers.ak4PFJetsPuppi_cfi import ak4PFJetsPuppi + setattr( proc, jetalgo+'PFJetsPuppi', + ak4PFJetsPuppi.clone( src = cms.InputTag( srcForPFJets ), + doAreaFastjet = True, + rParam = jetSize, + jetAlgorithm = algorithm ) ) + jetSeq += getattr(proc, jetalgo+'PFJetsPuppi' ) + + if JETCorrPayload not in payloadList: JETCorrPayload = 'AK'+size+'PFPuppi' + if subJETCorrPayload not in payloadList: subJETCorrPayload = 'AK4PFPuppi' + + elif 'SK' in PUMethod: + + if ('sk' in tmpPfCandName): + srcForPFJets = pfCand + print '|---- jetToolBox: Not running softkiller algorithm because keyword SK was specified in nameNewPFCollection, but applying SK corrections.' + else: + proc.load('CommonTools.PileupAlgos.softKiller_cfi') + getattr( proc, 'softKiller' ).PFCandidates = cms.InputTag( pfCand ) + jetSeq += getattr(proc, 'softKiller' ) + srcForPFJets = 'softKiller' + + from RecoJets.JetProducers.ak4PFJetsSK_cfi import ak4PFJetsSK + setattr( proc, jetalgo+'PFJetsSK', + ak4PFJetsSK.clone( src = cms.InputTag( srcForPFJets ), + rParam = jetSize, + jetAlgorithm = algorithm ) ) + jetSeq += getattr(proc, jetalgo+'PFJetsSK' ) + + if JETCorrPayload not in payloadList: JETCorrPayload = 'AK'+size+'PFSK' + if subJETCorrPayload not in payloadList: subJETCorrPayload = 'AK4PFSK' + + elif 'CS' in PUMethod: + + from RecoJets.JetProducers.ak4PFJetsCHSCS_cfi import ak4PFJetsCHSCS + setattr( proc, jetalgo+'PFJetsCS', + ak4PFJetsCHSCS.clone( doAreaFastjet = True, + src = cms.InputTag( pfCand ), #srcForPFJets ), + csRParam = cms.double(jetSize), + jetAlgorithm = algorithm ) ) + if miniAOD: getattr( proc, jetalgo+'PFJetsCS').src = pfCand + jetSeq += getattr(proc, jetalgo+'PFJetsCS' ) + + if JETCorrPayload not in payloadList: JETCorrPayload = 'AK'+size+'PFCS' + if subJETCorrPayload not in payloadList: subJETCorrPayload = 'AK4PFCS' + + elif 'CHS' in PUMethod: + + if miniAOD: + if ('chs' in tmpPfCandName): + srcForPFJets = pfCand + print '|---- jetToolBox: Not running CHS algorithm because keyword CHS was specified in nameNewPFCollection, but applying CHS corrections.' + else: + setattr( proc, 'chs', cms.EDFilter('CandPtrSelector', src = cms.InputTag( pfCand ), cut = cms.string('fromPV')) ) + jetSeq += getattr(proc, 'chs') + srcForPFJets = 'chs' + else: + if ( pfCand == 'particleFlow' ): + from RecoParticleFlow.PFProducer.particleFlowTmpPtrs_cfi import particleFlowTmpPtrs + setattr( proc, 'newParticleFlowTmpPtrs', particleFlowTmpPtrs.clone( src = pfCand ) ) + jetSeq += getattr(proc, 'newParticleFlowTmpPtrs') + from CommonTools.ParticleFlow.pfNoPileUpJME_cff import pfPileUpJME, pfNoPileUpJME + proc.load('CommonTools.ParticleFlow.goodOfflinePrimaryVertices_cfi') + setattr( proc, 'newPfPileUpJME', pfPileUpJME.clone( PFCandidates= 'newParticleFlowTmpPtrs' ) ) + jetSeq += getattr(proc, 'newPfPileUpJME') + setattr( proc, 'newPfNoPileUpJME', pfNoPileUpJME.clone( topCollection='newPfPileUpJME', bottomCollection= 'newParticleFlowTmpPtrs' ) ) + jetSeq += getattr(proc, 'newPfNoPileUpJME') + srcForPFJets = 'newPfNoPileUpJME' + else: + proc.load('CommonTools.ParticleFlow.pfNoPileUpJME_cff') + srcForPFJets = 'pfNoPileUpJME' + + setattr( proc, jetalgo+'PFJetsCHS', + ak4PFJetsCHS.clone( src = cms.InputTag( srcForPFJets ), + doAreaFastjet = True, + rParam = jetSize, + jetAlgorithm = algorithm ) ) + jetSeq += getattr(proc, jetalgo+'PFJetsCHS' ) + + if JETCorrPayload not in payloadList: JETCorrPayload = 'AK'+size+'PFchs' + if subJETCorrPayload not in payloadList: subJETCorrPayload = 'AK4PFchs' + + else: + PUMethod = '' + setattr( proc, jetalgo+'PFJets', + ak4PFJets.clone( + doAreaFastjet = True, + rParam = jetSize, + jetAlgorithm = algorithm ) ) + if miniAOD: getattr( proc, jetalgo+'PFJets').src = pfCand + jetSeq += getattr(proc, jetalgo+'PFJets' ) + if JETCorrPayload not in payloadList: JETCorrPayload = 'AK'+size+'PF' + if subJETCorrPayload not in payloadList: subJETCorrPayload = 'AK4PF' + + if 'None' in JETCorrPayload: JEC = None + else: JEC = ( JETCorrPayload.replace('CS','chs').replace('SK','chs') , JETCorrLevels, 'None' ) ### temporary + #else: JEC = ( JETCorrPayload., JETCorrLevels, 'None' ) + print '|---- jetToolBox: Applying this corrections: '+str(JEC) + + if addPrunedSubjets or addSoftDropSubjets or addCMSTopTagger: + if 'None' in subJETCorrPayload: subJEC = None + else: subJEC = ( subJETCorrPayload.replace('CS','chs').replace('SK','chs') , subJETCorrLevels, 'None' ) ### temporary + + + if ( PUMethod in [ 'CHS', 'CS', 'Puppi' ] ) and miniAOD: setattr( proc, jetalgo+'PFJets'+PUMethod+'Constituents', cms.EDFilter("MiniAODJetConstituentSelector", src = cms.InputTag( jetalgo+'PFJets'+PUMethod ), cut = cms.string( Cut ) )) + else: setattr( proc, jetalgo+'PFJets'+PUMethod+'Constituents', cms.EDFilter("PFJetConstituentSelector", src = cms.InputTag( jetalgo+'PFJets'+PUMethod ), cut = cms.string( Cut ) )) + jetSeq += getattr(proc, jetalgo+'PFJets'+PUMethod+'Constituents' ) + + addJetCollection( + proc, + labelName = jetALGO+'PF'+PUMethod, + jetSource = cms.InputTag( jetalgo+'PFJets'+PUMethod), + algo = jetalgo, + rParam = jetSize, + jetCorrections = JEC if JEC is not None else None, + pfCandidates = cms.InputTag( pfCand ), + svSource = cms.InputTag( svLabel ), + genJetCollection = cms.InputTag( jetalgo+'GenJetsNoNu'), + pvSource = cms.InputTag( pvLabel ), + muSource = cms.InputTag( muLabel ), + elSource = cms.InputTag( elLabel ), + btagDiscriminators = bTagDiscriminators, + btagInfos = bTagInfos, + getJetMCFlavour = GetJetMCFlavour, + genParticles = cms.InputTag(genParticlesLabel), + outputModules = ['outputFile'] + ) + getattr(proc,'patJets'+jetALGO+'PF'+PUMethod).addTagInfos = cms.bool(True) + + if 'CS' in PUMethod: getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod ).getJetMCFlavour = False # CS jets cannot be re-clustered from their constituents + + #### Groomers + if addSoftDrop or addSoftDropSubjets: + + setattr( proc, jetalgo+'PFJets'+PUMethod+'SoftDrop', + ak8PFJetsCHSSoftDrop.clone( + src = cms.InputTag( jetalgo+'PFJets'+PUMethod+'Constituents', 'constituents' ), + rParam = jetSize, + jetAlgorithm = algorithm, + useExplicitGhosts=True, + R0= cms.double(jetSize), + #zcut=zCutSD, + beta=betaCut, + writeCompound = cms.bool(True), + jetCollInstanceName=cms.string('SubJets') ) ) + setattr( proc, jetalgo+'PFJets'+PUMethod+'SoftDropMass', + ak8PFJetsCHSSoftDropMass.clone( src = cms.InputTag( jetalgo+'PFJets'+PUMethod), + matched = cms.InputTag( jetalgo+'PFJets'+PUMethod+'SoftDrop'), + distMax = cms.double( jetSize ) ) ) + + elemToKeep += [ 'keep *_'+jetalgo+'PFJets'+PUMethod+'SoftDropMass_*_*'] + jetSeq += getattr(proc, jetalgo+'PFJets'+PUMethod+'SoftDrop' ) + jetSeq += getattr(proc, jetalgo+'PFJets'+PUMethod+'SoftDropMass' ) + getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod).userData.userFloats.src += [ jetalgo+'PFJets'+PUMethod+'SoftDropMass'] + toolsUsed.append( jetalgo+'PFJets'+PUMethod+'SoftDropMass' ) + + if addSoftDropSubjets: + + if runOnMC: + setattr( proc, jetalgo+'GenJetsNoNuSoftDrop', + ak4GenJets.clone( + SubJetParameters, + useSoftDrop = cms.bool(True), + rParam = jetSize, + jetAlgorithm = algorithm, + useExplicitGhosts=cms.bool(True), + #zcut=cms.double(zCutSD), + R0= cms.double(jetSize), + beta=cms.double(betaCut), + writeCompound = cms.bool(True), + jetCollInstanceName=cms.string('SubJets') + )) + if miniAOD: getattr( proc, jetalgo+'GenJetsNoNuSoftDrop' ).src = 'packedGenParticlesForJetsNoNu' + jetSeq += getattr(proc, jetalgo+'GenJetsNoNuSoftDrop' ) + + addJetCollection( + proc, + labelName = jetALGO+'PF'+PUMethod+'SoftDrop', + jetSource = cms.InputTag( jetalgo+'PFJets'+PUMethod+'SoftDrop'), + algo = jetalgo, + rParam = jetSize, + jetCorrections = JEC if JEC is not None else None, + pvSource = cms.InputTag( pvLabel ), + btagDiscriminators = ['None'], + genJetCollection = cms.InputTag( jetalgo+'GenJetsNoNu'), + getJetMCFlavour = False, # jet flavor should always be disabled for groomed jets + genParticles = cms.InputTag(genParticlesLabel), + outputModules = ['outputFile'] + ) + + setattr( proc, 'selectedPatJets'+jetALGO+'PF'+PUMethod+'SoftDrop', selectedPatJets.clone( src = 'patJets'+jetALGO+'PF'+PUMethod+'SoftDrop', cut = Cut ) ) + + addJetCollection( + proc, + labelName = jetALGO+'PF'+PUMethod+'SoftDropSubjets', + jetSource = cms.InputTag( jetalgo+'PFJets'+PUMethod+'SoftDrop', 'SubJets'), + algo = jetalgo, # needed for subjet b tagging + rParam = jetSize, # needed for subjet b tagging + jetCorrections = subJEC if subJEC is not None else None, + pfCandidates = cms.InputTag( pfCand ), + pvSource = cms.InputTag( pvLabel), + svSource = cms.InputTag( svLabel ), + muSource = cms.InputTag( muLabel ), + elSource = cms.InputTag( elLabel ), + btagDiscriminators = bTagDiscriminators, + btagInfos = bTagInfos, + genJetCollection = cms.InputTag( jetalgo+'GenJetsNoNuSoftDrop','SubJets'), + getJetMCFlavour = GetSubjetMCFlavour, + genParticles = cms.InputTag(genParticlesLabel), + explicitJTA = True, # needed for subjet b tagging + svClustering = True, # needed for subjet b tagging + fatJets=cms.InputTag(jetalgo+'PFJets'+PUMethod), # needed for subjet flavor clustering + groomedFatJets=cms.InputTag(jetalgo+'PFJets'+PUMethod+'SoftDrop'), # needed for subjet flavor clustering + outputModules = ['outputFile'] + ) + + setattr( proc, 'selectedPatJets'+jetALGO+'PF'+PUMethod+'SoftDropSubjets', selectedPatJets.clone( src = 'patJets'+jetALGO+'PF'+PUMethod+'SoftDropSubjets', cut = CutSubjet )) + getattr( proc, 'selectedPatJets'+jetALGO+'PF'+PUMethod+'SoftDropSubjets').addTagInfos = cms.bool(True) + + ## Establish references between PATified fat jets and subjets using the BoostedJetMerger + setattr( proc, 'selectedPatJets'+jetALGO+'PF'+PUMethod+'SoftDropPacked', + cms.EDProducer("BoostedJetMerger", + jetSrc=cms.InputTag('selectedPatJets'+jetALGO+'PF'+PUMethod+'SoftDrop'), + subjetSrc=cms.InputTag('selectedPatJets'+jetALGO+'PF'+PUMethod+'SoftDropSubjets') + )) + jetSeq += getattr(proc, 'selectedPatJets'+jetALGO+'PF'+PUMethod+'SoftDropPacked' ) + elemToKeep += [ 'keep *_selectedPatJets'+jetALGO+'PF'+PUMethod+'SoftDropPacked_*_*' ] + toolsUsed.append( 'selectedPatJets'+jetALGO+'PF'+PUMethod+'SoftDropPacked' ) + toolsUsed.append( 'selectedPatJets'+jetALGO+'PF'+PUMethod+'SoftDropSubjets' ) + + if addPruning or addPrunedSubjets: + + setattr( proc, jetalgo+'PFJets'+PUMethod+'Pruned', + ak8PFJetsCHSPruned.clone( + src = cms.InputTag( jetalgo+'PFJets'+PUMethod+'Constituents', 'constituents' ), + rParam = jetSize, + jetAlgorithm = algorithm, + zcut=zCut, + rcut_factor=rCut, + writeCompound = cms.bool(True), + doAreaFastjet = cms.bool(True), + jetCollInstanceName=cms.string('SubJets') ) ) + setattr( proc, jetalgo+'PFJets'+PUMethod+'PrunedMass', + ak8PFJetsCHSPrunedMass.clone( src = cms.InputTag( jetalgo+'PFJets'+PUMethod), + matched = cms.InputTag( jetalgo+'PFJets'+PUMethod+'Pruned'), + distMax = cms.double( jetSize ) ) ) + + jetSeq += getattr(proc, jetalgo+'PFJets'+PUMethod+'Pruned' ) + jetSeq += getattr(proc, jetalgo+'PFJets'+PUMethod+'PrunedMass' ) + getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod).userData.userFloats.src += [ jetalgo+'PFJets'+PUMethod+'PrunedMass'] + elemToKeep += [ 'keep *_'+jetalgo+'PFJets'+PUMethod+'PrunedMass_*_*'] + toolsUsed.append( jetalgo+'PFJets'+PUMethod+'PrunedMass' ) + + if addPrunedSubjets: + if runOnMC: + setattr( proc, jetalgo+'GenJetsNoNuPruned', + ak4GenJets.clone( + SubJetParameters, + rParam = jetSize, + usePruning = cms.bool(True), + writeCompound = cms.bool(True), + jetCollInstanceName=cms.string('SubJets') + )) + if miniAOD: getattr( proc, jetalgo+'GenJetsNoNuPruned' ).src = 'packedGenParticlesForJetsNoNu' + jetSeq += getattr(proc, jetalgo+'GenJetsNoNuPruned' ) + + addJetCollection( + proc, + labelName = jetALGO+'PF'+PUMethod+'Pruned', + jetSource = cms.InputTag( jetalgo+'PFJets'+PUMethod+'Pruned'), + algo = jetalgo, + rParam = jetSize, + jetCorrections = JEC if JEC is not None else None, + pvSource = cms.InputTag( pvLabel ), + btagDiscriminators = ['None'], + genJetCollection = cms.InputTag( jetalgo+'GenJetsNoNu'), + getJetMCFlavour = False, # jet flavor should always be disabled for groomed jets + genParticles = cms.InputTag(genParticlesLabel), + outputModules = ['outputFile'] + ) + + setattr( proc, 'selectedPatJets'+jetALGO+'PF'+PUMethod+'Pruned', selectedPatJets.clone( src = 'patJets'+jetALGO+'PF'+PUMethod+'Pruned', cut = Cut ) ) + + addJetCollection( + proc, + labelName = jetALGO+'PF'+PUMethod+'PrunedSubjets', + jetSource = cms.InputTag( jetalgo+'PFJets'+PUMethod+'Pruned', 'SubJets'), + algo = jetalgo, # needed for subjet b tagging + rParam = jetSize, # needed for subjet b tagging + jetCorrections = subJEC if subJEC is not None else None, + pfCandidates = cms.InputTag( pfCand ), + pvSource = cms.InputTag( pvLabel), + svSource = cms.InputTag( svLabel ), + muSource = cms.InputTag( muLabel ), + elSource = cms.InputTag( elLabel ), + getJetMCFlavour = GetSubjetMCFlavour, + genParticles = cms.InputTag(genParticlesLabel), + btagDiscriminators = bTagDiscriminators, + btagInfos = bTagInfos, + genJetCollection = cms.InputTag( jetalgo+'GenJetsNoNuPruned','SubJets'), + explicitJTA = True, # needed for subjet b tagging + svClustering = True, # needed for subjet b tagging + fatJets=cms.InputTag(jetalgo+'PFJets'+PUMethod), # needed for subjet flavor clustering + groomedFatJets=cms.InputTag(jetalgo+'PFJets'+PUMethod+'Pruned'), # needed for subjet flavor clustering + outputModules = ['outputFile'] + ) + + setattr( proc, 'selectedPatJets'+jetALGO+'PF'+PUMethod+'PrunedSubjets', selectedPatJets.clone( src = 'patJets'+jetALGO+'PF'+PUMethod+'PrunedSubjets', cut = CutSubjet ) ) + getattr( proc, 'selectedPatJets'+jetALGO+'PF'+PUMethod+'PrunedSubjets').addTagInfos = cms.bool(True) + + ## Establish references between PATified fat jets and subjets using the BoostedJetMerger + setattr( proc, 'selectedPatJets'+jetALGO+'PF'+PUMethod+'PrunedPacked', + cms.EDProducer("BoostedJetMerger", + jetSrc=cms.InputTag('selectedPatJets'+jetALGO+'PF'+PUMethod+'Pruned'), + subjetSrc=cms.InputTag('selectedPatJets'+jetALGO+'PF'+PUMethod+'PrunedSubjets') + )) + jetSeq += getattr(proc, 'selectedPatJets'+jetALGO+'PF'+PUMethod+'PrunedPacked' ) + elemToKeep += [ 'keep *_selectedPatJets'+jetALGO+'PF'+PUMethod+'PrunedPacked_*_*' ] + toolsUsed.append( 'selectedPatJets'+jetALGO+'PF'+PUMethod+'PrunedPacked' ) + toolsUsed.append( 'selectedPatJets'+jetALGO+'PF'+PUMethod+'PrunedSubjets' ) + + + if addTrimming: + + setattr( proc, jetalgo+'PFJets'+PUMethod+'Trimmed', + ak8PFJetsCHSTrimmed.clone( + rParam = jetSize, + src = cms.InputTag( jetalgo+'PFJets'+PUMethod+'Constituents', 'constituents'), + jetAlgorithm = algorithm, + rFilt= rFiltTrim, + trimPtFracMin= ptFrac) ) + setattr( proc, jetalgo+'PFJets'+PUMethod+'TrimmedMass', + ak8PFJetsCHSTrimmedMass.clone( src = cms.InputTag( jetalgo+'PFJets'+PUMethod), + matched = cms.InputTag( jetalgo+'PFJets'+PUMethod+'Trimmed'), + distMax = cms.double( jetSize ) ) ) + + elemToKeep += [ 'keep *_'+jetalgo+'PFJets'+PUMethod+'TrimmedMass_*_*'] + jetSeq += getattr(proc, jetalgo+'PFJets'+PUMethod+'Trimmed' ) + jetSeq += getattr(proc, jetalgo+'PFJets'+PUMethod+'TrimmedMass' ) + getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod).userData.userFloats.src += [ jetalgo+'PFJets'+PUMethod+'TrimmedMass'] + toolsUsed.append( jetalgo+'PFJets'+PUMethod+'TrimmedMass' ) + + if addFiltering: + + setattr( proc, jetalgo+'PFJets'+PUMethod+'Filtered', + ak8PFJetsCHSFiltered.clone( + src = cms.InputTag( jetalgo+'PFJets'+PUMethod+'Constituents', 'constituents' ), + rParam = jetSize, + jetAlgorithm = algorithm, + rFilt= rfilt, + nFilt= nfilt ) ) + setattr( proc, jetalgo+'PFJets'+PUMethod+'FilteredMass', + ak8PFJetsCHSFilteredMass.clone( src = cms.InputTag( jetalgo+'PFJets'+PUMethod), + matched = cms.InputTag( jetalgo+'PFJets'+PUMethod+'Filtered'), + distMax = cms.double( jetSize ) ) ) + elemToKeep += [ 'keep *_'+jetalgo+'PFJets'+PUMethod+'FilteredMass_*_*'] + jetSeq += getattr(proc, jetalgo+'PFJets'+PUMethod+'Filtered' ) + jetSeq += getattr(proc, jetalgo+'PFJets'+PUMethod+'FilteredMass' ) + getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod).userData.userFloats.src += [ jetalgo+'PFJets'+PUMethod+'FilteredMass'] + toolsUsed.append( jetalgo+'PFJets'+PUMethod+'FilteredMass' ) + + if addCMSTopTagger : + + if 'CA' in jetALGO : + + setattr( proc, 'cmsTopTagPFJets'+PUMethod, + cms.EDProducer("CATopJetProducer", + PFJetParameters.clone( + src = cms.InputTag( jetalgo+'PFJets'+PUMethod+'Constituents', 'constituents' ), + doAreaFastjet = cms.bool(True), + doRhoFastjet = cms.bool(False), + jetPtMin = cms.double(100.0) + ), + AnomalousCellParameters, + CATopJetParameters.clone( jetCollInstanceName = cms.string("SubJets"), + verbose = cms.bool(False), + algorithm = cms.int32(1), # 0 = KT, 1 = CA, 2 = anti-KT + tagAlgo = cms.int32(0), #0=legacy top + useAdjacency = cms.int32(2), # modified adjacency + centralEtaCut = cms.double(2.5), # eta for defining "central" jets + sumEtBins = cms.vdouble(0,1600,2600), # sumEt bins over which cuts vary. vector={bin 0 lower bound, bin 1 lower bound, ...} + rBins = cms.vdouble(0.8,0.8,0.8), # Jet distance paramter R. R values depend on sumEt bins. + ptFracBins = cms.vdouble(0.05,0.05,0.05), # minimum fraction of central jet pt for subjets (deltap) + deltarBins = cms.vdouble(0.19,0.19,0.19), # Applicable only if useAdjacency=1. deltar adjacency values for each sumEtBin + nCellBins = cms.vdouble(1.9,1.9,1.9), + ), + jetAlgorithm = cms.string("CambridgeAachen"), + rParam = cms.double(jetSize), + writeCompound = cms.bool(True) + ) + ) + + setattr( proc, "CATopTagInfos", + cms.EDProducer("CATopJetTagger", + src = cms.InputTag('cmsTopTagPFJets'+PUMethod), + TopMass = cms.double(171), + TopMassMin = cms.double(0.), + TopMassMax = cms.double(250.), + WMass = cms.double(80.4), + WMassMin = cms.double(0.0), + WMassMax = cms.double(200.0), + MinMassMin = cms.double(0.0), + MinMassMax = cms.double(200.0), + verbose = cms.bool(False) + ) + ) + addJetCollection( + proc, + labelName = 'CMSTopTag'+PUMethod, + jetSource = cms.InputTag('cmsTopTagPFJets'+PUMethod), + jetCorrections = JEC if JEC is not None else None, + pfCandidates = cms.InputTag( pfCand ), + pvSource = cms.InputTag( pvLabel), + svSource = cms.InputTag( svLabel ), + muSource = cms.InputTag( muLabel ), + elSource = cms.InputTag( elLabel ), + btagDiscriminators = bTagDiscriminators, + btagInfos = bTagInfos, + genJetCollection = cms.InputTag(jetalgo+'GenJetsNoNu'), + getJetMCFlavour = False, # jet flavor should always be disabled for groomed jets + genParticles = cms.InputTag(genParticlesLabel) + ) + getattr(proc,'patJetsCMSTopTag'+PUMethod).addTagInfos = True + getattr(proc,'patJetsCMSTopTag'+PUMethod).tagInfoSources = cms.VInputTag( cms.InputTag('CATopTagInfos')) + setattr( proc, 'selectedPatJetsCMSTopTag'+PUMethod, selectedPatJets.clone( src = 'patJetsCMSTopTag'+PUMethod, cut = Cut ) ) + + addJetCollection( + proc, + labelName = 'CMSTopTag'+PUMethod+'Subjets', + jetSource = cms.InputTag('cmsTopTagPFJets'+PUMethod, 'SubJets'), + algo = jetalgo, # needed for subjet b tagging + rParam = jetSize, # needed for subjet b tagging + jetCorrections = subJEC if subJEC is not None else None, + pfCandidates = cms.InputTag( pfCand ), + pvSource = cms.InputTag( pvLabel), + svSource = cms.InputTag( svLabel ), + muSource = cms.InputTag( muLabel ), + elSource = cms.InputTag( elLabel ), + btagDiscriminators = bTagDiscriminators, + btagInfos = bTagInfos, + genJetCollection = cms.InputTag( jetalgo+'GenJetsNoNu'), + getJetMCFlavour = GetSubjetMCFlavour, + explicitJTA = True, # needed for subjet b tagging + svClustering = True, # needed for subjet b tagging + fatJets=cms.InputTag(jetalgo+'PFJets'+PUMethod), # needed for subjet flavor clustering + groomedFatJets=cms.InputTag('patJetsCMSTopTag'+PUMethod), # needed for subjet flavor clustering + genParticles = cms.InputTag(genParticlesLabel) + ) + + setattr( proc, 'selectedPatJetsCMSTopTag'+PUMethod+'Subjets', selectedPatJets.clone( src = 'patJetsCMSTopTag'+PUMethod+'Subjets', cut = Cut ) ) + getattr( proc, 'selectedPatJetsCMSTopTag'+PUMethod+'Subjets' ).addTagInfos = cms.bool(True) + + setattr( proc, 'patJetsCMSTopTag'+PUMethod+'Packed', + cms.EDProducer("BoostedJetMerger", + jetSrc=cms.InputTag('patJetsCMSTopTag'+PUMethod ), + subjetSrc=cms.InputTag('patJetsCMSTopTag'+PUMethod+'Subjets') + )) + jetSeq += getattr(proc, 'patJetsCMSTopTag'+PUMethod+'Packed' ) + elemToKeep += [ 'keep *_patJetsCMSTopTag'+PUMethod+'Packed_*_*' ] + toolsUsed.append( 'patJetsCMSTopTag'+PUMethod+'Packed' ) + + else: print '|---- jetToolBox: CMS recommends CambridgeAachen for CMS Top Tagger, you are using '+algorithm+'. JetToolbox will not run CMS Top Tagger.' + + if addMassDrop : + + if 'CA' in jetALGO : + setattr( proc, jetalgo+'PFJets'+PUMethod+'MassDropFiltered', + ca15PFJetsCHSMassDropFiltered.clone( + rParam = jetSize, + src = cms.InputTag( jetalgo+'PFJets'+PUMethod+'Constituents', 'constituents' ), + ) ) + setattr( proc, jetalgo+'PFJets'+PUMethod+'MassDropFilteredMass', ak8PFJetsCHSPrunedMass.clone( src = cms.InputTag( jetalgo+'PFJets'+PUMethod), + matched = cms.InputTag(jetalgo+'PFJets'+PUMethod+'MassDropFiltered'), distMax = cms.double( jetSize ) ) ) + elemToKeep += [ 'keep *_'+jetalgo+'PFJets'+PUMethod+'MassDropFilteredMass_*_*' ] + getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod).userData.userFloats.src += [ jetalgo+'PFJets'+PUMethod+'MassDropFilteredMass' ] + jetSeq += getattr(proc, jetalgo+'PFJets'+PUMethod+'MassDropFiltered' ) + jetSeq += getattr(proc, jetalgo+'PFJets'+PUMethod+'MassDropFilteredMass' ) + else: print '|---- jetToolBox: CMS recommends CambridgeAachen for Mass Drop, you are using '+algorithm+'. JetToolbox will not run Mass Drop.' + toolsUsed.append( jetalgo+'PFJets'+PUMethod+'MassDropFilteredMass' ) + + if addHEPTopTagger: + if ( jetSize >= 1. ) and ( 'CA' in jetALGO ): + + setattr( proc, 'hepTopTagPFJets'+PUMethod, hepTopTagPFJetsCHS.clone( src = cms.InputTag( jetalgo+'PFJets'+PUMethod+'Constituents', 'constituents' ) ) ) + setattr( proc, 'hepTopTagPFJets'+PUMethod+'Mass'+jetALGO, ak8PFJetsCHSPrunedMass.clone( src = cms.InputTag( jetalgo+'PFJets'+PUMethod), + matched = cms.InputTag("hepTopTagPFJets"+PUMethod), distMax = cms.double( jetSize ) ) ) + elemToKeep += [ 'keep *_hepTopTagPFJets'+PUMethod+'Mass'+jetALGO+'_*_*' ] + getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod).userData.userFloats.src += [ 'hepTopTagPFJets'+PUMethod+'Mass'+jetALGO ] + jetSeq += getattr(proc, 'hepTopTagPFJets'+PUMethod ) + jetSeq += getattr(proc, 'hepTopTagPFJets'+PUMethod+'Mass'+jetALGO ) + toolsUsed.append( 'hepTopTagPFJets'+PUMethod+'Mass'+jetALGO ) + else: print '|---- jetToolBox: CMS recommends CambridgeAachen for HEPTopTagger, you are using '+algorithm+', and a jet cone size bigger than 1. JetToolbox will not run HEP TopTagger.' + + ####### Nsubjettiness + if addNsub: + from RecoJets.JetProducers.nJettinessAdder_cfi import Njettiness + + rangeTau = range(1,maxTau+1) + setattr( proc, 'Njettiness'+jetALGO+PUMethod, + Njettiness.clone( src = cms.InputTag( jetalgo+'PFJets'+PUMethod), + Njets=cms.vuint32(rangeTau), # compute 1-, 2-, 3-, 4- subjettiness + # variables for measure definition : + measureDefinition = cms.uint32( 0 ), # CMS default is normalized measure + beta = cms.double(1.0), # CMS default is 1 + R0 = cms.double( jetSize ), # CMS default is jet cone size + Rcutoff = cms.double( 999.0), # not used by default + # variables for axes definition : + axesDefinition = cms.uint32( 6 ), # CMS default is 1-pass KT axes + nPass = cms.int32(999), # not used by default + akAxesR0 = cms.double(-999.0) ) ) # not used by default + + elemToKeep += [ 'keep *_Njettiness'+jetALGO+PUMethod+'_*_*' ] + for tau in rangeTau: getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod).userData.userFloats.src += ['Njettiness'+jetALGO+PUMethod+':tau'+str(tau) ] + jetSeq += getattr(proc, 'Njettiness'+jetALGO+PUMethod ) + toolsUsed.append( 'Njettiness'+jetALGO+PUMethod ) + + ####### Nsubjettiness + if addNsubSubjets and (addPrunedSubjets or addSoftDropSubjets): + + from RecoJets.JetProducers.nJettinessAdder_cfi import Njettiness + + if addSoftDropSubjets: groomer = 'SoftDrop' + elif addPrunedSubjets: groomer = 'Pruned' + typeSubjetColl = jetALGO+'PF'+PUMethod+groomer+'Subjets' + rangeTau = range(1,subjetMaxTau+1) + setattr( proc, 'Nsubjettiness'+typeSubjetColl, + Njettiness.clone( src = cms.InputTag( jetalgo+'PFJets'+PUMethod+groomer,'SubJets' ), + Njets=cms.vuint32(rangeTau), # compute 1-, 2-, 3-, 4- subjettiness + # variables for measure definition : + measureDefinition = cms.uint32( 0 ), # CMS default is normalized measure + beta = cms.double(1.0), # CMS default is 1 + R0 = cms.double( jetSize ), # CMS default is jet cone size + Rcutoff = cms.double( 999.0), # not used by default + # variables for axes definition : + axesDefinition = cms.uint32( 6 ), # CMS default is 1-pass KT axes + nPass = cms.int32(999), # not used by default + akAxesR0 = cms.double(-999.0) ) ) # not used by default + + elemToKeep += [ 'keep *_Nsubjettiness'+typeSubjetColl+'_*_*' ] + for tau in rangeTau: getattr( proc, 'patJets'+typeSubjetColl).userData.userFloats.src += ['Nsubjettiness'+typeSubjetColl+':tau'+str(tau) ] + jetSeq += getattr(proc, 'Nsubjettiness'+typeSubjetColl ) + toolsUsed.append( 'Nsubjettiness'+typeSubjetColl ) + + ###### QJetsAdder + ''' + if addQJets: + ### there must be a better way to do this random number introduction + setattr( proc, 'RandomNumberGeneratorService', cms.Service("RandomNumberGeneratorService", + QJetsAdderCA8 = cms.PSet(initialSeed = cms.untracked.uint32(7)), + QJetsAdderAK8 = cms.PSet(initialSeed = cms.untracked.uint32(31)), + QJetsAdderCA15 = cms.PSet(initialSeed = cms.untracked.uint32(76)), ) ) + + from RecoJets.JetProducers.qjetsadder_cfi import QJetsAdder + setattr( proc, 'QJetsAdder'+jetALGO, + QJetsAdder.clone( src = cms.InputTag(jetalgo+'PFJets'+PUMethod), + jetRad = cms.double( jetSize ), + jetAlgo = cms.string( jetALGO[0:2] ))) + elemToKeep += [ 'keep *_QJetsAdder'+jetALGO+'_*_*' ] + getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod).userData.userFloats.src += ['QJetsAdder'+jetALGO+':QjetsVolatility'] + jetSeq += getattr(proc, 'QJetsAdder'+jetALGO ) + toolsUsed.append( 'QJetsAdder'+jetALGO ) + ''' + + ###### QGTagger + if addQGTagger: + if ( 'ak4' in jetalgo ) and ( PUMethod not in ['Puppi','CS','SK'] ) : + from RecoJets.JetProducers.QGTagger_cfi import QGTagger + proc.load('RecoJets.JetProducers.QGTagger_cfi') ## In 74X you need to run some stuff before. + setattr( proc, 'QGTagger'+jetALGO+'PF'+PUMethod, + QGTagger.clone( + srcJets = cms.InputTag(jetalgo+'PFJets'+PUMethod), # Could be reco::PFJetCollection or pat::JetCollection (both AOD and miniAOD) + jetsLabel = cms.string('QGL_AK4PF'+QGjetsLabel) # Other options (might need to add an ESSource for it): see https://twiki.cern.ch/twiki/bin/viewauth/CMS/QGDataBaseVersion + ) + ) + elemToKeep += [ 'keep *_QGTagger'+jetALGO+'PF'+PUMethod+'_*_*' ] + getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod).userData.userFloats.src += ['QGTagger'+jetALGO+'PF'+PUMethod+':qgLikelihood'] + jetSeq += getattr(proc, 'QGTagger'+jetALGO+'PF'+PUMethod ) + + toolsUsed.append( 'QGTagger'+jetALGO+'PF'+PUMethod ) + else: + print '|---- jetToolBox: QGTagger is optimized for ak4 jets with CHS. NOT running QGTagger' + + + ####### Pileup JetID + if addPUJetID: + if ( 'ak4' in jetalgo ) and ( 'CHS' in PUMethod ): + from RecoJets.JetProducers.pileupjetidproducer_cfi import pileupJetIdCalculator,pileupJetIdEvaluator + + setattr( proc, jetALGO+'PF'+PUMethod+'pileupJetIdCalculator', + pileupJetIdCalculator.clone( + jets = cms.InputTag(jetalgo+'PFJets'+PUMethod), + rho = cms.InputTag("fixedGridRhoFastjetAll"), + vertexes = cms.InputTag(pvLabel), + applyJec = cms.bool(True), + inputIsCorrected = cms.bool(False) + )) + + setattr( proc, jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator', + pileupJetIdEvaluator.clone( + jetids = cms.InputTag(jetALGO+'PF'+PUMethod+'pileupJetIdCalculator'), + jets = cms.InputTag(jetalgo+'PFJets'+PUMethod), + rho = cms.InputTag("fixedGridRhoFastjetAll"), + vertexes = cms.InputTag(pvLabel) + ) + ) + + getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod).userData.userFloats.src += [jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator:fullDiscriminant'] + getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod).userData.userInts.src += [jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator:cutbasedId',jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator:fullId'] + elemToKeep += ['keep *_'+jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator_*_*'] + toolsUsed.append( jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator' ) + else: + print '|---- jetToolBox: PUJetID is optimized for ak4 PFjets with CHS. NOT running PUJetID.' + + ###### Energy Correlation Functions + if addEnergyCorrFunc: + from RecoJets.JetProducers.ECF_cfi import ECF + rangeECF = range(1,maxECF+1) + setattr( proc, jetalgo+'PFJets'+PUMethod+'ECF', ECF.clone( + src = cms.InputTag(jetalgo+'PFJets'+PUMethod), + Njets = cms.vuint32( rangeECF ), + beta = cms.double( ecfBeta ) + )) + + elemToKeep += [ 'keep *_'+jetalgo+'PFJets'+PUMethod+'ECF_*_*'] + for ecf in rangeECF: getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod).userData.userFloats.src += [ jetalgo+'PFJets'+PUMethod+'ECF:ecf'+str(ecf) ] + jetSeq += getattr(proc, jetalgo+'PFJets'+PUMethod+'ECF' ) + toolsUsed.append( jetalgo+'PFJets'+PUMethod+'ECF' ) + + if hasattr(proc, 'patJetPartons'): proc.patJetPartons.particles = genParticlesLabel + + + setattr( proc, 'selectedPatJets'+jetALGO+'PF'+PUMethod, selectedPatJets.clone( src = 'patJets'+jetALGO+'PF'+PUMethod, cut = Cut ) ) + elemToKeep += [ 'keep *_selectedPatJets'+jetALGO+'PF'+PUMethod+'_*_*' ] + elemToKeep += [ 'drop *_selectedPatJets'+jetALGO+'PF'+PUMethod+'_calo*_*' ] + elemToKeep += [ 'drop *_selectedPatJets'+jetALGO+'PF'+PUMethod+'_tagInfos_*' ] + + + if len(toolsUsed) > 0 : print '|---- jetToolBox: Running '+', '.join(toolsUsed)+'.' + print '|---- jetToolBox: Creating selectedPatJets'+jetALGO+'PF'+PUMethod+' collection.' + + ### "return" + setattr(proc, jetSequence, jetSeq) + if hasattr(proc, outputFile): getattr(proc, outputFile).outputCommands += elemToKeep + else: setattr( proc, outputFile, + cms.OutputModule('PoolOutputModule', + fileName = cms.untracked.string('jettoolbox.root'), + outputCommands = cms.untracked.vstring( elemToKeep ) ) ) + + if runOnData: + from PhysicsTools.PatAlgos.tools.coreTools import removeMCMatching + removeMCMatching(proc, names=['Jets'], outputModules=[outputFile]) diff --git a/AnalysisFW/test/jetToolbox_cff.pyc b/AnalysisFW/test/jetToolbox_cff.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a6a002c4ff84bf719bd107796304f6a3ddfa1432 GIT binary patch literal 23685 zcmc(H3w%`BdEa+OLLecK76IbD!@>d!tagE2VDavP5E4%bF%r9r{2-$_S7KmZ%)P_H zcBZLAl4i5+rgfaOahtSmlcuqoIDMpb`fy#>O_Mlj)8^5pk2L8cuA9bn>oj$n#L55v zopWdIykOb>+#oS?p5OW2-*?WvM?GIzGw_Rrue_QO_wOLSPvL)X#}hI5^&}^9)03MC zS?JN0gyec9zd{yPNWM=N`Xs+n7FJ4rl`O21e7`L8OMXBW1|+{)7FJ7sP!td;zbEDTA0SQdsQ|ClU1Ci!);uueR#*CV+R$*-4%^|szCxeb!vC<_~HeTC#k zWu7BZ+Eg!Xu9vpdOIvNJPjcHNzg-r#TL>#9w?p!e%fjR0`AIRW#Po~5lfNtv$g&re zJ<{LO$SJGE308guPF?WBAY8Atr)6rL#;OW~$29nE-&cwq+)Yg&@p^6~6$+tpL_6X?dz!N6SERuY9dE#&(b=q@>A{C%JK@S9iq+~Rd};b%!nAM^ae2- z#f*yCBxbXiEn>Ec*(PSYm>pss7X!nAxji8UI=@@YlVbLW*(+wBn5V?-7jr<&K`~E@ z858r27%Yv24vRS=<~cFXi#aOhm@GdfH8dU<^MaTYV%{U>MKLdld0CcMO6`c!zS*l{ z)=Ap+F*K3*Q&IyId;$h)Rwc}DfCRO!*=(yD<<>MY& zFu8i1liAh7F@SO(Q;y2*;~surHRDoyK_KwzQMvC4l+TWG@=34WWzNV33@u>9 zBt`O^-0UM3m^fNHA*?6r_4h~>zlY@3N-28@GbQG%++4{PEHY}&L4p`?)|>|<&F{Z(Vfc*HK*MFJ zof0!EwFxm-q;^KAMCAlDr~ti5No|sPS6;%ndPFF*n8B5|a~?7gG>Zl;wV@t)WtfBT^mU`Zw2W`3TGS4PNUt zC4oGlc)`wIbK8~6M|x>BYBI|`QX7y0Bx9>kWk?Tx9{u)%h93lQID@-8ODYc~E>cyDaSur71 zelC)7MbV|^4-yF2fLM2ZRP}spg>5&}QTrzHuc3GW&6J9VWeEC?nAat@S@K(?c22y8 zc<;ha&N+2-Yn>%bb5FvpEz<67(@xBG>s0%tdRUG6Csvp@)b!0Cf%*3!3R5#85%%(p~ze{3a1^R1G5T=Ge& zU5F$1$AR1hMb641ay?cV%(toQ*-7_7c{vYaWdv7vbtT4GH$*=IVC2#hO={BUAhQ}G zd~;<)%9|ZY`SysEw-a@{EPq!&J#ccBc`Fj+&k_Y{--jT`+iUxsJAJEzJ9RYG-RYko zO>OS&oWOu(e^f--9T!&r$X0W{cTv>RaoNWd6~PG9QU#{!xv( zeKBPIERcChk?G(xY)FG<{CYpw-%va38qqgf%h3`EHNxsJ#kB64tm$m5{JOi#`X zAoA2^q_CGQ$Z%kD&`d1Ja?Ol799Z2DCunB2V!jWYgu_Rw@#h<< z2CdW$prJ=LQXM3w&PECso8{304XHxid%Oc^^*9n+nz%Wo2@g;?&BvI07zjic`-?6y zicKN5e~IayOLD%S++{-0FXdlbjWW|M0Q!Mwszy2Um!s-w5@>!fssav@CpP_+s7XV* z`Jt$a>@lh;mr$Vg4RPKN_j7`TH`e+m{y`fjXuu3eBc09kmY_M%rhiew$cs z9+I1frT69&s&SD;VIEgaAo5kmnViMfBv541Ry53lpB`%P=F{MbCh8%!UjLw(t+Dig z!iXu2X_E?jA*4;JYY!HWr{bY=7#ZTOLn$S~z=ev}9=&Y`oh6gnPId_?nGUuYNw1rI zesHK^pDpJ03A!~fwUcH3Ft_L34Q#d3J@c6+qardPc8PXV)GS%{!ROK2iN?&1RQ|*6 zR8sX}KP`k_jvUd=;VRs7M@Q5`cZ*+o=Uyl7!5}b)5PT8#axK2-vufG@NIyTg>s*!;HA&YJ*MuWxe808IUFcgwcpL2elw?C6%AC|bN#J#E^w;s2*w z1~Of}1qpblTmJd(R6fKldmFzlZn>k=jc15)UkxcbEZ?PDcEWtPTLz!HGMYSmG`EZy zRLgE|`4_O*L*24Ny_;L+5)XIFSSfN7?QZ!OTgP`a)~;9kxI*x2y*!=3h#6o0xwk)$Is_D>`S(zYMr9JgSccGTnV_yR-Y( z4eoSuz=ZYy2Mi2d_oF#r%&R-#wrrU|ArLZrhm==tZD;tu0b@>dV@!M`@H2=AI z;;(BJ4_UsTaQ;hFwY&H)M%DkSy}zMVtn%Nq`kPukrB9f?B<8;h49|QyYWyE!^p}nQ zGiv;b82x4AZ$*v&ON{=q@wcPK|1Cy;(Rg20P9X5+J1i>mZrmQNX_&RmZjZdr|dkTK)Z~iqk{P_4MQc{IG))QME^V zd!wrDT@h7nZ?hckdjlZUtM8IbpVxFg6GJ$D9&>wpBe7^XkNJ9RgRWWQ?6h6H@2&B0 z0OK6jO2rjq4|#@_dzS#BbZU)6s5Zl}>HMRST+f(h_m0-)p30j#CdwR6f4r z>yoH+%Sq~td5n2&XoNN6WV`x@B4< z2YXauF^)izvA0j}GI&>nI=&^+@!eAX)NVf9+Un&dB|jy#S%e3?tMLV?KFLptuXZK! zn%g|`j3J{s+l}vJ(sm6(XQg^Y$n!wujGl46xEm*TwK*x^$r4U3 zzPj7|j8>6hH=e9i=O9hE!`i&Qg9EAUZI{|pUUmLK5>p`dAoLGkaQhY6xX|#z4Tbhn zv(P|Mv#>0cT?F-;PsRjgM>Y$|wK)OpmvU_{UIv4gW=37v3zavodVDRZvX{a-;N{Ls z{({u5Lf!1M*n`x-C|W+P>K8r#s$NxN8B=A&3mc8+Bs7O-v>ER4S+9CPQy&*8sKD4hFBgnamGHqiXnPZBUq$k<`m!{K|>%HUkaO47S3=sIC!i6|bJK-Lb^0)4%5GTCcWy#}pxYz1&VXW?9uDQ4nQ)qJr zSiSa+V#BqjU{HOU)$UISC+h^zi(j)|9Q(6Jdf+!@z4$`27ysH*4d>88N|Qmf_E~2U z0v$ZoI_qI<`TO@*U)Gm1QgR)x8;{*=qWhVqrw)w_x;gqZWziiTRy1-7cAjf?4d?3& z>d<+i-Wkp_1Ez+bmRoqW@f!}9i=MgU@ij|rAI001HUl=(%`40>Yj8<0-l=_w8*$H) zU&ZzrJp;@hLq{}sGx>6uxzKiDF?-xW3RRMhesr&1%_ zYm<0cZ|6a3Y z9VBO`Cej6yHR;d~V)Mg3^p6+9?8PulpqRdeM+|szIh|iDXU(!dp3dCBJKOBar1i@U zycO!J&v+Z&eIK{4LZ@v#lRmERSmWjKXHy$68@nbfbn(#a6yBD0mBaDMk$45Kpf`r$ z?ej+EXuNVPUctNbjbSg?3SZdAqR-kIUo=+~X0Oi9o`;ZG1rqTp(1=%oNW2PE;#D9M zuL7NT6$r(vK*?5D*O9XIl@VHV7eiYHPW3Vns+WOHy$n?9W#CaS1BrSW7}U#H9%Uy5 zFa#C8hp+r_B`oVoSk#rUq$^=TSHg0xgvDG5OSuvjvRb8l*A*`vy1cX$_@Q2)xO8YL z9q?uSkc_x==)&y0>!m<09ZvbVbeO&4t9&jU8D9*Fxk~8UxzA6fb9aiBvITn#mjgn) z+Ru9nmkwV#lJbMBsibo$UYT&O$F{96T!*{Cz2s=J|qL0=UDPu zv64)e{bYq!u03PHa~+qsFgZVe`SPXHmtRY!uFlMypE;YnJd>Qx7P8})&m^ZVr;-8L zm&CZa!ps8-b=xy4DvXe$@zia1}QEr<+25TE~j@;W^olIUB34U*pkg)1YJ>J zyXHVv!NfZ^qq9;dr8BpDGhfD6FkUeAsYJp}ov!e<2(N&+hDqMxD6^5bXDo!cLsQIb za~$ERVi{@{%oJxT&Z`y7Y*?PtDfSXcgC&n#twX91vHt2=8zBz;9=IWA^iMRHu?tuvV}|zdV9yON2E4g33z)Z1r4J7#&CIPDZ5-L!z~mGW0sqB ztpwpqdKD^8LtOGZh{KYiJ5j74)D@P`WtVSEE-jq~blh4B!Y)H*E9LqSYIbP}6K2cB z#q?q}mksaLJE_^)dAd{Y9_^jW=1V!hiBkV=D6UMp(=o_=M#0W3u)sv@7wrLzTF;zh0$6(e{PAMNTl14jy9QlLxITVIh= zyOD=VpS7x3ajk77HY8e44wM zd>2f@tR@ao+q!XxXk1h@=vkDgMw4Y2!*`uwF1N7ULZug-nq-jhiMb9e#x=Z&IgR7) z+Mumuf|PZS76OLYoCpk^m`l+&1^4msU?u|g1GJ32?}B}t7U!R4IZNeYe)bhh9X_J~ibhy0HEd2p@?tRzi}^;Qy6UdDHIYGsOMM7S zX)f2eEXq98X6THLwp|Tob}D!pE$y-%kL*6Yk>z%#ZuUr%NLR++O$%lylL_dM}xs z`E-b_s8JM6HVCKFcLTQH^8HeB|Mh?jjZeD1|N4Gi&E^Z51xEd9alk&Rr$~)*ENTHN zkaC~{eMjSk`Ef-pxHEzL1(`kqkD{~WI7TH{E*FcqoIMq5ieS!a=Bq|@x(Igpyr4Yo zmzR+}Q}MCj9I{c0G0^2v3+V775}U6&2ULS**h;h7kiAq+7y3q~Vs~0)6s|9&Gtdb6<2|t(9;Y<4OYbRAM$_eDk*0)e! zBHo~p3alb6mdNVtCrBhc3%JJyiZWhJ-?ikNDxOlbU*#Z+_U8Fh>Ugw?^T=RZiDpUm zltM#q9C%bs-&H!Wv$oAYE5dm0TW|qimmVhlGjl1U=G#x zsMWIDZ#iVc&cB@G5a6A(Ts@e)7vJY6gQoy@ED4Qt=Yq-Ck)r8Q1#GTm@|aRi7B&6B z2Bz?>jjZc2Vy6xoN-*MEIN&2oI zG{$AA(+Uh{J22NT^q@*ROWzvDz|^zRX0us=dp18ey2}g0c><#3~U92;jkVHm_KjMPC>J98ZX_VOHP_O~4ExeJ$Hef6{ zb9uhLsf{MuWS)oJCEaQQ+w*23oy$~kpoySM-o$z)d8){c)bEl+Dk&GyW2f?sqV5`& zvUhQ!f|K}0$QjS&R9J{Fp$~Cc$uS?kfUPg1T(*D&?|k5LQQxF~kMJpUz|Wc>coM}< zh@4oe5Oy_LL`9dSrJ#Jm&n&4DTYt_C8gg9CxeQzu)5_);5m1A# zXVSSMogz2D*FzT+QQv}kJ25GD_7O0$A57|gseRN04i$Jbm26#+DF=2q(H_Bi^;sMb zUXCU5ssu}5GIMFQ0`Mrb&yL2Bk%sC9Y@*M-8a5@dKeSW!^Tj*<^u#n%Z02>EMiG)~ zC1eroBP#=bK>btSgzr=ZAKI)X+lEJ6vhTh4P!Kq)cL@-70Ne%S?ce^vL7>YR%6=(_ zyhn8&!Cq&T(*^8Xhyu<}Fis7lh+eLaEKO;h^KavC31KEBiAB<3XrBp8p0P=ujyg|E zfV)xU55juF4)~mqVjiO_WpeP@x>Bx~Huiy)QVcFqRDKX*|le3vlA>%=RIC*BEJa47s7Wb8(>z0u1HcIG`SG`>^n`i5P|U;hD*zt>>y^4uh?B+g55!Do33;q}ZO3@)WtS~}97~{Etjkx2+_+^!X zrU)eBPQ|WDs$B6=V(rsiSG8Uqo+WEaPA7C_#xEOWB4M28pZVgsOK0@yh8f%Gmz6nq z;HC!I#|A1yq-r)C=KMmcpIvl@O@5DKai-6wN$zamj$h>;#3utn$FJ+CSY=G%A>g|#xGq>VFp zri2m&i9z+vANR5}KD0%fp=eBe6QDR_46|QdGoQXYkBpf1?3yEdsk0ab6~d7f$I!qr z#-%D6LQuVOfytj+I!Y6J5hplHvfQw-E82HX^5 zXzERVyu}X&GtE)JCPg1YN6~KG=mRvdp#sokxqTuD_PnsHibK9xt>N*y?tFA_puW{Q z%Q_s&mvA6<>%dT!ef-c(8(2r@hF6E+XqU!H_msblRz3gtZJOzpm0lly`d6&*`efMK z>TU3PydC zy$X;4LpIC$ zXv5w%lr~}pzn{?7HCVsH>OG{c-{GWiffMlp9O?J=CWaEA52gJ*>tx2e=sgZD^m(}9 zp>sAVMk5Y0%iSSwAh8#-clHb>HURbx9ogp%fs^1io2`I5^P8xozNF9Q*nRP-Zdb zh(XA`U*({j0mtHe+5o8h*`z!l>7`9X^0b^(j`UFK1L%p*CH9oWaAKpk&)e@b!&230 zoTYZe8}2y_&O^&EduxK0y(uwFOi?1ePb8lA#z4ahpyCN?F}S}eaol^}+oP?cXx|1X zTzSNM4EhvljQt)-Z1&d3Sz2VzIzop2^8ZGxx5nGsHhKd_zXv+9ew6w}OCuhm-e}Ku z?w8Vk2lA_V(?D=L@-CpL!Kh)W@4PF4Ld$L-)Rk<`409b?SIRh<8y^ z8<>qU#jGc|wj+8;h0Qi#(EsZ8rm<&v@b<%Qi0Zq56eEz`Z0>pRdhT(JE~xv8{qgY^ z;`;|g8P+4B1I@;n3O!)Y(Xu1r6y5aIIncC%MW%U$@K9HTx@@gcwE2cX)+a39eRYA`4pN(W=# Q44QORwukP5r9STu0L Date: Thu, 2 Nov 2017 09:38:45 +0100 Subject: [PATCH 13/48] Delete ProcessedTreeProducer_MCPAT25ns_BTag_cfg.pyc --- ...ProcessedTreeProducer_MCPAT25ns_BTag_cfg.pyc | Bin 10626 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 AnalysisFW/test/ProcessedTreeProducer_MCPAT25ns_BTag_cfg.pyc diff --git a/AnalysisFW/test/ProcessedTreeProducer_MCPAT25ns_BTag_cfg.pyc b/AnalysisFW/test/ProcessedTreeProducer_MCPAT25ns_BTag_cfg.pyc deleted file mode 100644 index a910ae23ce7bb3d556157ad226fb1f9fab386d6d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10626 zcmd5?ZGRI7*hav?Ay{CI7vu*p1`b%{2O0ddTFJnj^Pr5?BYEVJMms$+ zc+buy=gTI!%U8$;NM7Bm`%ZbC50Lz;dS*PbEzbM9H)o+yS9eu)RdscBRS(Jk9q9Yd zAO7bNzij#6LqgLevaVONh-R_aubVCFENGWa5 zFhIIr63$goza}=XLCRs4dz8Ks5)v3f-VndT!rvDb z{-uP31UJQD62viBro~}bWXD@9jKu5^eO%PO7PSYW^e~k5OCAoixkCWqWkhKr#JH<5 z^b+0Ez$6b&iPE&NqV^*pzY?2|g&Y%`Gwho8h4VzzXT|0$#F-Vfr$UYkYbMlomXW>| z&NESeE;gS7={X}k5Z2=m=@)F07eYQ1GQ(|HVuHkwm{~8)6oZgOFUlhZABQ031M-s) zd6vPa3}Q9F?JMqi7UDl=P|phkzhLlXIC`DISMA_83}UJE=xYYS98{BxpXDCRHOJsQ zgRg{KU~n-6a||wp$Zr^Y8-mLWt}v)2U*(>)kbIrNZ$mK8;CBqd(FzO}LvqZn5jH}6 z_C)zEM2Licf1>9@tmhkM`%CVDxqijqCWDbd{)R!Q|F`VOz(MT#yRh@`W1Xe2^B;sX z#bH9ot+1yY_Qc=y6BbBsm>nS<5pI}R7w;*!{A>2d z$nWaRGV;3ygOT643`Ty}WH558?-`8T%40C@DQw6?agGFpzi4Tckp3|NxvPVKE#?{t zxXWN9;70}{0Y5Pq3Ao2#B;XGWb`o$d6!6zV?jIA7yE+JXz+58%|B=B+z~3+!3HVP8 zMgsmbgOPy0Ww4WgdW$Uxc_`%X*azUx+E@Q2bP2r~e`FA@`>(|C&`8n(U`y(V_ixl0 z9!mcn2Y#;s#GH^bk>o^4@837f0pg)^PK4Q^XIo8kNgIFw! z(h3~`#j*cDK4AYJ{?^A5X!^Z)m^+X2xn;{&et#UAe^VSY2&Yf?E?Esi(tShdE4H@K zkvBcFZuyoMj1bAVMjAv@S&miqEtxm{BWmO$;=82{vs$%07Gd3QH68m0FnNoidACuq zt1Zv;ZMTsr`es9#o-A75x2#6lQkk6RHhkOifG2IjQKcov-7+0;ES1r@Ftl54-cddpGLLWbwIKcSRC-6_szGS)3*V`*tWp`nY$!5+#wq{lvmT#AHw&lpuqo*58 zISxu#gk#^Mc5+6r=lHcA_c3Ew>uA?$o;;d73Ri1&D-Jrc{O!RihVeq)^tkj!$qe9bQz}Bnp%db^${~HBr%!| z37*nI%V%V}L*s%WpNoT$z%cR`BvR;VDSwE~{Ni-UUUD~l>6O?Y;W-Y4UO_C%H*JjM zYmveZoQ2D4kCEB7aTvIENz{f#S8YTb69V};(|S47oyJn|aba z5CCa@LX<9tiZ8aw#g3BWOgOA!K7hq7Oex+A)9=nf6p^`>JLadc9OvG*S7i1q2X{+~sRYd|Mr zvr;?@&p(42=XwiV%Wi$kZdk~H+9Z8H9U16Lo_qe!;!#@Atb}-P8)c`Z?A_xgh%rvJ z5v;w>#>ObUYF6^DLKe1bg-kmOsqxpXDl)sX;FC)+!dcQTSbZOWJVD&a*GB$I^FbKB#z2b>5sO*{XDIRIGxX>)m>`TEI(}`b@4D* zXOy&OO1q`f%`m%7`@}Z8!aw;OpX;krIa5(u%ZL8zbis01F%3S-ZYkGk`Bvc~DAiBP z^l<1PThbZ#y1U-OF$*4E8T(y`s?~_n!kp_t0L3_D2#+%~&g7vLI>?-wAtwqMZl&U2zvUrf5Ehtt z7()<~BVAT0w`_BX!q!5rS)c_#$mNy73@WsOS|z(M6y>Ihs-qptYNp3aVH(SBSsE{m zGZUoI#6*$RpMPInwRbGX-gaHdrieQMFN{Vf$3TKxpd@pQwg9K56~{GolGP`Z%*ru-v6g=49OsLS1Y|YRg0(~i~W}#`nvt+bd zdrgbC6WWnx{J_?|%V|_}XjNqE%?_ z9<}|TO`FoE>g=7eBwOLTB{0$sIfg;O5A|ELCd`VOK!w=Il(#27y57!2bD~*A1hpJz zf~vG^!*o#ZsfqcuV(~-iX=$=F^{52DD{oItAUI7F*Ye8~Ay)3g1Z~?1#BPqga>KK* zqjVKoTAR;jH>PJ$y3fJ#h&k0vbB~uC;!%j&azD*MDD@)=ndmWkjm1Q7vd8E%MvQ)Z zdJ=aNSB$~LU{4Q0`jZ$i9vG>_K%(EcN57z=kv`*EvK>wtJ;@|SE*fYBpFv~L7{>S9 z^`68iC{so%dBb>V+)P|e{LFZ4@M_?)gr&qU)*M$LsxU!f-oqpJ0Rha)tl^|FtJbPZ z*Bk8+)v2}&@#FFMoo_o7tx=xm5Q&SHw~LTN`06I`*XB#7+i{xfPc;ji4#jv__ph3J zmN!Mkc@!S?rNTEIY4zm|B4j`tyUc0l!2uj5iJe%5MX=SC|5da?(l@3=@}{y4+z9DN z^&!HeeW>jk?4-AiimP}7kv^T+I7hLg;Rk0IrT}%b1^R~&i0Q%lY%D0i zHY+$tIXqy|aDkz?jm^(WQY^~ng2=>YF41T`>6B|5Bb6xT@i6I5fuUxV-!;lbWEFI_ zMiAlZ134JhcNcV0fSe;L?E6ygvp z=1s>fY`gw7fED|bC6_!~q9e#GvW`O-Ob_gQj&SK{J{_0$B;mc&F_4UdqetIdksGlW z)y+@8!hHt)jl5=KA_IY)e49Lmd7xumCp0$SCy~+62glC)Y%~DN%WJ06N2RUS=1mWB z28R{!cs5#qCXO`Z3O0p-HLKBL12uIt@hI;HT)IY0pH#`Db>8#LzmRb)>^gpu@~( zb(ra-0|t(C0B|OWf_2ceXQBvnAThKKXps)IdG$R)kzaklcPYWe9WZS>PGV`P$}L|# z!|yFy<;)!`eeYhnfuNaw^)mgK0CP)?{cu11;$?c8;U*W^cpc(xyWFd&lBfH691IzJ z^}bdazRE!^oilBx6s*QIIKNH|uvtMavJa%}8N|=d6N@frWra1WtEiNAJ+=m=A^sgaPIopgM=~Jd ziwItt(-D#Mg!LLP4X=Dh)C~()dAKNm2vz@fM{|XxHcLtylhXjKFV!eI*V6668V%CD zW4n)Kk(Xqm_gDqm`+RU!`3z9 zbo1B?99xh)Jet-ihxv(*Ma6p|xbPs^6~ALD(CJsGQ?Qzd zNW3#WZi2J7$Ga|GcyLTZ%;NV}T+J62Xac&HLSBV@Tj%C9HL8DXk*NGFydXqM8F13V zA^E~4cG+?w3^B2;eROpY6$fo@^*uNiz9rtD Date: Thu, 2 Nov 2017 09:38:57 +0100 Subject: [PATCH 14/48] Delete ProcessedTreeProducer_MCPAT25ns_BTag_cfg.py --- ...rocessedTreeProducer_MCPAT25ns_BTag_cfg.py | 332 ------------------ 1 file changed, 332 deletions(-) delete mode 100644 AnalysisFW/test/ProcessedTreeProducer_MCPAT25ns_BTag_cfg.py diff --git a/AnalysisFW/test/ProcessedTreeProducer_MCPAT25ns_BTag_cfg.py b/AnalysisFW/test/ProcessedTreeProducer_MCPAT25ns_BTag_cfg.py deleted file mode 100644 index 011a3c5a6e8..00000000000 --- a/AnalysisFW/test/ProcessedTreeProducer_MCPAT25ns_BTag_cfg.py +++ /dev/null @@ -1,332 +0,0 @@ -# -*- coding: utf-8 -*- - -import FWCore.ParameterSet.Config as cms - -from RecoJets.Configuration.RecoPFJets_cff import ak4PFJets, ak4PFJetsCHS -from RecoJets.Configuration.RecoGenJets_cff import ak4GenJets -from RecoJets.JetProducers.SubJetParameters_cfi import SubJetParameters -from RecoJets.JetProducers.PFJetParameters_cfi import * -from RecoJets.JetProducers.GenJetParameters_cfi import * -from RecoJets.JetProducers.AnomalousCellParameters_cfi import * -from PhysicsTools.PatAlgos.producersLayer1.patCandidates_cff import * -from PhysicsTools.PatAlgos.selectionLayer1.jetSelector_cfi import selectedPatJets -from PhysicsTools.PatAlgos.tools.jetTools import * -#from PhysicsTools.PatAlgos.producersLayer1.metProducer_cfi import patMETs -from PhysicsTools.PatAlgos.patSequences_cff import * -#nnfrom PhysicsTools.PatAlgos.tools.metTools import addMETCollection -#from RecoJets.JetProducers.pileupjetidproducer_cfi import * -from PhysicsTools.PatAlgos.patTemplate_cfg import * -from PhysicsTools.PatAlgos.tools.jetTools import * -from RecoJets.JetProducers.QGTagger_cfi import QGTagger - -## Modified version of jetToolBox from https://github.com/cms-jet/jetToolbox -## Options for PUMethod: Puppi, CS, SK, CHS - -# -*- coding: utf-8 -*- -import FWCore.ParameterSet.Config as cms - -process = cms.Process("Ntuplizer") -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -#! Conditions -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_condDBv2_cff") -process.load("Configuration.EventContent.EventContent_cff") -process.load('Configuration.StandardSequences.GeometryRecoDB_cff') -process.load('Configuration.StandardSequences.MagneticField_38T_cff') -process.load('RecoJets.Configuration.GenJetParticles_cff') -process.load('RecoJets.Configuration.RecoGenJets_cff') -process.load('RecoJets.JetProducers.TrackJetParameters_cfi') -process.load('RecoJets.JetProducers.PileupJetIDParams_cfi') -process.load("PhysicsTools.PatAlgos.patSequences_cff") - -#process.load("PhysicsTools.PatAlgos.slimming.pileupJetId_cfi") -from Configuration.AlCa.GlobalTag import GlobalTag -#process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:mc', '') -process.GlobalTag.globaltag = "80X_mcRun2_asymptotic_2016_miniAODv2_v1" - -process.load('RecoJets.JetProducers.QGTagger_cfi') -process.QGTagger.srcJets = cms.InputTag('ak4PFJetsCHS') # Could be reco::PFJetCollection or pat::JetCollection (both AOD and miniAOD) -process.QGTagger.jetsLabel = cms.string('QGL_AK4PFchs') # Other options: see https://twiki.cern.ch/twiki/bin/viewauth/CMS/QGDataBaseVersion - -##-------------------- Import the JEC services ----------------------- -process.load('JetMETCorrections.Configuration.DefaultJEC_cff') - -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -#! Input -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -inFiles = cms.untracked.vstring( -'file:009A0396-C0F1-E511-BE94-0025904C67A6.root' -#'file:0274FD94-43A4-E511-BCDF-02163E01439A.root' - ) - -process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(-1)) -process.source = cms.Source("PoolSource", fileNames = inFiles ) - -def jetToolbox( proc, jetType, jetSequence,PUMethod='', bTagDiscriminators = None): - - JETCorrPayload='None' - JETCorrLevels = [ 'None' ] - bTagDiscriminators = ['trackCountingHighEffBJetTags','trackCountingHighPurBJetTags','pfTrackCountingHighEffBJetTags','pfTrackCountingHighPurBJetTags','softPFMuonByIP3dBJetTags','softPFElectronByIP3dBJetTags','softPFMuonBJetTags','softPFElectronBJetTags','simpleSecondaryVertexHighEffBJetTags','simpleSecondaryVertexHighPurBJetTags','pfSimpleSecondaryVertexHighEffBJetTags','pfSimpleSecondaryVertexHighPurBJetTags','combinedSecondaryVertexV2BJetTags','pfCombinedSecondaryVertexV2BJetTags','pfCombinedInclusiveSecondaryVertexV2BJetTags','pfCombinedMVAV2BJetTags','pfPositiveCombinedSecondaryVertexV2BJetTags','pfNegativeCombinedSecondaryVertexV2BJetTags','pfCombinedInclusiveSecondaryVertexV2BJetTags','pfCombinedMVAV2BJetTags','pfJetProbabilityBJetTags'] - - GetJetMCFlavour = ['True'] - #JECLevels = [ 'L1Offset', 'L1FastJet', 'L1JPTOffset', 'L2Relative', 'L3Absolute', 'L5Falvour', 'L7Parton' ] - - algorithm='AntiKt' # CambridgeAachen' , 'Kt' - size = jetType[-1:] #[-1:] takes the last char from string 'akX' - jetSize = float('0.'+jetType[-1:]) - jetALGO = jetType.upper() - jetalgo = jetType.lower() - elemToKeep = [] - - print 'Running processes with: '+str(jetALGO)+' PF '+PUMethod+' jet algorithm with radius parameter '+str(jetSize) - - JETCorrPayload = 'AK'+size+'PF'+PUMethod.lower() - JETCorrLevels = ['L1FastJet', 'L2Relative', 'L3Absolute'] - #JETCorrLevels = [] #No JEC corrections - JEC = ( JETCorrPayload, JETCorrLevels , 'None') - - ################################################################################# - ####### Toolbox start - ################################################################################# - - elemToKeep = [] - jetSeq = cms.Sequence() - genParticlesLabel = '' - pvLabel = '' - tvLabel = '' - toolsUsed = [] - - proc.load('RecoJets.Configuration.GenJetParticles_cff') - setattr( proc, jetalgo+'GenJetsNoNu', ak4GenJets.clone( src = 'genParticlesForJetsNoNu', rParam = jetSize, jetAlgorithm = algorithm ) ) - jetSeq += getattr(proc, jetalgo+'GenJetsNoNu' ) - - proc.load('CommonTools.ParticleFlow.pfNoPileUpJME_cff') - #### Creating PATjets - if( PUMethod=='CHS') : - setattr( proc, jetalgo+'PFJetsCHS', ak4PFJets.clone( rParam = jetSize, jetAlgorithm = algorithm ) ) - jetSeq += getattr(proc, jetalgo+'PFJetsCHS' ) - - setattr( proc, jetalgo+'PFJetsCHS', - ak4PFJetsCHS.clone( - doAreaFastjet = True, - rParam = jetSize, - jetAlgorithm = algorithm ) ) - jetSeq += getattr(proc, jetalgo+'PFJetsCHS' ) - - else : - setattr( proc, jetalgo+'PFJets', ak4PFJets.clone( rParam = jetSize, jetAlgorithm = algorithm ) ) - jetSeq += getattr(proc, jetalgo+'PFJets' ) - - setattr( proc, jetalgo+'PFJets', - ak4PFJets.clone( - doAreaFastjet = True, - rParam = jetSize, - jetAlgorithm = algorithm ) ) - jetSeq += getattr(proc, jetalgo+'PFJets' ) - PUMethod='' - - - addJetCollection( - proc, - labelName = jetALGO+'PF'+PUMethod, - jetSource = cms.InputTag( jetalgo+'PFJets'+PUMethod), - algo = jetalgo, - btagDiscriminators = bTagDiscriminators, - rParam = jetSize, - jetCorrections = JEC, #( 'AK'+size+'PFchs', cms.vstring( ['L1FastJet', 'L2Relative', 'L3Absolute']), 'None'), - pfCandidates = cms.InputTag( 'particleFlow' ), #'packedPFCandidates'), - svSource = cms.InputTag('inclusiveCandidateSecondaryVertices'), - genJetCollection = cms.InputTag( jetalgo+'GenJetsNoNu'), - pvSource = cms.InputTag( 'offlinePrimaryVertices' ), #'offlineSlimmedPrimaryVertices'), - jetTrackAssociation = True, - - ) - - #setattr( proc, jetALGO+'PF'+PUMethod+'pileupJetIdCalculator', -# pileupJetIdCalculator.clone( -# jets = cms.InputTag(jetalgo+'PFJets'+PUMethod), -# rho = cms.InputTag("fixedGridRhoFastjetAll"), -# vertexes = cms.InputTag('offlinePrimaryVertices'), -# applyJec = cms.bool(True), -# inputIsCorrected = cms.bool(False) -# )) - -# setattr( proc, jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator', -# pileupJetIdEvaluator.clone( -# jetids = cms.InputTag(jetALGO+'PF'+PUMethod+'pileupJetIdCalculator'), -# jets = cms.InputTag(jetalgo+'PFJets'+PUMethod), -# rho = cms.InputTag("fixedGridRhoFastjetAll"), -# vertexes = cms.InputTag('offlinePrimaryVertices'), -# applyJec = cms.bool(True), -# inputIsCorrected = cms.bool(False) -# -# ) -# ) - - #getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod).userData.userFloats.src += [jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator:fullDiscriminant'] - #getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod).userData.userInts.src += [jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator:cutbasedId',jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator:fullId'] - - QGjetsLabel='chs' - - setattr( proc, 'QGTagger'+jetALGO+'PF'+PUMethod, - QGTagger.clone( - srcJets = cms.InputTag(jetalgo+'PFJets'+PUMethod), # Could be reco::PFJetCollection or pat::JetCollection (both AOD and miniAOD) - jetsLabel = cms.string('QGL_AK4PF'+QGjetsLabel) # Other options (might need to add an ESSource for it): see https://twiki.cern.ch/twiki/bi - ) - ) - elemToKeep += [ 'keep *_QGTagger'+jetALGO+'PF'+PUMethod+'_*_*' ] - getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod).userData.userFloats.src += ['QGTagger'+jetALGO+'PF'+PUMethod+':qgLikelihood'] - jetSeq += getattr(proc, 'QGTagger'+jetALGO+'PF'+PUMethod ) - - toolsUsed.append( 'QGTagger'+jetALGO+'PF'+PUMethod ) - - getattr(proc,'patJetPartons').particles = cms.InputTag( 'genParticles' ) #'prunedGenParticles') - setattr(proc, 'selectedPatJets'+jetALGO+'PF'+PUMethod, selectedPatJets.clone( src = 'patJets'+jetALGO+'PF'+PUMethod ) ) - setattr(proc, jetSequence, jetSeq) - - -jetToolbox( process, 'ak4', 'ak4JetSubs') -jetToolbox( process, 'ak4', 'ak4JetSubs','CHS') - -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -#! Services -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -process.load('FWCore.MessageLogger.MessageLogger_cfi') -process.MessageLogger.cerr.FwkReport.reportEvery = 100 -process.load('CommonTools.UtilAlgos.TFileService_cfi') -process.TFileService.fileName=cms.string('MC_ProcessedTreeProducer_2.root') - -# PAT Layer 1 -#process.load("PhysicsTools.PatAlgos.patLayer0_cff") # need to load this -#process.load("PhysicsTools.PatAlgos.patLayer1_cff") # even if we run only layer 1 - -process.load("PhysicsTools.PatAlgos.producersLayer1.patCandidates_cff") -process.load("PhysicsTools.PatAlgos.selectionLayer1.selectedPatCandidates_cff") -#from PhysicsTools.PatAlgos.tools.metTools import addMETCollection -#addMETCollection(process,'patMETPF','pfMetT1') -#patMETs.addGenMet = cms.bool(False) -#patMETs.genMETSource = cms.InputTag("") -process.patJets.addTagInfos = True -process.patJets.getJetMCFlavour = True - -genJetCollection = 'ak4GenJetsNoNu' -genParticleCollection = 'genParticles' - -from PhysicsTools.JetMCAlgos.HadronAndPartonSelector_cfi import selectedHadronsAndPartons -process.selectedHadronsAndPartons = selectedHadronsAndPartons.clone( - particles = genParticleCollection -) - -from PhysicsTools.JetMCAlgos.AK4PFJetsMCFlavourInfos_cfi import ak4JetFlavourInfos - -process.genJetFlavourInfos = ak4JetFlavourInfos.clone( - jets = genJetCollection, -) - -process.ak4 = cms.EDAnalyzer('ProcessedTreeProducerBTag', - ## jet collections ########################### - pfjets = cms.InputTag('selectedPatJetsAK4PF'), - pfjetschs = cms.InputTag('selectedPatJetsAK4PFCHS'), - pfpujetid = cms.string('AK4PFpileupJetIdEvaluator:fullDiscriminant'), - pfchsjetpuid = cms.string('AK4PFCHSpileupJetIdEvaluator:fullDiscriminant'), - ## MET collection #### - pfmet = cms.InputTag('patMETs'), - genjets = cms.untracked.InputTag('ak4GenJetsNoNu'), - ## database entry for the uncertainties ###### - PFPayloadName = cms.string('AK4PF'), - PFPayloadNameCHS= cms.string('AK4PFchs'), - jecUncSrc = cms.string(''), - jecUncSrcCHS = cms.string(''), - jecUncSrcNames = cms.vstring(''), - AK4 = cms.untracked.bool(True), - ## set the conditions for good Vtx counting ## - offlineVertices = cms.InputTag('offlinePrimaryVertices'), - goodVtxNdof = cms.double(4), - goodVtxZ = cms.double(24), - ## rho ####################################### - srcCaloRho = cms.InputTag('fixedGridRhoFastjetAllCalo'), - srcPFRho = cms.InputTag('fixedGridRhoFastjetAll'), - srcPULabel = cms.untracked.InputTag('addPileupInfo'), - ## preselection cuts ######################### - maxY = cms.double(5.0), - minPFPt = cms.double(20), - minNPFJets = cms.int32(1), - minGenPt = cms.untracked.double(20), - minJJMass = cms.double(-1), - isMCarlo = cms.untracked.bool(True), - useGenInfo = cms.untracked.bool(True), - ## trigger ################################### - printTriggerMenu = cms.untracked.bool(False), - processName = cms.string('HLT'), - triggerName = cms.vstring(''), - triggerResults = cms.InputTag("TriggerResults","","HLT"), - triggerEvent = cms.InputTag("hltTriggerSummaryAOD","","HLT"), - ## jec services ############################## - HBHENoiseFilterResultLabel = cms.InputTag("HBHENoiseFilterResultProducer", "HBHENoiseFilterResult"), - HBHENoiseFilterResultNoMinZLabel = cms.InputTag("HBHENoiseFilterResultProducerNoMinZ", "HBHENoiseFilterResult"), - EventInfo = cms.InputTag("generator"), - GenParticles = cms.InputTag("genParticles"), - beamSpot = cms.InputTag('offlineBeamSpot'), - jetFlavourInfos = cms.InputTag("genJetFlavourInfos"), - #pfjecService = cms.string('ak7PFL1FastL2L3Residual'), -) - -jetToolbox( process, 'ak8', 'ak8JetSubs','CHS') -jetToolbox( process, 'ak8', 'ak8JetSubs') - -process.ak8 = process.ak4.clone( - pfjets = cms.InputTag('selectedPatJetsAK8PF'), - pfjetschs = cms.InputTag('selectedPatJetsAK8PFCHS'), - pfpujetid = cms.string('AK8PFpileupJetIdEvaluator:fullDiscriminant'), - pfchsjetpuid = cms.string('AK8PFCHSpileupJetIdEvaluator:fullDiscriminant'), - PFPayloadName = cms.string('AK8PF'), - PFPayloadNameCHS= cms.string('AK8PFchs'), - AK4 = cms.untracked.bool(False), -) - -jetToolbox( process, 'ak7', 'ak7JetSubs','CHS') -jetToolbox( process, 'ak7', 'ak7JetSubs') - -process.ak7 = process.ak4.clone( - pfjets = cms.InputTag('selectedPatJetsAK7PF'), - pfjetschs = cms.InputTag('selectedPatJetsAK7PFCHS'), - pfpujetid = cms.string('AK7PFpileupJetIdEvaluator:fullDiscriminant'), - pfchsjetpuid = cms.string('AK7PFCHSpileupJetIdEvaluator:fullDiscriminant'), - PFPayloadName = cms.string('AK7PF'), - PFPayloadNameCHS= cms.string('AK7PFchs'), - AK4 = cms.untracked.bool(False), -) - -jetToolbox( process, 'ak5', 'ak5JetSubs','CHS') -jetToolbox( process, 'ak5', 'ak5JetSubs') - -process.ak5 = process.ak4.clone( - pfjets = cms.InputTag('selectedPatJetsAK5PF'), - pfjetschs = cms.InputTag('selectedPatJetsAK5PFCHS'), - pfpujetid = cms.string('AK5PFpileupJetIdEvaluator:fullDiscriminant'), - pfchsjetpuid = cms.string('AK5PFCHSpileupJetIdEvaluator:fullDiscriminant'), - PFPayloadName = cms.string('AK5PF'), - PFPayloadNameCHS= cms.string('AK5PFchs'), - AK4 = cms.untracked.bool(False), -) - -process.goodVertices = cms.EDFilter("VertexSelector", - filter = cms.bool(False), - src = cms.InputTag("offlinePrimaryVertices"), - cut = cms.string("!isFake && ndof >= 4 && abs(z) <= 24 && position.rho <= 2"), -) -process.load('RecoMET.METFilters.trackingFailureFilter_cfi') - -##Type1 patMET Producer -process.load('PhysicsTools.PatAlgos.recoLayer0.metCorrections_cff') -process.load('PhysicsTools.PatAlgos.producersLayer1.metProducer_cfi') -process.patMETs.addGenMET = cms.bool(False) -#Try scheduled processs -process.path = cms.Path(process.ak4*process.ak7) - -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -#! Output and Log -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(False) ) -process.options.allowUnscheduled = cms.untracked.bool(True) From 6ec11c8f795712f5f269252983c1a86eec7edd6b Mon Sep 17 00:00:00 2001 From: pgunnell Date: Thu, 2 Nov 2017 09:39:24 +0100 Subject: [PATCH 15/48] Delete ProcessedTreeProducer_dataPAT25ns_BTag_RunC_cfg.py --- ...dTreeProducer_dataPAT25ns_BTag_RunC_cfg.py | 323 ------------------ 1 file changed, 323 deletions(-) delete mode 100644 AnalysisFW/test/ProcessedTreeProducer_dataPAT25ns_BTag_RunC_cfg.py diff --git a/AnalysisFW/test/ProcessedTreeProducer_dataPAT25ns_BTag_RunC_cfg.py b/AnalysisFW/test/ProcessedTreeProducer_dataPAT25ns_BTag_RunC_cfg.py deleted file mode 100644 index 2b1f2c93fa2..00000000000 --- a/AnalysisFW/test/ProcessedTreeProducer_dataPAT25ns_BTag_RunC_cfg.py +++ /dev/null @@ -1,323 +0,0 @@ -# -*- coding: utf-8 -*- - -import FWCore.ParameterSet.Config as cms - -from RecoJets.Configuration.RecoPFJets_cff import ak4PFJets, ak4PFJetsCHS -from RecoJets.Configuration.RecoGenJets_cff import ak4GenJets -from RecoJets.JetProducers.SubJetParameters_cfi import SubJetParameters -from RecoJets.JetProducers.PFJetParameters_cfi import * -from RecoJets.JetProducers.GenJetParameters_cfi import * -from RecoJets.JetProducers.AnomalousCellParameters_cfi import * -from PhysicsTools.PatAlgos.producersLayer1.patCandidates_cff import * -from PhysicsTools.PatAlgos.selectionLayer1.jetSelector_cfi import selectedPatJets -from PhysicsTools.PatAlgos.tools.jetTools import * -#from PhysicsTools.PatAlgos.producersLayer1.metProducer_cfi import patMETs -from PhysicsTools.PatAlgos.patSequences_cff import * -#nnfrom PhysicsTools.PatAlgos.tools.metTools import addMETCollection -#from RecoJets.JetProducers.pileupjetidproducer_cfi import * -from PhysicsTools.PatAlgos.patTemplate_cfg import * -from PhysicsTools.PatAlgos.tools.jetTools import * - -## Modified version of jetToolBox from https://github.com/cms-jet/jetToolbox -## Options for PUMethod: Puppi, CS, SK, CHS - -# -*- coding: utf-8 -*- -import FWCore.ParameterSet.Config as cms - -process = cms.Process("Ntuplizer") -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -#! Conditions -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_condDBv2_cff") -process.load("Configuration.EventContent.EventContent_cff") -process.load('Configuration.StandardSequences.GeometryRecoDB_cff') -process.load('Configuration.StandardSequences.MagneticField_38T_cff') -process.load('RecoJets.Configuration.GenJetParticles_cff') -process.load('RecoJets.Configuration.RecoGenJets_cff') -process.load('RecoJets.JetProducers.TrackJetParameters_cfi') -process.load('RecoJets.JetProducers.PileupJetIDParams_cfi') -process.load("PhysicsTools.PatAlgos.patSequences_cff") - -#process.load("PhysicsTools.PatAlgos.slimming.pileupJetId_cfi") - -#process.GlobalTag.globaltag = "74X_dataRun2_Prompt_v4" -process.GlobalTag.globaltag = "76X_dataRun2_v5" - -##-------------------- Import the JEC services ----------------------- -process.load('JetMETCorrections.Configuration.DefaultJEC_cff') - -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -#! Input -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -inFiles = cms.untracked.vstring( -#'root://xrootd.unl.edu//store/data/Run2015D/JetHT/AOD/PromptReco-v4/000/258/159/00000/00F952BC-D16B-E511-B784-02163E0144F2.root' -#'root://xrootd.unl.edu//store/data/Run2015D/JetHT/AOD/PromptReco-v3/000/256/630/00000/BC44672C-345F-E511-BEA5-02163E0141FB.root' -#'root://xrootd.unl.edu//store/data/Run2015C/JetHT/AOD/PromptReco-v1/000/253/890/00000/24D029CE-2741-E511-B0AF-02163E014604.root' -#'root://xrootd.unl.edu//store/data/Run2015D/JetHT/AOD/PromptReco-v3/000/256/674/00000/36D872F3-F95E-E511-870B-02163E013539.root' -#'root://xrootd.unl.edu//store/data/Run2015D/JetHT/AOD/PromptReco-v3/000/256/729/00000/5C1F5529-F65F-E511-9B8C-02163E0145D9.root' -'root://xrootd.unl.edu//store/data/Run2015C/JetHT/AOD/PromptReco-v1/000/253/890/00000/24D029CE-2741-E511-B0AF-02163E014604.root' - ) - -process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(10000)) -process.source = cms.Source("PoolSource", fileNames = inFiles ) - -def jetToolbox( proc, jetType, jetSequence,PUMethod='', bTagDiscriminators = None): - - JETCorrPayload='None' - JETCorrLevels = [ 'None' ] - bTagDiscriminators = ['trackCountingHighEffBJetTags','trackCountingHighPurBJetTags','pfTrackCountingHighEffBJetTags','pfTrackCountingHighPurBJetTags','softPFMuonByIP3dBJetTags','softPFElectronByIP3dBJetTags','softPFMuonBJetTags','softPFElectronBJetTags','simpleSecondaryVertexHighEffBJetTags','simpleSecondaryVertexHighPurBJetTags','pfSimpleSecondaryVertexHighEffBJetTags','pfSimpleSecondaryVertexHighPurBJetTags','combinedSecondaryVertexBJetTags','pfCombinedSecondaryVertexSoftLeptonBJetTags','pfPositiveCombinedSecondaryVertexBJetTags','pfNegativeCombinedSecondaryVertexBJetTags'] -#,'pfCombinedSecondaryVertexBJetTags','pfCombinedMVABJetTags','pfCombinedSecondaryVertexSoftLeptonBJetTags','pfPositiveCombinedSecondaryVertexBJetTags','pfNegativeCombinedSecondaryVertexBJetTags'] -#,'pfCombinedInclusiveSecondaryVertexBJetTags' - - #GetJetMCFlavour = ['True'] - #JECLevels = [ 'L1Offset', 'L1FastJet', 'L1JPTOffset', 'L2Relative', 'L3Absolute', 'L5Falvour', 'L7Parton' ] - - algorithm='AntiKt' # CambridgeAachen' , 'Kt' - size = jetType[-1:] #[-1:] takes the last char from string 'akX' - jetSize = float('0.'+jetType[-1:]) - jetALGO = jetType.upper() - jetalgo = jetType.lower() - elemToKeep = [] - - print 'Running processes with: '+str(jetALGO)+' PF '+PUMethod+' jet algorithm with radius parameter '+str(jetSize) - - JETCorrPayload = 'AK'+size+'PF'+PUMethod.lower() - JETCorrLevels = ['L1FastJet', 'L2Relative', 'L3Absolute','L2L3Residual'] - #JETCorrLevels = [] #No JEC corrections - JEC = ( JETCorrPayload, JETCorrLevels , 'None') - - ################################################################################# - ####### Toolbox start - ################################################################################# - - elemToKeep = [] - jetSeq = cms.Sequence() - genParticlesLabel = '' - pvLabel = '' - tvLabel = '' - toolsUsed = [] - - proc.load('RecoJets.Configuration.GenJetParticles_cff') - setattr( proc, jetalgo+'GenJetsNoNu', ak4GenJets.clone( src = 'genParticlesForJetsNoNu', rParam = jetSize, jetAlgorithm = algorithm ) ) - jetSeq += getattr(proc, jetalgo+'GenJetsNoNu' ) - - proc.load('CommonTools.ParticleFlow.pfNoPileUpJME_cff') - #### Creating PATjets - if( PUMethod=='CHS') : - setattr( proc, jetalgo+'PFJetsCHS', ak4PFJets.clone( rParam = jetSize, jetAlgorithm = algorithm ) ) - jetSeq += getattr(proc, jetalgo+'PFJetsCHS' ) - - setattr( proc, jetalgo+'PFJetsCHS', - ak4PFJetsCHS.clone( - doAreaFastjet = True, - rParam = jetSize, - jetAlgorithm = algorithm ) ) - jetSeq += getattr(proc, jetalgo+'PFJetsCHS' ) - - else : - setattr( proc, jetalgo+'PFJets', ak4PFJets.clone( rParam = jetSize, jetAlgorithm = algorithm ) ) - jetSeq += getattr(proc, jetalgo+'PFJets' ) - - setattr( proc, jetalgo+'PFJets', - ak4PFJets.clone( - doAreaFastjet = True, - rParam = jetSize, - jetAlgorithm = algorithm ) ) - jetSeq += getattr(proc, jetalgo+'PFJets' ) - PUMethod='' - - - addJetCollection( - proc, - labelName = jetALGO+'PF'+PUMethod, - jetSource = cms.InputTag( jetalgo+'PFJets'+PUMethod), - algo = jetalgo, - btagDiscriminators = bTagDiscriminators, - rParam = jetSize, - jetCorrections = JEC, #( 'AK'+size+'PFchs', cms.vstring( ['L1FastJet', 'L2Relative', 'L3Absolute']), 'None'), - pfCandidates = cms.InputTag( 'particleFlow' ), #'packedPFCandidates'), - svSource = cms.InputTag('inclusiveCandidateSecondaryVertices'), - genJetCollection = cms.InputTag( jetalgo+'GenJetsNoNu'), - pvSource = cms.InputTag( 'offlinePrimaryVertices' ), #'offlineSlimmedPrimaryVertices'), - jetTrackAssociation = True, - - ) - - #setattr( proc, jetALGO+'PF'+PUMethod+'pileupJetIdCalculator', -# pileupJetIdCalculator.clone( -# jets = cms.InputTag(jetalgo+'PFJets'+PUMethod), -# rho = cms.InputTag("fixedGridRhoFastjetAll"), -# vertexes = cms.InputTag('offlinePrimaryVertices'), -# applyJec = cms.bool(True), -# inputIsCorrected = cms.bool(False) -# )) - -# setattr( proc, jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator', -# pileupJetIdEvaluator.clone( -# jetids = cms.InputTag(jetALGO+'PF'+PUMethod+'pileupJetIdCalculator'), -# jets = cms.InputTag(jetalgo+'PFJets'+PUMethod), -# rho = cms.InputTag("fixedGridRhoFastjetAll"), -# vertexes = cms.InputTag('offlinePrimaryVertices'), -# applyJec = cms.bool(True), -# inputIsCorrected = cms.bool(False) -# -# ) -# ) - - #getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod).userData.userFloats.src += [jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator:fullDiscriminant'] - #getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod).userData.userInts.src += [jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator:cutbasedId',jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator:fullId'] - - getattr(proc,'patJetPartons').particles = cms.InputTag( 'genParticles' ) #'prunedGenParticles') - setattr(proc, 'selectedPatJets'+jetALGO+'PF'+PUMethod, selectedPatJets.clone( src = 'patJets'+jetALGO+'PF'+PUMethod ) ) - setattr(proc, jetSequence, jetSeq) - -jetToolbox( process, 'ak4', 'ak4JetSubs') -jetToolbox( process, 'ak4', 'ak4JetSubs','CHS') - -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -#! Services -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -process.load('FWCore.MessageLogger.MessageLogger_cfi') -process.MessageLogger.cerr.FwkReport.reportEvery = 100 -process.load('CommonTools.UtilAlgos.TFileService_cfi') -process.TFileService.fileName=cms.string('DATA_ProcessedTreeProducer_2.root') - -# PAT Layer 1 -#process.load("PhysicsTools.PatAlgos.patLayer0_cff") # need to load this -#process.load("PhysicsTools.PatAlgos.patLayer1_cff") # even if we run only layer 1 - -process.load("PhysicsTools.PatAlgos.producersLayer1.patCandidates_cff") -process.load("PhysicsTools.PatAlgos.selectionLayer1.selectedPatCandidates_cff") -#from PhysicsTools.PatAlgos.tools.metTools import addMETCollection -#addMETCollection(process,'patMETPF','pfMetT1') -#patMETs.addGenMet = cms.bool(False) -#patMETs.genMETSource = cms.InputTag("") -process.patJets.addTagInfos = True -process.patJets.addAssociatedTracks = True - -process.ak4 = cms.EDAnalyzer('ProcessedTreeProducerBTag', - ## jet collections ########################### - pfjets = cms.InputTag('selectedPatJetsAK4PF'), - pfjetschs = cms.InputTag('selectedPatJetsAK4PFCHS'), - pfpujetid = cms.string('AK4PFpileupJetIdEvaluator:fullDiscriminant'), - pfchsjetpuid = cms.string('AK4PFCHSpileupJetIdEvaluator:fullDiscriminant'), - ## MET collection #### - pfmet = cms.InputTag('patMETs'), - genjets = cms.untracked.InputTag('ak4GenJetsNoNu'), - ## database entry for the uncertainties ###### - PFPayloadName = cms.string('AK4PF'), - PFPayloadNameCHS= cms.string('AK4PFchs'), - jecUncSrc = cms.string(''), - jecUncSrcCHS = cms.string(''), - jecUncSrcNames = cms.vstring(''), - ## set the conditions for good Vtx counting ## - offlineVertices = cms.InputTag('offlinePrimaryVertices'), - beamSpot = cms.InputTag('offlineBeamSpot'), - goodVtxNdof = cms.double(4), - goodVtxZ = cms.double(24), - ## rho ####################################### - srcCaloRho = cms.InputTag('fixedGridRhoFastjetAllCalo'), - srcPFRho = cms.InputTag('fixedGridRhoFastjetAll'), - srcPULabel = cms.untracked.InputTag('addPileupInfo','addPileupInfo'), - ## preselection cuts ######################### - maxY = cms.double(5.0), - minPFPt = cms.double(20), - minNPFJets = cms.int32(1), - minGenPt = cms.untracked.double(20), - minJJMass = cms.double(-1), - isMCarlo = cms.untracked.bool(False), - useGenInfo = cms.untracked.bool(False), - ## trigger ################################### - printTriggerMenu = cms.untracked.bool(True), - processName = cms.string('HLT'), - triggerName = cms.vstring('HLT_PFJet40_v2','HLT_PFJet60_v2', 'HLT_PFJet80_v2', 'HLT_PFJet140_v2', 'HLT_PFJet200_v2', 'HLT_PFJet260_v2','HLT_PFJet320_v2', 'HLT_PFJet400_v2', 'HLT_PFJet450_v2','HLT_PFJet500_v2','HLT_PFHT600_v2','HLT_PFHT650_v2','HLT_PFHT800_v1','HLT_PFHT200_v1','HLT_PFHT250_v1','HLT_PFHT300_v1','HLT_PFHT350_v2','HLT_PFHT400_v1','HLT_PFHT475_v1','HLT_ZeroBias_v2'), - triggerResults = cms.InputTag("TriggerResults","","HLT"), - triggerEvent = cms.InputTag("hltTriggerSummaryAOD","","HLT"), - ## jec services ############################## - #new tokens - EventInfo = cms.InputTag("generator"), - GenParticles = cms.InputTag("genparticles"), - HBHENoiseFilterResultLabel = cms.InputTag("HBHENoiseFilterResultProducer", "HBHENoiseFilterResult"), - HBHENoiseFilterResultNoMinZLabel = cms.InputTag("HBHENoiseFilterResultProducerNoMinZ", "HBHENoiseFilterResult"), - #pfjecService = cms.string('ak7PFL1FastL2L3Residual'), -) - -jetToolbox( process, 'ak8', 'ak8JetSubs','CHS') -jetToolbox( process, 'ak8', 'ak8JetSubs') - -process.ak8 = process.ak4.clone( - pfjets = cms.InputTag('selectedPatJetsAK8PF'), - pfjetschs = cms.InputTag('selectedPatJetsAK8PFCHS'), - pfpujetid = cms.string('AK8PFpileupJetIdEvaluator:fullDiscriminant'), - pfchsjetpuid = cms.string('AK8PFCHSpileupJetIdEvaluator:fullDiscriminant'), - PFPayloadName = cms.string('AK8PF'), - PFPayloadNameCHS= cms.string('AK8PFchs'), -) - -jetToolbox( process, 'ak7', 'ak7JetSubs','CHS') -jetToolbox( process, 'ak7', 'ak7JetSubs') - -process.ak7 = process.ak4.clone( - pfjets = cms.InputTag('selectedPatJetsAK7PF'), - pfjetschs = cms.InputTag('selectedPatJetsAK7PFCHS'), - pfpujetid = cms.string('AK7PFpileupJetIdEvaluator:fullDiscriminant'), - pfchsjetpuid = cms.string('AK7PFCHSpileupJetIdEvaluator:fullDiscriminant'), - PFPayloadName = cms.string('AK7PF'), - PFPayloadNameCHS= cms.string('AK7PFchs'), -) - -jetToolbox( process, 'ak5', 'ak5JetSubs','CHS') -jetToolbox( process, 'ak5', 'ak5JetSubs') - -process.ak5 = process.ak4.clone( - pfjets = cms.InputTag('selectedPatJetsAK5PF'), - pfjetschs = cms.InputTag('selectedPatJetsAK5PFCHS'), - pfpujetid = cms.string('AK5PFpileupJetIdEvaluator:fullDiscriminant'), - pfchsjetpuid = cms.string('AK5PFCHSpileupJetIdEvaluator:fullDiscriminant'), - PFPayloadName = cms.string('AK5PF'), - PFPayloadNameCHS= cms.string('AK5PFchs'), -) - -############# hlt filter ######################### -process.hltFilter = cms.EDFilter('HLTHighLevel', - TriggerResultsTag = cms.InputTag('TriggerResults','','HLT'), - HLTPaths = cms.vstring('HLT_PFJet40_v3','HLT_PFJet60_v3', 'HLT_PFJet80_v3', 'HLT_PFJet140_v3', 'HLT_PFJet200_v3', 'HLT_PFJet260_v3','HLT_PFJet320_v3', 'HLT_PFJet400_v3', 'HLT_PFJet450_v3','HLT_PFJet500_v3','HLT_PFHT600_v3','HLT_PFHT650_v3','HLT_PFHT800_v2','HLT_PFHT200_v2','HLT_PFHT250_v2','HLT_PFHT300_v2','HLT_PFHT350_v3','HLT_PFHT400_v2','HLT_PFHT475_v2','HLT_ZeroBias_v2','HLT_AK4PFJet30_v3','HLT_AK4PFJet50_v3','HLT_AK4PFJet80_v3','HLT_AK4PFJet100_v3','HLT_PFJet40_v4','HLT_PFJet60_v4', 'HLT_PFJet80_v4', 'HLT_PFJet140_v4', 'HLT_PFJet200_v4', 'HLT_PFJet260_v4','HLT_PFJet320_v4', 'HLT_PFJet400_v4', 'HLT_PFJet450_v4','HLT_PFJet500_v4'), - eventSetupPathsKey = cms.string(''), - andOr = cms.bool(True), #----- True = OR, False = AND between the HLTPaths - throw = cms.bool(False) -) - -##MET Filters -process.load('RecoMET.METFilters.CSCTightHaloFilter_cfi') -process.load('CommonTools.RecoAlgos.HBHENoiseFilterResultProducer_cfi') - -process.HBHENoiseFilterResultProducerNoMinZ = process.HBHENoiseFilterResultProducer.clone(minZeros = cms.int32(99999)) - - -process.goodVertices = cms.EDFilter("VertexSelector", - filter = cms.bool(False), - src = cms.InputTag("offlinePrimaryVertices"), - cut = cms.string("!isFake && ndof >= 4 && abs(z) <= 24 && position.rho <= 2"), -) -process.load('RecoMET.METFilters.trackingFailureFilter_cfi') - -##Type1 patMET Producer -process.load('PhysicsTools.PatAlgos.recoLayer0.metCorrections_cff') -process.load('PhysicsTools.PatAlgos.producersLayer1.metProducer_cfi') -process.patMETs.addGenMET = cms.bool(False) -#Try scheduled processs -process.path = cms.Path(process.goodVertices*process.trackingFailureFilter* - process.hltFilter* - process.HBHENoiseFilterResultProducer* - process.HBHENoiseFilterResultProducerNoMinZ* - process.patMETCorrections*process.patMETs#process.patDefaultSequence* - #*process.ak4 *process.ak5*process.ak7*process.ak8) - *process.ak4*process.ak7) - - -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -#! Output and Log -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(False) ) -process.options.allowUnscheduled = cms.untracked.bool(True) From f67498b8d2a4fabd7b59a2bff1ffb2b4dd3ff25f Mon Sep 17 00:00:00 2001 From: pgunnell Date: Thu, 2 Nov 2017 09:39:33 +0100 Subject: [PATCH 16/48] Delete ProcessedTreeProducer_dataPAT25ns_BTag_cfg.py --- ...cessedTreeProducer_dataPAT25ns_BTag_cfg.py | 331 ------------------ 1 file changed, 331 deletions(-) delete mode 100644 AnalysisFW/test/ProcessedTreeProducer_dataPAT25ns_BTag_cfg.py diff --git a/AnalysisFW/test/ProcessedTreeProducer_dataPAT25ns_BTag_cfg.py b/AnalysisFW/test/ProcessedTreeProducer_dataPAT25ns_BTag_cfg.py deleted file mode 100644 index dd29b30bfdc..00000000000 --- a/AnalysisFW/test/ProcessedTreeProducer_dataPAT25ns_BTag_cfg.py +++ /dev/null @@ -1,331 +0,0 @@ -# -*- coding: utf-8 -*- - -import FWCore.ParameterSet.Config as cms - -from RecoJets.Configuration.RecoPFJets_cff import ak4PFJets, ak4PFJetsCHS -from RecoJets.Configuration.RecoGenJets_cff import ak4GenJets -from RecoJets.JetProducers.SubJetParameters_cfi import SubJetParameters -from RecoJets.JetProducers.PFJetParameters_cfi import * -from RecoJets.JetProducers.GenJetParameters_cfi import * -from RecoJets.JetProducers.AnomalousCellParameters_cfi import * -from PhysicsTools.PatAlgos.producersLayer1.patCandidates_cff import * -from PhysicsTools.PatAlgos.selectionLayer1.jetSelector_cfi import selectedPatJets -from PhysicsTools.PatAlgos.tools.jetTools import * -#from PhysicsTools.PatAlgos.producersLayer1.metProducer_cfi import patMETs -from PhysicsTools.PatAlgos.patSequences_cff import * -#nnfrom PhysicsTools.PatAlgos.tools.metTools import addMETCollection -#from RecoJets.JetProducers.pileupjetidproducer_cfi import * -from PhysicsTools.PatAlgos.patTemplate_cfg import * -from PhysicsTools.PatAlgos.tools.jetTools import * -from RecoJets.JetProducers.QGTagger_cfi import QGTagger - -## Modified version of jetToolBox from https://github.com/cms-jet/jetToolbox -## Options for PUMethod: Puppi, CS, SK, CHS - -# -*- coding: utf-8 -*- -import FWCore.ParameterSet.Config as cms - -process = cms.Process("Ntuplizer") -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -#! Conditions -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_condDBv2_cff") -process.load("Configuration.EventContent.EventContent_cff") -process.load('Configuration.StandardSequences.GeometryRecoDB_cff') -process.load('Configuration.StandardSequences.MagneticField_38T_cff') -process.load('RecoJets.Configuration.GenJetParticles_cff') -process.load('RecoJets.Configuration.RecoGenJets_cff') -process.load('RecoJets.JetProducers.TrackJetParameters_cfi') -process.load('RecoJets.JetProducers.PileupJetIDParams_cfi') -process.load("PhysicsTools.PatAlgos.patSequences_cff") - -#process.load("PhysicsTools.PatAlgos.slimming.pileupJetId_cfi") -process.load('RecoJets.JetProducers.QGTagger_cfi') -process.QGTagger.srcJets = cms.InputTag('ak4PFJetsCHS') # Could be reco::PFJetCollection or pat::JetCollection (both AOD and miniAOD) -process.QGTagger.jetsLabel = cms.string('QGL_AK4PFchs') # Other options: see https://twiki.cern.ch/twiki/bin/viewauth/CMS/QGDataBaseVersion - -process.GlobalTag.globaltag = "80X_dataRun2_ICHEP16_repro_v0" - -##-------------------- Import the JEC services ----------------------- -process.load('JetMETCorrections.Configuration.DefaultJEC_cff') - -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -#! Input -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -inFiles = cms.untracked.vstring( -'file:FC972EB3-D819-E611-94F9-02163E0134F4.root' - ) - -process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(10000)) -process.source = cms.Source("PoolSource", fileNames = inFiles ) - -def jetToolbox( proc, jetType, jetSequence,PUMethod='', bTagDiscriminators = None): - - JETCorrPayload='None' - JETCorrLevels = [ 'None' ] - bTagDiscriminators = ['trackCountingHighEffBJetTags','trackCountingHighPurBJetTags','pfTrackCountingHighEffBJetTags','pfTrackCountingHighPurBJetTags','softPFMuonByIP3dBJetTags','softPFElectronByIP3dBJetTags','softPFMuonBJetTags','softPFElectronBJetTags','simpleSecondaryVertexHighEffBJetTags','simpleSecondaryVertexHighPurBJetTags','pfSimpleSecondaryVertexHighEffBJetTags','pfSimpleSecondaryVertexHighPurBJetTags','combinedSecondaryVertexV2BJetTags','pfCombinedSecondaryVertexV2BJetTags','pfCombinedInclusiveSecondaryVertexV2BJetTags','pfCombinedMVAV2BJetTags','pfPositiveCombinedSecondaryVertexV2BJetTags','pfNegativeCombinedSecondaryVertexV2BJetTags','pfCombinedInclusiveSecondaryVertexV2BJetTags','pfCombinedMVAV2BJetTags','pfJetProbabilityBJetTags'] - - #GetJetMCFlavour = ['True'] - #JECLevels = [ 'L1Offset', 'L1FastJet', 'L1JPTOffset', 'L2Relative', 'L3Absolute', 'L5Falvour', 'L7Parton' ] - - algorithm='AntiKt' # CambridgeAachen' , 'Kt' - size = jetType[-1:] #[-1:] takes the last char from string 'akX' - jetSize = float('0.'+jetType[-1:]) - jetALGO = jetType.upper() - jetalgo = jetType.lower() - elemToKeep = [] - - print 'Running processes with: '+str(jetALGO)+' PF '+PUMethod+' jet algorithm with radius parameter '+str(jetSize) - - JETCorrPayload = 'AK'+size+'PF'+PUMethod.lower() - JETCorrLevels = ['L1FastJet', 'L2Relative', 'L3Absolute','L2L3Residual'] - #JETCorrLevels = [] #No JEC corrections - JEC = ( JETCorrPayload, JETCorrLevels , 'None') - - ################################################################################# - ####### Toolbox start - ################################################################################# - - elemToKeep = [] - jetSeq = cms.Sequence() - genParticlesLabel = '' - pvLabel = '' - tvLabel = '' - toolsUsed = [] - - proc.load('RecoJets.Configuration.GenJetParticles_cff') - setattr( proc, jetalgo+'GenJetsNoNu', ak4GenJets.clone( src = 'genParticlesForJetsNoNu', rParam = jetSize, jetAlgorithm = algorithm ) ) - jetSeq += getattr(proc, jetalgo+'GenJetsNoNu' ) - - proc.load('CommonTools.ParticleFlow.pfNoPileUpJME_cff') - #### Creating PATjets - if( PUMethod=='CHS') : - setattr( proc, jetalgo+'PFJetsCHS', ak4PFJets.clone( rParam = jetSize, jetAlgorithm = algorithm ) ) - jetSeq += getattr(proc, jetalgo+'PFJetsCHS' ) - - setattr( proc, jetalgo+'PFJetsCHS', - ak4PFJetsCHS.clone( - doAreaFastjet = True, - rParam = jetSize, - jetAlgorithm = algorithm ) ) - jetSeq += getattr(proc, jetalgo+'PFJetsCHS' ) - - else : - setattr( proc, jetalgo+'PFJets', ak4PFJets.clone( rParam = jetSize, jetAlgorithm = algorithm ) ) - jetSeq += getattr(proc, jetalgo+'PFJets' ) - - setattr( proc, jetalgo+'PFJets', - ak4PFJets.clone( - doAreaFastjet = True, - rParam = jetSize, - jetAlgorithm = algorithm ) ) - jetSeq += getattr(proc, jetalgo+'PFJets' ) - PUMethod='' - - addJetCollection( - proc, - labelName = jetALGO+'PF'+PUMethod, - jetSource = cms.InputTag( jetalgo+'PFJets'+PUMethod), - algo = jetalgo, - btagDiscriminators = bTagDiscriminators, - rParam = jetSize, - jetCorrections = JEC, #( 'AK'+size+'PFchs', cms.vstring( ['L1FastJet', 'L2Relative', 'L3Absolute']), 'None'), - pfCandidates = cms.InputTag( 'particleFlow' ), #'packedPFCandidates'), - svSource = cms.InputTag('inclusiveCandidateSecondaryVertices'), - genJetCollection = cms.InputTag( jetalgo+'GenJetsNoNu'), - pvSource = cms.InputTag( 'offlinePrimaryVertices' ), #'offlineSlimmedPrimaryVertices'), - jetTrackAssociation = True, - ) - - getattr(proc,'patJetPartons').particles = cms.InputTag( 'genParticles' ) #'prunedGenParticles') - - QGjetsLabel='chs' - - setattr( proc, 'QGTagger'+jetALGO+'PF'+PUMethod, - QGTagger.clone( - srcJets = cms.InputTag(jetalgo+'PFJets'+PUMethod), # Could be reco::PFJetCollection or pat::JetCollection (both AOD and miniAOD) - jetsLabel = cms.string('QGL_AK4PF'+QGjetsLabel) # Other options (might need to add an ESSource for it): see https://twiki.cern.ch/twiki/bin/viewauth/CMS/QGDataBaseVersion - ) - ) - elemToKeep += [ 'keep *_QGTagger'+jetALGO+'PF'+PUMethod+'_*_*' ] - getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod).userData.userFloats.src += ['QGTagger'+jetALGO+'PF'+PUMethod+':qgLikelihood'] - jetSeq += getattr(proc, 'QGTagger'+jetALGO+'PF'+PUMethod ) - - toolsUsed.append( 'QGTagger'+jetALGO+'PF'+PUMethod ) - - #getattr( proc, 'selectedPatJets').userData.userFloats.src += ['QGTagger:qgLikelihood'] - #setattr(proc, 'selectedPatJets'+jetALGO+'PF'+PUMethod, selectedPatJets.clone( src = 'patJets'+jetALGO+'PF'+PUMethod ) ) - #jetSeq += getattr(proc, 'QGTagger') - - setattr(proc, jetSequence, jetSeq) - - - - - -jetToolbox( process, 'ak4', 'ak4JetSubs') -jetToolbox( process, 'ak4', 'ak4JetSubs','CHS') - -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -#! Services -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -process.load('FWCore.MessageLogger.MessageLogger_cfi') -process.MessageLogger.cerr.FwkReport.reportEvery = 100 -process.load('CommonTools.UtilAlgos.TFileService_cfi') -process.TFileService.fileName=cms.string('DATA_ProcessedTreeProducer_2.root') - -# PAT Layer 1 -#process.load("PhysicsTools.PatAlgos.patLayer0_cff") # need to load this -#process.load("PhysicsTools.PatAlgos.patLayer1_cff") # even if we run only layer 1 - -process.load("PhysicsTools.PatAlgos.producersLayer1.patCandidates_cff") -process.load("PhysicsTools.PatAlgos.selectionLayer1.selectedPatCandidates_cff") -#from PhysicsTools.PatAlgos.tools.metTools import addMETCollection -#addMETCollection(process,'patMETPF','pfMetT1') -#patMETs.addGenMet = cms.bool(False) -#patMETs.genMETSource = cms.InputTag("") -process.patJets.addTagInfos = True -process.patJets.addAssociatedTracks = True - -#process.out.outputCommands += ['keep *_QGTagger_*_*'] -process.load("PhysicsTools.PatAlgos.patSequences_cff") - -process.ak4 = cms.EDAnalyzer('ProcessedTreeProducerBTag', - ## jet collections ########################### - pfjets = cms.InputTag('slimmedJets'), - pfjetschs = cms.InputTag('slimmedJets'), - pfpujetid = cms.string('AK4PFpileupJetIdEvaluator:fullDiscriminant'), - pfchsjetpuid = cms.string('AK4PFCHSpileupJetIdEvaluator:fullDiscriminant'), - ## MET collection #### - pfmet = cms.InputTag('patMETs'), - genjets = cms.untracked.InputTag('ak4GenJetsNoNu'), - ## database entry for the uncertainties ###### - PFPayloadName = cms.string('AK4PF'), - PFPayloadNameCHS= cms.string('AK4PFchs'), - jecUncSrc = cms.string(''), - jecUncSrcCHS = cms.string(''), - jecUncSrcNames = cms.vstring(''), - ## set the conditions for good Vtx counting ## - offlineVertices = cms.InputTag('offlinePrimaryVertices'), - beamSpot = cms.InputTag('offlineBeamSpot'), - goodVtxNdof = cms.double(4), - goodVtxZ = cms.double(24), - ## rho ####################################### - srcCaloRho = cms.InputTag('fixedGridRhoFastjetAllCalo'), - srcPFRho = cms.InputTag('fixedGridRhoFastjetAll'), - srcPULabel = cms.untracked.InputTag('addPileupInfo','addPileupInfo'), - ## preselection cuts ######################### - maxY = cms.double(5.0), - minPFPt = cms.double(20), - minNPFJets = cms.int32(1), - minGenPt = cms.untracked.double(20), - minJJMass = cms.double(-1), - isMCarlo = cms.untracked.bool(False), - useGenInfo = cms.untracked.bool(False), - AK4 = cms.untracked.bool(True), - ## trigger ################################### - printTriggerMenu = cms.untracked.bool(True), - processName = cms.string('HLT'), - triggerName = cms.vstring('HLT_PFJet40_v6','HLT_PFJet60_v6', 'HLT_PFJet80_v6', 'HLT_PFJet140_v6', 'HLT_PFJet200_v6', 'HLT_PFJet260_v6','HLT_PFJet320_v6', 'HLT_PFJet400_v6', 'HLT_PFJet450_v6','HLT_PFJet500_v6','HLT_PFJet40_v5','HLT_PFJet60_v5', 'HLT_PFJet80_v5', 'HLT_PFJet140_v5', 'HLT_PFJet200_v5', 'HLT_PFJet260_v5','HLT_PFJet320_v5', 'HLT_PFJet400_v5', 'HLT_PFJet450_v5','HLT_PFJet500_v5','HLT_PFJet40_v4','HLT_PFJet60_v4', 'HLT_PFJet80_v4', 'HLT_PFJet140_v4','HLT_PFJet200_v4','HLT_PFJet260_v4','HLT_PFJet320_v4','HLT_PFJet400_v4','HLT_PFJet450_v4','HLT_PFJet500_v4','HLT_PFHT125_v2','HLT_PFHT200_v2','HLT_PFHT250_v2','HLT_PFHT300_v2','HLT_PFHT350_v2','HLT_PFHT400_v2','HLT_PFHT475_v2','HLT_PFHT600_v2','HLT_PFHT650_v2','HLT_PFHT800_v2','HLT_PFHT900_v2','HLT_PFHT125_v3','HLT_PFHT200_v3','HLT_PFHT250_v3','HLT_PFHT300_v3','HLT_PFHT350_v3','HLT_PFHT400_v3','HLT_PFHT475_v3','HLT_PFHT600_v3','HLT_PFHT650_v3','HLT_PFHT800_v3','HLT_PFHT900_v3','HLT_PFHT125_v4','HLT_PFHT200_v4','HLT_PFHT250_v4','HLT_PFHT300_v4','HLT_PFHT350_v4','HLT_PFHT400_v4','HLT_PFHT475_v4','HLT_PFHT600_v4','HLT_PFHT650_v4','HLT_PFHT800_v4','HLT_PFHT900_v4','HLT_PFHT125_v5','HLT_PFHT200_v5','HLT_PFHT250_v5','HLT_PFHT300_v5','HLT_PFHT350_v5','HLT_PFHT400_v5','HLT_PFHT475_v5','HLT_PFHT600_v5','HLT_PFHT650_v5','HLT_PFHT800_v5','HLT_PFHT900_v5','HLT_PFHT125_v1','HLT_PFHT200_v1','HLT_PFHT250_v1','HLT_PFHT300_v1','HLT_PFHT350_v1','HLT_PFHT400_v1','HLT_PFHT475_v1','HLT_PFHT600_v1','HLT_PFHT650_v1','HLT_PFHT800_v1','HLT_PFHT900_v1','HLT_AK8PFJet40_v1','HLT_AK8PFJet60_v1','HLT_AK8PFJet80_v1','HLT_AK8PFJet140_v1','HLT_AK8PFJet200_v1','HLT_AK8PFJet260_v1','HLT_AK8PFJet320_v1','HLT_AK8PFJet400_v1','HLT_AK8PFJet450_v1','HLT_AK8PFJet500_v1','HLT_AK8PFJet40_v2','HLT_AK8PFJet60_v2','HLT_AK8PFJet80_v2','HLT_AK8PFJet140_v2','HLT_AK8PFJet200_v2','HLT_AK8PFJet260_v2','HLT_AK8PFJet320_v2','HLT_AK8PFJet400_v2','HLT_AK8PFJet450_v2','HLT_AK8PFJet500_v2'), - triggerResults = cms.InputTag("TriggerResults","","HLT"), - triggerEvent = cms.InputTag("hltTriggerSummaryAOD","","HLT"), - ## jec services ############################## - #new tokens - EventInfo = cms.InputTag("generator"), - GenParticles = cms.InputTag("genparticles"), - HBHENoiseFilterResultLabel = cms.InputTag("HBHENoiseFilterResultProducer", "HBHENoiseFilterResult"), - HBHENoiseFilterResultNoMinZLabel = cms.InputTag("HBHENoiseFilterResultProducerNoMinZ", "HBHENoiseFilterResult"), - jetFlavourInfos = cms.InputTag("genJetFlavourInfos"), - #pfjecService = cms.string('ak7PFL1FastL2L3Residual'), -) - -jetToolbox( process, 'ak8', 'ak8JetSubs','CHS') -jetToolbox( process, 'ak8', 'ak8JetSubs') - -process.ak8 = process.ak4.clone( - pfjets = cms.InputTag('selectedPatJetsAK8PF'), - pfjetschs = cms.InputTag('selectedPatJetsAK8PFCHS'), - pfpujetid = cms.string('AK8PFpileupJetIdEvaluator:fullDiscriminant'), - pfchsjetpuid = cms.string('AK8PFCHSpileupJetIdEvaluator:fullDiscriminant'), - PFPayloadName = cms.string('AK8PF'), - PFPayloadNameCHS= cms.string('AK8PFchs'), - AK4 = cms.untracked.bool(False), -) - -jetToolbox( process, 'ak7', 'ak7JetSubs','CHS') -jetToolbox( process, 'ak7', 'ak7JetSubs') - -process.ak7 = process.ak4.clone( - pfjets = cms.InputTag('selectedPatJetsAK7PF'), - pfjetschs = cms.InputTag('selectedPatJetsAK7PFCHS'), - pfpujetid = cms.string('AK7PFpileupJetIdEvaluator:fullDiscriminant'), - pfchsjetpuid = cms.string('AK7PFCHSpileupJetIdEvaluator:fullDiscriminant'), - PFPayloadName = cms.string('AK7PF'), - PFPayloadNameCHS= cms.string('AK7PFchs'), - AK4 = cms.untracked.bool(False), -) - -jetToolbox( process, 'ak5', 'ak5JetSubs','CHS') -jetToolbox( process, 'ak5', 'ak5JetSubs') - -process.ak5 = process.ak4.clone( - pfjets = cms.InputTag('selectedPatJetsAK5PF'), - pfjetschs = cms.InputTag('selectedPatJetsAK5PFCHS'), - pfpujetid = cms.string('AK5PFpileupJetIdEvaluator:fullDiscriminant'), - pfchsjetpuid = cms.string('AK5PFCHSpileupJetIdEvaluator:fullDiscriminant'), - PFPayloadName = cms.string('AK5PF'), - PFPayloadNameCHS= cms.string('AK5PFchs'), - AK4 = cms.untracked.bool(False), -) - -############# hlt filter ######################### -process.hltFilter = cms.EDFilter('HLTHighLevel', - TriggerResultsTag = cms.InputTag('TriggerResults','','HLT'), - HLTPaths = cms.vstring('HLT_PFJet40_v6','HLT_PFJet60_v6', 'HLT_PFJet80_v6', 'HLT_PFJet140_v6', 'HLT_PFJet200_v6', 'HLT_PFJet260_v6','HLT_PFJet320_v6', 'HLT_PFJet400_v6', 'HLT_PFJet450_v6','HLT_PFJet500_v6','HLT_PFJet40_v5','HLT_PFJet60_v5', 'HLT_PFJet80_v5', 'HLT_PFJet140_v5', 'HLT_PFJet200_v5', 'HLT_PFJet260_v5','HLT_PFJet320_v5', 'HLT_PFJet400_v5', 'HLT_PFJet450_v5','HLT_PFJet500_v5','HLT_PFJet40_v4','HLT_PFJet60_v4', 'HLT_PFJet80_v4', 'HLT_PFJet140_v4','HLT_PFJet200_v4','HLT_PFJet260_v4','HLT_PFJet320_v4','HLT_PFJet400_v4','HLT_PFJet450_v4','HLT_PFJet500_v4','HLT_PFHT125_v2','HLT_PFHT200_v2','HLT_PFHT250_v2','HLT_PFHT300_v2','HLT_PFHT350_v2','HLT_PFHT400_v2','HLT_PFHT475_v2','HLT_PFHT600_v2','HLT_PFHT650_v2','HLT_PFHT800_v2','HLT_PFHT900_v2','HLT_PFHT125_v3','HLT_PFHT200_v3','HLT_PFHT250_v3','HLT_PFHT300_v3','HLT_PFHT350_v3','HLT_PFHT400_v3','HLT_PFHT475_v3','HLT_PFHT600_v3','HLT_PFHT650_v3','HLT_PFHT800_v3','HLT_PFHT900_v3','HLT_PFHT125_v4','HLT_PFHT200_v4','HLT_PFHT250_v4','HLT_PFHT300_v4','HLT_PFHT350_v4','HLT_PFHT400_v4','HLT_PFHT475_v4','HLT_PFHT600_v4','HLT_PFHT650_v4','HLT_PFHT800_v4','HLT_PFHT900_v4','HLT_PFHT125_v5','HLT_PFHT200_v5','HLT_PFHT250_v5','HLT_PFHT300_v5','HLT_PFHT350_v5','HLT_PFHT400_v5','HLT_PFHT475_v5','HLT_PFHT600_v5','HLT_PFHT650_v5','HLT_PFHT800_v5','HLT_PFHT900_v5','HLT_AK8PFJet40_v1','HLT_AK8PFJet60_v1','HLT_AK8PFJet80_v1','HLT_AK8PFJet140_v1','HLT_AK8PFJet200_v1','HLT_AK8PFJet260_v1','HLT_AK8PFJet320_v1','HLT_AK8PFJet400_v1','HLT_AK8PFJet450_v1','HLT_AK8PFJet500_v1','HLT_AK8PFJet40_v2','HLT_AK8PFJet60_v2','HLT_AK8PFJet80_v2','HLT_AK8PFJet140_v2','HLT_AK8PFJet200_v2','HLT_AK8PFJet260_v2','HLT_AK8PFJet320_v2','HLT_AK8PFJet400_v2','HLT_AK8PFJet450_v2','HLT_AK8PFJet500_v2','HLT_PFHT125_v1','HLT_PFHT200_v1','HLT_PFHT250_v1','HLT_PFHT300_v1','HLT_PFHT350_v1','HLT_PFHT400_v1','HLT_PFHT475_v1','HLT_PFHT600_v1','HLT_PFHT650_v1','HLT_PFHT800_v1','HLT_PFHT900_v1'), - eventSetupPathsKey = cms.string(''), - andOr = cms.bool(True), #----- True = OR, False = AND between the HLTPaths - throw = cms.bool(False) -) - -##MET Filters -process.load('RecoMET.METFilters.CSCTightHaloFilter_cfi') -process.load('CommonTools.RecoAlgos.HBHENoiseFilterResultProducer_cfi') -process.load('CommonTools.RecoAlgos.HBHENoiseFilter_cfi') - -process.HBHENoiseFilterResultProducerNoMinZ = process.HBHENoiseFilterResultProducer.clone(minZeros = cms.int32(99999)) - -process.goodVertices = cms.EDFilter("VertexSelector", - filter = cms.bool(False), - src = cms.InputTag("offlinePrimaryVertices"), - cut = cms.string("!isFake && ndof >= 4 && abs(z) <= 24 && position.rho <= 2"), -) - -process.load('RecoMET.METFilters.trackingFailureFilter_cfi') -process.load('RecoMET.METFilters.EcalDeadCellTriggerPrimitiveFilter_cfi') -process.load('RecoMET.METFilters.eeBadScFilter_cfi') -process.load('RecoMET.METFilters.BadChargedCandidateFilter_cfi') -process.load('RecoMET.METFilters.BadPFMuonFilter_cfi') -process.load('RecoMET.METFilters.globalTightHalo2016Filter_cfi') - -process.allMetFilterPaths=cms.Sequence(process.HBHENoiseFilter*process.HBHENoiseIsoFilter*process.EcalDeadCellTriggerPrimitiveFilter*process.eeBadScFilter*process.BadPFMuonFilter*process.BadChargedCandidateFilter*process.globalTightHalo2016Filter) - -##Type1 patMET Producer -process.load('PhysicsTools.PatAlgos.recoLayer0.metCorrections_cff') -process.load('PhysicsTools.PatAlgos.producersLayer1.metProducer_cfi') -process.patMETs.addGenMET = cms.bool(False) - -#Try scheduled processs -process.path = cms.Path(process.goodVertices*process.trackingFailureFilter* - process.hltFilter* - process.HBHENoiseFilterResultProducer* - process.HBHENoiseFilterResultProducerNoMinZ*process.allMetFilterPaths* - process.patMETCorrections*process.patMETs - *process.QGTagger*process.ak4*process.ak7) - - -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -#! Output and Log -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(False) ) -process.options.allowUnscheduled = cms.untracked.bool(True) From 15aa99c89c1821f0190989e89cf761bc7018c4cb Mon Sep 17 00:00:00 2001 From: pgunnell Date: Thu, 2 Nov 2017 09:39:39 +0100 Subject: [PATCH 17/48] Delete ProcessedTreeProducer_dataPAT25ns_BTag_cfg.pyc --- ...ocessedTreeProducer_dataPAT25ns_BTag_cfg.pyc | Bin 13410 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 AnalysisFW/test/ProcessedTreeProducer_dataPAT25ns_BTag_cfg.pyc diff --git a/AnalysisFW/test/ProcessedTreeProducer_dataPAT25ns_BTag_cfg.pyc b/AnalysisFW/test/ProcessedTreeProducer_dataPAT25ns_BTag_cfg.pyc deleted file mode 100644 index e688f23eeb81d94996faddd07c5ae2123e198978..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 13410 zcmds7d3Y38a<7>Y0t5mK2!V}lVFQaX=oS*J!4^6Zk~|&>dsjIot*IWVMQeII-6N1A zvdPME?)yGB*<^Fy_kG{@eQ)k-b0?eopUto8b+@KxB&>YEo*q=X7e46aH5I;_@W1%mQjsNY$PY^#z zn;9_Iz}!KbP4T>m3{3ecRqh#DxkxL|QvOn;>r>htTK2R6V(w+icSaOv4TV{fa|Y13wdi7ZrR~K}_W(1usWnr-Be@X1`lO3;_`H25G&D z>5J(56bD+&%q;AsVilHgSZu_&hZnu3u0RwaHe0yf%rp+Ka}{xh(DY-Py7+Y7V#o+ftZPH z;v(@9@iMVPyh41J*d<;iE)jdgW#U(fE5tr=KwKqWBfdv`pLm`4HR6vX-XMNJ{87a3 zApU6Lk0E|1@h0)>#2-ui2Jy!ce?0Lg5Pu@^ClP-#@uv`fD)FZge>(AJ5Pv4|XAyrk z@#heKF7f9Pe?IXS5Pu=@7ZHCk@s|*PDe=3Azl`|HiQi596~tdj{2t=3BK~UPuOa?g z;;$qAdg5;&{zl?&BK~ILZz29x;%_7VcH-|K{!ZfWBK~gT?;-wP;_oB=e&Qb>{z2j& zBK~38#3cNPPU9)!AC=7}bDJUlu?YF&HOQZckUy#O|5Fk8(+d7f1pX}X&*?7u`3Un1 z5#|>o%r6PcX6mds4IBjH6@HocS19rdH7Io)IM;);GE{S9e^rN#kL<507$4bRS1>-Z zzoB4!B7alC_(cAeg0*{4_vt3>6$Nn?jW)kc{5y3DDryG>e^;f(3jUsgv4X#^V65OD zC>SgFUIk+X|4_l56ohv$3jPuCAJ-|Us2vpi6O|e(_@@fS3jUdbv4VfDV65O@C>SgF zmkREr;9GUwpCkS&;=hjeK<$2epCUW{zn|p~;;6oPGe5)Tr_KBfnxAWQ92SW_@lE&?@qekpxD}&uLz5?J@H(k7<^<&@CBmJ%@ZSh| zoe$vO?1eO%!G3&Mcl)#BQ+D772Wz2`$+-(Dp+SHwG!u47hz#xsaC6l~AhK4)TD1ea z67~qoMMHELP2YCyLSS>&3bwfSq2r~Ad24COuBZyLLAC5UuR+Kybd7kWqO(-3Sb^h} zI_Cnb#8!pp>{qLHsbKq^;}x$IICcee>z0m#vtYrXkGvFJbBAZ={T zE(Kr=@Y7ifD1C1OedFj8wg-DF>p8pNjowtYfnBi8SW6{4a0=s&?Q*_vXkIxlf>Q*^ z+;k@GHuH_?1(R$0N`8K4a*+})k&<4jC6#rmcw8-DhCAmgR^e`9<-p+RT*ay+7_yFQ zSIa=%8r9VnT^wI@$u6(^PQjn|JlF5U5)Zpep5Ixvf_Sl1m#22rCE5idF{ist_TWns z)A`}s*p-E4KR5%#Q1{#NYz0=XTI$WilGSpMzcn&BmhHJRH8zr8>-IZA1r2A$=106r z1zS$GMcs^!+C{7C2ErkmLs*J1?b`Ur)xqAen|+r@hkCAF9=p=hbNOoj_|?nZy**d@ z#=3j@`p5e_E1nkwd%)t9%GJO@f@e-f7PilM)k?wEoh$-paUlEv1XK`)M0}X|2=ODtMrr~KQvX53UEoX_(Np1wCkREO9 zg}jW!4;zPMMYhP1Ck#F~6v@;4DFvI5L)}eNr6s*3`yyl?P}vEo=?1AF45cQS4=VGs z6kw$iA{rIj5>a}CwxnFztqLG)P+^OCS1N3Yka^Egpp(RxW%0w6ZRbvs#X78W4+hx` z*hSo>h;G`zmNS<2&<3pT4avDrZba^nzySrX)Cj{u3dLYVF{Bh%W$rdp2U2EKz9v|+ zoN`5{DUV(996dM|&KX}9ZKI9Y9z3EeaHD3N8l|6CG>**+v~f&_-z2lR*!IH-L41?i zaV!UMAi~i{68+F*XhJ7!<){xQM?)JXu`GIII4A;q!F+<74C?%2$1au zKQnh>44z{a6N7ILm&j=}0&(IaUKJN%X=&0~S{^GFZ^8lM3iP)p$W|*c!4r^BF6u?F zlZ+imYNd!%^Sxq_9iORsrJL)wvV9y6AxfIgF^K?hW!DiLjR}-H()~n?j`^alv(n|P zmR)-emz@L!>n|gKu{Vr%a{05 zW7+B6ob9ST2J9PN^gXv4*c$&%_fGfaY~SIk<>p!;%KzWRXt+p-!a!`+o2}yZgp5id zkY!o2OL0Iq?p2_XuQW0<6^*S_2bd|5lv=67W1&{PQWR#Hh;ZEX?sb-nvz~-!cgj;U zV-nTqa0uPiZWGoEB!;jzT(K>g3CIs*$S~}eB*3*6ZC3&pWduPO)5!eGj0bXD7Xxc) z)bR@yXVocLfmiWyb>OTc}%!WuvLOQIE#<8L`?r}`XS~!B711H+m zF;`+sI@l9|q#T&PDH+Tamx2gSC6yyd;yS!y(Z#vTLdDQMDDyFNK~42|!@lno98E4% zwc16|i9-B}QDmVIL+XSg4$aAg!8_|>qT7!q%Ac00Qz(vGeMx=p+IG3)Vm=CSbt~sD z<}a!cGluWW!d!cGY1+AKyUw!b@deo@8fX?>&oUurwOodulUNe7hn8-s!2A|geVv6U z;?`>doNRQp1IVc4G}#jY1y^nmF=Hw0LX%ABEo(hrsoFZ#7IWiN-;&rDSBzR4EonG4 zGCzJ$!6{aKs=i$rMaZsaOaQFB75F(hO}hCk7**m65*@3~a`aU(S*P`~tp^G1*f7~O z**i0Kub!RwtE&rvbVBVhsv;0c9&@uhWWvj9TkRlh%h3xYd%EM>tQNmC0YPR@T|g)4 zm;X9iT~^WWLIzjrEG&23^D1|{%3b9pI8NJjyCgFjE?F+}F~4hMW^V44{7}9--_w`J zPAe?;bioC6&CO(|x+1FaSGweIcEMAt%jNlsjdNqNM9sFc!}GlZNUm>Up5a@TI?L<2 znzBI9dC|K+47L1sikj)>)c(}ip5|0b>UioPKF#TK>659W>BG&<0+~;`HFYV~o^DMa zOr4is@JLTf>d{ORZU=t`J%>_gg`dNz!>MEV+naeT-JEU%Z+oge^LXld>dEw}W?c)E zDO5xJPGRR%7yX=Md77(^zXB&^ch2B?v6k#>3+jJ$aqj&{zj ztihuwsoe9U!}G(Ek!~}Ey_z%ngP__WPmWUZX=~lC^hn+u`#+QKKffcdsjI*RhP*X( zmZXf}l*rglL0MMax#gm4xj;^0jTlUzuSvK$>`Ei~xcH~-$f8T9Tr5{1&tbi}R6-dO zX9@^Bwr06ixjL>DtFF6sdP_lgZ(s;;m#g5vjFFTdqIV}kJY2bmOH2mAhzLt8-*mZ?M`9Yl>7h1VOx2KJyX73m;CbNb+!qkRt zm5QD^(pBsJ+fh!Cf5%_YiASV>2@D+d^Wr{%m^FcilLDyY12=)tDA3siFf}z}`Q~18 z{FxD}0zHKn_Xy~8G`Rz@2zpnQaqHl2cjQRV*rlpE(z4m}x}ZWlIX$mW4h^x2}u)XQ!Zo6J>Lr7AJ};;05XN}|Dx1d)hPZ9MYyDjGye zI21kli>efH!mT0Q+2gX-+jU3jUC_1@MbNQR&loreY zQnPvJ0ESpEXN2A3uC<0oWMZnXOATA6>d+FRS$BuR^lb>;lD=)9l;9w3pN60VL3fyV z0N7R55at<%cUK%*iqZ3|(W|y37ce#qhBgd7)P}*GY(U4B4FGnfQD}qV-4#b@gQ#Kh z8ML-+7zk|`c&H5nJK2DaEgJyrN~6#Q!@Dbv&<0V%*npPUAjc5CP96(r$wysL@~BGg zD?A{}S^;>(r=UDkLcIwuBPi~+y{;pmlKG-3zXi(`@1Fk*Naaa6lFLr~ne&H-&2uC3 z7%`YcR%LKnC6N5TwxA%Krl9c96C}K$+R|2KYeh=HQt$UFIvY}) z3C`kc`%R}zW_vN8o;%`c22@xIp4xG`qGG>lDhE?* zAXs0i51OKsY3HUzhU}r-P5GLauMvD{WDvj3q|lPS+!TamcRccyXTK;HOHp|(EV)bD zDZ%Zaq$_2iEcU!QFH}bQdQDx$x~~z3uX{dx`XV~|`ua*vTuaWymp%kZ)Jat&O3&tP zt?_$zb9Nb?N9!pSZ9;NoT~AkSnN%GZe3QNslgr8gV={o8TojMsgiTB!k7oc!PiAb? zqG6)1m(bX#R;=-InCi`5b4UMq24s6?pWjJlo8lvT{5q% zFDIF&EH0kt+$s5mWt*$6jko;qZ|m#-PTgPb%I8+$k6rtQ_#^)yChchYMCu4WE#U{P zbW28{Bh9G%H?^kfKAF~3TdJ+;V5YTse`=M^>5VAy~ baJPv)=`$H4t1aCMYoK$wxp}tvZ0dgiPBzJ; From 82e7e0226b71004e4a2cf3a925b0b47d16dd0b7e Mon Sep 17 00:00:00 2001 From: pgunnell Date: Thu, 2 Nov 2017 09:39:47 +0100 Subject: [PATCH 18/48] Delete Test_cfg.py --- AnalysisFW/test/Test_cfg.py | 326 ------------------------------------ 1 file changed, 326 deletions(-) delete mode 100644 AnalysisFW/test/Test_cfg.py diff --git a/AnalysisFW/test/Test_cfg.py b/AnalysisFW/test/Test_cfg.py deleted file mode 100644 index 8071c01a6f7..00000000000 --- a/AnalysisFW/test/Test_cfg.py +++ /dev/null @@ -1,326 +0,0 @@ -# -*- coding: utf-8 -*- - -import FWCore.ParameterSet.Config as cms - -from RecoJets.Configuration.RecoPFJets_cff import ak4PFJets, ak4PFJetsCHS -from RecoJets.Configuration.RecoGenJets_cff import ak4GenJets -from RecoJets.JetProducers.SubJetParameters_cfi import SubJetParameters -from RecoJets.JetProducers.PFJetParameters_cfi import * -from RecoJets.JetProducers.GenJetParameters_cfi import * -from RecoJets.JetProducers.AnomalousCellParameters_cfi import * -from PhysicsTools.PatAlgos.producersLayer1.patCandidates_cff import * -from PhysicsTools.PatAlgos.selectionLayer1.jetSelector_cfi import selectedPatJets -from PhysicsTools.PatAlgos.tools.jetTools import * -#from PhysicsTools.PatAlgos.producersLayer1.metProducer_cfi import patMETs -from PhysicsTools.PatAlgos.patSequences_cff import * -#nnfrom PhysicsTools.PatAlgos.tools.metTools import addMETCollection -#from RecoJets.JetProducers.pileupjetidproducer_cfi import * -from PhysicsTools.PatAlgos.patTemplate_cfg import * -from PhysicsTools.PatAlgos.tools.jetTools import * - -## Modified version of jetToolBox from https://github.com/cms-jet/jetToolbox -## Options for PUMethod: Puppi, CS, SK, CHS - -# -*- coding: utf-8 -*- -import FWCore.ParameterSet.Config as cms - -process = cms.Process("Ntuplizer") -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -#! Conditions -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_condDBv2_cff") -process.load("Configuration.EventContent.EventContent_cff") -process.load('Configuration.StandardSequences.GeometryRecoDB_cff') -process.load('Configuration.StandardSequences.MagneticField_38T_cff') -process.load('RecoJets.Configuration.GenJetParticles_cff') -process.load('RecoJets.Configuration.RecoGenJets_cff') -process.load('RecoJets.JetProducers.TrackJetParameters_cfi') -process.load('RecoJets.JetProducers.PileupJetIDParams_cfi') -process.load("PhysicsTools.PatAlgos.patSequences_cff") - -#process.load("PhysicsTools.PatAlgos.slimming.pileupJetId_cfi") - -#process.GlobalTag.globaltag = "74X_dataRun2_Prompt_v4" -#process.GlobalTag.globaltag = "76X_dataRun2_v5" -process.GlobalTag.globaltag = '80X_dataRun2_Prompt_v9' - -##-------------------- Import the JEC services ----------------------- -process.load('JetMETCorrections.Configuration.DefaultJEC_cff') - -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -#! Input -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -inFiles = cms.untracked.vstring( -#'root://xrootd.unl.edu//store/data/Run2015D/JetHT/AOD/PromptReco-v4/000/258/159/00000/00F952BC-D16B-E511-B784-02163E0144F2.root' -#'root://xrootd.unl.edu//store/data/Run2015D/JetHT/AOD/PromptReco-v3/000/256/630/00000/BC44672C-345F-E511-BEA5-02163E0141FB.root' -#'root://xrootd.unl.edu//store/data/Run2015C/JetHT/AOD/PromptReco-v1/000/253/890/00000/24D029CE-2741-E511-B0AF-02163E014604.root' -#'root://xrootd.unl.edu//store/data/Run2015D/JetHT/AOD/PromptReco-v3/000/256/674/00000/36D872F3-F95E-E511-870B-02163E013539.root' -#'root://xrootd.unl.edu//store/data/Run2015D/JetHT/AOD/PromptReco-v3/000/256/729/00000/5C1F5529-F65F-E511-9B8C-02163E0145D9.root' -#'file:2EE7CEE1-483B-E611-B695-02163E014655.root' -'file:0CF529E9-0445-E611-8317-02163E011F22.root' - ) - -process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(10000)) -process.source = cms.Source("PoolSource", fileNames = inFiles ) - -def jetToolbox( proc, jetType, jetSequence,PUMethod='', bTagDiscriminators = None): - - JETCorrPayload='None' - JETCorrLevels = [ 'None' ] - bTagDiscriminators = ['trackCountingHighEffBJetTags','trackCountingHighPurBJetTags','pfTrackCountingHighEffBJetTags','pfTrackCountingHighPurBJetTags','softPFMuonByIP3dBJetTags','softPFElectronByIP3dBJetTags','softPFMuonBJetTags','softPFElectronBJetTags','simpleSecondaryVertexHighEffBJetTags','simpleSecondaryVertexHighPurBJetTags','pfSimpleSecondaryVertexHighEffBJetTags','pfSimpleSecondaryVertexHighPurBJetTags','combinedSecondaryVertexV2BJetTags','pfCombinedSecondaryVertexV2BJetTags','pfCombinedInclusiveSecondaryVertexV2BJetTags','pfCombinedMVAV2BJetTags','pfPositiveCombinedSecondaryVertexV2BJetTags','pfNegativeCombinedSecondaryVertexV2BJetTags','pfCombinedInclusiveSecondaryVertexV2BJetTags','pfCombinedMVAV2BJetTags','pfJetProbabilityBJetTags'] - - - - #GetJetMCFlavour = ['True'] - #JECLevels = [ 'L1Offset', 'L1FastJet', 'L1JPTOffset', 'L2Relative', 'L3Absolute', 'L5Falvour', 'L7Parton' ] - - algorithm='AntiKt' # CambridgeAachen' , 'Kt' - size = jetType[-1:] #[-1:] takes the last char from string 'akX' - jetSize = float('0.'+jetType[-1:]) - jetALGO = jetType.upper() - jetalgo = jetType.lower() - elemToKeep = [] - - print 'Running processes with: '+str(jetALGO)+' PF '+PUMethod+' jet algorithm with radius parameter '+str(jetSize) - - JETCorrPayload = 'AK'+size+'PF'+PUMethod.lower() - JETCorrLevels = ['L1FastJet', 'L2Relative', 'L3Absolute','L2L3Residual'] - #JETCorrLevels = [] #No JEC corrections - JEC = ( JETCorrPayload, JETCorrLevels , 'None') - - ################################################################################# - ####### Toolbox start - ################################################################################# - - elemToKeep = [] - jetSeq = cms.Sequence() - genParticlesLabel = '' - pvLabel = '' - tvLabel = '' - toolsUsed = [] - - proc.load('RecoJets.Configuration.GenJetParticles_cff') - setattr( proc, jetalgo+'GenJetsNoNu', ak4GenJets.clone( src = 'genParticlesForJetsNoNu', rParam = jetSize, jetAlgorithm = algorithm ) ) - jetSeq += getattr(proc, jetalgo+'GenJetsNoNu' ) - - proc.load('CommonTools.ParticleFlow.pfNoPileUpJME_cff') - #### Creating PATjets - if( PUMethod=='CHS') : - setattr( proc, jetalgo+'PFJetsCHS', ak4PFJets.clone( rParam = jetSize, jetAlgorithm = algorithm ) ) - jetSeq += getattr(proc, jetalgo+'PFJetsCHS' ) - - setattr( proc, jetalgo+'PFJetsCHS', - ak4PFJetsCHS.clone( - doAreaFastjet = True, - rParam = jetSize, - jetAlgorithm = algorithm ) ) - jetSeq += getattr(proc, jetalgo+'PFJetsCHS' ) - - else : - setattr( proc, jetalgo+'PFJets', ak4PFJets.clone( rParam = jetSize, jetAlgorithm = algorithm ) ) - jetSeq += getattr(proc, jetalgo+'PFJets' ) - - setattr( proc, jetalgo+'PFJets', - ak4PFJets.clone( - doAreaFastjet = True, - rParam = jetSize, - jetAlgorithm = algorithm ) ) - jetSeq += getattr(proc, jetalgo+'PFJets' ) - PUMethod='' - - - addJetCollection( - proc, - labelName = jetALGO+'PF'+PUMethod, - jetSource = cms.InputTag( jetalgo+'PFJets'+PUMethod), - algo = jetalgo, - btagDiscriminators = bTagDiscriminators, - rParam = jetSize, - jetCorrections = JEC, #( 'AK'+size+'PFchs', cms.vstring( ['L1FastJet', 'L2Relative', 'L3Absolute']), 'None'), - pfCandidates = cms.InputTag( 'particleFlow' ), #'packedPFCandidates'), - svSource = cms.InputTag('inclusiveCandidateSecondaryVertices'), - genJetCollection = cms.InputTag( jetalgo+'GenJetsNoNu'), - pvSource = cms.InputTag( 'offlinePrimaryVertices' ), #'offlineSlimmedPrimaryVertices'), - jetTrackAssociation = True, - - ) - - #setattr( proc, jetALGO+'PF'+PUMethod+'pileupJetIdCalculator', -# pileupJetIdCalculator.clone( -# jets = cms.InputTag(jetalgo+'PFJets'+PUMethod), -# rho = cms.InputTag("fixedGridRhoFastjetAll"), -# vertexes = cms.InputTag('offlinePrimaryVertices'), -# applyJec = cms.bool(True), -# inputIsCorrected = cms.bool(False) -# )) - -# setattr( proc, jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator', -# pileupJetIdEvaluator.clone( -# jetids = cms.InputTag(jetALGO+'PF'+PUMethod+'pileupJetIdCalculator'), -# jets = cms.InputTag(jetalgo+'PFJets'+PUMethod), -# rho = cms.InputTag("fixedGridRhoFastjetAll"), -# vertexes = cms.InputTag('offlinePrimaryVertices'), -# applyJec = cms.bool(True), -# inputIsCorrected = cms.bool(False) -# -# ) -# ) - - #getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod).userData.userFloats.src += [jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator:fullDiscriminant'] - #getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod).userData.userInts.src += [jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator:cutbasedId',jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator:fullId'] - - getattr(proc,'patJetPartons').particles = cms.InputTag( 'genParticles' ) #'prunedGenParticles') - setattr(proc, 'selectedPatJets'+jetALGO+'PF'+PUMethod, selectedPatJets.clone( src = 'patJets'+jetALGO+'PF'+PUMethod ) ) - setattr(proc, jetSequence, jetSeq) - -jetToolbox( process, 'ak4', 'ak4JetSubs') -jetToolbox( process, 'ak4', 'ak4JetSubs','CHS') - -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -#! Services -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -process.load('FWCore.MessageLogger.MessageLogger_cfi') -process.MessageLogger.cerr.FwkReport.reportEvery = 100 -process.load('CommonTools.UtilAlgos.TFileService_cfi') -process.TFileService.fileName=cms.string('DATA_ProcessedTreeProducer_2.root') - -# PAT Layer 1 -#process.load("PhysicsTools.PatAlgos.patLayer0_cff") # need to load this -#process.load("PhysicsTools.PatAlgos.patLayer1_cff") # even if we run only layer 1 - -process.load("PhysicsTools.PatAlgos.producersLayer1.patCandidates_cff") -process.load("PhysicsTools.PatAlgos.selectionLayer1.selectedPatCandidates_cff") -#from PhysicsTools.PatAlgos.tools.metTools import addMETCollection -#addMETCollection(process,'patMETPF','pfMetT1') -#patMETs.addGenMet = cms.bool(False) -#patMETs.genMETSource = cms.InputTag("") -process.patJets.addTagInfos = True -process.patJets.addAssociatedTracks = True - -process.ak4 = cms.EDAnalyzer('ProcessedTreeProducerBTag', - ## jet collections ########################### - pfjets = cms.InputTag('selectedPatJetsAK4PF'), - pfjetschs = cms.InputTag('selectedPatJetsAK4PFCHS'), - pfpujetid = cms.string('AK4PFpileupJetIdEvaluator:fullDiscriminant'), - pfchsjetpuid = cms.string('AK4PFCHSpileupJetIdEvaluator:fullDiscriminant'), - ## MET collection #### - pfmet = cms.InputTag('patMETs'), - genjets = cms.untracked.InputTag('ak4GenJetsNoNu'), - ## database entry for the uncertainties ###### - PFPayloadName = cms.string('AK4PF'), - PFPayloadNameCHS= cms.string('AK4PFchs'), - jecUncSrc = cms.string(''), - jecUncSrcCHS = cms.string(''), - jecUncSrcNames = cms.vstring(''), - ## set the conditions for good Vtx counting ## - offlineVertices = cms.InputTag('offlinePrimaryVertices'), - beamSpot = cms.InputTag('offlineBeamSpot'), - goodVtxNdof = cms.double(4), - goodVtxZ = cms.double(24), - ## rho ####################################### - srcCaloRho = cms.InputTag('fixedGridRhoFastjetAllCalo'), - srcPFRho = cms.InputTag('fixedGridRhoFastjetAll'), - srcPULabel = cms.untracked.InputTag('addPileupInfo','addPileupInfo'), - ## preselection cuts ######################### - maxY = cms.double(5.0), - minPFPt = cms.double(20), - minNPFJets = cms.int32(1), - minGenPt = cms.untracked.double(20), - minJJMass = cms.double(-1), - isMCarlo = cms.untracked.bool(False), - useGenInfo = cms.untracked.bool(False), - ## trigger ################################### - printTriggerMenu = cms.untracked.bool(True), - processName = cms.string('HLT'), - triggerName = cms.vstring('HLT_PFJet40_v6'), - triggerResults = cms.InputTag("TriggerResults","","HLT"), - triggerEvent = cms.InputTag("hltTriggerSummaryAOD","","HLT"), - ## jec services ############################## - #new tokens - EventInfo = cms.InputTag("generator"), - GenParticles = cms.InputTag("genparticles"), - HBHENoiseFilterResultLabel = cms.InputTag("HBHENoiseFilterResultProducer", "HBHENoiseFilterResult"), - HBHENoiseFilterResultNoMinZLabel = cms.InputTag("HBHENoiseFilterResultProducerNoMinZ", "HBHENoiseFilterResult"), - jetFlavourInfos = cms.InputTag("genJetFlavourInfos"), - #pfjecService = cms.string('ak7PFL1FastL2L3Residual'), -) - -jetToolbox( process, 'ak8', 'ak8JetSubs','CHS') -jetToolbox( process, 'ak8', 'ak8JetSubs') - -process.ak8 = process.ak4.clone( - pfjets = cms.InputTag('selectedPatJetsAK8PF'), - pfjetschs = cms.InputTag('selectedPatJetsAK8PFCHS'), - pfpujetid = cms.string('AK8PFpileupJetIdEvaluator:fullDiscriminant'), - pfchsjetpuid = cms.string('AK8PFCHSpileupJetIdEvaluator:fullDiscriminant'), - PFPayloadName = cms.string('AK8PF'), - PFPayloadNameCHS= cms.string('AK8PFchs'), -) - -jetToolbox( process, 'ak7', 'ak7JetSubs','CHS') -jetToolbox( process, 'ak7', 'ak7JetSubs') - -process.ak7 = process.ak4.clone( - pfjets = cms.InputTag('selectedPatJetsAK7PF'), - pfjetschs = cms.InputTag('selectedPatJetsAK7PFCHS'), - pfpujetid = cms.string('AK7PFpileupJetIdEvaluator:fullDiscriminant'), - pfchsjetpuid = cms.string('AK7PFCHSpileupJetIdEvaluator:fullDiscriminant'), - PFPayloadName = cms.string('AK7PF'), - PFPayloadNameCHS= cms.string('AK7PFchs'), -) - -jetToolbox( process, 'ak5', 'ak5JetSubs','CHS') -jetToolbox( process, 'ak5', 'ak5JetSubs') - -process.ak5 = process.ak4.clone( - pfjets = cms.InputTag('selectedPatJetsAK5PF'), - pfjetschs = cms.InputTag('selectedPatJetsAK5PFCHS'), - pfpujetid = cms.string('AK5PFpileupJetIdEvaluator:fullDiscriminant'), - pfchsjetpuid = cms.string('AK5PFCHSpileupJetIdEvaluator:fullDiscriminant'), - PFPayloadName = cms.string('AK5PF'), - PFPayloadNameCHS= cms.string('AK5PFchs'), -) - -############# hlt filter ######################### -process.hltFilter = cms.EDFilter('HLTHighLevel', - TriggerResultsTag = cms.InputTag('TriggerResults','','HLT'), - HLTPaths = cms.vstring('HLT_PFJet40_v6'), - eventSetupPathsKey = cms.string(''), - andOr = cms.bool(True), #----- True = OR, False = AND between the HLTPaths - throw = cms.bool(False) -) - -##MET Filters -process.load('RecoMET.METFilters.CSCTightHaloFilter_cfi') -process.load('CommonTools.RecoAlgos.HBHENoiseFilterResultProducer_cfi') - -process.HBHENoiseFilterResultProducerNoMinZ = process.HBHENoiseFilterResultProducer.clone(minZeros = cms.int32(99999)) - - -process.goodVertices = cms.EDFilter("VertexSelector", - filter = cms.bool(False), - src = cms.InputTag("offlinePrimaryVertices"), - cut = cms.string("!isFake && ndof >= 4 && abs(z) <= 24 && position.rho <= 2"), -) -process.load('RecoMET.METFilters.trackingFailureFilter_cfi') - -##Type1 patMET Producer -process.load('PhysicsTools.PatAlgos.recoLayer0.metCorrections_cff') -process.load('PhysicsTools.PatAlgos.producersLayer1.metProducer_cfi') -process.patMETs.addGenMET = cms.bool(False) -#Try scheduled processs -process.path = cms.Path(process.goodVertices*process.trackingFailureFilter* - process.hltFilter* - process.HBHENoiseFilterResultProducer* - process.HBHENoiseFilterResultProducerNoMinZ* - process.patMETCorrections*process.patMETs#process.patDefaultSequence* - #*process.ak4 *process.ak5*process.ak7*process.ak8) - *process.ak4) - - -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -#! Output and Log -#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(False) ) -process.options.allowUnscheduled = cms.untracked.bool(True) From af553bdf18799812f5143677613aaf8a0188df8b Mon Sep 17 00:00:00 2001 From: pgunnell Date: Thu, 2 Nov 2017 09:40:03 +0100 Subject: [PATCH 19/48] Delete crab.log --- AnalysisFW/test/crab.log | 183 --------------------------------------- 1 file changed, 183 deletions(-) delete mode 100644 AnalysisFW/test/crab.log diff --git a/AnalysisFW/test/crab.log b/AnalysisFW/test/crab.log deleted file mode 100644 index 4b1e25b78b4..00000000000 --- a/AnalysisFW/test/crab.log +++ /dev/null @@ -1,183 +0,0 @@ -DEBUG 2016-07-01 10:29:05,103: Executing command: 'status' -DEBUG 2016-07-01 10:29:05,103: Found CRAB cache file /afs/desy.de/user/e/eren/.crab3 -DEBUG 2016-07-01 10:29:05,111: Checking credentials -DEBUG 2016-07-01 10:29:05,111: Found proxy file /tmp/x509up_u22919 -DEBUG 2016-07-01 10:29:05,111: Getting proxy life time left -DEBUG 2016-07-01 10:29:05,814: Executing : - command : voms-proxy-info -file /tmp/x509up_u22919 -timeleft - output : 86281 - - error: Picked up _JAVA_OPTIONS: -Xmx256M - - retcode : 0 -DEBUG 2016-07-01 10:29:06,217: Executing : - command : voms-proxy-info -file /tmp/x509up_u22919 -actimeleft - output : 86280 - - error: Picked up _JAVA_OPTIONS: -Xmx256M - - retcode : 0 -DEBUG 2016-07-01 10:29:06,217: Proxy valid for 23:58:01 hours -ERROR 2016-07-01 10:29:06,218: Cannot find .requestcache file in CRAB project directory /nfs/dust/cms/user/eren/CMS/InclusiveJets/CMSSW_8_0_7/src/SMPJ/AnalysisFW/test/JetDataWithJsonFile-MagnField-Run2016B_25ns-BTag-80X-PromptReco-v1 -ERROR 2016-07-01 10:29:06,219: Caught exception -Traceback (most recent call last): - File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1606-comp/bin/crab", line 160, in - client() - File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1606-comp/bin/crab", line 146, in __call__ - self.cmd = sub_cmd(self.logger, args[1:]) - File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1606-comp/lib/python2.7/site-packages/CRABClient/Commands/SubCommand.py", line 318, in __init__ - self.loadLocalCache(proxyOptsSetPlace) - File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1606-comp/lib/python2.7/site-packages/CRABClient/Commands/SubCommand.py", line 447, in loadLocalCache - raise ex -CachefileNotFoundException: Cannot find .requestcache file in CRAB project directory /nfs/dust/cms/user/eren/CMS/InclusiveJets/CMSSW_8_0_7/src/SMPJ/AnalysisFW/test/JetDataWithJsonFile-MagnField-Run2016B_25ns-BTag-80X-PromptReco-v1 -DEBUG 2016-07-04 18:17:18,771: Executing command: 'submit' -DEBUG 2016-07-04 18:17:18,772: Found CRAB cache file /afs/desy.de/user/e/eren/.crab3 -DEBUG 2016-07-04 18:17:18,792: Checking credentials -DEBUG 2016-07-04 18:17:18,792: Found proxy file /tmp/x509up_u22919 -DEBUG 2016-07-04 18:17:18,792: Getting proxy life time left -ERROR 2016-07-04 18:17:19,095: Keyboard Interrupted -DEBUG 2016-07-04 18:17:31,174: Executing command: 'submit' -DEBUG 2016-07-04 18:17:31,174: Found CRAB cache file /afs/desy.de/user/e/eren/.crab3 -DEBUG 2016-07-04 18:17:31,181: Checking credentials -DEBUG 2016-07-04 18:17:31,182: Found proxy file /tmp/x509up_u22919 -DEBUG 2016-07-04 18:17:31,182: Getting proxy life time left -DEBUG 2016-07-04 18:17:32,085: Executing : - command : voms-proxy-info -file /tmp/x509up_u22919 -timeleft - output : 59464 - - error: Picked up _JAVA_OPTIONS: -Xmx256M - - retcode : 0 -DEBUG 2016-07-04 18:17:32,488: Executing : - command : voms-proxy-info -file /tmp/x509up_u22919 -actimeleft - output : 59464 - - error: Picked up _JAVA_OPTIONS: -Xmx256M - - retcode : 0 -DEBUG 2016-07-04 18:17:32,488: Proxy valid for 16:31:04 hours -INFO 2016-07-04 18:17:32,489: Will use CRAB configuration file crabDataAODBTag.py -DEBUG 2016-07-04 18:17:32,489: Loading CRAB configuration file. -DEBUG 2016-07-04 18:17:32,492: Will use CRAB Analysis plugin (i.e. will run an analysis job type). -ERROR 2016-07-04 18:17:32,493: Working area '/nfs/dust/cms/user/eren/CMS/InclusiveJets/CMSSW_8_0_7/src/SMPJ/AnalysisFW/test/JetDataWithJsonFile-MagnField-Run2016B_25ns-BTag-80X-PromptReco-v2/crab_JetData-June2016-MagnField-Run2016B_25ns-BTag-80X-PromptReco-v2' already exists -Please change the requestName in the config file -ERROR 2016-07-04 18:17:32,493: Caught exception -Traceback (most recent call last): - File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1606-comp/bin/crab", line 160, in - client() - File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1606-comp/bin/crab", line 146, in __call__ - self.cmd = sub_cmd(self.logger, args[1:]) - File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1606-comp/lib/python2.7/site-packages/CRABClient/Commands/submit.py", line 34, in __init__ - SubCommand.__init__(self, logger, cmdargs, disable_interspersed_args=True) - File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1606-comp/lib/python2.7/site-packages/CRABClient/Commands/SubCommand.py", line 299, in __init__ - getattr(self.configuration.General, 'requestName', None)) - File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1606-comp/lib/python2.7/site-packages/CRABClient/ClientUtilities.py", line 394, in createWorkArea - raise ConfigException("Working area '%s' already exists \nPlease change the requestName in the config file" % fullpath) -ConfigException: Working area '/nfs/dust/cms/user/eren/CMS/InclusiveJets/CMSSW_8_0_7/src/SMPJ/AnalysisFW/test/JetDataWithJsonFile-MagnField-Run2016B_25ns-BTag-80X-PromptReco-v2/crab_JetData-June2016-MagnField-Run2016B_25ns-BTag-80X-PromptReco-v2' already exists -Please change the requestName in the config file -DEBUG 2016-08-03 11:37:33,212: Executing command: 'submit' -DEBUG 2016-08-03 11:37:33,213: Found CRAB cache file /afs/cern.ch/user/p/pgunnell/.crab3 -DEBUG 2016-08-03 11:37:33,229: Checking credentials -DEBUG 2016-08-03 11:37:33,229: Found proxy file /tmp/x509up_u32627 -DEBUG 2016-08-03 11:37:33,229: Getting proxy life time left -DEBUG 2016-08-03 11:37:34,033: Executing : - command : voms-proxy-info -file /tmp/x509up_u32627 -timeleft - output : 86328 - - error: - retcode : 0 -DEBUG 2016-08-03 11:37:34,546: Executing : - command : voms-proxy-info -file /tmp/x509up_u32627 -actimeleft - output : 86328 - - error: - retcode : 0 -DEBUG 2016-08-03 11:37:34,546: Proxy valid for 23:58:48 hours -INFO 2016-08-03 11:37:34,546: Will use CRAB configuration file crabDataAODBTag.py -DEBUG 2016-08-03 11:37:34,546: Loading CRAB configuration file. -DEBUG 2016-08-03 11:37:34,547: Will use CRAB Analysis plugin (i.e. will run an analysis job type). -ERROR 2016-08-03 11:37:34,548: Working area '/afs/cern.ch/work/p/pgunnell/Run2Analysis/CMSSW_8_0_13_patch1/src/SMPJ/AnalysisFW/test/JetDataWithJsonFile-MagnField-Run2016D_25ns-BTag-80X-PromptReco-v2/crab_JetData-June2016-MagnField-Run2016D_25ns-BTag-80X-PromptReco-v2' already exists -Please change the requestName in the config file -ERROR 2016-08-03 11:37:34,548: Caught exception -Traceback (most recent call last): - File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1607.patch2/bin/crab", line 160, in - client() - File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1607.patch2/bin/crab", line 146, in __call__ - self.cmd = sub_cmd(self.logger, args[1:]) - File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1607.patch2/lib/python2.7/site-packages/CRABClient/Commands/submit.py", line 34, in __init__ - SubCommand.__init__(self, logger, cmdargs, disable_interspersed_args=True) - File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1607.patch2/lib/python2.7/site-packages/CRABClient/Commands/SubCommand.py", line 302, in __init__ - getattr(self.configuration.General, 'requestName', None)) - File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1607.patch2/lib/python2.7/site-packages/CRABClient/ClientUtilities.py", line 394, in createWorkArea - raise ConfigException("Working area '%s' already exists \nPlease change the requestName in the config file" % fullpath) -ConfigException: Working area '/afs/cern.ch/work/p/pgunnell/Run2Analysis/CMSSW_8_0_13_patch1/src/SMPJ/AnalysisFW/test/JetDataWithJsonFile-MagnField-Run2016D_25ns-BTag-80X-PromptReco-v2/crab_JetData-June2016-MagnField-Run2016D_25ns-BTag-80X-PromptReco-v2' already exists -Please change the requestName in the config file -DEBUG 2016-08-03 18:22:58,334: Executing command: 'status' -DEBUG 2016-08-03 18:22:58,334: Found CRAB cache file /afs/cern.ch/user/p/pgunnell/.crab3 -ERROR 2016-08-03 18:22:58,334: Error: JetDataWithJsonFile-MagnField-Run2016D_25ns-BTag-80X-PromptReco-v2/crab_JetData-June2016-MagnField-Run2016D_25ns-BTag-80X-PromptReco-v2/ is not a valid CRAB project directory. -ERROR 2016-08-03 18:22:58,334: Caught exception -Traceback (most recent call last): - File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1607.patch2/bin/crab", line 160, in - client() - File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1607.patch2/bin/crab", line 146, in __call__ - self.cmd = sub_cmd(self.logger, args[1:]) - File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1607.patch2/lib/python2.7/site-packages/CRABClient/Commands/SubCommand.py", line 257, in __init__ - self.validateOptions() - File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1607.patch2/lib/python2.7/site-packages/CRABClient/Commands/status.py", line 749, in validateOptions - SubCommand.validateOptions(self) - File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1607.patch2/lib/python2.7/site-packages/CRABClient/Commands/SubCommand.py", line 566, in validateOptions - raise ConfigurationException(msg) -ConfigurationException: Error: JetDataWithJsonFile-MagnField-Run2016D_25ns-BTag-80X-PromptReco-v2/crab_JetData-June2016-MagnField-Run2016D_25ns-BTag-80X-PromptReco-v2/ is not a valid CRAB project directory. -DEBUG 2016-08-03 18:23:01,830: Executing command: 'status' -DEBUG 2016-08-03 18:23:01,830: Found CRAB cache file /afs/cern.ch/user/p/pgunnell/.crab3 -ERROR 2016-08-03 18:23:01,831: Error: JetDataWithJsonFile-MagnField-Run2016D_25ns-BTag-80X-PromptReco-v2/crab_JetData-June2016-MagnField-Run2016D_25ns-BTag-80X-PromptReco-v2/ is not a valid CRAB project directory. -ERROR 2016-08-03 18:23:01,831: Caught exception -Traceback (most recent call last): - File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1607.patch2/bin/crab", line 160, in - client() - File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1607.patch2/bin/crab", line 146, in __call__ - self.cmd = sub_cmd(self.logger, args[1:]) - File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1607.patch2/lib/python2.7/site-packages/CRABClient/Commands/SubCommand.py", line 257, in __init__ - self.validateOptions() - File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1607.patch2/lib/python2.7/site-packages/CRABClient/Commands/status.py", line 749, in validateOptions - SubCommand.validateOptions(self) - File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1607.patch2/lib/python2.7/site-packages/CRABClient/Commands/SubCommand.py", line 566, in validateOptions - raise ConfigurationException(msg) -ConfigurationException: Error: JetDataWithJsonFile-MagnField-Run2016D_25ns-BTag-80X-PromptReco-v2/crab_JetData-June2016-MagnField-Run2016D_25ns-BTag-80X-PromptReco-v2/ is not a valid CRAB project directory. -DEBUG 2016-09-26 21:51:00,704: Executing command: 'submit' -DEBUG 2016-09-26 21:51:00,722: Found CRAB cache file /afs/cern.ch/user/p/pgunnell/.crab3 -DEBUG 2016-09-26 21:51:00,757: Checking credentials -DEBUG 2016-09-26 21:51:00,757: Proxy file /tmp/x509up_u32627 not found -DEBUG 2016-09-26 21:51:00,757: Creating new proxy for 24:00 hours with VO group '' and VO role 'NULL'. -DEBUG 2016-09-26 21:51:04,974: Executing : - command : voms-proxy-init -voms cms:/cms -valid 24:00 -rfc - output : None - error: None - retcode : 1 -DEBUG 2016-09-26 21:51:05,379: Executing : - command : voms-proxy-info -file /tmp/x509up_u32627 -timeleft - output : - error: Proxy not found: /tmp/x509up_u32627 (No such file or directory) - - retcode : 1 -ERROR 2016-09-26 21:51:05,379: Error while checking proxy timeleft for /tmp/x509up_u32627 -DEBUG 2016-09-26 21:51:05,789: Executing : - command : env X509_USER_PROXY=/tmp/x509up_u32627 voms-proxy-info -fqan - output : - error: Proxy not found: /tmp/x509up_u32627 (No such file or directory) - - retcode : 1 -ERROR 2016-09-26 21:51:05,790: Problems creating proxy. -ERROR 2016-09-26 21:51:05,790: Caught exception -Traceback (most recent call last): - File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1608/bin/crab", line 160, in - client() - File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1608/bin/crab", line 146, in __call__ - self.cmd = sub_cmd(self.logger, args[1:]) - File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1608/lib/python2.7/site-packages/CRABClient/Commands/submit.py", line 34, in __init__ - SubCommand.__init__(self, logger, cmdargs, disable_interspersed_args=True) - File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1608/lib/python2.7/site-packages/CRABClient/Commands/SubCommand.py", line 292, in __init__ - self.proxyCreated = self.proxy.createNewVomsProxySimple(timeLeftThreshold = 720) - File "/cvmfs/cms.cern.ch/crab3/slc6_amd64_gcc493/cms/crabclient/3.3.1608/lib/python2.7/site-packages/CRABClient/CredentialInteractions.py", line 152, in createNewVomsProxySimple - raise ProxyCreationException("Problems creating proxy.") -ProxyCreationException: Problems creating proxy. From b2c5782aedc081a439f1bcf4ffa0613c9820768f Mon Sep 17 00:00:00 2001 From: pgunnell Date: Thu, 2 Nov 2017 09:40:11 +0100 Subject: [PATCH 20/48] Delete crabDataAODBTag-RunC2016.py --- AnalysisFW/test/crabDataAODBTag-RunC2016.py | 29 --------------------- 1 file changed, 29 deletions(-) delete mode 100644 AnalysisFW/test/crabDataAODBTag-RunC2016.py diff --git a/AnalysisFW/test/crabDataAODBTag-RunC2016.py b/AnalysisFW/test/crabDataAODBTag-RunC2016.py deleted file mode 100644 index 3479c5442d6..00000000000 --- a/AnalysisFW/test/crabDataAODBTag-RunC2016.py +++ /dev/null @@ -1,29 +0,0 @@ -from WMCore.Configuration import Configuration -config = Configuration() - -config.section_("User") -config.User.voGroup = 'dcms' - -config.section_("General") -config.General.requestName = 'JetData-June2016-MagnField-Run2016C_25ns-BTag-80X-PromptReco-v2' -config.General.workArea = 'JetDataWithJsonFile-MagnField-Run2016C_25ns-BTag-80X-PromptReco-v2' - -config.section_("JobType") -config.JobType.pluginName = 'Analysis' -config.JobType.psetName = 'ProcessedTreeProducer_dataPAT25ns_BTag_cfg.py' -config.JobType.allowUndistributedCMSSW = True - - -config.section_("Data") -config.Data.inputDataset = '/JetHT/Run2016C-PromptReco-v2/AOD' -#config.Data.inputDataset = '/JetHT/Run2015D-16Dec2015-v2/AOD' -#config.Data.inputDataset = '/JetHT/Run2015C_25ns-05Oct2015-v2/AOD ' -config.Data.splitting = 'LumiBased' #LumiBased' -config.Data.unitsPerJob = 10 -config.Data.lumiMask = 'Cert_271036-276097_13TeV_PromptReco_Collisions16_JSON_NoL1T.txt' -config.Data.runRange = '271036-276097' # '193093-194075' -config.Data.outputDatasetTag = 'CRAB3_JetData-25ns-Run2016C_v2-BTag-80X-PromptReco-v2' - -config.section_("Site") -config.Site.storageSite = "T2_DE_DESY" -#config.Site.whitelist = ['T2_DE_DESY'] From f7c706c7b6642235032ef33d8aaaf048f9989701 Mon Sep 17 00:00:00 2001 From: pgunnell Date: Thu, 2 Nov 2017 09:40:19 +0100 Subject: [PATCH 21/48] Delete crabDataAODBTag-RunC2016.pyc --- AnalysisFW/test/crabDataAODBTag-RunC2016.pyc | Bin 1279 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 AnalysisFW/test/crabDataAODBTag-RunC2016.pyc diff --git a/AnalysisFW/test/crabDataAODBTag-RunC2016.pyc b/AnalysisFW/test/crabDataAODBTag-RunC2016.pyc deleted file mode 100644 index ebf70d8d2c230b8d7998d8f48693f6f22637dc3d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1279 zcmb7D%~R7r6yLN6w6st@)Uy|dOPV$e1!o+!4T965rIQA$Ty{cs2`lL)?ruQN{8|24 z-n{7Bjj_YQgK6^mzV_w!-utEcqgnrc@i2?fpQ{4@@8FR?K@hktlpr*>(1nF8YM}>& zE-Hvt(3dJA74!gJQZ@Dx!cWS;QV}TZWrSA{SvE1ySIeZ8BB`)z2-gv*nHcD6h&D>S zSstht2OtKoUq^TYks=B779vF+=$nYFmpNOAY?S&oBCS&2F$(msSrpwe_EUtPA+n98 zyF1W6`vupo1)6Gt@KS!o;#`D^rCcq6=Uh@@6cWv)S^>`q&YLIoB&)Fb^7qB{5W-cBK4Z8>3&R)-U4|<(f2e`Wz(2sc0 zKK9ZiVG`ynyFEOdo{jN1J?#c<^-W2=i$}-hK6pI8KiI?N%*|X&X!zFs$Ba!!Q>LiW z=mHlXy@z}HdA$1^Y^6ys8+oaq?MKV^!H?83h{$ll%vI7z69fB(Fq#av>4`}5%&+R~ zH4uV+&8bx5a9*t9E)_R@K|^1Y$w0`GJZAiFLMCaEtrG%~Q>Af*Ns`{3bHbz&>@ruB zc%$ib=4(Kz0fO-?H{65cW(zV)m{N?#21d@Ak`pR`6$W_%I~s-Z#uy^!e#m30T2Ls> z)uIv*!Pf*bHKa;K7*jpFUGSlWkT+mD;gxiNO1vFiJGxCLbFw(+oF<8(OvysWK*xu; zgS)OHMdVCJlc7_Fk7tg8i8+x7FE#UkR_1Gg)q461(yY{&UeAHL34NnyFJFRaS+z>j RYUrnwR-+1573|^%vEPc@KU@F+ From 7a6bf3d109d75f6d24fd3ca44220e24ac65c0336 Mon Sep 17 00:00:00 2001 From: pgunnell Date: Thu, 2 Nov 2017 09:40:23 +0100 Subject: [PATCH 22/48] Delete crabDataAODBTag.py --- AnalysisFW/test/crabDataAODBTag.py | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 AnalysisFW/test/crabDataAODBTag.py diff --git a/AnalysisFW/test/crabDataAODBTag.py b/AnalysisFW/test/crabDataAODBTag.py deleted file mode 100644 index 2801fb6bc95..00000000000 --- a/AnalysisFW/test/crabDataAODBTag.py +++ /dev/null @@ -1,29 +0,0 @@ -from WMCore.Configuration import Configuration -config = Configuration() - -config.section_("User") -config.User.voGroup = 'dcms' - -config.section_("General") -config.General.requestName = 'JetData-June2016-MagnField-Run2016D_25ns-BTag-80X-PromptReco-v2' -config.General.workArea = 'JetDataWithJsonFile-MagnField-Run2016D_25ns-BTag-80X-PromptReco-v2' - -config.section_("JobType") -config.JobType.pluginName = 'Analysis' -config.JobType.psetName = 'ProcessedTreeProducer_dataPAT25ns_BTag_cfg.py' -config.JobType.allowUndistributedCMSSW = True - - -config.section_("Data") -config.Data.inputDataset = '/JetHT/Run2016D-PromptReco-v2/AOD' -#config.Data.inputDataset = '/JetHT/Run2015D-16Dec2015-v2/AOD' -#config.Data.inputDataset = '/JetHT/Run2015C_25ns-05Oct2015-v2/AOD ' -config.Data.splitting = 'LumiBased' #LumiBased' -config.Data.unitsPerJob = 50 -config.Data.lumiMask = 'Cert_271036-277148_13TeV_PromptReco_Collisions16_JSON_NoL1T.txt' -config.Data.runRange = '271036-277148' # '193093-194075' -config.Data.outputDatasetTag = 'CRAB3_JetData-25ns-Run2016D_v2-BTag-80X-PromptReco-v2' - -config.section_("Site") -config.Site.storageSite = "T2_DE_DESY" -#config.Site.whitelist = ['T2_DE_DESY'] From a04949269adc1d3f2639882211643336718384ef Mon Sep 17 00:00:00 2001 From: pgunnell Date: Thu, 2 Nov 2017 09:40:27 +0100 Subject: [PATCH 23/48] Delete crabDataAODBTag.pyc --- AnalysisFW/test/crabDataAODBTag.pyc | Bin 1277 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 AnalysisFW/test/crabDataAODBTag.pyc diff --git a/AnalysisFW/test/crabDataAODBTag.pyc b/AnalysisFW/test/crabDataAODBTag.pyc deleted file mode 100644 index f201326ab0e00976e4dcf89b7a2424f82eedc790..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1277 zcmb7COLNmO5SEkDHfhqP4`7BH7bX|iNlG6F2FQb!$uw!laS8OIQ7zRKbz~#SEj{;V zaN{p>;{q!glj(s2j=kBpzFmFgANA_DXWyqG`ty|F|1Es#CkP6!gJOhc4mx*`!yI&v z(0K{568c<5w1n=#OUu??K=@G+SjYppy@>Dq{96&nM61+iM8 z*NcK`UH~yTeih+0MDrxj8;It4psypkTI6gXx>o3$h&Bp+%PKI#dfs%y+K&-_g6Jli zG`C=U{tKR_1DdXb=qKWmN0}s=CqgfP=S(qa6&lWzUINb%6HJm=y#am5^nhsM4l}_z zt@fTfB9S=cET*oX3F8^y&aO~yFCdY7(E8|}%4C*mpM{Bg(^0*7k15wzLzO^v%>J{D zg*8krg1eOIWoX$IB)(HzDHjYlF=R?H8c4>#pjpTyrU3i28yIldfWzTsw4L7BQO!u| zIh1-Z-}}HTMtKO{>z)jB1+tE_8SfD|fOo*Md+Ec{aA&{W+SzkE`}^&e2e`cxun%}X zKJF)R%oXfewfFFFax%u_#tgwyLeEpcEQv4yS*J;?A-3PfQD~6|JbpeXu>tq zRcH}(@ZcT1lTYL3Q?Rum!F1G5B-?&)`9AoOUIYx+@v+4Vf&2G|nO}{wAb~<=G}7kQvhk7m4HK_DoQ&wB#3= zX0$(=Os2j8q-!9!NHfblD7Uwu(wJ+_MPy-Qf@^ikB(TCFkKv9+L|t1$X2K^TV!8p1 zl1$G#0TFydAlpOfM3RV^-8I37=0b5WJ#wi$ppw`QuRJrRmwIWG3BlsnQl?;`XQAT* z+yWBdl<4rP?I{_0lhNtWE3yu!o`%JFp(GcEfWR)pOT$Tn=+z8}8?)DD^XdhNhEplk SotpUy>D0<#mBG$`5c>^N%0F}f From 1726ee317b5b54d64667674eac67f8131da02c50 Mon Sep 17 00:00:00 2001 From: pgunnell Date: Thu, 2 Nov 2017 09:40:34 +0100 Subject: [PATCH 24/48] Delete crabDataAODBTagRunC.py --- AnalysisFW/test/crabDataAODBTagRunC.py | 28 -------------------------- 1 file changed, 28 deletions(-) delete mode 100644 AnalysisFW/test/crabDataAODBTagRunC.py diff --git a/AnalysisFW/test/crabDataAODBTagRunC.py b/AnalysisFW/test/crabDataAODBTagRunC.py deleted file mode 100644 index 622ef431ed4..00000000000 --- a/AnalysisFW/test/crabDataAODBTagRunC.py +++ /dev/null @@ -1,28 +0,0 @@ -from WMCore.Configuration import Configuration -config = Configuration() - -config.section_("User") -config.User.voGroup = 'dcms' - -config.section_("General") -config.General.requestName = 'JetData-July2015-MagnField-Run2015C_25ns-BTag-76X-16Dec-v3' -config.General.workArea = 'JetDataWithJsonFile-MagnField-Run2015C_25ns-BTag-76X-16Dec-v3' - -config.section_("JobType") -config.JobType.pluginName = 'Analysis' -config.JobType.psetName = 'ProcessedTreeProducer_dataPAT25ns_BTag_RunC_cfg.py' - -config.section_("Data") -#config.Data.inputDataset = '/JetHT/Run2015D-PromptReco-v3/AOD' -#config.Data.inputDataset = '/JetHT/Run2015D-PromptReco-v4/AOD' -config.Data.inputDataset = '/JetHT/Run2015C_25ns-16Dec2015-v1/AOD' -config.Data.splitting = 'LumiBased' #LumiBased' -config.Data.unitsPerJob = 10 -#config.Data.lumiMask = 'Cert_246908-251883_13TeV_PromptReco_Collisions15_JSON_v3.txt' -#config.Data.lumiMask = 'Cert_254833_13TeV_PromptReco_Collisions15_JSON.txt' -config.Data.lumiMask = 'Cert_246908-260627_13TeV_PromptReco_Collisions15_25ns_JSON_v2.txt' -config.Data.runRange = '246908-260627' # '193093-194075' -config.Data.outputDatasetTag = 'CRAB3_JetData-December2015-25ns-Run2015C-BTag-76X-16Dec-v3' - -config.section_("Site") -config.Site.storageSite = "T2_DE_DESY" From 24b5580bad9cb58fcbb26266f029f45785a0a165 Mon Sep 17 00:00:00 2001 From: pgunnell Date: Thu, 2 Nov 2017 09:40:39 +0100 Subject: [PATCH 25/48] Delete crabMC-madgraphSlices.py --- AnalysisFW/test/crabMC-madgraphSlices.py | 33 ------------------------ 1 file changed, 33 deletions(-) delete mode 100644 AnalysisFW/test/crabMC-madgraphSlices.py diff --git a/AnalysisFW/test/crabMC-madgraphSlices.py b/AnalysisFW/test/crabMC-madgraphSlices.py deleted file mode 100644 index a85ad47ff6c..00000000000 --- a/AnalysisFW/test/crabMC-madgraphSlices.py +++ /dev/null @@ -1,33 +0,0 @@ -from WMCore.Configuration import Configuration -config = Configuration() - -config.section_("User") -config.User.voGroup = 'dcms' - -config.section_("General") -config.General.requestName = 'MadgraphP8Ntuples-January2016-Slice100-200-76X' -config.General.workArea = 'MadgraphP8Ntuples-January2016-TuneCUETM1-Slice100-200GeV-76X' - -config.section_("JobType") -config.JobType.pluginName = 'Analysis' -config.JobType.psetName = 'ProcessedTreeProducer_MCPAT25ns_BTag_cfg.py' - -config.section_("Data") -config.Data.inputDataset = '/QCD_HT100to200_TuneCUETP8M1_13TeV-madgraphMLM-pythia8/RunIIFall15DR76-PU25nsData2015v1_76X_mcRun2_asymptotic_v12-v1/AODSIM' -config.Data.splitting = 'EventAwareLumiBased' #LumiBased' -config.Data.unitsPerJob = 12000 -config.Data.outputDatasetTag = 'CRAB3_MadgraphP8NtuplesTuneCUETM1-January2016-Slice100-200GeV-76X' - -config.section_("Site") -config.Site.storageSite = "T2_DE_DESY" - -#/QCD_HT1000to1500_TuneCUETP8M1_13TeV-madgraphMLM-pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v2/AODSIM -#/QCD_HT100to200_TuneCUETP8M1_13TeV-madgraphMLM-pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v2/AODSIM -#/QCD_HT1500to2000_TuneCUETP8M1_13TeV-madgraphMLM-pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/AODSIM -#/QCD_HT2000toInf_TuneCUETP8M1_13TeV-madgraphMLM-pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/AODSIM -#/QCD_HT2000toInf_TuneCUETP8M1_13TeV-madgraphMLM-pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9_ext1-v1/AODSIM -#/QCD_HT200to300_TuneCUETP8M1_13TeV-madgraphMLM-pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v2/AODSIM -#/QCD_HT300to500_TuneCUETP8M1_13TeV-madgraphMLM-pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v2/AODSIM -#/QCD_HT500to700_TuneCUETP8M1_13TeV-madgraphMLM-pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/AODSIM -#/QCD_HT500to700_TuneCUETP8M1_13TeV-madgraphMLM-pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9_ext1-v3/AODSIM -#/QCD_HT700to1000_TuneCUETP8M1_13TeV-madgraphMLM-pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/AODSIM From cdfde3dd453b27a5a561804f93877bcb61a31efc Mon Sep 17 00:00:00 2001 From: pgunnell Date: Thu, 2 Nov 2017 09:40:43 +0100 Subject: [PATCH 26/48] Delete crabMC-pythia8Flat.py --- AnalysisFW/test/crabMC-pythia8Flat.py | 40 --------------------------- 1 file changed, 40 deletions(-) delete mode 100644 AnalysisFW/test/crabMC-pythia8Flat.py diff --git a/AnalysisFW/test/crabMC-pythia8Flat.py b/AnalysisFW/test/crabMC-pythia8Flat.py deleted file mode 100644 index 11b5aaebc40..00000000000 --- a/AnalysisFW/test/crabMC-pythia8Flat.py +++ /dev/null @@ -1,40 +0,0 @@ -from WMCore.Configuration import Configuration -config = Configuration() - -config.section_("User") -config.User.voGroup = 'dcms' - -config.section_("General") -config.General.requestName = 'Herwig-25ns-Ntuples-July2016-Flat-v2' -config.General.workArea = 'Herwig-25ns-Ntuples-July2016-TuneCUETM1-Flat-v2' - -config.section_("JobType") -config.JobType.pluginName = 'Analysis' -config.JobType.psetName = 'ProcessedTreeProducer_MCPAT25ns_BTag_cfg.py' - -config.section_("Data") -#config.Data.inputDataset = '/QCD_Pt-15to7000_TuneCUETP8M1_Flat_13TeV_pythia8/RunIISpring16DR80-PUSpring16_magnetOn_80X_mcRun2_asymptotic_2016_v3-v1/AODSIM' -config.Data.inputDataset = '/QCD_Pt-15to7000_TuneCUETHS1_Flat_13TeV_herwigpp/RunIISpring16DR80-PUSpring16_80X_mcRun2_asymptotic_2016_v3-v1/AODSIM' -config.Data.splitting = 'EventAwareLumiBased' #LumiBased' -config.Data.unitsPerJob = 12000 -config.Data.outputDatasetTag = 'CRAB3_Herwig-25ns-NtuplesTuneCUETS1-July2016-Flat-v2' - -config.section_("Site") -config.Site.storageSite = "T2_DE_DESY" - -#/QCD_Pt_15to30_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v2/AODSIM -#/QCD_Pt_30to50_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v2/AODSIM -#/QCD_Pt_50to80_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v2/AODSIM - -#/QCD_Pt_80to120_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/AODSIM -#/QCD_Pt_120to170_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/AODSIM -#/QCD_Pt_170to300_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v2/AODSIM -#/QCD_Pt_300to470_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/AODSIM -#/QCD_Pt_470to600_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v2/AODSIM -#/QCD_Pt_600to800_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v3/AODSIM -#/QCD_Pt_800to1000_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v2/AODSIM -#/QCD_Pt_1000to1400_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/AODSIM -#/QCD_Pt_1400to1800_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/AODSIM -#/QCD_Pt_1800to2400_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/AODSIM -#/QCD_Pt_2400to3200_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/AODSIM -#/QCD_Pt_3200toInf_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/AODSIM From 381706551f2aabf85e0ca545d7bf864d820a5cde Mon Sep 17 00:00:00 2001 From: pgunnell Date: Thu, 2 Nov 2017 09:40:49 +0100 Subject: [PATCH 27/48] Delete crabMC-pythia8Flat.pyc --- AnalysisFW/test/crabMC-pythia8Flat.pyc | Bin 1134 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 AnalysisFW/test/crabMC-pythia8Flat.pyc diff --git a/AnalysisFW/test/crabMC-pythia8Flat.pyc b/AnalysisFW/test/crabMC-pythia8Flat.pyc deleted file mode 100644 index 2e3a027f6d52dc1bf97cb0b705c09d188a6da851..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1134 zcmah|%Wl&^6dfm}ZPJ83-~(8&h=d%+DJ@wbMC$Y@QiAPL=w>vvr;fp~&CGSGh-Lqg zHQTQF0Jt-*sSrq5_Vs<7@qHcFf3%yoUvJL?a(C76{Td(n4Mm8zK@vh{2DvbZ!3}al z$VH9t8u?TwVU66NH>_)WiO>gCV5tn0_A;R>BwW@p)K@FeN(n0M2BA$7HgpX2wF=ZM zL8aXyv`xa6j-mdLgzZXSC*i|N->43+mxoJxlh7>^ZW6Dvg{{Ru@#+|;K^ujWrB`uO z2nKPM!V-GUBo|rIs2_209Yc~T^ce$U=D4-y9E zyf3Z)0sSK7&e^^{wyQHb(MfjcFLDm6cz&3&WFccIpP?}kS-_>_p)WW`BP;?g=-8PI zeN_qF^I1fLtEihVbm=1oOcr?1dgqMj1WbDevKPHxk5-wFJe#U=slDy<_jIb;%5%#t z(&J+<7jYWdyCZkdGbd-2Ne8_TbQU0_PnlfIa>yVKsA`?gx6Qe24d0Hu<1swK%=>em z!tk02{-&74dkl+@zju*e&oSt@!@X_#k6BjbdG=pZ)s1;EaA@Ke{5~D+}4w)x00FG8?DAE|@gbUm{Y+y7i z;2w_)brlUXQbHzJ#8vYh^pSfZ@gF4?yOI_XBJBoKOVw%RRvr~;%9BJbv|n+_a>kx_ zP6xDyYo|GbU}{@Z1eQ0RoLCj=;M@Z2+zJG{96KgbY8tbFB8#GzD(dA78JO@_YI^bs SiVdStYa1=~+{+s3clIxcX(6Qm From fc3a1148ce5e7aa7402d55c69f3ea4a59de000a4 Mon Sep 17 00:00:00 2001 From: pgunnell Date: Thu, 2 Nov 2017 09:40:52 +0100 Subject: [PATCH 28/48] Delete crabMC-pythia8Slices.py --- AnalysisFW/test/crabMC-pythia8Slices.py | 39 ------------------------- 1 file changed, 39 deletions(-) delete mode 100644 AnalysisFW/test/crabMC-pythia8Slices.py diff --git a/AnalysisFW/test/crabMC-pythia8Slices.py b/AnalysisFW/test/crabMC-pythia8Slices.py deleted file mode 100644 index 57b863813bc..00000000000 --- a/AnalysisFW/test/crabMC-pythia8Slices.py +++ /dev/null @@ -1,39 +0,0 @@ -from WMCore.Configuration import Configuration -config = Configuration() - -config.section_("User") -config.User.voGroup = 'dcms' - -config.section_("General") -config.General.requestName = 'Pythia8-25ns-Ntuples-January2016-Slice30-50GeV-v2' -config.General.workArea = 'Pythia8-25ns-Ntuples-January2016-TuneCUETM1-Slice30-50GeV-v2' - -config.section_("JobType") -config.JobType.pluginName = 'Analysis' -config.JobType.psetName = 'ProcessedTreeProducer_MCPAT25ns_BTag_cfg.py' - -config.section_("Data") -config.Data.inputDataset = '/QCD_Pt_30to50_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v2/AODSIM' -config.Data.splitting = 'EventAwareLumiBased' #LumiBased' -config.Data.unitsPerJob = 12000 -config.Data.outputDatasetTag = 'CRAB3_Pythia8-25ns-NtuplesTuneCUETM1-January2016-Slice30-50GeV-v2' - -config.section_("Site") -config.Site.storageSite = "T2_DE_DESY" - -#/QCD_Pt_15to30_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v2/AODSIM -#/QCD_Pt_30to50_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v2/AODSIM -#/QCD_Pt_50to80_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v2/AODSIM - -#/QCD_Pt_80to120_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/AODSIM -#/QCD_Pt_120to170_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/AODSIM -#/QCD_Pt_170to300_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v2/AODSIM -#/QCD_Pt_300to470_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/AODSIM -#/QCD_Pt_470to600_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v2/AODSIM -#/QCD_Pt_600to800_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v3/AODSIM -#/QCD_Pt_800to1000_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v2/AODSIM -#/QCD_Pt_1000to1400_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/AODSIM -#/QCD_Pt_1400to1800_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/AODSIM -#/QCD_Pt_1800to2400_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/AODSIM -#/QCD_Pt_2400to3200_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/AODSIM -#/QCD_Pt_3200toInf_TuneCUETP8M1_13TeV_pythia8/RunIISpring15DR74-Asympt25ns_MCRUN2_74_V9-v1/AODSIM From 3215bb6f1ad269429585d51f86594f0d5c293ad3 Mon Sep 17 00:00:00 2001 From: pgunnell Date: Thu, 2 Nov 2017 09:41:01 +0100 Subject: [PATCH 29/48] Delete jetToolbox_cff.py --- AnalysisFW/test/jetToolbox_cff.py | 836 ------------------------------ 1 file changed, 836 deletions(-) delete mode 100644 AnalysisFW/test/jetToolbox_cff.py diff --git a/AnalysisFW/test/jetToolbox_cff.py b/AnalysisFW/test/jetToolbox_cff.py deleted file mode 100644 index 7493a1abb3b..00000000000 --- a/AnalysisFW/test/jetToolbox_cff.py +++ /dev/null @@ -1,836 +0,0 @@ -############################################### -#### -#### Jet Substructure Toolbox (jetToolBox) -#### Python function for easy access of -#### jet substructure tools implemented in CMS -#### -#### Alejandro Gomez Espinosa (gomez@physics.rutgers.edu) -#### -############################################### -import FWCore.ParameterSet.Config as cms - -from RecoJets.Configuration.RecoPFJets_cff import ak4PFJets, ak8PFJetsCHSSoftDrop, ak8PFJetsCHSSoftDropMass, ak8PFJetsCHSPruned, ak8PFJetsCHSPrunedMass, ak8PFJetsCHSTrimmed, ak8PFJetsCHSTrimmedMass, ak8PFJetsCHSFiltered, ak8PFJetsCHSFilteredMass, ak4PFJetsCHS, ca15PFJetsCHSMassDropFiltered, hepTopTagPFJetsCHS, ak8PFJetsCHSConstituents, puppi -from RecoJets.Configuration.RecoGenJets_cff import ak4GenJets -from RecoJets.JetProducers.SubJetParameters_cfi import SubJetParameters -from RecoJets.JetProducers.PFJetParameters_cfi import * -from RecoJets.JetProducers.GenJetParameters_cfi import * -from RecoJets.JetProducers.AnomalousCellParameters_cfi import * -from RecoJets.JetProducers.CATopJetParameters_cfi import * -from PhysicsTools.PatAlgos.producersLayer1.patCandidates_cff import * -from PhysicsTools.PatAlgos.selectionLayer1.jetSelector_cfi import selectedPatJets -from PhysicsTools.PatAlgos.tools.jetTools import addJetCollection - - -def jetToolbox( proc, jetType, jetSequence, outputFile, - newPFCollection=False, nameNewPFCollection = '', - PUMethod='CHS', - miniAOD=True, - runOnMC=True, - JETCorrPayload='', JETCorrLevels = [ 'None' ], GetJetMCFlavour=True, - Cut = '', - bTagDiscriminators = None, - bTagInfos = None, - subJETCorrPayload='', subJETCorrLevels = [ 'None' ], GetSubjetMCFlavour=True, - CutSubjet = '', - addPruning=False, zCut=0.1, rCut=0.5, addPrunedSubjets=False, - addSoftDrop=False, betaCut=0.0, zCutSD=0.1, addSoftDropSubjets=False, - addTrimming=False, rFiltTrim=0.2, ptFrac=0.03, - addFiltering=False, rfilt=0.3, nfilt=3, - addCMSTopTagger=False, - addMassDrop=False, - addHEPTopTagger=False, - addNsub=False, maxTau=4, - addNsubSubjets=False, subjetMaxTau=4, - addPUJetID=False, - addQJets=False, - addQGTagger=False, QGjetsLabel='chs', - addEnergyCorrFunc=False, ecfBeta = 1.0, maxECF=3, - ): - - runOnData = not runOnMC - if runOnData: - GetJetMCFlavour = False - GetSubjetMCFlavour = False - - ############################################################################### - ####### Verifying some inputs and defining variables - ############################################################################### - print '|---- jetToolbox: Initialyzing collection...' - if newPFCollection: print '|---- jetToolBox: Using '+ nameNewPFCollection +' as PFCandidates collection' - supportedJetAlgos = { 'ak': 'AntiKt', 'ca' : 'CambridgeAachen', 'kt' : 'Kt' } - recommendedJetAlgos = [ 'ak4', 'ak8', 'ca4', 'ca8', 'ca10' ] - payloadList = [ 'None', - 'AK1PFchs', 'AK2PFchs', 'AK3PFchs', 'AK4PFchs', 'AK5PFchs', 'AK6PFchs', 'AK7PFchs', 'AK8PFchs', 'AK9PFchs', 'AK10PFchs', - 'AK1PFPUPPI', 'AK2PFPUPPI', 'AK3PFPUPPI', 'AK4PFPUPPI', 'AK5PFPUPPI', 'AK6PFPUPPI', 'AK7PFPUPPI', 'AK8PFPUPPI', 'AK9PFPUPPI', 'AK10PFPUPPI', - 'AK1PFSK', 'AK2PFSK', 'AK3PFSK', 'AK4PFSK', 'AK5PFSK', 'AK6PFSK', 'AK7PFSK', 'AK8PFSK', 'AK9PFSK', 'AK10PFSK', - 'AK1PF', 'AK2PF', 'AK3PF', 'AK4PF', 'AK5PF', 'AK6PF', 'AK7PF', 'AK8PF', 'AK9PF', 'AK10PF' ] - JECLevels = [ 'L1Offset', 'L1FastJet', 'L1JPTOffset', 'L2Relative', 'L3Absolute', 'L5Falvour', 'L7Parton' ] - if runOnData: - JECLevels += ['L2L3Residual'] - jetAlgo = '' - algorithm = '' - size = '' - for type, tmpAlgo in supportedJetAlgos.iteritems(): - if type in jetType.lower(): - jetAlgo = type - algorithm = tmpAlgo - size = jetType.replace( type, '' ) - - jetSize = 0. - if int(size) in range(0, 20): jetSize = int(size)/10. - else: print '|---- jetToolBox: jetSize has not a valid value. Insert a number between 1 and 20 after algorithm, like: AK8' - ### Trick for uppercase/lowercase algo name - jetALGO = jetAlgo.upper()+size - jetalgo = jetAlgo.lower()+size - if jetalgo not in recommendedJetAlgos: print '|---- jetToolBox: CMS recommends the following jet algoritms: '+' '.join(recommendedJetAlgos)+'. You are using', jetalgo,'.' - - - ################################################################################# - ####### Toolbox start - ################################################################################# - - elemToKeep = [] - jetSeq = cms.Sequence() - genParticlesLabel = '' - pvLabel = '' - tvLabel = '' - toolsUsed = [] - - #### For MiniAOD - if miniAOD: - - print '|---- jetToolBox: JETTOOLBOX RUNNING ON MiniAOD FOR '+jetALGO+' JETS USING '+PUMethod - - genParticlesLabel = 'prunedGenParticles' - pvLabel = 'offlineSlimmedPrimaryVertices' - svLabel = 'slimmedSecondaryVertices' - tvLabel = 'unpackedTracksAndVertices' - muLabel = 'slimmedMuons' - elLabel = 'slimmedElectrons' - pfCand = nameNewPFCollection if newPFCollection else 'packedPFCandidates' - - if runOnMC: - ## Filter out neutrinos from packed GenParticles - setattr( proc, 'packedGenParticlesForJetsNoNu', - cms.EDFilter("CandPtrSelector", - src = cms.InputTag("packedGenParticles"), - cut = cms.string("abs(pdgId) != 12 && abs(pdgId) != 14 && abs(pdgId) != 16") - )) - jetSeq += getattr(proc, 'packedGenParticlesForJetsNoNu' ) - - setattr( proc, jetalgo+'GenJetsNoNu', - ak4GenJets.clone( src = 'packedGenParticlesForJetsNoNu', - rParam = jetSize, - jetAlgorithm = algorithm ) ) - jetSeq += getattr(proc, jetalgo+'GenJetsNoNu' ) - - #for Inclusive Vertex Finder - proc.load('PhysicsTools.PatAlgos.slimming.unpackedTracksAndVertices_cfi') - - #### For AOD - else: - print '|---- jetToolBox: JETTOOLBOX RUNNING ON AOD FOR '+jetALGO+' JETS USING '+PUMethod - - genParticlesLabel = 'genParticles' - pvLabel = 'offlinePrimaryVertices' - tvLabel = 'generalTracks' - muLabel = 'muons' - elLabel = 'gedGsfElectrons' - pfCand = nameNewPFCollection if newPFCollection else 'particleFlow' - svLabel = 'inclusiveCandidateSecondaryVertices' - - if runOnMC: - proc.load('RecoJets.Configuration.GenJetParticles_cff') - setattr( proc, jetalgo+'GenJetsNoNu', ak4GenJets.clone( src = 'genParticlesForJetsNoNu', rParam = jetSize, jetAlgorithm = algorithm ) ) - jetSeq += getattr(proc, jetalgo+'GenJetsNoNu' ) - - - - ## b-tag discriminators - if bTagDiscriminators is None: - bTagDiscriminators = [ - 'pfTrackCountingHighEffBJetTags', - 'pfTrackCountingHighPurBJetTags', - 'pfJetProbabilityBJetTags', - 'pfJetBProbabilityBJetTags', - 'pfSimpleSecondaryVertexHighEffBJetTags', - 'pfSimpleSecondaryVertexHighPurBJetTags', - 'pfCombinedSecondaryVertexV2BJetTags', - 'pfCombinedInclusiveSecondaryVertexV2BJetTags', - 'pfCombinedMVAV2BJetTags' - ] - - ### Jet Corrections - if not set(JETCorrLevels).issubset(set(JECLevels)): - if ( 'CHS' in PUMethod ) or ( 'Plain' in PUMethod ): JETCorrLevels = ['L1FastJet','L2Relative', 'L3Absolute'] - else: JETCorrLevels = [ 'L2Relative', 'L3Absolute'] - if runOnData: JETCorrLevels.append('L2L3Residual') - if not set(subJETCorrLevels).issubset(set(JECLevels)): - if ( 'CHS' in PUMethod ) or ( 'Plain' in PUMethod ): subJETCorrLevels = ['L1FastJet','L2Relative', 'L3Absolute'] - else: subJETCorrLevels = [ 'L2Relative', 'L3Absolute'] - if runOnData: subJETCorrLevels.append('L2L3Residual') - - #### Creating PATjets - tmpPfCandName = pfCand.lower() - if 'Puppi' in PUMethod: - if ('puppi' in tmpPfCandName): - srcForPFJets = pfCand - print '|---- jetToolBox: Not running puppi algorithm because keyword puppi was specified in nameNewPFCollection, but applying puppi corrections.' - else: - proc.load('CommonTools.PileupAlgos.Puppi_cff') - puppi.candName = cms.InputTag( pfCand ) - if miniAOD: puppi.vertexName = cms.InputTag('offlineSlimmedPrimaryVertices') - jetSeq += getattr(proc, 'puppi' ) - srcForPFJets = 'puppi' - - from RecoJets.JetProducers.ak4PFJetsPuppi_cfi import ak4PFJetsPuppi - setattr( proc, jetalgo+'PFJetsPuppi', - ak4PFJetsPuppi.clone( src = cms.InputTag( srcForPFJets ), - doAreaFastjet = True, - rParam = jetSize, - jetAlgorithm = algorithm ) ) - jetSeq += getattr(proc, jetalgo+'PFJetsPuppi' ) - - if JETCorrPayload not in payloadList: JETCorrPayload = 'AK'+size+'PFPuppi' - if subJETCorrPayload not in payloadList: subJETCorrPayload = 'AK4PFPuppi' - - elif 'SK' in PUMethod: - - if ('sk' in tmpPfCandName): - srcForPFJets = pfCand - print '|---- jetToolBox: Not running softkiller algorithm because keyword SK was specified in nameNewPFCollection, but applying SK corrections.' - else: - proc.load('CommonTools.PileupAlgos.softKiller_cfi') - getattr( proc, 'softKiller' ).PFCandidates = cms.InputTag( pfCand ) - jetSeq += getattr(proc, 'softKiller' ) - srcForPFJets = 'softKiller' - - from RecoJets.JetProducers.ak4PFJetsSK_cfi import ak4PFJetsSK - setattr( proc, jetalgo+'PFJetsSK', - ak4PFJetsSK.clone( src = cms.InputTag( srcForPFJets ), - rParam = jetSize, - jetAlgorithm = algorithm ) ) - jetSeq += getattr(proc, jetalgo+'PFJetsSK' ) - - if JETCorrPayload not in payloadList: JETCorrPayload = 'AK'+size+'PFSK' - if subJETCorrPayload not in payloadList: subJETCorrPayload = 'AK4PFSK' - - elif 'CS' in PUMethod: - - from RecoJets.JetProducers.ak4PFJetsCHSCS_cfi import ak4PFJetsCHSCS - setattr( proc, jetalgo+'PFJetsCS', - ak4PFJetsCHSCS.clone( doAreaFastjet = True, - src = cms.InputTag( pfCand ), #srcForPFJets ), - csRParam = cms.double(jetSize), - jetAlgorithm = algorithm ) ) - if miniAOD: getattr( proc, jetalgo+'PFJetsCS').src = pfCand - jetSeq += getattr(proc, jetalgo+'PFJetsCS' ) - - if JETCorrPayload not in payloadList: JETCorrPayload = 'AK'+size+'PFCS' - if subJETCorrPayload not in payloadList: subJETCorrPayload = 'AK4PFCS' - - elif 'CHS' in PUMethod: - - if miniAOD: - if ('chs' in tmpPfCandName): - srcForPFJets = pfCand - print '|---- jetToolBox: Not running CHS algorithm because keyword CHS was specified in nameNewPFCollection, but applying CHS corrections.' - else: - setattr( proc, 'chs', cms.EDFilter('CandPtrSelector', src = cms.InputTag( pfCand ), cut = cms.string('fromPV')) ) - jetSeq += getattr(proc, 'chs') - srcForPFJets = 'chs' - else: - if ( pfCand == 'particleFlow' ): - from RecoParticleFlow.PFProducer.particleFlowTmpPtrs_cfi import particleFlowTmpPtrs - setattr( proc, 'newParticleFlowTmpPtrs', particleFlowTmpPtrs.clone( src = pfCand ) ) - jetSeq += getattr(proc, 'newParticleFlowTmpPtrs') - from CommonTools.ParticleFlow.pfNoPileUpJME_cff import pfPileUpJME, pfNoPileUpJME - proc.load('CommonTools.ParticleFlow.goodOfflinePrimaryVertices_cfi') - setattr( proc, 'newPfPileUpJME', pfPileUpJME.clone( PFCandidates= 'newParticleFlowTmpPtrs' ) ) - jetSeq += getattr(proc, 'newPfPileUpJME') - setattr( proc, 'newPfNoPileUpJME', pfNoPileUpJME.clone( topCollection='newPfPileUpJME', bottomCollection= 'newParticleFlowTmpPtrs' ) ) - jetSeq += getattr(proc, 'newPfNoPileUpJME') - srcForPFJets = 'newPfNoPileUpJME' - else: - proc.load('CommonTools.ParticleFlow.pfNoPileUpJME_cff') - srcForPFJets = 'pfNoPileUpJME' - - setattr( proc, jetalgo+'PFJetsCHS', - ak4PFJetsCHS.clone( src = cms.InputTag( srcForPFJets ), - doAreaFastjet = True, - rParam = jetSize, - jetAlgorithm = algorithm ) ) - jetSeq += getattr(proc, jetalgo+'PFJetsCHS' ) - - if JETCorrPayload not in payloadList: JETCorrPayload = 'AK'+size+'PFchs' - if subJETCorrPayload not in payloadList: subJETCorrPayload = 'AK4PFchs' - - else: - PUMethod = '' - setattr( proc, jetalgo+'PFJets', - ak4PFJets.clone( - doAreaFastjet = True, - rParam = jetSize, - jetAlgorithm = algorithm ) ) - if miniAOD: getattr( proc, jetalgo+'PFJets').src = pfCand - jetSeq += getattr(proc, jetalgo+'PFJets' ) - if JETCorrPayload not in payloadList: JETCorrPayload = 'AK'+size+'PF' - if subJETCorrPayload not in payloadList: subJETCorrPayload = 'AK4PF' - - if 'None' in JETCorrPayload: JEC = None - else: JEC = ( JETCorrPayload.replace('CS','chs').replace('SK','chs') , JETCorrLevels, 'None' ) ### temporary - #else: JEC = ( JETCorrPayload., JETCorrLevels, 'None' ) - print '|---- jetToolBox: Applying this corrections: '+str(JEC) - - if addPrunedSubjets or addSoftDropSubjets or addCMSTopTagger: - if 'None' in subJETCorrPayload: subJEC = None - else: subJEC = ( subJETCorrPayload.replace('CS','chs').replace('SK','chs') , subJETCorrLevels, 'None' ) ### temporary - - - if ( PUMethod in [ 'CHS', 'CS', 'Puppi' ] ) and miniAOD: setattr( proc, jetalgo+'PFJets'+PUMethod+'Constituents', cms.EDFilter("MiniAODJetConstituentSelector", src = cms.InputTag( jetalgo+'PFJets'+PUMethod ), cut = cms.string( Cut ) )) - else: setattr( proc, jetalgo+'PFJets'+PUMethod+'Constituents', cms.EDFilter("PFJetConstituentSelector", src = cms.InputTag( jetalgo+'PFJets'+PUMethod ), cut = cms.string( Cut ) )) - jetSeq += getattr(proc, jetalgo+'PFJets'+PUMethod+'Constituents' ) - - addJetCollection( - proc, - labelName = jetALGO+'PF'+PUMethod, - jetSource = cms.InputTag( jetalgo+'PFJets'+PUMethod), - algo = jetalgo, - rParam = jetSize, - jetCorrections = JEC if JEC is not None else None, - pfCandidates = cms.InputTag( pfCand ), - svSource = cms.InputTag( svLabel ), - genJetCollection = cms.InputTag( jetalgo+'GenJetsNoNu'), - pvSource = cms.InputTag( pvLabel ), - muSource = cms.InputTag( muLabel ), - elSource = cms.InputTag( elLabel ), - btagDiscriminators = bTagDiscriminators, - btagInfos = bTagInfos, - getJetMCFlavour = GetJetMCFlavour, - genParticles = cms.InputTag(genParticlesLabel), - outputModules = ['outputFile'] - ) - getattr(proc,'patJets'+jetALGO+'PF'+PUMethod).addTagInfos = cms.bool(True) - - if 'CS' in PUMethod: getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod ).getJetMCFlavour = False # CS jets cannot be re-clustered from their constituents - - #### Groomers - if addSoftDrop or addSoftDropSubjets: - - setattr( proc, jetalgo+'PFJets'+PUMethod+'SoftDrop', - ak8PFJetsCHSSoftDrop.clone( - src = cms.InputTag( jetalgo+'PFJets'+PUMethod+'Constituents', 'constituents' ), - rParam = jetSize, - jetAlgorithm = algorithm, - useExplicitGhosts=True, - R0= cms.double(jetSize), - #zcut=zCutSD, - beta=betaCut, - writeCompound = cms.bool(True), - jetCollInstanceName=cms.string('SubJets') ) ) - setattr( proc, jetalgo+'PFJets'+PUMethod+'SoftDropMass', - ak8PFJetsCHSSoftDropMass.clone( src = cms.InputTag( jetalgo+'PFJets'+PUMethod), - matched = cms.InputTag( jetalgo+'PFJets'+PUMethod+'SoftDrop'), - distMax = cms.double( jetSize ) ) ) - - elemToKeep += [ 'keep *_'+jetalgo+'PFJets'+PUMethod+'SoftDropMass_*_*'] - jetSeq += getattr(proc, jetalgo+'PFJets'+PUMethod+'SoftDrop' ) - jetSeq += getattr(proc, jetalgo+'PFJets'+PUMethod+'SoftDropMass' ) - getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod).userData.userFloats.src += [ jetalgo+'PFJets'+PUMethod+'SoftDropMass'] - toolsUsed.append( jetalgo+'PFJets'+PUMethod+'SoftDropMass' ) - - if addSoftDropSubjets: - - if runOnMC: - setattr( proc, jetalgo+'GenJetsNoNuSoftDrop', - ak4GenJets.clone( - SubJetParameters, - useSoftDrop = cms.bool(True), - rParam = jetSize, - jetAlgorithm = algorithm, - useExplicitGhosts=cms.bool(True), - #zcut=cms.double(zCutSD), - R0= cms.double(jetSize), - beta=cms.double(betaCut), - writeCompound = cms.bool(True), - jetCollInstanceName=cms.string('SubJets') - )) - if miniAOD: getattr( proc, jetalgo+'GenJetsNoNuSoftDrop' ).src = 'packedGenParticlesForJetsNoNu' - jetSeq += getattr(proc, jetalgo+'GenJetsNoNuSoftDrop' ) - - addJetCollection( - proc, - labelName = jetALGO+'PF'+PUMethod+'SoftDrop', - jetSource = cms.InputTag( jetalgo+'PFJets'+PUMethod+'SoftDrop'), - algo = jetalgo, - rParam = jetSize, - jetCorrections = JEC if JEC is not None else None, - pvSource = cms.InputTag( pvLabel ), - btagDiscriminators = ['None'], - genJetCollection = cms.InputTag( jetalgo+'GenJetsNoNu'), - getJetMCFlavour = False, # jet flavor should always be disabled for groomed jets - genParticles = cms.InputTag(genParticlesLabel), - outputModules = ['outputFile'] - ) - - setattr( proc, 'selectedPatJets'+jetALGO+'PF'+PUMethod+'SoftDrop', selectedPatJets.clone( src = 'patJets'+jetALGO+'PF'+PUMethod+'SoftDrop', cut = Cut ) ) - - addJetCollection( - proc, - labelName = jetALGO+'PF'+PUMethod+'SoftDropSubjets', - jetSource = cms.InputTag( jetalgo+'PFJets'+PUMethod+'SoftDrop', 'SubJets'), - algo = jetalgo, # needed for subjet b tagging - rParam = jetSize, # needed for subjet b tagging - jetCorrections = subJEC if subJEC is not None else None, - pfCandidates = cms.InputTag( pfCand ), - pvSource = cms.InputTag( pvLabel), - svSource = cms.InputTag( svLabel ), - muSource = cms.InputTag( muLabel ), - elSource = cms.InputTag( elLabel ), - btagDiscriminators = bTagDiscriminators, - btagInfos = bTagInfos, - genJetCollection = cms.InputTag( jetalgo+'GenJetsNoNuSoftDrop','SubJets'), - getJetMCFlavour = GetSubjetMCFlavour, - genParticles = cms.InputTag(genParticlesLabel), - explicitJTA = True, # needed for subjet b tagging - svClustering = True, # needed for subjet b tagging - fatJets=cms.InputTag(jetalgo+'PFJets'+PUMethod), # needed for subjet flavor clustering - groomedFatJets=cms.InputTag(jetalgo+'PFJets'+PUMethod+'SoftDrop'), # needed for subjet flavor clustering - outputModules = ['outputFile'] - ) - - setattr( proc, 'selectedPatJets'+jetALGO+'PF'+PUMethod+'SoftDropSubjets', selectedPatJets.clone( src = 'patJets'+jetALGO+'PF'+PUMethod+'SoftDropSubjets', cut = CutSubjet )) - getattr( proc, 'selectedPatJets'+jetALGO+'PF'+PUMethod+'SoftDropSubjets').addTagInfos = cms.bool(True) - - ## Establish references between PATified fat jets and subjets using the BoostedJetMerger - setattr( proc, 'selectedPatJets'+jetALGO+'PF'+PUMethod+'SoftDropPacked', - cms.EDProducer("BoostedJetMerger", - jetSrc=cms.InputTag('selectedPatJets'+jetALGO+'PF'+PUMethod+'SoftDrop'), - subjetSrc=cms.InputTag('selectedPatJets'+jetALGO+'PF'+PUMethod+'SoftDropSubjets') - )) - jetSeq += getattr(proc, 'selectedPatJets'+jetALGO+'PF'+PUMethod+'SoftDropPacked' ) - elemToKeep += [ 'keep *_selectedPatJets'+jetALGO+'PF'+PUMethod+'SoftDropPacked_*_*' ] - toolsUsed.append( 'selectedPatJets'+jetALGO+'PF'+PUMethod+'SoftDropPacked' ) - toolsUsed.append( 'selectedPatJets'+jetALGO+'PF'+PUMethod+'SoftDropSubjets' ) - - if addPruning or addPrunedSubjets: - - setattr( proc, jetalgo+'PFJets'+PUMethod+'Pruned', - ak8PFJetsCHSPruned.clone( - src = cms.InputTag( jetalgo+'PFJets'+PUMethod+'Constituents', 'constituents' ), - rParam = jetSize, - jetAlgorithm = algorithm, - zcut=zCut, - rcut_factor=rCut, - writeCompound = cms.bool(True), - doAreaFastjet = cms.bool(True), - jetCollInstanceName=cms.string('SubJets') ) ) - setattr( proc, jetalgo+'PFJets'+PUMethod+'PrunedMass', - ak8PFJetsCHSPrunedMass.clone( src = cms.InputTag( jetalgo+'PFJets'+PUMethod), - matched = cms.InputTag( jetalgo+'PFJets'+PUMethod+'Pruned'), - distMax = cms.double( jetSize ) ) ) - - jetSeq += getattr(proc, jetalgo+'PFJets'+PUMethod+'Pruned' ) - jetSeq += getattr(proc, jetalgo+'PFJets'+PUMethod+'PrunedMass' ) - getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod).userData.userFloats.src += [ jetalgo+'PFJets'+PUMethod+'PrunedMass'] - elemToKeep += [ 'keep *_'+jetalgo+'PFJets'+PUMethod+'PrunedMass_*_*'] - toolsUsed.append( jetalgo+'PFJets'+PUMethod+'PrunedMass' ) - - if addPrunedSubjets: - if runOnMC: - setattr( proc, jetalgo+'GenJetsNoNuPruned', - ak4GenJets.clone( - SubJetParameters, - rParam = jetSize, - usePruning = cms.bool(True), - writeCompound = cms.bool(True), - jetCollInstanceName=cms.string('SubJets') - )) - if miniAOD: getattr( proc, jetalgo+'GenJetsNoNuPruned' ).src = 'packedGenParticlesForJetsNoNu' - jetSeq += getattr(proc, jetalgo+'GenJetsNoNuPruned' ) - - addJetCollection( - proc, - labelName = jetALGO+'PF'+PUMethod+'Pruned', - jetSource = cms.InputTag( jetalgo+'PFJets'+PUMethod+'Pruned'), - algo = jetalgo, - rParam = jetSize, - jetCorrections = JEC if JEC is not None else None, - pvSource = cms.InputTag( pvLabel ), - btagDiscriminators = ['None'], - genJetCollection = cms.InputTag( jetalgo+'GenJetsNoNu'), - getJetMCFlavour = False, # jet flavor should always be disabled for groomed jets - genParticles = cms.InputTag(genParticlesLabel), - outputModules = ['outputFile'] - ) - - setattr( proc, 'selectedPatJets'+jetALGO+'PF'+PUMethod+'Pruned', selectedPatJets.clone( src = 'patJets'+jetALGO+'PF'+PUMethod+'Pruned', cut = Cut ) ) - - addJetCollection( - proc, - labelName = jetALGO+'PF'+PUMethod+'PrunedSubjets', - jetSource = cms.InputTag( jetalgo+'PFJets'+PUMethod+'Pruned', 'SubJets'), - algo = jetalgo, # needed for subjet b tagging - rParam = jetSize, # needed for subjet b tagging - jetCorrections = subJEC if subJEC is not None else None, - pfCandidates = cms.InputTag( pfCand ), - pvSource = cms.InputTag( pvLabel), - svSource = cms.InputTag( svLabel ), - muSource = cms.InputTag( muLabel ), - elSource = cms.InputTag( elLabel ), - getJetMCFlavour = GetSubjetMCFlavour, - genParticles = cms.InputTag(genParticlesLabel), - btagDiscriminators = bTagDiscriminators, - btagInfos = bTagInfos, - genJetCollection = cms.InputTag( jetalgo+'GenJetsNoNuPruned','SubJets'), - explicitJTA = True, # needed for subjet b tagging - svClustering = True, # needed for subjet b tagging - fatJets=cms.InputTag(jetalgo+'PFJets'+PUMethod), # needed for subjet flavor clustering - groomedFatJets=cms.InputTag(jetalgo+'PFJets'+PUMethod+'Pruned'), # needed for subjet flavor clustering - outputModules = ['outputFile'] - ) - - setattr( proc, 'selectedPatJets'+jetALGO+'PF'+PUMethod+'PrunedSubjets', selectedPatJets.clone( src = 'patJets'+jetALGO+'PF'+PUMethod+'PrunedSubjets', cut = CutSubjet ) ) - getattr( proc, 'selectedPatJets'+jetALGO+'PF'+PUMethod+'PrunedSubjets').addTagInfos = cms.bool(True) - - ## Establish references between PATified fat jets and subjets using the BoostedJetMerger - setattr( proc, 'selectedPatJets'+jetALGO+'PF'+PUMethod+'PrunedPacked', - cms.EDProducer("BoostedJetMerger", - jetSrc=cms.InputTag('selectedPatJets'+jetALGO+'PF'+PUMethod+'Pruned'), - subjetSrc=cms.InputTag('selectedPatJets'+jetALGO+'PF'+PUMethod+'PrunedSubjets') - )) - jetSeq += getattr(proc, 'selectedPatJets'+jetALGO+'PF'+PUMethod+'PrunedPacked' ) - elemToKeep += [ 'keep *_selectedPatJets'+jetALGO+'PF'+PUMethod+'PrunedPacked_*_*' ] - toolsUsed.append( 'selectedPatJets'+jetALGO+'PF'+PUMethod+'PrunedPacked' ) - toolsUsed.append( 'selectedPatJets'+jetALGO+'PF'+PUMethod+'PrunedSubjets' ) - - - if addTrimming: - - setattr( proc, jetalgo+'PFJets'+PUMethod+'Trimmed', - ak8PFJetsCHSTrimmed.clone( - rParam = jetSize, - src = cms.InputTag( jetalgo+'PFJets'+PUMethod+'Constituents', 'constituents'), - jetAlgorithm = algorithm, - rFilt= rFiltTrim, - trimPtFracMin= ptFrac) ) - setattr( proc, jetalgo+'PFJets'+PUMethod+'TrimmedMass', - ak8PFJetsCHSTrimmedMass.clone( src = cms.InputTag( jetalgo+'PFJets'+PUMethod), - matched = cms.InputTag( jetalgo+'PFJets'+PUMethod+'Trimmed'), - distMax = cms.double( jetSize ) ) ) - - elemToKeep += [ 'keep *_'+jetalgo+'PFJets'+PUMethod+'TrimmedMass_*_*'] - jetSeq += getattr(proc, jetalgo+'PFJets'+PUMethod+'Trimmed' ) - jetSeq += getattr(proc, jetalgo+'PFJets'+PUMethod+'TrimmedMass' ) - getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod).userData.userFloats.src += [ jetalgo+'PFJets'+PUMethod+'TrimmedMass'] - toolsUsed.append( jetalgo+'PFJets'+PUMethod+'TrimmedMass' ) - - if addFiltering: - - setattr( proc, jetalgo+'PFJets'+PUMethod+'Filtered', - ak8PFJetsCHSFiltered.clone( - src = cms.InputTag( jetalgo+'PFJets'+PUMethod+'Constituents', 'constituents' ), - rParam = jetSize, - jetAlgorithm = algorithm, - rFilt= rfilt, - nFilt= nfilt ) ) - setattr( proc, jetalgo+'PFJets'+PUMethod+'FilteredMass', - ak8PFJetsCHSFilteredMass.clone( src = cms.InputTag( jetalgo+'PFJets'+PUMethod), - matched = cms.InputTag( jetalgo+'PFJets'+PUMethod+'Filtered'), - distMax = cms.double( jetSize ) ) ) - elemToKeep += [ 'keep *_'+jetalgo+'PFJets'+PUMethod+'FilteredMass_*_*'] - jetSeq += getattr(proc, jetalgo+'PFJets'+PUMethod+'Filtered' ) - jetSeq += getattr(proc, jetalgo+'PFJets'+PUMethod+'FilteredMass' ) - getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod).userData.userFloats.src += [ jetalgo+'PFJets'+PUMethod+'FilteredMass'] - toolsUsed.append( jetalgo+'PFJets'+PUMethod+'FilteredMass' ) - - if addCMSTopTagger : - - if 'CA' in jetALGO : - - setattr( proc, 'cmsTopTagPFJets'+PUMethod, - cms.EDProducer("CATopJetProducer", - PFJetParameters.clone( - src = cms.InputTag( jetalgo+'PFJets'+PUMethod+'Constituents', 'constituents' ), - doAreaFastjet = cms.bool(True), - doRhoFastjet = cms.bool(False), - jetPtMin = cms.double(100.0) - ), - AnomalousCellParameters, - CATopJetParameters.clone( jetCollInstanceName = cms.string("SubJets"), - verbose = cms.bool(False), - algorithm = cms.int32(1), # 0 = KT, 1 = CA, 2 = anti-KT - tagAlgo = cms.int32(0), #0=legacy top - useAdjacency = cms.int32(2), # modified adjacency - centralEtaCut = cms.double(2.5), # eta for defining "central" jets - sumEtBins = cms.vdouble(0,1600,2600), # sumEt bins over which cuts vary. vector={bin 0 lower bound, bin 1 lower bound, ...} - rBins = cms.vdouble(0.8,0.8,0.8), # Jet distance paramter R. R values depend on sumEt bins. - ptFracBins = cms.vdouble(0.05,0.05,0.05), # minimum fraction of central jet pt for subjets (deltap) - deltarBins = cms.vdouble(0.19,0.19,0.19), # Applicable only if useAdjacency=1. deltar adjacency values for each sumEtBin - nCellBins = cms.vdouble(1.9,1.9,1.9), - ), - jetAlgorithm = cms.string("CambridgeAachen"), - rParam = cms.double(jetSize), - writeCompound = cms.bool(True) - ) - ) - - setattr( proc, "CATopTagInfos", - cms.EDProducer("CATopJetTagger", - src = cms.InputTag('cmsTopTagPFJets'+PUMethod), - TopMass = cms.double(171), - TopMassMin = cms.double(0.), - TopMassMax = cms.double(250.), - WMass = cms.double(80.4), - WMassMin = cms.double(0.0), - WMassMax = cms.double(200.0), - MinMassMin = cms.double(0.0), - MinMassMax = cms.double(200.0), - verbose = cms.bool(False) - ) - ) - addJetCollection( - proc, - labelName = 'CMSTopTag'+PUMethod, - jetSource = cms.InputTag('cmsTopTagPFJets'+PUMethod), - jetCorrections = JEC if JEC is not None else None, - pfCandidates = cms.InputTag( pfCand ), - pvSource = cms.InputTag( pvLabel), - svSource = cms.InputTag( svLabel ), - muSource = cms.InputTag( muLabel ), - elSource = cms.InputTag( elLabel ), - btagDiscriminators = bTagDiscriminators, - btagInfos = bTagInfos, - genJetCollection = cms.InputTag(jetalgo+'GenJetsNoNu'), - getJetMCFlavour = False, # jet flavor should always be disabled for groomed jets - genParticles = cms.InputTag(genParticlesLabel) - ) - getattr(proc,'patJetsCMSTopTag'+PUMethod).addTagInfos = True - getattr(proc,'patJetsCMSTopTag'+PUMethod).tagInfoSources = cms.VInputTag( cms.InputTag('CATopTagInfos')) - setattr( proc, 'selectedPatJetsCMSTopTag'+PUMethod, selectedPatJets.clone( src = 'patJetsCMSTopTag'+PUMethod, cut = Cut ) ) - - addJetCollection( - proc, - labelName = 'CMSTopTag'+PUMethod+'Subjets', - jetSource = cms.InputTag('cmsTopTagPFJets'+PUMethod, 'SubJets'), - algo = jetalgo, # needed for subjet b tagging - rParam = jetSize, # needed for subjet b tagging - jetCorrections = subJEC if subJEC is not None else None, - pfCandidates = cms.InputTag( pfCand ), - pvSource = cms.InputTag( pvLabel), - svSource = cms.InputTag( svLabel ), - muSource = cms.InputTag( muLabel ), - elSource = cms.InputTag( elLabel ), - btagDiscriminators = bTagDiscriminators, - btagInfos = bTagInfos, - genJetCollection = cms.InputTag( jetalgo+'GenJetsNoNu'), - getJetMCFlavour = GetSubjetMCFlavour, - explicitJTA = True, # needed for subjet b tagging - svClustering = True, # needed for subjet b tagging - fatJets=cms.InputTag(jetalgo+'PFJets'+PUMethod), # needed for subjet flavor clustering - groomedFatJets=cms.InputTag('patJetsCMSTopTag'+PUMethod), # needed for subjet flavor clustering - genParticles = cms.InputTag(genParticlesLabel) - ) - - setattr( proc, 'selectedPatJetsCMSTopTag'+PUMethod+'Subjets', selectedPatJets.clone( src = 'patJetsCMSTopTag'+PUMethod+'Subjets', cut = Cut ) ) - getattr( proc, 'selectedPatJetsCMSTopTag'+PUMethod+'Subjets' ).addTagInfos = cms.bool(True) - - setattr( proc, 'patJetsCMSTopTag'+PUMethod+'Packed', - cms.EDProducer("BoostedJetMerger", - jetSrc=cms.InputTag('patJetsCMSTopTag'+PUMethod ), - subjetSrc=cms.InputTag('patJetsCMSTopTag'+PUMethod+'Subjets') - )) - jetSeq += getattr(proc, 'patJetsCMSTopTag'+PUMethod+'Packed' ) - elemToKeep += [ 'keep *_patJetsCMSTopTag'+PUMethod+'Packed_*_*' ] - toolsUsed.append( 'patJetsCMSTopTag'+PUMethod+'Packed' ) - - else: print '|---- jetToolBox: CMS recommends CambridgeAachen for CMS Top Tagger, you are using '+algorithm+'. JetToolbox will not run CMS Top Tagger.' - - if addMassDrop : - - if 'CA' in jetALGO : - setattr( proc, jetalgo+'PFJets'+PUMethod+'MassDropFiltered', - ca15PFJetsCHSMassDropFiltered.clone( - rParam = jetSize, - src = cms.InputTag( jetalgo+'PFJets'+PUMethod+'Constituents', 'constituents' ), - ) ) - setattr( proc, jetalgo+'PFJets'+PUMethod+'MassDropFilteredMass', ak8PFJetsCHSPrunedMass.clone( src = cms.InputTag( jetalgo+'PFJets'+PUMethod), - matched = cms.InputTag(jetalgo+'PFJets'+PUMethod+'MassDropFiltered'), distMax = cms.double( jetSize ) ) ) - elemToKeep += [ 'keep *_'+jetalgo+'PFJets'+PUMethod+'MassDropFilteredMass_*_*' ] - getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod).userData.userFloats.src += [ jetalgo+'PFJets'+PUMethod+'MassDropFilteredMass' ] - jetSeq += getattr(proc, jetalgo+'PFJets'+PUMethod+'MassDropFiltered' ) - jetSeq += getattr(proc, jetalgo+'PFJets'+PUMethod+'MassDropFilteredMass' ) - else: print '|---- jetToolBox: CMS recommends CambridgeAachen for Mass Drop, you are using '+algorithm+'. JetToolbox will not run Mass Drop.' - toolsUsed.append( jetalgo+'PFJets'+PUMethod+'MassDropFilteredMass' ) - - if addHEPTopTagger: - if ( jetSize >= 1. ) and ( 'CA' in jetALGO ): - - setattr( proc, 'hepTopTagPFJets'+PUMethod, hepTopTagPFJetsCHS.clone( src = cms.InputTag( jetalgo+'PFJets'+PUMethod+'Constituents', 'constituents' ) ) ) - setattr( proc, 'hepTopTagPFJets'+PUMethod+'Mass'+jetALGO, ak8PFJetsCHSPrunedMass.clone( src = cms.InputTag( jetalgo+'PFJets'+PUMethod), - matched = cms.InputTag("hepTopTagPFJets"+PUMethod), distMax = cms.double( jetSize ) ) ) - elemToKeep += [ 'keep *_hepTopTagPFJets'+PUMethod+'Mass'+jetALGO+'_*_*' ] - getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod).userData.userFloats.src += [ 'hepTopTagPFJets'+PUMethod+'Mass'+jetALGO ] - jetSeq += getattr(proc, 'hepTopTagPFJets'+PUMethod ) - jetSeq += getattr(proc, 'hepTopTagPFJets'+PUMethod+'Mass'+jetALGO ) - toolsUsed.append( 'hepTopTagPFJets'+PUMethod+'Mass'+jetALGO ) - else: print '|---- jetToolBox: CMS recommends CambridgeAachen for HEPTopTagger, you are using '+algorithm+', and a jet cone size bigger than 1. JetToolbox will not run HEP TopTagger.' - - ####### Nsubjettiness - if addNsub: - from RecoJets.JetProducers.nJettinessAdder_cfi import Njettiness - - rangeTau = range(1,maxTau+1) - setattr( proc, 'Njettiness'+jetALGO+PUMethod, - Njettiness.clone( src = cms.InputTag( jetalgo+'PFJets'+PUMethod), - Njets=cms.vuint32(rangeTau), # compute 1-, 2-, 3-, 4- subjettiness - # variables for measure definition : - measureDefinition = cms.uint32( 0 ), # CMS default is normalized measure - beta = cms.double(1.0), # CMS default is 1 - R0 = cms.double( jetSize ), # CMS default is jet cone size - Rcutoff = cms.double( 999.0), # not used by default - # variables for axes definition : - axesDefinition = cms.uint32( 6 ), # CMS default is 1-pass KT axes - nPass = cms.int32(999), # not used by default - akAxesR0 = cms.double(-999.0) ) ) # not used by default - - elemToKeep += [ 'keep *_Njettiness'+jetALGO+PUMethod+'_*_*' ] - for tau in rangeTau: getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod).userData.userFloats.src += ['Njettiness'+jetALGO+PUMethod+':tau'+str(tau) ] - jetSeq += getattr(proc, 'Njettiness'+jetALGO+PUMethod ) - toolsUsed.append( 'Njettiness'+jetALGO+PUMethod ) - - ####### Nsubjettiness - if addNsubSubjets and (addPrunedSubjets or addSoftDropSubjets): - - from RecoJets.JetProducers.nJettinessAdder_cfi import Njettiness - - if addSoftDropSubjets: groomer = 'SoftDrop' - elif addPrunedSubjets: groomer = 'Pruned' - typeSubjetColl = jetALGO+'PF'+PUMethod+groomer+'Subjets' - rangeTau = range(1,subjetMaxTau+1) - setattr( proc, 'Nsubjettiness'+typeSubjetColl, - Njettiness.clone( src = cms.InputTag( jetalgo+'PFJets'+PUMethod+groomer,'SubJets' ), - Njets=cms.vuint32(rangeTau), # compute 1-, 2-, 3-, 4- subjettiness - # variables for measure definition : - measureDefinition = cms.uint32( 0 ), # CMS default is normalized measure - beta = cms.double(1.0), # CMS default is 1 - R0 = cms.double( jetSize ), # CMS default is jet cone size - Rcutoff = cms.double( 999.0), # not used by default - # variables for axes definition : - axesDefinition = cms.uint32( 6 ), # CMS default is 1-pass KT axes - nPass = cms.int32(999), # not used by default - akAxesR0 = cms.double(-999.0) ) ) # not used by default - - elemToKeep += [ 'keep *_Nsubjettiness'+typeSubjetColl+'_*_*' ] - for tau in rangeTau: getattr( proc, 'patJets'+typeSubjetColl).userData.userFloats.src += ['Nsubjettiness'+typeSubjetColl+':tau'+str(tau) ] - jetSeq += getattr(proc, 'Nsubjettiness'+typeSubjetColl ) - toolsUsed.append( 'Nsubjettiness'+typeSubjetColl ) - - ###### QJetsAdder - ''' - if addQJets: - ### there must be a better way to do this random number introduction - setattr( proc, 'RandomNumberGeneratorService', cms.Service("RandomNumberGeneratorService", - QJetsAdderCA8 = cms.PSet(initialSeed = cms.untracked.uint32(7)), - QJetsAdderAK8 = cms.PSet(initialSeed = cms.untracked.uint32(31)), - QJetsAdderCA15 = cms.PSet(initialSeed = cms.untracked.uint32(76)), ) ) - - from RecoJets.JetProducers.qjetsadder_cfi import QJetsAdder - setattr( proc, 'QJetsAdder'+jetALGO, - QJetsAdder.clone( src = cms.InputTag(jetalgo+'PFJets'+PUMethod), - jetRad = cms.double( jetSize ), - jetAlgo = cms.string( jetALGO[0:2] ))) - elemToKeep += [ 'keep *_QJetsAdder'+jetALGO+'_*_*' ] - getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod).userData.userFloats.src += ['QJetsAdder'+jetALGO+':QjetsVolatility'] - jetSeq += getattr(proc, 'QJetsAdder'+jetALGO ) - toolsUsed.append( 'QJetsAdder'+jetALGO ) - ''' - - ###### QGTagger - if addQGTagger: - if ( 'ak4' in jetalgo ) and ( PUMethod not in ['Puppi','CS','SK'] ) : - from RecoJets.JetProducers.QGTagger_cfi import QGTagger - proc.load('RecoJets.JetProducers.QGTagger_cfi') ## In 74X you need to run some stuff before. - setattr( proc, 'QGTagger'+jetALGO+'PF'+PUMethod, - QGTagger.clone( - srcJets = cms.InputTag(jetalgo+'PFJets'+PUMethod), # Could be reco::PFJetCollection or pat::JetCollection (both AOD and miniAOD) - jetsLabel = cms.string('QGL_AK4PF'+QGjetsLabel) # Other options (might need to add an ESSource for it): see https://twiki.cern.ch/twiki/bin/viewauth/CMS/QGDataBaseVersion - ) - ) - elemToKeep += [ 'keep *_QGTagger'+jetALGO+'PF'+PUMethod+'_*_*' ] - getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod).userData.userFloats.src += ['QGTagger'+jetALGO+'PF'+PUMethod+':qgLikelihood'] - jetSeq += getattr(proc, 'QGTagger'+jetALGO+'PF'+PUMethod ) - - toolsUsed.append( 'QGTagger'+jetALGO+'PF'+PUMethod ) - else: - print '|---- jetToolBox: QGTagger is optimized for ak4 jets with CHS. NOT running QGTagger' - - - ####### Pileup JetID - if addPUJetID: - if ( 'ak4' in jetalgo ) and ( 'CHS' in PUMethod ): - from RecoJets.JetProducers.pileupjetidproducer_cfi import pileupJetIdCalculator,pileupJetIdEvaluator - - setattr( proc, jetALGO+'PF'+PUMethod+'pileupJetIdCalculator', - pileupJetIdCalculator.clone( - jets = cms.InputTag(jetalgo+'PFJets'+PUMethod), - rho = cms.InputTag("fixedGridRhoFastjetAll"), - vertexes = cms.InputTag(pvLabel), - applyJec = cms.bool(True), - inputIsCorrected = cms.bool(False) - )) - - setattr( proc, jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator', - pileupJetIdEvaluator.clone( - jetids = cms.InputTag(jetALGO+'PF'+PUMethod+'pileupJetIdCalculator'), - jets = cms.InputTag(jetalgo+'PFJets'+PUMethod), - rho = cms.InputTag("fixedGridRhoFastjetAll"), - vertexes = cms.InputTag(pvLabel) - ) - ) - - getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod).userData.userFloats.src += [jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator:fullDiscriminant'] - getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod).userData.userInts.src += [jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator:cutbasedId',jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator:fullId'] - elemToKeep += ['keep *_'+jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator_*_*'] - toolsUsed.append( jetALGO+'PF'+PUMethod+'pileupJetIdEvaluator' ) - else: - print '|---- jetToolBox: PUJetID is optimized for ak4 PFjets with CHS. NOT running PUJetID.' - - ###### Energy Correlation Functions - if addEnergyCorrFunc: - from RecoJets.JetProducers.ECF_cfi import ECF - rangeECF = range(1,maxECF+1) - setattr( proc, jetalgo+'PFJets'+PUMethod+'ECF', ECF.clone( - src = cms.InputTag(jetalgo+'PFJets'+PUMethod), - Njets = cms.vuint32( rangeECF ), - beta = cms.double( ecfBeta ) - )) - - elemToKeep += [ 'keep *_'+jetalgo+'PFJets'+PUMethod+'ECF_*_*'] - for ecf in rangeECF: getattr( proc, 'patJets'+jetALGO+'PF'+PUMethod).userData.userFloats.src += [ jetalgo+'PFJets'+PUMethod+'ECF:ecf'+str(ecf) ] - jetSeq += getattr(proc, jetalgo+'PFJets'+PUMethod+'ECF' ) - toolsUsed.append( jetalgo+'PFJets'+PUMethod+'ECF' ) - - if hasattr(proc, 'patJetPartons'): proc.patJetPartons.particles = genParticlesLabel - - - setattr( proc, 'selectedPatJets'+jetALGO+'PF'+PUMethod, selectedPatJets.clone( src = 'patJets'+jetALGO+'PF'+PUMethod, cut = Cut ) ) - elemToKeep += [ 'keep *_selectedPatJets'+jetALGO+'PF'+PUMethod+'_*_*' ] - elemToKeep += [ 'drop *_selectedPatJets'+jetALGO+'PF'+PUMethod+'_calo*_*' ] - elemToKeep += [ 'drop *_selectedPatJets'+jetALGO+'PF'+PUMethod+'_tagInfos_*' ] - - - if len(toolsUsed) > 0 : print '|---- jetToolBox: Running '+', '.join(toolsUsed)+'.' - print '|---- jetToolBox: Creating selectedPatJets'+jetALGO+'PF'+PUMethod+' collection.' - - ### "return" - setattr(proc, jetSequence, jetSeq) - if hasattr(proc, outputFile): getattr(proc, outputFile).outputCommands += elemToKeep - else: setattr( proc, outputFile, - cms.OutputModule('PoolOutputModule', - fileName = cms.untracked.string('jettoolbox.root'), - outputCommands = cms.untracked.vstring( elemToKeep ) ) ) - - if runOnData: - from PhysicsTools.PatAlgos.tools.coreTools import removeMCMatching - removeMCMatching(proc, names=['Jets'], outputModules=[outputFile]) From 0f3816d5a65d0b6ee2615cd30f358bfef20fa6b9 Mon Sep 17 00:00:00 2001 From: pgunnell Date: Thu, 2 Nov 2017 09:41:05 +0100 Subject: [PATCH 30/48] Delete jetToolbox_cff.pyc --- AnalysisFW/test/jetToolbox_cff.pyc | Bin 23685 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 AnalysisFW/test/jetToolbox_cff.pyc diff --git a/AnalysisFW/test/jetToolbox_cff.pyc b/AnalysisFW/test/jetToolbox_cff.pyc deleted file mode 100644 index a6a002c4ff84bf719bd107796304f6a3ddfa1432..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 23685 zcmc(H3w%`BdEa+OLLecK76IbD!@>d!tagE2VDavP5E4%bF%r9r{2-$_S7KmZ%)P_H zcBZLAl4i5+rgfaOahtSmlcuqoIDMpb`fy#>O_Mlj)8^5pk2L8cuA9bn>oj$n#L55v zopWdIykOb>+#oS?p5OW2-*?WvM?GIzGw_Rrue_QO_wOLSPvL)X#}hI5^&}^9)03MC zS?JN0gyec9zd{yPNWM=N`Xs+n7FJ4rl`O21e7`L8OMXBW1|+{)7FJ7sP!td;zbEDTA0SQdsQ|ClU1Ci!);uueR#*CV+R$*-4%^|szCxeb!vC<_~HeTC#k zWu7BZ+Eg!Xu9vpdOIvNJPjcHNzg-r#TL>#9w?p!e%fjR0`AIRW#Po~5lfNtv$g&re zJ<{LO$SJGE308guPF?WBAY8Atr)6rL#;OW~$29nE-&cwq+)Yg&@p^6~6$+tpL_6X?dz!N6SERuY9dE#&(b=q@>A{C%JK@S9iq+~Rd};b%!nAM^ae2- z#f*yCBxbXiEn>Ec*(PSYm>pss7X!nAxji8UI=@@YlVbLW*(+wBn5V?-7jr<&K`~E@ z858r27%Yv24vRS=<~cFXi#aOhm@GdfH8dU<^MaTYV%{U>MKLdld0CcMO6`c!zS*l{ z)=Ap+F*K3*Q&IyId;$h)Rwc}DfCRO!*=(yD<<>MY& zFu8i1liAh7F@SO(Q;y2*;~surHRDoyK_KwzQMvC4l+TWG@=34WWzNV33@u>9 zBt`O^-0UM3m^fNHA*?6r_4h~>zlY@3N-28@GbQG%++4{PEHY}&L4p`?)|>|<&F{Z(Vfc*HK*MFJ zof0!EwFxm-q;^KAMCAlDr~ti5No|sPS6;%ndPFF*n8B5|a~?7gG>Zl;wV@t)WtfBT^mU`Zw2W`3TGS4PNUt zC4oGlc)`wIbK8~6M|x>BYBI|`QX7y0Bx9>kWk?Tx9{u)%h93lQID@-8ODYc~E>cyDaSur71 zelC)7MbV|^4-yF2fLM2ZRP}spg>5&}QTrzHuc3GW&6J9VWeEC?nAat@S@K(?c22y8 zc<;ha&N+2-Yn>%bb5FvpEz<67(@xBG>s0%tdRUG6Csvp@)b!0Cf%*3!3R5#85%%(p~ze{3a1^R1G5T=Ge& zU5F$1$AR1hMb641ay?cV%(toQ*-7_7c{vYaWdv7vbtT4GH$*=IVC2#hO={BUAhQ}G zd~;<)%9|ZY`SysEw-a@{EPq!&J#ccBc`Fj+&k_Y{--jT`+iUxsJAJEzJ9RYG-RYko zO>OS&oWOu(e^f--9T!&r$X0W{cTv>RaoNWd6~PG9QU#{!xv( zeKBPIERcChk?G(xY)FG<{CYpw-%va38qqgf%h3`EHNxsJ#kB64tm$m5{JOi#`X zAoA2^q_CGQ$Z%kD&`d1Ja?Ol799Z2DCunB2V!jWYgu_Rw@#h<< z2CdW$prJ=LQXM3w&PECso8{304XHxid%Oc^^*9n+nz%Wo2@g;?&BvI07zjic`-?6y zicKN5e~IayOLD%S++{-0FXdlbjWW|M0Q!Mwszy2Um!s-w5@>!fssav@CpP_+s7XV* z`Jt$a>@lh;mr$Vg4RPKN_j7`TH`e+m{y`fjXuu3eBc09kmY_M%rhiew$cs z9+I1frT69&s&SD;VIEgaAo5kmnViMfBv541Ry53lpB`%P=F{MbCh8%!UjLw(t+Dig z!iXu2X_E?jA*4;JYY!HWr{bY=7#ZTOLn$S~z=ev}9=&Y`oh6gnPId_?nGUuYNw1rI zesHK^pDpJ03A!~fwUcH3Ft_L34Q#d3J@c6+qardPc8PXV)GS%{!ROK2iN?&1RQ|*6 zR8sX}KP`k_jvUd=;VRs7M@Q5`cZ*+o=Uyl7!5}b)5PT8#axK2-vufG@NIyTg>s*!;HA&YJ*MuWxe808IUFcgwcpL2elw?C6%AC|bN#J#E^w;s2*w z1~Of}1qpblTmJd(R6fKldmFzlZn>k=jc15)UkxcbEZ?PDcEWtPTLz!HGMYSmG`EZy zRLgE|`4_O*L*24Ny_;L+5)XIFSSfN7?QZ!OTgP`a)~;9kxI*x2y*!=3h#6o0xwk)$Is_D>`S(zYMr9JgSccGTnV_yR-Y( z4eoSuz=ZYy2Mi2d_oF#r%&R-#wrrU|ArLZrhm==tZD;tu0b@>dV@!M`@H2=AI z;;(BJ4_UsTaQ;hFwY&H)M%DkSy}zMVtn%Nq`kPukrB9f?B<8;h49|QyYWyE!^p}nQ zGiv;b82x4AZ$*v&ON{=q@wcPK|1Cy;(Rg20P9X5+J1i>mZrmQNX_&RmZjZdr|dkTK)Z~iqk{P_4MQc{IG))QME^V zd!wrDT@h7nZ?hckdjlZUtM8IbpVxFg6GJ$D9&>wpBe7^XkNJ9RgRWWQ?6h6H@2&B0 z0OK6jO2rjq4|#@_dzS#BbZU)6s5Zl}>HMRST+f(h_m0-)p30j#CdwR6f4r z>yoH+%Sq~td5n2&XoNN6WV`x@B4< z2YXauF^)izvA0j}GI&>nI=&^+@!eAX)NVf9+Un&dB|jy#S%e3?tMLV?KFLptuXZK! zn%g|`j3J{s+l}vJ(sm6(XQg^Y$n!wujGl46xEm*TwK*x^$r4U3 zzPj7|j8>6hH=e9i=O9hE!`i&Qg9EAUZI{|pUUmLK5>p`dAoLGkaQhY6xX|#z4Tbhn zv(P|Mv#>0cT?F-;PsRjgM>Y$|wK)OpmvU_{UIv4gW=37v3zavodVDRZvX{a-;N{Ls z{({u5Lf!1M*n`x-C|W+P>K8r#s$NxN8B=A&3mc8+Bs7O-v>ER4S+9CPQy&*8sKD4hFBgnamGHqiXnPZBUq$k<`m!{K|>%HUkaO47S3=sIC!i6|bJK-Lb^0)4%5GTCcWy#}pxYz1&VXW?9uDQ4nQ)qJr zSiSa+V#BqjU{HOU)$UISC+h^zi(j)|9Q(6Jdf+!@z4$`27ysH*4d>88N|Qmf_E~2U z0v$ZoI_qI<`TO@*U)Gm1QgR)x8;{*=qWhVqrw)w_x;gqZWziiTRy1-7cAjf?4d?3& z>d<+i-Wkp_1Ez+bmRoqW@f!}9i=MgU@ij|rAI001HUl=(%`40>Yj8<0-l=_w8*$H) zU&ZzrJp;@hLq{}sGx>6uxzKiDF?-xW3RRMhesr&1%_ zYm<0cZ|6a3Y z9VBO`Cej6yHR;d~V)Mg3^p6+9?8PulpqRdeM+|szIh|iDXU(!dp3dCBJKOBar1i@U zycO!J&v+Z&eIK{4LZ@v#lRmERSmWjKXHy$68@nbfbn(#a6yBD0mBaDMk$45Kpf`r$ z?ej+EXuNVPUctNbjbSg?3SZdAqR-kIUo=+~X0Oi9o`;ZG1rqTp(1=%oNW2PE;#D9M zuL7NT6$r(vK*?5D*O9XIl@VHV7eiYHPW3Vns+WOHy$n?9W#CaS1BrSW7}U#H9%Uy5 zFa#C8hp+r_B`oVoSk#rUq$^=TSHg0xgvDG5OSuvjvRb8l*A*`vy1cX$_@Q2)xO8YL z9q?uSkc_x==)&y0>!m<09ZvbVbeO&4t9&jU8D9*Fxk~8UxzA6fb9aiBvITn#mjgn) z+Ru9nmkwV#lJbMBsibo$UYT&O$F{96T!*{Cz2s=J|qL0=UDPu zv64)e{bYq!u03PHa~+qsFgZVe`SPXHmtRY!uFlMypE;YnJd>Qx7P8})&m^ZVr;-8L zm&CZa!ps8-b=xy4DvXe$@zia1}QEr<+25TE~j@;W^olIUB34U*pkg)1YJ>J zyXHVv!NfZ^qq9;dr8BpDGhfD6FkUeAsYJp}ov!e<2(N&+hDqMxD6^5bXDo!cLsQIb za~$ERVi{@{%oJxT&Z`y7Y*?PtDfSXcgC&n#twX91vHt2=8zBz;9=IWA^iMRHu?tuvV}|zdV9yON2E4g33z)Z1r4J7#&CIPDZ5-L!z~mGW0sqB ztpwpqdKD^8LtOGZh{KYiJ5j74)D@P`WtVSEE-jq~blh4B!Y)H*E9LqSYIbP}6K2cB z#q?q}mksaLJE_^)dAd{Y9_^jW=1V!hiBkV=D6UMp(=o_=M#0W3u)sv@7wrLzTF;zh0$6(e{PAMNTl14jy9QlLxITVIh= zyOD=VpS7x3ajk77HY8e44wM zd>2f@tR@ao+q!XxXk1h@=vkDgMw4Y2!*`uwF1N7ULZug-nq-jhiMb9e#x=Z&IgR7) z+Mumuf|PZS76OLYoCpk^m`l+&1^4msU?u|g1GJ32?}B}t7U!R4IZNeYe)bhh9X_J~ibhy0HEd2p@?tRzi}^;Qy6UdDHIYGsOMM7S zX)f2eEXq98X6THLwp|Tob}D!pE$y-%kL*6Yk>z%#ZuUr%NLR++O$%lylL_dM}xs z`E-b_s8JM6HVCKFcLTQH^8HeB|Mh?jjZeD1|N4Gi&E^Z51xEd9alk&Rr$~)*ENTHN zkaC~{eMjSk`Ef-pxHEzL1(`kqkD{~WI7TH{E*FcqoIMq5ieS!a=Bq|@x(Igpyr4Yo zmzR+}Q}MCj9I{c0G0^2v3+V775}U6&2ULS**h;h7kiAq+7y3q~Vs~0)6s|9&Gtdb6<2|t(9;Y<4OYbRAM$_eDk*0)e! zBHo~p3alb6mdNVtCrBhc3%JJyiZWhJ-?ikNDxOlbU*#Z+_U8Fh>Ugw?^T=RZiDpUm zltM#q9C%bs-&H!Wv$oAYE5dm0TW|qimmVhlGjl1U=G#x zsMWIDZ#iVc&cB@G5a6A(Ts@e)7vJY6gQoy@ED4Qt=Yq-Ck)r8Q1#GTm@|aRi7B&6B z2Bz?>jjZc2Vy6xoN-*MEIN&2oI zG{$AA(+Uh{J22NT^q@*ROWzvDz|^zRX0us=dp18ey2}g0c><#3~U92;jkVHm_KjMPC>J98ZX_VOHP_O~4ExeJ$Hef6{ zb9uhLsf{MuWS)oJCEaQQ+w*23oy$~kpoySM-o$z)d8){c)bEl+Dk&GyW2f?sqV5`& zvUhQ!f|K}0$QjS&R9J{Fp$~Cc$uS?kfUPg1T(*D&?|k5LQQxF~kMJpUz|Wc>coM}< zh@4oe5Oy_LL`9dSrJ#Jm&n&4DTYt_C8gg9CxeQzu)5_);5m1A# zXVSSMogz2D*FzT+QQv}kJ25GD_7O0$A57|gseRN04i$Jbm26#+DF=2q(H_Bi^;sMb zUXCU5ssu}5GIMFQ0`Mrb&yL2Bk%sC9Y@*M-8a5@dKeSW!^Tj*<^u#n%Z02>EMiG)~ zC1eroBP#=bK>btSgzr=ZAKI)X+lEJ6vhTh4P!Kq)cL@-70Ne%S?ce^vL7>YR%6=(_ zyhn8&!Cq&T(*^8Xhyu<}Fis7lh+eLaEKO;h^KavC31KEBiAB<3XrBp8p0P=ujyg|E zfV)xU55juF4)~mqVjiO_WpeP@x>Bx~Huiy)QVcFqRDKX*|le3vlA>%=RIC*BEJa47s7Wb8(>z0u1HcIG`SG`>^n`i5P|U;hD*zt>>y^4uh?B+g55!Do33;q}ZO3@)WtS~}97~{Etjkx2+_+^!X zrU)eBPQ|WDs$B6=V(rsiSG8Uqo+WEaPA7C_#xEOWB4M28pZVgsOK0@yh8f%Gmz6nq z;HC!I#|A1yq-r)C=KMmcpIvl@O@5DKai-6wN$zamj$h>;#3utn$FJ+CSY=G%A>g|#xGq>VFp zri2m&i9z+vANR5}KD0%fp=eBe6QDR_46|QdGoQXYkBpf1?3yEdsk0ab6~d7f$I!qr z#-%D6LQuVOfytj+I!Y6J5hplHvfQw-E82HX^5 zXzERVyu}X&GtE)JCPg1YN6~KG=mRvdp#sokxqTuD_PnsHibK9xt>N*y?tFA_puW{Q z%Q_s&mvA6<>%dT!ef-c(8(2r@hF6E+XqU!H_msblRz3gtZJOzpm0lly`d6&*`efMK z>TU3PydC zy$X;4LpIC$ zXv5w%lr~}pzn{?7HCVsH>OG{c-{GWiffMlp9O?J=CWaEA52gJ*>tx2e=sgZD^m(}9 zp>sAVMk5Y0%iSSwAh8#-clHb>HURbx9ogp%fs^1io2`I5^P8xozNF9Q*nRP-Zdb zh(XA`U*({j0mtHe+5o8h*`z!l>7`9X^0b^(j`UFK1L%p*CH9oWaAKpk&)e@b!&230 zoTYZe8}2y_&O^&EduxK0y(uwFOi?1ePb8lA#z4ahpyCN?F}S}eaol^}+oP?cXx|1X zTzSNM4EhvljQt)-Z1&d3Sz2VzIzop2^8ZGxx5nGsHhKd_zXv+9ew6w}OCuhm-e}Ku z?w8Vk2lA_V(?D=L@-CpL!Kh)W@4PF4Ld$L-)Rk<`409b?SIRh<8y^ z8<>qU#jGc|wj+8;h0Qi#(EsZ8rm<&v@b<%Qi0Zq56eEz`Z0>pRdhT(JE~xv8{qgY^ z;`;|g8P+4B1I@;n3O!)Y(Xu1r6y5aIIncC%MW%U$@K9HTx@@gcwE2cX)+a39eRYA`4pN(W=# Q44QORwukP5r9STu0L Date: Thu, 2 Nov 2017 09:41:09 +0100 Subject: [PATCH 31/48] Delete processedLumisRunB2016.json --- AnalysisFW/test/processedLumisRunB2016.json | 1 - 1 file changed, 1 deletion(-) delete mode 100644 AnalysisFW/test/processedLumisRunB2016.json diff --git a/AnalysisFW/test/processedLumisRunB2016.json b/AnalysisFW/test/processedLumisRunB2016.json deleted file mode 100644 index c2e63c075b6..00000000000 --- a/AnalysisFW/test/processedLumisRunB2016.json +++ /dev/null @@ -1 +0,0 @@ -{"273402": [[100, 292]], "273403": [[1, 53]], "275000": [[1, 136]], "275001": [[1, 1781], [1786, 2061]], "273404": [[1, 18]], "273405": [[2, 25]], "273409": [[3, 110], [113, 166], [169, 309]], "273406": [[1, 44], [49, 52], [61, 66], [85, 100], [109, 112]], "273158": [[1, 1279]], "273411": [[1, 29]], "273410": [[1, 90]], "274319": [[1, 225]], "274251": [[1, 546]], "274146": [[1, 67]], "274316": [[1, 959]], "274315": [[1, 424]], "274314": [[97, 97], [99, 158]], "275310": [[1, 1929]], "275311": [[1, 1253]], "274421": [[1, 342]], "274420": [[94, 268]], "274422": [[1, 2207]], "275319": [[141, 282]], "273554": [[77, 437]], "273555": [[1, 173]], "273493": [[1, 233]], "273492": [[71, 71], [73, 282], [284, 325], [327, 338]], "273494": [[1, 192]], "274955": [[10, 12], [14, 21], [23, 27], [29, 50], [52, 52], [54, 55], [57, 58], [60, 72], [75, 80], [82, 87], [89, 91]], "275125": [[1, 989]], "275124": [[106, 106], [108, 431]], "274382": [[94, 144]], "274387": [[88, 439]], "274094": [[108, 332]], "274244": [[1, 607]], "273730": [[1, 1814], [1820, 2126]], "274240": [[1, 40], [42, 82]], "273425": [[62, 352], [354, 733]], "274441": [[1, 431]], "275066": [[1, 96]], "275067": [[1, 392]], "274159": [[1, 43]], "274440": [[92, 493]], "275309": [[55, 617]], "275068": [[1, 915]], "273302": [[1, 459]], "274388": [[1, 1820]], "274968": [[1, 1192]], "274969": [[1, 1003]], "273725": [[83, 252], [254, 2545]], "274160": [[1, 207]], "274161": [[1, 516]], "273728": [[1, 100]], "275074": [[1, 442], [444, 647]], "275073": [[1, 115], [130, 133], [138, 139], [142, 143], [150, 159], [162, 163], [166, 203], [206, 207], [210, 211], [214, 225], [228, 231], [234, 235], [238, 247], [250, 344], [347, 374], [377, 467], [470, 517]], "275370": [[90, 94], [96, 108], [112, 119], [121, 123], [125, 135], [138, 139], [141, 144], [146, 154], [157, 159], [161, 161], [163, 164], [166, 171], [173, 176], [178, 178], [180, 188], [190, 207], [209, 231], [233, 238], [241, 364]], "275371": [[1, 22], [28, 569]], "275376": [[1, 2667], [2669, 3096]], "275375": [[127, 1449]], "274241": [[1, 1152], [1161, 1176]], "274971": [[1, 905]], "274970": [[1, 47]], "275284": [[1, 74]], "275282": [[91, 180]], "275283": [[1, 132]], "273448": [[1, 391]], "273449": [[1, 214]], "273446": [[1, 33]], "273447": [[1, 113], [115, 412]], "274200": [[1, 678]], "275291": [[1, 347]], "275290": [[96, 143]], "275293": [[1, 142], [144, 201]], "275292": [[1, 121]], "275059": [[78, 81], [105, 137]], "274999": [[1, 1241]], "274998": [[64, 240], [242, 782]], "273450": [[1, 214], [219, 647]], "274344": [[1, 632]], "274345": [[1, 170]], "274172": [[31, 95]], "275345": [[1, 286], [288, 303], [306, 317], [320, 321], [324, 325], [328, 329], [332, 333], [336, 343], [346, 347], [350, 353]], "275344": [[76, 356]], "273503": [[1, 598]], "273502": [[73, 256], [258, 318], [320, 813], [815, 1064]], "274199": [[1, 623]], "274198": [[81, 191]], "274250": [[1, 593], [596, 649], [653, 701]], "274317": [[1, 3]], "274335": [[60, 1003]], "274442": [[1, 737], [739, 741], [751, 752]], "274337": [[3, 17]], "274336": [[1, 14]], "274339": [[1, 20], [22, 29], [31, 31], [36, 92]], "274338": [[1, 698]], "275337": [[1, 427]], "275338": [[1, 520]], "274283": [[2, 19]], "274284": [[1, 207], [210, 210]], "274286": [[1, 10], [17, 27], [30, 31], [38, 41], [44, 45], [66, 67], [72, 73], [86, 91], [102, 103], [107, 110], [127, 128], [133, 138], [141, 142], [149, 150], [153, 154]]} From e5a5abfab5147ba58323f241c965899a1d32f0f2 Mon Sep 17 00:00:00 2001 From: pgunnell Date: Thu, 2 Nov 2017 09:41:31 +0100 Subject: [PATCH 32/48] Delete Spring16_25nsV9p2_DATA_L2L3Residual_AK8PFchs.txt --- ...16_25nsV9p2_DATA_L2L3Residual_AK8PFchs.txt | 37 ------------------- 1 file changed, 37 deletions(-) delete mode 100644 AnalysisFW/test/Spring16_25nsV9p2_DATA_L2L3Residual_AK8PFchs.txt diff --git a/AnalysisFW/test/Spring16_25nsV9p2_DATA_L2L3Residual_AK8PFchs.txt b/AnalysisFW/test/Spring16_25nsV9p2_DATA_L2L3Residual_AK8PFchs.txt deleted file mode 100644 index 759f96655e9..00000000000 --- a/AnalysisFW/test/Spring16_25nsV9p2_DATA_L2L3Residual_AK8PFchs.txt +++ /dev/null @@ -1,37 +0,0 @@ -{ 1 JetEta 1 JetPt [2]*([3]*([4]+[5]*TMath::Log(max([0],min([1],x))))*1./([6]+[7]*100./3.*(TMath::Max(0.,1.03091-0.051154*pow(x,-0.154227))-TMath::Max(0.,1.03091-0.051154*TMath::Power(208.,-0.154227)))+[8]*((1+0.04432-1.304*pow(max(30.,min(6500.,x)),-0.4624)+(0+1.724*TMath::Log(max(30.,min(6500.,x))))/x)-(1+0.04432-1.304*pow(208.,-0.4624)+(0+1.724*TMath::Log(208.))/208.)))) Correction L2Relative} - -5.191 -3.839 11 10 6500 55 240 0.996800 1.000101 1.322001 -0.051859 0.992 -0.031 0 - -3.839 -3.489 11 10 6500 55 380 0.996800 1.000101 1.172906 -0.031481 0.992 -0.031 0 - -3.489 -3.139 11 10 6500 55 640 0.996800 1.000101 1.202572 -0.051945 0.992 -0.031 0 - -3.139 -2.964 11 10 6500 55 760 0.996800 1.000101 1.399289 -0.096722 0.992 -0.031 0 - -2.964 -2.853 11 10 6500 55 670 0.996800 1.000101 1.632535 -0.110592 0.992 -0.031 0 - -2.853 -2.650 11 10 6500 55 710 0.996800 1.000101 1.256777 -0.035855 0.992 -0.031 0 - -2.650 -2.500 11 10 6500 55 900 0.996800 1.000101 1.091728 -0.014777 0.992 -0.031 0 - -2.500 -2.322 11 10 6500 55 1020 0.996800 1.000101 1.063383 -0.011839 0.992 -0.031 0 - -2.322 -2.172 11 10 6500 55 1120 0.996800 1.000101 1.025884 -0.004054 0.992 -0.031 0 - -2.172 -1.930 11 10 6500 55 1400 0.996800 1.000101 1.032040 -0.007101 0.992 -0.031 0 - -1.930 -1.653 11 10 6500 55 1630 0.996800 1.000101 1.021314 -0.005810 0.992 -0.031 0 - -1.653 -1.479 11 10 6500 55 1960 0.996800 1.000101 1.030430 -0.008819 0.992 -0.031 0 - -1.479 -1.305 11 10 6500 55 2120 0.996800 1.000101 1.007190 -0.001887 0.992 -0.031 0 - -1.305 -1.044 11 10 6500 55 2180 0.996800 1.000101 0.995596 0.003583 0.992 -0.031 0 - -1.044 -0.783 11 10 6500 55 2310 0.996800 1.000101 1.007819 -0.000155 0.992 -0.031 0 - -0.783 -0.522 11 10 6500 55 2590 0.996800 1.000101 1.013788 -0.001362 0.992 -0.031 0 - -0.522 -0.261 11 10 6500 55 2950 0.996800 1.000101 0.996912 -0.000148 0.992 -0.031 0 - -0.261 -0.000 11 10 6500 55 2810 0.996800 1.000101 0.982343 0.001198 0.992 -0.031 0 - 0.000 0.261 11 10 6500 55 2810 0.996800 1.000101 0.982343 0.001198 0.992 -0.031 0 - 0.261 0.522 11 10 6500 55 2950 0.996800 1.000101 0.996912 -0.000148 0.992 -0.031 0 - 0.522 0.783 11 10 6500 55 2590 0.996800 1.000101 1.013788 -0.001362 0.992 -0.031 0 - 0.783 1.044 11 10 6500 55 2310 0.996800 1.000101 1.007819 -0.000155 0.992 -0.031 0 - 1.044 1.305 11 10 6500 55 2180 0.996800 1.000101 0.995596 0.003583 0.992 -0.031 0 - 1.305 1.479 11 10 6500 55 2120 0.996800 1.000101 1.007190 -0.001887 0.992 -0.031 0 - 1.479 1.653 11 10 6500 55 1960 0.996800 1.000101 1.030430 -0.008819 0.992 -0.031 0 - 1.653 1.930 11 10 6500 55 1630 0.996800 1.000101 1.021314 -0.005810 0.992 -0.031 0 - 1.930 2.172 11 10 6500 55 1400 0.996800 1.000101 1.032040 -0.007101 0.992 -0.031 0 - 2.172 2.322 11 10 6500 55 1120 0.996800 1.000101 1.025884 -0.004054 0.992 -0.031 0 - 2.322 2.500 11 10 6500 55 1020 0.996800 1.000101 1.063383 -0.011839 0.992 -0.031 0 - 2.500 2.650 11 10 6500 55 900 0.996800 1.000101 1.091728 -0.014777 0.992 -0.031 0 - 2.650 2.853 11 10 6500 55 710 0.996800 1.000101 1.256777 -0.035855 0.992 -0.031 0 - 2.853 2.964 11 10 6500 55 670 0.996800 1.000101 1.632535 -0.110592 0.992 -0.031 0 - 2.964 3.139 11 10 6500 55 760 0.996800 1.000101 1.399289 -0.096722 0.992 -0.031 0 - 3.139 3.489 11 10 6500 55 640 0.996800 1.000101 1.202572 -0.051945 0.992 -0.031 0 - 3.489 3.839 11 10 6500 55 380 0.996800 1.000101 1.172906 -0.031481 0.992 -0.031 0 - 3.839 5.191 11 10 6500 55 240 0.996800 1.000101 1.322001 -0.051859 0.992 -0.031 0 From 3fc98965d44d5f0085d2e4ea5bf3d9869c1988d0 Mon Sep 17 00:00:00 2001 From: pgunnell Date: Thu, 2 Nov 2017 09:41:35 +0100 Subject: [PATCH 33/48] Delete processedLumisRunC2016.json --- AnalysisFW/test/processedLumisRunC2016.json | 1 - 1 file changed, 1 deletion(-) delete mode 100644 AnalysisFW/test/processedLumisRunC2016.json diff --git a/AnalysisFW/test/processedLumisRunC2016.json b/AnalysisFW/test/processedLumisRunC2016.json deleted file mode 100644 index 6b8551d21ed..00000000000 --- a/AnalysisFW/test/processedLumisRunC2016.json +++ /dev/null @@ -1 +0,0 @@ -{"275782": [[1, 131], [133, 762]], "276092": [[74, 149]], "275767": [[1, 4]], "275761": [[1, 9]], "276097": [[1, 507]], "275931": [[1, 14], [19, 89]], "275886": [[73, 109]], "275912": [[1, 289]], "275913": [[1, 475]], "275911": [[62, 298], [300, 354], [356, 440]], "275657": [[1, 105]], "275918": [[1, 318], [348, 361]], "275847": [[1, 2263]], "275659": [[1, 17]], "275658": [[1, 337]], "275778": [[1, 305]], "275776": [[1, 140]], "275777": [[1, 300]], "275774": [[1, 311], [315, 315]], "275772": [[1, 56]], "275773": [[1, 7]], "275963": [[82, 139], [141, 172]], "275833": [[1, 53], [56, 115], [117, 251]], "275832": [[1, 367]], "275835": [[1, 13]], "275834": [[1, 297]], "275837": [[1, 186], [198, 726]], "275836": [[1, 1163], [1166, 1170], [1184, 1293]], "275890": [[1, 1393]], "275923": [[3, 53], [63, 64], [66, 126]], "275921": [[1, 2], [4, 5], [17, 20]], "275920": [[7, 15], [17, 18], [21, 186], [191, 192], [195, 196], [205, 210], [213, 216], [219, 224], [227, 234], [237, 240], [247, 248], [251, 252], [255, 264], [267, 270], [275, 298], [301, 460]]} From dfd67f1dd53791fd6c70d83671cab9e4d887b53b Mon Sep 17 00:00:00 2001 From: pgunnell Date: Thu, 2 Nov 2017 09:41:39 +0100 Subject: [PATCH 34/48] Delete processedLumisRunD2016.json --- AnalysisFW/test/processedLumisRunD2016.json | 1 - 1 file changed, 1 deletion(-) delete mode 100644 AnalysisFW/test/processedLumisRunD2016.json diff --git a/AnalysisFW/test/processedLumisRunD2016.json b/AnalysisFW/test/processedLumisRunD2016.json deleted file mode 100644 index b04078fc79f..00000000000 --- a/AnalysisFW/test/processedLumisRunD2016.json +++ /dev/null @@ -1 +0,0 @@ -{"276584": [[1, 2]], "276318": [[3, 103], [106, 570]], "276586": [[2, 658], [680, 773]], "276587": [[1, 1006]], "276581": [[79, 444]], "276582": [[1, 871]], "276585": [[1, 238], [241, 242], [245, 246]], "276542": [[74, 857]], "276543": [[1, 638], [643, 952]], "276315": [[40, 175], [178, 217]], "276545": [[2, 110], [117, 213]], "276454": [[1, 527]], "276808": [[1, 875]], "276807": [[66, 220]], "276384": [[2, 1117]], "276437": [[63, 224], [227, 1074], [1076, 2190]], "276458": [[1, 341]], "276659": [[1, 127], [129, 252]], "276655": [[1, 593], [595, 1106]], "276776": [[1, 1823]], "276775": [[96, 1260]], "276653": [[72, 550]], "276361": [[1, 161], [169, 208], [210, 800], [802, 833]], "276363": [[1, 140], [142, 238], [242, 1482]], "276544": [[2, 161]], "276794": [[1, 885]], "276317": [[3, 138]], "276583": [[1, 52]], "276810": [[1, 287]], "276811": [[1, 1270], [1272, 2563]], "276527": [[1, 214]], "276355": [[1, 33]], "276525": [[88, 469], [471, 1606], [1626, 2893]], "276528": [[4, 394]], "276495": [[87, 268]], "276501": [[4, 221], [223, 2547]], "276502": [[2, 741]]} From a5013af07c7b5b2c80a894177c2561ae21c8e671 Mon Sep 17 00:00:00 2001 From: pgunnell Date: Thu, 2 Nov 2017 09:41:42 +0100 Subject: [PATCH 35/48] Delete processedLumisRunE2016.json --- AnalysisFW/test/processedLumisRunE2016.json | 1 - 1 file changed, 1 deletion(-) delete mode 100644 AnalysisFW/test/processedLumisRunE2016.json diff --git a/AnalysisFW/test/processedLumisRunE2016.json b/AnalysisFW/test/processedLumisRunE2016.json deleted file mode 100644 index a3c8fcd2d7a..00000000000 --- a/AnalysisFW/test/processedLumisRunE2016.json +++ /dev/null @@ -1 +0,0 @@ -{"276944": [[1, 15]], "276945": [[1, 5]], "276946": [[1, 27]], "276947": [[1, 89], [91, 126], [135, 141]], "276940": [[70, 213]], "276941": [[1, 18]], "276942": [[1, 14]], "277148": [[83, 190], [193, 700]], "277069": [[81, 265], [267, 390]], "276948": [[1, 474]], "277127": [[1, 438], [440, 779], [781, 784], [787, 790], [793, 798], [801, 802], [805, 808], [811, 812], [817, 824], [829, 834], [837, 842], [845, 846], [851, 858], [861, 862], [865, 866], [869, 870], [877, 878], [884, 892], [895, 896], [901, 902]], "277126": [[42, 59]], "277094": [[1, 161], [164, 584]], "277096": [[1, 1309], [1311, 1939], [1942, 1943], [1946, 1975], [1978, 1987], [1994, 1999], [2002, 2009], [2014, 2019], [2022, 2026], [2029, 2036], [2039, 2056], [2064, 2070], [2073, 2086]], "277112": [[11, 24], [29, 36], [40, 155]], "276834": [[1, 710], [712, 716], [718, 720]], "276950": [[1, 2353]], "276831": [[64, 755], [761, 1072], [1079, 1080], [1087, 1092], [1097, 1100], [1103, 1142], [1145, 1160], [1163, 1166], [1169, 1186], [1189, 1210], [1213, 1234], [1239, 1254], [1259, 1270], [1275, 1280], [1283, 1348], [1351, 1372], [1375, 1691], [1694, 1755], [1758, 2702]], "277076": [[1, 3], [5, 7], [9, 35], [38, 513], [518, 519], [524, 527], [530, 531], [534, 535], [542, 545], [551, 560], [563, 564], [567, 568], [575, 592], [595, 612], [615, 711], [715, 893], [896, 901], [904, 943], [946, 949], [954, 961], [964, 975], [978, 981], [988, 989], [994, 995], [998, 999], [1004, 1020], [1025, 1030], [1033, 1034], [1037, 1037]], "277073": [[1, 90]], "277072": [[1, 253], [256, 466]], "277071": [[1, 82], [90, 178]], "277070": [[1, 309], [311, 1059]], "276935": [[79, 184], [188, 838], [842, 906]], "276870": [[78, 1354], [1356, 3108], [3111, 3258], [3260, 3484]], "277087": [[204, 224], [227, 276], [279, 346], [349, 413], [415, 418], [421, 428], [437, 442], [447, 448], [451, 460], [467, 474], [477, 490], [495, 496], [499, 500], [505, 530], [533, 534], [537, 542], [545, 614], [617, 618], [621, 720], [722, 797], [800, 811], [814, 835], [840, 934], [937, 960], [963, 1016], [1018, 1039], [1041, 1045], [1047, 1078], [1083, 1104], [1106, 1191]]} From d7e64469b4c17c51dd8661f94a9d91228a53d864 Mon Sep 17 00:00:00 2001 From: pgunnell Date: Thu, 2 Nov 2017 09:41:46 +0100 Subject: [PATCH 36/48] Delete processedLumisRun_2016BCD.json --- AnalysisFW/test/processedLumisRun_2016BCD.json | 1 - 1 file changed, 1 deletion(-) delete mode 100644 AnalysisFW/test/processedLumisRun_2016BCD.json diff --git a/AnalysisFW/test/processedLumisRun_2016BCD.json b/AnalysisFW/test/processedLumisRun_2016BCD.json deleted file mode 100644 index 595fbeb7969..00000000000 --- a/AnalysisFW/test/processedLumisRun_2016BCD.json +++ /dev/null @@ -1 +0,0 @@ -{"273402": [[100, 292]], "273403": [[1, 53]], "275000": [[1, 136]], "275001": [[1, 1781], [1786, 2061]], "273404": [[1, 18]], "273405": [[2, 25]], "273409": [[3, 110], [113, 166], [169, 309]], "273406": [[1, 44], [49, 52], [61, 66], [85, 100], [109, 112]], "273158": [[1, 1279]], "273411": [[1, 29]], "273410": [[1, 90]], "274319": [[1, 225]], "274251": [[1, 546]], "274146": [[1, 67]], "274316": [[1, 959]], "274315": [[1, 424]], "274314": [[97, 97], [99, 158]], "275310": [[1, 1929]], "275311": [[1, 1253]], "274421": [[1, 342]], "274420": [[94, 268]], "274422": [[1, 2207]], "275319": [[141, 282]], "273554": [[77, 437]], "273555": [[1, 173]], "273493": [[1, 233]], "273492": [[71, 71], [73, 282], [284, 325], [327, 338]], "273494": [[1, 192]], "274955": [[10, 12], [14, 21], [23, 27], [29, 50], [52, 52], [54, 55], [57, 58], [60, 72], [75, 80], [82, 87], [89, 91]], "275125": [[1, 989]], "275124": [[106, 106], [108, 431]], "274382": [[94, 144]], "274387": [[88, 439]], "274094": [[108, 332]], "274244": [[1, 607]], "273730": [[1, 1814], [1820, 2126]], "274240": [[1, 40], [42, 82]], "273425": [[62, 352], [354, 733]], "274441": [[1, 431]], "275066": [[1, 96]], "275067": [[1, 392]], "274159": [[1, 43]], "274440": [[92, 493]], "275309": [[55, 617]], "275068": [[1, 915]], "273302": [[1, 459]], "274388": [[1, 1820]], "274968": [[1, 1192]], "274969": [[1, 1003]], "273725": [[83, 252], [254, 2545]], "274160": [[1, 207]], "274161": [[1, 516]], "273728": [[1, 100]], "275074": [[1, 442], [444, 647]], "275073": [[1, 115], [130, 133], [138, 139], [142, 143], [150, 159], [162, 163], [166, 203], [206, 207], [210, 211], [214, 225], [228, 231], [234, 235], [238, 247], [250, 344], [347, 374], [377, 467], [470, 517]], "275370": [[90, 94], [96, 108], [112, 119], [121, 123], [125, 135], [138, 139], [141, 144], [146, 154], [157, 159], [161, 161], [163, 164], [166, 171], [173, 176], [178, 178], [180, 188], [190, 207], [209, 231], [233, 238], [241, 364]], "275371": [[1, 22], [28, 569]], "275376": [[1, 2667], [2669, 3096]], "275375": [[127, 1449]], "274241": [[1, 1152], [1161, 1176]], "274971": [[1, 905]], "274970": [[1, 47]], "275284": [[1, 74]], "275282": [[91, 180]], "275283": [[1, 132]], "273448": [[1, 391]], "273449": [[1, 214]], "273446": [[1, 33]], "273447": [[1, 113], [115, 412]], "274200": [[1, 678]], "275291": [[1, 347]], "275290": [[96, 143]], "275293": [[1, 142], [144, 201]], "275292": [[1, 121]], "275059": [[78, 81], [105, 137]], "274999": [[1, 1241]], "274998": [[64, 240], [242, 782]], "273450": [[1, 214], [219, 647]], "274344": [[1, 632]], "274345": [[1, 170]], "274172": [[31, 95]], "275345": [[1, 286], [288, 303], [306, 317], [320, 321], [324, 325], [328, 329], [332, 333], [336, 343], [346, 347], [350, 353]], "275344": [[76, 356]], "273503": [[1, 598]], "273502": [[73, 256], [258, 318], [320, 813], [815, 1064]], "274199": [[1, 623]], "274198": [[81, 191]], "274250": [[1, 593], [596, 649], [653, 701]], "274317": [[1, 3]], "274335": [[60, 1003]], "274442": [[1, 737], [739, 741], [751, 752]], "274337": [[3, 17]], "274336": [[1, 14]], "274339": [[1, 20], [22, 29], [31, 31], [36, 92]], "274338": [[1, 698]], "275337": [[1, 427]], "275338": [[1, 520]], "274283": [[2, 19]], "274284": [[1, 207], [210, 210]], "274286": [[1, 10], [17, 27], [30, 31], [38, 41], [44, 45], [66, 67], [72, 73], [86, 91], [102, 103], [107, 110], [127, 128], [133, 138], [141, 142], [149, 150], [153, 154]], "275782": [[1, 131], [133, 762]], "276092": [[74, 149]], "275767": [[1, 4]], "275761": [[1, 9]], "276097": [[1, 507]], "275931": [[1, 14], [19, 89]], "275886": [[73, 109]], "275912": [[1, 289]], "275913": [[1, 475]], "275911": [[62, 298], [300, 354], [356, 440]], "275657": [[1, 105]], "275918": [[1, 318], [348, 361]], "275847": [[1, 2263]], "275659": [[1, 17]], "275658": [[1, 337]], "275778": [[1, 305]], "275776": [[1, 140]], "275777": [[1, 300]], "275774": [[1, 311], [315, 315]], "275772": [[1, 56]], "275773": [[1, 7]], "275963": [[82, 139], [141, 172]], "275833": [[1, 53], [56, 115], [117, 251]], "275832": [[1, 367]], "275835": [[1, 13]], "275834": [[1, 297]], "275837": [[1, 186], [198, 726]], "275836": [[1, 1163], [1166, 1170], [1184, 1293]], "275890": [[1, 1393]], "275923": [[3, 53], [63, 64], [66, 126]], "275921": [[1, 2], [4, 5], [17, 20]], "275920": [[7, 15], [17, 18], [21, 186], [191, 192], [195, 196], [205, 210], [213, 216], [219, 224], [227, 234], [237, 240], [247, 248], [251, 252], [255, 264], [267, 270], [275, 298], [301, 460]], "276584": [[1, 2]], "276318": [[3, 103], [106, 570]], "276586": [[2, 658], [680, 773]], "276587": [[1, 1006]], "276581": [[79, 444]], "276582": [[1, 871]], "276585": [[1, 238], [241, 242], [245, 246]], "276542": [[74, 857]], "276543": [[1, 638], [643, 952]], "276315": [[40, 175], [178, 217]], "276545": [[2, 110], [117, 213]], "276454": [[1, 527]], "276808": [[1, 875]], "276807": [[66, 220]], "276384": [[2, 1117]], "276437": [[63, 224], [227, 1074], [1076, 2190]], "276458": [[1, 341]], "276659": [[1, 127], [129, 252]], "276655": [[1, 593], [595, 1106]], "276776": [[1, 1823]], "276775": [[96, 1260]], "276653": [[72, 550]], "276361": [[1, 161], [169, 208], [210, 800], [802, 833]], "276363": [[1, 140], [142, 238], [242, 1482]], "276544": [[2, 161]], "276794": [[1, 885]], "276317": [[3, 138]], "276583": [[1, 52]], "276810": [[1, 287]], "276811": [[1, 1270], [1272, 2563]], "276527": [[1, 214]], "276355": [[1, 33]], "276525": [[88, 469], [471, 1606], [1626, 2893]], "276528": [[4, 394]], "276495": [[87, 268]], "276501": [[4, 221], [223, 2547]], "276502": [[2, 741]]} From 4c6f1eca31290c5ddb37ef873bda500258a8b29d Mon Sep 17 00:00:00 2001 From: pgunnell Date: Thu, 2 Nov 2017 09:41:56 +0100 Subject: [PATCH 37/48] Delete .DS_Store --- AnalysisFW/test/.DS_Store | Bin 8196 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 AnalysisFW/test/.DS_Store diff --git a/AnalysisFW/test/.DS_Store b/AnalysisFW/test/.DS_Store deleted file mode 100644 index 38277c3ec89f477792afe7eae0e3cb2a398be633..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8196 zcmeHMOKclO7@p5fo83(x<0K`nLyOfYY6xj+_mL7P#YvMs6rx7t;j{@gYwxyQvDr1= zbyBDz1rP`jqT+D@2_#yehyoG^1cC!XLM@^fkSatFaN))Y2{^!se|FYY>b3_ifas1j z^UeJ8|Fg5-eBSY_8Dr?L7#YSAj4_3>K;A&bHInET`KlBPEz1Z&@ysny?axBVwmknT z@5m4_5HS!j5HS!j5HavyV1V{)k(BG~`?5DGBL*S{Zb$~i^C3l9U^c`BiNT|Tir@%9 zSV!g{QJsqlVJgIIhzk;_hZ1Bcp$tWM#DEMZdn)wHhPWV6hBJhR4}@1nctSyNbs9ev zxHDuWMrFi6#K6@I$g_KQVa_WR?4{@Tbb1l7Wp&F})GMmiAU-^<-8XvNog4LazvA`l z<*A@$8D=4@kLdpKYJJRg?aOt&FkzW73;l?p(iHaSU&IRF0Rk z4F7nZuN^6yvlKd_JLZJtSq00s{D%}(eDZwV$&=f9db?8Fc5I*TN}bGPdNW!M+j@Gq2mIz!Mbg4c0_U!bLG2?bo$#R zTqFjXwY_=XDCTvrxA>p6Z0g0e%pS2P{Na*iD)A|2m4YMEs<9y_9rIr@w#qgoQ{RQ`c7ZP56` zt|5GkpeNCiSg$Bk!oH_$QYp<^DzQ=Jx-#a`G~^KN+9s8I>evIcb~3b6>r%L(j@x>{ zw54f_mQnbSnwypMNaJ>`M~S0Loh-UDGc-d_ntKy>D*OxOh`9DWy5}D(nGRi^-?jVh zY)c|hdw12lJ|z7648t@OMQO`+$R$#>*q7`g`-&~H@7VY32lg}jmHozk2cV$=tFRhPxEbql3sPuDH?|;yt+*Y1 z=*IvCF^mc1a2QiCFarlAJctE6g;RJ5ui+ft!Mk`5AL1i9r&v{h`@%VffX}ER1sHxA zW4UVyFge(y?fZ8GxVTctF5cMGyf)Nf-{p0zS-Pbv3WOt-5h$jrh(ME9%J3!n%O!fwvG*rG^_L3Tf zj(MHz?bS$yLn>b(dv|Nu;Jd?_Y_}&>_3z2-G>PnElGsJ|HT#DB$bMqKus=vx^@yVd z3AB>1HeeGv(23iy89msEUfh9QB&)sHj{_LO7{*CnlO(Vr3G672!9p1xDwxFyJc38@ zIG(_hcn;6w1-yt?@M?|F_SXpQ?3L}Pbwe^B_I^qUasD5?{`>#HDJmicA_o4S44`gc zbfBN^t@^v9_BO>?J4N|^$|4EB1&Kij6~S?wFgT7AUjD<7>M3#+G1(9oB$9>FKmH;> Q{3ea||A70bxN#Zy3vtKC00000 From 4e6387ea524d27b4b565b24a665ca00ad36bed2f Mon Sep 17 00:00:00 2001 From: pgunnell Date: Thu, 2 Nov 2017 09:41:59 +0100 Subject: [PATCH 38/48] Delete ._.DS_Store --- AnalysisFW/test/._.DS_Store | Bin 4096 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 AnalysisFW/test/._.DS_Store diff --git a/AnalysisFW/test/._.DS_Store b/AnalysisFW/test/._.DS_Store deleted file mode 100644 index c35f5c288a879aa0f73c9c514c470f48750880ea..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4096 zcmZQz6=P>$Vqox1Ojhs@R)|o50+1L3ClDJkFz{^v(m+1nBL)UWIk*Y|peR=07!nc$ zl;DHtV5q>VXjE`C1V%$(Gz3ONU^E0qLtr!nMnhmU1V%$(Gz3ONU^E1%90H6$^FSC3 z Date: Thu, 2 Nov 2017 09:42:01 +0100 Subject: [PATCH 39/48] Delete processedLumis_2016BCD.json --- AnalysisFW/test/processedLumis_2016BCD.json | 1 - 1 file changed, 1 deletion(-) delete mode 100644 AnalysisFW/test/processedLumis_2016BCD.json diff --git a/AnalysisFW/test/processedLumis_2016BCD.json b/AnalysisFW/test/processedLumis_2016BCD.json deleted file mode 100644 index eed2c609859..00000000000 --- a/AnalysisFW/test/processedLumis_2016BCD.json +++ /dev/null @@ -1 +0,0 @@ -{"273402": [[100, 292]], "273403": [[1, 53]], "275000": [[1, 136]], "275001": [[1, 1781], [1786, 2061]], "273404": [[1, 18]], "273405": [[2, 25]], "273408": [[1, 6]], "273409": [[1, 309]], "273406": [[1, 112]], "273158": [[1, 1279]], "273411": [[1, 29]], "273410": [[1, 90]], "274319": [[1, 225]], "274251": [[1, 546]], "274146": [[1, 67]], "274316": [[1, 959]], "274315": [[1, 424]], "274314": [[97, 97], [99, 158]], "275310": [[1, 1929]], "275311": [[1, 1253]], "274421": [[1, 342]], "274420": [[94, 268]], "274422": [[1, 2207]], "275319": [[141, 282]], "273554": [[77, 437]], "273555": [[1, 173]], "273493": [[1, 233]], "273492": [[71, 71], [73, 282], [284, 325], [327, 338]], "273494": [[1, 192]], "274955": [[1, 91]], "274954": [[37, 37], [39, 57]], "275125": [[1, 989]], "275124": [[106, 106], [108, 431]], "274382": [[94, 144]], "274387": [[88, 439]], "274094": [[108, 332]], "274244": [[1, 607]], "273730": [[1, 1814], [1820, 2126]], "274240": [[1, 40], [42, 82]], "273425": [[62, 352], [354, 733]], "274441": [[1, 431]], "275066": [[1, 96]], "275067": [[1, 392]], "274159": [[1, 43]], "274440": [[92, 493]], "275309": [[55, 617]], "275068": [[1, 915]], "273302": [[1, 459]], "274388": [[1, 1820]], "274968": [[1, 1192]], "274969": [[1, 1003]], "273725": [[83, 252], [254, 2545]], "274160": [[1, 207]], "274161": [[1, 516]], "273728": [[1, 100]], "275074": [[1, 442], [444, 647]], "275073": [[1, 517]], "275370": [[81, 365]], "275371": [[1, 22], [28, 569]], "275376": [[1, 2667], [2669, 3096]], "275375": [[127, 1449]], "274241": [[1, 1152], [1161, 1176]], "274971": [[1, 905]], "274970": [[1, 47]], "275284": [[1, 74]], "275282": [[91, 180]], "275283": [[1, 132]], "273448": [[1, 391]], "273449": [[1, 214]], "273446": [[1, 33]], "273447": [[1, 113], [115, 412]], "273502": [[73, 256], [258, 318], [320, 813], [815, 1064]], "275291": [[1, 347]], "275290": [[96, 143]], "275293": [[1, 142], [144, 201]], "275292": [[1, 121]], "275059": [[78, 81], [105, 137]], "274999": [[1, 1241]], "274998": [[64, 782]], "273450": [[1, 214], [219, 647]], "274344": [[1, 632]], "274345": [[1, 170]], "274172": [[31, 95]], "275345": [[1, 353]], "275344": [[76, 356]], "273503": [[1, 598]], "274200": [[1, 678]], "274199": [[1, 623]], "274198": [[81, 191]], "274250": [[1, 594], [599, 647], [652, 701]], "274317": [[1, 3]], "274335": [[60, 1003]], "274442": [[1, 752]], "274337": [[3, 17]], "274336": [[1, 14]], "274339": [[1, 24], [26, 26], [28, 28], [31, 31], [33, 33], [35, 93]], "274338": [[1, 698]], "275337": [[1, 427]], "275338": [[1, 520]], "274283": [[2, 19]], "274284": [[1, 210]], "274286": [[1, 34], [51, 78], [83, 86], [99, 102], [111, 134], [139, 146], [151, 154]], "275782": [[1, 131], [133, 762]], "276092": [[74, 149]], "275767": [[1, 4]], "275761": [[1, 9]], "276097": [[1, 507]], "276283": [[3, 1087]], "276282": [[75, 534], [537, 1142]], "275931": [[1, 14], [19, 89]], "275886": [[73, 109]], "275912": [[1, 289]], "275913": [[1, 475]], "275911": [[62, 298], [300, 354], [356, 440]], "275657": [[1, 105]], "275918": [[1, 318], [348, 361]], "275847": [[1, 2263]], "275659": [[1, 17]], "275658": [[1, 337]], "275778": [[1, 305]], "275776": [[1, 140]], "275777": [[1, 300]], "275774": [[1, 311], [315, 315]], "276244": [[3, 1202]], "276243": [[1, 15], [18, 480], [482, 611]], "276242": [[1, 7], [18, 61], [72, 1664]], "275773": [[1, 7]], "275835": [[1, 13]], "275963": [[82, 139], [141, 172]], "275833": [[1, 53], [56, 115], [117, 251]], "275832": [[1, 367]], "275772": [[1, 56]], "275834": [[1, 297]], "275837": [[1, 186], [198, 726]], "275836": [[1, 429], [431, 1163], [1166, 1170], [1184, 1293]], "275890": [[1, 1393]], "275923": [[3, 53], [63, 64], [66, 126]], "275921": [[1, 2], [4, 5], [17, 20]], "275920": [[5, 463]], "276584": [[1, 2]], "276318": [[3, 103], [106, 570]], "276586": [[2, 658], [680, 773]], "276587": [[1, 1006]], "276581": [[79, 444]], "276582": [[1, 871]], "276585": [[1, 238], [241, 242], [245, 246]], "276542": [[74, 857]], "276543": [[1, 638], [643, 952]], "276315": [[40, 175], [178, 217]], "276545": [[2, 110], [117, 213]], "276454": [[1, 527]], "276808": [[1, 875]], "276807": [[66, 220]], "276384": [[2, 1117]], "276437": [[63, 224], [227, 1074], [1076, 2190]], "276458": [[1, 341]], "276659": [[1, 127], [129, 252]], "276655": [[1, 593], [595, 1106]], "276776": [[1, 1823]], "276775": [[96, 1260]], "276653": [[72, 550]], "276361": [[1, 161], [169, 208], [210, 800], [802, 833]], "276363": [[1, 140], [142, 238], [242, 1482]], "276544": [[2, 161]], "276794": [[1, 885]], "276317": [[3, 138]], "276583": [[1, 52]], "276810": [[1, 287]], "276811": [[1, 1270], [1272, 2563]], "276527": [[1, 214]], "276355": [[1, 33]], "276525": [[88, 469], [471, 1606], [1626, 2893]], "276528": [[4, 394]], "276495": [[87, 268]], "276501": [[4, 221], [223, 2547]], "276502": [[2, 741]]} \ No newline at end of file From 83718edc65881110036e0f4cc234bb6ea4f8e2ee Mon Sep 17 00:00:00 2001 From: pgunnell Date: Thu, 2 Nov 2017 09:42:32 +0100 Subject: [PATCH 40/48] Delete Analysis_Template_MC.cc --- AnalysisFW/plugins/Analysis_Template_MC.cc | 2281 -------------------- 1 file changed, 2281 deletions(-) delete mode 100644 AnalysisFW/plugins/Analysis_Template_MC.cc diff --git a/AnalysisFW/plugins/Analysis_Template_MC.cc b/AnalysisFW/plugins/Analysis_Template_MC.cc deleted file mode 100644 index 87b2023978a..00000000000 --- a/AnalysisFW/plugins/Analysis_Template_MC.cc +++ /dev/null @@ -1,2281 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "TMath.h" -#include "TRandom.h" - -#include "parsePileUpJSON2.h" -#include "SMPJ/AnalysisFW/plugins/Analysis_Template_MC.h" -#include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/MakerMacros.h" - -//#include "../Unfolding/RooUnfold-1.1.1/src/RooUnfold.h" -//#include "../Unfolding/RooUnfold-1.1.1/src/RooUnfoldResponse.h" - -using namespace std; - -//---------------------------- Constructor Of The Class TriggerTurnOn -------------------------- // -Analysis_Template_MC::Analysis_Template_MC(edm::ParameterSet const& cfg) -{ - mFileName = cfg.getParameter> ("filename"); - mTreeName = cfg.getParameter ("treename"); - mDirName = cfg.getParameter ("dirname"); - - mMinPt = cfg.getParameter ("minPt"); - mYMax = cfg.getParameter ("ymax"); - mJetID = cfg.getParameter ("JetID"); - - mprintOk = cfg.getParameter ("printOk"); - - // mIsMCarlo = cfg.getUntrackedParameter ("isMCarlo"); - // mJECUncSrcNames = cfg.getParameter > ("jecUncSrcNames"); - //jecs = new JECs(mIsMCarlo, mGlobalTag, mjettype); - mGlobalTag = cfg.getParameter ("pseudoglobaltag"); - mjettype = cfg.getParameter ("jettype"); - - mIsMCarlo = cfg.getUntrackedParameter ("isMCarlo"); - mJECUncSrcNames = cfg.getParameter > ("jecUncSrcNames"); - mJECUncSrc = cfg.getParameter ("jecUncSrc"); - - mMCSlice= cfg.getParameter("MCSlice"); - mPUReweighting= cfg.getUntrackedParameter("PUReweighting"); - mLowPileUp= cfg.getUntrackedParameter("LowPileUp"); - -} - -//------------------------------ Declaration Of The Function beginjob() ------------------------// -void Analysis_Template_MC::beginJob() - { - - //for(unsigned i=0;iGet(mDirName.c_str()); - //TTree* mTreeFirst=(TTree*)mDir->Get(mTreeName.c_str()); - //mTree.push_back(mTreeFirst) - //Event = new QCDEvent(); - //TBranch *branch = mTree[i]->GetBranch("events"); - //branch->SetAddress(&Event); - //} - - //jecs = new JECs(mIsMCarlo, mGlobalTag, mjettype,mJECUncSrcNames); - - //Pt binning - double Ptbinning[81] = {0, 1, 5, 6, 8, 10, 12, 15, 18, 21, 24, 28, 32, 37, 43, 49, 56, 64, 74, 84,97, 114, 133, 153, 174, 196, 220, 245, 272, 300, 330, 362, 395, 430, 468,507, 548, 592, 638, 686, 737, 790, 846, 905, 967,1032, 1101, 1172, 1248, 1327, 1410, 1497, 1588, 1684, 1784, 1890, 2000,2116, 2238, 2366, 2500, 2640, 2787, 2941, 3103, 3273, 3450, 3637, 3832,4037, 4252, 4477, 4713, 4961, 5220, 5492, 5777, 6076, 6389, 6717, 7000}; - - int Ptbins=80; - - //------------------ Histogram Booking --------------------------- // - num_of_Vtx = fs->make("num_of_Vtx","num_of_Vtx",100,0.,100.); - num_of_VtxGood = fs->make("num_of_VtxGood","num_of_VtxGood",100,0.,100.); - - mc_pthat = fs->make("mc_pthat","mc_pthat",200,0.,2000.); - mc_pthat_weighted = fs->make("mc_pthat_weighted","mc_pthat_weighted",100,0.,2000.); - mc_pthat_weighted->Sumw2(); - - pt0_GENJet = fs->make("pt0_GENJet","pt0_GENJet",Ptbins,Ptbinning); pt0_GENJet->Sumw2(); - pt1_GENJet = fs->make("pt1_GENJet","pt1_GENJet",Ptbins,Ptbinning); pt1_GENJet->Sumw2(); - y0_GENJet = fs->make("y0_GENJet","y0_GENJet",60,-5.,5.); y0_GENJet->Sumw2(); - y1_GENJet = fs->make("y1_GENJet","y1_GENJet",60,-5.,5.); y1_GENJet->Sumw2(); - phi0_GENJet = fs->make("phi0_GENJet","phi0_GENJet",60, -TMath::Pi(),TMath::Pi()); phi0_GENJet->Sumw2(); - phi1_GENJet = fs->make("phi1_GENJet","phi1_GENJet",60, -TMath::Pi(),TMath::Pi()); phi1_GENJet->Sumw2(); - - pt0_DETJet = fs->make("pt0_DETJet","pt0_DETJet",Ptbins,Ptbinning); pt0_DETJet->Sumw2(); - pt1_DETJet = fs->make("pt1_DETJet","pt1_DETJet",Ptbins,Ptbinning); pt1_DETJet->Sumw2(); - pt0_DETJetUncor = fs->make("pt0_DETJetUncor","pt0_DETJetUncor",Ptbins,Ptbinning); pt0_DETJetUncor->Sumw2(); - pt1_DETJetUncor = fs->make("pt1_DETJetUncor","pt1_DETJetUncor",Ptbins,Ptbinning); pt1_DETJetUncor->Sumw2(); - y0_DETJet = fs->make("y0_DETJet","y0_DETJet",60,-5.,5.); y0_DETJet->Sumw2(); - y1_DETJet = fs->make("y1_DETJet","y1_DETJet",60,-5.,5.); y1_DETJet->Sumw2(); - phi0_DETJet = fs->make("phi0_DETJet","phi0_DETJet",60, -TMath::Pi(),TMath::Pi()); phi0_DETJet->Sumw2(); - phi1_DETJet = fs->make("phi1_DETJet","phi1_DETJet",60, -TMath::Pi(),TMath::Pi()); phi1_DETJet->Sumw2(); - - Multiplicity_DETJet = fs->make("Multiplicity_DETJet","Multiplicity_DETJet",21, -0.5,20.5); Multiplicity_DETJet->Sumw2(); - Multiplicity_GENJet = fs->make("Multiplicity_GENJet","Multiplicity_GENJet",21, -0.5,20.5); Multiplicity_GENJet->Sumw2(); - - pt0_DETInclJet = fs->make("pt0_DETInclJet","pt0_DETInclJet",Ptbins,Ptbinning); pt0_DETInclJet->Sumw2(); - pt0_DETInclJetUncor = fs->make("pt0_DETInclJetUncor","pt0_DETInclJetUncor",Ptbins,Ptbinning); pt0_DETInclJetUncor->Sumw2(); - y0_DETInclJet = fs->make("y0_DETInclJet","y0_DETInclJet",60,-5.,5.); y0_DETInclJet->Sumw2(); - phi0_DETInclJet = fs->make("phi0_DETInclJet","phi0_DETInclJet",60, -TMath::Pi(),TMath::Pi()); phi0_DETInclJet->Sumw2(); - - PF_MatchedInclusiveJets = fs->make("PF_MatchedInclusiveJets","PF_MatchedInclusiveJets",Ptbins,Ptbinning); PF_MatchedInclusiveJets->Sumw2(); - Gen_MatchedInclusiveJets = fs->make("Gen_MatchedInclusiveJets","Gen_MatchedInclusiveJets",Ptbins,Ptbinning); Gen_MatchedInclusiveJets->Sumw2(); - TwoD_MatchedInclusiveJets = fs->make("TwoD_MatchedInclusiveJets","TwoD_MatchedInclusiveJets",Ptbins,Ptbinning,Ptbins,Ptbinning); TwoD_MatchedInclusiveJets->Sumw2(); - PF_FakeInclusiveJets = fs->make("PF_FakeInclusiveJets","PF_FakeInclusiveJets",Ptbins,Ptbinning); PF_FakeInclusiveJets->Sumw2(); - Gen_MissInclusiveJets = fs->make("Gen_MissInclusiveJets","Gen_MissInclusiveJets",Ptbins,Ptbinning); Gen_MissInclusiveJets->Sumw2(); - - PileUpVSVertex = fs->make("PileUpVSVertex","PileUpVSVertex",31,-0.5,30.5,31,-0.5,30.5); PileUpVSVertex->Sumw2(); - - DeltaR_Jets = fs->make("DeltaR_Jets","DeltaR_Jets",20, 0,10); DeltaR_Jets->Sumw2(); - - AcceptancePtJets= fs->make("AcceptancePtJets","AcceptancePtJets",Ptbins,Ptbinning); AcceptancePtJets->Sumw2(); - PurityPtJets= fs->make("PurityPtJets","PurityPtJets",Ptbins,Ptbinning); PurityPtJets->Sumw2(); - BackgroundPtJets= fs->make("BackgroundPtJets","BackgroundPtJets",Ptbins,Ptbinning); BackgroundPtJets->Sumw2(); - StabilityPtJets= fs->make("StabilityPtJets","StabilityPtJets",Ptbins,Ptbinning); StabilityPtJets->Sumw2(); - - AcceptancePtJets_1bin= fs->make("AcceptancePtJets_1bin","AcceptancePtJets_1bin",Ptbins,Ptbinning); - PurityPtJets_1bin= fs->make("PurityPtJets_1bin","PurityPtJets_1bin",Ptbins,Ptbinning); - AcceptancePtJets_2bin= fs->make("AcceptancePtJets_2bin","AcceptancePtJets_2bin",Ptbins,Ptbinning); - PurityPtJets_2bin= fs->make("PurityPtJets_2bin","PurityPtJets_2bin",Ptbins,Ptbinning); - AcceptancePtJets_3bin= fs->make("AcceptancePtJets_3bin","AcceptancePtJets_3bin",Ptbins,Ptbinning); - PurityPtJets_3bin= fs->make("PurityPtJets_3bin","PurityPtJets_3bin",Ptbins,Ptbinning); - AcceptancePtJets_4bin= fs->make("AcceptancePtJets_4bin","AcceptancePtJets_4bin",Ptbins,Ptbinning); - PurityPtJets_4bin= fs->make("PurityPtJets_4bin","PurityPtJets_4bin",Ptbins,Ptbinning); - AcceptancePtJets_5bin= fs->make("AcceptancePtJets_5bin","AcceptancePtJets_5bin",Ptbins,Ptbinning); - PurityPtJets_5bin= fs->make("PurityPtJets_5bin","PurityPtJets_5bin",Ptbins,Ptbinning); - AcceptancePtJets_6bin= fs->make("AcceptancePtJets_6bin","AcceptancePtJets_6bin",Ptbins,Ptbinning); - PurityPtJets_6bin= fs->make("PurityPtJets_6bin","PurityPtJets_6bin",Ptbins,Ptbinning); - AcceptancePtJets_7bin= fs->make("AcceptancePtJets_7bin","AcceptancePtJets_7bin",Ptbins,Ptbinning); - PurityPtJets_7bin= fs->make("PurityPtJets_7bin","PurityPtJets_7bin",Ptbins,Ptbinning); - - BackgroundPtJets_1bin= fs->make("BackgroundPtJets_1bin","BackgroundPtJets_1bin",Ptbins,Ptbinning); - StabilityPtJets_1bin= fs->make("StabilityPtJets_1bin","StabilityPtJets_1bin",Ptbins,Ptbinning); - BackgroundPtJets_2bin= fs->make("BackgroundPtJets_2bin","BackgroundPtJets_2bin",Ptbins,Ptbinning); - StabilityPtJets_2bin= fs->make("StabilityPtJets_2bin","StabilityPtJets_2bin",Ptbins,Ptbinning); - BackgroundPtJets_3bin= fs->make("BackgroundPtJets_3bin","BackgroundPtJets_3bin",Ptbins,Ptbinning); - StabilityPtJets_3bin= fs->make("StabilityPtJets_3bin","StabilityPtJets_3bin",Ptbins,Ptbinning); - BackgroundPtJets_4bin= fs->make("BackgroundPtJets_4bin","BackgroundPtJets_4bin",Ptbins,Ptbinning); - StabilityPtJets_4bin= fs->make("StabilityPtJets_4bin","StabilityPtJets_4bin",Ptbins,Ptbinning); - BackgroundPtJets_5bin= fs->make("BackgroundPtJets_5bin","BackgroundPtJets_5bin",Ptbins,Ptbinning); - StabilityPtJets_5bin= fs->make("StabilityPtJets_5bin","StabilityPtJets_5bin",Ptbins,Ptbinning); - BackgroundPtJets_6bin= fs->make("BackgroundPtJets_6bin","BackgroundPtJets_6bin",Ptbins,Ptbinning); - StabilityPtJets_6bin= fs->make("StabilityPtJets_6bin","StabilityPtJets_6bin",Ptbins,Ptbinning); - BackgroundPtJets_7bin= fs->make("BackgroundPtJets_7bin","BackgroundPtJets_7bin",Ptbins,Ptbinning); - StabilityPtJets_7bin= fs->make("StabilityPtJets_7bin","StabilityPtJets_7bin",Ptbins,Ptbinning); - - pt_DETInclJet_1bin = fs->make("pt_DETInclJet_1bin","pt_DETInclJet_1bin",Ptbins,Ptbinning); pt_DETInclJet_1bin->Sumw2(); - pt_DETInclJet_2bin = fs->make("pt_DETInclJet_2bin","pt_DETInclJet_2bin",Ptbins,Ptbinning); pt_DETInclJet_2bin->Sumw2(); - pt_DETInclJet_3bin = fs->make("pt_DETInclJet_3bin","pt_DETInclJet_3bin",Ptbins,Ptbinning); pt_DETInclJet_3bin->Sumw2(); - pt_DETInclJet_4bin = fs->make("pt_DETInclJet_4bin","pt_DETInclJet_4bin",Ptbins,Ptbinning); pt_DETInclJet_4bin->Sumw2(); - pt_DETInclJet_5bin = fs->make("pt_DETInclJet_5bin","pt_DETInclJet_5bin",Ptbins,Ptbinning); pt_DETInclJet_5bin->Sumw2(); - pt_DETInclJet_6bin = fs->make("pt_DETInclJet_6bin","pt_DETInclJet_6bin",Ptbins,Ptbinning); pt_DETInclJet_6bin->Sumw2(); - pt_DETInclJet_7bin = fs->make("pt_DETInclJet_7bin","pt_DETInclJet_7bin",Ptbins,Ptbinning); pt_DETInclJet_7bin->Sumw2(); - - pt_DETInclJetCrossSectNorm_1bin = fs->make("pt_DETInclJetCrossSectNorm_1bin","pt_DETInclJetCrossSectNorm_1bin",Ptbins,Ptbinning); pt_DETInclJetCrossSectNorm_1bin->Sumw2(); - pt_DETInclJetCrossSectNorm_2bin = fs->make("pt_DETInclJetCrossSectNorm_2bin","pt_DETInclJetCrossSectNorm_2bin",Ptbins,Ptbinning); pt_DETInclJetCrossSectNorm_2bin->Sumw2(); - pt_DETInclJetCrossSectNorm_3bin = fs->make("pt_DETInclJetCrossSectNorm_3bin","pt_DETInclJetCrossSectNorm_3bin",Ptbins,Ptbinning); pt_DETInclJetCrossSectNorm_3bin->Sumw2(); - pt_DETInclJetCrossSectNorm_4bin = fs->make("pt_DETInclJetCrossSectNorm_4bin","pt_DETInclJetCrossSectNorm_4bin",Ptbins,Ptbinning); pt_DETInclJetCrossSectNorm_4bin->Sumw2(); - pt_DETInclJetCrossSectNorm_5bin = fs->make("pt_DETInclJetCrossSectNorm_5bin","pt_DETInclJetCrossSectNorm_5bin",Ptbins,Ptbinning); pt_DETInclJetCrossSectNorm_5bin->Sumw2(); - pt_DETInclJetCrossSectNorm_6bin = fs->make("pt_DETInclJetCrossSectNorm_6bin","pt_DETInclJetCrossSectNorm_6bin",Ptbins,Ptbinning); pt_DETInclJetCrossSectNorm_6bin->Sumw2(); - pt_DETInclJetCrossSectNorm_7bin = fs->make("pt_DETInclJetCrossSectNorm_7bin","pt_DETInclJetCrossSectNorm_7bin",Ptbins,Ptbinning); pt_DETInclJetCrossSectNorm_7bin->Sumw2(); - - pt_DETInclJet60_1bin = fs->make("pt_DETInclJet60_1bin","pt_DETInclJet60_1bin",Ptbins,Ptbinning); pt_DETInclJet60_1bin->Sumw2(); - pt_DETInclJet60_2bin = fs->make("pt_DETInclJet60_2bin","pt_DETInclJet60_2bin",Ptbins,Ptbinning); pt_DETInclJet60_2bin->Sumw2(); - pt_DETInclJet60_3bin = fs->make("pt_DETInclJet60_3bin","pt_DETInclJet60_3bin",Ptbins,Ptbinning); pt_DETInclJet60_3bin->Sumw2(); - pt_DETInclJet60_4bin = fs->make("pt_DETInclJet60_4bin","pt_DETInclJet60_4bin",Ptbins,Ptbinning); pt_DETInclJet60_4bin->Sumw2(); - pt_DETInclJet60_5bin = fs->make("pt_DETInclJet60_5bin","pt_DETInclJet60_5bin",Ptbins,Ptbinning); pt_DETInclJet60_5bin->Sumw2(); - pt_DETInclJet60_6bin = fs->make("pt_DETInclJet60_6bin","pt_DETInclJet60_6bin",Ptbins,Ptbinning); pt_DETInclJet60_6bin->Sumw2(); - pt_DETInclJet60_7bin = fs->make("pt_DETInclJet60_7bin","pt_DETInclJet60_7bin",Ptbins,Ptbinning); pt_DETInclJet60_7bin->Sumw2(); - - pt_DETInclJet80_1bin = fs->make("pt_DETInclJet80_1bin","pt_DETInclJet80_1bin",Ptbins,Ptbinning); pt_DETInclJet80_1bin->Sumw2(); - pt_DETInclJet80_2bin = fs->make("pt_DETInclJet80_2bin","pt_DETInclJet80_2bin",Ptbins,Ptbinning); pt_DETInclJet80_2bin->Sumw2(); - pt_DETInclJet80_3bin = fs->make("pt_DETInclJet80_3bin","pt_DETInclJet80_3bin",Ptbins,Ptbinning); pt_DETInclJet80_3bin->Sumw2(); - pt_DETInclJet80_4bin = fs->make("pt_DETInclJet80_4bin","pt_DETInclJet80_4bin",Ptbins,Ptbinning); pt_DETInclJet80_4bin->Sumw2(); - pt_DETInclJet80_5bin = fs->make("pt_DETInclJet80_5bin","pt_DETInclJet80_5bin",Ptbins,Ptbinning); pt_DETInclJet80_5bin->Sumw2(); - pt_DETInclJet80_6bin = fs->make("pt_DETInclJet80_6bin","pt_DETInclJet80_6bin",Ptbins,Ptbinning); pt_DETInclJet80_6bin->Sumw2(); - pt_DETInclJet80_7bin = fs->make("pt_DETInclJet80_7bin","pt_DETInclJet80_7bin",Ptbins,Ptbinning); pt_DETInclJet80_7bin->Sumw2(); - - pt_DETInclJet140_1bin = fs->make("pt_DETInclJet140_1bin","pt_DETInclJet140_1bin",Ptbins,Ptbinning); pt_DETInclJet140_1bin->Sumw2(); - pt_DETInclJet140_2bin = fs->make("pt_DETInclJet140_2bin","pt_DETInclJet140_2bin",Ptbins,Ptbinning); pt_DETInclJet140_2bin->Sumw2(); - pt_DETInclJet140_3bin = fs->make("pt_DETInclJet140_3bin","pt_DETInclJet140_3bin",Ptbins,Ptbinning); pt_DETInclJet140_3bin->Sumw2(); - pt_DETInclJet140_4bin = fs->make("pt_DETInclJet140_4bin","pt_DETInclJet140_4bin",Ptbins,Ptbinning); pt_DETInclJet140_4bin->Sumw2(); - pt_DETInclJet140_5bin = fs->make("pt_DETInclJet140_5bin","pt_DETInclJet140_5bin",Ptbins,Ptbinning); pt_DETInclJet140_5bin->Sumw2(); - pt_DETInclJet140_6bin = fs->make("pt_DETInclJet140_6bin","pt_DETInclJet140_6bin",Ptbins,Ptbinning); pt_DETInclJet140_6bin->Sumw2(); - pt_DETInclJet140_7bin = fs->make("pt_DETInclJet140_7bin","pt_DETInclJet140_7bin",Ptbins,Ptbinning); pt_DETInclJet140_7bin->Sumw2(); - - pt_DETInclJet200_1bin = fs->make("pt_DETInclJet200_1bin","pt_DETInclJet200_1bin",Ptbins,Ptbinning); pt_DETInclJet200_1bin->Sumw2(); - pt_DETInclJet200_2bin = fs->make("pt_DETInclJet200_2bin","pt_DETInclJet200_2bin",Ptbins,Ptbinning); pt_DETInclJet200_2bin->Sumw2(); - pt_DETInclJet200_3bin = fs->make("pt_DETInclJet200_3bin","pt_DETInclJet200_3bin",Ptbins,Ptbinning); pt_DETInclJet200_3bin->Sumw2(); - pt_DETInclJet200_4bin = fs->make("pt_DETInclJet200_4bin","pt_DETInclJet200_4bin",Ptbins,Ptbinning); pt_DETInclJet200_4bin->Sumw2(); - pt_DETInclJet200_5bin = fs->make("pt_DETInclJet200_5bin","pt_DETInclJet200_5bin",Ptbins,Ptbinning); pt_DETInclJet200_5bin->Sumw2(); - pt_DETInclJet200_6bin = fs->make("pt_DETInclJet200_6bin","pt_DETInclJet200_6bin",Ptbins,Ptbinning); pt_DETInclJet200_6bin->Sumw2(); - pt_DETInclJet200_7bin = fs->make("pt_DETInclJet200_7bin","pt_DETInclJet200_7bin",Ptbins,Ptbinning); pt_DETInclJet200_7bin->Sumw2(); - - pt_DETInclJet260_1bin = fs->make("pt_DETInclJet260_1bin","pt_DETInclJet260_1bin",Ptbins,Ptbinning); pt_DETInclJet260_1bin->Sumw2(); - pt_DETInclJet260_2bin = fs->make("pt_DETInclJet260_2bin","pt_DETInclJet260_2bin",Ptbins,Ptbinning); pt_DETInclJet260_2bin->Sumw2(); - pt_DETInclJet260_3bin = fs->make("pt_DETInclJet260_3bin","pt_DETInclJet260_3bin",Ptbins,Ptbinning); pt_DETInclJet260_3bin->Sumw2(); - pt_DETInclJet260_4bin = fs->make("pt_DETInclJet260_4bin","pt_DETInclJet260_4bin",Ptbins,Ptbinning); pt_DETInclJet260_4bin->Sumw2(); - pt_DETInclJet260_5bin = fs->make("pt_DETInclJet260_5bin","pt_DETInclJet260_5bin",Ptbins,Ptbinning); pt_DETInclJet260_5bin->Sumw2(); - pt_DETInclJet260_6bin = fs->make("pt_DETInclJet260_6bin","pt_DETInclJet260_6bin",Ptbins,Ptbinning); pt_DETInclJet260_6bin->Sumw2(); - pt_DETInclJet260_7bin = fs->make("pt_DETInclJet260_7bin","pt_DETInclJet260_7bin",Ptbins,Ptbinning); pt_DETInclJet260_7bin->Sumw2(); - - pt_DETInclJet320_1bin = fs->make("pt_DETInclJet320_1bin","pt_DETInclJet320_1bin",Ptbins,Ptbinning); pt_DETInclJet320_1bin->Sumw2(); - pt_DETInclJet320_2bin = fs->make("pt_DETInclJet320_2bin","pt_DETInclJet320_2bin",Ptbins,Ptbinning); pt_DETInclJet320_2bin->Sumw2(); - pt_DETInclJet320_3bin = fs->make("pt_DETInclJet320_3bin","pt_DETInclJet320_3bin",Ptbins,Ptbinning); pt_DETInclJet320_3bin->Sumw2(); - pt_DETInclJet320_4bin = fs->make("pt_DETInclJet320_4bin","pt_DETInclJet320_4bin",Ptbins,Ptbinning); pt_DETInclJet320_4bin->Sumw2(); - pt_DETInclJet320_5bin = fs->make("pt_DETInclJet320_5bin","pt_DETInclJet320_5bin",Ptbins,Ptbinning); pt_DETInclJet320_5bin->Sumw2(); - pt_DETInclJet320_6bin = fs->make("pt_DETInclJet320_6bin","pt_DETInclJet320_6bin",Ptbins,Ptbinning); pt_DETInclJet320_6bin->Sumw2(); - pt_DETInclJet320_7bin = fs->make("pt_DETInclJet320_7bin","pt_DETInclJet320_7bin",Ptbins,Ptbinning); pt_DETInclJet320_7bin->Sumw2(); - - pt_DETInclJet400_1bin = fs->make("pt_DETInclJet400_1bin","pt_DETInclJet400_1bin",Ptbins,Ptbinning); pt_DETInclJet400_1bin->Sumw2(); - pt_DETInclJet400_2bin = fs->make("pt_DETInclJet400_2bin","pt_DETInclJet400_2bin",Ptbins,Ptbinning); pt_DETInclJet400_2bin->Sumw2(); - pt_DETInclJet400_3bin = fs->make("pt_DETInclJet400_3bin","pt_DETInclJet400_3bin",Ptbins,Ptbinning); pt_DETInclJet400_3bin->Sumw2(); - pt_DETInclJet400_4bin = fs->make("pt_DETInclJet400_4bin","pt_DETInclJet400_4bin",Ptbins,Ptbinning); pt_DETInclJet400_4bin->Sumw2(); - pt_DETInclJet400_5bin = fs->make("pt_DETInclJet400_5bin","pt_DETInclJet400_5bin",Ptbins,Ptbinning); pt_DETInclJet400_5bin->Sumw2(); - pt_DETInclJet400_6bin = fs->make("pt_DETInclJet400_6bin","pt_DETInclJet400_6bin",Ptbins,Ptbinning); pt_DETInclJet400_6bin->Sumw2(); - pt_DETInclJet400_7bin = fs->make("pt_DETInclJet400_7bin","pt_DETInclJet400_7bin",Ptbins,Ptbinning); pt_DETInclJet400_7bin->Sumw2(); - - pt_DETInclJet450_1bin = fs->make("pt_DETInclJet450_1bin","pt_DETInclJet450_1bin",Ptbins,Ptbinning); pt_DETInclJet450_1bin->Sumw2(); - pt_DETInclJet450_2bin = fs->make("pt_DETInclJet450_2bin","pt_DETInclJet450_2bin",Ptbins,Ptbinning); pt_DETInclJet450_2bin->Sumw2(); - pt_DETInclJet450_3bin = fs->make("pt_DETInclJet450_3bin","pt_DETInclJet450_3bin",Ptbins,Ptbinning); pt_DETInclJet450_3bin->Sumw2(); - pt_DETInclJet450_4bin = fs->make("pt_DETInclJet450_4bin","pt_DETInclJet450_4bin",Ptbins,Ptbinning); pt_DETInclJet450_4bin->Sumw2(); - pt_DETInclJet450_5bin = fs->make("pt_DETInclJet450_5bin","pt_DETInclJet450_5bin",Ptbins,Ptbinning); pt_DETInclJet450_5bin->Sumw2(); - pt_DETInclJet450_6bin = fs->make("pt_DETInclJet450_6bin","pt_DETInclJet450_6bin",Ptbins,Ptbinning); pt_DETInclJet450_6bin->Sumw2(); - pt_DETInclJet450_7bin = fs->make("pt_DETInclJet450_7bin","pt_DETInclJet450_7bin",Ptbins,Ptbinning); pt_DETInclJet450_7bin->Sumw2(); - - pt_GENInclJet_1bin = fs->make("pt_GENInclJet_1bin","pt_GENInclJet_1bin",Ptbins,Ptbinning); pt_GENInclJet_1bin->Sumw2(); - pt_GENInclJet_2bin = fs->make("pt_GENInclJet_2bin","pt_GENInclJet_2bin",Ptbins,Ptbinning); pt_GENInclJet_2bin->Sumw2(); - pt_GENInclJet_3bin = fs->make("pt_GENInclJet_3bin","pt_GENInclJet_3bin",Ptbins,Ptbinning); pt_GENInclJet_3bin->Sumw2(); - pt_GENInclJet_4bin = fs->make("pt_GENInclJet_4bin","pt_GENInclJet_4bin",Ptbins,Ptbinning); pt_GENInclJet_4bin->Sumw2(); - pt_GENInclJet_5bin = fs->make("pt_GENInclJet_5bin","pt_GENInclJet_5bin",Ptbins,Ptbinning); pt_GENInclJet_5bin->Sumw2(); - pt_GENInclJet_6bin = fs->make("pt_GENInclJet_6bin","pt_GENInclJet_6bin",Ptbins,Ptbinning); pt_GENInclJet_6bin->Sumw2(); - pt_GENInclJet_7bin = fs->make("pt_GENInclJet_7bin","pt_GENInclJet_7bin",Ptbins,Ptbinning); pt_GENInclJet_7bin->Sumw2(); - - pt_GENInclJetCrossSectNorm_1bin = fs->make("pt_GENInclJetCrossSectNorm_1bin","pt_GENInclJetCrossSectNorm_1bin",Ptbins,Ptbinning); pt_GENInclJetCrossSectNorm_1bin->Sumw2(); - pt_GENInclJetCrossSectNorm_2bin = fs->make("pt_GENInclJetCrossSectNorm_2bin","pt_GENInclJetCrossSectNorm_2bin",Ptbins,Ptbinning); pt_GENInclJetCrossSectNorm_2bin->Sumw2(); - pt_GENInclJetCrossSectNorm_3bin = fs->make("pt_GENInclJetCrossSectNorm_3bin","pt_GENInclJetCrossSectNorm_3bin",Ptbins,Ptbinning); pt_GENInclJetCrossSectNorm_3bin->Sumw2(); - pt_GENInclJetCrossSectNorm_4bin = fs->make("pt_GENInclJetCrossSectNorm_4bin","pt_GENInclJetCrossSectNorm_4bin",Ptbins,Ptbinning); pt_GENInclJetCrossSectNorm_4bin->Sumw2(); - pt_GENInclJetCrossSectNorm_5bin = fs->make("pt_GENInclJetCrossSectNorm_5bin","pt_GENInclJetCrossSectNorm_5bin",Ptbins,Ptbinning); pt_GENInclJetCrossSectNorm_5bin->Sumw2(); - pt_GENInclJetCrossSectNorm_6bin = fs->make("pt_GENInclJetCrossSectNorm_6bin","pt_GENInclJetCrossSectNorm_6bin",Ptbins,Ptbinning); pt_GENInclJetCrossSectNorm_6bin->Sumw2(); - pt_GENInclJetCrossSectNorm_7bin = fs->make("pt_GENInclJetCrossSectNorm_7bin","pt_GENInclJetCrossSectNorm_7bin",Ptbins,Ptbinning); pt_GENInclJetCrossSectNorm_7bin->Sumw2(); - - PF_FakeInclusiveJets_1bin = fs->make("PF_FakeInclusiveJets_1bin","PF_FakeInclusiveJets_1bin",Ptbins,Ptbinning); PF_FakeInclusiveJets_1bin->Sumw2(); - PF_FakeInclusiveJets_2bin = fs->make("PF_FakeInclusiveJets_2bin","PF_FakeInclusiveJets_2bin",Ptbins,Ptbinning); PF_FakeInclusiveJets_2bin->Sumw2(); - PF_FakeInclusiveJets_3bin = fs->make("PF_FakeInclusiveJets_3bin","PF_FakeInclusiveJets_3bin",Ptbins,Ptbinning); PF_FakeInclusiveJets_3bin->Sumw2(); - PF_FakeInclusiveJets_4bin = fs->make("PF_FakeInclusiveJets_4bin","PF_FakeInclusiveJets_4bin",Ptbins,Ptbinning); PF_FakeInclusiveJets_4bin->Sumw2(); - PF_FakeInclusiveJets_5bin = fs->make("PF_FakeInclusiveJets_5bin","PF_FakeInclusiveJets_5bin",Ptbins,Ptbinning); PF_FakeInclusiveJets_5bin->Sumw2(); - PF_FakeInclusiveJets_6bin = fs->make("PF_FakeInclusiveJets_6bin","PF_FakeInclusiveJets_6bin",Ptbins,Ptbinning); PF_FakeInclusiveJets_6bin->Sumw2(); - PF_FakeInclusiveJets_7bin = fs->make("PF_FakeInclusiveJets_7bin","PF_FakeInclusiveJets_7bin",Ptbins,Ptbinning); PF_FakeInclusiveJets_7bin->Sumw2(); - - Gen_MissInclusiveJets_1bin = fs->make("Gen_MissInclusiveJets_1bin","Gen_MissInclusiveJets_1bin",Ptbins,Ptbinning); Gen_MissInclusiveJets_1bin->Sumw2(); - Gen_MissInclusiveJets_2bin = fs->make("Gen_MissInclusiveJets_2bin","Gen_MissInclusiveJets_2bin",Ptbins,Ptbinning); Gen_MissInclusiveJets_2bin->Sumw2(); - Gen_MissInclusiveJets_3bin = fs->make("Gen_MissInclusiveJets_3bin","Gen_MissInclusiveJets_3bin",Ptbins,Ptbinning); Gen_MissInclusiveJets_3bin->Sumw2(); - Gen_MissInclusiveJets_4bin = fs->make("Gen_MissInclusiveJets_4bin","Gen_MissInclusiveJets_4bin",Ptbins,Ptbinning); Gen_MissInclusiveJets_4bin->Sumw2(); - Gen_MissInclusiveJets_5bin = fs->make("Gen_MissInclusiveJets_5bin","Gen_MissInclusiveJets_5bin",Ptbins,Ptbinning); Gen_MissInclusiveJets_5bin->Sumw2(); - Gen_MissInclusiveJets_6bin = fs->make("Gen_MissInclusiveJets_6bin","Gen_MissInclusiveJets_6bin",Ptbins,Ptbinning); Gen_MissInclusiveJets_6bin->Sumw2(); - Gen_MissInclusiveJets_7bin = fs->make("Gen_MissInclusiveJets_7bin","Gen_MissInclusiveJets_7bin",Ptbins,Ptbinning); Gen_MissInclusiveJets_7bin->Sumw2(); - - PF_MatchedInclusiveJets_1bin = fs->make("PF_MatchedInclusiveJets_1bin","PF_MatchedInclusiveJets_1bin",Ptbins,Ptbinning); PF_MatchedInclusiveJets_1bin->Sumw2(); - PF_MatchedInclusiveJets_2bin = fs->make("PF_MatchedInclusiveJets_2bin","PF_MatchedInclusiveJets_2bin",Ptbins,Ptbinning); PF_MatchedInclusiveJets_2bin->Sumw2(); - PF_MatchedInclusiveJets_3bin = fs->make("PF_MatchedInclusiveJets_3bin","PF_MatchedInclusiveJets_3bin",Ptbins,Ptbinning); PF_MatchedInclusiveJets_3bin->Sumw2(); - PF_MatchedInclusiveJets_4bin = fs->make("PF_MatchedInclusiveJets_4bin","PF_MatchedInclusiveJets_4bin",Ptbins,Ptbinning); PF_MatchedInclusiveJets_4bin->Sumw2(); - PF_MatchedInclusiveJets_5bin = fs->make("PF_MatchedInclusiveJets_5bin","PF_MatchedInclusiveJets_5bin",Ptbins,Ptbinning); PF_MatchedInclusiveJets_5bin->Sumw2(); - PF_MatchedInclusiveJets_6bin = fs->make("PF_MatchedInclusiveJets_6bin","PF_MatchedInclusiveJets_6bin",Ptbins,Ptbinning); PF_MatchedInclusiveJets_6bin->Sumw2(); - PF_MatchedInclusiveJets_7bin = fs->make("PF_MatchedInclusiveJets_7bin","PF_MatchedInclusiveJets_7bin",Ptbins,Ptbinning); PF_MatchedInclusiveJets_7bin->Sumw2(); - - Gen_MatchedInclusiveJets_1bin = fs->make("Gen_MatchedInclusiveJets_1bin","Gen_MatchedInclusiveJets_1bin",Ptbins,Ptbinning); Gen_MatchedInclusiveJets_1bin->Sumw2(); - Gen_MatchedInclusiveJets_2bin = fs->make("Gen_MatchedInclusiveJets_2bin","Gen_MatchedInclusiveJets_2bin",Ptbins,Ptbinning); Gen_MatchedInclusiveJets_2bin->Sumw2(); - Gen_MatchedInclusiveJets_3bin = fs->make("Gen_MatchedInclusiveJets_3bin","Gen_MatchedInclusiveJets_3bin",Ptbins,Ptbinning); Gen_MatchedInclusiveJets_3bin->Sumw2(); - Gen_MatchedInclusiveJets_4bin = fs->make("Gen_MatchedInclusiveJets_4bin","Gen_MatchedInclusiveJets_4bin",Ptbins,Ptbinning); Gen_MatchedInclusiveJets_4bin->Sumw2(); - Gen_MatchedInclusiveJets_5bin = fs->make("Gen_MatchedInclusiveJets_5bin","Gen_MatchedInclusiveJets_5bin",Ptbins,Ptbinning); Gen_MatchedInclusiveJets_5bin->Sumw2(); - Gen_MatchedInclusiveJets_6bin = fs->make("Gen_MatchedInclusiveJets_6bin","Gen_MatchedInclusiveJets_6bin",Ptbins,Ptbinning); Gen_MatchedInclusiveJets_6bin->Sumw2(); - Gen_MatchedInclusiveJets_7bin = fs->make("Gen_MatchedInclusiveJets_7bin","Gen_MatchedInclusiveJets_7bin",Ptbins,Ptbinning); Gen_MatchedInclusiveJets_7bin->Sumw2(); - - TwoD_MatchedInclusiveJets_1bin = fs->make("TwoD_MatchedInclusiveJets_1bin","TwoD_MatchedInclusiveJets_1bin",Ptbins,Ptbinning,Ptbins,Ptbinning); TwoD_MatchedInclusiveJets_1bin->Sumw2(); - TwoD_MatchedInclusiveJets_2bin = fs->make("TwoD_MatchedInclusiveJets_2bin","TwoD_MatchedInclusiveJets_2bin",Ptbins,Ptbinning,Ptbins,Ptbinning); TwoD_MatchedInclusiveJets_2bin->Sumw2(); - TwoD_MatchedInclusiveJets_3bin = fs->make("TwoD_MatchedInclusiveJets_3bin","TwoD_MatchedInclusiveJets_3bin",Ptbins,Ptbinning,Ptbins,Ptbinning); TwoD_MatchedInclusiveJets_3bin->Sumw2(); - TwoD_MatchedInclusiveJets_4bin = fs->make("TwoD_MatchedInclusiveJets_4bin","TwoD_MatchedInclusiveJets_4bin",Ptbins,Ptbinning,Ptbins,Ptbinning); TwoD_MatchedInclusiveJets_4bin->Sumw2(); - TwoD_MatchedInclusiveJets_5bin = fs->make("TwoD_MatchedInclusiveJets_5bin","TwoD_MatchedInclusiveJets_5bin",Ptbins,Ptbinning,Ptbins,Ptbinning); TwoD_MatchedInclusiveJets_5bin->Sumw2(); - TwoD_MatchedInclusiveJets_6bin = fs->make("TwoD_MatchedInclusiveJets_6bin","TwoD_MatchedInclusiveJets_6bin",Ptbins,Ptbinning,Ptbins,Ptbinning); TwoD_MatchedInclusiveJets_6bin->Sumw2(); - TwoD_MatchedInclusiveJets_7bin = fs->make("TwoD_MatchedInclusiveJets_7bin","TwoD_MatchedInclusiveJets_7bin",Ptbins,Ptbinning,Ptbins,Ptbinning); TwoD_MatchedInclusiveJets_7bin->Sumw2(); - - Resolution1D = fs->make("Resolution1D","Resolution1D",100,-5,5); - ResolutionForward1D = fs->make("ResolutionForward1D","ResolutionForward1D",100,-5,5); - - ResolutionInclusiveJets = fs->make("ResolutionInclusiveJets","ResolutionInclusiveJets",Ptbins,Ptbinning,0,5); - ResolutionInclusiveJets_1bin = fs->make("ResolutionInclusiveJets_1bin","ResolutionInclusiveJets_1bin",Ptbins,Ptbinning,0,5); - ResolutionInclusiveJets_2bin = fs->make("ResolutionInclusiveJets_2bin","ResolutionInclusiveJets_2bin",Ptbins,Ptbinning,0,5); - ResolutionInclusiveJets_3bin = fs->make("ResolutionInclusiveJets_3bin","ResolutionInclusiveJets_3bin",Ptbins,Ptbinning,0,5); - ResolutionInclusiveJets_4bin = fs->make("ResolutionInclusiveJets_4bin","ResolutionInclusiveJets_4bin",Ptbins,Ptbinning,0,5); - ResolutionInclusiveJets_5bin = fs->make("ResolutionInclusiveJets_5bin","ResolutionInclusiveJets_5bin",Ptbins,Ptbinning,0,5); - ResolutionInclusiveJets_6bin = fs->make("ResolutionInclusiveJets_6bin","ResolutionInclusiveJets_6bin",Ptbins,Ptbinning,0,5); - ResolutionInclusiveJets_7bin = fs->make("ResolutionInclusiveJets_7bin","ResolutionInclusiveJets_7bin",Ptbins,Ptbinning,0,5); - - ResolutionTagAndProbe = fs->make("ResolutionTagAndProbe","ResolutionTagAndProbe",Ptbins,Ptbinning,0,5); - - //trigger efficiency measurement - TagAndProbeNum= fs->make("TagAndProbeNum","TagAndProbeNum",Ptbins,Ptbinning); - TagAndProbeDen= fs->make("TagAndProbeDen","TagAndProbeDen",Ptbins,Ptbinning); - TagAndProbeEff= fs->make("TagAndProbeEff","TagAndProbeEff",Ptbins,Ptbinning); - - hist_leading_pt_emulated_Jet60= fs->make("hist_leading_pt_emulated_Jet60","hist_leading_pt_emulated_Jet60",Ptbins,Ptbinning); - hist_leading_pt_all_Jet60= fs->make("hist_leading_pt_all_Jet60","hist_leading_pt_all_Jet60",Ptbins,Ptbinning); - hist_leading_eta_emulated_Jet60= fs->make("hist_leading_eta_emulated_Jet60","hist_leading_eta_emulated_Jet60",24,-5.2,5.2); - hist_leading_eta_all_Jet60= fs->make("hist_leading_eta_all_Jet60","hist_leading_eta_all_Jet60",24,-5.2,5.2); - - hist_leading_pt_HLT_Jet60U_eff= fs->make("hist_leading_pt_HLT_Jet60U_eff","hist_leading_pt_HLT_Jet60U_eff",Ptbins,Ptbinning); - hist_leading_eta_HLT_Jet60U_eff= fs->make("hist_leading_eta_HLT_Jet60U_eff","hist_leading_eta_HLT_Jet60U_eff",24,-5.2,5.2); - - hist_leading_pt_emulated_Jet80= fs->make("hist_leading_pt_emulated_Jet80","hist_leading_pt_emulated_Jet80",Ptbins,Ptbinning); - hist_leading_pt_all_Jet80= fs->make("hist_leading_pt_all_Jet80","hist_leading_pt_all_Jet80",Ptbins,Ptbinning); - hist_leading_eta_emulated_Jet80= fs->make("hist_leading_eta_emulated_Jet80","hist_leading_eta_emulated_Jet80",24,-5.2,5.2); - hist_leading_eta_all_Jet80= fs->make("hist_leading_eta_all_Jet80","hist_leading_eta_all_Jet80",24,-5.2,5.2); - - hist_leading_pt_HLT_Jet80U_eff= fs->make("hist_leading_pt_HLT_Jet80U_eff","hist_leading_pt_HLT_Jet80U_eff",Ptbins,Ptbinning); - hist_leading_eta_HLT_Jet80U_eff= fs->make("hist_leading_eta_HLT_Jet80U_eff","hist_leading_eta_HLT_Jet80U_eff",24,-5.2,5.2); - - hist_leading_pt_emulated_Jet140= fs->make("hist_leading_pt_emulated_Jet140","hist_leading_pt_emulated_Jet140",Ptbins,Ptbinning); - hist_leading_pt_all_Jet140= fs->make("hist_leading_pt_all_Jet140","hist_leading_pt_all_Jet140",Ptbins,Ptbinning); - hist_leading_eta_emulated_Jet140= fs->make("hist_leading_eta_emulated_Jet140","hist_leading_eta_emulated_Jet140",24,-5.2,5.2); - hist_leading_eta_all_Jet140= fs->make("hist_leading_eta_all_Jet140","hist_leading_eta_all_Jet140",24,-5.2,5.2); - - hist_leading_pt_HLT_Jet140U_eff= fs->make("hist_leading_pt_HLT_Jet140U_eff","hist_leading_pt_HLT_Jet140U_eff",Ptbins,Ptbinning); - hist_leading_eta_HLT_Jet140U_eff= fs->make("hist_leading_eta_HLT_Jet140U_eff","hist_leading_eta_HLT_Jet140U_eff",24,-5.2,5.2); - - hist_leading_pt_emulated_Jet200= fs->make("hist_leading_pt_emulated_Jet200","hist_leading_pt_emulated_Jet200",Ptbins,Ptbinning); - hist_leading_pt_all_Jet200= fs->make("hist_leading_pt_all_Jet200","hist_leading_pt_all_Jet200",Ptbins,Ptbinning); - hist_leading_eta_emulated_Jet200= fs->make("hist_leading_eta_emulated_Jet200","hist_leading_eta_emulated_Jet200",24,-5.2,5.2); - hist_leading_eta_all_Jet200= fs->make("hist_leading_eta_all_Jet200","hist_leading_eta_all_Jet200",24,-5.2,5.2); - - hist_leading_pt_HLT_Jet200U_eff= fs->make("hist_leading_pt_HLT_Jet200U_eff","hist_leading_pt_HLT_Jet200U_eff",Ptbins,Ptbinning); - hist_leading_eta_HLT_Jet200U_eff= fs->make("hist_leading_eta_HLT_Jet200U_eff","hist_leading_eta_HLT_Jet200U_eff",24,-5.2,5.2); - - hist_leading_pt_emulated_Jet260= fs->make("hist_leading_pt_emulated_Jet260","hist_leading_pt_emulated_Jet260",Ptbins,Ptbinning); - hist_leading_pt_all_Jet260= fs->make("hist_leading_pt_all_Jet260","hist_leading_pt_all_Jet260",Ptbins,Ptbinning); - hist_leading_eta_emulated_Jet260= fs->make("hist_leading_eta_emulated_Jet260","hist_leading_eta_emulated_Jet260",24,-5.2,5.2); - hist_leading_eta_all_Jet260= fs->make("hist_leading_eta_all_Jet260","hist_leading_eta_all_Jet260",24,-5.2,5.2); - - hist_leading_pt_HLT_Jet260U_eff= fs->make("hist_leading_pt_HLT_Jet260U_eff","hist_leading_pt_HLT_Jet260U_eff",Ptbins,Ptbinning); - hist_leading_eta_HLT_Jet260U_eff= fs->make("hist_leading_eta_HLT_Jet260U_eff","hist_leading_eta_HLT_Jet260U_eff",24,-5.2,5.2); - - hist_leading_pt_emulated_Jet320= fs->make("hist_leading_pt_emulated_Jet320","hist_leading_pt_emulated_Jet320",Ptbins,Ptbinning); - hist_leading_pt_all_Jet320= fs->make("hist_leading_pt_all_Jet320","hist_leading_pt_all_Jet320",Ptbins,Ptbinning); - hist_leading_eta_emulated_Jet320= fs->make("hist_leading_eta_emulated_Jet320","hist_leading_eta_emulated_Jet320",24,-5.2,5.2); - hist_leading_eta_all_Jet320= fs->make("hist_leading_eta_all_Jet320","hist_leading_eta_all_Jet320",24,-5.2,5.2); - - hist_leading_pt_HLT_Jet320U_eff= fs->make("hist_leading_pt_HLT_Jet320U_eff","hist_leading_pt_HLT_Jet320U_eff",Ptbins,Ptbinning); - hist_leading_eta_HLT_Jet320U_eff= fs->make("hist_leading_eta_HLT_Jet320U_eff","hist_leading_eta_HLT_Jet320U_eff",24,-5.2,5.2); - - hist_leading_pt_emulated_Jet400= fs->make("hist_leading_pt_emulated_Jet400","hist_leading_pt_emulated_Jet400",Ptbins,Ptbinning); - hist_leading_pt_all_Jet400= fs->make("hist_leading_pt_all_Jet400","hist_leading_pt_all_Jet400",Ptbins,Ptbinning); - hist_leading_eta_emulated_Jet400= fs->make("hist_leading_eta_emulated_Jet400","hist_leading_eta_emulated_Jet400",24,-5.2,5.2); - hist_leading_eta_all_Jet400= fs->make("hist_leading_eta_all_Jet400","hist_leading_eta_all_Jet400",24,-5.2,5.2); - - hist_leading_pt_HLT_Jet400U_eff= fs->make("hist_leading_pt_HLT_Jet400U_eff","hist_leading_pt_HLT_Jet400U_eff",Ptbins,Ptbinning); - hist_leading_eta_HLT_Jet400U_eff= fs->make("hist_leading_eta_HLT_Jet400U_eff","hist_leading_eta_HLT_Jet400U_eff",24,-5.2,5.2); - - hist_leading_pt_emulated_Jet450= fs->make("hist_leading_pt_emulated_Jet450","hist_leading_pt_emulated_Jet450",Ptbins,Ptbinning); - hist_leading_pt_all_Jet450= fs->make("hist_leading_pt_all_Jet450","hist_leading_pt_all_Jet450",Ptbins,Ptbinning); - hist_leading_eta_emulated_Jet450= fs->make("hist_leading_eta_emulated_Jet450","hist_leading_eta_emulated_Jet450",24,-5.2,5.2); - hist_leading_eta_all_Jet450= fs->make("hist_leading_eta_all_Jet450","hist_leading_eta_all_Jet450",24,-5.2,5.2); - - hist_leading_pt_HLT_Jet450U_eff= fs->make("hist_leading_pt_HLT_Jet450U_eff","hist_leading_pt_HLT_Jet450U_eff",Ptbins,Ptbinning); - hist_leading_eta_HLT_Jet450U_eff= fs->make("hist_leading_eta_HLT_Jet450U_eff","hist_leading_eta_HLT_Jet450U_eff",24,-5.2,5.2); - - hist_leading_pt_emulated_Jet500= fs->make("hist_leading_pt_emulated_Jet500","hist_leading_pt_emulated_Jet500",Ptbins,Ptbinning); - hist_leading_pt_all_Jet500= fs->make("hist_leading_pt_all_Jet500","hist_leading_pt_all_Jet500",Ptbins,Ptbinning); - hist_leading_eta_emulated_Jet500= fs->make("hist_leading_eta_emulated_Jet500","hist_leading_eta_emulated_Jet500",24,-5.2,5.2); - hist_leading_eta_all_Jet500= fs->make("hist_leading_eta_all_Jet500","hist_leading_eta_all_Jet500",24,-5.2,5.2); - - hist_leading_pt_HLT_Jet500U_eff= fs->make("hist_leading_pt_HLT_Jet500U_eff","hist_leading_pt_HLT_Jet500U_eff",Ptbins,Ptbinning); - hist_leading_eta_HLT_Jet500U_eff= fs->make("hist_leading_eta_HLT_Jet500U_eff","hist_leading_eta_HLT_Jet500U_eff",24,-5.2,5.2); - - //Jet energy systematic uncertainty - pt_DETInclJetUP_1bin = fs->make("pt_DETInclJetUP_1bin","pt_DETInclJetUP_1bin",Ptbins,Ptbinning); pt_DETInclJetUP_1bin->Sumw2(); - pt_DETInclJetUP_2bin = fs->make("pt_DETInclJetUP_2bin","pt_DETInclJetUP_2bin",Ptbins,Ptbinning); pt_DETInclJetUP_2bin->Sumw2(); - pt_DETInclJetUP_3bin = fs->make("pt_DETInclJetUP_3bin","pt_DETInclJetUP_3bin",Ptbins,Ptbinning); pt_DETInclJetUP_3bin->Sumw2(); - pt_DETInclJetUP_4bin = fs->make("pt_DETInclJetUP_4bin","pt_DETInclJetUP_4bin",Ptbins,Ptbinning); pt_DETInclJetUP_4bin->Sumw2(); - pt_DETInclJetUP_5bin = fs->make("pt_DETInclJetUP_5bin","pt_DETInclJetUP_5bin",Ptbins,Ptbinning); pt_DETInclJetUP_5bin->Sumw2(); - pt_DETInclJetUP_6bin = fs->make("pt_DETInclJetUP_6bin","pt_DETInclJetUP_6bin",Ptbins,Ptbinning); pt_DETInclJetUP_6bin->Sumw2(); - pt_DETInclJetUP_7bin = fs->make("pt_DETInclJetUP_7bin","pt_DETInclJetUP_7bin",Ptbins,Ptbinning); pt_DETInclJetUP_7bin->Sumw2(); - - pt_DETInclJetDOWN_1bin = fs->make("pt_DETInclJetDOWN_1bin","pt_DETInclJetDOWN_1bin",Ptbins,Ptbinning); pt_DETInclJetDOWN_1bin->Sumw2(); - pt_DETInclJetDOWN_2bin = fs->make("pt_DETInclJetDOWN_2bin","pt_DETInclJetDOWN_2bin",Ptbins,Ptbinning); pt_DETInclJetDOWN_2bin->Sumw2(); - pt_DETInclJetDOWN_3bin = fs->make("pt_DETInclJetDOWN_3bin","pt_DETInclJetDOWN_3bin",Ptbins,Ptbinning); pt_DETInclJetDOWN_3bin->Sumw2(); - pt_DETInclJetDOWN_4bin = fs->make("pt_DETInclJetDOWN_4bin","pt_DETInclJetDOWN_4bin",Ptbins,Ptbinning); pt_DETInclJetDOWN_4bin->Sumw2(); - pt_DETInclJetDOWN_5bin = fs->make("pt_DETInclJetDOWN_5bin","pt_DETInclJetDOWN_5bin",Ptbins,Ptbinning); pt_DETInclJetDOWN_5bin->Sumw2(); - pt_DETInclJetDOWN_6bin = fs->make("pt_DETInclJetDOWN_6bin","pt_DETInclJetDOWN_6bin",Ptbins,Ptbinning); pt_DETInclJetDOWN_6bin->Sumw2(); - pt_DETInclJetDOWN_7bin = fs->make("pt_DETInclJetDOWN_7bin","pt_DETInclJetDOWN_7bin",Ptbins,Ptbinning); pt_DETInclJetDOWN_7bin->Sumw2(); - - Chargedhf0_DETJet = fs->make("Chargedhf0_DETJet","Chargedhf0_DETJet",50,0,1); Chargedhf0_DETJet->Sumw2(); - Chargedef0_DETJet = fs->make("Chargedef0_DETJet","Chargedef0_DETJet",50,0,1); Chargedef0_DETJet->Sumw2(); - Neutralhf0_DETJet = fs->make("Neutralhf0_DETJet","Neutralhf0_DETJet",50,0,1); Neutralhf0_DETJet->Sumw2(); - Photonef0_DETJet = fs->make("Photonef0_DETJet","Photonef0_DETJet",50,0,1); Photonef0_DETJet->Sumw2(); - Hadronef0_DETJet = fs->make("Hadronef0_DETJet","Hadronef0_DETJet",50,0,1); Hadronef0_DETJet->Sumw2(); - Muonef0_DETJet = fs->make("Muonef0_DETJet","Muonef0_DETJet",50,0,1); Muonef0_DETJet->Sumw2(); - Electromagneticef0_DETJet = fs->make("Electromagneticef0_DETJet","Electromagneticef0_DETJet",50,0,1); Electromagneticef0_DETJet->Sumw2(); - - ChargedhMultiplicity0_DETJet = fs->make("ChargedhMultiplicity0_DETJet","ChargedhMultiplicity0_DETJet",100,0,100); ChargedhMultiplicity0_DETJet->Sumw2(); - ChargedeMultiplicity0_DETJet = fs->make("ChargedeMultiplicity0_DETJet","ChargedeMultiplicity0_DETJet",100,0,100); ChargedeMultiplicity0_DETJet->Sumw2(); - NeutralhMultiplicity0_DETJet = fs->make("NeutralhMultiplicity0_DETJet","NeutralhMultiplicity0_DETJet",100,0,100); NeutralhMultiplicity0_DETJet->Sumw2(); - PhotoneMultiplicity0_DETJet = fs->make("PhotoneMultiplicity0_DETJet","PhotoneMultiplicity0_DETJet",100,0,100); PhotoneMultiplicity0_DETJet->Sumw2(); - HadroneMultiplicity0_DETJet = fs->make("HadroneMultiplicity0_DETJet","HadroneMultiplicity0_DETJet",100,0,100); HadroneMultiplicity0_DETJet->Sumw2(); - MuoneMultiplicity0_DETJet = fs->make("MuoneMultiplicity0_DETJet","MuoneMultiplicity0_DETJet",100,0,100); MuoneMultiplicity0_DETJet->Sumw2(); - ElectromagneticeMultiplicity0_DETJet = fs->make("ElectromagneticeMultiplicity0_DETJet","ElectromagneticeMultiplicity0_DETJet",100,0,100); ElectromagneticeMultiplicity0_DETJet->Sumw2(); - - TruePileUpMC = fs->make("TruePileUpMC","TruePileUpMC",100,0,100); TruePileUpMC->Sumw2(); - TruePileUpMCInteger = fs->make("TruePileUpMCInteger","TruePileUpMCInteger",100,0,100); TruePileUpMCInteger->Sumw2(); - - TruePileUpDataInteger = fs->make("TruePileUpDataInteger","TruePileUpDataInteger",100,0,100); TruePileUpDataInteger->Sumw2(); - - MET_DET = fs->make("MET_DET","MET_DET",500,0,2000); MET_DET->Sumw2(); - METPhi_DET = fs->make("METPhi_DET","METPhi_DET",35,-7,7); METPhi_DET->Sumw2(); - FractionMET_DET = fs->make("FractionMET_DET","FractionMET_DET",50,0,1); FractionMET_DET->Sumw2(); - - jecs = new JECs(mIsMCarlo, mGlobalTag, mjettype,mJECUncSrc,mJECUncSrcNames); - - //Unfolding - /*resp_jetpt1etabin = fs->make(pt0_DETJet,pt0_DETJet, "resp_jetpt1etabin", "jetpt1etabin"); - resp_jetpt2etabin = fs->make(pt0_DETJet,pt0_DETJet, "resp_jetpt2etabin", "jetpt2etabin"); - resp_jetpt3etabin = fs->make(pt0_DETJet,pt0_DETJet, "resp_jetpt3etabin", "jetpt3etabin"); - resp_jetpt4etabin = fs->make(pt0_DETJet,pt0_DETJet, "resp_jetpt4etabin", "jetpt4etabin"); - resp_jetpt5etabin = fs->make(pt0_DETJet,pt0_DETJet, "resp_jetpt5etabin", "jetpt5etabin"); - resp_jetpt6etabin = fs->make(pt0_DETJet,pt0_DETJet, "resp_jetpt6etabin", "jetpt6etabin"); - resp_jetpt7etabin = fs->make(pt0_DETJet,pt0_DETJet, "resp_jetpt7etabin", "jetpt7etabin");*/ - - } // end of function beginJob() - - - //------------------------ endjob() function declaration ---------------------- // - void Analysis_Template_MC::endJob() - { - - mInf->Close(); - - } // closing endJob() - - - - - - //--------------------------- analyze() fuction declaration ------------------ // -void Analysis_Template_MC::analyze(edm::Event const& iEvent, edm::EventSetup const& iSetup) - { - - cout<<" Size "<Get(mDirName.c_str()); - mTree=(TTree*)mDir->Get(mTreeName.c_str()); - - Event = new QCDEvent(); - TBranch *branch = mTree->GetBranch("events"); - branch->SetAddress(&Event); - - unsigned NEntries = mTree->GetEntries(); - cout<<"Reading TREE: "<Get("ak4/TriggerNames"); - cout<<"Finding trigger mapping: "<GetNbinsX();ibin++) { - TString ss(hTrigNames->GetXaxis()->GetBinLabel(ibin+1)); - - for (int ii=0; ii "<GetEntry(l); - - //LOW PILE-UP - - double TruePileUpInteger=0; - if(mIsMCarlo) TruePileUpInteger=Event->evtHdr().pu()/Event->evtHdr().nbx(); - - if(mIsMCarlo){ - if(mMCSlice==0){WeightMC=2022100000*Event->evtHdr().weight()/NEntriesNorm;}//flat MC - if(mMCSlice==1){ - if(ifile==0){WeightMC=61018300000*Event->evtHdr().weight()/NEntriesNorm;}//5-10 Slice - if(ifile==1){WeightMC=5887580000*Event->evtHdr().weight()/NEntriesNorm;}//10-15 Slice - if(ifile==2){WeightMC=1837410000*Event->evtHdr().weight()/NEntriesNorm;}//15-30 - if(ifile==3){WeightMC=140932000*Event->evtHdr().weight()/NEntriesNorm;}//30-50 - if(ifile==4){WeightMC=19204300*Event->evtHdr().weight()/NEntriesNorm;}//50-80 - if(ifile==5){WeightMC=2762530*Event->evtHdr().weight()/NEntriesNorm;}//80-120 - if(ifile==6){WeightMC=471100*Event->evtHdr().weight()/NEntriesNorm;}//120-170 - if(ifile==7){WeightMC=117276*Event->evtHdr().weight()/NEntriesNorm;}//170-300 - if(ifile==8){WeightMC=7823*Event->evtHdr().weight()/NEntriesNorm;}//300-470 - if(ifile==9){WeightMC=648.2*Event->evtHdr().weight()/NEntriesNorm;}//470-600 - if(ifile==10){WeightMC=186.9*Event->evtHdr().weight()/NEntriesNorm;}//600-800 - if(ifile==11){WeightMC=32.293*Event->evtHdr().weight()/NEntriesNorm;}//800-1000 - if(ifile==12){WeightMC=9.4183*Event->evtHdr().weight()/NEntriesNorm;}//1000-1400 Slice - if(ifile==13){WeightMC=0.84265*Event->evtHdr().weight()/NEntriesNorm;}//1400-1800 Slice - if(ifile==14){WeightMC=0.114943*Event->evtHdr().weight()/NEntriesNorm;}//1800-2400 Slice - if(ifile==15){WeightMC=0.00682981*Event->evtHdr().weight()/NEntriesNorm;}//2400-3200 Slice - if(ifile==16){WeightMC=0.000165445*Event->evtHdr().weight()/NEntriesNorm;}//3200 Slice - } - - - if(mPUReweighting) { - double PUValue=Event->evtHdr().pu()/Event->evtHdr().nbx(); - /*if(PUValue==0) WeightMC=WeightMC*0; - if(PUValue==1) WeightMC=WeightMC*7.15108*5.58912*7.75622; - if(PUValue==2) WeightMC=WeightMC*0.719276*0.486575*0.491436; - if(PUValue==3) WeightMC=WeightMC*3.04295*2.22316*2.7563; - if(PUValue==4) WeightMC=WeightMC*1.1615*0.864842*1.0667; - if(PUValue==5) WeightMC=WeightMC*1.1548*0.871069*1.05845; - if(PUValue==6) WeightMC=WeightMC*1.05194*0.809438*0.973934; - if(PUValue==7) WeightMC=WeightMC*1.13305*0.877764*1.0274; - if(PUValue==8) WeightMC=WeightMC*1.1113*0.87246*0.993396; - if(PUValue==9) WeightMC=WeightMC*1.12867*0.897374*0.994636; - if(PUValue==10) WeightMC=WeightMC*1.37858*1.11327*1.19816; - if(PUValue==11) WeightMC=WeightMC*0.980989*0.809113*0.843709; - if(PUValue==12) WeightMC=WeightMC*1.05204*0.892604*0.906712; - if(PUValue==13) WeightMC=WeightMC*0.988467*0.863995*0.852765; - if(PUValue==14) WeightMC=WeightMC*1.02872*0.933885*0.900774; - if(PUValue==15) WeightMC=WeightMC*1.03825*0.993352*0.937782; - if(PUValue==16) WeightMC=WeightMC*1.06262*1.08708*1.01057; - if(PUValue==17) WeightMC=WeightMC*1.03728*1.13625*1.04205; - if(PUValue==18) WeightMC=WeightMC*1.08073*1.29543*1.17618; - if(PUValue==19) WeightMC=WeightMC*0.990623*1.30234*1.17403; - if(PUValue==20) WeightMC=WeightMC*0.837278*1.22644*1.1057; - if(PUValue==21) WeightMC=WeightMC*0.98399*1.62192*1.46057; - if(PUValue==22) WeightMC=WeightMC*0.659693*1.23017*1.13012; - if(PUValue==23) WeightMC=WeightMC*0.624227*1.31342*1.22292; - if(PUValue==24) WeightMC=WeightMC*0.604303*1.41144*1.35969; - if(PUValue==25) WeightMC=WeightMC*0.368001*0.934106*0.929623; - if(PUValue==26) WeightMC=WeightMC*0.681775*1.78803*1.86664; - if(PUValue==27) WeightMC=WeightMC*0.146738*0.384705*0.417471; - if(PUValue==28) WeightMC=WeightMC*0.100275*0.248257*0.276309; - if(PUValue==29) WeightMC=WeightMC*0.0101723*0.0215978*0.0245047; - if(PUValue==30) WeightMC=WeightMC*0.0920068*0.1853*0.212557; - if(PUValue==31) WeightMC=WeightMC*0.00156869*0.00278051*0.00324063; - if(PUValue==32) WeightMC=WeightMC*0.000224117*0.000361503*0.000429415; - if(PUValue==33) WeightMC=WeightMC*5.23446e-05*9.00635e-05*0.000106457; - if(PUValue==34) WeightMC=WeightMC*0.000863209*0.00110908*0.00131942; - if(PUValue==35) WeightMC=WeightMC*1.81972e-05*2.03696e-05*2.40029e-05;*/ - - //////////////////////// MIKKO METHOD ////////////////////////////////////////////// - - //RUNB - /*if(PUValue==0) WeightMC=WeightMC*5.02417; - if(PUValue==1) WeightMC=WeightMC*0.92605; - if(PUValue==2) WeightMC=WeightMC*98.52599; - if(PUValue==3) WeightMC=WeightMC*2.74279; - if(PUValue==4) WeightMC=WeightMC*0.04558; - if(PUValue==5) WeightMC=WeightMC*0.06637; - if(PUValue==6) WeightMC=WeightMC*0.00301; - if(PUValue==7) WeightMC=WeightMC*0.00496; - if(PUValue==8) WeightMC=WeightMC*0.19185; - if(PUValue==9) WeightMC=WeightMC*0.05482; - if(PUValue==10) WeightMC=WeightMC*0.00030; - if(PUValue==11) WeightMC=WeightMC*0.00407; - if(PUValue==12) WeightMC=WeightMC*0.34996; - if(PUValue==13) WeightMC=WeightMC*0.38465; - if(PUValue==14) WeightMC=WeightMC*0.26010; - if(PUValue==15) WeightMC=WeightMC*0.00091; - if(PUValue==16) WeightMC=WeightMC*0.92053; - if(PUValue==17) WeightMC=WeightMC*0.96500; - if(PUValue==18) WeightMC=WeightMC*1.94715; - if(PUValue==19) WeightMC=WeightMC*1.00000; - if(PUValue==20) WeightMC=WeightMC*0.79781; - if(PUValue==21) WeightMC=WeightMC*1.00942; - if(PUValue==22) WeightMC=WeightMC*0.83538; - if(PUValue==23) WeightMC=WeightMC*0.91728; - if(PUValue==24) WeightMC=WeightMC*0.37085; - if(PUValue>=25) WeightMC=WeightMC*0;*/ - - //RUNC - if(PUValue==0) WeightMC=WeightMC*467.57407; - if(PUValue==1) WeightMC=WeightMC*30.31823; - if(PUValue==2) WeightMC=WeightMC*26.30839; - if(PUValue==3) WeightMC=WeightMC*6.08921; - if(PUValue==4) WeightMC=WeightMC*0; - if(PUValue==5) WeightMC=WeightMC*0; - if(PUValue==6) WeightMC=WeightMC*0.97311; - if(PUValue==7) WeightMC=WeightMC*0.12387; - if(PUValue==8) WeightMC=WeightMC*0.00199; - if(PUValue==9) WeightMC=WeightMC*0; - if(PUValue==10) WeightMC=WeightMC*0.03264; - if(PUValue==11) WeightMC=WeightMC*0.05545; - if(PUValue==12) WeightMC=WeightMC*0.01525; - if(PUValue==13) WeightMC=WeightMC*0.00746; - if(PUValue==14) WeightMC=WeightMC*0.00383; - if(PUValue==15) WeightMC=WeightMC*0.43554; - if(PUValue==16) WeightMC=WeightMC*1.45626; - if(PUValue==17) WeightMC=WeightMC*1.07330; - if(PUValue==18) WeightMC=WeightMC*1.20143; - if(PUValue==19) WeightMC=WeightMC*1; - if(PUValue==20) WeightMC=WeightMC*0.98406; - if(PUValue==21) WeightMC=WeightMC*1.51376; - if(PUValue==22) WeightMC=WeightMC*1.24476; - if(PUValue==23) WeightMC=WeightMC*1.25060; - if(PUValue==24) WeightMC=WeightMC*0.97207; - if(PUValue==25) WeightMC=WeightMC*0.47589; - if(PUValue>=26) WeightMC=WeightMC*0; - } - - hweight=WeightMC; - - } - if(hweight<0){ continue; } - - //cout<<"************************* NEW EVENT ******************************************"< decade) - cout<<10*k<<" %"<fired(ihltj[j]) > 0) { - hltPassj[j] = true; - if(Event->preL1(ihltj[j])>=0){ prescalej[j] = Event->preL1(ihltj[j]) * Event->preHLT(ihltj[j]);} - else {prescalej[j] = Event->preHLT(ihltj[j]);} - if(mprintOk==4){ - cout<preL1(ihltj[j])<<" "<< Event->preHLT(ihltj[j])<evtHdr().lumi(); - - double pthat = Event->evtHdr().pthat(); - double mc_weight = Event->evtHdr().weight(); - if(mprintOk==10) printf("\npthat=%f mc_weight=%e\n",pthat,mc_weight); - - mc_pthat->Fill(pthat); - mc_pthat_weighted->Fill(pthat,hweight); - - unsigned n_genJets = Event->nGenJets(); - unsigned n_PFJets = Event->nPFJetsCHS(); - int DetJets=0; - int DETjet_ok[100]; for(int ii=0;ii<100;++ii){DETjet_ok[ii]=0;} - - jecs->JEC_CHScorrections(Event, Event->nPFJetsCHS(), mIsMCarlo,mJECUncSrcNames); - //jecs->JEC_corrections(Event, Event->nPFJetsCHS(), mIsMCarlo,mJECUncSrcNames); - - if(mIsMCarlo){ - - ///////////////////////////////////////////////////////////////////////////////////////////// - ///Examine GenJets - - /// Dump all GEN jets - if(mprintOk==2){ - printf("Number of GENJets=%d\n",n_genJets); - for(unsigned j=0; jgenjet(j).pt(),Event->genjet(j).Rapidity(),Event->genjet(j).phi()); - } - } - - ///Apply Jet cuts. Very General to all existing GEN Jets - int GENjet_ok[100]; for(int ii=0;ii<100;++ii){GENjet_ok[ii]=0;} - - int GenJets=0; - - if(mprintOk==1) cout<<"Vertex info: numVtx="<evtHdr().nVtx()<<" numVtxGood="<evtHdr().nVtxGood()<<" isPVgood()="<evtHdr().isPVgood()<Fill(Event->evtHdr().nVtx(),hweight); - /// Keep events with PVgood - if (Event->evtHdr().isPVgood() != 1) continue; - - for(unsigned j=0; j< n_genJets; ++j){ - if(Event->genjet(j).pt()genjet(j).Rapidity())>mYMax) continue; - GENjet_ok[j]=1; - - if(Event->genjet(j).pt()>=50){ - GenJets++; - - if(fabs(Event->genjet(j).Rapidity())<=0.5) pt_GENInclJet_1bin->Fill(Event->genjet(j).pt(),hweight); - if(fabs(Event->genjet(j).Rapidity())>0.5 && fabs(Event->genjet(j).Rapidity())<=1.0) pt_GENInclJet_2bin->Fill(Event->genjet(j).pt(),hweight); - if(fabs(Event->genjet(j).Rapidity())>1.0 && fabs(Event->genjet(j).Rapidity())<=1.5) pt_GENInclJet_3bin->Fill(Event->genjet(j).pt(),hweight); - if(fabs(Event->genjet(j).Rapidity())>1.5 && fabs(Event->genjet(j).Rapidity())<=2.0) pt_GENInclJet_4bin->Fill(Event->genjet(j).pt(),hweight); - if(fabs(Event->genjet(j).Rapidity())>2.0 && fabs(Event->genjet(j).Rapidity())<=2.5) pt_GENInclJet_5bin->Fill(Event->genjet(j).pt(),hweight); - if(fabs(Event->genjet(j).Rapidity())>2.5 && fabs(Event->genjet(j).Rapidity())<=3.0) pt_GENInclJet_6bin->Fill(Event->genjet(j).pt(),hweight); - if(fabs(Event->genjet(j).Rapidity())>3.2 && fabs(Event->genjet(j).Rapidity())<=4.7) pt_GENInclJet_7bin->Fill(Event->genjet(j).pt(),hweight); - } - } - - Multiplicity_GENJet->Fill(GenJets,hweight); - - /// Keep events where leading Jet[0] and Jet[1] survived cuts - if((GENjet_ok[0]==1)&&(GENjet_ok[1]==1)) { - - ///////////////////////////////////// Measurement with Gen Jets /////////////////////////////////////////////////// - - pt0_GENJet->Fill(Event->genjet(0).pt(),hweight); - pt1_GENJet->Fill(Event->genjet(1).pt(),hweight); - y0_GENJet->Fill(Event->genjet(0).Rapidity(),hweight); - y1_GENJet->Fill(Event->genjet(1).Rapidity(),hweight); - phi0_GENJet->Fill(Event->genjet(0).phi(),hweight); - phi1_GENJet->Fill(Event->genjet(1).phi(),hweight); - - } //end of GEN Jets - - - ///////////////////////////////////////////////////////////////////////////////////////////// - /// PFJets - /////////////////////////////////////////////Vertex!!!!//////////////////////////////////////////////////////// - - /// Vertex selection - TruePileUpMC->Fill(Event->evtHdr().trpu(),hweight); - PileUpVSVertex->Fill(TruePileUpInteger,Event->evtHdr().nVtx(),hweight); - - //cout<evtHdr().pu()<<" "<evtHdr().ootpuEarly()<<" "<evtHdr().ootpuLate()<<" "<evtHdr().intpu()<<" "<evtHdr().nbx()<pfjetchs(j).ptCor(),Event->pfjetchs(j).y(),Event->pfjetchs(j).phi());} - } - - ///Apply Jet cuts. Very Deteral to all existing DET Jets - - for(unsigned j=0; j< Event->nPFJetsCHS(); ++j){ - if(Event->pfjetchs(j).ptCor()pfjetchs(j).y())>mYMax) continue; - - //if(mLowPileUp) {if (TruePileUpInteger<=5) continue;} - - //if(Event->pfjetchs(j).ptCor()>=50 && TruePileUpInteger<=10){ - if(Event->pfjetchs(j).ptCor()>=50){ - - DetJets++; - DETjet_ok[j]=1; - - pt0_DETInclJet->Fill(Event->pfjetchs(j).ptCor(),hweight); - pt0_DETInclJetUncor->Fill(Event->pfjetchs(j).pt(),hweight); - y0_DETInclJet->Fill(Event->pfjetchs(j).y(),hweight); - phi0_DETInclJet->Fill(Event->pfjetchs(j).phi(),hweight); - - //new histograms - Chargedhf0_DETJet->Fill(Event->pfjetchs(j).chf(),hweight);//charged hadron energy fraction - Neutralhf0_DETJet->Fill(Event->pfjetchs(j).nhf(),hweight);//neutral hadron energy fraction - Chargedef0_DETJet->Fill(Event->pfjetchs(j).cemf(),hweight);//charged em energy fraction - Photonef0_DETJet->Fill(Event->pfjetchs(j).nemf(),hweight);//neutral em energy fraction - Hadronef0_DETJet->Fill(Event->pfjetchs(j).hf_hf(),hweight);//hadron fraction energy fraction - Electromagneticef0_DETJet->Fill(Event->pfjetchs(j).hf_phf(),hweight);//electromagnetic fraction energy fraction - Muonef0_DETJet->Fill(Event->pfjetchs(j).muf(),hweight); //muon fraction energy fraction - - ChargedhMultiplicity0_DETJet->Fill(Event->pfjetchs(j).chm(),hweight);//charged hadron multiplicity - NeutralhMultiplicity0_DETJet->Fill(Event->pfjetchs(j).nhm(),hweight);//neutral hadron multiplicity - ChargedeMultiplicity0_DETJet->Fill(Event->pfjetchs(j).elm(),hweight);//electron em multiplicity - PhotoneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).phm(),hweight);//neutral em multiplicity - HadroneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).hf_hm(),hweight);//hadron fraction multiplicity - ElectromagneticeMultiplicity0_DETJet->Fill(Event->pfjetchs(j).hf_phm(),hweight);//electromagnetic fraction multiplicity - MuoneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).mum(),hweight); //muon fraction multiplicity - - if(fabs(Event->pfjetchs(j).y())<=0.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_1bin->Fill(Event->pfjetchs(j).ptCor(),hweight); pt_DETInclJetUP_1bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_1bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>0.5 && fabs(Event->pfjetchs(j).y())<=1.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_2bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_2bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_2bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>1.0 && fabs(Event->pfjetchs(j).y())<=1.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_3bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_3bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_3bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>1.5 && fabs(Event->pfjetchs(j).y())<=2.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_4bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_4bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_4bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>2.0 && fabs(Event->pfjetchs(j).y())<=2.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_5bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_5bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_5bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>2.5 && fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_6bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_6bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_6bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>3.2 && fabs(Event->pfjetchs(j).y())<=4.7) { - if(Event->pfjetchs(j).nemf()<0.90 && Event->pfjetchs(j).ncand()>10)//tight JETID forward region - {pt_DETInclJet_7bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_7bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_7bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - } - } - } - - if(DETjet_ok[0]==1){ - TruePileUpMCInteger->Fill(TruePileUpInteger,hweight); - num_of_VtxGood->Fill(Event->evtHdr().nVtxGood(),hweight); - - if(fabs(Event->pfjetchs(0).y())<=3.0 && Event->pfjetchs(0).tightID()){ - MET_DET->Fill(Event->pfmet().met(),hweight); - METPhi_DET->Fill(fabs(Event->pfmet().phi()),hweight); - FractionMET_DET->Fill(Event->pfmet().met_o_sumet(),hweight); - } - if(fabs(Event->pfjetchs(0).y())>3.2){ - if(Event->pfjetchs(0).nemf()<0.90 && Event->pfjetchs(0).ncand()>10){//tight JETID forward region - MET_DET->Fill(Event->pfmet().met(),hweight); - METPhi_DET->Fill(fabs(Event->pfmet().phi()),hweight); - FractionMET_DET->Fill(Event->pfmet().met_o_sumet(),hweight); - } - } - } - - /// Keep events where leading Jet[0] and Jet[1] survived cuts - if((DETjet_ok[0]==1)&&(DETjet_ok[1]==1)) { - - ///////////////////////////////////// Measurement with Det Jets /////////////////////////////////////////////////// - - pt0_DETJet->Fill(Event->pfjetchs(0).ptCor(),hweight); - pt0_DETJetUncor->Fill(Event->pfjetchs(0).pt(),hweight); - pt1_DETJet->Fill(Event->pfjetchs(1).ptCor(),hweight); - pt1_DETJetUncor->Fill(Event->pfjetchs(1).pt(),hweight); - y0_DETJet->Fill(Event->pfjetchs(0).y(),hweight); - y1_DETJet->Fill(Event->pfjetchs(1).y(),hweight); - phi0_DETJet->Fill(Event->pfjetchs(0).phi(),hweight); - phi1_DETJet->Fill(Event->pfjetchs(1).phi(),hweight); - } - - /// Vertex selection - if(mprintOk==1) cout<<"Vertex info: numVtx="<evtHdr().nVtx()<<" numVtxGood="<evtHdr().nVtxGood()<<" isPVgood()="<evtHdr().isPVgood()<<" pfRho="<evtHdr().pfRho()<nPFJetsCHS()); - for(unsigned j=0; jnPFJetsCHS(); ++j){ - printf("j=%2d pt=%8.3f ptCor=%8.3f y=%6.3f phi=%6.3f cor=%6.3f tightID=%d\n",j,Event->pfjetchs(j).pt(),Event->pfjetchs(j).ptCor(),Event->pfjetchs(j).y(),Event->pfjetchs(j).phi(),Event->pfjetchs(j).cor(),Event->pfjetchs(j).tightID()); - } - } - - // PURITY AND STABILITY - for(unsigned j=0; j< Event->nPFJetsCHS(); ++j){ - if(Event->pfjetchs(j).ptCor()pfjetchs(j).y())>mYMax) continue; - - int histoEntry=0; - double matchJet=1000; - double matchJetCounter=1000; - - for(unsigned i=0; i< n_genJets; ++i){ - if(Event->genjet(i).pt()genjet(i).Rapidity())>mYMax) continue; - - double deltaPhiMatch=Event->genjet(i).phi()-Event->pfjetchs(j).phi(); - if(deltaPhiMatch<-TMath::Pi()) deltaPhiMatch=deltaPhiMatch+2*TMath::Pi(); - if(deltaPhiMatch>TMath::Pi()) deltaPhiMatch=deltaPhiMatch-2*TMath::Pi(); - deltaPhiMatch=fabs(deltaPhiMatch); - - matchJetCounter=sqrt(pow(Event->genjet(i).Rapidity()-Event->pfjetchs(j).y(),2)+pow(deltaPhiMatch,2)); - - if(matchJetCounter<=matchJet) matchJet=matchJetCounter; - - if (matchJetCounter<0.3 && histoEntry==0){ - histoEntry=1; - PF_MatchedInclusiveJets->Fill(Event->pfjetchs(j).ptCor(),hweight); - Gen_MatchedInclusiveJets->Fill(Event->genjet(i).pt(),hweight); - TwoD_MatchedInclusiveJets->Fill(Event->pfjetchs(j).ptCor(),Event->genjet(i).pt(),hweight); - - //Separation in eta bins - if(fabs(Event->pfjetchs(j).y())<=0.5 && Event->pfjetchs(j).tightID()) { PF_MatchedInclusiveJets_1bin->Fill(Event->pfjetchs(j).ptCor(),hweight); Gen_MatchedInclusiveJets_1bin->Fill(Event->genjet(i).pt(),hweight); TwoD_MatchedInclusiveJets_1bin->Fill(Event->pfjetchs(j).ptCor(),Event->genjet(i).pt(),hweight); } - if(fabs(Event->pfjetchs(j).y())>0.5 && fabs(Event->pfjetchs(j).y())<=1.0 && Event->pfjetchs(j).tightID()) { PF_MatchedInclusiveJets_2bin->Fill(Event->pfjetchs(j).ptCor(),hweight); Gen_MatchedInclusiveJets_2bin->Fill(Event->genjet(i).pt(),hweight); TwoD_MatchedInclusiveJets_2bin->Fill(Event->pfjetchs(j).ptCor(),Event->genjet(i).pt(),hweight); } - if(fabs(Event->pfjetchs(j).y())>1.0 && fabs(Event->pfjetchs(j).y())<=1.5 && Event->pfjetchs(j).tightID()) { PF_MatchedInclusiveJets_3bin->Fill(Event->pfjetchs(j).ptCor(),hweight); Gen_MatchedInclusiveJets_3bin->Fill(Event->genjet(i).pt(),hweight); TwoD_MatchedInclusiveJets_3bin->Fill(Event->pfjetchs(j).ptCor(),Event->genjet(i).pt(),hweight); } - if(fabs(Event->pfjetchs(j).y())>1.5 && fabs(Event->pfjetchs(j).y())<=2.0 && Event->pfjetchs(j).tightID()) { PF_MatchedInclusiveJets_4bin->Fill(Event->pfjetchs(j).ptCor(),hweight); Gen_MatchedInclusiveJets_4bin->Fill(Event->genjet(i).pt(),hweight); TwoD_MatchedInclusiveJets_4bin->Fill(Event->pfjetchs(j).ptCor(),Event->genjet(i).pt(),hweight); } - if(fabs(Event->pfjetchs(j).y())>2.0 && fabs(Event->pfjetchs(j).y())<=2.5 && Event->pfjetchs(j).tightID()) { PF_MatchedInclusiveJets_5bin->Fill(Event->pfjetchs(j).ptCor(),hweight); Gen_MatchedInclusiveJets_5bin->Fill(Event->genjet(i).pt(),hweight); TwoD_MatchedInclusiveJets_5bin->Fill(Event->pfjetchs(j).ptCor(),Event->genjet(i).pt(),hweight); } - if(fabs(Event->pfjetchs(j).y())>2.5 && fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID()) { PF_MatchedInclusiveJets_6bin->Fill(Event->pfjetchs(j).ptCor(),hweight); Gen_MatchedInclusiveJets_6bin->Fill(Event->genjet(i).pt(),hweight); TwoD_MatchedInclusiveJets_6bin->Fill(Event->pfjetchs(j).ptCor(),Event->genjet(i).pt(),hweight); } - if(fabs(Event->pfjetchs(j).y())>3.2 && fabs(Event->pfjetchs(j).y())<=4.7) { - if(Event->pfjetchs(j).nemf()<0.90 && Event->pfjetchs(j).ncand()>10){//tight JETID forward region - PF_MatchedInclusiveJets_7bin->Fill(Event->pfjetchs(j).ptCor(),hweight); Gen_MatchedInclusiveJets_7bin->Fill(Event->genjet(i).pt(),hweight); TwoD_MatchedInclusiveJets_7bin->Fill(Event->pfjetchs(j).ptCor(),Event->genjet(i).pt(),hweight); } - } - - //Evaluation of resolution - double resolution=fabs(Event->pfjetchs(j).ptCor()-Event->genjet(i).pt())/Event->genjet(i).pt(); - double resolutionNoAbs=(Event->pfjetchs(j).ptCor()-Event->genjet(i).pt())/Event->genjet(i).pt(); - Resolution1D->Fill(resolutionNoAbs,hweight); - ResolutionInclusiveJets->Fill(Event->pfjetchs(j).ptCor(),resolution,hweight); - //Fill that for each eta bins - //ResolutionHistoPt1bin[0]->Fill(resolution,hweight); - - if(fabs(Event->pfjetchs(j).y())<=0.5 && Event->pfjetchs(j).tightID()) ResolutionInclusiveJets_1bin->Fill(Event->pfjetchs(j).ptCor(),resolution,hweight); - if(fabs(Event->pfjetchs(j).y())>0.5 && fabs(Event->pfjetchs(j).y())<=1.0 && Event->pfjetchs(j).tightID()) ResolutionInclusiveJets_2bin->Fill(Event->pfjetchs(j).ptCor(),resolution,hweight); - if(fabs(Event->pfjetchs(j).y())>1.0 && fabs(Event->pfjetchs(j).y())<=1.5 && Event->pfjetchs(j).tightID()) ResolutionInclusiveJets_3bin->Fill(Event->pfjetchs(j).ptCor(),resolution,hweight); - if(fabs(Event->pfjetchs(j).y())>1.5 && fabs(Event->pfjetchs(j).y())<=2.0 && Event->pfjetchs(j).tightID()) ResolutionInclusiveJets_4bin->Fill(Event->pfjetchs(j).ptCor(),resolution,hweight); - if(fabs(Event->pfjetchs(j).y())>2.0 && fabs(Event->pfjetchs(j).y())<=2.5 && Event->pfjetchs(j).tightID()) ResolutionInclusiveJets_5bin->Fill(Event->pfjetchs(j).ptCor(),resolution,hweight); - if(fabs(Event->pfjetchs(j).y())>2.5 && fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID()) ResolutionInclusiveJets_6bin->Fill(Event->pfjetchs(j).ptCor(),resolution,hweight); - if(fabs(Event->pfjetchs(j).y())>3.2 && fabs(Event->pfjetchs(j).y())<=4.7){ - if(Event->pfjetchs(j).nemf()<0.90 && Event->pfjetchs(j).ncand()>10){//tight JETID forward region - {ResolutionInclusiveJets_7bin->Fill(Event->pfjetchs(j).ptCor(),resolution,hweight); ResolutionForward1D->Fill(resolutionNoAbs,hweight);} - } - } - } - } - - DeltaR_Jets->Fill(matchJet,hweight); - - if (matchJet>0.3){ - PF_FakeInclusiveJets->Fill(Event->pfjetchs(j).ptCor(),hweight); - - if(fabs(Event->pfjetchs(j).y())<=0.5 && Event->pfjetchs(j).tightID()) PF_FakeInclusiveJets_1bin->Fill(Event->pfjetchs(j).ptCor(),hweight); - if(fabs(Event->pfjetchs(j).y())>0.5 && fabs(Event->pfjetchs(j).y())<=1.0 && Event->pfjetchs(j).tightID()) PF_FakeInclusiveJets_2bin->Fill(Event->pfjetchs(j).ptCor(),hweight); - if(fabs(Event->pfjetchs(j).y())>1.0 && fabs(Event->pfjetchs(j).y())<=1.5 && Event->pfjetchs(j).tightID()) PF_FakeInclusiveJets_3bin->Fill(Event->pfjetchs(j).ptCor(),hweight); - if(fabs(Event->pfjetchs(j).y())>1.5 && fabs(Event->pfjetchs(j).y())<=2.0 && Event->pfjetchs(j).tightID()) PF_FakeInclusiveJets_4bin->Fill(Event->pfjetchs(j).ptCor(),hweight); - if(fabs(Event->pfjetchs(j).y())>2.0 && fabs(Event->pfjetchs(j).y())<=2.5 && Event->pfjetchs(j).tightID()) PF_FakeInclusiveJets_5bin->Fill(Event->pfjetchs(j).ptCor(),hweight); - if(fabs(Event->pfjetchs(j).y())>2.5 && fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID()) PF_FakeInclusiveJets_6bin->Fill(Event->pfjetchs(j).ptCor(),hweight); - if(fabs(Event->pfjetchs(j).y())>3.2 && fabs(Event->pfjetchs(j).y())<=4.7) PF_FakeInclusiveJets_7bin->Fill(Event->pfjetchs(j).ptCor(),hweight); - - } - } - - // Missed Events at the Gen Level - for(unsigned i=0; i< n_genJets; ++i){ - if(Event->genjet(i).pt()genjet(i).Rapidity())>mYMax) continue; - double matchJet=1000; - double matchJetCounter=1000; - - for(unsigned j=0; j< Event->nPFJetsCHS(); ++j){ - if(Event->pfjetchs(j).ptCor()pfjetchs(j).y())>mYMax) continue; - - if(fabs(Event->pfjetchs(j).y())<=3.0 && !Event->pfjetchs(j).tightID()) continue; - - double deltaPhiMatch=Event->genjet(i).phi()-Event->pfjetchs(j).phi(); - if(deltaPhiMatch<-TMath::Pi()) deltaPhiMatch=deltaPhiMatch+2*TMath::Pi(); - if(deltaPhiMatch>TMath::Pi()) deltaPhiMatch=deltaPhiMatch-2*TMath::Pi(); - deltaPhiMatch=fabs(deltaPhiMatch); - - matchJetCounter=sqrt(pow(Event->genjet(i).Rapidity()-Event->pfjetchs(j).y(),2)+pow(deltaPhiMatch,2)); - if(matchJetCounter<=matchJet) matchJet=matchJetCounter; - } - - if (matchJet>0.3){ - Gen_MissInclusiveJets->Fill(Event->genjet(i).pt(),hweight); - - if(fabs(Event->genjet(i).Rapidity())<=0.5) Gen_MissInclusiveJets_1bin->Fill(Event->genjet(i).pt(),hweight); - if(fabs(Event->genjet(i).Rapidity())>0.5 && fabs(Event->genjet(i).Rapidity())<=1.0) Gen_MissInclusiveJets_2bin->Fill(Event->genjet(i).pt(),hweight); - if(fabs(Event->genjet(i).Rapidity())>1.0 && fabs(Event->genjet(i).Rapidity())<=1.5) Gen_MissInclusiveJets_3bin->Fill(Event->genjet(i).pt(),hweight); - if(fabs(Event->genjet(i).Rapidity())>1.5 && fabs(Event->genjet(i).Rapidity())<=2.0) Gen_MissInclusiveJets_4bin->Fill(Event->genjet(i).pt(),hweight); - if(fabs(Event->genjet(i).Rapidity())>2.0 && fabs(Event->genjet(i).Rapidity())<=2.5) Gen_MissInclusiveJets_5bin->Fill(Event->genjet(i).pt(),hweight); - if(fabs(Event->genjet(i).Rapidity())>2.5 && fabs(Event->genjet(i).Rapidity())<=3.0) Gen_MissInclusiveJets_6bin->Fill(Event->genjet(i).pt(),hweight); - if(fabs(Event->genjet(i).Rapidity())>3.2 && fabs(Event->genjet(i).Rapidity())<=4.7) Gen_MissInclusiveJets_7bin->Fill(Event->genjet(i).pt(),hweight); - - /*if(fabs(Event->genjet(i).y())<=0.5) { resp_jetpt1etabin->Miss(Event->genjet(i).pt(),hweight);} - if(fabs(Event->genjet(i).y())>0.5 && fabs(Event->genjet(i).y())<=1.0) { resp_jetpt2etabin->Miss(Event->genjet(i).pt(),hweight);} - if(fabs(Event->genjet(i).y())>1.0 && fabs(Event->genjet(i).y())<=1.5) { resp_jetpt3etabin->Miss(Event->genjet(i).pt(),hweight);} - if(fabs(Event->genjet(i).y())>1.5 && fabs(Event->genjet(i).y())<=2.0) { resp_jetpt4etabin->Miss(Event->genjet(i).pt(),hweight);} - if(fabs(Event->genjet(i).y())>2.0 && fabs(Event->genjet(i).y())<=2.5) { resp_jetpt5etabin->Miss(Event->genjet(i).pt(),hweight);} - if(fabs(Event->genjet(i).y())>2.5 && fabs(Event->genjet(i).y())<=3.0) { resp_jetpt6etabin->Miss(Event->genjet(i).pt(),hweight);} - if(fabs(Event->genjet(i).y())>3.2 && fabs(Event->genjet(i).y())<=4.7) { resp_jetpt7etabin->Miss(Event->genjet(i).pt(),hweight);}*/ - } - } - } - - // Trigger Ranges code - if(!mIsMCarlo){ - - double leading_pt = -10.0; - double leading_eta = -10.0; - - num_of_Vtx->Fill(Event->evtHdr().nVtx(),hweight); - /// Keep events with PVgood - - if(mprintOk==1){ - for(unsigned j=0; jnPFJets(); ++j){ - if(Event->evtHdr().runNo()==251252){ - if(Event->evtHdr().lumi()==158 && Event->evtHdr().event()==95957128) { - cout<evtHdr().event()<pfjet(j).ptCor(),Event->pfjet(j).y(),Event->pfjet(j).phi());} - if(Event->evtHdr().lumi()==158 && Event->evtHdr().event()==95734424) { - cout<evtHdr().event()<pfjet(j).ptCor(),Event->pfjet(j).y(),Event->pfjet(j).phi());} - if(Event->evtHdr().lumi()==158 && Event->evtHdr().event()==95800780) { - cout<evtHdr().event()<pfjet(j).ptCor(),Event->pfjet(j).y(),Event->pfjet(j).phi());} - } - } - } - - if (Event->evtHdr().isPVgood() != 1) continue; - - for (int j=0; jnL1Obj(ihltj[j]); l1iobj++ ) - { - //cout << "L1 object id: "< " << Event->l1obj(ihltj[j],l1iobj).pt() << " > " << ATrig[j] << endl; - if (Event->l1obj(ihltj[j],l1iobj).pt() > ATrig[j]) //threshold for L1 trigger - { - l1cut[j] = true; - } - } - - //----------------- HLT Theshold Checking --------------------------// - for ( unsigned hltiobj=0; hltiobjnHLTObj(ihltj[j]); hltiobj++ ) - { - //cout << "HLT object id: " << hltiobj << " -> " << Event->hltobj(ihltj[j],hltiobj).pt() << " > " << HLTJetPtNThres[j] << endl; - if (Event->hltobj(ihltj[j],hltiobj).pt() > HLTJetPtNThres[j]) //threshold for HLT trigger - { - hltcut[j] = true; - } - } - } - } - - //Trigger tag-and-probe - - if(Event->nPFJetsCHS()>=2) { - int selectEventsLead=0; - int selectEventsSubLead=0; - - if(fabs(Event->pfjetchs(0).eta())<1.3){ - - for ( unsigned hltiobj=0; hltiobjnHLTObj(ihltj[1]); hltiobj++ ) - { - - double deltaPhiMatch=Event->pfjetchs(0).phi()-Event->hltobj(ihltj[1],hltiobj).phi(); - if(deltaPhiMatch<-TMath::Pi()) deltaPhiMatch=deltaPhiMatch+2*TMath::Pi(); - if(deltaPhiMatch>TMath::Pi()) deltaPhiMatch=deltaPhiMatch-2*TMath::Pi(); - deltaPhiMatch=fabs(deltaPhiMatch); - - double matchJetCounter=sqrt(pow(Event->pfjetchs(0).eta()-Event->hltobj(ihltj[1],hltiobj).eta(),2)+pow(deltaPhiMatch,2)); - - if (matchJetCounter<0.5 && Event->hltobj(ihltj[1],hltiobj).pt()>10){ - double ResHLT=(Event->pfjetchs(0).ptCor()-Event->hltobj(ihltj[1],hltiobj).pt())/Event->pfjetchs(0).ptCor(); - ResolutionTagAndProbe->Fill(Event->pfjetchs(0).ptCor(),ResHLT,hweight); - } - - if (matchJetCounter<0.5 && Event->hltobj(ihltj[1],hltiobj).pt()>60){ - selectEventsLead=1; - } - - } - } - - if(fabs(Event->pfjetchs(1).eta())<1.3){ - for ( unsigned hltiobj=0; hltiobjnHLTObj(ihltj[1]); hltiobj++ ) - { - - double deltaPhiMatch=Event->pfjetchs(1).phi()-Event->hltobj(ihltj[1],hltiobj).phi(); - if(deltaPhiMatch<-TMath::Pi()) deltaPhiMatch=deltaPhiMatch+2*TMath::Pi(); - if(deltaPhiMatch>TMath::Pi()) deltaPhiMatch=deltaPhiMatch-2*TMath::Pi(); - deltaPhiMatch=fabs(deltaPhiMatch); - - double matchJetCounter=sqrt(pow(Event->pfjetchs(1).eta()-Event->hltobj(ihltj[1],hltiobj).eta(),2)+pow(deltaPhiMatch,2)); - - if (matchJetCounter<0.5 && Event->hltobj(ihltj[1],hltiobj).pt()>10){ - double ResHLT=(Event->pfjetchs(1).ptCor()-Event->hltobj(ihltj[1],hltiobj).pt())/Event->pfjetchs(1).ptCor(); - ResolutionTagAndProbe->Fill(Event->pfjetchs(1).ptCor(),ResHLT,hweight); - } - - if (matchJetCounter<0.5 && Event->hltobj(ihltj[1],hltiobj).pt()>60) //threshold for HLT trigger - { - selectEventsSubLead=1; - } - } - } - - int TriggerDenLead=0; - int TriggerDenLeadMatch=0; - int TriggerNumLead=0; - - int TriggerDenSubLead=0; - int TriggerDenSubLeadMatch=0; - int TriggerNumSubLead=0; - - if(selectEventsLead){ - - if(fabs(Event->pfjetchs(1).eta())<1.5){ - - double deltaPhiMatch=Event->pfjetchs(0).phi()-Event->pfjetchs(1).phi(); - if(deltaPhiMatch<-TMath::Pi()) deltaPhiMatch=deltaPhiMatch+2*TMath::Pi(); - if(deltaPhiMatch>TMath::Pi()) deltaPhiMatch=deltaPhiMatch-2*TMath::Pi(); - deltaPhiMatch=fabs(deltaPhiMatch); - - if(Event->nPFJetsCHS()==2 && deltaPhiMatch>2.7){TriggerDenLead=1;} - double ptBalance=0.3*(Event->pfjetchs(0).ptCor()+Event->pfjetchs(1).ptCor())/2; - if(Event->nPFJetsCHS()>2 && deltaPhiMatch>2.7 && Event->pfjetchs(2).ptCor()nHLTObj(ihltj[1]); hltiobj++ ) - { - - double deltaPhiMatch2=Event->pfjetchs(1).phi()-Event->hltobj(ihltj[1],hltiobj).phi(); - if(deltaPhiMatch2<-TMath::Pi()) deltaPhiMatch2=deltaPhiMatch2+2*TMath::Pi(); - if(deltaPhiMatch2>TMath::Pi()) deltaPhiMatch2=deltaPhiMatch2-2*TMath::Pi(); - deltaPhiMatch2=fabs(deltaPhiMatch2); - - double matchJetCounter2=sqrt(pow(Event->pfjetchs(1).eta()-Event->hltobj(ihltj[1],hltiobj).eta(),2)+pow(deltaPhiMatch2,2)); - - if (matchJetCounter2<0.2){ - TriggerDenLeadMatch=1; - if(Event->hltobj(ihltj[1],hltiobj).pt()>60){ - //cout<pfjetchs(1).ptCor()<<" "<hltobj(ihltj[1],hltiobj).pt()<pfjetchs(0).eta())<1.5){ - - double deltaPhiMatch=Event->pfjetchs(0).phi()-Event->pfjetchs(1).phi(); - if(deltaPhiMatch<-TMath::Pi()) deltaPhiMatch=deltaPhiMatch+2*TMath::Pi(); - if(deltaPhiMatch>TMath::Pi()) deltaPhiMatch=deltaPhiMatch-2*TMath::Pi(); - deltaPhiMatch=fabs(deltaPhiMatch); - - if(Event->nPFJetsCHS()==2 && deltaPhiMatch>2.7){TriggerDenSubLead=1;} - double ptBalance=0.3*(Event->pfjetchs(0).ptCor()+Event->pfjetchs(1).ptCor())/2; - if(Event->nPFJetsCHS()>2 && deltaPhiMatch>2.7 && Event->pfjetchs(2).ptCor()nHLTObj(ihltj[1]); hltiobj++ ) - { - - double deltaPhiMatch2=Event->pfjetchs(0).phi()-Event->hltobj(ihltj[1],hltiobj).phi(); - if(deltaPhiMatch2<-TMath::Pi()) deltaPhiMatch2=deltaPhiMatch2+2*TMath::Pi(); - if(deltaPhiMatch2>TMath::Pi()) deltaPhiMatch2=deltaPhiMatch2-2*TMath::Pi(); - deltaPhiMatch2=fabs(deltaPhiMatch2); - - double matchJetCounter2=sqrt(pow(Event->pfjetchs(0).eta()-Event->hltobj(ihltj[1],hltiobj).eta(),2)+pow(deltaPhiMatch2,2)); - - if(matchJetCounter2<0.2){ - TriggerDenSubLeadMatch=1; - - if(Event->hltobj(ihltj[1],hltiobj).pt()>60){ - TriggerNumSubLead=1; - } - } - } - } - } - } - - if(random==1){ - random=0; - if(TriggerDenLeadMatch){TagAndProbeDen->Fill(Event->pfjetchs(1).ptCor(),hweight);} - if(TriggerNumLead){TagAndProbeNum->Fill(Event->pfjetchs(1).ptCor(),hweight);} - } - - if(random==0){ - random=1; - if(TriggerDenSubLeadMatch){TagAndProbeDen->Fill(Event->pfjetchs(0).ptCor(),hweight);} - if(TriggerNumSubLead){TagAndProbeNum->Fill(Event->pfjetchs(0).ptCor(),hweight);} - } - } - - //end of trigger tag-and-probe - - for(unsigned int j=0; jnPFJetsCHS(); j++) { - double pt = Event->pfjetchs(j).ptCor(); - double eta = Event->pfjetchs(j).eta(); - - if (pt >= 20){ - if((Event->pfjetchs(j).tightID() && fabs(Event->pfjetchs(j).eta())<=3.0) || (fabs(Event->pfjetchs(j).eta())>3.0 && fabs(Event->pfjetchs(j).eta())<=4.7 && Event->pfjetchs(j).nemf()<0.90 && Event->pfjetchs(j).ncand()>10)) { - if (leading_pt < pt) { leading_pt = pt; leading_eta = eta; } - } - } - } - - hweight=1.; - - if(fabs(leading_eta)<1.5){ - if(hltPassj[0]){ - //if(prescalej[0]>0) hweight=hweight*prescalej[0]; - //if(prescalej[0]<0) hweight=hweight*(-prescalej[0]); - hist_leading_pt_all_Jet60->Fill(leading_pt,hweight); - hist_leading_eta_all_Jet60->Fill(leading_eta,hweight); - } - if (hltPassj[0] && hltcut[0]){ - //if(prescalej[0]>0) hweight=hweight*prescalej[0]; - //if(prescalej[0]<0) hweight=hweight*(-prescalej[0]); - hist_leading_pt_emulated_Jet60->Fill(leading_pt,hweight); - hist_leading_eta_emulated_Jet60->Fill(leading_eta,hweight); - } - - if(hltPassj[1]){ - //if(prescalej[1]>0) hweight=hweight*prescalej[1]; - //if(prescalej[1]<0) hweight=hweight*(-prescalej[1]); - hist_leading_pt_all_Jet80->Fill(leading_pt,hweight); - hist_leading_eta_all_Jet80->Fill(leading_eta,hweight); - } - if (hltPassj[1] && l1cut[1] && hltcut[1]){ - //if(prescalej[1]>0) hweight=hweight*prescalej[1]; - //if(prescalej[1]<0) hweight=hweight*(-prescalej[1]); - hist_leading_pt_emulated_Jet80->Fill(leading_pt,hweight); - hist_leading_eta_emulated_Jet80->Fill(leading_eta,hweight); - } - - if(hltPassj[2]){ - //if(prescalej[2]>0) hweight=hweight*prescalej[2]; - //if(prescalej[2]<0) hweight=hweight*(-prescalej[2]); - hist_leading_pt_all_Jet140->Fill(leading_pt,hweight); - hist_leading_eta_all_Jet140->Fill(leading_eta,hweight); - } - if (hltPassj[2] && l1cut[2] && hltcut[2]){ - //if(prescalej[2]>0) hweight=hweight*prescalej[2]; - //if(prescalej[2]<0) hweight=hweight*(-prescalej[2]); - hist_leading_pt_emulated_Jet140->Fill(leading_pt,hweight); - hist_leading_eta_emulated_Jet140->Fill(leading_eta,hweight); - } - - if(hltPassj[3]){ - //if(prescalej[3]>0) hweight=hweight*prescalej[3]; - //if(prescalej[3]<0) hweight=hweight*(-prescalej[3]); - hist_leading_pt_all_Jet200->Fill(leading_pt,hweight); - hist_leading_eta_all_Jet200->Fill(leading_eta,hweight); - } - if (hltPassj[3] && l1cut[3] && hltcut[3]){ - //if(prescalej[3]>0) hweight=hweight*prescalej[3]; - //if(prescalej[3]<0) hweight=hweight*(-prescalej[3]); - hist_leading_pt_emulated_Jet200->Fill(leading_pt,hweight); - hist_leading_eta_emulated_Jet200->Fill(leading_eta,hweight); - } - - if(hltPassj[4]){ - //if(prescalej[3]>0) hweight=hweight*prescalej[3]; - //if(prescalej[3]<0) hweight=hweight*(-prescalej[3]); - hist_leading_pt_all_Jet260->Fill(leading_pt,hweight); - hist_leading_eta_all_Jet260->Fill(leading_eta,hweight); - } - if (hltPassj[4] && l1cut[4] && hltcut[4]){ - //if(prescalej[3]>0) hweight=hweight*prescalej[3]; - //if(prescalej[3]<0) hweight=hweight*(-prescalej[3]); - hist_leading_pt_emulated_Jet260->Fill(leading_pt,hweight); - hist_leading_eta_emulated_Jet260->Fill(leading_eta,hweight); - } - - if(hltPassj[5]){ - //if(prescalej[4]>0) hweight=hweight*prescalej[4]; - //if(prescalej[4]<0) hweight=hweight*(-prescalej[4]); - hist_leading_pt_all_Jet320->Fill(leading_pt,hweight); - hist_leading_eta_all_Jet320->Fill(leading_eta,hweight); - } - if (hltPassj[5] && l1cut[5] && hltcut[5]){ - //if(prescalej[4]>0) hweight=hweight*prescalej[4]; - //if(prescalej[4]<0) hweight=hweight*(-prescalej[4]); - hist_leading_pt_emulated_Jet320->Fill(leading_pt,hweight); - hist_leading_eta_emulated_Jet320->Fill(leading_eta,hweight); - } - - if(hltPassj[6]){ - //if(prescalej[5]>0) hweight=hweight*prescalej[5]; - //if(prescalej[5]<0) hweight=hweight*(-prescalej[5]); - hist_leading_pt_all_Jet400->Fill(leading_pt,hweight); - hist_leading_eta_all_Jet400->Fill(leading_eta,hweight); - } - if (hltPassj[6] && l1cut[6] && hltcut[6]){ - //if(prescalej[5]>0) hweight=hweight*prescalej[5]; - //if(prescalej[5]<0) hweight=hweight*(-prescalej[5]); - hist_leading_pt_emulated_Jet400->Fill(leading_pt,hweight); - hist_leading_eta_emulated_Jet400->Fill(leading_eta,hweight); - } - - if(hltPassj[7]){ - //if(prescalej[6]>0) hweight=hweight*prescalej[6]; - //if(prescalej[6]<0) hweight=hweight*(-prescalej[6]); - hist_leading_pt_all_Jet450->Fill(leading_pt,hweight); - hist_leading_eta_all_Jet450->Fill(leading_eta,hweight); - } - if (hltPassj[7] && l1cut[7] && hltcut[7]){ - //if(prescalej[6]>0) hweight=hweight*prescalej[6]; - //if(prescalej[6]<0) hweight=hweight*(-prescalej[6]); - hist_leading_pt_emulated_Jet450->Fill(leading_pt,hweight); - hist_leading_eta_emulated_Jet450->Fill(leading_eta,hweight); - } - - if(hltPassj[8]){ - //if(prescalej[7]>0) hweight=hweight*prescalej[7]; - //if(prescalej[7]<0) hweight=hweight*(-prescalej[7]); - hist_leading_pt_all_Jet500->Fill(leading_pt,hweight); - hist_leading_eta_all_Jet500->Fill(leading_eta,hweight); - } - if (hltPassj[8] && l1cut[8] && hltcut[8]){ - //if(prescalej[7]>0) hweight=hweight*prescalej[7]; - //if(prescalej[7]<0) hweight=hweight*(-prescalej[7]); - hist_leading_pt_emulated_Jet500->Fill(leading_pt,hweight); - hist_leading_eta_emulated_Jet500->Fill(leading_eta,hweight); - } - } - - hweight=1.; - - for(unsigned int j=0; jnPFJetsCHS(); j++) { - if(Event->pfjetchs(j).ptCor()pfjetchs(j).y())>mYMax) continue; - - hweight=1.; - - //parsePileUpJSON2(); - double PileUpData=-10; - //PileUpData=getAvgPU(int(Event->evtHdr().runNo()),int(Event->evtHdr().lumi())); - - //cout<evtHdr().runNo())<<" "<evtHdr().lumi())<evtHdr().runNo()),int(Event->evtHdr().lumi()))<<" "<evtHdr().runNo())<<" "<evtHdr().lumi())<0) hweight=hweight*prescalej[1]; - if(prescalej[1]<0) hweight=hweight*(-prescalej[1]); - if(fabs(Event->pfjetchs(j).y())<=0.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet60_1bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - if(fabs(Event->pfjetchs(j).y())>=0.5 && fabs(Event->pfjetchs(j).y())<=1.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet60_2bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - if(fabs(Event->pfjetchs(j).y())>=1.0 && fabs(Event->pfjetchs(j).y())<=1.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet60_3bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - if(fabs(Event->pfjetchs(j).y())>=1.5 && fabs(Event->pfjetchs(j).y())<=2.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet60_4bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - if(fabs(Event->pfjetchs(j).y())>=2.0 && fabs(Event->pfjetchs(j).y())<=2.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet60_5bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - if(fabs(Event->pfjetchs(j).y())>=2.5 && fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet60_6bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - if(fabs(Event->pfjetchs(j).y())>=3.2 && fabs(Event->pfjetchs(j).y())<=4.7 && Event->pfjetchs(j).tightID()) {pt_DETInclJet60_7bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - } - - hweight=1.; - - if(hltPassj[2]){ - if(prescalej[2]>0) hweight=hweight*prescalej[2]; - if(prescalej[2]<0) hweight=hweight*(-prescalej[2]); - if(fabs(Event->pfjetchs(j).y())<=0.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet80_1bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - if(fabs(Event->pfjetchs(j).y())>=0.5 && fabs(Event->pfjetchs(j).y())<=1.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet80_2bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - if(fabs(Event->pfjetchs(j).y())>=1.0 && fabs(Event->pfjetchs(j).y())<=1.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet80_3bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - if(fabs(Event->pfjetchs(j).y())>=1.5 && fabs(Event->pfjetchs(j).y())<=2.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet80_4bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - if(fabs(Event->pfjetchs(j).y())>=2.0 && fabs(Event->pfjetchs(j).y())<=2.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet80_5bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - if(fabs(Event->pfjetchs(j).y())>=2.5 && fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet80_6bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - if(fabs(Event->pfjetchs(j).y())>=3.2 && fabs(Event->pfjetchs(j).y())<=4.7 && Event->pfjetchs(j).tightID()) {pt_DETInclJet80_7bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - } - - hweight=1.; - - if(hltPassj[3]){ - if(prescalej[3]>0) hweight=hweight*prescalej[3]; - if(prescalej[3]<0) hweight=hweight*(-prescalej[3]); - if(fabs(Event->pfjetchs(j).y())<=0.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet140_1bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - if(fabs(Event->pfjetchs(j).y())>=0.5 && fabs(Event->pfjetchs(j).y())<=1.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet140_2bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - if(fabs(Event->pfjetchs(j).y())>=1.0 && fabs(Event->pfjetchs(j).y())<=1.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet140_3bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - if(fabs(Event->pfjetchs(j).y())>=1.5 && fabs(Event->pfjetchs(j).y())<=2.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet140_4bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - if(fabs(Event->pfjetchs(j).y())>=2.0 && fabs(Event->pfjetchs(j).y())<=2.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet140_5bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - if(fabs(Event->pfjetchs(j).y())>=2.5 && fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet140_6bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - if(fabs(Event->pfjetchs(j).y())>=3.2 && fabs(Event->pfjetchs(j).y())<=4.7 && Event->pfjetchs(j).tightID()) {pt_DETInclJet140_7bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - } - - hweight=1.; - - if(hltPassj[4]){ - if(prescalej[4]>0) hweight=hweight*prescalej[4]; - if(prescalej[4]<0) hweight=hweight*(-prescalej[4]); - if(fabs(Event->pfjetchs(j).y())<=0.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet200_1bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - if(fabs(Event->pfjetchs(j).y())>=0.5 && fabs(Event->pfjetchs(j).y())<=1.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet200_2bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - if(fabs(Event->pfjetchs(j).y())>=1.0 && fabs(Event->pfjetchs(j).y())<=1.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet200_3bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - if(fabs(Event->pfjetchs(j).y())>=1.5 && fabs(Event->pfjetchs(j).y())<=2.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet200_4bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - if(fabs(Event->pfjetchs(j).y())>=2.0 && fabs(Event->pfjetchs(j).y())<=2.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet200_5bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - if(fabs(Event->pfjetchs(j).y())>=2.5 && fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet200_6bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - if(fabs(Event->pfjetchs(j).y())>=3.2 && fabs(Event->pfjetchs(j).y())<=4.7 && Event->pfjetchs(j).tightID()) {pt_DETInclJet200_7bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - } - - hweight=1.; - - if(hltPassj[5]){ - if(prescalej[5]>0) hweight=hweight*prescalej[5]; - if(prescalej[5]<0) hweight=hweight*(-prescalej[5]); - if(fabs(Event->pfjetchs(j).y())<=0.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet260_1bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - if(fabs(Event->pfjetchs(j).y())>=0.5 && fabs(Event->pfjetchs(j).y())<=1.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet260_2bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - if(fabs(Event->pfjetchs(j).y())>=1.0 && fabs(Event->pfjetchs(j).y())<=1.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet260_3bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - if(fabs(Event->pfjetchs(j).y())>=1.5 && fabs(Event->pfjetchs(j).y())<=2.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet260_4bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - if(fabs(Event->pfjetchs(j).y())>=2.0 && fabs(Event->pfjetchs(j).y())<=2.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet260_5bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - if(fabs(Event->pfjetchs(j).y())>=2.5 && fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet260_6bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - if(fabs(Event->pfjetchs(j).y())>=3.2 && fabs(Event->pfjetchs(j).y())<=4.7 && Event->pfjetchs(j).tightID()) {pt_DETInclJet260_7bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - } - - hweight=1.; - - if(hltPassj[6]){ - if(prescalej[6]>0) hweight=hweight*prescalej[6]; - if(prescalej[6]<0) hweight=hweight*(-prescalej[6]); - if(fabs(Event->pfjetchs(j).y())<=0.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet320_1bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - if(fabs(Event->pfjetchs(j).y())>=0.5 && fabs(Event->pfjetchs(j).y())<=1.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet320_2bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - if(fabs(Event->pfjetchs(j).y())>=1.0 && fabs(Event->pfjetchs(j).y())<=1.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet320_3bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - if(fabs(Event->pfjetchs(j).y())>=1.5 && fabs(Event->pfjetchs(j).y())<=2.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet320_4bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - if(fabs(Event->pfjetchs(j).y())>=2.0 && fabs(Event->pfjetchs(j).y())<=2.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet320_5bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - if(fabs(Event->pfjetchs(j).y())>=2.5 && fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet320_6bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - if(fabs(Event->pfjetchs(j).y())>=3.2 && fabs(Event->pfjetchs(j).y())<=4.7 && Event->pfjetchs(j).tightID()) {pt_DETInclJet320_7bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - } - - hweight=1.; - - if(hltPassj[7]){ - if(prescalej[7]>0) hweight=hweight*prescalej[7]; - if(prescalej[7]<0) hweight=hweight*(-prescalej[7]); - if(fabs(Event->pfjetchs(j).y())<=0.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet400_1bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - if(fabs(Event->pfjetchs(j).y())>=0.5 && fabs(Event->pfjetchs(j).y())<=1.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet400_2bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - if(fabs(Event->pfjetchs(j).y())>=1.0 && fabs(Event->pfjetchs(j).y())<=1.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet400_3bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - if(fabs(Event->pfjetchs(j).y())>=1.5 && fabs(Event->pfjetchs(j).y())<=2.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet400_4bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - if(fabs(Event->pfjetchs(j).y())>=2.0 && fabs(Event->pfjetchs(j).y())<=2.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet400_5bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - if(fabs(Event->pfjetchs(j).y())>=2.5 && fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet400_6bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - if(fabs(Event->pfjetchs(j).y())>=3.2 && fabs(Event->pfjetchs(j).y())<=4.7 && Event->pfjetchs(j).tightID()) {pt_DETInclJet400_7bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - } - - hweight=1.; - - if(hltPassj[8]){ - if(prescalej[8]>0) hweight=hweight*prescalej[8]; - if(prescalej[8]<0) hweight=hweight*(-prescalej[8]); - if(fabs(Event->pfjetchs(j).y())<=0.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet450_1bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - if(fabs(Event->pfjetchs(j).y())>=0.5 && fabs(Event->pfjetchs(j).y())<=1.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet450_2bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - if(fabs(Event->pfjetchs(j).y())>=1.0 && fabs(Event->pfjetchs(j).y())<=1.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet450_3bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - if(fabs(Event->pfjetchs(j).y())>=1.5 && fabs(Event->pfjetchs(j).y())<=2.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet450_4bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - if(fabs(Event->pfjetchs(j).y())>=2.0 && fabs(Event->pfjetchs(j).y())<=2.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet450_5bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - if(fabs(Event->pfjetchs(j).y())>=2.5 && fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet450_6bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - if(fabs(Event->pfjetchs(j).y())>=3.2 && fabs(Event->pfjetchs(j).y())<=4.7 && Event->pfjetchs(j).tightID()) {pt_DETInclJet450_7bin->Fill(Event->pfjetchs(j).ptCor(),hweight);} - } - - hweight=1.; - - if(Event->pfjetchs(j).ptCor()>=mMinPt){ - - if(Event->pfjetchs(0).ptCor()>=mMinPt && Event->pfjetchs(0).ptCor()<114 && hltPassj[0]){ - //if(Event->pfjetchs(0).ptCor()>=mMinPt && Event->pfjetchs(0).ptCor()<137 && hltPassj[0]){ - - if(prescalej[0]>0) hweight=hweight*prescalej[0]; - if(prescalej[0]<0) hweight=hweight*(-prescalej[0]); - - if((fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID())||(fabs(Event->pfjetchs(j).y())>3.2 && Event->pfjetchs(j).nemf()<0.90 && Event->pfjetchs(j).ncand()>10)){ - DetJets++; - DETjet_ok[j]=1; - - pt0_DETInclJet->Fill(Event->pfjetchs(j).ptCor(),hweight); - pt0_DETInclJetUncor->Fill(Event->pfjetchs(j).pt(),hweight); - y0_DETInclJet->Fill(Event->pfjetchs(j).y(),hweight); - phi0_DETInclJet->Fill(Event->pfjetchs(j).phi(),hweight); - - //new histograms - Chargedhf0_DETJet->Fill(Event->pfjetchs(j).chf(),hweight);//charged hadron energy fraction - Neutralhf0_DETJet->Fill(Event->pfjetchs(j).nhf(),hweight);//neutral hadron energy fraction - Chargedef0_DETJet->Fill(Event->pfjetchs(j).cemf(),hweight);//charged em energy fraction - Photonef0_DETJet->Fill(Event->pfjetchs(j).nemf(),hweight);//neutral em energy fraction - Hadronef0_DETJet->Fill(Event->pfjetchs(j).hf_hf(),hweight);//hadron fraction energy fraction - Electromagneticef0_DETJet->Fill(Event->pfjetchs(j).hf_phf(),hweight);//electromagnetic fraction energy fraction - Muonef0_DETJet->Fill(Event->pfjetchs(j).muf(),hweight); //muon fraction energy fraction - - ChargedhMultiplicity0_DETJet->Fill(Event->pfjetchs(j).chm(),hweight);//charged hadron multiplicity - NeutralhMultiplicity0_DETJet->Fill(Event->pfjetchs(j).nhm(),hweight);//neutral hadron multiplicity - ChargedeMultiplicity0_DETJet->Fill(Event->pfjetchs(j).elm(),hweight);//electron em multiplicity - PhotoneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).phm(),hweight);//neutral em multiplicity - HadroneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).hf_hm(),hweight);//hadron fraction multiplicity - ElectromagneticeMultiplicity0_DETJet->Fill(Event->pfjetchs(j).hf_phm(),hweight);//electromagnetic fraction multiplicity - MuoneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).mum(),hweight); //muon fraction multiplicity - } - - if(Event->pfjetchs(j).ptCor()>=10){ - if(fabs(Event->pfjetchs(j).y())<=0.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_1bin->Fill(Event->pfjetchs(j).ptCor(),hweight); pt_DETInclJetUP_1bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_1bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>0.5 && fabs(Event->pfjetchs(j).y())<=1.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_2bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_2bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_2bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>1.0 && fabs(Event->pfjetchs(j).y())<=1.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_3bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_3bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_3bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>1.5 && fabs(Event->pfjetchs(j).y())<=2.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_4bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_4bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_4bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>2.0 && fabs(Event->pfjetchs(j).y())<=2.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_5bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_5bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_5bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>2.5 && fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_6bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_6bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_6bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>3.2 && fabs(Event->pfjetchs(j).y())<=4.7){ - if(Event->pfjetchs(j).nemf()<0.90 && Event->pfjetchs(j).ncand()>10)//tight JETID forward region - {pt_DETInclJet_7bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_7bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_7bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - } - } - } - - if(Event->pfjetchs(0).ptCor()>=114 && Event->pfjetchs(0).ptCor()<133 && hltPassj[1]){ - - //if(Event->pfjetchs(0).ptCor()>=137 && Event->pfjetchs(0).ptCor()<200 && hltPassj[1]){ - if(prescalej[1]>0) hweight=hweight*prescalej[1]; - if(prescalej[1]<0) hweight=hweight*(-prescalej[1]); - - bool switchFillPU=1; - if(switchFillPU){ - TruePileUpDataInteger->Fill(PileUpData,hweight); - switchFillPU=0; - } - - if((fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID())||(fabs(Event->pfjetchs(j).y())>3.2 && Event->pfjetchs(j).nemf()<0.90 && Event->pfjetchs(j).ncand()>10)){ - DetJets++; - DETjet_ok[j]=1; - - pt0_DETInclJet->Fill(Event->pfjetchs(j).ptCor(),hweight); - pt0_DETInclJetUncor->Fill(Event->pfjetchs(j).pt(),hweight); - y0_DETInclJet->Fill(Event->pfjetchs(j).y(),hweight); - phi0_DETInclJet->Fill(Event->pfjetchs(j).phi(),hweight); - - //new histograms - Chargedhf0_DETJet->Fill(Event->pfjetchs(j).chf(),hweight);//charged hadron energy fraction - Neutralhf0_DETJet->Fill(Event->pfjetchs(j).nhf(),hweight);//neutral hadron energy fraction - Chargedef0_DETJet->Fill(Event->pfjetchs(j).cemf(),hweight);//charged em energy fraction - Photonef0_DETJet->Fill(Event->pfjetchs(j).nemf(),hweight);//neutral em energy fraction - Hadronef0_DETJet->Fill(Event->pfjetchs(j).hf_hf(),hweight);//hadron fraction energy fraction - Electromagneticef0_DETJet->Fill(Event->pfjetchs(j).hf_phf(),hweight);//electromagnetic fraction energy fraction - Muonef0_DETJet->Fill(Event->pfjetchs(j).muf(),hweight); //muon fraction energy fraction - - ChargedhMultiplicity0_DETJet->Fill(Event->pfjetchs(j).chm(),hweight);//charged hadron multiplicity - NeutralhMultiplicity0_DETJet->Fill(Event->pfjetchs(j).nhm(),hweight);//neutral hadron multiplicity - ChargedeMultiplicity0_DETJet->Fill(Event->pfjetchs(j).elm(),hweight);//electron em multiplicity - PhotoneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).phm(),hweight);//neutral em multiplicity - HadroneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).hf_hm(),hweight);//hadron fraction multiplicity - ElectromagneticeMultiplicity0_DETJet->Fill(Event->pfjetchs(j).hf_phm(),hweight);//electromagnetic fraction multiplicity - MuoneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).mum(),hweight); //muon fraction multiplicity - } - - if(Event->pfjetchs(j).ptCor()>=10){ - if(fabs(Event->pfjetchs(j).y())<=0.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_1bin->Fill(Event->pfjetchs(j).ptCor(),hweight); pt_DETInclJetUP_1bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_1bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>0.5 && fabs(Event->pfjetchs(j).y())<=1.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_2bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_2bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_2bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>1.0 && fabs(Event->pfjetchs(j).y())<=1.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_3bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_3bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_3bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>1.5 && fabs(Event->pfjetchs(j).y())<=2.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_4bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_4bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_4bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>2.0 && fabs(Event->pfjetchs(j).y())<=2.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_5bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_5bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_5bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>2.5 && fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_6bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_6bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_6bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>3.2 && fabs(Event->pfjetchs(j).y())<=4.7) { - if(Event->pfjetchs(j).nemf()<0.90 && Event->pfjetchs(j).ncand()>10)//tight JETID forward region - {pt_DETInclJet_7bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_7bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_7bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - } - } - } - - if(Event->pfjetchs(0).ptCor()>=133 && Event->pfjetchs(0).ptCor()<220 && hltPassj[2]){ - //if(Event->pfjetchs(0).ptCor()>=200 && Event->pfjetchs(0).ptCor()<300 && hltPassj[2]){ - if(prescalej[2]>0) hweight=hweight*prescalej[2]; - if(prescalej[2]<0) hweight=hweight*(-prescalej[2]); - - bool switchFillPU=1; - if(switchFillPU){ - TruePileUpDataInteger->Fill(PileUpData,hweight); - switchFillPU=0; - } - - - if((fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID())||(fabs(Event->pfjetchs(j).y())>3.2 && Event->pfjetchs(j).nemf()<0.90 && Event->pfjetchs(j).ncand()>10)){ - DetJets++; - DETjet_ok[j]=1; - - pt0_DETInclJet->Fill(Event->pfjetchs(j).ptCor(),hweight); - pt0_DETInclJetUncor->Fill(Event->pfjetchs(j).pt(),hweight); - y0_DETInclJet->Fill(Event->pfjetchs(j).y(),hweight); - phi0_DETInclJet->Fill(Event->pfjetchs(j).phi(),hweight); - - //new histograms - Chargedhf0_DETJet->Fill(Event->pfjetchs(j).chf(),hweight);//charged hadron energy fraction - Neutralhf0_DETJet->Fill(Event->pfjetchs(j).nhf(),hweight);//neutral hadron energy fraction - Chargedef0_DETJet->Fill(Event->pfjetchs(j).cemf(),hweight);//charged em energy fraction - Photonef0_DETJet->Fill(Event->pfjetchs(j).nemf(),hweight);//neutral em energy fraction - Hadronef0_DETJet->Fill(Event->pfjetchs(j).hf_hf(),hweight);//hadron fraction energy fraction - Electromagneticef0_DETJet->Fill(Event->pfjetchs(j).hf_phf(),hweight);//electromagnetic fraction energy fraction - Muonef0_DETJet->Fill(Event->pfjetchs(j).muf(),hweight); //muon fraction energy fraction - - ChargedhMultiplicity0_DETJet->Fill(Event->pfjetchs(j).chm(),hweight);//charged hadron multiplicity - NeutralhMultiplicity0_DETJet->Fill(Event->pfjetchs(j).nhm(),hweight);//neutral hadron multiplicity - ChargedeMultiplicity0_DETJet->Fill(Event->pfjetchs(j).elm(),hweight);//electron em multiplicity - PhotoneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).phm(),hweight);//neutral em multiplicity - HadroneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).hf_hm(),hweight);//hadron fraction multiplicity - ElectromagneticeMultiplicity0_DETJet->Fill(Event->pfjetchs(j).hf_phm(),hweight);//electromagnetic fraction multiplicity - MuoneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).mum(),hweight); //muon fraction multiplicity - } - - if(Event->pfjetchs(j).ptCor()>=10){ - if(fabs(Event->pfjetchs(j).y())<=0.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_1bin->Fill(Event->pfjetchs(j).ptCor(),hweight); pt_DETInclJetUP_1bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_1bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>0.5 && fabs(Event->pfjetchs(j).y())<=1.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_2bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_2bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_2bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>1.0 && fabs(Event->pfjetchs(j).y())<=1.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_3bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_3bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_3bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>1.5 && fabs(Event->pfjetchs(j).y())<=2.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_4bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_4bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_4bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>2.0 && fabs(Event->pfjetchs(j).y())<=2.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_5bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_5bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_5bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>2.5 && fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_6bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_6bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_6bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>3.2 && fabs(Event->pfjetchs(j).y())<=4.7) { - if(Event->pfjetchs(j).nemf()<0.90 && Event->pfjetchs(j).ncand()>10)//tight JETID forward region - {pt_DETInclJet_7bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_7bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_7bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - } - } - } - - if(Event->pfjetchs(0).ptCor()>=220 && Event->pfjetchs(0).ptCor()<300 && hltPassj[3]){ - //if(Event->pfjetchs(0).ptCor()>=300 && Event->pfjetchs(0).ptCor()<400 && hltPassj[3]){ - if(prescalej[3]>0) hweight=hweight*prescalej[3]; - if(prescalej[3]<0) hweight=hweight*(-prescalej[3]); - - bool switchFillPU=1; - if(switchFillPU){ - TruePileUpDataInteger->Fill(PileUpData,hweight); - switchFillPU=0; - } - - if((fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID())||(fabs(Event->pfjetchs(j).y())>3.2 && Event->pfjetchs(j).nemf()<0.90 && Event->pfjetchs(j).ncand()>10)){ - DetJets++; - DETjet_ok[j]=1; - - pt0_DETInclJet->Fill(Event->pfjetchs(j).ptCor(),hweight); - pt0_DETInclJetUncor->Fill(Event->pfjetchs(j).pt(),hweight); - y0_DETInclJet->Fill(Event->pfjetchs(j).y(),hweight); - phi0_DETInclJet->Fill(Event->pfjetchs(j).phi(),hweight); - - //new histograms - Chargedhf0_DETJet->Fill(Event->pfjetchs(j).chf(),hweight);//charged hadron energy fraction - Neutralhf0_DETJet->Fill(Event->pfjetchs(j).nhf(),hweight);//neutral hadron energy fraction - Chargedef0_DETJet->Fill(Event->pfjetchs(j).cemf(),hweight);//charged em energy fraction - Photonef0_DETJet->Fill(Event->pfjetchs(j).nemf(),hweight);//neutral em energy fraction - Hadronef0_DETJet->Fill(Event->pfjetchs(j).hf_hf(),hweight);//hadron fraction energy fraction - Electromagneticef0_DETJet->Fill(Event->pfjetchs(j).hf_phf(),hweight);//electromagnetic fraction energy fraction - Muonef0_DETJet->Fill(Event->pfjetchs(j).muf(),hweight); //muon fraction energy fraction - - ChargedhMultiplicity0_DETJet->Fill(Event->pfjetchs(j).chm(),hweight);//charged hadron multiplicity - NeutralhMultiplicity0_DETJet->Fill(Event->pfjetchs(j).nhm(),hweight);//neutral hadron multiplicity - ChargedeMultiplicity0_DETJet->Fill(Event->pfjetchs(j).elm(),hweight);//electron em multiplicity - PhotoneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).phm(),hweight);//neutral em multiplicity - HadroneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).hf_hm(),hweight);//hadron fraction multiplicity - ElectromagneticeMultiplicity0_DETJet->Fill(Event->pfjetchs(j).hf_phm(),hweight);//electromagnetic fraction multiplicity - MuoneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).mum(),hweight); //muon fraction multiplicity - } - - if(Event->pfjetchs(j).ptCor()>=10){ - if(fabs(Event->pfjetchs(j).y())<=0.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_1bin->Fill(Event->pfjetchs(j).ptCor(),hweight); pt_DETInclJetUP_1bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_1bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>0.5 && fabs(Event->pfjetchs(j).y())<=1.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_2bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_2bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_2bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>1.0 && fabs(Event->pfjetchs(j).y())<=1.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_3bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_3bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_3bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>1.5 && fabs(Event->pfjetchs(j).y())<=2.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_4bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_4bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_4bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>2.0 && fabs(Event->pfjetchs(j).y())<=2.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_5bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_5bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_5bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>2.5 && fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_6bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_6bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_6bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>3.2 && fabs(Event->pfjetchs(j).y())<=4.7) { - if(Event->pfjetchs(j).nemf()<0.90 && Event->pfjetchs(j).ncand()>10)//tight JETID forward region - {pt_DETInclJet_7bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_7bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_7bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - } - } - } - - if(Event->pfjetchs(0).ptCor()>=300 && Event->pfjetchs(0).ptCor()<430 && hltPassj[4]){ - //if(Event->pfjetchs(0).ptCor()>=400 && Event->pfjetchs(0).ptCor()<500 && hltPassj[4]){ - if(prescalej[4]>0) hweight=hweight*prescalej[4]; - if(prescalej[4]<0) hweight=hweight*(-prescalej[4]); - - bool switchFillPU=1; - if(switchFillPU){ - TruePileUpDataInteger->Fill(PileUpData,hweight); - switchFillPU=0; - } - - - if((fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID())||(fabs(Event->pfjetchs(j).y())>3.2 && Event->pfjetchs(j).nemf()<0.90 && Event->pfjetchs(j).ncand()>10)){ - DetJets++; - DETjet_ok[j]=1; - - pt0_DETInclJet->Fill(Event->pfjetchs(j).ptCor(),hweight); - pt0_DETInclJetUncor->Fill(Event->pfjetchs(j).pt(),hweight); - y0_DETInclJet->Fill(Event->pfjetchs(j).y(),hweight); - phi0_DETInclJet->Fill(Event->pfjetchs(j).phi(),hweight); - - //new histograms - Chargedhf0_DETJet->Fill(Event->pfjetchs(j).chf(),hweight);//charged hadron energy fraction - Neutralhf0_DETJet->Fill(Event->pfjetchs(j).nhf(),hweight);//neutral hadron energy fraction - Chargedef0_DETJet->Fill(Event->pfjetchs(j).cemf(),hweight);//charged em energy fraction - Photonef0_DETJet->Fill(Event->pfjetchs(j).nemf(),hweight);//neutral em energy fraction - Hadronef0_DETJet->Fill(Event->pfjetchs(j).hf_hf(),hweight);//hadron fraction energy fraction - Electromagneticef0_DETJet->Fill(Event->pfjetchs(j).hf_phf(),hweight);//electromagnetic fraction energy fraction - Muonef0_DETJet->Fill(Event->pfjetchs(j).muf(),hweight); //muon fraction energy fraction - - ChargedhMultiplicity0_DETJet->Fill(Event->pfjetchs(j).chm(),hweight);//charged hadron multiplicity - NeutralhMultiplicity0_DETJet->Fill(Event->pfjetchs(j).nhm(),hweight);//neutral hadron multiplicity - ChargedeMultiplicity0_DETJet->Fill(Event->pfjetchs(j).elm(),hweight);//electron em multiplicity - PhotoneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).phm(),hweight);//neutral em multiplicity - HadroneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).hf_hm(),hweight);//hadron fraction multiplicity - ElectromagneticeMultiplicity0_DETJet->Fill(Event->pfjetchs(j).hf_phm(),hweight);//electromagnetic fraction multiplicity - MuoneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).mum(),hweight); //muon fraction multiplicity - } - - if(Event->pfjetchs(j).ptCor()>=10){ - if(fabs(Event->pfjetchs(j).y())<=0.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_1bin->Fill(Event->pfjetchs(j).ptCor(),hweight); pt_DETInclJetUP_1bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_1bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>0.5 && fabs(Event->pfjetchs(j).y())<=1.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_2bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_2bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_2bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>1.0 && fabs(Event->pfjetchs(j).y())<=1.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_3bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_3bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_3bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>1.5 && fabs(Event->pfjetchs(j).y())<=2.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_4bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_4bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_4bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>2.0 && fabs(Event->pfjetchs(j).y())<=2.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_5bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_5bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_5bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>2.5 && fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_6bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_6bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_6bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>3.2 && fabs(Event->pfjetchs(j).y())<=4.7) { - if(Event->pfjetchs(j).nemf()<0.90 && Event->pfjetchs(j).ncand()>10)//tight JETID forward region - {pt_DETInclJet_7bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_7bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_7bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - } - } - } - - if(Event->pfjetchs(0).ptCor()>=430 && Event->pfjetchs(0).ptCor()<507 && hltPassj[5]){ - //if(Event->pfjetchs(0).ptCor()>=500 && Event->pfjetchs(0).ptCor()<600 && hltPassj[5]){ - if(prescalej[5]>0) hweight=hweight*prescalej[5]; - if(prescalej[5]<0) hweight=hweight*(-prescalej[5]); - - bool switchFillPU=1; - if(switchFillPU){ - TruePileUpDataInteger->Fill(PileUpData,hweight); - switchFillPU=0; - } - - - if((fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID())||(fabs(Event->pfjetchs(j).y())>3.2 && Event->pfjetchs(j).nemf()<0.90 && Event->pfjetchs(j).ncand()>10)){ - DetJets++; - DETjet_ok[j]=1; - - pt0_DETInclJet->Fill(Event->pfjetchs(j).ptCor(),hweight); - pt0_DETInclJetUncor->Fill(Event->pfjetchs(j).pt(),hweight); - y0_DETInclJet->Fill(Event->pfjetchs(j).y(),hweight); - phi0_DETInclJet->Fill(Event->pfjetchs(j).phi(),hweight); - - //new histograms - Chargedhf0_DETJet->Fill(Event->pfjetchs(j).chf(),hweight);//charged hadron energy fraction - Neutralhf0_DETJet->Fill(Event->pfjetchs(j).nhf(),hweight);//neutral hadron energy fraction - Chargedef0_DETJet->Fill(Event->pfjetchs(j).cemf(),hweight);//charged em energy fraction - Photonef0_DETJet->Fill(Event->pfjetchs(j).nemf(),hweight);//neutral em energy fraction - Hadronef0_DETJet->Fill(Event->pfjetchs(j).hf_hf(),hweight);//hadron fraction energy fraction - Electromagneticef0_DETJet->Fill(Event->pfjetchs(j).hf_phf(),hweight);//electromagnetic fraction energy fraction - Muonef0_DETJet->Fill(Event->pfjetchs(j).muf(),hweight); //muon fraction energy fraction - - ChargedhMultiplicity0_DETJet->Fill(Event->pfjetchs(j).chm(),hweight);//charged hadron multiplicity - NeutralhMultiplicity0_DETJet->Fill(Event->pfjetchs(j).nhm(),hweight);//neutral hadron multiplicity - ChargedeMultiplicity0_DETJet->Fill(Event->pfjetchs(j).elm(),hweight);//electron em multiplicity - PhotoneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).phm(),hweight);//neutral em multiplicity - HadroneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).hf_hm(),hweight);//hadron fraction multiplicity - ElectromagneticeMultiplicity0_DETJet->Fill(Event->pfjetchs(j).hf_phm(),hweight);//electromagnetic fraction multiplicity - MuoneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).mum(),hweight); //muon fraction multiplicity - } - - if(Event->pfjetchs(j).ptCor()>=10){ - if(fabs(Event->pfjetchs(j).y())<=0.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_1bin->Fill(Event->pfjetchs(j).ptCor(),hweight); pt_DETInclJetUP_1bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_1bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>0.5 && fabs(Event->pfjetchs(j).y())<=1.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_2bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_2bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_2bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>1.0 && fabs(Event->pfjetchs(j).y())<=1.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_3bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_3bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_3bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>1.5 && fabs(Event->pfjetchs(j).y())<=2.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_4bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_4bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_4bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>2.0 && fabs(Event->pfjetchs(j).y())<=2.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_5bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_5bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_5bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>2.5 && fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_6bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_6bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_6bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>3.2 && fabs(Event->pfjetchs(j).y())<=4.7) { - if(Event->pfjetchs(j).nemf()<0.90 && Event->pfjetchs(j).ncand()>10)//tight JETID forward region - {pt_DETInclJet_7bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_7bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_7bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - } - } - } - - if(Event->pfjetchs(0).ptCor()>=507 && Event->pfjetchs(0).ptCor()<638 && hltPassj[6]){ - //if(Event->pfjetchs(0).ptCor()>=600 && Event->pfjetchs(0).ptCor()<700 && hltPassj[6]){ - if(prescalej[6]>0) hweight=hweight*prescalej[6]; - if(prescalej[6]<0) hweight=hweight*(-prescalej[6]); - - bool switchFillPU=1; - if(switchFillPU){ - TruePileUpDataInteger->Fill(PileUpData,hweight); - switchFillPU=0; - } - - - if((fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID())||(fabs(Event->pfjetchs(j).y())>3.2 && Event->pfjetchs(j).nemf()<0.90 && Event->pfjetchs(j).ncand()>10)){ - DetJets++; - DETjet_ok[j]=1; - - pt0_DETInclJet->Fill(Event->pfjetchs(j).ptCor(),hweight); - pt0_DETInclJetUncor->Fill(Event->pfjetchs(j).pt(),hweight); - y0_DETInclJet->Fill(Event->pfjetchs(j).y(),hweight); - phi0_DETInclJet->Fill(Event->pfjetchs(j).phi(),hweight); - - //new histograms - Chargedhf0_DETJet->Fill(Event->pfjetchs(j).chf(),hweight);//charged hadron energy fraction - Neutralhf0_DETJet->Fill(Event->pfjetchs(j).nhf(),hweight);//neutral hadron energy fraction - Chargedef0_DETJet->Fill(Event->pfjetchs(j).cemf(),hweight);//charged em energy fraction - Photonef0_DETJet->Fill(Event->pfjetchs(j).nemf(),hweight);//neutral em energy fraction - Hadronef0_DETJet->Fill(Event->pfjetchs(j).hf_hf(),hweight);//hadron fraction energy fraction - Electromagneticef0_DETJet->Fill(Event->pfjetchs(j).hf_phf(),hweight);//electromagnetic fraction energy fraction - Muonef0_DETJet->Fill(Event->pfjetchs(j).muf(),hweight); //muon fraction energy fraction - - ChargedhMultiplicity0_DETJet->Fill(Event->pfjetchs(j).chm(),hweight);//charged hadron multiplicity - NeutralhMultiplicity0_DETJet->Fill(Event->pfjetchs(j).nhm(),hweight);//neutral hadron multiplicity - ChargedeMultiplicity0_DETJet->Fill(Event->pfjetchs(j).elm(),hweight);//electron em multiplicity - PhotoneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).phm(),hweight);//neutral em multiplicity - HadroneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).hf_hm(),hweight);//hadron fraction multiplicity - ElectromagneticeMultiplicity0_DETJet->Fill(Event->pfjetchs(j).hf_phm(),hweight);//electromagnetic fraction multiplicity - MuoneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).mum(),hweight); //muon fraction multiplicity - } - - if(Event->pfjetchs(j).ptCor()>=10){ - if(fabs(Event->pfjetchs(j).y())<=0.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_1bin->Fill(Event->pfjetchs(j).ptCor(),hweight); pt_DETInclJetUP_1bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_1bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>0.5 && fabs(Event->pfjetchs(j).y())<=1.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_2bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_2bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_2bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>1.0 && fabs(Event->pfjetchs(j).y())<=1.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_3bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_3bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_3bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>1.5 && fabs(Event->pfjetchs(j).y())<=2.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_4bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_4bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_4bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>2.0 && fabs(Event->pfjetchs(j).y())<=2.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_5bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_5bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_5bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>2.5 && fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_6bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_6bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_6bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>3.2 && fabs(Event->pfjetchs(j).y())<=4.7) { - if(Event->pfjetchs(j).nemf()<0.90 && Event->pfjetchs(j).ncand()>10)//tight JETID forward region - {pt_DETInclJet_7bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_7bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_7bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - } - } - } - - if(Event->pfjetchs(0).ptCor()>=638 && Event->pfjetchs(0).ptCor()<737 && hltPassj[7]){ - //if(Event->pfjetchs(0).ptCor()>=700 && Event->pfjetchs(0).ptCor()<800 && hltPassj[7]){ - if(prescalej[7]>0) hweight=hweight*prescalej[7]; - if(prescalej[7]<0) hweight=hweight*(-prescalej[7]); - - bool switchFillPU=1; - if(switchFillPU){ - TruePileUpDataInteger->Fill(PileUpData,hweight); - switchFillPU=0; - } - - - if((fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID())||(fabs(Event->pfjetchs(j).y())>3.2 && Event->pfjetchs(j).nemf()<0.90 && Event->pfjetchs(j).ncand()>10)){ - DetJets++; - DETjet_ok[j]=1; - - pt0_DETInclJet->Fill(Event->pfjetchs(j).ptCor(),hweight); - pt0_DETInclJetUncor->Fill(Event->pfjetchs(j).pt(),hweight); - y0_DETInclJet->Fill(Event->pfjetchs(j).y(),hweight); - phi0_DETInclJet->Fill(Event->pfjetchs(j).phi(),hweight); - - //new histograms - Chargedhf0_DETJet->Fill(Event->pfjetchs(j).chf(),hweight);//charged hadron energy fraction - Neutralhf0_DETJet->Fill(Event->pfjetchs(j).nhf(),hweight);//neutral hadron energy fraction - Chargedef0_DETJet->Fill(Event->pfjetchs(j).cemf(),hweight);//charged em energy fraction - Photonef0_DETJet->Fill(Event->pfjetchs(j).nemf(),hweight);//neutral em energy fraction - Hadronef0_DETJet->Fill(Event->pfjetchs(j).hf_hf(),hweight);//hadron fraction energy fraction - Electromagneticef0_DETJet->Fill(Event->pfjetchs(j).hf_phf(),hweight);//electromagnetic fraction energy fraction - Muonef0_DETJet->Fill(Event->pfjetchs(j).muf(),hweight); //muon fraction energy fraction - - ChargedhMultiplicity0_DETJet->Fill(Event->pfjetchs(j).chm(),hweight);//charged hadron multiplicity - NeutralhMultiplicity0_DETJet->Fill(Event->pfjetchs(j).nhm(),hweight);//neutral hadron multiplicity - ChargedeMultiplicity0_DETJet->Fill(Event->pfjetchs(j).elm(),hweight);//electron em multiplicity - PhotoneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).phm(),hweight);//neutral em multiplicity - HadroneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).hf_hm(),hweight);//hadron fraction multiplicity - ElectromagneticeMultiplicity0_DETJet->Fill(Event->pfjetchs(j).hf_phm(),hweight);//electromagnetic fraction multiplicity - MuoneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).mum(),hweight); //muon fraction multiplicity - } - - if(Event->pfjetchs(j).ptCor()>=10){ - if(fabs(Event->pfjetchs(j).y())<=0.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_1bin->Fill(Event->pfjetchs(j).ptCor(),hweight); pt_DETInclJetUP_1bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_1bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>0.5 && fabs(Event->pfjetchs(j).y())<=1.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_2bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_2bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_2bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>1.0 && fabs(Event->pfjetchs(j).y())<=1.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_3bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_3bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_3bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>1.5 && fabs(Event->pfjetchs(j).y())<=2.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_4bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_4bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_4bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>2.0 && fabs(Event->pfjetchs(j).y())<=2.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_5bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_5bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_5bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>2.5 && fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_6bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_6bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_6bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>3.2 && fabs(Event->pfjetchs(j).y())<=4.7) { - if(Event->pfjetchs(j).nemf()<0.90 && Event->pfjetchs(j).ncand()>10)//tight JETID forward region - {pt_DETInclJet_7bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_7bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_7bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - } - } - } - - if(Event->pfjetchs(0).ptCor()>=737 && hltPassj[8]){ - //if(Event->pfjetchs(0).ptCor()>=800 && hltPassj[8]){ - if(prescalej[8]>0) hweight=hweight*prescalej[8]; - if(prescalej[8]<0) hweight=hweight*(-prescalej[8]); - - bool switchFillPU=1; - if(switchFillPU){ - TruePileUpDataInteger->Fill(PileUpData,hweight); - switchFillPU=0; - } - - - if((fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID())||(fabs(Event->pfjetchs(j).y())>3.2 && Event->pfjetchs(j).nemf()<0.90 && Event->pfjetchs(j).ncand()>10)){ - DetJets++; - DETjet_ok[j]=1; - - pt0_DETInclJet->Fill(Event->pfjetchs(j).ptCor(),hweight); - pt0_DETInclJetUncor->Fill(Event->pfjetchs(j).pt(),hweight); - y0_DETInclJet->Fill(Event->pfjetchs(j).y(),hweight); - phi0_DETInclJet->Fill(Event->pfjetchs(j).phi(),hweight); - - //new histograms - Chargedhf0_DETJet->Fill(Event->pfjetchs(j).chf(),hweight);//charged hadron energy fraction - Neutralhf0_DETJet->Fill(Event->pfjetchs(j).nhf(),hweight);//neutral hadron energy fraction - Chargedef0_DETJet->Fill(Event->pfjetchs(j).cemf(),hweight);//charged em energy fraction - Photonef0_DETJet->Fill(Event->pfjetchs(j).nemf(),hweight);//neutral em energy fraction - Hadronef0_DETJet->Fill(Event->pfjetchs(j).hf_hf(),hweight);//hadron fraction energy fraction - Electromagneticef0_DETJet->Fill(Event->pfjetchs(j).hf_phf(),hweight);//electromagnetic fraction energy fraction - Muonef0_DETJet->Fill(Event->pfjetchs(j).muf(),hweight); //muon fraction energy fraction - - ChargedhMultiplicity0_DETJet->Fill(Event->pfjetchs(j).chm(),hweight);//charged hadron multiplicity - NeutralhMultiplicity0_DETJet->Fill(Event->pfjetchs(j).nhm(),hweight);//neutral hadron multiplicity - ChargedeMultiplicity0_DETJet->Fill(Event->pfjetchs(j).elm(),hweight);//electron em multiplicity - PhotoneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).phm(),hweight);//neutral em multiplicity - HadroneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).hf_hm(),hweight);//hadron fraction multiplicity - ElectromagneticeMultiplicity0_DETJet->Fill(Event->pfjetchs(j).hf_phm(),hweight);//electromagnetic fraction multiplicity - MuoneMultiplicity0_DETJet->Fill(Event->pfjetchs(j).mum(),hweight); //muon fraction multiplicity - } - - if(Event->pfjetchs(j).ptCor()>=10){ - if(fabs(Event->pfjetchs(j).y())<=0.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_1bin->Fill(Event->pfjetchs(j).ptCor(),hweight); pt_DETInclJetUP_1bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_1bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>0.5 && fabs(Event->pfjetchs(j).y())<=1.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_2bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_2bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_2bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>1.0 && fabs(Event->pfjetchs(j).y())<=1.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_3bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_3bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_3bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>1.5 && fabs(Event->pfjetchs(j).y())<=2.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_4bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_4bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_4bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>2.0 && fabs(Event->pfjetchs(j).y())<=2.5 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_5bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_5bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_5bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>2.5 && fabs(Event->pfjetchs(j).y())<=3.0 && Event->pfjetchs(j).tightID()) {pt_DETInclJet_6bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_6bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_6bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - if(fabs(Event->pfjetchs(j).y())>3.2 && fabs(Event->pfjetchs(j).y())<=4.7) { - if(Event->pfjetchs(j).nemf()<0.90 && Event->pfjetchs(j).ncand()>10)//tight JETID forward region - {pt_DETInclJet_7bin->Fill(Event->pfjetchs(j).ptCor(),hweight);pt_DETInclJetUP_7bin->Fill(Event->pfjetchs(j).ptCor()+Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);pt_DETInclJetDOWN_7bin->Fill(Event->pfjetchs(j).ptCor()-Event->pfjetchs(j).ptCor()*Event->pfjetchs(j).unc(),hweight);} - } - } - } - } - } - } - - if(DETjet_ok[0]==1 && DETjet_ok[1]==1){ - - pt0_DETJet->Fill(Event->pfjetchs(0).ptCor(),hweight); - pt0_DETJetUncor->Fill(Event->pfjetchs(0).pt(),hweight); - pt1_DETJet->Fill(Event->pfjetchs(1).ptCor(),hweight); - pt1_DETJetUncor->Fill(Event->pfjetchs(1).pt(),hweight); - y0_DETJet->Fill(Event->pfjetchs(0).y(),hweight); - y1_DETJet->Fill(Event->pfjetchs(1).y(),hweight); - phi0_DETJet->Fill(Event->pfjetchs(0).phi(),hweight); - phi1_DETJet->Fill(Event->pfjetchs(1).phi(),hweight); - } - - if(DETjet_ok[0]==1){ - - Multiplicity_DETJet->Fill(DetJets,hweight); - num_of_VtxGood->Fill(Event->evtHdr().nVtxGood(),hweight); - - if(fabs(Event->pfjetchs(0).y())<=3.0 && Event->pfjetchs(0).tightID()){ - MET_DET->Fill(Event->pfmet().met(),hweight); - METPhi_DET->Fill(fabs(Event->pfmet().phi()),hweight); - FractionMET_DET->Fill(Event->pfmet().met_o_sumet(),hweight); - } - if(fabs(Event->pfjetchs(0).y())>3.2 && Event->pfjetchs(0).nemf()<0.90 && Event->pfjetchs(0).ncand()>10){ - MET_DET->Fill(Event->pfmet().met(),hweight); - METPhi_DET->Fill(fabs(Event->pfmet().phi()),hweight); - FractionMET_DET->Fill(Event->pfmet().met_o_sumet(),hweight); - } - } - - //if(DetJets==2) {cout<evtHdr().lumi()<<" Event "<evtHdr().event()<<" Run Number "<evtHdr().runNo()<evtHdr().lumi()<<" Event "<evtHdr().event()<<" Run Number "<evtHdr().runNo()<evtHdr().lumi()<<" Event "<evtHdr().event()<<" Run Number "<evtHdr().runNo()<evtHdr().runNo()==251252){ - //if(Event->evtHdr().lumi()==158) { cout<evtHdr().event()<evtHdr().lumi()==158) { cout<evtHdr().event()<<" "<pfjetchs(0).ptCor()<<" "<pfjetchs(1).ptCor()<<" "<pfjetchs(2).ptCor()<<" "<pfjetchs(0).y()<<" "<pfjetchs(1).y()<<" "<pfjetchs(2).y()<evtHdr().lumi()==158) { cout<evtHdr().event()<<" "<pfjetchs(0).ptCor()<<" "<pfjetchs(1).ptCor()<<" "<pfjetchs(0).y()<<" "<pfjetchs(1).y()<evtHdr().lumi()==158) { cout<evtHdr().event()<<" "<pfjetchs(0).ptCor()<<" "<pfjetchs(1).ptCor()<<" "<pfjetchs(2).ptCor()<<" "<pfjetchs(0).y()<<" "<pfjetchs(1).y()<<" "<pfjetchs(2).y()<Close(); - - } - - float EntriesNumAcceptance[100][8]; - float EntriesDenAcceptance[100][8]; - float EntriesNumPurity[100][8]; - float EntriesDenPurity[100][8]; - float EntriesNumBackground[100][8]; - float EntriesDenBackground[100][8]; - float EntriesNumStability[100][8]; - float EntriesDenStability[100][8]; - - float Entries[8]; - float Errors[8]; - - for(int i=0;i<100;i++){ - for(int j=0;j<8;j++){ - EntriesNumAcceptance[i][j]=0; - EntriesDenAcceptance[i][j]=0; - EntriesNumStability[i][j]=0; - EntriesDenStability[i][j]=0; - EntriesNumBackground[i][j]=0; - EntriesDenBackground[i][j]=0; - EntriesNumPurity[i][j]=0; - EntriesDenPurity[i][j]=0; - Entries[j]=0; - Errors[j]=0; - } - } - - //Acceptance - - for(int i=1;iGetXaxis()->GetNbins()+1;i++){ - EntriesDenAcceptance[i][0]=Gen_MatchedInclusiveJets->GetBinContent(i); - EntriesDenAcceptance[i][1]=pt_GENInclJet_1bin->GetBinContent(i); - EntriesDenAcceptance[i][2]=pt_GENInclJet_2bin->GetBinContent(i); - EntriesDenAcceptance[i][3]=pt_GENInclJet_3bin->GetBinContent(i); - EntriesDenAcceptance[i][4]=pt_GENInclJet_4bin->GetBinContent(i); - EntriesDenAcceptance[i][5]=pt_GENInclJet_5bin->GetBinContent(i); - EntriesDenAcceptance[i][6]=pt_GENInclJet_6bin->GetBinContent(i); - EntriesDenAcceptance[i][7]=pt_GENInclJet_7bin->GetBinContent(i); - - for(int j=1;jGetYaxis()->GetNbins()+1;j++){ - EntriesNumAcceptance[i][0]=EntriesNumAcceptance[i][0]+TwoD_MatchedInclusiveJets->GetBinContent(j,i); - EntriesNumAcceptance[i][1]=EntriesNumAcceptance[i][1]+TwoD_MatchedInclusiveJets_1bin->GetBinContent(j,i); - EntriesNumAcceptance[i][2]=EntriesNumAcceptance[i][2]+TwoD_MatchedInclusiveJets_2bin->GetBinContent(j,i); - EntriesNumAcceptance[i][3]=EntriesNumAcceptance[i][3]+TwoD_MatchedInclusiveJets_3bin->GetBinContent(j,i); - EntriesNumAcceptance[i][4]=EntriesNumAcceptance[i][4]+TwoD_MatchedInclusiveJets_4bin->GetBinContent(j,i); - EntriesNumAcceptance[i][5]=EntriesNumAcceptance[i][5]+TwoD_MatchedInclusiveJets_5bin->GetBinContent(j,i); - EntriesNumAcceptance[i][6]=EntriesNumAcceptance[i][6]+TwoD_MatchedInclusiveJets_6bin->GetBinContent(j,i); - EntriesNumAcceptance[i][7]=EntriesNumAcceptance[i][7]+TwoD_MatchedInclusiveJets_7bin->GetBinContent(j,i); - } - - for(int j=0;j<8;j++){ - if(EntriesDenAcceptance[i][j]!=0){ - Entries[j]=EntriesNumAcceptance[i][j]/EntriesDenAcceptance[i][j]; - } - } - - AcceptancePtJets->SetBinContent(i,Entries[0]); - AcceptancePtJets->SetBinError(i,Errors[0]); - AcceptancePtJets_1bin->SetBinContent(i,Entries[1]); - AcceptancePtJets_2bin->SetBinContent(i,Entries[2]); - AcceptancePtJets_3bin->SetBinContent(i,Entries[3]); - AcceptancePtJets_4bin->SetBinContent(i,Entries[4]); - AcceptancePtJets_5bin->SetBinContent(i,Entries[5]); - AcceptancePtJets_6bin->SetBinContent(i,Entries[6]); - AcceptancePtJets_7bin->SetBinContent(i,Entries[7]); - AcceptancePtJets_1bin->SetBinError(i,Errors[0]); - AcceptancePtJets_2bin->SetBinError(i,Errors[0]); - AcceptancePtJets_3bin->SetBinError(i,Errors[0]); - AcceptancePtJets_4bin->SetBinError(i,Errors[0]); - AcceptancePtJets_5bin->SetBinError(i,Errors[0]); - AcceptancePtJets_6bin->SetBinError(i,Errors[0]); - AcceptancePtJets_7bin->SetBinError(i,Errors[0]); - } - - //Purity: matched detector and hadron level/ matched detector level - - for(int i=1;iGetXaxis()->GetNbins()+1;i++){ - EntriesNumPurity[i][0]=TwoD_MatchedInclusiveJets->GetBinContent(i,i); - - EntriesNumPurity[i][1]=TwoD_MatchedInclusiveJets_1bin->GetBinContent(i,i); - EntriesNumPurity[i][2]=TwoD_MatchedInclusiveJets_2bin->GetBinContent(i,i); - EntriesNumPurity[i][3]=TwoD_MatchedInclusiveJets_3bin->GetBinContent(i,i); - EntriesNumPurity[i][4]=TwoD_MatchedInclusiveJets_4bin->GetBinContent(i,i); - EntriesNumPurity[i][5]=TwoD_MatchedInclusiveJets_5bin->GetBinContent(i,i); - EntriesNumPurity[i][6]=TwoD_MatchedInclusiveJets_6bin->GetBinContent(i,i); - EntriesNumPurity[i][7]=TwoD_MatchedInclusiveJets_7bin->GetBinContent(i,i); - - for(int j=1;jGetYaxis()->GetNbins()+1;j++){ - EntriesDenPurity[i][0]=EntriesDenPurity[i][0]+TwoD_MatchedInclusiveJets->GetBinContent(j,i); - EntriesDenPurity[i][1]=EntriesDenPurity[i][1]+TwoD_MatchedInclusiveJets_1bin->GetBinContent(j,i); - EntriesDenPurity[i][2]=EntriesDenPurity[i][2]+TwoD_MatchedInclusiveJets_2bin->GetBinContent(j,i); - EntriesDenPurity[i][3]=EntriesDenPurity[i][3]+TwoD_MatchedInclusiveJets_3bin->GetBinContent(j,i); - EntriesDenPurity[i][4]=EntriesDenPurity[i][4]+TwoD_MatchedInclusiveJets_4bin->GetBinContent(j,i); - EntriesDenPurity[i][5]=EntriesDenPurity[i][5]+TwoD_MatchedInclusiveJets_5bin->GetBinContent(j,i); - EntriesDenPurity[i][6]=EntriesDenPurity[i][6]+TwoD_MatchedInclusiveJets_6bin->GetBinContent(j,i); - EntriesDenPurity[i][7]=EntriesDenPurity[i][7]+TwoD_MatchedInclusiveJets_7bin->GetBinContent(j,i); - } - - for(int j=0;j<8;j++){ - if(EntriesDenPurity[i][j]!=0){ - Entries[j]=EntriesNumPurity[i][j]/EntriesDenPurity[i][j]; - } - } - - PurityPtJets->SetBinContent(i,Entries[0]); - PurityPtJets_1bin->SetBinContent(i,Entries[1]); - PurityPtJets_2bin->SetBinContent(i,Entries[2]); - PurityPtJets_3bin->SetBinContent(i,Entries[3]); - PurityPtJets_4bin->SetBinContent(i,Entries[4]); - PurityPtJets_5bin->SetBinContent(i,Entries[5]); - PurityPtJets_6bin->SetBinContent(i,Entries[6]); - PurityPtJets_7bin->SetBinContent(i,Entries[7]); - - } - - //Stability:matched detector and hadron level / matched gen level - - for(int i=1;iGetXaxis()->GetNbins()+1;i++){ - EntriesNumStability[i][0]=TwoD_MatchedInclusiveJets->GetBinContent(i,i); - - EntriesNumStability[i][1]=TwoD_MatchedInclusiveJets_1bin->GetBinContent(i,i); - EntriesNumStability[i][2]=TwoD_MatchedInclusiveJets_2bin->GetBinContent(i,i); - EntriesNumStability[i][3]=TwoD_MatchedInclusiveJets_3bin->GetBinContent(i,i); - EntriesNumStability[i][4]=TwoD_MatchedInclusiveJets_4bin->GetBinContent(i,i); - EntriesNumStability[i][5]=TwoD_MatchedInclusiveJets_5bin->GetBinContent(i,i); - EntriesNumStability[i][6]=TwoD_MatchedInclusiveJets_6bin->GetBinContent(i,i); - EntriesNumStability[i][7]=TwoD_MatchedInclusiveJets_7bin->GetBinContent(i,i); - - for(int j=1;jGetYaxis()->GetNbins()+1;j++){ - EntriesDenStability[i][0]=EntriesDenStability[i][0]+TwoD_MatchedInclusiveJets->GetBinContent(i,j); - EntriesDenStability[i][1]=EntriesDenStability[i][1]+TwoD_MatchedInclusiveJets_1bin->GetBinContent(i,j); - EntriesDenStability[i][2]=EntriesDenStability[i][2]+TwoD_MatchedInclusiveJets_2bin->GetBinContent(i,j); - EntriesDenStability[i][3]=EntriesDenStability[i][3]+TwoD_MatchedInclusiveJets_3bin->GetBinContent(i,j); - EntriesDenStability[i][4]=EntriesDenStability[i][4]+TwoD_MatchedInclusiveJets_4bin->GetBinContent(i,j); - EntriesDenStability[i][5]=EntriesDenStability[i][5]+TwoD_MatchedInclusiveJets_5bin->GetBinContent(i,j); - EntriesDenStability[i][6]=EntriesDenStability[i][6]+TwoD_MatchedInclusiveJets_6bin->GetBinContent(i,j); - EntriesDenStability[i][7]=EntriesDenStability[i][7]+TwoD_MatchedInclusiveJets_7bin->GetBinContent(i,j); - } - - for(int j=0;j<8;j++){ - if(EntriesDenStability[i][j]!=0){ - Entries[j]=EntriesNumStability[i][j]/EntriesDenStability[i][j]; - } - } - - StabilityPtJets->SetBinContent(i,Entries[0]); - StabilityPtJets_1bin->SetBinContent(i,Entries[1]); - StabilityPtJets_2bin->SetBinContent(i,Entries[2]); - StabilityPtJets_3bin->SetBinContent(i,Entries[3]); - StabilityPtJets_4bin->SetBinContent(i,Entries[4]); - StabilityPtJets_5bin->SetBinContent(i,Entries[5]); - StabilityPtJets_6bin->SetBinContent(i,Entries[6]); - StabilityPtJets_7bin->SetBinContent(i,Entries[7]); - - } - - //Background - - for(int i=1;iGetXaxis()->GetNbins()+1;i++){ - EntriesDenBackground[i][0]=PF_MatchedInclusiveJets->GetBinContent(i); - - EntriesDenBackground[i][1]=pt_DETInclJet_1bin->GetBinContent(i); - EntriesDenBackground[i][2]=pt_DETInclJet_2bin->GetBinContent(i); - EntriesDenBackground[i][3]=pt_DETInclJet_3bin->GetBinContent(i); - EntriesDenBackground[i][4]=pt_DETInclJet_4bin->GetBinContent(i); - EntriesDenBackground[i][5]=pt_DETInclJet_5bin->GetBinContent(i); - EntriesDenBackground[i][6]=pt_DETInclJet_6bin->GetBinContent(i); - EntriesDenBackground[i][7]=pt_DETInclJet_7bin->GetBinContent(i); - - for(int j=1;jGetYaxis()->GetNbins()+1;j++){ - EntriesNumBackground[i][0]=EntriesNumBackground[i][0]+TwoD_MatchedInclusiveJets->GetBinContent(i,j); - - EntriesNumBackground[i][1]=EntriesNumBackground[i][1]+TwoD_MatchedInclusiveJets_1bin->GetBinContent(i,j); - EntriesNumBackground[i][2]=EntriesNumBackground[i][2]+TwoD_MatchedInclusiveJets_2bin->GetBinContent(i,j); - EntriesNumBackground[i][3]=EntriesNumBackground[i][3]+TwoD_MatchedInclusiveJets_3bin->GetBinContent(i,j); - EntriesNumBackground[i][4]=EntriesNumBackground[i][4]+TwoD_MatchedInclusiveJets_4bin->GetBinContent(i,j); - EntriesNumBackground[i][5]=EntriesNumBackground[i][5]+TwoD_MatchedInclusiveJets_5bin->GetBinContent(i,j); - EntriesNumBackground[i][6]=EntriesNumBackground[i][6]+TwoD_MatchedInclusiveJets_6bin->GetBinContent(i,j); - EntriesNumBackground[i][7]=EntriesNumBackground[i][7]+TwoD_MatchedInclusiveJets_7bin->GetBinContent(i,j); - } - - for(int j=0;j<8;j++){ - if(EntriesDenBackground[i][j]!=0){ - Entries[j]=1-EntriesNumBackground[i][j]/EntriesDenBackground[i][j]; - } - } - - BackgroundPtJets->SetBinContent(i,Entries[0]); - BackgroundPtJets_1bin->SetBinContent(i,Entries[1]); - BackgroundPtJets_2bin->SetBinContent(i,Entries[2]); - BackgroundPtJets_3bin->SetBinContent(i,Entries[3]); - BackgroundPtJets_4bin->SetBinContent(i,Entries[4]); - BackgroundPtJets_5bin->SetBinContent(i,Entries[5]); - BackgroundPtJets_6bin->SetBinContent(i,Entries[6]); - BackgroundPtJets_7bin->SetBinContent(i,Entries[7]); - - } - - int Ptbinwidth[81] = {1,1,4,1,2,2,2,3,3,3,3,4,4,5,6,6,7,8,10,10,13,17,19,20,21,22,24,25,27,28,30,32,33,35,38,39,41,44,46,48,51,53,56,59,62,65,69,71,76,79,83,87,91,96,100,106,110,116,122,128,134,140,147,154,162,170,177,187,195,205,215,225,236,248,259,272,285,299,313,328,283}; - - if(!mIsMCarlo){ - - double Entries=0; - for(int j=1;jGetXaxis()->GetNbins()+1;j++){ - Entries=pt_DETInclJet_1bin->GetBinContent(j)/(71.52*Ptbinwidth[j]); - pt_DETInclJetCrossSectNorm_1bin->SetBinContent(j,Entries); - Entries=pt_DETInclJet_2bin->GetBinContent(j)/(71.52*Ptbinwidth[j]); - pt_DETInclJetCrossSectNorm_2bin->SetBinContent(j,Entries); - Entries=pt_DETInclJet_3bin->GetBinContent(j)/(71.52*Ptbinwidth[j]); - pt_DETInclJetCrossSectNorm_3bin->SetBinContent(j,Entries); - Entries=pt_DETInclJet_4bin->GetBinContent(j)/(71.52*Ptbinwidth[j]); - pt_DETInclJetCrossSectNorm_4bin->SetBinContent(j,Entries); - Entries=pt_DETInclJet_5bin->GetBinContent(j)/(71.52*Ptbinwidth[j]); - pt_DETInclJetCrossSectNorm_5bin->SetBinContent(j,Entries); - Entries=pt_DETInclJet_6bin->GetBinContent(j)/(71.52*Ptbinwidth[j]); - pt_DETInclJetCrossSectNorm_6bin->SetBinContent(j,Entries); - Entries=pt_DETInclJet_7bin->GetBinContent(j)/(71.52*Ptbinwidth[j]); - pt_DETInclJetCrossSectNorm_7bin->SetBinContent(j,Entries); - } - } - - if(mIsMCarlo){ - - double Entries=0; - for(int j=1;jGetXaxis()->GetNbins()+1;j++){ - Entries=pt_DETInclJet_1bin->GetBinContent(j)/(Ptbinwidth[j]); - pt_DETInclJetCrossSectNorm_1bin->SetBinContent(j,Entries); - Entries=pt_DETInclJet_2bin->GetBinContent(j)/(Ptbinwidth[j]); - pt_DETInclJetCrossSectNorm_2bin->SetBinContent(j,Entries); - Entries=pt_DETInclJet_3bin->GetBinContent(j)/(Ptbinwidth[j]); - pt_DETInclJetCrossSectNorm_3bin->SetBinContent(j,Entries); - Entries=pt_DETInclJet_4bin->GetBinContent(j)/(Ptbinwidth[j]); - pt_DETInclJetCrossSectNorm_4bin->SetBinContent(j,Entries); - Entries=pt_DETInclJet_5bin->GetBinContent(j)/(Ptbinwidth[j]); - pt_DETInclJetCrossSectNorm_5bin->SetBinContent(j,Entries); - Entries=pt_DETInclJet_6bin->GetBinContent(j)/(Ptbinwidth[j]); - pt_DETInclJetCrossSectNorm_6bin->SetBinContent(j,Entries); - Entries=pt_DETInclJet_7bin->GetBinContent(j)/(Ptbinwidth[j]); - pt_DETInclJetCrossSectNorm_7bin->SetBinContent(j,Entries); - - Entries=pt_GENInclJet_1bin->GetBinContent(j)/(Ptbinwidth[j]); - pt_GENInclJetCrossSectNorm_1bin->SetBinContent(j,Entries); - Entries=pt_GENInclJet_2bin->GetBinContent(j)/(Ptbinwidth[j]); - pt_GENInclJetCrossSectNorm_2bin->SetBinContent(j,Entries); - Entries=pt_GENInclJet_3bin->GetBinContent(j)/(Ptbinwidth[j]); - pt_GENInclJetCrossSectNorm_3bin->SetBinContent(j,Entries); - Entries=pt_GENInclJet_4bin->GetBinContent(j)/(Ptbinwidth[j]); - pt_GENInclJetCrossSectNorm_4bin->SetBinContent(j,Entries); - Entries=pt_GENInclJet_5bin->GetBinContent(j)/(Ptbinwidth[j]); - pt_GENInclJetCrossSectNorm_5bin->SetBinContent(j,Entries); - Entries=pt_GENInclJet_6bin->GetBinContent(j)/(Ptbinwidth[j]); - pt_GENInclJetCrossSectNorm_6bin->SetBinContent(j,Entries); - Entries=pt_GENInclJet_7bin->GetBinContent(j)/(Ptbinwidth[j]); - pt_GENInclJetCrossSectNorm_7bin->SetBinContent(j,Entries); - } - } - - TagAndProbeEff->Divide(TagAndProbeNum,TagAndProbeDen,1.,1.,"B"); - - hist_leading_pt_HLT_Jet60U_eff->Divide(hist_leading_pt_emulated_Jet60,hist_leading_pt_all_Jet60,1.,1.,"B"); - hist_leading_eta_HLT_Jet60U_eff->Divide(hist_leading_eta_emulated_Jet60,hist_leading_eta_all_Jet60,1.,1.,"B"); - - hist_leading_pt_HLT_Jet80U_eff->Divide(hist_leading_pt_emulated_Jet80,hist_leading_pt_all_Jet80,1.,1.,"B"); - hist_leading_eta_HLT_Jet80U_eff->Divide(hist_leading_eta_emulated_Jet80,hist_leading_eta_all_Jet80,1.,1.,"B"); - - hist_leading_pt_HLT_Jet140U_eff->Divide(hist_leading_pt_emulated_Jet140,hist_leading_pt_all_Jet140,1.,1.,"B"); - hist_leading_eta_HLT_Jet140U_eff->Divide(hist_leading_eta_emulated_Jet140,hist_leading_eta_all_Jet140,1.,1.,"B"); - - hist_leading_pt_HLT_Jet200U_eff->Divide(hist_leading_pt_emulated_Jet200,hist_leading_pt_all_Jet200,1.,1.,"B"); - hist_leading_eta_HLT_Jet200U_eff->Divide(hist_leading_eta_emulated_Jet200,hist_leading_eta_all_Jet200,1.,1.,"B"); - - hist_leading_pt_HLT_Jet260U_eff->Divide(hist_leading_pt_emulated_Jet260,hist_leading_pt_all_Jet260,1.,1.,"B"); - hist_leading_eta_HLT_Jet260U_eff->Divide(hist_leading_eta_emulated_Jet260,hist_leading_eta_all_Jet260,1.,1.,"B"); - - hist_leading_pt_HLT_Jet320U_eff->Divide(hist_leading_pt_emulated_Jet320,hist_leading_pt_all_Jet320,1.,1.,"B"); - hist_leading_eta_HLT_Jet320U_eff->Divide(hist_leading_eta_emulated_Jet320,hist_leading_eta_all_Jet320,1.,1.,"B"); - - hist_leading_pt_HLT_Jet400U_eff->Divide(hist_leading_pt_emulated_Jet400,hist_leading_pt_all_Jet400,1.,1.,"B"); - hist_leading_eta_HLT_Jet400U_eff->Divide(hist_leading_eta_emulated_Jet400,hist_leading_eta_all_Jet400,1.,1.,"B"); - - hist_leading_pt_HLT_Jet450U_eff->Divide(hist_leading_pt_emulated_Jet450,hist_leading_pt_all_Jet450,1.,1.,"B"); - hist_leading_eta_HLT_Jet450U_eff->Divide(hist_leading_eta_emulated_Jet450,hist_leading_eta_all_Jet450,1.,1.,"B"); - - hist_leading_pt_HLT_Jet500U_eff->Divide(hist_leading_pt_emulated_Jet500,hist_leading_pt_all_Jet500,1.,1.,"B"); - hist_leading_eta_HLT_Jet500U_eff->Divide(hist_leading_eta_emulated_Jet500,hist_leading_eta_all_Jet500,1.,1.,"B"); - - } // closing analyze() function - - - -Analysis_Template_MC::~Analysis_Template_MC() -{ -} - - -DEFINE_FWK_MODULE(Analysis_Template_MC); - From adfb764fd19ac7678f71fee976645df24538de96 Mon Sep 17 00:00:00 2001 From: pgunnell Date: Thu, 2 Nov 2017 09:42:41 +0100 Subject: [PATCH 41/48] Delete Analysis_Template_MC.h --- AnalysisFW/plugins/Analysis_Template_MC.h | 426 ---------------------- 1 file changed, 426 deletions(-) delete mode 100644 AnalysisFW/plugins/Analysis_Template_MC.h diff --git a/AnalysisFW/plugins/Analysis_Template_MC.h b/AnalysisFW/plugins/Analysis_Template_MC.h deleted file mode 100644 index e681c6883ac..00000000000 --- a/AnalysisFW/plugins/Analysis_Template_MC.h +++ /dev/null @@ -1,426 +0,0 @@ -#ifndef My_azimuthal_MC_h -#define My_azimuthal_MC_h - -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/EDAnalyzer.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "SMPJ/AnalysisFW/interface/QCDJet.h" -#include "SMPJ/AnalysisFW/interface/QCDEvent.h" -#include "SMPJ/AnalysisFW/interface/QCDEventHdr.h" -#include "SMPJ/AnalysisFW/interface/QCDCaloJet.h" -#include "SMPJ/AnalysisFW/interface/QCDPFJet.h" -#include "SMPJ/AnalysisFW/interface/QCDMET.h" -#include "FWCore/ServiceRegistry/interface/Service.h" -#include "CommonTools/UtilAlgos/interface/TFileService.h" -//#include "PhysicsTools/Utilities/interface/LumiReweighting.h" -#include "TTree.h" -#include "TH1F.h" -#include "TH2F.h" -#include "TFile.h" -#include "TProfile.h" -#include -#include -using namespace edm; -using namespace std; - -#include "SMPJ/AnalysisFW/plugins/JECs.h" -//#include "SMPJ/AnalysisFW/plugins/JECs_S15.h" - -//#include "../Unfolding/RooUnfold-1.1.1/src/RooUnfold.h" -//#include "../Unfolding/RooUnfold-1.1.1/src/RooUnfoldResponse.h" - - -class Analysis_Template_MC : public edm::EDAnalyzer - { - public: - explicit Analysis_Template_MC(edm::ParameterSet const& cfg); - virtual void beginJob(); - virtual void analyze(edm::Event const& iEvent, edm::EventSetup const& iSetup); - virtual void endJob(); - virtual ~Analysis_Template_MC(); - - private: - //---- configurable parameters -------- - std::string mjettype,mGlobalTag,mTreeName,mDirName; - std::vector mFileName; - double mMinPt, mYMax; - int mJetID; // looseID==1 tightID==2 - int mprintOk; // noPrint=0 Print=1 - int mMCSlice; // noPrint=0 Print=1 - bool mIsMCarlo; - bool mPUReweighting; - bool mLowPileUp; - std::vector mJECUncSrcNames; - string mJECUncSrc; - - edm::Service fs; - //std::vector *mTree; - //std::vector *mInf; - TFile *mPuf,*mInf; - TTree *mTree; - //std::vector *mDir; - TDirectoryFile *mDir; - - //---- TREE variable -------- - QCDEvent *Event; - - JECs *jecs; - - //--------- Histogram Declaration --------------------// - // Vertices - TH1F *num_of_Vtx; - TH1F *num_of_VtxGood; - - TH1F *mc_pthat; - TH1F *mc_pthat_weighted; - - ///Measurement Gen jets - TH1F *pt0_GENJet; - TH1F *pt1_GENJet; - TH1F *y0_GENJet; - TH1F *y1_GENJet; - TH1F *phi0_GENJet; - TH1F *phi1_GENJet; - - TH1F *Multiplicity_GENJet; - - ///Measurement Det jets - TH1F *pt0_DETJet; - TH1F *pt1_DETJet; - TH1F *pt0_DETJetUncor; - TH1F *pt1_DETJetUncor; - TH1F *y0_DETJet; - TH1F *y1_DETJet; - TH1F *phi0_DETJet; - TH1F *phi1_DETJet; - - TH1F *Multiplicity_DETJet; - - TH1F *pt0_DETInclJet; - TH1F *pt0_DETInclJetUncor; - TH1F *y0_DETInclJet; - TH1F *phi0_DETInclJet; - - // Purity and stability - TH1F *PF_MatchedInclusiveJets; - TH1F *Gen_MatchedInclusiveJets; - TH2F *TwoD_MatchedInclusiveJets; - TH1F *PF_FakeInclusiveJets; - - TH1F *Gen_MissInclusiveJets; - TH1F *DeltaR_Jets; - - TH2F *PileUpVSVertex; - - TH1F *AcceptancePtJets; - TH1F *PurityPtJets; - TH1F *BackgroundPtJets; - TH1F *StabilityPtJets; - - TH1F *AcceptancePtJets_1bin; - TH1F *PurityPtJets_1bin; - TH1F *AcceptancePtJets_2bin; - TH1F *PurityPtJets_2bin; - TH1F *AcceptancePtJets_3bin; - TH1F *PurityPtJets_3bin; - TH1F *AcceptancePtJets_4bin; - TH1F *PurityPtJets_4bin; - TH1F *AcceptancePtJets_5bin; - TH1F *PurityPtJets_5bin; - TH1F *AcceptancePtJets_6bin; - TH1F *PurityPtJets_6bin; - TH1F *AcceptancePtJets_7bin; - TH1F *PurityPtJets_7bin; - - TH1F *BackgroundPtJets_1bin; - TH1F *StabilityPtJets_1bin; - TH1F *BackgroundPtJets_2bin; - TH1F *StabilityPtJets_2bin; - TH1F *BackgroundPtJets_3bin; - TH1F *StabilityPtJets_3bin; - TH1F *BackgroundPtJets_4bin; - TH1F *StabilityPtJets_4bin; - TH1F *BackgroundPtJets_5bin; - TH1F *StabilityPtJets_5bin; - TH1F *BackgroundPtJets_6bin; - TH1F *StabilityPtJets_6bin; - TH1F *BackgroundPtJets_7bin; - TH1F *StabilityPtJets_7bin; - - TH1F* pt_DETInclJet_1bin; - TH1F* pt_DETInclJet_2bin; - TH1F* pt_DETInclJet_3bin; - TH1F* pt_DETInclJet_4bin; - TH1F* pt_DETInclJet_5bin; - TH1F* pt_DETInclJet_6bin; - TH1F* pt_DETInclJet_7bin; - - TH1F* pt_DETInclJetCrossSectNorm_1bin; - TH1F* pt_DETInclJetCrossSectNorm_2bin; - TH1F* pt_DETInclJetCrossSectNorm_3bin; - TH1F* pt_DETInclJetCrossSectNorm_4bin; - TH1F* pt_DETInclJetCrossSectNorm_5bin; - TH1F* pt_DETInclJetCrossSectNorm_6bin; - TH1F* pt_DETInclJetCrossSectNorm_7bin; - - TH1F* pt_GENInclJetCrossSectNorm_1bin; - TH1F* pt_GENInclJetCrossSectNorm_2bin; - TH1F* pt_GENInclJetCrossSectNorm_3bin; - TH1F* pt_GENInclJetCrossSectNorm_4bin; - TH1F* pt_GENInclJetCrossSectNorm_5bin; - TH1F* pt_GENInclJetCrossSectNorm_6bin; - TH1F* pt_GENInclJetCrossSectNorm_7bin; - - TH1F* pt_DETInclJet60_1bin; - TH1F* pt_DETInclJet60_2bin; - TH1F* pt_DETInclJet60_3bin; - TH1F* pt_DETInclJet60_4bin; - TH1F* pt_DETInclJet60_5bin; - TH1F* pt_DETInclJet60_6bin; - TH1F* pt_DETInclJet60_7bin; - - TH1F* pt_DETInclJet80_1bin; - TH1F* pt_DETInclJet80_2bin; - TH1F* pt_DETInclJet80_3bin; - TH1F* pt_DETInclJet80_4bin; - TH1F* pt_DETInclJet80_5bin; - TH1F* pt_DETInclJet80_6bin; - TH1F* pt_DETInclJet80_7bin; - - TH1F* pt_DETInclJet140_1bin; - TH1F* pt_DETInclJet140_2bin; - TH1F* pt_DETInclJet140_3bin; - TH1F* pt_DETInclJet140_4bin; - TH1F* pt_DETInclJet140_5bin; - TH1F* pt_DETInclJet140_6bin; - TH1F* pt_DETInclJet140_7bin; - - TH1F* pt_DETInclJet200_1bin; - TH1F* pt_DETInclJet200_2bin; - TH1F* pt_DETInclJet200_3bin; - TH1F* pt_DETInclJet200_4bin; - TH1F* pt_DETInclJet200_5bin; - TH1F* pt_DETInclJet200_6bin; - TH1F* pt_DETInclJet200_7bin; - - TH1F* pt_DETInclJet260_1bin; - TH1F* pt_DETInclJet260_2bin; - TH1F* pt_DETInclJet260_3bin; - TH1F* pt_DETInclJet260_4bin; - TH1F* pt_DETInclJet260_5bin; - TH1F* pt_DETInclJet260_6bin; - TH1F* pt_DETInclJet260_7bin; - - TH1F* pt_DETInclJet320_1bin; - TH1F* pt_DETInclJet320_2bin; - TH1F* pt_DETInclJet320_3bin; - TH1F* pt_DETInclJet320_4bin; - TH1F* pt_DETInclJet320_5bin; - TH1F* pt_DETInclJet320_6bin; - TH1F* pt_DETInclJet320_7bin; - - TH1F* pt_DETInclJet400_1bin; - TH1F* pt_DETInclJet400_2bin; - TH1F* pt_DETInclJet400_3bin; - TH1F* pt_DETInclJet400_4bin; - TH1F* pt_DETInclJet400_5bin; - TH1F* pt_DETInclJet400_6bin; - TH1F* pt_DETInclJet400_7bin; - - TH1F* pt_DETInclJet450_1bin; - TH1F* pt_DETInclJet450_2bin; - TH1F* pt_DETInclJet450_3bin; - TH1F* pt_DETInclJet450_4bin; - TH1F* pt_DETInclJet450_5bin; - TH1F* pt_DETInclJet450_6bin; - TH1F* pt_DETInclJet450_7bin; - - TH1F* pt_GENInclJet_1bin; - TH1F* pt_GENInclJet_2bin; - TH1F* pt_GENInclJet_3bin; - TH1F* pt_GENInclJet_4bin; - TH1F* pt_GENInclJet_5bin; - TH1F* pt_GENInclJet_6bin; - TH1F* pt_GENInclJet_7bin; - - TH1F* PF_MatchedInclusiveJets_1bin; - TH1F* PF_MatchedInclusiveJets_2bin; - TH1F* PF_MatchedInclusiveJets_3bin; - TH1F* PF_MatchedInclusiveJets_4bin; - TH1F* PF_MatchedInclusiveJets_5bin; - TH1F* PF_MatchedInclusiveJets_6bin; - TH1F* PF_MatchedInclusiveJets_7bin; - - TH1F* Gen_MatchedInclusiveJets_1bin; - TH1F* Gen_MatchedInclusiveJets_2bin; - TH1F* Gen_MatchedInclusiveJets_3bin; - TH1F* Gen_MatchedInclusiveJets_4bin; - TH1F* Gen_MatchedInclusiveJets_5bin; - TH1F* Gen_MatchedInclusiveJets_6bin; - TH1F* Gen_MatchedInclusiveJets_7bin; - - TH1F* PF_FakeInclusiveJets_1bin; - TH1F* PF_FakeInclusiveJets_2bin; - TH1F* PF_FakeInclusiveJets_3bin; - TH1F* PF_FakeInclusiveJets_4bin; - TH1F* PF_FakeInclusiveJets_5bin; - TH1F* PF_FakeInclusiveJets_6bin; - TH1F* PF_FakeInclusiveJets_7bin; - - TH1F* Gen_MissInclusiveJets_1bin; - TH1F* Gen_MissInclusiveJets_2bin; - TH1F* Gen_MissInclusiveJets_3bin; - TH1F* Gen_MissInclusiveJets_4bin; - TH1F* Gen_MissInclusiveJets_5bin; - TH1F* Gen_MissInclusiveJets_6bin; - TH1F* Gen_MissInclusiveJets_7bin; - - TH2F *TwoD_MatchedInclusiveJets_1bin; - TH2F *TwoD_MatchedInclusiveJets_2bin; - TH2F *TwoD_MatchedInclusiveJets_3bin; - TH2F *TwoD_MatchedInclusiveJets_4bin; - TH2F *TwoD_MatchedInclusiveJets_5bin; - TH2F *TwoD_MatchedInclusiveJets_6bin; - TH2F *TwoD_MatchedInclusiveJets_7bin; - - TH1F* Resolution1D; - TH1F* ResolutionForward1D; - - TProfile *ResolutionTagAndProbe; - - TProfile *ResolutionInclusiveJets; - TProfile *ResolutionInclusiveJets_1bin; - TProfile *ResolutionInclusiveJets_2bin; - TProfile *ResolutionInclusiveJets_3bin; - TProfile *ResolutionInclusiveJets_4bin; - TProfile *ResolutionInclusiveJets_5bin; - TProfile *ResolutionInclusiveJets_6bin; - TProfile *ResolutionInclusiveJets_7bin; - - TH1F *hist_leading_pt_emulated_Jet60; - TH1F *hist_leading_pt_all_Jet60; - TH1F *hist_leading_eta_emulated_Jet60; - TH1F *hist_leading_eta_all_Jet60; - TH1F *hist_leading_pt_HLT_Jet60U_eff; - TH1F *hist_leading_eta_HLT_Jet60U_eff; - - TH1F *hist_leading_pt_emulated_Jet80; - TH1F *hist_leading_pt_all_Jet80; - TH1F *hist_leading_eta_emulated_Jet80; - TH1F *hist_leading_eta_all_Jet80; - TH1F *hist_leading_pt_HLT_Jet80U_eff; - TH1F *hist_leading_eta_HLT_Jet80U_eff; - - TH1F *hist_leading_pt_emulated_Jet140; - TH1F *hist_leading_pt_all_Jet140; - TH1F *hist_leading_eta_emulated_Jet140; - TH1F *hist_leading_eta_all_Jet140; - TH1F *hist_leading_pt_HLT_Jet140U_eff; - TH1F *hist_leading_eta_HLT_Jet140U_eff; - - TH1F *hist_leading_pt_emulated_Jet200; - TH1F *hist_leading_pt_all_Jet200; - TH1F *hist_leading_eta_emulated_Jet200; - TH1F *hist_leading_eta_all_Jet200; - TH1F *hist_leading_pt_HLT_Jet200U_eff; - TH1F *hist_leading_eta_HLT_Jet200U_eff; - - TH1F *hist_leading_pt_emulated_Jet260; - TH1F *hist_leading_pt_all_Jet260; - TH1F *hist_leading_eta_emulated_Jet260; - TH1F *hist_leading_eta_all_Jet260; - TH1F *hist_leading_pt_HLT_Jet260U_eff; - TH1F *hist_leading_eta_HLT_Jet260U_eff; - - TH1F *hist_leading_pt_emulated_Jet320; - TH1F *hist_leading_pt_all_Jet320; - TH1F *hist_leading_eta_emulated_Jet320; - TH1F *hist_leading_eta_all_Jet320; - TH1F *hist_leading_pt_HLT_Jet320U_eff; - TH1F *hist_leading_eta_HLT_Jet320U_eff; - - TH1F *hist_leading_pt_emulated_Jet400; - TH1F *hist_leading_pt_all_Jet400; - TH1F *hist_leading_eta_emulated_Jet400; - TH1F *hist_leading_eta_all_Jet400; - TH1F *hist_leading_pt_HLT_Jet400U_eff; - TH1F *hist_leading_eta_HLT_Jet400U_eff; - - TH1F *hist_leading_pt_emulated_Jet450; - TH1F *hist_leading_pt_all_Jet450; - TH1F *hist_leading_eta_emulated_Jet450; - TH1F *hist_leading_eta_all_Jet450; - TH1F *hist_leading_pt_HLT_Jet450U_eff; - TH1F *hist_leading_eta_HLT_Jet450U_eff; - - TH1F *hist_leading_pt_emulated_Jet500; - TH1F *hist_leading_pt_all_Jet500; - TH1F *hist_leading_eta_emulated_Jet500; - TH1F *hist_leading_eta_all_Jet500; - TH1F *hist_leading_pt_HLT_Jet500U_eff; - TH1F *hist_leading_eta_HLT_Jet500U_eff; - - TH1F* TagAndProbeEff; - TH1F* TagAndProbeNum; - TH1F* TagAndProbeDen; - - TH1F* pt_DETInclJetUP_1bin; - TH1F* pt_DETInclJetUP_2bin; - TH1F* pt_DETInclJetUP_3bin; - TH1F* pt_DETInclJetUP_4bin; - TH1F* pt_DETInclJetUP_5bin; - TH1F* pt_DETInclJetUP_6bin; - TH1F* pt_DETInclJetUP_7bin; - - TH1F* pt_DETInclJetDOWN_1bin; - TH1F* pt_DETInclJetDOWN_2bin; - TH1F* pt_DETInclJetDOWN_3bin; - TH1F* pt_DETInclJetDOWN_4bin; - TH1F* pt_DETInclJetDOWN_5bin; - TH1F* pt_DETInclJetDOWN_6bin; - TH1F* pt_DETInclJetDOWN_7bin; - - TH1F* Chargedhf0_DETJet; - TH1F* Chargedef0_DETJet; - TH1F* Neutralhf0_DETJet; - TH1F* Photonef0_DETJet; - TH1F* Hadronef0_DETJet; - TH1F* Muonef0_DETJet; - TH1F* Electromagneticef0_DETJet; - - TH1F* ChargedhMultiplicity0_DETJet; - TH1F* ChargedeMultiplicity0_DETJet; - TH1F* NeutralhMultiplicity0_DETJet; - TH1F* PhotoneMultiplicity0_DETJet; - TH1F* HadroneMultiplicity0_DETJet; - TH1F* MuoneMultiplicity0_DETJet; - TH1F* ElectromagneticeMultiplicity0_DETJet; - - TH1F* Emf0_DETJet; - TH1F* Hpd0_DETJet; - TH1F* Chf0_DETJet; - TH1F* Nhf0_DETJet; - TH1F* Pef0_DETJet; - TH1F* Eef0_DETJet; - TH1F* Mef0_DETJet; - - TH1F* TruePileUpMC; - TH1F* TruePileUpMCInteger; - TH1F* TruePileUpDataInteger; - - TH1F* MET_DET; - TH1F* METPhi_DET; - TH1F* FractionMET_DET; - - /*RooUnfoldResponse resp_jetpt1etabin; - RooUnfoldResponse resp_jetpt2etabin; - RooUnfoldResponse resp_jetpt3etabin; - RooUnfoldResponse resp_jetpt4etabin; - RooUnfoldResponse resp_jetpt5etabin; - RooUnfoldResponse resp_jetpt6etabin; - RooUnfoldResponse resp_jetpt7etabin;*/ - - }; - -#endif - From 49aed8d250b3d6ee6df77c41a7c974da09f93bf3 Mon Sep 17 00:00:00 2001 From: pgunnell Date: Thu, 2 Nov 2017 09:43:13 +0100 Subject: [PATCH 42/48] Delete QCDCaloJet.cc --- AnalysisFW/src/QCDCaloJet.cc | 1 - 1 file changed, 1 deletion(-) delete mode 100644 AnalysisFW/src/QCDCaloJet.cc diff --git a/AnalysisFW/src/QCDCaloJet.cc b/AnalysisFW/src/QCDCaloJet.cc deleted file mode 100644 index 9c1aba60586..00000000000 --- a/AnalysisFW/src/QCDCaloJet.cc +++ /dev/null @@ -1 +0,0 @@ -#include "SMPJ/AnalysisFW/interface/QCDCaloJet.h" From c91ec78f73a28dd1dafb86ed9a374679c05aebef Mon Sep 17 00:00:00 2001 From: pgunnell Date: Thu, 2 Nov 2017 09:43:15 +0100 Subject: [PATCH 43/48] Delete MyElectron.cc --- AnalysisFW/src/MyElectron.cc | 1 - 1 file changed, 1 deletion(-) delete mode 100644 AnalysisFW/src/MyElectron.cc diff --git a/AnalysisFW/src/MyElectron.cc b/AnalysisFW/src/MyElectron.cc deleted file mode 100644 index 10956914a4e..00000000000 --- a/AnalysisFW/src/MyElectron.cc +++ /dev/null @@ -1 +0,0 @@ -#include "SMPJ/AnalysisFW/interface/MyElectron.h" From 01adad27315d4e6f24d08ba09e38bbf0410770ab Mon Sep 17 00:00:00 2001 From: pgunnell Date: Thu, 2 Nov 2017 09:43:17 +0100 Subject: [PATCH 44/48] Delete MyElectron.cc~ --- AnalysisFW/src/MyElectron.cc~ | 1 - 1 file changed, 1 deletion(-) delete mode 100644 AnalysisFW/src/MyElectron.cc~ diff --git a/AnalysisFW/src/MyElectron.cc~ b/AnalysisFW/src/MyElectron.cc~ deleted file mode 100644 index 55f03cb32ba..00000000000 --- a/AnalysisFW/src/MyElectron.cc~ +++ /dev/null @@ -1 +0,0 @@ -#include "SMPJ/AnalysisFW/interface/MyMuon.h" From 549210e9c113b2684271edc9acee484dd1e7c273 Mon Sep 17 00:00:00 2001 From: pgunnell Date: Thu, 2 Nov 2017 09:43:18 +0100 Subject: [PATCH 45/48] Delete MyMuon.cc --- AnalysisFW/src/MyMuon.cc | 1 - 1 file changed, 1 deletion(-) delete mode 100644 AnalysisFW/src/MyMuon.cc diff --git a/AnalysisFW/src/MyMuon.cc b/AnalysisFW/src/MyMuon.cc deleted file mode 100644 index 55f03cb32ba..00000000000 --- a/AnalysisFW/src/MyMuon.cc +++ /dev/null @@ -1 +0,0 @@ -#include "SMPJ/AnalysisFW/interface/MyMuon.h" From 9da12976f99c98aac143dbc951ec5c54cebedbb1 Mon Sep 17 00:00:00 2001 From: pgunnell Date: Thu, 2 Nov 2017 09:43:42 +0100 Subject: [PATCH 46/48] Delete MyElectron.h --- AnalysisFW/interface/MyElectron.h | 87 ------------------------------- 1 file changed, 87 deletions(-) delete mode 100644 AnalysisFW/interface/MyElectron.h diff --git a/AnalysisFW/interface/MyElectron.h b/AnalysisFW/interface/MyElectron.h deleted file mode 100644 index deb26c8a981..00000000000 --- a/AnalysisFW/interface/MyElectron.h +++ /dev/null @@ -1,87 +0,0 @@ - //Author P. Gunnellini - -#ifndef MyElectron_h -#define MyElectron_h -#include "DataFormats/PatCandidates/interface/Electron.h" -//-------- Generic Jet class for QCD analyses --------------- -class MyElectron -{ - public: - typedef reco::Particle::LorentzVector LorentzVector; - //------------ Constructor ------------------------------ - MyElectron() {} - //------------ Destructor ------------------------------- - ~MyElectron() {} - //------------ Sett methods ----------------------------- - void setP4(LorentzVector fP4) {P4_ = fP4;} - void setGen(LorentzVector fP4, float fgenR) {genP4_ = fP4;genR_ = fgenR;} - void setCor(float fCor) {cor_ = fCor;} - void setUnc(float fUnc) {unc_ = fUnc;} - void setUncSrc(std::vector fUncSrc) {uncSrc_ = fUncSrc;} - //New Instructions - void setElectronDxyVertex(double fDxyVertex) {DxyVertex_ = fDxyVertex;} - void setElectronDzVertex(double fDzVertex) {DzVertex_ = fDzVertex;} - void setPDGId(double fPDGID) {PDGID_ = fPDGID;} - void setPfIso(double fPfIso) {PfIso_ = fPfIso;} - - void setChargedHadronIos(double fChargedHadronIso) {fChargedHadronIso = ChargedHadronIso_;} - void setNeutralHadronIso(double fNeutralHadronIso) {fNeutralHadronIso = NeutralHadronIso_;} - void setPhotonIso(double fPhotonIso) {fPhotonIso = PhotonIso_;} - void setPuChargedHadronIso(double fPuChargedHadronIso) {fPuChargedHadronIso = PuChargedHadronIso_;} - - //------------ Get methods ------------------------------ - const LorentzVector& p4() const {return P4_;} - const LorentzVector& genp4() const {return genP4_;} - float pt() const {return P4_.pt()/cor_;} - float genpt() const {return genP4_.pt();} - float geneta() const {return genP4_.eta();} - float genR() const {return genR_;} - float ptCor() const {return P4_.pt();} - float e() const {return P4_.energy()/cor_;} - float eCor() const {return P4_.energy();} - float eta() const {return P4_.eta();} - float y() const {return P4_.Rapidity();} - float phi() const {return P4_.phi();} - float mass() const {return P4_.mass();} - float cor() const {return cor_;} - float unc() const {return unc_;} - float uncSrc(int i) const {return uncSrc_[i];} - - float Iso() const {return PfIso_;} - float pdgId() const {return PDGID_;} - float ElectronDZVertex() const {return DzVertex_;} - float ElectronDxyVertex() const {return DxyVertex_;} - - // int nParticles() const {return pfParticles_.size();} - // const LorentzVector& getPFParticles(int i) const {return pfParticles_[i];} - private: - //------ jet 4-momentum vector------------------ - LorentzVector P4_; - //------ matched genjet 4-momentum vector------- - LorentzVector genP4_; - //------ matching radius ----------------------- - float genR_; - //------ jec factor ---------------------------- - float cor_; - // ----- All components of JEC Factor ---------- - std::vector jecLabels_; - //------ jec uncertainty ----------------------- - float unc_; - //------ jec uncertainty sources --------------- - std::vector uncSrc_; - //------ jet area ------------------------------ - float area_; - - //Electron Vertices - double DxyVertex_; - double DzVertex_; - double PDGID_; - double PfIso_; - - double PuChargedHadronIso_; - double ChargedHadronIso_; - double NeutralHadronIso_; - double PhotonIso_; - - }; -#endif From 58811c3887a191d7881342843ba5db80de9a8607 Mon Sep 17 00:00:00 2001 From: pgunnell Date: Thu, 2 Nov 2017 09:43:46 +0100 Subject: [PATCH 47/48] Delete MyMuon.h --- AnalysisFW/interface/MyMuon.h | 87 ----------------------------------- 1 file changed, 87 deletions(-) delete mode 100644 AnalysisFW/interface/MyMuon.h diff --git a/AnalysisFW/interface/MyMuon.h b/AnalysisFW/interface/MyMuon.h deleted file mode 100644 index fc9e4da6ceb..00000000000 --- a/AnalysisFW/interface/MyMuon.h +++ /dev/null @@ -1,87 +0,0 @@ - //Author P. Gunnellini - -#ifndef MyMuon_h -#define MyMuon_h -#include "DataFormats/PatCandidates/interface/Muon.h" -//-------- Generic Jet class for QCD analyses --------------- -class MyMuon -{ - public: - typedef reco::Particle::LorentzVector LorentzVector; - //------------ Constructor ------------------------------ - MyMuon() {} - //------------ Destructor ------------------------------- - ~MyMuon() {} - //------------ Sett methods ----------------------------- - void setP4(LorentzVector fP4) {P4_ = fP4;} - void setGen(LorentzVector fP4, float fgenR) {genP4_ = fP4;genR_ = fgenR;} - void setCor(float fCor) {cor_ = fCor;} - void setUnc(float fUnc) {unc_ = fUnc;} - void setUncSrc(std::vector fUncSrc) {uncSrc_ = fUncSrc;} - //New Instructions - void setMuonDxyVertex(double fDxyVertex) {DxyVertex_ = fDxyVertex;} - void setMuonDzVertex(double fDzVertex) {DzVertex_ = fDzVertex;} - void setPDGId(double fPDGID) {PDGID_ = fPDGID;} - void setPfIso(double fPfIso) {PfIso_ = fPfIso;} - - void setChargedHadronIso(double fChargedHadronIso) {fChargedHadronIso = ChargedHadronIso_;} - void setNeutralHadronIso(double fNeutralHadronIso) {fNeutralHadronIso = NeutralHadronIso_;} - void setPhotonIso(double fPhotonIso) {fPhotonIso = PhotonIso_;} - void setPuChargedHadronIso(double fPuChargedHadronIso) {fPuChargedHadronIso = PuChargedHadronIso_;} - - //------------ Get methods ------------------------------ - const LorentzVector& p4() const {return P4_;} - const LorentzVector& genp4() const {return genP4_;} - float pt() const {return P4_.pt()/cor_;} - float genpt() const {return genP4_.pt();} - float geneta() const {return genP4_.eta();} - float genR() const {return genR_;} - float ptCor() const {return P4_.pt();} - float e() const {return P4_.energy()/cor_;} - float eCor() const {return P4_.energy();} - float eta() const {return P4_.eta();} - float y() const {return P4_.Rapidity();} - float phi() const {return P4_.phi();} - float mass() const {return P4_.mass();} - float cor() const {return cor_;} - float unc() const {return unc_;} - float uncSrc(int i) const {return uncSrc_[i];} - - float Iso() const {return PfIso_;} - float pdgId() const {return PDGID_;} - float MuonDZVertex() const {return DzVertex_;} - float MuonDxyVertex() const {return DxyVertex_;} - - // int nParticles() const {return pfParticles_.size();} - // const LorentzVector& getPFParticles(int i) const {return pfParticles_[i];} - private: - //------ jet 4-momentum vector------------------ - LorentzVector P4_; - //------ matched genjet 4-momentum vector------- - LorentzVector genP4_; - //------ matching radius ----------------------- - float genR_; - //------ jec factor ---------------------------- - float cor_; - // ----- All components of JEC Factor ---------- - std::vector jecLabels_; - //------ jec uncertainty ----------------------- - float unc_; - //------ jec uncertainty sources --------------- - std::vector uncSrc_; - //------ jet area ------------------------------ - float area_; - - //Muon Vertices - double DxyVertex_; - double DzVertex_; - double PDGID_; - double PfIso_; - - double PuChargedHadronIso_; - double ChargedHadronIso_; - double NeutralHadronIso_; - double PhotonIso_; - - }; -#endif From 02526aca52a7a723d3852532c9465e3299e46e65 Mon Sep 17 00:00:00 2001 From: pgunnell Date: Thu, 2 Nov 2017 09:43:50 +0100 Subject: [PATCH 48/48] Delete QCDCaloJet.h --- AnalysisFW/interface/QCDCaloJet.h | 39 ------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 AnalysisFW/interface/QCDCaloJet.h diff --git a/AnalysisFW/interface/QCDCaloJet.h b/AnalysisFW/interface/QCDCaloJet.h deleted file mode 100644 index 9bec8a657f1..00000000000 --- a/AnalysisFW/interface/QCDCaloJet.h +++ /dev/null @@ -1,39 +0,0 @@ -//Author K. Kousouris -//Modified by: S. Ganguly - -#ifndef QCDCaloJet_h -#define QCDCaloJet_h -#include "SMPJ/AnalysisFW/interface/QCDJet.h" - -class QCDCaloJet : public QCDJet { - public: - //------------ Constructor ------------------------------ - QCDCaloJet() {emf_=0;fHPD_=0;fRBX_=0;n90hits_=0;nTrkCalo_=0;nTrkVtx_=0;} - //------------ Destructor ------------------------------- - ~QCDCaloJet() {}; - //------------ Set method ------------------------------- - void setVar(float femf,float ffHPD,float ffRBX,int fn90,int fnTrkCalo,int fnTrkVtx) {emf_ = - femf;fHPD_=ffHPD;fRBX_=ffRBX;n90hits_=fn90;nTrkCalo_=fnTrkCalo;nTrkVtx_=fnTrkVtx;} - //------------ Get methods ------------------------------ - float emf() const {return emf_;} - float fHPD() const {return fHPD_;} - float fRBX() const {return fRBX_;} - int n90hits() const {return n90hits_;} - int nTrkCalo() const {return nTrkCalo_;} - int nTrkVtx() const {return nTrkVtx_;} - - private: - //---- EM energy fraction ---------------- - float emf_; - //---- fraction of energy from one HPD --- - float fHPD_; - //---- fraction of energy from one RBX --- - float fRBX_; - //---- number of hits containing at least 90% of the jet energy - int n90hits_; - //---- number of associated tracks at the Calo face - int nTrkCalo_; - //---- number of associated tracks at the vertex - int nTrkVtx_; - }; -#endif