Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
CML2Convergence Class Reference

#include <ML2Convergence.hh>

Public Member Functions

 CML2Convergence ()
 
 CML2Convergence (G4int seed, G4int saving_in_Selected_Voxels_every_events, G4String FileExperimentalData, G4String FileExperimentalDataOut, G4bool bCompareExp, G4int maxNumberOfEvents, G4int nRecycling, G4int nMaxLoops)
 
 ~CML2Convergence (void)
 
void add (const G4Step *aStep)
 
G4bool stopRun ()
 
void setMaxNumberOfEvents (G4int val)
 
G4double getMaxNumberOfEvents ()
 
CML2ExpVoxels * getExpVoxels ()
 
void saveResults ()
 
void setNewGeometry ()
 
int getNMaxLoops ()
 

Detailed Description

Definition at line 52 of file ML2Convergence.hh.

Constructor & Destructor Documentation

CML2Convergence::CML2Convergence ( void  )

Definition at line 46 of file ML2Convergence.cc.

47 {}
CML2Convergence::CML2Convergence ( G4int  seed,
G4int  saving_in_Selected_Voxels_every_events,
G4String  FileExperimentalData,
G4String  FileExperimentalDataOut,
G4bool  bCompareExp,
G4int  maxNumberOfEvents,
G4int  nRecycling,
G4int  nMaxLoops 
)

Definition at line 49 of file ML2Convergence.cc.

References G4endl, CML2ExpVoxels::loadData(), and CML2ExpVoxels::setRecycling().

52  :ML2ExpVoxels(0)
53 {
54  nGeometry=0;
55  nMaxLoops=maxLoops;
56  idCurrentLoop=nMaxLoops;
57  bCompareExp=bComp;
58  nAccumulatedEvents=0;
59  if (bCompareExp){nMaxLoops=-1;};
60  fileExperimentalData=FileExperimentalData;
61 
62  // if the flag compareExp if true and the experimental data is given create the class CML2ExpVoxels
63  if (bCompareExp && fileExperimentalData!="")
64  {
65  ML2ExpVoxels=new CML2ExpVoxels(bCompareExp, saveEvents, seed, FileExperimentalData, FileExperimentalDataOut);
66  if (!ML2ExpVoxels->loadData())
67  {
68  ML2ExpVoxels=0;
69  std::cout <<"I don't have any convergence criteria set, I'll do " << nMaxLoops << " loop(s) for each rotation"<< G4endl;
70  }
71  else
72  {
73  ML2ExpVoxels->setRecycling(nRecycling);
74  }
75  }
76  maxNumberOfEvents=maxNumEvents;
77 }
G4bool loadData()
Definition: ML2ExpVoxels.cc:77
void setRecycling(int recycling)
Definition: ML2ExpVoxels.hh:66
#define G4endl
Definition: G4ios.hh:61
CML2Convergence::~CML2Convergence ( void  )

Definition at line 79 of file ML2Convergence.cc.

80 {
81  if (ML2ExpVoxels!=0)
82  {delete ML2ExpVoxels;}
83 
84 }

Member Function Documentation

void CML2Convergence::add ( const G4Step *  aStep)

Definition at line 85 of file ML2Convergence.cc.

References CML2ExpVoxels::add(), and G4Step::GetTotalEnergyDeposit().

Referenced by CML2SteppingAction::UserSteppingAction().

86 {
87  // accumulate events in the CML2ExpVoxels class (if created)
88  if (ML2ExpVoxels!=0)
89  {
90  if (aStep->GetTotalEnergyDeposit()>0.)
91  {ML2ExpVoxels->add(aStep);}
92  }
93 }
G4double GetTotalEnergyDeposit() const
void add(G4ThreeVector pos, G4double depEnergy, G4double density)
CML2ExpVoxels* CML2Convergence::getExpVoxels ( )
inline

Definition at line 62 of file ML2Convergence.hh.

62 {return ML2ExpVoxels;}
G4double CML2Convergence::getMaxNumberOfEvents ( )
inline

Definition at line 61 of file ML2Convergence.hh.

61 {return maxNumberOfEvents;};
int CML2Convergence::getNMaxLoops ( )
inline

Definition at line 65 of file ML2Convergence.hh.

Referenced by CML2RunAction::BeginOfRunAction().

65 {return nMaxLoops;}
void CML2Convergence::saveResults ( )
inline

Definition at line 63 of file ML2Convergence.hh.

References CML2ExpVoxels::saveResults().

Referenced by CML2RunAction::EndOfRunAction().

63 {if (ML2ExpVoxels!=0){ML2ExpVoxels->saveResults();}}
void saveResults(void)
void CML2Convergence::setMaxNumberOfEvents ( G4int  val)
inline

Definition at line 60 of file ML2Convergence.hh.

60 {maxNumberOfEvents=val;}
void CML2Convergence::setNewGeometry ( )
inline

Definition at line 64 of file ML2Convergence.hh.

Referenced by main().

64 {nGeometry++; idCurrentLoop=nMaxLoops;}
G4bool CML2Convergence::stopRun ( )

Definition at line 94 of file ML2Convergence.cc.

Referenced by main().

95 {
96  G4bool bStopRun=false;
97  if (ML2ExpVoxels!=0) // true if the experimental data file exists and is used to check the convergence
98  {
99  bStopRun=convergenceCriteria();
100  return bStopRun;
101  }
102  else // true if no experiemental data file is used. In this case it runs "nMaxLoops" loops.
103  {
104  idCurrentLoop--;
105  if (idCurrentLoop==0)
106  {
107  bStopRun=true;
108  }
109  }
110  return bStopRun;
111 }
bool G4bool
Definition: G4Types.hh:79

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