CMS 3D CMS Logo

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