Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
partons
core
partons-example
Commits
6862a574
Commit
6862a574
authored
Mar 30, 2022
by
Pawel Sznajder
Browse files
add ANN parameters
parent
e9d101d7
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
include/gpd/xEqXi_with_pos_replicas.h
0 → 100644
View file @
6862a574
This diff is collapsed.
Click to expand it.
src/main.cpp
View file @
6862a574
#include <ElementaryUtils/logger/CustomException.h>
#include <ElementaryUtils/logger/LoggerManager.h>
#include <partons/beans/gpd/GPDKinematic.h>
#include <partons/beans/gpd/GPDType.h>
#include <partons/beans/parton_distribution/PartonDistribution.h>
#include <partons/beans/parton_distribution/QuarkDistribution.h>
#include <partons/beans/QuarkFlavor.h>
#include <partons/modules/gpd/GPDGK16.h>
#include <partons/ModuleObjectFactory.h>
#include <partons/Partons.h>
#include <partons/services/GPDService.h>
#include <partons/ServiceObjectRegistry.h>
#include <QtCore/qcoreapplication.h>
#include <stddef.h>
#include <cstdlib>
#include <iostream>
#include <vector>
#include "../include/gpd/GPDANNDD.h"
#include "../include/gpd/xEqXi_with_pos_replicas.h"
using
namespace
PARTONS
;
...
...
@@ -30,31 +41,62 @@ int main(int argc, char** argv) {
Partons
::
getInstance
()
->
getServiceObjectRegistry
()
->
getGPDService
();
// Create GPD module with the BaseModuleFactory
GPDModule
*
pGPDModel
=
GPDModule
*
pGPDModel
GK
=
Partons
::
getInstance
()
->
getModuleObjectFactory
()
->
newGPDModule
(
GPDGK16
::
classId
);
GPDModule
*
pGPDModelANN
=
Partons
::
getInstance
()
->
getModuleObjectFactory
()
->
newGPDModule
(
GPDANNDD
::
classId
);
// Create a GPDKinematic(x, xi, t, MuF2, MuR2) to compute
GPDKinematic
gpdKinematic
(
0.1
,
0.2
,
-
0.1
,
2.
,
2.
);
// Run computation
GPDResult
gpdResult
=
pGPDService
->
computeSingleKinematic
(
gpdKinematic
,
pGPDModel
);
GPDResult
gpdResult
GK
=
pGPDService
->
computeSingleKinematic
(
gpdKinematic
,
pGPDModel
GK
);
// Print results
Partons
::
getInstance
()
->
getLoggerManager
()
->
info
(
"main"
,
__func__
,
gpdResult
.
toString
());
gpdResult
GK
.
toString
());
// Print something
more
specific
// Print something specific
std
::
cout
<<
"GPD H for up quarks is: "
<<
gpdResult
.
getPartonDistribution
(
GPDType
::
H
).
getQuarkDistribution
(
<<
gpdResult
GK
.
getPartonDistribution
(
GPDType
::
H
).
getQuarkDistribution
(
QuarkFlavor
::
UP
).
getQuarkDistribution
()
<<
std
::
endl
;
// Set replica for ANN
size_t
iReplica
=
0
;
std
::
vector
<
double
>
parameters
(
c_nPar_x_eq_xi_with_pos
);
if
(
!
(
iReplica
<
c_nRep_x_eq_xi_with_pos
))
{
std
::
cout
<<
"error: "
<<
__func__
<<
": wrong replica index, "
<<
iReplica
<<
" (must be smaller than "
<<
c_nRep_x_eq_xi_with_pos
<<
")"
<<
std
::
endl
;
exit
(
0
);
}
for
(
size_t
i
=
0
;
i
<
c_nPar_x_eq_xi_with_pos
;
i
++
)
{
parameters
.
at
(
i
)
=
c_par_x_eq_xi_with_pos
[
iReplica
][
i
];
}
static_cast
<
GPDANNDD
*>
(
pGPDModelANN
)
->
setParameters
(
parameters
);
// Run computation
GPDResult
gpdResultANN
=
pGPDService
->
computeSingleKinematic
(
gpdKinematic
,
pGPDModelANN
);
// Print results
Partons
::
getInstance
()
->
getLoggerManager
()
->
info
(
"main"
,
__func__
,
gpdResultANN
.
toString
());
// Remove pointer references
// Module pointers are managed by PARTONS
Partons
::
getInstance
()
->
getModuleObjectFactory
()
->
updateModulePointerReference
(
pGPDModel
,
0
);
pGPDModel
=
0
;
pGPDModel
GK
,
0
);
pGPDModel
GK
=
0
;
}
// Appropriate catching of exceptions is crucial for working of PARTONS.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment