#include #include #include #include #include #include #include #include namespace RAT { IBDCrossSecMessenger::IBDCrossSecMessenger(IBDCrossSec* e) : fIBDCrossSection(e) { // Commands will go in a /generator/cross_sec/ibd directory G4UIdirectory* dir = new G4UIdirectory("/generator/cross_sec/ibd/"); dir->SetGuidance("Control the physics parameters of the inverse beta decay generator"); fStratCmd = new G4UIcmdWithAnInteger("/generator/cross_sec/ibd/strategy", this); fStratCmd->SetGuidance("Sets the strategy for the IBD cross section calculation."); fStratCmd->SetGuidance("Usage: /generator/cross_sec/ibd/strategy strat"); fStratCmd->SetGuidance("Options:"); fStratCmd->SetGuidance(" 0 : Original routine from Vogel (Vogel 1999). [default]"); fStratCmd->SetGuidance(" 1 : Vogel routine with precomputed tables."); fStratCmd->SetParameter(new G4UIparameter("strat",'i',false)); fStratCmd->SetDefaultValue( 0 ); // } IBDCrossSecMessenger::~IBDCrossSecMessenger() {;} void IBDCrossSecMessenger::SetNewValue(G4UIcommand* command, G4String newValue) { if ( command == fStratCmd ) { G4int strat = fStratCmd->GetNewIntValue( newValue ); fIBDCrossSection->SetStrategy( static_cast(strat)); } else { warn << "Error: Invalid IBDCrossSecMessenger \"set\" command" << newline; } } G4String IBDCrossSecMessenger::GetCurrentValue(G4UIcommand* command) { if ( command == fStratCmd ) return fStratCmd->ConvertToString( fIBDCrossSection->GetStrategy() ); // Error if we reach here. return G4String("Error: Invalid ESCrossSecMessenger \"get\" command"); } } // namespace RAT