Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
MCGIDI_angularEnergy.cc File Reference
#include <string.h>
#include "MCGIDI.h"
#include "MCGIDI_fromTOM.h"
#include "MCGIDI_misc.h"
#include "MCGIDI_private.h"

Go to the source code of this file.

Functions

MCGIDI_angularEnergyMCGIDI_angularEnergy_new (statusMessageReporting *smr)
 
int MCGIDI_angularEnergy_initialize (statusMessageReporting *, MCGIDI_angularEnergy *angularEnergy)
 
MCGIDI_angularEnergyMCGIDI_angularEnergy_free (statusMessageReporting *smr, MCGIDI_angularEnergy *angularEnergy)
 
int MCGIDI_angularEnergy_release (statusMessageReporting *smr, MCGIDI_angularEnergy *angularEnergy)
 
int MCGIDI_angularEnergy_parseFromTOM (statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_distribution *distribution)
 
int MCGIDI_angularEnergy_sampleDistribution (statusMessageReporting *smr, MCGIDI_angularEnergy *angularEnergy, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo)
 

Function Documentation

◆ MCGIDI_angularEnergy_free()

MCGIDI_angularEnergy * MCGIDI_angularEnergy_free ( statusMessageReporting * smr,
MCGIDI_angularEnergy * angularEnergy )

Definition at line 40 of file MCGIDI_angularEnergy.cc.

40 {
41
42 MCGIDI_angularEnergy_release( smr, angularEnergy );
43 smr_freeMemory( (void **) &angularEnergy );
44 return( NULL );
45}
int MCGIDI_angularEnergy_release(statusMessageReporting *smr, MCGIDI_angularEnergy *angularEnergy)
void * smr_freeMemory(void **p)

Referenced by MCGIDI_angularEnergy_new(), and MCGIDI_distribution_release().

◆ MCGIDI_angularEnergy_initialize()

int MCGIDI_angularEnergy_initialize ( statusMessageReporting * smr,
MCGIDI_angularEnergy * angularEnergy )

Definition at line 32 of file MCGIDI_angularEnergy.cc.

32 {
33
34 memset( angularEnergy, 0, sizeof( MCGIDI_angularEnergy ) );
35 return( 0 );
36}

Referenced by MCGIDI_angularEnergy_new(), and MCGIDI_angularEnergy_release().

◆ MCGIDI_angularEnergy_new()

MCGIDI_angularEnergy * MCGIDI_angularEnergy_new ( statusMessageReporting * smr)

Definition at line 21 of file MCGIDI_angularEnergy.cc.

21 {
22
23 MCGIDI_angularEnergy *angularEnergy;
24
25 if( ( angularEnergy = (MCGIDI_angularEnergy *) smr_malloc2( smr, sizeof( MCGIDI_angularEnergy ), 0, "angularEnergy" ) ) == NULL ) return( NULL );
26 if( MCGIDI_angularEnergy_initialize( smr, angularEnergy ) ) angularEnergy = MCGIDI_angularEnergy_free( smr, angularEnergy );
27 return( angularEnergy );
28}
MCGIDI_angularEnergy * MCGIDI_angularEnergy_free(statusMessageReporting *smr, MCGIDI_angularEnergy *angularEnergy)
int MCGIDI_angularEnergy_initialize(statusMessageReporting *, MCGIDI_angularEnergy *angularEnergy)
#define smr_malloc2(smr, size, zero, forItem)

◆ MCGIDI_angularEnergy_parseFromTOM()

int MCGIDI_angularEnergy_parseFromTOM ( statusMessageReporting * smr,
xDataTOM_element * element,
MCGIDI_distribution * distribution )

Definition at line 65 of file MCGIDI_angularEnergy.cc.

65 {
66
67 xDataTOM_element *angularEnergyElement, *pointwise = NULL;
68 char const *nativeData;
69
70 if( ( angularEnergyElement = xDataTOME_getOneElementByName( smr, element, "angularEnergy", 1 ) ) == NULL ) goto err;
71
72 if( ( nativeData = xDataTOM_getAttributesValueInElement( angularEnergyElement, "nativeData" ) ) == NULL ) goto err;
73 if( strcmp( nativeData, "pointwise" ) == 0 ) {
74 if( ( pointwise = xDataTOME_getOneElementByName( smr, angularEnergyElement, "pointwise", 1 ) ) == NULL ) goto err; }
75 else if( strcmp( nativeData, "linear" ) == 0 ) {
76 if( ( pointwise = xDataTOME_getOneElementByName( smr, angularEnergyElement, "linear", 1 ) ) == NULL ) goto err; }
77 else {
78 smr_setReportError2( smr, smr_unknownID, 1, "angularEnergy nativeData = '%s' not supported", nativeData );
79 goto err;
80 }
81 if( pointwise != NULL ) return( MCGIDI_angularEnergy_parsePointwiseFromTOM( smr, pointwise, distribution ) );
82
83 return( 0 );
84
85err:
86 return( 1 );
87}
#define smr_setReportError2(smr, libraryID, code, fmt,...)
#define smr_unknownID
xDataTOM_element * xDataTOME_getOneElementByName(statusMessageReporting *smr, xDataTOM_element *element, char const *name, int required)
Definition xDataTOM.cc:246
char const * xDataTOM_getAttributesValueInElement(xDataTOM_element *element, char const *name)
Definition xDataTOM.cc:286

Referenced by MCGIDI_distribution_parseFromTOM().

◆ MCGIDI_angularEnergy_release()

int MCGIDI_angularEnergy_release ( statusMessageReporting * smr,
MCGIDI_angularEnergy * angularEnergy )

Definition at line 49 of file MCGIDI_angularEnergy.cc.

49 {
50
51 int i;
52
53 for( i = 0; i < angularEnergy->pdfOfMuGivenE.numberOfWs; i++ ) {
55 }
56 smr_freeMemory( (void **) &(angularEnergy->pdfOfEpGivenEAndMu) );
58 MCGIDI_angularEnergy_initialize( smr, angularEnergy );
59
60 return( 0 );
61}
int MCGIDI_sampling_pdfsOfXGivenW_release(statusMessageReporting *smr, MCGIDI_pdfsOfXGivenW *dists)
MCGIDI_pdfsOfXGivenW * pdfOfEpGivenEAndMu
Definition MCGIDI.h:361
MCGIDI_pdfsOfXGivenW pdfOfMuGivenE
Definition MCGIDI.h:360

Referenced by MCGIDI_angularEnergy_free().

◆ MCGIDI_angularEnergy_sampleDistribution()

int MCGIDI_angularEnergy_sampleDistribution ( statusMessageReporting * smr,
MCGIDI_angularEnergy * angularEnergy,
MCGIDI_quantitiesLookupModes & modes,
MCGIDI_decaySamplingInfo * decaySamplingInfo )

Definition at line 175 of file MCGIDI_angularEnergy.cc.

176 {
177
178 int status = MCGIDI_sampling_doubleDistribution( smr, &(angularEnergy->pdfOfMuGivenE), angularEnergy->pdfOfEpGivenEAndMu, modes, decaySamplingInfo );
179
180 decaySamplingInfo->frame = angularEnergy->frame;
181 return( status );
182}
int MCGIDI_sampling_doubleDistribution(statusMessageReporting *smr, MCGIDI_pdfsOfXGivenW *pdfOfWGivenV, MCGIDI_pdfsOfXGivenW *pdfOfXGivenVAndW, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo)
enum xDataTOM_frame frame
Definition MCGIDI.h:359
enum xDataTOM_frame frame
Definition MCGIDI.h:252

Referenced by MCGIDI_outputChannel_sampleProductsAtE().