26 barrelRecHit_token_ = consumes<edm::SortedCollection<EcalRecHit,edm::StrictWeakOrdering<EcalRecHit> > >(pset.
getParameter<
edm::InputTag>(
"barrelRecHitProducer"));
29 endcapRecHit_token_ = consumes<edm::SortedCollection<EcalRecHit,edm::StrictWeakOrdering<EcalRecHit> > >(pset.
getParameter<
edm::InputTag>(
"endcapRecHitProducer"));
35 invMassEtCut_ = pset.
getParameter<
double>(
"invMassEtCut");
37 numberOfSteps_ = pset.
getParameter<
int>(
"numberOfSteps");
39 useTriggerFiltering_ = pset.
getParameter<
bool>(
"useTriggerFiltering");
40 minimalSetOfHistos_ = pset.
getParameter<
bool>(
"minimalSetOfHistos");
41 excludeBkgHistos_ = pset.
getParameter<
bool>(
"excludeBkgHistos");
43 isolationStrength_ = pset.
getParameter<
int>(
"isolationStrength");
46 histo_index_photons_ = 0;
47 histo_index_conversions_ = 0;
48 histo_index_efficiency_ = 0;
49 histo_index_invMass_ = 0;
54 parts_.push_back(
"AllEcal");
55 parts_.push_back(
"Barrel");
56 parts_.push_back(
"Endcaps");
58 types_.push_back(
"All");
59 types_.push_back(
"GoodCandidate");
60 if (!excludeBkgHistos_)
62 types_.push_back(
"Background");
91 sigmaIetaMin_ = pset.
getParameter<
double>(
"sigmaIetaMin");
92 sigmaIetaMax_ = pset.
getParameter<
double>(
"sigmaIetaMax");
106 dPhiTracksBin_ = pset.
getParameter<
int>(
"dPhiTracksBin");
107 dPhiTracksMin_ = pset.
getParameter<
double>(
"dPhiTracksMin");
108 dPhiTracksMax_ = pset.
getParameter<
double>(
"dPhiTracksMax");
110 dEtaTracksBin_ = pset.
getParameter<
int>(
"dEtaTracksBin");
111 dEtaTracksMin_ = pset.
getParameter<
double>(
"dEtaTracksMin");
112 dEtaTracksMax_ = pset.
getParameter<
double>(
"dEtaTracksMax");
134 reducedEtBin_ = etBin_/4;
135 reducedEtaBin_ = etaBin_/4;
136 reducedR9Bin_ = r9Bin_/4;
137 reducedSumBin_ = sumBin_/4;
148 bookHistogramsForHistogramCounts(iBooker);
150 bookHistogramsEfficiency(iBooker);
151 bookHistogramsInvMass(iBooker);
152 bookHistogramsPhotons(iBooker);
153 bookHistogramsConversions(iBooker);
155 fillHistogramsForHistogramCounts(iBooker);
162 totalNumberOfHistos_efficiencyFolder = iBooker.
bookInt(
"numberOfHistogramsInEfficiencyFolder");
163 totalNumberOfHistos_invMassFolder = iBooker.
bookInt(
"numberOfHistogramsInInvMassFolder");
164 totalNumberOfHistos_photonsFolder = iBooker.
bookInt(
"numberOfHistogramsInPhotonsFolder");
165 totalNumberOfHistos_conversionsFolder = iBooker.
bookInt(
"numberOfHistogramsInConversionsFolder");
171 totalNumberOfHistos_efficiencyFolder->Fill(histo_index_efficiency_);
172 totalNumberOfHistos_invMassFolder->Fill(histo_index_invMass_);
173 totalNumberOfHistos_photonsFolder->Fill(histo_index_photons_);
174 totalNumberOfHistos_conversionsFolder->Fill(histo_index_conversions_);
183 h_phoEta_Loose_ = iBooker.
book1D(
"phoEtaLoose",
"Loose Photon #eta", etaBin_, etaMin_, etaMax_);
184 h_phoEta_Tight_ = iBooker.
book1D(
"phoEtaTight",
"Tight Photon #eta", etaBin_, etaMin_, etaMax_);
186 h_phoEt_Loose_ = iBooker.
book1D(
"phoEtLoose",
"Loose Photon E_{T}", etBin_, etMin_, etMax_);
187 h_phoEt_Tight_ = iBooker.
book1D(
"phoEtTight",
"Tight Photon E_{T}", etBin_, etMin_, etMax_);
189 h_phoEta_preHLT_ = iBooker.
book1D(
"phoEtaPreHLT",
"Photon #eta: before HLT", etaBin_, etaMin_, etaMax_);
190 h_phoEta_postHLT_ = iBooker.
book1D(
"phoEtaPostHLT",
"Photon #eta: after HLT", etaBin_, etaMin_, etaMax_);
191 h_phoEt_preHLT_ = iBooker.
book1D(
"phoEtPreHLT",
"Photon E_{T}: before HLT", etBin_, etMin_, etMax_);
192 h_phoEt_postHLT_ = iBooker.
book1D(
"phoEtPostHLT",
"Photon E_{T}: after HLT", etBin_, etMin_, etMax_);
194 h_convEta_Loose_ = iBooker.
book1D(
"convEtaLoose",
"Converted Loose Photon #eta", etaBin_, etaMin_, etaMax_);
195 h_convEta_Tight_ = iBooker.
book1D(
"convEtaTight",
"Converted Tight Photon #eta", etaBin_, etaMin_, etaMax_);
196 h_convEt_Loose_ = iBooker.
book1D(
"convEtLoose",
"Converted Loose Photon E_{T}", etBin_, etMin_, etMax_);
197 h_convEt_Tight_ = iBooker.
book1D(
"convEtTight",
"Converted Tight Photon E_{T}", etBin_, etMin_, etMax_);
199 h_phoEta_Vertex_ = iBooker.
book1D(
"phoEtaVertex",
"Converted Photons before valid vertex cut: #eta", etaBin_, etaMin_, etaMax_);
202 vector<MonitorElement*> temp1DVectorEta;
203 vector<MonitorElement*> temp1DVectorPhi;
204 vector<vector<MonitorElement*> > temp2DVectorPhi;
206 for(
int cut = 0;
cut != numberOfSteps_; ++
cut){
208 currentFolder_.str(
"");
209 currentFolder_ <<
"Egamma/"+fName_+
"/" << types_[
type] <<
"Photons/Et above " << (
cut+1)*cutStep_ <<
" GeV/Conversions";
212 temp1DVectorEta.push_back(iBooker.
book1D(
"phoConvEtaForEfficiency",
"Converted Photon #eta;#eta",etaBin_,etaMin_,etaMax_));
214 temp1DVectorPhi.push_back(iBooker.
book1D(
"phoConvPhiForEfficiency"+parts_[
part],
"Converted Photon #phi;#phi",phiBin_,phiMin_,phiMax_));
216 temp2DVectorPhi.push_back(temp1DVectorPhi);
217 temp1DVectorPhi.clear();
219 h_phoConvEtaForEfficiency_.push_back(temp1DVectorEta);
220 temp1DVectorEta.clear();
221 h_phoConvPhiForEfficiency_.push_back(temp2DVectorPhi);
222 temp2DVectorPhi.clear();
231 h_invMassAllPhotons_ = bookHisto(iBooker,
"invMassAllIsolatedPhotons",
"Two photon invariant mass: All isolated photons;M (GeV)", etBin_, etMin_, etMax_);
232 h_invMassPhotonsEBarrel_ = bookHisto(iBooker,
"invMassIsoPhotonsEBarrel",
"Two photon invariant mass: isolated photons in barrel; M (GeV)", etBin_, etMin_, etMax_);
233 h_invMassPhotonsEEndcap_ = bookHisto(iBooker,
"invMassIsoPhotonsEEndcap",
"Two photon invariant mass: isolated photons in endcap; M (GeV)", etBin_, etMin_, etMax_);
235 h_invMassZeroWithTracks_ = bookHisto(iBooker,
"invMassZeroWithTracks",
"Two photon invariant mass: Neither has tracks;M (GeV)", etBin_, etMin_, etMax_);
236 h_invMassOneWithTracks_ = bookHisto(iBooker,
"invMassOneWithTracks",
"Two photon invariant mass: Only one has tracks;M (GeV)", etBin_, etMin_, etMax_);
237 h_invMassTwoWithTracks_ = bookHisto(iBooker,
"invMassTwoWithTracks",
"Two photon invariant mass: Both have tracks;M (GeV)", etBin_, etMin_, etMax_);
239 h_nRecoVtx_ = bookHisto(iBooker,
"nOfflineVtx",
"# of Offline Vertices", 80, -0.5, 79.5);
248 book3DHistoVector(iBooker, h_phoE_,
"1D",
"phoE",
"Energy;E (GeV)",eBin_,eMin_,eMax_);
249 book3DHistoVector(iBooker, h_phoSigmaEoverE_,
"1D",
"phoSigmaEoverE",
"#sigma_{E}/E; #sigma_{E}/E", 100,0.,0.08);
250 book3DHistoVector(iBooker, p_phoSigmaEoverEvsNVtx_,
"Profile",
"phoSigmaEoverEvsNVtx",
"#sigma_{E}/E vs NVtx; N_{vtx}; #sigma_{E}/E",80, -0.5, 79.5, 100,0., 0.08);
251 book3DHistoVector(iBooker, h_phoEt_,
"1D",
"phoEt",
"E_{T};E_{T} (GeV)", etBin_,etMin_,etMax_);
254 book3DHistoVector(iBooker, h_nPho_,
"1D",
"nPho",
"Number of Photons per Event;# #gamma",numberBin_,numberMin_,numberMax_);
258 book2DHistoVector(iBooker, h_phoEta_,
"1D",
"phoEta",
"#eta;#eta",etaBin_,etaMin_,etaMax_) ;
259 book3DHistoVector(iBooker, h_phoPhi_,
"1D",
"phoPhi",
"#phi;#phi",phiBin_,phiMin_,phiMax_) ;
262 book2DHistoVector(iBooker, h_scEta_,
"1D",
"scEta",
"SuperCluster #eta;#eta",etaBin_,etaMin_,etaMax_) ;
263 book3DHistoVector(iBooker, h_scPhi_,
"1D",
"scPhi",
"SuperCluster #phi;#phi",phiBin_,phiMin_,phiMax_) ;
267 book3DHistoVector(iBooker, h_r9_,
"1D",
"r9",
"R9;R9",r9Bin_,r9Min_, r9Max_);
269 book2DHistoVector(iBooker, h_r9VsEt_,
"2D",
"r9VsEt2D",
"R9 vs E_{T};E_{T} (GeV);R9",reducedEtBin_,etMin_,etMax_,reducedR9Bin_,r9Min_,r9Max_);
271 book2DHistoVector(iBooker, p_r9VsEt_,
"Profile",
"r9VsEt",
"Avg R9 vs E_{T};E_{T} (GeV);R9",etBin_,etMin_,etMax_,r9Bin_,r9Min_,r9Max_);
273 book2DHistoVector(iBooker, h_r9VsEta_,
"2D",
"r9VsEta2D",
"R9 vs #eta;#eta;R9",reducedEtaBin_,etaMin_,etaMax_,reducedR9Bin_,r9Min_,r9Max_);
275 book2DHistoVector(iBooker, p_r9VsEta_,
"Profile",
"r9VsEta",
"Avg R9 vs #eta;#eta;R9",etaBin_,etaMin_,etaMax_,r9Bin_,r9Min_,r9Max_);
278 book3DHistoVector(iBooker, h_phoSigmaIetaIeta_,
"1D",
"phoSigmaIetaIeta",
"#sigma_{i#etai#eta};#sigma_{i#etai#eta}",sigmaIetaBin_,sigmaIetaMin_,sigmaIetaMax_);
280 book2DHistoVector(iBooker, h_sigmaIetaIetaVsEta_,
"2D",
"sigmaIetaIetaVsEta2D",
"#sigma_{i#etai#eta} vs #eta;#eta;#sigma_{i#etai#eta}",reducedEtaBin_,etaMin_,etaMax_,sigmaIetaBin_,sigmaIetaMin_,sigmaIetaMax_);
282 book2DHistoVector(iBooker, p_sigmaIetaIetaVsEta_,
"Profile",
"sigmaIetaIetaVsEta",
"Avg #sigma_{i#etai#eta} vs #eta;#eta;#sigma_{i#etai#eta}",etaBin_,etaMin_,etaMax_,sigmaIetaBin_,sigmaIetaMin_,sigmaIetaMax_);
286 book2DHistoVector(iBooker, h_e1x5VsEt_,
"2D",
"e1x5VsEt2D",
"E1x5 vs E_{T};E_{T} (GeV);E1X5 (GeV)",reducedEtBin_,etMin_,etMax_,reducedEtBin_,etMin_,etMax_);
288 book2DHistoVector(iBooker, p_e1x5VsEt_,
"Profile",
"e1x5VsEt",
"Avg E1x5 vs E_{T};E_{T} (GeV);E1X5 (GeV)",etBin_,etMin_,etMax_,etBin_,etMin_,etMax_);
290 book2DHistoVector(iBooker, h_e1x5VsEta_,
"2D",
"e1x5VsEta2D",
"E1x5 vs #eta;#eta;E1X5 (GeV)",reducedEtaBin_,etaMin_,etaMax_,reducedEtBin_,etMin_,etMax_);
292 book2DHistoVector(iBooker, p_e1x5VsEta_,
"Profile",
"e1x5VsEta",
"Avg E1x5 vs #eta;#eta;E1X5 (GeV)",etaBin_,etaMin_,etaMax_,etBin_,etMin_,etMax_);
296 book2DHistoVector(iBooker, h_e2x5VsEt_,
"2D",
"e2x5VsEt2D",
"E2x5 vs E_{T};E_{T} (GeV);E2X5 (GeV)",reducedEtBin_,etMin_,etMax_,reducedEtBin_,etMin_,etMax_);
298 book2DHistoVector(iBooker, p_e2x5VsEt_,
"Profile",
"e2x5VsEt",
"Avg E2x5 vs E_{T};E_{T} (GeV);E2X5 (GeV)",etBin_,etMin_,etMax_,etBin_,etMin_,etMax_);
300 book2DHistoVector(iBooker, h_e2x5VsEta_,
"2D",
"e2x5VsEta2D",
"E2x5 vs #eta;#eta;E2X5 (GeV)",reducedEtaBin_,etaMin_,etaMax_,reducedEtBin_,etMin_,etMax_);
302 book2DHistoVector(iBooker, p_e2x5VsEta_,
"Profile",
"e2x5VsEta",
"Avg E2x5 vs #eta;#eta;E2X5 (GeV)",etaBin_,etaMin_,etaMax_,etBin_,etMin_,etMax_);
306 book2DHistoVector(iBooker, h_r1x5VsEt_,
"2D",
"r1x5VsEt2D",
"R1x5 vs E_{T};E_{T} (GeV);R1X5",reducedEtBin_,etMin_,etMax_,reducedR9Bin_,r9Min_,r9Max_);
308 book2DHistoVector(iBooker, p_r1x5VsEt_,
"Profile",
"r1x5VsEt",
"Avg R1x5 vs E_{T};E_{T} (GeV);R1X5",etBin_,etMin_,etMax_,r9Bin_,r9Min_,r9Max_);
310 book2DHistoVector(iBooker, h_r1x5VsEta_,
"2D",
"r1x5VsEta2D",
"R1x5 vs #eta;#eta;R1X5",reducedEtaBin_,etaMin_,etaMax_,reducedR9Bin_,r9Min_,r9Max_);
312 book2DHistoVector(iBooker, p_r1x5VsEta_,
"Profile",
"r1x5VsEta",
"Avg R1x5 vs #eta;#eta;R1X5",etaBin_,etaMin_,etaMax_,r9Bin_,r9Min_,r9Max_);
316 book2DHistoVector(iBooker, h_r2x5VsEt_ ,
"2D",
"r2x5VsEt2D",
"R2x5 vs E_{T};E_{T} (GeV);R2X5",reducedEtBin_,etMin_,etMax_,reducedR9Bin_,r9Min_,r9Max_);
318 book2DHistoVector(iBooker, p_r2x5VsEt_ ,
"Profile",
"r2x5VsEt",
"Avg R2x5 vs E_{T};E_{T} (GeV);R2X5",etBin_,etMin_,etMax_,r9Bin_,r9Min_,r9Max_);
320 book2DHistoVector(iBooker, h_r2x5VsEta_ ,
"2D",
"r2x5VsEta2D",
"R2x5 vs #eta;#eta;R2X5",reducedEtaBin_,etaMin_,etaMax_,reducedR9Bin_,r9Min_,r9Max_);
322 book2DHistoVector(iBooker, p_r2x5VsEta_ ,
"Profile",
"r2x5VsEta",
"Avg R2x5 vs #eta;#eta;R2X5",etaBin_,etaMin_,etaMax_,r9Bin_,r9Min_,r9Max_);
326 book2DHistoVector(iBooker, h_maxEXtalOver3x3VsEt_ ,
"2D",
"maxEXtalOver3x3VsEt2D",
"(Max Xtal E)/E3x3 vs E_{T};E_{T} (GeV);(Max Xtal E)/E3x3",reducedEtBin_,etMin_,etMax_,r9Bin_,r9Min_,r9Max_);
328 book2DHistoVector(iBooker, p_maxEXtalOver3x3VsEt_ ,
"Profile",
"maxEXtalOver3x3VsEt",
"Avg (Max Xtal E)/E3x3 vs E_{T};E_{T} (GeV);(Max Xtal E)/E3x3",etBin_,etMin_,etMax_,r9Bin_,r9Min_,r9Max_);
330 book2DHistoVector(iBooker, h_maxEXtalOver3x3VsEta_ ,
"2D",
"maxEXtalOver3x3VsEta2D",
"(Max Xtal E)/E3x3 vs #eta;#eta;(Max Xtal E)/E3x3",reducedEtaBin_,etaMin_,etaMax_,r9Bin_,r9Min_,r9Max_);
332 book2DHistoVector(iBooker, p_maxEXtalOver3x3VsEta_ ,
"Profile",
"maxEXtalOver3x3VsEta",
"Avg (Max Xtal E)/E3x3 vs #eta;#eta;(Max Xtal E)/E3x3",etaBin_,etaMin_,etaMax_,r9Bin_,r9Min_,r9Max_);
336 book2DHistoVector(iBooker, h_nTrackIsolSolid_ ,
"1D",
"nIsoTracksSolid",
"Number Of Tracks in the Solid Iso Cone;# tracks",numberBin_,numberMin_,numberMax_);
338 book2DHistoVector(iBooker, h_nTrackIsolSolidVsEt_ ,
"2D",
"nIsoTracksSolidVsEt2D",
"Number Of Tracks in the Solid Iso Cone vs E_{T};E_{T};# tracks",reducedEtBin_,etMin_, etMax_,numberBin_,numberMin_,numberMax_);
340 book2DHistoVector(iBooker, p_nTrackIsolSolidVsEt_ ,
"Profile",
"nIsoTracksSolidVsEt",
"Avg Number Of Tracks in the Solid Iso Cone vs E_{T};E_{T};# tracks",etBin_,etMin_,etMax_,numberBin_,numberMin_,numberMax_);
342 book2DHistoVector(iBooker, h_nTrackIsolSolidVsEta_ ,
"2D",
"nIsoTracksSolidVsEta2D",
"Number Of Tracks in the Solid Iso Cone vs #eta;#eta;# tracks",reducedEtaBin_,etaMin_, etaMax_,numberBin_,numberMin_,numberMax_);
344 book2DHistoVector(iBooker, p_nTrackIsolSolidVsEta_ ,
"Profile",
"nIsoTracksSolidVsEta",
"Avg Number Of Tracks in the Solid Iso Cone vs #eta;#eta;# tracks",etaBin_,etaMin_, etaMax_,numberBin_,numberMin_,numberMax_);
347 book2DHistoVector(iBooker, h_nTrackIsolHollow_ ,
"1D",
"nIsoTracksHollow",
"Number Of Tracks in the Hollow Iso Cone;# tracks",numberBin_,numberMin_,numberMax_);
349 book2DHistoVector(iBooker, h_nTrackIsolHollowVsEt_ ,
"2D",
"nIsoTracksHollowVsEt2D",
"Number Of Tracks in the Hollow Iso Cone vs E_{T};E_{T};# tracks",reducedEtBin_,etMin_, etMax_,numberBin_,numberMin_,numberMax_);
351 book2DHistoVector(iBooker, p_nTrackIsolHollowVsEt_ ,
"Profile",
"nIsoTracksHollowVsEt",
"Avg Number Of Tracks in the Hollow Iso Cone vs E_{T};E_{T};# tracks",etBin_,etMin_,etMax_,numberBin_,numberMin_,numberMax_);
353 book2DHistoVector(iBooker, h_nTrackIsolHollowVsEta_ ,
"2D",
"nIsoTracksHollowVsEta2D",
"Number Of Tracks in the Hollow Iso Cone vs #eta;#eta;# tracks",reducedEtaBin_,etaMin_, etaMax_,numberBin_,numberMin_,numberMax_);
355 book2DHistoVector(iBooker, p_nTrackIsolHollowVsEta_ ,
"Profile",
"nIsoTracksHollowVsEta",
"Avg Number Of Tracks in the Hollow Iso Cone vs #eta;#eta;# tracks",etaBin_,etaMin_, etaMax_,numberBin_,numberMin_,numberMax_);
358 book2DHistoVector(iBooker, h_trackPtSumSolid_ ,
"1D",
"isoPtSumSolid",
"Track P_{T} Sum in the Solid Iso Cone;P_{T} (GeV)",sumBin_,sumMin_,sumMax_);
360 book2DHistoVector(iBooker, h_trackPtSumSolidVsEt_ ,
"2D",
"isoPtSumSolidVsEt2D",
"Track P_{T} Sum in the Solid Iso Cone;E_{T} (GeV);P_{T} (GeV)",reducedEtBin_,etMin_, etMax_,reducedSumBin_,sumMin_,sumMax_);
362 book2DHistoVector(iBooker, p_trackPtSumSolidVsEt_ ,
"Profile",
"isoPtSumSolidVsEt",
"Avg Track P_{T} Sum in the Solid Iso Cone vs E_{T};E_{T} (GeV);P_{T} (GeV)",etBin_,etMin_,etMax_,sumBin_,sumMin_,sumMax_);
364 book2DHistoVector(iBooker, h_trackPtSumSolidVsEta_ ,
"2D",
"isoPtSumSolidVsEta2D",
"Track P_{T} Sum in the Solid Iso Cone;#eta;P_{T} (GeV)",reducedEtaBin_,etaMin_, etaMax_,reducedSumBin_,sumMin_,sumMax_);
366 book2DHistoVector(iBooker, p_trackPtSumSolidVsEta_ ,
"Profile",
"isoPtSumSolidVsEta",
"Avg Track P_{T} Sum in the Solid Iso Cone vs #eta;#eta;P_{T} (GeV)",etaBin_,etaMin_, etaMax_,sumBin_,sumMin_,sumMax_);
369 book2DHistoVector(iBooker, h_trackPtSumHollow_ ,
"1D",
"isoPtSumHollow",
"Track P_{T} Sum in the Hollow Iso Cone;P_{T} (GeV)",sumBin_,sumMin_,sumMax_);
371 book2DHistoVector(iBooker, h_trackPtSumHollowVsEt_ ,
"2D",
"isoPtSumHollowVsEt2D",
"Track P_{T} Sum in the Hollow Iso Cone;E_{T} (GeV);P_{T} (GeV)",reducedEtBin_,etMin_, etMax_,reducedSumBin_,sumMin_,sumMax_);
373 book2DHistoVector(iBooker, p_trackPtSumHollowVsEt_ ,
"Profile",
"isoPtSumHollowVsEt",
"Avg Track P_{T} Sum in the Hollow Iso Cone vs E_{T};E_{T} (GeV);P_{T} (GeV)",etBin_,etMin_,etMax_,sumBin_,sumMin_,sumMax_);
375 book2DHistoVector(iBooker, h_trackPtSumHollowVsEta_ ,
"2D",
"isoPtSumHollowVsEta2D",
"Track P_{T} Sum in the Hollow Iso Cone;#eta;P_{T} (GeV)",reducedEtaBin_,etaMin_, etaMax_,reducedSumBin_,sumMin_,sumMax_);
377 book2DHistoVector(iBooker, p_trackPtSumHollowVsEta_ ,
"Profile",
"isoPtSumHollowVsEta",
"Avg Track P_{T} Sum in the Hollow Iso Cone vs #eta;#eta;P_{T} (GeV)",etaBin_,etaMin_, etaMax_,sumBin_,sumMin_,sumMax_);
381 book2DHistoVector(iBooker, h_ecalSum_,
"1D",
"ecalSum",
"Ecal Sum in the Iso Cone;E (GeV)",sumBin_,sumMin_,sumMax_);
382 book2DHistoVector(iBooker, h_ecalSumEBarrel_,
"1D",
"ecalSumEBarrel",
"Ecal Sum in the IsoCone for Barrel;E (GeV)",sumBin_,sumMin_,sumMax_);
383 book2DHistoVector(iBooker, h_ecalSumEEndcap_,
"1D",
"ecalSumEEndcap",
"Ecal Sum in the IsoCone for Endcap;E (GeV)",sumBin_,sumMin_,sumMax_);
385 book2DHistoVector(iBooker, h_ecalSumVsEt_,
"2D",
"ecalSumVsEt2D",
"Ecal Sum in the Iso Cone;E_{T} (GeV);E (GeV)",reducedEtBin_,etMin_, etMax_,reducedSumBin_,sumMin_,sumMax_);
387 book3DHistoVector(iBooker, p_ecalSumVsEt_,
"Profile",
"ecalSumVsEt",
"Avg Ecal Sum in the Iso Cone vs E_{T};E_{T} (GeV);E (GeV)",etBin_,etMin_, etMax_,sumBin_,sumMin_,sumMax_);
389 book2DHistoVector(iBooker, h_ecalSumVsEta_,
"2D",
"ecalSumVsEta2D",
"Ecal Sum in the Iso Cone;#eta;E (GeV)",reducedEtaBin_,etaMin_, etaMax_,reducedSumBin_,sumMin_,sumMax_);
391 book2DHistoVector(iBooker, p_ecalSumVsEta_,
"Profile",
"ecalSumVsEta",
"Avg Ecal Sum in the Iso Cone vs #eta;#eta;E (GeV)",etaBin_,etaMin_, etaMax_,sumBin_,sumMin_,sumMax_);
394 book2DHistoVector(iBooker, h_hcalSum_,
"1D",
"hcalSum",
"Hcal Sum in the Iso Cone;E (GeV)",sumBin_,sumMin_,sumMax_);
395 book2DHistoVector(iBooker, h_hcalSumEBarrel_,
"1D",
"hcalSumEBarrel",
"Hcal Sum in the IsoCone for Barrel;E (GeV)",sumBin_,sumMin_,sumMax_);
396 book2DHistoVector(iBooker, h_hcalSumEEndcap_,
"1D",
"hcalSumEEndcap",
"Hcal Sum in the IsoCone for Endcap;E (GeV)",sumBin_,sumMin_,sumMax_);
398 book2DHistoVector(iBooker, h_hcalSumVsEt_,
"2D",
"hcalSumVsEt2D",
"Hcal Sum in the Iso Cone;E_{T} (GeV);E (GeV)",reducedEtBin_,etMin_, etMax_,reducedSumBin_,sumMin_,sumMax_);
400 book3DHistoVector(iBooker, p_hcalSumVsEt_,
"Profile",
"hcalSumVsEt",
"Avg Hcal Sum in the Iso Cone vs E_{T};E_{T} (GeV);E (GeV)",etBin_,etMin_, etMax_,sumBin_,sumMin_,sumMax_);
402 book2DHistoVector(iBooker, h_hcalSumVsEta_,
"2D",
"hcalSumVsEta2D",
"Hcal Sum in the Iso Cone;#eta;E (GeV)",reducedEtaBin_,etaMin_, etaMax_,reducedSumBin_,sumMin_,sumMax_);
404 book2DHistoVector(iBooker, p_hcalSumVsEta_,
"Profile",
"hcalSumVsEta",
"Avg Hcal Sum in the Iso Cone vs #eta;#eta;E (GeV)",etaBin_,etaMin_, etaMax_,sumBin_,sumMin_,sumMax_);
407 book3DHistoVector(iBooker, h_hOverE_,
"1D",
"hOverE",
"H/E;H/E",hOverEBin_,hOverEMin_,hOverEMax_);
408 book2DHistoVector(iBooker, p_hOverEVsEt_,
"Profile",
"hOverEVsEt",
"Avg H/E vs Et;E_{T} (GeV);H/E",etBin_,etMin_,etMax_,hOverEBin_,hOverEMin_,hOverEMax_);
409 book2DHistoVector(iBooker, p_hOverEVsEta_,
"Profile",
"hOverEVsEta",
"Avg H/E vs #eta;#eta;H/E",etaBin_,etaMin_,etaMax_,hOverEBin_,hOverEMin_,hOverEMax_);
410 book3DHistoVector(iBooker, h_h1OverE_,
"1D",
"h1OverE",
"H/E for Depth 1;H/E",hOverEBin_,hOverEMin_,hOverEMax_);
411 book3DHistoVector(iBooker, h_h2OverE_,
"1D",
"h2OverE",
"H/E for Depth 2;H/E",hOverEBin_,hOverEMin_,hOverEMax_);
414 book2DHistoVector(iBooker, h_phoIsoBarrel_,
"1D",
"phoIsoBarrel",
"PF photon iso Barrel;E (GeV)",reducedEtBin_,etMin_,25.);
415 book2DHistoVector(iBooker, h_phoIsoEndcap_,
"1D",
"phoIsoEndcap",
"PF photon iso Endcap;E (GeV)",reducedEtBin_,etMin_,25.);
416 book2DHistoVector(iBooker, h_chHadIsoBarrel_,
"1D",
"chHadIsoBarrel",
"PF charged Had iso Barrel;E (GeV)",reducedEtBin_,etMin_,25.);
417 book2DHistoVector(iBooker, h_chHadIsoEndcap_,
"1D",
"chHadIsoEndcap",
"PF charged Had iso Endcap;E (GeV)",reducedEtBin_,etMin_,25.);
418 book2DHistoVector(iBooker, h_nHadIsoBarrel_,
"1D",
"neutralHadIsoBarrel",
"PF neutral Had iso Barrel;E (GeV)",reducedEtBin_,etMin_,25.);
419 book2DHistoVector(iBooker, h_nHadIsoEndcap_,
"1D",
"neutralHadIsoEndcap",
"PF neutral Had iso Endcap;E (GeV)",reducedEtBin_,etMin_,25.);
423 book2DHistoVector(iBooker, h_phoEt_BadChannels_ ,
"1D",
"phoEtBadChannels",
"Fraction Containing Bad Channels: E_{T};E_{T} (GeV)",etBin_,etMin_,etMax_);
424 book2DHistoVector(iBooker, h_phoEta_BadChannels_ ,
"1D",
"phoEtaBadChannels",
"Fraction Containing Bad Channels: #eta;#eta",etaBin_,etaMin_,etaMax_);
425 book2DHistoVector(iBooker, h_phoPhi_BadChannels_ ,
"1D",
"phoPhiBadChannels",
"Fraction Containing Bad Channels: #phi;#phi",phiBin_,phiMin_,phiMax_);
431 iBooker.
setCurrentFolder(
"Egamma/"+fName_+
"/AllPhotons/Et Above 0 GeV/Conversions");
434 book3DHistoVector(iBooker, h_phoConvE_ ,
"1D",
"phoConvE",
"E;E (GeV)",eBin_,eMin_,eMax_);
435 book3DHistoVector(iBooker, h_phoConvEt_ ,
"1D",
"phoConvEt",
"E_{T};E_{T} (GeV)",etBin_,etMin_,etMax_);
438 book2DHistoVector(iBooker, h_phoConvEta_ ,
"1D",
"phoConvEta",
"#eta;#eta",etaBin_,etaMin_,etaMax_);
439 book3DHistoVector(iBooker, h_phoConvPhi_ ,
"1D",
"phoConvPhi",
"#phi;#phi",phiBin_,phiMin_,phiMax_);
442 book3DHistoVector(iBooker, h_nConv_ ,
"1D",
"nConv",
"Number Of Conversions per Event ;# conversions",numberBin_,numberMin_,numberMax_);
445 book3DHistoVector(iBooker, h_phoConvR9_ ,
"1D",
"phoConvR9",
"R9;R9",r9Bin_,r9Min_,r9Max_);
448 book3DHistoVector(iBooker, h_eOverPTracks_ ,
"1D",
"eOverPTracks",
"E/P;E/P",eOverPBin_,eOverPMin_,eOverPMax_);
449 book3DHistoVector(iBooker, h_pOverETracks_ ,
"1D",
"pOverETracks",
"P/E;P/E",eOverPBin_,eOverPMin_,eOverPMax_);
450 book3DHistoVector(iBooker, h_dPhiTracksAtVtx_ ,
"1D",
"dPhiTracksAtVtx",
"#Delta#phi of Tracks at Vertex;#Delta#phi",dPhiTracksBin_,dPhiTracksMin_,dPhiTracksMax_);
451 book3DHistoVector(iBooker, h_dPhiTracksAtEcal_,
"1D",
"dPhiTracksAtEcal",
"Abs(#Delta#phi) of Tracks at Ecal;#Delta#phi",dPhiTracksBin_,0.,dPhiTracksMax_);
452 book3DHistoVector(iBooker, h_dEtaTracksAtEcal_,
"1D",
"dEtaTracksAtEcal",
"#Delta#eta of Tracks at Ecal;#Delta#eta",dEtaTracksBin_,dEtaTracksMin_,dEtaTracksMax_);
453 book3DHistoVector(iBooker, h_dCotTracks_ ,
"1D",
"dCotTracks",
"#Deltacot(#theta) of Tracks;#Deltacot(#theta)",dEtaTracksBin_,dEtaTracksMin_,dEtaTracksMax_);
454 book2DHistoVector(iBooker, p_dCotTracksVsEta_ ,
"Profile",
"dCotTracksVsEta",
"Avg #Deltacot(#theta) of Tracks vs #eta;#eta;#Deltacot(#theta)",etaBin_,etaMin_,etaMax_,dEtaTracksBin_,dEtaTracksMin_,dEtaTracksMax_);
455 book2DHistoVector(iBooker, p_nHitsVsEta_ ,
"Profile",
"nHitsVsEta",
"Avg Number of Hits per Track vs #eta;#eta;# hits",etaBin_,etaMin_,etaMax_,etaBin_,0,16);
456 book2DHistoVector(iBooker, h_tkChi2_ ,
"1D",
"tkChi2",
"#chi^{2} of Track Fitting;#chi^{2}",chi2Bin_,chi2Min_,chi2Max_);
457 book2DHistoVector(iBooker, p_tkChi2VsEta_ ,
"Profile",
"tkChi2VsEta",
"Avg #chi^{2} of Track Fitting vs #eta;#eta;#chi^{2}",etaBin_,etaMin_,etaMax_,chi2Bin_,chi2Min_,chi2Max_);
460 book2DHistoVector(iBooker, h_convVtxRvsZ_ ,
"2D",
"convVtxRvsZ",
"Vertex Position;Z (cm);R (cm)",500,zMin_,zMax_,rBin_,rMin_,rMax_);
461 book2DHistoVector(iBooker, h_convVtxZEndcap_ ,
"1D",
"convVtxZEndcap",
"Vertex Position: #eta > 1.5;Z (cm)",zBin_,zMin_,zMax_);
462 book2DHistoVector(iBooker, h_convVtxZ_ ,
"1D",
"convVtxZ",
"Vertex Position;Z (cm)",zBin_,zMin_,zMax_);
463 book2DHistoVector(iBooker, h_convVtxR_ ,
"1D",
"convVtxR",
"Vertex Position: #eta < 1;R (cm)",rBin_,rMin_,rMax_);
464 book2DHistoVector(iBooker, h_convVtxYvsX_ ,
"2D",
"convVtxYvsX",
"Vertex Position: #eta < 1;X (cm);Y (cm)",xBin_,xMin_,xMax_,yBin_,yMin_,yMax_);
465 book2DHistoVector(iBooker, h_vertexChi2Prob_ ,
"1D",
"vertexChi2Prob",
"#chi^{2} Probability of Vertex Fitting;#chi^{2}",100,0.,1.0);
471 string histoName,
string title,
475 stringstream histo_number_stream;
478 if(iBooker.
pwd().find(
"InvMass" ) != string::npos){
479 histo_index_invMass_++;
480 histo_index = histo_index_invMass_;
482 if(iBooker.
pwd().find(
"Efficiencies" ) != string::npos){
483 histo_index_efficiency_++;
484 histo_index = histo_index_efficiency_;
487 histo_number_stream <<
"h_";
488 if(histo_index<10) histo_number_stream <<
"0";
489 histo_number_stream << histo_index;
495 vector<vector<MonitorElement*> > &temp2DVector,
496 string histoType,
string histoName,
string title,
502 vector<MonitorElement*> temp1DVector;
505 bool conversionPlot =
false;
506 if(iBooker.
pwd().find(
"Conversions" ) != string::npos) conversionPlot =
true;
507 bool TwoDPlot =
false;
508 if(histoName.find(
"2D" ) != string::npos) TwoDPlot =
true;
511 histo_index_conversions_++;
512 histo_index = histo_index_conversions_;
515 histo_index_photons_++;
516 histo_index = histo_index_photons_;
519 stringstream histo_number_stream;
520 histo_number_stream <<
"h_";
521 if(histo_index<10) histo_number_stream <<
"0";
522 histo_number_stream << histo_index <<
"_";
524 for(
int cut = 0;
cut != numberOfSteps_; ++
cut){
526 currentFolder_.str(
"");
527 currentFolder_ <<
"Egamma/"+fName_+
"/" << types_[
type] <<
"Photons/Et above " << (
cut+1)*cutStep_ <<
" GeV";
528 if(conversionPlot) currentFolder_ <<
"/Conversions";
533 if(conversionPlot) kind =
" Conversions: ";
534 else kind =
" Photons: ";
536 if(histoType==
"1D") temp1DVector.push_back(iBooker.
book1D( histo_number_stream.str()+histoName,types_[
type]+kind+
title,xbin,
xmin,
xmax));
537 else if(histoType==
"2D"){
538 if((TwoDPlot &&
type==0) || !TwoDPlot){
543 else cout <<
"bad histoType\n";
546 temp2DVector.push_back(temp1DVector);
547 temp1DVector.clear();
552 vector<vector<vector<MonitorElement*> > > &temp3DVector,
553 string histoType,
string histoName,
string title,
559 vector<MonitorElement*> temp1DVector;
560 vector<vector<MonitorElement*> > temp2DVector;
563 bool conversionPlot =
false;
564 if(iBooker.
pwd().find(
"Conversions" ) != string::npos) conversionPlot =
true;
567 histo_index_conversions_++;
568 histo_index = histo_index_conversions_;
571 histo_index_photons_++;
572 histo_index = histo_index_photons_;
575 stringstream histo_number_stream;
576 histo_number_stream <<
"h_";
577 if(histo_index<10) histo_number_stream <<
"0";
578 histo_number_stream << histo_index <<
"_";
580 for(
int cut = 0;
cut != numberOfSteps_; ++
cut){
583 currentFolder_.str(
"");
584 currentFolder_ <<
"Egamma/"+fName_+
"/" << types_[
type] <<
"Photons/Et above " << (
cut+1)*cutStep_ <<
" GeV";
585 if(conversionPlot) currentFolder_ <<
"/Conversions";
589 if(conversionPlot) kind =
" Conversions: ";
590 else kind =
" Photons: ";
592 if(histoType==
"1D") temp1DVector.push_back(iBooker.
book1D( histo_number_stream.str()+histoName+parts_[
part],types_[
type]+kind+parts_[
part]+
": "+
title,xbin,
xmin,
xmax));
595 else cout <<
"bad histoType\n";
597 temp2DVector.push_back(temp1DVector);
598 temp1DVector.clear();
600 temp3DVector.push_back(temp2DVector);
601 temp2DVector.clear();
611 if (nEvt_% prescaleFactor_ )
return;
613 LogInfo(fName_) <<
"PhotonAnalyzer Analyzing event number: " << e.
id() <<
" Global Counter " << nEvt_ <<
"\n";
616 bool validTriggerEvent=
true;
619 e.
getByToken(triggerEvent_token_,triggerEventHandle);
620 if(!triggerEventHandle.isValid()) {
621 edm::LogInfo(fName_) <<
"Error! Can't get the product: triggerEvent_" << endl;
622 validTriggerEvent=
false;
624 const trigger::TriggerEvent& triggerEvent(validTriggerEvent? *(triggerEventHandle.product()) : dummyTE);
630 if ( !photonHandle.isValid()) {
631 edm::LogInfo(fName_) <<
"Error! Can't get the product: photon_token_" << endl;
640 e.
getByToken(PhotonIDLoose_token_, loosePhotonFlag);
641 if ( !loosePhotonFlag.isValid()) {
642 edm::LogInfo(fName_) <<
"Error! Can't get the product: PhotonIDLoose_token_" << endl;
650 e.
getByToken(PhotonIDTight_token_, tightPhotonFlag);
651 if ( !tightPhotonFlag.isValid()) {
652 edm::LogInfo(fName_) <<
"Error! Can't get the product: PhotonIDTight_token_" << endl;
662 h_nRecoVtx_ ->Fill (
float(vtxH->size()));
676 int nConv[100][3][3];
689 for(uint filterIndex=0;filterIndex<triggerEvent.
sizeFilters();++filterIndex){
691 if(label.find(
"Photon" ) != string::npos ) {
692 for(uint filterKeyIndex=0;filterKeyIndex<triggerEvent.
filterKeys(filterIndex).size();++filterKeyIndex){
693 Keys.push_back(triggerEvent.
filterKeys(filterIndex)[filterKeyIndex]);
701 for ( uint
i=0 ;
i<
Keys.size() ; )
703 if (
i!=(
Keys.size()-1))
716 for(
unsigned int iPho=0; iPho < photonHandle->size(); iPho++) {
722 h_phoEta_preHLT_->Fill(aPho->
eta());
723 h_phoEt_preHLT_->Fill( aPho->
et());
726 double deltaRMin=1000.;
729 for (vector<int>::const_iterator objectKey=
Keys.begin();objectKey!=
Keys.end();objectKey++){
732 if(deltaR < deltaRMin) deltaRMin =
deltaR;
736 if(deltaRMin > deltaRMax) {
737 if(useTriggerFiltering_)
continue;
740 if(deltaRMin <= deltaRMax) {
741 h_phoEta_postHLT_->Fill(aPho->
eta() );
742 h_phoEt_postHLT_->Fill( aPho->
et() );
746 bool isLoosePhoton(
false), isTightPhoton(
false);
747 if ( photonSelection (aPho) ) isLoosePhoton=
true ;
750 bool phoIsInBarrel=
false;
751 bool phoIsInEndcap=
false;
753 if ( fabs(etaPho) < 1.479 )
760 if ( phoIsInBarrel ) part = 1;
761 if ( phoIsInEndcap ) part = 2;
764 bool isIsolated=
false;
765 if ( isolationStrength_ == 0) isIsolated = isLoosePhoton;
766 if ( isolationStrength_ == 1) isIsolated = isTightPhoton;
769 if ( isIsolated ) type=1;
770 if ( !excludeBkgHistos_ && !isIsolated ) type=2;
773 bool validEcalRecHits=
true;
776 if ( phoIsInBarrel ) {
778 e.
getByToken(barrelRecHit_token_, ecalRecHitHandle);
779 if (!ecalRecHitHandle.
isValid()) {
780 edm::LogError(fName_) <<
"Error! Can't get the product: barrelRecHit_token_";
781 validEcalRecHits=
false;
784 else if ( phoIsInEndcap ) {
786 e.
getByToken(endcapRecHit_token_, ecalRecHitHandle);
787 if (!ecalRecHitHandle.
isValid()) {
788 edm::LogError(fName_) <<
"Error! Can't get the product: endcapRecHit_token";
789 validEcalRecHits=
false;
792 if (validEcalRecHits) ecalRecHitCollection = *(ecalRecHitHandle.
product());
798 h_phoEta_Loose_->Fill(aPho->
eta());
799 h_phoEt_Loose_->Fill( aPho->
et() );
802 h_phoEta_Tight_->Fill(aPho->
eta());
803 h_phoEt_Tight_->Fill( aPho->
et() );
806 for (
int cut = 0;
cut !=numberOfSteps_; ++
cut) {
807 double Et = aPho->
et();
808 bool passesCuts =
false;
811 if ( useBinning_ && Et > (
cut+1)*cutStep_ && ( (Et < (
cut+2)*cutStep_) | (
cut == numberOfSteps_-1) ) ){
814 else if ( !useBinning_ && Et > (
cut+1)*cutStep_ ){
907 fill2DHistoVector(h_phoEta_,aPho->
eta(),
cut,
type);
916 if (standAlone_) fill2DHistoVector(h_r9VsEta_,aPho->
eta(),aPho->
r9(),
cut,
type);
917 fill2DHistoVector(p_r9VsEta_,aPho->
eta(),aPho->
r9(),
cut,
type);
918 if (standAlone_) fill2DHistoVector(h_r9VsEt_, aPho->
et(), aPho->
r9(),
cut,
type);
919 fill2DHistoVector(p_r9VsEt_, aPho->
et(), aPho->
r9(),
cut,
type);
921 if (standAlone_) fill2DHistoVector(h_e1x5VsEta_,aPho->
eta(),aPho->
e1x5(),
cut,
type);
922 fill2DHistoVector(p_e1x5VsEta_,aPho->
eta(),aPho->
e1x5(),
cut,
type);
923 if (standAlone_) fill2DHistoVector(h_e1x5VsEt_, aPho->
et(), aPho->
e1x5(),
cut,
type);
924 fill2DHistoVector(p_e1x5VsEt_, aPho->
et(), aPho->
e1x5(),
cut,
type);
926 if (standAlone_) fill2DHistoVector(h_e2x5VsEta_,aPho->
eta(),aPho->
e2x5(),
cut,
type);
927 fill2DHistoVector(p_e2x5VsEta_,aPho->
eta(),aPho->
e2x5(),
cut,
type);
928 if (standAlone_) fill2DHistoVector(h_e2x5VsEt_, aPho->
et(), aPho->
e2x5(),
cut,
type);
929 fill2DHistoVector(p_e2x5VsEt_, aPho->
et(), aPho->
e2x5(),
cut,
type);
936 if (standAlone_) fill2DHistoVector(h_r1x5VsEta_,aPho->
eta(),aPho->
r1x5(),
cut,
type);
937 fill2DHistoVector(p_r1x5VsEta_,aPho->
eta(),aPho->
r1x5(),
cut,
type);
938 if (standAlone_) fill2DHistoVector(h_r1x5VsEt_, aPho->
et(), aPho->
r1x5(),
cut,
type);
939 fill2DHistoVector(p_r1x5VsEt_, aPho->
et(), aPho->
r1x5(),
cut,
type);
941 if (standAlone_) fill2DHistoVector(h_r2x5VsEta_,aPho->
eta(),aPho->
r2x5(),
cut,
type);
942 fill2DHistoVector(p_r2x5VsEta_,aPho->
eta(),aPho->
r2x5(),
cut,
type);
943 if (standAlone_) fill2DHistoVector(h_r2x5VsEt_, aPho->
et(), aPho->
r2x5(),
cut,
type);
944 fill2DHistoVector(p_r2x5VsEt_, aPho->
et(), aPho->
r2x5(),
cut,
type);
951 bool atLeastOneDeadChannel=
false;
953 for(vector< pair<DetId, float> >::const_iterator rhIt = (*bcIt)->hitsAndFractions().begin();rhIt != (*bcIt)->hitsAndFractions().end(); ++rhIt) {
956 if (rhIt->first == (*it).id() ) {
957 if ( (*it).recoFlag() == 9 ) {
958 atLeastOneDeadChannel=
true;
965 if ( atLeastOneDeadChannel ) {
966 fill2DHistoVector(h_phoPhi_BadChannels_,aPho->
phi(),
cut,
type);
967 fill2DHistoVector(h_phoEta_BadChannels_,aPho->
eta(),
cut,
type);
968 fill2DHistoVector(h_phoEt_BadChannels_, aPho->
et(),
cut,
type);
982 for (
unsigned int iConv=0; iConv<conversions.
size(); iConv++) {
986 if ( aConv->nTracks() <2 )
continue;
989 if(
cut==0) h_phoEta_Vertex_->Fill(aConv->refittedPairMomentum().eta());
991 if ( !(aConv->conversionVertex().isValid()) )
continue;
993 float chi2Prob =
ChiSquaredProbability( aConv->conversionVertex().chi2(), aConv->conversionVertex().ndof() );
995 if(chi2Prob<0.0005)
continue;
997 fill2DHistoVector(h_vertexChi2Prob_,chi2Prob,
cut,type);
1003 if (
cut==0 && isLoosePhoton){
1004 h_convEta_Loose_->Fill(aPho->
eta());
1005 h_convEt_Loose_->Fill( aPho->
et() );
1007 if (
cut==0 && isTightPhoton){
1008 h_convEta_Tight_->Fill(aPho->
eta());
1009 h_convEt_Tight_->Fill( aPho->
et() );
1012 fill2DHistoVector(h_phoConvEta_,aConv->refittedPairMomentum().eta(),
cut,
type);
1013 fill3DHistoVector(h_phoConvPhi_,aConv->refittedPairMomentum().phi(),
cut,
type,
part);
1016 fill2DHistoVector(h_phoConvEtaForEfficiency_,aPho->
eta(),
cut,
type);
1017 fill3DHistoVector(h_phoConvPhiForEfficiency_,aPho->
phi(),
cut,
type,
part);
1020 double convR=
sqrt(aConv->conversionVertex().position().perp2());
1021 double scalar = aConv->conversionVertex().position().x()*aConv->refittedPairMomentum().x() + aConv->conversionVertex().position().y()*aConv->refittedPairMomentum().y();
1022 if ( scalar < 0 ) convR= -convR;
1024 fill2DHistoVector(h_convVtxRvsZ_,aConv->conversionVertex().position().z(), convR,
cut,
type);
1025 fill2DHistoVector(h_convVtxZ_,aConv->conversionVertex().position().z(),
cut,
type);
1028 if( fabs(aPho->
eta()) > 1.5){
1029 fill2DHistoVector(h_convVtxZEndcap_,aConv->conversionVertex().position().z(),
cut,
type);
1031 else if(fabs(aPho->
eta()) < 1){
1032 fill2DHistoVector(h_convVtxR_,convR,cut,type);
1033 fill2DHistoVector(h_convVtxYvsX_,aConv->conversionVertex().position().x(),aConv->conversionVertex().position().y(),
cut,
type);
1037 const std::vector<edm::RefToBase<reco::Track> >
tracks = aConv->tracks();
1040 for (
unsigned int i=0;
i<tracks.size();
i++) {
1041 fill2DHistoVector(h_tkChi2_,tracks[
i]->normalizedChi2(),cut,type);
1042 fill2DHistoVector(p_tkChi2VsEta_,aPho->
eta(),tracks[
i]->normalizedChi2(),
cut,
type);
1043 fill2DHistoVector(p_dCotTracksVsEta_,aPho->
eta(),aConv->pairCotThetaSeparation(),
cut,
type);
1044 fill2DHistoVector(p_nHitsVsEta_,aPho->
eta(),float(tracks[
i]->numberOfValidHits()),
cut,
type);
1049 float DPhiTracksAtVtx = -99;
1050 float dPhiTracksAtEcal= -99;
1051 float dEtaTracksAtEcal= -99;
1053 float phiTk1= aConv->tracksPin()[0].phi();
1054 float phiTk2= aConv->tracksPin()[1].phi();
1055 DPhiTracksAtVtx = phiTk1-phiTk2;
1056 DPhiTracksAtVtx = phiNormalization( DPhiTracksAtVtx );
1058 if (aConv->bcMatchingWithTracks().size() > 0 && aConv->bcMatchingWithTracks()[0].
isNonnull() && aConv->bcMatchingWithTracks()[1].
isNonnull() ) {
1059 float recoPhi1 = aConv->ecalImpactPosition()[0].phi();
1060 float recoPhi2 = aConv->ecalImpactPosition()[1].phi();
1061 float recoEta1 = aConv->ecalImpactPosition()[0].eta();
1062 float recoEta2 = aConv->ecalImpactPosition()[1].eta();
1064 recoPhi1 = phiNormalization(recoPhi1);
1065 recoPhi2 = phiNormalization(recoPhi2);
1067 dPhiTracksAtEcal = recoPhi1 -recoPhi2;
1068 dPhiTracksAtEcal = phiNormalization( dPhiTracksAtEcal );
1069 dEtaTracksAtEcal = recoEta1 -recoEta2;
1072 fill3DHistoVector(h_dPhiTracksAtVtx_,DPhiTracksAtVtx,cut,type,part);
1073 fill3DHistoVector(h_dPhiTracksAtEcal_,fabs(dPhiTracksAtEcal),cut,type,part);
1074 fill3DHistoVector(h_dEtaTracksAtEcal_, dEtaTracksAtEcal,cut,type,part);
1075 fill3DHistoVector(h_eOverPTracks_,aConv->EoverPrefittedTracks(),
cut,
type,
part);
1076 fill3DHistoVector(h_pOverETracks_,1./aConv->EoverPrefittedTracks(),
cut,
type,
part);
1077 fill3DHistoVector(h_dCotTracks_,aConv->pairCotThetaSeparation(),
cut,
type,
part);
1084 if (isIsolated && aPho->
et()>=invMassEtCut_){
1085 for(
unsigned int iPho2=iPho+1; iPho2 < photonHandle->size(); iPho2++) {
1093 bool isTightPhoton2(
false), isLoosePhoton2(
false);
1094 if ( photonSelection (aPho2) ) isLoosePhoton2=
true;
1101 bool isIsolated2=
false;
1102 if ( isolationStrength_ == 0) isIsolated2 = isLoosePhoton2;
1103 if ( isolationStrength_ == 1) isIsolated2 = isTightPhoton2;
1108 if(isIsolated2 && aPho2->
et()>=invMassEtCut_){
1111 float gamgamMass2 = p12.Dot(p12);
1114 h_invMassAllPhotons_ ->
Fill(
sqrt( gamgamMass2 ));
1115 if(aPho->
isEB() && aPho2->
isEB()){h_invMassPhotonsEBarrel_ ->
Fill(
sqrt( gamgamMass2 ));}
1116 if(aPho->
isEE() || aPho2->
isEE()){h_invMassPhotonsEEndcap_ ->
Fill(
sqrt( gamgamMass2 ));}
1118 if(conversions.
size()!=0 && conversions[0]->nTracks() >= 2){
1119 if(conversions2.
size()!=0 && conversions2[0]->nTracks() >= 2) h_invMassTwoWithTracks_ ->
Fill(
sqrt( gamgamMass2 ));
1120 else h_invMassOneWithTracks_ ->
Fill(
sqrt( gamgamMass2 ));
1122 else if(conversions2.
size()!=0 && conversions2[0]->nTracks() >= 2) h_invMassOneWithTracks_ ->
Fill(
sqrt( gamgamMass2 ));
1123 else h_invMassZeroWithTracks_ ->
Fill(
sqrt( gamgamMass2 ));
1130 for (
int cut = 0;
cut !=numberOfSteps_; ++
cut) {
1144 const float PI = 3.1415927;
1147 if(phi > PI) {phi = phi -
TWOPI;}
1148 if(phi < -PI) {phi = phi +
TWOPI;}
1155 histoVector[
cut][0]->Fill(x,y);
1156 if(histoVector[cut].
size()>1) histoVector[
cut][
type]->Fill(x,y);
1161 histoVector[
cut][0]->Fill(x);
1162 histoVector[
cut][
type]->Fill(x);
1167 histoVector[
cut][0][0]->Fill(x);
1168 histoVector[
cut][0][
part]->Fill(x);
1169 histoVector[
cut][
type][0]->Fill(x);
1175 histoVector[
cut][0][0]->Fill(x,y);
1176 histoVector[
cut][0][
part]->Fill(x,y);
1177 histoVector[
cut][
type][0]->Fill(x,y);
1184 if ( pho->
pt() < minPhoEtCut_ ) result=
false;
1185 if ( fabs(pho->
eta()) > photonMaxEta_ ) result=
false;
1191 if (pho->
r9() <=0.9) {
1195 if (EtCorrHcalIso>4.0) result=
false;
1196 if (EtCorrTrkIso>4.0) result=
false ;
1202 if (EtCorrHcalIso>50.0) result=
false;
1203 if (EtCorrTrkIso>50.0) result=
false;
bool photonSelection(const reco::Photon *p)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
void bookHistogramsPhotons(DQMStore::IBooker &)
float hcalTowerSumEtConeDR04() const
Hcal isolation sum.
bool isNonnull() const
Checks for non-null.
The single EDProduct to be saved for each event (AOD case)
trigger::size_type sizeFilters() const
float chargedHadronIso() const
Accessors for Particle Flow Isolation variables.
reco::SuperClusterRef superCluster() const
Ref to SuperCluster.
virtual double energy() const final
energy
float neutralHadronIso() const
float hcalTowerSumEtConeDR03() const
Hcal isolation sum.
MonitorElement * bookProfile(Args &&...args)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const std::string & pwd(void)
float trkSumPtSolidConeDR04() const
const Keys & filterKeys(trigger::size_type index) const
MonitorElement * bookInt(Args &&...args)
std::vector< EcalRecHit >::const_iterator const_iterator
float e1x5() const
Shower shape variables.
bool isEBEEGap() const
true if photon is in boundary between EB and EE
virtual double phi() const final
momentum azimuthal angle
float ecalRecHitSumEtConeDR04() const
float trkSumPtHollowConeDR03() const
void fill3DHistoVector(std::vector< std::vector< std::vector< MonitorElement * > > > &histoVector, double x, int cut, int type, int part)
void bookHistogramsConversions(DQMStore::IBooker &)
float hadronicDepth2OverEm() const
the hadronic release in depth2 over electromagnetic fraction
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
MonitorElement * bookHisto(DQMStore::IBooker &, std::string histoName, std::string title, int bin, double min, double max)
void fill2DHistoVector(std::vector< std::vector< MonitorElement * > > &histoVector, double x, int cut, int type)
void fillHistogramsForHistogramCounts(DQMStore::IBooker &)
reco::ConversionRefVector conversions() const
vector of references to Conversion's
const TriggerObjectCollection & getObjects() const
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
float sigmaIetaIeta() const
MonitorElement * book1D(Args &&...args)
#define TWOPI
EgammaCoreTools.
auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
float ChiSquaredProbability(double chiSquared, double nrDOF)
float hadTowOverEm() const
the ration of hadronic energy in towers behind the BCs in the SC and the SC energy ...
int nTrkHollowConeDR04() const
float hadronicOverEm() const
the total hadronic over electromagnetic fraction
void bookHistogramsInvMass(DQMStore::IBooker &)
float phiNormalization(float &a)
float getCorrectedEnergyError(P4type type) const
P4type getCandidateP4type() const
const_iterator end() const
double deltaR(double eta1, double eta2, double phi1, double phi2)
float hadronicDepth1OverEm() const
the hadronic release in depth1 over electromagnetic fraction
virtual ~PhotonAnalyzer()
bool hasConversionTracks() const
Bool flagging photons with a vector of refereces to conversions with size >0.
const edm::InputTag filterTag(trigger::size_type index) const
void book3DHistoVector(DQMStore::IBooker &, std::vector< std::vector< std::vector< MonitorElement * > > > &toFill, std::string histoType, std::string histoName, std::string title, int xbin, double xmin, double xmax, int ybin=1, double ymin=1, double ymax=2)
void setCurrentFolder(const std::string &fullpath)
T const * product() const
MonitorElement * book2D(Args &&...args)
std::vector< size_type > Keys
std::vector< Photon > PhotonCollection
collectin of Photon objects
virtual void analyze(const edm::Event &, const edm::EventSetup &)
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
int nTrkSolidConeDR04() const
const LorentzVector & p4(P4type type) const
float trkSumPtHollowConeDR04() const
void bookHistogramsForHistogramCounts(DQMStore::IBooker &)
size_type size() const
Size of the RefVector.
virtual double et() const final
transverse energy
virtual double eta() const final
momentum pseudorapidity
void book2DHistoVector(DQMStore::IBooker &, std::vector< std::vector< MonitorElement * > > &toFill, std::string histoType, std::string histoName, std::string title, int xbin, double xmin, double xmax, int ybin=1, double ymin=1, double ymax=2)
void bookHistogramsEfficiency(DQMStore::IBooker &)
volatile std::atomic< bool > shutdown_flag false
tuple size
Write out results.
PhotonAnalyzer(const edm::ParameterSet &)
const_iterator begin() const
virtual double pt() const final
transverse momentum
double scalar(const CLHEP::HepGenMatrix &m)
Return the matrix as a scalar. Raise an assertion if the matris is not .
float maxEnergyXtal() const