Message: How can I add to the number of events to be run? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question How can I add to the number of events to be run? 

Forum: Run Management
Date: 05 Mar, 2010
From: Ioannis Sechopoulos <Ioannis Sechopoulos>

Hello, In the PreUserTrackingAction function of my TrackingAction class, I test for a certain condition, and if it is true, I cancel that event by killing the track and all its daughters. For this, I used the following code:

if(certain test)
  const_cast<G4Track*>(theTrack)->SetTrackStatus(fKillTrackAndSecondaries);

This works fine. However, I would like for every time this happens for an additional event to be run, to compensate for this killed one. I tried adding the following command inside the if statement above to increase the number of events to be run during this run by one:

const_cast<G4Run*>(runManager->GetCurrentRun())->SetNumberOfEventToBeProcessed(runManager->GetCurrentRun()->GetNumberOfEventToBeProcessed() + 1)

But that didn't work. I also tried calling the GeneratePrimaries function of the PrimaryGeneratorAction inside the above if statement with the following command:

generatorAction->GeneratePrimaries(const_cast<G4Event*>(runManager->GetCurrentEvent()))

But that didn't work either. Both of these commands together don't work either. Is there a way to do this? Thanks!

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 Feedback: Re: How can I add to the number of events to be run?   (Gumplinger Peter - 05 Mar, 2010)
(_ Idea: Re: How can I add to the number of events to be run?   (Tom Roberts - 06 Mar, 2010)
(_ Ok: Re: How can I add to the number of events to be run?   (Ioannis Sechopoulos - 08 Mar, 2010)
 Add Message Add Message
to: "How can I add to the number of events to be run?"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]