Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/examples/advanced/ChargeExchangeMC/src/CexmcASTEval.cc

Version: [ ReleaseNotes ] [ 1.0 ] [ 1.1 ] [ 2.0 ] [ 3.0 ] [ 3.1 ] [ 3.2 ] [ 4.0 ] [ 4.0.p1 ] [ 4.0.p2 ] [ 4.1 ] [ 4.1.p1 ] [ 5.0 ] [ 5.0.p1 ] [ 5.1 ] [ 5.1.p1 ] [ 5.2 ] [ 5.2.p1 ] [ 5.2.p2 ] [ 6.0 ] [ 6.0.p1 ] [ 6.1 ] [ 6.2 ] [ 6.2.p1 ] [ 6.2.p2 ] [ 7.0 ] [ 7.0.p1 ] [ 7.1 ] [ 7.1.p1 ] [ 8.0 ] [ 8.0.p1 ] [ 8.1 ] [ 8.1.p1 ] [ 8.1.p2 ] [ 8.2 ] [ 8.2.p1 ] [ 8.3 ] [ 8.3.p1 ] [ 8.3.p2 ] [ 9.0 ] [ 9.0.p1 ] [ 9.0.p2 ] [ 9.1 ] [ 9.1.p1 ] [ 9.1.p2 ] [ 9.1.p3 ] [ 9.2 ] [ 9.2.p1 ] [ 9.2.p2 ] [ 9.2.p3 ] [ 9.2.p4 ] [ 9.3 ] [ 9.3.p1 ] [ 9.3.p2 ] [ 9.4 ] [ 9.4.p1 ] [ 9.4.p2 ] [ 9.4.p3 ] [ 9.4.p4 ] [ 9.5 ] [ 9.5.p1 ] [ 9.5.p2 ] [ 9.6 ] [ 9.6.p1 ] [ 9.6.p2 ] [ 9.6.p3 ] [ 9.6.p4 ] [ 10.0 ] [ 10.0.p1 ] [ 10.0.p2 ] [ 10.0.p3 ] [ 10.0.p4 ] [ 10.1 ] [ 10.1.p1 ] [ 10.1.p2 ] [ 10.1.p3 ] [ 10.2 ] [ 10.2.p1 ] [ 10.2.p2 ] [ 10.2.p3 ] [ 10.3 ] [ 10.3.p1 ] [ 10.3.p2 ] [ 10.3.p3 ] [ 10.4 ] [ 10.4.p1 ] [ 10.4.p2 ] [ 10.4.p3 ] [ 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 /examples/advanced/ChargeExchangeMC/src/CexmcASTEval.cc (Version 11.3.0) and /examples/advanced/ChargeExchangeMC/src/CexmcASTEval.cc (Version 7.0)


  1 //                                                  1 
  2 // *******************************************    
  3 // * License and Disclaimer                       
  4 // *                                              
  5 // * The  Geant4 software  is  copyright of th    
  6 // * the Geant4 Collaboration.  It is provided    
  7 // * conditions of the Geant4 Software License    
  8 // * LICENSE and available at  http://cern.ch/    
  9 // * include a list of copyright holders.         
 10 // *                                              
 11 // * Neither the authors of this software syst    
 12 // * institutes,nor the agencies providing fin    
 13 // * work  make  any representation or  warran    
 14 // * regarding  this  software system or assum    
 15 // * use.  Please see the license in the file     
 16 // * for the full disclaimer and the limitatio    
 17 // *                                              
 18 // * This  code  implementation is the result     
 19 // * technical work of the GEANT4 collaboratio    
 20 // * By using,  copying,  modifying or  distri    
 21 // * any work based  on the software)  you  ag    
 22 // * use  in  resulting  scientific  publicati    
 23 // * acceptance of all terms of the Geant4 Sof    
 24 // *******************************************    
 25 //                                                
 26 /*                                                
 27  * ===========================================    
 28  *                                                
 29  *       Filename:  CexmcASTEval.cc               
 30  *                                                
 31  *    Description:  abstract syntax tree for c    
 32  *                                                
 33  *        Version:  1.0                           
 34  *        Created:  17.07.2010 15:46:01           
 35  *       Revision:  none                          
 36  *       Compiler:  gcc                           
 37  *                                                
 38  *         Author:  Alexey Radkov (),             
 39  *        Company:  PNPI                          
 40  *                                                
 41  * ===========================================    
 42  */                                               
 43                                                   
 44 #ifdef CEXMC_USE_CUSTOM_FILTER                    
 45                                                   
 46 #include <numeric>                                
 47 #include <boost/variant/get.hpp>                  
 48 #include <G4SystemOfUnits.hh>                     
 49 #include "CexmcASTEval.hh"                        
 50                                                   
 51                                                   
 52 namespace                                         
 53 {                                                 
 54     const std::string  CexmcCFVarEvent( "event    
 55     const std::string  CexmcCFVarOpCosThetaSCM    
 56     const std::string  CexmcCFVarEDT( "edt" );    
 57     const std::string  CexmcCFVarTPT( "tpt" );    
 58     const std::string  CexmcCFVarMon( "mon" );    
 59     const std::string  CexmcCFVarMonED( "monED    
 60     const std::string  CexmcCFVarVclED( "vclED    
 61     const std::string  CexmcCFVarVcrED( "vcrED    
 62     const std::string  CexmcCFVarClED( "clED"     
 63     const std::string  CexmcCFVarCrED( "crED"     
 64     const std::string  CexmcCFVarClEDCol( "clE    
 65     const std::string  CexmcCFVarCrEDCol( "crE    
 66     const std::string  CexmcCFVarBpMonPosL( "b    
 67     const std::string  CexmcCFVarBpMonPosW( "b    
 68     const std::string  CexmcCFVarBpMonDirL( "b    
 69     const std::string  CexmcCFVarBpMonDirW( "b    
 70     const std::string  CexmcCFVarBpMonMom( "bp    
 71     const std::string  CexmcCFVarBpMonTid( "bp    
 72     const std::string  CexmcCFVarBpTgtPosL( "b    
 73     const std::string  CexmcCFVarBpTgtPosW( "b    
 74     const std::string  CexmcCFVarBpTgtDirL( "b    
 75     const std::string  CexmcCFVarBpTgtDirW( "b    
 76     const std::string  CexmcCFVarBpTgtMom( "bp    
 77     const std::string  CexmcCFVarBpTgtTid( "bp    
 78     const std::string  CexmcCFVarOpTgtPosL( "o    
 79     const std::string  CexmcCFVarOpTgtPosW( "o    
 80     const std::string  CexmcCFVarOpTgtDirL( "o    
 81     const std::string  CexmcCFVarOpTgtDirW( "o    
 82     const std::string  CexmcCFVarOpTgtMom( "op    
 83     const std::string  CexmcCFVarOpTgtTid( "op    
 84     const std::string  CexmcCFVarNpTgtPosL( "n    
 85     const std::string  CexmcCFVarNpTgtPosW( "n    
 86     const std::string  CexmcCFVarNpTgtDirL( "n    
 87     const std::string  CexmcCFVarNpTgtDirW( "n    
 88     const std::string  CexmcCFVarNpTgtMom( "np    
 89     const std::string  CexmcCFVarNpTgtTid( "np    
 90     const std::string  CexmcCFVarOpdp1TgtPosL(    
 91     const std::string  CexmcCFVarOpdp1TgtPosW(    
 92     const std::string  CexmcCFVarOpdp1TgtDirL(    
 93     const std::string  CexmcCFVarOpdp1TgtDirW(    
 94     const std::string  CexmcCFVarOpdp1TgtMom(     
 95     const std::string  CexmcCFVarOpdp1TgtTid(     
 96     const std::string  CexmcCFVarOpdp2TgtPosL(    
 97     const std::string  CexmcCFVarOpdp2TgtPosW(    
 98     const std::string  CexmcCFVarOpdp2TgtDirL(    
 99     const std::string  CexmcCFVarOpdp2TgtDirW(    
100     const std::string  CexmcCFVarOpdp2TgtMom(     
101     const std::string  CexmcCFVarOpdp2TgtTid(     
102     const std::string  CexmcCFVarOpdpVclPosL(     
103     const std::string  CexmcCFVarOpdpVclPosW(     
104     const std::string  CexmcCFVarOpdpVclDirL(     
105     const std::string  CexmcCFVarOpdpVclDirW(     
106     const std::string  CexmcCFVarOpdpVclMom( "    
107     const std::string  CexmcCFVarOpdpVclTid( "    
108     const std::string  CexmcCFVarOpdpVcrPosL(     
109     const std::string  CexmcCFVarOpdpVcrPosW(     
110     const std::string  CexmcCFVarOpdpVcrDirL(     
111     const std::string  CexmcCFVarOpdpVcrDirW(     
112     const std::string  CexmcCFVarOpdpVcrMom( "    
113     const std::string  CexmcCFVarOpdpVcrTid( "    
114     const std::string  CexmcCFVarOpdpClPosL( "    
115     const std::string  CexmcCFVarOpdpClPosW( "    
116     const std::string  CexmcCFVarOpdpClDirL( "    
117     const std::string  CexmcCFVarOpdpClDirW( "    
118     const std::string  CexmcCFVarOpdpClMom( "o    
119     const std::string  CexmcCFVarOpdpClTid( "o    
120     const std::string  CexmcCFVarOpdpCrPosL( "    
121     const std::string  CexmcCFVarOpdpCrPosW( "    
122     const std::string  CexmcCFVarOpdpCrDirL( "    
123     const std::string  CexmcCFVarOpdpCrDirW( "    
124     const std::string  CexmcCFVarOpdpCrMom( "o    
125     const std::string  CexmcCFVarOpdpCrTid( "o    
126     const std::string  CexmcCFVarIpSCM( "ipSCM    
127     const std::string  CexmcCFVarIpLAB( "ipLAB    
128     const std::string  CexmcCFVarNpSCM( "npSCM    
129     const std::string  CexmcCFVarNpLAB( "npLAB    
130     const std::string  CexmcCFVarOpSCM( "opSCM    
131     const std::string  CexmcCFVarOpLAB( "opLAB    
132     const std::string  CexmcCFVarNopSCM( "nopS    
133     const std::string  CexmcCFVarNopLAB( "nopL    
134     const std::string  CexmcCFVarIpId( "ipId"     
135     const std::string  CexmcCFVarNpId( "npId"     
136     const std::string  CexmcCFVarOpId( "opId"     
137     const std::string  CexmcCFVarNopId( "nopId    
138     const std::string  CexmcCFVarConst_eV( "eV    
139     const std::string  CexmcCFVarConst_keV( "k    
140     const std::string  CexmcCFVarConst_MeV( "M    
141     const std::string  CexmcCFVarConst_GeV( "G    
142     const std::string  CexmcCFVarConst_mm( "mm    
143     const std::string  CexmcCFVarConst_cm( "cm    
144     const std::string  CexmcCFVarConst_m( "m"     
145 }                                                 
146                                                   
147                                                   
148 const G4double  CexmcASTEval::constants[] = {     
149                                                   
150                                                   
151 CexmcASTEval::CexmcASTEval( const CexmcEventFa    
152                             const CexmcEventSO    
153     evFastSObject( evFastSObject_ ), evSObject    
154 {                                                 
155 }                                                 
156                                                   
157                                                   
158 CexmcAST::BasicEval::ScalarValueType  CexmcAST    
159                                         const     
160 {                                                 
161     const CexmcAST::Function &  fun( boost::ge    
162                                                   
163                                                   
164     if ( fun == "Sum" )                           
165     {                                             
166         CexmcEnergyDepositCalorimeterCollectio    
167         GetEDCollectionValue( ast.children[ 0     
168                                                   
169         G4double  result( 0. );                   
170                                                   
171         for ( CexmcEnergyDepositCalorimeterCol    
172                                     k( edCol.b    
173         {                                         
174             result += std::accumulate( k->begi    
175         }                                         
176                                                   
177         return result;                            
178     }                                             
179                                                   
180     bool             evalResult( false );         
181     ScalarValueType  result( GetBasicFunScalar    
182                                                   
183     if ( evalResult )                             
184         return result;                            
185                                                   
186     throw CexmcException( CexmcCFUnexpectedFun    
187                                                   
188     return 0;                                     
189 }                                                 
190                                                   
191                                                   
192 CexmcAST::BasicEval::ScalarValueType  CexmcAST    
193                                         const     
194 {                                                 
195     if ( evFastSObject == NULL || evSObject ==    
196         throw CexmcException( CexmcCFUninitial    
197                                                   
198     /* Variables with initialized address */      
199                                                   
200     /* bound to CexmcAST::Variable:addr */        
201                                                   
202     const double * const *  addr( boost::get<     
203                                                   
204     if ( addr )                                   
205     {                                             
206         if ( *addr )                              
207             return **addr;                        
208     }                                             
209     else                                          
210     {                                             
211         const int * const &  addr_( boost::get    
212                                                   
213         if ( addr_ )                              
214             return *addr_;                        
215     }                                             
216                                                   
217     /* found in varAddrMap */                     
218                                                   
219     VarAddrMap::const_iterator  found( varAddr    
220                                                   
221     if ( found != varAddrMap.end() )              
222     {                                             
223         const CexmcEnergyDepositCalorimeterCol    
224                 boost::get< const CexmcEnergyD    
225                                                   
226         if ( addr_ )                              
227         {                                         
228             if ( *addr_ )                         
229             {                                     
230                 if ( ( *addr_ )->size() == 0 )    
231                     throw CexmcException( Cexm    
232                 if ( var.index1 == 0 || var.in    
233                     throw CexmcException( Cexm    
234                 return ( *addr_ )->at( var.ind    
235             }                                     
236         }                                         
237         else                                      
238         {                                         
239             const bool * const &  addr__( boos    
240                                                   
241             if ( addr__ )                         
242                 return int( *addr__ );            
243         }                                         
244     }                                             
245                                                   
246     /* Variables without address */               
247                                                   
248     if ( var.name == CexmcCFVarTPT )              
249     {                                             
250         return int( evSObject->targetTPOutputP    
251                     CexmcInvalidTrackId );        
252     }                                             
253                                                   
254     throw CexmcException( CexmcCFUnexpectedVar    
255                                                   
256     return 0;                                     
257 }                                                 
258                                                   
259                                                   
260 void  CexmcASTEval::GetEDCollectionValue( cons    
261                         CexmcEnergyDepositCalo    
262 {                                                 
263     if ( evSObject == NULL )                      
264         throw CexmcException( CexmcCFUninitial    
265                                                   
266     const CexmcAST::Subtree *  ast( boost::get    
267                                                   
268     if ( ast )                                    
269     {                                             
270         const CexmcAST::Function &  fun( boost    
271                                                   
272                                                   
273         if ( fun == "Inner" )                     
274         {                                         
275             GetEDCollectionValue( ast->childre    
276             edCol.pop_back();                     
277             edCol.erase( edCol.begin() );         
278             for ( CexmcEnergyDepositCalorimete    
279                             k( edCol.begin() )    
280             {                                     
281                 k->pop_back();                    
282                 k->erase( k->begin() );           
283             }                                     
284             return;                               
285         }                                         
286         if ( fun == "Outer" )                     
287         {                                         
288             GetEDCollectionValue( ast->childre    
289             if ( edCol.size() < 3 )               
290                 return;                           
291             for ( CexmcEnergyDepositCalorimete    
292                             k( edCol.begin() +    
293             {                                     
294                 if ( k->size() < 3 )              
295                     continue;                     
296                 k->erase( k->begin() + 1, k->e    
297             }                                     
298             return;                               
299         }                                         
300     }                                             
301     else                                          
302     {                                             
303         const CexmcAST::Leaf &      leaf( boos    
304                                                   
305         const CexmcAST::Variable &  var( boost    
306                                                   
307                                                   
308         if ( var.index1 != 0 || var.index2 !=     
309             throw CexmcException( CexmcCFUnexp    
310                                                   
311         VarAddrMap::const_iterator  found( var    
312                                                   
313         if ( found == varAddrMap.end() )          
314             throw CexmcException( CexmcCFUnexp    
315                                                   
316         const CexmcEnergyDepositCalorimeterCol    
317                 boost::get< const CexmcEnergyD    
318                                                   
319         if ( ! addr )                             
320         {                                         
321             throw CexmcException( CexmcCFUnexp    
322         }                                         
323         else                                      
324         {                                         
325             if ( *addr )                          
326                 edCol = **addr;                   
327             return;                               
328         }                                         
329     }                                             
330 }                                                 
331                                                   
332                                                   
333 void  CexmcASTEval::BindAddresses( CexmcAST::S    
334 {                                                 
335     if ( evFastSObject == NULL || evSObject ==    
336         return;                                   
337                                                   
338     for ( std::vector< CexmcAST::Node >::itera    
339                                                   
340     {                                             
341         CexmcAST::Subtree *  subtree( boost::g    
342                                                   
343         if ( subtree )                            
344         {                                         
345             BindAddresses( *subtree );            
346         }                                         
347         else                                      
348         {                                         
349             CexmcAST::Leaf &      leaf( boost:    
350             CexmcAST::Variable *  var( boost::    
351                                                   
352             if ( ! var )                          
353                 continue;                         
354                                                   
355             const int * const *   intVarAddr(     
356                                     boost::get    
357             if ( intVarAddr )                     
358             {                                     
359                 if ( *intVarAddr )                
360                     continue;                     
361             }                                     
362             else                                  
363             {                                     
364                 const double * const &  double    
365                                     boost::get    
366                 if ( doubleVarAddr )              
367                     continue;                     
368             }                                     
369                                                   
370             VarAddrMap::const_iterator  found(    
371                                                   
372             if ( found != varAddrMap.end() )      
373                 continue;                         
374                                                   
375             do                                    
376             {                                     
377                 if ( var->name == CexmcCFVarEv    
378                 {                                 
379                     var->addr = &evFastSObject    
380                     break;                        
381                 }                                 
382                 if ( var->name == CexmcCFVarOp    
383                 {                                 
384                     var->addr = &evFastSObject    
385                     break;                        
386                 }                                 
387                 if ( var->name == CexmcCFVarED    
388                 {                                 
389                     varAddrMap.insert( VarAddr    
390                                    &evFastSObj    
391                     break;                        
392                 }                                 
393                 if ( var->name == CexmcCFVarMo    
394                 {                                 
395                     varAddrMap.insert( VarAddr    
396                            &evFastSObject->edD    
397                     break;                        
398                 }                                 
399                 if ( var->name == CexmcCFVarMo    
400                 {                                 
401                     var->addr = &evSObject->mo    
402                     break;                        
403                 }                                 
404                 if ( var->name == CexmcCFVarVc    
405                 {                                 
406                     var->addr = &evSObject->ve    
407                     break;                        
408                 }                                 
409                 if ( var->name == CexmcCFVarVc    
410                 {                                 
411                     var->addr = &evSObject->ve    
412                     break;                        
413                 }                                 
414                 if ( var->name == CexmcCFVarCl    
415                 {                                 
416                     var->addr = &evSObject->ca    
417                     break;                        
418                 }                                 
419                 if ( var->name == CexmcCFVarCr    
420                 {                                 
421                     var->addr = &evSObject->ca    
422                     break;                        
423                 }                                 
424                 if ( var->name == CexmcCFVarCl    
425                 {                                 
426                     varAddrMap.insert( VarAddr    
427                                 &evSObject->ca    
428                     break;                        
429                 }                                 
430                 if ( var->name == CexmcCFVarCr    
431                 {                                 
432                     varAddrMap.insert( VarAddr    
433                                 &evSObject->ca    
434                     break;                        
435                 }                                 
436                 if ( var->name == CexmcCFVarBp    
437                 {                                 
438                     var->addr = GetThreeVector    
439                             evSObject->monitor    
440                     break;                        
441                 }                                 
442                 if ( var->name == CexmcCFVarBp    
443                 {                                 
444                     var->addr = GetThreeVector    
445                             evSObject->monitor    
446                     break;                        
447                 }                                 
448                 if ( var->name == CexmcCFVarBp    
449                 {                                 
450                     var->addr = GetThreeVector    
451                             evSObject->monitor    
452                     break;                        
453                 }                                 
454                 if ( var->name == CexmcCFVarBp    
455                 {                                 
456                     var->addr = GetThreeVector    
457                             evSObject->monitor    
458                     break;                        
459                 }                                 
460                 if ( var->name == CexmcCFVarBp    
461                 {                                 
462                     var->addr = &evSObject->mo    
463                     break;                        
464                 }                                 
465                 if ( var->name == CexmcCFVarBp    
466                 {                                 
467                     var->addr = &evSObject->mo    
468                     break;                        
469                 }                                 
470                 if ( var->name == CexmcCFVarBp    
471                 {                                 
472                     var->addr = GetThreeVector    
473                             evSObject->targetT    
474                             var->index1 );        
475                     break;                        
476                 }                                 
477                 if ( var->name == CexmcCFVarBp    
478                 {                                 
479                     var->addr = GetThreeVector    
480                             evSObject->targetT    
481                             var->index1 );        
482                     break;                        
483                 }                                 
484                 if ( var->name == CexmcCFVarBp    
485                 {                                 
486                     var->addr = GetThreeVector    
487                             evSObject->targetT    
488                             var->index1 );        
489                     break;                        
490                 }                                 
491                 if ( var->name == CexmcCFVarBp    
492                 {                                 
493                     var->addr = GetThreeVector    
494                             evSObject->targetT    
495                             var->index1 );        
496                     break;                        
497                 }                                 
498                 if ( var->name == CexmcCFVarBp    
499                 {                                 
500                     var->addr = &evSObject->ta    
501                     break;                        
502                 }                                 
503                 if ( var->name == CexmcCFVarBp    
504                 {                                 
505                     var->addr = &evSObject->ta    
506                     break;                        
507                 }                                 
508                 if ( var->name == CexmcCFVarOp    
509                 {                                 
510                     var->addr = GetThreeVector    
511                             evSObject->targetT    
512                             var->index1 );        
513                     break;                        
514                 }                                 
515                 if ( var->name == CexmcCFVarOp    
516                 {                                 
517                     var->addr = GetThreeVector    
518                             evSObject->targetT    
519                             var->index1 );        
520                     break;                        
521                 }                                 
522                 if ( var->name == CexmcCFVarOp    
523                 {                                 
524                     var->addr = GetThreeVector    
525                             evSObject->targetT    
526                             var->index1 );        
527                     break;                        
528                 }                                 
529                 if ( var->name == CexmcCFVarOp    
530                 {                                 
531                     var->addr = GetThreeVector    
532                             evSObject->targetT    
533                             var->index1 );        
534                     break;                        
535                 }                                 
536                 if ( var->name == CexmcCFVarOp    
537                 {                                 
538                     var->addr = &evSObject->ta    
539                     break;                        
540                 }                                 
541                 if ( var->name == CexmcCFVarOp    
542                 {                                 
543                     var->addr = &evSObject->ta    
544                     break;                        
545                 }                                 
546                 if ( var->name == CexmcCFVarNp    
547                 {                                 
548                     var->addr = GetThreeVector    
549                             evSObject->targetT    
550                             var->index1 );        
551                     break;                        
552                 }                                 
553                 if ( var->name == CexmcCFVarNp    
554                 {                                 
555                     var->addr = GetThreeVector    
556                             evSObject->targetT    
557                             var->index1 );        
558                     break;                        
559                 }                                 
560                 if ( var->name == CexmcCFVarNp    
561                 {                                 
562                     var->addr = GetThreeVector    
563                             evSObject->targetT    
564                             var->index1 );        
565                     break;                        
566                 }                                 
567                 if ( var->name == CexmcCFVarNp    
568                 {                                 
569                     var->addr = GetThreeVector    
570                             evSObject->targetT    
571                             var->index1 );        
572                     break;                        
573                 }                                 
574                 if ( var->name == CexmcCFVarNp    
575                 {                                 
576                     var->addr = &evSObject->ta    
577                     break;                        
578                 }                                 
579                 if ( var->name == CexmcCFVarNp    
580                 {                                 
581                     var->addr = &evSObject->ta    
582                     break;                        
583                 }                                 
584                 if ( var->name == CexmcCFVarOp    
585                 {                                 
586                     var->addr = GetThreeVector    
587                         evSObject->targetTPOut    
588                                                   
589                         var->index1 );            
590                     break;                        
591                 }                                 
592                 if ( var->name == CexmcCFVarOp    
593                 {                                 
594                     var->addr = GetThreeVector    
595                         evSObject->targetTPOut    
596                                                   
597                         var->index1 );            
598                     break;                        
599                 }                                 
600                 if ( var->name == CexmcCFVarOp    
601                 {                                 
602                     var->addr = GetThreeVector    
603                         evSObject->targetTPOut    
604                                                   
605                         var->index1 );            
606                     break;                        
607                 }                                 
608                 if ( var->name == CexmcCFVarOp    
609                 {                                 
610                     var->addr = GetThreeVector    
611                         evSObject->targetTPOut    
612                                                   
613                         var->index1 );            
614                     break;                        
615                 }                                 
616                 if ( var->name == CexmcCFVarOp    
617                 {                                 
618                     var->addr = &evSObject->      
619                         targetTPOutputParticle    
620                     break;                        
621                 }                                 
622                 if ( var->name == CexmcCFVarOp    
623                 {                                 
624                     var->addr = &evSObject->      
625                         targetTPOutputParticle    
626                     break;                        
627                 }                                 
628                 if ( var->name == CexmcCFVarOp    
629                 {                                 
630                     var->addr = GetThreeVector    
631                         evSObject->targetTPOut    
632                                                   
633                         var->index1 );            
634                     break;                        
635                 }                                 
636                 if ( var->name == CexmcCFVarOp    
637                 {                                 
638                     var->addr = GetThreeVector    
639                         evSObject->targetTPOut    
640                                                   
641                         var->index1 );            
642                     break;                        
643                 }                                 
644                 if ( var->name == CexmcCFVarOp    
645                 {                                 
646                     var->addr = GetThreeVector    
647                         evSObject->targetTPOut    
648                                                   
649                         var->index1 );            
650                     break;                        
651                 }                                 
652                 if ( var->name == CexmcCFVarOp    
653                 {                                 
654                     var->addr = GetThreeVector    
655                         evSObject->targetTPOut    
656                                                   
657                         var->index1 );            
658                     break;                        
659                 }                                 
660                 if ( var->name == CexmcCFVarOp    
661                 {                                 
662                     var->addr = &evSObject->      
663                         targetTPOutputParticle    
664                     break;                        
665                 }                                 
666                 if ( var->name == CexmcCFVarOp    
667                 {                                 
668                     var->addr = &evSObject->      
669                         targetTPOutputParticle    
670                     break;                        
671                 }                                 
672                 if ( var->name == CexmcCFVarOp    
673                 {                                 
674                     var->addr = GetThreeVector    
675                             evSObject->vetoCou    
676                             var->index1 );        
677                     break;                        
678                 }                                 
679                 if ( var->name == CexmcCFVarOp    
680                 {                                 
681                     var->addr = GetThreeVector    
682                             evSObject->vetoCou    
683                             var->index1 );        
684                     break;                        
685                 }                                 
686                 if ( var->name == CexmcCFVarOp    
687                 {                                 
688                     var->addr = GetThreeVector    
689                             evSObject->vetoCou    
690                             var->index1 );        
691                     break;                        
692                 }                                 
693                 if ( var->name == CexmcCFVarOp    
694                 {                                 
695                     var->addr = GetThreeVector    
696                             evSObject->vetoCou    
697                             var->index1 );        
698                     break;                        
699                 }                                 
700                 if ( var->name == CexmcCFVarOp    
701                 {                                 
702                     var->addr = &evSObject->ve    
703                     break;                        
704                 }                                 
705                 if ( var->name == CexmcCFVarOp    
706                 {                                 
707                     var->addr = &evSObject->ve    
708                     break;                        
709                 }                                 
710                 if ( var->name == CexmcCFVarOp    
711                 {                                 
712                     var->addr = GetThreeVector    
713                             evSObject->vetoCou    
714                             var->index1 );        
715                     break;                        
716                 }                                 
717                 if ( var->name == CexmcCFVarOp    
718                 {                                 
719                     var->addr = GetThreeVector    
720                             evSObject->vetoCou    
721                             var->index1 );        
722                     break;                        
723                 }                                 
724                 if ( var->name == CexmcCFVarOp    
725                 {                                 
726                     var->addr = GetThreeVector    
727                             evSObject->vetoCou    
728                             var->index1 );        
729                     break;                        
730                 }                                 
731                 if ( var->name == CexmcCFVarOp    
732                 {                                 
733                     var->addr = GetThreeVector    
734                             evSObject->vetoCou    
735                             var->index1 );        
736                     break;                        
737                 }                                 
738                 if ( var->name == CexmcCFVarOp    
739                 {                                 
740                     var->addr = &evSObject->ve    
741                     break;                        
742                 }                                 
743                 if ( var->name == CexmcCFVarOp    
744                 {                                 
745                     var->addr = &evSObject->ve    
746                     break;                        
747                 }                                 
748                 if ( var->name == CexmcCFVarOp    
749                 {                                 
750                     var->addr = GetThreeVector    
751                             evSObject->calorim    
752                             var->index1 );        
753                     break;                        
754                 }                                 
755                 if ( var->name == CexmcCFVarOp    
756                 {                                 
757                     var->addr = GetThreeVector    
758                             evSObject->calorim    
759                             var->index1 );        
760                     break;                        
761                 }                                 
762                 if ( var->name == CexmcCFVarOp    
763                 {                                 
764                     var->addr = GetThreeVector    
765                             evSObject->calorim    
766                             var->index1 );        
767                     break;                        
768                 }                                 
769                 if ( var->name == CexmcCFVarOp    
770                 {                                 
771                     var->addr = GetThreeVector    
772                             evSObject->calorim    
773                             var->index1 );        
774                     break;                        
775                 }                                 
776                 if ( var->name == CexmcCFVarOp    
777                 {                                 
778                     var->addr = &evSObject->ca    
779                     break;                        
780                 }                                 
781                 if ( var->name == CexmcCFVarOp    
782                 {                                 
783                     var->addr = &evSObject->ca    
784                     break;                        
785                 }                                 
786                 if ( var->name == CexmcCFVarOp    
787                 {                                 
788                     var->addr = GetThreeVector    
789                             evSObject->calorim    
790                             var->index1 );        
791                     break;                        
792                 }                                 
793                 if ( var->name == CexmcCFVarOp    
794                 {                                 
795                     var->addr = GetThreeVector    
796                             evSObject->calorim    
797                             var->index1 );        
798                     break;                        
799                 }                                 
800                 if ( var->name == CexmcCFVarOp    
801                 {                                 
802                     var->addr = GetThreeVector    
803                             evSObject->calorim    
804                             var->index1 );        
805                     break;                        
806                 }                                 
807                 if ( var->name == CexmcCFVarOp    
808                 {                                 
809                     var->addr = GetThreeVector    
810                             evSObject->calorim    
811                             var->index1 );        
812                     break;                        
813                 }                                 
814                 if ( var->name == CexmcCFVarOp    
815                 {                                 
816                     var->addr = &evSObject->ca    
817                     break;                        
818                 }                                 
819                 if ( var->name == CexmcCFVarOp    
820                 {                                 
821                     var->addr = &evSObject->ca    
822                     break;                        
823                 }                                 
824                 if ( var->name == CexmcCFVarIp    
825                 {                                 
826                     var->addr = GetLorentzVect    
827                         evSObject->productionM    
828                         var->index1 );            
829                     break;                        
830                 }                                 
831                 if ( var->name == CexmcCFVarIp    
832                 {                                 
833                     var->addr = GetLorentzVect    
834                         evSObject->productionM    
835                         var->index1 );            
836                     break;                        
837                 }                                 
838                 if ( var->name == CexmcCFVarNp    
839                 {                                 
840                     var->addr = GetLorentzVect    
841                         evSObject->productionM    
842                         var->index1 );            
843                     break;                        
844                 }                                 
845                 if ( var->name == CexmcCFVarNp    
846                 {                                 
847                     var->addr = GetLorentzVect    
848                         evSObject->productionM    
849                         var->index1 );            
850                     break;                        
851                 }                                 
852                 if ( var->name == CexmcCFVarOp    
853                 {                                 
854                     var->addr = GetLorentzVect    
855                         evSObject->productionM    
856                         var->index1 );            
857                     break;                        
858                 }                                 
859                 if ( var->name == CexmcCFVarOp    
860                 {                                 
861                     var->addr = GetLorentzVect    
862                         evSObject->productionM    
863                         var->index1 );            
864                     break;                        
865                 }                                 
866                 if ( var->name == CexmcCFVarNo    
867                 {                                 
868                     var->addr = GetLorentzVect    
869                         evSObject->productionM    
870                         var->index1 );            
871                     break;                        
872                 }                                 
873                 if ( var->name == CexmcCFVarNo    
874                 {                                 
875                     var->addr = GetLorentzVect    
876                         evSObject->productionM    
877                         var->index1 );            
878                     break;                        
879                 }                                 
880                 if ( var->name == CexmcCFVarIp    
881                 {                                 
882                     var->addr =                   
883                         &evSObject->production    
884                     break;                        
885                 }                                 
886                 if ( var->name == CexmcCFVarNp    
887                 {                                 
888                     var->addr = &evSObject->pr    
889                     break;                        
890                 }                                 
891                 if ( var->name == CexmcCFVarOp    
892                 {                                 
893                     var->addr = &evSObject->pr    
894                     break;                        
895                 }                                 
896                 if ( var->name == CexmcCFVarNo    
897                 {                                 
898                     var->addr =                   
899                         &evSObject->production    
900                     break;                        
901                 }                                 
902                 if ( var->name == CexmcCFVarCo    
903                 {                                 
904                     var->addr = &constants[ 0     
905                     break;                        
906                 }                                 
907                 if ( var->name == CexmcCFVarCo    
908                 {                                 
909                     var->addr = &constants[ 1     
910                     break;                        
911                 }                                 
912                 if ( var->name == CexmcCFVarCo    
913                 {                                 
914                     var->addr = &constants[ 2     
915                     break;                        
916                 }                                 
917                 if ( var->name == CexmcCFVarCo    
918                 {                                 
919                     var->addr = &constants[ 3     
920                     break;                        
921                 }                                 
922                 if ( var->name == CexmcCFVarCo    
923                 {                                 
924                     var->addr = &constants[ 4     
925                     break;                        
926                 }                                 
927                 if ( var->name == CexmcCFVarCo    
928                 {                                 
929                     var->addr = &constants[ 5     
930                     break;                        
931                 }                                 
932                 if ( var->name == CexmcCFVarCo    
933                 {                                 
934                     var->addr = &constants[ 6     
935                     break;                        
936                 }                                 
937             } while ( false );                    
938         }                                         
939     }                                             
940 }                                                 
941                                                   
942                                                   
943 void  CexmcASTEval::ResetAddressBinding( Cexmc    
944 {                                                 
945     for ( std::vector< CexmcAST::Node >::itera    
946                                                   
947     {                                             
948         CexmcAST::Subtree *  subtree( boost::g    
949                                                   
950         if ( subtree )                            
951         {                                         
952             ResetAddressBinding( *subtree );      
953         }                                         
954         else                                      
955         {                                         
956             CexmcAST::Leaf &      leaf( boost:    
957             CexmcAST::Variable *  var( boost::    
958                                                   
959             if ( var )                            
960                 var->addr = ( const int * ) NU    
961         }                                         
962     }                                             
963 }                                                 
964                                                   
965 #endif                                            
966                                                   
967