Message: Re: How to obtain the number of photon reflections? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Feedback Re: How to obtain the number of photon reflections? 

Keywords: optical photon reflections
Forum: Event and Track Management
Re: Question How to obtain the number of photon reflections? (Igor Machulin)
Date: 30 Jan, 2004
From: Gumplinger Peter <Gumplinger Peter>

The G4OpBoundaryProcess has a public method:

G4OpBoundaryProcess::GetStatus()

This method returns the momentary status:

enum G4OpBoundaryProcessStatus {  Undefined,
                                  FresnelRefraction, FresnelReflection,
                                  TotalInternalReflection,
                                  LambertianReflection, LobeReflection,
                                  SpikeReflection, BackScattering,
                                  Absorption, Detection };

The process does not keep a counter of how often a certain status is set for a track, or an event. You need to do the counting yourself in your user-stepping-action. I don't think there is an example anywhere how this is done. To the best of my knowledge, it seems to require lengthy code like this:

  G4Material* m1 =  theStep->GetPreStepPoint()->GetPhysicalVolume()->GetLogicalVolume()- >GetMaterial();
  G4Material* m2 =  theStep->GetPostStepPoint()->GetPhysicalVolume()->GetLogicalVolume()- >GetMaterial(); 

  if(m1!=m2){
    G4OpBoundaryProcessStatus status = Undefined;
    G4ProcessManager* pm =   theStep->GetTrack()->GetDefinition()->GetProcessManager();
    G4int nprocesses = pm->GetProcessListLength();
    G4ProcessVector* pv = pm->GetProcessList();
    for(G4int i=0;i<nprocesses;i++){
      if((*pv)[i]->GetProcessName()=="OpBoundary"){
        G4OpBoundaryProcess* boundary = (G4OpBoundaryProcess*)(*pv)[i];
        status=boundary->GetStatus();
        break;
      }
    }
  }

Anyone with a better solution? I don't know how to get a list of all DoIts which were invoked during a step. Anybody knows?

Peter

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

 Add Message Add Message
to: "Re: How to obtain the number of photon reflections?"

 Subscribe Subscribe

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


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]