FairRoot/PandaRoot
g4Config_opt.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+optical", "stepLimiter+specialCuts+specialControls");
30 
32  TGeant4* geant4 = new TGeant4("TGeant4", "The Geant4 Monte Carlo", runConfiguration);
33  cout << "Geant4 has been created." << endl;
34 
35  geant4->ProcessGeantCommand("/optics_engine/selectOpProcess Cerenkov");
36  geant4->ProcessGeantCommand("/optics_engine/setTrackSecondariesFirst false");
37 
39  PndStack *stack = new PndStack(1000);
40  stack->StoreSecondaries(kTRUE);
41  stack->SetMinPoints(2);
42  geant4->SetStack(stack);
43 
44  if(FairRunSim::Instance()->IsExtDecayer()){
45  TVirtualMCDecayer* decayer = TPythia6Decayer::Instance();
46  geant4->SetExternalDecayer(decayer);
47  }
48 
51 
52  TString configm(gSystem->Getenv("VMCWORKDIR"));
53  configm = configm + "/gconfig/g4config.in";
54  cout << " -I g4Config() using g4conf macro: " << configm << endl;
55 
56  //set geant4 specific stuff
57  geant4->SetMaxNStep(10000); // default is 30000
58 
59  Text_t buffer[50];
60  sprintf(buffer,"/random/setSeeds %i %i ",gRandom->GetSeed(), gRandom->GetSeed());
61  geant4->ProcessGeantCommand(buffer);
62 
63  geant4->ProcessGeantMacro(configm.Data());
64 
65 
66 }
void SetMinPoints(Int_t min)
Definition: PndStack.h:171
void StoreSecondaries(Bool_t choice=kTRUE)
Definition: PndStack.h:170