FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
g4Config.C
Go to the documentation of this file.
1 /********************************************************************************
2  * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
3  * *
4  * This software is distributed under the terms of the *
5  * GNU Lesser General Public Licence (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
8 
9 // Configuration macro for Geant4 VirtualMC
10 void Config()
11 {
30 
39 
40  Bool_t mtMode = FairRunSim::Instance()->IsMT();
41  Bool_t specialStacking = false;
42  TG4RunConfiguration* runConfiguration = new TG4RunConfiguration(
43  "geomRoot", "QGSP_FTFP_BERT", "stepLimiter+specialCuts+specialControls+stackPopper", specialStacking, mtMode);
44 
46  TGeant4* geant4 = new TGeant4("TGeant4", "The Geant4 Monte Carlo", runConfiguration);
47  cout << "Geant4 has been created." << endl;
48 
50  MyProjStack* stack = new MyProjStack(1000);
51  stack->StoreSecondaries(kTRUE);
52  stack->SetMinPoints(0);
53  geant4->SetStack(stack);
54 
55  if (FairRunSim::Instance()->IsExtDecayer()) {
56  TVirtualMCDecayer* decayer = TPythia6Decayer::Instance();
57  geant4->SetExternalDecayer(decayer);
58  }
59 
62 
63  TString configm(gSystem->Getenv("VMCWORKDIR"));
64  TString configm1 = configm + "/gconfig/g4config.in";
65  cout << " -I g4Config() using g4conf macro: " << configm1 << endl;
66 
67  // set geant4 specific stuff
68  geant4->SetMaxNStep(10000); // default is 30000
69  geant4->ProcessGeantMacro(configm1.Data());
70 }
void SetMinPoints(Int_t min)
Definition: MyProjStack.h:181
Bool_t IsMT() const
Definition: FairRunSim.h:185
void StoreSecondaries(Bool_t choice=kTRUE)
Definition: MyProjStack.h:180
static FairRunSim * Instance()
Definition: FairRunSim.cxx:116
void Config()
Configuration macro for Geant3 VirtualMC.
Definition: flConfig.C:10