source: trunk/source/particles/management/include/G4ParticleDefinition.icc@ 1335

Last change on this file since 1335 was 1196, checked in by garnier, 16 years ago

update CVS release candidate geant4.9.3.01

File size: 4.4 KB
RevLine 
[824]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//
[1196]27// $Id: G4ParticleDefinition.icc,v 1.14 2009/03/27 20:33:50 gum Exp $
28// GEANT4 tag $Name: geant4-09-03-cand-01 $
[824]29//
30
31inline
32 G4ParticleTable* G4ParticleDefinition::GetParticleTable()
33{
34 return theParticleTable;
35}
36
37inline
38 G4DecayTable* G4ParticleDefinition::GetDecayTable()
39{
40 return theDecayTable;
41}
42
43inline
44 void G4ParticleDefinition::SetDecayTable(G4DecayTable* aDecayTable)
45{
46 theDecayTable = aDecayTable;
47}
48
49
50inline
51 void G4ParticleDefinition::SetVerboseLevel(G4int value)
52{
53 verboseLevel = value;
54}
55
56inline
57 G4int G4ParticleDefinition::GetVerboseLevel() const
58{
59 return verboseLevel;
60}
61
62inline
63 G4ProcessManager* G4ParticleDefinition::GetProcessManager() const
64{
65 return theProcessManager;
66}
67
68inline
69 void G4ParticleDefinition::SetProcessManager(G4ProcessManager *aProcessManager)
70{
71 theProcessManager = aProcessManager;
72}
73
74inline
75 G4int G4ParticleDefinition::GetQuarkContent(G4int flavor) const
76{
77 G4int content = 0;
78 if ((flavor>0) && (flavor<=NumberOfQuarkFlavor)){
79 content = theQuarkContent[flavor-1];
80 }else {
81#ifdef G4VERBOSE
82 if (verboseLevel >0) {
83 G4cout << "Invalid Quark Flavor for G4ParticleDefinition::GetQuarkContent";
84 G4cout << ": flavor=" << flavor <<G4endl;
85 }
86#endif
87 }
88 return content;
89}
90
91inline
92 G4int G4ParticleDefinition::GetAntiQuarkContent(G4int flavor) const
93{
94 G4int content = 0;
95 if ((flavor>0) && (flavor<=NumberOfQuarkFlavor)){
96 content = theAntiQuarkContent[flavor-1];
97 }else {
98#ifdef G4VERBOSE
99 if (verboseLevel >0) {
100 G4cout <<"Invalid Quark Flavor for G4ParticleDefinition::GetAntiQuarkContent";
101 G4cout << ": flavor=" << flavor <<G4endl;
102 }
103#endif
104 }
105 return content;
106}
107
108
109inline
110 void G4ParticleDefinition::SetParticleSubType(const G4String& subtype)
111{
112 theParticleSubType = subtype;
113}
114
115inline
116 void G4ParticleDefinition::SetAntiPDGEncoding(G4int aEncoding)
117{
118 theAntiPDGEncoding = aEncoding;
119}
120
121inline
122G4bool G4ParticleDefinition::GetApplyCutsFlag() const
123{
124 return fApplyCutsFlag;
125}
126
127inline
128 void G4ParticleDefinition::SetAtomicNumber(G4int i)
129{
130 theAtomicNumber = i;
131}
132
133inline
134 G4int G4ParticleDefinition::GetAtomicNumber() const
135{
136 return theAtomicNumber;
137}
138
139inline
140 void G4ParticleDefinition::SetAtomicMass(G4int i)
141{
142 theAtomicMass = i;
143}
144
145inline
146 G4int G4ParticleDefinition::GetAtomicMass() const
147{
148 return theAtomicMass;
149}
150
151inline
152 void G4ParticleDefinition::SetPDGMagneticMoment(G4double magneticMoment)
153{
154 thePDGMagneticMoment = magneticMoment;
155}
156
[1196]157inline
158 G4double G4ParticleDefinition::CalculateAnomaly() const
159{
160 // gives the anomaly of magnetic moment for spin 1/2 particles
161 if (thePDGiSpin==1) {
162 G4double muB = 0.5*eplus*hbar_Planck/(thePDGMass/c_squared);
163 return 0.5*std::fabs(thePDGMagneticMoment/muB - 2.*thePDGCharge/eplus);
164 } else {
165 return 0.0;
166 }
167}
Note: See TracBrowser for help on using the repository browser.