Ignore:
Timestamp:
Nov 25, 2009, 5:13:58 PM (15 years ago)
Author:
garnier
Message:

update CVS release candidate geant4.9.3.01

Location:
trunk/source/processes/optical
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/processes/optical/History

    r1055 r1196  
    1616     * Reverse chronological order (last date on top), please *
    1717     ----------------------------------------------------------
     18
     1919th Nov 2009 Peter Gumplinger (op-V09-02-06)
     20              change the code such that the LUT are now read in and kept
     21              by G4OpticalSurface and not G4OpBoundaryProcess, reordering
     22              of enumeration and set theStatus in DielectricLUT.
     23
     2411th Nov 2009 Peter Gumplinger (op-V09-02-05)
     25              add capability of simulating surface reflections
     26              with Look-Up-Tables (LUT) containing measured
     27              optical reflectance for a variety of surface
     28              treatments - Thanks to Martin Janecek and
     29              William Moses (Lawrence Berkeley National Lab.)
     30
     319th  Nov 2009 Peter Gumplinger (op-V09-02-04)
     32              G4OpBoundary: initialze theReflectivity and theEfficiency
     33              at the beginning of the PostStepDoIt; add method
     34              BoundaryProcessVerbose which will now print the process
     35              status for every call to PostStepDoIt.
     36
     375th  Nov 2009 Peter Gumplinger (op-V09-02-03)
     38              G4OpBoundary::PostStepDoIt - all dielectric_dielectric
     39              surfaces may now have a reflectivity <1; not only
     40              'frontpainted' as was the case in the past.
     41
     426th  May 2009 Peter Gumplinger (op-V09-02-02)
     43              G4OpBoundary::PostStepDoIt now throws an G4Exception
     44              EventMustBeAborted when an invalid surface normal is returnd;
     45              addresses bug report #1060
    1846
    194723th Mar 2009 Peter Gumplinger (op-V09-02-01)
  • trunk/source/processes/optical/include/G4OpAbsorption.hh

    r1007 r1196  
    2626//
    2727// $Id: G4OpAbsorption.hh,v 1.9 2006/06/29 21:08:36 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     28// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2929//
    3030////////////////////////////////////////////////////////////////////////
  • trunk/source/processes/optical/include/G4OpBoundaryProcess.hh

    r1055 r1196  
    2525//
    2626//
    27 // $Id: G4OpBoundaryProcess.hh,v 1.19 2009/03/23 21:18:20 gum Exp $
    28 // GEANT4 tag $Name: geant4-09-03-beta-cand-01 $
     27// $Id: G4OpBoundaryProcess.hh,v 1.22 2009/11/20 01:06:45 gum Exp $
     28// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2929//
    3030//
     
    4949//                           of refraction - Thanks to Sehwook Lee and John
    5050//                           Hauptman (Dept. of Physics - Iowa State Univ.)
     51//              2009-11-10 - add capability of simulating surface reflections
     52//                           with Look-Up-Tables (LUT) containing measured
     53//                           optical reflectance for a variety of surface
     54//                           treatments - Thanks to Martin Janecek and
     55//                           William Moses (Lawrence Berkeley National Lab.)
    5156//
    5257// Author:      Peter Gumplinger
     
    96101                                  SpikeReflection, BackScattering,
    97102                                  Absorption, Detection, NotAtBoundary,
    98                                   SameMaterial, StepTooSmall, NoRINDEX };
     103                                  SameMaterial, StepTooSmall, NoRINDEX,
     104                                  PolishedLumirrorAirReflection,
     105                                  PolishedLumirrorGlueReflection,
     106                                  PolishedAirReflection,
     107                                  PolishedTeflonAirReflection,
     108                                  PolishedTiOAirReflection,
     109                                  PolishedTyvekAirReflection,
     110                                  PolishedVM2000AirReflection,
     111                                  PolishedVM2000GlueReflection,
     112                                  EtchedLumirrorAirReflection,
     113                                  EtchedLumirrorGlueReflection,
     114                                  EtchedAirReflection,
     115                                  EtchedTeflonAirReflection,
     116                                  EtchedTiOAirReflection,
     117                                  EtchedTyvekAirReflection,
     118                                  EtchedVM2000AirReflection,
     119                                  EtchedVM2000GlueReflection,
     120                                  GroundLumirrorAirReflection,
     121                                  GroundLumirrorGlueReflection,
     122                                  GroundAirReflection,
     123                                  GroundTeflonAirReflection,
     124                                  GroundTiOAirReflection,
     125                                  GroundTyvekAirReflection,
     126                                  GroundVM2000AirReflection,
     127                                  GroundVM2000GlueReflection };
    99128
    100129class G4OpBoundaryProcess : public G4VDiscreteProcess
     
    149178        // Returns the current status.
    150179
    151         G4double GetIncidentAngle();
    152         // Returns the incident angle of optical photon
    153 
    154         G4double GetReflectivity(G4double E1_perp,
    155                                  G4double E1_parl,
    156                                  G4double incidentangle,
    157                                  G4double RealRindex,
    158                                  G4double ImaginaryRindex);
    159         // Returns the Reflectivity on a metalic surface
    160 
    161         void CalculateReflectivity(void);
    162 
    163180        void SetModel(G4OpticalSurfaceModel model);
    164181        // Set the optical surface model to be followed
    165         // (glisur || unified).
     182        // (glisur || unified || LUT).
    166183
    167184private:
     
    174191        void DielectricMetal();
    175192        void DielectricDielectric();
     193        void DielectricLUT();
    176194
    177195        void ChooseReflection();
     
    179197        void DoReflection();
    180198
     199        G4double GetIncidentAngle();
     200        // Returns the incident angle of optical photon
     201
     202        G4double GetReflectivity(G4double E1_perp,
     203                                 G4double E1_parl,
     204                                 G4double incidentangle,
     205                                 G4double RealRindex,
     206                                 G4double ImaginaryRindex);
     207        // Returns the Reflectivity on a metalic surface
     208
     209        void CalculateReflectivity(void);
     210
     211        void BoundaryProcessVerbose(void) const;
     212
    181213private:
    182214
     
    219251
    220252        G4double kCarTolerance;
     253
    221254};
    222255
  • trunk/source/processes/optical/include/G4OpProcessSubType.hh

    r1007 r1196  
    2626//
    2727// $Id: G4OpProcessSubType.hh,v 1.3 2008/12/18 13:02:46 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     28// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2929//
    3030//---------------------------------------------------------------
  • trunk/source/processes/optical/include/G4OpRayleigh.hh

    r1007 r1196  
    2626//
    2727// $Id: G4OpRayleigh.hh,v 1.9 2006/06/29 21:08:40 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     28// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2929//
    3030//
  • trunk/source/processes/optical/include/G4OpWLS.hh

    r1007 r1196  
    2626//
    2727// $Id: G4OpWLS.hh,v 1.4 2006/06/29 21:08:42 gunter Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     28// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2929//
    3030////////////////////////////////////////////////////////////////////////
  • trunk/source/processes/optical/src/G4OpAbsorption.cc

    r1007 r1196  
    2626//
    2727// $Id: G4OpAbsorption.cc,v 1.9 2008/10/24 19:52:28 gum Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     28// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2929//
    3030////////////////////////////////////////////////////////////////////////
  • trunk/source/processes/optical/src/G4OpBoundaryProcess.cc

    r1055 r1196  
    5959//                           of refraction - Thanks to Sehwook Lee and John
    6060//                           Hauptman (Dept. of Physics - Iowa State Univ.)
     61//              2009-11-10 - add capability of simulating surface reflections
     62//                           with Look-Up-Tables (LUT) containing measured
     63//                           optical reflectance for a variety of surface
     64//                           treatments - Thanks to Martin Janecek and
     65//                           William Moses (Lawrence Berkeley National Lab.)
    6166//
    6267// Author:      Peter Gumplinger
     
    140145        G4StepPoint* pPostStepPoint = aStep.GetPostStepPoint();
    141146
     147        if ( verboseLevel > 0 ) {
     148           G4cout << " Photon at Boundary! " << G4endl;
     149           G4VPhysicalVolume* thePrePV = pPreStepPoint->GetPhysicalVolume();
     150           G4VPhysicalVolume* thePostPV = pPostStepPoint->GetPhysicalVolume();
     151           if (thePrePV)  G4cout << " thePrePV:  " << thePrePV->GetName()  << G4endl;
     152           if (thePostPV) G4cout << " thePostPV: " << thePostPV->GetName() << G4endl;
     153        }
     154
    142155        if (pPostStepPoint->GetStepStatus() != fGeomBoundary){
    143156                theStatus = NotAtBoundary;
     157                if ( verboseLevel > 0) BoundaryProcessVerbose();
    144158                return G4VDiscreteProcess::PostStepDoIt(aTrack, aStep);
    145159        }
    146160        if (aTrack.GetStepLength()<=kCarTolerance/2){
    147161                theStatus = StepTooSmall;
     162                if ( verboseLevel > 0) BoundaryProcessVerbose();
    148163                return G4VDiscreteProcess::PostStepDoIt(aTrack, aStep);
    149164        }
     
    157172        OldMomentum       = aParticle->GetMomentumDirection();
    158173        OldPolarization   = aParticle->GetPolarization();
     174
     175        if ( verboseLevel > 0 ) {
     176           G4cout << " Old Momentum Direction: " << OldMomentum     << G4endl;
     177           G4cout << " Old Polarization:       " << OldPolarization << G4endl;
     178        }
    159179
    160180        G4ThreeVector theGlobalPoint = pPostStepPoint->GetPosition();
     
    207227        else {
    208228                theStatus = NoRINDEX;
     229                if ( verboseLevel > 0) BoundaryProcessVerbose();
    209230                aParticleChange.ProposeTrackStatus(fStopAndKill);
    210231                return G4VDiscreteProcess::PostStepDoIt(aTrack, aStep);
     
    216237        else {
    217238                theStatus = NoRINDEX;
     239                if ( verboseLevel > 0) BoundaryProcessVerbose();
    218240                aParticleChange.ProposeTrackStatus(fStopAndKill);
    219241                return G4VDiscreteProcess::PostStepDoIt(aTrack, aStep);
    220242        }
     243
     244        theReflectivity = 1.;
     245        theEfficiency   = 0.;
    221246
    222247        theModel = glisur;
     
    281306                  else {
    282307                     theStatus = NoRINDEX;
     308                     if ( verboseLevel > 0) BoundaryProcessVerbose();
    283309                     aParticleChange.ProposeTrackStatus(fStopAndKill);
    284310                     return G4VDiscreteProcess::PostStepDoIt(aTrack, aStep);
     
    305331                 CalculateReflectivity();
    306332
    307               } else {
    308                  theReflectivity = 1.0;
    309333              }
    310334
     
    314338                      theEfficiency =
    315339                      PropertyPointer->GetProperty(thePhotonMomentum);
    316               } else {
    317                       theEfficiency = 0.0;
    318340              }
    319341
     
    359381              if (Material1 == Material2){
    360382                 theStatus = SameMaterial;
     383                 if ( verboseLevel > 0) BoundaryProcessVerbose();
    361384                 return G4VDiscreteProcess::PostStepDoIt(aTrack, aStep);
    362385              }
     
    370393              else {
    371394                 theStatus = NoRINDEX;
     395                 if ( verboseLevel > 0) BoundaryProcessVerbose();
    372396                 aParticleChange.ProposeTrackStatus(fStopAndKill);
    373397                 return G4VDiscreteProcess::PostStepDoIt(aTrack, aStep);
    374398              }
    375399           }
    376         }
    377 
    378         if ( verboseLevel > 0 ) {
    379                 G4cout << " Photon at Boundary! " << G4endl;
    380                 G4cout << " Old Momentum Direction: " << OldMomentum     << G4endl;
    381                 G4cout << " Old Polarization:       " << OldPolarization << G4endl;
    382400        }
    383401
     
    393411
    394412        }
     413        else if (type == dielectric_LUT) {
     414
     415          DielectricLUT();
     416
     417        }
    395418        else if (type == dielectric_dielectric) {
    396419
    397420          if ( theFinish == polishedfrontpainted ||
    398421               theFinish == groundfrontpainted ) {
    399 
    400422                  if( !G4BooleanRand(theReflectivity) ) {
    401423                    DoAbsorption();
     
    408430          }
    409431          else {
    410                   DielectricDielectric();
     432                  if( !G4BooleanRand(theReflectivity) ) {
     433                    DoAbsorption();
     434                  }
     435                  else {
     436                    DielectricDielectric();
     437                  }
    411438          }
    412439        }
     
    422449
    423450        if ( verboseLevel > 0) {
    424                 G4cout << " New Momentum Direction: " << NewMomentum     << G4endl;
    425                 G4cout << " New Polarization:       " << NewPolarization << G4endl;
    426                 if ( theStatus == Undefined )
    427                         G4cout << " *** Undefined *** " << G4endl;
    428                 if ( theStatus == FresnelRefraction )
    429                         G4cout << " *** FresnelRefraction *** " << G4endl;
    430                 if ( theStatus == FresnelReflection )
    431                         G4cout << " *** FresnelReflection *** " << G4endl;
    432                 if ( theStatus == TotalInternalReflection )
    433                         G4cout << " *** TotalInternalReflection *** " << G4endl;
    434                 if ( theStatus == LambertianReflection )
    435                         G4cout << " *** LambertianReflection *** " << G4endl;
    436                 if ( theStatus == LobeReflection )
    437                         G4cout << " *** LobeReflection *** " << G4endl;
    438                 if ( theStatus == SpikeReflection )
    439                         G4cout << " *** SpikeReflection *** " << G4endl;
    440                 if ( theStatus == BackScattering )
    441                         G4cout << " *** BackScattering *** " << G4endl;
    442                 if ( theStatus == Absorption )
    443                         G4cout << " *** Absorption *** " << G4endl;
    444                 if ( theStatus == Detection )
    445                         G4cout << " *** Detection *** " << G4endl;
    446                 if ( theStatus == NotAtBoundary )
    447                         G4cout << " *** NotAtBoundary *** " << G4endl;
    448                 if ( theStatus == SameMaterial )
    449                         G4cout << " *** SameMaterial *** " << G4endl;
    450                 if ( theStatus == StepTooSmall )
    451                         G4cout << " *** StepTooSmall *** " << G4endl;
    452                 if ( theStatus == NoRINDEX )
    453                         G4cout << " *** NoRINDEX *** " << G4endl;
     451           G4cout << " New Momentum Direction: " << NewMomentum     << G4endl;
     452           G4cout << " New Polarization:       " << NewPolarization << G4endl;
     453           BoundaryProcessVerbose();
    454454        }
    455455
     
    458458
    459459        return G4VDiscreteProcess::PostStepDoIt(aTrack, aStep);
     460}
     461
     462void G4OpBoundaryProcess::BoundaryProcessVerbose() const
     463{
     464        if ( theStatus == Undefined )
     465                G4cout << " *** Undefined *** " << G4endl;
     466        if ( theStatus == FresnelRefraction )
     467                G4cout << " *** FresnelRefraction *** " << G4endl;
     468        if ( theStatus == FresnelReflection )
     469                G4cout << " *** FresnelReflection *** " << G4endl;
     470        if ( theStatus == TotalInternalReflection )
     471                G4cout << " *** TotalInternalReflection *** " << G4endl;
     472        if ( theStatus == LambertianReflection )
     473                G4cout << " *** LambertianReflection *** " << G4endl;
     474        if ( theStatus == LobeReflection )
     475                G4cout << " *** LobeReflection *** " << G4endl;
     476        if ( theStatus == SpikeReflection )
     477                G4cout << " *** SpikeReflection *** " << G4endl;
     478        if ( theStatus == BackScattering )
     479                G4cout << " *** BackScattering *** " << G4endl;
     480        if ( theStatus == PolishedLumirrorAirReflection )
     481                G4cout << " *** PolishedLumirrorAirReflection *** " << G4endl;
     482        if ( theStatus == PolishedLumirrorGlueReflection )
     483                G4cout << " *** PolishedLumirrorGlueReflection *** " << G4endl;
     484        if ( theStatus == PolishedAirReflection )
     485                G4cout << " *** PolishedAirReflection *** " << G4endl;
     486        if ( theStatus == PolishedTeflonAirReflection )
     487                G4cout << " *** PolishedTeflonAirReflection *** " << G4endl;
     488        if ( theStatus == PolishedTiOAirReflection )
     489                G4cout << " *** PolishedTiOAirReflection *** " << G4endl;
     490        if ( theStatus == PolishedTyvekAirReflection )
     491                G4cout << " *** PolishedTyvekAirReflection *** " << G4endl;
     492        if ( theStatus == PolishedVM2000AirReflection )
     493                G4cout << " *** PolishedVM2000AirReflection *** " << G4endl;
     494        if ( theStatus == PolishedVM2000GlueReflection )
     495                G4cout << " *** PolishedVM2000GlueReflection *** " << G4endl;
     496        if ( theStatus == EtchedLumirrorAirReflection )
     497                G4cout << " *** EtchedLumirrorAirReflection *** " << G4endl;
     498        if ( theStatus == EtchedLumirrorGlueReflection )
     499                G4cout << " *** EtchedLumirrorGlueReflection *** " << G4endl;
     500        if ( theStatus == EtchedAirReflection )
     501                G4cout << " *** EtchedAirReflection *** " << G4endl;
     502        if ( theStatus == EtchedTeflonAirReflection )
     503                G4cout << " *** EtchedTeflonAirReflection *** " << G4endl;
     504        if ( theStatus == EtchedTiOAirReflection )
     505                G4cout << " *** EtchedTiOAirReflection *** " << G4endl;
     506        if ( theStatus == EtchedTyvekAirReflection )
     507                G4cout << " *** EtchedTyvekAirReflection *** " << G4endl;
     508        if ( theStatus == EtchedVM2000AirReflection )
     509                G4cout << " *** EtchedVM2000AirReflection *** " << G4endl;
     510        if ( theStatus == EtchedVM2000GlueReflection )
     511                G4cout << " *** EtchedVM2000GlueReflection *** " << G4endl;
     512        if ( theStatus == GroundLumirrorAirReflection )
     513                G4cout << " *** GroundLumirrorAirReflection *** " << G4endl;
     514        if ( theStatus == GroundLumirrorGlueReflection )
     515                G4cout << " *** GroundLumirrorGlueReflection *** " << G4endl;
     516        if ( theStatus == GroundAirReflection )
     517                G4cout << " *** GroundAirReflection *** " << G4endl;
     518        if ( theStatus == GroundTeflonAirReflection )
     519                G4cout << " *** GroundTeflonAirReflection *** " << G4endl;
     520        if ( theStatus == GroundTiOAirReflection )
     521                G4cout << " *** GroundTiOAirReflection *** " << G4endl;
     522        if ( theStatus == GroundTyvekAirReflection )
     523                G4cout << " *** GroundTyvekAirReflection *** " << G4endl;
     524        if ( theStatus == GroundVM2000AirReflection )
     525                G4cout << " *** GroundVM2000AirReflection *** " << G4endl;
     526        if ( theStatus == GroundVM2000GlueReflection )
     527                G4cout << " *** GroundVM2000GlueReflection *** " << G4endl;
     528        if ( theStatus == Absorption )
     529                G4cout << " *** Absorption *** " << G4endl;
     530        if ( theStatus == Detection )
     531                G4cout << " *** Detection *** " << G4endl;
     532        if ( theStatus == NotAtBoundary )
     533                G4cout << " *** NotAtBoundary *** " << G4endl;
     534        if ( theStatus == SameMaterial )
     535                G4cout << " *** SameMaterial *** " << G4endl;
     536        if ( theStatus == StepTooSmall )
     537                G4cout << " *** StepTooSmall *** " << G4endl;
     538        if ( theStatus == NoRINDEX )
     539                G4cout << " *** NoRINDEX *** " << G4endl;
    460540}
    461541
     
    466546        G4ThreeVector FacetNormal;
    467547
    468         if (theModel == unified) {
     548        if (theModel == unified || theModel == LUT) {
    469549
    470550        /* This function code alpha to a random value taken from the
     
    622702}
    623703
     704void G4OpBoundaryProcess::DielectricLUT()
     705{
     706        G4int thetaIndex, phiIndex;
     707        G4double AngularDistributionValue, thetaRad, phiRad, EdotN;
     708        G4ThreeVector PerpendicularVectorTheta, PerpendicularVectorPhi;
     709
     710        theStatus = G4OpBoundaryProcessStatus(G4int(theFinish) +
     711                           (G4int(NoRINDEX)-G4int(groundbackpainted)));
     712
     713        G4int thetaIndexMax = OpticalSurface->GetThetaIndexMax();
     714        G4int phiIndexMax   = OpticalSurface->GetPhiIndexMax();
     715
     716        do {
     717           if ( !G4BooleanRand(theReflectivity) ) // Not reflected, so Absorbed
     718              DoAbsorption();
     719           else {
     720              // Calculate Angle between Normal and Photon Momentum
     721              G4double anglePhotonToNormal =
     722                                          OldMomentum.angle(-theGlobalNormal);
     723              // Round it to closest integer
     724              G4int angleIncident = G4int(floor(180/pi*anglePhotonToNormal+0.5));
     725
     726              // Take random angles THETA and PHI,
     727              // and see if below Probability - if not - Redo
     728              do {
     729                 thetaIndex = CLHEP::RandFlat::shootInt(thetaIndexMax-1);
     730                 phiIndex = CLHEP::RandFlat::shootInt(phiIndexMax-1);
     731                 // Find probability with the new indeces from LUT
     732                 AngularDistributionValue = OpticalSurface ->
     733                   GetAngularDistributionValue(angleIncident,
     734                                               thetaIndex,
     735                                               phiIndex);
     736              } while ( !G4BooleanRand(AngularDistributionValue) );
     737
     738              thetaRad = (-90 + 4*thetaIndex)*pi/180;
     739              phiRad = (-90 + 5*phiIndex)*pi/180;
     740              // Rotate Photon Momentum in Theta, then in Phi
     741              NewMomentum = -OldMomentum;
     742              PerpendicularVectorTheta = NewMomentum.cross(theGlobalNormal);
     743              if (PerpendicularVectorTheta.mag() > kCarTolerance ) {
     744                 PerpendicularVectorPhi =
     745                                  PerpendicularVectorTheta.cross(NewMomentum);
     746              }
     747              else {
     748                 PerpendicularVectorTheta = NewMomentum.orthogonal();
     749                 PerpendicularVectorPhi =
     750                                  PerpendicularVectorTheta.cross(NewMomentum);
     751              }
     752              NewMomentum =
     753                 NewMomentum.rotate(anglePhotonToNormal-thetaRad,
     754                                    PerpendicularVectorTheta);
     755              NewMomentum = NewMomentum.rotate(-phiRad,PerpendicularVectorPhi);
     756              // Rotate Polarization too:
     757              theFacetNormal = (NewMomentum - OldMomentum).unit();
     758              EdotN = OldPolarization * theFacetNormal;
     759              NewPolarization = -OldPolarization + (2.*EdotN)*theFacetNormal;
     760           }
     761        } while (NewMomentum * theGlobalNormal <= 0.0);
     762}
     763
    624764void G4OpBoundaryProcess::DielectricDielectric()
    625765{
  • trunk/source/processes/optical/src/G4OpRayleigh.cc

    r1007 r1196  
    2626//
    2727// $Id: G4OpRayleigh.cc,v 1.17 2008/10/24 19:51:12 gum Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     28// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2929//
    3030//
  • trunk/source/processes/optical/src/G4OpWLS.cc

    r1007 r1196  
    2626//
    2727// $Id: G4OpWLS.cc,v 1.13 2008/10/24 19:50:50 gum Exp $
    28 // GEANT4 tag $Name: geant4-09-02 $
     28// GEANT4 tag $Name: geant4-09-03-cand-01 $
    2929//
    3030////////////////////////////////////////////////////////////////////////
Note: See TracChangeset for help on using the changeset viewer.