Skip to content

Commit 80c7d6d

Browse files
committed
Apply new MC IO convention also to serial case
1 parent 570ce24 commit 80c7d6d

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

macro/migrateSimFiles.C

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
// Copyright CERN and copyright holders of ALICE O2. This software is
2+
// distributed under the terms of the GNU General Public License v3 (GPL
3+
// Version 3), copied verbatim in the file "COPYING".
4+
//
5+
// See http://alice-o2.web.cern.ch/license for full licensing information.
6+
//
7+
// In applying this license CERN does not waive the privileges and immunities
8+
// granted to it by virtue of its status as an Intergovernmental Organization
9+
// or submit itself to any jurisdiction.
10+
11+
#if !defined(__CLING__) || defined(__ROOTCLING__)
12+
#include <TTree.h>
13+
#include <DetectorsCommonDataFormats/NameConf.h>
14+
#include <DetectorsCommonDataFormats/DetID.h>
15+
#include <DetectorsCommonDataFormats/SimTraits.h>
16+
#endif
17+
118
// A macro with the purpose to produce
219
// simulation files in the new layout, where detector hits
320
// are stored in individual files.

macro/o2sim.C

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include <unistd.h>
3131
#include <sstream>
3232
#endif
33+
#include "migrateSimFiles.C"
3334

3435
FairRunSim* o2sim_init(bool asservice)
3536
{
@@ -205,6 +206,14 @@ void o2sim_run(FairRunSim* run, bool asservice)
205206
LOG(INFO) << "Macro finished succesfully.";
206207
LOG(INFO) << "Real time " << rtime << " s, CPU time " << ctime << "s";
207208
LOG(INFO) << "Memory used " << sysinfo.GetMaxMemory() << " MB";
209+
210+
// migrate to file format where hits sit in separate files
211+
// (Note: The parallel version is doing this intrinsically;
212+
// The serial version uses FairRootManager IO which handles a common file IO for all outputs)
213+
if (!asservice) {
214+
LOG(INFO) << "Migrating simulation output to separate hit file format";
215+
migrateSimFiles(confref.getOutPrefix().c_str());
216+
}
208217
}
209218

210219
// asservice: in a parallel device-based context?

0 commit comments

Comments
 (0)