Skip to content

Commit 9369699

Browse files
committed
Fix module numbering labels for GE2/1 Layer1 (display 5–8 instead of 1–4)
1 parent 57ccb0f commit 9369699

File tree

3 files changed

+22
-9
lines changed

3 files changed

+22
-9
lines changed

DQM/GEM/interface/GEMDQMBase.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,7 @@ class GEMDQMBase : public DQMEDAnalyzer {
604604
};
605605

606606
int SortingLayers(std::vector<ME4IdsKey> &listLayers);
607+
int getDisplayModuleNumber(int station, int layer, int module_number);
607608
dqm::impl::MonitorElement *CreateSummaryHist(DQMStore::IBooker &ibooker, TString strName);
608609

609610
template <typename T>
@@ -755,7 +756,7 @@ inline std::string GEMDQMBase::getNameDirLayer(ME4IdsKey key4) {
755756
char cRegion = (keyToRegion(key4) > 0 ? 'P' : 'M');
756757
auto nLayer = keyToLayer(key4);
757758
if (nStation == 2) {
758-
auto nModule = keyToModule(key4);
759+
auto nModule = getDisplayModuleNumber(nStation, nLayer, keyToModule(key4));
759760
return std::string(Form("GE%i1-%c-L%i-M%i", nStation, cRegion, nLayer, nModule));
760761
}
761762
return std::string(Form("GE%i1-%c-L%i", nStation, cRegion, nLayer));

DQM/GEM/plugins/GEMRecHitSource.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,8 @@ int GEMRecHitSource::ProcessWithMEMap3(BookingHelper& bh, ME3IdsKey key) {
166166
mapCLSOver5_.FindHist(key)->setYTitle("Module");
167167
}
168168
for (Int_t i = 1; i <= stationInfo.nNumModules_; i++) {
169-
std::string strLabel = std::string(Form("M%i", i));
169+
Int_t module_number = getDisplayModuleNumber(keyToStation(key), keyToLayer(key), i);
170+
std::string strLabel = std::string(Form("M%i", module_number));
170171
if (mapCLSAverage_.isOperating()) {
171172
mapCLSAverage_.FindHist(key)->setBinLabel(i, strLabel, 2);
172173
}
@@ -199,7 +200,8 @@ int GEMRecHitSource::ProcessWithMEMap4WithChamber(BookingHelper& bh, ME4IdsKey k
199200
mapCLSPerCh_.FindHist(key)->setYTitle("Module");
200201
}
201202
for (Int_t i = 1; i <= stationInfo.nNumModules_; i++) {
202-
std::string strLabel = std::string(Form("M%i", i));
203+
Int_t module_number = getDisplayModuleNumber(keyToStation(key), keyToLayer(key), i);
204+
std::string strLabel = std::string(Form("M%i", module_number));
203205
if (mapCLSPerCh_.isOperating()) {
204206
mapCLSPerCh_.FindHist(key)->setBinLabel(i, strLabel, 2);
205207
}

DQM/GEM/src/GEMDQMBase.cc

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,11 @@ int GEMDQMBase::SortingLayers(std::vector<ME4IdsKey>& listLayers) {
147147
return 0;
148148
}
149149

150+
int GEMDQMBase::getDisplayModuleNumber(int station, int layer, int module_number) {
151+
if (station == 2 && layer == 1) return module_number + 4;
152+
return module_number;
153+
}
154+
150155
dqm::impl::MonitorElement* GEMDQMBase::CreateSummaryHist(DQMStore::IBooker& ibooker, TString strName) {
151156
std::vector<ME4IdsKey> listLayers;
152157
for (auto const& [key3, stationInfo] : mapStationInfo_) {
@@ -175,14 +180,15 @@ dqm::impl::MonitorElement* GEMDQMBase::CreateSummaryHist(DQMStore::IBooker& iboo
175180

176181
auto region = keyToRegion(key);
177182
auto strInfo = GEMUtils::getSuffixName(key3); // NOTE: It starts with '_'
183+
auto module_number = getDisplayModuleNumber(keyToStation(key), keyToLayer(key), keyToModule(key));
178184
if (mapStationInfo_[key3].nNumModules_ > 1) {
179-
strInfo += Form("-M%i", keyToModule(key));
185+
strInfo += Form("-M%i", module_number);
180186
}
181187
auto label = Form("GE%+i1-%cL%i-M%i;%s",
182188
region * keyToStation(key),
183189
(region > 0 ? 'P' : 'M'),
184190
keyToLayer(key),
185-
keyToModule(key),
191+
module_number,
186192
strInfo.Data());
187193
h2Res->setBinLabel(i, label, 2);
188194
Int_t nNumCh = mapStationInfo_[key3].nNumChambers_;
@@ -246,8 +252,10 @@ int GEMDQMBase::GenerateMEPerChamber(DQMStore::IBooker& ibooker) {
246252
if (!MEMap4Check_[key4]) {
247253
Int_t nLa = gid.layer();
248254
TString strSuffixCh = Form("-L%i", nLa);
249-
if (mapStationInfo_[key3].nNumModules_ > 1)
250-
strSuffixCh = Form("-L%i-M%i", nLa, module_number);
255+
if (mapStationInfo_[key3].nNumModules_ > 1) {
256+
Int_t nMo = getDisplayModuleNumber(gid.station(), nLa, module_number);
257+
strSuffixCh = Form("-L%i-M%i", nLa, nMo);
258+
}
251259
auto strSuffixName = GEMUtils::getSuffixName(key2) + strSuffixCh;
252260
auto strSuffixTitle = GEMUtils::getSuffixTitle(key2) + strSuffixCh;
253261
BookingHelper bh4(ibooker, strSuffixName, strSuffixTitle);
@@ -270,8 +278,10 @@ int GEMDQMBase::GenerateMEPerChamber(DQMStore::IBooker& ibooker) {
270278
Int_t nLa = gid.layer();
271279
char cLS = (nCh % 2 == 0 ? 'L' : 'S'); // FIXME: Is it general enough?
272280
TString strSuffixCh = Form("-%02iL%i-%c", nCh, nLa, cLS);
273-
if (mapStationInfo_[key3].nNumModules_ > 1)
274-
strSuffixCh = Form("-%02iL%i-M%i-%c", nCh, nLa, module_number, cLS);
281+
if (mapStationInfo_[key3].nNumModules_ > 1) {
282+
Int_t nMo = getDisplayModuleNumber(gid.station(), nLa, module_number);
283+
strSuffixCh = Form("-%02iL%i-M%i-%c", nCh, nLa, nMo, cLS);
284+
}
275285
auto strSuffixName = GEMUtils::getSuffixName(key2) + strSuffixCh;
276286
auto strSuffixTitle = GEMUtils::getSuffixTitle(key2) + strSuffixCh;
277287
BookingHelper bh5Ch(ibooker, strSuffixName, strSuffixTitle);

0 commit comments

Comments
 (0)