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 
446 
448 
449  //Only in standalone mode save local root file
451 
452 }
453 
454 // Functions that gets called by framework every event
456 {
457 
458  LogInfo("EventInfo") << " Run = " << e.id().run() << " Event = " << e.id().event();
459  //cout << " Run = " << e.id().run() << " Event = " << e.id().event() << endl;
460 
461  int isrechitrphi = 0;
462  int isrechitsas = 0;
463  int isrechitmatched = 0;
464 
465  DetId detid;
466  uint32_t myid;
467 
469 
470  //Retrieve tracker topology from geometry
471  edm::ESHandle<TrackerTopology> tTopoHandle;
472  es.get<TrackerTopologyRcd>().get(tTopoHandle);
473  const TrackerTopology* const tTopo = tTopoHandle.product();
474 
476  es.get < TrackerDigiGeometryRecord > ().get(pDD);
477  const TrackerGeometry & tracker(*pDD);
478 
479  const TrackerGeometry *tracker2;
481  es.get < TrackerDigiGeometryRecord > ().get(estracker);
482  tracker2 = &(*estracker);
483 
485  es.get < IdealMagneticFieldRecord > ().get(magfield);
486 
487  const MagneticField & magfield_(*magfield);
488  magfield2_ = &magfield_;
489 
491  es.get < TkStripCPERecord > ().get("SimpleStripCPE", stripcpe);
492 
493  // Mangano's
494 
495  edm::Handle < std::vector<reco::Track> > trackCollectionHandle;
496  e.getByToken(tracksInputToken_, trackCollectionHandle);
497 
498  edm::LogVerbatim("TrajectoryAnalyzer") << "trackColl->size(): " << trackCollectionHandle->size();
499  auto const & tracks = *trackCollectionHandle;
500  for (auto const & track : tracks) {
501 
502  if (track.pt()<0.5) continue;
503  edm::LogVerbatim("TrajectoryAnalyzer") << "this track has " << track.found() << " valid hits";
504 
505  auto const & trajParams = track.extra()->trajParams();
506  assert(trajParams.size()==track.recHitsSize());
507  auto hb = track.recHitsBegin();
508  for(unsigned int h=0;h<track.recHitsSize();h++){
509  auto recHit = *(hb+h);
510  if(!recHit->isValid()) continue;
511  auto ldir = trajParams[h].direction();
512  auto gmom = recHit->surface()->toGlobal(trajParams[h].momentum());
513  if (gmom.perp() < 0.5) continue; // redundant...
514  {
515 
516  auto thit2 = recHit;
517  DetId detid2 = thit2->geographicalId();
518  const SiStripMatchedRecHit2D *matchedhit = dynamic_cast < const SiStripMatchedRecHit2D * >(thit2);
519  const SiStripRecHit2D *hit2d = dynamic_cast < const SiStripRecHit2D * >(thit2);
520  const SiStripRecHit1D *hit1d = dynamic_cast < const SiStripRecHit1D * >(thit2);
521 
522  auto thit = thit2;
523 
524  detid = (thit)->geographicalId();
525  myid = detid.rawId();
526  //Here due to the fact that the SiStripHistoId::getSubdetid complains when
527  //a subdet of 1 or 2 appears we add an if statement.
528  if(detid.subdetId()==1 ||detid.subdetId()==2 ){
529  continue;
530  }
531  SiStripHistoId hidmanager;
532  std::string label = hidmanager.getSubdetid(myid,tTopo,true);
533  // std::cout<< "label " << label << " and id " << detid.subdetId() << std::endl;
534 
535  StripSubdetector StripSubdet = (StripSubdetector) detid;
536  //Variable to define the case we are dealing with
537  std::string matchedmonorstereo;
538 
539  isrechitmatched = 0;
540 
541  if (matchedhit) {
542  isrechitmatched = 1;
543  const GluedGeomDet *gluedDet = (const GluedGeomDet *) tracker.idToDet(matchedhit->geographicalId());
544  //Analysis
545  rechitanalysis_matched(ldir, thit2, gluedDet, associate, stripcpe, MatchStatus::matched);
546  // rechitmatched.push_back(rechitpro);
547  }
548 
549  std::map<std::string, StereoAndMatchedMEs>::iterator iStereoAndMatchedME = StereoAndMatchedMEsMap.find(label);
550 
551  //Filling Histograms for Matched hits
552 
553  if (isrechitmatched) {
554 
555  if(iStereoAndMatchedME != StereoAndMatchedMEsMap.end()){
556  fillME(iStereoAndMatchedME->second.mePosxMatched,rechitpro.x);
557  fillME(iStereoAndMatchedME->second.mePosyMatched,rechitpro.y);
558  fillME(iStereoAndMatchedME->second.meResolxMatched,sqrt(rechitpro.resolxx));
559  fillME(iStereoAndMatchedME->second.meResolyMatched,sqrt(rechitpro.resolyy));
560  fillME(iStereoAndMatchedME->second.meResxMatched,rechitpro.resx);
561  fillME(iStereoAndMatchedME->second.meResyMatched,rechitpro.resy);
562  fillME(iStereoAndMatchedME->second.mePullxMatched,rechitpro.pullx);
563  fillME(iStereoAndMatchedME->second.mePullyMatched,rechitpro.pully);
564  }
565  }
566 
567  //Reset Variables here for the current event
568  isrechitrphi = 0;
569  isrechitsas = 0;
570 
572  // simple hits from matched hits
574 
575  if (gmom.transverse() != 0) {
576  track_rapidity = gmom.eta();
577  } else {
578  track_rapidity = -999.0;
579  }
580 
581  if (matchedhit) {
582  auto hm = matchedhit->monoHit();
583  const SiStripRecHit2D *monohit = &hm;
584  // const GeomDetUnit * monodet=gdet->monoDet();
585  GluedGeomDet *gdet = (GluedGeomDet *) tracker2->idToDet(matchedhit->geographicalId());
586 
587  if (monohit) {
588 
589  isrechitrphi = 1;
590 
591  //Analysis
592  rechitanalysis_matched(ldir, thit2, gdet, associate, stripcpe, MatchStatus::monoHit);
593 
594  }
595 
596  auto s = matchedhit->stereoHit();
597  const SiStripRecHit2D *stereohit = &s;
598 
599  if (stereohit) {
600 
601  isrechitsas = 1;
602 
603  //Analysis
604  rechitanalysis_matched(ldir, thit2, gdet, associate, stripcpe, MatchStatus::stereoHit);
605  }
606  }
607 
608  if (hit1d) {
609  // simple hits are mono or stereo
610  // cout<<"simple hit"<<endl;
611  if (StripSubdet.stereo()) {
612 
613  //cout<<"simple hit stereo"<<endl;
614  isrechitsas = 1;
615 
616  const GeomDetUnit *det = tracker.idToDetUnit(detid2);
617  const StripGeomDetUnit *stripdet = (const StripGeomDetUnit *) (det);
618 
619  //Analysis for hit1d stereo
620  rechitanalysis(ldir, thit2, stripdet, stripcpe, associate, true);
621  } else {
622  isrechitrphi = 1;
623  // cout<<"simple hit mono"<<endl;
624 
625  const GeomDetUnit *det = tracker.idToDetUnit(detid2);
626  const StripGeomDetUnit *stripdet = (const StripGeomDetUnit *) (det);
627 
628  //Analysis for hit1d mono
629  rechitanalysis(ldir, thit2, stripdet, stripcpe, associate, true);
630 
631  }
632  }
633 
634  if (hit2d) {
635  // simple hits are mono or stereo
636  // cout<<"simple hit"<<endl;
637  if (StripSubdet.stereo()) {
638 
639  //cout<<"simple hit stereo"<<endl;
640  isrechitsas = 1;
641 
642  const GeomDetUnit *det = tracker.idToDetUnit(detid2);
643  const StripGeomDetUnit *stripdet = (const StripGeomDetUnit *) (det);
644 
645  //Analysis for hit2d stereo
646  rechitanalysis(ldir, thit2, stripdet, stripcpe, associate, false);
647 
648  } else {
649  isrechitrphi = 1;
650  // cout<<"simple hit mono"<<endl;
651 
652  const GeomDetUnit *det = tracker.idToDetUnit(detid2);
653  const StripGeomDetUnit *stripdet = (const StripGeomDetUnit *) (det);
654 
655  //Analysis for hit2d mono
656  rechitanalysis(ldir, thit2, stripdet, stripcpe, associate, false);
657 
658  }
659  }
660 
661 //------------------------------------------------------------------------------------------------------------------------------------------------------
662 
663  //Filling Histograms for simple hits
664  //cout<<"isrechitrphi,isrechitsas = "<<isrechitrphi<<","<<isrechitsas<<endl;
665 
666  std::map<std::string, LayerMEs>::iterator iLayerME = LayerMEsMap.find(label);
667  if (isrechitrphi) {
674 
677 
678  if (rechitpro.clusiz == 1) {
681  } else if (rechitpro.clusiz == 2) {
687  } else if (rechitpro.clusiz == 3) {
690  } else if (rechitpro.clusiz == 4) {
693  }
694 
695  if (rechitpro.category == 1) {
698  } else if (rechitpro.category == 2) {
700  } else if (rechitpro.category == 3) {
702  } else if (rechitpro.category == 4) {
704  }
705 
712 
713  if(iLayerME != LayerMEsMap.end()){
714  fillME(iLayerME->second.meWclusRphi,rechitpro.clusiz);
715  fillME(iLayerME->second.meAdcRphi,rechitpro.cluchg);
716  fillME(iLayerME->second.meResolxLFRphi,sqrt(rechitpro.resolxx));
717  fillME(iLayerME->second.meResolxMFRphi,sqrt(rechitpro.resolxxMF));
718 
719  if( (min(rechitpro.clusiz, 4) - 1) == 1 ){fillME(iLayerME->second.meResolxMFRphiwclus1,sqrt(rechitpro.resolxxMF));}
720  if( (min(rechitpro.clusiz, 4) - 1) == 2 ){fillME(iLayerME->second.meResolxMFRphiwclus2,sqrt(rechitpro.resolxxMF));}
721  if( (min(rechitpro.clusiz, 4) - 1) == 3 ){fillME(iLayerME->second.meResolxMFRphiwclus3,sqrt(rechitpro.resolxxMF));}
722  if( (min(rechitpro.clusiz, 4) - 1) == 4 ){fillME(iLayerME->second.meResolxMFRphiwclus4,sqrt(rechitpro.resolxxMF));}
723 
724 
725  fillME(iLayerME->second.meResLFRphi,rechitpro.resx);
726  fillME(iLayerME->second.meResMFRphi,rechitpro.resxMF);
727 
728  if( (min(rechitpro.clusiz, 4) - 1) == 1 ){fillME(iLayerME->second.merapidityResProfilewclus1,track_rapidity, fabs(rechitpro.resxMF));}
729  if( (min(rechitpro.clusiz, 4) - 1) == 2 ){fillME(iLayerME->second.merapidityResProfilewclus2,track_rapidity, fabs(rechitpro.resxMF));}
730  if( (min(rechitpro.clusiz, 4) - 1) == 3 ){fillME(iLayerME->second.merapidityResProfilewclus3,track_rapidity, fabs(rechitpro.resxMF));}
731  if( (min(rechitpro.clusiz, 4) - 1) == 4 ){fillME(iLayerME->second.merapidityResProfilewclus4,track_rapidity, fabs(rechitpro.resxMF));}
732 
733  if( (min(rechitpro.clusiz, 4) - 1) == 1 ){fillME(iLayerME->second.meResMFRphiwclus1,rechitpro.resxMF);}
734  if( (min(rechitpro.clusiz, 4) - 1) == 2 ){fillME(iLayerME->second.meResMFRphiwclus2,rechitpro.resxMF);}
735  if( (min(rechitpro.clusiz, 4) - 1) == 3 ){fillME(iLayerME->second.meResMFRphiwclus3,rechitpro.resxMF);}
736  if( (min(rechitpro.clusiz, 4) - 1) == 4 ){fillME(iLayerME->second.meResMFRphiwclus4,rechitpro.resxMF);}
737 
738  fillME(iLayerME->second.mePullLFRphi,rechitpro.pullx);
739  fillME(iLayerME->second.mePullMFRphi,rechitpro.pullxMF);
740 
741  if( (min(rechitpro.clusiz, 4) - 1) == 1 ){fillME(iLayerME->second.mePullMFRphiwclus1,rechitpro.pullxMF);}
742  if( (min(rechitpro.clusiz, 4) - 1) == 2 ){fillME(iLayerME->second.mePullMFRphiwclus2,rechitpro.pullxMF);}
743  if( (min(rechitpro.clusiz, 4) - 1) == 3 ){fillME(iLayerME->second.mePullMFRphiwclus3,rechitpro.pullxMF);}
744  if( (min(rechitpro.clusiz, 4) - 1) == 4 ){fillME(iLayerME->second.mePullMFRphiwclus4,rechitpro.pullxMF);}
745 
746 
747  fillME(iLayerME->second.meTrackangleRphi,rechitpro.trackangle);
748  fillME(iLayerME->second.mePullTrackangleProfileRphi,rechitpro.trackangle,fabs(rechitpro.pullxMF));
749 
750  if( (min(rechitpro.clusiz, 4) - 1) == 1 ){fillME(iLayerME->second.mePullTrackwidthProfileRphiwclus1,rechitpro.trackwidth, fabs(rechitpro.pullxMF));}
751  if( (min(rechitpro.clusiz, 4) - 1) == 2 ){fillME(iLayerME->second.mePullTrackwidthProfileRphiwclus2,rechitpro.trackwidth, fabs(rechitpro.pullxMF));}
752  if( (min(rechitpro.clusiz, 4) - 1) == 3 ){fillME(iLayerME->second.mePullTrackwidthProfileRphiwclus3,rechitpro.trackwidth, fabs(rechitpro.pullxMF));}
753  if( (min(rechitpro.clusiz, 4) - 1) == 4 ){fillME(iLayerME->second.mePullTrackwidthProfileRphiwclus4,rechitpro.trackwidth, fabs(rechitpro.pullxMF));}
754 
755 
756  if (rechitpro.clusiz == 1) {
757  fillME(iLayerME->second.meResolxMFTrackwidthProfileWclus1Rphi,rechitpro.trackwidth,sqrt(rechitpro.resolxxMF));
758  fillME(iLayerME->second.meResMFTrackwidthProfileWclus1Rphi,rechitpro.trackwidth,fabs(rechitpro.resxMF));
759  }
760  if (rechitpro.clusiz == 2) {
761  fillME(iLayerME->second.meResolxMFTrackwidthProfileWclus2Rphi,rechitpro.trackwidth,sqrt(rechitpro.resolxxMF));
762  fillME(iLayerME->second.meResMFTrackwidthProfileWclus2Rphi,rechitpro.trackwidth,fabs(rechitpro.resxMF));
763  }
764  if (rechitpro.clusiz == 3) {
765  fillME(iLayerME->second.meResolxMFTrackwidthProfileWclus3Rphi,rechitpro.trackwidth,sqrt(rechitpro.resolxxMF));
766  fillME(iLayerME->second.meResMFTrackwidthProfileWclus3Rphi,rechitpro.trackwidth,fabs(rechitpro.resxMF));
767  }
768  if (rechitpro.clusiz == 4) {
769  fillME(iLayerME->second.meResolxMFTrackwidthProfileWclus4Rphi,rechitpro.trackwidth,sqrt(rechitpro.resolxxMF));
770  fillME(iLayerME->second.meResMFTrackwidthProfileWclus4Rphi,rechitpro.trackwidth,fabs(rechitpro.resxMF));
771  }
772 
773 
774  if (rechitpro.category == 1) {
775  fillME(iLayerME->second.mePullTrackwidthProfileCategory1Rphi,rechitpro.trackwidth,fabs(rechitpro.pullxMF));
776  fillME(iLayerME->second.meResolxMFTrackwidthProfileCategory1Rphi,rechitpro.trackwidth,sqrt(rechitpro.resolxxMF));
777  fillME(iLayerME->second.meResolxMFClusterwidthProfileCategory1Rphi,rechitpro.clusiz,sqrt(rechitpro.resolxxMF));
778  } else if(rechitpro.category == 2) {
779  fillME(iLayerME->second.mePullTrackwidthProfileCategory2Rphi,rechitpro.trackwidth,fabs(rechitpro.pullxMF));
780  fillME(iLayerME->second.meResolxMFTrackwidthProfileCategory2Rphi,rechitpro.trackwidth,sqrt(rechitpro.resolxxMF));
781  } else if (rechitpro.category == 3) {
782  fillME(iLayerME->second.mePullTrackwidthProfileCategory3Rphi,rechitpro.trackwidth,fabs(rechitpro.pullxMF));
783  fillME(iLayerME->second.meResolxMFTrackwidthProfileCategory3Rphi,rechitpro.trackwidth,sqrt(rechitpro.resolxxMF));
784  } else if (rechitpro.category == 4) {
785  fillME(iLayerME->second.mePullTrackwidthProfileCategory4Rphi,rechitpro.trackwidth,fabs(rechitpro.pullxMF));
786  fillME(iLayerME->second.meResolxMFTrackwidthProfileCategory4Rphi,rechitpro.trackwidth,sqrt(rechitpro.resolxxMF));
787  }
788 
789  fillME(iLayerME->second.meTrackwidthRphi,rechitpro.trackwidth);
790  fillME(iLayerME->second.meExpectedwidthRphi,rechitpro.expectedwidth);
791  fillME(iLayerME->second.meClusterwidthRphi,rechitpro.clusiz);
792  fillME(iLayerME->second.meCategoryRphi,rechitpro.category);
793  fillME(iLayerME->second.meResolxMFTrackwidthProfileRphi,rechitpro.trackwidth,sqrt(rechitpro.resolxxMF));
794  fillME(iLayerME->second.meResolxMFAngleProfileRphi,rechitpro.trackangle,sqrt(rechitpro.resolxxMF));
795  }
796  }
797 
798  if (isrechitsas > 0) {
805 
808 
809  if (rechitpro.clusiz == 1) {
812  } else if (rechitpro.clusiz == 2) {
815  } else if (rechitpro.clusiz == 3) {
818  } else if (rechitpro.clusiz == 4) {
821  } if (rechitpro.category == 1) {
824  } else if (rechitpro.category == 2) {
826  } else if (rechitpro.category == 3) {
828  } else if (rechitpro.category == 4) {
830  }
831 
838 
839  if(iStereoAndMatchedME != StereoAndMatchedMEsMap.end()){
840  fillME(iStereoAndMatchedME->second.meWclusSas,rechitpro.clusiz);
841  fillME(iStereoAndMatchedME->second.meAdcSas,rechitpro.cluchg);
842  fillME(iStereoAndMatchedME->second.meResolxLFSas,sqrt(rechitpro.resolxx));
843  fillME(iStereoAndMatchedME->second.meResLFSas,rechitpro.resx);
844  fillME(iStereoAndMatchedME->second.mePullLFSas,rechitpro.pullx);
845  fillME(iStereoAndMatchedME->second.meResolxMFSas,sqrt(rechitpro.resolxxMF));
846  fillME(iStereoAndMatchedME->second.meResMFSas,rechitpro.resxMF);
847  fillME(iStereoAndMatchedME->second.mePullMFSas,rechitpro.pullxMF);
848  fillME(iStereoAndMatchedME->second.meTrackangleSas,rechitpro.trackangle);
849  fillME(iStereoAndMatchedME->second.mePullTrackangleProfileSas,rechitpro.trackangle, rechitpro.pullxMF);
850  fillME(iStereoAndMatchedME->second.mePullTrackwidthProfileSas,rechitpro.trackwidth, rechitpro.pullxMF);
851  if (rechitpro.category == 1) {
852  fillME(iStereoAndMatchedME->second.mePullTrackwidthProfileCategory1Sas,rechitpro.trackwidth,rechitpro.pullxMF);
853  fillME(iStereoAndMatchedME->second.meResolxMFTrackwidthProfileCategory1Sas,rechitpro.trackwidth,sqrt(rechitpro.resolxxMF));
854  fillME(iStereoAndMatchedME->second.meResolxMFClusterwidthProfileCategory1Sas,rechitpro.clusiz,sqrt(rechitpro.resolxxMF));
855  } else if (rechitpro.category == 2) {
856  fillME(iStereoAndMatchedME->second.mePullTrackwidthProfileCategory2Sas,rechitpro.trackwidth,rechitpro.pullxMF);
857  fillME(iStereoAndMatchedME->second.meResolxMFTrackwidthProfileCategory2Sas,rechitpro.trackwidth,sqrt(rechitpro.resolxxMF));
858  } else if (rechitpro.category == 3) {
859  fillME(iStereoAndMatchedME->second.mePullTrackwidthProfileCategory3Sas,rechitpro.trackwidth,rechitpro.pullxMF);
860  fillME(iStereoAndMatchedME->second.meResolxMFTrackwidthProfileCategory3Sas,rechitpro.trackwidth,sqrt(rechitpro.resolxxMF));
861  } else if (rechitpro.category == 4) {
862  fillME(iStereoAndMatchedME->second.mePullTrackwidthProfileCategory4Sas,rechitpro.trackwidth,rechitpro.pullxMF);
863  fillME(iStereoAndMatchedME->second.meResolxMFTrackwidthProfileCategory4Sas,rechitpro.trackwidth,sqrt(rechitpro.resolxxMF));
864  }
865  fillME(iStereoAndMatchedME->second.meTrackwidthSas,rechitpro.trackwidth);
866  fillME(iStereoAndMatchedME->second.meExpectedwidthSas,rechitpro.expectedwidth);
867  fillME(iStereoAndMatchedME->second.meClusterwidthSas,rechitpro.clusiz);
868  fillME(iStereoAndMatchedME->second.meCategorySas,rechitpro.category);
869  fillME(iStereoAndMatchedME->second.meResolxMFTrackwidthProfileSas,rechitpro.trackwidth,sqrt(rechitpro.resolxxMF));
870  fillME(iStereoAndMatchedME->second.meResolxMFAngleProfileSas,rechitpro.trackangle, rechitpro.resolxxMF);
871  }
872  }
873  }
874  }
875  }
876 }
877 
878 
879 
880 //needed by to do the residual for matched hits
881 std::pair < LocalPoint, LocalVector > SiStripTrackingRecHitsValid::projectHit(const PSimHit & hit,
882  const StripGeomDetUnit
883  * stripDet,
884  const BoundPlane &
885  plane)
886 {
887  // const StripGeomDetUnit* stripDet = dynamic_cast<const StripGeomDetUnit*>(hit.det());
888  //if (stripDet == 0) throw MeasurementDetException("HitMatcher hit is not on StripGeomDetUnit");
889 
890  const StripTopology & topol = stripDet->specificTopology();
891  GlobalPoint globalpos = stripDet->surface().toGlobal(hit.localPosition());
892  LocalPoint localHit = plane.toLocal(globalpos);
893  //track direction
894  LocalVector locdir = hit.localDirection();
895  //rotate track in new frame
896 
897  GlobalVector globaldir = stripDet->surface().toGlobal(locdir);
898  LocalVector dir = plane.toLocal(globaldir);
899  float scale = -localHit.z() / dir.z();
900 
901  LocalPoint projectedPos = localHit + scale * dir;
902 
903  // std::cout << "projectedPos " << projectedPos << std::endl;
904 
905  float selfAngle = topol.stripAngle(topol.strip(hit.localPosition()));
906 
907  LocalVector stripDir(sin(selfAngle), cos(selfAngle), 0); // vector along strip in hit frame
908 
909  LocalVector localStripDir(plane.toLocal(stripDet->surface().toGlobal(stripDir)));
910 
911  return std::pair < LocalPoint, LocalVector > (projectedPos, localStripDir);
912 }
913 //--------------------------------------------------------------------------------------------
915 
916  rechitpro.resx = -999999.; rechitpro.resy = -999999.; rechitpro.resxMF = -999999.;
917  rechitpro.pullx = -999999.; rechitpro.pully = -999999.; rechitpro.pullxMF = -999999.; rechitpro.trackangle = -999999.; rechitpro.trackanglebeta = -999999.;
918 
919  const GeomDetUnit *monodet = gluedDet->monoDet();
920  const GeomDetUnit *stereodet = gluedDet->stereoDet();
921  //We initialized it to monoHit case because it complains that it may be uninitialized
922  //and it will change value in the stereoHit case. The matched case do not use this
923  const StripGeomDetUnit *stripdet = (const StripGeomDetUnit *) (monodet) ;
924 
925  const SiStripMatchedRecHit2D *matchedhit = dynamic_cast < const SiStripMatchedRecHit2D * > (rechit);
926  const SiStripRecHit2D *monohit = nullptr;
927  const SiStripRecHit2D *stereohit = nullptr;
929 
930  if (matchedmonorstereo == MatchStatus::monoHit){
931  auto hm = matchedhit->monoHit();
932  monohit = &hm;
933  stripdet = (const StripGeomDetUnit *) (monodet);
934  } else if (matchedmonorstereo == MatchStatus::stereoHit){
935  auto s = matchedhit->stereoHit();
936  stereohit = &s;
937  stripdet = (const StripGeomDetUnit *) (stereodet);
938  }
939  //if(matchedhit) cout<<"manganomatchedhit"<<endl;
940  //if(hit) cout<<"manganosimplehit"<<endl;
941  //if (hit && matchedhit) cout<<"manganosimpleandmatchedhit"<<endl;
942  const StripTopology & topol = (const StripTopology &) stripdet->topology();
943 
944  const LocalVector& trackdirection = ldir;
945 
946  GlobalVector gtrkdir = gluedDet->toGlobal(trackdirection);
947  LocalVector monotkdir = monodet->toLocal(gtrkdir);
948  LocalVector stereotkdir = stereodet->toLocal(gtrkdir);
949 
952  MeasurementPoint Mposition;
953  MeasurementError Merror;
954 
955  if (matchedmonorstereo == MatchStatus::matched){
956  position=rechit->localPosition();
957  error=rechit->localPositionError();
958  } else if(matchedmonorstereo == MatchStatus::monoHit){
959  position = monohit->localPosition();
960  error = monohit->localPositionError();
961  Mposition = topol.measurementPosition(position);
962  Merror = topol.measurementError(position, error);
963  if (monotkdir.z()) {
964  rechitpro.trackangle = atan(monotkdir.x() / monotkdir.z()) * TMath::RadToDeg();
965  rechitpro.trackanglebeta = atan(monotkdir.y() / monotkdir.z()) * TMath::RadToDeg();
966  }
967  clust = monohit->cluster();
968  } else if (matchedmonorstereo == MatchStatus::stereoHit){
969  position = stereohit->localPosition();
970  error = stereohit->localPositionError();
971  Mposition = topol.measurementPosition(position);
972  Merror = topol.measurementError(position, error);
973  if (stereotkdir.z()) {
974  rechitpro.trackangle = atan(stereotkdir.x() / stereotkdir.z()) * TMath::RadToDeg();
975  rechitpro.trackanglebeta = atan(stereotkdir.y() / stereotkdir.z()) * TMath::RadToDeg();
976  }
977  clust = stereohit->cluster();
978  }
979 
980  LocalVector drift = stripcpe->driftDirection(stripdet);
981  rechitpro.thickness = stripdet->surface().bounds().thickness();
982  float pitch = topol.localPitch(position);
983  float tanalpha = tan(rechitpro.trackangle * TMath::DegToRad());
984  float tanalphaL = drift.x() / drift.z();
985  rechitpro.trackwidth = fabs((rechitpro.thickness / pitch) * tanalpha - (rechitpro.thickness / pitch) * tanalphaL);
986  float SLorentz = 0.5 * (rechitpro.thickness / pitch) * tanalphaL;
987  int Sp = int (position.x() / pitch + SLorentz + 0.5 * rechitpro.trackwidth);
988  int Sm = int (position.x() / pitch + SLorentz - 0.5 * rechitpro.trackwidth);
989  rechitpro.expectedwidth = 1 + Sp - Sm;
990 
991  const auto & amplitudes=clust->amplitudes();
992  rechitpro.clusiz = amplitudes.size();
993  int totcharge=0;
994  for(size_t ia=0; ia<amplitudes.size();++ia){
995  totcharge+=amplitudes[ia];
996  }
997 
998  rechitpro.x = position.x();
999  rechitpro.y = position.y();
1000  rechitpro.z = position.z();
1001  rechitpro.resolxx = error.xx();
1002  rechitpro.resolxy = error.xy();
1003  rechitpro.resolyy = error.yy();
1004  rechitpro.resolxxMF = Merror.uu();
1005  rechitpro.cluchg = totcharge;
1006 
1008  rechitpro.category = 1;
1009  } else if (rechitpro.expectedwidth == 1) {
1010  rechitpro.category = 2;
1011  } else if (rechitpro.clusiz <= rechitpro.expectedwidth) {
1012  rechitpro.category = 3;
1013  } else {
1014  rechitpro.category = 4;
1015  }
1016 
1017  if(matchedmonorstereo == MatchStatus::matched){matched.clear();matched = associate.associateHit(*matchedhit);}
1018  else if(matchedmonorstereo == MatchStatus::monoHit){matched.clear();matched = associate.associateHit(*monohit);}
1019  else if(matchedmonorstereo == MatchStatus::stereoHit){matched.clear();matched = associate.associateHit(*stereohit);}
1020 
1021  if(!matched.empty()){
1022  float mindist = std::numeric_limits<float>::max();
1023  float dist = std::numeric_limits<float>::max();
1024  float distx = std::numeric_limits<float>::max();
1025  float disty = std::numeric_limits<float>::max();
1026  std::pair<LocalPoint,LocalVector> closestPair;
1027  PSimHit* closest = nullptr;
1028 
1029  const StripGeomDetUnit* partnerstripdet = static_cast<const StripGeomDetUnit*>(gluedDet->stereoDet());
1030  std::pair<LocalPoint,LocalVector> hitPair;
1031 
1032  if (matchedmonorstereo ==MatchStatus::matched) {
1033  for(auto &m : matched){
1034  //project simhit;
1035  hitPair= projectHit(m,partnerstripdet,gluedDet->surface());
1036  distx = fabs(rechitpro.x - hitPair.first.x());
1037  disty = fabs(rechitpro.y - hitPair.first.y());
1038  dist = sqrt(distx*distx+disty*disty);
1039  if(dist<mindist){
1040  mindist = dist;
1041  closestPair = hitPair;
1042  closest = &m;
1043  }
1044  }
1045  float closestX = closestPair.first.x();
1046  float closestY = closestPair.first.y();
1047  rechitpro.resx = rechitpro.x - closestX;
1048  rechitpro.resy = rechitpro.y - closestPair.first.y();
1049  rechitpro.pullx = ((rechit)->localPosition().x() - closestX) / sqrt(error.xx());
1050  rechitpro.pully = ((rechit)->localPosition().y() - closestY) / sqrt(error.yy());
1051  } else if(matchedmonorstereo == MatchStatus::monoHit){
1052  for(auto &m : matched ){
1053  //project simhit;
1054  dist = abs((monohit)->localPosition().x() - m.localPosition().x());
1055  if(dist<mindist){
1056  mindist = dist;
1057  closestPair = hitPair;
1058  closest = &m;
1059  }
1060  }
1061  float closestX = closest->localPosition().x();
1062  rechitpro.resx = rechitpro.x - closestX;
1063  rechitpro.resxMF = Mposition.x() - (topol.measurementPosition(closest->localPosition())).x();
1064  rechitpro.pullx = (rechit->localPosition().x() - closestX) / sqrt(error.xx());
1065  rechitpro.pullxMF = (rechitpro.resxMF)/sqrt(Merror.uu());
1066  } else if(matchedmonorstereo == MatchStatus::stereoHit){
1067  for(auto &m : matched){
1068  //project simhit;
1069  dist = abs((stereohit)->localPosition().x() - m.localPosition().x());
1070  if(dist<mindist){
1071  mindist = dist;
1072  closestPair = hitPair;
1073  closest = &m;
1074  }
1075  }
1076  float closestX = closest->localPosition().x();
1077  rechitpro.resx = rechitpro.x - closestX;
1078  rechitpro.resxMF = Mposition.x() - (topol.measurementPosition(closest->localPosition())).x();
1079  rechitpro.pullx = (rechit->localPosition().x() - closestX) / sqrt(error.xx());
1080  rechitpro.pullxMF = (rechitpro.resxMF)/sqrt(Merror.uu());
1081  }
1082  }
1083 }
1084 //--------------------------------------------------------------------------------------------
1086 
1087  rechitpro.resx = -999999.; rechitpro.resy = -999999.; rechitpro.resxMF = -999999.;
1088  rechitpro.pullx = -999999.; rechitpro.pully = -999999.; rechitpro.pullxMF = -999999.;
1089 
1090  //If simplehit1or2D is true we are dealing with hit1d, false is for hit2d
1091  const SiStripRecHit2D *hit2d = dynamic_cast < const SiStripRecHit2D * >(rechit);
1092  const SiStripRecHit1D *hit1d = dynamic_cast < const SiStripRecHit1D * >(rechit);
1093 
1094  const StripTopology & topol = (const StripTopology &) stripdet->topology();
1095 
1096  LocalPoint position = rechit->localPosition();
1097  LocalError error = rechit->localPositionError();
1098  MeasurementPoint Mposition = topol.measurementPosition(position);
1099  MeasurementError Merror = topol.measurementError(position,error);
1100 
1101  const LocalVector& trackdirection = ldir;
1102  rechitpro.trackangle = std::atan(trackdirection.x() / trackdirection.z()) * TMath::RadToDeg();
1103  rechitpro.trackanglebeta = std::atan(trackdirection.y() / trackdirection.z()) * TMath::RadToDeg();
1104 
1105  LocalVector drift = stripcpe->driftDirection(stripdet);
1106  rechitpro.thickness = stripdet->surface().bounds().thickness();
1107  float pitch = topol.localPitch(position);
1108  float tanalpha = tan(rechitpro.trackangle * TMath::DegToRad());
1109  float tanalphaL = drift.x() / drift.z();
1110  rechitpro.trackwidth = fabs((rechitpro.thickness / pitch) * tanalpha - (rechitpro.thickness / pitch) * tanalphaL);
1111  float SLorentz = 0.5 * (rechitpro.thickness / pitch) * tanalphaL;
1112  int Sp = int (position.x() / pitch + SLorentz + 0.5 * rechitpro.trackwidth);
1113  int Sm = int (position.x() / pitch + SLorentz - 0.5 * rechitpro.trackwidth);
1114  rechitpro.expectedwidth = 1 + Sp - Sm;
1115 
1116  int totcharge=0;
1117  if(simplehit1or2D){
1119  clust1d = hit1d->cluster();
1120  const auto & amplitudes1d = clust1d->amplitudes();
1121  rechitpro.clusiz = amplitudes1d.size();
1122  for(size_t ia=0; ia<amplitudes1d.size();++ia){
1123  totcharge+=amplitudes1d[ia];
1124  }
1125  } else {
1127  clust2d = hit2d->cluster();
1128  const auto & amplitudes2d = clust2d->amplitudes();
1129  rechitpro.clusiz = amplitudes2d.size();
1130  for(size_t ia=0; ia<amplitudes2d.size();++ia){
1131  totcharge+=amplitudes2d[ia];
1132  }
1133  }
1134 
1135  rechitpro.x = position.x();
1136  rechitpro.y = position.y();
1137  rechitpro.z = position.z();
1138  rechitpro.resolxx = error.xx();
1139  rechitpro.resolxy = error.xy();
1140  rechitpro.resolyy = error.yy();
1141  rechitpro.resolxxMF = Merror.uu();
1142  rechitpro.cluchg = totcharge;
1143 
1145  rechitpro.category = 1;
1146  } else if (rechitpro.expectedwidth == 1) {
1147  rechitpro.category = 2;
1148  } else if (rechitpro.clusiz <= rechitpro.expectedwidth) {
1149  rechitpro.category = 3;
1150  } else {
1151  rechitpro.category = 4;
1152  }
1153 
1154  matched.clear();
1155  float mindist = std::numeric_limits<float>::max();
1156  float dist = std::numeric_limits<float>::max();
1157  PSimHit* closest = nullptr;
1158 
1159  if(simplehit1or2D){
1160  matched = associate.associateHit(*hit1d);
1161  if(!matched.empty()){
1162  for(auto &m : matched ){
1163  dist = abs((hit1d)->localPosition().x() - m.localPosition().x());
1164  if(dist<mindist){
1165  mindist = dist;
1166  closest = &m;
1167  }
1168  }
1169  float closestX = closest->localPosition().x();
1170  rechitpro.resx = rechitpro.x - closestX;
1171  rechitpro.resxMF = Mposition.x() - (topol.measurementPosition(closest->localPosition())).x();
1172  rechitpro.pullx = (rechit->localPosition().x() - closestX) / sqrt(error.xx());
1173  rechitpro.pullxMF = (rechitpro.resxMF)/sqrt(Merror.uu());
1174  }
1175  } else {
1176  matched = associate.associateHit(*hit2d);
1177  if(!matched.empty()){
1178  for(auto &m : matched ){
1179  dist = abs((hit2d)->localPosition().x() - m.localPosition().x());
1180  if(dist<mindist){
1181  mindist = dist;
1182  closest = &m;
1183  }
1184  }
1185  float closestX = closest->localPosition().x();
1186  rechitpro.resx = rechitpro.x - closestX;
1187  rechitpro.resxMF = Mposition.x() - (topol.measurementPosition(closest->localPosition())).x();
1188  rechitpro.pullx = (rechit->localPosition().x() - closestX) / sqrt(error.xx());
1189  rechitpro.pullxMF = (rechitpro.resxMF)/sqrt(Merror.uu());
1190  }
1191  }
1192 }
1193 //--------------------------------------------------------------------------------------------
1195 
1196  //Retrieve tracker topology from geometry
1197  edm::ESHandle<TrackerTopology> tTopoHandle;
1198  es.get<TrackerTopologyRcd>().get(tTopoHandle);
1199  const TrackerTopology* const tTopo = tTopoHandle.product();
1200 
1201  // take from eventSetup the SiStripDetCabling object - here will use SiStripDetControl later on
1203 
1204  // get list of active detectors from SiStripDetCabling
1205  std::vector<uint32_t> activeDets;
1207 
1208  SiStripFolderOrganizer folder_organizer;
1209  // folder_organizer.setSiStripFolderName(topFolderName_);
1210  std::string curfold = topFolderName_;
1211  folder_organizer.setSiStripFolderName(curfold);
1212  folder_organizer.setSiStripFolder();
1213 
1214  // std::cout << "curfold " << curfold << std::endl;
1215 
1216  createSimpleHitsMEs(ibooker);
1217 
1218  // loop over detectors and book MEs
1219  edm::LogInfo("SiStripTrackingRecHitsValid|SiStripTrackingRecHitsValid")<<"nr. of activeDets: "<<activeDets.size();
1220  const std::string& tec = "TEC", tid = "TID", tob = "TOB", tib = "TIB";
1221  for(std::vector<uint32_t>::iterator detid_iterator = activeDets.begin(), detid_end = activeDets.end(); detid_iterator!=detid_end; ++detid_iterator){
1222  uint32_t detid = (*detid_iterator);
1223  // remove any eventual zero elements - there should be none, but just in case
1224  if(detid == 0) {
1225  activeDets.erase(detid_iterator);
1226  continue;
1227  }
1228 
1229  // Create Layer Level MEs
1230  std::pair<std::string,int32_t> det_layer_pair = folder_organizer.GetSubDetAndLayer(detid,tTopo,true);
1231  SiStripHistoId hidmanager;
1232  std::string label = hidmanager.getSubdetid(detid,tTopo,true);
1233  // std::cout << "label " << label << endl;
1234 
1235  std::map<std::string, LayerMEs>::iterator iLayerME = LayerMEsMap.find(label);
1236  if(iLayerME==LayerMEsMap.end()) {
1237 
1238  // get detids for the layer
1239  // Keep in mind that when we are on the TID or TEC we deal with rings not wheel
1240  int32_t lnumber = det_layer_pair.second;
1241  const std::string& lname = det_layer_pair.first;
1242  std::vector<uint32_t> layerDetIds;
1243  if (lname == tec) {
1244  if (lnumber > 0) {
1245  SiStripSubStructure::getTECDetectors(activeDets,layerDetIds,tTopo,2,0,0,0,abs(lnumber),0);
1246  } else if (lnumber < 0) {
1247  SiStripSubStructure::getTECDetectors(activeDets,layerDetIds,tTopo,1,0,0,0,abs(lnumber),0);
1248  }
1249  } else if (lname == tid) {
1250  if (lnumber > 0) {
1251  SiStripSubStructure::getTIDDetectors(activeDets,layerDetIds,tTopo,2,0,abs(lnumber),0);
1252  } else if (lnumber < 0) {
1253  SiStripSubStructure::getTIDDetectors(activeDets,layerDetIds,tTopo,1,0,abs(lnumber),0);
1254  }
1255  } else if (lname == tob) {
1256  SiStripSubStructure::getTOBDetectors(activeDets,layerDetIds,tTopo,lnumber,0,0);
1257  } else if (lname == tib) {
1258  SiStripSubStructure::getTIBDetectors(activeDets,layerDetIds,tTopo,lnumber,0,0,0);
1259  }
1260  LayerDetMap[label] = layerDetIds;
1261 
1262  // book Layer MEs
1263  folder_organizer.setLayerFolder(detid,tTopo,det_layer_pair.second,true);
1264  // std::stringstream ss;
1265  // folder_organizer.getLayerFolderName(ss, detid, tTopo, true);
1266  // std::cout << "Folder Name " << ss.str().c_str() << std::endl;
1267  // folder_organizer.setLayerFolder(detid,det_layer_pair.second,true);
1268  createLayerMEs(ibooker,label);
1269  }
1270  //Create StereoAndMatchedMEs
1271  std::map<std::string, StereoAndMatchedMEs>::iterator iStereoAndMatchedME = StereoAndMatchedMEsMap.find(label);
1272  if(iStereoAndMatchedME==StereoAndMatchedMEsMap.end()) {
1273 
1274  // get detids for the stereo and matched layer. We are going to need a bool for these layers
1275  bool isStereo = false;
1276  // Keep in mind that when we are on the TID or TEC we deal with rings not wheel
1277  std::vector<uint32_t> stereoandmatchedDetIds;
1278  int32_t stereolnumber = det_layer_pair.second;
1279  const std::string& stereolname = det_layer_pair.first;
1280  if ( stereolname == tec && (tTopo->tecIsStereo(detid)) ) {
1281  if ( stereolnumber > 0 ) {
1282  SiStripSubStructure::getTECDetectors(activeDets,stereoandmatchedDetIds,tTopo,2,0,0,0,abs(stereolnumber),1);
1283  isStereo = true;
1284  } else if ( stereolnumber < 0 ) {
1285  SiStripSubStructure::getTECDetectors(activeDets,stereoandmatchedDetIds,tTopo,1,0,0,0,abs(stereolnumber),1);
1286  isStereo = true;
1287  }
1288  } else if ( stereolname == tid && (tTopo->tidIsStereo(detid)) ) {
1289  if ( stereolnumber > 0 ) {
1290  SiStripSubStructure::getTIDDetectors(activeDets,stereoandmatchedDetIds,tTopo,2,0,abs(stereolnumber),1);
1291  isStereo = true;
1292  } else if ( stereolnumber < 0 ) {
1293  SiStripSubStructure::getTIDDetectors(activeDets,stereoandmatchedDetIds,tTopo,1,0,abs(stereolnumber),1);
1294  isStereo = true;
1295  }
1296  } else if ( stereolname == tob && (tTopo->tobIsStereo(detid)) ) {
1297  SiStripSubStructure::getTOBDetectors(activeDets,stereoandmatchedDetIds,tTopo,stereolnumber,0,0);
1298  isStereo = true;
1299  } else if ( stereolname == tib && (tTopo->tibIsStereo(detid)) ) {
1300  SiStripSubStructure::getTIBDetectors(activeDets,stereoandmatchedDetIds,tTopo,stereolnumber,0,0,0);
1301  isStereo = true;
1302  }
1303 
1304  StereoAndMatchedDetMap[label] = stereoandmatchedDetIds;
1305 
1306  // book StereoAndMatched MEs
1307  if(isStereo){
1308  folder_organizer.setLayerFolder(detid,tTopo,det_layer_pair.second,true);
1309  // std::stringstream ss1;
1310  // folder_organizer.getLayerFolderName(ss1, detid, tTopo, true);
1311  // std::cout << "Folder Name stereo " << ss1.str().c_str() << std::endl;
1312  //Create the Monitor Elements only when we have a stereo module
1313  createStereoAndMatchedMEs(ibooker,label);
1314  }
1315  }
1316 
1317 
1318  }//end of loop over detectors
1319 }
1320 //------------------------------------------------------------------------------------------
1322 {
1323  simplehitsMEs.meCategory = nullptr;
1324  simplehitsMEs.meTrackwidth = nullptr;
1325  simplehitsMEs.meExpectedwidth = nullptr;
1326  simplehitsMEs.meClusterwidth = nullptr;
1327  simplehitsMEs.meTrackanglealpha = nullptr;
1328  simplehitsMEs.meTrackanglebeta = nullptr;
1335 
1340 
1349  simplehitsMEs.meResolxLF = nullptr;
1350  simplehitsMEs.meResLF = nullptr;
1351  simplehitsMEs.mePullLF = nullptr;
1352  simplehitsMEs.meResolxMF = nullptr;
1353  simplehitsMEs.meResMF = nullptr;
1354  simplehitsMEs.mePullMF = nullptr;
1355 
1356 
1357  if(layerswitchResolx_LF) {
1358  simplehitsMEs.meResolxLF = bookME1D(ibooker,"TH1Resolx_LF", "TH1Resolx_LF" ,"RecHit resol(x) coord. (local frame)");
1359  simplehitsMEs.meResolxLF->setAxisTitle("resol(x) RecHit coord. (local frame)");
1360  }
1361  if(layerswitchResolx_MF) {
1362  simplehitsMEs.meResolxMF = bookME1D(ibooker,"TH1Resolx_MF", "TH1Resolx_MF" ,"RecHit resol(x) coord. (measurement frame)");
1363  simplehitsMEs.meResolxMF->setAxisTitle("resol(x) RecHit coord. (measurement frame)");
1364  }
1365  if(layerswitchRes_LF) {
1366  simplehitsMEs.meResLF = bookME1D(ibooker,"TH1Res_LF", "TH1Res_LF" ,"Residual of the hit x coordinate (local frame)");
1367  simplehitsMEs.meResLF->setAxisTitle("Hit Res(x) (local frame)");
1368  }
1369  if(layerswitchRes_MF) {
1370  simplehitsMEs.meResMF = bookME1D(ibooker,"TH1Res_MF", "TH1Res_MF" ,"Residual of the hit x coordinate (measurement frame)");
1371  simplehitsMEs.meResMF->setAxisTitle("Hit Res(x) (measurement frame)");
1372  }
1373  if(layerswitchPull_LF) {
1374  simplehitsMEs.mePullLF = bookME1D(ibooker,"TH1Pull_LF", "TH1Pull_LF" ,"Pull distribution (local frame)");
1375  simplehitsMEs.mePullLF->setAxisTitle("Pull distribution (local frame)");
1376  }
1377  if(layerswitchPull_MF) {
1378  simplehitsMEs.mePullMF = bookME1D(ibooker,"TH1Pull_MF", "TH1Pull_MF" ,"Pull distribution (measurement frame)");
1379  simplehitsMEs.mePullMF->setAxisTitle("Pull distribution (measurement frame)");
1380  }
1381  if(layerswitchCategory) {
1382  simplehitsMEs.meCategory = bookME1D(ibooker,"TH1Category", "TH1Category" ,"Category");
1383  simplehitsMEs.meCategory->setAxisTitle("Category");
1384  }
1385  if(layerswitchTrackwidth) {
1386  simplehitsMEs.meTrackwidth = bookME1D(ibooker,"TH1Trackwidth", "TH1Trackwidth" ,"Track width");
1387  simplehitsMEs.meTrackwidth->setAxisTitle("Track width");
1388  }
1390  simplehitsMEs.meExpectedwidth = bookME1D(ibooker,"TH1Expectedwidth", "TH1Expectedwidth" ,"Expected width");
1391  simplehitsMEs.meExpectedwidth->setAxisTitle("Expected width");
1392  }
1394  simplehitsMEs.meClusterwidth = bookME1D(ibooker,"TH1Clusterwidth", "TH1Clusterwidth" ,"Cluster width");
1395  simplehitsMEs.meClusterwidth->setAxisTitle("Cluster width");
1396  }
1398  simplehitsMEs.meTrackanglealpha = bookME1D(ibooker,"TH1Trackanglealpha", "TH1Trackanglealpha" ,"Track angle alpha");
1399  simplehitsMEs.meTrackanglealpha->setAxisTitle("Track angle alpha");
1400  }
1402  simplehitsMEs.meTrackanglebeta = bookME1D(ibooker,"TH1Trackanglebeta", "TH1Trackanglebeta" ,"Track angle beta");
1403  simplehitsMEs.meTrackanglebeta->setAxisTitle("Track angle beta");
1404  }
1406  simplehitsMEs.meResolxMFTrackwidthProfileWClus1 = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfile_WClus1","TProfResolxMFTrackwidthProfile_WClus1","Profile of Resolution in MF vs track width for w=1");
1408  simplehitsMEs.meResolxMFTrackwidthProfileWClus1->setAxisTitle("Resolution (measurement frame) w=1",2);
1409  }
1411  simplehitsMEs.meResolxMFTrackwidthProfileWClus2 = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfile_WClus2","TProfResolxMFTrackwidthProfile_WClus2","Profile of Resolution in MF vs track width for w=2");
1413  simplehitsMEs.meResolxMFTrackwidthProfileWClus2->setAxisTitle("Resolution (measurement frame) w=2",2);
1414 
1415  }
1417  simplehitsMEs.meResolxMFTrackwidthProfileWClus3 = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfile_WClus3","TProfResolxMFTrackwidthProfile_WClus3","Profile of Resolution in MF vs track width for w=3");
1419  simplehitsMEs.meResolxMFTrackwidthProfileWClus3->setAxisTitle("Resolution (measurement frame) w=3",2);
1420  }
1422  simplehitsMEs.meResolxMFTrackwidthProfileWClus4 = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfile_WClus4","TProfResolxMFTrackwidthProfile_WClus4","Profile of Resolution in MF vs track width for w=4");
1424  simplehitsMEs.meResolxMFTrackwidthProfileWClus4->setAxisTitle("Resolution (measurement frame) w=3",2);
1425  }
1427  simplehitsMEs.meResMFTrackwidthProfileWClus1 = bookMEProfile(ibooker,"TProfResMFTrackwidthProfile_WClus1","TProfResMFTrackwidthProfile_WClus1","Profile of Residuals(x) in MF vs track width for w=1");
1429  simplehitsMEs.meResMFTrackwidthProfileWClus1->setAxisTitle("Residuals(x) (measurement frame) w=1",2);
1430  }
1432  simplehitsMEs.meResMFTrackwidthProfileWClus2 = bookMEProfile(ibooker,"TProfResMFTrackwidthProfile_WClus2","TProfResMFTrackwidthProfile_WClus2","Profile of Residuals(x) in MF vs track width for w=2");
1434  simplehitsMEs.meResMFTrackwidthProfileWClus2->setAxisTitle("Residuals(x) (measurement frame) w=2",2);
1435  }
1437  simplehitsMEs.meResMFTrackwidthProfileWClus21 = bookMEProfile(ibooker,"TProfResMFTrackwidthProfile_WClus21","TProfResMFTrackwidthProfile_WClus21","Profile of Residuals(x) in MF vs track width for w=2");
1439  simplehitsMEs.meResMFTrackwidthProfileWClus21->setAxisTitle("Residuals(x) (measurement frame) w=2",2);
1440  }
1442  simplehitsMEs.meResMFTrackwidthProfileWClus22 = bookMEProfile(ibooker,"TProfResMFTrackwidthProfile_WClus22","TProfResMFTrackwidthProfile_WClus22","Profile of Residuals(x) in MF vs track width for w=2");
1444  simplehitsMEs.meResMFTrackwidthProfileWClus22->setAxisTitle("Residuals(x) (measurement frame) w=2",2);
1445 
1446  }
1448  simplehitsMEs.meResMFTrackwidthProfileWClus23 = bookMEProfile(ibooker,"TProfResMFTrackwidthProfile_WClus23","TProfResMFTrackwidthProfile_WClus23","Profile of Residuals(x) in MF vs track width for w=2");
1450  simplehitsMEs.meResMFTrackwidthProfileWClus23->setAxisTitle("Residuals(x) (measurement frame) w=2",2);
1451  }
1453  simplehitsMEs.meResMFTrackwidthProfileWClus3 = bookMEProfile(ibooker,"TProfResMFTrackwidthProfile_WClus3","TProfResMFTrackwidthProfile_WClus3","Profile of Residuals(x) in MF vs track width for w=3");
1455  simplehitsMEs.meResMFTrackwidthProfileWClus3->setAxisTitle("Residuals(x) (measurement frame) w=3",2);
1456  }
1458  simplehitsMEs.meResMFTrackwidthProfileWClus4 = bookMEProfile(ibooker,"TProfResMFTrackwidthProfile_WClus4","TProfResMFTrackwidthProfile_WClus4","Profile of Residuals(x) in MF vs track width for w=4");
1460  simplehitsMEs.meResMFTrackwidthProfileWClus4->setAxisTitle("Residuals(x) (measurement frame) w=4",2);
1461  }
1463  simplehitsMEs.meResolxMFTrackwidthProfile = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfile","TProfResolxMFTrackwidthProfile","Profile of Resolution in MF vs track width");
1465  simplehitsMEs.meResolxMFTrackwidthProfile->setAxisTitle("Resolution (measurement frame)",2);
1466  }
1468  simplehitsMEs.meResolxMFTrackwidthProfileCategory1 = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfile_Category1","TProfResolxMFTrackwidthProfile_Category1","Profile of Resolution in MF vs track width (Category 1)");
1470  simplehitsMEs.meResolxMFTrackwidthProfileCategory1->setAxisTitle("Resolution (measurement frame) Category 1",2);
1471  }
1473  simplehitsMEs.meResolxMFTrackwidthProfileCategory2 = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfile_Category2","TProfResolxMFTrackwidthProfile_Category2","Profile of Resolution in MF vs track width (Category 2)");
1475  simplehitsMEs.meResolxMFTrackwidthProfileCategory2->setAxisTitle("Resolution (measurement frame) Category 2",2);
1476  }
1478  simplehitsMEs.meResolxMFTrackwidthProfileCategory3 = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfile_Category3","TProfResolxMFTrackwidthProfile_Category3","Profile of Resolution in MF vs track width (Category 3)");
1480  simplehitsMEs.meResolxMFTrackwidthProfileCategory3->setAxisTitle("Resolution (measurement frame) Category 3",2);
1481  }
1483  simplehitsMEs.meResolxMFTrackwidthProfileCategory4 = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfile_Category4","TProfResolxMFTrackwidthProfile_Category4","Profile of Resolution in MF vs track width (Category 4)");
1485  simplehitsMEs.meResolxMFTrackwidthProfileCategory4->setAxisTitle("Resolution (measurement frame) Category 4",2);
1486  }
1488  simplehitsMEs.meResolxMFClusterwidthProfileCategory1 = bookMEProfile(ibooker,"TProfResolxMFClusterwidthProfile_Category1","TProfResolxMFClusterwidthProfile_Category1","Profile of Resolution in MF vs cluster width (Category 1)");
1490  simplehitsMEs.meResolxMFClusterwidthProfileCategory1->setAxisTitle("Resolution (measurement frame) Category 1",2);
1491  }
1493  simplehitsMEs.meResolxMFAngleProfile = bookMEProfile(ibooker,"TProfResolxMFAngleProfile","TProfResolxMFAngleProfile","Profile of Resolution in MF vs Track angle alpha");
1494  simplehitsMEs.meResolxMFAngleProfile->setAxisTitle("Track angle alpha",1);
1495  simplehitsMEs.meResolxMFAngleProfile->setAxisTitle("Resolution (measurement frame)",2);
1496  }
1497 
1498 
1499 }
1500 //------------------------------------------------------------------------------------------
1502 {
1503  SiStripHistoId hidmanager;
1504  LayerMEs layerMEs;
1505 
1506  layerMEs.meWclusRphi = nullptr;
1507  layerMEs.meAdcRphi = nullptr;
1508  layerMEs.meResolxLFRphi = nullptr;
1509  layerMEs.meResolxMFRphi = nullptr;
1510  layerMEs.meResolxMFRphiwclus1 = nullptr;
1511  layerMEs.meResolxMFRphiwclus2 = nullptr;
1512  layerMEs.meResolxMFRphiwclus3 = nullptr;
1513  layerMEs.meResolxMFRphiwclus4 = nullptr;
1514  layerMEs.meResLFRphi = nullptr;
1515  layerMEs.meResMFRphi = nullptr;
1516  layerMEs.meResMFRphiwclus1 = nullptr;
1517  layerMEs.meResMFRphiwclus2 = nullptr;
1518  layerMEs.meResMFRphiwclus3 = nullptr;
1519  layerMEs.meResMFRphiwclus4 = nullptr;
1520  layerMEs.mePullLFRphi = nullptr;
1521  layerMEs.mePullMFRphi = nullptr;
1522  layerMEs.mePullMFRphiwclus1 = nullptr;
1523  layerMEs.mePullMFRphiwclus2 = nullptr;
1524  layerMEs.mePullMFRphiwclus3 = nullptr;
1525  layerMEs.mePullMFRphiwclus4 = nullptr;
1526  layerMEs.meTrackangleRphi = nullptr;
1527  layerMEs.meTrackanglebetaRphi = nullptr;
1528  layerMEs.meTrackangle2Rphi = nullptr;
1529  layerMEs.mePullTrackangleProfileRphi = nullptr;
1530  layerMEs.mePullTrackangle2DRphi = nullptr;
1531  layerMEs.meTrackwidthRphi = nullptr;
1532  layerMEs.meExpectedwidthRphi = nullptr;
1533  layerMEs.meClusterwidthRphi = nullptr;
1534  layerMEs.meCategoryRphi = nullptr;
1535  layerMEs.mePullTrackwidthProfileRphi = nullptr;
1536  layerMEs.mePullTrackwidthProfileRphiwclus1 = nullptr;
1537  layerMEs.mePullTrackwidthProfileRphiwclus2 = nullptr;
1538  layerMEs.mePullTrackwidthProfileRphiwclus3 = nullptr;
1539  layerMEs.mePullTrackwidthProfileRphiwclus4 = nullptr;
1540  layerMEs.mePullTrackwidthProfileCategory1Rphi = nullptr;
1541  layerMEs.mePullTrackwidthProfileCategory2Rphi = nullptr;
1542  layerMEs.mePullTrackwidthProfileCategory3Rphi = nullptr;
1543  layerMEs.mePullTrackwidthProfileCategory4Rphi = nullptr;
1544  layerMEs.meResolxMFTrackwidthProfileRphi = nullptr;
1545 
1546  layerMEs.meResolxMFTrackwidthProfileWclus1Rphi = nullptr;
1547  layerMEs.meResolxMFTrackwidthProfileWclus2Rphi = nullptr;
1548  layerMEs.meResolxMFTrackwidthProfileWclus3Rphi = nullptr;
1549  layerMEs.meResolxMFTrackwidthProfileWclus4Rphi = nullptr;
1550  layerMEs.meResMFTrackwidthProfileWclus1Rphi = nullptr;
1551  layerMEs.meResMFTrackwidthProfileWclus2Rphi = nullptr;
1552  layerMEs.meResMFTrackwidthProfileWclus3Rphi = nullptr;
1553  layerMEs.meResMFTrackwidthProfileWclus4Rphi = nullptr;
1554 
1555  layerMEs.meResolxMFTrackwidthProfileCategory1Rphi = nullptr;
1556  layerMEs.meResolxMFTrackwidthProfileCategory2Rphi = nullptr;
1557  layerMEs.meResolxMFTrackwidthProfileCategory3Rphi = nullptr;
1558  layerMEs.meResolxMFTrackwidthProfileCategory4Rphi = nullptr;
1559  layerMEs.meResolxMFClusterwidthProfileCategory1Rphi = nullptr;
1560  layerMEs.meResolxMFAngleProfileRphi = nullptr;
1561  layerMEs.merapidityResProfilewclus1 = nullptr;
1562  layerMEs.merapidityResProfilewclus2 = nullptr;
1563  layerMEs.merapidityResProfilewclus3 = nullptr;
1564  layerMEs.merapidityResProfilewclus4 = nullptr;
1565 
1566 
1567  //WclusRphi
1568  if(layerswitchWclusRphi) {
1569  layerMEs.meWclusRphi = bookME1D(ibooker,"TH1WclusRphi", hidmanager.createHistoLayer("Wclus_rphi","layer",label,"").c_str() ,"Cluster Width - Number of strips that belong to the RecHit cluster");
1570  layerMEs.meWclusRphi->setAxisTitle("Cluster Width [nr strips] in "+ label);
1571  }
1572  //AdcRphi
1573  if(layerswitchAdcRphi) {
1574  layerMEs.meAdcRphi = bookME1D(ibooker,"TH1AdcRphi", hidmanager.createHistoLayer("Adc_rphi","layer",label,"").c_str() ,"RecHit Cluster Charge");
1575  layerMEs.meAdcRphi->setAxisTitle("cluster charge [ADC] in " + label);
1576  }
1577  //ResolxLFRphi
1579  layerMEs.meResolxLFRphi = bookME1D(ibooker,"TH1ResolxLFRphi", hidmanager.createHistoLayer("Resolx_LF_rphi","layer",label,"").c_str() ,"RecHit resol(x) coord."); //<resolor>~20micron
1580  layerMEs.meResolxLFRphi->setAxisTitle("resol(x) RecHit coord. (local frame) in " + label);
1581  }
1582  //ResolxMFRphi
1584  layerMEs.meResolxMFRphi = bookME1D(ibooker,"TH1ResolxMFRphi", hidmanager.createHistoLayer("Resolx_MF_rphi","layer",label,"").c_str() ,"RecHit resol(x) coord."); //<resolor>~20micron
1585  layerMEs.meResolxMFRphi->setAxisTitle("resol(x) RecHit coord. (measurement frame) in " + label);
1586  }
1587  //ResolxMFRphiwclus1
1589  layerMEs.meResolxMFRphiwclus1 = bookME1D(ibooker,"TH1ResolxMFRphiwclus1", hidmanager.createHistoLayer("Resolx_MF_wclus1_rphi","layer",label,"").c_str() ,"RecHit resol(x) coord. w=1 "); //<resolor>~20micron
1590  layerMEs.meResolxMFRphiwclus1->setAxisTitle("resol(x) RecHit coord. (measurement frame) for w=1 in " + label);
1591  }
1592  //ResolxMFRphiwclus2
1594  layerMEs.meResolxMFRphiwclus2 = bookME1D(ibooker,"TH1ResolxMFRphiwclus2", hidmanager.createHistoLayer("Resolx_MF_wclus2_rphi","layer",label,"").c_str() ,"RecHit resol(x) coord. w=2 "); //<resolor>~20micron
1595  layerMEs.meResolxMFRphiwclus2->setAxisTitle("resol(x) RecHit coord. (measurement frame) for w=2 in " + label);
1596  }
1597  //ResolxMFRphiwclus3
1599  layerMEs.meResolxMFRphiwclus3 = bookME1D(ibooker,"TH1ResolxMFRphiwclus3", hidmanager.createHistoLayer("Resolx_MF_wclus3_rphi","layer",label,"").c_str() ,"RecHit resol(x) coord. w=3 "); //<resolor>~20micron
1600  layerMEs.meResolxMFRphiwclus3->setAxisTitle("resol(x) RecHit coord. (measurement frame) for w=3 in " + label);
1601  }
1602  //ResolxMFRphiwclus4
1604  layerMEs.meResolxMFRphiwclus4 = bookME1D(ibooker,"TH1ResolxMFRphiwclus4", hidmanager.createHistoLayer("Resolx_MF_wclus4_rphi","layer",label,"").c_str() ,"RecHit resol(x) coord. w=4 "); //<resolor>~20micron
1605  layerMEs.meResolxMFRphiwclus4->setAxisTitle("resol(x) RecHit coord. (measurement frame) for w=4 in " + label);
1606  }
1607  //ResLFRphi
1608  if(layerswitchResLFRphi) {
1609  layerMEs.meResLFRphi = bookME1D(ibooker,"TH1ResLFRphi", hidmanager.createHistoLayer("Res_LF_rphi","layer",label,"").c_str() ,"Residual of the hit x coordinate");
1610  layerMEs.meResLFRphi->setAxisTitle("Hit Residuals(x) (local frame) in " + label);
1611  }
1612  //ResMFRphi
1613  if(layerswitchResMFRphi) {
1614  layerMEs.meResMFRphi = bookME1D(ibooker,"TH1ResMFRphi",hidmanager.createHistoLayer("Res_MF_Rphi","layer",label,"").c_str() ,"Residual of the hit x coordinate");
1615  layerMEs.meResMFRphi->setAxisTitle("Hit Residuals(x) (measurement frame) in "+ label);
1616  }
1617  //ResMFRphiwclus1
1619  layerMEs.meResMFRphiwclus1 = bookME1D(ibooker,"TH1ResMFRphiwclus1",hidmanager.createHistoLayer("Res_MF_wclus1_Rphi","layer",label,"").c_str() ,"Residual of the hit x coordinate w=1");
1620  layerMEs.meResMFRphiwclus1->setAxisTitle("Hit Residuals(x) (measurement frame) for w=1 in "+ label);
1621  }
1622  //ResMFRphiwclus2
1624  layerMEs.meResMFRphiwclus2 = bookME1D(ibooker,"TH1ResMFRphiwclus2",hidmanager.createHistoLayer("Res_MF_wclus2_Rphi","layer",label,"").c_str() ,"Residual of the hit x coordinate w=2");
1625  layerMEs.meResMFRphiwclus2->setAxisTitle("Hit Residuals(x) (measurement frame) for w=2 in "+ label);
1626  }
1627  //ResMFRphiwclus3
1629  layerMEs.meResMFRphiwclus3 = bookME1D(ibooker,"TH1ResMFRphiwclus3",hidmanager.createHistoLayer("Res_MF_wclus3_Rphi","layer",label,"").c_str() ,"Residual of the hit x coordinate w=3");
1630  layerMEs.meResMFRphiwclus3->setAxisTitle("Hit Residuals(x) (measurement frame) for w=3 in "+ label);
1631  }
1632  //ResMFRphiwclus4
1634  layerMEs.meResMFRphiwclus4 = bookME1D(ibooker,"TH1ResMFRphiwclus4",hidmanager.createHistoLayer("Res_MF_wclus4_Rphi","layer",label,"").c_str() ,"Residual of the hit x coordinate w=4");
1635  layerMEs.meResMFRphiwclus4->setAxisTitle("Hit Residuals(x) (measurement frame) for w=4 in "+ label);
1636  }
1637  //PullLFRphi
1638  if(layerswitchPullLFRphi) {
1639  layerMEs.mePullLFRphi = bookME1D(ibooker,"TH1PullLFRphi", hidmanager.createHistoLayer("Pull_LF_rphi","layer",label,"").c_str() ,"Pull distribution");
1640  layerMEs.mePullLFRphi->setAxisTitle("Pull distribution (local frame) in " + label);
1641  }
1642  //PullMFRphi
1643  if(layerswitchPullMFRphi) {
1644  layerMEs.mePullMFRphi = bookME1D(ibooker,"TH1PullMFRphi", hidmanager.createHistoLayer("Pull_MF_rphi","layer",label,"").c_str() ,"Pull distribution");
1645  layerMEs.mePullMFRphi->setAxisTitle("Pull distribution (measurement frame) in " + label);
1646  }
1647  //PullMFRphiwclus1
1649  layerMEs.mePullMFRphiwclus1 = bookME1D(ibooker,"TH1PullMFRphiwclus1", hidmanager.createHistoLayer("Pull_MF_wclus1_rphi","layer",label,"").c_str() ,"Pull distribution w=1");
1650  layerMEs.mePullMFRphiwclus1->setAxisTitle("Pull distribution (measurement frame) for w=1 in " + label);
1651  }
1652  //PullMFRphiwclus2
1654  layerMEs.mePullMFRphiwclus2 = bookME1D(ibooker,"TH1PullMFRphiwclus2", hidmanager.createHistoLayer("Pull_MF_wclus2_rphi","layer",label,"").c_str() ,"Pull distribution w=2");
1655  layerMEs.mePullMFRphiwclus2->setAxisTitle("Pull distribution (measurement frame) for w=2 in " + label);
1656  }
1657  //PullMFRphiwclus3
1659  layerMEs.mePullMFRphiwclus3 = bookME1D(ibooker,"TH1PullMFRphiwclus3", hidmanager.createHistoLayer("Pull_MF_wclus3_rphi","layer",label,"").c_str() ,"Pull distribution w=3");
1660  layerMEs.mePullMFRphiwclus3->setAxisTitle("Pull distribution (measurement frame) for w=3 in " + label);
1661  }
1662  //PullMFRphiwclus4
1664  layerMEs.mePullMFRphiwclus4 = bookME1D(ibooker,"TH1PullMFRphiwclus4", hidmanager.createHistoLayer("Pull_MF_wclus4_rphi","layer",label,"").c_str() ,"Pull distribution w=4");
1665  layerMEs.mePullMFRphiwclus4->setAxisTitle("Pull distribution (measurement frame) for w=4 in " + label);
1666  }
1667 
1669  layerMEs.meTrackangleRphi = bookME1D(ibooker,"TH1TrackangleRphi",hidmanager.createHistoLayer("Track_angle_Rphi","layer",label,"").c_str() ,"Track angle alpha");
1670  layerMEs.meTrackangleRphi->setAxisTitle("Track angle in "+ label);
1671  }
1673  layerMEs.meTrackanglebetaRphi = bookME1D(ibooker,"TH1TrackanglebetaRphi",hidmanager.createHistoLayer("Track_angle_beta_Rphi","layer",label,"").c_str() ,"Track angle beta");
1674  layerMEs.meTrackanglebetaRphi->setAxisTitle(""+ label);
1675  }
1677  layerMEs.meTrackangle2Rphi = bookME1D(ibooker,"TH1Trackangle2Rphi",hidmanager.createHistoLayer("Track_angle2_Rphi","layer",label,"").c_str() ,"");
1678  layerMEs.meTrackangle2Rphi->setAxisTitle(""+ label);
1679  }
1681  layerMEs.mePullTrackangleProfileRphi = bookMEProfile(ibooker,"TProfPullTrackangleProfileRphi",hidmanager.createHistoLayer("Pull_Trackangle_Profile_Rphi","layer",label,"").c_str() ,"Profile of Pull in MF vs track angle alpha");
1682  layerMEs.mePullTrackangleProfileRphi->setAxisTitle("Track angle alpha in "+ label,1);
1683  layerMEs.mePullTrackangleProfileRphi->setAxisTitle("Pull (MF) in "+ label,2);
1684  }
1686  layerMEs.mePullTrackangle2DRphi = bookME1D(ibooker,"TH1PullTrackangle2DRphi",hidmanager.createHistoLayer("Pull_Trackangle_2D_Rphi","layer",label,"").c_str() ,"");
1687  layerMEs.mePullTrackangle2DRphi->setAxisTitle(""+ label);
1688  }
1690  layerMEs.meTrackwidthRphi = bookME1D(ibooker,"TH1TrackwidthRphi",hidmanager.createHistoLayer("Track_width_Rphi","layer",label,"").c_str() ,"Track width");
1691  layerMEs.meTrackwidthRphi->setAxisTitle("Track width in "+ label);
1692  }
1694  layerMEs.meExpectedwidthRphi = bookME1D(ibooker,"TH1ExpectedwidthRphi",hidmanager.createHistoLayer("Expected_width_Rphi","layer",label,"").c_str() ,"Expected width");
1695  layerMEs.meExpectedwidthRphi->setAxisTitle("Expected width in "+ label);
1696  }
1698  layerMEs.meClusterwidthRphi = bookME1D(ibooker,"TH1ClusterwidthRphi",hidmanager.createHistoLayer("Cluster_width_Rphi","layer",label,"").c_str() ,"Cluster width");
1699  layerMEs.meClusterwidthRphi->setAxisTitle("Cluster width in "+ label);
1700  }
1702  layerMEs.meCategoryRphi = bookME1D(ibooker,"TH1CategoryRphi",hidmanager.createHistoLayer("Category_Rphi","layer",label,"").c_str() ,"Category");
1703  layerMEs.meCategoryRphi->setAxisTitle("Category in "+ label);
1704  }
1706  layerMEs.mePullTrackwidthProfileRphi = bookMEProfile(ibooker,"TProfPullTrackwidthProfileRphi",hidmanager.createHistoLayer("Pull_Track_width_Profile_Rphi","layer",label,"").c_str() ,"Profile of Pull in MF vs track width");
1707  layerMEs.mePullTrackwidthProfileRphi->setAxisTitle("track width in "+ label,1);
1708  layerMEs.mePullTrackwidthProfileRphi->setAxisTitle("Pull (MF) in "+ label,2);
1709  }
1711  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");
1712  layerMEs.mePullTrackwidthProfileRphiwclus1->setAxisTitle("track width for w=1 in "+ label,1);
1713  layerMEs.mePullTrackwidthProfileRphiwclus1->setAxisTitle("Pull (MF) for w=1 in "+ label,2);
1714  }
1716  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");
1717  layerMEs.mePullTrackwidthProfileRphiwclus2->setAxisTitle("track width for w=2 in "+ label,1);
1718  layerMEs.mePullTrackwidthProfileRphiwclus2->setAxisTitle("Pull (MF) for w=2 in "+ label,2);
1719 
1720  }
1722  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");
1723  layerMEs.mePullTrackwidthProfileRphiwclus3->setAxisTitle("track width for w=3 in "+ label,1);
1724  layerMEs.mePullTrackwidthProfileRphiwclus3->setAxisTitle("Pull (MF) for w=3 in "+ label,2);
1725  }
1727  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");
1728  layerMEs.mePullTrackwidthProfileRphiwclus4->setAxisTitle("track width for w=4 in "+ label,1);
1729  layerMEs.mePullTrackwidthProfileRphiwclus4->setAxisTitle("Pull (MF) for w=4 in "+ label,2);
1730 
1731  }
1733  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");
1734  layerMEs.mePullTrackwidthProfileCategory1Rphi->setAxisTitle("track width for Category 1 in "+ label,1);
1735  layerMEs.mePullTrackwidthProfileCategory1Rphi->setAxisTitle("Pull (MF) for Category 1 in "+ label,2);
1736  }
1738  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");
1739  layerMEs.mePullTrackwidthProfileCategory2Rphi->setAxisTitle("track width for Category 2 in "+ label,1);
1740  layerMEs.mePullTrackwidthProfileCategory2Rphi->setAxisTitle("Pull (MF) for Category 2 in "+ label,2);
1741  }
1743  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");
1744  layerMEs.mePullTrackwidthProfileCategory3Rphi->setAxisTitle("track width for Category 3 in "+ label,1);
1745  layerMEs.mePullTrackwidthProfileCategory3Rphi->setAxisTitle("Pull (MF) for Category 3 in "+ label,2);
1746  }
1748  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");
1749  layerMEs.mePullTrackwidthProfileCategory4Rphi->setAxisTitle("track width for Category 4 in "+ label,1);
1750  layerMEs.mePullTrackwidthProfileCategory4Rphi->setAxisTitle("Pull (MF) for Category 4 in "+ label,2);
1751  }
1753  layerMEs.meResolxMFTrackwidthProfileRphi = bookMEProfile(ibooker,"TProfResolxMFTrackwidthProfileRphi",hidmanager.createHistoLayer("ResolxMF_Track_width_Profile_Rphi","layer",label,"").c_str() ,"Profile of Resolution in MF vs track width");
1754  layerMEs.meResolxMFTrackwidthProfileRphi->setAxisTitle("track width in "+ label,1);
1755  layerMEs.meResolxMFTrackwidthProfileRphi->setAxisTitle("Resolution in MF in "+ label,2);
1756  }
1757 
1759  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");
1760  layerMEs.meResolxMFTrackwidthProfileWclus1Rphi->setAxisTitle("track width for w=1 in "+ label,1);
1761  layerMEs.meResolxMFTrackwidthProfileWclus1Rphi->setAxisTitle("Resolution in MF for w=1 in "+ label,2);
1762  }
1764  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");
1765  layerMEs.meResolxMFTrackwidthProfileWclus2Rphi->setAxisTitle("track width for w=2 in "+ label,1);
1766  layerMEs.meResolxMFTrackwidthProfileWclus2Rphi->setAxisTitle("Resolution in MF for w=2 in "+ label,2);
1767  }
1769  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");
1770  layerMEs.meResolxMFTrackwidthProfileWclus3Rphi->setAxisTitle("track width for w=3 in "+ label,1);
1771  layerMEs.meResolxMFTrackwidthProfileWclus3Rphi->setAxisTitle("Resolution in MF for w=3 in "+ label,2);
1772  }
1774  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");
1775  layerMEs.meResolxMFTrackwidthProfileWclus4Rphi->setAxisTitle("track width for w=4 in "+ label,1);
1776  layerMEs.meResolxMFTrackwidthProfileWclus4Rphi->setAxisTitle("Resolution in MF for w=4 in "+ label,2);
1777  }
1779  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");
1780  layerMEs.meResMFTrackwidthProfileWclus1Rphi->setAxisTitle("track width for w=1 in "+ label,1);
1781  layerMEs.meResMFTrackwidthProfileWclus1Rphi->setAxisTitle("Residuals(x) in MF for w=1 in "+ label,2);
1782  }
1784  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");
1785  layerMEs.meResMFTrackwidthProfileWclus2Rphi->setAxisTitle("track width for w=2 in "+ label,1);
1786  layerMEs.meResMFTrackwidthProfileWclus2Rphi->setAxisTitle("Residuals(x) in MF for w=2 in "+ label,2);
1787  }
1789  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");
1790  layerMEs.meResMFTrackwidthProfileWclus3Rphi->setAxisTitle("track width for w=3 in "+ label,1);
1791  layerMEs.meResMFTrackwidthProfileWclus3Rphi->setAxisTitle("Residuals(x) in MF for w=3 in "+ label,2);
1792  }
1794  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");
1795  layerMEs.meResMFTrackwidthProfileWclus4Rphi->setAxisTitle("track width for w=4 in "+ label,1);
1796  layerMEs.meResMFTrackwidthProfileWclus4Rphi->setAxisTitle("Residuals(x) in MF for w=4 in "+ label,2);
1797  }
1798 
1800  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");
1801  layerMEs.meResolxMFTrackwidthProfileCategory1Rphi->setAxisTitle("track width for Category 1 in "+ label,1);
1802  layerMEs.meResolxMFTrackwidthProfileCategory1Rphi->setAxisTitle("Resolution in MF for Category 1 in "+ label,2);
1803  }
1805  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");
1806  layerMEs.meResolxMFTrackwidthProfileCategory2Rphi->setAxisTitle("track width for Category 2 in "+ label,1);
1807  layerMEs.meResolxMFTrackwidthProfileCategory2Rphi->setAxisTitle("Resolution in MF for Category 2 in "+ label,2);
1808  }
1810  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");
1811  layerMEs.meResolxMFTrackwidthProfileCategory3Rphi->setAxisTitle("track width for Category 3 in "+ label,1);
1812  layerMEs.meResolxMFTrackwidthProfileCategory3Rphi->setAxisTitle("Resolution in MF for Category 3 in "+ label,2);
1813  }
1815  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");
1816  layerMEs.meResolxMFTrackwidthProfileCategory4Rphi->setAxisTitle("track width for Category 4 in "+ label,1);
1817  layerMEs.meResolxMFTrackwidthProfileCategory4Rphi->setAxisTitle("Resolution in MF for Category 4 in "+ label,2);
1818  }
1820  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");
1821  layerMEs.meResolxMFClusterwidthProfileCategory1Rphi->setAxisTitle("cluster width for Category 1 in "+ label,1);
1822  layerMEs.meResolxMFClusterwidthProfileCategory1Rphi->setAxisTitle("Resolution in MF for Category 1 in "+ label,2);
1823  }
1825  layerMEs.meResolxMFAngleProfileRphi = bookMEProfile(ibooker,"TProfResolxMFAngleProfileRphi",hidmanager.createHistoLayer("ResolxMF_Angle_Profile_Rphi","layer",label,"").c_str() ,"Profile of Resolution in MF vs track angle alpha");
1826  layerMEs.meResolxMFAngleProfileRphi->setAxisTitle("track angle alpha in "+ label,1);
1827  layerMEs.meResolxMFAngleProfileRphi->setAxisTitle("Resolution in MF in "+ label,2);
1828  }
1830  layerMEs.merapidityResProfilewclus1 = bookMEProfile(ibooker,"TProfrapidityResProfilewclus1",hidmanager.createHistoLayer("rapidity_Res_Profile_wclus1","layer",label,"").c_str() ,"Profile of rapidity vs Res for w=1");
1831  layerMEs.merapidityResProfilewclus1->setAxisTitle("Res for w=1 in "+ label,1);
1832  layerMEs.merapidityResProfilewclus1->setAxisTitle("rapidity for w=1 in "+ label,2);
1833  }
1835  layerMEs.merapidityResProfilewclus2 = bookMEProfile(ibooker,"TProfrapidityResProfilewclus2",hidmanager.createHistoLayer("rapidity_Res_Profile_wclus2","layer",label,"").c_str() ,"Profile of rapidity vs Res for w=2");
1836  layerMEs.merapidityResProfilewclus2->setAxisTitle("Res for w=2 in "+ label,1);
1837  layerMEs.merapidityResProfilewclus2->setAxisTitle("rapidity for w=2 in "+ label,2);
1838  }
1840  layerMEs.merapidityResProfilewclus3 = bookMEProfile(ibooker,"TProfrapidityResProfilewclus3",hidmanager.createHistoLayer("rapidity_Res_Profile_wclus3","layer",label,"").c_str() ,"Profile of rapidity vs Res for w=3");
1841  layerMEs.merapidityResProfilewclus3->setAxisTitle("Res for w=3 in "+ label,1);
1842  layerMEs.merapidityResProfilewclus3->setAxisTitle("rapidity for w=3 in "+ label,2);
1843  }
1845  layerMEs.merapidityResProfilewclus4 = bookMEProfile(ibooker,"TProfrapidityResProfilewclus4",hidmanager.createHistoLayer("rapidity_Res_Profile_wclus4","layer",label,"").c_str() ,"Profile of rapidity vs Res for w=4");
1846  layerMEs.merapidityResProfilewclus4->setAxisTitle("Res for w=4 in "+ label,1);
1847  layerMEs.merapidityResProfilewclus4->setAxisTitle("rapidity for w=4 in "+ label,2);
1848  }
1849 
1850 
1851  LayerMEsMap[label]=layerMEs;
1852 
1853 }
1854 //------------------------------------------------------------------------------------------
1856 {
1857  SiStripHistoId hidmanager;
1858  StereoAndMatchedMEs stereoandmatchedMEs;
1859 
1860  stereoandmatchedMEs.meWclusSas = nullptr;
1861  stereoandmatchedMEs.meAdcSas = nullptr;
1862  stereoandmatchedMEs.meResolxLFSas = nullptr;
1863  stereoandmatchedMEs.meResolxMFSas = nullptr;
1864  stereoandmatchedMEs.meResLFSas = nullptr;
1865  stereoandmatchedMEs.meResMFSas = nullptr;
1866  stereoandmatchedMEs.mePullLFSas = nullptr;
1867  stereoandmatchedMEs.mePullMFSas = nullptr;
1868  stereoandmatchedMEs.meTrackangleSas = nullptr;
1869  stereoandmatchedMEs.meTrackanglebetaSas = nullptr;
1870  stereoandmatchedMEs.mePullTrackangleProfileSas = nullptr;
1871  stereoandmatchedMEs.meTrackwidthSas = nullptr;
1872  stereoandmatchedMEs.meExpectedwidthSas = nullptr;
1873  stereoandmatchedMEs.meClusterwidthSas = nullptr;
1874  stereoandmatchedMEs.meCategorySas = nullptr;
1875  stereoandmatchedMEs.mePullTrackwidthProfileSas = nullptr;
1876  stereoandmatchedMEs.mePullTrackwidthProfileCategory1Sas = nullptr;
1877  stereoandmatchedMEs.mePullTrackwidthProfileCategory2Sas = nullptr;
1878  stereoandmatchedMEs.mePullTrackwidthProfileCategory3Sas = nullptr;
1879  stereoandmatchedMEs.mePullTrackwidthProfileCategory4Sas = nullptr;
1880  stereoandmatchedMEs.meResolxMFTrackwidthProfileSas = nullptr;
1881  stereoandmatchedMEs.meResolxMFTrackwidthProfileCategory1Sas = nullptr;
1882  stereoandmatchedMEs.meResolxMFTrackwidthProfileCategory2Sas = nullptr;
1883  stereoandmatchedMEs.meResolxMFTrackwidthProfileCategory3Sas = nullptr;
1884  stereoandmatchedMEs.meResolxMFTrackwidthProfileCategory4Sas = nullptr;
1885  stereoandmatchedMEs.meResolxMFClusterwidthProfileCategory1Sas = nullptr;
1886  stereoandmatchedMEs.meResolxMFAngleProfileSas = nullptr;
1887 
1888  stereoandmatchedMEs.mePosxMatched = nullptr;
1889  stereoandmatchedMEs.mePosyMatched = nullptr;
1890  stereoandmatchedMEs.meResolxMatched = nullptr;
1891  stereoandmatchedMEs.meResolyMatched = nullptr;
1892  stereoandmatchedMEs.meResxMatched = nullptr;
1893  stereoandmatchedMEs.meResyMatched = nullptr;
1894  stereoandmatchedMEs.mePullxMatched = nullptr;
1895  stereoandmatchedMEs.mePullyMatched = nullptr;
1896 
1897  //WclusSas
1898  if(layerswitchWclusSas) {
1899  stereoandmatchedMEs.meWclusSas = bookME1D(ibooker,"TH1WclusSas", hidmanager.createHistoLayer("Wclus_sas","layer",label,"").c_str() ,"Cluster Width - Number of strips that belong to the RecHit cluster");
1900  stereoandmatchedMEs.meWclusSas->setAxisTitle("Cluster Width [nr strips] (stereo) in "+ label);
1901  }
1902  //AdcSas
1903  if(layerswitchAdcSas) {
1904  stereoandmatchedMEs.meAdcSas = bookME1D(ibooker,"TH1AdcSas", hidmanager.createHistoLayer("Adc_sas","layer",label,"").c_str() ,"RecHit Cluster Charge");
1905  stereoandmatchedMEs.meAdcSas->setAxisTitle("cluster charge [ADC] (stereo) in " + label);
1906  }
1907  //ResolxLFSas
1909  stereoandmatchedMEs.meResolxLFSas = bookME1D(ibooker,"TH1ResolxLFSas", hidmanager.createHistoLayer("Resolx_LF_sas","layer",label,"").c_str() ,"RecHit resol(x) coord.");
1910  stereoandmatchedMEs.meResolxLFSas->setAxisTitle("resol(x) RecHit coord. (local frame) (stereo) in " + label);
1911  }
1912  //ResolxMFSas
1914  stereoandmatchedMEs.meResolxMFSas = bookME1D(ibooker,"TH1ResolxMFSas", hidmanager.createHistoLayer("Resolx_MF_sas","layer",label,"").c_str() ,"RecHit resol(x) coord.");
1915  stereoandmatchedMEs.meResolxMFSas->setAxisTitle("resol(x) RecHit coord. (measurement frame) (stereo) in " + label);
1916  }
1917  //ResLFSas
1918  if(layerswitchResLFSas) {
1919  stereoandmatchedMEs.meResLFSas = bookME1D(ibooker,"TH1ResLFSas", hidmanager.createHistoLayer("Res_LF_sas","layer",label,"").c_str() ,"Residual of the hit x coordinate");
1920  stereoandmatchedMEs.meResLFSas->setAxisTitle("Hit Residuals(x) (local frame) (stereo) in " + label);
1921  }
1922  //ResMFSas
1923  if(layerswitchResMFSas) {
1924  stereoandmatchedMEs.meResMFSas = bookME1D(ibooker,"TH1ResMFSas", hidmanager.createHistoLayer("Res_MF_sas","layer",label,"").c_str() ,"Residual of the hit x coordinate");
1925  stereoandmatchedMEs.meResMFSas->setAxisTitle("Hit Residuals(x) (stereo) in " + label);
1926  }
1927  //PullLFSas
1928  if(layerswitchPullLFSas) {
1929  stereoandmatchedMEs.mePullLFSas = bookME1D(ibooker,"TH1PullLFSas", hidmanager.createHistoLayer("Pull_LF_sas","layer",label,"").c_str() ,"Pull distribution");
1930  stereoandmatchedMEs.mePullLFSas->setAxisTitle("Pull distribution (local frame) (stereo) in " + label);
1931  }
1932  //PullMFSas
1933  if(layerswitchPullMFSas) {
1934  stereoandmatchedMEs.mePullMFSas = bookME1D(ibooker,"TH1PullMFSas", hidmanager.createHistoLayer("Pull_MF_sas","layer",label,"").c_str() ,"Pull distribution");
1935  stereoandmatchedMEs.mePullMFSas->setAxisTitle("Pull distribution (measurement frame) (stereo) in " + label);
1936  }
1937 
1939  stereoandmatchedMEs.meTrackangleSas = bookME1D(ibooker,"TH1TrackangleSas",hidmanager.createHistoLayer("Track_angle_Sas","layer",label,"").c_str() ,"Track angle");
1940  stereoandmatchedMEs.meTrackangleSas->setAxisTitle("Track angle (stereo) in " + label);
1941  }
1943  stereoandmatchedMEs.meTrackanglebetaSas = bookME1D(ibooker,"TH1TrackanglebetaSas",hidmanager.createHistoLayer("Track_angle_beta_Sas","layer",label,"").c_str() ,"Track angle beta");
1944  stereoandmatchedMEs.meTrackanglebetaSas->setAxisTitle("Track angle beta (stereo) in " + label);
1945  }
1947  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)");
1948  stereoandmatchedMEs.mePullTrackangleProfileSas->setAxisTitle("track angle (stereo) in " + label,1);
1949  stereoandmatchedMEs.mePullTrackangleProfileSas->setAxisTitle("Pull in MF (stereo) in " + label,2);
1950  }
1952  stereoandmatchedMEs.meTrackwidthSas = bookME1D(ibooker,"TH1TrackwidthSas",hidmanager.createHistoLayer("Track_width_Sas","layer",label,"").c_str() ,"Track width");
1953  stereoandmatchedMEs.meTrackwidthSas->setAxisTitle("Track width (stereo) in " + label);
1954  }
1956  stereoandmatchedMEs.meExpectedwidthSas = bookME1D(ibooker,"TH1ExpectedwidthSas",hidmanager.createHistoLayer("Expected_width_Sas","layer",label,"").c_str() ,"Expected width");
1957  stereoandmatchedMEs.meExpectedwidthSas->setAxisTitle("Expected width (stereo) in " + label);
1958  }
1960  stereoandmatchedMEs.meClusterwidthSas = bookME1D(ibooker,"TH1ClusterwidthSas",hidmanager.createHistoLayer("Cluster_width_Sas","layer",label,"").c_str() ,"Cluster width");
1961  stereoandmatchedMEs.meClusterwidthSas->setAxisTitle("Cluster width (stereo) in " + label);
1962  }
1964  stereoandmatchedMEs.meCategorySas = bookME1D(ibooker,"TH1CategorySas",hidmanager.createHistoLayer("Category_Sas","layer",label,"").c_str() ,"Category");
1965  stereoandmatchedMEs.meCategorySas->setAxisTitle("Category (stereo) in " + label);
1966  }
1968  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)");
1969  stereoandmatchedMEs.mePullTrackwidthProfileSas->setAxisTitle("track width (stereo) in " + label,1);
1970  stereoandmatchedMEs.mePullTrackwidthProfileSas->setAxisTitle("Pull in MF (stereo) in " + label,2);
1971  }
1973  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)");
1974  stereoandmatchedMEs.mePullTrackwidthProfileCategory1Sas->setAxisTitle("track width (Category 1) (stereo) in " + label,1);
1975  stereoandmatchedMEs.mePullTrackwidthProfileCategory1Sas->setAxisTitle("Pull in MF (Category 1) (stereo) in " + label,2);
1976  }
1978  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)");
1979  stereoandmatchedMEs.mePullTrackwidthProfileCategory2Sas->setAxisTitle("track width (Category 2) (stereo) in " + label,1);
1980  stereoandmatchedMEs.mePullTrackwidthProfileCategory2Sas->setAxisTitle("Pull in MF (Category 2) (stereo) in " + label,2);
1981  }
1983  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)");
1984  stereoandmatchedMEs.mePullTrackwidthProfileCategory3Sas->setAxisTitle("track width (Category 3) (stereo) in " + label,1);
1985  stereoandmatchedMEs.mePullTrackwidthProfileCategory3Sas->setAxisTitle("Pull in MF (Category 3) (stereo) in " + label,2);
1986  }
1988  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)");
1989  stereoandmatchedMEs.mePullTrackwidthProfileCategory4Sas->setAxisTitle("track width (Category 4) (stereo) in " + label,1);
1990  stereoandmatchedMEs.mePullTrackwidthProfileCategory4Sas->setAxisTitle("Pull in MF (Category 4) (stereo) in " + label,2);
1991  }
1993  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)");
1994  stereoandmatchedMEs.meResolxMFTrackwidthProfileSas->setAxisTitle("track width (stereo) in " + label,1);
1995  stereoandmatchedMEs.meResolxMFTrackwidthProfileSas->setAxisTitle("Resolution in MF (stereo) in " + label,2);
1996  }
1998  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)");
1999  stereoandmatchedMEs.meResolxMFTrackwidthProfileCategory1Sas->setAxisTitle(" track width (Category 1) (stereo) in " + label,1);
2000  stereoandmatchedMEs.meResolxMFTrackwidthProfileCategory1Sas->setAxisTitle(" Resolution in MF (Category 1) (stereo) in " + label,2);
2001  }
2003  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)");
2004  stereoandmatchedMEs.meResolxMFTrackwidthProfileCategory2Sas->setAxisTitle(" track width (Category 2) (stereo) in " + label,1);
2005  stereoandmatchedMEs.meResolxMFTrackwidthProfileCategory2Sas->setAxisTitle(" Resolution in MF (Category 2) (stereo) in " + label,2);
2006  }
2008  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)");
2009  stereoandmatchedMEs.meResolxMFTrackwidthProfileCategory3Sas->setAxisTitle(" track width (Category 3) (stereo) in " + label,1);
2010  stereoandmatchedMEs.meResolxMFTrackwidthProfileCategory3Sas->setAxisTitle(" Resolution in MF (Category 3) (stereo) in " + label,2);
2011  }
2013  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)");
2014  stereoandmatchedMEs.meResolxMFTrackwidthProfileCategory4Sas->setAxisTitle(" track width (Category 4) (stereo) in " + label,1);
2015  stereoandmatchedMEs.meResolxMFTrackwidthProfileCategory4Sas->setAxisTitle(" Resolution in MF (Category 4) (stereo) in " + label,2);
2016  }
2018  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)");
2019  stereoandmatchedMEs.meResolxMFClusterwidthProfileCategory1Sas->setAxisTitle("cluster width (Category 1) (stereo) in " + label,1);
2020  stereoandmatchedMEs.meResolxMFClusterwidthProfileCategory1Sas->setAxisTitle(" Resolution in MF (Category 1) (stereo) in " + label,2);
2021  }
2023  stereoandmatchedMEs.meResolxMFAngleProfileSas = bookMEProfile(ibooker,"TProfResolxMFAngleProfileSas",hidmanager.createHistoLayer("ResolxMF_Angle_Profile_Sas","layer",label,"").c_str() ,"Profile of Resolution in MF vs track angle (stereo)");
2024  stereoandmatchedMEs.meResolxMFAngleProfileSas->setAxisTitle("track angle (stereo) in " + label,1);
2025  stereoandmatchedMEs.meResolxMFAngleProfileSas->setAxisTitle("Resolution in MF (stereo) in " + label,2);
2026  }
2027  //PosxMatched
2029  stereoandmatchedMEs.mePosxMatched = bookME1D(ibooker,"TH1PosxMatched", hidmanager.createHistoLayer("Posx_matched","layer",label,"").c_str() ,"RecHit x coord.");
2030  stereoandmatchedMEs.mePosxMatched->setAxisTitle("x coord. matched RecHit (local frame) in " + label);
2031  }
2032  //PosyMatched
2034  stereoandmatchedMEs.mePosyMatched = bookME1D(ibooker,"TH1PosyMatched", hidmanager.createHistoLayer("Posy_matched","layer",label,"").c_str() ,"RecHit y coord.");
2035  stereoandmatchedMEs.mePosyMatched->setAxisTitle("y coord. matched RecHit (local frame) in " + label);
2036  }
2037  //ResolxMatched
2039  stereoandmatchedMEs.meResolxMatched = bookME1D(ibooker,"TH1ResolxMatched", hidmanager.createHistoLayer("Resolx_matched","layer",label,"").c_str() ,"RecHit resol(x) coord.");
2040  stereoandmatchedMEs.meResolxMatched->setAxisTitle("resol(x) coord. matched RecHit (local frame) in " + label);
2041  }
2042  //ResolyMatched
2044  stereoandmatchedMEs.meResolyMatched = bookME1D(ibooker,"TH1ResolyMatched", hidmanager.createHistoLayer("Resoly_matched","layer",label,"").c_str() ,"RecHit resol(y) coord.");
2045  stereoandmatchedMEs.meResolyMatched->setAxisTitle("resol(y) coord. matched RecHit (local frame) in " + label);
2046  }
2047  //ResxMatched
2049  stereoandmatchedMEs.meResxMatched = bookME1D(ibooker,"TH1ResxMatched", hidmanager.createHistoLayer("Resx_matched","layer",label,"").c_str() ,"Residual of the hit x coord.");
2050  stereoandmatchedMEs.meResxMatched->setAxisTitle("Residuals(x) in matched RecHit in " + label);
2051  }
2052  //ResyMatched
2054  stereoandmatchedMEs.meResyMatched = bookME1D(ibooker,"TH1ResyMatched", hidmanager.createHistoLayer("Resy_matched","layer",label,"").c_str() ,"Residual of the hit x coord.");
2055  stereoandmatchedMEs.meResyMatched->setAxisTitle("Res(y) in matched RecHit in " + label);
2056  }
2057 
2058  StereoAndMatchedMEsMap[label]=stereoandmatchedMEs;
2059 
2060 }
2061 //------------------------------------------------------------------------------------------
2062 inline MonitorElement* SiStripTrackingRecHitsValid::bookME1D(DQMStore::IBooker & ibooker,const char* ParameterSetLabel, const char* HistoName, const char* HistoTitle)
2063 {
2064  Parameters = conf_.getParameter<edm::ParameterSet>(ParameterSetLabel);
2065  return ibooker.book1D(HistoName,HistoTitle,
2066  Parameters.getParameter<int32_t>("Nbinx"),
2067  Parameters.getParameter<double>("xmin"),
2068  Parameters.getParameter<double>("xmax")
2069  );
2070 }
2071 //------------------------------------------------------------------------------------------
2072 inline MonitorElement* SiStripTrackingRecHitsValid::bookMEProfile(DQMStore::IBooker & ibooker,const char* ParameterSetLabel, const char* HistoName, const char* HistoTitle)
2073 {
2074  Parameters = conf_.getParameter<edm::ParameterSet>(ParameterSetLabel);
2075  //The number of channels in Y is disregarded in a profile plot.
2076  return ibooker.bookProfile(HistoName,HistoTitle,
2077  Parameters.getParameter<int32_t>("Nbinx"),
2078  Parameters.getParameter<double>("xmin"),
2079  Parameters.getParameter<double>("xmax"),
2080  Parameters.getParameter<double>("ymin"),
2081  Parameters.getParameter<double>("ymax"),
2082  ""
2083  );
2084 }
2085 
2086 // 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
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 getTIBDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tibDetRawIds, const TrackerTopology *trackerTopology, uint32_t layer=0, uint32_t bkw_frw=0, uint32_t int_ext=0, uint32_t string=0)
void addActiveDetectorsRawIds(std::vector< uint32_t > &) const
void setSiStripFolderName(std::string name)
LocalError localPositionError() const final
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:160
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
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
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:47
T y() const
Definition: PV3DBase.h:63
std::map< std::string, LayerMEs > LayerMEsMap
void getTIDDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tidDetRawIds, const TrackerTopology *trackerTopology, uint32_t side=0, uint32_t wheel=0, uint32_t ring=0, uint32_t ster=0)
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
const Bounds & bounds() const
Definition: Surface.h:120
void setLayerFolder(uint32_t rawdetid, const TrackerTopology *tTopo, int32_t layer=0, bool ring_flag=false)
void createLayerMEs(DQMStore::IBooker &ibooker, std::string label)
void getTECDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tecDetRawIds, const TrackerTopology *trackerTopology, 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)
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
void analyze(const edm::Event &e, const edm::EventSetup &c) override
const TrackerGeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
bool tecIsStereo(const DetId &id) const
float xy() const
Definition: LocalError.h:25
void createSimpleHitsMEs(DQMStore::IBooker &ibooker)
vector< ParameterSet > Parameters
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
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
virtual MeasurementPoint measurementPosition(const LocalPoint &) const =0
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
float uu() const
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:118
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
T min(T a, T b)
Definition: MathUtil.h:58
std::string getSubdetid(uint32_t id, const TrackerTopology *tTopo, bool flag_ring)
virtual LocalPoint localPosition() const =0
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
const Topology & topology() const override
Returns a reference to the strip proxy topology.
Definition: DetId.h:18
unsigned int stereo() const
stereo
SiStripRecHit2D stereoHit() const
virtual float thickness() const =0
bool tibIsStereo(const DetId &id) const
void createStereoAndMatchedMEs(DQMStore::IBooker &ibooker, std::string label)
virtual float localPitch(const LocalPoint &) const =0
std::string HistoName
std::pair< std::string, int32_t > GetSubDetAndLayer(const uint32_t &detid, const TrackerTopology *tTopo, bool ring_flag=false)
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
T get() const
Definition: EventSetup.h:63
const TrackerGeomDet * idToDet(DetId) const override
std::vector< PSimHit > associateHit(const TrackingRecHit &thit) const
LocalPoint localPosition() const final
virtual LocalVector driftDirection(const StripGeomDetUnit *) const =0
std::map< std::string, std::vector< uint32_t > > StereoAndMatchedDetMap
void bookHistograms(DQMStore::IBooker &ibooker, const edm::Run &run, const edm::EventSetup &es) override
DetId geographicalId() const
dbl *** dir
Definition: mlp_gen.cc:35
void getTOBDetectors(const std::vector< uint32_t > &inputDetRawIds, std::vector< uint32_t > &tobDetRawIds, const TrackerTopology *trackerTopology, uint32_t layer=0, uint32_t bkw_frw=0, uint32_t rod=0)
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
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:44