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
F04ElementField.hh
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file F04ElementField.hh
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
31
#ifndef F04ElementField_h
32
#define F04ElementField_h 1
33
34
#include "
globals.hh
"
35
36
#include "
G4Navigator.hh
"
37
#include "
G4TransportationManager.hh
"
38
39
#include "
G4UserLimits.hh
"
40
#include "
G4VisAttributes.hh
"
41
42
// class F04ElementField - interface for the EM field of one element
43
44
// This is the interface class used by GlobalField to compute the field
45
// value at a given point[].
46
47
// An element that represents an element with an EM field will
48
// derive a class from this one and implement the computation for the
49
// element. The Construct() function will add the derived object into
50
// GlobalField.
51
52
class
F04ElementField
53
{
54
55
private
:
56
57
F04ElementField
&
operator=
(
const
F04ElementField
&);
58
59
public
:
60
62
F04ElementField
(
const
G4ThreeVector
,
G4LogicalVolume
*);
63
65
void
Construct
();
66
68
virtual
~F04ElementField
() {}
69
71
void
SetMaxStep
(
G4double
stp)
72
{
73
fMaxStep
= stp;
74
fUserLimits
->
SetMaxAllowedStep
(
fMaxStep
);
75
fVolume
->
SetUserLimits
(
fUserLimits
);
76
}
77
79
G4double
GetMaxStep
() {
return
fMaxStep
; }
80
82
void
SetColor
(
G4String
c
)
83
{
84
fColor
=
c
;
85
fVolume
->
SetVisAttributes
(
GetVisAttribute
(
fColor
));
86
}
87
89
G4String
GetColor
() {
return
fColor
; }
90
92
static
G4VisAttributes
*
GetVisAttribute
(
G4String
color
);
93
100
void
SetGlobalPoint
(
const
G4double
point
[4])
101
{
102
if
(
fMinX
== -
DBL_MAX
||
fMinX
> point[0])
fMinX
= point[0];
103
if
(
fMinY
== -
DBL_MAX
||
fMinY
> point[1])
fMinY
= point[1];
104
if
(
fMinZ
== -
DBL_MAX
||
fMinZ
> point[2])
fMinZ
= point[2];
105
if
(
fMaxX
==
DBL_MAX
||
fMaxX
< point[0])
fMaxX
= point[0];
106
if
(
fMaxY
==
DBL_MAX
||
fMaxY
< point[1])
fMaxY
= point[1];
107
if
(
fMaxZ
==
DBL_MAX
||
fMaxZ
< point[2])
fMaxZ
= point[2];
108
}
109
112
bool
IsInBoundingBox
(
const
G4double
point
[4])
const
113
{
114
if
(point[2] <
fMinZ
|| point[2] >
fMaxZ
)
return
false
;
115
if
(point[0] <
fMinX
|| point[0] >
fMaxX
)
return
false
;
116
if
(point[1] <
fMinY
|| point[1] >
fMaxY
)
return
false
;
117
return
true
;
118
}
119
128
virtual
void
129
AddFieldValue
(
const
G4double
point
[4],
G4double
field[6])
const
= 0;
130
131
virtual
G4double
GetLength
() = 0;
132
virtual
G4double
GetWidth
() = 0;
133
virtual
G4double
GetHeight
() = 0;
134
135
protected
:
136
137
G4LogicalVolume
*
fVolume
;
138
139
G4AffineTransform
fGlobal2local
;
140
141
// F04ElementField(const F04ElementField&);
142
143
private
:
144
145
static
G4ThreadLocal
G4Navigator
*
fNavigator
;
146
147
G4String
fColor
;
148
149
G4ThreeVector
fCenter
;
150
G4double
fMinX
,
fMinY
,
fMinZ
,
fMaxX
,
fMaxY
,
fMaxZ
;
151
152
G4double
fMaxStep
;
153
G4UserLimits
*
fUserLimits
;
154
155
};
156
157
#endif
geant4
tree
geant4-10.6-release
examples
extended
field
field04
include
F04ElementField.hh
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:25:05
using
1.8.2 with
ECCE GitHub integration