DetectorConstruction.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \file DetectorConstruction.h
3 /// \brief Build Geant4 geometry from GDML
4 ///
5 /// \version $Id: DetectorConstruction.h,v 1.5 2012-12-03 23:29:49 rhatcher Exp $
6 /// \author brebel@fnal.gov
7 ////////////////////////////////////////////////////////////////////////
8 #ifndef G4BASE_DetectorConstruction_h
9 #define G4BASE_DetectorConstruction_h
10 
11 #include "Geant4/G4VUserDetectorConstruction.hh"
12 
13 // forward declarations
14 class G4VPhysicalVolume;
15 class G4FieldManager;
16 
17 namespace g4b {
18 
19  class DetectorConstruction : public G4VUserDetectorConstruction {
20 
21  public:
22  /// Standard constructor and destructor.
23  explicit DetectorConstruction(std::string const& gdmlFile,
24  bool const& overlapCheck = false,
25  bool const& validateSchema = true);
26  virtual ~DetectorConstruction();
27 
28  /// The key method in this class; returns the Geant4 version of
29  /// the detector geometry. Required of any class that inherits
30  /// from G4VUserDetectorConstruction.
31  G4VPhysicalVolume* Construct();
32 
33  /// Return a pointer to the world volume. This returns the same
34  /// pointer as Construct(), but Construct() also does other
35  /// actions such as setting up sensitive detectors. World() just
36  /// returns the pointer to the top physical volume.
37  static G4VPhysicalVolume* GetWorld() { return fWorld; }
38 
39  /// Magnetic field
40  static G4FieldManager* GetFieldMgr() { return fFieldMgr; }
41 
42  private:
43  static G4VPhysicalVolume* fWorld; ///< pointer to the world volume
44  static G4FieldManager* fFieldMgr; ///< pointer to the field manager
45 
46  };
47 
48 } // namespace g4b
49 
50 #endif // G4BASE_DetectorConstruction_h
std::string string
Definition: nybbler.cc:12
G4VPhysicalVolume * Construct()
static G4VPhysicalVolume * GetWorld()
DetectorConstruction(std::string const &gdmlFile, bool const &overlapCheck=false, bool const &validateSchema=true)
Standard constructor and destructor.
static G4VPhysicalVolume * fWorld
pointer to the world volume
static G4FieldManager * GetFieldMgr()
Magnetic field.
basic interface to Geant4 for ART-based software
static G4FieldManager * fFieldMgr
pointer to the field manager