Commit e397d977 authored by Morfouace's avatar Morfouace
Browse files

Merge branch 'NPTool.2.dev' of https://gitlab.in2p3.fr/np/nptool into NPTool.2.dev

parents 7c4be5e4 2ddb0fba
Pipeline #84523 passed with stages
in 41 minutes and 56 seconds
......@@ -204,7 +204,7 @@ void NPOptionManager::DisplayVersion(){
std::cout << line << std::endl;
std::cout << " NPLib version: nplib-"<< NPL::version_major <<"-" << NPL::version_minor << "-" << NPL::version_deta <<std::endl;
std::cout << " Copyright: NPTool Collaboration "<<std::endl;
std::cout << " GitHub: http://github.com/adrien-matta/nptool"<<std::endl; ;
std::cout << " Gitlab: https://gitlab.in2p3.fr/np/nptool"<<std::endl; ;
std::cout << line << std::endl;
}
......
add_custom_command(OUTPUT NPNucleusDict.cxx COMMAND ${CMAKE_BINARY_DIR}/scripts/build_dict.sh NPNucleus.h NPNucleusDict.cxx NPNucleus.rootmap libNPPhysics.so NPNucleusLinkDef.h DEPENDS NPNucleus.h NPNucleusLinkDef.h)
add_custom_command(OUTPUT NPParticleDict.cxx COMMAND ${CMAKE_BINARY_DIR}/scripts/build_dict.sh NPParticle.h NPParticleDict.cxx NPParticle.rootmap libNPPhysics.so NPParticleLinkDef.h DEPENDS NPParticle.h NPParticleLinkDef.h)
add_custom_command(OUTPUT NPReactionDict.cxx COMMAND ${CMAKE_BINARY_DIR}/scripts/build_dict.sh NPReaction.h NPReactionDict.cxx NPReaction.rootmap libNPPhysics.so NPReactionLinkDef.h DEPENDS NPReaction.h NPReactionLinkDef.h)
......@@ -14,7 +14,7 @@ add_custom_command(OUTPUT TInteractionCoordinatesDict.cxx COMMAND ${CMAKE_BINARY
add_custom_command(OUTPUT TReactionConditionsDict.cxx COMMAND ${CMAKE_BINARY_DIR}/scripts/build_dict.sh TReactionConditions.h TReactionConditionsDict.cxx TReactionConditions.rootmap libNPReactionConditions.so DEPENDS TReactionConditions.h)
add_library(NPPhysics SHARED NPDecay.cxx NPBeam.cxx NPEnergyLoss.cxx NPFunction.cxx NPNucleus.cxx NPReaction.cxx NPQFS.cxx NPNucleusDict.cxx NPReactionDict.cxx NPQFSDict.cxx NPEnergyLossDict.cxx )
add_library(NPPhysics SHARED NPDecay.cxx NPBeam.cxx NPEnergyLoss.cxx NPFunction.cxx NPParticle.cxx NPReaction.cxx NPQFS.cxx NPParticleDict.cxx NPReactionDict.cxx NPQFSDict.cxx NPEnergyLossDict.cxx )
target_link_libraries(NPPhysics ${ROOT_LIBRARIES} Physics NPCore)
add_library(NPInitialConditions SHARED TInitialConditions.cxx TInitialConditionsDict.cxx )
......@@ -26,5 +26,4 @@ target_link_libraries(NPInteractionCoordinates ${ROOT_LIBRARIES} )
add_library(NPReactionConditions SHARED TReactionConditions.cxx TReactionConditionsDict.cxx)
target_link_libraries(NPReactionConditions ${ROOT_LIBRARIES} )
install(FILES NPDecay.h NPBeam.h NPEnergyLoss.h NPFunction.h NPNucleus.h NPReaction.h NPQFS.h TInitialConditions.h TInteractionCoordinates.h TReactionConditions.h DESTINATION ${CMAKE_INCLUDE_OUTPUT_DIRECTORY})
install(FILES NPDecay.h NPBeam.h NPEnergyLoss.h NPFunction.h NPParticle.h NPNucleus.h NPReaction.h NPQFS.h TInitialConditions.h TInteractionCoordinates.h TReactionConditions.h DESTINATION ${CMAKE_INCLUDE_OUTPUT_DIRECTORY})
......@@ -81,9 +81,10 @@ Beam::Beam(){
fXThetaXHist = new TH2F(Form("XThetaXHis_%i",offset),"XThetaXHis",1,0,1,1,0,1);
fYPhiYHist = new TH2F(Form("YPhiYHist_%i",offset),"YPhiYHist",1,0,1,1,0,1);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Beam::Beam(string isotope){
SetUp(isotope);
Beam::Beam(string name){
SetUp(name);
fEnergy = 0;
fExcitationEnergy = 0;
fSigmaEnergy = -1 ;
......@@ -116,7 +117,6 @@ Beam::Beam(string isotope){
fYPhiYHist = new TH2F(Form("YPhiYHist_%i",offset),"YPhiYHist",1,0,1,1,0,1);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Beam::~Beam(){
}
......@@ -126,6 +126,7 @@ void Beam::ReadConfigurationFile(string Path){
NPL::InputParser parser(Path);
ReadConfigurationFile(parser);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void Beam::ReadConfigurationFile(NPL::InputParser parser){
vector<NPL::InputBlock*> blocks = parser.GetAllBlocksWithToken("Beam");
......@@ -253,20 +254,20 @@ void Beam::Print() const {
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void Beam::SetTargetSize(double TargetSize){
fTargetSize = TargetSize;
fEffectiveTargetSize = fTargetSize*cos(fTargetAngle);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void Beam::SetTargetThickness(double TargetThickness){
fTargetThickness = TargetThickness;
fEffectiveTargetThickness = fTargetThickness/cos(fTargetAngle);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void Beam::SetTargetAngle(double TargetAngle){
fTargetAngle = TargetAngle;
fEffectiveTargetSize = fTargetSize*cos(fTargetAngle);
......
......@@ -35,13 +35,11 @@
using namespace std;
// NPL header
#include "NPNucleus.h"
#include "NPParticle.h"
#include "NPInputParser.h"
using namespace NPL;
namespace NPL{
class Beam:public NPL::Nucleus{
class Beam:public NPL::Particle{
public: // Constructors and Destructors
Beam();
......@@ -56,7 +54,7 @@ namespace NPL{
int fVerboseLevel;
private:
//Nucleus* fBeamNucleus;
//Particle* fBeamParticle;
double fEnergy;
double fExcitationEnergy;
double fSigmaEnergy;
......@@ -78,7 +76,7 @@ namespace NPL{
public:
// Getters and Setters
// Set
// void SetBeamNucleus (Nucleus* BeamNucleus) {delete fBeamNucleus ; fBeamNucleus = new Nucleus(BeamNucleus->GetZ(),BeamNucleus->GetA());}
// void SetBeamParticle (Particle* BeamParticle) {delete fBeamParticle ; fBeamParticle = new Particle(BeamParticle->GetZ(),BeamParticle->GetA());}
void SetEnergy (double Energy) {fEnergy=Energy;}
void SetExcitationEnergy(double Excitation) {fExcitationEnergy=Excitation;}
void SetSigmaEnergy (double SigmaEnergy) {fSigmaEnergy=SigmaEnergy;}
......@@ -96,7 +94,7 @@ namespace NPL{
void SetVerboseLevel(int verbose) {fVerboseLevel = verbose;}
// Get
// Nucleus* GetNucleus () const {return fBeamNucleus;}
// Particle* GetParticle () const {return fBeamParticle;}
double GetEnergy () const {return fEnergy;}
double GetExcitationEnergy() const {return fExcitationEnergy;}
double GetSigmaEnergy () const {return fSigmaEnergy;}
......@@ -111,7 +109,7 @@ namespace NPL{
TH1F* GetEnergyHist () const {return fEnergyHist;}
TH2F* GetXThetaXHist () const {return fXThetaXHist;}
TH2F* GetYPhiYHist () const {return fYPhiYHist;}
int GetVerboseLevel() const {return fVerboseLevel;}
int GetVerboseLevel() const {return fVerboseLevel;}
private: // Event Generation private variable
double fTargetSize;
......
......@@ -40,6 +40,7 @@
// Root
#include "TH1D.h"
#include "TGenPhaseSpace.h"
namespace NPL{
// A given decay Path
class SingleDecay{
......
#ifndef NPNUCLEUS_h
#define NPNUCLEUS_h
/*****************************************************************************
* Copyright (C) 2009-2016 this file is part of the NPTool Project *
* *
* For the licensing terms see $NPTOOL/Licence/NPTool_Licence *
* For the list of contributors see $NPTOOL/Licence/Contributors *
*****************************************************************************/
/*****************************************************************************
* Original Author: Adrien MATTA contact address: a.matta@surrey.ac.uk *
* *
* Creation Date : febuary 2009 *
* Last update : *
*---------------------------------------------------------------------------*
* Decription: *
* This class manage a nucleus, data are read in the nubtab03.asc file *
* *
*---------------------------------------------------------------------------*
* Comment: *
* *
* *
* *
*****************************************************************************/
// ROOT headers
#include "TLorentzVector.h"
// NPTOOL headers
#include "NPGlobalSystemOfUnits.h"
#include "NPPhysicalConstants.h"
#ifdef NP_SYSTEM_OF_UNITS_H
using namespace NPUNITS;
#endif
#ifdef HEP_PHYSICAL_CONSTANTS_H
using namespace CLHEP;
#endif
// C++ headers
#include <string>
using namespace std;
#include <iostream>
namespace NPL {
class Nucleus {
public:
Nucleus();
Nucleus(string isotope);
Nucleus(string isotope, const string& pathENSDF);
Nucleus(int Z, int A);
Nucleus(string name, vector<string> subpart, double binding,double Ex=0, string SpinParity="", double Spin=0, string Parity="", double LifeTime=-1);
virtual ~Nucleus();
#include "NPParticle.h"
namespace NPL{
typedef Particle Nucleus;
public:
void SetUp(string isotope);
void LoadENSDF(const string& isotope, const string& pathENSDF);
private :
//intrinsic properties
string fName; // Nucleus name
string fNucleusName;
int fCharge; // Nucleus charge
int fAtomicWeight; // Nucleus atomic weight
double fMassExcess; // Nucleus mass excess in keV
string fSpinParity; // Nucleus spin and parity
double fSpin; // Nucleus spin
string fParity; // Nucleus parity
double fLifeTime; // life time
double fLifeTimeErr; // life time error
double fExcitationEnergy; // Excitation Energy
//kinematic properties
double fKineticEnergy;
double fBeta;
double fGamma;
double fBrho;
double fTimeOfFlight;
double fVelocity;
TLorentzVector fEnergyImpulsion;
// ENSDF list of levels
vector<double> fLevelEnergy; // list of level energies
vector<double> fLevelEnergyUncertainty; // list of level energies uncertainty
public:
void EnergyToBrho(double Q=-1000);
void EnergyToTof();
void BetaToVelocity();
void BrhoToEnergy(double Q=-1000);
void BrhoToTof() {BrhoToEnergy(); EnergyToTof();}
void TofToEnergy();
void TofToBrho() {TofToEnergy(); EnergyToBrho();}
void EnergyToBeta();
void BetaToEnergy();
void BetaToGamma();
double DopplerCorrection(double EnergyLabGamma, double ThetaLabGamma);
protected :
void Extract(string line);
public :
void GetNucleusName();
string GetName() const {return fNucleusName;}
int GetZ() const {return fCharge;}
int GetA() const {return fAtomicWeight;}
double GetMassExcess() const {return fMassExcess;}
string GetSpinParity() const {return fSpinParity;}
double GetSpin() const {return fSpin;}
string GetParity() const {return fParity;}
double GetLifeTime() const {return fLifeTime;}
double GetLifeTimeError() const {return fLifeTimeErr;}
double GetEnergy() const {return fKineticEnergy;}
double GetBrho() const {return fBrho;}
double GetTimeOfFlight() const {return fTimeOfFlight;}
double GetBeta() const {return fBeta;}
double GetGamma() const {return fGamma;}
double GetVelocity() const {return fVelocity;}
TLorentzVector GetEnergyImpulsion() const {return fEnergyImpulsion;}
double GetExcitationEnergy() const {return fExcitationEnergy;}
void SetName(const char* name) {fName = name;}
void SetZ(int charge) {fCharge = charge;}
void SetA(int mass) {fAtomicWeight = mass;}
void SetMassExcess(double massexcess) {fMassExcess = massexcess;}
void SetSpinParity(const char* spinparity) {fSpinParity = spinparity;}
void SetSpin(double spin) {fSpin = spin;}
void SetParity(const char* parity) {fParity = parity;}
void SetLifeTime(double LifeTime) {fLifeTime=LifeTime;}
void SetLifeTimeError(double LifeTimeErr) {fLifeTimeErr=LifeTimeErr;}
void SetKineticEnergy(double energy) {fKineticEnergy = energy; EnergyToBrho(); EnergyToTof(); EnergyToBeta(); BetaToGamma();BetaToVelocity();}
void SetBrho(double brho) {fBrho = brho; BrhoToEnergy(); BrhoToTof(); EnergyToBeta(); BetaToGamma();BetaToVelocity();}
void SetTimeOfFlight(double tof) {fTimeOfFlight = tof; TofToEnergy(); TofToBrho(); EnergyToBeta(); BetaToGamma();BetaToVelocity();}
void SetEnergyImpulsion(TLorentzVector P) {fEnergyImpulsion = P;
fKineticEnergy = P.E() - Mass();
EnergyToBrho();
EnergyToTof();
EnergyToBeta();
BetaToGamma();
BetaToVelocity();}
void SetExcitationEnergy(double Ex) {fExcitationEnergy=Ex;}
void SetBeta(double beta) {fBeta = beta; BetaToGamma(); BetaToEnergy(); EnergyToTof(); EnergyToBrho();BetaToVelocity();}
double GetEnergyCM(double EnergyLab, double ThetaLab, double PhiLab, double relativisticboost);
double GetThetaCM(double EnergyLab, double ThetaLab, double PhiLab, double relativisticboost);
// Nuclear mass in MeV
double Mass() const {return (fAtomicWeight*amu_c2 + fMassExcess/1000. - fCharge*electron_mass_c2+fExcitationEnergy);}
double GetBindingEnergy() const {return (fCharge*proton_mass_c2 + (fAtomicWeight-fCharge)*neutron_mass_c2 + fCharge*electron_mass_c2 - fAtomicWeight*amu_c2 - fMassExcess/1000);}
void Print() const ;
public:
void DefineMassByThreshold(const vector<string>& v); // Define the mass as the sum of the mass of the particle named in v
void DefineMassByThreshold(const vector<NPL::Nucleus>& N); // Define the mass as the sum of the mass of the particle defined in N
public:
double GetSn() const;
double GetSp() const;
double GetS2n() const;
double GetS2p() const;
double GetSt() const;
double GetS3He() const;
double GetSa() const;
double GetSXn(unsigned int X) const;
double GetSXp(unsigned int X) const;
void PrintThreshold() const;
// methods for ENSDF
public:
unsigned int GetNumberOfLevels() {return fLevelEnergy.size();}
vector<double> GetLevelEnergyList() {return fLevelEnergy;}
vector<double> GetLevelEnergyUncertaintyList() {return fLevelEnergyUncertainty;}
double GetLevelEnergy(Int_t i) {return fLevelEnergy[i];}
double GetLevelEnergyUncertainty(Int_t i){return fLevelEnergyUncertainty[i];}
ClassDef(Nucleus,0)
};
}
}
#endif
......@@ -12,7 +12,7 @@
* Last update : may 2012 morfouac@ipno.in2p3.fr *
*---------------------------------------------------------------------------*
* Decription: *
* This class manage a nucleus, data are read in the nubtab12.asc file *
* This class manage a particle, data are read in the nubtab12.asc file *
* *
*---------------------------------------------------------------------------*
* Comment: *
......@@ -22,7 +22,7 @@
*****************************************************************************/
// NPTOOL headers
#include "NPNucleus.h"
#include "NPParticle.h"
#include "NPCore.h"
using namespace NPL;
......@@ -43,15 +43,16 @@ using namespace std;
ClassImp(Nucleus)
ClassImp(Particle)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Nucleus::Nucleus(){
Particle::Particle(){
//----------- Default Constructor ----------
fName= "XX DEFAULT XX";
fCharge= 0;
fAtomicWeight= 0;
fMassExcess= 0;
fMass=0;
fExcitationEnergy=0;
fSpinParity= "";
fSpin= 0;
......@@ -60,25 +61,25 @@ Nucleus::Nucleus(){
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Nucleus::Nucleus(string isotope){
SetUp(isotope);
Particle::Particle(string name){
SetUp(name);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Nucleus::Nucleus(string isotope, const string& path){
SetUp(isotope);
LoadENSDF(isotope, path);
Particle::Particle(string name, const string& path){
SetUp(name);
LoadENSDF(name, path);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Nucleus::Nucleus(string name, vector<string> subpart, double binding,double Ex, string SpinParity, double Spin, string Parity, double LifeTime){
Particle::Particle(string name, vector<string> subpart, double binding,double Ex, string SpinParity, double Spin, string Parity, double LifeTime){
fName= name;
fCharge= 0;
fAtomicWeight= 0;
unsigned int size = subpart.size();
double Mass = 0;
for(unsigned int i = 0 ; i < size ; i++){
Nucleus N = Nucleus(subpart[i]);
Particle N = Particle(subpart[i]);
Mass+= N.Mass();
fAtomicWeight+= N.GetA();
fCharge+= N.GetZ();
......@@ -92,10 +93,11 @@ Nucleus::Nucleus(string name, vector<string> subpart, double binding,double Ex,
fSpin= Spin;
fParity= Parity;
fLifeTime = LifeTime;
fMass=Mass;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void Nucleus::LoadENSDF(const string& isotope, const string& pathENSDF)
void Particle::LoadENSDF(const string& isotope, const string& pathENSDF)
{
// open file to read
TString fileName = Form("%s/AR_%s.ens", pathENSDF.c_str(), isotope.c_str());
......@@ -177,21 +179,50 @@ void Nucleus::LoadENSDF(const string& isotope, const string& pathENSDF)
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void Nucleus::SetUp(string isotope){
void Particle::SetUp(string name){
if(name=="electron"){
fName = "electron";
fCharge = -1;
fAtomicWeight = 0;
fMassExcess = 0;
fMass = electron_mass_c2;
fExcitationEnergy =0;
fSpinParity = "0.5";
fSpin = 0.5;
fParity = "";
fLifeTime = -1;
return;
}
else if(name=="gamma"){
fName = "gamma";
fCharge = 0;
fAtomicWeight = 0;
fMassExcess = 0;
fMass = 0;
fExcitationEnergy =0;
fSpinParity = "0";
fSpin = 0;
fParity = "";
fLifeTime = -1;
return;
}
//----------- Constructor Using nubtab12.asc by name----------
// open the file to read and check if it is open
fExcitationEnergy=0;
// Replace the n,p,d,t,a by there standard name:
if(isotope=="p") isotope="1H";
else if(isotope=="n") isotope="1n";
else if(isotope=="d") isotope="2H";
else if(isotope=="t") isotope="3H";
else if(isotope=="a") isotope="4He";
else if(isotope=="n") isotope="1n";
else if(isotope=="neutron") isotope="1n";
else if(isotope=="g") isotope="gamma";
else if(isotope=="gamma") isotope="gamma";
else if(isotope=="4n"){ // tetraneutron @Eres = 0
if(name=="p") name="1H";
else if(name=="n") name="1n";
else if(name=="d") name="2H";
else if(name=="t") name="3H";
else if(name=="a") name="4He";
else if(name=="n") name="1n";
else if(name=="neutron") name="1n";
else if(name=="g") name="gamma";
else if(name=="gamma") name="gamma";
else if(name=="4n"){ // tetraneutron @Eres = 0
string line = "004 0000 4n 32285.268 0.0005 219.4 ys 0.6 1/2+ 00 02PaDGt B-=100";
Extract(line.data());
return;
......@@ -199,7 +230,7 @@ void Nucleus::SetUp(string isotope){
ifstream inFile;
string Path = getenv("NPTOOL") ;
string FileName = Path + "/NPLib/Physics/nubtab12.asc";
string FileName = Path + "/NPLib/Physics/nubtab16.asc";
inFile.open(FileName.c_str());
// reading the file
......@@ -213,7 +244,7 @@ void Nucleus::SetUp(string isotope){
space = s_name.find_first_of(" ");
s_name.resize(space);
if (s_name.find(isotope) != string::npos && s_name.length() == isotope.length()) break;
if (s_name.find(name) != string::npos && s_name.length() == name.length()) break;
}
Extract(line.data());
}
......@@ -223,7 +254,7 @@ void Nucleus::SetUp(string isotope){
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Nucleus::Nucleus(int Z, int A)
Particle::Particle(int Z, int A)
{
//----------- Constructor Using nubtab12.asc by Z and A----------
......@@ -267,12 +298,12 @@ Nucleus::Nucleus(int Z, int A)
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Nucleus::~Nucleus()
Particle::~Particle()
{
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void Nucleus::Extract(string line){
void Particle::Extract(string line){
// name of the isotope
fName = line.substr(11,7);
// charge and mass
......@@ -409,12 +440,12 @@ void Nucleus::Extract(string line){
if (s_spinparity.find("17/2") != string::npos) fSpin = 8.5 ;
if (s_spinparity.find("19/2") != string::npos) fSpin = 9.5 ;
if (s_spinparity.find("21/2") != string::npos) fSpin = 10.5 ;
GetNucleusName();
GetParticleName();
fMass=Mass();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void Nucleus::Print() const
void Particle::Print() const
{
//------------ Imprime a l'ecran les caracteristiques d'un noyau -------
cout << endl;
......@@ -425,12 +456,12 @@ void Nucleus::Print() const
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void Nucleus::GetNucleusName() {
fNucleusName.assign(fName);
void Particle::GetParticleName() {
fParticleName.assign(fName);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void Nucleus::EnergyToBrho(double Q){
void Particle::EnergyToBrho(double Q){
if(Q==-1000)
Q=GetZ();
......@@ -439,19 +470,19 @@ void Nucleus::EnergyToBrho(double Q){
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void Nucleus::EnergyToTof(){
void Particle::EnergyToTof(){
fTimeOfFlight = 1/sqrt(1-(Mass()*Mass())/(fKineticEnergy+Mass())/(fKineticEnergy+Mass()))/(c_light*1e6);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void Nucleus::TofToEnergy() {
void Particle::TofToEnergy() {
double Energy = sqrt( Mass()*Mass()/(1-pow((1/((c_light*1e6)*fTimeOfFlight)),2)) );
fKineticEnergy = Energy - Mass();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void Nucleus::BrhoToEnergy(double Q ){
void Particle::BrhoToEnergy(double Q ){
if(Q==-1000)
Q=GetZ();
......@@ -460,27 +491,27 @@ void Nucleus::BrhoToEnergy(double Q ){
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void Nucleus::EnergyToBeta(){
void Particle::EnergyToBeta(){
fBeta = sqrt(pow(fKineticEnergy,2) + 2*fKineticEnergy*Mass())/(fKineticEnergy + Mass());
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void Nucleus::BetaToEnergy(){
void Particle::BetaToEnergy(){
fKineticEnergy = Mass()/sqrt(1-pow(fBeta,2)) - Mass();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void Nucleus::BetaToGamma(){
void Particle::BetaToGamma(){
fGamma = 1/sqrt(1-pow(fBeta,2));
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void Nucleus::BetaToVelocity(){
void Particle::BetaToVelocity(){
fVelocity = (c_light*1e6)*fBeta*1e-7;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
double Nucleus::DopplerCorrection(double EnergyLabGamma, double ThetaLabGamma){
double Particle::DopplerCorrection(double EnergyLabGamma, double ThetaLabGamma){
double EnergyGammaCorrected = EnergyLabGamma*(1-fBeta*cos(ThetaLabGamma))/( sqrt(1-pow(fBeta,2)) );
return EnergyGammaCorrected;
......@@ -488,7 +519,7 @@ double Nucleus::DopplerCorrection(double EnergyLabGamma, double ThetaLabGamma){
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
double Nucleus::GetEnergyCM(double EnergyLab, double ThetaLab, double PhiLab, double relativisticboost){
double Particle::GetEnergyCM(double EnergyLab, double ThetaLab, double PhiLab, double relativisticboost){
SetKineticEnergy(EnergyLab);
double EnergyCM;
double ImpulsionLab;
......@@ -516,7 +547,7 @@ double Nucleus::GetEnergyCM(double EnergyLab, double ThetaLab, double PhiLab, do
}