Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:27:30

0001 #include "FWCore/Framework/interface/stream/EDProducer.h"
0002 #include "FWCore/Framework/interface/Event.h"
0003 #include "FWCore/Utilities/interface/EDPutToken.h"
0004 #include "FWCore/Framework/interface/MakerMacros.h"
0005 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0006 #include "FWCore/ParameterSet/interface/EmptyGroupDescription.h"
0007 #include "DataFormats/EgammaCandidates/interface/GsfElectron.h"
0008 #include "DataFormats/ParticleFlowReco/interface/PFRecHit.h"
0009 #include "DataFormats/ParticleFlowReco/interface/PFBlockElementSuperCluster.h"
0010 #include "DataFormats/Common/interface/ValueMap.h"
0011 #include "RecoParticleFlow/PFProducer/interface/PFEGammaFilters.h"
0012 #include "RecoParticleFlow/PFProducer/interface/PFAlgo.h"
0013 #include "FWCore/Framework/interface/MakerMacros.h"
0014 #include "FWCore/Framework/interface/ESHandle.h"
0015 #include "FWCore/Framework/interface/EventSetup.h"
0016 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0017 #include "RecoParticleFlow/PFClusterTools/interface/PFEnergyCalibration.h"
0018 #include "RecoParticleFlow/PFClusterTools/interface/PFEnergyCalibrationHF.h"
0019 #include "CondFormats/PhysicsToolsObjects/interface/PerformancePayloadFromTFormula.h"
0020 #include "CondFormats/DataRecord/interface/PFCalibrationRcd.h"
0021 #include "CondFormats/DataRecord/interface/GBRWrapperRcd.h"
0022 
0023 #include <sstream>
0024 #include <string>
0025 
0026 #include "TFile.h"
0027 
0028 /**\class PFProducer
0029 \brief Producer for particle flow reconstructed particles (PFCandidates)
0030 
0031 This producer makes use of PFAlgo, the particle flow algorithm.
0032 
0033 \author Colin Bernet
0034 \date   July 2006
0035 */
0036 
0037 class PFProducer : public edm::stream::EDProducer<> {
0038 public:
0039   explicit PFProducer(const edm::ParameterSet&);
0040 
0041   void produce(edm::Event&, const edm::EventSetup&) override;
0042   void beginRun(const edm::Run&, const edm::EventSetup&) override;
0043 
0044   static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0045 
0046 private:
0047   const edm::EDPutTokenT<reco::PFCandidateCollection> pfCandidatesToken_;
0048   const edm::EDPutTokenT<reco::PFCandidateCollection> pfCleanedCandidatesToken_;
0049   edm::ESGetToken<PerformancePayload, PFCalibrationRcd> perfToken_;
0050 
0051   const edm::EDGetTokenT<reco::PFBlockCollection> inputTagBlocks_;
0052   edm::EDGetTokenT<reco::MuonCollection> inputTagMuons_;
0053   edm::EDGetTokenT<reco::VertexCollection> vertices_;
0054   edm::EDGetTokenT<reco::GsfElectronCollection> inputTagEgammaElectrons_;
0055 
0056   std::vector<edm::EDGetTokenT<reco::PFRecHitCollection>> inputTagCleanedHF_;
0057   std::string electronExtraOutputCol_;
0058   std::string photonExtraOutputCol_;
0059 
0060   bool vetoEndcap_;
0061   edm::EDGetTokenT<reco::PFCandidateCollection> inputTagVetoes_;
0062 
0063   // NEW EGamma Filters
0064   edm::EDGetTokenT<edm::ValueMap<reco::GsfElectronRef>> inputTagValueMapGedElectrons_;
0065   edm::EDGetTokenT<edm::ValueMap<reco::PhotonRef>> inputTagValueMapGedPhotons_;
0066   edm::EDGetTokenT<edm::View<reco::PFCandidate>> inputTagPFEGammaCandidates_;
0067 
0068   bool use_EGammaFilters_;
0069   std::unique_ptr<PFEGammaFilters> pfegamma_ = nullptr;
0070 
0071   //Use of HO clusters and links in PF Reconstruction
0072   bool useHO_;
0073 
0074   /// verbose ?
0075   bool verbose_;
0076 
0077   // Post muon cleaning ?
0078   bool postMuonCleaning_;
0079 
0080   // what about e/g electrons ?
0081   bool useEGammaElectrons_;
0082 
0083   // Use vertices for Neutral particles ?
0084   bool useVerticesForNeutral_;
0085 
0086   // Take PF cluster calibrations from Global Tag ?
0087   bool useCalibrationsFromDB_;
0088   std::string calibrationsLabel_;
0089 
0090   bool postHFCleaning_;
0091   // Name of the calibration functions to read from the database
0092   // std::vector<std::string> fToRead;
0093 
0094   // calibrations
0095   PFEnergyCalibration pfEnergyCalibration_;
0096   PFEnergyCalibrationHF pfEnergyCalibrationHF_;
0097 
0098   /// particle flow algorithm
0099   PFAlgo pfAlgo_;
0100 };
0101 
0102 DEFINE_FWK_MODULE(PFProducer);
0103 
0104 using namespace std;
0105 using namespace edm;
0106 
0107 PFProducer::PFProducer(const edm::ParameterSet& iConfig)
0108     : pfCandidatesToken_{produces<reco::PFCandidateCollection>()},
0109       pfCleanedCandidatesToken_{produces<reco::PFCandidateCollection>("CleanedHF")},
0110       inputTagBlocks_(consumes<reco::PFBlockCollection>(iConfig.getParameter<InputTag>("blocks"))),
0111       pfEnergyCalibrationHF_(iConfig.getParameter<bool>("calibHF_use"),
0112                              iConfig.getParameter<std::vector<double>>("calibHF_eta_step"),
0113                              iConfig.getParameter<std::vector<double>>("calibHF_a_EMonly"),
0114                              iConfig.getParameter<std::vector<double>>("calibHF_b_HADonly"),
0115                              iConfig.getParameter<std::vector<double>>("calibHF_a_EMHAD"),
0116                              iConfig.getParameter<std::vector<double>>("calibHF_b_EMHAD")),
0117       pfAlgo_(iConfig.getParameter<double>("pf_nsigma_ECAL"),
0118               iConfig.getParameter<double>("pf_nsigma_HCAL"),
0119               iConfig.getParameter<double>("pf_nsigma_HFEM"),
0120               iConfig.getParameter<double>("pf_nsigma_HFHAD"),
0121               iConfig.getParameter<std::vector<double>>("resolHF_square"),
0122               pfEnergyCalibration_,
0123               pfEnergyCalibrationHF_,
0124               iConfig) {
0125   //Post cleaning of the muons
0126   inputTagMuons_ = consumes<reco::MuonCollection>(iConfig.getParameter<InputTag>("muons"));
0127   postMuonCleaning_ = iConfig.getParameter<bool>("postMuonCleaning");
0128   vetoEndcap_ = iConfig.getParameter<bool>("vetoEndcap");
0129   if (vetoEndcap_)
0130     inputTagVetoes_ = consumes<reco::PFCandidateCollection>(iConfig.getParameter<edm::InputTag>("vetoes"));
0131 
0132   if (iConfig.existsAs<bool>("useEGammaFilters")) {
0133     use_EGammaFilters_ = iConfig.getParameter<bool>("useEGammaFilters");
0134   } else {
0135     use_EGammaFilters_ = false;
0136   }
0137 
0138   useEGammaElectrons_ = iConfig.getParameter<bool>("useEGammaElectrons");
0139 
0140   if (useEGammaElectrons_) {
0141     inputTagEgammaElectrons_ =
0142         consumes<reco::GsfElectronCollection>(iConfig.getParameter<edm::InputTag>("egammaElectrons"));
0143   }
0144 
0145   // register products
0146   produces<reco::PFCandidateCollection>("CleanedCosmicsMuons");
0147   produces<reco::PFCandidateCollection>("CleanedTrackerAndGlobalMuons");
0148   produces<reco::PFCandidateCollection>("CleanedFakeMuons");
0149   produces<reco::PFCandidateCollection>("CleanedPunchThroughMuons");
0150   produces<reco::PFCandidateCollection>("CleanedPunchThroughNeutralHadrons");
0151   produces<reco::PFCandidateCollection>("AddedMuonsAndHadrons");
0152 
0153   // Reading new EGamma selection cuts
0154   bool useProtectionsForJetMET(false);
0155 
0156   // Reading new EGamma ubiased collections and value maps
0157   if (use_EGammaFilters_) {
0158     inputTagPFEGammaCandidates_ =
0159         consumes<edm::View<reco::PFCandidate>>((iConfig.getParameter<edm::InputTag>("PFEGammaCandidates")));
0160     inputTagValueMapGedElectrons_ =
0161         consumes<edm::ValueMap<reco::GsfElectronRef>>(iConfig.getParameter<edm::InputTag>("GedElectronValueMap"));
0162     inputTagValueMapGedPhotons_ =
0163         consumes<edm::ValueMap<reco::PhotonRef>>(iConfig.getParameter<edm::InputTag>("GedPhotonValueMap"));
0164     useProtectionsForJetMET = iConfig.getParameter<bool>("useProtectionsForJetMET");
0165 
0166     const edm::ParameterSet pfEGammaFiltersParams =
0167         iConfig.getParameter<edm::ParameterSet>("PFEGammaFiltersParameters");
0168     pfegamma_ = std::make_unique<PFEGammaFilters>(pfEGammaFiltersParams);
0169   }
0170 
0171   // EGamma filters
0172   pfAlgo_.setEGammaParameters(use_EGammaFilters_, useProtectionsForJetMET);
0173 
0174   //Secondary tracks and displaced vertices parameters
0175 
0176   bool rejectTracks_Bad = iConfig.getParameter<bool>("rejectTracks_Bad");
0177 
0178   bool rejectTracks_Step45 = iConfig.getParameter<bool>("rejectTracks_Step45");
0179 
0180   bool usePFNuclearInteractions = iConfig.getParameter<bool>("usePFNuclearInteractions");
0181 
0182   bool usePFConversions = iConfig.getParameter<bool>("usePFConversions");
0183 
0184   bool usePFDecays = iConfig.getParameter<bool>("usePFDecays");
0185 
0186   double dptRel_DispVtx = iConfig.getParameter<double>("dptRel_DispVtx");
0187 
0188   useCalibrationsFromDB_ = iConfig.getParameter<bool>("useCalibrationsFromDB");
0189 
0190   if (useCalibrationsFromDB_) {
0191     calibrationsLabel_ = iConfig.getParameter<std::string>("calibrationsLabel");
0192     perfToken_ = esConsumes<edm::Transition::BeginRun>(edm::ESInputTag("", calibrationsLabel_));
0193   }
0194   // Secondary tracks and displaced vertices parameters
0195   pfAlgo_.setDisplacedVerticesParameters(
0196       rejectTracks_Bad, rejectTracks_Step45, usePFNuclearInteractions, usePFConversions, usePFDecays, dptRel_DispVtx);
0197 
0198   if (usePFNuclearInteractions)
0199     pfAlgo_.setCandConnectorParameters(iConfig.getParameter<edm::ParameterSet>("iCfgCandConnector"));
0200 
0201   // Post cleaning of the HF
0202   postHFCleaning_ = iConfig.getParameter<bool>("postHFCleaning");
0203   const edm::ParameterSet pfHFCleaningParams = iConfig.getParameter<edm::ParameterSet>("PFHFCleaningParameters");
0204 
0205   // Set post HF cleaning muon parameters
0206   pfAlgo_.setPostHFCleaningParameters(postHFCleaning_, pfHFCleaningParams);
0207 
0208   // Input tags for HF cleaned rechits
0209   std::vector<edm::InputTag> tags = iConfig.getParameter<std::vector<edm::InputTag>>("cleanedHF");
0210   for (unsigned int i = 0; i < tags.size(); ++i)
0211     inputTagCleanedHF_.push_back(consumes<reco::PFRecHitCollection>(tags[i]));
0212   //MIKE: Vertex Parameters
0213   vertices_ = consumes<reco::VertexCollection>(iConfig.getParameter<edm::InputTag>("vertexCollection"));
0214   useVerticesForNeutral_ = iConfig.getParameter<bool>("useVerticesForNeutral");
0215 
0216   // Use HO clusters and links in the PF reconstruction
0217   useHO_ = iConfig.getParameter<bool>("useHO");
0218   pfAlgo_.setHOTag(useHO_);
0219 
0220   verbose_ = iConfig.getUntrackedParameter<bool>("verbose", false);
0221 }
0222 
0223 void PFProducer::beginRun(const edm::Run& run, const edm::EventSetup& es) {
0224   if (useCalibrationsFromDB_) {
0225     // read the PFCalibration functions from the global tags
0226     auto perfH = es.getHandle(perfToken_);
0227 
0228     PerformancePayloadFromTFormula const* pfCalibrations =
0229         static_cast<const PerformancePayloadFromTFormula*>(perfH.product());
0230 
0231     pfEnergyCalibration_.setCalibrationFunctions(pfCalibrations);
0232   }
0233 }
0234 
0235 void PFProducer::produce(Event& iEvent, const EventSetup& iSetup) {
0236   LogDebug("PFProducer") << "START event: " << iEvent.id().event() << " in run " << iEvent.id().run() << endl;
0237 
0238   //Assign the PFAlgo Parameters
0239   pfAlgo_.setPFVertexParameters(useVerticesForNeutral_, iEvent.get(vertices_));
0240 
0241   // get the collection of blocks
0242   auto blocks = iEvent.getHandle(inputTagBlocks_);
0243   assert(blocks.isValid());
0244 
0245   // get and set the collection of muons (and collection of vetoes if specified)
0246   if (postMuonCleaning_) {
0247     pfAlgo_.setMuonHandle(iEvent.getHandle(inputTagMuons_));
0248     if (vetoEndcap_) {
0249       auto& muAlgo = *pfAlgo_.getPFMuonAlgo();
0250       muAlgo.setVetoes(iEvent.get(inputTagVetoes_));
0251     }
0252   }
0253 
0254   if (use_EGammaFilters_)
0255     pfAlgo_.setEGammaCollections(iEvent.get(inputTagPFEGammaCandidates_),
0256                                  iEvent.get(inputTagValueMapGedElectrons_),
0257                                  iEvent.get(inputTagValueMapGedPhotons_));
0258 
0259   LogDebug("PFProducer") << "particle flow is starting" << endl;
0260 
0261   pfAlgo_.reconstructParticles(blocks, pfegamma_.get());
0262 
0263   if (verbose_) {
0264     ostringstream str;
0265     str << pfAlgo_ << endl;
0266     LogInfo("PFProducer") << str.str() << endl;
0267   }
0268 
0269   // Check HF overcleaning
0270   if (postHFCleaning_) {
0271     reco::PFRecHitCollection hfCopy;
0272     for (unsigned ihf = 0; ihf < inputTagCleanedHF_.size(); ++ihf) {
0273       Handle<reco::PFRecHitCollection> hfCleaned;
0274       bool foundHF = iEvent.getByToken(inputTagCleanedHF_[ihf], hfCleaned);
0275       if (!foundHF)
0276         continue;
0277       for (unsigned jhf = 0; jhf < (*hfCleaned).size(); ++jhf) {
0278         hfCopy.push_back((*hfCleaned)[jhf]);
0279       }
0280     }
0281     pfAlgo_.checkCleaning(hfCopy);
0282   }
0283 
0284   // Save the final PFCandidate collection
0285   auto pOutputCandidateCollection = pfAlgo_.makeConnectedCandidates();
0286 
0287   LogDebug("PFProducer") << "particle flow: putting products in the event";
0288   if (verbose_) {
0289     int nC = 0;
0290     ostringstream ss;
0291     for (auto const& cand : pOutputCandidateCollection) {
0292       nC++;
0293       ss << "  " << nC << ") pid=" << cand.particleId() << " pt=" << cand.pt() << endl;
0294     }
0295     LogDebug("PFProducer") << "Here the full list:" << endl << ss.str();
0296   }
0297 
0298   // Write in the event
0299   iEvent.emplace(pfCandidatesToken_, pOutputCandidateCollection);
0300   iEvent.emplace(pfCleanedCandidatesToken_, pfAlgo_.getCleanedCandidates());
0301 
0302   if (postMuonCleaning_) {
0303     auto& muAlgo = *pfAlgo_.getPFMuonAlgo();
0304     // Save cosmic cleaned muon candidates
0305     iEvent.put(muAlgo.transferCleanedCosmicCandidates(), "CleanedCosmicsMuons");
0306     // Save tracker/global cleaned muon candidates
0307     iEvent.put(muAlgo.transferCleanedTrackerAndGlobalCandidates(), "CleanedTrackerAndGlobalMuons");
0308     // Save fake cleaned muon candidates
0309     iEvent.put(muAlgo.transferCleanedFakeCandidates(), "CleanedFakeMuons");
0310     // Save punch-through cleaned muon candidates
0311     iEvent.put(muAlgo.transferPunchThroughCleanedMuonCandidates(), "CleanedPunchThroughMuons");
0312     // Save punch-through cleaned neutral hadron candidates
0313     iEvent.put(muAlgo.transferPunchThroughCleanedHadronCandidates(), "CleanedPunchThroughNeutralHadrons");
0314     // Save added muon candidates
0315     iEvent.put(muAlgo.transferAddedMuonCandidates(), "AddedMuonsAndHadrons");
0316   }
0317 }
0318 
0319 void PFProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
0320   edm::ParameterSetDescription desc;
0321 
0322   // Verbosity and debug flags
0323   desc.addUntracked<bool>("verbose", false);
0324   desc.addUntracked<bool>("debug", false);
0325 
0326   // PF Blocks label
0327   desc.add<edm::InputTag>("blocks", edm::InputTag("particleFlowBlock"));
0328 
0329   // reco::muons label and Post Muon cleaning
0330   desc.add<edm::InputTag>("muons", edm::InputTag("muons1stStep"));
0331   desc.add<bool>("postMuonCleaning", true);
0332 
0333   // vetoEndcap flag and pf candidates for vetoes
0334   edm::ParameterSetDescription emptyDescription;
0335   desc.ifValue(edm::ParameterDescription<bool>("vetoEndcap", false, true),
0336                true >> edm::ParameterDescription<edm::InputTag>("vetoes", {"pfTICL"}, true) or
0337                    false >> edm::EmptyGroupDescription());
0338 
0339   // Vertices label
0340   desc.add<edm::InputTag>("vertexCollection", edm::InputTag("offlinePrimaryVertices"));
0341   desc.add<bool>("useVerticesForNeutral", true);
0342 
0343   // Use HO clusters in PF hadron reconstruction
0344   desc.add<bool>("useHO", true);
0345 
0346   // EGamma-related
0347   desc.add<edm::InputTag>("PFEGammaCandidates", edm::InputTag("particleFlowEGamma"));
0348   desc.add<edm::InputTag>("GedElectronValueMap", {"gedGsfElectronValueMapsTmp"});
0349   desc.add<edm::InputTag>("GedPhotonValueMap", edm::InputTag("gedPhotonsTmp", "valMapPFEgammaCandToPhoton"));
0350 
0351   desc.add<bool>("useEGammaElectrons", true);
0352   desc.add<edm::InputTag>("egammaElectrons", edm::InputTag("mvaElectrons"));
0353 
0354   desc.add<bool>("useEGammaFilters", true);
0355   desc.add<bool>("useProtectionsForJetMET", true);  // Propagated to PFEGammaFilters
0356 
0357   // For PFEGammaFilters
0358   edm::ParameterSetDescription psd_PFEGammaFilters;
0359   PFEGammaFilters::fillPSetDescription(psd_PFEGammaFilters);
0360   desc.add<edm::ParameterSetDescription>("PFEGammaFiltersParameters", psd_PFEGammaFilters);
0361 
0362   // Treatment of muons :
0363   // Expected energy in ECAL and HCAL, and RMS
0364   desc.add<std::vector<double>>("muon_HCAL", {3.0, 3.0});
0365   desc.add<std::vector<double>>("muon_ECAL", {0.5, 0.5});
0366   desc.add<std::vector<double>>("muon_HO", {0.9, 0.9});
0367 
0368   // For PFMuonAlgo
0369   edm::ParameterSetDescription psd_PFMuonAlgo;
0370   PFMuonAlgo::fillPSetDescription(psd_PFMuonAlgo);
0371   desc.add<edm::ParameterSetDescription>("PFMuonAlgoParameters", psd_PFMuonAlgo);
0372 
0373   // Input displaced vertices
0374   // It is strongly adviced to keep usePFNuclearInteractions = bCorrect
0375   desc.add<bool>("rejectTracks_Bad", true);
0376   desc.add<bool>("rejectTracks_Step45", true);
0377 
0378   desc.add<bool>("usePFNuclearInteractions", true);
0379   desc.add<bool>("usePFConversions", true);
0380   desc.add<bool>("usePFDecays", false);
0381 
0382   desc.add<double>("dptRel_DispVtx", 10.0);
0383 
0384   // PFCandConnector
0385   edm::ParameterSetDescription psd_CandConnector;
0386   PFCandConnector::fillPSetDescription(psd_CandConnector);
0387   desc.add<edm::ParameterSetDescription>("iCfgCandConnector", psd_CandConnector);
0388 
0389   // Treatment of potential fake tracks
0390   desc.add<double>("nsigma_TRACK", 1.0)->setComment("Number of sigmas for fake track detection");
0391   // pt_Error: dont forget to modify also ptErrorSecondary if you modify this parameter
0392   desc.add<double>("pt_Error", 1.0)
0393       ->setComment("Absolute pt error to detect fake tracks in the first three iterations");
0394   desc.add<std::vector<double>>("factors_45", {10.0, 100.0})
0395       ->setComment("Factors to be applied in the four and fifth steps to the pt error");
0396 
0397   // Treatment of tracks in region of bad HCal
0398   desc.add<double>("goodTrackDeadHcal_ptErrRel", 0.2)->setComment("trackRef->ptError()/trackRef->pt() < X");
0399   desc.add<double>("goodTrackDeadHcal_chi2n", 5)->setComment("trackRef->normalizedChi2() < X");
0400   desc.add<unsigned int>("goodTrackDeadHcal_layers", 4)
0401       ->setComment("trackRef->hitPattern().trackerLayersWithMeasurement() >= X");
0402   desc.add<double>("goodTrackDeadHcal_validFr", 0.5)->setComment("trackRef->validFraction() > X");
0403   desc.add<double>("goodTrackDeadHcal_dxy", 0.5)->setComment("abs(trackRef->dxy(primaryVertex_.position())) < X [cm]");
0404 
0405   desc.add<double>("goodPixelTrackDeadHcal_minEta", 2.3)->setComment("abs(trackRef->eta()) > X");
0406   desc.add<double>("goodPixelTrackDeadHcal_maxPt", 50.0)->setComment("trackRef->ptError()/trackRef->pt() < X");
0407   desc.add<double>("goodPixelTrackDeadHcal_ptErrRel", 1.0)->setComment("trackRef->ptError()/trackRef->pt() < X");
0408   desc.add<double>("goodPixelTrackDeadHcal_chi2n", 2)->setComment("trackRef->normalizedChi2() < X");
0409   desc.add<int>("goodPixelTrackDeadHcal_maxLost3Hit", 0)
0410       ->setComment(
0411           "max missing outer hits for a track with 3 valid pixel layers (can set to -1 to reject all these tracks)");
0412   desc.add<int>("goodPixelTrackDeadHcal_maxLost4Hit", 1)
0413       ->setComment("max missing outer hits for a track with >= 4 valid pixel layers");
0414   desc.add<double>("goodPixelTrackDeadHcal_dxy", 0.02)
0415       ->setComment("abs(trackRef->dxy(primaryVertex_.position())) < X [cm] ");
0416   desc.add<double>("goodPixelTrackDeadHcal_dz", 0.05)
0417       ->setComment("abs(trackRef->dz(primaryVertex_.position())) < X [cm]");
0418 
0419   // number of sigmas for neutral energy detection
0420   desc.add<double>("pf_nsigma_ECAL", 0.0);
0421   desc.add<double>("pf_nsigma_HCAL", 1.0);
0422   desc.add<double>("pf_nsigma_HFEM", 1.0);
0423   desc.add<double>("pf_nsigma_HFHAD", 1.0);
0424 
0425   // ECAL/HCAL PF cluster calibration : take it from global tag ?
0426   desc.add<bool>("useCalibrationsFromDB", true);
0427   desc.add<std::string>("calibrationsLabel", "");
0428 
0429   // Post HF cleaning
0430   desc.add<bool>("postHFCleaning", false);
0431   {
0432     edm::ParameterSetDescription psd_PFHFCleaning;
0433     psd_PFHFCleaning.add<double>("minHFCleaningPt", 5.0)
0434         ->setComment("Clean only objects with pt larger than this value");
0435     psd_PFHFCleaning.add<double>("maxSignificance", 2.5)
0436         ->setComment("Clean only if the initial MET/sqrt(sumet) is larger than this value");
0437     psd_PFHFCleaning.add<double>("minSignificance", 2.5)
0438         ->setComment("Clean only if the final MET/sqrt(sumet) is smaller than this value");
0439     psd_PFHFCleaning.add<double>("minSignificanceReduction", 1.4)
0440         ->setComment("Clean only if the significance reduction is larger than this value");
0441     psd_PFHFCleaning.add<double>("maxDeltaPhiPt", 7.0)
0442         ->setComment("Clean only if the MET and the to-be-cleaned object satisfy this DeltaPhi * Pt cut");
0443     // (the MET angular resoution is in 1/MET)
0444     psd_PFHFCleaning.add<double>("minDeltaMet", 0.4)
0445         ->setComment(
0446             "Clean only if the MET relative reduction from the to-be-cleaned object is larger than this value");
0447     desc.add<edm::ParameterSetDescription>("PFHFCleaningParameters", psd_PFHFCleaning);
0448   }
0449 
0450   // Check HF cleaning
0451   desc.add<std::vector<edm::InputTag>>("cleanedHF",
0452                                        {
0453                                            edm::InputTag("particleFlowRecHitHF", "Cleaned"),
0454                                            edm::InputTag("particleFlowClusterHF", "Cleaned"),
0455                                        });
0456 
0457   // calibration parameters for HF:
0458   desc.add<bool>("calibHF_use", false);
0459   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});
0460   desc.add<std::vector<double>>("calibHF_a_EMonly", {1., 1., 1., 1., 1., 1., 1., 1., 1., 1.});
0461   desc.add<std::vector<double>>("calibHF_a_EMHAD", {1., 1., 1., 1., 1., 1., 1., 1., 1., 1.});
0462   desc.add<std::vector<double>>("calibHF_b_HADonly", {1., 1., 1., 1., 1., 1., 1., 1., 1., 1.});
0463   desc.add<std::vector<double>>("calibHF_b_EMHAD", {1., 1., 1., 1., 1., 1., 1., 1., 1., 1.});
0464 
0465   // resolution parameters for HF: EPJC 53(2008)139, doi:10.1140/epjc/s10052-007-0459-4
0466   desc.add<std::vector<double>>("resolHF_square", {2.799 * 2.799, 0.114 * 0.114, 0.0 * 0.0})
0467       ->setComment("HF resolution - stochastic, constant, noise term squares");
0468 
0469   descriptions.add("particleFlow", desc);
0470 }