137#ifndef G4AdjointSimManager_hh
138#define G4AdjointSimManager_hh 1
151class G4AdjointRunAction;
154class G4AdjointEventAction;
180 return adjoint_sim_mode;
190 return ID_of_last_particle_that_reach_the_ext_source;
226 return area_of_the_adjoint_source;
249 use_user_StackingAction = aBool;
253 use_user_TrackingAction = aBool;
282 void SetRestOfAdjointActions();
283 void SetAdjointPrimaryRunAndStackingActions();
284 void SetAdjointActions();
285 void ResetRestOfUserActions();
286 void ResetUserPrimaryRunAndStackingActions();
287 void ResetUserActions();
288 void DefineUserActions();
303 G4bool user_action_already_defined =
false;
310 G4bool use_user_StackingAction =
false;
311 G4bool use_user_TrackingAction =
false;
324 G4bool adjoint_tracking_mode =
false;
325 G4bool adjoint_sim_mode =
false;
329 std::vector<G4ThreeVector> last_pos_vec;
330 std::vector<G4ThreeVector> last_direction_vec;
331 std::vector<G4double> last_ekin_vec;
332 std::vector<G4double> last_ekin_nuc_vec;
333 std::vector<G4double> last_cos_th_vec;
334 std::vector<G4double> last_weight_vec;
335 std::vector<G4int> last_fwd_part_PDGEncoding_vec;
336 std::vector<G4int> last_fwd_part_index_vec;
337 std::vector<G4int> ID_of_last_particle_that_reach_the_ext_source_vec;
341 G4double last_ekin = 0.0, last_ekin_nuc = 0.0;
345 G4int last_fwd_part_PDGEncoding = 0;
346 G4int last_fwd_part_index = 0;
348 G4int ID_of_last_particle_that_reach_the_ext_source = 0;
350 G4int nb_evt_of_last_run = 0;
351 G4int normalisation_mode = 3;
355 G4double area_of_the_adjoint_source = 0.0;
357 G4double theAdjointPrimaryWeight = 0.0;
365 G4bool welcome_message =
true;
void SetAdjointStackingAction(G4UserStackingAction *anAction)
void ClearEndOfAdjointTrackInfoVectors()
G4bool DefineAdjointSourceOnTheExtSurfaceOfAVolume(const G4String &volume_name)
const G4String & GetPrimaryIonName()
G4bool DefineExtSourceOnTheExtSurfaceOfAVolume(const G4String &volume_name)
G4double GetEkinAtEndOfLastAdjointTrack(std::size_t i=0)
G4int GetFwdParticlePDGEncodingAtEndOfLastAdjointTrack(std::size_t i=0)
G4bool GetDidAdjParticleReachTheExtSource()
std::vector< G4ParticleDefinition * > * GetListOfPrimaryFwdParticles()
void RunAdjointSimulation(G4int nb_evt)
G4double GetCosthAtEndOfLastAdjointTrack(std::size_t i=0)
G4bool GetAdjointTrackingMode()
const G4String & GetFwdParticleNameAtEndOfLastAdjointTrack()
G4bool DefineSphericalExtSourceWithCentreAtTheCentreOfAVolume(G4double radius, const G4String &volume_name)
void SetNbAdjointPrimaryGammasPerEvent(G4int)
void SetAdjointTrackingMode(G4bool aBool)
G4int GetIDOfLastAdjParticleReachingExtSource()
void ConsiderParticleAsPrimary(const G4String &particle_name)
void SwitchToAdjointSimulationMode()
G4double GetAdjointSourceArea()
std::size_t GetNbOfPrimaryFwdParticles()
void SetAdjointRunAction(G4UserRunAction *anAction)
void SetExtSourceEmax(G4double Emax)
void RegisterAtEndOfAdjointTrack()
virtual void BeginOfRunAction(const G4Run *aRun)
void SetAdjointSourceEmax(G4double Emax)
void RegisterAdjointPrimaryWeight(G4double aWeight)
void SetAdjointSourceEmin(G4double Emin)
virtual void EndOfRunAction(const G4Run *aRun)
G4double GetWeightAtEndOfLastAdjointTrack(std::size_t i=0)
G4bool GetAdjointSimMode()
void ResetDidOneAdjPartReachExtSourceDuringEvent()
void SetAdjointEventAction(G4UserEventAction *anAction)
void UseUserStackingActionInFwdTrackingPhase(G4bool aBool)
G4int GetNbEvtOfLastRun()
void NeglectParticleAsPrimary(const G4String &particle_name)
G4bool DefineSphericalAdjointSourceWithCentreAtTheCentreOfAVolume(G4double radius, const G4String &volume_name)
G4int GetNormalisationMode()
void UseUserTrackingActionInFwdTrackingPhase(G4bool aBool)
void SetNbAdjointPrimaryElectronsPerEvent(G4int)
static G4AdjointSimManager * GetInstance()
G4int GetFwdParticleIndexAtEndOfLastAdjointTrack(std::size_t i=0)
G4double GetEkinNucAtEndOfLastAdjointTrack(std::size_t i=0)
void SetNbOfPrimaryFwdGammasPerEvent(G4int)
G4ThreeVector GetDirectionAtEndOfLastAdjointTrack(std::size_t i=0)
void BackToFwdSimulationMode()
G4ParticleDefinition * GetLastGeneratedFwdPrimaryParticle()
void SetAdjointSteppingAction(G4UserSteppingAction *anAction)
void SetNormalisationMode(G4int n)
G4bool DefineSphericalExtSource(G4double radius, G4ThreeVector pos)
G4ThreeVector GetPositionAtEndOfLastAdjointTrack(std::size_t i=0)
std::size_t GetNbOfAdointTracksReachingTheExternalSurface()
G4double GetNumberNucleonsInIon()
G4bool DefineSphericalAdjointSource(G4double radius, G4ThreeVector pos)
void SetPrimaryIon(G4ParticleDefinition *adjointIon, G4ParticleDefinition *fwdIon)