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
Analysis.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file Analysis.cc
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
//
26
//
29
30
//#include "TFile.h"
31
//#include "TH1.h"
32
//#include "TH2.h"
33
//#include "TROOT.h"
34
#include "
G4AutoDelete.hh
"
35
#include "
G4SystemOfUnits.hh
"
36
#include "Analysis.hh"
37
38
//Select format of output here
39
#include "
g4root.hh
"
40
G4ThreadLocal
G4int
Analysis::fincidentFlag
=
false
;
41
G4ThreadLocal
Analysis
*
the_analysis
= 0;
42
43
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
44
Analysis
*
45
Analysis::GetAnalysis
()
46
{
47
if
(!
the_analysis
)
48
{
49
the_analysis
=
new
Analysis
();
50
G4AutoDelete::Register
(
the_analysis
);
51
}
52
return
the_analysis
;
53
}
54
55
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
56
Analysis::Analysis
() :
57
fincident_x_hist(0), fincident_map(0), fdose_hist(0), fdose_map(0),
58
fdose_prof(0), fdose_map_prof(0), fdose_map3d(0)
59
{
60
}
61
62
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
63
void
64
Analysis::Book
()
65
{
66
G4AnalysisManager
* mgr =
G4AnalysisManager::Instance
();
67
//mgr->SetVerboseLevel(1);
68
fincident_x_hist
= mgr->
CreateH1
(
"incident_x"
,
"Incident X"
, 100, -5 *
cm
,
69
5 *
cm
,
"cm"
);
70
fincident_map
= mgr->
CreateH2
(
"incident_map"
,
"Incident Map"
, 50, -5 *
cm
,
71
5 *
cm
, 50, -5 *
cm
, 5 *
cm
,
"cm"
,
"cm"
);
72
fdose_hist
73
= mgr->
CreateH1
(
"dose"
,
"Dose distribution"
, 500, 0, 50 *
cm
,
"cm"
);
74
fdose_map
= mgr->
CreateH2
(
"dose_map"
,
"Dose distribution"
, 500, 0, 50 *
cm
,
75
200, -10 *
cm
, 10 *
cm
,
"cm"
,
"cm"
);
76
fdose_map3d
= mgr->
CreateH3
(
"dose_map_3d"
,
"Dose distribution"
, 30, 0,
77
50 *
cm
, 20, -10 *
cm
, 10 *
cm
, 20, -10 *
cm
, 10 *
cm
,
"cm"
,
"cm"
,
"cm"
);
78
fdose_prof
= mgr->
CreateP1
(
"dose_prof"
,
"Dose distribution"
, 300, 0, 30 *
cm
,
79
0, 100 *
MeV
,
"cm"
,
"MeV"
);
80
fdose_map_prof
= mgr->
CreateP2
(
"dose_map_prof"
,
"Dose distribution"
, 300, 0,
81
30 *
cm
, 80, -4 *
cm
, 4 *
cm
, 0, 100 *
MeV
,
"cm"
,
"cm"
,
"MeV"
);
82
83
}
84
85
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
86
Analysis::~Analysis
()
87
{
88
}
89
90
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
91
void
92
Analysis::Update
()
93
{
94
return
;
95
}
96
97
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
98
void
99
Analysis::Clear
()
100
{
101
return
;
102
}
103
104
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
105
void
106
Analysis::Save
(
const
G4String
&
fname
)
107
{
108
G4AnalysisManager
* mgr =
G4AnalysisManager::Instance
();
109
mgr->
OpenFile
(fname.c_str());
110
mgr->
Write
();
111
return
;
112
}
113
114
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
115
void
116
Analysis::Close
(
G4bool
reset)
117
{
118
G4AnalysisManager
* mgr =
G4AnalysisManager::Instance
();
119
mgr->
CloseFile
(reset);
120
return
;
121
}
122
123
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
124
void
125
Analysis::FillIncident
(
const
G4ThreeVector
&
p
)
126
{
127
if
(!
fincidentFlag
)
128
{
129
G4AnalysisManager
* mgr =
G4AnalysisManager::Instance
();
130
mgr->
FillH2
(
fincident_map
, p.
x
(), p.
y
());
131
mgr->
FillH1
(
fincident_x_hist
, p.
x
());
132
fincidentFlag
=
true
;
133
}
134
}
135
136
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
137
void
138
Analysis::FillDose
(
const
G4ThreeVector
& p,
G4double
dedx)
139
{
140
const
G4double
dxy = 10. *
mm
;
141
if
(
std::abs
(p.
y
()) < dxy)
142
{
143
G4AnalysisManager
* mgr =
G4AnalysisManager::Instance
();
144
const
G4double
Z0 = 25. *
cm
;
145
146
mgr->
FillH2
(
fdose_map
, p.
z
() + Z0, p.
x
(), dedx /
GeV
);
147
mgr->
FillP2
(
fdose_map_prof
, p.
z
() + Z0, p.
x
(), dedx);
148
mgr->
FillH3
(
fdose_map3d
, p.
z
() + Z0, p.
x
(), p.
y
(), dedx /
GeV
);
149
if
(
std::abs
(p.
x
()) < dxy)
150
{
151
mgr->
FillH1
(
fdose_hist
, p.
z
() + Z0, dedx /
GeV
);
152
mgr->
FillP1
(
fdose_prof
, p.
z
() + Z0, dedx);
153
}
154
}
155
156
}
geant4
tree
geant4-10.6-release
examples
extended
parallel
MPI
examples
exMPI03
src
Analysis.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:25:09
using
1.8.2 with
ECCE GitHub integration