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