10:00 – 10:30
Go4 V4 Overview (presentation)
Runtime environment and event loop
Introduction to GUI
Working with Go4 GUI (practice)
Viewpanel and graphic options
Analysis client/server control
Conditions and markers
Remote object monitoring
Analysis in batch mode (practice)
The go4analysis executable
Go4 Analysis code (practice)
How to edit and compile the user analysis
Analysis, Processor and Event classes
How to define new histograms/conditions/...
Unpacking of Mbs events
Structuring the analysis code
Go4 Advanced Features (presentation)
Go4 Event Store with ROOT Trees
Go4 Advanced Features (practice)
How to add an analysis step
Multistep analysis setup
How to work with Parameters
How to use macros
How to implement user defined event sources
Discussion and Questions
Special topics on request
[shell] . go4login head
On normal GSI linux account create directory
like “/u/user/go4workshop/ “
[shell] mkdir go4workshop;
[shell] cd go4workshop
On guest account, create directory with your
name inside like
[shell] cd ~/Go4workshop2011
[shell] mkdir MyName
[shell] cd MyName
[shell] cp –r $GO4SYS/Go4Example2Step .
[shell] cd Go4Example2Step
[shell] make clean
Select “Analysis -> Launch analysis” menu. In dialog window specify:
Dir: <directory with analysis> (can be selected via file browser)
Lib: analysis library name (field can be left empty)
Starting mode: exec
Shell mode: Qt window
Press “Start analysis client” button (green tick) to start analysis process.
In “Analysis configuration” dialog change following fields:
Event source: MBS Random
Press “Submit+Start” button to run analysis.
When analysis running, generate hotstart file by selecting menu “Settings->Generate hotstart”. Specify filename for hotstart file (like mygo4) and press “Save” button.
Next time one could start complete analysis from the shell with only command:
[shell] go4 mygo4.hotstart
MBS Random: build in go4 random event generator
MBS Files: /s/go4/Workshop11/*.lmd
MBS Stream Server: depcp002
[shell] go4analysis -h
[shell] go4analysis -random
[shell] go4analysis –stream depcp002
[shell] go4analysis –file “/s/go4/Workshop11/*.lmd”
[shell] go4analysis –file /s/go4/Workshop11/gaussfiles.lml
Hint: running analysis can be always normally stopped by Ctrl-C pressing.
All histograms, filled by analysis, saved in autosave file. If one enable it, histograms can be inspected later with go4 gui:
[shell] rm –f asf.root
[shell] go4analysis –random –asf asf.root –number 10000
[shell] go4 asf.root
Same can be done with any other event sources.
One very often use batch mode to convert original data into ROOT tree format, which can be analyzed directly with ROOT macros. To enable store:
[shell] go4analysis –stream depcp002 –number 10000 –store output.root
Created ROOT tree can be browsed with standard ROOT browser:
[shell] root –l output.root
[root] new TBrowser
<select tree in browser, double click on leaf to fill histogram>
By default all arguments applied for the first analysis step. To specify arguments for other step, this step should be explicitly selected. Lets try to enable output of second step:
[shell] go4analysis –stream depcp002 –number 10000 –step Analysis –store output2.root
And to produce output for both events simultaneously:
[shell] go4analysis –stream depcp002 –number 10000 –step Unpack –store output1.root –step Analysis –store output2.root
Sometimes it is useful to see original MBS data as is. For that just:
[shell] go4analysis –stream depcp002 –print hex
For printout of MBS events no user analysis is required. More info about printout command one can get with:
[shell] go4analysis –help print
Analysis can be started as server from batch and than monitored/steered from the GUI.
[shell] go4analysis –random -server
On debug output one should see message:
Waiting for client connection on PORT: 5000
Here is important port number 5000 (can be 5001, 5002 and so on). This port number should be specified when connecting to analysis from the GUI:
[shell] . go4login head
[shell] go4 –observer localhost 5000
Connection arguments can be specified also via gui menu command “Analysis -> Connect to running server”. With same command one could connect to any running analysis of your colleague - just type host name of remote computer instead of localhost.
GUI can also be connected with administration privileges, which allows reconfiguring and shutdown of analysis:
[shell] go4 –admin localhost 5000
$GO4SYS/build/rename.sh XXX MyName
Start editor: kate TMyNameAnalysis.cxx
Commment definition of second step
What has changed?:
Use “MakeTH1” statement in constructor on new pointer
Fill new histogram in BuildEvent
What has changed?:
Use “MakeWinCond” statement in constructor on new pointer
Use new condition in BuildEvent to set a gate for new histogram
What has changed?: Modify condition during monitoring analysis
Use “Form” statement in constructor to label each object with channel index
Use channel index in BuildEvent to test/fill the correct condition/histogram
Modify condition(s) interactively
Each Condition should be in same pad as corresponding histogram
Take picture “condSet” as example for dividing the pads and setting graphic options
Use “for” loop over pad coordinates (2x4) to match channel numbers (0...7) in definition
How does picture look?
Modify embedded conditions in picture with marker editor
Open new viewpanel; use canvas divide tool to get 2x4 divisions
Drag and drop histograms to corresponding pads
Drag and drop conditions to corresponding pads
Generate hotstart script with new “Picture”
Test hotstart setup by shutdown and restart gui
Open with editor: kate TMyNameUnpackEvent.h and TMyNameUnpackEvent.cxx
Declare Int_t variables for each crate to contain sum of all channels values
Implement Clear() for new member variables
For each mbs event, accumulate sums and put into output event variables
Build modified analysis “make”
Start Go4 in batch or GUI mode with output tree enabled
After end of processing, inspect tree with ROOT or Go4 viewer. Are new variables available?
Start Go4 in GUI mode. Configure step 1 with output tree
Use online tree viewer to define dynamic histogram from tree.
Monitor new histogram during Go4 run
Activate second analysis step in TMyNameAnalyis.cxx
Define and implement new histograms in second step to be filled from new variables
In analysis set up (GUI or go4analysis batch mode) disable second step and switch on tree output of first step. Run from sample file.
In analysis set up (GUI or go4analysis batch mode) disable first step and enable second step. Use previous tree output of first step as second step event source.
Compare speed (ev/s) for the three cases. Any influence of tree parameters? What about file size (lmd format, intermediate tree file)?
Edit TMyNameParameter.h , .cxx and define different polynomial calibration coefficients (2nd order) for each of the 8 channels of crate 1
Define Function TMyNameParameter::DoCalibration(ch, adc) that calculates energy from adc values for each channel.
Define a boolean switch “recalibrate” to indicate that calibration was changed by user
Edit TMyNameAnalysisProc.cxx .h: Add new calibrated histograms for 8 channels of crate 1 array. Hint: Use function InitCalibratedSpectra to recreate these histograms based on the calibration values in parameter. Use DoCalibration function of parameter to set histogram boundaries!
Use Parameter calibration function to fill calibrated histograms from raw data.
Provide mechanism to recreate calibrated spectra with changed limits whenever the “recalibrate” switch in parameter object becomes true!
View parameter object in GUI editor. Modify values and watch effect.
After changing inital values, produce an analysis macro to set current values.
Recover values by means of the set_all.C macro in analysis.
Introduce “Randomize” function into parameter class to smear digital rounding artefacts at bin edges.
Copy $GO4SYS/Go4ExampleUserSource to local work directory.
Rebuild “make clean; make”
Run from GUI with user source file
Look into code TYYYEventSource and TYYYRawEvent
Optionally discuss other event sources