G4SmartTrackStack.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$
00028 //
00029 //
00030 //  Last Modification : 04/Oct/12 S. Kamperis
00031 //
00032 
00033 
00034 #ifndef G4SmartTrackStack_h
00035 #define G4SmartTrackStack_h 1
00036 
00037 #include "G4StackedTrack.hh"
00038 #include "G4TrackStack.hh"
00039 #include "globals.hh"
00040 
00041 // class description:
00042 //
00043 // This is a 'smart' stack class used by G4StackManager. This class object
00044 // stores G4StackedTrack class objects in various dedicated stacks
00045 
00046 class G4SmartTrackStack
00047 {
00048   public:
00049       G4SmartTrackStack();
00050       ~G4SmartTrackStack();
00051 
00052   private:
00053       const G4SmartTrackStack & operator=
00054                           (const G4SmartTrackStack &right);
00055       G4int operator==(const G4SmartTrackStack &right) const;
00056       G4int operator!=(const G4SmartTrackStack &right) const;
00057 
00058   public:
00059       void PushToStack(const G4StackedTrack& aStackedTrack);
00060       G4StackedTrack PopFromStack();
00061       void clear();
00062       void clearAndDestroy();
00063       void TransferTo(G4TrackStack* aStack);
00064       G4double getEnergyOfStack(G4TrackStack* aTrackStack);
00065       void dumpStatistics();
00066 
00067   private:
00068       G4int fTurn;
00069       G4int nTurn; // should be 5
00070       G4double energies[5];
00071       G4TrackStack* stacks[5];
00072       // = 0 : all primaries and secondaries except followings
00073       // = 1 : secondary neutrons
00074       // = 2 : secondary electrons
00075       // = 3 : secondary gammas
00076       // = 4 : secondary positrons
00077       G4int maxNTracks;
00078       G4int nTracks;
00079 
00080   public:
00081       G4int GetNTrack() const { return nTracks; }
00082       G4int GetMaxNTrack() const { return maxNTracks; }
00083 
00084   private:
00085       inline G4int n_stackedTrack() const
00086       {
00087               return stacks[0]->GetNTrack() +
00088                      stacks[1]->GetNTrack() +
00089                      stacks[2]->GetNTrack() +
00090                      stacks[3]->GetNTrack() +
00091                      stacks[4]->GetNTrack();
00092       }
00093 };
00094 
00095 #endif
00096 

Generated on Mon May 27 17:49:51 2013 for Geant4 by  doxygen 1.4.7