|
1 | 1 | /******************************************************************************** |
2 | | - * Copyright (C) 2014-2022 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * |
| 2 | + * Copyright (C) 2014-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * |
3 | 3 | * * |
4 | 4 | * This software is distributed under the terms of the * |
5 | 5 | * GNU Lesser General Public Licence (LGPL) version 3, * |
6 | 6 | * copied verbatim in the file "LICENSE" * |
7 | 7 | ********************************************************************************/ |
8 | 8 |
|
| 9 | +#if !defined(__CLING__) || defined(__ROOTCLING__) |
| 10 | +#include "FairBoxGenerator.h" |
| 11 | +#include "FairCave.h" |
| 12 | +#include "FairDetector.h" |
| 13 | +#include "FairModule.h" |
| 14 | +#include "FairParRootFileIo.h" |
| 15 | +#include "FairPrimaryGenerator.h" |
| 16 | +#include "FairRootFileSink.h" |
| 17 | +#include "FairRunSim.h" |
| 18 | +#include "FairRuntimeDb.h" |
| 19 | +#include "FairSystemInfo.h" |
| 20 | +#include "FairTutorialDet2.h" |
| 21 | + |
| 22 | +#include <RtypesCore.h> |
9 | 23 | #include <TRandom.h> |
10 | 24 | #include <TStopwatch.h> |
11 | 25 | #include <TString.h> |
12 | 26 | #include <TSystem.h> |
13 | 27 | #include <memory> |
| 28 | +#endif |
14 | 29 |
|
15 | | -void run_tutorial2(Int_t nEvents = 10, TString mcEngine = "TGeant4", |
16 | | - Bool_t isMT = true, UInt_t initial_seed=98989) |
| 30 | +void run_tutorial2(Int_t nEvents = 10, TString mcEngine = "TGeant4", Bool_t isMT = true, UInt_t initial_seed = 98989) |
17 | 31 | { |
18 | 32 | TString dir = getenv("VMCWORKDIR"); |
19 | 33 |
|
@@ -66,8 +80,8 @@ void run_tutorial2(Int_t nEvents = 10, TString mcEngine = "TGeant4", |
66 | 80 |
|
67 | 81 | // ----- Create simulation run ---------------------------------------- |
68 | 82 | auto run = std::make_unique<FairRunSim>(); |
69 | | - run->SetName(mcEngine); // Transport engine |
70 | | - run->SetIsMT(isMT); // Multi-threading mode (Geant4 only) |
| 83 | + run->SetName(mcEngine); // Transport engine |
| 84 | + run->SetIsMT(isMT); // Multi-threading mode (Geant4 only) |
71 | 85 | run->SetSink(std::make_unique<FairRootFileSink>(outFile)); |
72 | 86 | FairRuntimeDb* rtdb = run->GetRuntimeDb(); |
73 | 87 | // ------------------------------------------------------------------------ |
@@ -118,30 +132,30 @@ void run_tutorial2(Int_t nEvents = 10, TString mcEngine = "TGeant4", |
118 | 132 |
|
119 | 133 | // ----- Finish ------------------------------------------------------- |
120 | 134 |
|
121 | | - cout << endl << endl; |
| 135 | + std::cout << std::endl << std::endl; |
122 | 136 |
|
123 | 137 | // Extract the maximal used memory an add is as Dart measurement |
124 | 138 | // This line is filtered by CTest and the value send to CDash |
125 | 139 | FairSystemInfo sysInfo; |
126 | 140 | Float_t maxMemory = sysInfo.GetMaxMemory(); |
127 | | - cout << "<DartMeasurement name=\"MaxMemory\" type=\"numeric/double\">"; |
128 | | - cout << maxMemory; |
129 | | - cout << "</DartMeasurement>" << endl; |
| 141 | + std::cout << "<DartMeasurement name=\"MaxMemory\" type=\"numeric/double\">"; |
| 142 | + std::cout << maxMemory; |
| 143 | + std::cout << "</DartMeasurement>" << std::endl; |
130 | 144 |
|
131 | 145 | timer.Stop(); |
132 | 146 | Double_t rtime = timer.RealTime(); |
133 | 147 | Double_t ctime = timer.CpuTime(); |
134 | 148 |
|
135 | 149 | Float_t cpuUsage = ctime / rtime; |
136 | | - cout << "<DartMeasurement name=\"CpuLoad\" type=\"numeric/double\">"; |
137 | | - cout << cpuUsage; |
138 | | - cout << "</DartMeasurement>" << endl; |
139 | | - |
140 | | - cout << endl << endl; |
141 | | - cout << "Output file is " << outFile << endl; |
142 | | - cout << "Parameter file is " << parFile << endl; |
143 | | - cout << "Real time " << rtime << " s, CPU time " << ctime << "s" << endl << endl; |
144 | | - cout << "Macro finished successfully." << endl; |
| 150 | + std::cout << "<DartMeasurement name=\"CpuLoad\" type=\"numeric/double\">"; |
| 151 | + std::cout << cpuUsage; |
| 152 | + std::cout << "</DartMeasurement>" << std::endl; |
| 153 | + |
| 154 | + std::cout << std::endl << std::endl; |
| 155 | + std::cout << "Output file is " << outFile << std::endl; |
| 156 | + std::cout << "Parameter file is " << parFile << std::endl; |
| 157 | + std::cout << "Real time " << rtime << " s, CPU time " << ctime << "s" << std::endl << std::endl; |
| 158 | + std::cout << "Macro finished successfully." << std::endl; |
145 | 159 |
|
146 | 160 | // ------------------------------------------------------------------------ |
147 | 161 | } |
0 commit comments