-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from vetlewi/master
Fixed some bugs
- Loading branch information
Showing
9 changed files
with
108 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#ifndef RELSCATTER_H | ||
#define RELSCATTER_H | ||
|
||
|
||
class Particle; | ||
#include "Scattering.h" | ||
|
||
class RelScatter : public Scattering | ||
{ | ||
public: | ||
//! Constuctor. | ||
RelScatter(Particle *pA, /*!< Incident particle. */ | ||
Particle *pX, /*!< Target particle. */ | ||
Particle *pY, /*!< Residual particle. */ | ||
Particle *pB /*!< Fragement particle. */); | ||
|
||
//! Destructor. | ||
~RelScatter(); | ||
|
||
//! Evaluate energy of residual particle. | ||
/*! \return Energy of particle Y after scattering. | ||
*/ | ||
double EvaluateY(const double &E, /*!< Incident energy. */ | ||
const double &theta, /*!< Scattering angle of particle Y */ | ||
const double &Ex /*!< Excitation of particle B. */) const; | ||
|
||
|
||
//! Calculate the maximum excitation energy of particle B at given scattering angle and residual energy. | ||
double FindMaxEx(const double &E, /*!< Incident energy. */ | ||
const double &theta /*!< Scattering angle. */) const; | ||
|
||
}; | ||
|
||
#endif // RELSCATTER_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#include "RelScatter.h" | ||
|
||
#include "Particle.h" | ||
|
||
#include <cmath> | ||
|
||
|
||
RelScatter::RelScatter(Particle *pA, Particle *pX, Particle *pY, Particle *pB) | ||
: Scattering(pA, pX, pY, pB) | ||
{ | ||
|
||
} | ||
|
||
RelScatter::~RelScatter(){ } | ||
|
||
double RelScatter::EvaluateY(const double &E, const double &theta, const double &Ex) const | ||
{ | ||
double m1 = X->GetM_MeV(), m2 = A->GetM_MeV(), m3 = Y->GetM_MeV(), m4 = B->GetM_MeV(); | ||
|
||
double m4ex = m4 + Ex; | ||
|
||
double s = (m1+m2)*(m1+m2) + 2*m1*E; | ||
|
||
double pcm = sqrt(((s - m1*m1 - m2*m2)*(s - m1*m1 - m2*m2) - 4*m1*m1*m2*m2)/(4*s)); | ||
|
||
double chi = log((pcm + sqrt(pcm*pcm + m1*m1))/m1); | ||
|
||
double pcm2 = sqrt(((s - m3*m3 - m4ex*m4ex)*(s - m3*m3 - m4ex*m4ex) - 4*m3*m3*m4ex*m4ex)/(4*s)); | ||
|
||
double p3 = sqrt(pcm2*pcm2 + m3*m3)*cos(theta)*sinh(chi)+sqrt(pcm2*pcm2 - pow(m3*sin(theta)*sinh(chi),2))*cosh(chi); | ||
p3 /= 1 + sin(theta)*sin(theta)*sinh(chi)*sinh(chi); | ||
|
||
double E3 = sqrt(p3*p3 + m3*m3); | ||
return E3 - m3; | ||
} | ||
|
||
double RelScatter::FindMaxEx(const double &E, const double &theta) const | ||
{ | ||
double m1 = X->GetM_MeV(), m2 = A->GetM_MeV(), m3 = Y->GetM_MeV(), m4 = B->GetM_MeV(); | ||
|
||
double s = (m1+m2)*(m1+m2) + 2*m1*E; | ||
|
||
double pcm = sqrt(((s - m1*m1 - m2*m2)*(s - m1*m1 - m2*m2) - 4*m1*m1*m2*m2)/(4*s)); | ||
|
||
double chi = log((pcm + sqrt(pcm*pcm + m1*m1))/m1); | ||
|
||
double Ex = sqrt(s - 2*sqrt(s)*m3*sqrt(1 + pow(sin(theta)*sinh(chi), 2)) + m3*m3) - m4; | ||
return Ex; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters