Skip to content

Commit

Permalink
Use a flag to turn ge21 demo. off
Browse files Browse the repository at this point in the history
  • Loading branch information
watson-ij committed Feb 8, 2022
1 parent 6f322eb commit 665318e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
10 changes: 9 additions & 1 deletion EventFilter/GEMRawToDigi/plugins/GEMRawToDigiModule.cc
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
8 changes: 3 additions & 5 deletions EventFilter/GEMRawToDigi/python/muonGEMDigis_cfi.py
Expand Up @@ -7,8 +7,6 @@
from Configuration.Eras.Modifier_phase2_GEM_cff import phase2_GEM

run2_GEM_2017.toModify(muonGEMDigis, useDBEMap = True)
# from DataFormats/FEDRawData/interface/FEDNumbering.h
MINGE21FEDID = 1469
MAXGEMFEDID = 1478
run3_GEM.toModify(muonGEMDigis, useDBEMap = True, fedIdEnd=MINGE21FEDID-1)
phase2_GEM.toModify(muonGEMDigis, useDBEMap = False, readMultiBX = True, fedIdEnd=MAXGEMFEDID)
# 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 665318e

Please sign in to comment.