Commit c84d3fd2 authored by Nabil Chouika's avatar Nabil Chouika
Browse files

Use explicit namespace everywhere partons/core/partons#29

parent 4ab922b8
...@@ -20,52 +20,51 @@ ...@@ -20,52 +20,51 @@
#include <partons/services/ObservableService.h> #include <partons/services/ObservableService.h>
#include <partons/ServiceObjectRegistry.h> #include <partons/ServiceObjectRegistry.h>
using namespace PARTONS;
void computeOneGPDModel() { void computeOneGPDModel() {
// Retrieve GPD service // Retrieve GPD service
GPDService* pGPDService = PARTONS::GPDService* pGPDService =
Partons::getInstance()->getServiceObjectRegistry()->getGPDService(); PARTONS::Partons::getInstance()->getServiceObjectRegistry()->getGPDService();
// Create GPD module with the BaseModuleFactory // Create GPD module with the BaseModuleFactory
GPDModule* pGPDModel = PARTONS::GPDModule* pGPDModel =
Partons::getInstance()->getModuleObjectFactory()->newGPDModule( PARTONS::Partons::getInstance()->getModuleObjectFactory()->newGPDModule(
GPDMMS13::classId); PARTONS::GPDMMS13::classId);
// Create a GPDKinematic(x, xi, t, MuF, MuR) to compute // Create a GPDKinematic(x, xi, t, MuF, MuR) to compute
GPDKinematic gpdKinematic(-0.99, 0.99, 0., 1., 1.); PARTONS::GPDKinematic gpdKinematic(-0.99, 0.99, 0., 1., 1.);
GPDResult gpdResult = pGPDService->computeGPDModel(gpdKinematic, pGPDModel); PARTONS::GPDResult gpdResult = pGPDService->computeGPDModel(gpdKinematic,
pGPDModel);
// Print results // Print results
Partons::getInstance()->getLoggerManager()->info("main", __func__, PARTONS::Partons::getInstance()->getLoggerManager()->info("main", __func__,
gpdResult.toString()); gpdResult.toString());
// Remove pointer reference ; Module pointers are managed by PARTONS. // Remove pointer reference ; Module pointers are managed by PARTONS.
Partons::getInstance()->getModuleObjectFactory()->updateModulePointerReference( PARTONS::Partons::getInstance()->getModuleObjectFactory()->updateModulePointerReference(
pGPDModel, 0); pGPDModel, 0);
pGPDModel = 0; pGPDModel = 0;
} }
void computeOneComptonFormFactor() { void computeOneComptonFormFactor() {
// Retrieve service // Retrieve service
ConvolCoeffFunctionService* pDVCSConvolCoeffFunctionService = PARTONS::ConvolCoeffFunctionService* pDVCSConvolCoeffFunctionService =
Partons::getInstance()->getServiceObjectRegistry()->getConvolCoeffFunctionService(); PARTONS::Partons::getInstance()->getServiceObjectRegistry()->getConvolCoeffFunctionService();
// Create GPD module with the BaseModuleFactory // Create GPD module with the BaseModuleFactory
GPDModule* pGPDModule = PARTONS::GPDModule* pGPDModule =
Partons::getInstance()->getModuleObjectFactory()->newGPDModule( PARTONS::Partons::getInstance()->getModuleObjectFactory()->newGPDModule(
GPDMMS13::classId); PARTONS::GPDMMS13::classId);
// Create CFF module with the BaseModuleFactory // Create CFF module with the BaseModuleFactory
DVCSConvolCoeffFunctionModule* pDVCSCFFModule = PARTONS::DVCSConvolCoeffFunctionModule* pDVCSCFFModule =
Partons::getInstance()->getModuleObjectFactory()->newDVCSConvolCoeffFunctionModule( PARTONS::Partons::getInstance()->getModuleObjectFactory()->newDVCSConvolCoeffFunctionModule(
DVCSCFFStandard::classId); PARTONS::DVCSCFFStandard::classId);
// Create parameters to configure later DVCSCFFModel with PerturbativeQCD = LO // Create parameters to configure later DVCSCFFModel with PerturbativeQCD = LO
ElemUtils::Parameters parameters( ElemUtils::Parameters parameters(
PerturbativeQCDOrderType::PARAMETER_NAME_PERTURBATIVE_QCD_ORDER_TYPE, PARTONS::PerturbativeQCDOrderType::PARAMETER_NAME_PERTURBATIVE_QCD_ORDER_TYPE,
PerturbativeQCDOrderType::LO); PARTONS::PerturbativeQCDOrderType::LO);
// Configure DVCSCFFModule with previous parameters. // Configure DVCSCFFModule with previous parameters.
pDVCSCFFModule->configure(parameters); pDVCSCFFModule->configure(parameters);
...@@ -74,63 +73,63 @@ void computeOneComptonFormFactor() { ...@@ -74,63 +73,63 @@ void computeOneComptonFormFactor() {
pDVCSCFFModule->setGPDModule(pGPDModule); pDVCSCFFModule->setGPDModule(pGPDModule);
// Create kinematic // Create kinematic
DVCSConvolCoeffFunctionKinematic kinematic = PARTONS::DVCSConvolCoeffFunctionKinematic kinematic =
DVCSConvolCoeffFunctionKinematic(0.0088933952793878, -0.1346, PARTONS::DVCSConvolCoeffFunctionKinematic(0.0088933952793878,
1.5557, 4., 4.); -0.1346, 1.5557, 4., 4.);
// Run computation // Run computation
DVCSConvolCoeffFunctionResult result = PARTONS::DVCSConvolCoeffFunctionResult result =
pDVCSConvolCoeffFunctionService->computeForOneCCFModel(kinematic, pDVCSConvolCoeffFunctionService->computeForOneCCFModel(kinematic,
pDVCSCFFModule); pDVCSCFFModule);
// Print results for DVCSCFFModule // Print results for DVCSCFFModule
Partons::getInstance()->getLoggerManager()->info("main", __func__, PARTONS::Partons::getInstance()->getLoggerManager()->info("main", __func__,
result.toString()); result.toString());
// Remove DVCSCFFModule pointer reference // Remove DVCSCFFModule pointer reference
Partons::getInstance()->getModuleObjectFactory()->updateModulePointerReference( PARTONS::Partons::getInstance()->getModuleObjectFactory()->updateModulePointerReference(
pDVCSCFFModule, 0); pDVCSCFFModule, 0);
pDVCSCFFModule = 0; pDVCSCFFModule = 0;
// Remove GPDModule pointer reference // Remove GPDModule pointer reference
Partons::getInstance()->getModuleObjectFactory()->updateModulePointerReference( PARTONS::Partons::getInstance()->getModuleObjectFactory()->updateModulePointerReference(
pGPDModule, 0); pGPDModule, 0);
pGPDModule = 0; pGPDModule = 0;
} }
void computeOneDVCSObservableManyKinematics() { void computeOneDVCSObservableManyKinematics() {
// Retrieve Observable service // Retrieve Observable service
ObservableService* pObservableService = PARTONS::ObservableService* pObservableService =
Partons::getInstance()->getServiceObjectRegistry()->getObservableService(); PARTONS::Partons::getInstance()->getServiceObjectRegistry()->getObservableService();
// Create Observable // Create Observable
Observable* pObservable = PARTONS::Observable* pObservable =
Partons::getInstance()->getModuleObjectFactory()->newObservable( PARTONS::Partons::getInstance()->getModuleObjectFactory()->newObservable(
DVCSAluMinus::classId); PARTONS::DVCSAluMinus::classId);
// Create ProcessModule // Create ProcessModule
DVCSModule* pProcessModule = PARTONS::DVCSModule* pProcessModule =
Partons::getInstance()->getModuleObjectFactory()->newDVCSModule( PARTONS::Partons::getInstance()->getModuleObjectFactory()->newDVCSModule(
DVCSProcessGV08::classId); PARTONS::DVCSProcessGV08::classId);
// Create CFF module // Create CFF module
DVCSConvolCoeffFunctionModule* pDVCSCFFModel = PARTONS::DVCSConvolCoeffFunctionModule* pDVCSCFFModel =
Partons::getInstance()->getModuleObjectFactory()->newDVCSConvolCoeffFunctionModule( PARTONS::Partons::getInstance()->getModuleObjectFactory()->newDVCSConvolCoeffFunctionModule(
DVCSCFFStandard::classId); PARTONS::DVCSCFFStandard::classId);
// Set its PerturbativeQCDOrder // Set its PerturbativeQCDOrder
ElemUtils::Parameters dvcsConvolCoeffFunctionParameters; ElemUtils::Parameters dvcsConvolCoeffFunctionParameters;
dvcsConvolCoeffFunctionParameters.add( dvcsConvolCoeffFunctionParameters.add(
PerturbativeQCDOrderType::PARAMETER_NAME_PERTURBATIVE_QCD_ORDER_TYPE, PARTONS::PerturbativeQCDOrderType::PARAMETER_NAME_PERTURBATIVE_QCD_ORDER_TYPE,
PerturbativeQCDOrderType::NLO); PARTONS::PerturbativeQCDOrderType::NLO);
pDVCSCFFModel->configure(dvcsConvolCoeffFunctionParameters); pDVCSCFFModel->configure(dvcsConvolCoeffFunctionParameters);
// Create GPDModule // Create GPDModule
GPDModule* pGPDModule = PARTONS::GPDModule* pGPDModule =
Partons::getInstance()->getModuleObjectFactory()->newGPDModule( PARTONS::Partons::getInstance()->getModuleObjectFactory()->newGPDModule(
GPDMMS13::classId); PARTONS::GPDMMS13::classId);
// Link module to each other // Link module to each other
pObservable->setProcessModule(pProcessModule); pObservable->setProcessModule(pProcessModule);
...@@ -138,36 +137,36 @@ void computeOneDVCSObservableManyKinematics() { ...@@ -138,36 +137,36 @@ void computeOneDVCSObservableManyKinematics() {
pDVCSCFFModel->setGPDModule(pGPDModule); pDVCSCFFModel->setGPDModule(pGPDModule);
// Load list of kinematics from file // Load list of kinematics from file
List<ObservableKinematic> observableKinematicList = PARTONS::List<PARTONS::ObservableKinematic> observableKinematicList =
KinematicUtils().getObservableKinematicFromFile( PARTONS::KinematicUtils().getObservableKinematicFromFile(
"/home/debian/workspace/PARTONS_release/bin/examples/Observable_kinematics.csv"); "/home/debian/workspace/PARTONS_release/bin/examples/Observable_kinematics.csv");
// Run computation // Run computation
List<ObservableResult> results = PARTONS::List<PARTONS::ObservableResult> results =
pObservableService->computeManyKinematicOneModel( pObservableService->computeManyKinematicOneModel(
observableKinematicList, pObservable); observableKinematicList, pObservable);
// Print results // Print results
Partons::getInstance()->getLoggerManager()->info("main", __func__, PARTONS::Partons::getInstance()->getLoggerManager()->info("main", __func__,
results.toString()); results.toString());
// Remove Observable pointer reference // Remove Observable pointer reference
Partons::getInstance()->getModuleObjectFactory()->updateModulePointerReference( PARTONS::Partons::getInstance()->getModuleObjectFactory()->updateModulePointerReference(
pObservable, 0); pObservable, 0);
pObservable = 0; pObservable = 0;
// Remove ProcessModule pointer reference // Remove ProcessModule pointer reference
Partons::getInstance()->getModuleObjectFactory()->updateModulePointerReference( PARTONS::Partons::getInstance()->getModuleObjectFactory()->updateModulePointerReference(
pProcessModule, 0); pProcessModule, 0);
pProcessModule = 0; pProcessModule = 0;
// Remove DVCSCFFModel pointer reference // Remove DVCSCFFModel pointer reference
Partons::getInstance()->getModuleObjectFactory()->updateModulePointerReference( PARTONS::Partons::getInstance()->getModuleObjectFactory()->updateModulePointerReference(
pDVCSCFFModel, 0); pDVCSCFFModel, 0);
pDVCSCFFModel = 0; pDVCSCFFModel = 0;
// Remove GPDModule pointer reference // Remove GPDModule pointer reference
Partons::getInstance()->getModuleObjectFactory()->updateModulePointerReference( PARTONS::Partons::getInstance()->getModuleObjectFactory()->updateModulePointerReference(
pGPDModule, 0); pGPDModule, 0);
pGPDModule = 0; pGPDModule = 0;
} }
...@@ -7,8 +7,6 @@ ...@@ -7,8 +7,6 @@
#include <string> #include <string>
#include <vector> #include <vector>
using namespace PARTONS;
std::vector<std::string> parseArguments(int argc, char** argv) { std::vector<std::string> parseArguments(int argc, char** argv) {
if (argc <= 1) { if (argc <= 1) {
throw ElemUtils::CustomException("main", __func__, throw ElemUtils::CustomException("main", __func__,
...@@ -31,19 +29,19 @@ int main(int argc, char** argv) { ...@@ -31,19 +29,19 @@ int main(int argc, char** argv) {
argv); argv);
QCoreApplication a(argc, argv); QCoreApplication a(argc, argv);
Partons* pPartons = 0; PARTONS::Partons* pPartons = 0;
try { try {
// Init PARTONS application // Init PARTONS application
pPartons = Partons::getInstance(); pPartons = PARTONS::Partons::getInstance();
pPartons->init(argc, argv); pPartons->init(argc, argv);
// Retrieve automation service parse scenario xml file and play it. // Retrieve automation service parse scenario xml file and play it.
AutomationService* pAutomationService = PARTONS::AutomationService* pAutomationService =
pPartons->getServiceObjectRegistry()->getAutomationService(); pPartons->getServiceObjectRegistry()->getAutomationService();
for (unsigned int i = 0; i != xmlScenarioFilePathList.size(); i++) { for (unsigned int i = 0; i != xmlScenarioFilePathList.size(); i++) {
Scenario* pScenario = pAutomationService->parseXMLFile( PARTONS::Scenario* pScenario = pAutomationService->parseXMLFile(
xmlScenarioFilePathList[i]); xmlScenarioFilePathList[i]);
pAutomationService->playScenario(pScenario); pAutomationService->playScenario(pScenario);
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment