Skip to content

Commit b152705

Browse files
authored
Merge pull request #49191 from hyokyu-choi/master
Update for Labels of GE2/1 Layers on GEM online DQM
2 parents 49f114c + 7bfa232 commit b152705

File tree

3 files changed

+24
-9
lines changed

3 files changed

+24
-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: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,13 @@ int GEMDQMBase::SortingLayers(std::vector<ME4IdsKey>& listLayers) {
147147
return 0;
148148
}
149149

150+
int GEMDQMBase::getDisplayModuleNumber(int station, int layer, int module_number) {
151+
// For GE2/1 Layer 1, labeling module numbers as 5–8 instead of 1–4
152+
if (station == 2 && layer == 1)
153+
return module_number + 4;
154+
return module_number;
155+
}
156+
150157
dqm::impl::MonitorElement* GEMDQMBase::CreateSummaryHist(DQMStore::IBooker& ibooker, TString strName) {
151158
std::vector<ME4IdsKey> listLayers;
152159
for (auto const& [key3, stationInfo] : mapStationInfo_) {
@@ -175,14 +182,15 @@ dqm::impl::MonitorElement* GEMDQMBase::CreateSummaryHist(DQMStore::IBooker& iboo
175182

176183
auto region = keyToRegion(key);
177184
auto strInfo = GEMUtils::getSuffixName(key3); // NOTE: It starts with '_'
185+
auto module_number = getDisplayModuleNumber(keyToStation(key), keyToLayer(key), keyToModule(key));
178186
if (mapStationInfo_[key3].nNumModules_ > 1) {
179-
strInfo += Form("-M%i", keyToModule(key));
187+
strInfo += Form("-M%i", module_number);
180188
}
181189
auto label = Form("GE%+i1-%cL%i-M%i;%s",
182190
region * keyToStation(key),
183191
(region > 0 ? 'P' : 'M'),
184192
keyToLayer(key),
185-
keyToModule(key),
193+
module_number,
186194
strInfo.Data());
187195
h2Res->setBinLabel(i, label, 2);
188196
Int_t nNumCh = mapStationInfo_[key3].nNumChambers_;
@@ -246,8 +254,10 @@ int GEMDQMBase::GenerateMEPerChamber(DQMStore::IBooker& ibooker) {
246254
if (!MEMap4Check_[key4]) {
247255
Int_t nLa = gid.layer();
248256
TString strSuffixCh = Form("-L%i", nLa);
249-
if (mapStationInfo_[key3].nNumModules_ > 1)
250-
strSuffixCh = Form("-L%i-M%i", nLa, module_number);
257+
if (mapStationInfo_[key3].nNumModules_ > 1) {
258+
Int_t nMo = getDisplayModuleNumber(gid.station(), nLa, module_number);
259+
strSuffixCh = Form("-L%i-M%i", nLa, nMo);
260+
}
251261
auto strSuffixName = GEMUtils::getSuffixName(key2) + strSuffixCh;
252262
auto strSuffixTitle = GEMUtils::getSuffixTitle(key2) + strSuffixCh;
253263
BookingHelper bh4(ibooker, strSuffixName, strSuffixTitle);
@@ -270,8 +280,10 @@ int GEMDQMBase::GenerateMEPerChamber(DQMStore::IBooker& ibooker) {
270280
Int_t nLa = gid.layer();
271281
char cLS = (nCh % 2 == 0 ? 'L' : 'S'); // FIXME: Is it general enough?
272282
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);
283+
if (mapStationInfo_[key3].nNumModules_ > 1) {
284+
Int_t nMo = getDisplayModuleNumber(gid.station(), nLa, module_number);
285+
strSuffixCh = Form("-%02iL%i-M%i-%c", nCh, nLa, nMo, cLS);
286+
}
275287
auto strSuffixName = GEMUtils::getSuffixName(key2) + strSuffixCh;
276288
auto strSuffixTitle = GEMUtils::getSuffixTitle(key2) + strSuffixCh;
277289
BookingHelper bh5Ch(ibooker, strSuffixName, strSuffixTitle);

0 commit comments

Comments
 (0)