Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate Algorithms for GE0 and GE1/1 GE2/1 Segments #32972

Merged
merged 5 commits into from Mar 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 13 additions & 5 deletions RecoLocalMuon/GEMSegment/plugins/GEMSegmentBuilder.cc
Expand Up @@ -11,15 +11,19 @@

GEMSegmentBuilder::GEMSegmentBuilder(const edm::ParameterSet& ps) : geom_(nullptr) {
// Algo name
algoName = ps.getParameter<std::string>("algo_name");
segAlgoName = ps.getParameter<std::string>("algo_name");
ge0AlgoName = ps.getParameter<std::string>("ge0_name");

edm::LogVerbatim("GEMSegmentBuilder") << "GEMSegmentBuilder algorithm name: " << algoName;
edm::LogVerbatim("GEMSegmentBuilder") << "GEMSegmentBuilder algorithm : ge0 name : " << ge0AlgoName
<< " name: " << segAlgoName;

// SegAlgo parameter set
segAlgoPSet = ps.getParameter<edm::ParameterSet>("algo_pset");
ge0AlgoPSet = ps.getParameter<edm::ParameterSet>("ge0_pset");

// Ask factory to build this algorithm, giving it appropriate ParameterSet
algo = GEMSegmentBuilderPluginFactory::get()->create(algoName, segAlgoPSet);
// Ask factory to build these algorithms, giving them the appropriate ParameterSets
segAlgo = GEMSegmentBuilderPluginFactory::get()->create(segAlgoName, segAlgoPSet);
ge0Algo = GEMSegmentBuilderPluginFactory::get()->create(ge0AlgoName, ge0AlgoPSet);
}
GEMSegmentBuilder::~GEMSegmentBuilder() {}

Expand Down Expand Up @@ -88,7 +92,11 @@ void GEMSegmentBuilder::build(const GEMRecHitCollection* recHits, GEMSegmentColl
#endif

// given the superchamber select the appropriate algo... and run it
std::vector<GEMSegment> segv = algo->run(ensemble, gemRecHits);
std::vector<GEMSegment> segv;
if (chamber->id().station() == 0)
segv = ge0Algo->run(ensemble, gemRecHits);
else
segv = segAlgo->run(ensemble, gemRecHits);
#ifdef EDM_ML_DEBUG // have lines below only compiled when in debug mode
LogTrace("GEMSegmentBuilder") << "[GEMSegmentBuilder::build] found " << segv.size();
#endif
Expand Down
7 changes: 5 additions & 2 deletions RecoLocalMuon/GEMSegment/plugins/GEMSegmentBuilder.h
Expand Up @@ -40,9 +40,12 @@ class GEMSegmentBuilder {
void setGeometry(const GEMGeometry* g);

private:
std::string algoName;
std::string segAlgoName;
std::string ge0AlgoName;
edm::ParameterSet segAlgoPSet;
std::unique_ptr<GEMSegmentAlgorithmBase> algo;
edm::ParameterSet ge0AlgoPSet;
std::unique_ptr<GEMSegmentAlgorithmBase> segAlgo;
std::unique_ptr<GEMSegmentAlgorithmBase> ge0Algo;
const GEMGeometry* geom_;
};

Expand Down
33 changes: 16 additions & 17 deletions RecoLocalMuon/GEMSegment/python/gemSegments_cfi.py
@@ -1,25 +1,24 @@
import FWCore.ParameterSet.Config as cms

# defaults for GE0SegAlgoRU
RU_GE0 = cms.PSet(
allowWideSegments = cms.bool(True),
doCollisions = cms.bool(True),
maxChi2Additional = cms.double(100.0),
maxChi2Prune = cms.double(50),
maxChi2GoodSeg = cms.double(50),
maxPhiSeeds = cms.double(0.001096605744), #Assuming 384 strips
maxPhiAdditional = cms.double(0.001096605744), #Assuming 384 strips
maxETASeeds = cms.double(0.1), #Assuming 8 eta partitions
maxTOFDiff = cms.double(25),
requireCentralBX = cms.bool(True), #require that a majority of hits come from central BX
minNumberOfHits = cms.uint32(4),
maxNumberOfHits = cms.uint32(300),
maxNumberOfHitsPerLayer = cms.uint32(100),
)

gemSegments = cms.EDProducer("GEMSegmentProducer",
gemRecHitLabel = cms.InputTag("gemRecHits"),
ge0_name = cms.string("GE0SegAlgoRU"),
algo_name = cms.string("GEMSegmentAlgorithm"),
ge0_pset = cms.PSet(
allowWideSegments = cms.bool(True),
doCollisions = cms.bool(True),
maxChi2Additional = cms.double(100.0),
maxChi2Prune = cms.double(50),
maxChi2GoodSeg = cms.double(50),
maxPhiSeeds = cms.double(0.001096605744), #Assuming 384 strips
maxPhiAdditional = cms.double(0.001096605744), #Assuming 384 strips
maxETASeeds = cms.double(0.1), #Assuming 8 eta partitions
maxTOFDiff = cms.double(25),
requireCentralBX = cms.bool(True), #require that a majority of hits come from central BX
minNumberOfHits = cms.uint32(4),
maxNumberOfHits = cms.uint32(300),
maxNumberOfHitsPerLayer = cms.uint32(100),
),
algo_pset = cms.PSet(
minHitsPerSegment = cms.uint32(2),
preClustering = cms.bool(True), # False => all hits in chamber are given to the fitter
Expand Down