Commit f8c95515 authored by Arkadiusz P. Trawinski's avatar Arkadiusz P. Trawinski
Browse files

Loading GPDModel in MellinMomentModule as subModule.

parent 4932b8fc
...@@ -36,7 +36,7 @@ class MellinMomentFromGPD: public MellinMomentModule, public MathIntegratorModul ...@@ -36,7 +36,7 @@ class MellinMomentFromGPD: public MellinMomentModule, public MathIntegratorModul
public: public:
static const std::string MELLIN_MOMENT_MODULE_CLASS_NAME; ///< Type of the module in XML automation. static const std::string MELLIN_MOMENT_MODULE_CLASS_NAME; ///< Type of the module in XML automation.
static const std::string MELLIN_MOMENT_MODULE_GPD_TYPE; ///< Parameter used in configure() or XML automation to set the type of the GPD to compute. static const std::string MELLIN_MOMENT_MODULE_GPD_MODEL; ///< Parameter used in configure() or XML automation to set the type of the GPD to compute.
/** /**
* ID assigned by BaseObjectRegistry. * ID assigned by BaseObjectRegistry.
...@@ -50,11 +50,18 @@ public: ...@@ -50,11 +50,18 @@ public:
virtual MellinMomentFromGPD* clone() const; virtual MellinMomentFromGPD* clone() const;
void virtual configure(const ElemUtils::Parameters &parameters); virtual void configure(const ElemUtils::Parameters &parameters);
virtual void prepareSubModules(
const std::map<std::string, BaseObjectData>& subModulesData);
GPDModule* getGPDModule() const; GPDModule* getGPDModule() const;
void setGPDModule(GPDModule* pGPDModel); void setGPDModule(GPDModule* pGPDModel);
virtual List<QuarkFlavor> getListOfAvailableQuarkFlavor(MellinMomentKinematic mKinematic, const GPDType &gpdType);
virtual List<GPDType> getListOfAvailableGPDType();
protected: protected:
virtual void isModuleWellConfigured(); virtual void isModuleWellConfigured();
virtual void initModule(); virtual void initModule();
...@@ -67,8 +74,6 @@ private: ...@@ -67,8 +74,6 @@ private:
virtual double compute(MellinMomentKinematic mKinematic); virtual double compute(MellinMomentKinematic mKinematic);
double integrant(double x, std::vector<double> par); double integrant(double x, std::vector<double> par);
virtual List<QuarkFlavor> getQuarkFlavorList(MellinMomentKinematic mKinematic, const GPDType &gpdType);
} }
; ;
......
...@@ -34,7 +34,7 @@ class MellinMomentModule: public ModuleObject { ...@@ -34,7 +34,7 @@ class MellinMomentModule: public ModuleObject {
public: public:
static const std::string MELLIN_MOMENT_MODULE_CLASS_NAME; ///< Type of the module in XML automation. static const std::string MELLIN_MOMENT_MODULE_CLASS_NAME; ///< Type of the module in XML automation.
static const std::string PARAMETER_NAME_MELLIN_MODEL_MODULE_N; ///< Index of the Mellin Model in XML automation. static const std::string PARAMETER_NAME_MELLIN_MOMENT_MODULE_N; ///< Index of the Mellin Model in XML automation.
/** /**
...@@ -54,7 +54,7 @@ public: ...@@ -54,7 +54,7 @@ public:
virtual MellinMomentModule* clone() const = 0; virtual MellinMomentModule* clone() const = 0;
void configure(const ElemUtils::Parameters &parameters); virtual void configure(const ElemUtils::Parameters &parameters);
/* /*
* @param n index of Mellin Moment. * @param n index of Mellin Moment.
...@@ -83,6 +83,10 @@ public: ...@@ -83,6 +83,10 @@ public:
int getN(); int getN();
void setN(int n); void setN(int n);
virtual List<QuarkFlavor> getListOfAvailableQuarkFlavor(MellinMomentKinematic mKinematic, const GPDType &gpdType) = 0;
virtual List<GPDType> getListOfAvailableGPDType() = 0;
protected: protected:
virtual void isModuleWellConfigured(); virtual void isModuleWellConfigured();
virtual void initModule(); virtual void initModule();
...@@ -93,7 +97,7 @@ protected: ...@@ -93,7 +97,7 @@ protected:
QuarkFlavor m_flavor; ///< For witch quark flavor compute. QuarkFlavor m_flavor; ///< For witch quark flavor compute.
GPDType m_type; ///< Witch type of GPD compute. GPDType m_type; ///< Witch type of GPD compute.
virtual List<QuarkFlavor> getQuarkFlavorList(MellinMomentKinematic mKinematic, const GPDType &gpdType) = 0;
private: private:
virtual double compute(MellinMomentKinematic mKinematic) = 0; virtual double compute(MellinMomentKinematic mKinematic) = 0;
......
...@@ -98,7 +98,7 @@ public: ...@@ -98,7 +98,7 @@ public:
* @param task Automation task. * @param task Automation task.
* @return GPDModule pointer. * @return GPDModule pointer.
*/ */
GPDModule* newGPDModuleFromTask(const Task &task) const; MellinMomentModule* newMellinMomentModuleFromTask(const Task &task) const;
// GPDModule* configureGPDModule(GPDModule* pGPDModule) const; // GPDModule* configureGPDModule(GPDModule* pGPDModule) const;
...@@ -118,14 +118,14 @@ public: ...@@ -118,14 +118,14 @@ public:
List<MellinMomentKinematic> newListOfKinematicFromTask(const Task &task) const; List<MellinMomentKinematic> newListOfKinematicFromTask(const Task &task) const;
private: private:
GPDModule* m_pGPDModule; ///< Pointer to the currently used GPD module. //MellinMomentModule* m_pMellinModule; ///< Pointer to the currently used GPD module.
/** /**
* Method used in the automated interface to compute GPD. * Method used in the automated interface to compute GPD.
* @param task Automated XML task. * @param task Automated XML task.
* @return GPDResult object. * @return GPDResult object.
*/ */
MellinMomentResult computeMellinMomentTask(Task &task); MellinMomentResult computeOneKinematicTask(Task &task);
/** /**
* Method used in the automated interface to compute GPDs for a list of kinematics. * Method used in the automated interface to compute GPDs for a list of kinematics.
* @param task Automated XML task. * @param task Automated XML task.
......
...@@ -76,16 +76,16 @@ void computeSingleKinematicsForMellinMoment() { ...@@ -76,16 +76,16 @@ void computeSingleKinematicsForMellinMoment() {
formatter << pMoment->computeAll(mkinematic, PARTONS::GPDType::H).toString() << '\n'; formatter << pMoment->computeAll(mkinematic, PARTONS::GPDType::H).toString() << '\n';
// Retrieve Mellin Moment service // Retrieve Mellin Moment service
//PARTONS::MellinMomentService* pMellinService = static_cast<PARTONS::MellinMomentService*>(PARTONS::Partons::getInstance()->getServiceObjectRegistry()->get(PARTONS::MellinMomentService::classId)); PARTONS::MellinMomentService* pMellinService = static_cast<PARTONS::MellinMomentService*>(PARTONS::Partons::getInstance()->getServiceObjectRegistry()->get(PARTONS::MellinMomentService::classId));
// Run computation // Run computation
PARTONS::List<PARTONS::GPDType> gpdTypeList; PARTONS::List<PARTONS::GPDType> gpdTypeList;
//gpdTypeList.add(PARTONS::GPDType::H); gpdTypeList.add(PARTONS::GPDType::H);
gpdTypeList.add(PARTONS::GPDType::E); //gpdTypeList.add(PARTONS::GPDType::E);
gpdTypeList.add(PARTONS::GPDType::Et); //gpdTypeList.add(PARTONS::GPDType::Et);
gpdTypeList.add(PARTONS::GPDType::Ht); //gpdTypeList.add(PARTONS::GPDType::Ht);
//PARTONS::MellinMomentResult result = pMellinService->compute(mkinematic,pGPDModel,gpdTypeList); //PARTONS::MellinMomentResult result = pMellinService->compute(mkinematic,pMoment,gpdTypeList);
// Print results // Print results
//PARTONS::Partons::getInstance()->getLoggerManager()->info("main", __func__, result.toString()); //PARTONS::Partons::getInstance()->getLoggerManager()->info("main", __func__, result.toString());
......
#include "../../include/mellin_moment/MellinMomentFromGPD.h" #include "../../include/mellin_moment/MellinMomentFromGPD.h"
#include <ElementaryUtils/logger/CustomException.h>
#include <ElementaryUtils/parameters/Parameters.h> #include <ElementaryUtils/parameters/Parameters.h>
#include <ElementaryUtils/string_utils/Formatter.h> #include <ElementaryUtils/string_utils/Formatter.h>
#include <NumA/functor/one_dimension/Functor1D.h> #include <NumA/functor/one_dimension/Functor1D.h>
#include <NumA/integration/one_dimension/Integrator1D.h> #include <NumA/integration/one_dimension/Integrator1D.h>
#include <NumA/integration/one_dimension/IntegratorType1D.h> #include <NumA/integration/one_dimension/IntegratorType1D.h>
#include <partons/beans/automation/BaseObjectData.h>
#include <partons/beans/gpd/GPDKinematic.h> #include <partons/beans/gpd/GPDKinematic.h>
#include <partons/beans/parton_distribution/GluonDistribution.h> #include <partons/beans/parton_distribution/GluonDistribution.h>
#include <partons/beans/parton_distribution/PartonDistribution.h> #include <partons/beans/parton_distribution/PartonDistribution.h>
#include <partons/beans/parton_distribution/QuarkDistribution.h> #include <partons/beans/parton_distribution/QuarkDistribution.h>
#include <partons/BaseObjectRegistry.h> #include <partons/BaseObjectRegistry.h>
#include <partons/ModuleObjectFactory.h> #include <partons/ModuleObjectFactory.h>
#include <partons/Partons.h>
#include <cmath> #include <cmath>
#include <map>
#include <string> #include <string>
...@@ -23,8 +27,8 @@ const unsigned int MellinMomentFromGPD::classId = ...@@ -23,8 +27,8 @@ const unsigned int MellinMomentFromGPD::classId =
const std::string MellinMomentFromGPD::MELLIN_MOMENT_MODULE_CLASS_NAME = const std::string MellinMomentFromGPD::MELLIN_MOMENT_MODULE_CLASS_NAME =
"MellinMomentFromGPD"; "MellinMomentFromGPD";
const std::string MellinMomentFromGPD::MELLIN_MOMENT_MODULE_GPD_TYPE = const std::string MellinMomentFromGPD::MELLIN_MOMENT_MODULE_GPD_MODEL =
"GPD_MODULE_GPD_TYPE"; "GPD_MODULE_GPD_MODEL";
MellinMomentFromGPD::MellinMomentFromGPD(const std::string &className) : MellinMomentFromGPD::MellinMomentFromGPD(const std::string &className) :
MellinMomentModule(className) { MellinMomentModule(className) {
...@@ -32,19 +36,19 @@ MellinMomentFromGPD::MellinMomentFromGPD(const std::string &className) : ...@@ -32,19 +36,19 @@ MellinMomentFromGPD::MellinMomentFromGPD(const std::string &className) :
m_pint = NumA::Integrator1D::newIntegrationFunctor(this, m_pint = NumA::Integrator1D::newIntegrationFunctor(this,
&MellinMomentFromGPD::integrant); &MellinMomentFromGPD::integrant);
NumA::IntegratorType1D::Type integratorType = NumA::IntegratorType1D::DEXP; initModule();
setIntegrator(integratorType);
} }
MellinMomentFromGPD::MellinMomentFromGPD(const MellinMomentFromGPD& other) : MellinMomentFromGPD::MellinMomentFromGPD(const MellinMomentFromGPD& other) :
MellinMomentModule(other), MathIntegratorModule(other) { MellinMomentModule(other), MathIntegratorModule(other) {
m_pGPDModel = 0; m_pGPDModel = other.m_pGPDModel;
m_pint = NumA::Integrator1D::newIntegrationFunctor(this, m_pint = NumA::Integrator1D::newIntegrationFunctor(this,
&MellinMomentFromGPD::integrant); &MellinMomentFromGPD::integrant);
initModule();
} }
MellinMomentFromGPD* MellinMomentFromGPD::clone() const { MellinMomentFromGPD* MellinMomentFromGPD::clone() const {
...@@ -52,10 +56,20 @@ MellinMomentFromGPD* MellinMomentFromGPD::clone() const { ...@@ -52,10 +56,20 @@ MellinMomentFromGPD* MellinMomentFromGPD::clone() const {
} }
void MellinMomentFromGPD::isModuleWellConfigured() { void MellinMomentFromGPD::isModuleWellConfigured() {
debug(__func__, ElemUtils::Formatter() << "executed"); MellinMomentModule::isModuleWellConfigured();
if (m_pGPDModel == 0)
throw ElemUtils::CustomException(getClassName(), __func__,
ElemUtils::Formatter()
<< "GPDModule not provided.");
} }
void MellinMomentFromGPD::initModule() { void MellinMomentFromGPD::initModule() {
debug(__func__, ElemUtils::Formatter() << "executed"); MellinMomentModule::initModule();
NumA::IntegratorType1D::Type integratorType = NumA::IntegratorType1D::DEXP;
setIntegrator(integratorType);
} }
void MellinMomentFromGPD::configure(const ElemUtils::Parameters &parameters) { void MellinMomentFromGPD::configure(const ElemUtils::Parameters &parameters) {
...@@ -63,6 +77,39 @@ void MellinMomentFromGPD::configure(const ElemUtils::Parameters &parameters) { ...@@ -63,6 +77,39 @@ void MellinMomentFromGPD::configure(const ElemUtils::Parameters &parameters) {
MellinMomentModule::configure(parameters); MellinMomentModule::configure(parameters);
} }
void MellinMomentFromGPD::prepareSubModules(
const std::map<std::string, BaseObjectData>& subModulesData)
{
ModuleObject::prepareSubModules(subModulesData);
std::map<std::string, BaseObjectData>::const_iterator it;
if (m_pGPDModel != 0) setGPDModule(0);
it = subModulesData.find(
GPDModule::GPD_MODULE_CLASS_NAME);
if (it != subModulesData.end()) {
m_pGPDModel = Partons::getInstance()->getModuleObjectFactory()->newGPDModule(
(it->second).getModuleClassName());
info(__func__,
ElemUtils::Formatter() << "GPD Module is set to: "
<< m_pGPDModel->getClassName());
m_pGPDModel->configure((it->second).getParameters());
m_pGPDModel->prepareSubModules(
(it->second).getSubModules());
} else
{
throw ElemUtils::CustomException(getClassName(), __func__,
ElemUtils::Formatter()
<< "GPDModule not provided.");
}
}
double MellinMomentFromGPD::compute(MellinMomentKinematic mKinematic) ///< Compute when everything is set. double MellinMomentFromGPD::compute(MellinMomentKinematic mKinematic) ///< Compute when everything is set.
{ {
std::vector<double> parameters; std::vector<double> parameters;
...@@ -71,6 +118,8 @@ double MellinMomentFromGPD::compute(MellinMomentKinematic mKinematic) ///< Compu ...@@ -71,6 +118,8 @@ double MellinMomentFromGPD::compute(MellinMomentKinematic mKinematic) ///< Compu
parameters.push_back(mKinematic.getMuF2()); parameters.push_back(mKinematic.getMuF2());
parameters.push_back(mKinematic.getMuR2()); parameters.push_back(mKinematic.getMuR2());
isModuleWellConfigured();
return integrate(m_pint, -1.0, 1.0, parameters); return integrate(m_pint, -1.0, 1.0, parameters);
} }
...@@ -91,24 +140,26 @@ double MellinMomentFromGPD::integrant(double x, std::vector<double> par) ///< In ...@@ -91,24 +140,26 @@ double MellinMomentFromGPD::integrant(double x, std::vector<double> par) ///< In
} }
} }
List<QuarkFlavor> MellinMomentFromGPD::getQuarkFlavorList( List<QuarkFlavor> MellinMomentFromGPD::getListOfAvailableQuarkFlavor(
MellinMomentKinematic mKinematic, const GPDType &gpdType) { MellinMomentKinematic mKinematic, const GPDType &gpdType) {
List<QuarkFlavor> result; List<QuarkFlavor> result;
List<GPDType> gpdTypeList = List<GPDType> gpdTypeList = getListOfAvailableGPDType();
m_pGPDModel->getListOfAvailableGPDTypeForComputation();
bool isGPDType = false; bool isGPDType = false;
for (unsigned int i = 0; i != gpdTypeList.size(); i++) { for (unsigned int i = 0; i != gpdTypeList.size(); i++) {
if (gpdTypeList[i].getType() == gpdType.getType()) if (gpdTypeList[i].getType() == gpdType.getType())
isGPDType = true; isGPDType = true;
} }
if (isGPDType) { if (isGPDType) {
GPDKinematic kinematic(1, mKinematic.getXi, mKinematic.getT, GPDKinematic kinematic(1., mKinematic.getXi(), mKinematic.getT(),
mKinematic.getMuF2, mKinematic.getMuR2); mKinematic.getMuF2(), mKinematic.getMuR2());
List<QuarkDistribution> list = List<QuarkDistribution> list =
m_pGPDModel->compute(kinematic, gpdType).getListOfQuarkDistribution(); m_pGPDModel->compute(kinematic, gpdType).getListOfQuarkDistribution();
for (unsigned int i = 0; i != list.size(); i++) { for (unsigned int i = 0; i != list.size(); i++) {
QuarkFlavor flavor = list[i].getQuarkFlavor(); QuarkFlavor flavor = list[i].getQuarkFlavor();
result.add(flavor); result.add(flavor);
...@@ -118,6 +169,10 @@ List<QuarkFlavor> MellinMomentFromGPD::getQuarkFlavorList( ...@@ -118,6 +169,10 @@ List<QuarkFlavor> MellinMomentFromGPD::getQuarkFlavorList(
return result; return result;
} }
List<GPDType> MellinMomentFromGPD::getListOfAvailableGPDType(){
return m_pGPDModel -> getListOfAvailableGPDTypeForComputation();
}
GPDModule* MellinMomentFromGPD::getGPDModule() const { GPDModule* MellinMomentFromGPD::getGPDModule() const {
return m_pGPDModel; return m_pGPDModel;
} }
...@@ -126,14 +181,6 @@ void MellinMomentFromGPD::setGPDModule(GPDModule* pGPDModel) { ...@@ -126,14 +181,6 @@ void MellinMomentFromGPD::setGPDModule(GPDModule* pGPDModel) {
m_pModuleObjectFactory->updateModulePointerReference(m_pGPDModel, m_pModuleObjectFactory->updateModulePointerReference(m_pGPDModel,
pGPDModel); pGPDModel);
m_pGPDModel = pGPDModel; m_pGPDModel = pGPDModel;
if (m_pGPDModel != 0) {
info(__func__,
ElemUtils::Formatter() << "GPD Module is set to : "
<< m_pGPDModel->getClassName());
} else {
info(__func__, "GPDModule is set to : 0");
}
} }
} /* namespace PARTONS */ } /* namespace PARTONS */
...@@ -17,12 +17,14 @@ namespace PARTONS { ...@@ -17,12 +17,14 @@ namespace PARTONS {
const std::string MellinMomentModule::MELLIN_MOMENT_MODULE_CLASS_NAME = const std::string MellinMomentModule::MELLIN_MOMENT_MODULE_CLASS_NAME =
"MellinMomentModule"; "MellinMomentModule";
const std::string MellinMomentModule::PARAMETER_NAME_MELLIN_MODEL_MODULE_N = "MELLIN_INDEX_N"; const std::string MellinMomentModule::PARAMETER_NAME_MELLIN_MOMENT_MODULE_N = "MELLIN_INDEX_N";
MellinMomentModule::MellinMomentModule(const std::string &className) : MellinMomentModule::MellinMomentModule(const std::string &className) :
ModuleObject(className) { ModuleObject(className) {
m_n = 0; m_n = 0;
m_gluon = false; m_gluon = false;
initModule();
} }
MellinMomentModule::MellinMomentModule(const MellinMomentModule& other) : MellinMomentModule::MellinMomentModule(const MellinMomentModule& other) :
...@@ -33,6 +35,8 @@ MellinMomentModule::MellinMomentModule(const MellinMomentModule& other) : ...@@ -33,6 +35,8 @@ MellinMomentModule::MellinMomentModule(const MellinMomentModule& other) :
m_flavor = other.m_flavor; m_flavor = other.m_flavor;
m_type = other.m_type; m_type = other.m_type;
initModule();
} }
MellinMomentModule::~MellinMomentModule(){ MellinMomentModule::~MellinMomentModule(){
...@@ -48,12 +52,12 @@ void MellinMomentModule::initModule() { ...@@ -48,12 +52,12 @@ void MellinMomentModule::initModule() {
void MellinMomentModule::configure(const ElemUtils::Parameters &parameters) { void MellinMomentModule::configure(const ElemUtils::Parameters &parameters) {
if (parameters.isAvailable(MellinMomentModule::PARAMETER_NAME_MELLIN_MODEL_MODULE_N)) { if (parameters.isAvailable(MellinMomentModule::PARAMETER_NAME_MELLIN_MOMENT_MODULE_N)) {
m_n = parameters.getLastAvailable().toDouble(); m_n = parameters.getLastAvailable().toDouble();
info(__func__, info(__func__,
ElemUtils::Formatter() << "Parameter " ElemUtils::Formatter() << "Parameter "
<< MellinMomentModule::PARAMETER_NAME_MELLIN_MODEL_MODULE_N << " changed to " << MellinMomentModule::PARAMETER_NAME_MELLIN_MOMENT_MODULE_N << " changed to "
<< m_n); << m_n);
} }
} }
...@@ -64,7 +68,7 @@ PartonValues MellinMomentModule::computeAll(MellinMomentKinematic mKinematic, GP ...@@ -64,7 +68,7 @@ PartonValues MellinMomentModule::computeAll(MellinMomentKinematic mKinematic, GP
GluonValue gluon = computeGluonValue(mKinematic,mGPDtype); GluonValue gluon = computeGluonValue(mKinematic,mGPDtype);
result.setGluonValue(gluon); result.setGluonValue(gluon);
List<QuarkFlavor> flavorList = getQuarkFlavorList(mKinematic, mGPDtype); List<QuarkFlavor> flavorList = getListOfAvailableQuarkFlavor(mKinematic, mGPDtype);
for (unsigned int i = 0; i != flavorList.size(); i++) { for (unsigned int i = 0; i != flavorList.size(); i++) {
result.addQuarkValue(computeQuarkValue(mKinematic, mGPDtype, result.addQuarkValue(computeQuarkValue(mKinematic, mGPDtype,
......
...@@ -35,8 +35,7 @@ const unsigned int MellinMomentService::classId = ...@@ -35,8 +35,7 @@ const unsigned int MellinMomentService::classId =
new MellinMomentService("MellinMomentService")); new MellinMomentService("MellinMomentService"));
MellinMomentService::MellinMomentService(const std::string &className) : MellinMomentService::MellinMomentService(const std::string &className) :
ServiceObjectTyped<MellinMomentKinematic, MellinMomentResult>( ServiceObjectTyped<MellinMomentKinematic, MellinMomentResult>(className) {
className), m_pGPDModule(0) {
} }
MellinMomentService::~MellinMomentService() { MellinMomentService::~MellinMomentService() {
...@@ -58,7 +57,7 @@ MellinMomentResult MellinMomentService::compute(const MellinMomentKinematic &kin ...@@ -58,7 +57,7 @@ MellinMomentResult MellinMomentService::compute(const MellinMomentKinematic &kin
MellinMomentResult result; MellinMomentResult result;
List<GPDType> restrictedByGPDTypeListFinal; // = getFinalGPDTypeList(pGPDModule,gpdTypeList); List<GPDType> restrictedByGPDTypeListFinal = getFinalGPDTypeList(pMellinMoment,gpdTypeList);
for (unsigned int i = 0; i != restrictedByGPDTypeListFinal.size(); i++) { for (unsigned int i = 0; i != restrictedByGPDTypeListFinal.size(); i++) {
PartonValues values = pMellinMoment->computeAll(kinematic, restrictedByGPDTypeListFinal[i]); PartonValues values = pMellinMoment->computeAll(kinematic, restrictedByGPDTypeListFinal[i]);
...@@ -68,12 +67,6 @@ MellinMomentResult MellinMomentService::compute(const MellinMomentKinematic &kin ...@@ -68,12 +67,6 @@ MellinMomentResult MellinMomentService::compute(const MellinMomentKinematic &kin
result.setKinematic(kinematic); result.setKinematic(kinematic);
result.setComputationModuleName(pMellinMoment->getClassName()); result.setComputationModuleName(pMellinMoment->getClassName());
// Remove pointer references
// Module pointers are managed by PARTONS
PARTONS::Partons::getInstance()->getModuleObjectFactory()->updateModulePointerReference(
pMellinMoment, 0);
pMellinMoment = 0;
return result; return result;
} }
...@@ -91,7 +84,7 @@ List<MellinMomentResult> MellinMomentService::computeManyKinematic( ...@@ -91,7 +84,7 @@ List<MellinMomentResult> MellinMomentService::computeManyKinematic(
List<MellinMomentResult> results; List<MellinMomentResult> results;
List<ElemUtils::Packet> listOfPacket; List<ElemUtils::Packet> listOfPacket;
List<GPDType> finalGPDTypeList;// = getFinalGPDTypeList(pGPDModule,gpdTypeList); List<GPDType> finalGPDTypeList = getFinalGPDTypeList(pMellinModule,gpdTypeList);
if (finalGPDTypeList.size() == 0) { if (finalGPDTypeList.size() == 0) {
info(__func__, info(__func__,
...@@ -153,10 +146,45 @@ List<MellinMomentResult> MellinMomentService::computeManyKinematic( ...@@ -153,10 +146,45 @@ List<MellinMomentResult> MellinMomentService::computeManyKinematic(
return results; return results;
} }
MellinMomentResult MellinMomentService::computeMellinMomentTask(Task& task) { void MellinMomentService::computeTask(Task &task) {
debug(__func__, "Processing ...");
ServiceObjectTyped<MellinMomentKinematic, MellinMomentResult>::computeTask(task);
List<MellinMomentResult> resultList;
if (ElemUtils::StringUtils::equals(task.getFunctionName(),
MellinMomentService::MELLIN_MOMENT_SERVICE_COMPUTE_MANY_KINEMATIC)) {
resultList.add(computeManyKinematicTask(task));
} else {
if (ElemUtils::StringUtils::equals(task.getFunctionName(),
MellinMomentService::MELLIN_MOMENT_SERVICE_COMPUTE_ONE_KINEMATIC)) {
resultList.add(computeOneKinematicTask(task));
} else if (ElemUtils::StringUtils::equals(task.getFunctionName(),
MellinMomentService::FUNCTION_NAME_GENERATE_PLOT_FILE)) {
generatePlotFileTask(task);
} else if (!ServiceObjectTyped<MellinMomentKinematic, MellinMomentResult>::computeGeneralTask(
task)) {
errorUnknownMethod(task);
}
updateResultInfo(resultList, m_resultInfo);
if (task.isStoreInDB()) {
//TODO implemented connection with Data Base
//GPDResultDaoService gpdResultDaoService;
//gpdResultDaoService.insert(resultList);
}
}
m_resultListBuffer = resultList;
}