1 | README of FACT svntools/rootmacros
|
---|
2 |
|
---|
3 | on the ISDC cluster, I used /opt/root5.18.x86_64/bin/root for testing.
|
---|
4 |
|
---|
5 | fbsl.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
|
---|
23 | overviews are stored in a root file.
|
---|
24 | the 4 ints: firstevent, nevents, firstpixel, npixel can be used to calculate
|
---|
25 | only for a subset
|
---|
26 | the last bool can be set to true, which will open 2 Canvases with overview
|
---|
27 | histograms.
|
---|
28 |
|
---|
29 | for automatic production of baseline analysis one can call this macro like
|
---|
30 | this:
|
---|
31 | e.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 | -----------------------------------------------------------------------------------------------
|
---|
36 | fpeak_cfd.C ROOT macro creating an amplitude spektrum for each pixel
|
---|
37 |
|
---|
38 | int 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 |
|
---|
53 | the peaks are search, using the constant fraction discriminator, implemented
|
---|
54 | as a FIR filter, which outputs a waveform, which rising edge zero crossings
|
---|
55 | show the position of a peak.
|
---|
56 |
|
---|
57 | the two integers 'avg1' and 'avg2' are still present for debugging...
|
---|
58 | two sliding average filters are beeing used, and these are the HALFwidths of
|
---|
59 | these filters.
|
---|
60 |
|
---|
61 | The amplitude spektra are produced as a TH2F with the pixels on its x-Axis.
|
---|
62 | For further analysy the ROOT macro gainfit.C may be used...
|
---|
63 |
|
---|
64 |
|
---|
65 | -----------------------------------------------------------------------------------------------
|
---|
66 |
|
---|
67 | gainfit.C ROOT macro for analysing the amplitude spektra of fpeak_cfd.C
|
---|
68 |
|
---|
69 | this is far from beeing any good, but have a look yourself.
|
---|
70 |
|
---|
71 | call it like this:
|
---|
72 | gainfit("rootfilename.root", "textoutfilename.txt" , false);
|
---|
73 |
|
---|
74 | its short ... so I'd rather not explain it here.
|
---|
75 | I guess one can try for many other fit functions, and play with Parameter
|
---|
76 | bounds, but I had no time yet.
|
---|
77 | Thomas Krähenbühl once send me a mail containing a lot of ideas, and I guess
|
---|
78 | in gainanalysis.C there is a lot more ...
|
---|
79 | these scripts should maybe be joined soon ...somehow.
|
---|
80 | D.Neise 20111104
|
---|
81 |
|
---|
82 |
|
---|
83 | -----------------------------------------------------------------------------------------------
|
---|
84 | flightpulser.C ROOT macro for plotting the amplitudes of the external lightpulser
|
---|
85 |
|
---|
86 | call it e.g. like this
|
---|
87 | root
|
---|
88 | flightpulser.C+'("data/20111029_017.fits.gz","data/20111029_013.drs.fits.gz","../analysis/20111029_017-013_fpeak_cfd.root",
|
---|
89 | 0, 100, 0,-1)'
|
---|
90 |
|
---|
91 | to look at the amplitudes of all camera pixel for 100 events.
|
---|
92 | you get a color coded TH2F so you can look at the amplitude distribution
|
---|
93 | yourself.
|
---|
94 |
|
---|
95 | this macro is based on fpeak_cdf.C pretty much.
|
---|
96 | I basically use the same steps, but in the end I just fill the absolute
|
---|
97 | maximum into the TH2F.
|
---|
98 |
|
---|
99 | The macro is pretty slow (about 1.5 min for 100 full camera events) so I
|
---|
100 | switched off the sliding averages...
|
---|
101 |
|
---|
102 | but it didn't help much...
|
---|
103 |
|
---|
104 | I am still not sure how to improve the speed of these macros.....
|
---|
105 |
|
---|
106 |
|
---|
107 | -----------------------------------------------------------------------------------------------
|
---|
108 | tpeak.C ROOT macros to produce overlays of data around a found peak in a given
|
---|
109 | window.
|
---|
110 |
|
---|
111 | int 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
|
---|
125 | here
|
---|
126 | bool ProduceGraphic = true
|
---|
127 | )
|
---|
128 |
|
---|
129 | call it like this, if you want to overlay a certain number of peaks for a
|
---|
130 | single channel
|
---|
131 | tpeak("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 |
|
---|
133 | set the first bool 'spikeDebug' to false in order to overlay quicker ... every
|
---|
134 | 50th event the canvas is updated.
|
---|
135 | depending on what kind of peaks you like to detect the sliding average filters
|
---|
136 | should be set to e.g. 14,8 for singles in a quiet G-APD pedestal run
|
---|
137 | or 0,0 if you want to see just every thing that might be a signal...
|
---|
138 |
|
---|
139 | the window size 50,150 means .. 50 slices to the left of the maximum and 150
|
---|
140 | to the right.
|
---|
141 |
|
---|
142 | there is a bit of cleaning included in the file, maybe you want to switch it
|
---|
143 | off, then just search for the calls of these methods...
|
---|
144 | removeMaximaBelow( *zXings, 3.0);
|
---|
145 | removeRegionWithMaxOnEdge( *zXings, 2);
|
---|
146 | removeRegionOnFallingEdge( *zXings, 100);
|
---|
147 |
|
---|
148 | and comment them out or play with the settings.
|
---|
149 |
|
---|
150 | they are defined in zerosearch.C, which is maybe a bad choice...
|
---|
151 |
|
---|
152 |
|
---|
153 |
|
---|