blob: c9bec07a74e1053629d55c4495c6f8bc9913800b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
/**
* Copyright (C) 2009
* The IceCube collaboration
* ID: $Id: G4Interface.h 149388 2016-08-18 21:50:04Z jgonzalez $
*
* @file G4Interface.h
* @version $Rev: 149388 $
* @date $Date: 2016-08-18 22:50:04 +0100 (Thu, 18 Aug 2016) $
* @author Tilo Waldenmaier
*/
#ifndef _TOPSIM_G4INTERFACE_H_
#define _TOPSIM_G4INTERFACE_H_
#include <g4-tankresponse/g4classes/G4BeamTestRunManager.h>
#include <icetray/I3Logging.h>
#ifdef G4VIS_USE
class G4VisManager;
#endif
class I3Particle;
class G4BeamTestTank;
class G4BeamTestDetectorConstruction;
/**
* Top-level class to handle Geant4. All global things are initialized here (run manager, visualization manager, detector construction, physics list and user actions).
*/
class G4Interface
{
public:
G4Interface(const std::string& visMacro="");
~G4Interface();
// Static method which returns the singleton pointer to this class
static G4Interface* GetInstance() {return g4Interface_;}
/// Add a tank to the geometry. Should not be called after initialized.
void InstallTank(G4BeamTestTank* tank);
/// Initialize event. Most Geant4 global things are initialized the first time this is called.
void InitializeEvent();
/// To be called after simulating each IceTray event.
void TerminateEvent();
/// Simulate a single particle (InitializeEvent must be called first)
void InjectParticle(const I3Particle& particle);
private:
void Initialize();
static G4Interface* g4Interface_;
G4BeamTestRunManager runManager_;
#ifdef G4VIS_USE
G4VisManager* visManager_;
#endif
G4BeamTestDetectorConstruction* detector_;
bool initialized_;
bool eventInitialized_;
std::string visMacro_;
SET_LOGGER("G4Interface");
};
#endif
|