Message: Re: ExampleGB01 question Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Idea Re: ExampleGB01 question 

Forum: Biasing and Scoring
Re: None ExampleGB01 question (Carlos Ayerbe Gayoso)
Re: None Re: ExampleGB01 question (Marc Verderi)
Re: None Re: ExampleGB01 question (Carlos Ayerbe Gayoso)
Date: 07 Jan, 2015
From: Tom Roberts <Tom Roberts>

There is a whole 'nother way to do this.

Start with a simulation of just the target in G4beamline. Use this command:

    newparticlentuple First require=ParentID>0 kill=1 format=ascii

This writes an NTuple file "First.txt" containing just the secondary particles from beam interactions, killing them after outputting (to not waste time).

Now write a filter program to read First.txt and write an NTuple to "Second.txt". In this program you impose whatever constraints and biases you wish. The ASCII NTuple format is documented in the G4beamline Users Guide.

Then use Second.txt as input to the second simulation in G4beamline (as you indicated you intend to do).

This has the advantage that except for reading and writing the ASCII files, the only code you write is to implement the specific constraints and biases you want -- you have to do that no matter how you implement it. You aren't even limited to C++, as any language can read and write the ASCII NTuple files.

The disadvantage is that you have no access to the geometry information, and will have slightly less performance (negligible for any non-trivial simulation).

Note that if you don't handle the value of Weight carefully, you will have difficulty unwinding the biasing later in the analysis.

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

1 None: Re: ExampleGB01 question   (Carlos Ayerbe Gayoso - 08 Jan, 2015)
 Add Message Add Message
to: "Re: ExampleGB01 question"

 Subscribe Subscribe

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