GammaWare  Head Version for release 0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BaseNucleus.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2004 by Olivier Stezowski *
3  * stezow(AT)ipnl.in2p3.fr *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
20 
23 #ifndef Gw_BaseNucleus
24 #define Gw_BaseNucleus
25 #define GW_BASENUCLEUS_H Gw_BaseNucleus
26 
27 #ifndef ROOT_TObject
28 #include <TObject.h>
29 #endif
30 
31 #ifndef ROOT_TMap
32 #include <TMap.h>
33 #endif
34 
35 using namespace std;
36 
37 namespace Gw {
38 
46 class BaseNucleus : public TObject
47 {
48 private:
49  static TMap *gTable;
50 
51 protected:
52  Int_t fA; // total number of nucleons
53  Int_t fN; // number of neutrons
54  Int_t fZ; // number of protons
55 
56 public:
58  BaseNucleus() ;
59  explicit BaseNucleus(Int_t, Int_t, Int_t);
60  virtual ~BaseNucleus();
61 
62  Int_t GetA() const;
63  Int_t GetZ() const;
64  Int_t GetN() const;
65 
66  void SetA(Int_t A);
67  void SetZ(Int_t Z);
68  void SetN(Int_t N);
69 
71 
75  static bool LoadTable(const char *xmlfile = "");
76 
78 
81  bool SetAZN(Int_t A, Int_t Z);
82 
84 
88  bool SetAZN(const char* s);
89  /*
90  It returns false (without changing anything) if it cannot be a nucleus (i.e. A < Z).
91  If N != A - Z, it keeps A-Z and send a warning.
92  */
93  bool SetAZN(Int_t A, Int_t Z, Int_t N);
94 
96 
102  bool SetAZN(const char *s, Int_t A);
103 
105 
110  static const char *WhichSymbol(Int_t Z);
111  static const char *WhichSymbol(Int_t Z, Int_t A);
112 
114 
118  static Int_t WhichZ(const char *s);
119 
121 
125  static const char* WhichFullName(const char *s);
126 
128 
132  static const char* WhichFullName(Int_t Z);
133 
135  ClassDef(BaseNucleus,1) // Base class for a nucleus (just composition)
136 };
137 // inline members
138 inline Int_t BaseNucleus::GetA() const { return fA; }
139 inline Int_t BaseNucleus::GetZ() const { return fZ; }
140 inline Int_t BaseNucleus::GetN() const { return fN; }
141 inline void BaseNucleus::SetA(Int_t A) {fA = A;}
142 inline void BaseNucleus::SetZ(Int_t Z) {fZ = Z;}
143 inline void BaseNucleus::SetN(Int_t N) {fN = N;}
144 
145 }
146 #endif
Int_t Z[3000]
Base class for a nucleus which means its composition.
Definition: BaseNucleus.h:46
Int_t A[3000]