CMS 3D CMS Logo

SiStripTrackingRecHitsValid.cc
Go to the documentation of this file.
1 #include <memory>
2 #include <string>
3 #include <iostream>
4 #include <TMath.h>
6 
8 
14 
19 
22 
30 
31 using namespace std;
32 using namespace edm;
33 
34 // ROOT
35 #include "TROOT.h"
36 #include "TFile.h"
37 #include "TTree.h"
38 #include "TBranch.h"
39 #include "TH1.h"
40 #include "TH2.h"
41 class TFile;
42 
43 //Constructor
45  dbe_(edm::Service<DQMStore>().operator->()),
46  conf_(ps),
47  trackerHitAssociatorConfig_(ps, consumesCollector()),
48  m_cacheID_(0)
49  // trajectoryInput_( ps.getParameter<edm::InputTag>("trajectoryInput") )
50 {
51  topFolderName_ = conf_.getParameter<std::string>("TopFolderName");
52 
53  runStandalone = conf_.getParameter<bool>("runStandalone");
54 
55  outputMEsInRootFile = conf_.getParameter<bool>("OutputMEsInRootFile");
56 
58 
59  tracksInputToken_ = consumes<std::vector<reco::Track> >( conf_.getParameter<edm::InputTag>("tracksInput") );
60 
61  edm::ParameterSet ParametersResolx_LF = conf_.getParameter<edm::ParameterSet>("TH1Resolx_LF");
62  layerswitchResolx_LF = ParametersResolx_LF.getParameter<bool>("layerswitchon");
63 
64  edm::ParameterSet ParametersResolx_MF = conf_.getParameter<edm::ParameterSet>("TH1Resolx_MF");
65  layerswitchResolx_MF = ParametersResolx_MF.getParameter<bool>("layerswitchon");
66 
67  edm::ParameterSet ParametersRes_LF = conf_.getParameter<edm::ParameterSet>("TH1Res_LF");
68  layerswitchRes_LF = ParametersRes_LF.getParameter<bool>("layerswitchon");
69 
70  edm::ParameterSet ParametersRes_MF = conf_.getParameter<edm::ParameterSet>("TH1Res_MF");
71  layerswitchRes_MF = ParametersRes_MF.getParameter<bool>("layerswitchon");
72 
73  edm::ParameterSet ParametersPull_LF = conf_.getParameter<edm::ParameterSet>("TH1Pull_LF");
74  layerswitchPull_LF = ParametersPull_LF.getParameter<bool>("layerswitchon");
75 
76  edm::ParameterSet ParametersPull_MF = conf_.getParameter<edm::ParameterSet>("TH1Pull_MF");
77  layerswitchPull_MF = ParametersPull_MF.getParameter<bool>("layerswitchon");
78 
79  edm::ParameterSet ParametersCategory = conf_.getParameter<edm::ParameterSet>("TH1Category");
80  layerswitchCategory = ParametersCategory.getParameter<bool>("layerswitchon");
81 
82  edm::ParameterSet ParametersTrackwidth = conf_.getParameter<edm::ParameterSet>("TH1Trackwidth");
83  layerswitchTrackwidth = ParametersTrackwidth.getParameter<bool>("layerswitchon");
84 
85  edm::ParameterSet ParametersExpectedwidth = conf_.getParameter<edm::ParameterSet>("TH1Expectedwidth");
86  layerswitchExpectedwidth = ParametersExpectedwidth.getParameter<bool>("layerswitchon");
87 
88  edm::ParameterSet ParametersClusterwidth = conf_.getParameter<edm::ParameterSet>("TH1Clusterwidth");
89  layerswitchClusterwidth = ParametersClusterwidth.getParameter<bool>("layerswitchon");
90 
91  edm::ParameterSet ParametersTrackanglealpha = conf_.getParameter<edm::ParameterSet>("TH1Trackanglealpha");
92  layerswitchTrackanglealpha = ParametersTrackanglealpha.getParameter<bool>("layerswitchon");
93 
94  edm::ParameterSet ParametersTrackanglebeta = conf_.getParameter<edm::ParameterSet>("TH1Trackanglebeta");
95  layerswitchTrackanglebeta = ParametersTrackanglebeta.getParameter<bool>("layerswitchon");
96 
97  edm::ParameterSet ParametersResolxMFTrackwidthProfile_WClus1 = conf_.getParameter<edm::ParameterSet>("TProfResolxMFTrackwidthProfile_WClus1");
98  layerswitchResolxMFTrackwidthProfile_WClus1 = ParametersResolxMFTrackwidthProfile_WClus1.getParameter<bool>("layerswitchon");
99 
100  edm::ParameterSet ParametersResolxMFTrackwidthProfile_WClus2 = conf_.getParameter<edm::ParameterSet>("TProfResolxMFTrackwidthProfile_WClus2");
101  layerswitchResolxMFTrackwidthProfile_WClus2 = ParametersResolxMFTrackwidthProfile_WClus2.getParameter<bool>("layerswitchon");
102 
103  edm::ParameterSet ParametersResolxMFTrackwidthProfile_WClus3 = conf_.getParameter<edm::ParameterSet>("TProfResolxMFTrackwidthProfile_WClus3");
104  layerswitchResolxMFTrackwidthProfile_WClus3 = ParametersResolxMFTrackwidthProfile_WClus3.getParameter<bool>("layerswitchon");
105 
106  edm::ParameterSet ParametersResolxMFTrackwidthProfile_WClus4 = conf_.getParameter<edm::ParameterSet>("TProfResolxMFTrackwidthProfile_WClus4");
107  layerswitchResolxMFTrackwidthProfile_WClus4 = ParametersResolxMFTrackwidthProfile_WClus4.getParameter<bool>("layerswitchon");
108 
109  edm::ParameterSet ParametersResMFTrackwidthProfile_WClus1 = conf_.getParameter<edm::ParameterSet>("TProfResMFTrackwidthProfile_WClus1");
110  layerswitchResMFTrackwidthProfile_WClus1 = ParametersResMFTrackwidthProfile_WClus1.getParameter<bool>("layerswitchon");
111 
112  edm::ParameterSet ParametersResMFTrackwidthProfile_WClus2 = conf_.getParameter<edm::ParameterSet>("TProfResMFTrackwidthProfile_WClus2");
113  layerswitchResMFTrackwidthProfile_WClus2 = ParametersResMFTrackwidthProfile_WClus2.getParameter<bool>("layerswitchon");
114 
115  edm::ParameterSet ParametersResMFTrackwidthProfile_WClus21 = conf_.getParameter<edm::ParameterSet>("TProfResMFTrackwidthProfile_WClus21");
116  layerswitchResMFTrackwidthProfile_WClus21 = ParametersResMFTrackwidthProfile_WClus21.getParameter<bool>("layerswitchon");
117 
118  edm::ParameterSet ParametersResMFTrackwidthProfile_WClus22 = conf_.getParameter<edm::ParameterSet>("TProfResMFTrackwidthProfile_WClus22");
119  layerswitchResMFTrackwidthProfile_WClus22 = ParametersResMFTrackwidthProfile_WClus22.getParameter<bool>("layerswitchon");
120 
121  edm::ParameterSet ParametersResMFTrackwidthProfile_WClus23 = conf_.getParameter<edm::ParameterSet>("TProfResMFTrackwidthProfile_WClus23");
122  layerswitchResMFTrackwidthProfile_WClus23 = ParametersResMFTrackwidthProfile_WClus23.getParameter<bool>("layerswitchon");
123 
124  edm::ParameterSet ParametersResMFTrackwidthProfile_WClus3 = conf_.getParameter<edm::ParameterSet>("TProfResMFTrackwidthProfile_WClus3");
125  layerswitchResMFTrackwidthProfile_WClus3 = ParametersResMFTrackwidthProfile_WClus3.getParameter<bool>("layerswitchon");
126 
127  edm::ParameterSet ParametersResMFTrackwidthProfile_WClus4 = conf_.getParameter<edm::ParameterSet>("TProfResMFTrackwidthProfile_WClus4");
128  layerswitchResMFTrackwidthProfile_WClus4 = ParametersResMFTrackwidthProfile_WClus4.getParameter<bool>("layerswitchon");
129 
130  edm::ParameterSet ParametersResolxMFTrackwidthProfile = conf_.getParameter<edm::ParameterSet>("TProfResolxMFTrackwidthProfile");
131  layerswitchResolxMFTrackwidthProfile = ParametersResolxMFTrackwidthProfile.getParameter<bool>("layerswitchon");
132 
133  edm::ParameterSet ParametersResolxMFTrackwidthProfile_Category1 = conf_.getParameter<edm::ParameterSet>("TProfResolxMFTrackwidthProfile_Category1");
134  layerswitchResolxMFTrackwidthProfile_Category1 = ParametersResolxMFTrackwidthProfile_Category1.getParameter<bool>("layerswitchon");
135 
136  edm::ParameterSet ParametersResolxMFTrackwidthProfile_Category2 = conf_.getParameter<edm::ParameterSet>("TProfResolxMFTrackwidthProfile_Category2");
137  layerswitchResolxMFTrackwidthProfile_Category2 = ParametersResolxMFTrackwidthProfile_Category2.getParameter<bool>("layerswitchon");
138 
139  edm::ParameterSet ParametersResolxMFTrackwidthProfile_Category3 = conf_.getParameter<edm::ParameterSet>("TProfResolxMFTrackwidthProfile_Category3");
140  layerswitchResolxMFTrackwidthProfile_Category3 = ParametersResolxMFTrackwidthProfile_Category3.getParameter<bool>("layerswitchon");
141 
142  edm::ParameterSet ParametersResolxMFTrackwidthProfile_Category4 = conf_.getParameter<edm::ParameterSet>("TProfResolxMFTrackwidthProfile_Category4");
143  layerswitchResolxMFTrackwidthProfile_Category4 = ParametersResolxMFTrackwidthProfile_Category4.getParameter<bool>("layerswitchon");
144 
145  edm::ParameterSet ParametersResolxMFClusterwidthProfile_Category1 = conf_.getParameter<edm::ParameterSet>("TProfResolxMFClusterwidthProfile_Category1");
146  layerswitchResolxMFClusterwidthProfile_Category1 = ParametersResolxMFClusterwidthProfile_Category1.getParameter<bool>("layerswitchon");
147 
148  edm::ParameterSet ParametersResolxMFAngleProfile = conf_.getParameter<edm::ParameterSet>("TProfResolxMFAngleProfile");
149  layerswitchResolxMFAngleProfile = ParametersResolxMFAngleProfile.getParameter<bool>("layerswitchon");
150 
151  edm::ParameterSet ParametersWclusRphi = conf_.getParameter<edm::ParameterSet>("TH1WclusRphi");
152  layerswitchWclusRphi = ParametersWclusRphi.getParameter<bool>("layerswitchon");
153 
154  edm::ParameterSet ParametersAdcRphi = conf_.getParameter<edm::ParameterSet>("TH1AdcRphi");
155  layerswitchAdcRphi = ParametersAdcRphi.getParameter<bool>("layerswitchon");
156 
157  edm::ParameterSet ParametersResolxLFRphi = conf_.getParameter<edm::ParameterSet>("TH1ResolxLFRphi");
158  layerswitchResolxLFRphi = ParametersResolxLFRphi.getParameter<bool>("layerswitchon");
159 
160  edm::ParameterSet ParametersResolxMFRphi = conf_.getParameter<edm::ParameterSet>("TH1ResolxMFRphi");
161  layerswitchResolxMFRphi = ParametersResolxMFRphi.getParameter<bool>("layerswitchon");
162 
163  edm::ParameterSet ParametersResolxMFRphiwclus1 = conf_.getParameter<edm::ParameterSet>("TH1ResolxMFRphiwclus1");
164  layerswitchResolxMFRphiwclus1 = ParametersResolxMFRphiwclus1.getParameter<bool>("layerswitchon");
165 
166  edm::ParameterSet ParametersResolxMFRphiwclus2 = conf_.getParameter<edm::ParameterSet>("TH1ResolxMFRphiwclus2");
167  layerswitchResolxMFRphiwclus2 = ParametersResolxMFRphiwclus2.getParameter<bool>("layerswitchon");
168 
169  edm::ParameterSet ParametersResolxMFRphiwclus3 = conf_.getParameter<edm::ParameterSet>("TH1ResolxMFRphiwclus3");
170  layerswitchResolxMFRphiwclus3 = ParametersResolxMFRphiwclus3.getParameter<bool>("layerswitchon");
171 
172  edm::ParameterSet ParametersResolxMFRphiwclus4 = conf_.getParameter<edm::ParameterSet>("TH1ResolxMFRphiwclus4");
173  layerswitchResolxMFRphiwclus4 = ParametersResolxMFRphiwclus4.getParameter<bool>("layerswitchon");
174 
175  edm::ParameterSet ParametersResLFRphi = conf_.getParameter<edm::ParameterSet>("TH1ResLFRphi");
176  layerswitchResLFRphi = ParametersResLFRphi.getParameter<bool>("layerswitchon");
177 
178  edm::ParameterSet ParametersResMFRphi = conf_.getParameter<edm::ParameterSet>("TH1ResMFRphi");
179  layerswitchResMFRphi = ParametersResMFRphi.getParameter<bool>("layerswitchon");
180 
181  edm::ParameterSet ParametersResMFRphiwclus1 = conf_.getParameter<edm::ParameterSet>("TH1ResMFRphiwclus1");
182  layerswitchResMFRphiwclus1 = ParametersResMFRphiwclus1.getParameter<bool>("layerswitchon");
183 
184  edm::ParameterSet ParametersResMFRphiwclus2 = conf_.getParameter<edm::ParameterSet>("TH1ResMFRphiwclus2");
185  layerswitchResMFRphiwclus2 = ParametersResMFRphiwclus2.getParameter<bool>("layerswitchon");
186 
187  edm::ParameterSet ParametersResMFRphiwclus3 = conf_.getParameter<edm::ParameterSet>("TH1ResMFRphiwclus3");
188  layerswitchResMFRphiwclus3 = ParametersResMFRphiwclus3.getParameter<bool>("layerswitchon");
189 
190  edm::ParameterSet ParametersResMFRphiwclus4 = conf_.getParameter<edm::ParameterSet>("TH1ResMFRphiwclus4");
191  layerswitchResMFRphiwclus4 = ParametersResMFRphiwclus4.getParameter<bool>("layerswitchon");
192 
193  edm::ParameterSet ParametersPullLFRphi = conf_.getParameter<edm::ParameterSet>("TH1PullLFRphi");
194  layerswitchPullLFRphi = ParametersPullLFRphi.getParameter<bool>("layerswitchon");
195 
196  edm::ParameterSet ParametersPullMFRphi = conf_.getParameter<edm::ParameterSet>("TH1PullMFRphi");
197  layerswitchPullMFRphi = ParametersPullMFRphi.getParameter<bool>("layerswitchon");
198 
199  edm::ParameterSet ParametersPullMFRphiwclus1 = conf_.getParameter<edm::ParameterSet>("TH1PullMFRphiwclus1");
200  layerswitchPullMFRphiwclus1 = ParametersPullMFRphiwclus1.getParameter<bool>("layerswitchon");
201 
202  edm::ParameterSet ParametersPullMFRphiwclus2 = conf_.getParameter<edm::ParameterSet>("TH1PullMFRphiwclus2");
203  layerswitchPullMFRphiwclus2 = ParametersPullMFRphiwclus2.getParameter<bool>("layerswitchon");
204 
205  edm::ParameterSet ParametersPullMFRphiwclus3 = conf_.getParameter<edm::ParameterSet>("TH1PullMFRphiwclus3");
206  layerswitchPullMFRphiwclus3 = ParametersPullMFRphiwclus3.getParameter<bool>("layerswitchon");
207 
208  edm::ParameterSet ParametersPullMFRphiwclus4 = conf_.getParameter<edm::ParameterSet>("TH1PullMFRphiwclus4");
209  layerswitchPullMFRphiwclus4 = ParametersPullMFRphiwclus4.getParameter<bool>("layerswitchon");
210 
211  edm::ParameterSet ParametersTrackangleRphi = conf_.getParameter<edm::ParameterSet>("TH1TrackangleRphi");
212  layerswitchTrackangleRphi = ParametersTrackangleRphi.getParameter<bool>("layerswitchon");
213 
214  edm::ParameterSet ParametersTrackanglebetaRphi = conf_.getParameter<edm::ParameterSet>("TH1TrackanglebetaRphi");
215  layerswitchTrackanglebetaRphi = ParametersTrackanglebetaRphi.getParameter<bool>("layerswitchon");
216 
217  edm::ParameterSet ParametersTrackangle2Rphi = conf_.getParameter<edm::ParameterSet>("TH1Trackangle2Rphi");
218  layerswitchTrackangle2Rphi = ParametersTrackangle2Rphi.getParameter<bool>("layerswitchon");
219 
220  edm::ParameterSet ParametersPullTrackangleProfileRphi = conf_.getParameter<edm::ParameterSet>("TProfPullTrackangleProfileRphi");
221  layerswitchPullTrackangleProfileRphi = ParametersPullTrackangleProfileRphi.getParameter<bool>("layerswitchon");
222 
223  edm::ParameterSet ParametersPullTrackangle2DRphi = conf_.getParameter<edm::ParameterSet>("TH1PullTrackangle2DRphi");
224  layerswitchPullTrackangle2DRphi = ParametersPullTrackangle2DRphi.getParameter<bool>("layerswitchon");
225 
226  edm::ParameterSet ParametersTrackwidthRphi = conf_.getParameter<edm::ParameterSet>("TH1TrackwidthRphi");
227  layerswitchTrackwidthRphi = ParametersTrackwidthRphi.getParameter<bool>("layerswitchon");
228 
229  edm::ParameterSet ParametersExpectedwidthRphi = conf_.getParameter<edm::ParameterSet>("TH1ExpectedwidthRphi");
230  layerswitchExpectedwidthRphi = ParametersExpectedwidthRphi.getParameter<bool>("layerswitchon");
231 
232  edm::ParameterSet ParametersClusterwidthRphi = conf_.getParameter<edm::ParameterSet>("TH1ClusterwidthRphi");
233  layerswitchClusterwidthRphi = ParametersClusterwidthRphi.getParameter<bool>("layerswitchon");
234 
235  edm::ParameterSet ParametersCategoryRphi = conf_.getParameter<edm::ParameterSet>("TH1CategoryRphi");
236  layerswitchCategoryRphi = ParametersCategoryRphi.getParameter<bool>("layerswitchon");
237 
238  edm::ParameterSet ParametersPullTrackwidthProfileRphi = conf_.getParameter<edm::ParameterSet>("TProfPullTrackwidthProfileRphi");
239  layerswitchPullTrackwidthProfileRphi = ParametersPullTrackwidthProfileRphi.getParameter<bool>("layerswitchon");
240 
241  edm::ParameterSet ParametersPullTrackwidthProfileRphiwclus1 = conf_.getParameter<edm::ParameterSet>("TProfPullTrackwidthProfileRphiwclus1");
242  layerswitchPullTrackwidthProfileRphiwclus1 = ParametersPullTrackwidthProfileRphiwclus1.getParameter<bool>("layerswitchon");
243 
244  edm::ParameterSet ParametersPullTrackwidthProfileRphiwclus2 = conf_.getParameter<edm::ParameterSet>("TProfPullTrackwidthProfileRphiwclus2");
245  layerswitchPullTrackwidthProfileRphiwclus2 = ParametersPullTrackwidthProfileRphiwclus2.getParameter<bool>("layerswitchon");
246 
247  edm::ParameterSet ParametersPullTrackwidthProfileRphiwclus3 = conf_.getParameter<edm::ParameterSet>("TProfPullTrackwidthProfileRphiwclus3");
248  layerswitchPullTrackwidthProfileRphiwclus3 = ParametersPullTrackwidthProfileRphiwclus3.getParameter<bool>("layerswitchon");
249 
250  edm::ParameterSet ParametersPullTrackwidthProfileRphiwclus4 = conf_.getParameter<edm::ParameterSet>("TProfPullTrackwidthProfileRphiwclus4");
251  layerswitchPullTrackwidthProfileRphiwclus4 = ParametersPullTrackwidthProfileRphiwclus4.getParameter<bool>("layerswitchon");
252 
253  edm::ParameterSet ParametersPullTrackwidthProfileCategory1Rphi = conf_.getParameter<edm::ParameterSet>("TProfPullTrackwidthProfileCategory1Rphi");
254  layerswitchPullTrackwidthProfileCategory1Rphi = ParametersPullTrackwidthProfileCategory1Rphi.getParameter<bool>("layerswitchon");
255 
256  edm::ParameterSet ParametersPullTrackwidthProfileCategory2Rphi = conf_.getParameter<edm::ParameterSet>("TProfPullTrackwidthProfileCategory2Rphi");
257  layerswitchPullTrackwidthProfileCategory2Rphi = ParametersPullTrackwidthProfileCategory2Rphi.getParameter<bool>("layerswitchon");
258 
259  edm::ParameterSet ParametersPullTrackwidthProfileCategory3Rphi = conf_.getParameter<edm::ParameterSet>("TProfPullTrackwidthProfileCategory3Rphi");
260  layerswitchPullTrackwidthProfileCategory3Rphi = ParametersPullTrackwidthProfileCategory3Rphi.getParameter<bool>("layerswitchon");
261 
262  edm::ParameterSet ParametersPullTrackwidthProfileCategory4Rphi = conf_.getParameter<edm::ParameterSet>("TProfPullTrackwidthProfileCategory4Rphi");
263  layerswitchPullTrackwidthProfileCategory4Rphi = ParametersPullTrackwidthProfileCategory4Rphi.getParameter<bool>("layerswitchon");
264 
265  edm::ParameterSet ParametersResolxMFTrackwidthProfileRphi = conf_.getParameter<edm::ParameterSet>("TProfResolxMFTrackwidthProfileRphi");
266  layerswitchResolxMFTrackwidthProfileRphi = ParametersResolxMFTrackwidthProfileRphi.getParameter<bool>("layerswitchon");
267 
268  edm::ParameterSet ParametersResolxMFTrackwidthProfileWclus1Rphi = conf_.getParameter<edm::ParameterSet>("TProfResolxMFTrackwidthProfileWclus1Rphi");
269  layerswitchResolxMFTrackwidthProfileWclus1Rphi = ParametersResolxMFTrackwidthProfileWclus1Rphi.getParameter<bool>("layerswitchon");
270 
271  edm::ParameterSet ParametersResolxMFTrackwidthProfileWclus2Rphi = conf_.getParameter<edm::ParameterSet>("TProfResolxMFTrackwidthProfileWclus2Rphi");
272  layerswitchResolxMFTrackwidthProfileWclus2Rphi = ParametersResolxMFTrackwidthProfileWclus2Rphi.getParameter<bool>("layerswitchon");
273 
274  edm::ParameterSet ParametersResolxMFTrackwidthProfileWclus3Rphi = conf_.getParameter<edm::ParameterSet>("TProfResolxMFTrackwidthProfileWclus3Rphi");
275  layerswitchResolxMFTrackwidthProfileWclus3Rphi = ParametersResolxMFTrackwidthProfileWclus3Rphi.getParameter<bool>("layerswitchon");
276 
277  edm::ParameterSet ParametersResolxMFTrackwidthProfileWclus4Rphi = conf_.getParameter<edm::ParameterSet>("TProfResolxMFTrackwidthProfileWclus4Rphi");
278  layerswitchResolxMFTrackwidthProfileWclus4Rphi = ParametersResolxMFTrackwidthProfileWclus4Rphi.getParameter<bool>("layerswitchon");
279 
280  edm::ParameterSet ParametersResMFTrackwidthProfileWclus1Rphi = conf_.getParameter<edm::ParameterSet>("TProfResMFTrackwidthProfileWclus1Rphi");
281  layerswitchResMFTrackwidthProfileWclus1Rphi = ParametersResMFTrackwidthProfileWclus1Rphi.getParameter<bool>("layerswitchon");
282 
283  edm::ParameterSet ParametersResMFTrackwidthProfileWclus2Rphi = conf_.getParameter<edm::ParameterSet>("TProfResMFTrackwidthProfileWclus2Rphi");
284  layerswitchResMFTrackwidthProfileWclus2Rphi = ParametersResMFTrackwidthProfileWclus2Rphi.getParameter<bool>("layerswitchon");
285 
286  edm::ParameterSet ParametersResMFTrackwidthProfileWclus3Rphi = conf_.getParameter<edm::ParameterSet>("TProfResMFTrackwidthProfileWclus3Rphi");
287  layerswitchResMFTrackwidthProfileWclus3Rphi = ParametersResMFTrackwidthProfileWclus3Rphi.getParameter<bool>("layerswitchon");
288 
289  edm::ParameterSet ParametersResMFTrackwidthProfileWclus4Rphi = conf_.getParameter<edm::ParameterSet>("TProfResMFTrackwidthProfileWclus4Rphi");
290  layerswitchResMFTrackwidthProfileWclus4Rphi = ParametersResMFTrackwidthProfileWclus4Rphi.getParameter<bool>("layerswitchon");
291 
292  edm::ParameterSet ParametersResolxMFTrackwidthProfileCategory1Rphi = conf_.getParameter<edm::ParameterSet>("TProfResolxMFTrackwidthProfileCategory1Rphi");
293  layerswitchResolxMFTrackwidthProfileCategory1Rphi = ParametersResolxMFTrackwidthProfileCategory1Rphi.getParameter<bool>("layerswitchon");
294 
295  edm::ParameterSet ParametersResolxMFTrackwidthProfileCategory2Rphi = conf_.getParameter<edm::ParameterSet>("TProfResolxMFTrackwidthProfileCategory2Rphi");
296  layerswitchResolxMFTrackwidthProfileCategory2Rphi = ParametersResolxMFTrackwidthProfileCategory2Rphi.getParameter<bool>("layerswitchon");
297 
298  edm::ParameterSet ParametersResolxMFTrackwidthProfileCategory3Rphi = conf_.getParameter<edm::ParameterSet>("TProfResolxMFTrackwidthProfileCategory3Rphi");
299  layerswitchResolxMFTrackwidthProfileCategory3Rphi = ParametersResolxMFTrackwidthProfileCategory3Rphi.getParameter<bool>("layerswitchon");
300 
301  edm::ParameterSet ParametersResolxMFTrackwidthProfileCategory4Rphi = conf_.getParameter<edm::ParameterSet>("TProfResolxMFTrackwidthProfileCategory4Rphi");
302  layerswitchResolxMFTrackwidthProfileCategory4Rphi = ParametersResolxMFTrackwidthProfileCategory4Rphi.getParameter<bool>("layerswitchon");
303 
304  edm::ParameterSet ParametersResolxMFAngleProfileRphi = conf_.getParameter<edm::ParameterSet>("TProfResolxMFAngleProfileRphi");
305  layerswitchResolxMFAngleProfileRphi = ParametersResolxMFAngleProfileRphi.getParameter<bool>("layerswitchon");
306 
307  edm::ParameterSet ParametersResolxMFClusterwidthProfileCategory1Rphi = conf_.getParameter<edm::ParameterSet>("TProfResolxMFClusterwidthProfileCategory1Rphi");
308  layerswitchResolxMFClusterwidthProfileCategory1Rphi = ParametersResolxMFClusterwidthProfileCategory1Rphi.getParameter<bool>("layerswitchon");
309 
310  edm::ParameterSet ParametersrapidityResProfilewclus1 = conf_.getParameter<edm::ParameterSet>("TProfrapidityResProfilewclus1");
311  layerswitchrapidityResProfilewclus1 = ParametersrapidityResProfilewclus1.getParameter<bool>("layerswitchon");
312 
313  edm::ParameterSet ParametersrapidityResProfilewclus2 = conf_.getParameter<edm::ParameterSet>("TProfrapidityResProfilewclus2");
314  layerswitchrapidityResProfilewclus2 = ParametersrapidityResProfilewclus2.getParameter<bool>("layerswitchon");
315 
316  edm::ParameterSet ParametersrapidityResProfilewclus3 = conf_.getParameter<edm::ParameterSet>("TProfrapidityResProfilewclus3");
317  layerswitchrapidityResProfilewclus3 = ParametersrapidityResProfilewclus3.getParameter<bool>("layerswitchon");
318 
319  edm::ParameterSet ParametersrapidityResProfilewclus4 = conf_.getParameter<edm::ParameterSet>("TProfrapidityResProfilewclus4");
320  layerswitchrapidityResProfilewclus4 = ParametersrapidityResProfilewclus4.getParameter<bool>("layerswitchon");
321 
322  edm::ParameterSet ParametersWclusSas = conf_.getParameter<edm::ParameterSet>("TH1WclusSas");
323  layerswitchWclusSas = ParametersWclusSas.getParameter<bool>("layerswitchon");
324 
325  edm::ParameterSet ParametersAdcSas = conf_.getParameter<edm::ParameterSet>("TH1AdcSas");
326  layerswitchAdcSas = ParametersAdcSas.getParameter<bool>("layerswitchon");
327 
328  edm::ParameterSet ParametersResolxLFSas = conf_.getParameter<edm::ParameterSet>("TH1ResolxLFSas");
329  layerswitchResolxLFSas = ParametersResolxLFSas.getParameter<bool>("layerswitchon");
330 
331  edm::ParameterSet ParametersResolxMFSas = conf_.getParameter<edm::ParameterSet>("TH1ResolxMFSas");
332  layerswitchResolxMFSas = ParametersResolxMFSas.getParameter<bool>("layerswitchon");
333 
334  edm::ParameterSet ParametersResLFSas = conf_.getParameter<edm::ParameterSet>("TH1ResLFSas");
335  layerswitchResLFSas = ParametersResLFSas.getParameter<bool>("layerswitchon");
336 
337  edm::ParameterSet ParametersResMFSas = conf_.getParameter<edm::ParameterSet>("TH1ResMFSas");
338  layerswitchResMFSas = ParametersResMFSas.getParameter<bool>("layerswitchon");
339 
340  edm::ParameterSet ParametersPullLFSas = conf_.getParameter<edm::ParameterSet>("TH1PullLFSas");
341  layerswitchPullLFSas = ParametersPullLFSas.getParameter<bool>("layerswitchon");
342 
343  edm::ParameterSet ParametersPullMFSas = conf_.getParameter<edm::ParameterSet>("TH1PullMFSas");
344  layerswitchPullMFSas = ParametersPullMFSas.getParameter<bool>("layerswitchon");
345 
346  edm::ParameterSet ParametersTrackangleSas = conf_.getParameter<edm::ParameterSet>("TH1TrackangleSas");
347  layerswitchTrackangleSas = ParametersTrackangleSas.getParameter<bool>("layerswitchon");
348 
349  edm::ParameterSet ParametersTrackanglebetaSas = conf_.getParameter<edm::ParameterSet>("TH1TrackanglebetaSas");
350  layerswitchTrackanglebetaSas = ParametersTrackanglebetaSas.getParameter<bool>("layerswitchon");
351 
352  edm::ParameterSet ParametersPullTrackangleProfileSas = conf_.getParameter<edm::ParameterSet>("TProfPullTrackangleProfileSas");
353  layerswitchPullTrackangleProfileSas = ParametersPullTrackangleProfileSas.getParameter<bool>("layerswitchon");
354 
355  edm::ParameterSet ParametersTrackwidthSas = conf_.getParameter<edm::ParameterSet>("TH1TrackwidthSas");
356  layerswitchTrackwidthSas = ParametersTrackwidthSas.getParameter<bool>("layerswitchon");
357 
358  edm::ParameterSet ParametersExpectedwidthSas = conf_.getParameter<edm::ParameterSet>("TH1ExpectedwidthSas");
359  layerswitchExpectedwidthSas = ParametersExpectedwidthSas.getParameter<bool>("layerswitchon");
360 
361  edm::ParameterSet ParametersClusterwidthSas = conf_.getParameter<edm::ParameterSet>("TH1ClusterwidthSas");
362  layerswitchClusterwidthSas = ParametersClusterwidthSas.getParameter<bool>("layerswitchon");
363 
364  edm::ParameterSet ParametersCategorySas = conf_.getParameter<edm::ParameterSet>("TH1CategorySas");
365  layerswitchCategorySas = ParametersCategorySas.getParameter<bool>("layerswitchon");
366 
367  edm::ParameterSet ParametersPullTrackwidthProfileSas = conf_.getParameter<edm::ParameterSet>("TProfPullTrackwidthProfileSas");
368  layerswitchPullTrackwidthProfileSas = ParametersPullTrackwidthProfileSas.getParameter<bool>("layerswitchon");
369 
370  edm::ParameterSet ParametersPullTrackwidthProfileCategory1Sas = conf_.getParameter<edm::ParameterSet>("TProfPullTrackwidthProfileCategory1Sas");
371  layerswitchPullTrackwidthProfileCategory1Sas = ParametersPullTrackwidthProfileCategory1Sas.getParameter<bool>("layerswitchon");
372 
373  edm::ParameterSet ParametersPullTrackwidthProfileCategory2Sas = conf_.getParameter<edm::ParameterSet>("TProfPullTrackwidthProfileCategory2Sas");
374  layerswitchPullTrackwidthProfileCategory2Sas = ParametersPullTrackwidthProfileCategory2Sas.getParameter<bool>("layerswitchon");
375 
376  edm::ParameterSet ParametersPullTrackwidthProfileCategory3Sas = conf_.getParameter<edm::ParameterSet>("TProfPullTrackwidthProfileCategory3Sas");
377  layerswitchPullTrackwidthProfileCategory3Sas = ParametersPullTrackwidthProfileCategory3Sas.getParameter<bool>("layerswitchon");
378 
379  edm::ParameterSet ParametersPullTrackwidthProfileCategory4Sas = conf_.getParameter<edm::ParameterSet>("TProfPullTrackwidthProfileCategory4Sas");
380  layerswitchPullTrackwidthProfileCategory4Sas = ParametersPullTrackwidthProfileCategory4Sas.getParameter<bool>("layerswitchon");
381 
382  edm::ParameterSet ParametersResolxMFTrackwidthProfileSas = conf_.getParameter<edm::ParameterSet>("TProfResolxMFTrackwidthProfileSas");
383  layerswitchResolxMFTrackwidthProfileSas = ParametersResolxMFTrackwidthProfileSas.getParameter<bool>("layerswitchon");
384 
385  edm::ParameterSet ParametersResolxMFTrackwidthProfileCategory1Sas = conf_.getParameter<edm::ParameterSet>("TProfResolxMFTrackwidthProfileCategory1Sas");
386  layerswitchResolxMFTrackwidthProfileCategory1Sas = ParametersResolxMFTrackwidthProfileCategory1Sas.getParameter<bool>("layerswitchon");
387 
388  edm::ParameterSet ParametersResolxMFTrackwidthProfileCategory2Sas = conf_.getParameter<edm::ParameterSet>("TProfResolxMFTrackwidthProfileCategory2Sas");
389  layerswitchResolxMFTrackwidthProfileCategory2Sas = ParametersResolxMFTrackwidthProfileCategory2Sas.getParameter<bool>("layerswitchon");
390 
391  edm::ParameterSet ParametersResolxMFTrackwidthProfileCategory3Sas = conf_.getParameter<edm::ParameterSet>("TProfResolxMFTrackwidthProfileCategory3Sas");
392  layerswitchResolxMFTrackwidthProfileCategory3Sas = ParametersResolxMFTrackwidthProfileCategory3Sas.getParameter<bool>("layerswitchon");
393 
394  edm::ParameterSet ParametersResolxMFTrackwidthProfileCategory4Sas = conf_.getParameter<edm::ParameterSet>("TProfResolxMFTrackwidthProfileCategory4Sas");
395  layerswitchResolxMFTrackwidthProfileCategory4Sas = ParametersResolxMFTrackwidthProfileCategory4Sas.getParameter<bool>("layerswitchon");
396 
397  edm::ParameterSet ParametersResolxMFAngleProfileSas = conf_.getParameter<edm::ParameterSet>("TProfResolxMFAngleProfileSas");
398  layerswitchResolxMFAngleProfileSas = ParametersResolxMFAngleProfileSas.getParameter<bool>("layerswitchon");
399 
400  edm::ParameterSet ParametersResolxMFClusterwidthProfileCategory1Sas = conf_.getParameter<edm::ParameterSet>("TProfResolxMFClusterwidthProfileCategory1Sas");
401  layerswitchResolxMFClusterwidthProfileCategory1Sas = ParametersResolxMFClusterwidthProfileCategory1Sas.getParameter<bool>("layerswitchon");
402 
403  edm::ParameterSet ParametersPosxMatched = conf_.getParameter<edm::ParameterSet>("TH1PosxMatched");
404  layerswitchPosxMatched = ParametersPosxMatched.getParameter<bool>("layerswitchon");
405 
406  edm::ParameterSet ParametersPosyMatched = conf_.getParameter<edm::ParameterSet>("TH1PosyMatched");
407  layerswitchPosyMatched = ParametersPosyMatched.getParameter<bool>("layerswitchon");
408 
409  edm::ParameterSet ParametersResolxMatched = conf_.getParameter<edm::ParameterSet>("TH1ResolxMatched");
410  layerswitchResolxMatched = ParametersResolxMatched.getParameter<bool>("layerswitchon");
411 
412  edm::ParameterSet ParametersResolyMatched = conf_.getParameter<edm::ParameterSet>("TH1ResolyMatched");
413  layerswitchResolyMatched = ParametersResolyMatched.getParameter<bool>("layerswitchon");
414 
415  edm::ParameterSet ParametersResxMatched = conf_.getParameter<edm::ParameterSet>("TH1ResxMatched");
416  layerswitchResxMatched = ParametersResxMatched.getParameter<bool>("layerswitchon");
417 
418  edm::ParameterSet ParametersResyMatched = conf_.getParameter<edm::ParameterSet>("TH1ResyMatched");
419  layerswitchResyMatched = ParametersResyMatched.getParameter<bool>("layerswitchon");
420 
421  edm::ParameterSet ParametersPullxMatched = conf_.getParameter<edm::ParameterSet>("TH1PullxMatched");
422  layerswitchPullxMatched = ParametersPullxMatched.getParameter<bool>("layerswitchon");
423 
424  edm::ParameterSet ParametersPullyMatched = conf_.getParameter<edm::ParameterSet>("TH1PullyMatched");
425  layerswitchPullyMatched = ParametersPullyMatched.getParameter<bool>("layerswitchon");
426 
427 }
428 
429 //Destructor
431 }
432 //--------------------------------------------------------------------------------------------
434 
435  unsigned long long cacheID = es.get<SiStripDetCablingRcd>().cacheIdentifier();
436  if (m_cacheID_ != cacheID) {
437  m_cacheID_ = cacheID;
438  edm::LogInfo("SiStripRecHitsValid") <<"SiStripRecHitsValid::beginRun: "
439  << " Creating MEs for new Cabling ";
440 
441  createMEs(ibooker,es);
442  }
443 }
444 
445 
447 
448 }
449 
451 
452  //Only in standalone mode save local root file
454 
455 }
456 
457 // Functions that gets called by framework every event
459 {
460 
461  LogInfo("EventInfo") << " Run = " << e.id().run() << " Event = " << e.id().event();
462  //cout << " Run = " << e.id().run() << " Event = " << e.id().event() << endl;
463 
464  int isrechitrphi = 0;
465  int isrechitsas = 0;
466  int isrechitmatched = 0;
467 
468  DetId detid;
469  uint32_t myid;
470 
472 
473  //Retrieve tracker topology from geometry
474  edm::ESHandle<TrackerTopology> tTopoHandle;
475  es.get<TrackerTopologyRcd>().get(tTopoHandle);
476  const TrackerTopology* const tTopo = tTopoHandle.product();
477 
479  es.get < TrackerDigiGeometryRecord > ().get(pDD);
480  const TrackerGeometry & tracker(*pDD);
481 
482  const TrackerGeometry *tracker2;
484  es.get < TrackerDigiGeometryRecord > ().get(estracker);
485  tracker2 = &(*estracker);
486 
488  es.get < IdealMagneticFieldRecord > ().get(magfield);
489 
490  const MagneticField & magfield_(*magfield);
491  magfield2_ = &magfield_;
492 
494  es.get < TkStripCPERecord > ().get("SimpleStripCPE", stripcpe);
495 
496  // Mangano's
497 
498  edm::Handle < std::vector<reco::Track> > trackCollectionHandle;
499  e.getByToken(tracksInputToken_, trackCollectionHandle);
500 
501  edm::LogVerbatim("TrajectoryAnalyzer") << "trackColl->size(): " << trackCollectionHandle->size();
502  auto const & tracks = *trackCollectionHandle;
503  for (auto const & track : tracks) {
504 
505  if (track.pt()<0.5) continue;
506  edm::LogVerbatim("TrajectoryAnalyzer") << "this track has " << track.found() << " valid hits";
507 
508  auto const & trajParams = track.extra()->trajParams();
509  assert(trajParams.size()==track.recHitsSize());
510  auto hb = track.recHitsBegin();
511  for(unsigned int h=0;h<track.recHitsSize();h++){
512  auto recHit = *(hb+h);
513  if(!recHit->isValid()) continue;
514  auto ldir = trajParams[h].direction();
515  auto gmom = recHit->surface()->toGlobal(trajParams[h].momentum());
516  if (gmom.perp() < 0.5) continue; // redundant...
517  {
518 
519  auto thit2 = recHit;
520  DetId detid2 = thit2->geographicalId();
521  const SiStripMatchedRecHit2D *matchedhit = dynamic_cast < const SiStripMatchedRecHit2D * >(thit2);
522  const SiStripRecHit2D *hit2d = dynamic_cast < const SiStripRecHit2D * >(thit2);
523  const SiStripRecHit1D *hit1d = dynamic_cast < const SiStripRecHit1D * >(thit2);
524 
525  auto thit = thit2;
526 
527  detid = (thit)->geographicalId();
528  myid = detid.rawId();
529  //Here due to the fact that the SiStripHistoId::getSubdetid complains when
530  //a subdet of 1 or 2 appears we add an if statement.
531  if(detid.subdetId()==1 ||detid.subdetId()==2 ){
532  continue;
533  }
534  SiStripHistoId hidmanager;
535  std::string label = hidmanager.getSubdetid(myid,tTopo,true);
536  // std::cout<< "label " << label << " and id " << detid.subdetId() << std::endl;
537 
538  StripSubdetector StripSubdet = (StripSubdetector) detid;
539  //Variable to define the case we are dealing with
540  std::string matchedmonorstereo;
541 
542  isrechitmatched = 0;
543 
544  if (matchedhit) {
545  isrechitmatched = 1;
546  const GluedGeomDet *gluedDet = (const GluedGeomDet *) tracker.idToDet(matchedhit->geographicalId());
547  //Analysis
548  rechitanalysis_matched(ldir, thit2, gluedDet, associate, stripcpe, MatchStatus::matched);
549  // rechitmatched.push_back(rechitpro);
550  }
551 
552  std::map<std::string, StereoAndMatchedMEs>::iterator iStereoAndMatchedME = StereoAndMatchedMEsMap.find(label);
553 
554  //Filling Histograms for Matched hits
555 
556  if (isrechitmatched) {
557 
558  if(iStereoAndMatchedME != StereoAndMatchedMEsMap.end()){
559  fillME(iStereoAndMatchedME->second.mePosxMatched,rechitpro.x);
560  fillME(iStereoAndMatchedME->second.mePosyMatched,rechitpro.y);
561  fillME(iStereoAndMatchedME->second.meResolxMatched,sqrt(rechitpro.resolxx));
562  fillME(iStereoAndMatchedME->second.meResolyMatched,sqrt(rechitpro.resolyy));
563  fillME(iStereoAndMatchedME->second.meResxMatched,rechitpro.resx);
564  fillME(iStereoAndMatchedME->second.meResyMatched,rechitpro.resy);
565  fillME(iStereoAndMatchedME->second.mePullxMatched,rechitpro.pullx);
566  fillME(iStereoAndMatchedME->second.mePullyMatched,rechitpro.pully);
567  }
568  }
569 
570  //Reset Variables here for the current event
571  isrechitrphi = 0;
572  isrechitsas = 0;
573 
575  // simple hits from matched hits
577 
578  if (gmom.transverse() != 0) {
579  track_rapidity = gmom.eta();
580  } else {
581  track_rapidity = -999.0;
582  }
583 
584  if (matchedhit) {
585  auto hm = matchedhit->monoHit();
586  const SiStripRecHit2D *monohit = &hm;
587  // const GeomDetUnit * monodet=gdet->monoDet();
588  GluedGeomDet *gdet = (GluedGeomDet *) tracker2->idToDet(matchedhit->geographicalId());
589 
590  if (monohit) {
591 
592  isrechitrphi = 1;
593 
594  //Analysis
595  rechitanalysis_matched(ldir, thit2, gdet, associate, stripcpe, MatchStatus::monoHit);
596 
597  }
598 
599  auto s = matchedhit->stereoHit();
600  const SiStripRecHit2D *stereohit = &s;
601 
602  if (stereohit) {
603 
604  isrechitsas = 1;
605 
606  //Analysis
607  rechitanalysis_matched(ldir, thit2, gdet, associate, stripcpe, MatchStatus::stereoHit);
608  }
609  }
610 
611  if (hit1d) {
612  // simple hits are mono or stereo
613  // cout<<"simple hit"<<endl;
614  if (StripSubdet.stereo()) {
615 
616  //cout<<"simple hit stereo"<<endl;
617  isrechitsas = 1;
618 
619  const GeomDetUnit *det = tracker.idToDetUnit(detid2);
620  const StripGeomDetUnit *stripdet = (const StripGeomDetUnit *) (det);
621 
622  //Analysis for hit1d stereo
623  rechitanalysis(ldir, thit2, stripdet, stripcpe, associate, true);
624  } else {
625  isrechitrphi = 1;
626  // cout<<"simple hit mono"<<endl;
627 
628  const GeomDetUnit *det = tracker.idToDetUnit(detid2);
629  const StripGeomDetUnit *stripdet = (const StripGeomDetUnit *) (det);
630 
631  //Analysis for hit1d mono
632  rechitanalysis(ldir, thit2, stripdet, stripcpe, associate, true);
633 
634  }
635  }
636 
637  if (hit2d) {
638  // simple hits are mono or stereo
639  // cout<<"simple hit"<<endl;
640  if (StripSubdet.stereo()) {
641 
642  //cout<<"simple hit stereo"<<endl;
643  isrechitsas = 1;
644 
645  const GeomDetUnit *det = tracker.idToDetUnit(detid2);
646  const StripGeomDetUnit *stripdet = (const StripGeomDetUnit *) (det);
647 
648  //Analysis for hit2d stereo
649  rechitanalysis(ldir, thit2, stripdet, stripcpe, associate, false);
650 
651  } else {
652  isrechitrphi = 1;
653  // cout<<"simple hit mono"<<endl;
654 
655  const GeomDetUnit *det = tracker.idToDetUnit(detid2);
656  const StripGeomDetUnit *stripdet = (const StripGeomDetUnit *) (det);
657 
658  //Analysis for hit2d mono
659  rechitanalysis(ldir, thit2, stripdet, stripcpe, associate, false);
660 
661  }
662  }
663 
664 //------------------------------------------------------------------------------------------------------------------------------------------------------
665 
666  //Filling Histograms for simple hits
667  //cout<<"isrechitrphi,isrechitsas = "<<isrechitrphi<<","<<isrechitsas<<endl;
668 
669  std::map<std::string, LayerMEs>::iterator iLayerME = LayerMEsMap.find(label);
670  if (isrechitrphi) {
677 
680 
681  if (rechitpro.clusiz == 1) {
684  } else if (rechitpro.clusiz == 2) {
690  } else if (rechitpro.clusiz == 3) {
693  } else if (rechitpro.clusiz == 4) {
696  }
697 
698  if (rechitpro.category == 1) {
701  } else if (rechitpro.category == 2) {
703  } else if (rechitpro.category == 3) {
705  } else if (rechitpro.category == 4) {
707  }
708 
715 
716  if(iLayerME != LayerMEsMap.end()){
717  fillME(iLayerME->second.meWclusRphi,rechitpro.clusiz);
718  fillME(iLayerME->second.meAdcRphi,rechitpro.cluchg);
719  fillME(iLayerME->second.meResolxLFRphi,sqrt(rechitpro.resolxx));
720  fillME(iLayerME->second.meResolxMFRphi,sqrt(rechitpro.resolxxMF));
721 
722  if( (min(rechitpro.clusiz, 4) - 1) == 1 ){fillME(iLayerME->second.meResolxMFRphiwclus1,sqrt(rechitpro.resolxxMF));}
723  if( (min(rechitpro.clusiz, 4) - 1) == 2 ){fillME(iLayerME->second.meResolxMFRphiwclus2,sqrt(rechitpro.resolxxMF));}
724  if( (min(rechitpro.clusiz, 4) - 1) == 3 ){fillME(iLayerME->second.meResolxMFRphiwclus3,sqrt(rechitpro.resolxxMF));}
725  if( (min(rechitpro.clusiz, 4) - 1) == 4 ){fillME(iLayerME->second.meResolxMFRphiwclus4,sqrt(rechitpro.resolxxMF));}
726 
727 
728  fillME(iLayerME->second.meResLFRphi,rechitpro.resx);
729  fillME(iLayerME->second.meResMFRphi,rechitpro.resxMF);
730 
731  if( (min(rechitpro.clusiz, 4) - 1) == 1 ){fillME(iLayerME->second.merapidityResProfilewclus1,track_rapidity, fabs(rechitpro.resxMF));}
732  if( (min(rechitpro.clusiz, 4) - 1) == 2 ){fillME(iLayerME->second.merapidityResProfilewclus2,track_rapidity, fabs(rechitpro.resxMF));}
733  if( (min(rechitpro.clusiz, 4) - 1) == 3 ){fillME(iLayerME->second.merapidityResProfilewclus3,track_rapidity, fabs(rechitpro.resxMF));}
734  if( (min(rechitpro.clusiz, 4) - 1) == 4 ){fillME(iLayerME->second.merapidityResProfilewclus4,track_rapidity, fabs(rechitpro.resxMF));}
735 
736  if( (min(rechitpro.clusiz, 4) - 1) == 1 ){fillME(iLayerME->second.meResMFRphiwclus1,rechitpro.resxMF);}
737  if( (min(rechitpro.clusiz, 4) - 1) == 2 ){fillME(iLayerME->second.meResMFRphiwclus2,rechitpro.resxMF);}
738  if( (min(rechitpro.clusiz, 4) - 1) == 3 ){fillME(iLayerME->second.meResMFRphiwclus3,rechitpro.resxMF);}
739  if( (min(rechitpro.clusiz, 4) - 1) == 4 ){fillME(iLayerME->second.meResMFRphiwclus4,rechitpro.resxMF);}
740 
741  fillME(iLayerME->second.mePullLFRphi,rechitpro.pullx);
742  fillME(iLayerME->second.mePullMFRphi,rechitpro.pullxMF);
743 
744  if( (min(rechitpro.clusiz, 4) - 1) == 1 ){fillME(iLayerME->second.mePullMFRphiwclus1,rechitpro.pullxMF);}
745  if( (min(rechitpro.clusiz, 4) - 1) == 2 ){fillME(iLayerME->second.mePullMFRphiwclus2,rechitpro.pullxMF);}
746  if( (min(rechitpro.clusiz, 4) - 1) == 3 ){fillME(iLayerME->second.mePullMFRphiwclus3,rechitpro.pullxMF);}
747  if( (min(rechitpro.clusiz, 4) - 1) == 4 ){fillME(iLayerME->second.mePullMFRphiwclus4,rechitpro.pullxMF);}
748 
749 
750  fillME(iLayerME->second.meTrackangleRphi,rechitpro.trackangle);
751  fillME(iLayerME->second.mePullTrackangleProfileRphi,rechitpro.trackangle,fabs(rechitpro.pullxMF));
752 
753  if( (min(rechitpro.clusiz, 4) - 1) == 1 ){fillME(iLayerME->second.mePullTrackwidthProfileRphiwclus1,rechitpro.trackwidth, fabs(rechitpro.pullxMF));}
754  if( (min(rechitpro.clusiz, 4) - 1) == 2 ){fillME(iLayerME->second.mePullTrackwidthProfileRphiwclus2,rechitpro.trackwidth, fabs(rechitpro.pullxMF));}
755  if( (min(rechitpro.clusiz, 4) - 1) == 3 ){fillME(iLayerME->second.mePullTrackwidthProfileRphiwclus3,rechitpro.trackwidth, fabs(rechitpro.pullxMF));}
756  if( (min(rechitpro.clusiz, 4) - 1) == 4 ){fillME(iLayerME->second.mePullTrackwidthProfileRphiwclus4,rechitpro.trackwidth, fabs(rechitpro.pullxMF));}
757 
758 
759  if (rechitpro.clusiz == 1) {
760  fillME(iLayerME->second.meResolxMFTrackwidthProfileWclus1Rphi,rechitpro.trackwidth,sqrt(rechitpro.resolxxMF));
761  fillME(iLayerME->second.meResMFTrackwidthProfileWclus1Rphi,rechitpro.trackwidth,fabs(rechitpro.resxMF));
762  }
763  if (rechitpro.clusiz == 2) {
764  fillME(iLayerME->second.meResolxMFTrackwidthProfileWclus2Rphi,rechitpro.trackwidth,sqrt(rechitpro.resolxxMF));
765  fillME(iLayerME->second.meResMFTrackwidthProfileWclus2Rphi,rechitpro.trackwidth,fabs(rechitpro.resxMF));
766  }
767  if (rechitpro.clusiz == 3) {
768  fillME(iLayerME->second.meResolxMFTrackwidthProfileWclus3Rphi,rechitpro.trackwidth,sqrt(rechitpro.resolxxMF));
769  fillME(iLayerME->second.meResMFTrackwidthProfileWclus3Rphi,rechitpro.trackwidth,fabs(rechitpro.resxMF));
770  }
771  if (rechitpro.clusiz == 4) {
772  fillME(iLayerME->second.meResolxMFTrackwidthProfileWclus4Rphi,rechitpro.trackwidth,sqrt(rechitpro.resolxxMF));
773  fillME(iLayerME->second.meResMFTrackwidthProfileWclus4Rphi,rechitpro.trackwidth,fabs(rechitpro.resxMF));
774  }
775 
776 
777  if (rechitpro.category == 1) {
778  fillME(iLayerME->second.mePullTrackwidthProfileCategory1Rphi,rechitpro.trackwidth,fabs(rechitpro.pullxMF));
779  fillME(iLayerME->second.meResolxMFTrackwidthProfileCategory1Rphi,rechitpro.trackwidth,sqrt(rechitpro.resolxxMF));
780  fillME(iLayerME->second.meResolxMFClusterwidthProfileCategory1Rphi,rechitpro.clusiz,sqrt(rechitpro.resolxxMF));
781  } else if(rechitpro.category == 2) {
782  fillME(iLayerME->second.mePullTrackwidthProfileCategory2Rphi,rechitpro.trackwidth,fabs(rechitpro.pullxMF));
783  fillME(iLayerME->second.meResolxMFTrackwidthProfileCategory2Rphi,rechitpro.trackwidth,sqrt(rechitpro.resolxxMF));
784  } else if (rechitpro.category == 3) {
785  fillME(iLayerME->second.mePullTrackwidthProfileCategory3Rphi,rechitpro.trackwidth,fabs(rechitpro.pullxMF));
786  fillME(iLayerME->second.meResolxMFTrackwidthProfileCategory3Rphi,rechitpro.trackwidth,sqrt(rechitpro.resolxxMF));
787  } else if (rechitpro.category == 4) {
788  fillME(iLayerME->second.mePullTrackwidthProfileCategory4Rphi,rechitpro.trackwidth,fabs(rechitpro.pullxMF));
789  fillME(iLayerME->second.meResolxMFTrackwidthProfileCategory4Rphi,rechitpro.trackwidth,sqrt(rechitpro.resolxxMF));
790  }
791 
792  fillME(iLayerME->second.meTrackwidthRphi,rechitpro.trackwidth);
793  fillME(iLayerME->second.meExpectedwidthRphi,rechitpro.expectedwidth);
794  fillME(iLayerME->second.meClusterwidthRphi,rechitpro.clusiz);
795  fillME(iLayerME->second.meCategoryRphi,rechitpro.category);
796  fillME(iLayerME->second.meResolxMFTrackwidthProfileRphi,rechitpro.trackwidth,sqrt(rechitpro.resolxxMF));
797  fillME(iLayerME->second.meResolxMFAngleProfileRphi,rechitpro.trackangle,sqrt(rechitpro.resolxxMF));
798  }
799  }
800 
801  if (isrechitsas > 0) {
808 
811 
812  if (rechitpro.clusiz == 1) {
815  } else if (rechitpro.clusiz == 2) {
818  } else if (rechitpro.clusiz == 3) {
821  } else if (rechitpro.clusiz == 4) {
824  } if (rechitpro.category == 1) {
827  } else if (rechitpro.category == 2) {
829  } else if (rechitpro.category == 3) {
831  } else if (rechitpro.category == 4) {
833  }
834 
841 
842  if(iStereoAndMatchedME != StereoAndMatchedMEsMap.end()){
843  fillME(iStereoAndMatchedME->second.meWclusSas,rechitpro.clusiz);
844  fillME(iStereoAndMatchedME->second.meAdcSas,rechitpro.cluchg);
845  fillME(iStereoAndMatchedME->second.meResolxLFSas,sqrt(rechitpro.resolxx));
846  fillME(iStereoAndMatchedME->second.meResLFSas,rechitpro.resx);
847  fillME(iStereoAndMatchedME->second.mePullLFSas,rechitpro.pullx);
848  fillME(iStereoAndMatchedME->second.meResolxMFSas,sqrt(rechitpro.resolxxMF));
849  fillME(iStereoAndMatchedME->second.meResMFSas,rechitpro.resxMF);
850  fillME(iStereoAndMatchedME->second.mePullMFSas,rechitpro.pullxMF);
851  fillME(iStereoAndMatchedME->second.meTrackangleSas,rechitpro.trackangle);
852  fillME(iStereoAndMatchedME->second.mePullTrackangleProfileSas,rechitpro.trackangle, rechitpro.pullxMF);
853  fillME(iStereoAndMatchedME->second.mePullTrackwidthProfileSas,rechitpro.trackwidth, rechitpro.pullxMF);
854  if (rechitpro.category == 1) {
855  fillME(iStereoAndMatchedME->second.mePullTrackwidthProfileCategory1Sas,rechitpro.trackwidth,rechitpro.pullxMF);
856  fillME(iStereoAndMatchedME->second.meResolxMFTrackwidthProfileCategory1Sas,rechitpro.trackwidth,sqrt(rechitpro.resolxxMF));
857  fillME(iStereoAndMatchedME->second.meResolxMFClusterwidthProfileCategory1Sas,rechitpro.clusiz,sqrt(rechitpro.resolxxMF));
858  } else if (rechitpro.category == 2) {
859  fillME(iStereoAndMatchedME->second.mePullTrackwidthProfileCategory2Sas,rechitpro.trackwidth,rechitpro.pullxMF);
860  fillME(iStereoAndMatchedME->second.meResolxMFTrackwidthProfileCategory2Sas,rechitpro.trackwidth,sqrt(rechitpro.resolxxMF));
861  } else if (rechitpro.category == 3) {
862  fillME(iStereoAndMatchedME->second.mePullTrackwidthProfileCategory3Sas,rechitpro.trackwidth,rechitpro.pullxMF);
863  fillME(iStereoAndMatchedME->second.meResolxMFTrackwidthProfileCategory3Sas,rechitpro.trackwidth,sqrt(rechitpro.resolxxMF));
864  } else if (rechitpro.category == 4) {
865  fillME(iStereoAndMatchedME->second.mePullTrackwidthProfileCategory4Sas,rechitpro.trackwidth,rechitpro.pullxMF);
866  fillME(iStereoAndMatchedME->second.meResolxMFTrackwidthProfileCategory4Sas,rechitpro.trackwidth,sqrt(rechitpro.resolxxMF));
867  }
868  fillME(iStereoAndMatchedME->second.meTrackwidthSas,rechitpro.trackwidth);
869  fillME(iStereoAndMatchedME->second.meExpectedwidthSas,rechitpro.expectedwidth);
870  fillME(iStereoAndMatchedME->second.meClusterwidthSas,rechitpro.clusiz);
871  fillME(iStereoAndMatchedME->second.meCategorySas,rechitpro.category);
872  fillME(iStereoAndMatchedME->second.meResolxMFTrackwidthProfileSas,rechitpro.trackwidth,sqrt(rechitpro.resolxxMF));
873  fillME(iStereoAndMatchedME->second.meResolxMFAngleProfileSas,rechitpro.trackangle, rechitpro.resolxxMF);
874  }
875  }
876  }
877  }
878  }
879 }
880 
881 
882 
883 //needed by to do the residual for matched hits
884 std::pair < LocalPoint, LocalVector > SiStripTrackingRecHitsValid::projectHit(const PSimHit & hit,
885  const StripGeomDetUnit
886  * stripDet,
887  const BoundPlane &
888  plane)
889 {
890  // const StripGeomDetUnit* stripDet = dynamic_cast<const StripGeomDetUnit*>(hit.det());
891  //if (stripDet == 0) throw MeasurementDetException("HitMatcher hit is not on StripGeomDetUnit");
892 
893  const StripTopology & topol = stripDet->specificTopology();
894  GlobalPoint globalpos = stripDet->surface().toGlobal(hit.localPosition());
895  LocalPoint localHit = plane.toLocal(globalpos);
896  //track direction
897  LocalVector locdir = hit.localDirection();
898  //rotate track in new frame
899 
900  GlobalVector globaldir = stripDet->surface().toGlobal(locdir);
901  LocalVector dir = plane.toLocal(globaldir);
902  float scale = -localHit.z() / dir.z();
903 
904  LocalPoint projectedPos = localHit + scale * dir;
905 
906  // std::cout << "projectedPos " << projectedPos << std::endl;
907 
908  float selfAngle = topol.stripAngle(topol.strip(hit.localPosition()));
909 
910  LocalVector stripDir(sin(selfAngle), cos(selfAngle), 0); // vector along strip in hit frame
911 
912  LocalVector localStripDir(plane.toLocal(stripDet->surface().toGlobal(stripDir)));
913 
914  return std::pair < LocalPoint, LocalVector > (projectedPos, localStripDir);
915 }
916 //--------------------------------------------------------------------------------------------
918 
919  rechitpro.resx = -999999.; rechitpro.resy = -999999.; rechitpro.resxMF = -999999.;
920  rechitpro.pullx = -999999.; rechitpro.pully = -999999.; rechitpro.pullxMF = -999999.; rechitpro.trackangle = -999999.; rechitpro.trackanglebeta = -999999.;
921 
922  const GeomDetUnit *monodet = gluedDet->monoDet();
923  const GeomDetUnit *stereodet = gluedDet->stereoDet();
924  //We initialized it to monoHit case because it complains that it may be uninitialized
925  //and it will change value in the stereoHit case. The matched case do not use this
926  const StripGeomDetUnit *stripdet = (const StripGeomDetUnit *) (monodet) ;
927 
928  const SiStripMatchedRecHit2D *matchedhit = dynamic_cast < const SiStripMatchedRecHit2D * > (rechit);
929  const SiStripRecHit2D *monohit = nullptr;
930  const SiStripRecHit2D *stereohit = nullptr;
932 
933  if (matchedmonorstereo == MatchStatus::monoHit){
934  auto hm = matchedhit->monoHit();
935  monohit = &hm;
936  stripdet = (const StripGeomDetUnit *) (monodet);
937  } else if (matchedmonorstereo == MatchStatus::stereoHit){
938  auto s = matchedhit->stereoHit();
939  stereohit = &s;
940  stripdet = (const StripGeomDetUnit *) (stereodet);
941  }
942  //if(matchedhit) cout<<"manganomatchedhit"<<endl;
943  //if(hit) cout<<"manganosimplehit"<<endl;
944  //if (hit && matchedhit) cout<<"manganosimpleandmatchedhit"<<endl;
945  const StripTopology & topol = (const StripTopology &) stripdet->topology();
946 
947  LocalVector trackdirection = ldir;
948 
949  GlobalVector gtrkdir = gluedDet->toGlobal(trackdirection);
950  LocalVector monotkdir = monodet->toLocal(gtrkdir);
951  LocalVector stereotkdir = stereodet->toLocal(gtrkdir);
952 
955  MeasurementPoint Mposition;
956  MeasurementError Merror;
957 
958  if (matchedmonorstereo == MatchStatus::matched){
959  position=rechit->localPosition();
960  error=rechit->localPositionError();
961  } else if(matchedmonorstereo == MatchStatus::monoHit){
962  position = monohit->localPosition();
963  error = monohit->localPositionError();
964  Mposition = topol.measurementPosition(position);
965  Merror = topol.measurementError(position, error);
966  if (monotkdir.z()) {
967  rechitpro.trackangle = atan(monotkdir.x() / monotkdir.z()) * TMath::RadToDeg();
968  rechitpro.trackanglebeta = atan(monotkdir.y() / monotkdir.z()) * TMath::RadToDeg();
969  }
970  clust = monohit->cluster();
971  } else if (matchedmonorstereo == MatchStatus::stereoHit){
972  position = stereohit->localPosition();
973  error = stereohit->localPositionError();
974  Mposition = topol.measurementPosition(position);
975  Merror = topol.measurementError(position, error);
976  if (stereotkdir.z()) {
977  rechitpro.trackangle = atan(stereotkdir.x() / stereotkdir.z()) * TMath::RadToDeg();
978  rechitpro.trackanglebeta = atan(stereotkdir.y() / stereotkdir.z()) * TMath::RadToDeg();
979  }
980  clust = stereohit->cluster();
981  }
982 
983  LocalVector drift = stripcpe->driftDirection(stripdet);
984  rechitpro.thickness = stripdet->surface().bounds().thickness();
985  float pitch = topol.localPitch(position);
986  float tanalpha = tan(rechitpro.trackangle * TMath::DegToRad());
987  float tanalphaL = drift.x() / drift.z();
988  rechitpro.trackwidth = fabs((rechitpro.thickness / pitch) * tanalpha - (rechitpro.thickness / pitch) * tanalphaL);
989  float SLorentz = 0.5 * (rechitpro.thickness / pitch) * tanalphaL;
990  int Sp = int (position.x() / pitch + SLorentz + 0.5 * rechitpro.trackwidth);
991  int Sm = int (position.x() / pitch + SLorentz - 0.5 * rechitpro.trackwidth);
992  rechitpro.expectedwidth = 1 + Sp - Sm;
993 
994  const auto & amplitudes=clust->amplitudes();
995  rechitpro.clusiz = amplitudes.size();
996  int totcharge=0;
997  for(size_t ia=0; ia<amplitudes.size();++ia){
998  totcharge+=amplitudes[ia];
999  }
1000 
1001  rechitpro.x = position.x();
1002  rechitpro.y = position.y();
1003  rechitpro.z = position.z();
1004  rechitpro.resolxx = error.xx();
1005  rechitpro.resolxy = error.xy();
1006  rechitpro.resolyy = error.yy();
1007  rechitpro.resolxxMF = Merror.uu();
1008  rechitpro.cluchg = totcharge;
1009 
1011  rechitpro.category = 1;
1012  } else if (rechitpro.expectedwidth == 1) {
1013  rechitpro.category = 2;
1014  } else if (rechitpro.clusiz <= rechitpro.expectedwidth) {
1015  rechitpro.category = 3;
1016  } else {
1017  rechitpro.category = 4;
1018  }
1019 
1020  if(matchedmonorstereo == MatchStatus::matched){matched.clear();matched = associate.associateHit(*matchedhit);}
1021  else if(matchedmonorstereo == MatchStatus::monoHit){matched.clear();matched = associate.associateHit(*monohit);}
1022  else if(matchedmonorstereo == MatchStatus::stereoHit){matched.clear();matched = associate.associateHit(*stereohit);}
1023 
1024  if(!matched.empty()){
1025  float mindist = std::numeric_limits<float>::max();
1026  float dist = std::numeric_limits<float>::max();
1027  float distx = std::numeric_limits<float>::max();
1028  float disty = std::numeric_limits<float>::max();
1029  std::pair<LocalPoint,LocalVector> closestPair;
1030  PSimHit* closest = NULL;
1031 
1032  const StripGeomDetUnit* partnerstripdet = static_cast<const StripGeomDetUnit*>(gluedDet->stereoDet());
1033  std::pair<LocalPoint,LocalVector> hitPair;
1034 
1035  if (matchedmonorstereo ==MatchStatus::matched) {
1036  for(auto &m : matched){
1037  //project simhit;
1038  hitPair= projectHit(m,partnerstripdet,gluedDet->surface());
1039  distx = fabs(rechitpro.x - hitPair.first.x());
1040  disty = fabs(rechitpro.y - hitPair.first.y());
1041  dist = sqrt(distx*distx+disty*disty);
1042  if(dist<mindist){
1043  mindist = dist;
1044  closestPair = hitPair;
1045  closest = &m;
1046  }
1047  }
1048  float closestX = closestPair.first.x();
1049  float closestY = closestPair.first.y();
1050  rechitpro.resx = rechitpro.x - closestX;
1051  rechitpro.resy = rechitpro.y - closestPair.first.y();
1052  rechitpro.pullx = ((rechit)->localPosition().x() - closestX) / sqrt(error.xx());
1053  rechitpro.pully = ((rechit)->localPosition().y() - closestY) / sqrt(error.yy());
1054  } else if(matchedmonorstereo == MatchStatus::monoHit){
1055  for(auto &m : matched ){
1056  //project simhit;
1057  dist = abs((monohit)->localPosition().x() - m.localPosition().x());
1058  if(dist<mindist){
1059  mindist = dist;
1060  closestPair = hitPair;
1061  closest = &m;
1062  }
1063  }
1064  float closestX = closest->localPosition().x();
1065  rechitpro.resx = rechitpro.x - closestX;
1066  rechitpro.resxMF = Mposition.x() - (topol.measurementPosition(closest->localPosition())).x();
1067  rechitpro.pullx = (rechit->localPosition().x() - closestX) / sqrt(error.xx());
1068  rechitpro.pullxMF = (rechitpro.resxMF)/sqrt(Merror.uu());
1069  } else if(matchedmonorstereo == MatchStatus::stereoHit){
1070  for(auto &m : matched){
1071  //project simhit;
1072  dist = abs((stereohit)->localPosition().x() - m.localPosition().x());
1073  if(dist<mindist){
1074  mindist = dist;
1075  closestPair = hitPair;
1076  closest = &m;
1077  }
1078  }
1079  float closestX = closest->localPosition().x();
1080  rechitpro.resx = rechitpro.x - closestX;
1081  rechitpro.resxMF = Mposition.x() - (topol.measurementPosition(closest->localPosition())).x();
1082  rechitpro.pullx = (rechit->localPosition().x() - closestX) / sqrt(error.xx());
1083  rechitpro.pullxMF = (rechitpro.resxMF)/sqrt(Merror.uu());
1084  }
1085  }
1086 }
1087 //--------------------------------------------------------------------------------------------
1089 
1090  rechitpro.resx = -999999.; rechitpro.resy = -999999.; rechitpro.resxMF = -999999.;
1091  rechitpro.pullx = -999999.; rechitpro.pully = -999999.; rechitpro.pullxMF = -999999.;
1092 
1093  //If simplehit1or2D is true we are dealing with hit1d, false is for hit2d
1094  const SiStripRecHit2D *hit2d = dynamic_cast < const SiStripRecHit2D * >(rechit);
1095  const SiStripRecHit1D *hit1d = dynamic_cast < const SiStripRecHit1D * >(rechit);
1096 
1097  const StripTopology & topol = (const StripTopology &) stripdet->topology();
1098 
1099  LocalPoint position = rechit->localPosition();
1100  LocalError error = rechit->localPositionError();
1101  MeasurementPoint Mposition = topol.measurementPosition(position);
1102  MeasurementError Merror = topol.measurementError(position,error);
1103 
1104  LocalVector trackdirection = ldir;
1105  rechitpro.trackangle = std::atan(trackdirection.x() / trackdirection.z()) * TMath::RadToDeg();
1106  rechitpro.trackanglebeta = std::atan(trackdirection.y() / trackdirection.z()) * TMath::RadToDeg();
1107 
1108  LocalVector drift = stripcpe->driftDirection(stripdet);
1109  rechitpro.thickness = stripdet->surface().bounds().thickness();
1110  float pitch = topol.localPitch(position);
1111  float tanalpha = tan(rechitpro.trackangle * TMath::DegToRad());
1112  float tanalphaL = drift.x() / drift.z();
1113  rechitpro.trackwidth = fabs((rechitpro.thickness / pitch) * tanalpha - (rechitpro.thickness / pitch) * tanalphaL);
1114  float SLorentz = 0.5 * (rechitpro.thickness / pitch) * tanalphaL;
1115  int Sp = int (position.x() / pitch + SLorentz + 0.5 * rechitpro.trackwidth);
1116  int Sm = int (position.x() / pitch + SLorentz - 0.5 * rechitpro.trackwidth);
1117  rechitpro.expectedwidth = 1 + Sp - Sm;
1118 
1119  int totcharge=0;
1120  if(simplehit1or2D){
1122  clust1d = hit1d->cluster();
1123  const auto & amplitudes1d = clust1d->amplitudes();
1124  rechitpro.clusiz = amplitudes1d.size();
1125  for(size_t ia=0; ia<amplitudes1d.size();++ia){
1126  totcharge+=amplitudes1d[ia];
1127  }
1128  } else {
1130  clust2d = hit2d->cluster();
1131  const auto & amplitudes2d = clust2d->amplitudes();
1132  rechitpro.clusiz = amplitudes2d.size();
1133  for(size_t ia=0; ia<amplitudes2d.size();++ia){
1134  totcharge+=amplitudes2d[ia];
1135  }
1136  }
1137 
1138  rechitpro.x = position.x();
1139  rechitpro.y = position.y();
1140  rechitpro.z = position.z();
1141  rechitpro.resolxx = error.xx();
1142  rechitpro.resolxy = error.xy();
1143  rechitpro.resolyy = error.yy();
1144  rechitpro.resolxxMF = Merror.uu();
1145  rechitpro.cluchg = totcharge;
1146 
1148  rechitpro.category = 1;
1149  } else if (rechitpro.expectedwidth == 1) {
1150  rechitpro.category = 2;
1151  } else if (rechitpro.clusiz <= rechitpro.expectedwidth) {
1152  rechitpro.category = 3;
1153  } else {
1154  rechitpro.category = 4;
1155  }
1156 
1157  matched.clear();
1158  float mindist = std::numeric_limits<float>::max();
1159  float dist = std::numeric_limits<float>::max();
1160  PSimHit* closest = NULL;
1161 
1162  if(simplehit1or2D){
1163  matched = associate.associateHit(*hit1d);
1164  if(!matched.empty()){
1165  for(auto &m : matched ){
1166  dist = abs((hit1d)->localPosition().x() - m.localPosition().x());
1167  if(dist<mindist){
1168  mindist = dist;
1169  closest = &m;
1170  }
1171  }
1172  float closestX = closest->localPosition().x();
1173  rechitpro.resx = rechitpro.x - closestX;
1174  rechitpro.resxMF = Mposition.x() - (topol.measurementPosition(closest->localPosition())).x();
1175  rechitpro.pullx = (rechit->localPosition().x() - closestX) / sqrt(error.xx());
1176  rechitpro.pullxMF = (rechitpro.resxMF)/sqrt(Merror.uu());
1177  }
1178  } else {
1179  matched = associate.associateHit(*hit2d);
1180  if(!matched.empty()){
1181  for(auto &m : matched ){
1182  dist = abs((hit2d)->localPosition().x() - m.localPosition().x());
1183  if(dist<mindist){
1184  mindist = dist;
1185  closest = &m;
1186  }
1187  }
1188  float closestX = closest->localPosition().x();
1189  rechitpro.resx = rechitpro.x - closestX;
1190  rechitpro.resxMF = Mposition.x() - (topol.measurementPosition(closest->localPosition())).x();
1191  rechitpro.pullx = (rechit->localPosition().x() - closestX) / sqrt(error.xx());
1192  rechitpro.pullxMF = (rechitpro.resxMF)/sqrt(Merror.uu());
1193  }
1194  }
1195 }
1196 //--------------------------------------------------------------------------------------------
1198 
1199  //Retrieve tracker topology from geometry
1200  edm::ESHandle<TrackerTopology> tTopoHandle;
1201  es.get<TrackerTopologyRcd>().get(tTopoHandle);
1202  const TrackerTopology* const tTopo = tTopoHandle.product();
1203 
1204  // take from eventSetup the SiStripDetCabling object - here will use SiStripDetControl later on
1206 
1207  // get list of active detectors from SiStripDetCabling
1208  std::vector<uint32_t> activeDets;
1210 
1211  SiStripSubStructure substructure;
1212 
1213  SiStripFolderOrganizer folder_organizer;
1214  // folder_organizer.setSiStripFolderName(topFolderName_);
1215  std::string curfold = topFolderName_;
1216  folder_organizer.setSiStripFolderName(curfold);
1217  folder_organizer.setSiStripFolder();
1218 
1219  // std::cout << "curfold " << curfold << std::endl;
1220 
1221  createSimpleHitsMEs(ibooker);
1222 
1223  // loop over detectors and book MEs
1224  edm::LogInfo("SiStripTrackingRecHitsValid|SiStripTrackingRecHitsValid")<<"nr. of activeDets: "<<activeDets.size();
1225  const std::string& tec = "TEC", tid = "TID", tob = "TOB", tib = "TIB";
1226  for(std::vector<uint32_t>::iterator detid_iterator = activeDets.begin(), detid_end = activeDets.end(); detid_iterator!=detid_end; ++detid_iterator){
1227  uint32_t detid = (*detid_iterator);
1228  // remove any eventual zero elements - there should be none, but just in case
1229  if(detid == 0) {
1230  activeDets.erase(detid_iterator);
1231  continue;
1232  }
1233 
1234  // Create Layer Level MEs
1235  std::pair<std::string,int32_t> det_layer_pair = folder_organizer.GetSubDetAndLayer(detid,tTopo,true);
1236  SiStripHistoId hidmanager;
1237  std::string label = hidmanager.getSubdetid(detid,tTopo,true);
1238  // std::cout << "label " << label << endl;
1239 
1240  std::map<std::string, LayerMEs>::iterator iLayerME = LayerMEsMap.find(label);
1241  if(iLayerME==LayerMEsMap.end()) {
1242 
1243  // get detids for the layer
1244  // Keep in mind that when we are on the TID or TEC we deal with rings not wheel
1245  int32_t lnumber = det_layer_pair.second;
1246  const std::string& lname = det_layer_pair.first;
1247  std::vector<uint32_t> layerDetIds;
1248  if (lname.compare(tec) == 0) {
1249  if (lnumber > 0) {
1250  substructure.getTECDetectors(activeDets,layerDetIds,2,0,0,0,abs(lnumber),0);
1251  } else if (lnumber < 0) {
1252  substructure.getTECDetectors(activeDets,layerDetIds,1,0,0,0,abs(lnumber),0);
1253  }
1254  } else if (lname.compare(tid) == 0) {
1255  if (lnumber > 0) {
1256  substructure.getTIDDetectors(activeDets,layerDetIds,2,0,abs(lnumber),0);
1257  } else if (lnumber < 0) {
1258  substructure.getTIDDetectors(activeDets,layerDetIds,1,0,abs(lnumber),0);
1259  }
1260  } else if (lname.compare(tob) == 0) {
1261  substructure.getTOBDetectors(activeDets,layerDetIds,lnumber,0,0);
1262  } else if (lname.compare(tib) == 0) {
1263  substructure.getTIBDetectors(activeDets,layerDetIds,lnumber,0,0,0);
1264  }
1265  LayerDetMap[label] = layerDetIds;
1266 
1267  // book Layer MEs
1268  folder_organizer.setLayerFolder(detid,tTopo,det_layer_pair.second,true);
1269  // std::stringstream ss;
1270  // folder_organizer.getLayerFolderName(ss, detid, tTopo, true);
1271  // std::cout << "Folder Name " << ss.str().c_str() << std::endl;
1272  // folder_organizer.setLayerFolder(detid,det_layer_pair.second,true);
1273  createLayerMEs(ibooker,label);
1274  }
1275  //Create StereoAndMatchedMEs
1276  std::map<std::string, StereoAndMatchedMEs>::iterator iStereoAndMatchedME = StereoAndMatchedMEsMap.find(label);
1277  if(iStereoAndMatchedME==StereoAndMatchedMEsMap.end()) {
1278 
1279  // get detids for the stereo and matched layer. We are going to need a bool for these layers
1280  bool isStereo = false;
1281  // Keep in mind that when we are on the TID or TEC we deal with rings not wheel
1282  std::vector<uint32_t> stereoandmatchedDetIds;
1283  int32_t stereolnumber = det_layer_pair.second;
1284  const std::string& stereolname = det_layer_pair.first;
1285  if ( stereolname.compare(tec) == 0 && (tTopo->tecIsStereo(detid)) ) {
1286  if ( stereolnumber > 0 ) {
1287  substructure.getTECDetectors(activeDets,stereoandmatchedDetIds,2,0,0,0,abs(stereolnumber),1);
1288  isStereo = true;
1289  } else if ( stereolnumber < 0 ) {
1290  substructure.getTECDetectors(activeDets,stereoandmatchedDetIds,1,0,0,0,abs(stereolnumber),1);
1291  isStereo = true;
1292  }
1293  } else if ( stereolname.compare(tid) == 0 && (tTopo->tidIsStereo(detid)) ) {
1294  if ( stereolnumber > 0 ) {
1295  substructure.getTIDDetectors(activeDets,stereoandmatchedDetIds,2,0,abs(stereolnumber),1);
1296  isStereo = true;
1297  } else if ( stereolnumber < 0 ) {
1298  substructure.getTIDDetectors(activeDets,stereoandmatchedDetIds,1,0,abs(stereolnumber),1);
1299  isStereo = true;
1300  }
1301  } else if ( stereolname.compare(tob) == 0 && (tTopo->tobIsStereo(detid)) ) {
1302  substructure.getTOBDetectors(activeDets,stereoandmatchedDetIds,stereolnumber,0,0);
1303  isStereo = true;
1304  } else if ( stereolname.compare(tib) == 0 && (tTopo->tibIsStereo(detid)) ) {
1305  substructure.getTIBDetectors(activeDets,stereoandmatchedDetIds,stereolnumber,0,0,0);
1306  isStereo = true;
1307  }
1308 
1309  StereoAndMatchedDetMap[label] = stereoandmatchedDetIds;
1310 
1311  // book StereoAndMatched MEs
1312  if(isStereo){
1313  folder_organizer.setLayerFolder(detid,tTopo,det_layer_pair.second,true);
1314  // std::stringstream ss1;
1315  // folder_organizer.getLayerFolderName(ss1, detid, tTopo, true);
1316  // std::cout << "Folder Name stereo " << ss1.str().c_str() << std::endl;
1317  //Create the Monitor Elements only when we have a stereo module
1318  createStereoAndMatchedMEs(ibooker,label);
1319  }
1320  }
1321 
1322 
1323  }//end of loop over detectors
1324 }
1325 //------------------------------------------------------------------------------------------
1327 {
1340 
1345 
1355  simplehitsMEs.meResLF = 0;
1356  simplehitsMEs.mePullLF = 0;
1358  simplehitsMEs.meResMF = 0;
1359  simplehitsMEs.mePullMF = 0;
1360 
1361 
1362  if(layerswitchResolx_LF) {
1363  simplehitsMEs.meResolxLF = bookME1D(ibooker,"TH1Resolx_LF", "TH1Resolx_LF" ,"RecHit resol(x) coord. (local frame)");
1364  simplehitsMEs.meResolxLF->setAxisTitle("resol(x) RecHit coord. (local frame)");
1365  }
1366  if(layerswitchResolx_MF) {
1367  simplehitsMEs.meResolxMF = bookME1D(ibooker,"TH1Resolx_MF", "TH1Resolx_MF" ,"RecHit resol(x) coord. (measurement frame)");
1368  simplehitsMEs.meResolxMF->setAxisTitle("resol(x) RecHit coord. (measurement frame)");
1369  }
1370  if(layerswitchRes_LF) {
1371  simplehitsMEs.meResLF = bookME1D(ibooker,"TH1Res_LF", "TH1Res_LF" ,"Residual of the hit x coordinate (local frame)");
1372  simplehitsMEs.meResLF->setAxisTitle("Hit Res(x) (local frame)");
1373  }
1374  if(layerswitchRes_MF) {
1375  simplehitsMEs.meResMF = bookME1D(ibooker,"TH1Res_MF", "TH1Res_MF" ,"Residual of the hit x coordinate (measurement frame)");
1376  simplehitsMEs.meResMF->setAxisTitle("Hit Res(x) (measurement frame)");
1377  }
1378  if(layerswitchPull_LF) {
1379  simplehitsMEs.mePullLF = bookME1D(ibooker,"TH1Pull_LF", "TH1Pull_LF" ,"Pull distribution (local frame)");
1380  simplehitsMEs.mePullLF->setAxisTitle("Pull distribution (local frame)");
1381  }
1382  if(layerswitchPull_MF) {
1383  simplehitsMEs.mePullMF = bookME1D(ibooker,"TH1Pull_MF", "TH1Pull_MF" ,"Pull distribution (measurement frame)");
1384  simplehitsMEs.mePullMF->setAxisTitle("Pull distribution (measurement frame)");
1385  }
1386  if(layerswitchCategory) {
1387  simplehitsMEs.meCategory = bookME1D(ibooker,"TH1Category", "TH1Category" ,"Category");
1388  simplehitsMEs.meCategory->setAxisTitle("Category");
1389  }
1390  if(layerswitchTrackwidth) {
1391  simplehitsMEs.meTrackwidth = bookME1D(ibooker,"TH1Trackwidth", "TH1Trackwidth" ,"Track width");
1392  simplehitsMEs.meTrackwidth->setAxisTitle("Track width");
1393  }
1395  simplehitsMEs.meExpectedwidth = bookME1D(ibooker,"TH1Expectedwidth", "TH1Expectedwidth" ,"Expected width");
1396  simplehitsMEs.meExpectedwidth->setAxisTitle("Expected width");
1397  }
1399  simplehitsMEs.meClusterwidth = bookME1D(ibooker,"TH1Clusterwidth", "TH1Clusterwidth" ,"Cluster width");
1400  simplehitsMEs.meClusterwidth->setAxisTitle("Cluster width");
1401  }
1403  simplehitsMEs.meTrackanglealpha = bookME1D(ibooker,"TH1Trackanglealpha", "TH1Trackanglealpha" ,"Track angle alpha");
1404  simplehitsMEs.meTrackanglealpha->setAxisTitle("Track angle alpha");
1405  }
1407  simplehitsMEs.meTrackanglebeta = bookME1D(ibooker,"TH1Trackanglebeta", "TH1Trackanglebeta" ,"Track angle beta");
1408  simplehitsMEs.meTrackanglebeta->setAxisTitle("Track angle beta");
1409  }
1411  simplehitsMEs.meResolxMFTrackwidthProfileWClus1 = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfile_WClus1","TProfResolxMFTrackwidthProfile_WClus1","Profile of Resolution in MF vs track width for w=1");
1413  simplehitsMEs.meResolxMFTrackwidthProfileWClus1->setAxisTitle("Resolution (measurement frame) w=1",2);
1414  }
1416  simplehitsMEs.meResolxMFTrackwidthProfileWClus2 = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfile_WClus2","TProfResolxMFTrackwidthProfile_WClus2","Profile of Resolution in MF vs track width for w=2");
1418  simplehitsMEs.meResolxMFTrackwidthProfileWClus2->setAxisTitle("Resolution (measurement frame) w=2",2);
1419 
1420  }
1422  simplehitsMEs.meResolxMFTrackwidthProfileWClus3 = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfile_WClus3","TProfResolxMFTrackwidthProfile_WClus3","Profile of Resolution in MF vs track width for w=3");
1424  simplehitsMEs.meResolxMFTrackwidthProfileWClus3->setAxisTitle("Resolution (measurement frame) w=3",2);
1425  }
1427  simplehitsMEs.meResolxMFTrackwidthProfileWClus4 = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfile_WClus4","TProfResolxMFTrackwidthProfile_WClus4","Profile of Resolution in MF vs track width for w=4");
1429  simplehitsMEs.meResolxMFTrackwidthProfileWClus4->setAxisTitle("Resolution (measurement frame) w=3",2);
1430  }
1432  simplehitsMEs.meResMFTrackwidthProfileWClus1 = bookMEProfile(ibooker,"TProfResMFTrackwidthProfile_WClus1","TProfResMFTrackwidthProfile_WClus1","Profile of Residuals(x) in MF vs track width for w=1");
1434  simplehitsMEs.meResMFTrackwidthProfileWClus1->setAxisTitle("Residuals(x) (measurement frame) w=1",2);
1435  }
1437  simplehitsMEs.meResMFTrackwidthProfileWClus2 = bookMEProfile(ibooker,"TProfResMFTrackwidthProfile_WClus2","TProfResMFTrackwidthProfile_WClus2","Profile of Residuals(x) in MF vs track width for w=2");
1439  simplehitsMEs.meResMFTrackwidthProfileWClus2->setAxisTitle("Residuals(x) (measurement frame) w=2",2);
1440  }
1442  simplehitsMEs.meResMFTrackwidthProfileWClus21 = bookMEProfile(ibooker,"TProfResMFTrackwidthProfile_WClus21","TProfResMFTrackwidthProfile_WClus21","Profile of Residuals(x) in MF vs track width for w=2");
1444  simplehitsMEs.meResMFTrackwidthProfileWClus21->setAxisTitle("Residuals(x) (measurement frame) w=2",2);
1445  }
1447  simplehitsMEs.meResMFTrackwidthProfileWClus22 = bookMEProfile(ibooker,"TProfResMFTrackwidthProfile_WClus22","TProfResMFTrackwidthProfile_WClus22","Profile of Residuals(x) in MF vs track width for w=2");
1449  simplehitsMEs.meResMFTrackwidthProfileWClus22->setAxisTitle("Residuals(x) (measurement frame) w=2",2);
1450 
1451  }
1453  simplehitsMEs.meResMFTrackwidthProfileWClus23 = bookMEProfile(ibooker,"TProfResMFTrackwidthProfile_WClus23","TProfResMFTrackwidthProfile_WClus23","Profile of Residuals(x) in MF vs track width for w=2");
1455  simplehitsMEs.meResMFTrackwidthProfileWClus23->setAxisTitle("Residuals(x) (measurement frame) w=2",2);
1456  }
1458  simplehitsMEs.meResMFTrackwidthProfileWClus3 = bookMEProfile(ibooker,"TProfResMFTrackwidthProfile_WClus3","TProfResMFTrackwidthProfile_WClus3","Profile of Residuals(x) in MF vs track width for w=3");
1460  simplehitsMEs.meResMFTrackwidthProfileWClus3->setAxisTitle("Residuals(x) (measurement frame) w=3",2);
1461  }
1463  simplehitsMEs.meResMFTrackwidthProfileWClus4 = bookMEProfile(ibooker,"TProfResMFTrackwidthProfile_WClus4","TProfResMFTrackwidthProfile_WClus4","Profile of Residuals(x) in MF vs track width for w=4");
1465  simplehitsMEs.meResMFTrackwidthProfileWClus4->setAxisTitle("Residuals(x) (measurement frame) w=4",2);
1466  }
1468  simplehitsMEs.meResolxMFTrackwidthProfile = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfile","TProfResolxMFTrackwidthProfile","Profile of Resolution in MF vs track width");
1470  simplehitsMEs.meResolxMFTrackwidthProfile->setAxisTitle("Resolution (measurement frame)",2);
1471  }
1473  simplehitsMEs.meResolxMFTrackwidthProfileCategory1 = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfile_Category1","TProfResolxMFTrackwidthProfile_Category1","Profile of Resolution in MF vs track width (Category 1)");
1475  simplehitsMEs.meResolxMFTrackwidthProfileCategory1->setAxisTitle("Resolution (measurement frame) Category 1",2);
1476  }
1478  simplehitsMEs.meResolxMFTrackwidthProfileCategory2 = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfile_Category2","TProfResolxMFTrackwidthProfile_Category2","Profile of Resolution in MF vs track width (Category 2)");
1480  simplehitsMEs.meResolxMFTrackwidthProfileCategory2->setAxisTitle("Resolution (measurement frame) Category 2",2);
1481  }
1483  simplehitsMEs.meResolxMFTrackwidthProfileCategory3 = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfile_Category3","TProfResolxMFTrackwidthProfile_Category3","Profile of Resolution in MF vs track width (Category 3)");
1485  simplehitsMEs.meResolxMFTrackwidthProfileCategory3->setAxisTitle("Resolution (measurement frame) Category 3",2);
1486  }
1488  simplehitsMEs.meResolxMFTrackwidthProfileCategory4 = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfile_Category4","TProfResolxMFTrackwidthProfile_Category4","Profile of Resolution in MF vs track width (Category 4)");
1490  simplehitsMEs.meResolxMFTrackwidthProfileCategory4->setAxisTitle("Resolution (measurement frame) Category 4",2);
1491  }
1493  simplehitsMEs.meResolxMFClusterwidthProfileCategory1 = bookMEProfile(ibooker,"TProfResolxMFClusterwidthProfile_Category1","TProfResolxMFClusterwidthProfile_Category1","Profile of Resolution in MF vs cluster width (Category 1)");
1495  simplehitsMEs.meResolxMFClusterwidthProfileCategory1->setAxisTitle("Resolution (measurement frame) Category 1",2);
1496  }
1498  simplehitsMEs.meResolxMFAngleProfile = bookMEProfile(ibooker,"TProfResolxMFAngleProfile","TProfResolxMFAngleProfile","Profile of Resolution in MF vs Track angle alpha");
1499  simplehitsMEs.meResolxMFAngleProfile->setAxisTitle("Track angle alpha",1);
1500  simplehitsMEs.meResolxMFAngleProfile->setAxisTitle("Resolution (measurement frame)",2);
1501  }
1502 
1503 
1504 }
1505 //------------------------------------------------------------------------------------------
1507 {
1508  SiStripHistoId hidmanager;
1509  LayerMEs layerMEs;
1510 
1511  layerMEs.meWclusRphi = 0;
1512  layerMEs.meAdcRphi = 0;
1513  layerMEs.meResolxLFRphi = 0;
1514  layerMEs.meResolxMFRphi = 0;
1515  layerMEs.meResolxMFRphiwclus1 = 0;
1516  layerMEs.meResolxMFRphiwclus2 = 0;
1517  layerMEs.meResolxMFRphiwclus3 = 0;
1518  layerMEs.meResolxMFRphiwclus4 = 0;
1519  layerMEs.meResLFRphi = 0;
1520  layerMEs.meResMFRphi = 0;
1521  layerMEs.meResMFRphiwclus1 = 0;
1522  layerMEs.meResMFRphiwclus2 = 0;
1523  layerMEs.meResMFRphiwclus3 = 0;
1524  layerMEs.meResMFRphiwclus4 = 0;
1525  layerMEs.mePullLFRphi = 0;
1526  layerMEs.mePullMFRphi = 0;
1527  layerMEs.mePullMFRphiwclus1 = 0;
1528  layerMEs.mePullMFRphiwclus2 = 0;
1529  layerMEs.mePullMFRphiwclus3 = 0;
1530  layerMEs.mePullMFRphiwclus4 = 0;
1531  layerMEs.meTrackangleRphi = 0;
1532  layerMEs.meTrackanglebetaRphi = 0;
1533  layerMEs.meTrackangle2Rphi = 0;
1534  layerMEs.mePullTrackangleProfileRphi = 0;
1535  layerMEs.mePullTrackangle2DRphi = 0;
1536  layerMEs.meTrackwidthRphi = 0;
1537  layerMEs.meExpectedwidthRphi = 0;
1538  layerMEs.meClusterwidthRphi = 0;
1539  layerMEs.meCategoryRphi = 0;
1540  layerMEs.mePullTrackwidthProfileRphi = 0;
1541  layerMEs.mePullTrackwidthProfileRphiwclus1 = 0;
1542  layerMEs.mePullTrackwidthProfileRphiwclus2 = 0;
1543  layerMEs.mePullTrackwidthProfileRphiwclus3 = 0;
1544  layerMEs.mePullTrackwidthProfileRphiwclus4 = 0;
1549  layerMEs.meResolxMFTrackwidthProfileRphi = 0;
1550 
1559 
1565  layerMEs.meResolxMFAngleProfileRphi = 0;
1566  layerMEs.merapidityResProfilewclus1 = 0;
1567  layerMEs.merapidityResProfilewclus2 = 0;
1568  layerMEs.merapidityResProfilewclus3 = 0;
1569  layerMEs.merapidityResProfilewclus4 = 0;
1570 
1571 
1572  //WclusRphi
1573  if(layerswitchWclusRphi) {
1574  layerMEs.meWclusRphi = bookME1D(ibooker,"TH1WclusRphi", hidmanager.createHistoLayer("Wclus_rphi","layer",label,"").c_str() ,"Cluster Width - Number of strips that belong to the RecHit cluster");
1575  layerMEs.meWclusRphi->setAxisTitle(("Cluster Width [nr strips] in "+ label).c_str());
1576  }
1577  //AdcRphi
1578  if(layerswitchAdcRphi) {
1579  layerMEs.meAdcRphi = bookME1D(ibooker,"TH1AdcRphi", hidmanager.createHistoLayer("Adc_rphi","layer",label,"").c_str() ,"RecHit Cluster Charge");
1580  layerMEs.meAdcRphi->setAxisTitle(("cluster charge [ADC] in " + label).c_str());
1581  }
1582  //ResolxLFRphi
1584  layerMEs.meResolxLFRphi = bookME1D(ibooker,"TH1ResolxLFRphi", hidmanager.createHistoLayer("Resolx_LF_rphi","layer",label,"").c_str() ,"RecHit resol(x) coord."); //<resolor>~20micron
1585  layerMEs.meResolxLFRphi->setAxisTitle(("resol(x) RecHit coord. (local frame) in " + label).c_str());
1586  }
1587  //ResolxMFRphi
1589  layerMEs.meResolxMFRphi = bookME1D(ibooker,"TH1ResolxMFRphi", hidmanager.createHistoLayer("Resolx_MF_rphi","layer",label,"").c_str() ,"RecHit resol(x) coord."); //<resolor>~20micron
1590  layerMEs.meResolxMFRphi->setAxisTitle(("resol(x) RecHit coord. (measurement frame) in " + label).c_str());
1591  }
1592  //ResolxMFRphiwclus1
1594  layerMEs.meResolxMFRphiwclus1 = bookME1D(ibooker,"TH1ResolxMFRphiwclus1", hidmanager.createHistoLayer("Resolx_MF_wclus1_rphi","layer",label,"").c_str() ,"RecHit resol(x) coord. w=1 "); //<resolor>~20micron
1595  layerMEs.meResolxMFRphiwclus1->setAxisTitle(("resol(x) RecHit coord. (measurement frame) for w=1 in " + label).c_str());
1596  }
1597  //ResolxMFRphiwclus2
1599  layerMEs.meResolxMFRphiwclus2 = bookME1D(ibooker,"TH1ResolxMFRphiwclus2", hidmanager.createHistoLayer("Resolx_MF_wclus2_rphi","layer",label,"").c_str() ,"RecHit resol(x) coord. w=2 "); //<resolor>~20micron
1600  layerMEs.meResolxMFRphiwclus2->setAxisTitle(("resol(x) RecHit coord. (measurement frame) for w=2 in " + label).c_str());
1601  }
1602  //ResolxMFRphiwclus3
1604  layerMEs.meResolxMFRphiwclus3 = bookME1D(ibooker,"TH1ResolxMFRphiwclus3", hidmanager.createHistoLayer("Resolx_MF_wclus3_rphi","layer",label,"").c_str() ,"RecHit resol(x) coord. w=3 "); //<resolor>~20micron
1605  layerMEs.meResolxMFRphiwclus3->setAxisTitle(("resol(x) RecHit coord. (measurement frame) for w=3 in " + label).c_str());
1606  }
1607  //ResolxMFRphiwclus4
1609  layerMEs.meResolxMFRphiwclus4 = bookME1D(ibooker,"TH1ResolxMFRphiwclus4", hidmanager.createHistoLayer("Resolx_MF_wclus4_rphi","layer",label,"").c_str() ,"RecHit resol(x) coord. w=4 "); //<resolor>~20micron
1610  layerMEs.meResolxMFRphiwclus4->setAxisTitle(("resol(x) RecHit coord. (measurement frame) for w=4 in " + label).c_str());
1611  }
1612  //ResLFRphi
1613  if(layerswitchResLFRphi) {
1614  layerMEs.meResLFRphi = bookME1D(ibooker,"TH1ResLFRphi", hidmanager.createHistoLayer("Res_LF_rphi","layer",label,"").c_str() ,"Residual of the hit x coordinate");
1615  layerMEs.meResLFRphi->setAxisTitle(("Hit Residuals(x) (local frame) in " + label).c_str());
1616  }
1617  //ResMFRphi
1618  if(layerswitchResMFRphi) {
1619  layerMEs.meResMFRphi = bookME1D(ibooker,"TH1ResMFRphi",hidmanager.createHistoLayer("Res_MF_Rphi","layer",label,"").c_str() ,"Residual of the hit x coordinate");
1620  layerMEs.meResMFRphi->setAxisTitle(("Hit Residuals(x) (measurement frame) in "+ label).c_str());
1621  }
1622  //ResMFRphiwclus1
1624  layerMEs.meResMFRphiwclus1 = bookME1D(ibooker,"TH1ResMFRphiwclus1",hidmanager.createHistoLayer("Res_MF_wclus1_Rphi","layer",label,"").c_str() ,"Residual of the hit x coordinate w=1");
1625  layerMEs.meResMFRphiwclus1->setAxisTitle(("Hit Residuals(x) (measurement frame) for w=1 in "+ label).c_str());
1626  }
1627  //ResMFRphiwclus2
1629  layerMEs.meResMFRphiwclus2 = bookME1D(ibooker,"TH1ResMFRphiwclus2",hidmanager.createHistoLayer("Res_MF_wclus2_Rphi","layer",label,"").c_str() ,"Residual of the hit x coordinate w=2");
1630  layerMEs.meResMFRphiwclus2->setAxisTitle(("Hit Residuals(x) (measurement frame) for w=2 in "+ label).c_str());
1631  }
1632  //ResMFRphiwclus3
1634  layerMEs.meResMFRphiwclus3 = bookME1D(ibooker,"TH1ResMFRphiwclus3",hidmanager.createHistoLayer("Res_MF_wclus3_Rphi","layer",label,"").c_str() ,"Residual of the hit x coordinate w=3");
1635  layerMEs.meResMFRphiwclus3->setAxisTitle(("Hit Residuals(x) (measurement frame) for w=3 in "+ label).c_str());
1636  }
1637  //ResMFRphiwclus4
1639  layerMEs.meResMFRphiwclus4 = bookME1D(ibooker,"TH1ResMFRphiwclus4",hidmanager.createHistoLayer("Res_MF_wclus4_Rphi","layer",label,"").c_str() ,"Residual of the hit x coordinate w=4");
1640  layerMEs.meResMFRphiwclus4->setAxisTitle(("Hit Residuals(x) (measurement frame) for w=4 in "+ label).c_str());
1641  }
1642  //PullLFRphi
1643  if(layerswitchPullLFRphi) {
1644  layerMEs.mePullLFRphi = bookME1D(ibooker,"TH1PullLFRphi", hidmanager.createHistoLayer("Pull_LF_rphi","layer",label,"").c_str() ,"Pull distribution");
1645  layerMEs.mePullLFRphi->setAxisTitle(("Pull distribution (local frame) in " + label).c_str());
1646  }
1647  //PullMFRphi
1648  if(layerswitchPullMFRphi) {
1649  layerMEs.mePullMFRphi = bookME1D(ibooker,"TH1PullMFRphi", hidmanager.createHistoLayer("Pull_MF_rphi","layer",label,"").c_str() ,"Pull distribution");
1650  layerMEs.mePullMFRphi->setAxisTitle(("Pull distribution (measurement frame) in " + label).c_str());
1651  }
1652  //PullMFRphiwclus1
1654  layerMEs.mePullMFRphiwclus1 = bookME1D(ibooker,"TH1PullMFRphiwclus1", hidmanager.createHistoLayer("Pull_MF_wclus1_rphi","layer",label,"").c_str() ,"Pull distribution w=1");
1655  layerMEs.mePullMFRphiwclus1->setAxisTitle(("Pull distribution (measurement frame) for w=1 in " + label).c_str());
1656  }
1657  //PullMFRphiwclus2
1659  layerMEs.mePullMFRphiwclus2 = bookME1D(ibooker,"TH1PullMFRphiwclus2", hidmanager.createHistoLayer("Pull_MF_wclus2_rphi","layer",label,"").c_str() ,"Pull distribution w=2");
1660  layerMEs.mePullMFRphiwclus2->setAxisTitle(("Pull distribution (measurement frame) for w=2 in " + label).c_str());
1661  }
1662  //PullMFRphiwclus3
1664  layerMEs.mePullMFRphiwclus3 = bookME1D(ibooker,"TH1PullMFRphiwclus3", hidmanager.createHistoLayer("Pull_MF_wclus3_rphi","layer",label,"").c_str() ,"Pull distribution w=3");
1665  layerMEs.mePullMFRphiwclus3->setAxisTitle(("Pull distribution (measurement frame) for w=3 in " + label).c_str());
1666  }
1667  //PullMFRphiwclus4
1669  layerMEs.mePullMFRphiwclus4 = bookME1D(ibooker,"TH1PullMFRphiwclus4", hidmanager.createHistoLayer("Pull_MF_wclus4_rphi","layer",label,"").c_str() ,"Pull distribution w=4");
1670  layerMEs.mePullMFRphiwclus4->setAxisTitle(("Pull distribution (measurement frame) for w=4 in " + label).c_str());
1671  }
1672 
1674  layerMEs.meTrackangleRphi = bookME1D(ibooker,"TH1TrackangleRphi",hidmanager.createHistoLayer("Track_angle_Rphi","layer",label,"").c_str() ,"Track angle alpha");
1675  layerMEs.meTrackangleRphi->setAxisTitle(("Track angle in "+ label).c_str());
1676  }
1678  layerMEs.meTrackanglebetaRphi = bookME1D(ibooker,"TH1TrackanglebetaRphi",hidmanager.createHistoLayer("Track_angle_beta_Rphi","layer",label,"").c_str() ,"Track angle beta");
1679  layerMEs.meTrackanglebetaRphi->setAxisTitle((""+ label).c_str());
1680  }
1682  layerMEs.meTrackangle2Rphi = bookME1D(ibooker,"TH1Trackangle2Rphi",hidmanager.createHistoLayer("Track_angle2_Rphi","layer",label,"").c_str() ,"");
1683  layerMEs.meTrackangle2Rphi->setAxisTitle((""+ label).c_str());
1684  }
1686  layerMEs.mePullTrackangleProfileRphi = bookMEProfile(ibooker,"TProfPullTrackangleProfileRphi",hidmanager.createHistoLayer("Pull_Trackangle_Profile_Rphi","layer",label,"").c_str() ,"Profile of Pull in MF vs track angle alpha");
1687  layerMEs.mePullTrackangleProfileRphi->setAxisTitle(("Track angle alpha in "+ label).c_str(),1);
1688  layerMEs.mePullTrackangleProfileRphi->setAxisTitle(("Pull (MF) in "+ label).c_str(),2);
1689  }
1691  layerMEs.mePullTrackangle2DRphi = bookME1D(ibooker,"TH1PullTrackangle2DRphi",hidmanager.createHistoLayer("Pull_Trackangle_2D_Rphi","layer",label,"").c_str() ,"");
1692  layerMEs.mePullTrackangle2DRphi->setAxisTitle((""+ label).c_str());
1693  }
1695  layerMEs.meTrackwidthRphi = bookME1D(ibooker,"TH1TrackwidthRphi",hidmanager.createHistoLayer("Track_width_Rphi","layer",label,"").c_str() ,"Track width");
1696  layerMEs.meTrackwidthRphi->setAxisTitle(("Track width in "+ label).c_str());
1697  }
1699  layerMEs.meExpectedwidthRphi = bookME1D(ibooker,"TH1ExpectedwidthRphi",hidmanager.createHistoLayer("Expected_width_Rphi","layer",label,"").c_str() ,"Expected width");
1700  layerMEs.meExpectedwidthRphi->setAxisTitle(("Expected width in "+ label).c_str());
1701  }
1703  layerMEs.meClusterwidthRphi = bookME1D(ibooker,"TH1ClusterwidthRphi",hidmanager.createHistoLayer("Cluster_width_Rphi","layer",label,"").c_str() ,"Cluster width");
1704  layerMEs.meClusterwidthRphi->setAxisTitle(("Cluster width in "+ label).c_str());
1705  }
1707  layerMEs.meCategoryRphi = bookME1D(ibooker,"TH1CategoryRphi",hidmanager.createHistoLayer("Category_Rphi","layer",label,"").c_str() ,"Category");
1708  layerMEs.meCategoryRphi->setAxisTitle(("Category in "+ label).c_str());
1709  }
1711  layerMEs.mePullTrackwidthProfileRphi = bookMEProfile(ibooker,"TProfPullTrackwidthProfileRphi",hidmanager.createHistoLayer("Pull_Track_width_Profile_Rphi","layer",label,"").c_str() ,"Profile of Pull in MF vs track width");
1712  layerMEs.mePullTrackwidthProfileRphi->setAxisTitle(("track width in "+ label).c_str(),1);
1713  layerMEs.mePullTrackwidthProfileRphi->setAxisTitle(("Pull (MF) in "+ label).c_str(),2);
1714  }
1716  layerMEs.mePullTrackwidthProfileRphiwclus1 = bookMEProfile(ibooker,"TProfPullTrackwidthProfileRphiwclus1",hidmanager.createHistoLayer("Pull_Track_width_Profile_Rphi_wclus1","layer",label,"").c_str() ,"Profile of Pull in MF vs track width for w=1");
1717  layerMEs.mePullTrackwidthProfileRphiwclus1->setAxisTitle(("track width for w=1 in "+ label).c_str(),1);
1718  layerMEs.mePullTrackwidthProfileRphiwclus1->setAxisTitle(("Pull (MF) for w=1 in "+ label).c_str(),2);
1719  }
1721  layerMEs.mePullTrackwidthProfileRphiwclus2 = bookMEProfile(ibooker,"TProfPullTrackwidthProfileRphiwclus2",hidmanager.createHistoLayer("Pull_Track_width_Profile_Rphi_wclus2","layer",label,"").c_str() ,"Profile of Pull in MF vs track width for w=2");
1722  layerMEs.mePullTrackwidthProfileRphiwclus2->setAxisTitle(("track width for w=2 in "+ label).c_str(),1);
1723  layerMEs.mePullTrackwidthProfileRphiwclus2->setAxisTitle(("Pull (MF) for w=2 in "+ label).c_str(),2);
1724 
1725  }
1727  layerMEs.mePullTrackwidthProfileRphiwclus3 = bookMEProfile(ibooker,"TProfPullTrackwidthProfileRphiwclus3",hidmanager.createHistoLayer("Pull_Track_width_Profile_Rphi_wclus3","layer",label,"").c_str() ,"Profile of Pull in MF vs track width for w=3");
1728  layerMEs.mePullTrackwidthProfileRphiwclus3->setAxisTitle(("track width for w=3 in "+ label).c_str(),1);
1729  layerMEs.mePullTrackwidthProfileRphiwclus3->setAxisTitle(("Pull (MF) for w=3 in "+ label).c_str(),2);
1730  }
1732  layerMEs.mePullTrackwidthProfileRphiwclus4 = bookMEProfile(ibooker,"TProfPullTrackwidthProfileRphiwclus4",hidmanager.createHistoLayer("Pull_Track_width_Profile_Rphi_wclus4","layer",label,"").c_str() ,"Profile of Pull in MF vs track width for w=4");
1733  layerMEs.mePullTrackwidthProfileRphiwclus4->setAxisTitle(("track width for w=4 in "+ label).c_str(),1);
1734  layerMEs.mePullTrackwidthProfileRphiwclus4->setAxisTitle(("Pull (MF) for w=4 in "+ label).c_str(),2);
1735 
1736  }
1738  layerMEs.mePullTrackwidthProfileCategory1Rphi = bookMEProfile(ibooker,"TProfPullTrackwidthProfileCategory1Rphi",hidmanager.createHistoLayer("Pull_Track_width_Profile_Category1_Rphi","layer",label,"").c_str() ,"Profile of Pull in MF vs track width for Category 1");
1739  layerMEs.mePullTrackwidthProfileCategory1Rphi->setAxisTitle(("track width for Category 1 in "+ label).c_str(),1);
1740  layerMEs.mePullTrackwidthProfileCategory1Rphi->setAxisTitle(("Pull (MF) for Category 1 in "+ label).c_str(),2);
1741  }
1743  layerMEs.mePullTrackwidthProfileCategory2Rphi = bookMEProfile(ibooker,"TProfPullTrackwidthProfileCategory2Rphi",hidmanager.createHistoLayer("Pull_Track_width_Profile_Category2_Rphi","layer",label,"").c_str() ,"Profile of Pull in MF vs track width for Category 2");
1744  layerMEs.mePullTrackwidthProfileCategory2Rphi->setAxisTitle(("track width for Category 2 in "+ label).c_str(),1);
1745  layerMEs.mePullTrackwidthProfileCategory2Rphi->setAxisTitle(("Pull (MF) for Category 2 in "+ label).c_str(),2);
1746  }
1748  layerMEs.mePullTrackwidthProfileCategory3Rphi = bookMEProfile(ibooker,"TProfPullTrackwidthProfileCategory3Rphi",hidmanager.createHistoLayer("Pull_Track_width_Profile_Category3_Rphi","layer",label,"").c_str() ,"Profile of Pull in MF vs track width for Category 3");
1749  layerMEs.mePullTrackwidthProfileCategory3Rphi->setAxisTitle(("track width for Category 3 in "+ label).c_str(),1);
1750  layerMEs.mePullTrackwidthProfileCategory3Rphi->setAxisTitle(("Pull (MF) for Category 3 in "+ label).c_str(),2);
1751  }
1753  layerMEs.mePullTrackwidthProfileCategory4Rphi = bookMEProfile(ibooker,"TProfPullTrackwidthProfileCategory4Rphi",hidmanager.createHistoLayer("Pull_Track_width_Profile_Category4_Rphi","layer",label,"").c_str() ,"Profile of Pull in MF vs track width for Category 4");
1754  layerMEs.mePullTrackwidthProfileCategory4Rphi->setAxisTitle(("track width for Category 4 in "+ label).c_str(),1);
1755  layerMEs.mePullTrackwidthProfileCategory4Rphi->setAxisTitle(("Pull (MF) for Category 4 in "+ label).c_str(),2);
1756  }
1758  layerMEs.meResolxMFTrackwidthProfileRphi = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfileRphi",hidmanager.createHistoLayer("ResolxMF_Track_width_Profile_Rphi","layer",label,"").c_str() ,"Profile of Resolution in MF vs track width");
1759  layerMEs.meResolxMFTrackwidthProfileRphi->setAxisTitle(("track width in "+ label).c_str(),1);
1760  layerMEs.meResolxMFTrackwidthProfileRphi->setAxisTitle(("Resolution in MF in "+ label).c_str(),2);
1761  }
1762 
1764  layerMEs.meResolxMFTrackwidthProfileWclus1Rphi = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfileWclus1Rphi",hidmanager.createHistoLayer("ResolxMF_Track_width_Profile_Wclus1_Rphi","layer",label,"").c_str() ,"Profile of Resolution in MF vs track width for w=1");
1765  layerMEs.meResolxMFTrackwidthProfileWclus1Rphi->setAxisTitle(("track width for w=1 in "+ label).c_str(),1);
1766  layerMEs.meResolxMFTrackwidthProfileWclus1Rphi->setAxisTitle(("Resolution in MF for w=1 in "+ label).c_str(),2);
1767  }
1769  layerMEs.meResolxMFTrackwidthProfileWclus2Rphi = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfileWclus2Rphi",hidmanager.createHistoLayer("ResolxMF_Track_width_Profile_Wclus2_Rphi","layer",label,"").c_str() ,"Profile of Resolution in MF vs track width for w=2");
1770  layerMEs.meResolxMFTrackwidthProfileWclus2Rphi->setAxisTitle(("track width for w=2 in "+ label).c_str(),1);
1771  layerMEs.meResolxMFTrackwidthProfileWclus2Rphi->setAxisTitle(("Resolution in MF for w=2 in "+ label).c_str(),2);
1772  }
1774  layerMEs.meResolxMFTrackwidthProfileWclus3Rphi = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfileWclus3Rphi",hidmanager.createHistoLayer("ResolxMF_Track_width_Profile_Wclus3_Rphi","layer",label,"").c_str() ,"Profile of Resolution in MF vs track width for w=3");
1775  layerMEs.meResolxMFTrackwidthProfileWclus3Rphi->setAxisTitle(("track width for w=3 in "+ label).c_str(),1);
1776  layerMEs.meResolxMFTrackwidthProfileWclus3Rphi->setAxisTitle(("Resolution in MF for w=3 in "+ label).c_str(),2);
1777  }
1779  layerMEs.meResolxMFTrackwidthProfileWclus4Rphi = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfileWclus4Rphi",hidmanager.createHistoLayer("ResolxMF_Track_width_Profile_Wclus4_Rphi","layer",label,"").c_str() ,"Profile of Resolution in MF vs track width for w=4");
1780  layerMEs.meResolxMFTrackwidthProfileWclus4Rphi->setAxisTitle(("track width for w=4 in "+ label).c_str(),1);
1781  layerMEs.meResolxMFTrackwidthProfileWclus4Rphi->setAxisTitle(("Resolution in MF for w=4 in "+ label).c_str(),2);
1782  }
1784  layerMEs.meResMFTrackwidthProfileWclus1Rphi = bookMEProfile(ibooker,"TProfResMFTrackwidthProfileWclus1Rphi",hidmanager.createHistoLayer("ResMF_Track_width_Profile_Wclus1_Rphi","layer",label,"").c_str() ,"Profile of Residuals(x) in MF vs track width for w=1");
1785  layerMEs.meResMFTrackwidthProfileWclus1Rphi->setAxisTitle(("track width for w=1 in "+ label).c_str(),1);
1786  layerMEs.meResMFTrackwidthProfileWclus1Rphi->setAxisTitle(("Residuals(x) in MF for w=1 in "+ label).c_str(),2);
1787  }
1789  layerMEs.meResMFTrackwidthProfileWclus2Rphi = bookMEProfile(ibooker,"TProfResMFTrackwidthProfileWclus2Rphi",hidmanager.createHistoLayer("ResMF_Track_width_Profile_Wclus2_Rphi","layer",label,"").c_str() ,"Profile of Residuals(x) in MF vs track width for w=2");
1790  layerMEs.meResMFTrackwidthProfileWclus2Rphi->setAxisTitle(("track width for w=2 in "+ label).c_str(),1);
1791  layerMEs.meResMFTrackwidthProfileWclus2Rphi->setAxisTitle(("Residuals(x) in MF for w=2 in "+ label).c_str(),2);
1792  }
1794  layerMEs.meResMFTrackwidthProfileWclus3Rphi = bookMEProfile(ibooker,"TProfResMFTrackwidthProfileWclus3Rphi",hidmanager.createHistoLayer("ResMF_Track_width_Profile_Wclus3_Rphi","layer",label,"").c_str() ,"Profile of Residuals(x) in MF vs track width for w=3");
1795  layerMEs.meResMFTrackwidthProfileWclus3Rphi->setAxisTitle(("track width for w=3 in "+ label).c_str(),1);
1796  layerMEs.meResMFTrackwidthProfileWclus3Rphi->setAxisTitle(("Residuals(x) in MF for w=3 in "+ label).c_str(),2);
1797  }
1799  layerMEs.meResMFTrackwidthProfileWclus4Rphi = bookMEProfile(ibooker,"TProfResMFTrackwidthProfileWclus4Rphi",hidmanager.createHistoLayer("ResMF_Track_width_Profile_Wclus4_Rphi","layer",label,"").c_str() ,"Profile of Residuals(x) in MF vs track width for w=4");
1800  layerMEs.meResMFTrackwidthProfileWclus4Rphi->setAxisTitle(("track width for w=4 in "+ label).c_str(),1);
1801  layerMEs.meResMFTrackwidthProfileWclus4Rphi->setAxisTitle(("Residuals(x) in MF for w=4 in "+ label).c_str(),2);
1802  }
1803 
1805  layerMEs.meResolxMFTrackwidthProfileCategory1Rphi = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfileCategory1Rphi",hidmanager.createHistoLayer("ResolxMF_Track_width_Profile_Category1_Rphi","layer",label,"").c_str() ,"Profile of Resolution in MF vs track width for Category 1");
1806  layerMEs.meResolxMFTrackwidthProfileCategory1Rphi->setAxisTitle(("track width for Category 1 in "+ label).c_str(),1);
1807  layerMEs.meResolxMFTrackwidthProfileCategory1Rphi->setAxisTitle(("Resolution in MF for Category 1 in "+ label).c_str(),2);
1808  }
1810  layerMEs.meResolxMFTrackwidthProfileCategory2Rphi = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfileCategory2Rphi",hidmanager.createHistoLayer("ResolxMF_Track_width_Profile_Category2_Rphi","layer",label,"").c_str() ,"Profile of Resolution in MF vs track width for Category 2");
1811  layerMEs.meResolxMFTrackwidthProfileCategory2Rphi->setAxisTitle(("track width for Category 2 in "+ label).c_str(),1);
1812  layerMEs.meResolxMFTrackwidthProfileCategory2Rphi->setAxisTitle(("Resolution in MF for Category 2 in "+ label).c_str(),2);
1813  }
1815  layerMEs.meResolxMFTrackwidthProfileCategory3Rphi = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfileCategory3Rphi",hidmanager.createHistoLayer("ResolxMF_Track_width_Profile_Category3_Rphi","layer",label,"").c_str() ,"Profile of Resolution in MF vs track width for Category 3");
1816  layerMEs.meResolxMFTrackwidthProfileCategory3Rphi->setAxisTitle(("track width for Category 3 in "+ label).c_str(),1);
1817  layerMEs.meResolxMFTrackwidthProfileCategory3Rphi->setAxisTitle(("Resolution in MF for Category 3 in "+ label).c_str(),2);
1818  }
1820  layerMEs.meResolxMFTrackwidthProfileCategory4Rphi = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfileCategory4Rphi",hidmanager.createHistoLayer("ResolxMF_Track_width_Profile_Category3_Rphi","layer",label,"").c_str() ,"Profile of Resolution in MF vs track width for Category 4");
1821  layerMEs.meResolxMFTrackwidthProfileCategory4Rphi->setAxisTitle(("track width for Category 4 in "+ label).c_str(),1);
1822  layerMEs.meResolxMFTrackwidthProfileCategory4Rphi->setAxisTitle(("Resolution in MF for Category 4 in "+ label).c_str(),2);
1823  }
1825  layerMEs.meResolxMFClusterwidthProfileCategory1Rphi = bookMEProfile(ibooker,"TProfResolxMFClusterwidthProfileCategory1Rphi",hidmanager.createHistoLayer("ResolxMF_Cluster_width_Profile_Category1_Rphi","layer",label,"").c_str() ,"Profile of Resolution in MF vs cluster width for Category 1");
1826  layerMEs.meResolxMFClusterwidthProfileCategory1Rphi->setAxisTitle(("cluster width for Category 1 in "+ label).c_str(),1);
1827  layerMEs.meResolxMFClusterwidthProfileCategory1Rphi->setAxisTitle(("Resolution in MF for Category 1 in "+ label).c_str(),2);
1828  }
1830  layerMEs.meResolxMFAngleProfileRphi = bookMEProfile(ibooker,"TProfResolxMFAngleProfileRphi",hidmanager.createHistoLayer("ResolxMF_Angle_Profile_Rphi","layer",label,"").c_str() ,"Profile of Resolution in MF vs track angle alpha");
1831  layerMEs.meResolxMFAngleProfileRphi->setAxisTitle(("track angle alpha in "+ label).c_str(),1);
1832  layerMEs.meResolxMFAngleProfileRphi->setAxisTitle(("Resolution in MF in "+ label).c_str(),2);
1833  }
1835  layerMEs.merapidityResProfilewclus1 = bookMEProfile(ibooker,"TProfrapidityResProfilewclus1",hidmanager.createHistoLayer("rapidity_Res_Profile_wclus1","layer",label,"").c_str() ,"Profile of rapidity vs Res for w=1");
1836  layerMEs.merapidityResProfilewclus1->setAxisTitle(("Res for w=1 in "+ label).c_str(),1);
1837  layerMEs.merapidityResProfilewclus1->setAxisTitle(("rapidity for w=1 in "+ label).c_str(),2);
1838  }
1840  layerMEs.merapidityResProfilewclus2 = bookMEProfile(ibooker,"TProfrapidityResProfilewclus2",hidmanager.createHistoLayer("rapidity_Res_Profile_wclus2","layer",label,"").c_str() ,"Profile of rapidity vs Res for w=2");
1841  layerMEs.merapidityResProfilewclus2->setAxisTitle(("Res for w=2 in "+ label).c_str(),1);
1842  layerMEs.merapidityResProfilewclus2->setAxisTitle(("rapidity for w=2 in "+ label).c_str(),2);
1843  }
1845  layerMEs.merapidityResProfilewclus3 = bookMEProfile(ibooker,"TProfrapidityResProfilewclus3",hidmanager.createHistoLayer("rapidity_Res_Profile_wclus3","layer",label,"").c_str() ,"Profile of rapidity vs Res for w=3");
1846  layerMEs.merapidityResProfilewclus3->setAxisTitle(("Res for w=3 in "+ label).c_str(),1);
1847  layerMEs.merapidityResProfilewclus3->setAxisTitle(("rapidity for w=3 in "+ label).c_str(),2);
1848  }
1850  layerMEs.merapidityResProfilewclus4 = bookMEProfile(ibooker,"TProfrapidityResProfilewclus4",hidmanager.createHistoLayer("rapidity_Res_Profile_wclus4","layer",label,"").c_str() ,"Profile of rapidity vs Res for w=4");
1851  layerMEs.merapidityResProfilewclus4->setAxisTitle(("Res for w=4 in "+ label).c_str(),1);
1852  layerMEs.merapidityResProfilewclus4->setAxisTitle(("rapidity for w=4 in "+ label).c_str(),2);
1853  }
1854 
1855 
1856  LayerMEsMap[label]=layerMEs;
1857 
1858 }
1859 //------------------------------------------------------------------------------------------
1861 {
1862  SiStripHistoId hidmanager;
1863  StereoAndMatchedMEs stereoandmatchedMEs;
1864 
1865  stereoandmatchedMEs.meWclusSas = 0;
1866  stereoandmatchedMEs.meAdcSas = 0;
1867  stereoandmatchedMEs.meResolxLFSas = 0;
1868  stereoandmatchedMEs.meResolxMFSas = 0;
1869  stereoandmatchedMEs.meResLFSas = 0;
1870  stereoandmatchedMEs.meResMFSas = 0;
1871  stereoandmatchedMEs.mePullLFSas = 0;
1872  stereoandmatchedMEs.mePullMFSas = 0;
1873  stereoandmatchedMEs.meTrackangleSas = 0;
1874  stereoandmatchedMEs.meTrackanglebetaSas = 0;
1875  stereoandmatchedMEs.mePullTrackangleProfileSas = 0;
1876  stereoandmatchedMEs.meTrackwidthSas = 0;
1877  stereoandmatchedMEs.meExpectedwidthSas = 0;
1878  stereoandmatchedMEs.meClusterwidthSas = 0;
1879  stereoandmatchedMEs.meCategorySas = 0;
1880  stereoandmatchedMEs.mePullTrackwidthProfileSas = 0;
1881  stereoandmatchedMEs.mePullTrackwidthProfileCategory1Sas = 0;
1882  stereoandmatchedMEs.mePullTrackwidthProfileCategory2Sas = 0;
1883  stereoandmatchedMEs.mePullTrackwidthProfileCategory3Sas = 0;
1884  stereoandmatchedMEs.mePullTrackwidthProfileCategory4Sas = 0;
1885  stereoandmatchedMEs.meResolxMFTrackwidthProfileSas = 0;
1886  stereoandmatchedMEs.meResolxMFTrackwidthProfileCategory1Sas = 0;
1887  stereoandmatchedMEs.meResolxMFTrackwidthProfileCategory2Sas = 0;
1888  stereoandmatchedMEs.meResolxMFTrackwidthProfileCategory3Sas = 0;
1889  stereoandmatchedMEs.meResolxMFTrackwidthProfileCategory4Sas = 0;
1890  stereoandmatchedMEs.meResolxMFClusterwidthProfileCategory1Sas = 0;
1891  stereoandmatchedMEs.meResolxMFAngleProfileSas = 0;
1892 
1893  stereoandmatchedMEs.mePosxMatched = 0;
1894  stereoandmatchedMEs.mePosyMatched = 0;
1895  stereoandmatchedMEs.meResolxMatched = 0;
1896  stereoandmatchedMEs.meResolyMatched = 0;
1897  stereoandmatchedMEs.meResxMatched = 0;
1898  stereoandmatchedMEs.meResyMatched = 0;
1899  stereoandmatchedMEs.mePullxMatched = 0;
1900  stereoandmatchedMEs.mePullyMatched = 0;
1901 
1902  //WclusSas
1903  if(layerswitchWclusSas) {
1904  stereoandmatchedMEs.meWclusSas = bookME1D(ibooker,"TH1WclusSas", hidmanager.createHistoLayer("Wclus_sas","layer",label,"").c_str() ,"Cluster Width - Number of strips that belong to the RecHit cluster");
1905  stereoandmatchedMEs.meWclusSas->setAxisTitle(("Cluster Width [nr strips] (stereo) in "+ label).c_str());
1906  }
1907  //AdcSas
1908  if(layerswitchAdcSas) {
1909  stereoandmatchedMEs.meAdcSas = bookME1D(ibooker,"TH1AdcSas", hidmanager.createHistoLayer("Adc_sas","layer",label,"").c_str() ,"RecHit Cluster Charge");
1910  stereoandmatchedMEs.meAdcSas->setAxisTitle(("cluster charge [ADC] (stereo) in " + label).c_str());
1911  }
1912  //ResolxLFSas
1914  stereoandmatchedMEs.meResolxLFSas = bookME1D(ibooker,"TH1ResolxLFSas", hidmanager.createHistoLayer("Resolx_LF_sas","layer",label,"").c_str() ,"RecHit resol(x) coord.");
1915  stereoandmatchedMEs.meResolxLFSas->setAxisTitle(("resol(x) RecHit coord. (local frame) (stereo) in " + label).c_str());
1916  }
1917  //ResolxMFSas
1919  stereoandmatchedMEs.meResolxMFSas = bookME1D(ibooker,"TH1ResolxMFSas", hidmanager.createHistoLayer("Resolx_MF_sas","layer",label,"").c_str() ,"RecHit resol(x) coord.");
1920  stereoandmatchedMEs.meResolxMFSas->setAxisTitle(("resol(x) RecHit coord. (measurement frame) (stereo) in " + label).c_str());
1921  }
1922  //ResLFSas
1923  if(layerswitchResLFSas) {
1924  stereoandmatchedMEs.meResLFSas = bookME1D(ibooker,"TH1ResLFSas", hidmanager.createHistoLayer("Res_LF_sas","layer",label,"").c_str() ,"Residual of the hit x coordinate");
1925  stereoandmatchedMEs.meResLFSas->setAxisTitle(("Hit Residuals(x) (local frame) (stereo) in " + label).c_str());
1926  }
1927  //ResMFSas
1928  if(layerswitchResMFSas) {
1929  stereoandmatchedMEs.meResMFSas = bookME1D(ibooker,"TH1ResMFSas", hidmanager.createHistoLayer("Res_MF_sas","layer",label,"").c_str() ,"Residual of the hit x coordinate");
1930  stereoandmatchedMEs.meResMFSas->setAxisTitle(("Hit Residuals(x) (stereo) in " + label).c_str());
1931  }
1932  //PullLFSas
1933  if(layerswitchPullLFSas) {
1934  stereoandmatchedMEs.mePullLFSas = bookME1D(ibooker,"TH1PullLFSas", hidmanager.createHistoLayer("Pull_LF_sas","layer",label,"").c_str() ,"Pull distribution");
1935  stereoandmatchedMEs.mePullLFSas->setAxisTitle(("Pull distribution (local frame) (stereo) in " + label).c_str());
1936  }
1937  //PullMFSas
1938  if(layerswitchPullMFSas) {
1939  stereoandmatchedMEs.mePullMFSas = bookME1D(ibooker,"TH1PullMFSas", hidmanager.createHistoLayer("Pull_MF_sas","layer",label,"").c_str() ,"Pull distribution");
1940  stereoandmatchedMEs.mePullMFSas->setAxisTitle(("Pull distribution (measurement frame) (stereo) in " + label).c_str());
1941  }
1942 
1944  stereoandmatchedMEs.meTrackangleSas = bookME1D(ibooker,"TH1TrackangleSas",hidmanager.createHistoLayer("Track_angle_Sas","layer",label,"").c_str() ,"Track angle");
1945  stereoandmatchedMEs.meTrackangleSas->setAxisTitle(("Track angle (stereo) in " + label).c_str());
1946  }
1948  stereoandmatchedMEs.meTrackanglebetaSas = bookME1D(ibooker,"TH1TrackanglebetaSas",hidmanager.createHistoLayer("Track_angle_beta_Sas","layer",label,"").c_str() ,"Track angle beta");
1949  stereoandmatchedMEs.meTrackanglebetaSas->setAxisTitle(("Track angle beta (stereo) in " + label).c_str());
1950  }
1952  stereoandmatchedMEs.mePullTrackangleProfileSas = bookMEProfile(ibooker,"TProfPullTrackangleProfileSas",hidmanager.createHistoLayer("Pull_Track_angle_Profile_Sas","layer",label,"").c_str() ,"Profile of Pull in MF vs track angle (stereo)");
1953  stereoandmatchedMEs.mePullTrackangleProfileSas->setAxisTitle(("track angle (stereo) in " + label).c_str(),1);
1954  stereoandmatchedMEs.mePullTrackangleProfileSas->setAxisTitle(("Pull in MF (stereo) in " + label).c_str(),2);
1955  }
1957  stereoandmatchedMEs.meTrackwidthSas = bookME1D(ibooker,"TH1TrackwidthSas",hidmanager.createHistoLayer("Track_width_Sas","layer",label,"").c_str() ,"Track width");
1958  stereoandmatchedMEs.meTrackwidthSas->setAxisTitle(("Track width (stereo) in " + label).c_str());
1959  }
1961  stereoandmatchedMEs.meExpectedwidthSas = bookME1D(ibooker,"TH1ExpectedwidthSas",hidmanager.createHistoLayer("Expected_width_Sas","layer",label,"").c_str() ,"Expected width");
1962  stereoandmatchedMEs.meExpectedwidthSas->setAxisTitle(("Expected width (stereo) in " + label).c_str());
1963  }
1965  stereoandmatchedMEs.meClusterwidthSas = bookME1D(ibooker,"TH1ClusterwidthSas",hidmanager.createHistoLayer("Cluster_width_Sas","layer",label,"").c_str() ,"Cluster width");
1966  stereoandmatchedMEs.meClusterwidthSas->setAxisTitle(("Cluster width (stereo) in " + label).c_str());
1967  }
1969  stereoandmatchedMEs.meCategorySas = bookME1D(ibooker,"TH1CategorySas",hidmanager.createHistoLayer("Category_Sas","layer",label,"").c_str() ,"Category");
1970  stereoandmatchedMEs.meCategorySas->setAxisTitle(("Category (stereo) in " + label).c_str());
1971  }
1973  stereoandmatchedMEs.mePullTrackwidthProfileSas = bookMEProfile(ibooker,"TProfPullTrackwidthProfileSas",hidmanager.createHistoLayer("Pull_Track_width_Profile_Sas","layer",label,"").c_str() ,"Profile of Pull in MF vs track width (stereo)");
1974  stereoandmatchedMEs.mePullTrackwidthProfileSas->setAxisTitle(("track width (stereo) in " + label).c_str(),1);
1975  stereoandmatchedMEs.mePullTrackwidthProfileSas->setAxisTitle(("Pull in MF (stereo) in " + label).c_str(),2);
1976  }
1978  stereoandmatchedMEs.mePullTrackwidthProfileCategory1Sas = bookMEProfile(ibooker,"TProfPullTrackwidthProfileCategory1Sas",hidmanager.createHistoLayer("Pull_Track_width_Profile_Category1_Sas","layer",label,"").c_str() ,"Profile of Pull in MF vs track width (Category 1) (stereo)");
1979  stereoandmatchedMEs.mePullTrackwidthProfileCategory1Sas->setAxisTitle(("track width (Category 1) (stereo) in " + label).c_str(),1);
1980  stereoandmatchedMEs.mePullTrackwidthProfileCategory1Sas->setAxisTitle(("Pull in MF (Category 1) (stereo) in " + label).c_str(),2);
1981  }
1983  stereoandmatchedMEs.mePullTrackwidthProfileCategory2Sas = bookMEProfile(ibooker,"TProfPullTrackwidthProfileCategory2Sas",hidmanager.createHistoLayer("Pull_Track_width_Profile_Category2_Sas","layer",label,"").c_str() ,"Profile of Pull in MF vs track width (Category 2) (stereo)");
1984  stereoandmatchedMEs.mePullTrackwidthProfileCategory2Sas->setAxisTitle(("track width (Category 2) (stereo) in " + label).c_str(),1);
1985  stereoandmatchedMEs.mePullTrackwidthProfileCategory2Sas->setAxisTitle(("Pull in MF (Category 2) (stereo) in " + label).c_str(),2);
1986  }
1988  stereoandmatchedMEs.mePullTrackwidthProfileCategory3Sas = bookMEProfile(ibooker,"TProfPullTrackwidthProfileCategory3Sas",hidmanager.createHistoLayer("Pull_Track_width_Profile_Category3_Sas","layer",label,"").c_str() ,"Profile of Pull in MF vs track width (Category 3) (stereo)");
1989  stereoandmatchedMEs.mePullTrackwidthProfileCategory3Sas->setAxisTitle(("track width (Category 3) (stereo) in " + label).c_str(),1);
1990  stereoandmatchedMEs.mePullTrackwidthProfileCategory3Sas->setAxisTitle(("Pull in MF (Category 3) (stereo) in " + label).c_str(),2);
1991  }
1993  stereoandmatchedMEs.mePullTrackwidthProfileCategory4Sas = bookMEProfile(ibooker,"TProfPullTrackwidthProfileCategory4Sas",hidmanager.createHistoLayer("Pull_Track_width_Profile_Category4_Sas","layer",label,"").c_str() ,"Profile of Pull in MF vs track width (Category 4) (stereo)");
1994  stereoandmatchedMEs.mePullTrackwidthProfileCategory4Sas->setAxisTitle(("track width (Category 4) (stereo) in " + label).c_str(),1);
1995  stereoandmatchedMEs.mePullTrackwidthProfileCategory4Sas->setAxisTitle(("Pull in MF (Category 4) (stereo) in " + label).c_str(),2);
1996  }
1998  stereoandmatchedMEs.meResolxMFTrackwidthProfileSas = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfileSas",hidmanager.createHistoLayer("ResolxMF_Track_width_Profile_Sas","layer",label,"").c_str() ,"Profile of Resolution in MF vs track width (stereo)");
1999  stereoandmatchedMEs.meResolxMFTrackwidthProfileSas->setAxisTitle(("track width (stereo) in " + label).c_str(),1);
2000  stereoandmatchedMEs.meResolxMFTrackwidthProfileSas->setAxisTitle(("Resolution in MF (stereo) in " + label).c_str(),2);
2001  }
2003  stereoandmatchedMEs.meResolxMFTrackwidthProfileCategory1Sas = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfileCategory1Sas",hidmanager.createHistoLayer("ResolxMF_Track_width_Profile_Category1_Sas","layer",label,"").c_str() ,"Profile of Resolution in MF vs track width (Category 1) (stereo)");
2004  stereoandmatchedMEs.meResolxMFTrackwidthProfileCategory1Sas->setAxisTitle((" track width (Category 1) (stereo) in " + label).c_str(),1);
2005  stereoandmatchedMEs.meResolxMFTrackwidthProfileCategory1Sas->setAxisTitle((" Resolution in MF (Category 1) (stereo) in " + label).c_str(),2);
2006  }
2008  stereoandmatchedMEs.meResolxMFTrackwidthProfileCategory2Sas = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfileCategory2Sas",hidmanager.createHistoLayer("ResolxMF_Track_width_Profile_Category2_Sas","layer",label,"").c_str() ,"Profile of Resolution in MF vs track width (Category 2) (stereo)");
2009  stereoandmatchedMEs.meResolxMFTrackwidthProfileCategory2Sas->setAxisTitle((" track width (Category 2) (stereo) in " + label).c_str(),1);
2010  stereoandmatchedMEs.meResolxMFTrackwidthProfileCategory2Sas->setAxisTitle((" Resolution in MF (Category 2) (stereo) in " + label).c_str(),2);
2011  }
2013  stereoandmatchedMEs.meResolxMFTrackwidthProfileCategory3Sas = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfileCategory3Sas",hidmanager.createHistoLayer("ResolxMF_Track_width_Profile_Category3_Sas","layer",label,"").c_str() ,"Profile of Resolution in MF vs track width (Category 3) (stereo)");
2014  stereoandmatchedMEs.meResolxMFTrackwidthProfileCategory3Sas->setAxisTitle((" track width (Category 3) (stereo) in " + label).c_str(),1);
2015  stereoandmatchedMEs.meResolxMFTrackwidthProfileCategory3Sas->setAxisTitle((" Resolution in MF (Category 3) (stereo) in " + label).c_str(),2);
2016  }
2018  stereoandmatchedMEs.meResolxMFTrackwidthProfileCategory4Sas = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfileCategory4Sas",hidmanager.createHistoLayer("ResolxMF_Track_width_Profile_Category4_Sas","layer",label,"").c_str() ,"Profile of Resolution in MF vs track width (Category 4) (stereo)");
2019  stereoandmatchedMEs.meResolxMFTrackwidthProfileCategory4Sas->setAxisTitle((" track width (Category 4) (stereo) in " + label).c_str(),1);
2020  stereoandmatchedMEs.meResolxMFTrackwidthProfileCategory4Sas->setAxisTitle((" Resolution in MF (Category 4) (stereo) in " + label).c_str(),2);
2021  }
2023  stereoandmatchedMEs.meResolxMFClusterwidthProfileCategory1Sas = bookMEProfile(ibooker,"TProfResolxMFClusterwidthProfileCategory1Sas",hidmanager.createHistoLayer("ResolxMF_Cluster_width_Profile_Category1_Sas","layer",label,"").c_str() ,"Profile of Resolution in MF vs cluster width (Category 1) (stereo)");
2024  stereoandmatchedMEs.meResolxMFClusterwidthProfileCategory1Sas->setAxisTitle(("cluster width (Category 1) (stereo) in " + label).c_str(),1);
2025  stereoandmatchedMEs.meResolxMFClusterwidthProfileCategory1Sas->setAxisTitle((" Resolution in MF (Category 1) (stereo) in " + label).c_str(),2);
2026  }
2028  stereoandmatchedMEs.meResolxMFAngleProfileSas = bookMEProfile(ibooker,"TProfResolxMFAngleProfileSas",hidmanager.createHistoLayer("ResolxMF_Angle_Profile_Sas","layer",label,"").c_str() ,"Profile of Resolution in MF vs track angle (stereo)");
2029  stereoandmatchedMEs.meResolxMFAngleProfileSas->setAxisTitle(("track angle (stereo) in " + label).c_str(),1);
2030  stereoandmatchedMEs.meResolxMFAngleProfileSas->setAxisTitle(("Resolution in MF (stereo) in " + label).c_str(),2);
2031  }
2032  //PosxMatched
2034  stereoandmatchedMEs.mePosxMatched = bookME1D(ibooker,"TH1PosxMatched", hidmanager.createHistoLayer("Posx_matched","layer",label,"").c_str() ,"RecHit x coord.");
2035  stereoandmatchedMEs.mePosxMatched->setAxisTitle(("x coord. matched RecHit (local frame) in " + label).c_str());
2036  }
2037  //PosyMatched
2039  stereoandmatchedMEs.mePosyMatched = bookME1D(ibooker,"TH1PosyMatched", hidmanager.createHistoLayer("Posy_matched","layer",label,"").c_str() ,"RecHit y coord.");
2040  stereoandmatchedMEs.mePosyMatched->setAxisTitle(("y coord. matched RecHit (local frame) in " + label).c_str());
2041  }
2042  //ResolxMatched
2044  stereoandmatchedMEs.meResolxMatched = bookME1D(ibooker,"TH1ResolxMatched", hidmanager.createHistoLayer("Resolx_matched","layer",label,"").c_str() ,"RecHit resol(x) coord.");
2045  stereoandmatchedMEs.meResolxMatched->setAxisTitle(("resol(x) coord. matched RecHit (local frame) in " + label).c_str());
2046  }
2047  //ResolyMatched
2049  stereoandmatchedMEs.meResolyMatched = bookME1D(ibooker,"TH1ResolyMatched", hidmanager.createHistoLayer("Resoly_matched","layer",label,"").c_str() ,"RecHit resol(y) coord.");
2050  stereoandmatchedMEs.meResolyMatched->setAxisTitle(("resol(y) coord. matched RecHit (local frame) in " + label).c_str());
2051  }
2052  //ResxMatched
2054  stereoandmatchedMEs.meResxMatched = bookME1D(ibooker,"TH1ResxMatched", hidmanager.createHistoLayer("Resx_matched","layer",label,"").c_str() ,"Residual of the hit x coord.");
2055  stereoandmatchedMEs.meResxMatched->setAxisTitle(("Residuals(x) in matched RecHit in " + label).c_str());
2056  }
2057  //ResyMatched
2059  stereoandmatchedMEs.meResyMatched = bookME1D(ibooker,"TH1ResyMatched", hidmanager.createHistoLayer("Resy_matched","layer",label,"").c_str() ,"Residual of the hit x coord.");
2060  stereoandmatchedMEs.meResyMatched->setAxisTitle(("Res(y) in matched RecHit in " + label).c_str());
2061  }
2062 
2063  StereoAndMatchedMEsMap[label]=stereoandmatchedMEs;
2064 
2065 }
2066 //------------------------------------------------------------------------------------------
2067 inline MonitorElement* SiStripTrackingRecHitsValid::bookME1D(DQMStore::IBooker & ibooker,const char* ParameterSetLabel, const char* HistoName, const char* HistoTitle)
2068 {
2069  Parameters = conf_.getParameter<edm::ParameterSet>(ParameterSetLabel);
2070  return ibooker.book1D(HistoName,HistoTitle,
2071  Parameters.getParameter<int32_t>("Nbinx"),
2072  Parameters.getParameter<double>("xmin"),
2073  Parameters.getParameter<double>("xmax")
2074  );
2075 }
2076 //------------------------------------------------------------------------------------------
2077 inline MonitorElement* SiStripTrackingRecHitsValid::bookMEProfile(DQMStore::IBooker & ibooker,const char* ParameterSetLabel, const char* HistoName, const char* HistoTitle)
2078 {
2079  Parameters = conf_.getParameter<edm::ParameterSet>(ParameterSetLabel);
2080  //The number of channels in Y is disregarded in a profile plot.
2081  return ibooker.bookProfile(HistoName,HistoTitle,
2082  Parameters.getParameter<int32_t>("Nbinx"),
2083  Parameters.getParameter<double>("xmin"),
2084  Parameters.getParameter<double>("xmax"),
2085  Parameters.getParameter<double>("ymin"),
2086  Parameters.getParameter<double>("ymax"),
2087  ""
2088  );
2089 }
2090 
2091 // DEFINE_FWK_MODULE(SiStripTrackingRecHitsValid);
RunNumber_t run() const
Definition: EventID.h:39
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:106
T getParameter(std::string const &) const
SiStripTrackingRecHitsValid(const edm::ParameterSet &conf)
EventNumber_t event() const
Definition: EventID.h:41
const TrackerGeomDet * idToDetUnit(DetId) const
Return the pointer to the GeomDetUnit corresponding to a given DetId.
edm::ESHandle< SiStripDetCabling > SiStripDetCabling_
void rechitanalysis_matched(LocalVector ldir, const TrackingRecHit *rechit, const GluedGeomDet *gluedDet, TrackerHitAssociator &associate, edm::ESHandle< StripClusterParameterEstimator > stripcpe, const MatchStatus matchedmonorstereo)
float xx() const
Definition: LocalError.h:24
void addActiveDetectorsRawIds(std::vector< uint32_t > &) const
void setSiStripFolderName(std::string name)
const GeomDetUnit * monoDet() const
Definition: GluedGeomDet.h:20
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
std::map< std::string, StereoAndMatchedMEs > StereoAndMatchedMEsMap
bool tobIsStereo(const DetId &id) const
MonitorElement * bookME1D(DQMStore::IBooker &ibooker, const char *ParameterSetLabel, const char *HistoName, const char *HistoTitle)
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:157
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
void fillME(MonitorElement *ME, float value1)
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:54
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
LocalVector drift(const StripGeomDetUnit *, const MagneticField &, const SiStripLorentzAngle &)
Definition: ShallowTools.cc:38
T y() const
Definition: PV3DBase.h:63
std::map< std::string, LayerMEs > LayerMEsMap
virtual float strip(const LocalPoint &) const =0
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:69
std::pair< std::string, int32_t > GetSubDetAndLayer(const uint32_t &detid, const TrackerTopology *tTopo, bool ring_flag=0)
#define NULL
Definition: scimark2.h:8
const Bounds & bounds() const
Definition: Surface.h:120
void createLayerMEs(DQMStore::IBooker &ibooker, std::string label)
virtual const StripTopology & specificTopology() const
Returns a reference to the strip proxy topology.
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
bool tidIsStereo(const DetId &id) const
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
bool tecIsStereo(const DetId &id) const
float xy() const
Definition: LocalError.h:25
void createSimpleHitsMEs(DQMStore::IBooker &ibooker)
vector< ParameterSet > Parameters
void getTOBDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tobDetRawIds, uint32_t layer=0, uint32_t bkw_frw=0, uint32_t rod=0) const
float yy() const
Definition: LocalError.h:26
Local3DPoint localPosition() const
Definition: PSimHit.h:44
virtual float stripAngle(float strip) const =0
T sqrt(T t)
Definition: SSEVec.h:18
T z() const
Definition: PV3DBase.h:64
void bookHistograms(DQMStore::IBooker &ibooker, const edm::Run &run, const edm::EventSetup &es)
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
virtual MeasurementPoint measurementPosition(const LocalPoint &) const =0
float uu() const
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
TrackerHitAssociator::Config trackerHitAssociatorConfig_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
edm::EDGetTokenT< std::vector< reco::Track > > tracksInputToken_
ClusterRef cluster() const
virtual LocalPoint localPosition() const final
T min(T a, T b)
Definition: MathUtil.h:58
virtual void analyze(const edm::Event &e, const edm::EventSetup &c)
std::string getSubdetid(uint32_t id, const TrackerTopology *tTopo, bool flag_ring)
virtual LocalPoint localPosition() const =0
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
void createMEs(DQMStore::IBooker &ibooker, const edm::EventSetup &es)
DQMStore * dbe_
std::pair< LocalPoint, LocalVector > projectHit(const PSimHit &hit, const StripGeomDetUnit *stripDet, const BoundPlane &plane)
MonitorElement * bookMEProfile(DQMStore::IBooker &ibooker, const char *ParameterSetLabel, const char *HistoName, const char *HistoTitle)
LocalVector localDirection() const
Obsolete. Same as momentumAtEntry().unit(), for backward compatibility.
Definition: PSimHit.h:52
virtual const Topology & topology() const override
Returns a reference to the strip proxy topology.
Definition: DetId.h:18
unsigned int stereo() const
stereo
void setLayerFolder(uint32_t rawdetid, const TrackerTopology *tTopo, int32_t layer=0, bool ring_flag=0)
SiStripRecHit2D stereoHit() const
virtual float thickness() const =0
const T & get() const
Definition: EventSetup.h:56
bool tibIsStereo(const DetId &id) const
void createStereoAndMatchedMEs(DQMStore::IBooker &ibooker, std::string label)
virtual float localPitch(const LocalPoint &) const =0
std::string HistoName
void getTECDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tecDetRawIds, uint32_t side=0, uint32_t wheel=0, uint32_t petal_bkw_frw=0, uint32_t petal=0, uint32_t ring=0, uint32_t ster=0) const
SiStripRecHit2D monoHit() const
void rechitanalysis(LocalVector ldir, const TrackingRecHit *rechit, const StripGeomDetUnit *stripdet, edm::ESHandle< StripClusterParameterEstimator > stripcpe, TrackerHitAssociator &associate, bool simplehit1or2D)
edm::EventID id() const
Definition: EventBase.h:60
HLT enums.
static int position[264][3]
Definition: ReadPGInfo.cc:509
void getTIBDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tibDetRawIds, uint32_t layer=0, uint32_t bkw_frw=0, uint32_t int_ext=0, uint32_t string=0) const
std::vector< PSimHit > associateHit(const TrackingRecHit &thit) const
virtual LocalVector driftDirection(const StripGeomDetUnit *) const =0
std::map< std::string, std::vector< uint32_t > > StereoAndMatchedDetMap
void getTIDDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tidDetRawIds, uint32_t side=0, uint32_t wheel=0, uint32_t ring=0, uint32_t ster=0) const
DetId geographicalId() const
dbl *** dir
Definition: mlp_gen.cc:35
virtual LocalError localPositionError() const =0
std::string createHistoLayer(std::string description, std::string id_type, std::string path, std::string flag)
virtual MeasurementError measurementError(const LocalPoint &, const LocalError &) const =0
virtual LocalError localPositionError() const final
std::map< std::string, std::vector< uint32_t > > LayerDetMap
T x() const
Definition: PV2DBase.h:45
T x() const
Definition: PV3DBase.h:62
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
T const * product() const
Definition: ESHandle.h:86
const GeomDetUnit * stereoDet() const
Definition: GluedGeomDet.h:21
Definition: Run.h:42
void beginJob(const edm::EventSetup &es)
const TrackerGeomDet * idToDet(DetId) const