MYanalyzer.f95
USER program (event loop) |
analyzEvent: |
calculate signal
amplitudes, correct gain, preselection, find seed track,
(demultiplex), (fit all pulses), track fit Z-Y, track
fit X-Y, resolution fits, fill analysis Ntuple (or
whatever you want) |
MY_book: |
booking of user histograms
and ntuples. |
NF_analysis (PRIVATE): |
Example of user Ntuple. |
HF_test (PRIVATE): |
Example of user histogram. |
DenseData: |
Write DenseData. |
TPCanalyzer.f95
MAIN program and analysis flow |
PROGRAM TPCanalyzer: |
initialize, loop runfiles,
loop events, read data, call analyzEvent (or Calibrate),
terminate program. |
TPCcalcAmplitude.f95
Calculate signal amplitude from ADC spectrum
Calibration:
pedestals, gain, falltime: |
Calibrate: |
no event selection, for all
events fit all pulses (with large amplitude), fill
calibration histograms. calcPedestal is called
or default values are used. |
correctGain: |
divides the amplitudes of all
pads by a factor dependent on the group. |
calcPedestal: |
calculate pedestal as average
over 5 time bins, the maximum of the first or last
time bins is taken. Set default values for gain, rise-
and fall time. |
subPedestal: |
fills ADC() = IADC() - pedestal. |
Several routines calculate the signals for all pads: |
calcAmplitudePad: |
Independent determination for
each pad. Determine TMax as time bin with maximum amplitude,
calculate amplitude with routines given below, calculate
T0, correct amplitude from TMax to T0. |
calcAmplitudeRow: |
Determination within rows.
1st calculate amplitudes and T0 independently with calcAmplitudePad;
an amplitude weighted average T0ROW is determined,
for pulses <smallSignal the amplitude is
recalculated wrt T0ROW. |
calcAmplitudeFoil: |
T0 is determined from largest
pulse in row, amplitude is the average over 30 to 100
timebins, depending on risetime of the pulse. |
calcAmplitudeFoilNEW: |
T0 is determined from largest
pulse in row, amplitude is the average over 100 timebins
using the same window for all pulses in the row. |
Several routines
calculate the amplitude from ADC spectrum depending
on a given T (PRIVATE): |
calcSignalFix: |
Subtract pedestal and return
amplitude = -ADC count at given T; to be used only
for testing. |
calcSignalSum: |
amplitude is average in range
[T0-riseTime,T0+fallTime]. |
calcSignalSlideSum: |
amplitude is average in range
[T0-nTsum/2,T0+nTsum/2], nTsum is argument. If T0 is
not given, it will be |
calcSignalExp: |
call amplitudeExp,
determine T0 via calcT0, correct amplitude
to T0. |
calcSignalExpT0: |
call amplitudeExp,
correct amplitude to given T0. |
amplitudeExp: |
Subtract pedestal, integrate
ADC spectrum for time bins T+50 to T+350, if the pulse
is late the window is decreased down to 100 time bins;
T should be TMax. |
2 routines calculate
the time of the pulse (PRIVATE): |
calcTMax: |
time where the ADC value is
largest. |
calcT0: |
time of the rising pulse where
the ADC value is half the amplitude at TMax. |
Pulse fitting: |
fitAllPulses: |
CPU time consuming, should
be called only for good events.
700 time bins are used (200 before T0) to fit pulseShape to
the ADC spectrum. Start values taken from calcAmplitudeXxx,
2 possibilities:
calibration run: fit only large pulses (amplitude >20), 5 free parameters:
amplitude, T0, rise time, fall time, pedestal. VERY CPU time consuming. Fit results
for rise time, fall time and pedestal are filled in histograms. The average will
be written in calibration files.
normal run: fit pulses with non-zero amplitudes (>2), 2 free parameters:
amplitude, T0. T0 is bound within +- 200 bins of the start value. |
Plotting: books
and fills histograms with pulse shapes |
plotPulseAll: |
all groups. |
plotPulseEvent: |
groups with amplitude > 0. |
plotPulseRow: |
using common time in one row. |
plotPulseVeto: |
for groups given as argument. |