G4TrackingManager.hh

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 //
00027 // $Id: G4TrackingManager.hh 67009 2013-01-29 16:00:21Z gcosmo $
00028 //
00029 //---------------------------------------------------------------
00030 //
00031 // G4TrackingManager.hh
00032 //
00033 // class description:
00034 //  This is an interface class among the event,  the track
00035 //  and the tracking category. It handles necessary 
00036 //  message passings between the upper hierarchical object, which 
00037 //  is the event manager (G4EventManager), and lower hierarchical 
00038 //  objects in the tracking category. It receives one track in an 
00039 //  event from the event manager and takes care to finish tracking it. 
00040 //  Geant4 kernel use only.
00041 //
00042 // Contact:
00043 //   Questions and comments to this code should be sent to
00044 //     Katsuya Amako  (e-mail: Katsuya.Amako@kek.jp)
00045 //     Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
00046 //
00047 //---------------------------------------------------------------
00048 
00049 class G4TrackingManager;
00050 
00051 #ifndef G4TrackingManager_h
00052 #define G4TrackingManager_h 1
00053 
00054 #include "globals.hh"                  // Include from 'global'
00056 #include "G4SteppingManager.hh"        // Include from 'tracking'
00057 #include "G4Track.hh"                  // Include from 'tracking'
00058 #include "G4TrackingMessenger.hh"
00059 #include "G4TrackVector.hh"            // Include from 'tracking'
00060 #include "G4TrackStatus.hh"            // Include from 'tracking'
00061 #include "G4StepStatus.hh"             // Include from 'tracking'
00062 #include "G4UserTrackingAction.hh"     // Include from 'tracking'
00063 #include "G4UserSteppingAction.hh"     // Include from 'tracking'
00064 #include "G4VTrajectory.hh"             // Include from 'tracking'
00065 
00066 class G4VUserTrackInformation;
00067 
00069 class G4TrackingManager 
00071 {
00072 
00073 //--------
00074 public: // without description
00075 //--------
00076 
00077 // Constructor/Destructor
00078 
00079    G4TrackingManager();
00080       // TrackingManger should be dynamic persistent, therefore you
00081       // need to invoke new() when you call this constructor.
00082       // "G4SteppingManger' and "G4UserTrackingAction" will be 
00083       // constructed in this constructor. "This" pointer will be
00084       // passed to "G4UserTrackingAction". 
00085 
00086    ~G4TrackingManager();
00087 
00088 // Get/Set functions
00089 
00090    G4Track* GetTrack() const;
00091 
00092    G4int GetStoreTrajectory() const;
00093    void SetStoreTrajectory(G4int value);
00094 
00095    G4SteppingManager* GetSteppingManager() const;
00096 
00097    G4UserTrackingAction* GetUserTrackingAction() const;
00098 
00099    G4VTrajectory* GimmeTrajectory() const;
00100    void SetTrajectory(G4VTrajectory* aTrajectory);
00101     
00102    G4TrackVector* GimmeSecondaries() const;
00103 
00104   //   void SetNavigator(G4Navigator* apValue);
00105 
00106    void SetUserAction(G4UserTrackingAction* apAction);
00107    void SetUserAction(G4UserSteppingAction* apAction);
00108 
00109    void SetVerboseLevel(G4int vLevel);
00110    G4int GetVerboseLevel() const;
00111 
00112 
00113 // Other member functions
00114 
00115    void ProcessOneTrack(G4Track* apValueG4Track);
00116       // Invoking this function, a G4Track given by the argument
00117       // will be tracked.  
00118 
00119    void EventAborted();
00120       // Invoking this function, the current tracking will be
00121       // aborted immediately. The tracking will return the 
00122       // G4TrackStatus in 'fUserKillTrackAndSecondaries'.
00123       // By this the EventManager deletes the current track and all 
00124       // its accoicated csecondaries.
00125 
00126    void SetUserTrackInformation(G4VUserTrackInformation* aValue);
00127       // This method can be invoked from the user's G4UserTrackingAction
00128       // implementation to set his/her own G4VUserTrackInformation concrete
00129       // class object to a G4Track object.
00130 
00131 //---------
00132    private:
00133 //---------
00134 
00135 // Member data
00136 
00137    G4Track* fpTrack;
00138    G4SteppingManager* fpSteppingManager;
00139    G4UserTrackingAction* fpUserTrackingAction;
00140    G4VTrajectory* fpTrajectory;
00141    G4int StoreTrajectory;
00142    G4int verboseLevel;
00143    G4TrackingMessenger* messenger;
00144    G4bool EventIsAborted;
00145 // verbose
00146    void TrackBanner();
00147 
00148 };
00149 
00150 
00151 //*******************************************************************
00152 //
00153 //  Inline function 
00154 //
00155 //*******************************************************************
00156 
00157    inline G4Track* G4TrackingManager::GetTrack() const { 
00158      return fpTrack;
00159    }
00160 
00161    inline G4int G4TrackingManager::GetStoreTrajectory() const { 
00162      return StoreTrajectory;
00163    }
00164 
00165    inline void G4TrackingManager::SetStoreTrajectory(G4int value){ 
00166      StoreTrajectory = value;
00167    }
00168 
00169    inline G4SteppingManager* G4TrackingManager::GetSteppingManager() const { 
00170      return fpSteppingManager; 
00171    }
00172 
00173    inline G4UserTrackingAction* G4TrackingManager::GetUserTrackingAction() const  { 
00174      return fpUserTrackingAction; 
00175    }
00176 
00177    inline G4VTrajectory* G4TrackingManager::GimmeTrajectory() const { 
00178      return fpTrajectory ; 
00179    }
00180     
00181    inline G4TrackVector* G4TrackingManager::GimmeSecondaries() const { 
00182      return fpSteppingManager->GetfSecondary(); 
00183    }
00184 
00185    inline void G4TrackingManager::SetUserAction(G4UserTrackingAction* apAction){
00186      fpUserTrackingAction = apAction;
00187      if(apAction != 0){
00188        apAction->SetTrackingManagerPointer(this);
00189      }  
00190    }
00191 
00192    inline void G4TrackingManager::SetUserAction(G4UserSteppingAction* apAction){
00193      fpSteppingManager->SetUserAction(apAction);
00194      if(apAction != 0){
00195        apAction->SetSteppingManagerPointer(fpSteppingManager);  
00196      }  
00197    }
00198 
00199    inline void G4TrackingManager::SetVerboseLevel(G4int vLevel){ 
00200      verboseLevel = vLevel; 
00201      fpSteppingManager -> SetVerboseLevel( vLevel );
00202    }
00203 
00204 
00205    inline G4int G4TrackingManager::GetVerboseLevel() const { 
00206      return verboseLevel; 
00207    }
00208 
00209    inline void G4TrackingManager::SetUserTrackInformation(G4VUserTrackInformation* aValue) {
00210      if(fpTrack) fpTrack->SetUserInformation(aValue);
00211    }
00212 
00213 #endif

Generated on Mon May 27 17:50:01 2013 for Geant4 by  doxygen 1.4.7