FairRoot/PandaRoot
detectors/hypGe/hypGeTools/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  = new TG4RunConfiguration("geomRoot", /*"QGSP_BIC_HP"*/"QGSP_BERT_HP", "stepLimiter+specialCuts+specialControls"); // Marcell edt changed on 08.07.13 for COSY simulation
31 
33  TGeant4* geant4 = new TGeant4("TGeant4", "The Geant4 Monte Carlo", runConfiguration);
34  cout << "Geant4 has been created." << endl;
35 
37  PndStack *stack = new PndStack(1000);
38  stack->StoreSecondaries(kTRUE);
39  //stack->SetMinPoints(1); // secondaries need hit in active volume
40  stack->SetMinPoints(0); // no hit needed for secondaries in active volume
41  geant4->SetStack(stack);
42 
43  if(FairRunSim::Instance()->IsExtDecayer()){
44  TVirtualMCDecayer* decayer = TPythia6Decayer::Instance();
45  geant4->SetExternalDecayer(decayer);
46  }
47 
50 
51  TString configm(gSystem->Getenv("VMCWORKDIR"));
52  configm1 = configm + "/gconfig/g4config.in";
53  cout << " -I g4Config() using g4conf macro: " << configm1 << endl;
54 
55  //set geant4 specific stuff
56  geant4->SetMaxNStep(10000); // default is 30000
57 
58  Text_t buffer[50];
59  sprintf(buffer,"/random/setSeeds %i %i ",gRandom->GetSeed(), gRandom->GetSeed());
60  geant4->ProcessGeantCommand(buffer);
61 
62  geant4->ProcessGeantMacro(configm1.Data());
63 
64 
65 }
void SetMinPoints(Int_t min)
Definition: PndStack.h:171
void StoreSecondaries(Bool_t choice=kTRUE)
Definition: PndStack.h:170