Back to home page

EIC code displayed by LXR

 
 

    


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

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