CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TkConvValidator.cc
Go to the documentation of this file.
1 #include <iostream>
2 //
5 //
7 
8 //
12 //
18 //
22 //
29 //
33 //
36 #include "CLHEP/Units/GlobalPhysicalConstants.h"
38 //
48 
49 //
72 
73 //
81 
83 
84 //
85 //
86 #include "TFile.h"
87 #include "TH1.h"
88 #include "TH2.h"
89 #include "TTree.h"
90 #include "TVector3.h"
91 #include "TProfile.h"
92 //
101 using namespace std;
102 
103 
105  {
106 
107  fName_ = pset.getUntrackedParameter<std::string>("Name");
108  verbosity_ = pset.getUntrackedParameter<int>("Verbosity");
109  parameters_ = pset;
110 
111  photonCollectionProducer_ = pset.getParameter<std::string>("phoProducer");
112  photonCollection_ = pset.getParameter<std::string>("photonCollection");
113  photonCollectionPr_Token_ = consumes<reco::PhotonCollection> (
114  edm::InputTag(photonCollectionProducer_,
115  photonCollection_));
116 
117  conversionCollectionProducer_ = pset.getParameter<std::string>("convProducer");
118  conversionCollection_ = pset.getParameter<std::string>("conversionCollection");
119  conversionCollectionPr_Token_ = consumes<reco::ConversionCollection> (
120  edm::InputTag(conversionCollectionProducer_,
121  conversionCollection_));
122 
123  // conversionTrackProducer_ = pset.getParameter<std::string>("trackProducer");
124  dqmpath_ = pset.getParameter<std::string>("dqmpath");
125  minPhoEtCut_ = pset.getParameter<double>("minPhoEtCut");
126  generalTracksOnly_ = pset.getParameter<bool>("generalTracksOnly");
127  arbitratedMerged_ = pset.getParameter<bool>("arbitratedMerged");
128  arbitratedEcalSeeded_ = pset.getParameter<bool>("arbitratedEcalSeeded");
129  ecalalgotracks_ = pset.getParameter<bool>("ecalalgotracks");
130  highPurity_ = pset.getParameter<bool>("highPurity");
131  minProb_ = pset.getParameter<double>("minProb");
132  maxHitsBeforeVtx_ = pset.getParameter<uint>("maxHitsBeforeVtx");
133  minLxy_ = pset.getParameter<double>("minLxy");
134  isRunCentrally_= pset.getParameter<bool>("isRunCentrally");
135 
136  offline_pvToken_ = consumes<reco::VertexCollection>(
137  pset.getUntrackedParameter<edm::InputTag> ("offlinePV",
138  edm::InputTag("offlinePrimaryVertices")));
139  beamspotToken_ = consumes<reco::BeamSpot>(
140  pset.getUntrackedParameter<edm::InputTag> ("beamspot",
141  edm::InputTag("offlineBeamSpot")));
142  g4_simTk_Token_ = consumes<edm::SimTrackContainer>(edm::InputTag("g4SimHits"));
143  g4_simVtx_Token_ = consumes<edm::SimVertexContainer>(edm::InputTag("g4SimHits"));
144 
145  tpSelForEff_Token_ = consumes<TrackingParticleCollection> (
146  edm::InputTag("tpSelecForEfficiency"));
147  tpSelForFake_Token_ = consumes<TrackingParticleCollection> (
148  edm::InputTag("tpSelecForFakeRate"));
149  hepMC_Token_ = consumes<edm::HepMCProduct>(edm::InputTag("generator"));
150  genjets_Token_ = consumes<reco::GenJetCollection>(
151  edm::InputTag("iterativeCone5GenJets"));
152  }
153 
154 
155 
156 
157 
159 
160 
161 
162 
164 
165  nEvt_=0;
166  nEntry_=0;
167  nRecConv_=0;
168  nRecConvAss_=0;
169  nRecConvAssWithEcal_=0;
170 
171  nInvalidPCA_=0;
172 
173  dbe_ = 0;
175 
176 
177  double etMin = parameters_.getParameter<double>("etMin");
178  double etMax = parameters_.getParameter<double>("etMax");
179  int etBin = parameters_.getParameter<int>("etBin");
180 
181 
182  double resMin = parameters_.getParameter<double>("resMin");
183  double resMax = parameters_.getParameter<double>("resMax");
184  int resBin = parameters_.getParameter<int>("resBin");
185 
186  double etaMin = parameters_.getParameter<double>("etaMin");
187  double etaMax = parameters_.getParameter<double>("etaMax");
188  int etaBin = parameters_.getParameter<int>("etaBin");
189  int etaBin2 = parameters_.getParameter<int>("etaBin2");
190 
191 
192  double phiMin = parameters_.getParameter<double>("phiMin");
193  double phiMax = parameters_.getParameter<double>("phiMax");
194  int phiBin = parameters_.getParameter<int>("phiBin");
195 
196 
197  double rMin = parameters_.getParameter<double>("rMin");
198  double rMax = parameters_.getParameter<double>("rMax");
199  int rBin = parameters_.getParameter<int>("rBin");
200 
201  double zMin = parameters_.getParameter<double>("zMin");
202  double zMax = parameters_.getParameter<double>("zMax");
203  int zBin = parameters_.getParameter<int>("zBin");
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 eoverpMin = parameters_.getParameter<double>("eoverpMin");
210  double eoverpMax = parameters_.getParameter<double>("eoverpMax");
211  int eoverpBin = parameters_.getParameter<int>("eoverpBin");
212 
213 
214  // double dEtaTracksMin = parameters_.getParameter<double>("dEtaTracksMin"); // unused
215  // double dEtaTracksMax = parameters_.getParameter<double>("dEtaTracksMax"); // unused
216  // int dEtaTracksBin = parameters_.getParameter<int>("dEtaTracksBin"); // unused
217 
218  double dCotTracksMin = parameters_.getParameter<double>("dCotTracksMin");
219  double dCotTracksMax = parameters_.getParameter<double>("dCotTracksMax");
220  int dCotTracksBin = parameters_.getParameter<int>("dCotTracksBin");
221 
222 
223  double chi2Min = parameters_.getParameter<double>("chi2Min");
224  double chi2Max = parameters_.getParameter<double>("chi2Max");
225 
226 
227  double rMinForXray = parameters_.getParameter<double>("rMinForXray");
228  double rMaxForXray = parameters_.getParameter<double>("rMaxForXray");
229  int rBinForXray = parameters_.getParameter<int>("rBinForXray");
230  double zMinForXray = parameters_.getParameter<double>("zMinForXray");
231  double zMaxForXray = parameters_.getParameter<double>("zMaxForXray");
232  int zBinForXray = parameters_.getParameter<int>("zBinForXray");
233  int zBin2ForXray = parameters_.getParameter<int>("zBin2ForXray");
234 
235  minPhoPtForEffic = parameters_.getParameter<double>("minPhoPtForEffic");
236  maxPhoEtaForEffic = parameters_.getParameter<double>("maxPhoEtaForEffic");
237  maxPhoZForEffic = parameters_.getParameter<double>("maxPhoZForEffic");
238  maxPhoRForEffic = parameters_.getParameter<double>("maxPhoRForEffic");
239  minPhoPtForPurity = parameters_.getParameter<double>("minPhoPtForPurity");
240  maxPhoEtaForPurity = parameters_.getParameter<double>("maxPhoEtaForPurity");
241  maxPhoZForPurity = parameters_.getParameter<double>("maxPhoZForPurity");
242  maxPhoRForPurity = parameters_.getParameter<double>("maxPhoRForPurity");
243 
244 
245  if (dbe_) {
246 
248  // SC from reco photons
249 
250  //TString simfolder = TString(
251  std::string simpath = dqmpath_ + "SimulationInfo";
252  iBooker.setCurrentFolder(simpath);
253  //
254  // simulation information about conversions
256  std::string histname = "nOfSimConversions";
257  h_nSimConv_[0] = iBooker.book1D(histname,"# of Sim conversions per event ",20,-0.5,19.5);
259  histname = "h_AllSimConvEta";
260  h_AllSimConv_[0] = iBooker.book1D(histname," All conversions: simulated #eta",etaBin2,etaMin,etaMax);
261  histname = "h_AllSimConvPhi";
262  h_AllSimConv_[1] = iBooker.book1D(histname," All conversions: simulated #phi",phiBin,phiMin,phiMax);
263  histname = "h_AllSimConvR";
264  h_AllSimConv_[2] = iBooker.book1D(histname," All conversions: simulated R",rBin,rMin,rMax);
265  histname = "h_AllSimConvZ";
266  h_AllSimConv_[3] = iBooker.book1D(histname," All conversions: simulated Z",zBin,zMin,zMax);
267  histname = "h_AllSimConvEt";
268  h_AllSimConv_[4] = iBooker.book1D(histname," All conversions: simulated Et",etBin,etMin,etMax);
269  //
270  histname = "nOfVisSimConversions";
271  h_nSimConv_[1] = iBooker.book1D(histname,"# of Sim conversions per event ",20,-0.5,19.5);
272  histname = "h_VisSimConvEta";
273  h_VisSimConv_[0] = iBooker.book1D(histname," All vis conversions: simulated #eta",etaBin2,etaMin, etaMax);
274  histname = "h_VisSimConvPhi";
275  h_VisSimConv_[1] = iBooker.book1D(histname," All vis conversions: simulated #phi",phiBin,phiMin, phiMax);
276  histname = "h_VisSimConvR";
277  h_VisSimConv_[2] = iBooker.book1D(histname," All vis conversions: simulated R",rBin,rMin,rMax);
278  histname = "h_VisSimConvZ";
279  h_VisSimConv_[3] = iBooker.book1D(histname," All vis conversions: simulated Z",zBin,zMin, zMax);
280  histname = "h_VisSimConvEt";
281  h_VisSimConv_[4] = iBooker.book1D(histname," All vis conversions: simulated Et",etBin,etMin, etMax);
282 
283  //
284  histname = "h_SimConvTwoMTracksEta";
285  h_SimConvTwoMTracks_[0] = iBooker.book1D(histname," All vis conversions with 2 reco-matching tracks: simulated #eta",etaBin2,etaMin, etaMax);
286  histname = "h_SimConvTwoMTracksPhi";
287  h_SimConvTwoMTracks_[1] = iBooker.book1D(histname," All vis conversions with 2 reco-matching tracks: simulated #phi",phiBin,phiMin, phiMax);
288  histname = "h_SimConvTwoMTracksR";
289  h_SimConvTwoMTracks_[2] = iBooker.book1D(histname," All vis conversions with 2 reco-matching tracks: simulated R",rBin,rMin, rMax);
290  histname = "h_SimConvTwoMTracksZ";
291  h_SimConvTwoMTracks_[3] = iBooker.book1D(histname," All vis conversions with 2 reco-matching tracks: simulated Z",zBin,zMin, zMax);
292  histname = "h_SimConvTwoMTracksEt";
293  h_SimConvTwoMTracks_[4] = iBooker.book1D(histname," All vis conversions with 2 reco-matching tracks: simulated Et",etBin,etMin, etMax);
294  //
295  histname = "h_SimConvTwoTracksEta";
296  h_SimConvTwoTracks_[0] = iBooker.book1D(histname," All vis conversions with 2 reco tracks: simulated #eta",etaBin2,etaMin, etaMax);
297  histname = "h_SimConvTwoTracksPhi";
298  h_SimConvTwoTracks_[1] = iBooker.book1D(histname," All vis conversions with 2 reco tracks: simulated #phi",phiBin,phiMin, phiMax);
299  histname = "h_SimConvTwoTracksR";
300  h_SimConvTwoTracks_[2] = iBooker.book1D(histname," All vis conversions with 2 reco tracks: simulated R",rBin,rMin, rMax);
301  histname = "h_SimConvTwoTracksZ";
302  h_SimConvTwoTracks_[3] = iBooker.book1D(histname," All vis conversions with 2 reco tracks: simulated Z",zBin,zMin, zMax);
303  histname = "h_SimConvTwoTracksEt";
304  h_SimConvTwoTracks_[4] = iBooker.book1D(histname," All vis conversions with 2 reco tracks: simulated Et",etBin,etMin, etMax);
305  //
306  histname = "h_SimConvTwoMTracksEtaAndVtxPGT0";
307  h_SimConvTwoMTracksAndVtxPGT0_[0] = iBooker.book1D(histname," All vis conversions with 2 reco-matching tracks + vertex: simulated #eta",etaBin2,etaMin, etaMax);
308  histname = "h_SimConvTwoMTracksPhiAndVtxPGT0";
309  h_SimConvTwoMTracksAndVtxPGT0_[1] = iBooker.book1D(histname," All vis conversions with 2 reco-matching tracks + vertex: simulated #phi",phiBin,phiMin, phiMax);
310  histname = "h_SimConvTwoMTracksRAndVtxPGT0";
311  h_SimConvTwoMTracksAndVtxPGT0_[2] = iBooker.book1D(histname," All vis conversions with 2 reco-matching tracks + vertex: simulated R",rBin,rMin, rMax);
312  histname = "h_SimConvTwoMTracksZAndVtxPGT0";
313  h_SimConvTwoMTracksAndVtxPGT0_[3] = iBooker.book1D(histname," All vis conversions with 2 reco-matching tracks + vertex: simulated Z",zBin,zMin, zMax);
314  histname = "h_SimConvTwoMTracksEtAndVtxPGT0";
315  h_SimConvTwoMTracksAndVtxPGT0_[4] = iBooker.book1D(histname," All vis conversions with 2 reco-matching tracks + vertex: simulated Et",etBin,etMin, etMax);
316 
317  //
318  histname = "h_SimConvTwoMTracksEtaAndVtxPGT0005";
319  h_SimConvTwoMTracksAndVtxPGT0005_[0] = iBooker.book1D(histname," All vis conversions with 2 reco-matching tracks + vertex: simulated #eta",etaBin2,etaMin, etaMax);
320  histname = "h_SimConvTwoMTracksPhiAndVtxPGT0005";
321  h_SimConvTwoMTracksAndVtxPGT0005_[1] = iBooker.book1D(histname," All vis conversions with 2 reco-matching tracks + vertex: simulated #phi",phiBin,phiMin, phiMax);
322  histname = "h_SimConvTwoMTracksRAndVtxPGT0005";
323  h_SimConvTwoMTracksAndVtxPGT0005_[2] = iBooker.book1D(histname," All vis conversions with 2 reco-matching tracks + vertex: simulated R",rBin,rMin, rMax);
324  histname = "h_SimConvTwoMTracksZAndVtxPGT0005";
325  h_SimConvTwoMTracksAndVtxPGT0005_[3] = iBooker.book1D(histname," All vis conversions with 2 reco-matching tracks + vertex: simulated Z",zBin,zMin, zMax);
326  histname = "h_SimConvTwoMTracksEtAndVtxPGT0005";
327  h_SimConvTwoMTracksAndVtxPGT0005_[4] = iBooker.book1D(histname," All vis conversions with 2 reco-matching tracks + vertex: simulated Et",etBin,etMin, etMax);
328 
329  histname = "h_SimRecConvTwoMTracksEta";
330  h_SimRecConvTwoMTracks_[0] = iBooker.book1D(histname," All vis conversions with 2 reco-matching tracks: simulated #eta",etaBin2,etaMin, etaMax);
331  histname = "h_SimRecConvTwoMTracksPhi";
332  h_SimRecConvTwoMTracks_[1] = iBooker.book1D(histname," All vis conversions with 2 reco-matching tracks: simulated #phi",phiBin,phiMin, phiMax);
333  histname = "h_SimRecConvTwoMTracksR";
334  h_SimRecConvTwoMTracks_[2] = iBooker.book1D(histname," All vis conversions with 2 reco-matching tracks: simulated R",rBin,rMin, rMax);
335  histname = "h_SimRecConvTwoMTracksZ";
336  h_SimRecConvTwoMTracks_[3] = iBooker.book1D(histname," All vis conversions with 2 reco-matching tracks: simulated Z",zBin,zMin, zMax);
337  histname = "h_SimRecConvTwoMTracksEt";
338  h_SimRecConvTwoMTracks_[4] = iBooker.book1D(histname," All vis conversions with 2 reco-matching tracks: simulated Et",etBin,etMin, etMax);
339  //
340 
341 
342  h_SimConvEtaPix_[0] = iBooker.book1D("simConvEtaPix"," sim converted Photon Eta: Pix ",etaBin,etaMin, etaMax) ;
343  h_simTkPt_ = iBooker.book1D("simTkPt","Sim conversion tracks pt ",etBin*3,0.,etMax);
344  h_simTkEta_ = iBooker.book1D("simTkEta","Sim conversion tracks eta ",etaBin,etaMin,etaMax);
345 
346  h_simConvVtxRvsZ_[0] = iBooker.book2D("simConvVtxRvsZAll"," Photon Sim conversion vtx position",zBinForXray, zMinForXray, zMaxForXray, rBinForXray, rMinForXray, rMaxForXray);
347  h_simConvVtxRvsZ_[1] = iBooker.book2D("simConvVtxRvsZBarrel"," Photon Sim conversion vtx position",zBinForXray, zMinForXray, zMaxForXray, rBinForXray, rMinForXray, rMaxForXray);
348  h_simConvVtxRvsZ_[2] = iBooker.book2D("simConvVtxRvsZEndcap"," Photon Sim conversion vtx position",zBin2ForXray, zMinForXray, zMaxForXray, rBinForXray, rMinForXray, rMaxForXray);
349  h_simConvVtxRvsZ_[3] = iBooker.book2D("simConvVtxRvsZBarrel2"," Photon Sim conversion vtx position when reco R<4cm",zBinForXray, zMinForXray, zMaxForXray, rBinForXray, rMinForXray, rMaxForXray);
350  h_simConvVtxYvsX_ = iBooker.book2D("simConvVtxYvsXTrkBarrel"," Photon Sim conversion vtx position, (x,y) eta<1 ",100, -80., 80., 100, -80., 80.);
351 
352  std::string convpath = dqmpath_ + "ConversionInfo";
353  iBooker.setCurrentFolder(convpath);
354 
355  histname="nConv";
356  h_nConv_[0][0] = iBooker.book1D(histname+"All","Number Of Conversions per isolated candidates per events: All Ecal ",10,-0.5, 9.5);
357  h_nConv_[0][1] = iBooker.book1D(histname+"Barrel","Number Of Conversions per isolated candidates per events: Ecal Barrel ",10,-0.5, 9.5);
358  h_nConv_[0][2] = iBooker.book1D(histname+"Endcap","Number Of Conversions per isolated candidates per events: Ecal Endcap ",10,-0.5, 9.5);
359  h_nConv_[1][0] = iBooker.book1D(histname+"All_Ass","Number Of associated Conversions per isolated candidates per events: All Ecal ",10,-0.5, 9.5);
360 
361  h_convEta_[0][0] = iBooker.book1D("convEta"," converted Photon Eta ",etaBin,etaMin, etaMax) ;
362  h_convEtaMatchSC_[0][0] = iBooker.book1D("convEtaMatchSC"," converted Photon Eta when SC is matched ",etaBin,etaMin, etaMax) ;
363  h_convEta2_[0][0] = iBooker.book1D("convEta2"," converted Photon Eta ",etaBin2,etaMin, etaMax) ;
364  h_convPhi_[0][0] = iBooker.book1D("convPhi"," converted Photon Phi ",phiBin,phiMin,phiMax) ;
365  h_convR_[0][0] = iBooker.book1D("convR"," converted photon R",rBin,rMin, rMax);
366  h_convZ_[0][0] = iBooker.book1D("convZ"," converted photon Z",zBin,zMin, zMax);
367  h_convPt_[0][0] = iBooker.book1D("convPt"," conversions Transverse Energy: all eta ", etBin,etMin, etMax);
368 
369  h_convEta_[1][0] = iBooker.book1D("convEtaAss2"," Matched converted Photon Eta ",etaBin2,etaMin, etaMax) ;
370  h_convEta_[1][1] = iBooker.book1D("convEtaAss"," Matched converted Photon Eta ",etaBin,etaMin, etaMax) ;
371  h_convEtaMatchSC_[1][0] = iBooker.book1D("convEtaMatchSCAss"," converted Photon Eta when SC is matched ",etaBin,etaMin, etaMax) ;
372  h_convPhi_[1][0] = iBooker.book1D("convPhiAss"," Matched converted Photon Phi ",phiBin,phiMin,phiMax) ;
373  h_convR_[1][0] = iBooker.book1D("convRAss"," Matched converted photon R",rBin,rMin, rMax);
374  h_convZ_[1][0] = iBooker.book1D("convZAss"," Matched converted photon Z",zBin,zMin, zMax);
375  h_convPt_[1][0] = iBooker.book1D("convPtAss","Matched conversions Transverse Energy: all eta ", etBin,etMin, etMax);
376 
377  h_convEta_[2][0] = iBooker.book1D("convEtaFake2"," Fake converted Photon Eta ",etaBin2,etaMin, etaMax) ;
378  h_convEta_[2][1] = iBooker.book1D("convEtaFake"," Fake converted Photon Eta ",etaBin,etaMin, etaMax) ;
379  h_convEtaMatchSC_[2][0] = iBooker.book1D("convEtaMatchSCFake"," converted Photon Eta when SC is matched ",etaBin,etaMin, etaMax) ;
380  h_convPhi_[2][0] = iBooker.book1D("convPhiFake"," Fake converted Photon Phi ",phiBin,phiMin,phiMax) ;
381  h_convR_[2][0] = iBooker.book1D("convRFake"," Fake converted photon R",rBin,rMin, rMax);
382  h_convZ_[2][0] = iBooker.book1D("convZFake"," Fake converted photon Z",zBin,zMin, zMax);
383  h_convPt_[2][0] = iBooker.book1D("convPtFake","Fake conversions Transverse Energy: all eta ", etBin,etMin, etMax);
384 
385  h_convRplot_ = iBooker.book1D("convRplot"," converted photon R",600, 0.,120.);
386  h_convZplot_ = iBooker.book1D("convZplot"," converted photon Z",320,-160.,160.);
387 
388  histname = "convSCdPhi";
389  h_convSCdPhi_[0][0] = iBooker.book1D(histname+"All","dPhi between SC and conversion",100, -0.1,0.1);
390  h_convSCdPhi_[0][1] = iBooker.book1D(histname+"Barrel"," dPhi between SC and conversion: Barrel",100, -0.1,0.1);
391  h_convSCdPhi_[0][2] = iBooker.book1D(histname+"Endcap"," dPhi between SC and conversion: Endcap",100, -0.1,0.1);
392  h_convSCdPhi_[1][0] = iBooker.book1D(histname+"All_Ass","dPhi between SC and conversion",100, -0.1,0.1);
393  h_convSCdPhi_[1][1] = iBooker.book1D(histname+"Barrel_Ass"," dPhi between SC and conversion: Barrel",100, -0.1,0.1);
394  h_convSCdPhi_[1][2] = iBooker.book1D(histname+"Endcap_Ass"," dPhi between SC and conversion: Endcap",100, -0.1,0.1);
395  h_convSCdPhi_[2][0] = iBooker.book1D(histname+"All_Fakes","dPhi between SC and conversion",100, -0.1,0.1);
396  h_convSCdPhi_[2][1] = iBooker.book1D(histname+"Barrel_Fakes"," dPhi between SC and conversion: Barrel",100, -0.1,0.1);
397  h_convSCdPhi_[2][2] = iBooker.book1D(histname+"Endcap_Fakes"," dPhi between SC and conversion: Endcap",100, -0.1,0.1);
398  histname = "convSCdEta";
399  h_convSCdEta_[0][0] = iBooker.book1D(histname+"All"," dEta between SC and conversion",100, -0.1,0.1);
400  h_convSCdEta_[0][1] = iBooker.book1D(histname+"Barrel"," dEta between SC and conversion: Barrel",100, -0.1,0.1);
401  h_convSCdEta_[0][2] = iBooker.book1D(histname+"Endcap"," dEta between SC and conversion: Endcap",100, -0.1,0.1);
402  h_convSCdEta_[1][0] = iBooker.book1D(histname+"All_Ass"," dEta between SC and conversion",100, -0.1,0.1);
403  h_convSCdEta_[1][1] = iBooker.book1D(histname+"Barrel_Ass"," dEta between SC and conversion: Barrel",100, -0.1,0.1);
404  h_convSCdEta_[1][2] = iBooker.book1D(histname+"Endcap_Ass"," dEta between SC and conversion: Endcap",100, -0.1,0.1);
405  h_convSCdEta_[2][0] = iBooker.book1D(histname+"All_Fakes"," dEta between SC and conversion",100, -0.1,0.1);
406  h_convSCdEta_[2][1] = iBooker.book1D(histname+"Barrel_Fakes"," dEta between SC and conversion: Barrel",100, -0.1,0.1);
407  h_convSCdEta_[2][2] = iBooker.book1D(histname+"Endcap_Fakes"," dEta between SC and conversion: Endcap",100, -0.1,0.1);
408 
409  histname = "convPtRes";
410  h_convPtRes_[0] = iBooker.book1D(histname+"All"," Conversion Pt rec/true : All ecal ", resBin,resMin, resMax);
411  h_convPtRes_[1] = iBooker.book1D(histname+"Barrel"," Conversion Pt rec/true : Barrel ",resBin,resMin, resMax);
412  h_convPtRes_[2] = iBooker.book1D(histname+"Endcap"," Conversion Pt rec/true : Endcap ",resBin,resMin, resMax);
413 
414 
415  histname="hInvMass";
416  h_invMass_[0][0]= iBooker.book1D(histname+"All_AllTracks"," Photons:Tracks from conversion: Pair invariant mass: all Ecal ",100, 0., 1.5);
417  h_invMass_[0][1]= iBooker.book1D(histname+"Barrel_AllTracks"," Photons:Tracks from conversion: Pair invariant mass: Barrel Ecal ",100, 0., 1.5);
418  h_invMass_[0][2]= iBooker.book1D(histname+"Endcap_AllTracks"," Photons:Tracks from conversion: Pair invariant mass: Endcap Ecal ",100, 0., 1.5);
419  //
420  h_invMass_[1][0]= iBooker.book1D(histname+"All_AssTracks"," Photons:Tracks from conversion: Pair invariant mass: all Ecal ",100, 0., 1.5);
421  h_invMass_[1][1]= iBooker.book1D(histname+"Barrel_AssTracks"," Photons:Tracks from conversion: Pair invariant mass: Barrel Ecal ",100, 0., 1.5);
422  h_invMass_[1][2]= iBooker.book1D(histname+"Endcap_AssTracks"," Photons:Tracks from conversion: Pair invariant mass: Endcap Ecal ",100, 0., 1.5);
423  //
424  h_invMass_[2][0]= iBooker.book1D(histname+"All_FakeTracks"," Photons:Tracks from conversion: Pair invariant mass: all Ecal ",100, 0., 1.5);
425  h_invMass_[2][1]= iBooker.book1D(histname+"Barrel_FakeTracks"," Photons:Tracks from conversion: Pair invariant mass: Barrel Ecal ",100, 0., 1.5);
426  h_invMass_[2][2]= iBooker.book1D(histname+"Endcap_FaleTracks"," Photons:Tracks from conversion: Pair invariant mass: Endcap Ecal ",100, 0., 1.5);
427 
428 
429 
430  histname="hDPhiTracksAtVtx";
431  h_DPhiTracksAtVtx_[0][0] =iBooker.book1D(histname+"All", " Photons:Tracks from conversions: #delta#phi Tracks at vertex: all Ecal",dPhiTracksBin,dPhiTracksMin,dPhiTracksMax);
432  h_DPhiTracksAtVtx_[0][1] =iBooker.book1D(histname+"Barrel", " Photons:Tracks from conversions: #delta#phi Tracks at vertex: Barrel Ecal",dPhiTracksBin,dPhiTracksMin,dPhiTracksMax);
433  h_DPhiTracksAtVtx_[0][2] =iBooker.book1D(histname+"Endcap", " Photons:Tracks from conversions: #delta#phi Tracks at vertex: Endcap Ecal",dPhiTracksBin,dPhiTracksMin,dPhiTracksMax);
434  h_DPhiTracksAtVtx_[1][0] =iBooker.book1D(histname+"All_Ass", " Photons:Tracks from conversions: #delta#phi Tracks at vertex: all Ecal",dPhiTracksBin,dPhiTracksMin,dPhiTracksMax);
435  h_DPhiTracksAtVtx_[1][1] =iBooker.book1D(histname+"Barrel_Ass", " Photons:Tracks from conversions: #delta#phi Tracks at vertex: Barrel Ecal",dPhiTracksBin,dPhiTracksMin,dPhiTracksMax);
436  h_DPhiTracksAtVtx_[1][2] =iBooker.book1D(histname+"Endcap_Ass", " Photons:Tracks from conversions: #delta#phi Tracks at vertex: Endcap Ecal",dPhiTracksBin,dPhiTracksMin,dPhiTracksMax);
437  h_DPhiTracksAtVtx_[2][0] =iBooker.book1D(histname+"All_Fakes", " Photons:Tracks from conversions: #delta#phi Tracks at vertex: all Ecal",dPhiTracksBin,dPhiTracksMin,dPhiTracksMax);
438  h_DPhiTracksAtVtx_[2][1] =iBooker.book1D(histname+"Barrel_Fakes", " Photons:Tracks from conversions: #delta#phi Tracks at vertex: Barrel Ecal",dPhiTracksBin,dPhiTracksMin,dPhiTracksMax);
439  h_DPhiTracksAtVtx_[2][2] =iBooker.book1D(histname+"Endcap_Fakes", " Photons:Tracks from conversions: #delta#phi Tracks at vertex: Endcap Ecal",dPhiTracksBin,dPhiTracksMin,dPhiTracksMax);
440 
441 
442 
443  histname="hDPhiTracksAtVtxVsEta";
444  h2_DPhiTracksAtVtxVsEta_ = iBooker.book2D(histname+"All"," Photons:Tracks from conversions: #delta#phi Tracks at vertex vs #eta",etaBin2,etaMin, etaMax,100, -0.5, 0.5);
445  histname="pDPhiTracksAtVtxVsEta";
446  p_DPhiTracksAtVtxVsEta_ = iBooker.bookProfile(histname+"All"," Photons:Tracks from conversions: #delta#phi Tracks at vertex vs #eta ",etaBin2,etaMin, etaMax, 100, -0.5, 0.5,"");
447 
448  histname="hDPhiTracksAtVtxVsR";
449  h2_DPhiTracksAtVtxVsR_ = iBooker.book2D(histname+"All"," Photons:Tracks from conversions: #delta#phi Tracks at vertex vs R",rBin,rMin, rMax,100, -0.5, 0.5);
450  histname="pDPhiTracksAtVtxVsR";
451  p_DPhiTracksAtVtxVsR_ = iBooker.bookProfile(histname+"All"," Photons:Tracks from conversions: #delta#phi Tracks at vertex vs R ",rBin,rMin, rMax,100, -0.5, 0.5,"");
452 
453 
454  histname="hDCotTracks";
455  h_DCotTracks_[0][0]= iBooker.book1D(histname+"All"," Photons:Tracks from conversions #delta cotg(#Theta) Tracks: all Ecal ",dCotTracksBin,dCotTracksMin,dCotTracksMax);
456  h_DCotTracks_[0][1]= iBooker.book1D(histname+"Barrel"," Photons:Tracks from conversions #delta cotg(#Theta) Tracks: Barrel Ecal ",dCotTracksBin,dCotTracksMin,dCotTracksMax);
457  h_DCotTracks_[0][2]= iBooker.book1D(histname+"Endcap"," Photons:Tracks from conversions #delta cotg(#Theta) Tracks: Endcap Ecal ",dCotTracksBin,dCotTracksMin,dCotTracksMax);
458  h_DCotTracks_[1][0]= iBooker.book1D(histname+"All_Ass"," Photons:Tracks from conversions #delta cotg(#Theta) Tracks: all Ecal ",dCotTracksBin,dCotTracksMin,dCotTracksMax);
459  h_DCotTracks_[1][1]= iBooker.book1D(histname+"Barrel_Ass"," Photons:Tracks from conversions #delta cotg(#Theta) Tracks: Barrel Ecal ",dCotTracksBin,dCotTracksMin,dCotTracksMax);
460  h_DCotTracks_[1][2]= iBooker.book1D(histname+"Endcap_Ass"," Photons:Tracks from conversions #delta cotg(#Theta) Tracks: Endcap Ecal ",dCotTracksBin,dCotTracksMin,dCotTracksMax);
461  h_DCotTracks_[2][0]= iBooker.book1D(histname+"All_Fakes"," Photons:Tracks from conversions #delta cotg(#Theta) Tracks: all Ecal ",dCotTracksBin,dCotTracksMin,dCotTracksMax);
462  h_DCotTracks_[2][1]= iBooker.book1D(histname+"Barrel_Fakes"," Photons:Tracks from conversions #delta cotg(#Theta) Tracks: Barrel Ecal ",dCotTracksBin,dCotTracksMin,dCotTracksMax);
463  h_DCotTracks_[2][2]= iBooker.book1D(histname+"Endcap_Fakes"," Photons:Tracks from conversions #delta cotg(#Theta) Tracks: Endcap Ecal ",dCotTracksBin,dCotTracksMin,dCotTracksMax);
464 
465 
466  histname="hDCotTracksVsEta";
467  h2_DCotTracksVsEta_ = iBooker.book2D(histname+"All"," Photons:Tracks from conversions: #delta cotg(#Theta) Tracks vs #eta",etaBin2,etaMin, etaMax,100, -0.2, 0.2);
468  histname="pDCotTracksVsEta";
469  p_DCotTracksVsEta_ = iBooker.bookProfile(histname+"All"," Photons:Tracks from conversions: #delta cotg(#Theta) Tracks vs #eta ",etaBin2,etaMin, etaMax, 100, -0.2, 0.2,"");
470 
471  histname="hDCotTracksVsR";
472  h2_DCotTracksVsR_ = iBooker.book2D(histname+"All"," Photons:Tracks from conversions: #delta cotg(#Theta) Tracks at vertex vs R",rBin,rMin, rMax,100, -0.2, 0.2);
473  histname="pDCotTracksVsR";
474  p_DCotTracksVsR_ = iBooker.bookProfile(histname+"All"," Photons:Tracks from conversions: #delta cotg(#Theta) Tracks at vertex vs R ",rBin,rMin, rMax,100, -0.2, 0.2,"");
475 
476 
477  histname="hDistMinAppTracks";
478  h_distMinAppTracks_[0][0]= iBooker.book1D(histname+"All"," Photons:Tracks from conversions Min Approach Dist Tracks: all Ecal ",120, -0.5, 1.0);
479  h_distMinAppTracks_[0][1]= iBooker.book1D(histname+"Barrel"," Photons:Tracks from conversions Min Approach Dist Tracks: Barrel Ecal ",120, -0.5, 1.0);
480  h_distMinAppTracks_[0][2]= iBooker.book1D(histname+"Endcap"," Photons:Tracks from conversions Min Approach Dist Tracks: Endcap Ecal ",120, -0.5, 1.0);
481  h_distMinAppTracks_[1][0]= iBooker.book1D(histname+"All_Ass"," Photons:Tracks from conversions Min Approach Dist Tracks: all Ecal ",120, -0.5, 1.0);
482  h_distMinAppTracks_[1][1]= iBooker.book1D(histname+"Barrel_Ass"," Photons:Tracks from conversions Min Approach Dist Tracks: Barrel Ecal ",120, -0.5, 1.0);
483  h_distMinAppTracks_[1][2]= iBooker.book1D(histname+"Endcap_Ass"," Photons:Tracks from conversions Min Approach Dist Tracks: Endcap Ecal ",120, -0.5, 1.0);
484  h_distMinAppTracks_[2][0]= iBooker.book1D(histname+"All_Fakes"," Photons:Tracks from conversions Min Approach Dist Tracks: all Ecal ",120, -0.5, 1.0);
485  h_distMinAppTracks_[2][1]= iBooker.book1D(histname+"Barrel_Fakes"," Photons:Tracks from conversions Min Approach Dist Tracks: Barrel Ecal ",120, -0.5, 1.0);
486  h_distMinAppTracks_[2][2]= iBooker.book1D(histname+"Endcap_Fakes"," Photons:Tracks from conversions Min Approach Dist Tracks: Endcap Ecal ",120, -0.5, 1.0);
487 
488 
489  h_convVtxRvsZ_[0] = iBooker.book2D("convVtxRvsZAll"," Photon Reco conversion vtx position",zBinForXray, zMinForXray, zMaxForXray, rBinForXray, rMinForXray, rMaxForXray);
490  h_convVtxRvsZ_[1] = iBooker.book2D("convVtxRvsZBarrel"," Photon Reco conversion vtx position",zBinForXray, zMinForXray, zMaxForXray, rBinForXray, rMinForXray, rMaxForXray);
491  h_convVtxRvsZ_[2] = iBooker.book2D("convVtxRvsZEndcap"," Photon Reco conversion vtx position",zBin2ForXray, zMinForXray, zMaxForXray, rBinForXray, rMinForXray, rMaxForXray);
492  h_convVtxYvsX_ = iBooker.book2D("convVtxYvsXTrkBarrel"," Photon Reco conversion vtx position, (x,y) eta<1 ", 1000, -60., 60., 1000, -60., 60.);
494  h_convVtxRvsZ_zoom_[0] = iBooker.book2D("convVtxRvsZBarrelZoom1"," Photon Reco conversion vtx position",zBinForXray, zMinForXray, zMaxForXray, rBinForXray, -10., 40.);
495  h_convVtxRvsZ_zoom_[1] = iBooker.book2D("convVtxRvsZBarrelZoom2"," Photon Reco conversion vtx position",zBinForXray, zMinForXray, zMaxForXray, rBinForXray, -10., 20.);
496  h_convVtxYvsX_zoom_[0] = iBooker.book2D("convVtxYvsXTrkBarrelZoom1"," Photon Reco conversion vtx position, (x,y) eta<1 ",100, -40., 40., 100, -40., 40.);
497  h_convVtxYvsX_zoom_[1] = iBooker.book2D("convVtxYvsXTrkBarrelZoom2"," Photon Reco conversion vtx position, (x,y) eta<1 ",100, -20., 20., 100, -20., 20.);
498 
499  h_convVtxdR_ = iBooker.book1D("convVtxdR"," Photon Reco conversion vtx dR",100, -10.,10.);
500  h_convVtxdX_ = iBooker.book1D("convVtxdX"," Photon Reco conversion vtx dX",100, -10.,10.);
501  h_convVtxdY_ = iBooker.book1D("convVtxdY"," Photon Reco conversion vtx dY",100, -10.,10.);
502  h_convVtxdZ_ = iBooker.book1D("convVtxdZ"," Photon Reco conversion vtx dZ",100, -20.,20.);
503 
504  h_convVtxdPhi_ = iBooker.book1D("convVtxdPhi"," Photon Reco conversion vtx dPhi",100, -0.01,0.01);
505  h_convVtxdEta_ = iBooker.book1D("convVtxdEta"," Photon Reco conversion vtx dEta",100, -0.5,0.5);
506 
507  h_convVtxdR_barrel_ = iBooker.book1D("convVtxdR_barrel"," Photon Reco conversion vtx dR, |eta|<=1.2",100, -10.,10.);
508  h_convVtxdX_barrel_ = iBooker.book1D("convVtxdX_barrel"," Photon Reco conversion vtx dX, |eta|<=1.2",100, -10.,10.);
509  h_convVtxdY_barrel_ = iBooker.book1D("convVtxdY_barrel"," Photon Reco conversion vtx dY, |eta|<=1.2 ",100, -10.,10.);
510  h_convVtxdZ_barrel_ = iBooker.book1D("convVtxdZ_barrel"," Photon Reco conversion vtx dZ, |eta|<=1.2,",100, -20.,20.);
511 
512  h_convVtxdR_endcap_ = iBooker.book1D("convVtxdR_endcap"," Photon Reco conversion vtx dR, |eta|>1.2 ",100, -10.,10.);
513  h_convVtxdX_endcap_ = iBooker.book1D("convVtxdX_endcap"," Photon Reco conversion vtx dX, |eta|>1.2",100, -10.,10.);
514  h_convVtxdY_endcap_ = iBooker.book1D("convVtxdY_endcap"," Photon Reco conversion vtx dY, |eta|>1.2",100, -10.,10.);
515  h_convVtxdZ_endcap_ = iBooker.book1D("convVtxdZ_endcap"," Photon Reco conversion vtx dZ, |eta|>1.2",100, -20.,20.);
516 
517 
518 
519  h2_convVtxdRVsR_ = iBooker.book2D("h2ConvVtxdRVsR"," Conversion vtx dR vsR" ,rBin,rMin, rMax,100, -20.,20.);
520  h2_convVtxdRVsEta_ = iBooker.book2D("h2ConvVtxdRVsEta","Conversion vtx dR vs Eta" ,etaBin2,etaMin, etaMax,100, -20.,20.);
521 
522  p_convVtxdRVsR_ = iBooker.bookProfile("pConvVtxdRVsR"," Conversion vtx dR vsR" ,rBin,rMin, rMax ,100, -20.,20., "");
523  p_convVtxdRVsEta_ = iBooker.bookProfile("pConvVtxdRVsEta","Conversion vtx dR vs Eta" ,etaBin2,etaMin, etaMax, 100, -20.,20., "");
524  p_convVtxdXVsX_ = iBooker.bookProfile("pConvVtxdXVsX","Conversion vtx dX vs X" ,120,-60, 60 ,100, -20.,20., "");
525  p_convVtxdYVsY_ = iBooker.bookProfile("pConvVtxdYVsY","Conversion vtx dY vs Y" ,120,-60, 60 ,100, -20.,20., "");
526  p_convVtxdZVsZ_ = iBooker.bookProfile("pConvVtxdZVsZ","Conversion vtx dZ vs Z" ,zBin,zMin,zMax ,100, -20.,20., "");
527 
528  p_convVtxdZVsR_ = iBooker.bookProfile("pConvVtxdZVsR","Conversion vtx dZ vs R" ,rBin,rMin,rMax ,100, -20.,20., "");
529  p2_convVtxdRVsRZ_ = iBooker.bookProfile2D("p2ConvVtxdRVsRZ","Conversion vtx dR vs RZ" ,zBin,zMin, zMax,rBin,rMin,rMax,100, 0.,20.,"s");
530  p2_convVtxdZVsRZ_ = iBooker.bookProfile2D("p2ConvVtxdZVsRZ","Conversion vtx dZ vs RZ" ,zBin,zMin, zMax,rBin,rMin,rMax,100, 0.,20.,"s");
531 
532 
533  histname="EoverPtracks";
534  h_EoverPTracks_[0][0] = iBooker.book1D(histname+"All"," photons conversion E/p: all Ecal ", eoverpBin, eoverpMin, eoverpMax );
535  h_EoverPTracks_[0][1] = iBooker.book1D(histname+"Barrel"," photons conversion E/p: Barrel Ecal", eoverpBin, eoverpMin, eoverpMax);
536  h_EoverPTracks_[0][2] = iBooker.book1D(histname+"Endcap"," photons conversion E/p: Endcap Ecal ", eoverpBin, eoverpMin, eoverpMax);
537  h_EoverPTracks_[1][0] = iBooker.book1D(histname+"All_Ass"," photons conversion E/p: all Ecal ", eoverpBin, eoverpMin, eoverpMax);
538  h_EoverPTracks_[1][1] = iBooker.book1D(histname+"Barrel_Ass"," photons conversion E/p: Barrel Ecal", eoverpBin, eoverpMin, eoverpMax);
539  h_EoverPTracks_[1][2] = iBooker.book1D(histname+"Endcap_Ass"," photons conversion E/p: Endcap Ecal ", eoverpBin, eoverpMin, eoverpMax);
540  h_EoverPTracks_[2][0] = iBooker.book1D(histname+"All_Fakes"," photons conversion E/p: all Ecal ", eoverpBin, eoverpMin, eoverpMax);
541  h_EoverPTracks_[2][1] = iBooker.book1D(histname+"Barrel_Fakes"," photons conversion E/p: Barrel Ecal", eoverpBin, eoverpMin, eoverpMax);
542  h_EoverPTracks_[2][2] = iBooker.book1D(histname+"Endcap_Fakes"," photons conversion E/p: Endcap Ecal ", eoverpBin, eoverpMin, eoverpMax);
543 
544 
545  h2_convVtxRrecVsTrue_ = iBooker.book2D("h2ConvVtxRrecVsTrue","Photon Reco conversion vtx R rec vs true" ,rBin,rMin, rMax,rBin,rMin, rMax);
546 
547  histname="vtxChi2Prob";
548  h_vtxChi2Prob_[0][0] = iBooker.book1D(histname+"All","vertex #chi^{2} all", 100, 0., 1.);
549  h_vtxChi2Prob_[0][1] = iBooker.book1D(histname+"Barrel","vertex #chi^{2} barrel", 100, 0., 1.);
550  h_vtxChi2Prob_[0][2] = iBooker.book1D(histname+"Endcap","vertex #chi^{2} endcap", 100, 0., 1.);
551  h_vtxChi2Prob_[1][0] = iBooker.book1D(histname+"All_Ass","vertex #chi^{2} all", 100, 0., 1.);
552  h_vtxChi2Prob_[1][1] = iBooker.book1D(histname+"Barrel_Ass","vertex #chi^{2} barrel", 100, 0., 1.);
553  h_vtxChi2Prob_[1][2] = iBooker.book1D(histname+"Endcap_Ass","vertex #chi^{2} endcap", 100, 0., 1.);
554  h_vtxChi2Prob_[2][0] = iBooker.book1D(histname+"All_Fakes","vertex #chi^{2} all", 100, 0., 1.);
555  h_vtxChi2Prob_[2][1] = iBooker.book1D(histname+"Barrel_Fakes","vertex #chi^{2} barrel", 100, 0., 1.);
556  h_vtxChi2Prob_[2][2] = iBooker.book1D(histname+"Endcap_Fakes","vertex #chi^{2} endcap", 100, 0., 1.);
557 
558 
559  h_zPVFromTracks_[1] = iBooker.book1D("zPVFromTracks"," Photons: PV z from conversion tracks",100, -25., 25.);
560  h_dzPVFromTracks_[1] = iBooker.book1D("dzPVFromTracks"," Photons: PV Z_rec - Z_true from conversion tracks",100, -5., 5.);
561  h2_dzPVVsR_ = iBooker.book2D("h2dzPVVsR","Photon Reco conversions: dz(PV) vs R" ,rBin,rMin, rMax,100, -3.,3.);
562  p_dzPVVsR_ = iBooker.bookProfile("pdzPVVsR","Photon Reco conversions: dz(PV) vs R" ,rBin,rMin, rMax, 100, -3.,3.,"");
563 
564 
565  histname="lxybs";
566  h_lxybs_[0][0] = iBooker.book1D(histname+"All","vertex #chi^{2} all", 200, -100., 100.);
567  h_lxybs_[0][1] = iBooker.book1D(histname+"Barrel","vertex #chi^{2} barrel", 200, -100., 100.);
568  h_lxybs_[0][2] = iBooker.book1D(histname+"Endcap","vertex #chi^{2} endcap", 200, -100., 100.);
569  h_lxybs_[1][0] = iBooker.book1D(histname+"All_Ass","vertex #chi^{2} all", 200, -100., 100.);
570  h_lxybs_[1][1] = iBooker.book1D(histname+"Barrel_Ass","vertex #chi^{2} barrel", 200, -100., 100.);
571  h_lxybs_[1][2] = iBooker.book1D(histname+"Endcap_Ass","vertex #chi^{2} endcap", 200, -100., 100.);
572  h_lxybs_[2][0] = iBooker.book1D(histname+"All_Fakes","vertex #chi^{2} all", 200, -100., 100.);
573  h_lxybs_[2][1] = iBooker.book1D(histname+"Barrel_Fakes","vertex #chi^{2} barrel", 200, -100., 100.);
574  h_lxybs_[2][2] = iBooker.book1D(histname+"Endcap_Fakes","vertex #chi^{2} endcap", 200, -100., 100.);
575 
576  histname="maxNHitsBeforeVtx";
577  h_maxNHitsBeforeVtx_[0][0] = iBooker.book1D(histname+"All","vertex #chi^{2} all", 16, -0.5, 15.5);
578  h_maxNHitsBeforeVtx_[0][1] = iBooker.book1D(histname+"Barrel","vertex #chi^{2} barrel", 16, -0.5, 15.5);
579  h_maxNHitsBeforeVtx_[0][2] = iBooker.book1D(histname+"Endcap","vertex #chi^{2} endcap", 16, -0.5, 15.5);
580  h_maxNHitsBeforeVtx_[1][0] = iBooker.book1D(histname+"All_Ass","vertex #chi^{2} all", 16, -0.5, 15.5);
581  h_maxNHitsBeforeVtx_[1][1] = iBooker.book1D(histname+"Barrel_Ass","vertex #chi^{2} barrel", 16, -0.5, 15.5);
582  h_maxNHitsBeforeVtx_[1][2] = iBooker.book1D(histname+"Endcap_Ass","vertex #chi^{2} endcap", 16, -0.5, 15.5);
583  h_maxNHitsBeforeVtx_[2][0] = iBooker.book1D(histname+"All_Fakes","vertex #chi^{2} all", 16, -0.5, 15.5);
584  h_maxNHitsBeforeVtx_[2][1] = iBooker.book1D(histname+"Barrel_Fakes","vertex #chi^{2} barrel", 16, -0.5, 15.5);
585  h_maxNHitsBeforeVtx_[2][2] = iBooker.book1D(histname+"Endcap_Fakes","vertex #chi^{2} endcap", 16, -0.5, 15.5);
586 
587  histname="leadNHitsBeforeVtx";
588  h_leadNHitsBeforeVtx_[0][0] = iBooker.book1D(histname+"All","vertex #chi^{2} all", 16, -0.5, 15.5);
589  h_leadNHitsBeforeVtx_[0][1] = iBooker.book1D(histname+"Barrel","vertex #chi^{2} barrel", 16, -0.5, 15.5);
590  h_leadNHitsBeforeVtx_[0][2] = iBooker.book1D(histname+"Endcap","vertex #chi^{2} endcap", 16, -0.5, 15.5);
591  h_leadNHitsBeforeVtx_[1][0] = iBooker.book1D(histname+"All_Ass","vertex #chi^{2} all", 16, -0.5, 15.5);
592  h_leadNHitsBeforeVtx_[1][1] = iBooker.book1D(histname+"Barrel_Ass","vertex #chi^{2} barrel", 16, -0.5, 15.5);
593  h_leadNHitsBeforeVtx_[1][2] = iBooker.book1D(histname+"Endcap_Ass","vertex #chi^{2} endcap", 16, -0.5, 15.5);
594  h_leadNHitsBeforeVtx_[2][0] = iBooker.book1D(histname+"All_Fakes","vertex #chi^{2} all", 16, -0.5, 15.5);
595  h_leadNHitsBeforeVtx_[2][1] = iBooker.book1D(histname+"Barrel_Fakes","vertex #chi^{2} barrel", 16, -0.5, 15.5);
596  h_leadNHitsBeforeVtx_[2][2] = iBooker.book1D(histname+"Endcap_Fakes","vertex #chi^{2} endcap", 16, -0.5, 15.5);
597 
598  histname="trailNHitsBeforeVtx";
599  h_trailNHitsBeforeVtx_[0][0] = iBooker.book1D(histname+"All","vertex #chi^{2} all", 16, -0.5, 15.5);
600  h_trailNHitsBeforeVtx_[0][1] = iBooker.book1D(histname+"Barrel","vertex #chi^{2} barrel", 16, -0.5, 15.5);
601  h_trailNHitsBeforeVtx_[0][2] = iBooker.book1D(histname+"Endcap","vertex #chi^{2} endcap", 16, -0.5, 15.5);
602  h_trailNHitsBeforeVtx_[1][0] = iBooker.book1D(histname+"All_Ass","vertex #chi^{2} all", 16, -0.5, 15.5);
603  h_trailNHitsBeforeVtx_[1][1] = iBooker.book1D(histname+"Barrel_Ass","vertex #chi^{2} barrel", 16, -0.5, 15.5);
604  h_trailNHitsBeforeVtx_[1][2] = iBooker.book1D(histname+"Endcap_Ass","vertex #chi^{2} endcap", 16, -0.5, 15.5);
605  h_trailNHitsBeforeVtx_[2][0] = iBooker.book1D(histname+"All_Fakes","vertex #chi^{2} all", 16, -0.5, 15.5);
606  h_trailNHitsBeforeVtx_[2][1] = iBooker.book1D(histname+"Barrel_Fakes","vertex #chi^{2} barrel", 16, -0.5, 15.5);
607  h_trailNHitsBeforeVtx_[2][2] = iBooker.book1D(histname+"Endcap_Fakes","vertex #chi^{2} endcap", 16, -0.5, 15.5);
608 
609  histname="sumNHitsBeforeVtx";
610  h_sumNHitsBeforeVtx_[0][0] = iBooker.book1D(histname+"All","vertex #chi^{2} all", 16, -0.5, 15.5);
611  h_sumNHitsBeforeVtx_[0][1] = iBooker.book1D(histname+"Barrel","vertex #chi^{2} barrel", 16, -0.5, 15.5);
612  h_sumNHitsBeforeVtx_[0][2] = iBooker.book1D(histname+"Endcap","vertex #chi^{2} endcap", 16, -0.5, 15.5);
613  h_sumNHitsBeforeVtx_[1][0] = iBooker.book1D(histname+"All_Ass","vertex #chi^{2} all", 16, -0.5, 15.5);
614  h_sumNHitsBeforeVtx_[1][1] = iBooker.book1D(histname+"Barrel_Ass","vertex #chi^{2} barrel", 16, -0.5, 15.5);
615  h_sumNHitsBeforeVtx_[1][2] = iBooker.book1D(histname+"Endcap_Ass","vertex #chi^{2} endcap", 16, -0.5, 15.5);
616  h_sumNHitsBeforeVtx_[2][0] = iBooker.book1D(histname+"All_Fakes","vertex #chi^{2} all", 16, -0.5, 15.5);
617  h_sumNHitsBeforeVtx_[2][1] = iBooker.book1D(histname+"Barrel_Fakes","vertex #chi^{2} barrel", 16, -0.5, 15.5);
618  h_sumNHitsBeforeVtx_[2][2] = iBooker.book1D(histname+"Endcap_Fakes","vertex #chi^{2} endcap", 16, -0.5, 15.5);
619 
620  histname="maxDlClosestHitToVtx";
621  h_maxDlClosestHitToVtx_[0][0] = iBooker.book1D(histname+"All","vertex #chi^{2} all", 100, -10., 10.);
622  h_maxDlClosestHitToVtx_[0][1] = iBooker.book1D(histname+"Barrel","vertex #chi^{2} barrel", 100, -10., 10.);
623  h_maxDlClosestHitToVtx_[0][2] = iBooker.book1D(histname+"Endcap","vertex #chi^{2} endcap", 100, -10., 10.);
624  h_maxDlClosestHitToVtx_[1][0] = iBooker.book1D(histname+"All_Ass","vertex #chi^{2} all", 100, -10., 10.);
625  h_maxDlClosestHitToVtx_[1][1] = iBooker.book1D(histname+"Barrel_Ass","vertex #chi^{2} barrel", 100, -10., 10.);
626  h_maxDlClosestHitToVtx_[1][2] = iBooker.book1D(histname+"Endcap_Ass","vertex #chi^{2} endcap", 100, -10., 10.);
627  h_maxDlClosestHitToVtx_[2][0] = iBooker.book1D(histname+"All_Fakes","vertex #chi^{2} all", 100, -10., 10.);
628  h_maxDlClosestHitToVtx_[2][1] = iBooker.book1D(histname+"Barrel_Fakes","vertex #chi^{2} barrel", 100, -10., 10.);
629  h_maxDlClosestHitToVtx_[2][2] = iBooker.book1D(histname+"Endcap_Fakes","vertex #chi^{2} endcap", 100, -10., 10.);
630 
631  histname="maxDlClosestHitToVtxSig";
632  h_maxDlClosestHitToVtxSig_[0][0] = iBooker.book1D(histname+"All","vertex #chi^{2} all", 100, -8., 8.);
633  h_maxDlClosestHitToVtxSig_[0][1] = iBooker.book1D(histname+"Barrel","vertex #chi^{2} barrel", 100, -8., 8.);
634  h_maxDlClosestHitToVtxSig_[0][2] = iBooker.book1D(histname+"Endcap","vertex #chi^{2} endcap", 100, -8., 8.);
635  h_maxDlClosestHitToVtxSig_[1][0] = iBooker.book1D(histname+"All_Ass","vertex #chi^{2} all", 100, -8., 8.);
636  h_maxDlClosestHitToVtxSig_[1][1] = iBooker.book1D(histname+"Barrel_Ass","vertex #chi^{2} barrel", 100, -8., 8.);
637  h_maxDlClosestHitToVtxSig_[1][2] = iBooker.book1D(histname+"Endcap_Ass","vertex #chi^{2} endcap", 100, -8., 8.);
638  h_maxDlClosestHitToVtxSig_[2][0] = iBooker.book1D(histname+"All_Fakes","vertex #chi^{2} all", 100, -8., 8.);
639  h_maxDlClosestHitToVtxSig_[2][1] = iBooker.book1D(histname+"Barrel_Fakes","vertex #chi^{2} barrel", 100, -8., 8.);
640  h_maxDlClosestHitToVtxSig_[2][2] = iBooker.book1D(histname+"Endcap_Fakes","vertex #chi^{2} endcap", 100, -8., 8.);
641 
642  histname="deltaExpectedHitsInner";
643  h_deltaExpectedHitsInner_[0][0] = iBooker.book1D(histname+"All","vertex #chi^{2} all", 31, -15.5, 15.5);
644  h_deltaExpectedHitsInner_[0][1] = iBooker.book1D(histname+"Barrel","vertex #chi^{2} barrel", 31, -15.5, 15.5);
645  h_deltaExpectedHitsInner_[0][2] = iBooker.book1D(histname+"Endcap","vertex #chi^{2} endcap", 31, -15.5, 15.5);
646  h_deltaExpectedHitsInner_[1][0] = iBooker.book1D(histname+"All_Ass","vertex #chi^{2} all", 31, -15.5, 15.5);
647  h_deltaExpectedHitsInner_[1][1] = iBooker.book1D(histname+"Barrel_Ass","vertex #chi^{2} barrel", 31, -15.5, 15.5);
648  h_deltaExpectedHitsInner_[1][2] = iBooker.book1D(histname+"Endcap_Ass","vertex #chi^{2} endcap", 31, -15.5, 15.5);
649  h_deltaExpectedHitsInner_[2][0] = iBooker.book1D(histname+"All_Fakes","vertex #chi^{2} all", 31, -15.5, 15.5);
650  h_deltaExpectedHitsInner_[2][1] = iBooker.book1D(histname+"Barrel_Fakes","vertex #chi^{2} barrel", 31, -15.5, 15.5);
651  h_deltaExpectedHitsInner_[2][2] = iBooker.book1D(histname+"Endcap_Fakes","vertex #chi^{2} endcap", 31, -15.5, 15.5);
652 
653  histname="leadExpectedHitsInner";
654  h_leadExpectedHitsInner_[0][0] = iBooker.book1D(histname+"All","vertex #chi^{2} all", 16, -0.5, 15.5);
655  h_leadExpectedHitsInner_[0][1] = iBooker.book1D(histname+"Barrel","vertex #chi^{2} barrel", 16, -0.5, 15.5);
656  h_leadExpectedHitsInner_[0][2] = iBooker.book1D(histname+"Endcap","vertex #chi^{2} endcap", 16, -0.5, 15.5);
657  h_leadExpectedHitsInner_[1][0] = iBooker.book1D(histname+"All_Ass","vertex #chi^{2} all", 16, -0.5, 15.5);
658  h_leadExpectedHitsInner_[1][1] = iBooker.book1D(histname+"Barrel_Ass","vertex #chi^{2} barrel", 16, -0.5, 15.5);
659  h_leadExpectedHitsInner_[1][2] = iBooker.book1D(histname+"Endcap_Ass","vertex #chi^{2} endcap", 16, -0.5, 15.5);
660  h_leadExpectedHitsInner_[2][0] = iBooker.book1D(histname+"All_Fakes","vertex #chi^{2} all", 16, -0.5, 15.5);
661  h_leadExpectedHitsInner_[2][1] = iBooker.book1D(histname+"Barrel_Fakes","vertex #chi^{2} barrel", 16, -0.5, 15.5);
662  h_leadExpectedHitsInner_[2][2] = iBooker.book1D(histname+"Endcap_Fakes","vertex #chi^{2} endcap", 16, -0.5, 15.5);
663 
664  histname="nSharedHits";
665  h_nSharedHits_[0][0] = iBooker.book1D(histname+"All","vertex #chi^{2} all", 16, -0.5, 15.5);
666  h_nSharedHits_[0][1] = iBooker.book1D(histname+"Barrel","vertex #chi^{2} barrel", 16, -0.5, 15.5);
667  h_nSharedHits_[0][2] = iBooker.book1D(histname+"Endcap","vertex #chi^{2} endcap", 16, -0.5, 15.5);
668  h_nSharedHits_[1][0] = iBooker.book1D(histname+"All_Ass","vertex #chi^{2} all", 16, -0.5, 15.5);
669  h_nSharedHits_[1][1] = iBooker.book1D(histname+"Barrel_Ass","vertex #chi^{2} barrel", 16, -0.5, 15.5);
670  h_nSharedHits_[1][2] = iBooker.book1D(histname+"Endcap_Ass","vertex #chi^{2} endcap", 16, -0.5, 15.5);
671  h_nSharedHits_[2][0] = iBooker.book1D(histname+"All_Fakes","vertex #chi^{2} all", 16, -0.5, 15.5);
672  h_nSharedHits_[2][1] = iBooker.book1D(histname+"Barrel_Fakes","vertex #chi^{2} barrel", 16, -0.5, 15.5);
673  h_nSharedHits_[2][2] = iBooker.book1D(histname+"Endcap_Fakes","vertex #chi^{2} endcap", 16, -0.5, 15.5);
674 
676  histname="nHits";
677  nHits_[0] = iBooker.book2D(histname+"AllTracks","Photons:Tracks from conversions: # of hits all tracks",etaBin,etaMin, etaMax,30,0., 30.);
678  nHits_[1] = iBooker.book2D(histname+"AllTracks_Ass","Photons:Tracks from conversions: # of hits all tracks ass",etaBin,etaMin, etaMax,30,0., 30.);
679  nHits_[2] = iBooker.book2D(histname+"AllTracks_Fakes","Photons:Tracks from conversions: # of hits all tracks fakes",etaBin,etaMin, etaMax,30,0., 30.);
680 
681 
682  histname="nHitsVsEta";
683  nHitsVsEta_[0] = iBooker.book2D(histname+"AllTracks","Photons:Tracks from conversions: # of hits vs #eta all tracks",etaBin,etaMin, etaMax,30,0., 30.);
684  nHitsVsEta_[1] = iBooker.book2D(histname+"AllTracks_Ass","Photons:Tracks from conversions: # of hits vs #eta all tracks",etaBin,etaMin, etaMax,30,0., 30.);
685  nHitsVsEta_[2] = iBooker.book2D(histname+"AllTracks_Fakes","Photons:Tracks from conversions: # of hits vs #eta all tracks",etaBin,etaMin, etaMax,30,0., 30.);
686  histname="h_nHitsVsEta";
687  p_nHitsVsEta_[0] = iBooker.bookProfile(histname+"AllTracks","Photons:Tracks from conversions: # of hits vs #eta all tracks",etaBin,etaMin, etaMax, 30,-0.5, 29.5,"");
688  p_nHitsVsEta_[1] = iBooker.bookProfile(histname+"AllTracks_Ass","Photons:Tracks from conversions: # of hits vs #eta all tracks",etaBin,etaMin, etaMax, 30,-0.5, 29.5,"");
689  p_nHitsVsEta_[2] = iBooker.bookProfile(histname+"AllTracks_Fakes","Photons:Tracks from conversions: # of hits vs #eta all tracks",etaBin,etaMin, etaMax, 30,-0.5, 29.5,"");
690 
691 
692  histname="nHitsVsR";
693  nHitsVsR_[0] = iBooker.book2D(histname+"AllTracks","Photons:Tracks from conversions: # of hits vs radius all tracks" ,rBin,rMin, rMax,30,0., 30.);
694  nHitsVsR_[1] = iBooker.book2D(histname+"AllTracks_Ass","Photons:Tracks from conversions: # of hits vs radius all tracks" ,rBin,rMin, rMax,30,0., 30.);
695  nHitsVsR_[2] = iBooker.book2D(histname+"AllTracks_Fakes","Photons:Tracks from conversions: # of hits vs radius all tracks" ,rBin,rMin, rMax,30,0., 30.);
696 
697  histname="h_nHitsVsR";
698  p_nHitsVsR_[0] = iBooker.bookProfile(histname+"AllTracks","Photons:Tracks from conversions: # of hits vs radius all tracks",rBin,rMin, rMax, 30,-0.5, 29.5,"");
699  p_nHitsVsR_[1] = iBooker.bookProfile(histname+"AllTracks_Ass","Photons:Tracks from conversions: # of hits vs radius all tracks",rBin,rMin, rMax, 30,-0.5, 29.5,"");
700  p_nHitsVsR_[2] = iBooker.bookProfile(histname+"AllTracks_Fakes","Photons:Tracks from conversions: # of hits vs radius all tracks",rBin,rMin, rMax, 30,-0.5, 29.5,"");
701 
702  histname="tkChi2";
703  h_tkChi2_[0] = iBooker.book1D(histname+"AllTracks","Photons:Tracks from conversions: #chi^{2} of all tracks", 100, chi2Min, chi2Max);
704  h_tkChi2_[1] = iBooker.book1D(histname+"AllTracks_Ass","Photons:Tracks from conversions: #chi^{2} of all tracks", 100, chi2Min, chi2Max);
705  h_tkChi2_[2] = iBooker.book1D(histname+"AllTracks_Fakes","Photons:Tracks from conversions: #chi^{2} of all tracks", 100, chi2Min, chi2Max);
706 
707  histname="tkChi2Large";
708  h_tkChi2Large_[0] = iBooker.book1D(histname+"AllTracks","Photons:Tracks from conversions: #chi^{2} of all tracks", 1000, 0., 5000.0);
709  h_tkChi2Large_[1] = iBooker.book1D(histname+"AllTracks_Ass","Photons:Tracks from conversions: #chi^{2} of all tracks", 1000, 0., 5000.0);
710  h_tkChi2Large_[2] = iBooker.book1D(histname+"AllTracks_Fakes","Photons:Tracks from conversions: #chi^{2} of all tracks", 1000, 0., 5000.0);
711 
712 
713  histname="h2Chi2VsEta";
714  h2_Chi2VsEta_[0]=iBooker.book2D(histname+"All"," Reco Track #chi^{2} vs #eta: All ",etaBin2,etaMin, etaMax,100, chi2Min, chi2Max);
715  h2_Chi2VsEta_[1]=iBooker.book2D(histname+"All_Ass"," Reco Track #chi^{2} vs #eta: All ",etaBin2,etaMin, etaMax,100, chi2Min, chi2Max);
716  h2_Chi2VsEta_[2]=iBooker.book2D(histname+"All_Fakes"," Reco Track #chi^{2} vs #eta: All ",etaBin2,etaMin, etaMax,100, chi2Min, chi2Max);
717  histname="pChi2VsEta";
718  p_Chi2VsEta_[0]=iBooker.bookProfile(histname+"All"," Reco Track #chi^{2} vs #eta : All ",etaBin2,etaMin, etaMax, 100, chi2Min, chi2Max,"");
719  p_Chi2VsEta_[1]=iBooker.bookProfile(histname+"All_Ass"," Reco Track #chi^{2} vs #eta : All ",etaBin2,etaMin, etaMax, 100, chi2Min, chi2Max,"");
720  p_Chi2VsEta_[2]=iBooker.bookProfile(histname+"All_Fakes"," Reco Track #chi^{2} vs #eta : All ",etaBin2,etaMin, etaMax, 100, chi2Min, chi2Max,"");
721 
722  histname="h2Chi2VsR";
723  h2_Chi2VsR_[0]=iBooker.book2D(histname+"All"," Reco Track #chi^{2} vs R: All ",rBin,rMin, rMax,100,chi2Min, chi2Max);
724  h2_Chi2VsR_[1]=iBooker.book2D(histname+"All_Ass"," Reco Track #chi^{2} vs R: All ",rBin,rMin, rMax,100,chi2Min, chi2Max);
725  h2_Chi2VsR_[2]=iBooker.book2D(histname+"All_Fakes"," Reco Track #chi^{2} vs R: All ",rBin,rMin, rMax,100,chi2Min, chi2Max);
726  histname="pChi2VsR";
727  p_Chi2VsR_[0]=iBooker.bookProfile(histname+"All"," Reco Track #chi^{2} vas R : All ",rBin,rMin,rMax, 100,chi2Min, chi2Max,"");
728  p_Chi2VsR_[1]=iBooker.bookProfile(histname+"All_Ass"," Reco Track #chi^{2} vas R : All ",rBin,rMin,rMax, 100,chi2Min, chi2Max,"");
729  p_Chi2VsR_[2]=iBooker.bookProfile(histname+"All_Fakes"," Reco Track #chi^{2} vas R : All ",rBin,rMin,rMax, 100,chi2Min, chi2Max,"");
730 
731  histname="hTkD0";
732  h_TkD0_[0]=iBooker.book1D(histname+"All"," Reco Track D0*q: All ",200,-0.1,60);
733  h_TkD0_[1]=iBooker.book1D(histname+"All_Ass"," Reco Track D0*q: Barrel ",200,-0.1,60);
734  h_TkD0_[2]=iBooker.book1D(histname+"All_Fakes"," Reco Track D0*q: Endcap ",200,-0.1,60);
735 
736 
737 
738  histname="hTkPtPull";
739  h_TkPtPull_[0]=iBooker.book1D(histname+"All"," Reco Track Pt pull: All ",100, -20., 10.);
740  histname="hTkPtPull";
741  h_TkPtPull_[1]=iBooker.book1D(histname+"Barrel"," Reco Track Pt pull: Barrel ",100, -20., 10.);
742  histname="hTkPtPull";
743  h_TkPtPull_[2]=iBooker.book1D(histname+"Endcap"," Reco Track Pt pull: Endcap ",100, -20., 10.);
744 
745  histname="h2TkPtPullEta";
746  h2_TkPtPull_[0]=iBooker.book2D(histname+"All"," Reco Track Pt pull: All ",etaBin2,etaMin, etaMax,100, -20., 10.);
747  histname="pTkPtPullEta";
748  p_TkPtPull_[0]=iBooker.bookProfile(histname+"All"," Reco Track Pt pull: All ",etaBin2,etaMin, etaMax, 100, -20., 10., " ");
749 
750 
751  histname="PtRecVsPtSim";
752  h2_PtRecVsPtSim_[0]=iBooker.book2D(histname+"All", "Pt Rec vs Pt sim: All ", etBin,etMin,etMax,etBin,etMin, etMax);
753  h2_PtRecVsPtSim_[1]=iBooker.book2D(histname+"Barrel", "Pt Rec vs Pt sim: Barrel ", etBin,etMin,etMax,etBin,etMin, etMax);
754  h2_PtRecVsPtSim_[2]=iBooker.book2D(histname+"Endcap", "Pt Rec vs Pt sim: Endcap ", etBin,etMin,etMax,etBin,etMin, etMax);
755 
756  histname="photonPtRecVsPtSim";
757  h2_photonPtRecVsPtSim_=iBooker.book2D(histname+"All", "Pt Rec vs Pt sim: All ", etBin,etMin,etMax,etBin,etMin, etMax);
758 
759  histname="nHitsBeforeVtx";
760  h_nHitsBeforeVtx_[0]=iBooker.book1D(histname+"All", "Pt Rec vs Pt sim: All ", 16, -0.5, 15.5);
761  h_nHitsBeforeVtx_[1]=iBooker.book1D(histname+"Barrel", "Pt Rec vs Pt sim: Barrel ", 16, -0.5, 15.5);
762  h_nHitsBeforeVtx_[2]=iBooker.book1D(histname+"Endcap", "Pt Rec vs Pt sim: Endcap ", 16, -0.5, 15.5);
763 
764  histname="dlClosestHitToVtx";
765  h_dlClosestHitToVtx_[0]=iBooker.book1D(histname+"All", "Pt Rec vs Pt sim: All ", 100, -10., 10.);
766  h_dlClosestHitToVtx_[1]=iBooker.book1D(histname+"Barrel", "Pt Rec vs Pt sim: Barrel ", 100, -10., 10.);
767  h_dlClosestHitToVtx_[2]=iBooker.book1D(histname+"Endcap", "Pt Rec vs Pt sim: Endcap ", 100, -10., 10.);
768 
769  histname="dlClosestHitToVtxSig";
770  h_dlClosestHitToVtxSig_[0]=iBooker.book1D(histname+"All", "Pt Rec vs Pt sim: All ", 100, -8., 8.);
771  h_dlClosestHitToVtxSig_[1]=iBooker.book1D(histname+"Barrel", "Pt Rec vs Pt sim: Barrel ", 100, -8., 8.);
772  h_dlClosestHitToVtxSig_[2]=iBooker.book1D(histname+"Endcap", "Pt Rec vs Pt sim: Endcap ", 100, -8., 8.);
773 
774  h_match_= iBooker.book1D("h_match"," ", 3, -0.5,2.5);
775 
776 
777  } // if DQM
778 
779 
780 
781 }
782 
783 
784 
785  void TkConvValidator::dqmBeginRun (edm::Run const & r, edm::EventSetup const & theEventSetup) {
786 
787  //get magnetic field
788  edm::LogInfo("ConvertedPhotonProducer") << " get magnetic field" << "\n";
789  theEventSetup.get<IdealMagneticFieldRecord>().get(theMF_);
790 
791 
792  edm::ESHandle<TrackAssociatorBase> theHitsAssociator;
793  theEventSetup.get<TrackAssociatorRecord>().get("trackAssociatorByHitsForConversionValidation",theHitsAssociator);
794  theTrackAssociator_ = (TrackAssociatorBase *) theHitsAssociator.product();
795 
796 
797 
798 
799  thePhotonMCTruthFinder_ = new PhotonMCTruthFinder();
800 
801 }
802 
803 void TkConvValidator::endRun (edm::Run& r, edm::EventSetup const & theEventSetup) {
804 
805  delete thePhotonMCTruthFinder_;
806 
807 }
808 
809 
810 
812  thePhotonMCTruthFinder_->clear();
813  using namespace edm;
814  // const float etaPhiDistance=0.01;
815  // Fiducial region
816  // const float TRK_BARL =0.9;
817  const float BARL = 1.4442; // DAQ TDR p.290
818  // const float END_LO = 1.566; // unused
819  const float END_HI = 2.5;
820  // Electron mass
821  // const Float_t mElec= 0.000511; // unused
822 
823 
824  nEvt_++;
825  LogInfo("TkConvValidator") << "TkConvValidator Analyzing event number: " << e.id() << " Global Counter " << nEvt_ <<"\n";
826  // std::cout << "TkConvValidator Analyzing event number: " << e.id() << " Global Counter " << nEvt_ <<"\n";
827 
828 
829  // get the geometry from the event setup:
830  esup.get<CaloGeometryRecord>().get(theCaloGeom_);
831 
832 
833  // Transform Track into TransientTrack (needed by the Vertex fitter)
835  esup.get<TransientTrackRecord>().get("TransientTrackBuilder",theTTB);
836 
837 
840  e.getByToken(conversionCollectionPr_Token_, convHandle);
841  const reco::ConversionCollection convCollection = *(convHandle.product());
842  if (!convHandle.isValid()) {
843  edm::LogError("ConversionsProducer") << "Error! Can't get the collection "<< std::endl;
844  return;
845  }
846 
848  Handle<reco::PhotonCollection> photonHandle;
849  e.getByToken(photonCollectionPr_Token_, photonHandle);
850  const reco::PhotonCollection photonCollection = *(photonHandle.product());
851  if (!photonHandle.isValid()) {
852  edm::LogError("PhotonProducer") << "Error! Can't get the Photon collection "<< std::endl;
853  return;
854  }
855 
856 
857  // offline Primary vertex
860  e.getByToken(offline_pvToken_, vertexHandle);
861  if (!vertexHandle.isValid()) {
862  edm::LogError("TrackerOnlyConversionProducer") << "Error! Can't get the product primary Vertex Collection "<< "\n";
863  } else {
864  vertexCollection = *(vertexHandle.product());
865  }
866  reco::Vertex the_pvtx;
867  bool valid_pvtx = false;
868  if (!vertexCollection.empty()){
869  the_pvtx = *(vertexCollection.begin());
870  //asking for one good vertex
871  if (the_pvtx.isValid() && fabs(the_pvtx.position().z())<=15 && the_pvtx.position().Rho()<=2){
872  valid_pvtx = true;
873  }
874  }
875 
877  e.getByToken(beamspotToken_, bsHandle);
878  if (!bsHandle.isValid()) {
879  edm::LogError("TrackerOnlyConversionProducer")
880  << "Error! Can't get the product primary Vertex Collection "<< "\n";
881  return;
882  }
883  const reco::BeamSpot &thebs = *bsHandle.product();
884 
885  //get tracker geometry for hits positions
888  const TrackerGeometry* trackerGeom = tracker.product();
889 
890 
891 
893  //get simtrack info
894  std::vector<SimTrack> theSimTracks;
895  std::vector<SimVertex> theSimVertices;
896 
899  e.getByToken(g4_simTk_Token_, SimTk);
900  e.getByToken(g4_simVtx_Token_, SimVtx);
901 
902  bool useTP = parameters_.getParameter<bool>("useTP");
903  TrackingParticleCollection tpForEfficiency;
904  TrackingParticleCollection tpForFakeRate;
906  edm::Handle<TrackingParticleCollection> TPHandleForFakeRate;
907  if (useTP) {
908  e.getByToken(tpSelForEff_Token_, TPHandleForEff);
909  tpForEfficiency = *(TPHandleForEff.product());
910  e.getByToken(tpSelForFake_Token_, TPHandleForFakeRate);
911  tpForFakeRate = *(TPHandleForFakeRate.product());
912  }
913 
914 
915 
916  theSimTracks.insert(theSimTracks.end(),SimTk->begin(),SimTk->end());
917  theSimVertices.insert(theSimVertices.end(),SimVtx->begin(),SimVtx->end());
918  std::vector<PhotonMCTruth> mcPhotons=thePhotonMCTruthFinder_->find (theSimTracks, theSimVertices);
919 
921  e.getByToken(hepMC_Token_, hepMC);
922  // const HepMC::GenEvent *myGenEvent = hepMC->GetEvent(); // unused
923 
924 
925  // get generated jets
927  e.getByToken(genjets_Token_, GenJetsHandle);
928  reco::GenJetCollection genJetCollection = *(GenJetsHandle.product());
929 
930  ConversionHitChecker hitChecker;
931 
932  // ################ SIM to RECO ######################### //
933  std::map<const reco::Track*,TrackingParticleRef> myAss;
934  std::map<const reco::Track*,TrackingParticleRef>::const_iterator itAss;
935 
936  for ( std::vector<PhotonMCTruth>::const_iterator mcPho=mcPhotons.begin(); mcPho !=mcPhotons.end(); mcPho++) {
937 
938  mcConvPt_= (*mcPho).fourMomentum().et();
939  float mcPhi= (*mcPho).fourMomentum().phi();
940  mcPhi_= phiNormalization(mcPhi);
941  mcEta_= (*mcPho).fourMomentum().pseudoRapidity();
942  mcEta_ = etaTransformation(mcEta_, (*mcPho).primaryVertex().z() );
943  mcConvR_= (*mcPho).vertex().perp();
944  mcConvX_= (*mcPho).vertex().x();
945  mcConvY_= (*mcPho).vertex().y();
946  mcConvZ_= (*mcPho).vertex().z();
947  mcConvEta_= (*mcPho).vertex().eta();
948  mcConvPhi_= (*mcPho).vertex().phi();
949 
950  if ( fabs(mcEta_) > END_HI ) continue;
951 
952  if (mcConvPt_<minPhoPtForEffic) continue;
953  if (fabs(mcEta_)>maxPhoEtaForEffic) continue;
954  if (fabs(mcConvZ_)>maxPhoZForEffic) continue;
955  if (mcConvR_>maxPhoRForEffic) continue;
957 
958  bool goodSimConversion=false;
959  bool visibleConversion=false;
960  bool visibleConversionsWithTwoSimTracks=false;
961  if ( (*mcPho).isAConversion() == 1 ) {
962  nSimConv_[0]++;
963  h_AllSimConv_[0]->Fill( mcEta_ ) ;
964  h_AllSimConv_[1]->Fill( mcPhi_ );
965  h_AllSimConv_[2]->Fill( mcConvR_ );
966  h_AllSimConv_[3]->Fill( mcConvZ_ );
967  h_AllSimConv_[4]->Fill( (*mcPho).fourMomentum().et());
968 
969  if ( mcConvR_ <15) h_SimConvEtaPix_[0]->Fill( mcEta_ ) ;
970 
971  if ( ( fabs(mcEta_) <= BARL && mcConvR_ <85 ) ||
972  ( fabs(mcEta_) > BARL && fabs(mcEta_) <=END_HI && fabs( (*mcPho).vertex().z() ) < 210 ) ) visibleConversion=true;
973 
974  theConvTP_.clear();
975  // std::cout << " TkConvValidator TrackingParticles TrackingParticleCollection size "<< trackingParticles.size() << "\n";
976  //duplicated TP collections for two associations
977  for(size_t i = 0; i < tpForEfficiency.size(); ++i){
978  TrackingParticleRef tp (TPHandleForEff,i);
979  if ( fabs( tp->vx() - (*mcPho).vertex().x() ) < 0.0001 &&
980  fabs( tp->vy() - (*mcPho).vertex().y() ) < 0.0001 &&
981  fabs( tp->vz() - (*mcPho).vertex().z() ) < 0.0001) {
982  theConvTP_.push_back( tp );
983  }
984  }
985  //std::cout << " TkConvValidator theConvTP_ size " << theConvTP_.size() << std::endl;
986 
987  if ( theConvTP_.size() == 2 ) visibleConversionsWithTwoSimTracks=true;
988  goodSimConversion=false;
989 
990  if ( visibleConversion && visibleConversionsWithTwoSimTracks ) goodSimConversion=true;
991  if ( goodSimConversion ) {
992  nSimConv_[1]++;
993  h_VisSimConv_[0]->Fill( mcEta_ ) ;
994  h_VisSimConv_[1]->Fill( mcPhi_ );
995  h_VisSimConv_[2]->Fill( mcConvR_ );
996  h_VisSimConv_[3]->Fill( mcConvZ_ );
997  h_VisSimConv_[4]->Fill( (*mcPho).fourMomentum().et());
998 
999  }
1000 
1001  for ( edm::RefVector<TrackingParticleCollection>::iterator iTrk=theConvTP_.begin(); iTrk!=theConvTP_.end(); ++iTrk) {
1002  h_simTkPt_ -> Fill ( (*iTrk)->pt() );
1003  h_simTkEta_ -> Fill ( (*iTrk)->eta() );
1004  }
1005 
1006 
1007  }
1008 
1009  if ( ! (visibleConversion && visibleConversionsWithTwoSimTracks ) ) continue;
1010 
1011  h_simConvVtxRvsZ_[0] ->Fill ( fabs (mcConvZ_), mcConvR_ ) ;
1012  if ( fabs(mcEta_) <=1.) {
1013  h_simConvVtxRvsZ_[1] ->Fill ( fabs (mcConvZ_), mcConvR_ ) ;
1014  h_simConvVtxYvsX_ ->Fill ( mcConvX_, mcConvY_ ) ;
1015  }
1016  else
1017  h_simConvVtxRvsZ_[2] ->Fill ( fabs (mcConvZ_), mcConvR_ ) ;
1018 
1019  //std::cout << " TkConvValidator theConvTP_ size " << theConvTP_.size() << std::endl;
1020  for ( edm::RefVector<TrackingParticleCollection>::iterator iTP= theConvTP_.begin(); iTP!=theConvTP_.end(); iTP++)
1021  {
1022  // std::cout << " SIM to RECO TP vertex " << (*iTP)->vx() << " " << (*iTP)->vy() << " " << (*iTP)->vz() << " pt " << (*iTP)->pt() << std::endl;
1023  }
1024 
1025  bool recomatch = false;
1026  float chi2Prob = 0.;
1028  // cout << " size of conversions " << convHandle->size() << endl;
1029  for (reco::ConversionCollection::const_iterator conv = convHandle->begin();conv!=convHandle->end();++conv) {
1030 
1031  const reco::Conversion aConv = (*conv);
1032  if ( arbitratedMerged_ && !aConv.quality(reco::Conversion::arbitratedMerged) ) continue;
1033  if ( generalTracksOnly_ && !aConv.quality(reco::Conversion::generalTracksOnly) ) continue;
1034  if ( arbitratedEcalSeeded_ && !aConv.quality(reco::Conversion::arbitratedEcalSeeded) ) continue;
1035 
1036 
1037  if ( highPurity_ && !aConv.quality(reco::Conversion::highPurity) ) continue;
1038 
1039  //problematic?
1040  std::vector<edm::RefToBase<reco::Track> > tracks = aConv.tracks();
1041 
1042 
1043  const reco::Vertex& vtx = aConv.conversionVertex();
1044  //requires two tracks and a valid vertex
1045  if (tracks.size() !=2 || !(vtx.isValid())) continue;
1046 
1047 
1048  if (ChiSquaredProbability( aConv.conversionVertex().chi2(), aConv.conversionVertex().ndof() ) <= minProb_) continue;
1049  if (aConv.nHitsBeforeVtx().size()>1 && max(aConv.nHitsBeforeVtx().at(0),aConv.nHitsBeforeVtx().at(1)) > maxHitsBeforeVtx_ ) continue;
1050 
1051 
1052  //compute transverse decay length with respect to beamspot
1053  math::XYZVectorF themom = aConv.refittedPairMomentum();
1054  double dbsx = aConv.conversionVertex().x() - thebs.x0();
1055  double dbsy = aConv.conversionVertex().y() - thebs.y0();
1056  double lxy = (themom.x()*dbsx + themom.y()*dbsy)/themom.rho();
1057 
1058  if (lxy<minLxy_) continue;
1059 
1060  // bool phoIsInBarrel=false; // unused
1061  // bool phoIsInEndcap=false; // unused
1062  RefToBase<reco::Track> tfrb1 = aConv.tracks().front();
1063  RefToBase<reco::Track> tfrb2 = aConv.tracks().back();
1064 
1065  if ( ecalalgotracks_ && ( !(tfrb1->algo()==15 || tfrb1->algo()==16) || !(tfrb2->algo()==15 || tfrb2->algo()==16) ) ) continue;
1066 
1067 
1068  //reco::TrackRef tk1 = aConv.tracks().front();
1069  //reco::TrackRef tk2 = aConv.tracks().back();
1070  //std::cout << "SIM to RECO conversion track pt " << tk1->pt() << " " << tk2->pt() << endl;
1071  //
1072  //Use two RefToBaseVector and do two association actions to avoid that if two tracks from different collection
1074  tc1.push_back(tfrb1);
1075  tc2.push_back(tfrb2);
1076  bool isAssociated = false;
1077  reco::SimToRecoCollection q1 = theTrackAssociator_->associateSimToReco(tc1,theConvTP_,&e,&esup);
1078  reco::SimToRecoCollection q2 = theTrackAssociator_->associateSimToReco(tc2,theConvTP_,&e,&esup);
1079  //try {
1080  std::vector<std::pair<RefToBase<reco::Track>, double> > trackV1, trackV2;
1081 
1082  int tp_1 = 0, tp_2 = 1;//the index of associated tp in theConvTP_ for two tracks
1083  if (q1.find(theConvTP_[0])!=q1.end()){
1084  trackV1 = (std::vector<std::pair<RefToBase<reco::Track>, double> >) q1[theConvTP_[0]];
1085  } else if (q1.find(theConvTP_[1])!=q1.end()){
1086  trackV1 = (std::vector<std::pair<RefToBase<reco::Track>, double> >) q1[theConvTP_[1]];
1087  tp_1 = 1;
1088  }
1089  if (q2.find(theConvTP_[1])!=q2.end()){
1090  trackV2 = (std::vector<std::pair<RefToBase<reco::Track>, double> >) q2[theConvTP_[1]];
1091  } else if (q2.find(theConvTP_[0])!=q2.end()){
1092  trackV2 = (std::vector<std::pair<RefToBase<reco::Track>, double> >) q2[theConvTP_[0]];
1093  tp_2 = 0;
1094  }
1095  if (!(trackV1.size()&&trackV2.size()))
1096  continue;
1097  if (tp_1 == tp_2) continue;
1098 
1099  edm::RefToBase<reco::Track> tr1 = trackV1.front().first;
1100  edm::RefToBase<reco::Track> tr2 = trackV2.front().first;
1101  //std::cout << "associated tp1 " <<theConvTP_[0]->pt() << " to track with pT=" << tr1->pt() << " " << (tr1.get())->pt() << endl;
1102  //std::cout << "associated tp2 " <<theConvTP_[1]->pt() << " to track with pT=" << tr2->pt() << " " << (tr2.get())->pt() << endl;
1103  myAss.insert( std::make_pair (tr1.get(),theConvTP_[tp_1] ) );
1104  myAss.insert( std::make_pair (tr2.get(),theConvTP_[tp_2]) );
1105 
1106  //} catch (Exception event) {
1107  //cout << "continue: " << event.what() << endl;
1108  // continue;
1109  //}
1110 
1111 
1112  isAssociated = true;
1113  recomatch = true;
1114  chi2Prob = ChiSquaredProbability( aConv.conversionVertex().chi2(), aConv.conversionVertex().ndof() );
1115 
1116  if (isAssociated) {
1117  h_SimRecConvTwoMTracks_[0]->Fill( mcEta_ ) ;
1118  h_SimRecConvTwoMTracks_[1]->Fill( mcPhi_ );
1119  h_SimRecConvTwoMTracks_[2]->Fill( mcConvR_ );
1120  h_SimRecConvTwoMTracks_[3]->Fill( mcConvZ_ );
1121  h_SimRecConvTwoMTracks_[4]->Fill( (*mcPho).fourMomentum().et());
1122  }
1123 
1124  // break;
1125  } // loop over reco conversions
1126  if (recomatch) {
1128  h_SimConvTwoMTracks_[0]->Fill( mcEta_ ) ;
1129  h_SimConvTwoMTracks_[1]->Fill( mcPhi_ );
1130  h_SimConvTwoMTracks_[2]->Fill( mcConvR_ );
1131  h_SimConvTwoMTracks_[3]->Fill( mcConvZ_ );
1132  h_SimConvTwoMTracks_[4]->Fill( (*mcPho).fourMomentum().et());
1133 
1134 
1135  if ( chi2Prob > 0) {
1136  h_SimConvTwoMTracksAndVtxPGT0_[0]->Fill( mcEta_ ) ;
1137  h_SimConvTwoMTracksAndVtxPGT0_[1]->Fill( mcPhi_ );
1138  h_SimConvTwoMTracksAndVtxPGT0_[2]->Fill( mcConvR_ );
1139  h_SimConvTwoMTracksAndVtxPGT0_[3]->Fill( mcConvZ_ );
1140  h_SimConvTwoMTracksAndVtxPGT0_[4]->Fill( (*mcPho).fourMomentum().et());
1141  }
1142  if ( chi2Prob > 0.0005) {
1143  h_SimConvTwoMTracksAndVtxPGT0005_[0]->Fill( mcEta_ ) ;
1144  h_SimConvTwoMTracksAndVtxPGT0005_[1]->Fill( mcPhi_ );
1145  h_SimConvTwoMTracksAndVtxPGT0005_[2]->Fill( mcConvR_ );
1146  h_SimConvTwoMTracksAndVtxPGT0005_[3]->Fill( mcConvZ_ );
1147  h_SimConvTwoMTracksAndVtxPGT0005_[4]->Fill( (*mcPho).fourMomentum().et());
1148 
1149  }
1150  }
1151 
1152  } //End loop over simulated conversions
1153 
1154 
1155  // ########################### RECO to SIM ############################## //
1156 
1157  for (reco::ConversionCollection::const_iterator conv = convHandle->begin();conv!=convHandle->end();++conv) {
1158  const reco::Conversion aConv = (*conv);
1159  if ( arbitratedMerged_ && !aConv.quality(reco::Conversion::arbitratedMerged) ) continue;
1160  if ( generalTracksOnly_ && !aConv.quality(reco::Conversion::generalTracksOnly) ) continue;
1161  if ( arbitratedEcalSeeded_ && !aConv.quality(reco::Conversion::arbitratedEcalSeeded) ) continue;
1162 
1163 
1164  if ( highPurity_ && !aConv.quality(reco::Conversion::highPurity) ) continue;
1165 
1166  //problematic?
1167  std::vector<edm::RefToBase<reco::Track> > tracks = aConv.tracks();
1168 
1169  const reco::Vertex& vtx = aConv.conversionVertex();
1170  //requires two tracks and a valid vertex
1171  if (tracks.size() !=2 || !(vtx.isValid())) continue;
1172  //if (tracks.size() !=2) continue;
1173 
1174 
1175  if (ChiSquaredProbability( aConv.conversionVertex().chi2(), aConv.conversionVertex().ndof() ) <= minProb_) continue;
1176  if (aConv.nHitsBeforeVtx().size()>1 && max(aConv.nHitsBeforeVtx().at(0),aConv.nHitsBeforeVtx().at(1)) > maxHitsBeforeVtx_ ) continue;
1177 
1178  //compute transverse decay length with respect to beamspot
1179  math::XYZVectorF themom = aConv.refittedPairMomentum();
1180  double dbsx = aConv.conversionVertex().x() - thebs.x0();
1181  double dbsy = aConv.conversionVertex().y() - thebs.y0();
1182  double lxy = (themom.x()*dbsx + themom.y()*dbsy)/themom.rho();
1183 
1184  if (lxy<minLxy_) continue;
1185 
1186  bool phoIsInBarrel=false;
1187  bool phoIsInEndcap=false;
1188  RefToBase<reco::Track> tk1 = aConv.tracks().front();
1189  RefToBase<reco::Track> tk2 = aConv.tracks().back();
1191  tc1.push_back(tk1);
1192  tc2.push_back(tk2);
1193 
1194  if ( ecalalgotracks_ && ( !(tk1->algo()==15 || tk1->algo()==16) || !(tk2->algo()==15 || tk2->algo()==16) ) ) continue;
1195 
1196 
1197  //std::cout << " RECO to SIM conversion track pt " << tk1->pt() << " " << tk2->pt() << endl;
1198  const reco::Track refTk1 = aConv.conversionVertex().refittedTracks().front();
1199  const reco::Track refTk2 = aConv.conversionVertex().refittedTracks().back();
1200 
1201  //TODO replace it with phi at vertex
1202  float dPhiTracksAtVtx = aConv.dPhiTracksAtVtx();
1203  // override with the phi calculated at the vertex
1204  math::XYZVector p1AtVtx= recalculateMomentumAtFittedVertex ( (*theMF_), *trackerGeom, tk1, aConv.conversionVertex() );
1205  math::XYZVector p2AtVtx= recalculateMomentumAtFittedVertex ( (*theMF_), *trackerGeom, tk2, aConv.conversionVertex() );
1206  if ( sqrt(p1AtVtx.perp2()) > sqrt(p2AtVtx.perp2()) )
1207  dPhiTracksAtVtx = p1AtVtx.phi() - p2AtVtx.phi();
1208  else
1209  dPhiTracksAtVtx = p2AtVtx.phi() - p1AtVtx.phi();
1210 
1211 
1212  math::XYZVectorF refittedMom = aConv.refittedPairMomentum();
1213 
1214 
1215  if (fabs(refittedMom.eta())< 1.479 ) {
1216  phoIsInBarrel=true;
1217  } else {
1218  phoIsInEndcap=true;
1219  }
1220 
1221  nRecConv_++;
1222 
1223  // check matching with reco photon
1224  double Mindeltaeta = 999999;
1225  double Mindeltaphi = 999999;
1226  bool matchConvSC=false;
1227  reco::PhotonCollection::const_iterator iMatchingSC;
1228  for( reco::PhotonCollection::const_iterator iPho = photonCollection.begin(); iPho != photonCollection.end(); iPho++) {
1229  reco::Photon aPho = reco::Photon(*iPho);
1230  const double deltaphi= reco::deltaPhi( aConv.refittedPairMomentum().phi(), aPho.superCluster()->position().phi());
1231  double ConvEta = etaTransformation(aConv.refittedPairMomentum().eta(),aConv.zOfPrimaryVertexFromTracks());
1232  double deltaeta = abs( aPho.superCluster()->position().eta() -ConvEta);
1233  if (abs(deltaeta)<abs(Mindeltaeta) && abs(deltaphi)<abs(Mindeltaphi)) {
1234  Mindeltaphi=abs(deltaphi);
1235  Mindeltaeta=abs(deltaeta);
1236  iMatchingSC = iPho ;
1237  }
1238  }
1239  if (abs(Mindeltaeta)<0.1 && abs(Mindeltaphi)<0.1) {
1240  matchConvSC=true;
1241  }
1242 
1243 
1245  int match =0;
1246  float invM=aConv.pairInvariantMass();
1247  float chi2Prob = ChiSquaredProbability( aConv.conversionVertex().chi2(), aConv.conversionVertex().ndof() );
1248  uint maxNHitsBeforeVtx = aConv.nHitsBeforeVtx().size()>1 ? max(aConv.nHitsBeforeVtx().at(0),aConv.nHitsBeforeVtx().at(1)) : 0;
1249  uint sumNHitsBeforeVtx = aConv.nHitsBeforeVtx().size()>1 ? aConv.nHitsBeforeVtx().at(0) + aConv.nHitsBeforeVtx().at(1) : 0;
1250  float maxDlClosestHitToVtx = aConv.dlClosestHitToVtx().size()>1 ? max(aConv.dlClosestHitToVtx().at(0).value(),aConv.dlClosestHitToVtx().at(1).value()) : 0;
1251  float maxDlClosestHitToVtxSig = aConv.dlClosestHitToVtx().size()>1 ? max(aConv.dlClosestHitToVtx().at(0).value()/aConv.dlClosestHitToVtx().at(0).error(),aConv.dlClosestHitToVtx().at(1).value()/aConv.dlClosestHitToVtx().at(1).error()) : 0;
1252 
1253  int ilead = 0, itrail = 1;
1254  if (tk2->pt() > tk1->pt()) {
1255  ilead = 1;
1256  itrail = 0;
1257  }
1258  RefToBase<reco::Track> tklead = aConv.tracks().at(ilead);
1259  RefToBase<reco::Track> tktrail = aConv.tracks().at(itrail);
1260 
1261  int deltaExpectedHitsInner = tklead->hitPattern().numberOfHits(reco::HitPattern::MISSING_INNER_HITS)
1263  int leadExpectedHitsInner = tklead->hitPattern().numberOfHits(reco::HitPattern::MISSING_INNER_HITS);
1264  uint leadNHitsBeforeVtx = aConv.nHitsBeforeVtx().size()>1 ? aConv.nHitsBeforeVtx().at(ilead) : 0;
1265  uint trailNHitsBeforeVtx = aConv.nHitsBeforeVtx().size()>1 ? aConv.nHitsBeforeVtx().at(itrail) : 0;
1266 
1267 
1268  h_convEta_[match][0]->Fill( refittedMom.eta() );
1269  h_convEta2_[match][0]->Fill( refittedMom.eta() );
1270 
1271  h_convPhi_[match][0]->Fill( refittedMom.phi() );
1272  h_convR_[match][0]->Fill( sqrt(aConv.conversionVertex().position().perp2()) );
1273  h_convRplot_->Fill( sqrt(aConv.conversionVertex().position().perp2()) );
1274  h_convZ_[match][0]->Fill( aConv.conversionVertex().position().z() );
1275  h_convZplot_->Fill( aConv.conversionVertex().position().z() );
1276  h_convPt_[match][0]->Fill( sqrt(refittedMom.perp2()) );
1277  h_invMass_[match][0] ->Fill( invM);
1278  h_vtxChi2Prob_[match][0] ->Fill (chi2Prob);
1279  h_lxybs_[match][0] ->Fill (lxy);
1280  h_maxNHitsBeforeVtx_[match][0] ->Fill (maxNHitsBeforeVtx);
1281  h_leadNHitsBeforeVtx_[match][0] ->Fill (leadNHitsBeforeVtx);
1282  h_trailNHitsBeforeVtx_[match][0] ->Fill (trailNHitsBeforeVtx);
1283  h_sumNHitsBeforeVtx_[match][0] ->Fill (sumNHitsBeforeVtx);
1284  h_deltaExpectedHitsInner_[match][0] ->Fill (deltaExpectedHitsInner);
1285  h_leadExpectedHitsInner_[match][0] ->Fill (leadExpectedHitsInner);
1286  h_maxDlClosestHitToVtx_[match][0] ->Fill (maxDlClosestHitToVtx);
1287  h_maxDlClosestHitToVtxSig_[match][0] ->Fill (maxDlClosestHitToVtxSig);
1288  h_nSharedHits_[match][0] ->Fill (aConv.nSharedHits());
1289 
1290 
1291  if ( matchConvSC ) {
1292  h_convEtaMatchSC_[match][0]->Fill( refittedMom.eta() );
1293  h_EoverPTracks_[match][0] ->Fill (iMatchingSC->superCluster()->energy()/sqrt(refittedMom.mag2()));
1294  h_convSCdPhi_[match][0]->Fill( iMatchingSC->superCluster()->position().phi() - refittedMom.phi() );
1295  double ConvEta = etaTransformation(aConv.refittedPairMomentum().eta(),aConv.zOfPrimaryVertexFromTracks());
1296  h_convSCdEta_[match][0]->Fill( iMatchingSC->superCluster()->position().eta() - ConvEta );
1297  }
1298 
1299  h_distMinAppTracks_[match][0] ->Fill (aConv.distOfMinimumApproach());
1300  h_DPhiTracksAtVtx_[match][0]->Fill( dPhiTracksAtVtx);
1301  h2_DPhiTracksAtVtxVsEta_->Fill( mcEta_, dPhiTracksAtVtx);
1302  h2_DPhiTracksAtVtxVsR_->Fill( mcConvR_, dPhiTracksAtVtx);
1303  p_DPhiTracksAtVtxVsEta_->Fill( mcEta_, dPhiTracksAtVtx);
1304  p_DPhiTracksAtVtxVsR_->Fill( mcConvR_, dPhiTracksAtVtx);
1305 
1306  h_DCotTracks_[match][0] ->Fill ( aConv.pairCotThetaSeparation() );
1307  h2_DCotTracksVsEta_->Fill( mcEta_, aConv.pairCotThetaSeparation() );
1308  h2_DCotTracksVsR_->Fill( mcConvR_, aConv.pairCotThetaSeparation() );
1309  p_DCotTracksVsEta_->Fill( mcEta_, aConv.pairCotThetaSeparation() );
1310  p_DCotTracksVsR_->Fill( mcConvR_, aConv.pairCotThetaSeparation() );
1311 
1312  if ( phoIsInBarrel ) {
1313  h_invMass_[match][1] ->Fill(invM);
1314  h_vtxChi2Prob_[match][1] ->Fill (chi2Prob);
1315  h_distMinAppTracks_[match][1] ->Fill (aConv.distOfMinimumApproach());
1316  h_DPhiTracksAtVtx_[match][1]->Fill( dPhiTracksAtVtx);
1317  h_DCotTracks_[match][1] ->Fill ( aConv.pairCotThetaSeparation() );
1318  h_lxybs_[match][1] ->Fill (lxy);
1319  h_maxNHitsBeforeVtx_[match][1] ->Fill (maxNHitsBeforeVtx);
1320  h_leadNHitsBeforeVtx_[match][1] ->Fill (leadNHitsBeforeVtx);
1321  h_trailNHitsBeforeVtx_[match][1] ->Fill (trailNHitsBeforeVtx);
1322  h_sumNHitsBeforeVtx_[match][1] ->Fill (sumNHitsBeforeVtx);
1323  h_deltaExpectedHitsInner_[match][1] ->Fill (deltaExpectedHitsInner);
1324  h_leadExpectedHitsInner_[match][1] ->Fill (leadExpectedHitsInner);
1325  h_maxDlClosestHitToVtx_[match][1] ->Fill (maxDlClosestHitToVtx);
1326  h_maxDlClosestHitToVtxSig_[match][1] ->Fill (maxDlClosestHitToVtxSig);
1327  h_nSharedHits_[match][1] ->Fill (aConv.nSharedHits());
1328 
1329  /*
1330  if ( aConv.caloCluster().size() ) {
1331  h_convSCdPhi_[match][1]->Fill( aConv.caloCluster()[0]->phi() - refittedMom.phi() );
1332  double ConvEta = etaTransformation(aConv.refittedPairMomentum().eta(),aConv.zOfPrimaryVertexFromTracks());
1333  h_convSCdEta_[match][1]->Fill( aConv.caloCluster()[0]->eta() - ConvEta );
1334  }
1335  */
1336 
1337  if ( matchConvSC ) {
1338  h_EoverPTracks_[match][1] -> Fill(iMatchingSC->superCluster()->energy()/sqrt(refittedMom.mag2()));
1339  h_convSCdPhi_[match][1]->Fill( iMatchingSC->superCluster()->position().phi() - refittedMom.phi() );
1340  double ConvEta = etaTransformation(aConv.refittedPairMomentum().eta(),aConv.zOfPrimaryVertexFromTracks());
1341  h_convSCdEta_[match][1]->Fill( iMatchingSC->superCluster()->position().eta() - ConvEta );
1342  }
1343  }
1344 
1345 
1346  if ( phoIsInEndcap ) {
1347  h_invMass_[match][2] ->Fill(invM);
1348  h_vtxChi2Prob_[match][2] ->Fill (chi2Prob);
1349  h_distMinAppTracks_[match][2] ->Fill (aConv.distOfMinimumApproach());
1350  h_DPhiTracksAtVtx_[match][2]->Fill( dPhiTracksAtVtx);
1351  h_DCotTracks_[match][2] ->Fill ( aConv.pairCotThetaSeparation() );
1352  h_lxybs_[match][2] ->Fill (lxy);
1353  h_maxNHitsBeforeVtx_[match][2] ->Fill (maxNHitsBeforeVtx);
1354  h_leadNHitsBeforeVtx_[match][2] ->Fill (leadNHitsBeforeVtx);
1355  h_trailNHitsBeforeVtx_[match][2] ->Fill (trailNHitsBeforeVtx);
1356  h_sumNHitsBeforeVtx_[match][2] ->Fill (sumNHitsBeforeVtx);
1357  h_deltaExpectedHitsInner_[match][2] ->Fill (deltaExpectedHitsInner);
1358  h_leadExpectedHitsInner_[match][2] ->Fill (leadExpectedHitsInner);
1359  h_maxDlClosestHitToVtx_[match][2] ->Fill (maxDlClosestHitToVtx);
1360  h_maxDlClosestHitToVtxSig_[match][2] ->Fill (maxDlClosestHitToVtxSig);
1361  h_nSharedHits_[match][2] ->Fill (aConv.nSharedHits());
1362  if ( matchConvSC ) {
1363  h_EoverPTracks_[match][2] ->Fill (iMatchingSC->superCluster()->energy()/sqrt(refittedMom.mag2()));
1364  h_convSCdPhi_[match][2]->Fill( iMatchingSC->superCluster()->position().phi() - refittedMom.phi() );
1365  double ConvEta = etaTransformation(aConv.refittedPairMomentum().eta(),aConv.zOfPrimaryVertexFromTracks());
1366  h_convSCdEta_[match][2]->Fill( iMatchingSC->superCluster()->position().eta() - ConvEta );
1367 
1368  }
1369  }
1370 
1371  h_convVtxRvsZ_[0] ->Fill ( fabs (aConv.conversionVertex().position().z() ), sqrt(aConv.conversionVertex().position().perp2()) ) ;
1372  h_convVtxYvsX_ ->Fill ( aConv.conversionVertex().position().x(), aConv.conversionVertex().position().y() );
1373  h_convVtxYvsX_zoom_[0] ->Fill ( aConv.conversionVertex().position().x(), aConv.conversionVertex().position().y() );
1374  h_convVtxYvsX_zoom_[1] ->Fill ( aConv.conversionVertex().position().x(), aConv.conversionVertex().position().y() );
1375 
1376 
1377  // quantities per track: all conversions
1378  for (unsigned int i=0; i<tracks.size(); i++) {
1379  double d0;
1380  if (valid_pvtx){
1381  d0 = - tracks[i]->dxy(the_pvtx.position());
1382  } else {
1383  d0 = tracks[i]->d0();
1384  }
1385  h_TkD0_[match]->Fill ( d0* tracks[i]->charge() );
1386  h_nHitsBeforeVtx_[match]->Fill ( aConv.nHitsBeforeVtx().size()>1 ? aConv.nHitsBeforeVtx().at(i) : 0 );
1387  h_dlClosestHitToVtx_[match]->Fill ( aConv.dlClosestHitToVtx().size()>1 ? aConv.dlClosestHitToVtx().at(i).value() : 0 );
1388  h_dlClosestHitToVtxSig_[match]->Fill ( aConv.dlClosestHitToVtx().size()>1 ? aConv.dlClosestHitToVtx().at(i).value()/aConv.dlClosestHitToVtx().at(i).error() : 0 );
1389 
1390  nHitsVsEta_[match] ->Fill (mcEta_, float(tracks[i]->numberOfValidHits()) );
1391  nHitsVsR_[match] ->Fill (mcConvR_, float(tracks[i]->numberOfValidHits()) );
1392  p_nHitsVsEta_[match] ->Fill (mcEta_, float(tracks[i]->numberOfValidHits()) -0.0001);
1393  p_nHitsVsR_[match] ->Fill (mcConvR_, float(tracks[i]->numberOfValidHits()) -0.0001);
1394  h_tkChi2_[match] ->Fill (tracks[i]->normalizedChi2() );
1395  h_tkChi2Large_[match] ->Fill (tracks[i]->normalizedChi2() );
1396  h2_Chi2VsEta_[match] ->Fill( mcEta_, tracks[i]->normalizedChi2() );
1397  h2_Chi2VsR_[match] ->Fill( mcConvR_, tracks[i]->normalizedChi2() );
1398  p_Chi2VsEta_[match] ->Fill( mcEta_, tracks[i]->normalizedChi2() );
1399  p_Chi2VsR_[match] ->Fill( mcConvR_, tracks[i]->normalizedChi2() );
1400 
1401  }
1402 
1403  bool associated = false;
1404  float mcConvPt_= -99999999;
1405  // float mcPhi= 0; // unused
1406  float simPV_Z=0;
1407  for ( std::vector<PhotonMCTruth>::const_iterator mcPho=mcPhotons.begin(); mcPho !=mcPhotons.end(); mcPho++) {
1408  mcConvPt_= (*mcPho).fourMomentum().et();
1409  float mcPhi= (*mcPho).fourMomentum().phi();
1410  simPV_Z = (*mcPho).primaryVertex().z();
1411  mcPhi_= phiNormalization(mcPhi);
1412  mcEta_= (*mcPho).fourMomentum().pseudoRapidity();
1413  mcEta_ = etaTransformation(mcEta_, (*mcPho).primaryVertex().z() );
1414  mcConvR_= (*mcPho).vertex().perp();
1415  mcConvX_= (*mcPho).vertex().x();
1416  mcConvY_= (*mcPho).vertex().y();
1417  mcConvZ_= (*mcPho).vertex().z();
1418  mcConvEta_= (*mcPho).vertex().eta();
1419  mcConvPhi_= (*mcPho).vertex().phi();
1420  if ( fabs(mcEta_) > END_HI ) continue;
1421  if (mcConvPt_<minPhoPtForPurity) continue;
1422  if (fabs(mcEta_)>maxPhoEtaForPurity) continue;
1423  if (fabs(mcConvZ_)>maxPhoZForPurity) continue;
1424  if (mcConvR_>maxPhoRForEffic) continue;
1425 
1426  if ( (*mcPho).isAConversion() != 1 ) continue;
1427  if (!( ( fabs(mcEta_) <= BARL && mcConvR_ <85 ) ||
1428  ( fabs(mcEta_) > BARL && fabs(mcEta_) <=END_HI && fabs( (*mcPho).vertex().z() ) < 210 ) ) )
1429  continue;
1430 
1431 
1432  theConvTP_.clear();
1433  for(size_t i = 0; i < tpForFakeRate.size(); ++i){
1434  TrackingParticleRef tp (TPHandleForFakeRate,i);
1435  if ( fabs( tp->vx() - (*mcPho).vertex().x() ) < 0.0001 &&
1436  fabs( tp->vy() - (*mcPho).vertex().y() ) < 0.0001 &&
1437  fabs( tp->vz() - (*mcPho).vertex().z() ) < 0.0001) {
1438  theConvTP_.push_back( tp );
1439 
1440 
1441  }
1442  }
1443 
1444  if ( theConvTP_.size() < 2 ) continue;
1445 
1446  //associated = false;
1447  reco::RecoToSimCollection p1 = theTrackAssociator_->associateRecoToSim(tc1,theConvTP_,&e,&esup);
1448  reco::RecoToSimCollection p2 = theTrackAssociator_->associateRecoToSim(tc2,theConvTP_,&e,&esup);
1449  try{
1450  std::vector<std::pair<TrackingParticleRef, double> > tp1 = p1[tk1];
1451  std::vector<std::pair<TrackingParticleRef, double> > tp2 = p2[tk2];
1452  if (!(tp1.size()&&tp2.size())){
1453  tp1 = p1[tk2];
1454  tp2 = p2[tk1];
1455  }
1456  if (tp1.size()&&tp2.size()) {
1457  TrackingParticleRef tpr1 = tp1.front().first;
1458  TrackingParticleRef tpr2 = tp2.front().first;
1459  if (abs(tpr1->pdgId())==11&&abs(tpr2->pdgId())==11&& tpr1->pdgId()*tpr2->pdgId()<0) {
1460  if ( (tpr1->parentVertex()->sourceTracks_end()-tpr1->parentVertex()->sourceTracks_begin()==1) &&
1461  (tpr2->parentVertex()->sourceTracks_end()-tpr2->parentVertex()->sourceTracks_begin()==1)) {
1462  if (tpr1->parentVertex().key()==tpr2->parentVertex().key() && ((*tpr1->parentVertex()->sourceTracks_begin())->pdgId()==22)) {
1463  mcConvR_ = sqrt(tpr1->parentVertex()->position().Perp2());
1464  mcConvZ_ = tpr1->parentVertex()->position().z();
1465  mcConvX_ = tpr1->parentVertex()->position().x();
1466  mcConvY_ = tpr1->parentVertex()->position().y();
1467  mcConvEta_ = tpr1->parentVertex()->position().eta();
1468  mcConvPhi_ = tpr1->parentVertex()->position().phi();
1469  mcConvPt_ = sqrt((*tpr1->parentVertex()->sourceTracks_begin())->momentum().Perp2());
1470  //std::cout << " Reco to Sim mcconvpt " << mcConvPt_ << std::endl;
1471  //cout << "associated track1 to " << tpr1->pdgId() << " with p=" << tpr1->p4() << " with pT=" << tpr1->pt() << endl;
1472  //cout << "associated track2 to " << tpr2->pdgId() << " with p=" << tpr2->p4() << " with pT=" << tpr2->pt() << endl;
1473  associated = true;
1474  break;
1475  }
1476  }
1477  }
1478  }
1479  } catch (Exception event) {
1480  //cout << "do not continue: " << event.what() << endl;
1481  //continue;
1482  }
1483 
1484  }// end loop on sim photons
1485 
1486 
1487  if (0) {
1488  theConvTP_.clear();
1489  for(size_t i = 0; i < tpForFakeRate.size(); ++i){
1490  TrackingParticleRef tp (TPHandleForFakeRate,i);
1491  theConvTP_.push_back( tp );
1492  }
1493  reco::RecoToSimCollection p1incl = theTrackAssociator_->associateRecoToSim(tc1,theConvTP_,&e,&esup);
1494  reco::RecoToSimCollection p2incl = theTrackAssociator_->associateRecoToSim(tc2,theConvTP_,&e,&esup);
1495 
1496 
1497  for ( std::vector<PhotonMCTruth>::const_iterator mcPho=mcPhotons.begin(); mcPho !=mcPhotons.end(); mcPho++) {
1498  mcConvPt_= (*mcPho).fourMomentum().et();
1499  float mcPhi= (*mcPho).fourMomentum().phi();
1500  simPV_Z = (*mcPho).primaryVertex().z();
1501  mcPhi_= phiNormalization(mcPhi);
1502  mcEta_= (*mcPho).fourMomentum().pseudoRapidity();
1503  mcEta_ = etaTransformation(mcEta_, (*mcPho).primaryVertex().z() );
1504  mcConvR_= (*mcPho).vertex().perp();
1505  mcConvX_= (*mcPho).vertex().x();
1506  mcConvY_= (*mcPho).vertex().y();
1507  mcConvZ_= (*mcPho).vertex().z();
1508  mcConvEta_= (*mcPho).vertex().eta();
1509  mcConvPhi_= (*mcPho).vertex().phi();
1510  if ( fabs(mcEta_) > END_HI ) continue;
1511  if (mcConvPt_<minPhoPtForPurity) continue;
1512  if (fabs(mcEta_)>maxPhoEtaForPurity) continue;
1513  if (fabs(mcConvZ_)>maxPhoZForPurity) continue;
1514  if (mcConvR_>maxPhoRForEffic) continue;
1515 
1516  if ( (*mcPho).isAConversion() != 1 ) continue;
1517  if (!( ( fabs(mcEta_) <= BARL && mcConvR_ <85 ) ||
1518  ( fabs(mcEta_) > BARL && fabs(mcEta_) <=END_HI && fabs( (*mcPho).vertex().z() ) < 210 ) ) )
1519  continue;
1520 
1521 
1522  theConvTP_.clear();
1523  for(size_t i = 0; i < tpForFakeRate.size(); ++i){
1524  TrackingParticleRef tp (TPHandleForFakeRate,i);
1525  if ( fabs( tp->vx() - (*mcPho).vertex().x() ) < 0.0001 &&
1526  fabs( tp->vy() - (*mcPho).vertex().y() ) < 0.0001 &&
1527  fabs( tp->vz() - (*mcPho).vertex().z() ) < 0.0001) {
1528  theConvTP_.push_back( tp );
1529 
1530 
1531  }
1532  }
1533 
1534  if ( theConvTP_.size() < 2 ) continue;
1535 
1536  //associated = false;
1537  reco::RecoToSimCollection p1 = theTrackAssociator_->associateRecoToSim(tc1,theConvTP_,&e,&esup);
1538  reco::RecoToSimCollection p2 = theTrackAssociator_->associateRecoToSim(tc2,theConvTP_,&e,&esup);
1539 
1540 
1541 
1542 
1543 
1544  if ( (p1incl.size() && p2incl.size()) && (p1.size() || p2.size()) ) { // associated = true;
1545  try{
1546  std::vector<std::pair<TrackingParticleRef, double> > tp1 = p1incl[tk1];
1547  std::vector<std::pair<TrackingParticleRef, double> > tp2 = p2incl[tk2];
1548  if (!(tp1.size()&&tp2.size())){
1549  tp1 = p1[tk2];
1550  tp2 = p2[tk1];
1551  }
1552  if (tp1.size()&&tp2.size()) {
1553  TrackingParticleRef tpr1 = tp1.front().first;
1554  TrackingParticleRef tpr2 = tp2.front().first;
1555  if (abs(tpr1->pdgId())==11&&abs(tpr2->pdgId())==11 && tpr1->pdgId()*tpr2->pdgId()<0) {
1556  if ( ((tpr1->parentVertex()->sourceTracks_end()-tpr1->parentVertex()->sourceTracks_begin()>=1) && (*tpr1->parentVertex()->sourceTracks_begin())->pdgId()==22) &&
1557  ((tpr2->parentVertex()->sourceTracks_end()-tpr2->parentVertex()->sourceTracks_begin()>=1) && (*tpr2->parentVertex()->sourceTracks_begin())->pdgId()==22) ) {
1558 
1559  // if ( fabs(tpr1->vx() - tpr2->vx()) < 0.1 && fabs(tpr1->vy() - tpr2->vy()) < 0.1 && fabs(tpr1->vz() - tpr2->vz()) < 0.1) {
1560  //if (((*tpr1->parentVertex()->sourceTracks_begin())->pdgId()==22) || ((*tpr2->parentVertex()->sourceTracks_begin())->pdgId()==22)) {
1561 // mcConvR_ = sqrt(tpr1->parentVertex()->position().Perp2());
1562 // mcConvZ_ = tpr1->parentVertex()->position().z();
1563 // mcConvX_ = tpr1->parentVertex()->position().x();
1564 // mcConvY_ = tpr1->parentVertex()->position().y();
1565 // mcConvEta_ = tpr1->parentVertex()->position().eta();
1566 // mcConvPhi_ = tpr1->parentVertex()->position().phi();
1567 // mcConvPt_ = sqrt((*tpr1->parentVertex()->sourceTracks_begin())->momentum().Perp2());
1568  //std::cout << " Reco to Sim mcconvpt " << mcConvPt_ << std::endl;
1569  //cout << "associated track1 to " << tpr1->pdgId() << " with p=" << tpr1->p4() << " with pT=" << tpr1->pt() << endl;
1570  //cout << "associated track2 to " << tpr2->pdgId() << " with p=" << tpr2->p4() << " with pT=" << tpr2->pt() << endl;
1571  associated = true;
1572  break;
1573  //}
1574  //}
1575  }
1576  }
1577  }
1578  } catch (Exception event) {
1579  //cout << "do not continue: " << event.what() << endl;
1580  //continue;
1581  }
1582 
1583  }
1584 
1585  }
1586  }
1587 
1588  if ( associated ) match=1;
1589  else
1590  match=2;
1591 
1592  h_match_->Fill(float(match));
1594  if ( match == 1) nRecConvAss_++;
1595  h_convEta_[match][0]->Fill( refittedMom.eta() );
1596  h_convEta_[match][1]->Fill( refittedMom.eta() );
1597  if (matchConvSC) h_convEtaMatchSC_[match][0]->Fill( refittedMom.eta() );
1598  h_convPhi_[match][0]->Fill( refittedMom.phi() );
1599  h_convR_[match][0]->Fill( sqrt(aConv.conversionVertex().position().perp2()) );
1600  h_convZ_[match][0]->Fill( aConv.conversionVertex().position().z() );
1601  h_convPt_[match][0]->Fill( sqrt(refittedMom.perp2()) );
1602  h_invMass_[match][0] ->Fill( invM);
1603  h_vtxChi2Prob_[match][0] ->Fill (chi2Prob);
1604  h_DPhiTracksAtVtx_[match][0]->Fill( dPhiTracksAtVtx);
1605  h_DCotTracks_[match][0] ->Fill ( aConv.pairCotThetaSeparation() );
1606  h_distMinAppTracks_[match][0] ->Fill (aConv.distOfMinimumApproach());
1607  h_lxybs_[match][0] ->Fill (lxy);
1608  h_maxNHitsBeforeVtx_[match][0] ->Fill (maxNHitsBeforeVtx);
1609  h_leadNHitsBeforeVtx_[match][0] ->Fill (leadNHitsBeforeVtx);
1610  h_trailNHitsBeforeVtx_[match][0] ->Fill (trailNHitsBeforeVtx);
1611  h_sumNHitsBeforeVtx_[match][0] ->Fill (sumNHitsBeforeVtx);
1612  h_deltaExpectedHitsInner_[match][0] ->Fill (deltaExpectedHitsInner);
1613  h_leadExpectedHitsInner_[match][0] ->Fill (leadExpectedHitsInner);
1614  h_maxDlClosestHitToVtx_[match][0] ->Fill (maxDlClosestHitToVtx);
1615  h_maxDlClosestHitToVtxSig_[match][0] ->Fill (maxDlClosestHitToVtxSig);
1616  h_nSharedHits_[match][0] ->Fill (aConv.nSharedHits());
1617  if ( matchConvSC ) {
1618  //h_EoverPTracks_[match][0] ->Fill (aConv.EoverPrefittedTracks());
1619  h_EoverPTracks_[match][0] ->Fill (iMatchingSC->superCluster()->energy()/sqrt(refittedMom.mag2()));
1620  h_convSCdPhi_[match][0]->Fill( iMatchingSC->superCluster()->position().phi() - refittedMom.phi() );
1621  double ConvEta = etaTransformation(aConv.refittedPairMomentum().eta(),aConv.zOfPrimaryVertexFromTracks());
1622  h_convSCdEta_[match][0]->Fill( iMatchingSC->superCluster()->position().eta() - ConvEta );
1623 
1624  }
1625  if ( match==1) {
1626  h2_photonPtRecVsPtSim_->Fill ( mcConvPt_, sqrt(refittedMom.perp2()) );
1627  h_convPtRes_[0]->Fill ( sqrt(refittedMom.perp2())/mcConvPt_);
1628  }
1629 
1630  if ( phoIsInBarrel ) {
1631  h_invMass_[match][1] ->Fill(invM);
1632  h_vtxChi2Prob_[match][1] ->Fill (chi2Prob);
1633  h_DPhiTracksAtVtx_[match][1]->Fill( dPhiTracksAtVtx);
1634  h_DCotTracks_[match][1] ->Fill ( aConv.pairCotThetaSeparation() );
1635  h_distMinAppTracks_[match][1] ->Fill (aConv.distOfMinimumApproach());
1636  h_lxybs_[match][1] ->Fill (lxy);
1637  h_maxNHitsBeforeVtx_[match][1] ->Fill (maxNHitsBeforeVtx);
1638  h_leadNHitsBeforeVtx_[match][1] ->Fill (leadNHitsBeforeVtx);
1639  h_trailNHitsBeforeVtx_[match][1] ->Fill (trailNHitsBeforeVtx);
1640  h_sumNHitsBeforeVtx_[match][1] ->Fill (sumNHitsBeforeVtx);
1641  h_deltaExpectedHitsInner_[match][1] ->Fill (deltaExpectedHitsInner);
1642  h_leadExpectedHitsInner_[match][1] ->Fill (leadExpectedHitsInner);
1643  h_maxDlClosestHitToVtx_[match][1] ->Fill (maxDlClosestHitToVtx);
1644  h_maxDlClosestHitToVtxSig_[match][1] ->Fill (maxDlClosestHitToVtxSig);
1645  h_nSharedHits_[match][1] ->Fill (aConv.nSharedHits());
1646  if ( matchConvSC ) {
1647  // h_EoverPTracks_[match][1] ->Fill (aConv.EoverPrefittedTracks());
1648  h_EoverPTracks_[match][1] ->Fill (iMatchingSC->superCluster()->energy()/sqrt(refittedMom.mag2()));
1649  h_convSCdPhi_[match][1]->Fill( iMatchingSC->superCluster()->position().phi() - refittedMom.phi() );
1650  double ConvEta = etaTransformation(aConv.refittedPairMomentum().eta(),aConv.zOfPrimaryVertexFromTracks());
1651  h_convSCdEta_[match][1]->Fill( iMatchingSC->superCluster()->position().eta() - ConvEta );
1652 
1653  }
1654  if ( match==1) h_convPtRes_[1]->Fill ( sqrt(refittedMom.perp2())/mcConvPt_);
1655  }
1656 
1657 
1658  if ( phoIsInEndcap ) {
1659  h_invMass_[match][2] ->Fill(invM);
1660  h_vtxChi2Prob_[match][2] ->Fill (chi2Prob);
1661  h_DPhiTracksAtVtx_[match][2]->Fill( dPhiTracksAtVtx);
1662  h_DCotTracks_[match][2] ->Fill ( aConv.pairCotThetaSeparation() );
1663  h_distMinAppTracks_[match][2] ->Fill (aConv.distOfMinimumApproach());
1664  h_lxybs_[match][2] ->Fill (lxy);
1665  h_maxNHitsBeforeVtx_[match][2] ->Fill (maxNHitsBeforeVtx);
1666  h_leadNHitsBeforeVtx_[match][2] ->Fill (leadNHitsBeforeVtx);
1667  h_trailNHitsBeforeVtx_[match][2] ->Fill (trailNHitsBeforeVtx);
1668  h_sumNHitsBeforeVtx_[match][2] ->Fill (sumNHitsBeforeVtx);
1669  h_deltaExpectedHitsInner_[match][2] ->Fill (deltaExpectedHitsInner);
1670  h_leadExpectedHitsInner_[match][2] ->Fill (leadExpectedHitsInner);
1671  h_maxDlClosestHitToVtx_[match][2] ->Fill (maxDlClosestHitToVtx);
1672  h_maxDlClosestHitToVtxSig_[match][2] ->Fill (maxDlClosestHitToVtxSig);
1673  h_nSharedHits_[match][2] ->Fill (aConv.nSharedHits());
1674  if ( matchConvSC ) {
1675  // h_EoverPTracks_[match][2] ->Fill (aConv.EoverPrefittedTracks());
1676  h_EoverPTracks_[match][2] ->Fill (iMatchingSC->superCluster()->energy()/sqrt(refittedMom.mag2()));
1677  h_convSCdPhi_[match][2]->Fill( iMatchingSC->superCluster()->position().phi() - refittedMom.phi() );
1678  double ConvEta = etaTransformation(aConv.refittedPairMomentum().eta(),aConv.zOfPrimaryVertexFromTracks());
1679  h_convSCdEta_[match][2]->Fill( iMatchingSC->superCluster()->position().eta() - ConvEta );
1680  }
1681  if ( match==1) h_convPtRes_[2]->Fill ( sqrt(refittedMom.perp2())/mcConvPt_);
1682  }
1683 
1684 
1685  if ( match == 1 ) {
1686  h_convVtxdX_ ->Fill ( aConv.conversionVertex().position().x() - mcConvX_);
1687  h_convVtxdY_ ->Fill ( aConv.conversionVertex().position().y() - mcConvY_);
1688  h_convVtxdZ_ ->Fill ( aConv.conversionVertex().position().z() - mcConvZ_);
1689  h_convVtxdR_ ->Fill ( sqrt(aConv.conversionVertex().position().perp2()) - mcConvR_);
1690  h_convVtxdPhi_ ->Fill ( aConv.conversionVertex().position().phi() - mcConvPhi_);
1691  h_convVtxdEta_ ->Fill ( aConv.conversionVertex().position().eta() - mcConvEta_);
1692  h2_convVtxdRVsR_ ->Fill (mcConvR_, sqrt(aConv.conversionVertex().position().perp2()) - mcConvR_ );
1693  h2_convVtxdRVsEta_ ->Fill (mcEta_, sqrt(aConv.conversionVertex().position().perp2()) - mcConvR_ );
1694  p_convVtxdRVsR_ ->Fill (mcConvR_, sqrt(aConv.conversionVertex().position().perp2()) - mcConvR_ );
1695  p_convVtxdRVsEta_ ->Fill (mcEta_, sqrt(aConv.conversionVertex().position().perp2()) - mcConvR_ );
1696  p_convVtxdXVsX_ ->Fill (mcConvX_, aConv.conversionVertex().position().x() - mcConvX_ );
1697  p_convVtxdYVsY_ ->Fill (mcConvY_, aConv.conversionVertex().position().y() - mcConvY_ );
1698  p_convVtxdZVsZ_ ->Fill (mcConvZ_, aConv.conversionVertex().position().z() - mcConvZ_ );
1699  p_convVtxdZVsR_ ->Fill (mcConvR_, aConv.conversionVertex().position().z() - mcConvZ_ );
1700 
1701  float dR=sqrt(aConv.conversionVertex().position().perp2()) - mcConvR_;
1702  float dZ=aConv.conversionVertex().position().z() - mcConvZ_;
1703  p2_convVtxdRVsRZ_ ->Fill (mcConvZ_,mcConvR_, dR );
1704  p2_convVtxdZVsRZ_ ->Fill (mcConvZ_,mcConvR_, dZ );
1705 
1706 
1707 
1708 
1709  h2_convVtxRrecVsTrue_ -> Fill (mcConvR_, sqrt(aConv.conversionVertex().position().perp2()) );
1710 
1711 
1712  h_zPVFromTracks_[match]->Fill ( aConv.zOfPrimaryVertexFromTracks() );
1713  h_dzPVFromTracks_[match]->Fill ( aConv.zOfPrimaryVertexFromTracks() - simPV_Z );
1714  h2_dzPVVsR_ ->Fill(mcConvR_, aConv.zOfPrimaryVertexFromTracks() - simPV_Z );
1715  p_dzPVVsR_ ->Fill(mcConvR_, aConv.zOfPrimaryVertexFromTracks() - simPV_Z );
1716 
1717  if ( phoIsInBarrel ) {
1718  h_convVtxdX_barrel_ ->Fill ( aConv.conversionVertex().position().x() - mcConvX_);
1719  h_convVtxdY_barrel_ ->Fill ( aConv.conversionVertex().position().y() - mcConvY_);
1720  h_convVtxdZ_barrel_ ->Fill ( aConv.conversionVertex().position().z() - mcConvZ_);
1721  h_convVtxdR_barrel_ ->Fill ( sqrt(aConv.conversionVertex().position().perp2()) - mcConvR_);
1722 
1723  }
1724  if ( phoIsInEndcap ) {
1725  h_convVtxdX_endcap_ ->Fill ( aConv.conversionVertex().position().x() - mcConvX_);
1726  h_convVtxdY_endcap_ ->Fill ( aConv.conversionVertex().position().y() - mcConvY_);
1727  h_convVtxdZ_endcap_ ->Fill ( aConv.conversionVertex().position().z() - mcConvZ_);
1728  h_convVtxdR_endcap_ ->Fill ( sqrt(aConv.conversionVertex().position().perp2()) - mcConvR_);
1729 
1730  }
1731 
1732 
1733  }
1734 
1736  for (unsigned int i=0; i<tracks.size(); i++) {
1737  //std::cout << " Loop over tracks pt " << tracks[i]->pt() << std::endl;
1738  RefToBase<reco::Track> tfrb(aConv.tracks()[i] );
1739  itAss= myAss.find( tfrb.get() );
1740 
1741  nHitsVsEta_[match] ->Fill (mcEta_, float(tracks[i]->numberOfValidHits()) );
1742  nHitsVsR_[match] ->Fill (mcConvR_, float(tracks[i]->numberOfValidHits()) );
1743  p_nHitsVsEta_[match] ->Fill (mcEta_, float(tracks[i]->numberOfValidHits()) -0.0001);
1744  p_nHitsVsR_[match] ->Fill (mcConvR_, float(tracks[i]->numberOfValidHits()) -0.0001);
1745  h_tkChi2_[match] ->Fill (tracks[i]->normalizedChi2() );
1746  h_tkChi2Large_[match] ->Fill (tracks[i]->normalizedChi2() );
1747  h2_Chi2VsEta_[match] ->Fill( mcEta_, tracks[i]->normalizedChi2() );
1748  h2_Chi2VsR_[match] ->Fill( mcConvR_, tracks[i]->normalizedChi2() );
1749  p_Chi2VsEta_[match] ->Fill( mcEta_, tracks[i]->normalizedChi2() );
1750  p_Chi2VsR_[match] ->Fill( mcConvR_, tracks[i]->normalizedChi2() );
1751  double d0;
1752  if (valid_pvtx){
1753  d0 = - tracks[i]->dxy(the_pvtx.position());
1754  } else {
1755  d0 = tracks[i]->d0();
1756  }
1757  h_TkD0_[match]->Fill (d0* tracks[i]->charge() );
1758  h_nHitsBeforeVtx_[match]->Fill ( aConv.nHitsBeforeVtx().size()>1 ? aConv.nHitsBeforeVtx().at(i) : 0 );
1759  h_dlClosestHitToVtx_[match]->Fill ( aConv.dlClosestHitToVtx().size()>1 ? aConv.dlClosestHitToVtx().at(i).value() : 0 );
1760  h_dlClosestHitToVtxSig_[match]->Fill ( aConv.dlClosestHitToVtx().size()>1 ? aConv.dlClosestHitToVtx().at(i).value()/aConv.dlClosestHitToVtx().at(i).error() : 0 );
1761 
1762 
1763  if ( itAss == myAss.end() ) continue;
1764  reco::Track refTrack= aConv.conversionVertex().refittedTracks()[i];
1765 
1766  float simPt = sqrt( ((*itAss).second)->momentum().perp2() );
1767  float recPt = refTrack.pt();
1768  float ptres= recPt - simPt ;
1769  //float pterror = aConv.tracks()[i]->ptError();
1770  float pterror = aConv.conversionVertex().refittedTracks()[i].ptError();
1771  h2_PtRecVsPtSim_[0]->Fill ( simPt, recPt);
1772  h_TkPtPull_[0] ->Fill(ptres/pterror);
1773  h2_TkPtPull_[0] ->Fill(mcEta_, ptres/pterror);
1774 
1775  if ( phoIsInBarrel ) {
1776  h_TkPtPull_[1] ->Fill(ptres/pterror);
1777  h2_PtRecVsPtSim_[1]->Fill ( simPt, recPt);
1778  }
1779  if ( phoIsInEndcap ) {
1780  h_TkPtPull_[2] ->Fill(ptres/pterror);
1781  h2_PtRecVsPtSim_[2]->Fill ( simPt, recPt);
1782  }
1783  } // end loop over track
1784 
1785 
1786 
1787  } // loop over reco conversions
1788 
1789 
1790  h_nConv_[0][0]->Fill (float(nRecConv_));
1791  h_nConv_[1][0]->Fill (float(nRecConvAss_));
1792 
1793 
1794 
1795 }
1796 
1797 
1798 
1799 
1800 
1802 
1803 
1804  std::string outputFileName = parameters_.getParameter<std::string>("OutputFileName");
1805  if ( ! isRunCentrally_ ) {
1806  dbe_->save(outputFileName);
1807  }
1808 
1809  edm::LogInfo("TkConvValidator") << "Analyzed " << nEvt_ << "\n";
1810  // std::cout << "::endJob Analyzed " << nEvt_ << " events " << " with total " << nPho_ << " Photons " << "\n";
1811  // std::cout << "TkConvValidator::endJob Analyzed " << nEvt_ << " events " << "\n";
1812 
1813  return ;
1814 }
1815 
1816 
1818 
1821  auto scp = new SimpleCylinderBounds( sqrt(vtx.position().perp2())-0.001f,
1822  sqrt(vtx.position().perp2())+0.001f,
1823  -fabs(vtx.position().z()),
1824  fabs(vtx.position().z())
1825  );
1827 
1828  ReferenceCountingPointer<Disk> theDisk_(new Disk( Surface::PositionType( 0, 0, vtx.position().z()), rot,
1829  new SimpleDiskBounds( 0, sqrt(vtx.position().perp2()), -0.001, 0.001) )
1830  );
1831 
1832 
1833  const TrajectoryStateOnSurface myTSOS = trajectoryStateTransform::innerStateOnSurface(*tk, trackerGeom, &mf);
1834  PropagatorWithMaterial propag( anyDirection, 0.000511, &mf );
1835  TrajectoryStateOnSurface stateAtVtx;
1836  stateAtVtx = propag.propagate(myTSOS, *theBarrel_);
1837  if (!stateAtVtx.isValid() ) {
1838  stateAtVtx = propag.propagate(myTSOS, *theDisk_);
1839  }
1840  if (stateAtVtx.isValid()){
1841  return math::XYZVector ( double(stateAtVtx.globalMomentum().x()), double(stateAtVtx.globalMomentum().y()), double(stateAtVtx.globalMomentum().z()));
1842  } else {
1843  return math::XYZVector(0.,0.,0.);
1844  }
1845 
1846 
1847 
1848 }
1849 
1850 
1852 {
1853  //---Definitions
1854  const float PI = 3.1415927;
1855  const float TWOPI = 2.0*PI;
1856 
1857 
1858  if(phi > PI) {phi = phi - TWOPI;}
1859  if(phi < -PI) {phi = phi + TWOPI;}
1860 
1861  // cout << " Float_t PHInormalization out " << PHI << endl;
1862  return phi;
1863 
1864 }
1865 
1866 
1867 float TkConvValidator::etaTransformation( float EtaParticle , float Zvertex) {
1868 
1869  //---Definitions
1870  const float PI = 3.1415927;
1871 
1872  //---Definitions for ECAL
1873  const float R_ECAL = 136.5;
1874  const float Z_Endcap = 328.0;
1875  const float etaBarrelEndcap = 1.479;
1876 
1877  //---ETA correction
1878 
1879  float Theta = 0.0 ;
1880  float ZEcal = R_ECAL*sinh(EtaParticle)+Zvertex;
1881 
1882  if(ZEcal != 0.0) Theta = atan(R_ECAL/ZEcal);
1883  if(Theta<0.0) Theta = Theta+PI ;
1884  float ETA = - log(tan(0.5*Theta));
1885 
1886  if( fabs(ETA) > etaBarrelEndcap )
1887  {
1888  float Zend = Z_Endcap ;
1889  if(EtaParticle<0.0 ) Zend = -Zend ;
1890  float Zlen = Zend - Zvertex ;
1891  float RR = Zlen/sinh(EtaParticle);
1892  Theta = atan(RR/Zend);
1893  if(Theta<0.0) Theta = Theta+PI ;
1894  ETA = - log(tan(0.5*Theta));
1895  }
1896  //---Return the result
1897  return ETA;
1898  //---end
1899 }
1900 
1901 
const reco::Vertex & conversionVertex() const
returns the reco conversion vertex
Definition: Conversion.h:97
double lxy(const math::XYZPoint &myBeamSpot, const Conversion &conv)
value_type const * get() const
Definition: RefToBase.h:213
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
virtual FreeTrajectoryState propagate(const FreeTrajectoryState &ftsStart, const GlobalPoint &pDest) const final
Definition: Propagator.h:119
int i
Definition: DBlmapReader.cc:9
virtual void endRun(edm::Run &r, edm::EventSetup const &es)
reco::SuperClusterRef superCluster() const
Ref to SuperCluster.
std::vector< TrackingParticle > TrackingParticleCollection
#define PI
const_iterator end() const
last iterator over the map (read only)
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:157
static HepMC::IO_HEPEVT conv
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:446
bool quality(ConversionQuality q) const
Definition: Conversion.h:181
double y() const
y coordinate
Definition: Vertex.h:110
math::XYZVector recalculateMomentumAtFittedVertex(const MagneticField &mf, const TrackerGeometry &trackerGeom, const edm::RefToBase< reco::Track > &tk, const reco::Vertex &vtx)
bool isValid() const
Tells whether the vertex is valid.
Definition: Vertex.h:60
std::vector< GenJet > GenJetCollection
collection of GenJet objects
const std::vector< Measurement1DFloat > & dlClosestHitToVtx() const
Vector of signed decay length with uncertainty from nearest hit on track to the conversion vtx positi...
Definition: Conversion.h:163
const_iterator find(const key_type &k) const
find element with specified reference key
T y() const
Definition: PV3DBase.h:63
virtual void analyze(const edm::Event &, const edm::EventSetup &)
double zOfPrimaryVertexFromTracks(const math::XYZPoint &myBeamSpot=math::XYZPoint()) const
Definition: Conversion.h:145
double distOfMinimumApproach() const
Definition: Conversion.h:125
double pairCotThetaSeparation() const
Delta cot(Theta) where Theta is the angle in the (y,z) plane between the two tracks. Original tracks are used.
Definition: Conversion.cc:209
#define TWOPI
EgammaCoreTools.
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
key_type key() const
Accessor for product key.
Definition: Ref.h:266
const std::vector< Track > & refittedTracks() const
Returns the container of refitted tracks.
Definition: Vertex.h:149
double pairInvariantMass() const
if nTracks=2 returns the pair invariant mass. Original tracks are used here
Definition: Conversion.cc:190
const Point & position() const
position
Definition: Vertex.h:106
tuple vertexCollection
math::XYZVectorF refittedPairMomentum() const
Conversion tracks momentum from the tracks refitted with vertex constraint.
Definition: Conversion.cc:248
double q2[4]
Definition: TauolaWrapper.h:88
std::vector< Conversion > ConversionCollection
collectin of Conversion objects
Definition: ConversionFwd.h:9
return((rh^lh)&mask)
virtual ~TkConvValidator()
TrackAlgorithm algo() const
Definition: TrackBase.h:423
Definition: BoundDisk.h:19
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
#define ETA
float etaTransformation(float a, float b)
float phiNormalization(float &a)
MonitorElement * bookProfile2D(Args &&...args)
Definition: DQMStore.h:163
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
T sqrt(T t)
Definition: SSEVec.h:48
double pt() const
track transverse momentum
Definition: TrackBase.h:669
T z() const
Definition: PV3DBase.h:64
tuple result
Definition: query.py:137
TkConvValidator(const edm::ParameterSet &)
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double chi2() const
chi-squares
Definition: Vertex.h:95
double f[11][100]
float ChiSquaredProbability(double chiSquared, double nrDOF)
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< float > > XYZVectorF
spatial vector with cartesian internal representation
Definition: Vector3D.h:17
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
double p2[4]
Definition: TauolaWrapper.h:90
virtual void dqmBeginRun(edm::Run const &r, edm::EventSetup const &theEventSetup)
DQMStore * dbe_
double ndof() const
Definition: Vertex.h:102
double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:12
double x() const
x coordinate
Definition: Vertex.h:108
uint8_t nSharedHits() const
number of shared hits btw the two track
Definition: Conversion.h:165
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
size_type size() const
map size
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:384
double q1[4]
Definition: TauolaWrapper.h:87
tuple tracks
Definition: testEve_cfg.py:39
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
std::vector< Photon > PhotonCollection
collectin of Photon objects
Definition: PhotonFwd.h:9
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:86
virtual void endJob()
static const float etaBarrelEndcap
static const float Z_Endcap
edm::EventID id() const
Definition: EventBase.h:56
double p1[4]
Definition: TauolaWrapper.h:89
GlobalVector globalMomentum() const
static float computeRadius(Bounds const &bounds)
Definition: Cylinder.h:30
void push_back(const RefToBase< T > &)
const std::vector< uint8_t > & nHitsBeforeVtx() const
Vector of the number of hits before the vertex along each track trajector.
Definition: Conversion.h:161
static const float R_ECAL
double recPt
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:6
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
Definition: TrackBase.h:639
T x() const
Definition: PV3DBase.h:62
double dPhiTracksAtVtx() const
Definition: Conversion.cc:313
std::vector< edm::RefToBase< reco::Track > > const & tracks() const
vector of track to base references
Definition: Conversion.cc:176
Definition: Run.h:41
int numberOfHits(HitCategory category) const
Definition: HitPattern.h:718
TrajectoryStateOnSurface innerStateOnSurface(const reco::Track &tk, const TrackingGeometry &geom, const MagneticField *field, bool withErr=true)
Definition: DDAxes.h:10