Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
geant4-projects
cosmic-rays
Commits
db97b21f
Commit
db97b21f
authored
Jul 15, 2019
by
MARCOS ANTONIO DE OLIVEIRA DEROS
Browse files
2 functions added
parent
d81f9487
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/B1RunAction.cc
View file @
db97b21f
...
...
@@ -30,6 +30,7 @@
#include "B1RunAction.hh"
#include "B1PrimaryGeneratorAction.hh"
#include "B1DetectorConstruction.hh"
#include "B1SteppingAction.hh"
// #include "B1Run.hh"
// Adicionando header de análise de dados:
#include "B1Analysis.hh"
...
...
@@ -41,6 +42,7 @@
#include "G4UnitsTable.hh"
#include "G4SystemOfUnits.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
B1RunAction
::
B1RunAction
()
...
...
@@ -75,10 +77,7 @@ B1RunAction::~B1RunAction()
void
B1RunAction
::
BeginOfRunAction
(
const
G4Run
*
)
{
//chamar o "Analysis manager"
auto
analysisManager
=
G4AnalysisManager
::
Instance
();
//abre um arquivo de saída. OpenFIle(Nome do arquivo)
analysisManager
->
OpenFile
(
"B1"
);
createHistogram
();
// inform the runManager to save random number seed
G4RunManager
::
GetRunManager
()
->
SetRandomNumberStore
(
false
);
...
...
@@ -155,9 +154,8 @@ void B1RunAction::EndOfRunAction(const G4Run* run)
<<
G4endl
;
//salva os histogramas
auto
analysisManager
=
G4AnalysisManager
::
Instance
();
analysisManager
->
Write
();
analysisManager
->
CloseFile
();
WriteHistogram
();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
...
...
@@ -168,5 +166,35 @@ void B1RunAction::AddEdep(G4double edep)
fEdep2
+=
edep
*
edep
;
}
void
B1RunAction
::
createHistogram
()
{
//Avisa que está criando
G4cout
<<
"CRIANDO HISTOGRAMAS"
<<
G4endl
;
G4AnalysisManager
*
analysisManager
=
G4AnalysisManager
::
Instance
();
//mostrando o tipo
G4cout
<<
"utilizando "
<<
analysisManager
->
GetType
()
<<
"Analysis Manager"
<<
G4endl
;
//setando o verbose
analysisManager
->
SetVerboseLevel
(
1
);
//Abrindo arquivo de saída
G4String
filename
=
"air_shower"
;
analysisManager
->
OpenFile
(
filename
);
//criando ntuples
}
void
B1RunAction
::
WriteHistogram
()
{
G4cout
<<
"ESCREVENDO"
<<
G4endl
;
G4AnalysisManager
*
analysisManager
=
G4AnalysisManager
::
Instance
();
//salvando ghistogramas
analysisManager
->
Write
();
analysisManager
->
CloseFile
();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment