Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4ChargeState.hh
이 파일의 문서화 페이지로 가기
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 //
27 // $Id: G4ChargeState.hh $
28 //
29 //
30 // class G4ChargeState
31 //
32 // Class description:
33 //
34 // History
35 // - First version: Apr 10, 2013 John Apostolakis, Peter Gumplinger
36 // - Modified:
37 // -------------------------------------------------------------------
38 
39 #ifndef G4ChargeState_HH
40 #define G4ChargeState_HH
41 
42 #include "globals.hh"
43 
44 class G4ChargeState // Charge & moments
45 {
46  public: // without description
47 
48  inline G4ChargeState(G4double charge,
49  G4double magnetic_dipole_moment,
50  G4double pdgSpin,
51  G4double electric_dipole_moment = 0.0,
52  G4double magnetic_charge = 0.0);
53 
54  inline G4ChargeState( const G4ChargeState& right );
55  inline G4ChargeState& operator = ( const G4ChargeState& right );
56 
57  void SetChargeSpinMoments(G4double charge,
58  G4double pdgSpin,
59  G4double magnetic_dipole_moment= DBL_MAX,
60  G4double electric_dipole_moment= DBL_MAX,
61  G4double magnetic_charge= DBL_MAX );
62  // Revise the charge, pdgSpin, and optionally both moments and magnetic charge
63 
64  void SetCharge(G4double charge){ fCharge = charge; }
65  G4double GetCharge() const { return fCharge; }
66  // Revise the charge (in units of the positron charge)
67 
68 
69  // Basic Get / Set methods
70  void SetPDGSpin(G4double spin){ fSpin = spin; }
71  G4double GetPDGSpin() const { return fSpin; }
72 
73  void SetMagneticDipoleMoment(G4double moment){ fMagn_dipole = moment; }
75 
76  void SetElectricDipoleMoment(G4double moment){ fElec_dipole = moment; }
78 
79  void SetMagneticCharge(G4double charge){ fMagneticCharge=charge; }
81 
82  // Auxiliary methods to set several properties at once
83 
84  inline void SetChargeMdm(G4double charge, G4double mag_dipole_moment);
85  // SetCharge and Magnetic Dipole Moment
86 
87  inline void SetChargeMdmSpin(G4double charge,
88  G4double magnetic_dipole_moment,
89  G4double pdgSpin);
90 
91  inline void SetChargeSpin(G4double charge,
92  G4double pdgSpin);
93 
94  // Revise the charge, spin and all both moments
95  inline void SetChargeDipoleMoments(G4double charge,
96  G4double magnetic_dipole_moment,
97  G4double electric_dipole_moment);
98 
99  inline void SetChargesAndMoments(G4double charge,
100  G4double magnetic_dipole_moment,
101  G4double electric_dipole_moment,
102  G4double magnetic_charge );
103 
104 
105 
106 
107  public: // Obsolete
108  inline void SetSpin(G4double spin){ SetPDGSpin( spin); }
109  inline G4double GetSpin() const { return GetPDGSpin(); }
110 
111  private:
112 
117  G4double fMagneticCharge; // for magnetic monopole
118 };
119 
120 // Inline methods implementation
121 
123  G4double magnetic_dipole_moment,
124  G4double spin,
125  G4double electric_dipole_moment,
126  G4double magnetic_charge)
127 {
128  fCharge = charge;
129  fSpin = spin;
130  fMagn_dipole = magnetic_dipole_moment;
131  fElec_dipole = electric_dipole_moment;
132  fMagneticCharge = magnetic_charge;
133 }
134 
136 {
137  fCharge = right.fCharge;
138  fSpin = right.fSpin;
139  fMagn_dipole = right.fMagn_dipole;
140  fElec_dipole = right.fElec_dipole;
142 }
143 
145 {
146  if (&right == this) return *this;
147 
148  fCharge = right.fCharge;
149  fSpin = right.fSpin;
150  fMagn_dipole = right.fMagn_dipole;
151  fElec_dipole = right.fElec_dipole;
153 
154  return *this;
155 }
156 
157 inline void G4ChargeState::SetChargeMdm(G4double charge, G4double mag_dipole_moment)
158 {
159  SetCharge( charge );
160  SetMagneticDipoleMoment( mag_dipole_moment);
161 }
162 
164  G4double magDipoleMoment,
165  G4double pdgSpin)
166 {
167  SetChargeMdm( charge, magDipoleMoment );
168  SetPDGSpin( pdgSpin );
169 }
170 
172  G4double pdgSpin)
173 {
174  SetCharge( charge );
175  SetPDGSpin( pdgSpin );
176 }
177 
178 inline void
180  G4double magneticDM,
181  G4double electricDM)
182 {
183  SetChargeMdm( charge, magneticDM );
184  SetElectricDipoleMoment( electricDM );
185 }
186 
187 inline void
189  G4double magneticDM,
190  G4double electricDM,
191  G4double magnetic_charge )
192 {
193  SetChargeDipoleMoments( charge, magneticDM, electricDM);
194  SetMagneticCharge( magnetic_charge );
195 }
196 #endif /* End of ifndef G4ChargeState_HH */
void SetChargeMdm(G4double charge, G4double mag_dipole_moment)
G4ChargeState(G4double charge, G4double magnetic_dipole_moment, G4double pdgSpin, G4double electric_dipole_moment=0.0, G4double magnetic_charge=0.0)
G4double fMagneticCharge
G4double GetSpin() const
G4double fMagn_dipole
void SetChargeMdmSpin(G4double charge, G4double magnetic_dipole_moment, G4double pdgSpin)
void SetMagneticDipoleMoment(G4double moment)
G4double ElectricDipoleMoment() const
void SetChargeSpinMoments(G4double charge, G4double pdgSpin, G4double magnetic_dipole_moment=DBL_MAX, G4double electric_dipole_moment=DBL_MAX, G4double magnetic_charge=DBL_MAX)
void SetChargeSpin(G4double charge, G4double pdgSpin)
void SetPDGSpin(G4double spin)
double G4double
Definition: G4Types.hh:76
void SetElectricDipoleMoment(G4double moment)
G4double fCharge
void SetSpin(G4double spin)
G4double GetPDGSpin() const
G4double MagneticCharge() const
void SetMagneticCharge(G4double charge)
G4ChargeState & operator=(const G4ChargeState &right)
G4double GetMagneticDipoleMoment() const
G4double GetCharge() const
void SetCharge(G4double charge)
G4double fElec_dipole
void SetChargesAndMoments(G4double charge, G4double magnetic_dipole_moment, G4double electric_dipole_moment, G4double magnetic_charge)
#define DBL_MAX
Definition: templates.hh:83
void SetChargeDipoleMoments(G4double charge, G4double magnetic_dipole_moment, G4double electric_dipole_moment)