Generation of beta spectrum with gammas in coincidence

Dear all,

We are trying to simulate a beta decay followed but the emission of gamma rays.

Concerning the beta energy spectrum, there is no problem, the energy deposited in the detector corresponds to a standard continuum Beta decay.
Concerning the emmission of 2 gammas in coincidence, there is no problem. One even see the summing effect.

However, when trying to emit the beta and the 2 gammas (all 3 in coincidence), the energy deposited by beta is well taken into account, but the 2 gammas are completely ignored for some reasons.

Here are the things I tried but failed:

  • Reduced the emission of beta vs 2gammas, to see if one could start seeing the gamma ray energies.
  • Reverted the emission of the beta and 2 gammas.
  • Used a different physics library, other than the standard : FTFP_BERT_EMY
    if (GLOB_source_type[i] == 11) {
       double rdenergy=0;
       if(GLOB_source_energy_bdc_b[i]>0){
           for(;;){
               rdenergy = gRandom->Uniform(0.0,GLOB_source_energy_bdc_b[i]);
               bool result = BetaFunction(0,GLOB_source_energy_bdc_b[i],rdenergy,1,49);
               if(true == result){
                   break;
               }
           }
       
           particleGun->SetParticleDefinition(particleTable->FindParticle(particleName="e-"));
           particleGun->SetParticleEnergy(rdenergy);
           G4ThreeVector rdpos = G4RandomDirection();
           particleGun->SetParticleMomentumDirection( rdpos );
           double br = gRandom->Uniform(0.0,100);
           
           if(br<=10){       // Branching of 10%
               particleGun->GeneratePrimaryVertex(anEvent);
           }
       }
       
       particleGun->SetParticleDefinition(particleTable->FindParticle(particleName="gamma"));
       particleGun->SetParticleEnergy(GLOB_source_energy_bdc_g1[i]*keV);
       particleGun->SetParticleMomentumDirection( rdpos1 );
       particleGun->GeneratePrimaryVertex(anEvent);
       particleGun->SetParticleEnergy(GLOB_source_energy_bdc_g2[i]*keV);
       G4ThreeVector rdpos2 = G4RandomDirection();
       particleGun->SetParticleMomentumDirection( rdpos2 );
       particleGun->GeneratePrimaryVertex(anEvent);
   } 

}

// ****************************************************************************
// ************************* Beta Decay Function *****************************
bool G4IDSPrimaryGeneratorAction::BetaFunction(int type, double Q, double Te, double MaxFactor, double Z)
{…}

Main file called g4ids.cc and the PhysicsList.cc
g4ids.cc (6.2 KB) PhysicsList.cc (12.6 KB)

Please could you help me to figure out where to apply modifications in order to be able to generate and record the energy of a beta-gamma-gamma coincidence.

Thank you in advance.