Warning, /analysis/HCalCosmicCalib/offline/README is written in an unsupported language. File is not indexed.
0001 These analysis scripts are used to process cosmics run data to extract new calibration factors for the HCal detector using cosmic ray muon data.
0002 The raw data need to be produced first to get the HIST_COSMIC_HCALOUT and HIST_COSMIC_IHCALOUT dst files. Several runs need to be combined together to get sufficient statistics for the calibration.
0003 The following steps will give one calibration set for a range of runs.
0004
0005 1. Run get_runlist.sh to get runlist.txt, or provide your own runlist.txt
0006
0007 bash get_runlist.sh <start_run> <end_run>
0008
0009 The script will query the FileCatalog database for cosmics runs between <start_run> and <end_run> that have HIST_COSMIC_HCALOUT and HIST_COSMIC_IHCALOUT
0010 datasets available, and write the valid run numbers to runlist.txt.
0011
0012 2. Run do_cosmics_calibration.sh to get cosmics run histograms outputs and new calibration factors and CDB TTrees.
0013
0014 bash do_cosmics_calibration.sh
0015
0016 The script will read runlist.txt, process the runs listed there:
0017
0018 1) It will hadd per-run HIST_COSMIC_HCALOUT and HIST_COSMIC_IHCALOUT dst files into
0019 hist/ohcal_hist_<run>.root and hist/ihcal_hist_<run>.root files.
0020
0021 2) It will then hadd all per-run OHCal and IHCal histograms into a combined .root file each:
0022 hist/ohcal_hist_<min_run>_<max_run>.root and hist/ihcal_hist_<min_run>_<max_run>.root files.
0023
0024 3) It will run function_fitting.C to extract MPV values from the combined histograms. The outputs will be saved in output/ as:
0025 fitresult_ohcal_<min_run>_<max_run>.root and fitresult_ihcal_<min_run>_<max_run>.root
0026 fitcheck_ohcal_<min_run>_<max_run>.root and fitcheck_ihcal_<min_run>_<max_run>.root
0027 ohcal_mpv_<min_run>_<max_run>.txt and ihcal_mpv_<min_run>_<max_run>.txt
0028 The fitresult files contain the MPV fitting results for each tower. The fitcheck files contain the general 2D MPV and hits histograms for visual checking.
0029
0030 4) It will run readhcalcalib.C to read the existing pre-calibration factors used in production from ohcal_precalib.root and ihcal_precalib.root files into txt files.
0031 These .root files should be prepared in advance and placed in the offline/ directory. There are example files provided, and should be the default pre-calibration factors used.
0032 But for best results, one should check the log files from production to see what pre-calibration factors were used, and prepare the ohcal_precalib.root and ihcal_precalib.root
0033
0034 5) It will run get_calibration_factor.C to compute new calibration factors based on the sim and data MPV results and the pre-calibration factors.
0035 The new calibration factor files will be saved to output/ directory as:
0036 ohcal_calibration_factors_<min_run>_<max_run>.txt and ihcal_calibration_factors_<min_run>_<max_run>.txt
0037
0038 6) It will run get_CDBTree.C to form CDB TTrees with the new calibration factors. The CDB TTrees will be saved to output/ directory as:
0039 ohcal_CDBTTree_<min_run>_<max_run>.root and ihcal_CDBTTree_<min_run>_<max_run>.root