Skip to content

Commit 0618a4a

Browse files
committed
o2-sim: More universal timestamp setup
This matters for workflows using o2sim_grp to pickup timestamps (like sim_challenge) and only changes the behaviour of o2-sim-serial. Fixes https://its.cern.ch/jira/browse/O2-5377 Also adding some notes in sim_challenge.sh
1 parent fac9d91 commit 0618a4a

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

macro/o2sim.C

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,17 @@ FairRunSim* o2sim_init(bool asservice, bool evalmat = false)
6565
auto& ccdbmgr = o2::ccdb::BasicCCDBManager::instance();
6666
// fix the timestamp early
6767
uint64_t timestamp = confref.getTimestamp();
68+
// see if we have a run number but not a timestamp
69+
auto run_number = confref.getRunNumber();
70+
if (run_number != -1) {
71+
if (confref.getConfigData().mTimestampMode == o2::conf::TimeStampMode::kNow) {
72+
// fix the time by talking to CCDB
73+
auto [sor, eor] = ccdbmgr.getRunDuration(run_number);
74+
LOG(info) << "Have run number. Fixing timestamp to " << sor;
75+
timestamp = sor;
76+
}
77+
}
78+
6879
ccdbmgr.setTimestamp(timestamp);
6980
ccdbmgr.setURL(confref.getConfigData().mCCDBUrl);
7081
// try to verify connection
@@ -163,12 +174,12 @@ FairRunSim* o2sim_init(bool asservice, bool evalmat = false)
163174
// add ALICE particles to TDatabasePDG singleton
164175
o2::O2DatabasePDG::addALICEParticles(TDatabasePDG::Instance());
165176

166-
long runStart = confref.getTimestamp(); // this will signify "time of this MC" (might not coincide with start of Run)
177+
long runStart = timestamp;
167178
{
168179
// store GRPobject
169180
o2::parameters::GRPObject grp;
170-
if (confref.getRunNumber() != -1) {
171-
grp.setRun(confref.getRunNumber());
181+
if (run_number != -1) {
182+
grp.setRun(run_number);
172183
} else {
173184
grp.setRun(run->GetRunId());
174185
}

prodtests/sim_challenge.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
#!/bin/bash
22

3-
# A simple chain of algorithms from MC to reco (and analysis)
3+
# A linearized and simplified chain of algorithms from MC to reco (and analysis) for ALICE Run3.
4+
# Please note that this script was originally provided as first and quick integration of
5+
# algorithms in the MC pipeline (mainly for testing purposes).
6+
# The script does, however, not represent a production setup and it is not maintained actively.
7+
# The official MC configs and production system is maintained in O2DPG (https://github.com/AliceO2Group/O2DPG)
8+
# and it is advised to use that one. Some documentation can be found here: https://aliceo2group.github.io/simulation/docs/o2dpgworkflow/
49

510
# ------------ LOAD UTILITY FUNCTIONS ----------------------------
611
. ${O2_ROOT}/share/scripts/jobutils.sh

0 commit comments

Comments
 (0)