Skip to content
Nicola Amapane edited this page Nov 17, 2015 · 7 revisions

A DT pakage for observed hit residuals, resolution, calibration, internal alignment

...and other stuff we've lost memory of.

Workflow:

  1. Make trees running on RAW or RECO
  2. Process trees and create histogram sets with the desired granularity
  3. Plot the desired features
  4. or produce calibration tables.

1. Making trees

The tree maker is implemented in DTTreeBuilder.cc. The cmsRun configuration is fillDTTree_rereco.py. Here one can specify some options:

  • Use original segments from raw or re-reconstruct them
  • when re-reconstructing, apply additional calibration (t0i, ttrig, vdrift) or internal alignment

Instructions for job submission are here.

2. Process trees and create histogram sets with the desired granularity

The histogram creation tools is implemented in test/root_lib/TTreeReader.cc. It can be run with the root macro test/DTPlotter/readTree.r. Example:

root -q -b 'readTree.r ( "/data/DT/ZMu_2015Dv4_STD/chain.h","ZMu_2015Dv4_STD", "statByView" )'

The first argument is the path of the chain.h produced by submission jobs (see above). The second is the base name of the output file, and the third is the desired granularity for the plots. Supported granularities are (0 = merged)

  • statByView : merge sectors, merge the 2 phi SLs, merge all layers in the SL: Wh,St,Se=0,SL=[(1+3),2],L=0.
  • statBySL: merge sectors, keep the 3 SL separated, merge all layers in the SL: Wh,St,Se=0,SL,L=0.
  • statByLayer: merge sectors, keep all layers separately: Wh,St,Se=0,SL,L.
  • SL : each SL independently; merge all layers in the SL: Wh,St,Se,SL,L=0.
  • chamberByView: all sectors are independent, but merge the 2 phi SLs: Wh,St,Se,SL=[(1+3),2],L=0.
  • chamberByLayer: all layers independent: h,St,Se,SL,L. Produces a LOT of plots!
  • chamberByLayerLR as above, but separate L and R hits. This is useful for alignment studies. Produces a LOT of plots - beware of memory issues.

Also supported but not widely used:

  • absWStatByView: same as statByView but merge + and - wheels
  • station: whole station

Other options can be set within the script (quality cuts, run selection, multiple plot sets etc.)

The output is a root file named as the [second argument]_[granularity].root, eg. ZMu_2015Dv4_STD_statByView.root in this case.

3. Plotter

Plotting tools are located in test/DTPlotter

Plot archiving : the macro printAll("png") will create one pdf for each open canvas, with file names automatically set to include the histogram set, granularity, chamber/SL/layer identifier. "pdf" can also be specified as a format.

Simple plots: plot.r
Produces a set of plots of residuals and 2D correlations for single chambers. eg.

.L plot.r
plot("ZMu_2015Dv4_STD_statByView.root",0,1)

Parameters are: wheel, station, sector, layer, phiSL. sector and layer default to 0 (=all toghether) and must be set only for granularities where sectors and/or layers are filled separately. phiSL defaults to 1 (=both phi SL for *byView g, otherwise set 1/3 to select either phi SL)

A number of plots are implemented, they can be activated editing the script.

20-fold plots: plotAllWS.r
Plot 4x5 plots in a canvas (station x wheel) for residuals, correlations etc. .x plotAllWS.r("ZMu_2015Dv4_STD_statByView.root",0,1)

parameters are sector (0=all for stat* granularity) and SL (1=both phi SLs for *byView granularity)

Other plot sets:
plot12s.r : Compare a given plot for the 12 sectors of a given W/S

Summary tables
fillTTrigTable.r: Prepare table with residuals (can be converted into a ttrig calibration table, see Calibration Tools below). The table can be plotted with the gnuplot script plotTtrig.gnu.

writeSummaryTable_sigma.r: Prepare table with observed resolutions computed from residuals. The table can be plotted with the gnuplot script summaryPlot.gnu.

4. Calibration Tools

Calibration tools are located in test/calib

DumpDBToFile_cfg.py
Dumps the content of a calibration db (t0i, ttrig, vdrift) to a text file for inspection/plotting. The source can be either the content of a GT, or a .db file.

DumpFileToDBcfg.py
Create a .db file from a text file in the format of DumpDBToFile_cfg.py

sumTables.cc
Used to add corrections determined from residuals produced by fillTTrigTable.r to an existing db dump, converting residuals to times with a drift velocity table. Usage:

sumTables <originalTTrig> <originalVdrift <correctionTable>

If originalTTrig = "zero" -> write correction only (converted to ns)