Scintillation at GEANT4

Hello all. I am new to GEANT4. Can you help me with the scintillation process simulation? I am trying to add scintillation process to the existing code of a colleague to compare the cerenkov and scintillation photon yields and to distinguish them. The material properties are defined as follows:

G4MaterialPropertiesTable *PbF2MPT = new G4MaterialPropertiesTable();
  PbF2MPT->AddProperty("RINDEX", en_PbF2, ref_PbF2, n_PbF2);
  PbF2MPT->AddProperty("ABSLENGTH", en_PbF2, ab_PbF2, n_PbF2);
//  PbF2Material->SetMaterialPropertiesTable(PbF2MPT);
  PbF2MPT->AddProperty("SCINTILLATION",en_PbF2, ref_PbF2, n_PbF2, true);
  PbF2MPT->AddConstProperty("SCINTILLATIONYIELD", 1000./MeV);
  PbF2MPT->AddConstProperty("FASTTIMECONSTANT", 1.*ns, true);
  PbF2MPT->AddConstProperty("SLOWTIMECONSTANT", 1.*ns, true);
  PbF2Material->SetMaterialPropertiesTable(PbF2MPT);

And the processes are defined in another file:

  fCerenkovProcess = new G4Cerenkov("Cerenkov");
  fCerenkovProcess0 = new PrtCherenkovProcess("Cerenkov");
  fScintillationProcess = new G4Scintillation("Scintillation");
  fAbsorptionProcess = new G4OpAbsorption();
  fRayleighScatteringProcess = new G4OpRayleigh();
  fMieHGScatteringProcess = new G4OpMieHG();
  fBoundaryProcess = new PrtOpBoundaryProcess();

//    fCerenkovProcess->DumpPhysicsTable();
    fScintillationProcess->DumpPhysicsTable();
//    fRayleighScatteringProcess->DumpPhysicsTable();
//std::cout << "printed" << std::endl; getc(stdin);

  SetVerbose(0);

  fCerenkovProcess->SetMaxNumPhotonsPerStep(20);
  fCerenkovProcess->SetMaxBetaChangePerStep(10.0);
  fCerenkovProcess->SetTrackSecondariesFirst(true);

  fCerenkovProcess0->SetMaxNumPhotonsPerStep(20);
  fCerenkovProcess0->SetMaxBetaChangePerStep(10.0);
  fCerenkovProcess0->SetTrackSecondariesFirst(true);

//  fScintillationProcess->SetScintillationYieldFactor(1.0);
  fScintillationProcess->SetTrackSecondariesFirst(true);

  // Use Birks Correction in the Scintillation process

  G4EmSaturation *emSaturation = G4LossTableManager::Instance()->EmSaturation();
  fScintillationProcess->AddSaturation(emSaturation);
  std::cout << "number of scintillation photons = " << fScintillationProcess->GetNumPhotons() <<std::endl; //getc(stdin);
  auto particleIterator = GetParticleIterator();
  particleIterator->reset();
  while ((*particleIterator)()) {
    G4ParticleDefinition *particle = particleIterator->value();
    G4ProcessManager *pmanager = particle->GetProcessManager();
    G4String particleName = particle->GetParticleName();

    if (fCerenkovProcess->IsApplicable(*particle)) {
      if (fPhysList < 10) {
        pmanager->AddProcess(fCerenkovProcess);
        pmanager->SetProcessOrdering(fCerenkovProcess, idxPostStep);
      } else {
        pmanager->AddProcess(fCerenkovProcess0);
        pmanager->SetProcessOrdering(fCerenkovProcess0, idxPostStep);
      }
    }

    if (fScintillationProcess->IsApplicable(*particle)) {
       pmanager->AddProcess(fScintillationProcess);
       pmanager->SetProcessOrderingToLast(fScintillationProcess, idxAtRest);
       pmanager->SetProcessOrderingToLast(fScintillationProcess, idxPostStep);
//       std::cout << "scintillator process check!!!" << std::endl; getc(stdin);
    }
    if (particleName == "opticalphoton") {
      G4cout << " AddDiscreteProcess to OpticalPhoton " << G4endl;
      pmanager->AddDiscreteProcess(fAbsorptionProcess);
      pmanager->AddDiscreteProcess(fRayleighScatteringProcess);
      pmanager->AddDiscreteProcess(fMieHGScatteringProcess);
      pmanager->AddDiscreteProcess(fBoundaryProcess);
    }
  }

In the event display visualization I see the cerenkov photons. But if I switch off the cerenkov process, and try to see the scintillation, there are no photons.
I changed the material from the discussions in the forum, it was an working example:

G4Material *fLXe = new G4Material("LXe",z=54.,a=131.29*g/mole,density=3.020*g/cm3);
std::vector<G4double> lxe_Energy = {7.0*eV, 7.07*eV, 7.14*eV};
std::vector<G4double> lxe_SCINT = {0.1, 1.0, 0.1};
std::vector<G4double> lxe_RIND  = {1.59, 1.57, 1.54};
std::vector<G4double> lxe_ABSL  = {35.*cm, 35.*cm, 35.*cm};
G4MaterialPropertiesTable* fLXe_mt = new G4MaterialPropertiesTable();
fLXe_mt->AddProperty("SCINTILLATIONCOMPONENT1", lxe_Energy, lxe_SCINT);
fLXe_mt->AddProperty("SCINTILLATIONCOMPONENT2", lxe_Energy, lxe_SCINT);
fLXe_mt->AddProperty("RINDEX",        lxe_Energy, lxe_RIND);
fLXe_mt->AddProperty("ABSLENGTH",     lxe_Energy, lxe_ABSL);
fLXe_mt->AddConstProperty("SCINTILLATIONYIELD", 12000./MeV);
fLXe_mt->AddConstProperty("RESOLUTIONSCALE", 1.0);
fLXe_mt->AddConstProperty("SCINTILLATIONTIMECONSTANT1", 20.*ns);
fLXe_mt->AddConstProperty("SCINTILLATIONTIMECONSTANT2", 45.*ns);
fLXe_mt->AddConstProperty("SCINTILLATIONYIELD1", 1.0);
fLXe_mt->AddConstProperty("SCINTILLATIONYIELD2", 0.0);
fLXe->SetMaterialPropertiesTable(fLXe_mt);
fLXe->GetIonisation()->SetBirksConstant(0.126*mm/MeV);

I still don’t see scintillation photons. Could anyone help with this issue?

And, how can I get the step by step log of the simulation in Geant4, to see what particles at created, their properties (to debug the simulation)?
Thank you!

Geant4 Version: v11.1.3
Operating System: Linux Ubuntu
Compiler/Version: gcc 11.4.0
CMake Version: 3.22.1


Hi! A quick note on your question of being able to see the photons - for the optical photons produced to be visible in the world, each material (including air/vacuum or whatever is between your defined geometry elements) must have defined optical properties or photons won’t be able to propagate. Hope that helps :slight_smile: