FairRoot/PandaRoot
Functions
gconfig/g4Config.C File Reference

Go to the source code of this file.

Functions

void Config ()
 

Function Documentation

void Config ( )

Create the run configuration In constructor user has to specify the geometry input and select geometry navigation via the following options:

  • geomVMCtoGeant4 - geometry defined via VMC, G4 native navigation
  • geomVMCtoRoot - geometry defined via VMC, Root navigation
  • geomRoot - geometry defined via Root, Root navigation
  • geomRootToGeant4 - geometry defined via Root, G4 native navigation
  • geomGeant4 - geometry defined via Geant4, G4 native navigation

The second argument in the constructor selects physics list:

  • emStandard - standard em physics (default)
  • emStandard+optical - standard em physics + optical physics
  • XYZ - selected hadron physics list ( XYZ = LHEP, QGSP, ...)
  • XYZ+optical - selected hadron physics list + optical physics

The third argument activates the special processes in the TG4SpecialPhysicsList, which implement VMC features:

  • stepLimiter - step limiter (default)
  • specialCuts - VMC cuts
  • specialControls - VMC controls for activation/inactivation selected processes
  • stackPopper - stackPopper process When more than one options are selected, they should be separated with '+' character: eg. stepLimit+specialCuts.

Create the G4 VMC

create the Specific stack

Customise Geant4 setting (verbose level, global range cut, ..)

Definition at line 2 of file gconfig/g4Config.C.

References PndStack::SetMinPoints(), PndStack::StoreSecondaries(), and TString.

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(kTRUE);
38  stack->SetMinPoints(1);
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("VMCWORKDIR"));
50  configm = configm + "/gconfig/g4config.in";
51  cout << " -I g4Config() using g4conf macro: " << configm << endl;
52 
53  //set geant4 specific stuff
54  geant4->SetMaxNStep(10000); // default is 30000
55 
56  Text_t buffer[50];
57  sprintf(buffer,"/random/setSeeds %i %i ",gRandom->GetSeed(), gRandom->GetSeed());
58  geant4->ProcessGeantCommand(buffer);
59 
60  geant4->ProcessGeantMacro(configm.Data());
61 
62 
63 }
void SetMinPoints(Int_t min)
Definition: PndStack.h:171
void StoreSecondaries(Bool_t choice=kTRUE)
Definition: PndStack.h:170