source: trunk/documents/UserDoc/DocBookUsersGuides/ForToolkitDeveloper/xml/GuideToExtendFunctionality/Particles/particles.xml @ 904

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

ajout de la doc

File size: 5.5 KB
Line 
1<!-- ******************************************************** -->
2<!--  Docbook Version:  For Toolkit Developers Guide          -->
3<!-- ******************************************************** -->
4
5<!-- ******************* Section (Level#1) ****************** -->
6<sect1 id="sect.ExtdFuncParticles">
7<title>
8Particles
9</title>
10
11<!-- ******************* Section (Level#2) ****************** -->
12<sect2 id="sect.ExtdFuncParticles.Properties">
13<title>
14Properties of particles
15</title>
16
17<para>
18The <emphasis>G4ParticleDefinition</emphasis> class has
19properties to characterize individual particles,
20such as name, mass, charge, spin, and so on.
21Properties of particles are set during initialization of each particle.
22Default values of particle properties are described in each particles class.
23In addition, properties of heavy nuclei can be given by external files.
24Basicaly, these properties can not be changed after initialization phase except for
25ones related its decay; life time, branching ratio of each decay mode and
26 the ``stable'' flag. However, Geant4 proivides a method to override these properties
27by using external files.
28</para>
29
30
31<!-- ******* Bridgehead ******* -->
32<bridgehead renderas='sect4'>
33Properties of nuclei
34</bridgehead>
35
36<para>
37Individual classes are provided for light nuclei (i.e. deuteron, triton, He3, and He4)
38with default values of their properties.
39Other nuclei are dynamically created by requests from processes (and users).
40<emphasis>G4IonTable</emphasis> class handles creation of such ions.
41Default properties of nuclei are determined with help of <emphasis>G4NuclearProperties</emphasis>.
42</para>
43<para>
44Users can register a <emphasis>G4IsotopeTable</emphasis> to the
45<emphasis>G4IonTable</emphasis>. <emphasis>G4IsotopeTable</emphasis>
46describes properties of ions which are used to create ions.
47You can get exited energy, decay modes, and life time for relatively long life nuclei
48by using <emphasis>G4RIsotopeTable</emphasis> and data files
49(G4RADIOACTIVEDATA should be set to the directory where data files exist).
50<emphasis>G4IsotopeMagneticMomentTable</emphasis> provides a table of
51magnetic moment of nuclei with the data file of
52<emphasis>G4IsotopeMagneticMoment.table</emphasis> (The file name should be set to G4IONMAGNETICMOMENT )
53</para>
54
55<!-- ******* Bridgehead ******* -->
56<bridgehead renderas='sect4'>
57Changing particle properties
58</bridgehead>
59
60<para>
61Only in ``PreInit'' phase, properties can be modified with help of
62 <emphasis> G4ParticlePropertyTable</emphasis> class.
63Particle properties can be overridden with the method
64<informalexample><programlisting>
65G4bool SetParticleProperty(const G4ParticlePropertyData& newProperty)
66</programlisting></informalexample>
67by setting new values in <emphasis> G4ParticlePropertyData </emphasis>.
68In addition, the current values of particles properties can be extracted
69into text files by using  <emphasis> G4TextPPReporter </emphasis>.
70On the other hand, <emphasis> G4TextPPRetriever </emphasis> can change particle
71properties according to text files.
72</para>
73
74</sect2>
75
76<!-- ******************* Section (Level#2) ****************** -->
77<sect2 id="sect.ExtdFuncParticles.AddNewPar">
78<title>
79Adding New Particles
80</title>
81
82<para>
83You can add a new particle by creating a new class for it.
84The new class should be derived from <emphasis>G4ParticleDefinition</emphasis>.
85You can find an example under examples/extended/exoticphysics/monopole.
86A new class for the monople is defined as follows;
87<informalexample><programlisting>
88class G4Monopole : public G4ParticleDefinition
89{
90private:
91  static G4Monopole*  theMonopole;
92
93  G4Monopole(
94       const G4String&     aName,        G4double            mass,
95       G4double            width,        G4double            charge,   
96       G4int               iSpin,        G4int               iParity,   
97       G4int               iConjugation, G4int               iIsospin,   
98       G4int               iIsospin3,    G4int               gParity,
99       const G4String&     pType,        G4int               lepton,     
100       G4int               baryon,       G4int               encoding,
101       G4bool              stable,       G4double            lifetime,
102       G4DecayTable        *decaytable );
103
104public:
105   virtual ~G4Monopole();
106   static G4Monopole* MonopoleDefinition();
107   static G4Monopole* Monopole();
108}
109</programlisting></informalexample>
110Static methods above need to be defined and implemented so that
111this new particle instance will be created
112in ConstructParticls method of your physics list.
113You can add new properties if necessary (G4Monopole has a property for magnetic charge)
114Values of properties need to be given in the static method as other particle classes.
115<informalexample><programlisting>
116G4Monopole* G4Monopole::MonopoleDefinition(G4double mass, G4int mCharge, G4int eCharge)
117{   
118  if(!theMonopole) {
119    theMonopole = new G4Monopole(
120              "monopole",         mass,       0.0*MeV,           0,
121                    0,               0,             0,         
122                    0,               0,             0,             
123              "boson",               0,             0,           0,
124                 true,            -1.0,             0);
125  }
126  return theMonopole;
127}
128</programlisting></informalexample>
129</para>
130
131<!-- ******* Bridgehead ******* -->
132<bridgehead role="revisionHistory" renderas="sect4">
133[Status of this chapter]
134</bridgehead>
135<para>
136<simplelist type="var">
137  <member>
138    Nov. 2008 cretad by H. Kurashige
139  </member>
140</simplelist>
141</para>
142
143</sect2>
144</sect1>
145
Note: See TracBrowser for help on using the repository browser.