Skip to content

Commit

Permalink
Filling RCT information when uploading GRP at end of run
Browse files Browse the repository at this point in the history
  • Loading branch information
chiarazampolli authored and shahor02 committed Apr 27, 2022
1 parent 22b8799 commit 5b96c9a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Detectors/GRP/workflows/src/create-grp-ecs.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,17 @@ void createGRPECSObject(const std::string& dataPeriod,
// long ts = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count();
api.storeAsTFileAny(&grpecs, "GLO/Config/GRPECS", metadata, tstart, tendVal); // making it 1-year valid to be sure we have something
LOGP(info, "Uploaded to {}/{} with validity {}:{}", ccdbServer, "GLO/Config/GRPECS", tstart, tendVal);
// also storing the RCT/Info/RunInformation entry in case the run type is PHYSICS and if we are at the end of run
if (runType == GRPECSObject::RunType::PHYSICS && tend < tstart) {
char tempChar;
std::map<std::string, std::string> mdRCT;
mdRCT["SOR"] = std::to_string(tstart);
mdRCT["EOR"] = std::to_string(tend);
long startValRCT = (long)run;
long endValRCT = (long)(run + 1);
api.storeAsBinaryFile(&tempChar, sizeof(tempChar), "tmp.dat", "char", "RCT/Info/RunInformation", mdRCT, startValRCT, endValRCT);
LOGP(info, "Uploaded RCT object to {}/{} with validity {}:{}", ccdbServer, "RCT/Info/RunInformation", startValRCT, endValRCT);
}
} else { // write a local file
auto fname = o2::base::NameConf::getGRPECSFileName();
TFile grpF(fname.c_str(), "recreate");
Expand Down

0 comments on commit 5b96c9a

Please sign in to comment.