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.1ns);
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.