LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
ArtG4DetectorConstruction.hh
Go to the documentation of this file.
1 // ArtG4DetectorConstruction
2 
3 // ArtG4DetectorConstruction serves as the user-created Detector
4 // Construction class in the Artized Art G4 simulation.
5 //
6 // In all GEANT simulations, a DetectorConstruction class (derived
7 // from G4VUserDetectorConstruction) must be created and passed to the
8 // run manager. Then, when the run manager is initialized, it calls
9 // DetectorConstruction's Construct() method, which is responsible for
10 // constructing the geometry of the simulation and returning the world
11 // physical volume. In this highly modular simulation framework,
12 // however, no one class knows about the whole geometry. Rather,
13 // individual detectors and geometry components register with the
14 // DetectorHolder service, which matches each component with its
15 // desired mother volume and eventually constructs the whole
16 // simulation geometry. All that Construct() needs to do, then, is
17 // retrieve the DetectorHolder's world physical volume and return it.
18 // Thus, this simple class will work for any simulation setup, and
19 // does not need to be modified for the addition or modification of
20 // each geometry component.
21 //
22 // It is worth noting that the world volume must exist at the time of the
23 // ArtG4DetectorConstruction object's construction.
24 
25 // Author: Tasha Arvanitis, Adam Lyon
26 
27 // Date: July 2012
28 
29 #ifndef artg4tk_geantInit_ArtG4DetectorConstruction_hh
30 #define artg4tk_geantInit_ArtG4DetectorConstruction_hh
31 
32 #include "Geant4/G4VUserDetectorConstruction.hh"
33 class G4VPhysicalVolume;
34 
35 namespace artg4tk {
36 
37  class ArtG4DetectorConstruction : public G4VUserDetectorConstruction {
38  public:
39  explicit ArtG4DetectorConstruction(G4VPhysicalVolume* world);
40 
41  private:
42  // Construct() is called by GEANT on its own and just returns the world
43  G4VPhysicalVolume* Construct() override;
44 
45  G4VPhysicalVolume* world_;
46  };
47 
48 }
49 
50 #endif /* artg4tk_geantInit_ArtG4DetectorConstruction_hh */
ArtG4DetectorConstruction(G4VPhysicalVolume *world)
G4VPhysicalVolume * Construct() override