Skip to content

Commit

Permalink
add fillDescriptions to a bunch of RECO plugins used at HLT
Browse files Browse the repository at this point in the history
  • Loading branch information
mmusich committed Dec 20, 2024
1 parent 2870e94 commit 4a1417a
Show file tree
Hide file tree
Showing 33 changed files with 392 additions and 73 deletions.
2 changes: 1 addition & 1 deletion EventFilter/DTRawToDigi/plugins/DTuROSRawToDigi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ DTuROSRawToDigi::DTuROSRawToDigi(const edm::ParameterSet& pset) {

void DTuROSRawToDigi::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
edm::ParameterSetDescription desc;
desc.add<edm::InputTag>("inputLabel");
desc.add<edm::InputTag>("inputLabel", edm::InputTag("rawDataCollector"));
desc.addUntracked<bool>("debug", false);
descriptions.addWithDefaultLabel(desc);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ RawDataCollectorByLabel::RawDataCollectorByLabel(const edm::ParameterSet &pset)

void RawDataCollectorByLabel::fillDescriptions(edm::ConfigurationDescriptions &descriptions) {
edm::ParameterSetDescription desc;
desc.add<std::vector<InputTag> >("RawCollectionList");
desc.add<std::vector<InputTag> >("RawCollectionList", {edm::InputTag("SiStripDigiToZSRaw", "rawDataCollector")});
desc.addUntracked<int>("verbose", 0);
descriptions.addWithDefaultLabel(desc);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import FWCore.ParameterSet.Config as cms

hltIter2Phase2L3FromL1TkMuonMaskedMeasurementTrackerEvent = cms.EDProducer("MaskedMeasurementTrackerEventProducer",
OnDemand = cms.bool(False),
phase2clustersToSkip = cms.InputTag("hltIter2Phase2L3FromL1TkMuonClustersRefRemoval"),
src = cms.InputTag("hltMeasurementTrackerEvent")
)
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

hltSiPixelRecHits = cms.EDProducer("SiPixelRecHitConverter",
CPE = cms.string('PixelCPEGeneric'),
VerboseLevel = cms.untracked.int32(0),
src = cms.InputTag("hltSiPixelClusters")
)

Expand Down
21 changes: 21 additions & 0 deletions HLTrigger/Configuration/python/customizeHLTforCMSSW.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,25 @@ def customizeHLTfor46935(process):
delattr(prod, 'recHitsLabelCPUEE')
return process


def customizeHLTfor47017(process):
"""Remove unneeded parameters from the HLT menu"""
for prod in producers_by_type(process, 'MaskedMeasurementTrackerEventProducer'):
if hasattr(prod, 'OnDemand'):
delattr(prod, 'OnDemand')

for prod in producers_by_type(process, 'HcalHaloDataProducer'):
if hasattr(prod, 'HcalMaxMatchingRadiusParam'):
delattr(prod, 'HcalMaxMatchingRadiusParam')
if hasattr(prod, 'HcalMinMatchingRadiusParam'):
delattr(prod, 'HcalMinMatchingRadiusParam')

for prod in producers_by_type(process, 'SiPixelRecHitConverter'):
if hasattr(prod, 'VerboseLevel'):
delattr(prod, 'VerboseLevel')

return process

# CMSSW version specific customizations
def customizeHLTforCMSSW(process, menuType="GRun"):

Expand All @@ -74,5 +93,7 @@ def customizeHLTforCMSSW(process, menuType="GRun"):
# process = customiseFor12718(process)

process = customizeHLTfor46935(process)
process = customizeHLTfor47017(process)

return process

35 changes: 31 additions & 4 deletions RecoLocalMuon/CSCSegment/src/CSCSegmentBuilder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ CSCSegmentBuilder::CSCSegmentBuilder(const edm::ParameterSet& ps) : geom_(nullpt
int chosenAlgo = ps.getParameter<int>("algo_type") - 1;

// Find appropriate ParameterSets for each algo type
std::vector<edm::ParameterSet> algoPSets = ps.getParameter<std::vector<edm::ParameterSet> >("algo_psets");
std::vector<edm::ParameterSet> algoPSets = ps.getParameter<std::vector<edm::ParameterSet>>("algo_psets");

// Now load the right parameter set
// Algo name
Expand All @@ -33,14 +33,14 @@ CSCSegmentBuilder::CSCSegmentBuilder(const edm::ParameterSet& ps) : geom_(nullpt

// SegAlgo parameter set
std::vector<edm::ParameterSet> segAlgoPSet =
algoPSets[chosenAlgo].getParameter<std::vector<edm::ParameterSet> >("algo_psets");
algoPSets[chosenAlgo].getParameter<std::vector<edm::ParameterSet>>("algo_psets");

// Chamber types to handle
std::vector<std::string> chType = algoPSets[chosenAlgo].getParameter<std::vector<std::string> >("chamber_types");
std::vector<std::string> chType = algoPSets[chosenAlgo].getParameter<std::vector<std::string>>("chamber_types");
LogDebug("CSCSegment|CSC") << "No. of chamber types to handle: " << chType.size();

// Algo to chamber type
std::vector<int> algoToType = algoPSets[chosenAlgo].getParameter<std::vector<int> >("parameters_per_chamber_type");
std::vector<int> algoToType = algoPSets[chosenAlgo].getParameter<std::vector<int>>("parameters_per_chamber_type");

// Trap if we don't have enough parameter sets or haven't assigned an algo to every type
if (algoToType.size() != chType.size()) {
Expand Down Expand Up @@ -101,3 +101,30 @@ void CSCSegmentBuilder::build(const CSCRecHit2DCollection* recHits, CSCSegmentCo
}

void CSCSegmentBuilder::setGeometry(const CSCGeometry* geom) { geom_ = geom; }

void CSCSegmentBuilder::fillPSetDescription(edm::ParameterSetDescription& desc) {
/// Top-level parameters
desc.add<int>("algo_type", 1);

// Define the nested PSet for individual configurations
edm::ParameterSetDescription algoPSet;
algoPSet.add<std::vector<int>>("parameters_per_chamber_type", {1, 2, 3, 4, 5, 6, 5, 6, 5, 6});

// Define the VPSet inside algo_psets
edm::ParameterSetDescription innerPSet;
// Allow any parameter in the innerPSet
innerPSet.setAllowAnything();

// Fill the VPSet for algo_psets
edm::ParameterSetDescription innerAlgoPSet;
innerAlgoPSet.addVPSet("algo_psets", innerPSet);

// Additional top-level keys
algoPSet.addVPSet("algo_psets", innerPSet);
algoPSet.add<std::string>("algo_name", "CSCSegAlgoRU");
algoPSet.add<std::vector<std::string>>(
"chamber_types", {"ME1/a", "ME1/b", "ME1/2", "ME1/3", "ME2/1", "ME2/2", "ME3/1", "ME3/2", "ME4/1", "ME4/2"});

// Add to the top-level VPSet
desc.addVPSet("algo_psets", algoPSet);
}
10 changes: 6 additions & 4 deletions RecoLocalMuon/CSCSegment/src/CSCSegmentBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
*
*/

#include <DataFormats/CSCRecHit/interface/CSCRecHit2DCollection.h>
#include <DataFormats/CSCRecHit/interface/CSCSegmentCollection.h>

#include <FWCore/ParameterSet/interface/ParameterSet.h>
#include "DataFormats/CSCRecHit/interface/CSCRecHit2DCollection.h"
#include "DataFormats/CSCRecHit/interface/CSCSegmentCollection.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h"

class CSCGeometry;
class CSCSegmentAlgorithm;
Expand All @@ -32,6 +32,8 @@ class CSCSegmentBuilder {
/// Destructor
~CSCSegmentBuilder();

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

/** Find rechits in each CSCChamber, build CSCSegment's in each chamber,
* and fill into output collection.
*/
Expand Down
23 changes: 15 additions & 8 deletions RecoLocalMuon/CSCSegment/src/CSCSegmentProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
*
*/

#include <RecoLocalMuon/CSCSegment/src/CSCSegmentProducer.h>
#include <RecoLocalMuon/CSCSegment/src/CSCSegmentBuilder.h>
#include "RecoLocalMuon/CSCSegment/src/CSCSegmentProducer.h"
#include "RecoLocalMuon/CSCSegment/src/CSCSegmentBuilder.h"

#include <DataFormats/Common/interface/Handle.h>
#include <FWCore/Framework/interface/ESHandle.h>
#include <FWCore/Utilities/interface/InputTag.h>
#include <FWCore/MessageLogger/interface/MessageLogger.h>
#include "DataFormats/Common/interface/Handle.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Utilities/interface/InputTag.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"

#include <DataFormats/CSCRecHit/interface/CSCSegmentCollection.h>
#include <DataFormats/CSCRecHit/interface/CSCSegment.h>
#include "DataFormats/CSCRecHit/interface/CSCSegmentCollection.h"
#include "DataFormats/CSCRecHit/interface/CSCSegment.h"

CSCSegmentProducer::CSCSegmentProducer(const edm::ParameterSet& pas) : iev(0) {
m_token = consumes<CSCRecHit2DCollection>(pas.getParameter<edm::InputTag>("inputObjects"));
Expand All @@ -22,6 +22,13 @@ CSCSegmentProducer::CSCSegmentProducer(const edm::ParameterSet& pas) : iev(0) {
produces<CSCSegmentCollection>();
}

void CSCSegmentProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
edm::ParameterSetDescription desc;
desc.add<edm::InputTag>("inputObjects", edm::InputTag("csc2DRecHits"));
CSCSegmentBuilder::fillPSetDescription(desc);
descriptions.addWithDefaultLabel(desc);
}

CSCSegmentProducer::~CSCSegmentProducer() {
LogDebug("CSCSegment|CSC") << "deleting CSCSegmentBuilder after " << iev << " events w/csc data.";
delete segmentBuilder_;
Expand Down
5 changes: 5 additions & 0 deletions RecoLocalMuon/CSCSegment/src/CSCSegmentProducer.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
#include "DataFormats/CSCRecHit/interface/CSCRecHit2DCollection.h"
#include "Geometry/Records/interface/MuonGeometryRecord.h"
#include "Geometry/CSCGeometry/interface/CSCGeometry.h"
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h"

class CSCSegmentBuilder;

Expand All @@ -28,6 +31,8 @@ class CSCSegmentProducer : public edm::stream::EDProducer<> {
/// Produce the CSCSegment collection
void produce(edm::Event&, const edm::EventSetup&) override;

static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);

private:
int iev; // events through
CSCSegmentBuilder* segmentBuilder_;
Expand Down
11 changes: 11 additions & 0 deletions RecoLocalTracker/SiPixelRecHits/plugins/SiPixelRecHitConverter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@
#include "FWCore/Framework/interface/MakerMacros.h"
#include "DataFormats/Common/interface/Handle.h"
#include "FWCore/Framework/interface/ESHandle.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 "FWCore/Utilities/interface/EDPutToken.h"
#include "FWCore/Utilities/interface/ESGetToken.h"
Expand Down Expand Up @@ -95,6 +97,8 @@ namespace cms {
explicit SiPixelRecHitConverter(const edm::ParameterSet& conf);
~SiPixelRecHitConverter() override;

static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);

//--- Factory method to make CPE's depending on the ParameterSet
//--- Not sure if we need to make more than one CPE to run concurrently
//--- on different parts of the detector (e.g., one for the barrel and the
Expand Down Expand Up @@ -254,6 +258,13 @@ namespace cms {
<< " SiPixelClusters into SiPixelRecHits, in " << numberOfDetUnits
<< " DetUnits.";
}

void SiPixelRecHitConverter::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
edm::ParameterSetDescription desc;
desc.add<edm::InputTag>("src", edm::InputTag("siPixelClusters"));
desc.add<std::string>("CPE", "PixelCPEGeneric");
descriptions.addWithDefaultLabel(desc);
}
} // end of namespace cms

using cms::SiPixelRecHitConverter;
Expand Down
3 changes: 1 addition & 2 deletions RecoLocalTracker/SiPixelRecHits/python/SiPixelRecHits_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
# legacy pixel rechit producer
siPixelRecHits = cms.EDProducer("SiPixelRecHitConverter",
src = cms.InputTag("siPixelClusters"),
CPE = cms.string('PixelCPEGeneric'),
VerboseLevel = cms.untracked.int32(0)
CPE = cms.string('PixelCPEGeneric')
)

# SwitchProducer wrapping the legacy pixel rechit producer
Expand Down
17 changes: 17 additions & 0 deletions RecoLocalTracker/SiStripClusterizer/plugins/SiStripClusterizer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,23 @@ void SiStripClusterizer::produce(edm::Event& event, const edm::EventSetup& es) {
event.put(std::move(output));
}

void SiStripClusterizer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
edm::ParameterSetDescription desc;
desc.add<std::vector<edm::InputTag>>("DigiProducersList",
{edm::InputTag("siStripDigis", "ZeroSuppressed"),
edm::InputTag("siStripZeroSuppression", "VirginRaw"),
edm::InputTag("siStripZeroSuppression", "ProcessedRaw"),
edm::InputTag("siStripZeroSuppression", "ScopeMode")});

{
edm::ParameterSetDescription ClusterizerPSet;
StripClusterizerAlgorithmFactory::fillDescriptions(ClusterizerPSet);
desc.add<edm::ParameterSetDescription>("Clusterizer", ClusterizerPSet);
}

descriptions.addWithDefaultLabel(desc);
}

template <class T>
inline bool SiStripClusterizer::findInput(const edm::EDGetTokenT<T>& tag, edm::Handle<T>& handle, const edm::Event& e) {
e.getByToken(tag, handle);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/stream/EDProducer.h"
#include "RecoLocalTracker/SiStripClusterizer/interface/StripClusterizerAlgorithm.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 <vector>
Expand All @@ -14,6 +16,7 @@ class SiStripClusterizer : public edm::stream::EDProducer<> {
public:
explicit SiStripClusterizer(const edm::ParameterSet& conf);
void produce(edm::Event&, const edm::EventSetup&) override;
static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);

private:
template <class T>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#include "FWCore/Framework/interface/stream/EDProducer.h"

#include "DataFormats/Common/interface/DetSetVectorNew.h"
#include "DataFormats/Common/interface/Handle.h"
#include "DataFormats/SiPixelCluster/interface/SiPixelCluster.h"
#include "FWCore/Framework/interface/ESHandle.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 "DataFormats/Common/interface/Handle.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "DataFormats/SiPixelCluster/interface/SiPixelCluster.h"
#include "DataFormats/Common/interface/DetSetVectorNew.h"

#include "RecoLocalTracker/ClusterParameterEstimator/interface/PixelClusterParameterEstimator.h"
#include "RecoLocalTracker/Records/interface/TkPixelCPERecord.h"
Expand All @@ -30,11 +30,12 @@

class JetCoreClusterSplitter : public edm::stream::EDProducer<> {
public:
static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
JetCoreClusterSplitter(const edm::ParameterSet& iConfig);
~JetCoreClusterSplitter() override;
~JetCoreClusterSplitter() override = default;
void produce(edm::Event& iEvent, const edm::EventSetup& iSetup) override;

static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);

private:
bool split(const SiPixelCluster& aCluster,
edmNew::DetSetVector<SiPixelCluster>::FastFiller& filler,
Expand Down Expand Up @@ -129,8 +130,6 @@ JetCoreClusterSplitter::JetCoreClusterSplitter(const edm::ParameterSet& iConfig)
produces<edmNew::DetSetVector<SiPixelCluster>>();
}

JetCoreClusterSplitter::~JetCoreClusterSplitter() {}

bool SortPixels(const SiPixelCluster::Pixel& i, const SiPixelCluster::Pixel& j) { return (i.adc > j.adc); }

void JetCoreClusterSplitter::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) {
Expand Down
6 changes: 5 additions & 1 deletion RecoMET/METProducers/interface/CSCHaloDataProducer.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@

#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
#include "FWCore/PluginManager/interface/ModuleDef.h"

#include "Geometry/CommonDetUnit/interface/GeomDet.h"
Expand Down Expand Up @@ -130,7 +132,9 @@ namespace reco {
class CSCHaloDataProducer : public edm::stream::EDProducer<> {
public:
explicit CSCHaloDataProducer(const edm::ParameterSet &);
~CSCHaloDataProducer() override;
~CSCHaloDataProducer() override = default;

static void fillDescriptions(edm::ConfigurationDescriptions &descriptions);

private:
void produce(edm::Event &, const edm::EventSetup &) override;
Expand Down
6 changes: 5 additions & 1 deletion RecoMET/METProducers/interface/EcalHaloDataProducer.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@

#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
#include "FWCore/PluginManager/interface/ModuleDef.h"

#include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
Expand All @@ -94,7 +96,9 @@ namespace reco {
class EcalHaloDataProducer : public edm::stream::EDProducer<> {
public:
explicit EcalHaloDataProducer(const edm::ParameterSet&);
~EcalHaloDataProducer() override;
~EcalHaloDataProducer() override = default;

static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);

private:
void produce(edm::Event&, const edm::EventSetup&) override;
Expand Down
4 changes: 4 additions & 0 deletions RecoMET/METProducers/interface/GlobalHaloDataProducer.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@
#include "FWCore/Framework/interface/stream/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/PluginManager/interface/ModuleDef.h"

#include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
Expand Down Expand Up @@ -182,6 +184,8 @@ namespace reco {
explicit GlobalHaloDataProducer(const edm::ParameterSet&);
~GlobalHaloDataProducer() override;

static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);

private:
void produce(edm::Event&, const edm::EventSetup&) override;

Expand Down
Loading

0 comments on commit 4a1417a

Please sign in to comment.