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3 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

  1 //
  2 // ********************************************************************
  3 // * License and Disclaimer                                           *
  4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.                             *
 10 // *                                                                  *
 11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                                                  *
 18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // ********************************************************************
 25 //
 26 /// \file runAndEvent/RE02/include/RE02DetectorConstruction.hh
 27 /// \brief Definition of the RE02DetectorConstruction class
 28 //
 29 //
 30 //
 31 
 32 #ifndef RE02DetectorConstruction_h
 33 #define RE02DetectorConstruction_h 1
 34 
 35 #include "G4MultiFunctionalDetector.hh"
 36 #include "G4VUserDetectorConstruction.hh"
 37 #include "globals.hh"
 38 
 39 class G4Box;
 40 class G4LogicalVolume;
 41 class G4VPhysicalVolume;
 42 class G4Material;
 43 
 44 //
 45 /// Uer detector construction class
 46 ///
 47 /// (Description)
 48 ///
 49 ///    Detector construction for example RE02.
 50 ///
 51 ///  [Geometry]
 52 ///    The world volume is defined as 200 cm x 200 cm x 200 cm box with Air.
 53 ///  Water phantom is defined as  200 mm x 200 mm x 400 mm box with Water.
 54 ///  The water phantom is divided into 100 segments in x,y plane using
 55 ///  replication,
 56 ///  and then divided into 200 segments perpendicular to z axis using nested
 57 ///  parameterised volume.
 58 ///   These values are defined at constructor,
 59 ///   e.g. the size of water phantom (fPhantomSize), and number of segmentation
 60 ///  of water phantom (fNx, fNy, fNz).
 61 ///
 62 ///  By default, lead plates are inserted into the position of even order
 63 ///  segments.
 64 ///  NIST database is used for materials.
 65 ///
 66 ///
 67 ///  [Scorer]
 68 ///   Assignment of G4MultiFunctionalDetector and G4PrimitiveScorer
 69 ///  is demonstrated in this example.
 70 ///      -------------------------------------------------
 71 ///      The collection names of defined Primitives are
 72 ///       0       PhantomSD/totalEDep
 73 ///       1       PhantomSD/protonEDep
 74 ///       2       PhantomSD/protonNStep
 75 ///       3       PhantomSD/chargedPassCellFlux
 76 ///       4       PhantomSD/chargedCellFlux
 77 ///       5       PhantomSD/chargedSurfFlux
 78 ///       6       PhantomSD/gammaSurfCurr000
 79 ///       7       PhantomSD/gammaSurfCurr001
 80 ///       9       PhantomSD/gammaSurdCurr002
 81 ///      10       PhantomSD/gammaSurdCurr003
 82 ///     -------------------------------------------------
 83 ///     Please see README for detail description.
 84 ///
 85 ///
 86 /// - G4VPhysicalVolume* Construct()
 87 ///     retrieves material from NIST database,
 88 ///     constructs a water phantom "phantom" in the world volume "world" and
 89 ///     sets detector sensitivities with G4MultiFunctionalDetector
 90 ///
 91 /// - void SetPhantomSize(G4ThreeVector size)
 92 ///     sets the water phantom size which is defined in G4Box
 93 ///
 94 /// - const G4ThreeVector& GetPhantomSize() const
 95 ///     gets the water phantom size
 96 ///
 97 /// - void SetNumberOfSegmentsInPhantom(G4int nx, G4int ny, G4int nz)
 98 ///     sets the number of segments of the water phantom
 99 ///
100 /// - void GetNumberOfSegmentsInPhantom(G4int& nx, G4int& ny, G4int& nz)
101 ///     gets the number of segments of the water phantom
102 ///
103 /// - void SetLeadSegment(G4bool flag=TRUE)
104 ///     selects whether insert or not Lead plate in water or simple homogeneous
105 ///     water phantom
106 ///
107 /// - G4bool IsLeadSegment()
108 ///     returns whether insert or not Lead plate
109 //
110 class RE02DetectorConstruction : public G4VUserDetectorConstruction
111 {
112   public:
113     // constructor and destructor.
114     RE02DetectorConstruction();
115     virtual ~RE02DetectorConstruction();
116 
117   public:
118     // virtual method from G4VUserDetectorConstruction.
119     virtual G4VPhysicalVolume* Construct();
120     virtual void ConstructSDandField();
121 
122   public:
123     // Get/Set Access methods for data members
124     // Size of Whater Phantom
125     void SetPhantomSize(G4ThreeVector size) { fPhantomSize = size; }
126     const G4ThreeVector& GetPhantomSize() const { return fPhantomSize; }
127     // Number of segments of water phantom
128     void SetNumberOfSegmentsInPhantom(G4int nx, G4int ny, G4int nz)
129     {
130       fNx = nx;
131       fNy = ny;
132       fNz = nz;
133     }
134     void GetNumberOfSegmentsInPhantom(G4int& nx, G4int& ny, G4int& nz) const
135     {
136       nx = fNx;
137       ny = fNy;
138       nz = fNz;
139     }
140     // Insert Lead plate in water or simple homogeneous water phantom
141     void SetLeadSegment(G4bool flag = TRUE) { fInsertLead = flag; }
142     G4bool IsLeadSegment() { return fInsertLead; }
143 
144   private:
145     // Data members
146     G4ThreeVector fPhantomSize;  // Size of Water Phantom
147     G4int fNx, fNy, fNz;  // Number of segmentation of water phantom.
148     G4bool fInsertLead;  // Flag for inserting lead plate in water phantom
149     G4LogicalVolume* fLVPhantomSens;
150 };
151 #endif
152