Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
F04SimpleSolenoid.cc
이 파일의 문서화 페이지로 가기
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 // $Id: F04SimpleSolenoid.cc 68021 2013-03-13 13:36:07Z gcosmo $
27 //
30 //
31 
32 #include "globals.hh"
33 
34 #include "G4GeometryManager.hh"
35 
36 #include "F04GlobalField.hh"
37 
38 #include "F04SimpleSolenoid.hh"
39 
40 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
41 
43  G4LogicalVolume* lv,
45 {
46  fBfield = Bz;
47  fFringeZ = fz;
48 
49  fFieldLength = 2.*((G4Tubs*)fVolume->GetSolid())->GetZHalfLength()+fFringeZ;
50  fFieldRadius = ((G4Tubs*)fVolume->GetSolid())->GetOuterRadius();
51 }
52 
53 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
54 
56  G4double field[6]) const
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 }
73 
74 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
75 
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 }
83 
84 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
85 
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 }
G4ThreeVector TransformAxis(const G4ThreeVector &axis) const
Definition: G4Tubs.hh:85
Definition of the F04SimpleSolenoid class.
double z() const
G4AffineTransform fGlobal2local
double G4double
Definition: G4Types.hh:76
bool G4bool
Definition: G4Types.hh:79
G4LogicalVolume * fVolume
#define local
Definition: gzguts.h:114
virtual void AddFieldValue(const G4double point[4], G4double field[6]) const
F04SimpleSolenoid(G4double, G4double, G4LogicalVolume *, G4ThreeVector)
Default constructor.
Definition of the F04GlobalField class.
double x() const
G4AffineTransform Inverse() const
G4VSolid * GetSolid() const
double y() const
G4bool IsOutside(G4ThreeVector &local) const
IsOutside() returns true when outside the solenoid.
G4ThreeVector TransformPoint(const G4ThreeVector &vec) const
double B(double temperature)
G4bool IsWithin(G4ThreeVector &local) const
IsWithin() returns true when inside the solenoid.