EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
g4Config.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file g4Config.C
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  //= new TG4RunConfiguration("geomRootToGeant4", "emStandard", "stepLimiter+specialCuts+specialControls");
31  //= new TG4RunConfiguration("geomRoot", "emStandard", "stepLimiter");
32  = new TG4RunConfiguration("geomRoot", "FTFP_BERT", "stepLimiter");
33  //= new TG4RunConfiguration("geomRoot", "emStandard", "stepLimiter+specialControls");
34  // In case want to activate SetCuts.C ...;
35  //= new TG4RunConfiguration("geomRoot", "emStandard", "stepLimiter+specialCuts");
36 
38  TGeant4* geant4 = new TGeant4("TGeant4", "The Geant4 Monte Carlo", runConfiguration);
39  cout << "Geant4 has been created." << endl;
40 
42  PndStack *stack = new PndStack(1000);
43  stack->StoreSecondaries(kTRUE);
44  stack->SetMinPoints(1);
45  geant4->SetStack(stack);
46 
47 #if _RETURN_BACK_
48  if(FairRunSim::Instance()->IsExtDecayer()){
49  TVirtualMCDecayer* decayer = TPythia6Decayer::Instance();
50  geant4->SetExternalDecayer(decayer);
51  }
52 #endif
53 
56 
57  TString configm(gSystem->Getenv("VMCWORKDIR"));
58  TString configm1 = configm + "/gconfig/g4config.in";
59  cout << " -I g4Config() using g4conf macro: " << configm1 << endl;
60 
61  //set geant4 specific stuff
62  geant4->SetMaxNStep(10000); // default is 30000
63 
64  Text_t buffer[50];
65  sprintf(buffer,"/random/setSeeds %i %i ",gRandom->GetSeed(), gRandom->GetSeed());
66  geant4->ProcessGeantCommand(buffer);
67 
68  geant4->ProcessGeantMacro(configm1.Data());
69 
70 
71 }