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