99// granted to it by virtue of its status as an Intergovernmental Organization
1010// or submit itself to any jurisdiction.
1111
12- // / \file AgingLaserPostProcTask.h
12+ // / \file AgingLaserPostProcTask.cxx
1313// / \author Andreas Molander <andreas.molander@cern.ch>, Jakub Muszyński <jakub.milosz.muszynski@cern.ch>
1414
1515#include " FT0/AgingLaserPostProcTask.h"
2828#include < string>
2929
3030using namespace o2 ::quality_control::postprocessing;
31+ using namespace o2 ::quality_control_modules::fit;
3132
3233namespace o2 ::quality_control_modules::ft0
3334{
3435
3536AgingLaserPostProcTask::~AgingLaserPostProcTask () = default ;
3637
37- void AgingLaserPostProcTask::initialize (Trigger, framework::ServiceRegistryRef )
38+ void AgingLaserPostProcTask::configure ( const boost::property_tree::ptree& cfg )
3839{
39- ILOG (Info) << " initialize AgingLaserPostProcTask" << ENDM ;
40-
41- const std::string detChs = o2::quality_control_modules::common::getFromConfig<std::string>(
42- mCustomParameters , " detectorChannelIDs" , " " );
43- if (!detChs.empty ()) {
44- mDetectorChIDs = fit::helper::parseParameters<uint8_t >(detChs, " ," );
45- } else { // default: all detector channels 0–207
46- mDetectorChIDs .resize (208 );
47- std::iota (mDetectorChIDs .begin (), mDetectorChIDs .end (), 0 );
40+ const char * cfgPath = Form (" qc.postprocessing.%s" , getID ().c_str ());
41+ const char * cfgCustom = Form (" %s.custom" , cfgPath);
42+
43+ mPostProcHelper .configure (cfg, cfgPath, " FT0" );
44+
45+ auto key = [&cfgCustom](const std::string& e) { return Form (" %s.%s" , cfgCustom, e.c_str ()); };
46+
47+ mAmpMoPath = helper::getConfigFromPropertyTree<std::string>(cfg, key (" agingTaskSourcePath" ), mAmpMoPath );
48+
49+ mDetectorChIDs .resize (208 );
50+ std::iota (mDetectorChIDs .begin (), mDetectorChIDs .end (), 0 );
51+ const std::string detSkip =
52+ helper::getConfigFromPropertyTree<std::string>(cfg, key (" ignoreDetectorChannels" ), " " );
53+ if (!detSkip.empty ()) {
54+ auto toSkip = fit::helper::parseParameters<uint8_t >(detSkip, " ," );
55+ for (auto s : toSkip) {
56+ mDetectorChIDs .erase (std::remove (mDetectorChIDs .begin (), mDetectorChIDs .end (), s),
57+ mDetectorChIDs .end ());
58+ }
4859 }
4960
50- const std::string refChs = o2::quality_control_modules::common::getFromConfig<std::string>(
51- mCustomParameters , " referenceChannelIDs" , " " );
52- if (!refChs.empty ()) {
53- mReferenceChIDs = fit::helper::parseParameters<uint8_t >(refChs, " ," );
54- } else { // default: 208–210
55- for (uint8_t ch = 208 ; ch < 211 ; ++ch)
56- mReferenceChIDs .push_back (ch);
61+ // Reference channels: default 208–210, then remove skipped ones
62+ mReferenceChIDs .clear ();
63+ for (uint8_t ch = 208 ; ch < 211 ; ++ch) {
64+ mReferenceChIDs .push_back (ch);
5765 }
66+ const std::string refSkip =
67+ helper::getConfigFromPropertyTree<std::string>(cfg, key (" ignoreRefChannels" ), " " );
68+ if (!refSkip.empty ()) {
69+ auto toSkip = fit::helper::parseParameters<uint8_t >(refSkip, " ," );
70+ for (auto s : toSkip) {
71+ mReferenceChIDs .erase (std::remove (mReferenceChIDs .begin (), mReferenceChIDs .end (), s),
72+ mReferenceChIDs .end ());
73+ }
74+ }
75+
76+ mADCSearchMin = helper::getConfigFromPropertyTree<double >(cfg, key (" refPeakWindowMin" ), mADCSearchMin );
77+ mADCSearchMax = helper::getConfigFromPropertyTree<double >(cfg, key (" refPeakWindowMax" ), mADCSearchMax );
78+ mFracWindowA = helper::getConfigFromPropertyTree<double >(cfg, key (" fracWindowLow" ), mFracWindowA );
79+ mFracWindowB = helper::getConfigFromPropertyTree<double >(cfg, key (" fracWindowHigh" ), mFracWindowB );
80+ }
5881
59- mADCSearchMin = o2::quality_control_modules::common::getFromConfig<double >(
60- mCustomParameters , " adcSearchMin" , mADCSearchMin );
61- mADCSearchMax = o2::quality_control_modules::common::getFromConfig<double >(
62- mCustomParameters , " adcSearchMax" , mADCSearchMax );
63- mFracWindowA = o2::quality_control_modules::common::getFromConfig<double >(
64- mCustomParameters , " fracWindowA" , mFracWindowA );
65- mFracWindowB = o2::quality_control_modules::common::getFromConfig<double >(
66- mCustomParameters , " fracWindowB" , mFracWindowB );
82+ void AgingLaserPostProcTask::initialize (Trigger, framework::ServiceRegistryRef)
83+ {
84+ ILOG (Debug, Devel) << " initialize AgingLaserPostProcTask" << ENDM ;
6785
68- ILOG (Info) << " detector channels : " << detChs << ENDM ;
69- ILOG (Info) << " reference channels : " << refChs << ENDM ;
70- ILOG (Info) << " ADC search window : [" << mADCSearchMin << " , " << mADCSearchMax << " ]" << ENDM ;
71- ILOG (Info) << " fractional window : a=" << mFracWindowA << " b=" << mFracWindowB << ENDM ;
86+ ILOG (Debug, Devel) << " agingTaskSourcePath : " << mAmpMoPath << ENDM ;
87+ ILOG (Debug, Devel) << " ADC search window : [" << mADCSearchMin << " , " << mADCSearchMax << " ]" << ENDM ;
88+ ILOG (Debug, Devel) << " fractional window : a=" << mFracWindowA << " b=" << mFracWindowB << ENDM ;
7289
7390 mAmpVsChNormWeightedMeanA = fit::helper::registerHist<TH1F >(
7491 getObjectsManager (),
@@ -90,11 +107,11 @@ void AgingLaserPostProcTask::update(Trigger t, framework::ServiceRegistryRef srv
90107
91108 /* ---- fetch source histogram ---- */
92109 auto & qcdb = srv.get <quality_control::repository::DatabaseInterface>();
93- auto moIn = qcdb.retrieveMO (" FT0/MO/AgingLaser " , " AmpPerChannel" , t.timestamp , t.activity );
110+ auto moIn = qcdb.retrieveMO (mAmpMoPath , " AmpPerChannel" , t.timestamp , t.activity );
94111 TH2 * h2amp = moIn ? dynamic_cast <TH2 *>(moIn->getObject ()) : nullptr ;
95112
96113 if (!h2amp) {
97- ILOG (Error) << " Could not retrieve FT0/MO/AgingLaser /AmpPerChannel for timestamp "
114+ ILOG (Error) << " Could not retrieve " << mAmpMoPath << " /AmpPerChannel for timestamp "
98115 << t.timestamp << ENDM ;
99116 return ;
100117 }
@@ -164,15 +181,16 @@ void AgingLaserPostProcTask::update(Trigger t, framework::ServiceRegistryRef srv
164181 }
165182 };
166183
167- for (uint8_t ch = 0 ; ch < sNCHANNELS_PM ; ++ch)
184+ for (auto ch : mDetectorChIDs ) {
168185 processChannel (ch);
186+ }
169187
170- ILOG (Info ) << " update done – " << nRef << " reference fits, norm=" << norm << ENDM ;
188+ ILOG (Debug, Devel ) << " update done – " << nRef << " reference fits, norm=" << norm << ENDM ;
171189}
172190
173191void AgingLaserPostProcTask::finalize (Trigger, framework::ServiceRegistryRef)
174192{
175- ILOG (Info ) << " finalize AgingLaserPostProcTask" << ENDM ;
193+ ILOG (Debug, Devel ) << " finalize AgingLaserPostProcTask" << ENDM ;
176194}
177195
178- } // namespace o2::quality_control_modules::ft0
196+ } // namespace o2::quality_control_modules::ft0
0 commit comments