Loading...
Searching...
No Matches
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//
26/// \file biasing/ReverseMC01/include/RMC01AnalysisManager.hh
27/// \brief Definition of the RMC01AnalysisManager class
28//
29//
30//////////////////////////////////////////////////////////////
31// Class Name: RMC01AnalysisManager
32// Author: L. Desorgher
33// Organisation: SpaceIT GmbH
34// Contract: ESA contract 21435/08/NL/AT
35// Customer: ESA/ESTEC
36//////////////////////////////////////////////////////////////
37// CHANGE HISTORY
38//--------------
39// ChangeHistory:
40// 17-11-2009 creation by L. Desorgher
41// 24-11-2009 L.Desorgher,
42// -registering in Conv* ASCII files every 5000 events the computed
43// edep with precision.
44// -Correction of the adjoint computed current and answer matrices
45// by a factor n_asked/n_processed for the case where a run is aborted
46// because the user expected precision on e_dep has been reached.
47// 7-11-2013 L. Desorgher, migrate to the use of G4Histo
48//
49//-------------------------------------------------------------
50
51//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
52//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
53
54#ifndef RMC01AnalysisManager_HH
55#define RMC01AnalysisManager_HH
56
57#include"G4ios.hh"
58#include <vector>
59#include"globals.hh"
60#include <fstream>
61#include"G4ThreeVector.hh"
62#include"G4Event.hh"
63#include"G4Run.hh"
64#include"G4AnalysisManager.hh"
65#include"g4hntools_defs.hh"
66
67class G4Timer;
69
71
72class G4Step;
73
74//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
75
77{
78public:
79
82
83 void BeginOfRun(const G4Run*);
84 void EndOfRun(const G4Run*);
85 void BeginOfEvent(const G4Event*);
86 void EndOfEvent(const G4Event*);
87
89 const G4String& particle_name,
90 G4double fluence,
91 G4double E0, G4double Emin,G4double Emax);
93 const G4String& particle_name,G4double fluence,
94 G4double alpha, G4double Emin,G4double Emax);
95 //precision of the simulation results is given in % by the user
96 inline void SetPrecision(G4double precision){
97 fPrecision_to_reach =precision/100.;};
98
99 //Booking and saving of histograms
100 void Book();
101 void Save(G4double scaling_factor);
102
103private:
104
106
108
109 void EndOfEventForForwardSimulation(const G4Event* anEvent);
110 void EndOfEventForAdjointSimulation(const G4Event* anEvent);
111 G4double PrimDiffAndDirFluxForAdjointSim(G4double prim_energy);
112 /*
113 void WriteHisto(G4H1* anHisto, G4double scaling_factor,
114 G4String fileName, G4String header_lines);
115 void WriteHisto(G4H2* anHisto, G4double scaling_factor,
116 G4String fileName, G4String header_lines);
117 */
118 void ComputeMeanEdepAndError(const G4Event* anEvent,
119 G4double& mean,G4double& error);
120
122
123 //Histos for fwd simulation
124 //--------------
129
130 //Fluence
131 //------------
132 //G4double fOmni_fluence_for_fwd_sim;
133
134 //Variable to check the convergence of the energy deposited
135 // for forward and adjoint simulations
136 //---------------------------------------------------------
139 G4double fNentry;
140 G4double fMean_edep;
147
148
149 //Histos for forward and adjoint simulation
150 //-----------------------------
154
158
163
166
167
168 //Prim spectrum to which the adjoint simulation will be normalised
169 //Answer matrices will be also registered for post processing
170 //normalisation
171 //--------------------------------------------------------
174 G4double fAlpha_or_E0;
180
181 //Timer
182 //------
185};
186
187//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
188
189#endif
void EndOfEvent(const G4Event *)
static RMC01AnalysisManager * fInstance
void Save(G4double scaling_factor)
void EndOfRun(const G4Run *)
void SetPrecision(G4double precision)
void EndOfEventForForwardSimulation(const G4Event *anEvent)
void SetPrimaryPowerLawSpectrumForAdjointSim(const G4String &particle_name, G4double fluence, G4double alpha, G4double Emin, G4double Emax)
void EndOfEventForAdjointSimulation(const G4Event *anEvent)
G4H2 * fGamma_current_rmatrix_vs_electron_prim_energy
static RMC01AnalysisManager * GetInstance()
RMC01AnalysisManagerMessenger * fMsg
G4double PrimDiffAndDirFluxForAdjointSim(G4double prim_energy)
G4H2 * fGamma_current_rmatrix_vs_proton_prim_energy
void BeginOfRun(const G4Run *)
G4H2 * fElectron_current_rmatrix_vs_proton_prim_energy
void ComputeMeanEdepAndError(const G4Event *anEvent, G4double &mean, G4double &error)
PRIM_SPECTRUM_TYPE fPrimSpectrumType
G4H2 * 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 *)
G4H2 * fProton_current_rmatrix_vs_proton_prim_energy
G4H2 * fElectron_current_rmatrix_vs_electron_prim_energy

Applications | User Support | Publications | Collaboration