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;
37  TG4RunConfiguration* runConfiguration = new TG4RunConfiguration(
38  "geomRoot", "QGSP_BERT_EMV", "stepLimiter+specialCuts+specialControls", specialStacking, mtMode);
39 
41  TGeant4* geant4 = new TGeant4("TGeant4", "The Geant4 Monte Carlo", runConfiguration);
42  cout << "Geant4 has been created." << endl;
43 
45  FairStack* stack = new FairStack(1000);
46  stack->StoreSecondaries(kTRUE);
47  stack->SetMinPoints(0);
48  geant4->SetStack(stack);
49 
50  if (FairRunSim::Instance()->IsExtDecayer()) {
51  TVirtualMCDecayer* decayer = TPythia6Decayer::Instance();
52  geant4->SetExternalDecayer(decayer);
53  }
54 
57 
58  TString configm(gSystem->Getenv("CONFIG_DIR"));
59  TString configm1 = configm + "/g4config.in";
60  cout << " -I g4Config() using g4conf macro: " << configm1 << endl;
61 
62  // set geant4 specific stuff
63  geant4->SetMaxNStep(10000); // default is 30000
64  geant4->ProcessGeantMacro(configm1.Data());
65 }
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