Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /geant4/examples/extended/parallel/ThreadsafeScorers/include/TSDetectorConstruction.hh was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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