ATLAS Offline Software
Functions
IDAlignMonResidualsAlgCfg Namespace Reference

Functions

def IDAlignMonResidualsAlgCfg (helper, alg, **kwargs)
 

Function Documentation

◆ IDAlignMonResidualsAlgCfg()

def IDAlignMonResidualsAlgCfg.IDAlignMonResidualsAlgCfg (   helper,
  alg,
**  kwargs 
)
Function to configures some algorithms in the monitoring system.

Definition at line 10 of file IDAlignMonResidualsAlgCfg.py.

10 def IDAlignMonResidualsAlgCfg(helper, alg, **kwargs):
11  '''Function to configures some algorithms in the monitoring system.'''
12 
13  #Values
14  m_nBinsMuRange = 101
15  m_muRangeMin = -0.5
16  m_muRangeMax = 100.5
17  m_minSiResFillRange = -0.08
18  m_maxSiResFillRange = 0.08
19  m_siliconBarrelLayers = 12
20  m_siliconECLayers = 24
21  m_RangeOfPullHistos = 6
22  m_minPIXResYFillRange = -0.4
23  m_maxPIXResYFillRange = 0.4
24  m_FinerBinningFactor = 1
25  strawRadius = 2.5
26  m_EtaModulesPix = [20, 13, 13, 13]
27  m_EtaModulesMinPix = [-10.5, -6.5, -6.5, -6.5]
28  m_EtaModulesMaxPix = [9.5, 6.5, 6.5, 6.5]
29  m_PhiModules = [14, 22, 38, 52]
30  m_PhiModulesShift_barrel = 158
31  m_EtaModulesShift_barrel = 92
32  m_PhiModulesPerRing = 48
33  m_PhiModulesShift_ec = 152
34  m_EtaModulesSCT = 13
35  m_EtaModulesSCTEC = 3
36  m_EtaModulesMinSCT = -6.5
37  m_EtaModulesMaxSCT = 6.5
38  m_PhiModulesSCT = [32, 40 ,48 ,56]
39  m_PhiModulesSCTEC = 52
40  m_PhiModulesShift_sct_barrel = 208
41  m_EtaModulesShift_sct_barrel = 84
42  m_PhiModulesShift_sct_ec = 500
43  m_minTRTResWindow = -1.0
44  m_maxTRTResWindow = 1.0
45  m_TRTB_nSectorBins = 32
46  m_TRTEC_nPhiBins = 8
47 
48  # Set a folder name from the user options
49  folderName = "ExtendedTracks"
50  if "TrackName" in kwargs:
51  folderName = kwargs["TrackName"]
52 
53  # this creates a "residualGroup" called "alg" which will put its histograms into the subdirectory "Residuals"
54  residualGroup = helper.addGroup(alg, 'Residuals')
55  pathResiduals = '/IDAlignMon/'+folderName+'/Residuals'
56 
57  # Histograms for the Alignment Residual monitoring:
58  varName = 'm_mu;mu_perEvent'
59  title = 'mu_perEvent;#LT#mu#GT per event;Events'
60  residualGroup.defineHistogram(varName, type='TH1F', path=pathResiduals, title=title, xbins=m_nBinsMuRange, xmin=m_muRangeMin, xmax=m_muRangeMax)
61 
62  varName = 'm_detType;sirescalcfailure'
63  title = 'Hits with ResidualPullCalculator problem;Events;DetType'
64  residualGroup.defineHistogram(varName, type='TH1F', path=pathResiduals, title=title, xbins=2, xmin=0, xmax=2)
65 
66 
67  #TRT Barrel Plots
68  layersTRTB = ['', 'Side_A', 'Side_C']
69  predictedRBArray = helper.addArray([len(layersTRTB)], alg, 'TRTPredictedRB', topPath = pathResiduals)
70  for postfix, tool in predictedRBArray.Tools.items():
71  layer = layersTRTB[int( postfix.split('_')[1] )]
72  title = ('Measured drift radius from TRT Barrel %s' % layer) + ';Predicted Drift Radius [mm];Entries'
73  name = 'm_trt_b_PredictedR;trt_b_PredictedR' + layer
74  tool.defineHistogram(name, title = title, type = 'TH1F', xbins = 100 , xmin = -strawRadius , xmax = strawRadius)
75 
76  measuredRBArray = helper.addArray([len(layersTRTB)], alg, 'TRTMeasuredRB', topPath = pathResiduals)
77  for postfix, tool in measuredRBArray.Tools.items():
78  layer = layersTRTB[int( postfix.split('_')[1] )]
79  title = ('Measured at drift radius for TRT Barrel %s' % layer) + ';Measured Drift Radius [mm];Entries'
80  name = 'm_trt_b_MeasuredR;trt_b_MeasuredR' + layer
81  tool.defineHistogram(name, title = title, type = 'TH1F', xbins = 100 , xmin = -strawRadius , xmax = strawRadius)
82 
83  residualRBArray = helper.addArray([len(layersTRTB)], alg, 'TRTResidualRB', topPath = pathResiduals)
84  for postfix, tool in residualRBArray.Tools.items():
85  layer = layersTRTB[int( postfix.split('_')[1] )]
86  title = ('UnBiased Residual for the TRT %s' % layer) + ';Residual [mm];Entries'
87  name = 'm_trt_b_residualR;trt_b_residualR' + layer
88  tool.defineHistogram(name, title = title, type = 'TH1F', xbins = 100 * m_FinerBinningFactor, xmin = m_minTRTResWindow , xmax = m_maxTRTResWindow)
89 
90  pullRBArray = helper.addArray([len(layersTRTB)], alg, 'TRTPullRB', topPath = pathResiduals)
91  for postfix, tool in pullRBArray.Tools.items():
92  layer = layersTRTB[int( postfix.split('_')[1] )]
93  title = ('Pull for the TRT %s' % layer) + ';Pull;Entries'
94  name = 'm_trt_b_pullR;trt_b_pullR' + layer
95  tool.defineHistogram(name, title = title, type = 'TH1F', xbins = 100, xmin = -m_RangeOfPullHistos , xmax = m_RangeOfPullHistos)
96 
97  residualRNoTubeBArray = helper.addArray([len(layersTRTB)], alg, 'TRTResidualRNoTubeB', topPath = pathResiduals)
98  for postfix, tool in residualRNoTubeBArray.Tools.items():
99  layer = layersTRTB[int( postfix.split('_')[1] )]
100  title = ('UnBiased Residual (notube) for the TRT %s' % layer) + ';Residual [mm];Entries'
101  name = 'm_trt_b_residualR_notube;trt_b_residualR' + layer + '_notube'
102  tool.defineHistogram(name, title = title, type = 'TH1F', xbins = 100 * m_FinerBinningFactor, xmin = m_minTRTResWindow , xmax = m_maxTRTResWindow)
103 
104  pullRNoTubeBArray = helper.addArray([len(layersTRTB)], alg, 'TRTPullRNoTubeB', topPath = pathResiduals)
105  for postfix, tool in pullRNoTubeBArray.Tools.items():
106  layer = layersTRTB[int( postfix.split('_')[1] )]
107  title = ('Pull (notube) for the TRT %s' % layer) + ';Pull;Entries'
108  name = 'm_trt_b_pullR_notube;trt_b_pullR_notube' + layer
109  tool.defineHistogram(name, title = title, type = 'TH1F', xbins = 100, xmin = -m_RangeOfPullHistos , xmax = m_RangeOfPullHistos)
110 
111  lrBArray = helper.addArray([len(layersTRTB)], alg, 'TRTLRB', topPath = pathResiduals)
112  for postfix, tool in lrBArray.Tools.items():
113  layer = layersTRTB[int( postfix.split('_')[1] )]
114  title = ('|0= LRcor !isTube | 1= LRcor isTube| 2= !LRcor !isTube | 3= !LRcor isTube %s' % layer) + ';;Entries'
115  name = 'm_trt_b_lr;trt_b_lr' + layer
116  tool.defineHistogram(name, title = title, type = 'TH1F', xbins = 4, xmin = 0 , xmax = 4)
117 
118  #Plots for A+C,A,C over Barrel layer 0,1,2
119  layTRTB = ['0', '1', '2']
120  resvsEtaBArray = helper.addArray([len(layersTRTB),len(layTRTB)], alg, 'TRTResVsEtaB', topPath = pathResiduals)
121  for postfix, tool in resvsEtaBArray.Tools.items():
122  layer = layersTRTB[int( postfix.split('_')[1] )]
123  lay = layTRTB[int( postfix.split('_')[2] )]
124  title = ('Average Residual vs Track Eta for TRT Barrel module layer %s %s' % (lay,layer)) + ';Track Eta;Average Residual [mm]'
125  name = 'm_trt_b_aveResVsTrackEta, m_trt_b_residualR;trt_b_aveResVsTrackEta_l' + lay + layer
126  tool.defineHistogram(name, title = title, type = 'TProfile', xbins = 20, xmin = -2.5 , xmax = 2.5, ymin = -1.0 , ymax = 1.0)
127 
128  resVsPhiSecBArray = helper.addArray([len(layersTRTB),len(layTRTB)], alg, 'TRTResVsPhiSecB', topPath = pathResiduals)
129  for postfix, tool in resVsPhiSecBArray.Tools.items():
130  layer = layersTRTB[int( postfix.split('_')[1] )]
131  lay = layTRTB[int( postfix.split('_')[2] )]
132  title = ('Average Residual vs PhiSec for TRT Barrel Layer %s %s' % (lay,layer)) + ';Phi Sector;Average Residual [mm]'
133  name = 'm_trt_b_PhiSec,m_trt_b_residualR;trt_b_aveRes_l' + lay +layer
134  tool.defineHistogram(name, title = title, type = 'TProfile', xbins = m_TRTB_nSectorBins, xmin = -0.5 , xmax = 31.5, ymin = -1.0 , ymax = 1.0)
135 
136  lrVsPhiSecBArray = helper.addArray([len(layersTRTB),len(layTRTB)], alg, 'TRTLRVsPhiSecB', topPath = pathResiduals)
137  for postfix, tool in lrVsPhiSecBArray.Tools.items():
138  layer = layersTRTB[int( postfix.split('_')[1] )]
139  lay = layTRTB[int( postfix.split('_')[2] )]
140  title = ('LR assignment vs Phi Sector for TRT Barrel Layer %s %s' % (lay,layer)) + ';Phi Sector;fraction of LR assignment correct'
141  name = 'm_trt_b_PhiSec,m_trt_b_lrVsPhiSec;trt_b_lr_l' + lay + layer
142  tool.defineHistogram(name, title = title, type = 'TProfile', xbins = m_TRTB_nSectorBins, xmin = -0.5 , xmax = 31.5)
143 
144 
145  #TRT EndCap Plots
146  layersTRTEC = ['Endcap_A', 'Endcap_C']
147  predictedRECArray = helper.addArray([len(layersTRTEC)], alg, 'TRTPredictedREC', topPath = pathResiduals)
148  for postfix, tool in predictedRECArray.Tools.items():
149  layer = layersTRTEC[int( postfix.split('_')[1] )]
150  title = ('Predicted drift radius for TRT %s' % layer) + ';Predicted Drift Radius [mm];Entries'
151  name = 'm_trt_ec_PredictedR;trt_ec_PredictedR' + layer
152  tool.defineHistogram(name, title = title, type = 'TH1F', xbins = 100 , xmin = -strawRadius , xmax = strawRadius)
153 
154  measuredRECArray = helper.addArray([len(layersTRTEC)], alg, 'TRTMeasuredREC', topPath = pathResiduals)
155  for postfix, tool in measuredRECArray.Tools.items():
156  layer = layersTRTEC[int( postfix.split('_')[1] )]
157  title = ('Measured at line drift radius from TRT %s' % layer) + ';Measured Drift Radius [mm];Entries'
158  name = 'm_trt_ec_MeasuredR;trt_ec_MeasuredR' + layer
159  tool.defineHistogram(name, title = title, type = 'TH1F', xbins = 100 , xmin = -strawRadius , xmax = strawRadius)
160 
161  residualRECArray = helper.addArray([len(layersTRTEC)], alg, 'TRTResidualREC', topPath = pathResiduals)
162  for postfix, tool in residualRECArray.Tools.items():
163  layer = layersTRTEC[int( postfix.split('_')[1] )]
164  title = ('UnBiased Residual for TRT %s' % layer) + ';Residual [mm];Entries'
165  name = 'm_trt_ec_residualR;trt_ec_residualR' + layer
166  tool.defineHistogram(name, title = title, type = 'TH1F', xbins = 200, xmin = m_minTRTResWindow , xmax = m_maxTRTResWindow)
167 
168  pullRECArray = helper.addArray([len(layersTRTEC)], alg, 'TRTPullREC', topPath = pathResiduals)
169  for postfix, tool in pullRECArray.Tools.items():
170  layer = layersTRTEC[int( postfix.split('_')[1] )]
171  title = ('Pull for TRT %s' % layer) + ';Pull;Entries'
172  name = 'm_trt_ec_pullR;trt_ec_pullR_' + layer
173  tool.defineHistogram(name, title = title, type = 'TH1F', xbins = 100, xmin = -m_RangeOfPullHistos , xmax = m_RangeOfPullHistos)
174 
175  pullRNoTubeECArray = helper.addArray([len(layersTRTEC)], alg, 'TRTPullRNoTubeEC', topPath = pathResiduals)
176  for postfix, tool in pullRNoTubeECArray.Tools.items():
177  layer = layersTRTEC[int( postfix.split('_')[1] )]
178  title = ('Pull (notube) for TRT %s' % layer) + ';Pull;Entries'
179  name = 'm_trt_ec_pullR_notube;trt_ec_pullR_notube_' + layer
180  tool.defineHistogram(name, title = title, type = 'TH1F', xbins = 100, xmin = -m_RangeOfPullHistos , xmax = m_RangeOfPullHistos)
181 
182  residualRECArray = helper.addArray([len(layersTRTEC)], alg, 'TRTResidualRNoTubeEC', topPath = pathResiduals)
183  for postfix, tool in residualRECArray.Tools.items():
184  layer = layersTRTEC[int( postfix.split('_')[1] )]
185  title = ('UnBiased Residual (notube) for TRT %s' % layer) + ';Residual [mm];Entries'
186  name = 'm_trt_ec_residualR_notube;trt_ec_residualR_notube' + layer
187  tool.defineHistogram(name, title = title, type = 'TH1F', xbins = 200, xmin = m_minTRTResWindow , xmax = m_maxTRTResWindow)
188 
189  lrECArray = helper.addArray([len(layersTRTEC)], alg, 'TRTLREC', topPath = pathResiduals)
190  for postfix, tool in lrECArray.Tools.items():
191  layer = layersTRTEC[int( postfix.split('_')[1] )]
192  title = ('|0= LRcor !isTube | 1= LRcor isTube| 2= !LRcor !isTube | 3= !LRcor isTube %s' % layer) + ';;Entries'
193  name = 'm_trt_ec_lr;trt_ec_lr' + layer
194  tool.defineHistogram(name, title = title, type = 'TH1F', xbins = 4, xmin = 0 , xmax = 4)
195 
196  resvsEtaECArray = helper.addArray([len(layersTRTEC)], alg, 'TRTResVsEtaEC', topPath = pathResiduals)
197  for postfix, tool in resvsEtaECArray.Tools.items():
198  layer = layersTRTEC[int( postfix.split('_')[1] )]
199  title = ('Average Residual vs Eta for TRT %s' % layer) + ';Track Eta;Residual [mm]'
200  name = 'm_trt_ec_aveResVsTrackEta, m_trt_ec_residualR;trt_ec_aveResVsTrackEta_' + layer
201  tool.defineHistogram(name, title = title, type = 'TProfile', xbins = 20, xmin = -2.5 , xmax = 2.5, ymin = -1.0, ymax = 1.0)
202 
203  resVsPhiSecECArray = helper.addArray([len(layersTRTEC)], alg, 'TRTResVsPhiEC', topPath = pathResiduals)
204  for postfix, tool in resVsPhiSecECArray.Tools.items():
205  layer = layersTRTEC[int( postfix.split('_')[1] )]
206  title = ('Average Residual vs PhiSec for TRT %s' % layer) + ';Phi Sector;Average Residual [mm]'
207  name = 'm_trt_ec_phi,m_trt_ec_residualR;trt_ec_aveResVsPhiSec_' + layer
208  tool.defineHistogram(name, title = title, type = 'TProfile', xbins = m_TRTEC_nPhiBins, xmin = -0.5 , xmax = 31.5, ymin = -1.0, ymax = 1.0)
209 
210  lrVsPhiSecECArray = helper.addArray([len(layersTRTEC)], alg, 'TRTLRVsPhiEC', topPath = pathResiduals)
211  for postfix, tool in lrVsPhiSecECArray.Tools.items():
212  layer = layersTRTEC[int( postfix.split('_')[1] )]
213  title = ('LR assignment vs Phi Sector for TRT %s' % layer) + ';Phi Sector;fraction of LR assignment correct'
214  name = 'm_trt_ec_phi,m_trt_ec_lrVsPhiSec;trt_ec_lrVsPhiSec_' + layer
215  tool.defineHistogram(name, title = title, type = 'TProfile', xbins = m_TRTEC_nPhiBins, xmin = -0.5 , xmax = m_TRTEC_nPhiBins - 0.5)
216 
217 
218  #Silicon Plots
219  #Common for Pixel and SCT, barrel and Endcaps
220  varName = 'm_si_residualx;si_residualx'
221  title = 'Silicon UnBiased X Residual;Residual [mm];Events'
222  residualGroup.defineHistogram(varName, type='TH1F', path=pathResiduals, title=title, xbins=100, xmin=m_minSiResFillRange, xmax=m_maxSiResFillRange)
223 
224  varName = 'm_si_b_residualx;si_b_residualx'
225  title = 'Silicon Barrel Only UnBiased X Residual;Residual [mm];Events'
226  residualGroup.defineHistogram(varName, type='TH1F', path=pathResiduals, title=title, xbins=100, xmin=m_minSiResFillRange, xmax=m_maxSiResFillRange)
227 
228  varName = 'm_layerDisk_si, m_si_barrel_resX;si_barrel_resX'
229  title = 'Residual X vs Silicon Barrel Layer;Layer;Residual [mm]'
230  residualGroup.defineHistogram(varName, type='TH2F', path=pathResiduals, title=title, xbins=m_siliconBarrelLayers, xmin=-0.5, xmax=m_siliconBarrelLayers-0.5, ybins=100 * m_FinerBinningFactor, ymin=m_minSiResFillRange, ymax=m_maxSiResFillRange)
231 
232  varName = 'm_layerDisk_si, m_si_barrel_resY;si_barrel_resY'
233  title = 'Residual Y vs Silicon Barrel Layer;Layer;Residual [mm]'
234  residualGroup.defineHistogram(varName, type='TH2F', path=pathResiduals, title=title, xbins=m_siliconBarrelLayers, xmin=-0.5, xmax=m_siliconBarrelLayers-0.5, ybins=100 * m_FinerBinningFactor, ymin=m_minPIXResYFillRange, ymax=m_maxPIXResYFillRange)
235 
236  varName = 'm_layerDisk_si, m_si_barrel_pullX;si_barrel_pullX'
237  title = 'Pull X vs Silicon Barrel Layer;Layer;Pull'
238  residualGroup.defineHistogram(varName, type='TH2F', path=pathResiduals, title=title, xbins=m_siliconBarrelLayers, xmin=-0.5, xmax=m_siliconBarrelLayers-0.5, ybins=100, ymin=-m_RangeOfPullHistos, ymax=m_RangeOfPullHistos)
239 
240  varName = 'm_layerDisk_si, m_si_barrel_pullY;si_barrel_pullY'
241  title = 'Pull Y vs Silicon Barrel Layer;Layer;Pull'
242  residualGroup.defineHistogram(varName, type='TH2F', path=pathResiduals, title=title, xbins=m_siliconBarrelLayers, xmin=-0.5, xmax=m_siliconBarrelLayers-0.5, ybins=100, ymin=-m_RangeOfPullHistos, ymax=m_RangeOfPullHistos)
243 
244  varName = 'm_layerDisk_si, m_si_eca_resX;si_eca_resX'
245  title = 'Residual X vs Silicon ECA Layer;Residual [mm]'
246  residualGroup.defineHistogram(varName, type='TH2F', path=pathResiduals, title=title, xbins=m_siliconECLayers, xmin=-0.5, xmax=m_siliconECLayers-0.5, ybins=100 * m_FinerBinningFactor, ymin=m_minSiResFillRange, ymax=m_maxSiResFillRange)
247 
248  varName = 'm_layerDisk_si, m_si_eca_resY;si_eca_resY'
249  title = 'Residual Y vs Silicon ECA Layer;Layer;Residual [mm]'
250  residualGroup.defineHistogram(varName, type='TH2F', path=pathResiduals, title=title, xbins=m_siliconECLayers, xmin=-0.5, xmax=m_siliconECLayers-0.5, ybins=100 * m_FinerBinningFactor, ymin=m_minPIXResYFillRange, ymax=m_maxPIXResYFillRange)
251 
252  varName = 'm_layerDisk_si, m_si_eca_pullX;si_eca_pullX'
253  title = 'Pull X vs Silicon ECA Layer;Layer;Pull'
254  residualGroup.defineHistogram(varName, type='TH2F', path=pathResiduals, title=title, xbins=m_siliconECLayers, xmin=-0.5, xmax=m_siliconECLayers-0.5, ybins=100, ymin=-m_RangeOfPullHistos, ymax=m_RangeOfPullHistos)
255 
256  varName = 'm_layerDisk_si, m_si_eca_pullY;si_eca_pullY'
257  title = 'Pull Y vs Silicon ECA Layer;Layer;Pull'
258  residualGroup.defineHistogram(varName, type='TH2F', path=pathResiduals, title=title, xbins=m_siliconECLayers, xmin=-0.5, xmax=m_siliconECLayers-0.5, ybins=100, ymin=-m_RangeOfPullHistos, ymax=m_RangeOfPullHistos)
259 
260  varName = 'm_layerDisk_si, m_si_ecc_resX;si_ecc_resX'
261  title = 'Residual X vs Silicon ECC Layer;Layer;Residual [mm]'
262  residualGroup.defineHistogram(varName, type='TH2F', path=pathResiduals, title=title, xbins=m_siliconECLayers, xmin=-0.5, xmax=m_siliconECLayers-0.5, ybins=100 * m_FinerBinningFactor, ymin=m_minSiResFillRange, ymax=m_maxSiResFillRange)
263 
264  varName = 'm_layerDisk_si, m_si_ecc_resY;si_ecc_resY'
265  title = 'Residual Y vs Silicon ECC Layer;Layer;Residual [mm]'
266  residualGroup.defineHistogram(varName, type='TH2F', path=pathResiduals, title=title, xbins=m_siliconECLayers, xmin=-0.5, xmax=m_siliconECLayers-0.5, ybins=100 * m_FinerBinningFactor, ymin=m_minPIXResYFillRange, ymax=m_maxPIXResYFillRange)
267 
268  varName = 'm_layerDisk_si, m_si_ecc_pullX;si_ecc_pullX'
269  title = 'Pull X vs Silicon ECA Layer;Layer;Pull'
270  residualGroup.defineHistogram(varName, type='TH2F', path=pathResiduals, title=title, xbins=m_siliconECLayers, xmin=-0.5, xmax=m_siliconECLayers-0.5, ybins=100, ymin=-m_RangeOfPullHistos, ymax=m_RangeOfPullHistos)
271 
272  varName = 'm_layerDisk_si, m_si_ecc_pullY;si_ecc_pullY'
273  title = 'Pull Y vs Silicon ECC Layer;Layer;Pull'
274  residualGroup.defineHistogram(varName, type='TH2F', path=pathResiduals, title=title, xbins=m_siliconECLayers, xmin=-0.5, xmax=m_siliconECLayers-0.5, ybins=100, ymin=-m_RangeOfPullHistos, ymax=m_RangeOfPullHistos)
275 
276 
277  #Pixel Barrel Plots
278  varName = 'm_pix_b_residualx;pix_b_residualx'
279  title = 'UnBiased X Residual Pixel Barrel;Residual [mm];Events'
280  residualGroup.defineHistogram(varName, type='TH1F', path=pathResiduals, title=title, xbins=100, xmin=m_minSiResFillRange, xmax=m_maxSiResFillRange)
281 
282  varName = 'm_pix_b_biased_residualx;pix_b_biasedresidualx'
283  title = 'Biased X Residual Pixel Barrel;Residual [mm];Events'
284  residualGroup.defineHistogram(varName, type='TH1F', path=pathResiduals, title=title, xbins=100, xmin=m_minSiResFillRange, xmax=m_maxSiResFillRange)
285 
286  varName = 'm_pix_b_residualy;pix_b_residualy'
287  title = 'UnBiased Y Residual Pixel Barrel;Residual [mm];Events'
288  residualGroup.defineHistogram(varName, type='TH1F', path=pathResiduals, title=title, xbins=100, xmin=m_minPIXResYFillRange, xmax=m_maxPIXResYFillRange)
289 
290  varName = 'm_pix_b_biased_residualy;pix_b_biasedresidualy'
291  title = 'Biased Y Residual Pixel Barrel;Residual [mm];Events'
292  residualGroup.defineHistogram(varName, type='TH1F', path=pathResiduals, title=title, xbins=100, xmin=m_minPIXResYFillRange, xmax=m_maxPIXResYFillRange)
293 
294  layersPix = ['0', '1', '2', '3']
295  layersName = ['IBL','B-layer','1','2']
296  residualXArray = helper.addArray([len(layersPix)], alg, 'PixResidualX', topPath = pathResiduals)
297  for postfix, tool in residualXArray.Tools.items():
298  layer = layersPix[int( postfix.split('_')[1] )]
299  title = ('UnBiased X Residual Pixel Barrel %s' % layersName[int(layer)])
300  name = 'm_pix_residualsx;pix_b' + layer + '_residualx'
301  tool.defineHistogram(name, title = title, type = 'TH1F',
302  xbins = 100 * m_FinerBinningFactor, xmin = m_minSiResFillRange, xmax = m_maxSiResFillRange)
303 
304  residualYArray = helper.addArray([len(layersPix)], alg, 'PixResidualY', topPath = pathResiduals)
305  for postfix, tool in residualYArray.Tools.items():
306  layer = layersPix[int( postfix.split('_')[1] )]
307  title = ('UnBiased Y Residual Pixel Barrel %s' % layersName[int(layer)])
308  name = 'm_pix_residualsy;pix_b' + layer + '_residualy'
309  tool.defineHistogram(name, title = title, type = 'TH1F',
310  xbins = 100 * m_FinerBinningFactor, xmin = m_minPIXResYFillRange, xmax = m_maxPIXResYFillRange)
311 
312  # Define local X,Y 3D histograms (not really 3D histograms but TProfile 2D)
313  residualX2DProfArray = helper.addArray([len(layersPix)], alg, 'PixResidualX_2DProf', topPath = pathResiduals)
314  for postfix, tool in residualX2DProfArray.Tools.items():
315  layer = layersPix[int( postfix.split('_')[1] )]
316  title = ('Local X Residual vs Module Eta-Phi-ID Pixel Barrel layer %s; Mod Eta; Mod Phi; Local X Residual [mm]' % layersName[int(layer)])
317  name = 'm_modEta,m_modPhi,m_pix_residualsx;pix_b' + layer + '_xresvsmodetaphi_2dprof'
318  tool.defineHistogram(name, title = title, type = 'TProfile2D', xbins = m_EtaModulesPix[int(layer)], xmin = m_EtaModulesMinPix[int(layer)], xmax = m_EtaModulesMaxPix[int(layer)],
319  ybins = m_PhiModules[int(layer)], ymin = -0.5, ymax = m_PhiModules[int(layer)] - 0.5,
320  zmin = m_minSiResFillRange, zmax = m_maxSiResFillRange)
321 
322  residualY2DProfArray = helper.addArray([len(layersPix)], alg, 'PixResidualY_2DProf', topPath = pathResiduals)
323  for postfix, tool in residualY2DProfArray.Tools.items():
324  layer = layersPix[int( postfix.split('_')[1] )]
325  title = ('Local Y Residual vs Module Eta-Phi-ID Pixel Barrel layer %s; Mod Eta; Mod Phi; Local Y Residual [mm]' % layersName[int(layer)])
326  name = 'm_modEta,m_modPhi,m_pix_residualsy;pix_b' + layer + '_yresvsmodetaphi_2dprof'
327  tool.defineHistogram(name, title = title, type = 'TProfile2D', xbins = m_EtaModulesPix[int(layer)], xmin = m_EtaModulesMinPix[int(layer)], xmax = m_EtaModulesMaxPix[int(layer)],
328  ybins = m_PhiModules[int(layer)], ymin = -0.5, ymax = m_PhiModules[int(layer)] - 0.5,
329  zmin = m_minPIXResYFillRange, zmax = m_maxPIXResYFillRange)
330 
331  pullXArray = helper.addArray([len(layersPix)], alg, 'PixPullX', topPath = pathResiduals)
332  for postfix, tool in pullXArray.Tools.items():
333  layer = layersPix[int( postfix.split('_')[1] )]
334  title = ('UnBiased X Pull Pixel Barrel %s' % layer) + ';Pull'
335  name = 'm_pix_pullsx;pix_b' + layer + '_pullx'
336  tool.defineHistogram(name, title = title, type = 'TH1F',
337  xbins = 100 * m_FinerBinningFactor, xmin = -m_RangeOfPullHistos, xmax = m_RangeOfPullHistos)
338 
339  pullYArray = helper.addArray([len(layersPix)], alg, 'PixPullY', topPath = pathResiduals)
340  for postfix, tool in pullYArray.Tools.items():
341  layer = layersPix[int( postfix.split('_')[1] )]
342  title = ('UnBiased Y Pull Pixel Barrel %s' % layer) + ';Pull'
343  name = 'm_pix_pullsy;pix_b' + layer + '_pully'
344  tool.defineHistogram(name, title = title, type = 'TH1F',
345  xbins = 100 * m_FinerBinningFactor, xmin = -m_RangeOfPullHistos, xmax = m_RangeOfPullHistos)
346 
347  resXvsEtaArray = helper.addArray([len(layersPix)], alg, 'PixResidualXvsEta', topPath = pathResiduals)
348  for postfix, tool in resXvsEtaArray.Tools.items():
349  layer = layersPix[int( postfix.split('_')[1] )]
350  layerInd = int(layer)
351  EtaModules = m_EtaModulesPix[layerInd]
352  EtaModulesMin = m_EtaModulesMinPix[layerInd]
353  EtaModulesMax = m_EtaModulesMaxPix[layerInd]
354  title = ('X Residual Distribution vs Module Eta-ID Pixel Barrel %s' % layer) + ';Mod Eta;Residual [mm]'
355  name = 'm_modEta,m_residualX;pix_b' + layer + '_xresidualvseta_2d'
356  tool.defineHistogram(name, title = title, type = 'TH2F',
357  xbins = EtaModules, xmin = EtaModulesMin, xmax = EtaModulesMax,
358  ybins = 50 * m_FinerBinningFactor, ymin = m_minSiResFillRange, ymax = m_maxSiResFillRange)
359 
360  resYvsEtaArray = helper.addArray([len(layersPix)], alg, 'PixResidualYvsEta', topPath = pathResiduals)
361  for postfix, tool in resYvsEtaArray.Tools.items():
362  layer = layersPix[int( postfix.split('_')[1] )]
363  layerInd = int(layer)
364  EtaModules = m_EtaModulesPix[layerInd]
365  EtaModulesMin = m_EtaModulesMinPix[layerInd]
366  EtaModulesMax = m_EtaModulesMaxPix[layerInd]
367  title = ('Y Residual Distribution vs Module Eta-ID Pixel Barrel %s' % layer) + ';Mod Eta;Residual [mm]'
368  name = 'm_modEta,m_residualY;pix_b' + layer + '_yresidualvseta_2d'
369  tool.defineHistogram(name, title = title, type = 'TH2F',
370  xbins = EtaModules, xmin = EtaModulesMin, xmax = EtaModulesMax,
371  ybins = 50 * m_FinerBinningFactor, ymin = m_minPIXResYFillRange, ymax = m_maxPIXResYFillRange)
372 
373  resXvsPhiArray = helper.addArray([len(layersPix)], alg, 'PixResidualXvsPhi', topPath = pathResiduals)
374  for postfix, tool in resXvsPhiArray.Tools.items():
375  layer = layersPix[int( postfix.split('_')[1] )]
376  layerInd = int(layer)
377  PhiModules = m_PhiModules[layerInd]
378  title = ('X Residual Distribution vs Module Phi-ID Pixel Barrel %s' % layer) + ';Mod Phi;Residual [mm]'
379  name = 'm_modPhi,m_residualX;pix_b' + layer + '_xresidualvsphi_2d'
380  tool.defineHistogram(name, title = title, type = 'TH2F',
381  xbins = PhiModules, xmin = - 0.5, xmax = PhiModules - 0.5,
382  ybins = 50 * m_FinerBinningFactor, ymin = m_minSiResFillRange, ymax = m_maxSiResFillRange)
383 
384  resYvsPhiArray = helper.addArray([len(layersPix)], alg, 'PixResidualYvsPhi', topPath = pathResiduals)
385  for postfix, tool in resYvsPhiArray.Tools.items():
386  layer = layersPix[int( postfix.split('_')[1] )]
387  layerInd = int(layer)
388  PhiModules = m_PhiModules[layerInd]
389  title = ('Y Residual Distribution vs Module Phi-ID Pixel Barrel %s' % layer) + ';Mod Phi;Residual [mm]'
390  name = 'm_modPhi,m_residualY;pix_b' + layer + '_yresidualvsphi_2d'
391  tool.defineHistogram(name, title = title, type = 'TH2F',
392  xbins = PhiModules, xmin = - 0.5, xmax = PhiModules - 0.5,
393  ybins = 50 * m_FinerBinningFactor, ymin = m_minPIXResYFillRange, ymax = m_maxPIXResYFillRange)
394 
395  varName = 'm_modPhiShift_barrel,m_residualX_barrel;pix_b_xresvsmodphi_profile'
396  title = 'X Residual Mean vs (Modified) Module Phi-ID Pixel Barrel;(Modified) Phi-ID;Residual [mm]'
397  residualGroup.defineHistogram(varName, title = title, type = 'TProfile', path=pathResiduals,
398  xbins = m_PhiModulesShift_barrel, xmin = 0, xmax = m_PhiModulesShift_barrel)
399 
400  varName = 'm_modPhiShift_barrel,m_residualY_barrel;pix_b_yresvsmodphi_profile'
401  title = 'Y Residual Mean vs (Modified) Module Phi-ID Pixel Barrel;(Modified) Phi-ID;Residual [mm]'
402  residualGroup.defineHistogram(varName, title = title, type = 'TProfile', path=pathResiduals,
403  xbins = m_PhiModulesShift_barrel, xmin = 0, xmax = m_PhiModulesShift_barrel)
404 
405  varName = 'm_modEtaShift_barrel,m_residualX_barrel;pix_b_xresvsmodeta_profile'
406  title = 'X Residual Mean vs (Modified) Module Eta-ID Pixel Barrel;(Modified) Eta-ID;Residual [mm]'
407  residualGroup.defineHistogram(varName, title = title, type = 'TProfile', path=pathResiduals,
408  xbins = m_EtaModulesShift_barrel, xmin = 0, xmax = m_EtaModulesShift_barrel)
409 
410  varName = 'm_modEtaShift_barrel,m_residualY_barrel;pix_b_yresvsmodeta_profile'
411  title = 'Y Residual Mean vs (Modified) Module Eta-ID Pixel Barrel;(Modified) Eta-ID;Residual [mm]'
412  residualGroup.defineHistogram(varName, title = title, type = 'TProfile', path=pathResiduals,
413  xbins = m_EtaModulesShift_barrel, xmin = 0, xmax = m_EtaModulesShift_barrel)
414 
415  #Pixel EndCap A plots
416  layersECPix = ['0', '1', '2']
417  varName = 'm_pix_eca_residualx;pix_eca_residualx'
418  title = 'UnBiased X Residual Pixel EndCap A;Residual [mm]'
419  residualGroup.defineHistogram(varName, type='TH1F', path=pathResiduals, title=title, xbins=100, xmin=m_minSiResFillRange, xmax=m_maxSiResFillRange)
420 
421  varName = 'm_pix_eca_residualy;pix_eca_residualy'
422  title = 'UnBiased Y Residual Pixel EndCap A;Residual [mm]'
423  residualGroup.defineHistogram(varName, type='TH1F', path=pathResiduals, title=title, xbins=100, xmin=m_minPIXResYFillRange, xmax=m_maxPIXResYFillRange)
424 
425  varName = 'm_pix_eca_pullx;pix_eca_pulllx'
426  title = 'UnBiased X Pull Pixel EndCap A;Pull'
427  residualGroup.defineHistogram(varName, type='TH1F', path=pathResiduals, title=title, xbins=100, xmin=-m_RangeOfPullHistos, xmax=m_RangeOfPullHistos)
428 
429  varName = 'm_pix_eca_pully;pix_eca_pullly'
430  title = 'UnBiased Y Pull Pixel EndCap A;Pull'
431  residualGroup.defineHistogram(varName, type='TH1F', path=pathResiduals, title=title, xbins=100, xmin=-m_RangeOfPullHistos, xmax=m_RangeOfPullHistos)
432 
433  residualECAXArray = helper.addArray([len(layersECPix)], alg, 'PixResidualXECA', topPath = pathResiduals)
434  for postfix, tool in residualECAXArray.Tools.items():
435  layer = layersECPix[int( postfix.split('_')[1] )]
436  title = ('UNBIASED X Residual Average vs Module Phi of Pixel Endcap A Disk %s' % layer)
437  name = 'm_modPhi,m_pix_eca_residualx;m_pix_eca_unbiased_xresvsmodphi_disk' + layer
438  tool.defineHistogram(name, title = title, type = 'TProfile',
439  xbins = m_PhiModulesPerRing, xmin = -0.5, xmax = m_PhiModulesPerRing - 0.5)
440 
441  residualECAYArray = helper.addArray([len(layersECPix)], alg, 'PixResidualYECA', topPath = pathResiduals)
442  for postfix, tool in residualECAYArray.Tools.items():
443  layer = layersECPix[int( postfix.split('_')[1] )]
444  title = ('UNBIASED Y Residual Average vs Module Phi of Pixel Endcap A Disk %s' % layer)
445  name = 'm_modPhi,m_pix_eca_residualy;m_pix_eca_unbiased_yresvsmodphi_disk' + layer
446  tool.defineHistogram(name, title = title, type = 'TProfile',
447  xbins = m_PhiModulesPerRing, xmin = -0.5, xmax = m_PhiModulesPerRing - 0.5)
448 
449  # Define local X,Y 3D histograms for endcaps A, C (not really 3D histograms but TProfile 2D)
450  endcapsPix = ['a', 'c']
451  residualECX2DProfArray = helper.addArray([len(endcapsPix)], alg, 'PixResidualXEC_2DProf', topPath = pathResiduals)
452  for postfix, tool in residualECX2DProfArray.Tools.items():
453  layer = endcapsPix[int(postfix.split('_')[1])]
454  title = ('Local X Residual vs Module Disk-Phi-ID Pixel Endcap %s; Disk; Mod Phi; Local X Residual [mm]' % layer.upper())
455  name = 'm_layerDisk,m_modPhi,m_pix_ec_residualx;pix_ec' + layer + '_xresvsmodetaphi_2dprof'
456  tool.defineHistogram(name, title = title, type = 'TProfile2D', xbins = 3, xmin = - 0.5, xmax = 3 - 0.5,
457  ybins = m_PhiModulesPerRing, ymin = -0.5, ymax = m_PhiModulesPerRing - 0.5,
458  zmin = m_minSiResFillRange, zmax = m_maxSiResFillRange)
459 
460  residualECY2DProfArray = helper.addArray([len(endcapsPix)], alg, 'PixResidualYEC_2DProf', topPath = pathResiduals)
461  for postfix, tool in residualECY2DProfArray.Tools.items():
462  layer = endcapsPix[int( postfix.split('_')[1])]
463  title = ('Local Y Residual vs Module Eta-Phi-ID Pixel Endcap %s; Disk; Mod Phi; Local Y Residual [mm]' % layer.upper())
464  name = 'm_layerDisk,m_modPhi,m_pix_ec_residualy;pix_ec' + layer + '_yresvsmodetaphi_2dprof'
465  tool.defineHistogram(name, title = title, type = 'TProfile2D', xbins = 3, xmin = - 0.5, xmax = 3 - 0.5,
466  ybins = m_PhiModulesPerRing, ymin = -0.5, ymax = m_PhiModulesPerRing - 0.5,
467  zmin = m_minPIXResYFillRange, zmax = m_maxPIXResYFillRange)
468 
469  varName = 'm_modPhiShift_eca,m_residualX_eca;pix_eca_xresvsmodphi_2d'
470  title = 'X Residual Mean vs (Modified) Module Phi-ID Pixel ECA;(Modified) Phi-ID;Residual [mm]'
471  residualGroup.defineHistogram(varName, title = title, type = 'TH2F', path=pathResiduals,
472  xbins = m_PhiModulesShift_ec, xmin = 0, xmax = m_PhiModulesShift_ec,
473  ybins = 100 * m_FinerBinningFactor, ymin = m_minSiResFillRange, ymax = m_maxSiResFillRange)
474 
475  varName = 'm_modPhiShift_eca,m_residualY_eca;pix_eca_yresvsmodphi_2d'
476  title = 'Y Residual Mean vs (Modified) Module Phi-ID Pixel ECA;(Modified) Phi-ID;Residual [mm]'
477  residualGroup.defineHistogram(varName, title = title, type = 'TH2F', path=pathResiduals,
478  xbins = m_PhiModulesShift_ec, xmin = 0, xmax = m_PhiModulesShift_ec,
479  ybins = 100 * m_FinerBinningFactor, ymin = m_minPIXResYFillRange, ymax = m_maxPIXResYFillRange)
480 
481  varName = 'm_modPhiShift_eca,m_residualX_eca;pix_eca_xresvsmodphi_profile'
482  title = 'X Residual Mean vs (Modified) Module Phi-ID Pixel ECA;(Modified) Phi-ID;Residual [mm]'
483  residualGroup.defineHistogram(varName, title = title, type = 'TProfile', path=pathResiduals,
484  xbins = m_PhiModulesShift_ec, xmin = 0, xmax = m_PhiModulesShift_ec)
485 
486  varName = 'm_modPhiShift_eca,m_residualY_eca;pix_eca_yresvsmodphi_profile'
487  title = 'Y Residual Mean vs (Modified) Module Phi-ID Pixel ECA;(Modified) Phi-ID;Residual [mm]'
488  residualGroup.defineHistogram(varName, title = title, type = 'TProfile', path=pathResiduals,
489  xbins = m_PhiModulesShift_ec, xmin = 0, xmax = m_PhiModulesShift_ec)
490 
491  #Pixel EndCap C plots
492  varName = 'm_pix_ecc_residualx;pix_ecc_residualx'
493  title = 'UnBiased X Residual Pixel EndCap C;Residual [mm]'
494  residualGroup.defineHistogram(varName, type='TH1F', path=pathResiduals, title=title, xbins=100, xmin=m_minSiResFillRange, xmax=m_maxSiResFillRange)
495 
496  varName = 'm_pix_ecc_residualy;pix_ecc_residualy'
497  title = 'UnBiased Y Residual Pixel EndCap C;Residual [mm]'
498  residualGroup.defineHistogram(varName, type='TH1F', path=pathResiduals, title=title, xbins=100, xmin=m_minPIXResYFillRange, xmax=m_maxPIXResYFillRange)
499 
500  varName = 'm_pix_ecc_pullx;pix_ecc_pulllx'
501  title = 'UnBiased X Pull Pixel EndCap C;Pull'
502  residualGroup.defineHistogram(varName, type='TH1F', path=pathResiduals, title=title, xbins=100, xmin=-m_RangeOfPullHistos, xmax=m_RangeOfPullHistos)
503 
504  varName = 'm_pix_ecc_pully;pix_ecc_pullly'
505  title = 'UnBiased Y Pull Pixel EndCap C;Pull'
506  residualGroup.defineHistogram(varName, type='TH1F', path=pathResiduals, title=title, xbins=100, xmin=-m_RangeOfPullHistos, xmax=m_RangeOfPullHistos)
507 
508  residualECCXArray = helper.addArray([len(layersECPix)], alg, 'PixResidualXECC', topPath = pathResiduals)
509  for postfix, tool in residualECCXArray.Tools.items():
510  layer = layersECPix[int( postfix.split('_')[1] )]
511  title = ('UNBIASED X Residual Average vs Module Phi of Pixel Endcap C Disk %s' % layer)
512  name = 'm_modPhi,m_pix_ecc_residualx;m_pix_ecc_unbiased_xresvsmodphi_disk' + layer
513  tool.defineHistogram(name, title = title, type = 'TProfile',
514  xbins = m_PhiModulesPerRing, xmin = -0.5, xmax = m_PhiModulesPerRing - 0.5)
515 
516  residualECCYArray = helper.addArray([len(layersECPix)], alg, 'PixResidualYECC', topPath = pathResiduals)
517  for postfix, tool in residualECCYArray.Tools.items():
518  layer = layersECPix[int( postfix.split('_')[1] )]
519  title = ('UNBIASED Y Residual Average vs Module Phi of Pixel Endcap C Disk %s' % layer)
520  name = 'm_modPhi,m_pix_ecc_residualy;m_pix_ecc_unbiased_yresvsmodphi_disk' + layer
521  tool.defineHistogram(name, title = title, type = 'TProfile',
522  xbins = m_PhiModulesPerRing, xmin = -0.5, xmax = m_PhiModulesPerRing - 0.5)
523 
524  varName = 'm_modPhiShift_ecc,m_residualX_ecc;pix_ecc_xresvsmodphi_2d'
525  title = 'X Residual Distribution vs (Modified) Module Phi-ID Pixel ECC;(Modified) Phi-ID;Residual [mm]'
526  residualGroup.defineHistogram(varName, title = title, type = 'TH2F', path=pathResiduals,
527  xbins = m_PhiModulesShift_ec, xmin = 0, xmax = m_PhiModulesShift_ec,
528  ybins = 100 * m_FinerBinningFactor, ymin = m_minSiResFillRange, ymax = m_maxSiResFillRange)
529 
530  varName = 'm_modPhiShift_ecc,m_residualY_ecc;pix_ecc_yresvsmodphi_2d'
531  title = 'Y Residual Distribution vs (Modified) Module Phi-ID Pixel ECC;(Modified) Phi-ID;Residual [mm]'
532  residualGroup.defineHistogram(varName, title = title, type = 'TH2F', path=pathResiduals,
533  xbins = m_PhiModulesShift_ec, xmin = 0, xmax = m_PhiModulesShift_ec,
534  ybins = 100 * m_FinerBinningFactor, ymin = m_minPIXResYFillRange, ymax = m_maxPIXResYFillRange)
535 
536  varName = 'm_modPhiShift_ecc,m_residualX_ecc;pix_ecc_xresvsmodphi_profile'
537  title = 'X Residual Distribution vs (Modified) Module Phi-ID Pixel ECC;(Modified) Phi-ID;Residual [mm]'
538  residualGroup.defineHistogram(varName, title = title, type = 'TProfile', path=pathResiduals,
539  xbins = m_PhiModulesShift_ec, xmin = 0, xmax = m_PhiModulesShift_ec)
540 
541  varName = 'm_modPhiShift_ecc,m_residualY_ecc;pix_ecc_yresvsmodphi_profile'
542  title = 'Y Residual Distribution vs (Modified) Module Phi-ID Pixel ECC;(Modified) Phi-ID;Residual [mm]'
543  residualGroup.defineHistogram(varName, title = title, type = 'TProfile', path=pathResiduals,
544  xbins = m_PhiModulesShift_ec, xmin = 0, xmax = m_PhiModulesShift_ec)
545 
546  #SCT Barrel Plots
547  varName = 'm_sct_b_residualx;sct_b_residualx'
548  title = 'UnBiased X Residual SCT Barrel;Residual [mm]'
549  residualGroup.defineHistogram(varName, type='TH1F', path=pathResiduals, title=title, xbins=100, xmin=m_minSiResFillRange, xmax=m_maxSiResFillRange)
550 
551  varName = 'm_sct_b_biased_residualx;sct_b_biasedresidualx'
552  title = 'Biased X Residual SCT Barrel;Residual [mm]'
553  residualGroup.defineHistogram(varName, type='TH1F', path=pathResiduals, title=title, xbins=100, xmin=m_minSiResFillRange, xmax=m_maxSiResFillRange)
554 
555  layersSCTB = ['0', '1', '2', '3']
556  residualSCTXArray = helper.addArray([len(layersSCTB)], alg, 'SCTResidualX', topPath = pathResiduals)
557  for postfix, tool in residualSCTXArray.Tools.items():
558  layer = layersSCTB[int( postfix.split('_')[1] )]
559  title = ('UnBiased X Residual SCT Barrel %s' % layer)
560  name = 'm_sct_residualsx;sct_b' + layer + '_residualx'
561  tool.defineHistogram(name, title = title, type = 'TH1F',
562  xbins = 100 * m_FinerBinningFactor, xmin = m_minSiResFillRange, xmax = m_maxSiResFillRange)
563 
564  # Define local X 3D histograms (not really 3D histograms but TProfile 2D)
565  residualSCTX2DProfArray = helper.addArray([len(layersSCTB)], alg, 'SCTResidualX_2DProf', topPath = pathResiduals)
566  for postfix, tool in residualSCTX2DProfArray.Tools.items():
567  layer = layersSCTB[int( postfix.split('_')[1] )]
568  title = ('Local X Residual vs Module Eta-Phi-ID SCT Barrel layer %s; Mod Eta; Mod Phi; Local X Residual [mm]' % layer)
569  name = 'm_modEta,m_modPhi,m_sct_residualsx;sct_b' + layer + '_xresvsmodetaphi_2dprof'
570  tool.defineHistogram(name, title = title, type = 'TProfile2D', xbins = m_EtaModulesSCT, xmin = m_EtaModulesMinSCT, xmax = m_EtaModulesMaxSCT,
571  ybins = m_PhiModules[int(layer)], ymin = -0.5, ymax = m_PhiModules[int(layer)] - 0.5,
572  zmin = m_minSiResFillRange, zmax = m_maxSiResFillRange)
573 
574  residualSCTXS02DProfArray = helper.addArray([len(layersSCTB)], alg, 'SCT_s0_ResidualX_2DProf', topPath = pathResiduals)
575  for postfix, tool in residualSCTXS02DProfArray.Tools.items():
576  layer = layersSCTB[int( postfix.split('_')[1] )]
577  title = ('Local X Residual vs Module Eta-Phi-ID SCT Barrel layer %s side 0; Mod Eta; Mod Phi; Local X Residual side 0 [mm]' % layer)
578  name = 'm_modEta,m_modPhi,m_sct_residualsx;sct_b' + layer + '_s0_xresvsmodetaphi_2dprof'
579  tool.defineHistogram(name, title = title, type = 'TProfile2D', xbins = m_EtaModulesSCT, xmin = m_EtaModulesMinSCT, xmax = m_EtaModulesMaxSCT,
580  ybins = m_PhiModules[int(layer)], ymin = -0.5, ymax = m_PhiModules[int(layer)] - 0.5,
581  zmin = m_minSiResFillRange, zmax = m_maxSiResFillRange)
582 
583  residualSCTXS12DProfArray = helper.addArray([len(layersSCTB)], alg, 'SCT_s1_ResidualX_2DProf', topPath = pathResiduals)
584  for postfix, tool in residualSCTXS12DProfArray.Tools.items():
585  layer = layersSCTB[int( postfix.split('_')[1] )]
586  title = ('Local X Residual vs Module Eta-Phi-ID SCT Barrel layer %s side 1; Mod Eta; Mod Phi; Local X Residual side 1 [mm]' % layer)
587  name = 'm_modEta,m_modPhi,m_sct_residualsx;sct_b' + layer + '_s1_xresvsmodetaphi_2dprof'
588  tool.defineHistogram(name, title = title, type = 'TProfile2D', xbins = m_EtaModulesSCT, xmin = m_EtaModulesMinSCT, xmax = m_EtaModulesMaxSCT,
589  ybins = m_PhiModules[int(layer)], ymin = -0.5, ymax = m_PhiModules[int(layer)] - 0.5,
590  zmin = m_minSiResFillRange, zmax = m_maxSiResFillRange)
591 
592  pullSCTXArray = helper.addArray([len(layersSCTB)], alg, 'SCTPullX', topPath = pathResiduals)
593  for postfix, tool in pullSCTXArray.Tools.items():
594  layer = layersSCTB[int( postfix.split('_')[1] )]
595  title = ('UnBiased X Pull SCT Barrel %s' % layer) + ';Pull'
596  name = 'm_sct_pullsx;sct_b' + layer + '_pullx'
597  tool.defineHistogram(name, title = title, type = 'TH1F',
598  xbins = 100 * m_FinerBinningFactor, xmin = -m_RangeOfPullHistos, xmax = m_RangeOfPullHistos)
599 
600  resXvsEtaSCTArray = helper.addArray([len(layersSCTB)], alg, 'SCTResidualXvsEta', topPath = pathResiduals)
601  for postfix, tool in resXvsEtaSCTArray.Tools.items():
602  layer = layersSCTB[int( postfix.split('_')[1] )]
603  layerInd = int(layer)
604  title = ('X Residual Distribution vs Module Eta-ID SCT Barrel %s' % layer) + ';Mod Eta;Residual [mm]'
605  name = 'm_modEta,m_residualX;sct_b' + layer + '_xresidualvseta_2d'
606  tool.defineHistogram(name, title = title, type = 'TH2F',
607  xbins = m_EtaModulesSCT, xmin = m_EtaModulesMinSCT, xmax = m_EtaModulesMaxSCT,
608  ybins = 50 * m_FinerBinningFactor, ymin = m_minSiResFillRange, ymax = m_maxSiResFillRange)
609 
610  resXvsPhiSCTArray = helper.addArray([len(layersPix)], alg, 'SCTResidualXvsPhi', topPath = pathResiduals)
611  for postfix, tool in resXvsPhiSCTArray.Tools.items():
612  layer = layersSCTB[int( postfix.split('_')[1] )]
613  layerInd = int(layer)
614  PhiModules = m_PhiModulesSCT[layerInd]
615  title = ('X Residual Distribution vs Module Phi-ID SCT Barrel %s' % layer) + ';Mod Phi;Residual [mm]'
616  name = 'm_modPhi,m_residualX;sct_b' + layer + '_xresidualvsphi_2d'
617  tool.defineHistogram(name, title = title, type = 'TH2F',
618  xbins = PhiModules, xmin = - 0.5, xmax = PhiModules - 0.5,
619  ybins = 50 * m_FinerBinningFactor, ymin = m_minSiResFillRange, ymax = m_maxSiResFillRange)
620 
621  varName = 'm_modPhiShift_sct_barrel,m_residualX_sct_barrel;sct_b_xresvsmodphi_profile'
622  title = 'X Residual Mean vs (Modified) Module Phi-ID SCT Barrel;(Modified) Phi-ID;Residual [mm]'
623  residualGroup.defineHistogram(varName, title = title, type = 'TProfile', path=pathResiduals,
624  xbins = m_PhiModulesShift_sct_barrel, xmin = - 0.5, xmax = m_PhiModulesShift_sct_barrel - 0.5)
625 
626  varName = 'm_modEtaShift_sct_barrel,m_residualX_sct_barrel;sct_b_xresvsmodeta_profile'
627  title = 'X Residual Mean vs (Modified) Module Eta-ID SCT Barrel;(Modified) Eta-ID;Residual [mm]'
628  residualGroup.defineHistogram(varName, title = title, type = 'TProfile', path=pathResiduals,
629  xbins = m_EtaModulesShift_sct_barrel, xmin = - 0.5, xmax = m_EtaModulesShift_sct_barrel - 0.5)
630 
631  #SCT EndCap A plots
632  varName = 'm_sct_eca_residualx;sct_eca_residualx'
633  title = 'UnBiased X Residual SCT EndCap A;Residual [mm]'
634  residualGroup.defineHistogram(varName, type='TH1F', path=pathResiduals, title=title, xbins=100, xmin=m_minSiResFillRange, xmax=m_maxSiResFillRange)
635 
636  # Define local X 3D histograms (not really 3D histograms but TProfile 2D)
637  layersECsct = ['0', '1', '2', '3', '4', '5', '6', '7', '8']
638  residualSCTECAX2DProfArray = helper.addArray([len(layersECsct)], alg, 'SCTECAResidualX_2DProf', topPath = pathResiduals)
639  for postfix, tool in residualSCTECAX2DProfArray.Tools.items():
640  layer = layersECsct[int( postfix.split('_')[1] )]
641  title = ('Local X Residual vs Module Eta-Phi-ID SCT Endcap A Disk %s; Mod Eta; Mod Phi; Local X Residual [mm]' % layer)
642  name = 'm_modEta,m_modPhi,m_sct_eca_residualx;sct_eca' + layer + '_xresvsmodetaphi_2dprof'
643  tool.defineHistogram(name, title = title, type = 'TProfile2D', xbins = m_EtaModulesSCTEC, xmin = -0.5, xmax = m_EtaModulesSCTEC - 0.5,
644  ybins = m_PhiModulesSCTEC, ymin = - 0.5, ymax = m_PhiModulesSCTEC - 0.5,
645  zmin = m_minSiResFillRange, zmax = m_maxSiResFillRange)
646 
647  residualSCTECAXS02DProfArray = helper.addArray([len(layersECsct)], alg, 'SCTECA_s0_ResidualX_2DProf', topPath = pathResiduals)
648  for postfix, tool in residualSCTECAXS02DProfArray.Tools.items():
649  layer = layersECsct[int( postfix.split('_')[1] )]
650  title = ('Local X Residual vs Module Eta-Phi-ID SCT Endcap A Disk %s side 0; Mod Eta; Mod Phi; Local X Residual side 0 [mm]' % layer)
651  name = 'm_modEta,m_modPhi,m_sct_eca_residualx;sct_eca' + layer + '_s0_xresvsmodetaphi_2dprof'
652  tool.defineHistogram(name, title = title, type = 'TProfile2D', xbins = m_EtaModulesSCTEC, xmin = -0.5, xmax = m_EtaModulesSCTEC - 0.5,
653  ybins = m_PhiModulesSCTEC, ymin = - 0.5, ymax = m_PhiModulesSCTEC - 0.5,
654  zmin = m_minSiResFillRange, zmax = m_maxSiResFillRange)
655 
656  residualSCTECAXS12DProfArray = helper.addArray([len(layersECsct)], alg, 'SCTECA_s1_ResidualX_2DProf', topPath = pathResiduals)
657  for postfix, tool in residualSCTECAXS12DProfArray.Tools.items():
658  layer = layersECsct[int( postfix.split('_')[1] )]
659  title = ('Local X Residual vs Module Eta-Phi-ID SCT Endcap A Disk %s side 1; Mod Eta; Mod Phi; Local X Residual side 1 [mm]' % layer)
660  name = 'm_modEta,m_modPhi,m_sct_eca_residualx;sct_eca' + layer + '_s1_xresvsmodetaphi_2dprof'
661  tool.defineHistogram(name, title = title, type = 'TProfile2D', xbins = m_EtaModulesSCTEC, xmin = -0.5, xmax = m_EtaModulesSCTEC - 0.5,
662  ybins = m_PhiModulesSCTEC, ymin = - 0.5, ymax = m_PhiModulesSCTEC - 0.5,
663  zmin = m_minSiResFillRange, zmax = m_maxSiResFillRange)
664 
665  varName = 'm_sct_eca_pullx;sct_eca_pulllx'
666  title = 'UnBiased X Pull SCT EndCap A;Pull'
667  residualGroup.defineHistogram(varName, type='TH1F', path=pathResiduals, title=title, xbins=100, xmin=-m_RangeOfPullHistos, xmax=m_RangeOfPullHistos)
668 
669  varName = 'm_modPhiShift_sct_eca,m_residualX_sct_eca;sct_eca_xresvsmodphi_2d'
670  title = 'X Residual Mean vs (Modified) Module Phi-ID SCT ECA;(Modified) Phi-ID;Residual [mm]'
671  residualGroup.defineHistogram(varName, title = title, type = 'TProfile', path=pathResiduals,
672  xbins = m_PhiModulesShift_sct_ec, xmin = 0, xmax = m_PhiModulesShift_sct_ec,
673  ybins = 100 * m_FinerBinningFactor, ymin = m_minSiResFillRange, ymax = m_maxSiResFillRange)
674 
675  varName = 'm_modPhiShift_sct_eca,m_residualX_sct_eca;sct_eca_xresvsmodphi_profile'
676  title = 'X Residual Mean vs (Modified) Module Phi-ID SCT ECA;(Modified) Phi-ID;Residual [mm]'
677  residualGroup.defineHistogram(varName, title = title, type = 'TProfile', path=pathResiduals,
678  xbins = m_PhiModulesShift_sct_ec, xmin = - 0.5, xmax = m_PhiModulesShift_sct_ec - 0.5)
679 
680  #SCT EndCap C plots
681  varName = 'm_sct_ecc_residualx;sct_ecc_residualx'
682  title = 'UnBiased X Residual SCT EndCap C;Residual [mm]'
683  residualGroup.defineHistogram(varName, type='TH1F', path=pathResiduals, title=title, xbins=100, xmin=m_minSiResFillRange, xmax=m_maxSiResFillRange)
684 
685  # Define local X 3D histograms (not really 3D histograms but TProfile 2D)
686  residualSCTECCX2DProfArray = helper.addArray([len(layersECsct)], alg, 'SCTECCResidualX_2DProf', topPath = pathResiduals)
687  for postfix, tool in residualSCTECCX2DProfArray.Tools.items():
688  layer = layersECsct[int( postfix.split('_')[1] )]
689  title = ('Local X Residual vs Module Eta-Phi-ID SCT Endcap C Disk %s; Mod Eta; Mod Phi; Local X Residual [mm]' % layer)
690  name = 'm_modEta,m_modPhi,m_sct_ecc_residualx;sct_ecc' + layer + '_xresvsmodetaphi_2dprof'
691  tool.defineHistogram(name, title = title, type = 'TProfile2D', xbins = m_EtaModulesSCTEC, xmin = -0.5, xmax = m_EtaModulesSCTEC - 0.5,
692  ybins = m_PhiModulesSCTEC, ymin = -0.5, ymax = m_PhiModulesSCTEC - 0.5,
693  zmin = m_minSiResFillRange, zmax = m_maxSiResFillRange)
694 
695  residualSCTECCXS02DProfArray = helper.addArray([len(layersECsct)], alg, 'SCTECC_s0_ResidualX_2DProf', topPath = pathResiduals)
696  for postfix, tool in residualSCTECCXS02DProfArray.Tools.items():
697  layer = layersECsct[int( postfix.split('_')[1] )]
698  title = ('Local X Residual vs Module Eta-Phi-ID SCT Endcap C Disk %s side 0; Mod Eta; Mod Phi; Local X Residual side 0 [mm]' % layer)
699  name = 'm_modEta,m_modPhi,m_sct_ecc_residualx;sct_ecc' + layer + '_s0_xresvsmodetaphi_2dprof'
700  tool.defineHistogram(name, title = title, type = 'TProfile2D', xbins = m_EtaModulesSCTEC, xmin = -0.5, xmax = m_EtaModulesSCTEC - 0.5,
701  ybins = m_PhiModulesSCTEC, ymin = - 0.5, ymax = m_PhiModulesSCTEC - 0.5,
702  zmin = m_minSiResFillRange, zmax = m_maxSiResFillRange)
703 
704  residualSCTECCXS12DProfArray = helper.addArray([len(layersECsct)], alg, 'SCTECC_s1_ResidualX_2DProf', topPath = pathResiduals)
705  for postfix, tool in residualSCTECCXS12DProfArray.Tools.items():
706  layer = layersECsct[int( postfix.split('_')[1] )]
707  title = ('Local X Residual vs Module Eta-Phi-ID SCT Endcap C Disk %s side 1; Mod Eta; Mod Phi; Local X Residual side 1 [mm]' % layer)
708  name = 'm_modEta,m_modPhi,m_sct_ecc_residualx;sct_ecc' + layer + '_s1_xresvsmodetaphi_2dprof'
709  tool.defineHistogram(name, title = title, type = 'TProfile2D', xbins = m_EtaModulesSCTEC, xmin = -0.5, xmax = m_EtaModulesSCTEC - 0.5,
710  ybins = m_PhiModulesSCTEC, ymin = - 0.5, ymax = m_PhiModulesSCTEC - 0.5,
711  zmin = m_minSiResFillRange, zmax = m_maxSiResFillRange)
712 
713  varName = 'm_sct_ecc_pullx;sct_ecc_pulllx'
714  title = 'UnBiased X Pull SCT EndCap C;Pull'
715  residualGroup.defineHistogram(varName, type='TH1F', path=pathResiduals, title=title, xbins=100, xmin=-m_RangeOfPullHistos, xmax=m_RangeOfPullHistos)
716 
717  varName = 'm_modPhiShift_sct_ecc,m_residualX_sct_ecc;sct_ecc_xresvsmodphi_2d'
718  title = 'X Residual Mean vs (Modified) Module Phi-ID SCT ECC;(Modified) Phi-ID;Residual [mm]'
719  residualGroup.defineHistogram(varName, title = title, type = 'TProfile', path=pathResiduals,
720  xbins = m_PhiModulesShift_sct_ec, xmin = 0, xmax = m_PhiModulesShift_sct_ec,
721  ybins = 100 * m_FinerBinningFactor, ymin = m_minSiResFillRange, ymax = m_maxSiResFillRange)
722 
723  varName = 'm_modPhiShift_sct_ecc,m_residualX_sct_ecc;sct_ecc_xresvsmodphi_profile'
724  title = 'X Residual Mean vs (Modified) Module Phi-ID SCT ECC;(Modified) Phi-ID;Residual [mm]'
725  residualGroup.defineHistogram(varName, title = title, type = 'TProfile', path=pathResiduals,
726  xbins = m_PhiModulesShift_sct_ec, xmin = - 0.5, xmax = m_PhiModulesShift_sct_ec - 0.5)
727 
728  # end histograms
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
IDAlignMonResidualsAlgCfg.IDAlignMonResidualsAlgCfg
def IDAlignMonResidualsAlgCfg(helper, alg, **kwargs)
Definition: IDAlignMonResidualsAlgCfg.py:10