Skip to content

Commit d5be1e7

Browse files
committed
Set proper EOR to anchored MC GRPECS
1 parent 388c823 commit d5be1e7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

macro/o2sim.C

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ FairRunSim* o2sim_init(bool asservice, bool evalmat = false)
6969
auto& ccdbmgr = o2::ccdb::BasicCCDBManager::instance();
7070
// fix the timestamp early
7171
uint64_t timestamp = confref.getTimestamp();
72+
uint64_t runEnd = timestamp + 3600000;
7273
// see if we have a run number but not a timestamp
7374
auto run_number = confref.getRunNumber();
7475
if (run_number != -1) {
@@ -77,6 +78,7 @@ FairRunSim* o2sim_init(bool asservice, bool evalmat = false)
7778
auto [sor, eor] = ccdbmgr.getRunDuration(run_number);
7879
LOG(info) << "Have run number. Fixing timestamp to " << sor;
7980
timestamp = sor;
81+
runEnd = eor;
8082
}
8183
}
8284

@@ -189,7 +191,7 @@ FairRunSim* o2sim_init(bool asservice, bool evalmat = false)
189191
}
190192
uint64_t runStart = timestamp;
191193
grp.setTimeStart(runStart);
192-
grp.setTimeEnd(runStart + 3600000);
194+
grp.setTimeEnd(runEnd);
193195
grp.setDetsReadOut(readoutDetMask);
194196
// CTP is not a physical detector, just flag in the GRP if requested
195197
if (isReadout("CTP")) {
@@ -216,7 +218,7 @@ FairRunSim* o2sim_init(bool asservice, bool evalmat = false)
216218
o2::parameters::GRPECSObject grp;
217219
grp.setRun(run->GetRunId());
218220
grp.setTimeStart(runStart);
219-
grp.setTimeEnd(runStart + 3600000);
221+
grp.setTimeEnd(runEnd);
220222
grp.setNHBFPerTF(128); // might be overridden later
221223
grp.setDetsReadOut(readoutDetMask);
222224
if (isReadout("CTP")) {

0 commit comments

Comments
 (0)