CMS 3D CMS Logo

TkConvValidator.cc
Go to the documentation of this file.
1 #include <iostream>
2 //
5 //
7 
8 //
12 //
18 //
22 //
28 //
32 //
35 #include "CLHEP/Units/GlobalPhysicalConstants.h"
37 //
46 
47 //
70 
71 //
79 
80 //
81 //
82 #include "TFile.h"
83 #include "TH1.h"
84 #include "TH2.h"
85 #include "TTree.h"
86 #include "TVector3.h"
87 #include "TProfile.h"
88 //
97 using namespace std;
98 
100  fName_ = pset.getUntrackedParameter<std::string>("Name");
101  verbosity_ = pset.getUntrackedParameter<int>("Verbosity");
102  parameters_ = pset;
103 
104  photonCollectionProducer_ = pset.getParameter<std::string>("phoProducer");
105  photonCollection_ = pset.getParameter<std::string>("photonCollection");
106  photonCollectionPr_Token_ =
107  consumes<reco::PhotonCollection>(edm::InputTag(photonCollectionProducer_, photonCollection_));
108 
109  conversionCollectionProducer_ = pset.getParameter<std::string>("convProducer");
110  conversionCollection_ = pset.getParameter<std::string>("conversionCollection");
111  conversionCollectionPr_Token_ =
112  consumes<reco::ConversionCollection>(edm::InputTag(conversionCollectionProducer_, conversionCollection_));
113 
114  // conversionTrackProducer_ = pset.getParameter<std::string>("trackProducer");
115  dqmpath_ = pset.getParameter<std::string>("dqmpath");
116  minPhoEtCut_ = pset.getParameter<double>("minPhoEtCut");
117  generalTracksOnly_ = pset.getParameter<bool>("generalTracksOnly");
118  arbitratedMerged_ = pset.getParameter<bool>("arbitratedMerged");
119  arbitratedEcalSeeded_ = pset.getParameter<bool>("arbitratedEcalSeeded");
120  ecalalgotracks_ = pset.getParameter<bool>("ecalalgotracks");
121  highPurity_ = pset.getParameter<bool>("highPurity");
122  minProb_ = pset.getParameter<double>("minProb");
123  maxHitsBeforeVtx_ = pset.getParameter<uint>("maxHitsBeforeVtx");
124  minLxy_ = pset.getParameter<double>("minLxy");
125  isRunCentrally_ = pset.getParameter<bool>("isRunCentrally");
126 
127  offline_pvToken_ = consumes<reco::VertexCollection>(
128  pset.getUntrackedParameter<edm::InputTag>("offlinePV", edm::InputTag("offlinePrimaryVertices")));
129  beamspotToken_ =
130  consumes<reco::BeamSpot>(pset.getUntrackedParameter<edm::InputTag>("beamspot", edm::InputTag("offlineBeamSpot")));
131  g4_simTk_Token_ = consumes<edm::SimTrackContainer>(pset.getParameter<edm::InputTag>("simTracks"));
132  g4_simVtx_Token_ = consumes<edm::SimVertexContainer>(pset.getParameter<edm::InputTag>("simTracks"));
133 
134  tpSelForEff_Token_ = consumes<TrackingParticleRefVector>(edm::InputTag("tpSelecForEfficiency"));
135  tpSelForFake_Token_ = consumes<TrackingParticleRefVector>(edm::InputTag("tpSelecForFakeRate"));
136  //hepMC_Token_ = consumes<edm::HepMCProduct>(edm::InputTag("generatorSmeared"));
137  //genjets_Token_ = consumes<reco::GenJetCollection>(
138  // edm::InputTag("ak4GenJets"));
139 
140  trackAssociator_Token_ =
141  consumes<reco::TrackToTrackingParticleAssociator>(edm::InputTag("trackAssociatorByHitsForConversionValidation"));
142 }
143 
145 
147  nEvt_ = 0;
148  nEntry_ = 0;
149  nRecConv_ = 0;
150  nRecConvAss_ = 0;
151  nRecConvAssWithEcal_ = 0;
152 
153  nInvalidPCA_ = 0;
154 
155  dbe_ = nullptr;
156  dbe_ = edm::Service<DQMStore>().operator->();
157 
158  double etMin = parameters_.getParameter<double>("etMin");
159  double etMax = parameters_.getParameter<double>("etMax");
160  int etBin = parameters_.getParameter<int>("etBin");
161 
162  double resMin = parameters_.getParameter<double>("resMin");
163  double resMax = parameters_.getParameter<double>("resMax");
164  int resBin = parameters_.getParameter<int>("resBin");
165 
166  double etaMin = parameters_.getParameter<double>("etaMin");
167  double etaMax = parameters_.getParameter<double>("etaMax");
168  int etaBin = parameters_.getParameter<int>("etaBin");
169  int etaBin2 = parameters_.getParameter<int>("etaBin2");
170 
171  double phiMin = parameters_.getParameter<double>("phiMin");
172  double phiMax = parameters_.getParameter<double>("phiMax");
173  int phiBin = parameters_.getParameter<int>("phiBin");
174 
175  double rMin = parameters_.getParameter<double>("rMin");
176  double rMax = parameters_.getParameter<double>("rMax");
177  int rBin = parameters_.getParameter<int>("rBin");
178 
179  double zMin = parameters_.getParameter<double>("zMin");
180  double zMax = parameters_.getParameter<double>("zMax");
181  int zBin = parameters_.getParameter<int>("zBin");
182 
183  double dPhiTracksMin = parameters_.getParameter<double>("dPhiTracksMin");
184  double dPhiTracksMax = parameters_.getParameter<double>("dPhiTracksMax");
185  int dPhiTracksBin = parameters_.getParameter<int>("dPhiTracksBin");
186 
187  double eoverpMin = parameters_.getParameter<double>("eoverpMin");
188  double eoverpMax = parameters_.getParameter<double>("eoverpMax");
189  int eoverpBin = parameters_.getParameter<int>("eoverpBin");
190 
191  // double dEtaTracksMin = parameters_.getParameter<double>("dEtaTracksMin"); // unused
192  // double dEtaTracksMax = parameters_.getParameter<double>("dEtaTracksMax"); // unused
193  // int dEtaTracksBin = parameters_.getParameter<int>("dEtaTracksBin"); // unused
194 
195  double dCotTracksMin = parameters_.getParameter<double>("dCotTracksMin");
196  double dCotTracksMax = parameters_.getParameter<double>("dCotTracksMax");
197  int dCotTracksBin = parameters_.getParameter<int>("dCotTracksBin");
198 
199  double chi2Min = parameters_.getParameter<double>("chi2Min");
200  double chi2Max = parameters_.getParameter<double>("chi2Max");
201 
202  double rMinForXray = parameters_.getParameter<double>("rMinForXray");
203  double rMaxForXray = parameters_.getParameter<double>("rMaxForXray");
204  int rBinForXray = parameters_.getParameter<int>("rBinForXray");
205  double zMinForXray = parameters_.getParameter<double>("zMinForXray");
206  double zMaxForXray = parameters_.getParameter<double>("zMaxForXray");
207  int zBinForXray = parameters_.getParameter<int>("zBinForXray");
208  int zBin2ForXray = parameters_.getParameter<int>("zBin2ForXray");
209 
210  minPhoPtForEffic = parameters_.getParameter<double>("minPhoPtForEffic");
211  maxPhoEtaForEffic = parameters_.getParameter<double>("maxPhoEtaForEffic");
212  maxPhoZForEffic = parameters_.getParameter<double>("maxPhoZForEffic");
213  maxPhoRForEffic = parameters_.getParameter<double>("maxPhoRForEffic");
214  minPhoPtForPurity = parameters_.getParameter<double>("minPhoPtForPurity");
215  maxPhoEtaForPurity = parameters_.getParameter<double>("maxPhoEtaForPurity");
216  maxPhoZForPurity = parameters_.getParameter<double>("maxPhoZForPurity");
217  maxPhoRForPurity = parameters_.getParameter<double>("maxPhoRForPurity");
218 
219  if (dbe_) {
221  // SC from reco photons
222 
223  //TString simfolder = TString(
224  std::string simpath = dqmpath_ + "SimulationInfo";
225  iBooker.setCurrentFolder(simpath);
226  //
227  // simulation information about conversions
229  std::string histname = "nOfSimConversions";
230  h_nSimConv_[0] = iBooker.book1D(histname, "# of Sim conversions per event ", 20, -0.5, 19.5);
232  histname = "h_AllSimConvEta";
233  h_AllSimConv_[0] = iBooker.book1D(histname, " All conversions: simulated #eta", etaBin2, etaMin, etaMax);
234  histname = "h_AllSimConvPhi";
235  h_AllSimConv_[1] = iBooker.book1D(histname, " All conversions: simulated #phi", phiBin, phiMin, phiMax);
236  histname = "h_AllSimConvR";
237  h_AllSimConv_[2] = iBooker.book1D(histname, " All conversions: simulated R", rBin, rMin, rMax);
238  histname = "h_AllSimConvZ";
239  h_AllSimConv_[3] = iBooker.book1D(histname, " All conversions: simulated Z", zBin, zMin, zMax);
240  histname = "h_AllSimConvEt";
241  h_AllSimConv_[4] = iBooker.book1D(histname, " All conversions: simulated Et", etBin, etMin, etMax);
242  //
243  histname = "nOfVisSimConversions";
244  h_nSimConv_[1] = iBooker.book1D(histname, "# of Sim conversions per event ", 20, -0.5, 19.5);
245  histname = "h_VisSimConvEta";
246  h_VisSimConv_[0] = iBooker.book1D(histname, " All vis conversions: simulated #eta", etaBin2, etaMin, etaMax);
247  histname = "h_VisSimConvPhi";
248  h_VisSimConv_[1] = iBooker.book1D(histname, " All vis conversions: simulated #phi", phiBin, phiMin, phiMax);
249  histname = "h_VisSimConvR";
250  h_VisSimConv_[2] = iBooker.book1D(histname, " All vis conversions: simulated R", rBin, rMin, rMax);
251  histname = "h_VisSimConvZ";
252  h_VisSimConv_[3] = iBooker.book1D(histname, " All vis conversions: simulated Z", zBin, zMin, zMax);
253  histname = "h_VisSimConvEt";
254  h_VisSimConv_[4] = iBooker.book1D(histname, " All vis conversions: simulated Et", etBin, etMin, etMax);
255 
256  //
257  histname = "h_SimConvTwoMTracksEta";
258  h_SimConvTwoMTracks_[0] = iBooker.book1D(
259  histname, " All vis conversions with 2 reco-matching tracks: simulated #eta", etaBin2, etaMin, etaMax);
260  histname = "h_SimConvTwoMTracksPhi";
261  h_SimConvTwoMTracks_[1] = iBooker.book1D(
262  histname, " All vis conversions with 2 reco-matching tracks: simulated #phi", phiBin, phiMin, phiMax);
263  histname = "h_SimConvTwoMTracksR";
264  h_SimConvTwoMTracks_[2] =
265  iBooker.book1D(histname, " All vis conversions with 2 reco-matching tracks: simulated R", rBin, rMin, rMax);
266  histname = "h_SimConvTwoMTracksZ";
267  h_SimConvTwoMTracks_[3] =
268  iBooker.book1D(histname, " All vis conversions with 2 reco-matching tracks: simulated Z", zBin, zMin, zMax);
269  histname = "h_SimConvTwoMTracksEt";
270  h_SimConvTwoMTracks_[4] =
271  iBooker.book1D(histname, " All vis conversions with 2 reco-matching tracks: simulated Et", etBin, etMin, etMax);
272  //
273  histname = "h_SimConvTwoTracksEta";
274  h_SimConvTwoTracks_[0] =
275  iBooker.book1D(histname, " All vis conversions with 2 reco tracks: simulated #eta", etaBin2, etaMin, etaMax);
276  histname = "h_SimConvTwoTracksPhi";
277  h_SimConvTwoTracks_[1] =
278  iBooker.book1D(histname, " All vis conversions with 2 reco tracks: simulated #phi", phiBin, phiMin, phiMax);
279  histname = "h_SimConvTwoTracksR";
280  h_SimConvTwoTracks_[2] =
281  iBooker.book1D(histname, " All vis conversions with 2 reco tracks: simulated R", rBin, rMin, rMax);
282  histname = "h_SimConvTwoTracksZ";
283  h_SimConvTwoTracks_[3] =
284  iBooker.book1D(histname, " All vis conversions with 2 reco tracks: simulated Z", zBin, zMin, zMax);
285  histname = "h_SimConvTwoTracksEt";
286  h_SimConvTwoTracks_[4] =
287  iBooker.book1D(histname, " All vis conversions with 2 reco tracks: simulated Et", etBin, etMin, etMax);
288  //
289  histname = "h_SimConvTwoMTracksEtaAndVtxPGT0";
290  h_SimConvTwoMTracksAndVtxPGT0_[0] = iBooker.book1D(
291  histname, " All vis conversions with 2 reco-matching tracks + vertex: simulated #eta", etaBin2, etaMin, etaMax);
292  histname = "h_SimConvTwoMTracksPhiAndVtxPGT0";
293  h_SimConvTwoMTracksAndVtxPGT0_[1] = iBooker.book1D(
294  histname, " All vis conversions with 2 reco-matching tracks + vertex: simulated #phi", phiBin, phiMin, phiMax);
295  histname = "h_SimConvTwoMTracksRAndVtxPGT0";
296  h_SimConvTwoMTracksAndVtxPGT0_[2] = iBooker.book1D(
297  histname, " All vis conversions with 2 reco-matching tracks + vertex: simulated R", rBin, rMin, rMax);
298  histname = "h_SimConvTwoMTracksZAndVtxPGT0";
299  h_SimConvTwoMTracksAndVtxPGT0_[3] = iBooker.book1D(
300  histname, " All vis conversions with 2 reco-matching tracks + vertex: simulated Z", zBin, zMin, zMax);
301  histname = "h_SimConvTwoMTracksEtAndVtxPGT0";
302  h_SimConvTwoMTracksAndVtxPGT0_[4] = iBooker.book1D(
303  histname, " All vis conversions with 2 reco-matching tracks + vertex: simulated Et", etBin, etMin, etMax);
304 
305  //
306  histname = "h_SimConvTwoMTracksEtaAndVtxPGT0005";
307  h_SimConvTwoMTracksAndVtxPGT0005_[0] = iBooker.book1D(
308  histname, " All vis conversions with 2 reco-matching tracks + vertex: simulated #eta", etaBin2, etaMin, etaMax);
309  histname = "h_SimConvTwoMTracksPhiAndVtxPGT0005";
310  h_SimConvTwoMTracksAndVtxPGT0005_[1] = iBooker.book1D(
311  histname, " All vis conversions with 2 reco-matching tracks + vertex: simulated #phi", phiBin, phiMin, phiMax);
312  histname = "h_SimConvTwoMTracksRAndVtxPGT0005";
313  h_SimConvTwoMTracksAndVtxPGT0005_[2] = iBooker.book1D(
314  histname, " All vis conversions with 2 reco-matching tracks + vertex: simulated R", rBin, rMin, rMax);
315  histname = "h_SimConvTwoMTracksZAndVtxPGT0005";
316  h_SimConvTwoMTracksAndVtxPGT0005_[3] = iBooker.book1D(
317  histname, " All vis conversions with 2 reco-matching tracks + vertex: simulated Z", zBin, zMin, zMax);
318  histname = "h_SimConvTwoMTracksEtAndVtxPGT0005";
319  h_SimConvTwoMTracksAndVtxPGT0005_[4] = iBooker.book1D(
320  histname, " All vis conversions with 2 reco-matching tracks + vertex: simulated Et", etBin, etMin, etMax);
321 
322  histname = "h_SimRecConvTwoMTracksEta";
323  h_SimRecConvTwoMTracks_[0] = iBooker.book1D(
324  histname, " All vis conversions with 2 reco-matching tracks: simulated #eta", etaBin2, etaMin, etaMax);
325  histname = "h_SimRecConvTwoMTracksPhi";
326  h_SimRecConvTwoMTracks_[1] = iBooker.book1D(
327  histname, " All vis conversions with 2 reco-matching tracks: simulated #phi", phiBin, phiMin, phiMax);
328  histname = "h_SimRecConvTwoMTracksR";
329  h_SimRecConvTwoMTracks_[2] =
330  iBooker.book1D(histname, " All vis conversions with 2 reco-matching tracks: simulated R", rBin, rMin, rMax);
331  histname = "h_SimRecConvTwoMTracksZ";
332  h_SimRecConvTwoMTracks_[3] =
333  iBooker.book1D(histname, " All vis conversions with 2 reco-matching tracks: simulated Z", zBin, zMin, zMax);
334  histname = "h_SimRecConvTwoMTracksEt";
335  h_SimRecConvTwoMTracks_[4] =
336  iBooker.book1D(histname, " All vis conversions with 2 reco-matching tracks: simulated Et", etBin, etMin, etMax);
337  //
338 
339  h_SimConvEtaPix_[0] = iBooker.book1D("simConvEtaPix", " sim converted Photon Eta: Pix ", etaBin, etaMin, etaMax);
340  h_simTkPt_ = iBooker.book1D("simTkPt", "Sim conversion tracks pt ", etBin * 3, 0., etMax);
341  h_simTkEta_ = iBooker.book1D("simTkEta", "Sim conversion tracks eta ", etaBin, etaMin, etaMax);
342 
343  h_simConvVtxRvsZ_[0] = iBooker.book2D("simConvVtxRvsZAll",
344  " Photon Sim conversion vtx position",
345  zBinForXray,
346  zMinForXray,
347  zMaxForXray,
348  rBinForXray,
349  rMinForXray,
350  rMaxForXray);
351  h_simConvVtxRvsZ_[1] = iBooker.book2D("simConvVtxRvsZBarrel",
352  " Photon Sim conversion vtx position",
353  zBinForXray,
354  zMinForXray,
355  zMaxForXray,
356  rBinForXray,
357  rMinForXray,
358  rMaxForXray);
359  h_simConvVtxRvsZ_[2] = iBooker.book2D("simConvVtxRvsZEndcap",
360  " Photon Sim conversion vtx position",
361  zBin2ForXray,
362  zMinForXray,
363  zMaxForXray,
364  rBinForXray,
365  rMinForXray,
366  rMaxForXray);
367  h_simConvVtxRvsZ_[3] = iBooker.book2D("simConvVtxRvsZBarrel2",
368  " Photon Sim conversion vtx position when reco R<4cm",
369  zBinForXray,
370  zMinForXray,
371  zMaxForXray,
372  rBinForXray,
373  rMinForXray,
374  rMaxForXray);
375  h_simConvVtxYvsX_ = iBooker.book2D(
376  "simConvVtxYvsXTrkBarrel", " Photon Sim conversion vtx position, (x,y) eta<1 ", 100, -80., 80., 100, -80., 80.);
377 
378  std::string convpath = dqmpath_ + "ConversionInfo";
379  iBooker.setCurrentFolder(convpath);
380 
381  histname = "nConv";
382  h_nConv_[0][0] = iBooker.book1D(
383  histname + "All", "Number Of Conversions per isolated candidates per events: All Ecal ", 10, -0.5, 9.5);
384  h_nConv_[0][1] = iBooker.book1D(
385  histname + "Barrel", "Number Of Conversions per isolated candidates per events: Ecal Barrel ", 10, -0.5, 9.5);
386  h_nConv_[0][2] = iBooker.book1D(
387  histname + "Endcap", "Number Of Conversions per isolated candidates per events: Ecal Endcap ", 10, -0.5, 9.5);
388  h_nConv_[1][0] = iBooker.book1D(histname + "All_Ass",
389  "Number Of associated Conversions per isolated candidates per events: All Ecal ",
390  10,
391  -0.5,
392  9.5);
393 
394  h_convEta_[0][0] = iBooker.book1D("convEta", " converted Photon Eta ", etaBin, etaMin, etaMax);
395  h_convEtaMatchSC_[0][0] =
396  iBooker.book1D("convEtaMatchSC", " converted Photon Eta when SC is matched ", etaBin, etaMin, etaMax);
397  h_convEta2_[0][0] = iBooker.book1D("convEta2", " converted Photon Eta ", etaBin2, etaMin, etaMax);
398  h_convPhi_[0][0] = iBooker.book1D("convPhi", " converted Photon Phi ", phiBin, phiMin, phiMax);
399  h_convR_[0][0] = iBooker.book1D("convR", " converted photon R", rBin, rMin, rMax);
400  h_convZ_[0][0] = iBooker.book1D("convZ", " converted photon Z", zBin, zMin, zMax);
401  h_convPt_[0][0] = iBooker.book1D("convPt", " conversions Transverse Energy: all eta ", etBin, etMin, etMax);
402 
403  h_convEta_[1][0] = iBooker.book1D("convEtaAss2", " Matched converted Photon Eta ", etaBin2, etaMin, etaMax);
404  h_convEta_[1][1] = iBooker.book1D("convEtaAss", " Matched converted Photon Eta ", etaBin, etaMin, etaMax);
405  h_convEtaMatchSC_[1][0] =
406  iBooker.book1D("convEtaMatchSCAss", " converted Photon Eta when SC is matched ", etaBin, etaMin, etaMax);
407  h_convPhi_[1][0] = iBooker.book1D("convPhiAss", " Matched converted Photon Phi ", phiBin, phiMin, phiMax);
408  h_convR_[1][0] = iBooker.book1D("convRAss", " Matched converted photon R", rBin, rMin, rMax);
409  h_convZ_[1][0] = iBooker.book1D("convZAss", " Matched converted photon Z", zBin, zMin, zMax);
410  h_convPt_[1][0] =
411  iBooker.book1D("convPtAss", "Matched conversions Transverse Energy: all eta ", etBin, etMin, etMax);
412 
413  h_convEta_[2][0] = iBooker.book1D("convEtaFake2", " Fake converted Photon Eta ", etaBin2, etaMin, etaMax);
414  h_convEta_[2][1] = iBooker.book1D("convEtaFake", " Fake converted Photon Eta ", etaBin, etaMin, etaMax);
415  h_convEtaMatchSC_[2][0] =
416  iBooker.book1D("convEtaMatchSCFake", " converted Photon Eta when SC is matched ", etaBin, etaMin, etaMax);
417  h_convPhi_[2][0] = iBooker.book1D("convPhiFake", " Fake converted Photon Phi ", phiBin, phiMin, phiMax);
418  h_convR_[2][0] = iBooker.book1D("convRFake", " Fake converted photon R", rBin, rMin, rMax);
419  h_convZ_[2][0] = iBooker.book1D("convZFake", " Fake converted photon Z", zBin, zMin, zMax);
420  h_convPt_[2][0] = iBooker.book1D("convPtFake", "Fake conversions Transverse Energy: all eta ", etBin, etMin, etMax);
421 
422  h_convRplot_ = iBooker.book1D("convRplot", " converted photon R", 600, 0., 120.);
423  h_convZplot_ = iBooker.book1D("convZplot", " converted photon Z", 320, -160., 160.);
424 
425  histname = "convSCdPhi";
426  h_convSCdPhi_[0][0] = iBooker.book1D(histname + "All", "dPhi between SC and conversion", 100, -0.1, 0.1);
427  h_convSCdPhi_[0][1] =
428  iBooker.book1D(histname + "Barrel", " dPhi between SC and conversion: Barrel", 100, -0.1, 0.1);
429  h_convSCdPhi_[0][2] =
430  iBooker.book1D(histname + "Endcap", " dPhi between SC and conversion: Endcap", 100, -0.1, 0.1);
431  h_convSCdPhi_[1][0] = iBooker.book1D(histname + "All_Ass", "dPhi between SC and conversion", 100, -0.1, 0.1);
432  h_convSCdPhi_[1][1] =
433  iBooker.book1D(histname + "Barrel_Ass", " dPhi between SC and conversion: Barrel", 100, -0.1, 0.1);
434  h_convSCdPhi_[1][2] =
435  iBooker.book1D(histname + "Endcap_Ass", " dPhi between SC and conversion: Endcap", 100, -0.1, 0.1);
436  h_convSCdPhi_[2][0] = iBooker.book1D(histname + "All_Fakes", "dPhi between SC and conversion", 100, -0.1, 0.1);
437  h_convSCdPhi_[2][1] =
438  iBooker.book1D(histname + "Barrel_Fakes", " dPhi between SC and conversion: Barrel", 100, -0.1, 0.1);
439  h_convSCdPhi_[2][2] =
440  iBooker.book1D(histname + "Endcap_Fakes", " dPhi between SC and conversion: Endcap", 100, -0.1, 0.1);
441  histname = "convSCdEta";
442  h_convSCdEta_[0][0] = iBooker.book1D(histname + "All", " dEta between SC and conversion", 100, -0.1, 0.1);
443  h_convSCdEta_[0][1] =
444  iBooker.book1D(histname + "Barrel", " dEta between SC and conversion: Barrel", 100, -0.1, 0.1);
445  h_convSCdEta_[0][2] =
446  iBooker.book1D(histname + "Endcap", " dEta between SC and conversion: Endcap", 100, -0.1, 0.1);
447  h_convSCdEta_[1][0] = iBooker.book1D(histname + "All_Ass", " dEta between SC and conversion", 100, -0.1, 0.1);
448  h_convSCdEta_[1][1] =
449  iBooker.book1D(histname + "Barrel_Ass", " dEta between SC and conversion: Barrel", 100, -0.1, 0.1);
450  h_convSCdEta_[1][2] =
451  iBooker.book1D(histname + "Endcap_Ass", " dEta between SC and conversion: Endcap", 100, -0.1, 0.1);
452  h_convSCdEta_[2][0] = iBooker.book1D(histname + "All_Fakes", " dEta between SC and conversion", 100, -0.1, 0.1);
453  h_convSCdEta_[2][1] =
454  iBooker.book1D(histname + "Barrel_Fakes", " dEta between SC and conversion: Barrel", 100, -0.1, 0.1);
455  h_convSCdEta_[2][2] =
456  iBooker.book1D(histname + "Endcap_Fakes", " dEta between SC and conversion: Endcap", 100, -0.1, 0.1);
457 
458  histname = "convPtRes";
459  h_convPtRes_[0] = iBooker.book1D(histname + "All", " Conversion Pt rec/true : All ecal ", resBin, resMin, resMax);
460  h_convPtRes_[1] = iBooker.book1D(histname + "Barrel", " Conversion Pt rec/true : Barrel ", resBin, resMin, resMax);
461  h_convPtRes_[2] = iBooker.book1D(histname + "Endcap", " Conversion Pt rec/true : Endcap ", resBin, resMin, resMax);
462 
463  histname = "hInvMass";
464  h_invMass_[0][0] = iBooker.book1D(
465  histname + "All_AllTracks", " Photons:Tracks from conversion: Pair invariant mass: all Ecal ", 100, 0., 1.5);
466  h_invMass_[0][1] = iBooker.book1D(histname + "Barrel_AllTracks",
467  " Photons:Tracks from conversion: Pair invariant mass: Barrel Ecal ",
468  100,
469  0.,
470  1.5);
471  h_invMass_[0][2] = iBooker.book1D(histname + "Endcap_AllTracks",
472  " Photons:Tracks from conversion: Pair invariant mass: Endcap Ecal ",
473  100,
474  0.,
475  1.5);
476  //
477  h_invMass_[1][0] = iBooker.book1D(
478  histname + "All_AssTracks", " Photons:Tracks from conversion: Pair invariant mass: all Ecal ", 100, 0., 1.5);
479  h_invMass_[1][1] = iBooker.book1D(histname + "Barrel_AssTracks",
480  " Photons:Tracks from conversion: Pair invariant mass: Barrel Ecal ",
481  100,
482  0.,
483  1.5);
484  h_invMass_[1][2] = iBooker.book1D(histname + "Endcap_AssTracks",
485  " Photons:Tracks from conversion: Pair invariant mass: Endcap Ecal ",
486  100,
487  0.,
488  1.5);
489  //
490  h_invMass_[2][0] = iBooker.book1D(
491  histname + "All_FakeTracks", " Photons:Tracks from conversion: Pair invariant mass: all Ecal ", 100, 0., 1.5);
492  h_invMass_[2][1] = iBooker.book1D(histname + "Barrel_FakeTracks",
493  " Photons:Tracks from conversion: Pair invariant mass: Barrel Ecal ",
494  100,
495  0.,
496  1.5);
497  h_invMass_[2][2] = iBooker.book1D(histname + "Endcap_FaleTracks",
498  " Photons:Tracks from conversion: Pair invariant mass: Endcap Ecal ",
499  100,
500  0.,
501  1.5);
502 
503  histname = "hDPhiTracksAtVtx";
504  h_DPhiTracksAtVtx_[0][0] = iBooker.book1D(histname + "All",
505  " Photons:Tracks from conversions: #delta#phi Tracks at vertex: all Ecal",
508  dPhiTracksMax);
509  h_DPhiTracksAtVtx_[0][1] =
510  iBooker.book1D(histname + "Barrel",
511  " Photons:Tracks from conversions: #delta#phi Tracks at vertex: Barrel Ecal",
514  dPhiTracksMax);
515  h_DPhiTracksAtVtx_[0][2] =
516  iBooker.book1D(histname + "Endcap",
517  " Photons:Tracks from conversions: #delta#phi Tracks at vertex: Endcap Ecal",
520  dPhiTracksMax);
521  h_DPhiTracksAtVtx_[1][0] = iBooker.book1D(histname + "All_Ass",
522  " Photons:Tracks from conversions: #delta#phi Tracks at vertex: all Ecal",
525  dPhiTracksMax);
526  h_DPhiTracksAtVtx_[1][1] =
527  iBooker.book1D(histname + "Barrel_Ass",
528  " Photons:Tracks from conversions: #delta#phi Tracks at vertex: Barrel Ecal",
531  dPhiTracksMax);
532  h_DPhiTracksAtVtx_[1][2] =
533  iBooker.book1D(histname + "Endcap_Ass",
534  " Photons:Tracks from conversions: #delta#phi Tracks at vertex: Endcap Ecal",
537  dPhiTracksMax);
538  h_DPhiTracksAtVtx_[2][0] = iBooker.book1D(histname + "All_Fakes",
539  " Photons:Tracks from conversions: #delta#phi Tracks at vertex: all Ecal",
542  dPhiTracksMax);
543  h_DPhiTracksAtVtx_[2][1] =
544  iBooker.book1D(histname + "Barrel_Fakes",
545  " Photons:Tracks from conversions: #delta#phi Tracks at vertex: Barrel Ecal",
548  dPhiTracksMax);
549  h_DPhiTracksAtVtx_[2][2] =
550  iBooker.book1D(histname + "Endcap_Fakes",
551  " Photons:Tracks from conversions: #delta#phi Tracks at vertex: Endcap Ecal",
554  dPhiTracksMax);
555 
556  histname = "hDPhiTracksAtVtxVsEta";
557  h2_DPhiTracksAtVtxVsEta_ = iBooker.book2D(histname + "All",
558  " Photons:Tracks from conversions: #delta#phi Tracks at vertex vs #eta",
559  etaBin2,
560  etaMin,
561  etaMax,
562  100,
563  -0.5,
564  0.5);
565  histname = "pDPhiTracksAtVtxVsEta";
566  p_DPhiTracksAtVtxVsEta_ =
567  iBooker.bookProfile(histname + "All",
568  " Photons:Tracks from conversions: #delta#phi Tracks at vertex vs #eta ",
569  etaBin2,
570  etaMin,
571  etaMax,
572  100,
573  -0.5,
574  0.5,
575  "");
576 
577  histname = "hDPhiTracksAtVtxVsR";
578  h2_DPhiTracksAtVtxVsR_ = iBooker.book2D(histname + "All",
579  " Photons:Tracks from conversions: #delta#phi Tracks at vertex vs R",
580  rBin,
581  rMin,
582  rMax,
583  100,
584  -0.5,
585  0.5);
586  histname = "pDPhiTracksAtVtxVsR";
587  p_DPhiTracksAtVtxVsR_ = iBooker.bookProfile(histname + "All",
588  " Photons:Tracks from conversions: #delta#phi Tracks at vertex vs R ",
589  rBin,
590  rMin,
591  rMax,
592  100,
593  -0.5,
594  0.5,
595  "");
596 
597  histname = "hDCotTracks";
598  h_DCotTracks_[0][0] = iBooker.book1D(histname + "All",
599  " Photons:Tracks from conversions #delta cotg(#Theta) Tracks: all Ecal ",
602  dCotTracksMax);
603  h_DCotTracks_[0][1] = iBooker.book1D(histname + "Barrel",
604  " Photons:Tracks from conversions #delta cotg(#Theta) Tracks: Barrel Ecal ",
607  dCotTracksMax);
608  h_DCotTracks_[0][2] = iBooker.book1D(histname + "Endcap",
609  " Photons:Tracks from conversions #delta cotg(#Theta) Tracks: Endcap Ecal ",
612  dCotTracksMax);
613  h_DCotTracks_[1][0] = iBooker.book1D(histname + "All_Ass",
614  " Photons:Tracks from conversions #delta cotg(#Theta) Tracks: all Ecal ",
617  dCotTracksMax);
618  h_DCotTracks_[1][1] = iBooker.book1D(histname + "Barrel_Ass",
619  " Photons:Tracks from conversions #delta cotg(#Theta) Tracks: Barrel Ecal ",
622  dCotTracksMax);
623  h_DCotTracks_[1][2] = iBooker.book1D(histname + "Endcap_Ass",
624  " Photons:Tracks from conversions #delta cotg(#Theta) Tracks: Endcap Ecal ",
627  dCotTracksMax);
628  h_DCotTracks_[2][0] = iBooker.book1D(histname + "All_Fakes",
629  " Photons:Tracks from conversions #delta cotg(#Theta) Tracks: all Ecal ",
632  dCotTracksMax);
633  h_DCotTracks_[2][1] = iBooker.book1D(histname + "Barrel_Fakes",
634  " Photons:Tracks from conversions #delta cotg(#Theta) Tracks: Barrel Ecal ",
637  dCotTracksMax);
638  h_DCotTracks_[2][2] = iBooker.book1D(histname + "Endcap_Fakes",
639  " Photons:Tracks from conversions #delta cotg(#Theta) Tracks: Endcap Ecal ",
642  dCotTracksMax);
643 
644  histname = "hDCotTracksVsEta";
645  h2_DCotTracksVsEta_ = iBooker.book2D(histname + "All",
646  " Photons:Tracks from conversions: #delta cotg(#Theta) Tracks vs #eta",
647  etaBin2,
648  etaMin,
649  etaMax,
650  100,
651  -0.2,
652  0.2);
653  histname = "pDCotTracksVsEta";
654  p_DCotTracksVsEta_ = iBooker.bookProfile(histname + "All",
655  " Photons:Tracks from conversions: #delta cotg(#Theta) Tracks vs #eta ",
656  etaBin2,
657  etaMin,
658  etaMax,
659  100,
660  -0.2,
661  0.2,
662  "");
663 
664  histname = "hDCotTracksVsR";
665  h2_DCotTracksVsR_ = iBooker.book2D(histname + "All",
666  " Photons:Tracks from conversions: #delta cotg(#Theta) Tracks at vertex vs R",
667  rBin,
668  rMin,
669  rMax,
670  100,
671  -0.2,
672  0.2);
673  histname = "pDCotTracksVsR";
674  p_DCotTracksVsR_ =
675  iBooker.bookProfile(histname + "All",
676  " Photons:Tracks from conversions: #delta cotg(#Theta) Tracks at vertex vs R ",
677  rBin,
678  rMin,
679  rMax,
680  100,
681  -0.2,
682  0.2,
683  "");
684 
685  histname = "hDistMinAppTracks";
686  h_distMinAppTracks_[0][0] = iBooker.book1D(
687  histname + "All", " Photons:Tracks from conversions Min Approach Dist Tracks: all Ecal ", 120, -0.5, 1.0);
688  h_distMinAppTracks_[0][1] = iBooker.book1D(
689  histname + "Barrel", " Photons:Tracks from conversions Min Approach Dist Tracks: Barrel Ecal ", 120, -0.5, 1.0);
690  h_distMinAppTracks_[0][2] = iBooker.book1D(
691  histname + "Endcap", " Photons:Tracks from conversions Min Approach Dist Tracks: Endcap Ecal ", 120, -0.5, 1.0);
692  h_distMinAppTracks_[1][0] = iBooker.book1D(
693  histname + "All_Ass", " Photons:Tracks from conversions Min Approach Dist Tracks: all Ecal ", 120, -0.5, 1.0);
694  h_distMinAppTracks_[1][1] =
695  iBooker.book1D(histname + "Barrel_Ass",
696  " Photons:Tracks from conversions Min Approach Dist Tracks: Barrel Ecal ",
697  120,
698  -0.5,
699  1.0);
700  h_distMinAppTracks_[1][2] =
701  iBooker.book1D(histname + "Endcap_Ass",
702  " Photons:Tracks from conversions Min Approach Dist Tracks: Endcap Ecal ",
703  120,
704  -0.5,
705  1.0);
706  h_distMinAppTracks_[2][0] = iBooker.book1D(
707  histname + "All_Fakes", " Photons:Tracks from conversions Min Approach Dist Tracks: all Ecal ", 120, -0.5, 1.0);
708  h_distMinAppTracks_[2][1] =
709  iBooker.book1D(histname + "Barrel_Fakes",
710  " Photons:Tracks from conversions Min Approach Dist Tracks: Barrel Ecal ",
711  120,
712  -0.5,
713  1.0);
714  h_distMinAppTracks_[2][2] =
715  iBooker.book1D(histname + "Endcap_Fakes",
716  " Photons:Tracks from conversions Min Approach Dist Tracks: Endcap Ecal ",
717  120,
718  -0.5,
719  1.0);
720 
721  h_convVtxRvsZ_[0] = iBooker.book2D("convVtxRvsZAll",
722  " Photon Reco conversion vtx position",
723  zBinForXray,
724  zMinForXray,
725  zMaxForXray,
726  rBinForXray,
727  rMinForXray,
728  rMaxForXray);
729  h_convVtxRvsZ_[1] = iBooker.book2D("convVtxRvsZBarrel",
730  " Photon Reco conversion vtx position",
731  zBinForXray,
732  zMinForXray,
733  zMaxForXray,
734  rBinForXray,
735  rMinForXray,
736  rMaxForXray);
737  h_convVtxRvsZ_[2] = iBooker.book2D("convVtxRvsZEndcap",
738  " Photon Reco conversion vtx position",
739  zBin2ForXray,
740  zMinForXray,
741  zMaxForXray,
742  rBinForXray,
743  rMinForXray,
744  rMaxForXray);
745  h_convVtxYvsX_ = iBooker.book2D(
746  "convVtxYvsXTrkBarrel", " Photon Reco conversion vtx position, (x,y) eta<1 ", 1000, -60., 60., 1000, -60., 60.);
748  h_convVtxRvsZ_zoom_[0] = iBooker.book2D("convVtxRvsZBarrelZoom1",
749  " Photon Reco conversion vtx position",
750  zBinForXray,
751  zMinForXray,
752  zMaxForXray,
753  rBinForXray,
754  -10.,
755  40.);
756  h_convVtxRvsZ_zoom_[1] = iBooker.book2D("convVtxRvsZBarrelZoom2",
757  " Photon Reco conversion vtx position",
758  zBinForXray,
759  zMinForXray,
760  zMaxForXray,
761  rBinForXray,
762  -10.,
763  20.);
764  h_convVtxYvsX_zoom_[0] = iBooker.book2D("convVtxYvsXTrkBarrelZoom1",
765  " Photon Reco conversion vtx position, (x,y) eta<1 ",
766  100,
767  -40.,
768  40.,
769  100,
770  -40.,
771  40.);
772  h_convVtxYvsX_zoom_[1] = iBooker.book2D("convVtxYvsXTrkBarrelZoom2",
773  " Photon Reco conversion vtx position, (x,y) eta<1 ",
774  100,
775  -20.,
776  20.,
777  100,
778  -20.,
779  20.);
780 
781  h_convVtxdR_ = iBooker.book1D("convVtxdR", " Photon Reco conversion vtx dR", 100, -10., 10.);
782  h_convVtxdX_ = iBooker.book1D("convVtxdX", " Photon Reco conversion vtx dX", 100, -10., 10.);
783  h_convVtxdY_ = iBooker.book1D("convVtxdY", " Photon Reco conversion vtx dY", 100, -10., 10.);
784  h_convVtxdZ_ = iBooker.book1D("convVtxdZ", " Photon Reco conversion vtx dZ", 100, -20., 20.);
785 
786  h_convVtxdPhi_ = iBooker.book1D("convVtxdPhi", " Photon Reco conversion vtx dPhi", 100, -0.01, 0.01);
787  h_convVtxdEta_ = iBooker.book1D("convVtxdEta", " Photon Reco conversion vtx dEta", 100, -0.5, 0.5);
788 
789  h_convVtxdR_barrel_ =
790  iBooker.book1D("convVtxdR_barrel", " Photon Reco conversion vtx dR, |eta|<=1.2", 100, -10., 10.);
791  h_convVtxdX_barrel_ =
792  iBooker.book1D("convVtxdX_barrel", " Photon Reco conversion vtx dX, |eta|<=1.2", 100, -10., 10.);
793  h_convVtxdY_barrel_ =
794  iBooker.book1D("convVtxdY_barrel", " Photon Reco conversion vtx dY, |eta|<=1.2 ", 100, -10., 10.);
795  h_convVtxdZ_barrel_ =
796  iBooker.book1D("convVtxdZ_barrel", " Photon Reco conversion vtx dZ, |eta|<=1.2,", 100, -20., 20.);
797 
798  h_convVtxdR_endcap_ =
799  iBooker.book1D("convVtxdR_endcap", " Photon Reco conversion vtx dR, |eta|>1.2 ", 100, -10., 10.);
800  h_convVtxdX_endcap_ =
801  iBooker.book1D("convVtxdX_endcap", " Photon Reco conversion vtx dX, |eta|>1.2", 100, -10., 10.);
802  h_convVtxdY_endcap_ =
803  iBooker.book1D("convVtxdY_endcap", " Photon Reco conversion vtx dY, |eta|>1.2", 100, -10., 10.);
804  h_convVtxdZ_endcap_ =
805  iBooker.book1D("convVtxdZ_endcap", " Photon Reco conversion vtx dZ, |eta|>1.2", 100, -20., 20.);
806 
807  h2_convVtxdRVsR_ = iBooker.book2D("h2ConvVtxdRVsR", " Conversion vtx dR vsR", rBin, rMin, rMax, 100, -20., 20.);
808  h2_convVtxdRVsEta_ =
809  iBooker.book2D("h2ConvVtxdRVsEta", "Conversion vtx dR vs Eta", etaBin2, etaMin, etaMax, 100, -20., 20.);
810 
811  p_convVtxdRVsR_ =
812  iBooker.bookProfile("pConvVtxdRVsR", " Conversion vtx dR vsR", rBin, rMin, rMax, 100, -20., 20., "");
813  p_convVtxdRVsEta_ =
814  iBooker.bookProfile("pConvVtxdRVsEta", "Conversion vtx dR vs Eta", etaBin2, etaMin, etaMax, 100, -20., 20., "");
815  p_convVtxdXVsX_ = iBooker.bookProfile("pConvVtxdXVsX", "Conversion vtx dX vs X", 120, -60, 60, 100, -20., 20., "");
816  p_convVtxdYVsY_ = iBooker.bookProfile("pConvVtxdYVsY", "Conversion vtx dY vs Y", 120, -60, 60, 100, -20., 20., "");
817  p_convVtxdZVsZ_ =
818  iBooker.bookProfile("pConvVtxdZVsZ", "Conversion vtx dZ vs Z", zBin, zMin, zMax, 100, -20., 20., "");
819 
820  p_convVtxdZVsR_ =
821  iBooker.bookProfile("pConvVtxdZVsR", "Conversion vtx dZ vs R", rBin, rMin, rMax, 100, -20., 20., "");
822  p2_convVtxdRVsRZ_ = iBooker.bookProfile2D(
823  "p2ConvVtxdRVsRZ", "Conversion vtx dR vs RZ", zBin, zMin, zMax, rBin, rMin, rMax, 100, 0., 20., "s");
824  p2_convVtxdZVsRZ_ = iBooker.bookProfile2D(
825  "p2ConvVtxdZVsRZ", "Conversion vtx dZ vs RZ", zBin, zMin, zMax, rBin, rMin, rMax, 100, 0., 20., "s");
826 
827  histname = "EoverPtracks";
828  h_EoverPTracks_[0][0] =
829  iBooker.book1D(histname + "All", " photons conversion E/p: all Ecal ", eoverpBin, eoverpMin, eoverpMax);
830  h_EoverPTracks_[0][1] =
831  iBooker.book1D(histname + "Barrel", " photons conversion E/p: Barrel Ecal", eoverpBin, eoverpMin, eoverpMax);
832  h_EoverPTracks_[0][2] =
833  iBooker.book1D(histname + "Endcap", " photons conversion E/p: Endcap Ecal ", eoverpBin, eoverpMin, eoverpMax);
834  h_EoverPTracks_[1][0] =
835  iBooker.book1D(histname + "All_Ass", " photons conversion E/p: all Ecal ", eoverpBin, eoverpMin, eoverpMax);
836  h_EoverPTracks_[1][1] = iBooker.book1D(
837  histname + "Barrel_Ass", " photons conversion E/p: Barrel Ecal", eoverpBin, eoverpMin, eoverpMax);
838  h_EoverPTracks_[1][2] = iBooker.book1D(
839  histname + "Endcap_Ass", " photons conversion E/p: Endcap Ecal ", eoverpBin, eoverpMin, eoverpMax);
840  h_EoverPTracks_[2][0] =
841  iBooker.book1D(histname + "All_Fakes", " photons conversion E/p: all Ecal ", eoverpBin, eoverpMin, eoverpMax);
842  h_EoverPTracks_[2][1] = iBooker.book1D(
843  histname + "Barrel_Fakes", " photons conversion E/p: Barrel Ecal", eoverpBin, eoverpMin, eoverpMax);
844  h_EoverPTracks_[2][2] = iBooker.book1D(
845  histname + "Endcap_Fakes", " photons conversion E/p: Endcap Ecal ", eoverpBin, eoverpMin, eoverpMax);
846 
847  h2_convVtxRrecVsTrue_ = iBooker.book2D(
848  "h2ConvVtxRrecVsTrue", "Photon Reco conversion vtx R rec vs true", rBin, rMin, rMax, rBin, rMin, rMax);
849 
850  histname = "vtxChi2Prob";
851  h_vtxChi2Prob_[0][0] = iBooker.book1D(histname + "All", "vertex #chi^{2} all", 100, 0., 1.);
852  h_vtxChi2Prob_[0][1] = iBooker.book1D(histname + "Barrel", "vertex #chi^{2} barrel", 100, 0., 1.);
853  h_vtxChi2Prob_[0][2] = iBooker.book1D(histname + "Endcap", "vertex #chi^{2} endcap", 100, 0., 1.);
854  h_vtxChi2Prob_[1][0] = iBooker.book1D(histname + "All_Ass", "vertex #chi^{2} all", 100, 0., 1.);
855  h_vtxChi2Prob_[1][1] = iBooker.book1D(histname + "Barrel_Ass", "vertex #chi^{2} barrel", 100, 0., 1.);
856  h_vtxChi2Prob_[1][2] = iBooker.book1D(histname + "Endcap_Ass", "vertex #chi^{2} endcap", 100, 0., 1.);
857  h_vtxChi2Prob_[2][0] = iBooker.book1D(histname + "All_Fakes", "vertex #chi^{2} all", 100, 0., 1.);
858  h_vtxChi2Prob_[2][1] = iBooker.book1D(histname + "Barrel_Fakes", "vertex #chi^{2} barrel", 100, 0., 1.);
859  h_vtxChi2Prob_[2][2] = iBooker.book1D(histname + "Endcap_Fakes", "vertex #chi^{2} endcap", 100, 0., 1.);
860 
861  h_zPVFromTracks_[1] = iBooker.book1D("zPVFromTracks", " Photons: PV z from conversion tracks", 100, -25., 25.);
862  h_dzPVFromTracks_[1] =
863  iBooker.book1D("dzPVFromTracks", " Photons: PV Z_rec - Z_true from conversion tracks", 100, -5., 5.);
864  h2_dzPVVsR_ = iBooker.book2D("h2dzPVVsR", "Photon Reco conversions: dz(PV) vs R", rBin, rMin, rMax, 100, -3., 3.);
865  p_dzPVVsR_ =
866  iBooker.bookProfile("pdzPVVsR", "Photon Reco conversions: dz(PV) vs R", rBin, rMin, rMax, 100, -3., 3., "");
867 
868  histname = "lxybs";
869  h_lxybs_[0][0] = iBooker.book1D(histname + "All", "vertex #chi^{2} all", 200, -100., 100.);
870  h_lxybs_[0][1] = iBooker.book1D(histname + "Barrel", "vertex #chi^{2} barrel", 200, -100., 100.);
871  h_lxybs_[0][2] = iBooker.book1D(histname + "Endcap", "vertex #chi^{2} endcap", 200, -100., 100.);
872  h_lxybs_[1][0] = iBooker.book1D(histname + "All_Ass", "vertex #chi^{2} all", 200, -100., 100.);
873  h_lxybs_[1][1] = iBooker.book1D(histname + "Barrel_Ass", "vertex #chi^{2} barrel", 200, -100., 100.);
874  h_lxybs_[1][2] = iBooker.book1D(histname + "Endcap_Ass", "vertex #chi^{2} endcap", 200, -100., 100.);
875  h_lxybs_[2][0] = iBooker.book1D(histname + "All_Fakes", "vertex #chi^{2} all", 200, -100., 100.);
876  h_lxybs_[2][1] = iBooker.book1D(histname + "Barrel_Fakes", "vertex #chi^{2} barrel", 200, -100., 100.);
877  h_lxybs_[2][2] = iBooker.book1D(histname + "Endcap_Fakes", "vertex #chi^{2} endcap", 200, -100., 100.);
878 
879  histname = "maxNHitsBeforeVtx";
880  h_maxNHitsBeforeVtx_[0][0] = iBooker.book1D(histname + "All", "vertex #chi^{2} all", 16, -0.5, 15.5);
881  h_maxNHitsBeforeVtx_[0][1] = iBooker.book1D(histname + "Barrel", "vertex #chi^{2} barrel", 16, -0.5, 15.5);
882  h_maxNHitsBeforeVtx_[0][2] = iBooker.book1D(histname + "Endcap", "vertex #chi^{2} endcap", 16, -0.5, 15.5);
883  h_maxNHitsBeforeVtx_[1][0] = iBooker.book1D(histname + "All_Ass", "vertex #chi^{2} all", 16, -0.5, 15.5);
884  h_maxNHitsBeforeVtx_[1][1] = iBooker.book1D(histname + "Barrel_Ass", "vertex #chi^{2} barrel", 16, -0.5, 15.5);
885  h_maxNHitsBeforeVtx_[1][2] = iBooker.book1D(histname + "Endcap_Ass", "vertex #chi^{2} endcap", 16, -0.5, 15.5);
886  h_maxNHitsBeforeVtx_[2][0] = iBooker.book1D(histname + "All_Fakes", "vertex #chi^{2} all", 16, -0.5, 15.5);
887  h_maxNHitsBeforeVtx_[2][1] = iBooker.book1D(histname + "Barrel_Fakes", "vertex #chi^{2} barrel", 16, -0.5, 15.5);
888  h_maxNHitsBeforeVtx_[2][2] = iBooker.book1D(histname + "Endcap_Fakes", "vertex #chi^{2} endcap", 16, -0.5, 15.5);
889 
890  histname = "leadNHitsBeforeVtx";
891  h_leadNHitsBeforeVtx_[0][0] = iBooker.book1D(histname + "All", "vertex #chi^{2} all", 16, -0.5, 15.5);
892  h_leadNHitsBeforeVtx_[0][1] = iBooker.book1D(histname + "Barrel", "vertex #chi^{2} barrel", 16, -0.5, 15.5);
893  h_leadNHitsBeforeVtx_[0][2] = iBooker.book1D(histname + "Endcap", "vertex #chi^{2} endcap", 16, -0.5, 15.5);
894  h_leadNHitsBeforeVtx_[1][0] = iBooker.book1D(histname + "All_Ass", "vertex #chi^{2} all", 16, -0.5, 15.5);
895  h_leadNHitsBeforeVtx_[1][1] = iBooker.book1D(histname + "Barrel_Ass", "vertex #chi^{2} barrel", 16, -0.5, 15.5);
896  h_leadNHitsBeforeVtx_[1][2] = iBooker.book1D(histname + "Endcap_Ass", "vertex #chi^{2} endcap", 16, -0.5, 15.5);
897  h_leadNHitsBeforeVtx_[2][0] = iBooker.book1D(histname + "All_Fakes", "vertex #chi^{2} all", 16, -0.5, 15.5);
898  h_leadNHitsBeforeVtx_[2][1] = iBooker.book1D(histname + "Barrel_Fakes", "vertex #chi^{2} barrel", 16, -0.5, 15.5);
899  h_leadNHitsBeforeVtx_[2][2] = iBooker.book1D(histname + "Endcap_Fakes", "vertex #chi^{2} endcap", 16, -0.5, 15.5);
900 
901  histname = "trailNHitsBeforeVtx";
902  h_trailNHitsBeforeVtx_[0][0] = iBooker.book1D(histname + "All", "vertex #chi^{2} all", 16, -0.5, 15.5);
903  h_trailNHitsBeforeVtx_[0][1] = iBooker.book1D(histname + "Barrel", "vertex #chi^{2} barrel", 16, -0.5, 15.5);
904  h_trailNHitsBeforeVtx_[0][2] = iBooker.book1D(histname + "Endcap", "vertex #chi^{2} endcap", 16, -0.5, 15.5);
905  h_trailNHitsBeforeVtx_[1][0] = iBooker.book1D(histname + "All_Ass", "vertex #chi^{2} all", 16, -0.5, 15.5);
906  h_trailNHitsBeforeVtx_[1][1] = iBooker.book1D(histname + "Barrel_Ass", "vertex #chi^{2} barrel", 16, -0.5, 15.5);
907  h_trailNHitsBeforeVtx_[1][2] = iBooker.book1D(histname + "Endcap_Ass", "vertex #chi^{2} endcap", 16, -0.5, 15.5);
908  h_trailNHitsBeforeVtx_[2][0] = iBooker.book1D(histname + "All_Fakes", "vertex #chi^{2} all", 16, -0.5, 15.5);
909  h_trailNHitsBeforeVtx_[2][1] = iBooker.book1D(histname + "Barrel_Fakes", "vertex #chi^{2} barrel", 16, -0.5, 15.5);
910  h_trailNHitsBeforeVtx_[2][2] = iBooker.book1D(histname + "Endcap_Fakes", "vertex #chi^{2} endcap", 16, -0.5, 15.5);
911 
912  histname = "sumNHitsBeforeVtx";
913  h_sumNHitsBeforeVtx_[0][0] = iBooker.book1D(histname + "All", "vertex #chi^{2} all", 16, -0.5, 15.5);
914  h_sumNHitsBeforeVtx_[0][1] = iBooker.book1D(histname + "Barrel", "vertex #chi^{2} barrel", 16, -0.5, 15.5);
915  h_sumNHitsBeforeVtx_[0][2] = iBooker.book1D(histname + "Endcap", "vertex #chi^{2} endcap", 16, -0.5, 15.5);
916  h_sumNHitsBeforeVtx_[1][0] = iBooker.book1D(histname + "All_Ass", "vertex #chi^{2} all", 16, -0.5, 15.5);
917  h_sumNHitsBeforeVtx_[1][1] = iBooker.book1D(histname + "Barrel_Ass", "vertex #chi^{2} barrel", 16, -0.5, 15.5);
918  h_sumNHitsBeforeVtx_[1][2] = iBooker.book1D(histname + "Endcap_Ass", "vertex #chi^{2} endcap", 16, -0.5, 15.5);
919  h_sumNHitsBeforeVtx_[2][0] = iBooker.book1D(histname + "All_Fakes", "vertex #chi^{2} all", 16, -0.5, 15.5);
920  h_sumNHitsBeforeVtx_[2][1] = iBooker.book1D(histname + "Barrel_Fakes", "vertex #chi^{2} barrel", 16, -0.5, 15.5);
921  h_sumNHitsBeforeVtx_[2][2] = iBooker.book1D(histname + "Endcap_Fakes", "vertex #chi^{2} endcap", 16, -0.5, 15.5);
922 
923  histname = "maxDlClosestHitToVtx";
924  h_maxDlClosestHitToVtx_[0][0] = iBooker.book1D(histname + "All", "vertex #chi^{2} all", 100, -10., 10.);
925  h_maxDlClosestHitToVtx_[0][1] = iBooker.book1D(histname + "Barrel", "vertex #chi^{2} barrel", 100, -10., 10.);
926  h_maxDlClosestHitToVtx_[0][2] = iBooker.book1D(histname + "Endcap", "vertex #chi^{2} endcap", 100, -10., 10.);
927  h_maxDlClosestHitToVtx_[1][0] = iBooker.book1D(histname + "All_Ass", "vertex #chi^{2} all", 100, -10., 10.);
928  h_maxDlClosestHitToVtx_[1][1] = iBooker.book1D(histname + "Barrel_Ass", "vertex #chi^{2} barrel", 100, -10., 10.);
929  h_maxDlClosestHitToVtx_[1][2] = iBooker.book1D(histname + "Endcap_Ass", "vertex #chi^{2} endcap", 100, -10., 10.);
930  h_maxDlClosestHitToVtx_[2][0] = iBooker.book1D(histname + "All_Fakes", "vertex #chi^{2} all", 100, -10., 10.);
931  h_maxDlClosestHitToVtx_[2][1] = iBooker.book1D(histname + "Barrel_Fakes", "vertex #chi^{2} barrel", 100, -10., 10.);
932  h_maxDlClosestHitToVtx_[2][2] = iBooker.book1D(histname + "Endcap_Fakes", "vertex #chi^{2} endcap", 100, -10., 10.);
933 
934  histname = "maxDlClosestHitToVtxSig";
935  h_maxDlClosestHitToVtxSig_[0][0] = iBooker.book1D(histname + "All", "vertex #chi^{2} all", 100, -8., 8.);
936  h_maxDlClosestHitToVtxSig_[0][1] = iBooker.book1D(histname + "Barrel", "vertex #chi^{2} barrel", 100, -8., 8.);
937  h_maxDlClosestHitToVtxSig_[0][2] = iBooker.book1D(histname + "Endcap", "vertex #chi^{2} endcap", 100, -8., 8.);
938  h_maxDlClosestHitToVtxSig_[1][0] = iBooker.book1D(histname + "All_Ass", "vertex #chi^{2} all", 100, -8., 8.);
939  h_maxDlClosestHitToVtxSig_[1][1] = iBooker.book1D(histname + "Barrel_Ass", "vertex #chi^{2} barrel", 100, -8., 8.);
940  h_maxDlClosestHitToVtxSig_[1][2] = iBooker.book1D(histname + "Endcap_Ass", "vertex #chi^{2} endcap", 100, -8., 8.);
941  h_maxDlClosestHitToVtxSig_[2][0] = iBooker.book1D(histname + "All_Fakes", "vertex #chi^{2} all", 100, -8., 8.);
942  h_maxDlClosestHitToVtxSig_[2][1] =
943  iBooker.book1D(histname + "Barrel_Fakes", "vertex #chi^{2} barrel", 100, -8., 8.);
944  h_maxDlClosestHitToVtxSig_[2][2] =
945  iBooker.book1D(histname + "Endcap_Fakes", "vertex #chi^{2} endcap", 100, -8., 8.);
946 
947  histname = "deltaExpectedHitsInner";
948  h_deltaExpectedHitsInner_[0][0] = iBooker.book1D(histname + "All", "vertex #chi^{2} all", 31, -15.5, 15.5);
949  h_deltaExpectedHitsInner_[0][1] = iBooker.book1D(histname + "Barrel", "vertex #chi^{2} barrel", 31, -15.5, 15.5);
950  h_deltaExpectedHitsInner_[0][2] = iBooker.book1D(histname + "Endcap", "vertex #chi^{2} endcap", 31, -15.5, 15.5);
951  h_deltaExpectedHitsInner_[1][0] = iBooker.book1D(histname + "All_Ass", "vertex #chi^{2} all", 31, -15.5, 15.5);
952  h_deltaExpectedHitsInner_[1][1] =
953  iBooker.book1D(histname + "Barrel_Ass", "vertex #chi^{2} barrel", 31, -15.5, 15.5);
954  h_deltaExpectedHitsInner_[1][2] =
955  iBooker.book1D(histname + "Endcap_Ass", "vertex #chi^{2} endcap", 31, -15.5, 15.5);
956  h_deltaExpectedHitsInner_[2][0] = iBooker.book1D(histname + "All_Fakes", "vertex #chi^{2} all", 31, -15.5, 15.5);
957  h_deltaExpectedHitsInner_[2][1] =
958  iBooker.book1D(histname + "Barrel_Fakes", "vertex #chi^{2} barrel", 31, -15.5, 15.5);
959  h_deltaExpectedHitsInner_[2][2] =
960  iBooker.book1D(histname + "Endcap_Fakes", "vertex #chi^{2} endcap", 31, -15.5, 15.5);
961 
962  histname = "leadExpectedHitsInner";
963  h_leadExpectedHitsInner_[0][0] = iBooker.book1D(histname + "All", "vertex #chi^{2} all", 16, -0.5, 15.5);
964  h_leadExpectedHitsInner_[0][1] = iBooker.book1D(histname + "Barrel", "vertex #chi^{2} barrel", 16, -0.5, 15.5);
965  h_leadExpectedHitsInner_[0][2] = iBooker.book1D(histname + "Endcap", "vertex #chi^{2} endcap", 16, -0.5, 15.5);
966  h_leadExpectedHitsInner_[1][0] = iBooker.book1D(histname + "All_Ass", "vertex #chi^{2} all", 16, -0.5, 15.5);
967  h_leadExpectedHitsInner_[1][1] = iBooker.book1D(histname + "Barrel_Ass", "vertex #chi^{2} barrel", 16, -0.5, 15.5);
968  h_leadExpectedHitsInner_[1][2] = iBooker.book1D(histname + "Endcap_Ass", "vertex #chi^{2} endcap", 16, -0.5, 15.5);
969  h_leadExpectedHitsInner_[2][0] = iBooker.book1D(histname + "All_Fakes", "vertex #chi^{2} all", 16, -0.5, 15.5);
970  h_leadExpectedHitsInner_[2][1] =
971  iBooker.book1D(histname + "Barrel_Fakes", "vertex #chi^{2} barrel", 16, -0.5, 15.5);
972  h_leadExpectedHitsInner_[2][2] =
973  iBooker.book1D(histname + "Endcap_Fakes", "vertex #chi^{2} endcap", 16, -0.5, 15.5);
974 
975  histname = "nSharedHits";
976  h_nSharedHits_[0][0] = iBooker.book1D(histname + "All", "vertex #chi^{2} all", 16, -0.5, 15.5);
977  h_nSharedHits_[0][1] = iBooker.book1D(histname + "Barrel", "vertex #chi^{2} barrel", 16, -0.5, 15.5);
978  h_nSharedHits_[0][2] = iBooker.book1D(histname + "Endcap", "vertex #chi^{2} endcap", 16, -0.5, 15.5);
979  h_nSharedHits_[1][0] = iBooker.book1D(histname + "All_Ass", "vertex #chi^{2} all", 16, -0.5, 15.5);
980  h_nSharedHits_[1][1] = iBooker.book1D(histname + "Barrel_Ass", "vertex #chi^{2} barrel", 16, -0.5, 15.5);
981  h_nSharedHits_[1][2] = iBooker.book1D(histname + "Endcap_Ass", "vertex #chi^{2} endcap", 16, -0.5, 15.5);
982  h_nSharedHits_[2][0] = iBooker.book1D(histname + "All_Fakes", "vertex #chi^{2} all", 16, -0.5, 15.5);
983  h_nSharedHits_[2][1] = iBooker.book1D(histname + "Barrel_Fakes", "vertex #chi^{2} barrel", 16, -0.5, 15.5);
984  h_nSharedHits_[2][2] = iBooker.book1D(histname + "Endcap_Fakes", "vertex #chi^{2} endcap", 16, -0.5, 15.5);
985 
987  histname = "nHits";
988  nHits_[0] = iBooker.book2D(histname + "AllTracks",
989  "Photons:Tracks from conversions: # of hits all tracks",
990  etaBin,
991  etaMin,
992  etaMax,
993  30,
994  0.,
995  30.);
996  nHits_[1] = iBooker.book2D(histname + "AllTracks_Ass",
997  "Photons:Tracks from conversions: # of hits all tracks ass",
998  etaBin,
999  etaMin,
1000  etaMax,
1001  30,
1002  0.,
1003  30.);
1004  nHits_[2] = iBooker.book2D(histname + "AllTracks_Fakes",
1005  "Photons:Tracks from conversions: # of hits all tracks fakes",
1006  etaBin,
1007  etaMin,
1008  etaMax,
1009  30,
1010  0.,
1011  30.);
1012 
1013  histname = "nHitsVsEta";
1014  nHitsVsEta_[0] = iBooker.book2D(histname + "AllTracks",
1015  "Photons:Tracks from conversions: # of hits vs #eta all tracks",
1016  etaBin,
1017  etaMin,
1018  etaMax,
1019  30,
1020  0.,
1021  30.);
1022  nHitsVsEta_[1] = iBooker.book2D(histname + "AllTracks_Ass",
1023  "Photons:Tracks from conversions: # of hits vs #eta all tracks",
1024  etaBin,
1025  etaMin,
1026  etaMax,
1027  30,
1028  0.,
1029  30.);
1030  nHitsVsEta_[2] = iBooker.book2D(histname + "AllTracks_Fakes",
1031  "Photons:Tracks from conversions: # of hits vs #eta all tracks",
1032  etaBin,
1033  etaMin,
1034  etaMax,
1035  30,
1036  0.,
1037  30.);
1038  histname = "h_nHitsVsEta";
1039  p_nHitsVsEta_[0] = iBooker.bookProfile(histname + "AllTracks",
1040  "Photons:Tracks from conversions: # of hits vs #eta all tracks",
1041  etaBin,
1042  etaMin,
1043  etaMax,
1044  30,
1045  -0.5,
1046  29.5,
1047  "");
1048  p_nHitsVsEta_[1] = iBooker.bookProfile(histname + "AllTracks_Ass",
1049  "Photons:Tracks from conversions: # of hits vs #eta all tracks",
1050  etaBin,
1051  etaMin,
1052  etaMax,
1053  30,
1054  -0.5,
1055  29.5,
1056  "");
1057  p_nHitsVsEta_[2] = iBooker.bookProfile(histname + "AllTracks_Fakes",
1058  "Photons:Tracks from conversions: # of hits vs #eta all tracks",
1059  etaBin,
1060  etaMin,
1061  etaMax,
1062  30,
1063  -0.5,
1064  29.5,
1065  "");
1066 
1067  histname = "nHitsVsR";
1068  nHitsVsR_[0] = iBooker.book2D(histname + "AllTracks",
1069  "Photons:Tracks from conversions: # of hits vs radius all tracks",
1070  rBin,
1071  rMin,
1072  rMax,
1073  30,
1074  0.,
1075  30.);
1076  nHitsVsR_[1] = iBooker.book2D(histname + "AllTracks_Ass",
1077  "Photons:Tracks from conversions: # of hits vs radius all tracks",
1078  rBin,
1079  rMin,
1080  rMax,
1081  30,
1082  0.,
1083  30.);
1084  nHitsVsR_[2] = iBooker.book2D(histname + "AllTracks_Fakes",
1085  "Photons:Tracks from conversions: # of hits vs radius all tracks",
1086  rBin,
1087  rMin,
1088  rMax,
1089  30,
1090  0.,
1091  30.);
1092 
1093  histname = "h_nHitsVsR";
1094  p_nHitsVsR_[0] = iBooker.bookProfile(histname + "AllTracks",
1095  "Photons:Tracks from conversions: # of hits vs radius all tracks",
1096  rBin,
1097  rMin,
1098  rMax,
1099  30,
1100  -0.5,
1101  29.5,
1102  "");
1103  p_nHitsVsR_[1] = iBooker.bookProfile(histname + "AllTracks_Ass",
1104  "Photons:Tracks from conversions: # of hits vs radius all tracks",
1105  rBin,
1106  rMin,
1107  rMax,
1108  30,
1109  -0.5,
1110  29.5,
1111  "");
1112  p_nHitsVsR_[2] = iBooker.bookProfile(histname + "AllTracks_Fakes",
1113  "Photons:Tracks from conversions: # of hits vs radius all tracks",
1114  rBin,
1115  rMin,
1116  rMax,
1117  30,
1118  -0.5,
1119  29.5,
1120  "");
1121 
1122  histname = "tkChi2";
1123  h_tkChi2_[0] = iBooker.book1D(
1124  histname + "AllTracks", "Photons:Tracks from conversions: #chi^{2} of all tracks", 100, chi2Min, chi2Max);
1125  h_tkChi2_[1] = iBooker.book1D(
1126  histname + "AllTracks_Ass", "Photons:Tracks from conversions: #chi^{2} of all tracks", 100, chi2Min, chi2Max);
1127  h_tkChi2_[2] = iBooker.book1D(
1128  histname + "AllTracks_Fakes", "Photons:Tracks from conversions: #chi^{2} of all tracks", 100, chi2Min, chi2Max);
1129 
1130  histname = "tkChi2Large";
1131  h_tkChi2Large_[0] = iBooker.book1D(
1132  histname + "AllTracks", "Photons:Tracks from conversions: #chi^{2} of all tracks", 1000, 0., 5000.0);
1133  h_tkChi2Large_[1] = iBooker.book1D(
1134  histname + "AllTracks_Ass", "Photons:Tracks from conversions: #chi^{2} of all tracks", 1000, 0., 5000.0);
1135  h_tkChi2Large_[2] = iBooker.book1D(
1136  histname + "AllTracks_Fakes", "Photons:Tracks from conversions: #chi^{2} of all tracks", 1000, 0., 5000.0);
1137 
1138  histname = "h2Chi2VsEta";
1139  h2_Chi2VsEta_[0] = iBooker.book2D(
1140  histname + "All", " Reco Track #chi^{2} vs #eta: All ", etaBin2, etaMin, etaMax, 100, chi2Min, chi2Max);
1141  h2_Chi2VsEta_[1] = iBooker.book2D(
1142  histname + "All_Ass", " Reco Track #chi^{2} vs #eta: All ", etaBin2, etaMin, etaMax, 100, chi2Min, chi2Max);
1143  h2_Chi2VsEta_[2] = iBooker.book2D(
1144  histname + "All_Fakes", " Reco Track #chi^{2} vs #eta: All ", etaBin2, etaMin, etaMax, 100, chi2Min, chi2Max);
1145  histname = "pChi2VsEta";
1146  p_Chi2VsEta_[0] = iBooker.bookProfile(
1147  histname + "All", " Reco Track #chi^{2} vs #eta : All ", etaBin2, etaMin, etaMax, 100, chi2Min, chi2Max, "");
1148  p_Chi2VsEta_[1] = iBooker.bookProfile(
1149  histname + "All_Ass", " Reco Track #chi^{2} vs #eta : All ", etaBin2, etaMin, etaMax, 100, chi2Min, chi2Max, "");
1150  p_Chi2VsEta_[2] = iBooker.bookProfile(histname + "All_Fakes",
1151  " Reco Track #chi^{2} vs #eta : All ",
1152  etaBin2,
1153  etaMin,
1154  etaMax,
1155  100,
1156  chi2Min,
1157  chi2Max,
1158  "");
1159 
1160  histname = "h2Chi2VsR";
1161  h2_Chi2VsR_[0] =
1162  iBooker.book2D(histname + "All", " Reco Track #chi^{2} vs R: All ", rBin, rMin, rMax, 100, chi2Min, chi2Max);
1163  h2_Chi2VsR_[1] = iBooker.book2D(
1164  histname + "All_Ass", " Reco Track #chi^{2} vs R: All ", rBin, rMin, rMax, 100, chi2Min, chi2Max);
1165  h2_Chi2VsR_[2] = iBooker.book2D(
1166  histname + "All_Fakes", " Reco Track #chi^{2} vs R: All ", rBin, rMin, rMax, 100, chi2Min, chi2Max);
1167  histname = "pChi2VsR";
1168  p_Chi2VsR_[0] = iBooker.bookProfile(
1169  histname + "All", " Reco Track #chi^{2} vas R : All ", rBin, rMin, rMax, 100, chi2Min, chi2Max, "");
1170  p_Chi2VsR_[1] = iBooker.bookProfile(
1171  histname + "All_Ass", " Reco Track #chi^{2} vas R : All ", rBin, rMin, rMax, 100, chi2Min, chi2Max, "");
1172  p_Chi2VsR_[2] = iBooker.bookProfile(
1173  histname + "All_Fakes", " Reco Track #chi^{2} vas R : All ", rBin, rMin, rMax, 100, chi2Min, chi2Max, "");
1174 
1175  histname = "hTkD0";
1176  h_TkD0_[0] = iBooker.book1D(histname + "All", " Reco Track D0*q: All ", 200, -0.1, 60);
1177  h_TkD0_[1] = iBooker.book1D(histname + "All_Ass", " Reco Track D0*q: Barrel ", 200, -0.1, 60);
1178  h_TkD0_[2] = iBooker.book1D(histname + "All_Fakes", " Reco Track D0*q: Endcap ", 200, -0.1, 60);
1179 
1180  histname = "hTkPtPull";
1181  h_TkPtPull_[0] = iBooker.book1D(histname + "All", " Reco Track Pt pull: All ", 100, -20., 10.);
1182  histname = "hTkPtPull";
1183  h_TkPtPull_[1] = iBooker.book1D(histname + "Barrel", " Reco Track Pt pull: Barrel ", 100, -20., 10.);
1184  histname = "hTkPtPull";
1185  h_TkPtPull_[2] = iBooker.book1D(histname + "Endcap", " Reco Track Pt pull: Endcap ", 100, -20., 10.);
1186 
1187  histname = "h2TkPtPullEta";
1188  h2_TkPtPull_[0] =
1189  iBooker.book2D(histname + "All", " Reco Track Pt pull: All ", etaBin2, etaMin, etaMax, 100, -20., 10.);
1190  histname = "pTkPtPullEta";
1191  p_TkPtPull_[0] = iBooker.bookProfile(
1192  histname + "All", " Reco Track Pt pull: All ", etaBin2, etaMin, etaMax, 100, -20., 10., " ");
1193 
1194  histname = "PtRecVsPtSim";
1195  h2_PtRecVsPtSim_[0] =
1196  iBooker.book2D(histname + "All", "Pt Rec vs Pt sim: All ", etBin, etMin, etMax, etBin, etMin, etMax);
1197  h2_PtRecVsPtSim_[1] =
1198  iBooker.book2D(histname + "Barrel", "Pt Rec vs Pt sim: Barrel ", etBin, etMin, etMax, etBin, etMin, etMax);
1199  h2_PtRecVsPtSim_[2] =
1200  iBooker.book2D(histname + "Endcap", "Pt Rec vs Pt sim: Endcap ", etBin, etMin, etMax, etBin, etMin, etMax);
1201 
1202  histname = "photonPtRecVsPtSim";
1203  h2_photonPtRecVsPtSim_ =
1204  iBooker.book2D(histname + "All", "Pt Rec vs Pt sim: All ", etBin, etMin, etMax, etBin, etMin, etMax);
1205 
1206  histname = "nHitsBeforeVtx";
1207  h_nHitsBeforeVtx_[0] = iBooker.book1D(histname + "All", "Pt Rec vs Pt sim: All ", 16, -0.5, 15.5);
1208  h_nHitsBeforeVtx_[1] = iBooker.book1D(histname + "Barrel", "Pt Rec vs Pt sim: Barrel ", 16, -0.5, 15.5);
1209  h_nHitsBeforeVtx_[2] = iBooker.book1D(histname + "Endcap", "Pt Rec vs Pt sim: Endcap ", 16, -0.5, 15.5);
1210 
1211  histname = "dlClosestHitToVtx";
1212  h_dlClosestHitToVtx_[0] = iBooker.book1D(histname + "All", "Pt Rec vs Pt sim: All ", 100, -10., 10.);
1213  h_dlClosestHitToVtx_[1] = iBooker.book1D(histname + "Barrel", "Pt Rec vs Pt sim: Barrel ", 100, -10., 10.);
1214  h_dlClosestHitToVtx_[2] = iBooker.book1D(histname + "Endcap", "Pt Rec vs Pt sim: Endcap ", 100, -10., 10.);
1215 
1216  histname = "dlClosestHitToVtxSig";
1217  h_dlClosestHitToVtxSig_[0] = iBooker.book1D(histname + "All", "Pt Rec vs Pt sim: All ", 100, -8., 8.);
1218  h_dlClosestHitToVtxSig_[1] = iBooker.book1D(histname + "Barrel", "Pt Rec vs Pt sim: Barrel ", 100, -8., 8.);
1219  h_dlClosestHitToVtxSig_[2] = iBooker.book1D(histname + "Endcap", "Pt Rec vs Pt sim: Endcap ", 100, -8., 8.);
1220 
1221  h_match_ = iBooker.book1D("h_match", " ", 3, -0.5, 2.5);
1222 
1223  } // if DQM
1224 }
1225 
1226 void TkConvValidator::dqmBeginRun(edm::Run const& r, edm::EventSetup const& theEventSetup) {
1227  //get magnetic field
1228  edm::LogInfo("ConvertedPhotonProducer") << " get magnetic field"
1229  << "\n";
1230  theEventSetup.get<IdealMagneticFieldRecord>().get(theMF_);
1231 
1232  thePhotonMCTruthFinder_ = new PhotonMCTruthFinder();
1233 }
1234 
1235 void TkConvValidator::dqmEndRun(edm::Run const& r, edm::EventSetup const& theEventSetup) {
1236  delete thePhotonMCTruthFinder_;
1237 }
1238 
1240  thePhotonMCTruthFinder_->clear();
1241  using namespace edm;
1242  // const float etaPhiDistance=0.01;
1243  // Fiducial region
1244  // const float TRK_BARL =0.9;
1245  const float BARL = 1.4442; // DAQ TDR p.290
1246  // const float END_LO = 1.566; // unused
1247  const float END_HI = 2.5;
1248  // Electron mass
1249  // const Float_t mElec= 0.000511; // unused
1250 
1252  e.getByToken(trackAssociator_Token_, theTrackAssociator);
1253 
1254  nEvt_++;
1255  LogInfo("TkConvValidator") << "TkConvValidator Analyzing event number: " << e.id() << " Global Counter " << nEvt_
1256  << "\n";
1257  // std::cout << "TkConvValidator Analyzing event number: " << e.id() << " Global Counter " << nEvt_ <<"\n";
1258 
1259  // get the geometry from the event setup:
1260  esup.get<CaloGeometryRecord>().get(theCaloGeom_);
1261 
1262  // Transform Track into TransientTrack (needed by the Vertex fitter)
1264  esup.get<TransientTrackRecord>().get("TransientTrackBuilder", theTTB);
1265 
1268  e.getByToken(conversionCollectionPr_Token_, convHandle);
1269  const reco::ConversionCollection convCollection = *(convHandle.product());
1270  if (!convHandle.isValid()) {
1271  edm::LogError("ConversionsProducer") << "Error! Can't get the collection " << std::endl;
1272  return;
1273  }
1274 
1276  Handle<reco::PhotonCollection> photonHandle;
1277  e.getByToken(photonCollectionPr_Token_, photonHandle);
1278  const reco::PhotonCollection photonCollection = *(photonHandle.product());
1279  if (!photonHandle.isValid()) {
1280  edm::LogError("PhotonProducer") << "Error! Can't get the Photon collection " << std::endl;
1281  return;
1282  }
1283 
1284  // offline Primary vertex
1287  e.getByToken(offline_pvToken_, vertexHandle);
1288  if (!vertexHandle.isValid()) {
1289  edm::LogError("TrackerOnlyConversionProducer") << "Error! Can't get the product primary Vertex Collection "
1290  << "\n";
1291  } else {
1292  vertexCollection = *(vertexHandle.product());
1293  }
1294  reco::Vertex the_pvtx;
1295  bool valid_pvtx = false;
1296  if (!vertexCollection.empty()) {
1297  the_pvtx = *(vertexCollection.begin());
1298  //asking for one good vertex
1299  if (the_pvtx.isValid() && fabs(the_pvtx.position().z()) <= 15 && the_pvtx.position().Rho() <= 2) {
1300  valid_pvtx = true;
1301  }
1302  }
1303 
1304  edm::Handle<reco::BeamSpot> bsHandle;
1305  e.getByToken(beamspotToken_, bsHandle);
1306  if (!bsHandle.isValid()) {
1307  edm::LogError("TrackerOnlyConversionProducer") << "Error! Can't get the product primary Vertex Collection "
1308  << "\n";
1309  return;
1310  }
1311  const reco::BeamSpot& thebs = *bsHandle.product();
1312 
1313  //get tracker geometry for hits positions
1316  const TrackerGeometry* trackerGeom = tracker.product();
1317 
1319  //get simtrack info
1320  //std::vector<SimTrack> theSimTracks;
1321  //std::vector<SimVertex> theSimVertices;
1322 
1325  e.getByToken(g4_simTk_Token_, SimTk);
1326  e.getByToken(g4_simVtx_Token_, SimVtx);
1327 
1328  bool useTP = parameters_.getParameter<bool>("useTP");
1331  edm::Handle<TrackingParticleRefVector> TPHandleForFakeRate;
1332  if (useTP) {
1333  e.getByToken(tpSelForEff_Token_, TPHandleForEff);
1334  e.getByToken(tpSelForFake_Token_, TPHandleForFakeRate);
1335  }
1336 
1337  const TrackingParticleRefVector& tpForEfficiency = useTP ? *(TPHandleForEff.product()) : dummy;
1338  const TrackingParticleRefVector& tpForFakeRate = useTP ? *(TPHandleForFakeRate.product()) : dummy;
1339 
1340  const std::vector<SimTrack>& theSimTracks = *SimTk;
1341  const std::vector<SimVertex>& theSimVertices = *SimVtx;
1342 
1343  //theSimTracks.insert(theSimTracks.end(),SimTk->begin(),SimTk->end());
1344  //theSimVertices.insert(theSimVertices.end(),SimVtx->begin(),SimVtx->end());
1345  std::vector<PhotonMCTruth> mcPhotons = thePhotonMCTruthFinder_->find(theSimTracks, theSimVertices);
1346 
1347  //edm::Handle<edm::HepMCProduct> hepMC;
1348  //e.getByToken(hepMC_Token_, hepMC);
1349  // const HepMC::GenEvent *myGenEvent = hepMC->GetEvent(); // unused
1350 
1351  // get generated jets
1352  //edm::Handle<reco::GenJetCollection> GenJetsHandle;
1353  //e.getByToken(genjets_Token_, GenJetsHandle);
1354  //const reco::GenJetCollection &genJetCollection = *(GenJetsHandle.product());
1355 
1356  // ################ SIM to RECO ######################### //
1357  std::map<const reco::Track*, TrackingParticleRef> myAss;
1358  std::map<const reco::Track*, TrackingParticleRef>::const_iterator itAss;
1359 
1360  for (std::vector<PhotonMCTruth>::const_iterator mcPho = mcPhotons.begin(); mcPho != mcPhotons.end(); mcPho++) {
1361  mcConvPt_ = (*mcPho).fourMomentum().et();
1362  float mcPhi = (*mcPho).fourMomentum().phi();
1363  mcPhi_ = phiNormalization(mcPhi);
1364  mcEta_ = (*mcPho).fourMomentum().pseudoRapidity();
1365  mcEta_ = etaTransformation(mcEta_, (*mcPho).primaryVertex().z());
1366  mcConvR_ = (*mcPho).vertex().perp();
1367  mcConvX_ = (*mcPho).vertex().x();
1368  mcConvY_ = (*mcPho).vertex().y();
1369  mcConvZ_ = (*mcPho).vertex().z();
1370  mcConvEta_ = (*mcPho).vertex().eta();
1371  mcConvPhi_ = (*mcPho).vertex().phi();
1372 
1373  if (fabs(mcEta_) > END_HI)
1374  continue;
1375 
1376  if (mcConvPt_ < minPhoPtForEffic)
1377  continue;
1378  if (fabs(mcEta_) > maxPhoEtaForEffic)
1379  continue;
1380  if (fabs(mcConvZ_) > maxPhoZForEffic)
1381  continue;
1382  if (mcConvR_ > maxPhoRForEffic)
1383  continue;
1385 
1386  bool goodSimConversion = false;
1387  bool visibleConversion = false;
1388  bool visibleConversionsWithTwoSimTracks = false;
1389  if ((*mcPho).isAConversion() == 1) {
1390  nSimConv_[0]++;
1391  h_AllSimConv_[0]->Fill(mcEta_);
1392  h_AllSimConv_[1]->Fill(mcPhi_);
1393  h_AllSimConv_[2]->Fill(mcConvR_);
1394  h_AllSimConv_[3]->Fill(mcConvZ_);
1395  h_AllSimConv_[4]->Fill((*mcPho).fourMomentum().et());
1396 
1397  if (mcConvR_ < 15)
1398  h_SimConvEtaPix_[0]->Fill(mcEta_);
1399 
1400  if ((fabs(mcEta_) <= BARL && mcConvR_ < 85) ||
1401  (fabs(mcEta_) > BARL && fabs(mcEta_) <= END_HI && fabs((*mcPho).vertex().z()) < 210))
1402  visibleConversion = true;
1403 
1404  theConvTP_.clear();
1405  // std::cout << " TkConvValidator TrackingParticles TrackingParticleCollection size "<< trackingParticles.size() << "\n";
1406  //duplicated TP collections for two associations
1407  for (const TrackingParticleRef& tp : tpForEfficiency) {
1408  if (fabs(tp->vx() - (*mcPho).vertex().x()) < 0.0001 && fabs(tp->vy() - (*mcPho).vertex().y()) < 0.0001 &&
1409  fabs(tp->vz() - (*mcPho).vertex().z()) < 0.0001) {
1410  theConvTP_.push_back(tp);
1411  }
1412  }
1413  //std::cout << " TkConvValidator theConvTP_ size " << theConvTP_.size() << std::endl;
1414 
1415  if (theConvTP_.size() == 2)
1416  visibleConversionsWithTwoSimTracks = true;
1417  goodSimConversion = false;
1418 
1419  if (visibleConversion && visibleConversionsWithTwoSimTracks)
1420  goodSimConversion = true;
1421  if (goodSimConversion) {
1422  nSimConv_[1]++;
1423  h_VisSimConv_[0]->Fill(mcEta_);
1424  h_VisSimConv_[1]->Fill(mcPhi_);
1425  h_VisSimConv_[2]->Fill(mcConvR_);
1426  h_VisSimConv_[3]->Fill(mcConvZ_);
1427  h_VisSimConv_[4]->Fill((*mcPho).fourMomentum().et());
1428  }
1429 
1430  for (edm::RefVector<TrackingParticleCollection>::iterator iTrk = theConvTP_.begin(); iTrk != theConvTP_.end();
1431  ++iTrk) {
1432  h_simTkPt_->Fill((*iTrk)->pt());
1433  h_simTkEta_->Fill((*iTrk)->eta());
1434  }
1435 
1436  }
1437 
1438  if (!(visibleConversion && visibleConversionsWithTwoSimTracks))
1439  continue;
1440 
1441  h_simConvVtxRvsZ_[0]->Fill(fabs(mcConvZ_), mcConvR_);
1442  if (fabs(mcEta_) <= 1.) {
1443  h_simConvVtxRvsZ_[1]->Fill(fabs(mcConvZ_), mcConvR_);
1444  h_simConvVtxYvsX_->Fill(mcConvX_, mcConvY_);
1445  } else
1446  h_simConvVtxRvsZ_[2]->Fill(fabs(mcConvZ_), mcConvR_);
1447 
1448  //std::cout << " TkConvValidator theConvTP_ size " << theConvTP_.size() << std::endl;
1449  for (edm::RefVector<TrackingParticleCollection>::iterator iTP = theConvTP_.begin(); iTP != theConvTP_.end();
1450  iTP++) {
1451  // std::cout << " SIM to RECO TP vertex " << (*iTP)->vx() << " " << (*iTP)->vy() << " " << (*iTP)->vz() << " pt " << (*iTP)->pt() << std::endl;
1452  }
1453 
1454  bool recomatch = false;
1455  float chi2Prob = 0.;
1457  // cout << " size of conversions " << convHandle->size() << endl;
1458  for (reco::ConversionCollection::const_iterator conv = convHandle->begin(); conv != convHandle->end(); ++conv) {
1459  const reco::Conversion aConv = (*conv);
1460  if (arbitratedMerged_ && !aConv.quality(reco::Conversion::arbitratedMerged))
1461  continue;
1462  if (generalTracksOnly_ && !aConv.quality(reco::Conversion::generalTracksOnly))
1463  continue;
1464  if (arbitratedEcalSeeded_ && !aConv.quality(reco::Conversion::arbitratedEcalSeeded))
1465  continue;
1466 
1467  if (highPurity_ && !aConv.quality(reco::Conversion::highPurity))
1468  continue;
1469 
1470  //problematic?
1471  const std::vector<edm::RefToBase<reco::Track> >& tracks = aConv.tracks();
1472 
1473  const reco::Vertex& vtx = aConv.conversionVertex();
1474  //requires two tracks and a valid vertex
1475  if (tracks.size() != 2 || !(vtx.isValid()))
1476  continue;
1477 
1478  if (ChiSquaredProbability(aConv.conversionVertex().chi2(), aConv.conversionVertex().ndof()) <= minProb_)
1479  continue;
1480  if (aConv.nHitsBeforeVtx().size() > 1 &&
1481  max(aConv.nHitsBeforeVtx().at(0), aConv.nHitsBeforeVtx().at(1)) > maxHitsBeforeVtx_)
1482  continue;
1483 
1484  //compute transverse decay length with respect to beamspot
1485  math::XYZVectorF themom = aConv.refittedPairMomentum();
1486  double dbsx = aConv.conversionVertex().x() - thebs.x0();
1487  double dbsy = aConv.conversionVertex().y() - thebs.y0();
1488  double lxy = (themom.x() * dbsx + themom.y() * dbsy) / themom.rho();
1489 
1490  if (lxy < minLxy_)
1491  continue;
1492 
1493  // bool phoIsInBarrel=false; // unused
1494  // bool phoIsInEndcap=false; // unused
1495  RefToBase<reco::Track> tfrb1 = aConv.tracks().front();
1496  RefToBase<reco::Track> tfrb2 = aConv.tracks().back();
1497 
1498  if (ecalalgotracks_ && (!(tfrb1->algo() == reco::TrackBase::outInEcalSeededConv ||
1502  continue;
1503 
1504  //reco::TrackRef tk1 = aConv.tracks().front();
1505  //reco::TrackRef tk2 = aConv.tracks().back();
1506  //std::cout << "SIM to RECO conversion track pt " << tk1->pt() << " " << tk2->pt() << endl;
1507  //
1508  //Use two RefToBaseVector and do two association actions to avoid that if two tracks from different collection
1510  tc1.push_back(tfrb1);
1511  tc2.push_back(tfrb2);
1512  bool isAssociated = false;
1513  reco::SimToRecoCollection q1 = theTrackAssociator->associateSimToReco(tc1, theConvTP_);
1514  reco::SimToRecoCollection q2 = theTrackAssociator->associateSimToReco(tc2, theConvTP_);
1515  //try {
1516  std::vector<std::pair<RefToBase<reco::Track>, double> > trackV1, trackV2;
1517 
1518  int tp_1 = 0, tp_2 = 1; //the index of associated tp in theConvTP_ for two tracks
1519  if (q1.find(theConvTP_[0]) != q1.end()) {
1520  trackV1 = (std::vector<std::pair<RefToBase<reco::Track>, double> >)q1[theConvTP_[0]];
1521  } else if (q1.find(theConvTP_[1]) != q1.end()) {
1522  trackV1 = (std::vector<std::pair<RefToBase<reco::Track>, double> >)q1[theConvTP_[1]];
1523  tp_1 = 1;
1524  }
1525  if (q2.find(theConvTP_[1]) != q2.end()) {
1526  trackV2 = (std::vector<std::pair<RefToBase<reco::Track>, double> >)q2[theConvTP_[1]];
1527  } else if (q2.find(theConvTP_[0]) != q2.end()) {
1528  trackV2 = (std::vector<std::pair<RefToBase<reco::Track>, double> >)q2[theConvTP_[0]];
1529  tp_2 = 0;
1530  }
1531  if (!(!trackV1.empty() && !trackV2.empty()))
1532  continue;
1533  if (tp_1 == tp_2)
1534  continue;
1535 
1536  edm::RefToBase<reco::Track> tr1 = trackV1.front().first;
1537  edm::RefToBase<reco::Track> tr2 = trackV2.front().first;
1538  //std::cout << "associated tp1 " <<theConvTP_[0]->pt() << " to track with pT=" << tr1->pt() << " " << (tr1.get())->pt() << endl;
1539  //std::cout << "associated tp2 " <<theConvTP_[1]->pt() << " to track with pT=" << tr2->pt() << " " << (tr2.get())->pt() << endl;
1540  myAss.insert(std::make_pair(tr1.get(), theConvTP_[tp_1]));
1541  myAss.insert(std::make_pair(tr2.get(), theConvTP_[tp_2]));
1542 
1543  //} catch (Exception const& event) {
1544  //cout << "continue: " << event.what() << endl;
1545  // continue;
1546  //}
1547 
1548  isAssociated = true;
1549  recomatch = true;
1550  chi2Prob = ChiSquaredProbability(aConv.conversionVertex().chi2(), aConv.conversionVertex().ndof());
1551 
1552  if (isAssociated) {
1553  h_SimRecConvTwoMTracks_[0]->Fill(mcEta_);
1554  h_SimRecConvTwoMTracks_[1]->Fill(mcPhi_);
1555  h_SimRecConvTwoMTracks_[2]->Fill(mcConvR_);
1556  h_SimRecConvTwoMTracks_[3]->Fill(mcConvZ_);
1557  h_SimRecConvTwoMTracks_[4]->Fill((*mcPho).fourMomentum().et());
1558  }
1559 
1560  // break;
1561  } // loop over reco conversions
1562  if (recomatch) {
1564  h_SimConvTwoMTracks_[0]->Fill(mcEta_);
1565  h_SimConvTwoMTracks_[1]->Fill(mcPhi_);
1566  h_SimConvTwoMTracks_[2]->Fill(mcConvR_);
1567  h_SimConvTwoMTracks_[3]->Fill(mcConvZ_);
1568  h_SimConvTwoMTracks_[4]->Fill((*mcPho).fourMomentum().et());
1569 
1570  if (chi2Prob > 0) {
1571  h_SimConvTwoMTracksAndVtxPGT0_[0]->Fill(mcEta_);
1572  h_SimConvTwoMTracksAndVtxPGT0_[1]->Fill(mcPhi_);
1573  h_SimConvTwoMTracksAndVtxPGT0_[2]->Fill(mcConvR_);
1574  h_SimConvTwoMTracksAndVtxPGT0_[3]->Fill(mcConvZ_);
1575  h_SimConvTwoMTracksAndVtxPGT0_[4]->Fill((*mcPho).fourMomentum().et());
1576  }
1577  if (chi2Prob > 0.0005) {
1578  h_SimConvTwoMTracksAndVtxPGT0005_[0]->Fill(mcEta_);
1579  h_SimConvTwoMTracksAndVtxPGT0005_[1]->Fill(mcPhi_);
1580  h_SimConvTwoMTracksAndVtxPGT0005_[2]->Fill(mcConvR_);
1581  h_SimConvTwoMTracksAndVtxPGT0005_[3]->Fill(mcConvZ_);
1582  h_SimConvTwoMTracksAndVtxPGT0005_[4]->Fill((*mcPho).fourMomentum().et());
1583  }
1584  }
1585 
1586  } //End loop over simulated conversions
1587 
1588  // ########################### RECO to SIM ############################## //
1589 
1590  for (reco::ConversionCollection::const_iterator conv = convHandle->begin(); conv != convHandle->end(); ++conv) {
1591  const reco::Conversion aConv = (*conv);
1592  if (arbitratedMerged_ && !aConv.quality(reco::Conversion::arbitratedMerged))
1593  continue;
1594  if (generalTracksOnly_ && !aConv.quality(reco::Conversion::generalTracksOnly))
1595  continue;
1596  if (arbitratedEcalSeeded_ && !aConv.quality(reco::Conversion::arbitratedEcalSeeded))
1597  continue;
1598 
1599  if (highPurity_ && !aConv.quality(reco::Conversion::highPurity))
1600  continue;
1601 
1602  //problematic?
1603  std::vector<edm::RefToBase<reco::Track> > tracks = aConv.tracks();
1604 
1605  const reco::Vertex& vtx = aConv.conversionVertex();
1606  //requires two tracks and a valid vertex
1607  if (tracks.size() != 2 || !(vtx.isValid()))
1608  continue;
1609  //if (tracks.size() !=2) continue;
1610 
1611  if (ChiSquaredProbability(aConv.conversionVertex().chi2(), aConv.conversionVertex().ndof()) <= minProb_)
1612  continue;
1613  if (aConv.nHitsBeforeVtx().size() > 1 &&
1614  max(aConv.nHitsBeforeVtx().at(0), aConv.nHitsBeforeVtx().at(1)) > maxHitsBeforeVtx_)
1615  continue;
1616 
1617  //compute transverse decay length with respect to beamspot
1618  math::XYZVectorF themom = aConv.refittedPairMomentum();
1619  double dbsx = aConv.conversionVertex().x() - thebs.x0();
1620  double dbsy = aConv.conversionVertex().y() - thebs.y0();
1621  double lxy = (themom.x() * dbsx + themom.y() * dbsy) / themom.rho();
1622 
1623  if (lxy < minLxy_)
1624  continue;
1625 
1626  bool phoIsInBarrel = false;
1627  bool phoIsInEndcap = false;
1628  RefToBase<reco::Track> tk1 = aConv.tracks().front();
1629  RefToBase<reco::Track> tk2 = aConv.tracks().back();
1631  tc1.push_back(tk1);
1632  tc2.push_back(tk2);
1633 
1634  if (ecalalgotracks_ &&
1638  continue;
1639 
1640  //std::cout << " RECO to SIM conversion track pt " << tk1->pt() << " " << tk2->pt() << endl;
1641  const reco::Track refTk1 = aConv.conversionVertex().refittedTracks().front();
1642  const reco::Track refTk2 = aConv.conversionVertex().refittedTracks().back();
1643 
1644  float dPhiTracksAtVtx;
1645  // override with the phi calculated at the vertex
1646  math::XYZVector p1AtVtx = recalculateMomentumAtFittedVertex((*theMF_), *trackerGeom, tk1, aConv.conversionVertex());
1647  math::XYZVector p2AtVtx = recalculateMomentumAtFittedVertex((*theMF_), *trackerGeom, tk2, aConv.conversionVertex());
1648  if (p1AtVtx.perp2() > p2AtVtx.perp2())
1649  dPhiTracksAtVtx = p1AtVtx.phi() - p2AtVtx.phi();
1650  else
1651  dPhiTracksAtVtx = p2AtVtx.phi() - p1AtVtx.phi();
1652 
1653  math::XYZVectorF refittedMom = aConv.refittedPairMomentum();
1654 
1655  if (fabs(refittedMom.eta()) < 1.479) {
1656  phoIsInBarrel = true;
1657  } else {
1658  phoIsInEndcap = true;
1659  }
1660 
1661  nRecConv_++;
1662 
1663  // check matching with reco photon
1664  double Mindeltaeta = 999999;
1665  double Mindeltaphi = 999999;
1666  bool matchConvSC = false;
1667  reco::PhotonCollection::const_iterator iMatchingSC;
1668  for (reco::PhotonCollection::const_iterator iPho = photonCollection.begin(); iPho != photonCollection.end();
1669  iPho++) {
1670  reco::Photon aPho = reco::Photon(*iPho);
1671  const double deltaphi = reco::deltaPhi(aConv.refittedPairMomentum().phi(), aPho.superCluster()->position().phi());
1672  double ConvEta = etaTransformation(aConv.refittedPairMomentum().eta(), aConv.zOfPrimaryVertexFromTracks());
1673  double deltaeta = abs(aPho.superCluster()->position().eta() - ConvEta);
1674  if (abs(deltaeta) < abs(Mindeltaeta) && abs(deltaphi) < abs(Mindeltaphi)) {
1675  Mindeltaphi = abs(deltaphi);
1676  Mindeltaeta = abs(deltaeta);
1677  iMatchingSC = iPho;
1678  }
1679  }
1680  if (abs(Mindeltaeta) < 0.1 && abs(Mindeltaphi) < 0.1) {
1681  matchConvSC = true;
1682  }
1683 
1685  int match = 0;
1686  float invM = aConv.pairInvariantMass();
1687  float chi2Prob = ChiSquaredProbability(aConv.conversionVertex().chi2(), aConv.conversionVertex().ndof());
1688  uint maxNHitsBeforeVtx =
1689  aConv.nHitsBeforeVtx().size() > 1 ? max(aConv.nHitsBeforeVtx().at(0), aConv.nHitsBeforeVtx().at(1)) : 0;
1690  uint sumNHitsBeforeVtx =
1691  aConv.nHitsBeforeVtx().size() > 1 ? aConv.nHitsBeforeVtx().at(0) + aConv.nHitsBeforeVtx().at(1) : 0;
1692  float maxDlClosestHitToVtx = aConv.dlClosestHitToVtx().size() > 1 ? max(aConv.dlClosestHitToVtx().at(0).value(),
1693  aConv.dlClosestHitToVtx().at(1).value())
1694  : 0;
1695  float maxDlClosestHitToVtxSig =
1696  aConv.dlClosestHitToVtx().size() > 1
1697  ? max(aConv.dlClosestHitToVtx().at(0).value() / aConv.dlClosestHitToVtx().at(0).error(),
1698  aConv.dlClosestHitToVtx().at(1).value() / aConv.dlClosestHitToVtx().at(1).error())
1699  : 0;
1700 
1701  int ilead = 0, itrail = 1;
1702  if (tk2->pt() > tk1->pt()) {
1703  ilead = 1;
1704  itrail = 0;
1705  }
1706  RefToBase<reco::Track> tklead = aConv.tracks().at(ilead);
1707  RefToBase<reco::Track> tktrail = aConv.tracks().at(itrail);
1708 
1709  int deltaExpectedHitsInner = tklead->hitPattern().numberOfLostHits(reco::HitPattern::MISSING_INNER_HITS) -
1711  int leadExpectedHitsInner = tklead->hitPattern().numberOfLostHits(reco::HitPattern::MISSING_INNER_HITS);
1712  uint leadNHitsBeforeVtx = aConv.nHitsBeforeVtx().size() > 1 ? aConv.nHitsBeforeVtx().at(ilead) : 0;
1713  uint trailNHitsBeforeVtx = aConv.nHitsBeforeVtx().size() > 1 ? aConv.nHitsBeforeVtx().at(itrail) : 0;
1714 
1715  h_convEta_[match][0]->Fill(refittedMom.eta());
1716  h_convEta2_[match][0]->Fill(refittedMom.eta());
1717 
1718  h_convPhi_[match][0]->Fill(refittedMom.phi());
1719  h_convR_[match][0]->Fill(sqrt(aConv.conversionVertex().position().perp2()));
1720  h_convRplot_->Fill(sqrt(aConv.conversionVertex().position().perp2()));
1721  h_convZ_[match][0]->Fill(aConv.conversionVertex().position().z());
1722  h_convZplot_->Fill(aConv.conversionVertex().position().z());
1723  h_convPt_[match][0]->Fill(sqrt(refittedMom.perp2()));
1724  h_invMass_[match][0]->Fill(invM);
1725  h_vtxChi2Prob_[match][0]->Fill(chi2Prob);
1726  h_lxybs_[match][0]->Fill(lxy);
1727  h_maxNHitsBeforeVtx_[match][0]->Fill(maxNHitsBeforeVtx);
1728  h_leadNHitsBeforeVtx_[match][0]->Fill(leadNHitsBeforeVtx);
1729  h_trailNHitsBeforeVtx_[match][0]->Fill(trailNHitsBeforeVtx);
1730  h_sumNHitsBeforeVtx_[match][0]->Fill(sumNHitsBeforeVtx);
1731  h_deltaExpectedHitsInner_[match][0]->Fill(deltaExpectedHitsInner);
1732  h_leadExpectedHitsInner_[match][0]->Fill(leadExpectedHitsInner);
1733  h_maxDlClosestHitToVtx_[match][0]->Fill(maxDlClosestHitToVtx);
1734  h_maxDlClosestHitToVtxSig_[match][0]->Fill(maxDlClosestHitToVtxSig);
1735  h_nSharedHits_[match][0]->Fill(aConv.nSharedHits());
1736 
1737  if (matchConvSC) {
1738  h_convEtaMatchSC_[match][0]->Fill(refittedMom.eta());
1739  h_EoverPTracks_[match][0]->Fill(iMatchingSC->superCluster()->energy() / sqrt(refittedMom.mag2()));
1740  h_convSCdPhi_[match][0]->Fill(iMatchingSC->superCluster()->position().phi() - refittedMom.phi());
1741  double ConvEta = etaTransformation(aConv.refittedPairMomentum().eta(), aConv.zOfPrimaryVertexFromTracks());
1742  h_convSCdEta_[match][0]->Fill(iMatchingSC->superCluster()->position().eta() - ConvEta);
1743  }
1744 
1745  h_distMinAppTracks_[match][0]->Fill(aConv.distOfMinimumApproach());
1746  h_DPhiTracksAtVtx_[match][0]->Fill(dPhiTracksAtVtx);
1747  h2_DPhiTracksAtVtxVsEta_->Fill(mcEta_, dPhiTracksAtVtx);
1748  h2_DPhiTracksAtVtxVsR_->Fill(mcConvR_, dPhiTracksAtVtx);
1749  p_DPhiTracksAtVtxVsEta_->Fill(mcEta_, dPhiTracksAtVtx);
1750  p_DPhiTracksAtVtxVsR_->Fill(mcConvR_, dPhiTracksAtVtx);
1751 
1752  h_DCotTracks_[match][0]->Fill(aConv.pairCotThetaSeparation());
1753  h2_DCotTracksVsEta_->Fill(mcEta_, aConv.pairCotThetaSeparation());
1754  h2_DCotTracksVsR_->Fill(mcConvR_, aConv.pairCotThetaSeparation());
1755  p_DCotTracksVsEta_->Fill(mcEta_, aConv.pairCotThetaSeparation());
1756  p_DCotTracksVsR_->Fill(mcConvR_, aConv.pairCotThetaSeparation());
1757 
1758  if (phoIsInBarrel) {
1759  h_invMass_[match][1]->Fill(invM);
1760  h_vtxChi2Prob_[match][1]->Fill(chi2Prob);
1761  h_distMinAppTracks_[match][1]->Fill(aConv.distOfMinimumApproach());
1762  h_DPhiTracksAtVtx_[match][1]->Fill(dPhiTracksAtVtx);
1763  h_DCotTracks_[match][1]->Fill(aConv.pairCotThetaSeparation());
1764  h_lxybs_[match][1]->Fill(lxy);
1765  h_maxNHitsBeforeVtx_[match][1]->Fill(maxNHitsBeforeVtx);
1766  h_leadNHitsBeforeVtx_[match][1]->Fill(leadNHitsBeforeVtx);
1767  h_trailNHitsBeforeVtx_[match][1]->Fill(trailNHitsBeforeVtx);
1768  h_sumNHitsBeforeVtx_[match][1]->Fill(sumNHitsBeforeVtx);
1769  h_deltaExpectedHitsInner_[match][1]->Fill(deltaExpectedHitsInner);
1770  h_leadExpectedHitsInner_[match][1]->Fill(leadExpectedHitsInner);
1771  h_maxDlClosestHitToVtx_[match][1]->Fill(maxDlClosestHitToVtx);
1772  h_maxDlClosestHitToVtxSig_[match][1]->Fill(maxDlClosestHitToVtxSig);
1773  h_nSharedHits_[match][1]->Fill(aConv.nSharedHits());
1774 
1775  /*
1776  if ( aConv.caloCluster().size() ) {
1777  h_convSCdPhi_[match][1]->Fill( aConv.caloCluster()[0]->phi() - refittedMom.phi() );
1778  double ConvEta = etaTransformation(aConv.refittedPairMomentum().eta(),aConv.zOfPrimaryVertexFromTracks());
1779  h_convSCdEta_[match][1]->Fill( aConv.caloCluster()[0]->eta() - ConvEta );
1780  }
1781  */
1782 
1783  if (matchConvSC) {
1784  h_EoverPTracks_[match][1]->Fill(iMatchingSC->superCluster()->energy() / sqrt(refittedMom.mag2()));
1785  h_convSCdPhi_[match][1]->Fill(iMatchingSC->superCluster()->position().phi() - refittedMom.phi());
1786  double ConvEta = etaTransformation(aConv.refittedPairMomentum().eta(), aConv.zOfPrimaryVertexFromTracks());
1787  h_convSCdEta_[match][1]->Fill(iMatchingSC->superCluster()->position().eta() - ConvEta);
1788  }
1789  }
1790 
1791  if (phoIsInEndcap) {
1792  h_invMass_[match][2]->Fill(invM);
1793  h_vtxChi2Prob_[match][2]->Fill(chi2Prob);
1794  h_distMinAppTracks_[match][2]->Fill(aConv.distOfMinimumApproach());
1795  h_DPhiTracksAtVtx_[match][2]->Fill(dPhiTracksAtVtx);
1796  h_DCotTracks_[match][2]->Fill(aConv.pairCotThetaSeparation());
1797  h_lxybs_[match][2]->Fill(lxy);
1798  h_maxNHitsBeforeVtx_[match][2]->Fill(maxNHitsBeforeVtx);
1799  h_leadNHitsBeforeVtx_[match][2]->Fill(leadNHitsBeforeVtx);
1800  h_trailNHitsBeforeVtx_[match][2]->Fill(trailNHitsBeforeVtx);
1801  h_sumNHitsBeforeVtx_[match][2]->Fill(sumNHitsBeforeVtx);
1802  h_deltaExpectedHitsInner_[match][2]->Fill(deltaExpectedHitsInner);
1803  h_leadExpectedHitsInner_[match][2]->Fill(leadExpectedHitsInner);
1804  h_maxDlClosestHitToVtx_[match][2]->Fill(maxDlClosestHitToVtx);
1805  h_maxDlClosestHitToVtxSig_[match][2]->Fill(maxDlClosestHitToVtxSig);
1806  h_nSharedHits_[match][2]->Fill(aConv.nSharedHits());
1807  if (matchConvSC) {
1808  h_EoverPTracks_[match][2]->Fill(iMatchingSC->superCluster()->energy() / sqrt(refittedMom.mag2()));
1809  h_convSCdPhi_[match][2]->Fill(iMatchingSC->superCluster()->position().phi() - refittedMom.phi());
1810  double ConvEta = etaTransformation(aConv.refittedPairMomentum().eta(), aConv.zOfPrimaryVertexFromTracks());
1811  h_convSCdEta_[match][2]->Fill(iMatchingSC->superCluster()->position().eta() - ConvEta);
1812  }
1813  }
1814 
1815  h_convVtxRvsZ_[0]->Fill(fabs(aConv.conversionVertex().position().z()),
1816  sqrt(aConv.conversionVertex().position().perp2()));
1817  h_convVtxYvsX_->Fill(aConv.conversionVertex().position().x(), aConv.conversionVertex().position().y());
1818  h_convVtxYvsX_zoom_[0]->Fill(aConv.conversionVertex().position().x(), aConv.conversionVertex().position().y());
1819  h_convVtxYvsX_zoom_[1]->Fill(aConv.conversionVertex().position().x(), aConv.conversionVertex().position().y());
1820 
1821  // quantities per track: all conversions
1822  for (unsigned int i = 0; i < tracks.size(); i++) {
1823  double d0;
1824  if (valid_pvtx) {
1825  d0 = -tracks[i]->dxy(the_pvtx.position());
1826  } else {
1827  d0 = tracks[i]->d0();
1828  }
1829  h_TkD0_[match]->Fill(d0 * tracks[i]->charge());
1830  h_nHitsBeforeVtx_[match]->Fill(aConv.nHitsBeforeVtx().size() > 1 ? aConv.nHitsBeforeVtx().at(i) : 0);
1831  h_dlClosestHitToVtx_[match]->Fill(aConv.dlClosestHitToVtx().size() > 1 ? aConv.dlClosestHitToVtx().at(i).value()
1832  : 0);
1833  h_dlClosestHitToVtxSig_[match]->Fill(aConv.dlClosestHitToVtx().size() > 1
1834  ? aConv.dlClosestHitToVtx().at(i).value() /
1835  aConv.dlClosestHitToVtx().at(i).error()
1836  : 0);
1837 
1838  nHitsVsEta_[match]->Fill(mcEta_, float(tracks[i]->numberOfValidHits()));
1839  nHitsVsR_[match]->Fill(mcConvR_, float(tracks[i]->numberOfValidHits()));
1840  p_nHitsVsEta_[match]->Fill(mcEta_, float(tracks[i]->numberOfValidHits()) - 0.0001);
1841  p_nHitsVsR_[match]->Fill(mcConvR_, float(tracks[i]->numberOfValidHits()) - 0.0001);
1842  h_tkChi2_[match]->Fill(tracks[i]->normalizedChi2());
1843  h_tkChi2Large_[match]->Fill(tracks[i]->normalizedChi2());
1844  h2_Chi2VsEta_[match]->Fill(mcEta_, tracks[i]->normalizedChi2());
1845  h2_Chi2VsR_[match]->Fill(mcConvR_, tracks[i]->normalizedChi2());
1846  p_Chi2VsEta_[match]->Fill(mcEta_, tracks[i]->normalizedChi2());
1847  p_Chi2VsR_[match]->Fill(mcConvR_, tracks[i]->normalizedChi2());
1848  }
1849 
1850  bool associated = false;
1851  float mcConvPt_ = -99999999.0;
1852  // float mcPhi= 0; // unused
1853  float simPV_Z = 0;
1854  for (std::vector<PhotonMCTruth>::const_iterator mcPho = mcPhotons.begin(); mcPho != mcPhotons.end(); mcPho++) {
1855  mcConvPt_ = (*mcPho).fourMomentum().et();
1856  float mcPhi = (*mcPho).fourMomentum().phi();
1857  simPV_Z = (*mcPho).primaryVertex().z();
1858  mcPhi_ = phiNormalization(mcPhi);
1859  mcEta_ = (*mcPho).fourMomentum().pseudoRapidity();
1860  mcEta_ = etaTransformation(mcEta_, (*mcPho).primaryVertex().z());
1861  mcConvR_ = (*mcPho).vertex().perp();
1862  mcConvX_ = (*mcPho).vertex().x();
1863  mcConvY_ = (*mcPho).vertex().y();
1864  mcConvZ_ = (*mcPho).vertex().z();
1865  mcConvEta_ = (*mcPho).vertex().eta();
1866  mcConvPhi_ = (*mcPho).vertex().phi();
1867  if (fabs(mcEta_) > END_HI)
1868  continue;
1869  if (mcConvPt_ < minPhoPtForPurity)
1870  continue;
1871  if (fabs(mcEta_) > maxPhoEtaForPurity)
1872  continue;
1873  if (fabs(mcConvZ_) > maxPhoZForPurity)
1874  continue;
1875  if (mcConvR_ > maxPhoRForEffic)
1876  continue;
1877 
1878  if ((*mcPho).isAConversion() != 1)
1879  continue;
1880  if (!((fabs(mcEta_) <= BARL && mcConvR_ < 85) ||
1881  (fabs(mcEta_) > BARL && fabs(mcEta_) <= END_HI && fabs((*mcPho).vertex().z()) < 210)))
1882  continue;
1883 
1884  theConvTP_.clear();
1885  for (const TrackingParticleRef& tp : tpForFakeRate) {
1886  if (fabs(tp->vx() - (*mcPho).vertex().x()) < 0.0001 && fabs(tp->vy() - (*mcPho).vertex().y()) < 0.0001 &&
1887  fabs(tp->vz() - (*mcPho).vertex().z()) < 0.0001) {
1888  theConvTP_.push_back(tp);
1889  }
1890  }
1891 
1892  if (theConvTP_.size() < 2)
1893  continue;
1894 
1895  //associated = false;
1896  reco::RecoToSimCollection const& p1 = theTrackAssociator->associateRecoToSim(tc1, theConvTP_);
1897  reco::RecoToSimCollection const& p2 = theTrackAssociator->associateRecoToSim(tc2, theConvTP_);
1898 
1899  auto itP1 = p1.find(tk1);
1900  auto itP2 = p2.find(tk2);
1901  bool good = (itP1 != p1.end()) and (not itP1->val.empty()) and (itP2 != p2.end()) and (not itP2->val.empty());
1902  if (not good) {
1903  itP1 = p1.find(tk2);
1904  itP2 = p2.find(tk1);
1905  good = (itP1 != p1.end()) and (not itP1->val.empty()) and (itP2 != p2.end()) and (not itP2->val.empty());
1906  }
1907 
1908  if (good) {
1909  std::vector<std::pair<TrackingParticleRef, double> > const& tp1 = itP1->val;
1910  std::vector<std::pair<TrackingParticleRef, double> > const& tp2 = itP2->val;
1911  TrackingParticleRef tpr1 = tp1.front().first;
1912  TrackingParticleRef tpr2 = tp2.front().first;
1913  if (abs(tpr1->pdgId()) == 11 && abs(tpr2->pdgId()) == 11 && tpr1->pdgId() * tpr2->pdgId() < 0) {
1914  if ((tpr1->parentVertex()->sourceTracks_end() - tpr1->parentVertex()->sourceTracks_begin() == 1) &&
1915  (tpr2->parentVertex()->sourceTracks_end() - tpr2->parentVertex()->sourceTracks_begin() == 1)) {
1916  if (tpr1->parentVertex().key() == tpr2->parentVertex().key() &&
1917  ((*tpr1->parentVertex()->sourceTracks_begin())->pdgId() == 22)) {
1918  mcConvR_ = sqrt(tpr1->parentVertex()->position().Perp2());
1919  mcConvZ_ = tpr1->parentVertex()->position().z();
1920  mcConvX_ = tpr1->parentVertex()->position().x();
1921  mcConvY_ = tpr1->parentVertex()->position().y();
1922  mcConvEta_ = tpr1->parentVertex()->position().eta();
1923  mcConvPhi_ = tpr1->parentVertex()->position().phi();
1924  mcConvPt_ = sqrt((*tpr1->parentVertex()->sourceTracks_begin())->momentum().Perp2());
1925  //std::cout << " Reco to Sim mcconvpt " << mcConvPt_ << std::endl;
1926  //cout << "associated track1 to " << tpr1->pdgId() << " with p=" << tpr1->p4() << " with pT=" << tpr1->pt() << endl;
1927  //cout << "associated track2 to " << tpr2->pdgId() << " with p=" << tpr2->p4() << " with pT=" << tpr2->pt() << endl;
1928  associated = true;
1929  break;
1930  }
1931  }
1932  }
1933  }
1934 
1935  } // end loop on sim photons
1936 
1937  if (false) {
1938  theConvTP_.clear();
1939  theConvTP_ = tpForFakeRate;
1940  reco::RecoToSimCollection p1incl = theTrackAssociator->associateRecoToSim(tc1, theConvTP_);
1941  reco::RecoToSimCollection p2incl = theTrackAssociator->associateRecoToSim(tc2, theConvTP_);
1942 
1943  for (std::vector<PhotonMCTruth>::const_iterator mcPho = mcPhotons.begin(); mcPho != mcPhotons.end(); mcPho++) {
1944  mcConvPt_ = (*mcPho).fourMomentum().et();
1945  float mcPhi = (*mcPho).fourMomentum().phi();
1946  simPV_Z = (*mcPho).primaryVertex().z();
1947  mcPhi_ = phiNormalization(mcPhi);
1948  mcEta_ = (*mcPho).fourMomentum().pseudoRapidity();
1949  mcEta_ = etaTransformation(mcEta_, (*mcPho).primaryVertex().z());
1950  mcConvR_ = (*mcPho).vertex().perp();
1951  mcConvX_ = (*mcPho).vertex().x();
1952  mcConvY_ = (*mcPho).vertex().y();
1953  mcConvZ_ = (*mcPho).vertex().z();
1954  mcConvEta_ = (*mcPho).vertex().eta();
1955  mcConvPhi_ = (*mcPho).vertex().phi();
1956  if (fabs(mcEta_) > END_HI)
1957  continue;
1958  if (mcConvPt_ < minPhoPtForPurity)
1959  continue;
1960  if (fabs(mcEta_) > maxPhoEtaForPurity)
1961  continue;
1962  if (fabs(mcConvZ_) > maxPhoZForPurity)
1963  continue;
1964  if (mcConvR_ > maxPhoRForEffic)
1965  continue;
1966 
1967  if ((*mcPho).isAConversion() != 1)
1968  continue;
1969  if (!((fabs(mcEta_) <= BARL && mcConvR_ < 85) ||
1970  (fabs(mcEta_) > BARL && fabs(mcEta_) <= END_HI && fabs((*mcPho).vertex().z()) < 210)))
1971  continue;
1972 
1973  theConvTP_.clear();
1974  for (const TrackingParticleRef& tp : tpForFakeRate) {
1975  if (fabs(tp->vx() - (*mcPho).vertex().x()) < 0.0001 && fabs(tp->vy() - (*mcPho).vertex().y()) < 0.0001 &&
1976  fabs(tp->vz() - (*mcPho).vertex().z()) < 0.0001) {
1977  theConvTP_.push_back(tp);
1978  }
1979  }
1980 
1981  if (theConvTP_.size() < 2)
1982  continue;
1983 
1984  //associated = false;
1985  reco::RecoToSimCollection p1 = theTrackAssociator->associateRecoToSim(tc1, theConvTP_);
1986  reco::RecoToSimCollection p2 = theTrackAssociator->associateRecoToSim(tc2, theConvTP_);
1987 
1988  if ((!p1incl.empty() && !p2incl.empty()) && (!p1.empty() || !p2.empty())) { // associated = true;
1989  try {
1990  std::vector<std::pair<TrackingParticleRef, double> > tp1 = p1incl[tk1];
1991  std::vector<std::pair<TrackingParticleRef, double> > tp2 = p2incl[tk2];
1992  if (!(!tp1.empty() && !tp2.empty())) {
1993  tp1 = p1[tk2];
1994  tp2 = p2[tk1];
1995  }
1996  if (!tp1.empty() && !tp2.empty()) {
1997  TrackingParticleRef tpr1 = tp1.front().first;
1998  TrackingParticleRef tpr2 = tp2.front().first;
1999  if (abs(tpr1->pdgId()) == 11 && abs(tpr2->pdgId()) == 11 && tpr1->pdgId() * tpr2->pdgId() < 0) {
2000  if (((tpr1->parentVertex()->sourceTracks_end() - tpr1->parentVertex()->sourceTracks_begin() >= 1) &&
2001  (*tpr1->parentVertex()->sourceTracks_begin())->pdgId() == 22) &&
2002  ((tpr2->parentVertex()->sourceTracks_end() - tpr2->parentVertex()->sourceTracks_begin() >= 1) &&
2003  (*tpr2->parentVertex()->sourceTracks_begin())->pdgId() == 22)) {
2004  // if ( fabs(tpr1->vx() - tpr2->vx()) < 0.1 && fabs(tpr1->vy() - tpr2->vy()) < 0.1 && fabs(tpr1->vz() - tpr2->vz()) < 0.1) {
2005  //if (((*tpr1->parentVertex()->sourceTracks_begin())->pdgId()==22) || ((*tpr2->parentVertex()->sourceTracks_begin())->pdgId()==22)) {
2006  // mcConvR_ = sqrt(tpr1->parentVertex()->position().Perp2());
2007  // mcConvZ_ = tpr1->parentVertex()->position().z();
2008  // mcConvX_ = tpr1->parentVertex()->position().x();
2009  // mcConvY_ = tpr1->parentVertex()->position().y();
2010  // mcConvEta_ = tpr1->parentVertex()->position().eta();
2011  // mcConvPhi_ = tpr1->parentVertex()->position().phi();
2012  // mcConvPt_ = sqrt((*tpr1->parentVertex()->sourceTracks_begin())->momentum().Perp2());
2013  //std::cout << " Reco to Sim mcconvpt " << mcConvPt_ << std::endl;
2014  //cout << "associated track1 to " << tpr1->pdgId() << " with p=" << tpr1->p4() << " with pT=" << tpr1->pt() << endl;
2015  //cout << "associated track2 to " << tpr2->pdgId() << " with p=" << tpr2->p4() << " with pT=" << tpr2->pt() << endl;
2016  associated = true;
2017  break;
2018  //}
2019  //}
2020  }
2021  }
2022  }
2023  } catch (Exception const& event) {
2024  //cout << "do not continue: " << event.what() << endl;
2025  //continue;
2026  }
2027  }
2028  }
2029  }
2030 
2031  if (associated)
2032  match = 1;
2033  else
2034  match = 2;
2035 
2036  h_match_->Fill(float(match));
2038  if (match == 1)
2039  nRecConvAss_++;
2040  h_convEta_[match][0]->Fill(refittedMom.eta());
2041  h_convEta_[match][1]->Fill(refittedMom.eta());
2042  if (matchConvSC)
2043  h_convEtaMatchSC_[match][0]->Fill(refittedMom.eta());
2044  h_convPhi_[match][0]->Fill(refittedMom.phi());
2045  h_convR_[match][0]->Fill(sqrt(aConv.conversionVertex().position().perp2()));
2046  h_convZ_[match][0]->Fill(aConv.conversionVertex().position().z());
2047  h_convPt_[match][0]->Fill(sqrt(refittedMom.perp2()));
2048  h_invMass_[match][0]->Fill(invM);
2049  h_vtxChi2Prob_[match][0]->Fill(chi2Prob);
2050  h_DPhiTracksAtVtx_[match][0]->Fill(dPhiTracksAtVtx);
2051  h_DCotTracks_[match][0]->Fill(aConv.pairCotThetaSeparation());
2052  h_distMinAppTracks_[match][0]->Fill(aConv.distOfMinimumApproach());
2053  h_lxybs_[match][0]->Fill(lxy);
2054  h_maxNHitsBeforeVtx_[match][0]->Fill(maxNHitsBeforeVtx);
2055  h_leadNHitsBeforeVtx_[match][0]->Fill(leadNHitsBeforeVtx);
2056  h_trailNHitsBeforeVtx_[match][0]->Fill(trailNHitsBeforeVtx);
2057  h_sumNHitsBeforeVtx_[match][0]->Fill(sumNHitsBeforeVtx);
2058  h_deltaExpectedHitsInner_[match][0]->Fill(deltaExpectedHitsInner);
2059  h_leadExpectedHitsInner_[match][0]->Fill(leadExpectedHitsInner);
2060  h_maxDlClosestHitToVtx_[match][0]->Fill(maxDlClosestHitToVtx);
2061  h_maxDlClosestHitToVtxSig_[match][0]->Fill(maxDlClosestHitToVtxSig);
2062  h_nSharedHits_[match][0]->Fill(aConv.nSharedHits());
2063  if (matchConvSC) {
2064  //h_EoverPTracks_[match][0] ->Fill (aConv.EoverPrefittedTracks());
2065  h_EoverPTracks_[match][0]->Fill(iMatchingSC->superCluster()->energy() / sqrt(refittedMom.mag2()));
2066  h_convSCdPhi_[match][0]->Fill(iMatchingSC->superCluster()->position().phi() - refittedMom.phi());
2067  double ConvEta = etaTransformation(aConv.refittedPairMomentum().eta(), aConv.zOfPrimaryVertexFromTracks());
2068  h_convSCdEta_[match][0]->Fill(iMatchingSC->superCluster()->position().eta() - ConvEta);
2069  }
2070  if (match == 1) {
2071  h2_photonPtRecVsPtSim_->Fill(mcConvPt_, sqrt(refittedMom.perp2()));
2072  h_convPtRes_[0]->Fill(sqrt(refittedMom.perp2()) / mcConvPt_);
2073  }
2074 
2075  if (phoIsInBarrel) {
2076  h_invMass_[match][1]->Fill(invM);
2077  h_vtxChi2Prob_[match][1]->Fill(chi2Prob);
2078  h_DPhiTracksAtVtx_[match][1]->Fill(dPhiTracksAtVtx);
2079  h_DCotTracks_[match][1]->Fill(aConv.pairCotThetaSeparation());
2080  h_distMinAppTracks_[match][1]->Fill(aConv.distOfMinimumApproach());
2081  h_lxybs_[match][1]->Fill(lxy);
2082  h_maxNHitsBeforeVtx_[match][1]->Fill(maxNHitsBeforeVtx);
2083  h_leadNHitsBeforeVtx_[match][1]->Fill(leadNHitsBeforeVtx);
2084  h_trailNHitsBeforeVtx_[match][1]->Fill(trailNHitsBeforeVtx);
2085  h_sumNHitsBeforeVtx_[match][1]->Fill(sumNHitsBeforeVtx);
2086  h_deltaExpectedHitsInner_[match][1]->Fill(deltaExpectedHitsInner);
2087  h_leadExpectedHitsInner_[match][1]->Fill(leadExpectedHitsInner);
2088  h_maxDlClosestHitToVtx_[match][1]->Fill(maxDlClosestHitToVtx);
2089  h_maxDlClosestHitToVtxSig_[match][1]->Fill(maxDlClosestHitToVtxSig);
2090  h_nSharedHits_[match][1]->Fill(aConv.nSharedHits());
2091  if (matchConvSC) {
2092  // h_EoverPTracks_[match][1] ->Fill (aConv.EoverPrefittedTracks());
2093  h_EoverPTracks_[match][1]->Fill(iMatchingSC->superCluster()->energy() / sqrt(refittedMom.mag2()));
2094  h_convSCdPhi_[match][1]->Fill(iMatchingSC->superCluster()->position().phi() - refittedMom.phi());
2095  double ConvEta = etaTransformation(aConv.refittedPairMomentum().eta(), aConv.zOfPrimaryVertexFromTracks());
2096  h_convSCdEta_[match][1]->Fill(iMatchingSC->superCluster()->position().eta() - ConvEta);
2097  }
2098  if (match == 1)
2099  h_convPtRes_[1]->Fill(sqrt(refittedMom.perp2()) / mcConvPt_);
2100  }
2101 
2102  if (phoIsInEndcap) {
2103  h_invMass_[match][2]->Fill(invM);
2104  h_vtxChi2Prob_[match][2]->Fill(chi2Prob);
2105  h_DPhiTracksAtVtx_[match][2]->Fill(dPhiTracksAtVtx);
2106  h_DCotTracks_[match][2]->Fill(aConv.pairCotThetaSeparation());
2107  h_distMinAppTracks_[match][2]->Fill(aConv.distOfMinimumApproach());
2108  h_lxybs_[match][2]->Fill(lxy);
2109  h_maxNHitsBeforeVtx_[match][2]->Fill(maxNHitsBeforeVtx);
2110  h_leadNHitsBeforeVtx_[match][2]->Fill(leadNHitsBeforeVtx);
2111  h_trailNHitsBeforeVtx_[match][2]->Fill(trailNHitsBeforeVtx);
2112  h_sumNHitsBeforeVtx_[match][2]->Fill(sumNHitsBeforeVtx);
2113  h_deltaExpectedHitsInner_[match][2]->Fill(deltaExpectedHitsInner);
2114  h_leadExpectedHitsInner_[match][2]->Fill(leadExpectedHitsInner);
2115  h_maxDlClosestHitToVtx_[match][2]->Fill(maxDlClosestHitToVtx);
2116  h_maxDlClosestHitToVtxSig_[match][2]->Fill(maxDlClosestHitToVtxSig);
2117  h_nSharedHits_[match][2]->Fill(aConv.nSharedHits());
2118  if (matchConvSC) {
2119  // h_EoverPTracks_[match][2] ->Fill (aConv.EoverPrefittedTracks());
2120  h_EoverPTracks_[match][2]->Fill(iMatchingSC->superCluster()->energy() / sqrt(refittedMom.mag2()));
2121  h_convSCdPhi_[match][2]->Fill(iMatchingSC->superCluster()->position().phi() - refittedMom.phi());
2122  double ConvEta = etaTransformation(aConv.refittedPairMomentum().eta(), aConv.zOfPrimaryVertexFromTracks());
2123  h_convSCdEta_[match][2]->Fill(iMatchingSC->superCluster()->position().eta() - ConvEta);
2124  }
2125  if (match == 1)
2126  h_convPtRes_[2]->Fill(sqrt(refittedMom.perp2()) / mcConvPt_);
2127  }
2128 
2129  if (match == 1) {
2130  h_convVtxdX_->Fill(aConv.conversionVertex().position().x() - mcConvX_);
2131  h_convVtxdY_->Fill(aConv.conversionVertex().position().y() - mcConvY_);
2132  h_convVtxdZ_->Fill(aConv.conversionVertex().position().z() - mcConvZ_);
2133  h_convVtxdR_->Fill(sqrt(aConv.conversionVertex().position().perp2()) - mcConvR_);
2134  h_convVtxdPhi_->Fill(aConv.conversionVertex().position().phi() - mcConvPhi_);
2135  h_convVtxdEta_->Fill(aConv.conversionVertex().position().eta() - mcConvEta_);
2136  h2_convVtxdRVsR_->Fill(mcConvR_, sqrt(aConv.conversionVertex().position().perp2()) - mcConvR_);
2137  h2_convVtxdRVsEta_->Fill(mcEta_, sqrt(aConv.conversionVertex().position().perp2()) - mcConvR_);
2138  p_convVtxdRVsR_->Fill(mcConvR_, sqrt(aConv.conversionVertex().position().perp2()) - mcConvR_);
2139  p_convVtxdRVsEta_->Fill(mcEta_, sqrt(aConv.conversionVertex().position().perp2()) - mcConvR_);
2140  p_convVtxdXVsX_->Fill(mcConvX_, aConv.conversionVertex().position().x() - mcConvX_);
2141  p_convVtxdYVsY_->Fill(mcConvY_, aConv.conversionVertex().position().y() - mcConvY_);
2142  p_convVtxdZVsZ_->Fill(mcConvZ_, aConv.conversionVertex().position().z() - mcConvZ_);
2143  p_convVtxdZVsR_->Fill(mcConvR_, aConv.conversionVertex().position().z() - mcConvZ_);
2144 
2145  float dR = sqrt(aConv.conversionVertex().position().perp2()) - mcConvR_;
2146  float dZ = aConv.conversionVertex().position().z() - mcConvZ_;
2147  p2_convVtxdRVsRZ_->Fill(mcConvZ_, mcConvR_, dR);
2148  p2_convVtxdZVsRZ_->Fill(mcConvZ_, mcConvR_, dZ);
2149 
2150  h2_convVtxRrecVsTrue_->Fill(mcConvR_, sqrt(aConv.conversionVertex().position().perp2()));
2151 
2152  h_zPVFromTracks_[match]->Fill(aConv.zOfPrimaryVertexFromTracks());
2153  h_dzPVFromTracks_[match]->Fill(aConv.zOfPrimaryVertexFromTracks() - simPV_Z);
2154  h2_dzPVVsR_->Fill(mcConvR_, aConv.zOfPrimaryVertexFromTracks() - simPV_Z);
2155  p_dzPVVsR_->Fill(mcConvR_, aConv.zOfPrimaryVertexFromTracks() - simPV_Z);
2156 
2157  if (phoIsInBarrel) {
2158  h_convVtxdX_barrel_->Fill(aConv.conversionVertex().position().x() - mcConvX_);
2159  h_convVtxdY_barrel_->Fill(aConv.conversionVertex().position().y() - mcConvY_);
2160  h_convVtxdZ_barrel_->Fill(aConv.conversionVertex().position().z() - mcConvZ_);
2161  h_convVtxdR_barrel_->Fill(sqrt(aConv.conversionVertex().position().perp2()) - mcConvR_);
2162  }
2163  if (phoIsInEndcap) {
2164  h_convVtxdX_endcap_->Fill(aConv.conversionVertex().position().x() - mcConvX_);
2165  h_convVtxdY_endcap_->Fill(aConv.conversionVertex().position().y() - mcConvY_);
2166  h_convVtxdZ_endcap_->Fill(aConv.conversionVertex().position().z() - mcConvZ_);
2167  h_convVtxdR_endcap_->Fill(sqrt(aConv.conversionVertex().position().perp2()) - mcConvR_);
2168  }
2169  }
2170 
2172  for (unsigned int i = 0; i < tracks.size(); i++) {
2173  //std::cout << " Loop over tracks pt " << tracks[i]->pt() << std::endl;
2174  RefToBase<reco::Track> tfrb(aConv.tracks()[i]);
2175  itAss = myAss.find(tfrb.get());
2176 
2177  nHitsVsEta_[match]->Fill(mcEta_, float(tracks[i]->numberOfValidHits()));
2178  nHitsVsR_[match]->Fill(mcConvR_, float(tracks[i]->numberOfValidHits()));
2179  p_nHitsVsEta_[match]->Fill(mcEta_, float(tracks[i]->numberOfValidHits()) - 0.0001);
2180  p_nHitsVsR_[match]->Fill(mcConvR_, float(tracks[i]->numberOfValidHits()) - 0.0001);
2181  h_tkChi2_[match]->Fill(tracks[i]->normalizedChi2());
2182  h_tkChi2Large_[match]->Fill(tracks[i]->normalizedChi2());
2183  h2_Chi2VsEta_[match]->Fill(mcEta_, tracks[i]->normalizedChi2());
2184  h2_Chi2VsR_[match]->Fill(mcConvR_, tracks[i]->normalizedChi2());
2185  p_Chi2VsEta_[match]->Fill(mcEta_, tracks[i]->normalizedChi2());
2186  p_Chi2VsR_[match]->Fill(mcConvR_, tracks[i]->normalizedChi2());
2187  double d0;
2188  if (valid_pvtx) {
2189  d0 = -tracks[i]->dxy(the_pvtx.position());
2190  } else {
2191  d0 = tracks[i]->d0();
2192  }
2193  h_TkD0_[match]->Fill(d0 * tracks[i]->charge());
2194  h_nHitsBeforeVtx_[match]->Fill(aConv.nHitsBeforeVtx().size() > 1 ? aConv.nHitsBeforeVtx().at(i) : 0);
2195  h_dlClosestHitToVtx_[match]->Fill(aConv.dlClosestHitToVtx().size() > 1 ? aConv.dlClosestHitToVtx().at(i).value()
2196  : 0);
2197  h_dlClosestHitToVtxSig_[match]->Fill(aConv.dlClosestHitToVtx().size() > 1
2198  ? aConv.dlClosestHitToVtx().at(i).value() /
2199  aConv.dlClosestHitToVtx().at(i).error()
2200  : 0);
2201 
2202  if (itAss == myAss.end())
2203  continue;
2204  reco::Track refTrack = aConv.conversionVertex().refittedTracks()[i];
2205 
2206  float simPt = sqrt(((*itAss).second)->momentum().perp2());
2207  float recPt = refTrack.pt();
2208  float ptres = recPt - simPt;
2209  //float pterror = aConv.tracks()[i]->ptError();
2210  float pterror = aConv.conversionVertex().refittedTracks()[i].ptError();
2211  h2_PtRecVsPtSim_[0]->Fill(simPt, recPt);
2212  h_TkPtPull_[0]->Fill(ptres / pterror);
2213  h2_TkPtPull_[0]->Fill(mcEta_, ptres / pterror);
2214 
2215  if (phoIsInBarrel) {
2216  h_TkPtPull_[1]->Fill(ptres / pterror);
2217  h2_PtRecVsPtSim_[1]->Fill(simPt, recPt);
2218  }
2219  if (phoIsInEndcap) {
2220  h_TkPtPull_[2]->Fill(ptres / pterror);
2221  h2_PtRecVsPtSim_[2]->Fill(simPt, recPt);
2222  }
2223  } // end loop over track
2224 
2225  } // loop over reco conversions
2226 
2227  h_nConv_[0][0]->Fill(float(nRecConv_));
2228  h_nConv_[1][0]->Fill(float(nRecConvAss_));
2229 }
2230 
2232  std::string outputFileName = parameters_.getParameter<std::string>("OutputFileName");
2233  if (!isRunCentrally_) {
2235  }
2236 
2237  edm::LogInfo("TkConvValidator") << "Analyzed " << nEvt_ << "\n";
2238  // std::cout << "::endJob Analyzed " << nEvt_ << " events " << " with total " << nPho_ << " Photons " << "\n";
2239  // std::cout << "TkConvValidator::endJob Analyzed " << nEvt_ << " events " << "\n";
2240 
2241  return;
2242 }
2243 
2245  const TrackerGeometry& trackerGeom,
2246  const edm::RefToBase<reco::Track>& tk,
2247  const reco::Vertex& vtx) {
2250  auto scp = new SimpleCylinderBounds(sqrt(vtx.position().perp2()) - 0.001f,
2251  sqrt(vtx.position().perp2()) + 0.001f,
2252  -fabs(vtx.position().z()),
2253  fabs(vtx.position().z()));
2255  new Cylinder(Cylinder::computeRadius(*scp), Surface::PositionType(0, 0, 0), rot, scp));
2256 
2258  new Disk(Surface::PositionType(0, 0, vtx.position().z()),
2259  rot,
2260  new SimpleDiskBounds(0, sqrt(vtx.position().perp2()), -0.001, 0.001)));
2261 
2262  const TrajectoryStateOnSurface myTSOS = trajectoryStateTransform::innerStateOnSurface(*tk, trackerGeom, &mf);
2263  PropagatorWithMaterial propag(anyDirection, 0.000511, &mf);
2264  TrajectoryStateOnSurface stateAtVtx;
2265  stateAtVtx = propag.propagate(myTSOS, *theBarrel_);
2266  if (!stateAtVtx.isValid()) {
2267  stateAtVtx = propag.propagate(myTSOS, *theDisk_);
2268  }
2269  if (stateAtVtx.isValid()) {
2270  return math::XYZVector(double(stateAtVtx.globalMomentum().x()),
2271  double(stateAtVtx.globalMomentum().y()),
2272  double(stateAtVtx.globalMomentum().z()));
2273  } else {
2274  return math::XYZVector(0., 0., 0.);
2275  }
2276 }
2277 
2279  //---Definitions
2280  const float PI = 3.1415927;
2281  const float TWOPI = 2.0 * PI;
2282 
2283  if (phi > PI) {
2284  phi = phi - TWOPI;
2285  }
2286  if (phi < -PI) {
2287  phi = phi + TWOPI;
2288  }
2289 
2290  // cout << " Float_t PHInormalization out " << PHI << endl;
2291  return phi;
2292 }
2293 
2294 float TkConvValidator::etaTransformation(float EtaParticle, float Zvertex) {
2295  //---Definitions
2296  const float PI = 3.1415927;
2297 
2298  //---Definitions for ECAL
2299  const float R_ECAL = 136.5;
2300  const float Z_Endcap = 328.0;
2301  const float etaBarrelEndcap = 1.479;
2302 
2303  //---ETA correction
2304 
2305  float Theta = 0.0;
2306  float ZEcal = R_ECAL * sinh(EtaParticle) + Zvertex;
2307 
2308  if (ZEcal != 0.0)
2309  Theta = atan(R_ECAL / ZEcal);
2310  if (Theta < 0.0)
2311  Theta = Theta + PI;
2312  float ETA = -log(tan(0.5 * Theta));
2313 
2314  if (fabs(ETA) > etaBarrelEndcap) {
2315  float Zend = Z_Endcap;
2316  if (EtaParticle < 0.0)
2317  Zend = -Zend;
2318  float Zlen = Zend - Zvertex;
2319  float RR = Zlen / sinh(EtaParticle);
2320  Theta = atan(RR / Zend);
2321  if (Theta < 0.0)
2322  Theta = Theta + PI;
2323  ETA = -log(tan(0.5 * Theta));
2324  }
2325  //---Return the result
2326  return ETA;
2327  //---end
2328 }
reco::Conversion::pairCotThetaSeparation
double pairCotThetaSeparation() const
Delta cot(Theta) where Theta is the angle in the (y,z) plane between the two tracks....
Definition: Conversion.cc:179
PI
Definition: PayloadInspector.h:21
TrackExtra.h
TkRotation< float >
reco::Vertex::isValid
bool isValid() const
Tells whether the vertex is valid.
Definition: Vertex.h:72
tkConvValidator_cfi.minPhoPtForEffic
minPhoPtForEffic
Definition: tkConvValidator_cfi.py:59
GenJetCollection.h
reco::Conversion
Definition: Conversion.h:23
TrajectoryStateOnSurface.h
photonAnalyzer_cfi.rMax
rMax
Definition: photonAnalyzer_cfi.py:91
photonAnalyzer_cfi.etMin
etMin
Definition: photonAnalyzer_cfi.py:54
Handle.h
ALCARECOTkAlBeamHalo_cff.etaMin
etaMin
GeV.
Definition: ALCARECOTkAlBeamHalo_cff.py:32
anyDirection
Definition: PropagationDirection.h:4
mps_fire.i
i
Definition: mps_fire.py:428
FreeTrajectoryState.h
reco::Photon::superCluster
reco::SuperClusterRef superCluster() const override
Ref to SuperCluster.
reco::Conversion::generalTracksOnly
Definition: Conversion.h:28
photonAnalyzer_cfi.zMax
zMax
Definition: photonAnalyzer_cfi.py:95
MessageLogger.h
TkConvValidator::~TkConvValidator
~TkConvValidator() override
Definition: TkConvValidator.cc:144
TrackerGeometry.h
edm::Handle::product
T const * product() const
Definition: Handle.h:70
TkConvValidator::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: TkConvValidator.cc:1239
TrackCandidateCollection.h
tkConvValidator_cfi.minPhoPtForPurity
minPhoPtForPurity
Definition: tkConvValidator_cfi.py:63
photonAnalyzer_cfi.dPhiTracksMin
dPhiTracksMin
Definition: photonAnalyzer_cfi.py:102
etaBin
int etaBin(const l1t::HGCalMulticluster *cl)
Definition: L1EGammaEEProducer.cc:19
reco::TrackBase::inOutEcalSeededConv
Definition: TrackBase.h:106
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
photonAnalyzer_cfi.zBin
zBin
Definition: photonAnalyzer_cfi.py:93
PropagatorWithMaterial::propagate
TrajectoryStateOnSurface propagate(STA const &state, SUR const &surface) const
Definition: Propagator.h:50
reco::Conversion::tracks
std::vector< edm::RefToBase< reco::Track > > const & tracks() const
vector of track to base references
Definition: Conversion.cc:150
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
photonAnalyzer_cfi.dPhiTracksBin
dPhiTracksBin
Definition: photonAnalyzer_cfi.py:101
BoundDisk.h
PI
#define PI
Definition: QcdUeDQM.h:37
conv
static HepMC::IO_HEPEVT conv
Definition: BeamHaloProducer.cc:48
edm::Run
Definition: Run.h:45
BeamMonitor_cff.phiBin
phiBin
Definition: BeamMonitor_cff.py:76
photonValidationSequence_cff.eoverpMax
eoverpMax
Definition: photonValidationSequence_cff.py:17
reco::deltaPhi
constexpr double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:26
deltaPhi.h
BasicCluster.h
ChiSquaredProbability
float ChiSquaredProbability(double chiSquared, double nrDOF)
Definition: ChiSquaredProbability.cc:13
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
edm
HLT enums.
Definition: AlignableModifier.h:19
dqm::implementation::IBooker::bookProfile2D
MonitorElement * bookProfile2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, double lowZ, double highZ, char const *option="s", FUNC onbooking=NOOP())
Definition: DQMStore.h:399
reco::TrackToTrackingParticleAssociator::associateRecoToSim
reco::RecoToSimCollection associateRecoToSim(const edm::Handle< edm::View< reco::Track >> &tCH, const edm::Handle< TrackingParticleCollection > &tPCH) const
Definition: TrackToTrackingParticleAssociator.h:64
photonValidationSequence_cff.eoverpMin
eoverpMin
Definition: photonValidationSequence_cff.py:16
TkConvValidator::bookHistograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: TkConvValidator.cc:146
reco::VertexCollection
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
TrackCollections2monitor_cff.numberOfValidHits
numberOfValidHits
Definition: TrackCollections2monitor_cff.py:248
SimpleCylinderBounds.h
muonRecoAnalyzer_cfi.chi2Min
chi2Min
Definition: muonRecoAnalyzer_cfi.py:34
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
reco::Conversion::pairInvariantMass
double pairInvariantMass() const
if nTracks=2 returns the pair invariant mass. Original tracks are used here
Definition: Conversion.cc:159
ChiSquaredProbability.h
reco::Conversion::zOfPrimaryVertexFromTracks
double zOfPrimaryVertexFromTracks(const math::XYZPoint &myBeamSpot=math::XYZPoint()) const
Definition: Conversion.h:136
reco::Conversion::dlClosestHitToVtx
const std::vector< Measurement1DFloat > & dlClosestHitToVtx() const
Vector of signed decay length with uncertainty from nearest hit on track to the conversion vtx positi...
Definition: Conversion.h:156
reco::Vertex::position
const Point & position() const
position
Definition: Vertex.h:114
TrackerHitAssociator.h
photonValidator_cfi.dCotTracksMax
dCotTracksMax
Definition: photonValidator_cfi.py:100
ReferenceCountingPointer< Cylinder >
BoundCylinder.h
edm::RefVector< TrackingParticleCollection >
tkConvValidator_cfi.maxPhoEtaForPurity
maxPhoEtaForPurity
Definition: tkConvValidator_cfi.py:64
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
photonValidator_cfi.zMinForXray
zMinForXray
Definition: photonValidator_cfi.py:122
reco::HitPattern::numberOfLostHits
int numberOfLostHits(HitCategory category) const
Definition: HitPattern.h:860
edm::Handle< reco::TrackToTrackingParticleAssociator >
parallelization.uint
uint
Definition: parallelization.py:124
photonValidator_cfi.rMinForXray
rMinForXray
Definition: photonValidator_cfi.py:118
BasicClusterFwd.h
TwoTrackMinimumDistance.h
edm::Ref< TrackingParticleCollection >
reco::ConversionCollection
std::vector< Conversion > ConversionCollection
collectin of Conversion objects
Definition: ConversionFwd.h:9
recPt
double recPt
Definition: PFJetBenchmarkAnalyzer.cc:75
edm::Exception
Definition: EDMException.h:77
GenParticle.h
photonAnalyzer_cfi.dPhiTracksMax
dPhiTracksMax
Definition: photonAnalyzer_cfi.py:103
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
SimpleCylinderBounds
Definition: SimpleCylinderBounds.h:19
reco::TrackBase::pt
double pt() const
track transverse momentum
Definition: TrackBase.h:637
IdealMagneticFieldRecord
Definition: IdealMagneticFieldRecord.h:11
SimpleDiskBounds
Definition: SimpleDiskBounds.h:11
conversionPostprocessing_cfi.etaBin2
etaBin2
Definition: conversionPostprocessing_cfi.py:19
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
reco::Conversion::refittedPairMomentum
math::XYZVectorF refittedPairMomentum() const
Conversion tracks momentum from the tracks refitted with vertex constraint.
Definition: Conversion.cc:206
MakerMacros.h
Photon.h
reco::Conversion::arbitratedMerged
Definition: Conversion.h:30
PropagatorWithMaterial
Definition: PropagatorWithMaterial.h:25
TrackingRecHit.h
tkConvValidator_cfi.maxPhoEtaForEffic
maxPhoEtaForEffic
Definition: tkConvValidator_cfi.py:60
Track.h
edm::EventSetup::get
T get() const
Definition: EventSetup.h:87
TrackFwd.h
TkConvValidator.h
photonValidator_cfi.resMin
resMin
Definition: photonValidator_cfi.py:91
TrackingVertexContainer.h
reco::Conversion::nHitsBeforeVtx
const std::vector< uint8_t > & nHitsBeforeVtx() const
Vector of the number of hits before the vertex along each track trajector.
Definition: Conversion.h:154
TkConvValidator::TkConvValidator
TkConvValidator(const edm::ParameterSet &)
Definition: TkConvValidator.cc:99
photonValidationSequence_cff.useTP
useTP
Definition: photonValidationSequence_cff.py:14
ElectronMCTruth.h
edm::RefToBaseVector::push_back
void push_back(const RefToBase< T > &)
Definition: RefToBaseVector.h:217
reco::Conversion::arbitratedEcalSeeded
Definition: Conversion.h:29
reco::TrackBase::outInEcalSeededConv
Definition: TrackBase.h:105
PhotonMCTruth.h
Service.h
TrackerDigiGeometryRecord
Definition: TrackerDigiGeometryRecord.h:15
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
SimVertex.h
AlignmentTrackSelector_cfi.phiMin
phiMin
Definition: AlignmentTrackSelector_cfi.py:18
photonValidator_cfi.rMaxForXray
rMaxForXray
Definition: photonValidator_cfi.py:119
reco::BeamSpot
Definition: BeamSpot.h:21
TkConvValidator::etaTransformation
float etaTransformation(float a, float b)
Definition: TkConvValidator.cc:2294
TransientTrackRecord
Definition: TransientTrackRecord.h:11
reco::Track
Definition: Track.h:27
IdealMagneticFieldRecord.h
edm::ESHandle< TransientTrackBuilder >
AlignmentTrackSelector_cfi.phiMax
phiMax
Definition: AlignmentTrackSelector_cfi.py:17
p2
double p2[4]
Definition: TauolaWrapper.h:90
dqm::implementation::IBooker::bookProfile
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
Definition: DQMStore.h:322
photonValidator_cfi.zMaxForXray
zMaxForXray
Definition: photonValidator_cfi.py:123
CaloClusterFwd.h
reco_skim_cfg_mod.outputFileName
outputFileName
Definition: reco_skim_cfg_mod.py:15
dbe_
dqm::legacy::DQMStore * dbe_
Definition: PFJetBenchmarkAnalyzer.cc:77
tkConvValidator_cfi.maxPhoRForEffic
maxPhoRForEffic
Definition: tkConvValidator_cfi.py:62
Point3DBase< float, GlobalTag >
dqm::implementation::DQMStore::save
DQM_DEPRECATED void save(std::string const &filename, std::string const &path="")
Definition: DQMStore.cc:761
PhotonMCTruthFinder
Definition: PhotonMCTruthFinder.h:20
edm::RefToBase::get
value_type const * get() const
Definition: RefToBase.h:209
q2
double q2[4]
Definition: TauolaWrapper.h:88
cmsswSequenceInfo.tp
tp
Definition: cmsswSequenceInfo.py:17
reco::Vertex::refittedTracks
const std::vector< Track > & refittedTracks() const
Returns the container of refitted tracks.
Definition: Vertex.h:183
TkConvValidator::recalculateMomentumAtFittedVertex
math::XYZVector recalculateMomentumAtFittedVertex(const MagneticField &mf, const TrackerGeometry &trackerGeom, const edm::RefToBase< reco::Track > &tk, const reco::Vertex &vtx)
Definition: TkConvValidator.cc:2244
CaloGeometryRecord.h
photonValidator_cfi.eoverpBin
eoverpBin
Definition: photonValidator_cfi.py:106
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
TFileService.h
PhotonMCTruthFinder.h
PbPb_ZMuSkimMuonDPG_cff.tracker
tracker
Definition: PbPb_ZMuSkimMuonDPG_cff.py:60
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
TrackerDigiGeometryRecord.h
TransientTrackBuilder.h
edm::ParameterSet
Definition: ParameterSet.h:47
q1
double q1[4]
Definition: TauolaWrapper.h:87
reco::Conversion::quality
bool quality(ConversionQuality q) const
Definition: Conversion.h:178
tracks
const uint32_t *__restrict__ const HitContainer *__restrict__ TkSoA *__restrict__ tracks
Definition: CAHitNtupletGeneratorKernelsImpl.h:159
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
TWOPI
#define TWOPI
Definition: DQMSourcePi0.cc:36
reco::Conversion::conversionVertex
const reco::Vertex & conversionVertex() const
returns the reco conversion vertex
Definition: Conversion.h:88
PropagatorWithMaterial.h
edm::AssociationMap< edm::OneToManyWithQualityGeneric< TrackingParticleCollection, edm::View< reco::Track >, double > >
EcalClusterTools.h
reco::Vertex::x
double x() const
x coordinate
Definition: Vertex.h:116
match
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
math::XYZVector
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
CaloTopologyRecord.h
photonAnalyzer_cfi.zMin
zMin
Definition: photonAnalyzer_cfi.py:94
reco::Conversion::highPurity
Definition: Conversion.h:33
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
funct::tan
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
TrackTransientTrack.h
photonValidator_cfi.dCotTracksMin
dCotTracksMin
Definition: photonValidator_cfi.py:99
edm::Service
Definition: Service.h:30
photonAnalyzer_cfi.rBin
rBin
Definition: photonAnalyzer_cfi.py:89
muonRecoAnalyzer_cfi.chi2Max
chi2Max
Definition: muonRecoAnalyzer_cfi.py:35
reco::Conversion::distOfMinimumApproach
double distOfMinimumApproach() const
Definition: Conversion.h:116
tkConvValidator_cfi.maxPhoZForPurity
maxPhoZForPurity
Definition: tkConvValidator_cfi.py:65
photonValidator_cfi.resBin
resBin
Definition: photonValidator_cfi.py:90
p1
double p1[4]
Definition: TauolaWrapper.h:89
EgammaValidation_cff.pdgId
pdgId
Definition: EgammaValidation_cff.py:118
MagneticField.h
edm::EventSetup
Definition: EventSetup.h:58
TrackAssociatorRecord.h
photonValidator_cfi.zBin2ForXray
zBin2ForXray
Definition: photonValidator_cfi.py:121
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
TransientTrackRecord.h
get
#define get
edm::RefToBaseVector< reco::Track >
TrackCollections2monitor_cff.normalizedChi2
normalizedChi2
Definition: TrackCollections2monitor_cff.py:247
nanoDQM_cff.Photon
Photon
Definition: nanoDQM_cff.py:63
reco::Vertex::chi2
double chi2() const
chi-squares
Definition: Vertex.h:103
alignCSCRings.r
r
Definition: alignCSCRings.py:93
CaloTopology.h
reco::TrackBase::algo
TrackAlgorithm algo() const
Definition: TrackBase.h:547
reco::Photon
Definition: Photon.h:21
cosmicPhotonAnalyzer_cfi.etMax
etMax
Definition: cosmicPhotonAnalyzer_cfi.py:11
reco::TrackBase::hitPattern
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:504
reco::BeamSpot::x0
double x0() const
x coordinate
Definition: BeamSpot.h:61
edm::AssociationMap::empty
bool empty() const
return true if empty
Definition: AssociationMap.h:164
reco::Conversion::nSharedHits
uint8_t nSharedHits() const
number of shared hits btw the two track
Definition: Conversion.h:158
TrackingParticle.h
TrajectoryStateOnSurface::globalMomentum
GlobalVector globalMomentum() const
Definition: TrajectoryStateOnSurface.h:66
GeomDet.h
Disk
Definition: BoundDisk.h:19
std
Definition: JetResolutionObject.h:76
writedatasetfile.run
run
Definition: writedatasetfile.py:27
reco::Vertex::y
double y() const
y coordinate
Definition: Vertex.h:118
photonValidator_cfi.dCotTracksBin
dCotTracksBin
Definition: photonValidator_cfi.py:98
extraflags_cff.vtx
vtx
Definition: extraflags_cff.py:18
DetId.h
TrackingParticleFwd.h
spclusmultinvestigator_cfi.vertexCollection
vertexCollection
Definition: spclusmultinvestigator_cfi.py:4
dqm::implementation::IBooker::book2D
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:177
TrackingComponentsRecord.h
SuperCluster.h
edm::RefVectorIterator
Definition: EDProductfwd.h:33
ETA
#define ETA
Definition: GenericBenchmark.cc:28
reco::HitPattern::MISSING_INNER_HITS
Definition: HitPattern.h:155
tkConvValidator_cfi.maxPhoRForPurity
maxPhoRForPurity
Definition: tkConvValidator_cfi.py:66
makeMuonMisalignmentScenario.rot
rot
Definition: makeMuonMisalignmentScenario.py:322
math::XYZVectorF
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< float > > XYZVectorF
spatial vector with cartesian internal representation
Definition: Vector3D.h:16
ALCARECOTkAlBeamHalo_cff.etaMax
etaMax
Definition: ALCARECOTkAlBeamHalo_cff.py:33
HiEvtPlane_cfi.pterror
pterror
Definition: HiEvtPlane_cfi.py:24
tkConvValidator_cfi.maxPhoZForEffic
maxPhoZForEffic
Definition: tkConvValidator_cfi.py:61
edm::RefToBase< reco::Track >
photonValidator_cfi.resMax
resMax
Definition: photonValidator_cfi.py:92
TrajectoryStateTransform.h
Exception.h
reco::TrackToTrackingParticleAssociator::associateSimToReco
reco::SimToRecoCollection associateSimToReco(const edm::Handle< edm::View< reco::Track >> &tCH, const edm::Handle< TrackingParticleCollection > &tPCH) const
Definition: TrackToTrackingParticleAssociator.h:71
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
photonValidator_cfi.rBinForXray
rBinForXray
Definition: photonValidator_cfi.py:117
dqm::implementation::IBooker
Definition: DQMStore.h:43
Cylinder::computeRadius
static float computeRadius(Bounds const &bounds)
Definition: Cylinder.h:28
edm::Ref::key
key_type key() const
Accessor for product key.
Definition: Ref.h:250
reco::PhotonCollection
std::vector< Photon > PhotonCollection
collectin of Photon objects
Definition: PhotonFwd.h:9
photonAnalyzer_cfi.rMin
rMin
Definition: photonAnalyzer_cfi.py:90
TkConvValidator::dqmEndRun
void dqmEndRun(edm::Run const &r, edm::EventSetup const &es) override
Definition: TkConvValidator.cc:1235
Cylinder
Definition: Cylinder.h:19
mps_fire.result
result
Definition: mps_fire.py:311
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
SimpleDiskBounds.h
SimTrack.h
HGC3DClusterGenMatchSelector_cfi.dR
dR
Definition: HGC3DClusterGenMatchSelector_cfi.py:7
ExoticaDQM_cfi.photonCollection
photonCollection
Definition: ExoticaDQM_cfi.py:17
dummy
Definition: DummySelector.h:38
HepMCProduct.h
TkConvValidator::endJob
void endJob() override
Definition: TkConvValidator.cc:2231
trajectoryStateTransform::innerStateOnSurface
TrajectoryStateOnSurface innerStateOnSurface(const reco::Track &tk, const TrackingGeometry &geom, const MagneticField *field, bool withErr=true)
Definition: TrajectoryStateTransform.cc:110
ZEcal
static constexpr float ZEcal
Definition: L1TkEmParticleProducer.cc:40
photonAnalyzer_cfi.etBin
etBin
Definition: photonAnalyzer_cfi.py:53
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
event
Definition: event.py:1
reco::BeamSpot::y0
double y0() const
y coordinate
Definition: BeamSpot.h:63
edm::Event
Definition: Event.h:73
TkConvValidator::phiNormalization
float phiNormalization(float &a)
Definition: TkConvValidator.cc:2278
MagneticField
Definition: MagneticField.h:19
d0
static constexpr float d0
Definition: L1EGammaCrystalsEmulatorProducer.cc:85
reco::Vertex::ndof
double ndof() const
Definition: Vertex.h:110
SimTrackContainer.h
edm::InputTag
Definition: InputTag.h:15
Z_Endcap
static constexpr float Z_Endcap
Definition: ECALPositionCalculator.cc:11
SimVertexContainer.h
reco::Vertex
Definition: Vertex.h:35
R_ECAL
static constexpr float R_ECAL
Definition: ECALPositionCalculator.cc:10
TrajectoryStateOnSurface::isValid
bool isValid() const
Definition: TrajectoryStateOnSurface.h:54
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
CaloCluster.h
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
TkConvValidator::dqmBeginRun
void dqmBeginRun(edm::Run const &r, edm::EventSetup const &theEventSetup) override
Definition: TkConvValidator.cc:1226
TrackerGeometry
Definition: TrackerGeometry.h:14
etaBarrelEndcap
static constexpr float etaBarrelEndcap
Definition: ECALPositionCalculator.cc:12
photonValidator_cfi.zBinForXray
zBinForXray
Definition: photonValidator_cfi.py:120
Conversion.h