Track of optical photon

Dear G4users,

I am a beginner with G4 so maybe it will be a very simple task for you.
I’m trying to generate a very simple experiment like : an e- of like 800keV who target a scintillator (Polyvinyltoluene from the nist librarie).

I try to create (first), the most simple program without anything else. So I’ve my EventAction, my PlasticScintillatorConstruction, PrimaryGenerator & the ScintillatorActionInitialization.

I used some example from the optical example, but there is a lot of information inside and I maybe don’t keep some important.

Step by step (like that you maybe say where I am wrong): I add FTFP_Bert, G4EmStandartPhysics_option4, G4OpticalParameters & G4OpticalPhysics and I do like:

G4VModularPhysicsList* physicsList = new FTFP_BERT;
// Modification of physic list
physicsList->ReplacePhysics(new G4EmStandardPhysics_option4()); (I do this line, but never really understand why??)
G4OpticalPhysics* opticalPhysics = new G4OpticalPhysics();
auto opticalParams = G4OpticalParameters::Instance();

// Add optical propriety
// Set a profil of time, other choice like exponential
opticalParams->SetScintYieldFactor(1.0);
opticalParams->SetScintExcitationRatio(0.0);
opticalParams->SetScintTrackSecondariesFirst(false);
opticalParams->SetScintEnhancedTimeConstants(true);
// Set poursuit of track
opticalParams->SetCerenkovMaxPhotonsPerStep(100);
opticalParams->SetCerenkovMaxBetaChange(10.0);
opticalParams->SetCerenkovTrackSecondariesFirst(false);
// Add preferencies to physicsList
physicsList->RegisterPhysics(opticalPhysics);

After that, initialization of my detector. I have like motherWorld with He3 and Scintillator with my materials. For example for my scintillator

std::vector scPlastic_energyPh = { 3.046eV, 3.024eV, 2.966eV, 2.95eV, 2.917eV, 2.831eV, 2.774eV, 2.6724eV, 2.5995*eV };
std::vector scPlastic_amplScint = { 0.2, 0.4, 0.6, 0.8, 1.0, 0.8, 0.6, 0.4, 0.2 };
std::vector scPlastic_refrIndex = { 1.58, 1.58, 1.58, 1.58, 1.58, 1.58, 1.58, 1.58, 1.58 };
std::vector scPlastic_absLong = { 380.*cm, 380.*cm, 380.*cm, 380.*cm, 380.*cm, 380.*cm, 380.*cm, 380.*cm, 380.*cm };

scPlastic_mt = new G4MaterialPropertiesTable();
scPlastic_mt->AddProperty(“SCINTILLATIONCOMPONENT1”,scPlastic_energyPh,scPlastic_amplScint);
scPlastic_mt->AddProperty(“RINDEX”,scPlastic_energyPh,scPlastic_amplScint);
scPlastic_mt->AddProperty(“ABSLENGTH”,scPlastic_energyPh,scPlastic_absLong);
scPlastic_mt->AddConstProperty(“SCINTILLATIONYIELD”,10000./MeV);
scPlastic_mt->AddConstProperty(“RESOLUTIONSCALE”,0.68); //Light OutPut???
scPlastic_mt->AddConstProperty(“SCINTILLATIONTIMECONSTANT1”,0.9ns);
scPlastic_mt->AddConstProperty(“SCINTILLATIONTIMECONSTANT2”,2.1
ns);
scPlastic_mt->AddConstProperty(“SCINTILLATIONYIELD1”,0.68);
scPlastic->SetMaterialPropertiesTable(scPlastic_mt);
scPlastic->GetIonisation()->SetBirksConstant(0.3255*mm/MeV); //BirksConstant based on Cst & density of material

I add the same for the Helium.
Now my problem: it is like if G4 stop after the first optical photon. Like I see my e-, the contact with the scintillator and 4 optical photons. And then stop.

-------- EEEE ------- G4Exception-START -------- EEEE -------
*** G4Exception : TRACK003
issued by : G4ParticleChange::CheckIt()
momentum, energy, and/or time was illegal
*** Event Must Be Aborted ***
G4WT0 > G4Track (0x7f65b8514aa0) - track ID = 618, parent ID = 1
G4WT0 > Particle type : opticalphoton - creator process : Scintillation, creator model : Undefined
G4WT0 > Kinetic energy : 2.95842 eV - Momentum direction : (0.233331,0.148944,0.960923)
G4WT0 > Step length : 20.8079 cm - total energy deposit : 0 eV
G4WT0 > Pre-step point : (0.0273436,0.0244202,0.052626) - Physical volume : scintillateur_ph (scPlastic)
G4WT0 > - defined by : not available
G4WT0 > Post-step point : (48.5785,31.0165,200) - Physical volume : scintillateur_ph (scPlastic)
G4WT0 > - defined by : Transportation - step status : 1
G4WT0 > *** Note: Step information might not be properly updated.
G4WT0 >
-------- EEEE -------- G4Exception-END --------- EEEE -------

In another try, I add for example the property of H3:

mHe = nistManager->FindOrBuildMaterial(“G4_He”);
std::vector mHe_reflectivity = { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 };
std::vector mHe_efficiency = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
G4MaterialPropertiesTable* mHe_MT = new G4MaterialPropertiesTable();
mHe_MT->AddProperty(“REFLECTIVITY”, scPlastic_energyPh, mHe_reflectivity);

The border optical property between SCINT//H3

// Border optical property Scint//H3
G4OpticalSurface* scPlastic_border = new G4OpticalSurface(“Surface Optical Scintillator”);
scPlastic_border->SetType(dielectric_dielectric);
scPlastic_border->SetFinish(polished);
scPlastic_border->SetModel(glisur);
new G4LogicalBorderSurface(“Surface Optical Scintillator”, scPlastic_phys, mHall_phys, scPlastic_border);

But there is always this kind of :

-------- EEEE ------- G4Exception-START -------- EEEE -------
*** G4Exception : TRACK003
issued by : G4ParticleChange::CheckIt()
momentum, energy, and/or time was illegal
*** Event Must Be Aborted ***
G4WT1 > G4Track (0x7f31805aa690) - track ID = 3, parent ID = 1
G4WT1 > Particle type : opticalphoton - creator process : Scintillation, creator model : Undefined
G4WT1 > Kinetic energy : 3.0058 eV - Momentum direction : (0.293487,0.824305,0.484134)
G4WT1 > Step length : 2.06492 cm - total energy deposit : 0 eV
G4WT1 > Pre-step point : (3.10661e-05,-1.12049e-05,1.00299) - Physical volume : scintillateur_ph (scPlastic)
G4WT1 > - defined by : not available
G4WT1 > Post-step point : (6.06031,17.0213,11) - Physical volume : scintillateur_ph (scPlastic)
G4WT1 > - defined by : Transportation - step status : 1
G4WT1 > *** Note: Step information might not be properly updated.
G4WT1 >
-------- EEEE -------- G4Exception-END --------- EEEE -------

Always the same kind of error, TRACK003, and like a weir Post-step point … //
If someone knows something or a better method to do? Or maybe if you have some way to try to solve this problem.

Thanks you!!
Nsasap.

The error message looks like it comes from an overlap of two different volumes. Are you sure you don’t have any? Run

/geometry/test/run

to have Geant4 check.

If you’re sure there are no overlaps, try running with a debugger and get the backtrace when the crash occurs.

This doesn’t look like it has anything to do with optical photons.

Hello,
Thanks for your comment!
I try your macro and there are no overlaps here. I am currently trying to debug to obtain more informations.

Hello, I come back with some precision (and problem):

  • I activate all of the optical process, I can see the optical photon. But there are only produces by Cerenkov. If I disable Cerenkov → I can just see my e- pass through my scintillator. One good thing: Optical photon are created and I can “track” them with my SteppingAction.hh.

  • There is no scintillation … But, by increasing the verbose and modify some part of my program, I have :

Particle type - e-
G4WT1 > mass: 0.000510999[GeV]
G4WT1 > charge: -1[e]
G4WT1 > Direction x: -0.00243825, y: 0.000202843, z: 0.999997
G4WT1 > Total Momentum = 0.000963812[GeV]
G4WT1 > Momentum: -2.35001e-06[GeV], y: 1.95503e-07[GeV], z: 0.000963809[GeV]
G4WT1 > Total Energy = 0.0010909[GeV]
G4WT1 > Kinetic Energy = 0.000579897[GeV]
G4WT1 > MagneticMoment [MeV/T]: -5.79509e-11
G4WT1 > ProperTime = 0.0090197[ns]
G4WT1 > in Material scPlastic
G4WT1 > InteractionLength= 1.79769e+307[cm]
G4WT1 > G4VRestDiscreteProcess::PostStepGetPhysicalInteractionLength() - [ Scintillation]

Easy to say that the interaction length ^+307 cm is the problem. I use the exact property of the OpNovice2 model with the BG0 scintillator. It works well in the Op but no interaction in mine… Outside the scintillator there is Helium3 and I have the same value for the interaction length. But, the process select by G4 is rightly Scintillation.

  • Another question → Impossible to /control/execute/scint_by_particle.mac in the OpNovice2 example, I can only run with the ./OpNovice2 scint_by_particle.mac at the beginning. When I try just to ./OpNovice2 and execute the different macro of scint_by_particle, i have an error at processActivation Cerenkov. Everyone have this one? I though that it is because the Optical Physics need to be instantiate with the ./OpNovice2 directly. I see that a lot of people prefer to do Optical Physics with macro and no visualisation, maybe because of that?

Thank you in advance!
nsapsap

Easy to say that the interaction length ^+307 cm is the problem

No: scintillation doesn’t limit the step, so it always proposes an interaction length of DBL_MAX. If you don’t see scintillation photons in your application, something is mis-configured.

When I try just to ./OpNovice2 and execute the different macro of scint_by_particle, i have an error at processActivation Cerenkov.

Without a macro on the command line, vis.mac gets run. This macro calls /run/initialize. But there are commands in scint_by_particle.mac that must go before /run/initialize. So, to run with visualization, move these commands to vis.mac, before /run/initialize.

Hello,
My problems were resolved by putting all the Optical Process Activation inside the macro before the /Run/Initialize.
So perfect!
Thank you.