!!!!Attention !!!! those scripts have been written during the 1rst engeniring run and
not touched any more. so may not be up to date if you have questions, ask the writter or the analysis on call
The
scripts library for
Unless
specified, those scripts can be found on g0ana:$G0SCRATCH/scripts/
tcl-tk script written
to ais in the lauching of G0-specific analysis, plotting and viewing routines.
It is primarly targeted
at the non-expert user or"first-time" analysis shift worker, athough it
may
also be convenient
for "expert" users. Read manual
.
To start G0NAG,
logon to one of the analysis computers (G0ana, cdaql1, or cdaql2) and type
gonag.
Beam
tools
coil_pulse_check.C ---(J.
Martin, 03-01-21)
short script to
make some plots related to coil pulsing. need to be run on a ROOT session
#56834 to look at run NNNN
.x coil_pulse_check.C("NNNN")
or with arbitrary
cuts on the variable of the mps ntuple
.x coil_pulse_check.C("NNNN",imps>1500"
Axy_full-----
(J. Liu, 02-11-17)
Beam asymmetry analysis.
All the BPM and BCM asymmetry
and correlation
analysis. Executable. Type >Axy_full and give the run
number. Make sure
you've replayed the run with --qrtntuple <#ring> flag.
Axy ---
(J. Liu, 02-11-17)
A strip-down version
of Axy_full. Just plot Diff_x_G0B,
Diff_y_G0B and A_BCM2.
Executable.
AsymBPMPed
--- (J. Liu, 02-11-17)
Find the helicity
correlated pedestal difference of all
the BPM and BCM
channels. Executable. Need to replay the run with
"--beamntuple".
Executable.
ChargeAsym
--- (J. Liu, 02-11-17)
Not quite exact
as its name. This is a tool to plot the
charge asymmetry
vs different RHWP angle. Need to be edited to reflect the
correct angle---runnumber
correspondence. Executable. Need quartet ntuple.
beam_asym_5min_ave
--- (J. Liu, 02-11-17)
Display the short
term (5 min) average of
Diff_x_G0B, Diff_y_G0B,
A_BCM2 during a long run to look at the evolution
of beam asymmetry.
Executable. Need quartet ntuple.
eng_diff.C
--- (J. Liu, 02-11-17)
A simple root script
to get helicity correlated energy
difference in MeV
vs run number. Need to be edited for the correct run
range of interest.
Need quartet ntuple.
FindBPMPed
--- (J. Liu, 02-11-17)
Find the pedestal
value for all the beam scaler channels
(of course the run
has to be a pedestal run with forced gain on BPM
wires). Need beam
ntuple.
BCMAsymPerXMin.C
---(J. Lenoble, 02-11-23)
Display charge asymmetry
as a function of time, measured by the BCM2. Outputs
two graphs: one
giving the instantanous charge assymetry over an period of time
that is defined
by user, the other one giving the average value since the beginning
of the run. To be
run in a root session.
XYDiffPerXMin.C
--- (J. Lenoble, 02-11-23)
Display position
difference (in micro meter) as a function of time, measured by the G0B.
Outputs two* two
graphs: one giving the instantanous position asymmetry over an period
of time that is
defined by user, the other one giving the average value since the
beginning
of the run. To be
run in a root session.
beam_parity_prms ---(S.
Covrig, J. Liu, J. Roche, 02-12-19)
Summarises
beam helicity properties for runs analyzed with the quartet ntuple flag.
The
script computes,
for each run, assymetries in charge, positions, angles and energy and
write the
results into the follwoing file :
$G0SCRATCH/scripts/beam_parity_prms.out.
The list of the runs the script considers
for its summary,
is given in the file $G0SCRATCH/scripts/good_runs.dat. If you want
to add a run in
this summary, add its number at the bottom of the good_runs.dat file,
and run the
executable. see elog entry #
54915
Time
Encoding tools (tof, asymmetries..)
deadtime_fr.C ---
(L. Hannelius, 03-01-21)
Estimates
the deadtime of the french electronics from singles hits
/in the CFDs and
MTs. Uses french scaler information. Requires that
the run was
analyzed with "--hists --tof".
to be run in a root
session
asymmetries_sum ---
(J. Roche, 03-01-13)
summarises detector
asymmetries for run analyzed with the hists flag. The script get, for
each run, the asymmetries
per ring and write the results into the following file :
$G0SCRATCH/scripts/asymmetries_5000.out.
Then it sum all the asymmetries and plot them.
The list of the
runs the script considers for its summary, is given in the file
$G0SCRATCH/scripts/good_runs.dat.
If you want to add a run in this summary, add its number
at the bottom of
the good_runs.dat file, and run the executable. see elog entry #56013
asym_ana_summary
--- (J. Liu, 02-11-17)
Proton asymmetry
vs ring number, relative difference
between the proton
asymmetry width and the statistical estimate, etc.
Still developing.
Executable. Need to replay the run with "--hists" flag
to build the offline
histogram (NOT --tof!)
A_beam_det.C ---
(J. Liu, 02-11-17)
Makes the multi-run
plots for the correlation
between the proton
asymmetry and beam asymmetry (or difference).
The script will
take a bunch of ROOT files, with "offline_hists" built, and
create the proton
asymmetries of 8 detectors on a given detector ring
(6 by default),
vs
1. Diff_x_targ (position
difference in x projected onto the target)
2. Diff_y_targ (position
difference in y projected onto the target)
3. Diff_x_eng (position
difference in x of 3C12)
4. A_q_targ (charge
asymmetry)
It runs in ROOT
CINT. You might need to put the correction run numbers
into the code (modify
"NGoodRuns" and "TString runs[NGoodRuns]"). To
run it:
>root >root[0] .L A_beam_det.C >root[1] A_beam_det()
yield.C---
(K. Nakahara, 02-11-19)
Effect of beam steering/position
on detector yields and asymmetries.
It plots detector
yield as a function of your choice (beam position x01,
y01 in my case),
and also detector asymmetry as a function of your choice.
It can handle both
mps_nt and qrt_nt,
1. mps_nt.
This can be used to look at the detector yield as a function of
beam position (it
actually lets you choose what the x-variable should be).
This also plots
the detector asymmetry as a function of your choice.
2. qrt_nt.
This lets you look at detector yield as a function of your choice.
Start root, and just type: > .x yield.c
rates_vs.C
--- (G. Quemener, G. Batigne, 02-11-21)
Plot countings
rates as a function of the octant number for different beam/threshold conditions.
The code is under
gzero@g0ana:users/gilles/Macros/rates.
1) number N of runs
to be analysed.
2) name of the variable
which will be used to plot rates versus it and its
corresponding unit
(e.g. : X mm) this will appears in the axis titles as
"X (mm)".
It can be field or thresholds are whatever else you want.
3) Now you will
have to enter N couples of values: a run number and the
value of the variable
of interest, for instance for the beam steering study,
if you want to study
only 2 runs as a function of the X position of the beam,
you could enter
:
14384 0.
14386 -1.5
This program will
create a summary of the plots in the file rates_summary.ps
In the new version
which will be available today:
4) assymmetries
in rates for 2 opposite octants.
5) slopes of the
rates versus X .
(for more details
see readme file)
g0ana.C ---
(A. Biselli, 02-11-20)
see full description
under electronic section. note that the routines
plot_octant(*runnumber,*octant)
->it plots all the detectors for the given octant in just one canvas
it works also
for french octants
plot_all_octants(#runnumber)->it
plots all the octants (NA and french) (one octant per canvas)
calculate
and display the NA rates.
tofcutbinrange --- (B.
Guillon, 03-01-13)
This program calculates the positions of
the cuts for each kind of particles for NA and
Fr electronics. The
program creates a file (detBinRange.in.#run)
which can be used by
g0analysis in the directory DATA. It is an executable
program and
requires only the --tof option.
testprotoncut.C ---
(J. Roche, 02-12-10)
plot the tof spectra for one octant of one run
and surimpose the proton cuts that are read either in the
lookup table g0analysis uses for the replay or
in a file selected by the user
executable. To run it type : testprotoncut
wells_plot_per_ring ---(J.
Roche, 02-12-10)
detector asymmetry versus charge assymetry :
Starting form a list of runs (provided by users)
compute the variation of the asymmetry as a function
of the beam charge asymmetry for each ring
separetly for NA and Fr). Plot the slope extracted
as a function of ring number.
Executable. To run it (this is not a friendly
script...) :
- edit wells_plot_per_ring.C, change NUMRUN (line
26)to the number of runs in your list,
update the list of run (line 48) and comment
(line 49)
-compile the script by typing make wells_plot_per_ring -type wells_plot_per_ring.C
FindProtonToFPeaks_Macro.C
---
(T. Forest, 02-11-12) OBSOLETE
Great to display
the 16 tof of one octant from one run. This macro also find proton peak
in the tof spectra
and can display the 16*8 values on a summary plot
To use do the following
in a root interactive session :
.L FindProtonToFPeaks_Macro.C PlotProtonPeaks(13854)
(find proton peak in tof spectra and display there location in tof
spectra for all
detectors all octants)
GetPeakMean(13854,2)
(plot the 16 tof spectra for a given octant number (here 2) in a
given run (here
15854))
Fits the tof spectra with a 3 gaussian
distributions (one proton, one e-proton and the last one pion)
and counts number of each part within
2 sigma of the distributions. Gives fit results and counts in
output files (see beginning of script
for more details).This routine right now is optimal for FR tof
(were the setup is such that there are
actually three peaks) , Benoit will work on including the fit for
NA detector (mostly only two peaks, because
pion are under threshold...)
To run it : >root >.x fit_tof_spectra.C
Fastbus
Tools
gofar ---
(J. Roche, 02-07)
GUI that provide
various analysis scheme for fastbus like : amplitude check, timing resolution
...
to run:
cd $G0TOOLS/gofar,
type gofar -s
fastbus ---
(A. Biselli, 03-01-13)
computes single
cfd and single MT rates from the fastbus and the beam ntuple
(to properly normalize
the rates)
to use it just type
fastbus -rXXXXX
-oY (--KHZ --DMCH) --Rates
-rXXXXX XXXXX
is the runnumber
-oY Y is the octant
--KHZ gives rates
in kHz instead of counts/nC
--DMCH gives an
output similar to decode_sdmch
the program runs
on either G0Fastbus.XXXXX.root or G0Full.XXXXX.root files
fb-tof-diff.C ---
(R. Neveling, 02-11-19)
This code is supposed
to extract tof differences
between the
pion and proton peaks for fastbus data. There is a nice detailed
explanation on own
to use the code at the beginning of the file.
fb-tof-peakarea.C ---
(R. Neveling, 02-11-20)
get the number of
proton and pion detected using both a tof cut and an adc identification
(still need to
be copied under $G0SCRATCH/scripts, for more info contact Retief)
display single hit counts . first run
rate_fastbus.C then look at results using
rate_fastbus_plot.C for one octant and
rate_fastbus_plot8a.C for all 8 octants
front-back timing for
all detectors --- (A. Biselli, 02-12-02)
display the difference
of time between front and back meantimer for NA electronic.
This routine uses
4 calibration data (CalibrationConstantX.dat (X=1,3,5,7) that contain
the calibration
constantsfor fastbus data(NA octants). They are something general that
anybody can use.
Each line correspond to a detector and the columns are explained in
the file itself.
For example 03frt_cal=03frt*FR+FROffset
where FR and FROffset
are the 3rd and 4th number of the third line
To run it one
has just to open a root session and type .L MT_BackFrontTiming.C MT_BackFrontTiming(runnmber,octant)
Electronics
decode_sdmch (D.
Marchand, 02-11-17,FR electronics)
Plots rates and/or
counts (option) for each detector (CFDs and MTs) from
sdmch data. For
more detail see decode_sdmch11-18-02 To run it : decode_sdmch
<run_number> <segment_of_datafile> were segment_of_datafile
is 0, 1, 2, ... respectively for .0, .1, .2, ...
The code generates
:
- $SCRATCH/work/Rates_sdmch/log/G0Run<run_number>.log
:
configuration of FR electronics for this run
- $SCRATCH/work/Rates_sdmch/sdmch/G0Run<run_number>_sdmch.log
:
counts and rates per Octant and detector number, alerts
and some postscripts
under SCRATCH/work/Rates_sdmch/root/ :
if you have
chosen the option "Rates" :
- G0Run_<run_number>_directs_rate_O2_O6.ps
- G0Run_<run_number>_directs_rate_O4_O8.ps
if you have chosen
"Counts" :
- G0Run_<run_number>_directs_counts_O2_O6.ps
- G0Run_<run_number>_directs_counts_O4_O8.ps
g0ana.C ---(A.
Biselli, 02-11-20, NA electronic, FR+NA tof, rates)
It is a script to
run interactively from root
( run root and then
load it with .L g0ana.C)
It contains few
functions just to display tof spectra:
1)buddies(run#,octant#,detector#)
it displays
for run run# the time encoding spectra for detector# in
octant octant#
and its buddy (only for NA octants)
2)plot_octant(*runnumber,*octant)
it plots
all the detectors for the given octant in just one canvas
it works
also for french octants
3)plot_all_octants(#runnumber)
it plots
all the octants (NA and french) (one octant per canvas)
calculate
and display the NA rates.
it creates
automatically ps files: na#octant.ps, fr#octant.ps and
rates#runnumber.ps
This script
NEEDS the beam ntuple for the rate calculation
4)LTD(#runnumber,#crate)
diplay the
tof spectra in the same order of the NA electronics
crate=1 is
the top crate and crate=2 is the bottom one
the order
in the canvas is
oct=1(or
3) 1,9,2,10,3,11,4,12,
oct=5(or
7) 1,9,2,10,3,11,4,12,
oct=1(or
3) 5,13,6,14,7,15,8,16
oct=5(or
7) 5,13,6,14,7,15,8,16
it is useful
to spot problems in the electronics
HB
anode current versus beam current
graph_shielding.C ----
great example for
plotting one vector against an other one (in color !!), fit
them and put legend
on your drawing