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

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


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

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

void BLCMDbug1021::defineNamedArgs (  )  [virtual]

defineNamedArgs() defines the named arguments for this command.

Reimplemented from BLCommand.

References BLCommand::argDouble(), and minStep.

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

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

callback() from BLCallback.

Reimplemented from BLCallback.

References minStep.

00188 {
00189         if(type == 0) (void)new Bug1021(minStep);
00190 }


Member Data Documentation

Referenced by BLCMDbug1021(), and command().

G4double BLCMDbug1021::minStep [private]


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