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 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /global/management/include/G4PhysicsTable.hh (Version 11.3.0) and /global/management/include/G4PhysicsTable.hh (Version 6.2.p1)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                    <<   3 // * DISCLAIMER                                                       *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th <<   5 // * The following disclaimer summarizes all the specific disclaimers *
  6 // * the Geant4 Collaboration.  It is provided <<   6 // * of contributors to this software. The specific disclaimers,which *
  7 // * conditions of the Geant4 Software License <<   7 // * govern, are listed with their locations in:                      *
  8 // * LICENSE and available at  http://cern.ch/ <<   8 // *   http://cern.ch/geant4/license                                  *
  9 // * include a list of copyright holders.      << 
 10 // *                                                9 // *                                                                  *
 11 // * Neither the authors of this software syst     10 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     11 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     12 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     13 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file  <<  14 // * use.                                                             *
 16 // * for the full disclaimer and the limitatio << 
 17 // *                                               15 // *                                                                  *
 18 // * This  code  implementation is the result  <<  16 // * This  code  implementation is the  intellectual property  of the *
 19 // * technical work of the GEANT4 collaboratio <<  17 // * GEANT4 collaboration.                                            *
 20 // * By using,  copying,  modifying or  distri <<  18 // * By copying,  distributing  or modifying the Program (or any work *
 21 // * any work based  on the software)  you  ag <<  19 // * based  on  the Program)  you indicate  your  acceptance of  this *
 22 // * use  in  resulting  scientific  publicati <<  20 // * statement, and all its terms.                                    *
 23 // * acceptance of all terms of the Geant4 Sof << 
 24 // *******************************************     21 // ********************************************************************
 25 //                                                 22 //
 26 // G4PhysicsTable                              <<  23 //
                                                   >>  24 // $Id: G4PhysicsTable.hh,v 1.13 2003/11/04 10:38:03 kurasige Exp $
                                                   >>  25 // GEANT4 tag $Name: geant4-06-00-patch-01 $
                                                   >>  26 //
                                                   >>  27 // 
                                                   >>  28 // ------------------------------------------------------------
                                                   >>  29 //      GEANT 4 class header file
 27 //                                                 30 //
 28 // Class description:                              31 // Class description:
 29 //                                                 32 //
 30 // G4PhysicsTable is an utility class for stor     33 // G4PhysicsTable is an utility class for storage of pointers
 31 // to G4PhysicsVector containers. It derives a     34 // to G4PhysicsVector containers. It derives all functionalities
 32 // of STL vector containers with the addition      35 // of STL vector containers with the addition of few methods for
 33 // compatibility with previous implementation      36 // compatibility with previous implementation based on Rogue-Wave
 34 // pointer collections.                            37 // pointer collections.
 35 // The constructor given the 'capacity' of the     38 // The constructor given the 'capacity' of the table, pre-allocates
 36 // memory for the specified value by invoking      39 // memory for the specified value by invoking the STL's reserve()
 37 // function, in order to avoid reallocation du     40 // function, in order to avoid reallocation during insertions.
 38 // G4PhysicsTable has a vector of Boolean whic <<  41 // ------------------------------------------------------------
 39 // as 'recalc-needed' flags when processes cal <<  42 //
                                                   >>  43 // History:
                                                   >>  44 // -------
                                                   >>  45 // - First implementation, based on object model of
                                                   >>  46 //   2nd December 1995. G.Cosmo
                                                   >>  47 // - 1st March 1996, modified. K.Amako
                                                   >>  48 // - 24th February 2001, migration to STL vectors. H.Kurashige
                                                   >>  49 // - 9th March 2001, added Store/RetrievePhysicsTable. H.Kurashige
                                                   >>  50 //-------------------------------------
 40                                                    51 
 41 // Author: G.Cosmo, 2 December 1995            <<  52 #ifndef G4PhysicsTable_h
 42 //         First implementation based on objec <<  53 #define G4PhysicsTable_h 1
 43 // Revisions:                                  << 
 44 // - 1st March 1996, K.Amako: modified         << 
 45 // - 24th February 2001, H.Kurashige: migratio << 
 46 // ------------------------------------------- << 
 47 #ifndef G4PhysicsTable_hh                      << 
 48 #define G4PhysicsTable_hh 1                    << 
 49                                                    54 
 50 #include "G4PhysicsVector.hh"                  << 
 51 #include "G4ios.hh"                            << 
 52 #include "globals.hh"                          << 
 53 #include <vector>                                  55 #include <vector>
                                                   >>  56 #include "globals.hh"
                                                   >>  57 #include "G4ios.hh"
                                                   >>  58 
                                                   >>  59 class G4PhysicsVector;
 54                                                    60 
 55 class G4PhysicsTable : public std::vector<G4Ph <<  61 class G4PhysicsTable : public std::vector<G4PhysicsVector*> 
 56 {                                                  62 {
 57   using G4PhysCollection = std::vector<G4Physi << 
 58   using G4FlagCollection = std::vector<G4bool> << 
 59                                                    63 
 60  public:                                       <<  64   typedef std::vector<G4PhysicsVector*> G4PhysCollection;
 61   G4PhysicsTable() = default;                  << 
 62   // Default constructor                       << 
 63                                                    65 
 64   explicit G4PhysicsTable(size_t cap);         <<  66  public: // with description
 65   // Constructor with capacity. Reserves memor << 
 66                                                    67 
 67   virtual ~G4PhysicsTable();                   <<  68   G4PhysicsTable();
 68   // Destructor. Does not invoke deletion of c <<  69     // Default constructor.
 69                                                    70 
 70   G4PhysicsTable(const G4PhysicsTable&) = dele <<  71   G4PhysicsTable(size_t capacity);
 71   G4PhysicsTable& operator=(const G4PhysicsTab <<  72     // Constructor with capacity. Reserves memory for the
                                                   >>  73     // specified capacity.
 72                                                    74 
 73   G4PhysicsVector*& operator()(std::size_t);   <<  75   virtual ~G4PhysicsTable();
 74   G4PhysicsVector* const& operator()(std::size <<  76     // Destructor.
 75   // Access operators                          <<  77     // Does not invoke deletion of contained pointed collections.
 76                                                    78 
 77   void clearAndDestroy();                      <<  79   G4PhysicsVector*& operator()(size_t);
 78   // Removes all items and deletes them at the <<  80   G4PhysicsVector* const& operator()(size_t) const;
                                                   >>  81     // Access operators.
 79                                                    82 
 80   void push_back(G4PhysicsVector*);            <<  83   void clearAndDestroy();
 81   void insert(G4PhysicsVector*);               <<  84     // Removes all items and deletes them at the same time.
 82   // Pushes new element to collection          << 
 83                                                    85 
 84   void insertAt(std::size_t, G4PhysicsVector*) <<  86   void   insert (G4PhysicsVector*);
 85   // Insert element at the specified position  <<  87     // Pushes new element to collection.
 86                                                    88 
 87   void resize(std::size_t, G4PhysicsVector* ve <<  89   void   insertAt (size_t, G4PhysicsVector*); 
 88   // Resize collection                         <<  90     // Inserts element at the specified position in the collection.
 89                                                    91 
 90   std::size_t entries() const;                 <<  92   size_t entries() const;
 91   std::size_t length() const;                  <<  93   size_t length() const;
 92   // Return collection's size                  <<  94     // Return collection's size.
 93                                                    95 
 94   G4bool isEmpty() const;                          96   G4bool isEmpty() const;
 95   // Flags if collection is empty or not       <<  97     // Flags if collection is empty or not.
 96                                                    98 
 97   G4bool ExistPhysicsTable(const G4String& fil     99   G4bool ExistPhysicsTable(const G4String& fileName) const;
 98   // Check if the specified file exists or not << 100     // Check if the specified file exists or not
 99                                                << 
100   G4bool StorePhysicsTable(const G4String& fil << 
101   // Stores PhysicsTable in a file (returns fa << 
102                                                   101 
103   G4bool RetrievePhysicsTable(const G4String&  << 102   G4bool StorePhysicsTable(const G4String& filename, G4bool ascii=false);
104   // Retrieves Physics from a file (returns fa << 103     // Stores PhysicsTable in a file (returns false in case of failure).
105                                                << 104   
106   void ResetFlagArray();                       << 105   G4bool RetrievePhysicsTable(const G4String& filename, G4bool ascii=false);
107   // Reset the array of flags and all flags ar << 106     // Retrieves Physics from a file (returns false in case of failure).
108   // This flag is supposed to be used as "reca << 
109   // associated with each physics vector       << 
110                                                << 
111   G4bool GetFlag(std::size_t i) const;         << 
112   void ClearFlag(std::size_t i);               << 
113   // Get/Clear the flag for the 'i-th' physics << 
114                                                   107 
115   friend std::ostream& operator<<(std::ostream    108   friend std::ostream& operator<<(std::ostream& out, G4PhysicsTable& table);
116                                                   109 
117  protected:                                       110  protected:
118   G4PhysicsVector* CreatePhysicsVector(G4int t << 111 
119   G4FlagCollection vecFlag;                    << 112   G4PhysicsVector* CreatePhysicsVector(G4int type);  
                                                   >> 113 
                                                   >> 114  private:
                                                   >> 115 
                                                   >> 116   G4PhysicsTable(const G4PhysicsTable&);
                                                   >> 117   G4PhysicsTable& operator=(const G4PhysicsTable&);
                                                   >> 118     // Private copy constructor and assignment operator.
                                                   >> 119 
120 };                                                120 };
121                                                   121 
                                                   >> 122 typedef G4PhysicsTable::iterator G4PhysicsTableIterator;
                                                   >> 123 
                                                   >> 124 #include "G4PhysicsVector.hh"
122 #include "G4PhysicsTable.icc"                     125 #include "G4PhysicsTable.icc"
123                                                   126 
124 #endif                                            127 #endif
125                                                   128