Skip to content

Commit

Permalink
Merge pull request #28110 from hatakeyamak/Reconfigure_particleFlow_cfi
Browse files Browse the repository at this point in the history
Reconfigure particle flow config files
  • Loading branch information
cmsbuild committed Nov 4, 2019
2 parents ee77a3c + 6756673 commit 5762ef9
Show file tree
Hide file tree
Showing 16 changed files with 381 additions and 320 deletions.
75 changes: 75 additions & 0 deletions HLTrigger/Configuration/python/customizeHLTforCMSSW.py
Expand Up @@ -17,6 +17,79 @@
# pset.minGoodStripCharge = cms.PSet(refToPSet_ = cms.string('HLTSiStripClusterChargeCutNone'))
# return process

#
# PF config cleanup
def customiseFor28110(process):

for producer in producers_by_type(process, "PFProducer"):
#
# kill cleaned-up parameters
if hasattr(producer, "iCfgCandConnector"):
pset = getattr(producer, "iCfgCandConnector")
delattr(pset,'bCalibSecondary')
toDelete=['algoType',
'isolatedElectronID_mvaWeightFile',
'pf_electronID_mvaWeightFile',
'pf_electron_output_col',
'minTrackerHits',
'minPixelHits',
'dzPV']
#
# kill parameters that are moved to sub-psets
# PFEGammaFiltersParameters
toDelete.extend(['electron_iso_pt',
'electron_iso_mva_barrel',
'electron_iso_mva_endcap',
'electron_iso_combIso_barrel',
'electron_iso_combIso_endcap',
'electron_noniso_mvaCut',
'electron_missinghits',
'electron_ecalDrivenHademPreselCut',
'electron_maxElePtForOnlyMVAPresel',
'electron_protectionsForJetMET',
'electron_protectionsForBadHcal',
'photon_MinEt',
'photon_combIso',
'photon_HoE',
'photon_SigmaiEtaiEta_barrel',
'photon_SigmaiEtaiEta_endcap',
'photon_protectionsForJetMET',
'photon_protectionsForBadHcal'
])
# PFMuonAlgoParameters
toDelete.extend(['maxDPtOPt',
'trackQuality',
'ptErrorScale',
'eventFractionForCleaning',
'minPtForPostCleaning',
'eventFactorForCosmics',
'metSignificanceForCleaning',
'metSignificanceForRejection',
'metFactorForCleaning',
'eventFractionForRejection',
'metFactorForRejection',
'metFactorForHighEta',
'ptFactorForHighEta',
'metFactorForFakes',
'minMomentumForPunchThrough',
'minEnergyForPunchThrough',
'punchThroughFactor',
'punchThroughMETFactor',
'cosmicRejectionDistance'])
# Post HF cleaning
toDelete.extend(['minHFCleaningPt',
'maxSignificance',
'minSignificance',
'minSignificanceReduction',
'maxDeltaPhiPt',
'minDeltaMet'])
#
# Actually kill them
for att in toDelete:
if (hasattr(producer, att)): delattr(producer, att)
#
return process

def customiseFor2017DtUnpacking(process):
"""Adapt the HLT to run the legacy DT unpacking
for pre2018 data/MC workflows as the default"""
Expand Down Expand Up @@ -52,4 +125,6 @@ def customizeHLTforCMSSW(process, menuType="GRun"):
# add call to action function in proper order: newest last!
# process = customiseFor12718(process)

process = customiseFor28110(process)

return process
2 changes: 1 addition & 1 deletion RecoJets/JetProducers/python/hltParticleFlowForJets_cfi.py
Expand Up @@ -53,7 +53,7 @@
)


from RecoParticleFlow.PFProducer.particleFlow_cfi import particleFlowTmp
from RecoParticleFlow.PFProducer.particleFlow_cff import particleFlowTmp

hltParticleFlow = particleFlowTmp.clone(
GedPhotonValueMap = cms.InputTag(""),
Expand Down
8 changes: 1 addition & 7 deletions RecoParticleFlow/PFProducer/interface/PFAlgo.h
Expand Up @@ -84,13 +84,7 @@ class PFAlgo {
const edm::ValueMap<reco::GsfElectronRef>& valueMapGedElectrons,
const edm::ValueMap<reco::PhotonRef>& valueMapGedPhotons);

void setPostHFCleaningParameters(bool postHFCleaning,
double minHFCleaningPt,
double minSignificance,
double maxSignificance,
double minSignificanceReduction,
double maxDeltaPhiPt,
double minDeltaMet);
void setPostHFCleaningParameters(bool postHFCleaning, const edm::ParameterSet& pfHFCleaningParams);

void setDisplacedVerticesParameters(bool rejectTracks_Bad,
bool rejectTracks_Step45,
Expand Down
7 changes: 4 additions & 3 deletions RecoParticleFlow/PFProducer/interface/PFCandConnector.h
Expand Up @@ -2,12 +2,11 @@
#define PFProducer_PFCandConnector_H_

#include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h"

#include "DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h"

#include "FWCore/MessageLogger/interface/MessageLogger.h"

#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h"

// \author : M. Gouzevitch
// \date : May 2010

Expand Down Expand Up @@ -79,6 +78,8 @@ class PFCandConnector {
double ptErrorSecondary,
const std::vector<double>& nuclCalibFactors);

static void fillPSetDescription(edm::ParameterSetDescription& iDesc);

reco::PFCandidateCollection connect(reco::PFCandidateCollection& pfCand) const;

private:
Expand Down
3 changes: 3 additions & 0 deletions RecoParticleFlow/PFProducer/interface/PFEGammaFilters.h
Expand Up @@ -10,6 +10,7 @@
#include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h"
#include "DataFormats/ParticleFlowCandidate/interface/PFCandidateEGammaExtra.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h"

#include <iostream>

Expand All @@ -28,6 +29,8 @@ class PFEGammaFilters {

bool isPhotonSafeForJetMET(const reco::Photon &, const reco::PFCandidate &) const;

static void fillPSetDescription(edm::ParameterSetDescription &iDesc);

private:
bool passGsfElePreSelWithOnlyConeHadem(const reco::GsfElectron &) const;

Expand Down
13 changes: 8 additions & 5 deletions RecoParticleFlow/PFProducer/interface/PFMuonAlgo.h
Expand Up @@ -5,6 +5,7 @@
#include "DataFormats/VertexReco/interface/Vertex.h"
#include "DataFormats/VertexReco/interface/VertexFwd.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
#include "DataFormats/Common/interface/Handle.h"
#include "DataFormats/MuonReco/interface/Muon.h"
#include "DataFormats/MuonReco/interface/MuonFwd.h"
Expand All @@ -15,7 +16,9 @@ class PFMuonAlgo {

public:
/// constructor
PFMuonAlgo(edm::ParameterSet const&);
PFMuonAlgo(edm::ParameterSet const&, bool postMuonCleaning);

static void fillPSetDescription(edm::ParameterSetDescription& iDesc);

////STATIC MUON ID METHODS
static bool isMuon(const reco::PFBlockElement& elt);
Expand Down Expand Up @@ -118,14 +121,14 @@ class PFMuonAlgo {
const reco::VertexCollection* vertices_;

//Configurables
// for PFMuonAlgo::goodMuonTracks/muonTracks
const double maxDPtOPt_;
const int minTrackerHits_;
const int minPixelHits_;
// for PFMuonAlgo::reconstructMuon
const reco::TrackBase::TrackQuality trackQuality_;
const double errorCompScale_;
const double eventFractionCleaning_;
const double dzPV_;
// for postCleaning (postClean/addMissingMuons)
const bool postCleaning_;
const double eventFractionCleaning_;
const double minPostCleaningPt_;
const double eventFactorCosmics_;
const double metSigForCleaning_;
Expand Down
2 changes: 0 additions & 2 deletions RecoParticleFlow/PFProducer/plugins/PFEGammaProducer.cc
Expand Up @@ -184,8 +184,6 @@ void PFEGammaProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup
std::list<reco::PFBlockRef> otherBlockRefs;

for (unsigned i = 0; i < blocks->size(); ++i) {
// reco::PFBlockRef blockref( blockh,i );
//reco::PFBlockRef blockref = createBlockRef( *blocks, i);
reco::PFBlockRef blockref(blocks, i);

const edm::OwnVector<reco::PFBlockElement>& elements = blockref->elements();
Expand Down

0 comments on commit 5762ef9

Please sign in to comment.