4 // Author: I. Hrivnacova
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
12 #include "TG4PhysicsConstructorGeneral.h"
13 #include "TG4ProcessControlMap.h"
14 #include "TG4ProcessMCMap.h"
15 #include "TG4G3Control.h"
16 #include "TG4ExtDecayer.h"
17 #include "AliDecayer.h"
20 #include <G4ParticleDefinition.hh>
21 #include <G4ProcessManager.hh>
22 #include <G4ChargedGeantino.hh>
23 #include <G4Geantino.hh>
25 //_____________________________________________________________________________
26 TG4PhysicsConstructorGeneral::TG4PhysicsConstructorGeneral(const G4String& name)
27 : G4VPhysicsConstructor(name)
33 //_____________________________________________________________________________
34 TG4PhysicsConstructorGeneral::~TG4PhysicsConstructorGeneral() {
40 //_____________________________________________________________________________
41 void TG4PhysicsConstructorGeneral::ConstructParticle()
43 // Instantiates particles.
47 G4Geantino::GeantinoDefinition();
48 G4ChargedGeantino::ChargedGeantinoDefinition();
51 //_____________________________________________________________________________
52 void TG4PhysicsConstructorGeneral::ConstructProcess()
54 // Constructs electromagnetic processes for e+.
57 // Set external decayer
58 AliDecayer* aliDecayer = gMC->Decayer();
60 TG4ExtDecayer* tg4Decayer = new TG4ExtDecayer(aliDecayer);
61 // the tg4Decayer is deleted in G4Decay destructor
62 tg4Decayer->SetVerboseLevel(1);
63 fDecayProcess.SetExtDecayer(tg4Decayer);
65 if (verboseLevel>0) G4cout << "### External decayer is set" << G4endl;
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);
81 TG4ProcessControlMap* processMap = TG4ProcessControlMap::Instance();
82 processMap->Add(&fDecayProcess, kDCAY);
85 G4cout << "### General physics constructed." << G4endl;