Back to home page

EIC code displayed by LXR

 
 

    


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

0001 #ifndef DDVCS_OBSERVABLE_KINEMATIC_H
0002 #define DDVCS_OBSERVABLE_KINEMATIC_H
0003 
0004 /**
0005  * @file DDVCSObservableKinematic.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 DDVCSObservableKinematic
0024  *
0025  * @brief Class representing single observable kinematics for DDVCS process.
0026  *
0027  * This class represents a single observable kinematics for DDVCS process (x_{B}, t, \f$Q^{2}\f$, \f$Q^{'2}\f$, E_{b}, \f$\phi\f$, \f$\theta\f$).
0028  */
0029 class DDVCSObservableKinematic: public ObservableKinematic {
0030 
0031 public:
0032 
0033     static const std::string DDVCS_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$Q^{2}'\f$ via configuration methods.
0047      */
0048     static const std::string KINEMATIC_PARAMETER_NAME_Q2PRIM;
0049 
0050     /**
0051      * Parameter name to set variable \f$E_{b}\f$ via configuration methods.
0052      */
0053     static const std::string KINEMATIC_PARAMETER_NAME_BEAM_ENERGY;
0054 
0055     /**
0056      * Parameter name to set variable \f$\phi\f$ via configuration methods.
0057      */
0058     static const std::string KINEMATIC_PARAMETER_NAME_PHI;
0059 
0060     /**
0061      * Parameter name to set variable \f$\phi_{l}\f$ via configuration methods.
0062      */
0063     static const std::string KINEMATIC_PARAMETER_NAME_PHIL;
0064 
0065     /**
0066      * Parameter name to set variable \f$\theta_{l}\f$ via configuration methods.
0067      */
0068     static const std::string KINEMATIC_PARAMETER_NAME_THETAL;
0069 
0070     /**
0071      * Parameter name to set unit of variable \f$x_{B}\f$ via configuration methods.
0072      */
0073     static const std::string KINEMATIC_PARAMETER_NAME_XB_UNIT;
0074 
0075     /**
0076      * Parameter name to set unit of variable \f$Q^{2}\f$ via configuration methods.
0077      */
0078     static const std::string KINEMATIC_PARAMETER_NAME_Q2_UNIT;
0079 
0080     /**
0081      * Parameter name to set unit of variable \f$Q^{2}'\f$ via configuration methods.
0082      */
0083     static const std::string KINEMATIC_PARAMETER_NAME_Q2PRIM_UNIT;
0084 
0085     /**
0086      * Parameter name to set unit of variable \f$E_{b}\f$ via configuration methods.
0087      */
0088     static const std::string KINEMATIC_PARAMETER_NAME_BEAM_ENERGY_UNIT;
0089 
0090     /**
0091      * Parameter name to set unit of variable \f$\phi\f$ via configuration methods.
0092      */
0093     static const std::string KINEMATIC_PARAMETER_NAME_PHI_UNIT;
0094 
0095     /**
0096      * Parameter name to set unit of variable \f$\phi_{l}\f$ via configuration methods.
0097      */
0098     static const std::string KINEMATIC_PARAMETER_NAME_PHIL_UNIT;
0099 
0100     /**
0101      * Parameter name to set unit of variable \f$\theta_{l}\f$ via configuration methods.
0102      */
0103     static const std::string KINEMATIC_PARAMETER_NAME_THETAL_UNIT;
0104 
0105     /**
0106      * Default constructor.
0107      */
0108     DDVCSObservableKinematic();
0109 
0110     /**
0111      * Assignment constructor.
0112      * @param xB Bjorken variable.
0113      * @param t Four-momentum transfer squared of hadron target (in \f$GeV^{2}\f$).
0114      * @param Q2 Virtual-photon virtuality (in \f$GeV^{2}\f$).
0115      * @param Q2Prim Outgoing virtual-photon virtuality (in \f$GeV^{2}\f$).
0116      * @param E Beam energy (in GeV).
0117      * @param phi Angle between leptonic and hadronic planes (in radians, Trento convention).
0118      * @param phiL Azimuthal angle of the lepton pair (in radians).
0119      * @param thetaL Polar angle of the lepton pair (in radians).
0120      */
0121     DDVCSObservableKinematic(double xB, double t, double Q2, double Q2Prim,
0122             double E, double phi, double phiL, double thetaL);
0123 
0124     /**
0125      * Assignment constructor.
0126      * @param xB Bjorken variable.
0127      * @param t Four-momentum transfer squared of hadron target (in \f$GeV^{2}\f$).
0128      * @param Q2 Virtual-photon virtuality (in \f$GeV^{2}\f$).
0129      * @param Q2Prim Outgoing virtual-photon virtuality (in \f$GeV^{2}\f$).
0130      * @param E Beam energy (in GeV).
0131      * @param phi Angle between leptonic and hadronic planes (in radians, Trento convention).
0132      * @param phiL Azimuthal angle of the lepton pair (in radians).
0133      * @param thetaL Polar angle of the lepton pair (in radians).
0134      */
0135     DDVCSObservableKinematic(const PhysicalType<double>& xB,
0136             const PhysicalType<double>& t, const PhysicalType<double>& Q2,
0137             const PhysicalType<double>& Q2Prim, const PhysicalType<double>& E,
0138             const PhysicalType<double>& phi, const PhysicalType<double>& phiL,
0139             const PhysicalType<double>& thetaL);
0140 
0141     /**
0142      * Assignment constructor.
0143      * @param xB Bjorken variable.
0144      * @param t Four-momentum transfer squared of hadron target (in \f$GeV^{2}\f$).
0145      * @param Q2 Virtual-photon virtuality (in \f$GeV^{2}\f$).
0146      * @param Q2Prim Outgoing virtual-photon virtuality (in \f$GeV^{2}\f$).
0147      * @param E Beam energy (in GeV).
0148      * @param phi Angle between leptonic and hadronic planes (in radians, Trento convention).
0149      * @param phiL Azimuthal angle of the lepton pair (in radians).
0150      * @param thetaL Polar angle of the lepton pair (in radians).
0151      */
0152     DDVCSObservableKinematic(const ElemUtils::GenericType& xB,
0153             const ElemUtils::GenericType& t, const ElemUtils::GenericType& Q2,
0154             const ElemUtils::GenericType& Q2Prim,
0155             const ElemUtils::GenericType& E, const ElemUtils::GenericType& phi,
0156             const ElemUtils::GenericType& phiL,
0157             const ElemUtils::GenericType& thetaL);
0158 
0159     /**
0160      * Copy constructor.
0161      * @param other Object to be copied.
0162      */
0163     DDVCSObservableKinematic(const DDVCSObservableKinematic &other);
0164 
0165     /**
0166      * Destructor.
0167      */
0168     virtual ~DDVCSObservableKinematic();
0169 
0170     virtual void configure(const ElemUtils::Parameters &parameters);
0171     virtual std::string toString() const;
0172 
0173     /**
0174      * Serialize into given Packet.
0175      * @param packet Target Packet.
0176      */
0177     void serialize(ElemUtils::Packet &packet) const;
0178 
0179     /**
0180      * Retrieve data from given Packet.
0181      * @param packet Input Packet.
0182      */
0183     void unserialize(ElemUtils::Packet &packet);
0184 
0185     /**
0186      * Serialize to std::vector<double>.
0187      */
0188     void serializeIntoStdVector(std::vector<double>& vec) const;
0189 
0190     /**
0191      * Unserialize from std::vector<double>.
0192      */
0193     void unserializeFromStdVector(std::vector<double>::const_iterator& it,
0194             const std::vector<double>::const_iterator& end);
0195 
0196     /**
0197      * Is equal operator. Checks if values of kinematic variables are the same.
0198      */
0199     bool operator ==(const DDVCSObservableKinematic& other) const;
0200 
0201     /**
0202      * Is different operator. Checks of values of kinematic variables are different.
0203      */
0204     bool operator !=(const DDVCSObservableKinematic& other) const;
0205 
0206     //********************************************************
0207     //*** SETTERS AND GETTERS ********************************
0208     //********************************************************
0209 
0210     /**
0211      * Get Bjorken variable.
0212      */
0213     const PhysicalType<double>& getXB() const;
0214 
0215     /**
0216      * Set Bjorken variable.
0217      */
0218     void setXB(const PhysicalType<double>& xB);
0219 
0220     /**
0221      * Set Bjorken variable.
0222      */
0223     void setXB(double xB, PhysicalUnit::Type unit = PhysicalUnit::NONE);
0224 
0225     /**
0226      * Get four-momentum transfer squared of hadron target.
0227      */
0228     const PhysicalType<double>& getT() const;
0229 
0230     /**
0231      * Set four-momentum transfer squared of hadron target.
0232      */
0233     void setT(const PhysicalType<double>& t);
0234 
0235     /**
0236      * Set four-momentum transfer squared of hadron target.
0237      */
0238     void setT(double t, PhysicalUnit::Type unit = PhysicalUnit::GEV2);
0239 
0240     /**
0241      * Get virtual-photon virtuality.
0242      */
0243     const PhysicalType<double>& getQ2() const;
0244 
0245     /**
0246      * Set virtual-photon virtuality.
0247      */
0248     void setQ2(const PhysicalType<double>& Q2);
0249 
0250     /**
0251      * Set virtual-photon virtuality.
0252      */
0253     void setQ2(double Q2, PhysicalUnit::Type unit = PhysicalUnit::GEV2);
0254 
0255     /**
0256      * Get outgoing virtual-photon virtuality.
0257      */
0258     const PhysicalType<double>& getQ2Prim() const;
0259 
0260     /**
0261      * Set outgoing virtual-photon virtuality.
0262      */
0263     void setQ2Prim(const PhysicalType<double>& Q2Prim);
0264 
0265     /**
0266      * Set outgoing virtual-photon virtuality.
0267      */
0268     void setQ2Prim(double Q2Prim, PhysicalUnit::Type unit = PhysicalUnit::GEV2);
0269 
0270     /**
0271      * Get beam energy.
0272      */
0273     const PhysicalType<double>& getE() const;
0274 
0275     /**
0276      * Set beam energy.
0277      */
0278     void setE(const PhysicalType<double>& E);
0279 
0280     /**
0281      * Set beam energy.
0282      */
0283     void setE(double E, PhysicalUnit::Type unit = PhysicalUnit::GEV);
0284 
0285     /**
0286      * Get angle between leptonic and hadronic planes (in radians).
0287      */
0288     const PhysicalType<double>& getPhi() const;
0289 
0290     /**
0291      * Set angle between leptonic and hadronic planes (in radians).
0292      */
0293     void setPhi(const PhysicalType<double>& phi);
0294 
0295     /**
0296      * Set angle between leptonic and hadronic planes (in radians).
0297      */
0298     void setPhi(double phi, PhysicalUnit::Type unit = PhysicalUnit::RAD);
0299 
0300     /**
0301      * Get azimuthal angle of the lepton pair (in radians).
0302      */
0303     const PhysicalType<double>& getPhiL() const;
0304 
0305     /**
0306      * Set azimuthal angle of the lepton pair (in radians).
0307      */
0308     void setPhiL(const PhysicalType<double>& phiL);
0309 
0310     /**
0311      * Set azimuthal angle of the lepton pair (in radians).
0312      */
0313     void setPhiL(double phiL, PhysicalUnit::Type unit = PhysicalUnit::RAD);
0314 
0315     /**
0316      * Get polar angle of the lepton pair (in radians).
0317      */
0318     const PhysicalType<double>& getThetaL() const;
0319 
0320     /**
0321      * Set polar angle of the lepton pair (in radians).
0322      */
0323     void setThetaL(const PhysicalType<double>& thetaL);
0324 
0325     /**
0326      * Set polar angle of the lepton pair (in radians).
0327      */
0328     void setThetaL(double thetaL, PhysicalUnit::Type unit = PhysicalUnit::RAD);
0329 
0330 protected:
0331 
0332     virtual void updateHashSum() const;
0333 
0334 private:
0335 
0336     /**
0337      * Bjorken variable.
0338      */
0339     PhysicalType<double> m_xB;
0340 
0341     /**
0342      * Four-momentum transfer squared of hadron target (in \f$GeV^{2}\f$).
0343      */
0344     PhysicalType<double> m_t;
0345 
0346     /**
0347      * Virtual-photon virtuality (in \f$GeV^{2}\f$).
0348      */
0349     PhysicalType<double> m_Q2;
0350 
0351     /**
0352      * Virtual-photon virtuality (in \f$GeV^{2}\f$).
0353      */
0354     PhysicalType<double> m_Q2Prim;
0355 
0356     /**
0357      * Beam energy (in GeV).
0358      */
0359     PhysicalType<double> m_E;
0360 
0361     /**
0362      * Angle between leptonic and hadronic planes (in radians, Trento convention).
0363      */
0364     PhysicalType<double> m_phi;
0365 
0366     /**
0367      * Azimuthal angle of the lepton pair (in radians).
0368      */
0369     PhysicalType<double> m_phiL;
0370 
0371     /**
0372      *  Polar angle of the lepton pair (in radians).
0373      */
0374     PhysicalType<double> m_thetaL;
0375 };
0376 
0377 /**
0378  * Stream operator to serialize class into Packet. See also GPDType::serialize().
0379  */
0380 ElemUtils::Packet& operator <<(ElemUtils::Packet& packet,
0381         DDVCSObservableKinematic& DDVCSObservableKinematic);
0382 
0383 /**
0384  * Stream operator to retrieve class from Packet. See also GPDType::unserialize().
0385  */
0386 ElemUtils::Packet& operator >>(ElemUtils::Packet& packet,
0387         DDVCSObservableKinematic& DDVCSObservableKinematic);
0388 
0389 } /* namespace PARTONS */
0390 
0391 #endif /* DDVCS_OBSERVABLE_KINEMATIC_H */