File indexing completed on 2025-01-18 09:58:51
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
0035
0036
0037
0038
0039
0040
0041
0042 #ifndef G4ParticleDefinition_hh
0043 #define G4ParticleDefinition_hh 1
0044
0045 #include "G4PDefManager.hh"
0046 #include "G4ios.hh"
0047 #include "globals.hh"
0048
0049 #include <CLHEP/Units/PhysicalConstants.h>
0050
0051 #include <vector>
0052
0053 class G4ProcessManager;
0054 class G4DecayTable;
0055 class G4ParticleTable;
0056 class G4ParticlePropertyTable;
0057 class G4VTrackingManager;
0058
0059 using G4ParticleDefinitionSubInstanceManager = G4PDefManager;
0060
0061 class G4ParticleDefinition
0062 {
0063 friend class G4ParticlePropertyTable;
0064
0065 public:
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075 G4ParticleDefinition(const G4String& aName, G4double mass, G4double width, G4double charge,
0076 G4int iSpin, G4int iParity, G4int iConjugation, G4int iIsospin,
0077 G4int iIsospinZ, G4int gParity, const G4String& pType, G4int lepton,
0078 G4int baryon, G4int encoding, G4bool stable, G4double lifetime,
0079 G4DecayTable* decaytable, G4bool shortlived = false,
0080 const G4String& subType = "", G4int anti_encoding = 0,
0081 G4double magneticMoment = 0.0);
0082
0083
0084 virtual ~G4ParticleDefinition();
0085
0086
0087 G4ParticleDefinition(const G4ParticleDefinition&) = delete;
0088 G4ParticleDefinition& operator=(const G4ParticleDefinition&) = delete;
0089
0090 G4bool operator==(const G4ParticleDefinition& right) const;
0091 G4bool operator!=(const G4ParticleDefinition& right) const;
0092
0093
0094
0095
0096 const G4String& GetParticleName() const { return theParticleName; }
0097
0098 G4double GetPDGMass() const { return thePDGMass; }
0099 G4double GetPDGWidth() const { return thePDGWidth; }
0100 G4double GetPDGCharge() const { return thePDGCharge; }
0101
0102 G4double GetPDGSpin() const { return thePDGSpin; }
0103 G4int GetPDGiSpin() const { return thePDGiSpin; }
0104 G4int GetPDGiParity() const { return thePDGiParity; }
0105 G4int GetPDGiConjugation() const { return thePDGiConjugation; }
0106 G4double GetPDGIsospin() const { return thePDGIsospin; }
0107 G4double GetPDGIsospin3() const { return thePDGIsospin3; }
0108 G4int GetPDGiIsospin() const { return thePDGiIsospin; }
0109 G4int GetPDGiIsospin3() const { return thePDGiIsospin3; }
0110 G4int GetPDGiGParity() const { return thePDGiGParity; }
0111
0112 G4double GetPDGMagneticMoment() const { return thePDGMagneticMoment; }
0113 inline void SetPDGMagneticMoment(G4double mageticMoment);
0114
0115
0116 G4double CalculateAnomaly() const;
0117
0118 const G4String& GetParticleType() const { return theParticleType; }
0119 const G4String& GetParticleSubType() const { return theParticleSubType; }
0120 G4int GetLeptonNumber() const { return theLeptonNumber; }
0121 G4int GetBaryonNumber() const { return theBaryonNumber; }
0122
0123 G4int GetPDGEncoding() const { return thePDGEncoding; }
0124 G4int GetAntiPDGEncoding() const { return theAntiPDGEncoding; }
0125 inline void SetAntiPDGEncoding(G4int aEncoding);
0126
0127
0128
0129
0130 inline G4int GetQuarkContent(G4int flavor) const;
0131 inline G4int GetAntiQuarkContent(G4int flavor) const;
0132
0133 G4bool IsShortLived() const { return fShortLivedFlag; }
0134
0135 inline G4bool GetPDGStable() const;
0136 void SetPDGStable(const G4bool aFlag) { thePDGStable = aFlag; }
0137
0138 inline G4double GetPDGLifeTime() const;
0139 void SetPDGLifeTime(G4double aLifeTime) { thePDGLifeTime = aLifeTime; }
0140
0141
0142 inline G4double GetIonLifeTime() const;
0143
0144
0145
0146 inline G4DecayTable* GetDecayTable() const;
0147 inline void SetDecayTable(G4DecayTable* aDecayTable);
0148
0149
0150
0151 G4ProcessManager* GetProcessManager() const;
0152 void SetProcessManager(G4ProcessManager* aProcessManager);
0153
0154
0155
0156 G4VTrackingManager* GetTrackingManager() const;
0157 void SetTrackingManager(G4VTrackingManager* aTrackingManager);
0158
0159
0160 inline G4ParticleTable* GetParticleTable() const;
0161
0162
0163
0164 inline G4int GetAtomicNumber() const;
0165 inline G4int GetAtomicMass() const;
0166
0167
0168 void DumpTable() const;
0169
0170
0171
0172
0173
0174 inline void SetVerboseLevel(G4int value);
0175 inline G4int GetVerboseLevel() const;
0176
0177 void SetApplyCutsFlag(G4bool);
0178 inline G4bool GetApplyCutsFlag() const;
0179
0180
0181
0182 inline G4bool IsGeneralIon() const;
0183
0184
0185
0186 inline G4bool IsMuonicAtom() const;
0187
0188
0189 inline G4ProcessManager* GetMasterProcessManager() const;
0190
0191
0192 inline void SetMasterProcessManager(G4ProcessManager* aNewPM);
0193
0194
0195 inline G4int GetInstanceID() const;
0196
0197
0198 static const G4PDefManager& GetSubInstanceManager();
0199
0200
0201 static void Clean();
0202
0203 void SetParticleDefinitionID(G4int id = -1);
0204 inline G4int GetParticleDefinitionID() const;
0205
0206
0207
0208
0209
0210
0211
0212
0213
0214
0215
0216 inline G4bool IsHypernucleus() const;
0217 inline G4int GetNumberOfLambdasInHypernucleus() const;
0218 inline G4bool IsAntiHypernucleus() const;
0219 inline G4int GetNumberOfAntiLambdasInAntiHypernucleus() const;
0220
0221 protected:
0222
0223 G4ParticleDefinition();
0224
0225
0226
0227
0228
0229 G4int FillQuarkContents();
0230
0231 inline void SetParticleSubType(const G4String& subtype);
0232
0233 inline void SetAtomicNumber(G4int);
0234 inline void SetAtomicMass(G4int);
0235
0236 enum
0237 {
0238 NumberOfQuarkFlavor = 6
0239 };
0240
0241
0242
0243
0244 G4int theQuarkContent[NumberOfQuarkFlavor];
0245 G4int theAntiQuarkContent[NumberOfQuarkFlavor];
0246
0247 G4bool isGeneralIon = false;
0248 G4bool isMuonicAtom = false;
0249
0250 private:
0251
0252
0253
0254
0255 G4ProcessManager* theProcessManagerShadow = nullptr;
0256
0257
0258 G4int g4particleDefinitionInstanceID = 0;
0259
0260
0261 G4PART_DLL static G4PDefManager subInstanceManager;
0262
0263
0264
0265
0266
0267
0268 G4String theParticleName = "";
0269
0270
0271
0272
0273 G4double thePDGMass = 0.0;
0274
0275
0276
0277
0278 G4double thePDGWidth = 0.0;
0279
0280
0281 G4double thePDGCharge = 0.0;
0282
0283
0284
0285
0286
0287
0288
0289 G4int thePDGiSpin = 0;
0290
0291
0292 G4double thePDGSpin = 0.0;
0293
0294
0295
0296 G4int thePDGiParity = 0;
0297
0298
0299 G4int thePDGiConjugation = 0;
0300
0301
0302 G4int thePDGiGParity = 0;
0303
0304
0305 G4int thePDGiIsospin = 0;
0306 G4int thePDGiIsospin3 = 0;
0307
0308
0309 G4double thePDGIsospin = 0.0;
0310 G4double thePDGIsospin3 = 0.0;
0311
0312
0313 G4double thePDGMagneticMoment = 0.0;
0314
0315
0316 G4int theLeptonNumber = 0;
0317
0318
0319 G4int theBaryonNumber = 0;
0320
0321
0322 G4String theParticleType = "";
0323
0324
0325
0326 G4String theParticleSubType = "";
0327
0328
0329 G4int thePDGEncoding = 0;
0330
0331
0332 G4int theAntiPDGEncoding = 0;
0333
0334
0335
0336
0337
0338 G4bool fShortLivedFlag = false;
0339
0340
0341
0342
0343 G4bool thePDGStable = false;
0344
0345
0346
0347 G4double thePDGLifeTime = 0.0;
0348
0349
0350 G4DecayTable* theDecayTable = nullptr;
0351
0352 G4ParticleTable* theParticleTable = nullptr;
0353
0354 G4int theAtomicNumber = 0;
0355 G4int theAtomicMass = 0;
0356
0357 G4int verboseLevel = 1;
0358 G4bool fApplyCutsFlag = false;
0359 };
0360
0361 #include "G4ParticleDefinition.icc"
0362
0363 #endif