File indexing completed on 2025-01-18 09:58:01
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034 #ifndef G4CHARGESTATE_HH
0035 #define G4CHARGESTATE_HH
0036
0037 #include "globals.hh"
0038
0039 class G4ChargeState
0040 {
0041 public:
0042
0043 inline G4ChargeState(G4double charge,
0044 G4double magnetic_dipole_moment,
0045 G4double pdgSpin,
0046 G4double electric_dipole_moment = 0.0,
0047 G4double magnetic_charge = 0.0);
0048
0049 inline G4ChargeState( const G4ChargeState& right );
0050 inline G4ChargeState& operator = ( const G4ChargeState& right );
0051
0052 void SetChargeSpinMoments(G4double charge,
0053 G4double pdgSpin,
0054 G4double magnetic_dipole_moment= DBL_MAX,
0055 G4double electric_dipole_moment= DBL_MAX,
0056 G4double magnetic_charge= DBL_MAX );
0057
0058
0059
0060 void SetCharge(G4double charge){ fCharge = charge; }
0061 G4double GetCharge() const { return fCharge; }
0062
0063
0064
0065
0066
0067 void SetPDGSpin(G4double spin){ fSpin = spin; }
0068 G4double GetPDGSpin() const { return fSpin; }
0069
0070 void SetMagneticDipoleMoment(G4double moment){ fMagn_dipole = moment; }
0071 G4double GetMagneticDipoleMoment() const { return fMagn_dipole; }
0072
0073 void SetElectricDipoleMoment(G4double moment){ fElec_dipole = moment; }
0074 G4double ElectricDipoleMoment() const { return fElec_dipole; }
0075
0076 void SetMagneticCharge(G4double charge){ fMagneticCharge=charge; }
0077 G4double MagneticCharge() const { return fMagneticCharge; }
0078
0079
0080
0081 inline void SetChargeMdm(G4double charge, G4double mag_dipole_moment);
0082
0083
0084 inline void SetChargeMdmSpin(G4double charge,
0085 G4double magnetic_dipole_moment,
0086 G4double pdgSpin);
0087
0088 inline void SetChargeSpin(G4double charge,
0089 G4double pdgSpin);
0090
0091
0092
0093 inline void SetChargeDipoleMoments(G4double charge,
0094 G4double magnetic_dipole_moment,
0095 G4double electric_dipole_moment);
0096
0097 inline void SetChargesAndMoments(G4double charge,
0098 G4double magnetic_dipole_moment,
0099 G4double electric_dipole_moment,
0100 G4double magnetic_charge );
0101
0102
0103
0104 inline void SetSpin(G4double spin){ SetPDGSpin( spin); }
0105 inline G4double GetSpin() const { return GetPDGSpin(); }
0106
0107 private:
0108
0109 G4double fCharge;
0110 G4double fSpin;
0111 G4double fMagn_dipole;
0112 G4double fElec_dipole;
0113 G4double fMagneticCharge;
0114 };
0115
0116
0117
0118 inline G4ChargeState::G4ChargeState(G4double charge,
0119 G4double magnetic_dipole_moment,
0120 G4double spin,
0121 G4double electric_dipole_moment,
0122 G4double magnetic_charge)
0123 {
0124 fCharge = charge;
0125 fSpin = spin;
0126 fMagn_dipole = magnetic_dipole_moment;
0127 fElec_dipole = electric_dipole_moment;
0128 fMagneticCharge = magnetic_charge;
0129 }
0130
0131 inline G4ChargeState::G4ChargeState( const G4ChargeState& right )
0132 {
0133 fCharge = right.fCharge;
0134 fSpin = right.fSpin;
0135 fMagn_dipole = right.fMagn_dipole;
0136 fElec_dipole = right.fElec_dipole;
0137 fMagneticCharge = right.fMagneticCharge;
0138 }
0139
0140 inline G4ChargeState& G4ChargeState::operator = ( const G4ChargeState& right )
0141 {
0142 if (&right == this) { return *this; }
0143
0144 fCharge = right.fCharge;
0145 fSpin = right.fSpin;
0146 fMagn_dipole = right.fMagn_dipole;
0147 fElec_dipole = right.fElec_dipole;
0148 fMagneticCharge = right.fMagneticCharge;
0149
0150 return *this;
0151 }
0152
0153 inline void G4ChargeState::SetChargeMdm(G4double charge, G4double mdipole_mom)
0154 {
0155 SetCharge( charge );
0156 SetMagneticDipoleMoment( mdipole_mom );
0157 }
0158
0159 inline void G4ChargeState::SetChargeMdmSpin(G4double charge,
0160 G4double magDipoleMoment,
0161 G4double pdgSpin)
0162 {
0163 SetChargeMdm( charge, magDipoleMoment );
0164 SetPDGSpin( pdgSpin );
0165 }
0166
0167 inline void G4ChargeState::SetChargeSpin(G4double charge,
0168 G4double pdgSpin)
0169 {
0170 SetCharge( charge );
0171 SetPDGSpin( pdgSpin );
0172 }
0173
0174 inline void
0175 G4ChargeState::SetChargeDipoleMoments(G4double charge,
0176 G4double magneticDM,
0177 G4double electricDM)
0178 {
0179 SetChargeMdm( charge, magneticDM );
0180 SetElectricDipoleMoment( electricDM );
0181 }
0182
0183 inline void
0184 G4ChargeState::SetChargesAndMoments(G4double charge,
0185 G4double magneticDM,
0186 G4double electricDM,
0187 G4double magnetic_charge )
0188 {
0189 SetChargeDipoleMoments( charge, magneticDM, electricDM);
0190 SetMagneticCharge( magnetic_charge );
0191 }
0192 #endif