Skip to content

Commit df6dce5

Browse files
ChristianTackeGSIdennisklein
authored andcommitted
fix(examples): More unique output filenames
As our tests run in parallel, the output filenames must be unique across different run types. So add more properties to the filename (MT, postinit).
1 parent e3faf16 commit df6dce5

1 file changed

Lines changed: 15 additions & 8 deletions

File tree

examples/simulation/Tutorial1/macros/run_tutorial1.C

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/********************************************************************************
2-
* Copyright (C) 2014-2023 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
2+
* Copyright (C) 2014-2024 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
33
* *
44
* This software is distributed under the terms of the *
55
* GNU Lesser General Public Licence (LGPL) version 3, *
@@ -42,18 +42,25 @@ int run_tutorial1(int nEvents = 10, string mcEngine = "TGeant3", bool isMT = tru
4242

4343
auto nofPart = 1;
4444

45-
string outDir = "./";
45+
string outPrefix = "./tutorial1_";
46+
outPrefix += mcEngine;
47+
if (isMT) {
48+
outPrefix += "MT";
49+
}
50+
if (loadPostInitConfig) {
51+
outPrefix += "_postinit";
52+
}
53+
outPrefix += '_';
4654

4755
// Output file name
48-
string outFile = outDir + "/tutorial1_" + mcEngine + "_" + partName[chosenPart] + ".mc_p" + std::to_string(momentum)
49-
+ "_t" + std::to_string(theta) + "_n" + std::to_string(nEvents) + ".root";
56+
string outFile = outPrefix + partName[chosenPart] + ".mc_p" + std::to_string(momentum) + "_t"
57+
+ std::to_string(theta) + "_n" + std::to_string(nEvents) + ".root";
5058

5159
// Parameter file name
52-
string parFile = outDir + "/tutorial1_" + mcEngine + "_" + partName[chosenPart] + ".params_p"
53-
+ std::to_string(momentum) + "_t" + std::to_string(theta) + "_n" + std::to_string(nEvents)
54-
+ ".root";
60+
string parFile = outPrefix + partName[chosenPart] + ".params_p" + std::to_string(momentum) + "_t"
61+
+ std::to_string(theta) + "_n" + std::to_string(nEvents) + ".root";
5562

56-
auto geoFile = "geofile_" + mcEngine + "_full.root";
63+
auto geoFile = outPrefix + "_geofile_full.root";
5764

5865
// In general, the following parts need not be touched
5966
// ========================================================================

0 commit comments

Comments
 (0)