Back to home page

EIC code displayed by LXR

 
 

    


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

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 runAndEvent/RE02/include/RE02DetectorConstruction.hh
0027 /// \brief Definition of the RE02DetectorConstruction class
0028 //
0029 //
0030 //
0031 
0032 #ifndef RE02DetectorConstruction_h
0033 #define RE02DetectorConstruction_h 1
0034 
0035 #include "G4MultiFunctionalDetector.hh"
0036 #include "G4VUserDetectorConstruction.hh"
0037 #include "globals.hh"
0038 
0039 class G4Box;
0040 class G4LogicalVolume;
0041 class G4VPhysicalVolume;
0042 class G4Material;
0043 
0044 //
0045 /// Uer detector construction class
0046 ///
0047 /// (Description)
0048 ///
0049 ///    Detector construction for example RE02.
0050 ///
0051 ///  [Geometry]
0052 ///    The world volume is defined as 200 cm x 200 cm x 200 cm box with Air.
0053 ///  Water phantom is defined as  200 mm x 200 mm x 400 mm box with Water.
0054 ///  The water phantom is divided into 100 segments in x,y plane using
0055 ///  replication,
0056 ///  and then divided into 200 segments perpendicular to z axis using nested
0057 ///  parameterised volume.
0058 ///   These values are defined at constructor,
0059 ///   e.g. the size of water phantom (fPhantomSize), and number of segmentation
0060 ///  of water phantom (fNx, fNy, fNz).
0061 ///
0062 ///  By default, lead plates are inserted into the position of even order
0063 ///  segments.
0064 ///  NIST database is used for materials.
0065 ///
0066 ///
0067 ///  [Scorer]
0068 ///   Assignment of G4MultiFunctionalDetector and G4PrimitiveScorer
0069 ///  is demonstrated in this example.
0070 ///      -------------------------------------------------
0071 ///      The collection names of defined Primitives are
0072 ///       0       PhantomSD/totalEDep
0073 ///       1       PhantomSD/protonEDep
0074 ///       2       PhantomSD/protonNStep
0075 ///       3       PhantomSD/chargedPassCellFlux
0076 ///       4       PhantomSD/chargedCellFlux
0077 ///       5       PhantomSD/chargedSurfFlux
0078 ///       6       PhantomSD/gammaSurfCurr000
0079 ///       7       PhantomSD/gammaSurfCurr001
0080 ///       9       PhantomSD/gammaSurdCurr002
0081 ///      10       PhantomSD/gammaSurdCurr003
0082 ///     -------------------------------------------------
0083 ///     Please see README for detail description.
0084 ///
0085 ///
0086 /// - G4VPhysicalVolume* Construct()
0087 ///     retrieves material from NIST database,
0088 ///     constructs a water phantom "phantom" in the world volume "world" and
0089 ///     sets detector sensitivities with G4MultiFunctionalDetector
0090 ///
0091 /// - void SetPhantomSize(G4ThreeVector size)
0092 ///     sets the water phantom size which is defined in G4Box
0093 ///
0094 /// - const G4ThreeVector& GetPhantomSize() const
0095 ///     gets the water phantom size
0096 ///
0097 /// - void SetNumberOfSegmentsInPhantom(G4int nx, G4int ny, G4int nz)
0098 ///     sets the number of segments of the water phantom
0099 ///
0100 /// - void GetNumberOfSegmentsInPhantom(G4int& nx, G4int& ny, G4int& nz)
0101 ///     gets the number of segments of the water phantom
0102 ///
0103 /// - void SetLeadSegment(G4bool flag=TRUE)
0104 ///     selects whether insert or not Lead plate in water or simple homogeneous
0105 ///     water phantom
0106 ///
0107 /// - G4bool IsLeadSegment()
0108 ///     returns whether insert or not Lead plate
0109 //
0110 class RE02DetectorConstruction : public G4VUserDetectorConstruction
0111 {
0112   public:
0113     // constructor and destructor.
0114     RE02DetectorConstruction();
0115     virtual ~RE02DetectorConstruction();
0116 
0117   public:
0118     // virtual method from G4VUserDetectorConstruction.
0119     virtual G4VPhysicalVolume* Construct();
0120     virtual void ConstructSDandField();
0121 
0122   public:
0123     // Get/Set Access methods for data members
0124     // Size of Whater Phantom
0125     void SetPhantomSize(G4ThreeVector size) { fPhantomSize = size; }
0126     const G4ThreeVector& GetPhantomSize() const { return fPhantomSize; }
0127     // Number of segments of water phantom
0128     void SetNumberOfSegmentsInPhantom(G4int nx, G4int ny, G4int nz)
0129     {
0130       fNx = nx;
0131       fNy = ny;
0132       fNz = nz;
0133     }
0134     void GetNumberOfSegmentsInPhantom(G4int& nx, G4int& ny, G4int& nz) const
0135     {
0136       nx = fNx;
0137       ny = fNy;
0138       nz = fNz;
0139     }
0140     // Insert Lead plate in water or simple homogeneous water phantom
0141     void SetLeadSegment(G4bool flag = TRUE) { fInsertLead = flag; }
0142     G4bool IsLeadSegment() { return fInsertLead; }
0143 
0144   private:
0145     // Data members
0146     G4ThreeVector fPhantomSize;  // Size of Water Phantom
0147     G4int fNx, fNy, fNz;  // Number of segmentation of water phantom.
0148     G4bool fInsertLead;  // Flag for inserting lead plate in water phantom
0149     G4LogicalVolume* fLVPhantomSens;
0150 };
0151 #endif