source: fact/tools/rootmacros/README.txt@ 12392

Last change on this file since 12392 was 12392, checked in by neise, 13 years ago
tidied up tpeak.C and put an entry into README.txt
File size: 5.5 KB
Line 
1README of FACT svntools/rootmacros
2
3 on the ISDC cluster, I used /opt/root5.18.x86_64/bin/root for testing.
4
5fbsl.C ROOT Macro computing the baseline for each pixel
6 the function is declared as:
7 int fbsl(
8 const char *datafilename = "path-to-datafile.fits.gz",
9 const char *drsfilename = "path-to-calibfile.drs.fits.gz",
10 const char *TextOutFileName = "./appendfile.txt",
11 const char *RootOutFileName = "./datafile.root",
12 int firstevent = 0,
13 int nevents = -1,
14 int firstpixel = 0,
15 int npixel = -1,
16 bool produceGraphic = false
17 )
18
19 the baseline and its rms is calculated for each pixel based on the data,
20 given in the datafile.
21 the results are appended to a textfile
22 and the histograms ,which were used for caluculation, as well as some
23overviews are stored in a root file.
24 the 4 ints: firstevent, nevents, firstpixel, npixel can be used to calculate
25only for a subset
26 the last bool can be set to true, which will open 2 Canvases with overview
27histograms.
28
29 for automatic production of baseline analysis one can call this macro like
30this:
31e.g.
32 root -l -q fbsl.C++'("/data00/fact-construction/raw/2011/10/26/20111026_036.fits.gz", "/data00/fact-construction/raw/2011/10/26/20111026_031.drs.fits.gz", "./fbsl.txt", "./20111026_036.root")'
33
34
35-----------------------------------------------------------------------------------------------
36fpeak_cfd.C ROOT macro creating an amplitude spektrum for each pixel
37
38int fpeak(
39 char *datafilename = "data/20111016_013.fits.gz",
40 const char *drsfilename = "../../20111016_011.drs.fits.gz",
41 const char *OutRootFileName = "../analysis/fpeak_cdf.Coutput.root",
42 int firstevent = 0,
43 int nevents = -1,
44 int firstpixel = 0,
45 int npixel = -1,
46 bool spikeDebug = false,
47 int avg1 = 14,
48 int avg2 = 8,
49 int verbosityLevel = 1, // different verbosity levels can be implemented here
50 bool ProduceGraphic = true
51 )
52
53the peaks are search, using the constant fraction discriminator, implemented
54as a FIR filter, which outputs a waveform, which rising edge zero crossings
55show the position of a peak.
56
57the two integers 'avg1' and 'avg2' are still present for debugging...
58two sliding average filters are beeing used, and these are the HALFwidths of
59these filters.
60
61The amplitude spektra are produced as a TH2F with the pixels on its x-Axis.
62For further analysy the ROOT macro gainfit.C may be used...
63
64
65-----------------------------------------------------------------------------------------------
66
67gainfit.C ROOT macro for analysing the amplitude spektra of fpeak_cfd.C
68
69this is far from beeing any good, but have a look yourself.
70
71call it like this:
72gainfit("rootfilename.root", "textoutfilename.txt" , false);
73
74its short ... so I'd rather not explain it here.
75I guess one can try for many other fit functions, and play with Parameter
76bounds, but I had no time yet.
77Thomas Krähenbühl once send me a mail containing a lot of ideas, and I guess
78in gainanalysis.C there is a lot more ...
79these scripts should maybe be joined soon ...somehow.
80D.Neise 20111104
81
82
83-----------------------------------------------------------------------------------------------
84flightpulser.C ROOT macro for plotting the amplitudes of the external lightpulser
85
86call it e.g. like this
87root
88flightpulser.C+'("data/20111029_017.fits.gz","data/20111029_013.drs.fits.gz","../analysis/20111029_017-013_fpeak_cfd.root",
890, 100, 0,-1)'
90
91to look at the amplitudes of all camera pixel for 100 events.
92you get a color coded TH2F so you can look at the amplitude distribution
93yourself.
94
95this macro is based on fpeak_cdf.C pretty much.
96I basically use the same steps, but in the end I just fill the absolute
97maximum into the TH2F.
98
99The macro is pretty slow (about 1.5 min for 100 full camera events) so I
100switched off the sliding averages...
101
102but it didn't help much...
103
104I am still not sure how to improve the speed of these macros.....
105
106
107-----------------------------------------------------------------------------------------------
108tpeak.C ROOT macros to produce overlays of data around a found peak in a given
109window.
110
111int tpeak(
112 char *datafilename = "data/20111016_013.fits.gz",
113 const char *drsfilename = "../../20111016_011.drs.fits.gz",
114 const char *OutRootFileName = "../analysis/fpeak_cdf.Coutput.root",
115 int firstevent = 0,
116 int nevents = -1,
117 int firstpixel = 0,
118 int npixel = -1,
119 bool spikeDebug = false,
120 int avg1 = 14,
121 int avg2 = 8,
122 int OverlayWindowLeft = 50,
123 int OverlayWindowRight = 150,
124 int verbosityLevel = 1, // different verbosity levels can be implemented
125here
126 bool ProduceGraphic = true
127 )
128
129call it like this, if you want to overlay a certain number of peaks for a
130single channel
131tpeak("data/20111029_017.fits.gz","data/20111029_013.drs.fits.gz","test.root",0,1000,333,1,true,0,0,50,150,1,true)
132
133set the first bool 'spikeDebug' to false in order to overlay quicker ... every
13450th event the canvas is updated.
135depending on what kind of peaks you like to detect the sliding average filters
136should be set to e.g. 14,8 for singles in a quiet G-APD pedestal run
137or 0,0 if you want to see just every thing that might be a signal...
138
139the window size 50,150 means .. 50 slices to the left of the maximum and 150
140to the right.
141
142there is a bit of cleaning included in the file, maybe you want to switch it
143off, then just search for the calls of these methods...
144 removeMaximaBelow( *zXings, 3.0);
145 removeRegionWithMaxOnEdge( *zXings, 2);
146 removeRegionOnFallingEdge( *zXings, 100);
147
148and comment them out or play with the settings.
149
150they are defined in zerosearch.C, which is maybe a bad choice...
151
152
153
Note: See TracBrowser for help on using the repository browser.