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

Go to the source code of this file.

Functions

MCGIDI_energyAngularMCGIDI_energyAngular_new (statusMessageReporting *smr)
 
int MCGIDI_energyAngular_initialize (statusMessageReporting *, MCGIDI_energyAngular *energyAngular)
 
MCGIDI_energyAngularMCGIDI_energyAngular_free (statusMessageReporting *smr, MCGIDI_energyAngular *energyAngular)
 
int MCGIDI_energyAngular_release (statusMessageReporting *smr, MCGIDI_energyAngular *energyAngular)
 
int MCGIDI_energyAngular_parseFromTOM (statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_distribution *distribution)
 
int MCGIDI_energyAngular_sampleDistribution (statusMessageReporting *smr, MCGIDI_distribution *distribution, MCGIDI_quantitiesLookupModes &modes, MCGIDI_decaySamplingInfo *decaySamplingInfo)
 

Function Documentation

◆ MCGIDI_energyAngular_free()

MCGIDI_energyAngular * MCGIDI_energyAngular_free ( statusMessageReporting smr,
MCGIDI_energyAngular energyAngular 
)

Definition at line 39 of file MCGIDI_energyAngular.cc.

39 {
40
41 MCGIDI_energyAngular_release( smr, energyAngular );
42 smr_freeMemory( (void **) &energyAngular );
43 return( NULL );
44}
int MCGIDI_energyAngular_release(statusMessageReporting *smr, MCGIDI_energyAngular *energyAngular)
void * smr_freeMemory(void **p)

Referenced by MCGIDI_distribution_release(), and MCGIDI_energyAngular_new().

◆ MCGIDI_energyAngular_initialize()

int MCGIDI_energyAngular_initialize ( statusMessageReporting smr,
MCGIDI_energyAngular energyAngular 
)

Definition at line 31 of file MCGIDI_energyAngular.cc.

31 {
32
33 memset( energyAngular, 0, sizeof( MCGIDI_energyAngular ) );
34 return( 0 );
35}

Referenced by MCGIDI_energyAngular_new(), and MCGIDI_energyAngular_release().

◆ MCGIDI_energyAngular_new()

MCGIDI_energyAngular * MCGIDI_energyAngular_new ( statusMessageReporting smr)

Definition at line 20 of file MCGIDI_energyAngular.cc.

20 {
21
22 MCGIDI_energyAngular *energyAngular;
23
24 if( ( energyAngular = (MCGIDI_energyAngular *) smr_malloc2( smr, sizeof( MCGIDI_energyAngular ), 0, "energyAngular" ) ) == NULL ) return( NULL );
25 if( MCGIDI_energyAngular_initialize( smr, energyAngular ) ) energyAngular = MCGIDI_energyAngular_free( smr, energyAngular );
26 return( energyAngular );
27}
MCGIDI_energyAngular * MCGIDI_energyAngular_free(statusMessageReporting *smr, MCGIDI_energyAngular *energyAngular)
int MCGIDI_energyAngular_initialize(statusMessageReporting *, MCGIDI_energyAngular *energyAngular)
#define smr_malloc2(smr, size, zero, forItem)

◆ MCGIDI_energyAngular_parseFromTOM()

int MCGIDI_energyAngular_parseFromTOM ( statusMessageReporting smr,
xDataTOM_element element,
MCGIDI_distribution distribution 
)

Definition at line 64 of file MCGIDI_energyAngular.cc.

64 {
65
66 xDataTOM_element *energyAngularElement;
67 char const *nativeData;
68
69 if( ( energyAngularElement = xDataTOME_getOneElementByName( smr, element, "energyAngular", 1 ) ) == NULL ) goto err;
70
71 if( ( nativeData = xDataTOM_getAttributesValueInElement( energyAngularElement, "nativeData" ) ) == NULL ) goto err;
72 if( strcmp( nativeData, "KalbachMann" ) == 0 ) {
73 return( MCGIDI_KalbachMann_parseFromTOM( smr, energyAngularElement, distribution ) ); }
74 else if( strcmp( nativeData, "linear" ) == 0 ) {
75 return( MCGIDI_energyAngular_linear_parseFromTOM( smr, energyAngularElement, distribution ) ); }
76 else {
77 smr_setReportError2( smr, smr_unknownID, 1, "energyAngular nativeData = '%s' not supported", nativeData );
78 goto err;
79 }
80
81 return( 0 );
82
83err:
84 return( 1 );
85}
int MCGIDI_KalbachMann_parseFromTOM(statusMessageReporting *smr, xDataTOM_element *element, MCGIDI_distribution *distribution)
#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_energyAngular_release()

int MCGIDI_energyAngular_release ( statusMessageReporting smr,
MCGIDI_energyAngular energyAngular 
)

Definition at line 48 of file MCGIDI_energyAngular.cc.

48 {
49
50 int i;
51
52 for( i = 0; i < energyAngular->pdfOfEpGivenE.numberOfWs; i++ ) {
54 }
55 smr_freeMemory( (void **) &(energyAngular->pdfOfMuGivenEAndEp) );
57 MCGIDI_energyAngular_initialize( smr, energyAngular );
58
59 return( 0 );
60}
int MCGIDI_sampling_pdfsOfXGivenW_release(statusMessageReporting *smr, MCGIDI_pdfsOfXGivenW *dists)
MCGIDI_pdfsOfXGivenW * pdfOfMuGivenEAndEp
Definition: MCGIDI.h:359
MCGIDI_pdfsOfXGivenW pdfOfEpGivenE
Definition: MCGIDI.h:358

Referenced by MCGIDI_energyAngular_free().

◆ MCGIDI_energyAngular_sampleDistribution()

int MCGIDI_energyAngular_sampleDistribution ( statusMessageReporting smr,
MCGIDI_distribution distribution,
MCGIDI_quantitiesLookupModes modes,
MCGIDI_decaySamplingInfo decaySamplingInfo 
)

Definition at line 180 of file MCGIDI_energyAngular.cc.

181 {
182
183 double Ep;
184 MCGIDI_energyAngular *energyAngular = distribution->energyAngular;
185
186 MCGIDI_sampling_doubleDistribution( smr, &(energyAngular->pdfOfEpGivenE), energyAngular->pdfOfMuGivenEAndEp, modes, decaySamplingInfo );
187 Ep = decaySamplingInfo->mu;
188 decaySamplingInfo->mu = decaySamplingInfo->Ep;
189 decaySamplingInfo->Ep = Ep;
190 decaySamplingInfo->frame = energyAngular->frame;
191
192 return( 0 );
193}
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:256
MCGIDI_energyAngular * energyAngular
Definition: MCGIDI.h:385
enum xDataTOM_frame frame
Definition: MCGIDI.h:357

Referenced by MCGIDI_outputChannel_sampleProductsAtE().