PARTONS  
PARtonic Tomography Of Nucleon Software
Public Member Functions | Static Public Attributes | Protected Member Functions | Private Member Functions | List of all members
PARTONS::ObservableService< KinematicType, ResultType > Class Template Referenceabstract

Abstract class for a service to handle and compute observables. More...

Inheritance diagram for PARTONS::ObservableService< KinematicType, ResultType >:
PARTONS::ServiceObjectTyped< KinematicType, ResultType > PARTONS::ServiceObject PARTONS::BaseObject

Public Member Functions

virtual ~ObservableService ()
 Destructor. More...
 
virtual void resolveObjectDependencies ()
 See parent class for details. More...
 
virtual void computeTask (Task &task)
 Compute task. More...
 
ResultType computeSingleKinematic (const KinematicType &observableKinematic, Observable< KinematicType, ResultType > *pObservable, const List< GPDType > &gpdTypeList=List< GPDType >()) const
 Computes an Observable at specific kinematics. More...
 
List< ResultType > computeManyKinematic (const List< KinematicType > &listOfKinematic, Observable< KinematicType, ResultType > *pObservable, const List< GPDType > &gpdTypeList=List< GPDType >())
 Computes an Observable for a list of kinematics. More...
 
virtual ProcessModule< KinematicType, ResultType > * newProcessModuleFromTask (const Task &task) const =0
 Uses an automation task (XML file) to configure a ProcessModule, e.g. a DVCSModule. More...
 
virtual Observable< KinematicType, ResultType > * newObservableModuleFromTask (const Task &task) const =0
 Uses an automation task (XML file) to configure an Observable. More...
 
virtual KinematicType newKinematicFromTask (const Task &task) const =0
 Uses an automation task (XML file) to set specific kinematics. More...
 
virtual List< KinematicTypenewListOfKinematicFromTask (const Task &task) const =0
 Uses an automation task (XML file) to set a list of kinematics. More...
 
virtual void storeResultListInDatabase (const List< ResultType > &results) const =0
 Store list of results in DB. More...
 
- Public Member Functions inherited from PARTONS::ServiceObjectTyped< KinematicType, ResultType >
virtual ~ServiceObjectTyped ()
 Destructor. More...
 
void add (const ResultType &result)
 Add single result to result list. More...
 
void add (const List< ResultType > &resultList)
 Add many results to result list. More...
 
void sortResultList ()
 Sort result list. More...
 
List< ResultType > & getResultList ()
 Get result list. More...
 
void clearResultListBuffer ()
 Clear result list. More...
 
void clearKinematicListBuffer ()
 Clear kinematic list. More...
 
List< ResultType > computeScenario (Scenario &scenario)
 Compute scenario. More...
 
List< ResultType > flushResultList ()
 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 std::string OBSERVABLE_SERVICE_COMPUTE_SINGLE_KINEMATIC
 Name of the XML task used to compute an Observable at given kinematics. More...
 
static const std::string OBSERVABLE_SERVICE_COMPUTE_MANY_KINEMATIC
 Name of the XML task used to compute an Observable for a list of kinematics. More...
 
static const std::string OBSERVABLE_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< KinematicType, ResultType >
static const std::string SERVICE_OBJECT_PRINT_RESULTS
 Name of the XML task used to print results via Logger. More...
 

Protected Member Functions

 ObservableService (const std::string &className)
 Default constructor. More...
 
- Protected Member Functions inherited from PARTONS::ServiceObjectTyped< KinematicType, ResultType >
 ServiceObjectTyped (const std::string &className)
 Default constructor. More...
 
bool computeGeneralTask (Task &task)
 General tasks. More...
 
void printResultListBuffer ()
 Print results to buffer. More...
 
void updateResultInfo (ResultType &result, const ResultInfo &resultInfo)
 Update result info. More...
 
void updateResultInfo (List< ResultType > &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

ResultType computeSingleKinematicTask (Task &task)
 Method used in the automated interface to compute an Observable. More...
 
List< ResultType > computeManyKinematicTask (Task &task)
 Method used in the automated interface to compute an Observable for a list of kinematics. More...
 
virtual void generatePlotFileTask (Task &task)=0
 Method used in the automated interface to generate a data file ready for plotting. More...
 
List< GPDTypegetFinalGPDTypeList (Observable< KinematicType, ResultType > *pObservable, 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< KinematicType, ResultType >
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< KinematicTypem_kinematicListBuffer
 Kinematic list. More...
 
List< ResultType > m_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

template<typename KinematicType, typename ResultType>
class PARTONS::ObservableService< KinematicType, ResultType >

Abstract class for a service to handle and compute observables.

Constructor & Destructor Documentation

◆ ~ObservableService()

template<typename KinematicType , typename ResultType >
virtual PARTONS::ObservableService< KinematicType, ResultType >::~ObservableService ( )
inlinevirtual

Destructor.

◆ ObservableService()

template<typename KinematicType , typename ResultType >
PARTONS::ObservableService< KinematicType, ResultType >::ObservableService ( const std::string &  className)
inlineprotected

Default constructor.

Member Function Documentation

◆ computeManyKinematic()

template<typename KinematicType , typename ResultType >
List<ResultType> PARTONS::ObservableService< KinematicType, ResultType >::computeManyKinematic ( const List< KinematicType > &  listOfKinematic,
Observable< KinematicType, ResultType > *  pObservable,
const List< GPDType > &  gpdTypeList = List<GPDType>() 
)
inline

Computes an Observable for a list of kinematics.

Parameters
listOfKinematicList of kinematics.
pObservableObservable to compute.
listOfGPDTypeList of GPDType to compute. Default: all the GPDTypes available with (both) the underlying ConvolCoeffFunctionModule (AND the underlying GPDModule, if any).
storeInDBBoolean to store the results and kinematics on the database. Default: false.
Returns
List of ObservableResult.

◆ computeManyKinematicTask()

template<typename KinematicType , typename ResultType >
List<ResultType> PARTONS::ObservableService< KinematicType, ResultType >::computeManyKinematicTask ( Task task)
inlineprivate

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

Parameters
taskAutomated XML task.
Returns
List of ObservableResult.

◆ computeSingleKinematic()

template<typename KinematicType , typename ResultType >
ResultType PARTONS::ObservableService< KinematicType, ResultType >::computeSingleKinematic ( const KinematicType observableKinematic,
Observable< KinematicType, ResultType > *  pObservable,
const List< GPDType > &  gpdTypeList = List<GPDType>() 
) const
inline

Computes an Observable at specific kinematics.

Parameters
observableKinematicKinematics.
pObservableObservable to compute.
listOfGPDTypeList of GPDType to compute. Default: all the GPDTypes available with (both) the underlying ConvolCoeffFunctionModule (AND the underlying GPDModule, if any).
Returns
ObservableResult.

◆ computeSingleKinematicTask()

template<typename KinematicType , typename ResultType >
ResultType PARTONS::ObservableService< KinematicType, ResultType >::computeSingleKinematicTask ( Task task)
inlineprivate

Method used in the automated interface to compute an Observable.

Parameters
taskAutomated XML task.
Returns
ObservableResult object.

◆ computeTask()

template<typename KinematicType , typename ResultType >
virtual void PARTONS::ObservableService< KinematicType, ResultType >::computeTask ( Task task)
inlinevirtual

◆ generatePlotFileTask()

template<typename KinematicType , typename ResultType >
virtual void PARTONS::ObservableService< KinematicType, ResultType >::generatePlotFileTask ( Task task)
privatepure virtual

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

Parameters
taskAutomated XML task.

Implemented in PARTONS::TCSObservableService, PARTONS::DVMPObservableService, PARTONS::DVCSObservableService, and PARTONS::DDVCSObservableService.

◆ getFinalGPDTypeList()

template<typename KinematicType , typename ResultType >
List<GPDType> PARTONS::ObservableService< KinematicType, ResultType >::getFinalGPDTypeList ( Observable< KinematicType, ResultType > *  pObservable,
const List< GPDType > &  gpdTypeList 
) const
inlineprivate

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

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

◆ newKinematicFromTask()

template<typename KinematicType , typename ResultType >
virtual KinematicType PARTONS::ObservableService< KinematicType, ResultType >::newKinematicFromTask ( const Task task) const
pure virtual

Uses an automation task (XML file) to set specific kinematics.

Parameters
task
Returns
Observable kinematics.

Implemented in PARTONS::TCSObservableService, PARTONS::DVMPObservableService, PARTONS::DVCSObservableService, and PARTONS::DDVCSObservableService.

◆ newListOfKinematicFromTask()

template<typename KinematicType , typename ResultType >
virtual List<KinematicType> PARTONS::ObservableService< KinematicType, ResultType >::newListOfKinematicFromTask ( const Task task) const
pure virtual

Uses an automation task (XML file) to set a list of kinematics.

Parameters
task
Returns
List of Observable kinematics.

Implemented in PARTONS::TCSObservableService, PARTONS::DVMPObservableService, PARTONS::DVCSObservableService, and PARTONS::DDVCSObservableService.

◆ newObservableModuleFromTask()

template<typename KinematicType , typename ResultType >
virtual Observable<KinematicType, ResultType>* PARTONS::ObservableService< KinematicType, ResultType >::newObservableModuleFromTask ( const Task task) const
pure virtual

Uses an automation task (XML file) to configure an Observable.

Parameters
taskAutomation task.
Returns
Pre-configured Observable.

Implemented in PARTONS::TCSObservableService, PARTONS::DVMPObservableService, PARTONS::DVCSObservableService, and PARTONS::DDVCSObservableService.

◆ newProcessModuleFromTask()

template<typename KinematicType , typename ResultType >
virtual ProcessModule<KinematicType, ResultType>* PARTONS::ObservableService< KinematicType, ResultType >::newProcessModuleFromTask ( const Task task) const
pure virtual

Uses an automation task (XML file) to configure a ProcessModule, e.g. a DVCSModule.

Parameters
taskAutomation task.
Returns
Pre-configured ProcessModule.

Implemented in PARTONS::TCSObservableService, PARTONS::DVMPObservableService, PARTONS::DVCSObservableService, and PARTONS::DDVCSObservableService.

◆ resolveObjectDependencies()

template<typename KinematicType , typename ResultType >
virtual void PARTONS::ObservableService< KinematicType, ResultType >::resolveObjectDependencies ( )
inlinevirtual

◆ storeResultListInDatabase()

template<typename KinematicType , typename ResultType >
virtual void PARTONS::ObservableService< KinematicType, ResultType >::storeResultListInDatabase ( const List< ResultType > &  results) const
pure virtual

Store list of results in DB.

Parameters
resultsList of results.
Returns
True is insertion successful.

Implemented in PARTONS::TCSObservableService, PARTONS::DVMPObservableService, PARTONS::DVCSObservableService, and PARTONS::DDVCSObservableService.

Member Data Documentation

◆ OBSERVABLE_SERVICE_COMPUTE_MANY_KINEMATIC

template<typename KinematicType , typename ResultType >
const std::string PARTONS::ObservableService< KinematicType, ResultType >::OBSERVABLE_SERVICE_COMPUTE_MANY_KINEMATIC
static
Initial value:
=
"computeManyKinematic"

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

◆ OBSERVABLE_SERVICE_COMPUTE_SINGLE_KINEMATIC

template<typename KinematicType , typename ResultType >
const std::string PARTONS::ObservableService< KinematicType, ResultType >::OBSERVABLE_SERVICE_COMPUTE_SINGLE_KINEMATIC
static
Initial value:
=
"computeSingleKinematic"

Name of the XML task used to compute an Observable at given kinematics.

◆ OBSERVABLE_SERVICE_GENERATE_PLOT_FILE

template<typename KinematicType , typename ResultType >
const std::string PARTONS::ObservableService< KinematicType, ResultType >::OBSERVABLE_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 file: