GamR  0.0.0
GammaROOT
Loading...
Searching...
No Matches
Coulex.hh
Go to the documentation of this file.
1#ifndef GAMR_COULEX_COULEX_HH
2#define GAMR_COULEX_COULEX_HH
3
4#include <iostream>
5#include <fstream>
6#include <cmath>
7#include <vector>
8#include <map>
9#include <string>
10#include <complex>
11
12#include <TMath.h>
13
14#include <toolkit/Misc.hh>
15#include <angdist/AngDist.hh>
16#include "Eloss.hh"
17#include "WDBSubs.hh"
18
19namespace GamR {
20 namespace Coulex {
21 const double rad2deg = 360. / 2. / TMath::Pi();
22 // Structure for passing level data to the MakeDatafile function
23 struct WDB_nuclvl {
24 float spin; // Spin of state
25 float E; // Energy of state
26 bool par; // Parity of state
27 int K_Band; // K number in rotor model
28 };
29
30 // Structure for passing transition data to the MakeDatafile function
31 struct WDB_nuctrans {
32 int lvl1; // Lower level
33 int lvl2; // Upper level
34 float B; // Reduced matrix element in eb
35 int M; // Multipolarity
36 };
37
38 // This routine accepts beam and target information, and the dimensions and position of a square particle detector at phi=0, and calculates the average nuclear stat tensor across the detector.
39 // Nuclear levels and transitions from the nucleus of interest must be passed using the WDB_nuclvls and WDB_nuctrans vectors.
40 //GamR::AngDist::StatTensor *CoulexNucTensors(int Zbeam, float Abeam, int Ztgt, float Atgt, bool ProjDet, bool TgtEx, float E, float Q, float Tgtdensity, float Tgtthickness, int tenslvl, int nlvl, std::vector<WDB_nuclvl> &lvls, int nEtran, std::vector<WDB_nuctrans> &Etrans, int nMtran, std::vector<WDB_nuctrans> &Mtrans, float PDetx, float PDety, float PDetz, double PDetr);
41
42 // This routine will ask a series of questions to input the information required for coulex and optionally the Qk calculation, then build the WDB_nuclvls and WDB_nuctrans one-dimensional arrays needed for the CoulexNucTens routine.
43 //void ExperimentalSetup(int &Zbeam, double &Abeam, int &Ztgt, double &Atgt, bool &ProjectileDetected, bool &TargetExcited, double &Ebeam, double &Qex, double &TargetThickness, double &TargetDensity, double &PDetx, double &PDety, double &PDetz, double &PDetr, int &ngamma, int &nstates, std::vector<WDB_nuclvl> &NucLevels, int &Tenslevel, int &nEtrans, std::vector<WDB_nuctrans> &Etrans, int &nMtrans, std::vector<WDB_nuctrans> &Mtrans, std::vector<GamR::AngDist::SolidAttenuation> *Qks = nullptr);
44
45 // Gives the Winther-DeBoer codes a projectile energy and target scattering angle (CM) which calculates nuclear stat tensors after coulex, then copies the tensors and reaction cross-section for your chosen level into the variables provided (whether the target or projectile tensors are calculated is determined in the MakeDatafile routine).
46 // Please ensure rho is dimensioned [3][5] (k=0,2,4 q<=0 to 2*k)
47 void GP_AC_Tensors(float Ebeam, float CMAng, int lvl, std::complex<double> **rho, float &xsect);
48
49 // This function is a wrapper to handle datafile construction, reading and removal. Returns 0 on success, 1 on file write error, 2 on read error, and 3 on removal error.
50 int setupcoulex(int Zbeam, float Abeam, int Ztgt, float Atgt, int grouptype, std::vector<WDB_nuclvl> &nuclvls, std::vector<WDB_nuctrans> &nucEtrans, std::vector<WDB_nuctrans> &nucMtrans);
51
52 /* Creates the data file which FREADER will read to setup the common block variables for the coulex calculation.
53 * Total states is the total number of nuclear states to be considered in all level schemes, Z_P is projectile Z, A_P is projectile mass, Z_T is target Z, A_T is target mass, nucgroups is the number of different nuclear level schemes,
54 * grouptype[nucgroups] specifies whether the group is a projectile(1) or target(2), nuclvls[nucgroups] specifies how many levels are in the level scheme provided for a scheme, nuclvl[nucgroups][nuclvls] is a struct containing level information,
55 * nucEMtrans[nucgroups] is the number of reduced matrix elements between transitions provided, nucEMtran[nucgroups][nucE/Mtrans] is a structure containing sqrt(B(EM/MM)) values, and filename is an optional output name for the data file.
56 * Function returns 0 on success, 1 on a file access error.
57 */
58 int MakeDatafile(int Zbeam, float Abeam, int Ztgt, float Atgt, int grouptype, std::vector<WDB_nuclvl> &nuclvls, std::vector<WDB_nuctrans> &nucEtrans, std::vector<WDB_nuctrans> &nucMtrans, std::string filename = "");
59
60 // Calls the coulex setup and data file reading routines that are part of the Winther-DeBoer codes. This only needs to be done once. Use Makedatafile to setup the data file.
61 int ReadDatafile(std::string datafile="");
62
63 // Transforms cross-section from centre-of-mass to lab
64 double xcmlr(double anglab, double angCM, double Ap, double At, double Ep, double Q, bool Tgtex);
65
66 // :: DEPRECIATED See Eloss.hh for new code :: Simplified interface to the fortran-based eloss routine by A.E. Stuchbery based on Ziegler's stopping powers. Accepts a monoelemental target only. Dfoil can be 0 and will pull a value from SCOEF.dat.
67 // void Eloss(float Ein, float Abeam, int Zbeam, float Afoil, int Zfoil, float &Dfoil, float FoilThickness, float &Eout, float &transittime, float &range);
68
69 /* Routine to get reaction kinematics based on Marion and Young's solutions, originally writted in FORTRAN by A.E. Stuchbery.
70 * Inputs: A1I is projectile mass, A2I is target mass, A3I is light recoil mass, A4I is heavy recoil mass, E1I is projectile energy, QEFFI is reaction energy and PSII is the light recoil angle.
71 * Outputs: E3I is the light mass energy, E3AI is alt solution, E4I is heavy mass energy, E4AI is alt solution, ZETAI is heavy recoil angle, ZETAAI is alt solution, thetaI is light CM angle, thetaaI is alt solution, PHII is heavy CM angle, and PHIAI is alt soluiton.
72 * The function returns a flag where 1= unique solution, 0= two solutions and -1= bad light recoil angle. */
73 int Kinematics(double A1I, double A2I, double A3I, double A4I, double E1I, double QEFFI, double PSII, double &E3I, double &E3AI, double &E4I, double &E4AI, double &ZETAI, double &ZETAAI, double &thetaI, double &thetaaI, double &PHII, double &PHIAI);
74
75 // Draws the particle detector geometry using ASCII characters to assist user input
76 void DrawSetup();
77 }
78}
79#endif
const double rad2deg
Definition Coulex.hh:21
int ReadDatafile(std::string datafile)
Definition Coulex.cc:287
void GP_AC_Tensors(float Ebeam, float CMAng, int lvl, std::complex< double > **rho, float &xsect)
Definition Coulex.cc:317
void DrawSetup()
Definition Coulex.cc:336
int Kinematics(double A1I, double A2I, double A3I, double A4I, double E1I, double QEFFI, double PSII, double &E3I, double &E3AI, double &E4I, double &E4AI, double &ZETAI, double &ZETAAI, double &thetaI, double &thetaaI, double &PHII, double &PHIAI)
Definition Coulex.cc:50
int setupcoulex(int Zbeam, float Abeam, int Ztgt, float Atgt, int grouptype, std::vector< WDB_nuclvl > &nuclvls, std::vector< WDB_nuctrans > &nucEtrans, std::vector< WDB_nuctrans > &nucMtrans)
Definition Coulex.cc:304
double xcmlr(double anglab, double angCM, double Ap, double At, double Ep, double Q, bool Tgtex)
Definition Coulex.cc:182
int MakeDatafile(int Zbeam, float Abeam, int Ztgt, float Atgt, int grouptype, std::vector< WDB_nuclvl > &nuclvls, std::vector< WDB_nuctrans > &nucEtrans, std::vector< WDB_nuctrans > &nucMtrans, std::string filename)
Definition Coulex.cc:229
Definition Gain.cc:19