CMS 3D CMS Logo

PhotonValidator.cc
Go to the documentation of this file.
1 #include <iostream>
2 #include <memory>
3 
4 //
7 //
9 
10 //
14 //
16 //
20 //
25 //
30 //
33 #include "CLHEP/Units/GlobalPhysicalConstants.h"
35 
36 //
56 
57 //
62 
66 //
67 //#include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
68 //
69 #include "TFile.h"
70 #include "TH1.h"
71 #include "TH2.h"
72 #include "TTree.h"
73 #include "TVector3.h"
74 #include "TProfile.h"
75 //
84 using namespace std;
85 
87 
88 {
89  fName_ = pset.getParameter<std::string>("analyzerName");
90  verbosity_ = pset.getUntrackedParameter<int>("Verbosity");
91  parameters_ = pset;
92  fastSim_ = pset.getParameter<bool>("fastSim");
93  isRunCentrally_ = pset.getParameter<bool>("isRunCentrally");
94 
95  photonCollectionProducer_ = pset.getParameter<std::string>("phoProducer");
96  photonCollection_ = pset.getParameter<std::string>("photonCollection");
97  photonCollectionToken_ =
98  consumes<reco::PhotonCollection>(edm::InputTag(photonCollectionProducer_, photonCollection_));
99 
100  token_tp_ = consumes<TrackingParticleCollection>(pset.getParameter<edm::InputTag>("label_tp"));
101 
102  barrelEcalHits_ = consumes<EcalRecHitCollection>(pset.getParameter<edm::InputTag>("barrelEcalHits"));
103  endcapEcalHits_ = consumes<EcalRecHitCollection>(pset.getParameter<edm::InputTag>("endcapEcalHits"));
104 
105  conversionOITrackProducer_ = pset.getParameter<std::string>("conversionOITrackProducer");
106  conversionIOTrackProducer_ = pset.getParameter<std::string>("conversionIOTrackProducer");
107  conversionOITrackPr_Token_ = consumes<edm::View<reco::Track> >(edm::InputTag(conversionOITrackProducer_));
108  conversionIOTrackPr_Token_ = consumes<edm::View<reco::Track> >(edm::InputTag(conversionIOTrackProducer_));
109 
110  pfCandidates_ = consumes<reco::PFCandidateCollection>(pset.getParameter<edm::InputTag>("pfCandidates"));
111  valueMapPhoPFCandIso_ = pset.getParameter<std::string>("valueMapPhoToParticleBasedIso");
112  particleBasedIso_token =
113  consumes<edm::ValueMap<std::vector<reco::PFCandidateRef> > >(pset.getUntrackedParameter<edm::InputTag>(
114  "particleBasedIso", edm::InputTag("particleBasedIsolation", valueMapPhoPFCandIso_)));
115 
116  minPhoEtCut_ = pset.getParameter<double>("minPhoEtCut");
117  convTrackMinPtCut_ = pset.getParameter<double>("convTrackMinPtCut");
118  likelihoodCut_ = pset.getParameter<double>("likelihoodCut");
119 
120  trkIsolExtRadius_ = pset.getParameter<double>("trkIsolExtR");
121  trkIsolInnRadius_ = pset.getParameter<double>("trkIsolInnR");
122  trkPtLow_ = pset.getParameter<double>("minTrackPtCut");
123  lip_ = pset.getParameter<double>("lipCut");
124  ecalIsolRadius_ = pset.getParameter<double>("ecalIsolR");
125  bcEtLow_ = pset.getParameter<double>("minBcEtCut");
126  hcalIsolExtRadius_ = pset.getParameter<double>("hcalIsolExtR");
127  hcalIsolInnRadius_ = pset.getParameter<double>("hcalIsolInnR");
128  hcalHitEtLow_ = pset.getParameter<double>("minHcalHitEtCut");
129 
130  numOfTracksInCone_ = pset.getParameter<int>("maxNumOfTracksInCone");
131  trkPtSumCut_ = pset.getParameter<double>("trkPtSumCut");
132  ecalEtSumCut_ = pset.getParameter<double>("ecalEtSumCut");
133  hcalEtSumCut_ = pset.getParameter<double>("hcalEtSumCut");
134  dCotCutOn_ = pset.getParameter<bool>("dCotCutOn");
135  dCotCutValue_ = pset.getParameter<double>("dCotCutValue");
136  dCotHardCutValue_ = pset.getParameter<double>("dCotHardCutValue");
137 
138  offline_pvToken_ = consumes<reco::VertexCollection>(
139  pset.getUntrackedParameter<edm::InputTag>("offlinePV", edm::InputTag("offlinePrimaryVertices")));
140  g4_simTk_Token_ = consumes<edm::SimTrackContainer>(edm::InputTag("g4SimHits"));
141  g4_simVtx_Token_ = consumes<edm::SimVertexContainer>(edm::InputTag("g4SimHits"));
142  famos_simTk_Token_ = consumes<edm::SimTrackContainer>(edm::InputTag("fastSimProducer"));
143  famos_simVtx_Token_ = consumes<edm::SimVertexContainer>(edm::InputTag("fastSimProducer"));
144  hepMC_Token_ = consumes<edm::HepMCProduct>(edm::InputTag("generatorSmeared"));
145  genjets_Token_ = consumes<reco::GenJetCollection>(edm::InputTag("ak4GenJets"));
146 
147  genpartToken_ = consumes<reco::GenParticleCollection>(edm::InputTag("genParticles"));
148 
149  consumes<reco::TrackToTrackingParticleAssociator>(edm::InputTag("trackAssociatorByHitsForPhotonValidation"));
150 
151  nEvt_ = 0;
152  nEntry_ = 0;
153  nRecConv_ = 0;
154  nRecConvAss_ = 0;
155  nRecConvAssWithEcal_ = 0;
156  nInvalidPCA_ = 0;
157 }
158 
160 
162  double resMin = parameters_.getParameter<double>("resMin");
163  double resMax = parameters_.getParameter<double>("resMax");
164  int resBin = parameters_.getParameter<int>("resBin");
165 
166  double eMin = parameters_.getParameter<double>("eMin");
167  double eMax = parameters_.getParameter<double>("eMax");
168  int eBin = parameters_.getParameter<int>("eBin");
169 
170  double etMin = parameters_.getParameter<double>("etMin");
171  double etMax = parameters_.getParameter<double>("etMax");
172  int etBin = parameters_.getParameter<int>("etBin");
173 
174  double etScale = parameters_.getParameter<double>("etScale");
175 
176  double etaMin = parameters_.getParameter<double>("etaMin");
177  double etaMax = parameters_.getParameter<double>("etaMax");
178  int etaBin = parameters_.getParameter<int>("etaBin");
179  int etaBin2 = parameters_.getParameter<int>("etaBin2");
180 
181  double dEtaMin = parameters_.getParameter<double>("dEtaMin");
182  double dEtaMax = parameters_.getParameter<double>("dEtaMax");
183  int dEtaBin = parameters_.getParameter<int>("dEtaBin");
184 
185  double phiMin = parameters_.getParameter<double>("phiMin");
186  double phiMax = parameters_.getParameter<double>("phiMax");
187  int phiBin = parameters_.getParameter<int>("phiBin");
188 
189  double dPhiMin = parameters_.getParameter<double>("dPhiMin");
190  double dPhiMax = parameters_.getParameter<double>("dPhiMax");
191  int dPhiBin = parameters_.getParameter<int>("dPhiBin");
192 
193  double rMin = parameters_.getParameter<double>("rMin");
194  double rMax = parameters_.getParameter<double>("rMax");
195  int rBin = parameters_.getParameter<int>("rBin");
196 
197  double zMin = parameters_.getParameter<double>("zMin");
198  double zMax = parameters_.getParameter<double>("zMax");
199  int zBin = parameters_.getParameter<int>("zBin");
200 
201  double r9Min = parameters_.getParameter<double>("r9Min");
202  double r9Max = parameters_.getParameter<double>("r9Max");
203  int r9Bin = parameters_.getParameter<int>("r9Bin");
204 
205  double dPhiTracksMin = parameters_.getParameter<double>("dPhiTracksMin");
206  double dPhiTracksMax = parameters_.getParameter<double>("dPhiTracksMax");
207  int dPhiTracksBin = parameters_.getParameter<int>("dPhiTracksBin");
208 
209  double dEtaTracksMin = parameters_.getParameter<double>("dEtaTracksMin");
210  double dEtaTracksMax = parameters_.getParameter<double>("dEtaTracksMax");
211  int dEtaTracksBin = parameters_.getParameter<int>("dEtaTracksBin");
212 
213  double dCotTracksMin = parameters_.getParameter<double>("dCotTracksMin");
214  double dCotTracksMax = parameters_.getParameter<double>("dCotTracksMax");
215  int dCotTracksBin = parameters_.getParameter<int>("dCotTracksBin");
216 
217  double povereMin = parameters_.getParameter<double>("povereMin");
218  double povereMax = parameters_.getParameter<double>("povereMax");
219  int povereBin = parameters_.getParameter<int>("povereBin");
220 
221  double eoverpMin = parameters_.getParameter<double>("eoverpMin");
222  double eoverpMax = parameters_.getParameter<double>("eoverpMax");
223  int eoverpBin = parameters_.getParameter<int>("eoverpBin");
224 
225  double chi2Min = parameters_.getParameter<double>("chi2Min");
226  double chi2Max = parameters_.getParameter<double>("chi2Max");
227 
228  int ggMassBin = parameters_.getParameter<int>("ggMassBin");
229  double ggMassMin = parameters_.getParameter<double>("ggMassMin");
230  double ggMassMax = parameters_.getParameter<double>("ggMassMax");
231 
232  double rMinForXray = parameters_.getParameter<double>("rMinForXray");
233  double rMaxForXray = parameters_.getParameter<double>("rMaxForXray");
234  int rBinForXray = parameters_.getParameter<int>("rBinForXray");
235  double zMinForXray = parameters_.getParameter<double>("zMinForXray");
236  double zMaxForXray = parameters_.getParameter<double>("zMaxForXray");
237  int zBinForXray = parameters_.getParameter<int>("zBinForXray");
238  int zBin2ForXray = parameters_.getParameter<int>("zBin2ForXray");
239 
241  // SC from reco photons
242 
243  iBooker.setCurrentFolder("EgammaV/" + fName_ + "/SimulationInfo");
244 
245  // simulation information about all MC photons found
246  std::string histname = "nOfSimPhotons";
247  if (!isRunCentrally_) {
248  h_nSimPho_[0] = iBooker.book1D(histname, "# of Sim photons per event ", 20, -0.5, 19.5);
249  histname = "SimPhoMotherEt";
250  h_SimPhoMotherEt_[0] = iBooker.book1D(histname, "Sim photon Mother tranverse energy spectrum", etBin, etMin, etMax);
251  h_SimPhoMotherEta_[0] = iBooker.book1D("SimPhoMotherEta", " Sim Photon Mother Eta ", etaBin, etaMin, etaMax);
252  histname = "SimPhoMotherEtMatched";
253  h_SimPhoMotherEt_[1] = iBooker.book1D(
254  histname, "Sim photon matched by a reco Photon: Mother tranverse energy spectrum", etBin, etMin, etMax);
255  h_SimPhoMotherEta_[1] = iBooker.book1D(
256  "SimPhoMotherEtaMatched", " Sim Photon matched by a reco Photon: Mother Eta ", etaBin, etaMin, etaMax);
257  }
258 
259  histname = "h_SimPhoEta";
260  h_SimPho_[0] = iBooker.book1D(histname, " All photons simulated #eta", etaBin, etaMin, etaMax);
261  histname = "h_SimPhoPhi";
262  h_SimPho_[1] = iBooker.book1D(histname, " All photons simulated #phi", phiBin, phiMin, phiMax);
263  histname = "h_SimPhoEt";
264  h_SimPho_[2] = iBooker.book1D(histname, " All photons simulated Et", etBin, etMin, etMax);
265  // Numerators
266  histname = "nOfSimPhotonsMatched";
267  h_nSimPho_[1] = iBooker.book1D(histname, "# of Sim photons matched by a reco Photon per event ", 20, -0.5, 19.5);
268  histname = "h_MatchedSimPhoEta";
269  h_MatchedSimPho_[0] = iBooker.book1D(histname, " Matching photons simulated #eta", etaBin, etaMin, etaMax);
270  histname = "h_MatchedSimPhoPhi";
271  h_MatchedSimPho_[1] = iBooker.book1D(histname, " Matching photons simulated #phi", phiBin, phiMin, phiMax);
272  histname = "h_MatchedSimPhoEt";
273  h_MatchedSimPho_[2] = iBooker.book1D(histname, " Matching photons simulated Et", etBin, etMin, etMax);
274  //
275  histname = "h_MatchedSimPhoBadChEta";
276  h_MatchedSimPhoBadCh_[0] = iBooker.book1D(histname, " Matching photons simulated #eta", etaBin, etaMin, etaMax);
277  histname = "h_MatchedSimPhoBadChPhi";
278  h_MatchedSimPhoBadCh_[1] = iBooker.book1D(histname, " Matching photons simulated #phi", phiBin, phiMin, phiMax);
279  histname = "h_MatchedSimPhoBadChEt";
280  h_MatchedSimPhoBadCh_[2] = iBooker.book1D(histname, " Matching photons simulated Et", etBin, etMin, etMax);
281 
283  histname = "nOfSimConversions";
284  if (!isRunCentrally_) {
285  h_nSimConv_[0] = iBooker.book1D(histname, "# of Sim conversions per event ", 20, -0.5, 19.5);
286  histname = "nOfVisSimConversions";
287  h_nSimConv_[1] = iBooker.book1D(histname, "# of Sim conversions per event ", 20, -0.5, 19.5);
288  }
290  histname = "h_AllSimConvEta";
291  h_AllSimConv_[0] = iBooker.book1D(histname, " All conversions: simulated #eta", etaBin2, etaMin, etaMax);
292  histname = "h_AllSimConvPhi";
293  h_AllSimConv_[1] = iBooker.book1D(histname, " All conversions: simulated #phi", phiBin, phiMin, phiMax);
294  histname = "h_AllSimConvR";
295  h_AllSimConv_[2] = iBooker.book1D(histname, " All conversions: simulated R", rBin, rMin, rMax);
296  histname = "h_AllSimConvZ";
297  h_AllSimConv_[3] = iBooker.book1D(histname, " All conversions: simulated Z", zBin, zMin, zMax);
298  histname = "h_AllSimConvEt";
299  h_AllSimConv_[4] = iBooker.book1D(histname, " All conversions: simulated Et", etBin, etMin, etMax);
300  //
301  histname = "h_VisSimConvEta";
302  h_VisSimConv_[0] = iBooker.book1D(histname, " All vis conversions: simulated #eta", etaBin2, etaMin, etaMax);
303  histname = "h_VisSimConvPhi";
304  h_VisSimConv_[1] = iBooker.book1D(histname, " All vis conversions: simulated #phi", phiBin, phiMin, phiMax);
305  histname = "h_VisSimConvR";
306  h_VisSimConv_[2] = iBooker.book1D(histname, " All vis conversions: simulated R", rBin, rMin, rMax);
307  histname = "h_VisSimConvZ";
308  h_VisSimConv_[3] = iBooker.book1D(histname, " All vis conversions: simulated Z", zBin, zMin, zMax);
309  histname = "h_VisSimConvEt";
310  h_VisSimConv_[4] = iBooker.book1D(histname, " All vis conversions: simulated Et", etBin, etMin, etMax);
312  histname = "h_SimConvOneTracksEta";
313  h_SimConvOneTracks_[0] =
314  iBooker.book1D(histname, " All vis conversions with 1 reco tracks: simulated #eta", etaBin2, etaMin, etaMax);
315  histname = "h_SimConvOneTracksPhi";
316  h_SimConvOneTracks_[1] =
317  iBooker.book1D(histname, " All vis conversions with 1 reco tracks: simulated #phi", phiBin, phiMin, phiMax);
318  histname = "h_SimConvOneTracksR";
319  h_SimConvOneTracks_[2] =
320  iBooker.book1D(histname, " All vis conversions with 1 reco tracks: simulated R", rBin, rMin, rMax);
321  histname = "h_SimConvOneTracksZ";
322  h_SimConvOneTracks_[3] =
323  iBooker.book1D(histname, " All vis conversions with 1 reco tracks: simulated Z", zBin, zMin, zMax);
324  histname = "h_SimConvOneTracksEt";
325  h_SimConvOneTracks_[4] =
326  iBooker.book1D(histname, " All vis conversions with 1 reco tracks: simulated Et", etBin, etMin, etMax);
327  //
328  histname = "h_SimConvTwoMTracksEta";
329  h_SimConvTwoMTracks_[0] = iBooker.book1D(
330  histname, " All vis conversions with 2 reco-matching tracks: simulated #eta", etaBin2, etaMin, etaMax);
331  histname = "h_SimConvTwoMTracksPhi";
332  h_SimConvTwoMTracks_[1] = iBooker.book1D(
333  histname, " All vis conversions with 2 reco-matching tracks: simulated #phi", phiBin, phiMin, phiMax);
334  histname = "h_SimConvTwoMTracksR";
335  h_SimConvTwoMTracks_[2] =
336  iBooker.book1D(histname, " All vis conversions with 2 reco-matching tracks: simulated R", rBin, rMin, rMax);
337  histname = "h_SimConvTwoMTracksZ";
338  h_SimConvTwoMTracks_[3] =
339  iBooker.book1D(histname, " All vis conversions with 2 reco-matching tracks: simulated Z", zBin, zMin, zMax);
340  histname = "h_SimConvTwoMTracksEt";
341  h_SimConvTwoMTracks_[4] =
342  iBooker.book1D(histname, " All vis conversions with 2 reco-matching tracks: simulated Et", etBin, etMin, etMax);
343  //
344  histname = "h_SimConvTwoTracksEta";
345  h_SimConvTwoTracks_[0] =
346  iBooker.book1D(histname, " All vis conversions with 2 reco tracks: simulated #eta", etaBin2, etaMin, etaMax);
347  histname = "h_SimConvTwoTracksPhi";
348  h_SimConvTwoTracks_[1] =
349  iBooker.book1D(histname, " All vis conversions with 2 reco tracks: simulated #phi", phiBin, phiMin, phiMax);
350  histname = "h_SimConvTwoTracksR";
351  h_SimConvTwoTracks_[2] =
352  iBooker.book1D(histname, " All vis conversions with 2 reco tracks: simulated R", rBin, rMin, rMax);
353  histname = "h_SimConvTwoTracksZ";
354  h_SimConvTwoTracks_[3] =
355  iBooker.book1D(histname, " All vis conversions with 2 reco tracks: simulated Z", zBin, zMin, zMax);
356  histname = "h_SimConvTwoTracksEt";
357  h_SimConvTwoTracks_[4] =
358  iBooker.book1D(histname, " All vis conversions with 2 reco tracks: simulated Et", etBin, etMin, etMax);
359  //
360  histname = "h_SimConvOneMTracksEta";
361  h_SimConvOneMTracks_[0] = iBooker.book1D(
362  histname, " All vis conversions with 1 reco-matching tracks: simulated #eta", etaBin2, etaMin, etaMax);
363  histname = "h_SimConvOneMTracksPhi";
364  h_SimConvOneMTracks_[1] = iBooker.book1D(
365  histname, " All vis conversions with 1 reco-matching tracks: simulated #phi", phiBin, phiMin, phiMax);
366  histname = "h_SimConvOneMTracksR";
367  h_SimConvOneMTracks_[2] =
368  iBooker.book1D(histname, " All vis conversions with 1 reco-matching tracks: simulated R", rBin, rMin, rMax);
369  histname = "h_SimConvOneMTracksZ";
370  h_SimConvOneMTracks_[3] =
371  iBooker.book1D(histname, " All vis conversions with 1 reco-matching tracks: simulated Z", zBin, zMin, zMax);
372  histname = "h_SimConvOneMTracksEt";
373  h_SimConvOneMTracks_[4] =
374  iBooker.book1D(histname, " All vis conversions with 1 reco-matching tracks: simulated Et", etBin, etMin, etMax);
375  //
376  histname = "h_SimConvTwoMTracksEtaAndVtxPGT0";
377  h_SimConvTwoMTracksAndVtxPGT0_[0] = iBooker.book1D(
378  histname, " All vis conversions with 2 reco-matching tracks + vertex: simulated #eta", etaBin2, etaMin, etaMax);
379  histname = "h_SimConvTwoMTracksPhiAndVtxPGT0";
380  h_SimConvTwoMTracksAndVtxPGT0_[1] = iBooker.book1D(
381  histname, " All vis conversions with 2 reco-matching tracks + vertex: simulated #phi", phiBin, phiMin, phiMax);
382  histname = "h_SimConvTwoMTracksRAndVtxPGT0";
383  h_SimConvTwoMTracksAndVtxPGT0_[2] = iBooker.book1D(
384  histname, " All vis conversions with 2 reco-matching tracks + vertex: simulated R", rBin, rMin, rMax);
385  histname = "h_SimConvTwoMTracksZAndVtxPGT0";
386  h_SimConvTwoMTracksAndVtxPGT0_[3] = iBooker.book1D(
387  histname, " All vis conversions with 2 reco-matching tracks + vertex: simulated Z", zBin, zMin, zMax);
388  histname = "h_SimConvTwoMTracksEtAndVtxPGT0";
389  h_SimConvTwoMTracksAndVtxPGT0_[4] = iBooker.book1D(
390  histname, " All vis conversions with 2 reco-matching tracks + vertex: simulated Et", etBin, etMin, etMax);
391  //
392  histname = "h_SimConvTwoMTracksEtaAndVtxPGT0005";
393  h_SimConvTwoMTracksAndVtxPGT0005_[0] = iBooker.book1D(
394  histname, " All vis conversions with 2 reco-matching tracks + vertex: simulated #eta", etaBin2, etaMin, etaMax);
395  histname = "h_SimConvTwoMTracksPhiAndVtxPGT0005";
396  h_SimConvTwoMTracksAndVtxPGT0005_[1] = iBooker.book1D(
397  histname, " All vis conversions with 2 reco-matching tracks + vertex: simulated #phi", phiBin, phiMin, phiMax);
398  histname = "h_SimConvTwoMTracksRAndVtxPGT0005";
399  h_SimConvTwoMTracksAndVtxPGT0005_[2] = iBooker.book1D(
400  histname, " All vis conversions with 2 reco-matching tracks + vertex: simulated R", rBin, rMin, rMax);
401  histname = "h_SimConvTwoMTracksZAndVtxPGT0005";
402  h_SimConvTwoMTracksAndVtxPGT0005_[3] = iBooker.book1D(
403  histname, " All vis conversions with 2 reco-matching tracks + vertex: simulated Z", zBin, zMin, zMax);
404  histname = "h_SimConvTwoMTracksEtAndVtxPGT0005";
405  h_SimConvTwoMTracksAndVtxPGT0005_[4] = iBooker.book1D(
406  histname, " All vis conversions with 2 reco-matching tracks + vertex: simulated Et", etBin, etMin, etMax);
407 
408  if (!isRunCentrally_) {
409  h_SimConvEtaPix_[0] = iBooker.book1D("simConvEtaPix", " sim converted Photon Eta: Pix ", etaBin, etaMin, etaMax);
410  h_simTkPt_ = iBooker.book1D("simTkPt", "Sim conversion tracks pt ", etBin * 3, 0., etMax);
411  h_simTkEta_ = iBooker.book1D("simTkEta", "Sim conversion tracks eta ", etaBin, etaMin, etaMax);
412  h_simConvVtxRvsZ_[0] = iBooker.book2D("simConvVtxRvsZAll",
413  " Photon Sim conversion vtx position",
414  zBinForXray,
415  zMinForXray,
416  zMaxForXray,
417  rBinForXray,
418  rMinForXray,
419  rMaxForXray);
420  h_simConvVtxRvsZ_[1] = iBooker.book2D("simConvVtxRvsZBarrel",
421  " Photon Sim conversion vtx position",
422  zBinForXray,
423  zMinForXray,
424  zMaxForXray,
425  rBinForXray,
426  rMinForXray,
427  rMaxForXray);
428  h_simConvVtxRvsZ_[2] = iBooker.book2D("simConvVtxRvsZEndcap",
429  " Photon Sim conversion vtx position",
430  zBin2ForXray,
431  zMinForXray,
432  zMaxForXray,
433  rBinForXray,
434  rMinForXray,
435  rMaxForXray);
436  h_simConvVtxYvsX_ = iBooker.book2D(
437  "simConvVtxYvsXTrkBarrel", " Photon Sim conversion vtx position, (x,y) eta<1 ", 100, -80., 80., 100, -80., 80.);
438  }
439 
441  histname = "h_SimJetEta";
442  h_SimJet_[0] = iBooker.book1D(histname, " Jet bkg simulated #eta", etaBin, etaMin, etaMax);
443  histname = "h_SimJetPhi";
444  h_SimJet_[1] = iBooker.book1D(histname, " Jet bkg simulated #phi", phiBin, phiMin, phiMax);
445  histname = "h_SimJetEt";
446  h_SimJet_[2] = iBooker.book1D(histname, " Jet bkg simulated Et", etBin, etMin, etMax);
447  //
448  histname = "h_MatchedSimJetEta";
449  h_MatchedSimJet_[0] = iBooker.book1D(histname, " Matching jet simulated #eta", etaBin, etaMin, etaMax);
450  histname = "h_MatchedSimJetPhi";
451  h_MatchedSimJet_[1] = iBooker.book1D(histname, " Matching jet simulated #phi", phiBin, phiMin, phiMax);
452  histname = "h_MatchedSimJetEt";
453  h_MatchedSimJet_[2] = iBooker.book1D(histname, " Matching jet simulated Et", etBin, etMin, etMax);
454  //
455  histname = "h_MatchedSimJetBadChEta";
456  h_MatchedSimJetBadCh_[0] = iBooker.book1D(histname, " Matching jet simulated #eta", etaBin, etaMin, etaMax);
457  histname = "h_MatchedSimJetBadChPhi";
458  h_MatchedSimJetBadCh_[1] = iBooker.book1D(histname, " Matching jet simulated #phi", phiBin, phiMin, phiMax);
459  histname = "h_MatchedSimJetBadChEt";
460  h_MatchedSimJetBadCh_[2] = iBooker.book1D(histname, " Matching jet simulated Et", etBin, etMin, etMax);
461 
462  iBooker.setCurrentFolder("EgammaV/" + fName_ + "/Background");
463 
464  histname = "nOfPhotons";
465  h_nPho_ = iBooker.book1D(histname, "# of Reco photons per event ", 20, -0.5, 19.5);
466 
467  h_scBkgEta_ = iBooker.book1D("scBkgEta", " SC Bkg Eta ", etaBin, etaMin, etaMax);
468  h_scBkgPhi_ = iBooker.book1D("scBkgPhi", " SC Bkg Phi ", phiBin, phiMin, phiMax);
469  //
470  h_phoBkgEta_ = iBooker.book1D("phoBkgEta", " Photon Bkg Eta ", etaBin, etaMin, etaMax);
471  h_phoBkgPhi_ = iBooker.book1D("phoBkgPhi", " Photon Bkg Phi ", phiBin, phiMin, phiMax);
472  //
473  h_phoBkgDEta_ = iBooker.book1D("phoBkgDEta", " Photon Eta(rec)-Eta(true) ", dEtaBin, dEtaMin, dEtaMax);
474  h_phoBkgDPhi_ = iBooker.book1D("phoBkgDPhi", " Photon Phi(rec)-Phi(true) ", dPhiBin, dPhiMin, dPhiMax);
475  //
476  histname = "phoBkgE";
477  h_phoBkgE_[0] = iBooker.book1D(histname + "All", " Photon Bkg Energy: All ecal ", eBin, eMin, eMax);
478  h_phoBkgE_[1] = iBooker.book1D(histname + "Barrel", " Photon Bkg Energy: barrel ", eBin, eMin, eMax);
479  h_phoBkgE_[2] = iBooker.book1D(histname + "Endcap", " Photon Bkg Energy: Endcap ", eBin, eMin, eMax);
480  //
481  histname = "phoBkgEt";
482  h_phoBkgEt_[0] = iBooker.book1D(histname + "All", " Photon Bkg Transverse Energy: All ecal ", etBin, etMin, etMax);
483  h_phoBkgEt_[1] = iBooker.book1D(histname + "Barrel", " Photon Bkg Transverse Energy: Barrel ", etBin, etMin, etMax);
484  h_phoBkgEt_[2] = iBooker.book1D(histname + "Endcap", " Photon BkgTransverse Energy: Endcap ", etBin, etMin, etMax);
485 
486  //
487  histname = "scBkgE";
488  h_scBkgE_[0] = iBooker.book1D(histname + "All", " SC bkg Energy: All Ecal ", eBin, eMin, eMax);
489  h_scBkgE_[1] = iBooker.book1D(histname + "Barrel", " SC bkg Energy: Barrel ", eBin, eMin, eMax);
490  h_scBkgE_[2] = iBooker.book1D(histname + "Endcap", " SC bkg Energy: Endcap ", eBin, eMin, eMax);
491  histname = "scBkgEt";
492  h_scBkgEt_[0] = iBooker.book1D(histname + "All", " SC bkg Et: All Ecal ", eBin, eMin, eMax);
493  h_scBkgEt_[1] = iBooker.book1D(histname + "Barrel", " SC bkg Et: Barrel ", eBin, eMin, eMax);
494  h_scBkgEt_[2] = iBooker.book1D(histname + "Endcap", " SC bkg Et: Endcap ", eBin, eMin, eMax);
495  //
496  histname = "r9Bkg";
497  h_r9Bkg_[0] = iBooker.book1D(histname + "All", " r9 bkg: All Ecal", r9Bin, r9Min, r9Max);
498  h_r9Bkg_[1] = iBooker.book1D(histname + "Barrel", " r9 bkg: Barrel ", r9Bin, r9Min, r9Max);
499  h_r9Bkg_[2] = iBooker.book1D(histname + "Endcap", " r9 bkg: Endcap ", r9Bin, r9Min, r9Max);
500  //
501  histname = "R9VsEtaBkg";
502  if (!isRunCentrally_)
503  h2_r9VsEtaBkg_ =
504  iBooker.book2D(histname + "All", " Bkg r9 vs #eta: all Ecal ", etaBin2, etaMin, etaMax, 100, 0., 1.1);
505  //
506  histname = "R9VsEtBkg";
507  if (!isRunCentrally_)
508  h2_r9VsEtBkg_ =
509  iBooker.book2D(histname + "All", " Bkg photons r9 vs Et: all Ecal ", etBin, etMin, etMax, 100, 0., 1.1);
510  //
511  histname = "r1Bkg";
512  h_r1Bkg_[0] = iBooker.book1D(histname + "All", " Bkg photon e1x5/e5x5: All Ecal", r9Bin, r9Min, r9Max);
513  h_r1Bkg_[1] = iBooker.book1D(histname + "Barrel", " Bkg photon e1x5/e5x5: Barrel ", r9Bin, r9Min, r9Max);
514  h_r1Bkg_[2] = iBooker.book1D(histname + "Endcap", " Bkg photon e1x5/e5x5: Endcap ", r9Bin, r9Min, r9Max);
515  //
516  histname = "R1VsEtaBkg";
517  if (!isRunCentrally_)
518  h2_r1VsEtaBkg_ = iBooker.book2D(
519  histname + "All", " Bkg photons e1x5/e5x5 vs #eta: all Ecal ", etaBin2, etaMin, etaMax, 100, 0., 1.1);
520  histname = "pR1VsEtaBkg";
521  if (!isRunCentrally_)
522  p_r1VsEtaBkg_ = iBooker.bookProfile(
523  histname + "All", " Bkg photons e1x5/e5x5 vs #eta: all Ecal ", etaBin2, etaMin, etaMax, 100, 0., 1.1);
524  //
525  histname = "R1VsEtBkg";
526  if (!isRunCentrally_)
527  h2_r1VsEtBkg_ =
528  iBooker.book2D(histname + "All", " Bkg photons e1x5/e5x5 vs Et: all Ecal ", etBin, etMin, etMax, 100, 0., 1.1);
529  histname = "pR1VsEtBkg";
530  if (!isRunCentrally_)
531  p_r1VsEtBkg_ = iBooker.bookProfile(
532  histname + "All", " Bkg photons e2x5/e5x5 vs Et: all Ecal ", etBin, etMin, etMax, 100, 0., 1.1);
533  //
534  histname = "r2Bkg";
535  h_r2Bkg_[0] = iBooker.book1D(histname + "All", " Bkg photon e2x5/e5x5: All Ecal", r9Bin, r9Min, r9Max);
536  h_r2Bkg_[1] = iBooker.book1D(histname + "Barrel", " Bkg photon e2x5/e5x5: Barrel ", r9Bin, r9Min, r9Max);
537  h_r2Bkg_[2] = iBooker.book1D(histname + "Endcap", " Bkg photon e2x5/e5x5: Endcap ", r9Bin, r9Min, r9Max);
538  //
539  histname = "R2VsEtaBkg";
540  if (!isRunCentrally_)
541  h2_r2VsEtaBkg_ = iBooker.book2D(
542  histname + "All", " Bkg photons e2x5/e5x5 vs #eta: all Ecal ", etaBin2, etaMin, etaMax, 100, 0., 1.1);
543  histname = "pR2VsEtaBkg";
544  if (!isRunCentrally_)
545  p_r2VsEtaBkg_ = iBooker.bookProfile(
546  histname + "All", " Bkg photons e2x5/e5x5 vs #eta: all Ecal ", etaBin2, etaMin, etaMax, 100, 0., 1.1);
547  //
548  histname = "R2VsEtBkg";
549  if (!isRunCentrally_)
550  h2_r2VsEtBkg_ =
551  iBooker.book2D(histname + "All", " Bkg photons e2x5/e5x5 vs Et: all Ecal ", etBin, etMin, etMax, 100, 0., 1.1);
552  histname = "pR2VsEtBkg";
553  if (!isRunCentrally_)
554  p_r2VsEtBkg_ = iBooker.bookProfile(
555  histname + "All", " Bkg photons e2x5/e5x5 vs Et: all Ecal ", etBin, etMin, etMax, 100, 0., 1.1);
556 
557  histname = "sigmaIetaIetaBkg";
558  h_sigmaIetaIetaBkg_[0] = iBooker.book1D(histname + "All", "Bkg sigmaIetaIeta: All Ecal", 100, 0., 0.1);
559  h_sigmaIetaIetaBkg_[1] = iBooker.book1D(histname + "Barrel", "Bkg sigmaIetaIeta: Barrel ", 100, 0., 0.05);
560  h_sigmaIetaIetaBkg_[2] = iBooker.book1D(histname + "Endcap", "Bkg sigmaIetaIeta: Endcap ", 100, 0., 0.1);
561  //
562  histname = "sigmaIetaIetaVsEtaBkg";
563  if (!isRunCentrally_)
564  h2_sigmaIetaIetaVsEtaBkg_ = iBooker.book2D(
565  histname + "All", " Bkg photons sigmaIetaIeta vs #eta: all Ecal ", etaBin2, etaMin, etaMax, 100, 0., 0.1);
566  histname = "pSigmaIetaIetaVsEtaBkg";
567  if (!isRunCentrally_)
568  p_sigmaIetaIetaVsEtaBkg_ = iBooker.bookProfile(
569  histname + "All", " Bkg photons sigmaIetaIeta vs #eta: all Ecal ", etaBin2, etaMin, etaMax, 100, 0., 0.1);
570  //
571  histname = "sigmaIetaIetaVsEtBkg";
572  if (!isRunCentrally_)
573  h2_sigmaIetaIetaVsEtBkg_[0] = iBooker.book2D(
574  histname + "All", " Bkg photons sigmaIetaIeta vs Et: all Ecal ", etBin, etMin, etMax, 100, 0., 0.1);
575  if (!isRunCentrally_)
576  h2_sigmaIetaIetaVsEtBkg_[1] = iBooker.book2D(
577  histname + "Barrel", " Bkg photons sigmaIetaIeta vs Et: all Ecal ", etBin, etMin, etMax, 100, 0., 0.1);
578  if (!isRunCentrally_)
579  h2_sigmaIetaIetaVsEtBkg_[2] = iBooker.book2D(
580  histname + "Endcap", " Bkg photons sigmaIetaIeta vs Et: all Ecal ", etBin, etMin, etMax, 100, 0., 0.1);
581  //
582  histname = "pSigmaIetaIetaVsEtBkg";
583  if (!isRunCentrally_)
584  p_sigmaIetaIetaVsEtBkg_[0] = iBooker.bookProfile(
585  histname + "All", " Bkg photons sigmaIetaIeta vs Et: all Ecal ", etBin, etMin, etMax, 100, 0., 0.1);
586  if (!isRunCentrally_)
587  p_sigmaIetaIetaVsEtBkg_[1] = iBooker.bookProfile(
588  histname + "Barrel", " Bkg photons sigmaIetaIeta vs Et: all Ecal ", etBin, etMin, etMax, 100, 0., 0.1);
589  if (!isRunCentrally_)
590  p_sigmaIetaIetaVsEtBkg_[2] = iBooker.bookProfile(
591  histname + "Endcap", " Bkg photons sigmaIetaIeta vs Et: all Ecal ", etBin, etMin, etMax, 100, 0., 0.1);
592  //
593  histname = "hOverEBkg";
594  h_hOverEBkg_[0] = iBooker.book1D(histname + "All", "H/E bkg: All Ecal", 100, 0., 1.);
595  h_hOverEBkg_[1] = iBooker.book1D(histname + "Barrel", "H/E bkg: Barrel ", 100, 0., 1.);
596  h_hOverEBkg_[2] = iBooker.book1D(histname + "Endcap", "H/E bkg: Endcap ", 100, 0., 1.);
597  //
598  histname = "pHOverEVsEtaBkg";
599  if (!isRunCentrally_)
600  p_hOverEVsEtaBkg_ =
601  iBooker.bookProfile(histname + "All", " Bkg H/E vs #eta: all Ecal ", etaBin2, etaMin, etaMax, 100, 0., 0.1);
602  histname = "pHOverEVsEtBkg";
603  if (!isRunCentrally_)
604  p_hOverEVsEtBkg_ =
605  iBooker.bookProfile(histname + "All", " Bkg photons H/E vs Et: all Ecal ", etBin, etMin, etMax, 100, 0., 0.1);
606  if (!isRunCentrally_) {
607  histname = "hOverEVsEtaBkg";
608  h2_hOverEVsEtaBkg_ =
609  iBooker.book2D(histname + "All", " Bkg H/E vs #eta: all Ecal ", etaBin2, etaMin, etaMax, 100, 0., 0.1);
610  //
611  histname = "hOverEVsEtBkg";
612  h2_hOverEVsEtBkg_ =
613  iBooker.book2D(histname + "All", " Bkg photons H/E vs Et: all Ecal ", etBin, etMin, etMax, 100, 0., 0.1);
614  }
615  //
616  histname = "ecalRecHitSumEtConeDR04Bkg";
617  h_ecalRecHitSumEtConeDR04Bkg_[0] =
618  iBooker.book1D(histname + "All", "bkg ecalRecHitSumEtDR04: All Ecal", etBin, etMin, 50.);
619  h_ecalRecHitSumEtConeDR04Bkg_[1] =
620  iBooker.book1D(histname + "Barrel", "bkg ecalRecHitSumEtDR04: Barrel ", etBin, etMin, 50.);
621  h_ecalRecHitSumEtConeDR04Bkg_[2] =
622  iBooker.book1D(histname + "Endcap", "bkg ecalRecHitSumEtDR04: Endcap ", etBin, etMin, 50.);
623  //
624  if (!isRunCentrally_) {
625  histname = "ecalRecHitSumEtConeDR04VsEtaBkg";
626  h2_ecalRecHitSumEtConeDR04VsEtaBkg_ = iBooker.book2D(histname + "All",
627  " bkg ecalRecHitSumEtDR04 vs #eta: all Ecal ",
628  etaBin2,
629  etaMin,
630  etaMax,
631  etBin,
632  etMin,
633  etMax * etScale);
634  histname = "ecalRecHitSumEtConeDR04VsEtBkg";
635  h2_ecalRecHitSumEtConeDR04VsEtBkg_[0] = iBooker.book2D(histname + "All",
636  " Bkg ecalRecHitSumEtDR04 vs Et: all Ecal ",
637  etBin,
638  etMin,
639  etMax,
640  etBin,
641  etMin,
642  etMax * etScale);
643  h2_ecalRecHitSumEtConeDR04VsEtBkg_[1] = iBooker.book2D(histname + "Barrel",
644  " Bkg ecalRecHitSumEtDR04 vs Et: Barrel ",
645  etBin,
646  etMin,
647  etMax,
648  etBin,
649  etMin,
650  etMax * etScale);
651  h2_ecalRecHitSumEtConeDR04VsEtBkg_[2] = iBooker.book2D(histname + "Endcap",
652  " Bkg ecalRecHitSumEtDR04 vs Et: Endcap ",
653  etBin,
654  etMin,
655  etMax,
656  etBin,
657  etMin,
658  etMax * etScale);
659  histname = "hcalTowerSumEtConeDR04VsEtaBkg";
660  h2_hcalTowerSumEtConeDR04VsEtaBkg_ = iBooker.book2D(histname + "All",
661  " bkg hcalTowerSumEtDR04 vs #eta: all Ecal ",
662  etaBin2,
663  etaMin,
664  etaMax,
665  etBin,
666  etMin,
667  etMax * etScale);
668  histname = "hcalTowerSumEtConeDR04VsEtBkg";
669  h2_hcalTowerSumEtConeDR04VsEtBkg_[0] = iBooker.book2D(histname + "All",
670  " Bkg hcalTowerSumEtDR04 vs Et: all Ecal ",
671  etBin,
672  etMin,
673  etMax,
674  etBin,
675  etMin,
676  etMax * etScale);
677  h2_hcalTowerSumEtConeDR04VsEtBkg_[1] = iBooker.book2D(histname + "Barrel",
678  " Bkg hcalTowerSumEtDR04 vs Et: Barrel ",
679  etBin,
680  etMin,
681  etMax,
682  etBin,
683  etMin,
684  etMax * etScale);
685  h2_hcalTowerSumEtConeDR04VsEtBkg_[2] = iBooker.book2D(histname + "Endcap",
686  " Bkg hcalTowerSumEtDR04 vs Et: Endcap ",
687  etBin,
688  etMin,
689  etMax,
690  etBin,
691  etMin,
692  etMax * etScale);
693  }
694 
695  histname = "pEcalRecHitSumEtConeDR04VsEtaBkg";
696  if (!isRunCentrally_)
697  p_ecalRecHitSumEtConeDR04VsEtaBkg_ = iBooker.bookProfile(histname + "All",
698  "bkg photons ecalRecHitSumEtDR04 vs #eta: all Ecal ",
699  etaBin2,
700  etaMin,
701  etaMax,
702  etBin,
703  etMin,
704  etMax * etScale,
705  "");
706  //
707  histname = "pEcalRecHitSumEtConeDR04VsEtBkg";
708  if (!isRunCentrally_)
709  p_ecalRecHitSumEtConeDR04VsEtBkg_[0] = iBooker.bookProfile(histname + "All",
710  "Bkg ecalRecHitSumEtDR04 vs Et: all Ecal ",
711  etBin,
712  etMin,
713  etMax,
714  etBin,
715  etMin,
716  etMax * etScale,
717  "");
718  if (!isRunCentrally_)
719  p_ecalRecHitSumEtConeDR04VsEtBkg_[1] = iBooker.bookProfile(histname + "Barrel",
720  "Bkg ecalRecHitSumEtDR04 vs Et: all Ecal ",
721  etBin,
722  etMin,
723  etMax,
724  etBin,
725  etMin,
726  etMax * etScale,
727  "");
728  if (!isRunCentrally_)
729  p_ecalRecHitSumEtConeDR04VsEtBkg_[2] = iBooker.bookProfile(histname + "Endcap",
730  "Bkg ecalRecHitSumEtDR04 vs Et: all Ecal ",
731  etBin,
732  etMin,
733  etMax,
734  etBin,
735  etMin,
736  etMax * etScale,
737  "");
738  //
739  histname = "hcalTowerSumEtConeDR04Bkg";
740  h_hcalTowerSumEtConeDR04Bkg_[0] =
741  iBooker.book1D(histname + "All", "bkg hcalTowerSumEtDR04: All Ecal", etBin, etMin, 20.);
742  h_hcalTowerSumEtConeDR04Bkg_[1] =
743  iBooker.book1D(histname + "Barrel", "bkg hcalTowerSumEtDR04: Barrel ", etBin, etMin, 20.);
744  h_hcalTowerSumEtConeDR04Bkg_[2] =
745  iBooker.book1D(histname + "Endcap", "bkg hcalTowerSumEtDR04: Endcap ", etBin, etMin, 20.);
746  //
747  histname = "pHcalTowerSumEtConeDR04VsEtaBkg";
748  if (!isRunCentrally_)
749  p_hcalTowerSumEtConeDR04VsEtaBkg_ = iBooker.bookProfile(histname + "All",
750  "bkg photons hcalTowerSumEtDR04 vs #eta: all Ecal ",
751  etaBin2,
752  etaMin,
753  etaMax,
754  etBin,
755  etMin,
756  etMax * etScale,
757  "");
758  //
759  histname = "pHcalTowerSumEtConeDR04VsEtBkg";
760  if (!isRunCentrally_)
761  p_hcalTowerSumEtConeDR04VsEtBkg_[0] = iBooker.bookProfile(histname + "All",
762  "Bkg hcalTowerSumEtDR04 vs Et: all Ecal ",
763  etBin,
764  etMin,
765  etMax,
766  etBin,
767  etMin,
768  etMax * etScale,
769  "");
770  if (!isRunCentrally_)
771  p_hcalTowerSumEtConeDR04VsEtBkg_[1] = iBooker.bookProfile(histname + "Barrel",
772  "Bkg hcalTowerSumEtDR04 vs Et: all Ecal ",
773  etBin,
774  etMin,
775  etMax,
776  etBin,
777  etMin,
778  etMax * etScale,
779  "");
780  if (!isRunCentrally_)
781  p_hcalTowerSumEtConeDR04VsEtBkg_[2] = iBooker.bookProfile(histname + "Endcap",
782  "Bkg hcalTowerSumEtDR04 vs Et: all Ecal ",
783  etBin,
784  etMin,
785  etMax,
786  etBin,
787  etMin,
788  etMax * etScale,
789  "");
790  //
791  histname = "isoTrkSolidConeDR04Bkg";
792  h_isoTrkSolidConeDR04Bkg_[0] =
793  iBooker.book1D(histname + "All", "isoTrkSolidConeDR04 Bkg: All Ecal", etBin, etMin, etMax * 0.1);
794  h_isoTrkSolidConeDR04Bkg_[1] =
795  iBooker.book1D(histname + "Barrel", "isoTrkSolidConeDR04 Bkg: Barrel ", etBin, etMin, etMax * 0.1);
796  h_isoTrkSolidConeDR04Bkg_[2] =
797  iBooker.book1D(histname + "Endcap", "isoTrkSolidConeDR04 Bkg: Endcap ", etBin, etMin, etMax * 0.1);
798  //
799  histname = "isoTrkSolidConeDR04VsEtaBkg";
800  if (!isRunCentrally_)
801  h2_isoTrkSolidConeDR04VsEtaBkg_ = iBooker.book2D(histname + "All",
802  " Bkg photons isoTrkSolidConeDR04 vs #eta: all Ecal ",
803  etaBin2,
804  etaMin,
805  etaMax,
806  etBin,
807  etMin,
808  etMax * 0.1);
809  histname = "pIsoTrkSolidConeDR04VsEtaBkg";
810  if (!isRunCentrally_)
811  p_isoTrkSolidConeDR04VsEtaBkg_ = iBooker.bookProfile(histname + "All",
812  " Bkg photons isoTrkSolidConeDR04 vs #eta: all Ecal ",
813  etaBin2,
814  etaMin,
815  etaMax,
816  etBin,
817  etMin,
818  etMax * 0.1);
819  //
820  histname = "isoTrkSolidConeDR04VsEtBkg";
821  if (!isRunCentrally_)
822  h2_isoTrkSolidConeDR04VsEtBkg_[0] = iBooker.book2D(histname + "All",
823  " Bkg photons isoTrkSolidConeDR04 vs Et: all Ecal ",
824  etBin,
825  etMin,
826  etMax,
827  etBin,
828  etMin,
829  etMax * 0.1);
830  if (!isRunCentrally_)
831  h2_isoTrkSolidConeDR04VsEtBkg_[1] = iBooker.book2D(histname + "Barrel",
832  " Bkg photons isoTrkSolidConeDR04 vs Et: all Ecal ",
833  etBin,
834  etMin,
835  etMax,
836  etBin,
837  etMin,
838  etMax * 0.1);
839  if (!isRunCentrally_)
840  h2_isoTrkSolidConeDR04VsEtBkg_[2] = iBooker.book2D(histname + "Endcap",
841  " Bkg photons isoTrkSolidConeDR04 vs Et: all Ecal ",
842  etBin,
843  etMin,
844  etMax,
845  etBin,
846  etMin,
847  etMax * 0.1);
848  histname = "pIsoTrkSolidConeDR04VsEtBkg";
849  if (!isRunCentrally_)
850  p_isoTrkSolidConeDR04VsEtBkg_[0] = iBooker.bookProfile(histname + "All",
851  " Bkg photons isoTrkSolidConeDR04 vs Et: all Ecal ",
852  etBin,
853  etMin,
854  etMax,
855  etBin,
856  etMin,
857  etMax * 0.1);
858  if (!isRunCentrally_)
859  p_isoTrkSolidConeDR04VsEtBkg_[1] = iBooker.bookProfile(histname + "Barrel",
860  " Bkg photons isoTrkSolidConeDR04 vs Et: all Ecal ",
861  etBin,
862  etMin,
863  etMax,
864  etBin,
865  etMin,
866  etMax * 0.1);
867  if (!isRunCentrally_)
868  p_isoTrkSolidConeDR04VsEtBkg_[2] = iBooker.bookProfile(histname + "Endcap",
869  " Bkg photons isoTrkSolidConeDR04 vs Et: all Ecal ",
870  etBin,
871  etMin,
872  etMax,
873  etBin,
874  etMin,
875  etMax * 0.1);
876  //
877  histname = "nTrkSolidConeDR04Bkg";
878  h_nTrkSolidConeDR04Bkg_[0] = iBooker.book1D(histname + "All", "Bkg nTrkSolidConeDR04: All Ecal", 20, 0., 20);
879  h_nTrkSolidConeDR04Bkg_[1] = iBooker.book1D(histname + "Barrel", "Bkg nTrkSolidConeDR04: Barrel ", 20, 0., 20);
880  h_nTrkSolidConeDR04Bkg_[2] = iBooker.book1D(histname + "Endcap", "Bkg nTrkSolidConeDR04: Endcap ", 20, 0., 20);
881  //
882  histname = "nTrkSolidConeDR04VsEtaBkg";
883  if (!isRunCentrally_)
884  h2_nTrkSolidConeDR04VsEtaBkg_ = iBooker.book2D(
885  histname + "All", " Bkg photons nTrkSolidConeDR04 vs #eta: all Ecal ", etaBin2, etaMin, etaMax, 20, 0., 20);
886  histname = "p_nTrkSolidConeDR04VsEtaBkg";
887  if (!isRunCentrally_)
888  p_nTrkSolidConeDR04VsEtaBkg_ = iBooker.bookProfile(
889  histname + "All", " Bkg photons nTrkSolidConeDR04 vs #eta: all Ecal ", etaBin2, etaMin, etaMax, 20, 0., 20);
890  //
891  histname = "nTrkSolidConeDR04VsEtBkg";
892  if (!isRunCentrally_)
893  h2_nTrkSolidConeDR04VsEtBkg_[0] = iBooker.book2D(
894  histname + "All", "Bkg photons nTrkSolidConeDR04 vs Et: all Ecal ", etBin, etMin, etMax, 20, 0., 20);
895  if (!isRunCentrally_)
896  h2_nTrkSolidConeDR04VsEtBkg_[1] = iBooker.book2D(
897  histname + "Barrel", "Bkg photons nTrkSolidConeDR04 vs Et: all Ecal ", etBin, etMin, etMax, 20, 0., 20);
898  if (!isRunCentrally_)
899  h2_nTrkSolidConeDR04VsEtBkg_[2] = iBooker.book2D(
900  histname + "Endcap", "Bkg photons nTrkSolidConeDR04 vs Et: all Ecal ", etBin, etMin, etMax, 20, 0., 20);
901  //
902  histname = "pnTrkSolidConeDR04VsEtBkg";
903  if (!isRunCentrally_)
904  p_nTrkSolidConeDR04VsEtBkg_[0] = iBooker.bookProfile(
905  histname + "All", "Bkg photons nTrkSolidConeDR04 vs Et: all Ecal ", etBin, etMin, etMax, 20, 0., 20);
906  if (!isRunCentrally_)
907  p_nTrkSolidConeDR04VsEtBkg_[1] = iBooker.bookProfile(
908  histname + "Barrel", "Bkg photons nTrkSolidConeDR04 vs Et: all Ecal ", etBin, etMin, etMax, 20, 0., 20);
909  if (!isRunCentrally_)
910  p_nTrkSolidConeDR04VsEtBkg_[2] = iBooker.bookProfile(
911  histname + "Endcap", "Bkg photons nTrkSolidConeDR04 vs Et: all Ecal ", etBin, etMin, etMax, 20, 0., 20);
912  //
913  h_convEtaBkg_ = iBooker.book1D("convEtaBkg", " converted Photon Bkg Eta 2 tracks", etaBin, etaMin, etaMax);
914  h_convPhiBkg_ = iBooker.book1D("convPhiBkg", " converted Photon Bkg Phi ", phiBin, phiMin, phiMax);
915  //
916  histname = "mvaOutBkg";
917  h_mvaOutBkg_[0] = iBooker.book1D(histname + "All", " mvaOut conversions bkg : All Ecal", 100, 0., 1.);
918  h_mvaOutBkg_[1] = iBooker.book1D(histname + "Barrel", " mvaOut conversions bkg: Barrel Ecal", 100, 0., 1.);
919  h_mvaOutBkg_[2] = iBooker.book1D(histname + "Endcap", " mvaOut conversions bkg: Endcap Ecal", 100, 0., 1.);
920 
921  histname = "PoverEtracksBkg";
922  h_PoverETracksBkg_[0] =
923  iBooker.book1D(histname + "All", " bkg photons conversion p/E: all Ecal ", povereBin, povereMin, povereMax);
924  h_PoverETracksBkg_[1] =
925  iBooker.book1D(histname + "Barrel", "bkg photons conversion p/E: Barrel Ecal", povereBin, povereMin, povereMax);
926  h_PoverETracksBkg_[2] =
927  iBooker.book1D(histname + "Endcap", " bkg photons conversion p/E: Endcap Ecal ", povereBin, povereMin, povereMax);
928 
929  histname = "EoverPtracksBkg";
930  h_EoverPTracksBkg_[0] =
931  iBooker.book1D(histname + "All", " bkg photons conversion E/p: all Ecal ", eoverpBin, eoverpMin, eoverpMax);
932  h_EoverPTracksBkg_[1] =
933  iBooker.book1D(histname + "Barrel", "bkg photons conversion E/p: Barrel Ecal", eoverpBin, eoverpMin, eoverpMax);
934  h_EoverPTracksBkg_[2] =
935  iBooker.book1D(histname + "Endcap", " bkg photons conversion E/p: Endcap Ecal ", eoverpBin, eoverpMin, eoverpMax);
936 
937  histname = "hDCotTracksBkg";
938  h_DCotTracksBkg_[0] = iBooker.book1D(histname + "All",
939  " bkg Photons:Tracks from conversions #delta cotg(#Theta) Tracks: all Ecal ",
942  dCotTracksMax);
943  h_DCotTracksBkg_[1] = iBooker.book1D(histname + "Barrel",
944  " bkg Photons:Tracks from conversions #delta cotg(#Theta) Tracks: Barrel Ecal ",
947  dCotTracksMax);
948  h_DCotTracksBkg_[2] = iBooker.book1D(histname + "Endcap",
949  " bkg Photons:Tracks from conversions #delta cotg(#Theta) Tracks: Endcap Ecal ",
952  dCotTracksMax);
953 
954  histname = "hDPhiTracksAtVtxBkg";
955  h_DPhiTracksAtVtxBkg_[0] =
956  iBooker.book1D(histname + "All",
957  " Bkg Photons:Tracks from conversions: #delta#phi Tracks at vertex: all Ecal",
960  dPhiTracksMax);
961  h_DPhiTracksAtVtxBkg_[1] =
962  iBooker.book1D(histname + "Barrel",
963  " Bkg Photons:Tracks from conversions: #delta#phi Tracks at vertex: Barrel Ecal",
966  dPhiTracksMax);
967  h_DPhiTracksAtVtxBkg_[2] =
968  iBooker.book1D(histname + "Endcap",
969  " Bkg Photons:Tracks from conversions: #delta#phi Tracks at vertex: Endcap Ecal",
972  dPhiTracksMax);
973 
974  if (!isRunCentrally_) {
975  h_convVtxRvsZBkg_[0] = iBooker.book2D("convVtxRvsZAllBkg",
976  " Bkg Photon Reco conversion vtx position",
977  zBinForXray,
978  zMinForXray,
979  zMaxForXray,
980  rBinForXray,
981  rMinForXray,
982  rMaxForXray);
983  h_convVtxRvsZBkg_[1] = iBooker.book2D("convVtxRvsZBarrelBkg",
984  " Bkg Photon Reco conversion vtx position",
985  zBinForXray,
986  zMinForXray,
987  zMaxForXray,
988  rBinForXray,
989  rMinForXray,
990  rMaxForXray);
991  h_convVtxYvsXBkg_ = iBooker.book2D("convVtxYvsXTrkBarrelBkg",
992  " Bkg Photon Reco conversion vtx position, (x,y) eta<1 ",
993  100,
994  -80.,
995  80.,
996  100,
997  -80.,
998  80.);
999  }
1000 
1001  //
1002  iBooker.setCurrentFolder("EgammaV/" + fName_ + "/Photons");
1003 
1004  histname = "nOfflineVtx";
1005  h_nRecoVtx_ = iBooker.book1D(histname, "# of Offline Vertices", 200, -0.5, 199.5);
1006 
1007  h_phoEta_[0] = iBooker.book1D("phoEta", " Photon Eta ", etaBin, etaMin, etaMax);
1008  h_phoPhi_[0] = iBooker.book1D("phoPhi", " Photon Phi ", phiBin, phiMin, phiMax);
1009 
1010  h_phoDEta_[0] = iBooker.book1D("phoDEta", " Photon Eta(rec)-Eta(true) ", dEtaBin, dEtaMin, dEtaMax);
1011  h_phoDPhi_[0] = iBooker.book1D("phoDPhi", " Photon Phi(rec)-Phi(true) ", dPhiBin, dPhiMin, dPhiMax);
1012 
1013  h_scEta_[0] = iBooker.book1D("scEta", " SC Eta ", etaBin, etaMin, etaMax);
1014  h_scPhi_[0] = iBooker.book1D("scPhi", " SC Phi ", phiBin, phiMin, phiMax);
1015 
1016  if (!isRunCentrally_) {
1017  h_scEtaWidth_[0] = iBooker.book1D("scEtaWidth", " SC Eta Width ", 100, 0., 0.1);
1018  h_scPhiWidth_[0] = iBooker.book1D("scPhiWidth", " SC Phi Width ", 100, 0., 1.);
1019  }
1020 
1021  histname = "scE";
1022  h_scE_[0][0] = iBooker.book1D(histname + "All", " SC Energy: All Ecal ", eBin, eMin, eMax);
1023  h_scE_[0][1] = iBooker.book1D(histname + "Barrel", " SC Energy: Barrel ", eBin, eMin, eMax);
1024  h_scE_[0][2] = iBooker.book1D(histname + "Endcap", " SC Energy: Endcap ", eBin, eMin, eMax);
1025 
1026  histname = "psE";
1027  h_psE_ = iBooker.book1D(histname + "Endcap", " ES Energy ", eBin, eMin, 50.);
1028 
1029  histname = "scEt";
1030  h_scEt_[0][0] = iBooker.book1D(histname + "All", " SC Et: All Ecal ", etBin, etMin, etMax);
1031  h_scEt_[0][1] = iBooker.book1D(histname + "Barrel", " SC Et: Barrel", etBin, etMin, etMax);
1032  h_scEt_[0][2] = iBooker.book1D(histname + "Endcap", " SC Et: Endcap", etBin, etMin, etMax);
1033 
1034  histname = "r9";
1035  h_r9_[0][0] = iBooker.book1D(histname + "All", " r9: All Ecal", r9Bin, r9Min, r9Max);
1036  h_r9_[0][1] = iBooker.book1D(histname + "Barrel", " r9: Barrel ", r9Bin, r9Min, r9Max);
1037  h_r9_[0][2] = iBooker.book1D(histname + "Endcap", " r9: Endcap ", r9Bin, r9Min, r9Max);
1038  //
1039 
1040  if (!isRunCentrally_) {
1041  histname = "r9ConvFromMC";
1042  h_r9_[1][0] = iBooker.book1D(histname + "All", " r9: All Ecal", r9Bin, r9Min, r9Max);
1043  h_r9_[1][1] = iBooker.book1D(histname + "Barrel", " r9: Barrel ", r9Bin, r9Min, r9Max);
1044  h_r9_[1][2] = iBooker.book1D(histname + "Endcap", " r9: Endcap ", r9Bin, r9Min, r9Max);
1045  //
1046  histname = "r9ConvFromReco";
1047  h_r9_[2][0] = iBooker.book1D(histname + "All", " r9: All Ecal", r9Bin, r9Min, r9Max);
1048  h_r9_[2][1] = iBooker.book1D(histname + "Barrel", " r9: Barrel ", r9Bin, r9Min, r9Max);
1049  h_r9_[2][2] = iBooker.book1D(histname + "Endcap", " r9: Endcap ", r9Bin, r9Min, r9Max);
1051  histname = "EtR9Less093";
1052  h_EtR9Less093_[0][0] = iBooker.book1D(histname + "All", " r9 < 0.94 or 0.95 : All Ecal", etBin, etMin, etMax);
1053  h_EtR9Less093_[0][1] = iBooker.book1D(histname + "Barrel", " r9 < 0.94 : Barrel ", etBin, etMin, etMax);
1054  h_EtR9Less093_[0][2] = iBooker.book1D(histname + "Endcap", " r9 < 0.95 : Endcap ", etBin, etMin, etMax);
1055  histname = "EtR9Less093Conv";
1056  h_EtR9Less093_[1][0] =
1057  iBooker.book1D(histname + "All", " r9 < 0.94, 0.95 and good conv : All Ecal", etBin, etMin, etMax);
1058  h_EtR9Less093_[1][1] =
1059  iBooker.book1D(histname + "Barrel", " r9 < 0.94 and good conv : Barrel ", etBin, etMin, etMax);
1060  h_EtR9Less093_[1][2] =
1061  iBooker.book1D(histname + "Endcap", " r9 < 0.95 and good conv : Endcap ", etBin, etMin, etMax);
1062  }
1063 
1065  histname = "pR9VsEta";
1066  p_r9VsEta_[0] = iBooker.bookProfile(
1067  histname + "All", " All photons r9 vs #eta: all Ecal ", etaBin2, etaMin, etaMax, 100, 0., 1.1);
1068  p_r9VsEta_[1] = iBooker.bookProfile(
1069  histname + "Unconv", " Unconv photons r9 vs #eta: all Ecal ", etaBin2, etaMin, etaMax, 100, 0., 1.1);
1070  p_r9VsEta_[2] = iBooker.bookProfile(
1071  histname + "Conv", " Conv photons r9 vs #eta: all Ecal ", etaBin2, etaMin, etaMax, 100, 0., 1.1);
1072  //
1073  histname = "R9VsEt";
1074  if (!isRunCentrally_)
1075  h2_r9VsEt_[0] =
1076  iBooker.book2D(histname + "All", " All photons r9 vs Et: all Ecal ", etBin, etMin, etMax, 100, 0., 1.1);
1077  if (!isRunCentrally_)
1078  h2_r9VsEt_[1] =
1079  iBooker.book2D(histname + "Unconv", " All photons r9 vs Et: all Ecal ", etBin, etMin, etMax, 100, 0., 1.1);
1080  //
1081  histname = "r1";
1082  h_r1_[0][0] = iBooker.book1D(histname + "All", " e1x5/e5x5: All Ecal", r9Bin, r9Min, r9Max);
1083  h_r1_[0][1] = iBooker.book1D(histname + "Barrel", " e1x5/e5x5: Barrel ", r9Bin, r9Min, r9Max);
1084  h_r1_[0][2] = iBooker.book1D(histname + "Endcap", " e1x5/e5x5: Endcap ", r9Bin, r9Min, r9Max);
1085  //
1086  histname = "R1VsEta";
1087  if (!isRunCentrally_)
1088  h2_r1VsEta_[0] = iBooker.book2D(
1089  histname + "All", " All photons e1x5/e5x5 vs #eta: all Ecal ", etaBin2, etaMin, etaMax, 100, 0., 1.1);
1090  if (!isRunCentrally_)
1091  h2_r1VsEta_[1] = iBooker.book2D(
1092  histname + "Unconv", " All photons e1x5/e5x5 vs #eta: all Ecal ", etaBin2, etaMin, etaMax, 100, 0., 1.1);
1093  //
1094  histname = "R1VsEt";
1095  if (!isRunCentrally_)
1096  h2_r1VsEt_[0] =
1097  iBooker.book2D(histname + "All", " All photons e1x5/e5x5 vs Et: all Ecal ", etBin, etMin, etMax, 100, 0., 1.1);
1098  if (!isRunCentrally_)
1099  h2_r1VsEt_[1] = iBooker.book2D(
1100  histname + "Unconv", " All photons e1x5/e5x5 vs Et: all Ecal ", etBin, etMin, etMax, 100, 0., 1.1);
1101  //
1102  histname = "r2";
1103  h_r2_[0][0] = iBooker.book1D(histname + "All", " e2x5/e5x5: All Ecal", r9Bin, r9Min, r9Max);
1104  h_r2_[0][1] = iBooker.book1D(histname + "Barrel", " e2x5/e5x5: Barrel ", r9Bin, r9Min, r9Max);
1105  h_r2_[0][2] = iBooker.book1D(histname + "Endcap", " e2x5/e5x5: Endcap ", r9Bin, r9Min, r9Max);
1106  //
1107  histname = "R2VsEta";
1108  if (!isRunCentrally_)
1109  h2_r2VsEta_[0] = iBooker.book2D(
1110  histname + "All", " All photons e2x5/e5x5 vs #eta: all Ecal ", etaBin2, etaMin, etaMax, 100, 0., 1.1);
1111  if (!isRunCentrally_)
1112  h2_r2VsEta_[1] = iBooker.book2D(
1113  histname + "Unconv", " All photons e2x5/e5x5 vs #eta: all Ecal ", etaBin2, etaMin, etaMax, 100, 0., 1.1);
1114  //
1115  histname = "R2VsEt";
1116  if (!isRunCentrally_)
1117  h2_r2VsEt_[0] =
1118  iBooker.book2D(histname + "All", " All photons e2x5/e5x5 vs Et: all Ecal ", etBin, etMin, etMax, 100, 0., 1.1);
1119  if (!isRunCentrally_)
1120  h2_r2VsEt_[1] = iBooker.book2D(
1121  histname + "Unconv", " All photons e2x5/e5x5 vs Et: all Ecal ", etBin, etMin, etMax, 100, 0., 1.1);
1122  //
1123  histname = "sigmaIetaIeta";
1124  h_sigmaIetaIeta_[0][0] = iBooker.book1D(histname + "All", "sigmaIetaIeta: All Ecal", 100, 0., 0.1);
1125  h_sigmaIetaIeta_[0][1] = iBooker.book1D(histname + "Barrel", "sigmaIetaIeta: Barrel ", 100, 0., 0.05);
1126  h_sigmaIetaIeta_[0][2] = iBooker.book1D(histname + "Endcap", "sigmaIetaIeta: Endcap ", 100, 0., 0.1);
1127  //
1128  histname = "sigmaIetaIetaVsEta";
1129  if (!isRunCentrally_)
1130  h2_sigmaIetaIetaVsEta_[0] = iBooker.book2D(
1131  histname + "All", " All photons sigmaIetaIeta vs #eta: all Ecal ", etaBin2, etaMin, etaMax, 100, 0., 0.1);
1132  if (!isRunCentrally_)
1133  h2_sigmaIetaIetaVsEta_[1] = iBooker.book2D(
1134  histname + "Unconv", " All photons sigmaIetaIeta vs #eta: all Ecal ", etaBin2, etaMin, etaMax, 100, 0., 0.1);
1135  //
1136  histname = "sigmaIetaIetaVsEt";
1137  if (!isRunCentrally_)
1138  h2_sigmaIetaIetaVsEt_[0] = iBooker.book2D(
1139  histname + "All", " All photons sigmaIetaIeta vs Et: all Ecal ", etBin, etMin, etMax, 100, 0., 0.1);
1140  if (!isRunCentrally_)
1141  h2_sigmaIetaIetaVsEt_[1] = iBooker.book2D(
1142  histname + "Unconv", " All photons sigmaIetaIeta vs Et: all Ecal ", etBin, etMin, etMax, 100, 0., 0.1);
1143  //
1144  histname = "hOverE";
1145  h_hOverE_[0][0] = iBooker.book1D(histname + "All", "H/E: All Ecal", 100, 0., 0.1);
1146  h_hOverE_[0][1] = iBooker.book1D(histname + "Barrel", "H/E: Barrel ", 100, 0., 0.1);
1147  h_hOverE_[0][2] = iBooker.book1D(histname + "Endcap", "H/E: Endcap ", 100, 0., 0.1);
1148  //
1149  histname = "newhOverE";
1150  h_newhOverE_[0][0] = iBooker.book1D(histname + "All", "new H/E: All Ecal", 100, 0., 0.1);
1151  h_newhOverE_[0][1] = iBooker.book1D(histname + "Barrel", "new H/E: Barrel ", 100, 0., 0.1);
1152  h_newhOverE_[0][2] = iBooker.book1D(histname + "Endcap", "new H/E: Endcap ", 100, 0., 0.1);
1153 
1154  //
1155  if (!isRunCentrally_) {
1156  histname = "hOverEVsEta";
1157  h2_hOverEVsEta_[0] =
1158  iBooker.book2D(histname + "All", " All photons H/E vs #eta: all Ecal ", etaBin2, etaMin, etaMax, 100, 0., 0.1);
1159  h2_hOverEVsEta_[1] = iBooker.book2D(
1160  histname + "Unconv", " All photons H/E vs #eta: all Ecal ", etaBin2, etaMin, etaMax, 100, 0., 0.1);
1161  //
1162  histname = "hOverEVsEt";
1163  h2_hOverEVsEt_[0] =
1164  iBooker.book2D(histname + "All", " All photons H/E vs Et: all Ecal ", etBin, etMin, etMax, 100, 0., 0.1);
1165  h2_hOverEVsEt_[1] =
1166  iBooker.book2D(histname + "Unconv", " All photons H/E vs Et: all Ecal ", etBin, etMin, etMax, 100, 0., 0.1);
1167  //
1168  }
1169  histname = "pHoverEVsEta";
1170  p_hOverEVsEta_[0] = iBooker.bookProfile(
1171  histname + "All", " All photons H/E vs #eta: all Ecal ", etaBin2, etaMin, etaMax, 100, 0., 0.1);
1172  p_hOverEVsEta_[1] = iBooker.bookProfile(
1173  histname + "Unconv", " All photons H/E vs #eta: all Ecal ", etaBin2, etaMin, etaMax, 100, 0., 0.1);
1174  //
1175  histname = "pHoverEVsEt";
1176  p_hOverEVsEt_[0] =
1177  iBooker.bookProfile(histname + "All", " All photons H/E vs Et: all Ecal ", etBin, etMin, etMax, 100, 0., 0.1);
1178  p_hOverEVsEt_[1] =
1179  iBooker.bookProfile(histname + "Unconv", " All photons H/E vs Et: all Ecal ", etBin, etMin, etMax, 100, 0., 0.1);
1180  //
1181  histname = "pnewHoverEVsEta";
1182  p_newhOverEVsEta_[0] = iBooker.bookProfile(
1183  histname + "All", " All photons new H/E vs #eta: all Ecal ", etaBin2, etaMin, etaMax, 100, 0., 0.1);
1184  p_newhOverEVsEta_[1] = iBooker.bookProfile(
1185  histname + "Unconv", " All photons new H/E vs #eta: all Ecal ", etaBin2, etaMin, etaMax, 100, 0., 0.1);
1186  //
1187  histname = "pnewHoverEVsEt";
1188  p_newhOverEVsEt_[0] =
1189  iBooker.bookProfile(histname + "All", " All photons new H/E vs Et: all Ecal ", etBin, etMin, etMax, 100, 0., 0.1);
1190  p_newhOverEVsEt_[1] = iBooker.bookProfile(
1191  histname + "Unconv", " All photons new H/E vs Et: all Ecal ", etBin, etMin, etMax, 100, 0., 0.1);
1192  //
1193  histname = "ecalRecHitSumEtConeDR04";
1194  h_ecalRecHitSumEtConeDR04_[0][0] =
1195  iBooker.book1D(histname + "All", "ecalRecHitSumEtDR04: All Ecal", etBin, etMin, 20.);
1196  h_ecalRecHitSumEtConeDR04_[0][1] =
1197  iBooker.book1D(histname + "Barrel", "ecalRecHitSumEtDR04: Barrel ", etBin, etMin, 20.);
1198  h_ecalRecHitSumEtConeDR04_[0][2] =
1199  iBooker.book1D(histname + "Endcap", "ecalRecHitSumEtDR04: Endcap ", etBin, etMin, 20.);
1200  //
1201 
1202  if (!isRunCentrally_) {
1203  histname = "ecalRecHitSumEtConeDR04VsEta";
1204  h2_ecalRecHitSumEtConeDR04VsEta_[0] = iBooker.book2D(histname + "All",
1205  " All photons ecalRecHitSumEtDR04 vs #eta: all Ecal ",
1206  etaBin2,
1207  etaMin,
1208  etaMax,
1209  etBin,
1210  etMin,
1211  etMax * etScale);
1212  h2_ecalRecHitSumEtConeDR04VsEta_[1] = iBooker.book2D(histname + "Unconv",
1213  " All photons ecalRecHitSumEtDR04 vs #eta: all Ecal ",
1214  etaBin2,
1215  etaMin,
1216  etaMax,
1217  etBin,
1218  etMin,
1219  etMax * etScale);
1220  }
1221  histname = "pEcalRecHitSumEtConeDR04VsEta";
1222  p_ecalRecHitSumEtConeDR04VsEta_[0] = iBooker.bookProfile(histname + "All",
1223  "All photons ecalRecHitSumEtDR04 vs #eta: all Ecal ",
1224  etaBin2,
1225  etaMin,
1226  etaMax,
1227  etBin,
1228  etMin,
1229  etMax * etScale,
1230  "");
1231  p_ecalRecHitSumEtConeDR04VsEta_[1] = iBooker.bookProfile(histname + "Unconv",
1232  "All photons ecalRecHitSumEtDR04 vs #eta: all Ecal ",
1233  etaBin2,
1234  etaMin,
1235  etaMax,
1236  etBin,
1237  etMin,
1238  etMax * etScale,
1239  "");
1240  //
1241  if (!isRunCentrally_) {
1242  histname = "ecalRecHitSumEtConeDR04VsEt";
1243  h2_ecalRecHitSumEtConeDR04VsEt_[0] = iBooker.book2D(histname + "All",
1244  " All photons ecalRecHitSumEtDR04 vs Et: all Ecal ",
1245  etBin,
1246  etMin,
1247  etMax,
1248  etBin,
1249  etMin,
1250  etMax * etScale);
1251  h2_ecalRecHitSumEtConeDR04VsEt_[1] = iBooker.book2D(histname + "Barrel",
1252  " All photons ecalRecHitSumEtDR04 vs Et: Barrel ",
1253  etBin,
1254  etMin,
1255  etMax,
1256  etBin,
1257  etMin,
1258  etMax * etScale);
1259  h2_ecalRecHitSumEtConeDR04VsEt_[2] = iBooker.book2D(histname + "Endcap",
1260  " All photons ecalRecHitSumEtDR04 vs Et: Endcap ",
1261  etBin,
1262  etMin,
1263  etMax,
1264  etBin,
1265  etMin,
1266  etMax * etScale);
1267  }
1268  histname = "pEcalRecHitSumEtConeDR04VsEt";
1269  if (!isRunCentrally_)
1270  p_ecalRecHitSumEtConeDR04VsEt_[0] = iBooker.bookProfile(histname + "All",
1271  "All photons ecalRecHitSumEtDR04 vs Et: all Ecal ",
1272  etBin,
1273  etMin,
1274  etMax,
1275  etBin,
1276  etMin,
1277  etMax * etScale,
1278  "");
1279  p_ecalRecHitSumEtConeDR04VsEt_[1] = iBooker.bookProfile(histname + "Barrel",
1280  "All photons ecalRecHitSumEtDR04 vs Et: all Ecal ",
1281  etBin,
1282  etMin,
1283  etMax,
1284  etBin,
1285  etMin,
1286  etMax * etScale,
1287  "");
1288  p_ecalRecHitSumEtConeDR04VsEt_[2] = iBooker.bookProfile(histname + "Endcap",
1289  "All photons ecalRecHitSumEtDR04 vs Et: all Ecal ",
1290  etBin,
1291  etMin,
1292  etMax,
1293  etBin,
1294  etMin,
1295  etMax * etScale,
1296  "");
1297  //
1298  histname = "hcalTowerSumEtConeDR04";
1299  h_hcalTowerSumEtConeDR04_[0][0] =
1300  iBooker.book1D(histname + "All", "hcalTowerSumEtConeDR04: All Ecal", etBin, etMin, 20.);
1301  h_hcalTowerSumEtConeDR04_[0][1] =
1302  iBooker.book1D(histname + "Barrel", "hcalTowerSumEtConeDR04: Barrel ", etBin, etMin, 20.);
1303  h_hcalTowerSumEtConeDR04_[0][2] =
1304  iBooker.book1D(histname + "Endcap", "hcalTowerSumEtConeDR04: Endcap ", etBin, etMin, 20.);
1305  //
1306  histname = "hcalTowerBcSumEtConeDR04";
1307  if (!isRunCentrally_)
1308  h_hcalTowerBcSumEtConeDR04_[0][0] =
1309  iBooker.book1D(histname + "All", "hcalTowerBcSumEtConeDR04: All Ecal", etBin, etMin, 20.);
1310  h_hcalTowerBcSumEtConeDR04_[0][1] =
1311  iBooker.book1D(histname + "Barrel", "hcalTowerBcSumEtConeDR04: Barrel ", etBin, etMin, 20.);
1312  h_hcalTowerBcSumEtConeDR04_[0][2] =
1313  iBooker.book1D(histname + "Endcap", "hcalTowerBcSumEtConeDR04: Endcap ", etBin, etMin, 20.);
1314 
1315  //
1316  if (!isRunCentrally_) {
1317  histname = "hcalTowerSumEtConeDR04VsEta";
1318  h2_hcalTowerSumEtConeDR04VsEta_[0] = iBooker.book2D(histname + "All",
1319  " All photons hcalTowerSumEtConeDR04 vs #eta: all Ecal ",
1320  etaBin2,
1321  etaMin,
1322  etaMax,
1323  etBin,
1324  etMin,
1325  etMax * 0.1);
1326  h2_hcalTowerSumEtConeDR04VsEta_[1] = iBooker.book2D(histname + "Unconv",
1327  " All photons hcalTowerSumEtConeDR04 vs #eta: all Ecal ",
1328  etaBin2,
1329  etaMin,
1330  etaMax,
1331  etBin,
1332  etMin,
1333  etMax * 0.1);
1334  }
1335  histname = "pHcalTowerSumEtConeDR04VsEta";
1336  p_hcalTowerSumEtConeDR04VsEta_[0] = iBooker.bookProfile(histname + "All",
1337  "All photons hcalTowerSumEtDR04 vs #eta: all Ecal ",
1338  etaBin2,
1339  etaMin,
1340  etaMax,
1341  etBin,
1342  etMin,
1343  etMax * 0.1,
1344  "");
1345  p_hcalTowerSumEtConeDR04VsEta_[1] = iBooker.bookProfile(histname + "Unconv",
1346  "All photons hcalTowerSumEtDR04 vs #eta: all Ecal ",
1347  etaBin2,
1348  etaMin,
1349  etaMax,
1350  etBin,
1351  etMin,
1352  etMax * 0.1,
1353  "");
1354  histname = "pHcalTowerBcSumEtConeDR04VsEta";
1355  p_hcalTowerBcSumEtConeDR04VsEta_[0] = iBooker.bookProfile(histname + "All",
1356  "All photons hcalTowerBcSumEtDR04 vs #eta: all Ecal ",
1357  etaBin2,
1358  etaMin,
1359  etaMax,
1360  etBin,
1361  etMin,
1362  etMax * 0.1,
1363  "");
1364  p_hcalTowerBcSumEtConeDR04VsEta_[1] = iBooker.bookProfile(histname + "Unconv",
1365  "All photons hcalTowerBcSumEtDR04 vs #eta: all Ecal ",
1366  etaBin2,
1367  etaMin,
1368  etaMax,
1369  etBin,
1370  etMin,
1371  etMax * 0.1,
1372  "");
1373  //
1374  if (!isRunCentrally_) {
1375  histname = "hcalTowerSumEtConeDR04VsEt";
1376  h2_hcalTowerSumEtConeDR04VsEt_[0] = iBooker.book2D(histname + "All",
1377  " All photons hcalTowerSumEtConeDR04 vs Et: all Ecal ",
1378  etBin,
1379  etMin,
1380  etMax,
1381  etBin,
1382  etMin,
1383  etMax * 0.1);
1384  h2_hcalTowerSumEtConeDR04VsEt_[1] = iBooker.book2D(histname + "Barrel",
1385  " All photons hcalTowerSumEtConeDR04 vs Et: Barrel ",
1386  etBin,
1387  etMin,
1388  etMax,
1389  etBin,
1390  etMin,
1391  etMax * 0.1);
1392  h2_hcalTowerSumEtConeDR04VsEt_[2] = iBooker.book2D(histname + "Endcap",
1393  " All photons hcalTowerSumEtConeDR04 vs Et: Endcap ",
1394  etBin,
1395  etMin,
1396  etMax,
1397  etBin,
1398  etMin,
1399  etMax * 0.1);
1400  }
1401  histname = "pHcalTowerSumEtConeDR04VsEt";
1402  if (!isRunCentrally_)
1403  p_hcalTowerSumEtConeDR04VsEt_[0] = iBooker.bookProfile(histname + "All",
1404  "All photons hcalTowerSumEtDR04 vs Et: all Ecal ",
1405  etBin,
1406  etMin,
1407  etMax,
1408  etBin,
1409  etMin,
1410  etMax * etScale,
1411  "");
1412  p_hcalTowerSumEtConeDR04VsEt_[1] = iBooker.bookProfile(histname + "Barrel",
1413  "All photons hcalTowerSumEtDR04 vs Et: all Ecal ",
1414  etBin,
1415  etMin,
1416  etMax,
1417  etBin,
1418  etMin,
1419  etMax * etScale,
1420  "");
1421  p_hcalTowerSumEtConeDR04VsEt_[2] = iBooker.bookProfile(histname + "Endcap",
1422  "All photons hcalTowerSumEtDR04 vs Et: all Ecal ",
1423  etBin,
1424  etMin,
1425  etMax,
1426  etBin,
1427  etMin,
1428  etMax * etScale,
1429  "");
1430  //
1431  histname = "pHcalTowerBcSumEtConeDR04VsEt";
1432  if (!isRunCentrally_)
1433  p_hcalTowerBcSumEtConeDR04VsEt_[0] = iBooker.bookProfile(histname + "All",
1434  "All photons hcalTowerBcSumEtDR04 vs Et: all Ecal ",
1435  etBin,
1436  etMin,
1437  etMax,
1438  etBin,
1439  etMin,
1440  etMax * etScale,
1441  "");
1442  p_hcalTowerBcSumEtConeDR04VsEt_[1] = iBooker.bookProfile(histname + "Barrel",
1443  "All photons hcalTowerBcSumEtDR04 vs Et: all Ecal ",
1444  etBin,
1445  etMin,
1446  etMax,
1447  etBin,
1448  etMin,
1449  etMax * etScale,
1450  "");
1451  p_hcalTowerBcSumEtConeDR04VsEt_[2] = iBooker.bookProfile(histname + "Endcap",
1452  "All photons hcalTowerBcSumEtDR04 vs Et: all Ecal ",
1453  etBin,
1454  etMin,
1455  etMax,
1456  etBin,
1457  etMin,
1458  etMax * etScale,
1459  "");
1460 
1461  //
1462  histname = "isoTrkSolidConeDR04";
1463  h_isoTrkSolidConeDR04_[0][0] =
1464  iBooker.book1D(histname + "All", "isoTrkSolidConeDR04: All Ecal", etBin, etMin, etMax * 0.1);
1465  h_isoTrkSolidConeDR04_[0][1] =
1466  iBooker.book1D(histname + "Barrel", "isoTrkSolidConeDR04: Barrel ", etBin, etMin, etMax * 0.1);
1467  h_isoTrkSolidConeDR04_[0][2] =
1468  iBooker.book1D(histname + "Endcap", "isoTrkSolidConeDR04: Endcap ", etBin, etMin, etMax * 0.1);
1469  //
1470 
1471  histname = "isoTrkSolidConeDR04VsEta";
1472  if (!isRunCentrally_)
1473  h2_isoTrkSolidConeDR04VsEta_[0] = iBooker.book2D(histname + "All",
1474  " All photons isoTrkSolidConeDR04 vs #eta: all Ecal ",
1475  etaBin2,
1476  etaMin,
1477  etaMax,
1478  etBin,
1479  etMin,
1480  etMax * 0.1);
1481  if (!isRunCentrally_)
1482  h2_isoTrkSolidConeDR04VsEta_[1] = iBooker.book2D(histname + "Unconv",
1483  " All photons isoTrkSolidConeDR04 vs #eta: all Ecal ",
1484  etaBin2,
1485  etaMin,
1486  etaMax,
1487  etBin,
1488  etMin,
1489  etMax * 0.1);
1490 
1491  //
1492  histname = "isoTrkSolidConeDR04VsEt";
1493  if (!isRunCentrally_)
1494  h2_isoTrkSolidConeDR04VsEt_[0] = iBooker.book2D(histname + "All",
1495  " All photons isoTrkSolidConeDR04 vs Et: all Ecal ",
1496  etBin,
1497  etMin,
1498  etMax,
1499  etBin,
1500  etMin,
1501  etMax * 0.1);
1502  if (!isRunCentrally_)
1503  h2_isoTrkSolidConeDR04VsEt_[1] = iBooker.book2D(histname + "Unconv",
1504  " All photons isoTrkSolidConeDR04 vs Et: all Ecal ",
1505  etBin,
1506  etMin,
1507  etMax,
1508  etBin,
1509  etMin,
1510  etMax * 0.1);
1511  //
1512  histname = "nTrkSolidConeDR04";
1513  h_nTrkSolidConeDR04_[0][0] = iBooker.book1D(histname + "All", "nTrkSolidConeDR04: All Ecal", 20, 0., 20);
1514  h_nTrkSolidConeDR04_[0][1] = iBooker.book1D(histname + "Barrel", "nTrkSolidConeDR04: Barrel ", 20, 0., 20);
1515  h_nTrkSolidConeDR04_[0][2] = iBooker.book1D(histname + "Endcap", "nTrkSolidConeDR04: Endcap ", 20, 0., 20);
1516  //
1517  histname = "nTrkSolidConeDR04VsEta";
1518  if (!isRunCentrally_)
1519  h2_nTrkSolidConeDR04VsEta_[0] = iBooker.book2D(
1520  histname + "All", " All photons nTrkSolidConeDR04 vs #eta: all Ecal ", etaBin2, etaMin, etaMax, 20, 0., 20);
1521  if (!isRunCentrally_)
1522  h2_nTrkSolidConeDR04VsEta_[1] = iBooker.book2D(
1523  histname + "Unconv", " All photons nTrkSolidConeDR04 vs #eta: all Ecal ", etaBin2, etaMin, etaMax, 20, 0., 20);
1524  //
1525  histname = "nTrkSolidConeDR04VsEt";
1526  if (!isRunCentrally_)
1527  h2_nTrkSolidConeDR04VsEt_[0] = iBooker.book2D(
1528  histname + "All", " All photons nTrkSolidConeDR04 vs Et: all Ecal ", etBin, etMin, etMax, 20, 0., 20);
1529  if (!isRunCentrally_)
1530  h2_nTrkSolidConeDR04VsEt_[1] = iBooker.book2D(
1531  histname + "Unconv", " All photons nTrkSolidConeDR04 vs Et: all Ecal ", etBin, etMin, etMax, 20, 0., 20);
1532  //
1533  histname = "phoE";
1534  h_phoE_[0][0] = iBooker.book1D(histname + "All", " Photon Energy: All ecal ", eBin, eMin, eMax);
1535  h_phoE_[0][1] = iBooker.book1D(histname + "Barrel", " Photon Energy: barrel ", eBin, eMin, eMax);
1536  h_phoE_[0][2] = iBooker.book1D(histname + "Endcap", " Photon Energy: Endcap ", eBin, eMin, eMax);
1537 
1538  histname = "phoEt";
1539  h_phoEt_[0][0] = iBooker.book1D(histname + "All", " Photon Transverse Energy: All ecal ", etBin, etMin, etMax);
1540  h_phoEt_[0][1] = iBooker.book1D(histname + "Barrel", " Photon Transverse Energy: Barrel ", etBin, etMin, etMax);
1541  h_phoEt_[0][2] = iBooker.book1D(histname + "Endcap", " Photon Transverse Energy: Endcap ", etBin, etMin, etMax);
1542 
1543  histname = "eRes";
1544  h_phoERes_[0][0] =
1545  iBooker.book1D(histname + "All", " Photon E/E_{true}: All ecal; E/E_{true} (GeV)", resBin, resMin, resMax);
1546  h_phoERes_[0][1] =
1547  iBooker.book1D(histname + "Barrel", "Photon E/E_{true}: Barrel; E/E_{true} (GeV)", resBin, resMin, resMax);
1548  h_phoERes_[0][2] =
1549  iBooker.book1D(histname + "Endcap", " Photon E/E_{true}: Endcap; E/E_{true} (GeV)", resBin, resMin, resMax);
1550 
1551  h_phoERes_[1][0] = iBooker.book1D(
1552  histname + "unconvAll", " Photon E/E_{true} if r9>0.94, 0.95: All ecal; E/E_{true} (GeV)", resBin, resMin, resMax);
1553  h_phoERes_[1][1] = iBooker.book1D(
1554  histname + "unconvBarrel", " Photon E/E_{true} if r9>0.94: Barrel; E/E_{true} (GeV)", resBin, resMin, resMax);
1555  h_phoERes_[1][2] = iBooker.book1D(
1556  histname + "unconvEndcap", " Photon E/E_{true} if r9>0.95: Endcap; E/E_{true} (GeV)", resBin, resMin, resMax);
1557 
1558  h_phoERes_[2][0] = iBooker.book1D(
1559  histname + "convAll", " Photon E/E_{true} if r9<0.0.94, 0.95: All ecal; E/E_{true} (GeV)", resBin, resMin, resMax);
1560  h_phoERes_[2][1] = iBooker.book1D(
1561  histname + "convBarrel", " Photon E/E_{true} if r9<0.94: Barrel; E/E_{true} (GeV)", resBin, resMin, resMax);
1562  h_phoERes_[2][2] = iBooker.book1D(
1563  histname + "convEndcap", " Photon E/E_{true} if r9<0.95: Endcap; E/E_{true} (GeV)", resBin, resMin, resMax);
1564 
1565  histname = "sigmaEoE";
1566  h_phoSigmaEoE_[0][0] = iBooker.book1D(histname + "All", "#sigma_{E}/E: All ecal; #sigma_{E}/E", 100, 0., 0.08);
1567  h_phoSigmaEoE_[0][1] = iBooker.book1D(histname + "Barrel", "#sigma_{E}/E: Barrel; #sigma_{E}/E", 100, 0., 0.08);
1568  h_phoSigmaEoE_[0][2] = iBooker.book1D(histname + "Endcap", "#sigma_{E}/E: Endcap, #sigma_{E}/E", 100, 0., 0.08);
1569 
1570  h_phoSigmaEoE_[1][0] =
1571  iBooker.book1D(histname + "unconvAll", "#sigma_{E}/E if r9>0.94, 0.95: All ecal; #sigma_{E}/E", 100, 0., 0.08);
1572  h_phoSigmaEoE_[1][1] =
1573  iBooker.book1D(histname + "unconvBarrel", "#sigma_{E}/E if r9>0.94: Barrel; #sigma_{E}/E", 100, 0., 0.08);
1574  h_phoSigmaEoE_[1][2] =
1575  iBooker.book1D(histname + "unconvEndcap", "#sigma_{E}/E r9>0.95: Endcap; #sigma_{E}/E", 100, 0., 0.08);
1576 
1577  h_phoSigmaEoE_[2][0] =
1578  iBooker.book1D(histname + "convAll", "#sigma_{E}/E if r9<0.0.94, 0.95: All ecal, #sigma_{E}/E", 100, 0., 0.08);
1579  h_phoSigmaEoE_[2][1] =
1580  iBooker.book1D(histname + "convBarrel", "#sigma_{E}/E if r9<0.94: Barrel, #sigma_{E}/E", 100, 0., 0.08);
1581  h_phoSigmaEoE_[2][2] =
1582  iBooker.book1D(histname + "convEndcap", "#sigma_{E}/E if r9<0.95: Endcap, #sigma_{E}/E", 100, 0., 0.08);
1583 
1584  histname = "eResVsEta";
1585  if (!isRunCentrally_)
1586  h2_eResVsEta_[0] = iBooker.book2D(
1587  histname + "All", " All photons E/Etrue vs #eta: all Ecal ", etaBin2, etaMin, etaMax, 100, 0., 2.5);
1588  if (!isRunCentrally_)
1589  h2_eResVsEta_[1] = iBooker.book2D(
1590  histname + "Unconv", " Unconv photons E/Etrue vs #eta: all Ecal ", etaBin2, etaMin, etaMax, 100, 0., 2.5);
1591 
1592  histname = "pEResVsEta";
1593  p_eResVsEta_[0] = iBooker.bookProfile(
1594  histname + "All", "All photons E/Etrue vs #eta: all Ecal ", etaBin2, etaMin, etaMax, resBin, resMin, resMax, "");
1595  p_eResVsEta_[1] = iBooker.bookProfile(histname + "Unconv",
1596  "Unconv photons E/Etrue vs #eta: all Ecal",
1597  etaBin2,
1598  etaMin,
1599  etaMax,
1600  resBin,
1601  resMin,
1602  resMax,
1603  "");
1604  p_eResVsEta_[2] = iBooker.bookProfile(
1605  histname + "Conv", "Conv photons E/Etrue vs #eta: all Ecal", etaBin2, etaMin, etaMax, resBin, resMin, resMax, "");
1606 
1607  histname = "pSigmaEoEVsEta";
1608  p_sigmaEoEVsEta_[0] = iBooker.bookProfile(histname + "All",
1609  "All photons: #sigma_{E}/E vs #eta: all Ecal; #eta; #sigma_{E}/E",
1610  etaBin2,
1611  etaMin,
1612  etaMax,
1613  100,
1614  0.,
1615  0.08,
1616  "");
1617  p_sigmaEoEVsEta_[1] = iBooker.bookProfile(histname + "Unconv",
1618  "Unconv photons #sigma_{E}/E vs #eta: all Ecal; #eta; #sigma_{E}/E ",
1619  etaBin2,
1620  etaMin,
1621  etaMax,
1622  100,
1623  0.,
1624  0.08,
1625  "");
1626  p_sigmaEoEVsEta_[2] = iBooker.bookProfile(histname + "Conv",
1627  "Conv photons #sigma_{E}/E vs #eta: all Ecal; #eta; #sigma_{E}/E",
1628  etaBin2,
1629  etaMin,
1630  etaMax,
1631  100,
1632  0.,
1633  0.08,
1634  "");
1635 
1636  histname = "pSigmaEoEVsEt";
1637  p_sigmaEoEVsEt_[1][0] = iBooker.bookProfile(histname + "Barrel",
1638  "All photons #sigma_{E}/E vs E_{T}: Barrel; E_{T} (GeV); #sigma_{E}/E ",
1639  etBin,
1640  etMin,
1641  etMax,
1642  100,
1643  0.,
1644  0.08,
1645  "");
1646  p_sigmaEoEVsEt_[1][1] =
1647  iBooker.bookProfile(histname + "unconvBarrel",
1648  "Unconv photons #sigma_{E}/E vs E_{T}: Barrel; E_{T} (GeV); #sigma_{E}/E ",
1649  etBin,
1650  etMin,
1651  etMax,
1652  100,
1653  0.,
1654  0.08,
1655  "");
1656  p_sigmaEoEVsEt_[1][2] = iBooker.bookProfile(histname + "convBarrel",
1657  "Conv photons #sigma_{E}/E vs E_{T}: Barrel; E_{T} (GeV); #sigma_{E}/E",
1658  etBin,
1659  etMin,
1660  etMax,
1661  100,
1662  0.,
1663  0.08,
1664  "");
1665  p_sigmaEoEVsEt_[2][0] = iBooker.bookProfile(histname + "Endcap",
1666  "All photons #sigma_{E}/E vs E_{T}: Endcap; E_{T} (GeV); #sigma_{E}/E ",
1667  etBin,
1668  etMin,
1669  etMax,
1670  100,
1671  0.,
1672  0.08,
1673  "");
1674  p_sigmaEoEVsEt_[2][1] =
1675  iBooker.bookProfile(histname + "unconvEndcap",
1676  "Unconv photons #sigma_{E}/E vs E_{T}: Endcap; E_{T} (GeV); #sigma_{E}/E ",
1677  etBin,
1678  etMin,
1679  etMax,
1680  100,
1681  0.,
1682  0.08,
1683  "");
1684  p_sigmaEoEVsEt_[2][2] = iBooker.bookProfile(histname + "convEndcap",
1685  "Conv photons #sigma_{E}/E vs E_{T}: Endcap; E_{T} (GeV); #sigma_{E}/E",
1686  etBin,
1687  etMin,
1688  etMax,
1689  100,
1690  0.,
1691  0.08,
1692  "");
1693 
1694  histname = "pSigmaEoEVsNVtx";
1695  p_sigmaEoEVsNVtx_[1][0] = iBooker.bookProfile(histname + "Barrel",
1696  "All photons: #sigma_{E}/E vs N_{vtx}: Barrel; N_{vtx}; #sigma_{E}/E",
1697  200,
1698  -0.5,
1699  199.5,
1700  100,
1701  0.,
1702  0.08,
1703  "");
1704  p_sigmaEoEVsNVtx_[1][1] =
1705  iBooker.bookProfile(histname + "unconvBarrel",
1706  "Unconv photons #sigma_{E}/E vs N_{vtx}: Barrel; N_{vtx}; #sigma_{E}/E ",
1707  200,
1708  -0.5,
1709  199.5,
1710  100,
1711  0.,
1712  0.08,
1713  "");
1714  p_sigmaEoEVsNVtx_[1][2] = iBooker.bookProfile(histname + "convBarrel",
1715  "Conv photons #sigma_{E}/E vs N_{vtx}: Barrel; N_{vtx}; #sigma_{E}/E",
1716  200,
1717  -0.5,
1718  199.5,
1719  100,
1720  0.,
1721  0.08,
1722  "");
1723  p_sigmaEoEVsNVtx_[2][0] = iBooker.bookProfile(histname + "Endcap",
1724  "All photons: #sigma_{E}/E vs N_{vtx}: Endcap; N_{vtx}; #sigma_{E}/E",
1725  200,
1726  -0.5,
1727  199.5,
1728  100,
1729  0.,
1730  0.08,
1731  "");
1732  p_sigmaEoEVsNVtx_[2][1] =
1733  iBooker.bookProfile(histname + "unconvEndcap",
1734  "Unconv photons #sigma_{E}/E vs N_{vtx}: Endcap; N_{vtx}; #sigma_{E}/E ",
1735  200,
1736  -0.5,
1737  199.5,
1738  100,
1739  0.,
1740  0.08,
1741  "");
1742  p_sigmaEoEVsNVtx_[2][2] = iBooker.bookProfile(histname + "convEndcap",
1743  "Conv photons #sigma_{E}/E vs N_{vtx}: Endcap; N_{vtx}; #sigma_{E}/E",
1744  200,
1745  -0.5,
1746  199.5,
1747  100,
1748  0.,
1749  0.08,
1750  "");
1751 
1752  if (!isRunCentrally_) {
1753  histname = "eResVsEt";
1754  h2_eResVsEt_[0][0] = iBooker.book2D(
1755  histname + "All", " All photons E/Etrue vs true Et: all Ecal ", etBin, etMin, etMax, 100, 0.9, 1.1);
1756  h2_eResVsEt_[0][1] = iBooker.book2D(
1757  histname + "unconv", " All photons E/Etrue vs true Et: all Ecal ", etBin, etMin, etMax, 100, 0.9, 1.1);
1758  h2_eResVsEt_[0][2] = iBooker.book2D(
1759  histname + "conv", " All photons E/Etrue vs true Et: all Ecal ", etBin, etMin, etMax, 100, 0.9, 1.1);
1760  h2_eResVsEt_[1][0] = iBooker.book2D(
1761  histname + "Barrel", " All photons E/Etrue vs true Et: Barrel ", etBin, etMin, etMax, 100, 0.9, 1.1);
1762  h2_eResVsEt_[1][1] = iBooker.book2D(
1763  histname + "unconvBarrel", " All photons E/Etrue vs true Et: Barrel ", etBin, etMin, etMax, 100, 0.9, 1.1);
1764  h2_eResVsEt_[1][2] = iBooker.book2D(
1765  histname + "convBarrel", " All photons E/Etrue vs true Et: Barrel ", etBin, etMin, etMax, 100, 0.9, 1.1);
1766  h2_eResVsEt_[2][0] = iBooker.book2D(
1767  histname + "Endcap", " All photons E/Etrue vs true Et: Endcap ", etBin, etMin, etMax, 100, 0.9, 1.1);
1768  h2_eResVsEt_[2][1] = iBooker.book2D(
1769  histname + "unconvEndcap", " All photons E/Etrue vs true Et: Endcap ", etBin, etMin, etMax, 100, 0.9, 1.1);
1770  h2_eResVsEt_[2][2] = iBooker.book2D(
1771  histname + "convEndcap", " All photons E/Etrue vs true Et: Endcap ", etBin, etMin, etMax, 100, 0.9, 1.1);
1772  }
1773 
1774  histname = "pEResVsEt";
1775  p_eResVsEt_[0][0] = iBooker.bookProfile(
1776  histname + "All", "All photons E/Etrue vs Et: all Ecal ", etBin, etMin, etMax, resBin, resMin, resMax, "");
1777  p_eResVsEt_[0][1] = iBooker.bookProfile(
1778  histname + "unconv", "All photons E/Etrue vs Et: all Ecal ", etBin, etMin, etMax, resBin, resMin, resMax, "");
1779  p_eResVsEt_[0][2] = iBooker.bookProfile(
1780  histname + "conv", "All photons E/Etrue vs Et: all Ecal ", etBin, etMin, etMax, resBin, resMin, resMax, "");
1781  p_eResVsEt_[1][0] = iBooker.bookProfile(
1782  histname + "Barrel", "All photons E/Etrue vs Et: Barrel ", etBin, etMin, etMax, resBin, resMin, resMax, "");
1783  p_eResVsEt_[1][1] = iBooker.bookProfile(
1784  histname + "unconvBarrel", "All photons E/Etrue vs Et: Barrel ", etBin, etMin, etMax, resBin, resMin, resMax, "");
1785  p_eResVsEt_[1][2] = iBooker.bookProfile(
1786  histname + "convBarrel", "All photons E/Etrue vs Et: Barrel ", etBin, etMin, etMax, resBin, resMin, resMax, "");
1787  p_eResVsEt_[2][0] = iBooker.bookProfile(
1788  histname + "Endcap", "All photons E/Etrue vs Et: Endcap ", etBin, etMin, etMax, resBin, resMin, resMax, "");
1789  p_eResVsEt_[2][1] = iBooker.bookProfile(
1790  histname + "unconvEndcap", "All photons E/Etrue vs Et: Endcap ", etBin, etMin, etMax, resBin, resMin, resMax, "");
1791  p_eResVsEt_[2][2] = iBooker.bookProfile(
1792  histname + "convEndcap", "All photons E/Etrue vs Et: Endcap ", etBin, etMin, etMax, resBin, resMin, resMax, "");
1793 
1794  histname = "pEResVsNVtx";
1795  p_eResVsNVtx_[1][0] = iBooker.bookProfile(histname + "Barrel",
1796  "All photons E/E_{true} vs N_{vtx}: Barrel; N_{vtx}; E}/E_{true}",
1797  200,
1798  -0.5,
1799  199.5,
1800  resBin,
1801  resMin,
1802  resMax,
1803  "");
1804  p_eResVsNVtx_[1][1] =
1805  iBooker.bookProfile(histname + "unconvBarrel",
1806  "Unconverted photons E/E_{true} vs N_{vtx}: Barrel; N_{vtx}; E}/E_{true} ",
1807  200,
1808  -0.5,
1809  199.5,
1810  resBin,
1811  resMin,
1812  resMax,
1813  "");
1814  p_eResVsNVtx_[1][2] =
1815  iBooker.bookProfile(histname + "convBarrel",
1816  " Converted photons E/E_{true} vs N_{vtx}: Barrel; N_{vtx}; E}/E_{true} ",
1817  200,
1818  -0.5,
1819  199.5,
1820  resBin,
1821  resMin,
1822  resMax,
1823  "");
1824  p_eResVsNVtx_[2][0] = iBooker.bookProfile(histname + "Endcap",
1825  "All photons E/E_{true} vs N_{vtx}: Endcap; N_{vtx}; E}/E_{true} ",
1826  200,
1827  -0.5,
1828  199.5,
1829  resBin,
1830  resMin,
1831  resMax,
1832  "");
1833  p_eResVsNVtx_[2][1] =
1834  iBooker.bookProfile(histname + "unconvEndcap",
1835  "Uncoverted photons E/E_{true} vs N_{vtx}: Endcap; N_{vtx}; E}/E_{true} ",
1836  2080,
1837  -0.5,
1838  199.5,
1839  resBin,
1840  resMin,
1841  resMax,
1842  "");
1843  p_eResVsNVtx_[2][2] = iBooker.bookProfile(histname + "convEndcap",
1844  "Converted photons E/E_{true} vs N_{vtx}: Endcap; N_{vtx}; E}/E_{true} ",
1845  200,
1846  -0.5,
1847  199.5,
1848  resBin,
1849  resMin,
1850  resMax,
1851  "");
1852 
1853  histname = "eResVsR9";
1854  if (!isRunCentrally_)
1855  h2_eResVsR9_[0] = iBooker.book2D(
1856  histname + "All", " All photons E/Etrue vs R9: all Ecal ", r9Bin * 2, r9Min, r9Max, 100, 0., 2.5);
1857  if (!isRunCentrally_)
1858  h2_eResVsR9_[1] = iBooker.book2D(
1859  histname + "Barrel", " All photons E/Etrue vs R9: Barrel ", r9Bin * 2, r9Min, r9Max, 100, 0., 2.5);
1860  if (!isRunCentrally_)
1861  h2_eResVsR9_[2] = iBooker.book2D(
1862  histname + "Endcap", " All photons E/Etrue vs R9: Endcap ", r9Bin * 2, r9Min, r9Max, 100, 0., 2.5);
1863  histname = "pEResVsR9";
1864  if (!isRunCentrally_)
1865  p_eResVsR9_[0] = iBooker.bookProfile(
1866  histname + "All", " All photons E/Etrue vs R9: all Ecal ", r9Bin * 2, r9Min, r9Max, resBin, resMin, resMax, "");
1867  p_eResVsR9_[1] = iBooker.bookProfile(
1868  histname + "Barrel", " All photons E/Etrue vs R9: Barrel ", r9Bin * 2, r9Min, r9Max, resBin, resMin, resMax, "");
1869  p_eResVsR9_[2] = iBooker.bookProfile(
1870  histname + "Endcap", " All photons E/Etrue vs R9: Endcap ", r9Bin * 2, r9Min, r9Max, resBin, resMin, resMax, "");
1871  histname = "sceResVsR9";
1872  if (!isRunCentrally_)
1873  h2_sceResVsR9_[0] = iBooker.book2D(
1874  histname + "All", " All photons scE/Etrue vs R9: all Ecal ", r9Bin * 2, r9Min, r9Max, 100, 0., 2.5);
1875  if (!isRunCentrally_)
1876  h2_sceResVsR9_[1] = iBooker.book2D(
1877  histname + "Barrel", " All photons scE/Etrue vs R9: Barrel ", r9Bin * 2, r9Min, r9Max, 100, 0., 2.5);
1878  if (!isRunCentrally_)
1879  h2_sceResVsR9_[2] = iBooker.book2D(
1880  histname + "Endcap", " All photons scE/Etrue vs R9: Endcap ", r9Bin * 2, r9Min, r9Max, 100, 0., 2.5);
1881  histname = "scpEResVsR9";
1882  if (!isRunCentrally_)
1883  p_sceResVsR9_[0] = iBooker.bookProfile(histname + "All",
1884  " All photons scE/Etrue vs R9: all Ecal ",
1885  r9Bin * 2,
1886  r9Min,
1887  r9Max,
1888  resBin,
1889  resMin,
1890  resMax,
1891  "");
1892  p_sceResVsR9_[1] = iBooker.bookProfile(histname + "Barrel",
1893  " All photons scE/Etrue vs R9: Barrel ",
1894  r9Bin * 2,
1895  r9Min,
1896  r9Max,
1897  resBin,
1898  resMin,
1899  resMax,
1900  "");
1901  p_sceResVsR9_[2] = iBooker.bookProfile(histname + "Endcap",
1902  " All photons scE/Etrue vs R9: Endcap ",
1903  r9Bin * 2,
1904  r9Min,
1905  r9Max,
1906  resBin,
1907  resMin,
1908  resMax,
1909  "");
1910 
1911  // Photon E resolution when using energy values from regressions
1912  histname = "eResRegr1";
1913  h_phoEResRegr1_[0][0] =
1914  iBooker.book1D(histname + "All", " Photon rec/true Energy from Regression1 : All ecal ", resBin, resMin, resMax);
1915  h_phoEResRegr1_[0][1] =
1916  iBooker.book1D(histname + "Barrel", " Photon rec/true Energy from Regression1: Barrel ", resBin, resMin, resMax);
1917  h_phoEResRegr1_[0][2] =
1918  iBooker.book1D(histname + "Endcap", " Photon rec/true Energy from Regression1: Endcap ", resBin, resMin, resMax);
1919 
1920  h_phoEResRegr1_[1][0] = iBooker.book1D(histname + "unconvAll",
1921  " Photon rec/true Energy from Regression1 if r9>0.94, 0.95: All ecal ",
1922  resBin,
1923  resMin,
1924  resMax);
1925  h_phoEResRegr1_[1][1] = iBooker.book1D(
1926  histname + "unconvBarrel", " Photon rec/true Energy from Regression1 if r9>0.94: Barrel ", resBin, resMin, resMax);
1927  h_phoEResRegr1_[1][2] = iBooker.book1D(
1928  histname + "unconvEndcap", " Photon rec/true Energy from Regression1 if r9>0.95: Endcap ", resBin, resMin, resMax);
1929 
1930  h_phoEResRegr1_[2][0] = iBooker.book1D(histname + "convAll",
1931  " Photon rec/true Energy from Regression1if r9<0.0.94, 0.95: All ecal ",
1932  resBin,
1933  resMin,
1934  resMax);
1935  h_phoEResRegr1_[2][1] = iBooker.book1D(
1936  histname + "convBarrel", " Photon rec/true Energy from Regression1 if r9<0.94: Barrel ", resBin, resMin, resMax);
1937  h_phoEResRegr1_[2][2] = iBooker.book1D(
1938  histname + "convEndcap", " Photon rec/true Energy from Regression1 if r9<0.95: Endcap ", resBin, resMin, resMax);
1939 
1940  histname = "eResRegr2";
1941  h_phoEResRegr2_[0][0] =
1942  iBooker.book1D(histname + "All", " Photon rec/true Energy from Regression2 : All ecal ", resBin, resMin, resMax);
1943  h_phoEResRegr2_[0][1] =
1944  iBooker.book1D(histname + "Barrel", " Photon rec/true Energy from Regression2: Barrel ", resBin, resMin, resMax);
1945  h_phoEResRegr2_[0][2] =
1946  iBooker.book1D(histname + "Endcap", " Photon rec/true Energy from Regression2: Endcap ", resBin, resMin, resMax);
1947 
1948  h_phoEResRegr2_[1][0] = iBooker.book1D(histname + "unconvAll",
1949  " Photon rec/true Energy from Regression2 if r9>0.94, 0.95: All ecal ",
1950  resBin,
1951  resMin,
1952  resMax);
1953  h_phoEResRegr2_[1][1] = iBooker.book1D(
1954  histname + "unconvBarrel", " Photon rec/true Energy from Regression2 if r9>0.94: Barrel ", resBin, resMin, resMax);
1955  h_phoEResRegr2_[1][2] = iBooker.book1D(
1956  histname + "unconvEndcap", " Photon rec/true Energy from Regression2 if r9>0.95: Endcap ", resBin, resMin, resMax);
1957 
1958  h_phoEResRegr2_[2][0] = iBooker.book1D(histname + "convAll",
1959  " Photon rec/true Energy from Regression2 if r9<0.0.94, 0.95: All ecal ",
1960  resBin,
1961  resMin,
1962  resMax);
1963  h_phoEResRegr2_[2][1] = iBooker.book1D(
1964  histname + "convBarrel", " Photon rec/true Energy from Regression2 if r9<0.94: Barrel ", resBin, resMin, resMax);
1965  h_phoEResRegr2_[2][2] = iBooker.book1D(
1966  histname + "convEndcap", " Photon rec/true Energy from Regression2 if r9<0.95: Endcap ", resBin, resMin, resMax);
1967  //
1968  histname = "phoPixSeedSize";
1969  h_phoPixSeedSize_[0] = iBooker.book1D(histname + "Barrel", "Pixel seeds size ", 100, 0., 100.);
1970  h_phoPixSeedSize_[1] = iBooker.book1D(histname + "Endcap", "Pixel seeds size ", 100, 0., 100.);
1971 
1972  // Infos from Particle Flow - isolation and ID
1973  histname = "chargedHadIso";
1974  h_chHadIso_[0] = iBooker.book1D(histname + "All", "PF chargedHadIso: All Ecal", etBin, etMin, 20.);
1975  h_chHadIso_[1] = iBooker.book1D(histname + "Barrel", "PF chargedHadIso: Barrel", etBin, etMin, 20.);
1976  h_chHadIso_[2] = iBooker.book1D(histname + "Endcap", "PF chargedHadIso: Endcap", etBin, etMin, 20.);
1977  histname = "neutralHadIso";
1978  h_nHadIso_[0] = iBooker.book1D(histname + "All", "PF neutralHadIso: All Ecal", etBin, etMin, 20.);
1979  h_nHadIso_[1] = iBooker.book1D(histname + "Barrel", "PF neutralHadIso: Barrel", etBin, etMin, 20.);
1980  h_nHadIso_[2] = iBooker.book1D(histname + "Endcap", "PF neutralHadIso: Endcap", etBin, etMin, 20.);
1981  histname = "photonIso";
1982  h_phoIso_[0] = iBooker.book1D(histname + "All", "PF photonIso: All Ecal", etBin, etMin, 20.);
1983  h_phoIso_[1] = iBooker.book1D(histname + "Barrel", "PF photonIso: Barrel", etBin, etMin, 20.);
1984  h_phoIso_[2] = iBooker.book1D(histname + "Endcap", "PF photonIso: Endcap", etBin, etMin, 20.);
1985  histname = "nCluOutMustache";
1986  h_nCluOutsideMustache_[0] =
1987  iBooker.book1D(histname + "All", "PF number of clusters outside Mustache: All Ecal", 50, 0., 50.);
1988  h_nCluOutsideMustache_[1] =
1989  iBooker.book1D(histname + "Barrel", "PF number of clusters outside Mustache: Barrel", 50, 0., 50.);
1990  h_nCluOutsideMustache_[2] =
1991  iBooker.book1D(histname + "Endcap", "PF number of clusters outside Mustache: Endcap", 50, 0., 50.);
1992  histname = "etOutMustache";
1993  h_etOutsideMustache_[0] = iBooker.book1D(histname + "All", "PF et outside Mustache: All Ecal", etBin, etMin, 20.);
1994  h_etOutsideMustache_[1] = iBooker.book1D(histname + "Barrel", "PF et outside Mustache: Barrel", etBin, etMin, 20.);
1995  h_etOutsideMustache_[2] = iBooker.book1D(histname + "Endcap", "PF et outside Mustache: Endcap", etBin, etMin, 20.);
1996  histname = "pfMVA";
1997  h_pfMva_[0] = iBooker.book1D(histname + "All", "PF MVA output: All Ecal", 50, -1., 2.);
1998  h_pfMva_[1] = iBooker.book1D(histname + "Barrel", "PF MVA output: Barrel", 50, -1., 2.);
1999  h_pfMva_[2] = iBooker.book1D(histname + "Endcap", "PF MVA output: Endcap", 50, -1, 2.);
2001  histname = "SumPtOverPhoPt_ChHad_Cleaned";
2002  h_SumPtOverPhoPt_ChHad_Cleaned_[0] =
2003  iBooker.book1D(histname + "All", "Pf Cand SumPt/P_{T}_{#gamma}: Charged Hadrons: All Ecal", etBin, etMin, 2.);
2004  h_SumPtOverPhoPt_ChHad_Cleaned_[1] =
2005  iBooker.book1D(histname + "Barrel", "PF Cand SumPt/P_{T}_{#gamma}: Charged Hadrons: Barrel", etBin, etMin, 2.);
2006  h_SumPtOverPhoPt_ChHad_Cleaned_[2] =
2007  iBooker.book1D(histname + "Endcap", "PF Cand SumPt/P_{T}_{#gamma}: Charged Hadrons: Endcap", etBin, etMin, 2.);
2008  histname = "SumPtOverPhoPt_NeuHad_Cleaned";
2009  h_SumPtOverPhoPt_NeuHad_Cleaned_[0] =
2010  iBooker.book1D(histname + "All", "Pf Cand SumPt/P_{T}_{#gamma}: Neutral Hadrons: All Ecal", etBin, etMin, 2.);
2011  h_SumPtOverPhoPt_NeuHad_Cleaned_[1] =
2012  iBooker.book1D(histname + "Barrel", "PF Cand SumPt/P_{T}_{#gamma}: Neutral Hadrons: Barrel", etBin, etMin, 2.);
2013  h_SumPtOverPhoPt_NeuHad_Cleaned_[2] =
2014  iBooker.book1D(histname + "Endcap", "PF Cand SumPt/P_{T}_{#gamma}: Neutral Hadrons: Endcap", etBin, etMin, 2.);
2015  histname = "SumPtOverPhoPt_Pho_Cleaned";
2016  h_SumPtOverPhoPt_Pho_Cleaned_[0] =
2017  iBooker.book1D(histname + "All", "Pf Cand SumPt/P_{T}_{#gamma}: Photons: All Ecal", etBin, etMin, 2.);
2018  h_SumPtOverPhoPt_Pho_Cleaned_[1] =
2019  iBooker.book1D(histname + "Barrel", "PF Cand SumPt/P_{T}_{#gamma}: Photons: Barrel", etBin, etMin, 2.);
2020  h_SumPtOverPhoPt_Pho_Cleaned_[2] =
2021  iBooker.book1D(histname + "Endcap", "PF Cand SumPt/P_{T}_{#gamma}: Photons: Endcap", etBin, etMin, 2.);
2022 
2023  histname = "dRPhoPFcand_ChHad_Cleaned";
2024  h_dRPhoPFcand_ChHad_Cleaned_[0] =
2025  iBooker.book1D(histname + "All", "dR(pho,cand) Charged Hadrons : All Ecal", etBin, etMin, 0.7);
2026  h_dRPhoPFcand_ChHad_Cleaned_[1] =
2027  iBooker.book1D(histname + "Barrel", "dR(pho,cand) Charged Hadrons : Barrel", etBin, etMin, 0.7);
2028  h_dRPhoPFcand_ChHad_Cleaned_[2] =
2029  iBooker.book1D(histname + "Endcap", "dR(pho,cand) Charged Hadrons : Endcap", etBin, etMin, 0.7);
2030  histname = "dRPhoPFcand_NeuHad_Cleaned";
2031  h_dRPhoPFcand_NeuHad_Cleaned_[0] =
2032  iBooker.book1D(histname + "All", "dR(pho,cand) Neutral Hadrons : All Ecal", etBin, etMin, 0.7);
2033  h_dRPhoPFcand_NeuHad_Cleaned_[1] =
2034  iBooker.book1D(histname + "Barrel", "dR(pho,cand) Neutral Hadrons : Barrel", etBin, etMin, 0.7);
2035  h_dRPhoPFcand_NeuHad_Cleaned_[2] =
2036  iBooker.book1D(histname + "Endcap", "dR(pho,cand) Neutral Hadrons : Endcap", etBin, etMin, 0.7);
2037  histname = "dRPhoPFcand_Pho_Cleaned";
2038  h_dRPhoPFcand_Pho_Cleaned_[0] =
2039  iBooker.book1D(histname + "All", "dR(pho,cand) Photons : All Ecal", etBin, etMin, 0.7);
2040  h_dRPhoPFcand_Pho_Cleaned_[1] =
2041  iBooker.book1D(histname + "Barrel", "dR(pho,cand) Photons : Barrel", etBin, etMin, 0.7);
2042  h_dRPhoPFcand_Pho_Cleaned_[2] =
2043  iBooker.book1D(histname + "Endcap", "dR(pho,cand) Photons : Endcap", etBin, etMin, 0.7);
2044 
2045  //
2046  histname = "SumPtOverPhoPt_ChHad_unCleaned";
2047  h_SumPtOverPhoPt_ChHad_unCleaned_[0] =
2048  iBooker.book1D(histname + "All", "Pf Cand Sum Pt Over photon pt Charged Hadrons : All Ecal", etBin, etMin, 2.);
2049  h_SumPtOverPhoPt_ChHad_unCleaned_[1] =
2050  iBooker.book1D(histname + "Barrel", "PF Cand Sum Pt Over photon pt Charged Hadrons: Barrel", etBin, etMin, 2.);
2051  h_SumPtOverPhoPt_ChHad_unCleaned_[2] =
2052  iBooker.book1D(histname + "Endcap", "PF Cand Sum Pt Over photon pt Charged Hadrons: Endcap", etBin, etMin, 2.);
2053  histname = "SumPtOverPhoPt_NeuHad_unCleaned";
2054  h_SumPtOverPhoPt_NeuHad_unCleaned_[0] =
2055  iBooker.book1D(histname + "All", "Pf Cand Sum Pt Over photon pt Neutral Hadrons : All Ecal", etBin, etMin, 2.);
2056  h_SumPtOverPhoPt_NeuHad_unCleaned_[1] =
2057  iBooker.book1D(histname + "Barrel", "PF Cand Sum Pt Over photon pt Neutral Hadrons: Barrel", etBin, etMin, 2.);
2058  h_SumPtOverPhoPt_NeuHad_unCleaned_[2] =
2059  iBooker.book1D(histname + "Endcap", "PF Cand Sum Pt Over photon pt Neutral Hadrons: Endcap", etBin, etMin, 2.);
2060  histname = "SumPtOverPhoPt_Pho_unCleaned";
2061  h_SumPtOverPhoPt_Pho_unCleaned_[0] =
2062  iBooker.book1D(histname + "All", "Pf Cand Sum Pt Over photon pt Photons: All Ecal", etBin, etMin, 2.);
2063  h_SumPtOverPhoPt_Pho_unCleaned_[1] =
2064  iBooker.book1D(histname + "Barrel", "PF Cand Sum Pt Over photon pt Photons: Barrel", etBin, etMin, 2.);
2065  h_SumPtOverPhoPt_Pho_unCleaned_[2] =
2066  iBooker.book1D(histname + "Endcap", "PF Cand Sum Pt Over photon pt Photons: Endcap", etBin, etMin, 2.);
2067  histname = "dRPhoPFcand_ChHad_unCleaned";
2068  h_dRPhoPFcand_ChHad_unCleaned_[0] =
2069  iBooker.book1D(histname + "All", "dR(pho,cand) Charged Hadrons : All Ecal", etBin, etMin, 0.7);
2070  h_dRPhoPFcand_ChHad_unCleaned_[1] =
2071  iBooker.book1D(histname + "Barrel", "dR(pho,cand) Charged Hadrons : Barrel", etBin, etMin, 0.7);
2072  h_dRPhoPFcand_ChHad_unCleaned_[2] =
2073  iBooker.book1D(histname + "Endcap", "dR(pho,cand) Charged Hadrons : Endcap", etBin, etMin, 0.7);
2074  histname = "dRPhoPFcand_NeuHad_unCleaned";
2075  h_dRPhoPFcand_NeuHad_unCleaned_[0] =
2076  iBooker.book1D(histname + "All", "dR(pho,cand) Neutral Hadrons : All Ecal", etBin, etMin, 0.7);
2077  h_dRPhoPFcand_NeuHad_unCleaned_[1] =
2078  iBooker.book1D(histname + "Barrel", "dR(pho,cand) Neutral Hadrons : Barrel", etBin, etMin, 0.7);
2079  h_dRPhoPFcand_NeuHad_unCleaned_[2] =
2080  iBooker.book1D(histname + "Endcap", "dR(pho,cand) Neutral Hadrons : Endcap", etBin, etMin, 0.7);
2081  histname = "dRPhoPFcand_Pho_unCleaned";
2082  h_dRPhoPFcand_Pho_unCleaned_[0] =
2083  iBooker.book1D(histname + "All", "dR(pho,cand) Photons: All Ecal", etBin, etMin, 0.7);
2084  h_dRPhoPFcand_Pho_unCleaned_[1] =
2085  iBooker.book1D(histname + "Barrel", "dR(pho,cand) Photons: Barrel", etBin, etMin, 0.7);
2086  h_dRPhoPFcand_Pho_unCleaned_[2] =
2087  iBooker.book1D(histname + "Endcap", "dR(pho,cand) Photons: Endcap", etBin, etMin, 0.7);
2088 
2089  // if ( ! isRunCentrally_ ) {
2090  // Photon pair invariant mass
2091  histname = "gamgamMass";
2092  h_gamgamMass_[0][0] =
2093  iBooker.book1D(histname + "All", "2 photons invariant mass: All ecal ", ggMassBin, ggMassMin, ggMassMax);
2094  h_gamgamMass_[0][1] =
2095  iBooker.book1D(histname + "Barrel", "2 photons invariant mass: Barrel ", ggMassBin, ggMassMin, ggMassMax);
2096  h_gamgamMass_[0][2] =
2097  iBooker.book1D(histname + "Endcap", "2 photons invariant mass: Endcap ", ggMassBin, ggMassMin, ggMassMax);
2098  //
2099  histname = "gamgamMassNoConv";
2100  h_gamgamMass_[1][0] = iBooker.book1D(
2101  histname + "All", "2 photons with no conversion invariant mass: All ecal ", ggMassBin, ggMassMin, ggMassMax);
2102  h_gamgamMass_[1][1] = iBooker.book1D(
2103  histname + "Barrel", "2 photons with no conversion invariant mass: Barrel ", ggMassBin, ggMassMin, ggMassMax);
2104  h_gamgamMass_[1][2] = iBooker.book1D(
2105  histname + "Endcap", "2 photons with no conversion invariant mass: Endcap ", ggMassBin, ggMassMin, ggMassMax);
2106  //
2107  histname = "gamgamMassConv";
2108  h_gamgamMass_[2][0] = iBooker.book1D(
2109  histname + "All", "2 photons with conversion invariant mass: All ecal ", ggMassBin, ggMassMin, ggMassMax);
2110  h_gamgamMass_[2][1] = iBooker.book1D(
2111  histname + "Barrel", "2 photons with conversion invariant mass: Barrel ", ggMassBin, ggMassMin, ggMassMax);
2112  h_gamgamMass_[2][2] = iBooker.book1D(
2113  histname + "Endcap", "2 photons with conversion invariant mass: Endcap ", ggMassBin, ggMassMin, ggMassMax);
2114  // with energy regression1
2115  histname = "gamgamMassRegr1";
2116  h_gamgamMassRegr1_[0][0] =
2117  iBooker.book1D(histname + "All", "2 photons invariant mass Regr1 : All ecal ", ggMassBin, ggMassMin, ggMassMax);
2118  h_gamgamMassRegr1_[0][1] =
2119  iBooker.book1D(histname + "Barrel", "2 photons invariant mass Regr1 : Barrel ", ggMassBin, ggMassMin, ggMassMax);
2120  h_gamgamMassRegr1_[0][2] =
2121  iBooker.book1D(histname + "Endcap", "2 photons invariant mass Regr1 : Endcap ", ggMassBin, ggMassMin, ggMassMax);
2122  //
2123  histname = "gamgamMassRegr1NoConv";
2124  h_gamgamMassRegr1_[1][0] = iBooker.book1D(
2125  histname + "All", "2 photons with no conversion invariant mass Regr1: All ecal ", ggMassBin, ggMassMin, ggMassMax);
2126  h_gamgamMassRegr1_[1][1] = iBooker.book1D(histname + "Barrel",
2127  "2 photons with no conversion invariant mass Regr1: Barrel ",
2128  ggMassBin,
2129  ggMassMin,
2130  ggMassMax);
2131  h_gamgamMassRegr1_[1][2] = iBooker.book1D(histname + "Endcap",
2132  "2 photons with no conversion invariant mass Regr1: Endcap ",
2133  ggMassBin,
2134  ggMassMin,
2135  ggMassMax);
2136  //
2137  histname = "gamgamMassRegr1Conv";
2138  h_gamgamMassRegr1_[2][0] = iBooker.book1D(
2139  histname + "All", "2 photons with conversion invariant mass Regr1: All ecal ", ggMassBin, ggMassMin, ggMassMax);
2140  h_gamgamMassRegr1_[2][1] = iBooker.book1D(histname + "Barrel",
2141  "2 photons with conversion invariant mass Regr1: Barrel ",
2142  ggMassBin,
2143  ggMassMin,
2144  ggMassMax);
2145  h_gamgamMassRegr1_[2][2] = iBooker.book1D(histname + "Endcap",
2146  "2 photons with conversion invariant mass Regr1: Endcap ",
2147  ggMassBin,
2148  ggMassMin,
2149  ggMassMax);
2150  // with energy regression2
2151  histname = "gamgamMassRegr2";
2152  h_gamgamMassRegr2_[0][0] =
2153  iBooker.book1D(histname + "All", "2 photons invariant mass Regr2 : All ecal ", ggMassBin, ggMassMin, ggMassMax);
2154  h_gamgamMassRegr2_[0][1] =
2155  iBooker.book1D(histname + "Barrel", "2 photons invariant mass Regr2 : Barrel ", ggMassBin, ggMassMin, ggMassMax);
2156  h_gamgamMassRegr2_[0][2] =
2157  iBooker.book1D(histname + "Endcap", "2 photons invariant mass Regr2 : Endcap ", ggMassBin, ggMassMin, ggMassMax);
2158  //
2159  histname = "gamgamMassRegr2NoConv";
2160  h_gamgamMassRegr2_[1][0] = iBooker.book1D(
2161  histname + "All", "2 photons with no conversion invariant mass Regr2: All ecal ", ggMassBin, ggMassMin, ggMassMax);
2162  h_gamgamMassRegr2_[1][1] = iBooker.book1D(histname + "Barrel",
2163  "2 photons with no conversion invariant mass Regr2: Barrel ",
2164  ggMassBin,
2165  ggMassMin,
2166  ggMassMax);
2167  h_gamgamMassRegr2_[1][2] = iBooker.book1D(histname + "Endcap",
2168  "2 photons with no conversion invariant mass Regr2: Endcap ",
2169  ggMassBin,
2170  ggMassMin,
2171  ggMassMax);
2172  //
2173  histname = "gamgamMassRegr2Conv";
2174  h_gamgamMassRegr2_[2][0] = iBooker.book1D(
2175  histname + "All", "2 photons with conversion invariant mass Regr2: All ecal ", ggMassBin, ggMassMin, ggMassMax);
2176  h_gamgamMassRegr2_[2][1] = iBooker.book1D(histname + "Barrel",
2177  "2 photons with conversion invariant mass Regr2: Barrel ",
2178  ggMassBin,
2179  ggMassMin,
2180  ggMassMax);
2181  h_gamgamMassRegr2_[2][2] = iBooker.book1D(histname + "Endcap",
2182  "2 photons with conversion invariant mass Regr2: Endcap ",
2183  ggMassBin,
2184  ggMassMin,
2185  ggMassMax);
2186 
2187  //}
2188 
2190 
2191  h_scEta_miniAOD_[0] = iBooker.book1D("scEta_miniAOD", " SC Eta ", etaBin, etaMin, etaMax);
2192  h_scPhi_miniAOD_[0] = iBooker.book1D("scPhi_miniAOD", " SC Phi ", phiBin, phiMin, phiMax);
2193  histname = "phoE";
2194  h_phoE_miniAOD_[0][0] = iBooker.book1D(histname + "All_miniAOD", " Photon Energy: All ecal ", eBin, eMin, eMax);
2195  h_phoE_miniAOD_[0][1] = iBooker.book1D(histname + "Barrel_miniAOD", " Photon Energy: barrel ", eBin, eMin, eMax);
2196  h_phoE_miniAOD_[0][2] = iBooker.book1D(histname + "Endcap_miniAOD", " Photon Energy: Endcap ", eBin, eMin, eMax);
2197 
2198  histname = "phoEt";
2199  h_phoEt_miniAOD_[0][0] =
2200  iBooker.book1D(histname + "All_miniAOD", " Photon Transverse Energy: All ecal ", etBin, etMin, etMax);
2201  h_phoEt_miniAOD_[0][1] =
2202  iBooker.book1D(histname + "Barrel_miniAOD", " Photon Transverse Energy: Barrel ", etBin, etMin, etMax);
2203  h_phoEt_miniAOD_[0][2] =
2204  iBooker.book1D(histname + "Endcap_miniAOD", " Photon Transverse Energy: Endcap ", etBin, etMin, etMax);
2205 
2206  histname = "eRes";
2207  h_phoERes_miniAOD_[0][0] = iBooker.book1D(
2208  histname + "All_miniAOD", " Photon E/E_{true}: All ecal; E/E_{true} (GeV)", resBin, resMin, resMax);
2209  h_phoERes_miniAOD_[0][1] = iBooker.book1D(
2210  histname + "Barrel_miniAOD", "Photon E/E_{true}: Barrel; E/E_{true} (GeV)", resBin, resMin, resMax);
2211  h_phoERes_miniAOD_[0][2] = iBooker.book1D(
2212  histname + "Endcap_miniAOD", " Photon E/E_{true}: Endcap; E/E_{true} (GeV)", resBin, resMin, resMax);
2213 
2214  histname = "sigmaEoE";
2215  h_phoSigmaEoE_miniAOD_[0][0] =
2216  iBooker.book1D(histname + "All_miniAOD", "#sigma_{E}/E: All ecal; #sigma_{E}/E", 100, 0., 0.08);
2217  h_phoSigmaEoE_miniAOD_[0][1] =
2218  iBooker.book1D(histname + "Barrel_miniAOD", "#sigma_{E}/E: Barrel; #sigma_{E}/E", 100, 0., 0.08);
2219  h_phoSigmaEoE_miniAOD_[0][2] =
2220  iBooker.book1D(histname + "Endcap_miniAOD", "#sigma_{E}/E: Endcap, #sigma_{E}/E", 100, 0., 0.08);
2221 
2222  histname = "r9";
2223  h_r9_miniAOD_[0][0] = iBooker.book1D(histname + "All_miniAOD", " r9: All Ecal", r9Bin, r9Min, r9Max);
2224  h_r9_miniAOD_[0][1] = iBooker.book1D(histname + "Barrel_miniAOD", " r9: Barrel ", r9Bin, r9Min, r9Max);
2225  h_r9_miniAOD_[0][2] = iBooker.book1D(histname + "Endcap_miniAOD", " r9: Endcap ", r9Bin, r9Min, r9Max);
2226  histname = "full5x5_r9";
2227  h_full5x5_r9_miniAOD_[0][0] = iBooker.book1D(histname + "All_miniAOD", " r9: All Ecal", r9Bin, r9Min, r9Max);
2228  h_full5x5_r9_miniAOD_[0][1] = iBooker.book1D(histname + "Barrel_miniAOD", " r9: Barrel ", r9Bin, r9Min, r9Max);
2229  h_full5x5_r9_miniAOD_[0][2] = iBooker.book1D(histname + "Endcap_miniAOD", " r9: Endcap ", r9Bin, r9Min, r9Max);
2230  histname = "r1";
2231  h_r1_miniAOD_[0][0] = iBooker.book1D(histname + "All_miniAOD", " e1x5/e5x5: All Ecal", r9Bin, r9Min, r9Max);
2232  h_r1_miniAOD_[0][1] = iBooker.book1D(histname + "Barrel_miniAOD", " e1x5/e5x5: Barrel ", r9Bin, r9Min, r9Max);
2233  h_r1_miniAOD_[0][2] = iBooker.book1D(histname + "Endcap_miniAOD", " e1x5/e5x5: Endcap ", r9Bin, r9Min, r9Max);
2234  histname = "r2";
2235  h_r2_miniAOD_[0][0] = iBooker.book1D(histname + "All_miniAOD", " e2x5/e5x5: All Ecal", r9Bin, r9Min, r9Max);
2236  h_r2_miniAOD_[0][1] = iBooker.book1D(histname + "Barrel_miniAOD", " e2x5/e5x5: Barrel ", r9Bin, r9Min, r9Max);
2237  h_r2_miniAOD_[0][2] = iBooker.book1D(histname + "Endcap_miniAOD", " e2x5/e5x5: Endcap ", r9Bin, r9Min, r9Max);
2238  histname = "hOverE";
2239  h_hOverE_miniAOD_[0][0] = iBooker.book1D(histname + "All_miniAOD", "H/E: All Ecal", 100, 0., 0.2);
2240  h_hOverE_miniAOD_[0][1] = iBooker.book1D(histname + "Barrel_miniAOD", "H/E: Barrel ", 100, 0., 0.2);
2241  h_hOverE_miniAOD_[0][2] = iBooker.book1D(histname + "Endcap_miniAOD", "H/E: Endcap ", 100, 0., 0.2);
2242  //
2243  histname = "newhOverE";
2244  h_newhOverE_miniAOD_[0][0] = iBooker.book1D(histname + "All_miniAOD", "new H/E: All Ecal", 100, 0., 0.2);
2245  h_newhOverE_miniAOD_[0][1] = iBooker.book1D(histname + "Barrel_miniAOD", "new H/E: Barrel ", 100, 0., 0.2);
2246  h_newhOverE_miniAOD_[0][2] = iBooker.book1D(histname + "Endcap_miniAOD", "new H/E: Endcap ", 100, 0., 0.2);
2247  //
2248  histname = "sigmaIetaIeta";
2249  h_sigmaIetaIeta_miniAOD_[0][0] = iBooker.book1D(histname + "All_miniAOD", "sigmaIetaIeta: All Ecal", 100, 0., 0.1);
2250  h_sigmaIetaIeta_miniAOD_[0][1] = iBooker.book1D(histname + "Barrel_miniAOD", "sigmaIetaIeta: Barrel ", 100, 0., 0.05);
2251  h_sigmaIetaIeta_miniAOD_[0][2] = iBooker.book1D(histname + "Endcap_miniAOD", "sigmaIetaIeta: Endcap ", 100, 0., 0.1);
2252  histname = "full5x5_sigmaIetaIeta";
2253  h_full5x5_sigmaIetaIeta_miniAOD_[0][0] =
2254  iBooker.book1D(histname + "All_miniAOD", "Full5x5 sigmaIetaIeta: All Ecal", 100, 0., 0.1);
2255  h_full5x5_sigmaIetaIeta_miniAOD_[0][1] =
2256  iBooker.book1D(histname + "Barrel_miniAOD", "Full5x5 sigmaIetaIeta: Barrel ", 100, 0., 0.05);
2257  h_full5x5_sigmaIetaIeta_miniAOD_[0][2] =
2258  iBooker.book1D(histname + "Endcap_miniAOD", "Full5x5 sigmaIetaIeta: Endcap ", 100, 0., 0.1);
2259  //
2260  histname = "ecalRecHitSumEtConeDR04";
2261  h_ecalRecHitSumEtConeDR04_miniAOD_[0][0] =
2262  iBooker.book1D(histname + "All_miniAOD", "ecalRecHitSumEtDR04: All Ecal", etBin, etMin, 20.);
2263  h_ecalRecHitSumEtConeDR04_miniAOD_[0][1] =
2264  iBooker.book1D(histname + "Barrel_miniAOD", "ecalRecHitSumEtDR04: Barrel ", etBin, etMin, 20.);
2265  h_ecalRecHitSumEtConeDR04_miniAOD_[0][2] =
2266  iBooker.book1D(histname + "Endcap_miniAOD", "ecalRecHitSumEtDR04: Endcap ", etBin, etMin, 20.);
2267  histname = "hcalTowerSumEtConeDR04";
2268  h_hcalTowerSumEtConeDR04_miniAOD_[0][0] =
2269  iBooker.book1D(histname + "All_miniAOD", "hcalTowerSumEtConeDR04: All Ecal", etBin, etMin, 20.);
2270  h_hcalTowerSumEtConeDR04_miniAOD_[0][1] =
2271  iBooker.book1D(histname + "Barrel_miniAOD", "hcalTowerSumEtConeDR04: Barrel ", etBin, etMin, 20.);
2272  h_hcalTowerSumEtConeDR04_miniAOD_[0][2] =
2273  iBooker.book1D(histname + "Endcap_miniAOD", "hcalTowerSumEtConeDR04: Endcap ", etBin, etMin, 20.);
2274  //
2275  histname = "hcalTowerBcSumEtConeDR04";
2276  h_hcalTowerBcSumEtConeDR04_miniAOD_[0][0] =
2277  iBooker.book1D(histname + "All_miniAOD", "hcalTowerBcSumEtConeDR04: All Ecal", etBin, etMin, 20.);
2278  h_hcalTowerBcSumEtConeDR04_miniAOD_[0][1] =
2279  iBooker.book1D(histname + "Barrel_miniAOD", "hcalTowerBcSumEtConeDR04: Barrel ", etBin, etMin, 20.);
2280  h_hcalTowerBcSumEtConeDR04_miniAOD_[0][2] =
2281  iBooker.book1D(histname + "Endcap_miniAOD", "hcalTowerBcSumEtConeDR04: Endcap ", etBin, etMin, 20.);
2282  histname = "isoTrkSolidConeDR04";
2283  h_isoTrkSolidConeDR04_miniAOD_[0][0] =
2284  iBooker.book1D(histname + "All_miniAOD", "isoTrkSolidConeDR04: All Ecal", etBin, etMin, etMax * 0.1);
2285  h_isoTrkSolidConeDR04_miniAOD_[0][1] =
2286  iBooker.book1D(histname + "Barrel_miniAOD", "isoTrkSolidConeDR04: Barrel ", etBin, etMin, etMax * 0.1);
2287  h_isoTrkSolidConeDR04_miniAOD_[0][2] =
2288  iBooker.book1D(histname + "Endcap_miniAOD", "isoTrkSolidConeDR04: Endcap ", etBin, etMin, etMax * 0.1);
2289  histname = "nTrkSolidConeDR04";
2290  h_nTrkSolidConeDR04_miniAOD_[0][0] =
2291  iBooker.book1D(histname + "All_miniAOD", "nTrkSolidConeDR04: All Ecal", 20, 0., 20);
2292  h_nTrkSolidConeDR04_miniAOD_[0][1] =
2293  iBooker.book1D(histname + "Barrel_miniAOD", "nTrkSolidConeDR04: Barrel ", 20, 0., 20);
2294  h_nTrkSolidConeDR04_miniAOD_[0][2] =
2295  iBooker.book1D(histname + "Endcap_miniAOD", "nTrkSolidConeDR04: Endcap ", 20, 0., 20);
2296 
2297  // Infos from Particle Flow - isolation and ID
2298  histname = "chargedHadIso";
2299  h_chHadIso_miniAOD_[0] = iBooker.book1D(histname + "All_miniAOD", "PF chargedHadIso: All Ecal", etBin, etMin, 20.);
2300  h_chHadIso_miniAOD_[1] = iBooker.book1D(histname + "Barrel_miniAOD", "PF chargedHadIso: Barrel", etBin, etMin, 20.);
2301  h_chHadIso_miniAOD_[2] = iBooker.book1D(histname + "Endcap_miniAOD", "PF chargedHadIso: Endcap", etBin, etMin, 20.);
2302  histname = "neutralHadIso";
2303  h_nHadIso_miniAOD_[0] = iBooker.book1D(histname + "All_miniAOD", "PF neutralHadIso: All Ecal", etBin, etMin, 20.);
2304  h_nHadIso_miniAOD_[1] = iBooker.book1D(histname + "Barrel_miniAOD", "PF neutralHadIso: Barrel", etBin, etMin, 20.);
2305  h_nHadIso_miniAOD_[2] = iBooker.book1D(histname + "Endcap_miniAOD", "PF neutralHadIso: Endcap", etBin, etMin, 20.);
2306  histname = "photonIso";
2307  h_phoIso_miniAOD_[0] = iBooker.book1D(histname + "All_miniAOD", "PF photonIso: All Ecal", etBin, etMin, 20.);
2308  h_phoIso_miniAOD_[1] = iBooker.book1D(histname + "Barrel_miniAOD", "PF photonIso: Barrel", etBin, etMin, 20.);
2309  h_phoIso_miniAOD_[2] = iBooker.book1D(histname + "Endcap_miniAOD", "PF photonIso: Endcap", etBin, etMin, 20.);
2310 
2311  iBooker.setCurrentFolder("EgammaV/" + fName_ + "/ConversionInfo");
2312 
2313  histname = "nConv";
2314  h_nConv_[0][0] = iBooker.book1D(histname + "All",
2315  "Number Of two-tracks Conversions per isolated candidates per events: All Ecal ",
2316  10,
2317  -0.5,
2318  9.5);
2319  h_nConv_[0][1] = iBooker.book1D(histname + "Barrel",
2320  "Number Of two-tracks Conversions per isolated candidates per events: Ecal Barrel ",
2321  10,
2322  -0.5,
2323  9.5);
2324  h_nConv_[0][2] = iBooker.book1D(histname + "Endcap",
2325  "Number Of two-tracks Conversions per isolated candidates per events: Ecal Endcap ",
2326  10,
2327  -0.5,
2328  9.5);
2329  h_nConv_[1][0] = iBooker.book1D(histname + "OneLegAll",
2330  "Number Of single leg Conversions per isolated candidates per events: All Ecal ",
2331  10,
2332  -0.5,
2333  9.5);
2334  h_nConv_[1][1] = iBooker.book1D(histname + "OneLegBarrel",
2335  "Number Of single leg Conversions per isolated candidates per events: Ecal Barrel ",
2336  10,
2337  -0.5,
2338  9.5);
2339  h_nConv_[1][2] = iBooker.book1D(histname + "OneLegEndcap",
2340  "Number Of single leg Conversions per isolated candidates per events: Ecal Endcap ",
2341  10,
2342  -0.5,
2343  9.5);
2344 
2345  h_convEta_[0] = iBooker.book1D("convEta1", " converted Photon Eta >1 track", etaBin, etaMin, etaMax);
2346  h_convEta_[1] = iBooker.book1D("convEta2", " converted Photon Eta =2 tracks ", etaBin, etaMin, etaMax);
2347  h_convEta_[2] = iBooker.book1D("convEta2ass", " converted Photon Eta =2 tracks, both ass ", etaBin, etaMin, etaMax);
2348  h_convPhi_[0] = iBooker.book1D("convPhi", " converted Photon Phi ", phiBin, phiMin, phiMax);
2349 
2350  histname = "convERes";
2351  h_convERes_[0][0] =
2352  iBooker.book1D(histname + "All", " Conversion rec/true Energy: All ecal ", resBin, resMin, resMax);
2353  h_convERes_[0][1] =
2354  iBooker.book1D(histname + "Barrel", " Conversion rec/true Energy: Barrel ", resBin, resMin, resMax);
2355  h_convERes_[0][2] =
2356  iBooker.book1D(histname + "Endcap", " Conversion rec/true Energy: Endcap ", resBin, resMin, resMax);
2357 
2358  histname = "p_EResVsR";
2359  p_eResVsR_ = iBooker.bookProfile(
2360  histname + "All", " photons conversion E/Etrue vs R: all Ecal ", rBin, rMin, rMax, 100, 0., 1.5, "");
2361 
2362  histname = "convPtRes";
2363  h_convPtRes_[1][0] =
2364  iBooker.book1D(histname + "All", " Conversion Pt rec/true from tracks : All ecal ", resBin, 0., 1.5);
2365  h_convPtRes_[1][1] =
2366  iBooker.book1D(histname + "Barrel", " Conversion Pt rec/true from tracks: Barrel ", resBin, 0., 1.5);
2367  h_convPtRes_[1][2] =
2368  iBooker.book1D(histname + "Endcap", " Conversion Pt rec/true from tracks: Endcap ", resBin, 0., 1.5);
2369 
2370  if (!isRunCentrally_) {
2371  histname = "r9VsTracks";
2372  h_r9VsNofTracks_[0][0] = iBooker.book2D(
2373  histname + "All", " photons r9 vs nTracks from conversions: All Ecal", r9Bin, r9Min, r9Max, 3, -0.5, 2.5);
2374  h_r9VsNofTracks_[0][1] = iBooker.book2D(
2375  histname + "Barrel", " photons r9 vs nTracks from conversions: Barrel Ecal", r9Bin, r9Min, r9Max, 3, -0.5, 2.5);
2376  h_r9VsNofTracks_[0][2] = iBooker.book2D(
2377  histname + "Endcap", " photons r9 vs nTracks from conversions: Endcap Ecal", r9Bin, r9Min, r9Max, 3, -0.5, 2.5);
2378  }
2379 
2380  histname = "mvaOut";
2381  h_mvaOut_[0] = iBooker.book1D(histname + "All", " mvaOut for all conversions : All Ecal", 100, 0., 1.);
2382  h_mvaOut_[1] = iBooker.book1D(histname + "Barrel", " mvaOut for all conversions : Barrel Ecal", 100, 0., 1.);
2383  h_mvaOut_[2] = iBooker.book1D(histname + "Endcap", " mvaOut for all conversions : Endcap Ecal", 100, 0., 1.);
2384 
2385  histname = "EoverPtracks";
2386  h_EoverPTracks_[0][0] =
2387  iBooker.book1D(histname + "BarrelPix", " photons conversion E/p: barrel pix", eoverpBin, eoverpMin, eoverpMax);
2388  h_EoverPTracks_[0][1] =
2389  iBooker.book1D(histname + "BarrelTib", " photons conversion E/p: barrel tib", eoverpBin, eoverpMin, eoverpMax);
2390  h_EoverPTracks_[0][2] =
2391  iBooker.book1D(histname + "BarrelTob", " photons conversion E/p: barrel tob ", eoverpBin, eoverpMin, eoverpMax);
2392 
2393  h_EoverPTracks_[1][0] = iBooker.book1D(histname + "All", " photons conversion E/p: all Ecal ", 100, 0., 5.);
2394  h_EoverPTracks_[1][1] = iBooker.book1D(histname + "Barrel", " photons conversion E/p: Barrel Ecal", 100, 0., 5.);
2395  h_EoverPTracks_[1][2] = iBooker.book1D(histname + "Endcap", " photons conversion E/p: Endcap Ecal ", 100, 0., 5.);
2396  histname = "EoverP_SL";
2397  h_EoverP_SL_[0] = iBooker.book1D(histname + "All", " photons single leg conversion E/p: all Ecal ", 100, 0., 5.);
2398  h_EoverP_SL_[1] = iBooker.book1D(histname + "Barrel", " photons single leg conversion E/p: Barrel Ecal", 100, 0., 5.);
2399  h_EoverP_SL_[2] =
2400  iBooker.book1D(histname + "Endcap", " photons single leg conversion E/p: Endcap Ecal ", 100, 0., 5.);
2401 
2402  histname = "PoverEtracks";
2403  h_PoverETracks_[1][0] =
2404  iBooker.book1D(histname + "All", " photons conversion p/E: all Ecal ", povereBin, povereMin, povereMax);
2405  h_PoverETracks_[1][1] =
2406  iBooker.book1D(histname + "Barrel", " photons conversion p/E: Barrel Ecal", povereBin, povereMin, povereMax);
2407  h_PoverETracks_[1][2] =
2408  iBooker.book1D(histname + "Endcap", " photons conversion p/E: Endcap Ecal ", povereBin, povereMin, povereMax);
2409 
2410  histname = "pEoverEtrueVsEta";
2411  p_EoverEtrueVsEta_[0] =
2412  iBooker.bookProfile(histname + "All",
2413  " photons conversion with 2 (associated) reco tracks E/Etrue vs #eta: all Ecal ",
2414  etaBin2,
2415  etaMin,
2416  etaMax,
2417  100,
2418  0.,
2419  2.5,
2420  "");
2421 
2422  histname = "pEoverEtrueVsR";
2423  p_EoverEtrueVsR_[0] = iBooker.bookProfile(
2424  histname + "All", " photons conversion E/Etrue vs R: all Ecal ", rBin, rMin, rMax, 100, 0., 2.5, "");
2425 
2426  histname = "pEoverEtrueVsEta";
2427  p_EoverEtrueVsEta_[1] = iBooker.bookProfile(histname + "All2",
2428  " photons conversion 2 reco tracks E/Etrue vs #eta: all Ecal ",
2429  etaBin2,
2430  etaMin,
2431  etaMax,
2432  100,
2433  0.,
2434  2.5,
2435  "");
2436 
2437  histname = "pPoverPtrueVsEta";
2438  p_PoverPtrueVsEta_[0] = iBooker.bookProfile(
2439  histname + "All", " photons conversion P/Ptrue vs #eta: all Ecal ", etaBin2, etaMin, etaMax, 100, 0., 5., "");
2440 
2441  histname = "pEoverPVsEta";
2442  p_EoverPVsEta_[0] = iBooker.bookProfile(
2443  histname + "All", " photons conversion E/P vs #eta: all Ecal ", etaBin2, etaMin, etaMax, 100, 0., 5., "");
2444 
2445  if (!isRunCentrally_) {
2446  histname = "EoverEtrueVsEoverP";
2447  h2_EoverEtrueVsEoverP_[0] =
2448  iBooker.book2D(histname + "All", " photons conversion E/Etrue vs E/P: all Ecal ", 100, 0., 5., 100, 0.5, 1.5);
2449  h2_EoverEtrueVsEoverP_[1] = iBooker.book2D(
2450  histname + "Barrel", " photons conversion E/Etrue vs E/: Barrel Ecal", 100, 0., 5., 100, 0.5, 1.5);
2451  h2_EoverEtrueVsEoverP_[2] = iBooker.book2D(
2452  histname + "Endcap", " photons conversion E/Etrue vs E/: Endcap Ecal ", 100, 0., 5., 100, 0.5, 1.5);
2453  histname = "PoverPtrueVsEoverP";
2454  h2_PoverPtrueVsEoverP_[0] =
2455  iBooker.book2D(histname + "All", " photons conversion P/Ptrue vs E/P: all Ecal ", 100, 0., 5., 100, 0., 2.5);
2456  h2_PoverPtrueVsEoverP_[1] = iBooker.book2D(
2457  histname + "Barrel", " photons conversion P/Ptrue vs E/: Barrel Ecal", 100, 0., 5., 100, 0., 2.5);
2458  h2_PoverPtrueVsEoverP_[2] = iBooker.book2D(
2459  histname + "Endcap", " photons conversion P/Ptrue vs E/: Endcap Ecal ", 100, 0., 5., 100, 0., 2.5);
2460 
2461  histname = "EoverEtrueVsEta";
2462  h2_EoverEtrueVsEta_[0] =
2463  iBooker.book2D(histname + "All",
2464  " photons conversion with 2 (associated) reco tracks E/Etrue vs #eta: all Ecal ",
2465  etaBin2,
2466  etaMin,
2467  etaMax,
2468  100,
2469  0.,
2470  2.5);
2471 
2472  histname = "EoverEtrueVsEta";
2473  h2_EoverEtrueVsEta_[1] = iBooker.book2D(histname + "All2",
2474  " photons conversion 2 reco tracks E/Etrue vs #eta: all Ecal ",
2475  etaBin2,
2476  etaMin,
2477  etaMax,
2478  100,
2479  0.,
2480  2.5);
2481 
2482  histname = "EoverEtrueVsR";
2483  h2_EoverEtrueVsR_[0] =
2484  iBooker.book2D(histname + "All", " photons conversion E/Etrue vs R: all Ecal ", rBin, rMin, rMax, 100, 0., 2.5);
2485 
2486  histname = "PoverPtrueVsEta";
2487  h2_PoverPtrueVsEta_[0] = iBooker.book2D(
2488  histname + "All", " photons conversion P/Ptrue vs #eta: all Ecal ", etaBin2, etaMin, etaMax, 100, 0., 5.);
2489 
2490  histname = "EoverPVsEta";
2491  h2_EoverPVsEta_[0] = iBooker.book2D(
2492  histname + "All", " photons conversion E/P vs #eta: all Ecal ", etaBin2, etaMin, etaMax, 100, 0., 5.);
2493 
2494  histname = "EoverPVsR";
2495  h2_EoverPVsR_[0] =
2496  iBooker.book2D(histname + "All", " photons conversion E/P vs R: all Ecal ", rBin, rMin, rMax, 100, 0., 5.);
2497 
2498  histname = "etaVsRsim";
2499  h2_etaVsRsim_[0] = iBooker.book2D(histname + "All",
2500  " eta(sim) vs R (sim) for associated conversions: all Ecal ",
2501  etaBin,
2502  etaMin,
2503  etaMax,
2504  rBin,
2505  rMin,
2506  rMax);
2507  histname = "etaVsRreco";
2508  h2_etaVsRreco_[0] = iBooker.book2D(histname + "All",
2509  " eta(reco) vs R (reco) for associated conversions: all Ecal ",
2510  etaBin,
2511  etaMin,
2512  etaMax,
2513  rBin,
2514  rMin,
2515  rMax);
2516  }
2517 
2518  histname = "pEoverPVsR";
2519  p_EoverPVsR_[0] = iBooker.bookProfile(
2520  histname + "All", " photons conversion E/P vs R: all Ecal ", rBin, rMin, rMax, 100, 0., 5., "");
2521 
2522  histname = "hInvMass";
2523  h_invMass_[0][0] = iBooker.book1D(
2524  histname + "All_AllTracks", " Photons:Tracks from conversion: Pair invariant mass: all Ecal ", 100, 0., 1.5);
2525  h_invMass_[0][1] = iBooker.book1D(
2526  histname + "Barrel_AllTracks", " Photons:Tracks from conversion: Pair invariant mass: Barrel Ecal ", 100, 0., 1.5);
2527  h_invMass_[0][2] = iBooker.book1D(
2528  histname + "Endcap_AllTracks", " Photons:Tracks from conversion: Pair invariant mass: Endcap Ecal ", 100, 0., 1.5);
2529  histname = "hInvMass";
2530  h_invMass_[1][0] = iBooker.book1D(
2531  histname + "All_AssTracks", " Photons:Tracks from conversion: Pair invariant mass: all Ecal ", 100, 0., 1.5);
2532  h_invMass_[1][1] = iBooker.book1D(
2533  histname + "Barrel_AssTracks", " Photons:Tracks from conversion: Pair invariant mass: Barrel Ecal ", 100, 0., 1.5);
2534  h_invMass_[1][2] = iBooker.book1D(
2535  histname + "Endcap_AssTracks", " Photons:Tracks from conversion: Pair invariant mass: Endcap Ecal ", 100, 0., 1.5);
2536 
2537  histname = "hDPhiTracksAtVtx";
2538  h_DPhiTracksAtVtx_[1][0] = iBooker.book1D(histname + "All",
2539  " Photons:Tracks from conversions: #delta#phi Tracks at vertex: all Ecal",
2540  dPhiTracksBin,
2541  dPhiTracksMin,
2542  dPhiTracksMax);
2543  h_DPhiTracksAtVtx_[1][1] =
2544  iBooker.book1D(histname + "Barrel",
2545  " Photons:Tracks from conversions: #delta#phi Tracks at vertex: Barrel Ecal",
2546  dPhiTracksBin,
2547  dPhiTracksMin,
2548  dPhiTracksMax);
2549  h_DPhiTracksAtVtx_[1][2] =
2550  iBooker.book1D(histname + "Endcap",
2551  " Photons:Tracks from conversions: #delta#phi Tracks at vertex: Endcap Ecal",
2552  dPhiTracksBin,
2553  dPhiTracksMin,
2554  dPhiTracksMax);
2555 
2556  if (!isRunCentrally_) {
2557  histname = "hDPhiTracksAtVtxVsEta";
2558  h2_DPhiTracksAtVtxVsEta_ = iBooker.book2D(histname + "All",
2559  " Photons:Tracks from conversions: #delta#phi Tracks at vertex vs #eta",
2560  etaBin2,
2561  etaMin,
2562  etaMax,
2563  100,
2564  -0.5,
2565  0.5);
2566 
2567  histname = "hDPhiTracksAtVtxVsR";
2568  h2_DPhiTracksAtVtxVsR_ = iBooker.book2D(histname + "All",
2569  " Photons:Tracks from conversions: #delta#phi Tracks at vertex vs R",
2570  rBin,
2571  rMin,
2572  rMax,
2573  100,
2574  -0.5,
2575  0.5);
2576 
2577  histname = "hDCotTracksVsEta";
2578  h2_DCotTracksVsEta_ = iBooker.book2D(histname + "All",
2579  " Photons:Tracks from conversions: #delta cotg(#Theta) Tracks vs #eta",
2580  etaBin2,
2581  etaMin,
2582  etaMax,
2583  100,
2584  -0.2,
2585  0.2);
2586 
2587  histname = "hDCotTracksVsR";
2588  h2_DCotTracksVsR_ = iBooker.book2D(histname + "All",
2589  " Photons:Tracks from conversions: #delta cotg(#Theta) Tracks at vertex vs R",
2590  rBin,
2591  rMin,
2592  rMax,
2593  100,
2594  -0.2,
2595  0.2);
2596 
2597  histname = "h2_DPhiTracksAtEcalVsR";
2598  if (fName_ != "pfPhotonValidator" && fName_ != "oldpfPhotonValidator")
2599  h2_DPhiTracksAtEcalVsR_ = iBooker.book2D(histname + "All",
2600  " Photons:Tracks from conversions: #delta#phi at Ecal vs R : all Ecal ",
2601  rBin,
2602  rMin,
2603  rMax,
2604  dPhiTracksBin,
2605  0.,
2606  dPhiTracksMax);
2607 
2608  histname = "h2_DPhiTracksAtEcalVsEta";
2609  if (fName_ != "pfPhotonValidator" && fName_ != "oldpfPhotonValidator")
2610  h2_DPhiTracksAtEcalVsEta_ =
2611  iBooker.book2D(histname + "All",
2612  " Photons:Tracks from conversions: #delta#phi at Ecal vs #eta : all Ecal ",
2613  etaBin2,
2614  etaMin,
2615  etaMax,
2616  dPhiTracksBin,
2617  0.,
2618  dPhiTracksMax);
2619  }
2620 
2621  histname = "pDPhiTracksAtVtxVsEta";
2622  p_DPhiTracksAtVtxVsEta_ =
2623  iBooker.bookProfile(histname + "All",
2624  " Photons:Tracks from conversions: #delta#phi Tracks at vertex vs #eta ",
2625  etaBin2,
2626  etaMin,
2627  etaMax,
2628  100,
2629  -0.5,
2630  0.5,
2631  "");
2632 
2633  histname = "pDPhiTracksAtVtxVsR";
2634  p_DPhiTracksAtVtxVsR_ = iBooker.bookProfile(histname + "All",
2635  " Photons:Tracks from conversions: #delta#phi Tracks at vertex vs R ",
2636  rBin,
2637  rMin,
2638  rMax,
2639  100,
2640  -0.5,
2641  0.5,
2642  "");
2643 
2644  histname = "hDCotTracks";
2645  h_DCotTracks_[1][0] = iBooker.book1D(histname + "All",
2646  " Photons:Tracks from conversions #delta cotg(#Theta) Tracks: all Ecal ",
2647  dCotTracksBin,
2648  dCotTracksMin,
2649  dCotTracksMax);
2650  h_DCotTracks_[1][1] = iBooker.book1D(histname + "Barrel",
2651  " Photons:Tracks from conversions #delta cotg(#Theta) Tracks: Barrel Ecal ",
2652  dCotTracksBin,
2653  dCotTracksMin,
2654  dCotTracksMax);
2655  h_DCotTracks_[1][2] = iBooker.book1D(histname + "Endcap",
2656  " Photons:Tracks from conversions #delta cotg(#Theta) Tracks: Endcap Ecal ",
2657  dCotTracksBin,
2658  dCotTracksMin,
2659  dCotTracksMax);
2660 
2661  histname = "pDCotTracksVsEta";
2662  p_DCotTracksVsEta_ = iBooker.bookProfile(histname + "All",
2663  " Photons:Tracks from conversions: #delta cotg(#Theta) Tracks vs #eta ",
2664  etaBin2,
2665  etaMin,
2666  etaMax,
2667  100,
2668  -0.2,
2669  0.2,
2670  "");
2671 
2672  histname = "pDCotTracksVsR";
2673  p_DCotTracksVsR_ =
2674  iBooker.bookProfile(histname + "All",
2675  " Photons:Tracks from conversions: #delta cotg(#Theta) Tracks at vertex vs R ",
2676  rBin,
2677  rMin,
2678  rMax,
2679  100,
2680  -0.2,
2681  0.2,
2682  "");
2683 
2684  histname = "hDistMinAppTracks";
2685  h_distMinAppTracks_[1][0] = iBooker.book1D(histname + "All",
2686  " Photons:Tracks from conversions Min Approach Dist Tracks: all Ecal ",
2687  dEtaTracksBin,
2688  -0.1,
2689  0.6);
2690  h_distMinAppTracks_[1][1] = iBooker.book1D(histname + "Barrel",
2691  " Photons:Tracks from conversions Min Approach Dist Tracks: Barrel Ecal ",
2692  dEtaTracksBin,
2693  -0.1,
2694  0.6);
2695  h_distMinAppTracks_[1][2] = iBooker.book1D(histname + "Endcap",
2696  " Photons:Tracks from conversions Min Approach Dist Tracks: Endcap Ecal ",
2697  dEtaTracksBin,
2698  -0.1,
2699  0.6);
2700 
2701  // if ( fName_ != "pfPhotonValidator" && fName_ != "oldpfPhotonValidator" ) {
2702  histname = "hDPhiTracksAtEcal";
2703  h_DPhiTracksAtEcal_[1][0] = iBooker.book1D(histname + "All",
2704  " Photons:Tracks from conversions: #delta#phi at Ecal : all Ecal ",
2705  dPhiTracksBin,
2706  0.,
2707  dPhiTracksMax);
2708  h_DPhiTracksAtEcal_[1][1] = iBooker.book1D(histname + "Barrel",
2709  " Photons:Tracks from conversions: #delta#phi at Ecal : Barrel Ecal ",
2710  dPhiTracksBin,
2711  0.,
2712  dPhiTracksMax);
2713  h_DPhiTracksAtEcal_[1][2] = iBooker.book1D(histname + "Endcap",
2714  " Photons:Tracks from conversions: #delta#phi at Ecal : Endcap Ecal ",
2715  dPhiTracksBin,
2716  0.,
2717  dPhiTracksMax);
2718 
2719  histname = "pDPhiTracksAtEcalVsR";
2720  p_DPhiTracksAtEcalVsR_ = iBooker.bookProfile(histname + "All",
2721  " Photons:Tracks from conversions: #delta#phi at Ecal vs R ",
2722  rBin,
2723  rMin,
2724  rMax,
2725  dPhiTracksBin,
2726  0.,
2727  dPhiTracksMax,
2728  "");
2729 
2730  histname = "pDPhiTracksAtEcalVsEta";
2731  p_DPhiTracksAtEcalVsEta_ = iBooker.bookProfile(histname + "All",
2732  " Photons:Tracks from conversions: #delta#phi at Ecal vs #eta ",
2733  etaBin2,
2734  etaMin,
2735  etaMax,
2736  dPhiTracksBin,
2737  0.,
2738  dPhiTracksMax,
2739  "");
2740 
2741  histname = "hDEtaTracksAtEcal";
2742  h_DEtaTracksAtEcal_[1][0] = iBooker.book1D(histname + "All",
2743  " Photons:Tracks from conversions: #delta#eta at Ecal : all Ecal ",
2744  dEtaTracksBin,
2745  dEtaTracksMin,
2746  dEtaTracksMax);
2747  h_DEtaTracksAtEcal_[1][1] = iBooker.book1D(histname + "Barrel",
2748  " Photons:Tracks from conversions: #delta#eta at Ecal : Barrel Ecal ",
2749  dEtaTracksBin,
2750  dEtaTracksMin,
2751  dEtaTracksMax);
2752  h_DEtaTracksAtEcal_[1][2] = iBooker.book1D(histname + "Endcap",
2753  " Photons:Tracks from conversions: #delta#eta at Ecal : Endcap Ecal ",
2754  dEtaTracksBin,
2755  dEtaTracksMin,
2756  dEtaTracksMax);
2757 
2758  // }
2759 
2760  h_convVtxRvsZ_[0] = iBooker.book2D("convVtxRvsZAll",
2761  " Photon Reco conversion vtx position",
2762  zBinForXray,
2763  zMinForXray,
2764  zMaxForXray,
2765  rBinForXray,
2766  rMinForXray,
2767  rMaxForXray);
2768  h_convVtxRvsZ_[1] = iBooker.book2D("convVtxRvsZBarrel",
2769  " Photon Reco conversion vtx position",
2770  zBinForXray,
2771  zMinForXray,
2772  zMaxForXray,
2773  rBinForXray,
2774  rMinForXray,
2775  rMaxForXray);
2776  h_convVtxRvsZ_[2] = iBooker.book2D("convVtxRvsZEndcap",
2777  " Photon Reco conversion vtx position",
2778  zBin2ForXray,
2779  zMinForXray,
2780  zMaxForXray,
2781  rBinForXray,
2782  rMinForXray,
2783  rMaxForXray);
2784  h_convVtxYvsX_ = iBooker.book2D(
2785  "convVtxYvsXTrkBarrel", " Photon Reco conversion vtx position, (x,y) eta<1 ", 100, -80., 80., 100, -80., 80.);
2786  //
2787  h_convSLVtxRvsZ_[0] = iBooker.book2D("convSLVtxRvsZAll",
2788  " Photon Reco single leg conversion innermost hit position",
2789  zBinForXray,
2790  zMinForXray,
2791  zMaxForXray,
2792  rBinForXray,
2793  rMinForXray,
2794  rMaxForXray);
2795  h_convSLVtxRvsZ_[1] = iBooker.book2D("convSLVtxRvsZBarrel",
2796  " Photon Reco single leg conversion innermost hit position",
2797  zBinForXray,
2798  zMinForXray,
2799  zMaxForXray,
2800  rBinForXray,
2801  rMinForXray,
2802  rMaxForXray);
2803  h_convSLVtxRvsZ_[2] = iBooker.book2D("convSLVtxRvsZEndcap",
2804  " Photon Reco single leg conversion innermost hit position",
2805  zBin2ForXray,
2806  zMinForXray,
2807  zMaxForXray,
2808  rBinForXray,
2809  rMinForXray,
2810  rMaxForXray);
2811 
2813  if (!isRunCentrally_) {
2814  h_convVtxRvsZ_zoom_[0] = iBooker.book2D("convVtxRvsZBarrelZoom1",
2815  " Photon Reco conversion vtx position",
2816  zBinForXray,
2817  zMinForXray,
2818  zMaxForXray,
2819  rBinForXray,
2820  -10.,
2821  40.);
2822  h_convVtxRvsZ_zoom_[1] = iBooker.book2D("convVtxRvsZBarrelZoom2",
2823  " Photon Reco conversion vtx position",
2824  zBinForXray,
2825  zMinForXray,
2826  zMaxForXray,
2827  rBinForXray,
2828  -10.,
2829  20.);
2830  h_convVtxYvsX_zoom_[0] = iBooker.book2D("convVtxYvsXTrkBarrelZoom1",
2831  " Photon Reco conversion vtx position, (x,y) eta<1 ",
2832  100,
2833  -40.,
2834  40.,
2835  100,
2836  -40.,
2837  40.);
2838  h_convVtxYvsX_zoom_[1] = iBooker.book2D("convVtxYvsXTrkBarrelZoom2",
2839  " Photon Reco conversion vtx position, (x,y) eta<1 ",
2840  100,
2841  -20.,
2842  20.,
2843  100,
2844  -20.,
2845  20.);
2846  }
2847 
2848  h_convVtxdX_ = iBooker.book1D("convVtxdX", " Photon Reco conversion vtx dX", 100, -20., 20.);
2849  h_convVtxdY_ = iBooker.book1D("convVtxdY", " Photon Reco conversion vtx dY", 100, -20., 20.);
2850  h_convVtxdZ_ = iBooker.book1D("convVtxdZ", " Photon Reco conversion vtx dZ", 100, -20., 20.);
2851  h_convVtxdR_ = iBooker.book1D("convVtxdR", " Photon Reco conversion vtx dR", 100, -20., 20.);
2852 
2853  h_convVtxdX_barrel_ =
2854  iBooker.book1D("convVtxdX_barrel", " Photon Reco conversion vtx dX, |eta|<=1.2", 100, -20., 20.);
2855  h_convVtxdY_barrel_ =
2856  iBooker.book1D("convVtxdY_barrel", " Photon Reco conversion vtx dY, |eta|<=1.2 ", 100, -20., 20.);
2857  h_convVtxdZ_barrel_ =
2858  iBooker.book1D("convVtxdZ_barrel", " Photon Reco conversion vtx dZ, |eta|<=1.2,", 100, -20., 20.);
2859  h_convVtxdR_barrel_ =
2860  iBooker.book1D("convVtxdR_barrel", " Photon Reco conversion vtx dR, |eta|<=1.2", 100, -20., 20.);
2861  h_convVtxdX_endcap_ =
2862  iBooker.book1D("convVtxdX_endcap", " Photon Reco conversion vtx dX, |eta|>1.2", 100, -20., 20.);
2863  h_convVtxdY_endcap_ =
2864  iBooker.book1D("convVtxdY_endcap", " Photon Reco conversion vtx dY, |eta|>1.2", 100, -20., 20.);
2865  h_convVtxdZ_endcap_ =
2866  iBooker.book1D("convVtxdZ_endcap", " Photon Reco conversion vtx dZ, |eta|>1.2", 100, -20., 20.);
2867  h_convVtxdR_endcap_ =
2868  iBooker.book1D("convVtxdR_endcap", " Photon Reco conversion vtx dR, |eta|>1.2 ", 100, -20., 20.);
2869 
2870  h_convVtxdPhi_ = iBooker.book1D("convVtxdPhi", " Photon Reco conversion vtx dPhi", 100, -0.005, 0.005);
2871  h_convVtxdEta_ = iBooker.book1D("convVtxdEta", " Photon Reco conversion vtx dEta", 100, -0.5, 0.5);
2872 
2873  if (!isRunCentrally_) {
2874  h2_convVtxdRVsR_ =
2875  iBooker.book2D("h2ConvVtxdRVsR", "Photon Reco conversion vtx dR vsR", rBin, rMin, rMax, 100, -20., 20.);
2876  h2_convVtxdRVsEta_ = iBooker.book2D(
2877  "h2ConvVtxdRVsEta", "Photon Reco conversion vtx dR vs Eta", etaBin2, etaMin, etaMax, 100, -20., 20.);
2878  }
2879 
2880  p_convVtxdRVsR_ =
2881  iBooker.bookProfile("pConvVtxdRVsR", "Photon Reco conversion vtx dR vsR", rBin, rMin, rMax, 100, -20., 20., "");
2882  p_convVtxdRVsEta_ = iBooker.bookProfile(
2883  "pConvVtxdRVsEta", "Photon Reco conversion vtx dR vs Eta", etaBin2, etaMin, etaMax, 100, -20., 20., "");
2884  p_convVtxdXVsX_ = iBooker.bookProfile("pConvVtxdXVsX", "Conversion vtx dX vs X", 120, -60, 60, 100, -20., 20., "");
2885  p_convVtxdYVsY_ = iBooker.bookProfile("pConvVtxdYVsY", "Conversion vtx dY vs Y", 120, -60, 60, 100, -20., 20., "");
2886  p_convVtxdZVsZ_ =
2887  iBooker.bookProfile("pConvVtxdZVsZ", "Conversion vtx dZ vs Z", zBin, zMin, zMax, 100, -20., 20., "");
2888 
2889  if (!isRunCentrally_) {
2890  h2_convVtxRrecVsTrue_ = iBooker.book2D(
2891  "h2ConvVtxRrecVsTrue", "Photon Reco conversion vtx R rec vs true", rBin, rMin, rMax, rBin, rMin, rMax);
2892  }
2893 
2894  histname = "vtxChi2";
2895  h_vtxChi2_[0] = iBooker.book1D(histname + "All", "vertex #chi^{2} all", 100, chi2Min, chi2Max);
2896  h_vtxChi2_[1] = iBooker.book1D(histname + "Barrel", "vertex #chi^{2} barrel", 100, chi2Min, chi2Max);
2897  h_vtxChi2_[2] = iBooker.book1D(histname + "Endcap", "vertex #chi^{2} endcap", 100, chi2Min, chi2Max);
2898  histname = "vtxChi2Prob";
2899  h_vtxChi2Prob_[0] = iBooker.book1D(histname + "All", "vertex #chi^{2} all", 100, 0., 1.);
2900  h_vtxChi2Prob_[1] = iBooker.book1D(histname + "Barrel", "vertex #chi^{2} barrel", 100, 0., 1.);
2901  h_vtxChi2Prob_[2] = iBooker.book1D(histname + "Endcap", "vertex #chi^{2} endcap", 100, 0., 1.);
2902 
2903  histname = "zPVFromTracks";
2904  h_zPVFromTracks_[0] = iBooker.book1D(histname + "All", " Photons: PV z from conversion tracks", 100, -30., 30.);
2905  h_zPVFromTracks_[1] = iBooker.book1D(histname + "Barrel", " Photons: PV z from conversion tracks", 100, -30., 30.);
2906  h_zPVFromTracks_[2] = iBooker.book1D(histname + "Endcap", " Photons: PV z from conversion tracks", 100, -30., 30.);
2907  h_zPVFromTracks_[3] = iBooker.book1D(histname + "EndcapP", " Photons: PV z from conversion tracks", 100, -30., 30.);
2908  h_zPVFromTracks_[4] = iBooker.book1D(histname + "EndcapM", " Photons: PV z from conversion tracks", 100, -30., 30.);
2909  histname = "dzPVFromTracks";
2910  h_dzPVFromTracks_[0] =
2911  iBooker.book1D(histname + "All", " Photons: PV Z_rec - Z_true from conversion tracks", 100, -10., 10.);
2912  h_dzPVFromTracks_[1] =
2913  iBooker.book1D(histname + "Barrel", " Photons: PV Z_rec - Z_true from conversion tracks", 100, -10., 10.);
2914  h_dzPVFromTracks_[2] =
2915  iBooker.book1D(histname + "Endcap", " Photons: PV Z_rec - Z_true from conversion tracks", 100, -10., 10.);
2916  h_dzPVFromTracks_[3] =
2917  iBooker.book1D(histname + "EndcapP", " Photons: PV Z_rec - Z_true from conversion tracks", 100, -10., 10.);
2918  h_dzPVFromTracks_[4] =
2919  iBooker.book1D(histname + "EndcapM", " Photons: PV Z_rec - Z_true from conversion tracks", 100, -10., 10.);
2920  p_dzPVVsR_ =
2921  iBooker.bookProfile("pdzPVVsR", "Photon Reco conversions: dz(PV) vs R", rBin, rMin, rMax, 100, -3., 3., "");
2922  p_dzPVVsEta_ = iBooker.bookProfile(
2923  "pdzPVVsEta", "Photon Reco conversions: dz(PV) vs Eta", etaBin, etaMin, etaMax, 100, -3., 3., "");
2924 
2925  if (!isRunCentrally_) {
2926  h2_dzPVVsR_ = iBooker.book2D("h2dzPVVsR", "Photon Reco conversions: dz(PV) vs R", rBin, rMin, rMax, 100, -3., 3.);
2927  }
2928 
2930  if (!isRunCentrally_) {
2931  histname = "nHitsVsEta";
2932  nHitsVsEta_[0] = iBooker.book2D(histname + "AllTracks",
2933  "Photons:Tracks from conversions: # of hits vs #eta all tracks",
2934  etaBin,
2935  etaMin,
2936  etaMax,
2937  25,
2938  0.,
2939  25.);
2940 
2941  histname = "nHitsVsEta";
2942  nHitsVsEta_[1] = iBooker.book2D(histname + "AssTracks",
2943  "Photons:Tracks from conversions: # of hits vs #eta associated tracks",
2944  etaBin,
2945  etaMin,
2946  etaMax,
2947  25,
2948  0.,
2949  25.);
2950 
2951  histname = "nHitsVsR";
2952  nHitsVsR_[0] = iBooker.book2D(histname + "AllTracks",
2953  "Photons:Tracks from conversions: # of hits vs radius all tracks",
2954  rBin,
2955  rMin,
2956  rMax,
2957  25,
2958  0.,
2959  25);
2960 
2961  histname = "nHitsVsR";
2962  nHitsVsR_[1] = iBooker.book2D(histname + "AssTracks",
2963  "Photons:Tracks from conversions: # of hits vs radius associated tracks",
2964  rBin,
2965  rMin,
2966  rMax,
2967  25,
2968  0.,
2969  25);
2970 
2971  histname = "h2Chi2VsEta";
2972  h2_Chi2VsEta_[0] = iBooker.book2D(
2973  histname + "All", " Reco Track #chi^{2} vs #eta: All ", etaBin2, etaMin, etaMax, 100, chi2Min, chi2Max);
2974 
2975  histname = "h2Chi2VsR";
2976  h2_Chi2VsR_[0] =
2977  iBooker.book2D(histname + "All", " Reco Track #chi^{2} vs R: All ", rBin, rMin, rMax, 100, chi2Min, chi2Max);
2978  }
2979 
2980  histname = "h_nHitsVsEta";
2981  p_nHitsVsEta_[0] = iBooker.bookProfile(histname + "AllTracks",
2982  "Photons:Tracks from conversions: # of hits vs #eta all tracks",
2983  etaBin,
2984  etaMin,
2985  etaMax,
2986  25,
2987  -0.5,
2988  24.5,
2989  "");
2990 
2991  histname = "h_nHitsVsEta";
2992  p_nHitsVsEta_[1] = iBooker.bookProfile(histname + "AssTracks",
2993  "Photons:Tracks from conversions: # of hits vs #eta associated tracks",
2994  etaBin,
2995  etaMin,
2996  etaMax,
2997  25,
2998  -0.5,
2999  24.5,
3000  "");
3001 
3002  histname = "p_nHitsVsEtaSL";
3003  p_nHitsVsEtaSL_[0] = iBooker.bookProfile(histname + "AllTracks",
3004  "Photons:Tracks from single leg conversions: # of hits vs #eta all tracks",
3005  etaBin,
3006  etaMin,
3007  etaMax,
3008  25,
3009  -0.5,
3010  24.5,
3011  "");
3012 
3013  histname = "h_nHitsVsR";
3014  p_nHitsVsR_[0] = iBooker.bookProfile(histname + "AllTracks",
3015  "Photons:Tracks from conversions: # of hits vs radius all tracks",
3016  rBin,
3017  rMin,
3018  rMax,
3019  25,
3020  -0.5,
3021  24.5,
3022  "");
3023  histname = "p_nHitsVsRSL";
3024  p_nHitsVsRSL_[0] = iBooker.bookProfile(histname + "AllTracks",
3025  "Photons:Tracks from single leg conversions: # of hits vs radius all tracks",
3026  rBin,
3027  rMin,
3028  rMax,
3029  25,
3030  -0.5,
3031  24.5,
3032  "");
3033 
3034  histname = "tkChi2";
3035  h_tkChi2_[0] = iBooker.book1D(
3036  histname + "AllTracks", "Photons:Tracks from conversions: #chi^{2} of all tracks", 100, chi2Min, chi2Max);
3037  histname = "tkChi2SL";
3038  h_tkChi2SL_[0] = iBooker.book1D(histname + "AllTracks",
3039  "Photons:Tracks from single leg conversions: #chi^{2} of associated tracks",
3040  100,
3041  chi2Min,
3042  chi2Max);
3043  histname = "tkChi2Large";
3044  h_tkChi2Large_[0] = iBooker.book1D(
3045  histname + "AllTracks", "Photons:Tracks from conversions: #chi^{2} of all tracks", 1000, 0., 5000.0);
3046 
3047  histname = "h_nHitsVsR";
3048  p_nHitsVsR_[1] = iBooker.bookProfile(histname + "AssTracks",
3049  "Photons:Tracks from conversions: # of hits vs radius associated tracks",
3050  rBin,
3051  rMin,
3052  rMax,
3053  25,
3054  -0.5,
3055  24.5,
3056  "");
3057 
3058  histname = "tkChi2";
3059  h_tkChi2_[1] = iBooker.book1D(
3060  histname + "AssTracks", "Photons:Tracks from conversions: #chi^{2} of associated tracks", 100, chi2Min, chi2Max);
3061  histname = "tkChi2Large";
3062  h_tkChi2Large_[1] = iBooker.book1D(
3063  histname + "AssTracks", "Photons:Tracks from conversions: #chi^{2} of associated tracks", 1000, 0., 5000.0);
3064 
3065  histname = "pChi2VsEta";
3066  p_Chi2VsEta_[0] = iBooker.bookProfile(
3067  histname + "All", " Reco Track #chi^{2} vs #eta : All ", etaBin2, etaMin, etaMax, 100, chi2Min, chi2Max, "");
3068 
3069  histname = "pChi2VsR";
3070  p_Chi2VsR_[0] = iBooker.bookProfile(
3071  histname + "All", " Reco Track #chi^{2} vas R : All ", rBin, rMin, rMax, 100, chi2Min, chi2Max, "");
3072 
3073  histname = "hTkD0";
3074  h_TkD0_[0] = iBooker.book1D(histname + "All", " Reco Track D0*q: All ", 100, -0.1, 0.6);
3075  h_TkD0_[1] = iBooker.book1D(histname + "Barrel", " Reco Track D0*q: Barrel ", 100, -0.1, 0.6);
3076  h_TkD0_[2] = iBooker.book1D(histname + "Endcap", " Reco Track D0*q: Endcap ", 100, -0.1, 0.6);
3077 
3078  histname = "hTkPtPull";
3079  h_TkPtPull_[0] = iBooker.book1D(histname + "All", " Reco Track Pt pull: All ", 100, -10., 10.);
3080  histname = "hTkPtPull";
3081  h_TkPtPull_[1] = iBooker.book1D(histname + "Barrel", " Reco Track Pt pull: Barrel ", 100, -10., 10.);
3082  histname = "hTkPtPull";
3083  h_TkPtPull_[2] = iBooker.book1D(histname + "Endcap", " Reco Track Pt pull: Endcap ", 100, -10., 10.);
3084 
3085  histname = "pTkPtPullEta";
3086  p_TkPtPull_[0] =
3087  iBooker.bookProfile(histname + "All", " Reco Track Pt pull: All ", etaBin2, etaMin, etaMax, 100, -10., 10., " ");
3088 
3089  if (!isRunCentrally_) {
3090  histname = "h2TkPtPullEta";
3091  h2_TkPtPull_[0] =
3092  iBooker.book2D(histname + "All", " Reco Track Pt pull: All ", etaBin2, etaMin, etaMax, 100, -10., 10.);
3093 
3094  histname = "PtRecVsPtSim";
3095  h2_PtRecVsPtSim_[0] =
3096  iBooker.book2D(histname + "All", "Pt Rec vs Pt sim: All ", etBin, etMin, etMax, etBin, etMin, etMax);
3097  h2_PtRecVsPtSim_[1] =
3098  iBooker.book2D(histname + "Barrel", "Pt Rec vs Pt sim: Barrel ", etBin, etMin, etMax, etBin, etMin, etMax);
3099  h2_PtRecVsPtSim_[2] =
3100  iBooker.book2D(histname + "Endcap", "Pt Rec vs Pt sim: Endcap ", etBin, etMin, etMax, etBin, etMin, etMax);
3101  histname = "PtRecVsPtSimMixProv";
3102  h2_PtRecVsPtSimMixProv_ = iBooker.book2D(
3103  histname + "All", "Pt Rec vs Pt sim All for mix with general tracks ", etBin, etMin, etMax, etBin, etMin, etMax);
3104  }
3105 
3106  // if ( fName_ != "pfPhotonValidator" && fName_ != "oldpfPhotonValidator" ) {
3107  histname = "eBcOverTkPout";
3108  hBCEnergyOverTrackPout_[0] = iBooker.book1D(histname + "All", "Matrching BC E/P_out: all Ecal ", 100, 0., 5.);
3109  hBCEnergyOverTrackPout_[1] = iBooker.book1D(histname + "Barrel", "Matrching BC E/P_out: Barrel ", 100, 0., 5.);
3110  hBCEnergyOverTrackPout_[2] = iBooker.book1D(histname + "Endcap", "Matrching BC E/P_out: Endcap ", 100, 0., 5.);
3111  // }
3112 
3114  h_OIinnermostHitR_ = iBooker.book1D("OIinnermostHitR", " R innermost hit for OI tracks ", 50, 0., 25);
3115  h_IOinnermostHitR_ = iBooker.book1D("IOinnermostHitR", " R innermost hit for IO tracks ", 50, 0., 25);
3116 
3118  h_trkProv_[0] = iBooker.book1D("allTrkProv", " Track pair provenance ", 4, 0., 4.);
3119  h_trkProv_[1] = iBooker.book1D("assTrkProv", " Track pair provenance ", 4, 0., 4.);
3120  //
3121  h_trkAlgo_ =
3122  iBooker.book1D("allTrackAlgo", " Track Algo ", reco::TrackBase::algoSize, -0.5, reco::TrackBase::algoSize - 0.5);
3123  h_convAlgo_ = iBooker.book1D("allConvAlgo", " Conv Algo ", 5, -0.5, 4.5);
3124  h_convQuality_ = iBooker.book1D("allConvQuality", "Conv quality ", 11, -0.5, 11.);
3125 
3126  // histos for fake rate
3127  histname = "h_RecoConvTwoTracksEta";
3128  h_RecoConvTwoTracks_[0] =
3129  iBooker.book1D(histname, " All reco conversions with 2 reco tracks: simulated #eta", etaBin2, etaMin, etaMax);
3130  histname = "h_RecoConvTwoTracksPhi";
3131  h_RecoConvTwoTracks_[1] =
3132  iBooker.book1D(histname, " All reco conversions with 2 reco tracks: simulated #phi", phiBin, phiMin, phiMax);
3133  histname = "h_RecoConvTwoTracksR";
3134  h_RecoConvTwoTracks_[2] =
3135  iBooker.book1D(histname, " All reco conversions with 2 reco tracks: simulated R", rBin, rMin, rMax);
3136  histname = "h_RecoConvTwoTracksZ";
3137  h_RecoConvTwoTracks_[3] =
3138  iBooker.book1D(histname, " All reco conversions with 2 reco tracks: simulated Z", zBin, zMin, zMax);
3139  histname = "h_RecoConvTwoTracksEt";
3140  h_RecoConvTwoTracks_[4] =
3141  iBooker.book1D(histname, " All reco conversions with 2 reco tracks: simulated Et", etBin, etMin, etMax);
3142  //
3143  histname = "h_RecoConvTwoMTracksEta";
3144  h_RecoConvTwoMTracks_[0] =
3145  iBooker.book1D(histname, " All reco conversions with 2 reco-ass tracks: simulated #eta", etaBin2, etaMin, etaMax);
3146  histname = "h_RecoConvTwoMTracksPhi";
3147  h_RecoConvTwoMTracks_[1] =
3148  iBooker.book1D(histname, " All reco conversions with 2 reco-ass tracks: simulated #phi", phiBin, phiMin, phiMax);
3149  histname = "h_RecoConvTwoMTracksR";
3150  h_RecoConvTwoMTracks_[2] =
3151  iBooker.book1D(histname, " All reco conversions with 2 reco-ass tracks: simulated R", rBin, rMin, rMax);
3152  histname = "h_RecoConvTwoMTracksZ";
3153  h_RecoConvTwoMTracks_[3] =
3154  iBooker.book1D(histname, " All reco conversions with 2 reco-ass tracks: simulated Z", zBin, zMin, zMax);
3155  histname = "h_RecoConvTwoMTracksEt";
3156  h_RecoConvTwoMTracks_[4] =
3157  iBooker.book1D(histname, " All reco conversions with 2 reco-ass tracks: simulated Et", etBin, etMin, etMax);
3158 }
3159 
3160 void PhotonValidator::dqmBeginRun(edm::Run const& r, edm::EventSetup const& theEventSetup) {
3161  //get magnetic field
3162  edm::LogInfo("ConvertedPhotonProducer") << " get magnetic field"
3163  << "\n";
3164  theEventSetup.get<IdealMagneticFieldRecord>().get(theMF_);
3165 
3166  thePhotonMCTruthFinder_ = std::make_unique<PhotonMCTruthFinder>();
3167 }
3168 
3169 void PhotonValidator::dqmEndRun(edm::Run const& r, edm::EventSetup const& theEventSetup) {
3170  thePhotonMCTruthFinder_.reset();
3171 }
3172 
3174  thePhotonMCTruthFinder_->clear();
3175  using namespace edm;
3176  // const float etaPhiDistance=0.01;
3177  // Fiducial region
3178  // const float TRK_BARL =0.9;
3179  const float BARL = 1.4442; // DAQ TDR p.290
3180  // const float END_LO = 1.566; // unused
3181  const float END_HI = 2.5;
3182  // Electron mass
3183  //const Float_t mElec= 0.000511;
3184 
3186  e.getByLabel("trackAssociatorByHitsForPhotonValidation", theHitsAssociator);
3188 
3189  nEvt_++;
3190  LogInfo("PhotonValidator") << "PhotonValidator Analyzing event number: " << e.id() << " Global Counter " << nEvt_
3191  << "\n";
3192 
3193  // get the geometry from the event setup:
3194  esup.get<CaloGeometryRecord>().get(theCaloGeom_);
3195 
3197  e.getByToken(offline_pvToken_, vtxH);
3198  h_nRecoVtx_->Fill(float(vtxH->size()));
3199 
3200  // Transform Track into TransientTrack (needed by the Vertex fitter)
3202  esup.get<TransientTrackRecord>().get("TransientTrackBuilder", theTTB);
3203 
3205  Handle<reco::PhotonCollection> photonHandle;
3206  e.getByToken(photonCollectionToken_, photonHandle);
3207  const reco::PhotonCollection photonCollection = *(photonHandle.product());
3208  if (!photonHandle.isValid()) {
3209  edm::LogError("PhotonProducer") << "Error! Can't get the Photon collection " << std::endl;
3210  return;
3211  }
3212 
3213  // Get the PF refined cluster collection
3214  Handle<reco::PFCandidateCollection> pfCandidateHandle;
3215  e.getByToken(pfCandidates_, pfCandidateHandle);
3216  if (!pfCandidateHandle.isValid()) {
3217  edm::LogError("PhotonValidator") << "Error! Can't get the product pfCandidates " << std::endl;
3218  }
3219 
3220  edm::Handle<edm::ValueMap<std::vector<reco::PFCandidateRef> > > phoToParticleBasedIsoMapHandle;
3221  edm::ValueMap<std::vector<reco::PFCandidateRef> > phoToParticleBasedIsoMap;
3222  if (fName_ == "pfPhotonValidator") {
3223  e.getByToken(particleBasedIso_token, phoToParticleBasedIsoMapHandle);
3224  if (!phoToParticleBasedIsoMapHandle.isValid()) {
3225  edm::LogInfo("PhotonValidator") << "Error! Can't get the product: valueMap photons to particle based iso "
3226  << std::endl;
3227  }
3228  phoToParticleBasedIsoMap = *(phoToParticleBasedIsoMapHandle.product());
3229  }
3230 
3231  Handle<edm::View<reco::Track> > outInTrkHandle;
3232  Handle<edm::View<reco::Track> > inOutTrkHandle;
3233  if (!fastSim_) {
3235  e.getByToken(conversionOITrackPr_Token_, outInTrkHandle);
3237  e.getByToken(conversionIOTrackPr_Token_, inOutTrkHandle);
3238 
3239  // Loop over Out In Tracks
3240  int iTrk = 0;
3241  int nHits = 0;
3242  for (View<reco::Track>::const_iterator iTk = outInTrkHandle->begin(); iTk != outInTrkHandle->end(); iTk++) {
3243  h_OIinnermostHitR_->Fill(sqrt(iTk->innerPosition().Perp2()));
3244  for (trackingRecHit_iterator itHits = iTk->extra()->recHitsBegin(); itHits != iTk->extra()->recHitsEnd();
3245  ++itHits) {
3246  if ((*itHits)->isValid()) {
3247  nHits++;
3248  }
3249  }
3250 
3251  iTrk++;
3252  }
3253 
3254  // Loop over In Out Tracks Barrel
3255  iTrk = 0;
3256  for (View<reco::Track>::const_iterator iTk = inOutTrkHandle->begin(); iTk != inOutTrkHandle->end(); iTk++) {
3257  h_IOinnermostHitR_->Fill(sqrt(iTk->innerPosition().Perp2()));
3258  nHits = 0;
3259  for (trackingRecHit_iterator itHits = iTk->extra()->recHitsBegin(); itHits != iTk->extra()->recHitsEnd();
3260  ++itHits) {
3261  if ((*itHits)->isValid()) {
3262  nHits++;
3263  }
3264  }
3265  iTrk++;
3266  }
3267 
3268  } // if !fastSim
3269 
3271  //get simtrack info
3272  std::vector<SimTrack> theSimTracks;
3273  std::vector<SimVertex> theSimVertices;
3276 
3277  if (!fastSim_) {
3278  e.getByToken(g4_simTk_Token_, SimTk);
3279  e.getByToken(g4_simVtx_Token_, SimVtx);
3280  } else {
3281  e.getByToken(famos_simTk_Token_, SimTk);
3282  e.getByToken(famos_simVtx_Token_, SimVtx);
3283  }
3284 
3285  theSimTracks.insert(theSimTracks.end(), SimTk->begin(), SimTk->end());
3286  theSimVertices.insert(theSimVertices.end(), SimVtx->begin(), SimVtx->end());
3287  std::vector<PhotonMCTruth> mcPhotons = thePhotonMCTruthFinder_->find(theSimTracks, theSimVertices);
3288 
3290  e.getByToken(hepMC_Token_, hepMC);
3291  const HepMC::GenEvent* myGenEvent = hepMC->GetEvent();
3292 
3294  e.getByToken(genpartToken_, genParticles);
3295 
3296  // get generated jets
3297  Handle<reco::GenJetCollection> GenJetsHandle;
3298  e.getByToken(genjets_Token_, GenJetsHandle);
3299  reco::GenJetCollection genJetCollection = *(GenJetsHandle.product());
3300 
3301  // Get electron tracking truth
3302  bool useTP = parameters_.getParameter<bool>("useTP");
3304  edm::Handle<TrackingParticleCollection> ElectronTPHandle;
3305  if (useTP) {
3306  if (!fastSim_) {
3307  e.getByToken(token_tp_, ElectronTPHandle);
3308  trackingParticles = *(ElectronTPHandle.product());
3309  }
3310  }
3311 
3313  std::vector<reco::PhotonCollection::const_iterator> StoRMatchedConvertedPhotons;
3314  reco::SimToRecoCollection OISimToReco;
3315  reco::SimToRecoCollection IOSimToReco;
3316  // Reco to Sim
3317  reco::RecoToSimCollection OIRecoToSim;
3318  reco::RecoToSimCollection IORecoToSim;
3319 
3320  if (useTP) {
3321  if (!fastSim_) {
3322  // Sim to Reco
3323  OISimToReco = trackAssociator->associateSimToReco(outInTrkHandle, ElectronTPHandle);
3324  IOSimToReco = trackAssociator->associateSimToReco(inOutTrkHandle, ElectronTPHandle);
3325  // Reco to Sim
3326  OIRecoToSim = trackAssociator->associateRecoToSim(outInTrkHandle, ElectronTPHandle);
3327  IORecoToSim = trackAssociator->associateRecoToSim(inOutTrkHandle, ElectronTPHandle);
3328  }
3329  }
3330  //
3331  vector<reco::SimToRecoCollection*> StoRCollPtrs;
3332  StoRCollPtrs.push_back(&OISimToReco);
3333  StoRCollPtrs.push_back(&IOSimToReco);
3334  vector<reco::RecoToSimCollection*> RtoSCollPtrs;
3335  RtoSCollPtrs.push_back(&OIRecoToSim);
3336  RtoSCollPtrs.push_back(&IORecoToSim);
3337  //
3338  for (int i = 0; i < 2; i++)
3339  nSimPho_[i] = 0;
3340  for (int i = 0; i < 2; i++)
3341  nSimConv_[i] = 0;
3342 
3343  std::vector<reco::PhotonRef> myPhotons;
3344 
3345  for (unsigned int iPho = 0; iPho < photonHandle->size(); iPho++) {
3346  reco::PhotonRef phoRef(reco::PhotonRef(photonHandle, iPho));
3347  // for( reco::PhotonCollection::const_iterator iPho = photonCollection.begin(); iPho != photonCollection.end(); iPho++) {
3348  if (fabs(phoRef->eta()) > 2.5)
3349  continue;
3350  myPhotons.push_back(phoRef);
3351  }
3352 
3353  std::sort(myPhotons.begin(), myPhotons.end(), sortPhotons());
3354  // if ( ! isRunCentrally_ ) {
3355  if (myPhotons.size() >= 2) {
3356  if (myPhotons[0]->et() > 40 && myPhotons[1]->et() > 25) {
3357  math::XYZTLorentzVector p12 = myPhotons[0]->p4() + myPhotons[1]->p4();
3358  math::XYZTLorentzVector p12_regr1 =
3359  myPhotons[0]->p4(reco::Photon::regression1) + myPhotons[1]->p4(reco::Photon::regression1);
3360  math::XYZTLorentzVector p12_regr2 =
3361  myPhotons[0]->p4(reco::Photon::regression2) + myPhotons[1]->p4(reco::Photon::regression2);
3362  float gamgamMass2 = p12.Dot(p12);
3363  float gamgamMass2_regr1 = p12_regr1.Dot(p12_regr1);
3364  float gamgamMass2_regr2 = p12_regr2.Dot(p12_regr2);
3365 
3367  if (gamgamMass2 > 0) {
3368  // total
3369  h_gamgamMass_[0][0]->Fill(sqrt(gamgamMass2));
3370  if (myPhotons[0]->isEB() && myPhotons[1]->isEB())
3371  h_gamgamMass_[0][1]->Fill(sqrt(gamgamMass2));
3372  if ((myPhotons[0]->isEE() && myPhotons[1]->isEE()) || (myPhotons[0]->isEE() && myPhotons[1]->isEB()) ||
3373  (myPhotons[0]->isEB() && myPhotons[1]->isEE()))
3374  h_gamgamMass_[0][2]->Fill(sqrt(gamgamMass2));
3375  // Golden photons
3376  if (myPhotons[0]->r9() > 0.94 && myPhotons[1]->r9() > 0.94) {
3377  h_gamgamMass_[1][0]->Fill(sqrt(gamgamMass2));
3378  if (myPhotons[0]->isEB() && myPhotons[1]->isEB())
3379  h_gamgamMass_[1][1]->Fill(sqrt(gamgamMass2));
3380  if ((myPhotons[0]->isEE() && myPhotons[1]->isEE()) || (myPhotons[0]->isEE() && myPhotons[1]->isEB()) ||
3381  (myPhotons[0]->isEB() && myPhotons[1]->isEE()))
3382  h_gamgamMass_[1][2]->Fill(sqrt(gamgamMass2));
3383  }
3384  // both photons converted
3385  if (!myPhotons[0]->conversions().empty() && !myPhotons[1]->conversions().empty()) {
3386  if (myPhotons[0]->conversions()[0]->nTracks() == 2 && myPhotons[1]->conversions()[0]->nTracks() == 2) {
3387  float chi2Prob1 = ChiSquaredProbability(myPhotons[0]->conversions()[0]->conversionVertex().chi2(),
3388  myPhotons[0]->conversions()[0]->conversionVertex().ndof());
3389  float chi2Prob2 = ChiSquaredProbability(myPhotons[1]->conversions()[0]->conversionVertex().chi2(),
3390  myPhotons[1]->conversions()[0]->conversionVertex().ndof());
3391  if (chi2Prob1 > 0.0005 && chi2Prob2 > 0.0005) {
3392  h_gamgamMass_[2][0]->Fill(sqrt(gamgamMass2));
3393  if (myPhotons[0]->isEB() && myPhotons[1]->isEB()) {
3394  h_gamgamMass_[2][1]->Fill(sqrt(gamgamMass2));
3395  }
3396  if ((myPhotons[0]->isEE() && myPhotons[1]->isEE()) || (myPhotons[0]->isEE() && myPhotons[1]->isEB()) ||
3397  (myPhotons[0]->isEB() && myPhotons[1]->isEE())) {
3398  h_gamgamMass_[2][2]->Fill(sqrt(gamgamMass2));
3399  }
3400  }
3401  }
3402  } else if (!myPhotons[0]->conversions().empty() && myPhotons[1]->conversions().empty() &&
3403  myPhotons[1]->r9() > 0.93) { // one photon converted
3404  if (myPhotons[0]->conversions()[0]->nTracks() == 2) {
3405  float chi2Prob1 = ChiSquaredProbability(myPhotons[0]->conversions()[0]->conversionVertex().chi2(),
3406  myPhotons[0]->conversions()[0]->conversionVertex().ndof());
3407  if (chi2Prob1 > 0.0005) {
3408  h_gamgamMass_[2][0]->Fill(sqrt(gamgamMass2));
3409  if (myPhotons[0]->isEB() && myPhotons[1]->isEB()) {
3410  h_gamgamMass_[2][1]->Fill(sqrt(gamgamMass2));
3411  }
3412  if (myPhotons[0]->isEE() || myPhotons[1]->isEE()) {
3413  h_gamgamMass_[2][2]->Fill(sqrt(gamgamMass2));
3414  }
3415  }
3416  }
3417  } else if (!myPhotons[1]->conversions().empty() && myPhotons[0]->conversions().empty() &&
3418  myPhotons[0]->r9() > 0.93) { // one photon converted
3419  if (myPhotons[1]->conversions()[0]->nTracks() == 2) {
3420  float chi2Prob1 = ChiSquaredProbability(myPhotons[1]->conversions()[0]->conversionVertex().chi2(),
3421  myPhotons[1]->conversions()[0]->conversionVertex().ndof());
3422  if (chi2Prob1 > 0.0005) {
3423  h_gamgamMass_[2][0]->Fill(sqrt(gamgamMass2));
3424  if (myPhotons[0]->isEB() && myPhotons[1]->isEB()) {
3425  h_gamgamMass_[2][1]->Fill(sqrt(gamgamMass2));
3426  }
3427  if (myPhotons[0]->isEE() || myPhotons[1]->isEE()) {
3428  h_gamgamMass_[2][2]->Fill(sqrt(gamgamMass2));
3429  }
3430  }
3431  }
3432  }
3433  } // gamgamMass2 > 0
3434 
3436  if (gamgamMass2_regr1 > 0) {
3437  // total
3438  h_gamgamMassRegr1_[0][0]->Fill(sqrt(gamgamMass2_regr1));
3439  if (myPhotons[0]->isEB() && myPhotons[1]->isEB())
3440  h_gamgamMassRegr1_[0][1]->Fill(sqrt(gamgamMass2_regr1));
3441  if ((myPhotons[0]->isEE() && myPhotons[1]->isEE()) || (myPhotons[0]->isEE() && myPhotons[1]->isEB()) ||
3442  (myPhotons[0]->isEB() && myPhotons[1]->isEE()))
3443  h_gamgamMassRegr1_[0][2]->Fill(sqrt(gamgamMass2_regr1));
3444  // Golden photons
3445  if (myPhotons[0]->r9() > 0.94 && myPhotons[1]->r9() > 0.94) {
3446  h_gamgamMassRegr1_[1][0]->Fill(sqrt(gamgamMass2_regr1));
3447  if (myPhotons[0]->isEB() && myPhotons[1]->isEB())
3448  h_gamgamMassRegr1_[1][1]->Fill(sqrt(gamgamMass2_regr1));
3449  if ((myPhotons[0]->isEE() && myPhotons[1]->isEE()) || (myPhotons[0]->isEE() && myPhotons[1]->isEB()) ||
3450  (myPhotons[0]->isEB() && myPhotons[1]->isEE()))
3451  h_gamgamMassRegr1_[1][2]->Fill(sqrt(gamgamMass2_regr1));
3452  }
3453 
3454  // both photons converted
3455  if (!myPhotons[0]->conversions().empty() && !myPhotons[1]->conversions().empty()) {
3456  if (myPhotons[0]->conversions()[0]->nTracks() == 2 && myPhotons[1]->conversions()[0]->nTracks() == 2) {
3457  float chi2Prob1 = ChiSquaredProbability(myPhotons[0]->conversions()[0]->conversionVertex().chi2(),
3458  myPhotons[0]->conversions()[0]->conversionVertex().ndof());
3459  float chi2Prob2 = ChiSquaredProbability(myPhotons[1]->conversions()[0]->conversionVertex().chi2(),
3460  myPhotons[1]->conversions()[0]->conversionVertex().ndof());
3461  if (chi2Prob1 > 0.0005 && chi2Prob2 > 0.0005) {
3462  h_gamgamMassRegr1_[2][0]->Fill(sqrt(gamgamMass2_regr1));
3463  if (myPhotons[0]->isEB() && myPhotons[1]->isEB()) {
3464  h_gamgamMassRegr1_[2][1]->Fill(sqrt(gamgamMass2_regr1));
3465  }
3466  if ((myPhotons[0]->isEE() && myPhotons[1]->isEE()) || (myPhotons[0]->isEE() && myPhotons[1]->isEB()) ||
3467  (myPhotons[0]->isEB() && myPhotons[1]->isEE())) {
3468  h_gamgamMassRegr1_[2][2]->Fill(sqrt(gamgamMass2_regr1));
3469  }
3470  }
3471  }
3472  } else if (!myPhotons[0]->conversions().empty() && myPhotons[1]->conversions().empty() &&
3473  myPhotons[1]->r9() > 0.93) { // one photon converted
3474  if (myPhotons[0]->conversions()[0]->nTracks() == 2) {
3475  float chi2Prob1 = ChiSquaredProbability(myPhotons[0]->conversions()[0]->conversionVertex().chi2(),
3476  myPhotons[0]->conversions()[0]->conversionVertex().ndof());
3477  if (chi2Prob1 > 0.0005) {
3478  h_gamgamMassRegr1_[2][0]->Fill(sqrt(gamgamMass2_regr1));
3479  if (myPhotons[0]->isEB() && myPhotons[1]->isEB()) {
3480  h_gamgamMassRegr1_[2][1]->Fill(sqrt(gamgamMass2_regr1));
3481  }
3482  if (myPhotons[0]->isEE() || myPhotons[1]->isEE()) {
3483  h_gamgamMassRegr1_[2][2]->Fill(sqrt(gamgamMass2_regr1));
3484  }
3485  }
3486  }
3487  } else if (!myPhotons[1]->conversions().empty() && myPhotons[0]->conversions().empty() &&
3488  myPhotons[0]->r9() > 0.93) { // one photon converted
3489  if (myPhotons[1]->conversions()[0]->nTracks() == 2) {
3490  float chi2Prob1 = ChiSquaredProbability(myPhotons[1]->conversions()[0]->conversionVertex().chi2(),
3491  myPhotons[1]->conversions()[0]->conversionVertex().ndof());
3492  if (chi2Prob1 > 0.0005) {
3493  h_gamgamMassRegr1_[2][0]->Fill(sqrt(gamgamMass2_regr1));
3494  if (myPhotons[0]->isEB() && myPhotons[1]->isEB()) {
3495  h_gamgamMassRegr1_[2][1]->Fill(sqrt(gamgamMass2_regr1));
3496  }
3497  if (myPhotons[0]->isEE() || myPhotons[1]->isEE()) {
3498  h_gamgamMassRegr1_[2][2]->Fill(sqrt(gamgamMass2_regr1));
3499  }
3500  }
3501  }
3502  }
3503  } // gamgamMass2_regr1 > 0
3504 
3506  if (gamgamMass2_regr2 > 0) {
3507  // total
3508  h_gamgamMassRegr2_[0][0]->Fill(sqrt(gamgamMass2_regr2));
3509  if (myPhotons[0]->isEB() && myPhotons[1]->isEB())
3510  h_gamgamMassRegr2_[0][1]->Fill(sqrt(gamgamMass2_regr2));
3511  if ((myPhotons[0]->isEE() && myPhotons[1]->isEE()) || (myPhotons[0]->isEE() && myPhotons[1]->isEB()) ||
3512  (myPhotons[0]->isEB() && myPhotons[1]->isEE()))
3513  h_gamgamMassRegr2_[0][2]->Fill(sqrt(gamgamMass2_regr2));
3514  // Golden photons
3515  if (myPhotons[0]->r9() > 0.94 && myPhotons[1]->r9() > 0.94) {
3516  h_gamgamMassRegr2_[1][0]->Fill(sqrt(gamgamMass2_regr2));
3517  if (myPhotons[0]->isEB() && myPhotons[1]->isEB())
3518  h_gamgamMassRegr2_[1][1]->Fill(sqrt(gamgamMass2_regr2));
3519  if ((myPhotons[0]->isEE() && myPhotons[1]->isEE()) || (myPhotons[0]->isEE() && myPhotons[1]->isEB()) ||
3520  (myPhotons[0]->isEB() && myPhotons[1]->isEE()))
3521  h_gamgamMassRegr2_[1][2]->Fill(sqrt(gamgamMass2_regr2));
3522  }
3523 
3524  // both photons converted
3525  if (!myPhotons[0]->conversions().empty() && !myPhotons[1]->conversions().empty()) {
3526  if (myPhotons[0]->conversions()[0]->nTracks() == 2 && myPhotons[1]->conversions()[0]->nTracks() == 2) {
3527  float chi2Prob1 = ChiSquaredProbability(myPhotons[0]->conversions()[0]->conversionVertex().chi2(),
3528  myPhotons[0]->conversions()[0]->conversionVertex().ndof());
3529  float chi2Prob2 = ChiSquaredProbability(myPhotons[1]->conversions()[0]->conversionVertex().chi2(),
3530  myPhotons[1]->conversions()[0]->conversionVertex().ndof());
3531  if (chi2Prob1 > 0.0005 && chi2Prob2 > 0.0005) {
3532  h_gamgamMassRegr2_[2][0]->Fill(sqrt(gamgamMass2_regr2));
3533  if (myPhotons[0]->isEB() && myPhotons[1]->isEB()) {
3534  h_gamgamMassRegr2_[2][1]->Fill(sqrt(gamgamMass2_regr2));
3535  }
3536  if ((myPhotons[0]->isEE() && myPhotons[1]->isEE()) || (myPhotons[0]->isEE() && myPhotons[1]->isEB()) ||
3537  (myPhotons[0]->isEB() && myPhotons[1]->isEE())) {
3538  h_gamgamMassRegr2_[2][2]->Fill(sqrt(gamgamMass2_regr2));
3539  }
3540  }
3541  }
3542  } else if (!myPhotons[0]->conversions().empty() && myPhotons[1]->conversions().empty() &&
3543  myPhotons[1]->r9() > 0.93) { // one photon converted
3544  if (myPhotons[0]->conversions()[0]->nTracks() == 2) {
3545  float chi2Prob1 = ChiSquaredProbability(myPhotons[0]->conversions()[0]->conversionVertex().chi2(),
3546  myPhotons[0]->conversions()[0]->conversionVertex().ndof());
3547  if (chi2Prob1 > 0.0005) {
3548  h_gamgamMassRegr2_[2][0]->Fill(sqrt(gamgamMass2_regr2));
3549  if (myPhotons[0]->isEB() && myPhotons[1]->isEB()) {
3550  h_gamgamMassRegr2_[2][1]->Fill(sqrt(gamgamMass2_regr2));
3551  }
3552  if (myPhotons[0]->isEE() || myPhotons[1]->isEE()) {
3553  h_gamgamMassRegr2_[2][2]->Fill(sqrt(gamgamMass2_regr2));
3554  }
3555  }
3556  }
3557  } else if (!myPhotons[1]->conversions().empty() && myPhotons[0]->conversions().empty() &&
3558  myPhotons[0]->r9() > 0.93) { // one photon converted
3559  if (myPhotons[1]->conversions()[0]->nTracks() == 2) {
3560  float chi2Prob1 = ChiSquaredProbability(myPhotons[1]->conversions()[0]->conversionVertex().chi2(),
3561  myPhotons[1]->conversions()[0]->conversionVertex().ndof());
3562  if (chi2Prob1 > 0.0005) {
3563  h_gamgamMassRegr2_[2][0]->Fill(sqrt(gamgamMass2_regr2));
3564  if (myPhotons[0]->isEB() && myPhotons[1]->isEB()) {
3565  h_gamgamMassRegr2_[2][1]->Fill(sqrt(gamgamMass2_regr2));
3566  }
3567  if (myPhotons[0]->isEE() || myPhotons[1]->isEE()) {
3568  h_gamgamMassRegr2_[2][2]->Fill(sqrt(gamgamMass2_regr2));
3569  }
3570  }
3571  }
3572  }
3573  } // gamgamMass2_regr2 > 0
3574  }
3575  }
3576  // }
3577 
3578  for (std::vector<PhotonMCTruth>::const_iterator mcPho = mcPhotons.begin(); mcPho != mcPhotons.end(); mcPho++) {
3579  if ((*mcPho).fourMomentum().et() < minPhoEtCut_)
3580  continue;
3581 
3582  for (HepMC::GenEvent::particle_const_iterator mcIter = myGenEvent->particles_begin();
3583  mcIter != myGenEvent->particles_end();
3584  mcIter++) {
3585  if ((*mcIter)->pdg_id() != 22)
3586  continue;
3587  bool isTheSame = false;
3588  HepMC::GenParticle* mother = nullptr;
3589  if ((*mcIter)->production_vertex()) {
3590  if ((*mcIter)->production_vertex()->particles_begin(HepMC::parents) !=
3591  (*mcIter)->production_vertex()->particles_end(HepMC::parents))
3592  mother = *((*mcIter)->production_vertex()->particles_begin(HepMC::parents));
3593  }
3594 
3595  float mcPhi = (*mcPho).fourMomentum().phi();
3596  mcPhi_ = phiNormalization(mcPhi);
3597  mcEta_ = (*mcPho).fourMomentum().pseudoRapidity();
3598  mcEta_ = etaTransformation(mcEta_, (*mcPho).primaryVertex().z());
3599  mcConvR_ = (*mcPho).vertex().perp();
3600  mcConvX_ = (*mcPho).vertex().x();
3601  mcConvY_ = (*mcPho).vertex().y();
3602  mcConvZ_ = (*mcPho).vertex().z();
3603  mcConvEta_ = (*mcPho).vertex().eta();
3604  mcConvPhi_ = (*mcPho).vertex().phi();
3605 
3606  if (fabs(mcEta_) > END_HI)
3607  continue;
3608 
3609  if (mother == nullptr || (mother != nullptr && mother->pdg_id() == 22) ||
3610  (mother != nullptr && mother->pdg_id() == 25) || (mother != nullptr && mother->pdg_id() == 35)) {
3611  double dPt = fabs((*mcIter)->momentum().perp() - (*mcPho).fourMomentum().et());
3612  float phiMother = (*mcIter)->momentum().phi();
3613  double dPhi = phiNormalization(phiMother) - mcPhi_;
3614  double dEta = fabs((*mcIter)->momentum().eta() - (*mcPho).fourMomentum().pseudoRapidity());
3615 
3616  if (dEta <= 0.0001 && dPhi <= 0.0001 && dPt <= 0.0001)
3617  isTheSame = true;
3618  }
3619  if (!isTheSame)
3620  continue;
3621 
3622  nSimPho_[0]++;
3623  if (!isRunCentrally_) {
3624  h_SimPhoMotherEt_[0]->Fill((*mcPho).motherMomentum().et());
3625  h_SimPhoMotherEta_[0]->Fill((*mcPho).motherMomentum().pseudoRapidity());
3626  }
3627 
3628  h_SimPho_[0]->Fill(mcEta_);
3629  h_SimPho_[1]->Fill(mcPhi_);
3630  h_SimPho_[2]->Fill((*mcPho).fourMomentum().et());
3631 
3633 
3634  bool goodSimConversion = false;
3635  bool visibleConversion = false;
3636  bool visibleConversionsWithTwoSimTracks = false;
3637  if ((*mcPho).isAConversion() == 1) {
3638  nSimConv_[0]++;
3639  h_AllSimConv_[0]->Fill(mcEta_);
3640  h_AllSimConv_[1]->Fill(mcPhi_);
3641  h_AllSimConv_[2]->Fill(mcConvR_);
3642  h_AllSimConv_[3]->Fill(mcConvZ_);
3643  h_AllSimConv_[4]->Fill((*mcPho).fourMomentum().et());
3644 
3645  if (!isRunCentrally_) {
3646  if (mcConvR_ < 51)
3647  h_SimConvEtaPix_[0]->Fill(mcEta_);
3648  }
3649 
3650  if ((fabs(mcEta_) <= BARL && mcConvR_ < 85) ||
3651  (fabs(mcEta_) > BARL && fabs(mcEta_) <= END_HI && fabs((*mcPho).vertex().z()) < 210))
3652  visibleConversion = true;
3653 
3654  theConvTP_.clear();
3655  for (size_t i = 0; i < trackingParticles.size(); ++i) {
3656  TrackingParticleRef tp(ElectronTPHandle, i);
3657  if (fabs(tp->vx() - (*mcPho).vertex().x()) < 0.001 && fabs(tp->vy() - (*mcPho).vertex().y()) < 0.001 &&
3658  fabs(tp->vz() - (*mcPho).vertex().z()) < 0.001) {
3659  theConvTP_.push_back(tp);
3660  }
3661  }
3662  if (theConvTP_.size() == 2)
3663  visibleConversionsWithTwoSimTracks = true;
3664  goodSimConversion = false;
3665 
3666  if (visibleConversion && visibleConversionsWithTwoSimTracks)
3667  goodSimConversion = true;
3668  if (goodSimConversion) {
3669  nSimConv_[1]++;
3670  h_VisSimConv_[0]->Fill(mcEta_);
3671  h_VisSimConv_[1]->Fill(mcPhi_);
3672  h_VisSimConv_[2]->Fill(mcConvR_);
3673  h_VisSimConv_[3]->Fill(mcConvZ_);
3674  h_VisSimConv_[4]->Fill((*mcPho).fourMomentum().et());
3675 
3676  if (useTP) {
3677  if (!isRunCentrally_) {
3678  for (edm::RefVector<TrackingParticleCollection>::iterator iTrk = theConvTP_.begin();
3679  iTrk != theConvTP_.end();
3680  ++iTrk) {
3681  h_simTkPt_->Fill((*iTrk)->pt());
3682  h_simTkEta_->Fill((*iTrk)->eta());
3683  }
3684  }
3685  }
3686  }
3687  }
3688 
3689  float minDelta = 10000.;
3690  std::vector<reco::PhotonRef> thePhotons;
3691  int index = 0;
3692  int iMatch = -1;
3693  bool matched = false;
3694 
3695  for (unsigned int iPho = 0; iPho < photonHandle->size(); iPho++) {
3696  reco::PhotonRef aPho(reco::PhotonRef(photonHandle, iPho));
3697  thePhotons.push_back(aPho);
3698  float phiPho = aPho->phi();
3699  float etaPho = aPho->eta();
3700  float deltaPhi = phiPho - mcPhi_;
3701  float deltaEta = etaPho - mcEta_;
3702  if (deltaPhi > pi)
3703  deltaPhi -= twopi;
3704  if (deltaPhi < -pi)
3705  deltaPhi += twopi;
3706  deltaPhi = pow(deltaPhi, 2);
3707  deltaEta = pow(deltaEta, 2);
3708  float delta = sqrt(deltaPhi + deltaEta);
3709  if (delta < 0.1 && delta < minDelta) {
3710  minDelta = delta;
3711  iMatch = index;
3712  }
3713  index++;
3714  } // end loop over reco photons
3715  if (iMatch > -1)
3716  matched = true;
3717 
3718  if (matched) {
3719  nSimPho_[1]++;
3720  if (!isRunCentrally_) {
3721  h_SimPhoMotherEt_[1]->Fill((*mcPho).motherMomentum().et());
3722  h_SimPhoMotherEta_[1]->Fill((*mcPho).motherMomentum().pseudoRapidity());
3723  }
3724  h_MatchedSimPho_[0]->Fill(mcEta_);
3725  h_MatchedSimPho_[1]->Fill(mcPhi_);
3726  h_MatchedSimPho_[2]->Fill((*mcPho).fourMomentum().et());
3727  }
3728 
3729  if (!matched)
3730  continue;
3731 
3732  bool phoIsInBarrel = false;
3733  bool phoIsInEndcap = false;
3734  bool phoIsInEndcapP = false;
3735  bool phoIsInEndcapM = false;
3736 
3737  reco::PhotonRef matchingPho = thePhotons[iMatch];
3738 
3739  if (fabs(matchingPho->superCluster()->position().eta()) < 1.479) {
3740  phoIsInBarrel = true;
3741  } else {
3742  phoIsInEndcap = true;
3743  if (matchingPho->superCluster()->position().eta() > 0)
3744  phoIsInEndcapP = true;
3745  if (matchingPho->superCluster()->position().eta() < 0)
3746  phoIsInEndcapM = true;
3747  }
3748 
3749  edm::Handle<EcalRecHitCollection> ecalRecHitHandle;
3750  if (phoIsInBarrel) {
3751  // Get handle to rec hits ecal barrel
3752  e.getByToken(barrelEcalHits_, ecalRecHitHandle);
3753  if (!ecalRecHitHandle.isValid()) {
3754  Labels l;
3755  labelsForToken(barrelEcalHits_, l);
3756  edm::LogError("PhotonProducer") << "Error! Can't get the product " << l.module;
3757  return;
3758  }
3759 
3760  } else if (phoIsInEndcap) {
3761  // Get handle to rec hits ecal encap
3762  e.getByToken(endcapEcalHits_, ecalRecHitHandle);
3763  if (!ecalRecHitHandle.isValid()) {
3764  Labels l;
3765  labelsForToken(barrelEcalHits_, l);
3766  edm::LogError("PhotonProducer") << "Error! Can't get the product " << l.module;
3767  return;
3768  }
3769  }
3770 
3771  int type = 0;
3772  const EcalRecHitCollection ecalRecHitCollection = *(ecalRecHitHandle.product());
3773  float photonE = matchingPho->energy();
3774  float sigmaEoE = matchingPho->getCorrectedEnergyError(matchingPho->getCandidateP4type()) / matchingPho->energy();
3775  //float photonEt= matchingPho->energy()/cosh( matchingPho->eta()) ;
3776  float photonEt = matchingPho->pt();
3777  float photonERegr1 = matchingPho->getCorrectedEnergy(reco::Photon::regression1);
3778  float photonERegr2 = matchingPho->getCorrectedEnergy(reco::Photon::regression2);
3779  float r9 = matchingPho->r9();
3780  // float full5x5_r9 = matchingPho->full5x5_r9();
3781  float r1 = matchingPho->r1x5();
3782  float r2 = matchingPho->r2x5();
3783  float sigmaIetaIeta = matchingPho->sigmaIetaIeta();
3784  //float full5x5_sieie = matchingPho->full5x5_sigmaIetaIeta();
3785  float hOverE = matchingPho->hadronicOverEm();
3786  float newhOverE = matchingPho->hadTowOverEm();
3787  float ecalIso = matchingPho->ecalRecHitSumEtConeDR04();
3788  float hcalIso = matchingPho->hcalTowerSumEtConeDR04();
3789  float newhcalIso = matchingPho->hcalTowerSumEtBcConeDR04();
3790  float trkIso = matchingPho->trkSumPtSolidConeDR04();
3791  float nIsoTrk = matchingPho->nTrkSolidConeDR04();
3792  // PF related quantities
3793  float chargedHadIso = matchingPho->chargedHadronIso();
3794  float neutralHadIso = matchingPho->neutralHadronIso();
3795  float photonIso = matchingPho->photonIso();
3796  float etOutsideMustache = matchingPho->etOutsideMustache();
3797  int nClusterOutsideMustache = matchingPho->nClusterOutsideMustache();
3798  float pfMVA = matchingPho->pfMVA();
3799 
3800  std::vector<std::pair<DetId, float> >::const_iterator rhIt;
3801  bool atLeastOneDeadChannel = false;
3802  for (reco::CaloCluster_iterator bcIt = matchingPho->superCluster()->clustersBegin();
3803  bcIt != matchingPho->superCluster()->clustersEnd();
3804  ++bcIt) {
3805  for (rhIt = (*bcIt)->hitsAndFractions().begin(); rhIt != (*bcIt)->hitsAndFractions().end(); ++rhIt) {
3806  for (EcalRecHitCollection::const_iterator it = ecalRecHitCollection.begin(); it != ecalRecHitCollection.end();
3807  ++it) {
3808  if (rhIt->first == (*it).id()) {
3809  if ((*it).recoFlag() == 9) {
3810  atLeastOneDeadChannel = true;
3811  break;
3812  }
3813  }
3814  }
3815  }
3816  }
3817 
3818  if (atLeastOneDeadChannel) {
3819  h_MatchedSimPhoBadCh_[0]->Fill(mcEta_);
3820  h_MatchedSimPhoBadCh_[1]->Fill(mcPhi_);
3821  h_MatchedSimPhoBadCh_[2]->Fill((*mcPho).fourMomentum().et());
3822  }
3823 
3824  if (phoIsInBarrel)
3825  h_phoPixSeedSize_[0]->Fill(matchingPho->electronPixelSeeds().size());
3826  else
3827  h_phoPixSeedSize_[1]->Fill(matchingPho->electronPixelSeeds().size());
3828 
3829  h_scEta_[type]->Fill(matchingPho->superCluster()->eta());
3830  h_scPhi_[type]->Fill(matchingPho->superCluster()->phi());
3831  if (!isRunCentrally_) {
3832  h_scEtaWidth_[type]->Fill(matchingPho->superCluster()->etaWidth());
3833  h_scPhiWidth_[type]->Fill(matchingPho->superCluster()->phiWidth());
3834  }
3835  h_scE_[type][0]->Fill(matchingPho->superCluster()->energy());
3836  h_scEt_[type][0]->Fill(matchingPho->superCluster()->energy() / cosh(matchingPho->superCluster()->eta()));
3837  if (phoIsInEndcap)
3838  h_psE_->Fill(matchingPho->superCluster()->preshowerEnergy());
3839  //
3840  h_r9_[type][0]->Fill(r9);
3841  //
3842  h_r1_[type][0]->Fill(r1);
3843  //
3844  h_r2_[type][0]->Fill(r2);
3845  //
3846  h_sigmaIetaIeta_[type][0]->Fill(sigmaIetaIeta);
3847  //
3848  h_hOverE_[type][0]->Fill(hOverE);
3849  p_r9VsEta_[0]->Fill(mcEta_, r9);
3850 
3851  if (!isRunCentrally_) {
3852  h2_r9VsEt_[0]->Fill((*mcPho).fourMomentum().et(), r9);
3853  h2_r1VsEta_[0]->Fill(mcEta_, r1);
3854  h2_r1VsEt_[0]->Fill((*mcPho).fourMomentum().et(), r1);
3855  h2_r2VsEta_[0]->Fill(mcEta_, r2);
3856  h2_r2VsEt_[0]->Fill((*mcPho).fourMomentum().et(), r2);
3857  h2_sigmaIetaIetaVsEta_[0]->Fill(mcEta_, sigmaIetaIeta);
3858  h2_sigmaIetaIetaVsEt_[0]->Fill((*mcPho).fourMomentum().et(), sigmaIetaIeta);
3859  h2_hOverEVsEta_[0]->Fill(mcEta_, hOverE);
3860  h2_hOverEVsEt_[0]->Fill((*mcPho).fourMomentum().et(), hOverE);
3861  }
3862  p_hOverEVsEta_[0]->Fill(mcEta_, hOverE);
3863  p_hOverEVsEt_[0]->Fill((*mcPho).fourMomentum().et(), hOverE);
3864  //
3865  h_newhOverE_[type][0]->Fill(newhOverE);
3866  p_newhOverEVsEta_[0]->Fill(mcEta_, newhOverE);
3867  p_newhOverEVsEt_[0]->Fill((*mcPho).fourMomentum().et(), newhOverE);
3868 
3869  //
3870  h_ecalRecHitSumEtConeDR04_[type][0]->Fill(ecalIso);
3871  if (!isRunCentrally_) {
3872  h2_ecalRecHitSumEtConeDR04VsEta_[0]->Fill(mcEta_, ecalIso);
3873  h2_ecalRecHitSumEtConeDR04VsEt_[0]->Fill((*mcPho).fourMomentum().et(), ecalIso);
3874  h2_hcalTowerSumEtConeDR04VsEta_[0]->Fill(mcEta_, hcalIso);
3875  h2_hcalTowerSumEtConeDR04VsEt_[0]->Fill((*mcPho).fourMomentum().et(), hcalIso);
3876  }
3877  p_ecalRecHitSumEtConeDR04VsEta_[0]->Fill(mcEta_, ecalIso);
3878  if (!isRunCentrally_)
3879  p_ecalRecHitSumEtConeDR04VsEt_[0]->Fill((*mcPho).fourMomentum().et(), ecalIso);
3880  //
3881  h_hcalTowerSumEtConeDR04_[type][0]->Fill(hcalIso);
3882  p_hcalTowerSumEtConeDR04VsEta_[0]->Fill(mcEta_, hcalIso);
3883  if (!isRunCentrally_)
3884  p_hcalTowerSumEtConeDR04VsEt_[0]->Fill((*mcPho).fourMomentum().et(), hcalIso);
3885  //
3886  if (!isRunCentrally_)
3887  h_hcalTowerBcSumEtConeDR04_[type][0]->Fill(newhcalIso);
3888  p_hcalTowerBcSumEtConeDR04VsEta_[0]->Fill(mcEta_, newhcalIso);
3889  if (!isRunCentrally_)
3890  p_hcalTowerBcSumEtConeDR04VsEt_[0]->Fill((*mcPho).fourMomentum().et(), newhcalIso);
3891  //
3892  h_isoTrkSolidConeDR04_[type][0]->Fill(trkIso);
3893  h_nTrkSolidConeDR04_[type][0]->Fill(nIsoTrk);
3894 
3895  if (!isRunCentrally_) {
3896  h2_isoTrkSolidConeDR04VsEta_[0]->Fill(mcEta_, trkIso);
3897  h2_isoTrkSolidConeDR04VsEt_[0]->Fill((*mcPho).fourMomentum().et(), trkIso);
3898  h2_nTrkSolidConeDR04VsEta_[0]->Fill(mcEta_, nIsoTrk);
3899  h2_nTrkSolidConeDR04VsEt_[0]->Fill((*mcPho).fourMomentum().et(), nIsoTrk);
3900  }
3901 
3902  h_chHadIso_[0]->Fill(chargedHadIso);
3903  h_nHadIso_[0]->Fill(neutralHadIso);
3904  h_phoIso_[0]->Fill(photonIso);
3905  h_nCluOutsideMustache_[0]->Fill(float(nClusterOutsideMustache));
3906  h_etOutsideMustache_[0]->Fill(etOutsideMustache);
3907  h_pfMva_[0]->Fill(pfMVA);
3908  //
3909  h_phoEta_[type]->Fill(matchingPho->eta());
3910  h_phoPhi_[type]->Fill(matchingPho->phi());
3911  h_phoDEta_[0]->Fill(matchingPho->eta() - (*mcPho).fourMomentum().eta());
3912  h_phoDPhi_[0]->Fill(matchingPho->phi() - mcPhi_);
3913  h_phoE_[type][0]->Fill(photonE);
3914  h_phoEt_[type][0]->Fill(photonEt);
3915  h_nConv_[0][0]->Fill(float(matchingPho->conversions().size()));
3916  h_nConv_[1][0]->Fill(float(matchingPho->conversionsOneLeg().size()));
3917 
3918  //
3919  h_phoERes_[0][0]->Fill(photonE / (*mcPho).fourMomentum().e());
3920  h_phoSigmaEoE_[0][0]->Fill(sigmaEoE);
3921  h_phoEResRegr1_[0][0]->Fill(photonERegr1 / (*mcPho).fourMomentum().e());
3922  h_phoEResRegr2_[0][0]->Fill(photonERegr2 / (*mcPho).fourMomentum().e());
3923 
3924  p_eResVsEta_[0]->Fill(mcEta_, photonE / (*mcPho).fourMomentum().e());
3925  p_sigmaEoEVsEta_[0]->Fill(mcEta_, sigmaEoE);
3926  p_eResVsEt_[0][0]->Fill((*mcPho).fourMomentum().et(), photonE / (*mcPho).fourMomentum().e());
3927 
3928  if (!isRunCentrally_)
3929  h2_eResVsEta_[0]->Fill(mcEta_, photonE / (*mcPho).fourMomentum().e());
3930  if (!isRunCentrally_)
3931  h2_eResVsEt_[0][0]->Fill((*mcPho).fourMomentum().et(), photonE / (*mcPho).fourMomentum().e());
3932  if (!isRunCentrally_)
3933  h2_eResVsR9_[0]->Fill(r9, photonE / (*mcPho).fourMomentum().e());
3934  if (!isRunCentrally_)
3935  h2_sceResVsR9_[0]->Fill(r9, matchingPho->superCluster()->energy() / (*mcPho).fourMomentum().e());
3936  if (!isRunCentrally_)
3937  p_eResVsR9_[0]->Fill(r9, photonE / (*mcPho).fourMomentum().e());
3938  if (!isRunCentrally_)
3939  p_sceResVsR9_[0]->Fill(r9, matchingPho->superCluster()->energy() / (*mcPho).fourMomentum().e());
3940  //
3941  if ((*mcPho).isAConversion() == 0) {
3942  if (!isRunCentrally_) {
3943  h2_eResVsEta_[1]->Fill(mcEta_, photonE / (*mcPho).fourMomentum().e());
3944  h2_r9VsEt_[1]->Fill((*mcPho).fourMomentum().et(), r9);
3945  //
3946  h2_r1VsEta_[1]->Fill(mcEta_, r1);
3947  h2_r1VsEt_[1]->Fill((*mcPho).fourMomentum().et(), r1);
3948  //
3949  h2_r2VsEta_[1]->Fill(mcEta_, r2);
3950  h2_r2VsEt_[1]->Fill((*mcPho).fourMomentum().et(), r2);
3951  //
3952  h2_sigmaIetaIetaVsEta_[1]->Fill(mcEta_, sigmaIetaIeta);
3953  h2_sigmaIetaIetaVsEt_[1]->Fill((*mcPho).fourMomentum().et(), sigmaIetaIeta);
3954  //
3955  h2_hOverEVsEta_[1]->Fill(mcEta_, hOverE);
3956  h2_hOverEVsEt_[1]->Fill((*mcPho).fourMomentum().et(), hOverE);
3957  }
3958 
3959  if (!isRunCentrally_) {
3960  h2_ecalRecHitSumEtConeDR04VsEta_[1]->Fill(mcEta_, ecalIso);
3961  h2_hcalTowerSumEtConeDR04VsEta_[1]->Fill(mcEta_, hcalIso);
3962  h2_isoTrkSolidConeDR04VsEta_[1]->Fill(mcEta_, trkIso);
3963  h2_isoTrkSolidConeDR04VsEt_[1]->Fill((*mcPho).fourMomentum().et(), trkIso);
3964  h2_nTrkSolidConeDR04VsEta_[1]->Fill(mcEta_, nIsoTrk);
3965  h2_nTrkSolidConeDR04VsEt_[1]->Fill((*mcPho).fourMomentum().et(), nIsoTrk);
3966  }
3967  p_ecalRecHitSumEtConeDR04VsEta_[1]->Fill(mcEta_, ecalIso);
3968  if (!isRunCentrally_)
3969  p_hcalTowerSumEtConeDR04VsEta_[1]->Fill(mcEta_, hcalIso);
3970  }
3971 
3972  if (photonE / (*mcPho).fourMomentum().e() < 0.3 && photonE / (*mcPho).fourMomentum().e() > 0.1) {
3973  }
3974 
3975  if ((r9 > 0.94 && phoIsInBarrel) || (r9 > 0.95 && phoIsInEndcap)) {
3976  h_phoERes_[1][0]->Fill(photonE / (*mcPho).fourMomentum().e());
3977  h_phoSigmaEoE_[1][0]->Fill(sigmaEoE);
3978  h_phoEResRegr1_[1][0]->Fill(photonERegr1 / (*mcPho).fourMomentum().e());
3979  h_phoEResRegr2_[1][0]->Fill(photonERegr2 / (*mcPho).fourMomentum().e());
3980  if (!isRunCentrally_)
3981  h2_eResVsEt_[0][1]->Fill((*mcPho).fourMomentum().et(), photonE / (*mcPho).fourMomentum().e());
3982  p_eResVsEt_[0][1]->Fill((*mcPho).fourMomentum().et(), photonE / (*mcPho).fourMomentum().e());
3983  p_eResVsEta_[1]->Fill(mcEta_, photonE / (*mcPho).fourMomentum().e());
3984  p_r9VsEta_[1]->Fill(mcEta_, r9);
3985  p_sigmaEoEVsEta_[1]->Fill(mcEta_, sigmaEoE);
3986 
3987  } else if ((r9 <= 0.94 && phoIsInBarrel) || (r9 <= 0.95 && phoIsInEndcap)) {
3988  h_phoERes_[2][0]->Fill(photonE / (*mcPho).fourMomentum().e());
3989  h_phoSigmaEoE_[2][0]->Fill(sigmaEoE);
3990  h_phoEResRegr1_[2][0]->Fill(photonERegr1 / (*mcPho).fourMomentum().e());
3991  h_phoEResRegr2_[2][0]->Fill(photonERegr2 / (*mcPho).fourMomentum().e());
3992  p_eResVsEt_[0][2]->Fill((*mcPho).fourMomentum().et(), photonE / (*mcPho).fourMomentum().e());
3993  p_eResVsEta_[2]->Fill(mcEta_, photonE / (*mcPho).fourMomentum().e());
3994  p_r9VsEta_[2]->Fill(mcEta_, r9);
3995  p_sigmaEoEVsEta_[2]->Fill(mcEta_, sigmaEoE);
3996 
3997  if (!isRunCentrally_) {
3998  h2_eResVsEt_[0][2]->Fill((*mcPho).fourMomentum().et(), photonE / (*mcPho).fourMomentum().e());
3999  h_EtR9Less093_[0][0]->Fill(photonEt);
4000  }
4001  }
4002 
4003  if (phoIsInBarrel) {
4004  h_scE_[type][1]->Fill(matchingPho->superCluster()->energy());
4005  h_scEt_[type][1]->Fill(matchingPho->superCluster()->energy() / cosh(matchingPho->superCluster()->eta()));
4006  h_r9_[type][1]->Fill(r9);
4007  h_r1_[type][1]->Fill(r1);
4008  h_r2_[type][1]->Fill(r2);
4009  h_sigmaIetaIeta_[type][1]->Fill(sigmaIetaIeta);
4010  h_hOverE_[type][1]->Fill(hOverE);
4011  h_newhOverE_[type][1]->Fill(newhOverE);
4012  h_ecalRecHitSumEtConeDR04_[type][1]->Fill(ecalIso);
4013  p_ecalRecHitSumEtConeDR04VsEt_[1]->Fill((*mcPho).fourMomentum().et(), ecalIso);
4014  h_hcalTowerSumEtConeDR04_[type][1]->Fill(hcalIso);
4015  p_hcalTowerSumEtConeDR04VsEt_[1]->Fill((*mcPho).fourMomentum().et(), hcalIso);
4016  h_hcalTowerBcSumEtConeDR04_[type][1]->Fill(newhcalIso);
4017  p_hcalTowerBcSumEtConeDR04VsEt_[1]->Fill((*mcPho).fourMomentum().et(), newhcalIso);
4018  h_isoTrkSolidConeDR04_[type][1]->Fill(trkIso);
4019  h_nTrkSolidConeDR04_[type][1]->Fill(nIsoTrk);
4020  h_chHadIso_[1]->Fill(chargedHadIso);
4021  h_nHadIso_[1]->Fill(neutralHadIso);
4022  h_phoIso_[1]->Fill(photonIso);
4023  h_nCluOutsideMustache_[1]->Fill(float(nClusterOutsideMustache));
4024  h_etOutsideMustache_[1]->Fill(etOutsideMustache);
4025  h_pfMva_[1]->Fill(pfMVA);
4026  h_phoE_[type][1]->Fill(photonE);
4027  h_phoEt_[type][1]->Fill(photonEt);
4028  h_nConv_[type][1]->Fill(float(matchingPho->conversions().size()));
4029  h_nConv_[1][1]->Fill(float(matchingPho->conversionsOneLeg().size()));
4030  h_phoERes_[0][1]->Fill(photonE / (*mcPho).fourMomentum().e());
4031  h_phoSigmaEoE_[0][1]->Fill(sigmaEoE);
4032  h_phoEResRegr1_[0][1]->Fill(photonERegr1 / (*mcPho).fourMomentum().e());
4033  h_phoEResRegr2_[0][1]->Fill(photonERegr2 / (*mcPho).fourMomentum().e());
4034  p_eResVsR9_[1]->Fill(r9, photonE / (*mcPho).fourMomentum().e());
4035  p_sceResVsR9_[1]->Fill(r9, matchingPho->superCluster()->energy() / (*mcPho).fourMomentum().e());
4036  if (!isRunCentrally_) {
4037  h2_eResVsR9_[1]->Fill(r9, photonE / (*mcPho).fourMomentum().e());
4038  h2_sceResVsR9_[1]->Fill(r9, matchingPho->superCluster()->energy() / (*mcPho).fourMomentum().e());
4039  h2_ecalRecHitSumEtConeDR04VsEt_[1]->Fill((*mcPho).fourMomentum().et(), ecalIso);
4040  h2_hcalTowerSumEtConeDR04VsEt_[1]->Fill((*mcPho).fourMomentum().et(), hcalIso);
4041  h2_eResVsEt_[1][0]->Fill((*mcPho).fourMomentum().et(), photonE / (*mcPho).fourMomentum().e());
4042  }
4043  p_eResVsEt_[1][0]->Fill((*mcPho).fourMomentum().et(), photonE / (*mcPho).fourMomentum().e());
4044  p_eResVsNVtx_[1][0]->Fill(float(vtxH->size()), photonE / (*mcPho).fourMomentum().e());
4045  p_sigmaEoEVsEt_[1][0]->Fill((*mcPho).fourMomentum().et(), sigmaEoE);
4046  p_sigmaEoEVsNVtx_[1][0]->Fill(float(vtxH->size()), sigmaEoE);
4047 
4048  if (r9 > 0.94) {
4049  h_phoERes_[1][1]->Fill(photonE / (*mcPho).fourMomentum().e());
4050  h_phoSigmaEoE_[1][1]->Fill(sigmaEoE);
4051  h_phoEResRegr1_[1][1]->Fill(photonERegr1 / (*mcPho).fourMomentum().e());
4052  h_phoEResRegr2_[1][1]->Fill(photonERegr2 / (*mcPho).fourMomentum().e());
4053  if (!isRunCentrally_)
4054  h2_eResVsEt_[1][1]->Fill((*mcPho).fourMomentum().et(), photonE / (*mcPho).fourMomentum().e());
4055  p_eResVsEt_[1][1]->Fill((*mcPho).fourMomentum().et(), photonE / (*mcPho).fourMomentum().e());
4056  p_eResVsNVtx_[1][1]->Fill(float(vtxH->size()), photonE / (*mcPho).fourMomentum().e());
4057  p_sigmaEoEVsEt_[1][1]->Fill((*mcPho).fourMomentum().et(), sigmaEoE);
4058  p_sigmaEoEVsNVtx_[1][1]->Fill(float(vtxH->size()), sigmaEoE);
4059  }
4060  if (r9 <= 0.94) {
4061  h_phoERes_[2][1]->Fill(photonE / (*mcPho).fourMomentum().e());
4062  h_phoSigmaEoE_[2][1]->Fill(sigmaEoE);
4063  h_phoEResRegr1_[2][1]->Fill(photonERegr1 / (*mcPho).fourMomentum().e());
4064  h_phoEResRegr2_[2][1]->Fill(photonERegr2 / (*mcPho).fourMomentum().e());
4065  p_eResVsEt_[1][2]->Fill((*mcPho).fourMomentum().et(), photonE / (*mcPho).fourMomentum().e());
4066  p_eResVsNVtx_[1][2]->Fill(float(vtxH->size()), photonE / (*mcPho).fourMomentum().e());
4067  p_sigmaEoEVsEt_[1][2]->Fill((*mcPho).fourMomentum().et(), sigmaEoE);
4068  p_sigmaEoEVsNVtx_[1][2]->Fill(float(vtxH->size()), sigmaEoE);
4069  if (!isRunCentrally_) {
4070  h2_eResVsEt_[1][2]->Fill((*mcPho).fourMomentum().et(), photonE / (*mcPho).fourMomentum().e());
4071  h_EtR9Less093_[0][1]->Fill(photonEt);
4072  }
4073  }
4074  }
4075  if (phoIsInEndcap) {
4076  h_scE_[type][2]->Fill(matchingPho->superCluster()->energy());
4077  h_scEt_[type][2]->Fill(matchingPho->superCluster()->energy() / cosh(matchingPho->superCluster()->eta()));
4078  h_r9_[type][2]->Fill(r9);
4079  h_r1_[type][2]->Fill(r1);
4080  h_r2_[type][2]->Fill(r2);
4081  h_sigmaIetaIeta_[type][2]->Fill(sigmaIetaIeta);
4082  h_hOverE_[type][2]->Fill(hOverE);
4083  h_newhOverE_[type][2]->Fill(newhOverE);
4084  h_ecalRecHitSumEtConeDR04_[type][2]->Fill(ecalIso);
4085  p_ecalRecHitSumEtConeDR04VsEt_[2]->Fill((*mcPho).fourMomentum().et(), ecalIso);
4086  h_hcalTowerSumEtConeDR04_[type][2]->Fill(hcalIso);
4087  p_hcalTowerSumEtConeDR04VsEt_[2]->Fill((*mcPho).fourMomentum().et(), hcalIso);
4088  h_hcalTowerBcSumEtConeDR04_[type][2]->Fill(newhcalIso);
4089  p_hcalTowerBcSumEtConeDR04VsEt_[2]->Fill((*mcPho).fourMomentum().et(), newhcalIso);
4090  h_isoTrkSolidConeDR04_[type][2]->Fill(trkIso);
4091  h_nTrkSolidConeDR04_[type][2]->Fill(nIsoTrk);
4092  h_chHadIso_[2]->Fill(chargedHadIso);
4093  h_nHadIso_[2]->Fill(neutralHadIso);
4094  h_phoIso_[2]->Fill(photonIso);
4095  h_nCluOutsideMustache_[2]->Fill(float(nClusterOutsideMustache));
4096  h_etOutsideMustache_[2]->Fill(etOutsideMustache);
4097  h_pfMva_[2]->Fill(pfMVA);
4098  h_phoE_[type][2]->Fill(photonE);
4099  h_phoEt_[type][2]->Fill(photonEt);
4100  h_nConv_[type][2]->Fill(float(matchingPho->conversions().size()));
4101  h_nConv_[1][2]->Fill(float(matchingPho->conversionsOneLeg().size()));
4102  h_phoERes_[0][2]->Fill(photonE / (*mcPho).fourMomentum().e());
4103  h_phoSigmaEoE_[0][2]->Fill(sigmaEoE);
4104  h_phoEResRegr1_[0][2]->Fill(photonERegr1 / (*mcPho).fourMomentum().e());
4105  h_phoEResRegr2_[0][2]->Fill(photonERegr2 / (*mcPho).fourMomentum().e());
4106  p_eResVsR9_[2]->Fill(r9, photonE / (*mcPho).fourMomentum().e());
4107  p_sceResVsR9_[2]->Fill(r9, matchingPho->superCluster()->energy() / (*mcPho).fourMomentum().e());
4108  if (!isRunCentrally_) {
4109  h2_eResVsR9_[2]->Fill(r9, photonE / (*mcPho).fourMomentum().e());
4110  h2_sceResVsR9_[2]->Fill(r9, matchingPho->superCluster()->energy() / (*mcPho).fourMomentum().e());
4111  h2_ecalRecHitSumEtConeDR04VsEt_[2]->Fill((*mcPho).fourMomentum().et(), ecalIso);
4112  h2_hcalTowerSumEtConeDR04VsEt_[2]->Fill((*mcPho).fourMomentum().et(), hcalIso);
4113  h2_eResVsEt_[2][0]->Fill((*mcPho).fourMomentum().et(), photonE / (*mcPho).fourMomentum().e());
4114  }
4115 
4116  p_eResVsEt_[2][0]->Fill((*mcPho).fourMomentum().et(), photonE / (*mcPho).fourMomentum().e());
4117  p_eResVsNVtx_[2][0]->Fill(float(vtxH->size()), photonE / (*mcPho).fourMomentum().e());
4118  p_sigmaEoEVsEt_[2][0]->Fill((*mcPho).fourMomentum().et(), sigmaEoE);
4119  p_sigmaEoEVsNVtx_[2][0]->Fill(float(vtxH->size()), sigmaEoE);
4120 
4121  if (r9 > 0.95) {
4122  h_phoERes_[1][2]->Fill(photonE / (*mcPho).fourMomentum().e());
4123  h_phoSigmaEoE_[1][2]->Fill(sigmaEoE);
4124  h_phoEResRegr1_[1][2]->Fill(photonERegr1 / (*mcPho).fourMomentum().e());
4125  h_phoEResRegr2_[1][2]->Fill(photonERegr2 / (*mcPho).fourMomentum().e());
4126  if (!isRunCentrally_)
4127  h2_eResVsEt_[2][1]->Fill((*mcPho).fourMomentum().et(), photonE / (*mcPho).fourMomentum().e());
4128  p_eResVsEt_[2][1]->Fill((*mcPho).fourMomentum().et(), photonE / (*mcPho).fourMomentum().e());
4129  p_eResVsNVtx_[2][1]->Fill(float(vtxH->size()), photonE / (*mcPho).fourMomentum().e());
4130  p_sigmaEoEVsEt_[2][1]->Fill((*mcPho).fourMomentum().et(), sigmaEoE);
4131  p_sigmaEoEVsNVtx_[2][1]->Fill(float(vtxH->size()), sigmaEoE);
4132  }
4133  if (r9 <= 0.95) {
4134  h_phoERes_[2][2]->Fill(photonE / (*mcPho).fourMomentum().e());
4135  h_phoSigmaEoE_[2][2]->Fill(sigmaEoE);
4136  h_phoEResRegr1_[2][2]->Fill(photonERegr1 / (*mcPho).fourMomentum().e());
4137  h_phoEResRegr2_[2][2]->Fill(photonERegr2 / (*mcPho).fourMomentum().e());
4138  p_eResVsEt_[2][2]->Fill((*mcPho).fourMomentum().et(), photonE / (*mcPho).fourMomentum().e());
4139  p_eResVsNVtx_[2][2]->Fill(float(vtxH->size()), photonE / (*mcPho).fourMomentum().e());
4140  p_sigmaEoEVsEt_[2][2]->Fill((*mcPho).fourMomentum().et(), sigmaEoE);
4141  p_sigmaEoEVsNVtx_[2][2]->Fill(float(vtxH->size()), sigmaEoE);
4142 
4143  if (!isRunCentrally_) {
4144  h2_eResVsEt_[2][2]->Fill((*mcPho).fourMomentum().et(), photonE / (*mcPho).fourMomentum().e());
4145  h_EtR9Less093_[0][2]->Fill(photonEt);
4146  }
4147  }
4148  }
4149 
4151  if (fName_ == "pfPhotonValidator") {
4152  float SumPtIsoValCh = 0.;
4153  float SumPtIsoValNh = 0.;
4154  float SumPtIsoValPh = 0.;
4155 
4156  float SumPtIsoValCleanCh = 0.;
4157  float SumPtIsoValCleanNh = 0.;
4158  float SumPtIsoValCleanPh = 0.;
4159 
4160  for (unsigned int lCand = 0; lCand < pfCandidateHandle->size(); lCand++) {
4161  reco::PFCandidateRef pfCandRef(reco::PFCandidateRef(pfCandidateHandle, lCand));
4162  float dR = deltaR(matchingPho->eta(), matchingPho->phi(), pfCandRef->eta(), pfCandRef->phi());
4163  if (dR < 0.4) {
4165  reco::PFCandidate::ParticleType type = pfCandRef->particleId();
4166  if (type == reco::PFCandidate::e)
4167  continue;
4168  if (type == reco::PFCandidate::gamma && pfCandRef->mva_nothing_gamma() > 0.)
4169  continue;
4170 
4171  if (type == reco::PFCandidate::h) {
4172  SumPtIsoValCh += pfCandRef->pt();
4173  h_dRPhoPFcand_ChHad_unCleaned_[0]->Fill(dR);
4174  if (phoIsInBarrel)
4175  h_dRPhoPFcand_ChHad_unCleaned_[1]->Fill(dR);
4176  else
4177  h_dRPhoPFcand_ChHad_unCleaned_[2]->Fill(dR);
4178  }
4179  if (type == reco::PFCandidate::h0) {
4180  SumPtIsoValNh += pfCandRef->pt();
4181  h_dRPhoPFcand_NeuHad_unCleaned_[0]->Fill(dR);
4182  if (phoIsInBarrel)
4183  h_dRPhoPFcand_NeuHad_unCleaned_[1]->Fill(dR);
4184  else
4185  h_dRPhoPFcand_NeuHad_unCleaned_[2]->Fill(dR);
4186  }
4187  if (type == reco::PFCandidate::gamma) {
4188  SumPtIsoValPh += pfCandRef->pt();
4189  h_dRPhoPFcand_Pho_unCleaned_[0]->Fill(dR);
4190  if (phoIsInBarrel)
4191  h_dRPhoPFcand_Pho_unCleaned_[1]->Fill(dR);
4192  else
4193  h_dRPhoPFcand_Pho_unCleaned_[2]->Fill(dR);
4194  }
4196  bool skip = false;
4197  for (std::vector<reco::PFCandidateRef>::const_iterator i = phoToParticleBasedIsoMap[matchingPho].begin();
4198  i != phoToParticleBasedIsoMap[matchingPho].end();
4199  ++i) {
4200  if ((*i) == pfCandRef) {
4201  skip = true;
4202  }
4203  } // loop over the PFCandidates flagged as overlapping with the photon
4204 
4205  if (skip)
4206  continue;
4207  if (type == reco::PFCandidate::h) {
4208  SumPtIsoValCleanCh += pfCandRef->pt();
4209  h_dRPhoPFcand_ChHad_Cleaned_[0]->Fill(dR);
4210  if (phoIsInBarrel)
4211  h_dRPhoPFcand_ChHad_Cleaned_[1]->Fill(dR);
4212  else
4213  h_dRPhoPFcand_ChHad_Cleaned_[2]->Fill(dR);
4214  }
4215  if (type == reco::PFCandidate::h0) {
4216  SumPtIsoValCleanNh += pfCandRef->pt();
4217  h_dRPhoPFcand_NeuHad_Cleaned_[0]->Fill(dR);
4218  if (phoIsInBarrel)
4219  h_dRPhoPFcand_NeuHad_Cleaned_[1]->Fill(dR);
4220  else
4221  h_dRPhoPFcand_NeuHad_Cleaned_[2]->Fill(dR);
4222  }
4223  if (type == reco::PFCandidate::gamma) {
4224  SumPtIsoValCleanPh += pfCandRef->pt();
4225  h_dRPhoPFcand_Pho_Cleaned_[0]->Fill(dR);
4226  if (phoIsInBarrel)
4227  h_dRPhoPFcand_Pho_Cleaned_[1]->Fill(dR);
4228  else
4229  h_dRPhoPFcand_Pho_Cleaned_[2]->Fill(dR);
4230  }
4231 
4232  } // dr=0.4
4233  } // loop over all PF Candidates
4234 
4235  h_SumPtOverPhoPt_ChHad_Cleaned_[0]->Fill(SumPtIsoValCleanCh / matchingPho->pt());
4236  h_SumPtOverPhoPt_NeuHad_Cleaned_[0]->Fill(SumPtIsoValCleanNh / matchingPho->pt());
4237  h_SumPtOverPhoPt_Pho_Cleaned_[0]->Fill(SumPtIsoValCleanPh / matchingPho->pt());
4238  h_SumPtOverPhoPt_ChHad_unCleaned_[0]->Fill(SumPtIsoValCh / matchingPho->pt());
4239  h_SumPtOverPhoPt_NeuHad_unCleaned_[0]->Fill(SumPtIsoValNh / matchingPho->pt());
4240  h_SumPtOverPhoPt_Pho_unCleaned_[0]->Fill(SumPtIsoValPh / matchingPho->pt());
4241  if (phoIsInBarrel) {
4242  h_SumPtOverPhoPt_ChHad_Cleaned_[1]->Fill(SumPtIsoValCleanCh / matchingPho->pt());
4243  h_SumPtOverPhoPt_NeuHad_Cleaned_[1]->Fill(SumPtIsoValCleanNh / matchingPho->pt());
4244  h_SumPtOverPhoPt_Pho_Cleaned_[1]->Fill(SumPtIsoValCleanPh / matchingPho->pt());
4245  h_SumPtOverPhoPt_ChHad_unCleaned_[1]->Fill(SumPtIsoValCh / matchingPho->pt());
4246  h_SumPtOverPhoPt_NeuHad_unCleaned_[1]->Fill(SumPtIsoValNh / matchingPho->pt());
4247  h_SumPtOverPhoPt_Pho_unCleaned_[1]->Fill(SumPtIsoValPh / matchingPho->pt());
4248  } else {
4249  h_SumPtOverPhoPt_ChHad_Cleaned_[2]->Fill(SumPtIsoValCleanCh / matchingPho->pt());
4250  h_SumPtOverPhoPt_NeuHad_Cleaned_[2]->Fill(SumPtIsoValCleanNh / matchingPho->pt());
4251  h_SumPtOverPhoPt_Pho_Cleaned_[2]->Fill(SumPtIsoValCleanPh / matchingPho->pt());
4252  h_SumPtOverPhoPt_ChHad_unCleaned_[2]->Fill(SumPtIsoValCh / matchingPho->pt());
4253  h_SumPtOverPhoPt_NeuHad_unCleaned_[2]->Fill(SumPtIsoValNh / matchingPho->pt());
4254  h_SumPtOverPhoPt_Pho_unCleaned_[2]->Fill(SumPtIsoValPh / matchingPho->pt());
4255  }
4256 
4257  } // only for pfPhotonValidator
4258 
4259  if (!(visibleConversion && visibleConversionsWithTwoSimTracks))
4260  continue;
4261 
4262  if (!isRunCentrally_) {
4263  h_r9_[1][0]->Fill(r9);
4264  if (phoIsInBarrel)
4265  h_r9_[1][1]->Fill(r9);
4266  if (phoIsInEndcap)
4267  h_r9_[1][2]->Fill(r9);
4268 
4269  h_simConvVtxRvsZ_[0]->Fill(fabs(mcConvZ_), mcConvR_);
4270  if (fabs(mcEta_) <= 1.) {
4271  h_simConvVtxRvsZ_[1]->Fill(fabs(mcConvZ_), mcConvR_);
4272  h_simConvVtxYvsX_->Fill(mcConvX_, mcConvY_);
4273  } else
4274  h_simConvVtxRvsZ_[2]->Fill(fabs(mcConvZ_), mcConvR_);
4275  }
4276 
4277  if (!fastSim_) {
4279  reco::ConversionRefVector conversions = matchingPho->conversions();
4280  bool atLeastOneRecoTwoTrackConversion = false;
4281  for (unsigned int iConv = 0; iConv < conversions.size(); iConv++) {
4282  reco::ConversionRef aConv = conversions[iConv];
4283  double like = aConv->MVAout();
4284  if (like < likelihoodCut_)
4285  continue;
4286 
4287  if (!isRunCentrally_)
4288  h2_EoverEtrueVsEta_[1]->Fill(mcEta_, matchingPho->superCluster()->energy() / (*mcPho).fourMomentum().e());
4289  p_EoverEtrueVsEta_[1]->Fill(mcEta_, matchingPho->superCluster()->energy() / (*mcPho).fourMomentum().e());
4290 
4291  //std::vector<reco::TrackRef> tracks = aConv->tracks();
4292  const std::vector<edm::RefToBase<reco::Track> > tracks = aConv->tracks();
4293  if (tracks.size() < 2)
4294  continue;
4295  atLeastOneRecoTwoTrackConversion = true;
4296 
4297  h_mvaOut_[0]->Fill(like);
4298 
4299  if (tracks.size() == 2) {
4300  if (sqrt(aConv->tracksPin()[0].Perp2()) < convTrackMinPtCut_ ||
4301  sqrt(aConv->tracksPin()[1].Perp2()) < convTrackMinPtCut_)
4302  continue;
4303  }
4304 
4305  if (dCotCutOn_) {
4306  if ((fabs(mcEta_) > 1.1 && fabs(mcEta_) < 1.4) && fabs(aConv->pairCotThetaSeparation()) > dCotHardCutValue_)
4307  continue;
4308  if (fabs(aConv->pairCotThetaSeparation()) > dCotCutValue_)
4309  continue;
4310  }
4311 
4312  nRecConv_++;
4313 
4314  std::map<const reco::Track*, TrackingParticleRef> myAss;
4315  std::map<const reco::Track*, TrackingParticleRef>::const_iterator itAss;
4316  std::map<reco::TrackRef, TrackingParticleRef>::const_iterator itAssMin;
4317  std::map<reco::TrackRef, TrackingParticleRef>::const_iterator itAssMax;
4318  //
4319 
4320  int nAssT2 = 0;
4321  for (unsigned int i = 0; i < tracks.size(); i++) {
4322  // reco::TrackRef track = tracks[i].castTo<reco::TrackRef>();
4323 
4324  type = 0;
4325  if (!isRunCentrally_)
4326  nHitsVsEta_[type]->Fill(mcEta_, float(tracks[i]->numberOfValidHits()) - 0.0001);
4327  if (!isRunCentrally_)
4328  nHitsVsR_[type]->Fill(mcConvR_, float(tracks[i]->numberOfValidHits()) - 0.0001);
4329  p_nHitsVsEta_[type]->Fill(mcEta_, float(tracks[i]->numberOfValidHits() - 0.0001));
4330  p_nHitsVsR_[type]->Fill(mcConvR_, float(tracks[i]->numberOfValidHits() - 0.0001));
4331  h_tkChi2_[type]->Fill(tracks[i]->normalizedChi2());
4332 
4335  tc.push_back(tfrb);
4336  // reco::RecoToSimCollection q = trackAssociator->associateRecoToSim(tc,theConvTP_);
4337  reco::SimToRecoCollection q = trackAssociator->associateSimToReco(tc, theConvTP_);
4338  std::vector<std::pair<RefToBase<reco::Track>, double> > trackV;
4339  int tpI = 0;
4340 
4341  if (q.find(theConvTP_[0]) != q.end()) {
4342  trackV = (std::vector<std::pair<RefToBase<reco::Track>, double> >)q[theConvTP_[0]];
4343  } else if (q.find(theConvTP_[1]) != q.end()) {
4344  trackV = (std::vector<std::pair<RefToBase<reco::Track>, double> >)q[theConvTP_[1]];
4345  tpI = 1;
4346  }
4347 
4348  if (trackV.empty())
4349  continue;
4350  edm::RefToBase<reco::Track> tr = trackV.front().first;
4351  myAss.insert(std::make_pair(tr.get(), theConvTP_[tpI]));
4352  nAssT2++;
4353  }
4354 
4355  type = 0;
4356 
4357  // float totP = sqrt(aConv->pairMomentum().Mag2());
4358  float refP = -99999.;
4359  float refPt = -99999.;
4360  if (aConv->conversionVertex().isValid()) {
4361  refP = sqrt(aConv->refittedPairMomentum().Mag2());
4362  refPt = sqrt(aConv->refittedPairMomentum().perp2());
4363  }
4364  float invM = aConv->pairInvariantMass();
4365 
4366  h_invMass_[type][0]->Fill(invM);
4367  if (phoIsInBarrel)
4368  h_invMass_[type][1]->Fill(invM);
4369  if (phoIsInEndcap)
4370  h_invMass_[type][2]->Fill(invM);
4371 
4373  if (tracks.size() == 2) {
4374  h_SimConvTwoTracks_[0]->Fill(mcEta_);
4375  h_SimConvTwoTracks_[1]->Fill(mcPhi_);
4376  h_SimConvTwoTracks_[2]->Fill(mcConvR_);
4377  h_SimConvTwoTracks_[3]->Fill(mcConvZ_);
4378  h_SimConvTwoTracks_[4]->Fill((*mcPho).fourMomentum().et());
4379 
4380  if (!aConv->caloCluster().empty())
4381  h_convEta_[1]->Fill(aConv->caloCluster()[0]->eta());
4382 
4383  float trkProvenance = 3;
4384  if (tracks[0]->algoName() == "outInEcalSeededConv" && tracks[1]->algoName() == "outInEcalSeededConv")
4385  trkProvenance = 0;
4386  if (tracks[0]->algoName() == "inOutEcalSeededConv" && tracks[1]->algoName() == "inOutEcalSeededConv")
4387  trkProvenance = 1;
4388  if ((tracks[0]->algoName() == "outInEcalSeededConv" && tracks[1]->algoName() == "inOutEcalSeededConv") ||
4389  (tracks[1]->algoName() == "outInEcalSeededConv" && tracks[0]->algoName() == "inOutEcalSeededConv"))
4390  trkProvenance = 2;
4391  if (trkProvenance == 3) {
4392  }
4393  h_trkProv_[0]->Fill(trkProvenance);
4394  h_trkAlgo_->Fill(tracks[0]->algo());
4395  h_trkAlgo_->Fill(tracks[1]->algo());
4396  h_convAlgo_->Fill(aConv->algo());
4397 
4399  if (nAssT2 == 2) {
4400  if (!isRunCentrally_) {
4401  h_r9_[2][0]->Fill(r9);
4402  if (phoIsInBarrel)
4403  h_r9_[2][1]->Fill(r9);
4404  if (phoIsInEndcap)
4405  h_r9_[2][2]->Fill(r9);
4406  }
4407 
4408  if (!aConv->caloCluster().empty())
4409  h_convEta_[2]->Fill(aConv->caloCluster()[0]->eta());
4410  nRecConvAss_++;
4411 
4412  h_SimConvTwoMTracks_[0]->Fill(mcEta_);
4413  h_SimConvTwoMTracks_[1]->Fill(mcPhi_);
4414  h_SimConvTwoMTracks_[2]->Fill(mcConvR_);
4415  h_SimConvTwoMTracks_[3]->Fill(mcConvZ_);
4416  h_SimConvTwoMTracks_[4]->Fill((*mcPho).fourMomentum().et());
4417 
4418  if (aConv->conversionVertex().isValid()) {
4419  float chi2Prob =
4420  ChiSquaredProbability(aConv->conversionVertex().chi2(), aConv->conversionVertex().ndof());
4421  if (chi2Prob > 0) {
4422  h_SimConvTwoMTracksAndVtxPGT0_[0]->Fill(mcEta_);
4423  h_SimConvTwoMTracksAndVtxPGT0_[1]->Fill(mcPhi_);
4424  h_SimConvTwoMTracksAndVtxPGT0_[2]->Fill(mcConvR_);
4425  h_SimConvTwoMTracksAndVtxPGT0_[3]->Fill(mcConvZ_);
4426  h_SimConvTwoMTracksAndVtxPGT0_[4]->Fill((*mcPho).fourMomentum().et());
4427  }
4428  if (chi2Prob > 0.0005) {
4429  h_SimConvTwoMTracksAndVtxPGT0005_[0]->Fill(mcEta_);
4430  h_SimConvTwoMTracksAndVtxPGT0005_[1]->Fill(mcPhi_);
4431  h_SimConvTwoMTracksAndVtxPGT0005_[2]->Fill(mcConvR_);
4432  h_SimConvTwoMTracksAndVtxPGT0005_[3]->Fill(mcConvZ_);
4433  h_SimConvTwoMTracksAndVtxPGT0005_[4]->Fill((*mcPho).fourMomentum().et());
4434  }
4435 
4436  if (chi2Prob > 0.0005) {
4437  if (!aConv->caloCluster().empty()) {
4438  h_convEta_[0]->Fill(aConv->caloCluster()[0]->eta());
4439  h_convPhi_[0]->Fill(aConv->caloCluster()[0]->phi());
4440  h_convERes_[0][0]->Fill(aConv->caloCluster()[0]->energy() / (*mcPho).fourMomentum().e());
4441  }
4442  if (!isRunCentrally_) {
4443  h_r9VsNofTracks_[0][0]->Fill(r9, aConv->nTracks());
4444  h_EtR9Less093_[1][0]->Fill(photonEt);
4445  if (phoIsInBarrel)
4446  h_EtR9Less093_[1][1]->Fill(photonEt);
4447  if (phoIsInEndcap)
4448  h_EtR9Less093_[1][2]->Fill(photonEt);
4449  }
4450  if (phoIsInBarrel) {
4451  if (!aConv->caloCluster().empty())
4452  h_convERes_[0][1]->Fill(aConv->caloCluster()[0]->energy() / (*mcPho).fourMomentum().e());
4453  if (!isRunCentrally_)
4454  h_r9VsNofTracks_[0][1]->Fill(r9, aConv->nTracks());
4455  h_mvaOut_[1]->Fill(like);
4456  }
4457  if (phoIsInEndcap) {
4458  if (!aConv->caloCluster().empty())
4459  h_convERes_[0][2]->Fill(aConv->caloCluster()[0]->energy() / (*mcPho).fourMomentum().e());
4460  if (!isRunCentrally_)
4461  h_r9VsNofTracks_[0][2]->Fill(r9, aConv->nTracks());
4462  h_mvaOut_[2]->Fill(like);
4463  }
4464  }
4465  }
4466 
4468  type = 1;
4469 
4470  h_trkProv_[1]->Fill(trkProvenance);
4471  h_invMass_[type][0]->Fill(invM);
4472 
4473  float eoverp = -99999.;
4474 
4475  if (aConv->conversionVertex().isValid()) {
4476  eoverp = photonE / sqrt(aConv->refittedPairMomentum().Mag2());
4477  //eoverp= aConv->EoverPrefittedTracks();
4478  h_convPtRes_[type][0]->Fill(refPt / (*mcPho).fourMomentum().et());
4479  h_EoverPTracks_[type][0]->Fill(eoverp);
4480  h_PoverETracks_[type][0]->Fill(1. / eoverp);
4481  if (!isRunCentrally_)
4482  h2_EoverEtrueVsEoverP_[0]->Fill(eoverp,
4483  matchingPho->superCluster()->energy() / (*mcPho).fourMomentum().e());
4484  if (!isRunCentrally_)
4485  h2_PoverPtrueVsEoverP_[0]->Fill(eoverp, refP / (*mcPho).fourMomentum().e());
4486  if (!isRunCentrally_)
4487  h2_EoverPVsEta_[0]->Fill(mcEta_, eoverp);
4488  if (!isRunCentrally_)
4489  h2_EoverPVsR_[0]->Fill(mcConvR_, eoverp);
4490  p_EoverPVsEta_[0]->Fill(mcEta_, eoverp);
4491  p_EoverPVsR_[0]->Fill(mcConvR_, eoverp);
4492  p_eResVsR_->Fill(mcConvR_, photonE / (*mcPho).fourMomentum().e());
4493  if (!isRunCentrally_)
4494  h2_PoverPtrueVsEta_[0]->Fill(mcEta_, refP / (*mcPho).fourMomentum().e());
4495  p_PoverPtrueVsEta_[0]->Fill(mcEta_, refP / (*mcPho).fourMomentum().e());
4496  }
4497 
4498  if (!isRunCentrally_)
4499  h2_EoverEtrueVsEta_[0]->Fill(mcEta_,
4500  matchingPho->superCluster()->energy() / (*mcPho).fourMomentum().e());
4501  if (!isRunCentrally_)
4502  h2_EoverEtrueVsR_[0]->Fill(mcConvR_,
4503  matchingPho->superCluster()->energy() / (*mcPho).fourMomentum().e());
4504  p_EoverEtrueVsEta_[0]->Fill(mcEta_, matchingPho->superCluster()->energy() / (*mcPho).fourMomentum().e());
4505  p_EoverEtrueVsR_[0]->Fill(mcConvR_, matchingPho->superCluster()->energy() / (*mcPho).fourMomentum().e());
4506 
4507  if (!isRunCentrally_)
4508  h2_etaVsRsim_[0]->Fill(mcEta_, mcConvR_);
4509 
4510  // here original tracks and their inner momentum is considered
4511  float dPhiTracksAtVtx = aConv->dPhiTracksAtVtx();
4512  h_DPhiTracksAtVtx_[type][0]->Fill(dPhiTracksAtVtx);
4513  if (!isRunCentrally_)
4514  h2_DPhiTracksAtVtxVsEta_->Fill(mcEta_, dPhiTracksAtVtx);
4515  if (!isRunCentrally_)
4516  h2_DPhiTracksAtVtxVsR_->Fill(mcConvR_, dPhiTracksAtVtx);
4517  p_DPhiTracksAtVtxVsEta_->Fill(mcEta_, dPhiTracksAtVtx);
4518  p_DPhiTracksAtVtxVsR_->Fill(mcConvR_, dPhiTracksAtVtx);
4519 
4520  h_DCotTracks_[type][0]->Fill(aConv->pairCotThetaSeparation());
4521  if (!isRunCentrally_)
4522  h2_DCotTracksVsEta_->Fill(mcEta_, aConv->pairCotThetaSeparation());
4523  if (!isRunCentrally_)
4524  h2_DCotTracksVsR_->Fill(mcConvR_, aConv->pairCotThetaSeparation());
4525  p_DCotTracksVsEta_->Fill(mcEta_, aConv->pairCotThetaSeparation());
4526  p_DCotTracksVsR_->Fill(mcConvR_, aConv->pairCotThetaSeparation());
4527 
4528  if (phoIsInBarrel) {
4529  h_invMass_[type][1]->Fill(invM);
4530  if (aConv->conversionVertex().isValid()) {
4531  h_convPtRes_[type][1]->Fill(refPt / (*mcPho).fourMomentum().et());
4532  h_EoverPTracks_[type][1]->Fill(eoverp);
4533  if (mcConvR_ < 15)
4534  h_EoverPTracks_[0][0]->Fill(eoverp);
4535  if (mcConvR_ > 15 && mcConvR_ < 58)
4536  h_EoverPTracks_[0][1]->Fill(eoverp);
4537  if (mcConvR_ > 58)
4538  h_EoverPTracks_[0][2]->Fill(eoverp);
4539  h_PoverETracks_[type][1]->Fill(1. / eoverp);
4540  if (!isRunCentrally_)
4541  h2_EoverEtrueVsEoverP_[1]->Fill(
4542  eoverp, matchingPho->superCluster()->energy() / (*mcPho).fourMomentum().e());
4543  if (!isRunCentrally_)
4544  h2_PoverPtrueVsEoverP_[1]->Fill(eoverp, refP / (*mcPho).fourMomentum().e());
4545  }
4546  h_DPhiTracksAtVtx_[type][1]->Fill(dPhiTracksAtVtx);
4547  h_DCotTracks_[type][1]->Fill(aConv->pairCotThetaSeparation());
4548  }
4549 
4550  if (phoIsInEndcap) {
4551  h_invMass_[type][2]->Fill(invM);
4552  if (aConv->conversionVertex().isValid()) {
4553  h_convPtRes_[type][2]->Fill(refPt / (*mcPho).fourMomentum().et());
4554  h_EoverPTracks_[type][2]->Fill(eoverp);
4555  h_PoverETracks_[type][2]->Fill(1. / eoverp);
4556  if (!isRunCentrally_)
4557  h2_EoverEtrueVsEoverP_[2]->Fill(
4558  eoverp, matchingPho->superCluster()->energy() / (*mcPho).fourMomentum().e());
4559  if (!isRunCentrally_)
4560  h2_PoverPtrueVsEoverP_[2]->Fill(eoverp, refP / (*mcPho).fourMomentum().e());
4561  }
4562  h_DPhiTracksAtVtx_[type][2]->Fill(dPhiTracksAtVtx);
4563  h_DCotTracks_[type][2]->Fill(aConv->pairCotThetaSeparation());
4564  }
4565 
4566  if (aConv->conversionVertex().isValid()) {
4567  h_convVtxdX_->Fill(aConv->conversionVertex().position().x() - mcConvX_);
4568  h_convVtxdY_->Fill(aConv->conversionVertex().position().y() - mcConvY_);
4569  h_convVtxdZ_->Fill(aConv->conversionVertex().position().z() - mcConvZ_);
4570  h_convVtxdR_->Fill(sqrt(aConv->conversionVertex().position().perp2()) - mcConvR_);
4571 
4572  if (fabs(mcConvEta_) <= 1.2) {
4573  h_convVtxdX_barrel_->Fill(aConv->conversionVertex().position().x() - mcConvX_);
4574  h_convVtxdY_barrel_->Fill(aConv->conversionVertex().position().y() - mcConvY_);
4575  h_convVtxdZ_barrel_->Fill(aConv->conversionVertex().position().z() - mcConvZ_);
4576  h_convVtxdR_barrel_->Fill(sqrt(aConv->conversionVertex().position().perp2()) - mcConvR_);
4577  } else {
4578  h_convVtxdX_endcap_->Fill(aConv->conversionVertex().position().x() - mcConvX_);
4579  h_convVtxdY_endcap_->Fill(aConv->conversionVertex().position().y() - mcConvY_);
4580  h_convVtxdZ_endcap_->Fill(aConv->conversionVertex().position().z() - mcConvZ_);
4581  h_convVtxdR_endcap_->Fill(sqrt(aConv->conversionVertex().position().perp2()) - mcConvR_);
4582  }
4583 
4584  h_convVtxdPhi_->Fill(aConv->conversionVertex().position().phi() - mcConvPhi_);
4585  h_convVtxdEta_->Fill(aConv->conversionVertex().position().eta() - mcConvEta_);
4586  if (!isRunCentrally_)
4587  h2_convVtxdRVsR_->Fill(mcConvR_, sqrt(aConv->conversionVertex().position().perp2()) - mcConvR_);
4588  if (!isRunCentrally_)
4589  h2_convVtxdRVsEta_->Fill(mcEta_, sqrt(aConv->conversionVertex().position().perp2()) - mcConvR_);
4590  p_convVtxdRVsR_->Fill(mcConvR_, sqrt(aConv->conversionVertex().position().perp2()) - mcConvR_);
4591  p_convVtxdRVsEta_->Fill(mcEta_, sqrt(aConv->conversionVertex().position().perp2()) - mcConvR_);
4592  float signX = aConv->refittedPairMomentum().x() / fabs(aConv->refittedPairMomentum().x());
4593  float signY = aConv->refittedPairMomentum().y() / fabs(aConv->refittedPairMomentum().y());
4594  float signZ = aConv->refittedPairMomentum().z() / fabs(aConv->refittedPairMomentum().z());
4595  p_convVtxdXVsX_->Fill(mcConvX_, (aConv->conversionVertex().position().x() - mcConvX_) * signX);
4596  p_convVtxdYVsY_->Fill(mcConvY_, (aConv->conversionVertex().position().y() - mcConvY_) * signY);
4597  p_convVtxdZVsZ_->Fill(mcConvZ_, (aConv->conversionVertex().position().z() - mcConvZ_) * signZ);
4598 
4599  if (!isRunCentrally_)
4600  h2_convVtxRrecVsTrue_->Fill(mcConvR_, sqrt(aConv->conversionVertex().position().perp2()));
4601 
4602  //float zPV = aConv->zOfPrimaryVertexFromTracks();
4603  float thetaConv = aConv->refittedPairMomentum().Theta();
4604  float thetaSC = matchingPho->superCluster()->position().theta();
4605  float rSC =
4606  sqrt(matchingPho->superCluster()->position().x() * matchingPho->superCluster()->position().x() +
4607  matchingPho->superCluster()->position().y() * matchingPho->superCluster()->position().y());
4608  float zSC = matchingPho->superCluster()->position().z();
4609  float zPV = sqrt(rSC * rSC + zSC * zSC) * sin(thetaConv - thetaSC) / sin(thetaConv);
4610 
4611  h_zPVFromTracks_[0]->Fill(zPV);
4612  h_dzPVFromTracks_[0]->Fill(zPV - (*mcPho).primaryVertex().z());
4613 
4614  if (phoIsInBarrel) {
4615  h_zPVFromTracks_[1]->Fill(zPV);
4616  h_dzPVFromTracks_[1]->Fill(zPV - (*mcPho).primaryVertex().z());
4617  } else if (phoIsInEndcap) {
4618  h_zPVFromTracks_[2]->Fill(zPV);
4619  h_dzPVFromTracks_[2]->Fill(zPV - (*mcPho).primaryVertex().z());
4620  } else if (phoIsInEndcapP) {
4621  h_zPVFromTracks_[3]->Fill(zPV);
4622  h_dzPVFromTracks_[3]->Fill(zPV - (*mcPho).primaryVertex().z());
4623  } else if (phoIsInEndcapM) {
4624  h_zPVFromTracks_[4]->Fill(zPV);
4625  h_dzPVFromTracks_[4]->Fill(zPV - (*mcPho).primaryVertex().z());
4626  }
4627 
4628  p_dzPVVsR_->Fill(mcConvR_, zPV - (*mcPho).primaryVertex().z());
4629  p_dzPVVsEta_->Fill(mcConvEta_, zPV - (*mcPho).primaryVertex().z());
4630  if (!isRunCentrally_)
4631  h2_dzPVVsR_->Fill(mcConvR_, zPV - (*mcPho).primaryVertex().z());
4632  }
4633 
4634  float dPhiTracksAtEcal = -99;
4635  float dEtaTracksAtEcal = -99;
4636  if (!aConv->bcMatchingWithTracks().empty() && aConv->bcMatchingWithTracks()[0].isNonnull() &&
4637  aConv->bcMatchingWithTracks()[1].isNonnull()) {
4638  nRecConvAssWithEcal_++;
4639  float recoPhi1 = aConv->ecalImpactPosition()[0].phi();
4640  float recoPhi2 = aConv->ecalImpactPosition()[1].phi();
4641  float recoEta1 = aConv->ecalImpactPosition()[0].eta();
4642  float recoEta2 = aConv->ecalImpactPosition()[1].eta();
4643  // unused float bcPhi1 = aConv->bcMatchingWithTracks()[0]->phi();
4644  // unused float bcPhi2 = aConv->bcMatchingWithTracks()[1]->phi();
4645  // unused float bcEta1 = aConv->bcMatchingWithTracks()[0]->eta();
4646  // unused float bcEta2 = aConv->bcMatchingWithTracks()[1]->eta();
4647  recoPhi1 = phiNormalization(recoPhi1);
4648  recoPhi2 = phiNormalization(recoPhi2);
4649  dPhiTracksAtEcal = recoPhi1 - recoPhi2;
4650  dPhiTracksAtEcal = phiNormalization(dPhiTracksAtEcal);
4651  dEtaTracksAtEcal = recoEta1 - recoEta2;
4652 
4653  h_DPhiTracksAtEcal_[type][0]->Fill(fabs(dPhiTracksAtEcal));
4654  if (!isRunCentrally_)
4655  h2_DPhiTracksAtEcalVsR_->Fill(mcConvR_, fabs(dPhiTracksAtEcal));
4656  if (!isRunCentrally_)
4657  h2_DPhiTracksAtEcalVsEta_->Fill(mcEta_, fabs(dPhiTracksAtEcal));
4658  p_DPhiTracksAtEcalVsR_->Fill(mcConvR_, fabs(dPhiTracksAtEcal));
4659  p_DPhiTracksAtEcalVsEta_->Fill(mcEta_, fabs(dPhiTracksAtEcal));
4660 
4661  h_DEtaTracksAtEcal_[type][0]->Fill(dEtaTracksAtEcal);
4662 
4663  if (phoIsInBarrel) {
4664  h_DPhiTracksAtEcal_[type][1]->Fill(fabs(dPhiTracksAtEcal));
4665  h_DEtaTracksAtEcal_[type][1]->Fill(dEtaTracksAtEcal);
4666  }
4667  if (phoIsInEndcap) {
4668  h_DPhiTracksAtEcal_[type][2]->Fill(fabs(dPhiTracksAtEcal));
4669  h_DEtaTracksAtEcal_[type][2]->Fill(dEtaTracksAtEcal);
4670  }
4671  }
4673  for (unsigned int i = 0; i < tracks.size(); i++) {
4675  itAss = myAss.find(tfrb.get());
4676  if (itAss == myAss.end())
4677  continue;
4678 
4679  float trkProvenance = 3;
4680  if (tracks[0]->algoName() == "outInEcalSeededConv" && tracks[1]->algoName() == "outInEcalSeededConv")
4681  trkProvenance = 0;
4682  if (tracks[0]->algoName() == "inOutEcalSeededConv" && tracks[1]->algoName() == "inOutEcalSeededConv")
4683  trkProvenance = 1;
4684  if ((tracks[0]->algoName() == "outInEcalSeededConv" &&
4685  tracks[1]->algoName() == "inOutEcalSeededConv") ||
4686  (tracks[1]->algoName() == "outInEcalSeededConv" && tracks[0]->algoName() == "inOutEcalSeededConv"))
4687  trkProvenance = 2;
4688 
4689  if (!isRunCentrally_)
4690  nHitsVsEta_[type]->Fill(mcEta_, float(tracks[i]->numberOfValidHits()));
4691  if (!isRunCentrally_)
4692  nHitsVsR_[type]->Fill(mcConvR_, float(tracks[i]->numberOfValidHits()));
4693  p_nHitsVsEta_[type]->Fill(mcEta_, float(tracks[i]->numberOfValidHits()) - 0.0001);
4694  p_nHitsVsR_[type]->Fill(mcConvR_, float(tracks[i]->numberOfValidHits()) - 0.0001);
4695  h_tkChi2_[type]->Fill(tracks[i]->normalizedChi2());
4696  h_tkChi2Large_[type]->Fill(tracks[i]->normalizedChi2());
4697  if (!isRunCentrally_)
4698  h2_Chi2VsEta_[0]->Fill(mcEta_, tracks[i]->normalizedChi2());
4699  if (!isRunCentrally_)
4700  h2_Chi2VsR_[0]->Fill(mcConvR_, tracks[i]->normalizedChi2());
4701  p_Chi2VsEta_[0]->Fill(mcEta_, tracks[i]->normalizedChi2());
4702  p_Chi2VsR_[0]->Fill(mcConvR_, tracks[i]->normalizedChi2());
4703 
4704  float simPt = sqrt(((*itAss).second)->momentum().perp2());
4705  // float recPt = sqrt( aConv->tracks()[i]->innerMomentum().Perp2() ) ;
4706  float refPt = -9999.;
4707  float px = 0, py = 0;
4708 
4709  if (aConv->conversionVertex().isValid()) {
4710  reco::Track refTrack = aConv->conversionVertex().refittedTracks()[i];
4711  px = refTrack.momentum().x();
4712  py = refTrack.momentum().y();
4713  refPt = sqrt(px * px + py * py);
4714 
4715  float ptres = refPt - simPt;
4716  // float pterror = aConv->tracks()[i]->ptError();
4717  float pterror = aConv->conversionVertex().refittedTracks()[i].ptError();
4718  if (!isRunCentrally_) {
4719  h2_PtRecVsPtSim_[0]->Fill(simPt, refPt);
4720  if (trkProvenance == 3)
4721  h2_PtRecVsPtSimMixProv_->Fill(simPt, refPt);
4722  }
4723 
4724  h_TkPtPull_[0]->Fill(ptres / pterror);
4725  if (!isRunCentrally_)
4726  h2_TkPtPull_[0]->Fill(mcEta_, ptres / pterror);
4727 
4728  h_TkD0_[0]->Fill(tracks[i]->d0() * tracks[i]->charge());
4729 
4730  // if ( fName_ != "pfPhotonValidator" && fName_ != "oldpfPhotonValidator" )
4731  if (!aConv->bcMatchingWithTracks().empty() && aConv->bcMatchingWithTracks()[i].isNonnull())
4732  hBCEnergyOverTrackPout_[0]->Fill(aConv->bcMatchingWithTracks()[i]->energy() /
4733  sqrt(aConv->tracks()[i]->outerMomentum().Mag2()));
4734 
4735  if (phoIsInBarrel) {
4736  h_TkD0_[1]->Fill(tracks[i]->d0() * tracks[i]->charge());
4737  h_TkPtPull_[1]->Fill(ptres / pterror);
4738  if (!isRunCentrally_)
4739  h2_PtRecVsPtSim_[1]->Fill(simPt, refPt);
4740  //if ( fName_ != "pfPhotonValidator" && fName_ != "oldpfPhotonValidator")
4741  if (!aConv->bcMatchingWithTracks().empty() && aConv->bcMatchingWithTracks()[i].isNonnull())
4742  hBCEnergyOverTrackPout_[1]->Fill(aConv->bcMatchingWithTracks()[i]->energy() /
4743  sqrt(aConv->tracks()[i]->outerMomentum().Mag2()));
4744  }
4745  if (phoIsInEndcap) {
4746  h_TkD0_[2]->Fill(tracks[i]->d0() * tracks[i]->charge());
4747  h_TkPtPull_[2]->Fill(ptres / pterror);
4748  if (!isRunCentrally_)
4749  h2_PtRecVsPtSim_[2]->Fill(simPt, refPt);
4750  // if ( fName_ != "pfPhotonValidator" && fName_ != "oldpfPhotonValidator")
4751  if (!aConv->bcMatchingWithTracks().empty() && aConv->bcMatchingWithTracks()[i].isNonnull())
4752  hBCEnergyOverTrackPout_[2]->Fill(aConv->bcMatchingWithTracks()[i]->energy() /
4753  sqrt(aConv->tracks()[i]->outerMomentum().Mag2()));
4754  }
4755  }
4756 
4757  } // end loop over track
4758  } // end analysis of two associated tracks
4759  } // end analysis of two tracks
4760 
4761  } // loop over conversions
4762 
4764 
4765  reco::ConversionRefVector conversionsOneLeg = matchingPho->conversionsOneLeg();
4766  if (!atLeastOneRecoTwoTrackConversion) {
4767  for (unsigned int iConv = 0; iConv < conversionsOneLeg.size(); iConv++) {
4768  reco::ConversionRef aConv = conversionsOneLeg[iConv];
4769  const std::vector<edm::RefToBase<reco::Track> > tracks = aConv->tracks();
4770 
4771  h_trkAlgo_->Fill(tracks[0]->algo());
4772  h_convAlgo_->Fill(aConv->algo());
4773 
4774  int nAssT = 0;
4775  std::map<const reco::Track*, TrackingParticleRef> myAss;
4776  for (unsigned int i = 0; i < tracks.size(); i++) {
4777  p_nHitsVsEtaSL_[0]->Fill(mcEta_, float(tracks[0]->numberOfValidHits() - 0.0001));
4778  p_nHitsVsRSL_[0]->Fill(mcConvR_, float(tracks[0]->numberOfValidHits() - 0.0001));
4779  h_tkChi2SL_[0]->Fill(tracks[0]->normalizedChi2());
4780 
4781  float eoverp = photonE / tracks[0]->p();
4782  h_EoverP_SL_[0]->Fill(eoverp);
4783  if (phoIsInBarrel) {
4784  h_EoverP_SL_[1]->Fill(eoverp);
4785  } else {
4786  h_EoverP_SL_[2]->Fill(eoverp);
4787  }
4788  h_convSLVtxRvsZ_[0]->Fill(tracks[0]->innerPosition().z(), sqrt(tracks[0]->innerPosition().Perp2()));
4789  if (fabs(mcEta_) <= 1.) {
4790  h_convSLVtxRvsZ_[1]->Fill(tracks[0]->innerPosition().z(), sqrt(tracks[0]->innerPosition().Perp2()));
4791  } else {
4792  h_convSLVtxRvsZ_[2]->Fill(tracks[0]->innerPosition().z(), sqrt(tracks[0]->innerPosition().Perp2()));
4793  }
4794 
4797  tc.push_back(tfrb);
4798  reco::SimToRecoCollection q = trackAssociator->associateSimToReco(tc, theConvTP_);
4799  std::vector<std::pair<RefToBase<reco::Track>, double> > trackV;
4800  int tpI = 0;
4801 
4802  if (q.find(theConvTP_[0]) != q.end()) {
4803  trackV = (std::vector<std::pair<RefToBase<reco::Track>, double> >)q[theConvTP_[0]];
4804  } else if (q.find(theConvTP_[1]) != q.end()) {
4805  trackV = (std::vector<std::pair<RefToBase<reco::Track>, double> >)q[theConvTP_[1]];
4806  tpI = 1;
4807  }
4808 
4809  if (trackV.empty())
4810  continue;
4811  edm::RefToBase<reco::Track> tr = trackV.front().first;
4812  myAss.insert(std::make_pair(tr.get(), theConvTP_[tpI]));
4813  nAssT++;
4814  }
4815 
4816  if (nAssT > 0) {
4817  h_SimConvOneMTracks_[0]->Fill(mcEta_);
4818  h_SimConvOneMTracks_[1]->Fill(mcPhi_);
4819  h_SimConvOneMTracks_[2]->Fill(mcConvR_);
4820  h_SimConvOneMTracks_[3]->Fill(mcConvZ_);
4821  h_SimConvOneMTracks_[4]->Fill((*mcPho).fourMomentum().et());
4822  }
4823  } // End loop over single leg conversions
4824  }
4825 
4826  } // if !fastSim
4827  } // End loop over generated particles
4828  } // End loop over simulated Photons
4829 
4830  if (!isRunCentrally_) {
4831  h_nSimPho_[0]->Fill(float(nSimPho_[0]));
4832  h_nSimPho_[1]->Fill(float(nSimPho_[1]));
4833  h_nSimConv_[0]->Fill(float(nSimConv_[0]));
4834  h_nSimConv_[1]->Fill(float(nSimConv_[1]));
4835  }
4836 
4837  if (!fastSim_) {
4839  for (reco::PhotonCollection::const_iterator iPho = photonCollection.begin(); iPho != photonCollection.end();
4840  iPho++) {
4841  reco::Photon aPho = reco::Photon(*iPho);
4842  // float et= aPho.superCluster()->energy()/cosh( aPho.superCluster()->eta()) ;
4844  for (unsigned int iConv = 0; iConv < conversions.size(); iConv++) {
4845  reco::ConversionRef aConv = conversions[iConv];
4846  double like = aConv->MVAout();
4847  if (like < likelihoodCut_)
4848  continue;
4849  //std::vector<reco::TrackRef> tracks = aConv->tracks();
4850  const std::vector<edm::RefToBase<reco::Track> > tracks = aConv->tracks();
4851  if (tracks.size() < 2)
4852  continue;
4853 
4854  RefToBase<reco::Track> tk1 = aConv->tracks().front();
4855  RefToBase<reco::Track> tk2 = aConv->tracks().back();
4857  tc1.push_back(tk1);
4858  tc2.push_back(tk2);
4859 
4860  bool phoIsInBarrel = false;
4861  bool phoIsInEndcap = false;
4862  if (fabs(aPho.superCluster()->position().eta()) < 1.479) {
4863  phoIsInBarrel = true;
4864  } else {
4865  phoIsInEndcap = true;
4866  }
4867 
4868  if (dCotCutOn_) {
4869  if ((fabs(mcEta_) > 1.1 && fabs(mcEta_) < 1.4) && fabs(aConv->pairCotThetaSeparation()) > dCotHardCutValue_)
4870  continue;
4871  if (fabs(aConv->pairCotThetaSeparation()) > dCotCutValue_)
4872  continue;
4873  }
4874 
4875  h_RecoConvTwoTracks_[0]->Fill(aPho.eta());
4876  h_RecoConvTwoTracks_[1]->Fill(aPho.phi());
4877  if (aConv->conversionVertex().isValid())
4878  h_RecoConvTwoTracks_[2]->Fill(aConv->conversionVertex().position().perp2());
4879  h_RecoConvTwoTracks_[3]->Fill(aConv->conversionVertex().position().z());
4880  h_RecoConvTwoTracks_[4]->Fill(aPho.et());
4881 
4882  int nAssT2 = 0;
4883  for (std::vector<PhotonMCTruth>::const_iterator mcPho = mcPhotons.begin(); mcPho != mcPhotons.end(); mcPho++) {
4884  // mcConvPt_= (*mcPho).fourMomentum().et();
4885  float mcPhi = (*mcPho).fourMomentum().phi();
4886  //simPV_Z = (*mcPho).primaryVertex().z();
4887  mcPhi_ = phiNormalization(mcPhi);
4888  mcEta_ = (*mcPho).fourMomentum().pseudoRapidity();
4889  mcEta_ = etaTransformation(mcEta_, (*mcPho).primaryVertex().z());
4890  //mcConvR_= (*mcPho).vertex().perp();
4891  //mcConvX_= (*mcPho).vertex().x();
4892  //mcConvY_= (*mcPho).vertex().y();
4893  //mcConvZ_= (*mcPho).vertex().z();
4894  //mcConvEta_= (*mcPho).vertex().eta();
4895  //mcConvPhi_= (*mcPho).vertex().phi();
4896  if (fabs(mcEta_) > END_HI)
4897  continue;
4898  // if (mcConvPt_<minPhoPtForPurity) continue;
4899  //if (fabs(mcEta_)>maxPhoEtaForPurity) continue;
4900  //if (fabs(mcConvZ_)>maxPhoZForPurity) continue;
4901  //if (mcConvR_>maxPhoRForEffic) continue;
4902 
4903  if ((*mcPho).isAConversion() != 1)
4904  continue;
4905  if (!((fabs(mcEta_) <= BARL && mcConvR_ < 85) ||
4906  (fabs(mcEta_) > BARL && fabs(mcEta_) <= END_HI && fabs((*mcPho).vertex().z()) < 210)))
4907  continue;
4908 
4909  theConvTP_.clear();
4910  for (size_t i = 0; i < trackingParticles.size(); ++i) {
4911  TrackingParticleRef tp(ElectronTPHandle, i);
4912  if (fabs(tp->vx() - (*mcPho).vertex().x()) < 0.0001 && fabs(tp->vy() - (*mcPho).vertex().y()) < 0.0001 &&
4913  fabs(tp->vz() - (*mcPho).vertex().z()) < 0.0001) {
4914  theConvTP_.push_back(tp);
4915  }
4916  }
4917 
4918  if (theConvTP_.size() < 2)
4919  continue;
4920 
4921  reco::RecoToSimCollection const& p1 = trackAssociator->associateRecoToSim(tc1, theConvTP_);
4922  reco::RecoToSimCollection const& p2 = trackAssociator->associateRecoToSim(tc2, theConvTP_);
4923  std::vector<std::pair<RefToBase<reco::Track>, double> > trackV1, trackV2;
4924 
4925  auto itP1 = p1.find(tk1);
4926  auto itP2 = p2.find(tk2);
4927  bool good = (itP1 != p1.end()) and (not itP1->val.empty()) and (itP2 != p2.end()) and (not itP2->val.empty());
4928  if (not good) {
4929  itP1 = p1.find(tk2);
4930  itP2 = p2.find(tk1);
4931  good = (itP1 != p1.end()) and (not itP1->val.empty()) and (itP2 != p2.end()) and (not itP2->val.empty());
4932  }
4933  if (good) {
4934  std::vector<std::pair<TrackingParticleRef, double> > const& tp1 = itP1->val;
4935  std::vector<std::pair<TrackingParticleRef, double> > const& tp2 = itP2->val;
4936 
4937  TrackingParticleRef tpr1 = tp1.front().first;
4938  TrackingParticleRef tpr2 = tp2.front().first;
4939 
4940  if (abs(tpr1->pdgId()) == 11 && abs(tpr2->pdgId()) == 11) {
4941  if ((tpr1->parentVertex()->sourceTracks_end() - tpr1->parentVertex()->sourceTracks_begin() == 1) &&
4942  (tpr2->parentVertex()->sourceTracks_end() - tpr2->parentVertex()->sourceTracks_begin() == 1)) {
4943  if (tpr1->parentVertex().key() == tpr2->parentVertex().key() &&
4944  ((*tpr1->parentVertex()->sourceTracks_begin())->pdgId() == 22)) {
4945  nAssT2 = 2;
4946  break;
4947  }
4948  }
4949  }
4950  }
4951 
4952  } // end loop over simulated photons
4953 
4954  if (nAssT2 == 2) {
4955  h_RecoConvTwoMTracks_[0]->Fill(aPho.eta());
4956  h_RecoConvTwoMTracks_[1]->Fill(aPho.phi());
4957  if (aConv->conversionVertex().isValid())
4958  h_RecoConvTwoMTracks_[2]->Fill(aConv->conversionVertex().position().perp2());
4959  h_RecoConvTwoMTracks_[3]->Fill(aConv->conversionVertex().position().z());
4960  h_RecoConvTwoMTracks_[4]->Fill(aPho.et());
4961  }
4962 
4964  if (aConv->conversionVertex().isValid()) {
4965  float chi2Prob = ChiSquaredProbability(aConv->conversionVertex().chi2(), aConv->conversionVertex().ndof());
4966  double convR = sqrt(aConv->conversionVertex().position().perp2());
4967  double scalar = aConv->conversionVertex().position().x() * aConv->pairMomentum().x() +
4968  aConv->conversionVertex().position().y() * aConv->pairMomentum().y();
4969 
4970  if (scalar < 0)
4971  convR = -sqrt(aConv->conversionVertex().position().perp2());
4972  h_convVtxRvsZ_[0]->Fill(fabs(aConv->conversionVertex().position().z()),
4973  sqrt(aConv->conversionVertex().position().perp2()));
4974 
4975  if (!aConv->caloCluster().empty()) {
4976  if (!isRunCentrally_)
4977  h2_etaVsRreco_[0]->Fill(aConv->caloCluster()[0]->eta(),
4978  sqrt(aConv->conversionVertex().position().perp2()));
4979  if (fabs(aConv->caloCluster()[0]->eta()) <= 1.) {
4980  h_convVtxYvsX_->Fill(aConv->conversionVertex().position().y(), aConv->conversionVertex().position().x());
4981  h_convVtxRvsZ_[1]->Fill(fabs(aConv->conversionVertex().position().z()), convR);
4982 
4983  if (!isRunCentrally_) {
4984  h_convVtxYvsX_zoom_[0]->Fill(aConv->conversionVertex().position().y(),
4985  aConv->conversionVertex().position().x());
4986  h_convVtxYvsX_zoom_[1]->Fill(aConv->conversionVertex().position().y(),
4987  aConv->conversionVertex().position().x());
4988  h_convVtxRvsZ_zoom_[0]->Fill(fabs(aConv->conversionVertex().position().z()), convR);
4989  h_convVtxRvsZ_zoom_[1]->Fill(fabs(aConv->conversionVertex().position().z()), convR);
4990  }
4991  }
4992  if (fabs(aConv->caloCluster()[0]->eta()) > 1.)
4993  h_convVtxRvsZ_[2]->Fill(fabs(aConv->conversionVertex().position().z()), convR);
4994  }
4995 
4996  h_vtxChi2Prob_[0]->Fill(chi2Prob);
4997  h_vtxChi2_[0]->Fill(aConv->conversionVertex().normalizedChi2());
4998  if (phoIsInBarrel) {
4999  h_vtxChi2Prob_[1]->Fill(chi2Prob);
5000  h_vtxChi2_[1]->Fill(aConv->conversionVertex().normalizedChi2());
5001  }
5002  if (phoIsInEndcap) {
5003  h_vtxChi2Prob_[2]->Fill(chi2Prob);
5004  h_vtxChi2_[2]->Fill(aConv->conversionVertex().normalizedChi2());
5005  }
5006 
5007  } // end conversion vertex valid
5008  } // end loop over reco conversions
5009  } // end loop on all reco photons
5010  } // if !fastSim
5011 
5013  float nPho = 0;
5014  for (reco::GenJetCollection::const_iterator genJetIter = genJetCollection.begin();
5015  genJetIter != genJetCollection.end();
5016  ++genJetIter) {
5017  if (genJetIter->pt() < minPhoEtCut_)
5018  continue;
5019  if (fabs(genJetIter->eta()) > 2.5)
5020  continue;
5021 
5022  float mcJetPhi = genJetIter->phi();
5023  mcJetPhi_ = phiNormalization(mcJetPhi);
5024  mcJetEta_ = genJetIter->eta();
5025  float mcJetPt = genJetIter->pt();
5026 
5027  h_SimJet_[0]->Fill(mcJetEta_);
5028  h_SimJet_[1]->Fill(mcJetPhi_);
5029  h_SimJet_[2]->Fill(mcJetPt);
5030 
5031  std::vector<reco::Photon> thePhotons;
5032  bool matched = false;
5033 
5034  reco::Photon matchingPho;
5035  for (reco::PhotonCollection::const_iterator iPho = photonCollection.begin(); iPho != photonCollection.end();
5036  iPho++) {
5037  reco::Photon aPho = reco::Photon(*iPho);
5038  float phiPho = aPho.phi();
5039  float etaPho = aPho.eta();
5040  float deltaPhi = phiPho - mcJetPhi_;
5041  float deltaEta = etaPho - mcJetEta_;
5042  if (deltaPhi > pi)
5043  deltaPhi -= twopi;
5044  if (deltaPhi < -pi)
5045  deltaPhi += twopi;
5046  deltaPhi = pow(deltaPhi, 2);
5047  deltaEta = pow(deltaEta, 2);
5048  float delta = sqrt(deltaPhi + deltaEta);
5049  if (delta < 0.3) {
5050  matchingPho = *iPho;
5051  matched = true;
5052  }
5053  } // end loop over reco photons
5054 
5055  if (!matched)
5056  continue;
5057  nPho++;
5058 
5059  h_MatchedSimJet_[0]->Fill(mcJetEta_);
5060  h_MatchedSimJet_[1]->Fill(mcJetPhi_);
5061  h_MatchedSimJet_[2]->Fill(mcJetPt);
5062 
5063  bool phoIsInBarrel = false;
5064  bool phoIsInEndcap = false;
5065  if (fabs(matchingPho.superCluster()->position().eta()) < 1.479) {
5066  phoIsInBarrel = true;
5067  } else {
5068  phoIsInEndcap = true;
5069  }
5070  edm::Handle<EcalRecHitCollection> ecalRecHitHandle;
5071  if (phoIsInBarrel) {
5072  // Get handle to rec hits ecal barrel
5073  e.getByToken(barrelEcalHits_, ecalRecHitHandle);
5074  if (!ecalRecHitHandle.isValid()) {
5075  Labels l;
5076  labelsForToken(barrelEcalHits_, l);
5077  edm::LogError("PhotonProducer") << "Error! Can't get the product " << l.module;
5078  return;
5079  }
5080 
5081  } else if (phoIsInEndcap) {
5082  // Get handle to rec hits ecal encap
5083  e.getByToken(endcapEcalHits_, ecalRecHitHandle);
5084  if (!ecalRecHitHandle.isValid()) {
5085  Labels l;
5086  labelsForToken(barrelEcalHits_, l);
5087  edm::LogError("PhotonProducer") << "Error! Can't get the product " << l.module;
5088  return;
5089  }
5090  }
5091 
5092  const EcalRecHitCollection ecalRecHitCollection = *(ecalRecHitHandle.product());
5093  float photonE = matchingPho.energy();
5094  float photonEt = matchingPho.et();
5095  float r9 = matchingPho.r9();
5096  float r1 = matchingPho.r1x5();
5097  float r2 = matchingPho.r2x5();
5098  float sigmaIetaIeta = matchingPho.sigmaIetaIeta();
5099  float hOverE = matchingPho.hadronicOverEm();
5100  float ecalIso = matchingPho.ecalRecHitSumEtConeDR04();
5101  float hcalIso = matchingPho.hcalTowerSumEtConeDR04();
5102  float trkIso = matchingPho.trkSumPtSolidConeDR04();
5103  float nIsoTrk = matchingPho.nTrkSolidConeDR04();
5104  std::vector<std::pair<DetId, float> >::const_iterator rhIt;
5105 
5106  bool atLeastOneDeadChannel = false;
5107  for (reco::CaloCluster_iterator bcIt = matchingPho.superCluster()->clustersBegin();
5108  bcIt != matchingPho.superCluster()->clustersEnd();
5109  ++bcIt) {
5110  for (rhIt = (*bcIt)->hitsAndFractions().begin(); rhIt != (*bcIt)->hitsAndFractions().end(); ++rhIt) {
5111  for (EcalRecHitCollection::const_iterator it = ecalRecHitCollection.begin(); it != ecalRecHitCollection.end();
5112  ++it) {
5113  if (rhIt->first == (*it).id()) {
5114  if ((*it).recoFlag() == 9) {
5115  atLeastOneDeadChannel = true;
5116  break;
5117  }
5118  }
5119  }
5120  }
5121  }
5122 
5123  if (atLeastOneDeadChannel) {
5124  h_MatchedSimJetBadCh_[0]->Fill(mcJetEta_);
5125  h_MatchedSimJetBadCh_[1]->Fill(mcJetPhi_);
5126  h_MatchedSimJetBadCh_[2]->Fill(mcJetPt);
5127  }
5128 
5129  h_scBkgEta_->Fill(matchingPho.superCluster()->eta());
5130  h_scBkgPhi_->Fill(matchingPho.superCluster()->phi());
5131  h_scBkgE_[0]->Fill(matchingPho.superCluster()->energy());
5132  h_scBkgEt_[0]->Fill(matchingPho.superCluster()->energy() / cosh(matchingPho.superCluster()->eta()));
5133  //
5134  h_phoBkgEta_->Fill(matchingPho.eta());
5135  h_phoBkgPhi_->Fill(matchingPho.phi());
5136  h_phoBkgE_[0]->Fill(photonE);
5137  h_phoBkgEt_[0]->Fill(photonEt);
5138  h_phoBkgDEta_->Fill(matchingPho.eta() - mcJetEta_);
5139  h_phoBkgDPhi_->Fill(matchingPho.phi() - mcJetPhi_);
5140 
5141  h_r9Bkg_[0]->Fill(r9);
5142  h_r1Bkg_[0]->Fill(r1);
5143  h_r2Bkg_[0]->Fill(r2);
5144  h_sigmaIetaIetaBkg_[0]->Fill(sigmaIetaIeta);
5145  h_hOverEBkg_[0]->Fill(hOverE);
5146  h_ecalRecHitSumEtConeDR04Bkg_[0]->Fill(ecalIso);
5147  h_hcalTowerSumEtConeDR04Bkg_[0]->Fill(hcalIso);
5148  h_isoTrkSolidConeDR04Bkg_[0]->Fill(trkIso);
5149  h_nTrkSolidConeDR04Bkg_[0]->Fill(nIsoTrk);
5150 
5151  if (!isRunCentrally_) {
5152  h2_r9VsEtaBkg_->Fill(mcJetEta_, r9);
5153  h2_r9VsEtBkg_->Fill(mcJetPt, r9);
5154  h2_r1VsEtaBkg_->Fill(mcJetEta_, r1);
5155  h2_r1VsEtBkg_->Fill(mcJetPt, r1);
5156  h2_r2VsEtaBkg_->Fill(mcJetEta_, r2);
5157  h2_r2VsEtBkg_->Fill(mcJetPt, r2);
5158  h2_sigmaIetaIetaVsEtaBkg_->Fill(mcJetEta_, sigmaIetaIeta);
5159  h2_sigmaIetaIetaVsEtBkg_[0]->Fill(mcJetPt, sigmaIetaIeta);
5160  h2_hOverEVsEtaBkg_->Fill(mcJetEta_, hOverE);
5161  h2_hOverEVsEtBkg_->Fill(mcJetPt, hOverE);
5162 
5163  p_r1VsEtaBkg_->Fill(mcJetEta_, r1);
5164  p_r1VsEtBkg_->Fill(mcJetPt, r1);
5165  p_r2VsEtaBkg_->Fill(mcJetEta_, r2);
5166  p_r2VsEtBkg_->Fill(mcJetPt, r2);
5167  p_sigmaIetaIetaVsEtaBkg_->Fill(mcJetEta_, sigmaIetaIeta);
5168  p_sigmaIetaIetaVsEtBkg_[0]->Fill(mcJetPt, sigmaIetaIeta);
5169  p_hOverEVsEtaBkg_->Fill(mcJetEta_, hOverE);
5170  p_hOverEVsEtBkg_->Fill(mcJetPt, hOverE);
5171  }
5172 
5173  if (!isRunCentrally_) {
5174  h2_ecalRecHitSumEtConeDR04VsEtaBkg_->Fill(mcJetEta_, ecalIso);
5175  h2_ecalRecHitSumEtConeDR04VsEtBkg_[0]->Fill(mcJetPt, ecalIso);
5176  h2_hcalTowerSumEtConeDR04VsEtaBkg_->Fill(mcJetEta_, hcalIso);
5177  h2_hcalTowerSumEtConeDR04VsEtBkg_[0]->Fill(mcJetPt, hcalIso);
5178  p_ecalRecHitSumEtConeDR04VsEtaBkg_->Fill(mcJetEta_, ecalIso);
5179  p_ecalRecHitSumEtConeDR04VsEtBkg_[0]->Fill(mcJetPt, ecalIso);
5180  p_hcalTowerSumEtConeDR04VsEtaBkg_->Fill(mcJetEta_, hcalIso);
5181  p_hcalTowerSumEtConeDR04VsEtBkg_[0]->Fill(mcJetPt, hcalIso);
5182  p_isoTrkSolidConeDR04VsEtaBkg_->Fill(mcJetEta_, trkIso);
5183  p_isoTrkSolidConeDR04VsEtBkg_[0]->Fill(mcJetPt, trkIso);
5184  p_nTrkSolidConeDR04VsEtaBkg_->Fill(mcJetEta_, nIsoTrk);
5185  p_nTrkSolidConeDR04VsEtBkg_[0]->Fill(mcJetPt, nIsoTrk);
5186  h2_isoTrkSolidConeDR04VsEtaBkg_->Fill(mcJetEta_, trkIso);
5187  h2_isoTrkSolidConeDR04VsEtBkg_[0]->Fill(mcJetPt, trkIso);
5188  h2_nTrkSolidConeDR04VsEtaBkg_->Fill(mcJetEta_, nIsoTrk);
5189  h2_nTrkSolidConeDR04VsEtBkg_[0]->Fill(mcJetPt, nIsoTrk);
5190  }
5191 
5192  if (phoIsInBarrel) {
5193  h_r9Bkg_[1]->Fill(r9);
5194  h_r1Bkg_[1]->Fill(r1);
5195  h_r2Bkg_[1]->Fill(r2);
5196 
5197  h_sigmaIetaIetaBkg_[1]->Fill(sigmaIetaIeta);
5198  h_hOverEBkg_[1]->Fill(hOverE);
5199  h_ecalRecHitSumEtConeDR04Bkg_[1]->Fill(ecalIso);
5200  h_hcalTowerSumEtConeDR04Bkg_[1]->Fill(hcalIso);
5201  h_isoTrkSolidConeDR04Bkg_[1]->Fill(trkIso);
5202  h_nTrkSolidConeDR04Bkg_[1]->Fill(nIsoTrk);
5203 
5204  if (!isRunCentrally_) {
5205  h2_sigmaIetaIetaVsEtBkg_[1]->Fill(mcJetPt, sigmaIetaIeta);
5206  h2_isoTrkSolidConeDR04VsEtBkg_[1]->Fill(mcJetPt, trkIso);
5207  h2_nTrkSolidConeDR04VsEtBkg_[1]->Fill(mcJetPt, nIsoTrk);
5208  h2_ecalRecHitSumEtConeDR04VsEtBkg_[1]->Fill(mcJetPt, ecalIso);
5209  h2_hcalTowerSumEtConeDR04VsEtBkg_[1]->Fill(mcJetPt, hcalIso);
5210  p_sigmaIetaIetaVsEtBkg_[1]->Fill(mcJetPt, sigmaIetaIeta);
5211  p_ecalRecHitSumEtConeDR04VsEtBkg_[1]->Fill(mcJetPt, ecalIso);
5212  p_hcalTowerSumEtConeDR04VsEtBkg_[1]->Fill(mcJetPt, hcalIso);
5213  p_isoTrkSolidConeDR04VsEtBkg_[1]->Fill(mcJetPt, trkIso);
5214  p_nTrkSolidConeDR04VsEtBkg_[1]->Fill(mcJetPt, nIsoTrk);
5215  }
5216  } else if (phoIsInEndcap) {
5217  h_r9Bkg_[2]->Fill(r9);
5218  h_r1Bkg_[2]->Fill(r1);
5219  h_r2Bkg_[2]->Fill(r2);
5220 
5221  h_sigmaIetaIetaBkg_[2]->Fill(sigmaIetaIeta);
5222  h_hOverEBkg_[2]->Fill(hOverE);
5223  h_ecalRecHitSumEtConeDR04Bkg_[2]->Fill(ecalIso);
5224  h_hcalTowerSumEtConeDR04Bkg_[2]->Fill(hcalIso);
5225  h_isoTrkSolidConeDR04Bkg_[2]->Fill(trkIso);
5226  h_nTrkSolidConeDR04Bkg_[2]->Fill(nIsoTrk);
5227 
5228  if (!isRunCentrally_) {
5229  h2_sigmaIetaIetaVsEtBkg_[2]->Fill(mcJetPt, sigmaIetaIeta);
5230  h2_isoTrkSolidConeDR04VsEtBkg_[2]->Fill(mcJetPt, trkIso);
5231  h2_nTrkSolidConeDR04VsEtBkg_[2]->Fill(mcJetPt, nIsoTrk);
5232  h2_ecalRecHitSumEtConeDR04VsEtBkg_[2]->Fill(mcJetPt, ecalIso);
5233  h2_hcalTowerSumEtConeDR04VsEtBkg_[2]->Fill(mcJetPt, hcalIso);
5234  p_sigmaIetaIetaVsEtBkg_[2]->Fill(mcJetPt, sigmaIetaIeta);
5235  p_ecalRecHitSumEtConeDR04VsEtBkg_[2]->Fill(mcJetPt, ecalIso);
5236  p_hcalTowerSumEtConeDR04VsEtBkg_[2]->Fill(mcJetPt, hcalIso);
5237  p_isoTrkSolidConeDR04VsEtBkg_[2]->Fill(mcJetPt, trkIso);
5238  p_nTrkSolidConeDR04VsEtBkg_[2]->Fill(mcJetPt, nIsoTrk);
5239  }
5240  }
5241 
5242  if (!fastSim_) {
5245  for (unsigned int iConv = 0; iConv < conversions.size(); iConv++) {
5246  reco::ConversionRef aConv = conversions[iConv];
5247  //std::vector<reco::TrackRef> tracks = aConv->tracks();
5248  const std::vector<edm::RefToBase<reco::Track> > tracks = aConv->tracks();
5249  double like = aConv->MVAout();
5250  if (like < likelihoodCut_)
5251  continue;
5252  if (tracks.size() < 2)
5253  continue;
5254  if (!aConv->caloCluster().empty()) {
5255  h_convEtaBkg_->Fill(aConv->caloCluster()[0]->eta());
5256  h_convPhiBkg_->Fill(aConv->caloCluster()[0]->phi());
5257  }
5258  h_mvaOutBkg_[0]->Fill(like);
5259  float eoverp = aConv->EoverP();
5260  h_EoverPTracksBkg_[0]->Fill(eoverp);
5261  h_PoverETracksBkg_[0]->Fill(1. / eoverp);
5262  h_DCotTracksBkg_[0]->Fill(aConv->pairCotThetaSeparation());
5263  float dPhiTracksAtVtx = aConv->dPhiTracksAtVtx();
5264  h_DPhiTracksAtVtxBkg_[0]->Fill(dPhiTracksAtVtx);
5265 
5266  if (phoIsInBarrel) {
5267  h_mvaOutBkg_[1]->Fill(like);
5268  h_EoverPTracksBkg_[1]->Fill(eoverp);
5269  h_PoverETracksBkg_[1]->Fill(1. / eoverp);
5270  h_DCotTracksBkg_[1]->Fill(aConv->pairCotThetaSeparation());
5271  h_DPhiTracksAtVtxBkg_[1]->Fill(dPhiTracksAtVtx);
5272  } else if (phoIsInEndcap) {
5273  h_mvaOutBkg_[2]->Fill(like);
5274  h_EoverPTracksBkg_[2]->Fill(eoverp);
5275  h_PoverETracksBkg_[2]->Fill(1. / eoverp);
5276  h_DCotTracksBkg_[2]->Fill(aConv->pairCotThetaSeparation());
5277  h_DPhiTracksAtVtxBkg_[2]->Fill(dPhiTracksAtVtx);
5278  }
5279 
5280  if (aConv->conversionVertex().isValid()) {
5281  double convR = sqrt(aConv->conversionVertex().position().perp2());
5282  double scalar = aConv->conversionVertex().position().x() * aConv->pairMomentum().x() +
5283  aConv->conversionVertex().position().y() * aConv->pairMomentum().y();
5284  if (scalar < 0)
5285  convR = -sqrt(aConv->conversionVertex().position().perp2());
5286 
5287  if (!isRunCentrally_) {
5288  h_convVtxRvsZBkg_[0]->Fill(fabs(aConv->conversionVertex().position().z()),
5289  sqrt(aConv->conversionVertex().position().perp2()));
5290  if (!aConv->caloCluster().empty() && fabs(aConv->caloCluster()[0]->eta()) <= 1.) {
5291  h_convVtxYvsXBkg_->Fill(aConv->conversionVertex().position().y(),
5292  aConv->conversionVertex().position().x());
5293  h_convVtxRvsZBkg_[1]->Fill(fabs(aConv->conversionVertex().position().z()), convR);
5294  }
5295  }
5296 
5297  } // end vertex valid
5298 
5299  } // end loop over conversions
5300  } // if !fastSim
5301  } // end loop over sim jets
5302 
5304  for (reco::GenParticleCollection::const_iterator mcIter = genParticles->begin(); mcIter != genParticles->end();
5305  mcIter++) {
5306  if (!(mcIter->pdgId() == 22))
5307  continue;
5308  if (mcIter->mother() != nullptr and !(mcIter->mother()->pdgId() == 25))
5309  continue;
5310  if (fabs(mcIter->eta()) > 2.5)
5311  continue;
5312 
5313  float mcPhi = mcIter->phi();
5314  float mcEta = mcIter->eta();
5315  //mcEta = etaTransformation(mcEta, (*mcPho).primaryVertex().z() );
5316  float mcEnergy = mcIter->energy();
5317 
5318  double dR = 9999999.;
5319  float minDr = 10000.;
5320  int iMatch = -1;
5321  bool matched = false;
5322 
5323  for (unsigned int ipho = 0; ipho < photonHandle->size(); ipho++) {
5324  reco::PhotonRef pho(reco::PhotonRef(photonHandle, ipho));
5325 
5326  double dphi = pho->phi() - mcPhi;
5327  if (std::fabs(dphi) > CLHEP::pi) {
5328  dphi = dphi < 0 ? (CLHEP::twopi) + dphi : dphi - CLHEP::twopi;
5329  }
5330  double deta = pho->superCluster()->position().eta() - mcEta;
5331 
5332  dR = sqrt(pow((deta), 2) + pow(dphi, 2));
5333  if (dR < 0.1 && dR < minDr) {
5334  minDr = dR;
5335  iMatch = ipho;
5336  }
5337  }
5338 
5339  if (iMatch > -1)
5340  matched = true;
5341  if (!matched)
5342  continue;
5343 
5344  reco::PhotonRef matchingPho(reco::PhotonRef(photonHandle, iMatch));
5345 
5346  bool phoIsInBarrel = false;
5347  bool phoIsInEndcap = false;
5348 
5349  float phoEta = matchingPho->superCluster()->position().eta();
5350  if (fabs(phoEta) < 1.479) {
5351  phoIsInBarrel = true;
5352  } else {
5353  phoIsInEndcap = true;
5354  }
5355 
5356  float photonE = matchingPho->energy();
5357  float sigmaEoE = matchingPho->getCorrectedEnergyError(matchingPho->getCandidateP4type()) / matchingPho->energy();
5358  float photonEt = matchingPho->energy() / cosh(matchingPho->eta());
5359  // float photonERegr1 = matchingPho->getCorrectedEnergy(reco::Photon::regression1);
5360  //float photonERegr2 = matchingPho->getCorrectedEnergy(reco::Photon::regression2);
5361  float r9 = matchingPho->r9();
5362  float full5x5_r9 = matchingPho->full5x5_r9();
5363  float r1 = matchingPho->r1x5();
5364  float r2 = matchingPho->r2x5();
5365  float sigmaIetaIeta = matchingPho->sigmaIetaIeta();
5366  float full5x5_sieie = matchingPho->full5x5_sigmaIetaIeta();
5367  float hOverE = matchingPho->hadronicOverEm();
5368  float newhOverE = matchingPho->hadTowOverEm();
5369  float ecalIso = matchingPho->ecalRecHitSumEtConeDR04();
5370  float hcalIso = matchingPho->hcalTowerSumEtConeDR04();
5371  float newhcalIso = matchingPho->hcalTowerSumEtBcConeDR04();
5372  float trkIso = matchingPho->trkSumPtSolidConeDR04();
5373  float nIsoTrk = matchingPho->nTrkSolidConeDR04();
5374  // PF related quantities
5375  float chargedHadIso = matchingPho->chargedHadronIso();
5376  float neutralHadIso = matchingPho->neutralHadronIso();
5377  float photonIso = matchingPho->photonIso();
5378  // float etOutsideMustache = matchingPho->etOutsideMustache();
5379  // int nClusterOutsideMustache = matchingPho->nClusterOutsideMustache();
5380  //float pfMVA = matchingPho->pfMVA();
5381 
5382  if ((photonEt > 14 && newhOverE < 0.15) || (photonEt > 10 && photonEt < 14 && chargedHadIso < 10)) {
5383  h_scEta_miniAOD_[0]->Fill(matchingPho->superCluster()->eta());
5384  h_scPhi_miniAOD_[0]->Fill(matchingPho->superCluster()->phi());
5385 
5386  h_phoE_miniAOD_[0][0]->Fill(photonE);
5387  h_phoEt_miniAOD_[0][0]->Fill(photonEt);
5388 
5389  h_phoERes_miniAOD_[0][0]->Fill(photonE / mcEnergy);
5390  h_phoSigmaEoE_miniAOD_[0][0]->Fill(sigmaEoE);
5391 
5392  h_r9_miniAOD_[0][0]->Fill(r9);
5393  h_full5x5_r9_miniAOD_[0][0]->Fill(full5x5_r9);
5394  h_r1_miniAOD_[0][0]->Fill(r1);
5395  h_r2_miniAOD_[0][0]->Fill(r2);
5396 
5397  h_sigmaIetaIeta_miniAOD_[0][0]->Fill(sigmaIetaIeta);
5398  h_full5x5_sigmaIetaIeta_miniAOD_[0][0]->Fill(full5x5_sieie);
5399  h_hOverE_miniAOD_[0][0]->Fill(hOverE);
5400  h_newhOverE_miniAOD_[0][0]->Fill(newhOverE);
5401 
5402  h_ecalRecHitSumEtConeDR04_miniAOD_[0][0]->Fill(ecalIso);
5403  h_hcalTowerSumEtConeDR04_miniAOD_[0][0]->Fill(hcalIso);
5404  h_hcalTowerBcSumEtConeDR04_miniAOD_[0][0]->Fill(newhcalIso);
5405  h_isoTrkSolidConeDR04_miniAOD_[0][0]->Fill(trkIso);
5406  h_nTrkSolidConeDR04_miniAOD_[0][0]->Fill(nIsoTrk);
5407 
5408  //
5409  h_chHadIso_miniAOD_[0]->Fill(chargedHadIso);
5410  h_nHadIso_miniAOD_[0]->Fill(neutralHadIso);
5411  h_phoIso_miniAOD_[0]->Fill(photonIso);
5412 
5413  //
5414  if (phoIsInBarrel) {
5415  h_phoE_miniAOD_[0][1]->Fill(photonE);
5416  h_phoEt_miniAOD_[0][1]->Fill(photonEt);
5417 
5418  h_phoERes_miniAOD_[0][1]->Fill(photonE / mcEnergy);
5419  h_phoSigmaEoE_miniAOD_[0][1]->Fill(sigmaEoE);
5420 
5421  h_r9_miniAOD_[0][1]->Fill(r9);
5422  h_full5x5_r9_miniAOD_[0][1]->Fill(full5x5_r9);
5423  h_r1_miniAOD_[0][1]->Fill(r1);
5424  h_r2_miniAOD_[0][1]->Fill(r2);
5425  h_sigmaIetaIeta_miniAOD_[0][1]->Fill(sigmaIetaIeta);
5426  h_full5x5_sigmaIetaIeta_miniAOD_[0][1]->Fill(full5x5_sieie);
5427  h_hOverE_miniAOD_[0][1]->Fill(hOverE);
5428  h_newhOverE_miniAOD_[0][1]->Fill(newhOverE);
5429  h_ecalRecHitSumEtConeDR04_miniAOD_[0][1]->Fill(ecalIso);
5430  h_hcalTowerSumEtConeDR04_miniAOD_[0][1]->Fill(hcalIso);
5431  h_hcalTowerBcSumEtConeDR04_miniAOD_[0][1]->Fill(newhcalIso);
5432  h_isoTrkSolidConeDR04_miniAOD_[0][1]->Fill(trkIso);
5433  h_nTrkSolidConeDR04_miniAOD_[0][1]->Fill(nIsoTrk);
5434  h_chHadIso_miniAOD_[1]->Fill(chargedHadIso);
5435  h_nHadIso_miniAOD_[1]->Fill(neutralHadIso);
5436  h_phoIso_miniAOD_[1]->Fill(photonIso);
5437  }
5438  if (phoIsInEndcap) {
5439  h_phoE_miniAOD_[0][2]->Fill(photonE);
5440  h_phoEt_miniAOD_[0][2]->Fill(photonEt);
5441 
5442  h_phoERes_miniAOD_[0][2]->Fill(photonE / mcEnergy);
5443  h_phoSigmaEoE_miniAOD_[0][2]->Fill(sigmaEoE);
5444  h_r9_miniAOD_[0][2]->Fill(r9);
5445  h_full5x5_r9_miniAOD_[0][2]->Fill(full5x5_r9);
5446  h_r1_miniAOD_[0][2]->Fill(r1);
5447  h_r2_miniAOD_[0][2]->Fill(r2);
5448  h_sigmaIetaIeta_miniAOD_[0][2]->Fill(sigmaIetaIeta);
5449  h_full5x5_sigmaIetaIeta_miniAOD_[0][2]->Fill(full5x5_sieie);
5450  h_hOverE_miniAOD_[0][2]->Fill(hOverE);
5451  h_newhOverE_miniAOD_[0][2]->Fill(newhOverE);
5452  h_ecalRecHitSumEtConeDR04_miniAOD_[0][2]->Fill(ecalIso);
5453  h_hcalTowerSumEtConeDR04_miniAOD_[0][2]->Fill(hcalIso);
5454  h_hcalTowerBcSumEtConeDR04_miniAOD_[0][2]->Fill(newhcalIso);
5455  h_isoTrkSolidConeDR04_miniAOD_[0][2]->Fill(trkIso);
5456  h_nTrkSolidConeDR04_miniAOD_[0][2]->Fill(nIsoTrk);
5457  h_chHadIso_miniAOD_[2]->Fill(chargedHadIso);
5458  h_nHadIso_miniAOD_[2]->Fill(neutralHadIso);
5459  h_phoIso_miniAOD_[2]->Fill(photonIso);
5460  }
5461  } // end histos for comparing with miniAOD
5462 
5463  } // end loop over gen photons
5464 
5465  h_nPho_->Fill(float(nPho));
5466 }
5467 
5469  //---Definitions
5470  const float PI = 3.1415927;
5471  const float TWOPI = 2.0 * PI;
5472 
5473  if (phi > PI) {
5474  phi = phi - TWOPI;
5475  }
5476  if (phi < -PI) {
5477  phi = phi + TWOPI;
5478  }
5479 
5480  return phi;
5481 }
5482 
5483 float PhotonValidator::etaTransformation(float EtaParticle, float Zvertex) {
5484  //---Definitions
5485  const float PI = 3.1415927;
5486 
5487  //---Definitions for ECAL
5488  const float R_ECAL = 136.5;
5489  const float Z_Endcap = 328.0;
5490  const float etaBarrelEndcap = 1.479;
5491 
5492  //---ETA correction
5493 
5494  float Theta = 0.0;
5495  float ZEcal = R_ECAL * sinh(EtaParticle) + Zvertex;
5496 
5497  if (ZEcal != 0.0)
5498  Theta = atan(R_ECAL / ZEcal);
5499  if (Theta < 0.0)
5500  Theta = Theta + PI;
5501  float ETA = -log(tan(0.5 * Theta));
5502 
5503  if (fabs(ETA) > etaBarrelEndcap) {
5504  float Zend = Z_Endcap;
5505  if (EtaParticle < 0.0)
5506  Zend = -Zend;
5507  float Zlen = Zend - Zvertex;
5508  float RR = Zlen / sinh(EtaParticle);
5509  Theta = atan(RR / Zend);
5510  if (Theta < 0.0)
5511  Theta = Theta + PI;
5512  ETA = -log(tan(0.5 * Theta));
5513  }
5514  //---Return the result
5515  return ETA;
5516  //---end
5517 }
muonTagProbeFilters_cff.matched
matched
Definition: muonTagProbeFilters_cff.py:62
photonValidator_cfi.dEtaBin
dEtaBin
Definition: photonValidator_cfi.py:74
PI
Definition: PayloadInspector.h:21
TrackExtra.h
electrons_cff.r9
r9
Definition: electrons_cff.py:360
photonValidator_cfi.dEtaMax
dEtaMax
Definition: photonValidator_cfi.py:76
photonAnalyzer_cfi.rMax
rMax
Definition: photonAnalyzer_cfi.py:91
photonAnalyzer_cfi.etMin
etMin
Definition: photonAnalyzer_cfi.py:54
photonValidator_cfi.ggMassMin
ggMassMin
Definition: photonValidator_cfi.py:114
Handle.h
PhotonValidator::phiNormalization
float phiNormalization(float &a)
Definition: PhotonValidator.cc:5468
ALCARECOTkAlBeamHalo_cff.etaMin
etaMin
GeV.
Definition: ALCARECOTkAlBeamHalo_cff.py:32
mps_fire.i
i
Definition: mps_fire.py:428
FreeTrajectoryState.h
edm::SortedCollection< EcalRecHit >::const_iterator
std::vector< EcalRecHit >::const_iterator const_iterator
Definition: SortedCollection.h:80
photonValidator_cfi.ggMassMax
ggMassMax
Definition: photonValidator_cfi.py:115
reco::Photon::superCluster
reco::SuperClusterRef superCluster() const override
Ref to SuperCluster.
photonAnalyzer_cfi.zMax
zMax
Definition: photonAnalyzer_cfi.py:95
MessageLogger.h
genParticles2HepMC_cfi.genParticles
genParticles
Definition: genParticles2HepMC_cfi.py:4
TrackerGeometry.h
edm::Handle::product
T const * product() const
Definition: Handle.h:70
TrackCandidateCollection.h
photonAnalyzer_cfi.dPhiTracksMin
dPhiTracksMin
Definition: photonAnalyzer_cfi.py:102
etaBin
int etaBin(const l1t::HGCalMulticluster *cl)
Definition: L1EGammaEEProducer.cc:19
reco::PFCandidate::e
Definition: PFCandidate.h:47
reco::Photon::sigmaIetaIeta
float sigmaIetaIeta() const
Definition: Photon.h:237
photonAnalyzer_cfi.zBin
zBin
Definition: photonAnalyzer_cfi.py:93
PFCandidate.h
reco::GenJetCollection
std::vector< GenJet > GenJetCollection
collection of GenJet objects
Definition: GenJetCollection.h:14
photonAnalyzer_cfi.dPhiTracksBin
dPhiTracksBin
Definition: photonAnalyzer_cfi.py:101
PI
#define PI
Definition: QcdUeDQM.h:37
edm::Run
Definition: Run.h:45
BeamMonitor_cff.phiBin
phiBin
Definition: BeamMonitor_cff.py:76
photonValidationSequence_cff.eoverpMax
eoverpMax
Definition: photonValidationSequence_cff.py:17
BasicCluster.h
PhotonValidator::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: PhotonValidator.cc:3173
ChiSquaredProbability
float ChiSquaredProbability(double chiSquared, double nrDOF)
Definition: ChiSquaredProbability.cc:13
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
multPhiCorr_741_25nsDY_cfi.py
py
Definition: multPhiCorr_741_25nsDY_cfi.py:12
edm
HLT enums.
Definition: AlignableModifier.h:19
photonValidationSequence_cff.eoverpMin
eoverpMin
Definition: photonValidationSequence_cff.py:16
TrackCollections2monitor_cff.numberOfValidHits
numberOfValidHits
Definition: TrackCollections2monitor_cff.py:248
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89285
reco::TrackToTrackingParticleAssociator
Definition: TrackToTrackingParticleAssociator.h:51
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::PFCandidate::h
Definition: PFCandidate.h:46
edm::PtrVectorItr
Definition: PtrVector.h:51
HIPAlignmentAlgorithm_cfi.algoName
algoName
Definition: HIPAlignmentAlgorithm_cfi.py:5
edm::SortedCollection< EcalRecHit >
ChiSquaredProbability.h
TrackerHitAssociator.h
photonValidator_cfi.dCotTracksMax
dCotTracksMax
Definition: photonValidator_cfi.py:100
edm::RefVector< ConversionCollection >
particleFlowDQM_cff.genJetCollection
genJetCollection
Definition: particleFlowDQM_cff.py:68
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
photonValidator_cfi.zMinForXray
zMinForXray
Definition: photonValidator_cfi.py:122
hltPixelTracks_cff.chi2
chi2
Definition: hltPixelTracks_cff.py:25
ConversionFwd.h
HLT_FULL_cff.dPhi
dPhi
Definition: HLT_FULL_cff.py:13703
BeamSpotPI::nTracks
Definition: BeamSpotPayloadInspectorHelper.h:42
edm::Handle< reco::TrackToTrackingParticleAssociator >
photonValidator_cfi.rMinForXray
rMinForXray
Definition: photonValidator_cfi.py:118
BasicClusterFwd.h
TwoTrackMinimumDistance.h
HepMC::GenEvent
Definition: hepmc_rootio.cc:9
edm::Ref< PhotonCollection >
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
GenParticle.h
photonAnalyzer_cfi.dPhiTracksMax
dPhiTracksMax
Definition: photonAnalyzer_cfi.py:103
ndof
Definition: HIMultiTrackSelector.h:49
gedPhotonSequence_cff.photonIso
photonIso
Definition: gedPhotonSequence_cff.py:32
IdealMagneticFieldRecord
Definition: IdealMagneticFieldRecord.h:11
conversionPostprocessing_cfi.etaBin2
etaBin2
Definition: conversionPostprocessing_cfi.py:19
cmsdt::algo
algo
Definition: constants.h:165
optionsL1T.skip
skip
Definition: optionsL1T.py:30
MakerMacros.h
PhotonValidator::dqmEndRun
void dqmEndRun(edm::Run const &r, edm::EventSetup const &es) override
Definition: PhotonValidator.cc:3169
TrackingRecHit.h
photonValidator_cfi.povereMax
povereMax
Definition: photonValidator_cfi.py:104
Track.h
edm::EventSetup::get
T get() const
Definition: EventSetup.h:87
TrackFwd.h
photonValidator_cfi.resMin
resMin
Definition: photonValidator_cfi.py:91
TrackingVertexContainer.h
PhotonValidator.h
spr::deltaEta
static const double deltaEta
Definition: CaloConstants.h:8
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
SiPixelRawToDigiRegional_cfi.deltaPhi
deltaPhi
Definition: SiPixelRawToDigiRegional_cfi.py:9
nHits
const caConstants::TupleMultiplicity *__restrict__ const HitsOnGPU *__restrict__ double *__restrict__ float *__restrict__ double *__restrict__ uint32_t nHits
Definition: BrokenLineFitOnGPU.h:27
PhotonMCTruth.h
edm::SortedCollection::begin
const_iterator begin() const
Definition: SortedCollection.h:262
Service.h
PhotonValidator::bookHistograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: PhotonValidator.cc:161
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
photonAnalyzer_cfi.eMin
eMin
Definition: photonAnalyzer_cfi.py:50
AlignmentTrackSelector_cfi.phiMin
phiMin
Definition: AlignmentTrackSelector_cfi.py:18
photonValidator_cfi.rMaxForXray
rMaxForXray
Definition: photonValidator_cfi.py:119
reco::Photon::nTrkSolidConeDR04
int nTrkSolidConeDR04() const
Definition: Photon.h:428
TransientTrackRecord
Definition: TransientTrackRecord.h:11
reco::Track
Definition: Track.h:27
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
hitfit::scalar
double scalar(const CLHEP::HepGenMatrix &m)
Return the matrix as a scalar. Raise an assertion if the matris is not .
Definition: matutil.cc:166
PhotonValidator::dqmBeginRun
void dqmBeginRun(edm::Run const &r, edm::EventSetup const &theEventSetup) override
Definition: PhotonValidator.cc:3160
photonAnalyzer_cfi.r9Min
r9Min
Definition: photonAnalyzer_cfi.py:70
edm::RefToBase::get
value_type const * get() const
Definition: RefToBase.h:209
cmsswSequenceInfo.tp
tp
Definition: cmsswSequenceInfo.py:17
PbPb_ZMuSkimMuonDPG_cff.deltaR
deltaR
Definition: PbPb_ZMuSkimMuonDPG_cff.py:63
edm::OwnVector::const_iterator
Definition: OwnVector.h:41
CaloGeometryRecord.h
photonValidator_cfi.eoverpBin
eoverpBin
Definition: photonValidator_cfi.py:106
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
Vertex.h
edm::ValueMap::end
const_iterator end() const
Definition: ValueMap.h:230
TFileService.h
photonAnalyzer_cfi.r9Bin
r9Bin
Definition: photonAnalyzer_cfi.py:69
PhotonMCTruthFinder.h
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
TrackerDigiGeometryRecord.h
TrackToTrackingParticleAssociator.h
TransientTrackBuilder.h
EgHLTOffHistBins_cfi.hOverE
hOverE
Definition: EgHLTOffHistBins_cfi.py:17
edm::ParameterSet
Definition: ParameterSet.h:47
PhotonValidator::etaTransformation
float etaTransformation(float a, float b)
Definition: PhotonValidator.cc:5483
reco::Photon::r9
float r9() const
Definition: Photon.h:240
reco::LeafCandidate::eta
double eta() const final
momentum pseudorapidity
Definition: LeafCandidate.h:152
tracks
const uint32_t *__restrict__ const HitContainer *__restrict__ TkSoA *__restrict__ tracks
Definition: CAHitNtupletGeneratorKernelsImpl.h:159
deltaR.h
TWOPI
#define TWOPI
Definition: DQMSourcePi0.cc:36
cosmicPhotonAnalyzer_cfi.eMax
eMax
Definition: cosmicPhotonAnalyzer_cfi.py:10
edm::AssociationMap< edm::OneToManyWithQualityGeneric< TrackingParticleCollection, edm::View< reco::Track >, double > >
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
edm::SortedCollection::end
const_iterator end() const
Definition: SortedCollection.h:267
jetUpdater_cfi.sort
sort
Definition: jetUpdater_cfi.py:29
EcalClusterTools.h
edm::Ref::isNonnull
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:238
muonClassificationByHits_cfi.trackingParticles
trackingParticles
Definition: muonClassificationByHits_cfi.py:28
gainCalibHelper::gainCalibPI::type
type
Definition: SiPixelGainCalibHelper.h:40
dumpMFGeometry_cfg.delta
delta
Definition: dumpMFGeometry_cfg.py:25
CaloTopologyRecord.h
photonAnalyzer_cfi.zMin
zMin
Definition: photonAnalyzer_cfi.py:94
diffTwoXMLs.r2
r2
Definition: diffTwoXMLs.py:73
funct::tan
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
TrackTransientTrack.h
photonValidator_cfi.dCotTracksMin
dCotTracksMin
Definition: photonValidator_cfi.py:99
photonAnalyzer_cfi.rBin
rBin
Definition: photonAnalyzer_cfi.py:89
muonRecoAnalyzer_cfi.chi2Max
chi2Max
Definition: muonRecoAnalyzer_cfi.py:35
photonValidator_cfi.dEtaMin
dEtaMin
Definition: photonValidator_cfi.py:75
reco::PFCandidate::gamma
Definition: PFCandidate.h:49
photonValidator_cfi.resBin
resBin
Definition: photonValidator_cfi.py:90
p1
double p1[4]
Definition: TauolaWrapper.h:89
EgHLTOffHistBins_cfi.et
et
Definition: EgHLTOffHistBins_cfi.py:8
EgammaValidation_cff.pdgId
pdgId
Definition: EgammaValidation_cff.py:118
submitPVResolutionJobs.q
q
Definition: submitPVResolutionJobs.py:84
edm::EventSetup
Definition: EventSetup.h:58
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
PhotonValidator::sortPhotons
Definition: PhotonValidator.h:592
GenTrackMatcher_cfi.trackAssociator
trackAssociator
Definition: GenTrackMatcher_cfi.py:14
nanoDQM_cff.Photon
Photon
Definition: nanoDQM_cff.py:63
HcalObjRepresent::Fill
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
Definition: HcalObjRepresent.h:1053
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:204
alignCSCRings.r
r
Definition: alignCSCRings.py:93
CaloTopology.h
photonAnalyzer_cfi.dEtaTracksBin
dEtaTracksBin
Definition: photonAnalyzer_cfi.py:97
reco::Photon
Definition: Photon.h:21
cosmicPhotonAnalyzer_cfi.etMax
etMax
Definition: cosmicPhotonAnalyzer_cfi.py:11
multPhiCorr_741_25nsDY_cfi.px
px
Definition: multPhiCorr_741_25nsDY_cfi.py:10
reco::LeafCandidate::et
double et() const final
transverse energy
Definition: LeafCandidate.h:127
photonValidator_cfi.ggMassBin
ggMassBin
Definition: photonValidator_cfi.py:113
TrackingParticle.h
GeomDet.h
photonAnalyzer_cfi.dEtaTracksMin
dEtaTracksMin
Definition: photonAnalyzer_cfi.py:98
photonValidator_cfi.povereMin
povereMin
Definition: photonValidator_cfi.py:103
GenParticle.GenParticle
GenParticle
Definition: GenParticle.py:18
std
Definition: JetResolutionObject.h:76
writedatasetfile.run
run
Definition: writedatasetfile.py:27
photonValidator_cfi.dCotTracksBin
dCotTracksBin
Definition: photonValidator_cfi.py:98
reco::Photon::hadronicOverEm
float hadronicOverEm() const
the total hadronic over electromagnetic fraction
Definition: Photon.h:208
reco::LeafCandidate::phi
double phi() const final
momentum azimuthal angle
Definition: LeafCandidate.h:148
reco::TrackBase::algoSize
Definition: TrackBase.h:141
DetId.h
diffTwoXMLs.r1
r1
Definition: diffTwoXMLs.py:53
HLT_FULL_cff.dEta
dEta
Definition: HLT_FULL_cff.py:13702
math::XYZTLorentzVector
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
reco::Photon::trkSumPtSolidConeDR04
float trkSumPtSolidConeDR04() const
Definition: Photon.h:424
edm::ValueMap
Definition: ValueMap.h:107
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
PhotonValidator::PhotonValidator
PhotonValidator(const edm::ParameterSet &)
Definition: PhotonValidator.cc:86
reco::PFCandidate::h0
Definition: PFCandidate.h:50
relativeConstraints.empty
bool empty
Definition: relativeConstraints.py:46
SuperCluster.h
edm::RefVectorIterator
Definition: EDProductfwd.h:33
ETA
#define ETA
Definition: GenericBenchmark.cc:28
reco::Photon::conversions
reco::ConversionRefVector conversions() const
vector of references to Conversion's
Definition: Photon.h:60
cosmicPhotonAnalyzer_cfi.r9Max
r9Max
Definition: cosmicPhotonAnalyzer_cfi.py:12
reco::Photon::regression1
Definition: Photon.h:273
ALCARECOTkAlBeamHalo_cff.etaMax
etaMax
Definition: ALCARECOTkAlBeamHalo_cff.py:33
reco::Photon::ecalRecHitSumEtConeDR04
float ecalRecHitSumEtConeDR04() const
Definition: Photon.h:410
TrackingParticleCollection
std::vector< TrackingParticle > TrackingParticleCollection
Definition: TrackingParticleFwd.h:9
HiEvtPlane_cfi.pterror
pterror
Definition: HiEvtPlane_cfi.py:24
reco::Photon::r2x5
float r2x5() const
Definition: Photon.h:239
edm::RefToBase< reco::Track >
photonValidator_cfi.resMax
resMax
Definition: photonValidator_cfi.py:92
Exception.h
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
reco::LeafCandidate::energy
double energy() const final
energy
Definition: LeafCandidate.h:125
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
edm::View::const_iterator
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:86
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
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
pi
const Double_t pi
Definition: trackSplitPlot.h:36
PhotonValidator::~PhotonValidator
~PhotonValidator() override
Definition: PhotonValidator.cc:159
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
HGC3DClusterGenMatchSelector_cfi.dR
dR
Definition: HGC3DClusterGenMatchSelector_cfi.py:7
reco::Photon::r1x5
float r1x5() const
Definition: Photon.h:238
reco::Photon::regression2
Definition: Photon.h:273
ExoticaDQM_cfi.photonCollection
photonCollection
Definition: ExoticaDQM_cfi.py:17
photonValidator_cfi.dPhiBin
dPhiBin
Definition: photonValidator_cfi.py:78
HepMCProduct.h
reco::PFCandidate::ParticleType
ParticleType
particle types
Definition: PFCandidate.h:44
reco::TrackBase::momentum
const Vector & momentum() const
track momentum vector
Definition: TrackBase.h:664
parents
TPRegexp parents
Definition: eve_filter.cc:21
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
pwdgSkimBPark_cfi.conversions
conversions
Definition: pwdgSkimBPark_cfi.py:10
photonValidator_cfi.povereBin
povereBin
Definition: photonValidator_cfi.py:102
edm::Event
Definition: Event.h:73
edm::RefVector::size
size_type size() const
Size of the RefVector.
Definition: RefVector.h:102
d0
static constexpr float d0
Definition: L1EGammaCrystalsEmulatorProducer.cc:85
CSCSegmentAlgorithmRU_cfi.dPhiMax
dPhiMax
Definition: CSCSegmentAlgorithmRU_cfi.py:9
photonValidator_cfi.dPhiMin
dPhiMin
Definition: photonValidator_cfi.py:79
edm::InputTag
Definition: InputTag.h:15
Z_Endcap
static constexpr float Z_Endcap
Definition: ECALPositionCalculator.cc:11
photonAnalyzer_cfi.dEtaTracksMax
dEtaTracksMax
Definition: photonAnalyzer_cfi.py:99
reco::Photon::hcalTowerSumEtConeDR04
float hcalTowerSumEtConeDR04() const
Hcal isolation sum.
Definition: Photon.h:412
MuonClassifier_cff.hepMC
hepMC
Definition: MuonClassifier_cff.py:13
R_ECAL
static constexpr float R_ECAL
Definition: ECALPositionCalculator.cc:10
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
edm::ProductLabels
Definition: ProductLabels.h:4
CaloCluster.h
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
photonValidator_cfi.etScale
etScale
Definition: photonValidator_cfi.py:47
etaBarrelEndcap
static constexpr float etaBarrelEndcap
Definition: ECALPositionCalculator.cc:12
photonAnalyzer_cfi.eBin
eBin
CAREFULL for the time being only Loos exists 1 => Tight Photon = GoodCandidate.
Definition: photonAnalyzer_cfi.py:49
photonValidator_cfi.zBinForXray
zBinForXray
Definition: photonValidator_cfi.py:120
Conversion.h