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

GE21-ME21 segment reconstruction #39441

Merged
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
@@ -0,0 +1,4 @@
import FWCore.ParameterSet.Config as cms

# This modifier enable runnig of GEMCSCSegmentProducer in relval workflows
gemcscSegmentsTesting = cms.Modifier()
2 changes: 1 addition & 1 deletion DQM/GEM/test/testGEMEffByGEMCSCSegment.py
Expand Up @@ -40,7 +40,7 @@
process.load('RecoLocalMuon.GEMRecHit.gemRecHits_cfi')
process.load("Configuration.StandardSequences.RawToDigi_Data_cff")
process.load("Configuration.StandardSequences.Reconstruction_cff")
process.load('RecoLocalMuon.GEMCSCSegment.gemcscSegments_cfi')
process.load('RecoLocalMuon.GEMCSCSegment.gemcscSegments_cff')
process.load("DQM.GEM.gemEffByGEMCSCSegment_cff")

process.muonGEMDigis.useDBEMap = True
Expand Down
Expand Up @@ -29,7 +29,7 @@

process.load("Configuration.StandardSequences.RawToDigi_Data_cff")
process.load("Configuration.StandardSequences.Reconstruction_cff")
process.load('RecoLocalMuon.GEMCSCSegment.gemcscSegments_cfi')
process.load('RecoLocalMuon.GEMCSCSegment.gemcscSegments_cff')
process.load("DQM.GEM.GEMDQM_cff")
process.load("DQM.GEM.gemEffByGEMCSCSegment_cff")

Expand Down
22 changes: 9 additions & 13 deletions RecoLocalMuon/GEMCSCSegment/plugins/GEMCSCSegmentBuilder.cc
Expand Up @@ -32,6 +32,7 @@ GEMCSCSegmentBuilder::GEMCSCSegmentBuilder(const edm::ParameterSet& ps)
: // Ask factory to build this algorithm, giving it appropriate ParameterSet
algo{GEMCSCSegmentBuilderPluginFactory::get()->create(ps.getParameter<std::string>("algo_name"),
ps.getParameter<edm::ParameterSet>("algo_psets"))},
enable_me21_ge21_(ps.getParameter<bool>("enableME21GE21")),
gemgeom_{nullptr},
cscgeom_{nullptr} {
edm::LogVerbatim("GEMCSCSegmentBuilder")
Expand Down Expand Up @@ -120,14 +121,13 @@ void GEMCSCSegmentBuilder::build(const GEMRecHitCollection* recHits,
CSCDetId CSCId = segmIt->cscDetId();

// Search for Matches between GEM Roll and CSC Chamber
// - only matches between ME1/1(a&b) and GE1/1
// - notation: CSC ring 1 = ME1/1b; CSC ring 4 = ME1/1a

// Case A :: ME1/1 Segments can have GEM Rechits associated to them
// Case A :: ME1/1 and ME2/1 Segments can have GE1/1 and GE2/1 Rechits associated to them, respectively
// ================================================================
if (CSCId.station() == 1 && (CSCId.ring() == 1 || CSCId.ring() == 4)) {
if (CSCId.isME11() or (enable_me21_ge21_ and CSCId.isME21())) {
edm::LogVerbatim("GEMCSCSegmentBuilder")
<< "[GEMCSCSegmentBuilder :: build] Found ME1/1 Segment in " << CSCId.rawId() << " = " << CSCId << std::endl;
<< "[GEMCSCSegmentBuilder :: build] Found " << (CSCId.isME11() ? "ME1/1" : "ME2/1") << " Segment in "
<< CSCId.rawId() << " = " << CSCId;

// 1) Save the CSC Segment in CSC segment collection
// -------------------------------------------------
Expand Down Expand Up @@ -214,13 +214,13 @@ void GEMCSCSegmentBuilder::build(const GEMRecHitCollection* recHits,
}
} // end Loop over GEM Rolls
} // end Loop over GEM RecHits
} // end requirement of CSC segment in ME1/1
} // end requirement of CSC segment in ME1/1 or ME2/1

// Case B :: all other CSC Chambers have no GEM Chamber associated
// ===============================================================
else if (!(CSCId.station() == 1 && (CSCId.ring() == 1 || CSCId.ring() == 4))) {
edm::LogVerbatim("GEMCSCSegmentBuilder") << "[GEMCSCSegmentBuilder :: build] Found non-ME1/1 Segment in "
<< CSCId.rawId() << " = " << CSCId << std::endl;
else {
edm::LogVerbatim("GEMCSCSegmentBuilder")
<< "[GEMCSCSegmentBuilder :: build] Found a Segment in " << CSCId.rawId() << " = " << CSCId;

// get CSC segment vector associated to this CSCDetId
// if no vector is associated yet to this CSCDetId, create empty vector
Expand All @@ -230,10 +230,6 @@ void GEMCSCSegmentBuilder::build(const GEMRecHitCollection* recHits,
cscsegmentvector_noGEM.push_back(segmIt->clone());
cscSegColl_noGEM[CSCId.rawId()] = cscsegmentvector_noGEM;
}

else {
} // no other option

} // end Loop over csc segments

// === Now pass CSC Segments and GEM RecHits to the Segment Algorithm ===
Expand Down
1 change: 1 addition & 0 deletions RecoLocalMuon/GEMCSCSegment/plugins/GEMCSCSegmentBuilder.h
Expand Up @@ -80,6 +80,7 @@ class GEMCSCSegmentBuilder {

private:
std::unique_ptr<GEMCSCSegmentAlgorithm> algo;
const bool enable_me21_ge21_;
const GEMGeometry* gemgeom_;
const CSCGeometry* cscgeom_;
};
Expand Down
24 changes: 24 additions & 0 deletions RecoLocalMuon/GEMCSCSegment/plugins/GEMCSCSegmentProducer.cc
Expand Up @@ -34,6 +34,30 @@ GEMCSCSegmentProducer::~GEMCSCSegmentProducer() {
delete segmentBuilder_;
}

void GEMCSCSegmentProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
// gemcscSegments
edm::ParameterSetDescription desc;
desc.add<edm::InputTag>("inputObjectsGEM", edm::InputTag("gemRecHits"));
desc.add<edm::InputTag>("inputObjectsCSC", edm::InputTag("cscSegments"));
desc.add<bool>("enableME21GE21", false);
desc.add<std::string>("algo_name", "GEMCSCSegAlgoRR");
{
edm::ParameterSetDescription psd0;
psd0.addUntracked<bool>("GEMCSCDebug", true);
psd0.add<unsigned int>("minHitsPerSegment", 2);
psd0.add<bool>("preClustering", true);
psd0.add<double>("dXclusBoxMax", 1.0);
psd0.add<double>("dYclusBoxMax", 5.0);
psd0.add<bool>("preClusteringUseChaining", true);
psd0.add<double>("dPhiChainBoxMax", 1.0);
psd0.add<double>("dThetaChainBoxMax", 0.02);
psd0.add<double>("dRChainBoxMax", 0.5);
psd0.add<int>("maxRecHitsInCluster", 6);
desc.add<edm::ParameterSetDescription>("algo_psets", psd0);
}
descriptions.add("gemcscSegments", desc);
}

void GEMCSCSegmentProducer::produce(edm::Event& ev, const edm::EventSetup& setup) {
LogDebug("GEMCSCSegment") << "start producing segments for " << ++iev << "th event w/ gem and csc data";

Expand Down
6 changes: 4 additions & 2 deletions RecoLocalMuon/GEMCSCSegment/plugins/GEMCSCSegmentProducer.h
Expand Up @@ -11,9 +11,9 @@

#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/stream/EDProducer.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
#include "FWCore/Utilities/interface/InputTag.h"

#include "DataFormats/CSCRecHit/interface/CSCSegmentCollection.h"
Expand All @@ -31,6 +31,8 @@ class GEMCSCSegmentProducer : public edm::stream::EDProducer<> {
explicit GEMCSCSegmentProducer(const edm::ParameterSet&);
/// Destructor
~GEMCSCSegmentProducer() override;
/// generate gemcscSegment_cfi
static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
/// Produce the GEM-CSCSegment collection
void produce(edm::Event&, const edm::EventSetup&) override;

Expand Down
6 changes: 6 additions & 0 deletions RecoLocalMuon/GEMCSCSegment/python/gemcscSegments_cff.py
@@ -0,0 +1,6 @@
import FWCore.ParameterSet.Config as cms

from RecoLocalMuon.GEMCSCSegment.gemcscSegments_cfi import gemcscSegments

from Configuration.ProcessModifiers.gemcscSegmentsTesting_cff import gemcscSegmentsTesting
gemcscSegmentsTesting.toModify(gemcscSegments, enableME21GE21=True)
29 changes: 0 additions & 29 deletions RecoLocalMuon/GEMCSCSegment/python/gemcscSegments_cfi.py

This file was deleted.

3 changes: 3 additions & 0 deletions RecoLocalMuon/GEMCSCSegment/test/BuildFile.xml
Expand Up @@ -9,13 +9,16 @@
<use name="Geometry/Records"/>
<use name="SimDataFormats/Track"/>
<use name="SimDataFormats/TrackingHit"/>
<use name="CommonTools/UtilAlgos"/>
<use name="rootcore"/>
<use name="rootgraphics"/>
<use name="Root"/>
<use name="boost"/>
<flags EDM_PLUGIN="1"/>
<library file="TestGEMCSCSegmentAnalyzer.cc" name="testGEMCSCSegmentAnalyzer">
</library>
<library file="GEMCSCCoincidenceRateAnalyzer.cc" name="GEMCSCCoincidenceRateAnalyzer">
</library>

<export>
</export>