Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/examples/extended/biasing/ReverseMC01/src/G4AdjointPhysicsList.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 /examples/extended/biasing/ReverseMC01/src/G4AdjointPhysicsList.cc (Version 11.3.0) and /examples/extended/biasing/ReverseMC01/src/G4AdjointPhysicsList.cc (Version 7.0)


  1 //                                                  1 
  2 // *******************************************    
  3 // * License and Disclaimer                       
  4 // *                                              
  5 // * The  Geant4 software  is  copyright of th    
  6 // * the Geant4 Collaboration.  It is provided    
  7 // * conditions of the Geant4 Software License    
  8 // * LICENSE and available at  http://cern.ch/    
  9 // * include a list of copyright holders.         
 10 // *                                              
 11 // * Neither the authors of this software syst    
 12 // * institutes,nor the agencies providing fin    
 13 // * work  make  any representation or  warran    
 14 // * regarding  this  software system or assum    
 15 // * use.  Please see the license in the file     
 16 // * for the full disclaimer and the limitatio    
 17 // *                                              
 18 // * This  code  implementation is the result     
 19 // * technical work of the GEANT4 collaboratio    
 20 // * By using,  copying,  modifying or  distri    
 21 // * any work based  on the software)  you  ag    
 22 // * use  in  resulting  scientific  publicati    
 23 // * acceptance of all terms of the Geant4 Sof    
 24 // *******************************************    
 25 //                                                
 26 /// \file biasing/ReverseMC01/src/G4AdjointPhy    
 27 /// \brief Implementation of the G4AdjointPhys    
 28 //                                                
 29 //                                                
 30 //////////////////////////////////////////////    
 31 //  Class Name:        G4AdjointPhysicsList       
 32 //        Author:               L. Desorgher      
 33 //         Organisation:         SpaceIT GmbH     
 34 //        Contract:        ESA contract 21435/    
 35 //         Customer:             ESA/ESTEC        
 36 //////////////////////////////////////////////    
 37                                                   
 38 //....oooOO0OOooo........oooOO0OOooo........oo    
 39 //....oooOO0OOooo........oooOO0OOooo........oo    
 40                                                   
 41 #include "G4AdjointPhysicsList.hh"                
 42                                                   
 43 #include "G4AdjointPhysicsMessenger.hh"           
 44 #include "G4ParticleTypes.hh"                     
 45 #include "G4ProcessManager.hh"                    
 46 #include "G4SystemOfUnits.hh"                     
 47                                                   
 48 //....oooOO0OOooo........oooOO0OOooo........oo    
 49                                                   
 50 G4AdjointPhysicsList::G4AdjointPhysicsList()      
 51   : G4VUserPhysicsList(),                         
 52     fEminusIonisation(0),                         
 53     fPIonisation(0),                              
 54     fUse_forced_interaction(true),                
 55     fUse_eionisation(true),                       
 56     fUse_pionisation(true),                       
 57     fUse_brem(true),                              
 58     fUse_compton(true),                           
 59     fUse_ms(true),                                
 60     fUse_egain_fluctuation(true),                 
 61     fUse_peeffect(true),                          
 62     fEmin_adj_models(1. * keV),                   
 63     fEmax_adj_models(1. * MeV),                   
 64     fCS_biasing_factor_compton(1.),               
 65     fCS_biasing_factor_brem(1.),                  
 66     fCS_biasing_factor_ionisation(1.),            
 67     fCS_biasing_factor_PEeffect(1.)               
 68 {                                                 
 69   defaultCutValue = 1.0 * mm;                     
 70   SetVerboseLevel(1);                             
 71   fPhysicsMessenger = new G4AdjointPhysicsMess    
 72 }                                                 
 73                                                   
 74 //....oooOO0OOooo........oooOO0OOooo........oo    
 75                                                   
 76 G4AdjointPhysicsList::~G4AdjointPhysicsList()     
 77 void G4AdjointPhysicsList::ConstructParticle()    
 78 {                                                 
 79   // In this method, static member functions s    
 80   // for all particles which you want to use.     
 81   // This ensures that objects of these partic    
 82   // created in the program.                      
 83   ConstructBosons();                              
 84   ConstructLeptons();                             
 85   ConstructMesons();                              
 86   ConstructBaryons();                             
 87   ConstructAdjointParticles();                    
 88 }                                                 
 89                                                   
 90 //....oooOO0OOooo........oooOO0OOooo........oo    
 91                                                   
 92 void G4AdjointPhysicsList::SetLossFluctuationF    
 93 {                                                 
 94   if (fEminusIonisation) fEminusIonisation->Se    
 95 }                                                 
 96                                                   
 97 //....oooOO0OOooo........oooOO0OOooo........oo    
 98                                                   
 99 void G4AdjointPhysicsList::ConstructBosons()      
100 {                                                 
101   // pseudo-particles                             
102   G4Geantino::GeantinoDefinition();               
103   G4ChargedGeantino::ChargedGeantinoDefinition    
104                                                   
105   // gamma                                        
106   G4Gamma::GammaDefinition();                     
107                                                   
108   // optical photon                               
109   G4OpticalPhoton::OpticalPhotonDefinition();     
110 }                                                 
111                                                   
112 //....oooOO0OOooo........oooOO0OOooo........oo    
113                                                   
114 void G4AdjointPhysicsList::ConstructLeptons()     
115 {                                                 
116   // leptons                                      
117   G4Electron::ElectronDefinition();               
118   G4Positron::PositronDefinition();               
119   G4MuonPlus::MuonPlusDefinition();               
120   G4MuonMinus::MuonMinusDefinition();             
121                                                   
122   G4NeutrinoE::NeutrinoEDefinition();             
123   G4AntiNeutrinoE::AntiNeutrinoEDefinition();     
124   G4NeutrinoMu::NeutrinoMuDefinition();           
125   G4AntiNeutrinoMu::AntiNeutrinoMuDefinition()    
126 }                                                 
127                                                   
128 //....oooOO0OOooo........oooOO0OOooo........oo    
129                                                   
130 void G4AdjointPhysicsList::ConstructMesons()      
131 {                                                 
132   //  mesons                                      
133   G4PionPlus::PionPlusDefinition();               
134   G4PionMinus::PionMinusDefinition();             
135   G4PionZero::PionZeroDefinition();               
136   G4Eta::EtaDefinition();                         
137   G4EtaPrime::EtaPrimeDefinition();               
138   G4KaonPlus::KaonPlusDefinition();               
139   G4KaonMinus::KaonMinusDefinition();             
140   G4KaonZero::KaonZeroDefinition();               
141   G4AntiKaonZero::AntiKaonZeroDefinition();       
142   G4KaonZeroLong::KaonZeroLongDefinition();       
143   G4KaonZeroShort::KaonZeroShortDefinition();     
144 }                                                 
145                                                   
146 //....oooOO0OOooo........oooOO0OOooo........oo    
147                                                   
148 void G4AdjointPhysicsList::ConstructBaryons()     
149 {                                                 
150   //  barions                                     
151   G4Proton::ProtonDefinition();                   
152   G4AntiProton::AntiProtonDefinition();           
153   G4Neutron::NeutronDefinition();                 
154   G4AntiNeutron::AntiNeutronDefinition();         
155 }                                                 
156                                                   
157 //....oooOO0OOooo........oooOO0OOooo........oo    
158                                                   
159 #include "G4AdjointElectron.hh"                   
160 #include "G4AdjointGamma.hh"                      
161 #include "G4AdjointProton.hh"                     
162 void G4AdjointPhysicsList::ConstructAdjointPar    
163 {                                                 
164   // adjoint_gammma                               
165   G4AdjointGamma::AdjointGammaDefinition();       
166                                                   
167   // adjoint_electron                             
168   G4AdjointElectron::AdjointElectronDefinition    
169                                                   
170   // adjoint_proton                               
171   G4AdjointProton::AdjointProtonDefinition();     
172 }                                                 
173                                                   
174 //....oooOO0OOooo........oooOO0OOooo........oo    
175                                                   
176 void G4AdjointPhysicsList::ConstructProcess()     
177 {                                                 
178   AddTransportation();                            
179   ConstructEM();                                  
180   ConstructGeneral();                             
181 }                                                 
182                                                   
183 //....oooOO0OOooo........oooOO0OOooo........oo    
184                                                   
185 // #include "G4PEEffectFluoModel.hh"              
186 #include "G4ComptonScattering.hh"                 
187 #include "G4GammaConversion.hh"                   
188 #include "G4PhotoElectricEffect.hh"               
189 #include "G4eAdjointMultipleScattering.hh"        
190 #include "G4eBremsstrahlung.hh"                   
191 #include "G4eIonisation.hh"                       
192 #include "G4eMultipleScattering.hh"               
193 #include "G4eplusAnnihilation.hh"                 
194 #include "G4hIonisation.hh"                       
195 #include "G4hMultipleScattering.hh"               
196 #include "G4ionIonisation.hh"                     
197 // #include "G4IonParametrisedLossModel.hh"       
198                                                   
199 #include "G4AdjointAlongStepWeightCorrection.h    
200 #include "G4AdjointBremsstrahlungModel.hh"        
201 #include "G4AdjointCSManager.hh"                  
202 #include "G4AdjointComptonModel.hh"               
203 #include "G4AdjointForcedInteractionForGamma.h    
204 #include "G4AdjointIonIonisationModel.hh"         
205 #include "G4AdjointPhotoElectricModel.hh"         
206 #include "G4AdjointProcessEquivalentToDirectPr    
207 #include "G4AdjointSimManager.hh"                 
208 #include "G4AdjointeIonisationModel.hh"           
209 #include "G4AdjointhIonisationModel.hh"           
210 #include "G4AdjointhMultipleScattering.hh"        
211 #include "G4ContinuousGainOfEnergy.hh"            
212 #include "G4InversePEEffect.hh"                   
213 #include "G4IonInverseIonisation.hh"              
214 #include "G4PhysicalConstants.hh"                 
215 #include "G4SystemOfUnits.hh"                     
216 #include "G4UrbanAdjointMscModel.hh"              
217 #include "G4UrbanMscModel.hh"                     
218 #include "G4eBremsstrahlung.hh"                   
219 #include "G4eInverseBremsstrahlung.hh"            
220 #include "G4eInverseCompton.hh"                   
221 #include "G4eInverseIonisation.hh"                
222 #include "G4hInverseIonisation.hh"                
223                                                   
224 //....oooOO0OOooo........oooOO0OOooo........oo    
225                                                   
226 void G4AdjointPhysicsList::ConstructEM()          
227 {                                                 
228   G4AdjointCSManager* theCSManager = G4Adjoint    
229   G4AdjointSimManager* theAdjointSimManager =     
230                                                   
231   theCSManager->RegisterAdjointParticle(G4Adjo    
232                                                   
233   if (fUse_brem || fUse_peeffect || fUse_compt    
234     theCSManager->RegisterAdjointParticle(G4Ad    
235                                                   
236   if (fUse_eionisation) {                         
237     if (!fEminusIonisation) fEminusIonisation     
238     fEminusIonisation->SetLossFluctuations(fUs    
239   }                                               
240   if (fUse_pionisation) {                         
241     if (!fPIonisation) fPIonisation = new G4hI    
242     fPIonisation->SetLossFluctuations(fUse_ega    
243     theCSManager->RegisterAdjointParticle(G4Ad    
244   }                                               
245                                                   
246   G4eBremsstrahlung* theeminusBremsstrahlung =    
247   if (fUse_brem && fUse_eionisation) theeminus    
248                                                   
249   G4ComptonScattering* theComptonScattering =     
250   if (fUse_compton) theComptonScattering = new    
251                                                   
252   G4PhotoElectricEffect* thePEEffect = 0;         
253   if (fUse_peeffect) thePEEffect = new G4Photo    
254                                                   
255   G4eMultipleScattering* theeminusMS = 0;         
256   G4hMultipleScattering* thepMS = 0;              
257   G4eAdjointMultipleScattering* theeminusAdjoi    
258   if (fUse_ms) {                                  
259     theeminusMS = new G4eMultipleScattering();    
260     G4UrbanMscModel* msc1 = new G4UrbanMscMode    
261     theeminusMS->SetEmModel(msc1);                
262     theeminusAdjointMS = new G4eAdjointMultipl    
263     G4UrbanAdjointMscModel* msc2 = new G4Urban    
264     theeminusAdjointMS->SetEmModel(msc2);         
265     thepMS = new G4hMultipleScattering();         
266   }                                               
267                                                   
268   G4VProcess* theGammaConversion = 0;             
269   if (fUse_gamma_conversion) theGammaConversio    
270   // Define adjoint e- ionisation                 
271   //-------------------                           
272   G4AdjointeIonisationModel* theeInverseIonisa    
273   G4eInverseIonisation* theeInverseIonisationP    
274   G4eInverseIonisation* theeInverseIonisationP    
275   if (fUse_eionisation) {                         
276     theeInverseIonisationModel = new G4Adjoint    
277     theeInverseIonisationModel->SetHighEnergyL    
278     theeInverseIonisationModel->SetLowEnergyLi    
279     theeInverseIonisationModel->SetCSBiasingFa    
280     theeInverseIonisationProjToProjCase =         
281       new G4eInverseIonisation(true, "Inv_eIon    
282     theeInverseIonisationProdToProjCase =         
283       new G4eInverseIonisation(false, "Inv_eIo    
284     theAdjointSimManager->ConsiderParticleAsPr    
285   }                                               
286                                                   
287   // Define  adjoint Bremsstrahlung               
288   //-------------------------------               
289   G4AdjointBremsstrahlungModel* theeInverseBre    
290   G4eInverseBremsstrahlung* theeInverseBremsst    
291   G4eInverseBremsstrahlung* theeInverseBremsst    
292   G4AdjointForcedInteractionForGamma* theForce    
293   if (fUse_brem && fUse_eionisation) {            
294     theeInverseBremsstrahlungModel = new G4Adj    
295     theeInverseBremsstrahlungModel->SetHighEne    
296     theeInverseBremsstrahlungModel->SetLowEner    
297     theeInverseBremsstrahlungModel->SetCSBiasi    
298     theeInverseBremsstrahlungProjToProjCase =     
299       new G4eInverseBremsstrahlung(true, "Inv_    
300     theeInverseBremsstrahlungProdToProjCase =     
301       new G4eInverseBremsstrahlung(false, "Inv    
302     theAdjointSimManager->ConsiderParticleAsPr    
303     theAdjointSimManager->ConsiderParticleAsPr    
304                                                   
305     if (!fUse_forced_interaction)                 
306       theeInverseBremsstrahlungProdToProjCase     
307         new G4eInverseBremsstrahlung(false, G4    
308     theAdjointSimManager->ConsiderParticleAsPr    
309     theAdjointSimManager->ConsiderParticleAsPr    
310     if (fUse_forced_interaction) {                
311       theForcedInteractionForGamma =              
312         new G4AdjointForcedInteractionForGamma    
313       theForcedInteractionForGamma->RegisterAd    
314     }                                             
315   }                                               
316                                                   
317   // Define  adjoint Compton                      
318   //---------------------                         
319                                                   
320   G4AdjointComptonModel* theeInverseComptonMod    
321   G4eInverseCompton* theeInverseComptonProjToP    
322   G4eInverseCompton* theeInverseComptonProdToP    
323                                                   
324   if (fUse_compton) {                             
325     theeInverseComptonModel = new G4AdjointCom    
326     theeInverseComptonModel->SetHighEnergyLimi    
327     theeInverseComptonModel->SetLowEnergyLimit    
328     theeInverseComptonModel->SetDirectProcess(    
329     theeInverseComptonModel->SetUseMatrix(fals    
330                                                   
331     theeInverseComptonModel->SetCSBiasingFacto    
332     if (!fUse_forced_interaction)                 
333       theeInverseComptonProjToProjCase =          
334         new G4eInverseCompton(true, "Inv_Compt    
335     theeInverseComptonProdToProjCase =            
336       new G4eInverseCompton(false, "Inv_Compt1    
337     if (fUse_forced_interaction) {                
338       if (!theForcedInteractionForGamma)          
339         theForcedInteractionForGamma =            
340           new G4AdjointForcedInteractionForGam    
341       theForcedInteractionForGamma->RegisterAd    
342     }                                             
343     theAdjointSimManager->ConsiderParticleAsPr    
344     theAdjointSimManager->ConsiderParticleAsPr    
345   }                                               
346                                                   
347   // Define  adjoint PEEffect                     
348   //---------------------                         
349   G4AdjointPhotoElectricModel* theInversePhoto    
350   G4InversePEEffect* theInversePhotoElectricPr    
351                                                   
352   if (fUse_peeffect) {                            
353     theInversePhotoElectricModel = new G4Adjoi    
354     theInversePhotoElectricModel->SetHighEnerg    
355     theInversePhotoElectricModel->SetLowEnergy    
356     theInversePhotoElectricModel->SetCSBiasing    
357     theInversePhotoElectricProcess =              
358       new G4InversePEEffect("Inv_PEEffect", th    
359     theAdjointSimManager->ConsiderParticleAsPr    
360     theAdjointSimManager->ConsiderParticleAsPr    
361   }                                               
362                                                   
363   // Define  adjoint ionisation for protons       
364   //---------------------                         
365   G4AdjointhIonisationModel* thepInverseIonisa    
366   G4hInverseIonisation* thepInverseIonisationP    
367   G4hInverseIonisation* thepInverseIonisationP    
368   if (fUse_pionisation) {                         
369     thepInverseIonisationModel = new G4Adjoint    
370     thepInverseIonisationModel->SetHighEnergyL    
371     thepInverseIonisationModel->SetLowEnergyLi    
372     thepInverseIonisationModel->SetUseMatrix(f    
373     thepInverseIonisationProjToProjCase =         
374       new G4hInverseIonisation(true, "Inv_pIon    
375     thepInverseIonisationProdToProjCase =         
376       new G4hInverseIonisation(false, "Inv_pIo    
377     theAdjointSimManager->ConsiderParticleAsPr    
378     theAdjointSimManager->ConsiderParticleAsPr    
379   }                                               
380                                                   
381   // Declare the processes active for the diff    
382   //------------------------------------------    
383   auto particleIterator = GetParticleIterator(    
384   particleIterator->reset();                      
385   while ((*particleIterator)()) {                 
386     G4ParticleDefinition* particle = particleI    
387     G4ProcessManager* pmanager = particle->Get    
388     if (!pmanager) {                              
389       pmanager = new G4ProcessManager(particle    
390       particle->SetProcessManager(pmanager);      
391     }                                             
392                                                   
393     G4String particleName = particle->GetParti    
394     if (particleName == "e-") {                   
395       if (fUse_ms && fUse_eionisation) pmanage    
396       if (fUse_eionisation) {                     
397         pmanager->AddProcess(fEminusIonisation    
398         G4AdjointCSManager::GetAdjointCSManage    
399                                                   
400       }                                           
401       if (fUse_brem && fUse_eionisation) {        
402         pmanager->AddProcess(theeminusBremsstr    
403         G4AdjointCSManager::GetAdjointCSManage    
404           theeminusBremsstrahlung, particle);     
405       }                                           
406       G4int n_order = 0;                          
407       if (fUse_ms && fUse_eionisation) {          
408         n_order++;                                
409         pmanager->SetProcessOrdering(theeminus    
410       }                                           
411       if (fUse_eionisation) {                     
412         n_order++;                                
413         pmanager->SetProcessOrdering(fEminusIo    
414       }                                           
415       if (fUse_brem && fUse_eionisation) {        
416         n_order++;                                
417         pmanager->SetProcessOrdering(theeminus    
418       }                                           
419       n_order = 0;                                
420       if (fUse_ms && fUse_eionisation) {          
421         n_order++;                                
422         pmanager->SetProcessOrdering(theeminus    
423       }                                           
424       if (fUse_eionisation) {                     
425         n_order++;                                
426         pmanager->SetProcessOrdering(fEminusIo    
427       }                                           
428       if (fUse_brem && fUse_eionisation) {        
429         n_order++;                                
430         pmanager->SetProcessOrdering(theeminus    
431       }                                           
432     }                                             
433                                                   
434     if (particleName == "adj_e-") {               
435       G4ContinuousGainOfEnergy* theContinuousG    
436       if (fUse_eionisation) {                     
437         theContinuousGainOfEnergy = new G4Cont    
438         theContinuousGainOfEnergy->SetLossFluc    
439         theContinuousGainOfEnergy->SetDirectEn    
440         theContinuousGainOfEnergy->SetDirectPa    
441         pmanager->AddProcess(theContinuousGain    
442       }                                           
443       G4int n_order = 0;                          
444       if (fUse_ms) {                              
445         n_order++;                                
446         pmanager->AddProcess(theeminusAdjointM    
447         pmanager->SetProcessOrdering(theeminus    
448       }                                           
449       n_order++;                                  
450       pmanager->SetProcessOrdering(theContinuo    
451                                                   
452       n_order++;                                  
453       G4AdjointAlongStepWeightCorrection* theA    
454         new G4AdjointAlongStepWeightCorrection    
455       pmanager->AddProcess(theAlongStepWeightC    
456       pmanager->SetProcessOrdering(theAlongSte    
457       n_order = 0;                                
458       if (fUse_eionisation) {                     
459         pmanager->AddProcess(theeInverseIonisa    
460         pmanager->AddProcess(theeInverseIonisa    
461         n_order++;                                
462         pmanager->SetProcessOrdering(theeInver    
463         n_order++;                                
464         pmanager->SetProcessOrdering(theeInver    
465       }                                           
466       if (fUse_brem && fUse_eionisation) {        
467         pmanager->AddProcess(theeInverseBremss    
468         n_order++;                                
469         pmanager->SetProcessOrdering(theeInver    
470       }                                           
471                                                   
472       if (fUse_compton) {                         
473         pmanager->AddProcess(theeInverseCompto    
474         n_order++;                                
475         pmanager->SetProcessOrdering(theeInver    
476       }                                           
477       if (fUse_peeffect) {                        
478         pmanager->AddDiscreteProcess(theInvers    
479         n_order++;                                
480         pmanager->SetProcessOrdering(theInvers    
481       }                                           
482       if (fUse_pionisation) {                     
483         pmanager->AddProcess(thepInverseIonisa    
484         n_order++;                                
485         pmanager->SetProcessOrdering(thepInver    
486       }                                           
487       if (fUse_ms && fUse_eionisation) {          
488         n_order++;                                
489         pmanager->SetProcessOrdering(theeminus    
490       }                                           
491     }                                             
492                                                   
493     if (particleName == "adj_gamma") {            
494       G4int n_order = 0;                          
495       if (!fUse_forced_interaction) {             
496         G4AdjointAlongStepWeightCorrection* th    
497           new G4AdjointAlongStepWeightCorrecti    
498         pmanager->AddProcess(theAlongStepWeigh    
499         pmanager->SetProcessOrdering(theAlongS    
500                                                   
501         if (fUse_brem && fUse_eionisation) {      
502           pmanager->AddProcess(theeInverseBrem    
503           n_order++;                              
504           pmanager->SetProcessOrdering(theeInv    
505                                        n_order    
506         }                                         
507         if (fUse_compton) {                       
508           pmanager->AddDiscreteProcess(theeInv    
509           n_order++;                              
510           pmanager->SetProcessOrdering(theeInv    
511         }                                         
512       }                                           
513       else {                                      
514         if (theForcedInteractionForGamma) {       
515           pmanager->AddProcess(theForcedIntera    
516           n_order++;                              
517           pmanager->SetProcessOrdering(theForc    
518           pmanager->SetProcessOrdering(theForc    
519         }                                         
520       }                                           
521     }                                             
522                                                   
523     if (particleName == "gamma") {                
524       if (fUse_compton) {                         
525         pmanager->AddDiscreteProcess(theCompto    
526         G4AdjointCSManager::GetAdjointCSManage    
527                                                   
528       }                                           
529       if (fUse_peeffect) {                        
530         pmanager->AddDiscreteProcess(thePEEffe    
531         G4AdjointCSManager::GetAdjointCSManage    
532       }                                           
533       if (fUse_gamma_conversion) {                
534         pmanager->AddDiscreteProcess(theGammaC    
535       }                                           
536     }                                             
537                                                   
538     if (particleName == "e+" && fUse_gamma_con    
539       G4VProcess* theeplusMultipleScattering =    
540       G4VProcess* theeplusIonisation = new G4e    
541       G4VProcess* theeplusBremsstrahlung = new    
542       G4VProcess* theeplusAnnihilation = new G    
543                                                   
544       // add processes                            
545       pmanager->AddProcess(theeplusMultipleSca    
546       pmanager->AddProcess(theeplusIonisation)    
547       pmanager->AddProcess(theeplusBremsstrahl    
548       pmanager->AddProcess(theeplusAnnihilatio    
549                                                   
550       // set ordering for AtRestDoIt              
551       pmanager->SetProcessOrderingToFirst(thee    
552                                                   
553       // set ordering for AlongStepDoIt           
554       pmanager->SetProcessOrdering(theeplusMul    
555       pmanager->SetProcessOrdering(theeplusIon    
556       pmanager->SetProcessOrdering(theeplusBre    
557                                                   
558       // set ordering for PostStepDoIt            
559       pmanager->SetProcessOrdering(theeplusMul    
560       pmanager->SetProcessOrdering(theeplusIon    
561       pmanager->SetProcessOrdering(theeplusBre    
562       pmanager->SetProcessOrdering(theeplusAnn    
563     }                                             
564     if (particleName == "proton" && fUse_pioni    
565       if (fUse_ms && fUse_pionisation) pmanage    
566                                                   
567       if (fUse_pionisation) {                     
568         pmanager->AddProcess(fPIonisation);       
569         G4AdjointCSManager::GetAdjointCSManage    
570                                                   
571       }                                           
572                                                   
573       G4int n_order = 0;                          
574       if (fUse_ms && fUse_pionisation) {          
575         n_order++;                                
576         pmanager->SetProcessOrdering(thepMS, i    
577       }                                           
578                                                   
579       if (fUse_pionisation) {                     
580         n_order++;                                
581         pmanager->SetProcessOrdering(fPIonisat    
582       }                                           
583                                                   
584       n_order = 0;                                
585       if (fUse_ms && fUse_pionisation) {          
586         n_order++;                                
587         pmanager->SetProcessOrdering(thepMS, i    
588       }                                           
589                                                   
590       if (fUse_pionisation) {                     
591         n_order++;                                
592         pmanager->SetProcessOrdering(fPIonisat    
593       }                                           
594     }                                             
595                                                   
596     if (particleName == "adj_proton" && fUse_p    
597       G4ContinuousGainOfEnergy* theContinuousG    
598       if (fUse_pionisation) {                     
599         theContinuousGainOfEnergy = new G4Cont    
600         theContinuousGainOfEnergy->SetLossFluc    
601         theContinuousGainOfEnergy->SetDirectEn    
602         theContinuousGainOfEnergy->SetDirectPa    
603         pmanager->AddProcess(theContinuousGain    
604       }                                           
605                                                   
606       G4int n_order = 0;                          
607       if (fUse_ms) {                              
608         n_order++;                                
609         pmanager->AddProcess(thepMS);             
610         pmanager->SetProcessOrdering(thepMS, i    
611       }                                           
612                                                   
613       n_order++;                                  
614       pmanager->SetProcessOrdering(theContinuo    
615                                                   
616       n_order++;                                  
617       G4AdjointAlongStepWeightCorrection* theA    
618         new G4AdjointAlongStepWeightCorrection    
619       pmanager->AddProcess(theAlongStepWeightC    
620       pmanager->SetProcessOrdering(theAlongSte    
621       n_order = 0;                                
622       if (fUse_pionisation) {                     
623         pmanager->AddProcess(thepInverseIonisa    
624         n_order++;                                
625         pmanager->SetProcessOrdering(thepInver    
626       }                                           
627                                                   
628       if (fUse_ms && fUse_pionisation) {          
629         n_order++;                                
630         pmanager->SetProcessOrdering(thepMS, i    
631       }                                           
632     }                                             
633   }                                               
634 }                                                 
635                                                   
636 //....oooOO0OOooo........oooOO0OOooo........oo    
637                                                   
638 #include "G4Decay.hh"                             
639 void G4AdjointPhysicsList::ConstructGeneral()     
640 {                                                 
641   // Add Decay Process                            
642   G4Decay* theDecayProcess = new G4Decay();       
643   auto particleIterator = GetParticleIterator(    
644   particleIterator->reset();                      
645   while ((*particleIterator)()) {                 
646     G4ParticleDefinition* particle = particleI    
647     G4ProcessManager* pmanager = particle->Get    
648     if (theDecayProcess->IsApplicable(*particl    
649       pmanager->AddProcess(theDecayProcess);      
650       // set ordering for PostStepDoIt and AtR    
651       pmanager->SetProcessOrdering(theDecayPro    
652       pmanager->SetProcessOrdering(theDecayPro    
653     }                                             
654   }                                               
655 }                                                 
656                                                   
657 //....oooOO0OOooo........oooOO0OOooo........oo    
658                                                   
659 void G4AdjointPhysicsList::SetCuts()              
660 {                                                 
661   if (verboseLevel > 0) {                         
662     G4cout << "G4AdjointPhysicsList::SetCuts:"    
663     G4cout << "CutLength : " << G4BestUnit(def    
664   }                                               
665                                                   
666   // set cut values for gamma at first and for    
667   // because some processes for e+/e- need cut    
668   //                                              
669   SetCutValue(defaultCutValue, "gamma");          
670   SetCutValue(defaultCutValue, "e-");             
671   SetCutValue(defaultCutValue, "e+");             
672                                                   
673   if (verboseLevel > 0) DumpCutValuesTable();     
674 }                                                 
675                                                   
676 //....oooOO0OOooo........oooOO0OOooo........oo    
677