This commit was generated by cvs2svn to compensate for changes in r1461,
[u/mrichter/AliRoot.git] / TGeant4 / TG4PhysicsList.cxx
1 // $Id$
2 // Category: physics
3 //
4 // According to:
5 // ExN04PhysicsList.cc,v 1.7 1999/12/15 14:49:26 gunter
6 // GEANT4 tag Name: geant4-01-01
7
8 #include "TG4PhysicsList.h"
9 #include "TG4PhysicsListMessenger.h"
10 #include "TG4PhysicsManager.h"
11 #include "TG4CutVector.h"
12 #include "TG4FlagVector.h"
13 #include "TG4SpecialCuts.h"
14 #include "TG4SpecialFlags.h"
15
16 #include <G4ParticleDefinition.hh>
17 #include <G4ParticleWithCuts.hh>
18 #include <G4ProcessManager.hh>
19 #include <G4ProcessVector.hh>
20 #include <G4ParticleTypes.hh>
21 #include <G4ParticleTable.hh>
22 #include <G4BosonConstructor.hh>
23 #include <G4LeptonConstructor.hh>
24 #include <G4MesonConstructor.hh>
25 #include <G4BaryonConstructor.hh>
26 #include <G4IonConstructor.hh>
27 #include <G4ShortLivedConstructor.hh>
28 #include <G4Material.hh>
29 #include <G4MaterialTable.hh>
30 #include <G4ProcessTable.hh>
31 //#include <G4ios.hh>
32
33 #include <g4std/iomanip>
34
35
36 TG4PhysicsList::TG4PhysicsList()
37   : G4VUserPhysicsList(),
38     fSetOptical(false),
39     fSetHadron(false),
40     fSetSpecialCuts(false),
41     fSetSpecialFlags(false)
42 {
43   // default cut value  (1.0mm) 
44   defaultCutValue = 1.0*mm;
45
46   // messenger
47   fMessenger = new TG4PhysicsListMessenger(this);
48
49   SetVerboseLevel(1);
50 }
51
52 TG4PhysicsList::TG4PhysicsList(const TG4PhysicsList& right)
53   : G4VUserPhysicsList(right)
54 {
55   // messenger
56   fMessenger = new TG4PhysicsListMessenger(this);
57   
58   fSetOptical = right.fSetOptical;
59   fSetHadron = right.fSetHadron;
60   fSetSpecialCuts = right.fSetSpecialCuts;
61   fSetSpecialFlags = right.fSetSpecialFlags;
62 }
63
64 TG4PhysicsList::~TG4PhysicsList() {
65 //
66 }
67
68 // operators
69
70 TG4PhysicsList& TG4PhysicsList::operator=(const TG4PhysicsList& right)
71 {
72   // check assignement to self
73   if (this == &right) return *this;
74
75   // base class assignement
76   G4VUserPhysicsList::operator=(right);
77
78   fSetOptical = right.fSetOptical;
79   fSetHadron = right.fSetHadron;
80   fSetSpecialCuts = right.fSetSpecialCuts;
81   fSetSpecialFlags = right.fSetSpecialFlags;
82   
83   return *this;
84 }  
85
86 // public methods
87
88 void TG4PhysicsList::ConstructParticle()
89 {
90 // In this method, static member functions should be called
91 // for all particles which you want to use.
92 // This ensures that objects of these particle types will be
93 // created in the program. 
94 // ---
95
96   // lock physics manager
97   TG4PhysicsManager* physicsManager = TG4PhysicsManager::Instance();
98   physicsManager->Lock();  
99   physicsManager->SetPhysicsList(this);
100  
101   // create all particles
102   ConstructAllBosons();
103   ConstructAllLeptons();
104   ConstructAllMesons();
105   ConstructAllBaryons();
106   ConstructAllIons();
107   ConstructAllShortLiveds();
108 }
109
110 void TG4PhysicsList::ConstructProcess()
111 {
112 // Constructs all processes.
113 // ---
114
115   AddTransportation();
116
117   ConstructEM();
118   if (fSetHadron)  ConstructHad();
119   if (fSetOptical) ConstructOp();
120   if (fSetSpecialCuts)  ConstructSpecialCuts();
121   if (fSetSpecialFlags) ConstructSpecialFlags();  
122   ConstructGeneral();
123   if (verboseLevel>1) PrintAllProcesses();
124   // InActivateEM();
125 }
126
127 void TG4PhysicsList::SetProcessActivation()
128 {
129 // (In)Activates built processes according
130 // to the setup in TG4PhysicsManager::fFlagVector.
131 // ---
132
133   G4cout << "TG4PhysicsList::SetProcessActivation() start" << endl;
134   
135   TG4PhysicsManager* physicsManager = TG4PhysicsManager::Instance();
136   TG4FlagVector* flagVector = physicsManager->GetFlagVector();
137
138   // uncomment following lines to print
139   // the flagVector values
140   //for (G4int i=0; i<kNoG3Flags; i++)
141   //{ cout << i << " flag: " << (*flagVector)[i] << endl; }
142
143   if (flagVector) {
144     theParticleIterator->reset();
145     while ((*theParticleIterator)())
146     {
147       G4ParticleDefinition* particle = theParticleIterator->value();
148       G4ProcessManager* processManager = particle->GetProcessManager(); 
149       G4ProcessVector* processVector = processManager->GetProcessList();
150     
151       // set processes flags
152       for (G4int i=0; i<processManager->GetProcessListLength(); i++) {
153         G4int flag = flagVector->GetFlag((*processVector)[i]);
154         if ((flag == kInActivate) && 
155             (processManager->GetProcessActivation(i))) {
156           if (verboseLevel>1) {
157              G4cout << "Set process inactivation for " 
158                     << (*processVector)[i]->GetProcessName() << endl;
159           }
160           processManager->SetProcessActivation(i,false);
161         }  
162         else if (((flag == kActivate) || (flag == kActivate2)) &&
163                  (!processManager->GetProcessActivation(i))) {
164           if (verboseLevel>1) {
165              G4cout << "Set process activation for " 
166                     << (*processVector)[i]->GetProcessName() << endl;
167           }
168           processManager->SetProcessActivation(i,true);
169         } 
170       }
171     }
172   }
173   else {
174     G4String text = "TG4PhysicsList::SetProcessActivation: \n";
175     text = text + "    Vector of processes flags is not set.";
176     TG4Globals::Warning(text);
177   }    
178   G4cout << "TG4PhysicsList::SetProcessActivation() end" << endl;
179 }
180
181 void TG4PhysicsList::PrintAllProcesses() const
182 {
183 // Prints all processes.
184 // ---
185
186   G4cout << "TG4PhysicsList processes: " << endl;
187   G4cout << "========================= " << endl;
188  
189   G4ProcessTable* processTable = G4ProcessTable::GetProcessTable();
190   TG4StringVector* processNameList = processTable->GetNameList();
191
192   for (G4int i=0; i <processNameList->entries(); i++){
193     G4cout << "   " << (*processNameList)[i] << endl;
194   }  
195 }
196
197 // protected methods
198
199 #include <G4ComptonScattering.hh>
200 #include <G4GammaConversion.hh>
201 #include <G4PhotoElectricEffect.hh>
202
203 #include <G4MultipleScattering.hh>
204
205 #include <G4eIonisation.hh>
206 #include <G4eBremsstrahlung.hh>
207 #include <G4eplusAnnihilation.hh>
208
209 #include <G4MuIonisation.hh>
210 #include <G4MuBremsstrahlung.hh>
211 #include <G4MuPairProduction.hh>
212
213 #include <G4hIonisation.hh>
214 #include <G4ionIonisation.hh>
215
216 void TG4PhysicsList::ConstructEM()
217 {
218 // Constructs electromagnetic processes.
219 // ---
220
221   theParticleIterator->reset();
222   while( (*theParticleIterator)() ){
223     G4ParticleDefinition* particle = theParticleIterator->value();
224     G4ProcessManager* pmanager = particle->GetProcessManager();
225     G4String particleName = particle->GetParticleName();
226      
227     if (particleName == "gamma") {
228     // gamma
229       // Construct processes for gamma
230       pmanager->AddDiscreteProcess(new G4GammaConversion());
231       pmanager->AddDiscreteProcess(new G4ComptonScattering());      
232       pmanager->AddDiscreteProcess(new G4PhotoElectricEffect());
233
234     } else if (particleName == "e-") {
235     //electron
236       // Construct processes for electron
237       G4VProcess* theeminusMultipleScattering = new G4MultipleScattering();
238       G4VProcess* theeminusIonisation = new G4eIonisation();
239       G4VProcess* theeminusBremsstrahlung = new G4eBremsstrahlung();
240       // add processes
241       pmanager->AddProcess(theeminusMultipleScattering);
242       pmanager->AddProcess(theeminusIonisation);
243       pmanager->AddProcess(theeminusBremsstrahlung);      
244       // set ordering for AlongStepDoIt
245       pmanager->SetProcessOrdering(theeminusMultipleScattering, idxAlongStep,  1);
246       pmanager->SetProcessOrdering(theeminusIonisation, idxAlongStep,  2);
247       // set ordering for PostStepDoIt
248       pmanager->SetProcessOrdering(theeminusMultipleScattering, idxPostStep, 1);
249       pmanager->SetProcessOrdering(theeminusIonisation, idxPostStep, 2);
250       pmanager->SetProcessOrdering(theeminusBremsstrahlung, idxPostStep, 3);
251
252     } else if (particleName == "e+") {
253     //positron
254       // Construct processes for positron
255       G4VProcess* theeplusMultipleScattering = new G4MultipleScattering();
256       G4VProcess* theeplusIonisation = new G4eIonisation();
257       G4VProcess* theeplusBremsstrahlung = new G4eBremsstrahlung();
258       G4VProcess* theeplusAnnihilation = new G4eplusAnnihilation();
259       // add processes
260       pmanager->AddProcess(theeplusMultipleScattering);
261       pmanager->AddProcess(theeplusIonisation);
262       pmanager->AddProcess(theeplusBremsstrahlung);
263       pmanager->AddProcess(theeplusAnnihilation);
264       // set ordering for AtRestDoIt
265       pmanager->SetProcessOrderingToFirst(theeplusAnnihilation, idxAtRest);
266       // set ordering for AlongStepDoIt
267       pmanager->SetProcessOrdering(theeplusMultipleScattering, idxAlongStep,  1);
268       pmanager->SetProcessOrdering(theeplusIonisation, idxAlongStep,  2);
269       // set ordering for PostStepDoIt
270       pmanager->SetProcessOrdering(theeplusMultipleScattering, idxPostStep, 1);
271       pmanager->SetProcessOrdering(theeplusIonisation, idxPostStep, 2);
272       pmanager->SetProcessOrdering(theeplusBremsstrahlung, idxPostStep, 3);
273       pmanager->SetProcessOrdering(theeplusAnnihilation, idxPostStep, 4);
274   
275     } else if( particleName == "mu+" || 
276                particleName == "mu-"    ) {
277     //muon  
278      // Construct processes for muon+
279      G4VProcess* aMultipleScattering = new G4MultipleScattering();
280      G4VProcess* aBremsstrahlung = new G4MuBremsstrahlung();
281      G4VProcess* aPairProduction = new G4MuPairProduction();
282      G4VProcess* anIonisation = new G4MuIonisation();
283       // add processes
284      pmanager->AddProcess(anIonisation);
285      pmanager->AddProcess(aMultipleScattering);
286      pmanager->AddProcess(aBremsstrahlung);
287      pmanager->AddProcess(aPairProduction);
288      // set ordering for AlongStepDoIt
289      pmanager->SetProcessOrdering(aMultipleScattering, idxAlongStep,  1);
290      pmanager->SetProcessOrdering(anIonisation, idxAlongStep,  2);
291      // set ordering for PostStepDoIt
292      pmanager->SetProcessOrdering(aMultipleScattering, idxPostStep, 1);
293      pmanager->SetProcessOrdering(anIonisation, idxPostStep, 2);
294      pmanager->SetProcessOrdering(aBremsstrahlung, idxPostStep, 3);
295      pmanager->SetProcessOrdering(aPairProduction, idxPostStep, 4);
296      
297     } else if( particleName == "GenericIon" ) {
298      G4VProcess* aionIonization = new G4ionIonisation;
299      G4VProcess* aMultipleScattering = new G4MultipleScattering();
300      pmanager->AddProcess(aionIonization);
301      pmanager->AddProcess(aMultipleScattering);
302      // set ordering for AlongStepDoIt
303      pmanager->SetProcessOrdering(aMultipleScattering, idxAlongStep,  1);
304      pmanager->SetProcessOrdering(aionIonization, idxAlongStep,  2);
305      // set ordering for PostStepDoIt
306      pmanager->SetProcessOrdering(aMultipleScattering, idxPostStep, 1);
307      pmanager->SetProcessOrdering(aionIonization, idxPostStep, 2);
308
309    } else if ((!particle->IsShortLived()) &&
310               (particle->GetPDGCharge() != 0.0) && 
311               (particle->GetParticleName() != "chargedgeantino")) {
312      // all others charged particles except geantino
313      G4VProcess* aMultipleScattering = new G4MultipleScattering();
314      G4VProcess* anIonisation = new G4hIonisation();
315      // add processes
316      pmanager->AddProcess(anIonisation);
317      pmanager->AddProcess(aMultipleScattering);
318      // set ordering for AlongStepDoIt
319      pmanager->SetProcessOrdering(aMultipleScattering, idxAlongStep,  1);
320      pmanager->SetProcessOrdering(anIonisation, idxAlongStep,  2);
321      // set ordering for PostStepDoIt
322      pmanager->SetProcessOrdering(aMultipleScattering, idxPostStep, 1);
323      pmanager->SetProcessOrdering(anIonisation, idxPostStep, 2);
324     }
325   }
326 }
327
328
329 // Hadron Processes
330
331 #include <G4HadronElasticProcess.hh>
332
333 #include <G4PionPlusInelasticProcess.hh>
334 #include <G4PionMinusInelasticProcess.hh>
335 #include <G4KaonPlusInelasticProcess.hh>
336 #include <G4KaonZeroSInelasticProcess.hh>
337 #include <G4KaonZeroLInelasticProcess.hh>
338 #include <G4KaonMinusInelasticProcess.hh>
339 #include <G4ProtonInelasticProcess.hh>
340 #include <G4AntiProtonInelasticProcess.hh>
341 #include <G4NeutronInelasticProcess.hh>
342 #include <G4AntiNeutronInelasticProcess.hh>
343 #include <G4LambdaInelasticProcess.hh>
344 #include <G4AntiLambdaInelasticProcess.hh>
345 #include <G4SigmaPlusInelasticProcess.hh>
346 #include <G4SigmaMinusInelasticProcess.hh>
347 #include <G4AntiSigmaPlusInelasticProcess.hh>
348 #include <G4AntiSigmaMinusInelasticProcess.hh>
349 #include <G4XiZeroInelasticProcess.hh>
350 #include <G4XiMinusInelasticProcess.hh>
351 #include <G4AntiXiZeroInelasticProcess.hh>
352 #include <G4AntiXiMinusInelasticProcess.hh>
353 #include <G4DeuteronInelasticProcess.hh>
354 #include <G4TritonInelasticProcess.hh>
355 #include <G4AlphaInelasticProcess.hh>
356 #include <G4OmegaMinusInelasticProcess.hh>
357 #include <G4AntiOmegaMinusInelasticProcess.hh>
358
359 // Low-energy Models
360
361 #include <G4LElastic.hh>
362
363 #include <G4LEPionPlusInelastic.hh>
364 #include <G4LEPionMinusInelastic.hh>
365 #include <G4LEKaonPlusInelastic.hh>
366 #include <G4LEKaonZeroSInelastic.hh>
367 #include <G4LEKaonZeroLInelastic.hh>
368 #include <G4LEKaonMinusInelastic.hh>
369 #include <G4LEProtonInelastic.hh>
370 #include <G4LEAntiProtonInelastic.hh>
371 #include <G4LENeutronInelastic.hh>
372 #include <G4LEAntiNeutronInelastic.hh>
373 #include <G4LELambdaInelastic.hh>
374 #include <G4LEAntiLambdaInelastic.hh>
375 #include <G4LESigmaPlusInelastic.hh>
376 #include <G4LESigmaMinusInelastic.hh>
377 #include <G4LEAntiSigmaPlusInelastic.hh>
378 #include <G4LEAntiSigmaMinusInelastic.hh>
379 #include <G4LEXiZeroInelastic.hh>
380 #include <G4LEXiMinusInelastic.hh>
381 #include <G4LEAntiXiZeroInelastic.hh>
382 #include <G4LEAntiXiMinusInelastic.hh>
383 #include <G4LEDeuteronInelastic.hh>
384 #include <G4LETritonInelastic.hh>
385 #include <G4LEAlphaInelastic.hh>
386 #include <G4LEOmegaMinusInelastic.hh>
387 #include <G4LEAntiOmegaMinusInelastic.hh>
388
389 // High-energy Models
390
391 #include <G4HEPionPlusInelastic.hh>
392 #include <G4HEPionMinusInelastic.hh>
393 #include <G4HEKaonPlusInelastic.hh>
394 #include <G4HEKaonZeroInelastic.hh>
395 #include <G4HEKaonZeroInelastic.hh>
396 #include <G4HEKaonMinusInelastic.hh>
397 #include <G4HEProtonInelastic.hh>
398 #include <G4HEAntiProtonInelastic.hh>
399 #include <G4HENeutronInelastic.hh>
400 #include <G4HEAntiNeutronInelastic.hh>
401 #include <G4HELambdaInelastic.hh>
402 #include <G4HEAntiLambdaInelastic.hh>
403 #include <G4HESigmaPlusInelastic.hh>
404 #include <G4HESigmaMinusInelastic.hh>
405 #include <G4HEAntiSigmaPlusInelastic.hh>
406 #include <G4HEAntiSigmaMinusInelastic.hh>
407 #include <G4HEXiZeroInelastic.hh>
408 #include <G4HEXiMinusInelastic.hh>
409 #include <G4HEAntiXiZeroInelastic.hh>
410 #include <G4HEAntiXiMinusInelastic.hh>
411 #include <G4HEOmegaMinusInelastic.hh>
412 #include <G4HEAntiOmegaMinusInelastic.hh>
413
414 // Stopping processes
415
416 #ifdef TRIUMF_STOP_PIMINUS
417 #include <G4PionMinusAbsorptionAtRest.hh>
418 #else
419 #include <G4PiMinusAbsorptionAtRest.hh>
420 #endif
421 #ifdef TRIUMF_STOP_KMINUS
422 #include <G4KaonMinusAbsorption.hh>
423 #else
424 #include <G4KaonMinusAbsorptionAtRest.hh>
425 #endif
426
427 void TG4PhysicsList::ConstructHad()
428 {
429 //
430 // ConstructHad()
431 //
432 // Makes discrete physics processes for the hadrons, at present limited
433 // to those particles with GHEISHA interactions (INTRC > 0).
434 // The processes are: Elastic scattering and Inelastic scattering.
435 //
436 // F.W.Jones  09-JUL-1998
437 // ---
438
439    G4cout << "### TG4PhysicsList::ConstructHad()" << endl;
440
441    G4HadronElasticProcess* theElasticProcess = 
442                                     new G4HadronElasticProcess;
443    G4LElastic* theElasticModel = new G4LElastic;
444    theElasticProcess->RegisterMe(theElasticModel);
445
446    theParticleIterator->reset();
447    while ((*theParticleIterator)()) {
448       G4ParticleDefinition* particle = theParticleIterator->value();
449       G4ProcessManager* pmanager = particle->GetProcessManager();
450       G4String particleName = particle->GetParticleName();
451      
452       if (particleName == "pi+") {
453          pmanager->AddDiscreteProcess(theElasticProcess);
454          G4PionPlusInelasticProcess* theInelasticProcess = 
455                                 new G4PionPlusInelasticProcess("inelastic");
456          G4LEPionPlusInelastic* theLEInelasticModel = 
457                                 new G4LEPionPlusInelastic;
458          theInelasticProcess->RegisterMe(theLEInelasticModel);
459          G4HEPionPlusInelastic* theHEInelasticModel = 
460                                 new G4HEPionPlusInelastic;
461          theInelasticProcess->RegisterMe(theHEInelasticModel);
462          pmanager->AddDiscreteProcess(theInelasticProcess);
463       }
464       else if (particleName == "pi-") {
465          pmanager->AddDiscreteProcess(theElasticProcess);
466          G4PionMinusInelasticProcess* theInelasticProcess = 
467                                 new G4PionMinusInelasticProcess("inelastic");
468          G4LEPionMinusInelastic* theLEInelasticModel = 
469                                 new G4LEPionMinusInelastic;
470          theInelasticProcess->RegisterMe(theLEInelasticModel);
471          G4HEPionMinusInelastic* theHEInelasticModel = 
472                                 new G4HEPionMinusInelastic;
473          theInelasticProcess->RegisterMe(theHEInelasticModel);
474          pmanager->AddDiscreteProcess(theInelasticProcess);
475 #ifdef TRIUMF_STOP_PIMINUS
476          pmanager->AddRestProcess(new G4PionMinusAbsorptionAtRest, ordDefault);
477 #else
478          G4String prcNam;
479          pmanager->AddRestProcess(
480            new G4PiMinusAbsorptionAtRest(
481                 prcNam="PiMinusAbsorptionAtRest"), ordDefault);
482 #endif
483       }
484       else if (particleName == "kaon+") {
485          pmanager->AddDiscreteProcess(theElasticProcess);
486          G4KaonPlusInelasticProcess* theInelasticProcess = 
487                                   new G4KaonPlusInelasticProcess("inelastic");
488          G4LEKaonPlusInelastic* theLEInelasticModel = 
489                                   new G4LEKaonPlusInelastic;
490          theInelasticProcess->RegisterMe(theLEInelasticModel);
491          G4HEKaonPlusInelastic* theHEInelasticModel = 
492                                   new G4HEKaonPlusInelastic;
493          theInelasticProcess->RegisterMe(theHEInelasticModel);
494          pmanager->AddDiscreteProcess(theInelasticProcess);
495       }
496       else if (particleName == "kaon0S") {
497          pmanager->AddDiscreteProcess(theElasticProcess);
498          G4KaonZeroSInelasticProcess* theInelasticProcess = 
499                              new G4KaonZeroSInelasticProcess("inelastic");
500          G4LEKaonZeroSInelastic* theLEInelasticModel = 
501                              new G4LEKaonZeroSInelastic;
502          theInelasticProcess->RegisterMe(theLEInelasticModel);
503          G4HEKaonZeroInelastic* theHEInelasticModel = 
504                              new G4HEKaonZeroInelastic;
505          theInelasticProcess->RegisterMe(theHEInelasticModel);
506          pmanager->AddDiscreteProcess(theInelasticProcess);
507       }
508       else if (particleName == "kaon0L") {
509          pmanager->AddDiscreteProcess(theElasticProcess);
510          G4KaonZeroLInelasticProcess* theInelasticProcess = 
511                              new G4KaonZeroLInelasticProcess("inelastic");
512          G4LEKaonZeroLInelastic* theLEInelasticModel = 
513                              new G4LEKaonZeroLInelastic;
514          theInelasticProcess->RegisterMe(theLEInelasticModel);
515          G4HEKaonZeroInelastic* theHEInelasticModel = 
516                              new G4HEKaonZeroInelastic;
517          theInelasticProcess->RegisterMe(theHEInelasticModel);
518          pmanager->AddDiscreteProcess(theInelasticProcess);
519       }
520       else if (particleName == "kaon-") {
521          pmanager->AddDiscreteProcess(theElasticProcess);
522          G4KaonMinusInelasticProcess* theInelasticProcess = 
523                                  new G4KaonMinusInelasticProcess("inelastic");
524          G4LEKaonMinusInelastic* theLEInelasticModel = 
525                                  new G4LEKaonMinusInelastic;
526          theInelasticProcess->RegisterMe(theLEInelasticModel);
527          G4HEKaonMinusInelastic* theHEInelasticModel = 
528                                  new G4HEKaonMinusInelastic;
529          theInelasticProcess->RegisterMe(theHEInelasticModel);
530          pmanager->AddDiscreteProcess(theInelasticProcess);
531 #ifdef TRIUMF_STOP_KMINUS
532          pmanager->AddRestProcess(new G4KaonMinusAbsorption, ordDefault);
533 #else
534          pmanager->AddRestProcess(new G4KaonMinusAbsorptionAtRest, ordDefault);
535 #endif
536       }
537       else if (particleName == "proton") {
538          pmanager->AddDiscreteProcess(theElasticProcess);
539          G4ProtonInelasticProcess* theInelasticProcess = 
540                                     new G4ProtonInelasticProcess("inelastic");
541          G4LEProtonInelastic* theLEInelasticModel = new G4LEProtonInelastic;
542          theInelasticProcess->RegisterMe(theLEInelasticModel);
543          G4HEProtonInelastic* theHEInelasticModel = new G4HEProtonInelastic;
544          theInelasticProcess->RegisterMe(theHEInelasticModel);
545          pmanager->AddDiscreteProcess(theInelasticProcess);
546       }
547       else if (particleName == "anti_proton") {
548          pmanager->AddDiscreteProcess(theElasticProcess);
549          G4AntiProtonInelasticProcess* theInelasticProcess = 
550                                 new G4AntiProtonInelasticProcess("inelastic");
551          G4LEAntiProtonInelastic* theLEInelasticModel = 
552                                 new G4LEAntiProtonInelastic;
553          theInelasticProcess->RegisterMe(theLEInelasticModel);
554          G4HEAntiProtonInelastic* theHEInelasticModel = 
555                                 new G4HEAntiProtonInelastic;
556          theInelasticProcess->RegisterMe(theHEInelasticModel);
557          pmanager->AddDiscreteProcess(theInelasticProcess);
558       }
559       else if (particleName == "neutron") {
560          pmanager->AddDiscreteProcess(theElasticProcess);
561          G4NeutronInelasticProcess* theInelasticProcess = 
562                                     new G4NeutronInelasticProcess("inelastic");
563          G4LENeutronInelastic* theLEInelasticModel = 
564                                     new G4LENeutronInelastic;
565          theInelasticProcess->RegisterMe(theLEInelasticModel);
566          G4HENeutronInelastic* theHEInelasticModel = 
567                                     new G4HENeutronInelastic;
568          theInelasticProcess->RegisterMe(theHEInelasticModel);
569          pmanager->AddDiscreteProcess(theInelasticProcess);
570       }  
571       else if (particleName == "anti_neutron") {
572          pmanager->AddDiscreteProcess(theElasticProcess);
573          G4AntiNeutronInelasticProcess* theInelasticProcess = 
574                                new G4AntiNeutronInelasticProcess("inelastic");
575          G4LEAntiNeutronInelastic* theLEInelasticModel = 
576                                new G4LEAntiNeutronInelastic;
577          theInelasticProcess->RegisterMe(theLEInelasticModel);
578          G4HEAntiNeutronInelastic* theHEInelasticModel = 
579                                new G4HEAntiNeutronInelastic;
580          theInelasticProcess->RegisterMe(theHEInelasticModel);
581          pmanager->AddDiscreteProcess(theInelasticProcess);
582       }
583       else if (particleName == "lambda") {
584          pmanager->AddDiscreteProcess(theElasticProcess);
585          G4LambdaInelasticProcess* theInelasticProcess = 
586                                     new G4LambdaInelasticProcess("inelastic");
587          G4LELambdaInelastic* theLEInelasticModel = new G4LELambdaInelastic;
588          theInelasticProcess->RegisterMe(theLEInelasticModel);
589          G4HELambdaInelastic* theHEInelasticModel = new G4HELambdaInelastic;
590          theInelasticProcess->RegisterMe(theHEInelasticModel);
591          pmanager->AddDiscreteProcess(theInelasticProcess);
592       }
593       else if (particleName == "anti_lambda") {
594          pmanager->AddDiscreteProcess(theElasticProcess);
595          G4AntiLambdaInelasticProcess* theInelasticProcess = 
596                                 new G4AntiLambdaInelasticProcess("inelastic");
597          G4LEAntiLambdaInelastic* theLEInelasticModel = 
598                                 new G4LEAntiLambdaInelastic;
599          theInelasticProcess->RegisterMe(theLEInelasticModel);
600          G4HEAntiLambdaInelastic* theHEInelasticModel = 
601                                 new G4HEAntiLambdaInelastic;
602          theInelasticProcess->RegisterMe(theHEInelasticModel);
603          pmanager->AddDiscreteProcess(theInelasticProcess);
604       }
605       else if (particleName == "sigma+") {
606          pmanager->AddDiscreteProcess(theElasticProcess);
607          G4SigmaPlusInelasticProcess* theInelasticProcess = 
608                                  new G4SigmaPlusInelasticProcess("inelastic");
609          G4LESigmaPlusInelastic* theLEInelasticModel = 
610                                  new G4LESigmaPlusInelastic;
611          theInelasticProcess->RegisterMe(theLEInelasticModel);
612          G4HESigmaPlusInelastic* theHEInelasticModel = 
613                                  new G4HESigmaPlusInelastic;
614          theInelasticProcess->RegisterMe(theHEInelasticModel);
615          pmanager->AddDiscreteProcess(theInelasticProcess);
616       }
617       else if (particleName == "sigma-") {
618          pmanager->AddDiscreteProcess(theElasticProcess);
619          G4SigmaMinusInelasticProcess* theInelasticProcess = 
620                                  new G4SigmaMinusInelasticProcess("inelastic");
621          G4LESigmaMinusInelastic* theLEInelasticModel = 
622                                  new G4LESigmaMinusInelastic;
623          theInelasticProcess->RegisterMe(theLEInelasticModel);
624          G4HESigmaMinusInelastic* theHEInelasticModel = 
625                                  new G4HESigmaMinusInelastic;
626          theInelasticProcess->RegisterMe(theHEInelasticModel);
627          pmanager->AddDiscreteProcess(theInelasticProcess);
628       }
629       else if (particleName == "anti_sigma+") {
630          pmanager->AddDiscreteProcess(theElasticProcess);
631          G4AntiSigmaPlusInelasticProcess* theInelasticProcess = 
632                              new G4AntiSigmaPlusInelasticProcess("inelastic");
633          G4LEAntiSigmaPlusInelastic* theLEInelasticModel = 
634                                  new G4LEAntiSigmaPlusInelastic;
635          theInelasticProcess->RegisterMe(theLEInelasticModel);
636          G4HEAntiSigmaPlusInelastic* theHEInelasticModel = 
637                                  new G4HEAntiSigmaPlusInelastic;
638          theInelasticProcess->RegisterMe(theHEInelasticModel);
639          pmanager->AddDiscreteProcess(theInelasticProcess);
640       }
641       else if (particleName == "anti_sigma-") {
642          pmanager->AddDiscreteProcess(theElasticProcess);
643          G4AntiSigmaMinusInelasticProcess* theInelasticProcess = 
644                             new G4AntiSigmaMinusInelasticProcess("inelastic");
645          G4LEAntiSigmaMinusInelastic* theLEInelasticModel = 
646                                  new G4LEAntiSigmaMinusInelastic;
647          theInelasticProcess->RegisterMe(theLEInelasticModel);
648          G4HEAntiSigmaMinusInelastic* theHEInelasticModel = 
649                                  new G4HEAntiSigmaMinusInelastic;
650          theInelasticProcess->RegisterMe(theHEInelasticModel);
651          pmanager->AddDiscreteProcess(theInelasticProcess);
652       }
653       else if (particleName == "xi0") {
654          pmanager->AddDiscreteProcess(theElasticProcess);
655          G4XiZeroInelasticProcess* theInelasticProcess = 
656                             new G4XiZeroInelasticProcess("inelastic");
657          G4LEXiZeroInelastic* theLEInelasticModel = 
658                                  new G4LEXiZeroInelastic;
659          theInelasticProcess->RegisterMe(theLEInelasticModel);
660          G4HEXiZeroInelastic* theHEInelasticModel = 
661                                  new G4HEXiZeroInelastic;
662          theInelasticProcess->RegisterMe(theHEInelasticModel);
663          pmanager->AddDiscreteProcess(theInelasticProcess);
664       }
665       else if (particleName == "xi-") {
666          pmanager->AddDiscreteProcess(theElasticProcess);
667          G4XiMinusInelasticProcess* theInelasticProcess = 
668                             new G4XiMinusInelasticProcess("inelastic");
669          G4LEXiMinusInelastic* theLEInelasticModel = 
670                                  new G4LEXiMinusInelastic;
671          theInelasticProcess->RegisterMe(theLEInelasticModel);
672          G4HEXiMinusInelastic* theHEInelasticModel = 
673                                  new G4HEXiMinusInelastic;
674          theInelasticProcess->RegisterMe(theHEInelasticModel);
675          pmanager->AddDiscreteProcess(theInelasticProcess);
676       }
677       else if (particleName == "anti_xi0") {
678          pmanager->AddDiscreteProcess(theElasticProcess);
679          G4AntiXiZeroInelasticProcess* theInelasticProcess = 
680                             new G4AntiXiZeroInelasticProcess("inelastic");
681          G4LEAntiXiZeroInelastic* theLEInelasticModel = 
682                                  new G4LEAntiXiZeroInelastic;
683          theInelasticProcess->RegisterMe(theLEInelasticModel);
684          G4HEAntiXiZeroInelastic* theHEInelasticModel = 
685                                  new G4HEAntiXiZeroInelastic;
686          theInelasticProcess->RegisterMe(theHEInelasticModel);
687          pmanager->AddDiscreteProcess(theInelasticProcess);
688       }
689       else if (particleName == "anti_xi-") {
690          pmanager->AddDiscreteProcess(theElasticProcess);
691          G4AntiXiMinusInelasticProcess* theInelasticProcess = 
692                             new G4AntiXiMinusInelasticProcess("inelastic");
693          G4LEAntiXiMinusInelastic* theLEInelasticModel = 
694                                  new G4LEAntiXiMinusInelastic;
695          theInelasticProcess->RegisterMe(theLEInelasticModel);
696          G4HEAntiXiMinusInelastic* theHEInelasticModel = 
697                                  new G4HEAntiXiMinusInelastic;
698          theInelasticProcess->RegisterMe(theHEInelasticModel);
699          pmanager->AddDiscreteProcess(theInelasticProcess);
700       }
701       else if (particleName == "deuteron") {
702          pmanager->AddDiscreteProcess(theElasticProcess);
703          G4DeuteronInelasticProcess* theInelasticProcess = 
704                             new G4DeuteronInelasticProcess("inelastic");
705          G4LEDeuteronInelastic* theLEInelasticModel = 
706                                  new G4LEDeuteronInelastic;
707          theInelasticProcess->RegisterMe(theLEInelasticModel);
708          pmanager->AddDiscreteProcess(theInelasticProcess);
709       }
710       else if (particleName == "triton") {
711          pmanager->AddDiscreteProcess(theElasticProcess);
712          G4TritonInelasticProcess* theInelasticProcess = 
713                             new G4TritonInelasticProcess("inelastic");
714          G4LETritonInelastic* theLEInelasticModel = 
715                                  new G4LETritonInelastic;
716          theInelasticProcess->RegisterMe(theLEInelasticModel);
717          pmanager->AddDiscreteProcess(theInelasticProcess);
718       }
719       else if (particleName == "alpha") {
720          pmanager->AddDiscreteProcess(theElasticProcess);
721          G4AlphaInelasticProcess* theInelasticProcess = 
722                             new G4AlphaInelasticProcess("inelastic");
723          G4LEAlphaInelastic* theLEInelasticModel = 
724                                  new G4LEAlphaInelastic;
725          theInelasticProcess->RegisterMe(theLEInelasticModel);
726          pmanager->AddDiscreteProcess(theInelasticProcess);
727       }
728       else if (particleName == "omega-") {
729          pmanager->AddDiscreteProcess(theElasticProcess);
730          G4OmegaMinusInelasticProcess* theInelasticProcess = 
731                             new G4OmegaMinusInelasticProcess("inelastic");
732          G4LEOmegaMinusInelastic* theLEInelasticModel = 
733                                  new G4LEOmegaMinusInelastic;
734          theInelasticProcess->RegisterMe(theLEInelasticModel);
735          G4HEOmegaMinusInelastic* theHEInelasticModel = 
736                                  new G4HEOmegaMinusInelastic;
737          theInelasticProcess->RegisterMe(theHEInelasticModel);
738          pmanager->AddDiscreteProcess(theInelasticProcess);
739       }
740       else if (particleName == "anti_omega-") {
741          pmanager->AddDiscreteProcess(theElasticProcess);
742          G4AntiOmegaMinusInelasticProcess* theInelasticProcess = 
743                             new G4AntiOmegaMinusInelasticProcess("inelastic");
744          G4LEAntiOmegaMinusInelastic* theLEInelasticModel = 
745                                  new G4LEAntiOmegaMinusInelastic;
746          theInelasticProcess->RegisterMe(theLEInelasticModel);
747          G4HEAntiOmegaMinusInelastic* theHEInelasticModel = 
748                                  new G4HEAntiOmegaMinusInelastic;
749          theInelasticProcess->RegisterMe(theHEInelasticModel);
750          pmanager->AddDiscreteProcess(theInelasticProcess);
751       }
752    }
753
754    G4cout << "### TG4PhysicsList::ConstructHad() finished." << endl;
755
756 }
757
758
759 #include <G4Cerenkov.hh>
760 #include <G4OpAbsorption.hh>
761 #include <G4OpRayleigh.hh>
762 #include <G4OpBoundaryProcess.hh>
763
764 void TG4PhysicsList::ConstructOp()
765 {
766 // Constructs optical processes.
767 // According to ExN06PhysicsList.cc.
768 // (geant4 1.1)
769 // ---
770
771   G4Cerenkov*     theCerenkovProcess = new G4Cerenkov("Cerenkov");
772   G4OpAbsorption* theAbsorptionProcess = new G4OpAbsorption();
773   G4OpRayleigh*   theRayleighScatteringProcess = new G4OpRayleigh();
774   G4OpBoundaryProcess* theBoundaryProcess = new G4OpBoundaryProcess();
775
776   theCerenkovProcess->DumpPhysicsTable();
777   //theAbsorptionProcess->DumpPhysicsTable();
778   //theRayleighScatteringProcess->DumpPhysicsTable();
779
780   // add verbose 
781   //theCerenkovProcess->SetVerboseLevel(1);
782   //theAbsorptionProcess->SetVerboseLevel(1);
783   //theRayleighScatteringProcess->SetVerboseLevel(1);
784   //theBoundaryProcess->SetVerboseLevel(1);
785
786   G4int maxNumPhotons = 300;
787
788   theCerenkovProcess->SetTrackSecondariesFirst(true);
789   theCerenkovProcess->SetMaxNumPhotonsPerStep(maxNumPhotons);
790
791   //G4OpticalSurfaceModel themodel = unified;   
792   // model from GEANT3
793   G4OpticalSurfaceModel themodel = glisur;
794   theBoundaryProcess->SetModel(themodel);
795
796   theParticleIterator->reset();
797   while( (*theParticleIterator)() ){
798     G4ParticleDefinition* particle = theParticleIterator->value();
799     G4ProcessManager* processManager = particle->GetProcessManager();
800     G4String particleName = particle->GetParticleName();
801     if (theCerenkovProcess->IsApplicable(*particle)) {
802       processManager->AddContinuousProcess(theCerenkovProcess);
803     }
804     if (particleName == "opticalphoton") {
805       G4cout << " AddDiscreteProcess to OpticalPhoton " << G4endl;
806       processManager->AddDiscreteProcess(theAbsorptionProcess);
807       processManager->AddDiscreteProcess(theRayleighScatteringProcess);
808       processManager->AddDiscreteProcess(theBoundaryProcess);
809     }
810   }
811 }
812
813 #include <G4Decay.hh>
814
815 void TG4PhysicsList::ConstructGeneral()
816 {
817 // Constructs general processes.
818 // ---
819
820   // Add Decay Process
821   G4Decay* theDecayProcess = new G4Decay();
822   theParticleIterator->reset();
823   while( (*theParticleIterator)() ){
824     G4ParticleDefinition* particle = theParticleIterator->value();
825     G4ProcessManager* pmanager = particle->GetProcessManager();
826     if (theDecayProcess->IsApplicable(*particle)) { 
827       pmanager ->AddProcess(theDecayProcess);
828       // set ordering for PostStepDoIt and AtRestDoIt
829       pmanager ->SetProcessOrdering(theDecayProcess, idxPostStep);
830       pmanager ->SetProcessOrdering(theDecayProcess, idxAtRest);
831     }
832   }
833 }
834
835 void TG4PhysicsList::ConstructSpecialCuts()
836 {
837 // Adds TG4SpecialCuts "process" that activates
838 // the kinetic energy cuts defined in 
839 // the vector of cuts (PhysicsManager::fCutVector) or in TG4Limits.
840 // ---
841
842   TG4PhysicsManager* physicsManager 
843     = TG4PhysicsManager::Instance();
844
845   if (physicsManager->IsSpecialCuts())
846   {
847     TG4CutVector* cutVector
848       = physicsManager->GetCutVector(); 
849     TG4boolVector* isCutVector 
850       = physicsManager->GetIsCutVector(); 
851
852     theParticleIterator->reset();
853     while ((*theParticleIterator)())
854     {
855       G4ParticleDefinition* particle = theParticleIterator->value();
856       TG3ParticleWSP particleWSP 
857         = physicsManager->GetG3ParticleWSP(particle);
858       G4String name;
859       physicsManager->GetG3ParticleWSPName(particleWSP, name);
860       
861       // uncomment this to see all particles "WSP"
862       //G4cout << "Iterating particle: " 
863       //       << particle->GetParticleName() << " " << particleWSP << " "
864       //       << name << endl;
865
866       // special process is created in case
867       // cutVector (vector of kinetic energy cuts) is set
868       // or the special cut is set by TG4Limits
869       if ((particleWSP !=kNofParticlesWSP) && 
870           ((*isCutVector)[particleWSP])) {
871         // check if process already exists
872         G4String processName = "specialCutFor" + name;
873         G4VProcess* process = FindProcess(processName);
874         if (!process) {
875           process = new TG4SpecialCuts(particleWSP, cutVector, processName);
876         }  
877         //particle->GetProcessManager()->AddProcess(process, 0, -1, 1);
878         particle->GetProcessManager()->AddDiscreteProcess(process);
879       }
880     }
881
882     if (verboseLevel>0) {
883       G4cout << "TG4PhysicsList::ConstructSpecialCuts: " << endl;
884       if (cutVector)
885         G4cout << "   Global kinetic energy cuts are set." << endl;
886       G4cout << "   Special cuts process is defined for: " << endl 
887              << "   ";
888       for (G4int i=0; i<kAny; i++) {
889         G4String name;
890         physicsManager->GetG3ParticleWSPName(i, name);
891         if ((*isCutVector)[i]) G4cout << name << " ";
892       }  
893       G4cout << endl;
894     }  
895   }
896 }
897
898 void TG4PhysicsList::ConstructSpecialFlags()
899 {
900 // Adds TG4SpecialFlags "process" that activates
901 // the control process flags defined in TG4Limits.
902 // ---
903
904   TG4PhysicsManager* physicsManager 
905     = TG4PhysicsManager::Instance();
906
907   if (physicsManager->IsSpecialFlags())
908   {
909     G4cout << "IsSpecialFlags started" << endl;
910     TG4boolVector* isFlagVector 
911       = physicsManager->GetIsFlagVector(); 
912
913     theParticleIterator->reset();
914     while ((*theParticleIterator)())
915     {
916       G4ParticleDefinition* particle = theParticleIterator->value();
917       TG3ParticleWSP particleWSP 
918         = physicsManager->GetG3ParticleWSP(particle);
919       //G4String name;
920       //GetG3ParticleWSPName(particleWSP, name);
921
922       // special process is set in case
923       // the special flag is set by TG4Limits    
924       if ((particleWSP !=kNofParticlesWSP) && 
925           ((*isFlagVector)[particleWSP])) {
926         // check if process already exists
927         G4String processName = "specialFlag";
928         G4VProcess* process = FindProcess(processName);
929         if (!process) {
930           process = new TG4SpecialFlags(processName);
931         }  
932         //particle->GetProcessManager()->AddProcess(process, 0, -1, 1);
933         particle->GetProcessManager()->AddDiscreteProcess(process);
934       }
935     }
936
937     if (verboseLevel>0) {
938       G4cout << "TG4PhysicsList::ConstructSpecialFlagss: " << endl;
939       G4cout << "   Special flags process is defined for: " << endl
940              << "   ";
941       for (G4int i=0; i<kNofParticlesWSP; i++) {
942         G4String name;
943         physicsManager->GetG3ParticleWSPName(i, name);
944         if ((*isFlagVector)[i]) G4cout << name << " ";
945       }  
946       G4cout << endl;
947     }  
948   }
949 }
950
951 void TG4PhysicsList::SetCuts()
952 {
953 // "G4VUserPhysicsList::SetCutsWithDefault" method sets 
954 // the default cut value for all particle types 
955 // ---
956
957   SetCutsWithDefault();   
958 }
959
960 void TG4PhysicsList::ConstructAllBosons()
961 {
962 // Construct all bosons
963 // ---
964
965   G4BosonConstructor pConstructor;
966   pConstructor.ConstructParticle();
967 }
968
969 void TG4PhysicsList::ConstructAllLeptons()
970 {
971 // Construct all leptons
972 // ---
973
974   G4LeptonConstructor pConstructor;
975   pConstructor.ConstructParticle();
976 }
977
978 void TG4PhysicsList::ConstructAllMesons()
979 {
980 // Construct all mesons
981 // ---
982
983   G4MesonConstructor pConstructor;
984   pConstructor.ConstructParticle();
985 }
986
987 void TG4PhysicsList::ConstructAllBaryons()
988 {
989 // Construct all barions
990 // ---
991
992   G4BaryonConstructor pConstructor;
993   pConstructor.ConstructParticle();
994 }
995
996 void TG4PhysicsList::ConstructAllIons()
997 {
998 // Construct light ions
999 // ---
1000
1001   G4IonConstructor pConstructor;
1002   pConstructor.ConstructParticle();  
1003 }
1004
1005 void TG4PhysicsList::ConstructAllShortLiveds()
1006 {
1007 // Construct  resonaces and quarks
1008 // ---
1009
1010   G4ShortLivedConstructor pConstructor;
1011   pConstructor.ConstructParticle();  
1012 }
1013
1014 // private methods
1015
1016 G4VProcess* TG4PhysicsList::FindProcess(G4String processName) const
1017 {
1018 // Finds G4VProcess with specified name.
1019 // ---
1020
1021   G4ProcessTable* processTable = G4ProcessTable::GetProcessTable();
1022
1023   G4ProcessVector* processVector 
1024     = processTable->FindProcesses(processName);
1025   G4VProcess* firstFoundProcess = 0;
1026   if (processVector->entries()>0) firstFoundProcess= (*processVector)[0];
1027
1028   processVector->clear();
1029   delete processVector;
1030   
1031   return firstFoundProcess;
1032 }
1033
1034 void TG4PhysicsList::InActivateProcess(G4String processName, 
1035                         G4ParticleDefinition* particle)              
1036 {
1037 // Activates the process specified by name for the specified 
1038 // particle.
1039 // Only for tests - to be removed.
1040 // ---
1041
1042   G4ProcessManager* processManager = particle->GetProcessManager();
1043   G4ProcessVector* processVector = processManager->GetProcessList();
1044   for (G4int i=0; i<processVector->entries(); i++) {
1045     if ((*processVector)[i]->GetProcessName() == processName) {
1046       processManager->SetProcessActivation((*processVector)[i], false);
1047       return;
1048     }
1049   }
1050  
1051   G4String text = "TG4PhysicsList::InActivateProcess: ";
1052   text = text + processName + " is not set for ";
1053   text = text + particle->GetParticleName();
1054   TG4Globals::Exception(text);
1055 }
1056
1057 void TG4PhysicsList::InActivateEM()
1058 {
1059 // Inactivates specified electromagnetic processes.
1060 // Only for tests - to be removed.
1061 // !! This method must be called after all Construct methods.
1062 // Uncomment the selected line(s) to inactivate desired processes.
1063 // ---
1064
1065  theParticleIterator->reset();
1066   while ((*theParticleIterator)())
1067   {
1068     G4ParticleDefinition* particle = theParticleIterator->value();
1069     G4String name = particle->GetParticleName();     
1070     
1071     if (name == "gamma") {
1072       // gamma
1073       //InActivateProcess("phot",  particle);      
1074       //InActivateProcess("compt", particle);      
1075       //InActivateProcess("conv", particle);      
1076     } 
1077     else if (name == "e-") {
1078       //electron
1079       InActivateProcess("msc",  particle);      
1080       G4cout << "msc inactivated." << endl;
1081       //InActivateProcess("eIoni",  particle);      
1082       //G4cout << "eIoni inactivated." << endl;
1083       InActivateProcess("eBrem",  particle);      
1084       G4cout << "eBrem inactivated." << endl;
1085     } 
1086     else if (name == "e+") {
1087       //positron
1088       //InActivateProcess("msc",  particle);      
1089       //InActivateProcess("eIoni",  particle);      
1090       //InActivateProcess("eBrem",  particle);      
1091       //InActivateProcess("annihil",  particle);      
1092     } 
1093     else if (name == "mu+" || name == "mu-") {
1094       //muon  
1095       //InActivateProcess("msc",  particle);      
1096       //InActivateProcess("MuIoni",  particle);      
1097       //InActivateProcess("MuBrem",  particle);      
1098       //InActivateProcess("MuPairProd",  particle);      
1099     } 
1100     else if ((!particle->IsShortLived()) &&
1101              (particle->GetPDGCharge() != 0.0) && 
1102              (particle->GetParticleName() != "chargedgeantino")) 
1103     {
1104       // all others charged particles except geantino
1105       //InActivateProcess("msc",  particle);      
1106       //InActivateProcess("hIoni",  particle);      
1107     }
1108   }
1109 }
1110