-- EsterRicci - 2018-01-30

Alignment calibration loop residual monitoring

Getting residuals from monitoring files

The first step of the alignment residual monitoring is to collect the residuals from the output files produced by the calibration loop. The data are stored inside the /eos/atlas/atlastier0/tzero/caf/IDAlignment/ folder and are divided by year and data type.

Using a bash script it is possible to select the data samples the user is interested to analyse. In the file the grep selection used to collect the files containing the information requred by the macro that collect the data are specified. A different selection can be made if needed.

In the standard version od the loop only the run with more than 3 lumi-block groups are taken into account, and the first 3 lumi-block groups of each run are skipped because of some known stability issues of the detector at the beginning of the runs.

The bash script calls a macro that selects the plot in the monitoring file and collects the residuals in a TTree structure with 10 branches. The combination of values in each entry specifies what part of the detector and which position the residual refers to. A specific entry keeps in memory also the run number.

Variable Value Meaning
detector 1 Pixel
2 SCT
bec 0 Barrel
-2 End Cap C
2 End Cap A
layer 0 - 4 Barrel or End Cap layer
eta_index -8 - 8 η index of the module
phi_index 0 - 50 φ index of the module
dof 1 X direction
2 Y direction
residual   Residual Value
residual_err   Residual value error
It is clear that there are only a limited number of combinations that indicates different components of the detector. Residuals for different ID components are collected from different plots from the alignment calibration loop monitoring files.

ID element Residual plot in alignment CL monitoring file
Pixel Barrel pix_b[layer]_[dof]resvsmodetaphi_3d
Pixel ECC pix_ecc_unbiased_[dof]resvsmodphi_disk[layer]
Pixel ECA pix_eca_unbiased_[dof]resvsmodphi_disk[layer]
SCT Barrel sct_b[layer]_[dof]resvsmodetaphi_3d
SCT ECC sct_ecc_xresvsmodphi_2d
SCT ECA sct_eca_xresvsmodphi_2d
The histograms are 2D and 3D, so to obtain the information in the correct format they are projected and the projection data are collected bin by bin. The collection is performed by a macro from the merged files.

As soon as the data from all the runs have been collected and saved with the proper format it is possible to produce the IBL cumulative distributions and the time evolution monitoring for all the Pixel and SCT layers.

Building of the plots

Residuals have to be collected in a structure to allow a further analysis. Two different structures have been prepared for SCT and Pixel residuals, and they are implemented in three different macros. A suitable number of loops is performed in order to assign each entry of the TTree to the correct detector element. Once the structures have been filled, it is possible to use the stored data to produce all the plots we are interested in. Different macros produce different plots.

The first step of data collection in a vector of custom made structures is the same for all the three macros, that are splitted to simplify the usage in case the user is interested in only one kind of plots or only in a sub-detector. An example of the plots that can be produced by the macro is given at the beginning of each paragraph.

IBL residuals cumulative distribution monitoring

IBL_cumulative.png

The plot report the distribution of the residuals of each IBL module of the stave (in this case stave at φ=0 for non reprocessed 2017 data). The vertical axis reports the residual values, the horizontal axis the counts, the green line marks the 0. A correct alignment would lead all the residuals to 0. In each pad the degree of freedom (DoF), the η and φ of the module are reported. The residual scales for X and Y are different because of the different resolution of the modules.

The maco used to realise the IBL cumulative distribution is a macro that contains 4 different functions:

  • find_residuals: the function collects the residuals from the files and store them in a vector;
  • residual_monitoring: the main macro;
  • residual_cumulative_eta;
  • residual_cumulative_phi;
The main function is residual_monitoring, that requires as argument a file that contains the list of files to collect. The function then creates a vector containing the IBL residuals by calling the find_residual function. The vector is then used to produce the cumulative distributions.

The two residual_cumulative_eta and residual_cumulative_phi macros create the same kind of plots, they differ in the visualization order. The residual_cumulative_eta provides in each page of the output pdf file the residuals cumulative dsitribution for a stave (same φ index), as a function of the η index of the single module, whereas the other function provides the same information collecting in the same page the cumulative distributions for modules with the same η index and different φ index.

The output files are two, residual_cumulative_eta.pdf and residual_cumulative_phi.pdf, one for each analysis function.

Pixel barrel and End Caps time evolution monitoring plots

The macro that produces the plots that monitor the whole pixel detector residuals time evolution are produced by the functions contained in the macro. The file contains 6 different functions:

  • find_residuals_pixel: collects the residuals from the files and store them in a vector;
  • residual_monitoring: main function;
  • residual_pixel_maps: crates the time evolution maps for the barrel layers;
  • residual_ec_maps: crates the time evolution maps for the End Caps;
  • ec_runbyrun: the macro fits the residual distribution with a sinusoidal shape and plots the fit parameters (amplitude and phase) as a function of the run number;
  • pixel_runbyrun: the macro fits the residual distribution with a polynomial function whose degree can be set and produce a time evolution monitoring maps from the fitted values and plot of the fit parameters as a function of the run number.
It is possible to select the plot the user is interested by checking the residual_monitoring function and commenting and uncommenting the correct rows. The function takes as input a file containing the list of files prepared by the previous step of the analysis process.

The functions produces one or more pdf files as output. The name of the files are the following:

Function Output file name File content
residual_pixel_maps residual_map_PIXEL[layer].pdf Map of the residuals as a function of the run number and η index of the module. A file is produced for each layer of the barrel.
pixel_runbyrun l[layer]_PIXEL_singlerun_pol[degree].pdf Residual distribution of each module fit with a polynomial function for each run. A file is produced for each layer of the barrel.
l[layer]_PIXEL_maps_pol[degree].pdf Maps build using the function from the run by run fit of the modules. A file is produced for each layer of the barrel.
par[number]_PIXEL_evolution_pol[degree].pdf Fit function parameter evolution as a function of the run number.
residual_ec_maps pixel_ec_X_maps.pdf Maps of residuals as a function of the run number and the φ index for the X degree of freedom.
pixel_ec_Y_maps.pdf Maps of residuals as a function of the run number and the φ index for the Y degree of freedom.
ec_runbyrun ec_runbyrun_X.pdf Residual distribution of each module fit with a sinusoidal function for each run for the X degree of freedom.
ec_runbyrun_Y.pdf Residual distribution of each module fit with a sinusoidal function for each run for the Y degree of freedom.
ec_runbyrun_par_X.pdf Distribution of the fit parameter as a function of the run number for the X degree of freedom.
ec_runbyrun_par_Y.pdf Distribution of the fit parameter as a function of the run number for the Y degree of freedom.
Pixel_map.png

The plot is reported as an example. All the plots defined as "maps" have a similar behaviour and can be read in the same way. In the x axis the run number is reported as time reference. On the y axis there can be the η index (barrel modules) or the φ index (End Caps). The color scale represent the residual value of each module in each run. In the example plot I report the layer 0 of End Cap C. The map has been obtained using 2017 data non reprocessed.

Another inportant feature of this macro is the analysis of the residual distribution run by run. In the plot the distribution for the Pixel End Cap C in X DoF is reported for a run acquired in 2017. A sinusoidal function is used to fit the data. In the barrel case a polynomial function is used. The parameters collected are used both to create a map to be compared with the one produced using the residual values and to be reported as a function of the run number to monitor their evolution with time.

The plot reports an example of time evolution monitoring for a fit parameter, In this case the amplitude of the sinusoidal function that fits the data. The expected value for this amplitude is 0. The plot refers to the 2017 data before the reprocessing campaign, that were affected by a small systematic effect, corrected with the reprocessing. From the plot it appears that not all the fits are perfectly controlled, but this is not important as long as we are able to follow the general behaviour of the alignment.

SCT barrel and End Caps time evolution monitoring plots

SCT barrel and End Caps time evolution monitoring plots

The SCT monitoring plots are produced by the sct_monitoring.C macro, that contains 5 functions:

  • find_residuals_sct: collects the residuals from the files and store them in a vector;
  • residual_monitoring: main function;
  • residual_sct_maps: it produces the residuals time evolution maps for the barrel layers;
  • residual_ec_maps: it produces the residuals time evolution maps for the End Caps;
  • sct_runbyrun: the function fits the residual distribution of each module of the barrel with a polynomial function whose degree can be set by the user.
The general behaviour of this macro is the same of the previous. The main function, residual_monitoring, takes as argument a file containing the list of files to be analyzed.

Each macro produces one or more pdf files.

Function Output File name Contents
residual_ec_maps sct_ec_maps.pdf Maps of residuals as a function of the run number and the φ index.
residual_sct_maps residual_map_SCT[layer].pdf Map of the residuals as a function of the run number and η index of the module. A file is produced for each layer of the barrel.
sct_runbyrun l[layer]_SCT_singlerun_pol[degree].pdf Residual distribution of each module fit with a polynomial function for each run. A file is produced for each layer of the barrel.
  l[layer]_SCT_maps_pol[degree].pdf Maps build using the function from the run by run fit of the modules. A file is produced for each layer of the barrel.
  par[number]_SCT_evolution_pol[degree].pdf Distribution of the fit parameter as a function of the run number.
Example plots are not provided for this section since they are visually the same of the Pixel plots.

Example: how to run the code

All the macros are thougth to run on lxplus. The first step is to collect the data from the IdAlignment repository. The user can select the year and the data type by modifying the "project" folder in the bash script used to collect the data, and also the iteration and the fast (.c0) or reprocessed (.c00) data.

The code can be launched by typing

$ ./loop.sh

Please notice that this process can last up to several hours.

Once the files have been collected, the user have to produce a file containing a list of the collected data (with the complete path). The list will be used by the analysis macros, that work in root.

$ root -l

$ .L IBL_monitoring.C+

$ residual_monitoring("filelist.txt")

Each macro will produce one or more pdf files with the plots.

Topic attachments
I Attachment History Action Size Date Who Comment
PNGpng IBL_cumulative.png r1 manage 308.1 K 2018-01-30 - 11:40 UnknownUser  
PNGpng Pixel_map.png r1 manage 215.7 K 2018-01-30 - 14:14 UnknownUser  
PNGpng parameter_evolution.png r1 manage 181.8 K 2018-01-30 - 17:40 UnknownUser  
PNGpng pixel_runbyrun.png r1 manage 128.7 K 2018-01-30 - 17:34 UnknownUser  
Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r3 - 2018-01-30 - unknown
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Sandbox All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback