Back to home page

EIC code displayed by LXR

 
 

    


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

0001 #ifndef GPD_SERVICE_H
0002 #define GPD_SERVICE_H
0003 
0004 /**
0005  * @file GPDService.h
0006  * @author Bryan BERTHOU (SPhN / CEA Saclay)
0007  * @date Aout 04, 2014
0008  * @version 1.0
0009  */
0010 
0011 #include <string>
0012 
0013 #include "../beans/gpd/GPDKinematic.h"
0014 #include "../beans/gpd/GPDResult.h"
0015 #include "../beans/gpd/GPDType.h"
0016 #include "../beans/List.h"
0017 #include "../ServiceObjectTyped.h"
0018 
0019 namespace PARTONS {
0020 class GPDModule;
0021 } /* namespace PARTONS */
0022 
0023 namespace PARTONS {
0024 
0025 /**
0026  * @class GPDService
0027  *
0028  * @brief Class to handle and compute GPD modules.
0029  */
0030 class GPDService: public ServiceObjectTyped<GPDKinematic, GPDResult> {
0031 
0032 public:
0033 
0034     static const unsigned int classId; ///< Unique ID to automatically register the class in the registry.
0035 
0036     static const std::string GPD_SERVICE_COMPUTE_SINGLE_KINEMATIC; ///< Name of the XML task used to compute a GPD at given kinematics.
0037     static const std::string GPD_SERVICE_COMPUTE_MANY_KINEMATIC; ///< Name of the XML task used to compute GPDs for a list of kinematics.
0038 
0039     /**
0040      * Default destructor.
0041      */
0042     virtual ~GPDService();
0043 
0044     virtual void resolveObjectDependencies();
0045     virtual void computeTask(Task &task);
0046 
0047     /**
0048      * Computes GPD model at specific kinematics.
0049      *
0050      * @param gpdKinematic GPD kinematic.
0051      * @param pGPDModule GPDModule to use.
0052      * @param gpdType List of GPDType to compute. Default: all the GPDTypes available with the GPDModule.
0053      * @return GPDResult
0054      */
0055     GPDResult computeSingleKinematic(const GPDKinematic &gpdKinematic,
0056             GPDModule* pGPDModule, const List<GPDType>& gpdType =
0057                     List<GPDType>()) const;
0058 
0059     /**
0060      * Computes a GPD model for a list of kinematics.
0061      *
0062      * @param gpdKinematicList List of GPDKinematics.
0063      * @param pGPDModule GPDModule to use for the computation.
0064      * @param gpdTypeList List of GPDType to compute. Default: all the GPDTypes available with the GPDModule.
0065      * @param storeInDB Boolean to store the results and kinematics on the database. Default: false.
0066      * @return List of GPDResults.
0067      */
0068     List<GPDResult> computeManyKinematic(
0069             const List<GPDKinematic> &gpdKinematicList, GPDModule* pGPDModule,
0070             const List<GPDType>& gpdTypeList = List<GPDType>());
0071 
0072     /**
0073      * Devises the GPDModule from an automation task.
0074      *
0075      * @param task Automation task.
0076      * @return GPDModule pointer.
0077      */
0078     GPDModule* newGPDModuleFromTask(const Task &task) const;
0079 
0080     /**
0081      * Devises the GPD kinematics from an automation task.
0082      *
0083      * @param task Automation task.
0084      * @return GPD kinematics.
0085      */
0086     GPDKinematic newKinematicFromTask(const Task &task) const;
0087 
0088     /**
0089      * Devises the GPD kinematics from an automation task.
0090      *
0091      * @param task Automation task.
0092      * @return List of GPD kinematics.
0093      */
0094     List<GPDKinematic> newListOfKinematicFromTask(const Task &task) const;
0095 
0096 protected:
0097 
0098     /**
0099      * Default constructor used by the registry.
0100      */
0101     GPDService(const std::string &className);
0102 
0103 private:
0104 
0105     /**
0106      * Method used in the automated interface to compute GPD.
0107      * @param task Automated XML task.
0108      * @return GPDResult object.
0109      */
0110     GPDResult computeSingleKinematicTask(Task &task);
0111 
0112     /**
0113      * Method used in the automated interface to compute GPDs for a list of kinematics.
0114      * @param task Automated XML task.
0115      * @return List of GPD results.
0116      */
0117     List<GPDResult> computeManyKinematicTask(Task &task);
0118 
0119     /**
0120      * Method used to derive an intersection of available GPD types from the various underlying modules.
0121      * @param pGPDModule GPDModule used for the computation.
0122      * @param gpdTypeList List of desired GPD types to compute.
0123      * @return List of GPD types.
0124      */
0125     List<GPDType> getFinalGPDTypeList(GPDModule* pGPDModule,
0126             const List<GPDType> &gpdTypeList) const;
0127 };
0128 
0129 } /* namespace PARTONS */
0130 
0131 #endif /* GPD_SERVICE_H */