CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
V0Validator.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: V0Validator
4 // Class: V0Validator
5 //
13 //
14 // Original Author: Brian Drell
15 // Created: Wed Feb 18 17:21:04 MST 2009
16 // $Id: V0Validator.cc,v 1.8 2010/03/26 22:04:49 drell Exp $
17 //
18 //
19 
20 
23 
24 typedef std::vector<TrackingVertex> TrackingVertexCollection;
28 
29 const double piMass = 0.13957018;
30 const double piMassSquared = piMass*piMass;
31 const double protonMass = 0.93827203;
33 
34 
35 
37  theDQMRootFileName(iConfig.getParameter<std::string>("DQMRootFileName")),
38  k0sCollectionTag(iConfig.getParameter<edm::InputTag>("kShortCollection")),
39  lamCollectionTag(iConfig.getParameter<edm::InputTag>("lambdaCollection")),
40  dirName(iConfig.getParameter<std::string>("dirName")) {
44 }
45 
46 
48 
49 }
50 
51 //void V0Validator::beginRun(const edm::Run& iRun, const edm::EventSetup& iSetup) {
52 //void V0Validator::beginJob(const edm::EventSetup& iSetup) {
53 //}
54 
55 //void V0Validator::beginJob(const edm::EventSetup& iSetup) {
56 void V0Validator::beginRun(const edm::Run& iRun, const edm::EventSetup& iSetup) {
57  //std::cout << "Running V0Validator" << std::endl;
58  //theDQMstore = edm::Service<DQMStore>().operator->();
59  //std::cout << "In beginJob() at line 1" << std::endl;
60  //edm::Service<TFileService> fs;
61 
62  theDQMstore->cd();
63  std::string subDirName = dirName + "/EffFakes";
64  theDQMstore->setCurrentFolder(subDirName.c_str());
65 
66  ksEffVsR = theDQMstore->book1D("K0sEffVsR",
67  "K^{0}_{S} Efficiency vs #rho", 40, 0., 40.);
68  ksEffVsEta = theDQMstore->book1D("K0sEffVsEta",
69  "K^{0}_{S} Efficiency vs #eta", 40, -2.5, 2.5);
70  ksEffVsPt = theDQMstore->book1D("K0sEffVsPt",
71  "K^{0}_{S} Efficiency vs p_{T}", 70, 0., 20.);;
72 
73  ksTkEffVsR = theDQMstore->book1D("K0sTkEffVsR",
74  "K^{0}_{S} Tracking Efficiency vs #rho", 40, 0., 40.);
75  ksTkEffVsEta = theDQMstore->book1D("K0sTkEffVsEta",
76  "K^{0}_{S} Tracking Efficiency vs #eta", 40, -2.5, 2.5);
77  ksTkEffVsPt = theDQMstore->book1D("K0sTkEffVsPt",
78  "K^{0}_{S} Tracking Efficiency vs p_{T}", 70, 0., 20.);
79 
80  ksEffVsR_num = theDQMstore->book1D("K0sEffVsR_num",
81  "K^{0}_{S} Efficiency vs #rho", 40, 0., 40.);
82  ksEffVsEta_num = theDQMstore->book1D("K0sEffVsEta_num",
83  "K^{0}_{S} Efficiency vs #eta", 40, -2.5, 2.5);
84  ksEffVsPt_num = theDQMstore->book1D("K0sEffVsPt_num",
85  "K^{0}_{S} Efficiency vs p_{T}", 70, 0., 20.);;
86 
87  ksTkEffVsR_num = theDQMstore->book1D("K0sTkEffVsR_num",
88  "K^{0}_{S} Tracking Efficiency vs #rho", 40, 0., 40.);
89  ksTkEffVsEta_num = theDQMstore->book1D("K0sTkEffVsEta_num",
90  "K^{0}_{S} Tracking Efficiency vs #eta", 40, -2.5, 2.5);
91  ksTkEffVsPt_num = theDQMstore->book1D("K0sTkEffVsPt_num",
92  "K^{0}_{S} Tracking Efficiency vs p_{T}", 70, 0., 20.);;
93 
94 
95  ksEffVsR_denom = theDQMstore->book1D("K0sEffVsR_denom",
96  "K^{0}_{S} Efficiency vs #rho", 40, 0., 40.);
97  ksEffVsEta_denom = theDQMstore->book1D("K0sEffVsEta_denom",
98  "K^{0}_{S} Efficiency vs #eta", 40, -2.5, 2.5);
99  ksEffVsPt_denom = theDQMstore->book1D("K0sEffVsPt_denom",
100  "K^{0}_{S} Efficiency vs p_{T}", 70, 0., 20.);;
101 
102 
103  lamEffVsR = theDQMstore->book1D("LamEffVsR",
104  "#Lambda^{0} Efficiency vs #rho", 40, 0., 40.);
105  lamEffVsEta = theDQMstore->book1D("LamEffVsEta",
106  "#Lambda^{0} Efficiency vs #eta", 40, -2.5, 2.5);
107  lamEffVsPt = theDQMstore->book1D("LamEffVsPt",
108  "#Lambda^{0} Efficiency vs p_{T}", 70, 0., 20.);
109 
110 
111  lamTkEffVsR = theDQMstore->book1D("LamTkEffVsR",
112  "#Lambda^{0} TrackingEfficiency vs #rho", 40, 0., 40.);
113  lamTkEffVsEta = theDQMstore->book1D("LamTkEffVsEta",
114  "#Lambda^{0} Tracking Efficiency vs #eta", 40, -2.5, 2.5);
115  lamTkEffVsPt = theDQMstore->book1D("LamTkEffVsPt",
116  "#Lambda^{0} Tracking Efficiency vs p_{T}", 70, 0., 20.);
117 
118  lamEffVsR_num = theDQMstore->book1D("LamEffVsR_num",
119  "#Lambda^{0} Efficiency vs #rho", 40, 0., 40.);
120  lamEffVsEta_num = theDQMstore->book1D("LamEffVsEta_num",
121  "#Lambda^{0} Efficiency vs #eta", 40, -2.5, 2.5);
122  lamEffVsPt_num = theDQMstore->book1D("LamEffVsPt_num",
123  "#Lambda^{0} Efficiency vs p_{T}", 70, 0., 20.);
124 
125 
126  lamTkEffVsR_num = theDQMstore->book1D("LamTkEffVsR_num",
127  "#Lambda^{0} TrackingEfficiency vs #rho", 40, 0., 40.);
128  lamTkEffVsEta_num = theDQMstore->book1D("LamTkEffVsEta_num",
129  "#Lambda^{0} Tracking Efficiency vs #eta", 40, -2.5, 2.5);
130  lamTkEffVsPt_num = theDQMstore->book1D("LamTkEffVsPt_num",
131  "#Lambda^{0} Tracking Efficiency vs p_{T}", 70, 0., 20.);
132 
133 
134  lamEffVsR_denom = theDQMstore->book1D("LamEffVsR_denom",
135  "#Lambda^{0} Efficiency vs #rho", 40, 0., 40.);
136  lamEffVsEta_denom = theDQMstore->book1D("LamEffVsEta_denom",
137  "#Lambda^{0} Efficiency vs #eta", 40, -2.5, 2.5);
138  lamEffVsPt_denom = theDQMstore->book1D("LamEffVsPt_denom",
139  "#Lambda^{0} Efficiency vs p_{T}", 70, 0., 20.);
140 
141  //theDQMstore->cd();
142  //subDirName = dirName + "/Fake";
143  //theDQMstore->setCurrentFolder(subDirName.c_str());
144 
145 
146  ksFakeVsR = theDQMstore->book1D("K0sFakeVsR",
147  "K^{0}_{S} Fake Rate vs #rho", 40, 0., 40.);
148  ksFakeVsEta = theDQMstore->book1D("K0sFakeVsEta",
149  "K^{0}_{S} Fake Rate vs #eta", 40, -2.5, 2.5);
150  ksFakeVsPt = theDQMstore->book1D("K0sFakeVsPt",
151  "K^{0}_{S} Fake Rate vs p_{T}", 70, 0., 20.);
152  ksTkFakeVsR = theDQMstore->book1D("K0sTkFakeVsR",
153  "K^{0}_{S} Tracking Fake Rate vs #rho", 40, 0., 40.);
154  ksTkFakeVsEta = theDQMstore->book1D("K0sTkFakeVsEta",
155  "K^{0}_{S} Tracking Fake Rate vs #eta", 40, -2.5, 2.5);
156  ksTkFakeVsPt = theDQMstore->book1D("K0sTkFakeVsPt",
157  "K^{0}_{S} Tracking Fake Rate vs p_{T}", 70, 0., 20.);
158 
159  ksFakeVsR_num = theDQMstore->book1D("K0sFakeVsR_num",
160  "K^{0}_{S} Fake Rate vs #rho", 40, 0., 40.);
161  ksFakeVsEta_num = theDQMstore->book1D("K0sFakeVsEta_num",
162  "K^{0}_{S} Fake Rate vs #eta", 40, -2.5, 2.5);
163  ksFakeVsPt_num = theDQMstore->book1D("K0sFakeVsPt_num",
164  "K^{0}_{S} Fake Rate vs p_{T}", 70, 0., 20.);
165  ksTkFakeVsR_num = theDQMstore->book1D("K0sTkFakeVsR_num",
166  "K^{0}_{S} Tracking Fake Rate vs #rho", 40, 0., 40.);
167  ksTkFakeVsEta_num = theDQMstore->book1D("K0sTkFakeVsEta_num",
168  "K^{0}_{S} Tracking Fake Rate vs #eta", 40, -2.5, 2.5);
169  ksTkFakeVsPt_num = theDQMstore->book1D("K0sTkFakeVsPt_num",
170  "K^{0}_{S} Tracking Fake Rate vs p_{T}", 70, 0., 20.);
171 
172  ksFakeVsR_denom = theDQMstore->book1D("K0sFakeVsR_denom",
173  "K^{0}_{S} Fake Rate vs #rho", 40, 0., 40.);
174  ksFakeVsEta_denom = theDQMstore->book1D("K0sFakeVsEta_denom",
175  "K^{0}_{S} Fake Rate vs #eta", 40, -2.5, 2.5);
176  ksFakeVsPt_denom = theDQMstore->book1D("K0sFakeVsPt_denom",
177  "K^{0}_{S} Fake Rate vs p_{T}", 70, 0., 20.);
178 
179  lamFakeVsR = theDQMstore->book1D("LamFakeVsR",
180  "#Lambda^{0} Fake Rate vs #rho", 40, 0., 40.);
181  lamFakeVsEta = theDQMstore->book1D("LamFakeVsEta",
182  "#Lambda^{0} Fake Rate vs #eta", 40, -2.5, 2.5);
183  lamFakeVsPt = theDQMstore->book1D("LamFakeVsPt",
184  "#Lambda^{0} Fake Rate vs p_{T}", 70, 0., 20.);
185  lamTkFakeVsR = theDQMstore->book1D("LamTkFakeVsR",
186  "#Lambda^{0} Tracking Fake Rate vs #rho", 40, 0., 40.);
187  lamTkFakeVsEta = theDQMstore->book1D("LamTkFakeVsEta",
188  "#Lambda^{0} Tracking Fake Rate vs #eta", 40, -2.5, 2.5);
189  lamTkFakeVsPt = theDQMstore->book1D("LamTkFakeVsPt",
190  "#Lambda^{0} Tracking Fake Rate vs p_{T}", 70, 0., 20.);
191 
192  lamFakeVsR_num = theDQMstore->book1D("LamFakeVsR_num",
193  "#Lambda^{0} Fake Rate vs #rho", 40, 0., 40.);
194  lamFakeVsEta_num = theDQMstore->book1D("LamFakeVsEta_num",
195  "#Lambda^{0} Fake Rate vs #eta", 40, -2.5, 2.5);
196  lamFakeVsPt_num = theDQMstore->book1D("LamFakeVsPt_num",
197  "#Lambda^{0} Fake Rate vs p_{T}", 70, 0., 20.);
198  lamTkFakeVsR_num = theDQMstore->book1D("LamTkFakeVsR_num",
199  "#Lambda^{0} Tracking Fake Rate vs #rho", 40, 0., 40.);
200  lamTkFakeVsEta_num = theDQMstore->book1D("LamTkFakeVsEta_num",
201  "#Lambda^{0} Tracking Fake Rate vs #eta", 40, -2.5, 2.5);
202  lamTkFakeVsPt_num = theDQMstore->book1D("LamTkFakeVsPt_num",
203  "#Lambda^{0} Tracking Fake Rate vs p_{T}", 70, 0., 20.);
204 
205  lamFakeVsR_denom = theDQMstore->book1D("LamFakeVsR_denom",
206  "#Lambda^{0} Fake Rate vs #rho", 40, 0., 40.);
207  lamFakeVsEta_denom = theDQMstore->book1D("LamFakeVsEta_denom",
208  "#Lambda^{0} Fake Rate vs #eta", 40, -2.5, 2.5);
209  lamFakeVsPt_denom = theDQMstore->book1D("LamFakeVsPt_denom",
210  "#Lambda^{0} Fake Rate vs p_{T}", 70, 0., 20.);
211 
212  theDQMstore->cd();
213  subDirName = dirName + "/Other";
214  theDQMstore->setCurrentFolder(subDirName.c_str());
215 
216  nKs = theDQMstore->book1D("nK0s",
217  "Number of K^{0}_{S} found per event", 60, 0., 60.);
218  nLam = theDQMstore->book1D("nLam",
219  "Number of #Lambda^{0} found per event", 60, 0., 60.);
220 
221  ksXResolution = theDQMstore->book1D("ksXResolution",
222  "Resolution of V0 decay vertex X coordinate", 50, 0., 50.);
223  ksYResolution = theDQMstore->book1D("ksYResolution",
224  "Resolution of V0 decay vertex Y coordinate", 50, 0., 50.);
225  ksZResolution = theDQMstore->book1D("ksZResolution",
226  "Resolution of V0 decay vertex Z coordinate", 50, 0., 50.);
227  lamXResolution = theDQMstore->book1D("lamXResolution",
228  "Resolution of V0 decay vertex X coordinate", 50, 0., 50.);
229  lamYResolution = theDQMstore->book1D("lamYResolution",
230  "Resolution of V0 decay vertex Y coordinate", 50, 0., 50.);
231  lamZResolution = theDQMstore->book1D("lamZResolution",
232  "Resolution of V0 decay vertex Z coordinate", 50, 0., 50.);
233  ksAbsoluteDistResolution = theDQMstore->book1D("ksRResolution",
234  "Resolution of absolute distance from primary vertex to V0 vertex",
235  100, 0., 50.);
236  lamAbsoluteDistResolution = theDQMstore->book1D("lamRResolution",
237  "Resolution of absolute distance from primary vertex to V0 vertex",
238  100, 0., 50.);
239 
240  ksCandStatus = theDQMstore->book1D("ksCandStatus",
241  "Fake type by cand status",
242  10, 0., 10.);
243  lamCandStatus = theDQMstore->book1D("ksCandStatus",
244  "Fake type by cand status",
245  10, 0., 10.);
246 
247  double minKsMass = 0.49767 - 0.07;
248  double maxKsMass = 0.49767 + 0.07;
249  double minLamMass = 1.1156 - 0.05;
250  double maxLamMass = 1.1156 + 0.05;
251  int ksMassNbins = 100;
252  double ksMassXmin = minKsMass;
253  double ksMassXmax = maxKsMass;
254  int lamMassNbins = 100;
255  double lamMassXmin = minLamMass;
256  double lamMassXmax = maxLamMass;
257 
258  fakeKsMass = theDQMstore->book1D("ksMassFake",
259  "Mass of fake K0S",
260  ksMassNbins, minKsMass, maxKsMass);
261  goodKsMass = theDQMstore->book1D("ksMassGood",
262  "Mass of good reco K0S",
263  ksMassNbins, minKsMass, maxKsMass);
264  fakeLamMass = theDQMstore->book1D("lamMassFake",
265  "Mass of fake Lambda",
266  lamMassNbins, minLamMass, maxLamMass);
267  goodLamMass = theDQMstore->book1D("lamMassGood",
268  "Mass of good Lambda",
269  lamMassNbins, minLamMass, maxLamMass);
270 
271  ksMassAll = theDQMstore->book1D("ksMassAll",
272  "Invariant mass of all K0S",
273  ksMassNbins, ksMassXmin, ksMassXmax);
274  lamMassAll = theDQMstore->book1D("lamMassAll",
275  "Invariant mass of all #Lambda^{0}",
276  lamMassNbins, lamMassXmin, lamMassXmax);
277 
278  ksFakeDauRadDist = theDQMstore->book1D("radDistFakeKs",
279  "Production radius of daughter particle of Ks fake",
280  100, 0., 15.);
281  lamFakeDauRadDist = theDQMstore->book1D("radDistFakeLam",
282  "Production radius of daughter particle of Lam fake",
283  100, 0., 15.);
284 
285  /*
286 
287  ksEffVsRHist = new TH1F("K0sEffVsR",
288  "K^{0}_{S} Efficiency vs #rho", 40, 0., 40.);
289  ksEffVsEtaHist = new TH1F("K0sEffVsEta",
290  "K^{0}_{S} Efficiency vs #eta", 40, -2.5, 2.5);
291  ksEffVsPtHist = new TH1F("K0sEffVsPt",
292  "K^{0}_{S} Efficiency vs p_{T}", 70, 0., 20.);;
293  ksFakeVsRHist = new TH1F("K0sFakeVsR",
294  "K^{0}_{S} Fake Rate vs #rho", 40, 0., 40.);
295  ksFakeVsEtaHist = new TH1F("K0sFakeVsEta",
296  "K^{0}_{S} Fake Rate vs #eta", 40, -2.5, 2.5);
297  ksFakeVsPtHist = new TH1F("K0sFakeVsPt",
298  "K^{0}_{S} Fake Rate vs p_{T}", 70, 0., 20.);
299 
300  ksTkEffVsRHist = new TH1F("K0sTkEffVsR",
301  "K^{0}_{S} Tracking Efficiency vs #rho", 40, 0., 40.);
302  ksTkEffVsEtaHist = new TH1F("K0sTkEffVsEta",
303  "K^{0}_{S} Tracking Efficiency vs #eta", 40, -2.5, 2.5);
304  ksTkEffVsPtHist = new TH1F("K0sTkEffVsPt",
305  "K^{0}_{S} Tracking Efficiency vs p_{T}", 70, 0., 20.);;
306  ksTkFakeVsRHist = new TH1F("K0sTkFakeVsR",
307  "K^{0}_{S} Tracking Fake Rate vs #rho", 40, 0., 40.);
308  ksTkFakeVsEtaHist = new TH1F("K0sTkFakeVsEta",
309  "K^{0}_{S} Tracking Fake Rate vs #eta", 40, -2.5, 2.5);
310  ksTkFakeVsPtHist = new TH1F("K0sTkFakeVsPt",
311  "K^{0}_{S} Tracking Fake Rate vs p_{T}", 70, 0., 20.);
312 
313  ksEffVsRHist_denom = new TH1F("K0sEffVsR_denom",
314  "K^{0}_{S} Efficiency vs #rho", 40, 0., 40.);
315  ksEffVsEtaHist_denom = new TH1F("K0sEffVsEta_denom",
316  "K^{0}_{S} Efficiency vs #eta", 40, -2.5, 2.5);
317  ksEffVsPtHist_denom = new TH1F("K0sEffVsPt_denom",
318  "K^{0}_{S} Efficiency vs p_{T}", 70, 0., 20.);;
319  ksFakeVsRHist_denom = new TH1F("K0sFakeVsR_denom",
320  "K^{0}_{S} Fake Rate vs #rho", 40, 0., 40.);
321  ksFakeVsEtaHist_denom = new TH1F("K0sFakeVsEta_denom",
322  "K^{0}_{S} Fake Rate vs #eta", 40, -2.5, 2.5);
323  ksFakeVsPtHist_denom = new TH1F("K0sFakeVsPt_denom",
324  "K^{0}_{S} Fake Rate vs p_{T}", 70, 0., 20.);
325 
326  lamEffVsRHist = new TH1F("LamEffVsR",
327  "#Lambda^{0} Efficiency vs #rho", 40, 0., 40.);
328  lamEffVsEtaHist = new TH1F("LamEffVsEta",
329  "#Lambda^{0} Efficiency vs #eta", 40, -2.5, 2.5);
330  lamEffVsPtHist = new TH1F("LamEffVsPt",
331  "#Lambda^{0} Efficiency vs p_{T}", 70, 0., 20.);
332  lamFakeVsRHist = new TH1F("LamFakeVsR",
333  "#Lambda^{0} Fake Rate vs #rho", 40, 0., 40.);
334  lamFakeVsEtaHist = new TH1F("LamFakeVsEta",
335  "#Lambda^{0} Fake Rate vs #eta", 40, -2.5, 2.5);
336  lamFakeVsPtHist = new TH1F("LamFakeVsPt",
337  "#Lambda^{0} Fake Rate vs p_{T}", 70, 0., 20.);
338 
339  lamTkEffVsRHist = new TH1F("LamTkEffVsR",
340  "#Lambda^{0} TrackingEfficiency vs #rho", 40, 0., 40.);
341  lamTkEffVsEtaHist = new TH1F("LamTkEffVsEta",
342  "#Lambda^{0} Tracking Efficiency vs #eta", 40, -2.5, 2.5);
343  lamTkEffVsPtHist = new TH1F("LamTkEffVsPt",
344  "#Lambda^{0} Tracking Efficiency vs p_{T}", 70, 0., 20.);
345  lamTkFakeVsRHist = new TH1F("LamTkFakeVsR",
346  "#Lambda^{0} Tracking Fake Rate vs #rho", 40, 0., 40.);
347  lamTkFakeVsEtaHist = new TH1F("LamTkFakeVsEta",
348  "#Lambda^{0} Tracking Fake Rate vs #eta", 40, -2.5, 2.5);
349  lamTkFakeVsPtHist = new TH1F("LamTkFakeVsPt",
350  "#Lambda^{0} Tracking Fake Rate vs p_{T}", 70, 0., 20.);
351 
352  lamEffVsRHist_denom = new TH1F("LamEffVsR_denom",
353  "#Lambda^{0} Efficiency vs #rho", 40, 0., 40.);
354  lamEffVsEtaHist_denom = new TH1F("LamEffVsEta_denom",
355  "#Lambda^{0} Efficiency vs #eta", 40, -2.5, 2.5);
356  lamEffVsPtHist_denom = new TH1F("LamEffVsPt_denom",
357  "#Lambda^{0} Efficiency vs p_{T}", 70, 0., 20.);
358  lamFakeVsRHist_denom = new TH1F("LamFakeVsR_denom",
359  "#Lambda^{0} Fake Rate vs #rho", 40, 0., 40.);
360  lamFakeVsEtaHist_denom = new TH1F("LamFakeVsEta_denom",
361  "#Lambda^{0} Fake Rate vs #eta", 40, -2.5, 2.5);
362  lamFakeVsPtHist_denom = new TH1F("LamFakeVsPt_denom",
363  "#Lambda^{0} Fake Rate vs p_{T}", 70, 0., 20.);
364 
365  nKsHist = new TH1F("nK0s",
366  "Number of K^{0}_{S} found per event", 60, 0., 60.);
367  nLamHist = new TH1F("nLam",
368  "Number of #Lambda^{0} found per event", 60, 0., 60.);
369 
370  ksXResolutionHist = new TH1F("ksXResolution",
371  "Resolution of V0 decay vertex X coordinate", 50, 0., 50.);
372  ksYResolutionHist = new TH1F("ksYResolution",
373  "Resolution of V0 decay vertex Y coordinate", 50, 0., 50.);
374  ksZResolutionHist = new TH1F("ksZResolution",
375  "Resolution of V0 decay vertex Z coordinate", 50, 0., 50.);
376  lamXResolutionHist = new TH1F("lamXResolution",
377  "Resolution of V0 decay vertex X coordinate", 50, 0., 50.);
378  lamYResolutionHist = new TH1F("lamYResolution",
379  "Resolution of V0 decay vertex Y coordinate", 50, 0., 50.);
380  lamZResolutionHist = new TH1F("lamZResolution",
381  "Resolution of V0 decay vertex Z coordinate", 50, 0., 50.);
382  ksAbsoluteDistResolutionHist = new TH1F("ksRResolution",
383  "Resolution of absolute distance from primary vertex to V0 vertex",
384  100, 0., 50.);
385  lamAbsoluteDistResolutionHist = new TH1F("lamRResolution",
386  "Resolution of absolute distance from primary vertex to V0 vertex",
387  100, 0., 50.);
388 
389  ksCandStatusHist = new TH1F("ksCandStatus",
390  "Fake type by cand status",
391  10, 0., 10.);
392  lamCandStatusHist = new TH1F("ksCandStatus",
393  "Fake type by cand status",
394  10, 0., 10.);
395 
396  double minKsMass = 0.49767 - 0.07;
397  double maxKsMass = 0.49767 + 0.07;
398  double minLamMass = 1.1156 - 0.05;
399  double maxLamMass = 1.1156 + 0.05;
400  fakeKsMassHisto = new TH1F("ksMassFake",
401  "Mass of fake K0s",
402  100, minKsMass, maxKsMass);
403  goodKsMassHisto = new TH1F("ksMassGood",
404  "Mass of good reco K0s",
405  100, minKsMass, maxKsMass);
406  fakeLamMassHisto = new TH1F("lamMassFake",
407  "Mass of fake Lambda",
408  100, minLamMass, maxLamMass);
409  goodLamMassHisto = new TH1F("lamMassGood",
410  "Mass of good Lambda",
411  100, minLamMass, maxLamMass);
412 
413  ksFakeDauRadDistHisto = new TH1F("radDistFakeKs",
414  "Production radius of daughter particle of Ks fake",
415  100, 0., 15.);
416  lamFakeDauRadDistHisto = new TH1F("radDistFakeLam",
417  "Production radius of daughter particle of Lam fake",
418  100, 0., 15.);*/
419 
420 
421  //std::cout << "Histograms booked" << std::endl;
422 
423  /*ksEffVsRHist->Sumw2();
424  ksEffVsEtaHist->Sumw2();
425  ksEffVsPtHist->Sumw2();
426  ksTkEffVsRHist->Sumw2();
427  ksTkEffVsEtaHist->Sumw2();
428  ksTkEffVsPtHist->Sumw2();
429  ksFakeVsRHist->Sumw2();
430  ksFakeVsEtaHist->Sumw2();
431  ksFakeVsPtHist->Sumw2();
432  ksTkFakeVsRHist->Sumw2();
433  ksTkFakeVsEtaHist->Sumw2();
434  ksTkFakeVsPtHist->Sumw2();
435 
436  lamEffVsRHist->Sumw2();
437  lamEffVsEtaHist->Sumw2();
438  lamEffVsPtHist->Sumw2();
439  lamTkEffVsRHist->Sumw2();
440  lamTkEffVsEtaHist->Sumw2();
441  lamTkEffVsPtHist->Sumw2();
442  lamFakeVsRHist->Sumw2();
443  lamFakeVsEtaHist->Sumw2();
444  lamFakeVsPtHist->Sumw2();
445  lamTkFakeVsRHist->Sumw2();
446  lamTkFakeVsEtaHist->Sumw2();
447  lamTkFakeVsPtHist->Sumw2();*/
448 
449 }
450 
452 
453  using std::cout;
454  using std::endl;
455  using namespace edm;
456  using namespace std;
457 
458  //cout << "In analyze(), getting collections..." << endl;
459  // Get event setup info, B-field and tracker geometry
460  ESHandle<MagneticField> bFieldHandle;
461  iSetup.get<IdealMagneticFieldRecord>().get(bFieldHandle);
462  ESHandle<GlobalTrackingGeometry> globTkGeomHandle;
463  iSetup.get<GlobalTrackingGeometryRecord>().get(globTkGeomHandle);
464 
465  // Make matching collections
466  //reco::RecoToSimCollection recSimColl;
467  //reco::SimToRecoCollection simRecColl;
468 
469  Handle<reco::RecoToSimCollection > recotosimCollectionH;
470  iEvent.getByLabel("trackingParticleRecoTrackAsssociation", recotosimCollectionH);
471  //recSimColl= *( recotosimCollectionH.product() );
472 
473  Handle<reco::SimToRecoCollection> simtorecoCollectionH;
474  iEvent.getByLabel("trackingParticleRecoTrackAsssociation", simtorecoCollectionH);
475  //simRecColl= *( simtorecoCollectionH.product() );
476 
478  iEvent.getByLabel("mergedtruth", "MergedTrackTruth", TPCollectionEff);
479  const TrackingParticleCollection tPCeff = *( TPCollectionEff.product() );
480 
481  edm::ESHandle<TrackAssociatorBase> associatorByHits;
482  iSetup.get<TrackAssociatorRecord>().get("TrackAssociatorByHits", associatorByHits);
483 
484  //VertexAssociatorBase* associatorByTracks;
485 
486  // edm::ESHandle<VertexAssociatorBase> theTracksAssociator;
487  // iSetup.get<VertexAssociatorRecord>().get("VertexAssociatorByTracks",theTracksAssociator);
488  // associatorByTracks = (VertexAssociatorBase *) theTracksAssociator.product();
489 
490  // Get tracks
491  Handle< View<reco::Track> > trackCollectionH;
492  iEvent.getByLabel("generalTracks", trackCollectionH);
493 
494  Handle<SimTrackContainer> simTrackCollection;
495  iEvent.getByLabel("g4SimHits", simTrackCollection);
496  const SimTrackContainer simTC = *(simTrackCollection.product());
497 
498  Handle<SimVertexContainer> simVertexCollection;
499  iEvent.getByLabel("g4SimHits", simVertexCollection);
500  const SimVertexContainer simVC = *(simVertexCollection.product());
501 
502  //Get tracking particles
503  // -->tracks
505  iEvent.getByLabel("mergedtruth", "MergedTrackTruth", TPCollectionH);
506  const View<reco::Track> tC = *( trackCollectionH.product() );
507 
508 // edm::Handle<TrackingVertexCollection> TVCollectionH ;
509 // iEvent.getByLabel("trackingParticles","VertexTruth",TVCollectionH);
510 // const TrackingVertexCollection tVC = *(TVCollectionH.product());
511 
512  // Select the primary vertex, create a new reco::Vertex to hold it
513  edm::Handle< std::vector<reco::Vertex> > primaryVtxCollectionH;
514  iEvent.getByLabel("offlinePrimaryVertices", primaryVtxCollectionH);
515  const reco::VertexCollection primaryVertexCollection = *(primaryVtxCollectionH.product());
516 
517  reco::Vertex* thePrimary = 0;
518  std::vector<reco::Vertex>::const_iterator iVtxPH = primaryVtxCollectionH->begin();
519  for(std::vector<reco::Vertex>::const_iterator iVtx = primaryVtxCollectionH->begin();
520  iVtx < primaryVtxCollectionH->end();
521  iVtx++) {
522  if(primaryVtxCollectionH->size() > 1) {
523  if(iVtx->tracksSize() > iVtxPH->tracksSize()) {
524  iVtxPH = iVtx;
525  }
526  }
527  else iVtxPH = iVtx;
528  }
529  thePrimary = new reco::Vertex(*iVtxPH);
530 
531  //cout << "Done with collections, associating reco and sim..." << endl;
532 
533 
534  //reco::RecoToSimCollection r2s = associatorByHits->associateRecoToSim(trackCollectionH,TPCollectionH,&iEvent );
535  //reco::SimToRecoCollection s2r = associatorByHits->associateSimToReco(trackCollectionH,TPCollectionH,&iEvent );
536 
537 // reco::VertexRecoToSimCollection vr2s = associatorByTracks->associateRecoToSim(primaryVtxCollectionH, TVCollectionH, iEvent, r2s);
538 // reco::VertexSimToRecoCollection vs2r = associatorByTracks->associateSimToReco(primaryVtxCollectionH, TVCollectionH, iEvent, s2r);
539 
540  //get the V0s;
543  //iEvent.getByLabel("generalV0Candidates", "Kshort", k0sCollection);
544  //iEvent.getByLabel("generalV0Candidates", "Lambda", lambdaCollection);
545  iEvent.getByLabel(k0sCollectionTag, k0sCollection);
546  iEvent.getByLabel(lamCollectionTag, lambdaCollection);
547 
548  //make vector of pair of trackingParticles to hold good V0 candidates
549  std::vector< pair<TrackingParticleRef, TrackingParticleRef> > trueK0s;
550  std::vector< pair<TrackingParticleRef, TrackingParticleRef> > trueLams;
551  std::vector<double> trueKsMasses;
552  std::vector<double> trueLamMasses;
553 
555  // Do vertex calculations //
557 /*
558  if( k0sCollection->size() > 0 ) {
559  for(reco::VertexCompositeCandidateCollection::const_iterator iK0s = k0sCollection->begin();
560  iK0s != k0sCollection->end();
561  iK0s++) {
562  // Still can't actually associate the V0 vertex with a TrackingVertexCollection.
563  // Is this a problem? You bet.
564  reco::VertexCompositeCandidate::CovarianceMatrix aErr;
565  iK0s->fillVertexCovariance(aErr);
566  reco::Vertex tVtx(iK0s->vertex(), aErr);
567  reco::VertexCollection *tVtxColl = 0;
568  tVtxColl->push_back(tVtx);
569  reco::VertexRef aVtx(tVtxColl, 0);
570  //if(vr2s.find(iK0s->vertex()) != vr2s.end()) {
571  if(vr2s.find(aVtx) != vr2s.end()) {
572  //cout << "Found it in the collection." << endl;
573  std::vector< std::pair<TrackingVertexRef, double> > vVR
574  = (std::vector< std::pair<TrackingVertexRef, double> >) vr2s[aVtx];
575  }
576  }
577  }
578 */
580  // Do fake rate calculation //
582 
583  //cout << "Starting K0s fake rate calculation" << endl;
584  // Kshorts
585  double numK0sFound = 0.;
586  double mass = 0.;
587  std::vector<double> radDist;
588  // radDist.clear();
589  //cout << "K0s collection size: " << k0sCollection->size() << endl;
590  if ( k0sCollection->size() > 0 ) {
591  //cout << "In loop" << endl;
592 
593  vector<reco::TrackRef> theDaughterTracks;
594  for( reco::VertexCompositeCandidateCollection::const_iterator iK0s = k0sCollection->begin();
595  iK0s != k0sCollection->end();
596  iK0s++) {
597  //cout << "In loop 2" << endl;
598  // Fill mass of all K0S
599  ksMassAll->Fill( iK0s->mass() );
600  // Fill values to be histogrammed
601  K0sCandpT = (sqrt( iK0s->momentum().perp2() ));
602  K0sCandEta = iK0s->momentum().eta();
603  K0sCandR = (sqrt( iK0s->vertex().perp2() ));
604  K0sCandStatus = 0;
605  //cout << "MASS" << endl;
606  mass = iK0s->mass();
607  //cout << "Pushing back daughters" << endl;
608 
609  theDaughterTracks.push_back( (*(dynamic_cast<const reco::RecoChargedCandidate *> (iK0s->daughter(0)) )).track() );
610  theDaughterTracks.push_back( (*(dynamic_cast<const reco::RecoChargedCandidate *> (iK0s->daughter(1)) )).track() );
611 
612  //cout << "1" << endl;
613  for (int itrack = 0; itrack < 2; itrack++) {
614  K0sPiCandStatus[itrack] = 0;
615  }
616 
617  std::vector< std::pair<TrackingParticleRef, double> > tp;
618  TrackingParticleRef tpref;
619  TrackingParticleRef firstDauTP;
620  TrackingVertexRef k0sVtx;
621 
622  //cout << "2" << endl;
623  // Loop through K0s candidate daugher tracks
624  for(View<reco::Track>::size_type i=0; i<theDaughterTracks.size(); ++i){
625  // Found track from theDaughterTracks
626  RefToBase<reco::Track> track( theDaughterTracks.at(i) );
627 
628  //if(recSimColl.find(track) != recSimColl.end()) {
629  if(recotosimCollectionH->find(track) != recotosimCollectionH->end()) {
630  //tp = recSimColl[track];
631  tp = (*recotosimCollectionH)[track];
632  if (tp.size() != 0) {
633  K0sPiCandStatus[i] = 1;
634  tpref = tp.begin()->first;
635 
636  //if( simRecColl.find(tpref) == simRecColl.end() ) {
637  if( simtorecoCollectionH->find(tpref) == simtorecoCollectionH->end() ) {
638  K0sPiCandStatus[i] = 3;
639  }
640  //cout << "3" << endl;
641  TrackingVertexRef parentVertex = tpref->parentVertex();
642  if(parentVertex.isNonnull()) radDist.push_back(parentVertex->position().R());
643 
644  if( parentVertex.isNonnull() ) {
645  if( k0sVtx.isNonnull() ) {
646  if( k0sVtx->position() == parentVertex->position() ) {
647  if( parentVertex->nDaughterTracks() == 2 ) {
648  if( parentVertex->nSourceTracks() == 0 ) {
649  // No source tracks found for K0s vertex; shouldn't happen, but does for evtGen events
650  K0sCandStatus = 6;
651  }
652 
653  for( TrackingVertex::tp_iterator iTP = parentVertex->sourceTracks_begin();
654  iTP != parentVertex->sourceTracks_end(); iTP++) {
655  if( (*iTP)->pdgId() == 310 ) {
656  //cout << "4" << endl;
657  K0sCandStatus = 1;
658  realK0sFound++;
659  numK0sFound += 1.;
660  std::pair<TrackingParticleRef, TrackingParticleRef> pair(firstDauTP, tpref);
661  // Pushing back a good V0
662  trueK0s.push_back(pair);
663  trueKsMasses.push_back(mass);
664  }
665  else {
666  K0sCandStatus = 2;
667  if( (*iTP)->pdgId() == 3122 ) {
668  K0sCandStatus = 7;
669  }
670  }
671  }
672  }
673  else {
674  // Found a bad match because the mother has too many daughters
675  K0sCandStatus = 3;
676  }
677  }
678  else {
679  // Found a bad match because the parent vertices from the two tracks are different
680  K0sCandStatus = 4;
681  }
682  }
683  else {
684  // if k0sVtx is null, fill it with parentVertex to compare to the parentVertex from the second track
685  k0sVtx = parentVertex;
686  firstDauTP = tpref;
687  }
688  }//parent vertex is null
689  }//tp size zero
690  }
691  else {
692  //cout << "5" << endl;
693  K0sPiCandStatus[i] = 2;
694  noTPforK0sCand++;
695  K0sCandStatus = 5;
696  theDaughterTracks.clear();
697  }
698  }
699  //cout << "6" << endl;
700  theDaughterTracks.clear();
701  // fill the fake rate histograms
702  if( K0sCandStatus > 1 ) {
703  //cout << "7" << endl;
707  ksCandStatus->Fill((float) K0sCandStatus);
708  fakeKsMass->Fill(mass);
709  for( unsigned int ndx = 0; ndx < radDist.size(); ndx++ ) {
710  ksFakeDauRadDist->Fill(radDist[ndx]);
711  }
712  }
713  if( K0sCandStatus == 5 ) {
717  }
721  }
722  }
723  //cout << "Outside loop, why would it fail here?" << endl;
724  //double numK0sFound = (double) realK0sFound;
725  //cout << "numK0sFound: " << numK0sFound << endl;
726  nKs->Fill( (float) numK0sFound );
727  numK0sFound = 0.;
728 
729  //cout << "Starting Lambda fake rate calculation" << endl;
730 
731  double numLamFound = 0.;
732  mass = 0.;
733  radDist.clear();
734  // Lambdas
735  if ( lambdaCollection->size() > 0 ) {
736  //cout << "In lam loop." << endl;
737 
738  vector<reco::TrackRef> theDaughterTracks;
739  for( reco::VertexCompositeCandidateCollection::const_iterator iLam = lambdaCollection->begin();
740  iLam != lambdaCollection->end();
741  iLam++) {
742  // Fill mass plot with ALL lambdas
743  lamMassAll->Fill( iLam->mass() );
744  // Fill values to be histogrammed
745  LamCandpT = (sqrt( iLam->momentum().perp2() ));
746  LamCandEta = iLam->momentum().eta();
747  LamCandR = (sqrt( iLam->vertex().perp2() ));
748  LamCandStatus = 0;
749  mass = iLam->mass();
750 
751  //cout << "Lam daughter tracks" << endl;
752  theDaughterTracks.push_back( (*(dynamic_cast<const reco::RecoChargedCandidate *> (iLam->daughter(0)) )).track() );
753  theDaughterTracks.push_back( (*(dynamic_cast<const reco::RecoChargedCandidate *> (iLam->daughter(1)) )).track() );
754 
755  for (int itrack = 0; itrack < 2; itrack++) {
756  LamPiCandStatus[itrack] = 0;
757  }
758 
759  std::vector< std::pair<TrackingParticleRef, double> > tp;
760  TrackingParticleRef tpref;
761  TrackingParticleRef firstDauTP;
762  TrackingVertexRef LamVtx;
763  // Loop through Lambda candidate daughter tracks
764  for(View<reco::Track>::size_type i=0; i<theDaughterTracks.size(); ++i){
765  // Found track from theDaughterTracks
766  //cout << "Looping over lam daughters" << endl;
767  RefToBase<reco::Track> track( theDaughterTracks.at(i) );
768 
769  //if(recSimColl.find(track) != recSimColl.end()) {
770  if(recotosimCollectionH->find(track) != recotosimCollectionH->end()) {
771  //tp = recSimColl[track];
772  tp = (*recotosimCollectionH)[track];
773  if (tp.size() != 0) {
774  LamPiCandStatus[i] = 1;
775  tpref = tp.begin()->first;
776 
777  //if( simRecColl.find(tpref) == simRecColl.end() ) {
778  if( simtorecoCollectionH->find(tpref) == simtorecoCollectionH->end() ) {
779  LamPiCandStatus[i] = 3;
780  }
781  TrackingVertexRef parentVertex = tpref->parentVertex();
782  if( parentVertex.isNonnull() ) radDist.push_back(parentVertex->position().R());
783 
784  if( parentVertex.isNonnull() ) {
785  if( LamVtx.isNonnull() ) {
786  if( LamVtx->position() == parentVertex->position() ) {
787  if( parentVertex->nDaughterTracks() == 2 ) {
788  if( parentVertex->nSourceTracks() == 0 ) {
789  // No source tracks found for K0s vertex; shouldn't happen, but does for evtGen events
790  LamCandStatus = 6;
791  }
792 
793  for( TrackingVertex::tp_iterator iTP = parentVertex->sourceTracks_begin();
794  iTP != parentVertex->sourceTracks_end(); ++iTP) {
795  if( abs((*iTP)->pdgId()) == 3122 ) {
796  LamCandStatus = 1;
797  realLamFound++;
798  numLamFound += 1.;
799  std::pair<TrackingParticleRef, TrackingParticleRef> pair(firstDauTP, tpref);
800  // Pushing back a good V0
801  trueLams.push_back(pair);
802  trueLamMasses.push_back(mass);
803  }
804  else {
805  LamCandStatus = 2;
806  if( abs((*iTP)->pdgId() ) == 310 ) {
807  LamCandStatus = 7;
808  }
809  }
810  //if(iTP != parentVertex->sourceTracks_end()) {
811  //cout << "Bogus check 1" << endl;
812  //}
813  }
814  }
815  else {
816  // Found a bad match because the mother has too many daughters
817  LamCandStatus = 3;
818  }
819  }
820  else {
821  // Found a bad match because the parent vertices from the two tracks are different
822  LamCandStatus = 4;
823  }
824  }
825  else {
826  // if lamVtx is null, fill it with parentVertex to compare to the parentVertex from the second track
827  LamVtx = parentVertex;
828  firstDauTP = tpref;
829  }
830  }//parent vertex is null
831  }//tp size zero
832  }
833  else {
834  LamPiCandStatus[i] = 2;
835  noTPforLamCand++;
836  LamCandStatus = 5;
837  theDaughterTracks.clear();
838  }
839  }
840  theDaughterTracks.clear();
841  // fill the fake rate histograms
842  //cout << "Fill lam fake rate histos" << endl;
843  if( LamCandStatus > 1 ) {
844  //cout << "fake 1" << endl;
845  //cout << "fake 1.5" << endl;
847  //cout << "fake 2" << endl;
849  //cout << "fake 3" << endl;
851  //cout << "fake 4" << endl;
852  lamCandStatus->Fill((float) LamCandStatus);
853  //cout << "fake 5" << endl;
855  //cout << "fake 6" << endl;
856  for( unsigned int ndx = 0; ndx < radDist.size(); ndx++ ) {
857  lamFakeDauRadDist->Fill(radDist[ndx]);
858  }
859  }
860  //cout << "Fill lam Tk fake histos" << endl;
861  if( K0sCandStatus == 5 ) {
865  }
866  //cout << "Fill denominators" << endl;
870  }
871  }
872  //cout << "Filling numLamFound" << endl;
873  nLam->Fill( (double) numLamFound );
874  numLamFound = 0.;
875 
876 
878  // Do efficiency calculation //
880 
881  //cout << "Starting Lambda efficiency" << endl;
882  // Lambdas
883 
884  for(TrackingParticleCollection::size_type i = 0; i < tPCeff.size(); i++) {
885  TrackingParticleRef tpr1(TPCollectionEff, i);
886  TrackingParticle* itp1 = const_cast<TrackingParticle*>(tpr1.get());
887  if( (itp1->pdgId() == 211 || itp1->pdgId() == 2212)
888  && itp1->parentVertex().isNonnull()
889  && abs(itp1->momentum().eta()) < 2.4
890  && sqrt( itp1->momentum().perp2() ) > 0.9) {
891  bool isLambda = false;
892  if( itp1->pdgId() == 2212 ) isLambda = true;
893  if( itp1->parentVertex()->nDaughterTracks() == 2 ) {
894 
895  TrackingVertexRef piCand1Vertex = itp1->parentVertex();
896  for(TrackingVertex::tp_iterator iTP1 = piCand1Vertex->sourceTracks_begin();
897  iTP1 != piCand1Vertex->sourceTracks_end(); iTP1++) {
898  if( abs((*iTP1)->pdgId()) == 3122 ) {
899  //double motherpT = (*iTP1)->pt();
900  // ----->>>>>>Keep going here
902  j < tPCeff.size();
903  j++) {
904  TrackingParticleRef tpr2(TPCollectionEff, j);
905  TrackingParticle* itp2 = const_cast<TrackingParticle*>(tpr2.get());
906  int particle2pdgId;
907  if (isLambda) particle2pdgId = -211;
908  else particle2pdgId = -2212;
909  if( itp2->pdgId() == particle2pdgId
910  && itp2->parentVertex().isNonnull()
911  && abs(itp2->momentum().eta()) < 2.4
912  && sqrt(itp2->momentum().perp2()) > 0.9) {
913  if(itp2->parentVertex() == itp1->parentVertex()) {
914  // Found a good pair of Lambda daughters
915  TrackingVertexRef piCand2Vertex = itp2->parentVertex();
916  for (TrackingVertex::tp_iterator iTP2 = piCand2Vertex->sourceTracks_begin();
917  iTP2 != piCand2Vertex->sourceTracks_end();
918  ++iTP2) {
919  LamGenEta = LamGenpT = LamGenR = 0.;
920  LamGenStatus = 0;
921  for(int ifill = 0;
922  ifill < 2;
923  ifill++) {
924  // do nothing?
925  }
926  if( abs((*iTP2)->pdgId()) == 3122 ) {
927  // found generated Lambda
928 
929  LamGenpT = sqrt((*iTP2)->momentum().perp2());
930  LamGenEta = (*iTP2)->momentum().eta();
931  LamGenR = sqrt(itp2->vertex().perp2());
932  genLam++;
933  if(trueLams.size() > 0) {
934  int loop_1 = 0;
935  for(std::vector< pair<TrackingParticleRef, TrackingParticleRef> >::const_iterator iEffCheck = trueLams.begin();
936  iEffCheck != trueLams.end();
937  iEffCheck++) {
938  //cout << "In LOOP" << endl;
939  if( itp1->parentVertex() == iEffCheck->first->parentVertex()
940  && itp2->parentVertex() == iEffCheck->second->parentVertex() ) {
941  realLamFoundEff++;
942  //V0Producer found the generated Lambda
943  LamGenStatus = 1;
944  //cout << "Maybe it's here.." << endl;
945  goodLamMass->Fill(trueLamMasses[loop_1]);
946  //cout << "Did we make it?" << endl;
947  break;
948  }
949  else {
950  //V0Producer didn't find the generated Lambda
951  LamGenStatus = 2;
952  }
953  loop_1++;
954  }
955  }
956  else {
957  //No V0 cand found, so V0Producer didn't find the generated Lambda
958  LamGenStatus = 2;
959  }
960  std::vector< std::pair<RefToBase<reco::Track>, double> > rt1;
961  std::vector< std::pair<RefToBase<reco::Track>, double> > rt2;
962 
963  //if( simRecColl.find(tpr1) != simRecColl.end() ) {
964  if( simtorecoCollectionH->find(tpr1) != simtorecoCollectionH->end() ) {
965  //rt1 = (std::vector<std::pair<RefToBase<reco::Track>, double> >) simRecColl[tpr1];
966  rt1 = (std::vector<std::pair<RefToBase<reco::Track>, double> >) (*simtorecoCollectionH)[tpr1];
967  if(rt1.size() != 0) {
968  LamPiEff[0] = 1; //Found the first daughter track
969  edm::RefToBase<reco::Track> t1 = rt1.begin()->first;
970  }
971  }
972  else {
973  LamPiEff[0] = 2;//First daughter not found
974  }
975  //if( (simRecColl.find(tpr2) != simRecColl.end()) ) {
976  if( (simtorecoCollectionH->find(tpr2) != simtorecoCollectionH->end()) ) {
977  //rt2 = (std::vector<std::pair<RefToBase<reco::Track>, double> >) simRecColl[tpr2];
978  rt2 = (std::vector<std::pair<RefToBase<reco::Track>, double> >) (*simtorecoCollectionH)[tpr2];
979  if(rt2.size() != 0) {
980  LamPiEff[1] = 1;//Found the second daughter track
981  edm::RefToBase<reco::Track> t2 = rt2.begin()->first;
982  }
983  }
984  else {
985  LamPiEff[1] = 2;//Second daughter not found
986  }
987 
988  if( LamGenStatus == 1
989  && (LamPiEff[0] == 2 || LamPiEff[1] == 2) ) {
990  // Good Lambda found, but recoTrack->trackingParticle->recoTrack didn't work
991  LamGenStatus = 4;
992  realLamFoundEff--;
993  }
994  if( LamGenStatus == 2
995  && (LamPiEff[0] == 2 || LamPiEff[1] == 2) ) {
996  // Lambda not found because we didn't find a daughter track
997  LamGenStatus = 3;
998  }
999  //cout << "LamGenStatus: " << LamGenStatus << ", LamPiEff[i]: " << LamPiEff[0] << ", " << LamPiEff[1] << endl;
1000  // Fill histograms
1001  if(LamGenR > 0.) {
1002  if(LamGenStatus == 1) {
1004  }
1005  if((double) LamGenStatus < 2.5) {
1007  }
1009  }
1010  if(abs(LamGenEta) > 0.) {
1011  if(LamGenStatus == 1) {
1012  lamEffVsEta_num->Fill(LamGenEta);
1013  }
1014  if((double) LamGenStatus < 2.5) {
1015  lamTkEffVsEta_num->Fill(LamGenEta);
1016  }
1017  lamEffVsEta_denom->Fill(LamGenEta);
1018  }
1019  if(LamGenpT > 0.) {
1020  if(LamGenStatus == 1) {
1022  }
1023  if((double) LamGenStatus < 2.5) {
1025  }
1027  }
1028  }
1029  }
1030  }
1031  }
1032  }
1033  }
1034  }
1035  }
1036  }
1037  }
1038 
1039  //Kshorts
1040 
1041  //cout << "Starting Kshort efficiency" << endl;
1042  for (TrackingParticleCollection::size_type i=0; i<tPCeff.size(); i++){
1043  TrackingParticleRef tpr1(TPCollectionEff, i);
1044  TrackingParticle* itp1=const_cast<TrackingParticle*>(tpr1.get());
1045  // only count the efficiency for pions with |eta|<2.4 and pT>0.9 GeV. First search for a suitable pi+
1046  if ( itp1->pdgId() == 211
1047  && itp1->parentVertex().isNonnull()
1048  && abs(itp1->momentum().eta()) < 2.4
1049  && sqrt(itp1->momentum().perp2()) > 0.9) {
1050  if ( itp1->parentVertex()->nDaughterTracks() == 2 ) {
1051  TrackingVertexRef piCand1Vertex = itp1->parentVertex();
1052  //check trackingParticle pion for a Ks mother
1053  for (TrackingVertex::tp_iterator iTP1 = piCand1Vertex->sourceTracks_begin();
1054  iTP1 != piCand1Vertex->sourceTracks_end(); ++iTP1) {
1055  //iTP1 is a TrackingParticle
1056  if ( (*iTP1)->pdgId()==310 ) {
1057  //with a Ks mother found for the pi+, loop through trackingParticles again to find a pi-
1058  for (TrackingParticleCollection::size_type j=0; j<tPCeff.size(); j++){
1059  TrackingParticleRef tpr2(TPCollectionEff, j);
1060  TrackingParticle* itp2=const_cast<TrackingParticle*>(tpr2.get());
1061 
1062  if ( itp2->pdgId() == -211 && itp2->parentVertex().isNonnull()
1063  && abs(itp2->momentum().eta()) < 2.4
1064  && sqrt(itp2->momentum().perp2()) > 0.9) {
1065  //check the pi+ and pi- have the same vertex
1066  if ( itp2->parentVertex() == itp1->parentVertex() ) {
1067  TrackingVertexRef piCand2Vertex = itp2->parentVertex();
1068  for (TrackingVertex::tp_iterator iTP2 = piCand2Vertex->sourceTracks_begin();
1069  iTP2 != piCand2Vertex->sourceTracks_end(); ++iTP2) {
1070  //iTP2 is a TrackingParticle
1071  K0sGenEta = K0sGenpT = K0sGenR = 0.;
1072  K0sGenStatus = 0;
1073  if( (*iTP2)->pdgId() == 310 ) {
1074  K0sGenpT = sqrt( (*iTP2)->momentum().perp2() );
1075  K0sGenEta = (*iTP2)->momentum().eta();
1076  K0sGenR = sqrt(itp2->vertex().perp2());
1077  genK0s++;
1078  int loop_2 = 0;
1079  if( trueK0s.size() > 0 ) {
1080  for( std::vector< pair<TrackingParticleRef, TrackingParticleRef> >::const_iterator iEffCheck = trueK0s.begin();
1081  iEffCheck != trueK0s.end();
1082  iEffCheck++) {
1083  //if the parent vertices for the tracks are the same, then the generated Ks was found
1084  if (itp1->parentVertex()==iEffCheck->first->parentVertex() &&
1085  itp2->parentVertex()==iEffCheck->second->parentVertex()) {
1086  realK0sFoundEff++;
1087  K0sGenStatus = 1;
1088  //cout << "Maybe here?" << endl;
1089  goodKsMass->Fill(trueKsMasses[loop_2]);
1090  //cout << "We made it...." << endl;
1091  break;
1092  }
1093  else {
1094  K0sGenStatus = 2;
1095  }
1096  }
1097  }
1098  else {
1099  K0sGenStatus = 2;
1100  }
1101 
1102  // Check if the generated Ks tracks were found or not
1103  // by searching the recoTracks list for a match to the trackingParticles
1104 
1105  std::vector<std::pair<RefToBase<reco::Track>, double> > rt1;
1106  std::vector<std::pair<RefToBase<reco::Track>, double> > rt2;
1107 
1108  //if( simRecColl.find(tpr1) != simRecColl.end() ) {
1109  if( simtorecoCollectionH->find(tpr1) != simtorecoCollectionH->end() ) {
1110  rt1 = (std::vector< std::pair<RefToBase<reco::Track>, double> >) (*simtorecoCollectionH)[tpr1];
1111 //simRecColl[tpr1];
1112  if(rt1.size() != 0) {
1113  //First pion found
1114  K0sPiEff[0] = 1;
1115  edm::RefToBase<reco::Track> t1 = rt1.begin()->first;
1116  }
1117  }
1118  else {
1119  //First pion not found
1120  K0sPiEff[0] = 2;
1121  }
1122 
1123  //if( simRecColl.find(tpr2) != simRecColl.end() ) {
1124  if( simtorecoCollectionH->find(tpr2) != simtorecoCollectionH->end() ) {
1125  rt2 = (std::vector< std::pair<RefToBase<reco::Track>, double> >) (*simtorecoCollectionH)[tpr2];
1126 //simRecColl[tpr2];
1127  if(rt2.size() != 0) {
1128  //Second pion found
1129  K0sPiEff[1] = 1;
1130  edm::RefToBase<reco::Track> t2 = rt2.begin()->first;
1131  }
1132  }
1133  else {
1134  K0sPiEff[1] = 2;
1135  }
1136  //cout << "Status: " << K0sGenStatus << ", K0sPiEff[i]: " << K0sPiEff[0] << ", " << K0sPiEff[1] << endl;
1137  if(K0sGenStatus == 1
1138  && (K0sPiEff[0] == 2 || K0sPiEff[1] == 2)) {
1139  K0sGenStatus = 4;
1140  realK0sFoundEff--;
1141  }
1142  if(K0sGenStatus == 2
1143  && (K0sPiEff[0] == 2 || K0sPiEff[1] == 2)) {
1144  K0sGenStatus = 3;
1145  }
1146  if(K0sPiEff[0] == 1 && K0sPiEff[1] == 1) {
1147  k0sTracksFound++;
1148  }
1149  //Fill Histograms
1150  if(K0sGenR > 0.) {
1151  if(K0sGenStatus == 1) {
1153  }
1154  if((double) K0sGenStatus < 2.5) {
1156  }
1158  }
1159  if(abs(K0sGenEta) > 0.) {
1160  if(K0sGenStatus == 1) {
1161  ksEffVsEta_num->Fill(K0sGenEta);
1162  }
1163  if((double) K0sGenStatus < 2.5) {
1164  ksTkEffVsEta_num->Fill(K0sGenEta);
1165  }
1166  ksEffVsEta_denom->Fill(K0sGenEta);
1167  }
1168  if(K0sGenpT > 0.) {
1169  if(K0sGenStatus == 1) {
1171  }
1172  if((double) K0sGenStatus < 2.5) {
1174  }
1176  }
1177  }
1178  }
1179  }
1180  }
1181  }
1182  }
1183  }
1184  }
1185  }
1186  }
1187 
1188  delete thePrimary;
1189 }
1190 
1191 void V0Validator::endRun(const edm::Run& iRun, const edm::EventSetup& iSetup) {
1192  //theDQMstore->showDirStructure();
1193  if(theDQMRootFileName.size() && theDQMstore) {
1195  }
1196 }
1197 
1198 
1199 //void V0Validator::endJob() {
1200  //std::cout << "In endJob()" << std::endl;
1201  /*ksEffVsRHist->Divide(ksEffVsRHist_denom);
1202  ksEffVsEtaHist->Divide(ksEffVsEtaHist_denom);
1203  ksEffVsPtHist->Divide(ksEffVsPtHist_denom);
1204  ksTkEffVsRHist->Divide(ksEffVsRHist_denom);
1205  ksTkEffVsEtaHist->Divide(ksEffVsEtaHist_denom);
1206  ksTkEffVsPtHist->Divide(ksEffVsPtHist_denom);
1207  ksFakeVsRHist->Divide(ksFakeVsRHist_denom);
1208  ksFakeVsEtaHist->Divide(ksFakeVsEtaHist_denom);
1209  ksFakeVsPtHist->Divide(ksFakeVsPtHist_denom);
1210  ksTkFakeVsRHist->Divide(ksFakeVsRHist_denom);
1211  ksTkFakeVsEtaHist->Divide(ksFakeVsEtaHist_denom);
1212  ksTkFakeVsPtHist->Divide(ksFakeVsPtHist_denom);
1213 
1214  lamEffVsRHist->Divide(lamEffVsRHist_denom);
1215  lamEffVsEtaHist->Divide(lamEffVsEtaHist_denom);
1216  lamEffVsPtHist->Divide(lamEffVsPtHist_denom);
1217  lamTkEffVsRHist->Divide(lamEffVsRHist_denom);
1218  lamTkEffVsEtaHist->Divide(lamEffVsEtaHist_denom);
1219  lamTkEffVsPtHist->Divide(lamEffVsPtHist_denom);
1220  lamFakeVsRHist->Divide(lamFakeVsRHist_denom);
1221  lamFakeVsEtaHist->Divide(lamFakeVsEtaHist_denom);
1222  lamFakeVsPtHist->Divide(lamFakeVsPtHist_denom);
1223  lamTkFakeVsRHist->Divide(lamFakeVsRHist_denom);
1224  lamTkFakeVsEtaHist->Divide(lamFakeVsEtaHist_denom);
1225  lamTkFakeVsPtHist->Divide(lamFakeVsPtHist_denom);
1226 
1227  theDQMstore->cd();
1228  std::string subDirName = dirName + "/Efficiency";
1229  theDQMstore->setCurrentFolder(subDirName.c_str());
1230 
1231  ksEffVsR = theDQMstore->book1D("KsEffVsR", ksEffVsRHist);
1232  ksEffVsEta = theDQMstore->book1D("KsEffVsEta", ksEffVsEtaHist);
1233  ksEffVsPt = theDQMstore->book1D("KsEffVsPt", ksEffVsPtHist);
1234  ksTkEffVsR = theDQMstore->book1D("KsTkEffVsR", ksTkEffVsRHist);
1235  ksTkEffVsEta = theDQMstore->book1D("KsTkEffVsEta", ksTkEffVsEtaHist);
1236  ksTkEffVsPt = theDQMstore->book1D("KsTkEffVsPt", ksTkEffVsPtHist);
1237 
1238  lamEffVsR = theDQMstore->book1D("LamEffVsR", lamEffVsRHist);
1239  lamEffVsEta = theDQMstore->book1D("LamEffVsEta", lamEffVsEtaHist);
1240  lamEffVsPt = theDQMstore->book1D("LamEffVsPt", lamEffVsPtHist);
1241  lamTkEffVsR = theDQMstore->book1D("LamTkEffVsR", lamTkEffVsRHist);
1242  lamTkEffVsEta = theDQMstore->book1D("LamTkEffVsEta", lamTkEffVsEtaHist);
1243  lamTkEffVsPt = theDQMstore->book1D("LamTkEffVsPt", lamTkEffVsPtHist);
1244 
1245  theDQMstore->cd();
1246  subDirName = dirName + "/Fake";
1247  theDQMstore->setCurrentFolder(subDirName.c_str());
1248 
1249  ksFakeVsR = theDQMstore->book1D("KsFakeVsR", ksFakeVsRHist);
1250  ksFakeVsEta = theDQMstore->book1D("KsFakeVsEta", ksFakeVsEtaHist);
1251  ksFakeVsPt = theDQMstore->book1D("KsFakeVsPt", ksFakeVsPtHist);
1252  ksTkFakeVsR = theDQMstore->book1D("KsTkFakeVsR", ksTkFakeVsRHist);
1253  ksTkFakeVsEta = theDQMstore->book1D("KsTkFakeVsEta", ksTkFakeVsEtaHist);
1254  ksTkFakeVsPt = theDQMstore->book1D("KsTkFakeVsPt", ksTkFakeVsPtHist);
1255 
1256  lamFakeVsR = theDQMstore->book1D("LamFakeVsR", lamFakeVsRHist);
1257  lamFakeVsEta = theDQMstore->book1D("LamFakeVsEta", lamFakeVsEtaHist);
1258  lamFakeVsPt = theDQMstore->book1D("LamFakeVsPt", lamFakeVsPtHist);
1259  lamTkFakeVsR = theDQMstore->book1D("LamTkFakeVsR", lamTkFakeVsRHist);
1260  lamTkFakeVsEta = theDQMstore->book1D("LamTkFakeVsEta", lamTkFakeVsEtaHist);
1261  lamTkFakeVsPt = theDQMstore->book1D("LamTkFakeVsPt", lamTkFakeVsPtHist);
1262 
1263  nKs = theDQMstore->book1D("nK0s", nKsHist);
1264  nLam = theDQMstore->book1D("nLam", nLamHist);
1265 
1266  ksCandStatusME = theDQMstore->book1D("ksCandStatus", ksCandStatusHist);
1267  lamCandStatusME = theDQMstore->book1D("lamCandStatus", lamCandStatusHist);
1268 
1269  fakeKsMass = theDQMstore->book1D("ksMassFake", fakeKsMassHisto);
1270  goodKsMass = theDQMstore->book1D("ksMassGood", goodKsMassHisto);
1271  fakeLamMass = theDQMstore->book1D("lamMassFake", fakeLamMassHisto);
1272  goodLamMass = theDQMstore->book1D("lamMassGood", goodLamMassHisto);
1273 
1274  ksFakeDauRadDist = theDQMstore->book1D("radDistFakeKs", ksFakeDauRadDistHisto);
1275  lamFakeDauRadDist = theDQMstore->book1D("radDistFakeLam", lamFakeDauRadDistHisto);
1276 
1277  // ***************************************/
1278  /*theDQMstore->tag(ksEffVsR->getFullname(), 1);
1279  theDQMstore->tag(ksEffVsEta->getFullname(), 2);
1280  theDQMstore->tag(ksEffVsPt->getFullname(), 3);
1281  theDQMstore->tag(ksTkEffVsR->getFullname(), 4);
1282  theDQMstore->tag(ksTkEffVsEta->getFullname(), 5);
1283  theDQMstore->tag(ksTkEffVsPt->getFullname(), 6);
1284 
1285  theDQMstore->tag(lamEffVsR->getFullname(), 7);
1286  theDQMstore->tag(lamEffVsEta->getFullname(), 8);
1287  theDQMstore->tag(lamEffVsPt->getFullname(), 9);
1288  theDQMstore->tag(lamTkEffVsR->getFullname(), 10);
1289  theDQMstore->tag(lamTkEffVsEta->getFullname(), 11);
1290  theDQMstore->tag(lamTkEffVsPt->getFullname(), 12);
1291 
1292  theDQMstore->tag(ksFakeVsR->getFullname(), 13);
1293  theDQMstore->tag(ksFakeVsEta->getFullname(), 14);
1294  theDQMstore->tag(ksFakeVsPt->getFullname(), 15);
1295  theDQMstore->tag(ksTkFakeVsR->getFullname(), 16);
1296  theDQMstore->tag(ksTkFakeVsEta->getFullname(), 17);
1297  theDQMstore->tag(ksTkFakeVsPt->getFullname(), 18);
1298 
1299  theDQMstore->tag(lamFakeVsR->getFullname(), 19);
1300  theDQMstore->tag(lamFakeVsEta->getFullname(), 20);
1301  theDQMstore->tag(lamFakeVsPt->getFullname(), 21);
1302  theDQMstore->tag(lamTkFakeVsR->getFullname(), 22);
1303  theDQMstore->tag(lamTkFakeVsEta->getFullname(), 23);
1304  theDQMstore->tag(lamTkFakeVsPt->getFullname(), 24);
1305 
1306  theDQMstore->tag(nKs->getFullname(), 25);
1307  theDQMstore->tag(nLam->getFullname(), 26);
1308 
1309  theDQMstore->tag(ksCandStatusME->getFullname(), 27);
1310  theDQMstore->tag(lamCandStatusME->getFullname(), 28);
1311 
1312  theDQMstore->tag(fakeKsMass->getFullname(), 29);
1313  theDQMstore->tag(goodKsMass->getFullname(), 30);
1314  theDQMstore->tag(fakeLamMass->getFullname(), 31);
1315  theDQMstore->tag(goodLamMass->getFullname(), 32);
1316 
1317  theDQMstore->tag(ksFakeDauRadDist->getFullname(), 33);
1318  theDQMstore->tag(lamFakeDauRadDist->getFullname(), 34);*/
1319  /****************************************/
1320 
1321  /*theDQMstore->showDirStructure();
1322  theDQMstore->save(theDQMRootFileName);*/
1323 //}
1324 
1325 //define this as a plug-in
1326 //DEFINE_FWK_MODULE(V0Validator);
MonitorElement * ksTkFakeVsPt
Definition: V0Validator.h:192
int i
Definition: DBlmapReader.cc:9
MonitorElement * nLam
Definition: V0Validator.h:257
MonitorElement * lamTkFakeVsR_num
Definition: V0Validator.h:243
MonitorElement * ksEffVsR
Definition: V0Validator.h:181
unsigned int K0sCandStatus
Definition: V0Validator.h:106
V0Validator(const edm::ParameterSet &)
Definition: V0Validator.cc:36
float LamGenR
Definition: V0Validator.h:103
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
std::vector< TrackingParticle > TrackingParticleCollection
MonitorElement * ksFakeVsPt_denom
Definition: V0Validator.h:209
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:406
float LamCandR
Definition: V0Validator.h:105
MonitorElement * lamTkEffVsR
Definition: V0Validator.h:224
int pdgId() const
PDG id, signal source, crossing number.
const double protonMass
Definition: V0Fitter.cc:43
MonitorElement * lamFakeVsPt
Definition: V0Validator.h:229
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
Definition: DQMStore.cc:2113
MonitorElement * ksTkFakeVsEta
Definition: V0Validator.h:191
MonitorElement * ksFakeVsR_denom
Definition: V0Validator.h:207
MonitorElement * ksFakeVsEta_num
Definition: V0Validator.h:201
#define abs(x)
Definition: mlp_lapack.h:159
unsigned int LamPiCandStatus[2]
Definition: V0Validator.h:107
MonitorElement * lamEffVsEta_num
Definition: V0Validator.h:235
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
MonitorElement * lamFakeVsPt_denom
Definition: V0Validator.h:216
const double piMassSquared
Definition: V0Fitter.cc:42
MonitorElement * ksEffVsR_num
Definition: V0Validator.h:194
const double piMass
Definition: V0Fitter.cc:41
MonitorElement * ksFakeVsPt_num
Definition: V0Validator.h:202
MonitorElement * lamFakeVsR_denom
Definition: V0Validator.h:214
MonitorElement * lamEffVsPt_denom
Definition: V0Validator.h:219
unsigned int K0sPiCandStatus[2]
Definition: V0Validator.h:107
uint16_t size_type
MonitorElement * lamEffVsPt_num
Definition: V0Validator.h:236
MonitorElement * lamTkFakeVsR
Definition: V0Validator.h:230
MonitorElement * lamFakeVsR
Definition: V0Validator.h:227
virtual void analyze(const edm::Event &, const edm::EventSetup &)
Definition: V0Validator.cc:451
void Fill(long long x)
MonitorElement * ksFakeVsEta
Definition: V0Validator.h:188
MonitorElement * lamZResolution
Definition: V0Validator.h:253
unsigned int LamPiEff[2]
Definition: V0Validator.h:107
MonitorElement * lamFakeDauRadDist
Definition: V0Validator.h:272
MonitorElement * lamTkEffVsEta
Definition: V0Validator.h:225
MonitorElement * lamEffVsR
Definition: V0Validator.h:221
MonitorElement * ksFakeVsEta_denom
Definition: V0Validator.h:208
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
int iEvent
Definition: GenABIO.cc:243
MonitorElement * fakeLamMass
Definition: V0Validator.h:264
MonitorElement * ksFakeDauRadDist
Definition: V0Validator.h:271
MonitorElement * lamTkFakeVsEta_num
Definition: V0Validator.h:244
edm::RefVector< edm::HepMCProduct, HepMC::GenVertex > GenVertexRefVector
MonitorElement * lamTkFakeVsPt
Definition: V0Validator.h:232
MonitorElement * ksEffVsPt_denom
Definition: V0Validator.h:212
int lamCandFound
Definition: V0Validator.h:111
MonitorElement * ksTkFakeVsEta_num
Definition: V0Validator.h:204
int k0sCandFound
Definition: V0Validator.h:111
int noTPforLamCand
Definition: V0Validator.h:111
T sqrt(T t)
Definition: SSEVec.h:46
MonitorElement * ksTkEffVsR_num
Definition: V0Validator.h:197
MonitorElement * lamFakeVsEta_denom
Definition: V0Validator.h:215
const double protonMassSquared
Definition: V0Fitter.cc:44
DQMStore * theDQMstore
Definition: V0Validator.h:179
edm::InputTag lamCollectionTag
Definition: V0Validator.h:277
MonitorElement * lamXResolution
Definition: V0Validator.h:251
MonitorElement * ksEffVsEta_denom
Definition: V0Validator.h:211
MonitorElement * lamTkEffVsPt
Definition: V0Validator.h:226
float K0sCandEta
Definition: V0Validator.h:105
unsigned int size_type
Definition: View.h:85
int j
Definition: DBlmapReader.cc:9
MonitorElement * goodKsMass
Definition: V0Validator.h:263
float LamGenpT
Definition: V0Validator.h:103
int realLamFound
Definition: V0Validator.h:110
const TrackingVertexRef & parentVertex() const
MonitorElement * fakeKsMass
Definition: V0Validator.h:262
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
MonitorElement * ksTkEffVsPt
Definition: V0Validator.h:186
MonitorElement * goodLamMass
Definition: V0Validator.h:265
MonitorElement * ksFakeVsPt
Definition: V0Validator.h:189
edm::Ref< TrackingVertexCollection > TrackingVertexRef
unsigned int LamGenStatus
Definition: V0Validator.h:106
MonitorElement * lamTkFakeVsEta
Definition: V0Validator.h:231
unsigned int K0sGenStatus
Definition: V0Validator.h:106
MonitorElement * ksMassAll
Definition: V0Validator.h:267
MonitorElement * lamTkEffVsR_num
Definition: V0Validator.h:237
MonitorElement * ksTkEffVsR
Definition: V0Validator.h:184
MonitorElement * nKs
Definition: V0Validator.h:256
MonitorElement * lamTkEffVsEta_num
Definition: V0Validator.h:238
int noTPforK0sCand
Definition: V0Validator.h:111
float K0sGenEta
Definition: V0Validator.h:103
MonitorElement * ksXResolution
Definition: V0Validator.h:247
float K0sCandpT
Definition: V0Validator.h:105
float K0sGenpT
Definition: V0Validator.h:103
MonitorElement * lamEffVsEta_denom
Definition: V0Validator.h:218
std::vector< TrackingVertex > TrackingVertexCollection
const T & get() const
Definition: EventSetup.h:55
std::vector< SimVertex > SimVertexContainer
MonitorElement * lamFakeVsEta
Definition: V0Validator.h:228
MonitorElement * ksAbsoluteDistResolution
Definition: V0Validator.h:250
MonitorElement * ksCandStatus
Definition: V0Validator.h:259
Vector momentum() const
spatial momentum vector
Definition: ParticleBase.h:86
MonitorElement * lamCandStatus
Definition: V0Validator.h:260
MonitorElement * lamEffVsEta
Definition: V0Validator.h:222
MonitorElement * lamTkFakeVsPt_num
Definition: V0Validator.h:245
MonitorElement * lamFakeVsEta_num
Definition: V0Validator.h:241
std::string theDQMRootFileName
Definition: V0Validator.h:275
MonitorElement * ksTkEffVsPt_num
Definition: V0Validator.h:199
MonitorElement * lamFakeVsPt_num
Definition: V0Validator.h:242
MonitorElement * lamMassAll
Definition: V0Validator.h:268
float K0sCandR
Definition: V0Validator.h:105
MonitorElement * lamFakeVsR_num
Definition: V0Validator.h:240
float LamGenEta
Definition: V0Validator.h:103
float LamCandEta
Definition: V0Validator.h:105
MonitorElement * lamEffVsR_num
Definition: V0Validator.h:234
MonitorElement * ksFakeVsR
Definition: V0Validator.h:187
MonitorElement * ksEffVsEta
Definition: V0Validator.h:182
tuple mass
Definition: scaleCards.py:27
MonitorElement * lamTkEffVsPt_num
Definition: V0Validator.h:239
MonitorElement * lamAbsoluteDistResolution
Definition: V0Validator.h:254
MonitorElement * ksZResolution
Definition: V0Validator.h:249
unsigned int LamCandStatus
Definition: V0Validator.h:106
MonitorElement * ksEffVsPt_num
Definition: V0Validator.h:196
MonitorElement * ksTkEffVsEta_num
Definition: V0Validator.h:198
tuple cout
Definition: gather_cfg.py:121
MonitorElement * lamEffVsPt
Definition: V0Validator.h:223
MonitorElement * ksEffVsR_denom
Definition: V0Validator.h:210
MonitorElement * ksTkFakeVsPt_num
Definition: V0Validator.h:205
edm::InputTag k0sCollectionTag
Definition: V0Validator.h:276
int realK0sFoundEff
Definition: V0Validator.h:110
MonitorElement * ksTkEffVsEta
Definition: V0Validator.h:185
MonitorElement * ksFakeVsR_num
Definition: V0Validator.h:200
MonitorElement * ksEffVsEta_num
Definition: V0Validator.h:195
virtual void endRun(const edm::Run &, const edm::EventSetup &)
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:242
const Point & vertex() const
vertex position
Definition: ParticleBase.h:228
MonitorElement * lamYResolution
Definition: V0Validator.h:252
std::string dirName
Definition: V0Validator.h:278
MonitorElement * ksEffVsPt
Definition: V0Validator.h:183
std::vector< SimTrack > SimTrackContainer
unsigned int K0sPiEff[2]
Definition: V0Validator.h:107
int k0sTracksFound
Definition: V0Validator.h:111
edm::RefVector< edm::HepMCProduct, HepMC::GenParticle > GenParticleRefVector
Definition: V0Validator.cc:27
int realLamFoundEff
Definition: V0Validator.h:110
float K0sGenR
Definition: V0Validator.h:103
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
MonitorElement * ksTkFakeVsR
Definition: V0Validator.h:190
MonitorElement * ksYResolution
Definition: V0Validator.h:248
MonitorElement * lamEffVsR_denom
Definition: V0Validator.h:217
Definition: Run.h:33
int realK0sFound
Definition: V0Validator.h:110
virtual void beginRun(const edm::Run &, const edm::EventSetup &)
Definition: V0Validator.cc:56
float LamCandpT
Definition: V0Validator.h:105
MonitorElement * ksTkFakeVsR_num
Definition: V0Validator.h:203