Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:22:29

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 /// \file parallel/ThreadsafeScorers/include/TSDetectorConstruction.hh
0027 /// \brief Definition of the TSDetectorConstruction class
0028 //
0029 //
0030 //
0031 //
0032 /// Construction of a target material (default = boron) surrounded by a
0033 ///     casing material (default = water) and a vacuum world (default =
0034 ///     target and casing fill world). The target + casing is brick
0035 ///     geometry with fTargetSections defining the number of divisions
0036 ///     in each dimension. The end sections in each dimension
0037 ///     is set to the casing. So a fTargetSections = G4ThreeVector(3, 3, 3)
0038 ///     would be one section of boron and 8 sections of water.
0039 /// The idea behind this geometry is just to create a simple geometry that
0040 ///     scatters and produces a lot neutrons with a minimal number of sections
0041 ///     (i.e. coarse meshing) such that the contention in operating on
0042 ///     the atomic hits maps is higher and round-off errors in the
0043 ///     thread-local hits maps are detectable (printed out in TSRunAction)
0044 ///     from the sheer number of floating point sum operations.
0045 /// Two scorers are implemented: EnergyDeposit and Number of steps
0046 ///     The energy deposit is to (possibly) show the round-off error seen
0047 ///     with thread-local hits maps. The # of steps scorer is to verify
0048 ///     the thread-safe and thread-local hits maps provide the same results.
0049 //
0050 //
0051 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0052 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0053 
0054 #ifndef tsdetectorconstruction_hh
0055 #define tsdetectorconstruction_hh 1
0056 
0057 #include "G4ThreeVector.hh"
0058 #include "G4VUserDetectorConstruction.hh"
0059 #include "globals.hh"
0060 
0061 #include <map>
0062 #include <set>
0063 
0064 class G4Box;
0065 class G4Tubs;
0066 class G4Sphere;
0067 class G4LogicalVolume;
0068 class G4VPhysicalVolume;
0069 class G4Material;
0070 
0071 class TSDetectorConstruction : public G4VUserDetectorConstruction
0072 {
0073   public:
0074     typedef std::map<G4String, G4Material*> MaterialCollection_t;
0075     typedef std::set<G4LogicalVolume*> ScoringVolumes_t;
0076 
0077   public:
0078     TSDetectorConstruction();
0079     virtual ~TSDetectorConstruction();
0080 
0081     static TSDetectorConstruction* Instance();
0082 
0083   public:
0084     G4VPhysicalVolume* Construct();
0085     inline const G4ThreeVector& GetWorldDimensions() const { return fWorldDim; }
0086     inline const ScoringVolumes_t& GetScoringVolumes() const { return fScoringVolumes; }
0087     inline const G4String& GetMFDName() const { return fMfdName; }
0088     inline G4int GetTotalTargets() const
0089     {
0090       return fTargetSections.x() * fTargetSections.y() * fTargetSections.z();
0091     }
0092 
0093   protected:
0094     virtual MaterialCollection_t ConstructMaterials();
0095     virtual G4VPhysicalVolume* ConstructWorld(const MaterialCollection_t&);
0096     virtual void ConstructSDandField();
0097 
0098   private:
0099     static TSDetectorConstruction* fgInstance;
0100     G4VPhysicalVolume* fWorldPhys;
0101     ScoringVolumes_t fScoringVolumes;
0102     G4String fWorldMaterialName;
0103     G4String fTargetMaterialName;
0104     G4String fCasingMaterialName;
0105     G4ThreeVector fWorldDim;
0106     G4ThreeVector fTargetDim;
0107     G4ThreeVector fTargetSections;
0108     G4String fMfdName;
0109 };
0110 
0111 #endif