This is a workaround for Geant4 bug 1021 -- when that gets fixed this will no longer be needed.
Public Member Functions | |
BLCMDbug1021 () | |
Constructor. | |
virtual G4String | commandName () |
commandName() returns "bug1021". | |
virtual int | command (BLArgumentVector &argv, BLArgumentMap &namedArgs) |
command() implements the bug1021 command. | |
virtual void | defineNamedArgs () |
defineNamedArgs() defines the named arguments for this command. | |
void | callback (int type) |
callback() from BLCallback. | |
Private Attributes | |
bool | alreadyRegistered |
G4double | minStep |
BLCMDbug1021::BLCMDbug1021 | ( | ) |
Constructor.
References alreadyRegistered, BLCMDTYPE_PHYSICS, minStep, BLCommand::registerCommand(), BLCommand::setDescription(), and BLCommand::setSynopsis().
00147 { 00148 registerCommand(BLCMDTYPE_PHYSICS); 00149 setSynopsis("Workaround to improve accuracy of bug1021 in E field"); 00150 setDescription("When a charged particle turns around in an E field, " 00151 "a bug in the Geant4 transportation process can sometimes " 00152 "give it a wildly-incorrect kinetic energy. " 00153 "This workaround computes the distance to turn-around, " 00154 "and limits the step to half that vlue until minStep is " 00155 "reached; at that point the track is reflected.\n\n" 00156 "Simulations in which there are no E fields, or no charged " 00157 "particle ever gets below ~0.001 MeV in an E field, have " 00158 "no need to apply this workaround."); 00159 00160 alreadyRegistered = false; 00161 minStep = 0.002 * mm; 00162 }
virtual G4String BLCMDbug1021::commandName | ( | ) | [inline, virtual] |
int BLCMDbug1021::command | ( | BLArgumentVector & | argv, | |
BLArgumentMap & | namedArgs | |||
) | [virtual] |
command() implements the bug1021 command.
Implements BLCommand.
References alreadyRegistered, BLManager::getObject(), BLCommand::handleNamedArgs(), BLCommand::print(), and BLManager::registerCallback().
00165 { 00166 int retval = handleNamedArgs(namedArgs); 00167 00168 if(!alreadyRegistered) { 00169 BLManager::getObject()->registerCallback(this,0); 00170 alreadyRegistered = true; 00171 } 00172 00173 print(""); 00174 00175 return retval; 00176 }
void BLCMDbug1021::defineNamedArgs | ( | ) | [virtual] |
defineNamedArgs() defines the named arguments for this command.
Reimplemented from BLCommand.
References BLCommand::argDouble(), and minStep.
void BLCMDbug1021::callback | ( | int | type | ) | [virtual] |
bool BLCMDbug1021::alreadyRegistered [private] |
Referenced by BLCMDbug1021(), and command().
G4double BLCMDbug1021::minStep [private] |
Referenced by BLCMDbug1021(), callback(), and defineNamedArgs().