Geant4  10.03
RMC01AnalysisManager.hh
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
28 //
29 // $Id: RMC01AnalysisManager.hh 98774 2016-08-09 14:28:06Z gcosmo $
30 //
32 // Class Name: RMC01AnalysisManager
33 // Author: L. Desorgher
34 // Organisation: SpaceIT GmbH
35 // Contract: ESA contract 21435/08/NL/AT
36 // Customer: ESA/ESTEC
38 // CHANGE HISTORY
39 //--------------
40 // ChangeHistory:
41 // 17-11-2009 creation by L. Desorgher
42 // 24-11-2009 L.Desorgher,
43 // -registering in Conv* ASCII files every 5000 events the computed
44 // edep with precision.
45 // -Correction of the adjoint computed current and answer matrices
46 // by a factor n_asked/n_processed for the case where a run is aborted
47 // because the user expected precision on e_dep has been reached.
48 // 7-11-2013 L. Desorgher, migrate to the use of G4Histo
49 //
50 //-------------------------------------------------------------
51 
52 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
53 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
54 
55 #ifndef RMC01AnalysisManager_HH
56 #define RMC01AnalysisManager_HH
57 
58 #include"G4ios.hh"
59 #include"G4strstreambuf.hh"
60 #include <vector>
61 #include"globals.hh"
62 #include <fstream>
63 #include"G4ThreeVector.hh"
64 #include"G4Event.hh"
65 #include"G4Run.hh"
66 #include "g4root.hh"
67 
68 class G4Timer;
70 
72 
73 class G4Step;
74 
75 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
76 
78 {
79 public:
80 
83 
84  void BeginOfRun(const G4Run*);
85  void EndOfRun(const G4Run*);
86  void BeginOfEvent(const G4Event*);
87  void EndOfEvent(const G4Event*);
88 
90  const G4String& particle_name,
91  G4double fluence,
94  const G4String& particle_name,G4double fluence,
95  G4double alpha, G4double Emin,G4double Emax);
96  //precision of the simulation results is given in % by the user
97  inline void SetPrecision(G4double precision){
98  fPrecision_to_reach =precision/100.;};
99 
100  //Booking and saving of histograms
101  void Book();
102  void Save(G4double scaling_factor);
103 
104 private:
105 
107 
109 
110  void EndOfEventForForwardSimulation(const G4Event* anEvent);
111  void EndOfEventForAdjointSimulation(const G4Event* anEvent);
113  /*
114  void WriteHisto(G4AnaH1* anHisto, G4double scaling_factor,
115  G4String fileName, G4String header_lines);
116  void WriteHisto(G4AnaH2* anHisto, G4double scaling_factor,
117  G4String fileName, G4String header_lines);
118  */
119  void ComputeMeanEdepAndError(const G4Event* anEvent,
120  G4double& mean,G4double& error);
121 
123 
124  //Histos for fwd simulation
125  //--------------
130 
131  //Fluence
132  //------------
133  //G4double fOmni_fluence_for_fwd_sim;
134 
135  //Variable to check the convergence of the energy deposited
136  // for forward and adjoint simulations
137  //---------------------------------------------------------
148 
149 
150  //Histos for forward and adjoint simulation
151  //-----------------------------
155 
159 
164 
167 
168 
169  //Prim spectrum to which the adjoint simulation will be normalised
170  //Answer matrices will be also registered for post processing
171  //normalisation
172  //--------------------------------------------------------
181 
182  //Timer
183  //------
186 };
187 
188 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
189 
190 #endif
G4AnaH1 * fEdep_rmatrix_vs_proton_prim_energy
void SetPrimaryPowerLawSpectrumForAdjointSim(const G4String &particle_name, G4double fluence, G4double alpha, G4double Emin, G4double Emax)
G4AnaH1 * fEdep_rmatrix_vs_electron_prim_energy
G4AnaH2 * fGamma_current_rmatrix_vs_proton_prim_energy
G4AnaH2 * fElectron_current_rmatrix_vs_electron_prim_energy
G4AnaH2 * fElectron_current_rmatrix_vs_gamma_prim_energy
void SetPrimaryExpSpectrumForAdjointSim(const G4String &particle_name, G4double fluence, G4double E0, G4double Emin, G4double Emax)
void BeginOfEvent(const G4Event *)
PRIM_SPECTRUM_TYPE fPrimSpectrumType
int G4int
Definition: G4Types.hh:78
G4AnaH2 * fProton_current_rmatrix_vs_proton_prim_energy
PRIM_SPECTRUM_TYPE
void SetPrecision(G4double precision)
bool G4bool
Definition: G4Types.hh:79
Definition: G4Run.hh:46
void EndOfRun(const G4Run *)
Definition: G4Step.hh:76
G4double PrimDiffAndDirFluxForAdjointSim(G4double prim_energy)
RMC01AnalysisManagerMessenger * fMsg
void Save(G4double scaling_factor)
void ComputeMeanEdepAndError(const G4Event *anEvent, G4double &mean, G4double &error)
G4AnaH2 * fGamma_current_rmatrix_vs_electron_prim_energy
G4AnaH2 * fElectron_current_rmatrix_vs_proton_prim_energy
static RMC01AnalysisManager * GetInstance()
void EndOfEvent(const G4Event *)
void BeginOfRun(const G4Run *)
static const G4double Emin
static const G4double Emax
tools::histo::h1d G4AnaH1
Definition: g4root_defs.hh:46
static PROLOG_HANDLER error
Definition: xmlrole.cc:112
tools::histo::h2d G4AnaH2
Definition: g4root_defs.hh:52
double G4double
Definition: G4Types.hh:76
static const G4double alpha
G4AnaH2 * fGamma_current_rmatrix_vs_gamma_prim_energy
void EndOfEventForAdjointSimulation(const G4Event *anEvent)
void EndOfEventForForwardSimulation(const G4Event *anEvent)
static RMC01AnalysisManager * fInstance
G4AnaH1 * fEdep_rmatrix_vs_gamma_prim_energy