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] [ 10.5 ] [ 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 /processes/electromagnetic/dna/management/include/G4ITModelProcessor.hh (Version 11.3.0) and /processes/electromagnetic/dna/management/include/G4ITModelProcessor.hh (Version 10.5)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                         3 // * License and Disclaimer                                           *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th      5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided      6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License      7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/      8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.           9 // * include a list of copyright holders.                             *
 10 // *                                               10 // *                                                                  *
 11 // * Neither the authors of this software syst     11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file      15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitatio     16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                               17 // *                                                                  *
 18 // * This  code  implementation is the result      18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboratio     19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distri     20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  ag     21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publicati     22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Sof     23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // *******************************************     24 // ********************************************************************
 25 //                                                 25 //
 26 //                                                 26 //
 27 // Author: Mathieu Karamitros                      27 // Author: Mathieu Karamitros
 28                                                    28 
 29 // The code is developed in the framework of t     29 // The code is developed in the framework of the ESA AO7146
 30 //                                                 30 //
 31 // We would be very happy hearing from you, se     31 // We would be very happy hearing from you, send us your feedback! :)
 32 //                                                 32 //
 33 // In order for Geant4-DNA to be maintained an     33 // In order for Geant4-DNA to be maintained and still open-source,
 34 // article citations are crucial.                  34 // article citations are crucial. 
 35 // If you use Geant4-DNA chemistry and you pub     35 // If you use Geant4-DNA chemistry and you publish papers about your software, 
 36 // in addition to the general paper on Geant4-     36 // in addition to the general paper on Geant4-DNA:
 37 //                                                 37 //
 38 // Int. J. Model. Simul. Sci. Comput. 1 (2010)     38 // Int. J. Model. Simul. Sci. Comput. 1 (2010) 157–178
 39 //                                                 39 //
 40 // we would be very happy if you could please      40 // we would be very happy if you could please also cite the following
 41 // reference papers on chemistry:                  41 // reference papers on chemistry:
 42 //                                                 42 //
 43 // J. Comput. Phys. 274 (2014) 841-882             43 // J. Comput. Phys. 274 (2014) 841-882
 44 // Prog. Nucl. Sci. Tec. 2 (2011) 503-508          44 // Prog. Nucl. Sci. Tec. 2 (2011) 503-508 
 45                                                    45 
 46 #pragma once                                   <<  46 #ifndef G4ITMODELPROCESSOR_H
                                                   >>  47 #define G4ITMODELPROCESSOR_H
 47                                                    48 
                                                   >>  49 #include <vector>
 48 #include "G4ITReactionChange.hh"                   50 #include "G4ITReactionChange.hh"
 49 #include "G4ITType.hh"                             51 #include "G4ITType.hh"
 50 #include "G4ITModelHandler.hh"                     52 #include "G4ITModelHandler.hh"
 51 #include "G4ITStepStatus.hh"                       53 #include "G4ITStepStatus.hh"
 52 #include <vector>                              << 
 53                                                    54 
 54 class G4VITTimeStepComputer;                       55 class G4VITTimeStepComputer;
 55 class G4VITReactionProcess;                        56 class G4VITReactionProcess;
 56 class G4ITModelHandler;                            57 class G4ITModelHandler;
 57 class G4ITReactionSet;                             58 class G4ITReactionSet;
 58 class G4UserTimeStepAction;                        59 class G4UserTimeStepAction;
 59 class G4ITTrackingManager;                         60 class G4ITTrackingManager;
 60 class G4ITTrackHolder;                             61 class G4ITTrackHolder;
 61                                                    62 
                                                   >>  63 //#ifndef compTrackPerID__
                                                   >>  64 //#define compTrackPerID__
                                                   >>  65 //  struct compTrackPerID
                                                   >>  66 //  {
                                                   >>  67 //    bool operator()(G4Track* rhs, G4Track* lhs) const
                                                   >>  68 //    {
                                                   >>  69 //      return rhs->GetTrackID() < lhs->GetTrackID();
                                                   >>  70 //    }
                                                   >>  71 //  };
                                                   >>  72 //#endif
                                                   >>  73 
 62 /**                                                74 /**
 63  * The G4ITModelProcessor will call the two pr     75  * The G4ITModelProcessor will call the two processes defined in G4VITModel.
 64  * This processes act at the beginning and end     76  * This processes act at the beginning and end of each step.
 65  * The first one, the TimeStepper will calcula     77  * The first one, the TimeStepper will calculate a time step to propagate all
 66  * the track and eventually it can return some     78  * the track and eventually it can return some tracks that can likely react
 67  * at the end of the step.                         79  * at the end of the step.
 68  * The second one, the ReactionProcess will ma     80  * The second one, the ReactionProcess will make the tracks reacting.
 69  * \deprecated This class will be removed      << 
 70  */                                                81  */
 71 class G4ITModelProcessor                           82 class G4ITModelProcessor
 72 {                                                  83 {
 73 public:                                            84 public:
 74     G4ITModelProcessor();                      <<  85   G4ITModelProcessor();
 75     G4ITModelProcessor(const G4ITModelProcesso <<  86   virtual ~G4ITModelProcessor();
 76     G4ITModelProcessor& operator=(const G4ITMo << 
 77     virtual ~G4ITModelProcessor();             << 
 78                                                << 
 79     void SetModelHandler(G4ITModelHandler*);   << 
 80     void SetTrackingManager(G4ITTrackingManage << 
 81                                                    87 
 82     void Initialize();                         <<  88   inline void SetModelHandler(G4ITModelHandler*);
                                                   >>  89   void Initialize();
                                                   >>  90   //void Initialize(G4MIWorkspace* /*workspace*/);
                                                   >>  91 
                                                   >>  92   void RegisterModel(double time, G4VITStepModel*);
                                                   >>  93 
                                                   >>  94   /**
                                                   >>  95    * Restore original state of the modelProcessor.
                                                   >>  96    * This method should be call only by the G4Scheduler
                                                   >>  97    */
                                                   >>  98   inline void CleanProcessor();
                                                   >>  99 
                                                   >> 100   G4double CalculateMinTimeStep(G4double currentGlobalTime,
                                                   >> 101                                 G4double definedMinTimeStep);
                                                   >> 102 
                                                   >> 103   void ComputeTrackReaction(G4ITStepStatus fITStepStatus,
                                                   >> 104                             G4double fGlobalTime,
                                                   >> 105                             G4double currentTimeStep,
                                                   >> 106                             G4double previousTimeStep,
                                                   >> 107                             G4bool reachedUserTimeLimit,
                                                   >> 108                             G4double fTimeTolerance,
                                                   >> 109                             G4UserTimeStepAction* fpUserTimeStepAction,
                                                   >> 110                             G4int fVerbose);
                                                   >> 111 
                                                   >> 112   //____________________________________________________________
                                                   >> 113   // Time stepper part
                                                   >> 114   void InitializeStepper(G4double currentGlobalTime,
                                                   >> 115                          G4double userMinTime);
                                                   >> 116 
                                                   >> 117   bool GetComputeTimeStep()
                                                   >> 118   {
                                                   >> 119     return fComputeTimeStep;
                                                   >> 120   }
 83                                                   121 
 84     void RegisterModel(double time, G4VITStepM << 122 protected:
 85                                                << 
 86     /** Restore the original state. This metho << 
 87     void CleanProcessor();                     << 
 88                                                   123 
 89     G4double CalculateMinTimeStep(G4double cur << 124   inline void SetTrack(const G4Track*);
 90                                   G4double def << 
 91                                                   125 
 92     void ComputeTrackReaction(G4ITStepStatus f << 126 public:
 93                               G4double fGlobal << 127   void CalculateTimeStep(const G4Track*, const G4double);
 94                               G4double current << 128   void DoCalculateStep();
 95                               G4double previou << 
 96                               G4bool reachedUs << 
 97                               G4double fTimeTo << 
 98                               G4UserTimeStepAc << 
 99                               G4int fVerbose); << 
100                                                   129 
101     void InitializeStepper(G4double currentGlo << 130   //____________________________________________________________
102                            G4double userMinTim << 131   // Reaction process part
                                                   >> 132   void FindReaction(G4ITReactionSet* reactionSet,
                                                   >> 133                     const double currentStepTime,
                                                   >> 134                     const double previousStepTime,
                                                   >> 135                     const bool reachedUserStepTimeLimit);
                                                   >> 136 
                                                   >> 137   //____________________________________________________________
                                                   >> 138   // Get results
                                                   >> 139   inline const std::vector<std::vector<G4VITStepModel*> >* GetCurrentModel();
                                                   >> 140 
                                                   >> 141   inline std::vector<G4ITReactionChange*>* GetReactionInfo()
                                                   >> 142   {
                                                   >> 143     return &fReactionInfo;
                                                   >> 144   }
                                                   >> 145 
                                                   >> 146   const G4Track* GetTrack() const
                                                   >> 147   {
                                                   >> 148     return fpTrack;
                                                   >> 149   }
                                                   >> 150 
                                                   >> 151   void SetTrackingManager(G4ITTrackingManager* trackingManager)
                                                   >> 152   {
                                                   >> 153     fpTrackingManager = trackingManager;
                                                   >> 154   }
103                                                   155 
104     bool GetComputeTimeStep() const;           << 156 protected:
                                                   >> 157   void ExtractTimeStepperData();
105                                                   158 
106 public:                                        << 159   /** Copy constructor
107     const G4Track* GetTrack() const;           << 160    *  \param other Object to copy from
                                                   >> 161    */
                                                   >> 162   G4ITModelProcessor(const G4ITModelProcessor& other);
                                                   >> 163   /** Assignment operator
                                                   >> 164    *  \param other Object to assign from
                                                   >> 165    *  \return A reference to this
                                                   >> 166    */
                                                   >> 167   G4ITModelProcessor& operator=(const G4ITModelProcessor& other);
                                                   >> 168 
                                                   >> 169   //_____________________________
                                                   >> 170   // Members
                                                   >> 171 
                                                   >> 172   G4double fTSTimeStep;
                                                   >> 173   G4ITReactionSet* fReactionSet;
                                                   >> 174   G4ITTrackingManager* fpTrackingManager;
                                                   >> 175   G4ITTrackHolder* fpTrackContainer;
                                                   >> 176 
                                                   >> 177   G4bool fInitialized;
                                                   >> 178   G4ITModelHandler* fpModelHandler;
                                                   >> 179 
                                                   >> 180   const G4Track* fpTrack;
                                                   >> 181   G4double fUserMinTimeStep;
                                                   >> 182 
                                                   >> 183   // Interactions between different IT types
                                                   >> 184   // eg : electron/proton
                                                   >> 185   std::vector<std::vector<G4VITStepModel*> > fCurrentModel;
                                                   >> 186 
                                                   >> 187   // Interactions between ITs of the same type
                                                   >> 188   // eg : molecule/molecule or electron/electron
                                                   >> 189   G4VITStepModel* fpModel;
                                                   >> 190   G4ITModelManager* fpModelManager;
108                                                   191 
109 protected:                                     << 192   G4ITType fCurrentType1;
110     void SetTrack(const G4Track*);             << 193   G4ITType fCurrentType2;
111                                                   194 
112     G4double fTSTimeStep;                      << 195   std::vector<G4ITReactionChange*> fReactionInfo;
113     G4ITReactionSet* fReactionSet;             << 
114     G4ITTrackingManager* fpTrackingManager;    << 
115     G4ITTrackHolder* fpTrackContainer;         << 
116                                                   196 
117     G4bool fInitialized;                       << 197   bool fComputeTimeStep;
118     G4ITModelHandler* fpModelHandler;          << 198   bool fComputeReaction;
                                                   >> 199 };
119                                                   200 
120     const G4Track* fpTrack;                    << 201 ///
121     G4double fUserMinTimeStep;                 << 202 // Inline methods
                                                   >> 203 ///
122                                                   204 
123     std::vector<G4VITStepModel*> fActiveModels << 205 inline void G4ITModelProcessor::SetTrack(const G4Track* track)
124     G4VITStepModel* fpActiveModelWithMinTimeSt << 206 {
                                                   >> 207   fpTrack = track;
                                                   >> 208 }
125                                                   209 
126     std::vector<std::unique_ptr<G4ITReactionCh << 210 inline const std::vector<std::vector<G4VITStepModel*> >* G4ITModelProcessor::GetCurrentModel()
                                                   >> 211 {
                                                   >> 212   return &fCurrentModel;
                                                   >> 213 }
127                                                   214 
128     bool fComputeTimeStep;                     << 215 inline void G4ITModelProcessor::SetModelHandler(G4ITModelHandler* modelHandler)
129     bool fComputeReaction;                     << 216 {
130 };                                             << 217   if (fInitialized == 1)
                                                   >> 218   {
                                                   >> 219     G4ExceptionDescription exceptionDescription;
                                                   >> 220     exceptionDescription
                                                   >> 221         << "You are trying to set a new model while the model processor has alreaday be initialized";
                                                   >> 222     G4Exception("G4ITModelProcessor::SetModelHandler", "ITModelProcessor001",
                                                   >> 223                 FatalErrorInArgument, exceptionDescription);
                                                   >> 224   }
                                                   >> 225   fpModelHandler = modelHandler;
                                                   >> 226 }
131                                                   227 
                                                   >> 228 inline void G4ITModelProcessor::CleanProcessor()
                                                   >> 229 {
                                                   >> 230   fpTrack = 0;
                                                   >> 231 }
                                                   >> 232 #endif // G4ITMODELPROCESSOR_H
132                                                   233