How to avoid gamma in the decay of 207Bi (Radioactive decay)

Hello,
I am using radioactive decay package to simulate 207Bi spectra. However, I am not interested in gamma. Is there way to stop or kill gamma at origin it self?

_Geant4 Version:_10.06.p03
_Operating System:_Ubuntu_20.04
Compiler/Version:
_CMake Version:_3.16.3


No. Why bother? What kind of spectrum are you looking at? Are you trying to see what a realistic detector will give as output? In that case, the gammas are essential, or the simulation won’t look like reality.

If you just want to measure one thing (the initial electron kinetic energy?), then write your data out to an N-tuple with identifiers to show which entries are from electrons, and which from gammas. Probably include the track and step numbers, too. Then you can do whatever filtering or data rejection you want to do at analysis time.

Thank you for your response.

I am currently utilizing a scintillator detector connected to photomultiplier tubes (PMTs) at both ends. I record the total energy deposition (Edep) within the scintillator and the total number of optical photons detected by the PMTs. This information is stored at the end of each event within the event action. My current focus is to see the electron spectra.

However, I am encountering some difficulty in understanding how to store track information for each event, as it is represented as an array. Below is the event action part.

EventAction::EventAction(RunAction*)
:G4UserEventAction(),printModulo(100000),ListMode(0),fileOut(0)//, EdepInCrystal(0.), nAbsPhotons(0.), absTime(0.)
{
fileOut=new TFile(“Data207Bi_030724.root”,“recreate”);
ListMode=new TTree(“Tree”,“Parameters”);
ListMode->Branch(“EdepScintillator”,& EdepInScinti,“EdepScintillator/D”);
//ListMode->Branch(“PName”,&PName,“PName/I”);
ListMode->Branch(“PMT_A”,&nAbsPhotons1,“PMT_A/I”);
ListMode->Branch(“PMT_B”,&nAbsPhotons2,“PMT_B/I”);
ListMode->Branch(“t1”,&t1,“t1/D”);
ListMode->Branch(“t2”,&t2,“t2/D”);
}

EventAction::~EventAction()
{
ListMode->Write();
fileOut->Write();
G4cout<<“This file is written”<<G4endl;
fileOut->Close();
}

void EventAction::BeginOfEventAction(const G4Event* evt)
{
// initialisation per event
EdepInScinti = 0.;
nAbsPhotons1 = 0.;
nAbsPhotons2 = 0.;
PName = 0.;

G4int evtNb = evt->GetEventID();

//printing survey
if (evtNb%printModulo == 0)
G4cout << "\n—> Begin of Event: " << evtNb << G4endl;

}

void EventAction::EndOfEventAction(const G4Event* )
{
ListMode->Fill();
}