// $Id: g4Config.C,v 1.5 2009-06-12 18:39:13 pam-rm2 Exp $
//
// Configuration macro for Geant4 VirtualMC for PamG4VMC
// for geometry defined with Root and selected Geant4 native navigation

void Config()
{
  
  gSystem->Load("libG4phys_builders");
  gSystem->Load("libG4phys_lists");

  TString PAM_VMC=gSystem->Getenv("PAM_VMC");
  TString PLAT=gSystem->Getenv("PLATFORM");

  gSystem->Load(PAM_VMC+"/lib/tgt_"+PLAT+"/libPamG4RunConfiguration");
  //std::cout<<PAM_VMC+"/lib/tgt_"+PLAT+"/libPamG4RunConfiguration"<<std::endl;
  PamG4RunConfiguration* runConfiguration 
    = new PamG4RunConfiguration("geomRoot","LHEP","specialCuts+specialControls+stepLimiter");

  TGeant4* geant4
    = new TGeant4("TGeant4_PAMELA", "The Geant4 PAMELA Monte Carlo", runConfiguration);
 
  std::cout<<"TGeant config created..."<<std::endl;
  geant4->ProcessGeantMacro(PAM_VMC+"/config/g4config_ceci.in");
  std::cout<<"TGeant macro g4config_ceci.in processed..."<<std::endl;
}
