Changeset 1230 for trunk/examples/advanced/air_shower
- Timestamp:
- Jan 8, 2010, 3:02:48 PM (14 years ago)
- Location:
- trunk/examples/advanced/air_shower
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/advanced/air_shower/GNUmakefile
r807 r1230 23 23 endif 24 24 25 ifdef G4ANALYSIS_USE26 CPPFLAGS += `aida-config --include`27 LDFLAGS += `aida-config --lib`28 endif29 30 25 31 26 .PHONY: all -
trunk/examples/advanced/air_shower/UltraMacro.mac
r807 r1230 2 2 /run/verbose 2 3 3 /event/verbose 0 4 /tracking/verbose 04 /tracking/verbose 1 5 5 /run/initialize 6 /gps/particle opticalphoton6 /gps/particle mu- 7 7 /gps/direction 0.0 0.0 -1.0 8 8 /gps/pos/centre 0.0 0.0 100. cm … … 10 10 /gps/pos/shape Circle 11 11 /gps/pos/radius 25.0 cm 12 /gps/energy 3 .0eV12 /gps/energy 300.0 MeV 13 13 14 14 /mysetrun/SetRunID 9999 15 /run/beamOn 100 16 exit 15 /run/beamOn 1 -
trunk/examples/advanced/air_shower/Visualisation.mac
r1187 r1230 13 13 # 14 14 #/vis/open OGLIX 15 /vis/open RayTracerX 16 #/vis/open ATree 17 #/vis/open OIX 15 #/vis/open RayTracer 18 16 #/vis/open OGLSX 19 #/vis/open DAWNFILE17 /vis/open DAWNFILE 20 18 #/vis/open HepRepFile 21 19 #/vis/open VRML2FILE … … 35 33 /vis/scene/endOfEventAction accumulate 36 34 #/vis/drawVolume 35 /gps/particle opticalphoton 36 /gps/energy 2.0 eV 37 /mysetrun/SetRunID 9999 38 /run/beamOn 100 37 39 38 39 /mysetrun/SetRunID 999940 /run/beamOn 5041 -
trunk/examples/advanced/air_shower/include/UltraAnalysisManager.hh
r807 r1230 58 58 class IAnalysisFactory; 59 59 class ITreeFactory; 60 } ;60 } 61 61 #endif 62 62 -
trunk/examples/advanced/air_shower/include/UltraDetectorConstruction.hh
r807 r1230 60 60 class UltraDetectorConstruction : public G4VUserDetectorConstruction 61 61 { 62 62 63 public: 63 64 UltraDetectorConstruction(); … … 66 67 public: 67 68 G4VPhysicalVolume* Construct(); 69 70 inline G4double GetLambdaMin() const {return lambda_min;} 71 inline G4double GetLambdaMax() const {return lambda_max;} 68 72 69 73 private: … … 82 86 UltraPMTSD* PMTSD ; //pointer to the photomultiplier sensitive detector 83 87 G4SDManager* SDmanager ; // Sensitive Detector Manager 84 88 89 G4double lambda_min ; 90 G4double lambda_max ; 85 91 }; 86 92 -
trunk/examples/advanced/air_shower/src/UltraDetectorConstruction.cc
r807 r1230 76 76 // Sensitive Detector Manager 77 77 SDmanager = G4SDManager::GetSDMpointer(); 78 79 // Define wavelength limits for materials definition 80 lambda_min = 200*nm ; 81 lambda_max = 700*nm ; 82 78 83 } 79 84 … … 225 230 ///////////////////////////////////////////// 226 231 227 const G4int NUMENTRIES = 32;232 const G4int NUMENTRIES = 2; 228 233 229 234 // Energy bins 230 G4double X_RINDEX[NUMENTRIES] = 231 { 2.034E-9*GeV, 2.068E-9*GeV, 2.103E-9*GeV, 2.139E-9*GeV, 232 2.177E-9*GeV, 2.216E-9*GeV, 2.256E-9*GeV, 2.298E-9*GeV, 233 2.341E-9*GeV, 2.386E-9*GeV, 2.433E-9*GeV, 2.481E-9*GeV, 234 2.532E-9*GeV, 2.585E-9*GeV, 2.640E-9*GeV, 2.697E-9*GeV, 235 2.757E-9*GeV, 2.820E-9*GeV, 2.885E-9*GeV, 2.954E-9*GeV, 236 3.026E-9*GeV, 3.102E-9*GeV, 3.181E-9*GeV, 3.265E-9*GeV, 237 3.353E-9*GeV, 3.446E-9*GeV, 3.545E-9*GeV, 3.649E-9*GeV, 238 3.760E-9*GeV, 3.877E-9*GeV, 4.002E-9*GeV, 4.136E-9*GeV } ; 235 G4double X_RINDEX[NUMENTRIES] = {h_Planck*c_light/lambda_max, h_Planck*c_light/lambda_min} ; 239 236 240 237 241 238 // Air 242 G4double RINDEX_AIR[NUMENTRIES] = 243 { 1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 244 1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 245 1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 246 1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 247 1.00, 1.00, 1.00, 1.00 } ; 239 G4double RINDEX_AIR[NUMENTRIES] = {1.00, 1.00} ; 248 240 249 241 // Air refractive index at 20 oC and 1 atm (from PDG) … … 265 257 266 258 const G4int N_RINDEX_QUARTZ = 2 ; 267 G4double X_RINDEX_QUARTZ[N_RINDEX_QUARTZ] = { 0.0*eV, 10.0*eV};259 G4double X_RINDEX_QUARTZ[N_RINDEX_QUARTZ] = {h_Planck*c_light/lambda_max, h_Planck*c_light/lambda_min} ; 268 260 G4double RINDEX_QUARTZ[N_RINDEX_QUARTZ] = {1.54, 1.54}; 269 261 … … 280 272 // Refractive index 281 273 282 const G4int N_RINDEX_ACRYLIC = 3 ; 283 G4double X_RINDEX_ACRYLIC[N_RINDEX_ACRYLIC] = {320.0, 400.0, 500.0}; // Wavelength in nanometers 284 G4double RINDEX_ACRYLIC[N_RINDEX_ACRYLIC] = {1.526, 1.507, 1.497}; 285 286 // Convert from nm to GeV 287 288 for(G4int i=0;i<N_RINDEX_ACRYLIC; i++){ 289 X_RINDEX_ACRYLIC[i] = ((1239.84/X_RINDEX_ACRYLIC[i])*1E-9)*GeV; 290 } 274 const G4int NENTRIES = 11 ; 275 G4double LAMBDA_ACRYLIC[NENTRIES] ; 276 277 278 G4double RINDEX_ACRYLIC[NENTRIES] ; 279 G4double ENERGY_ACRYLIC[NENTRIES] ; 280 281 // Parameterization for refractive index of High Grade PMMA 282 283 G4double bParam[4] = {1760.7010,-1.3687,2.4388e-3,-1.5178e-6} ; 284 285 for(G4int i=0;i<NENTRIES; i++){ 286 287 LAMBDA_ACRYLIC[i] = lambda_min + i*(lambda_max-lambda_min)/float(NENTRIES-1) ; 288 RINDEX_ACRYLIC[i] = 0.0 ; 289 290 for (G4int jj=0 ; jj<4 ; jj++) 291 { 292 RINDEX_ACRYLIC[i] += (bParam[jj]/1000.0)*std::pow(LAMBDA_ACRYLIC[i]/nm,jj) ; 293 } 294 295 ENERGY_ACRYLIC[i] = h_Planck*c_light/LAMBDA_ACRYLIC[i] ; // Convert from wavelength to energy ; 296 // G4cout << ENERGY_ACRYLIC[i]/eV << " " << LAMBDA_ACRYLIC[i]/nm << " " << RINDEX_ACRYLIC[i] << G4endl ; 297 298 } 291 299 292 300 G4MaterialPropertiesTable *MPT_Acrylic = new G4MaterialPropertiesTable(); 293 MPT_Acrylic->AddProperty("RINDEX", X_RINDEX_ACRYLIC, RINDEX_ACRYLIC, N_RINDEX_ACRYLIC); 301 MPT_Acrylic->AddProperty("RINDEX", ENERGY_ACRYLIC, RINDEX_ACRYLIC, NENTRIES); 302 303 304 // Absorption 305 const G4int NENT = 25 ; 306 G4double LAMBDAABS[NENT] = 307 { 308 100.0, 309 246.528671, 260.605103, 263.853516, 266.019104, 268.726105, 310 271.433136, 273.598724, 276.305725, 279.554138, 300.127380, 311 320.159241, 340.191101, 360.764343, 381.337585, 399.745239, 312 421.401276, 440.891724, 460.382172, 480.414001, 500.987274, 313 520.477722, 540.509583, 559.458618, 314 700.0 315 } ; 316 317 G4double ABS[NENT] = // Transmission (in %) of 3mm thick PMMA 318 { 319 0.0000000, 320 0.0000000, 5.295952, 9.657321, 19.937695, 29.283491, 321 39.252335, 48.598133, 58.255451, 65.109039, 79.439247, 322 85.669785, 89.719627, 91.277260, 91.588783, 91.900307, 323 91.588783, 91.277260, 91.277260, 91.588783, 91.588783, 324 91.900307, 91.900307, 91.588783, 325 91.5 326 } ; 327 328 329 MPT_Acrylic->AddProperty("ABSLENGTH", new G4MaterialPropertyVector()) ; 330 for(G4int i=0;i<NENT; i++){ 331 G4double energy = h_Planck*c_light/(LAMBDAABS[i]*nm) ; 332 G4double abslength ; 333 334 if (ABS[i] <= 0.0) { 335 abslength = 1.0/kInfinity ; 336 } 337 else { 338 abslength = -3.0*mm/(std::log(ABS[i]/100.0)) ; 339 } 340 341 MPT_Acrylic->AddEntry("ABSLENGTH", energy, abslength); 342 343 } 344 294 345 Acrylic->SetMaterialPropertiesTable(MPT_Acrylic); 295 346 296 347 297 348 ////////////////////////////////////////////////////////////////// … … 344 395 345 396 const G4int NUM = 2; 346 G4double XX[NUM] = { 0.1E-9*GeV, 10.0E-9*GeV };397 G4double XX[NUM] = {h_Planck*c_light/lambda_max, h_Planck*c_light/lambda_min} ; 347 398 G4double ICEREFLECTIVITY[NUM] = { 0.95, 0.95 }; 348 399 … … 403 454 404 455 const G4int NUM = 2; 405 G4double XX[NUM] = { 0.1E-9*GeV, 10.0E-9*GeV };456 G4double XX[NUM] = {h_Planck*c_light/lambda_max, h_Planck*c_light/lambda_min} ; 406 457 G4double ICEREFLECTIVITY[NUM] = { 0.95, 0.95 }; 407 458 … … 566 617 567 618 const G4int NUM = 2; 568 G4double XX[NUM] = { 2.030E-9*GeV, 4.144E-9*GeV };619 G4double XX[NUM] = {h_Planck*c_light/lambda_max, h_Planck*c_light/lambda_min} ; 569 620 G4double BLACKPAINTREFLECTIVITY[NUM] = { 0.05, 0.05 }; 570 621 //G4double WHITEPAINTREFLECTIVITY[NUM] = { 0.99, 0.99 }; -
trunk/examples/advanced/air_shower/src/UltraPhysicsList.cc
r807 r1230 164 164 #include "G4PhotoElectricEffect.hh" 165 165 166 #include "G4MultipleScattering.hh" 166 #include "G4eMultipleScattering.hh" 167 #include "G4MuMultipleScattering.hh" 168 #include "G4hMultipleScattering.hh" 167 169 168 170 #include "G4eIonisation.hh" … … 196 198 //electron 197 199 // Construct processes for electron 198 pmanager->AddProcess(new G4 MultipleScattering(),-1,1,1);200 pmanager->AddProcess(new G4eMultipleScattering(),-1,1,1); 199 201 pmanager->AddProcess(new G4eIonisation(),-1,2,2); 200 202 pmanager->AddProcess(new G4eBremsstrahlung(),-1,-1,3); … … 203 205 //positron 204 206 // Construct processes for positron 205 pmanager->AddProcess(new G4 MultipleScattering(),-1,1,1);207 pmanager->AddProcess(new G4eMultipleScattering(),-1,1,1); 206 208 pmanager->AddProcess(new G4eIonisation(),-1,2,2); 207 209 pmanager->AddProcess(new G4eBremsstrahlung(),-1,-1,3); … … 212 214 //muon 213 215 // Construct processes for muon 214 pmanager->AddProcess(new G4Mu ltipleScattering(),-1,1,1);216 pmanager->AddProcess(new G4MuMultipleScattering(),-1,1,1); 215 217 pmanager->AddProcess(new G4MuIonisation(),-1,2,2); 216 218 pmanager->AddProcess(new G4MuBremsstrahlung(),-1,-1,3); … … 221 223 (particle->GetParticleName() != "chargedgeantino")) { 222 224 // all others charged particles except geantino 223 pmanager->AddProcess(new G4 MultipleScattering(),-1,1,1);225 pmanager->AddProcess(new G4hMultipleScattering(),-1,1,1); 224 226 pmanager->AddProcess(new G4hIonisation(),-1,2,2); 225 227 } … … 240 242 // this Cerenkov Process 241 243 G4Cerenkov* theCerenkovProcess = new G4Cerenkov("Cerenkov"); 242 // this is Scintillation process243 G4Scintillation* theScintillationProcess = new G4Scintillation("Scintillation");244 244 // this absorption process inside optical media 245 245 G4OpAbsorption* theAbsorptionProcess = new G4OpAbsorption(); … … 251 251 // Chose level 0 (no verbose) 252 252 theCerenkovProcess -> SetVerboseLevel(0); 253 theScintillationProcess -> SetVerboseLevel(0);254 253 theAbsorptionProcess -> SetVerboseLevel(0); 255 254 theRayleighScatteringProcess -> SetVerboseLevel(0); … … 262 261 theCerenkovProcess->SetTrackSecondariesFirst(true); 263 262 264 theScintillationProcess->SetTrackSecondariesFirst(true);265 theScintillationProcess->SetScintillationYieldFactor(1.);266 theScintillationProcess->SetScintillationExcitationRatio(0.0);267 268 263 // Boundary model (UNIFIED OR GLISUR (OLD GEANT3)) For now only GEANT3 269 264 G4OpticalSurfaceModel themodel = unified; … … 277 272 278 273 if (theCerenkovProcess->IsApplicable(*particle)) { 279 //pmanager->AddProcess(theCerenkovProcess);280 //pmanager->SetProcessOrdering(theCerenkovProcess,idxPostStep);274 pmanager->AddProcess(theCerenkovProcess); 275 pmanager->SetProcessOrdering(theCerenkovProcess,idxPostStep); 281 276 } 282 277 283 if (theScintillationProcess->IsApplicable(*particle)) {284 pmanager->AddProcess(theScintillationProcess);285 pmanager->SetProcessOrderingToLast(theScintillationProcess, idxAtRest);286 pmanager->SetProcessOrderingToLast(theScintillationProcess, idxPostStep);287 }288 278 289 279 if (particleName == "opticalphoton") { -
trunk/examples/advanced/air_shower/src/UltraPrimaryGeneratorAction.cc
r807 r1230 43 43 // 44 44 #include "UltraPrimaryGeneratorAction.hh" 45 #include "UltraDetectorConstruction.hh" 45 46 47 #include "G4RunManager.hh" 46 48 #include "G4Event.hh" 47 49 #include "G4GeneralParticleSource.hh" … … 129 131 G4cout << particleGun->GetCurrentSource()->GetPosDist()->GetPosDisType() << G4endl ; 130 132 133 134 // Check if optical photon wavelength is within limits set for material optical properties tables. 135 136 137 138 131 139 } 132 140 particleGun->GeneratePrimaryVertex(anEvent); 141 142 if (particleGun->GetParticleDefinition()->GetParticleName() == "opticalphoton"){ 143 144 const UltraDetectorConstruction * detector = 145 dynamic_cast<const UltraDetectorConstruction *>((G4RunManager::GetRunManager())->GetUserDetectorConstruction()) ; 146 147 G4double lambda_min = detector->GetLambdaMin() ; 148 G4double lambda_max = detector->GetLambdaMax() ; 149 150 G4double energy = particleGun->GetParticleEnergy() ; 151 152 if (h_Planck*c_light/energy > lambda_max || h_Planck*c_light/energy < lambda_min){ 153 G4cerr << "Error ! Optical photon energy (" << energy/eV << " eV) out of limits set by material optical properties tables. \n" 154 << "Please check that photon wavelength is within the following interval: [" 155 << lambda_min/nm << "," 156 << lambda_max/nm << "] nm" 157 << ", i.e., [" 158 << h_Planck*c_light/lambda_max/eV << "," 159 << h_Planck*c_light/lambda_min/eV << "] eV" 160 << G4endl ; 161 162 G4Exception("") ; 163 } 164 } 165 133 166 } 134 167
Note: See TracChangeset
for help on using the changeset viewer.