FairRoot/PandaRoot
outdated/mpiTools/macros/gconfig/g4Config.C
Go to the documentation of this file.
1 // Configuration macro for Geant4 VirtualMC
2 void Config()
3 {
27 
28  TG4RunConfiguration* runConfiguration
29  = new TG4RunConfiguration("geomRoot", "QGSP_BERT_EMV", "stepLimiter+specialCuts+specialControls");
30 
32  TGeant4* geant4 = new TGeant4("TGeant4", "The Geant4 Monte Carlo", runConfiguration);
33  cout << "Geant4 has been created." << endl;
34 
36  PndStack *stack = new PndStack(1000);
37  stack->StoreSecondaries(kFALSE);
38  stack->SetMinPoints(0);
39  geant4->SetStack(stack);
40 
41  if(FairRunSim::Instance()->IsExtDecayer()){
42  TVirtualMCDecayer* decayer = TPythia6Decayer::Instance();
43  geant4->SetExternalDecayer(decayer);
44  }
45 
48 
49  TString configm(gSystem->Getenv("CONFIG_DIR"));
50  configm1 = configm + "/g4config.in";
51  cout << " -I g4Config() using g4conf macro: " << configm1 << endl;
52 
53  // set the common cuts
54  TString cuts = configm + "/SetCuts.C";
55  cout << "Physics cuts with script \n "<< cuts.Data() << endl;
56  Int_t cut=gROOT->LoadMacro(cuts.Data());
57  if(cut==0)gInterpreter->ProcessLine("SetCuts()");
58 
59  //set geant4 specific stuff
60  geant4->SetMaxNStep(10000); // default is 30000
61  geant4->ProcessGeantMacro(configm1.Data());
62 
63 }
TString cuts[MAX]
Definition: autocutx.C:35
void SetMinPoints(Int_t min)
Definition: PndStack.h:171
double cut[MAX]
Definition: autocutx.C:36
void StoreSecondaries(Bool_t choice=kTRUE)
Definition: PndStack.h:170