CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SiStripTrackingRecHitsValid.cc
Go to the documentation of this file.
1 // File: SiStripTrackingRecHitsValid.cc
2 // // Author: Arnaud Gay.
3 // Creation Date: July 2006.
4 //
5 //--------------------------------------------
6 
7 #include <memory>
8 #include <string>
9 #include <iostream>
10 #include <TMath.h>
12 
16 
18 
23 
33 
36 
38 
39 using namespace std;
40 
41 // ROOT
42 #include "TROOT.h"
43 #include "TFile.h"
44 #include "TTree.h"
45 #include "TBranch.h"
46 #include "TH1.h"
47 #include "TH2.h"
48 class TFile;
49 
51 {
52 
53  conf_ = ps;
54 
55  // slices
56 
57  // myFile = new TFile("slice.root","RECREATE");
58 
59  // Diff = new TH1F("Diff","Diff",20,0.,1.);
60  //PositionSHx = new TH1F("PositionSHx","PositionSHx",3200,0.,800.);
61  //SecondStrip = new TH1F("SecondStrip","SecondStrip",2,0.,2.);
62 
63  ErrxMF = new TH1F("ErrxMF","ErrxMF",80,0.,1.);
64  ErrxMFvsTrackwidth = new TH2F("ErrxMFvsTrackwidth","ErrxMFvsTrackwidth",12,0.,4.,40,0.,0.5);
65  ErrxMFvsTrackwidthWClus1 = new TH2F("ErrxMFvsTrackwidthWClus1","ErrxMFvsTrackwidthWClus1",12,0.,4.,40,0.,0.5);
66  ErrxMFvsTrackwidthWClus2 = new TH2F("ErrxMFvsTrackwidthWClus2","ErrxMFvsTrackwidthWClus2",12,0.,4.,40,0.,0.5);
67  ErrxMFvsTrackwidthWClus3 = new TH2F("ErrxMFvsTrackwidthWClus3","ErrxMFvsTrackwidthWClus3",12,0.,4.,40,0.,0.5);
68  ErrxMFvsTrackwidthWClus4 = new TH2F("ErrxMFvsTrackwidthWClus4","ErrxMFvsTrackwidthWClus4",12,0.,4.,40,0.,0.5);
69 
70  ResMFvsTrackwidth = new TH2F("ResMFvsTrackwidth","ResMFvsTrackwidth",12,0.,4.,20,-3.,3.);
71 
72  ResMFvsTrackwidthWClus1 = new TH2F("ResMFvsTrackwidthWClus1","ResMFvsTrackwidthWClus1",12,0.,4.,100,-1.,1.);
73  ResMFvsTrackwidthWClus1Wexp1 = new TH2F("ResMFvsTrackwidthWClus1Wexp1","ResMFvsTrackwidthWClus1Wexp1",12,0.,4.,100,-1.,1.);
74  ResMFvsTrackwidthWClus1Wexp2 = new TH2F("ResMFvsTrackwidthWClus1Wexp2","ResMFvsTrackwidthWClus1Wexp2",12,0.,4.,100,-1.,1.);
75  ResMFvsTrackwidthWClus1Wexp3 = new TH2F("ResMFvsTrackwidthWClus1Wexp3","ResMFvsTrackwidthWClus1Wexp3",12,0.,4.,100,-1.,1.);
76  ResMFvsTrackwidthWClus1Wexp4 = new TH2F("ResMFvsTrackwidthWClus1Wexp4","ResMFvsTrackwidthWClus1Wexp4",12,0.,4.,100,-1.,1.);
77  ResMFvsTrackwidthWClus2 = new TH2F("ResMFvsTrackwidthWClus2","ResMFvsTrackwidthWClus2",12,0.,4.,100,-1.,1.);
78  ResMFvsTrackwidthWClus2Wexp1 = new TH2F("ResMFvsTrackwidthWClus2Wexp1","ResMFvsTrackwidthWClus2Wexp1",12,0.,4.,100,-1.,1.);
79  ResMFvsTrackwidthWClus2Wexp2 = new TH2F("ResMFvsTrackwidthWClus2Wexp2","ResMFvsTrackwidthWClus2Wexp2",12,0.,4.,100,-1.,1.);
80  ResMFvsTrackwidthWClus2Wexp3 = new TH2F("ResMFvsTrackwidthWClus2Wexp3","ResMFvsTrackwidthWClus2Wexp3",12,0.,4.,100,-1.,1.);
81  ResMFvsTrackwidthWClus2Wexp4 = new TH2F("ResMFvsTrackwidthWClus2Wexp4","ResMFvsTrackwidthWClus2Wexp4",12,0.,4.,100,-1.,1.);
82  ResMFvsTrackwidthWClus3 = new TH2F("ResMFvsTrackwidthWClus3","ResMFvsTrackwidthWClus3",12,0.,4.,100,-1.,1.);
83  ResMFvsTrackwidthWClus3Wexp1 = new TH2F("ResMFvsTrackwidthWClus3Wexp1","ResMFvsTrackwidthWClus3Wexp1",12,0.,4.,100,-1.,1.);
84  ResMFvsTrackwidthWClus3Wexp2 = new TH2F("ResMFvsTrackwidthWClus3Wexp2","ResMFvsTrackwidthWClus3Wexp2",12,0.,4.,100,-1.,1.);
85  ResMFvsTrackwidthWClus3Wexp3 = new TH2F("ResMFvsTrackwidthWClus3Wexp3","ResMFvsTrackwidthWClus3Wexp3",12,0.,4.,100,-1.,1.);
86  ResMFvsTrackwidthWClus3Wexp4 = new TH2F("ResMFvsTrackwidthWClus3Wexp4","ResMFvsTrackwidthWClus3Wexp4",12,0.,4.,100,-1.,1.);
87  ResMFvsTrackwidthWClus4 = new TH2F("ResMFvsTrackwidthWClus4","ResMFvsTrackwidthWClus4",12,0.,4.,100,-1.,1.);
88  ResMFvsTrackwidthWClus4Wexp1 = new TH2F("ResMFvsTrackwidthWClus4Wexp1","ResMFvsTrackwidthWClus4Wexp1",12,0.,4.,100,-1.,1.);
89  ResMFvsTrackwidthWClus4Wexp2 = new TH2F("ResMFvsTrackwidthWClus4Wexp2","ResMFvsTrackwidthWClus4Wexp2",12,0.,4.,100,-1.,1.);
90  ResMFvsTrackwidthWClus4Wexp3 = new TH2F("ResMFvsTrackwidthWClus4Wexp3","ResMFvsTrackwidthWClus4Wexp3",12,0.,4.,100,-1.,1.);
91  ResMFvsTrackwidthWClus4Wexp4 = new TH2F("ResMFvsTrackwidthWClus4Wexp4","ResMFvsTrackwidthWClus4Wexp4",12,0.,4.,100,-1.,1.);
92 
93  ErrxMFvsTrackwidthCategory2 = new TH2F("ErrxMFvsTrackwidthCategory2","ErrxMFvsTrackwidthCategory2",12,0.,4.,20,0.,0.4);
94  ErrxMFvsTrackwidthCategory3 = new TH2F("ErrxMFvsTrackwidthCategory3","ErrxMFvsTrackwidthCategory3",12,0.,4.,20,0.,0.4);
95  ErrxMFvsTrackwidthCategory4 = new TH2F("ErrxMFvsTrackwidthCategory4","ErrxMFvsTrackwidthCategory4",12,0.,4.,20,0.,0.4);
96 
97  ResMFvsTrackwidthCategory2 = new TH2F("ResMFvsTrackwidthCategory2","ResMFvsTrackwidthCategory2",12,0.,4.,20,-1.,1.);
98  ResMFvsTrackwidthCategory3 = new TH2F("ResMFvsTrackwidthCategory3","ResMFvsTrackwidthCategory3",12,0.,4.,20,-1.,1.);
99  ResMFvsTrackwidthCategory4 = new TH2F("ResMFvsTrackwidthCategory4","ResMFvsTrackwidthCategory4",12,0.,4.,20,-1.,1.);
100 
101  PullvsTrackwidth = new TH2F("PullvsTrackwidth","PullvsTrackwidth",12,0.,4.,20,-5.,5.);
102  PullvsClusterwidth = new TH2F("PullvsClusterwidth","PullvsClusterwidth",8,0.5,8.5,20,-5.,5.);
103  PullvsExpectedwidth = new TH2F("PullvsExpectedwidth","PullvsExpectedwidth",4,0.5,4.5,20,-5.,5.);
104  PullvsTrackangle = new TH2F("PullvsTrackangle","PullvsTrackangle",10,0.,90.,20,-5.,5.);
105  PullvsTrackanglebeta = new TH2F("PullvsTrackanglebeta","PullvsTrackanglebeta",9,0.,90.,20,-5.,5.);
106 
107  PullvsTrackwidthTIB = new TH2F("PullvsTrackwidthTIB","PullvsTrackwidthTIB",12,0.,4.,20,-5.,5.);
108  PullvsClusterwidthTIB = new TH2F("PullvsClusterwidthTIB","PullvsClusterwidthTIB",8,0.5,8.5,20,-5.,5.);
109  PullvsExpectedwidthTIB = new TH2F("PullvsExpectedwidthTIB","PullvsExpectedwidthTIB",4,0.5,4.5,20,-5.,5.);
110  PullvsTrackangleTIB = new TH2F("PullvsTrackangleTIB","PullvsTrackangleTIB",10,0.,90.,20,-5.,5.);
111  PullvsTrackanglebetaTIB = new TH2F("PullvsTrackanglebetaTIB","PullvsTrackanglebetaTIB",9,0.,90.,20,-5.,5.);
112 
113  PullvsTrackwidthTOB = new TH2F("PullvsTrackwidthTOB","PullvsTrackwidthTOB",12,0.,4.,20,-5.,5.);
114  PullvsClusterwidthTOB = new TH2F("PullvsClusterwidthTOB","PullvsClusterwidthTOB",8,0.5,8.5,20,-5.,5.);
115  PullvsExpectedwidthTOB = new TH2F("PullvsExpectedwidthTOB","PullvsExpectedwidthTOB",4,0.5,4.5,20,-5.,5.);
116  PullvsTrackangleTOB = new TH2F("PullvsTrackangleTOB","PullvsTrackangleTOB",10,0.,90.,20,-5.,5.);
117  PullvsTrackanglebetaTOB = new TH2F("PullvsTrackanglebetaTOB","PullvsTrackanglebetaTOB",9,0.,90.,20,-5.,5.);
118 
119  PullvsTrackwidthTID = new TH2F("PullvsTrackwidthTID","PullvsTrackwidthTID",12,0.,4.,20,-5.,5.);
120  PullvsClusterwidthTID = new TH2F("PullvsClusterwidthTID","PullvsClusterwidthTID",8,0.5,8.5,20,-5.,5.);
121  PullvsExpectedwidthTID = new TH2F("PullvsExpectedwidthTID","PullvsExpectedwidthTID",4,0.5,4.5,20,-5.,5.);
122  PullvsTrackangleTID = new TH2F("PullvsTrackangleTID","PullvsTrackangleTID",10,0.,90.,20,-5.,5.);
123  PullvsTrackanglebetaTID = new TH2F("PullvsTrackanglebetaTID","PullvsTrackanglebetaTID",9,0.,90.,20,-5.,5.);
124 
125  PullvsTrackwidthTEC = new TH2F("PullvsTrackwidthTEC","PullvsTrackwidthTEC",12,0.,4.,20,-5.,5.);
126  PullvsClusterwidthTEC = new TH2F("PullvsClusterwidthTEC","PullvsClusterwidthTEC",8,0.5,8.5,20,-5.,5.);
127  PullvsExpectedwidthTEC = new TH2F("PullvsExpectedwidthTEC","PullvsExpectedwidthTEC",4,0.5,4.5,20,-5.,5.);
128  PullvsTrackangleTEC = new TH2F("PullvsTrackangleTEC","PullvsTrackangleTEC",10,0.,90.,20,-5.,5.);
129  PullvsTrackanglebetaTEC = new TH2F("PullvsTrackanglebetaTEC","PullvsTrackanglebetaTEC",9,0.,90.,20,-5.,5.);
130 
131  //Read config file
132  //MTCCtrack_ = ps.getParameter<bool>("MTCCtrack");
133  outputFile_ = ps.getUntrackedParameter<string>("outputFile", "striptrackingrechitshisto.root");
134  //src_ = ps.getUntrackedParameter<std::string>( "src" );
135  //builderName_ = ps.getParameter<std::string>("TTRHBuilder");
136 
137  // Book histograms
139  // dbe_->showDirStructure();
140 
141  dbe_->setCurrentFolder("Tracking/TrackingRecHits/Strip/ALL");
142 
143  Char_t histo[200];
144 
145  sprintf(histo,"Errx_LF");
146  meErrxLF = dbe_->book1D(histo,"RecHit err(x) Local Frame coord.",100,0,0.005);
147  // const float Entries1 = meErrxLF->getEntries();
148 
149  sprintf(histo,"Errx_MF");
150  meErrxMF = dbe_->book1D(histo,"RecHit err(x) Meas. Frame coord.",100,0,0.5);
151 
152  sprintf(histo,"Res_LF");
153  meResLF = dbe_->book1D(histo,"RecHit Residual",100,-0.02,+0.02);
154 
155  sprintf(histo,"Res_MF");
156  meResMF = dbe_->book1D(histo,"RecHit Residual",100,-2,+2);
157 
158  sprintf(histo,"Pull_LF");
159  mePullLF = dbe_->book1D(histo,"Pull",100,-5.,5.);
160 
161  sprintf(histo,"Pull_MF");
162  mePullMF = dbe_->book1D(histo,"Pull",100,-5.,5.);
163 
164  sprintf(histo,"Category");
165  meCategory = dbe_->book1D(histo,"Cluster Category",10,0.,10.);
166 
167  sprintf(histo,"Trackwidth");
168  meTrackwidth = dbe_->book1D(histo,"Track width",100,0.,4.);
169 
170  sprintf(histo,"Expectedwidth");
171  meExpectedwidth = dbe_->book1D(histo,"Expected width",10,0.,10.);
172 
173  sprintf(histo,"Clusterwidth");
174  meClusterwidth = dbe_->book1D(histo,"Cluster width",10,0.,10.);
175 
176  sprintf(histo,"Trackanglealpha");
177  meTrackanglealpha = dbe_->book1D(histo,"Track angle alpha",100,-100.,100.);
178 
179  sprintf(histo,"Trackanglebeta");
180  meTrackanglebeta = dbe_->book1D(histo,"Track angle beta",100,-100.,100.);
181 
182  sprintf(histo,"ErrxMFTrackwidthProfile_WClus1");
183  meErrxMFTrackwidthProfileWClus1 = dbe_->bookProfile(histo,"Resolution Track width Profile", 12, 0., 4.,100, 0.,2.,"s");
184 
185  sprintf(histo,"ErrxMFTrackwidthProfile_WClus2");
186  meErrxMFTrackwidthProfileWClus2 = dbe_->bookProfile(histo,"Resolution Track width Profile", 12, 0., 4.,100, 0.,2.,"");
187 
188  sprintf(histo,"ErrxMFTrackwidthProfile_WClus3");
189  meErrxMFTrackwidthProfileWClus3 = dbe_->bookProfile(histo,"Resolution Track width Profile", 12, 0., 4.,100, 0.,2.,"s");
190 
191  sprintf(histo,"ErrxMFTrackwidthProfile_WClus4");
192  meErrxMFTrackwidthProfileWClus4 = dbe_->bookProfile(histo,"Resolution Track width Profile", 12, 0., 4.,100, 0.,2.,"s");
193 
194  sprintf(histo,"ResMFTrackwidthProfile_WClus1");
195  meResMFTrackwidthProfileWClus1 = dbe_->bookProfile(histo,"Resolution Track width Profile", 12, 0., 4.,100, 0.,2.,"s");
196 
197  sprintf(histo,"ResMFTrackwidthProfile_WClus2");
198  meResMFTrackwidthProfileWClus2 = dbe_->bookProfile(histo,"Resolution Track width Profile", 12, 0., 4.,100, 0.,2.,"");
199  sprintf(histo,"ResMFTrackwidthProfile_WClus21");
200  meResMFTrackwidthProfileWClus21 = dbe_->bookProfile(histo,"Resolution Track width Profile", 12, 0., 4.,100, -2.,2.,"");
201  sprintf(histo,"ResMFTrackwidthProfile_WClus22");
202  meResMFTrackwidthProfileWClus22 = dbe_->bookProfile(histo,"Resolution Track width Profile", 12, 0., 4.,100, -5.,5.,"");
203  sprintf(histo,"ResMFTrackwidthProfile_WClus23");
204  meResMFTrackwidthProfileWClus23 = dbe_->bookProfile(histo,"Resolution Track width Profile", 12, 0., 4.,100, -0.5,0.5,"");
205  //sprintf(histo,"ResMFTrackwidthProfile_WClus2");
206  //meResMFTrackwidthProfileWClus22 = dbe_->bookProfile(histo,"Resolution Track width Profile", 12, 0., 4., 0.,2.,"s");
207 
208  sprintf(histo,"ResMFTrackwidthProfile_WClus3");
209  meResMFTrackwidthProfileWClus3 = dbe_->bookProfile(histo,"Resolution Track width Profile", 12, 0., 4.,100, 0.,2.,"s");
210 
211  sprintf(histo,"ResMFTrackwidthProfile_WClus4");
212  meResMFTrackwidthProfileWClus4 = dbe_->bookProfile(histo,"Resolution Track width Profile", 12, 0., 4.,100, 0.,2.,"s");
213 
214  sprintf(histo,"ErrxMFTrackwidthProfile");
215  meErrxMFTrackwidthProfile = dbe_->bookProfile(histo,"Resolution Track width Profile", 12, 0., 4.,100, 0.,2.,"s");
216 
217  sprintf(histo,"ErrxMFTrackwidthProfile_Category1");
218  meErrxMFTrackwidthProfileCategory1 = dbe_->bookProfile(histo,"Resolution Track width Profile Category1", 12, 0., 4.,100, -2.,2.,"s");
219  sprintf(histo,"ErrxMFTrackwidthProfile_Category2");
220  meErrxMFTrackwidthProfileCategory2 = dbe_->bookProfile(histo,"Resolution Track width Profile Category2", 12, 0., 4.,100, -2.,2.,"s");
221 
222  sprintf(histo,"ErrxMFTrackwidthProfile_Category3");
223  meErrxMFTrackwidthProfileCategory3 = dbe_->bookProfile(histo,"Resolution Track width Profile Category3", 12, 0., 4.,100, -2.,2.,"s");
224 
225  sprintf(histo,"ErrxMFTrackwidthProfile_Category4");
226  meErrxMFTrackwidthProfileCategory4 = dbe_->bookProfile(histo,"Resolution Track width Profile Category4", 12, 0., 4.,100, -2.,2.,"s");
227 
228  sprintf(histo,"ErrxMFClusterwidthProfile_Category1");
229  meErrxMFClusterwidthProfileCategory1= dbe_->bookProfile(histo,"Resolution Cluster width Profile Category1", 100, 0., 10.,100, -2.,2.,"s");
230 
231  sprintf(histo,"ErrxMFAngleProfile");
232  meErrxMFAngleProfile = dbe_->bookProfile(histo,"Resolution Angle Profile", 100, 0., 60.,100, 0.,2.,"s");
233 
234  dbe_->setCurrentFolder("Tracking/TrackingRecHits/Strip/TIB");
235  //one histo per Layer rphi hits
236  for(int i = 0 ;i<4 ; i++) {
237  Char_t histo[200];
238  sprintf(histo,"Nstp_rphi_layer%dtib",i+1);
239  meNstpRphiTIB[i] = dbe_->book1D(histo,"RecHit Cluster Size",20,0.5,20.5);
240  sprintf(histo,"Adc_rphi_layer%dtib",i+1);
241  meAdcRphiTIB[i] = dbe_->book1D(histo,"RecHit Cluster Charge",100,0.,300.);
242  sprintf(histo,"Posx_rphi_layer%dtib",i+1);
243  mePosxRphiTIB[i] = dbe_->book1D(histo,"RecHit x coord.",100,-6.0,+6.0);
244 
245  sprintf(histo,"Errx_LF_rphi_layer%dtib",i+1);
246  meErrxLFRphiTIB[i] = dbe_->book1D(histo,"RecHit err(x) Local Frame coord.",100,0,0.005);
247  sprintf(histo,"Errx_MF_rphi_layer%dtib",i+1);
248  meErrxMFRphiTIB[i] = dbe_->book1D(histo,"RecHit err(x) Meas. Frame coord.",100,0,0.5);
249 
250  sprintf(histo,"Res_LF_rphi_layer%dtib",i+1);
251  meResLFRphiTIB[i] = dbe_->book1D(histo,"RecHit Residual",100,-0.02,+0.02);
252  sprintf(histo,"Res_MF_rphi_layer%dtib",i+1);
253  meResMFRphiTIB[i] = dbe_->book1D(histo,"RecHit Residual",100,-2,+2);
254 
255  sprintf(histo,"Pull_LF_rphi_layer%dtib",i+1);
256  mePullLFRphiTIB[i] = dbe_->book1D(histo,"Pull",100,-5.,5.);
257  sprintf(histo,"Pull_MF_rphi_layer%dtib",i+1);
258  mePullMFRphiTIB[i] = dbe_->book1D(histo,"Pull",100,-5.,5.);
259 
260  sprintf(histo,"Trackangle_rphi_layer%dtib",i+1);
261  meTrackangleRphiTIB[i] = dbe_->book1D(histo,"Track angle",100,-20.,20.);
262 
263  sprintf(histo,"Trackanglebeta_rphi_layer%dtib",i+1);
264  meTrackanglebetaRphiTIB[i] = dbe_->book1D(histo,"Track angle beta",100,-20.,20.);
265 
266  sprintf(histo,"Trackangle2_rphi_layer%dtib",i+1);
267  meTrackangle2RphiTIB[i] = dbe_->book1D(histo,"Track angle",100,-20.,20.);
268 
269  sprintf(histo,"PullTrackangleProfile_rphi_layer%dtib",i+1);
270  mePullTrackangleProfileRphiTIB[i] = dbe_->bookProfile(histo,"Pull Track angle Profile", 100, -20., 20.,100, -2.,2.,"s");
271 
272  sprintf(histo,"Trackwidth_rphi_layer%dtib",i+1);
273  meTrackwidthRphiTIB[i] = dbe_->book1D(histo,"Track width",100,0.,1.);
274 
275  sprintf(histo,"Expectedwidth_rphi_layer%dtib",i+1);
276  meExpectedwidthRphiTIB[i] = dbe_->book1D(histo,"Expected width",10,0.,10.);
277 
278  sprintf(histo,"Clusterwidth_rphi_layer%dtib",i+1);
279  meClusterwidthRphiTIB[i] = dbe_->book1D(histo,"Cluster width",10,0.,10.);
280 
281  sprintf(histo,"Category_rphi_layer%dtib",i+1);
282  meCategoryRphiTIB[i] = dbe_->book1D(histo,"Cluster Category",10,0.,10.);
283 
284  sprintf(histo,"PullTrackwidthProfile_rphi_layer%dtib",i+1);
285  mePullTrackwidthProfileRphiTIB[i] = dbe_->bookProfile(histo,"Pull Track width Profile", 100, 0., 1.,100, -2.,2.,"s");
286 
287  sprintf(histo,"PullTrackwidthProfile_Category1_rphi_layer%dtib",i+1);
288  mePullTrackwidthProfileCategory1RphiTIB[i] = dbe_->bookProfile(histo,"Pull Track width Profile Category1", 100, 0., 1.,100, -2.,2.,"s");
289 
290  sprintf(histo,"PullTrackwidthProfile_Category2_rphi_layer%dtib",i+1);
291  mePullTrackwidthProfileCategory2RphiTIB[i] = dbe_->bookProfile(histo,"Pull Track width Profile Category2", 100, 0., 1.,100, -2.,2.,"s");
292 
293  sprintf(histo,"PullTrackwidthProfile_Category3_rphi_layer%dtib",i+1);
294  mePullTrackwidthProfileCategory3RphiTIB[i] = dbe_->bookProfile(histo,"Pull Track width Profile Category3", 100, 0., 1.,100, -2.,2.,"s");
295 
296  sprintf(histo,"PullTrackwidthProfile_Category4_rphi_layer%dtib",i+1);
297  mePullTrackwidthProfileCategory4RphiTIB[i] = dbe_->bookProfile(histo,"Pull Track width Profile Category4", 100, 0., 1.,100, -2.,2.,"s");
298 
299  sprintf(histo,"ErrxMFTrackwidthProfile_rphi_layer%dtib",i+1);
300  meErrxMFTrackwidthProfileRphiTIB[i] = dbe_->bookProfile(histo,"Resolution Track width Profile", 12, 0., 4.,100, -2.,2.,"s");
301 
302 
303  sprintf(histo,"ErrxMFTrackwidthProfile_WClus1_rphi_layer%dtib",i+1);
304  meErrxMFTrackwidthProfileWclus1RphiTIB[i] = dbe_->bookProfile(histo,"Resolution Track width Profile Wclus1", 12, 0., 4.,100, -2.,2.,"s");
305 
306  sprintf(histo,"ErrxMFTrackwidthProfile_WClus2_rphi_layer%dtib",i+1);
307  meErrxMFTrackwidthProfileWclus2RphiTIB[i] = dbe_->bookProfile(histo,"Resolution Track width Profile Wclus1", 12, 0., 4.,100, -2.,2.,"s");
308 
309  sprintf(histo,"ErrxMFTrackwidthProfile_WClus3_rphi_layer%dtib",i+1);
310  meErrxMFTrackwidthProfileWclus3RphiTIB[i] = dbe_->bookProfile(histo,"Resolution Track width Profile Wclus1", 12, 0., 4.,100, -2.,2.,"s");
311 
312  sprintf(histo,"ErrxMFTrackwidthProfile_WClus4_rphi_layer%dtib",i+1);
313  meErrxMFTrackwidthProfileWclus4RphiTIB[i] = dbe_->bookProfile(histo,"Resolution Track width Profile Wclus1", 12, 0., 4.,100, -2.,2.,"s");
314 
315  sprintf(histo,"ResMFTrackwidthProfile_WClus1_rphi_layer%dtib",i+1);
316  meResMFTrackwidthProfileWclus1RphiTIB[i] = dbe_->bookProfile(histo,"Residue Track width Profile Wclus1", 12, 0., 4.,100, -2.,2.,"s");
317  sprintf(histo,"ResMFTrackwidthProfile_WClus2_rphi_layer%dtib",i+1);
318  meResMFTrackwidthProfileWclus2RphiTIB[i] = dbe_->bookProfile(histo,"Residue Track width Profile Wclus1", 12, 0., 4.,100, -2.,2.,"s");
319 
320  sprintf(histo,"ResMFTrackwidthProfile_WClus3_rphi_layer%dtib",i+1);
321  meResMFTrackwidthProfileWclus3RphiTIB[i] = dbe_->bookProfile(histo,"Residue Track width Profile Wclus1", 12, 0., 4.,100, -2.,2.,"s");
322 
323  sprintf(histo,"ResMFTrackwidthProfile_WClus4_rphi_layer%dtib",i+1);
324  meResMFTrackwidthProfileWclus4RphiTIB[i] = dbe_->bookProfile(histo,"Residue Track width Profile Wclus1", 12, 0., 4.,100, -2.,2.,"s");
325 
326 
327 
328  sprintf(histo,"ErrxMFTrackwidthProfile_Category1_rphi_layer%dtib",i+1);
329  meErrxMFTrackwidthProfileCategory1RphiTIB[i] = dbe_->bookProfile(histo,"Resolution Track width Profile Category1", 12, 0., 4.,100, -2.,2.,"s");
330 
331  sprintf(histo,"ErrxMFTrackwidthProfile_Category2_rphi_layer%dtib",i+1);
332  meErrxMFTrackwidthProfileCategory2RphiTIB[i] = dbe_->bookProfile(histo,"Resolution Track width Profile Category2", 12, 0., 4.,100, -2.,2.,"s");
333 
334  sprintf(histo,"ErrxMFTrackwidthProfile_Category3_rphi_layer%dtib",i+1);
335  meErrxMFTrackwidthProfileCategory3RphiTIB[i] = dbe_->bookProfile(histo,"Resolution Track width Profile Category3", 12, 0., 4.,100, -2.,2.,"s");
336 
337  sprintf(histo,"ErrxMFTrackwidthProfile_Category4_rphi_layer%dtib",i+1);
338  meErrxMFTrackwidthProfileCategory4RphiTIB[i] = dbe_->bookProfile(histo,"Resolution Track width Profile Category4", 12, 0., 4.,100, -2.,2.,"s");
339 
340  sprintf(histo,"ErrxMFAngleProfile_rphi_layer%dtib",i+1);
341  meErrxMFAngleProfileRphiTIB[i] = dbe_->bookProfile(histo,"Resolution Angle Profile", 100, 0., 1.,100, -2.,2.,"s");
342 
343  sprintf(histo,"ErrxMFClusterwidthProfile_Category1_rphi_layer%dtib",i+1);
344  meErrxMFClusterwidthProfileCategory1RphiTIB[i] = dbe_->bookProfile(histo,"Resolution Cluster width Profile Category1", 100, 0., 10.,100, -2.,2.,"s");
345 
346  }
347 
348  //one histo per Layer stereo and matched hits
349  for(int i = 0 ;i<2 ; i++) {
350  Char_t histo[200];
351  sprintf(histo,"Nstp_sas_layer%dtib",i+1);
352  meNstpSasTIB[i] = dbe_->book1D(histo,"RecHit Cluster Size",20,0.5,20.5);
353  sprintf(histo,"Adc_sas_layer%dtib",i+1);
354  meAdcSasTIB[i] = dbe_->book1D(histo,"RecHit Cluster Charge",100,0.,300.);
355  sprintf(histo,"Posx_sas_layer%dtib",i+1);
356  mePosxSasTIB[i] = dbe_->book1D(histo,"RecHit x coord.",100,-6.0,+6.0);
357 
358  sprintf(histo,"Errx_LF_sas_layer%dtib",i+1);
359  meErrxLFSasTIB[i] = dbe_->book1D(histo,"RecHit err(x) coord.",100,0.,0.005);
360  sprintf(histo,"Errx_MF_sas_layer%dtib",i+1);
361  meErrxMFSasTIB[i] = dbe_->book1D(histo,"RecHit err(x) coord.",100,0.,0.5);
362 
363  sprintf(histo,"Res_LF_sas_layer%dtib",i+1);
364  meResLFSasTIB[i] = dbe_->book1D(histo,"RecHit Residual",100,-0.02,+0.02);
365  sprintf(histo,"Res_MF_sas_layer%dtib",i+1);
366  meResMFSasTIB[i] = dbe_->book1D(histo,"RecHit Residual",100,-2,+2);
367 
368  sprintf(histo,"Pull_LF_sas_layer%dtib",i+1);
369  mePullLFSasTIB[i] = dbe_->book1D(histo,"Pull",100,-4.,4.);
370  sprintf(histo,"Pull_MF_sas_layer%dtib",i+1);
371  mePullMFSasTIB[i] = dbe_->book1D(histo,"Pull",100,-4.,4.);
372 
373  sprintf(histo,"Trackangle_sas_layer%dtib",i+1);
374  meTrackangleSasTIB[i] = dbe_->book1D(histo,"Track angle",100,-40.,40.);
375 
376  sprintf(histo,"Trackanglebeta_sas_layer%dtib",i+1);
377  meTrackanglebetaSasTIB[i] = dbe_->book1D(histo,"Track angle beta",100,-40.,40.);
378 
379  sprintf(histo,"PullTrackangleProfile_sas_layer%dtib",i+1);
380  mePullTrackangleProfileSasTIB[i] = dbe_->bookProfile(histo,"Pull Track angle Profile", 100, -40., 40.,100,-4.,4.,"s");
381 
382  sprintf(histo,"Trackwidth_sas_layer%dtib",i+1);
383  meTrackwidthSasTIB[i] = dbe_->book1D(histo,"Track width",100,0.,1.);
384 
385  sprintf(histo,"Expectedwidth_sas_layer%dtib",i+1);
386  meExpectedwidthSasTIB[i] = dbe_->book1D(histo,"Expected width",10,0.,10.);
387 
388  sprintf(histo,"Clusterwidth_sas_layer%dtib",i+1);
389  meClusterwidthSasTIB[i] = dbe_->book1D(histo,"Cluster width",10,0.,10.);
390 
391  sprintf(histo,"Category_sas_layer%dtib",i+1);
392  meCategorySasTIB[i] = dbe_->book1D(histo,"Cluster Category",10,0.,10.);
393 
394  sprintf(histo,"PullTrackwidthProfile_sas_layer%dtib",i+1);
395  mePullTrackwidthProfileSasTIB[i] = dbe_->bookProfile(histo,"Pull Track width Profile", 100, 0., 1.,100, -2.,2.,"s");
396 
397  sprintf(histo,"PullTrackwidthProfile_Category1_sas_layer%dtib",i+1);
398  mePullTrackwidthProfileCategory1SasTIB[i] = dbe_->bookProfile(histo,"Pull Track width Profile Category1", 100, 0., 1.,100, -2.,2.,"s");
399 
400  sprintf(histo,"PullTrackwidthProfile_Category2_sas_layer%dtib",i+1);
401  mePullTrackwidthProfileCategory2SasTIB[i] = dbe_->bookProfile(histo,"Pull Track width Profile Category2", 100, 0., 1.,100, -2.,2.,"s");
402 
403  sprintf(histo,"PullTrackwidthProfile_Category3_sas_layer%dtib",i+1);
404  mePullTrackwidthProfileCategory3SasTIB[i] = dbe_->bookProfile(histo,"Pull Track width Profile Category3", 100, 0., 1.,100, -2.,2.,"s");
405 
406  sprintf(histo,"PullTrackwidthProfile_Category4_sas_layer%dtib",i+1);
407  mePullTrackwidthProfileCategory4SasTIB[i] = dbe_->bookProfile(histo,"Pull Track width Profile Category4", 100, 0., 1.,100, -2.,2.,"s");
408 
409  sprintf(histo,"ErrxMFTrackwidthProfile_sas_layer%dtib",i+1);
410  meErrxMFTrackwidthProfileSasTIB[i] = dbe_->bookProfile(histo,"Resolution Track width Profile", 12,0.,4.,100, -2.,2.,"s");
411 
412  sprintf(histo,"ErrxMFTrackwidthProfile_Category1_sas_layer%dtib",i+1);
413  meErrxMFTrackwidthProfileCategory1SasTIB[i] = dbe_->bookProfile(histo,"Resolution Track width Profile Category1", 12,0.,4.,100, -2.,2.,"s");
414  sprintf(histo,"ErrxMFTrackwidthProfile_Category2_sas_layer%dtib",i+1);
415  meErrxMFTrackwidthProfileCategory2SasTIB[i] = dbe_->bookProfile(histo,"Resolution Track width Profile Category2", 12,0.,4.,100, -2.,2.,"s");
416  sprintf(histo,"ErrxMFTrackwidthProfile_Category3_sas_layer%dtib",i+1);
417  meErrxMFTrackwidthProfileCategory3SasTIB[i] = dbe_->bookProfile(histo,"Resolution Track width Profile Category3", 12,0.,4.,100, -2.,2.,"s");
418  sprintf(histo,"ErrxMFTrackwidthProfile_Category4_sas_layer%dtib",i+1);
419  meErrxMFTrackwidthProfileCategory4SasTIB[i] = dbe_->bookProfile(histo,"Resolution Track width Profile Category4", 12,0.,4.,100, -2.,2.,"s");
420 
421  sprintf(histo,"ErrxMFAngleProfile_sas_layer%dtib",i+1);
422  meErrxMFAngleProfileSasTIB[i] = dbe_->bookProfile(histo,"Resolution Angle Profile", 100, 0., 1.,100, -2.,2.,"s");
423 
424  sprintf(histo,"ErrxMFClusterwidthProfile_Category1_sas_layer%dtib",i+1);
425  meErrxMFClusterwidthProfileCategory1SasTIB[i] = dbe_->bookProfile(histo,"Resolution Cluster width Profile Category1", 100, 0., 10.,100, -2.,2.,"s");
426 
427 
428 
429  sprintf(histo,"Posx_matched_layer%dtib",i+1);
430  mePosxMatchedTIB[i] = dbe_->book1D(histo,"RecHit x coord.",100,-6.0, +6.0);
431  sprintf(histo,"Posy_matched_layer%dtib",i+1);
432  mePosyMatchedTIB[i] = dbe_->book1D(histo,"RecHit y coord.",100,-6.0, +6.0);
433  sprintf(histo,"Errx_matched_layer%dtib",i+1);
434  meErrxMatchedTIB[i] = dbe_->book1D(histo,"RecHit err(x) coord.",100,0., 0.05);
435  sprintf(histo,"Erry_matched_layer%dtib",i+1);
436  meErryMatchedTIB[i] = dbe_->book1D(histo,"RecHit err(y) coord.",100,0., 0.05);
437  sprintf(histo,"Resx_matched_layer%dtib",i+1);
438  meResxMatchedTIB[i] = dbe_->book1D(histo,"RecHit Res(x) coord.",100,-0.02, +0.02);
439  sprintf(histo,"Resy_matched_layer%dtib",i+1);
440  meResyMatchedTIB[i] = dbe_->book1D(histo,"RecHit Res(y) coord.",100,-1., +1.);
441  sprintf(histo,"Pullx_matched_layer%dtib",i+1);
442  mePullxMatchedTIB[i] = dbe_->book1D(histo,"Pull",100,-5.,5.);
443  sprintf(histo,"Pully_matched_layer%dtib",i+1);
444  mePullyMatchedTIB[i] = dbe_->book1D(histo,"Pull",100,-5.,5.);
445  }
446 
447  dbe_->setCurrentFolder("Tracking/TrackingRecHits/Strip/TOB");
448  //one histo per Layer rphi hits
449  for(int i = 0 ;i<6 ; i++) {
450  Char_t histo[200];
451  sprintf(histo,"Nstp_rphi_layer%dtob",i+1);
452  meNstpRphiTOB[i] = dbe_->book1D(histo,"RecHit Cluster Size",20,0.5,20.5);
453  sprintf(histo,"Adc_rphi_layer%dtob",i+1);
454  meAdcRphiTOB[i] = dbe_->book1D(histo,"RecHit Cluster Charge",100,0.,300.);
455  sprintf(histo,"Posx_rphi_layer%dtob",i+1);
456  mePosxRphiTOB[i] = dbe_->book1D(histo,"RecHit x coord.",100,-6.0,+6.0);
457 
458  sprintf(histo,"Errx_LF_rphi_layer%dtob",i+1);
459  meErrxLFRphiTOB[i] = dbe_->book1D(histo,"RecHit err(x) coord.",100,0,0.01);
460  sprintf(histo,"Errx_MF_rphi_layer%dtob",i+1);
461  meErrxMFRphiTOB[i] = dbe_->book1D(histo,"RecHit err(x) coord.",100,0,0.5);
462 
463  sprintf(histo,"Res_LF_rphi_layer%dtob",i+1);
464  meResLFRphiTOB[i] = dbe_->book1D(histo,"RecHit Residual",100,-0.02,+0.02);
465  sprintf(histo,"Res_MF_rphi_layer%dtob",i+1);
466  meResMFRphiTOB[i] = dbe_->book1D(histo,"RecHit Residual",100,-2,2);
467 
468  sprintf(histo,"Pull_LF_rphi_layer%dtob",i+1);
469  mePullLFRphiTOB[i] = dbe_->book1D(histo,"Pull",100,-5.,5.);
470  sprintf(histo,"Pull_MF_rphi_layer%dtob",i+1);
471  mePullMFRphiTOB[i] = dbe_->book1D(histo,"Pull",100,-5.,5.);
472 
473  sprintf(histo,"Trackangle_rphi_layer%dtob",i+1);
474  meTrackangleRphiTOB[i] = dbe_->book1D(histo,"Track angle",100,-20.,20.);
475 
476  sprintf(histo,"Trackanglebeta_rphi_layer%dtob",i+1);
477  meTrackanglebetaRphiTOB[i] = dbe_->book1D(histo,"Track angle beta",100,-20.,20.);
478 
479  sprintf(histo,"PullTrackangleProfile_rphi_layer%dtob",i+1);
480  mePullTrackangleProfileRphiTOB[i] = dbe_->bookProfile(histo,"Pull Track angle Profile", 100, -20., 20.,100,-5.,5.,"s");
481 
482  sprintf(histo,"Trackwidth_rphi_layer%dtob",i+1);
483  meTrackwidthRphiTOB[i] = dbe_->book1D(histo,"Track width",100,0.,4.);
484 
485  sprintf(histo,"Expectedwidth_rphi_layer%dtob",i+1);
486  meExpectedwidthRphiTOB[i] = dbe_->book1D(histo,"Expected width",10,0.,10.);
487 
488  sprintf(histo,"Clusterwidth_rphi_layer%dtob",i+1);
489  meClusterwidthRphiTOB[i] = dbe_->book1D(histo,"Cluster width",10,0.,10.);
490 
491  sprintf(histo,"Category_rphi_layer%dtob",i+1);
492  meCategoryRphiTOB[i] = dbe_->book1D(histo,"Cluster Category",10,0.,10.);
493 
494  sprintf(histo,"PullTrackwidthProfile_rphi_layer%dtob",i+1);
495  mePullTrackwidthProfileRphiTOB[i] = dbe_->bookProfile(histo,"Pull Track width Profile", 100, 0., 1.,100, -2.,2.,"s");
496 
497  sprintf(histo,"PullTrackwidthProfile_Category1_rphi_layer%dtob",i+1);
498  mePullTrackwidthProfileCategory1RphiTOB[i] = dbe_->bookProfile(histo,"Pull Track width Profile Category1", 100, 0., 1.,100, -2.,2.,"s");
499 
500  sprintf(histo,"PullTrackwidthProfile_Category2_rphi_layer%dtob",i+1);
501  mePullTrackwidthProfileCategory2RphiTOB[i] = dbe_->bookProfile(histo,"Pull Track width Profile Category2", 100, 0., 1.,100, -2.,2.,"s");
502 
503  sprintf(histo,"PullTrackwidthProfile_Category3_rphi_layer%dtob",i+1);
504  mePullTrackwidthProfileCategory3RphiTOB[i] = dbe_->bookProfile(histo,"Pull Track width Profile Category3", 100, 0., 1.,100, -2.,2.,"s");
505 
506  sprintf(histo,"PullTrackwidthProfile_Category4_rphi_layer%dtob",i+1);
507  mePullTrackwidthProfileCategory4RphiTOB[i] = dbe_->bookProfile(histo,"Pull Track width Profile Category4", 100, 0., 1.,100, -2.,2.,"s");
508 
509  sprintf(histo,"ErrxMFTrackwidthProfile_rphi_layer%dtob",i+1);
510  meErrxMFTrackwidthProfileRphiTOB[i] = dbe_->bookProfile(histo,"Resolution Track width Profile", 12,0.,4.,100, -2.,2.,"s");
511 
512  sprintf(histo,"ErrxMFTrackwidthProfile_WClus1_rphi_layer%dtob",i+1);
513  meErrxMFTrackwidthProfileWclus1RphiTOB[i] = dbe_->bookProfile(histo,"Resolution Track width Profile Wclus1", 12, 0., 4.,100, -2.,2.,"s");
514 
515  sprintf(histo,"ErrxMFTrackwidthProfile_WClus2_rphi_layer%dtob",i+1);
516  meErrxMFTrackwidthProfileWclus2RphiTOB[i] = dbe_->bookProfile(histo,"Resolution Track width Profile Wclus1", 12, 0., 4.,100, -2.,2.,"s");
517 
518  sprintf(histo,"ErrxMFTrackwidthProfile_WClus3_rphi_layer%dtob",i+1);
519  meErrxMFTrackwidthProfileWclus3RphiTOB[i] = dbe_->bookProfile(histo,"Resolution Track width Profile Wclus1", 12, 0., 4.,100, -2.,2.,"s");
520 
521  sprintf(histo,"ErrxMFTrackwidthProfile_WClus4_rphi_layer%dtob",i+1);
522  meErrxMFTrackwidthProfileWclus4RphiTOB[i] = dbe_->bookProfile(histo,"Resolution Track width Profile Wclus1", 12, 0., 4.,100, -2.,2.,"s");
523 
524  sprintf(histo,"ResMFTrackwidthProfile_WClus1_rphi_layer%dtob",i+1);
525  meResMFTrackwidthProfileWclus1RphiTOB[i] = dbe_->bookProfile(histo,"Residue Track width Profile Wclus1", 12, 0., 4.,100, -2.,2.,"s");
526  sprintf(histo,"ResMFTrackwidthProfile_WClus2_rphi_layer%dtob",i+1);
527  meResMFTrackwidthProfileWclus2RphiTOB[i] = dbe_->bookProfile(histo,"Residue Track width Profile Wclus1", 12, 0., 4.,100, -2.,2.,"s");
528 
529  sprintf(histo,"ResMFTrackwidthProfile_WClus3_rphi_layer%dtob",i+1);
530  meResMFTrackwidthProfileWclus3RphiTOB[i] = dbe_->bookProfile(histo,"Residue Track width Profile Wclus1", 12, 0., 4.,100, -2.,2.,"s");
531 
532  sprintf(histo,"ResMFTrackwidthProfile_WClus4_rphi_layer%dtob",i+1);
533  meResMFTrackwidthProfileWclus4RphiTOB[i] = dbe_->bookProfile(histo,"Residue Track width Profile Wclus1", 12, 0., 4.,100, -2.,2.,"s");
534 
535 
536 
537  sprintf(histo,"ErrxMFTrackwidthProfile_Category1_rphi_layer%dtob",i+1);
538  meErrxMFTrackwidthProfileCategory1RphiTOB[i] = dbe_->bookProfile(histo,"Resolution Track width Profile Category1", 12,0.,4.,100, -2.,2.,"s");
539 
540  sprintf(histo,"ErrxMFTrackwidthProfile_Category2_rphi_layer%dtob",i+1);
541  meErrxMFTrackwidthProfileCategory2RphiTOB[i] = dbe_->bookProfile(histo,"Resolution Track width Profile Category2", 12,0.,4.,100, -2.,2.,"s");
542 
543  sprintf(histo,"ErrxMFTrackwidthProfile_Category3_rphi_layer%dtob",i+1);
544  meErrxMFTrackwidthProfileCategory3RphiTOB[i] = dbe_->bookProfile(histo,"Resolution Track width Profile Category3", 12,0.,4.,100, -2.,2.,"s");
545 
546  sprintf(histo,"ErrxMFTrackwidthProfile_Category4_rphi_layer%dtob",i+1);
547  meErrxMFTrackwidthProfileCategory4RphiTOB[i] = dbe_->bookProfile(histo,"Resolution Track width Profile Category4", 12,0.,4.,100, -2.,2.,"s");
548 
549  sprintf(histo,"ErrxMFAngleProfile_rphi_layer%dtob",i+1);
550  meErrxMFAngleProfileRphiTOB[i] = dbe_->bookProfile(histo,"Resolution Angle Profile", 100, 0., 1.,100, -2.,2.,"s");
551 
552  sprintf(histo,"ErrxMFClusterwidthProfile_Category1_rphi_layer%dtob",i+1);
553  meErrxMFClusterwidthProfileCategory1RphiTOB[i] = dbe_->bookProfile(histo,"Resolution Cluster width Profile Category1", 100, 0., 10.,100, -2.,2.,"s");
554 
555  }
556 
557  //one histo per Layer stereo and matched hits
558  for(int i = 0 ;i<2 ; i++) {
559  Char_t histo[200];
560  sprintf(histo,"Nstp_sas_layer%dtob",i+1);
561  meNstpSasTOB[i] = dbe_->book1D(histo,"RecHit Cluster Size",20,0.5,20.5);
562  sprintf(histo,"Adc_sas_layer%dtob",i+1);
563  meAdcSasTOB[i] = dbe_->book1D(histo,"RecHit Cluster Charge",100,0.,300.);
564  sprintf(histo,"Posx_sas_layer%dtob",i+1);
565  mePosxSasTOB[i] = dbe_->book1D(histo,"RecHit x coord.",100,-6.0,+6.0);
566 
567  sprintf(histo,"Errx_LF_sas_layer%dtob",i+1);
568  meErrxLFSasTOB[i] = dbe_->book1D(histo,"RecHit err(x) coord.",100,0.,0.01);
569  sprintf(histo,"Errx_MF_sas_layer%dtob",i+1);
570  meErrxMFSasTOB[i] = dbe_->book1D(histo,"RecHit err(x) coord.",100,0.,0.5);
571 
572  sprintf(histo,"Res_LF_sas_layer%dtob",i+1);
573  meResLFSasTOB[i] = dbe_->book1D(histo,"RecHit Residual",100,-0.02,+0.02);
574  sprintf(histo,"Res_MF_sas_layer%dtob",i+1);
575  meResMFSasTOB[i] = dbe_->book1D(histo,"RecHit Residual",100,-2,2);
576 
577  sprintf(histo,"Pull_LF_sas_layer%dtob",i+1);
578  mePullLFSasTOB[i] = dbe_->book1D(histo,"Pull",100,-5.,5.);
579  sprintf(histo,"Pull_MF_sas_layer%dtob",i+1);
580  mePullMFSasTOB[i] = dbe_->book1D(histo,"Pull",100,-5.,5.);
581 
582  sprintf(histo,"Trackangle_sas_layer%dtob",i+1);
583  meTrackangleSasTOB[i] = dbe_->book1D(histo,"Track angle",100,-25.,25.);
584 
585  sprintf(histo,"Trackanglebeta_sas_layer%dtob",i+1);
586  meTrackanglebetaSasTOB[i] = dbe_->book1D(histo,"Track angle beta",100,-25.,25.);
587 
588  sprintf(histo,"PullTrackangleProfile_sas_layer%dtob",i+1);
589  mePullTrackangleProfileSasTOB[i] = dbe_->bookProfile(histo,"Pull Track angle Profile", 100, -25., 25. ,100 , -5., 5.,"s");
590 
591  sprintf(histo,"Trackwidth_sas_layer%dtob",i+1);
592  meTrackwidthSasTOB[i] = dbe_->book1D(histo,"Track width",100,0.,1.);
593 
594  sprintf(histo,"Expectedwidth_sas_layer%dtob",i+1);
595  meExpectedwidthSasTOB[i] = dbe_->book1D(histo,"Expected width",10,0.,10.);
596 
597  sprintf(histo,"Clusterwidth_sas_layer%dtob",i+1);
598  meClusterwidthSasTOB[i] = dbe_->book1D(histo,"Cluster width",10,0.,10.);
599 
600  sprintf(histo,"Category_sas_layer%dtob",i+1);
601  meCategorySasTOB[i] = dbe_->book1D(histo,"Cluster Category",10,0.,10.);
602 
603  sprintf(histo,"PullTrackwidthProfile_sas_layer%dtob",i+1);
604  mePullTrackwidthProfileSasTOB[i] = dbe_->bookProfile(histo,"Pull Track width Profile", 100, 0., 1.,100, -2.,2.,"s");
605 
606  sprintf(histo,"PullTrackwidthProfile_Category1_sas_layer%dtob",i+1);
607  mePullTrackwidthProfileCategory1SasTOB[i] = dbe_->bookProfile(histo,"Pull Track width Profile Category1", 100, 0., 1.,100, -2.,2.,"s");
608 
609  sprintf(histo,"PullTrackwidthProfile_Category2_sas_layer%dtob",i+1);
610  mePullTrackwidthProfileCategory2SasTOB[i] = dbe_->bookProfile(histo,"Pull Track width Profile Category2", 100, 0., 1.,100, -2.,2.,"s");
611 
612  sprintf(histo,"PullTrackwidthProfile_Category3_sas_layer%dtob",i+1);
613  mePullTrackwidthProfileCategory3SasTOB[i] = dbe_->bookProfile(histo,"Pull Track width Profile Category3", 100, 0., 1.,100, -2.,2.,"s");
614 
615  sprintf(histo,"PullTrackwidthProfile_Category4_sas_layer%dtob",i+1);
616  mePullTrackwidthProfileCategory4SasTOB[i] = dbe_->bookProfile(histo,"Pull Track width Profile Category4", 100, 0., 1.,100, -2.,2.,"s");
617 
618  sprintf(histo,"ErrxMFTrackwidthProfile_sas_layer%dtob",i+1);
619  meErrxMFTrackwidthProfileSasTOB[i] = dbe_->bookProfile(histo,"Resolution Track width Profile", 12,0.,4.,100, -2.,2.,"s");
620 
621  sprintf(histo,"ErrxMFTrackwidthProfile_Category1_sas_layer%dtob",i+1);
622  meErrxMFTrackwidthProfileCategory1SasTOB[i] = dbe_->bookProfile(histo,"Resolution Track width Profile Category1", 12,0.,4.,100, -2.,2.,"s");
623  sprintf(histo,"ErrxMFTrackwidthProfile_Category2_sas_layer%dtob",i+1);
624  meErrxMFTrackwidthProfileCategory2SasTOB[i] = dbe_->bookProfile(histo,"Resolution Track width Profile Category2", 12,0.,4.,100, -2.,2.,"s");
625  sprintf(histo,"ErrxMFTrackwidthProfile_Category3_sas_layer%dtob",i+1);
626  meErrxMFTrackwidthProfileCategory3SasTOB[i] = dbe_->bookProfile(histo,"Resolution Track width Profile Category3", 12,0.,4.,100, -2.,2.,"s");
627  sprintf(histo,"ErrxMFTrackwidthProfile_Category4_sas_layer%dtob",i+1);
628  meErrxMFTrackwidthProfileCategory4SasTOB[i] = dbe_->bookProfile(histo,"Resolution Track width Profile Category4", 12,0.,4.,100, -2.,2.,"s");
629 
630  sprintf(histo,"ErrxMFAngleProfile_sas_layer%dtob",i+1);
631  meErrxMFAngleProfileSasTOB[i] = dbe_->bookProfile(histo,"Resolution Angle Profile", 100, 0., 1.,100, -2.,2.,"s");
632 
633  sprintf(histo,"ErrxMFClusterwidthProfile_Category1_sas_layer%dtob",i+1);
634  meErrxMFClusterwidthProfileCategory1SasTOB[i] = dbe_->bookProfile(histo,"Resolution Cluster width Profile Category1", 100, 0., 10.,100, -2.,2.,"s");
635 
636  sprintf(histo,"Posx_matched_layer%dtob",i+1);
637  mePosxMatchedTOB[i] = dbe_->book1D(histo,"RecHit x coord.",100,-6.0, +6.0);
638  sprintf(histo,"Posy_matched_layer%dtob",i+1);
639  mePosyMatchedTOB[i] = dbe_->book1D(histo,"RecHit y coord.",100,-6.0, +6.0);
640  sprintf(histo,"Errx_matched_layer%dtob",i+1);
641  meErrxMatchedTOB[i] = dbe_->book1D(histo,"RecHit err(x) coord.",100,0., 0.05);
642  sprintf(histo,"Erry_matched_layer%dtob",i+1);
643  meErryMatchedTOB[i] = dbe_->book1D(histo,"RecHit err(y) coord.",100,0., 0.05);
644  sprintf(histo,"Resx_matched_layer%dtob",i+1);
645  meResxMatchedTOB[i] = dbe_->book1D(histo,"RecHit Res(x) coord.",100,-0.02, +0.02);
646  sprintf(histo,"Resy_matched_layer%dtob",i+1);
647  meResyMatchedTOB[i] = dbe_->book1D(histo,"RecHit Res(y) coord.",100,-1., +1.);
648  sprintf(histo,"Pullx_matched_layer%dtob",i+1);
649  mePullxMatchedTOB[i] = dbe_->book1D(histo,"Pull",100,-5.,5.);
650  sprintf(histo,"Pully_matched_layer%dtob",i+1);
651  mePullyMatchedTOB[i] = dbe_->book1D(histo,"Pull",100,-5.,5.);
652  }
653 
654  dbe_->setCurrentFolder("Tracking/TrackingRecHits/Strip/TID");
655  //one histo per Ring rphi hits: 3 rings, 6 disks, 2 inner rings are glued
656  for(int i = 0 ;i<3 ; i++) {
657  Char_t histo[200];
658  sprintf(histo,"Nstp_rphi_layer%dtid",i+1);
659  meNstpRphiTID[i] = dbe_->book1D(histo,"RecHit Cluster Size",20,0.5,20.5);
660  sprintf(histo,"Adc_rphi_layer%dtid",i+1);
661  meAdcRphiTID[i] = dbe_->book1D(histo,"RecHit Cluster Charge",100,0.,300.);
662  sprintf(histo,"Posx_rphi_layer%dtid",i+1);
663  mePosxRphiTID[i] = dbe_->book1D(histo,"RecHit x coord.",100,-6.0,+6.0);
664  sprintf(histo,"Errx_LF_rphi_layer%dtid",i+1);
665  meErrxLFRphiTID[i] = dbe_->book1D(histo,"RecHit err(x) coord.",100,0,0.5);
666  sprintf(histo,"Errx_MF_rphi_layer%dtid",i+1);
667  meErrxMFRphiTID[i] = dbe_->book1D(histo,"RecHit err(x) coord.",100,0,0.5);
668  sprintf(histo,"Res_LF_rphi_layer%dtid",i+1);
669  meResLFRphiTID[i] = dbe_->book1D(histo,"RecHit Residual",100,-0.5,+0.5);
670  sprintf(histo,"Res_MF_rphi_layer%dtid",i+1);
671  meResMFRphiTID[i] = dbe_->book1D(histo,"RecHit Residual",100,-2,2);
672  sprintf(histo,"Pull_LF_rphi_layer%dtid",i+1);
673  mePullLFRphiTID[i] = dbe_->book1D(histo,"Pull",100,-5.,5.);
674  sprintf(histo,"Pull_MF_rphi_layer%dtid",i+1);
675  mePullMFRphiTID[i] = dbe_->book1D(histo,"Pull",100,-5.,5.);
676  sprintf(histo,"Trackangle_rphi_layer%dtid",i+1);
677  meTrackangleRphiTID[i] = dbe_->book1D(histo,"Track angle",100,-20.,20.);
678 
679  sprintf(histo,"Trackanglebeta_rphi_layer%dtid",i+1);
680  meTrackanglebetaRphiTID[i] = dbe_->book1D(histo,"Track angle beta",100,-20.,20.);
681 
682  sprintf(histo,"PullTrackangleProfile_rphi_layer%dtid",i+1);
683  mePullTrackangleProfileRphiTID[i] = dbe_->bookProfile(histo,"Pull Track angle Profile", 100, -20., 20.,100, -5., 5.,"s");
684 
685  sprintf(histo,"Trackwidth_rphi_layer%dtid",i+1);
686  meTrackwidthRphiTID[i] = dbe_->book1D(histo,"Track width",100,0.,1.);
687 
688  sprintf(histo,"Expectedwidth_rphi_layer%dtid",i+1);
689  meExpectedwidthRphiTID[i] = dbe_->book1D(histo,"Expected width",10,0.,10.);
690 
691  sprintf(histo,"Clusterwidth_rphi_layer%dtid",i+1);
692  meClusterwidthRphiTID[i] = dbe_->book1D(histo,"Cluster width",10,0.,10.);
693 
694  sprintf(histo,"Category_rphi_layer%dtid",i+1);
695  meCategoryRphiTID[i] = dbe_->book1D(histo,"Cluster Category",10,0.,10.);
696 
697  sprintf(histo,"PullTrackwidthProfile_rphi_layer%dtid",i+1);
698  mePullTrackwidthProfileRphiTID[i] = dbe_->bookProfile(histo,"Pull Track width Profile", 100, 0., 1.,100, -2.,2.,"s");
699 
700  sprintf(histo,"PullTrackwidthProfile_Category1_rphi_layer%dtid",i+1);
701  mePullTrackwidthProfileCategory1RphiTID[i] = dbe_->bookProfile(histo,"Pull Track width Profile Category1", 100, 0., 1.,100, -2.,2.,"s");
702 
703  sprintf(histo,"PullTrackwidthProfile_Category2_rphi_layer%dtid",i+1);
704  mePullTrackwidthProfileCategory2RphiTID[i] = dbe_->bookProfile(histo,"Pull Track width Profile Category2", 100, 0., 1.,100, -2.,2.,"s");
705 
706  sprintf(histo,"PullTrackwidthProfile_Category3_rphi_layer%dtid",i+1);
707  mePullTrackwidthProfileCategory3RphiTID[i] = dbe_->bookProfile(histo,"Pull Track width Profile Category3", 100, 0., 1.,100, -2.,2.,"s");
708 
709  sprintf(histo,"PullTrackwidthProfile_Category4_rphi_layer%dtid",i+1);
710  mePullTrackwidthProfileCategory4RphiTID[i] = dbe_->bookProfile(histo,"Pull Track width Profile Category4", 100, 0., 1.,100, -2.,2.,"s");
711 
712  sprintf(histo,"ErrxMFTrackwidthProfile_rphi_layer%dtid",i+1);
713  meErrxMFTrackwidthProfileRphiTID[i] = dbe_->bookProfile(histo,"Resolution Track width Profile", 12,0.,4.,100, -2.,2.,"s");
714 
715  sprintf(histo,"ErrxMFTrackwidthProfile_Category1_rphi_layer%dtid",i+1);
716  meErrxMFTrackwidthProfileCategory1RphiTID[i] = dbe_->bookProfile(histo,"Resolution Track width Profile Category1", 12,0.,4.,100, -2.,2.,"s");
717  sprintf(histo,"ErrxMFTrackwidthProfile_Category2_rphi_layer%dtid",i+1);
718  meErrxMFTrackwidthProfileCategory2RphiTID[i] = dbe_->bookProfile(histo,"Resolution Track width Profile Category2", 12,0.,4.,100, -2.,2.,"s");
719  sprintf(histo,"ErrxMFTrackwidthProfile_Category3_rphi_layer%dtid",i+1);
720  meErrxMFTrackwidthProfileCategory3RphiTID[i] = dbe_->bookProfile(histo,"Resolution Track width Profile Category3", 12,0.,4.,100, -2.,2.,"s");
721  sprintf(histo,"ErrxMFTrackwidthProfile_Category4_rphi_layer%dtid",i+1);
722  meErrxMFTrackwidthProfileCategory4RphiTID[i] = dbe_->bookProfile(histo,"Resolution Track width Profile Category4", 12,0.,4.,100, -2.,2.,"s");
723 
724  sprintf(histo,"ErrxMFAngleProfile_rphi_layer%dtid",i+1);
725  meErrxMFAngleProfileRphiTID[i] = dbe_->bookProfile(histo,"Resolution Angle Profile", 100, 0., 1.,100, -2.,2.,"s");
726 
727  sprintf(histo,"ErrxMFClusterwidthProfile_Category1_rphi_layer%dtid",i+1);
728  meErrxMFClusterwidthProfileCategory1RphiTID[i] = dbe_->bookProfile(histo,"Resolution Cluster width Profile Category1", 100, 0., 10.,100, -2.,2.,"s");
729 
730  }
731 
732  //one histo per Ring stereo and matched hits
733  for(int i = 0 ;i<2 ; i++) {
734  Char_t histo[200];
735  sprintf(histo,"Nstp_sas_layer%dtid",i+1);
736  meNstpSasTID[i] = dbe_->book1D(histo,"RecHit Cluster Size",20,0.5,20.5);
737  sprintf(histo,"Adc_sas_layer%dtid",i+1);
738  meAdcSasTID[i] = dbe_->book1D(histo,"RecHit Cluster Charge",100,0.,300.);
739  sprintf(histo,"Posx_sas_layer%dtid",i+1);
740  mePosxSasTID[i] = dbe_->book1D(histo,"RecHit x coord.",100,-6.0,+6.0);
741  sprintf(histo,"Errx_LF_sas_layer%dtid",i+1);
742  meErrxLFSasTID[i] = dbe_->book1D(histo,"RecHit err(x) coord.",100,0.,0.5);
743  sprintf(histo,"Errx_MF_sas_layer%dtid",i+1);
744  meErrxMFSasTID[i] = dbe_->book1D(histo,"RecHit err(x) coord.",100,0.,0.5);
745  sprintf(histo,"Res_LF_sas_layer%dtid",i+1);
746  meResLFSasTID[i] = dbe_->book1D(histo,"RecHit Residual",100,-0.5,+0.5);
747  sprintf(histo,"Res_MF_sas_layer%dtid",i+1);
748  meResMFSasTID[i] = dbe_->book1D(histo,"RecHit Residual",100,-2,2);
749  sprintf(histo,"Pull_LF_sas_layer%dtid",i+1);
750  mePullLFSasTID[i] = dbe_->book1D(histo,"Pull",100,-5.,5.);
751  sprintf(histo,"Pull_MF_sas_layer%dtid",i+1);
752  mePullMFSasTID[i] = dbe_->book1D(histo,"Pull",100,-5.,5.);
753  sprintf(histo,"Trackangle_sas_layer%dtid",i+1);
754  meTrackangleSasTID[i] = dbe_->book1D(histo,"Track angle",100,-20.,20.);
755  sprintf(histo,"Trackanglebeta_sas_layer%dtid",i+1);
756  meTrackanglebetaSasTID[i] = dbe_->book1D(histo,"Track angle beta",100,-20.,20.);
757 
758  sprintf(histo,"PullTrackangleProfile_sas_layer%dtid",i+1);
759  mePullTrackangleProfileSasTID[i] = dbe_->bookProfile(histo,"Pull Track angle Profile", 100, -20., 20.,100, -5., 5.,"s");
760 
761  sprintf(histo,"Trackwidth_sas_layer%dtid",i+1);
762  meTrackwidthSasTID[i] = dbe_->book1D(histo,"Track width",100,0.,1.);
763 
764  sprintf(histo,"Expectedwidth_sas_layer%dtid",i+1);
765  meExpectedwidthSasTID[i] = dbe_->book1D(histo,"Expected width",10,0.,10.);
766 
767  sprintf(histo,"Clusterwidth_sas_layer%dtid",i+1);
768  meClusterwidthSasTID[i] = dbe_->book1D(histo,"Cluster width",10,0.,10.);
769 
770  sprintf(histo,"Category_sas_layer%dtid",i+1);
771  meCategorySasTID[i] = dbe_->book1D(histo,"Cluster Category",10,0.,10.);
772 
773  sprintf(histo,"PullTrackwidthProfile_sas_layer%dtid",i+1);
774  mePullTrackwidthProfileSasTID[i] = dbe_->bookProfile(histo,"Pull Track width Profile", 100, 0., 1.,100, -2.,2.,"s");
775 
776  sprintf(histo,"PullTrackwidthProfile_Category1_sas_layer%dtid",i+1);
777  mePullTrackwidthProfileCategory1SasTID[i] = dbe_->bookProfile(histo,"Pull Track width Profile Category1", 100, 0., 1.,100, -2.,2.,"s");
778 
779  sprintf(histo,"PullTrackwidthProfile_Category2_sas_layer%dtid",i+1);
780  mePullTrackwidthProfileCategory2SasTID[i] = dbe_->bookProfile(histo,"Pull Track width Profile Category2", 100, 0., 1.,100, -2.,2.,"s");
781 
782  sprintf(histo,"PullTrackwidthProfile_Category3_sas_layer%dtid",i+1);
783  mePullTrackwidthProfileCategory3SasTID[i] = dbe_->bookProfile(histo,"Pull Track width Profile Category3", 100, 0., 1.,100, -2.,2.,"s");
784 
785  sprintf(histo,"PullTrackwidthProfile_Category4_sas_layer%dtid",i+1);
786  mePullTrackwidthProfileCategory4SasTID[i] = dbe_->bookProfile(histo,"Pull Track width Profile Category4", 100, 0., 1.,100, -2.,2.,"s");
787 
788  sprintf(histo,"ErrxMFTrackwidthProfile_sas_layer%dtid",i+1);
789  meErrxMFTrackwidthProfileSasTID[i] = dbe_->bookProfile(histo,"Resolution Track width Profile", 12,0.,4.,100, -2.,2.,"s");
790 
791  sprintf(histo,"ErrxMFTrackwidthProfile_Category1_sas_layer%dtid",i+1);
792  meErrxMFTrackwidthProfileCategory1SasTID[i] = dbe_->bookProfile(histo,"Resolution Track width Profile Category1", 12,0.,4.,100, -2.,2.,"s");
793  sprintf(histo,"ErrxMFTrackwidthProfile_Category2_sas_layer%dtid",i+1);
794  meErrxMFTrackwidthProfileCategory2SasTID[i] = dbe_->bookProfile(histo,"Resolution Track width Profile Category2", 12,0.,4.,100, -2.,2.,"s");
795  sprintf(histo,"ErrxMFTrackwidthProfile_Category3_sas_layer%dtid",i+1);
796  meErrxMFTrackwidthProfileCategory3SasTID[i] = dbe_->bookProfile(histo,"Resolution Track width Profile Category3", 12,0.,4.,100, -2.,2.,"s");
797  sprintf(histo,"ErrxMFTrackwidthProfile_Category4_sas_layer%dtid",i+1);
798  meErrxMFTrackwidthProfileCategory4SasTID[i] = dbe_->bookProfile(histo,"Resolution Track width Profile Category4", 12,0.,4.,100, -2.,2.,"s");
799 
800  sprintf(histo,"ErrxMFAngleProfile_sas_layer%dtid",i+1);
801  meErrxMFAngleProfileSasTID[i] = dbe_->bookProfile(histo,"Resolution Angle Profile", 100, 0., 1.,100, -2.,2.,"s");
802 
803  sprintf(histo,"ErrxMFClusterwidthProfile_Category1_sas_layer%dtid",i+1);
804  meErrxMFClusterwidthProfileCategory1SasTID[i] = dbe_->bookProfile(histo,"Resolution Cluster width Profile Category1", 100, 0., 10.,100, -2.,2.,"s");
805 
806  sprintf(histo,"Posx_matched_layer%dtid",i+1);
807  mePosxMatchedTID[i] = dbe_->book1D(histo,"RecHit x coord.",100,-6.0, +6.0);
808  sprintf(histo,"Posy_matched_layer%dtid",i+1);
809  mePosyMatchedTID[i] = dbe_->book1D(histo,"RecHit y coord.",100,-6.0, +6.0);
810  sprintf(histo,"Errx_matched_layer%dtid",i+1);
811  meErrxMatchedTID[i] = dbe_->book1D(histo,"RecHit err(x) coord.",100,0., 0.02);
812  sprintf(histo,"Erry_matched_layer%dtid",i+1);
813  meErryMatchedTID[i] = dbe_->book1D(histo,"RecHit err(y) coord.",100,0., 0.1);
814  sprintf(histo,"Resx_matched_layer%dtid",i+1);
815  meResxMatchedTID[i] = dbe_->book1D(histo,"RecHit Res(x) coord.",100,-0.2, +0.2);
816  sprintf(histo,"Resy_matched_layer%dtid",i+1);
817  meResyMatchedTID[i] = dbe_->book1D(histo,"RecHit Res(y) coord.",100,-1., +1.);
818  sprintf(histo,"Pullx_matched_layer%dtid",i+1);
819  mePullxMatchedTID[i] = dbe_->book1D(histo,"Pull",100,-5.,5.);
820  sprintf(histo,"Pully_matched_layer%dtid",i+1);
821  mePullyMatchedTID[i] = dbe_->book1D(histo,"Pull",100,-5.,5.);
822  }
823 
824  dbe_->setCurrentFolder("Tracking/TrackingRecHits/Strip/TEC");
825  //one histo per Ring rphi hits: 7 rings, 18 disks. Innermost 3 rings are same as TID above.
826  for(int i = 0 ;i<7 ; i++) {
827  Char_t histo[200];
828  sprintf(histo,"Nstp_rphi_layer%dtec",i+1);
829  meNstpRphiTEC[i] = dbe_->book1D(histo,"RecHit Cluster Size",20,0.5,20.5);
830  sprintf(histo,"Adc_rphi_layer%dtec",i+1);
831  meAdcRphiTEC[i] = dbe_->book1D(histo,"RecHit Cluster Charge",100,0.,300.);
832  sprintf(histo,"Posx_rphi_layer%dtec",i+1);
833  mePosxRphiTEC[i] = dbe_->book1D(histo,"RecHit x coord.",100,-6.0,+6.0);
834 
835  sprintf(histo,"Errx_LF_rphi_layer%dtec",i+1);
836  meErrxLFRphiTEC[i] = dbe_->book1D(histo,"RecHit err(x) coord.",100,0,0.5);
837  sprintf(histo,"Errx_MF_rphi_layer%dtec",i+1);
838  meErrxMFRphiTEC[i] = dbe_->book1D(histo,"RecHit err(x) coord.",100,0,0.5);
839 
840  sprintf(histo,"Res_LF_rphi_layer%dtec",i+1);
841  meResLFRphiTEC[i] = dbe_->book1D(histo,"RecHit Residual",100,-0.5,+0.5);
842  sprintf(histo,"Res_MF_rphi_layer%dtec",i+1);
843  meResMFRphiTEC[i] = dbe_->book1D(histo,"RecHit Residual",100,-2,2);
844 
845  sprintf(histo,"Pull_LF_rphi_layer%dtec",i+1);
846  mePullLFRphiTEC[i] = dbe_->book1D(histo,"Pull",100,-5.,5.);
847  sprintf(histo,"Pull_MF_rphi_layer%dtec",i+1);
848  mePullMFRphiTEC[i] = dbe_->book1D(histo,"Pull",100,-5.,5.);
849 
850  sprintf(histo,"Trackangle_rphi_layer%dtec",i+1);
851  meTrackangleRphiTEC[i] = dbe_->book1D(histo,"Track angle",100,-10.,10.);
852 
853  sprintf(histo,"Trackanglebeta_rphi_layer%dtec",i+1);
854  meTrackanglebetaRphiTEC[i] = dbe_->book1D(histo,"Track angle beta",100,-10.,10.);
855 
856  sprintf(histo,"PullTrackangleProfile_rphi_layer%dtec",i+1);
857  mePullTrackangleProfileRphiTEC[i] = dbe_->bookProfile(histo,"Pull Track angle Profile", 100, -10., 10.,100, -5., 5.,"s");
858 
859  sprintf(histo,"Trackwidth_rphi_layer%dtec",i+1);
860  meTrackwidthRphiTEC[i] = dbe_->book1D(histo,"Track width",100,0.,1.);
861 
862  sprintf(histo,"Expectedwidth_rphi_layer%dtec",i+1);
863  meExpectedwidthRphiTEC[i] = dbe_->book1D(histo,"Expected width",10,0.,10.);
864 
865  sprintf(histo,"Clusterwidth_rphi_layer%dtec",i+1);
866  meClusterwidthRphiTEC[i] = dbe_->book1D(histo,"Cluster width",10,0.,10.);
867 
868  sprintf(histo,"Category_rphi_layer%dtec",i+1);
869  meCategoryRphiTEC[i] = dbe_->book1D(histo,"Cluster Category",10,0.,10.);
870 
871  sprintf(histo,"PullTrackwidthProfile_rphi_layer%dtec",i+1);
872  mePullTrackwidthProfileRphiTEC[i] = dbe_->bookProfile(histo,"Pull Track width Profile", 100, 0., 1.,100, -2.,2.,"s");
873 
874  sprintf(histo,"PullTrackwidthProfile_Category1_rphi_layer%dtec",i+1);
875  mePullTrackwidthProfileCategory1RphiTEC[i] = dbe_->bookProfile(histo,"Pull Track width Profile Category1", 100, 0., 1.,100, -2.,2.,"s");
876 
877  sprintf(histo,"PullTrackwidthProfile_Category2_rphi_layer%dtec",i+1);
878  mePullTrackwidthProfileCategory2RphiTEC[i] = dbe_->bookProfile(histo,"Pull Track width Profile Category2", 100, 0., 1.,100, -2.,2.,"s");
879 
880  sprintf(histo,"PullTrackwidthProfile_Category3_rphi_layer%dtec",i+1);
881  mePullTrackwidthProfileCategory3RphiTEC[i] = dbe_->bookProfile(histo,"Pull Track width Profile Category3", 100, 0., 1.,100, -2.,2.,"s");
882 
883  sprintf(histo,"PullTrackwidthProfile_Category4_rphi_layer%dtec",i+1);
884  mePullTrackwidthProfileCategory4RphiTEC[i] = dbe_->bookProfile(histo,"Pull Track width Profile Category4", 100, 0., 1.,100, -2.,2.,"s");
885 
886  sprintf(histo,"ErrxMFTrackwidthProfile_rphi_layer%dtec",i+1);
887  meErrxMFTrackwidthProfileRphiTEC[i] = dbe_->bookProfile(histo,"Resolution Track width Profile", 12,0.,4.,100, -2.,2.,"s");
888 
889  sprintf(histo,"ErrxMFTrackwidthProfile_Category1_rphi_layer%dtec",i+1);
890  meErrxMFTrackwidthProfileCategory1RphiTEC[i] = dbe_->bookProfile(histo,"Resolution Track width Profile Category1", 12,0.,4.,100, -2.,2.,"s");
891  sprintf(histo,"ErrxMFTrackwidthProfile_Category2_rphi_layer%dtec",i+1);
892  meErrxMFTrackwidthProfileCategory2RphiTEC[i] = dbe_->bookProfile(histo,"Resolution Track width Profile Category2", 12,0.,4.,100, -2.,2.,"s");
893  sprintf(histo,"ErrxMFTrackwidthProfile_Category3_rphi_layer%dtec",i+1);
894  meErrxMFTrackwidthProfileCategory3RphiTEC[i] = dbe_->bookProfile(histo,"Resolution Track width Profile Category3", 12,0.,4.,100, -2.,2.,"s");
895  sprintf(histo,"ErrxMFTrackwidthProfile_Category4_rphi_layer%dtec",i+1);
896  meErrxMFTrackwidthProfileCategory4RphiTEC[i] = dbe_->bookProfile(histo,"Resolution Track width Profile Category4", 12,0.,4.,100, -2.,2.,"s");
897 
898  sprintf(histo,"ErrxMFAngleProfile_rphi_layer%dtec",i+1);
899  meErrxMFAngleProfileRphiTEC[i] = dbe_->bookProfile(histo,"Resolution Angle Profile", 100, 0., 1.,100, -2.,2.,"s");
900 
901  sprintf(histo,"ErrxMFClusterwidthProfile_Category1_rphi_layer%dtec",i+1);
902  meErrxMFClusterwidthProfileCategory1RphiTEC[i] = dbe_->bookProfile(histo,"Resolution Cluster width Profile Category1", 100, 0., 10.,100, -2.,2.,"s");
903 
904  }
905 
906  //one histo per Layer stereo and matched hits: rings 1,2,5 are double sided
907  for(int i = 0 ;i<5 ; i++) {
908  if(i == 0 || i == 1 || i == 4) {
909  Char_t histo[200];
910  sprintf(histo,"Nstp_sas_layer%dtec",i+1);
911  meNstpSasTEC[i] = dbe_->book1D(histo,"RecHit Cluster Size",20,0.5,20.5);
912  sprintf(histo,"Adc_sas_layer%dtec",i+1);
913  meAdcSasTEC[i] = dbe_->book1D(histo,"RecHit Cluster Charge",100,0.,300.);
914  sprintf(histo,"Posx_sas_layer%dtec",i+1);
915  mePosxSasTEC[i] = dbe_->book1D(histo,"RecHit x coord.",100,-6.0,+6.0);
916  sprintf(histo,"Errx_LF_sas_layer%dtec",i+1);
917  meErrxLFSasTEC[i] = dbe_->book1D(histo,"RecHit err(x) coord.",100,0.,0.5);
918  sprintf(histo,"Errx_MF_sas_layer%dtec",i+1);
919  meErrxMFSasTEC[i] = dbe_->book1D(histo,"RecHit err(x) coord.",100,0.,0.5);
920  sprintf(histo,"Res_LF_sas_layer%dtec",i+1);
921  meResLFSasTEC[i] = dbe_->book1D(histo,"RecHit Residual",100,-0.5,+0.5);
922  sprintf(histo,"Res_MF_sas_layer%dtec",i+1);
923  meResMFSasTEC[i] = dbe_->book1D(histo,"RecHit Residual",100,-2,+2);
924  sprintf(histo,"Pull_LF_sas_layer%dtec",i+1);
925  mePullLFSasTEC[i] = dbe_->book1D(histo,"Pull",100,-5.,5.);
926  sprintf(histo,"Pull_MF_sas_layer%dtec",i+1);
927  mePullMFSasTEC[i] = dbe_->book1D(histo,"Pull",100,-5.,5.);
928  sprintf(histo,"Trackangle_sas_layer%dtec",i+1);
929  meTrackangleSasTEC[i] = dbe_->book1D(histo,"Track angle",100,-10.,10.);
930  sprintf(histo,"Trackanglebeta_sas_layer%dtec",i+1);
931  meTrackanglebetaSasTEC[i] = dbe_->book1D(histo,"Track angle beta",100,-10.,10.);
932 
933  sprintf(histo,"PullTrackangleProfile_sas_layer%dtec",i+1);
934  mePullTrackangleProfileSasTEC[i] = dbe_->bookProfile(histo,"Pull Track angle Profile", 100, -10., 10.,100, -5., 5.,"s");
935 
936  sprintf(histo,"Trackwidth_sas_layer%dtec",i+1);
937  meTrackwidthSasTEC[i] = dbe_->book1D(histo,"Track width",100,0.,1.);
938 
939  sprintf(histo,"Expectedwidth_sas_layer%dtec",i+1);
940  meExpectedwidthSasTEC[i] = dbe_->book1D(histo,"Expected width",10,0.,10.);
941 
942  sprintf(histo,"Clusterwidth_sas_layer%dtec",i+1);
943  meClusterwidthSasTEC[i] = dbe_->book1D(histo,"Cluster width",10,0.,10.);
944 
945  sprintf(histo,"Category_sas_layer%dtec",i+1);
946  meCategorySasTEC[i] = dbe_->book1D(histo,"Cluster Category",10,0.,10.);
947 
948  sprintf(histo,"PullTrackwidthProfile_sas_layer%dtec",i+1);
949  mePullTrackwidthProfileSasTEC[i] = dbe_->bookProfile(histo,"Pull Track width Profile", 100, 0., 1.,100, -2.,2.,"s");
950 
951  sprintf(histo,"PullTrackwidthProfile_Category1_sas_layer%dtec",i+1);
952  mePullTrackwidthProfileCategory1SasTEC[i] = dbe_->bookProfile(histo,"Pull Track width Profile Category1", 100, 0., 1.,100, -2.,2.,"s");
953 
954  sprintf(histo,"PullTrackwidthProfile_Category2_sas_layer%dtec",i+1);
955  mePullTrackwidthProfileCategory2SasTEC[i] = dbe_->bookProfile(histo,"Pull Track width Profile Category2", 100, 0., 1.,100, -2.,2.,"s");
956 
957  sprintf(histo,"PullTrackwidthProfile_Category3_sas_layer%dtec",i+1);
958  mePullTrackwidthProfileCategory3SasTEC[i] = dbe_->bookProfile(histo,"Pull Track width Profile Category3", 100, 0., 1.,100, -2.,2.,"s");
959 
960  sprintf(histo,"PullTrackwidthProfile_Category4_sas_layer%dtec",i+1);
961  mePullTrackwidthProfileCategory4SasTEC[i] = dbe_->bookProfile(histo,"Pull Track width Profile Category4", 100, 0., 1.,100, -2.,2.,"s");
962 
963  sprintf(histo,"ErrxMFTrackwidthProfile_sas_layer%dtec",i+1);
964  meErrxMFTrackwidthProfileSasTEC[i] = dbe_->bookProfile(histo,"Resolution Track width Profile", 12,0.,4.,100, -2.,2.,"s");
965 
966  sprintf(histo,"ErrxMFTrackwidthProfile_Category1_sas_layer%dtec",i+1);
967  meErrxMFTrackwidthProfileCategory1SasTEC[i] = dbe_->bookProfile(histo,"Resolution Track width Profile Category1", 12,0.,4.,100, -2.,2.,"s");
968  sprintf(histo,"ErrxMFTrackwidthProfile_Category2_sas_layer%dtec",i+1);
969  meErrxMFTrackwidthProfileCategory2SasTEC[i] = dbe_->bookProfile(histo,"Resolution Track width Profile Category2", 12,0.,4.,100, -2.,2.,"s");
970  sprintf(histo,"ErrxMFTrackwidthProfile_Category3_sas_layer%dtec",i+1);
971  meErrxMFTrackwidthProfileCategory3SasTEC[i] = dbe_->bookProfile(histo,"Resolution Track width Profile Category3", 12,0.,4.,100, -2.,2.,"s");
972  sprintf(histo,"ErrxMFTrackwidthProfile_Category4_sas_layer%dtec",i+1);
973  meErrxMFTrackwidthProfileCategory4SasTEC[i] = dbe_->bookProfile(histo,"Resolution Track width Profile Category4", 12,0.,4.,100, -2.,2.,"s");
974 
975  sprintf(histo,"ErrxMFAngleProfile_sas_layer%dtec",i+1);
976  meErrxMFAngleProfileSasTEC[i] = dbe_->bookProfile(histo,"Resolution Angle Profile", 100, 0., 1.,100, -2.,2.,"s");
977 
978  sprintf(histo,"ErrxMFClusterwidthProfile_Category1_sas_layer%dtec",i+1);
979  meErrxMFClusterwidthProfileCategory1SasTEC[i] = dbe_->bookProfile(histo,"Resolution Cluster width Profile Category1", 100, 0., 10.,100, -2.,2.,"s");
980 
981  sprintf(histo,"Posx_matched_layer%dtec",i+1);
982  mePosxMatchedTEC[i] = dbe_->book1D(histo,"RecHit x coord.",100,-6.0, +6.0);
983  sprintf(histo,"Posy_matched_layer%dtec",i+1);
984  mePosyMatchedTEC[i] = dbe_->book1D(histo,"RecHit y coord.",100,-8.0, +8.0);
985  sprintf(histo,"Errx_matched_layer%dtec",i+1);
986  meErrxMatchedTEC[i] = dbe_->book1D(histo,"RecHit err(x) coord.",100,0., 0.02);
987  sprintf(histo,"Erry_matched_layer%dtec",i+1);
988  meErryMatchedTEC[i] = dbe_->book1D(histo,"RecHit err(y) coord.",100,0., 0.1);
989  sprintf(histo,"Resx_matched_layer%dtec",i+1);
990  meResxMatchedTEC[i] = dbe_->book1D(histo,"RecHit Res(x) coord.",100,-0.2, +0.2);
991  sprintf(histo,"Resy_matched_layer%dtec",i+1);
992  meResyMatchedTEC[i] = dbe_->book1D(histo,"RecHit Res(y) coord.",100,-1., +1.);
993  sprintf(histo,"Pullx_matched_layer%dtec",i+1);
994  mePullxMatchedTEC[i] = dbe_->book1D(histo,"Pull",100,-5.,5.);
995  sprintf(histo,"Pully_matched_layer%dtec",i+1);
996  mePullyMatchedTEC[i] = dbe_->book1D(histo,"Pull",100,-5.,5.);
997  }
998  }
999 
1000 
1001 }
1002 
1004 
1005  /*
1006  dbe_->setCurrentFolder("Tracking/TrackingRecHits/Strip/ALL");
1007 
1008  PullvsTrackwidth->FitSlicesY();
1009  ErrxMFvsTrackwidth->FitSlicesY();
1010  PullvsExpectedwidth->FitSlicesY();
1011  PullvsClusterwidth->FitSlicesY();
1012  PullvsTrackangle->FitSlicesY();
1013  PullvsTrackanglebeta->FitSlicesY();
1014 
1015  PullvsTrackwidthTIB->FitSlicesY();
1016  PullvsExpectedwidthTIB->FitSlicesY();
1017  PullvsClusterwidthTIB->FitSlicesY();
1018  PullvsTrackangleTIB->FitSlicesY();
1019  PullvsTrackanglebetaTIB->FitSlicesY();
1020 
1021  PullvsTrackwidthTOB->FitSlicesY();
1022  PullvsExpectedwidthTOB->FitSlicesY();
1023  PullvsClusterwidthTOB->FitSlicesY();
1024  PullvsTrackangleTOB->FitSlicesY();
1025  PullvsTrackanglebetaTOB->FitSlicesY();
1026 
1027  PullvsTrackwidthTID->FitSlicesY();
1028  PullvsExpectedwidthTID->FitSlicesY();
1029  PullvsClusterwidthTID->FitSlicesY();
1030  PullvsTrackangleTID->FitSlicesY();
1031  PullvsTrackanglebetaTID->FitSlicesY();
1032 
1033  PullvsTrackwidthTEC->FitSlicesY();
1034  PullvsExpectedwidthTEC->FitSlicesY();
1035  PullvsClusterwidthTEC->FitSlicesY();
1036  PullvsTrackangleTEC->FitSlicesY();
1037  PullvsTrackanglebetaTEC->FitSlicesY();
1038 
1039  //int aaa = Pullvstrackwidth_1->GetEntries();ErrxMFvsTrackwidth
1040 
1041  TH1D *PullvsTrackwidth_2 = (TH1D*)gDirectory->Get("PullvsTrackwidth_2");
1042  TH1D *PullvsExpectedwidth_2 = (TH1D*)gDirectory->Get("PullvsExpectedwidth_2");
1043  TH1D *PullvsClusterwidth_2 = (TH1D*)gDirectory->Get("PullvsClusterwidth_2");
1044  TH1D *PullvsTrackangle_2 = (TH1D*)gDirectory->Get("PullvsTrackangle_2");
1045  TH1D *PullvsTrackanglebeta_2 = (TH1D*)gDirectory->Get("PullvsTrackanglebeta_2");
1046 
1047  TH1D *PullvsTrackwidthTIB_2 = (TH1D*)gDirectory->Get("PullvsTrackwidthTIB_2");
1048  TH1D *PullvsExpectedwidthTIB_2 = (TH1D*)gDirectory->Get("PullvsExpectedwidthTIB_2");
1049  TH1D *PullvsClusterwidthTIB_2 = (TH1D*)gDirectory->Get("PullvsClusterwidthTIB_2");
1050  TH1D *PullvsTrackangleTIB_2 = (TH1D*)gDirectory->Get("PullvsTrackangleTIB_2");
1051  TH1D *PullvsTrackanglebetaTIB_2 = (TH1D*)gDirectory->Get("PullvsTrackanglebetaTIB_2");
1052 
1053  TH1D *PullvsTrackwidthTOB_2 = (TH1D*)gDirectory->Get("PullvsTrackwidthTOB_2");
1054  TH1D *PullvsExpectedwidthTOB_2 = (TH1D*)gDirectory->Get("PullvsExpectedwidthTOB_2");
1055  TH1D *PullvsClusterwidthTOB_2 = (TH1D*)gDirectory->Get("PullvsClusterwidthTOB_2");
1056  TH1D *PullvsTrackangleTOB_2 = (TH1D*)gDirectory->Get("PullvsTrackangleTOB_2");
1057  TH1D *PullvsTrackanglebetaTOB_2 = (TH1D*)gDirectory->Get("PullvsTrackanglebetaTOB_2");
1058 
1059  TH1D *PullvsTrackwidthTID_2 = (TH1D*)gDirectory->Get("PullvsTrackwidthTID_2");
1060  TH1D *PullvsExpectedwidthTID_2 = (TH1D*)gDirectory->Get("PullvsExpectedwidthTID_2");
1061  TH1D *PullvsClusterwidthTID_2 = (TH1D*)gDirectory->Get("PullvsClusterwidthTID_2");
1062  TH1D *PullvsTrackangleTID_2 = (TH1D*)gDirectory->Get("PullvsTrackangleTID_2");
1063  TH1D *PullvsTrackanglebetaTID_2 = (TH1D*)gDirectory->Get("PullvsTrackanglebetaTID_2");
1064 
1065  TH1D *PullvsTrackwidthTEC_2 = (TH1D*)gDirectory->Get("PullvsTrackwidthTEC_2");
1066  TH1D *PullvsExpectedwidthTEC_2 = (TH1D*)gDirectory->Get("PullvsExpectedwidthTEC_2");
1067  TH1D *PullvsClusterwidthTEC_2 = (TH1D*)gDirectory->Get("PullvsClusterwidthTEC_2");
1068  TH1D *PullvsTrackangleTEC_2 = (TH1D*)gDirectory->Get("PullvsTrackangleTEC_2");
1069  TH1D *PullvsTrackanglebetaTEC_2 = (TH1D*)gDirectory->Get("PullvsTrackanglebetaTEC_2");
1070 
1071  //cout<<"h2_1->GetEntries() = "<<PullvsTrackwidth_1->GetEntries()<<endl;
1072  //cout<<"ddbb1"<<endl;
1073  unsigned int NBINSPullvsTrackwidth =PullvsTrackwidth_2->GetNbinsX();
1074  unsigned int NBINSPullvsClusterwidth = PullvsClusterwidth_2->GetNbinsX();
1075  unsigned int NBINSPullvsExpectedwidth = PullvsExpectedwidth_2->GetNbinsX();
1076  //cout<<"ddbb2"<<endl;
1077  unsigned int NBINSPullvsTrackangle = PullvsTrackangle_2->GetNbinsX();
1078  unsigned int NBINSPullvsTrackanglebeta = PullvsTrackanglebeta_2->GetNbinsX();
1079  //cout<<"ddbb3"<<endl;
1080 
1081  PullRMSvsTrackwidth = dbe_->book1D("PullRMSvsTrackwidth", "PullRMSvsTrackwidth",NBINSPullvsTrackwidth ,0.,4.);
1082  PullRMSvsClusterwidth = dbe_->book1D("PullRMSvsClusterwidth", "PullRMSvsClusterwidth",NBINSPullvsClusterwidth ,0.5,8.5);
1083  PullRMSvsExpectedwidth = dbe_->book1D("PullRMSvsExpectedwidth", "PullRMSvsExpectedwidth",NBINSPullvsExpectedwidth ,0.5,4.5);
1084  PullRMSvsTrackangle = dbe_->book1D("PullRMSvsTrackangle", "PullRMSvsTrackangle",NBINSPullvsTrackangle ,0.,90.);
1085  PullRMSvsTrackanglebeta = dbe_->book1D("PullRMSvsTrackanglebeta", "PullRMSvsTrackanglebeta",NBINSPullvsTrackanglebeta ,0.,90.);
1086 
1087  PullRMSvsTrackwidthTIB = dbe_->book1D("PullRMSvsTrackwidthTIB", "PullRMSvsTrackwidthTIB",NBINSPullvsTrackwidth ,0.,4.);
1088  PullRMSvsClusterwidthTIB = dbe_->book1D("PullRMSvsClusterwidthTIB", "PullRMSvsClusterwidthTIB",NBINSPullvsClusterwidth ,0.5,8.5);
1089  PullRMSvsExpectedwidthTIB = dbe_->book1D("PullRMSvsExpectedwidthTIB", "PullRMSvsExpectedwidthTIB",NBINSPullvsExpectedwidth ,0.5,4.5);
1090  PullRMSvsTrackangleTIB = dbe_->book1D("PullRMSvsTrackangleTIB", "PullRMSvsTrackangleTIB",NBINSPullvsTrackangle ,0.,90.);
1091  PullRMSvsTrackanglebetaTIB = dbe_->book1D("PullRMSvsTrackanglebetaTIB", "PullRMSvsTrackanglebetaTIB",NBINSPullvsTrackanglebeta ,0.,90.);
1092 
1093  PullRMSvsTrackwidthTOB = dbe_->book1D("PullRMSvsTrackwidthTOB", "PullRMSvsTrackwidthTOB",NBINSPullvsTrackwidth ,0.,4.);
1094  PullRMSvsClusterwidthTOB = dbe_->book1D("PullRMSvsClusterwidthTOB", "PullRMSvsClusterwidthTOB",NBINSPullvsClusterwidth ,0.5,8.5);
1095  PullRMSvsExpectedwidthTOB = dbe_->book1D("PullRMSvsExpectedwidthTOB", "PullRMSvsExpectedwidthTOB",NBINSPullvsExpectedwidth ,0.5,4.5);
1096  PullRMSvsTrackangleTOB = dbe_->book1D("PullRMSvsTrackangleTOB", "PullRMSvsTrackangleTOB",NBINSPullvsTrackangle ,0.,90.);
1097  PullRMSvsTrackanglebetaTOB = dbe_->book1D("PullRMSvsTrackanglebetaTOB", "PullRMSvsTrackanglebetaTOB",NBINSPullvsTrackanglebeta ,0.,90.);
1098 
1099  PullRMSvsTrackwidthTID = dbe_->book1D("PullRMSvsTrackwidthTID", "PullRMSvsTrackwidthTID",NBINSPullvsTrackwidth ,0.,4.);
1100  PullRMSvsClusterwidthTID = dbe_->book1D("PullRMSvsClusterwidthTID", "PullRMSvsClusterwidthTID",NBINSPullvsClusterwidth ,0.5,8.5);
1101  PullRMSvsExpectedwidthTID = dbe_->book1D("PullRMSvsExpectedwidthTID", "PullRMSvsExpectedwidthTID",NBINSPullvsExpectedwidth ,0.5,4.5);
1102  PullRMSvsTrackangleTID = dbe_->book1D("PullRMSvsTrackangleTID", "PullRMSvsTrackangleTID",NBINSPullvsTrackangle ,0.,90.);
1103  PullRMSvsTrackanglebetaTID = dbe_->book1D("PullRMSvsTrackanglebetaTID", "PullRMSvsTrackanglebetaTID",NBINSPullvsTrackanglebeta ,0.,90.);
1104 
1105  PullRMSvsTrackwidthTEC = dbe_->book1D("PullRMSvsTrackwidthTEC", "PullRMSvsTrackwidthTEC",NBINSPullvsTrackwidth ,0.,4.);
1106  PullRMSvsClusterwidthTEC = dbe_->book1D("PullRMSvsClusterwidthTEC", "PullRMSvsClusterwidthTEC",NBINSPullvsClusterwidth ,0.5,8.5);
1107  PullRMSvsExpectedwidthTEC = dbe_->book1D("PullRMSvsExpectedwidthTEC", "PullRMSvsExpectedwidthTEC",NBINSPullvsExpectedwidth ,0.5,4.5);
1108  PullRMSvsTrackangleTEC = dbe_->book1D("PullRMSvsTrackangleTEC", "PullRMSvsTrackangleTEC",NBINSPullvsTrackangle ,0.,90.);
1109  PullRMSvsTrackanglebetaTEC = dbe_->book1D("PullRMSvsTrackanglebetaTEC", "PullRMSvsTrackanglebetaTEC",NBINSPullvsTrackanglebeta ,0.,90.);
1110 
1111  //cout<<"ddbb5"<<endl;
1112  for(unsigned int i = 0; i !=NBINSPullvsTrackwidth ; ++i){
1113  PullRMSvsTrackwidth->setBinContent(i,PullvsTrackwidth_2 ->GetBinContent(i));
1114  PullRMSvsTrackwidth->setBinError(i,PullvsTrackwidth_2 ->GetBinError(i));
1115  PullRMSvsTrackwidthTIB->setBinContent(i,PullvsTrackwidthTIB_2 ->GetBinContent(i));
1116  PullRMSvsTrackwidthTIB->setBinError(i,PullvsTrackwidthTIB_2 ->GetBinError(i));
1117  PullRMSvsTrackwidthTOB->setBinContent(i,PullvsTrackwidthTOB_2 ->GetBinContent(i));
1118  PullRMSvsTrackwidthTOB->setBinError(i,PullvsTrackwidthTOB_2 ->GetBinError(i));
1119  PullRMSvsTrackwidthTID->setBinContent(i,PullvsTrackwidthTID_2 ->GetBinContent(i));
1120  PullRMSvsTrackwidthTID->setBinError(i,PullvsTrackwidthTID_2 ->GetBinError(i));
1121  PullRMSvsTrackwidthTEC->setBinContent(i,PullvsTrackwidthTEC_2 ->GetBinContent(i));
1122  PullRMSvsTrackwidthTEC->setBinError(i,PullvsTrackwidthTEC_2 ->GetBinError(i));
1123  }
1124  //cout<<"ddbb6"<<endl;
1125  for(unsigned int i = 0; i != NBINSPullvsClusterwidth; ++i){
1126  PullRMSvsClusterwidth->setBinContent(i,PullvsClusterwidth_2 ->GetBinContent(i));
1127  PullRMSvsClusterwidth->setBinError(i,PullvsClusterwidth_2 ->GetBinError(i));
1128  PullRMSvsClusterwidthTIB->setBinContent(i,PullvsClusterwidthTIB_2 ->GetBinContent(i));
1129  PullRMSvsClusterwidthTIB->setBinError(i,PullvsClusterwidthTIB_2 ->GetBinError(i));
1130  PullRMSvsClusterwidthTOB->setBinContent(i,PullvsClusterwidthTOB_2 ->GetBinContent(i));
1131  PullRMSvsClusterwidthTOB->setBinError(i,PullvsClusterwidthTOB_2 ->GetBinError(i));
1132  PullRMSvsClusterwidthTID->setBinContent(i,PullvsClusterwidthTID_2 ->GetBinContent(i));
1133  PullRMSvsClusterwidthTID->setBinError(i,PullvsClusterwidthTID_2 ->GetBinError(i));
1134  PullRMSvsClusterwidthTEC->setBinContent(i,PullvsClusterwidthTEC_2 ->GetBinContent(i));
1135  PullRMSvsClusterwidthTEC->setBinError(i,PullvsClusterwidthTEC_2 ->GetBinError(i));
1136  }
1137  //cout<<"ddbb7"<<endl;
1138  for(unsigned int i = 0; i != NBINSPullvsExpectedwidth; ++i){
1139  PullRMSvsExpectedwidth->setBinContent(i,PullvsExpectedwidth_2 ->GetBinContent(i));
1140  PullRMSvsExpectedwidth->setBinError(i,PullvsExpectedwidth_2 ->GetBinError(i));
1141  PullRMSvsExpectedwidthTIB->setBinContent(i,PullvsExpectedwidthTIB_2 ->GetBinContent(i));
1142  PullRMSvsExpectedwidthTIB->setBinError(i,PullvsExpectedwidthTIB_2 ->GetBinError(i));
1143  PullRMSvsExpectedwidthTOB->setBinContent(i,PullvsExpectedwidthTOB_2 ->GetBinContent(i));
1144  PullRMSvsExpectedwidthTOB->setBinError(i,PullvsExpectedwidthTOB_2 ->GetBinError(i));
1145  PullRMSvsExpectedwidthTID->setBinContent(i,PullvsExpectedwidthTID_2 ->GetBinContent(i));
1146  PullRMSvsExpectedwidthTID->setBinError(i,PullvsExpectedwidthTID_2 ->GetBinError(i));
1147  PullRMSvsExpectedwidthTEC->setBinContent(i,PullvsExpectedwidthTEC_2 ->GetBinContent(i));
1148  PullRMSvsExpectedwidthTEC->setBinError(i,PullvsExpectedwidthTEC_2 ->GetBinError(i));
1149  }
1150  //cout<<"ddbb8"<<endl;
1151  for(unsigned int i = 0; i != NBINSPullvsTrackangle; ++i){
1152  PullRMSvsTrackangle->setBinContent(i,PullvsTrackangle_2 ->GetBinContent(i));
1153  PullRMSvsTrackangle->setBinError(i,PullvsTrackangle_2 ->GetBinError(i));
1154  PullRMSvsTrackangleTIB->setBinContent(i,PullvsTrackangleTIB_2 ->GetBinContent(i));
1155  PullRMSvsTrackangleTIB->setBinError(i,PullvsTrackangleTIB_2 ->GetBinError(i));
1156  PullRMSvsTrackangleTOB->setBinContent(i,PullvsTrackangleTOB_2 ->GetBinContent(i));
1157  PullRMSvsTrackangleTOB->setBinError(i,PullvsTrackangleTOB_2 ->GetBinError(i));
1158  PullRMSvsTrackangleTID->setBinContent(i,PullvsTrackangleTID_2 ->GetBinContent(i));
1159  PullRMSvsTrackangleTID->setBinError(i,PullvsTrackangleTID_2 ->GetBinError(i));
1160  PullRMSvsTrackangleTEC->setBinContent(i,PullvsTrackangleTEC_2 ->GetBinContent(i));
1161  PullRMSvsTrackangleTEC->setBinError(i,PullvsTrackangleTEC_2 ->GetBinError(i));
1162  }
1163  //cout<<"ddbb9"<<endl;
1164  for(unsigned int i = 0; i !=NBINSPullvsTrackanglebeta ; ++i){
1165  PullRMSvsTrackanglebeta->setBinContent(i,PullvsTrackanglebeta_2 ->GetBinContent(i));
1166  PullRMSvsTrackanglebeta->setBinError(i,PullvsTrackanglebeta_2 ->GetBinError(i));
1167  PullRMSvsTrackanglebetaTIB->setBinContent(i,PullvsTrackanglebetaTIB_2 ->GetBinContent(i));
1168  PullRMSvsTrackanglebetaTIB->setBinError(i,PullvsTrackanglebetaTIB_2 ->GetBinError(i));
1169  PullRMSvsTrackanglebetaTOB->setBinContent(i,PullvsTrackanglebetaTOB_2 ->GetBinContent(i));
1170  PullRMSvsTrackanglebetaTOB->setBinError(i,PullvsTrackanglebetaTOB_2 ->GetBinError(i));
1171  PullRMSvsTrackanglebetaTID->setBinContent(i,PullvsTrackanglebetaTID_2 ->GetBinContent(i));
1172  PullRMSvsTrackanglebetaTID->setBinError(i,PullvsTrackanglebetaTID_2 ->GetBinError(i));
1173  PullRMSvsTrackanglebetaTEC->setBinContent(i,PullvsTrackanglebetaTEC_2 ->GetBinContent(i));
1174  PullRMSvsTrackanglebetaTEC->setBinError(i,PullvsTrackanglebetaTEC_2 ->GetBinError(i));
1175  }
1176 */
1177 
1178 
1179 
1180  /*
1181  dbe_->setCurrentFolder("Tracking/TrackingRecHits/Strip/ALL");
1182  unsigned int NBINS = meErrxMFTrackwidthProfile->getNbinsX();
1183  float Entries = meErrxMFTrackwidthProfile->getEntries();
1184  cout<<"Entries = "<<Entries<<endl;
1185  cout<<"NBINS = "<<NBINS<<endl;
1186  NBINS=100;
1187  new_1D = dbe_->book1D("my_name", "my_title", NBINS,0.,5.);
1188  for(unsigned int i = 0; i != NBINS; ++i){
1189  cout<<"i, getBinError(i) = "<<i<<";"<<meErrxMFTrackwidthProfile ->getBinError(i)<<endl;
1190  new_1D->setBinContent(i,meErrxMFTrackwidthProfile ->getBinError(i));
1191  }
1192  */
1193 
1194  /*
1195  myFile->cd();
1196 
1197  PositionSHx->Write();
1198  Diff->Write();
1199  SecondStrip->Write();
1200  ErrxMF->Write();
1201  ErrxMFvsTrackwidth->Write();
1202  ResMFvsTrackwidth->Write();
1203  ResMFvsTrackwidthWClus1->Write();
1204  ResMFvsTrackwidthWClus1Wexp1->Write();
1205  ResMFvsTrackwidthWClus1Wexp2->Write();
1206  ResMFvsTrackwidthWClus1Wexp3->Write();
1207  ResMFvsTrackwidthWClus1Wexp4->Write();
1208  ResMFvsTrackwidthWClus2->Write();
1209  ResMFvsTrackwidthWClus2Wexp1->Write();
1210  ResMFvsTrackwidthWClus2Wexp2->Write();
1211  ResMFvsTrackwidthWClus2Wexp3->Write();
1212  ResMFvsTrackwidthWClus2Wexp4->Write();
1213  ResMFvsTrackwidthWClus3->Write();
1214  ResMFvsTrackwidthWClus3Wexp1->Write();
1215  ResMFvsTrackwidthWClus3Wexp2->Write();
1216  ResMFvsTrackwidthWClus3Wexp3->Write();
1217  ResMFvsTrackwidthWClus3Wexp4->Write();
1218  ResMFvsTrackwidthWClus4->Write();
1219  ResMFvsTrackwidthWClus4Wexp1->Write();
1220  ResMFvsTrackwidthWClus4Wexp2->Write();
1221  ResMFvsTrackwidthWClus4Wexp3->Write();
1222  ResMFvsTrackwidthWClus4Wexp4->Write();
1223  ErrxMFvsTrackwidthWClus1->Write();
1224  ErrxMFvsTrackwidthWClus2->Write();
1225  ErrxMFvsTrackwidthWClus3->Write();
1226  ErrxMFvsTrackwidthWClus4->Write();
1227 
1228  ResMFvsTrackwidthCategory2->Write();
1229  ResMFvsTrackwidthCategory3->Write();
1230  ResMFvsTrackwidthCategory4->Write();
1231 
1232  ErrxMFvsTrackwidthCategory2->Write();
1233  ErrxMFvsTrackwidthCategory3->Write();
1234  ErrxMFvsTrackwidthCategory4->Write();
1235 
1236  // ErrxMFvsTrackwidth_1->Write();
1237  //ErrxMFvsTrackwidth_2->Write();
1238 
1239  PullvsTrackwidth->Write();
1240  //PullvsTrackwidth_1 ->Write();
1241  //PullvsTrackwidth_2 ->Write();
1242  PullvsExpectedwidth->Write();
1243  PullvsExpectedwidth_1 ->Write();
1244  PullvsExpectedwidth_2 ->Write();
1245  PullvsClusterwidth->Write();
1246  PullvsClusterwidth_1 ->Write();
1247  PullvsClusterwidth_2 ->Write();
1248  PullvsTrackangle->Write();
1249  PullvsTrackangle_1 ->Write();
1250  PullvsTrackangle_2 ->Write();
1251  PullvsTrackanglebeta->Write();
1252  PullvsTrackanglebeta_1 ->Write();
1253  PullvsTrackanglebeta_2 ->Write();
1254  myFile->Close();
1255  */
1256 
1257 
1258  if ( outputFile_.size() != 0 && dbe_ ) dbe_->save(outputFile_);
1259 }
1260 
1261 // Virtual destructor needed.
1263 
1264 }
1265 
1266 // Functions that gets called by framework every event
1268 {
1269 
1270  // EventID e.id() ;
1271 
1272  // float diff=0;
1273  //float positionshx = 0;
1274  //int secondstrip = 0;
1275 
1276  int isrechitrphi = 0;
1277  int isrechitsas = 0;
1278  int isrechitmatched = 0;
1279 
1280  float anglealpha=0;
1281  float anglebeta=0;
1282  float Wtrack;
1283  int Wexp;
1284  int clusterWidth;
1285  DetId detid;
1286  uint32_t myid;
1287 
1289  LocalError error;
1290  MeasurementPoint Mposition;
1291  MeasurementError Merror;
1292 
1293  int clusiz=0;
1294  int totcharge=0;
1295 
1296 
1297  float mindist = 999999;
1298  float dist;
1299  std::vector<PSimHit> matched;
1300 
1301  TrackerHitAssociator associate(e, conf_);
1302  PSimHit closest;
1303 
1304 
1305 
1307  es.get<TrackerDigiGeometryRecord> ().get (pDD);
1308  const TrackerGeometry &tracker(*pDD);
1309 
1310  const TrackerGeometry * tracker2;
1312  es.get<TrackerDigiGeometryRecord>().get(estracker);
1313  tracker2=&(* estracker);
1314 
1316  //iRecord.getRecord<IdealMagneticFieldRecord>().get(magfield );
1317  es.get<IdealMagneticFieldRecord>().get(magfield );
1318  // magfield_ = magfield;
1319  //const magfield_
1320  const MagneticField & magfield_ (*magfield);
1321  magfield2_ = &magfield_;
1322 
1323 
1325  es.get<TkStripCPERecord>().get("SimpleStripCPE",stripcpe);
1326 
1327  //
1328 
1329 
1330  // Mangano's
1331 
1332  edm::Handle<vector<Trajectory> > trajCollectionHandle;
1333  e.getByLabel(conf_.getParameter<string>("trajectoryInput"),trajCollectionHandle);
1334 
1335  edm::LogVerbatim("TrajectoryAnalyzer") << "trajColl->size(): " << trajCollectionHandle->size() ;
1336 
1337  //cout<<"trajColl->size() = "<<trajCollectionHandle->size()<<endl;
1338 
1339  for(vector<Trajectory>::const_iterator it = trajCollectionHandle->begin(); it!=trajCollectionHandle->end();it++){
1340 
1341  edm::LogVerbatim("TrajectoryAnalyzer") << "this traj has " << it->foundHits() << " valid hits" << " , "
1342  << "isValid: " << it->isValid() ;
1343 
1344  vector<TrajectoryMeasurement> tmColl = it->measurements();
1345  for(vector<TrajectoryMeasurement>::const_iterator itTraj = tmColl.begin(); itTraj!=tmColl.end(); itTraj++){
1346  if(! itTraj->updatedState().isValid()) continue;
1347 
1348 // edm::LogVerbatim("TrajectoryAnalyzer") << "tm number: " << (itTraj - tmColl.begin()) + 1<< " , "
1349 // << "tm.backwardState.pt: " << itTraj->backwardPredictedState().globalMomentum().perp() << " , "
1350 // << "tm.forwardState.pt: " << itTraj->forwardPredictedState().globalMomentum().perp() << " , "
1351 // << "tm.updatedState.pt: " << itTraj->updatedState().globalMomentum().perp() << " , "
1352 // << "tm.globalPos.perp: " << itTraj->updatedState().globalPosition().perp() ;
1353 
1354  if ( itTraj->updatedState().globalMomentum().perp() < 1.) continue;
1355 
1356  TrajectoryStateOnSurface tsos=itTraj->updatedState();
1357  LocalVector trackdirection=tsos.localDirection();
1358 
1359  DetId detid2 = itTraj->recHit()->geographicalId();
1360 
1361  const TransientTrackingRecHit::ConstRecHitPointer thit2=itTraj->recHit();
1362  const SiStripMatchedRecHit2D* matchedhit=dynamic_cast<const SiStripMatchedRecHit2D*>((*thit2).hit());
1363  const SiStripRecHit2D* hit2d=dynamic_cast<const SiStripRecHit2D*>((*thit2).hit());
1364  const SiStripRecHit1D* hit1d=dynamic_cast<const SiStripRecHit1D*>((*thit2).hit());
1365  //if(matchedhit) cout<<"manganomatchedhit"<<endl;
1366  //if(hit) cout<<"manganosimplehit"<<endl;
1367  //if (hit && matchedhit) cout<<"manganosimpleandmatchedhit"<<endl;
1368  const TrackingRecHit *thit = (*thit2).hit();
1369 
1370  detid = (thit)->geographicalId();
1371  myid=((thit)->geographicalId()).rawId();
1372 
1373  StripSubdetector StripSubdet = (StripSubdetector) detid;
1374 
1375  isrechitmatched = 0;
1376 
1377  if(matchedhit){
1378 
1379  isrechitmatched = 1;
1380 
1381  position = (thit)->localPosition();
1382  // Mposition = topol.measurementPosition(position);
1383  error = (thit)->localPositionError();
1384  // Merror = topol.measurementError(position,error);
1385  rechitmatchedx = position.x();
1386  rechitmatchedy = position.y();
1387  rechitmatchedz = position.z();
1388  rechitmatchederrxx = error.xx();
1389  rechitmatchederrxy = error.xy();
1390  rechitmatchederryy = error.yy();
1391 
1392  //Association of the rechit to the simhit
1393  mindist = 999999;
1394  float distx, disty;
1395  std::pair<LocalPoint,LocalVector> closestPair;
1396  matched.clear();
1397  matched = associate.associateHit(*matchedhit);
1398  if(!matched.empty()){
1399  //project simhit;
1400  const GluedGeomDet* gluedDet = (const GluedGeomDet*)tracker.idToDet(matchedhit->geographicalId());
1401  const StripGeomDetUnit* partnerstripdet =(StripGeomDetUnit*) gluedDet->stereoDet();
1402  std::pair<LocalPoint,LocalVector> hitPair;
1403  for(vector<PSimHit>::const_iterator m=matched.begin(); m<matched.end(); m++){
1404  //project simhit;
1405  hitPair= projectHit((*m),partnerstripdet,gluedDet->surface());
1406  distx = fabs(rechitmatchedx - hitPair.first.x());
1407  disty = fabs(rechitmatchedy - hitPair.first.y());
1408  dist = distx*distx+disty*disty;
1409  if(sqrt(dist)<mindist){
1410  mindist = dist;
1411  closestPair = hitPair;
1412  }
1413  }
1414  rechitmatchedresx = rechitmatchedx - closestPair.first.x();
1415  rechitmatchedresy = rechitmatchedy - closestPair.first.y();
1416  rechitmatchedpullx = ((thit)->localPosition().x() - (closestPair.first.x()))/sqrt(error.xx());
1417  rechitmatchedpully = ((thit)->localPosition().y() - (closestPair.first.y()))/sqrt(error.yy());
1418  }
1419  }
1420 
1421  //Filling Histograms for Matched hits
1422 
1423  if(isrechitmatched){
1424 
1425  if (detid.subdetId() == int(StripSubdetector::TIB)){
1426  TIBDetId tibid(myid);
1427  int Tibisrechitmatched = isrechitmatched;
1428  int ilay = tibid.layer() - 1; //for histogram filling
1429  if(Tibisrechitmatched>0){
1437 
1438  }
1439  }
1440 
1441  if (detid.subdetId() == int(StripSubdetector::TOB)){
1442  TOBDetId tobid(myid);
1443  int Tobisrechitmatched = isrechitmatched;
1444  int ilay = tobid.layer() - 1; //for histogram filling
1445  if(Tobisrechitmatched>0){
1454  }
1455  }
1456  if (detid.subdetId() == int(StripSubdetector::TID)){
1457  TIDDetId tidid(myid);
1458  int Tidisrechitmatched = isrechitmatched;
1459  int ilay = tidid.ring() - 1; //for histogram filling
1460  if(Tidisrechitmatched>0){
1469  }
1470  }
1471  if (detid.subdetId() == int(StripSubdetector::TEC)){
1472  TECDetId tecid(myid);
1473  int Tecisrechitmatched = isrechitmatched;
1474  int ilay = tecid.ring() - 1; //for histogram filling
1475  if(Tecisrechitmatched>0){
1484  }
1485  }
1486 
1487  }
1488 
1489 
1491  // simple hits from matched hits
1493  // Reset variables
1494 
1495  isrechitrphi = 0;
1496  isrechitsas = 0;
1497  rechitrphix =0;
1498  rechitrphierrxLF =0;
1499  rechitrphierrxMF =0;
1500  rechitrphiy =0;
1501  rechitrphiz =0;
1502  rechitsasx =0;
1503  rechitsaserrxLF =0;
1504  rechitsaserrxMF =0;
1505  rechitsasy =0;
1506  rechitsasz =0;
1507  clusizrphi =0;
1508  clusizsas =0;
1509  cluchgrphi =0;
1510  cluchgsas =0;
1511  rechitrphiresLF=-999.;
1512  rechitrphiresMF=-999.;
1513  rechitrphipullLF=-999.;
1514  rechitrphipullMF=-999.;
1520  rechitrphicategory =0;
1521  rechitrphithickness = 0.;
1522  rechitsasresLF=-999.;
1523  rechitsasresMF=-999.;
1524  rechitsaspullLF=-999.;
1525  rechitsaspullMF=-999.;
1528  rechitsasthickness = 0;
1529 
1530  GluedGeomDet * gdet;
1531  const GeomDetUnit * monodet;
1532  const SiStripRecHit2D *monohit;
1533  const StripGeomDetUnit * stripdet;
1534 
1535  if (matchedhit)
1536  {
1537  monohit=matchedhit->monoHit();
1538  // const GeomDetUnit * monodet=gdet->monoDet();
1539  gdet=(GluedGeomDet *)tracker2->idToDet(matchedhit->geographicalId());
1540  monodet=gdet->monoDet();
1541  GlobalVector gtrkdir=gdet->toGlobal(trackdirection);
1542  LocalVector monotkdir=monodet->toLocal(gtrkdir);
1543  // const GeomDetUnit * det = tracker.idToDetUnit(detid);
1544  //stripdet=(const StripGeomDetUnit*)(gdet);
1545  stripdet=(const StripGeomDetUnit*)(monodet);
1546  // const StripTopology &topol2=(StripTopology&)stripdet->topology();
1547 
1548  if(monotkdir.z()!=0){
1549  anglealpha = atan(monotkdir.x()/monotkdir.z())*180/TMath::Pi();
1550  anglebeta = atan(monotkdir.y()/monotkdir.z())*180/TMath::Pi();
1551  }
1552 
1553  if(monohit){
1554 
1555  const StripTopology &topol=(StripTopology&)stripdet->topology();
1556 
1557  position = monohit->localPosition();
1558  error = monohit->localPositionError();
1559  Mposition = topol.measurementPosition(position);
1560  Merror = topol.measurementError(position,error);
1561 
1562  LocalVector drift = stripcpe->driftDirection(stripdet);
1563  float thickness=stripdet->surface().bounds().thickness();
1564  rechitrphithickness = thickness;
1565 
1566  //cout<<"thickness = "<<thickness<<endl;
1567  float pitch = topol.localPitch(position);
1568  //cout<<"Valid:pitch = "<<pitch<<endl;
1569  float tanalpha = tan(anglealpha/57.3);
1570  //cout<<"Valid:tanalpha = "<<tanalpha<<endl;
1571  float tanalphaL = drift.x()/drift.z();
1572  //float tanalphaLbis = driftbis.x()/driftbis.z();
1573  //float tanalphaLter = driftter.x()/driftter.z();
1574  //cout<<"Validmonofrommatched:drift.x() = "<<drift.x()<<endl;
1575  //cout<<"Valid:drift.x() = "<<drift.x()<<endl;
1576  //cout<<"Valid:driftbis.x() = "<<driftbis.x()<<endl;
1577  //cout<<"Valid:driftter.x() = "<<driftter.x()<<endl;
1578  //cout<<"Valid:driftter.z() = "<<driftter.z()<<endl;
1579  //cout<<"Valid:tanalphaL = "<<tanalphaL<<endl;
1580  Wtrack = fabs((thickness/pitch)*tanalpha - (thickness/pitch)*tanalphaL);
1581  //cout<<"Valid1:Wtrack = "<<Wtrack<<endl;
1582  float SLorentz = 0.5*(thickness/pitch)*tanalphaL;
1583  //int nstrips = topol.nstrips();
1584  //clusterWidth = cluster->amplitudes().size();
1585  int Sp = int(position.x()/pitch+SLorentz+0.5*Wtrack);
1586  int Sm = int(position.x()/pitch+SLorentz-0.5*Wtrack);
1587  Wexp = 1+Sp-Sm;
1588  //cout<<"DebugLine22"<<endl;
1589 
1590  isrechitrphi = 1;
1591  //cout<<"DebugLine23"<<endl;
1592  // const edm::Ref<edm::DetSetVector<SiStripCluster>, SiStripCluster, edm::refhelper::FindForDetSetVector<SiStripCluster> > cluster=hit->cluster();
1593  SiStripRecHit2D::ClusterRef cluster=monohit->cluster();
1594  //SiStripRecHit1D::ClusterRef cluster=monohit->cluster();
1595  clusiz=0;
1596  totcharge=0;
1597  clusiz = cluster->amplitudes().size();
1598  // cout<<"clusiz = "<<clusiz<<endl;
1599  const std::vector<uint8_t> amplitudes=cluster->amplitudes();
1600  for(size_t ia=0; ia<amplitudes.size();ia++){
1601  totcharge+=amplitudes[ia];
1602  }
1603  rechitrphix = position.x();
1604  rechitrphiy = position.y();
1605  rechitrphiz = position.z();
1606  rechitrphierrxLF = error.xx();
1607  rechitrphierrxMF = Merror.uu();
1608  // cout<<"rechitrphierrxMF from Matched hit= "<<sqrt(rechitrphierrxMF)<<endl;
1609  clusizrphi = clusiz;
1610  cluchgrphi = totcharge;
1611 
1612  //Association of the rechit to the simhit
1613  mindist = 999999;
1614  matched.clear();
1615  // matched = associate.associateHit(*hit);
1616  matched = associate.associateHit(*monohit);
1617  if(!matched.empty()){
1618  // cout << "\t\t\tmatched " << matched.size() << endl;
1619  // cout<<"associatesimplehit"<<endl;
1620  for(vector<PSimHit>::const_iterator m=matched.begin(); m<matched.end(); m++){
1621  dist = abs((monohit)->localPosition().x() - (*m).localPosition().x());
1622  if(dist<mindist){
1623  mindist = dist;
1624  closest = (*m);
1625  }
1626  rechitrphiresLF = rechitrphix - closest.localPosition().x();
1627  rechitrphiresMF = Mposition.x() - (topol.measurementPosition(closest.localPosition())).x();
1630  //cout<<"rechitrphiresMF == "<<rechitrphiresMF<<endl;
1631  //cout<<"rechitrphierrxMF == "<<rechitrphierrxMF<<endl;
1632  //cout<<"rechitrphierrxLF == "<<rechitrphierrxLF<<endl;
1633  //cout<<"rechitrphipullMF == "<<rechitrphipullMF<<endl;
1634 
1635  }
1636  }
1637  rechitrphitrackangle = anglealpha;
1638  rechitrphitrackanglebeta = anglebeta;
1639  //rechitrphitrackangle = tanalphaL;
1640  //cout<<"Wtrack = "<<Wtrack<<endl;
1641  rechitrphitrackwidth = Wtrack;
1642  rechitrphiexpectedwidth = Wexp;
1643  clusterWidth = clusiz;
1644  unsigned int iopt;
1645  if (clusterWidth > Wexp + 2) {
1646  iopt = 1;
1647  } else if (Wexp == 1) {
1648  iopt = 2;
1649  } else if (clusterWidth <= Wexp) {
1650  iopt = 3;
1651  } else {
1652  iopt = 4;
1653  }
1654  rechitrphicategory = iopt;
1655  }
1656 
1657 
1658  const SiStripRecHit2D *stereohit;
1659  stereohit=matchedhit->stereoHit();
1660  const GeomDetUnit * stereodet=gdet->stereoDet();
1661  // GlobalVector
1662  gtrkdir=gdet->toGlobal(trackdirection);
1663  LocalVector stereotkdir=stereodet->toLocal(gtrkdir);
1664  if(stereotkdir.z()!=0){
1665  anglealpha = atan(stereotkdir.x()/stereotkdir.z())*180/TMath::Pi();
1666  anglebeta = atan(stereotkdir.y()/stereotkdir.z())*180/TMath::Pi();
1667  }
1668 
1669  if (stereohit)
1670  {
1671  // cout<<"stereohit from matched hit"<<endl;
1672  isrechitsas = 1;
1673  SiStripRecHit2D::ClusterRef cluster=stereohit->cluster();
1674 
1675  // const GeomDetUnit * det = tracker.idToDetUnit(detid2);
1676  const StripGeomDetUnit * stripdet=(const StripGeomDetUnit*)(stereodet);
1677  const StripTopology &topol=(StripTopology&)stripdet->topology();
1678 
1679  position = stereohit->localPosition();
1680  // Mposition = topol.measurementPosition(position);
1681  error = stereohit->localPositionError();
1682  Mposition = topol.measurementPosition(position);
1683  Merror = topol.measurementError(position,error);
1684 
1685  //LocalVector drift= driftDirection(stripdet);
1686  LocalVector drift = stripcpe->driftDirection(stripdet);
1687  float thickness=stripdet->surface().bounds().thickness();
1688  rechitsasthickness = thickness;
1689  //cout<<"thickness = "<<thickness<<endl;
1690  float pitch = topol.localPitch(position);
1691  //cout<<"Valid:pitch = "<<pitch<<endl;
1692  float tanalpha = tan(anglealpha/57.3);
1693  //cout<<"Valid:tanalpha = "<<tanalpha<<endl;
1694  float tanalphaL = drift.x()/drift.z();
1695  //cout<<"Validstereofrommatched:drift.x() = "<<drift.x()<<endl;
1696  //cout<<"Valid:drift.z() = "<<drift.z()<<endl;
1697  //cout<<"Valid:tanalphaL = "<<tanalphaL<<endl;
1698  Wtrack = fabs((thickness/pitch)*tanalpha - (thickness/pitch)*tanalphaL);
1699  //cout<<"Valid:Wtrack = "<<Wtrack<<endl;
1700  float SLorentz = 0.5*(thickness/pitch)*tanalphaL;
1701  //int nstrips = topol.nstrips();
1702  int Sp = int(position.x()/pitch+SLorentz+0.5*Wtrack);
1703  int Sm = int(position.x()/pitch+SLorentz-0.5*Wtrack);
1704  Wexp = 1+Sp-Sm;
1705 
1706 
1707  clusiz=0;
1708  totcharge=0;
1709  clusiz = cluster->amplitudes().size();
1710  const std::vector<uint8_t> amplitudes=cluster->amplitudes();
1711  for(size_t ia=0; ia<amplitudes.size();ia++){
1712  totcharge+=amplitudes[ia];
1713  }
1714  rechitsasx = position.x();
1715  rechitsasy = position.y();
1716  rechitsasz = position.z();
1717  rechitsaserrxLF = error.xx();
1718  // cout<<"rechitsaserrxLF = "<<rechitsaserrxLF<<endl;
1719  rechitsaserrxMF = Merror.uu();
1720  // cout<<"rechitsaserrxMF from Matched hit = "<<sqrt(rechitsaserrxMF)<<endl;
1721  clusizsas = clusiz;
1722  cluchgsas = totcharge;
1723 
1724  //Association of the rechit to the simhit
1725  mindist = 999999;
1726  matched.clear();
1727  matched = associate.associateHit(*stereohit);
1728  if(!matched.empty()){
1729  // cout << "\t\t\tmatched " << matched.size() << endl;
1730  for(vector<PSimHit>::const_iterator m=matched.begin(); m<matched.end(); m++){
1731  dist = abs((stereohit)->localPosition().x() - (*m).localPosition().x());
1732  if(dist<mindist){
1733  mindist = dist;
1734  closest = (*m);
1735  }
1736 
1737  rechitsasresLF = rechitsasx - closest.localPosition().x();
1738  rechitsasresMF = Mposition.x() - (topol.measurementPosition(closest.localPosition())).x();
1741 
1742 // cout<<"rechitsasresMF == "<<rechitsasresMF<<endl;
1743 // cout<<"rechitsaserrxMF == "<<rechitsaserrxMF<<endl;
1744 // cout<<"rechitsaserrxLF == "<<rechitsaserrxLF<<endl;
1745 // cout<<"rechitsaspullMF == "<<rechitsaspullMF<<endl;
1746 
1747  }
1748  }
1749  rechitsastrackangle = anglealpha;
1750  rechitsastrackanglebeta = anglebeta;
1751  rechitsastrackwidth = Wtrack;
1752  rechitsasexpectedwidth = Wexp;
1753 
1754  clusterWidth = clusiz;
1755  unsigned int iopt;
1756  if (clusterWidth > Wexp + 2) {
1757  iopt = 1;
1758  } else if (Wexp == 1) {
1759  iopt = 2;
1760  } else if (clusterWidth <= Wexp) {
1761  iopt = 3;
1762  } else {
1763  iopt = 4;
1764  }
1765  rechitsascategory = iopt;
1766  }
1767  }
1768 
1769 
1770  // A VIRER !!!!!!!!!!!!!!!!!!!!
1771 
1772  // isrechitrphi = 0;
1773  //isrechitsas = 0;
1774 
1775 
1776  if(hit1d){
1777  // simple hits are mono or stereo
1778  // cout<<"simple hit"<<endl;
1779  if (StripSubdet.stereo() == 0){
1780  isrechitrphi = 1;
1781  // cout<<"simple hit mono"<<endl;
1782 
1783  const GeomDetUnit * det = tracker.idToDetUnit(detid2);
1784  const StripGeomDetUnit * stripdet=(const StripGeomDetUnit*)(det);
1785  const StripTopology &topol=(StripTopology&)stripdet->topology();
1786 
1787  float anglealpha = atan(trackdirection.x()/trackdirection.z())*180/TMath::Pi();
1788  float anglebeta = atan(trackdirection.y()/trackdirection.z())*180/TMath::Pi();
1789 
1790  //SiStripRecHit2D::ClusterRef cluster=hit->cluster();
1791  SiStripRecHit1D::ClusterRef cluster=hit1d->cluster();
1792 
1793  position = thit->localPosition();
1794  error = thit->localPositionError();
1795  Mposition = topol.measurementPosition(position);
1796  Merror = topol.measurementError(position,error);
1797 
1798  LocalVector drift = stripcpe->driftDirection(stripdet);
1799  float thickness=stripdet->surface().bounds().thickness();
1800  rechitrphithickness = thickness;
1801  //cout<<"Valid:thickness = "<<thickness<<endl;
1802  float pitch = topol.localPitch(position);
1803  //cout<<"Valid:pitch = "<<pitch<<endl;
1804  float tanalpha = tan(anglealpha/57.3);
1805  //cout<<"Valid:tanalpha = "<<tanalpha<<endl;
1806  float tanalphaL = drift.x()/drift.z();
1807  //cout<<"Valid:tanalphaL = "<<tanalphaL<<endl;
1808  // float tanalphaLcpe = driftcpe.x()/driftcpe.z();
1809  //cout<<"Valid:tanalphaLcpe = "<<tanalphaLcpe<<endl;
1810  //cout<<"Validmono:drift.x() = "<<drift.x()<<endl;
1811  //cout<<"Valid:drift.z() = "<<drift.z()<<endl;
1812  //cout<<"Valid:tanalphaL = "<<tanalphaL<<endl;
1813  Wtrack = fabs((thickness/pitch)*tanalpha - (thickness/pitch)*tanalphaL);
1814  // fabs((thickness/pitch)*tanalpha - (thickness/pitch)*tanalphaL);
1815  //cout<<"Valid2:Wtrack = "<<Wtrack<<endl;
1816  float SLorentz = 0.5*(thickness/pitch)*tanalphaL;
1817  //int nstrips = topol.nstrips();
1818  int Sp = int(position.x()/pitch+SLorentz+0.5*Wtrack);
1819  int Sm = int(position.x()/pitch+SLorentz-0.5*Wtrack);
1820  Wexp = 1+Sp-Sm;
1821 
1822  clusiz=0;
1823  totcharge=0;
1824  clusiz = cluster->amplitudes().size();
1825  //cout<<"cluster->firstStrip() = "<<cluster->firstStrip()<<endl;
1826  const std::vector<uint8_t> amplitudes=cluster->amplitudes();
1827  for(size_t ia=0; ia<amplitudes.size();ia++){
1828  totcharge+=amplitudes[ia];
1829  }
1830  rechitrphix = position.x();
1831  rechitrphiy = position.y();
1832  rechitrphiz = position.z();
1833  rechitrphierrx = error.xx();
1834  rechitrphierrxLF = error.xx();
1835  rechitrphierrxMF = Merror.uu();
1836  //cout<<"rechitrphierrxMF simple hit= "<<sqrt(rechitrphierrxMF)<<endl;
1837  clusizrphi = clusiz;
1838  //cout<<"clusizrphi = "<<clusiz<<endl;
1839  cluchgrphi = totcharge;
1840 
1841  //Association of the rechit to the simhit
1842  mindist = 999999;
1843  matched.clear();
1844  matched = associate.associateHit(*hit1d);
1845  if(!matched.empty()){
1846  // cout << "\t\t\tmatched " << matched.size() << endl;
1847  for(vector<PSimHit>::const_iterator m=matched.begin(); m<matched.end(); m++){
1848  dist = abs((hit1d)->localPosition().x() - (*m).localPosition().x());
1849  if(dist<mindist){
1850  mindist = dist;
1851  closest = (*m);
1852  }
1853  rechitrphiresLF = rechitrphix - closest.localPosition().x();
1854  rechitrphiresMF = Mposition.x() - (topol.measurementPosition(closest.localPosition())).x();
1855  rechitrphipullLF = (thit->localPosition().x() - (closest).localPosition().x())/sqrt(error.xx());
1857  }
1858  }
1859  rechitrphitrackangle = anglealpha;
1860  rechitrphitrackanglebeta = anglebeta;
1861  rechitrphitrackwidth = Wtrack;
1862  rechitrphiexpectedwidth = Wexp;
1863 
1864  clusterWidth = clusiz;
1865  unsigned int iopt;
1866  if (clusterWidth > Wexp + 2) {
1867  iopt = 1;
1868  } else if (Wexp == 1) {
1869  iopt = 2;
1870  } else if (clusterWidth <= Wexp) {
1871  iopt = 3;
1872  } else {
1873  iopt = 4;
1874  }
1875  rechitrphicategory = iopt;
1876 
1877 // if (rechitrphiexpectedwidth == 1 && clusterWidth == 3) {
1878 // //if ( clusterWidth == 3) {
1879 // cout<<"TRUE"<<endl;
1880 // cout<<"TestClus2:Position SH = "<<(closest).localPosition().x()<<" , "<<(topol.measurementPosition(closest.localPosition())).x()<<endl;
1881 // cout<<"TestClus2:Position RH = "<<thit->localPosition().x()<<" ,"<<Mposition.x()<<endl;
1882 // cout<<"TestClus2:residue = "<<rechitrphiresMF<<endl;
1883 // short firstStrip = cluster->firstStrip();
1884 // short lastStrip = firstStrip + clusterWidth - 1;
1885 // cout<<"TestClus2:firstStrip = "<<firstStrip<<endl;
1886 // cout<<"TestClus2:lastStrip = "<<lastStrip<<endl;
1887 // cout<<"TestClus2:detid = "<<detid.subdetId()<<endl;
1888 // for(size_t ia=0; ia<amplitudes.size();ia++){
1889 // cout<<"ia, TestClus2:charge= "<<ia<<" , "<<amplitudes[ia]<<endl;
1890 // }
1891 // cout<<"TestClus2:Trackwidth = "<<Wtrack<<endl;
1892 // }
1893 
1894 
1895  //cout<<"rechitrphicategory = "<<rechitrphicategory<<endl;
1896 
1897  // if ((detid.subdetId() == int(StripSubdetector::TID)) || (detid.subdetId() == int(StripSubdetector::TEC))) {
1898  //if ((detid.subdetId() == int(StripSubdetector::TIB))) {
1899 
1900 // if (clusterWidth ==2 && Wexp == 1 && Wtrack<0.1) {
1901 // cout<<"TestClus:begin"<<endl;
1902 // LocalVector drift2 = drift * fabs(thickness/drift.z());
1903 // LocalPoint result2=LocalPoint(position.x()-drift2.x()/2,position.y()-drift2.y()/2,0);
1904 // MeasurementPoint mpoint=topol.measurementPosition(result2);
1905 // cout<<"TestClus:Position SH = "<<(closest).localPosition().x()<<" , "<<(topol.measurementPosition(closest.localPosition())).x()<<endl;
1906 // cout<<"TestClus:Position RH = "<<thit->localPosition().x()<<" ,"<<Mposition.x()<<endl;
1907 // cout<<"TestClus:Position RH no drift= "<<thit->localPosition().x() - drift2.x()/2<<" , "<<mpoint.x()<<endl;
1908 // cout<<"TestClus:Drift= "<<drift.x()<<endl;
1909 // cout<<"TestClus:residue = "<<rechitrphiresMF<<endl;
1910 // for(size_t ia=0; ia<amplitudes.size();ia++){
1911 // cout<<"ia, TestClus:charge= "<<ia<<" , "<<amplitudes[ia]<<endl;
1912 // }
1913 // cout<<"TestClus:Trackwidth = "<<Wtrack<<endl;
1914 // short firstStrip = cluster->firstStrip();
1915 // short lastStrip = firstStrip + clusterWidth - 1;
1916 // cout<<"TestClus:firstStrip = "<<firstStrip<<endl;
1917 // cout<<"TestClus:lastStrip = "<<lastStrip<<endl;
1918 // cout<<"TestClus:detid = "<<detid.subdetId()<<endl;
1919 // int nstrips = topol.nstrips();
1920 // cout<<"TestClus:nstrips = "<<nstrips<<endl;
1921 // cout<<"TestClus:anglealpha = "<<anglealpha<<endl;
1922 // cout<<"TestClus:end"<<endl;
1923 // positionshx = (topol.measurementPosition(closest.localPosition())).x();
1924 
1925 // if ((positionshx - int(positionshx)) > 0.5) {
1926 // if (lastStrip > int(positionshx)) secondstrip = 1;
1927 // if (lastStrip = int(positionshx)) secondstrip = -1;
1928 // }
1929 // if ((positionshx - int(positionshx)) < 0.5) {
1930 // if (lastStrip > int(positionshx)) secondstrip = -1;
1931 // if (lastStrip = int(positionshx)) secondstrip = 1;
1932 // }
1933 
1934 // }
1935 
1936  //}
1937 
1938 // cout<<"int() = "<<int((topol.measurementPosition(closest.localPosition())).x())<<endl;
1939 // diff = int((topol.measurementPosition(closest.localPosition())).x()) -topol.measurementPosition(closest.localPosition()).x();
1940 // cout<<"diff = "<<diff<<endl;
1941 // if (clusterWidth ==2 && Wexp == 1 && Wtrack<1) {
1942 // if ((abs(1 + diff) <0.2) || (abs(diff) <0.2)) {
1943 // // isrechitrphi = 0;
1944 // cout<<"vire"<<endl;
1945 // }
1946 // }
1947 // positionshx = (topol.measurementPosition(closest.localPosition())).x();
1948 
1949 
1950  }
1951 
1952  if (StripSubdet.stereo() == 1){
1953 
1954  //cout<<"simple hit stereo"<<endl;
1955  isrechitsas = 1;
1956 
1957  const GeomDetUnit * det = tracker.idToDetUnit(detid2);
1958  const StripGeomDetUnit * stripdet=(const StripGeomDetUnit*)(det);
1959  const StripTopology &topol=(StripTopology&)stripdet->topology();
1960 
1961  float anglealpha = atan(trackdirection.x()/trackdirection.z())*180/TMath::Pi();
1962  float anglebeta = atan(trackdirection.y()/trackdirection.z())*180/TMath::Pi();
1963 
1964  //SiStripRecHit2D::ClusterRef cluster=hit->cluster();
1965  SiStripRecHit1D::ClusterRef cluster=hit1d->cluster();
1966 
1967 
1968  position = thit->localPosition();
1969  error = thit->localPositionError();
1970  Mposition = topol.measurementPosition(position);
1971  Merror = topol.measurementError(position,error);
1972 
1973  // LocalVector drift= driftDirection(stripdet);
1974  LocalVector drift = stripcpe->driftDirection(stripdet);
1975  float thickness=stripdet->surface().bounds().thickness();
1976  rechitsasthickness = thickness;
1977  //cout<<"thickness = "<<thickness<<endl;
1978  float pitch = topol.localPitch(position);
1979  //cout<<"Valid:pitch = "<<pitch<<endl;
1980  float tanalpha = tan(anglealpha/57.3);
1981  //cout<<"Valid:tanalpha = "<<tanalpha<<endl;
1982  float tanalphaL = drift.x()/drift.z();
1983  //cout<<"Validstereo:drift.x() = "<<drift.x()<<endl;
1984  //cout<<"Valid:drift.z() = "<<drift.z()<<endl;
1985  //cout<<"Valid:tanalphaL = "<<tanalphaL<<endl;
1986  Wtrack = fabs((thickness/pitch)*tanalpha - (thickness/pitch)*tanalphaL);
1987  //cout<<"Valid:Wtrack = "<<Wtrack<<endl;
1988  float SLorentz = 0.5*(thickness/pitch)*tanalphaL;
1989  //int nstrips = topol.nstrips();
1990  int Sp = int(position.x()/pitch+SLorentz+0.5*Wtrack);
1991  int Sm = int(position.x()/pitch+SLorentz-0.5*Wtrack);
1992  Wexp = 1+Sp-Sm;
1993 
1994  clusiz=0;
1995  totcharge=0;
1996  clusiz = cluster->amplitudes().size();
1997  const std::vector<uint8_t> amplitudes=cluster->amplitudes();
1998  for(size_t ia=0; ia<amplitudes.size();ia++){
1999  totcharge+=amplitudes[ia];
2000  }
2001  rechitsasx = position.x();
2002  rechitsasy = position.y();
2003  rechitsasz = position.z();
2004  rechitsaserrxLF = error.xx();
2005  //cout<<"rechitsaserrxLF = "<<rechitsaserrxLF<<endl;
2006  rechitsaserrxMF = Merror.uu();
2007  //cout<<"rechitsaserrxMF simple hit= "<<sqrt(rechitsaserrxMF)<<endl;
2008  clusizsas = clusiz;
2009  cluchgsas = totcharge;
2010 
2011  //Association of the rechit to the simhit
2012  mindist = 999999;
2013  matched.clear();
2014  matched = associate.associateHit(*hit1d);
2015  if(!matched.empty()){
2016  // cout << "\t\t\tmatched " << matched.size() << endl;
2017  for(vector<PSimHit>::const_iterator m=matched.begin(); m<matched.end(); m++){
2018  dist = abs((hit1d)->localPosition().x() - (*m).localPosition().x());
2019  if(dist<mindist){
2020  mindist = dist;
2021  closest = (*m);
2022  }
2023 
2024  rechitsasresLF = rechitsasx - closest.localPosition().x();
2025  rechitsasresMF = Mposition.x() - (topol.measurementPosition(closest.localPosition())).x();
2026  rechitsaspullLF = (thit->localPosition().x() - (closest).localPosition().x())/sqrt(error.xx());
2028 
2029  }
2030  }
2031  rechitsastrackangle = anglealpha;
2032  rechitsastrackanglebeta = anglebeta;
2033  rechitsastrackwidth = Wtrack;
2034  rechitsasexpectedwidth = Wexp;
2035 
2036  clusterWidth = clusiz;
2037  unsigned int iopt;
2038  if (clusterWidth > Wexp + 2) {
2039  iopt = 1;
2040  } else if (Wexp == 1) {
2041  iopt = 2;
2042  } else if (clusterWidth <= Wexp) {
2043  iopt = 3;
2044  } else {
2045  iopt = 4;
2046  }
2047  rechitsascategory = iopt;
2048  }
2049  //isrechitsas = 0;
2050  }
2051 
2052 
2053  if(hit2d){
2054  // simple hits are mono or stereo
2055  // cout<<"simple hit"<<endl;
2056  if (StripSubdet.stereo() == 0){
2057  isrechitrphi = 1;
2058  // cout<<"simple hit mono"<<endl;
2059 
2060  const GeomDetUnit * det = tracker.idToDetUnit(detid2);
2061  const StripGeomDetUnit * stripdet=(const StripGeomDetUnit*)(det);
2062  const StripTopology &topol=(StripTopology&)stripdet->topology();
2063 
2064  float anglealpha = atan(trackdirection.x()/trackdirection.z())*180/TMath::Pi();
2065  float anglebeta = atan(trackdirection.y()/trackdirection.z())*180/TMath::Pi();
2066 
2067  SiStripRecHit2D::ClusterRef cluster=hit2d->cluster();
2068 
2069  position = thit->localPosition();
2070  error = thit->localPositionError();
2071  Mposition = topol.measurementPosition(position);
2072  Merror = topol.measurementError(position,error);
2073 
2074  LocalVector drift = stripcpe->driftDirection(stripdet);
2075  float thickness=stripdet->surface().bounds().thickness();
2076  rechitrphithickness = thickness;
2077  //cout<<"Valid:thickness = "<<thickness<<endl;
2078  float pitch = topol.localPitch(position);
2079  //cout<<"Valid:pitch = "<<pitch<<endl;
2080  float tanalpha = tan(anglealpha/57.3);
2081  //cout<<"Valid:tanalpha = "<<tanalpha<<endl;
2082  float tanalphaL = drift.x()/drift.z();
2083  //cout<<"Valid:tanalphaL = "<<tanalphaL<<endl;
2084  // float tanalphaLcpe = driftcpe.x()/driftcpe.z();
2085  //cout<<"Valid:tanalphaLcpe = "<<tanalphaLcpe<<endl;
2086  //cout<<"Validmono:drift.x() = "<<drift.x()<<endl;
2087  //cout<<"Valid:drift.z() = "<<drift.z()<<endl;
2088  //cout<<"Valid:tanalphaL = "<<tanalphaL<<endl;
2089  Wtrack = fabs((thickness/pitch)*tanalpha - (thickness/pitch)*tanalphaL);
2090  // fabs((thickness/pitch)*tanalpha - (thickness/pitch)*tanalphaL);
2091  //cout<<"Valid2:Wtrack = "<<Wtrack<<endl;
2092  float SLorentz = 0.5*(thickness/pitch)*tanalphaL;
2093  //int nstrips = topol.nstrips();
2094  int Sp = int(position.x()/pitch+SLorentz+0.5*Wtrack);
2095  int Sm = int(position.x()/pitch+SLorentz-0.5*Wtrack);
2096  Wexp = 1+Sp-Sm;
2097 
2098  clusiz=0;
2099  totcharge=0;
2100  clusiz = cluster->amplitudes().size();
2101  //cout<<"cluster->firstStrip() = "<<cluster->firstStrip()<<endl;
2102  const std::vector<uint8_t> amplitudes=cluster->amplitudes();
2103  for(size_t ia=0; ia<amplitudes.size();ia++){
2104  totcharge+=amplitudes[ia];
2105  }
2106  rechitrphix = position.x();
2107  rechitrphiy = position.y();
2108  rechitrphiz = position.z();
2109  rechitrphierrx = error.xx();
2110  rechitrphierrxLF = error.xx();
2111  rechitrphierrxMF = Merror.uu();
2112  //cout<<"rechitrphierrxMF simple hit= "<<sqrt(rechitrphierrxMF)<<endl;
2113  clusizrphi = clusiz;
2114  //cout<<"clusizrphi = "<<clusiz<<endl;
2115  cluchgrphi = totcharge;
2116 
2117  //Association of the rechit to the simhit
2118  mindist = 999999;
2119  matched.clear();
2120  matched = associate.associateHit(*hit2d);
2121  if(!matched.empty()){
2122  // cout << "\t\t\tmatched " << matched.size() << endl;
2123  for(vector<PSimHit>::const_iterator m=matched.begin(); m<matched.end(); m++){
2124  dist = abs((hit2d)->localPosition().x() - (*m).localPosition().x());
2125  if(dist<mindist){
2126  mindist = dist;
2127  closest = (*m);
2128  }
2129  rechitrphiresLF = rechitrphix - closest.localPosition().x();
2130  rechitrphiresMF = Mposition.x() - (topol.measurementPosition(closest.localPosition())).x();
2131  rechitrphipullLF = (thit->localPosition().x() - (closest).localPosition().x())/sqrt(error.xx());
2133  }
2134  }
2135  rechitrphitrackangle = anglealpha;
2136  rechitrphitrackanglebeta = anglebeta;
2137  rechitrphitrackwidth = Wtrack;
2138  rechitrphiexpectedwidth = Wexp;
2139 
2140  clusterWidth = clusiz;
2141  unsigned int iopt;
2142  if (clusterWidth > Wexp + 2) {
2143  iopt = 1;
2144  } else if (Wexp == 1) {
2145  iopt = 2;
2146  } else if (clusterWidth <= Wexp) {
2147  iopt = 3;
2148  } else {
2149  iopt = 4;
2150  }
2151  rechitrphicategory = iopt;
2152 
2153 // if (rechitrphiexpectedwidth == 1 && clusterWidth == 3) {
2154 // //if ( clusterWidth == 3) {
2155 // cout<<"TRUE"<<endl;
2156 // cout<<"TestClus2:Position SH = "<<(closest).localPosition().x()<<" , "<<(topol.measurementPosition(closest.localPosition())).x()<<endl;
2157 // cout<<"TestClus2:Position RH = "<<thit->localPosition().x()<<" ,"<<Mposition.x()<<endl;
2158 // cout<<"TestClus2:residue = "<<rechitrphiresMF<<endl;
2159 // short firstStrip = cluster->firstStrip();
2160 // short lastStrip = firstStrip + clusterWidth - 1;
2161 // cout<<"TestClus2:firstStrip = "<<firstStrip<<endl;
2162 // cout<<"TestClus2:lastStrip = "<<lastStrip<<endl;
2163 // cout<<"TestClus2:detid = "<<detid.subdetId()<<endl;
2164 // for(size_t ia=0; ia<amplitudes.size();ia++){
2165 // cout<<"ia, TestClus2:charge= "<<ia<<" , "<<amplitudes[ia]<<endl;
2166 // }
2167 // cout<<"TestClus2:Trackwidth = "<<Wtrack<<endl;
2168 // }
2169 
2170 
2171  //cout<<"rechitrphicategory = "<<rechitrphicategory<<endl;
2172 
2173  // if ((detid.subdetId() == int(StripSubdetector::TID)) || (detid.subdetId() == int(StripSubdetector::TEC))) {
2174  //if ((detid.subdetId() == int(StripSubdetector::TIB))) {
2175 
2176 // if (clusterWidth ==2 && Wexp == 1 && Wtrack<0.1) {
2177 // cout<<"TestClus:begin"<<endl;
2178 // LocalVector drift2 = drift * fabs(thickness/drift.z());
2179 // LocalPoint result2=LocalPoint(position.x()-drift2.x()/2,position.y()-drift2.y()/2,0);
2180 // MeasurementPoint mpoint=topol.measurementPosition(result2);
2181 // cout<<"TestClus:Position SH = "<<(closest).localPosition().x()<<" , "<<(topol.measurementPosition(closest.localPosition())).x()<<endl;
2182 // cout<<"TestClus:Position RH = "<<thit->localPosition().x()<<" ,"<<Mposition.x()<<endl;
2183 // cout<<"TestClus:Position RH no drift= "<<thit->localPosition().x() - drift2.x()/2<<" , "<<mpoint.x()<<endl;
2184 // cout<<"TestClus:Drift= "<<drift.x()<<endl;
2185 // cout<<"TestClus:residue = "<<rechitrphiresMF<<endl;
2186 // for(size_t ia=0; ia<amplitudes.size();ia++){
2187 // cout<<"ia, TestClus:charge= "<<ia<<" , "<<amplitudes[ia]<<endl;
2188 // }
2189 // cout<<"TestClus:Trackwidth = "<<Wtrack<<endl;
2190 // short firstStrip = cluster->firstStrip();
2191 // short lastStrip = firstStrip + clusterWidth - 1;
2192 // cout<<"TestClus:firstStrip = "<<firstStrip<<endl;
2193 // cout<<"TestClus:lastStrip = "<<lastStrip<<endl;
2194 // cout<<"TestClus:detid = "<<detid.subdetId()<<endl;
2195 // int nstrips = topol.nstrips();
2196 // cout<<"TestClus:nstrips = "<<nstrips<<endl;
2197 // cout<<"TestClus:anglealpha = "<<anglealpha<<endl;
2198 // cout<<"TestClus:end"<<endl;
2199 // positionshx = (topol.measurementPosition(closest.localPosition())).x();
2200 
2201 // if ((positionshx - int(positionshx)) > 0.5) {
2202 // if (lastStrip > int(positionshx)) secondstrip = 1;
2203 // if (lastStrip = int(positionshx)) secondstrip = -1;
2204 // }
2205 // if ((positionshx - int(positionshx)) < 0.5) {
2206 // if (lastStrip > int(positionshx)) secondstrip = -1;
2207 // if (lastStrip = int(positionshx)) secondstrip = 1;
2208 // }
2209 
2210 // }
2211 
2212  //}
2213 
2214 // cout<<"int() = "<<int((topol.measurementPosition(closest.localPosition())).x())<<endl;
2215 // diff = int((topol.measurementPosition(closest.localPosition())).x()) -topol.measurementPosition(closest.localPosition()).x();
2216 // cout<<"diff = "<<diff<<endl;
2217 // if (clusterWidth ==2 && Wexp == 1 && Wtrack<1) {
2218 // if ((abs(1 + diff) <0.2) || (abs(diff) <0.2)) {
2219 // // isrechitrphi = 0;
2220 // cout<<"vire"<<endl;
2221 // }
2222 // }
2223 // positionshx = (topol.measurementPosition(closest.localPosition())).x();
2224 
2225 
2226  }
2227 
2228  if (StripSubdet.stereo() == 1){
2229 
2230  //cout<<"simple hit stereo"<<endl;
2231  isrechitsas = 1;
2232 
2233  const GeomDetUnit * det = tracker.idToDetUnit(detid2);
2234  const StripGeomDetUnit * stripdet=(const StripGeomDetUnit*)(det);
2235  const StripTopology &topol=(StripTopology&)stripdet->topology();
2236 
2237  float anglealpha = atan(trackdirection.x()/trackdirection.z())*180/TMath::Pi();
2238  float anglebeta = atan(trackdirection.y()/trackdirection.z())*180/TMath::Pi();
2239 
2240  SiStripRecHit2D::ClusterRef cluster=hit2d->cluster();
2241 
2242 
2243  position = thit->localPosition();
2244  error = thit->localPositionError();
2245  Mposition = topol.measurementPosition(position);
2246  Merror = topol.measurementError(position,error);
2247 
2248  // LocalVector drift= driftDirection(stripdet);
2249  LocalVector drift = stripcpe->driftDirection(stripdet);
2250  float thickness=stripdet->surface().bounds().thickness();
2251  rechitsasthickness = thickness;
2252  //cout<<"thickness = "<<thickness<<endl;
2253  float pitch = topol.localPitch(position);
2254  //cout<<"Valid:pitch = "<<pitch<<endl;
2255  float tanalpha = tan(anglealpha/57.3);
2256  //cout<<"Valid:tanalpha = "<<tanalpha<<endl;
2257  float tanalphaL = drift.x()/drift.z();
2258  //cout<<"Validstereo:drift.x() = "<<drift.x()<<endl;
2259  //cout<<"Valid:drift.z() = "<<drift.z()<<endl;
2260  //cout<<"Valid:tanalphaL = "<<tanalphaL<<endl;
2261  Wtrack = fabs((thickness/pitch)*tanalpha - (thickness/pitch)*tanalphaL);
2262  //cout<<"Valid:Wtrack = "<<Wtrack<<endl;
2263  float SLorentz = 0.5*(thickness/pitch)*tanalphaL;
2264  //int nstrips = topol.nstrips();
2265  int Sp = int(position.x()/pitch+SLorentz+0.5*Wtrack);
2266  int Sm = int(position.x()/pitch+SLorentz-0.5*Wtrack);
2267  Wexp = 1+Sp-Sm;
2268 
2269  clusiz=0;
2270  totcharge=0;
2271  clusiz = cluster->amplitudes().size();
2272  const std::vector<uint8_t> amplitudes=cluster->amplitudes();
2273  for(size_t ia=0; ia<amplitudes.size();ia++){
2274  totcharge+=amplitudes[ia];
2275  }
2276  rechitsasx = position.x();
2277  rechitsasy = position.y();
2278  rechitsasz = position.z();
2279  rechitsaserrxLF = error.xx();
2280  //cout<<"rechitsaserrxLF = "<<rechitsaserrxLF<<endl;
2281  rechitsaserrxMF = Merror.uu();
2282  //cout<<"rechitsaserrxMF simple hit= "<<sqrt(rechitsaserrxMF)<<endl;
2283  clusizsas = clusiz;
2284  cluchgsas = totcharge;
2285 
2286  //Association of the rechit to the simhit
2287  mindist = 999999;
2288  matched.clear();
2289  matched = associate.associateHit(*hit2d);
2290  if(!matched.empty()){
2291  // cout << "\t\t\tmatched " << matched.size() << endl;
2292  for(vector<PSimHit>::const_iterator m=matched.begin(); m<matched.end(); m++){
2293  dist = abs((hit2d)->localPosition().x() - (*m).localPosition().x());
2294  if(dist<mindist){
2295  mindist = dist;
2296  closest = (*m);
2297  }
2298 
2299  rechitsasresLF = rechitsasx - closest.localPosition().x();
2300  rechitsasresMF = Mposition.x() - (topol.measurementPosition(closest.localPosition())).x();
2301  rechitsaspullLF = (thit->localPosition().x() - (closest).localPosition().x())/sqrt(error.xx());
2303 
2304  }
2305  }
2306  rechitsastrackangle = anglealpha;
2307  rechitsastrackanglebeta = anglebeta;
2308  rechitsastrackwidth = Wtrack;
2309  rechitsasexpectedwidth = Wexp;
2310 
2311  clusterWidth = clusiz;
2312  unsigned int iopt;
2313  if (clusterWidth > Wexp + 2) {
2314  iopt = 1;
2315  } else if (Wexp == 1) {
2316  iopt = 2;
2317  } else if (clusterWidth <= Wexp) {
2318  iopt = 3;
2319  } else {
2320  iopt = 4;
2321  }
2322  rechitsascategory = iopt;
2323  }
2324  //isrechitsas = 0;
2325 
2326  }
2327 
2328  //Filling Histograms for simple hits
2329  //cout<<"isrechitrphi,isrechitsas = "<<isrechitrphi<<","<<isrechitsas<<endl;
2330 
2331  float CutThickness=0.04;
2332  CutThickness=0.;
2333 
2334  if(isrechitrphi>0 || isrechitsas>0){
2335 
2336 
2337  if (isrechitrphi>0) {
2338 
2339  //cout<<"rechitrphitrackwidth,rechitrphipullMF = "<<rechitrphitrackwidth<<" "<<rechitrphipullMF<<endl;
2340  /*
2341  if (rechitrphithickness > CutThickness)
2342  {
2343  PullvsTrackwidth->Fill(rechitrphitrackwidth,rechitrphipullMF);
2344 
2345  if (clusizrphi ==2 && rechitrphiexpectedwidth == 1 && rechitrphitrackwidth<0.1) {
2346  //Diff->Fill(-diff);
2347 
2348  // if ((detid.subdetId() == int(StripSubdetector::TID)) || (detid.subdetId() == int(StripSubdetector::TEC))) {
2349  //SecondStrip->Fill(secondstrip);
2350  // }
2351  }
2352  // Diff->Fill(-diff);
2353 
2354  //PositionSHx->Fill(positionshx);
2355 
2356  // ErrxMF->Fill(sqrt(rechitrphierrxMF));
2357  //cout<<"ICI1:rechitrphitrackwidth = "<<rechitrphitrackwidth<<endl;
2358  //ErrxMFvsTrackwidth->Fill(rechitrphitrackwidth,sqrt(rechitrphierrxMF));
2359  ResMFvsTrackwidth->Fill(rechitrphitrackwidth,rechitrphiresMF);
2360 
2361  PullvsClusterwidth->Fill(clusizrphi,rechitrphipullMF);
2362  PullvsExpectedwidth->Fill(rechitrphiexpectedwidth,rechitrphipullMF);
2363  PullvsTrackangle->Fill(rechitrphitrackangle,rechitrphipullMF);
2364  PullvsTrackanglebeta->Fill(rechitrphitrackanglebeta,rechitrphipullMF);
2365 
2366  }
2367  */
2368 
2375 
2378 
2379  if (clusizrphi == 1) {
2382  if (rechitrphithickness > CutThickness)
2383  {
2384  //if ((detid.subdetId() == int(StripSubdetector::TIB)) || (detid.subdetId() == int(StripSubdetector::TOB)))
2385  //{
2386  /*
2387  ResMFvsTrackwidthWClus1->Fill(rechitrphitrackwidth,rechitrphiresMF);
2388  if (rechitrphiexpectedwidth==1) ResMFvsTrackwidthWClus1Wexp1->Fill(rechitrphitrackwidth,rechitrphiresMF);
2389  if (rechitrphiexpectedwidth==2) ResMFvsTrackwidthWClus1Wexp2->Fill(rechitrphitrackwidth,rechitrphiresMF);
2390  if (rechitrphiexpectedwidth==3) ResMFvsTrackwidthWClus1Wexp3->Fill(rechitrphitrackwidth,rechitrphiresMF);
2391  if (rechitrphiexpectedwidth==4) ResMFvsTrackwidthWClus1Wexp4->Fill(rechitrphitrackwidth,rechitrphiresMF);
2392  ErrxMFvsTrackwidthWClus1->Fill(rechitrphitrackwidth,sqrt(rechitrphierrxMF));
2393  */
2394  //}
2395  }
2396  }
2397  if (clusizrphi == 2) {
2403  if (rechitrphithickness > CutThickness)
2404  {
2405  // if ((detid.subdetId() == int(StripSubdetector::TIB)) || (detid.subdetId() == int(StripSubdetector::TOB)))
2406  //{
2407  if ((detid.subdetId() == int(StripSubdetector::TID)) || (detid.subdetId() == int(StripSubdetector::TEC))){
2408  /* ResMFvsTrackwidthWClus2->Fill(rechitrphitrackwidth,rechitrphiresMF);
2409  if (rechitrphiexpectedwidth==1) ResMFvsTrackwidthWClus2Wexp1->Fill(rechitrphitrackwidth,rechitrphiresMF);
2410  if (rechitrphiexpectedwidth==2) ResMFvsTrackwidthWClus2Wexp2->Fill(rechitrphitrackwidth,rechitrphiresMF);
2411  if (rechitrphiexpectedwidth==3) ResMFvsTrackwidthWClus2Wexp3->Fill(rechitrphitrackwidth,rechitrphiresMF);
2412  if (rechitrphiexpectedwidth==4) ResMFvsTrackwidthWClus2Wexp4->Fill(rechitrphitrackwidth,rechitrphiresMF);*/
2413  }
2414  // meResMFTrackwidthProfileWClus22->Fill(rechitrphitrackwidth,rechitrphiresMF);
2415  //cout<<"ICI2:rechitrphitrackwidth = "<<rechitrphitrackwidth<<endl;
2416 
2417  //ErrxMFvsTrackwidthWClus2->Fill(rechitrphitrackwidth,sqrt(rechitrphierrxMF));
2418  // }
2419  }
2420  }
2421  if (clusizrphi == 3) {
2424  if (rechitrphithickness > CutThickness)
2425  {
2426  //if ((detid.subdetId() == int(StripSubdetector::TIB)) || (detid.subdetId() == int(StripSubdetector::TOB)))
2427  //{
2428  /*
2429  ResMFvsTrackwidthWClus3->Fill(rechitrphitrackwidth,rechitrphiresMF);
2430  if (rechitrphiexpectedwidth==1) ResMFvsTrackwidthWClus3Wexp1->Fill(rechitrphitrackwidth,rechitrphiresMF);
2431  if (rechitrphiexpectedwidth==2) ResMFvsTrackwidthWClus3Wexp2->Fill(rechitrphitrackwidth,rechitrphiresMF);
2432  if (rechitrphiexpectedwidth==3) ResMFvsTrackwidthWClus3Wexp3->Fill(rechitrphitrackwidth,rechitrphiresMF);
2433  if (rechitrphiexpectedwidth==4) ResMFvsTrackwidthWClus3Wexp4->Fill(rechitrphitrackwidth,rechitrphiresMF);
2434  ErrxMFvsTrackwidthWClus3->Fill(rechitrphitrackwidth,sqrt(rechitrphierrxMF));
2435  */
2436  // }
2437  }
2438  }
2439  if (clusizrphi == 4) {
2442  if (rechitrphithickness > CutThickness)
2443  {
2444  //if ((detid.subdetId() == int(StripSubdetector::TIB)) || (detid.subdetId() == int(StripSubdetector::TOB)))
2445  //{
2446  /* ResMFvsTrackwidthWClus4->Fill(rechitrphitrackwidth,rechitrphiresMF);
2447  if (rechitrphiexpectedwidth==1) ResMFvsTrackwidthWClus4Wexp1->Fill(rechitrphitrackwidth,rechitrphiresMF);
2448  if (rechitrphiexpectedwidth==2) ResMFvsTrackwidthWClus4Wexp2->Fill(rechitrphitrackwidth,rechitrphiresMF);
2449  if (rechitrphiexpectedwidth==3) ResMFvsTrackwidthWClus4Wexp3->Fill(rechitrphitrackwidth,rechitrphiresMF);
2450  if (rechitrphiexpectedwidth==4) ResMFvsTrackwidthWClus4Wexp4->Fill(rechitrphitrackwidth,rechitrphiresMF);
2451  ErrxMFvsTrackwidthWClus4->Fill(rechitrphitrackwidth,sqrt(rechitrphierrxMF));*/
2452  //}
2453  }
2454  }
2455 
2456  if (rechitrphicategory == 1) {
2459  }
2460  if (rechitrphicategory == 2) {
2462  //ResMFvsTrackwidthCategory2->Fill(rechitrphitrackwidth,rechitrphiresMF);
2463  // ErrxMFvsTrackwidthCategory2->Fill(rechitrphitrackwidth,sqrt(rechitrphierrxMF));
2464  }
2465  if (rechitrphicategory == 3) {
2467  //ResMFvsTrackwidthCategory3->Fill(rechitrphitrackwidth,rechitrphiresMF);
2468  //ErrxMFvsTrackwidthCategory3->Fill(rechitrphitrackwidth,sqrt(rechitrphierrxMF));
2469  }
2470  if (rechitrphicategory == 4) {
2472  //ResMFvsTrackwidthCategory4->Fill(rechitrphitrackwidth,rechitrphiresMF);
2473  //ErrxMFvsTrackwidthCategory4->Fill(rechitrphitrackwidth,sqrt(rechitrphierrxMF));
2474  }
2475  //const unsigned int NBINS = meErrxMFTrackwidthProfile->getNbinsX();
2476  //cout<<"NBINS2 = "<<NBINS<<endl;
2477 
2479  //const unsigned int NBINS3 = meErrxMF->getNbinsX();
2480  //cout<<"NBINS3 = "<<NBINS<<endl;
2486 
2487  }
2488 
2489  if (isrechitsas>0) {
2490 
2491  if (rechitsasthickness > CutThickness)
2492  {
2493  /*
2494  PullvsTrackwidth->Fill(rechitsastrackwidth,rechitsaspullMF);
2495  //cout<<"rechitsaserrxMF"<<rechitsaserrxMF<<endl;
2496  // ErrxMF->Fill(sqrt(rechitsaserrxMF));
2497  ErrxMFvsTrackwidth->Fill(rechitsastrackwidth,sqrt(rechitsaserrxMF));
2498  ResMFvsTrackwidth->Fill(rechitsastrackwidth,rechitsasresMF);
2499 
2500 
2501  PullvsClusterwidth->Fill(clusizsas,rechitsaspullMF);
2502  PullvsExpectedwidth->Fill(rechitsasexpectedwidth,rechitsaspullMF);
2503  PullvsTrackangle->Fill(rechitsastrackangle,rechitsaspullMF);
2504  PullvsTrackanglebeta->Fill(rechitsastrackanglebeta,rechitsaspullMF);
2505  */
2506  }
2507 
2508 
2515 
2518 
2519  if (clusizsas == 1) {
2522  if (rechitsasthickness > CutThickness)
2523  {
2524  //if ((detid.subdetId() == int(StripSubdetector::TIB)) || (detid.subdetId() == int(StripSubdetector::TOB)))
2525  //{
2526  /*
2527  ResMFvsTrackwidthWClus1->Fill(rechitsastrackwidth,rechitsasresMF);
2528  if (rechitsasexpectedwidth==1) ResMFvsTrackwidthWClus1Wexp1->Fill(rechitsastrackwidth,rechitsasresMF);
2529  if (rechitsasexpectedwidth==2) ResMFvsTrackwidthWClus1Wexp2->Fill(rechitsastrackwidth,rechitsasresMF);
2530  if (rechitsasexpectedwidth==3) ResMFvsTrackwidthWClus1Wexp3->Fill(rechitsastrackwidth,rechitsasresMF);
2531  if (rechitsasexpectedwidth==4) ResMFvsTrackwidthWClus1Wexp4->Fill(rechitsastrackwidth,rechitsasresMF);
2532  ErrxMFvsTrackwidthWClus1->Fill(rechitsastrackwidth,sqrt(rechitsaserrxMF));
2533  */
2534  //}
2535  }
2536  }
2537 
2538  if (clusizsas == 2) {
2541  if (rechitsasthickness > CutThickness)
2542  {
2543  // if ((detid.subdetId() == int(StripSubdetector::TIB)) || (detid.subdetId() == int(StripSubdetector::TOB)))
2544  //{
2545  /*
2546  ResMFvsTrackwidthWClus2->Fill(rechitsastrackwidth,rechitsasresMF);
2547  if (rechitsasexpectedwidth==1) ResMFvsTrackwidthWClus2Wexp1->Fill(rechitsastrackwidth,rechitsasresMF);
2548  if (rechitsasexpectedwidth==2) ResMFvsTrackwidthWClus2Wexp2->Fill(rechitsastrackwidth,rechitsasresMF);
2549  if (rechitsasexpectedwidth==3) ResMFvsTrackwidthWClus2Wexp3->Fill(rechitsastrackwidth,rechitsasresMF);
2550  if (rechitsasexpectedwidth==4) ResMFvsTrackwidthWClus2Wexp4->Fill(rechitsastrackwidth,rechitsasresMF);
2551  ErrxMFvsTrackwidthWClus2->Fill(rechitsastrackwidth,sqrt(rechitsaserrxMF));
2552  */
2553  //}
2554  }
2555  }
2556  if (clusizsas == 3) {
2559  if (rechitsasthickness > CutThickness)
2560  {
2561  //if ((detid.subdetId() == int(StripSubdetector::TIB)) || (detid.subdetId() == int(StripSubdetector::TOB)))
2562  // {
2563  /*
2564  ResMFvsTrackwidthWClus3->Fill(rechitsastrackwidth,rechitsasresMF);
2565  if (rechitsasexpectedwidth==1) ResMFvsTrackwidthWClus3Wexp1->Fill(rechitsastrackwidth,rechitsasresMF);
2566  if (rechitsasexpectedwidth==2) ResMFvsTrackwidthWClus3Wexp2->Fill(rechitsastrackwidth,rechitsasresMF);
2567  if (rechitsasexpectedwidth==3) ResMFvsTrackwidthWClus3Wexp3->Fill(rechitsastrackwidth,rechitsasresMF);
2568  if (rechitsasexpectedwidth==4) ResMFvsTrackwidthWClus3Wexp4->Fill(rechitsastrackwidth,rechitsasresMF);
2569  ErrxMFvsTrackwidthWClus3->Fill(rechitsastrackwidth,sqrt(rechitsaserrxMF));
2570  */
2571  //}
2572  }
2573  }
2574  if (clusizsas == 4) {
2577  if (rechitsasthickness > CutThickness)
2578  {
2579  //if ((detid.subdetId() == int(StripSubdetector::TIB)) || (detid.subdetId() == int(StripSubdetector::TOB)))
2580  //{
2581  /*
2582  ResMFvsTrackwidthWClus4->Fill(rechitsastrackwidth,rechitsasresMF);
2583  if (rechitsasexpectedwidth==1) ResMFvsTrackwidthWClus4Wexp1->Fill(rechitsastrackwidth,rechitsasresMF);
2584  if (rechitsasexpectedwidth==2) ResMFvsTrackwidthWClus4Wexp2->Fill(rechitsastrackwidth,rechitsasresMF);
2585  if (rechitsasexpectedwidth==3) ResMFvsTrackwidthWClus4Wexp3->Fill(rechitsastrackwidth,rechitsasresMF);
2586  if (rechitsasexpectedwidth==4) ResMFvsTrackwidthWClus4Wexp4->Fill(rechitsastrackwidth,rechitsasresMF);
2587  ErrxMFvsTrackwidthWClus4->Fill(rechitsastrackwidth,sqrt(rechitsaserrxMF));
2588  */
2589  // }
2590  }
2591  }
2592  if (rechitsascategory == 1) {
2595  }
2596  if (rechitsascategory == 2) {
2598  //ResMFvsTrackwidthCategory2->Fill(rechitsastrackwidth,rechitsasresMF);
2599  //ErrxMFvsTrackwidthCategory2->Fill(rechitsastrackwidth,sqrt(rechitsaserrxMF));
2600  }
2601  if (rechitsascategory == 3) {
2603  //ResMFvsTrackwidthCategory3->Fill(rechitsastrackwidth,rechitsasresMF);
2604  //ErrxMFvsTrackwidthCategory3->Fill(rechitsastrackwidth,sqrt(rechitsaserrxMF));
2605  }
2606  if (rechitsascategory == 4) {
2608  //ResMFvsTrackwidthCategory4->Fill(rechitsastrackwidth,rechitsasresMF);
2609  //ErrxMFvsTrackwidthCategory4->Fill(rechitsastrackwidth,sqrt(rechitsaserrxMF));
2610  }
2611 
2618 
2619  }
2620 
2621 
2622  if (detid.subdetId() == int(StripSubdetector::TIB)){
2623  TIBDetId tibid(myid);
2624  int Tibisrechitrphi = isrechitrphi;
2625  int Tibisrechitsas = isrechitsas;
2626  //cout<<"Tibisrechitrphi,Tibisrechitsas = "<<Tibisrechitrphi<<" "<<Tibisrechitsas<<endl;
2627  int ilay = tibid.layer() - 1; //for histogram filling
2628  //cout<<"ilay1 = "<<ilay<<endl;
2629  if(Tibisrechitrphi!=0){
2630  if (rechitrphithickness > CutThickness)
2631  {
2632  /*PullvsTrackwidthTIB->Fill(rechitrphitrackwidth,rechitrphipullMF);
2633  PullvsClusterwidthTIB->Fill(clusizrphi,rechitrphipullMF);
2634  PullvsExpectedwidthTIB->Fill(rechitrphiexpectedwidth,rechitrphipullMF);
2635  PullvsTrackangleTIB->Fill(rechitrphitrackangle,rechitrphipullMF);
2636  PullvsTrackanglebetaTIB->Fill(rechitrphitrackanglebeta,rechitrphipullMF);*/
2637  }
2638  //cout<<"TIB:rechitrphitrackwidth,rechitrphipullMF = "<<rechitrphitrackwidth<<" "<<rechitrphipullMF<<endl;
2639  //cout<<"ilay2 = "<<ilay<<endl;
2640  //cout<<"je suis la RPHI"<<endl;
2641  meNstpRphiTIB[ilay]->Fill(clusizrphi);
2642  meAdcRphiTIB[ilay]->Fill(cluchgrphi);
2643  mePosxRphiTIB[ilay]->Fill(rechitrphix);
2653  if (clusizrphi == 1) {
2656  }
2657  if (clusizrphi == 2) {
2660  }
2661  if (clusizrphi == 3) {
2664  }
2665  if (clusizrphi == 4) {
2668  }
2669 
2670 
2671  if (rechitrphicategory == 1) {
2675  }
2676  if (rechitrphicategory == 2) {
2679  }
2680  if (rechitrphicategory == 3) {
2683  }
2684  if (rechitrphicategory == 4) {
2687  }
2694  }
2695  if(Tibisrechitsas!=0){
2696  if (rechitsasthickness > CutThickness)
2697  {
2698  /* PullvsTrackwidthTIB->Fill(rechitsastrackwidth,rechitsaspullMF);
2699  PullvsClusterwidthTIB->Fill(clusizsas,rechitsaspullMF);
2700  PullvsExpectedwidthTIB->Fill(rechitsasexpectedwidth,rechitsaspullMF);
2701  PullvsTrackangleTIB->Fill(rechitsastrackangle,rechitsaspullMF);
2702  PullvsTrackanglebetaTIB->Fill(rechitsastrackanglebeta,rechitsaspullMF);*/
2703  }
2704  meNstpSasTIB[ilay]->Fill(clusizsas);
2705  meAdcSasTIB[ilay]->Fill(cluchgsas);
2706  mePosxSasTIB[ilay]->Fill(rechitsasx);
2716  if (rechitsascategory == 1) {
2720  }
2721  if (rechitsascategory == 2) {
2724  }
2725  if (rechitsascategory == 3) {
2728  }
2729  if (rechitsascategory == 4) {
2732  }
2739  }
2740  }
2741 
2742  if (detid.subdetId() == int(StripSubdetector::TOB)){
2743  TOBDetId tobid(myid);
2744  int Tobisrechitrphi = isrechitrphi;
2745  int Tobisrechitsas = isrechitsas;
2746  int ilay = tobid.layer() - 1; //for histogram filling
2747  if(Tobisrechitrphi!=0){
2748  if (rechitrphithickness > CutThickness)
2749  {
2750  /*PullvsTrackwidthTOB->Fill(rechitrphitrackwidth,rechitrphipullMF);
2751  PullvsClusterwidthTOB->Fill(clusizrphi,rechitrphipullMF);
2752  PullvsExpectedwidthTOB->Fill(rechitrphiexpectedwidth,rechitrphipullMF);
2753  PullvsTrackangleTOB->Fill(rechitrphitrackangle,rechitrphipullMF);
2754  PullvsTrackanglebetaTOB->Fill(rechitrphitrackanglebeta,rechitrphipullMF);*/
2755  }
2756  //cout<<"TOB:rechitrphitrackwidth,rechitrphipullMF = "<<rechitrphitrackwidth<<" "<<rechitrphipullMF<<endl;
2757  meNstpRphiTOB[ilay]->Fill(clusizrphi);
2758  meAdcRphiTOB[ilay]->Fill(cluchgrphi);
2759  mePosxRphiTOB[ilay]->Fill(rechitrphix);
2769 
2770  if (clusizrphi == 1) {
2773  }
2774  if (clusizrphi == 2) {
2777  }
2778  if (clusizrphi == 3) {
2781  }
2782  if (clusizrphi == 4) {
2785  }
2786 
2787 
2788  if (rechitrphicategory == 1) {
2792  }
2793  if (rechitrphicategory == 2) {
2796  }
2797  if (rechitrphicategory == 3) {
2800  }
2801  if (rechitrphicategory == 4) {
2804  }
2811  }
2812  if(Tobisrechitsas!=0){
2813  if (rechitsasthickness > CutThickness)
2814  {/*
2815  PullvsTrackwidthTOB->Fill(rechitsastrackwidth,rechitsaspullMF);
2816  PullvsClusterwidthTOB->Fill(clusizsas,rechitsaspullMF);
2817  PullvsExpectedwidthTOB->Fill(rechitsasexpectedwidth,rechitsaspullMF);
2818  PullvsTrackangleTOB->Fill(rechitsastrackangle,rechitsaspullMF);
2819  PullvsTrackanglebetaTOB->Fill(rechitsastrackanglebeta,rechitsaspullMF);
2820  */
2821  }
2822  meNstpSasTOB[ilay]->Fill(clusizsas);
2823  meAdcSasTOB[ilay]->Fill(cluchgsas);
2824  mePosxSasTOB[ilay]->Fill(rechitsasx);
2834  if (rechitsascategory == 1) {
2838  }
2839  if (rechitsascategory == 2) {
2842  }
2843  if (rechitsascategory == 3) {
2846  }
2847  if (rechitsascategory == 4) {
2850  }
2857  }
2858  }
2859 
2860  if (detid.subdetId() == int(StripSubdetector::TID)){
2861  TIDDetId tidid(myid);
2862  int Tidisrechitrphi = isrechitrphi;
2863  int Tidisrechitsas = isrechitsas;
2864  int ilay = tidid.ring() - 1; //for histogram filling
2865  if(Tidisrechitrphi!=0){
2866  if (rechitrphithickness > CutThickness)
2867  {
2868  /*PullvsTrackwidthTID->Fill(rechitrphitrackwidth,rechitrphipullMF);
2869  PullvsClusterwidthTID->Fill(clusizrphi,rechitrphipullMF);
2870  PullvsExpectedwidthTID->Fill(rechitrphiexpectedwidth,rechitrphipullMF);
2871  PullvsTrackangleTID->Fill(rechitrphitrackangle,rechitrphipullMF);
2872  PullvsTrackanglebetaTID->Fill(rechitrphitrackanglebeta,rechitrphipullMF);*/
2873  }
2874  //cout<<"TID:rechitrphitrackwidth,rechitrphipullMF = "<<rechitrphitrackwidth<<" "<<rechitrphipullMF<<endl;
2875  meNstpRphiTID[ilay]->Fill(clusizrphi);
2876  meAdcRphiTID[ilay]->Fill(cluchgrphi);
2877  mePosxRphiTID[ilay]->Fill(rechitrphix);
2887  if (rechitrphicategory == 1) {
2891  }
2892  if (rechitrphicategory == 2) {
2895  }
2896  if (rechitrphicategory == 3) {
2899  }
2900  if (rechitrphicategory == 4) {
2903  }
2910  }
2911  if(Tidisrechitsas!=0){
2912  if (rechitsasthickness > CutThickness)
2913  {
2914  /*PullvsTrackwidthTID->Fill(rechitsastrackwidth,rechitsaspullMF);
2915  PullvsClusterwidthTID->Fill(clusizsas,rechitsaspullMF);
2916  PullvsExpectedwidthTID->Fill(rechitsasexpectedwidth,rechitsaspullMF);
2917  PullvsTrackangleTID->Fill(rechitsastrackangle,rechitsaspullMF);
2918  PullvsTrackanglebetaTID->Fill(rechitsastrackanglebeta,rechitsaspullMF);*/
2919  }
2920  meNstpSasTID[ilay]->Fill(clusizsas);
2921  meAdcSasTID[ilay]->Fill(cluchgsas);
2922  mePosxSasTID[ilay]->Fill(rechitsasx);
2932  if (rechitsascategory == 1) {
2936  }
2937  if (rechitsascategory == 2) {
2940  }
2941  if (rechitsascategory == 3) {
2944  }
2945  if (rechitsascategory == 4) {
2948  }
2955  }
2956  }
2957 
2958  if (detid.subdetId() == int(StripSubdetector::TEC)){
2959  TECDetId tecid(myid);
2960  int Tecisrechitrphi = isrechitrphi;
2961  int Tecisrechitsas = isrechitsas;
2962  int ilay = tecid.ring() - 1; //for histogram filling
2963  if(Tecisrechitrphi!=0){
2964  if (rechitrphithickness > CutThickness)
2965  {
2966  /*PullvsTrackwidthTEC->Fill(rechitrphitrackwidth,rechitrphipullMF);
2967  PullvsClusterwidthTEC->Fill(clusizrphi,rechitrphipullMF);
2968  PullvsExpectedwidthTEC->Fill(rechitrphiexpectedwidth,rechitrphipullMF);
2969  PullvsTrackangleTEC->Fill(rechitrphitrackangle,rechitrphipullMF);
2970  PullvsTrackanglebetaTEC->Fill(rechitrphitrackanglebeta,rechitrphipullMF);*/
2971  }
2972  //cout<<"TEC:rechitrphitrackwidth,rechitrphipullMF = "<<rechitrphitrackwidth<<" "<<rechitrphipullMF<<endl;
2973  meNstpRphiTEC[ilay]->Fill(clusizrphi);
2974  meAdcRphiTEC[ilay]->Fill(cluchgrphi);
2975  mePosxRphiTEC[ilay]->Fill(rechitrphix);
2985  if (rechitrphicategory == 1) {
2989  }
2990  if (rechitrphicategory == 2) {
2993  }
2994  if (rechitrphicategory == 3) {
2997  }
2998  if (rechitrphicategory == 4) {
3001  }
3008  }
3009  if(Tecisrechitsas!=0){
3010  if (rechitsasthickness > CutThickness)
3011  {
3012  /*PullvsTrackwidthTEC->Fill(rechitsastrackwidth,rechitsaspullMF);
3013  PullvsClusterwidthTEC->Fill(clusizsas,rechitsaspullMF);
3014  PullvsExpectedwidthTEC->Fill(rechitsasexpectedwidth,rechitsaspullMF);
3015  PullvsTrackangleTEC->Fill(rechitsastrackangle,rechitsaspullMF);
3016  PullvsTrackanglebetaTEC->Fill(rechitsastrackanglebeta,rechitsaspullMF);*/
3017  }
3018  meNstpSasTEC[ilay]->Fill(clusizsas);
3019  meAdcSasTEC[ilay]->Fill(cluchgsas);
3020  mePosxSasTEC[ilay]->Fill(rechitsasx);
3030  if (rechitsascategory == 1) {
3034  }
3035  if (rechitsascategory == 2) {
3038  }
3039  if (rechitsascategory == 3) {
3042  }
3043  if (rechitsascategory == 4) {
3046  }
3053  }
3054 
3055  }
3056 
3057  } //simplehits
3058  //cout<<"DebugLine301"<<endl;
3059 
3060  }
3061  //cout<<"DebugLine302"<<endl;
3062 
3063  }
3064  //cout<<"DebugLine303"<<endl;
3065 
3066 }
3067 
3068 
3069 
3070  //needed by to do the residual for matched hits
3071 std::pair<LocalPoint,LocalVector> SiStripTrackingRecHitsValid::projectHit( const PSimHit& hit, const StripGeomDetUnit* stripDet, const BoundPlane& plane)
3072 {
3073  // const StripGeomDetUnit* stripDet = dynamic_cast<const StripGeomDetUnit*>(hit.det());
3074  //if (stripDet == 0) throw MeasurementDetException("HitMatcher hit is not on StripGeomDetUnit");
3075 
3076  const StripTopology& topol = stripDet->specificTopology();
3077  GlobalPoint globalpos= stripDet->surface().toGlobal(hit.localPosition());
3078  LocalPoint localHit = plane.toLocal(globalpos);
3079  //track direction
3080  LocalVector locdir=hit.localDirection();
3081  //rotate track in new frame
3082 
3083  GlobalVector globaldir= stripDet->surface().toGlobal(locdir);
3084  LocalVector dir=plane.toLocal(globaldir);
3085  float scale = -localHit.z() / dir.z();
3086 
3087  LocalPoint projectedPos = localHit + scale*dir;
3088 
3089  // std::cout << "projectedPos " << projectedPos << std::endl;
3090 
3091  float selfAngle = topol.stripAngle( topol.strip( hit.localPosition()));
3092 
3093  LocalVector stripDir( sin(selfAngle), cos(selfAngle), 0); // vector along strip in hit frame
3094 
3095  LocalVector localStripDir( plane.toLocal(stripDet->surface().toGlobal( stripDir)));
3096 
3097  return std::pair<LocalPoint,LocalVector>( projectedPos, localStripDir);
3098 }
MonitorElement * mePullTrackwidthProfileCategory1SasTEC[5]
MonitorElement * meErrxMFTrackwidthProfileRphiTEC[7]
MonitorElement * mePullTrackwidthProfileSasTOB[2]
const double Pi
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:78
MonitorElement * mePullTrackwidthProfileCategory2RphiTID[3]
MonitorElement * mePullTrackwidthProfileRphiTID[3]
T getParameter(std::string const &) const
SiStripTrackingRecHitsValid(const edm::ParameterSet &conf)
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
MonitorElement * meErrxMFTrackwidthProfileCategory2RphiTIB[4]
float xx() const
Definition: LocalError.h:19
MonitorElement * mePullTrackwidthProfileCategory3SasTIB[4]
MonitorElement * meErrxMFClusterwidthProfileCategory1RphiTIB[4]
virtual LocalError localPositionError() const
MonitorElement * mePullTrackwidthProfileCategory4RphiTEC[7]
MonitorElement * mePullTrackwidthProfileCategory2SasTID[2]
MonitorElement * meResMFTrackwidthProfileWclus4RphiTOB[6]
MonitorElement * meErrxMFTrackwidthProfileCategory3SasTOB[2]
unsigned int layer() const
layer id
Definition: TOBDetId.h:39
MonitorElement * meErrxMFClusterwidthProfileCategory1SasTID[2]
MonitorElement * mePullTrackwidthProfileRphiTEC[7]
virtual float stripAngle(float strip) const =0
const GeomDetUnit * monoDet() const
Definition: GluedGeomDet.h:20
MonitorElement * meErrxMFTrackwidthProfileCategory4RphiTIB[4]
MonitorElement * meErrxMFTrackwidthProfileCategory1SasTID[2]
MonitorElement * mePullTrackwidthProfileCategory1RphiTOB[6]
const SiStripRecHit2D * stereoHit() const
LocalVector localDirection() const
MonitorElement * meErrxMFTrackwidthProfileCategory2SasTID[2]
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:49
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
Definition: DQMStore.cc:1898
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
MonitorElement * mePullTrackangleProfileSasTEC[5]
LocalVector drift(const StripGeomDetUnit *, const MagneticField &, const SiStripLorentzAngle &)
Definition: ShallowTools.cc:39
MonitorElement * meErrxMFTrackwidthProfileCategory4SasTIB[4]
MonitorElement * mePullTrackangleProfileRphiTEC[7]
MonitorElement * meErrxMFTrackwidthProfileWclus4RphiTOB[6]
MonitorElement * mePullTrackwidthProfileCategory1RphiTEC[7]
MonitorElement * mePullTrackwidthProfileCategory4SasTEC[5]
T y() const
Definition: PV3DBase.h:57
MonitorElement * mePullTrackwidthProfileCategory2SasTEC[5]
#define abs(x)
Definition: mlp_lapack.h:159
MonitorElement * meErrxMFTrackwidthProfileCategory4SasTOB[2]
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:64
MonitorElement * meErrxMFTrackwidthProfileWclus4RphiTIB[4]
MonitorElement * meErrxMFTrackwidthProfileWclus3RphiTOB[6]
MonitorElement * meResMFTrackwidthProfileWclus4RphiTIB[4]
MonitorElement * mePullTrackangleProfileRphiTID[3]
tuple histo
Definition: trackerHits.py:12
virtual const StripTopology & specificTopology() const
Returns a reference to the strip proxy topology.
MonitorElement * meErrxMFTrackwidthProfileCategory3RphiTEC[7]
MonitorElement * meErrxMFTrackwidthProfileCategory1SasTIB[4]
static int position[TOTALCHAMBERS][3]
Definition: ReadPGInfo.cc:509
MonitorElement * meResMFTrackwidthProfileWclus3RphiTIB[4]
virtual LocalPoint localPosition() const
MonitorElement * mePullTrackwidthProfileCategory4RphiTOB[6]
MonitorElement * meErrxMFTrackwidthProfileCategory1SasTOB[2]
MonitorElement * meErrxMFTrackwidthProfileWclus1RphiTOB[6]
virtual float strip(const LocalPoint &) const =0
void Fill(long long x)
MonitorElement * mePullTrackwidthProfileCategory3RphiTID[3]
MonitorElement * meResMFTrackwidthProfileWclus3RphiTOB[6]
virtual float thickness() const =0
MonitorElement * meResMFTrackwidthProfileWclus2RphiTOB[6]
MonitorElement * mePullTrackwidthProfileCategory4RphiTIB[4]
MonitorElement * mePullTrackwidthProfileCategory4RphiTID[3]
MonitorElement * meErrxMFClusterwidthProfileCategory1RphiTEC[7]
MonitorElement * meErrxMFClusterwidthProfileCategory1SasTEC[7]
MonitorElement * meErrxMFTrackwidthProfileCategory3RphiTOB[6]
virtual float localPitch(const LocalPoint &) const =0
float xy() const
Definition: LocalError.h:20
MonitorElement * mePullTrackwidthProfileCategory1SasTOB[2]
MonitorElement * meErrxMFTrackwidthProfileRphiTOB[6]
MonitorElement * mePullTrackwidthProfileCategory4SasTID[2]
virtual MeasurementError measurementError(const LocalPoint &, const LocalError &) const =0
MonitorElement * meErrxMFTrackwidthProfileCategory3SasTEC[7]
MonitorElement * meErrxMFTrackwidthProfileSasTIB[4]
float yy() const
Definition: LocalError.h:21
Local3DPoint localPosition() const
Definition: PSimHit.h:44
MonitorElement * mePullTrackwidthProfileCategory1RphiTIB[4]
T sqrt(T t)
Definition: SSEVec.h:28
LocalPoint toLocal(const GlobalPoint &gp) const
MonitorElement * mePullTrackwidthProfileCategory2SasTIB[4]
MonitorElement * mePullTrackangleProfileSasTIB[4]
MonitorElement * mePullTrackwidthProfileCategory2RphiTOB[6]
T z() const
Definition: PV3DBase.h:58
MonitorElement * mePullTrackwidthProfileCategory1SasTID[2]
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
MonitorElement * mePullTrackwidthProfileCategory3RphiTEC[7]
MonitorElement * mePullTrackangleProfileSasTID[2]
virtual const Topology & topology() const
Returns a reference to the strip proxy topology.
unsigned int ring() const
ring id
Definition: TIDDetId.h:55
MonitorElement * meErrxMFTrackwidthProfileCategory4RphiTEC[7]
float uu() const
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
MonitorElement * mePullTrackwidthProfileCategory3RphiTOB[6]
MonitorElement * meErrxMFTrackwidthProfileSasTOB[2]
virtual MeasurementPoint measurementPosition(const LocalPoint &) const =0
MonitorElement * meErrxMFTrackwidthProfileWclus2RphiTIB[4]
MonitorElement * meErrxMFTrackwidthProfileCategory4SasTEC[7]
virtual void analyze(const edm::Event &e, const edm::EventSetup &c)
MonitorElement * mePullTrackwidthProfileCategory2RphiTIB[4]
MonitorElement * mePullTrackwidthProfileRphiTOB[6]
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
virtual const GeomDet * idToDet(DetId) const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:355
MonitorElement * mePullTrackwidthProfileCategory4SasTOB[2]
MonitorElement * mePullTrackangleProfileRphiTIB[4]
DQMStore * dbe_
std::pair< LocalPoint, LocalVector > projectHit(const PSimHit &hit, const StripGeomDetUnit *stripDet, const BoundPlane &plane)
MonitorElement * mePullTrackwidthProfileCategory2RphiTEC[7]
MonitorElement * meErrxMFTrackwidthProfileCategory1SasTEC[7]
LocalVector localDirection() const
Obsolete. Same as momentumAtEntry().unit(), for backward compatibility.
Definition: PSimHit.h:52
MonitorElement * meResMFTrackwidthProfileWclus2RphiTIB[4]
MonitorElement * mePullTrackwidthProfileCategory1RphiTID[3]
Definition: DetId.h:20
unsigned int stereo() const
stereo
const Bounds & bounds() const
Definition: BoundSurface.h:89
MonitorElement * meErrxMFTrackwidthProfileWclus1RphiTIB[4]
MonitorElement * meErrxMFTrackwidthProfileWclus3RphiTIB[4]
MonitorElement * meResMFTrackwidthProfileWclus1RphiTIB[4]
MonitorElement * mePullTrackwidthProfileCategory4SasTIB[4]
MonitorElement * meErrxMFTrackwidthProfileCategory3RphiTID[3]
virtual LocalError localPositionError() const =0
MonitorElement * mePullTrackwidthProfileCategory3SasTID[2]
MonitorElement * meErrxMFTrackwidthProfileRphiTIB[4]
MonitorElement * meErrxMFTrackwidthProfileSasTEC[7]
MonitorElement * meErrxMFClusterwidthProfileCategory1SasTIB[4]
MonitorElement * mePullTrackwidthProfileCategory3RphiTIB[4]
MonitorElement * meResMFTrackwidthProfileWclus1RphiTOB[6]
MonitorElement * meErrxMFTrackwidthProfileCategory2SasTOB[2]
const T & get() const
Definition: EventSetup.h:55
MonitorElement * meErrxMFTrackwidthProfileCategory2SasTEC[7]
ClusterRef const & cluster() const
MonitorElement * mePullTrackwidthProfileSasTID[2]
MonitorElement * meErrxMFTrackwidthProfileCategory4RphiTOB[6]
MonitorElement * meErrxMFTrackwidthProfileWclus2RphiTOB[6]
MonitorElement * meErrxMFTrackwidthProfileCategory3RphiTIB[4]
MonitorElement * mePullTrackwidthProfileCategory1SasTIB[4]
MonitorElement * meErrxMFTrackwidthProfileSasTID[2]
MonitorElement * mePullTrackwidthProfileSasTEC[5]
unsigned int layer() const
layer id
Definition: TIBDetId.h:41
virtual const GeomDetUnit * idToDetUnit(DetId) const
Return the pointer to the GeomDetUnit corresponding to a given DetId.
MonitorElement * mePullTrackwidthProfileSasTIB[4]
MonitorElement * meErrxMFTrackwidthProfileCategory2RphiTOB[6]
MonitorElement * meErrxMFTrackwidthProfileCategory3SasTIB[4]
MonitorElement * meErrxMFTrackwidthProfileRphiTID[3]
MonitorElement * meErrxMFClusterwidthProfileCategory1RphiTOB[6]
MonitorElement * meErrxMFTrackwidthProfileCategory1RphiTIB[4]
unsigned int ring() const
ring id
Definition: TECDetId.h:71
MonitorElement * mePullTrackwidthProfileCategory3SasTOB[2]
std::vector< PSimHit > associateHit(const TrackingRecHit &thit)
MonitorElement * meErrxMFTrackwidthProfileCategory1RphiTEC[7]
MonitorElement * meErrxMFTrackwidthProfileCategory2RphiTEC[7]
MonitorElement * meErrxMFTrackwidthProfileCategory1RphiTOB[6]
ClusterRef const & cluster() const
MonitorElement * meErrxMFTrackwidthProfileCategory4SasTID[2]
DetId geographicalId() const
dbl *** dir
Definition: mlp_gen.cc:35
Definition: DDAxes.h:10
MonitorElement * meErrxMFClusterwidthProfileCategory1RphiTID[3]
const SiStripRecHit2D * monoHit() const
MonitorElement * mePullTrackwidthProfileCategory2SasTOB[2]
T x() const
Definition: PV2DBase.h:39
T x() const
Definition: PV3DBase.h:56
virtual LocalPoint localPosition() const =0
MonitorElement * mePullTrackangleProfileSasTOB[2]
MonitorElement * meErrxMFTrackwidthProfileCategory1RphiTID[3]
MonitorElement * meErrxMFTrackwidthProfileCategory3SasTID[2]
MonitorElement * mePullTrackangleProfileRphiTOB[6]
MonitorElement * meErrxMFTrackwidthProfileCategory2RphiTID[3]
virtual const BoundPlane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
const GeomDetUnit * stereoDet() const
Definition: GluedGeomDet.h:21
MonitorElement * mePullTrackwidthProfileCategory3SasTEC[5]
MonitorElement * meErrxMFTrackwidthProfileCategory2SasTIB[4]
MonitorElement * meErrxMFClusterwidthProfileCategory1SasTOB[2]
MonitorElement * mePullTrackwidthProfileRphiTIB[4]
MonitorElement * meErrxMFTrackwidthProfileCategory4RphiTID[3]