flat file
)
via ROOT I/O that is very compact and efficient.
It it not, however, intuitive nor does it lend itself to interactive
data analysis.
We therefore convert the flat file format to a ROOT ntuple
(we refer to that as the inter file
),
allowing ROOT/CINT access to the events - in other words,
interactive analysis (like PAW in the old days) or batch
analysis (like FORTRAN jobs to read ntuples in the old days).
Conversion from the raw data to the inter file happens semi-automatic with a cron job that runs on kzero. If the inter file has not been produced, you can do that manually, but I won't get into that here. Please refer to the detailed documentation. Note that an inter file is only created automatically after one more flat file has been created by the scanning setup.
The inter files are kept on NFS and a copy o fthe recent files is usually also on kzero, so ssh to kzero and go to one of the four local disks (called /u1 /u2 /u3) there. Create a directory for yourself if you don't have one already, use your user id as directory name.
By default, the new inter files will be located in /u2/pmtscans
.
You can directly access the inter file from there, for example type
root /u2/pmtscans/inter_file_date20040203_time535.rootThe root ntuple in the file is called main_scan. There are a number of ways to analyze this root ntuple.
TBrowser Band in the
ROOT Object Browser
window select
the ROOT Files
icon, then the icon that has the file
name, then right-click on the icon named main_scan
and
select Start Viewer
.
A window will open that shows all quantities in the ntuple,
simple click, for example, on the icon called
hits_values_pad24
to plot the time distribution for all
hits on pad number 24 in number of TDC counts for the line
from February 3, 2004, at 5:35 am.
main_scan->Draw("hits_values_pad24");will plot the time distribution for all hits on pad number 24 in number of TDC counts for the line from February 3, 2004, at 5:35 am.
main_scan->Draw("hits_values_pad24>>myhist1(651,-0.5,650.5)");will do the same but will use the 651 bins from -0.5 through 650.5.
x
: the value of x in mm; y
: the value of y in mm; hits_number_pad<#>
: number of hits observed
on pad number <#>; hits_values_pad<#>
: time of hits observed
on pad number <#> in TDC counts; hits_indices_pad<#>
: running index of hits observed
on pad number <#>, corresponding to the trigger number; Please refer to examples in the CRT software or in the ROOT manual for more on ROOT commands and scripting.
chain_OVER_ALL_LINESCANS_2004_local.C
overall_efficiency.C
make_pad_boundaries.C
\ls inter*[0-9].root > ! datafile3 root -b -l -q ../chain_OVER_ALL_LINESCANS_2004_local.CInspect the file
overall_efficiency.C
and, if
necessary, adjust the PMT boundaries, width and rotation.
Now create the macro that will book and fill the histograms.
root -b -l -q overall_efficiency.Cand run that macro to produce a new ROOT file that contains the 2d histogram
root -b -l combined.root overall_efficiency_run.C > &! opfile < /dev/nullIf you plan to draw the PMT boundaries and pad numbers on top of the scan result, create a file that contains the boundaries. Edit
make_pad_boundaries.C
so that the PMT size and position
are correct.
Then create the new file called store_pad_boundaries.root
root make_pad_boundaries.CTo plot the resulting 2d efficiency histo, run a ROOT session with the following commands:
root store_signal.root gStyle->SetOptStat(0); gStyle->SetNumberContours(50); normalized->SetTitle("Uniformity, MCP #5, scan 20040113, HV: -2.4kV") normalized->Draw("COLZ"); TFile* f = new TFile("store_pad_boundaries.root") boundary->Draw("SAME BOX"); Pads->SetMarkerSize(1.) Pads->Draw("TEXT SAME");Print a PostScript or GIF file from the ROOT window if you want.
If you want to see the uniformity and efficiency plotted in the
standard four eps files, edit pmt_effi.C
and enter the correct PMT info and scan parameters and
then run the macro with:
root -q -b -l pmt_effi.CYou're done.
Last significant update: February 3, 2004, | by Joe |