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] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /processes/hadronic/models/lend/src/MCGIDI_angularEnergy.cc (Version 11.3.0) and /processes/hadronic/models/lend/src/MCGIDI_angularEnergy.cc (Version 9.3.p2)


  1 /*                                                  1 
  2 # <<BEGIN-copyright>>                             
  3 # <<END-copyright>>                               
  4 */                                                
  5 #include <string.h>                               
  6                                                   
  7 #include "MCGIDI.h"                               
  8 #include "MCGIDI_fromTOM.h"                       
  9 #include "MCGIDI_misc.h"                          
 10 #include "MCGIDI_private.h"                       
 11                                                   
 12 #if defined __cplusplus                           
 13 namespace GIDI {                                  
 14 using namespace GIDI;                             
 15 #endif                                            
 16                                                   
 17 static int MCGIDI_angularEnergy_parsePointwise    
 18 /*                                                
 19 **********************************************    
 20 */                                                
 21 MCGIDI_angularEnergy *MCGIDI_angularEnergy_new    
 22                                                   
 23     MCGIDI_angularEnergy *angularEnergy;          
 24                                                   
 25     if( ( angularEnergy = (MCGIDI_angularEnerg    
 26     if( MCGIDI_angularEnergy_initialize( smr,     
 27     return( angularEnergy );                      
 28 }                                                 
 29 /*                                                
 30 **********************************************    
 31 */                                                
 32 int MCGIDI_angularEnergy_initialize( statusMes    
 33                                                   
 34     memset( angularEnergy, 0, sizeof( MCGIDI_a    
 35     return( 0 );                                  
 36 }                                                 
 37 /*                                                
 38 **********************************************    
 39 */                                                
 40 MCGIDI_angularEnergy *MCGIDI_angularEnergy_fre    
 41                                                   
 42     MCGIDI_angularEnergy_release( smr, angular    
 43     smr_freeMemory( (void **) &angularEnergy )    
 44     return( NULL );                               
 45 }                                                 
 46 /*                                                
 47 **********************************************    
 48 */                                                
 49 int MCGIDI_angularEnergy_release( statusMessag    
 50                                                   
 51     int i;                                        
 52                                                   
 53     for( i = 0; i < angularEnergy->pdfOfMuGive    
 54         MCGIDI_sampling_pdfsOfXGivenW_release(    
 55     }                                             
 56     smr_freeMemory( (void **) &(angularEnergy-    
 57     MCGIDI_sampling_pdfsOfXGivenW_release( smr    
 58     MCGIDI_angularEnergy_initialize( smr, angu    
 59                                                   
 60     return( 0 );                                  
 61 }                                                 
 62 /*                                                
 63 **********************************************    
 64 */                                                
 65 int MCGIDI_angularEnergy_parseFromTOM( statusM    
 66                                                   
 67     xDataTOM_element *angularEnergyElement, *p    
 68     char const *nativeData;                       
 69                                                   
 70     if( ( angularEnergyElement = xDataTOME_get    
 71                                                   
 72     if( ( nativeData = xDataTOM_getAttributesV    
 73     if( strcmp( nativeData, "pointwise" ) == 0    
 74         if( ( pointwise = xDataTOME_getOneElem    
 75     else if( strcmp( nativeData, "linear" ) ==    
 76         if( ( pointwise = xDataTOME_getOneElem    
 77     else {                                        
 78         smr_setReportError2( smr, smr_unknownI    
 79         goto err;                                 
 80     }                                             
 81     if( pointwise != NULL ) return( MCGIDI_ang    
 82                                                   
 83     return( 0 );                                  
 84                                                   
 85 err:                                              
 86     return( 1 );                                  
 87 }                                                 
 88 /*                                                
 89 **********************************************    
 90 */                                                
 91 static int MCGIDI_angularEnergy_parsePointwise    
 92                                                   
 93     int iV, iW;                                   
 94     double y, norm, energyInFactor;               
 95     char const *energyUnit, *energyOutProbabil    
 96     MCGIDI_angularEnergy *angularEnergy = NULL    
 97     ptwXY_interpolation interpolationXY, inter    
 98     xDataTOM_XYs *XYs;                            
 99     xDataTOM_W_XYs *W_XYs;                        
100     xDataTOM_V_W_XYs *V_W_XYs;                    
101     MCGIDI_pdfsOfXGivenW *pdfOfMuGivenE, *pdfO    
102     ptwXYPoints *pdfXY1 = NULL, *pdfXY2 = NULL    
103     nfu_status status;                            
104                                                   
105     if( MCGIDI_fromTOM_interpolation( smr, poi    
106     if( MCGIDI_fromTOM_interpolation( smr, poi    
107     if( MCGIDI_fromTOM_interpolation( smr, poi    
108     if( ( angularEnergy = MCGIDI_angularEnergy    
109                                                   
110     if( ( angularEnergy->frame = MCGIDI_misc_g    
111                                                   
112     pdfOfMuGivenE = &(angularEnergy->pdfOfMuGi    
113     pdfOfMuGivenE->interpolationWY = interpola    
114     pdfOfMuGivenE->interpolationXY = interpola    
115                                                   
116     if( ( V_W_XYs = (xDataTOM_V_W_XYs *) xData    
117     if( ( pdfOfMuGivenE->Ws = (double *) smr_m    
118     if( ( pdfOfMuGivenE->dist = (MCGIDI_pdfOfX    
119     if( ( pdfOfEpGivenEAndMu = (MCGIDI_pdfsOfX    
120                                                   
121     energyUnit = xDataTOM_subAxes_getUnit( smr    
122     if( !smr_isOk( smr ) ) goto err;              
123     energyInFactor = MCGIDI_misc_getUnitConver    
124     if( !smr_isOk( smr ) ) goto err;              
125                                                   
126     for( iV = 0; iV < V_W_XYs->length; iV++ )     
127         W_XYs = &(V_W_XYs->W_XYs[iV]);            
128         pdfOfEpGivenEAndMu2 = &(pdfOfEpGivenEA    
129         pdfOfEpGivenEAndMu2->interpolationWY =    
130         pdfOfEpGivenEAndMu2->interpolationXY =    
131         if( ( pdfXY2 = ptwXY_new( interpolatio    
132         if( ( pdfOfEpGivenEAndMu2->Ws = (doubl    
133         if( ( pdfOfEpGivenEAndMu2->dist = (MCG    
134         for( iW = 0; iW < W_XYs->length; iW++     
135             XYs = &(W_XYs->XYs[iW]);              
136             if( ( pdfXY1 =  MCGIDI_misc_dataFr    
137             y = ptwXY_integrateDomain( pdfXY1,    
138             if( ( status = ptwXY_setValueAtX(     
139                                                   
140             if( y == 0 ) {                        
141                 if( ( status = ptwXY_add_doubl    
142             }                                     
143             pdfOfEpGivenEAndMu2->Ws[iW] = XYs-    
144             if( MCGIDI_fromTOM_pdfOfX( smr, pd    
145             pdfOfEpGivenEAndMu2->numberOfWs++;    
146                                                   
147             pdfXY1 = ptwXY_free( pdfXY1 );        
148         }                                         
149         pdfOfMuGivenE->Ws[iV] = energyInFactor    
150         if( MCGIDI_fromTOM_pdfOfX( smr, pdfXY2    
151         pdfOfMuGivenE->numberOfWs++;              
152                                                   
153         pdfXY2 = ptwXY_free( pdfXY2 );            
154     }                                             
155                                                   
156     angularEnergy->pdfOfEpGivenEAndMu = pdfOfE    
157     distribution->angularEnergy = angularEnerg    
158     distribution->type = MCGIDI_distributionTy    
159                                                   
160     return( 0 );                                  
161                                                   
162 errA:                                             
163     smr_setReportError2( smr, smr_unknownID, 1    
164 err:                                              
165     if( pdfXY1 != NULL ) ptwXY_free( pdfXY1 );    
166     if( pdfXY2 != NULL ) ptwXY_free( pdfXY2 );    
167 /* Need to free pdfOfEpGivenEAndMu. */            
168     if( angularEnergy != NULL ) MCGIDI_angular    
169     return( 1 );                                  
170 }                                                 
171 /*                                                
172 **********************************************    
173 */                                                
174 int MCGIDI_angularEnergy_sampleDistribution( s    
175         MCGIDI_decaySamplingInfo *decaySamplin    
176                                                   
177     int status = MCGIDI_sampling_doubleDistrib    
178                                                   
179     decaySamplingInfo->frame = angularEnergy->    
180     return( status );                             
181 }                                                 
182                                                   
183 #if defined __cplusplus                           
184 }                                                 
185 #endif                                            
186                                                   
187