35 #include "DetectorConstruction.hh"
36 #include "PrimaryGeneratorAction.hh"
37 #include "HistoManager.hh"
53 fDetector(det),fParticle(0),
78 const Run* localRun =
static_cast<const Run*
>(run);
90 for (
unsigned int i = 0; i < localRun->
fluence.size(); i++)
93 catch(
const std::out_of_range& oor)
97 for (
unsigned int i = 0; i < localRun->
fluence1.size(); i++)
100 catch(
const std::out_of_range& oor)
104 for (
unsigned int i = 0; i < localRun->
fluence2.size(); i++)
107 catch(
const std::out_of_range& oor)
111 for (
unsigned int i = 0; i < localRun->
fNbEntries.size(); i++)
114 catch(
const std::out_of_range& oor)
137 G4cout <<
"\n ======================== run summary ======================\n";
144 << material->
GetName() <<
" (density: "
153 analysisManager->ScaleH1(1,fac);
154 analysisManager->ScaleH1(2,fac);
155 analysisManager->ScaleH1(3,fac);
156 analysisManager->ScaleH1(5,fac);
157 analysisManager->ScaleH1(6,fac);
172 analysisManager->SetH1(ih, 120, 0*
mm, 240*
mm,
"mm");
176 fNbBins = analysisManager->GetH1Nbins(ih);
177 fDr = analysisManager->GetH1Width(ih);
213 if(variance > 0.) rms = std::sqrt(variance);
229 G4double err0 = fnorm2/fnorm, err1 = 0.;
238 error = ratio*std::sqrt(err1*err1 + err0*err0);
244 analysisManager->FillH1(4,rmean,ratio);
256 G4String fileName = name +
".ascii";
257 std::ofstream File(fileName, std::ios::out);
259 std::ios::fmtflags mode = File.flags();
260 File.setf( std::ios::scientific, std::ios::floatfield );
261 G4int prec = File.precision(3);
263 File <<
" Fluence density distribution \n "
264 <<
"\n ibin \t radius (mm) \t Nb \t fluence\t norma fl\t rms/nfl (%) \n"
279 File.setf(mode,std::ios::floatfield);
280 File.precision(prec);
void SumFluence(G4double, G4double)
G4double GetThicknessScatter()
void SetPrimary(G4ParticleDefinition *particle, G4double energy)
DetectorConstruction * fDetector
static constexpr double mm
void ComputeFluenceError()
const G4String & GetParticleName() const
G4Material * GetMaterialScatter()
const G4String & GetName() const
std::vector< G4double > fluence1
static constexpr double twopi
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)
virtual void Merge(const G4Run *)
G4CsvAnalysisManager G4AnalysisManager
std::vector< G4int > fNbEntries
std::vector< G4double > fluence2
G4ParticleDefinition * fParticle
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
static const G4double fac
G4GLOB_DLL std::ostream G4cout
std::vector< G4double > fluence
static PROLOG_HANDLER error
virtual void Merge(const G4Run *)
Simple detector construction with a box volume placed in a world.
G4double GetDensity() const