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 // Configuration macro for Geant4 VirtualMC
9 void Config()
10 {
34 
35  Bool_t mtMode = FairRunSim::Instance()->IsMT();
36  Bool_t specialStacking = false;
38  "geomRoot", "QGSP_BERT_EMV", "stepLimiter+specialCuts+specialControls", specialStacking, mtMode);
39  // TG4RunConfiguration* runConfiguration
40  // = new TG4RunConfiguration("geomRoot", "QGSP_BERT_EMV", "stepLimiter+specialCuts+specialControls",
41  // specialStacking, mtMode);
42 
44  TGeant4* geant4 = new TGeant4("TGeant4", "The Geant4 Monte Carlo", runConfiguration);
45  cout << "Geant4 has been created." << endl;
46 
48  FairStack* stack = new FairStack(1000);
49  stack->StoreSecondaries(kTRUE);
50  stack->SetMinPoints(0);
51  geant4->SetStack(stack);
52 
53  if (FairRunSim::Instance()->IsExtDecayer()) {
54  TVirtualMCDecayer* decayer = TVirtualMC::GetMC()->GetDecayer();
55  // TVirtualMCDecayer* decayer = TPythia6Decayer::Instance();
56  geant4->SetExternalDecayer(decayer);
57  }
58 
61 
62  TString configm(gSystem->Getenv("VMCWORKDIR"));
63  TString configm1 = configm + "/common/gconfig/g4config.in";
64  cout << " -I g4Config() using g4conf macro: " << configm1 << endl;
65 
66  // set geant4 specific stuff
67  geant4->SetMaxNStep(10000); // default is 30000
68  geant4->ProcessGeantMacro(configm1.Data());
69 }
Bool_t IsMT() const
Definition: FairRunSim.h:185
static FairRunSim * Instance()
Definition: FairRunSim.cxx:116
void SetMinPoints(Int_t min)
Definition: FairStack.h:183
void StoreSecondaries(Bool_t choice=kTRUE)
Definition: FairStack.h:182
void Config()
Configuration macro for Geant3 VirtualMC.
Definition: flConfig.C:10