GRSISort "v4.0.0.5"
An extension of the ROOT analysis Framework
Loading...
Searching...
No Matches
TReaction.h
Go to the documentation of this file.
1#ifndef TREACTION_H
2#define TREACTION_H
3
4/** \addtogroup Fitting Fitting & Analysis
5 * @{
6 */
7
8#include <iostream>
9#include <string>
10#include <cmath>
11
12#include "TNamed.h"
13#include "TMath.h"
14#include "TGraph.h"
15
16#include "TNucleus.h"
17
18#ifndef PI
19#define PI (3.14159265358979312e+00)
20#endif
21
22#ifndef R2D
23#define R2D (5.72957795130823229e+01)
24#endif
25
26#ifndef D2R
27#define D2R (1.74532925199432955e-02)
28#endif
29
30/// *********** *********** *********** *********** *********** *********** *********** //
31///
32/// \class TReaction
33///
34/// A simple, intuitive two body reaction class.
35/// Lab frame variables are generally calculated by boosting from the CM frame
36/// Reactions have the form A(B,C)D where;
37/// [0] - B is "beam"
38/// [1] - A is "targ"
39/// [2] - C is "ejec"
40/// [3] - D is "reco"
41///
42/// Uses planck units (c=1 and is dimensionless)
43/// M = mc^2
44/// E = full mass energy (inc. kinetic energy)
45/// T = kinetic energy
46/// V = magnitude of velocity (=beta)
47/// P = magnitude of momentum
48/// G = gamma factor (=[1-V^2]^-0.5)
49///
50/// * An excitation energy can be included in the final state heavy recoil nucleus using ex3
51/// in the reaction initialisation or by using SetExcEnergy(exc)
52/// * ALL ENERGIES ARE IN MEV - MASSES TOO !
53/// * currently only works for part==2, I think that part==3 just means theta_cm -> -theta_cm
54///
55/// BUGS
56/// THERE ARE PERSISTANT NUMERICAL ERRORS (~0.1-1%) ...??! WHY?!!?!
57/// *********** *********** *********** *********** *********** *********** *********** //
58
59class TReaction : public TNamed {
60public:
61 TReaction(const char* beam, const char* targ, const char* ejec, const char* reco, double eBeam = 0.0, double ex3 = 0.0, bool inverse = false);
62
63 void InitReaction();
64
65 // returns reaction input parameters
66 const char* GetNameFull() const { return Form("%s @ %.3f MeV/u", this->GetName(), fTLab[0] / fNuc[0]->GetA()); }
67 TNucleus* GetNucleus(int part) const { return fNuc[part]; }
68 double GetM(int part) const { return fM[part]; }
69 double GetExc() const { return fExc; }
70 double GetQVal() const { return fQVal; }
71 bool Inverse() const { return fInverse; }
72 double GetTBeam(bool inverse) const;
73 double GetVBeam() const { return fVLab[0]; }
74
75 // CM frame properties
76 double GetInvariantMass() const { return fInvariantMass; }
77 double GetCmE() const { return fCmE; }
78 double GetCmTi() const { return fCmTi; }
79 double GetCmTf() const { return fCmTf; }
80 double GetCmV() const { return fCmV; }
81 double GetCmP() const { return fCmP; }
82 double GetCmG() const { return fCmG; }
83
84 // particle properties in CM frame
85 double GetECm(int part) const { return fECm[part]; }
86 double GetTCm(int part) const { return fTCm[part]; }
87 double GetVCm(int part) const { return fVCm[part]; }
88 double GetPCm(int part) const { return fPCm[part]; }
89 double GetGCm(int part) const { return fGCm[part]; }
90
91 // particle properties in LAB frame (default is beam)
92 double GetThetaMax(int part) const { return fThetaMax[part]; }
93 // this stuff depends on the lab angle as the cm motion and the particle in the cm are coupled
94 double GetELab(double theta_lab = 0.0, int part = 0) const
95 {
96 return GetELabFromThetaCm(ConvertThetaLabToCm(theta_lab, part), part);
97 }
98 double GetTLab(double theta_lab = 0.0, int part = 0) const
99 {
100 return GetTLabFromThetaCm(ConvertThetaLabToCm(theta_lab, part), part);
101 }
102 double GetVLab(double theta_lab = 0.0, int part = 0) const
103 {
104 return GetVLabFromThetaCm(ConvertThetaLabToCm(theta_lab, part), part);
105 }
106 double GetPLab(double theta_lab = 0.0, int part = 0) const
107 {
108 return GetPLabFromThetaCm(ConvertThetaLabToCm(theta_lab, part), part);
109 }
110 double GetGLab(double theta_lab = 0.0, int part = 0) const
111 {
112 return GetGLabFromThetaCm(ConvertThetaLabToCm(theta_lab, part), part);
113 }
114
115 // this stuff depends on the CM angle as the cm motion and the particle in the cm are coupled
116 double GetELabFromThetaCm(double theta_cm = 0.0, int part = 0) const; // FULL MASS+KINETIC ENERGY
117 double GetTLabFromThetaCm(double theta_cm = 0.0, int part = 0) const; // KINETIC ENERGY
118 double GetVLabFromThetaCm(double theta_cm = 0.0, int part = 0) const;
119 double GetPLabFromThetaCm(double theta_cm = 0.0, int part = 0) const;
120 double GetGLabFromThetaCm(double theta_cm = 0.0, int part = 0) const;
121
122 double GetExcEnergy(double ekin = 0.00, double theta_lab = 0.00, int part = 2) const;
123 void AnalysisAngDist(double ekin, double theta_lab, int part, double& exc, double& theta_cm, double& omega_lab2cm);
124 double AnalysisBeta(double ekin, int part) const;
125
126 double GetRutherfordCm(double theta_cm, int part = 2, bool Units_mb = true) const;
127 double GetRutherfordLab(double theta_lab, int part = 2, bool Units_mb = true) const;
128
129 // Conversion from LAB frame to CM frame
130 double ConvertThetaLabToCm(double theta_lab, int part = 2) const;
131 double ConvertOmegaLabToCm(double theta_lab, int part = 2) const;
132 void ConvertLabToCm(double theta_lab, double omega_lab, double& theta_cm, double& omega_cm, int part = 2) const;
133
134 // Conversion from CM frame to LAB frame
135 double ConvertThetaCmToLab(double theta_cm, int part = 2) const;
136 double ConvertOmegaCmToLab(double theta_cm, int part = 2) const;
137 void ConvertCmToLab(double theta_cm, double omega_cm, double& theta_lab, double& omega_lab, int part = 2) const;
138
139 // Graphs for conversions and kinematic/cross-section curves
140 // Frame_Lab -> TLab[ThetaLab] and Frame_Cm -> TLab[ThetaCm]
141 TGraph* KinVsTheta(double thmin = 0.0, double thmax = 180.0, int part = 2, bool Frame_Lab = true, bool Units_keV = true) const;
142 // Frame_Lab -> ThetaCm[ThetaLab] and Frame_Cm -> ThetaLab[ThetaCm]
143 TGraph* ThetaVsTheta(double thmin = 0.0, double thmax = 180.0, int part = 2, bool Frame_Lab = true) const;
144 // Frame_Lab -> dOmegaCm/dOmegaLab[ThetaLab] and Frame_Cm -> dOmegaLab/dOmegaCm[ThetaCm]
145 TGraph* OmegaVsTheta(double thmin = 0.0, double thmax = 180.0, int part = 2, bool Frame_Lab = true) const;
146 // Frame_Lab -> dSigma/dThetaLab[ThetaLab] and Frame_Cm -> dSigma/dThetaCm[ThetaCm]
147 TGraph* RutherfordVsTheta(double thmin = 1.0, double thmax = 179.0, int part = 2, bool Frame_Lab = true, bool Units_mb = true) const;
148
149 void Print(Option_t* opt = "") const override;
150 void Clear(Option_t* opt = "") override;
151
152 void SetExcEnergy(double exc) { SetCmFrame(exc); }
153
154private:
155 void SetCmFrame(double exc); // enables the reaction to be modified using excitation energy
156
157 // same as in TKinematics, should probably change from arrays to individual members
158 // USER INPUTS
159 TNucleus* fNuc[4]{nullptr}; // NOLINT(*-avoid-c-arrays)
160 double fTBeam{0.};
161 bool fInverse{false};
162 double fExc{0.};
163 double fM[4]{0.}; // NOLINT(*-avoid-c-arrays)
164
165 // CM FRAME MOTION
166 double fQVal{0.}; // effective Q value (includes excitation)
167 double fS{0.}; // 'S' = M^2
168 double fInvariantMass{0.};
169 double fCmTi{0.};
170 double fCmTf{0.};
171 double fCmE{0.};
172 double fCmV{0.};
173 double fCmP{0.};
174 double fCmG{0.};
175
176 // PARTICLES IN CM FRAME
177 double fTCm[4]{0.}; // NOLINT(*-avoid-c-arrays)
178 double fECm[4]{0.}; // NOLINT(*-avoid-c-arrays)
179 double fPCm[4]{0.}; // NOLINT(*-avoid-c-arrays)
180 double fVCm[4]{0.}; // NOLINT(*-avoid-c-arrays)
181 double fGCm[4]{0.}; // NOLINT(*-avoid-c-arrays)
182
183 // PARTICLE IN LAB FRAME
184 // Note that in the lab frame only the initial state (beam/targ) is fixed in the reaction
185 double fTLab[2]{0.}; // NOLINT(*-avoid-c-arrays)
186 double fELab[2]{0.}; // NOLINT(*-avoid-c-arrays)
187 double fPLab[2]{0.}; // NOLINT(*-avoid-c-arrays)
188 double fVLab[2]{0.}; // NOLINT(*-avoid-c-arrays)
189 double fGLab[2]{0.}; // NOLINT(*-avoid-c-arrays)
190 double fThetaMax[4]{0.}; // NOLINT(*-avoid-c-arrays)
191
192 /// \cond CLASSIMP
193 ClassDefOverride(TReaction, 1) // NOLINT(readability-else-after-return)
194 /// \endcond
195};
196/*! @} */
197#endif
double fCmG
Definition TReaction.h:174
TGraph * OmegaVsTheta(double thmin=0.0, double thmax=180.0, int part=2, bool Frame_Lab=true) const
double fTLab[2]
Definition TReaction.h:185
double GetCmV() const
Definition TReaction.h:80
TGraph * KinVsTheta(double thmin=0.0, double thmax=180.0, int part=2, bool Frame_Lab=true, bool Units_keV=true) const
double ConvertThetaLabToCm(double theta_lab, int part=2) const
double GetVLabFromThetaCm(double theta_cm=0.0, int part=0) const
void ConvertCmToLab(double theta_cm, double omega_cm, double &theta_lab, double &omega_lab, int part=2) const
double AnalysisBeta(double ekin, int part) const
double GetELabFromThetaCm(double theta_cm=0.0, int part=0) const
double GetGCm(int part) const
Definition TReaction.h:89
double fECm[4]
Definition TReaction.h:178
void Clear(Option_t *opt="") override
double GetELab(double theta_lab=0.0, int part=0) const
Definition TReaction.h:94
double ConvertThetaCmToLab(double theta_cm, int part=2) const
double GetCmE() const
Definition TReaction.h:77
double GetTLab(double theta_lab=0.0, int part=0) const
Definition TReaction.h:98
double GetTBeam(bool inverse) const
Definition TReaction.cxx:71
double ConvertOmegaLabToCm(double theta_lab, int part=2) const
double fM[4]
Definition TReaction.h:163
double fQVal
Definition TReaction.h:166
double GetGLab(double theta_lab=0.0, int part=0) const
Definition TReaction.h:110
double fS
Definition TReaction.h:167
double fCmV
Definition TReaction.h:172
double fCmTi
Definition TReaction.h:169
double fTBeam
Definition TReaction.h:160
double fGCm[4]
Definition TReaction.h:181
double GetInvariantMass() const
Definition TReaction.h:76
double fVCm[4]
Definition TReaction.h:180
double GetTCm(int part) const
Definition TReaction.h:86
double GetPLabFromThetaCm(double theta_cm=0.0, int part=0) const
double GetVBeam() const
Definition TReaction.h:73
void Print(Option_t *opt="") const override
const char * GetNameFull() const
Definition TReaction.h:66
TReaction(const char *beam, const char *targ, const char *ejec, const char *reco, double eBeam=0.0, double ex3=0.0, bool inverse=false)
Definition TReaction.cxx:8
double fGLab[2]
Definition TReaction.h:189
TGraph * RutherfordVsTheta(double thmin=1.0, double thmax=179.0, int part=2, bool Frame_Lab=true, bool Units_mb=true) const
void ConvertLabToCm(double theta_lab, double omega_lab, double &theta_cm, double &omega_cm, int part=2) const
bool Inverse() const
Definition TReaction.h:71
void AnalysisAngDist(double ekin, double theta_lab, int part, double &exc, double &theta_cm, double &omega_lab2cm)
double GetThetaMax(int part) const
Definition TReaction.h:92
double GetExc() const
Definition TReaction.h:69
double fInvariantMass
Definition TReaction.h:168
TNucleus * GetNucleus(int part) const
Definition TReaction.h:67
TGraph * ThetaVsTheta(double thmin=0.0, double thmax=180.0, int part=2, bool Frame_Lab=true) const
double fPLab[2]
Definition TReaction.h:187
double GetRutherfordCm(double theta_cm, int part=2, bool Units_mb=true) const
double GetCmG() const
Definition TReaction.h:82
double GetCmTf() const
Definition TReaction.h:79
double GetCmTi() const
Definition TReaction.h:78
void InitReaction()
Definition TReaction.cxx:33
double ConvertOmegaCmToLab(double theta_cm, int part=2) const
double GetGLabFromThetaCm(double theta_cm=0.0, int part=0) const
double fELab[2]
Definition TReaction.h:186
double fPCm[4]
Definition TReaction.h:179
double GetCmP() const
Definition TReaction.h:81
double GetM(int part) const
Definition TReaction.h:68
bool fInverse
Definition TReaction.h:161
double fTCm[4]
Definition TReaction.h:177
double GetPCm(int part) const
Definition TReaction.h:88
double fCmP
Definition TReaction.h:173
double fExc
Definition TReaction.h:162
double fCmE
Definition TReaction.h:171
double GetQVal() const
Definition TReaction.h:70
void SetExcEnergy(double exc)
Definition TReaction.h:152
double GetRutherfordLab(double theta_lab, int part=2, bool Units_mb=true) const
double GetPLab(double theta_lab=0.0, int part=0) const
Definition TReaction.h:106
void SetCmFrame(double exc)
Definition TReaction.cxx:79
double GetExcEnergy(double ekin=0.00, double theta_lab=0.00, int part=2) const
double GetVLab(double theta_lab=0.0, int part=0) const
Definition TReaction.h:102
double GetVCm(int part) const
Definition TReaction.h:87
double fCmTf
Definition TReaction.h:170
TNucleus * fNuc[4]
Definition TReaction.h:159
double fVLab[2]
Definition TReaction.h:188
double fThetaMax[4]
Definition TReaction.h:190
double GetTLabFromThetaCm(double theta_cm=0.0, int part=0) const
double GetECm(int part) const
Definition TReaction.h:85