Privacy and Security Notice
FPP software
Privacy and Security Notice
Privacy
and Security Notice
Comments on some macros for
FPP
(macros found in /adaqfs/home/adaq/ledex/jones)
Each macro assume that one created a root tree with the L.fpp
variables. Macro assumes
the root file is Afile_#.root with
# being the run numbers.
Can be modified in macro.
1. Macro for determining
the
tzero offsets:
tzero_calc.C
- Create file old_tzero.dat .
This file is the L.fpp. TOffset array. It will be 24x40 = 960 lines.
The database is setup in terms of the 24 FPP planes in the order
V1-3,U1-3,V4-6,U4-6,U7-8,V7-8,X1-2,U9-11,V9-11 .
- Run the macro. The macro is set to produce histograms of L.fpp.(pltype)(plnum).ltdc for
each wiregroup in that plane with pltype="u","v"
or "x" and plnum = 1-11 for
"u" and "v" or 1-2
for "x".
The front chamber 1 and 2 "v" ("u") planes have 20 (22) wiregroups. The
rear chamber 3 "u" and "v" planes have 30 wiregroups and the "x" planes
have 31. For chamber 4 the planes have 35 wiregroups.
- The macro asks: Do plane (1-24
; enter 25 to quit) (last plane : 1 . Enter which plane that one
wants to calcualte the time offset.
- Macro loops through the wire planes for that plane. Creates
histogram of L.fpp.(pltype)(plnum).ltdc
. The
histogram is in channel number with a channel bin being 0.5 ns. Also
plotted on the histogram is the old value for the tzero as a blue line.
The macro calculates a new value for the tzero. The TDC is common stop
so the shortest time is at large of L.fpp.(pltype)(plnum).ltdc . To
calculate the tzero time, the macro loops through the contents of the
histogram starting at the largest bin. It takes the average of 8 bins
and compares to the variable min, and
then moves doen one bin and takes the average of that 8 bins and
compares to min. When it
finds a group of 8 with average larger than min, it sets the tzero to
the time of the last bin in the group of 8. Presently min is set to 5, but this may need
to be changed depending on the conditions of the run. This new value is
plotted as a red line. The old value is plotted as a blue line.
- The macro asks: Use old value,
new value or type in new value (o/n/t)?
- If one answers "o" then the old value is
copied into the array new_tzero
and next wiregroup ltdc is plotted
- If one answers "n" then
the calculated value of
tzero is copied into the array new_tzero
.and next wiregroup ltdc is plotted
- If one answers "t" then
the macro asks: Enter value
for tzero ( in channel number) Present value : 1728. One then
gives a value for the
tzero which is plotted on the histogram. The
histogram is replotted and the maco asks: Use old value, new value or type in new
value (o/n/t)?. To save the newly entered tzero
enter "n". If you want
to change the value enter "t"
.
- After all wiregroups are done, the array new_tzero is written to the file new_tzero.dat and the macro loops
to ask for the next plane.
- Need to edit new_tzero.dat into
the database file.
2. Macro for looking at demux
gates:
show_front_demux.C and show_rear_demux.C
- In the FPP database there are nine demux gates per wiregroup for
each of the 24 planes in the order
V1-3,U1-3,V4-6,U4-6,U7-8,V7-8,X1-2,U9-11,V9-11 . Each plane is
given 35 lines of 9 demux gates ( so there are each lines for most
planes).
- Create file gates.dat from the 24x35 lines in the database after L.fpp. DemuxCuts. The database is
setup in terms of the 24 FPP planes in the order
V1-3,U1-3,V4-6,U4-6,U7-8,V7-8,X1-2,U9-11,V9-11 .
- Run the macro. It reads in all from the gates.dat file into
demux_gates array.
- Plots the demux spectra showing the gates in red and saves them
to a postscript file ( demux_pl_1_12_run5215.ps for front or
demux_pl_13_24_run5215.ps for rear ).
2. Macro for setting the
demux gates: set_demux_gates.C
- In the FPP database there are nine demux gates per wiregroup for
each of the 24 planes in the order
V1-3,U1-3,V4-6,U4-6,U7-8,V7-8,X1-2,U9-11,V9-11 . Each plane is
given 35 lines of 9 demux gates ( so there are each lines for most
planes).
- Create file gates.dat from the 24x35 lines in the database after L.fpp. DemuxCuts. The database is
setup in terms of the 24 FPP planes in the order
V1-3,U1-3,V4-6,U4-6,U7-8,V7-8,X1-2,U9-11,V9-11 .
- Run the macro. It reads in all from the gates.dat file into
demux_gates array
- Then it loops and asks "Which
plane (1-24) ( type 99 to quit)". Pick the plane
that you would like to set the demux gates. Plane 1 = V1 ... Plane 24 =
V11
- The macro fills the demux histograms for each wiregroup in that
plane.
- The macro loops and asks "Which
wire group? ( type 99 to quit)". Give the wiregroup number and
the demux spectra is plotted with the gates in red. Then it asks: Are gates ok ( y/n) ?": If yes then
ask: "Which wire group?".
If no then the macro asks: Which
gate to change ( 0-8 ) ? .
There are 9 gates numbered 0-8. Then it asks: What value for gate " . One enters
the channel number. Then the histogram is replotted with the new gates.
It loops through these questions until one answers "y" that the "gates are ok".
- Write the new demux gates to file: new_gates.dat
- Remember that if one decides to
run the macro again that one should copy new_gates.dat to gates.dat. OR you work will be lost
since the macro writes over the
new_gates.dat each time it is run.
- Need to edit new_gates.dat into
the database.
3. Macro for calculating the
drift time to distance conversion polynomials:
calc_drift_time.C
- For now the macro assumes that the maximum drift time is 150ns.
- Macro fills histogram of L.fpp.(pltype)(plnum).ltdc
for each plane with 300 bins in 0 to 150 ns.
- For each plane determines the running sum of counts in each
time bin and the sum of all counts.
- Sets the drift distance = (running sum of
counts)*(0.522)/sum*0.5 0.522cm is radius of straw tube
- Plot drift distance versus time and fit with 7th order
polynominal.
- Polynomial coefficients are written to new_drift_time_poly.dat
4. Macro for straw
efficiency: show_straweff.C
- In the analysis code, the fitted track is projected to each plane
and checks whether the straw that the track intersects had a signal or
not. If the straw has a signal then the variable L.fpp.(pltype)(plnum).efficiency
is set to 1. Other wise it is set to 0.
- Each plane fill histrograms of straw positions when L.fpp.(pltype)(plnum).efficiency =
1 and another set for 0.
- Make a plot of straw positions when L.fpp.(pltype)(plnum).efficiency =
1 ( black) and another for 0 (red). Then the efficiency is plotted
below.