CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
PFProducer Class Reference

Producer for particle flow reconstructed particles (PFCandidates) More...

Inheritance diagram for PFProducer:
edm::stream::EDProducer<>

Public Member Functions

void beginRun (const edm::Run &, const edm::EventSetup &) override
 
 PFProducer (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

std::string calibrationsLabel_
 
std::string electronExtraOutputCol_
 
const edm::EDGetTokenT< reco::PFBlockCollectioninputTagBlocks_
 
std::vector< edm::EDGetTokenT< reco::PFRecHitCollection > > inputTagCleanedHF_
 
edm::EDGetTokenT< reco::GsfElectronCollectioninputTagEgammaElectrons_
 
edm::EDGetTokenT< reco::MuonCollectioninputTagMuons_
 
edm::EDGetTokenT< edm::View< reco::PFCandidate > > inputTagPFEGammaCandidates_
 
edm::EDGetTokenT< edm::ValueMap< reco::GsfElectronRef > > inputTagValueMapGedElectrons_
 
edm::EDGetTokenT< edm::ValueMap< reco::PhotonRef > > inputTagValueMapGedPhotons_
 
edm::EDGetTokenT< reco::PFCandidateCollectioninputTagVetoes_
 
edm::ESGetToken< PerformancePayload, PFCalibrationRcdperfToken_
 
PFAlgo pfAlgo_
 particle flow algorithm More...
 
const edm::EDPutTokenT< reco::PFCandidateCollectionpfCandidatesToken_
 
const edm::EDPutTokenT< reco::PFCandidateCollectionpfCleanedCandidatesToken_
 
std::unique_ptr< PFEGammaFilterspfegamma_ = nullptr
 
PFEnergyCalibration pfEnergyCalibration_
 
PFEnergyCalibrationHF pfEnergyCalibrationHF_
 
std::string photonExtraOutputCol_
 
bool postHFCleaning_
 
bool postMuonCleaning_
 
bool use_EGammaFilters_
 
bool useCalibrationsFromDB_
 
bool useEGammaElectrons_
 
bool useHO_
 
bool useVerticesForNeutral_
 
bool verbose_
 verbose ? More...
 
edm::EDGetTokenT< reco::VertexCollectionvertices_
 
bool vetoEndcap_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Producer for particle flow reconstructed particles (PFCandidates)

This producer makes use of PFAlgo, the particle flow algorithm.

Author
Colin Bernet
Date
July 2006

Definition at line 37 of file PFProducer.cc.

Constructor & Destructor Documentation

◆ PFProducer()

PFProducer::PFProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 107 of file PFProducer.cc.

108  : pfCandidatesToken_{produces<reco::PFCandidateCollection>()},
109  pfCleanedCandidatesToken_{produces<reco::PFCandidateCollection>("CleanedHF")},
110  inputTagBlocks_(consumes<reco::PFBlockCollection>(iConfig.getParameter<InputTag>("blocks"))),
111  pfEnergyCalibrationHF_(iConfig.getParameter<bool>("calibHF_use"),
112  iConfig.getParameter<std::vector<double>>("calibHF_eta_step"),
113  iConfig.getParameter<std::vector<double>>("calibHF_a_EMonly"),
114  iConfig.getParameter<std::vector<double>>("calibHF_b_HADonly"),
115  iConfig.getParameter<std::vector<double>>("calibHF_a_EMHAD"),
116  iConfig.getParameter<std::vector<double>>("calibHF_b_EMHAD")),
117  pfAlgo_(iConfig.getParameter<double>("pf_nsigma_ECAL"),
118  iConfig.getParameter<double>("pf_nsigma_HCAL"),
119  iConfig.getParameter<double>("pf_nsigma_HFEM"),
120  iConfig.getParameter<double>("pf_nsigma_HFHAD"),
121  iConfig.getParameter<std::vector<double>>("resolHF_square"),
124  iConfig) {
125  //Post cleaning of the muons
126  inputTagMuons_ = consumes<reco::MuonCollection>(iConfig.getParameter<InputTag>("muons"));
127  postMuonCleaning_ = iConfig.getParameter<bool>("postMuonCleaning");
128  vetoEndcap_ = iConfig.getParameter<bool>("vetoEndcap");
129  if (vetoEndcap_)
130  inputTagVetoes_ = consumes<reco::PFCandidateCollection>(iConfig.getParameter<edm::InputTag>("vetoes"));
131 
132  use_EGammaFilters_ = iConfig.getParameter<bool>("useEGammaFilters");
133  useEGammaElectrons_ = iConfig.getParameter<bool>("useEGammaElectrons");
134 
135  if (useEGammaElectrons_) {
137  consumes<reco::GsfElectronCollection>(iConfig.getParameter<edm::InputTag>("egammaElectrons"));
138  }
139 
140  // register products
141  produces<reco::PFCandidateCollection>("CleanedCosmicsMuons");
142  produces<reco::PFCandidateCollection>("CleanedTrackerAndGlobalMuons");
143  produces<reco::PFCandidateCollection>("CleanedFakeMuons");
144  produces<reco::PFCandidateCollection>("CleanedPunchThroughMuons");
145  produces<reco::PFCandidateCollection>("CleanedPunchThroughNeutralHadrons");
146  produces<reco::PFCandidateCollection>("AddedMuonsAndHadrons");
147 
148  // Reading new EGamma selection cuts
149  bool useProtectionsForJetMET(false);
150 
151  // Reading new EGamma ubiased collections and value maps
152  if (use_EGammaFilters_) {
154  consumes<edm::View<reco::PFCandidate>>((iConfig.getParameter<edm::InputTag>("PFEGammaCandidates")));
156  consumes<edm::ValueMap<reco::GsfElectronRef>>(iConfig.getParameter<edm::InputTag>("GedElectronValueMap"));
158  consumes<edm::ValueMap<reco::PhotonRef>>(iConfig.getParameter<edm::InputTag>("GedPhotonValueMap"));
159  useProtectionsForJetMET = iConfig.getParameter<bool>("useProtectionsForJetMET");
160 
161  const edm::ParameterSet pfEGammaFiltersParams =
162  iConfig.getParameter<edm::ParameterSet>("PFEGammaFiltersParameters");
163  pfegamma_ = std::make_unique<PFEGammaFilters>(pfEGammaFiltersParams);
164  }
165 
166  // EGamma filters
168 
169  //Secondary tracks and displaced vertices parameters
170 
171  bool rejectTracks_Bad = iConfig.getParameter<bool>("rejectTracks_Bad");
172 
173  bool rejectTracks_Step45 = iConfig.getParameter<bool>("rejectTracks_Step45");
174 
175  bool usePFNuclearInteractions = iConfig.getParameter<bool>("usePFNuclearInteractions");
176 
177  bool usePFConversions = iConfig.getParameter<bool>("usePFConversions");
178 
179  bool usePFDecays = iConfig.getParameter<bool>("usePFDecays");
180 
181  double dptRel_DispVtx = iConfig.getParameter<double>("dptRel_DispVtx");
182 
183  useCalibrationsFromDB_ = iConfig.getParameter<bool>("useCalibrationsFromDB");
184 
186  calibrationsLabel_ = iConfig.getParameter<std::string>("calibrationsLabel");
187  perfToken_ = esConsumes<edm::Transition::BeginRun>(edm::ESInputTag("", calibrationsLabel_));
188  }
189  // Secondary tracks and displaced vertices parameters
192 
194  pfAlgo_.setCandConnectorParameters(iConfig.getParameter<edm::ParameterSet>("iCfgCandConnector"));
195 
196  // Post cleaning of the HF
197  postHFCleaning_ = iConfig.getParameter<bool>("postHFCleaning");
198  const edm::ParameterSet pfHFCleaningParams = iConfig.getParameter<edm::ParameterSet>("PFHFCleaningParameters");
199 
200  // Set post HF cleaning muon parameters
202 
203  // Input tags for HF cleaned rechits
204  std::vector<edm::InputTag> tags = iConfig.getParameter<std::vector<edm::InputTag>>("cleanedHF");
205  for (unsigned int i = 0; i < tags.size(); ++i)
206  inputTagCleanedHF_.push_back(consumes<reco::PFRecHitCollection>(tags[i]));
207  //MIKE: Vertex Parameters
208  vertices_ = consumes<reco::VertexCollection>(iConfig.getParameter<edm::InputTag>("vertexCollection"));
209  useVerticesForNeutral_ = iConfig.getParameter<bool>("useVerticesForNeutral");
210 
211  // Use HO clusters and links in the PF reconstruction
212  useHO_ = iConfig.getParameter<bool>("useHO");
214 
215  verbose_ = iConfig.getUntrackedParameter<bool>("verbose", false);
216 }
std::vector< edm::EDGetTokenT< reco::PFRecHitCollection > > inputTagCleanedHF_
Definition: PFProducer.cc:56
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::EDGetTokenT< reco::MuonCollection > inputTagMuons_
Definition: PFProducer.cc:52
PFEnergyCalibrationHF pfEnergyCalibrationHF_
Definition: PFProducer.cc:96
void setCandConnectorParameters(const edm::ParameterSet &iCfgCandConnector)
Definition: PFAlgo.h:68
edm::EDGetTokenT< reco::PFCandidateCollection > inputTagVetoes_
Definition: PFProducer.cc:61
std::string calibrationsLabel_
Definition: PFProducer.cc:88
void setDisplacedVerticesParameters(bool rejectTracks_Bad, bool rejectTracks_Step45, bool usePFNuclearInteractions, bool usePFConversions, bool usePFDecays, double dptRel_DispVtx)
Definition: PFAlgo.cc:96
bool useCalibrationsFromDB_
Definition: PFProducer.cc:87
bool use_EGammaFilters_
Definition: PFProducer.cc:68
edm::EDGetTokenT< reco::VertexCollection > vertices_
Definition: PFProducer.cc:53
std::unique_ptr< PFEGammaFilters > pfegamma_
Definition: PFProducer.cc:69
edm::ESGetToken< PerformancePayload, PFCalibrationRcd > perfToken_
Definition: PFProducer.cc:49
T getUntrackedParameter(std::string const &, T const &) const
void setPostHFCleaningParameters(bool postHFCleaning, const edm::ParameterSet &pfHFCleaningParams)
Definition: PFAlgo.cc:86
bool useVerticesForNeutral_
Definition: PFProducer.cc:84
const edm::EDGetTokenT< reco::PFBlockCollection > inputTagBlocks_
Definition: PFProducer.cc:51
bool postHFCleaning_
Definition: PFProducer.cc:90
bool vetoEndcap_
Definition: PFProducer.cc:60
bool postMuonCleaning_
Definition: PFProducer.cc:78
const edm::EDPutTokenT< reco::PFCandidateCollection > pfCandidatesToken_
Definition: PFProducer.cc:47
edm::EDGetTokenT< edm::View< reco::PFCandidate > > inputTagPFEGammaCandidates_
Definition: PFProducer.cc:66
void setHOTag(bool ho)
Definition: PFAlgo.h:65
bool useHO_
Definition: PFProducer.cc:72
PFAlgo pfAlgo_
particle flow algorithm
Definition: PFProducer.cc:99
bool verbose_
verbose ?
Definition: PFProducer.cc:75
bool useEGammaElectrons_
Definition: PFProducer.cc:81
edm::EDGetTokenT< edm::ValueMap< reco::PhotonRef > > inputTagValueMapGedPhotons_
Definition: PFProducer.cc:65
const edm::EDPutTokenT< reco::PFCandidateCollection > pfCleanedCandidatesToken_
Definition: PFProducer.cc:48
edm::EDGetTokenT< reco::GsfElectronCollection > inputTagEgammaElectrons_
Definition: PFProducer.cc:54
PFEnergyCalibration pfEnergyCalibration_
Definition: PFProducer.cc:95
void setEGammaParameters(bool use_EGammaFilters, bool useProtectionsForJetMET)
Definition: PFAlgo.cc:68
edm::EDGetTokenT< edm::ValueMap< reco::GsfElectronRef > > inputTagValueMapGedElectrons_
Definition: PFProducer.cc:64

Member Function Documentation

◆ beginRun()

void PFProducer::beginRun ( const edm::Run run,
const edm::EventSetup es 
)
override

Definition at line 218 of file PFProducer.cc.

References edm::EventSetup::getHandle(), perfToken_, pfEnergyCalibration_, PFEnergyCalibration::setCalibrationFunctions(), and useCalibrationsFromDB_.

218  {
220  // read the PFCalibration functions from the global tags
221  auto perfH = es.getHandle(perfToken_);
222 
223  PerformancePayloadFromTFormula const* pfCalibrations =
224  static_cast<const PerformancePayloadFromTFormula*>(perfH.product());
225 
227  }
228 }
bool useCalibrationsFromDB_
Definition: PFProducer.cc:87
edm::ESGetToken< PerformancePayload, PFCalibrationRcd > perfToken_
Definition: PFProducer.cc:49
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:130
void setCalibrationFunctions(const PerformancePayloadFromTFormula *thePFCal)
PFEnergyCalibration pfEnergyCalibration_
Definition: PFProducer.cc:95

◆ fillDescriptions()

void PFProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 314 of file PFProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), submitPVResolutionJobs::desc, PFMuonAlgo::fillPSetDescription(), PFEGammaFilters::fillPSetDescription(), PFCandConnector::fillPSetDescription(), ProducerED_cfi::InputTag, or, edm::ParameterDescriptionNode::setComment(), and AlCaHLTBitMon_QueryRunRegistry::string.

314  {
316 
317  // Verbosity and debug flags
318  desc.addUntracked<bool>("verbose", false);
319  desc.addUntracked<bool>("debug", false);
320 
321  // PF Blocks label
322  desc.add<edm::InputTag>("blocks", edm::InputTag("particleFlowBlock"));
323 
324  // reco::muons label and Post Muon cleaning
325  desc.add<edm::InputTag>("muons", edm::InputTag("muons1stStep"));
326  desc.add<bool>("postMuonCleaning", true);
327 
328  // vetoEndcap flag and pf candidates for vetoes
329  edm::ParameterSetDescription emptyDescription;
330  desc.ifValue(edm::ParameterDescription<bool>("vetoEndcap", false, true),
331  true >> edm::ParameterDescription<edm::InputTag>("vetoes", {"pfTICL"}, true) or
332  false >> edm::EmptyGroupDescription());
333 
334  // Vertices label
335  desc.add<edm::InputTag>("vertexCollection", edm::InputTag("offlinePrimaryVertices"));
336  desc.add<bool>("useVerticesForNeutral", true);
337 
338  // Use HO clusters in PF hadron reconstruction
339  desc.add<bool>("useHO", true);
340 
341  // EGamma-related
342  desc.add<edm::InputTag>("PFEGammaCandidates", edm::InputTag("particleFlowEGamma"));
343  desc.add<edm::InputTag>("GedElectronValueMap", {"gedGsfElectronValueMapsTmp"});
344  desc.add<edm::InputTag>("GedPhotonValueMap", edm::InputTag("gedPhotonsTmp", "valMapPFEgammaCandToPhoton"));
345 
346  desc.add<bool>("useEGammaElectrons", true);
347  desc.add<edm::InputTag>("egammaElectrons", edm::InputTag("mvaElectrons"));
348 
349  desc.add<bool>("useEGammaFilters", true);
350  desc.add<bool>("useProtectionsForJetMET", true); // Propagated to PFEGammaFilters
351 
352  // For PFEGammaFilters
353  edm::ParameterSetDescription psd_PFEGammaFilters;
354  PFEGammaFilters::fillPSetDescription(psd_PFEGammaFilters);
355  desc.add<edm::ParameterSetDescription>("PFEGammaFiltersParameters", psd_PFEGammaFilters);
356 
357  // Treatment of muons :
358  // Expected energy in ECAL and HCAL, and RMS
359  desc.add<std::vector<double>>("muon_HCAL", {3.0, 3.0});
360  desc.add<std::vector<double>>("muon_ECAL", {0.5, 0.5});
361  desc.add<std::vector<double>>("muon_HO", {0.9, 0.9});
362 
363  // For PFMuonAlgo
364  edm::ParameterSetDescription psd_PFMuonAlgo;
365  PFMuonAlgo::fillPSetDescription(psd_PFMuonAlgo);
366  desc.add<edm::ParameterSetDescription>("PFMuonAlgoParameters", psd_PFMuonAlgo);
367 
368  // Input displaced vertices
369  // It is strongly adviced to keep usePFNuclearInteractions = bCorrect
370  desc.add<bool>("rejectTracks_Bad", true);
371  desc.add<bool>("rejectTracks_Step45", true);
372 
373  desc.add<bool>("usePFNuclearInteractions", true);
374  desc.add<bool>("usePFConversions", true);
375  desc.add<bool>("usePFDecays", false);
376 
377  desc.add<double>("dptRel_DispVtx", 10.0);
378 
379  // PFCandConnector
380  edm::ParameterSetDescription psd_CandConnector;
381  PFCandConnector::fillPSetDescription(psd_CandConnector);
382  desc.add<edm::ParameterSetDescription>("iCfgCandConnector", psd_CandConnector);
383 
384  // Treatment of potential fake tracks
385  desc.add<double>("nsigma_TRACK", 1.0)->setComment("Number of sigmas for fake track detection");
386  // pt_Error: dont forget to modify also ptErrorSecondary if you modify this parameter
387  desc.add<double>("pt_Error", 1.0)
388  ->setComment("Absolute pt error to detect fake tracks in the first three iterations");
389  desc.add<std::vector<double>>("factors_45", {10.0, 100.0})
390  ->setComment("Factors to be applied in the four and fifth steps to the pt error");
391 
392  // Treatment of tracks in region of bad HCal
393  desc.add<double>("goodTrackDeadHcal_ptErrRel", 0.2)->setComment("trackRef->ptError()/trackRef->pt() < X");
394  desc.add<double>("goodTrackDeadHcal_chi2n", 5)->setComment("trackRef->normalizedChi2() < X");
395  desc.add<unsigned int>("goodTrackDeadHcal_layers", 4)
396  ->setComment("trackRef->hitPattern().trackerLayersWithMeasurement() >= X");
397  desc.add<double>("goodTrackDeadHcal_validFr", 0.5)->setComment("trackRef->validFraction() > X");
398  desc.add<double>("goodTrackDeadHcal_dxy", 0.5)->setComment("abs(trackRef->dxy(primaryVertex_.position())) < X [cm]");
399 
400  desc.add<double>("goodPixelTrackDeadHcal_minEta", 2.3)->setComment("abs(trackRef->eta()) > X");
401  desc.add<double>("goodPixelTrackDeadHcal_maxPt", 50.0)->setComment("trackRef->ptError()/trackRef->pt() < X");
402  desc.add<double>("goodPixelTrackDeadHcal_ptErrRel", 1.0)->setComment("trackRef->ptError()/trackRef->pt() < X");
403  desc.add<double>("goodPixelTrackDeadHcal_chi2n", 2)->setComment("trackRef->normalizedChi2() < X");
404  desc.add<int>("goodPixelTrackDeadHcal_maxLost3Hit", 0)
405  ->setComment(
406  "max missing outer hits for a track with 3 valid pixel layers (can set to -1 to reject all these tracks)");
407  desc.add<int>("goodPixelTrackDeadHcal_maxLost4Hit", 1)
408  ->setComment("max missing outer hits for a track with >= 4 valid pixel layers");
409  desc.add<double>("goodPixelTrackDeadHcal_dxy", 0.02)
410  ->setComment("abs(trackRef->dxy(primaryVertex_.position())) < X [cm] ");
411  desc.add<double>("goodPixelTrackDeadHcal_dz", 0.05)
412  ->setComment("abs(trackRef->dz(primaryVertex_.position())) < X [cm]");
413 
414  // number of sigmas for neutral energy detection
415  desc.add<double>("pf_nsigma_ECAL", 0.0);
416  desc.add<double>("pf_nsigma_HCAL", 1.0);
417  desc.add<double>("pf_nsigma_HFEM", 1.0);
418  desc.add<double>("pf_nsigma_HFHAD", 1.0);
419 
420  // ECAL/HCAL PF cluster calibration : take it from global tag ?
421  desc.add<bool>("useCalibrationsFromDB", true);
422  desc.add<std::string>("calibrationsLabel", "");
423 
424  // Post HF cleaning
425  desc.add<bool>("postHFCleaning", false);
426  {
427  edm::ParameterSetDescription psd_PFHFCleaning;
428  psd_PFHFCleaning.add<double>("minHFCleaningPt", 5.0)
429  ->setComment("Clean only objects with pt larger than this value");
430  psd_PFHFCleaning.add<double>("maxSignificance", 2.5)
431  ->setComment("Clean only if the initial MET/sqrt(sumet) is larger than this value");
432  psd_PFHFCleaning.add<double>("minSignificance", 2.5)
433  ->setComment("Clean only if the final MET/sqrt(sumet) is smaller than this value");
434  psd_PFHFCleaning.add<double>("minSignificanceReduction", 1.4)
435  ->setComment("Clean only if the significance reduction is larger than this value");
436  psd_PFHFCleaning.add<double>("maxDeltaPhiPt", 7.0)
437  ->setComment("Clean only if the MET and the to-be-cleaned object satisfy this DeltaPhi * Pt cut");
438  // (the MET angular resoution is in 1/MET)
439  psd_PFHFCleaning.add<double>("minDeltaMet", 0.4)
440  ->setComment(
441  "Clean only if the MET relative reduction from the to-be-cleaned object is larger than this value");
442  desc.add<edm::ParameterSetDescription>("PFHFCleaningParameters", psd_PFHFCleaning);
443  }
444 
445  // Check HF cleaning
446  desc.add<std::vector<edm::InputTag>>("cleanedHF",
447  {
448  edm::InputTag("particleFlowRecHitHF", "Cleaned"),
449  edm::InputTag("particleFlowClusterHF", "Cleaned"),
450  });
451 
452  // calibration parameters for HF:
453  desc.add<bool>("calibHF_use", false);
454  desc.add<std::vector<double>>("calibHF_eta_step", {0.0, 2.9, 3.0, 3.2, 4.2, 4.4, 4.6, 4.8, 5.2, 5.4});
455  desc.add<std::vector<double>>("calibHF_a_EMonly", {1., 1., 1., 1., 1., 1., 1., 1., 1., 1.});
456  desc.add<std::vector<double>>("calibHF_a_EMHAD", {1., 1., 1., 1., 1., 1., 1., 1., 1., 1.});
457  desc.add<std::vector<double>>("calibHF_b_HADonly", {1., 1., 1., 1., 1., 1., 1., 1., 1., 1.});
458  desc.add<std::vector<double>>("calibHF_b_EMHAD", {1., 1., 1., 1., 1., 1., 1., 1., 1., 1.});
459 
460  // resolution parameters for HF: EPJC 53(2008)139, doi:10.1140/epjc/s10052-007-0459-4
461  desc.add<std::vector<double>>("resolHF_square", {2.799 * 2.799, 0.114 * 0.114, 0.0 * 0.0})
462  ->setComment("HF resolution - stochastic, constant, noise term squares");
463 
464  descriptions.add("particleFlow", desc);
465 }
void setComment(std::string const &value)
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
static void fillPSetDescription(edm::ParameterSetDescription &iDesc)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void fillPSetDescription(edm::ParameterSetDescription &iDesc)
static void fillPSetDescription(edm::ParameterSetDescription &iDesc)
Definition: PFMuonAlgo.cc:1043
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

void PFProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 230 of file PFProducer.cc.

References cms::cuda::assert(), gather_cfg::blocks, PFAlgo::checkCleaning(), PFAlgo::getCleanedCandidates(), PFAlgo::getPFMuonAlgo(), iEvent, inputTagBlocks_, inputTagCleanedHF_, inputTagMuons_, inputTagPFEGammaCandidates_, inputTagValueMapGedElectrons_, inputTagValueMapGedPhotons_, inputTagVetoes_, LogDebug, PFAlgo::makeConnectedCandidates(), pfAlgo_, pfCandidatesToken_, pfCleanedCandidatesToken_, pfegamma_, postHFCleaning_, postMuonCleaning_, PFAlgo::reconstructParticles(), PFAlgo::setEGammaCollections(), PFAlgo::setMuonHandle(), PFAlgo::setPFVertexParameters(), PFMuonAlgo::setVetoes(), contentValuesCheck::ss, str, use_EGammaFilters_, useVerticesForNeutral_, verbose_, vertices_, and vetoEndcap_.

230  {
231  LogDebug("PFProducer") << "START event: " << iEvent.id().event() << " in run " << iEvent.id().run() << endl;
232 
233  //Assign the PFAlgo Parameters
235 
236  // get the collection of blocks
237  auto blocks = iEvent.getHandle(inputTagBlocks_);
238  assert(blocks.isValid());
239 
240  // get and set the collection of muons (and collection of vetoes if specified)
241  if (postMuonCleaning_) {
243  if (vetoEndcap_) {
244  auto& muAlgo = *pfAlgo_.getPFMuonAlgo();
245  muAlgo.setVetoes(iEvent.get(inputTagVetoes_));
246  }
247  }
248 
249  if (use_EGammaFilters_)
253 
254  LogDebug("PFProducer") << "particle flow is starting" << endl;
255 
257 
258  if (verbose_) {
259  ostringstream str;
260  str << pfAlgo_ << endl;
261  LogInfo("PFProducer") << str.str() << endl;
262  }
263 
264  // Check HF overcleaning
265  if (postHFCleaning_) {
267  for (unsigned ihf = 0; ihf < inputTagCleanedHF_.size(); ++ihf) {
269  bool foundHF = iEvent.getByToken(inputTagCleanedHF_[ihf], hfCleaned);
270  if (!foundHF)
271  continue;
272  for (unsigned jhf = 0; jhf < (*hfCleaned).size(); ++jhf) {
273  hfCopy.push_back((*hfCleaned)[jhf]);
274  }
275  }
276  pfAlgo_.checkCleaning(hfCopy);
277  }
278 
279  // Save the final PFCandidate collection
280  auto pOutputCandidateCollection = pfAlgo_.makeConnectedCandidates();
281 
282  LogDebug("PFProducer") << "particle flow: putting products in the event";
283  if (verbose_) {
284  int nC = 0;
285  ostringstream ss;
286  for (auto const& cand : pOutputCandidateCollection) {
287  nC++;
288  ss << " " << nC << ") pid=" << cand.particleId() << " pt=" << cand.pt() << endl;
289  }
290  LogDebug("PFProducer") << "Here the full list:" << endl << ss.str();
291  }
292 
293  // Write in the event
294  iEvent.emplace(pfCandidatesToken_, pOutputCandidateCollection);
296 
297  if (postMuonCleaning_) {
298  auto& muAlgo = *pfAlgo_.getPFMuonAlgo();
299  // Save cosmic cleaned muon candidates
300  iEvent.put(muAlgo.transferCleanedCosmicCandidates(), "CleanedCosmicsMuons");
301  // Save tracker/global cleaned muon candidates
302  iEvent.put(muAlgo.transferCleanedTrackerAndGlobalCandidates(), "CleanedTrackerAndGlobalMuons");
303  // Save fake cleaned muon candidates
304  iEvent.put(muAlgo.transferCleanedFakeCandidates(), "CleanedFakeMuons");
305  // Save punch-through cleaned muon candidates
306  iEvent.put(muAlgo.transferPunchThroughCleanedMuonCandidates(), "CleanedPunchThroughMuons");
307  // Save punch-through cleaned neutral hadron candidates
308  iEvent.put(muAlgo.transferPunchThroughCleanedHadronCandidates(), "CleanedPunchThroughNeutralHadrons");
309  // Save added muon candidates
310  iEvent.put(muAlgo.transferAddedMuonCandidates(), "AddedMuonsAndHadrons");
311  }
312 }
std::vector< edm::EDGetTokenT< reco::PFRecHitCollection > > inputTagCleanedHF_
Definition: PFProducer.cc:56
edm::EDGetTokenT< reco::MuonCollection > inputTagMuons_
Definition: PFProducer.cc:52
reco::PFCandidateCollection & getCleanedCandidates()
Definition: PFAlgo.h:112
edm::EDGetTokenT< reco::PFCandidateCollection > inputTagVetoes_
Definition: PFProducer.cc:61
std::vector< PFRecHit > PFRecHitCollection
collection of PFRecHit objects
Definition: PFRecHitFwd.h:9
void checkCleaning(const reco::PFRecHitCollection &cleanedHF)
Check HF Cleaning.
Definition: PFAlgo.cc:3607
void setVetoes(const reco::PFCandidateCollection &vetoes)
Definition: PFMuonAlgo.h:54
assert(be >=bs)
bool use_EGammaFilters_
Definition: PFProducer.cc:68
edm::EDGetTokenT< reco::VertexCollection > vertices_
Definition: PFProducer.cc:53
void setPFVertexParameters(bool useVertex, reco::VertexCollection const &primaryVertices)
Definition: PFAlgo.cc:110
std::unique_ptr< PFEGammaFilters > pfegamma_
Definition: PFProducer.cc:69
bool useVerticesForNeutral_
Definition: PFProducer.cc:84
int iEvent
Definition: GenABIO.cc:224
void setEGammaCollections(const edm::View< reco::PFCandidate > &pfEgammaCandidates, const edm::ValueMap< reco::GsfElectronRef > &valueMapGedElectrons, const edm::ValueMap< reco::PhotonRef > &valueMapGedPhotons)
Definition: PFAlgo.cc:76
const edm::EDGetTokenT< reco::PFBlockCollection > inputTagBlocks_
Definition: PFProducer.cc:51
bool postHFCleaning_
Definition: PFProducer.cc:90
bool vetoEndcap_
Definition: PFProducer.cc:60
bool postMuonCleaning_
Definition: PFProducer.cc:78
const edm::EDPutTokenT< reco::PFCandidateCollection > pfCandidatesToken_
Definition: PFProducer.cc:47
edm::EDGetTokenT< edm::View< reco::PFCandidate > > inputTagPFEGammaCandidates_
Definition: PFProducer.cc:66
void setMuonHandle(const edm::Handle< reco::MuonCollection > &muons)
Definition: PFAlgo.h:66
void reconstructParticles(const reco::PFBlockHandle &blockHandle, PFEGammaFilters const *pfegamma)
reconstruct particles
Definition: PFAlgo.cc:130
Log< level::Info, false > LogInfo
PFAlgo pfAlgo_
particle flow algorithm
Definition: PFProducer.cc:99
bool verbose_
verbose ?
Definition: PFProducer.cc:75
edm::EDGetTokenT< edm::ValueMap< reco::PhotonRef > > inputTagValueMapGedPhotons_
Definition: PFProducer.cc:65
reco::PFCandidateCollection makeConnectedCandidates()
Definition: PFAlgo.h:115
PFMuonAlgo * getPFMuonAlgo()
Definition: PFAlgo.cc:66
const edm::EDPutTokenT< reco::PFCandidateCollection > pfCleanedCandidatesToken_
Definition: PFProducer.cc:48
#define str(s)
edm::EDGetTokenT< edm::ValueMap< reco::GsfElectronRef > > inputTagValueMapGedElectrons_
Definition: PFProducer.cc:64
#define LogDebug(id)

Member Data Documentation

◆ calibrationsLabel_

std::string PFProducer::calibrationsLabel_
private

Definition at line 88 of file PFProducer.cc.

◆ electronExtraOutputCol_

std::string PFProducer::electronExtraOutputCol_
private

Definition at line 57 of file PFProducer.cc.

◆ inputTagBlocks_

const edm::EDGetTokenT<reco::PFBlockCollection> PFProducer::inputTagBlocks_
private

Definition at line 51 of file PFProducer.cc.

Referenced by produce().

◆ inputTagCleanedHF_

std::vector<edm::EDGetTokenT<reco::PFRecHitCollection> > PFProducer::inputTagCleanedHF_
private

Definition at line 56 of file PFProducer.cc.

Referenced by produce().

◆ inputTagEgammaElectrons_

edm::EDGetTokenT<reco::GsfElectronCollection> PFProducer::inputTagEgammaElectrons_
private

Definition at line 54 of file PFProducer.cc.

◆ inputTagMuons_

edm::EDGetTokenT<reco::MuonCollection> PFProducer::inputTagMuons_
private

Definition at line 52 of file PFProducer.cc.

Referenced by produce().

◆ inputTagPFEGammaCandidates_

edm::EDGetTokenT<edm::View<reco::PFCandidate> > PFProducer::inputTagPFEGammaCandidates_
private

Definition at line 66 of file PFProducer.cc.

Referenced by produce().

◆ inputTagValueMapGedElectrons_

edm::EDGetTokenT<edm::ValueMap<reco::GsfElectronRef> > PFProducer::inputTagValueMapGedElectrons_
private

Definition at line 64 of file PFProducer.cc.

Referenced by produce().

◆ inputTagValueMapGedPhotons_

edm::EDGetTokenT<edm::ValueMap<reco::PhotonRef> > PFProducer::inputTagValueMapGedPhotons_
private

Definition at line 65 of file PFProducer.cc.

Referenced by produce().

◆ inputTagVetoes_

edm::EDGetTokenT<reco::PFCandidateCollection> PFProducer::inputTagVetoes_
private

Definition at line 61 of file PFProducer.cc.

Referenced by produce().

◆ perfToken_

edm::ESGetToken<PerformancePayload, PFCalibrationRcd> PFProducer::perfToken_
private

Definition at line 49 of file PFProducer.cc.

Referenced by beginRun().

◆ pfAlgo_

PFAlgo PFProducer::pfAlgo_
private

particle flow algorithm

Definition at line 99 of file PFProducer.cc.

Referenced by produce().

◆ pfCandidatesToken_

const edm::EDPutTokenT<reco::PFCandidateCollection> PFProducer::pfCandidatesToken_
private

Definition at line 47 of file PFProducer.cc.

Referenced by produce().

◆ pfCleanedCandidatesToken_

const edm::EDPutTokenT<reco::PFCandidateCollection> PFProducer::pfCleanedCandidatesToken_
private

Definition at line 48 of file PFProducer.cc.

Referenced by produce().

◆ pfegamma_

std::unique_ptr<PFEGammaFilters> PFProducer::pfegamma_ = nullptr
private

Definition at line 69 of file PFProducer.cc.

Referenced by produce().

◆ pfEnergyCalibration_

PFEnergyCalibration PFProducer::pfEnergyCalibration_
private

Definition at line 95 of file PFProducer.cc.

Referenced by beginRun().

◆ pfEnergyCalibrationHF_

PFEnergyCalibrationHF PFProducer::pfEnergyCalibrationHF_
private

Definition at line 96 of file PFProducer.cc.

◆ photonExtraOutputCol_

std::string PFProducer::photonExtraOutputCol_
private

Definition at line 58 of file PFProducer.cc.

◆ postHFCleaning_

bool PFProducer::postHFCleaning_
private

Definition at line 90 of file PFProducer.cc.

Referenced by produce().

◆ postMuonCleaning_

bool PFProducer::postMuonCleaning_
private

Definition at line 78 of file PFProducer.cc.

Referenced by produce().

◆ use_EGammaFilters_

bool PFProducer::use_EGammaFilters_
private

Definition at line 68 of file PFProducer.cc.

Referenced by produce().

◆ useCalibrationsFromDB_

bool PFProducer::useCalibrationsFromDB_
private

Definition at line 87 of file PFProducer.cc.

Referenced by beginRun().

◆ useEGammaElectrons_

bool PFProducer::useEGammaElectrons_
private

Definition at line 81 of file PFProducer.cc.

◆ useHO_

bool PFProducer::useHO_
private

Definition at line 72 of file PFProducer.cc.

◆ useVerticesForNeutral_

bool PFProducer::useVerticesForNeutral_
private

Definition at line 84 of file PFProducer.cc.

Referenced by produce().

◆ verbose_

bool PFProducer::verbose_
private

verbose ?

Definition at line 75 of file PFProducer.cc.

Referenced by produce().

◆ vertices_

edm::EDGetTokenT<reco::VertexCollection> PFProducer::vertices_
private

Definition at line 53 of file PFProducer.cc.

Referenced by produce().

◆ vetoEndcap_

bool PFProducer::vetoEndcap_
private

Definition at line 60 of file PFProducer.cc.

Referenced by produce().