Scintillation issue with the G4OpticalPhysics package

Dear Rooters,

I am quite puzzle about the scintillation process handling. I am re-using an old code that handled scintillator light generation in the old way (with G4OpticalPhysics::Configure in the main file). So I had to make a few adjustments to match the current version of geant4. It runs well and makes sense. However, I am unable to generate scintillation light. I check the amount of scintillated photons via (I know it’s not optimal but it should give the results) :

G4bool scintSD::ProcessHits(G4Step*aStep, G4TouchableHistory* /*ROhist*/)
{
...
    // Check for secondary photons
    auto secondaries = aStep->GetSecondary();
    for (auto const & secondary : *secondaries)
    {
      G4double secondaryEnergy = secondary->GetKineticEnergy();
      G4cout << secondary->GetParticleDefinition()->GetParticleName() << " with energy = " << G4BestUnit(secondaryEnergy, "Energy") << G4endl;
      if (secondary->GetParticleDefinition() == G4OpticalPhoton::OpticalPhotonDefinition()){
        G4cout << "Optical photon generated with energy: " << G4BestUnit(secondaryEnergy, "Energy") << G4endl;
      }
    }
}

And I get no optical photons. I get the secondary electrons all right though, so I suppose I should see the photons if they were produced right ?

So, now how I implemented it :

in main.cc :

  G4OpticalPhysics* opticalPhysics = new G4OpticalPhysics();
  physList -> RegisterPhysics(opticalPhysics);

in detectorConstructor.cc:

G4bool scintSD::ProcessHits(G4Step* aStep, G4TouchableHistory* /*ROhist*/)
{
  G4Material* CeBr3 = new G4Material("CeBr_3", 5.2*g/cm3, 2);
  CeBr3 -> AddElement(Ce, nAtoms=1);
  CeBr3 -> AddElement(Br, nAtoms=3);

  // Properties definition :
  G4double optScintSpectrum[optN] = {5./9., 4./9.};
  G4double optScintIndex[optN] = {1.9, 1.9};
  G4double optScintAbs[optN] = {500.*cm, 500.*cm};
  G4double optQuartzIndex[optN] = {1.47, 1.47};
  G4double optBorosilIndex[optN] = {1.55, 1.55};

  // Add properties
  CeBr3MPT->AddProperty("FASTCOMPONENT", optEmission, optScintSpectrum, optN, true);
  CeBr3MPT->AddProperty("RINDEX", optEmission, optScintIndex, optN, true);
  CeBr3MPT->AddProperty("ABSLENGTH", optEmission, optScintAbs, optN, true);
  
  // Add constant properties 
  CeBr3MPT->AddConstProperty("SCINTILLATIONYIELD", 60./keV, true); // or 45
  CeBr3MPT->AddConstProperty("YIELDRATIO", 1., true);
  CeBr3MPT->AddConstProperty("FASTTIMECONSTANT", 18.*ns, true);
  CeBr3MPT->AddConstProperty("RESOLUTIONSCALE", 1., true);
    
  // Set the material properties table for CeBr3
  CeBr3->SetMaterialPropertiesTable(CeBr3MPT);
}

So I just put the crucial parts that I think might cause the issue. Tell me if you have a hint of where it might come from !

Sincerely,

Corentin

Geant4 Version: 11.3.0
Operating System: Linux/Debian (WSL2)
Compiler/Version: g++ (Debian 12.2.0-14) 12.2.0
CMake Version: 3.25.1


I plugged your code into one of my optical sims to check, and your issue should be property names, as mentioned in Different results when using Geant4 version 11 for optical simulation material property names were changed between 10.7 and 11. Swap out FASTCOMPONENT for SCINTILLATIONCOMPONENT1, YIELDRATIO for SCINTILLATIONYIELD1, and FASTTIMECONSTANT for SCINTILLATIONTIMECONSTANT1 and you should be good to go.

Thank you so much it worked !!

However, SCINTILLATIONYIELD1 do not exist, SCINTILLATIONYIELD works instead.

So, for future reference, here is a link to the up-to-date manual :
https://geant4.web.cern.ch/documentation/pipelines/master/bfad_html/ForApplicationDevelopers/TrackingAndPhysics/physicsProcess.html#defining-optical-processes-g4opticalphysics-constructor

Finally, just a thought : it might be a good idea that the simulation raise at least an exception message, stating that the old constants are deprecated.

Both are needed. If there is only one component, and SCINTILLATIONYIELD1 is not specified, SCINTILLATIONYIELD1 defaults to 1.0.

It does. However you’ve set createNewKey=true in calling AddConstProperty. Some users want to define their own material property names. In your case, where you want to use the ones the Geant4 toolkit expects, remove that argument from all AddProperty and AddConstProperty.

Ohhh I see, I thought that just was necessary to make the code work.

Thank you very much for your precisions !

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.