Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/examples/advanced/eFLASH_radiotherapy/src/FlashDetectorConstruction.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/advanced/eFLASH_radiotherapy/src/FlashDetectorConstruction.cc (Version 11.3.0) and /examples/advanced/eFLASH_radiotherapy/src/FlashDetectorConstruction.cc (Version 11.1.1)


  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 //                                                 26 //
 27 /// \file FlashDetectorConstruction.cc             27 /// \file FlashDetectorConstruction.cc
 28 /// \brief Implementation of the FlashDetector     28 /// \brief Implementation of the FlashDetectorConstruction class
 29                                                    29 
 30                                                    30 
 31 #include "FlashDetectorConstruction.hh"            31 #include "FlashDetectorConstruction.hh"
 32                                                    32 
 33 #include "G4RunManager.hh"                         33 #include "G4RunManager.hh"
 34                                                    34 
 35 #include "G4Material.hh"                           35 #include "G4Material.hh"
 36 #include "G4NistManager.hh"                        36 #include "G4NistManager.hh"
 37 #include "G4Region.hh"                             37 #include "G4Region.hh"
 38 #include "G4SDManager.hh"                          38 #include "G4SDManager.hh"
 39                                                    39 
 40 #include "G4AutoDelete.hh"                         40 #include "G4AutoDelete.hh"
 41 #include "G4Box.hh"                                41 #include "G4Box.hh"
 42 #include "G4GlobalMagFieldMessenger.hh"            42 #include "G4GlobalMagFieldMessenger.hh"
 43 #include "G4LogicalVolume.hh"                      43 #include "G4LogicalVolume.hh"
 44 #include "G4PVParameterised.hh"                    44 #include "G4PVParameterised.hh"
 45 #include "G4PVPlacement.hh"                        45 #include "G4PVPlacement.hh"
 46 #include "G4Tubs.hh"                               46 #include "G4Tubs.hh"
 47                                                    47 
 48 #include "G4GeometryManager.hh"                    48 #include "G4GeometryManager.hh"
 49 #include "G4GeometryTolerance.hh"                  49 #include "G4GeometryTolerance.hh"
 50                                                    50 
 51 #include "G4UserLimits.hh"                         51 #include "G4UserLimits.hh"
 52                                                    52 
 53 #include "G4Colour.hh"                             53 #include "G4Colour.hh"
 54 #include "G4VisAttributes.hh"                      54 #include "G4VisAttributes.hh"
 55                                                    55 
 56 #include "G4SystemOfUnits.hh"                      56 #include "G4SystemOfUnits.hh"
 57                                                    57 
 58 #include "FlashApplicator.hh"                  <<  58 #include "Applicator.hh"
 59                                                    59 
 60                                                    60 
 61 #include "G4MaterialPropertiesTable.hh"            61 #include "G4MaterialPropertiesTable.hh"
 62                                                    62 
 63 #include "G4PSEnergyDeposit.hh"                    63 #include "G4PSEnergyDeposit.hh"
 64 #include "G4PhysicalConstants.hh"                  64 #include "G4PhysicalConstants.hh"
 65 #include "G4SystemOfUnits.hh"                      65 #include "G4SystemOfUnits.hh"
 66 #include "G4VPrimitiveScorer.hh"                   66 #include "G4VPrimitiveScorer.hh"
 67 #include "G4VisAttributes.hh"                      67 #include "G4VisAttributes.hh"
 68 #include "FlashDetectorMessenger.hh"               68 #include "FlashDetectorMessenger.hh"
 69                                                    69 
 70 #include "FlashSensitiveDetector.hh"           << 
 71                                                << 
 72 //....oooOO0OOooo........oooOO0OOooo........oo     70 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 73                                                    71 
 74 FlashDetectorConstruction::FlashDetectorConstr     72 FlashDetectorConstruction::FlashDetectorConstruction()
 75     : G4VUserDetectorConstruction(), physicalT     73     : G4VUserDetectorConstruction(), physicalTreatmentRoom(0),logicTreatmentRoom(0), Collimator(0), fPhantom(0),
 76 fPhantomLogicalVolume(0),fPhant_phys(0),           74 fPhantomLogicalVolume(0),fPhant_phys(0),
 77       fCheckOverlaps(true),                    <<  75       fCheckOverlaps(true) {
 78       fActivateDet(false)                      << 
 79        {                                       << 
 80                                                    76 
 81   DefineMaterials();                               77   DefineMaterials();
 82   fDetectorMessenger = new FlashDetectorMessen     78   fDetectorMessenger = new FlashDetectorMessenger(this);
 83                                                    79 
 84   SetPhantomSize(30. *cm, 30. *cm, 30. *cm);       80   SetPhantomSize(30. *cm, 30. *cm, 30. *cm);
 85   SetAirGap(0*cm); // Set the air gap between      81   SetAirGap(0*cm); // Set the air gap between the water phantom and the end of the applicator
 86   SetDetectorThickness(10*um); //Set the SiC d <<  82   SetDetectorThickness(10*um);
 87   SetDetector_subThickness(370*um);                83   SetDetector_subThickness(370*um);
 88   SetDetectorWidth(2*mm); //Set the SiC detect <<  84   SetDetectorWidth(5*mm);
 89   SetDetectorPosition(13*mm); // Position of t <<  85   SetAirGap_water_detector(0*cm); // Set the air gap between the end of the water phantom and the entrance of the detector
                                                   >>  86 
 90                                                    87   
 91   // Change the following parameters to change << 
 92   nDet = 40;                                   << 
 93   fDet_ctc = 3 * mm;                           << 
 94                                                    88   
 95 }                                                  89 }
 96                                                    90 
 97 //....oooOO0OOooo........oooOO0OOooo........oo     91 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
 98                                                    92 
 99 FlashDetectorConstruction::~FlashDetectorConst     93 FlashDetectorConstruction::~FlashDetectorConstruction() {
100                                                    94 
101   delete fDetectorMessenger;                       95   delete fDetectorMessenger;
102 }                                                  96 }
103                                                    97 
104 //....oooOO0OOooo........oooOO0OOooo........oo     98 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
105                                                    99 
106 void FlashDetectorConstruction::DefineMaterial    100 void FlashDetectorConstruction::DefineMaterials() {
107   nist = G4NistManager::Instance();               101   nist = G4NistManager::Instance();
108 //write here a function to define custom mater    102 //write here a function to define custom materials
109 G4bool isotopes = false;                          103 G4bool isotopes = false;
110  Si = nist->FindOrBuildElement("Si", isotopes)    104  Si = nist->FindOrBuildElement("Si", isotopes);
111  C = nist->FindOrBuildElement("C", isotopes);     105  C = nist->FindOrBuildElement("C", isotopes);
112                                                   106 
113   }                                               107   }
114                                                   108 
115                                                   109 
116 //                                                110 //
117 G4VPhysicalVolume *                               111 G4VPhysicalVolume *
118 FlashDetectorConstruction::ConstructPhantom(G4    112 FlashDetectorConstruction::ConstructPhantom(G4double CollPos) {
119 //This function creates a cubic phantom with t    113 //This function creates a cubic phantom with the point Collpos on the surface of the cube.
120                                                   114 
121  fPhantomMaterial = nist->FindOrBuildMaterial(    115  fPhantomMaterial = nist->FindOrBuildMaterial("G4_WATER");
122                                                   116 
123  fPosition_coefficient = CollPos;                 117  fPosition_coefficient = CollPos;
124                                                   118  
125  fPhantom_coordinateX = (fPosition_coefficient    119  fPhantom_coordinateX = (fPosition_coefficient * mm + fPhantomSizeX / 2);
126                                                   120 
127  fPhantomPosition =  G4ThreeVector(fPhantom_co    121  fPhantomPosition =  G4ThreeVector(fPhantom_coordinateX, 0. * mm, 0. * mm); //phantom is constructed with the entrance surface attached to the applicator 
128                                                   122   
129                                                   123 
130   // Definition of the solid volume of the Pha    124   // Definition of the solid volume of the Phantom
131   fPhantom = new G4Box("Phantom", fPhantomSize    125   fPhantom = new G4Box("Phantom", fPhantomSizeX / 2, fPhantomSizeY / 2,
132                       fPhantomSizeZ / 2);         126                       fPhantomSizeZ / 2);
133                                                   127 
134   // Definition of the logical volume of the P    128   // Definition of the logical volume of the Phantom
135   fPhantomLogicalVolume =                         129   fPhantomLogicalVolume =
136       new G4LogicalVolume(fPhantom, fPhantomMa    130       new G4LogicalVolume(fPhantom, fPhantomMaterial, "phantomLog", 0, 0, 0);
137                                                   131 
138   // Definition of the physical volume of the     132   // Definition of the physical volume of the Phantom
139   fPhant_phys =                                   133   fPhant_phys =
140       new G4PVPlacement(0, fPhantomPosition, "    134       new G4PVPlacement(0, fPhantomPosition, "phantomPhys", fPhantomLogicalVolume,
141                         physicalTreatmentRoom,    135                         physicalTreatmentRoom, false, 0);
142 //define the region to set cuts in FlashPhysic    136 //define the region to set cuts in FlashPhysicsList.cc and step limit
143   G4Region *PhantomRegion = new G4Region("Phan    137   G4Region *PhantomRegion = new G4Region("Phantom_reg");
144   fPhantomLogicalVolume->SetRegion(PhantomRegi    138   fPhantomLogicalVolume->SetRegion(PhantomRegion);
145   PhantomRegion->AddRootLogicalVolume(fPhantom    139   PhantomRegion->AddRootLogicalVolume(fPhantomLogicalVolume);
146                                                   140 
147   // Visualisation attributes of the phantom      141   // Visualisation attributes of the phantom
148   red = new G4VisAttributes(G4Colour(0 / 255.,    142   red = new G4VisAttributes(G4Colour(0 / 255., 255 / 255., 0 / 255.));
149   red->SetVisibility(true);                       143   red->SetVisibility(true);
150                                                   144 
151   blue = new G4VisAttributes(G4Colour(0 / 255.    145   blue = new G4VisAttributes(G4Colour(0 / 255., 0. / 255., 255. / 255.));
152   blue->SetVisibility(true);                      146   blue->SetVisibility(true);
153                                                   147 
154   fPhantomLogicalVolume->SetVisAttributes(red)    148   fPhantomLogicalVolume->SetVisAttributes(red);
155 //set step limit in phantom                       149 //set step limit in phantom
156   G4double maxStep = 0.1 * mm;                    150   G4double maxStep = 0.1 * mm;
157   fStepLimit = new G4UserLimits(maxStep);         151   fStepLimit = new G4UserLimits(maxStep);
158   fPhantomLogicalVolume->SetUserLimits(fStepLi    152   fPhantomLogicalVolume->SetUserLimits(fStepLimit);
159                                                   153 
160   return fPhant_phys;                             154   return fPhant_phys;
161 }                                                 155 }
162                                                   156 
163                                                << 157 G4VPhysicalVolume *
164 void FlashDetectorConstruction::ConstructDetec << 158 FlashDetectorConstruction::ConstructDetector(){
165  //Detector                                       159  //Detector
166                                                << 160 
167                                                   161 
168   G4double fDensity_SiC=3.22*g/cm3;               162   G4double fDensity_SiC=3.22*g/cm3;
169                                                   163 
170   SiC=new G4Material("SiC", fDensity_SiC,2);      164   SiC=new G4Material("SiC", fDensity_SiC,2);
171   SiC->AddElement(Si,1);                          165   SiC->AddElement(Si,1);
172   SiC->AddElement(C,1);                           166   SiC->AddElement(C,1);
173                                                   167  
174  fDetectorMaterial=SiC;                           168  fDetectorMaterial=SiC;
175                                                   169 
176                                                   170 
177                                                << 171  fDetectorPosition=fPhantom_coordinateX+fAirGap+fPhantomSizeX/2+fDet_thickness/2+fAirGap_phantom_det;
                                                   >> 172  
178  fDet_box = new G4Box("Detector",fDet_thicknes    173  fDet_box = new G4Box("Detector",fDet_thickness/2,fDet_width/2,fDet_width/2);
179                                                   174  
180   // Definition of the logical volume of the D    175   // Definition of the logical volume of the Detector
181   fDetLogicalVolume =                             176   fDetLogicalVolume =
182       new G4LogicalVolume(fDet_box, fDetectorM    177       new G4LogicalVolume(fDet_box, fDetectorMaterial, "DetectorLog", 0, 0, 0);
                                                   >> 178   fDet_phys = new G4PVPlacement(0,G4ThreeVector(fDetectorPosition, 0. * mm, 0. * mm), "DetPhys",fDetLogicalVolume,physicalTreatmentRoom,false, 0, fCheckOverlaps);
183                                                   179 
184                                                << 180   
185   fDet_sub = new G4Box("Det_sub",fDet_sub_thic    181   fDet_sub = new G4Box("Det_sub",fDet_sub_thickness/2,fDet_width/2,fDet_width/2);
186                                                   182  
187     // Definition of the logical volume of the << 183   // Definition of the logical volume of the Detector 
188     fDet_sub_LogicalVolume =                   << 184   fDet_sub_LogicalVolume =
189         new G4LogicalVolume(fDet_sub, fDetecto << 185       new G4LogicalVolume(fDet_sub, fDetectorMaterial, "Det_sub_Log", 0, 0, 0);
                                                   >> 186   fDet_sub_phys = new G4PVPlacement(0,G4ThreeVector(fDetectorPosition+fDet_thickness+fDet_sub_thickness/2, 0. * mm, 0. * mm), "Det_sub_Phys",fDet_sub_LogicalVolume,physicalTreatmentRoom,false, 0, fCheckOverlaps);
190                                                   187 
191                                                << 
192   G4double posInit = (nDet - 1) * fDet_ctc / 2 << 
193                                                   188 
194                                                << 189     return fDet_phys;
195 if (fActivateDet) {                            << 
196     // Placement physical volumes of the detec << 
197     for (int i = 0; i < nDet; i++){            << 
198                                                << 
199     std::ostringstream os;                     << 
200     os << "Det_Phys_";                         << 
201     if (i < 10)                                << 
202     {                                          << 
203         os << "00";                            << 
204     } else if (i < 100){                       << 
205         os << "0";                             << 
206     }                                          << 
207     os << i ;                                  << 
208     G4String name = os.str();                  << 
209                                                << 
210     G4cout << "Position: " << -posInit + fDet_ << 
211                                                << 
212     fDet_phys.push_back(new G4PVPlacement(     << 
213         0,                                     << 
214   //  G4ThreeVector(fDetectorPosition, 0, -pos << 
215   G4ThreeVector(-fPhantomSizeX/2+fDetectorPosi << 
216         name,                                  << 
217         fDetLogicalVolume,                     << 
218         fPhant_phys,                           << 
219         false,                                 << 
220         i,                                     << 
221         fCheckOverlaps                         << 
222     ));                                        << 
223                                                << 
224                                                << 
225     fDet_sub_phys.push_back (new G4PVPlacement << 
226            (0,                                 << 
227             G4ThreeVector(-fPhantomSizeX/2+fDe << 
228             "Det_sub_Phys",                    << 
229             fDet_sub_LogicalVolume,            << 
230             fPhant_phys,                       << 
231             false,                             << 
232             i,                                 << 
233             fCheckOverlaps));                  << 
234                                                << 
235                                                << 
236                                                << 
237     }                                          << 
238 }                                              << 
239                                                   190 
240 }                                                 191 }
241                                                   192 
242 G4VPhysicalVolume *FlashDetectorConstruction::    193 G4VPhysicalVolume *FlashDetectorConstruction::Construct() {
243   // -----------------------------                194   // -----------------------------
244   // Treatment room - World volume                195   // Treatment room - World volume
245   //------------------------------                196   //------------------------------
246   // Treatment room sizes                         197   // Treatment room sizes
247   const G4double worldX = 400.0 * cm;             198   const G4double worldX = 400.0 * cm;
248   const G4double worldY = 400.0 * cm;             199   const G4double worldY = 400.0 * cm;
249   const G4double worldZ = 400.0 * cm;             200   const G4double worldZ = 400.0 * cm;
250   G4bool isotopes = false;                        201   G4bool isotopes = false;
251                                                   202 
252   airNist = G4NistManager::Instance()->FindOrB    203   airNist = G4NistManager::Instance()->FindOrBuildMaterial("G4_AIR", isotopes);
253   // Air                                          204   // Air
254   //                                              205   //
255                                                   206 
256   G4Box *treatmentRoom = new G4Box("TreatmentR    207   G4Box *treatmentRoom = new G4Box("TreatmentRoom", worldX, worldY, worldZ);
257   logicTreatmentRoom = new G4LogicalVolume(tre    208   logicTreatmentRoom = new G4LogicalVolume(treatmentRoom, airNist,
258                                            "lo    209                                            "logicTreatmentRoom", 0, 0, 0);
259   physicalTreatmentRoom =                         210   physicalTreatmentRoom =
260       new G4PVPlacement(0, G4ThreeVector(), "p    211       new G4PVPlacement(0, G4ThreeVector(), "physicalTreatmentRoom",
261                         logicTreatmentRoom, 0,    212                         logicTreatmentRoom, 0, false, 0);
262                                                   213 
263   // The treatment room is invisible in the Vi    214   // The treatment room is invisible in the Visualisation
264   logicTreatmentRoom->SetVisAttributes(G4VisAt    215   logicTreatmentRoom->SetVisAttributes(G4VisAttributes::GetInvisible());
265                                                   216 
266   // -----------------------------                217   // -----------------------------
267   // Applicator + phantom +Default dimensions     218   // Applicator + phantom +Default dimensions
268   //------------------------------                219   //------------------------------
269                                                   220  
270                                                   221 
271                                                   222   
272                                                   223 
273   Collimator = new FlashApplicator(physicalTre << 224   Collimator = new Applicator(physicalTreatmentRoom);
274                                                   225   
275                                                   226 
276                                                   227    
277  fPhantom_physical =                              228  fPhantom_physical =
278         ConstructPhantom(Collimator->fFinalApp    229         ConstructPhantom(Collimator->fFinalApplicatorXPositionFlash +
279   Collimator->fHightFinalApplicatorFlash+fAirG    230   Collimator->fHightFinalApplicatorFlash+fAirGap);
280                                                << 231  ConstructDetector();
                                                   >> 232    
281                                                   233 
282   ConstructDetector();                         << 
283                                                << 
284   return physicalTreatmentRoom;                   234   return physicalTreatmentRoom;
285 }                                                 235 }
286                                                   236 
287                                                   237 
288                                                   238 
289 void FlashDetectorConstruction::ConstructSDand    239 void FlashDetectorConstruction::ConstructSDandField() {
290 if (fActivateDet){                             << 240 //modify this function if you want to insert a sensitive detector
291                                                << 
292     G4SDManager * SDman = G4SDManager::GetSDMp << 
293                                                << 
294     // Sensitive detector                      << 
295     FlashSensitiveDetector *fSensDet = new Fla << 
296                                                << 
297     SDman->AddNewDetector(fSensDet);           << 
298     fDetLogicalVolume->SetSensitiveDetector(fS << 
299                                                << 
300 }                                              << 
301                                                << 
302 }                                                 241 }
303                                                   242 
304                                                   243 
305 /////MESSANGER ///                                244 /////MESSANGER ///
306                                                   245 
307 G4bool FlashDetectorConstruction::SetPhantomMa    246 G4bool FlashDetectorConstruction::SetPhantomMaterial(G4String material)
308 {                                                 247 {
309                                                   248 
310     if (G4Material* pMat = G4NistManager::Inst    249     if (G4Material* pMat = G4NistManager::Instance()->FindOrBuildMaterial(material, false) )
311     {                                             250     {
312   fPhantomMaterial  = pMat;                       251   fPhantomMaterial  = pMat;
313                                                   252 
314   if (fPhantomLogicalVolume)                      253   if (fPhantomLogicalVolume) 
315   {                                               254   {
316                                                   255       
317       fPhantomLogicalVolume ->  SetMaterial(pM    256       fPhantomLogicalVolume ->  SetMaterial(pMat);
318                                                   257 
319       G4RunManager::GetRunManager() -> Physics    258       G4RunManager::GetRunManager() -> PhysicsHasBeenModified();
320       G4RunManager::GetRunManager() -> Geometr    259       G4RunManager::GetRunManager() -> GeometryHasBeenModified();
321       G4cout << "The material of Phantom/Detec    260       G4cout << "The material of Phantom/Detector has been changed to " << material << G4endl;
322   }                                               261   }
323     }                                             262     }
324     else                                          263     else
325     {                                             264     {
326   G4cout << "WARNING: material \"" << material    265   G4cout << "WARNING: material \"" << material << "\" doesn't exist in NIST elements/materials"
327       " table [located in $G4INSTALL/source/ma    266       " table [located in $G4INSTALL/source/materials/src/G4NistMaterialBuilder.cc]" << G4endl; 
328   G4cout << "Use command \"/parameter/nist\" t    267   G4cout << "Use command \"/parameter/nist\" to see full materials list!" << G4endl; 
329   return false;                                   268   return false;
330     }                                             269     }
331                                                   270 
332     return true;                                  271     return true;
333 }                                                 272 }
334                                                   273 
335                                                   274 
336 void FlashDetectorConstruction::SetPhantomSize    275 void FlashDetectorConstruction::SetPhantomSize(G4double sizeX, G4double sizeY, G4double sizeZ)
337 {                                                 276 {
338     if (sizeX > 0.) fPhantomSizeX = sizeX;        277     if (sizeX > 0.) fPhantomSizeX = sizeX;
339     if (sizeY > 0.) fPhantomSizeY = sizeY;        278     if (sizeY > 0.) fPhantomSizeY = sizeY;
340     if (sizeZ > 0.) fPhantomSizeZ = sizeZ;        279     if (sizeZ > 0.) fPhantomSizeZ = sizeZ;
341 }                                                 280 }
342                                                   281 
343 void FlashDetectorConstruction::SetAirGap(G4do    282 void FlashDetectorConstruction::SetAirGap(G4double displ)
344 {                                                 283 {
345                                                   284   
346    fAirGap=displ;                                 285    fAirGap=displ;
347 }                                                 286 }
348                                                   287 
349 G4bool FlashDetectorConstruction::SetDetectorM    288 G4bool FlashDetectorConstruction::SetDetectorMaterial(G4String material)
350 {                                                 289 {
351                                                   290 
352     if (G4Material* pMat = G4NistManager::Inst    291     if (G4Material* pMat = G4NistManager::Instance()->FindOrBuildMaterial(material, false) )
353     {                                             292     {
354   fDetectorMaterial  = pMat;                      293   fDetectorMaterial  = pMat;
355                                                   294 
356   if (fDetLogicalVolume)                          295   if (fDetLogicalVolume) 
357   {                                               296   {
358                                                   297       
359       fDetLogicalVolume ->  SetMaterial(pMat);    298       fDetLogicalVolume ->  SetMaterial(pMat);
360                                                   299 
361       G4RunManager::GetRunManager() -> Physics    300       G4RunManager::GetRunManager() -> PhysicsHasBeenModified();
362       G4RunManager::GetRunManager() -> Geometr    301       G4RunManager::GetRunManager() -> GeometryHasBeenModified();
363       G4cout << "The material of Phantom/Detec    302       G4cout << "The material of Phantom/Detector has been changed to " << material << G4endl;
364   }                                               303   }
365     }                                             304     }
366     else                                          305     else
367     {                                             306     {
368   G4cout << "WARNING: material \"" << material    307   G4cout << "WARNING: material \"" << material << "\" doesn't exist in NIST elements/materials"
369       " table [located in $G4INSTALL/source/ma    308       " table [located in $G4INSTALL/source/materials/src/G4NistMaterialBuilder.cc]" << G4endl; 
370   G4cout << "Use command \"/parameter/nist\" t    309   G4cout << "Use command \"/parameter/nist\" to see full materials list!" << G4endl; 
371   return false;                                   310   return false;
372     }                                             311     }
373                                                   312 
374     return true;                                  313     return true;
375 }                                                 314 }
376                                                   315 
377                                                   316 
378                                                   317 
379                                                   318 
380 void FlashDetectorConstruction::SetDetectorThi    319 void FlashDetectorConstruction::SetDetectorThickness(G4double thickness)
381 {                                                 320 {
382                                                   321  
383    fDet_thickness=thickness;                      322    fDet_thickness=thickness;
384 }                                                 323 }
385                                                   324 
386 void FlashDetectorConstruction::SetDetectorWid    325 void FlashDetectorConstruction::SetDetectorWidth(G4double width)
387 {                                                 326 {
388                                                   327  
389    fDet_width=width;                              328    fDet_width=width;
390 }                                                 329 }
391                                                   330 
392 void FlashDetectorConstruction::SetDetector_su    331 void FlashDetectorConstruction::SetDetector_subThickness(G4double thickness_sub)
393 {                                                 332 {
394                                                   333  
395     fDet_sub_thickness= thickness_sub;            334     fDet_sub_thickness= thickness_sub;
396 }                                                 335 }
397                                                   336 
398                                                   337 
399 void FlashDetectorConstruction::SetDetectorPos << 338  
400 {                                              << 
401                                                   339 
402    fDetectorPosition=position;                 << 340 
                                                   >> 341  void FlashDetectorConstruction::SetAirGap_water_detector(G4double spost)
                                                   >> 342 {
                                                   >> 343   
                                                   >> 344   fAirGap_phantom_det=spost;
403 }                                                 345 }
404                                                   346 
405 void FlashDetectorConstruction::ActivateDetArr << 347 
406     fActivateDet = fbool;                      << 348 void FlashDetectorConstruction::SetDetectorPosition(G4double position)
                                                   >> 349 {
                                                   >> 350  
                                                   >> 351    fDetectorPosition=position;
407 }                                                 352 }
408                                                   353