Skip to content

Commit

Permalink
add fillDescriptions for CtfSpecialSeedGenerator and implement custom…
Browse files Browse the repository at this point in the history
…ization for HLT menu
  • Loading branch information
mmusich committed Nov 11, 2024
1 parent e2471cd commit 76acd21
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 17 deletions.
10 changes: 10 additions & 0 deletions HLTrigger/Configuration/python/customizeHLTforCMSSW.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ def customiseForOffline(process):

return process

def customiseForXXXX(process):
for prod in producers_by_type(process, 'CtfSpecialSeedGenerator'):
if hasattr(prod, "DontCountDetsAboveNClusters"):
value = prod.DontCountDetsAboveNClusters.value()
delattr(prod, "DontCountDetsAboveNClusters")
# Replace it with cms.uint32
prod.DontCountDetsAboveNClusters = cms.uint32(value)
return process

# CMSSW version specific customizations
def customizeHLTforCMSSW(process, menuType="GRun"):
Expand All @@ -57,4 +65,6 @@ def customizeHLTforCMSSW(process, menuType="GRun"):
# add call to action function in proper order: newest last!
# process = customiseFor12718(process)

process = customiseForXXXX(process)

return process
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
* from combinations of hits in pairs of strip layers
*/
//FWK
#include "FWCore/Framework/interface/stream/EDProducer.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/stream/EDProducer.h"
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
//DataFormats
#include "DataFormats/Common/interface/Handle.h"
#include "DataFormats/TrajectorySeed/interface/TrajectorySeedCollection.h"
Expand Down Expand Up @@ -42,14 +44,15 @@ class CtfSpecialSeedGenerator : public edm::stream::EDProducer<> {
typedef TrajectoryStateOnSurface TSOS;

CtfSpecialSeedGenerator(const edm::ParameterSet& conf);

~CtfSpecialSeedGenerator() override; //{};
~CtfSpecialSeedGenerator() override = default;

void beginRun(edm::Run const&, edm::EventSetup const&) override;
void endRun(edm::Run const&, edm::EventSetup const&) override;

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

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

private:
bool run(const edm::EventSetup& c, const edm::Event& e, TrajectorySeedCollection& output);

Expand Down
90 changes: 77 additions & 13 deletions RecoTracker/SpecialSeedGenerators/src/CtfSpecialSeedGenerator.cc
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
#include "RecoTracker/SpecialSeedGenerators/interface/CtfSpecialSeedGenerator.h"
#include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
#include "Geometry/Records/interface/TrackerTopologyRcd.h"
#include "DataFormats/GeometrySurface/interface/RectangularPlaneBounds.h"
#include "TrackingTools/GeomPropagators/interface/StraightLinePlaneCrossing.h"

#include "RecoTracker/TkTrackingRegions/interface/TrackingRegionProducerFactory.h"
#include "RecoTracker/TkTrackingRegions/interface/TrackingRegion.h"
#include "RecoTracker/TkTrackingRegions/interface/OrderedHitsGeneratorFactory.h"
#include "RecoTracker/TkSeedingLayers/interface/OrderedSeedingHits.h"
#include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
#include "FWCore/Framework/interface/ConsumesCollector.h"

#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/Framework/interface/ConsumesCollector.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "Geometry/Records/interface/TrackerTopologyRcd.h"
#include "RecoTracker/SpecialSeedGenerators/interface/CtfSpecialSeedGenerator.h"
#include "RecoTracker/TkSeedingLayers/interface/OrderedSeedingHits.h"
#include "RecoTracker/TkTrackingRegions/interface/OrderedHitsGeneratorFactory.h"
#include "RecoTracker/TkTrackingRegions/interface/TrackingRegion.h"
#include "RecoTracker/TkTrackingRegions/interface/TrackingRegionProducerFactory.h"
#include "TrackingTools/GeomPropagators/interface/StraightLinePlaneCrossing.h"

using namespace ctfseeding;

Expand Down Expand Up @@ -48,8 +46,6 @@ CtfSpecialSeedGenerator::CtfSpecialSeedGenerator(const edm::ParameterSet& conf)
}
}

CtfSpecialSeedGenerator::~CtfSpecialSeedGenerator() = default;

void CtfSpecialSeedGenerator::endRun(edm::Run const&, edm::EventSetup const&) { theSeedBuilder.reset(); }

void CtfSpecialSeedGenerator::beginRun(edm::Run const&, const edm::EventSetup& iSetup) {
Expand Down Expand Up @@ -278,3 +274,71 @@ bool CtfSpecialSeedGenerator::postCheck(const TrajectorySeed& seed) {
<< " position on Lower scintillator " << positionLower.second;
return false;
}

void CtfSpecialSeedGenerator::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
edm::ParameterSetDescription desc;

// Top-level parameters
desc.add<double>("SeedMomentum", 5.0);
desc.add<double>("ErrorRescaling", 50.0);
desc.add<bool>("UseScintillatorsConstraint", true);
desc.add<std::string>("TTRHBuilder", "WithTrackAngle");
desc.add<bool>("SeedsFromPositiveY", true);
desc.add<bool>("SeedsFromNegativeY", false);
desc.add<bool>("CheckHitsAreOnDifferentLayers", false);
desc.add<bool>("SetMomentum", true);
desc.add<bool>("requireBOFF", false);
desc.add<int32_t>("maxSeeds", 10000);

// call the cluster checker to insert directly the configuration
ClusterChecker::fillDescriptions(desc);

// Vector parameters
desc.add<std::vector<int>>("Charges", {-1});

// RegionFactoryPSet (nested PSet)
{
edm::ParameterSetDescription ps_RegionFactoryPSet;
ps_RegionFactoryPSet.add<std::string>("ComponentName", "GlobalRegionProducer");

edm::ParameterSetDescription ps_RegionPSet;
ps_RegionPSet.setAllowAnything();
ps_RegionFactoryPSet.add("RegionPSet", ps_RegionPSet)->setComment("");
desc.add<edm::ParameterSetDescription>("RegionFactoryPSet", ps_RegionFactoryPSet);
}

// UpperScintillatorParameters (nested PSet)
{
edm::ParameterSetDescription ps_UpperScintillatorParameters;
ps_UpperScintillatorParameters.add<double>("LenghtInZ", 100.0);
ps_UpperScintillatorParameters.add<double>("GlobalX", 0.0);
ps_UpperScintillatorParameters.add<double>("GlobalY", 300.0);
ps_UpperScintillatorParameters.add<double>("GlobalZ", 50.0);
ps_UpperScintillatorParameters.add<double>("WidthInX", 100.0);
desc.add<edm::ParameterSetDescription>("UpperScintillatorParameters", ps_UpperScintillatorParameters);
}

// LowerScintillatorParameters (nested PSet)
{
edm::ParameterSetDescription ps_LowerScintillatorParameters;
ps_LowerScintillatorParameters.add<double>("LenghtInZ", 100.0);
ps_LowerScintillatorParameters.add<double>("GlobalX", 0.0);
ps_LowerScintillatorParameters.add<double>("GlobalY", -100.0);
ps_LowerScintillatorParameters.add<double>("GlobalZ", 50.0);
ps_LowerScintillatorParameters.add<double>("WidthInX", 100.0);
desc.add<edm::ParameterSetDescription>("LowerScintillatorParameters", ps_LowerScintillatorParameters);
}

// OrderedHitsFactoryPSets (VPSet)
{
edm::ParameterSetDescription ps_OrderedHitsFactoryPSet;
ps_OrderedHitsFactoryPSet.setAllowAnything();
std::vector<edm::ParameterSet> default_OrderedHitsFactoryPSet(1);

// Add the VPSet (OrderedHitsFactoryPSets) to the top-level description
desc.addVPSet("OrderedHitsFactoryPSets", ps_OrderedHitsFactoryPSet, default_OrderedHitsFactoryPSet);
}

// Add the top-level description to the descriptions
descriptions.addWithDefaultLabel(desc);
}
1 change: 1 addition & 0 deletions RecoTracker/TkSeedGenerator/src/ClusterChecker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ void ClusterChecker::fillDescriptions(edm::ParameterSetDescription& desc) {
desc.add<edm::InputTag>("PixelClusterCollectionLabel", edm::InputTag("siPixelClusters"));
desc.add<std::string>("cut",
"strip < 400000 && pixel < 40000 && (strip < 50000 + 10*pixel) && (pixel < 5000 + 0.1*strip)");
desc.add<uint32_t>("DontCountDetsAboveNClusters", 0);
}

ClusterChecker::~ClusterChecker() {}
Expand Down

0 comments on commit 76acd21

Please sign in to comment.