This is a "perfect" detector in that it does not perturb the beam at all, and intrinsically has the resolution of a float (it measures position and momentum and time).
The userSteppingAction() for the timentuple is called for every volume, and checks if the step brackets the time specified; if so it linearly interpolates to the specified time and enters the result into the NTuple.
Note that if a BLCoordinates instance is linked into the track, its centerline coordinates are used; otherwise global coordinates are used.
Public Member Functions | |
BLCMDtimentuple () | |
Default constructor. | |
virtual | ~BLCMDtimentuple () |
Destructor. | |
BLCMDtimentuple (const BLCMDtimentuple &r) | |
Copy constructor. | |
G4String | commandName () |
commandName() returns "timentuple". | |
int | command (BLArgumentVector &argv, BLArgumentMap &namedArgs) |
command() implements the timentuple command. | |
void | defineNamedArgs () |
defineNamedArgs() defines the named arguments for the command. | |
void | setName (G4String _name) |
Private Attributes | |
G4double | time |
G4String | name |
G4String | format |
G4String | filename |
G4String | require |
G4String | coordinates |
BLCoordinateType | coordinateType |
BLCMDtimentuple::BLCMDtimentuple | ( | ) |
Default constructor.
References BLCMDTYPE_DATA, BLCOORD_CENTERLINE, coordinates, coordinateType, BLCommand::description, filename, format, BLNTuple::getFormatList(), name, BLCommand::registerCommand(), require, BLCommand::setDescription(), BLCommand::setSynopsis(), and time.
Referenced by command().
00103 : BLCommand() 00104 { 00105 registerCommand(BLCMDTYPE_DATA); 00106 setSynopsis("Construct an NTuple of tracks at a specified time."); 00107 setDescription("A time NTuple generates an NTuple of every track at a\n" 00108 "specified global time.\n" 00109 "It uses a linear interpolation in the step that straddles " 00110 "the required time, so accuracy will suffer for large steps. " 00111 "The NTuple uses centerline coordinates, if available.\n" 00112 "NTuple Variables:\n" 00113 " X,Y,Z (mm)\n" 00114 " Px,Py,Pz (MeV/c)\n" 00115 " T (ns)\n" 00116 " PDGid (11=e-, 13=mu-, 22=gamma, 211=pi+, 2212=proton, ...)\n" 00117 " EventNum (inexact above 16,777,215)\n" 00118 " ParentID (0 => primary particle)\n\n" 00119 "Valid Formats (ignore case): "); 00120 description += BLNTuple::getFormatList(); 00121 00122 time = 0.0; 00123 name = ""; 00124 format = ""; 00125 filename = ""; 00126 require = ""; 00127 coordinates = "Centerline"; 00128 coordinateType = BLCOORD_CENTERLINE; 00129 }
BLCMDtimentuple::BLCMDtimentuple | ( | const BLCMDtimentuple & | r | ) |
Copy constructor.
References coordinates, coordinateType, filename, format, name, require, and time.
00131 : BLCommand(r) 00132 { 00133 time = r.time; 00134 name = r.name; 00135 format = r.format; 00136 filename = r.filename; 00137 G4String require; 00138 coordinates = r.coordinates; 00139 coordinateType = r.coordinateType; 00140 }
G4String BLCMDtimentuple::commandName | ( | ) | [inline, virtual] |
int BLCMDtimentuple::command | ( | BLArgumentVector & | argv, | |
BLArgumentMap & | namedArgs | |||
) | [virtual] |
command() implements the timentuple command.
Implements BLCommand.
References BLCMDtimentuple(), coordinates, coordinateType, filename, format, BLCoordinates::getCoordinateType(), BLManager::getObject(), BLCommand::handleNamedArgs(), name, BLCommand::print(), BLCommand::printError(), BLManager::registerBeamStep(), require, setName(), and time.
00147 { 00148 if(argv.size() != 1) { 00149 printError("timentuple: Invalid command, must have name"); 00150 return -1; 00151 } 00152 00153 if(argv[0] == "default") { 00154 return defaultTimeNTuple.handleNamedArgs(namedArgs); 00155 } 00156 00157 BLCMDtimentuple *t = new BLCMDtimentuple(defaultTimeNTuple); 00158 t->setName(argv[0]); 00159 int retval = t->handleNamedArgs(namedArgs); 00160 00161 t->coordinateType = BLCoordinates::getCoordinateType(t->coordinates); 00162 00163 t->print(argv[0]); 00164 00165 TimeNTuple *tn = new TimeNTuple(t->name,t->time,t->format,t->filename, 00166 t->require,t->coordinateType); 00167 BLManager::getObject()->registerBeamStep(0,tn); 00168 00169 return retval; 00170 }
void BLCMDtimentuple::defineNamedArgs | ( | ) | [virtual] |
defineNamedArgs() defines the named arguments for the command.
Reimplemented from BLCommand.
References BLCommand::argDouble(), BLCommand::argString(), coordinates, filename, format, require, and time.
00173 { 00174 argDouble(time,"time","The global time of the sampling (ns)."); 00175 argString(format,"format","The NTuple format (see above for list)."); 00176 argString(filename,"filename","The filename of the NTuple."); 00177 argString(filename,"file","Synonym for filename."); 00178 argString(require,"require","Expression which must be nonzero to include the track (default=1)",false); 00179 argString(coordinates,"coordinates","Coordinates: global, centerline, or reference (default=c)."); 00180 }
void BLCMDtimentuple::setName | ( | G4String | _name | ) | [inline] |
G4double BLCMDtimentuple::time [private] |
Referenced by BLCMDtimentuple(), command(), and defineNamedArgs().
G4String BLCMDtimentuple::name [private] |
Referenced by BLCMDtimentuple(), command(), and setName().
G4String BLCMDtimentuple::format [private] |
Referenced by BLCMDtimentuple(), command(), and defineNamedArgs().
G4String BLCMDtimentuple::filename [private] |
Referenced by BLCMDtimentuple(), command(), and defineNamedArgs().
G4String BLCMDtimentuple::require [private] |
Referenced by BLCMDtimentuple(), command(), and defineNamedArgs().
G4String BLCMDtimentuple::coordinates [private] |
Referenced by BLCMDtimentuple(), command(), and defineNamedArgs().
Referenced by BLCMDtimentuple(), and command().