Geant4  10.00.p01
tpia_misc.cc File Reference
#include "Randomize.hh"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <cmath>
#include <tpia_target.h>
#include <tpia_misc.h>
#include <string>
+ Include dependency graph for tpia_misc.cc:

Go to the source code of this file.

Classes

struct  ZSymbol
 

Functions

int tpia_misc_NumberOfZSymbols (void)
 
const char * tpia_misc_ZToSymbol (int iZ)
 
int tpia_misc_symbolToZ (const char *Z)
 
int tpia_miscNameToZAm (statusMessageReporting *smr, const char *name, int *Z, int *A, int *m)
 
char * tpia_misc_pointerToAttributeIfAllOk (statusMessageReporting *smr, xData_element *element, const char *path, int required, xData_attributionList *attributes, const char *name, const char *file, int line)
 
int tpia_misc_setMessageError_Element (statusMessageReporting *smr, void *userInterface, xData_element *element, const char *file, int line, int code, const char *fmt,...)
 
xData_Int tpia_misc_binarySearch (xData_Int n, double *ds, double d)
 
double * tpia_misc_get2dx_y_data (statusMessageReporting *smr, xData_element *element, xData_Int *length)
 
double * tpia_misc_get2dxindex_y_data (statusMessageReporting *smr, xData_element *element, xData_Int *start, xData_Int *end, double *xValues)
 
double * tpia_misc_get2d_xShared_yHistogram_data (statusMessageReporting *smr, xData_element *element, xData_Int *start, xData_Int *end, xData_Int *length)
 
int tpia_misc_get2d_xShared_yHistogram_data_Grouped (statusMessageReporting *smr, xData_element *element, tpia_1dData *group)
 
double tpia_misc_getPointwiseCrossSectionAtE (statusMessageReporting *, tpia_1dData *crossSection, double *energyGrid, xData_Int index, double e_in)
 
tpia_EqualProbableBinSpectrum * tpia_misc_getEqualProbableBin (statusMessageReporting *smr, xData_element *parent, xData_Int *n, xData_Int *nBins)
 
tpia_EqualProbableBinSpectrum * tpia_misc_getEqualProbableBins (statusMessageReporting *smr, xData_element *parent, const char *name, xData_Int nBins, xData_Int *n)
 
double tpia_misc_drng (double(*rng)(void *), void *rngState)
 
int tpia_misc_sampleEqualProbableBin (statusMessageReporting *, tpia_decaySamplingInfo *decaySamplingInfo, double e_in, int nBins, tpia_EqualProbableBinSpectra *binned, double *value_)
 

Variables

static const struct ZSymbol ZSymbols []
 

Function Documentation

xData_Int tpia_misc_binarySearch ( xData_Int  n,
double *  ds,
double  d 
)

Definition at line 208 of file tpia_misc.cc.

References imax.

Referenced by tpia_target_heated_getEIndex().

+ Here is the caller graph for this function:

double tpia_misc_drng ( double(*)(void *)  rng,
void *  rngState 
)

Definition at line 403 of file tpia_misc.cc.

Referenced by G4GIDI_target::sampleChannelCrossSectionAtE(), tpia_decayChannel_sampleProductsAtE(), tpia_Legendre_SampleEp(), and tpia_misc_sampleEqualProbableBin().

+ Here is the caller graph for this function:

double* tpia_misc_get2d_xShared_yHistogram_data ( statusMessageReporting *  smr,
xData_element *  element,
xData_Int *  start,
xData_Int *  end,
xData_Int *  length 
)

Definition at line 268 of file tpia_misc.cc.

References xData_2d_xShared_yHistogram_copyData(), xData_addToAccessed(), and xData_getOneElementByTagName().

Referenced by tpia_misc_get2d_xShared_yHistogram_data_Grouped().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int tpia_misc_get2d_xShared_yHistogram_data_Grouped ( statusMessageReporting *  smr,
xData_element *  element,
tpia_1dData *  group 
)

Definition at line 289 of file tpia_misc.cc.

References tpia_misc_get2d_xShared_yHistogram_data().

Referenced by _tpia_product_getDepositionEnergy(), tpia_channel_getFromElement(), and tpia_multiplicity_getFromElement().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double* tpia_misc_get2dx_y_data ( statusMessageReporting *  smr,
xData_element *  element,
xData_Int *  length 
)

Definition at line 228 of file tpia_misc.cc.

References xData_2d_xy_allocateCopyData(), xData_addToAccessed(), xData_getOneElementByTagName(), and xData_is_2d_xy().

Referenced by tpia_multiplicity_getFromElement().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double* tpia_misc_get2dxindex_y_data ( statusMessageReporting *  smr,
xData_element *  element,
xData_Int *  start,
xData_Int *  end,
double *  xValues 
)

Definition at line 248 of file tpia_misc.cc.

References xData_2d_xindex_y_toFilledYs(), xData_addToAccessed(), xData_getOneElementByTagName(), and xData_is_2d_xindex_y().

Referenced by tpia_channel_getFromElement().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

tpia_EqualProbableBinSpectrum* tpia_misc_getEqualProbableBin ( statusMessageReporting *  smr,
xData_element *  parent,
xData_Int *  n,
xData_Int *  nBins 
)

Definition at line 317 of file tpia_misc.cc.

References tpia_misc_getEqualProbableBins(), tpia_misc_setMessageError_Element(), xData_addToAccessed(), xData_convertAttributeTo_xData_Int(), and xData_getOneElementByTagName().

Referenced by _tpia_Legendre_getOrder(), and tpia_angular_getFromElement().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

tpia_EqualProbableBinSpectrum* tpia_misc_getEqualProbableBins ( statusMessageReporting *  smr,
xData_element *  parent,
const char *  name,
xData_Int  nBins,
xData_Int *  n 
)

Definition at line 333 of file tpia_misc.cc.

References tpia_misc_setMessageError_Element(), xData_1d_x_copyData(), xData_addToAccessed(), xData_convertAttributeTo_xData_Int(), xData_convertAttributeToDouble(), xData_free(), xData_freeElementList(), xData_getElements_xDataElement(), and xData_getElementsByTagNameAndSort().

Referenced by tpia_angularEnergy_getFromElement(), and tpia_misc_getEqualProbableBin().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double tpia_misc_getPointwiseCrossSectionAtE ( statusMessageReporting *  ,
tpia_1dData *  crossSection,
double *  energyGrid,
xData_Int  index,
double  e_in 
)

Definition at line 298 of file tpia_misc.cc.

References e1, and e2.

Referenced by tpia_channel_getCrossSectionAtE(), and tpia_target_heated_getTotalCrossSectionAtE().

+ Here is the caller graph for this function:

int tpia_misc_NumberOfZSymbols ( void  )

Definition at line 76 of file tpia_misc.cc.

Referenced by tpia_misc_symbolToZ(), and tpia_misc_ZToSymbol().

+ Here is the caller graph for this function:

char* tpia_misc_pointerToAttributeIfAllOk ( statusMessageReporting *  smr,
xData_element *  element,
const char *  path,
int  required,
xData_attributionList *  attributes,
const char *  name,
const char *  file,
int  line 
)

Definition at line 163 of file tpia_misc.cc.

References smr_isOk(), smr_setMessageError(), tpia_misc_setMessageError_Element(), and xData_getAttributesValue().

+ Here is the call graph for this function:

int tpia_misc_sampleEqualProbableBin ( statusMessageReporting *  ,
tpia_decaySamplingInfo *  decaySamplingInfo,
double  e_in,
int  nBins,
tpia_EqualProbableBinSpectra *  binned,
double *  value_ 
)

Definition at line 420 of file tpia_misc.cc.

References P12, P23, and tpia_misc_drng().

Referenced by tpia_angular_SampleMu(), tpia_angularEnergy_SampleEp(), and tpia_Legendre_SampleEp().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int tpia_misc_setMessageError_Element ( statusMessageReporting *  smr,
void *  userInterface,
xData_element *  element,
const char *  file,
int  line,
int  code,
const char *  fmt,
  ... 
)
int tpia_misc_symbolToZ ( const char *  Z)

Definition at line 92 of file tpia_misc.cc.

References n, symbol, and tpia_misc_NumberOfZSymbols().

Referenced by tpia_miscNameToZAm().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const char* tpia_misc_ZToSymbol ( int  iZ)

Definition at line 83 of file tpia_misc.cc.

References symbol, and tpia_misc_NumberOfZSymbols().

Referenced by G4GIDI_Misc_Z_A_m_ToName().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int tpia_miscNameToZAm ( statusMessageReporting *  smr,
const char *  name,
int *  Z,
int *  A,
int *  m 
)

Definition at line 105 of file tpia_misc.cc.

References n, s, smr_isOk(), smr_setMessageError(), and tpia_misc_symbolToZ().

Referenced by G4GIDI_Misc_channelCompound(), and tpia_particle_getInternalID().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

const struct ZSymbol ZSymbols[]
static
Initial value:
= { { 0, "n" }, { 1, "H" }, { 2, "He" }, { 3, "Li" }, { 4, "Be" }, { 5, "B" }, { 6, "C" },
{ 7, "N" }, { 8, "O" }, { 9, "F" }, { 10, "Ne" }, { 11, "Na" }, { 12, "Mg" }, { 13, "Al" }, { 14, "Si" }, { 15, "P" },
{ 16, "S" }, { 17, "Cl" }, { 18, "Ar" }, { 19, "K" }, { 20, "Ca" }, { 21, "Sc" }, { 22, "Ti" }, { 23, "V" }, { 24, "Cr" },
{ 25, "Mn" }, { 26, "Fe" }, { 27, "Co" }, { 28, "Ni" }, { 29, "Cu" }, { 30, "Zn" }, { 31, "Ga" }, { 32, "Ge" }, { 33, "As" },
{ 34, "Se" }, { 35, "Br" }, { 36, "Kr" }, { 37, "Rb" }, { 38, "Sr" }, { 39, "Y" }, { 40, "Zr" }, { 41, "Nb" }, { 42, "Mo" },
{ 43, "Tc" }, { 44, "Ru" }, { 45, "Rh" }, { 46, "Pd" }, { 47, "Ag" }, { 48, "Cd" }, { 49, "In" }, { 50, "Sn" }, { 51, "Sb" },
{ 52, "Te" }, { 53, "I" }, { 54, "Xe" }, { 55, "Cs" }, { 56, "Ba" }, { 57, "La" }, { 58, "Ce" }, { 59, "Pr" }, { 60, "Nd" },
{ 61, "Pm" }, { 62, "Sm" }, { 63, "Eu" }, { 64, "Gd" }, { 65, "Tb" }, { 66, "Dy" }, { 67, "Ho" }, { 68, "Er" }, { 69, "Tm" },
{ 70, "Yb" }, { 71, "Lu" }, { 72, "Hf" }, { 73, "Ta" }, { 74, "W" }, { 75, "Re" }, { 76, "Os" }, { 77, "Ir" }, { 78, "Pt" },
{ 79, "Au" }, { 80, "Hg" }, { 81, "Tl" }, { 82, "Pb" }, { 83, "Bi" }, { 84, "Po" }, { 85, "At" }, { 86, "Rn" }, { 87, "Fr" },
{ 88, "Ra" }, { 89, "Ac" }, { 90, "Th" }, { 91, "Pa" }, { 92, "U" }, { 93, "Np" }, { 94, "Pu" }, { 95, "Am" }, { 96, "Cm" },
{ 97, "Bk" }, { 98, "Cf" }, { 99, "Es" }, { 100, "Fm" }, { 101, "Md" }, { 102, "No" }, { 103, "Lr" }, { 104, "Rf" }, { 105, "Db" },
{ 106, "Sg" }, { 107, "Bh" }, { 108, "Hs" }, { 109, "Mt" } }

Definition at line 59 of file tpia_misc.cc.