Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/processes/electromagnetic/dna/management/src/G4ITStepProcessor2.cc

Version: [ ReleaseNotes ] [ 1.0 ] [ 1.1 ] [ 2.0 ] [ 3.0 ] [ 3.1 ] [ 3.2 ] [ 4.0 ] [ 4.0.p1 ] [ 4.0.p2 ] [ 4.1 ] [ 4.1.p1 ] [ 5.0 ] [ 5.0.p1 ] [ 5.1 ] [ 5.1.p1 ] [ 5.2 ] [ 5.2.p1 ] [ 5.2.p2 ] [ 6.0 ] [ 6.0.p1 ] [ 6.1 ] [ 6.2 ] [ 6.2.p1 ] [ 6.2.p2 ] [ 7.0 ] [ 7.0.p1 ] [ 7.1 ] [ 7.1.p1 ] [ 8.0 ] [ 8.0.p1 ] [ 8.1 ] [ 8.1.p1 ] [ 8.1.p2 ] [ 8.2 ] [ 8.2.p1 ] [ 8.3 ] [ 8.3.p1 ] [ 8.3.p2 ] [ 9.0 ] [ 9.0.p1 ] [ 9.0.p2 ] [ 9.1 ] [ 9.1.p1 ] [ 9.1.p2 ] [ 9.1.p3 ] [ 9.2 ] [ 9.2.p1 ] [ 9.2.p2 ] [ 9.2.p3 ] [ 9.2.p4 ] [ 9.3 ] [ 9.3.p1 ] [ 9.3.p2 ] [ 9.4 ] [ 9.4.p1 ] [ 9.4.p2 ] [ 9.4.p3 ] [ 9.4.p4 ] [ 9.5 ] [ 9.5.p1 ] [ 9.5.p2 ] [ 9.6 ] [ 9.6.p1 ] [ 9.6.p2 ] [ 9.6.p3 ] [ 9.6.p4 ] [ 10.0 ] [ 10.0.p1 ] [ 10.0.p2 ] [ 10.0.p3 ] [ 10.0.p4 ] [ 10.1 ] [ 10.1.p1 ] [ 10.1.p2 ] [ 10.1.p3 ] [ 10.2 ] [ 10.2.p1 ] [ 10.2.p2 ] [ 10.2.p3 ] [ 10.3 ] [ 10.3.p1 ] [ 10.3.p2 ] [ 10.3.p3 ] [ 10.4 ] [ 10.4.p1 ] [ 10.4.p2 ] [ 10.4.p3 ] [ 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/src/G4ITStepProcessor2.cc (Version 11.3.0) and /processes/electromagnetic/dna/management/src/G4ITStepProcessor2.cc (Version 10.4.p1)


  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 // $Id: G4ITStepProcessor2.cc 94218 2015-11-09 08:24:48Z gcosmo $
 26 //                                                 27 //
 27 // Author: Mathieu Karamitros (kara (AT) cenbg     28 // Author: Mathieu Karamitros (kara (AT) cenbg . in2p3 . fr) 
 28 //                                                 29 //
 29 // History:                                        30 // History:
 30 // -----------                                     31 // -----------
 31 // 10 Oct 2011 M.Karamitros created                32 // 10 Oct 2011 M.Karamitros created
 32 //                                                 33 //
 33 // -------------------------------------------     34 // -------------------------------------------------------------------
 34                                                    35 
 35 #include "G4ITStepProcessor.hh"                    36 #include "G4ITStepProcessor.hh"
 36 #include "G4LossTableManager.hh"                   37 #include "G4LossTableManager.hh"
 37 #include "G4EnergyLossTables.hh"                   38 #include "G4EnergyLossTables.hh"
 38 #include "G4ProductionCuts.hh"                     39 #include "G4ProductionCuts.hh"
 39 #include "G4ProductionCutsTable.hh"                40 #include "G4ProductionCutsTable.hh"
 40 #include "G4VITProcess.hh"                         41 #include "G4VITProcess.hh"
 41 #include "G4TrackingInformation.hh"                42 #include "G4TrackingInformation.hh"
 42 #include "G4IT.hh"                                 43 #include "G4IT.hh"
 43 #include "G4ITTrackingManager.hh"                  44 #include "G4ITTrackingManager.hh"
 44 #include "G4ITTransportation.hh"                   45 #include "G4ITTransportation.hh"
 45                                                    46 
 46 #include "G4ITNavigator.hh"             // Inc     47 #include "G4ITNavigator.hh"             // Include from 'geometry'
 47                                                    48 
 48 #include "G4ITSteppingVerbose.hh"                  49 #include "G4ITSteppingVerbose.hh"
 49 #include "G4VITSteppingVerbose.hh"                 50 #include "G4VITSteppingVerbose.hh"
 50                                                    51 
 51 #include "G4ITTrackHolder.hh"                      52 #include "G4ITTrackHolder.hh"
 52 #include "G4ITReaction.hh"                         53 #include "G4ITReaction.hh"
 53                                                    54 
                                                   >>  55 #include "G4TrackingInformation.hh"
 54                                                    56 
 55 //#define DEBUG_MEM 1                              57 //#define DEBUG_MEM 1
 56                                                    58 
 57 #ifdef DEBUG_MEM                                   59 #ifdef DEBUG_MEM
 58 #include "G4MemStat.hh"                            60 #include "G4MemStat.hh"
 59 using namespace G4MemStat;                         61 using namespace G4MemStat;
 60 using G4MemStat::MemStat;                          62 using G4MemStat::MemStat;
 61 #endif                                             63 #endif
 62                                                    64 
 63 void G4ITStepProcessor::DealWithSecondaries(G4     65 void G4ITStepProcessor::DealWithSecondaries(G4int& counter)
 64 {                                                  66 {
 65   // Now Store the secondaries from ParticleCh     67   // Now Store the secondaries from ParticleChange to SecondaryList
 66   G4Track* tempSecondaryTrack;                     68   G4Track* tempSecondaryTrack;
 67                                                    69 
 68   for(G4int DSecLoop = 0; DSecLoop < fpParticl     70   for(G4int DSecLoop = 0; DSecLoop < fpParticleChange->GetNumberOfSecondaries();
 69       DSecLoop++)                                  71       DSecLoop++)
 70   {                                                72   {
 71     tempSecondaryTrack = fpParticleChange->Get     73     tempSecondaryTrack = fpParticleChange->GetSecondary(DSecLoop);
 72                                                    74 
 73     if(tempSecondaryTrack->GetDefinition()->Ge     75     if(tempSecondaryTrack->GetDefinition()->GetApplyCutsFlag())
 74     {                                              76     {
 75       ApplyProductionCut(tempSecondaryTrack);      77       ApplyProductionCut(tempSecondaryTrack);
 76     }                                              78     }
 77                                                    79 
 78     // Set parentID                                80     // Set parentID
 79     tempSecondaryTrack->SetParentID(fpTrack->G     81     tempSecondaryTrack->SetParentID(fpTrack->GetTrackID());
 80                                                    82 
 81     // Set the process pointer which created t     83     // Set the process pointer which created this track
 82     tempSecondaryTrack->SetCreatorProcess(fpCu     84     tempSecondaryTrack->SetCreatorProcess(fpCurrentProcess);
 83                                                    85 
 84     // If this 2ndry particle has 'zero' kinet     86     // If this 2ndry particle has 'zero' kinetic energy, make sure
 85     // it invokes a rest process at the beginn     87     // it invokes a rest process at the beginning of the tracking
 86     if(tempSecondaryTrack->GetKineticEnergy()      88     if(tempSecondaryTrack->GetKineticEnergy() <= DBL_MIN)
 87     {                                              89     {
 88       G4ProcessManager* pm = tempSecondaryTrac     90       G4ProcessManager* pm = tempSecondaryTrack->GetDefinition()->GetProcessManager();
 89       if (pm->GetAtRestProcessVector()->entrie     91       if (pm->GetAtRestProcessVector()->entries()>0)
 90       {                                            92       {
 91         tempSecondaryTrack->SetTrackStatus( fS     93         tempSecondaryTrack->SetTrackStatus( fStopButAlive );
 92         fpSecondary->push_back( tempSecondaryT     94         fpSecondary->push_back( tempSecondaryTrack );
 93         fN2ndariesAtRestDoIt++;                    95         fN2ndariesAtRestDoIt++;
 94       }                                            96       }
 95       else                                         97       else
 96       {                                            98       {
 97         delete tempSecondaryTrack;                 99         delete tempSecondaryTrack;
 98       }                                           100       }
 99     }                                             101     }
100     else                                          102     else
101     {                                             103     {
102       fpSecondary->push_back( tempSecondaryTra    104       fpSecondary->push_back( tempSecondaryTrack );
103       counter++;                                  105       counter++;
104     }                                             106     }
105   } //end of loop on secondary                    107   } //end of loop on secondary
106 }                                                 108 }
107                                                   109 
108 //____________________________________________    110 //_________________________________________________________________________
109                                                   111 
110 void G4ITStepProcessor::DoIt(double timeStep)     112 void G4ITStepProcessor::DoIt(double timeStep)
111                                                   113 
112 // Call the process having the min step length    114 // Call the process having the min step length or just propagate the track on the given time step
113                                                   115 
114 // If the track is "leading the step" (ie one     116 // If the track is "leading the step" (ie one of its process has been selected
115 // as the one having the minimum time step ove    117 // as the one having the minimum time step over all tracks and processes),
116 // it will undergo its selected processes. Oth    118 // it will undergo its selected processes. Otherwise, it will just propagate the track
117 // on the given time step.                        119 // on the given time step.
118                                                   120 
119 {                                                 121 {
120   if(fpVerbose != nullptr) fpVerbose->DoItStar << 122   if(fpVerbose) fpVerbose->DoItStarted();
121                                                   123 
122   G4TrackManyList* mainList = fpTrackContainer    124   G4TrackManyList* mainList = fpTrackContainer->GetMainList();
123   G4TrackManyList::iterator it = mainList->end    125   G4TrackManyList::iterator it = mainList->end();
124   it--;                                           126   it--;
125   std::size_t initialSize = mainList->size();  << 127   size_t initialSize = mainList->size();
126                                                   128 
127 //    G4cout << "initialSize = " << initialSiz << 129   //  G4cout << "initialSize = " << initialSize << G4endl;
128                                                   130 
129   for(std::size_t i = 0 ; i < initialSize ; ++ << 131   for(size_t i = 0 ; i < initialSize ; ++i)
130   {                                               132   {
131                                                   133 
132 //      G4cout << "i = " << i << G4endl;       << 134     //  G4cout << "i = " << i << G4endl;
133                                                   135 
134     G4Track* track = *it;                         136     G4Track* track = *it;
135     if (track == nullptr)                      << 137     if (!track)
136     {                                             138     {
137       G4ExceptionDescription exceptionDescript    139       G4ExceptionDescription exceptionDescription;
138       exceptionDescription << "No track was po    140       exceptionDescription << "No track was pop back the main track list.";
139       G4Exception("G4ITStepProcessor::DoIt", "    141       G4Exception("G4ITStepProcessor::DoIt", "NO_TRACK",
140                   FatalException, exceptionDes    142                   FatalException, exceptionDescription);
141     }                                             143     }
142     // G4TrackManyList::iterator next_it (it);    144     // G4TrackManyList::iterator next_it (it);
143     // next_it--;                                 145     // next_it--;
144     // it = next_it;                              146     // it = next_it;
145                                                   147 
146     it--;                                         148     it--;
147     // Must be called before EndTracking(track    149     // Must be called before EndTracking(track)
148     // Otherwise the iterator will point to th    150     // Otherwise the iterator will point to the list of killed tracks
149                                                   151 
150     if(track->GetTrackStatus() == fStopAndKill    152     if(track->GetTrackStatus() == fStopAndKill)
151     {                                             153     {
152       fpTrackingManager->EndTracking(track);      154       fpTrackingManager->EndTracking(track);
153 //      G4cout << GetIT(track)->GetName() << G    155 //      G4cout << GetIT(track)->GetName() << G4endl;
154 //      G4cout << " ************************ C    156 //      G4cout << " ************************ CONTINUE ********************" << G4endl;
155       continue;                                   157       continue;
156     }                                             158     }
157                                                   159 
158 #if defined (DEBUG_MEM) && defined (DEBUG_MEM_    160 #if defined (DEBUG_MEM) && defined (DEBUG_MEM_DOIT)
159     MemStat mem_first, mem_second, mem_diff;      161     MemStat mem_first, mem_second, mem_diff;
160     mem_first = MemoryUsage();                    162     mem_first = MemoryUsage();
161 #endif                                            163 #endif
162                                                   164 
163     Stepping(track, timeStep);                    165     Stepping(track, timeStep);
164                                                   166 
165 #if defined (DEBUG_MEM) && defined (DEBUG_MEM_    167 #if defined (DEBUG_MEM) && defined (DEBUG_MEM_DOIT)
166     MemStat mem_intermediaire = MemoryUsage();    168     MemStat mem_intermediaire = MemoryUsage();
167     mem_diff = mem_intermediaire-mem_first;       169     mem_diff = mem_intermediaire-mem_first;
168     G4cout << "\t\t >> || MEM || In DoIT with     170     G4cout << "\t\t >> || MEM || In DoIT with track "
169         << track->GetTrackID() << ", diff is :    171         << track->GetTrackID() << ", diff is : " << mem_diff << G4endl;
170 #endif                                            172 #endif
171                                                   173 
172     ExtractDoItData();                            174     ExtractDoItData();
173                                                   175 
174 #if defined (DEBUG_MEM) && defined (DEBUG_MEM_    176 #if defined (DEBUG_MEM) && defined (DEBUG_MEM_DOIT)
175     mem_second = MemoryUsage();                   177     mem_second = MemoryUsage();
176     mem_diff = mem_second-mem_first;              178     mem_diff = mem_second-mem_first;
177     G4cout << "\t >> || MEM || In DoIT with tr    179     G4cout << "\t >> || MEM || In DoIT with track "
178         << track->GetTrackID()                    180         << track->GetTrackID()
179         << ", diff is : " << mem_diff << G4end    181         << ", diff is : " << mem_diff << G4endl;
180 #endif                                            182 #endif
181   }                                               183   }
182                                                   184 
183                                                   185 
184   fpTrackContainer->MergeSecondariesWithMainLi    186   fpTrackContainer->MergeSecondariesWithMainList();
185   fpTrackContainer->KillTracks(); // (18-06-15    187   fpTrackContainer->KillTracks(); // (18-06-15 : MK) Remove it ?
186   fLeadingTracks.Reset();                         188   fLeadingTracks.Reset();
187 }                                                 189 }
188                                                   190 
189 //____________________________________________    191 //_________________________________________________________________________
190                                                   192 
191 void G4ITStepProcessor::ExtractDoItData()         193 void G4ITStepProcessor::ExtractDoItData()
192 {                                                 194 {
193   if (fpTrack == nullptr)                      << 195   if (!fpTrack)
194   {                                               196   {
195     CleanProcessor();                             197     CleanProcessor();
196     return;                                       198     return;
197   }                                               199   }
198                                                   200 
199   G4TrackStatus status = fpTrack->GetTrackStat    201   G4TrackStatus status = fpTrack->GetTrackStatus();
200                                                   202 
201   switch (status)                                 203   switch (status)
202   {                                               204   {
203     case fAlive:                                  205     case fAlive:
204     case fStopButAlive:                           206     case fStopButAlive:
205     case fSuspend:                                207     case fSuspend:
206     case fPostponeToNextEvent:                    208     case fPostponeToNextEvent:
207     default:                                      209     default:
208       PushSecondaries();                          210       PushSecondaries();
209       break;                                      211       break;
210                                                   212 
211     case fStopAndKill:                            213     case fStopAndKill:
212       G4ITReactionSet::Instance()->RemoveReact    214       G4ITReactionSet::Instance()->RemoveReactionSet(fpTrack);
213       PushSecondaries();                          215       PushSecondaries();
214 //      G4TrackList::Pop(fpTrack);                216 //      G4TrackList::Pop(fpTrack);
215       fpTrackingManager->EndTracking(fpTrack);    217       fpTrackingManager->EndTracking(fpTrack);
216 //      fTrackContainer->PushToKill(fpTrack);     218 //      fTrackContainer->PushToKill(fpTrack);
217       break;                                      219       break;
218                                                   220 
219     case fKillTrackAndSecondaries:                221     case fKillTrackAndSecondaries:
220       G4ITReactionSet::Instance()->RemoveReact    222       G4ITReactionSet::Instance()->RemoveReactionSet(fpTrack);
221       if (fpSecondary != nullptr)              << 223       if (fpSecondary)
222       {                                           224       {
223         for (auto & i : *fpSecondary)          << 225         for (size_t i = 0; i < fpSecondary->size(); ++i)
224         {                                         226         {
225           delete i;                            << 227           delete (*fpSecondary)[i];
226         }                                         228         }
227         fpSecondary->clear();                     229         fpSecondary->clear();
228       }                                           230       }
229 //      G4TrackList::Pop(fpTrack);                231 //      G4TrackList::Pop(fpTrack);
230       fpTrackingManager->EndTracking(fpTrack);    232       fpTrackingManager->EndTracking(fpTrack);
231 //      fTrackContainer->PushToKill(fpTrack);     233 //      fTrackContainer->PushToKill(fpTrack);
232       break;                                      234       break;
233   }                                               235   }
234                                                   236 
235   CleanProcessor();                               237   CleanProcessor();
236 }                                                 238 }
237                                                   239 
238 //____________________________________________    240 //_________________________________________________________________________
239                                                   241 
240 void G4ITStepProcessor::PushSecondaries()         242 void G4ITStepProcessor::PushSecondaries()
241 {                                                 243 {
242   if ((fpSecondary == nullptr) || fpSecondary- << 244   if (!fpSecondary || fpSecondary->empty())
243   {                                               245   {
244     // DEBUG                                      246     // DEBUG
245     //      G4cout << "NO SECONDARIES !!! " <<    247     //      G4cout << "NO SECONDARIES !!! " << G4endl;
246     return;                                       248     return;
247   }                                               249   }
248                                                   250 
249   // DEBUG                                        251   // DEBUG
250   //    G4cout << "There are secondaries : "<<    252   //    G4cout << "There are secondaries : "<< secondaries -> size() << G4endl ;
251                                                   253 
252   auto secondaries_i = fpSecondary->begin();   << 254   G4TrackVector::iterator secondaries_i = fpSecondary->begin();
253                                                   255 
254   for (; secondaries_i != fpSecondary->end();     256   for (; secondaries_i != fpSecondary->end(); ++secondaries_i)
255   {                                               257   {
256     G4Track* secondary = *secondaries_i;          258     G4Track* secondary = *secondaries_i;
257     fpTrackContainer->_PushTrack(secondary);      259     fpTrackContainer->_PushTrack(secondary);
258   }                                               260   }
259 }                                                 261 }
260                                                   262 
261 //____________________________________________    263 //______________________________________________________________________________
262                                                   264 
263 void G4ITStepProcessor::Stepping(G4Track* trac    265 void G4ITStepProcessor::Stepping(G4Track* track, const double & timeStep)
264 {                                                 266 {
265                                                   267 
266 #ifdef DEBUG_MEM                                  268 #ifdef DEBUG_MEM
267   MemStat mem_first, mem_second, mem_diff;        269   MemStat mem_first, mem_second, mem_diff;
268 #endif                                            270 #endif
269                                                   271 
270 #ifdef DEBUG_MEM                                  272 #ifdef DEBUG_MEM
271   mem_first = MemoryUsage();                      273   mem_first = MemoryUsage();
272 #endif                                            274 #endif
273                                                   275 
274   CleanProcessor();                               276   CleanProcessor();
275                                                   277 
276 #ifdef DEBUG_MEM                                  278 #ifdef DEBUG_MEM
277   MemStat mem_intermediaire = MemoryUsage();      279   MemStat mem_intermediaire = MemoryUsage();
278   mem_diff = mem_intermediaire-mem_first;         280   mem_diff = mem_intermediaire-mem_first;
279   G4cout << "\t\t\t >> || MEM || After CleanPr    281   G4cout << "\t\t\t >> || MEM || After CleanProcessor " << track->GetTrackID() << ", diff is : " << mem_diff << G4endl;
280 #endif                                            282 #endif
281                                                   283 
282   if(track == nullptr) return; // maybe put an << 284   if(track == 0) return; // maybe put an exception here
283   fTimeStep = timeStep;                           285   fTimeStep = timeStep;
284   SetTrack(track);                                286   SetTrack(track);
285   DoStepping();                                   287   DoStepping();
286 }                                                 288 }
287 //____________________________________________    289 //______________________________________________________________________________
288                                                   290 
289 // *******************************************    291 // ************************************************************************
290 //  Stepping                                      292 //  Stepping
291 // *******************************************    293 // ************************************************************************
292 void G4ITStepProcessor::DoStepping()              294 void G4ITStepProcessor::DoStepping()
293 {                                                 295 {
294   SetupMembers();                                 296   SetupMembers();
295                                                   297 
296 #ifdef DEBUG_MEM                                  298 #ifdef DEBUG_MEM
297   MemStat mem_first, mem_second, mem_diff;        299   MemStat mem_first, mem_second, mem_diff;
298 #endif                                            300 #endif
299                                                   301 
300 #ifdef DEBUG_MEM                                  302 #ifdef DEBUG_MEM
301   mem_first = MemoryUsage();                      303   mem_first = MemoryUsage();
302 #endif                                            304 #endif
303                                                   305 
304 #ifdef G4VERBOSE                                  306 #ifdef G4VERBOSE
305     if(fpVerbose != nullptr) fpVerbose->PreSte << 307     if(fpVerbose) fpVerbose->PreStepVerbose(fpTrack);
306 #endif                                            308 #endif
307                                                   309 
308   if(fpProcessInfo == nullptr)                 << 310   if(!fpProcessInfo)
309   {                                               311   {
310     G4ExceptionDescription exceptionDescriptio    312     G4ExceptionDescription exceptionDescription;
311     exceptionDescription << "No process info f    313     exceptionDescription << "No process info found for particle :"
312                          << fpTrack->GetDefini    314                          << fpTrack->GetDefinition()->GetParticleName();
313     G4Exception("G4ITStepProcessor::DoStepping    315     G4Exception("G4ITStepProcessor::DoStepping",
314                 "ITStepProcessor0012",            316                 "ITStepProcessor0012",
315                 FatalErrorInArgument,             317                 FatalErrorInArgument,
316                 exceptionDescription);            318                 exceptionDescription);
317     return;                                       319     return;
318   }                                               320   }
319 //  else if(fpTrack->GetTrackStatus() == fStop    321 //  else if(fpTrack->GetTrackStatus() == fStopAndKill)
320 //  {                                             322 //  {
321 //    fpState->fStepStatus = fUndefined;          323 //    fpState->fStepStatus = fUndefined;
322 //    return;                                     324 //    return;
323 //  }                                             325 //  }
324                                                   326 
325   if(fpProcessInfo->MAXofPostStepLoops == 0 &&    327   if(fpProcessInfo->MAXofPostStepLoops == 0 &&
326       fpProcessInfo->MAXofAlongStepLoops == 0     328       fpProcessInfo->MAXofAlongStepLoops == 0
327      && fpProcessInfo->MAXofAtRestLoops == 0)     329      && fpProcessInfo->MAXofAtRestLoops == 0)
328   {/*                                          << 330   {
329     G4ExceptionDescription exceptionDescriptio    331     G4ExceptionDescription exceptionDescription;
330     exceptionDescription << "No process was fo    332     exceptionDescription << "No process was found for particle :"
331                          << fpTrack->GetDefini    333                          << fpTrack->GetDefinition()->GetParticleName();
332     G4Exception("G4ITStepProcessor::DoStepping    334     G4Exception("G4ITStepProcessor::DoStepping",
333                 "ITStepProcessorNoProcess",       335                 "ITStepProcessorNoProcess",
334                 JustWarning,                      336                 JustWarning,
335                 exceptionDescription);            337                 exceptionDescription);
336                                                   338 
337     fpTrack->SetTrackStatus(fStopAndKill);        339     fpTrack->SetTrackStatus(fStopAndKill);
338     fpState->fStepStatus = fUndefined;*/       << 340     fpState->fStepStatus = fUndefined;
339     return;                                       341     return;
340   }                                               342   }
341                                                   343 
342   //--------                                      344   //--------
343   // Prelude                                      345   // Prelude
344   //--------                                      346   //--------
345 #ifdef G4VERBOSE                                  347 #ifdef G4VERBOSE
346   // !!!!! Verbose                                348   // !!!!! Verbose
347   if(fpVerbose != nullptr) fpVerbose->NewStep( << 349   if(fpVerbose) fpVerbose->NewStep();
348 #endif                                            350 #endif
349                                                   351 
350   //---------------------------------             352   //---------------------------------
351   // AtRestStep, AlongStep and PostStep Proces    353   // AtRestStep, AlongStep and PostStep Processes
352   //---------------------------------             354   //---------------------------------
353                                                   355 
354   fpNavigator->SetNavigatorState(fpITrack->Get    356   fpNavigator->SetNavigatorState(fpITrack->GetTrackingInfo()->GetNavigatorState());
355 //        fpNavigator->ResetHierarchyAndLocate    357 //        fpNavigator->ResetHierarchyAndLocate( fpTrack->GetPosition(),
356 //                                                358 //                                              fpTrack->GetMomentumDirection(),
357 //                                                359 //                                              *((G4TouchableHistory*)fpTrack->GetTouchableHandle()()) );
358 //        fpNavigator->SetNavigatorState(fpITr    360 //        fpNavigator->SetNavigatorState(fpITrack->GetTrackingInfo()->GetNavigatorState());
359   // We reset the navigator state before check    361   // We reset the navigator state before checking for AtRest
360   // in case a AtRest processe would use a nav    362   // in case a AtRest processe would use a navigator info
361                                                   363 
362 #ifdef DEBUG_MEM                                  364 #ifdef DEBUG_MEM
363   MemStat mem_intermediaire = MemoryUsage();      365   MemStat mem_intermediaire = MemoryUsage();
364   mem_diff = mem_intermediaire-mem_first;         366   mem_diff = mem_intermediaire-mem_first;
365   G4cout << "\t\t\t >> || MEM || G4ITStepProce    367   G4cout << "\t\t\t >> || MEM || G4ITStepProcessor::DoStepping || After dealing with navigator with " << fpTrack->GetTrackID() << ", diff is : " << mem_diff << G4endl;
366 #endif                                            368 #endif
367                                                   369 
368   if(fpTrack->GetTrackStatus() == fStopButAliv    370   if(fpTrack->GetTrackStatus() == fStopButAlive)
369   {                                               371   {
370     if(fpProcessInfo->MAXofAtRestLoops > 0 &&     372     if(fpProcessInfo->MAXofAtRestLoops > 0 && fpProcessInfo->fpAtRestDoItVector
371         != nullptr) // second condition to mak << 373         != 0) // second condition to make coverity happy
372     {                                             374     {
373       //-----------------                         375       //-----------------
374       // AtRestStepDoIt                           376       // AtRestStepDoIt
375       //-----------------                         377       //-----------------
376       InvokeAtRestDoItProcs();                    378       InvokeAtRestDoItProcs();
377       fpState->fStepStatus = fAtRestDoItProc;     379       fpState->fStepStatus = fAtRestDoItProc;
378       fpStep->GetPostStepPoint()->SetStepStatu    380       fpStep->GetPostStepPoint()->SetStepStatus(fpState->fStepStatus);
379                                                   381 
380 #ifdef G4VERBOSE                                  382 #ifdef G4VERBOSE
381             // !!!!! Verbose                      383             // !!!!! Verbose
382       if(fpVerbose != nullptr) fpVerbose->AtRe << 384       if(fpVerbose) fpVerbose->AtRestDoItInvoked();
383 #endif                                            385 #endif
384                                                   386 
385     }                                             387     }
386     // Make sure the track is killed              388     // Make sure the track is killed
387     // fpTrack->SetTrackStatus(fStopAndKill);     389     // fpTrack->SetTrackStatus(fStopAndKill);
388   }                                               390   }
389   else // if(fTimeStep > 0.) // Bye, because P    391   else // if(fTimeStep > 0.) // Bye, because PostStepIL can return 0 => time =0
390   {                                               392   {
391     if(fpITrack == nullptr)                    << 393     if(fpITrack == 0)
392     {                                             394     {
393       G4ExceptionDescription exceptionDescript    395       G4ExceptionDescription exceptionDescription;
394       exceptionDescription << " !!! TrackID :     396       exceptionDescription << " !!! TrackID : " << fpTrack->GetTrackID()
395                            << G4endl<< " !!! T    397                            << G4endl<< " !!! Track status : "<< fpTrack->GetTrackStatus() << G4endl
396       << " !!! Particle Name : "<< fpTrack ->     398       << " !!! Particle Name : "<< fpTrack -> GetDefinition() -> GetParticleName() << G4endl
397       << "No G4ITStepProcessor::fpITrack found    399       << "No G4ITStepProcessor::fpITrack found" << G4endl;
398                                                   400 
399       G4Exception("G4ITStepProcessor::DoSteppi    401       G4Exception("G4ITStepProcessor::DoStepping",
400                   "ITStepProcessor0013",          402                   "ITStepProcessor0013",
401                   FatalErrorInArgument,           403                   FatalErrorInArgument,
402                   exceptionDescription);          404                   exceptionDescription);
403       return; // to make coverity happy           405       return; // to make coverity happy
404     }                                             406     }
405                                                   407 
406     if(!fpITrack->GetTrackingInfo()->IsLeading << 408     if(fpITrack->GetTrackingInfo()->IsLeadingStep() == false)
407     {                                             409     {
408       // In case the track has NOT the minimum    410       // In case the track has NOT the minimum step length
409       // Given the final step time, the transp    411       // Given the final step time, the transportation
410       // will compute the final position of th    412       // will compute the final position of the particle
411       fpState->fStepStatus = fPostStepDoItProc    413       fpState->fStepStatus = fPostStepDoItProc;
412       fpStep->GetPostStepPoint()->SetProcessDe    414       fpStep->GetPostStepPoint()->SetProcessDefinedStep(fpTransportation);
413       FindTransportationStep();                   415       FindTransportationStep();
414     }                                             416     }
415                                                   417 
416 #ifdef DEBUG_MEM                                  418 #ifdef DEBUG_MEM
417     mem_intermediaire = MemoryUsage();            419     mem_intermediaire = MemoryUsage();
418     mem_diff = mem_intermediaire-mem_first;       420     mem_diff = mem_intermediaire-mem_first;
419     G4cout << "\t\t\t >> || MEM || G4ITStepPro    421     G4cout << "\t\t\t >> || MEM || G4ITStepProcessor::DoStepping || After FindTransportationStep() with " << fpTrack->GetTrackID() << ", diff is : " << mem_diff << G4endl;
420 #endif                                            422 #endif
421                                                   423 
422     // Store the Step length (geometrical leng    424     // Store the Step length (geometrical length) to G4Step and G4Track
423     fpTrack->SetStepLength(fpState->fPhysicalS    425     fpTrack->SetStepLength(fpState->fPhysicalStep);
424     fpStep->SetStepLength(fpState->fPhysicalSt    426     fpStep->SetStepLength(fpState->fPhysicalStep);
425                                                   427 
426     G4double GeomStepLength = fpState->fPhysic    428     G4double GeomStepLength = fpState->fPhysicalStep;
427                                                   429 
428     // Store StepStatus to PostStepPoint          430     // Store StepStatus to PostStepPoint
429     fpStep->GetPostStepPoint()->SetStepStatus(    431     fpStep->GetPostStepPoint()->SetStepStatus(fpState->fStepStatus);
430                                                   432 
431     // Invoke AlongStepDoIt                       433     // Invoke AlongStepDoIt
432     InvokeAlongStepDoItProcs();                   434     InvokeAlongStepDoItProcs();
433                                                   435 
434 #ifdef DEBUG_MEM                                  436 #ifdef DEBUG_MEM
435     mem_intermediaire = MemoryUsage();            437     mem_intermediaire = MemoryUsage();
436     mem_diff = mem_intermediaire-mem_first;       438     mem_diff = mem_intermediaire-mem_first;
437     G4cout << "\t\t\t >> || MEM || G4ITStepPro    439     G4cout << "\t\t\t >> || MEM || G4ITStepProcessor::DoStepping || After InvokeAlongStepDoItProcs() with " << fpTrack->GetTrackID() << ", diff is : " << mem_diff << G4endl;
438 #endif                                            440 #endif
439                                                   441 
440 #ifdef G4VERBOSE                                  442 #ifdef G4VERBOSE
441     // !!!!! Verbose                              443     // !!!!! Verbose
442     if(fpVerbose != nullptr) fpVerbose->AlongS << 444     if(fpVerbose) fpVerbose->AlongStepDoItAllDone();
443 #endif                                            445 #endif
444                                                   446 
445     // Update track by taking into account all    447     // Update track by taking into account all changes by AlongStepDoIt
446     // fpStep->UpdateTrack(); // done in Invok    448     // fpStep->UpdateTrack(); // done in InvokeAlongStepDoItProcs
447                                                   449 
448     // Update safety after invocation of all A    450     // Update safety after invocation of all AlongStepDoIts
449     fpState->fEndpointSafOrigin = fpPostStepPo    451     fpState->fEndpointSafOrigin = fpPostStepPoint->GetPosition();
450                                                   452 
451     fpState->fEndpointSafety =                    453     fpState->fEndpointSafety =
452         std::max(fpState->fProposedSafety - Ge    454         std::max(fpState->fProposedSafety - GeomStepLength, kCarTolerance);
453                                                   455 
454     fpStep->GetPostStepPoint()->SetSafety(fpSt    456     fpStep->GetPostStepPoint()->SetSafety(fpState->fEndpointSafety);
455                                                   457 
456     if(GetIT(fpTrack)->GetTrackingInfo()->IsLe    458     if(GetIT(fpTrack)->GetTrackingInfo()->IsLeadingStep())
457     {                                             459     {
458       // Invoke PostStepDoIt including G4ITTra    460       // Invoke PostStepDoIt including G4ITTransportation::PSDI
459       InvokePostStepDoItProcs();                  461       InvokePostStepDoItProcs();
460                                                   462 
461 #ifdef DEBUG_MEM                                  463 #ifdef DEBUG_MEM
462       mem_intermediaire = MemoryUsage();          464       mem_intermediaire = MemoryUsage();
463       mem_diff = mem_intermediaire-mem_first;     465       mem_diff = mem_intermediaire-mem_first;
464       G4cout << "\t\t\t >> || MEM || G4ITStepP    466       G4cout << "\t\t\t >> || MEM || G4ITStepProcessor::DoStepping || After InvokePostStepDoItProcs() with " << fpTrack->GetTrackID() << ", diff is : " << mem_diff << G4endl;
465 #endif                                            467 #endif
466 #ifdef G4VERBOSE                                  468 #ifdef G4VERBOSE
467     // !!!!! Verbose                              469     // !!!!! Verbose
468     if(fpVerbose != nullptr) fpVerbose->StepIn << 470     if(fpVerbose) fpVerbose->StepInfoForLeadingTrack();
469 #endif                                            471 #endif
470     }                                             472     }
471     else                                          473     else
472     {                                             474     {
473       // Only invoke transportation and all ot    475       // Only invoke transportation and all other forced processes
474       InvokeTransportationProc();                 476       InvokeTransportationProc();
475       fpStep->GetPostStepPoint()->SetProcessDe    477       fpStep->GetPostStepPoint()->SetProcessDefinedStep(fpTransportation);
476                                                   478 
477 #ifdef DEBUG_MEM                                  479 #ifdef DEBUG_MEM
478       mem_intermediaire = MemoryUsage();          480       mem_intermediaire = MemoryUsage();
479       mem_diff = mem_intermediaire-mem_first;     481       mem_diff = mem_intermediaire-mem_first;
480       G4cout << "\t\t\t >> || MEM || G4ITStepP    482       G4cout << "\t\t\t >> || MEM || G4ITStepProcessor::DoStepping || After InvokeTransportationProc() with " << fpTrack->GetTrackID() << ", diff is : " << mem_diff << G4endl;
481 #endif                                            483 #endif
482     }                                             484     }
483                                                   485 
484 #ifdef G4VERBOSE                                  486 #ifdef G4VERBOSE
485     // !!!!! Verbose                              487     // !!!!! Verbose
486     if(fpVerbose != nullptr) fpVerbose->PostSt << 488     if(fpVerbose) fpVerbose->PostStepDoItAllDone();
487 #endif                                            489 #endif
488   }                                               490   }
489                                                   491 
490   fpNavigator->ResetNavigatorState();             492   fpNavigator->ResetNavigatorState();
491                                                   493 
492 #ifdef DEBUG_MEM                                  494 #ifdef DEBUG_MEM
493   mem_intermediaire = MemoryUsage();              495   mem_intermediaire = MemoryUsage();
494   mem_diff = mem_intermediaire-mem_first;         496   mem_diff = mem_intermediaire-mem_first;
495   G4cout << "\t\t\t >> || MEM || G4ITStepProce    497   G4cout << "\t\t\t >> || MEM || G4ITStepProcessor::DoStepping || After fpNavigator->SetNavigatorState with " << fpTrack->GetTrackID() << ", diff is : " << mem_diff << G4endl;
496 #endif                                            498 #endif
497                                                   499 
498   //-------                                       500   //-------
499   // Finale                                       501   // Finale
500   //-------                                       502   //-------
501                                                   503 
502   // Update 'TrackLength' and remeber the Step    504   // Update 'TrackLength' and remeber the Step length of the current Step
503   fpTrack->AddTrackLength(fpStep->GetStepLengt    505   fpTrack->AddTrackLength(fpStep->GetStepLength());
504   fpTrack->IncrementCurrentStepNumber();          506   fpTrack->IncrementCurrentStepNumber();
505                                                   507 
506 //#ifdef G4VERBOSE                                508 //#ifdef G4VERBOSE
507 // //    !!!!! Verbose                            509 // //    !!!!! Verbose
508 //  if(fpVerbose) fpVerbose->StepInfo();          510 //  if(fpVerbose) fpVerbose->StepInfo();
509 //#endif                                          511 //#endif
510                                                   512 
511 #ifdef G4VERBOSE                                  513 #ifdef G4VERBOSE
512     if(fpVerbose != nullptr) fpVerbose->PostSt << 514     if(fpVerbose) fpVerbose->PostStepVerbose(fpTrack);
513 #endif                                            515 #endif
514                                                   516 
515 //    G4cout << " G4ITStepProcessor::DoSteppin    517 //    G4cout << " G4ITStepProcessor::DoStepping  -- " <<fpTrack->GetTrackID() << " tps = " << fpTrack->GetGlobalTime() << G4endl;
516                                                   518 
517   // Send G4Step information to Hit/Dig if the    519   // Send G4Step information to Hit/Dig if the volume is sensitive
518   /***                                            520   /***
519    fpCurrentVolume = fpStep->GetPreStepPoint()    521    fpCurrentVolume = fpStep->GetPreStepPoint()->GetPhysicalVolume();
520    StepControlFlag =  fpStep->GetControlFlag()    522    StepControlFlag =  fpStep->GetControlFlag();
521                                                   523 
522    if( fpCurrentVolume != 0 && StepControlFlag    524    if( fpCurrentVolume != 0 && StepControlFlag != AvoidHitInvocation)
523    {                                              525    {
524    fpSensitive = fpStep->GetPreStepPoint()->      526    fpSensitive = fpStep->GetPreStepPoint()->
525    GetSensitiveDetector();                        527    GetSensitiveDetector();
526    if( fpSensitive != 0 )                         528    if( fpSensitive != 0 )
527    {                                              529    {
528    fpSensitive->Hit(fpStep);                      530    fpSensitive->Hit(fpStep);
529    }                                              531    }
530    }                                              532    }
531                                                   533 
532    User intervention process.                     534    User intervention process.
533    if( fpUserSteppingAction != 0 )                535    if( fpUserSteppingAction != 0 )
534    {                                              536    {
535    fpUserSteppingAction->UserSteppingAction(fp    537    fpUserSteppingAction->UserSteppingAction(fpStep);
536    }                                              538    }
537    G4UserSteppingAction* regionalAction           539    G4UserSteppingAction* regionalAction
538    = fpStep->GetPreStepPoint()->GetPhysicalVol    540    = fpStep->GetPreStepPoint()->GetPhysicalVolume()->GetLogicalVolume()->GetRegion()
539    ->GetRegionalSteppingAction();                 541    ->GetRegionalSteppingAction();
540    if( regionalAction ) regionalAction->UserSt    542    if( regionalAction ) regionalAction->UserSteppingAction(fpStep);
541    ***/                                           543    ***/
542   fpTrackingManager->AppendStep(fpTrack, fpSte    544   fpTrackingManager->AppendStep(fpTrack, fpStep);
543   // Stepping process finish. Return the value    545   // Stepping process finish. Return the value of the StepStatus.
544                                                   546 
545 #ifdef DEBUG_MEM                                  547 #ifdef DEBUG_MEM
546   MemStat mem_intermediaire = MemoryUsage();      548   MemStat mem_intermediaire = MemoryUsage();
547   mem_diff = mem_intermediaire-mem_first;         549   mem_diff = mem_intermediaire-mem_first;
548   G4cout << "\t\t\t >> || MEM || End of DoStep    550   G4cout << "\t\t\t >> || MEM || End of DoStepping() with " << fpTrack->GetTrackID() << ", diff is : " << mem_diff << G4endl;
549 #endif                                            551 #endif
550                                                   552 
551   //    return fpState->fStepStatus;              553   //    return fpState->fStepStatus;
552 }                                                 554 }
553                                                   555 
554 //____________________________________________    556 //______________________________________________________________________________
555                                                   557 
556 // *******************************************    558 // ************************************************************************
557 //  AtRestDoIt                                    559 //  AtRestDoIt
558 // *******************************************    560 // ************************************************************************
559                                                   561 
560 void G4ITStepProcessor::InvokeAtRestDoItProcs(    562 void G4ITStepProcessor::InvokeAtRestDoItProcs()
561 {                                                 563 {
562   fpStep->SetStepLength(0.);  //the particle h    564   fpStep->SetStepLength(0.);  //the particle has stopped
563   fpTrack->SetStepLength(0.);                     565   fpTrack->SetStepLength(0.);
564                                                   566 
565   G4SelectedAtRestDoItVector& selectedAtRestDo    567   G4SelectedAtRestDoItVector& selectedAtRestDoItVector =
566       fpState->fSelectedAtRestDoItVector;         568       fpState->fSelectedAtRestDoItVector;
567                                                   569 
568   // invoke selected process                      570   // invoke selected process
569   for(std::size_t np = 0; np < fpProcessInfo-> << 571   for(size_t np = 0; np < fpProcessInfo->MAXofAtRestLoops; np++)
570   {                                               572   {
571     //                                            573     //
572     // Note: DoItVector has inverse order agai    574     // Note: DoItVector has inverse order against GetPhysIntVector
573     //       and SelectedAtRestDoItVector.        575     //       and SelectedAtRestDoItVector.
574     //                                            576     //
575     if(selectedAtRestDoItVector[fpProcessInfo-    577     if(selectedAtRestDoItVector[fpProcessInfo->MAXofAtRestLoops - np - 1] != InActivated)
576     {                                             578     {
577       fpCurrentProcess =                          579       fpCurrentProcess =
578           (G4VITProcess*) (*fpProcessInfo->fpA << 580           (G4VITProcess*) (*fpProcessInfo->fpAtRestDoItVector)[np];
579                                                   581 
580 //      G4cout << " Invoke : "                    582 //      G4cout << " Invoke : "
581 //             << fpCurrentProcess->GetProcess    583 //             << fpCurrentProcess->GetProcessName()
582 //             << G4endl;                         584 //             << G4endl;
583                                                   585 
584       //  if(fpVerbose)                           586       //  if(fpVerbose)
585       //  {                                       587       //  {
586       //    fpVerbose->AtRestDoItOneByOne();      588       //    fpVerbose->AtRestDoItOneByOne();
587       //  }                                       589       //  }
588                                                   590 
589       fpCurrentProcess->SetProcessState(fpTrac    591       fpCurrentProcess->SetProcessState(fpTrackingInfo->GetProcessState(fpCurrentProcess
590           ->GetProcessID()));                     592           ->GetProcessID()));
591       fpParticleChange = fpCurrentProcess->AtR    593       fpParticleChange = fpCurrentProcess->AtRestDoIt(*fpTrack, *fpStep);
592       fpCurrentProcess->ResetProcessState();      594       fpCurrentProcess->ResetProcessState();
593                                                   595 
594       // Set the current process as a process     596       // Set the current process as a process which defined this Step length
595       fpStep->GetPostStepPoint()->SetProcessDe    597       fpStep->GetPostStepPoint()->SetProcessDefinedStep(fpCurrentProcess);
596                                                   598 
597       // Update Step                              599       // Update Step
598       fpParticleChange->UpdateStepForAtRest(fp    600       fpParticleChange->UpdateStepForAtRest(fpStep);
599                                                   601 
600       // Now Store the secondaries from Partic    602       // Now Store the secondaries from ParticleChange to SecondaryList
601       DealWithSecondaries(fN2ndariesAtRestDoIt    603       DealWithSecondaries(fN2ndariesAtRestDoIt);
602                                                   604 
603       // Set the track status according to wha    605       // Set the track status according to what the process defined
604       // if kinetic energy >0, otherwise set      606       // if kinetic energy >0, otherwise set  fStopButAlive
605       fpTrack->SetTrackStatus(fpParticleChange    607       fpTrack->SetTrackStatus(fpParticleChange->GetTrackStatus());
606                                                   608 
607       // clear ParticleChange                     609       // clear ParticleChange
608       fpParticleChange->Clear();                  610       fpParticleChange->Clear();
609                                                   611 
610     } //if(fSelectedAtRestDoItVector[np] != In    612     } //if(fSelectedAtRestDoItVector[np] != InActivated){
611   } //for(std::size_t np=0; np < MAXofAtRestLo << 613   } //for(size_t np=0; np < MAXofAtRestLoops; np++){
612   fpStep->UpdateTrack();                          614   fpStep->UpdateTrack();
613                                                   615 
614   // Modification par rapport au transport sta    616   // Modification par rapport au transport standard :
615   // fStopAndKill doit etre propose par le mod    617   // fStopAndKill doit etre propose par le modele
616   // sinon d autres processus AtRest seront ap    618   // sinon d autres processus AtRest seront appeles
617   // au pas suivant                               619   // au pas suivant
618   // fpTrack->SetTrackStatus(fStopAndKill);       620   // fpTrack->SetTrackStatus(fStopAndKill);
619 }                                                 621 }
620                                                   622 
621 //____________________________________________    623 //______________________________________________________________________________
622                                                   624 
623 // *******************************************    625 // ************************************************************************
624 //  AlongStepDoIt                                 626 //  AlongStepDoIt
625 // *******************************************    627 // ************************************************************************
626                                                   628 
627 void G4ITStepProcessor::InvokeAlongStepDoItPro    629 void G4ITStepProcessor::InvokeAlongStepDoItProcs()
628 {                                                 630 {
629                                                   631 
630 #ifdef DEBUG_MEM                                  632 #ifdef DEBUG_MEM
631   MemStat mem_first, mem_second, mem_diff;        633   MemStat mem_first, mem_second, mem_diff;
632 #endif                                            634 #endif
633                                                   635 
634 #ifdef DEBUG_MEM                                  636 #ifdef DEBUG_MEM
635   mem_first = MemoryUsage();                      637   mem_first = MemoryUsage();
636 #endif                                            638 #endif
637                                                   639 
638   // If the current Step is defined by a 'Excl    640   // If the current Step is defined by a 'ExclusivelyForced'
639   // PostStepDoIt, then don't invoke any Along    641   // PostStepDoIt, then don't invoke any AlongStepDoIt
640   if(fpState->fStepStatus == fExclusivelyForce    642   if(fpState->fStepStatus == fExclusivelyForcedProc)
641   {                                               643   {
642     return;               // Take note 'return    644     return;               // Take note 'return' at here !!!
643   }                                               645   }
644                                                   646 
645   // Invoke the all active continuous processe    647   // Invoke the all active continuous processes
646   for(std::size_t ci = 0; ci < fpProcessInfo-> << 648   for(size_t ci = 0; ci < fpProcessInfo->MAXofAlongStepLoops; ci++)
647   {                                               649   {
648     fpCurrentProcess =                            650     fpCurrentProcess =
649         (G4VITProcess*) (*fpProcessInfo->fpAlo << 651         (G4VITProcess*) (*fpProcessInfo->fpAlongStepDoItVector)[ci];
650     if(fpCurrentProcess == nullptr) continue;  << 652     if(fpCurrentProcess == 0) continue;
651     // NULL means the process is inactivated b    653     // NULL means the process is inactivated by a user on fly.
652                                                   654 
653     fpCurrentProcess->SetProcessState(fpTracki    655     fpCurrentProcess->SetProcessState(fpTrackingInfo->GetProcessState(fpCurrentProcess
654         ->GetProcessID()));                       656         ->GetProcessID()));
655     fpParticleChange = fpCurrentProcess->Along    657     fpParticleChange = fpCurrentProcess->AlongStepDoIt(*fpTrack, *fpStep);
656                                                   658 
657 #ifdef DEBUG_MEM                                  659 #ifdef DEBUG_MEM
658     MemStat mem_intermediaire = MemoryUsage();    660     MemStat mem_intermediaire = MemoryUsage();
659     mem_diff = mem_intermediaire-mem_first;       661     mem_diff = mem_intermediaire-mem_first;
660     G4cout << "\t\t\t >> || MEM || After calli    662     G4cout << "\t\t\t >> || MEM || After calling AlongStepDoIt for " << fpCurrentProcess->GetProcessName() << " and track "<< fpTrack->GetTrackID() << ", diff is : " << mem_diff << G4endl;
661 #endif                                            663 #endif
662                                                   664 
663 //        fpCurrentProcess->SetProcessState(0)    665 //        fpCurrentProcess->SetProcessState(0);
664     fpCurrentProcess->ResetProcessState();        666     fpCurrentProcess->ResetProcessState();
665     // Update the PostStepPoint of Step accord    667     // Update the PostStepPoint of Step according to ParticleChange
666                                                   668 
667     fpParticleChange->UpdateStepForAlongStep(f    669     fpParticleChange->UpdateStepForAlongStep(fpStep);
668                                                   670 
669 #ifdef G4VERBOSE                                  671 #ifdef G4VERBOSE
670     // !!!!! Verbose                              672     // !!!!! Verbose
671     if(fpVerbose != nullptr) fpVerbose->AlongS << 673     if(fpVerbose) fpVerbose->AlongStepDoItOneByOne();
672 #endif                                            674 #endif
673                                                   675 
674     // Now Store the secondaries from Particle    676     // Now Store the secondaries from ParticleChange to SecondaryList
675     DealWithSecondaries(fN2ndariesAlongStepDoI    677     DealWithSecondaries(fN2ndariesAlongStepDoIt);
676                                                   678 
677     // Set the track status according to what     679     // Set the track status according to what the process defined
678     // if kinetic energy >0, otherwise set  fS    680     // if kinetic energy >0, otherwise set  fStopButAlive
679     fpTrack->SetTrackStatus(fpParticleChange->    681     fpTrack->SetTrackStatus(fpParticleChange->GetTrackStatus());
680                                                   682 
681     // clear ParticleChange                       683     // clear ParticleChange
682     fpParticleChange->Clear();                    684     fpParticleChange->Clear();
683   }                                               685   }
684                                                   686 
685 #ifdef DEBUG_MEM                                  687 #ifdef DEBUG_MEM
686   MemStat mem_intermediaire = MemoryUsage();      688   MemStat mem_intermediaire = MemoryUsage();
687   mem_diff = mem_intermediaire-mem_first;         689   mem_diff = mem_intermediaire-mem_first;
688   G4cout << "\t\t\t >> || MEM || After looping    690   G4cout << "\t\t\t >> || MEM || After looping on processes with " << fpTrack->GetTrackID() << ", diff is : " << mem_diff << G4endl;
689 #endif                                            691 #endif
690                                                   692 
691   fpStep->UpdateTrack();                          693   fpStep->UpdateTrack();
692                                                   694 
693   G4TrackStatus fNewStatus = fpTrack->GetTrack    695   G4TrackStatus fNewStatus = fpTrack->GetTrackStatus();
694                                                   696 
695   if(fNewStatus == fAlive && fpTrack->GetKinet    697   if(fNewStatus == fAlive && fpTrack->GetKineticEnergy() <= DBL_MIN)
696   {                                               698   {
697     //        G4cout << "G4ITStepProcessor::In    699     //        G4cout << "G4ITStepProcessor::InvokeAlongStepDoItProcs : Track will be killed" << G4endl;
698     if(fpProcessInfo->MAXofAtRestLoops>0) fNew    700     if(fpProcessInfo->MAXofAtRestLoops>0) fNewStatus = fStopButAlive;
699     else fNewStatus = fStopAndKill;               701     else fNewStatus = fStopAndKill;
700     fpTrack->SetTrackStatus( fNewStatus );        702     fpTrack->SetTrackStatus( fNewStatus );
701   }                                               703   }
702                                                   704 
703 }                                                 705 }
704                                                   706 
705 //____________________________________________    707 //______________________________________________________________________________
706                                                   708 
707 // *******************************************    709 // ************************************************************************
708 //  PostStepDoIt                                  710 //  PostStepDoIt
709 // *******************************************    711 // ************************************************************************
710                                                   712 
711 void G4ITStepProcessor::InvokePostStepDoItProc    713 void G4ITStepProcessor::InvokePostStepDoItProcs()
712 {                                                 714 {
713   std::size_t _MAXofPostStepLoops = fpProcessI << 715   size_t _MAXofPostStepLoops = fpProcessInfo->MAXofPostStepLoops;
714   G4SelectedPostStepDoItVector& selectedPostSt    716   G4SelectedPostStepDoItVector& selectedPostStepDoItVector = fpState
715       ->fSelectedPostStepDoItVector;              717       ->fSelectedPostStepDoItVector;
716   G4StepStatus& stepStatus = fpState->fStepSta    718   G4StepStatus& stepStatus = fpState->fStepStatus;
717                                                   719 
718   // Invoke the specified discrete processes      720   // Invoke the specified discrete processes
719   for(std::size_t np = 0; np < _MAXofPostStepL << 721   for(size_t np = 0; np < _MAXofPostStepLoops; np++)
720   {                                               722   {
721     //                                            723     //
722     // Note: DoItVector has inverse order agai    724     // Note: DoItVector has inverse order against GetPhysIntVector
723     //       and SelectedPostStepDoItVector.      725     //       and SelectedPostStepDoItVector.
724     //                                            726     //
725     G4int Cond = selectedPostStepDoItVector[_M    727     G4int Cond = selectedPostStepDoItVector[_MAXofPostStepLoops
726                                             -     728                                             - np - 1];
727     if(Cond != InActivated)                       729     if(Cond != InActivated)
728     {                                             730     {
729       if(((Cond == NotForced) && (stepStatus =    731       if(((Cond == NotForced) && (stepStatus == fPostStepDoItProc)) ||
730           ((Cond == Forced) && (stepStatus !=     732           ((Cond == Forced) && (stepStatus != fExclusivelyForcedProc))
731          ||                                       733          ||
732          // ((Cond == Conditionally) && (stepS    734          // ((Cond == Conditionally) && (stepStatus == fAlongStepDoItProc)) ||
733          ((Cond == ExclusivelyForced) && (step    735          ((Cond == ExclusivelyForced) && (stepStatus == fExclusivelyForcedProc))
734          || ((Cond == StronglyForced)))           736          || ((Cond == StronglyForced)))
735       {                                           737       {
736                                                   738 
737         InvokePSDIP(np);                          739         InvokePSDIP(np);
738       }                                           740       }
739     } //if(*fSelectedPostStepDoItVector(np)...    741     } //if(*fSelectedPostStepDoItVector(np)........
740                                                   742 
741     // Exit from PostStepLoop if the track has    743     // Exit from PostStepLoop if the track has been killed,
742     // but extra treatment for processes with     744     // but extra treatment for processes with Strongly Forced flag
743     if(fpTrack->GetTrackStatus() == fStopAndKi    745     if(fpTrack->GetTrackStatus() == fStopAndKill)
744     {                                             746     {
745       for(std::size_t np1 = np + 1; np1 < _MAX << 747       for(size_t np1 = np + 1; np1 < _MAXofPostStepLoops; np1++)
746       {                                           748       {
747         G4int Cond2 = selectedPostStepDoItVect    749         G4int Cond2 = selectedPostStepDoItVector[_MAXofPostStepLoops
748                                                   750                                                  - np1 - 1];
749         if(Cond2 == StronglyForced)               751         if(Cond2 == StronglyForced)
750         {                                         752         {
751           InvokePSDIP(np1);                       753           InvokePSDIP(np1);
752         }                                         754         }
753       }                                           755       }
754       break;                                      756       break;
755     }                                             757     }
756   } //for(std::size_t np=0; np < MAXofPostStep << 758   } //for(size_t np=0; np < MAXofPostStepLoops; np++){
757 }                                                 759 }
758                                                   760 
759 //____________________________________________    761 //______________________________________________________________________________
760                                                   762 
761 void G4ITStepProcessor::InvokePSDIP(std::size_ << 763 void G4ITStepProcessor::InvokePSDIP(size_t np)
762 {                                                 764 {
763   fpCurrentProcess = (G4VITProcess*) (*fpProce << 765   fpCurrentProcess = (G4VITProcess*) (*fpProcessInfo->fpPostStepDoItVector)[np];
764                                                   766 
765   fpCurrentProcess->SetProcessState(fpTracking    767   fpCurrentProcess->SetProcessState(fpTrackingInfo->GetProcessState(fpCurrentProcess
766       ->GetProcessID()));                         768       ->GetProcessID()));
767   fpParticleChange = fpCurrentProcess->PostSte    769   fpParticleChange = fpCurrentProcess->PostStepDoIt(*fpTrack, *fpStep);
768 //    fpCurrentProcess->SetProcessState(0);       770 //    fpCurrentProcess->SetProcessState(0);
769   fpCurrentProcess->ResetProcessState();          771   fpCurrentProcess->ResetProcessState();
770                                                   772 
771   // Update PostStepPoint of Step according to    773   // Update PostStepPoint of Step according to ParticleChange
772   fpParticleChange->UpdateStepForPostStep(fpSt    774   fpParticleChange->UpdateStepForPostStep(fpStep);
773                                                   775 
774 #ifdef G4VERBOSE                                  776 #ifdef G4VERBOSE
775   // !!!!! Verbose                                777   // !!!!! Verbose
776   if(fpVerbose != nullptr) fpVerbose->PostStep << 778   if(fpVerbose) fpVerbose->PostStepDoItOneByOne();
777 #endif                                            779 #endif
778                                                   780 
779   // Update G4Track according to ParticleChang    781   // Update G4Track according to ParticleChange after each PostStepDoIt
780   fpStep->UpdateTrack();                          782   fpStep->UpdateTrack();
781                                                   783 
782   // Update safety after each invocation of Po    784   // Update safety after each invocation of PostStepDoIts
783   fpStep->GetPostStepPoint()->SetSafety(Calcul    785   fpStep->GetPostStepPoint()->SetSafety(CalculateSafety());
784                                                   786 
785   // Now Store the secondaries from ParticleCh    787   // Now Store the secondaries from ParticleChange to SecondaryList
786   DealWithSecondaries(fN2ndariesPostStepDoIt);    788   DealWithSecondaries(fN2ndariesPostStepDoIt);
787                                                   789 
788   // Set the track status according to what th    790   // Set the track status according to what the process defined
789   fpTrack->SetTrackStatus(fpParticleChange->Ge    791   fpTrack->SetTrackStatus(fpParticleChange->GetTrackStatus());
790                                                   792 
791   // clear ParticleChange                         793   // clear ParticleChange
792   fpParticleChange->Clear();                      794   fpParticleChange->Clear();
793 }                                                 795 }
794                                                   796 
795 //____________________________________________    797 //______________________________________________________________________________
796                                                   798 
797 // *******************************************    799 // ************************************************************************
798 //  Transport on a given time                     800 //  Transport on a given time
799 // *******************************************    801 // ************************************************************************
800                                                   802 
801 void G4ITStepProcessor::FindTransportationStep    803 void G4ITStepProcessor::FindTransportationStep()
802 {                                                 804 {
803   double physicalStep(0.);                        805   double physicalStep(0.);
804                                                   806 
805   fpTransportation = fpProcessInfo->fpTranspor    807   fpTransportation = fpProcessInfo->fpTransportation;
806   // dynamic_cast<G4ITTransportation*>((fpProc    808   // dynamic_cast<G4ITTransportation*>((fpProcessInfo->fpAlongStepGetPhysIntVector)[MAXofAlongStepLoops-1]);
807                                                   809 
808   if(fpTrack == nullptr)                       << 810   if(!fpTrack)
809   {                                               811   {
810     G4ExceptionDescription exceptionDescriptio    812     G4ExceptionDescription exceptionDescription;
811     exceptionDescription << "No G4ITStepProces    813     exceptionDescription << "No G4ITStepProcessor::fpTrack found";
812     G4Exception("G4ITStepProcessor::FindTransp    814     G4Exception("G4ITStepProcessor::FindTransportationStep",
813                 "ITStepProcessor0013",            815                 "ITStepProcessor0013",
814                 FatalErrorInArgument,             816                 FatalErrorInArgument,
815                 exceptionDescription);            817                 exceptionDescription);
816     return;                                       818     return;
817                                                   819 
818   }                                               820   }
819   if(fpITrack == nullptr)                      << 821   if(!fpITrack)
820   {                                               822   {
821     G4ExceptionDescription exceptionDescriptio    823     G4ExceptionDescription exceptionDescription;
822     exceptionDescription << "No G4ITStepProces    824     exceptionDescription << "No G4ITStepProcessor::fITrack";
823     G4Exception("G4ITStepProcessor::FindTransp    825     G4Exception("G4ITStepProcessor::FindTransportationStep",
824                 "ITStepProcessor0014",            826                 "ITStepProcessor0014",
825                 FatalErrorInArgument,             827                 FatalErrorInArgument,
826                 exceptionDescription);            828                 exceptionDescription);
827     return;                                       829     return;
828   }                                               830   }
829   if((fpITrack->GetTrack()) == nullptr)        << 831   if(!(fpITrack->GetTrack()))
830   {                                               832   {
831     G4ExceptionDescription exceptionDescriptio    833     G4ExceptionDescription exceptionDescription;
832     exceptionDescription << "No G4ITStepProces    834     exceptionDescription << "No G4ITStepProcessor::fITrack->GetTrack()";
833     G4Exception("G4ITStepProcessor::FindTransp    835     G4Exception("G4ITStepProcessor::FindTransportationStep",
834                 "ITStepProcessor0015",            836                 "ITStepProcessor0015",
835                 FatalErrorInArgument,             837                 FatalErrorInArgument,
836                 exceptionDescription);            838                 exceptionDescription);
837     return;                                       839     return;
838   }                                               840   }
839                                                   841 
840   if(fpTransportation != nullptr)              << 842   if(fpTransportation)
841   {                                               843   {
842     fpTransportation->SetProcessState(fpTracki    844     fpTransportation->SetProcessState(fpTrackingInfo->GetProcessState(fpTransportation
843         ->GetProcessID()));                       845         ->GetProcessID()));
844     fpTransportation->ComputeStep(*fpTrack, *f    846     fpTransportation->ComputeStep(*fpTrack, *fpStep, fTimeStep, physicalStep);
845                                                   847 
846 //        fpTransportation->SetProcessState(0)    848 //        fpTransportation->SetProcessState(0);
847     fpTransportation->ResetProcessState();        849     fpTransportation->ResetProcessState();
848   }                                               850   }
849                                                   851 
850   if(physicalStep >= DBL_MAX)                     852   if(physicalStep >= DBL_MAX)
851   {                                               853   {
852 //    G4cout << "---- 2) Setting stop and kill    854 //    G4cout << "---- 2) Setting stop and kill for " << GetIT(fpTrack)->GetName() << G4endl;
853     fpTrack -> SetTrackStatus(fStopAndKill);      855     fpTrack -> SetTrackStatus(fStopAndKill);
854     return;                                       856     return;
855   }                                               857   }
856                                                   858 
857   fpState->fPhysicalStep = physicalStep;          859   fpState->fPhysicalStep = physicalStep;
858 }                                                 860 }
859                                                   861 
860 //____________________________________________    862 //______________________________________________________________________________
861                                                   863 
862 void G4ITStepProcessor::InvokeTransportationPr    864 void G4ITStepProcessor::InvokeTransportationProc()
863 {                                                 865 {
864   std::size_t _MAXofPostStepLoops = fpProcessI << 866   size_t _MAXofPostStepLoops = fpProcessInfo->MAXofPostStepLoops;
865   G4SelectedPostStepDoItVector& selectedPostSt    867   G4SelectedPostStepDoItVector& selectedPostStepDoItVector = fpState
866       ->fSelectedPostStepDoItVector;              868       ->fSelectedPostStepDoItVector;
867   G4StepStatus& stepStatus = fpState->fStepSta    869   G4StepStatus& stepStatus = fpState->fStepStatus;
868                                                   870 
869   // Invoke the specified discrete processes      871   // Invoke the specified discrete processes
870   for(std::size_t np = 0; np < _MAXofPostStepL << 872   for(size_t np = 0; np < _MAXofPostStepLoops; np++)
871   {                                               873   {
872     //                                            874     //
873     // Note: DoItVector has inverse order agai    875     // Note: DoItVector has inverse order against GetPhysIntVector
874     //       and SelectedPostStepDoItVector.      876     //       and SelectedPostStepDoItVector.
875     //                                            877     //
876     G4int Cond = selectedPostStepDoItVector[_M    878     G4int Cond = selectedPostStepDoItVector[_MAXofPostStepLoops - np - 1];
877     if(Cond != InActivated)                       879     if(Cond != InActivated)
878     {                                             880     {
879       if(((Cond == Forced) && (stepStatus != f    881       if(((Cond == Forced) && (stepStatus != fExclusivelyForcedProc)) ||
880       // ((Cond == Conditionally) && (stepStat    882       // ((Cond == Conditionally) && (stepStatus == fAlongStepDoItProc)) ||
881       ((Cond == ExclusivelyForced) && (stepSta    883       ((Cond == ExclusivelyForced) && (stepStatus == fExclusivelyForcedProc))
882          || ((Cond == StronglyForced)))           884          || ((Cond == StronglyForced)))
883       {                                           885       {
884                                                   886 
885         InvokePSDIP(np);                          887         InvokePSDIP(np);
886       }                                           888       }
887     } //if(Cond != InActivated)                   889     } //if(Cond != InActivated)
888                                                   890 
889     // Exit from PostStepLoop if the track has    891     // Exit from PostStepLoop if the track has been killed,
890     // but extra treatment for processes with     892     // but extra treatment for processes with Strongly Forced flag
891     if(fpTrack->GetTrackStatus() == fStopAndKi    893     if(fpTrack->GetTrackStatus() == fStopAndKill)
892     {                                             894     {
893       for(std::size_t np1 = np + 1; np1 < _MAX << 895       for(size_t np1 = np + 1; np1 < _MAXofPostStepLoops; np1++)
894       {                                           896       {
895         G4int Cond2 = selectedPostStepDoItVect    897         G4int Cond2 = selectedPostStepDoItVector[_MAXofPostStepLoops - np1 - 1];
896         if(Cond2 == StronglyForced)               898         if(Cond2 == StronglyForced)
897         {                                         899         {
898           InvokePSDIP(np1);                       900           InvokePSDIP(np1);
899         }                                         901         }
900       }                                           902       }
901       break;                                      903       break;
902     }                                             904     }
903   }                                               905   }
904 }                                                 906 }
905                                                   907 
906 //____________________________________________    908 //______________________________________________________________________________
907                                                   909 
908 // *******************************************    910 // ************************************************************************
909 //  Apply cuts                                    911 //  Apply cuts
910 // *******************************************    912 // ************************************************************************
911                                                   913 
912 void G4ITStepProcessor::ApplyProductionCut(G4T    914 void G4ITStepProcessor::ApplyProductionCut(G4Track* aSecondary)
913 {                                                 915 {
914   G4bool tBelowCutEnergyAndSafety = false;        916   G4bool tBelowCutEnergyAndSafety = false;
915   G4int tPtclIdx = G4ProductionCuts::GetIndex(    917   G4int tPtclIdx = G4ProductionCuts::GetIndex(aSecondary->GetDefinition());
916   if(tPtclIdx < 0)                                918   if(tPtclIdx < 0)
917   {                                               919   {
918     return;                                       920     return;
919   }                                               921   }
920   G4ProductionCutsTable* tCutsTbl =               922   G4ProductionCutsTable* tCutsTbl =
921       G4ProductionCutsTable::GetProductionCuts    923       G4ProductionCutsTable::GetProductionCutsTable();
922   G4int tCoupleIdx = tCutsTbl->GetCoupleIndex(    924   G4int tCoupleIdx = tCutsTbl->GetCoupleIndex(fpPreStepPoint
923       ->GetMaterialCutsCouple());                 925       ->GetMaterialCutsCouple());
924   G4double tProdThreshold =                       926   G4double tProdThreshold =
925       (*(tCutsTbl->GetEnergyCutsVector(tPtclId    927       (*(tCutsTbl->GetEnergyCutsVector(tPtclIdx)))[tCoupleIdx];
926   if(aSecondary->GetKineticEnergy() < tProdThr    928   if(aSecondary->GetKineticEnergy() < tProdThreshold)
927   {                                               929   {
928     tBelowCutEnergyAndSafety = true;              930     tBelowCutEnergyAndSafety = true;
929     if(std::abs(aSecondary->GetDynamicParticle    931     if(std::abs(aSecondary->GetDynamicParticle()->GetCharge()) > DBL_MIN)
930     {                                             932     {
931       G4double currentRange                       933       G4double currentRange
932       = G4LossTableManager::Instance()->GetRan    934       = G4LossTableManager::Instance()->GetRange(aSecondary->GetDefinition(),
933           aSecondary->GetKineticEnergy(),         935           aSecondary->GetKineticEnergy(),
934           fpPreStepPoint->GetMaterialCutsCoupl    936           fpPreStepPoint->GetMaterialCutsCouple());
935       tBelowCutEnergyAndSafety = (currentRange    937       tBelowCutEnergyAndSafety = (currentRange < CalculateSafety() );
936     }                                             938     }
937   }                                               939   }
938                                                   940 
939   if(tBelowCutEnergyAndSafety)                    941   if(tBelowCutEnergyAndSafety)
940   {                                               942   {
941     if(!(aSecondary->IsGoodForTracking()))        943     if(!(aSecondary->IsGoodForTracking()))
942     {                                             944     {
943       // Add kinetic energy to the total energ    945       // Add kinetic energy to the total energy deposit
944       fpStep->AddTotalEnergyDeposit(aSecondary    946       fpStep->AddTotalEnergyDeposit(aSecondary->GetKineticEnergy());
945       aSecondary->SetKineticEnergy(0.0);          947       aSecondary->SetKineticEnergy(0.0);
946     }                                             948     }
947   }                                               949   }
948 }                                                 950 }
949                                                   951