12 #ifndef ROOT_TGeoElement
13 #define ROOT_TGeoElement
27 class TGeoElementTable;
36 class TGeoElement :
public TNamed
41 kElemDefined = BIT(18),
42 kElementChecked = BIT(19)
50 Double_t *fAbundances;
55 TGeoElement(
const TGeoElement &other);
56 TGeoElement &operator=(
const TGeoElement &other);
59 void ComputeCoulombFactor();
61 void ComputeLradTsaiFactor();
66 TGeoElement(
const char *name,
const char *title, Int_t z, Double_t a);
67 TGeoElement(
const char *name,
const char *title, Int_t nisotopes);
68 TGeoElement(
const char *name,
const char *title, Int_t z, Int_t n, Double_t a);
70 virtual ~TGeoElement() {;}
72 virtual Int_t ENDFCode()
const {
return 0;}
73 Int_t Z()
const {
return fZ;}
74 Int_t N()
const {
return fN;}
75 Double_t Neff()
const;
76 Double_t A()
const {
return fA;}
77 void AddIsotope(TGeoIsotope *isotope, Double_t relativeAbundance);
78 Int_t GetNisotopes()
const {
return fNisotopes;}
79 TGeoIsotope *GetIsotope(Int_t i)
const;
80 Double_t GetRelativeAbundance(Int_t i)
const;
82 void ComputeDerivedQuantities();
84 virtual Double_t GetSpecificActivity()
const {
return 0.;}
85 Bool_t HasIsotopes()
const {
return (fNisotopes==0)?kFALSE:kTRUE;}
86 Bool_t IsDefined()
const {
return TObject::TestBit(kElemDefined);}
87 virtual Bool_t IsRadioNuclide()
const {
return kFALSE;}
88 Bool_t IsUsed()
const {
return TObject::TestBit(kElemUsed);}
89 virtual void Print(Option_t *option =
"")
const;
90 void SetDefined(Bool_t flag=kTRUE) {TObject::SetBit(kElemDefined,flag);}
91 void SetUsed(Bool_t flag=kTRUE) {TObject::SetBit(kElemUsed,flag);}
92 static TGeoElementTable *GetElementTable();
94 inline Double_t GetfCoulomb()
const {
return fCoulomb;}
96 inline Double_t GetfRadTsai()
const {
return fRadTsai;}
98 ClassDef(TGeoElement, 3)
108 class TGeoIsotope :
public TNamed
117 TGeoIsotope(
const char *name, Int_t z, Int_t n, Double_t a);
118 virtual ~TGeoIsotope() {}
120 Int_t GetZ()
const {
return fZ;}
121 Int_t GetN()
const {
return fN;}
122 Double_t GetA()
const {
return fA;}
123 static TGeoIsotope *FindIsotope(
const char *name);
124 virtual void Print(Option_t *option =
"")
const;
126 ClassDef(TGeoIsotope, 1)
135 class TGeoDecayChannel;
136 class TGeoBatemanSol;
138 class TGeoElementRN :
public TGeoElement
153 TGeoBatemanSol *fRatio;
157 void MakeName(Int_t a, Int_t z, Int_t iso);
160 TGeoElementRN(
const TGeoElementRN& elem);
161 TGeoElementRN& operator=(
const TGeoElementRN& elem);
165 TGeoElementRN(Int_t A, Int_t Z, Int_t iso, Double_t level,
166 Double_t deltaM, Double_t halfLife,
const char* JP,
167 Double_t natAbun, Double_t th_f, Double_t tg_f, Double_t th_s,
168 Double_t tg_s, Int_t status);
169 virtual ~TGeoElementRN();
171 void AddDecay(Int_t decay, Int_t diso, Double_t branchingRatio, Double_t qValue);
172 void AddDecay(TGeoDecayChannel *dc);
173 void AddRatio(TGeoBatemanSol &ratio);
175 static Int_t ENDF(Int_t a, Int_t z, Int_t iso) {
return 10000*z+10*a+iso;}
178 virtual Int_t ENDFCode()
const {
return fENDFcode;}
179 virtual Double_t GetSpecificActivity()
const;
180 virtual Bool_t IsRadioNuclide()
const {
return kTRUE;}
181 Int_t MassNo()
const {
return (Int_t)fA;}
182 Int_t AtomicNo()
const {
return fZ;}
183 Int_t IsoNo()
const {
return fIso;}
184 Double_t Level()
const {
return fLevel;}
185 Double_t MassEx()
const {
return fDeltaM;}
186 Double_t HalfLife()
const {
return fHalfLife;}
187 Double_t NatAbun()
const {
return fNatAbun;}
188 const char* PJ()
const {
return fTitle.Data();}
189 Double_t TH_F()
const {
return fTH_F;}
190 Double_t TG_F()
const {
return fTG_F;}
191 Double_t TH_S()
const {
return fTH_S;}
192 Double_t TG_S()
const {
return fTG_S;}
193 Double_t Status()
const {
return fStatus;}
194 Bool_t Stable()
const {
return !fDecays;}
195 TObjArray *Decays()
const {
return fDecays;}
196 Int_t GetNdecays()
const;
197 TGeoBatemanSol *Ratio()
const {
return fRatio;}
200 Bool_t CheckDecays()
const;
201 Int_t DecayResult(TGeoDecayChannel *dc)
const;
202 void FillPopulation(TObjArray *population, Double_t precision=0.001, Double_t factor=1.);
203 virtual void Print(Option_t *option =
"")
const;
204 static TGeoElementRN *ReadElementRN(
const char *record, Int_t &ndecays);
205 virtual void SavePrimitive(std::ostream &out, Option_t *option =
"");
207 ClassDef(TGeoElementRN, 2)
216 class TGeoDecayChannel :
public TObject
221 Double_t fBranchingRatio;
223 TGeoElementRN *fParent;
224 TGeoElementRN *fDaughter;
226 enum ENuclearDecayMode {
227 kBitMask32 = 0xffffffff,
228 k2BetaMinus = BIT(0),
244 TGeoDecayChannel() : fDecay(0), fDiso(0), fBranchingRatio(0), fQvalue(0), fParent(0), fDaughter(0) {}
245 TGeoDecayChannel(Int_t decay, Int_t diso, Double_t branchingRatio, Double_t qValue)
246 : fDecay(decay), fDiso(diso), fBranchingRatio(branchingRatio), fQvalue(qValue), fParent(0), fDaughter(0) {}
247 TGeoDecayChannel(
const TGeoDecayChannel &dc) : TObject(dc),fDecay(dc.fDecay),fDiso(dc.fDiso),fBranchingRatio(dc.fBranchingRatio),
248 fQvalue(dc.fQvalue),fParent(dc.fParent),fDaughter(dc.fDaughter) {}
249 virtual ~TGeoDecayChannel() {}
251 TGeoDecayChannel& operator=(
const TGeoDecayChannel& dc);
254 Int_t GetIndex()
const;
255 virtual const char *GetName()
const;
256 UInt_t Decay()
const {
return fDecay;}
257 Double_t BranchingRatio()
const {
return fBranchingRatio;}
258 Double_t Qvalue()
const {
return fQvalue;}
259 Int_t DeltaIso()
const {
return fDiso;}
260 TGeoElementRN *Daughter()
const {
return fDaughter;}
261 TGeoElementRN *Parent()
const {
return fParent;}
262 static void DecayName(UInt_t decay, TString &name);
264 void SetParent(TGeoElementRN *parent) {fParent = parent;}
265 void SetDaughter(TGeoElementRN *daughter) {fDaughter = daughter;}
267 virtual void Print(Option_t *opt =
" ")
const;
268 static TGeoDecayChannel *ReadDecay(
const char *record);
269 virtual void SavePrimitive(std::ostream &out, Option_t *option =
"");
270 virtual void DecayShift(Int_t &dA, Int_t &dZ, Int_t &dI)
const ;
272 ClassDef(TGeoDecayChannel,1)
281 class TGeoBatemanSol :
public TObject,
public TAttLine,
public TAttFill,
public TAttMarker
288 TGeoElementRN *fElem;
289 TGeoElementRN *fElemTop;
297 TGeoBatemanSol() : TObject(), TAttLine(), TAttFill(), TAttMarker(), fElem(NULL), fElemTop(NULL), fCsize(0), fNcoeff(0), fFactor(1.), fTmin(0.), fTmax(0), fCoeff(NULL) {}
298 TGeoBatemanSol(TGeoElementRN *elem);
299 TGeoBatemanSol(
const TObjArray *chain);
300 TGeoBatemanSol(
const TGeoBatemanSol& other);
303 TGeoBatemanSol& operator=(
const TGeoBatemanSol& other);
304 TGeoBatemanSol& operator+=(
const TGeoBatemanSol& other);
306 Double_t Concentration(Double_t time)
const;
307 virtual void Draw(Option_t *option=
"");
308 void GetCoeff(Int_t i, Double_t &cn, Double_t &lambda)
const {cn=fCoeff[i].cn; lambda=fCoeff[i].lambda;}
309 void GetRange(Double_t &tmin, Double_t &tmax)
const {tmin=fTmin; tmax=fTmax;}
310 TGeoElementRN *GetElement()
const {
return fElem;}
311 TGeoElementRN *GetTopElement()
const {
return fElemTop;}
312 Int_t GetNcoeff()
const {
return fNcoeff;}
313 virtual void Print(Option_t *option =
"")
const;
314 void SetRange(Double_t tmin=0., Double_t tmax=0.) {fTmin=tmin; fTmax=tmax;}
315 void SetFactor(Double_t factor) {fFactor = factor;}
316 void FindSolution(
const TObjArray *array);
317 void Normalize(Double_t factor);
319 ClassDef(TGeoBatemanSol,1)
331 const TGeoElementRN *fTop;
332 const TGeoElementRN *fElem;
335 Double_t fLimitRatio;
339 TGeoElemIter() : fTop(0), fElem(0), fBranch(0), fLevel(0), fLimitRatio(0), fRatio(0) {}
340 TGeoElementRN *Down(Int_t ibranch);
344 TGeoElemIter(TGeoElementRN *top, Double_t limit=1.e-4);
345 TGeoElemIter(
const TGeoElemIter &iter);
346 virtual ~TGeoElemIter();
348 TGeoElemIter &operator=(
const TGeoElemIter &iter);
349 TGeoElementRN *operator()();
350 TGeoElementRN *Next();
352 TObjArray *GetBranch()
const {
return fBranch;}
353 const TGeoElementRN *GetTop()
const {
return fTop;}
354 const TGeoElementRN *GetElement()
const {
return fElem;}
355 Int_t GetLevel()
const {
return fLevel;}
356 Double_t GetRatio()
const {
return fRatio;}
357 virtual void Print(Option_t *option=
"")
const;
358 void SetLimitRatio(Double_t limit) {fLimitRatio = limit;}
360 ClassDef(TGeoElemIter,0)
369 class TGeoElementTable :
public TObject
378 TObjArray *fIsotopes;
380 typedef std::map<Int_t, TGeoElementRN *> ElementRNMap_t;
381 typedef ElementRNMap_t::iterator ElementRNMapIt_t;
382 ElementRNMap_t fElementsRN;
385 TGeoElementTable(
const TGeoElementTable&);
386 TGeoElementTable& operator=(
const TGeoElementTable&);
391 TGeoElementTable(Int_t nelements);
393 virtual ~TGeoElementTable();
397 kETDefaultElements = BIT(14),
398 kETRNElements = BIT(15)
400 void AddElement(
const char *name,
const char *title, Int_t z, Double_t a);
401 void AddElement(
const char *name,
const char *title, Int_t z, Int_t n, Double_t a);
402 void AddElement(TGeoElement *elem);
403 void AddElementRN(TGeoElementRN *elem);
404 void AddIsotope(TGeoIsotope *isotope);
405 void BuildDefaultElements();
406 void ImportElementsRN();
407 Bool_t CheckTable()
const;
408 TGeoElement *FindElement(
const char *name)
const;
409 TGeoIsotope *FindIsotope(
const char *name)
const;
410 TGeoElement *GetElement(Int_t z) {
return (TGeoElement*)fList->At(z);}
411 TGeoElementRN *GetElementRN(Int_t ENDFcode)
const;
412 TGeoElementRN *GetElementRN(Int_t a, Int_t z, Int_t iso=0)
const;
413 TObjArray *GetElementsRN()
const {
return fListRN;}
414 Bool_t HasDefaultElements()
const {
return TObject::TestBit(kETDefaultElements);}
415 Bool_t HasRNElements()
const {
return TObject::TestBit(kETRNElements);}
417 Int_t GetNelements()
const {
return fNelements;}
418 Int_t GetNelementsRN()
const {
return fNelementsRN;}
419 void ExportElementsRN(
const char *filename=
"");
420 virtual void Print(Option_t *option =
"")
const;
422 ClassDef(TGeoElementTable,4)