ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MCGIDI_misc.cc File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <cmath>
#include <ctype.h>
#include <unistd.h>
#include <ptwXY.h>
#include <xDataTOM_importXML_private.h>
#include "MCGIDI.h"
#include "MCGIDI_misc.h"
#include "MCGIDI_fromTOM.h"
+ Include dependency graph for MCGIDI_misc.cc:

Go to the source code of this file.

Classes

struct  ZSymbol
 

Functions

static int MCGIDI_miscNameToZAm_getLevel (statusMessageReporting *smr, const char *name, const char *p)
 
static ptwXYPointsMCGIDI_misc_Data2ptwXYPointsInUnitsOf (statusMessageReporting *smr, ptwXY_interpolation interpolation, int length, double *data, char const *fromUnits[2], char const *toUnits[2])
 
int MCGIDI_misc_NumberOfZSymbols (void)
 
const char * MCGIDI_misc_ZToSymbol (int iZ)
 
int MCGIDI_misc_symbolToZ (const char *Z)
 
int MCGIDI_miscNameToZAm (statusMessageReporting *smr, const char *name, int *Z, int *A, int *m, int *level)
 
char const * MCGIDI_misc_pointerToTOMAttributeIfAllOk (statusMessageReporting *smr, const char *path, int required, xDataTOM_attributionList *attributes, const char *name, const char *file, int line)
 
char const * MCGIDI_misc_pointerToAttributeIfAllOk (statusMessageReporting *smr, xDataXML_element *element, const char *path, int required, xDataTOM_attributionList *attributes, const char *name, const char *file, int line)
 
int MCGIDI_misc_setMessageError_Element (statusMessageReporting *smr, void *userInterface, xDataXML_element *element, const char *file, int line, int code, const char *fmt,...)
 
xDataTOM_Int MCGIDI_misc_binarySearch (xDataTOM_Int n, double *ds, double d)
 
char * MCGIDI_misc_getAbsPath (statusMessageReporting *smr, const char *fileName)
 
int MCGIDI_misc_copyXMLAttributesToTOM (statusMessageReporting *smr, xDataTOM_attributionList *TOM, xDataXML_attributionList *XML)
 
enum xDataTOM_frame MCGIDI_misc_getProductFrame (statusMessageReporting *smr, xDataTOM_element *frameElement)
 
int MCGIDI_misc_PQUStringToDouble (statusMessageReporting *smr, char const *str, char const *unit, double conversion, double *value)
 
int MCGIDI_misc_PQUStringToDoubleInUnitOf (statusMessageReporting *smr, char const *str, char const *toUnit, double *value)
 
double MCGIDI_misc_getUnitConversionFactor (statusMessageReporting *smr, char const *fromUnit, char const *toUnit)
 
ptwXYPointsMCGIDI_misc_dataFromXYs2ptwXYPointsInUnitsOf (statusMessageReporting *smr, xDataTOM_XYs *XYs, ptwXY_interpolation interpolation, char const *toUnits[2])
 
ptwXYPointsMCGIDI_misc_dataFromElement2ptwXYPointsInUnitsOf (statusMessageReporting *smr, xDataTOM_element *linear, char const *toUnits[2])
 
void MCGIDI_misc_updateTransportabilitiesMap (transportabilitiesMap *transportabilities, int PoPID, enum MCGIDI_transportability transportability)
 
void MCGIDI_misc_updateTransportabilitiesMap2 (transportabilitiesMap *transportabilities, int PoPID, int transportable)
 

Variables

static struct ZSymbol ZSymbols []
 

Function Documentation

xDataTOM_Int MCGIDI_misc_binarySearch ( xDataTOM_Int  n,
double *  ds,
double  d 
)

Definition at line 228 of file MCGIDI_misc.cc.

View newest version in sPHENIX GitHub at line 228 of file MCGIDI_misc.cc

References imax.

Referenced by MCGIDI_sampling_doubleDistribution(), MCGIDI_sampling_sampleX_from_pdfOfX(), and MCGIDI_sampling_sampleX_from_pdfsOfXGivenW().

+ Here is the caller graph for this function:

int MCGIDI_misc_copyXMLAttributesToTOM ( statusMessageReporting smr,
xDataTOM_attributionList TOM,
xDataXML_attributionList XML 
)

Definition at line 296 of file MCGIDI_misc.cc.

View newest version in sPHENIX GitHub at line 296 of file MCGIDI_misc.cc

References check_license::err(), xDataXML_attribute_s::name, xDataXML_attribute_s::value, xDataTOMAL_addAttribute(), xDataTOMAL_initial(), xDataTOMAL_release(), and xDataXML_attributeByIndex().

+ Here is the call graph for this function:

static ptwXYPoints * MCGIDI_misc_Data2ptwXYPointsInUnitsOf ( statusMessageReporting smr,
ptwXY_interpolation  interpolation,
int  length,
double *  data,
char const *  fromUnits[2],
char const *  toUnits[2] 
)
static

Definition at line 447 of file MCGIDI_misc.cc.

View newest version in sPHENIX GitHub at line 447 of file MCGIDI_misc.cc

References e, check_license::err(), MCGIDI_misc_getUnitConversionFactor(), nfu_Okay, nfu_statusMessage(), ptwXY_create(), ptwXY_free(), ptwXY_scaleOffsetXAndY(), smr_isOk(), smr_setReportError2, and smr_unknownID.

Referenced by MCGIDI_misc_dataFromElement2ptwXYPointsInUnitsOf(), and MCGIDI_misc_dataFromXYs2ptwXYPointsInUnitsOf().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ptwXYPoints* MCGIDI_misc_dataFromElement2ptwXYPointsInUnitsOf ( statusMessageReporting smr,
xDataTOM_element linear,
char const *  toUnits[2] 
)

Definition at line 424 of file MCGIDI_misc.cc.

View newest version in sPHENIX GitHub at line 424 of file MCGIDI_misc.cc

References xDataTOM_xDataInfo_s::axes, xDataTOM_axes_s::axis, BTOF::length, MCGIDI_fromTOM_interpolation(), MCGIDI_misc_Data2ptwXYPointsInUnitsOf(), xDataTOM_axes_s::numberOfAxes, smr_setReportError2, smr_unknownID, xDataTOM_axis_s::unit, xDataTOM_element_s::xDataInfo, and xDataTOM_XYs_getDataFromXDataInfo().

Referenced by MCGIDI_energy_parseEvaporationFromTOM(), MCGIDI_energy_parseGeneralEvaporationFromTOM(), MCGIDI_energy_parseSimpleMaxwellianFissionFromTOM(), MCGIDI_energy_parseWattFromTOM(), MCGIDI_energy_parseWeightFromTOM(), MCGIDI_product_parseFromTOM(), MCGIDI_product_parseWeightedReferenceMultiplicityFromTOM(), and MCGIDI_reaction_parseFromTOM().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ptwXYPoints* MCGIDI_misc_dataFromXYs2ptwXYPointsInUnitsOf ( statusMessageReporting smr,
xDataTOM_XYs XYs,
ptwXY_interpolation  interpolation,
char const *  toUnits[2] 
)

Definition at line 405 of file MCGIDI_misc.cc.

View newest version in sPHENIX GitHub at line 405 of file MCGIDI_misc.cc

References BTOF::length, MCGIDI_misc_Data2ptwXYPointsInUnitsOf(), smr_isOk(), xDataTOM_XYs_s::subAxes, xDataTOM_subAxes_getUnit(), and xDataTOM_XYs_getData().

Referenced by MCGIDI_angular_parseFromTOM(), MCGIDI_angularEnergy_parsePointwiseFromTOM(), MCGIDI_energy_parseMadlandNixFromTOM(), MCGIDI_energyAngular_linear_parseFromTOM(), MCGIDI_fromTOM_pdfsOfXGivenW(), and MCGIDI_LLNL_angularEnergy_parsePointwiseFromTOM().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

char* MCGIDI_misc_getAbsPath ( statusMessageReporting smr,
const char *  fileName 
)

Definition at line 250 of file MCGIDI_misc.cc.

View newest version in sPHENIX GitHub at line 250 of file MCGIDI_misc.cc

References g4zmq::cwd(), int(), n, smr_malloc2, smr_setReportError2p, and smr_unknownID.

Referenced by MCGIDI_target_read().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

enum xDataTOM_frame MCGIDI_misc_getProductFrame ( statusMessageReporting smr,
xDataTOM_element frameElement 
)

Definition at line 315 of file MCGIDI_misc.cc.

View newest version in sPHENIX GitHub at line 315 of file MCGIDI_misc.cc

References MCGIDI_token_productFrame, smr_setReportError2, smr_unknownID, xDataTOM_axis_stringToFrame(), xDataTOM_frame_invalid, and xDataTOM_getAttributesValueInElement().

Referenced by MCGIDI_angular_parseFromTOM(), MCGIDI_angularEnergy_parsePointwiseFromTOM(), MCGIDI_energy_parseFromTOM(), MCGIDI_energyAngular_linear_parseFromTOM(), MCGIDI_KalbachMann_parseFromTOM(), and MCGIDI_LLNL_angularEnergy_parsePointwiseFromTOM().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double MCGIDI_misc_getUnitConversionFactor ( statusMessageReporting smr,
char const *  fromUnit,
char const *  toUnit 
)

Definition at line 381 of file MCGIDI_misc.cc.

View newest version in sPHENIX GitHub at line 381 of file MCGIDI_misc.cc

References e, smr_setReportError2, and smr_unknownID.

Referenced by MCGIDI_angular_parseFromTOM(), MCGIDI_angularEnergy_parsePointwiseFromTOM(), MCGIDI_energyAngular_linear_parseFromTOM(), MCGIDI_fromTOM_pdfsOfXGivenW(), MCGIDI_KalbachMann_parseFromTOM(), MCGIDI_misc_Data2ptwXYPointsInUnitsOf(), MCGIDI_misc_PQUStringToDoubleInUnitOf(), MCGIDI_product_parsePolynomialMultiplicity(), and MCGIDI_target_heated_read().

+ Here is the caller graph for this function:

int MCGIDI_misc_NumberOfZSymbols ( void  )

Definition at line 54 of file MCGIDI_misc.cc.

View newest version in sPHENIX GitHub at line 54 of file MCGIDI_misc.cc

References ZSymbols.

Referenced by MCGIDI_misc_symbolToZ(), and MCGIDI_misc_ZToSymbol().

+ Here is the caller graph for this function:

char const* MCGIDI_misc_pointerToAttributeIfAllOk ( statusMessageReporting smr,
xDataXML_element element,
const char *  path,
int  required,
xDataTOM_attributionList attributes,
const char *  name,
const char *  file,
int  line 
)

Definition at line 184 of file MCGIDI_misc.cc.

View newest version in sPHENIX GitHub at line 184 of file MCGIDI_misc.cc

References MCGIDI_misc_setMessageError_Element(), smr_isOk(), smr_setReportError(), smr_unknownID, and xDataTOMAL_getAttributesValue().

+ Here is the call graph for this function:

char const* MCGIDI_misc_pointerToTOMAttributeIfAllOk ( statusMessageReporting smr,
const char *  path,
int  required,
xDataTOM_attributionList attributes,
const char *  name,
const char *  file,
int  line 
)

Definition at line 168 of file MCGIDI_misc.cc.

View newest version in sPHENIX GitHub at line 168 of file MCGIDI_misc.cc

References smr_isOk(), smr_setReportError(), smr_unknownID, and xDataTOMAL_getAttributesValue().

+ Here is the call graph for this function:

int MCGIDI_misc_PQUStringToDouble ( statusMessageReporting smr,
char const *  str,
char const *  unit,
double  conversion,
double *  value 
)

Definition at line 330 of file MCGIDI_misc.cc.

View newest version in sPHENIX GitHub at line 330 of file MCGIDI_misc.cc

References e, smr_setReportError2, and smr_unknownID.

Referenced by MCGIDI_energy_parseNBodyPhaseSpaceFromTOM(), and MCGIDI_target_heated_parseParticle().

+ Here is the caller graph for this function:

int MCGIDI_misc_PQUStringToDoubleInUnitOf ( statusMessageReporting smr,
char const *  str,
char const *  toUnit,
double *  value 
)

Definition at line 356 of file MCGIDI_misc.cc.

View newest version in sPHENIX GitHub at line 356 of file MCGIDI_misc.cc

References e1, MCGIDI_misc_getUnitConversionFactor(), s1, smr_isOk(), smr_setReportError2, and smr_unknownID.

Referenced by MCGIDI_distribution_parseFromTOM(), MCGIDI_energy_parseEvaporationFromTOM(), MCGIDI_energy_parseMadlandNixFromTOM(), MCGIDI_energy_parseSimpleMaxwellianFissionFromTOM(), MCGIDI_energy_parseWattFromTOM(), MCGIDI_outputChannel_parseFromTOM(), MCGIDI_product_parseFromTOM(), and MCGIDI_target_heated_parseParticleLevel().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int MCGIDI_misc_setMessageError_Element ( statusMessageReporting smr,
void userInterface,
xDataXML_element element,
const char *  file,
int  line,
int  code,
const char *  fmt,
  ... 
)

Definition at line 204 of file MCGIDI_misc.cc.

View newest version in sPHENIX GitHub at line 204 of file MCGIDI_misc.cc

References xDataXML_element_s::name, smr_freeMemory(), smr_setReportError(), smr_unknownID, smr_vallocateFormatMessage(), and smr_vsetReportError().

Referenced by MCGIDI_misc_pointerToAttributeIfAllOk(), and MCGIDI_target_read().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int MCGIDI_misc_symbolToZ ( const char *  Z)

Definition at line 69 of file MCGIDI_misc.cc.

View newest version in sPHENIX GitHub at line 69 of file MCGIDI_misc.cc

References MCGIDI_misc_NumberOfZSymbols(), n, ZSymbol::symbol, and ZSymbols.

Referenced by MCGIDI_miscNameToZAm().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void MCGIDI_misc_updateTransportabilitiesMap ( transportabilitiesMap transportabilities,
int  PoPID,
enum MCGIDI_transportability  transportability 
)

Definition at line 482 of file MCGIDI_misc.cc.

View newest version in sPHENIX GitHub at line 482 of file MCGIDI_misc.cc

References MCGIDI_transportability_full, MCGIDI_transportability_none, MCGIDI_transportability_partial, and MCGIDI_transportability_unknown.

Referenced by MCGIDI_misc_updateTransportabilitiesMap2(), and MCGIDI_target_heated_read().

+ Here is the caller graph for this function:

void MCGIDI_misc_updateTransportabilitiesMap2 ( transportabilitiesMap transportabilities,
int  PoPID,
int  transportable 
)

Definition at line 524 of file MCGIDI_misc.cc.

View newest version in sPHENIX GitHub at line 524 of file MCGIDI_misc.cc

References MCGIDI_misc_updateTransportabilitiesMap(), MCGIDI_transportability_full, and MCGIDI_transportability_none.

Referenced by MCGIDI_reaction_addReturnProduct().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const char* MCGIDI_misc_ZToSymbol ( int  iZ)

Definition at line 61 of file MCGIDI_misc.cc.

View newest version in sPHENIX GitHub at line 61 of file MCGIDI_misc.cc

References MCGIDI_misc_NumberOfZSymbols(), ZSymbol::symbol, and ZSymbols.

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 MCGIDI_miscNameToZAm ( statusMessageReporting smr,
const char *  name,
int Z,
int A,
int m,
int level 
)

Definition at line 81 of file MCGIDI_misc.cc.

View newest version in sPHENIX GitHub at line 81 of file MCGIDI_misc.cc

References e, int(), MCGIDI_misc_symbolToZ(), MCGIDI_miscNameToZAm_getLevel(), smr_isOk(), smr_setReportError2, and smr_unknownID.

Referenced by G4GIDI_Misc_channelCompound(), MCGIDI_particle_getInternalID(), and MCGIDI_POP_new().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int MCGIDI_miscNameToZAm_getLevel ( statusMessageReporting smr,
const char *  name,
const char *  p 
)
static

Definition at line 138 of file MCGIDI_misc.cc.

View newest version in sPHENIX GitHub at line 138 of file MCGIDI_misc.cc

References e, int(), MCGIDI_particleLevel_continuum, MCGIDI_particleLevel_sum, smr_setReportError2, and smr_unknownID.

Referenced by MCGIDI_miscNameToZAm().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

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 34 of file MCGIDI_misc.cc.

View newest version in sPHENIX GitHub at line 34 of file MCGIDI_misc.cc

Referenced by MCGIDI_misc_NumberOfZSymbols(), MCGIDI_misc_symbolToZ(), and MCGIDI_misc_ZToSymbol().