Message: Re: polishedbackpainted calculation order Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: polishedbackpainted calculation order 

Forum: Processes Involving Optical Photons
Re: None polishedbackpainted calculation order (Robert Penny)
Re: Feedback Re: polishedbackpainted calculation order (Gumplinger Peter)
Date: 29 Jun, 2010
From: Robert Penny <Robert Penny>

Hi Peter,

Thanks for your previous response. I've tried implementing your suggestions but still don't get the expected result. I'm wondering if there's a problem in G4OpBoundaryProcess.cc. Down below I point out a fix in there that works for me.

I'm trying to simulate a reflecting surface with air gap on the back of a scintillator with an index of 1.8. I've set the index of the surface to 1.0. For simplicity, at the moment, I'm assuming smooth surfaces on both the interface and the backing.

I am setting

  ScintillatorOpticalSurface->SetType(dielectric_dielectric);
  ScintillatorOpticalSurface->SetModel(unified);
  ScintillatorOpticalSurface->SetFinish(polishedbackpainted);

... adding a material properties table with:

  RINDEX ->1

  SPECULARSPIKECONSTANT -> 1
  SPECULARLOBCONSTANT   -> 0
  BACKSCATTERCONSTANT   -> 0

... and to test things out, I'm setting

  REFLECTIVITY -> 0

My assumption is that this REFLECTIVITY parameter is referring to the backing material, and not overriding the dielectric_dielectric reflection rules of the scintillator-air interface... at least not with a backpainted surface. With this setup I expect to get reflection only from the scintillator-air interface and nothing from the backpaint material.

If I launch a photon at a grazing angle on to the surface from within the scintillator I should get total internal reflection. The reflectivity of the back paint shouldn't enter into the problem. However, if I set the reflectivity of the surface to zero, I get no reflections, even from grazing incidence photons.

I'm now running geant4.9.3.p01. When you get a chance, could you look at this little snippet of code in G4OpBoundaryProcess.cc in the G4OpBoundaryProcess::PostStepDoIt section starting at line 422.

**************************************************************

	else if (type == dielectric_dielectric) {

	  if ( theFinish == polishedfrontpainted ||
	       theFinish == groundfrontpainted ) {
	          if( !G4BooleanRand(theReflectivity) ) {
		    DoAbsorption();
		  }
	          else {
		    if ( theFinish == groundfrontpainted )
					theStatus = LambertianReflection;
		    DoReflection();
		  }
	  }
	  else {
                  if( !G4BooleanRand(theReflectivity) ) {
                    DoAbsorption();
                  }
                  else {
                    DielectricDielectric();
                  }
	  }
	}

**************************************************************

I'm using a polishedbackpainted finish, so I believe the "else" branch is being invoked. However, if the backpainted surface reflectivity is set to zero, the G4BooleanRand will always invoke the DoAbsorption and nothing will come back off. There's no chance for total internal reflection (or any other form of dielectric reflection) to be calculated.

Doesn't it make sense for DielectricDielectric() to have its first shot at calculating reflection if the surface is one of the two backpainted classes?

The following hack gives me the behavior I want:

**************************************************************

	  if ( theFinish == polishedfrontpainted ||
	       theFinish == groundfrontpainted ) {
	          if( !G4BooleanRand(theReflectivity) ) {
		    DoAbsorption();
		  }
	          else {
		    if ( theFinish == groundfrontpainted )
					theStatus = LambertianReflection;
		    DoReflection();
		  }
	  }
	  else {

#define RDP_PATCH_BACK_PAINT_CALCULATION 1

#ifdef RDP_PATCH_BACK_PAINT_CALCULATION
		DielectricDielectric();
#else
                  if( !G4BooleanRand(theReflectivity) ) {
                    DoAbsorption();
                  }
                  else {
                    DielectricDielectric();
                  }
#endif
	  }

**************************************************************

At shallow angles for photons launched within the high index material, I get total internal reflection. For photons launched normal to the surface I only get the very occasional photon coming back. Both of these are exactly the behaviors I'd expect for a high index material with an air gap and a completely absorbing cladding.

It's a little hard for me to follow all of the branches within DielectricDielectric, but I'm assuming the code starting at line 978, is the correct branch for dealing with the photon when it has passed out through the dielectric surface and is impacting the paint (or cladding).

If I print out the reflectivity being used:

**************************************************************

	if (Inside && !Swap) {
          if( theFinish == polishedbackpainted ||
              theFinish == groundbackpainted ) {

	      G4cout 
		  << "RDP Dielectric theFinish == polishedbackpainted or groundbackpainted"
		  << G4endl
		  << "theReflectivity = " << theReflectivity << G4endl;

	      if( !G4BooleanRand(theReflectivity) ) {
		DoAbsorption();
              }
	      else {
		if (theStatus != FresnelRefraction ) {
		   theGlobalNormal = -theGlobalNormal;
	        }
	        else {
		   Swap = !Swap;
		   G4SwapPtr(Material1,Material2);
		   G4SwapObj(&Rindex1,&Rindex2);
	        }
		if ( theFinish == groundbackpainted )
					theStatus = LambertianReflection;

	        DoReflection();

**************************************************************

... it is using the correct reflection coefficient that I've specified for the surface. This tells me that the intention is that the REFLECTIVITY parameter (at least for backpaint) IS referring to the backing material itself.

Could you give me a sanity check on this when you get a chance.

Many thanks,

-Rob.

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 None: Re: polishedbackpainted calculation order   (Robert Penny - 29 Jun, 2010)
(_ Warning: Re: polishedbackpainted calculation order   (Gumplinger Peter - 29 Jun, 2010)
 Add Message Add Message
to: "Re: polishedbackpainted calculation order"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews