Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
F04SimpleSolenoid Class Reference

#include <F04SimpleSolenoid.hh>

Inheritance diagram for F04SimpleSolenoid:
F04ElementField F04FocusSolenoid

Public Member Functions

 F04SimpleSolenoid (G4double, G4double, G4LogicalVolume *, G4ThreeVector)
 Default constructor. More...
 
virtual ~F04SimpleSolenoid ()
 Destructor. More...
 
virtual G4double GetLength ()
 GetLength() returns the length of the solenoid. More...
 
virtual G4double GetWidth ()
 GetWidth() returns the solenoid diameter. More...
 
virtual G4double GetHeight ()
 GetHeight() returns the solenoid diameter. More...
 
void SetFringeZ (G4double z)
 SetFringeZ(G4double) sets the solenoid fringe field z-length. More...
 
G4double GetFringeZ ()
 GetFringeZ() returns the solenoid fringe field z-length. More...
 
G4bool IsOutside (G4ThreeVector &local) const
 IsOutside() returns true when outside the solenoid. More...
 
G4bool IsWithin (G4ThreeVector &local) const
 IsWithin() returns true when inside the solenoid. More...
 
virtual void AddFieldValue (const G4double point[4], G4double field[6]) const
 
- Public Member Functions inherited from F04ElementField
 F04ElementField (const G4ThreeVector, G4LogicalVolume *)
 Constructor. More...
 
void Construct ()
 the actual implementation constructs the F04ElementField More...
 
virtual ~F04ElementField ()
 Destructor. More...
 
void SetMaxStep (G4double stp)
 SetMaxStep(G4double) sets the max. step size. More...
 
G4double GetMaxStep ()
 GetMaxStep() returns the max. step size. More...
 
void SetColor (G4String c)
 SetColor(G4String) sets the color. More...
 
G4String GetColor ()
 GetColor() returns the color. More...
 
void SetGlobalPoint (const G4double point[4])
 
bool IsInBoundingBox (const G4double point[4]) const
 

Additional Inherited Members

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

Detailed Description

Definition at line 44 of file F04SimpleSolenoid.hh.

Constructor & Destructor Documentation

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

Default constructor.

Definition at line 42 of file F04SimpleSolenoid.cc.

References F04ElementField::fVolume, and G4LogicalVolume::GetSolid().

44  : F04ElementField(c,lv)
45 {
46  fBfield = Bz;
47  fFringeZ = fz;
48 
49  fFieldLength = 2.*((G4Tubs*)fVolume->GetSolid())->GetZHalfLength()+fFringeZ;
50  fFieldRadius = ((G4Tubs*)fVolume->GetSolid())->GetOuterRadius();
51 }
F04ElementField(const G4ThreeVector, G4LogicalVolume *)
Constructor.
Definition: G4Tubs.hh:84
G4LogicalVolume * fVolume
G4VSolid * GetSolid() const
virtual F04SimpleSolenoid::~F04SimpleSolenoid ( )
inlinevirtual

Destructor.

Definition at line 52 of file F04SimpleSolenoid.hh.

52 {}

Member Function Documentation

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

AddFieldValue() adds the field for this solenoid into field[]. point[] is in global coordinates.

Implements F04ElementField.

Reimplemented in F04FocusSolenoid.

Definition at line 55 of file F04SimpleSolenoid.cc.

References F04ElementField::fGlobal2local, G4AffineTransform::Inverse(), IsOutside(), local, G4AffineTransform::TransformAxis(), and G4AffineTransform::TransformPoint().

57 {
58  G4ThreeVector global(point[0],point[1],point[2]);
60 
61  local = fGlobal2local.TransformPoint(global);
62 
63  if (IsOutside(local)) return;
64 
65  G4ThreeVector B(0.0,0.0,fBfield);
66 
68 
69  field[0] += B[0];
70  field[1] += B[1];
71  field[2] += B[2];
72 }
G4bool IsOutside(G4ThreeVector &local) const
IsOutside() returns true when outside the solenoid.
G4AffineTransform Inverse() const
#define local
Definition: adler32.cc:10
G4ThreeVector TransformPoint(const G4ThreeVector &vec) const
G4AffineTransform fGlobal2local
G4ThreeVector TransformAxis(const G4ThreeVector &axis) const
G4double F04SimpleSolenoid::GetFringeZ ( )
inline

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

Definition at line 67 of file F04SimpleSolenoid.hh.

67 { return fFringeZ; }
virtual G4double F04SimpleSolenoid::GetHeight ( )
inlinevirtual

GetHeight() returns the solenoid diameter.

Implements F04ElementField.

Definition at line 61 of file F04SimpleSolenoid.hh.

61 { return fFieldRadius*2.0; }
virtual G4double F04SimpleSolenoid::GetLength ( )
inlinevirtual

GetLength() returns the length of the solenoid.

Implements F04ElementField.

Definition at line 55 of file F04SimpleSolenoid.hh.

55 { return fFieldLength; }
virtual G4double F04SimpleSolenoid::GetWidth ( )
inlinevirtual

GetWidth() returns the solenoid diameter.

Implements F04ElementField.

Definition at line 58 of file F04SimpleSolenoid.hh.

58 { return fFieldRadius*2.0; }
G4bool F04SimpleSolenoid::IsOutside ( G4ThreeVector local) const

IsOutside() returns true when outside the solenoid.

Definition at line 76 of file F04SimpleSolenoid.cc.

References CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().

Referenced by F04FocusSolenoid::AddFieldValue(), and AddFieldValue().

77 {
78 // EInside inside = tubs->Inside(local);
79 // return (inside == kOutside);
80  G4double r = std::sqrt(local.x()*local.x()+local.y()*local.y());
81  return (r > fFieldRadius || std::fabs(local.z()) > fFieldLength/2.0);
82 }
double x() const
double z() const
double y() const
double G4double
Definition: G4Types.hh:76
G4bool F04SimpleSolenoid::IsWithin ( G4ThreeVector local) const

IsWithin() returns true when inside the solenoid.

Definition at line 86 of file F04SimpleSolenoid.cc.

References CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().

87 {
88 // EInside inside = tubs->Inside(local);
89 // return (inside == kInside);
90  G4double r = std::sqrt(local.x()*local.x()+local.y()*local.y());
91  return (r < fFieldRadius && std::fabs(local.z()) < fFieldLength/2.0);
92 }
double x() const
double z() const
double y() const
double G4double
Definition: G4Types.hh:76
void F04SimpleSolenoid::SetFringeZ ( G4double  z)
inline

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

Definition at line 64 of file F04SimpleSolenoid.hh.

References z.

64 { fFringeZ = z; }
G4double z
Definition: TRTMaterials.hh:39

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