Back to home page

EIC code displayed by LXR

 
 

    


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

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