g3Config.C 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // $Id: g3Config.C,v 1.1.1.1 2005/06/23 07:14:09 dbertini Exp $
  2. //
  3. // Configuration macro for Geant3 VirtualMC
  4. void Config()
  5. {
  6. FairRunSim *fRun = FairRunSim::Instance();
  7. TString* gModel = fRun->GetGeoModel();
  8. TGeant3* geant3 = NULL;
  9. if ( strncmp(gModel->Data(),"TGeo",4) == 0 ) {
  10. geant3
  11. = new TGeant3TGeo("C++ Interface to Geant3");
  12. cout << "-I- G3Config: Geant3 with TGeo has been created."
  13. << endl;
  14. }else{
  15. geant3
  16. = new TGeant3("C++ Interface to Geant3");
  17. cout << "-I- G3Config: Geant3 native has been created."
  18. << endl;
  19. }
  20. // create Fair Specific Stack
  21. MpdStack *st = new MpdStack();
  22. // Set minimum number of points to store the track
  23. // The default value is one, which means each track
  24. // needs at least 1 point in any detector
  25. st->SetMinPoints(1);
  26. geant3->SetStack( st ) ;
  27. // ******* GEANT3 specific configuration for simulated Runs *******
  28. geant3->SetTRIG(1); //Number of events to be processed
  29. geant3->SetSWIT(4, 100);
  30. geant3->SetDEBU(0, 0, 1);
  31. geant3->SetRAYL(1);
  32. geant3->SetSTRA(0); //1);
  33. geant3->SetAUTO(0); //Select automatic STMIN etc... calc. (AUTO 1) or manual (AUTO 0)
  34. geant3->SetABAN(0); //Restore 3.16 behaviour for abandoned tracks
  35. geant3->SetOPTI(2); //Select optimisation level for GEANT geometry searches (0,1,2)
  36. geant3->SetERAN(5.e-7);
  37. geant3->SetCKOV(1); // cerenkov photons
  38. // set common stuff
  39. TString configm(gSystem->Getenv("VMCWORKDIR"));
  40. TString cuts = configm + "/gconfig/SetCuts.C";
  41. cout << "Physics cuts with script \n "<< cuts.Data() << endl;
  42. Int_t cut=gROOT->LoadMacro(cuts.Data());
  43. if(cut==0)gInterpreter->ProcessLine("SetCuts()");
  44. }