Changeset 963 for trunk/source/processes/optical
- Timestamp:
- Apr 6, 2009, 12:34:39 PM (15 years ago)
- Location:
- trunk/source/processes/optical
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/optical/History
r819 r963 16 16 * Reverse chronological order (last date on top), please * 17 17 ---------------------------------------------------------- 18 19 14th Jan 2009 Peter Gumplinger (op-V09-02-00) 20 respond to bug report 1040 by fixing G4OpBoundaryProcess.cc 21 22 07th Nov 2008 Peter Gumplinger (op-V09-01-09) 23 use new global/HEPRandom's G4RandomTools.hh 24 25 24th Oct 2008 Peter Gumplinger (op-V09-01-08) 26 use local G4OpProcessSubType.hh 27 28 21st Oct 2008 Peter Gumplinger (op-V09-01-07) 29 add SetProcessSubType for G4OpAbsorption, G4OpBoundaryProcess, 30 G4OpRayleigh and G4OpWLS 31 32 18th Aug 2008 Peter Gumplinger (op-V09-01-06) 33 use signatures G4SwapPtr(T*& and G4SwapObj(T* 34 in G4OpBoundaryProcess - to work with global-V09-01-12 35 36 15th Aug 2008 Peter Gumplinger (op-V09-01-05) 37 replaced G4SwapPtr with G4SwapObj for Rindex 38 in G4OpBoundaryProcess - serious error since op-V09-01-00 39 (see also Problem Report 1020) 40 41 4th July 2008 Peter Gumplinger (op-V09-01-04) 42 In G4OpWLS now SetTouchableHandle(aTrack.GetTouchableHandle()) 43 for the secondaries in the DoIt. 44 In G4OpBoundaryProcess.cc initialize the pointer: 45 G4LogicalSurface* Surface = NULL; 46 47 27th June 2008 Peter Gumplinger (op-V09-01-03) 48 In G4OpBoundaryProcess changed unsafe cast 49 (G4OpticalSurface*) to dynamic_cast<G4OpticalSurface*> 50 following suggestion in bug-report #1014 51 52 6th June 2008 Peter Gumplinger (op-V09-01-02) 53 G4OpRayleigh, G4OpWLS = trivial name changes: 54 momentum->energy, momenta->energies 55 56 5th June 2008 Peter Gumplinger (op-V09-01-00) 57 G4OpBoundaryProcess: Removed G4Swap methods - replaced by 58 G4SwapPtr. Removed G4IsotropicRand method - replaced by 59 G4RandomDirection. Add commented code to change absorption 60 at a dielectric/metal boundary into transmission. 18 61 19 62 29th Oct 2007 Peter Gumplinger (op-V09-00-01) -
trunk/source/processes/optical/include/G4OpAbsorption.hh
r819 r963 26 26 // 27 27 // $Id: G4OpAbsorption.hh,v 1.9 2006/06/29 21:08:36 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 //////////////////////////////////////////////////////////////////////// -
trunk/source/processes/optical/include/G4OpBoundaryProcess.hh
r819 r963 25 25 // 26 26 // 27 // $Id: G4OpBoundaryProcess.hh,v 1.1 6 2007/10/15 21:16:24gum Exp $28 // GEANT4 tag $Name: $27 // $Id: G4OpBoundaryProcess.hh,v 1.18 2008/11/07 17:59:37 gum Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // … … 68 68 #include "geomdefs.hh" 69 69 #include "Randomize.hh" 70 71 #include "G4RandomTools.hh" 72 #include "G4RandomDirection.hh" 73 70 74 #include "G4Step.hh" 71 75 #include "G4VDiscreteProcess.hh" … … 162 166 private: 163 167 164 void G4Swap(G4double* a, G4double* b) const;165 166 void G4Swap(G4Material* a, G4Material* b) const;167 168 void G4VectorSwap(G4ThreeVector* vec1, G4ThreeVector* vec2) const;169 170 168 G4bool G4BooleanRand(const G4double prob) const; 171 172 G4ThreeVector G4IsotropicRand() const;173 174 G4ThreeVector G4LambertianRand(const G4ThreeVector& normal);175 176 G4ThreeVector G4PlaneVectorRand(const G4ThreeVector& normal) const;177 169 178 170 G4ThreeVector GetFacetNormal(const G4ThreeVector& Momentum, … … 229 221 230 222 inline 231 void G4OpBoundaryProcess::G4Swap(G4double* a, G4double* b) const232 {233 // swaps the contents of the objects pointed234 // to by 'a' and 'b'!235 236 G4double temp;237 238 temp = *a;239 *a = *b;240 *b = temp;241 }242 243 inline244 void G4OpBoundaryProcess::G4Swap(G4Material* a, G4Material* b) const245 {246 // ONLY swaps the pointers; i.e. what used to be pointed247 // to by 'a' is now pointed to by 'b' and vice versa!248 249 G4Material* temp = a;250 251 a = b;252 b = temp;253 }254 255 inline256 void G4OpBoundaryProcess::G4VectorSwap(G4ThreeVector* vec1,257 G4ThreeVector* vec2) const258 {259 // swaps the contents of the objects pointed260 // to by 'vec1' and 'vec2'!261 262 G4ThreeVector temp;263 264 temp = *vec1;265 *vec1 = *vec2;266 *vec2 = temp;267 }268 269 inline270 223 G4bool G4OpBoundaryProcess::G4BooleanRand(const G4double prob) const 271 224 { … … 273 226 274 227 return (G4UniformRand() < prob); 275 }276 277 inline278 G4ThreeVector G4OpBoundaryProcess::G4IsotropicRand() const279 {280 /* Returns a random isotropic unit vector. */281 282 G4ThreeVector vect;283 G4double len2;284 285 do {286 287 vect.setX(G4UniformRand() - 0.5);288 vect.setY(G4UniformRand() - 0.5);289 vect.setZ(G4UniformRand() - 0.5);290 291 len2 = vect.mag2();292 293 } while (len2 < 0.01 || len2 > 0.25);294 295 return vect.unit();296 }297 298 inline299 G4ThreeVector G4OpBoundaryProcess::300 G4LambertianRand(const G4ThreeVector& normal)301 {302 /* Returns a random lambertian unit vector. */303 304 G4ThreeVector vect;305 G4double ndotv;306 307 do {308 vect = G4IsotropicRand();309 310 ndotv = normal * vect;311 312 if (ndotv < 0.0) {313 vect = -vect;314 ndotv = -ndotv;315 }316 317 } while (!G4BooleanRand(ndotv));318 return vect;319 }320 321 inline322 G4ThreeVector G4OpBoundaryProcess::323 G4PlaneVectorRand(const G4ThreeVector& normal) const324 325 /* This function chooses a random vector within a plane given326 by the unit normal */327 {328 G4ThreeVector vec1 = normal.orthogonal();329 330 G4ThreeVector vec2 = vec1.cross(normal);331 332 G4double phi = twopi*G4UniformRand();333 G4double cosphi = std::cos(phi);334 G4double sinphi = std::sin(phi);335 336 return cosphi * vec1 + sinphi * vec2;337 228 } 338 229 -
trunk/source/processes/optical/include/G4OpRayleigh.hh
r819 r963 26 26 // 27 27 // $Id: G4OpRayleigh.hh,v 1.9 2006/06/29 21:08:40 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // -
trunk/source/processes/optical/include/G4OpWLS.hh
r819 r963 26 26 // 27 27 // $Id: G4OpWLS.hh,v 1.4 2006/06/29 21:08:42 gunter Exp $ 28 // GEANT4 tag $Name: $28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 //////////////////////////////////////////////////////////////////////// -
trunk/source/processes/optical/src/G4OpAbsorption.cc
r819 r963 25 25 // 26 26 // 27 // $Id: G4OpAbsorption.cc,v 1. 7 2006/06/29 21:08:50 gunterExp $28 // GEANT4 tag $Name: $27 // $Id: G4OpAbsorption.cc,v 1.9 2008/10/24 19:52:28 gum Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 //////////////////////////////////////////////////////////////////////// … … 52 52 53 53 #include "G4ios.hh" 54 #include "G4OpProcessSubType.hh" 55 54 56 #include "G4OpAbsorption.hh" 55 57 … … 76 78 G4cout << GetProcessName() << " is created " << G4endl; 77 79 } 80 81 SetProcessSubType(fOpAbsorption); 78 82 } 79 83 -
trunk/source/processes/optical/src/G4OpBoundaryProcess.cc
r819 r963 67 67 68 68 #include "G4ios.hh" 69 #include "G4OpProcessSubType.hh" 70 69 71 #include "G4OpBoundaryProcess.hh" 70 72 #include "G4GeometryTolerance.hh" … … 93 95 G4cout << GetProcessName() << " is created " << G4endl; 94 96 } 97 98 SetProcessSubType(fOpBoundary); 95 99 96 100 theStatus = Undefined; … … 220 224 OpticalSurface = NULL; 221 225 222 G4LogicalSurface* Surface = G4LogicalBorderSurface::GetSurface 223 (pPreStepPoint ->GetPhysicalVolume(), 224 pPostStepPoint->GetPhysicalVolume()); 226 G4LogicalSurface* Surface = NULL; 227 228 Surface = G4LogicalBorderSurface::GetSurface 229 (pPreStepPoint ->GetPhysicalVolume(), 230 pPostStepPoint->GetPhysicalVolume()); 225 231 226 232 if (Surface == NULL){ … … 249 255 } 250 256 251 // if (Surface) OpticalSurface = dynamic_cast <G4OpticalSurface*> (Surface->GetSurfaceProperty());252 if (Surface) OpticalSurface = (G4OpticalSurface*) Surface->GetSurfaceProperty();257 if (Surface) OpticalSurface = 258 dynamic_cast <G4OpticalSurface*> (Surface->GetSurfaceProperty()); 253 259 254 260 if (OpticalSurface) { … … 429 435 430 436 DielectricMetal(); 437 438 // Uncomment the following lines if you wish to have 439 // Transmission instead of Absorption 440 // if (theStatus == Absorption) { 441 // return G4VDiscreteProcess::PostStepDoIt(aTrack, aStep); 442 // } 431 443 432 444 } … … 579 591 if( !G4BooleanRand(theReflectivity) && n == 1 ) { 580 592 593 // Comment out DoAbsorption and uncomment theStatus = Absorption; 594 // if you wish to have Transmission instead of Absorption 595 581 596 DoAbsorption(); 597 // theStatus = Absorption; 582 598 break; 583 599 … … 657 673 Through = false; 658 674 theGlobalNormal = -theGlobalNormal; 659 G4Swap (Material1,Material2);660 G4Swap (&Rindex1,&Rindex2);675 G4SwapPtr(Material1,Material2); 676 G4SwapObj(&Rindex1,&Rindex2); 661 677 } 662 678 … … 864 880 else { 865 881 Swap = !Swap; 866 G4Swap (Material1,Material2);867 G4Swap (&Rindex1,&Rindex2);882 G4SwapPtr(Material1,Material2); 883 G4SwapObj(&Rindex1,&Rindex2); 868 884 } 869 885 if ( theFinish == groundbackpainted ) -
trunk/source/processes/optical/src/G4OpRayleigh.cc
r819 r963 25 25 // 26 26 // 27 // $Id: G4OpRayleigh.cc,v 1.1 4 2006/06/29 21:08:54 gunterExp $28 // GEANT4 tag $Name: $27 // $Id: G4OpRayleigh.cc,v 1.17 2008/10/24 19:51:12 gum Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 // … … 57 57 58 58 #include "G4ios.hh" 59 #include "G4OpProcessSubType.hh" 60 59 61 #include "G4OpRayleigh.hh" 60 62 … … 78 80 : G4VDiscreteProcess(processName, type) 79 81 { 82 SetProcessSubType(fOpRayleigh); 80 83 81 84 thePhysicsTable = 0; … … 248 251 const G4Material* aMaterial = aTrack.GetMaterial(); 249 252 250 G4double thePhoton Momentum = aParticle->GetTotalMomentum();253 G4double thePhotonEnergy = aParticle->GetTotalEnergy(); 251 254 252 255 G4double AttenuationLength = DBL_MAX; … … 258 261 AttenuationLength = 259 262 (*thePhysicsTable)(aMaterial->GetIndex())-> 260 GetValue(thePhoton Momentum, isOutRange);263 GetValue(thePhotonEnergy, isOutRange); 261 264 } 262 265 else { … … 270 273 if(AttenuationLengthVector){ 271 274 AttenuationLength = AttenuationLengthVector -> 272 GetProperty(thePhoton Momentum);275 GetProperty(thePhotonEnergy); 273 276 } 274 277 else{ … … 305 308 306 309 // Retrieve vectors for refraction index 307 // and photon momentumfrom the material properties table310 // and photon energy from the material properties table 308 311 309 312 G4MaterialPropertyVector* Rindex = aMPT->GetProperty("RINDEX"); … … 325 328 while (++(*Rindex)) { 326 329 327 e = (Rindex->GetPhoton Momentum());330 e = (Rindex->GetPhotonEnergy()); 328 331 329 332 refraction_index = Rindex->GetProperty(); … … 332 335 333 336 if (verboseLevel>0) { 334 G4cout << Rindex->GetPhoton Momentum() << " MeV\t";337 G4cout << Rindex->GetPhotonEnergy() << " MeV\t"; 335 338 G4cout << xlambda << " mm\t"; 336 339 } … … 347 350 } 348 351 RayleighScatteringLengths-> 349 InsertValues(Rindex->GetPhoton Momentum(), Dist);352 InsertValues(Rindex->GetPhotonEnergy(), Dist); 350 353 } 351 354 -
trunk/source/processes/optical/src/G4OpWLS.cc
r819 r963 25 25 // 26 26 // 27 // $Id: G4OpWLS.cc,v 1. 9 2007/10/30 03:53:36gum Exp $28 // GEANT4 tag $Name: $27 // $Id: G4OpWLS.cc,v 1.13 2008/10/24 19:50:50 gum Exp $ 28 // GEANT4 tag $Name: geant4-09-02-ref-02 $ 29 29 // 30 30 //////////////////////////////////////////////////////////////////////// … … 46 46 47 47 #include "G4ios.hh" 48 #include "G4OpProcessSubType.hh" 49 48 50 #include "G4OpWLS.hh" 49 51 #include "G4WLSTimeGeneratorProfileDelta.hh" … … 61 63 : G4VDiscreteProcess(processName, type) 62 64 { 65 SetProcessSubType(fOpWLS); 66 63 67 theIntegralTable = 0; 64 68 … … 161 165 for (G4int i = 0; i < NumPhotons; i++) { 162 166 163 // Determine photon momentum167 // Determine photon energy 164 168 165 169 G4double CIIvalue = G4UniformRand()*CIImax; 166 G4double sampled Momentum=170 G4double sampledEnergy = 167 171 WLSIntegral->GetEnergy(CIIvalue); 168 172 169 173 if (verboseLevel>1) { 170 G4cout << "sampled Momentum = " << sampledMomentum<< G4endl;174 G4cout << "sampledEnergy = " << sampledEnergy << G4endl; 171 175 G4cout << "CIIvalue = " << CIIvalue << G4endl; 172 176 } … … 217 221 photonPolarization.z()); 218 222 219 aWLSPhoton->SetKineticEnergy(sampled Momentum);223 aWLSPhoton->SetKineticEnergy(sampledEnergy); 220 224 221 225 // Generate new G4Track object: … … 230 234 G4Track* aSecondaryTrack = 231 235 new G4Track(aWLSPhoton,aSecondaryTime,aSecondaryPosition); 232 233 aSecondaryTrack->SetTouchableHandle((G4VTouchable*)0); 236 237 aSecondaryTrack->SetTouchableHandle(aTrack.GetTouchableHandle()); 238 // aSecondaryTrack->SetTouchableHandle((G4VTouchable*)0); 234 239 235 240 aSecondaryTrack->SetParentID(aTrack.GetTrackID()); … … 285 290 286 291 // Retrieve the first intensity point in vector 287 // of (photon momentum, intensity) pairs292 // of (photon energy, intensity) pairs 288 293 289 294 theWLSVector->ResetIterator(); … … 295 300 if (currentIN >= 0.0) { 296 301 297 // Create first (photon momentum)302 // Create first (photon energy) 298 303 299 304 G4double currentPM = theWLSVector-> 300 GetPhoton Momentum();305 GetPhotonEnergy(); 301 306 302 307 G4double currentCII = 0.0; … … 311 316 G4double prevIN = currentIN; 312 317 313 // loop over all (photon momentum, intensity)318 // loop over all (photon energy, intensity) 314 319 // pairs stored for this material 315 320 … … 317 322 { 318 323 currentPM = theWLSVector-> 319 GetPhoton Momentum();324 GetPhotonEnergy(); 320 325 321 326 currentIN=theWLSVector-> … … 355 360 const G4Material* aMaterial = aTrack.GetMaterial(); 356 361 357 G4double thePhoton Momentum = aParticle->GetTotalMomentum();362 G4double thePhotonEnergy = aParticle->GetTotalEnergy(); 358 363 359 364 G4MaterialPropertiesTable* aMaterialPropertyTable; … … 369 374 if ( AttenuationLengthVector ){ 370 375 AttenuationLength = AttenuationLengthVector-> 371 GetProperty (thePhoton Momentum);376 GetProperty (thePhotonEnergy); 372 377 } 373 378 else {
Note: See TracChangeset
for help on using the changeset viewer.