#include #include #include #include #include #include #include namespace RAT { ProtonESgenMessenger::ProtonESgenMessenger(ProtonESgen* lg):fProtonESgen(lg) { G4UIdirectory* dir = new G4UIdirectory("/generator/PES/"); dir->SetGuidance("Controls the Proton Neutrino elastic scattering interaction"); ftypeSetCmd = new G4UIcmdWithAString("/generator/PES/spectrum",this); ftypeSetCmd->SetGuidance("Choose a spectrum from your given RATDB file"); ftypeSetCmd->SetParameter(new G4UIparameter("setting", 's', true)); fProtonSetCmd = new G4UIcmdWithADouble("/generator/PES/FreeProtons",this); fProtonSetCmd->SetGuidance("This is the number of free protons in the detector in units 10^31"); fProtonSetCmd->SetParameterName("setting","d",true); } ProtonESgenMessenger::~ProtonESgenMessenger() { delete ftypeSetCmd; delete fProtonSetCmd; } void ProtonESgenMessenger::SetNewValue(G4UIcommand* command, G4String newValues) { if( command == ftypeSetCmd) { G4String state = util_strip_default(newValues); fProtonESgen->SetGenType(state); } else if( command == fProtonSetCmd) { fProtonESgen->SetNumFreeProtons(fProtonSetCmd->GetNewDoubleValue(newValues)); } else { // Error if we reach here. warn << "ProtonESgenMessenger::SetNewValue: Invalid command" << newline; } } }//namespace RAT