Changeset 54
- Timestamp:
- Dec 6, 2005, 5:08:55 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
MEMPHYS/HEAD/applications/MEMPHYS_session.cxx
r10 r54 12 12 13 13 // Lib : 14 #include <Lib/Interfaces/ISession.h> 15 #include <Lib/Manager.h> 14 #include <Lib/Interfaces/IManager.h> 16 15 #include <Lib/System.h> 17 //#include <Lib/Debug.h>16 #include <Lib/Cast.h> 18 17 19 18 // G4Lab : 20 19 #include <G4Lab/UIOnX.h> 21 20 #include <G4Lab/TrackingAction.h> 21 #include <G4Lab/Helpers.h> 22 22 23 23 //MEMPHYS: … … 43 43 virtual void* cast(const std::string& aTo) const { 44 44 if(aTo=="MEMPHYSAnalysisManager") { 45 return (MEMPHYSAnalysisManager*)this;45 return Lib_SCast(MEMPHYSAnalysisManager); 46 46 } else if(aTo=="MEMPHYSIAnalysis") { 47 return (MEMPHYSIAnalysis*)this;47 return Lib_SCast(MEMPHYSIAnalysis); 48 48 } else if(aTo=="MEMPHYSAnalysis") { 49 return (MEMPHYSAnalysis*)this;49 return Lib_SCast(MEMPHYSAnalysis); 50 50 } else if(aTo=="IManager") { 51 return (IManager*)this;51 return Lib_SCast(IManager); 52 52 } else { 53 53 return 0; … … 77 77 // Need to pass the G4RunManager at UIOnX creation 78 78 std::string gui = "$MEMPHYSROOT/scripts/OnX/MEMPHYS_session.onx"; 79 G4Lab::UIOnX* session = new G4Lab::UIOnX( runManager,gui,aArgc,aArgv);79 G4Lab::UIOnX* session = new G4Lab::UIOnX(*runManager,gui,aArgc,aArgv); 80 80 81 81 MEMPHYSAnalysisManager* analysisManager = 0; 82 82 83 // Declare actions that needs some UI or analysis facilities : 84 ISession* onxSession = session->session(); 85 if(onxSession) { 86 // Get theg AIDA Lab implementation : 87 AIDA::IAnalysisFactory* aida = 88 Lib_findManager(*onxSession,"AnalysisFactory",AIDA::IAnalysisFactory); 89 if(!aida) { 90 std::cout << "MEMPHYS_session :" 91 << " AnalysisFactory not found." << std::endl; 92 } else { 93 analysisManager = new MEMPHYSAnalysisManager(*aida,false); 94 onxSession->addManager(analysisManager); 95 } 83 AIDA::IAnalysisFactory* aida = G4Lab::UIOnX_aida(*session); 84 if(!aida) { 85 std::cout << "MEMPHYS_session : AIDA not found." << std::endl; 86 } else { 87 analysisManager = new MEMPHYSAnalysisManager(*aida,false); 88 session->addManager(analysisManager); 96 89 } 97 90 … … 113 106 114 107 // Set user action classes 115 MEMPHYSPrimaryGeneratorAction* myGeneratorAction = new MEMPHYSPrimaryGeneratorAction(MEMPHYSdetector); 108 MEMPHYSPrimaryGeneratorAction* myGeneratorAction = 109 new MEMPHYSPrimaryGeneratorAction(MEMPHYSdetector); 116 110 runManager->SetUserAction(myGeneratorAction); 117 111
Note: See TracChangeset
for help on using the changeset viewer.