diff --git a/DataFormats/PatCandidates/interface/Photon.h b/DataFormats/PatCandidates/interface/Photon.h index d9d724367080e..640df3a1a2aea 100644 --- a/DataFormats/PatCandidates/interface/Photon.h +++ b/DataFormats/PatCandidates/interface/Photon.h @@ -100,6 +100,23 @@ namespace pat { /// Returns the calorimeter isolation combined from ecal /// and hcal float caloIso() const { return ecalIso()+hcalIso(); } + + /// PARTICLE FLOW ISOLATION + /// Returns the isolation calculated with all the PFCandidates + float particleIso() const { return userIsolation(pat::PfAllParticleIso); } + /// Returns the isolation calculated with only the charged hadron + /// PFCandidates + float chargedHadronIso() const { return userIsolation(pat::PfChargedHadronIso); } + /// Returns the isolation calculated with only the neutral hadron + /// PFCandidates + float neutralHadronIso() const { return userIsolation(pat::PfNeutralHadronIso); } + /// Returns the isolation calculated with only the gamma + /// PFCandidates + float photonIso() const { return userIsolation(pat::PfGammaIso); } + /// Returns the isolation calculated with only the pile-up charged hadron + /// PFCandidates + float puChargedHadronIso() const { return userIsolation(pat::PfPUChargedHadronIso); } + /// Returns a user defined isolation value float userIso(uint8_t index=0) const { return userIsolation(IsolationKeys(UserBaseIso + index)); } /// Returns the isolation variable for a specifc key (or diff --git a/PhysicsTools/PatAlgos/plugins/PATElectronProducer.h b/PhysicsTools/PatAlgos/plugins/PATElectronProducer.h index aaa359d71ac29..664dd8d67b672 100644 --- a/PhysicsTools/PatAlgos/plugins/PATElectronProducer.h +++ b/PhysicsTools/PatAlgos/plugins/PATElectronProducer.h @@ -144,7 +144,7 @@ namespace pat { template void readIsolationLabels( const edm::ParameterSet & iConfig, const char* psetName, IsolationLabels& labels, - std::vector > > tokens); + std::vector > > & tokens); bool addElecID_; typedef std::pair NameTag; @@ -187,7 +187,7 @@ template void PATElectronProducer::readIsolationLabels( const edm::ParameterSet & iConfig, const char* psetName, IsolationLabels& labels, - std::vector > > tokens) { + std::vector > > & tokens) { labels.clear(); diff --git a/PhysicsTools/PatAlgos/plugins/PATMuonProducer.h b/PhysicsTools/PatAlgos/plugins/PATMuonProducer.h index d8a52d95188dd..ffa58081c96f6 100644 --- a/PhysicsTools/PatAlgos/plugins/PATMuonProducer.h +++ b/PhysicsTools/PatAlgos/plugins/PATMuonProducer.h @@ -65,7 +65,7 @@ namespace pat { void fillMuon( Muon& aMuon, const MuonBaseRef& muonRef, const reco::CandidateBaseRef& baseRef, const GenAssociations& genMatches, const IsoDepositMaps& deposits, const IsolationValueMaps& isolationValues) const; /// fill label vector from the contents of the parameter set, /// for the embedding of isoDeposits or userIsolation values - template void readIsolationLabels( const edm::ParameterSet & iConfig, const char* psetName, IsolationLabels& labels, std::vector > > tokens); + template void readIsolationLabels( const edm::ParameterSet & iConfig, const char* psetName, IsolationLabels& labels, std::vector > > & tokens); // embed various impact parameters with errors @@ -160,7 +160,7 @@ using namespace pat; template -void PATMuonProducer::readIsolationLabels( const edm::ParameterSet & iConfig, const char* psetName, IsolationLabels& labels, std::vector > > tokens) +void PATMuonProducer::readIsolationLabels( const edm::ParameterSet & iConfig, const char* psetName, IsolationLabels& labels, std::vector > > & tokens) { labels.clear(); diff --git a/PhysicsTools/PatAlgos/plugins/PATPhotonProducer.cc b/PhysicsTools/PatAlgos/plugins/PATPhotonProducer.cc index 657fd299d14e1..0ae9f8cedd9dc 100755 --- a/PhysicsTools/PatAlgos/plugins/PATPhotonProducer.cc +++ b/PhysicsTools/PatAlgos/plugins/PATPhotonProducer.cc @@ -78,21 +78,11 @@ PATPhotonProducer::PATPhotonProducer(const edm::ParameterSet & iConfig) : // produces vector of photons produces >(); - if (iConfig.exists("isoDeposits")) { - edm::ParameterSet depconf = iConfig.getParameter("isoDeposits"); - if (depconf.exists("tracker")) isoDepositLabels_.push_back(std::make_pair(pat::TrackIso, depconf.getParameter("tracker"))); - if (depconf.exists("ecal")) isoDepositLabels_.push_back(std::make_pair(pat::EcalIso, depconf.getParameter("ecal"))); - if (depconf.exists("hcal")) isoDepositLabels_.push_back(std::make_pair(pat::HcalIso, depconf.getParameter("hcal"))); - if (depconf.exists("user")) { - std::vector userdeps = depconf.getParameter >("user"); - std::vector::const_iterator it = userdeps.begin(), ed = userdeps.end(); - int key = UserBaseIso; - for ( ; it != ed; ++it, ++key) { - isoDepositLabels_.push_back(std::make_pair(IsolationKeys(key), *it)); - } - } - } - isoDepositTokens_ = edm::vector_transform(isoDepositLabels_, [this](std::pair const & label){return consumes >(label.second);}); + // read isoDeposit labels, for direct embedding + readIsolationLabels(iConfig, "isoDeposits", isoDepositLabels_, isoDepositTokens_); + // read isolation value labels, for direct embedding + readIsolationLabels(iConfig, "isolationValues", isolationValueLabels_, isolationValueTokens_); + } PATPhotonProducer::~PATPhotonProducer() { @@ -123,11 +113,17 @@ void PATPhotonProducer::produce(edm::Event & iEvent, const edm::EventSetup & iSe if (efficiencyLoader_.enabled()) efficiencyLoader_.newEvent(iEvent); if (resolutionLoader_.enabled()) resolutionLoader_.newEvent(iEvent, iSetup); - std::vector > > deposits(isoDepositTokens_.size()); + IsoDepositMaps deposits(isoDepositTokens_.size()); for (size_t j = 0, nd = isoDepositTokens_.size(); j < nd; ++j) { iEvent.getByToken(isoDepositTokens_[j], deposits[j]); } + IsolationValueMaps isolationValues(isolationValueTokens_.size()); + for (size_t j = 0; j > > idhandles; std::vector ids; @@ -180,7 +176,10 @@ void PATPhotonProducer::produce(edm::Event & iEvent, const edm::EventSetup & iSe for (size_t j = 0, nd = deposits.size(); j < nd; ++j) { aPhoton.setIsoDeposit(isoDepositLabels_[j].first, (*deposits[j])[photonRef]); } - + + for (size_t j = 0; j("tracker"); isoDepositsPSet.addOptional("ecal"); isoDepositsPSet.addOptional("hcal"); + isoDepositsPSet.addOptional("pfAllParticles"); + isoDepositsPSet.addOptional("pfChargedHadrons"); + isoDepositsPSet.addOptional("pfChargedAll"); + isoDepositsPSet.addOptional("pfPUChargedHadrons"); + isoDepositsPSet.addOptional("pfNeutralHadrons"); + isoDepositsPSet.addOptional("pfPhotons"); isoDepositsPSet.addOptional >("user"); iDesc.addOptional("isoDeposits", isoDepositsPSet); + + // isolation values configurables + edm::ParameterSetDescription isolationValuesPSet; + isolationValuesPSet.addOptional("tracker"); + isolationValuesPSet.addOptional("ecal"); + isolationValuesPSet.addOptional("hcal"); + isolationValuesPSet.addOptional("pfAllParticles"); + isolationValuesPSet.addOptional("pfChargedHadrons"); + isolationValuesPSet.addOptional("pfChargedAll"); + isolationValuesPSet.addOptional("pfPUChargedHadrons"); + isolationValuesPSet.addOptional("pfNeutralHadrons"); + isolationValuesPSet.addOptional("pfPhotons"); + isolationValuesPSet.addOptional >("user"); + iDesc.addOptional("isolationValues", isolationValuesPSet); // Efficiency configurables edm::ParameterSetDescription efficienciesPSet; diff --git a/PhysicsTools/PatAlgos/plugins/PATPhotonProducer.h b/PhysicsTools/PatAlgos/plugins/PATPhotonProducer.h index e4749dbdd6b6c..a5796c1fad1c4 100644 --- a/PhysicsTools/PatAlgos/plugins/PATPhotonProducer.h +++ b/PhysicsTools/PatAlgos/plugins/PATPhotonProducer.h @@ -58,10 +58,25 @@ namespace pat { // tools GreaterByEt eTComparator_; + typedef std::vector< edm::Handle< edm::ValueMap > > IsoDepositMaps; + typedef std::vector< edm::Handle< edm::ValueMap > > IsolationValueMaps; + typedef std::pair IsolationLabel; + typedef std::vector IsolationLabels; + pat::helper::MultiIsolator isolator_; pat::helper::MultiIsolator::IsolationValuePairs isolatorTmpStorage_; // better here than recreate at each event - std::vector > isoDepositLabels_; std::vector > > isoDepositTokens_; + std::vector > > isolationValueTokens_; + + IsolationLabels isoDepositLabels_; + IsolationLabels isolationValueLabels_; + + /// fill the labels vector from the contents of the parameter set, + /// for the isodeposit or isolation values embedding + template void readIsolationLabels( const edm::ParameterSet & iConfig, + const char* psetName, + IsolationLabels& labels, + std::vector > > & tokens); bool addEfficiencies_; pat::helper::EfficiencyLoader efficiencyLoader_; @@ -79,7 +94,57 @@ namespace pat { }; +} + + +using namespace pat; + +template +void PATPhotonProducer::readIsolationLabels( const edm::ParameterSet & iConfig, + const char* psetName, + IsolationLabels& labels, + std::vector > > & tokens) { + + labels.clear(); + + if (iConfig.exists( psetName )) { + edm::ParameterSet depconf + = iConfig.getParameter(psetName); + + if (depconf.exists("tracker")) labels.push_back(std::make_pair(pat::TrackIso, depconf.getParameter("tracker"))); + if (depconf.exists("ecal")) labels.push_back(std::make_pair(pat::EcalIso, depconf.getParameter("ecal"))); + if (depconf.exists("hcal")) labels.push_back(std::make_pair(pat::HcalIso, depconf.getParameter("hcal"))); + if (depconf.exists("pfAllParticles")) { + labels.push_back(std::make_pair(pat::PfAllParticleIso, depconf.getParameter("pfAllParticles"))); + } + if (depconf.exists("pfChargedHadrons")) { + labels.push_back(std::make_pair(pat::PfChargedHadronIso, depconf.getParameter("pfChargedHadrons"))); + } + if (depconf.exists("pfChargedAll")) { + labels.push_back(std::make_pair(pat::PfChargedAllIso, depconf.getParameter("pfChargedAll"))); + } + if (depconf.exists("pfPUChargedHadrons")) { + labels.push_back(std::make_pair(pat::PfPUChargedHadronIso, depconf.getParameter("pfPUChargedHadrons"))); + } + if (depconf.exists("pfNeutralHadrons")) { + labels.push_back(std::make_pair(pat::PfNeutralHadronIso, depconf.getParameter("pfNeutralHadrons"))); + } + if (depconf.exists("pfPhotons")) { + labels.push_back(std::make_pair(pat::PfGammaIso, depconf.getParameter("pfPhotons"))); + } + if (depconf.exists("user")) { + std::vector userdeps = depconf.getParameter >("user"); + std::vector::const_iterator it = userdeps.begin(), ed = userdeps.end(); + int key = UserBaseIso; + for ( ; it != ed; ++it, ++key) { + labels.push_back(std::make_pair(IsolationKeys(key), *it)); + } + } + } + + tokens = edm::vector_transform(labels, [this](IsolationLabel const & label){return consumes >(label.second);}); } + #endif diff --git a/PhysicsTools/PatAlgos/python/producersLayer1/electronProducer_cff.py b/PhysicsTools/PatAlgos/python/producersLayer1/electronProducer_cff.py index b111fc634e20b..57d85fcff69f7 100644 --- a/PhysicsTools/PatAlgos/python/producersLayer1/electronProducer_cff.py +++ b/PhysicsTools/PatAlgos/python/producersLayer1/electronProducer_cff.py @@ -4,8 +4,45 @@ from TrackingTools.TransientTrack.TransientTrackBuilder_cfi import * from PhysicsTools.PatAlgos.producersLayer1.electronProducer_cfi import * +from PhysicsTools.PatAlgos.recoLayer0.pfParticleSelectionForIso_cff import * +from CommonTools.ParticleFlow.Isolation.pfElectronIsolation_cff import * + +sourceElectrons = patElectrons.electronSource + +elPFIsoDepositCharged.src = sourceElectrons +elPFIsoDepositChargedAll.src = sourceElectrons +elPFIsoDepositNeutral.src = sourceElectrons +elPFIsoDepositGamma.src = sourceElectrons +elPFIsoDepositPU.src = sourceElectrons + +patElectrons.isoDeposits = cms.PSet( + pfChargedHadrons = cms.InputTag("elPFIsoDepositCharged" ), + pfChargedAll = cms.InputTag("elPFIsoDepositChargedAll" ), + pfPUChargedHadrons = cms.InputTag("elPFIsoDepositPU" ), + pfNeutralHadrons = cms.InputTag("elPFIsoDepositNeutral" ), + pfPhotons = cms.InputTag("elPFIsoDepositGamma" ), + ) + +patElectrons.isolationValues = cms.PSet( + pfChargedHadrons = cms.InputTag("elPFIsoValueCharged04PFId"), + pfChargedAll = cms.InputTag("elPFIsoValueChargedAll04PFId"), + pfPUChargedHadrons = cms.InputTag("elPFIsoValuePU04PFId" ), + pfNeutralHadrons = cms.InputTag("elPFIsoValueNeutral04PFId" ), + pfPhotons = cms.InputTag("elPFIsoValueGamma04PFId" ), + ) + +patElectrons.isolationValuesNoPFId = cms.PSet( + pfChargedHadrons = cms.InputTag("elPFIsoValueCharged04NoPFId"), + pfChargedAll = cms.InputTag("elPFIsoValueChargedAll04NoPFId"), + pfPUChargedHadrons = cms.InputTag("elPFIsoValuePU04NoPFId" ), + pfNeutralHadrons = cms.InputTag("elPFIsoValueNeutral04NoPFId" ), + pfPhotons = cms.InputTag("elPFIsoValueGamma04NoPFId" ) + ) + ## for scheduled mode makePatElectrons = cms.Sequence( + pfParticleSelectionForIsoSequence * + pfElectronIsolationSequence * electronMatch * patElectrons ) diff --git a/PhysicsTools/PatAlgos/python/producersLayer1/muonProducer_cff.py b/PhysicsTools/PatAlgos/python/producersLayer1/muonProducer_cff.py index dfefd496e2165..394aeeae85760 100644 --- a/PhysicsTools/PatAlgos/python/producersLayer1/muonProducer_cff.py +++ b/PhysicsTools/PatAlgos/python/producersLayer1/muonProducer_cff.py @@ -4,8 +4,37 @@ from TrackingTools.TransientTrack.TransientTrackBuilder_cfi import * from PhysicsTools.PatAlgos.producersLayer1.muonProducer_cfi import * +from PhysicsTools.PatAlgos.recoLayer0.pfParticleSelectionForIso_cff import * +from CommonTools.ParticleFlow.Isolation.pfMuonIsolation_cff import * + +sourceMuons = patMuons.muonSource + +muPFIsoDepositCharged.src = sourceMuons +muPFIsoDepositChargedAll.src = sourceMuons +muPFIsoDepositNeutral.src = sourceMuons +muPFIsoDepositGamma.src = sourceMuons +muPFIsoDepositPU.src = sourceMuons + +patMuons.isoDeposits = cms.PSet( + pfChargedHadrons = cms.InputTag("muPFIsoDepositCharged" ), + pfChargedAll = cms.InputTag("muPFIsoDepositChargedAll" ), + pfPUChargedHadrons = cms.InputTag("muPFIsoDepositPU" ), + pfNeutralHadrons = cms.InputTag("muPFIsoDepositNeutral" ), + pfPhotons = cms.InputTag("muPFIsoDepositGamma" ), + ) + +patMuons.isolationValues = cms.PSet( + pfChargedHadrons = cms.InputTag("muPFIsoValueCharged04"), + pfChargedAll = cms.InputTag("muPFIsoValueChargedAll04"), + pfPUChargedHadrons = cms.InputTag("muPFIsoValuePU04" ), + pfNeutralHadrons = cms.InputTag("muPFIsoValueNeutral04" ), + pfPhotons = cms.InputTag("muPFIsoValueGamma04" ), + ) + ## for scheduled mode makePatMuons = cms.Sequence( + pfParticleSelectionForIsoSequence * + pfMuonIsolationSequence * muonMatch * patMuons ) diff --git a/PhysicsTools/PatAlgos/python/producersLayer1/patCandidates_cff.py b/PhysicsTools/PatAlgos/python/producersLayer1/patCandidates_cff.py index cb50a6243ece9..2112265c93bdf 100644 --- a/PhysicsTools/PatAlgos/python/producersLayer1/patCandidates_cff.py +++ b/PhysicsTools/PatAlgos/python/producersLayer1/patCandidates_cff.py @@ -30,3 +30,4 @@ makePatMETs + patCandidateSummary ) + diff --git a/PhysicsTools/PatAlgos/python/producersLayer1/photonProducer_cff.py b/PhysicsTools/PatAlgos/python/producersLayer1/photonProducer_cff.py index 6e9f9b4325c85..ea39542721f91 100644 --- a/PhysicsTools/PatAlgos/python/producersLayer1/photonProducer_cff.py +++ b/PhysicsTools/PatAlgos/python/producersLayer1/photonProducer_cff.py @@ -3,8 +3,37 @@ from PhysicsTools.PatAlgos.mcMatchLayer0.photonMatch_cfi import * from PhysicsTools.PatAlgos.producersLayer1.photonProducer_cfi import * +from PhysicsTools.PatAlgos.recoLayer0.pfParticleSelectionForIso_cff import * +from CommonTools.ParticleFlow.Isolation.pfPhotonIsolation_cff import * + +sourcePhotons = patPhotons.photonSource + +phPFIsoDepositCharged.src = sourcePhotons +phPFIsoDepositChargedAll.src = sourcePhotons +phPFIsoDepositNeutral.src = sourcePhotons +phPFIsoDepositGamma.src = sourcePhotons +phPFIsoDepositPU.src = sourcePhotons + +patPhotons.isoDeposits = cms.PSet( + pfChargedHadrons = cms.InputTag("phPFIsoDepositCharged" ), + pfChargedAll = cms.InputTag("phPFIsoDepositChargedAll" ), + pfPUChargedHadrons = cms.InputTag("phPFIsoDepositPU" ), + pfNeutralHadrons = cms.InputTag("phPFIsoDepositNeutral" ), + pfPhotons = cms.InputTag("phPFIsoDepositGamma" ), + ) + +patPhotons.isolationValues = cms.PSet( + pfChargedHadrons = cms.InputTag("phPFIsoValueCharged04PFId"), + pfChargedAll = cms.InputTag("phPFIsoValueChargedAll04PFId"), + pfPUChargedHadrons = cms.InputTag("phPFIsoValuePU04PFId" ), + pfNeutralHadrons = cms.InputTag("phPFIsoValueNeutral04PFId" ), + pfPhotons = cms.InputTag("phPFIsoValueGamma04PFId" ), + ) + ## for scheduled mode makePatPhotons = cms.Sequence( + pfParticleSelectionForIsoSequence * + pfPhotonIsolationSequence * photonMatch * patPhotons ) diff --git a/PhysicsTools/PatAlgos/python/recoLayer0/pfParticleSelectionForIso_cff.py b/PhysicsTools/PatAlgos/python/recoLayer0/pfParticleSelectionForIso_cff.py new file mode 100644 index 0000000000000..45cd957222117 --- /dev/null +++ b/PhysicsTools/PatAlgos/python/recoLayer0/pfParticleSelectionForIso_cff.py @@ -0,0 +1,14 @@ +from RecoParticleFlow.PFProducer.pfLinker_cff import particleFlowPtrs +from CommonTools.ParticleFlow.pfParticleSelection_cff import * +pfPileUp.PFCandidates = 'particleFlowPtrs' +pfNoPileUp.bottomCollection = 'particleFlowPtrs' +pfPileUpIso.PFCandidates = 'particleFlowPtrs' +pfNoPileUpIso.bottomCollection='particleFlowPtrs' +pfPileUpJME.PFCandidates = 'particleFlowPtrs' +pfNoPileUpJME.bottomCollection='particleFlowPtrs' + +pfParticleSelectionForIsoSequence = cms.Sequence( + particleFlowPtrs + + pfNoPileUpIsoSequence + + pfParticleSelectionSequence + ) \ No newline at end of file diff --git a/PhysicsTools/PatAlgos/python/tools/pfTools.py b/PhysicsTools/PatAlgos/python/tools/pfTools.py index 65f50e2e8a9ad..69d3505290537 100644 --- a/PhysicsTools/PatAlgos/python/tools/pfTools.py +++ b/PhysicsTools/PatAlgos/python/tools/pfTools.py @@ -11,22 +11,6 @@ def warningIsolation(): print "WARNING: particle based isolation must be studied" -from CommonTools.ParticleFlow.Tools.pfIsolation import setupPFElectronIso, setupPFMuonIso - -def useGsfElectrons(process, postfix, dR = "04"): - print "using Gsf Electrons in PF2PAT" - print "WARNING: this will destory the feature of top projection which solves the ambiguity between leptons and jets because" - print "WARNING: there will be overlap between non-PF electrons and jets even though top projection is ON!" - print "********************* " - module = applyPostfix(process,"patElectrons",postfix) - module.useParticleFlow = False - print "Building particle-based isolation for GsfElectrons in PF2PAT(PFBRECO)" - print "********************* " - adaptPFIsoElectrons( process, module, postfix+"PFIso", dR ) - getattr(process,'patDefaultSequence'+postfix).replace( getattr(process,"patElectrons"+postfix), - setupPFElectronIso(process, 'gsfElectrons', "PFIso", postfix, runPF2PAT=True) + - getattr(process,"patElectrons"+postfix) ) - def adaptPFIsoElectrons(process,module, postfix = "PFIso", dR = "04"): #FIXME: adaptPFElectrons can use this function. module.isoDeposits = cms.PSet( @@ -68,19 +52,6 @@ def adaptPFIsoMuons(process,module, postfix = "PFIso", dR = "04"): pfPhotons = cms.InputTag("muPFIsoValueGamma" + dR + postfix) ) -def usePFIso(process, postfix = "PFIso"): - print "Building particle-based isolation " - print "***************** " - process.eleIsoSequence = setupPFElectronIso(process, 'gsfElectrons', postfix) - process.muIsoSequence = setupPFMuonIso(process, 'muons', postfix) - adaptPFIsoMuons( process, applyPostfix(process,"patMuons",""), postfix) - adaptPFIsoElectrons( process, applyPostfix(process,"patElectrons",""), postfix) - getattr(process,'patDefaultSequence').replace( getattr(process,"patCandidates"), - process.pfParticleSelectionSequence + - process.eleIsoSequence + - process.muIsoSequence + - getattr(process,"patCandidates") ) - def adaptPFMuons(process,module,postfix="" ): print "Adapting PF Muons " print "***************** " diff --git a/PhysicsTools/PatAlgos/test/patTuple_PF2PATGsfElectrons_cfg.py b/PhysicsTools/PatAlgos/test/patTuple_PF2PATGsfElectrons_cfg.py deleted file mode 100644 index 5c97a487be9b1..0000000000000 --- a/PhysicsTools/PatAlgos/test/patTuple_PF2PATGsfElectrons_cfg.py +++ /dev/null @@ -1,51 +0,0 @@ -## import skeleton process -from PhysicsTools.PatAlgos.patTemplate_cfg import * - -# load the PAT config -process.load("PhysicsTools.PatAlgos.patSequences_cff") - - -# Configure PAT to use PF2PAT instead of AOD sources -# this function will modify the PAT sequences. -from PhysicsTools.PatAlgos.tools.pfTools import * - -postfix = "PFlow" -jetAlgo="AK5" -usePF2PAT(process,runPF2PAT=True, jetAlgo=jetAlgo, runOnMC=True, postfix=postfix) - -# to use GsfElectrons instead of PF electrons -# this will destory the feature of top projection which solves the ambiguity between leptons and jets because -# there will be overlap between non-PF electrons and jets even though top projection is ON! -useGsfElectrons(process,postfix,"03") # to change isolation cone size to 0.3 as it is recommended by EGM POG, use "04" for cone size 0.4 - -# Let it run -process.p = cms.Path( -# process.patDefaultSequence + - getattr(process,"patPF2PATSequence"+postfix) -) - -# Add PF2PAT output to the created file -from PhysicsTools.PatAlgos.patEventContent_cff import patEventContentNoCleaning -#process.load("CommonTools.ParticleFlow.PF2PAT_EventContent_cff") -#process.out.outputCommands = cms.untracked.vstring('drop *') -process.out.outputCommands = cms.untracked.vstring('drop *', - 'keep recoPFCandidates_particleFlow_*_*', - *patEventContentNoCleaning ) - -## ------------------------------------------------------ -# In addition you usually want to change the following -# parameters: -## ------------------------------------------------------ -# -# process.GlobalTag.globaltag = ... ## (according to https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideFrontierConditions) -# ## -from PhysicsTools.PatAlgos.patInputFiles_cff import filesRelValProdTTbarAODSIM -process.source.fileNames = filesRelValProdTTbarAODSIM -# ## -process.maxEvents.input = 10 -# ## -# process.out.outputCommands = [ ... ] ## (e.g. taken from PhysicsTools/PatAlgos/python/patEventContent_cff.py) -# ## -process.out.fileName = 'patTuple_PF2PATGsfElectrons.root' -# ## -# process.options.wantSummary = False ## (to suppress the long output at the end of the job) diff --git a/PhysicsTools/PatAlgos/test/patTuple_pfIso_cfg.py b/PhysicsTools/PatAlgos/test/patTuple_pfIso_cfg.py deleted file mode 100644 index c0280c53b7b05..0000000000000 --- a/PhysicsTools/PatAlgos/test/patTuple_pfIso_cfg.py +++ /dev/null @@ -1,38 +0,0 @@ -## import skeleton process -from PhysicsTools.PatAlgos.patTemplate_cfg import * - -# load the PAT config -process.load("PhysicsTools.PatAlgos.patSequences_cff") - -from PhysicsTools.PatAlgos.tools.pfTools import * -usePFIso( process ) - -# process.patElectrons.pfElectronSource = 'particleFlow' - -## let it run -process.p = cms.Path( - process.patDefaultSequence - #process.pfParticleSelectionSequence + - #process.eleIsoSequence + - #process.makePatElectrons + - #process.selectedPatElectrons - ) - -## ------------------------------------------------------ -# In addition you usually want to change the following -# parameters: -## ------------------------------------------------------ -# -# process.GlobalTag.globaltag = ... ## (according to https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideFrontierConditions) -# ## -from PhysicsTools.PatAlgos.patInputFiles_cff import filesRelValProdTTbarAODSIM -process.source.fileNames = filesRelValProdTTbarAODSIM -# ## -process.maxEvents.input = 10 -# ## -# process.out.outputCommands = [ ... ] ## (e.g. taken from PhysicsTools/PatAlgos/python/patEventContent_cff.py) -# ## -process.out.fileName = 'patTuple_pfIso.root' -# ## -# process.options.wantSummary = False ## (to suppress the long output at the end of the job) - diff --git a/PhysicsTools/PatAlgos/test/runtests.sh b/PhysicsTools/PatAlgos/test/runtests.sh index 96baf4f3612a3..033636b2b02f6 100755 --- a/PhysicsTools/PatAlgos/test/runtests.sh +++ b/PhysicsTools/PatAlgos/test/runtests.sh @@ -11,10 +11,6 @@ cmsRun ${LOCAL_TEST_DIR}/patTuple_PF2PAT_cfg.py || die 'Failure using patTuple_P cmsRun ${LOCAL_TEST_DIR}/patTuple_PATandPF2PAT_cfg.py || die 'Failure using patTuple_PATandPF2PAT_cfg.py' $? -# cmsRun ${LOCAL_TEST_DIR}/patTuple_PF2PATGsfElectrons_cfg.py || die 'Failure using patTuple_PATandPF2PAT_cfg.py' $? - -# cmsRun ${LOCAL_TEST_DIR}/patTuple_pfIso_cfg.py || die 'Failure using patTuple_pfIso_cfg.py' $? - cmsRun ${LOCAL_TEST_DIR}/patTuple_addDecayInFlight_cfg.py || die 'Failure using patTuple_addDecayInFlight_cfg.py' $? cmsRun ${LOCAL_TEST_DIR}/patTuple_addBTagging_cfg.py || die 'Failure using patTuple_addBTagging_cfg.py' $?