44 #ifdef CEXMC_USE_CUSTOM_FILTER 
   47 #include <boost/variant/get.hpp> 
   53     const std::string  CexmcCFVarEvent( 
"event" );
 
   54     const std::string  CexmcCFVarOpCosThetaSCM( 
"op_cosTh_SCM" );
 
   55     const std::string  CexmcCFVarEDT( 
"edt" );
 
   56     const std::string  CexmcCFVarTPT( 
"tpt" );
 
   57     const std::string  CexmcCFVarMon( 
"mon" );
 
   58     const std::string  CexmcCFVarMonED( 
"monED" );
 
   59     const std::string  CexmcCFVarVclED( 
"vclED" );
 
   60     const std::string  CexmcCFVarVcrED( 
"vcrED" );
 
   61     const std::string  CexmcCFVarClED( 
"clED" );
 
   62     const std::string  CexmcCFVarCrED( 
"crED" );
 
   63     const std::string  CexmcCFVarClEDCol( 
"clEDcol" );
 
   64     const std::string  CexmcCFVarCrEDCol( 
"crEDcol" );
 
   65     const std::string  CexmcCFVarBpMonPosL( 
"bp_mon_posl" );
 
   66     const std::string  CexmcCFVarBpMonPosW( 
"bp_mon_posw" );
 
   67     const std::string  CexmcCFVarBpMonDirL( 
"bp_mon_dirl" );
 
   68     const std::string  CexmcCFVarBpMonDirW( 
"bp_mon_dirw" );
 
   69     const std::string  CexmcCFVarBpMonMom( 
"bp_mon_mom" );
 
   70     const std::string  CexmcCFVarBpMonTid( 
"bp_mon_tid" );
 
   71     const std::string  CexmcCFVarBpTgtPosL( 
"bp_tgt_posl" );
 
   72     const std::string  CexmcCFVarBpTgtPosW( 
"bp_tgt_posw" );
 
   73     const std::string  CexmcCFVarBpTgtDirL( 
"bp_tgt_dirl" );
 
   74     const std::string  CexmcCFVarBpTgtDirW( 
"bp_tgt_dirw" );
 
   75     const std::string  CexmcCFVarBpTgtMom( 
"bp_tgt_mom" );
 
   76     const std::string  CexmcCFVarBpTgtTid( 
"bp_tgt_tid" );
 
   77     const std::string  CexmcCFVarOpTgtPosL( 
"op_tgt_posl" );
 
   78     const std::string  CexmcCFVarOpTgtPosW( 
"op_tgt_posw" );
 
   79     const std::string  CexmcCFVarOpTgtDirL( 
"op_tgt_dirl" );
 
   80     const std::string  CexmcCFVarOpTgtDirW( 
"op_tgt_dirw" );
 
   81     const std::string  CexmcCFVarOpTgtMom( 
"op_tgt_mom" );
 
   82     const std::string  CexmcCFVarOpTgtTid( 
"op_tgt_tid" );
 
   83     const std::string  CexmcCFVarNpTgtPosL( 
"np_tgt_posl" );
 
   84     const std::string  CexmcCFVarNpTgtPosW( 
"np_tgt_posw" );
 
   85     const std::string  CexmcCFVarNpTgtDirL( 
"np_tgt_dirl" );
 
   86     const std::string  CexmcCFVarNpTgtDirW( 
"np_tgt_dirw" );
 
   87     const std::string  CexmcCFVarNpTgtMom( 
"np_tgt_mom" );
 
   88     const std::string  CexmcCFVarNpTgtTid( 
"np_tgt_tid" );
 
   89     const std::string  CexmcCFVarOpdp1TgtPosL( 
"opdp1_tgt_posl" );
 
   90     const std::string  CexmcCFVarOpdp1TgtPosW( 
"opdp1_tgt_posw" );
 
   91     const std::string  CexmcCFVarOpdp1TgtDirL( 
"opdp1_tgt_dirl" );
 
   92     const std::string  CexmcCFVarOpdp1TgtDirW( 
"opdp1_tgt_dirw" );
 
   93     const std::string  CexmcCFVarOpdp1TgtMom( 
"opdp1_tgt_mom" );
 
   94     const std::string  CexmcCFVarOpdp1TgtTid( 
"opdp1_tgt_tid" );
 
   95     const std::string  CexmcCFVarOpdp2TgtPosL( 
"opdp2_tgt_posl" );
 
   96     const std::string  CexmcCFVarOpdp2TgtPosW( 
"opdp2_tgt_posw" );
 
   97     const std::string  CexmcCFVarOpdp2TgtDirL( 
"opdp2_tgt_dirl" );
 
   98     const std::string  CexmcCFVarOpdp2TgtDirW( 
"opdp2_tgt_dirw" );
 
   99     const std::string  CexmcCFVarOpdp2TgtMom( 
"opdp2_tgt_mom" );
 
  100     const std::string  CexmcCFVarOpdp2TgtTid( 
"opdp2_tgt_tid" );
 
  101     const std::string  CexmcCFVarOpdpVclPosL( 
"opdp_vcl_posl" );
 
  102     const std::string  CexmcCFVarOpdpVclPosW( 
"opdp_vcl_posw" );
 
  103     const std::string  CexmcCFVarOpdpVclDirL( 
"opdp_vcl_dirl" );
 
  104     const std::string  CexmcCFVarOpdpVclDirW( 
"opdp_vcl_dirw" );
 
  105     const std::string  CexmcCFVarOpdpVclMom( 
"opdp_vcl_mom" );
 
  106     const std::string  CexmcCFVarOpdpVclTid( 
"opdp_vcl_tid" );
 
  107     const std::string  CexmcCFVarOpdpVcrPosL( 
"opdp_vcr_posl" );
 
  108     const std::string  CexmcCFVarOpdpVcrPosW( 
"opdp_vcr_posw" );
 
  109     const std::string  CexmcCFVarOpdpVcrDirL( 
"opdp_vcr_dirl" );
 
  110     const std::string  CexmcCFVarOpdpVcrDirW( 
"opdp_vcr_dirw" );
 
  111     const std::string  CexmcCFVarOpdpVcrMom( 
"opdp_vcr_mom" );
 
  112     const std::string  CexmcCFVarOpdpVcrTid( 
"opdp_vcr_tid" );
 
  113     const std::string  CexmcCFVarOpdpClPosL( 
"opdp_cl_posl" );
 
  114     const std::string  CexmcCFVarOpdpClPosW( 
"opdp_cl_posw" );
 
  115     const std::string  CexmcCFVarOpdpClDirL( 
"opdp_cl_dirl" );
 
  116     const std::string  CexmcCFVarOpdpClDirW( 
"opdp_cl_dirw" );
 
  117     const std::string  CexmcCFVarOpdpClMom( 
"opdp_cl_mom" );
 
  118     const std::string  CexmcCFVarOpdpClTid( 
"opdp_cl_tid" );
 
  119     const std::string  CexmcCFVarOpdpCrPosL( 
"opdp_cr_posl" );
 
  120     const std::string  CexmcCFVarOpdpCrPosW( 
"opdp_cr_posw" );
 
  121     const std::string  CexmcCFVarOpdpCrDirL( 
"opdp_cr_dirl" );
 
  122     const std::string  CexmcCFVarOpdpCrDirW( 
"opdp_cr_dirw" );
 
  123     const std::string  CexmcCFVarOpdpCrMom( 
"opdp_cr_mom" );
 
  124     const std::string  CexmcCFVarOpdpCrTid( 
"opdp_cr_tid" );
 
  125     const std::string  CexmcCFVarIpSCM( 
"ipSCM" );
 
  126     const std::string  CexmcCFVarIpLAB( 
"ipLAB" );
 
  127     const std::string  CexmcCFVarNpSCM( 
"npSCM" );
 
  128     const std::string  CexmcCFVarNpLAB( 
"npLAB" );
 
  129     const std::string  CexmcCFVarOpSCM( 
"opSCM" );
 
  130     const std::string  CexmcCFVarOpLAB( 
"opLAB" );
 
  131     const std::string  CexmcCFVarNopSCM( 
"nopSCM" );
 
  132     const std::string  CexmcCFVarNopLAB( 
"nopLAB" );
 
  133     const std::string  CexmcCFVarIpId( 
"ipId" );
 
  134     const std::string  CexmcCFVarNpId( 
"npId" );
 
  135     const std::string  CexmcCFVarOpId( 
"opId" );
 
  136     const std::string  CexmcCFVarNopId( 
"nopId" );
 
  137     const std::string  CexmcCFVarConst_eV( 
"eV" );
 
  138     const std::string  CexmcCFVarConst_keV( 
"keV" );
 
  139     const std::string  CexmcCFVarConst_MeV( 
"MeV" );
 
  140     const std::string  CexmcCFVarConst_GeV( 
"GeV" );
 
  141     const std::string  CexmcCFVarConst_mm( 
"mm" );
 
  142     const std::string  CexmcCFVarConst_cm( 
"cm" );
 
  143     const std::string  CexmcCFVarConst_m( 
"m" );
 
  150 CexmcASTEval::CexmcASTEval( 
const CexmcEventFastSObject *  evFastSObject,
 
  151                             const CexmcEventSObject *  evSObject ) :
 
  152     evFastSObject( evFastSObject ), evSObject( evSObject )
 
  157 CexmcAST::BasicEval::ScalarValueType  CexmcASTEval::GetFunScalarValue(
 
  158                                         const CexmcAST::Subtree &  ast )
 const 
  160     const CexmcAST::Function &  fun( boost::get< CexmcAST::Function >(
 
  166         GetEDCollectionValue( ast.children[ 0 ], edCol );
 
  170         for ( CexmcEnergyDepositCalorimeterCollection::iterator
 
  171                                     k( edCol.begin() ); k != edCol.end(); ++k )
 
  173             result += std::accumulate( k->begin(), k->end(), 
G4double( 0. ) );
 
  179     bool             evalResult( 
false );
 
  180     ScalarValueType  result( GetBasicFunScalarValue( ast, evalResult ) );
 
  191 CexmcAST::BasicEval::ScalarValueType  CexmcASTEval::GetVarScalarValue(
 
  192                                         const CexmcAST::Variable &  
var )
 const 
  194     if ( evFastSObject == NULL || evSObject == NULL )
 
  201     const double * 
const *  addr( boost::get< const double * >( &var.addr ) );
 
  210         const int * 
const &  addr( boost::get< const int * >( var.addr ) );
 
  218     VarAddrMap::const_iterator  found( varAddrMap.find( var.name ) );
 
  220     if ( found != varAddrMap.end() )
 
  223                 boost::get< const CexmcEnergyDepositCalorimeterCollection * >(
 
  229                 if ( ( *addr )->size() == 0 )
 
  231                 if ( var.index1 == 0 || var.index2 == 0 )
 
  233                 return ( *addr )->at( var.index1 - 1 ).at( var.index2 - 1 );
 
  238             const bool * 
const &  addr( boost::get< const bool * >(
 
  247     if ( var.name == CexmcCFVarTPT )
 
  249         return int( evSObject->targetTPOutputParticle.trackId !=
 
  259 void  CexmcASTEval::GetEDCollectionValue( 
const CexmcAST::Node &  node,
 
  262     if ( evSObject == NULL )
 
  265     const CexmcAST::Subtree *  ast( boost::get< CexmcAST::Subtree >( &node ) );
 
  269         const CexmcAST::Function &  fun( boost::get< CexmcAST::Function >(
 
  272         if ( fun == 
"Inner" )
 
  274             GetEDCollectionValue( ast->children[ 0 ], edCol );
 
  276             edCol.erase( edCol.begin() );
 
  277             for ( CexmcEnergyDepositCalorimeterCollection::iterator
 
  278                             k( edCol.begin() ); k != edCol.end(); ++k )
 
  281                 k->erase( k->begin() );
 
  285         if ( fun == 
"Outer" )
 
  287             GetEDCollectionValue( ast->children[ 0 ], edCol );
 
  288             if ( edCol.size() < 3 )
 
  290             for ( CexmcEnergyDepositCalorimeterCollection::iterator
 
  291                             k( edCol.begin() + 1 ); k != edCol.end() - 1; ++k )
 
  295                 k->erase( k->begin() + 1, k->end() - 1 );
 
  302         const CexmcAST::Leaf &      leaf( boost::get< CexmcAST::Leaf >(
 
  304         const CexmcAST::Variable &  
var( boost::get< CexmcAST::Variable >(
 
  307         if ( var.index1 != 0 || var.index2 != 0 )
 
  310         VarAddrMap::const_iterator  found( varAddrMap.find( var.name ) );
 
  312         if ( found == varAddrMap.end() )
 
  316                 boost::get< const CexmcEnergyDepositCalorimeterCollection * >(
 
  332 void  CexmcASTEval::BindAddresses( CexmcAST::Subtree &  ast )
 
  334     if ( evFastSObject == NULL || evSObject == NULL )
 
  337     for ( std::vector< CexmcAST::Node >::iterator  k( ast.children.begin() );
 
  338                                                   k != ast.children.end(); ++k )
 
  340         CexmcAST::Subtree *  subtree( boost::get< CexmcAST::Subtree >( &*k ) );
 
  344             BindAddresses( *subtree );
 
  348             CexmcAST::Leaf &      leaf( boost::get< CexmcAST::Leaf >( *k ) );
 
  349             CexmcAST::Variable *  
var( boost::get< CexmcAST::Variable >(
 
  354             const int * 
const *   intVarAddr(
 
  355                                     boost::get< const int * >( &var->addr ) );
 
  363                 const double * 
const &  doubleVarAddr(
 
  364                                     boost::get< const double * >( var->addr ) );
 
  369             VarAddrMap::const_iterator  found( varAddrMap.find( var->name ) );
 
  371             if ( found != varAddrMap.end() )
 
  376                 if ( var->name == CexmcCFVarEvent )
 
  378                     var->addr = &evFastSObject->eventId;
 
  381                 if ( var->name == CexmcCFVarOpCosThetaSCM )
 
  383                     var->addr = &evFastSObject->opCosThetaSCM;
 
  386                 if ( var->name == CexmcCFVarEDT )
 
  388                     varAddrMap.insert( VarAddrMapData( var->name,
 
  389                                    &evFastSObject->edDigitizerHasTriggered ) );
 
  392                 if ( var->name == CexmcCFVarMon )
 
  394                     varAddrMap.insert( VarAddrMapData( var->name,
 
  395                            &evFastSObject->edDigitizerMonitorHasTriggered ) );
 
  398                 if ( var->name == CexmcCFVarMonED )
 
  400                     var->addr = &evSObject->monitorED;
 
  403                 if ( var->name == CexmcCFVarVclED )
 
  405                     var->addr = &evSObject->vetoCounterEDLeft;
 
  408                 if ( var->name == CexmcCFVarVcrED )
 
  410                     var->addr = &evSObject->vetoCounterEDRight;
 
  413                 if ( var->name == CexmcCFVarClED )
 
  415                     var->addr = &evSObject->calorimeterEDLeft;
 
  418                 if ( var->name == CexmcCFVarCrED )
 
  420                     var->addr = &evSObject->calorimeterEDRight;
 
  423                 if ( var->name == CexmcCFVarClEDCol )
 
  425                     varAddrMap.insert( VarAddrMapData( var->name,
 
  426                                 &evSObject->calorimeterEDLeftCollection ) );
 
  429                 if ( var->name == CexmcCFVarCrEDCol )
 
  431                     varAddrMap.insert( VarAddrMapData( var->name,
 
  432                                 &evSObject->calorimeterEDRightCollection ) );
 
  435                 if ( var->name == CexmcCFVarBpMonPosL )
 
  437                     var->addr = GetThreeVectorElementAddrByIndex(
 
  438                             evSObject->monitorTP.positionLocal, var->index1 );
 
  441                 if ( var->name == CexmcCFVarBpMonPosW )
 
  443                     var->addr = GetThreeVectorElementAddrByIndex(
 
  444                             evSObject->monitorTP.positionWorld, var->index1 );
 
  447                 if ( var->name == CexmcCFVarBpMonDirL )
 
  449                     var->addr = GetThreeVectorElementAddrByIndex(
 
  450                             evSObject->monitorTP.directionLocal, var->index1 );
 
  453                 if ( var->name == CexmcCFVarBpMonDirW )
 
  455                     var->addr = GetThreeVectorElementAddrByIndex(
 
  456                             evSObject->monitorTP.directionWorld, var->index1 );
 
  459                 if ( var->name == CexmcCFVarBpMonMom )
 
  461                     var->addr = &evSObject->monitorTP.momentumAmp;
 
  464                 if ( var->name == CexmcCFVarBpMonTid )
 
  466                     var->addr = &evSObject->monitorTP.trackId;
 
  469                 if ( var->name == CexmcCFVarBpTgtPosL )
 
  471                     var->addr = GetThreeVectorElementAddrByIndex(
 
  472                             evSObject->targetTPBeamParticle.positionLocal,
 
  476                 if ( var->name == CexmcCFVarBpTgtPosW )
 
  478                     var->addr = GetThreeVectorElementAddrByIndex(
 
  479                             evSObject->targetTPBeamParticle.positionWorld,
 
  483                 if ( var->name == CexmcCFVarBpTgtDirL )
 
  485                     var->addr = GetThreeVectorElementAddrByIndex(
 
  486                             evSObject->targetTPBeamParticle.directionLocal,
 
  490                 if ( var->name == CexmcCFVarBpTgtDirW )
 
  492                     var->addr = GetThreeVectorElementAddrByIndex(
 
  493                             evSObject->targetTPBeamParticle.directionWorld,
 
  497                 if ( var->name == CexmcCFVarBpTgtMom )
 
  499                     var->addr = &evSObject->targetTPBeamParticle.momentumAmp;
 
  502                 if ( var->name == CexmcCFVarBpTgtTid )
 
  504                     var->addr = &evSObject->targetTPBeamParticle.trackId;
 
  507                 if ( var->name == CexmcCFVarOpTgtPosL )
 
  509                     var->addr = GetThreeVectorElementAddrByIndex(
 
  510                             evSObject->targetTPOutputParticle.positionLocal,
 
  514                 if ( var->name == CexmcCFVarOpTgtPosW )
 
  516                     var->addr = GetThreeVectorElementAddrByIndex(
 
  517                             evSObject->targetTPOutputParticle.positionWorld,
 
  521                 if ( var->name == CexmcCFVarOpTgtDirL )
 
  523                     var->addr = GetThreeVectorElementAddrByIndex(
 
  524                             evSObject->targetTPOutputParticle.directionLocal,
 
  528                 if ( var->name == CexmcCFVarOpTgtDirW )
 
  530                     var->addr = GetThreeVectorElementAddrByIndex(
 
  531                             evSObject->targetTPOutputParticle.directionWorld,
 
  535                 if ( var->name == CexmcCFVarOpTgtMom )
 
  537                     var->addr = &evSObject->targetTPOutputParticle.momentumAmp;
 
  540                 if ( var->name == CexmcCFVarOpTgtTid )
 
  542                     var->addr = &evSObject->targetTPOutputParticle.trackId;
 
  545                 if ( var->name == CexmcCFVarNpTgtPosL )
 
  547                     var->addr = GetThreeVectorElementAddrByIndex(
 
  548                             evSObject->targetTPNucleusParticle.positionLocal,
 
  552                 if ( var->name == CexmcCFVarNpTgtPosW )
 
  554                     var->addr = GetThreeVectorElementAddrByIndex(
 
  555                             evSObject->targetTPNucleusParticle.positionWorld,
 
  559                 if ( var->name == CexmcCFVarNpTgtDirL )
 
  561                     var->addr = GetThreeVectorElementAddrByIndex(
 
  562                             evSObject->targetTPNucleusParticle.directionLocal,
 
  566                 if ( var->name == CexmcCFVarNpTgtDirW )
 
  568                     var->addr = GetThreeVectorElementAddrByIndex(
 
  569                             evSObject->targetTPNucleusParticle.directionWorld,
 
  573                 if ( var->name == CexmcCFVarNpTgtMom )
 
  575                     var->addr = &evSObject->targetTPNucleusParticle.momentumAmp;
 
  578                 if ( var->name == CexmcCFVarNpTgtTid )
 
  580                     var->addr = &evSObject->targetTPNucleusParticle.trackId;
 
  583                 if ( var->name == CexmcCFVarOpdp1TgtPosL )
 
  585                     var->addr = GetThreeVectorElementAddrByIndex(
 
  586                         evSObject->targetTPOutputParticleDecayProductParticle1.
 
  591                 if ( var->name == CexmcCFVarOpdp1TgtPosW )
 
  593                     var->addr = GetThreeVectorElementAddrByIndex(
 
  594                         evSObject->targetTPOutputParticleDecayProductParticle1.
 
  599                 if ( var->name == CexmcCFVarOpdp1TgtDirL )
 
  601                     var->addr = GetThreeVectorElementAddrByIndex(
 
  602                         evSObject->targetTPOutputParticleDecayProductParticle1.
 
  607                 if ( var->name == CexmcCFVarOpdp1TgtDirW )
 
  609                     var->addr = GetThreeVectorElementAddrByIndex(
 
  610                         evSObject->targetTPOutputParticleDecayProductParticle1.
 
  615                 if ( var->name == CexmcCFVarOpdp1TgtMom )
 
  617                     var->addr = &evSObject->
 
  618                         targetTPOutputParticleDecayProductParticle1.momentumAmp;
 
  621                 if ( var->name == CexmcCFVarOpdp1TgtTid )
 
  623                     var->addr = &evSObject->
 
  624                         targetTPOutputParticleDecayProductParticle1.trackId;
 
  627                 if ( var->name == CexmcCFVarOpdp2TgtPosL )
 
  629                     var->addr = GetThreeVectorElementAddrByIndex(
 
  630                         evSObject->targetTPOutputParticleDecayProductParticle2.
 
  635                 if ( var->name == CexmcCFVarOpdp2TgtPosW )
 
  637                     var->addr = GetThreeVectorElementAddrByIndex(
 
  638                         evSObject->targetTPOutputParticleDecayProductParticle2.
 
  643                 if ( var->name == CexmcCFVarOpdp2TgtDirL )
 
  645                     var->addr = GetThreeVectorElementAddrByIndex(
 
  646                         evSObject->targetTPOutputParticleDecayProductParticle2.
 
  651                 if ( var->name == CexmcCFVarOpdp2TgtDirW )
 
  653                     var->addr = GetThreeVectorElementAddrByIndex(
 
  654                         evSObject->targetTPOutputParticleDecayProductParticle2.
 
  659                 if ( var->name == CexmcCFVarOpdp2TgtMom )
 
  661                     var->addr = &evSObject->
 
  662                         targetTPOutputParticleDecayProductParticle2.momentumAmp;
 
  665                 if ( var->name == CexmcCFVarOpdp2TgtTid )
 
  667                     var->addr = &evSObject->
 
  668                         targetTPOutputParticleDecayProductParticle2.trackId;
 
  671                 if ( var->name == CexmcCFVarOpdpVclPosL )
 
  673                     var->addr = GetThreeVectorElementAddrByIndex(
 
  674                             evSObject->vetoCounterTPLeft.positionLocal,
 
  678                 if ( var->name == CexmcCFVarOpdpVclPosW )
 
  680                     var->addr = GetThreeVectorElementAddrByIndex(
 
  681                             evSObject->vetoCounterTPLeft.positionWorld,
 
  685                 if ( var->name == CexmcCFVarOpdpVclDirL )
 
  687                     var->addr = GetThreeVectorElementAddrByIndex(
 
  688                             evSObject->vetoCounterTPLeft.directionLocal,
 
  692                 if ( var->name == CexmcCFVarOpdpVclDirW )
 
  694                     var->addr = GetThreeVectorElementAddrByIndex(
 
  695                             evSObject->vetoCounterTPLeft.directionWorld,
 
  699                 if ( var->name == CexmcCFVarOpdpVclMom )
 
  701                     var->addr = &evSObject->vetoCounterTPLeft.momentumAmp;
 
  704                 if ( var->name == CexmcCFVarOpdpVclTid )
 
  706                     var->addr = &evSObject->vetoCounterTPLeft.trackId;
 
  709                 if ( var->name == CexmcCFVarOpdpVcrPosL )
 
  711                     var->addr = GetThreeVectorElementAddrByIndex(
 
  712                             evSObject->vetoCounterTPRight.positionLocal,
 
  716                 if ( var->name == CexmcCFVarOpdpVcrPosW )
 
  718                     var->addr = GetThreeVectorElementAddrByIndex(
 
  719                             evSObject->vetoCounterTPRight.positionWorld,
 
  723                 if ( var->name == CexmcCFVarOpdpVcrDirL )
 
  725                     var->addr = GetThreeVectorElementAddrByIndex(
 
  726                             evSObject->vetoCounterTPRight.directionLocal,
 
  730                 if ( var->name == CexmcCFVarOpdpVcrDirW )
 
  732                     var->addr = GetThreeVectorElementAddrByIndex(
 
  733                             evSObject->vetoCounterTPRight.directionWorld,
 
  737                 if ( var->name == CexmcCFVarOpdpVcrMom )
 
  739                     var->addr = &evSObject->vetoCounterTPRight.momentumAmp;
 
  742                 if ( var->name == CexmcCFVarOpdpVcrTid )
 
  744                     var->addr = &evSObject->vetoCounterTPRight.trackId;
 
  747                 if ( var->name == CexmcCFVarOpdpClPosL )
 
  749                     var->addr = GetThreeVectorElementAddrByIndex(
 
  750                             evSObject->calorimeterTPLeft.positionLocal,
 
  754                 if ( var->name == CexmcCFVarOpdpClPosW )
 
  756                     var->addr = GetThreeVectorElementAddrByIndex(
 
  757                             evSObject->calorimeterTPLeft.positionWorld,
 
  761                 if ( var->name == CexmcCFVarOpdpClDirL )
 
  763                     var->addr = GetThreeVectorElementAddrByIndex(
 
  764                             evSObject->calorimeterTPLeft.directionLocal,
 
  768                 if ( var->name == CexmcCFVarOpdpClDirW )
 
  770                     var->addr = GetThreeVectorElementAddrByIndex(
 
  771                             evSObject->calorimeterTPLeft.directionWorld,
 
  775                 if ( var->name == CexmcCFVarOpdpClMom )
 
  777                     var->addr = &evSObject->calorimeterTPLeft.momentumAmp;
 
  780                 if ( var->name == CexmcCFVarOpdpClTid )
 
  782                     var->addr = &evSObject->calorimeterTPLeft.trackId;
 
  785                 if ( var->name == CexmcCFVarOpdpCrPosL )
 
  787                     var->addr = GetThreeVectorElementAddrByIndex(
 
  788                             evSObject->calorimeterTPRight.positionLocal,
 
  792                 if ( var->name == CexmcCFVarOpdpCrPosW )
 
  794                     var->addr = GetThreeVectorElementAddrByIndex(
 
  795                             evSObject->calorimeterTPRight.positionWorld,
 
  799                 if ( var->name == CexmcCFVarOpdpCrDirL )
 
  801                     var->addr = GetThreeVectorElementAddrByIndex(
 
  802                             evSObject->calorimeterTPRight.directionLocal,
 
  806                 if ( var->name == CexmcCFVarOpdpCrDirW )
 
  808                     var->addr = GetThreeVectorElementAddrByIndex(
 
  809                             evSObject->calorimeterTPRight.directionWorld,
 
  813                 if ( var->name == CexmcCFVarOpdpCrMom )
 
  815                     var->addr = &evSObject->calorimeterTPRight.momentumAmp;
 
  818                 if ( var->name == CexmcCFVarOpdpCrTid )
 
  820                     var->addr = &evSObject->calorimeterTPRight.trackId;
 
  823                 if ( var->name == CexmcCFVarIpSCM )
 
  825                     var->addr = GetLorentzVectorElementAddrByIndex(
 
  826                         evSObject->productionModelData.incidentParticleSCM,
 
  830                 if ( var->name == CexmcCFVarIpLAB )
 
  832                     var->addr = GetLorentzVectorElementAddrByIndex(
 
  833                         evSObject->productionModelData.incidentParticleLAB,
 
  837                 if ( var->name == CexmcCFVarNpSCM )
 
  839                     var->addr = GetLorentzVectorElementAddrByIndex(
 
  840                         evSObject->productionModelData.nucleusParticleSCM,
 
  844                 if ( var->name == CexmcCFVarNpLAB )
 
  846                     var->addr = GetLorentzVectorElementAddrByIndex(
 
  847                         evSObject->productionModelData.nucleusParticleLAB,
 
  851                 if ( var->name == CexmcCFVarOpSCM )
 
  853                     var->addr = GetLorentzVectorElementAddrByIndex(
 
  854                         evSObject->productionModelData.outputParticleSCM,
 
  858                 if ( var->name == CexmcCFVarOpLAB )
 
  860                     var->addr = GetLorentzVectorElementAddrByIndex(
 
  861                         evSObject->productionModelData.outputParticleLAB,
 
  865                 if ( var->name == CexmcCFVarNopSCM )
 
  867                     var->addr = GetLorentzVectorElementAddrByIndex(
 
  868                         evSObject->productionModelData.nucleusOutputParticleSCM,
 
  872                 if ( var->name == CexmcCFVarNopLAB )
 
  874                     var->addr = GetLorentzVectorElementAddrByIndex(
 
  875                         evSObject->productionModelData.nucleusOutputParticleLAB,
 
  879                 if ( var->name == CexmcCFVarIpId )
 
  882                         &evSObject->productionModelData.incidentParticle;
 
  885                 if ( var->name == CexmcCFVarNpId )
 
  887                     var->addr = &evSObject->productionModelData.nucleusParticle;
 
  890                 if ( var->name == CexmcCFVarOpId )
 
  892                     var->addr = &evSObject->productionModelData.outputParticle;
 
  895                 if ( var->name == CexmcCFVarNopId )
 
  898                         &evSObject->productionModelData.nucleusOutputParticle;
 
  901                 if ( var->name == CexmcCFVarConst_eV )
 
  903                     var->addr = &constants[ 0 ];
 
  906                 if ( var->name == CexmcCFVarConst_keV )
 
  908                     var->addr = &constants[ 1 ];
 
  911                 if ( var->name == CexmcCFVarConst_MeV )
 
  913                     var->addr = &constants[ 2 ];
 
  916                 if ( var->name == CexmcCFVarConst_GeV )
 
  918                     var->addr = &constants[ 3 ];
 
  921                 if ( var->name == CexmcCFVarConst_mm )
 
  923                     var->addr = &constants[ 4 ];
 
  926                 if ( var->name == CexmcCFVarConst_cm )
 
  928                     var->addr = &constants[ 5 ];
 
  931                 if ( var->name == CexmcCFVarConst_m )
 
  933                     var->addr = &constants[ 6 ];
 
  942 void  CexmcASTEval::ResetAddressBinding( CexmcAST::Subtree &  ast )
 
  944     for ( std::vector< CexmcAST::Node >::iterator  k( ast.children.begin() );
 
  945                                                   k != ast.children.end(); ++k )
 
  947         CexmcAST::Subtree *  subtree( boost::get< CexmcAST::Subtree >( &*k ) );
 
  951             ResetAddressBinding( *subtree );
 
  955             CexmcAST::Leaf &      leaf( boost::get< CexmcAST::Leaf >( *k ) );
 
  956             CexmcAST::Variable *  
var( boost::get< CexmcAST::Variable >(
 
  959                 var->addr = ( 
const int * ) NULL;