44 #ifdef CEXMC_USE_CUSTOM_FILTER
47 #include <boost/variant/get.hpp>
54 const std::string CexmcCFVarEvent(
"event" );
55 const std::string CexmcCFVarOpCosThetaSCM(
"op_cosTh_SCM" );
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(
"clEDcol" );
65 const std::string CexmcCFVarCrEDCol(
"crEDcol" );
66 const std::string CexmcCFVarBpMonPosL(
"bp_mon_posl" );
67 const std::string CexmcCFVarBpMonPosW(
"bp_mon_posw" );
68 const std::string CexmcCFVarBpMonDirL(
"bp_mon_dirl" );
69 const std::string CexmcCFVarBpMonDirW(
"bp_mon_dirw" );
70 const std::string CexmcCFVarBpMonMom(
"bp_mon_mom" );
71 const std::string CexmcCFVarBpMonTid(
"bp_mon_tid" );
72 const std::string CexmcCFVarBpTgtPosL(
"bp_tgt_posl" );
73 const std::string CexmcCFVarBpTgtPosW(
"bp_tgt_posw" );
74 const std::string CexmcCFVarBpTgtDirL(
"bp_tgt_dirl" );
75 const std::string CexmcCFVarBpTgtDirW(
"bp_tgt_dirw" );
76 const std::string CexmcCFVarBpTgtMom(
"bp_tgt_mom" );
77 const std::string CexmcCFVarBpTgtTid(
"bp_tgt_tid" );
78 const std::string CexmcCFVarOpTgtPosL(
"op_tgt_posl" );
79 const std::string CexmcCFVarOpTgtPosW(
"op_tgt_posw" );
80 const std::string CexmcCFVarOpTgtDirL(
"op_tgt_dirl" );
81 const std::string CexmcCFVarOpTgtDirW(
"op_tgt_dirw" );
82 const std::string CexmcCFVarOpTgtMom(
"op_tgt_mom" );
83 const std::string CexmcCFVarOpTgtTid(
"op_tgt_tid" );
84 const std::string CexmcCFVarNpTgtPosL(
"np_tgt_posl" );
85 const std::string CexmcCFVarNpTgtPosW(
"np_tgt_posw" );
86 const std::string CexmcCFVarNpTgtDirL(
"np_tgt_dirl" );
87 const std::string CexmcCFVarNpTgtDirW(
"np_tgt_dirw" );
88 const std::string CexmcCFVarNpTgtMom(
"np_tgt_mom" );
89 const std::string CexmcCFVarNpTgtTid(
"np_tgt_tid" );
90 const std::string CexmcCFVarOpdp1TgtPosL(
"opdp1_tgt_posl" );
91 const std::string CexmcCFVarOpdp1TgtPosW(
"opdp1_tgt_posw" );
92 const std::string CexmcCFVarOpdp1TgtDirL(
"opdp1_tgt_dirl" );
93 const std::string CexmcCFVarOpdp1TgtDirW(
"opdp1_tgt_dirw" );
94 const std::string CexmcCFVarOpdp1TgtMom(
"opdp1_tgt_mom" );
95 const std::string CexmcCFVarOpdp1TgtTid(
"opdp1_tgt_tid" );
96 const std::string CexmcCFVarOpdp2TgtPosL(
"opdp2_tgt_posl" );
97 const std::string CexmcCFVarOpdp2TgtPosW(
"opdp2_tgt_posw" );
98 const std::string CexmcCFVarOpdp2TgtDirL(
"opdp2_tgt_dirl" );
99 const std::string CexmcCFVarOpdp2TgtDirW(
"opdp2_tgt_dirw" );
100 const std::string CexmcCFVarOpdp2TgtMom(
"opdp2_tgt_mom" );
101 const std::string CexmcCFVarOpdp2TgtTid(
"opdp2_tgt_tid" );
102 const std::string CexmcCFVarOpdpVclPosL(
"opdp_vcl_posl" );
103 const std::string CexmcCFVarOpdpVclPosW(
"opdp_vcl_posw" );
104 const std::string CexmcCFVarOpdpVclDirL(
"opdp_vcl_dirl" );
105 const std::string CexmcCFVarOpdpVclDirW(
"opdp_vcl_dirw" );
106 const std::string CexmcCFVarOpdpVclMom(
"opdp_vcl_mom" );
107 const std::string CexmcCFVarOpdpVclTid(
"opdp_vcl_tid" );
108 const std::string CexmcCFVarOpdpVcrPosL(
"opdp_vcr_posl" );
109 const std::string CexmcCFVarOpdpVcrPosW(
"opdp_vcr_posw" );
110 const std::string CexmcCFVarOpdpVcrDirL(
"opdp_vcr_dirl" );
111 const std::string CexmcCFVarOpdpVcrDirW(
"opdp_vcr_dirw" );
112 const std::string CexmcCFVarOpdpVcrMom(
"opdp_vcr_mom" );
113 const std::string CexmcCFVarOpdpVcrTid(
"opdp_vcr_tid" );
114 const std::string CexmcCFVarOpdpClPosL(
"opdp_cl_posl" );
115 const std::string CexmcCFVarOpdpClPosW(
"opdp_cl_posw" );
116 const std::string CexmcCFVarOpdpClDirL(
"opdp_cl_dirl" );
117 const std::string CexmcCFVarOpdpClDirW(
"opdp_cl_dirw" );
118 const std::string CexmcCFVarOpdpClMom(
"opdp_cl_mom" );
119 const std::string CexmcCFVarOpdpClTid(
"opdp_cl_tid" );
120 const std::string CexmcCFVarOpdpCrPosL(
"opdp_cr_posl" );
121 const std::string CexmcCFVarOpdpCrPosW(
"opdp_cr_posw" );
122 const std::string CexmcCFVarOpdpCrDirL(
"opdp_cr_dirl" );
123 const std::string CexmcCFVarOpdpCrDirW(
"opdp_cr_dirw" );
124 const std::string CexmcCFVarOpdpCrMom(
"opdp_cr_mom" );
125 const std::string CexmcCFVarOpdpCrTid(
"opdp_cr_tid" );
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(
"nopSCM" );
133 const std::string CexmcCFVarNopLAB(
"nopLAB" );
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(
"keV" );
140 const std::string CexmcCFVarConst_MeV(
"MeV" );
141 const std::string CexmcCFVarConst_GeV(
"GeV" );
142 const std::string CexmcCFVarConst_mm(
"mm" );
143 const std::string CexmcCFVarConst_cm(
"cm" );
144 const std::string CexmcCFVarConst_m(
"m" );
151 CexmcASTEval::CexmcASTEval(
const CexmcEventFastSObject * evFastSObject_,
152 const CexmcEventSObject * evSObject_ ) :
153 evFastSObject( evFastSObject_ ), evSObject( evSObject_ )
158 CexmcAST::BasicEval::ScalarValueType CexmcASTEval::GetFunScalarValue(
159 const CexmcAST::Subtree & ast )
const
161 const CexmcAST::Function & fun( boost::get< CexmcAST::Function >(
167 GetEDCollectionValue( ast.children[ 0 ], edCol );
171 for ( CexmcEnergyDepositCalorimeterCollection::iterator
172 k( edCol.begin() ); k != edCol.end(); ++k )
174 result += std::accumulate( k->begin(), k->end(),
G4double( 0. ) );
180 bool evalResult(
false );
181 ScalarValueType
result( GetBasicFunScalarValue( ast, evalResult ) );
192 CexmcAST::BasicEval::ScalarValueType CexmcASTEval::GetVarScalarValue(
193 const CexmcAST::Variable & var )
const
195 if ( evFastSObject == NULL || evSObject == NULL )
202 const double *
const * addr( boost::get< const double * >( &var.addr ) );
211 const int *
const & addr_( boost::get< const int * >( var.addr ) );
219 VarAddrMap::const_iterator found( varAddrMap.find( var.name ) );
221 if ( found != varAddrMap.end() )
224 boost::get< const CexmcEnergyDepositCalorimeterCollection * >(
230 if ( ( *addr_ )->size() == 0 )
232 if ( var.index1 == 0 || var.index2 == 0 )
234 return ( *addr_ )->at( var.index1 - 1 ).at( var.index2 - 1 );
239 const bool *
const & addr__( boost::get< const bool * >(
242 return int( *addr__ );
248 if ( var.name == CexmcCFVarTPT )
250 return int( evSObject->targetTPOutputParticle.trackId !=
260 void CexmcASTEval::GetEDCollectionValue(
const CexmcAST::Node & node,
263 if ( evSObject == NULL )
266 const CexmcAST::Subtree * ast( boost::get< CexmcAST::Subtree >( &node ) );
270 const CexmcAST::Function & fun( boost::get< CexmcAST::Function >(
273 if ( fun ==
"Inner" )
275 GetEDCollectionValue( ast->children[ 0 ], edCol );
277 edCol.erase( edCol.begin() );
278 for ( CexmcEnergyDepositCalorimeterCollection::iterator
279 k( edCol.begin() ); k != edCol.end(); ++k )
282 k->erase( k->begin() );
286 if ( fun ==
"Outer" )
288 GetEDCollectionValue( ast->children[ 0 ], edCol );
289 if ( edCol.size() < 3 )
291 for ( CexmcEnergyDepositCalorimeterCollection::iterator
292 k( edCol.begin() + 1 ); k != edCol.end() - 1; ++k )
296 k->erase( k->begin() + 1, k->end() - 1 );
303 const CexmcAST::Leaf & leaf( boost::get< CexmcAST::Leaf >(
305 const CexmcAST::Variable & var( boost::get< CexmcAST::Variable >(
308 if ( var.index1 != 0 || var.index2 != 0 )
311 VarAddrMap::const_iterator found( varAddrMap.find( var.name ) );
313 if ( found == varAddrMap.end() )
317 boost::get< const CexmcEnergyDepositCalorimeterCollection * >(
333 void CexmcASTEval::BindAddresses( CexmcAST::Subtree & ast )
335 if ( evFastSObject == NULL || evSObject == NULL )
338 for ( std::vector< CexmcAST::Node >::iterator k( ast.children.begin() );
339 k != ast.children.end(); ++k )
341 CexmcAST::Subtree * subtree( boost::get< CexmcAST::Subtree >( &*k ) );
345 BindAddresses( *subtree );
349 CexmcAST::Leaf & leaf( boost::get< CexmcAST::Leaf >( *k ) );
350 CexmcAST::Variable * var( boost::get< CexmcAST::Variable >(
355 const int *
const * intVarAddr(
356 boost::get< const int * >( &var->addr ) );
364 const double *
const & doubleVarAddr(
365 boost::get< const double * >( var->addr ) );
370 VarAddrMap::const_iterator found( varAddrMap.find( var->name ) );
372 if ( found != varAddrMap.end() )
377 if ( var->name == CexmcCFVarEvent )
379 var->addr = &evFastSObject->eventId;
382 if ( var->name == CexmcCFVarOpCosThetaSCM )
384 var->addr = &evFastSObject->opCosThetaSCM;
387 if ( var->name == CexmcCFVarEDT )
389 varAddrMap.insert( VarAddrMapData( var->name,
390 &evFastSObject->edDigitizerHasTriggered ) );
393 if ( var->name == CexmcCFVarMon )
395 varAddrMap.insert( VarAddrMapData( var->name,
396 &evFastSObject->edDigitizerMonitorHasTriggered ) );
399 if ( var->name == CexmcCFVarMonED )
401 var->addr = &evSObject->monitorED;
404 if ( var->name == CexmcCFVarVclED )
406 var->addr = &evSObject->vetoCounterEDLeft;
409 if ( var->name == CexmcCFVarVcrED )
411 var->addr = &evSObject->vetoCounterEDRight;
414 if ( var->name == CexmcCFVarClED )
416 var->addr = &evSObject->calorimeterEDLeft;
419 if ( var->name == CexmcCFVarCrED )
421 var->addr = &evSObject->calorimeterEDRight;
424 if ( var->name == CexmcCFVarClEDCol )
426 varAddrMap.insert( VarAddrMapData( var->name,
427 &evSObject->calorimeterEDLeftCollection ) );
430 if ( var->name == CexmcCFVarCrEDCol )
432 varAddrMap.insert( VarAddrMapData( var->name,
433 &evSObject->calorimeterEDRightCollection ) );
436 if ( var->name == CexmcCFVarBpMonPosL )
438 var->addr = GetThreeVectorElementAddrByIndex(
439 evSObject->monitorTP.positionLocal, var->index1 );
442 if ( var->name == CexmcCFVarBpMonPosW )
444 var->addr = GetThreeVectorElementAddrByIndex(
445 evSObject->monitorTP.positionWorld, var->index1 );
448 if ( var->name == CexmcCFVarBpMonDirL )
450 var->addr = GetThreeVectorElementAddrByIndex(
451 evSObject->monitorTP.directionLocal, var->index1 );
454 if ( var->name == CexmcCFVarBpMonDirW )
456 var->addr = GetThreeVectorElementAddrByIndex(
457 evSObject->monitorTP.directionWorld, var->index1 );
460 if ( var->name == CexmcCFVarBpMonMom )
462 var->addr = &evSObject->monitorTP.momentumAmp;
465 if ( var->name == CexmcCFVarBpMonTid )
467 var->addr = &evSObject->monitorTP.trackId;
470 if ( var->name == CexmcCFVarBpTgtPosL )
472 var->addr = GetThreeVectorElementAddrByIndex(
473 evSObject->targetTPBeamParticle.positionLocal,
477 if ( var->name == CexmcCFVarBpTgtPosW )
479 var->addr = GetThreeVectorElementAddrByIndex(
480 evSObject->targetTPBeamParticle.positionWorld,
484 if ( var->name == CexmcCFVarBpTgtDirL )
486 var->addr = GetThreeVectorElementAddrByIndex(
487 evSObject->targetTPBeamParticle.directionLocal,
491 if ( var->name == CexmcCFVarBpTgtDirW )
493 var->addr = GetThreeVectorElementAddrByIndex(
494 evSObject->targetTPBeamParticle.directionWorld,
498 if ( var->name == CexmcCFVarBpTgtMom )
500 var->addr = &evSObject->targetTPBeamParticle.momentumAmp;
503 if ( var->name == CexmcCFVarBpTgtTid )
505 var->addr = &evSObject->targetTPBeamParticle.trackId;
508 if ( var->name == CexmcCFVarOpTgtPosL )
510 var->addr = GetThreeVectorElementAddrByIndex(
511 evSObject->targetTPOutputParticle.positionLocal,
515 if ( var->name == CexmcCFVarOpTgtPosW )
517 var->addr = GetThreeVectorElementAddrByIndex(
518 evSObject->targetTPOutputParticle.positionWorld,
522 if ( var->name == CexmcCFVarOpTgtDirL )
524 var->addr = GetThreeVectorElementAddrByIndex(
525 evSObject->targetTPOutputParticle.directionLocal,
529 if ( var->name == CexmcCFVarOpTgtDirW )
531 var->addr = GetThreeVectorElementAddrByIndex(
532 evSObject->targetTPOutputParticle.directionWorld,
536 if ( var->name == CexmcCFVarOpTgtMom )
538 var->addr = &evSObject->targetTPOutputParticle.momentumAmp;
541 if ( var->name == CexmcCFVarOpTgtTid )
543 var->addr = &evSObject->targetTPOutputParticle.trackId;
546 if ( var->name == CexmcCFVarNpTgtPosL )
548 var->addr = GetThreeVectorElementAddrByIndex(
549 evSObject->targetTPNucleusParticle.positionLocal,
553 if ( var->name == CexmcCFVarNpTgtPosW )
555 var->addr = GetThreeVectorElementAddrByIndex(
556 evSObject->targetTPNucleusParticle.positionWorld,
560 if ( var->name == CexmcCFVarNpTgtDirL )
562 var->addr = GetThreeVectorElementAddrByIndex(
563 evSObject->targetTPNucleusParticle.directionLocal,
567 if ( var->name == CexmcCFVarNpTgtDirW )
569 var->addr = GetThreeVectorElementAddrByIndex(
570 evSObject->targetTPNucleusParticle.directionWorld,
574 if ( var->name == CexmcCFVarNpTgtMom )
576 var->addr = &evSObject->targetTPNucleusParticle.momentumAmp;
579 if ( var->name == CexmcCFVarNpTgtTid )
581 var->addr = &evSObject->targetTPNucleusParticle.trackId;
584 if ( var->name == CexmcCFVarOpdp1TgtPosL )
586 var->addr = GetThreeVectorElementAddrByIndex(
587 evSObject->targetTPOutputParticleDecayProductParticle1.
592 if ( var->name == CexmcCFVarOpdp1TgtPosW )
594 var->addr = GetThreeVectorElementAddrByIndex(
595 evSObject->targetTPOutputParticleDecayProductParticle1.
600 if ( var->name == CexmcCFVarOpdp1TgtDirL )
602 var->addr = GetThreeVectorElementAddrByIndex(
603 evSObject->targetTPOutputParticleDecayProductParticle1.
608 if ( var->name == CexmcCFVarOpdp1TgtDirW )
610 var->addr = GetThreeVectorElementAddrByIndex(
611 evSObject->targetTPOutputParticleDecayProductParticle1.
616 if ( var->name == CexmcCFVarOpdp1TgtMom )
618 var->addr = &evSObject->
619 targetTPOutputParticleDecayProductParticle1.momentumAmp;
622 if ( var->name == CexmcCFVarOpdp1TgtTid )
624 var->addr = &evSObject->
625 targetTPOutputParticleDecayProductParticle1.trackId;
628 if ( var->name == CexmcCFVarOpdp2TgtPosL )
630 var->addr = GetThreeVectorElementAddrByIndex(
631 evSObject->targetTPOutputParticleDecayProductParticle2.
636 if ( var->name == CexmcCFVarOpdp2TgtPosW )
638 var->addr = GetThreeVectorElementAddrByIndex(
639 evSObject->targetTPOutputParticleDecayProductParticle2.
644 if ( var->name == CexmcCFVarOpdp2TgtDirL )
646 var->addr = GetThreeVectorElementAddrByIndex(
647 evSObject->targetTPOutputParticleDecayProductParticle2.
652 if ( var->name == CexmcCFVarOpdp2TgtDirW )
654 var->addr = GetThreeVectorElementAddrByIndex(
655 evSObject->targetTPOutputParticleDecayProductParticle2.
660 if ( var->name == CexmcCFVarOpdp2TgtMom )
662 var->addr = &evSObject->
663 targetTPOutputParticleDecayProductParticle2.momentumAmp;
666 if ( var->name == CexmcCFVarOpdp2TgtTid )
668 var->addr = &evSObject->
669 targetTPOutputParticleDecayProductParticle2.trackId;
672 if ( var->name == CexmcCFVarOpdpVclPosL )
674 var->addr = GetThreeVectorElementAddrByIndex(
675 evSObject->vetoCounterTPLeft.positionLocal,
679 if ( var->name == CexmcCFVarOpdpVclPosW )
681 var->addr = GetThreeVectorElementAddrByIndex(
682 evSObject->vetoCounterTPLeft.positionWorld,
686 if ( var->name == CexmcCFVarOpdpVclDirL )
688 var->addr = GetThreeVectorElementAddrByIndex(
689 evSObject->vetoCounterTPLeft.directionLocal,
693 if ( var->name == CexmcCFVarOpdpVclDirW )
695 var->addr = GetThreeVectorElementAddrByIndex(
696 evSObject->vetoCounterTPLeft.directionWorld,
700 if ( var->name == CexmcCFVarOpdpVclMom )
702 var->addr = &evSObject->vetoCounterTPLeft.momentumAmp;
705 if ( var->name == CexmcCFVarOpdpVclTid )
707 var->addr = &evSObject->vetoCounterTPLeft.trackId;
710 if ( var->name == CexmcCFVarOpdpVcrPosL )
712 var->addr = GetThreeVectorElementAddrByIndex(
713 evSObject->vetoCounterTPRight.positionLocal,
717 if ( var->name == CexmcCFVarOpdpVcrPosW )
719 var->addr = GetThreeVectorElementAddrByIndex(
720 evSObject->vetoCounterTPRight.positionWorld,
724 if ( var->name == CexmcCFVarOpdpVcrDirL )
726 var->addr = GetThreeVectorElementAddrByIndex(
727 evSObject->vetoCounterTPRight.directionLocal,
731 if ( var->name == CexmcCFVarOpdpVcrDirW )
733 var->addr = GetThreeVectorElementAddrByIndex(
734 evSObject->vetoCounterTPRight.directionWorld,
738 if ( var->name == CexmcCFVarOpdpVcrMom )
740 var->addr = &evSObject->vetoCounterTPRight.momentumAmp;
743 if ( var->name == CexmcCFVarOpdpVcrTid )
745 var->addr = &evSObject->vetoCounterTPRight.trackId;
748 if ( var->name == CexmcCFVarOpdpClPosL )
750 var->addr = GetThreeVectorElementAddrByIndex(
751 evSObject->calorimeterTPLeft.positionLocal,
755 if ( var->name == CexmcCFVarOpdpClPosW )
757 var->addr = GetThreeVectorElementAddrByIndex(
758 evSObject->calorimeterTPLeft.positionWorld,
762 if ( var->name == CexmcCFVarOpdpClDirL )
764 var->addr = GetThreeVectorElementAddrByIndex(
765 evSObject->calorimeterTPLeft.directionLocal,
769 if ( var->name == CexmcCFVarOpdpClDirW )
771 var->addr = GetThreeVectorElementAddrByIndex(
772 evSObject->calorimeterTPLeft.directionWorld,
776 if ( var->name == CexmcCFVarOpdpClMom )
778 var->addr = &evSObject->calorimeterTPLeft.momentumAmp;
781 if ( var->name == CexmcCFVarOpdpClTid )
783 var->addr = &evSObject->calorimeterTPLeft.trackId;
786 if ( var->name == CexmcCFVarOpdpCrPosL )
788 var->addr = GetThreeVectorElementAddrByIndex(
789 evSObject->calorimeterTPRight.positionLocal,
793 if ( var->name == CexmcCFVarOpdpCrPosW )
795 var->addr = GetThreeVectorElementAddrByIndex(
796 evSObject->calorimeterTPRight.positionWorld,
800 if ( var->name == CexmcCFVarOpdpCrDirL )
802 var->addr = GetThreeVectorElementAddrByIndex(
803 evSObject->calorimeterTPRight.directionLocal,
807 if ( var->name == CexmcCFVarOpdpCrDirW )
809 var->addr = GetThreeVectorElementAddrByIndex(
810 evSObject->calorimeterTPRight.directionWorld,
814 if ( var->name == CexmcCFVarOpdpCrMom )
816 var->addr = &evSObject->calorimeterTPRight.momentumAmp;
819 if ( var->name == CexmcCFVarOpdpCrTid )
821 var->addr = &evSObject->calorimeterTPRight.trackId;
824 if ( var->name == CexmcCFVarIpSCM )
826 var->addr = GetLorentzVectorElementAddrByIndex(
827 evSObject->productionModelData.incidentParticleSCM,
831 if ( var->name == CexmcCFVarIpLAB )
833 var->addr = GetLorentzVectorElementAddrByIndex(
834 evSObject->productionModelData.incidentParticleLAB,
838 if ( var->name == CexmcCFVarNpSCM )
840 var->addr = GetLorentzVectorElementAddrByIndex(
841 evSObject->productionModelData.nucleusParticleSCM,
845 if ( var->name == CexmcCFVarNpLAB )
847 var->addr = GetLorentzVectorElementAddrByIndex(
848 evSObject->productionModelData.nucleusParticleLAB,
852 if ( var->name == CexmcCFVarOpSCM )
854 var->addr = GetLorentzVectorElementAddrByIndex(
855 evSObject->productionModelData.outputParticleSCM,
859 if ( var->name == CexmcCFVarOpLAB )
861 var->addr = GetLorentzVectorElementAddrByIndex(
862 evSObject->productionModelData.outputParticleLAB,
866 if ( var->name == CexmcCFVarNopSCM )
868 var->addr = GetLorentzVectorElementAddrByIndex(
869 evSObject->productionModelData.nucleusOutputParticleSCM,
873 if ( var->name == CexmcCFVarNopLAB )
875 var->addr = GetLorentzVectorElementAddrByIndex(
876 evSObject->productionModelData.nucleusOutputParticleLAB,
880 if ( var->name == CexmcCFVarIpId )
883 &evSObject->productionModelData.incidentParticle;
886 if ( var->name == CexmcCFVarNpId )
888 var->addr = &evSObject->productionModelData.nucleusParticle;
891 if ( var->name == CexmcCFVarOpId )
893 var->addr = &evSObject->productionModelData.outputParticle;
896 if ( var->name == CexmcCFVarNopId )
899 &evSObject->productionModelData.nucleusOutputParticle;
902 if ( var->name == CexmcCFVarConst_eV )
904 var->addr = &constants[ 0 ];
907 if ( var->name == CexmcCFVarConst_keV )
909 var->addr = &constants[ 1 ];
912 if ( var->name == CexmcCFVarConst_MeV )
914 var->addr = &constants[ 2 ];
917 if ( var->name == CexmcCFVarConst_GeV )
919 var->addr = &constants[ 3 ];
922 if ( var->name == CexmcCFVarConst_mm )
924 var->addr = &constants[ 4 ];
927 if ( var->name == CexmcCFVarConst_cm )
929 var->addr = &constants[ 5 ];
932 if ( var->name == CexmcCFVarConst_m )
934 var->addr = &constants[ 6 ];
943 void CexmcASTEval::ResetAddressBinding( CexmcAST::Subtree & ast )
945 for ( std::vector< CexmcAST::Node >::iterator k( ast.children.begin() );
946 k != ast.children.end(); ++k )
948 CexmcAST::Subtree * subtree( boost::get< CexmcAST::Subtree >( &*k ) );
952 ResetAddressBinding( *subtree );
956 CexmcAST::Leaf & leaf( boost::get< CexmcAST::Leaf >( *k ) );
957 CexmcAST::Variable * var( boost::get< CexmcAST::Variable >(
960 var->addr = (
const int * ) NULL;
static constexpr double MeV
static constexpr double keV
static constexpr double mm
const G4int CexmcInvalidTrackId(-1)
static constexpr double m
std::vector< CexmcEnergyDepositCrystalRowCollection > CexmcEnergyDepositCalorimeterCollection
typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData)
static constexpr double eV
G4double G4ParticleHPJENDLHEData::G4double result
static constexpr double cm
static constexpr double GeV