Message: Re: How to obtain the number of photon reflections? | Not Logged In (login) |
|
|
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: |
|
|
Outline Depth: |
|
|
|
Add message: ![]() |
|
to: |
|