Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4AdjointSimManager Class Reference

#include <G4AdjointSimManager.hh>

Inheritance diagram for G4AdjointSimManager:
Collaboration diagram for G4AdjointSimManager:

Public Member Functions

virtual void BeginOfRunAction (const G4Run *aRun)
 
virtual void EndOfRunAction (const G4Run *aRun)
 
void RunAdjointSimulation (G4int nb_evt)
 
G4int GetNbEvtOfLastRun ()
 
void SetAdjointTrackingMode (G4bool aBool)
 
G4bool GetAdjointTrackingMode ()
 
G4bool GetAdjointSimMode ()
 
G4bool GetDidAdjParticleReachTheExtSource ()
 
void RegisterAtEndOfAdjointTrack ()
 
void RegisterAdjointPrimaryWeight (G4double aWeight)
 
void ResetDidOneAdjPartReachExtSourceDuringEvent ()
 
G4int GetIDOfLastAdjParticleReachingExtSource ()
 
G4ThreeVector GetPositionAtEndOfLastAdjointTrack (size_t i=0)
 
G4ThreeVector GetDirectionAtEndOfLastAdjointTrack (size_t i=0)
 
G4double GetEkinAtEndOfLastAdjointTrack (size_t i=0)
 
G4double GetEkinNucAtEndOfLastAdjointTrack (size_t i=0)
 
G4double GetWeightAtEndOfLastAdjointTrack (size_t i=0)
 
G4double GetCosthAtEndOfLastAdjointTrack (size_t i=0)
 
const G4StringGetFwdParticleNameAtEndOfLastAdjointTrack ()
 
G4int GetFwdParticlePDGEncodingAtEndOfLastAdjointTrack (size_t i=0)
 
G4int GetFwdParticleIndexAtEndOfLastAdjointTrack (size_t i=0)
 
size_t GetNbOfAdointTracksReachingTheExternalSurface ()
 
void ClearEndOfAdjointTrackInfoVectors ()
 
G4ParticleDefinitionGetLastGeneratedFwdPrimaryParticle ()
 
std::vector
< G4ParticleDefinition * > * 
GetListOfPrimaryFwdParticles ()
 
size_t GetNbOfPrimaryFwdParticles ()
 
G4bool DefineSphericalExtSource (G4double radius, G4ThreeVector pos)
 
G4bool DefineSphericalExtSourceWithCentreAtTheCentreOfAVolume (G4double radius, const G4String &volume_name)
 
G4bool DefineExtSourceOnTheExtSurfaceOfAVolume (const G4String &volume_name)
 
void SetExtSourceEmax (G4double Emax)
 
G4bool DefineSphericalAdjointSource (G4double radius, G4ThreeVector pos)
 
G4bool DefineSphericalAdjointSourceWithCentreAtTheCentreOfAVolume (G4double radius, const G4String &volume_name)
 
G4bool DefineAdjointSourceOnTheExtSurfaceOfAVolume (const G4String &volume_name)
 
void SetAdjointSourceEmin (G4double Emin)
 
void SetAdjointSourceEmax (G4double Emax)
 
G4double GetAdjointSourceArea ()
 
void ConsiderParticleAsPrimary (const G4String &particle_name)
 
void NeglectParticleAsPrimary (const G4String &particle_name)
 
void SetPrimaryIon (G4ParticleDefinition *adjointIon, G4ParticleDefinition *fwdIon)
 
const G4StringGetPrimaryIonName ()
 
void SetNormalisationMode (G4int n)
 
G4int GetNormalisationMode ()
 
G4double GetNumberNucleonsInIon ()
 
void SetAdjointEventAction (G4UserEventAction *anAction)
 
void SetAdjointSteppingAction (G4UserSteppingAction *anAction)
 
void SetAdjointStackingAction (G4UserStackingAction *anAction)
 
void SetAdjointRunAction (G4UserRunAction *anAction)
 
void UseUserStackingActionInFwdTrackingPhase (G4bool aBool)
 
void UseUserTrackingActionInFwdTrackingPhase (G4bool aBool)
 
void SetNbOfPrimaryFwdGammasPerEvent (G4int)
 
void SetNbAdjointPrimaryGammasPerEvent (G4int)
 
void SetNbAdjointPrimaryElectronsPerEvent (G4int)
 
void SwitchToAdjointSimulationMode ()
 
void BackToFwdSimulationMode ()
 
- Public Member Functions inherited from G4UserRunAction
 G4UserRunAction ()
 
virtual ~G4UserRunAction ()
 
virtual G4RunGenerateRun ()
 
virtual void SetMaster (G4bool val=true)
 
G4bool IsMaster () const
 

Static Public Member Functions

static G4AdjointSimManagerGetInstance ()
 

Additional Inherited Members

- Protected Attributes inherited from G4UserRunAction
G4bool isMaster
 

Detailed Description

Definition at line 150 of file G4AdjointSimManager.hh.

Member Function Documentation

void G4AdjointSimManager::BackToFwdSimulationMode ( )

Definition at line 221 of file G4AdjointSimManager.cc.

222 { //Restore the user defined actions
223  //--------------------------------
224  ResetUserActions();
225  adjoint_sim_mode=false;
226 }

Here is the caller graph for this function:

void G4AdjointSimManager::BeginOfRunAction ( const G4Run aRun)
virtual

Reimplemented from G4UserRunAction.

Definition at line 663 of file G4AdjointSimManager.cc.

664 {
665 /*
666  if (!adjoint_sim_mode){
667  if(fUserRunAction) fUserRunAction->BeginOfRunAction(aRun);
668  }
669  else {
670  if (theAdjointRunAction) theAdjointRunAction->BeginOfRunAction(aRun);
671  }
672  */
673 fUserRunAction->BeginOfRunAction(aRun);
674 }
virtual void BeginOfRunAction(const G4Run *aRun)

Here is the call graph for this function:

void G4AdjointSimManager::ClearEndOfAdjointTrackInfoVectors ( )

Definition at line 424 of file G4AdjointSimManager.cc.

425 {theAdjointTrackingAction->ClearEndOfAdjointTrackInfoVectors();
426 }

Here is the call graph for this function:

Here is the caller graph for this function:

void G4AdjointSimManager::ConsiderParticleAsPrimary ( const G4String particle_name)

Definition at line 581 of file G4AdjointSimManager.cc.

582 {
583  theAdjointPrimaryGeneratorAction->ConsiderParticleAsPrimary(particle_name);
584 }
void ConsiderParticleAsPrimary(const G4String &particle_name)

Here is the call graph for this function:

Here is the caller graph for this function:

G4bool G4AdjointSimManager::DefineAdjointSourceOnTheExtSurfaceOfAVolume ( const G4String volume_name)

Definition at line 557 of file G4AdjointSimManager.cc.

558 {
559  G4double area;
560  G4bool aBool = G4AdjointCrossSurfChecker::GetInstance()->AddanExtSurfaceOfAvolume( "AdjointSource", volume_name,area);
561  area_of_the_adjoint_source=area;
562  if (aBool) {
563  theAdjointPrimaryGeneratorAction->SetAdjointPrimarySourceOnAnExtSurfaceOfAVolume(volume_name);
564  }
565  return aBool;
566 }
bool G4bool
Definition: G4Types.hh:79
static G4AdjointCrossSurfChecker * GetInstance()
G4bool AddanExtSurfaceOfAvolume(const G4String &SurfaceName, const G4String &volume_name, G4double &area)
void SetAdjointPrimarySourceOnAnExtSurfaceOfAVolume(const G4String &volume_name)
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

Here is the caller graph for this function:

G4bool G4AdjointSimManager::DefineExtSourceOnTheExtSurfaceOfAVolume ( const G4String volume_name)

Definition at line 523 of file G4AdjointSimManager.cc.

524 {
525  G4double area;
526  return G4AdjointCrossSurfChecker::GetInstance()->AddanExtSurfaceOfAvolume( "ExternalSource", volume_name,area);
527 }
static G4AdjointCrossSurfChecker * GetInstance()
G4bool AddanExtSurfaceOfAvolume(const G4String &SurfaceName, const G4String &volume_name, G4double &area)
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

Here is the caller graph for this function:

G4bool G4AdjointSimManager::DefineSphericalAdjointSource ( G4double  radius,
G4ThreeVector  pos 
)

Definition at line 536 of file G4AdjointSimManager.cc.

537 {
538  G4double area;
539  G4bool aBool = G4AdjointCrossSurfChecker::GetInstance()->AddaSphericalSurface("AdjointSource", radius, pos, area);
540  theAdjointPrimaryGeneratorAction->SetSphericalAdjointPrimarySource(radius, pos);
541  area_of_the_adjoint_source=area;
542  return aBool;
543 }
G4bool AddaSphericalSurface(const G4String &SurfaceName, G4double radius, G4ThreeVector pos, G4double &area)
bool G4bool
Definition: G4Types.hh:79
static G4AdjointCrossSurfChecker * GetInstance()
double G4double
Definition: G4Types.hh:76
void SetSphericalAdjointPrimarySource(G4double radius, G4ThreeVector pos)

Here is the call graph for this function:

Here is the caller graph for this function:

G4bool G4AdjointSimManager::DefineSphericalAdjointSourceWithCentreAtTheCentreOfAVolume ( G4double  radius,
const G4String volume_name 
)

Definition at line 546 of file G4AdjointSimManager.cc.

547 {
548  G4double area;
549  G4ThreeVector center;
550  G4bool aBool = G4AdjointCrossSurfChecker::GetInstance()->AddaSphericalSurfaceWithCenterAtTheCenterOfAVolume( "AdjointSource", radius, volume_name,center, area);
551  theAdjointPrimaryGeneratorAction->SetSphericalAdjointPrimarySource(radius, center);
552  area_of_the_adjoint_source=area;
553  return aBool;
554 }
G4bool AddaSphericalSurfaceWithCenterAtTheCenterOfAVolume(const G4String &SurfaceName, G4double radius, const G4String &volume_name, G4ThreeVector &center, G4double &area)
bool G4bool
Definition: G4Types.hh:79
static G4AdjointCrossSurfChecker * GetInstance()
double G4double
Definition: G4Types.hh:76
void SetSphericalAdjointPrimarySource(G4double radius, G4ThreeVector pos)

Here is the call graph for this function:

Here is the caller graph for this function:

G4bool G4AdjointSimManager::DefineSphericalExtSource ( G4double  radius,
G4ThreeVector  pos 
)

Definition at line 508 of file G4AdjointSimManager.cc.

509 {
510  G4double area;
511  return G4AdjointCrossSurfChecker::GetInstance()->AddaSphericalSurface("ExternalSource", radius, pos, area);
512 }
G4bool AddaSphericalSurface(const G4String &SurfaceName, G4double radius, G4ThreeVector pos, G4double &area)
static G4AdjointCrossSurfChecker * GetInstance()
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

Here is the caller graph for this function:

G4bool G4AdjointSimManager::DefineSphericalExtSourceWithCentreAtTheCentreOfAVolume ( G4double  radius,
const G4String volume_name 
)

Definition at line 515 of file G4AdjointSimManager.cc.

516 {
517  G4double area;
518  G4ThreeVector center;
519  return G4AdjointCrossSurfChecker::GetInstance()->AddaSphericalSurfaceWithCenterAtTheCenterOfAVolume( "ExternalSource", radius, volume_name,center, area);
520 }
G4bool AddaSphericalSurfaceWithCenterAtTheCenterOfAVolume(const G4String &SurfaceName, G4double radius, const G4String &volume_name, G4ThreeVector &center, G4double &area)
static G4AdjointCrossSurfChecker * GetInstance()
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

Here is the caller graph for this function:

void G4AdjointSimManager::EndOfRunAction ( const G4Run aRun)
virtual

Reimplemented from G4UserRunAction.

Definition at line 677 of file G4AdjointSimManager.cc.

678 {if (!adjoint_sim_mode){
679  if(fUserRunAction) fUserRunAction->EndOfRunAction(aRun);
680  }
681  else if (theAdjointRunAction) theAdjointRunAction->EndOfRunAction(aRun);
682 /*
683 #ifdef G4MULTITHREADED
684  if (G4RunManager::GetRunManager()->GetRunManagerType() == G4RunManager::workerRM){
685  if (adjoint_sim_mode) BackToFwdSimulationMode();
686  }
687 #endif
688 */
689 
690 }
virtual void EndOfRunAction(const G4Run *aRun)

Here is the call graph for this function:

G4bool G4AdjointSimManager::GetAdjointSimMode ( )
inline

Definition at line 166 of file G4AdjointSimManager.hh.

166 {return adjoint_sim_mode;} //true if an adjoint simulation is running
G4double G4AdjointSimManager::GetAdjointSourceArea ( )
inline

Definition at line 206 of file G4AdjointSimManager.hh.

206 {return area_of_the_adjoint_source;}

Here is the caller graph for this function:

G4bool G4AdjointSimManager::GetAdjointTrackingMode ( )

Definition at line 323 of file G4AdjointSimManager.cc.

323  {
324  return theAdjointTrackingAction->GetIsAdjointTrackingMode();
325 }

Here is the call graph for this function:

G4double G4AdjointSimManager::GetCosthAtEndOfLastAdjointTrack ( size_t  i = 0)

Definition at line 397 of file G4AdjointSimManager.cc.

397  {
398  return theAdjointTrackingAction->GetCosthAtEndOfLastAdjointTrack(i);
399 }
G4double GetCosthAtEndOfLastAdjointTrack(size_t i=0)

Here is the call graph for this function:

G4bool G4AdjointSimManager::GetDidAdjParticleReachTheExtSource ( )

Definition at line 351 of file G4AdjointSimManager.cc.

352 {
354 }
size_t GetNbOfAdointTracksReachingTheExternalSurface()

Here is the call graph for this function:

Here is the caller graph for this function:

G4ThreeVector G4AdjointSimManager::GetDirectionAtEndOfLastAdjointTrack ( size_t  i = 0)

Definition at line 377 of file G4AdjointSimManager.cc.

377  {
378  return theAdjointTrackingAction->GetDirectionAtEndOfLastAdjointTrack(i);
379 }
G4ThreeVector GetDirectionAtEndOfLastAdjointTrack(size_t i=0)

Here is the call graph for this function:

G4double G4AdjointSimManager::GetEkinAtEndOfLastAdjointTrack ( size_t  i = 0)

Definition at line 382 of file G4AdjointSimManager.cc.

382  {
383  return theAdjointTrackingAction->GetEkinAtEndOfLastAdjointTrack(i);
384 }
G4double GetEkinAtEndOfLastAdjointTrack(size_t i=0)

Here is the call graph for this function:

G4double G4AdjointSimManager::GetEkinNucAtEndOfLastAdjointTrack ( size_t  i = 0)

Definition at line 387 of file G4AdjointSimManager.cc.

387  {
388  return theAdjointTrackingAction->GetEkinNucAtEndOfLastAdjointTrack(i);
389 }
G4double GetEkinNucAtEndOfLastAdjointTrack(size_t i=0)

Here is the call graph for this function:

G4int G4AdjointSimManager::GetFwdParticleIndexAtEndOfLastAdjointTrack ( size_t  i = 0)

Definition at line 413 of file G4AdjointSimManager.cc.

414 {return theAdjointTrackingAction->GetLastFwdParticleIndex(i);
415 }
G4int GetLastFwdParticleIndex(size_t i=0)

Here is the call graph for this function:

const G4String & G4AdjointSimManager::GetFwdParticleNameAtEndOfLastAdjointTrack ( )

Definition at line 402 of file G4AdjointSimManager.cc.

403 {return theAdjointTrackingAction->GetFwdParticleNameAtEndOfLastAdjointTrack();
404 }
const G4String & GetFwdParticleNameAtEndOfLastAdjointTrack()

Here is the call graph for this function:

G4int G4AdjointSimManager::GetFwdParticlePDGEncodingAtEndOfLastAdjointTrack ( size_t  i = 0)

Definition at line 407 of file G4AdjointSimManager.cc.

407  {
408  return theAdjointTrackingAction->GetFwdParticlePDGEncodingAtEndOfLastAdjointTrack(i);
409 }
G4int GetFwdParticlePDGEncodingAtEndOfLastAdjointTrack(size_t i=0)

Here is the call graph for this function:

G4int G4AdjointSimManager::GetIDOfLastAdjParticleReachingExtSource ( )
inline

Definition at line 173 of file G4AdjointSimManager.hh.

173 {return ID_of_last_particle_that_reach_the_ext_source;};
G4AdjointSimManager * G4AdjointSimManager::GetInstance ( )
static

Definition at line 134 of file G4AdjointSimManager.cc.

135 {
136  if (instance == 0) instance = new G4AdjointSimManager;
137  return instance;
138 }

Here is the caller graph for this function:

G4ParticleDefinition * G4AdjointSimManager::GetLastGeneratedFwdPrimaryParticle ( )

Definition at line 693 of file G4AdjointSimManager.cc.

693  {
694  return theAdjointPrimaryGeneratorAction->GetLastGeneratedFwdPrimaryParticle();
695 }
G4ParticleDefinition * GetLastGeneratedFwdPrimaryParticle()

Here is the call graph for this function:

std::vector< G4ParticleDefinition * > * G4AdjointSimManager::GetListOfPrimaryFwdParticles ( )

Definition at line 358 of file G4AdjointSimManager.cc.

359 {
360  return theAdjointPrimaryGeneratorAction->GetListOfPrimaryFwdParticles();
361 }
std::vector< G4ParticleDefinition * > * GetListOfPrimaryFwdParticles()

Here is the call graph for this function:

G4int G4AdjointSimManager::GetNbEvtOfLastRun ( )
inline

Definition at line 162 of file G4AdjointSimManager.hh.

162 {return nb_evt_of_last_run;}
size_t G4AdjointSimManager::GetNbOfAdointTracksReachingTheExternalSurface ( )

Definition at line 418 of file G4AdjointSimManager.cc.

419 {
420  return theAdjointTrackingAction->GetNbOfAdointTracksReachingTheExternalSurface();
421 }
size_t GetNbOfAdointTracksReachingTheExternalSurface()

Here is the call graph for this function:

Here is the caller graph for this function:

size_t G4AdjointSimManager::GetNbOfPrimaryFwdParticles ( )

Definition at line 364 of file G4AdjointSimManager.cc.

365 {
366  return theAdjointPrimaryGeneratorAction->GetListOfPrimaryFwdParticles()->size();
367 }
std::vector< G4ParticleDefinition * > * GetListOfPrimaryFwdParticles()

Here is the call graph for this function:

G4int G4AdjointSimManager::GetNormalisationMode ( )
inline

Definition at line 213 of file G4AdjointSimManager.hh.

213 {return normalisation_mode;};
G4double G4AdjointSimManager::GetNumberNucleonsInIon ( )
inline

Definition at line 214 of file G4AdjointSimManager.hh.

214 {return nb_nuc;};
G4ThreeVector G4AdjointSimManager::GetPositionAtEndOfLastAdjointTrack ( size_t  i = 0)

Definition at line 371 of file G4AdjointSimManager.cc.

371  {
372  return theAdjointTrackingAction->GetPositionAtEndOfLastAdjointTrack(i);
373 }
G4ThreeVector GetPositionAtEndOfLastAdjointTrack(size_t i=0)

Here is the call graph for this function:

const G4String & G4AdjointSimManager::GetPrimaryIonName ( )

Definition at line 606 of file G4AdjointSimManager.cc.

607 {
608  return theAdjointPrimaryGeneratorAction->GetPrimaryIonName();
609 }

Here is the call graph for this function:

G4double G4AdjointSimManager::GetWeightAtEndOfLastAdjointTrack ( size_t  i = 0)

Definition at line 392 of file G4AdjointSimManager.cc.

392  {
393  return theAdjointTrackingAction->GetWeightAtEndOfLastAdjointTrack(i);
394 }
G4double GetWeightAtEndOfLastAdjointTrack(size_t i=0)

Here is the call graph for this function:

void G4AdjointSimManager::NeglectParticleAsPrimary ( const G4String particle_name)

Definition at line 587 of file G4AdjointSimManager.cc.

588 {
589  theAdjointPrimaryGeneratorAction->NeglectParticleAsPrimary(particle_name);
590 }
void NeglectParticleAsPrimary(const G4String &particle_name)

Here is the call graph for this function:

Here is the caller graph for this function:

void G4AdjointSimManager::RegisterAdjointPrimaryWeight ( G4double  aWeight)

Definition at line 612 of file G4AdjointSimManager.cc.

613 {
614  theAdjointPrimaryWeight = aWeight;
615  theAdjointSteppingAction->SetPrimWeight(aWeight);
616 }
void SetPrimWeight(G4double weight)

Here is the call graph for this function:

void G4AdjointSimManager::RegisterAtEndOfAdjointTrack ( )

Definition at line 430 of file G4AdjointSimManager.cc.

431 {
432  last_pos = theAdjointSteppingAction->GetLastPosition();
433  last_direction = theAdjointSteppingAction->GetLastMomentum();
434  last_direction /=last_direction.mag();
435  last_cos_th = last_direction.z();
436  G4ParticleDefinition* aPartDef= theAdjointSteppingAction->GetLastPartDef();
437 
438  last_fwd_part_name= aPartDef->GetParticleName();
439 
440  last_fwd_part_name.remove(0,4);
441 
442  last_fwd_part_PDGEncoding=G4ParticleTable::GetParticleTable()->FindParticle(last_fwd_part_name)->GetPDGEncoding();
443 
444  std::vector<G4ParticleDefinition*>* aList = theAdjointPrimaryGeneratorAction->GetListOfPrimaryFwdParticles();
445  last_fwd_part_index=-1;
446  size_t i=0;
447  while(i<aList->size() && last_fwd_part_index<0) {
448  if ((*aList)[i]->GetParticleName() == last_fwd_part_name) last_fwd_part_index=i;
449  i++;
450  }
451 
452  last_ekin = theAdjointSteppingAction->GetLastEkin();
453  last_ekin_nuc = last_ekin;
454  if (aPartDef->GetParticleType() == "adjoint_nucleus") {
455  nb_nuc=double(aPartDef->GetBaryonNumber());
456  last_ekin_nuc /=nb_nuc;
457  }
458 
459  last_weight = theAdjointSteppingAction->GetLastWeight();
460 
461 
462 
463  last_pos_vec.push_back(last_pos);
464  last_direction_vec.push_back(last_direction);
465  last_ekin_vec.push_back(last_ekin);
466  last_ekin_nuc_vec.push_back(last_ekin_nuc);
467  last_cos_th_vec.push_back(last_cos_th);
468  last_weight_vec.push_back(last_weight);
469  last_fwd_part_PDGEncoding_vec.push_back(last_fwd_part_PDGEncoding);
470  last_fwd_part_index_vec.push_back(last_fwd_part_index);
471  ID_of_last_particle_that_reach_the_ext_source++;
472  ID_of_last_particle_that_reach_the_ext_source_vec.push_back(ID_of_last_particle_that_reach_the_ext_source);
473 
474 
475 
476 
477 
478 
479  /* G4PhysicsLogVector* theWeightVector=0;
480  if (last_fwd_part_name =="e-") theWeightVector=electron_last_weight_vector;
481  else if (last_fwd_part_name =="gamma") theWeightVector=gamma_last_weight_vector;
482  else if (last_fwd_part_name =="proton") theWeightVector=proton_last_weight_vector;
483 
484  if (theWeightVector){
485 
486  size_t ind = size_t(std::log10(last_weight/theAdjointPrimaryWeight)*10. + 200);
487  G4double low_val =theWeightVector->GetLowEdgeEnergy(ind);
488  G4bool aBool = true;
489  G4double bin_weight = theWeightVector->GetValue(low_val, aBool)+1.;
490  theWeightVector->PutValue(ind, bin_weight);
491  }
492  */
493  /*if ((last_weight/theAdjointPrimaryWeight)>1.) last_weight*=1000. ;
494  else if ( (last_weight/theAdjointPrimaryWeight)>0.1) last_weight*=100. ;
495  else if ( (last_weight/theAdjointPrimaryWeight)>0.01) last_weight*=10. ;*/
496 
497 
498  //G4cout <<"Last Weight "<<last_weight<<'\t'<<theAdjointPrimaryWeight<<'\t'<<last_weight/theAdjointPrimaryWeight<<std::endl;
499  /*if (last_weight/theAdjointPrimaryWeight >10.) {
500  G4cout<<"Warning a weight increase by a factor : "<<last_weight/theAdjointPrimaryWeight<<std::endl;
501  }
502  */
503 
504 
505 }
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
G4String & remove(str_size)
const G4String & GetParticleName() const
double z() const
const G4String & GetParticleType() const
G4ParticleDefinition * GetLastPartDef()
static G4ParticleTable * GetParticleTable()
std::vector< G4ParticleDefinition * > * GetListOfPrimaryFwdParticles()
double mag() const

Here is the call graph for this function:

Here is the caller graph for this function:

void G4AdjointSimManager::ResetDidOneAdjPartReachExtSourceDuringEvent ( )

Definition at line 698 of file G4AdjointSimManager.cc.

699 {theAdjointSteppingAction->ResetDidOneAdjPartReachExtSourceDuringEvent();
700 }

Here is the call graph for this function:

Here is the caller graph for this function:

void G4AdjointSimManager::RunAdjointSimulation ( G4int  nb_evt)

Definition at line 141 of file G4AdjointSimManager.cc.

142 { if (G4RunManager::GetRunManager()->GetRunManagerType() != G4RunManager::sequentialRM) return; //only for sequential mode
143  if (welcome_message) {
144  G4cout<<"****************************************************************"<<std::endl;
145  G4cout<<"*** Geant4 Reverse/Adjoint Monte Carlo mode ***"<<std::endl;
146  G4cout<<"*** Author: L.Desorgher ***"<<std::endl;
147  G4cout<<"*** Company: SpaceIT GmbH, Bern, Switzerland ***"<<std::endl;
148  G4cout<<"*** Sponsored by: ESA/ESTEC contract contract 21435/08/NL/AT ***"<<std::endl;
149  G4cout<<"****************************************************************"<<std::endl;
150  welcome_message=false;
151  }
152 
153  //Switch to adjoint simulation mode
154  //---------------------------------------------------------
156 
157  //Make the run
158  //------------
159 
160  nb_evt_of_last_run =nb_evt;
161  G4RunManager::GetRunManager()->BeamOn(nb_evt*theAdjointPrimaryGeneratorAction->GetNbOfAdjointPrimaryTypes());
162  //G4RunManager::GetRunManager()->BeamOn(theAdjointPrimaryGeneratorAction->GetNbOfAdjointPrimaryTypes()*2*nb_evt);
163 
164  //Back to Fwd Simulation Mode
165  //--------------------------------
167 
168  /*
169  //Register the weight vector
170  //--------------------------
171  std::ofstream FileOutputElectronWeight("ElectronWeight.txt", std::ios::out);
172  FileOutputElectronWeight<<std::setiosflags(std::ios::scientific);
173  FileOutputElectronWeight<<std::setprecision(6);
174  G4bool aBool = electron_last_weight_vector->Store(FileOutputElectronWeight, true);
175  FileOutputElectronWeight.close();
176 
177  std::ofstream FileOutputProtonWeight("ProtonWeight.txt", std::ios::out);
178  FileOutputProtonWeight<<std::setiosflags(std::ios::scientific);
179  FileOutputProtonWeight<<std::setprecision(6);
180  aBool = proton_last_weight_vector->Store(FileOutputProtonWeight, true);
181  FileOutputProtonWeight.close();
182 
183  std::ofstream FileOutputGammaWeight("GammaWeight.txt", std::ios::out);
184  FileOutputGammaWeight<<std::setiosflags(std::ios::scientific);
185  FileOutputGammaWeight<<std::setprecision(6);
186  aBool = gamma_last_weight_vector->Store(FileOutputGammaWeight, true);
187  FileOutputGammaWeight.close();
188  */
189 }
virtual void BeamOn(G4int n_event, const char *macroFile=0, G4int n_select=-1)
G4GLOB_DLL std::ostream G4cout
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:79

Here is the call graph for this function:

Here is the caller graph for this function:

void G4AdjointSimManager::SetAdjointEventAction ( G4UserEventAction anAction)

Definition at line 620 of file G4AdjointSimManager.cc.

621 {
622  theAdjointEventAction = anAction;
623 }
void G4AdjointSimManager::SetAdjointRunAction ( G4UserRunAction anAction)

Definition at line 639 of file G4AdjointSimManager.cc.

640 {
641  theAdjointRunAction=anAction;
642 }
void G4AdjointSimManager::SetAdjointSourceEmax ( G4double  Emax)

Definition at line 575 of file G4AdjointSimManager.cc.

576 {
577  theAdjointPrimaryGeneratorAction->SetEmax(Emax);
578 }
static const G4double Emax

Here is the call graph for this function:

Here is the caller graph for this function:

void G4AdjointSimManager::SetAdjointSourceEmin ( G4double  Emin)

Definition at line 569 of file G4AdjointSimManager.cc.

570 {
571  theAdjointPrimaryGeneratorAction->SetEmin(Emin);
572 }
static const G4double Emin

Here is the call graph for this function:

Here is the caller graph for this function:

void G4AdjointSimManager::SetAdjointStackingAction ( G4UserStackingAction anAction)

Definition at line 632 of file G4AdjointSimManager.cc.

633 {
634  theAdjointStackingAction->SetUserAdjointStackingAction(anAction);
635 }
void SetUserAdjointStackingAction(G4UserStackingAction *anAction)

Here is the call graph for this function:

void G4AdjointSimManager::SetAdjointSteppingAction ( G4UserSteppingAction anAction)

Definition at line 626 of file G4AdjointSimManager.cc.

627 {
628  theAdjointSteppingAction->SetUserAdjointSteppingAction(anAction);
629 }
void SetUserAdjointSteppingAction(G4UserSteppingAction *anAction)

Here is the call graph for this function:

void G4AdjointSimManager::SetAdjointTrackingMode ( G4bool  aBool)

Definition at line 328 of file G4AdjointSimManager.cc.

329 {
330  adjoint_tracking_mode = aBool;
331 
332  if (adjoint_tracking_mode) {
333  SetRestOfAdjointActions();
334  theAdjointStackingAction->SetAdjointMode(true);
335  theAdjointStackingAction->SetKillTracks(false);
336 
337  }
338  else {
339 
340  ResetRestOfUserActions();
341  theAdjointStackingAction->SetAdjointMode(false);
343  theAdjointStackingAction->SetKillTracks(false);
345  }
346  else theAdjointStackingAction->SetKillTracks(true);
347  }
348 }
G4bool GetDidAdjParticleReachTheExtSource()

Here is the call graph for this function:

Here is the caller graph for this function:

void G4AdjointSimManager::SetExtSourceEmax ( G4double  Emax)

Definition at line 530 of file G4AdjointSimManager.cc.

531 {
532  theAdjointSteppingAction->SetExtSourceEMax(Emax);
533 }
void SetExtSourceEMax(G4double Emax)
static const G4double Emax

Here is the call graph for this function:

Here is the caller graph for this function:

void G4AdjointSimManager::SetNbAdjointPrimaryElectronsPerEvent ( G4int  nb)

Definition at line 657 of file G4AdjointSimManager.cc.

658 {
659  theAdjointPrimaryGeneratorAction->SetNbAdjointPrimaryElectronsPerEvent(nb);
660 }

Here is the call graph for this function:

Here is the caller graph for this function:

void G4AdjointSimManager::SetNbAdjointPrimaryGammasPerEvent ( G4int  nb)

Definition at line 651 of file G4AdjointSimManager.cc.

652 {
653  theAdjointPrimaryGeneratorAction->SetNbAdjointPrimaryGammasPerEvent(nb);
654 }

Here is the call graph for this function:

Here is the caller graph for this function:

void G4AdjointSimManager::SetNbOfPrimaryFwdGammasPerEvent ( G4int  nb)

Definition at line 645 of file G4AdjointSimManager.cc.

646 {
647  theAdjointPrimaryGeneratorAction->SetNbPrimaryFwdGammasPerEvent(nb);
648 }

Here is the call graph for this function:

Here is the caller graph for this function:

void G4AdjointSimManager::SetNormalisationMode ( G4int  n)
inline

Definition at line 212 of file G4AdjointSimManager.hh.

212 {normalisation_mode=n;};
void G4AdjointSimManager::SetPrimaryIon ( G4ParticleDefinition adjointIon,
G4ParticleDefinition fwdIon 
)

Definition at line 600 of file G4AdjointSimManager.cc.

601 {
602  theAdjointPrimaryGeneratorAction->SetPrimaryIon(adjointIon, fwdIon);
603 }
void SetPrimaryIon(G4ParticleDefinition *adjointIon, G4ParticleDefinition *fwdIon)

Here is the call graph for this function:

void G4AdjointSimManager::SwitchToAdjointSimulationMode ( )

Definition at line 208 of file G4AdjointSimManager.cc.

209 { //Replace the user defined actions by the adjoint actions
210  //---------------------------------------------------------
211  SetAdjointActions();
212 
213  //Update the list of primaries
214  //-----------------------------
215  theAdjointPrimaryGeneratorAction->UpdateListOfPrimaryParticles();
216  adjoint_sim_mode=true;
217  ID_of_last_particle_that_reach_the_ext_source=0;
218 }

Here is the call graph for this function:

Here is the caller graph for this function:

void G4AdjointSimManager::UseUserStackingActionInFwdTrackingPhase ( G4bool  aBool)
inline

Definition at line 225 of file G4AdjointSimManager.hh.

225 {use_user_StackingAction=aBool;}
void G4AdjointSimManager::UseUserTrackingActionInFwdTrackingPhase ( G4bool  aBool)
inline

Definition at line 226 of file G4AdjointSimManager.hh.

226 {use_user_TrackingAction=aBool;}

The documentation for this class was generated from the following files: