VMC Examples Version 6.6
Loading...
Searching...
No Matches
A01MagField Class Reference

Definition of a uniform magnetic field within a given region. More...

#include <A01MagField.h>

Inheritance diagram for A01MagField:

Public Member Functions

 A01MagField (Double_t Bx, Double_t By, Double_t Bz)
 
 A01MagField ()
 
virtual ~A01MagField ()
 
virtual void Field (const Double_t *, Double_t *B)
 

Private Member Functions

 A01MagField (const A01MagField &)
 
A01MagFieldoperator= (const A01MagField &)
 

Private Attributes

Double_t fB [3]
 Magnetic field vector.
 

Detailed Description

Definition of a uniform magnetic field within a given region.

Date
Author
I. Hrivnacova; IPN, Orsay

Definition at line 29 of file A01MagField.h.

Constructor & Destructor Documentation

◆ A01MagField() [1/3]

A01MagField::A01MagField ( Double_t Bx,
Double_t By,
Double_t Bz )

Standard constructor

Parameters
BxThe x component of the field value (in kiloGauss)
ByThe y component of the field value (in kiloGauss)
BzThe z component of the field value (in kiloGauss)

Definition at line 26 of file A01MagField.cxx.

27 : TVirtualMagField("A01 magnetic field")
28{
29 /// Standard constructor
30 /// \param Bx The x component of the field value (in kiloGauss)
31 /// \param By The y component of the field value (in kiloGauss)
32 /// \param Bz The z component of the field value (in kiloGauss)
33
34 fB[0] = Bx;
35 fB[1] = By;
36 fB[2] = Bz;
37}
Double_t fB[3]
Magnetic field vector.
Definition A01MagField.h:42

◆ A01MagField() [2/3]

A01MagField::A01MagField ( )

Default constructor

Definition at line 40 of file A01MagField.cxx.

41{
42 /// Default constructor
43 fB[0] = 0.;
44 fB[1] = 0.;
45 fB[2] = 0.;
46}

◆ ~A01MagField()

A01MagField::~A01MagField ( )
virtual

Destructor

Definition at line 49 of file A01MagField.cxx.

50{
51 /// Destructor
52}

◆ A01MagField() [3/3]

A01MagField::A01MagField ( const A01MagField & )
private

Member Function Documentation

◆ Field()

void A01MagField::Field ( const Double_t * x,
Double_t * B )
virtual

Fill in the field value B in the given position at x.

Parameters
xThe position
BThe field value (in kiloGauss)

Definition at line 55 of file A01MagField.cxx.

56{
57 /// Fill in the field value B in the given position at x.
58 /// \param x The position
59 /// \param B The field value (in kiloGauss)
60
61 // G4VSolid* magneticSolid = new
62 // G4Tubs("magneticTubs",0.,1.*m,1.*m,0.,360.*deg); G4VSolid* magneticSolid =
63 // new G4Tubs("magneticTubs",0.,1.*m,1.*m,0.,360.*deg); G4RotationMatrix*
64 // fieldRot = new G4RotationMatrix(); fieldRot->rotateX(90.*deg); new
65 // G4PVPlacement(fieldRot,G4ThreeVector(),magneticLogical,
66 // "magneticPhysical",worldLogical,0,0);
67
68 if (TMath::Sqrt(x[0] * x[0] + x[2] * x[2]) <= 100.00 &&
69 TMath::Abs(x[1]) <= 100.00) {
70 B[0] = fB[0];
71 B[1] = fB[1];
72 B[2] = fB[2];
73 }
74 else {
75 B[0] = 0.;
76 B[1] = 0.;
77 B[2] = 0.;
78 }
79}

◆ operator=()

A01MagField & A01MagField::operator= ( const A01MagField & )
private

Member Data Documentation

◆ fB

Double_t A01MagField::fB[3]
private

Magnetic field vector.

Definition at line 42 of file A01MagField.h.


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