File indexing completed on 2025-01-31 09:22:01
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031 #ifndef DetectorConstruction_h
0032 #define DetectorConstruction_h 1
0033
0034 #include "G4VUserDetectorConstruction.hh"
0035 #include "G4VPhysicalVolume.hh"
0036 #include "G4LogicalVolume.hh"
0037 #include "G4Box.hh"
0038 #include "G4Tubs.hh"
0039 #include "G4Sphere.hh"
0040 #include "G4Orb.hh"
0041 #include "G4Sphere.hh"
0042 #include "G4EllipticalTube.hh"
0043 #include "G4Material.hh"
0044 #include "G4NistManager.hh"
0045 #include "G4PVPlacement.hh"
0046 #include "G4UserLimits.hh"
0047 #include "G4VisAttributes.hh"
0048 #include "G4PVParameterised.hh"
0049
0050 #include "PhysGeoImport.hh"
0051 #include "VoxelParameterisation.hh"
0052 #include "ChemGeoImport.hh"
0053
0054 #include <set>
0055
0056 enum class RunningMode{Phys,Chem};
0057 extern RunningMode gRunMode;
0058
0059 class DetectorConstructionMessenger;
0060
0061 class DetectorConstruction : public G4VUserDetectorConstruction
0062 {
0063 public:
0064
0065 DetectorConstruction(G4double factor=1, G4int verbose=0, G4bool isVisu=false);
0066
0067 ~DetectorConstruction() override = default;
0068
0069 G4VPhysicalVolume* Construct() override;
0070
0071 G4int GetVerbose(){return fVerbose;}
0072 void SetVerbose(G4int verbose){fVerbose=verbose;}
0073 void SetCellDefFilePath(const G4String finput);
0074 void AddVoxelDefFile(const G4String finput);
0075 void SetWorldBoxSizes(G4ThreeVector);
0076 void ParseGeoFileForChemMode(const G4String fn);
0077 void InsertMoleculeInWorld();
0078 private:
0079
0080 G4double fFactor{1};
0081 G4int fVerbose{0};
0082 G4bool fBVisu{false};
0083
0084 G4Box* fSolidWorld{nullptr};
0085 G4LogicalVolume* fLogicWorld=nullptr;
0086 G4VPhysicalVolume* fPhysWorld=nullptr;
0087
0088 G4VPhysicalVolume *ConstructFullCellNucleusGeo();
0089 G4VPhysicalVolume *ConstructVoxelGeo();
0090 DetectorConstructionMessenger *fDetectorMessenger{nullptr};
0091 std::unique_ptr<ChemGeoImport> fChemGeoImport{nullptr};
0092
0093 G4String fCellDefFilePath="";
0094 std::set<G4String> fVoxelDefFilesList;
0095 G4double fWorldBoxSizeX = 0., fWorldBoxSizeY =0., fWorldBoxSizeZ =0.;
0096 G4double fVoxelHalfSizeXYZ{0};
0097 G4bool fUsingUserDefinedSizesForWorld = false;
0098
0099 G4Material *fWater{nullptr};
0100 };
0101
0102
0103
0104 inline void DetectorConstruction::InsertMoleculeInWorld()
0105 {
0106 fChemGeoImport->InsertMoleculeInWorld();
0107 }
0108
0109
0110
0111 #endif