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_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 }


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

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.

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

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

callback() from BLCallback.

Reimplemented from BLCallback.

References minStep.

00184 {
00185         if(type == 0) (void)new Bug1021(minStep);
00186 }


Member Data Documentation

Referenced by BLCMDbug1021(), and command().

G4double BLCMDbug1021::minStep [private]


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