Project
Loading...
Searching...
No Matches
FlukaConfig.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 "FairRunSim.h"
13#include "DetectorsBase/Stack.h"
15#include <iostream>
16#include <fairlogger/Logger.h>
17#include "FairModule.h"
19#include "SimSetup/FlukaParam.h"
20#include "../commonConfig.C"
22
23// these are used in commonConfig.C
25
26namespace o2
27{
28namespace flukaconfig
29{
30
32{
33 // Link here some special Fluka files needed
34 gSystem->Exec("ln -s $FLUKADATA/neuxsc.bin .");
35 gSystem->Exec("ln -s $FLUKADATA/elasct.bin .");
36 gSystem->Exec("ln -s $FLUKADATA/gxsect.bin .");
37 gSystem->Exec("ln -s $FLUKADATA/nuclear.bin .");
38 gSystem->Exec("ln -s $FLUKADATA/sigmapi.bin .");
39 gSystem->Exec("ln -s $FLUKADATA/brems_fin.bin .");
40 gSystem->Exec("ln -s $FLUKADATA/cohff.bin .");
41 gSystem->Exec("ln -s $FLUKADATA/fluodt.dat .");
42 gSystem->Exec("ln -s $FLUKADATA/random.dat .");
43 gSystem->Exec("ln -s $FLUKADATA/dnr.dat .");
44 gSystem->Exec("ln -s $FLUKADATA/nunstab.data .");
45 // Give some meaningfull name to the output
46 gSystem->Exec("ln -s fluka.out fort.11");
47 gSystem->Exec("ln -s fluka.err fort.15");
48 gSystem->Exec("ln -fs $O2_ROOT/share/Detectors/gconfig/data/coreFlukaVmc.inp .");
49}
50
51void Config()
52{
54 FairRunSim* run = FairRunSim::Instance();
55 // try to see if Fluka is available in the runtime
56 auto status = gSystem->Load("libflukavmc");
57 if (status == 0 || status == 1) {
58 // we load Fluka as a real plugin via a ROOT Macro
59 auto fluka = o2::conf::GetFromMacro<TVirtualMC*>("$O2_ROOT/share/Detectors/gconfig/FlukaRuntimeConfig.macro", "FlukaRuntimeConfig()", "TVirtualMC*", "foo");
60 stackSetup(fluka, run);
61 decayerSetup(fluka);
62 } else {
63 LOG(error) << "FLUKA is not available in the runtime environment";
64 LOG(error) << "Please compile and load by including FLUKA_VMC/latest in the alienv package list";
65 LOG(fatal) << "Quitting here due to FLUKA_VMC not being available";
66 }
67 return;
68}
69
71{
72 LOG(info) << "Setting up FLUKA sim from library code";
73 Config();
74}
75} // namespace flukaconfig
76} // namespace o2
Definition of the Stack class.
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"