From 8c495b4f092d0996f2df18f31aee41ed7da712bf Mon Sep 17 00:00:00 2001 From: Elidiano Tronchin <elidiano.tronchin@gmail.com> Date: Fri, 4 Jan 2019 10:23:38 +0100 Subject: [PATCH] * Added Phi angle in TReactionCondition TTree branch --- NPLib/Physics/TReactionConditions.cxx | 1 + NPLib/Physics/TReactionConditions.h | 3 +++ NPSimulation/Process/BeamReaction.cc | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/NPLib/Physics/TReactionConditions.cxx b/NPLib/Physics/TReactionConditions.cxx index cb6e9d6de..bd7476763 100644 --- a/NPLib/Physics/TReactionConditions.cxx +++ b/NPLib/Physics/TReactionConditions.cxx @@ -53,6 +53,7 @@ void TReactionConditions::Clear(){ // emmitted particles fRC_Particle_Name.clear(); fRC_Theta.clear(); + fRC_Phi.clear(); fRC_Kinetic_Energy.clear(); fRC_Momentum_Direction_X.clear(); fRC_Momentum_Direction_Y.clear(); diff --git a/NPLib/Physics/TReactionConditions.h b/NPLib/Physics/TReactionConditions.h index 2a46cb1ca..f7ce597e7 100644 --- a/NPLib/Physics/TReactionConditions.h +++ b/NPLib/Physics/TReactionConditions.h @@ -62,6 +62,7 @@ private: // emmitted particles vector<string> fRC_Particle_Name; vector<double> fRC_Theta; + vector<double> fRC_Phi; vector<double> fRC_Kinetic_Energy; vector<double> fRC_Momentum_Direction_X; vector<double> fRC_Momentum_Direction_Y; @@ -95,6 +96,7 @@ public: // emmitted particles void SetParticleName (const string & Particle_Name) {fRC_Particle_Name.push_back(Particle_Name);}//! void SetTheta (const double & Angle) {fRC_Theta.push_back(Angle);}//! + void SetPhi (const double & Angle) {fRC_Phi.push_back(Angle);}//! void SetKineticEnergy (const double & Kinetic_Energy) {fRC_Kinetic_Energy.push_back(Kinetic_Energy);}//! void SetMomentumDirectionX (const double & Momentum_Direction_X) {fRC_Momentum_Direction_X.push_back(Momentum_Direction_X);}//! void SetMomentumDirectionY (const double & Momentum_Direction_Y) {fRC_Momentum_Direction_Y.push_back(Momentum_Direction_Y);}//! @@ -121,6 +123,7 @@ public: int GetParticleMultiplicity() const {return fRC_Kinetic_Energy.size();}//! string GetParticleName (const int &i) const {return fRC_Particle_Name[i];}//! double GetTheta (const int &i) const {return fRC_Theta[i];}//! + double GetPhi (const int &i) const {return fRC_Phi[i];}//! double GetKineticEnergy (const int &i) const {return fRC_Kinetic_Energy[i];}//! double GetMomentumDirectionX (const int &i) const {return fRC_Momentum_Direction_X[i];}//! double GetMomentumDirectionY (const int &i) const {return fRC_Momentum_Direction_Y[i];}//! diff --git a/NPSimulation/Process/BeamReaction.cc b/NPSimulation/Process/BeamReaction.cc index 27158ff4e..5f4d79daa 100644 --- a/NPSimulation/Process/BeamReaction.cc +++ b/NPSimulation/Process/BeamReaction.cc @@ -308,6 +308,10 @@ void NPS::BeamReaction::DoIt(const G4FastTrack& fastTrack,G4FastStep& fastStep) // Angle 3 and 4 // m_ReactionConditions->SetTheta(Theta3/deg); m_ReactionConditions->SetTheta(Theta4/deg); + + m_ReactionConditions->SetPhi(phi/deg); + if((phi+pi)/deg > 360 ) m_ReactionConditions->SetPhi((phi-pi)/deg); + else m_ReactionConditions->SetPhi((phi+pi)/deg); // Energy 3 and 4 // m_ReactionConditions->SetKineticEnergy(Energy3); m_ReactionConditions->SetKineticEnergy(Energy4); -- GitLab