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