ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4ParticleDefinition.hh
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4ParticleDefinition.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 //
28 //
29 // ------------------------------------------------------------
30 // GEANT 4 class header file
31 //
32 // History: first implementation, based on object model of
33 // 2nd December 1995, G.Cosmo
34 // ---------------- G4ParticleDefinition ----------------
35 // first implementation by Makoto Asai - 29 January 1996
36 // revised - G.Cosmo - 29 February 1996
37 // revised - H.Kurashige - 19 April 1996
38 // revised - H.Kurashige - 4 July 1996
39 // added GetEnergyCuts() and GetLengthCuts() - G.Cosmo - 11 July 1996
40 // added Set/GetVerboseLevel() - H.Kurashige - 11 November 1997
41 // added SetCuts() and ResetCuts - H.Kurashige - 15 November 1996
42 // change SetProcessManager as public - H.Kurashige - 06 June 1998
43 // added GetEnergyThreshold - H.Kurashige - 08 June 1998
44 // added ShortLived flag and ApplyCuts flag - H.Kurashige - 27 June 1998
45 // fixed some improper codings - H.Kurashige - 08 April 1999
46 // added sub-type - H.Kurashige - 15 February 2000
47 // added RestoreCuts - H.Kurashige - 09 March 2001
48 // restructuring for Cuts per Region - H.Kurashige - 11 March 2003
49 // added MagneticMoment - H.Kurashige - March 2007
50 // modified for thread-safety for MT - G.Cosmo, A.Dotti - January 2013
51 // added support for MuonicAtom - K.L.Genser - September 2017
52 // ------------------------------------------------------------
53 
54 #ifndef G4ParticleDefinition_h
55 #define G4ParticleDefinition_h 1
56 
57 #include <vector>
59 
60 #include "globals.hh"
61 #include "G4ios.hh"
62 #include "G4PDefManager.hh"
63 
64 class G4ProcessManager;
65 class G4DecayTable;
66 class G4ParticleTable;
68 
69 //typedef G4PDefSplitter<G4PDefData> G4PDefManager;
71 
73 {
74  // Class Description:
75  //
76  // This class containes all the static data of a particle.
77  // It also has uses a process manager in order to collect
78  // all the processes this kind of particle can undertake.
79 
81 
82  public: // With Description
83 
84  // Only one type of constructor can be used for G4ParticleDefinition.
85  // If you want to create new particle, you must set name of the particle
86  // at construction. Most of members seen as arguments of the constructor
87  // (except last 3 arguments concerning with decay ) are "constant"
88  // and can not be changed later. (No "SET" methods are available)
89  // Each type of particle must be constructed as a unique object
90  // of special class derived from G4ParticleDefinition.
91  // see G4ParticleTypes for detail
92 
93  G4ParticleDefinition(const G4String& aName,
94  G4double mass,
95  G4double width,
97  G4int iSpin,
98  G4int iParity,
99  G4int iConjugation,
100  G4int iIsospin,
101  G4int iIsospinZ,
102  G4int gParity,
103  const G4String& pType,
104  G4int lepton,
105  G4int baryon,
106  G4int encoding,
107  G4bool stable,
108  G4double lifetime,
109  G4DecayTable *decaytable,
110  G4bool shortlived = false,
111  const G4String& subType ="",
112  G4int anti_encoding =0,
113  G4double magneticMoment = 0.0);
114 
115  virtual ~G4ParticleDefinition();
116 
117  // With the following Getxxxx methods, one can get values
118  // for members which can not be changed
119 
120  const G4String& GetParticleName() const { return theParticleName; }
121 
122  G4double GetPDGMass() const { return thePDGMass; }
123  G4double GetPDGWidth() const { return thePDGWidth; }
124  G4double GetPDGCharge() const { return thePDGCharge; }
125 
126  G4double GetPDGSpin() const { return thePDGSpin; }
127  G4int GetPDGiSpin() const { return thePDGiSpin; }
128  G4int GetPDGiParity() const { return thePDGiParity; }
132  G4int GetPDGiIsospin() const { return thePDGiIsospin; }
134  G4int GetPDGiGParity() const { return thePDGiGParity; }
135 
137  void SetPDGMagneticMoment(G4double mageticMoment);
138  G4double CalculateAnomaly() const;
139  // Gives the anomaly of magnetic moment for spin 1/2 particles
140 
141  const G4String& GetParticleType() const { return theParticleType; }
142  const G4String& GetParticleSubType() const { return theParticleSubType; }
145 
146  G4int GetPDGEncoding() const { return thePDGEncoding; }
148  void SetAntiPDGEncoding(G4int aEncoding);
149 
150 
151  G4int GetQuarkContent(G4int flavor) const;
152  G4int GetAntiQuarkContent(G4int flavor) const;
153  // Returns the number of quark with flavor contained in this particle.
154  // The value of flavor is assigned as follows
155  // 1:d, 2:u, 3:s, 4:c, 5:b, 6:t
156 
157  G4bool IsShortLived() const { return fShortLivedFlag; }
158 
159  G4bool GetPDGStable() const;
160  void SetPDGStable(const G4bool aFlag) { thePDGStable=aFlag; }
161 
162  G4double GetPDGLifeTime() const;
163  void SetPDGLifeTime(G4double aLifeTime) { thePDGLifeTime=aLifeTime; }
164 
165  G4double GetIonLifeTime() const;
166  // Get life time of a generic ion through G4NuclideTable.
167 
168  G4DecayTable* GetDecayTable() const;
169  void SetDecayTable(G4DecayTable* aDecayTable);
170  // Set/Get Decay Table
171  // !! Decay Table can be modified !!
172 
174  void SetProcessManager(G4ProcessManager* aProcessManager);
175  // Set/Get Process Manager
176  // !! Process Manager can be modified !!
177 
179  // Get pointer to the particle table
180 
181  G4int GetAtomicNumber() const;
182  G4int GetAtomicMass() const;
183  // Get AtomicNumber and AtomicMass
184  // These properties are defined for nucleus
185 
186  void DumpTable() const;
187  // Prints information of data members.
188 
190  G4int GetVerboseLevel() const;
191  // controle flag for output message
192  // 0: Silent
193  // 1: Warning message
194  // 2: More
195 
196  void SetApplyCutsFlag(G4bool);
197  G4bool GetApplyCutsFlag() const;
198 
199  G4bool IsGeneralIon() const;
200  // true only if the particle is G4Ions
201  // (it means that theProcessManager is same as one for G4GenricIon)
202 
203  G4bool IsMuonicAtom() const;
204  // true only if the particle is a G4MuonicAtom
205  // (it means that theProcessManager is same as the one for G4GenricMuonicAtom)
206 
209 
210  public : // without description
211 
213  // Returns the process manager master pointer.
214  inline void SetMasterProcessManager(G4ProcessManager* aNewPM);
215  // Sets the shadow master pointer (not to be used by user)
216 
217  inline G4int GetInstanceID() const;
218  // Returns the instance ID.
219 
220  static const G4PDefManager& GetSubInstanceManager();
221  // Returns the private data instance manager.
222 
223  static void Clean();
224  // Clear memory allocated by sub-instance manager.
225 
226  private:
227  // --- Shadow of master pointers.
228 
230  // Each worker thread can access this field from the master thread
231  // through this pointer.
232 
234  // This field is used as instance ID.
235 
237  // This field helps to use the class G4PDefManager introduced above.
238 
239  protected:
240 
242  // Calculates quark and anti-quark contents
243  // return value is PDG encoding for this particle.
244  // It means error if the return value is deffernt from
245  // this->thePDGEncoding.
246 
247  void SetParticleSubType(const G4String& subtype);
248 
249  void SetAtomicNumber(G4int );
250  void SetAtomicMass(G4int );
251 
252  // !!! can not use "copy constructor" nor "default constructor" !!!!
253  //
256 
257  private:
258 
259  // !!! Assignment operation is forbidden !!!
260  //
262 
263  protected:
264 
268  // the number of quark (minus Sign means anti-quark) contents
269  // The value of flavor is assigned as follows
270  // 0:d, 1:u, 2:s, 3:c, 4:b, 5:t
271 
272  private:
273 
274  // --- Following values can not be changed
275  // --- i.e. No Setxxxx Methods for them
276 
278  // The name of the particle.
279  // Each object must have its specific name!!
280 
281  // --- Following member values must be defined with Units
282 
284  // The mass of the particle, in units of equivalent energy.
285 
287  // The decay width of the particle, usually the width of a
288  // Breit-Wigner function, assuming that you are near the
289  // mass center anyway. (in units of equivalent energy)
290 
292  // The charge of the particle.(in units of Coulomb)
293 
294  // --- Following members are quantum number
295  // i.e. discrete numbers can be allowded
296  // So, you can defined only by using integer in constructor
297 
299  // The total spin of the particle, also often denoted as
300  // capital J, in units of 1/2.
302  // The total spin of the particle, in units of 1.
303 
305  // The parity quantum number, in units of 1. If the parity
306  // is not defined for this particle, we will set this to 0.
307 
309  // This charge conjugation quantum number in units of 1.
310 
312  // The value of the G-parity quantum number.
313 
316  // The isospin and its 3rd-component in units of 1/2.
319  // The isospin quantum number in units of 1.
320 
322  // The magnetic moment.
323 
325  // The lepton quantum number.
326 
328  // The baryon quantum number.
329 
331  // More general textual type description of the particle.
332 
334  // Textual type description of the particle
335  // eg. pion, lamda etc.
336 
338  // The Particle Data Group integer identifier of this particle
339 
341  // The Particle Data Group integer identifier of the anti-particle
342 
343  // --- Following members can be changed after construction
344 
346  // Particles which have true value of this flag
347  // will not be tracked by TrackingManager
348 
350  // Is an indicator that this particle is stable. It must
351  // not decay. If the user tries to assign a kind of decay
352  // object to it, it will refuse to take it.
353 
355  // Is related to the decay width of the particle. The mean
356  // life time is given in seconds.
357 
359  // Points DecayTable
360 
361  private:
362 
364 
367 
370 
371  protected:
374 
375  public:
376  void SetParticleDefinitionID(G4int id=-1);
378 };
379 
380 #include "G4ParticleDefinition.icc"
381 
382 #endif