ECCE @ EIC Software
Reference for
ECCE @ EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
ECCE @ EIC Software
Deprecated List
Modules
Namespaces
Classes
Files
File List
acts
analysis
coresoftware
Doxygen_Assist
ecce-detectors
fun4all_eicdetectors
geant4
tree
geant4-10.6-release
config
environments
examples
source
analysis
digits_hits
error_propagation
event
externals
g3tog4
geometry
global
graphics_reps
intercoms
interfaces
materials
parameterisations
particles
persistency
physics_lists
processes
biasing
cuts
decay
electromagnetic
hadronic
cross_sections
management
models
abla
abrasion
binary_cascade
cascade
coherent_elastic
de_excitation
em_dissociation
fission
gamma_nuclear
im_r_matrix
inclxx
lend
include
src
G4GIDI.cc
G4GIDI_map.cc
G4GIDI_mass.cc
G4GIDI_Misc.cc
G4GIDI_target.cc
G4LENDCapture.cc
G4LENDCaptureCrossSection.cc
G4LENDCombinedCrossSection.cc
G4LENDCombinedModel.cc
G4LENDCrossSection.cc
G4LENDElastic.cc
G4LENDElasticCrossSection.cc
G4LENDFission.cc
G4LENDFissionCrossSection.cc
G4LENDGammaCrossSection.cc
G4LENDGammaModel.cc
G4LENDInelastic.cc
G4LENDInelasticCrossSection.cc
G4LENDManager.cc
G4LENDModel.cc
G4LENDUsedTarget.cc
GIDI_settings.cc
GIDI_settings_flux.cc
GIDI_settings_group.cc
GIDI_settings_particle.cc
lPoPs.cc
MCGIDI_angular.cc
MCGIDI_angularEnergy.cc
MCGIDI_distribution.cc
MCGIDI_energy.cc
MCGIDI_energyAngular.cc
MCGIDI_fromTOM.cc
MCGIDI_KalbachMann.cc
MCGIDI_kinetics.cc
MCGIDI_LLNLAngular_angularEnergy.cc
MCGIDI_map.cc
MCGIDI_mass.cc
MCGIDI_misc.cc
MCGIDI_outputChannel.cc
MCGIDI_particle.cc
MCGIDI_pop.cc
MCGIDI_product.cc
MCGIDI_quantitiesLookupMode.cc
MCGIDI_reaction.cc
MCGIDI_sampling.cc
MCGIDI_samplingSettings.cc
MCGIDI_target.cc
MCGIDI_target_heated.cc
MCGIDI_uncorrelated.cc
MCGIDI_version.cc
nf_angularMomentumCoupling.cc
nf_exponentialIntegral.cc
nf_gammaFunctions.cc
nf_GnG_adaptiveQuadrature.cc
nf_incompleteGammaFunctions.cc
nf_Legendre.cc
nf_Legendre_GaussianQuadrature.cc
nf_polevl.cc
nf_stringToDoubles.cc
nf_stringToDoubles_main.cc
nf_utilities.cc
PoPs.cc
PoPs_Bcast.cc
PoPs_data.cc
PoPs_mass.cc
ptwX_core.cc
ptwX_misc.cc
ptwXY_binaryOperators.cc
ptwXY_convenient.cc
ptwXY_core.cc
ptwXY_functions.cc
ptwXY_integration.cc
ptwXY_interpolation.cc
ptwXY_methods.cc
ptwXY_misc.cc
ptwXY_unitaryOperators.cc
statusMessageReporting.cc
xDataTOM.cc
xDataTOM_axes.cc
xDataTOM_importXML.cc
xDataTOM_importXML_axes.cc
xDataTOM_importXML_KalbachMann.cc
xDataTOM_importXML_polynomial.cc
xDataTOM_importXML_regionsW_XYs_LegendreSeries.cc
xDataTOM_importXML_regionsXYs.cc
xDataTOM_importXML_V_W_XYs.cc
xDataTOM_importXML_V_W_XYs_LegendreSeries.cc
xDataTOM_importXML_W_XYs.cc
xDataTOM_importXML_W_XYs_LegendreSeries.cc
xDataTOM_importXML_XYs.cc
xDataTOM_interpolation.cc
xDataTOM_KalbachMann.cc
xDataTOM_LegendreSeries.cc
xDataTOM_Misc.cc
xDataTOM_polynomial.cc
xDataTOM_regionsW_XYs_LegendreSeries.cc
xDataTOM_regionsXYs.cc
xDataTOM_V_W_XYs.cc
xDataTOM_V_W_XYs_LegendreSeries.cc
xDataTOM_W_XYs.cc
xDataTOM_W_XYs_LegendreSeries.cc
xDataTOM_XYs.cc
lepto_nuclear
management
particle_hp
parton_string
pre_equilibrium
qmd
quasi_elastic
radioactive_decay
rpg
theo_high_energy
util
processes
stopping
util
management
optical
parameterisation
scoring
solidstate
transportation
readout
run
track
tracking
visualization
macros
online_distribution
tutorials
doxygen_mainpage.h
File Members
External Links
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
xDataTOM_axes.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file xDataTOM_axes.cc
1
/*
2
# <<BEGIN-copyright>>
3
# <<END-copyright>>
4
*/
5
6
#include <string.h>
7
8
#include "
xDataTOM_private.h
"
9
10
#if defined __cplusplus
11
namespace
GIDI {
12
using namespace
GIDI;
13
#endif
14
15
static
char
const
*
xDataTOM_frame_labString
=
"lab"
;
16
static
char
const
*
xDataTOM_frame_centerOfMassString
=
"centerOfMass"
;
17
static
char
const
*
xDataTOM_frame_invalidString
=
"invalid"
;
18
/*
19
************************************************************
20
*/
21
int
xDataTOM_axes_initialize
(
statusMessageReporting
*smr,
xDataTOM_axes
*axes,
int
numberOfAxes ) {
22
23
axes->
numberOfAxes
= 0;
24
if
( ( axes->
axis
= (
xDataTOM_axis
*)
smr_malloc2
( smr, numberOfAxes *
sizeof
(
xDataTOM_axis
), 1,
"axes->axis"
) ) == NULL )
return
( 1 );
25
axes->
numberOfAxes
= numberOfAxes;
26
return
( 0 );
27
}
28
/*
29
************************************************************
30
*/
31
int
xDataTOM_axes_release
(
xDataTOM_axes
*axes ) {
32
33
int
i;
34
35
for
( i = 0; i < axes->
numberOfAxes
; i++ ) {
36
xDataTOM_axis_release
( NULL, &(axes->
axis
[i]) );
37
}
38
smr_freeMemory
( (
void
**) &(axes->
axis
) );
39
return
( 0 );
40
}
41
/*
42
************************************************************
43
*/
44
char
const
*
xDataTOM_axes_getLabel
(
statusMessageReporting
*smr,
xDataTOM_axes
*axes,
int
index ) {
45
46
if
( ( index < 0 ) || ( index >= axes->
numberOfAxes
) ) {
47
smr_setReportError2
( smr,
xDataTOM_smrLibraryID
, -1,
"invalid axes index = %d"
, index );
48
return
( NULL );
49
}
50
return
( axes->
axis
[index].
label
);
51
}
52
/*
53
************************************************************
54
*/
55
char
const
*
xDataTOM_axes_getUnit
(
statusMessageReporting
*smr,
xDataTOM_axes
*axes,
int
index ) {
56
57
if
( ( index < 0 ) || ( index >= axes->
numberOfAxes
) ) {
58
smr_setReportError2
( smr,
xDataTOM_smrLibraryID
, -1,
"invalid axes index = %d"
, index );
59
return
( NULL );
60
}
61
return
( axes->
axis
[index].
unit
);
62
}
63
/*
64
************************************************************
65
*/
66
int
xDataTOM_axes_getInterpolation
(
statusMessageReporting
*smr,
xDataTOM_axes
*axes,
int
index,
enum
xDataTOM_interpolationFlag
*independent,
67
enum
xDataTOM_interpolationFlag
*dependent,
enum
xDataTOM_interpolationQualifier
*qualifier ) {
68
69
xDataTOM_interpolation
*interpolation;
70
71
if
( ( index < 0 ) || ( index >= axes->
numberOfAxes
) ) {
72
smr_setReportError2
( smr,
xDataTOM_smrLibraryID
, -1,
"invalid axes index = %d"
, index );
73
return
( 1 );
74
}
75
interpolation = &(axes->
axis
[index].
interpolation
);
76
*independent = interpolation->independent;
77
*dependent = interpolation->
dependent
;
78
*qualifier = interpolation->
qualifier
;
79
80
return
( 0 );
81
}
82
83
/*
84
c subAxes functions.
85
*/
86
/*
87
************************************************************
88
*/
89
int
xDataTOM_subAxes_initialize
(
statusMessageReporting
*smr,
xDataTOM_subAxes
*subAxes,
enum
xDataTOM_subAxesType
type,
int
offset
,
90
xDataTOM_axes
*axes,
xDataTOM_interpolation
*interpolation ) {
91
92
subAxes->
type
= type;
93
if
( axes == NULL ) {
94
smr_setReportError2p
( smr,
xDataTOM_smrLibraryID
, -1,
"Axes must not be NULL"
);
95
return
( 1 );
96
}
97
subAxes->
offset
=
offset
;
98
if
( ( offset < 0 ) || ( offset >= axes->
numberOfAxes
) ) {
99
smr_setReportError2
( smr,
xDataTOM_smrLibraryID
, -1,
"offset = %d < 0 or >= axes->numberOfAxes = %d"
, offset, axes->
numberOfAxes
);
100
return
( 1 );
101
}
102
if
( type ==
xDataTOM_subAxesType_intepolationAxes
) {
103
if
( interpolation == NULL ) {
104
smr_setReportError2p
( smr,
xDataTOM_smrLibraryID
, -1,
"Interpolation must not be NULL for intepolationAxes"
);
105
return
( 1 );
106
}
107
if
(
xDataTOM_interpolation_copy
( smr, &(subAxes->
interpolation
), interpolation ) )
return
( 1 ); }
108
else
{
/* Not used but fill in anyway. */
109
xDataTOM_interpolation_set
( smr, &(subAxes->
interpolation
),
xDataTOM_interpolationFlag_linear
,
xDataTOM_interpolationFlag_linear
,
110
xDataTOM_interpolationQualifier_none
);
111
}
112
subAxes->
axes
= axes;
113
return
( 0 );
114
}
115
/*
116
************************************************************
117
*/
118
int
xDataTOM_subAxes_release
(
xDataTOM_subAxes
*subAxes ) {
119
120
subAxes->
axes
= NULL;
121
return
( 0 );
122
}
123
/*
124
************************************************************
125
*/
126
char
const
*
xDataTOM_subAxes_getLabel
(
statusMessageReporting
*smr,
xDataTOM_subAxes
*subAxes,
int
index ) {
127
128
return
(
xDataTOM_axes_getLabel
( smr, subAxes->
axes
, index + subAxes->
offset
) );
129
}
130
/*
131
************************************************************
132
*/
133
char
const
*
xDataTOM_subAxes_getUnit
(
statusMessageReporting
*smr,
xDataTOM_subAxes
*subAxes,
int
index ) {
134
135
return
(
xDataTOM_axes_getUnit
( smr, subAxes->
axes
, index + subAxes->
offset
) );
136
}
137
138
/*
139
c Axis functions.
140
*/
141
/*
142
************************************************************
143
*/
144
xDataTOM_axis
*
xDataTOM_axis_new
(
statusMessageReporting
*smr,
int
index,
char
const
*label,
char
const
*unit,
xDataTOM_interpolation
*interpolation ) {
145
146
xDataTOM_axis
*axis = NULL;
147
148
if
( ( axis = (
xDataTOM_axis
*)
smr_malloc2
( smr,
sizeof
(
xDataTOM_axis
), 0,
"axis"
) ) == NULL )
return
( NULL );
149
if
(
xDataTOM_axis_initialize
( smr, axis, index, label, unit, interpolation ) != 0 )
smr_freeMemory
( (
void
**) &axis );
150
return
( axis );
151
}
152
/*
153
************************************************************
154
*/
155
int
xDataTOM_axis_initialize
(
statusMessageReporting
*smr,
xDataTOM_axis
*axis,
int
index,
char
const
*label,
char
const
*unit,
xDataTOM_interpolation
*interpolation ) {
156
157
axis->
index
= index;
158
if
( ( axis->
label
=
smr_allocateCopyString2
( smr, label,
"label"
) ) == NULL )
goto
err
;
159
if
( ( axis->
unit
=
smr_allocateCopyString2
( smr, unit,
"unit"
) ) == NULL )
goto
err
;
160
if
(
xDataTOM_interpolation_copy
( smr, &(axis->
interpolation
), interpolation ) != 0 )
goto
err
;
161
162
return
( 0 );
163
164
err
:
165
smr_freeMemory
( (
void
**) &(axis->
label
) );
166
smr_freeMemory
( (
void
**) &(axis->
unit
) );
167
return
( 1 );
168
}
169
/*
170
************************************************************
171
*/
172
xDataTOM_axis
*
xDataTOM_axis_release
(
statusMessageReporting
*
/*smr*/
,
xDataTOM_axis
*axis ) {
173
174
axis->
index
= -1;
175
smr_freeMemory
( (
void
**) &(axis->
label
) );
176
smr_freeMemory
( (
void
**) &(axis->
unit
) );
177
return
( NULL );
178
}
179
/*
180
************************************************************
181
*/
182
enum
xDataTOM_frame
xDataTOM_axis_stringToFrame
(
statusMessageReporting
*
/*smr*/
,
char
const
*frame ) {
183
184
if
( strcmp(
"lab"
, frame ) == 0 )
return
(
xDataTOM_frame_lab
);
185
if
( strcmp(
"centerOfMass"
, frame ) == 0 )
return
(
xDataTOM_frame_centerOfMass
);
186
return
(
xDataTOM_frame_invalid
);
187
}
188
/*
189
************************************************************
190
*/
191
char
const
*
xDataTOM_axis_frameToString
(
statusMessageReporting
*
/*smr*/
,
enum
xDataTOM_frame
frame ) {
192
193
switch
( frame ) {
194
case
xDataTOM_frame_lab
:
return
(
xDataTOM_frame_labString
);
195
case
xDataTOM_frame_centerOfMass
:
return
(
xDataTOM_frame_centerOfMassString
);
196
default
:
197
break
;
198
}
199
return
(
xDataTOM_frame_invalidString
);
200
}
201
202
#if defined __cplusplus
203
}
204
#endif
geant4
tree
geant4-10.6-release
source
processes
hadronic
models
lend
src
xDataTOM_axes.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:25:47
using
1.8.2 with
ECCE GitHub integration