137#ifndef G4AdjointSimManager_hh
138#define G4AdjointSimManager_hh 1
151class G4AdjointRunAction;
154class G4AdjointEventAction;
179 return adjoint_sim_mode;
189 return ID_of_last_particle_that_reach_the_ext_source;
243 use_user_StackingAction = aBool;
247 use_user_TrackingAction = aBool;
273 void SetRestOfAdjointActions();
274 void SetAdjointPrimaryRunAndStackingActions();
275 void SetAdjointActions();
276 void ResetRestOfUserActions();
277 void ResetUserPrimaryRunAndStackingActions();
278 void ResetUserActions();
279 void DefineUserActions();
293 G4bool user_action_already_defined =
false;
300 G4bool use_user_StackingAction =
false;
301 G4bool use_user_TrackingAction =
false;
314 G4bool adjoint_tracking_mode =
false;
315 G4bool adjoint_sim_mode =
false;
319 std::vector<G4ThreeVector> last_pos_vec;
320 std::vector<G4ThreeVector> last_direction_vec;
321 std::vector<G4double> last_ekin_vec;
322 std::vector<G4double> last_ekin_nuc_vec;
323 std::vector<G4double> last_cos_th_vec;
324 std::vector<G4double> last_weight_vec;
325 std::vector<G4int> last_fwd_part_PDGEncoding_vec;
326 std::vector<G4int> last_fwd_part_index_vec;
327 std::vector<G4int> ID_of_last_particle_that_reach_the_ext_source_vec;
331 G4double last_ekin = 0.0, last_ekin_nuc = 0.0;
335 G4int last_fwd_part_PDGEncoding = 0;
336 G4int last_fwd_part_index = 0;
338 G4int ID_of_last_particle_that_reach_the_ext_source = 0;
340 G4int nb_evt_of_last_run = 0;
341 G4int normalisation_mode = 3;
345 G4double area_of_the_adjoint_source = 0.0;
347 G4double theAdjointPrimaryWeight = 0.0;
349 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)
void BeginOfRunAction(const G4Run *aRun) override
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()
void SetAdjointSourceEmax(G4double Emax)
void RegisterAdjointPrimaryWeight(G4double aWeight)
void SetAdjointSourceEmin(G4double Emin)
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)
void EndOfRunAction(const G4Run *aRun) override