Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions Detectors/CTP/workflowScalers/src/RunManager.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -216,14 +216,14 @@ int CTPRunManager::addScalers(uint32_t irun, std::time_t time, bool start)
}
scalrec.intRecord.bc = 0;
mActiveRuns[irun]->scalers.addScalerRacordRaw(scalrec);
LOG(info) << "Adding scalers for orbit:" << scalrec.intRecord.orbit;
LOG(debug) << "Adding scalers for orbit:" << scalrec.intRecord.orbit;
// scalrec.printStream(std::cout);
// printCounters();
return 0;
}
int CTPRunManager::processMessage(std::string& topic, const std::string& message)
{
LOG(info) << "Processing message with topic:" << topic;
LOG(debug) << "Processing message with topic:" << topic;
std::string firstcounters;
if (topic.find("clear") != std::string::npos) {
mRunsLoaded.clear();
Expand Down Expand Up @@ -283,7 +283,7 @@ int CTPRunManager::processMessage(std::string& topic, const std::string& message
// get config
size_t irun = message.find("run");
if (irun == std::string::npos) {
LOG(warning) << "run keyword not found in SOX";
LOG(debug) << "run keyword not found in SOX";
irun = message.size();
}
LOG(info) << "SOX received, Run keyword position:" << irun;
Expand Down Expand Up @@ -319,22 +319,22 @@ int CTPRunManager::processMessage(std::string& topic, const std::string& message
}
double timeStamp = std::stold(tokens.at(0));
std::time_t tt = timeStamp;
LOG(info) << "Processing scalers, all good, time:" << tokens.at(0) << " " << std::asctime(std::localtime(&tt));
LOG(debug) << "Processing scalers, all good, time:" << tokens.at(0) << " " << std::asctime(std::localtime(&tt));
for (uint32_t i = 1; i < tokens.size(); i++) {
mCounters[i - 1] = std::stoull(tokens.at(i));
if (i < (NRUNS + 1)) {
std::cout << mCounters[i - 1] << " ";
// std::cout << mCounters[i - 1] << " ";
}
}
std::cout << std::endl;
LOG(info) << "Counter size:" << tokens.size();
// std::cout << std::endl;
LOG(debug) << "Counter size:" << tokens.size();
//
for (uint32_t i = 0; i < NRUNS; i++) {
if ((mCounters[i] == 0) && (mActiveRunNumbers[i] == 0)) {
// not active
} else if ((mCounters[i] != 0) && (mActiveRunNumbers[i] == mCounters[i])) {
// active , do scalers
LOG(info) << "Run continue:" << mCounters[i];
LOG(debug) << "Run continue:" << mCounters[i];
addScalers(i, tt);
// LOG(info) << " QC period:" << mActiveRunNumbers[i] << " " << mActiveRuns[i]->qcwpcount << " " << mQCWritePeriod;
if (mActiveRuns[i]->qcwpcount > mQCWritePeriod) {
Expand Down Expand Up @@ -367,7 +367,7 @@ int CTPRunManager::processMessage(std::string& topic, const std::string& message
}
}
mEOX = 0;
printActiveRuns();
// printActiveRuns();
return 0;
}
void CTPRunManager::printActiveRuns() const
Expand Down
11 changes: 10 additions & 1 deletion Detectors/CTP/workflowScalers/src/ctp-proxy.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ InjectorFunction dcs2dpl(std::string& ccdbhost, std::string& bkhost, std::string
runMgr->setCtpCfgDir(ctpcfgdir);
runMgr->init();
// runMgr->setClient(client);
static int nprint = 0;
return [runMgr](TimingInfo&, ServiceRegistryRef const& services, fair::mq::Parts& parts, ChannelRetriever channelRetriever, size_t newTimesliceId, bool& stop) -> bool {
// FIXME: Why isn't this function using the timeslice index?
// make sure just 2 messages received
Expand All @@ -66,7 +67,15 @@ InjectorFunction dcs2dpl(std::string& ccdbhost, std::string& bkhost, std::string
std::string messageHeader{static_cast<const char*>(parts.At(0)->GetData()), parts.At(0)->GetSize()};
size_t dataSize = parts.At(1)->GetSize();
std::string messageData{static_cast<const char*>(parts.At(1)->GetData()), parts.At(1)->GetSize()};
LOG(info) << "received message " << messageHeader << " of size " << dataSize << " # parts:" << parts.Size(); // << " Payload:" << messageData;
nprint++;
int nlimit = 60;
int nrange = 8;
if (nprint > nlimit && nprint < (nlimit + nrange + 1)) {
LOG(info) << "received message " << messageHeader << " of size " << dataSize << " # parts:" << parts.Size(); // << " Payload:" << messageData;
if (nprint == (nlimit + nrange)) {
nprint = 0;
}
}
runMgr->processMessage(messageHeader, messageData);
return true;
};
Expand Down
4 changes: 2 additions & 2 deletions Detectors/CTP/workflowScalers/src/ctpCCDBManager.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ int ctpCCDBManager::saveRunScalersToCCDB(CTPRunScalers& scalers, long timeStart,
{
// data base
if (mCCDBHost == "none") {
LOG(info) << "Scalers not written to CCDB none";
LOG(debug) << "Scalers not written to CCDB none";
return 0;
}
// CTPActiveRun* run = mActiveRuns[i];
Expand Down Expand Up @@ -56,7 +56,7 @@ int ctpCCDBManager::saveRunScalersToQCDB(CTPRunScalers& scalers, long timeStart,
{
// data base
if (mQCDBHost == "none") {
LOG(info) << "Scalers not written to QCDB none";
LOG(debug) << "Scalers not written to QCDB none";
return 0;
}
// CTPActiveRun* run = mActiveRuns[i];q
Expand Down