Commit 9b6ea18b authored by Pawel Sznajder's avatar Pawel Sznajder
Browse files

add a bunch of new TCS observables

parent 6a618dcc
#ifndef TCSCROSSSECTIONUUMINUS_H #ifndef TCSCROSSSECTIONUU_H
#define TCSCROSSSECTIONUUMINUS_H #define TCSCROSSSECTIONUU_H
/** /**
* @file TCSCrossSectionUUMinus.h * @file TCSCrossSectionUU.h
* @author Pawel Sznajder (IPNO) * @author Pawel Sznajder (IPNO)
* @date November 25, 2016 * @date November 25, 2016
* @version 1.0 * @version 1.0
...@@ -18,25 +18,18 @@ ...@@ -18,25 +18,18 @@
namespace PARTONS { namespace PARTONS {
/** /**
* @class TCSCrossSectionUUMinus * @class TCSCrossSectionUU
* @brief Unpolarized cross-section for negative beam charge. * @brief Unpolarized cross-section.
* *
* Definition:<br> * Definition:<br>
* *
* \f$ \displaystyle * \f$ \displaystyle
* \frac{\mathrm{d}^4\sigma_{UU}}{\mathrm{d}x_{B} \mathrm{d}|t| \mathrm{d}Q^2 \mathrm{d}\phi}\left(x_{B}, t, Q^2, \phi\right) = * \frac{\mathrm{d}^4\sigma_{UU}}{\mathrm{d}|t| \mathrm{d}Q^2 \mathrm{d}\phi \mathrm{d}\theta}\left(t, Q^2, \phi, \theta\right) \, .
* \frac{1}{2} \left(
* \frac{\mathrm{d}^4\sigma^{\rightarrow -}}{\mathrm{d}x_{B} \mathrm{d}|t| \mathrm{d}Q^2 \mathrm{d}\phi}\left(x_{B}, t, Q^2, \phi\right) +
* \frac{\mathrm{d}^4\sigma^{\leftarrow -}}{\mathrm{d}x_{B} \mathrm{d}|t| \mathrm{d}Q^2 \mathrm{d}\phi}\left(x_{B}, t, Q^2, \phi\right)
* \right) \, ,
* \f$ * \f$
* *
* where
* \f$\sigma^{b_{h} b_{c}}\f$ is a single photon production cross-section (TCS, BH and Interference) for beam helicity denoted by \f$b_{h}\f$ and beam charge denoted by \f$b_{c}\f$.
*
* Unit: \f$\mathrm{nbarn}/\mathrm{GeV}^4\f$. * Unit: \f$\mathrm{nbarn}/\mathrm{GeV}^4\f$.
*/ */
class TCSCrossSectionUUMinus: public TCSObservable { class TCSCrossSectionUU: public TCSObservable {
public: public:
...@@ -49,14 +42,14 @@ public: ...@@ -49,14 +42,14 @@ public:
* Constructor. * Constructor.
* @param className Name of class. * @param className Name of class.
*/ */
TCSCrossSectionUUMinus(const std::string &className); TCSCrossSectionUU(const std::string &className);
/** /**
* Destructor. * Destructor.
*/ */
virtual ~TCSCrossSectionUUMinus(); virtual ~TCSCrossSectionUU();
virtual TCSCrossSectionUUMinus* clone() const; virtual TCSCrossSectionUU* clone() const;
protected: protected:
...@@ -64,7 +57,7 @@ protected: ...@@ -64,7 +57,7 @@ protected:
* Copy constructor. * Copy constructor.
* @param other Object to be copied. * @param other Object to be copied.
*/ */
TCSCrossSectionUUMinus(const TCSCrossSectionUUMinus &other); TCSCrossSectionUU(const TCSCrossSectionUU &other);
virtual PhysicalType<double> computeObservable( virtual PhysicalType<double> computeObservable(
const TCSObservableKinematic& kinematic, const TCSObservableKinematic& kinematic,
...@@ -73,4 +66,4 @@ protected: ...@@ -73,4 +66,4 @@ protected:
} /* namespace PARTONS */ } /* namespace PARTONS */
#endif /* TCSCROSSSECTIONUUMINUS_H */ #endif /* TCSCROSSSECTIONUU_H */
#ifndef TCSCROSSSECTIONTHETAINTEGRATEDUU_H
#define TCSCROSSSECTIONTHETAINTEGRATEDUU_H
/**
* @file TCSCrossSectionUUThetaIntegrated.h
* @author Pawel Sznajder (IPNO)
* @date November 25, 2016
* @version 1.0
*/
#include <ElementaryUtils/parameters/Parameters.h>
#include <string>
#include <utility>
#include <vector>
#include "../../../../beans/gpd/GPDType.h"
#include "../../../../beans/List.h"
#include "../../../../utils/type/PhysicalType.h"
#include "../../../MathIntegratorModule.h"
#include "TCSCrossSectionUU.h"
namespace PARTONS {
/**
* @class TCSCrossSectionUUThetaIntegrated
* @brief Unpolarized cross-section integrated over \f$\theta\f$ in a given range (default: \f$|\theta - \pi/2| < \pi/4\f$).
*
* Definition:<br>
*
* \f$ \displaystyle
* \int_{\theta_{\mathrm{min}}}^{\theta_{\mathrm{max}}}\mathrm{d}\theta} \frac{\mathrm{d}^4\sigma_{UU}}{\mathrm{d}|t| \mathrm{d}Q^2 \mathrm{d}\phi \mathrm{d}\theta}\left(t, Q^2, \phi, \theta\right) \, .
* \f$
*
* Unit: \f$\mathrm{nbarn}/\mathrm{GeV}^4\f$.
*/
class TCSCrossSectionUUThetaIntegrated: public TCSCrossSectionUU,
public MathIntegratorModule {
public:
static const std::string PARAMETER_NAME_THETA_LIMIT; ///< Name of parameter to set \f$\theta_{\mathrm{limit}}\f$, which is the limit on \f$\theta\f$ angle integration, defined as \f$|\theta - \pi/2| < \theta_{\mathrm{limit}}\f$. In degrees.
/**
* Unique ID to automatically register the class in the registry.
*/
static const unsigned int classId;
/**
* Constructor.
* @param className Name of class.
*/
TCSCrossSectionUUThetaIntegrated(const std::string &className);
/**
* Destructor.
*/
virtual ~TCSCrossSectionUUThetaIntegrated();
virtual TCSCrossSectionUUThetaIntegrated* clone() const;
virtual void configure(const ElemUtils::Parameters &parameters);
/**
* Get range of theta angle used in the integration.
*/
const std::pair<double, double>& getThetaRange() const;
/**
* Set range of theta angle used in the integration.
*/
void setThetaRange(const std::pair<double, double>& thetaRange);
protected:
/**
* Copy constructor.
* @param other Object to be copied.
*/
TCSCrossSectionUUThetaIntegrated(
const TCSCrossSectionUUThetaIntegrated &other);
virtual PhysicalType<double> computeObservable(
const TCSObservableKinematic& kinematic,
const List<GPDType>& gpdType);
/**
* Functor to perform the integration.
*/
NumA::FunctionType1D* m_pFunctionToIntegrateObservableTheta;
/**
* Function to be integrated.
*/
virtual double functionToIntegrateObservableTheta(double x,
std::vector<double> params);
/**
* Initialize functors.
*/
virtual void initFunctorsForIntegrations();
std::pair<double, double> m_thetaRange; ///< Range of theta angle used in the integration.
};
} /* namespace PARTONS */
#endif /* TCSCROSSSECTIONTHETAINTEGRATEDUU_H */
#ifndef TCSCROSSSECTIONTHETAPHIINTEGRATEDUU_H
#define TCSCROSSSECTIONTHETAPHIINTEGRATEDUU_H
/**
* @file TCSCrossSectionUUThetaPhiIntegrated.h
* @author Pawel Sznajder (IPNO)
* @date November 25, 2016
* @version 1.0
*/
#include <string>
#include <vector>
#include "../../../../beans/gpd/GPDType.h"
#include "../../../../beans/List.h"
#include "../../../../utils/type/PhysicalType.h"
#include "TCSCrossSectionUUThetaIntegrated.h"
namespace PARTONS {
/**
* @class TCSCrossSectionUUThetaPhiIntegrated
* @brief Unpolarized cross-section integrated over \f$\theta\f$ in a given range (default: \f$|\theta - \pi/2| < \pi/4\f$) and \f$\phi\f$ in the full range.
*
* Definition:<br>
*
* \f$ \displaystyle
* \int_{0}^{2\pi}\mathrm{d}\phi\int_{\theta_{\mathrm{min}}}^{\theta_{\mathrm{max}}}\mathrm{d}\theta} \frac{\mathrm{d}^4\sigma_{UU}}{\mathrm{d}|t| \mathrm{d}Q^2 \mathrm{d}\phi \mathrm{d}\theta}\left(t, Q^2, \phi, \theta\right) \, .
* \f$
*
* Unit: \f$\mathrm{nbarn}/\mathrm{GeV}^4\f$.
*/
class TCSCrossSectionUUThetaPhiIntegrated: public TCSCrossSectionUUThetaIntegrated {
public:
/**
* Unique ID to automatically register the class in the registry.
*/
static const unsigned int classId;
/**
* Constructor.
* @param className Name of class.
*/
TCSCrossSectionUUThetaPhiIntegrated(const std::string &className);
/**
* Destructor.
*/
virtual ~TCSCrossSectionUUThetaPhiIntegrated();
virtual TCSCrossSectionUUThetaPhiIntegrated* clone() const;
protected:
/**
* Copy constructor.
* @param other Object to be copied.
*/
TCSCrossSectionUUThetaPhiIntegrated(
const TCSCrossSectionUUThetaPhiIntegrated &other);
virtual PhysicalType<double> computeObservable(
const TCSObservableKinematic& kinematic,
const List<GPDType>& gpdType);
/**
* Functor to perform the integration.
*/
NumA::FunctionType1D* m_pFunctionToIntegrateObservablePhi;
/**
* Function to be integrated.
*/
virtual double functionToIntegrateObservablePhi(double x,
std::vector<double> params);
/**
* Initialize functors.
*/
virtual void initFunctorsForIntegrations();
};
} /* namespace PARTONS */
#endif /* TCSCROSSSECTIONTHETAPHIINTEGRATEDUU_H */
#include "../../../../../../include/partons/modules/observable/TCS/cross_section/TCSCrossSectionUUMinus.h" #include "../../../../../../include/partons/modules/observable/TCS/cross_section/TCSCrossSectionUU.h"
#include <NumA/linear_algebra/vector/Vector3D.h> #include <NumA/linear_algebra/vector/Vector3D.h>
...@@ -10,34 +10,33 @@ ...@@ -10,34 +10,33 @@
namespace PARTONS { namespace PARTONS {
const unsigned int TCSCrossSectionUUMinus::classId = const unsigned int TCSCrossSectionUU::classId =
BaseObjectRegistry::getInstance()->registerBaseObject( BaseObjectRegistry::getInstance()->registerBaseObject(
new TCSCrossSectionUUMinus("TCSCrossSectionUUMinus")); new TCSCrossSectionUU("TCSCrossSectionUU"));
TCSCrossSectionUUMinus::TCSCrossSectionUUMinus(const std::string &className) : TCSCrossSectionUU::TCSCrossSectionUU(const std::string &className) :
TCSObservable(className) { TCSObservable(className) {
} }
TCSCrossSectionUUMinus::TCSCrossSectionUUMinus( TCSCrossSectionUU::TCSCrossSectionUU(const TCSCrossSectionUU& other) :
const TCSCrossSectionUUMinus& other) :
TCSObservable(other) { TCSObservable(other) {
} }
TCSCrossSectionUUMinus::~TCSCrossSectionUUMinus() { TCSCrossSectionUU::~TCSCrossSectionUU() {
} }
TCSCrossSectionUUMinus* TCSCrossSectionUUMinus::clone() const { TCSCrossSectionUU* TCSCrossSectionUU::clone() const {
return new TCSCrossSectionUUMinus(*this); return new TCSCrossSectionUU(*this);
} }
PhysicalType<double> TCSCrossSectionUUMinus::computeObservable( PhysicalType<double> TCSCrossSectionUU::computeObservable(
const TCSObservableKinematic& kinematic, const List<GPDType>& gpdType) { const TCSObservableKinematic& kinematic, const List<GPDType>& gpdType) {
//evaluate //evaluate
TCSObservableResult A = m_pProcessModule->compute(0, TCSObservableResult A = m_pProcessModule->compute(-1,
NumA::Vector3D(0., 0., 0.), kinematic, gpdType); NumA::Vector3D(0., 0., 0.), kinematic, gpdType);
TCSObservableResult B = m_pProcessModule->compute(0, TCSObservableResult B = m_pProcessModule->compute(1,
NumA::Vector3D(0., 0., 0.), kinematic, gpdType); NumA::Vector3D(0., 0., 0.), kinematic, gpdType);
//combine //combine
......
#include "../../../../../../include/partons/modules/observable/TCS/cross_section/TCSCrossSectionUUThetaIntegrated.h"
#include <ElementaryUtils/parameters/GenericType.h>
#include <ElementaryUtils/string_utils/Formatter.h>
#include <NumA/functor/one_dimension/Functor1D.h>
#include <NumA/integration/one_dimension/Integrator1D.h>
#include <NumA/integration/one_dimension/IntegratorType1D.h>
#include "../../../../../../include/partons/beans/observable/TCS/TCSObservableKinematic.h"
#include "../../../../../../include/partons/BaseObjectRegistry.h"
#include "../../../../../../include/partons/FundamentalPhysicalConstants.h"
#include "../../../../../../include/partons/modules/observable/Observable.h"
#include "../../../../../../include/partons/utils/type/PhysicalUnit.h"
namespace PARTONS {
const std::string TCSCrossSectionUUThetaIntegrated::PARAMETER_NAME_THETA_LIMIT =
"theta_limit";
const unsigned int TCSCrossSectionUUThetaIntegrated::classId =
BaseObjectRegistry::getInstance()->registerBaseObject(
new TCSCrossSectionUUThetaIntegrated(
"TCSCrossSectionUUThetaIntegrated"));
TCSCrossSectionUUThetaIntegrated::TCSCrossSectionUUThetaIntegrated(
const std::string &className) :
TCSCrossSectionUU(className), MathIntegratorModule(), m_pFunctionToIntegrateObservableTheta(
0) {
m_thetaRange = std::pair<double, double>(Constant::PI / 4.,
3 * Constant::PI / 4.);
setIntegrator(NumA::IntegratorType1D::DEXP);
initFunctorsForIntegrations();
}
TCSCrossSectionUUThetaIntegrated::TCSCrossSectionUUThetaIntegrated(
const TCSCrossSectionUUThetaIntegrated& other) :
TCSCrossSectionUU(other), MathIntegratorModule(other), m_pFunctionToIntegrateObservableTheta(
0) {
m_thetaRange = other.m_thetaRange;
initFunctorsForIntegrations();
}
TCSCrossSectionUUThetaIntegrated::~TCSCrossSectionUUThetaIntegrated() {
if (m_pFunctionToIntegrateObservableTheta) {
delete m_pFunctionToIntegrateObservableTheta;
m_pFunctionToIntegrateObservableTheta = 0;
}
}
void TCSCrossSectionUUThetaIntegrated::initFunctorsForIntegrations() {
m_pFunctionToIntegrateObservableTheta =
NumA::Integrator1D::newIntegrationFunctor(this,
&TCSCrossSectionUUThetaIntegrated::functionToIntegrateObservableTheta);
}
TCSCrossSectionUUThetaIntegrated* TCSCrossSectionUUThetaIntegrated::clone() const {
return new TCSCrossSectionUUThetaIntegrated(*this);
}
void TCSCrossSectionUUThetaIntegrated::configure(
const ElemUtils::Parameters &parameters) {
TCSCrossSectionUU::configure(parameters);
MathIntegratorModule::configureIntegrator(parameters);
if (parameters.isAvailable(
TCSCrossSectionUUThetaIntegrated::PARAMETER_NAME_THETA_LIMIT)) {
PhysicalType<double> limit(parameters.getLastAvailable().toDouble(),
PhysicalUnit::DEG);
if (limit.getValue() < 0. || limit.getValue() > 180.) {
warn(__func__,
ElemUtils::Formatter() << "Illegal value of parameter "
<< TCSCrossSectionUUThetaIntegrated::PARAMETER_NAME_THETA_LIMIT
<< ", " << limit.toString() << ", ignored");
} else {
m_thetaRange =
std::pair<double, double>(
Constant::PI / 2.
- limit.makeSameUnitAs(PhysicalUnit::RAD).getValue(),
Constant::PI / 2.
+ limit.makeSameUnitAs(PhysicalUnit::RAD).getValue());
info(__func__,
ElemUtils::Formatter() << "Parameter "
<< TCSCrossSectionUUThetaIntegrated::PARAMETER_NAME_THETA_LIMIT
<< " changed to " << limit.toString());
}
}
}
double TCSCrossSectionUUThetaIntegrated::functionToIntegrateObservableTheta(
double x, std::vector<double> params) {
return TCSCrossSectionUU::computeObservable(
TCSObservableKinematic(m_t, m_Q2Prim, m_E, m_phi, x),
gpdTypesFromVector(params)).getValue();
}
PhysicalType<double> TCSCrossSectionUUThetaIntegrated::computeObservable(
const TCSObservableKinematic& kinematic, const List<GPDType>& gpdType) {
std::vector<double> params = gpdTypesToVector(gpdType);
return PhysicalType<double>(
integrate(m_pFunctionToIntegrateObservableTheta, m_thetaRange.first,
m_thetaRange.second, params), PhysicalUnit::NB);
}
const std::pair<double, double>& TCSCrossSectionUUThetaIntegrated::getThetaRange() const {
return m_thetaRange;
}
void TCSCrossSectionUUThetaIntegrated::setThetaRange(
const std::pair<double, double>& thetaRange) {
m_thetaRange = thetaRange;
}
} /* namespace PARTONS */
#include "../../../../../../include/partons/modules/observable/TCS/cross_section/TCSCrossSectionUUThetaPhiIntegrated.h"
#include <NumA/functor/one_dimension/Functor1D.h>
#include <NumA/integration/one_dimension/Integrator1D.h>
#include "../../../../../../include/partons/beans/observable/TCS/TCSObservableKinematic.h"
#include "../../../../../../include/partons/BaseObjectRegistry.h"
#include "../../../../../../include/partons/FundamentalPhysicalConstants.h"
#include "../../../../../../include/partons/modules/observable/Observable.h"
#include "../../../../../../include/partons/utils/type/PhysicalUnit.h"
namespace PARTONS {
const unsigned int TCSCrossSectionUUThetaPhiIntegrated::classId =
BaseObjectRegistry::getInstance()->registerBaseObject(
new TCSCrossSectionUUThetaPhiIntegrated(
"TCSCrossSectionUUThetaPhiIntegrated"));
TCSCrossSectionUUThetaPhiIntegrated::TCSCrossSectionUUThetaPhiIntegrated(
const std::string &className) :
TCSCrossSectionUUThetaIntegrated(className), m_pFunctionToIntegrateObservablePhi(
0) {
initFunctorsForIntegrations();
}
TCSCrossSectionUUThetaPhiIntegrated::TCSCrossSectionUUThetaPhiIntegrated(
const TCSCrossSectionUUThetaPhiIntegrated& other) :
TCSCrossSectionUUThetaIntegrated(other), m_pFunctionToIntegrateObservablePhi(
0) {
initFunctorsForIntegrations();
}
TCSCrossSectionUUThetaPhiIntegrated::~TCSCrossSectionUUThetaPhiIntegrated() {
if (m_pFunctionToIntegrateObservablePhi) {
delete m_pFunctionToIntegrateObservablePhi;
m_pFunctionToIntegrateObservablePhi = 0;
}
}
void TCSCrossSectionUUThetaPhiIntegrated::initFunctorsForIntegrations() {
TCSCrossSectionUUThetaIntegrated::initFunctorsForIntegrations();
m_pFunctionToIntegrateObservablePhi =
NumA::Integrator1D::newIntegrationFunctor(this,
&TCSCrossSectionUUThetaPhiIntegrated::functionToIntegrateObservablePhi);
}
TCSCrossSectionUUThetaPhiIntegrated* TCSCrossSectionUUThetaPhiIntegrated::clone() const {
return new TCSCrossSectionUUThetaPhiIntegrated(*this);
}
double TCSCrossSectionUUThetaPhiIntegrated::functionToIntegrateObservablePhi(
double x, std::vector<double> params) {
return TCSCrossSectionUUThetaIntegrated::computeObservable(
TCSObservableKinematic(m_t, m_Q2Prim, m_E, x, m_theta),
gpdTypesFromVector(params)).getValue();
}
PhysicalType<double> TCSCrossSectionUUThetaPhiIntegrated::computeObservable(
const TCSObservableKinematic& kinematic, const List<GPDType>& gpdType) {
std::vector<double> params = gpdTypesToVector(gpdType);
return PhysicalType<double>(
integrate(m_pFunctionToIntegrateObservablePhi, 0., 2 * Constant::PI,
params), PhysicalUnit::NB);
}
} /* namespace PARTONS */
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment