# Optical photon velocity

Hi,

I’m injecting relativistic muons (2 GeV) in water. Water has a n=1.33 index of refraction.

For simplification I turned off most processes
/process/inactivate Electromagnetic all
/process/activate Cerenkov

I can see the Cherenkov optical photons being produced and propagated with a velocity c. Shouldn’t it be c/1.33 ? See below.

Or am I missing something ?
Bernardo Tomé

• G4Track Information: Particle = opticalphoton, Track ID = 112, Parent ID = 1

Step# X(mm) Y(mm) Z(mm) KinE(MeV) dE(MeV) StepLeng TrackLeng NextVolume ProcName
0 0 0 1.7e+03 3.62e-06 0 0 0 WCD_10010 initStep

AlongStepDoIt (after all invocations):
++List of invoked processes

``````  1) CoupledTransportation

++G4Step Information
Step Length (mm)      : 2256.179710119461
Energy Deposit (MeV)  : 0
-----------------------------------------------------------------------
StepPoint Information               PreStep            PostStep
-----------------------------------------------------------------------
Position - x (mm)   :                    0   507.6507772455736
Position - y (mm)   :                    0   1395.593722444087
Position - z (mm)   :    1698.515744581532                   0
Global Time (ns)    :  0.03835567841198741   7.564161114516256
Local Time (ns)     :                    0   7.525805436104268
Proper Time (ns)    :                    0                   0
Momentum Direct - x :   0.2250045840624524  0.2250045840624524
Momentum Direct - y :   0.6185649645657849  0.6185649645657849
Momentum Direct - z :  -0.7528282153071921 -0.7528282153071921
Momentum - x (MeV/c): 8.137314257714439e-078.137314257714439e-07
Momentum - y (MeV/c): 2.237046647941492e-062.237046647941492e-06
Momentum - z (MeV/c): -2.722611095038221e-06-2.722611095038221e-06
Total Energy (MeV)  : 3.616510433163372e-063.616510433163372e-06
Kinetic Energy (MeV): 3.616510433163372e-063.616510433163372e-06
Velocity (mm/ns)    :           299.792458          299.792458
Volume Name         :            WCD_10010           WCD_10010
Safety (mm)         :                    0               5e-10
Polarization - x    :   0.2573464190273144  0.2573464190273144
Polarization - y    :   0.7074766019992675  0.7074766019992675
Polarization - Z    :   0.6582170449307644  0.6582170449307644``````

Hi,

I generated Cerenkov photons using extended example OpNovice2, the macro below, and Geant4 version 10.7, and find
fVelocity = 225.40786315789472
which is correct.

``````/control/verbose 2
/tracking/verbose 2
/run/verbose 1
/process/optical/verbose 0

/process/optical/processActivation Cerenkov      true
/process/optical/processActivation OpAbsorption  true
/process/optical/processActivation OpBoundary    true
/process/optical/processActivation Scintillation false
/process/optical/processActivation OpRayleigh    false
/process/optical/processActivation OpMieHG       false
/process/optical/processActivation OpWLS         false

/opnovice2/boxProperty RINDEX    0.000002 1.33    0.000008 1.33
/opnovice2/boxProperty ABSLENGTH 0.000002 1000000 0.000005 2000000 0.000008 3000000

/opnovice2/worldProperty RINDEX    0.000002 1.01    0.000008 1.01
/opnovice2/worldProperty ABSLENGTH 0.000002 1000000 0.000005 2000000 0.000008 3000000

/opnovice2/surfaceProperty TRANSMITTANCE 0.000002 0.0 0.000008 0.0
/opnovice2/surfaceProperty REFLECTIVITY  0.000002 1.0 0.000008 1.0
/opnovice2/surfaceProperty EFFICIENCY    0.000002 0.0 0.000008 0.0
/opnovice2/surfaceProperty RINDEX        0.000002 1.4 0.000008 1.5

/opnovice2/surfaceSigmaAlpha 0.2

/run/initialize
#
/gun/particle mu-
/gun/energy 2 GeV
/gun/position 0 0 0 cm
# will be normalized
/gun/direction .9 .44 0

/opnovice2/surfaceModel unified
/opnovice2/surfaceType dielectric_metal
/opnovice2/surfaceFinish polished
/run/beamOn 1
``````

Hi,
Many thanks for the feedback. I ran the OpNovice2 example with Geant4 version 10.5 and your macro and indeed found the correct velocity ! What’s puzzling in my code is how can the muons emit the Cherenkov photons at the correct angle (I checked that), meaning that the water refractive index is properly assigned, but these propagate at c ? Any hint ?

Thanks again,
Bernardo Tomé

Check to see that the material parameter GROUPVEL is present for the material. This should be automatically calculated when RINDEX is set.

You can call G4MaterialPropertiesTable::DumpTable().

In realtime, with gdb, get to the G4SteppingManager::Stepping frame, and print:

``````(gdb) p *((fStep->fpPostStepPoint->fpMaterial->fMaterialPropertiesTable)->GetProperty(9,false))

\$38 = {<G4PhysicsVector> = {_vptr.G4PhysicsVector = 0x7ffff52110e8 <vtable for G4PhysicsOrderedFreeVector+16>, type = T_G4PhysicsOrderedFreeVector, edgeMin = 1.9999999999999999e-06,
edgeMax = 7.9999999999999996e-06, invdBin = 0, baseBin = 0, verboseLevel = 0, numberOfNodes = 2, dataVector = std::vector of length 2, capacity 2 = {225.40786315789472, 225.40786315789472},
binVector = std::vector of length 2, capacity 2 = {1.9999999999999999e-06, 7.9999999999999996e-06}, secDerivative = std::vector of length 0, capacity 0, useSpline = false}, <No data fields>}
``````

Hi,

Indeed the GROUPVEL was not present. I found it had to do the way I was inserting the RINDEX values. I was doing this way,

for (int ie=0; ie<nEntries; ie++) {
}

which apparently does not work.

Now, if I do :

``````G4MaterialPropertyVector* mpv = new G4MaterialPropertyVector();
for (int ie=0; ie<nEntries; ++ie) {
mpv->InsertValues(e[ie], RINDEX);
}

``````

I can now see that the material has the GROUPVEL parameter present (and the speed of optical photons in water is indeed c/1.33 !).
So, I would guess that the GROUPVEL is computed when AddProperty is called. In the first case the MPV is still empty at that stage…

But isn’t the syntax

generally correct ? At least I was able to properly set the index of refraction …

Thanks !
Bernardo Tomé

Hi again,

Looking at the code (G4MaterialPropertiesTable.cc) I find that the parameter GROUPVEL is indeed computed when AddProperty is called :

void G4MaterialPropertiesTable::
{
// Provides a way of adding a property to the Material Properties
// Table given an G4MaterialPropertyVector Reference and a key
G4String k(key);
// if the key doesn’t exist, add it
if (std::find(G4MaterialPropertyName.begin(),
G4MaterialPropertyName.end(), k) ==
G4MaterialPropertyName.end()) {
G4MaterialPropertyName.push_back(k);
}
G4int index = GetPropertyIndex(k);
MP[ index ] = mpv;

// if key is RINDEX, we calculate GROUPVEL -
// contribution from Tao Lin (IHEP, the JUNO experiment)
if (k==“RINDEX”) {
CalculateGROUPVEL();
}
}

So, calling