Geant4
10.00.p02
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
RE06ParallelWorld.cc
Go to the documentation of this file.
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
// $Id: RE06ParallelWorld.cc 75123 2013-10-28 09:53:28Z gcosmo $
30
//
31
32
#include "
RE06ParallelWorld.hh
"
33
34
#include "
G4Tubs.hh
"
35
#include "
G4LogicalVolume.hh
"
36
#include "
G4PVPlacement.hh
"
37
#include "
G4PVReplica.hh
"
38
39
#include "
G4SDManager.hh
"
40
#include "
G4MultiFunctionalDetector.hh
"
41
#include "
G4VPrimitiveScorer.hh
"
42
#include "
G4PSEnergyDeposit.hh
"
43
#include "
G4PSNofSecondary.hh
"
44
#include "
G4PSTrackLength.hh
"
45
#include "
G4PSNofStep.hh
"
46
#include "
G4PSMinKinEAtGeneration.hh
"
47
#include "
G4VSDFilter.hh
"
48
#include "
G4SDParticleFilter.hh
"
49
#include "
G4ios.hh
"
50
#include "
G4SystemOfUnits.hh
"
51
52
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
53
54
RE06ParallelWorld::RE06ParallelWorld
(
G4String
worldName)
55
:
G4VUserParallelWorld
(worldName),
56
fConstructed(false),
57
fSerial(false),
58
fTotalThickness(2.0*
m
),
59
fNumberOfLayers(20)
60
{
61
for
(
size_t
i=0;i<3;i++)
62
{
63
fCalorLogical
[i] = 0;
64
fLayerLogical
[i] = 0;
65
fCalorPhysical
[i] = 0;
66
fLayerPhysical
[i] = 0;
67
}
68
fCalName
[0] =
"Calor-AP"
;
69
fCalName
[1] =
"Calor-BP"
;
70
fCalName
[2] =
"Calor-CP"
;
71
}
72
73
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
74
75
RE06ParallelWorld::~RE06ParallelWorld
()
76
{;}
77
78
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
79
80
void
RE06ParallelWorld::Construct
()
81
{
82
if
(!
fConstructed
)
83
{
84
fConstructed
=
true
;
85
SetupGeometry
();
86
//SetupDetectors();
87
}
88
}
89
90
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
91
92
void
RE06ParallelWorld::ConstructSD
()
93
{
94
SetupDetectors
();
95
}
96
97
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
98
void
RE06ParallelWorld::SetupGeometry
()
99
{
100
//
101
// World
102
//
103
G4VPhysicalVolume
* ghostWorld =
GetWorld
();
104
G4LogicalVolume
* worldLogical = ghostWorld->
GetLogicalVolume
();
105
106
//
107
// Calorimeter
108
//
109
G4VSolid
* calorSolid
110
=
new
G4Tubs
(
"Calor"
,0.0,0.5*
m
,
fTotalThickness
/2.,0.0,360.*
deg
);
111
G4int
i;
112
for
(i=0;i<3;i++)
113
{
114
fCalorLogical
[i] =
new
G4LogicalVolume
(calorSolid,0,
fCalName
[i]);
115
if
(
fSerial
)
116
{
117
fCalorPhysical
[i] =
new
G4PVPlacement
(0,
118
G4ThreeVector
(0.,0.,
G4double
(i-1)*
fTotalThickness
),
119
fCalorLogical
[i],
fCalName
[i],worldLogical,
false
,i);
120
}
121
else
122
{
123
fCalorPhysical
[i] =
new
G4PVPlacement
(0,
124
G4ThreeVector
(0.,
G4double
(i-1)*
m
,0.),
125
fCalorLogical
[i],
fCalName
[i],worldLogical,
false
,i);
126
}
127
}
128
129
//
130
// Layers --- as absorbers
131
//
132
G4VSolid
* layerSolid
133
=
new
G4Tubs
(
"Layer"
,0.0,0.5*
m
,
fTotalThickness
/2.,0.0,360.*
deg
);
134
for
(i=0;i<3;i++)
135
{
136
fLayerLogical
[i]
137
=
new
G4LogicalVolume
(layerSolid,0,
fCalName
[i]+
"_LayerLog"
);
138
fLayerPhysical
[i]
139
=
new
G4PVReplica
(
fCalName
[i]+
"_Layer"
,
fLayerLogical
[i],
fCalorLogical
[i],
140
kRho
,
fNumberOfLayers
,0.5*
m
/
fNumberOfLayers
);
141
}
142
143
}
144
145
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
146
147
void
RE06ParallelWorld::SetupDetectors
()
148
{
149
G4SDManager::GetSDMpointer
()->
SetVerboseLevel
(1);
150
G4String
filterName, particleName;
151
152
G4SDParticleFilter
* gammaFilter
153
=
new
G4SDParticleFilter
(filterName=
"gammaFilter"
,particleName=
"gamma"
);
154
G4SDParticleFilter
* electronFilter
155
=
new
G4SDParticleFilter
(filterName=
"electronFilter"
,particleName=
"e-"
);
156
G4SDParticleFilter
* positronFilter
157
=
new
G4SDParticleFilter
(filterName=
"positronFilter"
,particleName=
"e+"
);
158
G4SDParticleFilter
* epFilter
159
=
new
G4SDParticleFilter
(filterName=
"epFilter"
);
160
epFilter->
add
(particleName=
"e-"
);
161
epFilter->
add
(particleName=
"e+"
);
162
163
for
(
G4int
i=0;i<3;i++)
164
{
165
G4String
detName =
fCalName
[i]+
"_para"
;
166
G4MultiFunctionalDetector
* det =
new
G4MultiFunctionalDetector
(detName);
167
168
G4VPrimitiveScorer
* primitive;
169
primitive =
new
G4PSEnergyDeposit
(
"eDep"
);
170
det->
RegisterPrimitive
(primitive);
171
primitive =
new
G4PSNofSecondary
(
"nGamma"
);
172
primitive->
SetFilter
(gammaFilter);
173
det->
RegisterPrimitive
(primitive);
174
primitive =
new
G4PSNofSecondary
(
"nElectron"
);
175
primitive->
SetFilter
(electronFilter);
176
det->
RegisterPrimitive
(primitive);
177
primitive =
new
G4PSNofSecondary
(
"nPositron"
);
178
primitive->
SetFilter
(positronFilter);
179
det->
RegisterPrimitive
(primitive);
180
primitive =
new
G4PSTrackLength
(
"trackLength"
);
181
primitive->
SetFilter
(epFilter);
182
det->
RegisterPrimitive
(primitive);
183
primitive =
new
G4PSNofStep
(
"nStep"
);
184
primitive->
SetFilter
(epFilter);
185
det->
RegisterPrimitive
(primitive);
186
187
G4SDManager::GetSDMpointer
()->
AddNewDetector
(det);
188
SetSensitiveDetector
(
fLayerLogical
[i], det);
189
}
190
G4SDManager::GetSDMpointer
()->
SetVerboseLevel
(0);
191
192
}
193
194
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
195
196
void
RE06ParallelWorld::SetSerialGeometry
(
G4bool
serial)
197
{
198
if
(
fSerial
==serial)
return
;
199
fSerial
=serial;
200
if
(!
fConstructed
)
return
;
201
for
(
G4int
i=0;i<3;i++)
202
{
203
if
(
fSerial
)
204
{
205
fCalorPhysical
[i]
206
->
SetTranslation
(
G4ThreeVector
(0.,0.,
G4double
(i-1)*2.*
m
));
207
}
208
else
209
{
210
fCalorPhysical
[i]
211
->
SetTranslation
(
G4ThreeVector
(0.,
G4double
(i-1)*
m
,0.));
212
}
213
}
214
}
215
216
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4MultiFunctionalDetector::RegisterPrimitive
G4bool RegisterPrimitive(G4VPrimitiveScorer *)
Definition:
G4MultiFunctionalDetector.cc:57
G4PSNofStep
Definition:
G4PSNofStep.hh:46
G4PSTrackLength.hh
RE06ParallelWorld::fCalName
G4String fCalName[3]
Definition:
RE06ParallelWorld.hh:61
G4PSNofStep.hh
G4MultiFunctionalDetector.hh
G4ThreeVector
CLHEP::Hep3Vector G4ThreeVector
Definition:
G4ThreeVector.hh:42
G4PVPlacement
Definition:
G4PVPlacement.hh:51
G4VUserParallelWorld::GetWorld
G4VPhysicalVolume * GetWorld()
Definition:
G4VUserParallelWorld.cc:48
G4VPhysicalVolume
Definition:
G4VPhysicalVolume.hh:80
G4SDManager::SetVerboseLevel
void SetVerboseLevel(G4int vl)
Definition:
G4SDManager.hh:90
G4Tubs
Definition:
G4Tubs.hh:85
G4VSDFilter.hh
G4VPrimitiveScorer::SetFilter
void SetFilter(G4VSDFilter *f)
Definition:
G4VPrimitiveScorer.hh:105
RE06ParallelWorld::ConstructSD
virtual void ConstructSD()
Definition:
RE06ParallelWorld.cc:92
RE06ParallelWorld::SetupDetectors
void SetupDetectors()
Definition:
RE06ParallelWorld.cc:147
G4PSMinKinEAtGeneration.hh
RE06ParallelWorld.hh
Definition of the RE06ParallelWorld class.
RE06ParallelWorld::RE06ParallelWorld
RE06ParallelWorld(G4String worldName)
Definition:
RE06ParallelWorld.cc:54
RE06ParallelWorld::SetSerialGeometry
void SetSerialGeometry(G4bool ser)
Definition:
RE06ParallelWorld.cc:196
G4VUserParallelWorld
Definition:
G4VUserParallelWorld.hh:48
G4PSNofSecondary
Definition:
G4PSNofSecondary.hh:53
RE06ParallelWorld::fSerial
G4bool fSerial
Definition:
RE06ParallelWorld.hh:63
G4MultiFunctionalDetector
Definition:
G4MultiFunctionalDetector.hh:48
G4int
int G4int
Definition:
G4Types.hh:78
G4VPrimitiveScorer.hh
G4PVReplica
Definition:
G4PVReplica.hh:119
G4VUserParallelWorld::SetSensitiveDetector
void SetSensitiveDetector(const G4String &logVolName, G4VSensitiveDetector *aSD, G4bool multi=false)
Definition:
G4VUserParallelWorld.cc:58
RE06ParallelWorld::Construct
virtual void Construct()
Definition:
RE06ParallelWorld.cc:80
G4VSolid
Definition:
G4VSolid.hh:87
RE06ParallelWorld::SetupGeometry
void SetupGeometry()
Definition:
RE06ParallelWorld.cc:98
G4SDManager.hh
G4Tubs.hh
deg
static const double deg
Definition:
G4SIunits.hh:133
RE06ParallelWorld::fTotalThickness
G4double fTotalThickness
Definition:
RE06ParallelWorld.hh:64
G4bool
bool G4bool
Definition:
G4Types.hh:79
RE06ParallelWorld::fLayerLogical
G4LogicalVolume * fLayerLogical[3]
Definition:
RE06ParallelWorld.hh:58
G4VPhysicalVolume::SetTranslation
void SetTranslation(const G4ThreeVector &v)
G4VPrimitiveScorer
Definition:
G4VPrimitiveScorer.hh:50
G4LogicalVolume
Definition:
G4LogicalVolume.hh:187
RE06ParallelWorld::fNumberOfLayers
G4int fNumberOfLayers
Definition:
RE06ParallelWorld.hh:65
G4PSNofSecondary.hh
RE06ParallelWorld::fCalorLogical
G4LogicalVolume * fCalorLogical[3]
Definition:
RE06ParallelWorld.hh:57
G4SDManager::AddNewDetector
void AddNewDetector(G4VSensitiveDetector *aSD)
Definition:
G4SDManager.cc:67
G4PSEnergyDeposit
Definition:
G4PSEnergyDeposit.hh:45
G4LogicalVolume.hh
G4VPhysicalVolume::GetLogicalVolume
G4LogicalVolume * GetLogicalVolume() const
G4SDParticleFilter::add
void add(const G4String &particleName)
Definition:
G4SDParticleFilter.cc:132
G4SDManager::GetSDMpointer
static G4SDManager * GetSDMpointer()
Definition:
G4SDManager.cc:40
G4SDParticleFilter.hh
G4ios.hh
G4SDParticleFilter
Definition:
G4SDParticleFilter.hh:53
G4PVReplica.hh
G4PSEnergyDeposit.hh
G4PSTrackLength
Definition:
G4PSTrackLength.hh:49
m
static const double m
Definition:
G4SIunits.hh:110
G4double
double G4double
Definition:
G4Types.hh:76
RE06ParallelWorld::~RE06ParallelWorld
virtual ~RE06ParallelWorld()
Definition:
RE06ParallelWorld.cc:75
kRho
Definition:
geomdefs.hh:54
G4SystemOfUnits.hh
G4PVPlacement.hh
RE06ParallelWorld::fLayerPhysical
G4VPhysicalVolume * fLayerPhysical[3]
Definition:
RE06ParallelWorld.hh:60
RE06ParallelWorld::fCalorPhysical
G4VPhysicalVolume * fCalorPhysical[3]
Definition:
RE06ParallelWorld.hh:59
G4String
Definition:
G4String.hh:45
RE06ParallelWorld::fConstructed
G4bool fConstructed
Definition:
RE06ParallelWorld.hh:62
geant4.10.00.p02
examples
extended
runAndEvent
RE06
src
RE06ParallelWorld.cc
Generated on Thu Dec 31 2015 10:39:54 for Geant4 by
1.8.8