Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/examples/extended/hadronic/ParticleFluence/ConcentricSpheres/src/DetectorConstruction.cc

Version: [ ReleaseNotes ] [ 1.0 ] [ 1.1 ] [ 2.0 ] [ 3.0 ] [ 3.1 ] [ 3.2 ] [ 4.0 ] [ 4.0.p1 ] [ 4.0.p2 ] [ 4.1 ] [ 4.1.p1 ] [ 5.0 ] [ 5.0.p1 ] [ 5.1 ] [ 5.1.p1 ] [ 5.2 ] [ 5.2.p1 ] [ 5.2.p2 ] [ 6.0 ] [ 6.0.p1 ] [ 6.1 ] [ 6.2 ] [ 6.2.p1 ] [ 6.2.p2 ] [ 7.0 ] [ 7.0.p1 ] [ 7.1 ] [ 7.1.p1 ] [ 8.0 ] [ 8.0.p1 ] [ 8.1 ] [ 8.1.p1 ] [ 8.1.p2 ] [ 8.2 ] [ 8.2.p1 ] [ 8.3 ] [ 8.3.p1 ] [ 8.3.p2 ] [ 9.0 ] [ 9.0.p1 ] [ 9.0.p2 ] [ 9.1 ] [ 9.1.p1 ] [ 9.1.p2 ] [ 9.1.p3 ] [ 9.2 ] [ 9.2.p1 ] [ 9.2.p2 ] [ 9.2.p3 ] [ 9.2.p4 ] [ 9.3 ] [ 9.3.p1 ] [ 9.3.p2 ] [ 9.4 ] [ 9.4.p1 ] [ 9.4.p2 ] [ 9.4.p3 ] [ 9.4.p4 ] [ 9.5 ] [ 9.5.p1 ] [ 9.5.p2 ] [ 9.6 ] [ 9.6.p1 ] [ 9.6.p2 ] [ 9.6.p3 ] [ 9.6.p4 ] [ 10.0 ] [ 10.0.p1 ] [ 10.0.p2 ] [ 10.0.p3 ] [ 10.0.p4 ] [ 10.1 ] [ 10.1.p1 ] [ 10.1.p2 ] [ 10.1.p3 ] [ 10.2 ] [ 10.2.p1 ] [ 10.2.p2 ] [ 10.2.p3 ] [ 10.3 ] [ 10.3.p1 ] [ 10.3.p2 ] [ 10.3.p3 ] [ 10.4 ] [ 10.4.p1 ] [ 10.4.p2 ] [ 10.4.p3 ] [ 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 ]

Diff markup

Differences between /examples/extended/hadronic/ParticleFluence/ConcentricSpheres/src/DetectorConstruction.cc (Version 11.3.0) and /examples/extended/hadronic/ParticleFluence/ConcentricSpheres/src/DetectorConstruction.cc (Version 11.1.2)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                         3 // * License and Disclaimer                                           *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th      5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided      6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License      7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/      8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.           9 // * include a list of copyright holders.                             *
 10 // *                                               10 // *                                                                  *
 11 // * Neither the authors of this software syst     11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file      15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitatio     16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                               17 // *                                                                  *
 18 // * This  code  implementation is the result      18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboratio     19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distri     20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  ag     21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publicati     22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Sof     23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // *******************************************     24 // ********************************************************************
 25 //                                                 25 //
 26 /// \file DetectorConstruction.cc                  26 /// \file DetectorConstruction.cc
 27 /// \brief Implementation of the DetectorConst     27 /// \brief Implementation of the DetectorConstruction class
 28 //                                                 28 //
 29 //                                                 29 //
 30                                                    30 
 31 //....oooOO0OOooo........oooOO0OOooo........oo     31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 32 //....oooOO0OOooo........oooOO0OOooo........oo     32 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 33                                                    33 
 34 #include "DetectorConstruction.hh"                 34 #include "DetectorConstruction.hh"
 35                                                << 
 36 #include "DetectorMessenger.hh"                    35 #include "DetectorMessenger.hh"
 37 #include "PrimaryGeneratorAction.hh"               36 #include "PrimaryGeneratorAction.hh"
 38                                                << 
 39 #include "G4Box.hh"                            << 
 40 #include "G4GeometryManager.hh"                << 
 41 #include "G4LogicalVolume.hh"                  << 
 42 #include "G4LogicalVolumeStore.hh"             << 
 43 #include "G4Material.hh"                           37 #include "G4Material.hh"
 44 #include "G4NistManager.hh"                        38 #include "G4NistManager.hh"
                                                   >>  39 #include "G4Box.hh"
                                                   >>  40 #include "G4Sphere.hh"
                                                   >>  41 #include "G4LogicalVolume.hh"
                                                   >>  42 #include "G4ThreeVector.hh"
 45 #include "G4PVPlacement.hh"                        43 #include "G4PVPlacement.hh"
 46 #include "G4PhysicalConstants.hh"              <<  44 #include "globals.hh"
                                                   >>  45 #include "G4GeometryManager.hh"
 47 #include "G4PhysicalVolumeStore.hh"                46 #include "G4PhysicalVolumeStore.hh"
 48 #include "G4RunManager.hh"                     <<  47 #include "G4LogicalVolumeStore.hh"
 49 #include "G4SolidStore.hh"                         48 #include "G4SolidStore.hh"
 50 #include "G4Sphere.hh"                         <<  49 #include "G4RunManager.hh"
 51 #include "G4SystemOfUnits.hh"                      50 #include "G4SystemOfUnits.hh"
 52 #include "G4ThreeVector.hh"                    <<  51 #include "G4PhysicalConstants.hh"
 53 #include "globals.hh"                          <<  52            
 54                                                << 
 55 //....oooOO0OOooo........oooOO0OOooo........oo     53 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 56                                                    54 
 57 DetectorConstruction::DetectorConstruction()   <<  55 DetectorConstruction::DetectorConstruction() :  
 58   : fMaterialTracker(nullptr),                 <<  56   fMaterialTracker( nullptr ), fMaterialEmCalo( nullptr ), fMaterialHadCalo( nullptr ),
 59     fMaterialEmCalo(nullptr),                  <<  57   fExperimentalHall_log( nullptr ), fExperimentalHall_phys( nullptr ),
 60     fMaterialHadCalo(nullptr),                 <<  58   fLogicTrackerShell( nullptr), fPhysiTrackerShell( nullptr ),
 61     fExperimentalHall_log(nullptr),            <<  59   fLogicEmCaloShell( nullptr), fPhysiEmCaloShell( nullptr),
 62     fExperimentalHall_phys(nullptr),           <<  60   fLogicHadCaloShell( nullptr), fPhysiHadCaloShell( nullptr), 
 63     fLogicTrackerShell(nullptr),               <<  61   fLogicScoringTrackerShell( nullptr), fPhysiScoringTrackerShell( nullptr ),
 64     fPhysiTrackerShell(nullptr),               <<  62   fLogicScoringEmCaloShell( nullptr), fPhysiScoringEmCaloShell( nullptr),
 65     fLogicEmCaloShell(nullptr),                <<  63   fLogicScoringHadCaloShell( nullptr), fPhysiScoringHadCaloShell( nullptr), 
 66     fPhysiEmCaloShell(nullptr),                <<  64   fDetectorMessenger( nullptr ),
 67     fLogicHadCaloShell(nullptr),               <<  65   fInnerRadiusTracker( 10.0*cm ), fOuterRadiusTracker(  20.0*cm ),  //***LOOKHERE*** Default radii
 68     fPhysiHadCaloShell(nullptr),               <<  66   fInnerRadiusEmCalo(  30.0*cm ), fOuterRadiusEmCalo(   60.0*cm ),
 69     fLogicScoringTrackerShell(nullptr),        <<  67   fInnerRadiusHadCalo( 70.0*cm ), fOuterRadiusHadCalo( 170.0*cm )
 70     fPhysiScoringTrackerShell(nullptr),        << 
 71     fLogicScoringEmCaloShell(nullptr),         << 
 72     fPhysiScoringEmCaloShell(nullptr),         << 
 73     fLogicScoringHadCaloShell(nullptr),        << 
 74     fPhysiScoringHadCaloShell(nullptr),        << 
 75     fDetectorMessenger(nullptr),               << 
 76     fInnerRadiusTracker(10.0 * cm),            << 
 77     fOuterRadiusTracker(20.0 * cm),  //***LOOK << 
 78     fInnerRadiusEmCalo(30.0 * cm),             << 
 79     fOuterRadiusEmCalo(60.0 * cm),             << 
 80     fInnerRadiusHadCalo(70.0 * cm),            << 
 81     fOuterRadiusHadCalo(170.0 * cm)            << 
 82 {                                                  68 {
 83   // G4cout << " BEGIN  DetectorConstruction:: <<  69   //G4cout << " BEGIN  DetectorConstruction::DetectorConstruction()" << G4endl;
 84   fMaterialTracker = G4NistManager::Instance() <<  70   fMaterialTracker = G4NistManager::Instance()->FindOrBuildMaterial( "G4_Si" );  //***LOOKHERE***
 85                                                <<  71                                                                               // Default material
 86   fMaterialEmCalo = G4NistManager::Instance()- <<  72   fMaterialEmCalo  = G4NistManager::Instance()->FindOrBuildMaterial( "G4_PbWO4" );
 87   fMaterialHadCalo = G4NistManager::Instance() <<  73   fMaterialHadCalo = G4NistManager::Instance()->FindOrBuildMaterial( "G4_Fe" );
 88   fDetectorMessenger = new DetectorMessenger(t <<  74   fDetectorMessenger = new DetectorMessenger( this );
 89   // G4cout << " END  DetectorConstruction::De <<  75   //G4cout << " END  DetectorConstruction::DetectorConstruction()" << G4endl;
 90 }                                                  76 }
 91                                                    77 
 92 //....oooOO0OOooo........oooOO0OOooo........oo     78 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 93                                                    79 
 94 DetectorConstruction::~DetectorConstruction()  <<  80 DetectorConstruction::~DetectorConstruction() {
 95 {                                              << 
 96   delete fDetectorMessenger;                       81   delete fDetectorMessenger;
 97 }                                                  82 }
 98                                                    83 
 99 //....oooOO0OOooo........oooOO0OOooo........oo     84 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
100                                                    85 
101 G4VPhysicalVolume* DetectorConstruction::Const <<  86 G4VPhysicalVolume* DetectorConstruction::Construct() {
102 {                                              <<  87   //G4cout << " BEGIN  DetectorConstruction::Construct()" << G4endl;
103   // G4cout << " BEGIN  DetectorConstruction:: << 
104   return ConstructDetector();                      88   return ConstructDetector();
105 }                                                  89 }
106                                                    90 
107 //....oooOO0OOooo........oooOO0OOooo........oo     91 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
108                                                    92 
109 G4VPhysicalVolume* DetectorConstruction::Const <<  93 G4VPhysicalVolume* DetectorConstruction::ConstructDetector() {
110 {                                              <<  94   //G4cout << " BEGIN  DetectorConstruction::ConstructDetector()" << G4endl;
111   // G4cout << " BEGIN  DetectorConstruction:: << 
112                                                    95 
113   // Clean old geometry, if any.                   96   // Clean old geometry, if any.
114   G4GeometryManager::GetInstance()->OpenGeomet     97   G4GeometryManager::GetInstance()->OpenGeometry();
115                                                    98 
116   G4PhysicalVolumeStore::GetInstance()->Clean(     99   G4PhysicalVolumeStore::GetInstance()->Clean();
117   G4LogicalVolumeStore::GetInstance()->Clean()    100   G4LogicalVolumeStore::GetInstance()->Clean();
118   G4SolidStore::GetInstance()->Clean();           101   G4SolidStore::GetInstance()->Clean();
119                                                   102 
120   // Check that the radii are resonable           103   // Check that the radii are resonable
121   G4bool isOK = true;                             104   G4bool isOK = true;
122   if (fInnerRadiusTracker < 0.0 || fOuterRadiu << 105   if ( fInnerRadiusTracker < 0.0                                     ||
123       || fInnerRadiusEmCalo < fOuterRadiusTrac << 106        fOuterRadiusTracker < fInnerRadiusTracker                     ||
124       || fOuterRadiusEmCalo < fInnerRadiusEmCa << 107        fInnerRadiusEmCalo  < fOuterRadiusTracker + fScoringThickness ||
125       || fInnerRadiusHadCalo < fOuterRadiusEmC << 108        fOuterRadiusEmCalo  < fInnerRadiusEmCalo                      ||
126       || fOuterRadiusHadCalo < fInnerRadiusHad << 109        fInnerRadiusHadCalo < fOuterRadiusEmCalo  + fScoringThickness ||
127   {                                            << 110        fOuterRadiusHadCalo < fInnerRadiusHadCalo ) {
128     isOK = false;                                 111     isOK = false;
129   }                                               112   }
130   if (!isOK) {                                 << 113   if ( ! isOK ) {
131     G4cerr << G4endl << "ERROR: the radii are     114     G4cerr << G4endl << "ERROR: the radii are inconsistent !" << G4endl
132            << " InnerRadiusTracker = " << fInn    115            << " InnerRadiusTracker = " << fInnerRadiusTracker << " mm" << G4endl
133            << " OuterRadiusTracker = " << fOut    116            << " OuterRadiusTracker = " << fOuterRadiusTracker << " mm" << G4endl
134            << " InnerRadiusEmCalo  = " << fInn << 117            << " InnerRadiusEmCalo  = " << fInnerRadiusEmCalo  << " mm" << G4endl
135            << " OuterRadiusEmCalo  = " << fOut << 118            << " OuterRadiusEmCalo  = " << fOuterRadiusEmCalo  << " mm" << G4endl
136            << " InnerRadiusHadCalo = " << fInn    119            << " InnerRadiusHadCalo = " << fInnerRadiusHadCalo << " mm" << G4endl
137            << " OuterRadiusHadCalo = " << fOut    120            << " OuterRadiusHadCalo = " << fOuterRadiusHadCalo << " mm" << G4endl
138            << " ScoringThickness   = " << fSco << 121            << " ScoringThickness   = " << fScoringThickness   << " mm" << G4endl
                                                   >> 122            << G4endl;
139     return nullptr;                               123     return nullptr;
140   }                                               124   }
141                                                << 125   
142   // The detector consists of 3 concentric ful    126   // The detector consists of 3 concentric full spherical shells (G4Sphere),
143   // positioned at the center, (0.0, 0.0, 0.0)    127   // positioned at the center, (0.0, 0.0, 0.0).
144   // The world volume (experimental hall) is a    128   // The world volume (experimental hall) is a box 10% bigger than the outmost
145   // spherical shell.                             129   // spherical shell.
146   // and it is filled of "G4_Galactic" materia    130   // and it is filled of "G4_Galactic" material.
147                                                   131 
148   G4double expHall_x = 1.1 * fOuterRadiusHadCa << 132   G4double expHall_x = 1.1*fOuterRadiusHadCalo;  // half dimension along x
149   G4double expHall_y = 1.1 * fOuterRadiusHadCa << 133   G4double expHall_y = 1.1*fOuterRadiusHadCalo;  // half dimension along y
150   G4double expHall_z = 1.1 * fOuterRadiusHadCa << 134   G4double expHall_z = 1.1*fOuterRadiusHadCalo;  // half dimension along z
151                                                << 135 
152   G4Material* vacuum = G4NistManager::Instance << 136   G4Material* vacuum = G4NistManager::Instance()->FindOrBuildMaterial( "G4_Galactic" );
153                                                << 137 
154   G4Box* experimentalHall_box = new G4Box("exp << 138   G4Box* experimentalHall_box = new G4Box( "expHall_box", expHall_x, expHall_y, expHall_z );
155                                                << 139 
156   fExperimentalHall_log = new G4LogicalVolume( << 140   fExperimentalHall_log = new G4LogicalVolume( experimentalHall_box, // solid 
157                                                << 141                                                vacuum,               // material
158                                                << 142                                                "expHall_log",        // name
159                                                << 143                                                0,                    // field manager
160                                                << 144                                                0,                    // sensitive detector
161                                                << 145                                                0 );                  // user limits
162                                                << 146 
163   fExperimentalHall_phys = new G4PVPlacement(0 << 147   fExperimentalHall_phys = new G4PVPlacement( 0,                     // rotation
164                                              G << 148                                               G4ThreeVector(),       // translation
165                                              " << 149                                               "expHall",             // name
166                                              f << 150                                               fExperimentalHall_log, // logical volume
167                                              0 << 151                                               0,                     // mother physical volume
168                                              f << 152                                               false,                 // boolean operation
169                                              0 << 153                                               0 );                   // copy number
170                                                << 154 
171   // 1st (innermost) spherical shell: Tracker  << 155   // 1st (innermost) spherical shell: Tracker 
172   G4Sphere* solidTrackerShell = new G4Sphere(" << 156   G4Sphere* solidTrackerShell = new G4Sphere( "solidTrackerShell",   // name
173                                              f << 157                                               fInnerRadiusTracker,   // Inner radius
174                                              f << 158                                               fOuterRadiusTracker,   // Outer radius
175                                              0 << 159                                               0.0,                   // Starting Phi angle of the
176                                                << 160                                                                      // segment in radians
177                                              2 << 161                                               2.0*CLHEP::pi,         // Delta Phi angle of the
178                                                << 162                                                                      // segment in radians
179                                              0 << 163                                               0.0,                   // Starting Theta angle of
180                                                << 164                                                                      // the segment in radians
181                                              C << 165                                               CLHEP::pi );           // Delta Theta angle of the
182                                                << 166                                                                      // segment in radians
183   fLogicTrackerShell = new G4LogicalVolume(sol << 167   fLogicTrackerShell = new G4LogicalVolume( solidTrackerShell,       // solid 
184                                            fMa << 168                                             fMaterialTracker,        // material
185                                            "lo << 169                                             "logicTrackerShell",     // name
186                                            0,  << 170                                             0,                       // field manager
187                                            0,  << 171                                             0,                       // sensitive detector
188                                            0); << 172                                             0 );                     // user limits
189   fPhysiTrackerShell = new G4PVPlacement(0,  / << 173   fPhysiTrackerShell = new G4PVPlacement( 0,                         // rotation
190                                          G4Thr << 174                                           G4ThreeVector(),           // translation
191                                          "phys << 175                                           "physiTrackerShell",       // name
192                                          fLogi << 176                                           fLogicTrackerShell,        // logical volume
193                                          fExpe << 177                                           fExperimentalHall_phys,    // mother physical volume
194                                          false << 178                                           false,                     // boolean operation
195                                          0);   << 179                                           0 );                       // copy number
196                                                   180 
197   // Scoring tracker shell (a thin vacuum laye    181   // Scoring tracker shell (a thin vacuum layer, immediately outside the Tracker shell)
198   G4Sphere* solidScoringTrackerShell =            182   G4Sphere* solidScoringTrackerShell =
199     new G4Sphere("solidScoringTrackerShell",   << 183     new G4Sphere( "solidScoringTrackerShell",               // name
200                  fOuterRadiusTracker,  // Inne << 184                   fOuterRadiusTracker,                      // Inner radius
201                  fOuterRadiusTracker + fScorin << 185                   fOuterRadiusTracker + fScoringThickness,  // Outer radius
202                  0.0,  // Starting Phi angle o << 186                   0.0,                                      // Starting Phi angle of the segment
203                        // in radians           << 187                                                             // in radians
204                  2.0 * CLHEP::pi,  // Delta Ph << 188                   2.0*CLHEP::pi,                            // Delta Phi angle of the segment
205                                    // in radia << 189                                                             // in radians
206                  0.0,  // Starting Theta angle << 190                   0.0,                                      // Starting Theta angle of the segment
207                        // in radians           << 191                                                             // in radians
208                  CLHEP::pi);  // Delta Theta a << 192                   CLHEP::pi );                              // Delta Theta angle of the segment
209                               // in radians    << 193                                                             // in radians
210   fLogicScoringTrackerShell = new G4LogicalVol << 194   fLogicScoringTrackerShell = new G4LogicalVolume( solidScoringTrackerShell,    // solid 
211                                                << 195                                                    vacuum,                      // material
212                                                << 196                                                    "logicScoringTrackerShell",  // name
213                                                << 197                                                    0,                           // field manager
214                                                << 198                                                    0,                           // sensitive
215                                                << 199                                                                                 // detector
216                                                << 200                                                    0 );                         // user limits
217   fPhysiScoringTrackerShell = new G4PVPlacemen << 201   fPhysiScoringTrackerShell = new G4PVPlacement( 0,                             // rotation
218                                                << 202                                                  G4ThreeVector(),               // translation
219                                                << 203                                                  "physiScoringTrackerShell",    // name
220                                                << 204                                                  fLogicScoringTrackerShell,     // logical volume
221                                                << 205                                                  fExperimentalHall_phys,        // mother physical
222                                                << 206                                                                                 // volume
223                                                << 207                                                  false,                         // boolean
224                                                << 208                                                                                 // operation
225                                                << 209                                                  0 );                           // copy number
226                                                << 210   
227   // 2nd (middle) spherical shell: EM Calo     << 211   // 2nd (middle) spherical shell: EM Calo 
228   G4Sphere* solidEmCaloShell = new G4Sphere("s << 212   G4Sphere* solidEmCaloShell = new G4Sphere( "solidEmCaloShell",   // name
229                                             fI << 213                                               fInnerRadiusEmCalo,  // Inner radius
230                                             fO << 214                                               fOuterRadiusEmCalo,  // Outer radius
231                                             0. << 215                                               0.0,                 // Starting Phi angle of the
232                                                << 216                                                                    // segment in radians
233                                             2. << 217                                               2.0*CLHEP::pi,       // Delta Phi angle of the
234                                                << 218                                                                    // segment in radians
235                                             0. << 219                                               0.0,                 // Starting Theta angle of the
236                                                << 220                                                                    // segment in radians
237                                             CL << 221                                               CLHEP::pi );         // Delta Theta angle of the
238                                                << 222                                                                    // segment in radians
239   fLogicEmCaloShell = new G4LogicalVolume(soli << 223   fLogicEmCaloShell = new G4LogicalVolume( solidEmCaloShell,       // solid 
240                                           fMat << 224                                            fMaterialEmCalo,        // material
241                                           "log << 225                                            "logicEmCaloShell",     // name
242                                           0,   << 226                                            0,                      // field manager
243                                           0,   << 227                                            0,                      // sensitive detector
244                                           0);  << 228                                            0 );                    // user limits
245   fPhysiEmCaloShell = new G4PVPlacement(0,  // << 229   fPhysiEmCaloShell = new G4PVPlacement( 0,                        // rotation
246                                         G4Thre << 230                                          G4ThreeVector(),          // translation
247                                         "physi << 231                                          "physiEmCaloShell",       // name
248                                         fLogic << 232                                          fLogicEmCaloShell,        // logical volume
249                                         fExper << 233                                          fExperimentalHall_phys,   // mother physical volume
250                                         false, << 234                                          false,                    // boolean operation
251                                         0);  / << 235                                          0 );                      // copy number
252                                                   236 
253   // Scoring EmCalo shell (a thin vacuum layer    237   // Scoring EmCalo shell (a thin vacuum layer, immediately outside the EmCalo shell)
254   G4Sphere* solidScoringEmCaloShell =             238   G4Sphere* solidScoringEmCaloShell =
255     new G4Sphere("solidScoringEmCaloShell",  / << 239     new G4Sphere( "solidScoringEmCaloShell",               // name
256                  fOuterRadiusEmCalo,  // Inner << 240                   fOuterRadiusEmCalo,                      // Inner radius
257                  fOuterRadiusEmCalo + fScoring << 241                   fOuterRadiusEmCalo + fScoringThickness,  // Outer radius
258                  0.0,  // Starting Phi angle o << 242                   0.0,                                     // Starting Phi angle of the segment
259                        // in radians           << 243                                                            // in radians
260                  2.0 * CLHEP::pi,  // Delta Ph << 244                   2.0*CLHEP::pi,                           // Delta Phi angle of the segment
261                                    // in radia << 245                                                            // in radians
262                  0.0,  // Starting Theta angle << 246                   0.0,                                     // Starting Theta angle of the
263                        // segment in radians   << 247                                                            // segment in radians
264                  CLHEP::pi);  // Delta Theta a << 248                   CLHEP::pi );                             // Delta Theta angle of the segment
265                               // in radians    << 249                                                            // in radians
266   fLogicScoringEmCaloShell = new G4LogicalVolu << 250   fLogicScoringEmCaloShell = new G4LogicalVolume( solidScoringEmCaloShell,    // solid 
267                                                << 251                                                   vacuum,                     // material
268                                                << 252                                                   "logicScoringEmCaloShell",  // name
269                                                << 253                                                   0,                          // field manager
270                                                << 254                                                   0,                          // sensitive
271                                                << 255                                                                               // detector
272                                                << 256                                                   0 );                        // user limits
273   fPhysiScoringEmCaloShell = new G4PVPlacement << 257   fPhysiScoringEmCaloShell = new G4PVPlacement( 0,                            // rotation
274                                                << 258                                                 G4ThreeVector(),              // translation
275                                                << 259                                                 "physiScoringEmCaloShell",    // name
276                                                << 260                                                 fLogicScoringEmCaloShell,     // logical volume
277                                                << 261                                                 fExperimentalHall_phys,       // mother physical
278                                                << 262                                                                               // volume
279                                                << 263                                                 false,                        // boolean operation
280                                                << 264                                                 0 );                          // copy number
281                                                << 265   
282   // 3rd (outmost) spherical shell: HAD Calo   << 266   // 3rd (outmost) spherical shell: HAD Calo 
283   G4Sphere* solidHadCaloShell = new G4Sphere(" << 267   G4Sphere* solidHadCaloShell = new G4Sphere( "solidHadCaloShell",  // name
284                                              f << 268                                               fInnerRadiusHadCalo,  // Inner radius
285                                              f << 269                                               fOuterRadiusHadCalo,  // Outer radius
286                                              0 << 270                                               0.0,                  // Starting Phi angle of the
287                                                << 271                                                                     // segment in radians
288                                              2 << 272                                               2.0*CLHEP::pi,        // Delta Phi angle of the
289                                                << 273                                                                     // segment in radians
290                                              0 << 274                                               0.0,                  // Starting Theta angle of
291                                                << 275                                                                     // the segment in radians
292                                              C << 276                                               CLHEP::pi );          // Delta Theta angle of the
293                                                << 277                                                                     // segment in radians
294   fLogicHadCaloShell = new G4LogicalVolume(sol << 278   fLogicHadCaloShell = new G4LogicalVolume( solidHadCaloShell,      // solid 
295                                            fMa << 279                                             fMaterialHadCalo,       // material
296                                            "lo << 280                                             "logicHadCaloShell",    // name
297                                            0,  << 281                                             0,                      // field manager
298                                            0,  << 282                                             0,                      // sensitive detector
299                                            0); << 283                                             0 );                    // user limits
300   fPhysiHadCaloShell = new G4PVPlacement(0,  / << 284   fPhysiHadCaloShell = new G4PVPlacement( 0,                        // rotation
301                                          G4Thr << 285                                           G4ThreeVector(),          // translation
302                                          "phys << 286                                           "physiHadCaloShell",      // name
303                                          fLogi << 287                                           fLogicHadCaloShell,       // logical volume
304                                          fExpe << 288                                           fExperimentalHall_phys,   // mother physical volume
305                                          false << 289                                           false,                    // boolean operation
306                                          0);   << 290                                           0 );                      // copy number
307                                                   291 
308   // Scoring HadCalo shell (a thin vacuum laye    292   // Scoring HadCalo shell (a thin vacuum layer, immediately outside the HadCalo shell)
309   G4Sphere* solidScoringHadCaloShell =            293   G4Sphere* solidScoringHadCaloShell =
310     new G4Sphere("solidScoringHadCaloShell",   << 294     new G4Sphere( "solidScoringHadCaloShell",               // name
311                  fOuterRadiusHadCalo,  // Inne << 295                   fOuterRadiusHadCalo,                      // Inner radius
312                  fOuterRadiusHadCalo + fScorin << 296                   fOuterRadiusHadCalo + fScoringThickness,  // Outer radius
313                  0.0,  // Starting Phi angle o << 297                   0.0,                                      // Starting Phi angle of the
314                        // segment in radians   << 298                                                             // segment in radians
315                  2.0 * CLHEP::pi,  // Delta Ph << 299                   2.0*CLHEP::pi,                            // Delta Phi angle of the segment
316                                    // in radia << 300                                                             // in radians
317                  0.0,  // Starting Theta angle << 301                   0.0,                                      // Starting Theta angle of the
318                        // segment in radians   << 302                                                             // segment in radians
319                  CLHEP::pi);  // Delta Theta a << 303                   CLHEP::pi );                              // Delta Theta angle of the segment
320                               // in radians    << 304                                                             // in radians
321   fLogicScoringHadCaloShell = new G4LogicalVol << 305   fLogicScoringHadCaloShell = new G4LogicalVolume( solidScoringHadCaloShell,    // solid 
322                                                << 306                                                    vacuum,                      // material
323                                                << 307                                                    "logicScoringHadCaloShell",  // name
324                                                << 308                                                    0,                           // field manager
325                                                << 309                                                    0,                           // sensitive
326                                                << 310                                                                                 // detector
327                                                << 311                                                    0 );                         // user limits
328   fPhysiScoringHadCaloShell = new G4PVPlacemen << 312   fPhysiScoringHadCaloShell = new G4PVPlacement( 0,                             // rotation
329                                                << 313                                                  G4ThreeVector(),               // translation
330                                                << 314                                                  "physiScoringHadCaloShell",    // name
331                                                << 315                                                  fLogicScoringHadCaloShell,     // logical volume
332                                                << 316                                                  fExperimentalHall_phys,        // mother physical
333                                                << 317                                                                                 // volume
334                                                << 318                                                  false,                         // boolean
335                                                << 319                                                                                 // operation
336                                                << 320                                                  0 );                           // copy number
337                                                << 321   
338   G4cout << "DetectorConstruction::ConstructSp    322   G4cout << "DetectorConstruction::ConstructSphere() : " << G4endl
339          << "\t World (box) size: " << G4endl  << 323          << "\t World (box) size: " << G4endl
340          << "\t y : -/+ " << expHall_y << " mm << 324          << "\t \t x : -/+ " << expHall_x << " mm ;"
341          << "\t z : -/+ " << expHall_z << " mm << 325          << "\t y : -/+ "    << expHall_y << " mm ;"
                                                   >> 326          << "\t z : -/+ "    << expHall_z << " mm ;" << G4endl
                                                   >> 327          << G4endl;
342   PrintParameters();                              328   PrintParameters();
343   // G4cout << " END  DetectorConstruction::Co << 329   //G4cout << " END  DetectorConstruction::ConstructDetector()
344                                                   330 
345   return fExperimentalHall_phys;                  331   return fExperimentalHall_phys;
346 }                                                 332 }
347                                                   333 
348 //....oooOO0OOooo........oooOO0OOooo........oo    334 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
349                                                   335 
350 void DetectorConstruction::SetMaterialTracker( << 336 void DetectorConstruction::SetMaterialTracker( const G4String name ) {
351 {                                              << 337   fMaterialTracker = G4NistManager::Instance()->FindOrBuildMaterial( name ); 
352   fMaterialTracker = G4NistManager::Instance() << 338   if ( ! fMaterialTracker ) {
353   if (!fMaterialTracker) {                     << 339     G4cout << G4endl << G4endl
354     G4cout << G4endl << G4endl << "WARNING: th << 340            << "WARNING: the name of the material has not been recognized!" << G4endl
355            << G4endl << "     ===> the default << 341            << "     ===> the default  * G4_Si *  will be used." 
356     fMaterialTracker = G4NistManager::Instance << 342            << G4endl << G4endl;  
                                                   >> 343     fMaterialTracker = G4NistManager::Instance()->FindOrBuildMaterial( "G4_Si" ); 
357   }                                               344   }
358   if (fLogicTrackerShell) fLogicTrackerShell-> << 345   if ( fLogicTrackerShell ) fLogicTrackerShell->SetMaterial( fMaterialTracker );
359 }                                                 346 }
360                                                   347 
361 //....oooOO0OOooo........oooOO0OOooo........oo    348 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
362                                                   349 
363 void DetectorConstruction::SetMaterialEmCalo(c << 350 void DetectorConstruction::SetMaterialEmCalo( const G4String name ) {
364 {                                              << 351   fMaterialEmCalo = G4NistManager::Instance()->FindOrBuildMaterial( name ); 
365   fMaterialEmCalo = G4NistManager::Instance()- << 352   if ( ! fMaterialEmCalo ) {
366   if (!fMaterialEmCalo) {                      << 353     G4cout << G4endl << G4endl
367     G4cout << G4endl << G4endl << "WARNING: th << 354            << "WARNING: the name of the material has not been recognized!" << G4endl
368            << G4endl << "     ===> the default << 355            << "     ===> the default  * G4_Pb *  will be used." 
369     fMaterialEmCalo = G4NistManager::Instance( << 356            << G4endl << G4endl;  
                                                   >> 357     fMaterialEmCalo = G4NistManager::Instance()->FindOrBuildMaterial( "G4_Pb" ); 
370   }                                               358   }
371   if (fLogicEmCaloShell) fLogicEmCaloShell->Se << 359   if ( fLogicEmCaloShell ) fLogicEmCaloShell->SetMaterial( fMaterialEmCalo );
372 }                                                 360 }
373                                                   361 
374 //....oooOO0OOooo........oooOO0OOooo........oo    362 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
375                                                   363 
376 void DetectorConstruction::SetMaterialHadCalo( << 364 void DetectorConstruction::SetMaterialHadCalo( const G4String name ) {
377 {                                              << 365   fMaterialHadCalo = G4NistManager::Instance()->FindOrBuildMaterial( name ); 
378   fMaterialHadCalo = G4NistManager::Instance() << 366   if ( fMaterialHadCalo == nullptr ) {
379   if (fMaterialHadCalo == nullptr) {           << 367     G4cout << G4endl << G4endl
380     G4cout << G4endl << G4endl << "WARNING: th << 368            << "WARNING: the name of the material has not been recognized!" << G4endl
381            << G4endl << "     ===> the default << 369            << "     ===> the default  * G4_Fe *  will be used." 
382     fMaterialHadCalo = G4NistManager::Instance << 370            << G4endl << G4endl;  
                                                   >> 371     fMaterialHadCalo = G4NistManager::Instance()->FindOrBuildMaterial( "G4_Fe" ); 
383   }                                               372   }
384   if (fLogicHadCaloShell) fLogicHadCaloShell-> << 373   if ( fLogicHadCaloShell ) fLogicHadCaloShell->SetMaterial( fMaterialHadCalo );
385 }                                                 374 }
386                                                   375 
387 //....oooOO0OOooo........oooOO0OOooo........oo    376 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
388                                                   377 
389 void DetectorConstruction::UpdateGeometry()    << 378 void DetectorConstruction::UpdateGeometry() {
390 {                                              << 379   //G4cout << " BEGIN  DetectorConstruction::UpdateGeometry" << G4endl;
391   // G4cout << " BEGIN  DetectorConstruction:: << 
392   G4RunManager::GetRunManager()->ReinitializeG    380   G4RunManager::GetRunManager()->ReinitializeGeometry();
393   PrintParameters();                              381   PrintParameters();
394   // Update also the position of the gun          382   // Update also the position of the gun
395   const PrimaryGeneratorAction* pPrimaryAction << 383   const PrimaryGeneratorAction* pPrimaryAction = 
396     G4RunManager::GetRunManager()->GetUserPrim << 384     dynamic_cast< const PrimaryGeneratorAction* >
397   if (pPrimaryAction) pPrimaryAction->SetGunPo << 385       ( G4RunManager::GetRunManager()->GetUserPrimaryGeneratorAction() );
398   // G4cout << " END  DetectorConstruction::Up << 386   if ( pPrimaryAction ) pPrimaryAction->SetGunPosition();
                                                   >> 387   //G4cout << " END  DetectorConstruction::UpdateGeometry" << G4endl;
399 }                                                 388 }
400                                                   389 
401 //....oooOO0OOooo........oooOO0OOooo........oo    390 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
402                                                   391 
403 void DetectorConstruction::PrintParameters()   << 392 void DetectorConstruction::PrintParameters() {
404 {                                              << 393   G4cout << G4endl
405   G4cout << G4endl << " ------  DetectorConstr << 394          << " ------  DetectorConstruction::PrintParameters() ------ " << G4endl
406          << " MaterialTracker = " << fMaterial    395          << " MaterialTracker = " << fMaterialTracker->GetName() << G4endl
407          << " MaterialEmCalo  = " << fMaterial    396          << " MaterialEmCalo  = " << fMaterialEmCalo->GetName() << G4endl
408          << " MaterialHadCalo = " << fMaterial    397          << " MaterialHadCalo = " << fMaterialHadCalo->GetName() << G4endl
409          << " InnerRadiusTracker = " << fInner    398          << " InnerRadiusTracker = " << fInnerRadiusTracker << " mm" << G4endl
410          << " OuterRadiusTracker = " << fOuter    399          << " OuterRadiusTracker = " << fOuterRadiusTracker << " mm" << G4endl
411          << " InnerRadiusEmCalo  = " << fInner << 400          << " InnerRadiusEmCalo  = " << fInnerRadiusEmCalo  << " mm" << G4endl
412          << " OuterRadiusEmCalo  = " << fOuter << 401          << " OuterRadiusEmCalo  = " << fOuterRadiusEmCalo  << " mm" << G4endl
413          << " InnerRadiusHadCalo = " << fInner    402          << " InnerRadiusHadCalo = " << fInnerRadiusHadCalo << " mm" << G4endl
414          << " OuterRadiusHadCalo = " << fOuter    403          << " OuterRadiusHadCalo = " << fOuterRadiusHadCalo << " mm" << G4endl
415          << " ScoringThickness   = " << fScori << 404          << " ScoringThickness   = " << fScoringThickness   << " mm" << G4endl
416          << " -------------------------------- << 405          << " -------------------------------------------------------- " << G4endl
                                                   >> 406          << G4endl;
417 }                                                 407 }
418                                                   408 
419 //....oooOO0OOooo........oooOO0OOooo........oo    409 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
420                                                   410