Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
F04SimpleSolenoid Class Reference

#include <Doxymodules_field.h>

Inheritance diagram for F04SimpleSolenoid:
F04ElementField F04FocusSolenoid

Public Member Functions

 F04SimpleSolenoid (G4double, G4double, G4LogicalVolume *, G4ThreeVector)
 Default constructor.
 
 ~F04SimpleSolenoid () override=default
 Destructor.
 
G4double GetLength () override
 GetLength() returns the length of the solenoid.
 
G4double GetWidth () override
 GetWidth() returns the solenoid diameter.
 
G4double GetHeight () override
 GetHeight() returns the solenoid diameter.
 
void SetFringeZ (G4double z)
 SetFringeZ(G4double) sets the solenoid fringe field z-length.
 
G4double GetFringeZ ()
 GetFringeZ() returns the solenoid fringe field z-length.
 
G4bool IsOutside (G4ThreeVector &local) const
 IsOutside() returns true when outside the solenoid.
 
G4bool IsWithin (G4ThreeVector &local) const
 IsWithin() returns true when inside the solenoid.
 
void AddFieldValue (const G4double point[4], G4double field[6]) const override
 AddFieldValue() adds the field for this solenoid into field[].
 
- Public Member Functions inherited from F04ElementField
 F04ElementField (const G4ThreeVector, G4LogicalVolume *)
 Constructor.
 
void Construct ()
 the actual implementation constructs the F04ElementField
 
virtual ~F04ElementField ()=default
 Destructor.
 
void SetMaxStep (G4double stp)
 SetMaxStep(G4double) sets the max. step size.
 
G4double GetMaxStep ()
 GetMaxStep() returns the max. step size.
 
void SetColor (G4String c)
 SetColor(G4String) sets the color.
 
G4String GetColor ()
 GetColor() returns the color.
 
void SetGlobalPoint (const G4double point[4])
 SetGlobalPoint() ensures that the point is within the global bounding box of this ElementField's global coordinates.
 
bool IsInBoundingBox (const G4double point[4]) const
 IsInBoundingBox() returns true if the point is within the global bounding box - global coordinates.
 

Private Attributes

G4double fBfield = 0.
 
G4double fFringeZ = 0.
 
G4double fFieldLength = 0.
 
G4double fFieldRadius = 0.
 

Additional Inherited Members

- Static Public Member Functions inherited from F04ElementField
static G4VisAttributesGetVisAttribute (G4String color)
 GetVisAttribute() returns the appropriate G4VisAttributes.
 
- Protected Attributes inherited from F04ElementField
G4LogicalVolumefVolume = nullptr
 
G4AffineTransform fGlobal2local
 

Detailed Description

Definition at line 116 of file Doxymodules_field.h.

Constructor & Destructor Documentation

◆ F04SimpleSolenoid()

F04SimpleSolenoid::F04SimpleSolenoid ( G4double  Bz,
G4double  fz,
G4LogicalVolume lv,
G4ThreeVector  c 
)

Default constructor.

Definition at line 41 of file F04SimpleSolenoid.cc.

44 : F04ElementField(c,lv),
45 fBfield(Bz),
46 fFringeZ(fz),
47 fFieldLength(2.*((G4Tubs*)fVolume->GetSolid())->GetZHalfLength()+fFringeZ),
48 fFieldRadius(((G4Tubs*)fVolume->GetSolid())->GetOuterRadius())
49{}
G4LogicalVolume * fVolume

◆ ~F04SimpleSolenoid()

F04SimpleSolenoid::~F04SimpleSolenoid ( )
overridedefault

Destructor.

Member Function Documentation

◆ GetLength()

G4double F04SimpleSolenoid::GetLength ( )
inlineoverridevirtual

GetLength() returns the length of the solenoid.

Implements F04ElementField.

Definition at line 54 of file F04SimpleSolenoid.hh.

54{ return fFieldLength; }

◆ GetWidth()

G4double F04SimpleSolenoid::GetWidth ( )
inlineoverridevirtual

GetWidth() returns the solenoid diameter.

Implements F04ElementField.

Definition at line 57 of file F04SimpleSolenoid.hh.

57{ return fFieldRadius*2.0; }

◆ GetHeight()

G4double F04SimpleSolenoid::GetHeight ( )
inlineoverridevirtual

GetHeight() returns the solenoid diameter.

Implements F04ElementField.

Definition at line 60 of file F04SimpleSolenoid.hh.

60{ return fFieldRadius*2.0; }

◆ SetFringeZ()

void F04SimpleSolenoid::SetFringeZ ( G4double  z)
inline

SetFringeZ(G4double) sets the solenoid fringe field z-length.

Definition at line 63 of file F04SimpleSolenoid.hh.

63{ fFringeZ = z; }

◆ GetFringeZ()

G4double F04SimpleSolenoid::GetFringeZ ( )
inline

GetFringeZ() returns the solenoid fringe field z-length.

Definition at line 66 of file F04SimpleSolenoid.hh.

66{ return fFringeZ; }

◆ IsOutside()

G4bool F04SimpleSolenoid::IsOutside ( G4ThreeVector &  local) const

IsOutside() returns true when outside the solenoid.

Definition at line 74 of file F04SimpleSolenoid.cc.

75{
76// EInside inside = tubs->Inside(local);
77// return (inside == kOutside);
78 G4double r = std::sqrt(local.x()*local.x()+local.y()*local.y());
79 return (r > fFieldRadius || std::fabs(local.z()) > fFieldLength/2.0);
80}

◆ IsWithin()

G4bool F04SimpleSolenoid::IsWithin ( G4ThreeVector &  local) const

IsWithin() returns true when inside the solenoid.

Definition at line 84 of file F04SimpleSolenoid.cc.

85{
86// EInside inside = tubs->Inside(local);
87// return (inside == kInside);
88 G4double r = std::sqrt(local.x()*local.x()+local.y()*local.y());
89 return (r < fFieldRadius && std::fabs(local.z()) < fFieldLength/2.0);
90}

◆ AddFieldValue()

void F04SimpleSolenoid::AddFieldValue ( const G4double  point[4],
G4double  field[6] 
) const
overridevirtual

AddFieldValue() adds the field for this solenoid into field[].

point[] is in global coordinates.

Implements F04ElementField.

Definition at line 53 of file F04SimpleSolenoid.cc.

55{
56 G4ThreeVector global(point[0],point[1],point[2]);
57 G4ThreeVector local;
58
59 local = fGlobal2local.TransformPoint(global);
60
61 if (IsOutside(local)) return;
62
63 G4ThreeVector B(0.0,0.0,fBfield);
64
65 B = fGlobal2local.Inverse().TransformAxis(B);
66
67 field[0] += B[0];
68 field[1] += B[1];
69 field[2] += B[2];
70}
G4AffineTransform fGlobal2local
G4bool IsOutside(G4ThreeVector &local) const
IsOutside() returns true when outside the solenoid.

Member Data Documentation

◆ fBfield

G4double F04SimpleSolenoid::fBfield = 0.
private

Definition at line 80 of file F04SimpleSolenoid.hh.

◆ fFringeZ

G4double F04SimpleSolenoid::fFringeZ = 0.
private

Definition at line 82 of file F04SimpleSolenoid.hh.

◆ fFieldLength

G4double F04SimpleSolenoid::fFieldLength = 0.
private

Definition at line 84 of file F04SimpleSolenoid.hh.

◆ fFieldRadius

G4double F04SimpleSolenoid::fFieldRadius = 0.
private

Definition at line 85 of file F04SimpleSolenoid.hh.


The documentation for this class was generated from the following files:

Applications | User Support | Publications | Collaboration