ECCE @ EIC Software
Reference for
ECCE @ EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
RMC01AnalysisManager.hh
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file RMC01AnalysisManager.hh
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
//
31
// Class Name: RMC01AnalysisManager
32
// Author: L. Desorgher
33
// Organisation: SpaceIT GmbH
34
// Contract: ESA contract 21435/08/NL/AT
35
// Customer: ESA/ESTEC
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"
G4strstreambuf.hh
"
59
#include <vector>
60
#include"
globals.hh
"
61
#include <fstream>
62
#include"
G4ThreeVector.hh
"
63
#include"
G4Event.hh
"
64
#include"
G4Run.hh
"
65
#include "
g4root.hh
"
66
67
class
G4Timer
;
68
class
RMC01AnalysisManagerMessenger
;
69
70
enum
PRIM_SPECTRUM_TYPE
{
EXPO
,
POWER
};
71
72
class
G4Step
;
73
74
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
75
76
class
RMC01AnalysisManager
77
{
78
public
:
79
80
~RMC01AnalysisManager
();
81
static
RMC01AnalysisManager
*
GetInstance
();
82
83
void
BeginOfRun
(
const
G4Run
*);
84
void
EndOfRun
(
const
G4Run
*);
85
void
BeginOfEvent
(
const
G4Event
*);
86
void
EndOfEvent
(
const
G4Event
*);
87
88
void
SetPrimaryExpSpectrumForAdjointSim
(
89
const
G4String
& particle_name,
90
G4double
fluence,
91
G4double
E0,
G4double
Emin
,
G4double
Emax
);
92
void
SetPrimaryPowerLawSpectrumForAdjointSim
(
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
103
private
:
104
105
static
RMC01AnalysisManager
*
fInstance
;
106
107
RMC01AnalysisManager
();
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
121
RMC01AnalysisManagerMessenger
*
fMsg
;
122
123
//Histos for fwd simulation
124
//--------------
125
G4H1
*
fEdep_vs_prim_ekin
;
126
G4H1
*
fElectron_current
;
127
G4H1
*
fProton_current
;
128
G4H1
*
fGamma_current
;
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
//---------------------------------------------------------
137
G4double
fAccumulated_edep
;
138
G4double
fAccumulated_edep2
;
139
G4double
fNentry
;
140
G4double
fMean_edep
;
141
G4double
fError_mean_edep
;
142
G4double
fRelative_error
;
143
G4double
fElapsed_time
;
144
G4double
fPrecision_to_reach
;
145
G4bool
fStop_run_if_precision_reached
;
146
G4int
fNb_evt_modulo_for_convergence_test
;
147
148
149
//Histos for forward and adjoint simulation
150
//-----------------------------
151
G4H1
*
fEdep_rmatrix_vs_electron_prim_energy
;
152
G4H2
*
fElectron_current_rmatrix_vs_electron_prim_energy
;
153
G4H2
*
fGamma_current_rmatrix_vs_electron_prim_energy
;
154
155
G4H1
*
fEdep_rmatrix_vs_gamma_prim_energy
;
156
G4H2
*
fElectron_current_rmatrix_vs_gamma_prim_energy
;
157
G4H2
*
fGamma_current_rmatrix_vs_gamma_prim_energy
;
158
159
G4H1
*
fEdep_rmatrix_vs_proton_prim_energy
;
160
G4H2
*
fElectron_current_rmatrix_vs_proton_prim_energy
;
161
G4H2
*
fProton_current_rmatrix_vs_proton_prim_energy
;
162
G4H2
*
fGamma_current_rmatrix_vs_proton_prim_energy
;
163
164
G4String
fFileName
[2];
165
G4bool
fFactoryOn
;
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
//--------------------------------------------------------
172
PRIM_SPECTRUM_TYPE
fPrimSpectrumType
;
173
G4int
fPrimPDG_ID
;
174
G4double
fAlpha_or_E0
;
175
G4double
fAmplitude_prim_spectrum
;
176
G4double
fEmin_prim_spectrum
;
177
G4double
fEmax_prim_spectrum
;
178
G4bool
fAdjoint_sim_mode
;
179
G4int
fNb_evt_per_adj_evt
;
180
181
//Timer
182
//------
183
G4Timer
*
fTimer
;
184
std::fstream
fConvergenceFileOutput
;
185
};
186
187
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
188
189
#endif
geant4
tree
geant4-10.6-release
examples
extended
biasing
ReverseMC01
include
RMC01AnalysisManager.hh
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:25:02
using
1.8.2 with
ECCE GitHub integration