]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TGeant4/TG4PhysicsConstructorGeneral.cxx
added inheritance from TG4Verbose;
[u/mrichter/AliRoot.git] / TGeant4 / TG4PhysicsConstructorGeneral.cxx
1 // $Id$
2 // Category: physics
3 //
4 // Author: I. Hrivnacova
5 //
6 // Class TG4PhysicsConstructorGeneral
7 // ------------------------------
8 // See the class description in the header file.
9 // According to ExN04IonPhysics.cc,v 1.1.2.1 2001/06/28 19:07:37 gunter Exp 
10 // GEANT4 tag Name: geant4-03-02
11
12 #include "TG4PhysicsConstructorGeneral.h"
13 #include "TG4ProcessControlMap.h"
14 #include "TG4ProcessMCMap.h"
15 #include "TG4G3Control.h"
16 #include "TG4ExtDecayer.h"
17 #include "AliDecayer.h"
18 #include "AliMC.h"
19
20 #include <G4ParticleDefinition.hh>
21 #include <G4ProcessManager.hh>
22 #include <G4ChargedGeantino.hh>
23 #include <G4Geantino.hh>
24
25 //_____________________________________________________________________________
26 TG4PhysicsConstructorGeneral::TG4PhysicsConstructorGeneral(const G4String& name)
27   : G4VPhysicsConstructor(name)
28 {
29 //
30   SetVerboseLevel(1);
31 }
32
33 //_____________________________________________________________________________
34 TG4PhysicsConstructorGeneral::~TG4PhysicsConstructorGeneral() {
35 //
36 }
37
38 // protected methods
39
40 //_____________________________________________________________________________
41 void TG4PhysicsConstructorGeneral::ConstructParticle()
42 {
43 // Instantiates particles.
44 // ---
45
46   // pseudo-particles
47   G4Geantino::GeantinoDefinition();
48   G4ChargedGeantino::ChargedGeantinoDefinition();  
49 }
50
51 //_____________________________________________________________________________
52 void TG4PhysicsConstructorGeneral::ConstructProcess()
53 {
54 // Constructs electromagnetic processes for e+.
55 // ---
56
57   // Set external decayer
58   AliDecayer* aliDecayer = gMC->Decayer(); 
59   if (aliDecayer) {
60     TG4ExtDecayer* tg4Decayer = new TG4ExtDecayer(aliDecayer);
61        // the tg4Decayer is deleted in G4Decay destructor
62     tg4Decayer->SetVerboseLevel(1);   
63     fDecayProcess.SetExtDecayer(tg4Decayer);
64     
65     if (verboseLevel>0) G4cout << "### External decayer is set" << G4endl;
66   } 
67
68   theParticleIterator->reset();
69   while( (*theParticleIterator)() ){
70     G4ParticleDefinition* particle = theParticleIterator->value();
71     G4ProcessManager* pmanager = particle->GetProcessManager();
72     if (fDecayProcess.IsApplicable(*particle)) { 
73       pmanager ->AddProcess(&fDecayProcess);
74       // set ordering for PostStepDoIt and AtRestDoIt
75       pmanager ->SetProcessOrdering(&fDecayProcess, idxPostStep);
76       pmanager ->SetProcessOrdering(&fDecayProcess, idxAtRest);
77     }
78   }
79   
80   // map to G3 controls
81   TG4ProcessControlMap* processMap = TG4ProcessControlMap::Instance();
82   processMap->Add(&fDecayProcess, kDCAY); 
83
84   if (verboseLevel>0)
85     G4cout << "### General physics constructed." << G4endl;
86 }