Project
Loading...
Searching...
No Matches
o2sim_evalmat.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
12#include "../macro/o2sim.C"
13#include <SimConfig/SimConfig.h>
15#include <TStopwatch.h>
16#include <fairlogger/Logger.h>
18
19int main(int argc, char* argv[])
20{
21 // Geant4 is loaded by dlopen and may need a static TLS reserve, which glibc only takes at program start
23 TStopwatch timer;
24 timer.Start();
25
26 auto& conf = o2::conf::SimConfig::Instance();
27#ifdef SIM_RUN5
28 conf.setRun5();
29#endif
30 auto& matmapP = o2::conf::MatMapParams::Instance();
31 if (!conf.resetFromArguments(argc, argv)) {
32 return 1;
33 }
34 // custom number of events
35 // customize the level of output
36 FairLogger::GetLogger()->SetLogScreenLevel(conf.getLogSeverity().c_str());
37 FairLogger::GetLogger()->SetLogVerbosityLevel(conf.getLogVerbosity().c_str());
38
39 // call o2sim "macro"
40 o2sim(false, true);
41
43
44 // print total time
45 LOG(info) << "Simulation process took " << timer.RealTime() << " s";
46
47 // We do this instead of return 0
48 // for the reason that we see lots of problems
49 // with TROOTs atexit mechanism often triggering double-free or delete symptoms.
50 // While this is not optimal ... I think it is for the moment
51 // better to have a stable simulation runtime in contrast to
52 // having to debug complicated "atexit" memory problems.
53 _exit(0);
54}
void SetLogVerbosityLevel(const char *verbosity)
Definition FairLogger.h:87
void SetLogScreenLevel(const char *severity)
Definition FairLogger.h:58
static FairLogger * GetLogger()
static SimConfig & Instance()
Definition SimConfig.h:112
static ShmManager & Instance()
Definition ShmManager.h:62
void ensureStaticTLSReserve(char *argv[], unsigned long reserve=Geant4StaticTLSReserve)
#define main
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"