]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TGeant4/TG4PhysicsConstructorGeneral.cxx
Enable creation of fast rec points for ITS, when input argument for ITS = 2.
[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   : TG4VPhysicsConstructor(name) {
28 //
29 }
30
31 //_____________________________________________________________________________
32 TG4PhysicsConstructorGeneral::TG4PhysicsConstructorGeneral(
33                                                    G4int verboseLevel,
34                                                    const G4String& name)
35   : TG4VPhysicsConstructor(name, verboseLevel) {
36 //
37 }
38
39 //_____________________________________________________________________________
40 TG4PhysicsConstructorGeneral::~TG4PhysicsConstructorGeneral() {
41 //
42 }
43
44 // protected methods
45
46 //_____________________________________________________________________________
47 void TG4PhysicsConstructorGeneral::ConstructParticle()
48 {
49 // Instantiates particles.
50 // ---
51
52   // pseudo-particles
53   G4Geantino::GeantinoDefinition();
54   G4ChargedGeantino::ChargedGeantinoDefinition();  
55 }
56
57 //_____________________________________________________________________________
58 void TG4PhysicsConstructorGeneral::ConstructProcess()
59 {
60 // Constructs electromagnetic processes for e+.
61 // ---
62
63   // Set external decayer
64   AliDecayer* aliDecayer = gMC->Decayer(); 
65   if (aliDecayer) {
66     TG4ExtDecayer* tg4Decayer = new TG4ExtDecayer(aliDecayer);
67        // the tg4Decayer is deleted in G4Decay destructor
68     tg4Decayer->VerboseLevel(VerboseLevel());   
69     fDecayProcess.SetExtDecayer(tg4Decayer);
70     
71     if (VerboseLevel() > 0) { 
72       G4cout << "### External decayer is set" << G4endl;
73     }  
74   } 
75
76   theParticleIterator->reset();
77   while( (*theParticleIterator)() ){
78     G4ParticleDefinition* particle = theParticleIterator->value();
79     G4ProcessManager* pmanager = particle->GetProcessManager();
80     if (fDecayProcess.IsApplicable(*particle)) { 
81       pmanager ->AddProcess(&fDecayProcess);
82       // set ordering for PostStepDoIt and AtRestDoIt
83       pmanager ->SetProcessOrdering(&fDecayProcess, idxPostStep);
84       pmanager ->SetProcessOrdering(&fDecayProcess, idxAtRest);
85     }
86   }
87   
88   // map to G3 controls
89   TG4ProcessControlMap* processMap = TG4ProcessControlMap::Instance();
90   processMap->Add(&fDecayProcess, kDCAY); 
91
92   if (VerboseLevel() > 0) {
93     G4cout << "### General physics constructed." << G4endl;
94   }  
95 }