CMS 3D CMS Logo

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