mirror of
https://github.com/gwm17/Mask.git
synced 2024-11-26 12:08:52 -05:00
Removed gsl dependence for compatibility with NRB machines. Added in homeade legendre polynomials. Updated README to reflect
This commit is contained in:
parent
f90cc7e326
commit
87bde213ba
|
@ -33,4 +33,4 @@ To run MASK simply do the following from the MASK directory:
|
||||||
Input.txt can be replaced by any text file with the correct format.
|
Input.txt can be replaced by any text file with the correct format.
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
MASK requires that ROOT is installed for data writting and visualization, as well as for random number generation. It also requires gsl to calculate Legendre Polynomials. Testing has been done only on ROOT 6. Mileage on all other ROOT versions will vary.
|
MASK requires that ROOT is installed for data writting and visualization, as well as for random number generation. Testing has been done only on ROOT 6. Mileage on all other ROOT versions will vary.
|
||||||
|
|
6
include/LegendrePoly.h
Normal file
6
include/LegendrePoly.h
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
#ifndef LEGENDREPOLY_H
|
||||||
|
#define LEGENDREPOLY_H
|
||||||
|
|
||||||
|
double P_l(int l, double x);
|
||||||
|
|
||||||
|
#endif
|
|
@ -1,5 +1,5 @@
|
||||||
----------Data Information----------
|
----------Data Information----------
|
||||||
OutputFile: /media/gordon/b6414c35-ec1f-4fc1-83bc-a6b68ca4325a/gwm17/12C3Hed_13N3546keV_ps_fixedThetaBins_test.root
|
OutputFile: /data1/gwm17/10B3He/Feb2021/12C3Hed_13N3546keV_ps_fixedThetaBins_test.root
|
||||||
SaveTree: yes
|
SaveTree: yes
|
||||||
SavePlots: yes
|
SavePlots: yes
|
||||||
----------Reaction Information----------
|
----------Reaction Information----------
|
||||||
|
|
2
makefile
2
makefile
|
@ -2,7 +2,7 @@ CC=g++
|
||||||
ROOTGEN=rootcint
|
ROOTGEN=rootcint
|
||||||
CFLAGS=-g -Wall `root-config --cflags`
|
CFLAGS=-g -Wall `root-config --cflags`
|
||||||
CPPFLAGS=-I ./include
|
CPPFLAGS=-I ./include
|
||||||
LDFLAGS=`root-config --glibs` -lgsl
|
LDFLAGS=`root-config --glibs`
|
||||||
|
|
||||||
ROOTINCLDIR=./
|
ROOTINCLDIR=./
|
||||||
INCLDIR=./include
|
INCLDIR=./include
|
||||||
|
|
11
src/LegendrePoly.cpp
Normal file
11
src/LegendrePoly.cpp
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
#include "LegendrePoly.h"
|
||||||
|
|
||||||
|
double P_l(int l, double x) {
|
||||||
|
if(l == 0) {
|
||||||
|
return 1.0;
|
||||||
|
} else if (l == 1) {
|
||||||
|
return x;
|
||||||
|
} else {
|
||||||
|
return ((2.0*l + 1.0)*x*P_l(l-1, x) - (l-1.0)*P_l(l-2, x))/(double(l));
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
#include "ReactionSystem.h"
|
#include "ReactionSystem.h"
|
||||||
#include "KinematicsExceptions.h"
|
#include "KinematicsExceptions.h"
|
||||||
#include <gsl/gsl_sf_legendre.h>
|
#include "LegendrePoly.h"
|
||||||
|
|
||||||
namespace Mask {
|
namespace Mask {
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ double ReactionSystem::GetDecayTheta(int L) {
|
||||||
do {
|
do {
|
||||||
costheta = generator->Uniform(-1.0, 1.0);
|
costheta = generator->Uniform(-1.0, 1.0);
|
||||||
check = generator->Uniform(0.0, 1.0);
|
check = generator->Uniform(0.0, 1.0);
|
||||||
probability = std::pow(gsl_sf_legendre_Pl(L, costheta), 2.0);
|
probability = std::pow(P_l(L, costheta), 2.0);
|
||||||
} while(check > probability);
|
} while(check > probability);
|
||||||
|
|
||||||
return std::acos(costheta);
|
return std::acos(costheta);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user