This repository is meant to hold all of the standalone ROOT macros related to the dQ/dx calibration and validation with space charge correction.
A bash script, called runYZvalidation.sh, is provided to create all the necessary histograms and plots for the calibration once the crossing muons tuples are available. In order to run the script, there are 3 parameters used as an input parameters:
- Label tag for the calibration/MC validation. You can use "v1", "v2", "v3". This is mostly done to ensure a proper bookkeeping for all the different studies/variations
- Output directory of the tuples. This is the directory where the tuples are located in. An example of how the direcory will look like is as follows:
/pnfs/uboone/scratch/users/wospakrk/CrossingMuPitchCorr_take2/v08_00_00_12/CrossingMuPitchCorr
- Name of the output directory where you will keep your histogram files. You just need to supply a folder name. The directory itself will be created for you under the @/uboone/data/users/$USER directory@. Here as an example, I am using the "ExampleHistos" as the name of the folder.
- Type of sample you are analyzing: "data" or "mc"
Putting it all together, an example of the command line to run this:
. runYZvalidation.sh v1 /pnfs/uboone/scratch/users/wospakrk/CrossingMuPitchCorr_take2/v08_00_00_12/CrossingMuPitchCorr ExampleHistos mc calibration
The main macros used to create the histograms are:
- The macros used to create the YZ maps and correction factors map to get a uniform response across the YZ direction of the detector: Y_Z_calibration_DataDrivenMap.C and its header file Y_Z_calibration_DataDrivenMap.h
- The macros used to create the dQ/dx as a function of drift direction and drift time. This is the main macros used to create the histograms for the daily lifetime: X_calibration_DataDrivenMap.C and its header file X_calibration_DataDrivenMap.h
Macros that are used to make all the calibration and validation plots:
- MakePlotsYZ.C -- creates the 2d YZ map plots and the 1d projection of the map.
- MakePlotsX.C -- creates the dQ/dx vs drift direction plots.
- MakeLifetimePlotsFromTable.C -- creates the daily lifetime plots from the table created while running the X_calibration_DataDrivenMap.C
- MakeValidationPlots.C -- create various plots to see the diffent shapes after applying the space and electric field corrections.
- PlotOverlayTheta.C -- create plot of median dQ/dx as a function of the drift direction separated by the angle of the crossing tracks
- CreateNewRootTemplate.C -- create a new root file containing the correction factors from all 3 planes. The database macros and overlay requires specific naming and this macro provides the correct histograms name formatting depending on data or MC.
Macros for dQ/dx YZ map overlay validation:
- FillEmptyBins.C -- fill in the empty bins in the YZ map with the average correction factors from the neighboring bins. Should be used after the CreateNewRootTemplate.C
- FillEmptyBinsWithOne.C -- in case you want to fill the empty bins in the YZ map with 1 instead of the average correction factors from the neighboring bins.
- TestMedianError.C -- evaluate the median error assigned to the median dQ/dx. It uses toy data to evaluate how close the mean, median, and RMS with the current calculation for the error.