GamR  0.0.0
GammaROOT
Loading...
Searching...
No Matches
CoulexCalculation.hh
Go to the documentation of this file.
1
8
9#ifndef GAMR_COULEX_COULEXCALCULATION_HH
10#define GAMR_COULEX_COULEXCALCULATION_HH
11
12#include <iostream>
13#include <fstream>
14#include <cmath>
15#include <vector>
16#include <map>
17#include <string>
18#include <complex>
19
20#include <TMath.h>
21
22#include <toolkit/Misc.hh>
23#include <angdist/AngDist.hh>
24#include "Eloss.hh"
25#include "WDBSubs.hh"
26#include "Coulex.hh"
27
28namespace GamR {
29 namespace Coulex {
33 struct Nucleus {
34 int Z;
35 float A;
36 };
37
41 struct Target {
43 float density;
44 float thickness;
45 };
46
50 enum Species { kNone = 0, kProjectile = 1, kTarget = 2 };
51
52 class Level {
53 public:
54 int fIndex;
55 std::string fName;
56 float fEnergy;
57 float fSpin;
58 bool fParity;
59 int fKBand;
62
63 Level(std::string name, float energy, float spin, bool parity, int kband) :
64 fName(name),
65 fIndex(0),
66 fEnergy(energy),
67 fSpin(spin),
68 fParity(parity),
69 fKBand(kband),
71 {
73 };
74
75 bool operator<(const Level &rhs) const { return fEnergy < rhs.fEnergy; }
76 std::string PrintSP();
77 };
78
82 class Transition {
83 public:
86 float fMatEl;
87 int fMult;
88
89 Transition(Level* initial, Level* final, float mat_el, int mult) :
90 fInitial(initial),
91 fFinal(final),
92 fMatEl(mat_el),
93 fMult(mult) {}
94 void SetMatEl(float mat_el) { fMatEl = mat_el; }
100 void SetBUp(float b_up) { fMatEl = std::sqrt(b_up*(2*fFinal->fSpin+1.0)); }
106 float GetBUp() { return fMatEl*fMatEl/(2*fFinal->fSpin+1.0); }
112 float Energy() {return fInitial->fEnergy - fFinal->fEnergy;}
113 bool Character();
114 std::string Type();
115 };
116
121 public:
122 std::map<std::string, Level*> fLevels;
123 std::vector<Transition*> fTransitions;
124
125 void AddLevel(std::string name, float energy, float spin, bool parity);
126 void AddLevel(float energy, float spin, bool parity);
127 void AddTransition(std::string initial, std::string final, float mat_el, float multipolarity);
128 void SetIndices();
129 void PrintLevels(int loi=-1);
130 void PrintTransitions(int toi=-1);
131 void Print(int loi=-1, int toi=-1);
132 Level* GetLevelByIndex(int i);
133 int GetNLevels() { return (int)fLevels.size(); }
134 int GetNTransitions() { return (int)fTransitions.size(); }
135 std::vector<WDB_nuclvl> GetLevels();
136 std::vector<WDB_nuctrans> GetETransitions();
137 std::vector<WDB_nuctrans> GetMTransitions();
138 };
139
144 public:
145 float fWidth;
146 float fHeight;
149
150 void Print();
151 void DrawSetup();
152 };
153
155 public:
165
166 void SetBeam(int Z, float A, float energy) {fBeam.Z = Z; fBeam.A = A; fBeamEnergy = energy; }
167 void SetBeam(std::string isotope, float energy) { int Z; double A; GamR::TK::GetZA(isotope, Z, A); SetBeam(Z, A, energy); }
168
169 void SetTarget(int Z, float A, float density, float thickness) {fTarget.isotope.Z = Z; fTarget.isotope.A = A; fTarget.density = density; fTarget.thickness = thickness; }
170 void SetTarget(std::string isotope, float density, float thickness) { int Z; double A; GamR::TK::GetZA(isotope, Z, A); SetTarget(Z, A, density, thickness); }
171 void SetDetected(Species detected) { fDetected = detected; }
172 void SetExcited(Species excited) { fExcited = excited; }
173 void SetParticleDet(float width, float height, float z, float r) { fParticleDetector.fWidth = width;
174 fParticleDetector.fHeight = height; fParticleDetector.fDistanceZ = z; fParticleDetector.fDistanceR = r; }
175 void SetInterests(int loi, int toi) { fLevelOfInterest = loi; fTransitionOfInterest = toi; }
176
177 int ReadFromFile(std::string file_name = "Wtheta.ans");
178 void SaveToFile(std::string file_name = "Wtheta.ans");
179
180 //interactive versions
181 void SetBeam();
182 void SetTarget();
183 void SetDetected();
184 void SetExcited();
185 void SetLevelScheme();
186 void SetInterests();
187 void SetParticleDet();
188
189 void ExperimentalSetup();
190
191 void Print();
193 };
194
195 GamR::Coulex::CoulexCalculation ExperimentalSetup(std::string file_name = "Wtheta.ans");
196 GamR::AngDist::StatTensor *DoCoulex(std::string file_name = "Wtheta.ans");
197 }
198}
199
200#endif
void SetBeam(std::string isotope, float energy)
GamR::AngDist::StatTensor * CalcTensor()
void SaveToFile(std::string file_name="Wtheta.ans")
int ReadFromFile(std::string file_name="Wtheta.ans")
void SetBeam(int Z, float A, float energy)
void SetTarget(std::string isotope, float density, float thickness)
void SetParticleDet(float width, float height, float z, float r)
void SetInterests(int loi, int toi)
void SetTarget(int Z, float A, float density, float thickness)
bool operator<(const Level &rhs) const
GamR::AngDist::StatTensor * fStatTensor
Level(std::string name, float energy, float spin, bool parity, int kband)
std::vector< WDB_nuclvl > GetLevels()
std::vector< WDB_nuctrans > GetETransitions()
std::map< std::string, Level * > fLevels
void Print(int loi=-1, int toi=-1)
void AddLevel(std::string name, float energy, float spin, bool parity)
std::vector< WDB_nuctrans > GetMTransitions()
void AddTransition(std::string initial, std::string final, float mat_el, float multipolarity)
std::vector< Transition * > fTransitions
void SetMatEl(float mat_el)
Transition(Level *initial, Level *final, float mat_el, int mult)
GamR::Coulex::CoulexCalculation ExperimentalSetup(std::string file_name)
GamR::AngDist::StatTensor * DoCoulex(std::string file_name)
int GetZA(std::string Nuclide, int &Z, double &A)
Definition Misc.cc:9
Definition Gain.cc:19