Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-02 08:51:45

0001 #ifndef DDVCSCROSSSECTIONTOTAL_H
0002 #define DDVCSCROSSSECTIONTOTAL_H
0003 
0004 /**
0005  * @file DDVCSCrossSectionTotal.h
0006  * @author Pawel Sznajder (NCBJ)
0007  * @date May 17, 2020
0008  * @version 1.0
0009  */
0010 
0011 #include <ElementaryUtils/parameters/Parameters.h>
0012 #include <gsl/gsl_rng.h>
0013 #include <stddef.h>
0014 #include <string>
0015 #include <utility>
0016 
0017 #include "../../../../beans/gpd/GPDType.h"
0018 #include "../../../../beans/List.h"
0019 #include "../../../../utils/type/PhysicalType.h"
0020 #include "DDVCSCrossSectionUUMinus.h"
0021 
0022 namespace PARTONS {
0023 
0024 /**
0025  * @class DDVCSCrossSectionTotal
0026  * @brief Unpolarized cross-section for electro-production integrated over \f$xB\f$, \f$Q^{2}\f$, \f$t\f$ and angles.
0027  *
0028  * Default ranges: \f$1E-4 < xB < 0.7\f$, \f$-1 < t < 0\f$, \f$1 < Q^{2} < 1E3\f$ and \f$0 < y < 1\f$. Full integration over angles.
0029  *
0030  * Unit: \f$\mathrm{nbarn}\f$.
0031  */
0032 class DDVCSCrossSectionTotal: public DDVCSCrossSectionUUMinus {
0033 
0034 public:
0035 
0036     static const std::string DDVCS_CROSSSECTION_TOTAL_RANGEXb; ///< String used to set integration xB range via XML scenario.
0037     static const std::string DDVCS_CROSSSECTION_TOTAL_RANGET; ///< String used to set integration t range via XML scenario.
0038     static const std::string DDVCS_CROSSSECTION_TOTAL_RANGEQ2; ///< String used to set integration Q2 range via XML scenario.
0039     static const std::string DDVCS_CROSSSECTION_TOTAL_RANGEQ2PRIM; ///< String used to set integration Q2 range via XML scenario.
0040     static const std::string DDVCS_CROSSSECTION_TOTAL_RANGEPHI; ///< String used to set integration Q2 range via XML scenario.
0041     static const std::string DDVCS_CROSSSECTION_TOTAL_RANGEPHIL; ///< String used to set integration Q2 range via XML scenario.
0042     static const std::string DDVCS_CROSSSECTION_TOTAL_RANGETHETAL; ///< String used to set integration Q2 range via XML scenario.
0043 
0044     static const std::string DDVCS_CROSSSECTION_TOTAL_RANGEY; ///< String used to set integration y range via XML scenario.
0045 
0046     static const std::string DDVCS_CROSSSECTION_TOTAL_N0; ///< String used to set number of MC integration iterations per cycle via XML scenario.
0047     static const std::string DDVCS_CROSSSECTION_TOTAL_N1; ///< String used to set number of MC integration cycles via XML scenario.
0048 
0049     /**
0050      * Unique ID to automatically register the class in the registry.
0051      */
0052     static const unsigned int classId;
0053 
0054     /**
0055      * Function for the integration.
0056      */
0057     static double DDVCSCrossSectionTotalFunction(double* kin, size_t dim,
0058             void* par);
0059 
0060     /**
0061       * Function for the integration over angles.
0062       */
0063      static double DDVCSCrossSectionTotalFunctionAngle(double* kin, size_t dim,
0064              void* par);
0065 
0066     /**
0067      * Constructor.
0068      * @param className Name of class.
0069      */
0070     DDVCSCrossSectionTotal(const std::string &className);
0071 
0072     /**
0073      * Destructor.
0074      */
0075     virtual ~DDVCSCrossSectionTotal();
0076 
0077     virtual DDVCSCrossSectionTotal* clone() const;
0078     virtual void configure(const ElemUtils::Parameters &parameters);
0079 
0080     size_t getNI0() const;
0081     void setNI0(size_t nI0);
0082     size_t getNI1() const;
0083     void setNI1(size_t nI1);
0084 
0085     const std::pair<double, double>& getRangexB() const;
0086     void setRangexB(const std::pair<double, double>& rangexB);
0087     const std::pair<double, double>& getRangeT() const;
0088     void setRangeT(const std::pair<double, double>& rangeT);
0089     const std::pair<double, double>& getRangeQ2() const;
0090     void setRangeQ2(const std::pair<double, double>& rangeQ2);
0091     const std::pair<double, double>& getRangeQ2Prim() const;
0092     void setRangeQ2Prim(const std::pair<double, double>& rangeQ2Prim);
0093 
0094     const std::pair<double, double>& getRangePhi() const;
0095     void setRangePhi(const std::pair<double, double>& rangePhi);
0096     const std::pair<double, double>& getRangePhiL() const;
0097     void setRangePhiL(const std::pair<double, double>& rangePhiL);
0098     const std::pair<double, double>& getRangeThetaL() const;
0099     void setRangeThetaL(const std::pair<double, double>& rangeThetaL);
0100 
0101     const std::pair<double, double>& getRangeY() const;
0102     void setRangeY(const std::pair<double, double>& rangeY);
0103 
0104 protected:
0105 
0106     /**
0107      * Copy constructor.
0108      * @param other Object to be copied.
0109      */
0110     DDVCSCrossSectionTotal(const DDVCSCrossSectionTotal &other);
0111 
0112     virtual PhysicalType<double> computeObservable(
0113             const DDVCSObservableKinematic& kinematic,
0114             const List<GPDType>& gpdType);
0115 
0116 private:
0117 
0118     /**
0119      * Print change of ranges.
0120      */
0121     void printChangeOfRange(const std::string& func, const std::string& name,
0122             const std::pair<double, double>& oldValues,
0123             const std::pair<double, double>& newValues) const;
0124 
0125     /**
0126      * Parse range.
0127      */
0128     std::pair<double, double> parseRange(const std::string& str) const;
0129 
0130     size_t m_nI0;   ///< Number of iteration in single cycle.
0131     size_t m_nI1;   ///< Number of cycles.
0132 
0133     std::pair<double, double> m_rangexB; ///< xB integration range.
0134     std::pair<double, double> m_rangeT; ///< t integration range.
0135     std::pair<double, double> m_rangeQ2; ///< Q2 integration range.
0136     std::pair<double, double> m_rangeQ2Prim; ///< Q2 integration range.
0137 
0138     std::pair<double, double> m_rangePhi; ///< phi integration range.
0139     std::pair<double, double> m_rangePhiL; ///< phiL integration range.
0140     std::pair<double, double> m_rangeThetaL; ///< thetaL integration range.
0141 
0142     std::pair<double, double> m_rangeY; ///< y integration range.
0143 };
0144 
0145 struct DDVCSCrossSectionTotalParameters {
0146 
0147     DDVCSCrossSectionTotal* m_pDDVCSCrossSectionTotal; ///< Pointer to DDVCSCrossSectionTotal.
0148     gsl_rng* m_r; ///< Pointer to random number generator.
0149     double m_y, m_t, m_Q2, m_Q2Prim;
0150     double m_E; ///< Beam energy.
0151     List<GPDType> m_gpdType; ///< GPD types.
0152     std::pair<double, double> m_xBCut;
0153 };
0154 
0155 } /* namespace PARTONS */
0156 
0157 #endif /* DDVCSCROSSSECTIONTOTAL_H */