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

#include <Doxymodules_field.h>

Inheritance diagram for F04FocusSolenoid:
F04SimpleSolenoid F04ElementField

Public Member Functions

 F04FocusSolenoid (G4double, G4double, G4double, G4LogicalVolume *, G4ThreeVector)
 Default constructor.
 
 ~F04FocusSolenoid () override=default
 Destructor.
 
void SetHalf (G4bool h)
 Set F04FocusSolenoid to only half-focusing (default negative z)
 
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 F04SimpleSolenoid
 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

G4bool fHalf = false
 
G4double fB1 = 0.
 
G4double fB2 = 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 106 of file Doxymodules_field.h.

Constructor & Destructor Documentation

◆ F04FocusSolenoid()

F04FocusSolenoid::F04FocusSolenoid ( G4double  Ba,
G4double  Bb,
G4double  fz,
G4LogicalVolume lv,
G4ThreeVector  c 
)

Default constructor.

Definition at line 42 of file F04FocusSolenoid.cc.

45 : F04SimpleSolenoid(Ba, fz, lv, c),
46 fB1(Ba),
47 fB2(Bb)
48{}

◆ ~F04FocusSolenoid()

F04FocusSolenoid::~F04FocusSolenoid ( )
overridedefault

Destructor.

Member Function Documentation

◆ SetHalf()

void F04FocusSolenoid::SetHalf ( G4bool  h)
inline

Set F04FocusSolenoid to only half-focusing (default negative z)

Definition at line 53 of file F04FocusSolenoid.hh.

53{ fHalf = h; }

◆ AddFieldValue()

void F04FocusSolenoid::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 52 of file F04FocusSolenoid.cc.

54{
55 G4ThreeVector global(point[0],point[1],point[2]);
56
57 G4ThreeVector local = fGlobal2local.TransformPoint(global);
58
59 if (IsOutside(local)) return;
60
61 G4double length = ((F04SimpleSolenoid*)this)->GetLength();
62
63 G4double Bz = (fB2-fB1) * std::abs(local.z())/(length/2.) + fB1;
64
65 if (fHalf) { if (local.z() >= 0.) Bz = fB1; }
66
67 G4ThreeVector B(0.0,0.0,Bz);
68
69 B = fGlobal2local.Inverse().TransformAxis(B);
70
71 field[0] += B[0];
72 field[1] += B[1];
73 field[2] += B[2];
74}
G4AffineTransform fGlobal2local
G4bool IsOutside(G4ThreeVector &local) const
IsOutside() returns true when outside the solenoid.

Member Data Documentation

◆ fHalf

G4bool F04FocusSolenoid::fHalf = false
private

Definition at line 61 of file F04FocusSolenoid.hh.

◆ fB1

G4double F04FocusSolenoid::fB1 = 0.
private

Definition at line 63 of file F04FocusSolenoid.hh.

◆ fB2

G4double F04FocusSolenoid::fB2 = 0.
private

Definition at line 64 of file F04FocusSolenoid.hh.


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

Applications | User Support | Publications | Collaboration