diff --git a/CommonTools/RecoAlgos/interface/CandidateProducer.h b/CommonTools/RecoAlgos/interface/CandidateProducer.h index 5e1bcb2f82d92..2a840c3fb4258 100644 --- a/CommonTools/RecoAlgos/interface/CandidateProducer.h +++ b/CommonTools/RecoAlgos/interface/CandidateProducer.h @@ -12,15 +12,17 @@ * $Id: CandidateProducer.h,v 1.4 2010/02/11 00:10:53 wmtan Exp $ * */ -#include "FWCore/Utilities/interface/InputTag.h" -#include "FWCore/ParameterSet/interface/ParameterSetfwd.h" -#include "FWCore/Framework/interface/stream/EDProducer.h" -#include "FWCore/Framework/interface/Event.h" -#include "DataFormats/Common/interface/Handle.h" -#include "DataFormats/Candidate/interface/CandidateFwd.h" -#include "CommonTools/UtilAlgos/interface/MasterCollectionHelper.h" #include "CommonTools/UtilAlgos/interface/AnySelector.h" #include "CommonTools/UtilAlgos/interface/EventSetupInitTrait.h" +#include "CommonTools/UtilAlgos/interface/MasterCollectionHelper.h" +#include "DataFormats/Candidate/interface/CandidateFwd.h" +#include "DataFormats/Common/interface/Handle.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/stream/EDProducer.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" +#include "FWCore/ParameterSet/interface/ParameterSetfwd.h" +#include "FWCore/Utilities/interface/InputTag.h" namespace converter { namespace helper { @@ -81,6 +83,14 @@ class CandidateProducer : public edm::stream::EDProducer<> { /// destructor ~CandidateProducer() override {} + /// fillDescriptions + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add("src", edm::InputTag("")); + Conv::fillPSetDescription(desc); + descriptions.addWithDefaultLabel(desc); + } + private: /// begin job (first run) void beginRun(const edm::Run&, const edm::EventSetup& es) override { diff --git a/CommonTools/RecoAlgos/interface/MassiveCandidateConverter.h b/CommonTools/RecoAlgos/interface/MassiveCandidateConverter.h index 2f63740240169..8fa1cae6f63b6 100644 --- a/CommonTools/RecoAlgos/interface/MassiveCandidateConverter.h +++ b/CommonTools/RecoAlgos/interface/MassiveCandidateConverter.h @@ -1,9 +1,11 @@ #ifndef RecoAlgos_MassiveCandidateConverter_h #define RecoAlgos_MassiveCandidateConverter_h +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" #include "FWCore/ParameterSet/interface/ParameterSetfwd.h" #include "FWCore/Utilities/interface/ESGetToken.h" -#include "SimGeneral/HepPDTRecord/interface/PdtEntry.h" #include "SimGeneral/HepPDTRecord/interface/ParticleDataTable.h" +#include "SimGeneral/HepPDTRecord/interface/PdtEntry.h" #include namespace edm { @@ -16,6 +18,9 @@ namespace converter { MassiveCandidateConverter(const edm::ParameterSet&, edm::ConsumesCollector); void beginFirstRun(const edm::EventSetup&); + public: + static void fillPSetDescription(edm::ParameterSetDescription& desc); + protected: double massSqr_; PdtEntry particle_; diff --git a/CommonTools/RecoAlgos/interface/RecoTrackSelectorBase.h b/CommonTools/RecoAlgos/interface/RecoTrackSelectorBase.h index 62293872835b0..4bfad1f2cea64 100644 --- a/CommonTools/RecoAlgos/interface/RecoTrackSelectorBase.h +++ b/CommonTools/RecoAlgos/interface/RecoTrackSelectorBase.h @@ -1,17 +1,18 @@ #ifndef CommonTools_RecoAlgos_RecoTrackSelectorBase_h #define CommonTools_RecoAlgos_RecoTrackSelectorBase_h -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/ConsumesCollector.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/Utilities/interface/InputTag.h" - +#include "DataFormats/BeamSpot/interface/BeamSpot.h" +#include "DataFormats/Math/interface/deltaPhi.h" #include "DataFormats/TrackReco/interface/Track.h" #include "DataFormats/TrackReco/interface/TrackFwd.h" -#include "DataFormats/BeamSpot/interface/BeamSpot.h" #include "DataFormats/VertexReco/interface/Vertex.h" #include "DataFormats/VertexReco/interface/VertexFwd.h" -#include "DataFormats/Math/interface/deltaPhi.h" +#include "FWCore/Framework/interface/ConsumesCollector.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" +#include "FWCore/Utilities/interface/InputTag.h" class RecoTrackSelectorBase { public: @@ -79,6 +80,29 @@ class RecoTrackSelectorBase { vertex_ = (*hVtx)[0].position(); } + static void fillPSetDescription(edm::ParameterSetDescription& desc) { + desc.add("invertRapidityCut", false); + desc.add("usePV", false); + desc.add("lip", 300.0); + desc.add("maxChi2", 10000.0); + desc.add("maxPhi", -3.2); + desc.add("maxRapidity", 5.0); + desc.add("minPhi", 3.2); + desc.add("minRapidity", -5.0); + desc.add("ptMin", 0.1); + desc.add("tip", 120.0); + desc.add("beamSpot", edm::InputTag("offlineBeamSpot")); + desc.add("vertexTag", edm::InputTag("offlinePrimaryVertices")); + desc.add("min3DLayer", 0); + desc.add("minHit", 0); + desc.add("minLayer", 3); + desc.add("minPixelHit", 0); + desc.add >("algorithm", {}); + desc.add >("algorithmMaskContains", {}); + desc.add >("originalAlgorithm", {}); + desc.add >("quality", {}); + } + bool operator()(const reco::TrackRef& tref) const { return (*this)(*tref); } bool operator()(const reco::Track& t) const { return (*this)(t, vertex_); } diff --git a/CommonTools/RecoAlgos/interface/TrackFullCloneSelectorBase.h b/CommonTools/RecoAlgos/interface/TrackFullCloneSelectorBase.h index df57569202403..f1ffb3bd6b61a 100644 --- a/CommonTools/RecoAlgos/interface/TrackFullCloneSelectorBase.h +++ b/CommonTools/RecoAlgos/interface/TrackFullCloneSelectorBase.h @@ -12,24 +12,24 @@ * */ -#include - -#include "FWCore/Framework/interface/ConsumesCollector.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/stream/EDProducer.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/Utilities/interface/InputTag.h" #include #include #include #include #include -#include "DataFormats/TrackReco/interface/TrackFwd.h" #include "DataFormats/TrackReco/interface/Track.h" #include "DataFormats/TrackReco/interface/TrackExtra.h" -#include "TrackingTools/PatternTools/interface/Trajectory.h" +#include "DataFormats/TrackReco/interface/TrackFwd.h" +#include "FWCore/Framework/interface/ConsumesCollector.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/stream/EDProducer.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" +#include "FWCore/Utilities/interface/InputTag.h" #include "TrackingTools/PatternTools/interface/TrajTrackAssociation.h" +#include "TrackingTools/PatternTools/interface/Trajectory.h" namespace reco { namespace modules { @@ -57,7 +57,16 @@ namespace reco { } } /// destructor - ~TrackFullCloneSelectorBase() override {} + ~TrackFullCloneSelectorBase() override = default; + + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add("src", edm::InputTag("generalTracks")); + desc.addUntracked("copyExtras", false); + desc.addUntracked("copyTrajectories", false); + Selector::fillPSetDescription(desc); + descriptions.addWithDefaultLabel(desc); + } private: /// process one event @@ -173,7 +182,6 @@ namespace reco { std::unique_ptr > selTrajs_; std::unique_ptr selTTAss_; }; - } // namespace modules } // namespace reco #endif diff --git a/CommonTools/RecoAlgos/interface/TrackWithVertexSelector.h b/CommonTools/RecoAlgos/interface/TrackWithVertexSelector.h index 91ad0ae60c783..0677d24119f20 100644 --- a/CommonTools/RecoAlgos/interface/TrackWithVertexSelector.h +++ b/CommonTools/RecoAlgos/interface/TrackWithVertexSelector.h @@ -5,14 +5,16 @@ // Created: Fri May 25 10:06:02 CEST 2007 // $Id: TrackWithVertexSelector.h,v 1.4 2010/04/07 08:56:18 gpetrucc Exp $ -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/Utilities/interface/InputTag.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/ConsumesCollector.h" #include "DataFormats/Common/interface/ValueMap.h" #include "DataFormats/TrackReco/interface/Track.h" #include "DataFormats/VertexReco/interface/Vertex.h" #include "DataFormats/VertexReco/interface/VertexFwd.h" +#include "FWCore/Framework/interface/ConsumesCollector.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" +#include "FWCore/Utilities/interface/InputTag.h" class TrackWithVertexSelector { public: @@ -21,6 +23,8 @@ class TrackWithVertexSelector { explicit TrackWithVertexSelector(const edm::ParameterSet &iConfig, edm::ConsumesCollector &iC); ~TrackWithVertexSelector(); + static void fillPSetDescription(edm::ParameterSetDescription &desc); + void init(const edm::Event &event, const edm::EventSetup &) { init(event); } void init(const edm::Event &event); @@ -42,20 +46,20 @@ class TrackWithVertexSelector { bool testVertices(const reco::TrackRef &t, const reco::VertexCollection &vtxs) const; private: - uint32_t numberOfValidHits_; - uint32_t numberOfValidPixelHits_; - uint32_t numberOfLostHits_; - double normalizedChi2_; - double ptMin_, ptMax_, etaMin_, etaMax_; - double dzMax_, d0Max_; - double ptErrorCut_; - std::string quality_; + const uint32_t numberOfValidHits_; + const uint32_t numberOfValidPixelHits_; + const uint32_t numberOfLostHits_; + const double normalizedChi2_; + const double ptMin_, ptMax_, etaMin_, etaMax_; + const double dzMax_, d0Max_; + const double ptErrorCut_; + const std::string quality_; - uint32_t nVertices_; - edm::EDGetTokenT vertexToken_; - edm::EDGetTokenT > timesToken_, timeResosToken_; - bool vtxFallback_; - double zetaVtx_, rhoVtx_, nSigmaDtVertex_; + const uint32_t nVertices_; + const edm::EDGetTokenT vertexToken_; + const edm::EDGetTokenT > timesToken_, timeResosToken_; + const bool vtxFallback_; + const double zetaVtx_, rhoVtx_, nSigmaDtVertex_; reco::VertexCollection const *vcoll_ = nullptr; edm::ValueMap const *timescoll_ = nullptr; diff --git a/CommonTools/RecoAlgos/src/MassiveCandidateConverter.cc b/CommonTools/RecoAlgos/src/MassiveCandidateConverter.cc index 9f2733b32d829..890b7c9210cf4 100644 --- a/CommonTools/RecoAlgos/src/MassiveCandidateConverter.cc +++ b/CommonTools/RecoAlgos/src/MassiveCandidateConverter.cc @@ -20,3 +20,9 @@ void MassiveCandidateConverter::beginFirstRun(const EventSetup& es) { massSqr_ = particle_.data().mass(); massSqr_ *= massSqr_; } + +void MassiveCandidateConverter::fillPSetDescription(edm::ParameterSetDescription& desc) { + desc.addNode(edm::ParameterDescription("particleType", true) xor + edm::ParameterDescription("particleType", true)) + ->setComment("the PdtEntry can be specified as either an 'int' or via its name using a 'string'"); +} diff --git a/CommonTools/RecoAlgos/src/RecoChargedRefCandidateToTrackRef.h b/CommonTools/RecoAlgos/src/RecoChargedRefCandidateToTrackRef.h index b274a2ada8f2f..281b0ff5106f1 100644 --- a/CommonTools/RecoAlgos/src/RecoChargedRefCandidateToTrackRef.h +++ b/CommonTools/RecoAlgos/src/RecoChargedRefCandidateToTrackRef.h @@ -2,6 +2,7 @@ #define CommonTools_RecoAlgos_TrackToRefCandidate_h #include "DataFormats/TrackReco/interface/Track.h" #include "DataFormats/TrackReco/interface/TrackFwd.h" +#include "FWCore/ParameterSet/interface/ParameterSetfwd.h" #include "DataFormats/RecoCandidate/interface/RecoChargedRefCandidate.h" #include "DataFormats/RecoCandidate/interface/RecoChargedRefCandidateFwd.h" @@ -19,6 +20,7 @@ namespace converter { RecoChargedRefCandidateToTrackRef(const edm::ParameterSet& cfg, const edm::ConsumesCollector&) {} void beginFirstRun(const edm::EventSetup&) {} void convert(const reco::RecoChargedRefCandidateRef& c, reco::TrackRef& trkRef) const { trkRef = c->track(); } + static void fillPSetDescription(edm::ParameterSetDescription& desc) {} }; } // namespace converter diff --git a/CommonTools/RecoAlgos/src/TrackWithVertexSelector.cc b/CommonTools/RecoAlgos/src/TrackWithVertexSelector.cc index 52befeeed3bd8..120fcd95a4bda 100644 --- a/CommonTools/RecoAlgos/src/TrackWithVertexSelector.cc +++ b/CommonTools/RecoAlgos/src/TrackWithVertexSelector.cc @@ -128,3 +128,27 @@ bool TrackWithVertexSelector::operator()(const reco::TrackRef &tref) const { return true; return testVertices(tref, *vcoll_); } + +void TrackWithVertexSelector::fillPSetDescription(edm::ParameterSetDescription &desc) { + desc.add("numberOfValidHits", 0); + desc.add("numberOfValidPixelHits", 0); + desc.add("numberOfLostHits", 999)->setComment("at most 999 lost hits"); + desc.add("normalizedChi2", 999999.); + desc.add("ptMin", 0.3)->setComment("in GeV"); + desc.add("ptMax", 500.0)->setComment("in GeV"); + desc.add("etaMin", 0.0); + desc.add("etaMax", 50.0); + desc.add("dzMax", 999.)->setComment("in cm"); + desc.add("d0Max", 999.)->setComment("in cm"); + desc.add("ptErrorCut", 0.2)->setComment("[pTError/pT]*max(1,normChi2) <= ptErrorCut"); + desc.add("quality", "highPurity")->setComment(" quality cut as defined in reco::TrackBase"); + desc.add("useVtx", true)->setComment("compatibility with a vertex"); + desc.add("nVertices", 0)->setComment(" how many vertices to look at before dropping the track"); + desc.add("vertexTag", edm::InputTag("offlinePrimaryVertices")); + desc.add("timesTag", edm::InputTag("")); + desc.add("timeResosTag", edm::InputTag("")); + desc.add("vtxFallback", true)->setComment("falback to beam spot if there are no vertices"); + desc.add("zetaVtx", 1.0); + desc.add("rhoVtx", 0.2)->setComment("tags used by b-tagging folks"); + desc.add("nSigmaDtVertex", 0); +} diff --git a/JetMETCorrections/Modules/plugins/ChainedJetCorrectorProducer.cc b/JetMETCorrections/Modules/plugins/ChainedJetCorrectorProducer.cc index 3b32ab7deb7fc..3936f3a427210 100644 --- a/JetMETCorrections/Modules/plugins/ChainedJetCorrectorProducer.cc +++ b/JetMETCorrections/Modules/plugins/ChainedJetCorrectorProducer.cc @@ -122,14 +122,6 @@ class ChainedJetCorrectorProducer : public edm::stream::EDProducer<> { std::vector> correctorTokens_; }; -// -// constants, enums and typedefs -// - -// -// static data member definitions -// - // // constructors and destructor // @@ -169,11 +161,9 @@ void ChainedJetCorrectorProducer::produce(edm::Event& iEvent, const edm::EventSe // ------------ method fills 'descriptions' with the allowed parameters for the module ------------ void ChainedJetCorrectorProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { - //The following says we do not know what parameters are allowed so do no validation - // Please change this to state exactly what you do use, even if it is no parameters edm::ParameterSetDescription desc; - desc.add>("correctors"); - descriptions.addDefault(desc); + desc.add>("correctors", {}); + descriptions.addWithDefaultLabel(desc); } //define this as a plug-in diff --git a/RecoBTag/Combined/plugins/DeepFlavourJetTagsProducer.cc b/RecoBTag/Combined/plugins/DeepFlavourJetTagsProducer.cc index 7a02c3d9d06cb..b7a2c31d84c61 100644 --- a/RecoBTag/Combined/plugins/DeepFlavourJetTagsProducer.cc +++ b/RecoBTag/Combined/plugins/DeepFlavourJetTagsProducer.cc @@ -288,11 +288,26 @@ namespace { // ------------ method fills 'descriptions' with the allowed parameters for the module ------------ void DeepFlavourJetTagsProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { - //The following says we do not know what parameters are allowed so do no validation - // Please change this to state exactly what you do use, even if it is no parameters edm::ParameterSetDescription desc; - desc.setUnknown(); - descriptions.addDefault(desc); + + // Define the parameters + desc.add("src", edm::InputTag("pfDeepCSVTagInfos")) + ->setComment("InputTag for the source tag info collection."); + desc.add("checkSVForDefaults", false)->setComment("Flag to check secondary vertex defaults."); + desc.add("meanPadding", false)->setComment("Enable or disable mean padding for input features."); + desc.add("NNConfig", edm::FileInPath("RecoBTag/Combined/data/DeepFlavourNoSL.json")) + ->setComment("Path to the JSON file containing the neural network configuration."); + + // Define the 'toAdd' parameter as a ParameterSet with arbitrary string keys + edm::ParameterSetDescription toAddDesc; + toAddDesc.setAllowAnything(); // Allow any string-to-string mappings + desc.add("toAdd", toAddDesc) + ->setComment( + "ParameterSet for merging different NN outputs together. " + "Each key is an output to merge, and its value is the target output."); + + // Add this producer's description to the descriptions registry + descriptions.addWithDefaultLabel(desc); } } // end unnamed namespace diff --git a/RecoBTag/Combined/plugins/DeepNNTagInfoProducer.cc b/RecoBTag/Combined/plugins/DeepNNTagInfoProducer.cc index 4a34a95fde6aa..76a53e4692e44 100644 --- a/RecoBTag/Combined/plugins/DeepNNTagInfoProducer.cc +++ b/RecoBTag/Combined/plugins/DeepNNTagInfoProducer.cc @@ -20,23 +20,19 @@ #include // user 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/ParameterSet/interface/ParameterSet.h" -#include "FWCore/Utilities/interface/StreamID.h" - #include "DataFormats/BTauReco/interface/CandIPTagInfo.h" #include "DataFormats/BTauReco/interface/CandSecondaryVertexTagInfo.h" +#include "DataFormats/BTauReco/interface/SecondaryVertexTagInfo.h" #include "DataFormats/BTauReco/interface/ShallowTagInfo.h" #include "DataFormats/BTauReco/interface/TaggingVariable.h" -#include "RecoBTag/SecondaryVertex/interface/CombinedSVComputer.h" - #include "DataFormats/BTauReco/interface/TrackIPTagInfo.h" -#include "DataFormats/BTauReco/interface/SecondaryVertexTagInfo.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/Framework/interface/stream/EDProducer.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/Utilities/interface/StreamID.h" +#include "RecoBTag/SecondaryVertex/interface/CombinedSVComputer.h" #include @@ -50,7 +46,7 @@ template class TemplatedDeepNNTagInfoProducer : public edm::stream::EDProducer<> { public: explicit TemplatedDeepNNTagInfoProducer(const edm::ParameterSet&); - ~TemplatedDeepNNTagInfoProducer() override; + ~TemplatedDeepNNTagInfoProducer() override = default; static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); @@ -64,14 +60,6 @@ class TemplatedDeepNNTagInfoProducer : public edm::stream::EDProducer<> { CombinedSVComputer computer_; }; -// -// constants, enums and typedefs -// - -// -// static data member definitions -// - // // constructors and destructor // @@ -82,12 +70,6 @@ TemplatedDeepNNTagInfoProducer::TemplatedDeepNNTagInfoProducer(con produces >(); } -template -TemplatedDeepNNTagInfoProducer::~TemplatedDeepNNTagInfoProducer() { - // do anything here that needs to be done at destruction time - // (e.g. close files, deallocate resources etc.) -} - // // member functions // @@ -131,11 +113,15 @@ void TemplatedDeepNNTagInfoProducer::produce(edm::Event& iEvent, c // ------------ method fills 'descriptions' with the allowed parameters for the module ------------ template void TemplatedDeepNNTagInfoProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { - //The following says we do not know what parameters are allowed so do no validation - // Please change this to state exactly what you do use, even if it is no parameters edm::ParameterSetDescription desc; - desc.setUnknown(); - descriptions.addDefault(desc); + desc.add("svTagInfos", edm::InputTag("")); + + // Define the computer parameter using CombinedSVComputer + edm::ParameterSetDescription computerDesc; + CombinedSVComputer::fillPSetDescription(computerDesc); + desc.add("computer", computerDesc); + + descriptions.addWithDefaultLabel(desc); } //define this as a plug-in diff --git a/RecoBTag/SecondaryVertex/interface/CombinedSVComputer.h b/RecoBTag/SecondaryVertex/interface/CombinedSVComputer.h index ec29afa6d9621..17add425d7d0e 100644 --- a/RecoBTag/SecondaryVertex/interface/CombinedSVComputer.h +++ b/RecoBTag/SecondaryVertex/interface/CombinedSVComputer.h @@ -8,31 +8,28 @@ #include #include - -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/Utilities/interface/Exception.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -#include "DataFormats/Math/interface/Vector3D.h" -#include "DataFormats/Math/interface/LorentzVector.h" +#include "DataFormats/BTauReco/interface/CandSecondaryVertexTagInfo.h" +#include "DataFormats/BTauReco/interface/ParticleMasses.h" +#include "DataFormats/BTauReco/interface/SecondaryVertexTagInfo.h" +#include "DataFormats/BTauReco/interface/TaggingVariable.h" +#include "DataFormats/BTauReco/interface/VertexTypes.h" #include "DataFormats/GeometryCommonDetAlgo/interface/Measurement1D.h" #include "DataFormats/GeometryVector/interface/GlobalPoint.h" #include "DataFormats/GeometryVector/interface/GlobalVector.h" #include "DataFormats/GeometryVector/interface/VectorUtil.h" -#include "DataFormats/TrackReco/interface/Track.h" -#include "DataFormats/TrackReco/interface/TrackFwd.h" -#include "DataFormats/BTauReco/interface/SecondaryVertexTagInfo.h" -#include "DataFormats/BTauReco/interface/CandSecondaryVertexTagInfo.h" -#include "DataFormats/BTauReco/interface/TaggingVariable.h" -#include "DataFormats/BTauReco/interface/VertexTypes.h" -#include "DataFormats/BTauReco/interface/ParticleMasses.h" #include "DataFormats/JetReco/interface/PFJet.h" +#include "DataFormats/Math/interface/LorentzVector.h" +#include "DataFormats/Math/interface/Vector3D.h" #include "DataFormats/PatCandidates/interface/Jet.h" - +#include "DataFormats/TrackReco/interface/Track.h" +#include "DataFormats/TrackReco/interface/TrackFwd.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" +#include "FWCore/Utilities/interface/Exception.h" +#include "RecoBTag/SecondaryVertex/interface/TrackKinematics.h" #include "RecoBTag/SecondaryVertex/interface/TrackSelector.h" -#include "RecoBTag/SecondaryVertex/interface/V0Filter.h" #include "RecoBTag/SecondaryVertex/interface/TrackSorting.h" -#include "RecoBTag/SecondaryVertex/interface/TrackKinematics.h" +#include "RecoBTag/SecondaryVertex/interface/V0Filter.h" #define range_for(i, x) for (int i = (x).begin; i != (x).end; i += (x).increment) @@ -69,6 +66,8 @@ class CombinedSVComputer { double &vtx_track_ptSum, double &vtx_track_ESum) const; + static void fillPSetDescription(edm::ParameterSetDescription &desc); + private: bool trackFlip; bool vertexFlip; diff --git a/RecoBTag/SecondaryVertex/src/CombinedSVComputer.cc b/RecoBTag/SecondaryVertex/src/CombinedSVComputer.cc index d83cb48899435..eeca3888aaa5e 100644 --- a/RecoBTag/SecondaryVertex/src/CombinedSVComputer.cc +++ b/RecoBTag/SecondaryVertex/src/CombinedSVComputer.cc @@ -239,3 +239,86 @@ TaggingVariableList CombinedSVComputer::operator()(const CandIPTagInfo &ipInfo, vars.finalize(); return vars; } + +void CombinedSVComputer::fillPSetDescription(edm::ParameterSetDescription &desc) { + { + edm::ParameterSetDescription trackPseudoSelection; + trackPseudoSelection.add("max_pT_dRcut", 0.1); + trackPseudoSelection.add("b_dR", 0.6263); + trackPseudoSelection.add("min_pT", 120.0); + trackPseudoSelection.add("b_pT", 0.3684); + trackPseudoSelection.add("ptMin", 0.0); + trackPseudoSelection.add("max_pT_trackPTcut", 3.0); + trackPseudoSelection.add("max_pT", 500.0); + trackPseudoSelection.add("useVariableJTA", false); + trackPseudoSelection.add("maxDecayLen", 5.0); + trackPseudoSelection.add("qualityClass", "any"); + trackPseudoSelection.add("normChi2Max", 99999.9); + trackPseudoSelection.add("sip2dValMin", -99999.9); + trackPseudoSelection.add("sip3dValMin", -99999.9); + trackPseudoSelection.add("a_dR", -0.001053); + trackPseudoSelection.add("maxDistToAxis", 0.07); + trackPseudoSelection.add("totalHitsMin", 3); + trackPseudoSelection.add("a_pT", 0.005263); + trackPseudoSelection.add("sip2dSigMax", 99999.9); + trackPseudoSelection.add("sip2dValMax", 99999.9); + trackPseudoSelection.add("sip3dSigMax", 99999.9); + trackPseudoSelection.add("sip3dValMax", 99999.9); + trackPseudoSelection.add("min_pT_dRcut", 0.5); + trackPseudoSelection.add("jetDeltaRMax", 0.3); + trackPseudoSelection.add("pixelHitsMin", 0); + trackPseudoSelection.add("sip3dSigMin", -99999.9); + trackPseudoSelection.add("sip2dSigMin", 2.0); + desc.add("trackPseudoSelection", trackPseudoSelection); + } + + { + edm::ParameterSetDescription trackSelection; + trackSelection.add("max_pT_dRcut", 0.1); + trackSelection.add("b_dR", 0.6263); + trackSelection.add("min_pT", 120.0); + trackSelection.add("b_pT", 0.3684); + trackSelection.add("ptMin", 0.0); + trackSelection.add("max_pT_trackPTcut", 3.0); + trackSelection.add("max_pT", 500.0); + trackSelection.add("useVariableJTA", false); + trackSelection.add("maxDecayLen", 5.0); + trackSelection.add("qualityClass", "any"); + trackSelection.add("normChi2Max", 99999.9); + trackSelection.add("sip2dValMin", -99999.9); + trackSelection.add("sip3dValMin", -99999.9); + trackSelection.add("a_dR", -0.001053); + trackSelection.add("maxDistToAxis", 0.07); + trackSelection.add("totalHitsMin", 3); + trackSelection.add("a_pT", 0.005263); + trackSelection.add("sip2dSigMax", 99999.9); + trackSelection.add("sip2dValMax", 99999.9); + trackSelection.add("sip3dSigMax", 99999.9); + trackSelection.add("sip3dValMax", 99999.9); + trackSelection.add("min_pT_dRcut", 0.5); + trackSelection.add("jetDeltaRMax", 0.3); + trackSelection.add("pixelHitsMin", 2); + trackSelection.add("sip3dSigMin", -99999.9); + trackSelection.add("sip2dSigMin", -99999.9); + desc.add("trackSelection", trackSelection); + } + + edm::ParameterSetDescription trackPairV0Filter; + trackPairV0Filter.add("k0sMassWindow", 0.03); + desc.add("trackPairV0Filter", trackPairV0Filter); + + edm::ParameterSetDescription pseudoVertexV0Filter; + pseudoVertexV0Filter.add("k0sMassWindow", 0.05); + desc.add("pseudoVertexV0Filter", pseudoVertexV0Filter); + + desc.add("trackFlip", false); + desc.add("useTrackWeights", true); + desc.add("SoftLeptonFlip", false); + desc.add("pseudoMultiplicityMin", 2); + desc.add("correctVertexMass", true); + desc.add("minimumTrackWeight", 0.5); + desc.add("charmCut", 1.5); + desc.add("trackSort", "sip2dSig"); + desc.add("trackMultiplicityMin", 2); + desc.add("vertexFlip", false); +} diff --git a/RecoJets/JetAssociationProducers/src/JetTracksAssociatorAtVertex.cc b/RecoJets/JetAssociationProducers/src/JetTracksAssociatorAtVertex.cc index 96792a2059b32..b9d428a31bcee 100644 --- a/RecoJets/JetAssociationProducers/src/JetTracksAssociatorAtVertex.cc +++ b/RecoJets/JetAssociationProducers/src/JetTracksAssociatorAtVertex.cc @@ -16,21 +16,27 @@ #include "JetTracksAssociatorAtVertex.h" JetTracksAssociatorAtVertex::JetTracksAssociatorAtVertex(const edm::ParameterSet& fConfig) - : mAssociator(fConfig.getParameter("coneSize")), + : mJets{consumes >(fConfig.getParameter("jets"))}, + mTracks{consumes(fConfig.getParameter("tracks"))}, + mAssociator(fConfig.getParameter("coneSize")), mAssociatorAssigned(fConfig.getParameter("coneSize")), - useAssigned(false), + useAssigned(fConfig.getParameter("useAssigned")), pvSrc() { - mJets = consumes >(fConfig.getParameter("jets")); - mTracks = consumes(fConfig.getParameter("tracks")); - if (fConfig.exists("useAssigned")) { - useAssigned = fConfig.getParameter("useAssigned"); + if (useAssigned) { pvSrc = consumes(fConfig.getParameter("pvSrc")); } - produces(); } -JetTracksAssociatorAtVertex::~JetTracksAssociatorAtVertex() {} +void JetTracksAssociatorAtVertex::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add("jets", edm::InputTag("")); + desc.add("tracks", edm::InputTag("generalTracks")); + desc.add("coneSize", 0.4); + desc.add("useAssigned", false); + desc.add("pvSrc", edm::InputTag("offlinePrimaryVertices")); + descriptions.addWithDefaultLabel(desc); +} void JetTracksAssociatorAtVertex::produce(edm::Event& fEvent, const edm::EventSetup& fSetup) { edm::Handle > jets_h; diff --git a/RecoJets/JetAssociationProducers/src/JetTracksAssociatorAtVertex.h b/RecoJets/JetAssociationProducers/src/JetTracksAssociatorAtVertex.h index f88dc2da108db..fcc984270ec87 100644 --- a/RecoJets/JetAssociationProducers/src/JetTracksAssociatorAtVertex.h +++ b/RecoJets/JetAssociationProducers/src/JetTracksAssociatorAtVertex.h @@ -8,29 +8,30 @@ #ifndef JetTracksAssociatorAtVertex_h #define JetTracksAssociatorAtVertex_h -#include "FWCore/Framework/interface/stream/EDProducer.h" #include "DataFormats/Common/interface/EDProductfwd.h" -#include "FWCore/Utilities/interface/InputTag.h" +#include "FWCore/Framework/interface/stream/EDProducer.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" - +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" +#include "FWCore/Utilities/interface/InputTag.h" #include "RecoJets/JetAssociationAlgorithms/interface/JetTracksAssociationDRVertex.h" #include "RecoJets/JetAssociationAlgorithms/interface/JetTracksAssociationDRVertexAssigned.h" class JetTracksAssociatorAtVertex : public edm::stream::EDProducer<> { public: JetTracksAssociatorAtVertex(const edm::ParameterSet&); - ~JetTracksAssociatorAtVertex() override; + ~JetTracksAssociatorAtVertex() override = default; + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); void produce(edm::Event&, const edm::EventSetup&) override; private: - edm::EDGetTokenT> mJets; - edm::EDGetTokenT mTracks; + const edm::EDGetTokenT> mJets; + const edm::EDGetTokenT mTracks; - int mTrackQuality; - JetTracksAssociationDRVertex mAssociator; - JetTracksAssociationDRVertexAssigned mAssociatorAssigned; - bool useAssigned; /// if true, use the track/jet association with vertex assignment to tracks + const JetTracksAssociationDRVertex mAssociator; + const JetTracksAssociationDRVertexAssigned mAssociatorAssigned; + const bool useAssigned; /// if true, use the track/jet association with vertex assignment to tracks edm::EDGetTokenT pvSrc; /// if useAssigned, will read this PV collection. }; diff --git a/RecoJets/JetProducers/plugins/FixedGridRhoProducerFastjet.cc b/RecoJets/JetProducers/plugins/FixedGridRhoProducerFastjet.cc index 2a18ccd409991..d8f3707231bb7 100644 --- a/RecoJets/JetProducers/plugins/FixedGridRhoProducerFastjet.cc +++ b/RecoJets/JetProducers/plugins/FixedGridRhoProducerFastjet.cc @@ -1,21 +1,38 @@ -#include "RecoJets/JetProducers/plugins/FixedGridRhoProducerFastjet.h" -#include "FWCore/Framework/interface/Event.h" #include "DataFormats/Common/interface/View.h" -#include "FWCore/Framework/interface/MakerMacros.h" #include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h" +#include "DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/Frameworkfwd.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/Framework/interface/stream/EDProducer.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" +#include "fastjet/tools/GridMedianBackgroundEstimator.hh" + +class FixedGridRhoProducerFastjet : public edm::stream::EDProducer<> { +public: + explicit FixedGridRhoProducerFastjet(const edm::ParameterSet& iConfig); + ~FixedGridRhoProducerFastjet() override = default; + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + +private: + void produce(edm::Event&, const edm::EventSetup&) override; + + fastjet::GridMedianBackgroundEstimator bge_; + const edm::InputTag pfCandidatesTag_; + const edm::EDGetTokenT > input_pfcoll_token_; +}; using namespace std; FixedGridRhoProducerFastjet::FixedGridRhoProducerFastjet(const edm::ParameterSet& iConfig) - : bge_(iConfig.getParameter("maxRapidity"), iConfig.getParameter("gridSpacing")) { - pfCandidatesTag_ = iConfig.getParameter("pfCandidatesTag"); + : bge_(iConfig.getParameter("maxRapidity"), iConfig.getParameter("gridSpacing")), + pfCandidatesTag_{iConfig.getParameter("pfCandidatesTag")}, + input_pfcoll_token_{consumes >(pfCandidatesTag_)} { produces(); - - input_pfcoll_token_ = consumes >(pfCandidatesTag_); } -FixedGridRhoProducerFastjet::~FixedGridRhoProducerFastjet() {} - void FixedGridRhoProducerFastjet::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { edm::Handle > pfColl; iEvent.getByToken(input_pfcoll_token_, pfColl); @@ -28,4 +45,12 @@ void FixedGridRhoProducerFastjet::produce(edm::Event& iEvent, const edm::EventSe iEvent.put(std::make_unique(bge_.rho())); } +void FixedGridRhoProducerFastjet::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add("maxRapidity", 5.0); + desc.add("gridSpacing", 0.55); + desc.add("pfCandidatesTag", edm::InputTag("")); + descriptions.add("default_FixedGridRhoProducerFastjet", desc); +} + DEFINE_FWK_MODULE(FixedGridRhoProducerFastjet); diff --git a/RecoJets/JetProducers/plugins/FixedGridRhoProducerFastjet.h b/RecoJets/JetProducers/plugins/FixedGridRhoProducerFastjet.h deleted file mode 100644 index a28ef9fd2b999..0000000000000 --- a/RecoJets/JetProducers/plugins/FixedGridRhoProducerFastjet.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef RecoJets_JetProducers_plugins_FixedGridRhoProducerFastjet_h -#define RecoJets_JetProducers_plugins_FixedGridRhoProducerFastjet_h - -#include "FWCore/Framework/interface/stream/EDProducer.h" -#include "FWCore/Framework/interface/Frameworkfwd.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h" -#include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h" -#include "fastjet/tools/GridMedianBackgroundEstimator.hh" - -class FixedGridRhoProducerFastjet : public edm::stream::EDProducer<> { -public: - explicit FixedGridRhoProducerFastjet(const edm::ParameterSet& iConfig); - ~FixedGridRhoProducerFastjet() override; - -private: - void produce(edm::Event&, const edm::EventSetup&) override; - - edm::InputTag pfCandidatesTag_; - fastjet::GridMedianBackgroundEstimator bge_; - - edm::EDGetTokenT > input_pfcoll_token_; -}; - -#endif diff --git a/RecoJets/JetProducers/python/fixedGridRhoProducerFastjet_cfi.py b/RecoJets/JetProducers/python/fixedGridRhoProducerFastjet_cfi.py index 984b7d9714c1c..dce3a663e1d57 100644 --- a/RecoJets/JetProducers/python/fixedGridRhoProducerFastjet_cfi.py +++ b/RecoJets/JetProducers/python/fixedGridRhoProducerFastjet_cfi.py @@ -1,19 +1,10 @@ import FWCore.ParameterSet.Config as cms - -fixedGridRhoFastjetAll = cms.EDProducer("FixedGridRhoProducerFastjet", - pfCandidatesTag = cms.InputTag("particleFlow"), - maxRapidity = cms.double(5.0), - gridSpacing = cms.double(0.55) +from RecoJets.JetProducers.default_FixedGridRhoProducerFastjet_cfi import default_FixedGridRhoProducerFastjet +fixedGridRhoFastjetAll = default_FixedGridRhoProducerFastjet.clone( + pfCandidatesTag = "particleFlow" ) - -fixedGridRhoFastjetAllCalo = cms.EDProducer("FixedGridRhoProducerFastjet", - pfCandidatesTag = cms.InputTag("towerMaker"), - maxRapidity = cms.double(5.0), - gridSpacing = cms.double(0.55) +fixedGridRhoFastjetAllCalo = default_FixedGridRhoProducerFastjet.clone( + pfCandidatesTag = "towerMaker" ) - - - - diff --git a/RecoMuon/L2MuonProducer/plugins/L2MuonCandidateProducer.cc b/RecoMuon/L2MuonProducer/plugins/L2MuonCandidateProducer.cc index 6e8de309b18be..eca91367b808e 100644 --- a/RecoMuon/L2MuonProducer/plugins/L2MuonCandidateProducer.cc +++ b/RecoMuon/L2MuonProducer/plugins/L2MuonCandidateProducer.cc @@ -26,7 +26,9 @@ #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/interface/global/EDProducer.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" #include "FWCore/Utilities/interface/InputTag.h" class L2MuonCandidateProducer : public edm::global::EDProducer<> { @@ -40,22 +42,31 @@ class L2MuonCandidateProducer : public edm::global::EDProducer<> { /// produce candidates void produce(edm::StreamID sid, edm::Event& event, const edm::EventSetup&) const override; + /// fillDescriptions + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + private: // StandAlone Collection Label - edm::InputTag theSACollectionLabel; - edm::EDGetTokenT tracksToken; + const edm::InputTag theSACollectionLabel; + const edm::EDGetTokenT tracksToken; }; /// constructor with config -L2MuonCandidateProducer::L2MuonCandidateProducer(const edm::ParameterSet& parameterSet) { +L2MuonCandidateProducer::L2MuonCandidateProducer(const edm::ParameterSet& parameterSet) + : // StandAlone Collection Label + theSACollectionLabel{parameterSet.getParameter("InputObjects")}, + tracksToken{consumes(theSACollectionLabel)} { LogTrace("Muon|RecoMuon|L2MuonCandidateProducer") << " constructor called"; - - // StandAlone Collection Label - theSACollectionLabel = parameterSet.getParameter("InputObjects"); - tracksToken = consumes(theSACollectionLabel); produces(); } +void L2MuonCandidateProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add("InputObjects", edm::InputTag("L2Muons", "UpdatedAtVtx")) + ->setComment("Standalone Collection Label"); + descriptions.addWithDefaultLabel(desc); +} + /// destructor L2MuonCandidateProducer::~L2MuonCandidateProducer() { LogTrace("Muon|RecoMuon|L2MuonCandidateProducer") << " L2MuonCandidateProducer destructor called"; diff --git a/RecoMuon/L3MuonProducer/src/L3MuonCandidateProducer.cc b/RecoMuon/L3MuonProducer/src/L3MuonCandidateProducer.cc index 4fd42ab3e6f67..7d881156e08b8 100644 --- a/RecoMuon/L3MuonProducer/src/L3MuonCandidateProducer.cc +++ b/RecoMuon/L3MuonProducer/src/L3MuonCandidateProducer.cc @@ -41,39 +41,45 @@ static const char category[] = "Muon|RecoMuon|L3MuonCandidateProducer"; /// constructor with config L3MuonCandidateProducer::L3MuonCandidateProducer(const ParameterSet& parameterSet) { - LogTrace(category) << " constructor called"; + LogTrace(category) << "Constructor called"; // StandAlone Collection Label theL3CollectionLabel = parameterSet.getParameter("InputObjects"); trackToken_ = consumes(theL3CollectionLabel); - // use links - theUseLinks = parameterSet.existsAs("InputLinksObjects"); + // Use links + theL3LinksLabel = parameterSet.getParameter("InputLinksObjects"); + theUseLinks = !theL3LinksLabel.label().empty() && theL3LinksLabel.label() != "unused"; if (theUseLinks) { - theL3LinksLabel = parameterSet.getParameter("InputLinksObjects"); linkToken_ = consumes(theL3LinksLabel); - if (theL3LinksLabel.label().empty() or theL3LinksLabel.label() == "unused") - theUseLinks = false; } - // use global, standalone or tracker pT/4-vector assignment - const std::string& muon_track_for_momentum = parameterSet.existsAs("MuonPtOption") - ? parameterSet.getParameter("MuonPtOption") - : "Global"; - if (muon_track_for_momentum == std::string("Tracker")) + // Use global, standalone or tracker pT/4-vector assignment + const std::string& muon_track_for_momentum = parameterSet.getParameter("MuonPtOption"); + if (muon_track_for_momentum == "Tracker") theType = InnerTrack; - else if (muon_track_for_momentum == std::string("Standalone")) + else if (muon_track_for_momentum == "Standalone") theType = OuterTrack; - else if (muon_track_for_momentum == std::string("Global")) + else if (muon_track_for_momentum == "Global") theType = CombinedTrack; else { - LogError(category) << "invalid value for MuonPtOption, please choose among 'Tracker', 'Standalone', 'Global'"; + LogError(category) << "Invalid value for MuonPtOption, please choose among 'Tracker', 'Standalone', 'Global'"; theType = CombinedTrack; } produces(); } +/// fillDescriptions +void L3MuonCandidateProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add("InputObjects", edm::InputTag("L3Muons"))->setComment("Input tag for L3 muon tracks"); + desc.add("InputLinksObjects", edm::InputTag("unused"))->setComment("Input tag for track links"); + desc.add("MuonPtOption", "Global") + ->setComment("Option to determine muon momentum: 'Tracker', 'Standalone', or 'Global'"); + descriptions.addWithDefaultLabel(desc); +} + /// destructor L3MuonCandidateProducer::~L3MuonCandidateProducer() { LogTrace(category) << " L3MuonCandidateProducer destructor called"; diff --git a/RecoMuon/L3MuonProducer/src/L3MuonCandidateProducer.h b/RecoMuon/L3MuonProducer/src/L3MuonCandidateProducer.h index c7c1e7801ad84..8732fc9ed1de2 100644 --- a/RecoMuon/L3MuonProducer/src/L3MuonCandidateProducer.h +++ b/RecoMuon/L3MuonProducer/src/L3MuonCandidateProducer.h @@ -18,12 +18,14 @@ * \author J.Alcaraz */ -#include "FWCore/Framework/interface/global/EDProducer.h" -#include "FWCore/Utilities/interface/InputTag.h" +#include "DataFormats/MuonReco/interface/MuonFwd.h" +#include "DataFormats/MuonReco/interface/MuonTrackLinks.h" #include "DataFormats/TrackReco/interface/Track.h" #include "DataFormats/TrackReco/interface/TrackFwd.h" -#include "DataFormats/MuonReco/interface/MuonTrackLinks.h" -#include "DataFormats/MuonReco/interface/MuonFwd.h" +#include "FWCore/Framework/interface/global/EDProducer.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" +#include "FWCore/Utilities/interface/InputTag.h" namespace edm { class ParameterSet; @@ -44,6 +46,8 @@ class L3MuonCandidateProducer : public edm::global::EDProducer<> { /// produce candidates void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override; + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + private: // L3/GLB Collection Label edm::InputTag theL3CollectionLabel; diff --git a/RecoMuon/MuonIdentification/plugins/MuonLinksProducer.cc b/RecoMuon/MuonIdentification/plugins/MuonLinksProducer.cc index 9b14683206e5a..f36a7ec7c6d15 100644 --- a/RecoMuon/MuonIdentification/plugins/MuonLinksProducer.cc +++ b/RecoMuon/MuonIdentification/plugins/MuonLinksProducer.cc @@ -9,31 +9,25 @@ // // system include files +#include #include // user include files -#include "FWCore/Framework/interface/Frameworkfwd.h" - +#include "DataFormats/Common/interface/Handle.h" +#include "DataFormats/MuonReco/interface/MuonTrackLinks.h" +#include "DataFormats/TrackReco/interface/Track.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" - +#include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" - -#include "DataFormats/Common/interface/Handle.h" -#include "DataFormats/TrackReco/interface/Track.h" -#include "DataFormats/MuonReco/interface/MuonTrackLinks.h" #include "RecoMuon/MuonIdentification/plugins/MuonLinksProducer.h" -#include - -MuonLinksProducer::MuonLinksProducer(const edm::ParameterSet& iConfig) { +MuonLinksProducer::MuonLinksProducer(const edm::ParameterSet& iConfig) + : m_inputCollection{iConfig.getParameter("inputCollection")}, + muonToken_{consumes(m_inputCollection)} { produces(); - m_inputCollection = iConfig.getParameter("inputCollection"); - muonToken_ = consumes(m_inputCollection); } -MuonLinksProducer::~MuonLinksProducer() {} - void MuonLinksProducer::produce(edm::StreamID, edm::Event& iEvent, const edm::EventSetup& iSetup) const { auto output = std::make_unique(); edm::Handle muons; @@ -46,3 +40,9 @@ void MuonLinksProducer::produce(edm::StreamID, edm::Event& iEvent, const edm::Ev } iEvent.put(std::move(output)); } + +void MuonLinksProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add("inputCollection", edm::InputTag("muons", "", "@skipCurrentProcess")); + descriptions.addWithDefaultLabel(desc); +} diff --git a/RecoMuon/MuonIdentification/plugins/MuonLinksProducer.h b/RecoMuon/MuonIdentification/plugins/MuonLinksProducer.h index e5bd1f9200966..a9c962f49db04 100644 --- a/RecoMuon/MuonIdentification/plugins/MuonLinksProducer.h +++ b/RecoMuon/MuonIdentification/plugins/MuonLinksProducer.h @@ -17,23 +17,26 @@ // // user include files +#include "DataFormats/MuonReco/interface/Muon.h" +#include "DataFormats/MuonReco/interface/MuonFwd.h" +#include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/global/EDProducer.h" -#include "FWCore/Framework/interface/Event.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "DataFormats/MuonReco/interface/MuonFwd.h" -#include "DataFormats/MuonReco/interface/Muon.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" class MuonLinksProducer : public edm::global::EDProducer<> { public: explicit MuonLinksProducer(const edm::ParameterSet&); - - ~MuonLinksProducer() override; + ~MuonLinksProducer() override = default; void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override; + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + private: - edm::InputTag m_inputCollection; - edm::EDGetTokenT muonToken_; + const edm::InputTag m_inputCollection; + const edm::EDGetTokenT muonToken_; }; #endif diff --git a/RecoMuon/MuonIdentification/plugins/MuonLinksProducerForHLT.cc b/RecoMuon/MuonIdentification/plugins/MuonLinksProducerForHLT.cc index 3f2909502ad4b..f22105b688f91 100644 --- a/RecoMuon/MuonIdentification/plugins/MuonLinksProducerForHLT.cc +++ b/RecoMuon/MuonIdentification/plugins/MuonLinksProducerForHLT.cc @@ -8,31 +8,23 @@ // user include files #include "FWCore/Framework/interface/Frameworkfwd.h" - #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" - #include "FWCore/ParameterSet/interface/ParameterSet.h" - #include "DataFormats/Common/interface/Handle.h" #include "RecoMuon/MuonIdentification/plugins/MuonLinksProducerForHLT.h" -//#include - -MuonLinksProducerForHLT::MuonLinksProducerForHLT(const edm::ParameterSet& iConfig) { +MuonLinksProducerForHLT::MuonLinksProducerForHLT(const edm::ParameterSet& iConfig) + : theLinkCollectionInInput_{iConfig.getParameter("LinkCollection")}, + theInclusiveTrackCollectionInInput_{iConfig.getParameter("InclusiveTrackerTrackCollection")}, + linkToken_{consumes(theLinkCollectionInInput_)}, + trackToken_{consumes(theInclusiveTrackCollectionInInput_)}, + ptMin_{iConfig.getParameter("ptMin")}, + pMin_{iConfig.getParameter("pMin")}, + shareHitFraction_{iConfig.getParameter("shareHitFraction")} { produces(); - theLinkCollectionInInput = iConfig.getParameter("LinkCollection"); - theInclusiveTrackCollectionInInput = iConfig.getParameter("InclusiveTrackerTrackCollection"); - ptMin = iConfig.getParameter("ptMin"); - pMin = iConfig.getParameter("pMin"); - shareHitFraction = iConfig.getParameter("shareHitFraction"); - - linkToken_ = consumes(theLinkCollectionInInput); - trackToken_ = consumes(theInclusiveTrackCollectionInInput); } -MuonLinksProducerForHLT::~MuonLinksProducerForHLT() {} - void MuonLinksProducerForHLT::produce(edm::StreamID, edm::Event& iEvent, const edm::EventSetup& iSetup) const { auto output = std::make_unique(); @@ -48,9 +40,9 @@ void MuonLinksProducerForHLT::produce(edm::StreamID, edm::Event& iEvent, const e unsigned int muonTrackHits = link->trackerTrack()->extra()->recHitsSize(); for (reco::TrackCollection::const_iterator track = incTracks->begin(); track != incTracks->end(); ++track, ++trackIndex) { - if (track->pt() < ptMin) + if (track->pt() < ptMin_) continue; - if (track->p() < pMin) + if (track->p() < pMin_) continue; //std::cout << "pt (muon/track) " << link->trackerTrack()->pt() << " " << track->pt() << std::endl; unsigned trackHits = track->extra()->recHitsSize(); @@ -70,7 +62,7 @@ void MuonLinksProducerForHLT::produce(edm::StreamID, edm::Event& iEvent, const e } double fraction = (double)numberOfCommonDetIds / smallestNumberOfHits; // std::cout << "Overlap/Smallest/fraction = " << numberOfCommonDetIds << " " << smallestNumberOfHits << " " << fraction << std::endl; - if (fraction > shareHitFraction) { + if (fraction > shareHitFraction_) { output->push_back( reco::MuonTrackLinks(reco::TrackRef(incTracks, trackIndex), link->standAloneTrack(), link->globalTrack())); found = true; @@ -82,3 +74,13 @@ void MuonLinksProducerForHLT::produce(edm::StreamID, edm::Event& iEvent, const e } iEvent.put(std::move(output)); } + +void MuonLinksProducerForHLT::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add("LinkCollection", edm::InputTag("hltPFMuonMerging")); + desc.add("InclusiveTrackerTrackCollection", edm::InputTag("hltL3MuonsLinksCombination")); + desc.add("ptMin", 2.5); + desc.add("pMin", 2.5); + desc.add("shareHitFraction", 0.80); + descriptions.addWithDefaultLabel(desc); +} diff --git a/RecoMuon/MuonIdentification/plugins/MuonLinksProducerForHLT.h b/RecoMuon/MuonIdentification/plugins/MuonLinksProducerForHLT.h index ceea901b78390..3e0f8b25d769f 100644 --- a/RecoMuon/MuonIdentification/plugins/MuonLinksProducerForHLT.h +++ b/RecoMuon/MuonIdentification/plugins/MuonLinksProducerForHLT.h @@ -11,31 +11,33 @@ */ // user include files +#include "DataFormats/MuonReco/interface/MuonFwd.h" +#include "DataFormats/MuonReco/interface/MuonTrackLinks.h" +#include "DataFormats/TrackReco/interface/Track.h" +#include "DataFormats/TrackReco/interface/TrackFwd.h" +#include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/global/EDProducer.h" -#include "FWCore/Framework/interface/Event.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "DataFormats/TrackReco/interface/TrackFwd.h" -#include "DataFormats/TrackReco/interface/Track.h" -#include "DataFormats/MuonReco/interface/MuonFwd.h" -//#include "DataFormats/MuonReco/interface/Muon.h" -#include "DataFormats/MuonReco/interface/MuonTrackLinks.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" class MuonLinksProducerForHLT : public edm::global::EDProducer<> { public: explicit MuonLinksProducerForHLT(const edm::ParameterSet&); - - ~MuonLinksProducerForHLT() override; + ~MuonLinksProducerForHLT() override = default; void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override; + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); + private: - edm::InputTag theLinkCollectionInInput; - edm::InputTag theInclusiveTrackCollectionInInput; - edm::EDGetTokenT linkToken_; - edm::EDGetTokenT trackToken_; - double ptMin; - double pMin; - double shareHitFraction; + const edm::InputTag theLinkCollectionInInput_; + const edm::InputTag theInclusiveTrackCollectionInInput_; + const edm::EDGetTokenT linkToken_; + const edm::EDGetTokenT trackToken_; + const double ptMin_; + const double pMin_; + const double shareHitFraction_; }; #endif diff --git a/RecoMuon/MuonIdentification/python/links_cfi.py b/RecoMuon/MuonIdentification/python/links_cfi.py index bca452e03a8a3..3f790cbb3f74c 100644 --- a/RecoMuon/MuonIdentification/python/links_cfi.py +++ b/RecoMuon/MuonIdentification/python/links_cfi.py @@ -1,5 +1,7 @@ import FWCore.ParameterSet.Config as cms -globalMuonLinks = cms.EDProducer("MuonLinksProducer", + +from RecoMuon.MuonIdentificationp.muonLinksProducer_cfi import muonLinksProducer +globalMuonLinks = muonLinksProducer.clone( inputCollection = cms.InputTag("muons","","@skipCurrentProcess") ) diff --git a/RecoMuon/TrackerSeedGenerator/plugins/CollectionCombiner.h b/RecoMuon/TrackerSeedGenerator/plugins/CollectionCombiner.h index 14095633eb35e..a6d802e0b636f 100644 --- a/RecoMuon/TrackerSeedGenerator/plugins/CollectionCombiner.h +++ b/RecoMuon/TrackerSeedGenerator/plugins/CollectionCombiner.h @@ -22,12 +22,16 @@ #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" template class CollectionCombiner : public edm::global::EDProducer<> { public: explicit CollectionCombiner(const edm::ParameterSet&); - ~CollectionCombiner() override; + ~CollectionCombiner() override = default; + + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); private: void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override; @@ -44,8 +48,6 @@ CollectionCombiner::CollectionCombiner(const edm::ParameterSet& iCon for (unsigned int i = 0; i < labels.size(); ++i) collectionTokens.push_back(consumes(labels.at(i))); } -template -CollectionCombiner::~CollectionCombiner() {} template void CollectionCombiner::produce(edm::StreamID, edm::Event& iEvent, const edm::EventSetup& es) const { @@ -59,4 +61,11 @@ void CollectionCombiner::produce(edm::StreamID, edm::Event& iEvent, iEvent.put(std::move(merged)); } +template +void CollectionCombiner::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + desc.add >("labels", {}); + descriptions.addWithDefaultLabel(desc); +} + #endif diff --git a/RecoTracker/FinalTrackSelectors/plugins/AnalyticalTrackSelector.cc b/RecoTracker/FinalTrackSelectors/plugins/AnalyticalTrackSelector.cc index 23ec80416ac60..aedf76cf9066b 100644 --- a/RecoTracker/FinalTrackSelectors/plugins/AnalyticalTrackSelector.cc +++ b/RecoTracker/FinalTrackSelectors/plugins/AnalyticalTrackSelector.cc @@ -13,20 +13,22 @@ #include #include #include -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/Utilities/interface/InputTag.h" -#include "DataFormats/TrackReco/interface/TrackFwd.h" +#include "CommonTools/Utils/interface/StringCutObjectSelector.h" +#include "DataFormats/BeamSpot/interface/BeamSpot.h" #include "DataFormats/TrackReco/interface/Track.h" #include "DataFormats/TrackReco/interface/TrackExtra.h" -#include "DataFormats/VertexReco/interface/VertexFwd.h" +#include "DataFormats/TrackReco/interface/TrackFwd.h" +#include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit1D.h" #include "DataFormats/VertexReco/interface/Vertex.h" -#include "DataFormats/BeamSpot/interface/BeamSpot.h" -#include "TrackingTools/PatternTools/interface/Trajectory.h" +#include "DataFormats/VertexReco/interface/VertexFwd.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" +#include "FWCore/Utilities/interface/InputTag.h" #include "TrackingTools/PatternTools/interface/TrajTrackAssociation.h" -#include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit1D.h" -#include "CommonTools/Utils/interface/StringCutObjectSelector.h" +#include "TrackingTools/PatternTools/interface/Trajectory.h" #include "MultiTrackSelector.h" @@ -38,7 +40,9 @@ class dso_hidden AnalyticalTrackSelector final : public MultiTrackSelector { /// constructor explicit AnalyticalTrackSelector(const edm::ParameterSet& cfg); /// destructor - ~AnalyticalTrackSelector() override; + ~AnalyticalTrackSelector() override = default; + /// fillDescriptions + static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); private: typedef math::XYZPoint Point; @@ -101,10 +105,8 @@ AnalyticalTrackSelector::AnalyticalTrackSelector(const edm::ParameterSet& cfg) : produces>("MVAVals"); //foward compatibility produces("MVAValues"); - useAnyMVA_ = false; forest_[0] = nullptr; - if (cfg.exists("useAnyMVA")) - useAnyMVA_ = cfg.getParameter("useAnyMVA"); + useAnyMVA_ = cfg.getParameter("useAnyMVA"); src_ = consumes(cfg.getParameter("src")); hSrc_ = consumes(cfg.getParameter("src")); @@ -146,16 +148,14 @@ AnalyticalTrackSelector::AnalyticalTrackSelector(const edm::ParameterSet& cfg) : min_hits_bypass_.push_back(cfg.getParameter("minHitsToBypassChecks")); max_relpterr_.push_back(cfg.getParameter("max_relpterr")); min_nhits_.push_back(cfg.getParameter("min_nhits")); - max_minMissHitOutOrIn_.push_back( - cfg.existsAs("max_minMissHitOutOrIn") ? cfg.getParameter("max_minMissHitOutOrIn") : 99); - max_lostHitFraction_.push_back( - cfg.existsAs("max_lostHitFraction") ? cfg.getParameter("max_lostHitFraction") : 1.0); + max_minMissHitOutOrIn_.push_back(cfg.getParameter("max_minMissHitOutOrIn")); + max_lostHitFraction_.push_back(cfg.getParameter("max_lostHitFraction")); min_eta_.push_back(cfg.getParameter("min_eta")); max_eta_.push_back(cfg.getParameter("max_eta")); // Flag to apply absolute cuts if no PV passes the selection applyAbsCutsIfNoPV_.push_back(cfg.getParameter("applyAbsCutsIfNoPV")); - keepAllTracks_.push_back(cfg.exists("keepAllTracks") ? cfg.getParameter("keepAllTracks") : false); + keepAllTracks_.push_back(cfg.getParameter("keepAllTracks")); setQualityBit_.push_back(false); std::string qualityStr = cfg.getParameter("qualityBit"); @@ -165,12 +165,9 @@ AnalyticalTrackSelector::AnalyticalTrackSelector(const edm::ParameterSet& cfg) : throw; } - if (cfg.exists("qualityBit")) { - std::string qualityStr = cfg.getParameter("qualityBit"); - if (!qualityStr.empty()) { - setQualityBit_[0] = true; - qualityToSet_[0] = TrackBase::qualityByName(cfg.getParameter("qualityBit")); - } + if (!qualityStr.empty()) { + setQualityBit_[0] = true; + qualityToSet_[0] = TrackBase::qualityByName(cfg.getParameter("qualityBit")); } if (keepAllTracks_[0] && !setQualityBit_[0]) @@ -189,19 +186,14 @@ AnalyticalTrackSelector::AnalyticalTrackSelector(const edm::ParameterSet& cfg) : } if (useAnyMVA_) { - bool thisMVA = false; - if (cfg.exists("useMVA")) - thisMVA = cfg.getParameter("useMVA"); + bool thisMVA = cfg.getParameter("useMVA"); useMVA_.push_back(thisMVA); if (thisMVA) { - double minVal = -1; - if (cfg.exists("minMVA")) - minVal = cfg.getParameter("minMVA"); + double minVal = cfg.getParameter("minMVA"); min_MVA_.push_back(minVal); - mvaType_.push_back(cfg.exists("mvaType") ? cfg.getParameter("mvaType") : "Detached"); - forestLabel_.push_back(cfg.exists("GBRForestLabel") ? cfg.getParameter("GBRForestLabel") - : "MVASelectorIter0"); - useMVAonly_.push_back(cfg.exists("useMVAonly") ? cfg.getParameter("useMVAonly") : false); + mvaType_.push_back(cfg.getParameter("mvaType")); + forestLabel_.push_back(cfg.getParameter("GBRForestLabel")); + useMVAonly_.push_back(cfg.getParameter("useMVAonly")); } else { min_MVA_.push_back(-9999.0); useMVAonly_.push_back(false); @@ -231,8 +223,6 @@ AnalyticalTrackSelector::AnalyticalTrackSelector(const edm::ParameterSet& cfg) : produces().setBranchAlias(alias + "Tracks"); } -AnalyticalTrackSelector::~AnalyticalTrackSelector() {} - void AnalyticalTrackSelector::run(edm::Event& evt, const edm::EventSetup& es) const { // storage.... std::unique_ptr selTracks_; @@ -397,6 +387,76 @@ void AnalyticalTrackSelector::run(edm::Event& evt, const edm::EventSetup& es) co } } +void AnalyticalTrackSelector::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { + edm::ParameterSetDescription desc; + + desc.add("src", edm::InputTag("generalTracks")); + desc.add("keepAllTracks", false) + ->setComment("if set to true tracks failing this filter are kept in the output"); + desc.add("beamspot", edm::InputTag("offlineBeamSpot")); + + // vertex selection + desc.add("useVertices", true); + desc.add("useVtxError", false); + desc.add("vertices", edm::InputTag("firstStepPrimaryVertices")); + desc.add("vtxNumber", -1); + desc.add("vertexCut", "ndof>=2&!isFake"); + + desc.addUntracked("copyExtras", false); + desc.addUntracked("copyTrajectories", false); + desc.add("qualityBit", std::string(""))->setComment("set to ''if you don't want to set the bit"); + + // parameters for adapted optimal cuts on chi2 and primary vertex compatibility + desc.add("chi2n_no1Dmod_par", 9999.) + ->setComment("parameter for adapted optimal cuts on chi2 and primary vertex compatibility"); + desc.add("chi2n_par", 1.6) + ->setComment("parameter for adapted optimal cuts on chi2 and primary vertex compatibility"); + desc.add>("res_par", {0.003, 0.01})->setComment("default: Loose"); + desc.add>("d0_par1", {0.55, 4.0})->setComment("default: Loose"); + desc.add>("d0_par2", {0.65, 4.0})->setComment("default: Loose"); + desc.add>("dz_par1", {0.55, 4.0})->setComment("default: Loose"); + desc.add>("dz_par2", {0.45, 4.0})->setComment("default: Loose"); + desc.add("applyAdaptedPVCuts", true) + ->setComment("Boolean indicating if adapted primary vertex compatibility cuts are to be applied."); + + // Impact parameter absolute cuts. + desc.add("max_d0", 100.)->setComment("transverse impact parameter absolute cut"); + desc.add("max_z0", 100.)->setComment("longitudinal impact parameter absolute cut"); + desc.add("nSigmaZ", 4.); + + // Cuts on numbers of layers with hits/3D hits/lost hits. + desc.add("minNumberLayers", 0); + desc.add("minNumber3DLayers", 0); + desc.add("minHitsToBypassChecks", 20); + desc.add("maxNumberLostLayers", 999); + + // Absolute cuts in case of no PV. If yes, please define also max_d0NoPV and max_z0NoPV + desc.add("applyAbsCutsIfNoPV", false); + desc.add("max_d0NoPV", 100.); + desc.add("max_z0NoPV", 100.); + + // parameters for cutting on pterror/pt and number of valid hits + desc.add("max_relpterr", 9999)->setComment("parameter for cutting on pterror/pt"); + desc.add("min_nhits", 0)->setComment("parameter for cutting on number of valid hits"); + + desc.add("max_lostHitFraction", 1.0); + desc.add("max_minMissHitOutOrIn", 99); + + // parameters for cutting on eta + desc.add("max_eta", 9999.); + desc.add("min_eta", -9999.); + + // optional parameters for MVA selection + desc.add("useMVA", false); + desc.add("useAnyMVA", false); + desc.add("useMVAonly", false); + desc.add("minMVA", -1.); + desc.add("GBRForestLabel", "MVASelectorIter0"); + desc.add("mvaType", "Detached"); + + descriptions.addWithDefaultLabel(desc); +} + #include "FWCore/PluginManager/interface/ModuleDef.h" #include "FWCore/Framework/interface/MakerMacros.h" diff --git a/RecoVertex/AdaptiveVertexFinder/plugins/VertexMerger.cc b/RecoVertex/AdaptiveVertexFinder/plugins/VertexMerger.cc index 75e9c5729ce65..761e7c8f4f40d 100644 --- a/RecoVertex/AdaptiveVertexFinder/plugins/VertexMerger.cc +++ b/RecoVertex/AdaptiveVertexFinder/plugins/VertexMerger.cc @@ -1,22 +1,23 @@ #include #include -#include "FWCore/Framework/interface/stream/EDProducer.h" -#include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/MakerMacros.h" -#include "FWCore/Utilities/interface/InputTag.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" - +#include "DataFormats/Candidate/interface/VertexCompositePtrCandidate.h" #include "DataFormats/Common/interface/Handle.h" #include "DataFormats/TrackReco/interface/Track.h" #include "DataFormats/TrackReco/interface/TrackFwd.h" #include "DataFormats/VertexReco/interface/Vertex.h" #include "DataFormats/VertexReco/interface/VertexFwd.h" -#include "RecoVertex/VertexTools/interface/VertexDistance3D.h" -#include "RecoVertex/VertexTools/interface/SharedTracks.h" -#include "DataFormats/Candidate/interface/VertexCompositePtrCandidate.h" +#include "FWCore/Framework/interface/Event.h" +#include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/Framework/interface/stream/EDProducer.h" +#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" +#include "FWCore/Utilities/interface/InputTag.h" #include "RecoVertex/VertexPrimitives/interface/ConvertToFromReco.h" #include "RecoVertex/VertexPrimitives/interface/VertexState.h" +#include "RecoVertex/VertexTools/interface/SharedTracks.h" +#include "RecoVertex/VertexTools/interface/VertexDistance3D.h" template class TemplatedVertexMerger : public edm::stream::EDProducer<> { @@ -24,6 +25,7 @@ class TemplatedVertexMerger : public edm::stream::EDProducer<> { typedef std::vector Product; TemplatedVertexMerger(const edm::ParameterSet ¶ms); + static void fillDescriptions(edm::ConfigurationDescriptions &descriptions); void produce(edm::Event &event, const edm::EventSetup &es) override; private: @@ -77,6 +79,15 @@ void TemplatedVertexMerger::produce(edm::Event &event, const edm::EventSetu event.put(std::move(recoVertices)); } +template +void TemplatedVertexMerger::fillDescriptions(edm::ConfigurationDescriptions &descriptions) { + edm::ParameterSetDescription desc; + desc.add("maxFraction", 0.7); + desc.add("minSignificance", 2); + desc.add("secondaryVertices", edm::InputTag("inclusiveVertexFinder")); + descriptions.addWithDefaultLabel(desc); +} + typedef TemplatedVertexMerger VertexMerger; typedef TemplatedVertexMerger CandidateVertexMerger; diff --git a/RecoVertex/AdaptiveVertexFinder/python/vertexMerger_cfi.py b/RecoVertex/AdaptiveVertexFinder/python/vertexMerger_cfi.py deleted file mode 100644 index ffcab77d8863e..0000000000000 --- a/RecoVertex/AdaptiveVertexFinder/python/vertexMerger_cfi.py +++ /dev/null @@ -1,9 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -vertexMerger = cms.EDProducer("VertexMerger", - secondaryVertices = cms.InputTag("inclusiveVertexFinder"), - maxFraction = cms.double(0.7), - minSignificance = cms.double(2) -) - -