diff --git a/FastSimulation/ParticleFlow/plugins/BuildFile.xml b/FastSimulation/ParticleFlow/plugins/BuildFile.xml deleted file mode 100644 index a4927bdb703df..0000000000000 --- a/FastSimulation/ParticleFlow/plugins/BuildFile.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/FastSimulation/ParticleFlow/plugins/FSPFProducer.cc b/FastSimulation/ParticleFlow/plugins/FSPFProducer.cc deleted file mode 100644 index 60ad98e262bb0..0000000000000 --- a/FastSimulation/ParticleFlow/plugins/FSPFProducer.cc +++ /dev/null @@ -1,118 +0,0 @@ -#include "FastSimulation/ParticleFlow/plugins/FSPFProducer.h" -#include "FWCore/MessageLogger/interface/MessageLogger.h" -#include "FWCore/Utilities/interface/Exception.h" - -#include "DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h" -#include "DataFormats/Math/interface/LorentzVector.h" - -using namespace std; -using namespace edm; -using namespace reco; - - -FSPFProducer::FSPFProducer(const edm::ParameterSet& iConfig) { - - labelPFCandidateCollection_ = iConfig.getParameter < edm::InputTag > ("pfCandidates"); - - pfPatchInHF = iConfig.getParameter("pfPatchInHF"); - EM_HF_ScaleFactor = iConfig.getParameter< std::vector >("EM_HF_ScaleFactor"); - HF_Ratio = iConfig.getParameter("HF_Ratio"); - par1 = iConfig.getParameter("par1"); - par2 = iConfig.getParameter("par2"); - barrel_th = iConfig.getParameter("barrel_th"); - endcap_th = iConfig.getParameter("endcap_th"); - middle_th = iConfig.getParameter("middle_th"); - // register products - produces(); - - // consumes - pfCandidateToken = consumes(labelPFCandidateCollection_); -} - -FSPFProducer::~FSPFProducer() {} - -void -FSPFProducer::produce(Event& iEvent, - const EventSetup& iSetup) { - - Handle < reco::PFCandidateCollection > pfCandidates; - iEvent.getByToken (pfCandidateToken, pfCandidates); - - auto_ptr< reco::PFCandidateCollection > pOutputCandidateCollection(new PFCandidateCollection); - - /* - LogDebug("FSPFProducer")<<"START event: " - <begin(); - reco::PFCandidateCollection::const_iterator itCandEnd = pfCandidates->end(); - for( ; itCand != itCandEnd; itCand++) { - - // First part: create fake neutral hadrons as a function of charged hadrons and add them to the new collection - if(itCand->particleId() == reco::PFCandidate::h){ - theNeutralFraction = par1 - par2*itCand->energy(); - if(theNeutralFraction > 0.){ - px = theNeutralFraction*itCand->px(); - py = theNeutralFraction*itCand->py(); - pz = theNeutralFraction*itCand->pz(); - en = sqrt(px*px + py*py + pz*pz); - if (en > energy_threshold(itCand->eta())) { - // create a PFCandidate and add it to the particles Collection - math::XYZTLorentzVector momentum(px,py,pz,en); - reco::PFCandidate FakeNeutralHadron(0, momentum, reco::PFCandidate::h0); - pOutputCandidateCollection->push_back(FakeNeutralHadron); - } - } - } - - // Second part: deal with HF, and put every candidate of the old collection in the new collection - if(itCand->particleId() == reco::PFCandidate::egamma_HF){ - if (pfPatchInHF) { - n_em_HF++; - - if(fabs(itCand->eta())< 4.) vEta = 0; - else if(fabs(itCand->eta())<= 5.) vEta = 1; - - if (vEta==0 || vEta==1) { - // copy these PFCandidates after the momentum rescaling - px = EM_HF_ScaleFactor[vEta]*itCand->px(); - py = EM_HF_ScaleFactor[vEta]*itCand->py(); - pz = EM_HF_ScaleFactor[vEta]*itCand->pz(); - en = sqrt(px*px + py*py + pz*pz); - math::XYZTLorentzVector momentum(px,py,pz,en); - reco::PFCandidate EMHF(itCand->charge(), momentum, reco::PFCandidate::egamma_HF); - if(en>0.) pOutputCandidateCollection->push_back(EMHF); - } - } else pOutputCandidateCollection->push_back(*itCand); - } - - else if(itCand->particleId() == reco::PFCandidate::h_HF){ - if (pfPatchInHF) { - // copy these PFCandidates to the new particles Collection only if hadron candidates are currently more than EM candidates - n_hadron_HF++; - if(n_em_HF < (n_hadron_HF*HF_Ratio)) pOutputCandidateCollection->push_back(*itCand); - } else pOutputCandidateCollection->push_back(*itCand); - } - - else pOutputCandidateCollection->push_back(*itCand); - - } - iEvent.put(pOutputCandidateCollection); -} - -double FSPFProducer::energy_threshold(double eta) { - if (eta<0) eta = -eta; - if (eta < 1.6) return barrel_th; - else if (eta < 1.8) return middle_th; - else return endcap_th; -} - - - -DEFINE_FWK_MODULE (FSPFProducer); diff --git a/FastSimulation/ParticleFlow/plugins/FSPFProducer.h b/FastSimulation/ParticleFlow/plugins/FSPFProducer.h deleted file mode 100644 index 970aec3d4ecab..0000000000000 --- a/FastSimulation/ParticleFlow/plugins/FSPFProducer.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef FastSimulation_ParticleFlow_FSPFProducer_h_ -#define FastSimulation_ParticleFlow_FSPFProducer_h_ - -// system include files -#include - -// framework include files -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/Framework/interface/stream/EDProducer.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/MakerMacros.h" -#include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -#include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h" - -class PFCandidate; - -class FSPFProducer : public edm::stream::EDProducer <> { - public: - explicit FSPFProducer(const edm::ParameterSet&); - ~FSPFProducer(); - - virtual void produce(edm::Event&, const edm::EventSetup&) override; - - private: - - edm::InputTag labelPFCandidateCollection_; - - double par1, par2; - double barrel_th, endcap_th, middle_th; - - bool pfPatchInHF; - double HF_Ratio; - std::vector EM_HF_ScaleFactor; - - double energy_threshold(double eta); - - edm::EDGetTokenT pfCandidateToken; -}; - -#endif diff --git a/FastSimulation/ParticleFlow/plugins/SealModules.cc b/FastSimulation/ParticleFlow/plugins/SealModules.cc deleted file mode 100644 index 0d31ba670dfa2..0000000000000 --- a/FastSimulation/ParticleFlow/plugins/SealModules.cc +++ /dev/null @@ -1,7 +0,0 @@ -#include "FWCore/Framework/interface/MakerMacros.h" -#include "FWCore/Framework/interface/ESProducer.h" -#include "FWCore/Framework/interface/ModuleFactory.h" - -#include "FastSimulation/ParicleFlow/plugins/FSPFProducer.h" - -DEFINE_FWK_MODULE(FSPFProducer); diff --git a/FastSimulation/ParticleFlow/python/FSparticleFlow_cfi.py b/FastSimulation/ParticleFlow/python/FSparticleFlow_cfi.py deleted file mode 100644 index bf4b27db5a891..0000000000000 --- a/FastSimulation/ParticleFlow/python/FSparticleFlow_cfi.py +++ /dev/null @@ -1,20 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -FSparticleFlow = cms.EDProducer("FSPFProducer", - # PFCandidate label - pfCandidates = cms.InputTag("particleFlowTmp"), - # parameters of the linear dependence between neutral and charged hadrons in PF: - par1 = cms.double(0.145), - par2 = cms.double(0.0031), - # eta-dependent thresholds: - barrel_th = cms.double(0.8), - middle_th = cms.double(1.1), - endcap_th = cms.double(2.4), - # specific for HF candidates: - pfPatchInHF = cms.bool(False), - EM_HF_ScaleFactor = cms.vdouble(0.675, 0.55), # eta-dependent scale factor for EM tower energy - HF_Ratio = cms.double(1.7) # ratio of the number of EM/had towers in FullSim - ) - - - diff --git a/FastSimulation/ParticleFlow/python/ParticleFlowFastSimNeutralHadron_cff.py b/FastSimulation/ParticleFlow/python/ParticleFlowFastSimNeutralHadron_cff.py deleted file mode 100644 index d6cb445d42c54..0000000000000 --- a/FastSimulation/ParticleFlow/python/ParticleFlowFastSimNeutralHadron_cff.py +++ /dev/null @@ -1,91 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -# Particle Flow -from RecoParticleFlow.PFClusterProducer.particleFlowCluster_cff import * -#from RecoParticleFlow.PFTracking.particleFlowTrack_cff import * -from RecoParticleFlow.PFTracking.particleFlowTrackWithDisplacedVertex_cff import * -from RecoParticleFlow.PFProducer.particleFlowSimParticle_cff import * -from RecoParticleFlow.PFProducer.particleFlowBlock_cff import * -from RecoParticleFlow.PFProducer.particleFlow_cff import * -from RecoParticleFlow.PFProducer.pfElectronTranslator_cff import * -from RecoParticleFlow.PFProducer.pfPhotonTranslator_cff import * -from FastSimulation.ParticleFlow.FSparticleFlow_cfi import * -from RecoParticleFlow.PFClusterProducer.towerMakerPF_cfi import * -# The following is replaced by the MVA-based -#from RecoParticleFlow.PFProducer.pfGsfElectronCiCSelector_cff import * -from RecoEgamma.EgammaIsolationAlgos.particleBasedIsoProducer_cff import * -from RecoParticleFlow.PFProducer.pfGsfElectronMVASelector_cff import * -from RecoParticleFlow.PFProducer.pfLinker_cff import * -from RecoParticleFlow.PFProducer.particleFlowEGamma_cff import * -particleFlow.PFCandidate = [cms.InputTag("FSparticleFlow")] - -particleFlowSimParticle.sim = 'famosSimHits' - -#Deactivate the recovery of dead towers since dead towers are not simulated - -#Similarly, deactivate HF cleaning for spikes -particleFlowClusterHF.recHitCleaners = cms.VPSet() -particleFlowRecHitHF.producers[0].qualityTests =cms.VPSet( - cms.PSet( - name = cms.string("PFRecHitQTestHCALThresholdVsDepth"), - cuts = cms.VPSet( - cms.PSet( - depth = cms.int32(1), - threshold = cms.double(1.2)), - cms.PSet( - depth = cms.int32(2), - threshold = cms.double(1.8)) - ) - ) - -) - -#particleFlowBlock.useNuclear = cms.bool(True) -#particleFlowBlock.useConversions = cms.bool(True) -#particleFlowBlock.useV0 = cms.bool(True) - -#particleFlow.rejectTracks_Bad = cms.bool(False) -#particleFlow.rejectTracks_Step45 = cms.bool(False) - -#particleFlow.usePFNuclearInteractions = cms.bool(True) -#particleFlow.usePFConversions = cms.bool(True) -#particleFlow.usePFDecays = cms.bool(True) - -famosParticleFlowSequence = cms.Sequence( - caloTowersRec+ -# pfTrackElec+ - particleFlowTrackWithDisplacedVertex+ -# pfGsfElectronCiCSelectionSequence+ - pfGsfElectronMVASelectionSequence+ - particleFlowBlock+ - particleFlowEGammaFull+ - particleFlowTmp+ - particleFlowTmpPtrs+ - particleFlowEGammaFinal+ - FSparticleFlow -) - -particleFlowLinks = cms.Sequence(particleFlow+particleFlowPtrs + particleBasedIsolationSequence) - -# PF Reco Jets and MET - -from RecoJets.JetProducers.PFJetParameters_cfi import PFJetParameters -#PFJetParameters.src = cms.InputTag("FSparticleFlow") #AG -from RecoJets.Configuration.RecoPFJets_cff import * -from RecoMET.METProducers.PFMET_cfi import * -#pfMet.src = cms.InputTag("FSparticleFlow") #AG -from RecoMET.Configuration.RecoPFMET_cff import * - -PFJetMet = cms.Sequence( - recoPFJets+ - recoPFMET -) - - - - - - - - - diff --git a/FastSimulation/ParticleFlow/python/ParticleFlowFastSim_cff.py b/FastSimulation/ParticleFlow/python/ParticleFlowFastSim_cff.py deleted file mode 100644 index 6a8e1d563ed96..0000000000000 --- a/FastSimulation/ParticleFlow/python/ParticleFlowFastSim_cff.py +++ /dev/null @@ -1,93 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -# Particle Flow -from RecoParticleFlow.PFClusterProducer.particleFlowCluster_cff import * -#from RecoParticleFlow.PFTracking.particleFlowTrack_cff import * -from RecoParticleFlow.PFTracking.particleFlowTrackWithDisplacedVertex_cff import * -from RecoParticleFlow.PFProducer.particleFlowSimParticle_cff import * -from RecoParticleFlow.PFProducer.particleFlowBlock_cff import * -from RecoParticleFlow.PFProducer.particleFlow_cff import * -from RecoParticleFlow.PFProducer.pfElectronTranslator_cff import * -from RecoParticleFlow.PFProducer.pfPhotonTranslator_cff import * -#from FastSimulation.ParticleFlow.FSparticleFlow_cfi import * -from RecoParticleFlow.PFClusterProducer.towerMakerPF_cfi import * -# The following is replaced by the MVA-based -#from RecoParticleFlow.PFProducer.pfGsfElectronCiCSelector_cff import * -from RecoEgamma.EgammaIsolationAlgos.particleBasedIsoProducer_cff import * -from RecoParticleFlow.PFProducer.pfGsfElectronMVASelector_cff import * -from RecoParticleFlow.PFProducer.pfLinker_cff import * -from RecoParticleFlow.PFProducer.particleFlowEGamma_cff import * -#particleFlow.PFCandidate = [cms.InputTag("FSparticleFlow")] - -particleFlowSimParticle.sim = 'famosSimHits' - -#Deactivate the recovery of dead towers since dead towers are not simulated - -#Similarly, deactivate HF cleaning for spikes -particleFlowClusterHF.recHitCleaners = cms.VPSet() -particleFlowRecHitHF.producers[0].qualityTests =cms.VPSet( - cms.PSet( - name = cms.string("PFRecHitQTestHCALThresholdVsDepth"), - cuts = cms.VPSet( - cms.PSet( - depth = cms.int32(1), - threshold = cms.double(1.2)), - cms.PSet( - depth = cms.int32(2), - threshold = cms.double(1.8)) - ) - ) - -) - -#particleFlowBlock.useNuclear = cms.bool(True) -#particleFlowBlock.useConversions = cms.bool(True) -#particleFlowBlock.useV0 = cms.bool(True) - -#particleFlow.rejectTracks_Bad = cms.bool(False) -#particleFlow.rejectTracks_Step45 = cms.bool(False) - -#particleFlow.usePFNuclearInteractions = cms.bool(True) -#particleFlow.usePFConversions = cms.bool(True) -#particleFlow.usePFDecays = cms.bool(True) - -### With the new mixing scheme, the label of the Trajectory collection for the primary event is different: - -famosParticleFlowSequence = cms.Sequence( - caloTowersRec+ -# pfTrackElec+ - particleFlowTrackWithDisplacedVertex+ -# pfGsfElectronCiCSelectionSequence+ - pfGsfElectronMVASelectionSequence+ - particleFlowBlock+ - particleFlowEGammaFull+ - particleFlowTmp+ - particleFlowTmpPtrs+ - particleFlowEGammaFinal - #FSparticleFlow -) - -particleFlowLinks = cms.Sequence(particleFlow+particleFlowPtrs + particleBasedIsolationSequence) - -# PF Reco Jets and MET - -from RecoJets.JetProducers.PFJetParameters_cfi import PFJetParameters -#PFJetParameters.src = cms.InputTag("FSparticleFlow") #AG -from RecoJets.Configuration.RecoPFJets_cff import * -from RecoMET.METProducers.PFMET_cfi import * -#pfMet.src = cms.InputTag("FSparticleFlow") #AG -from RecoMET.Configuration.RecoPFMET_cff import * - -PFJetMet = cms.Sequence( - recoPFJets+ - recoPFMET -) - - - - - - - - -