diff --git a/RecoLocalTracker/SiStripClusterizer/interface/ClusterChargeCut.h b/RecoLocalTracker/SiStripClusterizer/interface/ClusterChargeCut.h index a3d4d04a9c544..8423cdfab35b6 100644 --- a/RecoLocalTracker/SiStripClusterizer/interface/ClusterChargeCut.h +++ b/RecoLocalTracker/SiStripClusterizer/interface/ClusterChargeCut.h @@ -9,14 +9,17 @@ inline float clusterChargeCut(const edm::ParameterSet& conf, const char* name = } #include "FWCore/ParameterSet/interface/ParameterSetDescription.h" -inline edm::ParameterSetDescription getFilledConfigurationDescription4CCC() { +inline void fillPSetDescription4CCC(edm::ParameterSetDescription& iDesc){ // HLTSiStripClusterChargeCutNone: -1.0 // HLTSiStripClusterChargeCutTiny: 800.0 // HLTSiStripClusterChargeCutLoose: 1620.0 // HLTSiStripClusterChargeCutTight: 1945.0 + iDesc.add("value", 1620.0); +} +inline edm::ParameterSetDescription getFilledConfigurationDescription4CCC() { edm::ParameterSetDescription desc; - desc.add("value", 1620.0); + fillPSetDescription4CCC(desc); return desc; } diff --git a/RecoMuon/L3TrackFinder/interface/MuonCkfTrajectoryBuilder.h b/RecoMuon/L3TrackFinder/interface/MuonCkfTrajectoryBuilder.h index f4b205a6803c2..932d56d73cfc0 100644 --- a/RecoMuon/L3TrackFinder/interface/MuonCkfTrajectoryBuilder.h +++ b/RecoMuon/L3TrackFinder/interface/MuonCkfTrajectoryBuilder.h @@ -1,15 +1,19 @@ #ifndef RecoMuon_L3TrackFinder_MuonCkfTrajectoryBuilder_H #define RecoMuon_L3TrackFinder_MuonCkfTrajectoryBuilder_H -#include "RecoTracker/CkfPattern/interface/CkfTrajectoryBuilder.h" #include "FWCore/Framework/interface/ESWatcher.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" +#include "RecoTracker/CkfPattern/interface/CkfTrajectoryBuilder.h" class TrackingComponentsRecord; + class MuonCkfTrajectoryBuilder : public CkfTrajectoryBuilder { public: MuonCkfTrajectoryBuilder(const edm::ParameterSet& conf, edm::ConsumesCollector& iC); ~MuonCkfTrajectoryBuilder() override; + static void fillPSetDescription(edm::ParameterSetDescription& iDesc); + protected: void setEvent_(const edm::Event& iEvent, const edm::EventSetup& iSetup) override; diff --git a/RecoMuon/L3TrackFinder/plugins/SealModules.cc b/RecoMuon/L3TrackFinder/plugins/SealModules.cc index 289c2c32339e5..66528331f148f 100644 --- a/RecoMuon/L3TrackFinder/plugins/SealModules.cc +++ b/RecoMuon/L3TrackFinder/plugins/SealModules.cc @@ -1,8 +1,9 @@ #include "FWCore/Framework/interface/MakerMacros.h" +#include "FWCore/ParameterSet/interface/ValidatedPluginMacros.h" #include "RecoMuon/L3TrackFinder/interface/MuonCkfTrajectoryBuilder.h" #include "RecoTracker/CkfPattern/interface/BaseCkfTrajectoryBuilderFactory.h" #include "RecoMuon/L3TrackFinder/interface/HLTMuonL2SelectorForL3IO.h" -DEFINE_EDM_PLUGIN(BaseCkfTrajectoryBuilderFactory, MuonCkfTrajectoryBuilder, "MuonCkfTrajectoryBuilder"); +DEFINE_EDM_VALIDATED_PLUGIN(BaseCkfTrajectoryBuilderFactory, MuonCkfTrajectoryBuilder, "MuonCkfTrajectoryBuilder"); DEFINE_FWK_MODULE(HLTMuonL2SelectorForL3IO); diff --git a/RecoMuon/L3TrackFinder/src/MuonCkfTrajectoryBuilder.cc b/RecoMuon/L3TrackFinder/src/MuonCkfTrajectoryBuilder.cc index 74d68df5ac7d5..155858a169a6e 100644 --- a/RecoMuon/L3TrackFinder/src/MuonCkfTrajectoryBuilder.cc +++ b/RecoMuon/L3TrackFinder/src/MuonCkfTrajectoryBuilder.cc @@ -30,6 +30,15 @@ MuonCkfTrajectoryBuilder::MuonCkfTrajectoryBuilder(const edm::ParameterSet& conf MuonCkfTrajectoryBuilder::~MuonCkfTrajectoryBuilder() {} +void MuonCkfTrajectoryBuilder::fillPSetDescription(edm::ParameterSetDescription& iDesc){ + CkfTrajectoryBuilder::fillPSetDescription(iDesc); + iDesc.add("deltaEta"); + iDesc.add("deltaPhi"); + iDesc.add("propagatorProximity"); + iDesc.add("useSeedLayer"); + iDesc.add("rescaleErrorIfFail"); +} + void MuonCkfTrajectoryBuilder::setEvent_(const edm::Event& iEvent, const edm::EventSetup& iSetup) { CkfTrajectoryBuilder::setEvent_(iEvent, iSetup); diff --git a/RecoTracker/CkfPattern/interface/BaseCkfTrajectoryBuilder.h b/RecoTracker/CkfPattern/interface/BaseCkfTrajectoryBuilder.h index 11b8c738f65e7..e6e03cb8f4fea 100644 --- a/RecoTracker/CkfPattern/interface/BaseCkfTrajectoryBuilder.h +++ b/RecoTracker/CkfPattern/interface/BaseCkfTrajectoryBuilder.h @@ -6,6 +6,7 @@ #include "FWCore/Framework/interface/ConsumesCollector.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" #include "FWCore/Utilities/interface/ESGetToken.h" #include "DataFormats/TrajectorySeed/interface/TrajectorySeed.h" @@ -75,6 +76,8 @@ class BaseCkfTrajectoryBuilder : public TrajectoryBuilder { BaseCkfTrajectoryBuilder& operator=(const BaseCkfTrajectoryBuilder&) = delete; ~BaseCkfTrajectoryBuilder() override; + static void fillPSetDescription(edm::ParameterSetDescription& iDesc); + // new interface returning the start Trajectory... virtual TempTrajectory buildTrajectories(const TrajectorySeed& seed, TrajectoryContainer& ret, diff --git a/RecoTracker/CkfPattern/interface/CkfTrajectoryBuilder.h b/RecoTracker/CkfPattern/interface/CkfTrajectoryBuilder.h index b1bf2caf60150..020a0727d450c 100644 --- a/RecoTracker/CkfPattern/interface/CkfTrajectoryBuilder.h +++ b/RecoTracker/CkfPattern/interface/CkfTrajectoryBuilder.h @@ -11,6 +11,7 @@ class TrajectoryStateOnSurface; class TrajectoryFilter; #include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/interface/Event.h" @@ -41,6 +42,8 @@ class CkfTrajectoryBuilder : public BaseCkfTrajectoryBuilder { ~CkfTrajectoryBuilder() override {} + static void fillPSetDescription(edm::ParameterSetDescription& iDesc); + /// trajectories building starting from a seed TrajectoryContainer trajectories(const TrajectorySeed& seed) const override; /// trajectories building starting from a seed diff --git a/RecoTracker/CkfPattern/plugins/GroupedCkfTrajectoryBuilder.cc b/RecoTracker/CkfPattern/plugins/GroupedCkfTrajectoryBuilder.cc index bad4d1ec39059..24c46d74a22a1 100644 --- a/RecoTracker/CkfPattern/plugins/GroupedCkfTrajectoryBuilder.cc +++ b/RecoTracker/CkfPattern/plugins/GroupedCkfTrajectoryBuilder.cc @@ -12,6 +12,7 @@ #include "TrackingTools/TrackFitters/interface/KFTrajectoryFitter.h" #include "GroupedTrajCandLess.h" #include "TrackingTools/TrajectoryFiltering/interface/RegionalTrajectoryFilter.h" +#include "TrackingTools/TrajectoryFiltering/interface/TrajectoryFilterFactory.h" #include "TrackingTools/PatternTools/interface/TempTrajectory.h" #include "RecoTracker/MeasurementDet/interface/MeasurementTracker.h" #include "RecoTracker/MeasurementDet/interface/MeasurementTrackerEvent.h" @@ -29,6 +30,7 @@ #include "TrackingTools/PatternTools/interface/TrajMeasLessEstim.h" #include "TrackingTools/TrajectoryState/interface/BasicSingleTrajectoryState.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ParameterSet/interface/PluginDescription.h" #include "FWCore/Utilities/interface/thread_safety_macros.h" #include "TrackingTools/PatternTools/interface/TransverseImpactPointExtrapolator.h" @@ -152,6 +154,30 @@ GroupedCkfTrajectoryBuilder::GroupedCkfTrajectoryBuilder(const edm::ParameterSet ===================================== */ } +void GroupedCkfTrajectoryBuilder::fillPSetDescription(edm::ParameterSetDescription& iDesc){ + iDesc.add("useSameTrajFilter"); + iDesc.add("maxCand"); + iDesc.add("lostHitPenalty"); + iDesc.add("foundHitBonus"); + iDesc.add("intermediateCleaning"); + iDesc.add("alwaysUseInvalidHits"); + iDesc.add("lockHits"); + iDesc.add("bestHitOnly"); + iDesc.add("requireSeedHitsInRebuild"); + iDesc.add("keepOriginalIfRebuildFails"); + iDesc.add("minNrOfHitsForRebuild"); + iDesc.add("maxPtForLooperReconstruction", 0.); + iDesc.add("maxDPhiForLooperReconstruction", 2.0); + + edm::ParameterSetDescription psdTJ1; + psdTJ1.addNode(edm::PluginDescription("ComponentType", true)); + iDesc.add("trajectoryFilter", psdTJ1); + + edm::ParameterSetDescription psdTJ2; + psdTJ2.addNode(edm::PluginDescription("ComponentType", true)); + iDesc.add("inOutTrajectoryFilter", psdTJ2); +} + /* void GroupedCkfTrajectoryBuilder::setEvent(const edm::Event& event) const { diff --git a/RecoTracker/CkfPattern/plugins/GroupedCkfTrajectoryBuilder.h b/RecoTracker/CkfPattern/plugins/GroupedCkfTrajectoryBuilder.h index aa98aec3a37d9..44a1cfb16b22f 100644 --- a/RecoTracker/CkfPattern/plugins/GroupedCkfTrajectoryBuilder.h +++ b/RecoTracker/CkfPattern/plugins/GroupedCkfTrajectoryBuilder.h @@ -2,6 +2,7 @@ #define GroupedCkfTrajectoryBuilder_H #include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" #include "FWCore/Framework/interface/EventSetup.h" #include "RecoTracker/CkfPattern/interface/BaseCkfTrajectoryBuilder.h" @@ -26,6 +27,8 @@ class dso_internal GroupedCkfTrajectoryBuilder final : public BaseCkfTrajectoryB /// destructor ~GroupedCkfTrajectoryBuilder() override {} + static void fillPSetDescription(edm::ParameterSetDescription& iDesc); + /// set Event for the internal MeasurementTracker data member // virtual void setEvent(const edm::Event& event) const; diff --git a/RecoTracker/CkfPattern/plugins/SealModules.cc b/RecoTracker/CkfPattern/plugins/SealModules.cc index 57b0c28c77734..f402ebd71c7e6 100644 --- a/RecoTracker/CkfPattern/plugins/SealModules.cc +++ b/RecoTracker/CkfPattern/plugins/SealModules.cc @@ -1,5 +1,4 @@ #include "FWCore/PluginManager/interface/ModuleDef.h" - #include "FWCore/Framework/interface/MakerMacros.h" #include "CkfTrackCandidateMaker.h" @@ -14,9 +13,10 @@ using cms::CkfTrajectoryMaker; DEFINE_FWK_MODULE(CkfTrackCandidateMaker); DEFINE_FWK_MODULE(CkfTrajectoryMaker); +#include "FWCore/ParameterSet/interface/ValidatedPluginMacros.h" #include "RecoTracker/CkfPattern/interface/BaseCkfTrajectoryBuilderFactory.h" #include "RecoTracker/CkfPattern/interface/CkfTrajectoryBuilder.h" #include "GroupedCkfTrajectoryBuilder.h" -DEFINE_EDM_PLUGIN(BaseCkfTrajectoryBuilderFactory, CkfTrajectoryBuilder, "CkfTrajectoryBuilder"); -DEFINE_EDM_PLUGIN(BaseCkfTrajectoryBuilderFactory, GroupedCkfTrajectoryBuilder, "GroupedCkfTrajectoryBuilder"); +DEFINE_EDM_VALIDATED_PLUGIN(BaseCkfTrajectoryBuilderFactory, CkfTrajectoryBuilder, "CkfTrajectoryBuilder"); +DEFINE_EDM_VALIDATED_PLUGIN(BaseCkfTrajectoryBuilderFactory, GroupedCkfTrajectoryBuilder, "GroupedCkfTrajectoryBuilder"); diff --git a/RecoTracker/CkfPattern/src/BaseCkfTrajectoryBuilder.cc b/RecoTracker/CkfPattern/src/BaseCkfTrajectoryBuilder.cc index 84aebfa9a1f90..af731bc6816d7 100644 --- a/RecoTracker/CkfPattern/src/BaseCkfTrajectoryBuilder.cc +++ b/RecoTracker/CkfPattern/src/BaseCkfTrajectoryBuilder.cc @@ -32,8 +32,7 @@ BaseCkfTrajectoryBuilder::BaseCkfTrajectoryBuilder(const edm::ParameterSet& conf theInOutFilter(std::move(inOutFilter)), theUpdatorToken(iC.esConsumes(edm::ESInputTag("", conf.getParameter("updator")))), thePropagatorAlongToken(iC.esConsumes(edm::ESInputTag("", conf.getParameter("propagatorAlong")))), - thePropagatorOppositeToken( - iC.esConsumes(edm::ESInputTag("", conf.getParameter("propagatorOpposite")))), + thePropagatorOppositeToken(iC.esConsumes(edm::ESInputTag("", conf.getParameter("propagatorOpposite")))), theEstimatorToken(iC.esConsumes(edm::ESInputTag("", conf.getParameter("estimator")))), theRecHitBuilderToken(iC.esConsumes(edm::ESInputTag("", conf.getParameter("TTRHBuilder")))) { if (conf.exists("clustersToSkip")) @@ -43,6 +42,15 @@ BaseCkfTrajectoryBuilder::BaseCkfTrajectoryBuilder(const edm::ParameterSet& conf BaseCkfTrajectoryBuilder::~BaseCkfTrajectoryBuilder() {} +void BaseCkfTrajectoryBuilder::fillPSetDescription(edm::ParameterSetDescription& iDesc){ + iDesc.add("seedAs5DHit"); + iDesc.add("updator"); + iDesc.add("propagatorAlong"); + iDesc.add("propagatorOpposite"); + iDesc.add("estimator"); + iDesc.add("TTRHBuilder"); +} + std::unique_ptr BaseCkfTrajectoryBuilder::createTrajectoryFilter(const edm::ParameterSet& pset, edm::ConsumesCollector& iC) { return TrajectoryFilterFactory::get()->create(pset.getParameter("ComponentType"), pset, iC); diff --git a/RecoTracker/CkfPattern/src/BaseCkfTrajectoryBuilderFactory.cc b/RecoTracker/CkfPattern/src/BaseCkfTrajectoryBuilderFactory.cc index d27a732e532ab..960c9438c5ce9 100644 --- a/RecoTracker/CkfPattern/src/BaseCkfTrajectoryBuilderFactory.cc +++ b/RecoTracker/CkfPattern/src/BaseCkfTrajectoryBuilderFactory.cc @@ -1,3 +1,4 @@ #include "RecoTracker/CkfPattern/interface/BaseCkfTrajectoryBuilderFactory.h" +#include "FWCore/ParameterSet/interface/ValidatedPluginFactoryMacros.h" -EDM_REGISTER_PLUGINFACTORY(BaseCkfTrajectoryBuilderFactory, "BaseCkfTrajectoryBuilderFactory"); +EDM_REGISTER_VALIDATED_PLUGINFACTORY(BaseCkfTrajectoryBuilderFactory, "BaseCkfTrajectoryBuilderFactory"); diff --git a/RecoTracker/CkfPattern/src/CkfTrackCandidateMakerBase.cc b/RecoTracker/CkfPattern/src/CkfTrackCandidateMakerBase.cc index c6f9c4056f977..f71e43677ac88 100644 --- a/RecoTracker/CkfPattern/src/CkfTrackCandidateMakerBase.cc +++ b/RecoTracker/CkfPattern/src/CkfTrackCandidateMakerBase.cc @@ -1,8 +1,9 @@ #include "DataFormats/Common/interface/Handle.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ParameterSet/interface/PluginDescription.h" #include "FWCore/Utilities/interface/isFinite.h" -#include +#include "FWCore/Utilities/interface/ESInputTag.h" #include "DataFormats/Common/interface/OwnVector.h" #include "DataFormats/TrackCandidate/interface/TrackCandidateCollection.h" @@ -551,8 +552,9 @@ namespace cms { desc.add("phase2clustersToSkip", edm::InputTag("")); desc.add("src", edm::InputTag("globalMixedSeeds")); - edm::ParameterSetDescription psd0; - desc.add("TrajectoryBuilderPSet", psd0); + edm::ParameterSetDescription psdTB; + psdTB.addNode(edm::PluginDescription("ComponentType", true)); + desc.add("TrajectoryBuilderPSet", psdTB); edm::ParameterSetDescription psd1; psd1.add("propagatorAlongTISE", "PropagatorWithMaterial"); diff --git a/RecoTracker/CkfPattern/src/CkfTrajectoryBuilder.cc b/RecoTracker/CkfPattern/src/CkfTrajectoryBuilder.cc index 79d888103a1c5..237e6f8bd879d 100644 --- a/RecoTracker/CkfPattern/src/CkfTrajectoryBuilder.cc +++ b/RecoTracker/CkfPattern/src/CkfTrajectoryBuilder.cc @@ -27,10 +27,7 @@ using namespace std; CkfTrajectoryBuilder::CkfTrajectoryBuilder(const edm::ParameterSet& conf, edm::ConsumesCollector iC) - : CkfTrajectoryBuilder(conf, - iC, - BaseCkfTrajectoryBuilder::createTrajectoryFilter( - conf.getParameter("trajectoryFilter"), iC)) {} + : CkfTrajectoryBuilder(conf, iC, BaseCkfTrajectoryBuilder::createTrajectoryFilter(conf.getParameter("trajectoryFilter"), iC)) {} CkfTrajectoryBuilder::CkfTrajectoryBuilder(const edm::ParameterSet& conf, edm::ConsumesCollector iC, @@ -49,6 +46,14 @@ CkfTrajectoryBuilder::CkfTrajectoryBuilder(const edm::ParameterSet& conf, */ } +void CkfTrajectoryBuilder::fillPSetDescription(edm::ParameterSetDescription& iDesc){ + BaseCkfTrajectoryBuilder::fillPSetDescription(iDesc); + iDesc.add("maxCand"); + iDesc.add("lostHitPenalty"); + iDesc.add("intermediateCleaning"); + iDesc.add("alwaysUseInvalidHits"); +} + /* void CkfTrajectoryBuilder::setEvent(const edm::Event& event) const { diff --git a/TrackingTools/TrajectoryFiltering/interface/ChargeSignificanceTrajectoryFilter.h b/TrackingTools/TrajectoryFiltering/interface/ChargeSignificanceTrajectoryFilter.h index 3892db67cb4f9..06eba2b10099f 100644 --- a/TrackingTools/TrajectoryFiltering/interface/ChargeSignificanceTrajectoryFilter.h +++ b/TrackingTools/TrajectoryFiltering/interface/ChargeSignificanceTrajectoryFilter.h @@ -1,6 +1,7 @@ #ifndef ChargeSignificanceTrajectoryFilter_H #define ChargeSignificanceTrajectoryFilter_H +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" #include "TrackingTools/TrajectoryFiltering/interface/TrajectoryFilter.h" #include "TrackingTools/PatternTools/interface/Trajectory.h" #include "TrackingTools/PatternTools/interface/TempTrajectory.h" @@ -18,6 +19,10 @@ class ChargeSignificanceTrajectoryFilter final : public TrajectoryFilter { explicit ChargeSignificanceTrajectoryFilter(const edm::ParameterSet& pset, edm::ConsumesCollector& iC) : theChargeSignificance(pset.getParameter("chargeSignificance")) {} + static void fillPSetDescription(edm::ParameterSetDescription& iDesc){ + iDesc.add("chargeSignificance"); + } + bool qualityFilter(const Trajectory& traj) const override { return traj.isValid(); } bool qualityFilter(const TempTrajectory& traj) const override { return traj.isValid(); } diff --git a/TrackingTools/TrajectoryFiltering/interface/CkfBaseTrajectoryFilter.h b/TrackingTools/TrajectoryFiltering/interface/CkfBaseTrajectoryFilter.h index a691dad636377..acd7f8ba14866 100644 --- a/TrackingTools/TrajectoryFiltering/interface/CkfBaseTrajectoryFilter.h +++ b/TrackingTools/TrajectoryFiltering/interface/CkfBaseTrajectoryFilter.h @@ -1,8 +1,8 @@ #ifndef CkfBaseTrajectoryFilter_H #define CkfBaseTrajectoryFilter_H +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" #include "TrackingTools/TrajectoryFiltering/interface/TrajectoryFilter.h" - #include "TrackingTools/TrajectoryFiltering/interface/ChargeSignificanceTrajectoryFilter.h" #include "TrackingTools/TrajectoryFiltering/interface/MaxConsecLostHitsTrajectoryFilter.h" #include "TrackingTools/TrajectoryFiltering/interface/MaxHitsTrajectoryFilter.h" @@ -13,7 +13,6 @@ #include "TrackingTools/TrajectoryFiltering/interface/LooperTrajectoryFilter.h" #include "TrackingTools/TrajectoryFiltering/interface/SeedExtensionTrajectoryFilter.h" #include "TrackingTools/TrajectoryFiltering/interface/MaxCCCLostHitsTrajectoryFilter.h" -#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" class CkfBaseTrajectoryFilter : public TrajectoryFilter { public: @@ -30,6 +29,19 @@ class CkfBaseTrajectoryFilter : public TrajectoryFilter { theSeedExtensionTrajectoryFilter(new SeedExtensionTrajectoryFilter(pset, iC)), theMaxCCCLostHitsTrajectoryFilter(new MaxCCCLostHitsTrajectoryFilter(pset, iC)) {} + static void fillPSetDescription(edm::ParameterSetDescription& iDesc){ + ChargeSignificanceTrajectoryFilter::fillPSetDescription(iDesc); + MaxConsecLostHitsTrajectoryFilter::fillPSetDescription(iDesc); + MaxHitsTrajectoryFilter::fillPSetDescription(iDesc); + MaxLostHitsTrajectoryFilter::fillPSetDescription(iDesc); + LostHitsFractionTrajectoryFilter::fillPSetDescription(iDesc); + MinHitsTrajectoryFilter::fillPSetDescription(iDesc); + MinPtTrajectoryFilter::fillPSetDescription(iDesc); + LooperTrajectoryFilter::fillPSetDescription(iDesc); + SeedExtensionTrajectoryFilter::fillPSetDescription(iDesc); + MaxCCCLostHitsTrajectoryFilter::fillPSetDescription(iDesc); + } + void setEvent(const edm::Event& iEvent, const edm::EventSetup& iSetup) override { theChargeSignificanceTrajectoryFilter->setEvent(iEvent, iSetup); theMaxLostHitsTrajectoryFilter->setEvent(iEvent, iSetup); @@ -50,19 +62,6 @@ class CkfBaseTrajectoryFilter : public TrajectoryFilter { std::string name() const override { return "CkfBaseTrajectoryFilter"; } - inline edm::ParameterSetDescription getFilledConfigurationDescription() { - edm::ParameterSetDescription descLooper = theLooperTrajectoryFilter->getFilledConfigurationDescription(); - edm::ParameterSetDescription descLostHitsFraction = - theLostHitsFractionTrajectoryFilter->getFilledConfigurationDescription(); - edm::ParameterSetDescription descMinHits = theMinHitsTrajectoryFilter->getFilledConfigurationDescription(); - - edm::ParameterSetDescription desc; - desc.add("looperTrajectoryFilter", descLooper); - desc.add("lostHitsFractionTrajectoryFilter", descLostHitsFraction); - desc.add("minHitsTrajectoryFilter", descMinHits); - return desc; - } - protected: template bool QF(const T& traj) const { diff --git a/TrackingTools/TrajectoryFiltering/interface/CompositeTrajectoryFilter.h b/TrackingTools/TrajectoryFiltering/interface/CompositeTrajectoryFilter.h index 19b10b44ba884..c65b18bc526e4 100644 --- a/TrackingTools/TrajectoryFiltering/interface/CompositeTrajectoryFilter.h +++ b/TrackingTools/TrajectoryFiltering/interface/CompositeTrajectoryFilter.h @@ -1,6 +1,7 @@ #ifndef CompositeTrajectoryFilter_H #define CompositeTrajectoryFilter_H +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" #include "TrackingTools/TrajectoryFiltering/interface/TrajectoryFilter.h" #include "TrackingTools/TrajectoryFiltering/interface/TrajectoryFilterFactory.h" #include "TrackingTools/PatternTools/interface/Trajectory.h" @@ -26,6 +27,10 @@ class CompositeTrajectoryFilter : public TrajectoryFilter { ~CompositeTrajectoryFilter() override {} + static void fillPSetDescription(edm::ParameterSetDescription& iDesc){ + // !!! MISSING + } + void setEvent(const edm::Event& iEvent, const edm::EventSetup& iSetup) override { for (auto& f : filters) { f->setEvent(iEvent, iSetup); diff --git a/TrackingTools/TrajectoryFiltering/interface/LooperTrajectoryFilter.h b/TrackingTools/TrajectoryFiltering/interface/LooperTrajectoryFilter.h index 5391a6f0ad7fa..37aaf7d5d8e93 100644 --- a/TrackingTools/TrajectoryFiltering/interface/LooperTrajectoryFilter.h +++ b/TrackingTools/TrajectoryFiltering/interface/LooperTrajectoryFilter.h @@ -1,8 +1,8 @@ #ifndef LooperTrajectoryFilter_H #define LooperTrajectoryFilter_H -#include "TrackingTools/TrajectoryFiltering/interface/TrajectoryFilter.h" #include "FWCore/ParameterSet/interface/ParameterSetDescription.h" +#include "TrackingTools/TrajectoryFiltering/interface/TrajectoryFilter.h" class LooperTrajectoryFilter final : public TrajectoryFilter { public: @@ -19,6 +19,12 @@ class LooperTrajectoryFilter final : public TrajectoryFilter { theExtraNumberOfHitsBeforeTheFirstLoop = pset.getParameter("extraNumberOfHitsBeforeTheFirstLoop"); } + static void fillPSetDescription(edm::ParameterSetDescription& iDesc){ + iDesc.add("minNumberOfHitsForLoopers"); + iDesc.add("minNumberOfHitsPerLoop"); + iDesc.add("extraNumberOfHitsBeforeTheFirstLoop"); + } + bool qualityFilter(const Trajectory& traj) const override { return QF(traj); } bool qualityFilter(const TempTrajectory& traj) const override { return QF(traj); } diff --git a/TrackingTools/TrajectoryFiltering/interface/LostHitsFractionTrajectoryFilter.h b/TrackingTools/TrajectoryFiltering/interface/LostHitsFractionTrajectoryFilter.h index 86923983286da..c69ec6619f62e 100644 --- a/TrackingTools/TrajectoryFiltering/interface/LostHitsFractionTrajectoryFilter.h +++ b/TrackingTools/TrajectoryFiltering/interface/LostHitsFractionTrajectoryFilter.h @@ -1,8 +1,8 @@ #ifndef LostHitsFractionTrajectoryFilter_H #define LostHitsFractionTrajectoryFilter_H -#include "TrackingTools/TrajectoryFiltering/interface/TrajectoryFilter.h" #include "FWCore/ParameterSet/interface/ParameterSetDescription.h" +#include "TrackingTools/TrajectoryFiltering/interface/TrajectoryFilter.h" class LostHitsFractionTrajectoryFilter final : public TrajectoryFilter { public: @@ -14,6 +14,11 @@ class LostHitsFractionTrajectoryFilter final : public TrajectoryFilter { theConstantValue = pset.getParameter("constantValueForLostHitsFractionFilter"); } + static void fillPSetDescription(edm::ParameterSetDescription& iDesc){ + iDesc.add("maxLostHitsFraction"); + iDesc.add("constantValueForLostHitsFractionFilter"); + } + bool qualityFilter(const Trajectory& traj) const override { return TrajectoryFilter::qualityFilterIfNotContributing; } bool qualityFilter(const TempTrajectory& traj) const override { return TrajectoryFilter::qualityFilterIfNotContributing; diff --git a/TrackingTools/TrajectoryFiltering/interface/MaxCCCLostHitsTrajectoryFilter.h b/TrackingTools/TrajectoryFiltering/interface/MaxCCCLostHitsTrajectoryFilter.h index 300fb7af6bc02..db00e240e1754 100644 --- a/TrackingTools/TrajectoryFiltering/interface/MaxCCCLostHitsTrajectoryFilter.h +++ b/TrackingTools/TrajectoryFiltering/interface/MaxCCCLostHitsTrajectoryFilter.h @@ -1,6 +1,7 @@ #ifndef MaxCCCLostHitsTrajectoryFilter_H #define MaxCCCLostHitsTrajectoryFilter_H +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h" #include "TrackingTools/TrajectoryFiltering/interface/TrajectoryFilter.h" #include "RecoLocalTracker/SiStripClusterizer/interface/ClusterChargeCut.h" @@ -14,6 +15,11 @@ class MaxCCCLostHitsTrajectoryFilter final : public TrajectoryFilter { : theMaxCCCLostHits_(pset.getParameter("maxCCCLostHits")), minGoodStripCharge_(clusterChargeCut(pset, "minGoodStripCharge")) {} + static void fillPSetDescription(edm::ParameterSetDescription& iDesc){ + iDesc.add("maxCCCLostHits"); + fillPSetDescription4CCC(iDesc); + } + bool qualityFilter(const Trajectory& traj) const override { return TrajectoryFilter::qualityFilterIfNotContributing; } bool qualityFilter(const TempTrajectory& traj) const override { return TrajectoryFilter::qualityFilterIfNotContributing; diff --git a/TrackingTools/TrajectoryFiltering/interface/MaxConsecLostHitsTrajectoryFilter.h b/TrackingTools/TrajectoryFiltering/interface/MaxConsecLostHitsTrajectoryFilter.h index e35f766156b49..3b8342e599916 100644 --- a/TrackingTools/TrajectoryFiltering/interface/MaxConsecLostHitsTrajectoryFilter.h +++ b/TrackingTools/TrajectoryFiltering/interface/MaxConsecLostHitsTrajectoryFilter.h @@ -1,6 +1,7 @@ #ifndef MaxConsecLostHitsTrajectoryFilter_H #define MaxConsecLostHitsTrajectoryFilter_H +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" #include "TrackingTools/TrajectoryFiltering/interface/TrajectoryFilter.h" class MaxConsecLostHitsTrajectoryFilter final : public TrajectoryFilter { @@ -10,6 +11,10 @@ class MaxConsecLostHitsTrajectoryFilter final : public TrajectoryFilter { explicit MaxConsecLostHitsTrajectoryFilter(const edm::ParameterSet& pset, edm::ConsumesCollector& iC) : theMaxConsecLostHits(pset.getParameter("maxConsecLostHits")) {} + static void fillPSetDescription(edm::ParameterSetDescription& iDesc){ + iDesc.add("maxConsecLostHits"); + } + bool qualityFilter(const Trajectory& traj) const override { return TrajectoryFilter::qualityFilterIfNotContributing; } bool qualityFilter(const TempTrajectory& traj) const override { return TrajectoryFilter::qualityFilterIfNotContributing; diff --git a/TrackingTools/TrajectoryFiltering/interface/MaxHitsTrajectoryFilter.h b/TrackingTools/TrajectoryFiltering/interface/MaxHitsTrajectoryFilter.h index e9daa22b9589e..4027e542839c2 100644 --- a/TrackingTools/TrajectoryFiltering/interface/MaxHitsTrajectoryFilter.h +++ b/TrackingTools/TrajectoryFiltering/interface/MaxHitsTrajectoryFilter.h @@ -1,6 +1,7 @@ #ifndef MaxHitsTrajectoryFilter_H #define MaxHitsTrajectoryFilter_H +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" #include "TrackingTools/TrajectoryFiltering/interface/TrajectoryFilter.h" class MaxHitsTrajectoryFilter final : public TrajectoryFilter { @@ -13,6 +14,10 @@ class MaxHitsTrajectoryFilter final : public TrajectoryFilter { theMaxHits = 10000; } + static void fillPSetDescription(edm::ParameterSetDescription& iDesc){ + iDesc.add("maxNumberOfHits"); + } + bool qualityFilter(const Trajectory& traj) const override { return TrajectoryFilter::qualityFilterIfNotContributing; } bool qualityFilter(const TempTrajectory& traj) const override { return TrajectoryFilter::qualityFilterIfNotContributing; diff --git a/TrackingTools/TrajectoryFiltering/interface/MaxLostHitsTrajectoryFilter.h b/TrackingTools/TrajectoryFiltering/interface/MaxLostHitsTrajectoryFilter.h index 1c0b147889344..131ab7aea613d 100644 --- a/TrackingTools/TrajectoryFiltering/interface/MaxLostHitsTrajectoryFilter.h +++ b/TrackingTools/TrajectoryFiltering/interface/MaxLostHitsTrajectoryFilter.h @@ -1,6 +1,7 @@ #ifndef MaxLostHitsTrajectoryFilter_H #define MaxLostHitsTrajectoryFilter_H +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" #include "TrackingTools/TrajectoryFiltering/interface/TrajectoryFilter.h" class MaxLostHitsTrajectoryFilter final : public TrajectoryFilter { @@ -10,6 +11,10 @@ class MaxLostHitsTrajectoryFilter final : public TrajectoryFilter { explicit MaxLostHitsTrajectoryFilter(const edm::ParameterSet& pset, edm::ConsumesCollector& iC) : theMaxLostHits(pset.getParameter("maxLostHits")) {} + static void fillPSetDescription(edm::ParameterSetDescription& iDesc){ + iDesc.add("maxLostHits"); + } + bool qualityFilter(const Trajectory& traj) const override { return TrajectoryFilter::qualityFilterIfNotContributing; } bool qualityFilter(const TempTrajectory& traj) const override { return TrajectoryFilter::qualityFilterIfNotContributing; diff --git a/TrackingTools/TrajectoryFiltering/interface/MinHitsTrajectoryFilter.h b/TrackingTools/TrajectoryFiltering/interface/MinHitsTrajectoryFilter.h index 0626353736fa8..1ed73f26ab911 100644 --- a/TrackingTools/TrajectoryFiltering/interface/MinHitsTrajectoryFilter.h +++ b/TrackingTools/TrajectoryFiltering/interface/MinHitsTrajectoryFilter.h @@ -19,6 +19,13 @@ class MinHitsTrajectoryFilter final : public TrajectoryFilter { : theMinHits(pset.getParameter("minimumNumberOfHits")), theSeedPairPenalty(pset.getParameter("seedPairPenalty")) {} + static void fillPSetDescription(edm::ParameterSetDescription& iDesc){ + iDesc.add("minimumNumberOfHits", 5); + iDesc.add("highEtaSwitch", 5.0); + iDesc.add("minHitsAtHighEta", 5); + iDesc.add("seedPairPenalty", 0); + } + bool qualityFilter(const Trajectory& traj) const override { return QF(traj); } bool qualityFilter(const TempTrajectory& traj) const override { return QF(traj); } @@ -27,13 +34,6 @@ class MinHitsTrajectoryFilter final : public TrajectoryFilter { std::string name() const override { return "MinHitsTrajectoryFilter"; } - inline edm::ParameterSetDescription getFilledConfigurationDescription() { - edm::ParameterSetDescription desc; - desc.add("minimumNumberOfHits", 5); - desc.add("seedPairPenalty", 0); - return desc; - } - protected: template bool QF(const T& traj) const { diff --git a/TrackingTools/TrajectoryFiltering/interface/MinPtTrajectoryFilter.h b/TrackingTools/TrajectoryFiltering/interface/MinPtTrajectoryFilter.h index e9f63c19d778c..c763d58980bd6 100644 --- a/TrackingTools/TrajectoryFiltering/interface/MinPtTrajectoryFilter.h +++ b/TrackingTools/TrajectoryFiltering/interface/MinPtTrajectoryFilter.h @@ -1,10 +1,10 @@ #ifndef MinPtTrajectoryFilter_H #define MinPtTrajectoryFilter_H +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" #include "TrackingTools/TrajectoryFiltering/interface/TrajectoryFilter.h" #include "TrackingTools/PatternTools/interface/Trajectory.h" #include "TrackingTools/PatternTools/interface/TempTrajectory.h" - #include "TrackingTools/TrajectoryState/interface/FreeTrajectoryState.h" #include "TrackingTools/TrajectoryParametrization/interface/CurvilinearTrajectoryError.h" #include "TrackingTools/TrajectoryState/interface/TrajectoryStateAccessor.h" @@ -28,6 +28,12 @@ class MinPtTrajectoryFilter final : public TrajectoryFilter { thePtMin2 *= thePtMin2; } + static void fillPSetDescription(edm::ParameterSetDescription& iDesc){ + iDesc.add("minPt"); + iDesc.add("nSigmaMinPt"); + iDesc.add("minHitsMinPt"); + } + bool qualityFilter(const Trajectory& traj) const override { return test(traj.lastMeasurement(), traj.foundHits()); } bool qualityFilter(const TempTrajectory& traj) const override { return test(traj.lastMeasurement(), traj.foundHits()); diff --git a/TrackingTools/TrajectoryFiltering/interface/SeedExtensionTrajectoryFilter.h b/TrackingTools/TrajectoryFiltering/interface/SeedExtensionTrajectoryFilter.h index 2f701f7e03ef4..3088d2a3436b0 100644 --- a/TrackingTools/TrajectoryFiltering/interface/SeedExtensionTrajectoryFilter.h +++ b/TrackingTools/TrajectoryFiltering/interface/SeedExtensionTrajectoryFilter.h @@ -1,6 +1,7 @@ #ifndef SeedExtensionTrajectoryFilter_H #define SeedExtensionTrajectoryFilter_H +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" #include "TrackingTools/TrajectoryFiltering/interface/TrajectoryFilter.h" class SeedExtensionTrajectoryFilter final : public TrajectoryFilter { @@ -12,6 +13,12 @@ class SeedExtensionTrajectoryFilter final : public TrajectoryFilter { thePixel(pset.getParameter("pixelSeedExtension")), theExtension(pset.getParameter("seedExtension")) {} + static void fillPSetDescription(edm::ParameterSetDescription& iDesc){ + iDesc.add("strictSeedExtension"); + iDesc.add("pixelSeedExtension"); + iDesc.add("seedExtension"); + } + bool qualityFilter(const Trajectory& traj) const override { return QF(traj); } bool qualityFilter(const TempTrajectory& traj) const override { return QF(traj); } diff --git a/TrackingTools/TrajectoryFiltering/interface/ThresholdPtTrajectoryFilter.h b/TrackingTools/TrajectoryFiltering/interface/ThresholdPtTrajectoryFilter.h index 0417d0080b462..245283fa2e363 100644 --- a/TrackingTools/TrajectoryFiltering/interface/ThresholdPtTrajectoryFilter.h +++ b/TrackingTools/TrajectoryFiltering/interface/ThresholdPtTrajectoryFilter.h @@ -1,10 +1,10 @@ #ifndef ThresholdPtTrajectoryFilter_H #define ThresholdPtTrajectoryFilter_H +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" #include "TrackingTools/TrajectoryFiltering/interface/TrajectoryFilter.h" #include "TrackingTools/PatternTools/interface/Trajectory.h" #include "TrackingTools/PatternTools/interface/TempTrajectory.h" - #include "TrackingTools/TrajectoryState/interface/FreeTrajectoryState.h" #include "TrackingTools/TrajectoryParametrization/interface/CurvilinearTrajectoryError.h" #include "TrackingTools/TrajectoryState/interface/TrajectoryStateAccessor.h" @@ -25,6 +25,12 @@ class ThresholdPtTrajectoryFilter : public TrajectoryFilter { theNSigma(pset.getParameter("nSigmaThresholdPt")), theMinHits(pset.getParameter("minHitsThresholdPt")) {} + static void fillPSetDescription(edm::ParameterSetDescription& iDesc){ + iDesc.add("thresholdPt"); + iDesc.add("nSigmaThresholdPt"); + iDesc.add("minHitsThresholdPt"); + } + bool qualityFilter(const Trajectory& traj) const override { return !test(traj.lastMeasurement(), traj.foundHits()); } bool qualityFilter(const TempTrajectory& traj) const override { return !test(traj.lastMeasurement(), traj.foundHits()); diff --git a/TrackingTools/TrajectoryFiltering/plugins/modules.cc b/TrackingTools/TrajectoryFiltering/plugins/modules.cc index 6ec015fd87022..2da0453a98993 100644 --- a/TrackingTools/TrajectoryFiltering/plugins/modules.cc +++ b/TrackingTools/TrajectoryFiltering/plugins/modules.cc @@ -1,6 +1,7 @@ #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/Framework/interface/ModuleFactory.h" #include "FWCore/Framework/interface/ESProducer.h" +#include "FWCore/ParameterSet/interface/ValidatedPluginMacros.h" #include "TrackingTools/TrajectoryFiltering/interface/TrajectoryFilterFactory.h" @@ -15,13 +16,13 @@ #include "TrackingTools/TrajectoryFiltering/interface/CkfBaseTrajectoryFilter.h" #include "TrackingTools/TrajectoryFiltering/interface/ChargeSignificanceTrajectoryFilter.h" -DEFINE_EDM_PLUGIN(TrajectoryFilterFactory, MaxHitsTrajectoryFilter, "MaxHitsTrajectoryFilter"); -DEFINE_EDM_PLUGIN(TrajectoryFilterFactory, MinHitsTrajectoryFilter, "MinHitsTrajectoryFilter"); -DEFINE_EDM_PLUGIN(TrajectoryFilterFactory, MaxLostHitsTrajectoryFilter, "MaxLostHitsTrajectoryFilter"); -DEFINE_EDM_PLUGIN(TrajectoryFilterFactory, MaxConsecLostHitsTrajectoryFilter, "MaxConsecLostHitsTrajectoryFilter"); -DEFINE_EDM_PLUGIN(TrajectoryFilterFactory, MaxCCCLostHitsTrajectoryFilter, "MaxCCCLostHitsTrajectoryFilter"); -DEFINE_EDM_PLUGIN(TrajectoryFilterFactory, MinPtTrajectoryFilter, "MinPtTrajectoryFilter"); -DEFINE_EDM_PLUGIN(TrajectoryFilterFactory, ThresholdPtTrajectoryFilter, "ThresholdPtTrajectoryFilter"); -DEFINE_EDM_PLUGIN(TrajectoryFilterFactory, CompositeTrajectoryFilter, "CompositeTrajectoryFilter"); -DEFINE_EDM_PLUGIN(TrajectoryFilterFactory, CkfBaseTrajectoryFilter, "CkfBaseTrajectoryFilter"); -DEFINE_EDM_PLUGIN(TrajectoryFilterFactory, ChargeSignificanceTrajectoryFilter, "ChargeSignificanceTrajectoryFilter"); +DEFINE_EDM_VALIDATED_PLUGIN(TrajectoryFilterFactory, MaxHitsTrajectoryFilter, "MaxHitsTrajectoryFilter"); +DEFINE_EDM_VALIDATED_PLUGIN(TrajectoryFilterFactory, MinHitsTrajectoryFilter, "MinHitsTrajectoryFilter"); +DEFINE_EDM_VALIDATED_PLUGIN(TrajectoryFilterFactory, MaxLostHitsTrajectoryFilter, "MaxLostHitsTrajectoryFilter"); +DEFINE_EDM_VALIDATED_PLUGIN(TrajectoryFilterFactory, MaxConsecLostHitsTrajectoryFilter, "MaxConsecLostHitsTrajectoryFilter"); +DEFINE_EDM_VALIDATED_PLUGIN(TrajectoryFilterFactory, MaxCCCLostHitsTrajectoryFilter, "MaxCCCLostHitsTrajectoryFilter"); +DEFINE_EDM_VALIDATED_PLUGIN(TrajectoryFilterFactory, MinPtTrajectoryFilter, "MinPtTrajectoryFilter"); +DEFINE_EDM_VALIDATED_PLUGIN(TrajectoryFilterFactory, ThresholdPtTrajectoryFilter, "ThresholdPtTrajectoryFilter"); +DEFINE_EDM_VALIDATED_PLUGIN(TrajectoryFilterFactory, CompositeTrajectoryFilter, "CompositeTrajectoryFilter"); +DEFINE_EDM_VALIDATED_PLUGIN(TrajectoryFilterFactory, CkfBaseTrajectoryFilter, "CkfBaseTrajectoryFilter"); +DEFINE_EDM_VALIDATED_PLUGIN(TrajectoryFilterFactory, ChargeSignificanceTrajectoryFilter, "ChargeSignificanceTrajectoryFilter"); diff --git a/TrackingTools/TrajectoryFiltering/src/TrajectoryFilterFactory.cc b/TrackingTools/TrajectoryFiltering/src/TrajectoryFilterFactory.cc index bb16493655601..b9d4ba7064fed 100644 --- a/TrackingTools/TrajectoryFiltering/src/TrajectoryFilterFactory.cc +++ b/TrackingTools/TrajectoryFiltering/src/TrajectoryFilterFactory.cc @@ -1,3 +1,4 @@ #include "TrackingTools/TrajectoryFiltering/interface/TrajectoryFilterFactory.h" +#include "FWCore/ParameterSet/interface/ValidatedPluginFactoryMacros.h" -EDM_REGISTER_PLUGINFACTORY(TrajectoryFilterFactory, "TrajectoryFilterFactory"); +EDM_REGISTER_VALIDATED_PLUGINFACTORY(TrajectoryFilterFactory, "TrajectoryFilterFactory");