Skip to content

Commit befd114

Browse files
authored
ctpdev: removing dependencies on RunManager (#2367)
* fix: removing RunManager dependence * clang * fix: comment added
1 parent 635ab26 commit befd114

4 files changed

Lines changed: 46 additions & 14 deletions

File tree

Modules/CTP/include/CTP/CountersQcTask.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,19 @@
1919

2020
#include "QualityControl/TaskInterface.h"
2121
#include "DataFormatsCTP/Configuration.h"
22-
#include "DataFormatsCTP/RunManager.h"
2322
#include "TH1.h"
2423

2524
class TH1F;
2625
class TH1D;
2726
class TCanvas;
2827

2928
using namespace o2::quality_control::core;
30-
29+
//
30+
// Fake class to compile. If the task CTPCounterTask will beused it will be fixed or the whole task shall be removed.
31+
//
32+
class CTPRunManager
33+
{
34+
};
3135
namespace o2::quality_control_modules::ctp
3236
{
3337

@@ -97,7 +101,7 @@ class CTPCountersTask final : public TaskInterface
97101
std::array<TCanvas*, 16> mTCanvasClassRates = { nullptr };
98102
};
99103

100-
class CTPQcRunManager : public o2::ctp::CTPRunManager
104+
class CTPQcRunManager : public CTPRunManager
101105
{
102106
public:
103107
/// \brief Constructor

Modules/CTP/src/CTPTrendingTask.cxx

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include <QualityControl/ActivityHelpers.h>
2424
#include <CCDB/BasicCCDBManager.h>
2525
#include <DataFormatsCTP/Configuration.h>
26-
#include "DataFormatsCTP/RunManager.h"
26+
// #include "DataFormatsCTP/RunManager.h"
2727

2828
#include <TCanvas.h>
2929
#include <TH1.h>
@@ -51,10 +51,22 @@ void CTPTrendingTask::initCTP(Trigger& t)
5151
}
5252

5353
/// the reading of the ccdb from trending was already discussed and is related with the fact that CTPconfing may not be ready at the QC starts
54-
o2::ctp::CTPRunManager::setCCDBHost(CCDBHost);
54+
// o2::ctp::CTPRunManager::setCCDBHost(CCDBHost);
5555
bool ok;
56-
o2::ctp::CTPConfiguration CTPconfig = o2::ctp::CTPRunManager::getConfigFromCCDB(t.timestamp, run, ok);
57-
56+
// o2::ctp::CTPConfiguration CTPconfig = o2::ctp::CTPRunManager::getConfigFromCCDB(t.timestamp, run, ok);
57+
auto& mgr = o2::ccdb::BasicCCDBManager::instance();
58+
mgr.setURL(CCDBHost);
59+
map<string, string> metadata; // can be empty
60+
metadata["runNumber"] = run;
61+
auto ctpconfigdb = mgr.getSpecific<o2::ctp::CTPConfiguration>(o2::ctp::CCDBPathCTPConfig, t.timestamp, metadata);
62+
if (ctpconfigdb == nullptr) {
63+
LOG(info) << "CTP config not in database, timestamp:" << t.timestamp;
64+
ok = 0;
65+
} else {
66+
// ctpconfigdb->printStream(std::cout);
67+
LOG(info) << "CTP config found. Run:" << run;
68+
ok = 1;
69+
}
5870
if (!ok) {
5971
ILOG(Warning, Support) << "CTP Config not found for run:" << run << " timesamp " << t.timestamp << ENDM;
6072
return;
@@ -123,8 +135,10 @@ void CTPTrendingTask::initCTP(Trigger& t)
123135
}
124136

125137
// get the indices of the classes we want to trend
126-
std::vector<ctp::CTPClass> ctpcls = CTPconfig.getCTPClasses();
127-
std::vector<int> clslist = CTPconfig.getTriggerClassList();
138+
// std::vector<ctp::CTPClass> ctpcls = CTPconfig.getCTPClasses();
139+
// std::vector<int> clslist = CTPconfig.getTriggerClassList();
140+
std::vector<ctp::CTPClass> ctpcls = ctpconfigdb->getCTPClasses();
141+
std::vector<int> clslist = ctpconfigdb->getTriggerClassList();
128142
for (size_t i = 0; i < clslist.size(); i++) {
129143
for (size_t j = 0; j < mNumberOfClasses; j++) {
130144
if (ctpcls[i].name.find(mClassNames[j]) != std::string::npos) {

Modules/CTP/src/RawDataQcTask.cxx

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include "Headers/RAWDataHeader.h"
2525
#include "DataFormatsCTP/Digits.h"
2626
#include "DataFormatsCTP/Configuration.h"
27-
#include "DataFormatsCTP/RunManager.h"
27+
// #include "DataFormatsCTP/RunManager.h"
2828
#include <Framework/InputRecord.h>
2929
#include "Framework/TimingInfo.h"
3030

@@ -80,13 +80,27 @@ void CTPRawDataReaderTask::startOfActivity(const Activity& activity)
8080
ccdbName = "https://alice-ccdb.cern.ch";
8181
}
8282
/// the ccdb reading to be futher discussed
83-
o2::ctp::CTPRunManager::setCCDBHost(ccdbName);
83+
// o2::ctp::CTPRunManager::setCCDBHost(ccdbName);
8484
bool ok;
85-
o2::ctp::CTPConfiguration CTPconfig = o2::ctp::CTPRunManager::getConfigFromCCDB(mTimestamp, run, ok);
85+
// o2::ctp::CTPConfiguration CTPconfig = o2::ctp::CTPRunManager::getConfigFromCCDB(mTimestamp, run, ok);
86+
auto& mgr = o2::ccdb::BasicCCDBManager::instance();
87+
mgr.setURL(ccdbName);
88+
map<string, string> metadata; // can be empty
89+
metadata["runNumber"] = run;
90+
auto ctpconfigdb = mgr.getSpecific<o2::ctp::CTPConfiguration>(o2::ctp::CCDBPathCTPConfig, mTimestamp, metadata);
91+
if (ctpconfigdb == nullptr) {
92+
LOG(info) << "CTP config not in database, timestamp:" << mTimestamp;
93+
ok = 0;
94+
} else {
95+
// ctpconfigdb->printStream(std::cout);
96+
LOG(info) << "CTP config found. Run:" << run;
97+
ok = 1;
98+
}
8699
if (ok) {
87100
// get the index of the MB reference class
88101
ILOG(Info, Support) << "CTP config found, run:" << run << ENDM;
89-
std::vector<o2::ctp::CTPClass> ctpcls = CTPconfig.getCTPClasses();
102+
// std::vector<o2::ctp::CTPClass> ctpcls = CTPconfig.getCTPClasses();
103+
std::vector<o2::ctp::CTPClass> ctpcls = ctpconfigdb->getCTPClasses();
90104
for (size_t i = 0; i < ctpcls.size(); i++) {
91105
if (ctpcls[i].name.find(MBclassName) != std::string::npos) {
92106
mIndexMBclass = ctpcls[i].getIndex() + 1;

Modules/CTP/src/RawDataReaderCheck.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include "QualityControl/MonitorObject.h"
1919
#include "QualityControl/Quality.h"
2020
#include "QualityControl/QcInfoLogger.h"
21-
#include "DataFormatsCTP/RunManager.h"
21+
// #include "DataFormatsCTP/RunManager.h"
2222
#include <DataFormatsCTP/Configuration.h>
2323
// ROOT
2424
#include <TH1.h>

0 commit comments

Comments
 (0)