Geant4  10.00.p02
tpia_target_heated.cc
Go to the documentation of this file.
1 /*
2 # <<BEGIN-copyright>>
3 # Copyright (c) 2010, Lawrence Livermore National Security, LLC.
4 # Produced at the Lawrence Livermore National Laboratory
5 # Written by Bret R. Beck, beck6@llnl.gov.
6 # CODE-461393
7 # All rights reserved.
8 #
9 # This file is part of GIDI. For details, see nuclear.llnl.gov.
10 # Please also read the "Additional BSD Notice" at nuclear.llnl.gov.
11 #
12 # Redistribution and use in source and binary forms, with or without modification,
13 # are permitted provided that the following conditions are met:
14 #
15 # 1) Redistributions of source code must retain the above copyright notice,
16 # this list of conditions and the disclaimer below.
17 # 2) Redistributions in binary form must reproduce the above copyright notice,
18 # this list of conditions and the disclaimer (as noted below) in the
19 # documentation and/or other materials provided with the distribution.
20 # 3) Neither the name of the LLNS/LLNL nor the names of its contributors may be
21 # used to endorse or promote products derived from this software without
22 # specific prior written permission.
23 #
24 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
25 # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
26 # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
27 # SHALL LAWRENCE LIVERMORE NATIONAL SECURITY, LLC, THE U.S. DEPARTMENT OF ENERGY OR
28 # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
31 # AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
33 # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 # <<END-copyright>>
35 */
36 #include <string.h>
37 #include <tpia_target.h>
38 #include <tpia_misc.h>
39 
40 #if defined __cplusplus
41 namespace GIDI {
42 using namespace GIDI;
43 #endif
44 
45 static void _tpia_target_heated_getEnergyGridAndAllocateTotalCrossSections( statusMessageReporting *smr, tpia_target_heated *target, xData_element *element );
46 static int _tpia_target_heated_releaseAndReturnOne( statusMessageReporting *smr, xData_document *doc, tpia_target_heated *target );
47 static int _tpia_target_heated_checkElememtsForAccess( statusMessageReporting *smr, xData_document *doc );
48 static int _tpia_target_heated_checkElememtsForAccess2( statusMessageReporting *smr, xData_element *element );
49 /*
50 ************************************************************
51 */
52 tpia_target_heated *tpia_target_heated_create( statusMessageReporting *smr ) {
53 
54  tpia_target_heated *target;
55 
56  //if( ( target = xData_malloc2( smr, sizeof( tpia_target_heated ), 0, "target" ) ) == NULL ) return( NULL );
57  if( ( target = (tpia_target_heated*) xData_malloc2( smr, sizeof( tpia_target_heated ), 0, "target" ) ) == NULL ) return( NULL );
58  //if( tpia_target_heated_initialize( smr, target ) ) target = xData_free( smr, target );
59  if( tpia_target_heated_initialize( smr, target ) ) target = (tpia_target_heated*) xData_free( smr, target );
60  return( target );
61 }
62 /*
63 ************************************************************
64 */
65 //int tpia_target_heated_initialize( statusMessageReporting *smr, tpia_target_heated *target ) {
66 int tpia_target_heated_initialize( statusMessageReporting *, tpia_target_heated *target ) {
67 
68  memset( target, 0, sizeof( tpia_target_heated ) );
69  return( 0 );
70 }
71 /*
72 ************************************************************
73 */
74 tpia_target_heated *tpia_target_heated_createRead( statusMessageReporting *smr, const char *fileName, int checkElememtsForAccess ) {
75 
76  tpia_target_heated *target;
77 
78  if( ( target = tpia_target_heated_create( smr ) ) == NULL ) return( NULL );
79  //if( tpia_target_heated_read( smr, target, fileName, checkElememtsForAccess ) != 0 ) target = xData_free( smr, target );
80  if( tpia_target_heated_read( smr, target, fileName, checkElememtsForAccess ) != 0 ) target = (tpia_target_heated*) xData_free( smr, target );
81  return( target );
82 }
83 /*
84 ************************************************************
85 */
86 tpia_target_heated *tpia_target_heated_free( statusMessageReporting *smr, tpia_target_heated *target ) {
87 
88  tpia_target_heated_release( smr, target );
89  xData_free( smr, target );
90  return( NULL );
91 }
92 /*
93 ************************************************************
94 */
95 int tpia_target_heated_release( statusMessageReporting *smr, tpia_target_heated *target ) {
96 
97  int i;
98 
99  //target->path = xData_free( smr, target->path );
100  target->path = (char*) xData_free( smr, target->path );
101  //target->absPath = xData_free( smr, target->absPath );
102  target->absPath = (char*) xData_free( smr, target->absPath );
103  target->energyGridLength = 0;
104  //target->energyGrid = xData_free( smr, target->energyGrid );
105  target->energyGrid = (double*) xData_free( smr, target->energyGrid );
106  //target->kerma = xData_free( smr, target->kerma );
107  target->kerma = (double*) xData_free( smr, target->kerma );
108  //target->totalCrossSectionPointwise.data = xData_free( smr, target->totalCrossSectionPointwise.data );
109  target->totalCrossSectionPointwise.data = (double*) xData_free( smr, target->totalCrossSectionPointwise.data );
110  //target->totalCrossSectionGrouped.data = xData_free( smr, target->totalCrossSectionGrouped.data );
111  target->totalCrossSectionGrouped.data = (double*) xData_free( smr, target->totalCrossSectionGrouped.data );
112  xData_releaseAttributionList( smr, &(target->attributes) );
113  for( i = 0; i < target->nChannels; i++ ) tpia_channel_free( smr, target->channels[i] );
114  target->nChannels = 0;
115  //target->channels = xData_free( smr, target->channels );
116  target->channels = (tpia_channel**) xData_free( smr, target->channels );
117  for( i = 0; i < target->nProductionChannels; i++ ) tpia_channel_free( smr, target->productionChannels[i] );
118  target->nProductionChannels = 0;
119  //target->productionChannels = xData_free( smr, target->productionChannels );
120  target->productionChannels = (tpia_channel**) xData_free( smr, target->productionChannels );
121  return( 0 );
122 }
123 /*
124 ************************************************************
125 */
126 int tpia_target_heated_read( statusMessageReporting *smr, tpia_target_heated *target, const char *fileName, int checkElememtsForAccess ) {
127 /*
128 * If a target has already been read into this target, user must have called tpia_target_heated_release before calling this routine.
129 * Otherwise, there will be memory leaks.
130 */
131  xData_document *doc = NULL;
132  xData_element *element, *channelElement, *channels;
133  int nChannels;
134  tpia_channel *channel;
135  char *name;
136  xData_Int i, j;
137 
138  tpia_target_heated_initialize( smr, target );
139  if( ( target->path = xDataMisc_allocateCopyString2( smr, fileName, "path" ) ) == NULL ) return( 1 );
140  if( ( target->absPath = xDataMisc_getAbsPath( smr, fileName ) ) == NULL ) return( _tpia_target_heated_releaseAndReturnOne( smr, doc, target ) );
141  if( ( doc = xData_parseReadFile( smr, fileName, NULL, NULL ) ) == NULL ) return( _tpia_target_heated_releaseAndReturnOne( smr, doc, target ) );
142  element = xData_getDocumentsElement( doc );
143  xData_addToAccessed( smr, element, 1 );
144  if( xData_convertAttributeTo_xData_Int( smr, element, "nGroups", &i ) != 0 ) return( _tpia_target_heated_releaseAndReturnOne( smr, doc, target ) );
145  target->nGroups = (int) i;
146  if( strcmp( element->name, "xTargetHeated" ) != 0 ) {
147  tpia_misc_setMessageError_Element( smr, NULL, element, __FILE__, __LINE__, 1, "input file's top element must be xTargetHeated and not %s",
148  element->name ); }
149  else {
150  xData_copyAttributionList( smr, &(target->attributes), &(element->attributes) );
151  if( smr_isOk( smr ) ) target->contents = xData_getAttributesValue( &(target->attributes), "contents" );
152  if( ( name = tpia_misc_pointerToAttributeIfAllOk3( smr, target->absPath, 1, &(target->attributes), "projectile" ) ) != NULL )
153  target->projectileID = tpia_particle_getInternalID( smr, name );
154  if( ( name = tpia_misc_pointerToAttributeIfAllOk3( smr, target->absPath, 1, &(target->attributes), "target" ) ) != NULL )
155  target->targetID = tpia_particle_getInternalID( smr, name );
157  if( smr_isOk( smr ) ) { /* Get channels. */
158  //if( ( channels = xData_getOneElementByTagName( smr, element, "channels", 1 ) ) == NULL )
159  if( ( channels = xData_getOneElementByTagName( smr, element, (char*)"channels", 1 ) ) == NULL )
160  return( _tpia_target_heated_releaseAndReturnOne( smr, doc, target ) );
161  xData_addToAccessed( smr, channels, 1 );
162  if( ( nChannels = xData_numberOfElementsByTagName( smr, channels, "channel" ) ) > 0 ) {
163  //if( ( target->channels = xData_malloc2( smr, nChannels * sizeof( tpia_channel * ), 1, "channels" ) ) == NULL )
164  if( ( target->channels = (tpia_channel**) xData_malloc2( smr, nChannels * sizeof( tpia_channel * ), 1, "channels" ) ) == NULL )
165  return( _tpia_target_heated_releaseAndReturnOne( smr, doc, target ) );
166  for( channelElement = xData_getFirstElement( channels ); channelElement != NULL; channelElement = xData_getNextElement( channelElement ) ) {
167  if( !strcmp( channelElement->name, "channel" ) ) {
168  if( ( channel = tpia_channel_createGetFromElement( smr, target, channelElement, 1 ) ) == NULL ) break;
169  target->channels[target->nChannels] = channel;
170  target->nChannels++;
171  for( i = channel->crossSectionPointwise.start, j = 0; i < channel->crossSectionPointwise.end; i++, j++ )
172  target->totalCrossSectionPointwise.data[i] += channel->crossSectionPointwise.data[j];
173  for( i = channel->crossSectionGrouped.start, j = 0; i < channel->crossSectionGrouped.end; i++, j++ )
174  target->totalCrossSectionGrouped.data[i] += channel->crossSectionGrouped.data[j];
175  }
176  }
177  }
178  }
179  if( smr_isOk( smr ) ) { /* Get production channels. */
180  //if( ( channels = xData_getOneElementByTagName( smr, element, "productionChannels", 0 ) ) == NULL ) {
181  if( ( channels = xData_getOneElementByTagName( smr, element, (char*) "productionChannels", 0 ) ) == NULL ) {
182  if( !smr_isOk( smr ) ) return( _tpia_target_heated_releaseAndReturnOne( smr, doc, target ) ); }
183  else {
184  xData_addToAccessed( smr, channels, 1 );
185  if( ( nChannels = xData_numberOfElementsByTagName( smr, channels, "channel" ) ) > 0 ) {
186  //if( ( target->productionChannels = xData_malloc2( smr, nChannels * sizeof( tpia_channel * ), 1, "channels" ) ) != NULL ) {
187  if( ( target->productionChannels = (tpia_channel**) xData_malloc2( smr, nChannels * sizeof( tpia_channel * ), 1, "channels" ) ) != NULL ) {
188  for( channelElement = xData_getFirstElement(channels); channelElement != NULL; channelElement = xData_getNextElement(channelElement) ) {
189  if( !strcmp( channelElement->name, "channel" ) ) {
190  channel = tpia_channel_createGetFromElement( smr, target, channelElement, 1 );
191  if( channel == NULL ) break;
192  target->productionChannels[target->nProductionChannels] = channel;
193  target->nProductionChannels++;
194  }
195  }
196  }
197  }
198  }
199  }
200  }
201  if( smr_isOk( smr ) && checkElememtsForAccess ) _tpia_target_heated_checkElememtsForAccess( smr, doc );
202  xData_parseFree( smr, doc );
203  if( !smr_isOk( smr ) ) tpia_target_heated_release( smr, target );
204  return( !smr_isOk( smr ) );
205 }
206 /*
207 ************************************************************
208 */
209 static void _tpia_target_heated_getEnergyGridAndAllocateTotalCrossSections( statusMessageReporting *smr, tpia_target_heated *target, xData_element *element ) {
210 
211  xData_Int i, energyGridIndex, energyGridStart, energyGridEnd, energyGridLength;
212  xData_element *energyGrid, *kerma;
213 
214  if( !smr_isOk( smr ) ) return;
215  //if( ( energyGrid = xData_getOneElementByTagName( smr, element, "energyGrid", 1 ) ) == NULL ) return;
216  if( ( energyGrid = xData_getOneElementByTagName( smr, element, (char*) "energyGrid", 1 ) ) == NULL ) return;
217  xData_addToAccessed( smr, energyGrid, 1 );
218  if( ( energyGrid = xData_getElements_xDataElement( smr, energyGrid ) ) == NULL ) return;
219  xData_addToAccessed( smr, energyGrid, 1 );
220  xData_getCommonData( smr, energyGrid, &energyGridIndex, &energyGridStart, &energyGridEnd, &energyGridLength );
221  if( ( target->energyGrid = xData_1d_x_allocateCopyData( smr, energyGrid ) ) == NULL ) return;
222  target->energyGridLength = energyGridLength;
223  target->totalCrossSectionPointwise.start = 0;
224  target->totalCrossSectionPointwise.end = energyGridLength;
225  target->totalCrossSectionPointwise.length = energyGridLength;
226  //if( ( target->totalCrossSectionPointwise.data = xData_malloc2( smr, energyGridLength * sizeof( double ), 0, "totalCrossSectionPointwise" ) ) == NULL )
227  if( ( target->totalCrossSectionPointwise.data = (double*) xData_malloc2( smr, energyGridLength * sizeof( double ), 0, "totalCrossSectionPointwise" ) ) == NULL )
228  return;
229  for( i = 0; i < energyGridLength; i++ ) target->totalCrossSectionPointwise.data[i] = 0.;
230  target->totalCrossSectionGrouped.start = 0;
231  target->totalCrossSectionGrouped.end = energyGridLength;
232  target->totalCrossSectionGrouped.length = energyGridLength;
233  //if( ( target->totalCrossSectionGrouped.data = xData_malloc2( smr, target->nGroups * sizeof( double ), 0, "totalCrossSectionGrouped" ) ) == NULL ) return;
234  if( ( target->totalCrossSectionGrouped.data = (double*) xData_malloc2( smr, target->nGroups * sizeof( double ), 0, "totalCrossSectionGrouped" ) ) == NULL ) return;
235  for( i = 0; i < target->nGroups; i++ ) target->totalCrossSectionGrouped.data[i] = 0.;
236  //if( ( kerma = xData_getOneElementByTagName( smr, element, "kerma", 1 ) ) != NULL ) {
237  if( ( kerma = xData_getOneElementByTagName( smr, element, (char*) "kerma", 1 ) ) != NULL ) {
238  xData_addToAccessed( smr, kerma, 1 );
239  if( ( kerma = xData_getElements_xDataElement( smr, kerma ) ) == NULL ) return;
240  xData_addToAccessed( smr, kerma, 1 );
241  if( ( target->kerma = xData_1d_x_allocateCopyData( smr, kerma ) ) == NULL ) return;
242  }
243 }
244 /*
245 ************************************************************
246 */
247 //int tpia_target_heated_numberOfChannels( statusMessageReporting *smr, tpia_target_heated *target ) {
248 int tpia_target_heated_numberOfChannels( statusMessageReporting *, tpia_target_heated *target ) {
249 
250  return( target->nChannels );
251 }
252 /*
253 ************************************************************
254 */
255 //int tpia_target_heated_numberOfProductionChannels( statusMessageReporting *smr, tpia_target_heated *target ) {
256 int tpia_target_heated_numberOfProductionChannels( statusMessageReporting *, tpia_target_heated *target ) {
257 
258  return( target->nProductionChannels );
259 }
260 /*
261 ************************************************************
262 */
263 tpia_channel *tpia_target_heated_getChannelAtIndex( tpia_target_heated *target, int index ) {
264 
265  tpia_channel *channel = NULL;
266 
267  if( ( index >= 0 ) && ( index < target->nChannels ) ) channel = target->channels[index];
268  return( channel );
269 }
270 /*
271 ************************************************************
272 */
273 tpia_channel *tpia_target_heated_getChannelAtIndex_smr( statusMessageReporting *smr, tpia_target_heated *target, int index ) {
274 
275  tpia_channel *channel = tpia_target_heated_getChannelAtIndex( target, index );
276 
277  if( channel == NULL ) {
278  smr_setMessageError( smr, NULL, __FILE__, __LINE__, 1, "bad channel index = %d for %s + %s", index,
279  target->projectileID->name, target->targetID->name );
280  }
281  return( channel );
282 }
283 /*
284 ************************************************************
285 */
286 tpia_channel *tpia_target_heated_getProductionChannelAtIndex( tpia_target_heated *target, int index ) {
287 
288  tpia_channel *channel = NULL;
289 
290  if( ( index >= 0 ) && ( index < target->nProductionChannels ) ) channel = target->productionChannels[index];
291  return( channel );
292 }
293 /*
294 ************************************************************
295 */
296 //xData_Int tpia_target_heated_getEnergyGrid( statusMessageReporting *smr, tpia_target_heated *target, double **energyGrid ) {
297 xData_Int tpia_target_heated_getEnergyGrid( statusMessageReporting *, tpia_target_heated *target, double **energyGrid ) {
298 
299  if( energyGrid != NULL ) *energyGrid = target->energyGrid;
300  return( target->energyGridLength );
301 }
302 /*
303 ************************************************************
304 */
305 xData_Int tpia_target_heated_getEIndex( tpia_target_heated *target, double e_in ) {
306 
307  return( tpia_misc_binarySearch( target->energyGridLength, target->energyGrid, e_in ) );
308 }
309 /*
310 ************************************************************
311 */
312 //double tpia_target_heated_getTotalCrossSectionAtE( statusMessageReporting *smr, tpia_target_heated *target, xData_Int iEg, double e_in,
313 double tpia_target_heated_getTotalCrossSectionAtE( statusMessageReporting *smr, tpia_target_heated *target, xData_Int , double e_in,
314  int crossSectionType ) {
315 
316  double xsec = 0.;
317 
318  if( crossSectionType == tpia_crossSectionType_grouped ) {
319  xsec = 0; }
320  else if( crossSectionType == tpia_crossSectionType_pointwise ) {
321  xsec = tpia_misc_getPointwiseCrossSectionAtE( smr, &(target->totalCrossSectionPointwise), target->energyGrid,
322  tpia_target_heated_getEIndex( target, e_in ), e_in );
323  }
324  return( xsec );
325 }
326 /*
327 ************************************************************
328 */
329 double tpia_target_heated_getIndexChannelCrossSectionAtE( statusMessageReporting *smr, tpia_target_heated *target, int index, xData_Int iEg, double e_in,
330  int crossSectionType ) {
331 
332  double xsec = 0.;
333  tpia_channel *channel = tpia_target_heated_getChannelAtIndex_smr( smr, target, index );
334 
335  if( channel != NULL ) xsec = tpia_channel_getCrossSectionAtE( smr, channel, iEg, e_in, crossSectionType );
336  return( xsec );
337 }
338 /*
339 ************************************************************
340 */
341 int tpia_target_heated_sampleIndexChannelProductsAtE( statusMessageReporting *smr, tpia_target_heated *target, int index,
342  tpia_decaySamplingInfo *decaySamplingInfo, int nProductData, tpia_productOutgoingData *productDatas ) {
343 
344  tpia_channel *channel = tpia_target_heated_getChannelAtIndex_smr( smr, target, index );
345 
346  if( channel == NULL ) return( -1 );
347  return( tpia_decayChannel_sampleProductsAtE( smr, &(channel->decayChannel), decaySamplingInfo, nProductData, productDatas ) );
348 }
349 /*
350 ************************************************************
351 */
352 static int _tpia_target_heated_releaseAndReturnOne( statusMessageReporting *smr, xData_document *doc, tpia_target_heated *target ) {
353 
354  tpia_target_heated_release( smr, target );
355  if( doc != NULL ) xData_parseFree( smr, doc );
356  return( 1 );
357 }
358 /*
359 ************************************************************
360 */
361 static int _tpia_target_heated_checkElememtsForAccess( statusMessageReporting *smr, xData_document *doc ) {
362 
363  xData_element *element = xData_getDocumentsElement( doc );
364 
366  return( 0 );
367 }
368 /*
369 ************************************************************
370 */
371 static int _tpia_target_heated_checkElememtsForAccess2( statusMessageReporting *smr, xData_element *element ) {
372 
373  xData_element *child;
374 
375  if( xData_getAccessed( smr, element ) != 1 ) printf( "%3d %s\n", xData_getAccessed( smr, element ), element->fullName );
376  for( child = xData_getFirstElement( element ); child != NULL; child = xData_getNextElement( child ) )
378  return( 0 );
379 }
380 
381 #if defined __cplusplus
382 }
383 #endif
int tpia_target_heated_numberOfChannels(statusMessageReporting *, tpia_target_heated *target)
xData_Int xData_convertAttributeTo_xData_Int(statusMessageReporting *smr, xData_element *element, const char *name, xData_Int *n)
Definition: xData.cc:710
xData_element * xData_getOneElementByTagName(statusMessageReporting *smr, xData_element *element, char *name, int required)
Definition: xData.cc:810
int xData_addToAccessed(statusMessageReporting *, xData_element *element, int increment)
Definition: xData.cc:1078
tpia_target_heated * tpia_target_heated_create(statusMessageReporting *smr)
static int _tpia_target_heated_checkElememtsForAccess(statusMessageReporting *smr, xData_document *doc)
xData_Int tpia_target_heated_getEnergyGrid(statusMessageReporting *, tpia_target_heated *target, double **energyGrid)
xData_element * xData_getElements_xDataElement(statusMessageReporting *smr, xData_element *element)
Definition: xData.cc:622
int xData_getCommonData(statusMessageReporting *smr, xData_element *element, xData_Int *index, xData_Int *start, xData_Int *end, xData_Int *length)
Definition: xData.cc:652
xData_element * xData_getNextElement(xData_element *element)
Definition: xData.cc:478
G4String name
Definition: TRTMaterials.hh:40
xData_document * xData_parseReadFile(statusMessageReporting *smr, const char *fileName, xData_xDataTypeOk func, void *userData)
Definition: xData.cc:84
xData_Int tpia_target_heated_getEIndex(tpia_target_heated *target, double e_in)
int tpia_misc_setMessageError_Element(statusMessageReporting *smr, void *userInterface, xData_element *element, const char *file, int line, int code, const char *fmt,...)
Definition: tpia_misc.cc:183
int smr_setMessageError(statusMessageReporting *smr, void *userInterface, const char *file, int line, int code, const char *fmt,...)
static int _tpia_target_heated_checkElememtsForAccess2(statusMessageReporting *smr, xData_element *element)
char * xData_getAttributesValue(xData_attributionList *attributes, const char *name)
Definition: xData.cc:530
double * xData_1d_x_allocateCopyData(statusMessageReporting *smr, xData_element *element)
Definition: xData_1d_x.cc:105
int xData_getAccessed(statusMessageReporting *, xData_element *element)
Definition: xData.cc:1087
tpia_channel * tpia_target_heated_getChannelAtIndex_smr(statusMessageReporting *smr, tpia_target_heated *target, int index)
int tpia_target_heated_numberOfProductionChannels(statusMessageReporting *, tpia_target_heated *target)
char * xDataMisc_getAbsPath(statusMessageReporting *smr, const char *fileName)
Definition: xDataMisc.cc:112
xData_element * xData_getFirstElement(xData_element *element)
Definition: xData.cc:477
tpia_channel * tpia_target_heated_getChannelAtIndex(tpia_target_heated *target, int index)
xData_element * xData_getDocumentsElement(xData_document *doc)
Definition: xData.cc:476
int tpia_decayChannel_sampleProductsAtE(statusMessageReporting *smr, tpia_decayChannel *decayChannel, tpia_decaySamplingInfo *decaySamplingInfo, int nProductData, tpia_productOutgoingData *productDatas)
static int _tpia_target_heated_releaseAndReturnOne(statusMessageReporting *smr, xData_document *doc, tpia_target_heated *target)
void * xData_parseFree(statusMessageReporting *smr, xData_document *doc)
Definition: xData.cc:208
tpia_channel * tpia_target_heated_getProductionChannelAtIndex(tpia_target_heated *target, int index)
int smr_isOk(statusMessageReporting *smr)
xData_Int tpia_misc_binarySearch(xData_Int n, double *ds, double d)
Definition: tpia_misc.cc:208
double tpia_target_heated_getIndexChannelCrossSectionAtE(statusMessageReporting *smr, tpia_target_heated *target, int index, xData_Int iEg, double e_in, int crossSectionType)
tpia_channel * tpia_channel_createGetFromElement(statusMessageReporting *smr, tpia_target_heated *target, xData_element *channelElement, int pointwiseRequired)
Definition: tpia_channel.cc:71
int xData_numberOfElementsByTagName(statusMessageReporting *, xData_element *element, const char *tagName)
Definition: xData.cc:750
int xData_releaseAttributionList(statusMessageReporting *smr, xData_attributionList *attributes)
Definition: xData.cc:611
tpia_channel * tpia_channel_free(statusMessageReporting *smr, tpia_channel *channel)
Definition: tpia_channel.cc:83
double tpia_target_heated_getTotalCrossSectionAtE(statusMessageReporting *smr, tpia_target_heated *target, xData_Int, double e_in, int crossSectionType)
void * xData_free(statusMessageReporting *, void *p)
Definition: xDataMisc.cc:89
int tpia_target_heated_sampleIndexChannelProductsAtE(statusMessageReporting *smr, tpia_target_heated *target, int index, tpia_decaySamplingInfo *decaySamplingInfo, int nProductData, tpia_productOutgoingData *productDatas)
int xData_copyAttributionList(statusMessageReporting *smr, xData_attributionList *dest, xData_attributionList *src)
Definition: xData.cc:564
double tpia_channel_getCrossSectionAtE(statusMessageReporting *smr, tpia_channel *channel, xData_Int, double e_in, int crossSectionType)
double tpia_misc_getPointwiseCrossSectionAtE(statusMessageReporting *, tpia_1dData *crossSection, double *energyGrid, xData_Int index, double e_in)
Definition: tpia_misc.cc:298
int tpia_target_heated_read(statusMessageReporting *smr, tpia_target_heated *target, const char *fileName, int checkElememtsForAccess)
static void _tpia_target_heated_getEnergyGridAndAllocateTotalCrossSections(statusMessageReporting *smr, tpia_target_heated *target, xData_element *element)
tpia_target_heated * tpia_target_heated_createRead(statusMessageReporting *smr, const char *fileName, int checkElememtsForAccess)
int tpia_target_heated_initialize(statusMessageReporting *, tpia_target_heated *target)
int tpia_target_heated_release(statusMessageReporting *smr, tpia_target_heated *target)
tpia_target_heated * tpia_target_heated_free(statusMessageReporting *smr, tpia_target_heated *target)
tpia_particle * tpia_particle_getInternalID(statusMessageReporting *smr, const char *const name)