47 #include "HistoManager.hh"
62 #include "HistoManagerMessenger.hh"
69 fHistoName =
"hadr00";
75 fParticleName =
"proton";
78 fMinKinEnergy = 0.1*
MeV;
79 fMaxKinEnergy = 10*
TeV;
81 fMaxMomentum = 10*
TeV;
105 fAnalysisManager = G4AnalysisManager::Instance();
106 fAnalysisManager->OpenFile(fHistoName+
".root");
107 fAnalysisManager->SetFirstHistoId(1);
109 fAnalysisManager->CreateH1(
"h1",
110 "Elastic cross section (barn) as a functions of log10(p/GeV)",
112 fAnalysisManager->CreateH1(
"h2",
113 "Elastic cross section (barn) as a functions of log10(E/MeV)",
115 fAnalysisManager->CreateH1(
"h3",
116 "Inelastic cross section (barn) as a functions of log10(p/GeV)",
118 fAnalysisManager->CreateH1(
"h4",
119 "Inelastic cross section (barn) as a functions of log10(E/MeV)",
121 fAnalysisManager->CreateH1(
"h5",
122 "Capture cross section (barn) as a functions of log10(E/MeV)",
124 fAnalysisManager->CreateH1(
"h6",
125 "Fission cross section (barn) as a functions of log10(E/MeV)",
127 fAnalysisManager->CreateH1(
"h7",
128 "Charge exchange cross section (barn) as a functions of log10(E/MeV)",
130 fAnalysisManager->CreateH1(
"h8",
131 "Total cross section (barn) as a functions of log10(E/MeV)",
140 G4cout <<
"HistoManager: End of run actions are started" <<
G4endl;
150 G4cout <<
"### Fill Cross Sections for " << fParticleName
151 <<
" off " << fElementName
154 G4cout <<
"-------------------------------------------------------------"
156 G4cout <<
" N E(MeV) Elastic(b) Inelastic(b)";
157 if(particle == fNeutron) {
G4cout <<
" Capture(b) Fission(b)"; }
159 G4cout <<
"-------------------------------------------------------------"
162 if(!particle || !elm) {
163 G4cout <<
"HistoManager WARNING Particle or element undefined" <<
G4endl;
185 for(i=0; i<fBinsE; i++) {
187 e = std::pow(10.,x)*
MeV;
188 if(fVerbose>0)
G4cout << std::setw(5) << i << std::setw(12) << e;
191 if(fVerbose>0)
G4cout << std::setw(12) << xs/
barn;
192 fAnalysisManager->FillH1(2, x, xs/
barn);
195 if(fVerbose>0)
G4cout <<
" " << std::setw(12) << xs/
barn;
196 fAnalysisManager->FillH1(4, x, xs/
barn);
197 if(particle == fNeutron) {
200 if(fVerbose>0)
G4cout <<
" " << std::setw(12) << xs/
barn;
201 fAnalysisManager->FillH1(5, x, xs/
barn);
204 if(fVerbose>0)
G4cout <<
" " << std::setw(12) << xs/
barn;
205 fAnalysisManager->FillH1(6, x, xs/
barn);
209 fAnalysisManager->FillH1(7, x, xs/
barn);
210 fAnalysisManager->FillH1(8, x, xtot/
barn);
214 for(i=0; i<fBinsP; i++) {
216 p = std::pow(10.,x)*
GeV;
217 e = std::sqrt(p*p + mass*mass) - mass;
219 fAnalysisManager->FillH1(1, x, xs/
barn);
221 fAnalysisManager->FillH1(3, x, xs/
barn);
224 G4cout <<
"-------------------------------------------------------------"
228 fAnalysisManager->Write();
229 fAnalysisManager->CloseFile();
231 delete fAnalysisManager;
G4Material * FindOrBuildMaterial(const G4String &name, G4bool isotopes=true, G4bool warning=false)
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
static G4HadronicProcessStore * Instance()
G4double GetElasticCrossSectionPerAtom(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4Element *anElement, const G4Material *mat=0)
G4double GetFissionCrossSectionPerAtom(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4Element *anElement, const G4Material *mat=0)
static G4NistManager * Instance()
static constexpr double TeV
G4GLOB_DLL std::ostream G4cout
G4double GetInelasticCrossSectionPerAtom(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4Element *anElement, const G4Material *mat=0)
G4double GetChargeExchangeCrossSectionPerAtom(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4Element *anElement, const G4Material *mat=0)
static G4Neutron * Neutron()
G4double GetPDGMass() const
static G4ParticleTable * GetParticleTable()
static constexpr double GeV
void SetVerbose(G4int val)
static constexpr double MeV
static constexpr double barn
G4Element * FindOrBuildElement(G4int Z, G4bool isotopes=true)
G4double GetCaptureCrossSectionPerAtom(const G4ParticleDefinition *aParticle, G4double kineticEnergy, const G4Element *anElement, const G4Material *mat=0)