[Halld-offline] vertex bug?
David Lawrence
davidl at jlab.org
Fri Jun 29 10:12:25 EDT 2012
Hi All,
I have just committed the fix discussed below to HDGeant in revision
9306. The default behavior for the particle gun has been reverted to a
single point at the target center (specified by the SCAP card in
control.in).
I have also added a new card called TGTWIDTH that allows you to
specify the R and Z size of a cylindrical volume from which to generate
particles. An appropriate comment has been added to the default
control.in file stored with the HDGeant source code. The comment is
copied below. To get back the behavior where the particle gun randomly
picks a z location along our 30cm target, simply uncomment the TGTWIDTH
line as it is.
c The TGTWIDTH card is used to determine an extended volume from
c which the particle gun will generate vertexes. The vertex position
c is sampled evenly from a cylindrical volume whose radius is given
c by the first parameter and whose full z-extent is given by the second.
c The volume is centered on the coordinates specified by SCAP above.
c If the card is not specified, then both the r and z extent default
c to zero meaning the vertex is always located at the point specified
c by SCAP. Note that this only affects the particle gun. Events read
c from a file contain their own vertex information.
c
c vertex_extent_r vertext_extent_z
c TGTWIDTH 0.0 30.0
Let me know if you have any issues.
Regards,
-David
On 6/29/12 8:37 AM, David Lawrence wrote:
>
> Hi Matt,
>
> I see the first event is at 80cm, but subsequent ones are at other
> values. However, when I look at the code, there is a problem. It looks
> like the RNDM array is not being filled prior to using it to determine
> z. The array is filled later when determining the momentum and angle
> values. I can imagine this leading to 2 different behaviors:
>
> 1. If the same memory is used on subsequent calls, the z position will
> be correlated with the kinematics of the previous event, but will
> change event to event
>
> 2. If the array memory is reset to zero, a single value (in our case
> 80cm) will always be used.
>
>
> The behavior could be compiler dependent, hence the different behavior
> you are seeing. I'm probably getting behavior 1. which is why my first
> event is always at z=80cm, but others are dependent on the random
> number seed.
>
> I will add the card as you suggest, fix the initialization of the RNDM
> array, and add comments to the control.in file. I'll announce on the
> offline list when it is done.
>
> Regards,
> -David
>
> On 6/29/12 7:33 AM, Matthew Shepherd wrote:
>> David,
>>
>> This isn't quite the behavior I'm seeing. I'm seeing every vertex
>> generated at 80 cm.
>>
>> I can imagine cases where one would want both a distribution and only
>> at the center of target. An extra control card might be a good idea
>> with some default behavior that is outlined in the comments.
>>
>> Matt
>>
>>
>> On Jun 28, 2012, at 1:26 PM, David Lawrence wrote:
>>
>>> Hi All,
>>>
>>> It looks like this was put in along with some other changes to the
>>> vertex handling in March of this year (revision 8887). It evenly
>>> distributes the vertex z-position for the particle gun over a 30cm span
>>> centered on the SCAP z position. We could revert this or add another
>>> control card to turn on/off the distributed target behavior. Any
>>> preferences?
>>>
>>> Regards,
>>> -David
>>>
>>> On 6/28/12 12:42 PM, Puneet Khetarpal wrote:
>>>> Hi Matt,
>>>>
>>>> I see the same behavior in HDGeant for DMCThrown as well. The smearing
>>>> of the vertex is across all three dimensions. I'm not sure if this is
>>>> supposed to be a bug or a feature.
>>>>
>>>> Puneet
>>>>
>>>> http://about.me/puneetk
>>>>
>>>> "No word is true until it is eaten" - 36 Lessons of Vivec, Sermon 27
>>>>
>>>>
>>>> On Thu, Jun 28, 2012 at 12:38 PM, Matthew
>>>> Shepherd<mashephe at indiana.edu> wrote:
>>>>> Hi all,
>>>>>
>>>>> In working on the photon efficiency studies for the new PID design
>>>>> I noticed a bug (?) with the simulation. I'm using the particle
>>>>> gun with the SCAP card setting the z vertex to 65. However, the
>>>>> DMCThrown objects (viewed in hdview2) report a vertex of 80. The
>>>>> reconstruction, with Paul's change, uses 65 for the vertex. Does
>>>>> anyone else see this?
>>>>>
>>>>> BTW (off topic, but related to our discussion yesterday), another
>>>>> good reason for using the center of target for default photon
>>>>> reconstruction is that it removes the dependency of basic photon
>>>>> reconstruction on tracking. This is probably an order of
>>>>> magnitude or more speedup if one just wants to run photon
>>>>> reconstruction (without track-shower matching, of course).
>>>>>
>>>>> Matt
>>>>> _______________________________________________
>>>>> Halld-offline mailing list
>>>>> Halld-offline at jlab.org
>>>>> https://mailman.jlab.org/mailman/listinfo/halld-offline
>>>> _______________________________________________
>>>> Halld-offline mailing list
>>>> Halld-offline at jlab.org
>>>> https://mailman.jlab.org/mailman/listinfo/halld-offline
>>> _______________________________________________
>>> Halld-offline mailing list
>>> Halld-offline at jlab.org
>>> https://mailman.jlab.org/mailman/listinfo/halld-offline
More information about the Halld-offline
mailing list