PARTONS  
PARtonic Tomography Of Nucleon Software
Public Member Functions | Static Public Attributes | Protected Member Functions | Private Member Functions | List of all members
PARTONS::GPDService Class Reference

Class to handle and compute GPD modules. More...

Inheritance diagram for PARTONS::GPDService:
PARTONS::ServiceObjectTyped< GPDKinematic, GPDResult > PARTONS::ServiceObject PARTONS::BaseObject

Public Member Functions

virtual ~GPDService ()
 Default destructor. More...
 
virtual void resolveObjectDependencies ()
 Because of the initialization step order of the program, objects are registered in a total random order and some objects depend on others. More...
 
virtual void computeTask (Task &task)
 Compute task. More...
 
GPDResult computeSingleKinematic (const GPDKinematic &gpdKinematic, GPDModule *pGPDModule, const List< GPDType > &gpdType=List< GPDType >()) const
 Computes GPD model at specific kinematics. More...
 
List< GPDResultcomputeManyKinematic (const List< GPDKinematic > &gpdKinematicList, GPDModule *pGPDModule, const List< GPDType > &gpdTypeList=List< GPDType >())
 Computes a GPD model for a list of kinematics. More...
 
GPDModulenewGPDModuleFromTask (const Task &task) const
 Devises the GPDModule from an automation task. More...
 
GPDKinematic newKinematicFromTask (const Task &task) const
 Devises the GPD kinematics from an automation task. More...
 
List< GPDKinematicnewListOfKinematicFromTask (const Task &task) const
 Devises the GPD kinematics from an automation task. More...
 
- Public Member Functions inherited from PARTONS::ServiceObjectTyped< GPDKinematic, GPDResult >
virtual ~ServiceObjectTyped ()
 Destructor. More...
 
void add (const GPDResult &result)
 Add single result to result list. More...
 
void add (const List< GPDResult > &resultList)
 Add many results to result list. More...
 
void sortResultList ()
 Sort result list. More...
 
List< GPDResult > & getResultList ()
 Get result list. More...
 
void clearResultListBuffer ()
 Clear result list. More...
 
void clearKinematicListBuffer ()
 Clear kinematic list. More...
 
List< GPDResultcomputeScenario (Scenario &scenario)
 Compute scenario. More...
 
List< GPDResultflushResultList ()
 Flush result list. More...
 
- Public Member Functions inherited from PARTONS::ServiceObject
 ServiceObject (const std::string &className)
 Default constructor. More...
 
virtual ~ServiceObject ()
 Default destructor. More...
 
void addTasks (const List< ElemUtils::Packet > &tasks)
 Add task to queue. More...
 
bool isEmptyTaskQueue ()
 Check if queue is empty. More...
 
ElemUtils::Packet popTaskFormQueue ()
 Pop task from queue. More...
 
void initComputationalThread (ModuleObject *pModuleObject)
 Initialize all threads. More...
 
void launchAllThreadAndWaitingFor ()
 Lunch all threads. More...
 
void clearAllThread ()
 Clear all threads. More...
 
std::string generateSQLQueryForPlotFile (const std::string &tableName, const ElemUtils::Parameters &selectParams, const ElemUtils::Parameters &whereParams) const
 Generate SQL query to create a plot file. More...
 
void generatePlotFile (const std::string &filePath, const std::string &sqlQuery, const char splitChar) const
 Generate a plot file. More...
 
- Public Member Functions inherited from PARTONS::BaseObject
 BaseObject (const std::string &className)
 Constructor. More...
 
virtual ~BaseObject ()
 Default destructor. More...
 
virtual BaseObjectclone () const
 Virtual clone function to allow the factory to clone all derived members object stored in the BaseObjectRegistry. More...
 
virtual std::string toString () const
 Return a pre-formatted characters string for output visualization of class member's values. More...
 
void serialize (ElemUtils::Packet &packet) const
 Used to split a complex C++ object into a concatenation of simple types. More...
 
void unserialize (ElemUtils::Packet &packet)
 Used to rebuild a complex C++ object from a concatenation of simple type. More...
 
bool operator< (const BaseObject &other) const
 Overload of < operator to sort BaseObject object by its indexId value. More...
 
const std::string & getClassName () const
 
unsigned int getObjectId () const
 
int getIndexId () const
 
void setIndexId (int indexId)
 

Static Public Attributes

static const unsigned int classId
 Unique ID to automatically register the class in the registry. More...
 
static const std::string GPD_SERVICE_COMPUTE_SINGLE_KINEMATIC
 Name of the XML task used to compute a GPD at given kinematics. More...
 
static const std::string GPD_SERVICE_COMPUTE_MANY_KINEMATIC
 Name of the XML task used to compute GPDs for a list of kinematics. More...
 
static const std::string GPD_SERVICE_GENERATE_PLOT_FILE
 Name of the XML task used for generating a data file ready for plotting. More...
 
- Static Public Attributes inherited from PARTONS::ServiceObjectTyped< GPDKinematic, GPDResult >
static const std::string SERVICE_OBJECT_PRINT_RESULTS
 Name of the XML task used to print results via Logger. More...
 

Protected Member Functions

 GPDService (const std::string &className)
 Default constructor used by the registry. More...
 
- Protected Member Functions inherited from PARTONS::ServiceObjectTyped< GPDKinematic, GPDResult >
 ServiceObjectTyped (const std::string &className)
 Default constructor. More...
 
bool computeGeneralTask (Task &task)
 General tasks. More...
 
void printResultListBuffer ()
 Print results to buffer. More...
 
void updateResultInfo (GPDResult &result, const ResultInfo &resultInfo)
 Update result info. More...
 
void updateResultInfo (List< GPDResult > &resultList, const ResultInfo &resultInfo)
 Update result info. More...
 
- Protected Member Functions inherited from PARTONS::ServiceObject
std::string generateSQLQueryForPlotFileTask (Task &task, const std::string &tableName) const
 Generate SQL query from a task. More...
 
std::string getOutputFilePathForPlotFileTask (Task &task) const
 Get path to a plot file from a task. More...
 
List< GPDTypegetGPDTypeListFromTask (Task &task) const
 Get list of GPD types to be computed from a task. More...
 
List< CollinearDistributionTypegetCollinearDistributionTypeListFromTask (Task &task) const
 Get list of Collinear Distribution types to be computed from a task. More...
 
void errorUnknownMethod (const Task &task) const
 Throw exception if unknown method. More...
 
- Protected Member Functions inherited from PARTONS::BaseObject
 BaseObject (const BaseObject &other)
 Copy constructor. More...
 
void info (const std::string &functionName, const std::string &message) const
 Print info message into logger. More...
 
void debug (const std::string &functionName, const std::string &message) const
 Print debug message into logger. More...
 
void warn (const std::string &functionName, const std::string &message) const
 Print warning message into logger. More...
 
void errorMissingParameter (const std::string &parameterName) const
 Use in automation process to throw exception when a parameter is missing from the XML scenario file. More...
 

Private Member Functions

GPDResult computeSingleKinematicTask (Task &task)
 Method used in the automated interface to compute GPD. More...
 
List< GPDResultcomputeManyKinematicTask (Task &task)
 Method used in the automated interface to compute GPDs for a list of kinematics. More...
 
void generatePlotFileTask (Task &task)
 Method used in the automated interface to generate a data file ready for plotting. More...
 
List< GPDTypegetFinalGPDTypeList (GPDModule *pGPDModule, const List< GPDType > &gpdTypeList) const
 Method used to derive an intersection of available GPD types from the various underlying modules. More...
 

Additional Inherited Members

- Protected Attributes inherited from PARTONS::ServiceObjectTyped< GPDKinematic, GPDResult >
unsigned int m_batchSize
 Batch size. More...
 
sf::Mutex m_mutexKinematicList
 Mutex for kinematic list. More...
 
sf::Mutex m_mutexResultListBuffer
 Mutex for result list. More...
 
List< GPDKinematicm_kinematicListBuffer
 Kinematic list. More...
 
List< GPDResultm_resultListBuffer
 Result list. More...
 
ResultInfo m_resultInfo
 Result info. More...
 
- Protected Attributes inherited from PARTONS::ServiceObject
ModuleObjectFactorym_pModuleObjectFactory
 Pointer to ModuleObjectFactory. More...
 
AutomationServicem_pAutomationService
 Pointer to AutomationService. More...
 

Detailed Description

Class to handle and compute GPD modules.

Constructor & Destructor Documentation

◆ ~GPDService()

PARTONS::GPDService::~GPDService ( )
virtual

Default destructor.

◆ GPDService()

PARTONS::GPDService::GPDService ( const std::string &  className)
protected

Default constructor used by the registry.

Member Function Documentation

◆ computeManyKinematic()

List< GPDResult > PARTONS::GPDService::computeManyKinematic ( const List< GPDKinematic > &  gpdKinematicList,
GPDModule pGPDModule,
const List< GPDType > &  gpdTypeList = List<GPDType>() 
)

Computes a GPD model for a list of kinematics.

Parameters
gpdKinematicListList of GPDKinematics.
pGPDModuleGPDModule to use for the computation.
gpdTypeListList of GPDType to compute. Default: all the GPDTypes available with the GPDModule.
storeInDBBoolean to store the results and kinematics on the database. Default: false.
Returns
List of GPDResults.

◆ computeManyKinematicTask()

List< GPDResult > PARTONS::GPDService::computeManyKinematicTask ( Task task)
private

Method used in the automated interface to compute GPDs for a list of kinematics.

Parameters
taskAutomated XML task.
Returns
List of GPD results.

◆ computeSingleKinematic()

GPDResult PARTONS::GPDService::computeSingleKinematic ( const GPDKinematic gpdKinematic,
GPDModule pGPDModule,
const List< GPDType > &  gpdType = List<GPDType>() 
) const

Computes GPD model at specific kinematics.

Parameters
gpdKinematicGPD kinematic.
pGPDModuleGPDModule to use.
gpdTypeList of GPDType to compute. Default: all the GPDTypes available with the GPDModule.
Returns
GPDResult

◆ computeSingleKinematicTask()

GPDResult PARTONS::GPDService::computeSingleKinematicTask ( Task task)
private

Method used in the automated interface to compute GPD.

Parameters
taskAutomated XML task.
Returns
GPDResult object.

◆ computeTask()

void PARTONS::GPDService::computeTask ( Task task)
virtual

Compute task.

Reimplemented from PARTONS::ServiceObjectTyped< GPDKinematic, GPDResult >.

◆ generatePlotFileTask()

void PARTONS::GPDService::generatePlotFileTask ( Task task)
private

Method used in the automated interface to generate a data file ready for plotting.

Parameters
taskAutomated XML task.

◆ getFinalGPDTypeList()

List< GPDType > PARTONS::GPDService::getFinalGPDTypeList ( GPDModule pGPDModule,
const List< GPDType > &  gpdTypeList 
) const
private

Method used to derive an intersection of available GPD types from the various underlying modules.

Parameters
pGPDModuleGPDModule used for the computation.
gpdTypeListList of desired GPD types to compute.
Returns
List of GPD types.

◆ newGPDModuleFromTask()

GPDModule * PARTONS::GPDService::newGPDModuleFromTask ( const Task task) const

Devises the GPDModule from an automation task.

Parameters
taskAutomation task.
Returns
GPDModule pointer.

◆ newKinematicFromTask()

GPDKinematic PARTONS::GPDService::newKinematicFromTask ( const Task task) const

Devises the GPD kinematics from an automation task.

Parameters
taskAutomation task.
Returns
GPD kinematics.

◆ newListOfKinematicFromTask()

List< GPDKinematic > PARTONS::GPDService::newListOfKinematicFromTask ( const Task task) const

Devises the GPD kinematics from an automation task.

Parameters
taskAutomation task.
Returns
List of GPD kinematics.

◆ resolveObjectDependencies()

void PARTONS::GPDService::resolveObjectDependencies ( )
virtual

Because of the initialization step order of the program, objects are registered in a total random order and some objects depend on others.

To avoid the problem of pointer resolution order, this method is called by the BaseObjectRegistery after all objects are well registered in it. See BaseObjectRegistry class documentation for more details.

Reimplemented from PARTONS::ServiceObjectTyped< GPDKinematic, GPDResult >.

Member Data Documentation

◆ classId

const unsigned int PARTONS::GPDService::classId
static
Initial value:
=
new GPDService("GPDService"))
unsigned int registerBaseObject(BaseObject *pBaseObject)
Store a unique instance of a module identified by a unique string character key.
Definition: BaseObjectRegistry.cpp:45
GPDService(const std::string &className)
Default constructor used by the registry.
Definition: GPDService.cpp:34
static Partons * getInstance()
Share a unique pointer of this class.
Definition: Partons.cpp:27
BaseObjectRegistry * getBaseObjectRegistry() const
Definition: Partons.cpp:175

Unique ID to automatically register the class in the registry.

◆ GPD_SERVICE_COMPUTE_MANY_KINEMATIC

const std::string PARTONS::GPDService::GPD_SERVICE_COMPUTE_MANY_KINEMATIC
static
Initial value:
=
"computeManyKinematic"

Name of the XML task used to compute GPDs for a list of kinematics.

◆ GPD_SERVICE_COMPUTE_SINGLE_KINEMATIC

const std::string PARTONS::GPDService::GPD_SERVICE_COMPUTE_SINGLE_KINEMATIC
static
Initial value:
=
"computeSingleKinematic"

Name of the XML task used to compute a GPD at given kinematics.

◆ GPD_SERVICE_GENERATE_PLOT_FILE

const std::string PARTONS::GPDService::GPD_SERVICE_GENERATE_PLOT_FILE
static
Initial value:
=
"generatePlotFile"

Name of the XML task used for generating a data file ready for plotting.


The documentation for this class was generated from the following files: