Back to home page

sPhenix code displayed by LXR

 
 

    


Warning, /macros/calibrations/calo/tower_slope_run23/README.md is written in an unsupported language. File is not indexed.

0001 Note this folder is simpler subset of previously committed macros in macros/calibrations/calo/tower_slope_macro, 
0002 some of those are out of date due mostly to the removal the DBAccessor class/package in favor of just standard
0003 Conditions Data Base (CDB) data structures.   Also it is very RawTower centric. 
0004 
0005 This folder, and the tower_slope_* macros generally are macros, etc. to run the calibration tool located in 
0006 coresoftware/calibrations/calorimeter/calo_tower_slope/  (the LiteCaloEval.h class)
0007 
0008 **Status of coresoftware/calibrations/calorimeter/calo_tower_slope**
0009 
0010 Current status: contains MDC2 updated relative fitting method using data-defined histogram shape. Currently 
0011 designed to run in two different modes 1) "gain tracing" mode where calibration shift in one time slice file 
0012 is detected from tower energy distributions, quantified, and correction file is generated for, by fitting its
0013 shape with same energy distribution for reference time slice. 2) “Eta slice flattening mode” where a gain shift
0014 in a single tower is detected by defining a phi-integrated histogram (that has the same eta coordinate as the 
0015 tower of interest) that serves as the function that will be fit to a single tower’s energy distribution. The
0016 gain shift in a single tower is defined as  1 / p1, where p1 is a fit parameter extracted from the fit on the 
0017 tower. A correction file is also generated storing a 1/p1 for each tower.  Currently out of date in this corr
0018 file format, will be soon converted to CBDTree objects for both emcal and hcal.
0019 
0020 **Running/Macros**
0021 
0022 dst_simple_towerslope_runmacro.C:   Macro/script for running over real or sim DST files already containing a 
0023 TOWERINFO (or RawTower) container. Outputs tower slope histograms (energy distributions for every tower and some 
0024 integrated regions, such as eta bin slices/rings integrated over phi.)
0025 
0026 **Macros for doing the actual fitting step**
0027 
0028 **For gain trace mode:** do_eta_fit2_<caloname>.C
0029 For flattening ("eta slice/rings") mode: rings_do_eta_fit2_<caloname>.C
0030 <caloname> is either CEMC, HCALIN, or HCALOUT
0031 Both macros have the same exact steps involved, the rings version just uses a different fitting method. 
0032 The fitting step (timeslice1 --> timeslice 2 --see above) should generally be after merging of tower energy 
0033     distribution histogram files (the output of the tower slope module over the mdc2/production data files). 
0034     The last function called in the macro LiteCaloEval::Fit_RelativeShift outputs the correction which can be 
0035     read as input in place of the "Example Simple Database" files above. For CEMC, this is output into the root
0036     file output containing all the other root output (various graphs, etc.) into a tree within that file with
0037     the correct name ("emc_corr_tree"). For the Hcals, for which the correction files should be simple text file 
0038     formats, the correction text file is outputted to: [output_root_filename].HCAL[IN|OUT]_CORR_TXTFILE.txt as an 
0039     additional output file besides the usual output_root_file.
0040 
0041 **To run** \: Each calorimeter has its own macro (see macro folder – /calibrations/calo/tower_slope_macro). More so, each mode as mentioned above has its own macro with the eta slice flattening mode having a prefix of ‘rings’ added to the name (rings_do_eta_fit2_<caloname>.C) See further below under ‘Mode Types’ for more details.
0042 The histogram naming is separated by calotype. The most important ones are individual towers, and the phi-integrated (a.k.a eta slice / eta ring) ones. 
0043     
0044 The histogram names are:
0045 •     EMCal
0046 o       Tower – emc_ietaX_phiY, where X is eta bin and Y is the phi bin
0047 o       Eta slice – eta_X
0048 •     I/OHCal
0049 o       Tower – hcal_<in/out>_eta_X_phi_Y
0050 o       Eta Slice – hcal<in/out>_eta_X
0051 
0052 **Mode Types**
0053         
0054   _The gain trace mode_ macro (do_eta_fit2_<caloname>.C ) takes 3 parameters respectively:
0055 •     Reffile – this parameter should be a root file that contains all merged calo histograms (see Init Run) from a specific run in sims, or whatever time period with real data
0056 •     Infile – this parameter is the exact same file as refile but with modified tower energies, thus modified tower energy distributions
0057 •     Modfile – the output file you want to write to
0058  The very last function used in the macro (FitRelativeShifts) called takes on two parameters. The first is the object, reflce, is the object made in the macro and the second is a parameter that sets several flags. The second variable is an integer and typical value is 10. In the 10’s place (the 1) is for smoothing of histograms [ hist->Smooth( ) ], and the digit in the 1’s place (the 0) is to run over all towers – if it were set to 1, it would only run eta slices. So, typical value for this parameter are 0, 10, or 20. 
0059 
0060   _Flattening mode_ ( rings_do_eta_fit2_<calotype>.C ) takes only 2 parameters:
0061 •     Infile – the same parameter as above. 
0062 •     Modfile – same parameter as above 
0063 
0064 The FitRelativeShifts function call in this macro takes on the same parameters, but the second (the integer mentioned above) takes on 3 numbers. The usual incantation is 110, again where each digit controls a flag (see LiteCaloEval.cc, L940). The hundreds place controls whether or not the flattening mode runs, and the tens and ones place are the same flag as above.
0065 
0066 **Exclusion of Towers in flattening mode**
0067 
0068 In the flattening mode, when a tower is being fit, its histogram is removed from the eta slice histogram. For example, in IHCal, one eta slice histogram contains only 63 towers, not 64. Same concept applies to OHCal and EMCal. 
0069 
0070 The towers that correspond to the chimney sector of OHCal are skipped over, or not fit at all, and also their respective towers are removed from the eta slice histogram. As of now (6/6/23), the towers corresponding from the TPC support rods are also skipped and their towers removed from the eta slice histogram. 
0071 
0072 This code will be generalized soon to use a generic bad tower definition to exclude for the eta slices/rings.
0073   
0074 **Fit Ranges of Spectra**
0075   
0076 For fit  Min/Max fit ranges, see any of the "Macros for doing the fitting step listed above", pretty much most macros in this folder, for examples of setting these.  Fit ranges were determined by trial and error, close to the values used for some latest performance plots as of start of run23 can be found in the macros.
0077 
0078 
0079