From cf258a4ef67af6653be26e812f1dc30131fff5b2 Mon Sep 17 00:00:00 2001 From: adrien matta <matta@lpccaen.in2p3.fr> Date: Thu, 17 Sep 2020 16:01:44 +0200 Subject: [PATCH] * renaming NPNucleus into NPParticle - adding a typedef of NPParticle into NPNucleus to solve backward compatibility - changing QFS and Reaction to match new terminology --- NPLib/Physics/CMakeLists.txt | 6 +- NPLib/Physics/NPBeam.h | 12 +- NPLib/Physics/NPDecay.h | 1 + NPLib/Physics/NPNucleus.h | 180 +----------------- NPLib/Physics/NPNucleusLinkDef.h | 3 - .../Physics/{NPNucleus.cxx => NPParticle.cxx} | 102 +++++----- NPLib/Physics/NPParticle.h | 179 +++++++++++++++++ NPLib/Physics/NPParticleLinkDef.h | 3 + NPLib/Physics/NPQFS.cxx | 46 ++--- NPLib/Physics/NPQFS.h | 24 +-- NPLib/Physics/NPReaction.cxx | 94 ++++----- NPLib/Physics/NPReaction.h | 24 +-- NPSimulation/Process/BeamReaction.cc | 34 ++-- Projects/Strasse/Analysis.cxx | 8 +- 14 files changed, 362 insertions(+), 354 deletions(-) delete mode 100644 NPLib/Physics/NPNucleusLinkDef.h rename NPLib/Physics/{NPNucleus.cxx => NPParticle.cxx} (91%) create mode 100644 NPLib/Physics/NPParticle.h create mode 100644 NPLib/Physics/NPParticleLinkDef.h diff --git a/NPLib/Physics/CMakeLists.txt b/NPLib/Physics/CMakeLists.txt index 60c974730..86f1a1b92 100644 --- a/NPLib/Physics/CMakeLists.txt +++ b/NPLib/Physics/CMakeLists.txt @@ -1,4 +1,4 @@ -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,4 +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}) diff --git a/NPLib/Physics/NPBeam.h b/NPLib/Physics/NPBeam.h index c20c3f519..d7b8fb5d8 100644 --- a/NPLib/Physics/NPBeam.h +++ b/NPLib/Physics/NPBeam.h @@ -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;} diff --git a/NPLib/Physics/NPDecay.h b/NPLib/Physics/NPDecay.h index 9478a22d9..24f8646be 100644 --- a/NPLib/Physics/NPDecay.h +++ b/NPLib/Physics/NPDecay.h @@ -40,6 +40,7 @@ // Root #include "TH1D.h" #include "TGenPhaseSpace.h" + namespace NPL{ // A given decay Path class SingleDecay{ diff --git a/NPLib/Physics/NPNucleus.h b/NPLib/Physics/NPNucleus.h index a44acc39f..4db32d064 100644 --- a/NPLib/Physics/NPNucleus.h +++ b/NPLib/Physics/NPNucleus.h @@ -1,179 +1,9 @@ #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 - double fMass; - 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 fName;} - 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 diff --git a/NPLib/Physics/NPNucleusLinkDef.h b/NPLib/Physics/NPNucleusLinkDef.h deleted file mode 100644 index 9bdcb1dc9..000000000 --- a/NPLib/Physics/NPNucleusLinkDef.h +++ /dev/null @@ -1,3 +0,0 @@ -#ifdef __CINT__ -#pragma link C++ defined_in "NPNucleus.h"; -#endif diff --git a/NPLib/Physics/NPNucleus.cxx b/NPLib/Physics/NPParticle.cxx similarity index 91% rename from NPLib/Physics/NPNucleus.cxx rename to NPLib/Physics/NPParticle.cxx index 59c02dc91..3a1e91d44 100644 --- a/NPLib/Physics/NPNucleus.cxx +++ b/NPLib/Physics/NPParticle.cxx @@ -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,10 +43,10 @@ using namespace std; -ClassImp(Nucleus) +ClassImp(Particle) //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -Nucleus::Nucleus(){ +Particle::Particle(){ //----------- Default Constructor ---------- fName= "XX DEFAULT XX"; fCharge= 0; @@ -61,25 +61,25 @@ Nucleus::Nucleus(){ } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -Nucleus::Nucleus(string name){ +Particle::Particle(string name){ SetUp(name); } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -Nucleus::Nucleus(string name, const string& 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(); @@ -97,7 +97,7 @@ Nucleus::Nucleus(string name, vector<string> subpart, double binding,double Ex, } //....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()); @@ -179,7 +179,7 @@ void Nucleus::LoadENSDF(const string& isotope, const string& pathENSDF) } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -void Nucleus::SetUp(string name){ +void Particle::SetUp(string name){ if(name=="electron"){ fName = "electron"; fCharge = -1; @@ -254,7 +254,7 @@ void Nucleus::SetUp(string name){ } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -Nucleus::Nucleus(int Z, int A) +Particle::Particle(int Z, int A) { //----------- Constructor Using nubtab12.asc by Z and A---------- @@ -298,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 @@ -440,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; @@ -456,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(); @@ -470,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(); @@ -491,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; @@ -519,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; @@ -547,7 +547,7 @@ double Nucleus::GetEnergyCM(double EnergyLab, double ThetaLab, double PhiLab, do } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -double Nucleus::GetThetaCM(double EnergyLab, double ThetaLab, double PhiLab, double relativisticboost){ +double Particle::GetThetaCM(double EnergyLab, double ThetaLab, double PhiLab, double relativisticboost){ SetKineticEnergy(EnergyLab); double EnergyCM; double ThetaCM; @@ -577,18 +577,18 @@ double Nucleus::GetThetaCM(double EnergyLab, double ThetaLab, double PhiLab, dou } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -void Nucleus::DefineMassByThreshold(const vector<string>& v){ +void Particle::DefineMassByThreshold(const vector<string>& v){ // Define the mass as the sum of the mass of the particle named in v unsigned int size = v.size(); - vector<NPL::Nucleus> N; + vector<NPL::Particle> N; for(unsigned int i = 0 ; i < size ; i++) - N.push_back(NPL::Nucleus(v[i])); + N.push_back(NPL::Particle(v[i])); DefineMassByThreshold(N); } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -void Nucleus::DefineMassByThreshold(const vector<NPL::Nucleus>& N){ +void Particle::DefineMassByThreshold(const vector<NPL::Particle>& N){ // Define the mass as the sum of the mass of the particle defined in N unsigned int size = N.size(); double Mass = 0; @@ -601,7 +601,7 @@ void Nucleus::DefineMassByThreshold(const vector<NPL::Nucleus>& N){ } // Check the threshold make any sense (same A, same Z): if(A!=GetA()|| Z!=GetZ()){ - NPL::SendWarning("NPL::Nucleus","Mass and charge is not conserved in DefineMassByThreshold! Doing no change to nucleus"); + NPL::SendWarning("NPL::Particle","Mass and charge is not conserved in DefineMassByThreshold! Doing no change to particle"); return; } @@ -611,52 +611,52 @@ void Nucleus::DefineMassByThreshold(const vector<NPL::Nucleus>& N){ //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -double Nucleus::GetSXn(unsigned int X) const { - Nucleus N(GetZ(),GetA()-X); +double Particle::GetSXn(unsigned int X) const { + Particle N(GetZ(),GetA()-X); return N.Mass()+X*neutron_mass_c2-Mass(); } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -double Nucleus::GetSXp(unsigned int X) const { - Nucleus N(GetZ()-X,GetA()-X); +double Particle::GetSXp(unsigned int X) const { + Particle N(GetZ()-X,GetA()-X); return N.Mass()+X*proton_mass_c2-Mass(); } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -double Nucleus::GetSn() const { +double Particle::GetSn() const { return GetSXn(1); } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -double Nucleus::GetSp() const { +double Particle::GetSp() const { return GetSXp(1); } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -double Nucleus::GetS2n() const { +double Particle::GetS2n() const { return GetSXn(2); } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -double Nucleus::GetS2p() const { +double Particle::GetS2p() const { return GetSXp(2); } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -double Nucleus::GetSt() const { - Nucleus N(GetZ()-1,GetA()-3); - Nucleus A(1,3); +double Particle::GetSt() const { + Particle N(GetZ()-1,GetA()-3); + Particle A(1,3); return N.Mass()+A.Mass()-Mass(); } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -double Nucleus::GetS3He() const { - Nucleus N(GetZ()-2,GetA()-3); - Nucleus A(2,3); +double Particle::GetS3He() const { + Particle N(GetZ()-2,GetA()-3); + Particle A(2,3); return N.Mass()+A.Mass()-Mass(); } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -double Nucleus::GetSa() const { - Nucleus N(GetZ()-2,GetA()-4); - Nucleus A(2,4); +double Particle::GetSa() const { + Particle N(GetZ()-2,GetA()-4); + Particle A(2,4); return N.Mass()+A.Mass()-Mass(); } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... -void Nucleus::PrintThreshold() const { +void Particle::PrintThreshold() const { cout << GetName() << " thresholds : " << endl; cout << " Sn : " << GetSn() << " MeV" << endl; cout << " Sp : " << GetSp() << " MeV" << endl; diff --git a/NPLib/Physics/NPParticle.h b/NPLib/Physics/NPParticle.h new file mode 100644 index 000000000..9a470fb1a --- /dev/null +++ b/NPLib/Physics/NPParticle.h @@ -0,0 +1,179 @@ +#ifndef NPPARTICLE_h +#define NPPARTICLE_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 particle, 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 Particle { + + public: + Particle(); + Particle(string isotope); + Particle(string isotope, const string& pathENSDF); + Particle(int Z, int A); + Particle(string name, vector<string> subpart, double binding,double Ex=0, string SpinParity="", double Spin=0, string Parity="", double LifeTime=-1); + virtual ~Particle(); + + public: + void SetUp(string isotope); + void LoadENSDF(const string& isotope, const string& pathENSDF); + + private : + //intrinsic properties + string fName; // Particle name + string fParticleName; + int fCharge; // Particle charge + int fAtomicWeight; // Particle atomic weight + double fMassExcess; // Particle mass excess in keV + double fMass; + string fSpinParity; // Particle spin and parity + double fSpin; // Particle spin + string fParity; // Particle 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 GetParticleName(); + string GetName() const {return fName;} + 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::Particle>& 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(Particle,0) + }; +} +#endif diff --git a/NPLib/Physics/NPParticleLinkDef.h b/NPLib/Physics/NPParticleLinkDef.h new file mode 100644 index 000000000..44747ea1a --- /dev/null +++ b/NPLib/Physics/NPParticleLinkDef.h @@ -0,0 +1,3 @@ +#ifdef __CINT__ +#pragma link C++ defined_in "NPParticle.h"; +#endif diff --git a/NPLib/Physics/NPQFS.cxx b/NPLib/Physics/NPQFS.cxx index 6f93995a9..29abb9ac0 100644 --- a/NPLib/Physics/NPQFS.cxx +++ b/NPLib/Physics/NPQFS.cxx @@ -126,15 +126,15 @@ void QFS::ReadConfigurationFile(NPL::InputParser parser){ if(blocks[i]->HasTokenList(token1)){ int v = NPOptionManager::getInstance()->GetVerboseLevel(); NPOptionManager::getInstance()->SetVerboseLevel(0); - fNucleiA.ReadConfigurationFile(parser); + fParticleA.ReadConfigurationFile(parser); NPOptionManager::getInstance()->SetVerboseLevel(v); - fBeamEnergy= fNucleiA.GetEnergy(); - GetNucleus(blocks[i]->GetString("Beam"),parser); - fNucleiT = GetNucleus(blocks[i]->GetString("Target"),parser); - fNucleiB = GetNucleus(blocks[i]->GetString("Heavy"),parser); - fNuclei1 = GetNucleus(blocks[i]->GetString("Scattered"),parser); - fNuclei2 = GetNucleus(blocks[i]->GetString("KnockedOut"),parser); + fBeamEnergy= fParticleA.GetEnergy(); + GetParticle(blocks[i]->GetString("Beam"),parser); + fParticleT = GetParticle(blocks[i]->GetString("Target"),parser); + fParticleB = GetParticle(blocks[i]->GetString("Heavy"),parser); + fParticle1 = GetParticle(blocks[i]->GetString("Scattered"),parser); + fParticle2 = GetParticle(blocks[i]->GetString("KnockedOut"),parser); } else{ cout << "ERROR: check your input file formatting \033[0m" << endl; @@ -178,17 +178,17 @@ void QFS::ReadConfigurationFile(NPL::InputParser parser){ } //////////////////////////////////////////////////////////////////////////////// -Nucleus QFS::GetNucleus(string name, NPL::InputParser parser){ +Particle QFS::GetParticle(string name, NPL::InputParser parser){ - vector<NPL::InputBlock*> blocks = parser.GetAllBlocksWithTokenAndValue("DefineNucleus",name); + vector<NPL::InputBlock*> blocks = parser.GetAllBlocksWithTokenAndValue("DefineParticle",name); unsigned int size = blocks.size(); if(size==0) - return NPL::Nucleus(name); + return NPL::Particle(name); else if(size==1){ cout << " -- User defined nucleus " << name << " -- " << endl; vector<string> token = {"SubPart","BindingEnergy"}; if(blocks[0]->HasTokenList(token)){ - NPL::Nucleus N(name,blocks[0]->GetVectorString("SubPart"),blocks[0]->GetDouble("BindingEnergy","MeV")); + NPL::Particle N(name,blocks[0]->GetVectorString("SubPart"),blocks[0]->GetDouble("BindingEnergy","MeV")); if(blocks[0]->HasToken("ExcitationEnergy")) N.SetExcitationEnergy(blocks[0]->GetDouble("ExcitationEnergy","MeV")); if(blocks[0]->HasToken("SpinParity")) @@ -206,9 +206,9 @@ Nucleus QFS::GetNucleus(string name, NPL::InputParser parser){ } else{ NPL::SendErrorAndExit("NPL::QFS","Too many nuclei define with the same name"); - return NPL::Nucleus(); + return NPL::Particle(); } - return NPL::Nucleus(); + return NPL::Particle(); } @@ -221,11 +221,11 @@ void QFS::CalculateVariables(){ //cout<<"---- COMPUTE ------"<<endl; // cout<<"--CM--"<<endl; - mA = fNucleiA.Mass(); // Beam mass in MeV - mT = fNucleiT.Mass(); // Target mass in MeV - mB = fNucleiB.Mass(); // Heavy residual mass in MeV + mA = fParticleA.Mass(); // Beam mass in MeV + mT = fParticleT.Mass(); // Target mass in MeV + mB = fParticleB.Mass(); // Heavy residual mass in MeV m1 = mT; // scattered target nucleon (same mass); - m2 = fNuclei2.Mass(); // knocked out cluster mass in MeV + m2 = fParticle2.Mass(); // knocked out cluster mass in MeV ma = m2; // intermediate cluster mass in MeV (same); double TA = fBeamEnergy; // Beam kinetic energy @@ -498,8 +498,8 @@ TGraph* QFS::GetPhi2VsPhi1(double AngleStep_CM){ /////////////////////////////////////////////////////////////////////////////// // Check whenever the reaction is allowed at a given energy bool QFS::IsAllowed(){//double Energy){ - //double AvailableEnergy = Energy + fNuclei1.Mass() + fNuclei2.Mass(); - //double RequiredEnergy = fNuclei3.Mass() + fNuclei4.Mass(); + //double AvailableEnergy = Energy + fParticle1.Mass() + fParticle2.Mass(); + //double RequiredEnergy = fParticle3.Mass() + fParticle4.Mass(); //if(AvailableEnergy>RequiredEnergy) return true; @@ -525,11 +525,11 @@ void QFS::CalculateVariablesOld(){ //cout<<"---- COMPUTE ------"<<endl; // cout<<"--CM--"<<endl; - mA = fNucleiA.Mass(); // Beam mass in MeV - mT = fNucleiT.Mass(); // Target mass in MeV - mB = fNucleiB.Mass(); // Heavy residual mass in MeV + mA = fParticleA.Mass(); // Beam mass in MeV + mT = fParticleT.Mass(); // Target mass in MeV + mB = fParticleB.Mass(); // Heavy residual mass in MeV m1 = mT; // scattered target nucleon (same mass); - m2 = fNuclei2.Mass(); // knocked out cluster mass in MeV + m2 = fParticle2.Mass(); // knocked out cluster mass in MeV ma = m2; // intermediate cluster mass in MeV (same); double TA = fBeamEnergy; // Beam kinetic energy diff --git a/NPLib/Physics/NPQFS.h b/NPLib/Physics/NPQFS.h index 052490510..e82efc300 100644 --- a/NPLib/Physics/NPQFS.h +++ b/NPLib/Physics/NPQFS.h @@ -42,7 +42,7 @@ #include <string> // NPL -#include "NPNucleus.h" +#include "NPParticle.h" #include "NPBeam.h" #include "NPInputParser.h" using namespace NPL; @@ -67,11 +67,11 @@ namespace NPL{ private: int fVerboseLevel; - Beam fNucleiA; // Beam (A) - Nucleus fNucleiT; // Target (T) - Nucleus fNucleiB; // Beam-like ejectile (B) - Nucleus fNuclei1; // Target-like ejectile (1) - Nucleus fNuclei2; // Knocked-out nucleon/cluster (2) + Beam fParticleA; // Beam (A) + Particle fParticleT; // Target (T) + Particle fParticleB; // Beam-like ejectile (B) + Particle fParticle1; // Target-like ejectile (1) + Particle fParticle2; // Knocked-out nucleon/cluster (2) double fQValue; // Q-value in MeV double fEcm; // Ecm in MeV double fThetaCM; // Center-of-mass theta angle in radian @@ -94,7 +94,7 @@ namespace NPL{ bool fshoot2; // shoot light ejectile 2 public: - Nucleus GetNucleus(string name, NPL::InputParser parser); + Particle GetParticle(string name, NPL::InputParser parser); void ReadConfigurationFile(string Path); void ReadConfigurationFile(NPL::InputParser); void CalculateVariables(); @@ -173,11 +173,11 @@ namespace NPL{ {delete fParMomentumHist; fParMomentumHist = ParMomentumHist;} //GETTERS - Nucleus* GetNucleusA() {return &fNucleiA;} - Nucleus* GetNucleusT() {return &fNucleiT;} - Nucleus* GetNucleusB() {return &fNucleiB;} - Nucleus* GetNucleus1() {return &fNuclei1;} - Nucleus* GetNucleus2() {return &fNuclei2;} + Particle* GetParticleA() {return &fParticleA;} + Particle* GetParticleT() {return &fParticleT;} + Particle* GetParticleB() {return &fParticleB;} + Particle* GetParticle1() {return &fParticle1;} + Particle* GetParticle2() {return &fParticle2;} bool GetShoot1() const {return fshoot1;} bool GetShoot2() const {return fshoot2;} bool GetShootB() const {return fshootB;} diff --git a/NPLib/Physics/NPReaction.cxx b/NPLib/Physics/NPReaction.cxx index 566194f56..6ec299bb0 100644 --- a/NPLib/Physics/NPReaction.cxx +++ b/NPLib/Physics/NPReaction.cxx @@ -14,7 +14,7 @@ *---------------------------------------------------------------------------* * Decription: * * This class deal with Two Body transfert Reaction * - * Physical parameter (Nuclei mass) are loaded from the nubtab03.asc file * + * Physical parameter (Particle mass) are loaded from the nubtab03.asc file * * (2003 nuclear table of isotopes mass). * * * * KineRelativistic: Used in NPSimulation * @@ -132,10 +132,10 @@ Reaction::Reaction(string reaction){ fLineBrho3 = 0; fTheta3VsTheta4 = 0; fAngleLine = 0; - fNuclei1 = Beam(A); - fNuclei2 = Nucleus(b); - fNuclei3 = Nucleus(c); - fNuclei4 = Nucleus(D); + fParticle1 = Beam(A); + fParticle2 = Particle(b); + fParticle3 = Particle(c); + fParticle4 = Particle(D); fBeamEnergy = atof(E.c_str()); fThetaCM = 0; fExcitation1 = 0; @@ -289,7 +289,7 @@ double Reaction::ReconstructRelativistic(double EnergyLab, double ThetaLab){ fEnergyImpulsionLab_4 = fTotalEnergyImpulsionLab - fEnergyImpulsionLab_3; - double Eex = fEnergyImpulsionLab_4.Mag() - fNuclei4.Mass(); + double Eex = fEnergyImpulsionLab_4.Mag() - fParticle4.Mass(); return Eex; } @@ -375,14 +375,14 @@ double Reaction::EnergyLabFromThetaLab(double ThetaLab){ void Reaction::Print() const{ // Print informations concerning the reaction - cout << "Reaction : " << fNuclei2.GetName() << "(" << fNuclei1.GetName() - << "," << fNuclei3.GetName() << ")" << fNuclei4.GetName() << " @ " + cout << "Reaction : " << fParticle2.GetName() << "(" << fParticle1.GetName() + << "," << fParticle3.GetName() << ")" << fParticle4.GetName() << " @ " << fBeamEnergy << " MeV" << endl ; - cout << "Exc Nuclei 1 = " << fExcitation1 << " MeV" << endl; - cout << "Exc Nuclei 3 = " << fExcitation3 << " MeV" << endl; - cout << "Exc Nuclei 4 = " << fExcitation4 << " MeV" << endl; + cout << "Exc Particle 1 = " << fExcitation1 << " MeV" << endl; + cout << "Exc Particle 3 = " << fExcitation3 << " MeV" << endl; + cout << "Exc Particle 4 = " << fExcitation4 << " MeV" << endl; cout << "Qgg = " << fQValue << " MeV" << endl; } @@ -403,16 +403,16 @@ void Reaction::ReadConfigurationFile(string Path){ ReadConfigurationFile(parser); } //////////////////////////////////////////////////////////////////////////////// -Nucleus Reaction::GetNucleus(string name, NPL::InputParser parser){ - vector<NPL::InputBlock*> blocks = parser.GetAllBlocksWithTokenAndValue("DefineNucleus",name); +Particle Reaction::GetParticle(string name, NPL::InputParser parser){ + vector<NPL::InputBlock*> blocks = parser.GetAllBlocksWithTokenAndValue("DefineParticle",name); unsigned int size = blocks.size(); if(size==0) - return NPL::Nucleus(name); + return NPL::Particle(name); else if(size==1){ cout << " -- User defined nucleus " << name << " -- " << endl; vector<string> token = {"SubPart","BindingEnergy"}; if(blocks[0]->HasTokenList(token)){ - NPL::Nucleus N(name,blocks[0]->GetVectorString("SubPart"),blocks[0]->GetDouble("BindingEnergy","MeV")); + NPL::Particle N(name,blocks[0]->GetVectorString("SubPart"),blocks[0]->GetDouble("BindingEnergy","MeV")); if(blocks[0]->HasToken("ExcitationEnergy")) N.SetExcitationEnergy(blocks[0]->GetDouble("ExcitationEnergy","MeV")); if(blocks[0]->HasToken("SpinParity")) @@ -432,7 +432,7 @@ Nucleus Reaction::GetNucleus(string name, NPL::InputParser parser){ NPL::SendErrorAndExit("NPL::Reaction","Too many nuclei define with the same name"); } - return (NPL::Nucleus()); + return (NPL::Particle()); } ////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -443,29 +443,29 @@ void Reaction::ReadConfigurationFile(NPL::InputParser parser){ cout << endl << "\033[1;35m//// Two body reaction found " << endl; vector<string> token1 = {"Beam","Target","Light","Heavy"}; - vector<string> token2 = {"Beam","Target","Nuclei3","Nuclei4"}; + vector<string> token2 = {"Beam","Target","Particle3","Particle4"}; double CSHalfOpenAngleMin= 0*deg ; double CSHalfOpenAngleMax= 180*deg; for(unsigned int i = 0 ; i < blocks.size() ; i++){ if(blocks[i]->HasTokenList(token1)){ int v = NPOptionManager::getInstance()->GetVerboseLevel(); NPOptionManager::getInstance()->SetVerboseLevel(0); - fNuclei1.ReadConfigurationFile(parser); + fParticle1.ReadConfigurationFile(parser); NPOptionManager::getInstance()->SetVerboseLevel(v); - fBeamEnergy= fNuclei1.GetEnergy(); - fNuclei2 = GetNucleus(blocks[i]->GetString("Target"),parser); - fNuclei3 = GetNucleus(blocks[i]->GetString("Light"),parser); - fNuclei4 = GetNucleus(blocks[i]->GetString("Heavy"),parser); + fBeamEnergy= fParticle1.GetEnergy(); + fParticle2 = GetParticle(blocks[i]->GetString("Target"),parser); + fParticle3 = GetParticle(blocks[i]->GetString("Light"),parser); + fParticle4 = GetParticle(blocks[i]->GetString("Heavy"),parser); } else if(blocks[i]->HasTokenList(token2)){ - fNuclei1.SetVerboseLevel(0); - fNuclei1.ReadConfigurationFile(parser); - fBeamEnergy= fNuclei1.GetEnergy(); + fParticle1.SetVerboseLevel(0); + fParticle1.ReadConfigurationFile(parser); + fBeamEnergy= fParticle1.GetEnergy(); - fNuclei2 = GetNucleus(blocks[i]->GetString("Target"),parser); - fNuclei3 = GetNucleus(blocks[i]->GetString("Nuclei3"),parser); - fNuclei4 = GetNucleus(blocks[i]->GetString("Nuclei4"),parser); + fParticle2 = GetParticle(blocks[i]->GetString("Target"),parser); + fParticle3 = GetParticle(blocks[i]->GetString("Particle3"),parser); + fParticle4 = GetParticle(blocks[i]->GetString("Particle4"),parser); } else{ cout << "ERROR: check your input file formatting \033[0m" << endl; @@ -573,13 +573,13 @@ void Reaction::initializePrecomputeVariable(){ if(fBeamEnergy < 0) fBeamEnergy = 0 ; - if(fExcitation1>=0) fNuclei1.SetExcitationEnergy(fExcitation1); // Write over the beam excitation energy + if(fExcitation1>=0) fParticle1.SetExcitationEnergy(fExcitation1); // Write over the beam excitation energy - //fNuclei1.GetExcitationEnergy() is a copy of fExcitation1 - m1 = fNuclei1.Mass() + fNuclei1.GetExcitationEnergy();// in case of isomeric state, - m2 = fNuclei2.Mass(); // Target - m3 = fNuclei3.Mass() + fExcitation3; - m4 = fNuclei4.Mass() + fExcitation4; + //fParticle1.GetExcitationEnergy() is a copy of fExcitation1 + m1 = fParticle1.Mass() + fParticle1.GetExcitationEnergy();// in case of isomeric state, + m2 = fParticle2.Mass(); // Target + m3 = fParticle3.Mass() + fExcitation3; + m4 = fParticle4.Mass() + fExcitation4; fQValue =m1+m2-m3-m4; s = m1*m1 + m2*m2 + 2*m2*(fBeamEnergy + m1); @@ -615,14 +615,14 @@ void Reaction::initializePrecomputeVariable(){ } //////////////////////////////////////////////////////////////////////////////////////////// -void Reaction::SetNuclei3(double EnergyLab, double ThetaLab){ +void Reaction::SetParticle3(double EnergyLab, double ThetaLab){ double p3 = sqrt(pow(EnergyLab,2) + 2*m3*EnergyLab); fEnergyImpulsionLab_3 = TLorentzVector(p3*sin(ThetaLab),0,p3*cos(ThetaLab),EnergyLab+m3); fEnergyImpulsionLab_4 = fTotalEnergyImpulsionLab - fEnergyImpulsionLab_3; - fNuclei3.SetEnergyImpulsion(fEnergyImpulsionLab_3); - fNuclei4.SetEnergyImpulsion(fEnergyImpulsionLab_4); + fParticle3.SetEnergyImpulsion(fEnergyImpulsionLab_3); + fParticle4.SetEnergyImpulsion(fEnergyImpulsionLab_4); fThetaCM = EnergyLabToThetaCM(EnergyLab, ThetaLab); fExcitation4 = ReconstructRelativistic(EnergyLab, ThetaLab); @@ -638,7 +638,7 @@ TGraph* Reaction::GetKinematicLine3(double AngleStep_CM){ for (double angle=0 ; angle < 360 ; angle+=AngleStep_CM){ SetThetaCM(angle*deg); KineRelativistic(theta3, E3, theta4, E4); - fNuclei3.SetKineticEnergy(E3); + fParticle3.SetKineticEnergy(E3); if(E3>0){ vx.push_back(theta3/deg); @@ -660,7 +660,7 @@ TGraph* Reaction::GetKinematicLine4(double AngleStep_CM){ for (double angle=0 ; angle < 360 ; angle+=AngleStep_CM){ SetThetaCM(angle*deg); KineRelativistic(theta3, E3, theta4, E4); - fNuclei4.SetKineticEnergy(E4); + fParticle4.SetKineticEnergy(E4); if(E4>0){ vx.push_back(theta4/deg); vy.push_back(E4); @@ -701,8 +701,8 @@ TGraph* Reaction::GetBrhoLine3(double AngleStep_CM){ for (double angle=0 ; angle < 360 ; angle+=AngleStep_CM){ SetThetaCM(angle*deg); KineRelativistic(theta3, E3, theta4, E4); - fNuclei3.SetKineticEnergy(E3); - Brho = fNuclei3.GetBrho(); + fParticle3.SetKineticEnergy(E3); + Brho = fParticle3.GetBrho(); vx.push_back(theta3/deg); vy.push_back(Brho); @@ -772,11 +772,11 @@ void Reaction::PrintKinematic(){ SetThetaCM(((double)i)/2*deg); KineRelativistic(theta3, E3, theta4, E4); - fNuclei3.SetKineticEnergy(E3); - Brho3 = fNuclei3.GetBrho(); + fParticle3.SetKineticEnergy(E3); + Brho3 = fParticle3.GetBrho(); - fNuclei4.SetKineticEnergy(E4); - Brho4 = fNuclei4.GetBrho(); + fParticle4.SetKineticEnergy(E4); + Brho4 = fParticle4.GetBrho(); cout << (double)i/2 << " " << theta3/deg << " " << E3 << " " << Brho3 << " " << E4 << " " << Brho4 << endl; } @@ -796,8 +796,8 @@ void Reaction::SetCSAngle(double CSHalfOpenAngleMin,double CSHalfOpenAngleMax){ /////////////////////////////////////////////////////////////////////////////// // Check whenever the reaction is allowed at the given energy bool Reaction::IsAllowed(double Energy){ - double AvailableEnergy = Energy + fNuclei1.Mass() + fNuclei2.Mass(); - double RequiredEnergy = fNuclei3.Mass() + fNuclei4.Mass(); + double AvailableEnergy = Energy + fParticle1.Mass() + fParticle2.Mass(); + double RequiredEnergy = fParticle3.Mass() + fParticle4.Mass(); if(AvailableEnergy>RequiredEnergy) return true; diff --git a/NPLib/Physics/NPReaction.h b/NPLib/Physics/NPReaction.h index a30118af2..57b7cfb29 100644 --- a/NPLib/Physics/NPReaction.h +++ b/NPLib/Physics/NPReaction.h @@ -17,7 +17,7 @@ * Decription: * * This class simulate particule with a give energy * * and angular distirubtion in the lab. * - * Physical parameter (Nuclei mass) are loaded from the nubtab03.asc file * + * Physical parameter (Particle mass) are loaded from the nubtab03.asc file * * (2003 nuclear table of isotopes mass). * * * * * @@ -32,7 +32,7 @@ #include <string> // NPL -#include "NPNucleus.h" +#include "NPParticle.h" #include "NPBeam.h" #include "NPInputParser.h" using namespace NPL; @@ -60,7 +60,7 @@ namespace NPL{ ~Reaction(); public: // Various Method - Nucleus GetNucleus(string name, NPL::InputParser parser); + Particle GetParticle(string name, NPL::InputParser parser); void ReadConfigurationFile(string Path); void ReadConfigurationFile(NPL::InputParser); @@ -83,10 +83,10 @@ namespace NPL{ TGraph* fLineBrho3; TGraph* fAngleLine; private: - Beam fNuclei1; // Beam - Nucleus fNuclei2; // Target - Nucleus fNuclei3; // Light ejectile - Nucleus fNuclei4; // Heavy ejectile + Beam fParticle1; // Beam + Particle fParticle2; // Target + Particle fParticle3; // Light ejectile + Particle fParticle4; // Heavy ejectile double fQValue; // Q-value in MeV double fEcm; // Ecm in MeV double fBeamEnergy; // Beam energy in MeV @@ -122,10 +122,10 @@ namespace NPL{ double GetExcitation4() const {return fExcitation4;} double GetQValue() const {return fQValue;} double GetEcm() const {return fEcm;} - Nucleus* GetNucleus1() {return &fNuclei1;} - Nucleus* GetNucleus2() {return &fNuclei2;} - Nucleus* GetNucleus3() {return &fNuclei3;} - Nucleus* GetNucleus4() {return &fNuclei4;} + Particle* GetParticle1() {return &fParticle1;} + Particle* GetParticle2() {return &fParticle2;} + Particle* GetParticle3() {return &fParticle3;} + Particle* GetParticle4() {return &fParticle4;} TH1F* GetCrossSectionHist() const {return fCrossSectionHist;} int GetVerboseLevel() const {return fVerboseLevel;} bool GetShoot3() const {return fshoot3;} @@ -221,7 +221,7 @@ namespace NPL{ // Check whenever the reaction is allowed at the given energy bool IsAllowed(double Energy); - void SetNuclei3(double EnergyLab, double ThetaLab); + void SetParticle3(double EnergyLab, double ThetaLab); TGraph* GetKinematicLine3(double AngleStep_CM=1); TGraph* GetKinematicLine4(double AngleStep_CM=1); diff --git a/NPSimulation/Process/BeamReaction.cc b/NPSimulation/Process/BeamReaction.cc index 9d9d3795b..1d73194f8 100644 --- a/NPSimulation/Process/BeamReaction.cc +++ b/NPSimulation/Process/BeamReaction.cc @@ -67,8 +67,8 @@ void NPS::BeamReaction::ReadConfiguration() { if (m_ReactionType=="TwoBodyReaction" ) { m_Reaction.ReadConfigurationFile(input); - m_BeamName = NPL::ChangeNameToG4Standard(m_Reaction.GetNucleus1()->GetName()); - if(m_Reaction.GetNucleus3()->GetName() != ""){ + m_BeamName = NPL::ChangeNameToG4Standard(m_Reaction.GetParticle1()->GetName()); + if(m_Reaction.GetParticle3()->GetName() != ""){ m_active = true; m_ReactionConditions = new TReactionConditions(); AttachReactionConditions(); @@ -80,7 +80,7 @@ void NPS::BeamReaction::ReadConfiguration() { else if (m_ReactionType=="QFSReaction") { m_QFS.ReadConfigurationFile(input); - m_BeamName = NPL::ChangeNameToG4Standard(m_QFS.GetNucleusA()->GetName()); + m_BeamName = NPL::ChangeNameToG4Standard(m_QFS.GetParticleA()->GetName()); m_active = true; m_ReactionConditions = new TReactionConditions(); AttachReactionConditions(); @@ -232,12 +232,12 @@ void NPS::BeamReaction::DoIt(const G4FastTrack& fastTrack, //////Define the kind of particle to shoot//////// // Particle 3 G4ParticleDefinition* LightName; - if(m_Reaction.GetNucleus3()->GetName()=="electron"){ + if(m_Reaction.GetParticle3()->GetName()=="electron"){ LightName=G4Electron::Definition(); } else{ - int LightZ = m_Reaction.GetNucleus3()->GetZ(); - int LightA = m_Reaction.GetNucleus3()->GetA(); + int LightZ = m_Reaction.GetParticle3()->GetZ(); + int LightA = m_Reaction.GetParticle3()->GetA(); if (LightZ == 0 && LightA == 1){ LightName = G4Neutron::Definition(); } @@ -252,9 +252,9 @@ void NPS::BeamReaction::DoIt(const G4FastTrack& fastTrack, } - // Nucleus 4 - G4int HeavyZ = m_Reaction.GetNucleus4()->GetZ(); - G4int HeavyA = m_Reaction.GetNucleus4()->GetA(); + // Particle 4 + G4int HeavyZ = m_Reaction.GetParticle4()->GetZ(); + G4int HeavyA = m_Reaction.GetParticle4()->GetA(); // Generate the excitation energy if a distribution is given m_Reaction.ShootRandomExcitationEnergy(); @@ -403,10 +403,10 @@ void NPS::BeamReaction::DoIt(const G4FastTrack& fastTrack, //////Define the kind of particle to shoot//////// // A --> T ==> B + (c -> T) => B + 1 + 2 - int Light1_Z = m_QFS.GetNucleus1()->GetZ(); - int Light1_A = m_QFS.GetNucleus1()->GetA(); - int Light2_Z = m_QFS.GetNucleus2()->GetZ(); - int Light2_A = m_QFS.GetNucleus2()->GetA(); + int Light1_Z = m_QFS.GetParticle1()->GetZ(); + int Light1_A = m_QFS.GetParticle1()->GetA(); + int Light2_Z = m_QFS.GetParticle2()->GetZ(); + int Light2_A = m_QFS.GetParticle2()->GetA(); static G4IonTable* IonTable = G4ParticleTable::GetParticleTable()->GetIonTable(); @@ -428,9 +428,9 @@ void NPS::BeamReaction::DoIt(const G4FastTrack& fastTrack, Light2Name = IonTable->GetIon(Light2_Z, Light2_A); } - // Nucleus B - G4int Heavy_Z = m_QFS.GetNucleusB()->GetZ(); - G4int Heavy_A = m_QFS.GetNucleusB()->GetA(); + // Particle B + G4int Heavy_Z = m_QFS.GetParticleB()->GetZ(); + G4int Heavy_A = m_QFS.GetParticleB()->GetA(); G4ParticleDefinition* HeavyName; HeavyName = IonTable->GetIon(Heavy_Z, Heavy_A); @@ -499,7 +499,7 @@ void NPS::BeamReaction::DoIt(const G4FastTrack& fastTrack, G4ThreeVector momentum_kineB_beam( P_B->Px(), P_B->Py(), P_B->Pz() ); momentum_kineB_beam = momentum_kineB_beam.unit(); - TKEB = P_B->Energy() - m_QFS.GetNucleusB()->Mass(); + TKEB = P_B->Energy() - m_QFS.GetParticleB()->Mass(); G4ThreeVector momentum_kineB_world = momentum_kineB_beam; momentum_kineB_world.rotate(Beam_theta, V); // rotation of Beam_theta on Y axis momentum_kineB_world.rotate(Beam_phi, ZZ); // rotation of Beam_phi on Z axis diff --git a/Projects/Strasse/Analysis.cxx b/Projects/Strasse/Analysis.cxx index 442d6c0d4..fbbd5e06d 100644 --- a/Projects/Strasse/Analysis.cxx +++ b/Projects/Strasse/Analysis.cxx @@ -154,12 +154,12 @@ void Analysis::TreatEvent(){ //////////////////////////////////// // setting up Lorentz Vector from measured trajectories and energies - // TVector3 PA(0,0,sqrt(TA*(TA+2*m_QFS->GetNucleusA()->Mass()))); // for like there is no BDC - double beam_mom=sqrt(TA*(TA+2*m_QFS->GetNucleusA()->Mass())); + // TVector3 PA(0,0,sqrt(TA*(TA+2*m_QFS->GetParticleA()->Mass()))); // for like there is no BDC + double beam_mom=sqrt(TA*(TA+2*m_QFS->GetParticleA()->Mass())); // TVector3 PA(0,0,beam_mom); // for like there is no BDC TVector3 PA=beam_mom*RC->GetBeamDirection().Unit(); - LV_A.SetVectM(PA,m_QFS->GetNucleusA()->Mass()); + LV_A.SetVectM(PA,m_QFS->GetParticleA()->Mass()); double P1= sqrt(E1*(E1+2*NPUNITS::proton_mass_c2)); double P2= sqrt(E2*(E2+2*NPUNITS::proton_mass_c2)); @@ -168,7 +168,7 @@ void Analysis::TreatEvent(){ // computing Ex from Missing Mass LV_B = LV_A + LV_T - LV_p1 - LV_p2; //LV_B = RC->GetParticleMomentum(2); - Ex = LV_B.M() - m_QFS->GetNucleusB()->Mass(); + Ex = LV_B.M() - m_QFS->GetParticleB()->Mass(); } } } -- GitLab