BLManager.hh

Go to the documentation of this file.
00001 //      BLManager.hh
00002 /*
00003 This source file is part of G4beamline, http://g4beamline.muonsinc.com
00004 Copyright (C) 2003,2004,2005,2006 by Tom Roberts, all rights reserved.
00005 
00006 This program is free software; you can redistribute it and/or
00007 modify it under the terms of the GNU General Public License
00008 as published by the Free Software Foundation; either version 2
00009 of the License, or (at your option) any later version.
00010 
00011 This program is distributed in the hope that it will be useful,
00012 but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 GNU General Public License for more details.
00015 
00016 http://www.gnu.org/copyleft/gpl.html
00017 */
00018 
00019 #ifndef BLMANAGER_HH
00020 #define BLMANAGER_HH
00021 
00022 #include <vector>
00023 #include <map>
00024 #include <set>
00025 #include "G4VUserDetectorConstruction.hh"
00026 #include "G4SteppingManager.hh"
00027 #include "G4Step.hh"
00028 #include "G4Track.hh"
00029 #include "G4Run.hh"
00030 #include "G4Event.hh"
00031 #include "G4VPhysicalVolume.hh"
00032 #include "G4VExceptionHandler.hh"
00033 
00034 #include "BLCallback.hh"
00035 #include "BLRunManager.hh"
00036 #include "BLPhysics.hh"
00037 #include "BLZStep.hh"
00038 #include "BLUserCode.hh"
00039 
00040 class BLBeam;
00041 
00042 
00043 // State SPECIAL is used for pre-tracking in collective mode -- all
00044 // entries into NTuples should be omitted in SPECIAL mode.
00045 enum BLManagerState { IDLE, VISUAL, TUNE, REFERENCE, BEAM, SPECIAL };
00046 enum VerboseFormat { TAG,NSTEP,GLOBAL,CL,CLX,KE,STEP,VOL,PROCESS,B,E,MAT,
00047                      P, ID, PART, SEG, WT, NEWLINE, EXT };
00048 enum PRNGSeedMethod { EVENT_NUMBER, NO_SEED, TIME_US };
00049 
00050 /**     BLManager is the overall manager for g4beamline, managing all aspects
00051  *      of the run.
00052  *
00053  *      Note it is uses all the G4 user action classes, implemented as classes
00054  *      under BLManager.
00055  *
00056  *      TrackID-s: It is non-trivial to preserve TrackID-s from input files,
00057  *      because Geant4 considers TrackID to be an internal variable, and it
00058  *      assigns them in a non-customizable manner. So BLManager keeps a
00059  *      trackIDMap[] that converts from internal (Geant4) to external (User)
00060  *      TrackID-s. It also uses BLTrackInfo to associate the external IDs
00061  *      with the track -- the external trackID is determined either in BLBeam
00062  *      (when the track is created), or in BLManager::PreUserTrackingAction
00063  *      for secondaries.
00064  **/
00065 class BLManager : public G4VUserDetectorConstruction, 
00066                         G4VExceptionHandler {
00067 public: // user Action classes
00068         class RunAction {
00069         public: virtual void BeginOfRunAction(const G4Run *run) = 0;
00070         public: virtual void EndOfRunAction(const G4Run *run) = 0;
00071         };
00072         class EventAction {
00073         public: virtual void BeginOfEventAction(const G4Event* event) = 0;
00074         public: virtual void EndOfEventAction(const G4Event* event) = 0;
00075         };
00076         class TrackingAction {
00077         protected: G4TrackingManager *fpTrackingManager;
00078         public: void SetTrackingManagerPointer(G4TrackingManager *p) 
00079                 {fpTrackingManager=p;}
00080         public: virtual void PreUserTrackingAction(const G4Track *track) = 0;
00081         public: virtual void PostUserTrackingAction(const G4Track *track) = 0;
00082         };
00083         class SteppingAction {
00084         public: virtual void UserSteppingAction(const G4Step *step) = 0;
00085         };
00086         class ZSteppingAction {
00087         public: virtual void UserZSteppingAction(const G4Track *track) = 0;
00088         };
00089         class PrimaryGeneratorAction {
00090         public: virtual void GeneratePrimaries(G4Event *event) = 0;
00091         };
00092         class StackingAction {
00093         // returns only fUrgent or fKill.
00094         public: virtual G4ClassificationOfNewTrack 
00095                                         ClassifyNewTrack(const G4Track*) = 0;
00096         public: virtual void NewStage() { }
00097         public: virtual void PrepareNewEvent() { }
00098         };
00099 private:
00100         struct ZStep {
00101                 G4double z;
00102                 ZSteppingAction *action;
00103                 ZStep(G4double _z, ZSteppingAction *a) { z=_z; action=a; }
00104         };
00105         static BLManager *blManager;
00106         static bool initialized;
00107         BLRunManager *runManager;
00108         BLManagerState state;
00109         G4int steppingVerbose;
00110         unsigned int  beamIndex;
00111         G4int histoUpdate;
00112         time_t startRun;
00113         time_t startEvent;
00114         G4int eventTimeLimit;
00115         BLPhysics *physics;
00116         G4VPhysicalVolume *worldPhysicalVolume;
00117         G4int eventID;
00118         G4int trackID;
00119         const G4Track *currentTrack;
00120         G4bool allExceptions;
00121         G4int fatalExceptions;
00122         G4int eventsAborted;
00123         G4int stuckTracks;
00124         G4int warnings;
00125         G4int prevEventID;
00126         G4int eventsProcessed;
00127         bool endRun;
00128         PRNGSeedMethod seedMethod;
00129         std::set<int> keepEventList;
00130         std::set<int> skipEventList;
00131         G4SteppingManager *fpSteppingManager;
00132         G4TrackingManager *fpTrackingManager;
00133         std::vector<BLBeam*> beamVector;
00134         std::vector<BLBeam*> referenceVector;
00135         std::vector<RunAction*> runActionVector;
00136         std::vector<RunAction*> beamRunActionVector;
00137         std::vector<EventAction*> eventActionVector;
00138         std::vector<EventAction*> beamEventActionVector;
00139         std::vector<TrackingAction*> trackingActionVector;
00140         std::vector<BLCallback*> preReferenceCallbackVector;
00141         std::vector<BLCallback*> postReferenceCallbackVector;
00142         std::vector<BLCallback*> postTrackingCallbackVector;
00143         std::vector<BLCallback*> replaceMainLoopCallbackVector;
00144         std::vector<BLCallback*> visualizationCallbackVector;
00145         std::vector<SteppingAction*> allStepVector;
00146         std::map<G4VPhysicalVolume*,SteppingAction*> allStepMap;
00147         std::map<G4VPhysicalVolume*,SteppingAction*> tpStepMap;
00148         std::map<G4VPhysicalVolume*,SteppingAction*> rpStepMap;
00149         std::vector<SteppingAction*> tpStepVector;
00150         std::vector<SteppingAction*> rpStepVector;
00151         std::map<G4VPhysicalVolume*,SteppingAction*> beamStepMap;
00152         std::vector<SteppingAction*> beamStepVector;
00153         std::vector<int> verboseFormat;
00154         G4double zTolerance;
00155         std::vector<ZStep> tuneZStep;
00156         std::vector<ZStep> referenceZStep;
00157         std::vector<ZStep> beamZStep;
00158         std::vector<ZStep> *currentZStep;
00159         unsigned indexZStep;
00160         G4double prevZ;
00161         G4int nStuckSteps;
00162         std::vector<StackingAction*> stackingActionVector;
00163         int nextSecondaryTrackID;
00164         std::map<G4int,G4int> trackIDMap;
00165         int primaryTrackID;
00166         int primaryParentID;
00167         std::vector<BLUserCode*> userCodeVector;
00168         std::map<G4String,int> exceptionCount;
00169         /// private constructor -- immediate construction only.
00170         BLManager();
00171         void insertZStep(std::vector<ZStep>& vector, G4double z, ZSteppingAction *action);
00172 public:
00173         /// getObject() will return a pointer to the single BLManager object,
00174         /// creating it if necessary. Does only the immediate constructor, not
00175         /// delayedConstruction(). that means it is Ok to register capabilities,
00176         /// but not much else.
00177         static BLManager *getObject();
00178 
00179         /// delayedConstruction() performs things which must wait until all
00180         /// static initializers have executed (e.g. in Geant4 routines).
00181         void delayedConstruction();
00182 
00183         /// Destructor.
00184         ~BLManager();
00185 
00186         /// getState() returns the current state.
00187         BLManagerState getState() { return state; }
00188 
00189         /// setState sets the state
00190         void setState(BLManagerState _state) { state = _state; }
00191 
00192         /// getSteppingVerbose() returns steppingVerbose. NOTE: use this
00193         /// during tracking instead of Param.getInt("steppingVerbose");
00194         int getSteppingVerbose() { return steppingVerbose; }
00195 
00196         /// setSteppingVerbose() updates steppingVerbose. -- NOTE: many
00197         /// other classes relay on the Parameter, not the valud in this class.
00198         void setSteppingVerbose(int v) { steppingVerbose = v; }
00199 
00200         /// getEventTimeLimit() returns the CPU time limit for events (seconds).
00201         /// -1 mean infinite.
00202         int getEventTimeLimit() { return eventTimeLimit; }
00203 
00204         /// setEventTimeLimit() sets the CPU time limit for events (seconds).
00205         /// -1 mean infinite.
00206         void setEventTimeLimit(int sec) { eventTimeLimit = sec; }
00207 
00208         /// getEventID() gets the current eventID;
00209         G4int getEventID() const { return eventID; }
00210 
00211         /// setEventID() sets the current eventID;
00212         void setEventID(int evId) { eventID=evId; prevEventID=evId-1; }
00213 
00214         /// skipEvent() determines if this EventID should be skipped. It
00215         /// checks keepEventList and skipEventList.
00216         bool skipEvent(int EventID) {
00217           if(skipEventList.count(EventID) > 0) return true;
00218           return keepEventList.size() > 0 && keepEventList.count(EventID) == 0;
00219         }
00220 
00221         /// setKeepEvent() puts EventID into the keepEventList.
00222         /// (if keepEventList is empty, all events are kept.)
00223         void setKeepEvent(int EventID) { keepEventList.insert(EventID); }
00224 
00225         /// setSkipEvent() puts EventID into the skipEventList.
00226         void setSkipEvent(int EventID) { skipEventList.insert(EventID); }
00227 
00228         /// incrEventsProcessed() will increment eventsProcessed.
00229         /// For special uses only (e.g.MPI).
00230         void incrEventsProcessed(int eventID);
00231 
00232         /// showAllExceptions() sets the flag that prevents thinning out
00233         /// multiple exception printouts. Returns the previous value.
00234         bool showAllExceptions(bool value=true)
00235                 { bool tmp=allExceptions;  allExceptions = value; return tmp; }
00236 
00237         /// registerSteppingAction() registers a SteppingAction to
00238         /// be called for each step (regardless of state).
00239         void registerSteppingAction(SteppingAction *sa)
00240                 { allStepVector.push_back(sa); }
00241 
00242         /// registerSteppingAction() registers a SteppingAction to
00243         /// be called for each step (regardless of state), for every step
00244         /// involving the physicalVol.
00245         /// The callback will be called if physicalVol is either
00246         /// the pre- or post-step physical volume (once if both).
00247         /// If physicalVol==0 it is called every reference particle step.
00248         /// LIMITATION: only one callback can be registered for a given 
00249         /// physicalVol (except 0).
00250         void registerSteppingAction(G4VPhysicalVolume *physicalVol,
00251                                                 SteppingAction *sa)
00252                 { if(physicalVol != 0) allStepMap[physicalVol] = sa;
00253                   else allStepVector.push_back(sa); }
00254 
00255         /// registerTuneParticleStep() registers a SteppingAction to
00256         /// be called for every tune particle step involving the physicalVol.
00257         /// The callback will be called if physicalVol is either
00258         /// the pre- or post-step physical volume (once if both).
00259         /// If physicalVol==0 it is called every tune particle step.
00260         /// LIMITATION: only one callback can be registered for a given 
00261         /// physicalVol (except 0).
00262         void registerTuneParticleStep(G4VPhysicalVolume *physicalVol,
00263                                         SteppingAction *sa)
00264                 { if(physicalVol != 0) tpStepMap[physicalVol] = sa; 
00265                   else tpStepVector.push_back(sa); }
00266 
00267         /// registerReferenceParticleStep() registers a SteppingAction to
00268         /// be called for every reference particle step involving the
00269         /// physicalVol.
00270         /// The callback will be called if physicalVol is either
00271         /// the pre- or post-step physical volume (once if both).
00272         /// If physicalVol==0 it is called every reference particle step.
00273         /// LIMITATION: only one callback can be registered for a given 
00274         /// physicalVol (except 0).
00275         void registerReferenceParticleStep(G4VPhysicalVolume *physicalVol,
00276                                         SteppingAction *sa)
00277                 { if(physicalVol != 0) rpStepMap[physicalVol] = sa; 
00278                   else rpStepVector.push_back(sa); }
00279 
00280         /// registerBeamStep() registers a SteppingAction to
00281         /// be called for every beam step involving the physicalVol.
00282         /// (beam particles are everything except reference and tune.)
00283         /// The callback will be called if physicalVol is either
00284         /// the pre- or post-step physical volume (once if both). 
00285         /// if physicalVol==0 it is called every beam step.
00286         /// LIMITATION: only one callback can be registered for a given 
00287         /// physicalVol (except 0).
00288         void registerBeamStep(G4VPhysicalVolume *physicalVol,
00289                                         SteppingAction *sa)
00290                 { if(physicalVol != 0) beamStepMap[physicalVol] = sa; 
00291                   else beamStepVector.push_back(sa); }
00292 
00293         /// registerZStep() will force a step to occur near the given z
00294         /// position, and will call the ZSteppingAction for it, interpolating
00295         /// to the desired z value (Centerline coords).
00296         /// when is a bitwise OR of 1=tune, 2=reference, 4=beam.
00297         void registerZStep(G4double z, ZSteppingAction *sa, G4int when=7);
00298 
00299         /// registerStackingAction() registers a StackingAction to be called
00300         /// by the Geant4 stacking manager.
00301         void registerStackingAction(StackingAction *sa)
00302                 { stackingActionVector.push_back(sa); }
00303 
00304         /// setSteppingFormat() sets the verbose printing format according
00305         /// to parameter "steppingFormat".
00306         void setSteppingFormat();
00307 
00308         /// getFormatHelp() returns a string with help text about valid format 
00309         /// items.
00310         G4String getFormatHelp();
00311 
00312         /// appendVerboseFormat() appends fmt to the format for printing when
00313         /// param steppingVerbose is nonzero
00314         void appendVerboseFormat(G4String fmt);
00315 
00316         /// steppingVerbosePrint() will print this step according to the current
00317         /// verboseFormat.
00318         /// Prints header if header != 0).
00319         void steppingVerbosePrint(const G4Step *step, const G4Track *track, int
00320                                                                 header=0);
00321 
00322         /// setSteppingManager() sets the pointer to the current
00323         /// G4SteppingManager.
00324         void setSteppingManager(G4SteppingManager *p) { fpSteppingManager = p; }
00325 
00326         /// getSteppingManager() returns a pointer to the current
00327         /// G4SteppingManager.
00328         G4SteppingManager *getSteppingManager() { return fpSteppingManager; }
00329 
00330         /// setTrackingManager() sets the pointer to the current
00331         /// G4TrackingManager.
00332         void setTrackingManager(G4TrackingManager *p) { fpTrackingManager = p; }
00333 
00334         /// initialize() will initialize the BLManager object, and the 
00335         /// geant4 kernel, thus constructing the geometry in the
00336         /// world group. Note that registerPhysics() must be called
00337         /// before initialize() (normally done by a "physics" command
00338         /// in the input file).
00339         void initialize();
00340 
00341         /// isInitialized() returns true if the BLManager has been initialized.
00342         static bool isInitialized() { return initialized; }
00343 
00344         /// trackTuneAndReferenceParticles() will generate and track the tune
00345         /// particle and then the reference particle.
00346         void trackTuneAndReferenceParticles();
00347 
00348         /// trackBeam() will generate the defined beam and track each event.
00349         void trackBeam();
00350 
00351         /// displayVisual() will display the detector visually.
00352         void displayVisual();
00353 
00354         /// displayGeometry() will display the geant4 geometry.
00355         /// This is a hierarchical ASCII listing of all volumes.
00356         /// if phys==0 then use the worldPhysicalVolume.
00357         void displayGeometry(G4VPhysicalVolume *phys=0, int level=0);
00358 
00359         /// registerPhysics() registers the BLPhysics object.
00360         /// It also sets the physics list to the BLRunManager, so following
00361         /// commands can find particle by name.
00362         void registerPhysics(BLPhysics *_physics)
00363                 { physics = _physics;
00364                   runManager->SetUserInitialization(physics->getPhysicsList());
00365                 }
00366         
00367         /// getPhysics returns the registered BLPhysics object.
00368         BLPhysics *getPhysics() { return physics; }
00369 
00370         /// registerBeam() registers a BLBeam object for beam generation.
00371         /// Multiple BLBeam objects can be registered, used in order.
00372         void registerBeam(BLBeam *_beam) { beamVector.push_back(_beam); }
00373 
00374         /// registerReference() registers a BLBeam object for reference 
00375         /// particle generation.
00376         /// Multiple BLBeam objects can be registered, used in order.
00377         void registerReference(BLBeam *_beam)
00378                 { referenceVector.push_back(_beam); }
00379 
00380         /// nReference() returns the number of reference particles registered.
00381         int nReference() { return referenceVector.size(); }
00382 
00383         /// registerRunAction() registers a UserRunAction.
00384         /// If beamOnly is true (the default), the callback is made only
00385         /// if state==BEAM.
00386         void registerRunAction(RunAction *a, G4bool beamOnly=true)
00387                 { if(beamOnly)
00388                         beamRunActionVector.push_back(a);
00389                   else
00390                         runActionVector.push_back(a);
00391                 }
00392 
00393         /// registerEventAction() registers a UserEventAction.
00394         /// If beamOnly is true (the default), the callback is made only
00395         /// if state==BEAM.
00396         void registerEventAction(EventAction *a, G4bool beamOnly=true)
00397                 { if(beamOnly)
00398                         beamEventActionVector.push_back(a);
00399                   else
00400                         eventActionVector.push_back(a);
00401                 }
00402 
00403         /// registerTrackingAction() registers a UserTackingAction.
00404         /// By default puts new entry at the back end of the vector;
00405         /// if front is true, puts new entry at the front.
00406         void registerTrackingAction(TrackingAction *a, bool front=false)
00407             { if(front)
00408                 trackingActionVector.insert(trackingActionVector.begin(),a); 
00409               else
00410                 trackingActionVector.push_back(a); 
00411             }
00412 
00413         /// registerUserCode() registers a BLUserCode instance.
00414         void registerUserCode(BLUserCode *instance)
00415                 { userCodeVector.push_back(instance); }
00416 
00417         /// getUserCodeInstances() returns a vector of all registered
00418         /// instances of BLUserCode with the specified type.
00419         std::vector<BLUserCode*> getUserCodeInstances(G4String type)
00420                 { std::vector<BLUserCode*> ret;
00421                   for(unsigned i=0; i<userCodeVector.size(); ++i) {
00422                         if(type == userCodeVector[i]->getType())
00423                                 ret.push_back(userCodeVector[i]);
00424                   }
00425                   return ret;
00426                 }
00427 
00428 
00429         /// registerCallback() registers a BLCallback.
00430         /// type=0 for pre-Tune particle,
00431         /// type=1 for post-Reference (pre-beam tracking),
00432         /// type=2 for post-beam tracking.
00433         /// type=3 for replacing the main program loop.
00434         /// type=4 for visualization.
00435         /// NOTE: if there are type=3 callbacks, when the last one returns
00436         /// the closes up by summarizing NTuples and callng handleCallbacks(2),
00437         /// and then the program exits. This prevents the main program loop from
00438         /// executing. type=3 callbacks are called just after the type=1
00439         /// callbacks (i.e. after the post-Reference callbacks).
00440         void registerCallback(BLCallback *cb, int type) {
00441                 if(type==0) preReferenceCallbackVector.push_back(cb);
00442                 else if(type==1) postReferenceCallbackVector.push_back(cb);
00443                 else if(type==2) postTrackingCallbackVector.push_back(cb);
00444                 else if(type==3) replaceMainLoopCallbackVector.push_back(cb);
00445                 else if(type==4) visualizationCallbackVector.push_back(cb);
00446         }
00447 
00448         /// handleCallbacks() calls all applicable registered callbacks.
00449         /// type=0 for pre-reference particle,
00450         /// type=1 for post-center (pre-beam tracking),
00451         /// type=2 for post-beam tracking (just before program exit).
00452         /// type=3 for replacing the main program loop.
00453         /// type=4 for visualization.
00454         void handleCallbacks(int type);
00455 
00456         /// getWorldPhysicalVolume() returns a pointer to the world PV.
00457         /// Note that it must already have been consructed, so this function
00458         /// returns NULL before construct() is called (by main).
00459         G4VPhysicalVolume *getWorldPhysicalVolume()
00460                 { return worldPhysicalVolume; }
00461 
00462         /// setPRNGSeedMethod() will set the method used to seed the
00463         /// pseudo random number generator at the start of each event.
00464         void setPRNGSeedMethod(PRNGSeedMethod method)
00465                 { seedMethod = method; }
00466 
00467         /// getPRNGSeedMethod() will return the method used to seed the
00468         /// pseudo random number generator at the start of each event.
00469         PRNGSeedMethod getPRNGSeedMethod() { return seedMethod; }
00470 
00471         // virtual functions from the geant4 base classes. All of them
00472         // call the registered actions, as appropriate for state and
00473         // the current physical volume (if applicable). Due to the design
00474         // of the Geant4 callback classes, these are mediated by classes of
00475         // the form BLManager_name.
00476 
00477         /// UserSteppingAction() from G4UserSteppingAction.
00478         void UserSteppingAction(const G4Step *step);
00479 
00480         /// Construct() from G4VUserDetectorConstruction.
00481         G4VPhysicalVolume *Construct();
00482 
00483         /// PreUserTrackingAction() from G4UserTrackingAction.
00484         void PreUserTrackingAction(const G4Track *track);
00485 
00486         /// PostUserTrackingAction() from G4UserTrackingAction.
00487         void PostUserTrackingAction(const G4Track *track);
00488 
00489         /// BeginOfRunAction() from G4UserRunAction.
00490         void BeginOfRunAction(const G4Run *run);
00491 
00492         /// EndOfRunAction() from G4UserRunAction.
00493         void EndOfRunAction(const G4Run *run);
00494 
00495         /// BeginOfEventAction() from G4UserEventAction.
00496         void BeginOfEventAction(const G4Event* event);
00497 
00498         /// EndOfEventAction() from G4UserEventAction.
00499         void EndOfEventAction(const G4Event* event);
00500 
00501         /// GeneratePrimaries() from G4VUserPrimaryGeneratorAction.
00502         void GeneratePrimaries(G4Event *event);
00503 
00504         /// ClassifyNewTrack() from G4UserStackingAction.
00505         G4ClassificationOfNewTrack ClassifyNewTrack(const G4Track*);
00506 
00507         /// NewStage() from G4userStackingAction.
00508         void NewStage();
00509 
00510         /// PrepareNewEvent() from G4StackingAction.
00511         void PrepareNewEvent();
00512 
00513         /// clearTrackIDMap() clears the TrackID map.
00514         void clearTrackIDMap() { trackIDMap.clear(); }
00515 
00516         /// setNextSecondaryTrackID() sets the external TrackID for the
00517         /// next secondary track. Automatically incremented for subsequent
00518         /// secondaries.
00519         void setNextSecondaryTrackID(int next) { nextSecondaryTrackID = next; }
00520         int getNextSecondaryTrackID() { return nextSecondaryTrackID; }
00521 
00522         /// getExternalTrackID() returns the external TrackID for the given
00523         /// track.
00524         /// In collective mode, internal and external trackID-s are the same.
00525         int getExternalTrackID(const G4Track *track);
00526 
00527         /// getExternalParentID() returns the external ParentID for the given
00528         /// track.
00529         /// In collective mode, internal and external trackID-s are the same.
00530         int getExternalParentID(const G4Track *track);
00531 
00532         /// setExternalTrackID() will set the external trackID and parentID.
00533         /// if trackID<0 uses nextSecondarTrackID++.
00534         void setExternalTrackID(G4Track *track, int trackID, int parentID);
00535 
00536         /// getPrimaryTrackID() returns the primaryTrackID set by the beam command
00537         int getPrimaryTrackID() { return primaryTrackID; }
00538 
00539         /// getPrimaryParentID() returns the primaryParentID set by the beam command
00540         int getPrimaryParentID() { return primaryParentID; }
00541 
00542         /// setPrimaryTrackID() sets track and parent IDs for a primary track.
00543         void setPrimaryTrackID(int t, int p)
00544                 { primaryTrackID = t; primaryParentID = p; }
00545 
00546         /// Notify() from G4VExceptionHandler.
00547         G4bool Notify(const char* originOfException, const char* exceptionCode,
00548                         G4ExceptionSeverity severity, const char* description);
00549 
00550         /// exceptionSummary() prints a summary of all exceptions
00551         void exceptionSummary();
00552 
00553         /// GSL error handler
00554         static void gsl_error_handler(const char *reason, const char *file,
00555                                                 int lineno, int gsl_errno);
00556 };
00557 
00558 #endif // BLMANAGER_HH
g4beamline