Skip to content

Commit 2f8cc88

Browse files
committed
fixes
1 parent a75a1a4 commit 2f8cc88

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

Detectors/CTP/workflowScalers/src/ctp-bk-write.cxx

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@
3737
#include <string>
3838
namespace bpo = boost::program_options;
3939
//
40-
40+
// Test in the lab
41+
// o2-ctp-bk-write -r 37 -s 1 -c 1 --ccdb='http://acsl-ccdb.cern.ch:8083' -b 'acsl-aliecs.cern.ch:4001' -t 1753185071753
42+
//
4143
int main(int argc, char** argv)
4244
{
4345
const std::string testCCDB = "http://ccdb-test.cern.ch:8080";
@@ -88,16 +90,18 @@ int main(int argc, char** argv)
8890
}
8991
// read input file
9092
std::string filename = vm["input-file"].as<std::string>();
91-
std::ifstream file(filename);
92-
if (!file.is_open()) {
93-
std::cout << "Cannot open file! Using only run:" << run << std::endl;
94-
} else {
95-
std::string line;
96-
while (std::getline(file, line)) {
97-
std::cout << line << "\n";
98-
std::vector<std::string> tokens = o2::utils::Str::tokenize(line, ' ');
99-
// int run = std::stoi(tokens[0]);
100-
runs.push_back(tokens[0]);
93+
if(filename != "none") {
94+
std::ifstream file(filename);
95+
if (!file.is_open()) {
96+
std::cout << "Cannot open file! Using only run:" << run << std::endl;
97+
} else {
98+
std::string line;
99+
while (std::getline(file, line)) {
100+
std::cout << line << "\n";
101+
std::vector<std::string> tokens = o2::utils::Str::tokenize(line, ' ');
102+
// int run = std::stoi(tokens[0]);
103+
runs.push_back(tokens[0]);
104+
}
101105
}
102106
}
103107
bool cfg = vm["cfg"].as<bool>();
@@ -119,8 +123,6 @@ int main(int argc, char** argv)
119123
}
120124
o2::ctp::ctpCCDBManager::setCCDBHost(ccdbAddress);
121125
std::cout << "CCDB: " << vm["ccdb"].as<std::string>() << " " << ccdbAddress << std::endl;
122-
// o2::ccdb::CcdbApi api;
123-
// api.init(ccdbAddress.c_str());
124126
std::map<std::string, std::string> metadata;
125127
for (auto const& run : runs) {
126128
metadata["runNumber"] = run;
@@ -148,8 +150,8 @@ int main(int argc, char** argv)
148150
std::array<uint64_t, 7> cntsbk = ctpcnts.getIntegralForClass(i);
149151
std::string clsname = ctpcfg.getClassNameFromHWIndex(cntsbk[0]);
150152
try {
151-
mBKClient->ctpTriggerCounters()->createOrUpdateForRun(runNumber, clsname, ts, cntsbk[1], cntsbk[2], cntsbk[3], cntsbk[4], cntsbk[5], cntsbk[6]);
152-
std::cout << runNumber << " clsname: " << clsname << "t:" << ts << "cnts:" << cntsbk[1] << " " << cntsbk[2] << " " << cntsbk[3] << " " << cntsbk[4] << " " << cntsbk[5] << " " << cntsbk[6] << std::endl;
153+
//mBKClient->ctpTriggerCounters()->createOrUpdateForRun(runNumber, clsname, ts, cntsbk[1], cntsbk[2], cntsbk[3], cntsbk[4], cntsbk[5], cntsbk[6]);
154+
std::cout << runNumber << " clsname: " << cntsbk[0] << " " << clsname << "t:" << ts << "cnts:" << cntsbk[1] << " " << cntsbk[2] << " " << cntsbk[3] << " " << cntsbk[4] << " " << cntsbk[5] << " " << cntsbk[6] << std::endl;
153155
;
154156

155157
} catch (std::runtime_error& error) {

0 commit comments

Comments
 (0)