MURE
Loading...
Searching...
No Matches
ZAI.hxx
Go to the documentation of this file.
1/*
2 This file is part of MURE,
3 Copyright (C) 2007-2021 MURE developers.
4
5 MURE is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 MURE 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 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public License
16 along with MURE. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19#ifndef _ZAI_
20#define _ZAI_
21
27#include <cmath>
28#include <iostream>
29#include <string>
30#include <vector>
31#include <algorithm>
32
33#include "XSDIRLine.hxx"
34#include "ReactionList.hxx"
35
36class ReactionList;
37class XSDIRLine;
38
39using namespace std;
40
41
43
50{
51 public:
53 {
54 fCode = 0;
55 fWeight = 0;
56 }
57 ZAIReaction(int code, double weight)
58 {
59 fCode = code;
60 fWeight = weight;
61 }
63 {
64 fCode = zr.fCode ;
65 fWeight = zr.fWeight;
66 }
67 ~ZAIReaction() {/*cout<<"DEST ZAIReaction "<<this<<endl;*/}
68 void SetCode(int code)
69 {
70 fCode = code;
71 }
72 int GetCode()
73 {
74 return fCode;
75 }
76 void SetWeight(double weight)
77 {
78 fWeight = weight;
79 }
80 double GetWeight()
81 {
82 return fWeight;
83 }
85
91 void SetReaction(int code, double weight)
92 {
93 fCode = code;
94 fWeight = weight;
95 }
96
97 private:
98 int fCode;
99 double fWeight;
100};
101
102
104
117class ZAI
118{
119 public:
121
127 ZAI(int aZ, int aA, int aI);
128 ZAI();
129 ZAI(const ZAI &zai);
130 ~ZAI();
131
136 int Z()
137 {
138 return fZ;
139 }
140 int A()
141 {
142 return fA;
143 }
144 int I()
145 {
146 return fI;
147 }
148 int N()
149 {
150 return fA - fZ;
151 }
152 void SetZ(int aZ)
153 {
154 fZ = aZ;
155 }
156 void SetA(int aA)
157 {
158 fA = aA;
159 }
160 void SetI(int aI)
161 {
162 fI = aI;
163 }
164 void SetMass(double m)
165 {
166 fMass = m;
167 }
168 double GetMass();
169 void SetName(string Name)
170 {
171 fName = Name;
172 }
173 string GetName()
174 {
175 return fName;
176 }
177 string GetFullName();
179
184 void SetHalfLifeTime(double T_12)
185 {
186 fHalfLifeTime = T_12;
187 }
189 {
190 return fHalfLifeTime;
191 }
192 void SetDecayConstant(double lambda)
193 {
194 fHalfLifeTime = log(2.) / lambda;
195 }
197 {
198 if (fHalfLifeTime)return log(2.) / fHalfLifeTime;
199 return 0.;
200 }
201
203 {
204 return fDecayDaughter.size();
205 }
207 {
208 return fDecayDaughter[i];
209 }
210 vector < ZAI *> &GetDecayDaughter()
211 {
212 return fDecayDaughter;
213 }
215 {
216 return fDecayParent.size();
217 }
218 vector < double > &GetDecayBranchingRatio()
219 {
220 return fDecayBranchingRatio;
221 }
223 {
224 return fDecayBranchingRatio[i];
225 }
226 void SetDecayBranchingRatio(int i, double BR)
227 {
228 fDecayBranchingRatio[i] = BR;
229 }
231 {
232 return fDecayParent[i];
233 }
234 vector < ZAI *> &GetDecayParent()
235 {
236 return fDecayParent;
237 }
238 void AddDecayDaughter(ZAI *Daughter, double BR, int DecayMode);
239 void AddDecayParent(ZAI *Parent);
240 void CutFromMammaDecay(ZAI *mamma);
242 {
243 return fAllDecays;
244 }
245 void SetAllDecays(string decays)
246 {
247 fAllDecays = decays;
248 }
249 vector < int > &GetDecayMode()
250 {
251 return fDecayMode;
252 }
253 int GetDecayMode(int i)
254 {
255 return fDecayMode[i];
256 }
257 void Stable()
258 {
259 fStable = true;
260 }
261 bool IsStable()
262 {
263 return fStable;
264 }
266
273 {
274 return fAllowedReaction;
275 }
276
278 {
279 return fReactionDaughter.size();
280 }
282 {
283 return fReactionParent.size();
284 }
286 {
287 return fReactionParent[i];
288 }
289 vector < ZAI *> &GetReactionParent()
290 {
291 return fReactionParent;
292 }
294 {
295 return fReactionDaughter[i];
296 }
297 vector < ZAI *> &GetReactionDaughter()
298 {
299 return fReactionDaughter;
300 }
301 void AddReactionDaughter(ZAI *Daughter, int code, double weight, bool replace = false);
302 void AddReactionParent(ZAI *Parent);
303 void CutFromMammaReaction(ZAI *mamma);
304 vector < ZAIReaction *> &GetZAIReaction()
305 {
306 return fReactionCode;
307 }
309 {
310 return GetZAIReaction()[i] -> GetCode();
311 }
312 double GetReactionWeight(int i)
313 {
314 return GetZAIReaction()[i] -> GetWeight();
315 }
318
323 void SetCanFission(bool state = true)
324 {
325 fCanFission = state;
326 }
328 {
329 return fCanFission;
330 }
331
332 void SetIsRealFissile(bool state = true)
333 {
334 fIsRealFissile = state;
335 }
337 {
338 return fIsRealFissile;
339 }
341 {
342 return fNubar;
343 }
344 void SetApproximateNubar(double nu)
345 {
346 fNubar = nu;
347 }
348 void FindApproximateNubar();
350 {
351 fFissionProduct = true;
352 }
354 {
355 return fFissionProduct;
356 }
358 {
360 }
362 {
364 }
366
372
378 string Print(string tab = "", bool WithDaughter = true, bool FirstGeneration = false, double BR = 0);
380
386 string PrintDecay(string tab = "", bool WithDaughter = true, bool FirstGeneration = false, double BR = 0);
388
393 string PrintReaction(string tab = "", bool WithDaughter = true, bool FirstGeneration = false);
394 string PrintParent();
395 string PrintInfo();
396 string PrintName();
398
403 void ResetDummy();
404
406
412 void SetInDataBase(int state)
413 {
414 fInbase = state - 1;
415 }
416 bool IsInDataBase();
418 {
419 return fSaveXSDIRLine;
420 }
421
423
427 XSDIRLine *FindXSDIRLine(int &other_isomer);
429
435
443 bool IsZAIInMyFamilly(int Z, int A, int I, ZAI *&ZaiOfMyFamilly);
444 void Used()
445 {
446 fUsed = true;
447 }
448 void NotUsed()
449 {
450 fUsed = false;
451 }
452 bool IsUsed()
453 {
454 return fUsed;
455 }
456 double BranchingRatioSum();
457 //double BranchingRatio(int i){return fDecayBranchingRatio[i];} //!< returns the ith decay branching ratio
458 void Delete()
459 {
460 fDelete = true;
461 }
462 bool IsDelete()
463 {
464 return fDelete;
465 }
467 {
468 fExploredZAI.push_back(this);
469 fHaveBeenHere = true;
470 }
472 {
473 return fHaveBeenHere;
474 }
475
476
477 void FindMass();
478
479
481 {
482 fCanEmitBeta = true;
483 }
485 {
486 return fCanEmitBeta;
487 }
488
490 {
492 }
494 {
496 }
497
499 {
500 fHasIsomer = true;
501 }
503 {
504 return fHasIsomer;
505 }
507 {
508 fAlternateZAI = zai;
509 }
511 {
512 return fAlternateZAI;
513 }
514 bool operator== (ZAI zai);
516 {
517 fNonEvolvingZai = true;
518 }
520 {
521 return fNonEvolvingZai;
522 }
523
524 void SetIsMotherOfCutBetaDecayer(ZAI *daughter, double BR);
526
527 protected:
529
535 void IncrementBR(int num, double BR)
536 {
537 fDecayBranchingRatio[num] += BR;
538 }
540
547 bool PrivateIsZAIInMyFamilly(int Z, int A, int I, ZAI *&ZaiOfMyFamilly);
549
556 string PrivatePrintReaction(string tab = "", bool WithDaughter = true, bool FirstGeneration = false, bool firstcall = true);
557
558
559 string fName;
560 int fZ;
561 int fA;
562 int fI;
563 double fMass;
565
566 string fAllDecays;
569 vector < ZAI * > fDecayDaughter;
570 vector < ZAI * > fDecayParent;
571 vector < double > fDecayBranchingRatio;
572 vector < int > fDecayMode;
573 vector < ZAI * > fReactionDaughter;
574 vector < ZAI * > fReactionParent;
575 vector < ZAIReaction * > fReactionCode;
577
578 bool fUsed;
582
591
593 static vector < ZAI *> fExploredZAI;
595
596 vector < ZAI *> fCutBetaDaughters;
597 vector < double > fCutBetaBR;
598
599 public:
601 double fNubar;
602};
603#endif
Header file for ReactionList class.
Header file for XSDIRLine class.
Reactions to take into account for evolution of a given nucleus.
Definition ReactionList.hxx:69
Extract all parameters from an XSDIR line.
Definition XSDIRLine.hxx:43
A very simple class which contains the Reaction code and its weight for possible nuclear reactions of...
Definition ZAI.hxx:50
void SetWeight(double weight)
Definition ZAI.hxx:76
double GetWeight()
Definition ZAI.hxx:80
int fCode
Reaction code (ENDF)
Definition ZAI.hxx:98
void SetReaction(int code, double weight)
Set a reaction code &weight.
Definition ZAI.hxx:91
ZAIReaction(int code, double weight)
Definition ZAI.hxx:57
void SetCode(int code)
Definition ZAI.hxx:68
~ZAIReaction()
Definition ZAI.hxx:67
double fWeight
Cross-section weight.
Definition ZAI.hxx:99
int GetCode()
Definition ZAI.hxx:72
ZAIReaction()
Definition ZAI.hxx:52
ZAIReaction(ZAIReaction const &zr)
Definition ZAI.hxx:62
A ZAI defined a (Z, A, Isomere) for a Nucleus.
Definition ZAI.hxx:118
ZAI * GetDecayDaughter(int i)
Definition ZAI.hxx:206
ZAI * GetReactionDaughter(int i)
Definition ZAI.hxx:293
int GetReactionCode(int i)
Definition ZAI.hxx:308
vector< ZAI * > fReactionDaughter
vector of reaction Daughter
Definition ZAI.hxx:573
void SetI(int aI)
Definition ZAI.hxx:160
vector< ZAIReaction * > fReactionCode
vector of the reaction codes
Definition ZAI.hxx:575
double fHalfLifeTime
Decay Half life constant.
Definition ZAI.hxx:564
void AddDecayParent(ZAI *Parent)
Add decay Parent.
Definition ZAI.cxx:215
void SetCanEmitBeta()
Definition ZAI.hxx:480
vector< ZAI * > fDecayDaughter
vector of decay Daughter
Definition ZAI.hxx:569
void SetDecayConstant(double lambda)
Definition ZAI.hxx:192
void Delete()
Definition ZAI.hxx:458
void IncrementBR(int num, double BR)
Increment a Branching Ratio.
Definition ZAI.hxx:535
int N()
Definition ZAI.hxx:148
static vector< ZAI * > fExploredZAI
Definition ZAI.hxx:593
void FissionProduct()
Definition ZAI.hxx:349
bool operator==(ZAI zai)
return true if Z, A and I are the same
Definition ZAI.cxx:960
string GetName()
Definition ZAI.hxx:173
bool fCanEmitBeta
flag to show if it can emit a beta-
Definition ZAI.hxx:587
int GetDecayMode(int i)
Definition ZAI.hxx:253
bool fHasIsomer
flag to show if another state(s) exists
Definition ZAI.hxx:583
bool IsDelete()
Definition ZAI.hxx:462
void SetAlternateZAI(ZAI *zai)
Definition ZAI.hxx:506
bool IsForceNonEvolvingZai()
Definition ZAI.hxx:519
int I()
Definition ZAI.hxx:144
double GetDecayConstant()
Definition ZAI.hxx:196
double GetHalfLifeTime()
Definition ZAI.hxx:188
int fInbase
flag to know IsInDataBase status
Definition ZAI.hxx:581
void SetInDataBase(int state)
Set the fInbase attribute to state-1.
Definition ZAI.hxx:412
double fMass
Mass of a ZAI.
Definition ZAI.hxx:563
void SetHalfLifeTime(double T_12)
Definition ZAI.hxx:184
int GetReactionDaughterSize()
Definition ZAI.hxx:277
bool IsFissionProduct()
Definition ZAI.hxx:353
bool IsZAIInMyFamilly(int Z, int A, int I, ZAI *&ZaiOfMyFamilly)
return true if the ZAI(Z, A, I) belong to this.
Definition ZAI.cxx:902
vector< ZAI * > & GetReactionDaughter()
Definition ZAI.hxx:297
bool fCanEmitDelayedNeutron
flag to show if it is a delayed neutron precursor
Definition ZAI.hxx:588
int fI
Isomeric state (Ground State, ith excited)
Definition ZAI.hxx:562
double fEnergyReleasedFromFission
The energy released from the fission of this isotope (default = 200 MeV only makes sense for fissile ...
Definition ZAI.hxx:590
vector< ZAIReaction * > & GetZAIReaction()
Definition ZAI.hxx:304
string PrintName()
Print only Name, A, I.
Definition ZAI.cxx:490
bool fUsed
whether a ZAI is really used in a Material
Definition ZAI.hxx:578
vector< double > fDecayBranchingRatio
vector of decay Branching Ratio.
Definition ZAI.hxx:571
bool PrivateIsZAIInMyFamilly(int Z, int A, int I, ZAI *&ZaiOfMyFamilly)
return true if the ZAI(Z, A, I) belong to this.
Definition ZAI.cxx:909
bool fAllowedReactionWasSet
Definition ZAI.hxx:567
void SetCanFission(bool state=true)
Definition ZAI.hxx:323
vector< ZAI * > fReactionParent
vector of reaction Parent
Definition ZAI.hxx:574
bool fDelete
whether a ZAI is deleted
Definition ZAI.hxx:579
bool fStable
whether a ZAI is stable
Definition ZAI.hxx:580
void AddReactionDaughter(ZAI *Daughter, int code, double weight, bool replace=false)
Add reaction Daughter.
Definition ZAI.cxx:447
int A()
Definition ZAI.hxx:140
double GetMass()
get the molar mass of a ZAI (g/mol)
Definition ZAI.cxx:274
bool CanEmitDelayedNeutron()
Definition ZAI.hxx:493
void SetIsRealFissile(bool state=true)
Definition ZAI.hxx:332
ZAI()
Default constructor.
Definition ZAI.cxx:42
string fAllDecays
All possible decays string.
Definition ZAI.hxx:566
~ZAI()
destructor
Definition ZAI.cxx:162
vector< int > fDecayMode
vector of decay modes
Definition ZAI.hxx:572
ReactionList * fAllowedReaction
The allowed reaction list for this ZAI (if fEvolved)
Definition ZAI.hxx:568
void SetApproximateNubar(double nu)
Definition ZAI.hxx:344
string PrintInfo()
Print all known Information of a ZAI.
Definition ZAI.cxx:655
vector< ZAI * > & GetDecayParent()
Definition ZAI.hxx:234
void SetEnergyReleasedFromFission(double Energy)
Definition ZAI.hxx:357
string GetAllDecays()
Definition ZAI.hxx:241
double ApproximateNubar()
Definition ZAI.hxx:340
void ForceNonEvolvingZai()
Definition ZAI.hxx:515
bool CanEmitBeta()
Definition ZAI.hxx:484
void Stable()
Definition ZAI.hxx:257
bool fCanFission
flag to show if it can fission
Definition ZAI.hxx:585
vector< ZAI * > & GetReactionParent()
Definition ZAI.hxx:289
void SetCanEmitDelayedNeutron()
Definition ZAI.hxx:489
vector< ZAI * > fDecayParent
vector of decay parent
Definition ZAI.hxx:570
void FindApproximateNubar()
find approximate value for mean number of neutron/fission (enter by pto's hand from ENDF B VII)
Definition ZAI.cxx:967
int fZ
number of protons
Definition ZAI.hxx:560
ZAI * GetReactionParent(int i)
Definition ZAI.hxx:285
bool fIsRealFissile
flag to show if it is a REAL fissile nucleus
Definition ZAI.hxx:586
void SetReactionList(ReactionList *l)
Set the allowed Reactions for an ZAI.
Definition ZAI.cxx:244
void AddedToMaterial()
Definition ZAI.hxx:466
double BranchingRatioSum()
returns the total sum of BR (normally >=1 && <=2)
Definition ZAI.cxx:222
double GetEnergyReleasedFromFission()
Definition ZAI.hxx:361
int fA
number of nucleons (A=0 means natural isotopes)
Definition ZAI.hxx:561
void SetIsMotherOfCutBetaDecayer(ZAI *daughter, double BR)
Fill vector of nuclei cut from tree.
Definition ZAI.cxx:1195
bool IsInDataBase()
return whether or not a nucleus is in BaseSummary file.
Definition ZAI.cxx:250
bool fNonEvolvingZai
to for a zai to not evolve but be present in MCNP composition
Definition ZAI.hxx:576
vector< int > & GetDecayMode()
Definition ZAI.hxx:249
string fName
Name of the ZAI.
Definition ZAI.hxx:559
void NotUsed()
Definition ZAI.hxx:448
bool fIsMotherOfBetaDecayer
Is ZAI a mother of a beta decaying nucleus?
Definition ZAI.hxx:589
void CutFromMammaDecay(ZAI *mamma)
Suppress Decay references of ZAI from mamma.
Definition ZAI.cxx:713
bool HasIsomer()
Definition ZAI.hxx:502
void SetMass(double m)
Definition ZAI.hxx:164
bool fFissionProduct
whether a ZAI is produced directly from ANY fission
Definition ZAI.hxx:584
vector< double > fCutBetaBR
The branching ratios of the cut beta decayers.
Definition ZAI.hxx:597
void SetA(int aA)
Definition ZAI.hxx:156
double fNubar
approximate value for mean number of neutron/fission
Definition ZAI.hxx:601
bool IsRealFissile()
Definition ZAI.hxx:336
void RemoveReactionDaugther()
Remove reaction daugther of a ZAI.
Definition ZAI.cxx:789
int GetDecayDaughterSize()
Definition ZAI.hxx:202
double GetDecayBranchingRatio(int i)
Definition ZAI.hxx:222
ReactionList * GetReactionList()
Definition ZAI.hxx:272
ZAI * GetAlternateZAI()
Definition ZAI.hxx:510
XSDIRLine * FindXSDIRLine(int &other_isomer)
Find the XSDIRLine for a ZAI.
Definition ZAI.cxx:348
void FindMass()
find mass when no evolution required
Definition ZAI.cxx:280
vector< double > & GetDecayBranchingRatio()
Definition ZAI.hxx:218
string Print(string tab="", bool WithDaughter=true, bool FirstGeneration=false, double BR=0)
Print a ZAI.
Definition ZAI.cxx:506
void Used()
Definition ZAI.hxx:444
int Z()
Definition ZAI.hxx:136
bool IsAddedToMaterial()
Definition ZAI.hxx:471
XSDIRLine * GetSaveXSDIRLine()
Definition ZAI.hxx:417
string PrintParent()
Print the Parents of a ZAI.
Definition ZAI.cxx:634
ZAI * fAlternateZAI
If no XS data, gives alternate ZAI i.e G.S. ZAI if isomer.
Definition ZAI.hxx:592
void ResetDummy()
Reset all fHaveBeenHere to false to allow other recursive method calls.
Definition ZAI.cxx:943
void AddReactionParent(ZAI *Parent)
Add reaction Parent.
Definition ZAI.cxx:440
vector< ZAI * > fCutBetaDaughters
List of the ZAI that were cut.
Definition ZAI.hxx:596
void CutFromMammaReaction(ZAI *mamma)
Suppress Reaction references of ZAI from mamma.
Definition ZAI.cxx:825
string PrintReaction(string tab="", bool WithDaughter=true, bool FirstGeneration=false)
Print a ZAI and its Reaction Daughter.
Definition ZAI.cxx:586
int GetDecayParentSize()
Definition ZAI.hxx:214
string PrivatePrintReaction(string tab="", bool WithDaughter=true, bool FirstGeneration=false, bool firstcall=true)
Print a ZAI and its Reaction Daughter.
Definition ZAI.cxx:594
int GetReactionParentSize()
Definition ZAI.hxx:281
bool CanFission()
Definition ZAI.hxx:327
void SetHasIsomer()
Definition ZAI.hxx:498
ZAI * GetDecayParent(int i)
Definition ZAI.hxx:230
void SetName(string Name)
Definition ZAI.hxx:169
void AddDecayDaughter(ZAI *Daughter, double BR, int DecayMode)
Add decay Daughter with Branching Ratio BR &Decay mode.
Definition ZAI.cxx:193
bool IsUsed()
Definition ZAI.hxx:452
bool IsStable()
Definition ZAI.hxx:261
XSDIRLine * fSaveXSDIRLine
the xsdir line for a given ZAI
Definition ZAI.hxx:594
void SetAllDecays(string decays)
Definition ZAI.hxx:245
bool fHaveBeenHere
flag used in recursive method to avoid infinit loop.
Definition ZAI.hxx:600
vector< ZAI * > & GetDecayDaughter()
Definition ZAI.hxx:210
string GetFullName()
returns the fule name (A, name, Isomeroc state)
Definition ZAI.cxx:952
double GetReactionWeight(int i)
Definition ZAI.hxx:312
void SetZ(int aZ)
Definition ZAI.hxx:152
void SetDecayBranchingRatio(int i, double BR)
Definition ZAI.hxx:226
string PrintDecay(string tab="", bool WithDaughter=true, bool FirstGeneration=false, double BR=0)
Print a ZAI and its Decay Daughter.
Definition ZAI.cxx:546
the namespace of the Standard C++

MURE Project, documentation generated by Doxygen 1.9.7 - Fri Jan 19 2024