// Configuration macro for Geant4 VirtualMC 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. TG4RunConfiguration* runConfiguration = new TG4RunConfiguration("geomRoot", "QGSP_BERT_EMV+optical","stepLimiter+specialCuts+specialControls"); /// Create the G4 VMC TGeant4* geant4 = new TGeant4("TGeant4", "The Geant4 Monte Carlo", runConfiguration); cout << "Geant4 has been created." << endl; geant4->ProcessGeantCommand("/mcVerbose/all 0"); geant4->ProcessGeantCommand("/mcVerbose/eventAction 1"); // geant4->ProcessGeantCommand("/optics_engine/selectOpProcess Cerenkov"); // geant4->ProcessGeantCommand("/optics_engine/setTrackSecondariesFirst false"); // geant4->ProcessGeantCommand("/optics_engine/setCerenkovMaxPhotons 5"); // geant4->ProcessGeantCommand("/optics_engine/setCerenkovMaxBetaChange 0.1"); /// create the Specific stack PndStack *stack = new PndStack(1000); //stack->StoreSecondaries(kFALSE); //default is kTRUE stack->SetMinPoints(2); geant4->SetStack(stack); if(FairRunSim::Instance()->IsExtDecayer()){ TVirtualMCDecayer* decayer = TPythia6Decayer::Instance(); geant4->SetExternalDecayer(decayer); } geant4->SetMaxNStep(10000); // default is 30000 Text_t buffer[50]; sprintf(buffer,"/random/setSeeds %i %i ",gRandom->GetSeed(), gRandom->GetSeed()); geant4->ProcessGeantCommand(buffer); }