Skip to content

Commit

Permalink
Merge pull request #36910 from watson-ij/gem-turn-off-demo-unpacker-b…
Browse files Browse the repository at this point in the history
…ackport

Gem turn off demo unpacker - 12_2_X backport of #36769
  • Loading branch information
cmsbuild authored Feb 9, 2022
2 parents 3662f17 + 665318e commit 3052139
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
10 changes: 9 additions & 1 deletion EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class GEMRawToDigiModule : public edm::global::EDProducer<edm::RunCache<GEMROMap
private:
edm::EDGetTokenT<FEDRawDataCollection> fed_token;
edm::ESGetToken<GEMeMap, GEMeMapRcd> gemEMapToken_;
bool useDBEMap_, keepDAQStatus_, readMultiBX_;
bool useDBEMap_, keepDAQStatus_, readMultiBX_, ge21Off_;
unsigned int fedIdStart_, fedIdEnd_;
std::unique_ptr<GEMRawToDigi> gemRawToDigi_;
};
Expand All @@ -58,6 +58,7 @@ GEMRawToDigiModule::GEMRawToDigiModule(const edm::ParameterSet& pset)
useDBEMap_(pset.getParameter<bool>("useDBEMap")),
keepDAQStatus_(pset.getParameter<bool>("keepDAQStatus")),
readMultiBX_(pset.getParameter<bool>("readMultiBX")),
ge21Off_(pset.getParameter<bool>("ge21Off")),
fedIdStart_(pset.getParameter<unsigned int>("fedIdStart")),
fedIdEnd_(pset.getParameter<unsigned int>("fedIdEnd")),
gemRawToDigi_(std::make_unique<GEMRawToDigi>()) {
Expand All @@ -71,6 +72,12 @@ GEMRawToDigiModule::GEMRawToDigiModule(const edm::ParameterSet& pset)
if (useDBEMap_) {
gemEMapToken_ = esConsumes<GEMeMap, GEMeMapRcd, edm::Transition::BeginRun>();
}
if (ge21Off_ && fedIdStart_ == FEDNumbering::MINGEMFEDID && fedIdEnd_ == FEDNumbering::MAXGEMFEDID) {
fedIdEnd_ = FEDNumbering::MINGE21FEDID - 1;
} else if (ge21Off_) {
edm::LogError("InvalidSettings") << "Turning GE2/1 off requires changing the FEDIDs the GEM unpacker looks at. If "
"you wish to set the FEDIDs yourself, don't use the ge21Off switch.";
}
}

void GEMRawToDigiModule::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
Expand All @@ -79,6 +86,7 @@ void GEMRawToDigiModule::fillDescriptions(edm::ConfigurationDescriptions& descri
desc.add<bool>("useDBEMap", false);
desc.add<bool>("keepDAQStatus", false);
desc.add<bool>("readMultiBX", false);
desc.add<bool>("ge21Off", false);
desc.add<unsigned int>("fedIdStart", FEDNumbering::MINGEMFEDID);
desc.add<unsigned int>("fedIdEnd", FEDNumbering::MAXGEMFEDID);
descriptions.add("muonGEMDigisDefault", desc);
Expand Down
5 changes: 3 additions & 2 deletions EventFilter/GEMRawToDigi/python/muonGEMDigis_cfi.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
from Configuration.Eras.Modifier_phase2_GEM_cff import phase2_GEM

run2_GEM_2017.toModify(muonGEMDigis, useDBEMap = True)
run3_GEM.toModify(muonGEMDigis, useDBEMap = True)
phase2_GEM.toModify(muonGEMDigis, useDBEMap = False, readMultiBX = True)
# Note that by default we don't unpack the GE2/1 demonstrator digis in run3
run3_GEM.toModify(muonGEMDigis, useDBEMap = True, ge21Off = True)
phase2_GEM.toModify(muonGEMDigis, useDBEMap = False, readMultiBX = True, ge21Off = False)

0 comments on commit 3052139

Please sign in to comment.