@@ -40,16 +40,6 @@ void DecodingPostProcessing::configure(const boost::property_tree::ptree& config
4040
4141void 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
6867void 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
9593void 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