Back to home page

EIC code displayed by LXR

 
 

    


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

0001 #ifndef DVMP_OBSERVABLE_KINEMATIC_H
0002 #define DVMP_OBSERVABLE_KINEMATIC_H
0003 
0004 /**
0005  * @file DVMPObservableKinematic.h
0006  * @author: Bryan BERTHOU (SPhN / CEA Saclay)
0007  * @date 26 November 2014
0008  * @version 1.0
0009  */
0010 
0011 #include <ElementaryUtils/parameters/GenericType.h>
0012 #include <ElementaryUtils/parameters/Parameters.h>
0013 #include <string>
0014 #include <vector>
0015 
0016 #include "../../../utils/type/PhysicalType.h"
0017 #include "../../../utils/type/PhysicalUnit.h"
0018 #include "../../MesonType.h"
0019 #include "../ObservableKinematic.h"
0020 
0021 namespace PARTONS {
0022 
0023 /**
0024  * @class DVMPObservableKinematic
0025  *
0026  * @brief Class representing single observable kinematics for DVMP process.
0027  *
0028  * This class represents a single observable kinematics for DVMP process (x_{B}, t, \f$Q^{2}\f$, E_{b}, \f$\phi\f$, mesonType).
0029  */
0030 class DVMPObservableKinematic: public ObservableKinematic {
0031 
0032 public:
0033 
0034     static const std::string DVMP_OBSERVABLE_KNEMATIC_CLASS_NAME; ///< Type of the kinematic in XML automation.
0035 
0036     /**
0037      * Parameter name to set variable \f$x_{B}\f$ via configuration methods.
0038      */
0039     static const std::string KINEMATIC_PARAMETER_NAME_XB;
0040 
0041     /**
0042      * Parameter name to set variable \f$Q^{2}\f$ via configuration methods.
0043      */
0044     static const std::string KINEMATIC_PARAMETER_NAME_Q2;
0045 
0046     /**
0047      * Parameter name to set variable \f$E_{b}\f$ via configuration methods.
0048      */
0049     static const std::string KINEMATIC_PARAMETER_NAME_BEAM_ENERGY;
0050 
0051     /**
0052      * Parameter name to set variable \f$\phi\f$ via configuration methods.
0053      */
0054     static const std::string KINEMATIC_PARAMETER_NAME_PHI;
0055 
0056     /**
0057      * Parameter name to set meson type via configuration methods.
0058      */
0059     static const std::string KINEMATIC_PARAMETER_NAME_MESON_TYPE;
0060 
0061     /**
0062      * Parameter name to set unit of variable \f$x_{B}\f$ via configuration methods.
0063      */
0064     static const std::string KINEMATIC_PARAMETER_NAME_XB_UNIT;
0065 
0066     /**
0067      * Parameter name to set unit of variable \f$Q^{2}\f$ via configuration methods.
0068      */
0069     static const std::string KINEMATIC_PARAMETER_NAME_Q2_UNIT;
0070 
0071     /**
0072      * Parameter name to set unit of variable \f$E_{b}\f$ via configuration methods.
0073      */
0074     static const std::string KINEMATIC_PARAMETER_NAME_BEAM_ENERGY_UNIT;
0075 
0076     /**
0077      * Parameter name to set unit of variable \f$\phi\f$ via configuration methods.
0078      */
0079     static const std::string KINEMATIC_PARAMETER_NAME_PHI_UNIT;
0080 
0081     /**
0082      * Default constructor.
0083      */
0084     DVMPObservableKinematic();
0085 
0086     /**
0087      * Assignment constructor.
0088      * @param xB Bjorken variable.
0089      * @param t Four-momentum transfer squared of hadron target (in \f$GeV^{2}\f$).
0090      * @param Q2 Virtual-photon virtuality (in \f$GeV^{2}\f$).
0091      * @param E Beam energy (in GeV).
0092      * @param phi Angle between leptonic and hadronic planes (in radians, Trento convention).
0093      * @param mesonType Meson type.
0094      */
0095     DVMPObservableKinematic(double xB, double t, double Q2, double E,
0096             double phi, MesonType::Type mesonType);
0097 
0098     /**
0099      * Assignment constructor.
0100      * @param xB Bjorken variable.
0101      * @param t Four-momentum transfer squared of hadron target (in \f$GeV^{2}\f$).
0102      * @param Q2 Virtual-photon virtuality (in \f$GeV^{2}\f$).
0103      * @param E Beam energy (in GeV).
0104      * @param phi Angle between leptonic and hadronic planes (in radians, Trento convention).
0105      * @param mesonType Meson type.
0106      */
0107     DVMPObservableKinematic(const PhysicalType<double>& xB,
0108             const PhysicalType<double>& t, const PhysicalType<double>& Q2,
0109             const PhysicalType<double>& E, const PhysicalType<double>& phi,
0110             MesonType::Type mesonType);
0111 
0112     /**
0113      * Assignment constructor.
0114      * @param xB Bjorken variable.
0115      * @param t Four-momentum transfer squared of hadron target (in \f$GeV^{2}\f$).
0116      * @param Q2 Virtual-photon virtuality (in \f$GeV^{2}\f$).
0117      * @param E Beam energy (in GeV).
0118      * @param phi Angle between leptonic and hadronic planes (in radians, Trento convention).
0119      * @param mesonType Meson type.
0120      */
0121     DVMPObservableKinematic(const ElemUtils::GenericType& xB,
0122             const ElemUtils::GenericType& t, const ElemUtils::GenericType& Q2,
0123             const ElemUtils::GenericType& E, const ElemUtils::GenericType& phi,
0124             MesonType::Type mesonType);
0125 
0126     /**
0127      * Copy constructor.
0128      * @param other Object to be copied.
0129      */
0130     DVMPObservableKinematic(const DVMPObservableKinematic &other);
0131 
0132     /**
0133      * Destructor.
0134      */
0135     virtual ~DVMPObservableKinematic();
0136 
0137     virtual void configure(const ElemUtils::Parameters &parameters);
0138     virtual std::string toString() const;
0139 
0140     /**
0141      * Serialize into given Packet.
0142      * @param packet Target Packet.
0143      */
0144     void serialize(ElemUtils::Packet &packet) const;
0145 
0146     /**
0147      * Retrieve data from given Packet.
0148      * @param packet Input Packet.
0149      */
0150     void unserialize(ElemUtils::Packet &packet);
0151 
0152     /**
0153      * Serialize to std::vector<double>.
0154      */
0155     void serializeIntoStdVector(std::vector<double>& vec) const;
0156 
0157     /**
0158      * Unserialize from std::vector<double>.
0159      */
0160     void unserializeFromStdVector(std::vector<double>::const_iterator& it,
0161             const std::vector<double>::const_iterator& end);
0162 
0163     /**
0164      * Is equal operator. Checks if values of kinematic variables are the same.
0165      */
0166     bool operator ==(const DVMPObservableKinematic& other) const;
0167 
0168     /**
0169      * Is different operator. Checks of values of kinematic variables are different.
0170      */
0171     bool operator !=(const DVMPObservableKinematic& other) const;
0172 
0173     //********************************************************
0174     //*** SETTERS AND GETTERS ********************************
0175     //********************************************************
0176 
0177     /**
0178      * Get Bjorken variable.
0179      */
0180     const PhysicalType<double>& getXB() const;
0181 
0182     /**
0183      * Set Bjorken variable.
0184      */
0185     void setXB(const PhysicalType<double>& xB);
0186 
0187     /**
0188      * Set Bjorken variable.
0189      */
0190     void setXB(double xB, PhysicalUnit::Type unit = PhysicalUnit::NONE);
0191 
0192     /**
0193      * Get four-momentum transfer squared of hadron target.
0194      */
0195     const PhysicalType<double>& getT() const;
0196 
0197     /**
0198      * Set four-momentum transfer squared of hadron target.
0199      */
0200     void setT(const PhysicalType<double>& t);
0201 
0202     /**
0203      * Set four-momentum transfer squared of hadron target.
0204      */
0205     void setT(double t, PhysicalUnit::Type unit = PhysicalUnit::GEV2);
0206 
0207     /**
0208      * Get virtual-photon virtuality.
0209      */
0210     const PhysicalType<double>& getQ2() const;
0211 
0212     /**
0213      * Set virtual-photon virtuality.
0214      */
0215     void setQ2(const PhysicalType<double>& Q2);
0216 
0217     /**
0218      * Set virtual-photon virtuality.
0219      */
0220     void setQ2(double Q2, PhysicalUnit::Type unit = PhysicalUnit::GEV2);
0221 
0222     /**
0223      * Get beam energy.
0224      */
0225     const PhysicalType<double>& getE() const;
0226 
0227     /**
0228      * Set beam energy.
0229      */
0230     void setE(const PhysicalType<double>& E);
0231 
0232     /**
0233      * Set beam energy.
0234      */
0235     void setE(double E, PhysicalUnit::Type unit = PhysicalUnit::GEV);
0236 
0237     /**
0238      * Get angle between leptonic and hadronic planes (in radians).
0239      */
0240     const PhysicalType<double>& getPhi() const;
0241 
0242     /**
0243      * Set angle between leptonic and hadronic planes (in radians).
0244      */
0245     void setPhi(const PhysicalType<double>& phi);
0246 
0247     /**
0248      * Set angle between leptonic and hadronic planes (in radians).
0249      */
0250     void setPhi(double phi, PhysicalUnit::Type unit = PhysicalUnit::RAD);
0251 
0252     /**
0253      * Get meson type.
0254      */
0255     MesonType::Type getMesonType() const;
0256 
0257     /**
0258      * Set meson type.
0259      */
0260     void setMesonType(MesonType::Type mesonType);
0261 
0262 protected:
0263 
0264     virtual void updateHashSum() const;
0265 
0266 private:
0267 
0268     /**
0269      * Bjorken variable.
0270      */
0271     PhysicalType<double> m_xB;
0272 
0273     /**
0274      * Four-momentum transfer squared of hadron target (in \f$GeV^{2}\f$).
0275      */
0276     PhysicalType<double> m_t;
0277 
0278     /**
0279      * Virtual-photon virtuality (in \f$GeV^{2}\f$).
0280      */
0281     PhysicalType<double> m_Q2;
0282 
0283     /**
0284      * Beam energy (in GeV).
0285      */
0286     PhysicalType<double> m_E;
0287 
0288     /**
0289      * Angle between leptonic and hadronic planes (in radians, Trento convention).
0290      */
0291     PhysicalType<double> m_phi;
0292 
0293     /**
0294      * Meson type.
0295      */
0296     MesonType::Type m_mesonType;
0297 };
0298 
0299 /**
0300  * Stream operator to serialize class into Packet. See also GPDType::serialize().
0301  */
0302 ElemUtils::Packet& operator <<(ElemUtils::Packet& packet,
0303         DVMPObservableKinematic& DVMPObservableKinematic);
0304 
0305 /**
0306  * Stream operator to retrieve class from Packet. See also GPDType::unserialize().
0307  */
0308 ElemUtils::Packet& operator >>(ElemUtils::Packet& packet,
0309         DVMPObservableKinematic& DVMPObservableKinematic);
0310 
0311 } /* namespace PARTONS */
0312 
0313 #endif /* DVMP_OBSERVABLE_KINEMATIC_H */