CMS 3D CMS Logo

AlignmentMonitorMuonResiduals.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: CommonAlignmentProducer
4 // Class : AlignmentMonitorMuonResiduals
5 //
6 // Implementation:
7 // <Notes on implementation>
8 //
9 // Original Author: Jim Pivarski
10 // Created: Mon Nov 12 13:30:14 CST 2007
11 //
12 
13 // system include files
18 
25 #include "TH1F.h"
26 #include "TTree.h"
27 
28 // user include files
29 
30 //
31 // class definition
32 //
33 
35  public:
38 
39  void book() override;
40  void event(const edm::Event &iEvent, const edm::EventSetup &iSetup, const ConstTrajTrackPairCollection& iTrajTracks) override;
41  void afterAlignment() override;
42 
43  private:
44  std::map<int, int> m_numx;
45  std::map<int, double> m_x_w;
46  std::map<int, double> m_x_ww;
47  std::map<int, double> m_x_wx;
48  std::map<int, double> m_x_wxx;
49  std::map<int, int> m_numy;
50  std::map<int, double> m_y_w;
51  std::map<int, double> m_y_ww;
52  std::map<int, double> m_y_wy;
53  std::map<int, double> m_y_wyy;
54 
56 
66 
76 
86 
96 
106 
116 
126 
136 
137  TTree *m_chambers;
142 
145 
146 };
147 
148 //
149 // constants, enums and typedefs
150 //
151 
152 //
153 // static data member definitions
154 //
155 
156 //
157 // member functions
158 //
159 
161  : AlignmentMonitorBase(cfg, "AlignmentMonitorMuonResiduals")
162 {
163  xresid_bins = cfg.getParameter<unsigned int>("xresid_bins");
164  xmean_bins = cfg.getParameter<unsigned int>("xmean_bins");
165  xstdev_bins = cfg.getParameter<unsigned int>("xstdev_bins");
166  xerronmean_bins = cfg.getParameter<unsigned int>("xerronmean_bins");
167  yresid_bins = cfg.getParameter<unsigned int>("yresid_bins");
168  ymean_bins = cfg.getParameter<unsigned int>("ymean_bins");
169  ystdev_bins = cfg.getParameter<unsigned int>("ystdev_bins");
170  yerronmean_bins = cfg.getParameter<unsigned int>("yerronmean_bins");
171  xresid_low = cfg.getParameter<double>("xresid_low");
172  xresid_high = cfg.getParameter<double>("xresid_high");
173  xmean_low = cfg.getParameter<double>("xmean_low");
174  xmean_high = cfg.getParameter<double>("xmean_high");
175  xstdev_low = cfg.getParameter<double>("xstdev_low");
176  xstdev_high = cfg.getParameter<double>("xstdev_high");
177  xerronmean_low = cfg.getParameter<double>("xerronmean_low");
178  xerronmean_high = cfg.getParameter<double>("xerronmean_high");
179  yresid_low = cfg.getParameter<double>("yresid_low");
180  yresid_high = cfg.getParameter<double>("yresid_high");
181  ymean_low = cfg.getParameter<double>("ymean_low");
182  ymean_high = cfg.getParameter<double>("ymean_high");
183  ystdev_low = cfg.getParameter<double>("ystdev_low");
184  ystdev_high = cfg.getParameter<double>("ystdev_high");
185  yerronmean_low = cfg.getParameter<double>("yerronmean_low");
186  yerronmean_high = cfg.getParameter<double>("yerronmean_high");
187 }
188 
190  m_numx.clear();
191  m_x_w.clear();
192  m_x_ww.clear();
193  m_x_wx.clear();
194  m_x_wxx.clear();
195  m_numy.clear();
196  m_y_w.clear();
197  m_y_ww.clear();
198  m_y_wy.clear();
199  m_y_wyy.clear();
200 
202  for (const auto& iter: pMuon()->DTChambers()) chambers.push_back(iter);
203  for (const auto& iter: pMuon()->CSCChambers()) chambers.push_back(iter);
204 
205  for (const auto& chamber: chambers) {
206  int id = chamber->geomDetId().rawId();
207  m_numx[id] = 0;
208  m_x_w[id] = 0;
209  m_x_ww[id] = 0;
210  m_x_wx[id] = 0;
211  m_x_wxx[id] = 0;
212  m_numy[id] = 0;
213  m_y_w[id] = 0;
214  m_y_ww[id] = 0;
215  m_y_wy[id] = 0;
216  m_y_wyy[id] = 0;
217  }
218 
219  m_sumnumx = book1D("/iterN/", "numx", "number of x hits", chambers.size(), 0.5, chambers.size() + 0.5);
220  m_sumnumy = book1D("/iterN/", "numy", "number of y hits", chambers.size(), 0.5, chambers.size() + 0.5);
221  m_xsummary = book1D("/iterN/", "xsummary", "summary of x means and errors (mm vertical axis)", chambers.size(), 0.5, chambers.size() + 0.5);
222  m_ysummary = book1D("/iterN/", "ysummary", "summary of y means and errors (mm vertical axis)", chambers.size(), 0.5, chambers.size() + 0.5);
223 
224  m_xresid = book1D("/iterN/", "xresid", "x residual (mm)", xresid_bins, xresid_low, xresid_high);
225  m_xresid_mb = book1D("/iterN/mb/", "xresid_mb", "barrel x residual (mm)", xresid_bins, xresid_low, xresid_high);
226  m_xresid_me = book1D("/iterN/me/", "xresid_me", "endcap x residual (mm)", xresid_bins, xresid_low, xresid_high);
227  m_xresid_mb1 = book1D("/iterN/mb1/", "xresid_mb1", "MB station 1 x residual (mm)", xresid_bins, xresid_low, xresid_high);
228  m_xresid_mb2 = book1D("/iterN/mb2/", "xresid_mb2", "MB station 2 x residual (mm)", xresid_bins, xresid_low, xresid_high);
229  m_xresid_mb3 = book1D("/iterN/mb3/", "xresid_mb3", "MB station 3 x residual (mm)", xresid_bins, xresid_low, xresid_high);
230  m_xresid_mb4 = book1D("/iterN/mb4/", "xresid_mb4", "MB station 4 x residual (mm)", xresid_bins, xresid_low, xresid_high);
231  m_xresid_minus2 = book1D("/iterN/minus2/", "xresid_minus2", "MB wheel -2 x residual (mm)", xresid_bins, xresid_low, xresid_high);
232  m_xresid_minus1 = book1D("/iterN/minus1/", "xresid_minus1", "MB wheel -1 x residual (mm)", xresid_bins, xresid_low, xresid_high);
233  m_xresid_zero = book1D("/iterN/zero/", "xresid_zero", "MB wheel 0 x residual (mm)", xresid_bins, xresid_low, xresid_high);
234  m_xresid_plus1 = book1D("/iterN/plus1/", "xresid_plus1", "MB wheel +1 x residual (mm)", xresid_bins, xresid_low, xresid_high);
235  m_xresid_plus2 = book1D("/iterN/plus2/", "xresid_plus2", "MB wheel +2 x residual (mm)", xresid_bins, xresid_low, xresid_high);
236  m_xresid_mep11 = book1D("/iterN/mep11/", "xresid_mep11", "ME+1/1 x residual (mm)", xresid_bins, xresid_low, xresid_high);
237  m_xresid_mep12 = book1D("/iterN/mep12/", "xresid_mep12", "ME+1/2 x residual (mm)", xresid_bins, xresid_low, xresid_high);
238  m_xresid_mep13 = book1D("/iterN/mep13/", "xresid_mep13", "ME+1/3 x residual (mm)", xresid_bins, xresid_low, xresid_high);
239  m_xresid_mep14 = book1D("/iterN/mep14/", "xresid_mep14", "ME+1/4 x residual (mm)", xresid_bins, xresid_low, xresid_high);
240  m_xresid_mep21 = book1D("/iterN/mep21/", "xresid_mep21", "ME+2/1 x residual (mm)", xresid_bins, xresid_low, xresid_high);
241  m_xresid_mep22 = book1D("/iterN/mep22/", "xresid_mep22", "ME+2/2 x residual (mm)", xresid_bins, xresid_low, xresid_high);
242  m_xresid_mep31 = book1D("/iterN/mep31/", "xresid_mep31", "ME+3/1 x residual (mm)", xresid_bins, xresid_low, xresid_high);
243  m_xresid_mep32 = book1D("/iterN/mep32/", "xresid_mep32", "ME+3/2 x residual (mm)", xresid_bins, xresid_low, xresid_high);
244  m_xresid_mep41 = book1D("/iterN/mep41/", "xresid_mep41", "ME+4/1 x residual (mm)", xresid_bins, xresid_low, xresid_high);
245  m_xresid_mem11 = book1D("/iterN/mem11/", "xresid_mem11", "ME-1/1 x residual (mm)", xresid_bins, xresid_low, xresid_high);
246  m_xresid_mem12 = book1D("/iterN/mem12/", "xresid_mem12", "ME-1/2 x residual (mm)", xresid_bins, xresid_low, xresid_high);
247  m_xresid_mem13 = book1D("/iterN/mem13/", "xresid_mem13", "ME-1/3 x residual (mm)", xresid_bins, xresid_low, xresid_high);
248  m_xresid_mem14 = book1D("/iterN/mem14/", "xresid_mem14", "ME-1/4 x residual (mm)", xresid_bins, xresid_low, xresid_high);
249  m_xresid_mem21 = book1D("/iterN/mem21/", "xresid_mem21", "ME-2/1 x residual (mm)", xresid_bins, xresid_low, xresid_high);
250  m_xresid_mem22 = book1D("/iterN/mem22/", "xresid_mem22", "ME-2/2 x residual (mm)", xresid_bins, xresid_low, xresid_high);
251  m_xresid_mem31 = book1D("/iterN/mem31/", "xresid_mem31", "ME-3/1 x residual (mm)", xresid_bins, xresid_low, xresid_high);
252  m_xresid_mem32 = book1D("/iterN/mem32/", "xresid_mem32", "ME-3/2 x residual (mm)", xresid_bins, xresid_low, xresid_high);
253  m_xresid_mem41 = book1D("/iterN/mem41/", "xresid_mem41", "ME-4/1 x residual (mm)", xresid_bins, xresid_low, xresid_high);
254  m_xresid_me11 = book1D("/iterN/me11/", "xresid_me11", "ME1/1 x residual (mm)", xresid_bins, xresid_low, xresid_high);
255  m_xresid_me12 = book1D("/iterN/me12/", "xresid_me12", "ME1/2 x residual (mm)", xresid_bins, xresid_low, xresid_high);
256  m_xresid_me13 = book1D("/iterN/me13/", "xresid_me13", "ME1/3 x residual (mm)", xresid_bins, xresid_low, xresid_high);
257  m_xresid_me14 = book1D("/iterN/me14/", "xresid_me14", "ME1/4 x residual (mm)", xresid_bins, xresid_low, xresid_high);
258  m_xresid_me21 = book1D("/iterN/me21/", "xresid_me21", "ME2/1 x residual (mm)", xresid_bins, xresid_low, xresid_high);
259  m_xresid_me22 = book1D("/iterN/me22/", "xresid_me22", "ME2/2 x residual (mm)", xresid_bins, xresid_low, xresid_high);
260  m_xresid_me31 = book1D("/iterN/me31/", "xresid_me31", "ME3/1 x residual (mm)", xresid_bins, xresid_low, xresid_high);
261  m_xresid_me32 = book1D("/iterN/me32/", "xresid_me32", "ME3/2 x residual (mm)", xresid_bins, xresid_low, xresid_high);
262  m_xresid_me41 = book1D("/iterN/me41/", "xresid_me41", "ME4/1 x residual (mm)", xresid_bins, xresid_low, xresid_high);
263 
264  m_xmean = book1D("/iterN/", "xmean", "weighted mean x residual per chamber (mm)", xmean_bins, xmean_low, xmean_high);
265  m_xmean_mb = book1D("/iterN/mb/", "xmean_mb", "barrel weighted mean x residual per chamber (mm)", xmean_bins, xmean_low, xmean_high);
266  m_xmean_me = book1D("/iterN/me/", "xmean_me", "endcap weighted mean x residual per chamber (mm)", xmean_bins, xmean_low, xmean_high);
267  m_xmean_mb1 = book1D("/iterN/mb1/", "xmean_mb1", "MB station 1 weighted mean x residual per chamber (mm)", xmean_bins, xmean_low, xmean_high);
268  m_xmean_mb2 = book1D("/iterN/mb2/", "xmean_mb2", "MB station 2 weighted mean x residual per chamber (mm)", xmean_bins, xmean_low, xmean_high);
269  m_xmean_mb3 = book1D("/iterN/mb3/", "xmean_mb3", "MB station 3 weighted mean x residual per chamber (mm)", xmean_bins, xmean_low, xmean_high);
270  m_xmean_mb4 = book1D("/iterN/mb4/", "xmean_mb4", "MB station 4 weighted mean x residual per chamber (mm)", xmean_bins, xmean_low, xmean_high);
271  m_xmean_minus2 = book1D("/iterN/minus2/", "xmean_minus2", "MB wheel -2 weighted mean x residual per chamber (mm)", xmean_bins, xmean_low, xmean_high);
272  m_xmean_minus1 = book1D("/iterN/minus1/", "xmean_minus1", "MB wheel -1 weighted mean x residual per chamber (mm)", xmean_bins, xmean_low, xmean_high);
273  m_xmean_zero = book1D("/iterN/zero/", "xmean_zero", "MB wheel 0 weighted mean x residual per chamber (mm)", xmean_bins, xmean_low, xmean_high);
274  m_xmean_plus1 = book1D("/iterN/plus1/", "xmean_plus1", "MB wheel +1 weighted mean x residual per chamber (mm)", xmean_bins, xmean_low, xmean_high);
275  m_xmean_plus2 = book1D("/iterN/plus2/", "xmean_plus2", "MB wheel +2 weighted mean x residual per chamber (mm)", xmean_bins, xmean_low, xmean_high);
276  m_xmean_mep11 = book1D("/iterN/mep11/", "xmean_mep11", "ME+1/1 weighted mean x residual per chamber (mm)", xmean_bins, xmean_low, xmean_high);
277  m_xmean_mep12 = book1D("/iterN/mep12/", "xmean_mep12", "ME+1/2 weighted mean x residual per chamber (mm)", xmean_bins, xmean_low, xmean_high);
278  m_xmean_mep13 = book1D("/iterN/mep13/", "xmean_mep13", "ME+1/3 weighted mean x residual per chamber (mm)", xmean_bins, xmean_low, xmean_high);
279  m_xmean_mep14 = book1D("/iterN/mep14/", "xmean_mep14", "ME+1/4 weighted mean x residual per chamber (mm)", xmean_bins, xmean_low, xmean_high);
280  m_xmean_mep21 = book1D("/iterN/mep21/", "xmean_mep21", "ME+2/1 weighted mean x residual per chamber (mm)", xmean_bins, xmean_low, xmean_high);
281  m_xmean_mep22 = book1D("/iterN/mep22/", "xmean_mep22", "ME+2/2 weighted mean x residual per chamber (mm)", xmean_bins, xmean_low, xmean_high);
282  m_xmean_mep31 = book1D("/iterN/mep31/", "xmean_mep31", "ME+3/1 weighted mean x residual per chamber (mm)", xmean_bins, xmean_low, xmean_high);
283  m_xmean_mep32 = book1D("/iterN/mep32/", "xmean_mep32", "ME+3/2 weighted mean x residual per chamber (mm)", xmean_bins, xmean_low, xmean_high);
284  m_xmean_mep41 = book1D("/iterN/mep41/", "xmean_mep41", "ME+4/1 weighted mean x residual per chamber (mm)", xmean_bins, xmean_low, xmean_high);
285  m_xmean_mem11 = book1D("/iterN/mem11/", "xmean_mem11", "ME-1/1 weighted mean x residual per chamber (mm)", xmean_bins, xmean_low, xmean_high);
286  m_xmean_mem12 = book1D("/iterN/mem12/", "xmean_mem12", "ME-1/2 weighted mean x residual per chamber (mm)", xmean_bins, xmean_low, xmean_high);
287  m_xmean_mem13 = book1D("/iterN/mem13/", "xmean_mem13", "ME-1/3 weighted mean x residual per chamber (mm)", xmean_bins, xmean_low, xmean_high);
288  m_xmean_mem14 = book1D("/iterN/mem14/", "xmean_mem14", "ME-1/4 weighted mean x residual per chamber (mm)", xmean_bins, xmean_low, xmean_high);
289  m_xmean_mem21 = book1D("/iterN/mem21/", "xmean_mem21", "ME-2/1 weighted mean x residual per chamber (mm)", xmean_bins, xmean_low, xmean_high);
290  m_xmean_mem22 = book1D("/iterN/mem22/", "xmean_mem22", "ME-2/2 weighted mean x residual per chamber (mm)", xmean_bins, xmean_low, xmean_high);
291  m_xmean_mem31 = book1D("/iterN/mem31/", "xmean_mem31", "ME-3/1 weighted mean x residual per chamber (mm)", xmean_bins, xmean_low, xmean_high);
292  m_xmean_mem32 = book1D("/iterN/mem32/", "xmean_mem32", "ME-3/2 weighted mean x residual per chamber (mm)", xmean_bins, xmean_low, xmean_high);
293  m_xmean_mem41 = book1D("/iterN/mem41/", "xmean_mem41", "ME-4/1 weighted mean x residual per chamber (mm)", xmean_bins, xmean_low, xmean_high);
294  m_xmean_me11 = book1D("/iterN/me11/", "xmean_me11", "ME1/1 weighted mean x residual per chamber (mm)", xmean_bins, xmean_low, xmean_high);
295  m_xmean_me12 = book1D("/iterN/me12/", "xmean_me12", "ME1/2 weighted mean x residual per chamber (mm)", xmean_bins, xmean_low, xmean_high);
296  m_xmean_me13 = book1D("/iterN/me13/", "xmean_me13", "ME1/3 weighted mean x residual per chamber (mm)", xmean_bins, xmean_low, xmean_high);
297  m_xmean_me14 = book1D("/iterN/me14/", "xmean_me14", "ME1/4 weighted mean x residual per chamber (mm)", xmean_bins, xmean_low, xmean_high);
298  m_xmean_me21 = book1D("/iterN/me21/", "xmean_me21", "ME2/1 weighted mean x residual per chamber (mm)", xmean_bins, xmean_low, xmean_high);
299  m_xmean_me22 = book1D("/iterN/me22/", "xmean_me22", "ME2/2 weighted mean x residual per chamber (mm)", xmean_bins, xmean_low, xmean_high);
300  m_xmean_me31 = book1D("/iterN/me31/", "xmean_me31", "ME3/1 weighted mean x residual per chamber (mm)", xmean_bins, xmean_low, xmean_high);
301  m_xmean_me32 = book1D("/iterN/me32/", "xmean_me32", "ME3/2 weighted mean x residual per chamber (mm)", xmean_bins, xmean_low, xmean_high);
302  m_xmean_me41 = book1D("/iterN/me41/", "xmean_me41", "ME4/1 weighted mean x residual per chamber (mm)", xmean_bins, xmean_low, xmean_high);
303 
304  m_xstdev = book1D("/iterN/", "xstdev", "weighted stdev x residual per chamber (mm)", xstdev_bins, xstdev_low, xstdev_high);
305  m_xstdev_mb = book1D("/iterN/mb/", "xstdev_mb", "barrel weighted stdev x residual per chamber (mm)", xstdev_bins, xstdev_low, xstdev_high);
306  m_xstdev_me = book1D("/iterN/me/", "xstdev_me", "endcap weighted stdev x residual per chamber (mm)", xstdev_bins, xstdev_low, xstdev_high);
307  m_xstdev_mb1 = book1D("/iterN/mb1/", "xstdev_mb1", "MB station 1 weighted stdev x residual per chamber (mm)", xstdev_bins, xstdev_low, xstdev_high);
308  m_xstdev_mb2 = book1D("/iterN/mb2/", "xstdev_mb2", "MB station 2 weighted stdev x residual per chamber (mm)", xstdev_bins, xstdev_low, xstdev_high);
309  m_xstdev_mb3 = book1D("/iterN/mb3/", "xstdev_mb3", "MB station 3 weighted stdev x residual per chamber (mm)", xstdev_bins, xstdev_low, xstdev_high);
310  m_xstdev_mb4 = book1D("/iterN/mb4/", "xstdev_mb4", "MB station 4 weighted stdev x residual per chamber (mm)", xstdev_bins, xstdev_low, xstdev_high);
311  m_xstdev_minus2 = book1D("/iterN/minus2/", "xstdev_minus2", "MB wheel -2 weighted stdev x residual per chamber (mm)", xstdev_bins, xstdev_low, xstdev_high);
312  m_xstdev_minus1 = book1D("/iterN/minus1/", "xstdev_minus1", "MB wheel -1 weighted stdev x residual per chamber (mm)", xstdev_bins, xstdev_low, xstdev_high);
313  m_xstdev_zero = book1D("/iterN/zero/", "xstdev_zero", "MB wheel 0 weighted stdev x residual per chamber (mm)", xstdev_bins, xstdev_low, xstdev_high);
314  m_xstdev_plus1 = book1D("/iterN/plus1/", "xstdev_plus1", "MB wheel +1 weighted stdev x residual per chamber (mm)", xstdev_bins, xstdev_low, xstdev_high);
315  m_xstdev_plus2 = book1D("/iterN/plus2/", "xstdev_plus2", "MB wheel +2 weighted stdev x residual per chamber (mm)", xstdev_bins, xstdev_low, xstdev_high);
316  m_xstdev_mep11 = book1D("/iterN/mep11/", "xstdev_mep11", "ME+1/1 weighted stdev x residual per chamber (mm)", xstdev_bins, xstdev_low, xstdev_high);
317  m_xstdev_mep12 = book1D("/iterN/mep12/", "xstdev_mep12", "ME+1/2 weighted stdev x residual per chamber (mm)", xstdev_bins, xstdev_low, xstdev_high);
318  m_xstdev_mep13 = book1D("/iterN/mep13/", "xstdev_mep13", "ME+1/3 weighted stdev x residual per chamber (mm)", xstdev_bins, xstdev_low, xstdev_high);
319  m_xstdev_mep14 = book1D("/iterN/mep14/", "xstdev_mep14", "ME+1/4 weighted stdev x residual per chamber (mm)", xstdev_bins, xstdev_low, xstdev_high);
320  m_xstdev_mep21 = book1D("/iterN/mep21/", "xstdev_mep21", "ME+2/1 weighted stdev x residual per chamber (mm)", xstdev_bins, xstdev_low, xstdev_high);
321  m_xstdev_mep22 = book1D("/iterN/mep22/", "xstdev_mep22", "ME+2/2 weighted stdev x residual per chamber (mm)", xstdev_bins, xstdev_low, xstdev_high);
322  m_xstdev_mep31 = book1D("/iterN/mep31/", "xstdev_mep31", "ME+3/1 weighted stdev x residual per chamber (mm)", xstdev_bins, xstdev_low, xstdev_high);
323  m_xstdev_mep32 = book1D("/iterN/mep32/", "xstdev_mep32", "ME+3/2 weighted stdev x residual per chamber (mm)", xstdev_bins, xstdev_low, xstdev_high);
324  m_xstdev_mep41 = book1D("/iterN/mep41/", "xstdev_mep41", "ME+4/1 weighted stdev x residual per chamber (mm)", xstdev_bins, xstdev_low, xstdev_high);
325  m_xstdev_mem11 = book1D("/iterN/mem11/", "xstdev_mem11", "ME-1/1 weighted stdev x residual per chamber (mm)", xstdev_bins, xstdev_low, xstdev_high);
326  m_xstdev_mem12 = book1D("/iterN/mem12/", "xstdev_mem12", "ME-1/2 weighted stdev x residual per chamber (mm)", xstdev_bins, xstdev_low, xstdev_high);
327  m_xstdev_mem13 = book1D("/iterN/mem13/", "xstdev_mem13", "ME-1/3 weighted stdev x residual per chamber (mm)", xstdev_bins, xstdev_low, xstdev_high);
328  m_xstdev_mem14 = book1D("/iterN/mem14/", "xstdev_mem14", "ME-1/4 weighted stdev x residual per chamber (mm)", xstdev_bins, xstdev_low, xstdev_high);
329  m_xstdev_mem21 = book1D("/iterN/mem21/", "xstdev_mem21", "ME-2/1 weighted stdev x residual per chamber (mm)", xstdev_bins, xstdev_low, xstdev_high);
330  m_xstdev_mem22 = book1D("/iterN/mem22/", "xstdev_mem22", "ME-2/2 weighted stdev x residual per chamber (mm)", xstdev_bins, xstdev_low, xstdev_high);
331  m_xstdev_mem31 = book1D("/iterN/mem31/", "xstdev_mem31", "ME-3/1 weighted stdev x residual per chamber (mm)", xstdev_bins, xstdev_low, xstdev_high);
332  m_xstdev_mem32 = book1D("/iterN/mem32/", "xstdev_mem32", "ME-3/2 weighted stdev x residual per chamber (mm)", xstdev_bins, xstdev_low, xstdev_high);
333  m_xstdev_mem41 = book1D("/iterN/mem41/", "xstdev_mem41", "ME-4/1 weighted stdev x residual per chamber (mm)", xstdev_bins, xstdev_low, xstdev_high);
334  m_xstdev_me11 = book1D("/iterN/me11/", "xstdev_me11", "ME1/1 weighted stdev x residual per chamber (mm)", xstdev_bins, xstdev_low, xstdev_high);
335  m_xstdev_me12 = book1D("/iterN/me12/", "xstdev_me12", "ME1/2 weighted stdev x residual per chamber (mm)", xstdev_bins, xstdev_low, xstdev_high);
336  m_xstdev_me13 = book1D("/iterN/me13/", "xstdev_me13", "ME1/3 weighted stdev x residual per chamber (mm)", xstdev_bins, xstdev_low, xstdev_high);
337  m_xstdev_me14 = book1D("/iterN/me14/", "xstdev_me14", "ME1/4 weighted stdev x residual per chamber (mm)", xstdev_bins, xstdev_low, xstdev_high);
338  m_xstdev_me21 = book1D("/iterN/me21/", "xstdev_me21", "ME2/1 weighted stdev x residual per chamber (mm)", xstdev_bins, xstdev_low, xstdev_high);
339  m_xstdev_me22 = book1D("/iterN/me22/", "xstdev_me22", "ME2/2 weighted stdev x residual per chamber (mm)", xstdev_bins, xstdev_low, xstdev_high);
340  m_xstdev_me31 = book1D("/iterN/me31/", "xstdev_me31", "ME3/1 weighted stdev x residual per chamber (mm)", xstdev_bins, xstdev_low, xstdev_high);
341  m_xstdev_me32 = book1D("/iterN/me32/", "xstdev_me32", "ME3/2 weighted stdev x residual per chamber (mm)", xstdev_bins, xstdev_low, xstdev_high);
342  m_xstdev_me41 = book1D("/iterN/me41/", "xstdev_me41", "ME4/1 weighted stdev x residual per chamber (mm)", xstdev_bins, xstdev_low, xstdev_high);
343 
344  m_xerronmean = book1D("/iterN/", "xerronmean", "error on x weighted mean residual per chamber (mm)", xerronmean_bins, xerronmean_low, xerronmean_high);
345  m_xerronmean_mb = book1D("/iterN/mb/", "xerronmean_mb", "barrel error on x weighted mean residual per chamber (mm)", xerronmean_bins, xerronmean_low, xerronmean_high);
346  m_xerronmean_me = book1D("/iterN/me/", "xerronmean_me", "endcap error on x weighted mean residual per chamber (mm)", xerronmean_bins, xerronmean_low, xerronmean_high);
347  m_xerronmean_mb1 = book1D("/iterN/mb1/", "xerronmean_mb1", "MB station 1 error on x weighted mean residual per chamber (mm)", xerronmean_bins, xerronmean_low, xerronmean_high);
348  m_xerronmean_mb2 = book1D("/iterN/mb2/", "xerronmean_mb2", "MB station 2 error on x weighted mean residual per chamber (mm)", xerronmean_bins, xerronmean_low, xerronmean_high);
349  m_xerronmean_mb3 = book1D("/iterN/mb3/", "xerronmean_mb3", "MB station 3 error on x weighted mean residual per chamber (mm)", xerronmean_bins, xerronmean_low, xerronmean_high);
350  m_xerronmean_mb4 = book1D("/iterN/mb4/", "xerronmean_mb4", "MB station 4 error on x weighted mean residual per chamber (mm)", xerronmean_bins, xerronmean_low, xerronmean_high);
351  m_xerronmean_minus2 = book1D("/iterN/minus2/", "xerronmean_minus2", "MB wheel -2 error on x weighted mean residual per chamber (mm)", xerronmean_bins, xerronmean_low, xerronmean_high);
352  m_xerronmean_minus1 = book1D("/iterN/minus1/", "xerronmean_minus1", "MB wheel -1 error on x weighted mean residual per chamber (mm)", xerronmean_bins, xerronmean_low, xerronmean_high);
353  m_xerronmean_zero = book1D("/iterN/zero/", "xerronmean_zero", "MB wheel 0 error on x weighted mean residual per chamber (mm)", xerronmean_bins, xerronmean_low, xerronmean_high);
354  m_xerronmean_plus1 = book1D("/iterN/plus1/", "xerronmean_plus1", "MB wheel +1 error on x weighted mean residual per chamber (mm)", xerronmean_bins, xerronmean_low, xerronmean_high);
355  m_xerronmean_plus2 = book1D("/iterN/plus2/", "xerronmean_plus2", "MB wheel +2 error on x weighted mean residual per chamber (mm)", xerronmean_bins, xerronmean_low, xerronmean_high);
356  m_xerronmean_mep11 = book1D("/iterN/mep11/", "xerronmean_mep11", "ME+1/1 error on x weighted mean residual per chamber (mm)", xerronmean_bins, xerronmean_low, xerronmean_high);
357  m_xerronmean_mep12 = book1D("/iterN/mep12/", "xerronmean_mep12", "ME+1/2 error on x weighted mean residual per chamber (mm)", xerronmean_bins, xerronmean_low, xerronmean_high);
358  m_xerronmean_mep13 = book1D("/iterN/mep13/", "xerronmean_mep13", "ME+1/3 error on x weighted mean residual per chamber (mm)", xerronmean_bins, xerronmean_low, xerronmean_high);
359  m_xerronmean_mep14 = book1D("/iterN/mep14/", "xerronmean_mep14", "ME+1/4 error on x weighted mean residual per chamber (mm)", xerronmean_bins, xerronmean_low, xerronmean_high);
360  m_xerronmean_mep21 = book1D("/iterN/mep21/", "xerronmean_mep21", "ME+2/1 error on x weighted mean residual per chamber (mm)", xerronmean_bins, xerronmean_low, xerronmean_high);
361  m_xerronmean_mep22 = book1D("/iterN/mep22/", "xerronmean_mep22", "ME+2/2 error on x weighted mean residual per chamber (mm)", xerronmean_bins, xerronmean_low, xerronmean_high);
362  m_xerronmean_mep31 = book1D("/iterN/mep31/", "xerronmean_mep31", "ME+3/1 error on x weighted mean residual per chamber (mm)", xerronmean_bins, xerronmean_low, xerronmean_high);
363  m_xerronmean_mep32 = book1D("/iterN/mep32/", "xerronmean_mep32", "ME+3/2 error on x weighted mean residual per chamber (mm)", xerronmean_bins, xerronmean_low, xerronmean_high);
364  m_xerronmean_mep41 = book1D("/iterN/mep41/", "xerronmean_mep41", "ME+4/1 error on x weighted mean residual per chamber (mm)", xerronmean_bins, xerronmean_low, xerronmean_high);
365  m_xerronmean_mem11 = book1D("/iterN/mem11/", "xerronmean_mem11", "ME-1/1 error on x weighted mean residual per chamber (mm)", xerronmean_bins, xerronmean_low, xerronmean_high);
366  m_xerronmean_mem12 = book1D("/iterN/mem12/", "xerronmean_mem12", "ME-1/2 error on x weighted mean residual per chamber (mm)", xerronmean_bins, xerronmean_low, xerronmean_high);
367  m_xerronmean_mem13 = book1D("/iterN/mem13/", "xerronmean_mem13", "ME-1/3 error on x weighted mean residual per chamber (mm)", xerronmean_bins, xerronmean_low, xerronmean_high);
368  m_xerronmean_mem14 = book1D("/iterN/mem14/", "xerronmean_mem14", "ME-1/4 error on x weighted mean residual per chamber (mm)", xerronmean_bins, xerronmean_low, xerronmean_high);
369  m_xerronmean_mem21 = book1D("/iterN/mem21/", "xerronmean_mem21", "ME-2/1 error on x weighted mean residual per chamber (mm)", xerronmean_bins, xerronmean_low, xerronmean_high);
370  m_xerronmean_mem22 = book1D("/iterN/mem22/", "xerronmean_mem22", "ME-2/2 error on x weighted mean residual per chamber (mm)", xerronmean_bins, xerronmean_low, xerronmean_high);
371  m_xerronmean_mem31 = book1D("/iterN/mem31/", "xerronmean_mem31", "ME-3/1 error on x weighted mean residual per chamber (mm)", xerronmean_bins, xerronmean_low, xerronmean_high);
372  m_xerronmean_mem32 = book1D("/iterN/mem32/", "xerronmean_mem32", "ME-3/2 error on x weighted mean residual per chamber (mm)", xerronmean_bins, xerronmean_low, xerronmean_high);
373  m_xerronmean_mem41 = book1D("/iterN/mem41/", "xerronmean_mem41", "ME-4/1 error on x weighted mean residual per chamber (mm)", xerronmean_bins, xerronmean_low, xerronmean_high);
374  m_xerronmean_me11 = book1D("/iterN/me11/", "xerronmean_me11", "ME1/1 error on x weighted mean residual per chamber (mm)", xerronmean_bins, xerronmean_low, xerronmean_high);
375  m_xerronmean_me12 = book1D("/iterN/me12/", "xerronmean_me12", "ME1/2 error on x weighted mean residual per chamber (mm)", xerronmean_bins, xerronmean_low, xerronmean_high);
376  m_xerronmean_me13 = book1D("/iterN/me13/", "xerronmean_me13", "ME1/3 error on x weighted mean residual per chamber (mm)", xerronmean_bins, xerronmean_low, xerronmean_high);
377  m_xerronmean_me14 = book1D("/iterN/me14/", "xerronmean_me14", "ME1/4 error on x weighted mean residual per chamber (mm)", xerronmean_bins, xerronmean_low, xerronmean_high);
378  m_xerronmean_me21 = book1D("/iterN/me21/", "xerronmean_me21", "ME2/1 error on x weighted mean residual per chamber (mm)", xerronmean_bins, xerronmean_low, xerronmean_high);
379  m_xerronmean_me22 = book1D("/iterN/me22/", "xerronmean_me22", "ME2/2 error on x weighted mean residual per chamber (mm)", xerronmean_bins, xerronmean_low, xerronmean_high);
380  m_xerronmean_me31 = book1D("/iterN/me31/", "xerronmean_me31", "ME3/1 error on x weighted mean residual per chamber (mm)", xerronmean_bins, xerronmean_low, xerronmean_high);
381  m_xerronmean_me32 = book1D("/iterN/me32/", "xerronmean_me32", "ME3/2 error on x weighted mean residual per chamber (mm)", xerronmean_bins, xerronmean_low, xerronmean_high);
382  m_xerronmean_me41 = book1D("/iterN/me41/", "xerronmean_me41", "ME4/1 error on x weighted mean residual per chamber (mm)", xerronmean_bins, xerronmean_low, xerronmean_high);
383 
384  m_yresid = book1D("/iterN/", "yresid", "y residual (mm)", yresid_bins, yresid_low, yresid_high);
385  m_yresid_mb = book1D("/iterN/mb/", "yresid_mb", "barrel y residual (mm)", yresid_bins, yresid_low, yresid_high);
386  m_yresid_me = book1D("/iterN/me/", "yresid_me", "endcap y residual (mm)", yresid_bins, yresid_low, yresid_high);
387  m_yresid_mb1 = book1D("/iterN/mb1/", "yresid_mb1", "MB station 1 y residual (mm)", yresid_bins, yresid_low, yresid_high);
388  m_yresid_mb2 = book1D("/iterN/mb2/", "yresid_mb2", "MB station 2 y residual (mm)", yresid_bins, yresid_low, yresid_high);
389  m_yresid_mb3 = book1D("/iterN/mb3/", "yresid_mb3", "MB station 3 y residual (mm)", yresid_bins, yresid_low, yresid_high);
390  m_yresid_mb4 = book1D("/iterN/mb4/", "yresid_mb4", "MB station 4 y residual (mm)", yresid_bins, yresid_low, yresid_high);
391  m_yresid_minus2 = book1D("/iterN/minus2/", "yresid_minus2", "MB wheel -2 y residual (mm)", yresid_bins, yresid_low, yresid_high);
392  m_yresid_minus1 = book1D("/iterN/minus1/", "yresid_minus1", "MB wheel -1 y residual (mm)", yresid_bins, yresid_low, yresid_high);
393  m_yresid_zero = book1D("/iterN/zero/", "yresid_zero", "MB wheel 0 y residual (mm)", yresid_bins, yresid_low, yresid_high);
394  m_yresid_plus1 = book1D("/iterN/plus1/", "yresid_plus1", "MB wheel +1 y residual (mm)", yresid_bins, yresid_low, yresid_high);
395  m_yresid_plus2 = book1D("/iterN/plus2/", "yresid_plus2", "MB wheel +2 y residual (mm)", yresid_bins, yresid_low, yresid_high);
396  m_yresid_mep11 = book1D("/iterN/mep11/", "yresid_mep11", "ME+1/1 y residual (mm)", yresid_bins, yresid_low, yresid_high);
397  m_yresid_mep12 = book1D("/iterN/mep12/", "yresid_mep12", "ME+1/2 y residual (mm)", yresid_bins, yresid_low, yresid_high);
398  m_yresid_mep13 = book1D("/iterN/mep13/", "yresid_mep13", "ME+1/3 y residual (mm)", yresid_bins, yresid_low, yresid_high);
399  m_yresid_mep14 = book1D("/iterN/mep14/", "yresid_mep14", "ME+1/4 y residual (mm)", yresid_bins, yresid_low, yresid_high);
400  m_yresid_mep21 = book1D("/iterN/mep21/", "yresid_mep21", "ME+2/1 y residual (mm)", yresid_bins, yresid_low, yresid_high);
401  m_yresid_mep22 = book1D("/iterN/mep22/", "yresid_mep22", "ME+2/2 y residual (mm)", yresid_bins, yresid_low, yresid_high);
402  m_yresid_mep31 = book1D("/iterN/mep31/", "yresid_mep31", "ME+3/1 y residual (mm)", yresid_bins, yresid_low, yresid_high);
403  m_yresid_mep32 = book1D("/iterN/mep32/", "yresid_mep32", "ME+3/2 y residual (mm)", yresid_bins, yresid_low, yresid_high);
404  m_yresid_mep41 = book1D("/iterN/mep41/", "yresid_mep41", "ME+4/1 y residual (mm)", yresid_bins, yresid_low, yresid_high);
405  m_yresid_mem11 = book1D("/iterN/mem11/", "yresid_mem11", "ME-1/1 y residual (mm)", yresid_bins, yresid_low, yresid_high);
406  m_yresid_mem12 = book1D("/iterN/mem12/", "yresid_mem12", "ME-1/2 y residual (mm)", yresid_bins, yresid_low, yresid_high);
407  m_yresid_mem13 = book1D("/iterN/mem13/", "yresid_mem13", "ME-1/3 y residual (mm)", yresid_bins, yresid_low, yresid_high);
408  m_yresid_mem14 = book1D("/iterN/mem14/", "yresid_mem14", "ME-1/4 y residual (mm)", yresid_bins, yresid_low, yresid_high);
409  m_yresid_mem21 = book1D("/iterN/mem21/", "yresid_mem21", "ME-2/1 y residual (mm)", yresid_bins, yresid_low, yresid_high);
410  m_yresid_mem22 = book1D("/iterN/mem22/", "yresid_mem22", "ME-2/2 y residual (mm)", yresid_bins, yresid_low, yresid_high);
411  m_yresid_mem31 = book1D("/iterN/mem31/", "yresid_mem31", "ME-3/1 y residual (mm)", yresid_bins, yresid_low, yresid_high);
412  m_yresid_mem32 = book1D("/iterN/mem32/", "yresid_mem32", "ME-3/2 y residual (mm)", yresid_bins, yresid_low, yresid_high);
413  m_yresid_mem41 = book1D("/iterN/mem41/", "yresid_mem41", "ME-4/1 y residual (mm)", yresid_bins, yresid_low, yresid_high);
414  m_yresid_me11 = book1D("/iterN/me11/", "yresid_me11", "ME1/1 y residual (mm)", yresid_bins, yresid_low, yresid_high);
415  m_yresid_me12 = book1D("/iterN/me12/", "yresid_me12", "ME1/2 y residual (mm)", yresid_bins, yresid_low, yresid_high);
416  m_yresid_me13 = book1D("/iterN/me13/", "yresid_me13", "ME1/3 y residual (mm)", yresid_bins, yresid_low, yresid_high);
417  m_yresid_me14 = book1D("/iterN/me14/", "yresid_me14", "ME1/4 y residual (mm)", yresid_bins, yresid_low, yresid_high);
418  m_yresid_me21 = book1D("/iterN/me21/", "yresid_me21", "ME2/1 y residual (mm)", yresid_bins, yresid_low, yresid_high);
419  m_yresid_me22 = book1D("/iterN/me22/", "yresid_me22", "ME2/2 y residual (mm)", yresid_bins, yresid_low, yresid_high);
420  m_yresid_me31 = book1D("/iterN/me31/", "yresid_me31", "ME3/1 y residual (mm)", yresid_bins, yresid_low, yresid_high);
421  m_yresid_me32 = book1D("/iterN/me32/", "yresid_me32", "ME3/2 y residual (mm)", yresid_bins, yresid_low, yresid_high);
422  m_yresid_me41 = book1D("/iterN/me41/", "yresid_me41", "ME4/1 y residual (mm)", yresid_bins, yresid_low, yresid_high);
423 
424  m_ymean = book1D("/iterN/", "ymean", "weighted mean y residual per chamber (mm)", ymean_bins, ymean_low, ymean_high);
425  m_ymean_mb = book1D("/iterN/mb/", "ymean_mb", "barrel weighted mean y residual per chamber (mm)", ymean_bins, ymean_low, ymean_high);
426  m_ymean_me = book1D("/iterN/me/", "ymean_me", "endcap weighted mean y residual per chamber (mm)", ymean_bins, ymean_low, ymean_high);
427  m_ymean_mb1 = book1D("/iterN/mb1/", "ymean_mb1", "MB station 1 weighted mean y residual per chamber (mm)", ymean_bins, ymean_low, ymean_high);
428  m_ymean_mb2 = book1D("/iterN/mb2/", "ymean_mb2", "MB station 2 weighted mean y residual per chamber (mm)", ymean_bins, ymean_low, ymean_high);
429  m_ymean_mb3 = book1D("/iterN/mb3/", "ymean_mb3", "MB station 3 weighted mean y residual per chamber (mm)", ymean_bins, ymean_low, ymean_high);
430  m_ymean_mb4 = book1D("/iterN/mb4/", "ymean_mb4", "MB station 4 weighted mean y residual per chamber (mm)", ymean_bins, ymean_low, ymean_high);
431  m_ymean_minus2 = book1D("/iterN/minus2/", "ymean_minus2", "MB wheel -2 weighted mean y residual per chamber (mm)", ymean_bins, ymean_low, ymean_high);
432  m_ymean_minus1 = book1D("/iterN/minus1/", "ymean_minus1", "MB wheel -1 weighted mean y residual per chamber (mm)", ymean_bins, ymean_low, ymean_high);
433  m_ymean_zero = book1D("/iterN/zero/", "ymean_zero", "MB wheel 0 weighted mean y residual per chamber (mm)", ymean_bins, ymean_low, ymean_high);
434  m_ymean_plus1 = book1D("/iterN/plus1/", "ymean_plus1", "MB wheel +1 weighted mean y residual per chamber (mm)", ymean_bins, ymean_low, ymean_high);
435  m_ymean_plus2 = book1D("/iterN/plus2/", "ymean_plus2", "MB wheel +2 weighted mean y residual per chamber (mm)", ymean_bins, ymean_low, ymean_high);
436  m_ymean_mep11 = book1D("/iterN/mep11/", "ymean_mep11", "ME+1/1 weighted mean y residual per chamber (mm)", ymean_bins, ymean_low, ymean_high);
437  m_ymean_mep12 = book1D("/iterN/mep12/", "ymean_mep12", "ME+1/2 weighted mean y residual per chamber (mm)", ymean_bins, ymean_low, ymean_high);
438  m_ymean_mep13 = book1D("/iterN/mep13/", "ymean_mep13", "ME+1/3 weighted mean y residual per chamber (mm)", ymean_bins, ymean_low, ymean_high);
439  m_ymean_mep14 = book1D("/iterN/mep14/", "ymean_mep14", "ME+1/4 weighted mean y residual per chamber (mm)", ymean_bins, ymean_low, ymean_high);
440  m_ymean_mep21 = book1D("/iterN/mep21/", "ymean_mep21", "ME+2/1 weighted mean y residual per chamber (mm)", ymean_bins, ymean_low, ymean_high);
441  m_ymean_mep22 = book1D("/iterN/mep22/", "ymean_mep22", "ME+2/2 weighted mean y residual per chamber (mm)", ymean_bins, ymean_low, ymean_high);
442  m_ymean_mep31 = book1D("/iterN/mep31/", "ymean_mep31", "ME+3/1 weighted mean y residual per chamber (mm)", ymean_bins, ymean_low, ymean_high);
443  m_ymean_mep32 = book1D("/iterN/mep32/", "ymean_mep32", "ME+3/2 weighted mean y residual per chamber (mm)", ymean_bins, ymean_low, ymean_high);
444  m_ymean_mep41 = book1D("/iterN/mep41/", "ymean_mep41", "ME+4/1 weighted mean y residual per chamber (mm)", ymean_bins, ymean_low, ymean_high);
445  m_ymean_mem11 = book1D("/iterN/mem11/", "ymean_mem11", "ME-1/1 weighted mean y residual per chamber (mm)", ymean_bins, ymean_low, ymean_high);
446  m_ymean_mem12 = book1D("/iterN/mem12/", "ymean_mem12", "ME-1/2 weighted mean y residual per chamber (mm)", ymean_bins, ymean_low, ymean_high);
447  m_ymean_mem13 = book1D("/iterN/mem13/", "ymean_mem13", "ME-1/3 weighted mean y residual per chamber (mm)", ymean_bins, ymean_low, ymean_high);
448  m_ymean_mem14 = book1D("/iterN/mem14/", "ymean_mem14", "ME-1/4 weighted mean y residual per chamber (mm)", ymean_bins, ymean_low, ymean_high);
449  m_ymean_mem21 = book1D("/iterN/mem21/", "ymean_mem21", "ME-2/1 weighted mean y residual per chamber (mm)", ymean_bins, ymean_low, ymean_high);
450  m_ymean_mem22 = book1D("/iterN/mem22/", "ymean_mem22", "ME-2/2 weighted mean y residual per chamber (mm)", ymean_bins, ymean_low, ymean_high);
451  m_ymean_mem31 = book1D("/iterN/mem31/", "ymean_mem31", "ME-3/1 weighted mean y residual per chamber (mm)", ymean_bins, ymean_low, ymean_high);
452  m_ymean_mem32 = book1D("/iterN/mem32/", "ymean_mem32", "ME-3/2 weighted mean y residual per chamber (mm)", ymean_bins, ymean_low, ymean_high);
453  m_ymean_mem41 = book1D("/iterN/mem41/", "ymean_mem41", "ME-4/1 weighted mean y residual per chamber (mm)", ymean_bins, ymean_low, ymean_high);
454  m_ymean_me11 = book1D("/iterN/me11/", "ymean_me11", "ME1/1 weighted mean y residual per chamber (mm)", ymean_bins, ymean_low, ymean_high);
455  m_ymean_me12 = book1D("/iterN/me12/", "ymean_me12", "ME1/2 weighted mean y residual per chamber (mm)", ymean_bins, ymean_low, ymean_high);
456  m_ymean_me13 = book1D("/iterN/me13/", "ymean_me13", "ME1/3 weighted mean y residual per chamber (mm)", ymean_bins, ymean_low, ymean_high);
457  m_ymean_me14 = book1D("/iterN/me14/", "ymean_me14", "ME1/4 weighted mean y residual per chamber (mm)", ymean_bins, ymean_low, ymean_high);
458  m_ymean_me21 = book1D("/iterN/me21/", "ymean_me21", "ME2/1 weighted mean y residual per chamber (mm)", ymean_bins, ymean_low, ymean_high);
459  m_ymean_me22 = book1D("/iterN/me22/", "ymean_me22", "ME2/2 weighted mean y residual per chamber (mm)", ymean_bins, ymean_low, ymean_high);
460  m_ymean_me31 = book1D("/iterN/me31/", "ymean_me31", "ME3/1 weighted mean y residual per chamber (mm)", ymean_bins, ymean_low, ymean_high);
461  m_ymean_me32 = book1D("/iterN/me32/", "ymean_me32", "ME3/2 weighted mean y residual per chamber (mm)", ymean_bins, ymean_low, ymean_high);
462  m_ymean_me41 = book1D("/iterN/me41/", "ymean_me41", "ME4/1 weighted mean y residual per chamber (mm)", ymean_bins, ymean_low, ymean_high);
463 
464  m_ystdev = book1D("/iterN/", "ystdev", "weighted stdev y residual per chamber (mm)", ystdev_bins, ystdev_low, ystdev_high);
465  m_ystdev_mb = book1D("/iterN/mb/", "ystdev_mb", "barrel weighted stdev y residual per chamber (mm)", ystdev_bins, ystdev_low, ystdev_high);
466  m_ystdev_me = book1D("/iterN/me/", "ystdev_me", "endcap weighted stdev y residual per chamber (mm)", ystdev_bins, ystdev_low, ystdev_high);
467  m_ystdev_mb1 = book1D("/iterN/mb1/", "ystdev_mb1", "MB station 1 weighted stdev y residual per chamber (mm)", ystdev_bins, ystdev_low, ystdev_high);
468  m_ystdev_mb2 = book1D("/iterN/mb2/", "ystdev_mb2", "MB station 2 weighted stdev y residual per chamber (mm)", ystdev_bins, ystdev_low, ystdev_high);
469  m_ystdev_mb3 = book1D("/iterN/mb3/", "ystdev_mb3", "MB station 3 weighted stdev y residual per chamber (mm)", ystdev_bins, ystdev_low, ystdev_high);
470  m_ystdev_mb4 = book1D("/iterN/mb4/", "ystdev_mb4", "MB station 4 weighted stdev y residual per chamber (mm)", ystdev_bins, ystdev_low, ystdev_high);
471  m_ystdev_minus2 = book1D("/iterN/minus2/", "ystdev_minus2", "MB wheel -2 weighted stdev y residual per chamber (mm)", ystdev_bins, ystdev_low, ystdev_high);
472  m_ystdev_minus1 = book1D("/iterN/minus1/", "ystdev_minus1", "MB wheel -1 weighted stdev y residual per chamber (mm)", ystdev_bins, ystdev_low, ystdev_high);
473  m_ystdev_zero = book1D("/iterN/zero/", "ystdev_zero", "MB wheel 0 weighted stdev y residual per chamber (mm)", ystdev_bins, ystdev_low, ystdev_high);
474  m_ystdev_plus1 = book1D("/iterN/plus1/", "ystdev_plus1", "MB wheel +1 weighted stdev y residual per chamber (mm)", ystdev_bins, ystdev_low, ystdev_high);
475  m_ystdev_plus2 = book1D("/iterN/plus2/", "ystdev_plus2", "MB wheel +2 weighted stdev y residual per chamber (mm)", ystdev_bins, ystdev_low, ystdev_high);
476  m_ystdev_mep11 = book1D("/iterN/mep11/", "ystdev_mep11", "ME+1/1 weighted stdev y residual per chamber (mm)", ystdev_bins, ystdev_low, ystdev_high);
477  m_ystdev_mep12 = book1D("/iterN/mep12/", "ystdev_mep12", "ME+1/2 weighted stdev y residual per chamber (mm)", ystdev_bins, ystdev_low, ystdev_high);
478  m_ystdev_mep13 = book1D("/iterN/mep13/", "ystdev_mep13", "ME+1/3 weighted stdev y residual per chamber (mm)", ystdev_bins, ystdev_low, ystdev_high);
479  m_ystdev_mep14 = book1D("/iterN/mep14/", "ystdev_mep14", "ME+1/4 weighted stdev y residual per chamber (mm)", ystdev_bins, ystdev_low, ystdev_high);
480  m_ystdev_mep21 = book1D("/iterN/mep21/", "ystdev_mep21", "ME+2/1 weighted stdev y residual per chamber (mm)", ystdev_bins, ystdev_low, ystdev_high);
481  m_ystdev_mep22 = book1D("/iterN/mep22/", "ystdev_mep22", "ME+2/2 weighted stdev y residual per chamber (mm)", ystdev_bins, ystdev_low, ystdev_high);
482  m_ystdev_mep31 = book1D("/iterN/mep31/", "ystdev_mep31", "ME+3/1 weighted stdev y residual per chamber (mm)", ystdev_bins, ystdev_low, ystdev_high);
483  m_ystdev_mep32 = book1D("/iterN/mep32/", "ystdev_mep32", "ME+3/2 weighted stdev y residual per chamber (mm)", ystdev_bins, ystdev_low, ystdev_high);
484  m_ystdev_mep41 = book1D("/iterN/mep41/", "ystdev_mep41", "ME+4/1 weighted stdev y residual per chamber (mm)", ystdev_bins, ystdev_low, ystdev_high);
485  m_ystdev_mem11 = book1D("/iterN/mem11/", "ystdev_mem11", "ME-1/1 weighted stdev y residual per chamber (mm)", ystdev_bins, ystdev_low, ystdev_high);
486  m_ystdev_mem12 = book1D("/iterN/mem12/", "ystdev_mem12", "ME-1/2 weighted stdev y residual per chamber (mm)", ystdev_bins, ystdev_low, ystdev_high);
487  m_ystdev_mem13 = book1D("/iterN/mem13/", "ystdev_mem13", "ME-1/3 weighted stdev y residual per chamber (mm)", ystdev_bins, ystdev_low, ystdev_high);
488  m_ystdev_mem14 = book1D("/iterN/mem14/", "ystdev_mem14", "ME-1/4 weighted stdev y residual per chamber (mm)", ystdev_bins, ystdev_low, ystdev_high);
489  m_ystdev_mem21 = book1D("/iterN/mem21/", "ystdev_mem21", "ME-2/1 weighted stdev y residual per chamber (mm)", ystdev_bins, ystdev_low, ystdev_high);
490  m_ystdev_mem22 = book1D("/iterN/mem22/", "ystdev_mem22", "ME-2/2 weighted stdev y residual per chamber (mm)", ystdev_bins, ystdev_low, ystdev_high);
491  m_ystdev_mem31 = book1D("/iterN/mem31/", "ystdev_mem31", "ME-3/1 weighted stdev y residual per chamber (mm)", ystdev_bins, ystdev_low, ystdev_high);
492  m_ystdev_mem32 = book1D("/iterN/mem32/", "ystdev_mem32", "ME-3/2 weighted stdev y residual per chamber (mm)", ystdev_bins, ystdev_low, ystdev_high);
493  m_ystdev_mem41 = book1D("/iterN/mem41/", "ystdev_mem41", "ME-4/1 weighted stdev y residual per chamber (mm)", ystdev_bins, ystdev_low, ystdev_high);
494  m_ystdev_me11 = book1D("/iterN/me11/", "ystdev_me11", "ME1/1 weighted stdev y residual per chamber (mm)", ystdev_bins, ystdev_low, ystdev_high);
495  m_ystdev_me12 = book1D("/iterN/me12/", "ystdev_me12", "ME1/2 weighted stdev y residual per chamber (mm)", ystdev_bins, ystdev_low, ystdev_high);
496  m_ystdev_me13 = book1D("/iterN/me13/", "ystdev_me13", "ME1/3 weighted stdev y residual per chamber (mm)", ystdev_bins, ystdev_low, ystdev_high);
497  m_ystdev_me14 = book1D("/iterN/me14/", "ystdev_me14", "ME1/4 weighted stdev y residual per chamber (mm)", ystdev_bins, ystdev_low, ystdev_high);
498  m_ystdev_me21 = book1D("/iterN/me21/", "ystdev_me21", "ME2/1 weighted stdev y residual per chamber (mm)", ystdev_bins, ystdev_low, ystdev_high);
499  m_ystdev_me22 = book1D("/iterN/me22/", "ystdev_me22", "ME2/2 weighted stdev y residual per chamber (mm)", ystdev_bins, ystdev_low, ystdev_high);
500  m_ystdev_me31 = book1D("/iterN/me31/", "ystdev_me31", "ME3/1 weighted stdev y residual per chamber (mm)", ystdev_bins, ystdev_low, ystdev_high);
501  m_ystdev_me32 = book1D("/iterN/me32/", "ystdev_me32", "ME3/2 weighted stdev y residual per chamber (mm)", ystdev_bins, ystdev_low, ystdev_high);
502  m_ystdev_me41 = book1D("/iterN/me41/", "ystdev_me41", "ME4/1 weighted stdev y residual per chamber (mm)", ystdev_bins, ystdev_low, ystdev_high);
503 
504  m_yerronmean = book1D("/iterN/", "yerronmean", "error on y weighted mean residual per chamber (mm)", yerronmean_bins, yerronmean_low, yerronmean_high);
505  m_yerronmean_mb = book1D("/iterN/mb/", "yerronmean_mb", "barrel error on y weighted mean residual per chamber (mm)", yerronmean_bins, yerronmean_low, yerronmean_high);
506  m_yerronmean_me = book1D("/iterN/me/", "yerronmean_me", "endcap error on y weighted mean residual per chamber (mm)", yerronmean_bins, yerronmean_low, yerronmean_high);
507  m_yerronmean_mb1 = book1D("/iterN/mb1/", "yerronmean_mb1", "MB station 1 error on y weighted mean residual per chamber (mm)", yerronmean_bins, yerronmean_low, yerronmean_high);
508  m_yerronmean_mb2 = book1D("/iterN/mb2/", "yerronmean_mb2", "MB station 2 error on y weighted mean residual per chamber (mm)", yerronmean_bins, yerronmean_low, yerronmean_high);
509  m_yerronmean_mb3 = book1D("/iterN/mb3/", "yerronmean_mb3", "MB station 3 error on y weighted mean residual per chamber (mm)", yerronmean_bins, yerronmean_low, yerronmean_high);
510  m_yerronmean_mb4 = book1D("/iterN/mb4/", "yerronmean_mb4", "MB station 4 error on y weighted mean residual per chamber (mm)", yerronmean_bins, yerronmean_low, yerronmean_high);
511  m_yerronmean_minus2 = book1D("/iterN/minus2/", "yerronmean_minus2", "MB wheel -2 error on y weighted mean residual per chamber (mm)", yerronmean_bins, yerronmean_low, yerronmean_high);
512  m_yerronmean_minus1 = book1D("/iterN/minus1/", "yerronmean_minus1", "MB wheel -1 error on y weighted mean residual per chamber (mm)", yerronmean_bins, yerronmean_low, yerronmean_high);
513  m_yerronmean_zero = book1D("/iterN/zero/", "yerronmean_zero", "MB wheel 0 error on y weighted mean residual per chamber (mm)", yerronmean_bins, yerronmean_low, yerronmean_high);
514  m_yerronmean_plus1 = book1D("/iterN/plus1/", "yerronmean_plus1", "MB wheel +1 error on y weighted mean residual per chamber (mm)", yerronmean_bins, yerronmean_low, yerronmean_high);
515  m_yerronmean_plus2 = book1D("/iterN/plus2/", "yerronmean_plus2", "MB wheel +2 error on y weighted mean residual per chamber (mm)", yerronmean_bins, yerronmean_low, yerronmean_high);
516  m_yerronmean_mep11 = book1D("/iterN/mep11/", "yerronmean_mep11", "ME+1/1 error on y weighted mean residual per chamber (mm)", yerronmean_bins, yerronmean_low, yerronmean_high);
517  m_yerronmean_mep12 = book1D("/iterN/mep12/", "yerronmean_mep12", "ME+1/2 error on y weighted mean residual per chamber (mm)", yerronmean_bins, yerronmean_low, yerronmean_high);
518  m_yerronmean_mep13 = book1D("/iterN/mep13/", "yerronmean_mep13", "ME+1/3 error on y weighted mean residual per chamber (mm)", yerronmean_bins, yerronmean_low, yerronmean_high);
519  m_yerronmean_mep14 = book1D("/iterN/mep14/", "yerronmean_mep14", "ME+1/4 error on y weighted mean residual per chamber (mm)", yerronmean_bins, yerronmean_low, yerronmean_high);
520  m_yerronmean_mep21 = book1D("/iterN/mep21/", "yerronmean_mep21", "ME+2/1 error on y weighted mean residual per chamber (mm)", yerronmean_bins, yerronmean_low, yerronmean_high);
521  m_yerronmean_mep22 = book1D("/iterN/mep22/", "yerronmean_mep22", "ME+2/2 error on y weighted mean residual per chamber (mm)", yerronmean_bins, yerronmean_low, yerronmean_high);
522  m_yerronmean_mep31 = book1D("/iterN/mep31/", "yerronmean_mep31", "ME+3/1 error on y weighted mean residual per chamber (mm)", yerronmean_bins, yerronmean_low, yerronmean_high);
523  m_yerronmean_mep32 = book1D("/iterN/mep32/", "yerronmean_mep32", "ME+3/2 error on y weighted mean residual per chamber (mm)", yerronmean_bins, yerronmean_low, yerronmean_high);
524  m_yerronmean_mep41 = book1D("/iterN/mep41/", "yerronmean_mep41", "ME+4/1 error on y weighted mean residual per chamber (mm)", yerronmean_bins, yerronmean_low, yerronmean_high);
525  m_yerronmean_mem11 = book1D("/iterN/mem11/", "yerronmean_mem11", "ME-1/1 error on y weighted mean residual per chamber (mm)", yerronmean_bins, yerronmean_low, yerronmean_high);
526  m_yerronmean_mem12 = book1D("/iterN/mem12/", "yerronmean_mem12", "ME-1/2 error on y weighted mean residual per chamber (mm)", yerronmean_bins, yerronmean_low, yerronmean_high);
527  m_yerronmean_mem13 = book1D("/iterN/mem13/", "yerronmean_mem13", "ME-1/3 error on y weighted mean residual per chamber (mm)", yerronmean_bins, yerronmean_low, yerronmean_high);
528  m_yerronmean_mem14 = book1D("/iterN/mem14/", "yerronmean_mem14", "ME-1/4 error on y weighted mean residual per chamber (mm)", yerronmean_bins, yerronmean_low, yerronmean_high);
529  m_yerronmean_mem21 = book1D("/iterN/mem21/", "yerronmean_mem21", "ME-2/1 error on y weighted mean residual per chamber (mm)", yerronmean_bins, yerronmean_low, yerronmean_high);
530  m_yerronmean_mem22 = book1D("/iterN/mem22/", "yerronmean_mem22", "ME-2/2 error on y weighted mean residual per chamber (mm)", yerronmean_bins, yerronmean_low, yerronmean_high);
531  m_yerronmean_mem31 = book1D("/iterN/mem31/", "yerronmean_mem31", "ME-3/1 error on y weighted mean residual per chamber (mm)", yerronmean_bins, yerronmean_low, yerronmean_high);
532  m_yerronmean_mem32 = book1D("/iterN/mem32/", "yerronmean_mem32", "ME-3/2 error on y weighted mean residual per chamber (mm)", yerronmean_bins, yerronmean_low, yerronmean_high);
533  m_yerronmean_mem41 = book1D("/iterN/mem41/", "yerronmean_mem41", "ME-4/1 error on y weighted mean residual per chamber (mm)", yerronmean_bins, yerronmean_low, yerronmean_high);
534  m_yerronmean_me11 = book1D("/iterN/me11/", "yerronmean_me11", "ME1/1 error on y weighted mean residual per chamber (mm)", yerronmean_bins, yerronmean_low, yerronmean_high);
535  m_yerronmean_me12 = book1D("/iterN/me12/", "yerronmean_me12", "ME1/2 error on y weighted mean residual per chamber (mm)", yerronmean_bins, yerronmean_low, yerronmean_high);
536  m_yerronmean_me13 = book1D("/iterN/me13/", "yerronmean_me13", "ME1/3 error on y weighted mean residual per chamber (mm)", yerronmean_bins, yerronmean_low, yerronmean_high);
537  m_yerronmean_me14 = book1D("/iterN/me14/", "yerronmean_me14", "ME1/4 error on y weighted mean residual per chamber (mm)", yerronmean_bins, yerronmean_low, yerronmean_high);
538  m_yerronmean_me21 = book1D("/iterN/me21/", "yerronmean_me21", "ME2/1 error on y weighted mean residual per chamber (mm)", yerronmean_bins, yerronmean_low, yerronmean_high);
539  m_yerronmean_me22 = book1D("/iterN/me22/", "yerronmean_me22", "ME2/2 error on y weighted mean residual per chamber (mm)", yerronmean_bins, yerronmean_low, yerronmean_high);
540  m_yerronmean_me31 = book1D("/iterN/me31/", "yerronmean_me31", "ME3/1 error on y weighted mean residual per chamber (mm)", yerronmean_bins, yerronmean_low, yerronmean_high);
541  m_yerronmean_me32 = book1D("/iterN/me32/", "yerronmean_me32", "ME3/2 error on y weighted mean residual per chamber (mm)", yerronmean_bins, yerronmean_low, yerronmean_high);
542  m_yerronmean_me41 = book1D("/iterN/me41/", "yerronmean_me41", "ME4/1 error on y weighted mean residual per chamber (mm)", yerronmean_bins, yerronmean_low, yerronmean_high);
543 
544  m_chambers = directory("/iterN/")->make<TTree>("chambers", "residual statistics for each chamber");
545  m_chambers->Branch("rawid", &m_chambers_rawid, "rawid/I");
546  m_chambers->Branch("endcap", &m_chambers_endcap, "endcap/I");
547  m_chambers->Branch("wheel", &m_chambers_wheel, "wheel/I");
548  m_chambers->Branch("station", &m_chambers_station, "station/I");
549  m_chambers->Branch("sector", &m_chambers_sector, "sector/I");
550  m_chambers->Branch("ring", &m_chambers_ring, "ring/I");
551  m_chambers->Branch("chamber", &m_chambers_chamber, "chamber/I");
552  m_chambers->Branch("numx", &m_chambers_numx, "numx/I");
553  m_chambers->Branch("x_w", &m_chambers_x_w, "x_w/F");
554  m_chambers->Branch("x_ww", &m_chambers_x_ww, "x_ww/F");
555  m_chambers->Branch("x_wx", &m_chambers_x_wx, "x_wx/F");
556  m_chambers->Branch("x_wxx", &m_chambers_x_wxx, "x_wxx/F");
557  m_chambers->Branch("numy", &m_chambers_numy, "numy/I");
558  m_chambers->Branch("y_w", &m_chambers_y_w, "y_w/F");
559  m_chambers->Branch("y_ww", &m_chambers_y_ww, "y_ww/F");
560  m_chambers->Branch("y_wy", &m_chambers_y_wy, "y_wy/F");
561  m_chambers->Branch("y_wyy", &m_chambers_y_wyy, "y_wyy/F");
562 
563 }
564 
566  TrajectoryStateCombiner tsoscomb;
567 
568  for (ConstTrajTrackPairCollection::const_iterator it = tracks.begin(); it != tracks.end(); ++it) {
569  const Trajectory *traj = it->first;
570 // const reco::Track *track = it->second;
571 
572  std::vector<TrajectoryMeasurement> measurements = traj->measurements();
573 
574  for (std::vector<TrajectoryMeasurement>::const_iterator im = measurements.begin(); im != measurements.end(); ++im) {
575  const TrajectoryMeasurement meas = *im;
576  const TransientTrackingRecHit* hit = &(*meas.recHit());
577  const DetId id = hit->geographicalId();
578 
579  if (hit->isValid() && pNavigator()->detAndSubdetInMap(id)) {
581  align::LocalPoint trackPos = tsosc.localPosition();
582  LocalError trackErr = tsosc.localError().positionError();
583  align::LocalPoint hitPos = hit->localPosition();
584  LocalError hitErr = hit->localPositionError(); // CPE+APE
585 
586  // subtract APEs from hitErr (if existing) from covariance matrix
587  auto det = static_cast<const TrackerGeomDet*>(hit->det());
588  const auto localAPE = det->localAlignmentError();
589  if (localAPE.valid()) {
590  hitErr = LocalError(hitErr.xx() - localAPE.xx(),
591  hitErr.xy() - localAPE.xy(),
592  hitErr.yy() - localAPE.yy());
593  }
594 
595  double x_residual = 10. * (trackPos.x() - hitPos.x());
596  double y_residual = 10. * (trackPos.y() - hitPos.y());
597  double x_reserr2 = 100. * (trackErr.xx() + hitErr.xx());
598  double y_reserr2 = 100. * (trackErr.yy() + hitErr.yy());
599 // double xpos = trackPos.x();
600 // double ypos = trackPos.y();
601 
602  if (id.det() == DetId::Muon && id.subdetId() == MuonSubdetId::DT) {
603  if (fabs(hit->surface()->toGlobal(align::LocalVector(0,1,0)).z()) < 0.1) {
604  // local y != global z: it's a middle (y-measuring) superlayer
605  y_residual = x_residual;
606  y_reserr2 = x_reserr2;
607 
608  x_residual = 0.;
609  x_reserr2 = 0.;
610  }
611  else {
612  y_residual = 0.;
613  y_reserr2 = 0.;
614  }
615 
616  if (x_reserr2 > 0.) {
617  m_xresid->Fill(x_residual, 1./x_reserr2);
618  m_xresid_mb->Fill(x_residual, 1./x_reserr2);
619  }
620  if (y_reserr2 > 0.) {
621  m_yresid->Fill(y_residual, 1./y_reserr2);
622  m_yresid_mb->Fill(y_residual, 1./y_reserr2);
623  }
624 
625  DTChamberId dtId(id.rawId());
626  int rawId = dtId.rawId();
627  if (x_reserr2 > 0.) {
628  m_numx[rawId]++;
629  m_x_w[rawId] += 1./x_reserr2;
630  m_x_ww[rawId] += 1./x_reserr2/x_reserr2;
631  m_x_wx[rawId] += x_residual/x_reserr2;
632  m_x_wxx[rawId] += x_residual*x_residual/x_reserr2;
633  }
634  if (y_reserr2 > 0.) {
635  m_numy[rawId]++;
636  m_y_w[rawId] += 1./y_reserr2;
637  m_y_ww[rawId] += 1./y_reserr2/y_reserr2;
638  m_y_wy[rawId] += y_residual/y_reserr2;
639  m_y_wyy[rawId] += y_residual*y_residual/y_reserr2;
640  }
641 
642  if (dtId.station() == 1) {
643  if (x_reserr2 > 0.) {
644  m_xresid_mb1->Fill(x_residual, 1./x_reserr2);
645  }
646  if (y_reserr2 > 0.) {
647  m_yresid_mb1->Fill(y_residual, 1./y_reserr2);
648  }
649  }
650  else if (dtId.station() == 2) {
651  if (x_reserr2 > 0.) {
652  m_xresid_mb2->Fill(x_residual, 1./x_reserr2);
653  }
654  if (y_reserr2 > 0.) {
655  m_yresid_mb2->Fill(y_residual, 1./y_reserr2);
656  }
657  }
658  else if (dtId.station() == 3) {
659  if (x_reserr2 > 0.) {
660  m_xresid_mb3->Fill(x_residual, 1./x_reserr2);
661  }
662  if (y_reserr2 > 0.) {
663  m_yresid_mb3->Fill(y_residual, 1./y_reserr2);
664  }
665  }
666  else if (dtId.station() == 4) {
667  if (x_reserr2 > 0.) {
668  m_xresid_mb4->Fill(x_residual, 1./x_reserr2);
669  }
670  if (y_reserr2 > 0.) {
671  m_yresid_mb4->Fill(y_residual, 1./y_reserr2);
672  }
673  }
674 
675  if (dtId.wheel() == -2) {
676  if (x_reserr2 > 0.) {
677  m_xresid_minus2->Fill(x_residual, 1./x_reserr2);
678  }
679  if (y_reserr2 > 0.) {
680  m_yresid_minus2->Fill(y_residual, 1./y_reserr2);
681  }
682  }
683  else if (dtId.wheel() == -1) {
684  if (x_reserr2 > 0.) {
685  m_xresid_minus1->Fill(x_residual, 1./x_reserr2);
686  }
687  if (y_reserr2 > 0.) {
688  m_yresid_minus1->Fill(y_residual, 1./y_reserr2);
689  }
690  }
691  else if (dtId.wheel() == 0) {
692  if (x_reserr2 > 0.) {
693  m_xresid_zero->Fill(x_residual, 1./x_reserr2);
694  }
695  if (y_reserr2 > 0.) {
696  m_yresid_zero->Fill(y_residual, 1./y_reserr2);
697  }
698  }
699  else if (dtId.wheel() == 1) {
700  if (x_reserr2 > 0.) {
701  m_xresid_plus1->Fill(x_residual, 1./x_reserr2);
702  }
703  if (y_reserr2 > 0.) {
704  m_yresid_plus1->Fill(y_residual, 1./y_reserr2);
705  }
706  }
707  else if (dtId.wheel() == 2) {
708  if (x_reserr2 > 0.) {
709  m_xresid_plus2->Fill(x_residual, 1./x_reserr2);
710  }
711  if (y_reserr2 > 0.) {
712  m_yresid_plus2->Fill(y_residual, 1./y_reserr2);
713  }
714  }
715  } // end if DT
716 
717  else if (id.det() == DetId::Muon && id.subdetId() == MuonSubdetId::CSC) {
718  m_xresid->Fill(x_residual, 1./x_reserr2);
719  m_yresid->Fill(y_residual, 1./y_reserr2);
720 
721  m_xresid_me->Fill(x_residual, 1./x_reserr2);
722  m_yresid_me->Fill(y_residual, 1./y_reserr2);
723 
724  CSCDetId cscId(id.rawId());
725  int rawId = cscId.chamberId().rawId();
726  if (x_reserr2 > 0.) {
727  m_numx[rawId]++;
728  m_x_w[rawId] += 1./x_reserr2;
729  m_x_ww[rawId] += 1./x_reserr2/x_reserr2;
730  m_x_wx[rawId] += x_residual/x_reserr2;
731  m_x_wxx[rawId] += x_residual*x_residual/x_reserr2;
732  }
733  if (y_reserr2 > 0.) {
734  m_numy[rawId]++;
735  m_y_w[rawId] += 1./y_reserr2;
736  m_y_ww[rawId] += 1./y_reserr2/y_reserr2;
737  m_y_wy[rawId] += y_residual/y_reserr2;
738  m_y_wyy[rawId] += y_residual*y_residual/y_reserr2;
739  }
740 
741  if ((cscId.endcap() == 1? 1: -1)*cscId.station() == 1 && cscId.ring() == 1) {
742  m_xresid_mep11->Fill(x_residual, 1./x_reserr2); m_yresid_mep11->Fill(y_residual, 1./y_reserr2);
743  m_xresid_me11->Fill(x_residual, 1./x_reserr2); m_yresid_me11->Fill(y_residual, 1./y_reserr2);
744  }
745  else if ((cscId.endcap() == 1? 1: -1)*cscId.station() == -1 && cscId.ring() == 1) {
746  m_xresid_mem11->Fill(x_residual, 1./x_reserr2); m_yresid_mem11->Fill(y_residual, 1./y_reserr2);
747  m_xresid_me11->Fill(x_residual, 1./x_reserr2); m_yresid_me11->Fill(y_residual, 1./y_reserr2);
748  }
749  else if ((cscId.endcap() == 1? 1: -1)*cscId.station() == 1 && cscId.ring() == 2) {
750  m_xresid_mep12->Fill(x_residual, 1./x_reserr2); m_yresid_mep12->Fill(y_residual, 1./y_reserr2);
751  m_xresid_me12->Fill(x_residual, 1./x_reserr2); m_yresid_me12->Fill(y_residual, 1./y_reserr2);
752  }
753  else if ((cscId.endcap() == 1? 1: -1)*cscId.station() == -1 && cscId.ring() == 2) {
754  m_xresid_mem12->Fill(x_residual, 1./x_reserr2); m_yresid_mem12->Fill(y_residual, 1./y_reserr2);
755  m_xresid_me12->Fill(x_residual, 1./x_reserr2); m_yresid_me12->Fill(y_residual, 1./y_reserr2);
756  }
757  else if ((cscId.endcap() == 1? 1: -1)*cscId.station() == 1 && cscId.ring() == 3) {
758  m_xresid_mep13->Fill(x_residual, 1./x_reserr2); m_yresid_mep13->Fill(y_residual, 1./y_reserr2);
759  m_xresid_me13->Fill(x_residual, 1./x_reserr2); m_yresid_me13->Fill(y_residual, 1./y_reserr2);
760  }
761  else if ((cscId.endcap() == 1? 1: -1)*cscId.station() == -1 && cscId.ring() == 3) {
762  m_xresid_mem13->Fill(x_residual, 1./x_reserr2); m_yresid_mem13->Fill(y_residual, 1./y_reserr2);
763  m_xresid_me13->Fill(x_residual, 1./x_reserr2); m_yresid_me13->Fill(y_residual, 1./y_reserr2);
764  }
765  else if ((cscId.endcap() == 1? 1: -1)*cscId.station() == 1 && cscId.ring() == 4) {
766  m_xresid_mep14->Fill(x_residual, 1./x_reserr2); m_yresid_mep14->Fill(y_residual, 1./y_reserr2);
767  m_xresid_me14->Fill(x_residual, 1./x_reserr2); m_yresid_me14->Fill(y_residual, 1./y_reserr2);
768  }
769  else if ((cscId.endcap() == 1? 1: -1)*cscId.station() == -1 && cscId.ring() == 4) {
770  m_xresid_mem14->Fill(x_residual, 1./x_reserr2); m_yresid_mem14->Fill(y_residual, 1./y_reserr2);
771  m_xresid_me14->Fill(x_residual, 1./x_reserr2); m_yresid_me14->Fill(y_residual, 1./y_reserr2);
772  }
773  else if ((cscId.endcap() == 1? 1: -1)*cscId.station() == 2 && cscId.ring() == 1) {
774  m_xresid_mep21->Fill(x_residual, 1./x_reserr2); m_yresid_mep21->Fill(y_residual, 1./y_reserr2);
775  m_xresid_me21->Fill(x_residual, 1./x_reserr2); m_yresid_me21->Fill(y_residual, 1./y_reserr2);
776  }
777  else if ((cscId.endcap() == 1? 1: -1)*cscId.station() == -2 && cscId.ring() == 1) {
778  m_xresid_mem21->Fill(x_residual, 1./x_reserr2); m_yresid_mem21->Fill(y_residual, 1./y_reserr2);
779  m_xresid_me21->Fill(x_residual, 1./x_reserr2); m_yresid_me21->Fill(y_residual, 1./y_reserr2);
780  }
781  else if ((cscId.endcap() == 1? 1: -1)*cscId.station() == 2 && cscId.ring() == 2) {
782  m_xresid_mep22->Fill(x_residual, 1./x_reserr2); m_yresid_mep22->Fill(y_residual, 1./y_reserr2);
783  m_xresid_me22->Fill(x_residual, 1./x_reserr2); m_yresid_me22->Fill(y_residual, 1./y_reserr2);
784  }
785  else if ((cscId.endcap() == 1? 1: -1)*cscId.station() == -2 && cscId.ring() == 2) {
786  m_xresid_mem22->Fill(x_residual, 1./x_reserr2); m_yresid_mem22->Fill(y_residual, 1./y_reserr2);
787  m_xresid_me22->Fill(x_residual, 1./x_reserr2); m_yresid_me22->Fill(y_residual, 1./y_reserr2);
788  }
789  else if ((cscId.endcap() == 1? 1: -1)*cscId.station() == 3 && cscId.ring() == 1) {
790  m_xresid_mep31->Fill(x_residual, 1./x_reserr2); m_yresid_mep31->Fill(y_residual, 1./y_reserr2);
791  m_xresid_me31->Fill(x_residual, 1./x_reserr2); m_yresid_me31->Fill(y_residual, 1./y_reserr2);
792  }
793  else if ((cscId.endcap() == 1? 1: -1)*cscId.station() == -3 && cscId.ring() == 1) {
794  m_xresid_mem31->Fill(x_residual, 1./x_reserr2); m_yresid_mem31->Fill(y_residual, 1./y_reserr2);
795  m_xresid_me31->Fill(x_residual, 1./x_reserr2); m_yresid_me31->Fill(y_residual, 1./y_reserr2);
796  }
797  else if ((cscId.endcap() == 1? 1: -1)*cscId.station() == 3 && cscId.ring() == 2) {
798  m_xresid_mep32->Fill(x_residual, 1./x_reserr2); m_yresid_mep32->Fill(y_residual, 1./y_reserr2);
799  m_xresid_me32->Fill(x_residual, 1./x_reserr2); m_yresid_me32->Fill(y_residual, 1./y_reserr2);
800  }
801  else if ((cscId.endcap() == 1? 1: -1)*cscId.station() == -3 && cscId.ring() == 2) {
802  m_xresid_mem32->Fill(x_residual, 1./x_reserr2); m_yresid_mem32->Fill(y_residual, 1./y_reserr2);
803  m_xresid_me32->Fill(x_residual, 1./x_reserr2); m_yresid_me32->Fill(y_residual, 1./y_reserr2);
804  }
805  else if ((cscId.endcap() == 1? 1: -1)*cscId.station() == 4 && cscId.ring() == 1) {
806  m_xresid_mep41->Fill(x_residual, 1./x_reserr2); m_yresid_mep41->Fill(y_residual, 1./y_reserr2);
807  m_xresid_me41->Fill(x_residual, 1./x_reserr2); m_yresid_me41->Fill(y_residual, 1./y_reserr2);
808  }
809  else if ((cscId.endcap() == 1? 1: -1)*cscId.station() == -4 && cscId.ring() == 1) {
810  m_xresid_mem41->Fill(x_residual, 1./x_reserr2); m_yresid_mem41->Fill(y_residual, 1./y_reserr2);
811  m_xresid_me41->Fill(x_residual, 1./x_reserr2); m_yresid_me41->Fill(y_residual, 1./y_reserr2);
812  }
813  } // else if CSC
814 
815  } // end if good hit
816  } // end loop over measurements
817 
818  } // end loop over track-trajectories
819 }
820 
823  for (const auto& iter: pMuon()->DTChambers()) chambers.push_back(iter);
824  for (const auto& iter: pMuon()->CSCChambers()) chambers.push_back(iter);
825 
826  int index = 0;
827  for (const auto& chamber: chambers) {
828  const int id = chamber->geomDetId().rawId();
829 
841 
842  index++;
843  m_sumnumx->SetBinContent(index, m_numx[id]);
844  m_sumnumy->SetBinContent(index, m_numy[id]);
845 
846  std::ostringstream name;
847  if (chamber->geomDetId().subdetId() == MuonSubdetId::DT) {
848  DTChamberId dtId(chamber->geomDetId());
849  name << "MB" << dtId.wheel() << "/" << dtId.station() << " (" << dtId.sector() << ")";
850  m_chambers_endcap = 0;
851  m_chambers_wheel = dtId.wheel();
852  m_chambers_station = dtId.station();
853  m_chambers_sector = dtId.sector();
854  m_chambers_ring = 0;
855  m_chambers_chamber = 0;
856  }
857  else {
858  CSCDetId cscId(chamber->geomDetId());
859  name << "ME" << (cscId.endcap() == 1? "+": "-") << cscId.station() << "/" << cscId.ring() << " (" << cscId.chamber() << ")";
860  m_chambers_endcap = cscId.endcap();
861  m_chambers_wheel = 0;
862  m_chambers_station = cscId.station();
863  m_chambers_sector = 0;
864  m_chambers_ring = cscId.ring();
865  m_chambers_chamber = cscId.chamber();
866  }
867  m_chambers->Fill();
868 
869  m_sumnumx->GetXaxis()->SetBinLabel(index, name.str().c_str());
870  m_sumnumy->GetXaxis()->SetBinLabel(index, name.str().c_str());
871  m_xsummary->GetXaxis()->SetBinLabel(index, name.str().c_str());
872  m_ysummary->GetXaxis()->SetBinLabel(index, name.str().c_str());
873 
874  if (m_numx[id] > 0.) {
875  double xmean = m_x_wx[id] / m_x_w[id];
876  double xstdev = sqrt(((m_x_wxx[id] * m_x_w[id]) - (m_x_wx[id] * m_x_wx[id]))/((m_x_w[id] * m_x_w[id]) - m_x_ww[id]));
877  double xerronmean = xstdev / sqrt(m_numx[id]);
878 
879  m_xsummary->SetBinContent(index, xmean);
880  m_xsummary->SetBinError(index, xerronmean);
881 
882  m_xmean->Fill(xmean); m_xstdev->Fill(xstdev); m_xerronmean->Fill(xerronmean);
883  if (chamber->geomDetId().subdetId() == MuonSubdetId::DT) {
884  m_xmean_mb->Fill(xmean); m_xstdev_mb->Fill(xstdev); m_xerronmean_mb->Fill(xerronmean);
885  DTChamberId id(chamber->geomDetId().rawId());
886  if (id.station() == 1) {
887  m_xmean_mb1->Fill(xmean); m_xstdev_mb1->Fill(xstdev); m_xerronmean_mb1->Fill(xerronmean);
888  }
889  else if (id.station() == 2) {
890  m_xmean_mb2->Fill(xmean); m_xstdev_mb2->Fill(xstdev); m_xerronmean_mb2->Fill(xerronmean);
891  }
892  else if (id.station() == 3) {
893  m_xmean_mb3->Fill(xmean); m_xstdev_mb3->Fill(xstdev); m_xerronmean_mb3->Fill(xerronmean);
894  }
895  else if (id.station() == 4) {
896  m_xmean_mb4->Fill(xmean); m_xstdev_mb4->Fill(xstdev); m_xerronmean_mb4->Fill(xerronmean);
897  }
898 
899  if (id.wheel() == -2) {
900  m_xmean_minus2->Fill(xmean); m_xstdev_minus2->Fill(xstdev); m_xerronmean_minus2->Fill(xerronmean);
901  }
902  else if (id.wheel() == -1) {
903  m_xmean_minus1->Fill(xmean); m_xstdev_minus1->Fill(xstdev); m_xerronmean_minus1->Fill(xerronmean);
904  }
905  else if (id.wheel() == 0) {
906  m_xmean_zero->Fill(xmean); m_xstdev_zero->Fill(xstdev); m_xerronmean_zero->Fill(xerronmean);
907  }
908  else if (id.wheel() == 1) {
909  m_xmean_plus1->Fill(xmean); m_xstdev_plus1->Fill(xstdev); m_xerronmean_plus1->Fill(xerronmean);
910  }
911  else if (id.wheel() == 2) {
912  m_xmean_plus2->Fill(xmean); m_xstdev_plus2->Fill(xstdev); m_xerronmean_plus2->Fill(xerronmean);
913  }
914  } // end if DT
915  else {
916  m_xmean_me->Fill(xmean); m_xstdev_me->Fill(xstdev); m_xerronmean_me->Fill(xerronmean);
917 
918  CSCDetId id(chamber->geomDetId().rawId());
919 
920  if ((id.endcap() == 1? 1: -1)*id.station() == 1 && id.ring() == 1) {
921  m_xmean_mep11->Fill(xmean); m_xstdev_mep11->Fill(xstdev); m_xerronmean_mep11->Fill(xerronmean);
922  m_xmean_me11->Fill(xmean); m_xstdev_me11->Fill(xstdev); m_xerronmean_me11->Fill(xerronmean);
923  }
924  else if((id.endcap() == 1? 1: -1)*id.station() == -1 && id.ring() == 1) {
925  m_xmean_mem11->Fill(xmean); m_xstdev_mem11->Fill(xstdev); m_xerronmean_mem11->Fill(xerronmean);
926  m_xmean_me11->Fill(xmean); m_xstdev_me11->Fill(xstdev); m_xerronmean_me11->Fill(xerronmean);
927  }
928  else if((id.endcap() == 1? 1: -1)*id.station() == 1 && id.ring() == 2) {
929  m_xmean_mep12->Fill(xmean); m_xstdev_mep12->Fill(xstdev); m_xerronmean_mep12->Fill(xerronmean);
930  m_xmean_me12->Fill(xmean); m_xstdev_me12->Fill(xstdev); m_xerronmean_me12->Fill(xerronmean);
931  }
932  else if((id.endcap() == 1? 1: -1)*id.station() == -1 && id.ring() == 2) {
933  m_xmean_mem12->Fill(xmean); m_xstdev_mem12->Fill(xstdev); m_xerronmean_mem12->Fill(xerronmean);
934  m_xmean_me12->Fill(xmean); m_xstdev_me12->Fill(xstdev); m_xerronmean_me12->Fill(xerronmean);
935  }
936  else if((id.endcap() == 1? 1: -1)*id.station() == 1 && id.ring() == 3) {
937  m_xmean_mep13->Fill(xmean); m_xstdev_mep13->Fill(xstdev); m_xerronmean_mep13->Fill(xerronmean);
938  m_xmean_me13->Fill(xmean); m_xstdev_me13->Fill(xstdev); m_xerronmean_me13->Fill(xerronmean);
939  }
940  else if((id.endcap() == 1? 1: -1)*id.station() == -1 && id.ring() == 3) {
941  m_xmean_mem13->Fill(xmean); m_xstdev_mem13->Fill(xstdev); m_xerronmean_mem13->Fill(xerronmean);
942  m_xmean_me13->Fill(xmean); m_xstdev_me13->Fill(xstdev); m_xerronmean_me13->Fill(xerronmean);
943  }
944  else if((id.endcap() == 1? 1: -1)*id.station() == 1 && id.ring() == 4) {
945  m_xmean_mep14->Fill(xmean); m_xstdev_mep14->Fill(xstdev); m_xerronmean_mep14->Fill(xerronmean);
946  m_xmean_me14->Fill(xmean); m_xstdev_me14->Fill(xstdev); m_xerronmean_me14->Fill(xerronmean);
947  }
948  else if((id.endcap() == 1? 1: -1)*id.station() == -1 && id.ring() == 4) {
949  m_xmean_mem14->Fill(xmean); m_xstdev_mem14->Fill(xstdev); m_xerronmean_mem14->Fill(xerronmean);
950  m_xmean_me14->Fill(xmean); m_xstdev_me14->Fill(xstdev); m_xerronmean_me14->Fill(xerronmean);
951  }
952  else if((id.endcap() == 1? 1: -1)*id.station() == 2 && id.ring() == 1) {
953  m_xmean_mep21->Fill(xmean); m_xstdev_mep21->Fill(xstdev); m_xerronmean_mep21->Fill(xerronmean);
954  m_xmean_me21->Fill(xmean); m_xstdev_me21->Fill(xstdev); m_xerronmean_me21->Fill(xerronmean);
955  }
956  else if((id.endcap() == 1? 1: -1)*id.station() == -2 && id.ring() == 1) {
957  m_xmean_mem21->Fill(xmean); m_xstdev_mem21->Fill(xstdev); m_xerronmean_mem21->Fill(xerronmean);
958  m_xmean_me21->Fill(xmean); m_xstdev_me21->Fill(xstdev); m_xerronmean_me21->Fill(xerronmean);
959  }
960  else if((id.endcap() == 1? 1: -1)*id.station() == 2 && id.ring() == 2) {
961  m_xmean_mep22->Fill(xmean); m_xstdev_mep22->Fill(xstdev); m_xerronmean_mep22->Fill(xerronmean);
962  m_xmean_me22->Fill(xmean); m_xstdev_me22->Fill(xstdev); m_xerronmean_me22->Fill(xerronmean);
963  }
964  else if((id.endcap() == 1? 1: -1)*id.station() == -2 && id.ring() == 2) {
965  m_xmean_mem22->Fill(xmean); m_xstdev_mem22->Fill(xstdev); m_xerronmean_mem22->Fill(xerronmean);
966  m_xmean_me22->Fill(xmean); m_xstdev_me22->Fill(xstdev); m_xerronmean_me22->Fill(xerronmean);
967  }
968  else if((id.endcap() == 1? 1: -1)*id.station() == 3 && id.ring() == 1) {
969  m_xmean_mep31->Fill(xmean); m_xstdev_mep31->Fill(xstdev); m_xerronmean_mep31->Fill(xerronmean);
970  m_xmean_me31->Fill(xmean); m_xstdev_me31->Fill(xstdev); m_xerronmean_me31->Fill(xerronmean);
971  }
972  else if((id.endcap() == 1? 1: -1)*id.station() == -3 && id.ring() == 1) {
973  m_xmean_mem31->Fill(xmean); m_xstdev_mem31->Fill(xstdev); m_xerronmean_mem31->Fill(xerronmean);
974  m_xmean_me31->Fill(xmean); m_xstdev_me31->Fill(xstdev); m_xerronmean_me31->Fill(xerronmean);
975  }
976  else if((id.endcap() == 1? 1: -1)*id.station() == 3 && id.ring() == 2) {
977  m_xmean_mep32->Fill(xmean); m_xstdev_mep32->Fill(xstdev); m_xerronmean_mep32->Fill(xerronmean);
978  m_xmean_me32->Fill(xmean); m_xstdev_me32->Fill(xstdev); m_xerronmean_me32->Fill(xerronmean);
979  }
980  else if((id.endcap() == 1? 1: -1)*id.station() == -3 && id.ring() == 2) {
981  m_xmean_mem32->Fill(xmean); m_xstdev_mem32->Fill(xstdev); m_xerronmean_mem32->Fill(xerronmean);
982  m_xmean_me32->Fill(xmean); m_xstdev_me32->Fill(xstdev); m_xerronmean_me32->Fill(xerronmean);
983  }
984  else if((id.endcap() == 1? 1: -1)*id.station() == 4 && id.ring() == 1) {
985  m_xmean_mep41->Fill(xmean); m_xstdev_mep41->Fill(xstdev); m_xerronmean_mep41->Fill(xerronmean);
986  m_xmean_me41->Fill(xmean); m_xstdev_me41->Fill(xstdev); m_xerronmean_me41->Fill(xerronmean);
987  }
988  else if((id.endcap() == 1? 1: -1)*id.station() == -4 && id.ring() == 1) {
989  m_xmean_mem41->Fill(xmean); m_xstdev_mem41->Fill(xstdev); m_xerronmean_mem41->Fill(xerronmean);
990  m_xmean_me41->Fill(xmean); m_xstdev_me41->Fill(xstdev); m_xerronmean_me41->Fill(xerronmean);
991  }
992  } // else itis CSC
993  } // end if xmean, xstdev exist
994 
995  if (m_numy[id] > 0.) {
996  double ymean = m_y_wy[id] / m_y_w[id];
997  double ystdev = sqrt(((m_y_wyy[id] * m_y_w[id]) - (m_y_wy[id] * m_y_wy[id]))/((m_y_w[id] * m_y_w[id]) - m_y_ww[id]));
998  double yerronmean = ystdev / sqrt(m_numy[id]);
999 
1000  m_ysummary->SetBinContent(index, ymean);
1001  m_ysummary->SetBinError(index, yerronmean);
1002 
1003  m_ymean->Fill(ymean); m_ystdev->Fill(ystdev); m_yerronmean->Fill(yerronmean);
1004  if (chamber->geomDetId().subdetId() == MuonSubdetId::DT) {
1005  m_ymean_mb->Fill(ymean); m_ystdev_mb->Fill(ystdev); m_yerronmean_mb->Fill(yerronmean);
1006  DTChamberId id(chamber->geomDetId().rawId());
1007  if (id.station() == 1) {
1008  m_ymean_mb1->Fill(ymean); m_ystdev_mb1->Fill(ystdev); m_yerronmean_mb1->Fill(yerronmean);
1009  }
1010  else if (id.station() == 2) {
1011  m_ymean_mb2->Fill(ymean); m_ystdev_mb2->Fill(ystdev); m_yerronmean_mb2->Fill(yerronmean);
1012  }
1013  else if (id.station() == 3) {
1014  m_ymean_mb3->Fill(ymean); m_ystdev_mb3->Fill(ystdev); m_yerronmean_mb3->Fill(yerronmean);
1015  }
1016  else if (id.station() == 4) {
1017  m_ymean_mb4->Fill(ymean); m_ystdev_mb4->Fill(ystdev); m_yerronmean_mb4->Fill(yerronmean);
1018  }
1019 
1020  if (id.wheel() == -2) {
1021  m_ymean_minus2->Fill(ymean); m_ystdev_minus2->Fill(ystdev); m_yerronmean_minus2->Fill(yerronmean);
1022  }
1023  else if (id.wheel() == -1) {
1024  m_ymean_minus1->Fill(ymean); m_ystdev_minus1->Fill(ystdev); m_yerronmean_minus1->Fill(yerronmean);
1025  }
1026  else if (id.wheel() == 0) {
1027  m_ymean_zero->Fill(ymean); m_ystdev_zero->Fill(ystdev); m_yerronmean_zero->Fill(yerronmean);
1028  }
1029  else if (id.wheel() == 1) {
1030  m_ymean_plus1->Fill(ymean); m_ystdev_plus1->Fill(ystdev); m_yerronmean_plus1->Fill(yerronmean);
1031  }
1032  else if (id.wheel() == 2) {
1033  m_ymean_plus2->Fill(ymean); m_ystdev_plus2->Fill(ystdev); m_yerronmean_plus2->Fill(yerronmean);
1034  }
1035  } // end if DT
1036  else {
1037  m_ymean_me->Fill(ymean); m_ystdev_me->Fill(ystdev); m_yerronmean_me->Fill(yerronmean);
1038 
1039  CSCDetId id(chamber->geomDetId().rawId());
1040 
1041  if ((id.endcap() == 1? 1: -1)*id.station() == 1 && id.ring() == 1) {
1042  m_ymean_mep11->Fill(ymean); m_ystdev_mep11->Fill(ystdev); m_yerronmean_mep11->Fill(yerronmean);
1043  m_ymean_me11->Fill(ymean); m_ystdev_me11->Fill(ystdev); m_yerronmean_me11->Fill(yerronmean);
1044  }
1045  else if((id.endcap() == 1? 1: -1)*id.station() == -1 && id.ring() == 1) {
1046  m_ymean_mem11->Fill(ymean); m_ystdev_mem11->Fill(ystdev); m_yerronmean_mem11->Fill(yerronmean);
1047  m_ymean_me11->Fill(ymean); m_ystdev_me11->Fill(ystdev); m_yerronmean_me11->Fill(yerronmean);
1048  }
1049  else if((id.endcap() == 1? 1: -1)*id.station() == 1 && id.ring() == 2) {
1050  m_ymean_mep12->Fill(ymean); m_ystdev_mep12->Fill(ystdev); m_yerronmean_mep12->Fill(yerronmean);
1051  m_ymean_me12->Fill(ymean); m_ystdev_me12->Fill(ystdev); m_yerronmean_me12->Fill(yerronmean);
1052  }
1053  else if((id.endcap() == 1? 1: -1)*id.station() == -1 && id.ring() == 2) {
1054  m_ymean_mem12->Fill(ymean); m_ystdev_mem12->Fill(ystdev); m_yerronmean_mem12->Fill(yerronmean);
1055  m_ymean_me12->Fill(ymean); m_ystdev_me12->Fill(ystdev); m_yerronmean_me12->Fill(yerronmean);
1056  }
1057  else if((id.endcap() == 1? 1: -1)*id.station() == 1 && id.ring() == 3) {
1058  m_ymean_mep13->Fill(ymean); m_ystdev_mep13->Fill(ystdev); m_yerronmean_mep13->Fill(yerronmean);
1059  m_ymean_me13->Fill(ymean); m_ystdev_me13->Fill(ystdev); m_yerronmean_me13->Fill(yerronmean);
1060  }
1061  else if((id.endcap() == 1? 1: -1)*id.station() == -1 && id.ring() == 3) {
1062  m_ymean_mem13->Fill(ymean); m_ystdev_mem13->Fill(ystdev); m_yerronmean_mem13->Fill(yerronmean);
1063  m_ymean_me13->Fill(ymean); m_ystdev_me13->Fill(ystdev); m_yerronmean_me13->Fill(yerronmean);
1064  }
1065  else if((id.endcap() == 1? 1: -1)*id.station() == 1 && id.ring() == 4) {
1066  m_ymean_mep14->Fill(ymean); m_ystdev_mep14->Fill(ystdev); m_yerronmean_mep14->Fill(yerronmean);
1067  m_ymean_me14->Fill(ymean); m_ystdev_me14->Fill(ystdev); m_yerronmean_me14->Fill(yerronmean);
1068  }
1069  else if((id.endcap() == 1? 1: -1)*id.station() == -1 && id.ring() == 4) {
1070  m_ymean_mem14->Fill(ymean); m_ystdev_mem14->Fill(ystdev); m_yerronmean_mem14->Fill(yerronmean);
1071  m_ymean_me14->Fill(ymean); m_ystdev_me14->Fill(ystdev); m_yerronmean_me14->Fill(yerronmean);
1072  }
1073  else if((id.endcap() == 1? 1: -1)*id.station() == 2 && id.ring() == 1) {
1074  m_ymean_mep21->Fill(ymean); m_ystdev_mep21->Fill(ystdev); m_yerronmean_mep21->Fill(yerronmean);
1075  m_ymean_me21->Fill(ymean); m_ystdev_me21->Fill(ystdev); m_yerronmean_me21->Fill(yerronmean);
1076  }
1077  else if((id.endcap() == 1? 1: -1)*id.station() == -2 && id.ring() == 1) {
1078  m_ymean_mem21->Fill(ymean); m_ystdev_mem21->Fill(ystdev); m_yerronmean_mem21->Fill(yerronmean);
1079  m_ymean_me21->Fill(ymean); m_ystdev_me21->Fill(ystdev); m_yerronmean_me21->Fill(yerronmean);
1080  }
1081  else if((id.endcap() == 1? 1: -1)*id.station() == 2 && id.ring() == 2) {
1082  m_ymean_mep22->Fill(ymean); m_ystdev_mep22->Fill(ystdev); m_yerronmean_mep22->Fill(yerronmean);
1083  m_ymean_me22->Fill(ymean); m_ystdev_me22->Fill(ystdev); m_yerronmean_me22->Fill(yerronmean);
1084  }
1085  else if((id.endcap() == 1? 1: -1)*id.station() == -2 && id.ring() == 2) {
1086  m_ymean_mem22->Fill(ymean); m_ystdev_mem22->Fill(ystdev); m_yerronmean_mem22->Fill(yerronmean);
1087  m_ymean_me22->Fill(ymean); m_ystdev_me22->Fill(ystdev); m_yerronmean_me22->Fill(yerronmean);
1088  }
1089  else if((id.endcap() == 1? 1: -1)*id.station() == 3 && id.ring() == 1) {
1090  m_ymean_mep31->Fill(ymean); m_ystdev_mep31->Fill(ystdev); m_yerronmean_mep31->Fill(yerronmean);
1091  m_ymean_me31->Fill(ymean); m_ystdev_me31->Fill(ystdev); m_yerronmean_me31->Fill(yerronmean);
1092  }
1093  else if((id.endcap() == 1? 1: -1)*id.station() == -3 && id.ring() == 1) {
1094  m_ymean_mem31->Fill(ymean); m_ystdev_mem31->Fill(ystdev); m_yerronmean_mem31->Fill(yerronmean);
1095  m_ymean_me31->Fill(ymean); m_ystdev_me31->Fill(ystdev); m_yerronmean_me31->Fill(yerronmean);
1096  }
1097  else if((id.endcap() == 1? 1: -1)*id.station() == 3 && id.ring() == 2) {
1098  m_ymean_mep32->Fill(ymean); m_ystdev_mep32->Fill(ystdev); m_yerronmean_mep32->Fill(yerronmean);
1099  m_ymean_me32->Fill(ymean); m_ystdev_me32->Fill(ystdev); m_yerronmean_me32->Fill(yerronmean);
1100  }
1101  else if((id.endcap() == 1? 1: -1)*id.station() == -3 && id.ring() == 2) {
1102  m_ymean_mem32->Fill(ymean); m_ystdev_mem32->Fill(ystdev); m_yerronmean_mem32->Fill(yerronmean);
1103  m_ymean_me32->Fill(ymean); m_ystdev_me32->Fill(ystdev); m_yerronmean_me32->Fill(yerronmean);
1104  }
1105  else if((id.endcap() == 1? 1: -1)*id.station() == 4 && id.ring() == 1) {
1106  m_ymean_mep41->Fill(ymean); m_ystdev_mep41->Fill(ystdev); m_yerronmean_mep41->Fill(yerronmean);
1107  m_ymean_me41->Fill(ymean); m_ystdev_me41->Fill(ystdev); m_yerronmean_me41->Fill(yerronmean);
1108  }
1109  else if((id.endcap() == 1? 1: -1)*id.station() == -4 && id.ring() == 1) {
1110  m_ymean_mem41->Fill(ymean); m_ystdev_mem41->Fill(ystdev); m_yerronmean_mem41->Fill(yerronmean);
1111  m_ymean_me41->Fill(ymean); m_ystdev_me41->Fill(ystdev); m_yerronmean_me41->Fill(yerronmean);
1112  }
1113  } // else itis CSC
1114  } // end if ymean, ystdev exist
1115 
1116  } // end loop over chambers
1117 }
1118 
1119 //
1120 // constructors and destructor
1121 //
1122 
1123 // AlignmentMonitorMuonResiduals::AlignmentMonitorMuonResiduals(const AlignmentMonitorMuonResiduals& rhs)
1124 // {
1125 // // do actual copying here;
1126 // }
1127 
1128 //
1129 // assignment operators
1130 //
1131 // const AlignmentMonitorMuonResiduals& AlignmentMonitorMuonResiduals::operator=(const AlignmentMonitorMuonResiduals& rhs)
1132 // {
1133 // //An exception safe implementation is
1134 // AlignmentMonitorMuonResiduals temp(rhs);
1135 // swap(rhs);
1136 //
1137 // return *this;
1138 // }
1139 
1140 //
1141 // const member functions
1142 //
1143 
1144 //
1145 // static member functions
1146 //
1147 
1148 //
1149 // SEAL definitions
1150 //
1151 
AlignableMuon * pMuon()
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:106
T getParameter(std::string const &) const
float xx() const
Definition: LocalError.h:24
AlignableNavigator * pNavigator()
virtual const Surface * surface() const
ConstRecHitPointer const & recHit() const
TSOS combine(const TSOS &pTsos1, const TSOS &pTsos2) const
void book() override
Book or retrieve histograms; MUST be reimplemented.
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:47
T y() const
Definition: PV3DBase.h:63
LocalError positionError() const
int endcap() const
Definition: CSCDetId.h:93
DataContainer const & measurements() const
Definition: Trajectory.h:196
float xy() const
Definition: LocalError.h:25
TFileDirectory * directory(std::string dir)
int iEvent
Definition: GenABIO.cc:230
static const int CSC
Definition: MuonSubdetId.h:13
float yy() const
Definition: LocalError.h:26
const GeomDet * det() const
T sqrt(T t)
Definition: SSEVec.h:18
T z() const
Definition: PV3DBase.h:64
void event(const edm::Event &iEvent, const edm::EventSetup &iSetup, const ConstTrajTrackPairCollection &iTrajTracks) override
Called for each event (by "run()"): may be reimplemented.
CSCDetId chamberId() const
Definition: CSCDetId.h:53
T * make(const Args &...args) const
make new ROOT object
const LocalTrajectoryError & localError() const
std::vector< ConstTrajTrackPair > ConstTrajTrackPairCollection
virtual LocalPoint localPosition() const =0
TH1F * book1D(std::string dir, std::string name, std::string title, int nchX, double lowX, double highX)
TrajectoryStateOnSurface const & forwardPredictedState() const
Access to forward predicted state (from fitter or builder)
int ring() const
Definition: CSCDetId.h:75
Definition: DetId.h:18
bool isValid() const
std::vector< Alignable * > Alignables
Definition: Utilities.h:32
int station() const
Definition: CSCDetId.h:86
#define DEFINE_EDM_PLUGIN(factory, type, name)
static const int DT
Definition: MuonSubdetId.h:12
AlignmentMonitorMuonResiduals(const edm::ParameterSet &cfg)
DetId geographicalId() const
virtual LocalError localPositionError() const =0
int station() const
Return the station number.
Definition: DTChamberId.h:51
static char chambers[264][20]
Definition: ReadPGInfo.cc:243
bool detAndSubdetInMap(const DetId &detid) const
Given a DetId, returns true if DetIds with this detector and subdetector id are in the map (not neces...
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:45
T x() const
Definition: PV3DBase.h:62
LocalError const & localAlignmentError() const
Return local alligment error.
TrajectoryStateOnSurface const & backwardPredictedState() const
Access to backward predicted state (from smoother)