Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
GeoModel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GeoModelDev
GeoModel
Commits
1bb8a192
Commit
1bb8a192
authored
4 years ago
by
Vangelis Kourlitis
Browse files
Options
Downloads
Patches
Plain Diff
init devs to write out steps statistics. create root file
parent
19650e25
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
FullSimLight/include/MyRunAction.hh
+5
-1
5 additions, 1 deletion
FullSimLight/include/MyRunAction.hh
FullSimLight/src/MyRunAction.cc
+35
-2
35 additions, 2 deletions
FullSimLight/src/MyRunAction.cc
with
40 additions
and
3 deletions
FullSimLight/include/MyRunAction.hh
+
5
−
1
View file @
1bb8a192
...
...
@@ -16,7 +16,7 @@ class MyRunAction: public G4UserRunAction {
public:
MyRunAction
(
bool
isGeantino
,
G4String
geantinoMapsFileName
=
"geantinoMaps.root"
);
MyRunAction
(
bool
isGeantino
,
G4String
geantinoMapsFileName
=
"geantinoMaps.root"
,
bool
isStepStats
=
false
,
G4String
stepStatsFilename
=
"stepStats.root"
);
virtual
~
MyRunAction
();
virtual
G4Run
*
GenerateRun
();
...
...
@@ -28,9 +28,11 @@ public:
private
:
G4bool
fIsPerformance
;
G4bool
fIsGeantino
;
G4bool
fIsStepStats
;
MyRun
*
fRun
;
G4Timer
*
fTimer
;
G4String
fGeantinoMapsFilename
;
G4String
fStepStatsFilename
;
//TO DO: make private and add Get methods
...
...
@@ -45,6 +47,8 @@ public:
int
fEtaRad_id
;
// ID of the Eta IntLen 1D Profile
int
fEtaInt_id
;
// ID of the ZRSteps 2D Histogram
int
fStepHeatMap_id
;
};
#endif
This diff is collapsed.
Click to expand it.
FullSimLight/src/MyRunAction.cc
+
35
−
2
View file @
1bb8a192
...
...
@@ -18,12 +18,12 @@
G4AnalysisManager
*
MyRunAction
::
fMasterAnalysisManager
=
nullptr
;
MyRunAction
::
MyRunAction
(
bool
isGeantino
,
G4String
geantinoMapFilename
)
:
G4UserRunAction
(),
fIsPerformance
(
false
),
fIsGeantino
(
isGeantino
),
fRun
(
nullptr
),
fTimer
(
nullptr
),
fGeantinoMapsFilename
(
geantinoMapFilename
){
MyRunAction
::
MyRunAction
(
bool
isGeantino
,
G4String
geantinoMapFilename
,
bool
isStepStats
,
G4String
stepStatsFilename
)
:
G4UserRunAction
(),
fIsPerformance
(
false
),
fIsGeantino
(
isGeantino
),
fIsStepStats
(
isStepStats
),
fRun
(
nullptr
),
fTimer
(
nullptr
),
fGeantinoMapsFilename
(
geantinoMapFilename
)
,
fStepStatsFilename
(
stepStatsFilename
)
{
}
MyRunAction
::~
MyRunAction
()
{
if
(
fIsGeantino
)
if
(
fIsGeantino
||
fIsStepStats
)
delete
G4AnalysisManager
::
Instance
();
}
...
...
@@ -98,6 +98,39 @@ void MyRunAction::BeginOfRunAction(const G4Run* /*aRun*/){
}
}
if
(
fIsStepStats
)
{
// Create analysis manager
G4AnalysisManager
*
analysisManager
=
G4AnalysisManager
::
Instance
();
if
(
isMaster
)
{
fMasterAnalysisManager
=
analysisManager
;
//G4cout<<"MyRunAction::BeginOfRunAction, created MASTER istance of the G4AnalysisManager: "<<fMasterAnalysisManager<<G4endl;
}
//else
// G4cout<<"MyRunAction::BeginOfRunAction, created WORKER istance of the G4AnalysisManager: "<<analysisManager<<G4endl;
G4cout
<<
"Using G4AnalysisManager type: "
<<
analysisManager
->
GetType
()
<<
G4endl
;
analysisManager
->
SetVerboseLevel
(
1
);
// Open output root file
G4cout
<<
"
\n\n
BeginOfRunAction:
\n
...create a root file using the G4AnalysisManager"
<<
G4endl
;
if
(
!
analysisManager
->
OpenFile
(
fStepStatsFilename
)){
G4cout
<<
"
\n
BeginOfRunAction ERROR: File cannot be opened!"
<<
G4endl
;
exit
(
-
1
);
}
else
G4cout
<<
"
\n
...output File "
<<
fStepStatsFilename
<<
" opened!"
<<
G4endl
;
const
char
*
stepHeatMapName
=
"ZRSteps"
;
if
(
analysisManager
->
GetH2Id
(
stepHeatMapName
,
false
)
<
0
)
{
fStepHeatMap_id
=
analysisManager
->
CreateH2
(
stepHeatMapName
,
stepHeatMapName
,
1000
,
-
25000.
,
25000.
,
2000
,
0.
,
15000.
);
// G4cout<<"MyRunAction::BeginOfRunAction: G4AnalysisManager Created ZRSteps 2DHistogram with name: "<<stepHeatMapName<< " and with id: "<<fStepHeatMap_id<<G4endl;
analysisManager
->
SetH2XAxisTitle
(
fStepHeatMap_id
,
"Z[mm]"
);
analysisManager
->
SetH2YAxisTitle
(
fStepHeatMap_id
,
"R[mm]"
);
analysisManager
->
SetH2ZAxisTitle
(
fStepHeatMap_id
,
"NumberOfSteps"
);
}
}
if
(
isMaster
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment