Skip to content

Commit a81dda7

Browse files
authored
[MCH] make LastCycle and trending plots optional (#2532)
The LastCycle plots have been introduced as a workaround to mimic the moving windows, before they were implemented in the framework. Since the moving windows are now the proper way to produce plots for a single QC cycle, the processing of LastCycle plots is made optional and disabled by default. The creation of trending plots is also made optional and disabled by default. It should be enabled for the tasks that process the moving window outputs.
1 parent a81dd4f commit a81dda7

File tree

7 files changed

+254
-185
lines changed

7 files changed

+254
-185
lines changed

Modules/MUON/MCH/include/MCH/DecodingPostProcessing.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ class DecodingPostProcessing : public PostProcessingInterface
7474
static std::string syncStatusSourceName() { return "syncstatus"; }
7575

7676
bool mFullHistos{ false };
77+
bool mEnableLastCycleHistos{ false };
78+
bool mEnableTrending{ false };
7779

7880
PostProcessingConfigMCH mConfig;
7981

Modules/MUON/MCH/include/MCH/DigitsPostProcessing.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,10 @@ class DigitsPostProcessing : public PostProcessingInterface
6262
static std::string orbitsSourceName() { return "orbits"; }
6363
static std::string orbitsSignalSourceName() { return "orbits_signal"; }
6464

65-
int64_t mRefTimeStamp{ 0 };
6665
bool mFullHistos{ false };
66+
bool mEnableLastCycleHistos{ false };
67+
bool mEnableTrending{ false };
68+
6769
float mChannelRateMin{ 0 };
6870
float mChannelRateMax{ 100 };
6971

Modules/MUON/MCH/include/MCH/PreclustersPostProcessing.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ class PreclustersPostProcessing : public PostProcessingInterface
7474
static std::string clusterSizeSourceName() { return "clsize"; }
7575

7676
bool mFullHistos{ false };
77+
bool mEnableLastCycleHistos{ false };
78+
bool mEnableTrending{ false };
7779

7880
PostProcessingConfigMCH mConfig;
7981

Modules/MUON/MCH/src/DecodingPostProcessing.cxx

Lines changed: 53 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,6 @@ void DecodingPostProcessing::configure(const boost::property_tree::ptree& config
4040

4141
void DecodingPostProcessing::createDecodingErrorsHistos(Trigger t, repository::DatabaseInterface* qcdb)
4242
{
43-
//------------------------------------------
44-
// Helpers to extract plots from last cycle
45-
//------------------------------------------
46-
47-
auto obj = mCcdbObjects.find(errorsSourceName());
48-
if (obj != mCcdbObjects.end()) {
49-
mErrorsOnCycle.reset();
50-
mErrorsOnCycle = std::make_unique<HistoOnCycle<TH2FRatio>>();
51-
}
52-
5343
//----------------------------------
5444
// Decoding errors plotters
5545
//----------------------------------
@@ -58,25 +48,24 @@ void DecodingPostProcessing::createDecodingErrorsHistos(Trigger t, repository::D
5848
mErrorsPlotter = std::make_unique<DecodingErrorsPlotter>("DecodingErrors/");
5949
mErrorsPlotter->publish(getObjectsManager(), core::PublicationPolicy::ThroughStop);
6050

61-
mErrorsPlotterOnCycle.reset();
62-
mErrorsPlotterOnCycle = std::make_unique<DecodingErrorsPlotter>("DecodingErrors/LastCycle/");
63-
mErrorsPlotterOnCycle->publish(getObjectsManager(), core::PublicationPolicy::ThroughStop);
51+
if (mEnableLastCycleHistos) {
52+
// Helpers to extract plots from last cycle
53+
auto obj = mCcdbObjects.find(errorsSourceName());
54+
if (obj != mCcdbObjects.end()) {
55+
mErrorsOnCycle.reset();
56+
mErrorsOnCycle = std::make_unique<HistoOnCycle<TH2FRatio>>();
57+
}
58+
59+
mErrorsPlotterOnCycle.reset();
60+
mErrorsPlotterOnCycle = std::make_unique<DecodingErrorsPlotter>("DecodingErrors/LastCycle/");
61+
mErrorsPlotterOnCycle->publish(getObjectsManager(), core::PublicationPolicy::ThroughStop);
62+
}
6463
}
6564

6665
//_________________________________________________________________________________________
6766

6867
void DecodingPostProcessing::createHeartBeatPacketsHistos(Trigger t, repository::DatabaseInterface* qcdb)
6968
{
70-
//------------------------------------------
71-
// Helpers to extract plots from last cycle
72-
//------------------------------------------
73-
74-
auto obj = mCcdbObjects.find(hbPacketsSourceName());
75-
if (obj != mCcdbObjects.end()) {
76-
mHBPacketsOnCycle.reset();
77-
mHBPacketsOnCycle = std::make_unique<HistoOnCycle<TH2FRatio>>();
78-
}
79-
8069
//----------------------------------
8170
// HeartBeat packets plotters
8271
//----------------------------------
@@ -85,25 +74,24 @@ void DecodingPostProcessing::createHeartBeatPacketsHistos(Trigger t, repository:
8574
mHBPacketsPlotter = std::make_unique<HeartBeatPacketsPlotter>("HeartBeatPackets/", mFullHistos);
8675
mHBPacketsPlotter->publish(getObjectsManager(), core::PublicationPolicy::ThroughStop);
8776

88-
mHBPacketsPlotterOnCycle.reset();
89-
mHBPacketsPlotterOnCycle = std::make_unique<HeartBeatPacketsPlotter>("HeartBeatPackets/LastCycle/", mFullHistos);
90-
mHBPacketsPlotterOnCycle->publish(getObjectsManager(), core::PublicationPolicy::ThroughStop);
77+
if (mEnableLastCycleHistos) {
78+
// Helpers to extract plots from last cycle
79+
auto obj = mCcdbObjects.find(hbPacketsSourceName());
80+
if (obj != mCcdbObjects.end()) {
81+
mHBPacketsOnCycle.reset();
82+
mHBPacketsOnCycle = std::make_unique<HistoOnCycle<TH2FRatio>>();
83+
}
84+
85+
mHBPacketsPlotterOnCycle.reset();
86+
mHBPacketsPlotterOnCycle = std::make_unique<HeartBeatPacketsPlotter>("HeartBeatPackets/LastCycle/", mFullHistos);
87+
mHBPacketsPlotterOnCycle->publish(getObjectsManager(), core::PublicationPolicy::ThroughStop);
88+
}
9189
}
9290

9391
//_________________________________________________________________________________________
9492

9593
void DecodingPostProcessing::createSyncStatusHistos(Trigger t, repository::DatabaseInterface* qcdb)
9694
{
97-
//------------------------------------------
98-
// Helpers to extract plots from last cycle
99-
//------------------------------------------
100-
101-
auto obj = mCcdbObjects.find(syncStatusSourceName());
102-
if (obj != mCcdbObjects.end()) {
103-
mSyncStatusOnCycle.reset();
104-
mSyncStatusOnCycle = std::make_unique<HistoOnCycle<TH2FRatio>>();
105-
}
106-
10795
//----------------------------------
10896
// Sync status plotters
10997
//----------------------------------
@@ -112,9 +100,18 @@ void DecodingPostProcessing::createSyncStatusHistos(Trigger t, repository::Datab
112100
mSyncStatusPlotter = std::make_unique<FECSyncStatusPlotter>("SyncErrors/");
113101
mSyncStatusPlotter->publish(getObjectsManager(), core::PublicationPolicy::ThroughStop);
114102

115-
mSyncStatusPlotterOnCycle.reset();
116-
mSyncStatusPlotterOnCycle = std::make_unique<FECSyncStatusPlotter>("SyncErrors/LastCycle/");
117-
mSyncStatusPlotterOnCycle->publish(getObjectsManager(), core::PublicationPolicy::ThroughStop);
103+
if (mEnableLastCycleHistos) {
104+
// Helpers to extract plots from last cycle
105+
auto obj = mCcdbObjects.find(syncStatusSourceName());
106+
if (obj != mCcdbObjects.end()) {
107+
mSyncStatusOnCycle.reset();
108+
mSyncStatusOnCycle = std::make_unique<HistoOnCycle<TH2FRatio>>();
109+
}
110+
111+
mSyncStatusPlotterOnCycle.reset();
112+
mSyncStatusPlotterOnCycle = std::make_unique<FECSyncStatusPlotter>("SyncErrors/LastCycle/");
113+
mSyncStatusPlotterOnCycle->publish(getObjectsManager(), core::PublicationPolicy::ThroughStop);
114+
}
118115
}
119116

120117
//_________________________________________________________________________________________
@@ -125,6 +122,8 @@ void DecodingPostProcessing::initialize(Trigger t, framework::ServiceRegistryRef
125122
const auto& activity = t.activity;
126123

127124
mFullHistos = getConfigurationParameter<bool>(mCustomParameters, "FullHistos", mFullHistos, activity);
125+
mEnableLastCycleHistos = getConfigurationParameter<bool>(mCustomParameters, "EnableLastCycleHistos", mEnableLastCycleHistos, activity);
126+
mEnableTrending = getConfigurationParameter<bool>(mCustomParameters, "EnableTrending", mEnableTrending, activity);
128127

129128
mCcdbObjects.clear();
130129
mCcdbObjects.emplace(errorsSourceName(), CcdbObjectHelper());
@@ -176,9 +175,11 @@ void DecodingPostProcessing::updateDecodingErrorsHistos(Trigger t, repository::D
176175
TH2FRatio* hr = obj->second.get<TH2FRatio>();
177176
if (hr) {
178177
mErrorsPlotter->update(hr);
179-
// extract the average occupancies on the last cycle
180-
mErrorsOnCycle->update(hr);
181-
mErrorsPlotterOnCycle->update(mErrorsOnCycle.get());
178+
if (mEnableLastCycleHistos) {
179+
// extract the average occupancies on the last cycle
180+
mErrorsOnCycle->update(hr);
181+
mErrorsPlotterOnCycle->update(mErrorsOnCycle.get());
182+
}
182183
}
183184
}
184185
}
@@ -192,9 +193,11 @@ void DecodingPostProcessing::updateHeartBeatPacketsHistos(Trigger t, repository:
192193
TH2FRatio* hr = obj->second.get<TH2FRatio>();
193194
if (hr) {
194195
mHBPacketsPlotter->update(hr);
195-
// extract the average occupancies on the last cycle
196-
mHBPacketsOnCycle->update(hr);
197-
mHBPacketsPlotterOnCycle->update(mHBPacketsOnCycle.get());
196+
if (mEnableLastCycleHistos) {
197+
// extract the average occupancies on the last cycle
198+
mHBPacketsOnCycle->update(hr);
199+
mHBPacketsPlotterOnCycle->update(mHBPacketsOnCycle.get());
200+
}
198201
}
199202
}
200203
}
@@ -208,9 +211,11 @@ void DecodingPostProcessing::updateSyncStatusHistos(Trigger t, repository::Datab
208211
TH2F* hr = obj->second.get<TH2FRatio>();
209212
if (hr) {
210213
mSyncStatusPlotter->update(hr);
211-
// extract the average occupancies on the last cycle
212-
mSyncStatusOnCycle->update(hr);
213-
mSyncStatusPlotterOnCycle->update(mSyncStatusOnCycle.get());
214+
if (mEnableLastCycleHistos) {
215+
// extract the average occupancies on the last cycle
216+
mSyncStatusOnCycle->update(hr);
217+
mSyncStatusPlotterOnCycle->update(mSyncStatusOnCycle.get());
218+
}
214219
}
215220
}
216221
}

0 commit comments

Comments
 (0)