Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ExP01MagneticField.cc
Go to the documentation of this file.
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 /// \file persistency/P01/src/ExP01MagneticField.cc
27 /// \brief Implementation of the ExP01MagneticField class
28 //
29 //
30 // $Id: ExP01MagneticField.cc 68025 2013-03-13 13:43:46Z gcosmo $
31 //
32 // User Field class implementation.
33 //
34 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
35 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
36 
37 #include "ExP01MagneticField.hh"
38 #include "G4FieldManager.hh"
39 
40 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
41 
44 {
47 }
48 
49 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
50 
52  : G4UniformMagField(fieldVector)
53 {
56 }
57 
58 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
59 
60 // Set the value of the Global Field to fieldValue along X
61 //
63 {
65 }
66 
67 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
68 
69 // Set the value of the Global Field
70 //
72 {
73  // Find the Field Manager for the global field
75 
76  if(fieldVector!=G4ThreeVector(0.,0.,0.))
77  {
79  fieldMgr->SetDetectorField(this);
80  } else {
81  // If the new field's value is Zero, then it is best to
82  // insure that it is not used for propagation.
83  G4MagneticField* magField = NULL;
84  fieldMgr->SetDetectorField(magField);
85  }
86 }
87 
88 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
89 
91 {
92  // GetGlobalFieldManager()->SetDetectorField(0);
93 }
94 
95 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
96 
98 
100 {
102 }
103 
104 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void SetFieldValue(const G4ThreeVector &newFieldValue)
void SetFieldValue(G4double fieldValue)
CLHEP::Hep3Vector G4ThreeVector
G4bool SetDetectorField(G4Field *detectorField)
static G4TransportationManager * GetTransportationManager()
G4FieldManager * GetFieldManager() const
Definition of the ExP01MagneticField class.
double G4double
Definition: G4Types.hh:76
void CreateChordFinder(G4MagneticField *detectorMagField)
G4FieldManager * GetGlobalFieldManager()