I have written a python script to run through the Pandora Calibration:
It will run over all of the calibration constants, produce the root files containing the histograms, fit the histograms and find the calibration constant that gives the mean of the fit closest to the correct value.
I've tried to find a sensible way for the code to decide which calibration constants to try next, and to decide when to finish the calibration, but I wouldn't want to guarantee that it gives the best answers.
The middle part of the code creates a Marlin steering file with the chosen calibration constants, and the appropriate slcio input files, runs this through Marlin to produce the histograms, gets the appropriate histogram, fits it, and prints the mean of the fit.
I think this part is useful in itself, even if you are not convinced by the way I have chosen the calibration constants each time.
You could always write a different loop around this bit, that just iterates through a load of calibration constants, maybe.
Anyway, to run the code, first you need to set up pyroot:
export LD_LIBRARY_PATH=$ROOTSYS/lib:$PYTHONDIR/lib:$LD_LIBRARY_PATH
export PYTHONPATH=$ROOTSYS/lib:$PYTHONPATH
This worked with our pretty standard root installation, but if it doesn't there is more info here
The python code is here
It calls a bash script that makes the Marlin steering file.
To run this script use:
python DoPandoraCalib.py
You will need to change the "slciofile" string to your slcio files on lines 100, 110 etc.
You will also need to change the gear file in MakeSteeringFile.sh.
"debug" can be changed:
if debug = 0, only the best calibration constants that the code finds will be printed out.
if debug = 1, some info about the calib consts that are being tried will also be printed out.
if debug = 2, lots of info will be printed, and the histograms will be drawn.
The starting values, and iteration values (lines 95 and 96 etc) for the calib consts will need to be set to something sensible, i've set them to what i think is sensible for LDC01_05Sc.
The script puts all the root files in a directory called 'CalibRootFiles'.
The calibration constants found by the code for LDC01_05Sc are as follows:
CalibrECAL = 63.4, 126.9
CalibrHCAL = 41.25
ECALMIPcalibration = 147.8
HCALMIPcalibration = 34.2
ECALEMMIPToGeV = 0.00675
ECALHadMIPToGeV = 0.00675
HCALEMMIPToGeV = 0.035
HCALHadMIPToGeV = 0.035
Mark Thompson's default consts are:
CalibrECAL = 62.5 123.0
CalibrHCAL = 31.2
ECALMIPcalibration = 171
HCALMIPcalibration = 37.1
ECALEMMIPToGeV = 0.00593
ECALHadMIPToGeV = 0.00593
HCALEMMIPToGeV = 0.026
HCALHadMIPToGeV = 0.026
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment