|Message: Re: Killing Photons||Not Logged In (login)|
Click on the Forum title, e.g. on the "Forums by Category" page, to read a sequence of postings to the Forum and its threads all in one page. If you are only interested in one thread or the thread following a specific posting, click the thread or the posting, which takes you to a smaller page, which contains only the part you are interested in and may be easier to navigate.
Messages are "chained" if there are only replies at the first level, i.e. 1/1.html, 1/1/1.html etc. In case of "chained" messages the message number is replaced by the icon and there is no indentation.
Inline: Display the subject line only or also the text of the posting(s); for the choice "All" the "Outline" choices are switched off.
|1||0||1||no text / full text of posting|
|2||1||All||text for level 1 only / text for All postings|
Outline: Choose the depth of the posting thread, successive toggle controls provide increasing detail.
|1||2||1||2 levels / 1 level (original posting)|
|2||3||2||3 levels / 2 levels|
|3||3||All||3 levels / all levels (all postings)|
> I've tried G4UserLimits and G4UserSpecialCuts in DetectorConstruction
> and PhysicsList, respectively, as an example I found seemed to describe.
> However, this compiles successfully and then can't run (I get errors
> telling me I need to construct electrons!), so if you suggest these
> methods please be very specific about what I need.
I can't find a reason why you'd need to define an electron simply because you are using G4UserLimits and G4UserSpecialCuts. You'll need an electron if you have this code in your PhysicsList:
// Use Birks Correction in the Scintillation process
G4EmSaturation* emSaturation = G4LossTableManager::Instance()->EmSaturation();
One way to get an electron would be to add:
at the top of your PhysicsList.
> I'd like to kill a photon like this (say, after a certain number of
> steps) so my program can move on and calculate the next photon
> trajectory. Any ideas on the simplest way to do this?
Well, the simplest way is G4UserLimits/G4UserSpecialCuts. Else, you can program in your SteppingAction class a private member bounceLimit which you initialize in the constructor. You also add counterBounce as a private member which you have to set to zero at each first step of a photon track. In UserSteppingAction:
if (bounceLimit > 0 && counterBounce >= bounceLimit) theTrack->SetTrackStatus(fStopAndKill);
(please see the examples/extended/optical/LXe/LXeSteppingAction.cc for how you obtain the G4OpBoundaryProcess status)
You can also even more simply code:
if(theTrack->GetTrackLength() > 10*m)theTrack->SetTrackStatus(fStopAndKill);
>I've also tried to set an absorption length in the fiber material, but
>when I do this the application ignores the boundary process/refractive
>indexes I've set and just shoots photons straight through my material.
I have no explanation for this!!! There is something very fishy with your code.
Best regards, Peter
|Inline Depth:||Outline Depth:||Add message:|