Geant4  10.00.p02
G4ChargeState.hh
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 //
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  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 
55  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 void G4ChargeState::SetChargeMdm(G4double charge, G4double mag_dipole_moment)
121 {
122  SetCharge( charge );
123  SetMagneticDipoleMoment( mag_dipole_moment);
124 }
125 
127  G4double magDipoleMoment,
128  G4double pdgSpin)
129 {
130  SetChargeMdm( charge, magDipoleMoment );
131  SetPDGSpin( pdgSpin );
132 }
133 
135  G4double pdgSpin)
136 {
137  SetCharge( charge );
138  SetPDGSpin( pdgSpin );
139 }
140 
141 inline void
143  G4double magneticDM,
144  G4double electricDM)
145 {
146  SetChargeMdm( charge, magneticDM );
147  SetElectricDipoleMoment( electricDM );
148 }
149 
150 inline void
152  G4double magneticDM,
153  G4double electricDM,
154  G4double magnetic_charge )
155 {
156  SetChargeDipoleMoments( charge, magneticDM, electricDM);
157  SetMagneticCharge( magnetic_charge );
158 }
159 #endif /* End of ifndef G4ChargeState_HH */
G4double GetCharge() const
G4double fElec_dipole
G4double fMagn_dipole
G4ChargeState & operator=(const G4ChargeState &right)
G4double fMagneticCharge
void SetChargeMdmSpin(G4double charge, G4double magnetic_dipole_moment, G4double pdgSpin)
G4ChargeState(G4double charge, G4double magnetic_dipole_moment, G4double pdgSpin, G4double electric_dipole_moment=0.0, G4double magnetic_charge=0.0)
void SetChargeSpin(G4double charge, G4double pdgSpin)
void SetMagneticCharge(G4double charge)
void SetSpin(G4double spin)
G4double ElectricDipoleMoment() const
void SetCharge(G4double charge)
void SetChargesAndMoments(G4double charge, G4double magnetic_dipole_moment, G4double electric_dipole_moment, G4double magnetic_charge)
G4double fCharge
void SetChargeDipoleMoments(G4double charge, G4double magnetic_dipole_moment, G4double electric_dipole_moment)
void SetElectricDipoleMoment(G4double moment)
void SetMagneticDipoleMoment(G4double moment)
G4double GetSpin() const
G4double GetMagneticDipoleMoment() const
G4double GetPDGSpin() const
G4double MagneticCharge() const
void SetChargeMdm(G4double charge, G4double mag_dipole_moment)
void SetChargeSpinMoments(G4double charge, G4double pdgSpin, G4double magnetic_dipole_moment=DBL_MAX, G4double electric_dipole_moment=DBL_MAX, G4double magnetic_charge=DBL_MAX)
double G4double
Definition: G4Types.hh:76
#define DBL_MAX
Definition: templates.hh:83
void SetPDGSpin(G4double spin)