Skip to content

Commit 625cd4e

Browse files
committed
Empty shell VMCReplay structure
Basic (trivial) setup for a new VMC implementation targeting replay functionality of a simulation without executing the transport/physics code. The new engine should take step information from a previous run and the goal is to use it to study influence of production cuts on the hits/digits efficiently. Together with @benedikt-voelkel
1 parent 186bce9 commit 625cd4e

9 files changed

Lines changed: 178 additions & 1 deletion

File tree

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,13 @@ add_subdirectory(EventVisualisation)
7373
add_subdirectory(Generators)
7474
add_subdirectory(Steer) # consider building this only for simulation ?
7575

76+
7677
if(BUILD_EXAMPLES)
7778
add_subdirectory(Examples)
7879
endif()
7980

8081
if(BUILD_SIMULATION)
82+
add_subdirectory(VMCReplay)
8183
add_subdirectory(run)
8284
endif()
8385

Detectors/gconfig/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@
99
# submit itself to any jurisdiction.
1010

1111
o2_add_library(SimSetup
12-
SOURCES src/G3Config.cxx src/G4Config.cxx
12+
SOURCES src/G3Config.cxx src/G4Config.cxx src/VMCReplayConfig.cxx
1313
src/GlobalProcessCutSimParam.cxx src/SimSetup.cxx
1414
PUBLIC_LINK_LIBRARIES MC::Geant3
1515
MC::Geant4VMC
1616
MC::Geant4
1717
O2::SimulationDataFormat
1818
O2::DetectorsPassive
19+
O2::VMCReplay
1920
MC::Pythia6 # this is needed by Geant3 and
2021
# EGPythia6
2122
ROOT::EGPythia6 # this is needed by Geant4
@@ -48,3 +49,7 @@ o2_add_test_root_macro(g3Config.C
4849
o2_add_test_root_macro(g4Config.C
4950
PUBLIC_LINK_LIBRARIES O2::SimSetup
5051
LABELS simsetup)
52+
53+
o2_add_test_root_macro(VMCReplayConfig.C
54+
PUBLIC_LINK_LIBRARIES O2::SimSetup
55+
LABELS simsetup)
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#if !defined(__CLING__) || defined(__ROOTCLING__)
2+
#include "VMCReplay/VMCReplay.h"
3+
#include "FairRunSim.h"
4+
#include <iostream>
5+
#endif
6+
#include "commonConfig.C"
7+
8+
void Config()
9+
{
10+
FairRunSim* run = FairRunSim::Instance();
11+
TString* gModel = run->GetGeoModel();
12+
13+
// THIS WOULD A GOOD MOMENT TO PASS IN THE CACHED STEP INFORMATION
14+
auto replayvmc = new VMCReplay("Hello");
15+
16+
stackSetup(replayvmc, run);
17+
18+
// ******* replayvmc specific configuration for simulated Runs *******
19+
//
20+
replayvmc->SetTRIG(1); // Number of events to be processed
21+
replayvmc->SetSWIT(4, 100);
22+
replayvmc->SetDEBU(0, 0, 1);
23+
24+
replayvmc->SetRAYL(1);
25+
replayvmc->SetSTRA(0);
26+
27+
// NOTE: Please avoid changing this setting, unless justified as this might lead to very many steps
28+
// performed by G3; AUTO(1) is the G3 default
29+
replayvmc->SetAUTO(1); // Select automatic STMIN etc... calc. (AUTO 1) or manual (AUTO 0)
30+
31+
replayvmc->SetABAN(0); // Restore 3.16 behaviour for abandoned tracks
32+
replayvmc->SetOPTI(2); // Select optimisation level for GEANT geometry searches (0,1,2)
33+
replayvmc->SetERAN(5.e-7);
34+
replayvmc->SetCKOV(1); // cerenkov photons
35+
36+
// allow many steps per track (per volume)
37+
// since this is needed in the TPC
38+
// (this does not seem to be possible per module)
39+
replayvmc->SetMaxNStep(1E5);
40+
}

Detectors/gconfig/src/SimSetup.cxx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,19 @@ namespace g4config
2323
{
2424
void G4Config();
2525
}
26+
namespace vmcreplayconfig
27+
{
28+
void VMCReplayConfig();
29+
}
2630

2731
void SimSetup::setup(const char* engine)
2832
{
2933
if (strcmp(engine, "TGeant3") == 0) {
3034
g3config::G3Config();
3135
} else if (strcmp(engine, "TGeant4") == 0) {
3236
g4config::G4Config();
37+
} else if (strcmp(engine, "VMCReplay") == 0) {
38+
vmcreplayconfig::VMCReplayConfig();
3339
} else {
3440
LOG(FATAL) << "Unsupported engine " << engine;
3541
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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+
#include "FairRunSim.h"
12+
#include "TGeant3.h"
13+
#include "TGeant3TGeo.h"
14+
#include "SimulationDataFormat/Stack.h"
15+
#include "SimulationDataFormat/StackParam.h"
16+
#include <iostream>
17+
#include "FairLogger.h"
18+
#include "FairModule.h"
19+
#include <DetectorsPassive/Cave.h>
20+
#include "DetectorsBase/MaterialManager.h"
21+
#include "SimSetup/GlobalProcessCutSimParam.h"
22+
23+
//using declarations here since SetCuts.C and g3Config.C are included within namespace
24+
// these are needed for SetCuts.C inclusion
25+
using o2::GlobalProcessCutSimParam;
26+
using o2::base::ECut;
27+
using o2::base::EProc;
28+
using o2::base::MaterialManager;
29+
// these are used in g3Config.C
30+
using std::cout;
31+
using std::endl;
32+
#include <SimSetup/SimSetup.h>
33+
34+
#include "../VMCReplayConfig.C"
35+
#include "../SetCuts.h"
36+
37+
namespace o2
38+
{
39+
namespace vmcreplayconfig
40+
{
41+
void VMCReplayConfig()
42+
{
43+
LOG(INFO) << "Setting up VMCReplay simulation";
44+
Config();
45+
SetCuts();
46+
}
47+
} // namespace vmcreplayconfig
48+
} // namespace o2

VMCReplay/CMakeLists.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright CERN and copyright holders of ALICE O2. This software is distributed
2+
# under the terms of the GNU General Public License v3 (GPL Version 3), copied
3+
# 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 or
9+
# submit itself to any jurisdiction.
10+
11+
12+
o2_add_library(VMCReplay
13+
SOURCES src/VMCReplay.cxx
14+
PUBLIC_LINK_LIBRARIES MC::Geant3
15+
)
16+
17+
set(headers
18+
include/VMCReplay/VMCReplay.h)
19+
20+
o2_target_root_dictionary(VMCReplay HEADERS ${headers})
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
#ifndef O2_VMCREPLAY_H
12+
#define O2_VMCREPLAY_H
13+
14+
#include "TGeant3TGeo.h"
15+
16+
class VMCReplay : public TGeant3TGeo
17+
{
18+
public:
19+
using TGeant3TGeo::TGeant3TGeo;
20+
21+
ClassDef(VMCReplay, 1); // needed as long we inherit from TObject
22+
};
23+
24+
#endif //O2_VMCREPLAY_H

VMCReplay/src/VMCReplay.cxx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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+
#include "VMCReplay/VMCReplay.h"
12+
13+
ClassImp(VMCReplay);

VMCReplay/src/VMCReplayLinkDef.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
#ifdef __CLING__
12+
13+
#pragma link off all globals;
14+
#pragma link off all classes;
15+
#pragma link off all functions;
16+
17+
#pragma link C++ class VMCReplay;
18+
19+
#endif

0 commit comments

Comments
 (0)