-
Notifications
You must be signed in to change notification settings - Fork 20
How to calibrate
This page outlines the steps to obtain a nicely calibrated detector setup. It assumes you have some fair knowledge how Ant is run, how it's operated on a cluster system and how Ant-calib works as a GUI for all the fits you're about to do.
Just make sure the following timing offset are set. Don't forget to use Ant ... -S DisableTimecuts=1
when you rund the calibration physics classes.
-
CB_Time use
extra/runFileTools/BrowseHistograms.C
to check for "jumping" CB timing channels. - PID_Time
- TAPS_Time
- TAPSVeto_Time
- Tagger/EPT_Time
Use pedestal runs to calibrate the pedestals (actually, those runs should have been taken with a random pulser and no beam, which was not the case for EPT beamtimes).
- PID_Energy_Pedestals
- TAPS_Energy_Pedestals
- TAPS_ShortEnergy_Pedestals
Lastly, align the PID to CB by running
- PID_PhiAngle
In Ant, the timewalk correction is independent of the energy calibration, as it uses uncalibrated "energy" (or say, "amplitude information") to determine the correction. If you find channels with bad timing spectra, don't exclude them completely but mark them as BrokenTDC
. This is crucial as you want to keep as much energy information as possible for later clustering (makes a huge difference in resolution).
Make sure you don't apply any additional threshold on data. But MC needs them of course in order to model the resolution correctly. Check that this is correct with CB_Thresholds
.
Ant supports the application of different calibration factors depending on the event id (which makes it time-dependent). This is important for drifts in the energy calibration, for example.
Make sure you don't have any leftover smearings or single cluster energy corrections in your database from previous efforts. Also, you should have already a list of broken or incomplete channels, as excluding them during the process always requires re-doing the steps outlined here. Note that Ant supports marking them as NoCalib
(still used but gain flood-filled from neighbours) or BrokenTDC
(only ignored with respect to timecuts in CB).
Calibrate CB on data with a fair portion of your beamtime (about 100-200 run files) and obtain well-calibrated default gains. Then run-by-run calibration, use Ant-calib -a 10
as Savitzky-Golay averaging (defaults to polyorder 4, which should be ok) and subsequently reduce "Pi0 peak fitting noise" by Ant-calib-smooth -a 20 --polyorder 6
. Don't forget to commit your Ant database and push it to your cluster. The loop is as follows:
-
Ant
on full beamtime -
Ant-calib -a 10 -c CB_Energy_RelativeGains <input files>
Please tick "Ignore prev fit params" as defaults are usually better starting parameters. Ant-calib-smooth --write -a 20 --polyorder 6 -c CB_Energy_RelativeGains -s <yoursetup>
- Go to step 1. if not good enough (less than 0.5% Pi0 peak offset over all channels is ok)
(Cauton: This toolchain is a litte weird)
Our detector simulation is far from being perfect, that's why it needs to be smeared. To obtain those smearings, ensure it's calibrated on some typical mixture of channels (use the Ant cocktail) with the same procedure as the default calibration for CB on data. This should make the Pi0 peak positions match those on data (there's no single global MC energy scaling in Ant, as it's not precise enough).
Next, run the tuning physics class TwoPi0_MCSmearing
for data and MC. The goal is to determine additional sigmas which parametrize the Gaussion noise added to the cluster energies on MC. This makes the Pi0 peaks as broad as they are on data (MC is expected to be more ideal than data).
First obtain your "goal" pi0 peak widths by running Ant-mcsmearing --fit <file> --detector CB
on data. The output file will be called <file>.cb_fitted.root
. Keep it, since it will be needed in later steps. Do the same on MC.
To obtain the initial smearing widths, run Ant-mcsmearing --step --data <data.cb_fitted.root> --mc <mc.cb_fitted.root> -s <your setup> --detector CB
. This determines somewhat too large starting values for the smearing and writes them to the database.
Then rerun the physics class on MC. The peak widths will now change. Rerun the --fit
and --step
commands on the newly obtained output from MC. Repeat until the peak width difference of MC and data is small.
To view the change of the smearing factors stored in the database run root <path-to-database>/calibration/CB_ClusterSmearing/*.root
(make sure your rootlogon.C
loads the Ant libraries, see also roologon.C
generated by Ant inside the build
directory) and then exec root[] ant::TwoPi0_MCSmearing_Tool::CompareChangeInBinLoadAndDecode()
. A 2D histogram with the smearing factors from the last iteration will pop up. Click on a bin to see the change over iterations of that bin.
You can compare the reference width from data (or any mc iteration) to the MC widths using Ant-mcsmearing --compare --data <data> --mc <mc>
. It will show the a 2D plot of the relative differences of the widths (data-mc)/mc.