BLCMDbug1021 Class Reference

Inheritance diagram for BLCMDbug1021:

BLCommand BLCallback

List of all members.


Detailed Description

class BLCMDbug1021 adds a physics process to all charged particles to improve the accuracy whenever they turn around in an E field.

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


Constructor & Destructor Documentation

BLCMDbug1021::BLCMDbug1021 (  ) 

Constructor.

References alreadyRegistered, BLCMDTYPE_CONTROL, minStep, BLCommand::registerCommand(), BLCommand::setDescription(), and BLCommand::setSynopsis().

00149 {
00150         registerCommand(BLCMDTYPE_CONTROL);
00151         setSynopsis("Workaround to improve accuracy of bug1021 in E field");
00152         setDescription("When a charged particle turns around in an E field, "
00153                 "a bug in the Geant4 transportation process can sometimes "
00154                 "give it a wildly-incorrect kinetic energy. "
00155                 "This workaround computes the distance to turn-around, "
00156                 "and limits the step to half that vlue until minStep is "
00157                 "reached; at that point the track is reflected.\n\n"
00158                 "Simulations in which there are no E fields, or no charged "
00159                 "particle ever gets below ~0.001 MeV in an E field, have "
00160                 "no need to apply this workaround.");
00161 
00162         alreadyRegistered = false;
00163         minStep = 0.002 * mm;
00164 }


Member Function Documentation

virtual G4String BLCMDbug1021::commandName (  )  [inline, virtual]

commandName() returns "bug1021".

Implements BLCommand.

00041 { return "bug1021"; }

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().

00167 {
00168         int retval = handleNamedArgs(namedArgs);
00169 
00170         if(!alreadyRegistered) {
00171                 BLManager::getObject()->registerCallback(this,0);
00172                 alreadyRegistered = true;
00173         }
00174 
00175         print("");
00176 
00177         return retval;
00178 }

void BLCMDbug1021::defineNamedArgs (  )  [virtual]

defineNamedArgs() defines the named arguments for this command.

Reimplemented from BLCommand.

References BLCommand::argDouble(), and minStep.

00181 {
00182         argDouble(minStep,"minStep","Minimum step in space (mm, default=0.002)",mm);
00183 }

void BLCMDbug1021::callback ( int  type  )  [virtual]

callback() from BLCallback.

Reimplemented from BLCallback.

References minStep.

00186 {
00187         if(type == 0) (void)new Bug1021(minStep);
00188 }


Member Data Documentation

Referenced by BLCMDbug1021(), and command().

G4double BLCMDbug1021::minStep [private]


The documentation for this class was generated from the following file:
g4beamline