Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-31 09:22:01

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 //
0027 /// \file DetectorConstruction.hh
0028 /// \brief Definition of the DetectorConstruction class
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(); // for runing chem separately
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 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0103 
0104 inline void DetectorConstruction::InsertMoleculeInWorld()
0105 {
0106     fChemGeoImport->InsertMoleculeInWorld();
0107 }
0108 
0109 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0110 
0111 #endif