ECCE @ EIC Software
 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;
69 
71 
72 class G4Step;
73 
74 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
75 
77 {
78 public:
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,
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
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 
106 
108 
109  void EndOfEventForForwardSimulation(const G4Event* anEvent);
110  void EndOfEventForAdjointSimulation(const G4Event* anEvent);
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  //---------------------------------------------------------
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  //--------------------------------------------------------
180 
181  //Timer
182  //------
185 };
186 
187 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
188 
189 #endif