Changeset 1337 for trunk/examples/extended/eventgenerator/exgps
- Timestamp:
- Sep 30, 2010, 2:47:17 PM (14 years ago)
- Location:
- trunk/examples/extended/eventgenerator/exgps
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/extended/eventgenerator/exgps/GNUmakefile
r1230 r1337 1 # $Id: GNUmakefile,v 1. 5 2008/12/02 21:42:48 fleiExp $1 # $Id: GNUmakefile,v 1.6 2010/01/11 16:33:59 gcosmo Exp $ 2 2 # -------------------------------------------------------------- 3 3 # GNUmakefile for tests module. Gabriele Cosmo, 27/06/98. … … 9 9 10 10 ifndef G4INSTALL 11 G4INSTALL = ../../.. 11 G4INSTALL = ../../../.. 12 12 endif 13 13 … … 16 16 17 17 include $(G4INSTALL)/config/binmake.gmk 18 19 #G4VIS_BUILD_OPENGLX_DRIVER = 020 #G4VIS_USE_OPENGLX = 021 #LDFLAGS += -static22 -
trunk/examples/extended/eventgenerator/exgps/History
r807 r1337 12 12 * Reverse chronological order (last date on top), please * 13 13 ---------------------------------------------------------- 14 15 03/06/2010 - J.Perl (exgps-V09-03-01) 16 - Updated vis usage 17 18 12/05/2010 J.Allison (exgps-V09-03-00) 19 - Introduced GUIExecutive. 20 21 08/12/2008 G.Barrand 22 - correct / compleete the part concerning AIDA in the README file. 23 24 06/12/2008 F.Lei (exgps-V09-01-02) 25 - updated g4mac files in ./macros 26 27 05/12/2008 G.Barrand 28 - exGPSAnalysisManager : have a comment in case the 29 AIDA_createAnalysisFactory or the AIDA::ITree creation 30 fails ; which is something that may happen. 31 - exGPSAnalysisManager : have the creation of the AIDA::IPlotter 32 on the same footing than other AIDA objects. Remove then 33 the createPlotter method. 34 - exGPSAnalysisManager : have t,hFactories local in BeginOfRun 35 and then rm getHistogram,getTupleFactories. 36 37 04/12/2008 F.Lei (exgps-V09-01-01) 38 - updated README 39 - tag Guy's changes 40 41 04/12/2008 G.Barrand 42 - exGPSAnalysisManager.hh : have the destructor private. 43 - exGPS.cc : then use the exGPSAnalysisManager::dispose() method. 44 - exGPS.cc : rm the aMgr which is no more used. 45 - exGPSAnalysisManager::createPlotter : rm the "Plotter" string 46 and then ask to the AIDA implementation the default plotter. 47 - exGPSAnalysisManager::EndOfRun : reset the variable after the deletions. 48 - exGPS.cc and exGPSEventAction : use #ifdef G4VIS_USE in case 49 somone want to build without the G4 vis system. 50 - exGPSAnalysisManager.cc : revisit : createPlotter : delete 51 of plotterFactory and plotter where lacking. (Seen with the 52 OpenScientist object decount). 53 - exGPSRunAction : #ifdef G4VIS_USE. 54 55 02/12/2008 F.Lei (exgps-V09-01-00) 56 - updated exGPSAnalysisManager class to improve the AIDA output 57 - removed AIDA setup from GNUmakefile (use G4 default one) 58 - removed the ROOT file option 59 60 21/12/2006 F.Lei (exgps-V08-02-00) 61 - Added the option for output results in .root file 62 - Changed particle_name to PDGcode in the ntuple 63 14 64 19/07/2005 F.Lei (exgps-V07-01-00) 15 65 - Changing in GNUmakefile -
trunk/examples/extended/eventgenerator/exgps/README
r807 r1337 35 35 36 36 Visualisation of the geometry and the tracks is possible with many of the G4 visualisation packages. An 37 example of displaying the geometry and tracks using VRML is given in the macro file display_vrml.mac.37 example of displaying the geometry and tracks using VRML is given in the macro file vis.mac. 38 38 39 39 6. ANALYSIS: 40 40 41 41 This example implements an AIDA-compliant analysis manager which creates histograms and ntuples. 42 If user has an AIDA-compliant tool such as AIDAJNI, ANAPHE, or PI installed on his/her system, 43 the analysis part of this example can be activated by: 42 If user has an AIDA-compliant tool such as AIDAJNI, ANAPHE, OpenScientist or PI installed on his/her system. Some URLs : 43 http://aida.freehep.org/ 44 http://java.freehep.org/aidajni 45 http://www.cern.ch/PI 46 http://OpenScientist.lal.in2p3.fr 47 48 The analysis part of this example can be activated by doing a "source 49 aida-setup" of the AIDA compliant tool (to activate the aida-config 50 program) and by raising some environment variabless so that the 51 G4 GNUmakefile system can take into account the AIDA tool. 52 This can be done, for example on a UNIX under a csh like shell, with : 53 csh> source <path_where_the_AIDA_tool_is_installed>/aida-setup.csh 54 csh> aida-config # to check that this program is up and running 55 G4 related part : 56 csh> setenv G4ANALYSIS_USE 1 57 csh> setenv G4ANALYSIS_AIDA_CONFIG_CFLAGS `aida-config --include` 58 csh> setenv G4ANALYSIS_AIDA_CONFIG_LIBS `aida-config --lib` 44 59 45 setenv G4ANALYSIS_USE 1 60 (It may be usefull to note that in the G4 GNUmakefile system, 61 the upper variables are used in the file config/analysis.gmk). 46 62 47 63 This needs to be done before building the executable. 48 64 49 65 At the end of an excution, an xml file "exgps.aida" is created by default which contains 50 histograms and ntuples. User can change the name and typeof this output file with the commands66 histograms and ntuples. User can change the name and format of this output file with the commands 51 67 52 68 /analysis/filetype new-type … … 55 71 e.g. 56 72 57 /analysis/filetype hbook58 /analysis/filename exgps.hbook73 /analysis/filetype root 74 /analysis/filename myfile.root 59 75 60 these change the output file type to "hbook" and name to "exgps.hbbok" 76 these change the output file format to ROOT and output file name to "myfile.root". There are three file 77 formats to choose from: xml, root or hbook. 61 78 62 79 The output file conatins 6 histograms and one ntuple: … … 74 91 In the ntuple the following data are recorded for each incident particle: 75 92 76 Particle Name93 Particle ID 77 94 Incident Position (x,y,z); 78 95 Incident Angle (theta,phi); 79 96 Particle weight; 80 81 97 82 98 7. GETTING STARTED: … … 86 102 87 103 setenv G4ANALYSIS_USE 1 104 105 otherwise do 106 107 unsetenv G4ANALYSIS_USE 88 108 89 otherwise make sure the G4ANALYSIS_USE is not defined: 90 91 unsetenv G4ANALYSIS_USE 109 to remove the generation of an output file. 92 110 93 111 ii) Build the exGPS executable: … … 106 124 $G4BIN/$G4SYSTEM/exGPS exrgps.in 107 125 108 If G4ANALYSIS_USE is defined, one should see a display of the six histograms. If JAIDA is used, one has 109 to close the plotter window in order to terminate the execution. After the termination one will find 110 the "exgps.aida", as well as a vrml file "g4_00.wrl" in the directory. 126 If G4ANALYSIS_USE is defined, and dpends on the particular AIDA system used, e.g. JAIDA, one could see 127 a display window of the six histograms. It may be neccessary to close the plotter window in order to 128 terminate the execution. After the termination one will find the "exgps.aida", as well as a vrml file 129 "g4_00.wrl" in the directory. 111 130 112 131 8. FURTHER EXAMPLES of MACRO FILES: … … 119 138 120 139 121 122 140 123 124 -
trunk/examples/extended/eventgenerator/exgps/exGPS.cc
r1230 r1337 26 26 #include "G4RunManager.hh" 27 27 #include "G4UImanager.hh" 28 #include "G4UIterminal.hh"29 #include "G4UItcsh.hh"30 28 31 29 #ifdef G4UI_USE_XM … … 39 37 #ifdef G4VIS_USE 40 38 #include "G4VisExecutive.hh" 39 #endif 40 41 #ifdef G4UI_USE 42 #include "G4UIExecutive.hh" 41 43 #endif 42 44 … … 72 74 runManager->SetUserAction(eventAction); 73 75 74 G4UIsession* session=0; 75 76 if (argc==1) // Define UI session for interactive mode. 77 { 78 // G4UIterminal is a (dumb) terminal. 79 #ifdef G4UI_USE_XM 80 session = new G4UIXm(argc,argv); 81 #else 82 #ifdef G4UI_USE_TCSH 83 session = new G4UIterminal(new G4UItcsh); 84 #else 85 session = new G4UIterminal(); 86 #endif 87 #endif 88 } 89 76 //Initialize G4 kernel 77 runManager->Initialize(); 78 90 79 // visualization manager 91 80 #ifdef G4VIS_USE … … 94 83 #endif 95 84 96 //Initialize G4 kernel97 runManager->Initialize();98 99 85 // get the pointer to the User Interface manager 100 G4UImanager* UI = G4UImanager::GetUIpointer();86 G4UImanager* UImanager = G4UImanager::GetUIpointer(); 101 87 // UI->ApplyCommand("/control/execute display.mac"); 102 88 103 if ( session) // Define UI session for interactive mode.89 if (argc!=1) // batch mode 104 90 { 105 // G4UIterminal is a (dumb) terminal.106 session->SessionStart();107 delete session;108 }109 else // Batch mode110 {111 91 G4String command = "/control/execute "; 112 92 G4String fileName = argv[1]; 113 UI ->ApplyCommand(command+fileName);93 UImanager->ApplyCommand(command+fileName); 114 94 } 115 95 else 96 { // interactive mode : define UI session 97 #ifdef G4UI_USE 98 G4UIExecutive* ui = new G4UIExecutive(argc, argv); 99 ui->SessionStart(); 100 delete ui; 101 #endif 102 } 103 116 104 // job termination 117 105 -
trunk/examples/extended/eventgenerator/exgps/exgps.in
r807 r1337 26 26 # commands below are independent of gps 27 27 # 28 #/analysis/filename focus.aida 28 #/analysis/filename exgps.root 29 #/analysis/filetype root 29 30 /analysis/maxeng 800 MeV 30 31 /analysis/mineng 200 MeV … … 34 35 #/tracking/verbose 1 35 36 # 36 /control/execute display_vrml.mac37 /control/execute macros/display.mac 37 38 # 38 /run/beamOn 20 39 /run/beamOn 2000 39 40 -
trunk/examples/extended/eventgenerator/exgps/include/exGPSEventActionMessenger.hh
r1230 r1337 32 32 // 33 33 // $Id: exGPSEventActionMessenger.hh,v 1.4 2006/06/29 17:14:26 gunter Exp $ 34 // GEANT4 tag $Name: geant4-09-0 3-cand-01 $34 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 35 35 // 36 36 // -
trunk/examples/extended/eventgenerator/exgps/macros/display.mac
r1230 r1337 1 # Use this open statement to create an OpenGL view: 2 #/vis/open OGL 600x600-0+0 1 3 # 2 /vis/scene/create 3 /vis/sceneHandler/create VRML2FILE 4 /vis/viewer/create 4 # Use this open statement to create a .prim file suitable for 5 # viewing in DAWN: 6 #/vis/open DAWNFILE 7 # 8 # Use this open statement to create a .heprep file suitable for 9 # viewing in HepRApp: 10 #/vis/open HepRepFile 11 # 12 # Use this open statement to create a .wrl file suitable for 13 # viewing in a VRML viewer: 14 /vis/open VRML2FILE 15 # 16 # Disable auto refresh and quieten vis messages whilst scene and 17 # trajectories are established: 18 /vis/viewer/set/autoRefresh false 19 /vis/verbose errors 20 # 21 # Draw geometry: 5 22 /vis/drawVolume 6 #/vis/viewer/viewpointThetaPhi 30 307 #/vis/viewer/update8 /vis/scene/endOfEventAction accumulate9 /tracking/storeTrajectory 110 11 23 # 12 24 # Specify view angle: 25 #/vis/viewer/set/viewpointThetaPhi 90. 0. 26 # 27 # Specify zoom value: 28 #/vis/viewer/zoom 2. 29 # 30 # Specify style (surface or wireframe): 31 #/vis/viewer/set/style wireframe 32 # 33 # Draw coordinate axes: 34 #/vis/scene/add/axes 0 0 0 1 m 35 # 36 # Draw smooth trajectories at end of event, showing trajectory points 37 # as markers 2 pixels wide: 38 /vis/scene/add/trajectories smooth 39 /vis/modeling/trajectories/create/drawByCharge 40 /vis/modeling/trajectories/drawByCharge-0/default/setDrawStepPts true 41 /vis/modeling/trajectories/drawByCharge-0/default/setStepPtsSize 2 42 # (if too many tracks cause core dump => /tracking/storeTrajectory 0) 43 # 44 # Draw hits at end of event: 45 #/vis/scene/add/hits 46 # 47 # To draw only gammas: 48 #/vis/filtering/trajectories/create/particleFilter 49 #/vis/filtering/trajectories/particleFilter-0/add gamma 50 # 51 # To invert the above, drawing all particles except gammas, 52 # keep the above two lines but also add: 53 #/vis/filtering/trajectories/particleFilter-0/invert true 54 # 55 # Many other options are available with /vis/modeling and /vis/filtering. 56 # For example, to select colour by particle ID: 57 #/vis/modeling/trajectories/create/drawByParticleID 58 #/vis/modeling/trajectories/drawByParticleID-0/set e- blue 59 # 60 # To superimpose all of the events from a given run: 61 #/vis/scene/endOfEventAction accumulate 62 # 63 # Re-establish auto refreshing and verbosity: 64 /vis/viewer/set/autoRefresh true 65 /vis/verbose warnings 66 # 67 # For file-based drivers, use this to create an empty detector view: 68 #/vis/viewer/flush -
trunk/examples/extended/eventgenerator/exgps/macros/test1.g4mac
r807 r1337 1 # test1 1 2 /gps/particle proton 2 3 /gps/pos/type Point … … 15 16 /analysis/maxpos 5 cm 16 17 /analysis/minpos -5 cm 17 /event/printModulo 1000 018 /event/printModulo 1000 18 19 #/control/execute display.mac 19 20 /run/beamOn 10000 20 21 -
trunk/examples/extended/eventgenerator/exgps/macros/test33.g4mac
r807 r1337 34 34 #/tracking/verbose 1 35 35 # 36 /control/execute display _vrml.mac36 /control/execute display.mac 37 37 # 38 38 /run/beamOn 20 -
trunk/examples/extended/eventgenerator/exgps/macros/test34.g4mac
r807 r1337 18 18 /gps/ang/type cos 19 19 # 20 # the proton energy is in gaussian profile centered at 4MeV20 # the proton energy is in gaussian profile centered at 2.5 MeV 21 21 /gps/ene/type Gauss 22 /gps/ene/mono 4MeV22 /gps/ene/mono 2.5 MeV 23 23 /gps/ene/sigma 0.5 MeV 24 24 # … … 49 49 # commands below are independent of gps 50 50 # 51 #/analysis/filetype root 51 52 /analysis/filename test34.aida 52 53 /analysis/maxeng 5 MeV … … 54 55 /analysis/maxpos 10 cm 55 56 /analysis/minpos -10 cm 56 #/event/printModulo 1000057 /event/printModulo 10000 57 58 # 58 /control/execute display_vrml.mac59 #/control/execute display.mac 59 60 # 60 61 #/tracking/verbose 1 61 /run/beamOn 10062 /run/beamOn 2000 62 63 -
trunk/examples/extended/eventgenerator/exgps/src/exGPSEventAction.cc
r1230 r1337 35 35 #include "G4Event.hh" 36 36 #include "G4EventManager.hh" 37 #include "G4TrajectoryContainer.hh"38 #include "G4Trajectory.hh"39 #include "G4VVisManager.hh"40 37 #include "G4ios.hh" 41 38 #include "G4UnitsTable.hh" … … 107 104 #endif 108 105 109 #ifdef G4VIS_USE110 // extract the trajectories and draw them111 if (G4VVisManager::GetConcreteInstance())112 {113 G4TrajectoryContainer * trajectoryContainer = evt->GetTrajectoryContainer();114 G4int n_trajectories = 0;115 if (trajectoryContainer) n_trajectories = trajectoryContainer->entries();116 117 for (G4int i=0; i<n_trajectories; i++)118 { G4Trajectory* trj = (G4Trajectory*)((*(evt->GetTrajectoryContainer()))[i]);119 if (drawFlag == "all") trj->DrawTrajectory(0);120 else if ((drawFlag == "charged")&&(trj->GetCharge() != 0.))121 trj->DrawTrajectory(0);122 else if ((drawFlag == "neutral")&&(trj->GetCharge() == 0.))123 trj->DrawTrajectory(0);124 }125 }126 #endif127 106 } 128 107 -
trunk/examples/extended/eventgenerator/exgps/src/exGPSEventActionMessenger.cc
r1230 r1337 32 32 // 33 33 // $Id: exGPSEventActionMessenger.cc,v 1.3 2006/06/29 17:14:43 gunter Exp $ 34 // GEANT4 tag $Name: geant4-09-0 3-cand-01 $34 // GEANT4 tag $Name: geant4-09-04-beta-01 $ 35 35 // 36 36 //
Note: See TracChangeset
for help on using the changeset viewer.