GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » PANDA » PandaRoot » Monte Carlo Engines » Group velocity for Cherenkov photon propagation in G3/G4
Group velocity for Cherenkov photon propagation in G3/G4 [message #11457] Wed, 26 January 2011 11:46 Go to next message
Jochen Schwiening is currently offline  Jochen Schwiening
Messages: 85
Registered: June 2009
Location: GSI, Darmstadt
continuous participant
From: *gsi.de
Hi folks,

I am looking at the time of propagation of Cherenkov photons
inside the DIRC radiator bars and see some slightly odd values.
This prompts the question how the velocity of the photon is
calculated in our framework. Does our VMC properly calculate
the group velocity of the Cherenkov photons from the material
index tables? Does that happen correctly in both G3 and G4?
Do any of you know and maybe know how to check the velocity
of the photon of a given wavelength, for instance in our
PndDrc.cxx code?

Thanks,
Jochen
Re: Group velocity for Cherenkov photon propagation in G3/G4 [message #11458 is a reply to message #11457] Wed, 26 January 2011 12:41 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: *vpn.unito.it
Hi,
as far as I know, for optically active materials you define in your media_pnd.geo the refraction index for each wavelenght (in the media file as photon momentum). Then G3 and G4 should use v = c/n. Just guessing, I think there is no group velocity but just the propagation of each single photon.

You could, inside your PndDrc::ProcessHits, store at entrance and at the exiting point the position and the time of the cherenkov photon, therefore easily calculate the velocity and compare it with the foreseen value.

Hope it helps somehow.
Re: Group velocity for Cherenkov photon propagation in G3/G4 [message #11459 is a reply to message #11457] Wed, 26 January 2011 14:12 Go to previous messageGo to next message
Jochen Schwiening is currently offline  Jochen Schwiening
Messages: 85
Registered: June 2009
Location: GSI, Darmstadt
continuous participant
From: *gsi.de
Hi Stefano,

thanks for the quick response.

I know from past work with (standard, non-Panda) Geant4 that
G4 does in fact use the wavelength-dependent photon group
velocity to calculate the propagation time. It uses the
formula n_group = n_phase - lambda*(dn_phase/dlambda).
It even comes out at the correct values, about 19.1cm/ns for
300nm photons, 20.3cm/ns for 600nm photons.
My quick and dirty check in our Panda simulation data finds
almost constant values of 19cm/ns +-0.1ns/cm for the entire
wavelength range from 300-650nm.

I don't think that I know how to find out in ProcessHits in
PndDrc.cxx how far the photon traveled since the path is
defined by the many internal reflections. We instead calculate
the path from the photon production angle and then calculate
the velocity from this path and the photon propagation time.
It's possible that this code has a bug and that's why I would
like to debug the (group) velocity of the photon in the medium
using something like the GetVelocity function but I don't see
that in our VMC environment.

Any other (simple) way to check the photon speed?

Thanks,
Jochen
Re: Group velocity for Cherenkov photon propagation in G3/G4 [message #11460 is a reply to message #11459] Wed, 26 January 2011 14:37 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: *vpn.unito.it
Hi,
if I remember well in geant4 of jan10 external packages there is a big in Cherenkov propagation. In this case it would be better to use geant3; I am not sure if the trunk version of the external packages has already this correction.

As a check, maybe you could do a check using a simplified geometry:
a) In the media definition you switch off somehow reflection, so that the photon exits from the quarz (if I remember well at the beginning Annalisa's photons were not reflected because reflection was off)
b) you shout the particle at 90° with respect to the rod, without any materials before and check only the exiting point.

In this case you avoid to have reflections making the calculation harder. Maybe you could use only a single quarz rod and enlarge it.

Just trying to guess...
Re: Group velocity for Cherenkov photon propagation in G3/G4 [message #11461 is a reply to message #11460] Wed, 26 January 2011 14:53 Go to previous messageGo to next message
Mohammad Al-Turany is currently offline  Mohammad Al-Turany
Messages: 518
Registered: April 2004
Location: GSI, Germany
first-grade participant
From: *gsi.de
Hallo Jochen,

in your ProcessHit you can use:

gMC->TrackLength() this will give you the track length from the vertex to the point where you are now (usually border of a step or material)

The VMC do not have any own methods, what ever you can do with native G4 you can do it through the VMC, the question which stay is this also available in G3? if yes then either it is already implemented or can be implemented. If Not one can still use it in G4 and give a warning or what ever in case of G3.


best regards

Mohammad
Re: Group velocity for Cherenkov photon propagation in G3/G4 [message #11462 is a reply to message #11459] Wed, 26 January 2011 17:41 Go to previous messageGo to next message
Jochen Schwiening is currently offline  Jochen Schwiening
Messages: 85
Registered: June 2009
Location: GSI, Darmstadt
continuous participant
From: *gsi.de
Hi Mohammad,

thanks for the suggestion.

I used TrackLength() and TrackTime() in PndDrc to calculate
the photon velocity in the bar at several times in the
Cherenkov photon's life. What I see is that the apparent
velocity does not behave as I expect. Here's an example for
two photons in Geant3 in the same event as they pass their
30ns mark:

time: 30.1524, path: 532.029, velocity: 17.6447, energy: 4.16593, wavelength: 296.971
time: 30.0086, path: 537.002, velocity: 17.8949, energy: 1.5531, wavelength: 796.575

This is probably because the TrackTime() of the photon includes
the time of flight of the primary particle. If I manually
calculate the time of flight of the primary particle and
subtract it I get velocity values around 19cm/ns, closer to
the expected values.

To illustrate the point I plotted (in excel, sorry) the observed
velocity vs wavelength for a few hundred photons in G3 and in
G4 as well as the expected group velocity. Please see the
attached figure.

Would you have a suggestion how I can access in PndDrc.cxx
the TOF of the particle and subtract it?
And is TrackLength() a "clean" quantity, which contains only
the path inside the bar? Or do I need to make a correction to
get the path that corresponds to the corrected TrackTime()
value I need to use?

Thanks,
Jochen

index.php?t=getfile&id=6296&private=0
Re: Group velocity for Cherenkov photon propagation in G3/G4 [message #11464 is a reply to message #11457] Wed, 26 January 2011 21:23 Go to previous messageGo to next message
Mohammad Al-Turany is currently offline  Mohammad Al-Turany
Messages: 518
Registered: April 2004
Location: GSI, Germany
first-grade participant
From: *dip.t-dialin.net
Hi Jochen,

Quote:

Would you have a suggestion how I can access in PndDrc.cxx
the TOF of the particle and subtract it?


if what you need is to the velocity inside the bar, then the easiest way is to register both track length and time when entering the bar. i.e:


if ( gMC->IsTrackEntering() ) {

fTime_in = gMC->TrackTime() * 1.0e09;
fLength_in = gMC->TrackLength();

}

and when exiting (or at certain position or time)

if ( gMC->IsTrackExiting() ) {

fTime_out = gMC->TrackTime() * 1.0e09;
fLength_out = gMC->TrackLength();

}

then you can subtract the time and length, would this solve the problem?


Quote:

And is TrackLength() a "clean" quantity, which contains only
the path inside the bar? Or do I need to make a correction to
get the path that corresponds to the corrected TrackTime()
value I need to use?



The track length is always from the vertex.

Hope this will help.

best regards

Mohammad
Re: Group velocity for Cherenkov photon propagation in G3/G4 [message #11465 is a reply to message #11462] Thu, 27 January 2011 11:33 Go to previous messageGo to next message
Jochen Schwiening is currently offline  Jochen Schwiening
Messages: 85
Registered: June 2009
Location: GSI, Darmstadt
continuous participant
From: *gsi.de
Hi Mohammad,

thanks for the suggestion.

I tried this on G3 and G4. The track entering and exiting are both
well-defined quantities for Cherenkov photons in Geant 3 where
the TrackLength and TrackTime are defined as I intuitively
expect: the clock (time and path) starts when the photon
is produced and stops when the photon exits the bar at the
backward end of the bar, which I selected as my stop point.
In Geant 4, however, the photons exit and re-enter on every
internal reflection, which means that a photon which propagates
inside the bar for 400cm only reports a TrackLength on the mm
level and a TrackTime on the picosecond scale, corresponding
to the last bounce before exiting the bar at the backward end.
Therefore, the calculated velocity is not based on the same
paths as the G3 numbers.

Having said that, the distribution of velocity vs. wavelength
looks somewhat different now but still strange, as you see
from the attached plot. I still don't see any reason why the
velocity for a given photon in Geant (3 or 4) is not a single
number but is spread out so much - unless the path or time
quantities are not the true/correct numbers.

Any ideas?

Thanks,
Jochen

index.php?t=getfile&id=6297&private=0
Re: Group velocity for Cherenkov photon propagation in G3/G4 [message #11474 is a reply to message #11465] Fri, 28 January 2011 19:04 Go to previous messageGo to next message
Oliver Merle is currently offline  Oliver Merle
Messages: 13
Registered: December 2010
occasional visitor
From: *wlan.uni-giessen.de
I checked the group velocity upstream in Geant4 and everything seems to be correct.

Method:
Create photons of different wavelength in a fused silica radiator (manually, not via the Cherenkov process). Export velocity of G4OpticalPhotons and a computed group velocity (using an approximation of n_g = n_p - lambda* dn/dlambda)

Result:
Attached


If a bug exists, it is most likely related to wrong material property maps.

Oliver
Re: Group velocity for Cherenkov photon propagation in G3/G4 [message #11475 is a reply to message #11457] Fri, 28 January 2011 19:14 Go to previous messageGo to next message
Jochen Schwiening is currently offline  Jochen Schwiening
Messages: 85
Registered: June 2009
Location: GSI, Darmstadt
continuous participant
From: *gsi.de
Hi Oliver,

thanks for the check.
Are you plotting the average velocity per wavelength bin or the
velocity for each photon? In the events that I looked at the
velocity is almost correct on average but there is a huge spread.
Would it be possible for you to plot the velocity per photon
vs. the photon wavelength from your sample, similar to the
scatter plots I have?
I checked the material properties table for FusedSil in the
current official media_pnd.geo and it looks OK. The binning
could be finer and I applied a table with the equivalent of
the 1nm binning you recommended. The spread of v_group for a
given wavelength remains the same, as you can see in the
attached plot for the finely binned FusedSil.

Cheers,
Jochen

index.php?t=getfile&id=6300&private=0
Re: Group velocity for Cherenkov photon propagation in G3/G4 [message #11476 is a reply to message #11475] Fri, 28 January 2011 19:39 Go to previous messageGo to next message
Oliver Merle is currently offline  Oliver Merle
Messages: 13
Registered: December 2010
occasional visitor
From: *wlan.uni-giessen.de
Jochen Schwiening wrote on Fri, 28 January 2011 19:14

Hi Oliver,

thanks for the check.
Are you plotting the average velocity per wavelength bin or the
velocity for each photon?


You know its friday evening? Wink

I've created exactly one photon for a given wavelength in a fused silica radiator. Geant4 assigns the group velocity to the photon at creation time. This value will only be changed if the material changes (in that case the LUT of the new material will be used to lookup the new value).

So what I did is checking the computation of the group velocity in Geant4 itself. And this value is correct.

I don't know what happens in the VMC Layer above Geant4. You should be able to query the velocity of the photon without measuring time and distance (looks weird to me). If you compute the velocity from time and distance, there might also be an error in the distance computation or the assigned timestamps.

I would also switch Geant4 to high verbosity mode (at least for transportation), where you can check the tracklength manually.

I'm sorry, but I can't help you with VMC related stuff - I've never used it.

Good luck,
Oliver

Re: Group velocity for Cherenkov photon propagation in G3/G4 [message #11477 is a reply to message #11457] Fri, 28 January 2011 21:33 Go to previous messageGo to next message
Jochen Schwiening is currently offline  Jochen Schwiening
Messages: 85
Registered: June 2009
Location: GSI, Darmstadt
continuous participant
From: *unitymediagroup.de
Hi Oliver,

I like your suggestion to check individual photons without
reflections and other potential complications, Stefano had
suggested it as well.
To do this I used a photon gun placed inside the fused silica
radiator bar, close to the forward end of the bar, and shot
the photon along the Z axis of the bar towards the readout end,
recording the production time and bar exit time as well as
the path.

I created 10 photons with a fixed wavelength and varied the
wavelength in 14 runs from 200nm to 700nm. I see that all
10 photons always have the exact same wavelength, path, time,
and velocity.
The attached plot shows that the calculated velocity in Geant 4
is pretty much right on top of the calculated group velocity.

Unfortunately I cannot use the photon gun in Geant 3 because
the photon gun does not work for us in Geant 3 (still the
floating point exception crash when we select a 50000050 photon
as primary particle) but at least for Geant 4 your test and my
check suggests that the observed scatter of photon velocities
is not due to a problem with the group velocity calculation
in Geant (4) but due to incorrectly assigned paths or times
from TrackLength() and/or TrackTime().

We still need to make sure that the photon velocity is correct
in Geant 3 since using Geant 4 to generate event samples is
prohibitively slow (more than a factor 10 per-event time). Any
ideas for that would be very welcome since generating our DIRC
reconstruction look-up tables in G4 and applying it to G3 tracks
without being able to cross-check G3 with G3 and G4 with G4 is
not great. (Plus, since Peter says that the velocity is wrong in
Geant 3, that only the phase velocity is used, it's important
that we verify and correct this mistake.)

Have a great weekend,

Jochen

index.php?t=getfile&id=6302&private=0
Re: Group velocity for Cherenkov photon propagation in G3/G4 [message #11657 is a reply to message #11457] Mon, 11 April 2011 15:25 Go to previous message
Jochen Schwiening is currently offline  Jochen Schwiening
Messages: 85
Registered: June 2009
Location: GSI, Darmstadt
continuous participant
From: *gsi.de
Dear all,

just a follow-up to the still unresolved question of group
velocity for optical photons in G3/G4 in pandaroot.
I found a bug in my code where I calculated the photon energy
(a Y was swapped for a Z due to German/Intl keyboard confusion)
which caused the large scatter observed in previous plots.
When the bug is removed the points all line up nicely on a line
as can be seen in the attached plot.
The very good news is that the Geant 4 points are now pretty
much right on top of my theory line (apart from a very small
remaining scatter, probably due to some very short photon path
segments caused by the photon exiting and re-entering the bar
during each internal reflection).
The not so good news is that the Geant 3 points are still far
away from theory and G4.

Any ideas?

Cheers,
Jochen

index.php?t=getfile&id=6383&private=0
Previous Topic: future of GEANT
Next Topic: [Solved]Problem with PndEvtGenDirect
Goto Forum:
  


Current Time: Tue Dec 10 00:47:07 CET 2024

Total time taken to generate the page: 0.00723 seconds