Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4FieldUtils.hh
이 파일의 문서화 페이지로 가기
1 // ********************************************************************
2 // * License and Disclaimer *
3 // * *
4 // * The Geant4 software is copyright of the Copyright Holders of *
5 // * the Geant4 Collaboration. It is provided under the terms and *
6 // * conditions of the Geant4 Software License, included in the file *
7 // * LICENSE and available at http://cern.ch/geant4/license . These *
8 // * include a list of copyright holders. *
9 // * *
10 // * Neither the authors of this software system, nor their employing *
11 // * institutes,nor the agencies providing financial support for this *
12 // * work make any representation or warranty, express or implied, *
13 // * regarding this software system or assume any liability for its *
14 // * use. Please see the license in the file LICENSE and URL above *
15 // * for the full disclaimer and the limitation of liability. *
16 // * *
17 // * This code implementation is the result of the scientific and *
18 // * technical work of the GEANT4 collaboration. *
19 // * By using, copying, modifying or distributing the software (or *
20 // * any work based on the software) you agree to acknowledge its *
21 // * use in resulting scientific publications, and indicate your *
22 // * acceptance of all terms of the Geant4 Software license. *
23 // ********************************************************************
24 //
25 //
26 // $Id: $
27 //
28 // Helper namespace 'field_utils'
29 //
30 // Description:
31 // Simple methods to extract vectors from arrays in conventions of
32 // the magnetic field integration
33 //
34 // Implementation by Dmitry Sorokin - GSoC 2017
35 // Work supported by Google as part of Google Summer of Code 2017.
36 // Supervision / code review: John Apostolakis
37 
38 #ifndef G4FIELD_UTILS_HH
39 #define G4FIELD_UTILS_HH
40 
41 #include "G4Types.hh"
42 #include "G4ThreeVector.hh"
43 
44 namespace field_utils {
45 
46 enum class Value3D {
47  Position = 0,
48  Momentum = 3,
49  Spin = 9
50 };
51 
52 enum class Value1D {
53  KineticEnergy = 6,
54  LabTime = 7,
55  ProperTime = 8
56 };
57 
58 template <typename ArrayType>
59 G4double getValue(const ArrayType& array, Value1D value);
60 
61 template <typename ArrayType>
62 G4double getValue2(const ArrayType& array, Value1D value);
63 
64 template <typename ArrayType>
65 G4double getValue(const ArrayType& array, Value3D value);
66 
67 template <typename ArrayType>
68 G4double getValue2(const ArrayType& array, Value3D value);
69 
70 template <typename ArrayType>
71 G4ThreeVector makeVector(const ArrayType& array, Value3D value);
72 
74  const G4double y[],
75  const G4double yerr[],
76  const G4double hstep,
77  const G4double errorTolerance = 1);
78 
79 } // field_utils
80 
81 #include "G4FieldUtils.icc"
82 
83 #endif
G4ThreeVector makeVector(const ArrayType &array, Value3D value)
G4double getValue(const ArrayType &array, Value1D value)
Float_t y
Definition: compare.C:6
G4double relativeError(const G4double y[], const G4double yerr[], const G4double hstep, const G4double errorTolerance=1)
Definition: G4FieldUtils.cc:38
double G4double
Definition: G4Types.hh:76
const XML_Char int const XML_Char * value
Definition: expat.h:331
G4double getValue2(const ArrayType &array, Value1D value)