31 barrelRecHit_token_ = consumes<edm::SortedCollection<EcalRecHit,edm::StrictWeakOrdering<EcalRecHit> > >(pset.
getParameter<
edm::InputTag>(
"barrelRecHitProducer"));
36 endcapRecHit_token_ = consumes<edm::SortedCollection<EcalRecHit,edm::StrictWeakOrdering<EcalRecHit> > >(pset.
getParameter<
edm::InputTag>(
"endcapRecHitProducer"));
41 invMassEtCut_ = pset.
getParameter<
double>(
"invMassEtCut");
44 numberOfSteps_ = pset.
getParameter<
int>(
"numberOfSteps");
47 useTriggerFiltering_ = pset.
getParameter<
bool>(
"useTriggerFiltering");
49 minimalSetOfHistos_ = pset.
getParameter<
bool>(
"minimalSetOfHistos");
50 excludeBkgHistos_ = pset.
getParameter<
bool>(
"excludeBkgHistos");
53 outputFileName_ = pset.
getParameter<
string>(
"OutputFileName");
55 isolationStrength_ = pset.
getParameter<
int>(
"isolationStrength");
61 histo_index_photons_ = 0;
62 histo_index_conversions_ = 0;
63 histo_index_efficiency_ = 0;
64 histo_index_invMass_ = 0;
83 double eMin = parameters_.getParameter<
double>(
"eMin");
84 double eMax = parameters_.getParameter<
double>(
"eMax");
85 int eBin = parameters_.getParameter<
int>(
"eBin");
87 double etMin = parameters_.getParameter<
double>(
"etMin");
88 double etMax = parameters_.getParameter<
double>(
"etMax");
89 int etBin = parameters_.getParameter<
int>(
"etBin");
91 double sumMin = parameters_.getParameter<
double>(
"sumMin");
92 double sumMax = parameters_.getParameter<
double>(
"sumMax");
93 int sumBin = parameters_.getParameter<
int>(
"sumBin");
95 double etaMin = parameters_.getParameter<
double>(
"etaMin");
96 double etaMax = parameters_.getParameter<
double>(
"etaMax");
97 int etaBin = parameters_.getParameter<
int>(
"etaBin");
99 double phiMin = parameters_.getParameter<
double>(
"phiMin");
100 double phiMax = parameters_.getParameter<
double>(
"phiMax");
101 int phiBin = parameters_.getParameter<
int>(
"phiBin");
103 double r9Min = parameters_.getParameter<
double>(
"r9Min");
104 double r9Max = parameters_.getParameter<
double>(
"r9Max");
105 int r9Bin = parameters_.getParameter<
int>(
"r9Bin");
107 double hOverEMin = parameters_.getParameter<
double>(
"hOverEMin");
108 double hOverEMax = parameters_.getParameter<
double>(
"hOverEMax");
109 int hOverEBin = parameters_.getParameter<
int>(
"hOverEBin");
111 double xMin = parameters_.getParameter<
double>(
"xMin");
112 double xMax = parameters_.getParameter<
double>(
"xMax");
113 int xBin = parameters_.getParameter<
int>(
"xBin");
115 double yMin = parameters_.getParameter<
double>(
"yMin");
116 double yMax = parameters_.getParameter<
double>(
"yMax");
117 int yBin = parameters_.getParameter<
int>(
"yBin");
119 double numberMin = parameters_.getParameter<
double>(
"numberMin");
120 double numberMax = parameters_.getParameter<
double>(
"numberMax");
121 int numberBin = parameters_.getParameter<
int>(
"numberBin");
123 double zMin = parameters_.getParameter<
double>(
"zMin");
124 double zMax = parameters_.getParameter<
double>(
"zMax");
125 int zBin = parameters_.getParameter<
int>(
"zBin");
127 double rMin = parameters_.getParameter<
double>(
"rMin");
128 double rMax = parameters_.getParameter<
double>(
"rMax");
129 int rBin = parameters_.getParameter<
int>(
"rBin");
131 double dPhiTracksMin = parameters_.getParameter<
double>(
"dPhiTracksMin");
132 double dPhiTracksMax = parameters_.getParameter<
double>(
"dPhiTracksMax");
133 int dPhiTracksBin = parameters_.getParameter<
int>(
"dPhiTracksBin");
135 double dEtaTracksMin = parameters_.getParameter<
double>(
"dEtaTracksMin");
136 double dEtaTracksMax = parameters_.getParameter<
double>(
"dEtaTracksMax");
137 int dEtaTracksBin = parameters_.getParameter<
int>(
"dEtaTracksBin");
139 double sigmaIetaMin = parameters_.getParameter<
double>(
"sigmaIetaMin");
140 double sigmaIetaMax = parameters_.getParameter<
double>(
"sigmaIetaMax");
141 int sigmaIetaBin = parameters_.getParameter<
int>(
"sigmaIetaBin");
143 double eOverPMin = parameters_.getParameter<
double>(
"eOverPMin");
144 double eOverPMax = parameters_.getParameter<
double>(
"eOverPMax");
145 int eOverPBin = parameters_.getParameter<
int>(
"eOverPBin");
147 double chi2Min = parameters_.getParameter<
double>(
"chi2Min");
148 double chi2Max = parameters_.getParameter<
double>(
"chi2Max");
149 int chi2Bin = parameters_.getParameter<
int>(
"chi2Bin");
152 int reducedEtBin = etBin/4;
153 int reducedEtaBin = etaBin/4;
154 int reducedSumBin = sumBin/4;
155 int reducedR9Bin = r9Bin/4;
158 parts_.push_back(
"AllEcal");
159 parts_.push_back(
"Barrel");
160 parts_.push_back(
"Endcaps");
162 types_.push_back(
"All");
163 types_.push_back(
"GoodCandidate");
164 if (!excludeBkgHistos_) types_.push_back(
"Background");
175 totalNumberOfHistos_efficiencyFolder =
dbe_->
bookInt(
"numberOfHistogramsInEfficiencyFolder");
176 totalNumberOfHistos_photonsFolder =
dbe_->
bookInt(
"numberOfHistogramsInPhotonsFolder");
177 totalNumberOfHistos_conversionsFolder =
dbe_->
bookInt(
"numberOfHistogramsInConversionsFolder");
178 totalNumberOfHistos_invMassFolder =
dbe_->
bookInt(
"numberOfHistogramsInInvMassFolder");
186 h_phoEta_Loose_ =
dbe_->
book1D(
"phoEtaLoose",
"Loose Photon #eta",etaBin,etaMin,etaMax);
187 h_phoEta_Tight_ =
dbe_->
book1D(
"phoEtaTight",
"Tight Photon #eta",etaBin,etaMin,etaMax);
188 h_phoEt_Loose_ =
dbe_->
book1D(
"phoEtLoose",
"Loose Photon E_{T}",etBin,etMin,etMax);
189 h_phoEt_Tight_ =
dbe_->
book1D(
"phoEtTight",
"Tight Photon E_{T}",etBin,etMin,etMax);
192 h_phoEta_preHLT_ =
dbe_->
book1D(
"phoEtaPreHLT",
"Photon #eta: before HLT",etaBin,etaMin,etaMax);
193 h_phoEta_postHLT_ =
dbe_->
book1D(
"phoEtaPostHLT",
"Photon #eta: after HLT",etaBin,etaMin,etaMax);
194 h_phoEt_preHLT_ =
dbe_->
book1D(
"phoEtPreHLT",
"Photon E_{T}: before HLT",etBin,etMin,etMax);
195 h_phoEt_postHLT_ =
dbe_->
book1D(
"phoEtPostHLT",
"Photon E_{T}: after HLT",etBin,etMin,etMax);
197 h_convEta_Loose_ =
dbe_->
book1D(
"convEtaLoose",
"Converted Loose Photon #eta",etaBin,etaMin,etaMax);
198 h_convEta_Tight_ =
dbe_->
book1D(
"convEtaTight",
"Converted Tight Photon #eta",etaBin,etaMin,etaMax);
199 h_convEt_Loose_ =
dbe_->
book1D(
"convEtLoose",
"Converted Loose Photon E_{T}",etBin,etMin,etMax);
200 h_convEt_Tight_ =
dbe_->
book1D(
"convEtTight",
"Converted Tight Photon E_{T}",etBin,etMin,etMax);
202 h_phoEta_Vertex_ =
dbe_->
book1D(
"phoEtaVertex",
"Converted Photons before valid vertex cut: #eta",etaBin,etaMin,etaMax);
205 vector<MonitorElement*> temp1DVectorEta;
206 vector<MonitorElement*> temp1DVectorPhi;
207 vector<vector<MonitorElement*> > temp2DVectorPhi;
210 for(
int cut = 0;
cut != numberOfSteps_; ++
cut){
212 currentFolder_.str(
"");
213 currentFolder_ <<
"Egamma/PhotonAnalyzer/" << types_[
type] <<
"Photons/Et above " << (
cut+1)*cutStep_ <<
" GeV/Conversions";
216 temp1DVectorEta.push_back(
dbe_->
book1D(
"phoConvEtaForEfficiency",
"Converted Photon #eta;#eta",etaBin,etaMin,etaMax));
218 temp1DVectorPhi.push_back(
dbe_->
book1D(
"phoConvPhiForEfficiency"+parts_[
part],
"Converted Photon #phi;#phi",phiBin,phiMin,phiMax));
220 temp2DVectorPhi.push_back(temp1DVectorPhi);
221 temp1DVectorPhi.clear();
223 h_phoConvEtaForEfficiency_.push_back(temp1DVectorEta);
224 temp1DVectorEta.clear();
225 h_phoConvPhiForEfficiency_.push_back(temp2DVectorPhi);
226 temp2DVectorPhi.clear();
236 h_invMassAllPhotons_ = bookHisto(
"invMassAllIsolatedPhotons",
"Two photon invariant mass: All isolated photons;M (GeV)",etBin,etMin,etMax);
237 h_invMassPhotonsEBarrel_ = bookHisto(
"invMassIsoPhotonsEBarrel",
"Two photon invariant mass: isolated photons in barrel; M (GeV)",etBin,etMin,etMax);
238 h_invMassPhotonsEEndcap_ = bookHisto(
"invMassIsoPhotonsEEndcap",
"Two photon invariant mass: isolated photons in endcap; M (GeV)",etBin,etMin,etMax);
240 h_invMassZeroWithTracks_= bookHisto(
"invMassZeroWithTracks",
"Two photon invariant mass: Neither has tracks;M (GeV)", etBin,etMin,etMax);
241 h_invMassOneWithTracks_ = bookHisto(
"invMassOneWithTracks",
"Two photon invariant mass: Only one has tracks;M (GeV)", etBin,etMin,etMax);
242 h_invMassTwoWithTracks_ = bookHisto(
"invMassTwoWithTracks",
"Two photon invariant mass: Both have tracks;M (GeV)", etBin,etMin,etMax);
249 book3DHistoVector(h_phoE_,
"1D",
"phoE",
"Energy;E (GeV)",eBin,eMin,eMax);
250 book3DHistoVector(h_phoEt_,
"1D",
"phoEt",
"E_{T};E_{T} (GeV)", etBin,etMin,etMax);
254 book3DHistoVector(h_nPho_,
"1D",
"nPho",
"Number of Photons per Event;# #gamma",numberBin,numberMin,numberMax);
259 book2DHistoVector(h_phoEta_,
"1D",
"phoEta",
"#eta;#eta",etaBin,etaMin,etaMax) ;
260 book3DHistoVector(h_phoPhi_,
"1D",
"phoPhi",
"#phi;#phi",phiBin,phiMin,phiMax) ;
263 book2DHistoVector(h_scEta_,
"1D",
"scEta",
"SuperCluster #eta;#eta",etaBin,etaMin,etaMax) ;
264 book3DHistoVector(h_scPhi_,
"1D",
"scPhi",
"SuperCluster #phi;#phi",phiBin,phiMin,phiMax) ;
269 book3DHistoVector(h_r9_,
"1D",
"r9",
"R9;R9",r9Bin,r9Min, r9Max);
270 book2DHistoVector(h_r9VsEt_,
"2D",
"r9VsEt2D",
"R9 vs E_{T};E_{T} (GeV);R9",reducedEtBin,etMin,etMax,reducedR9Bin,r9Min,r9Max);
271 book2DHistoVector(p_r9VsEt_,
"Profile",
"r9VsEt",
"Avg R9 vs E_{T};E_{T} (GeV);R9",etBin,etMin,etMax,r9Bin,r9Min,r9Max);
272 book2DHistoVector(h_r9VsEta_,
"2D",
"r9VsEta2D",
"R9 vs #eta;#eta;R9",reducedEtaBin,etaMin,etaMax,reducedR9Bin,r9Min,r9Max);
273 book2DHistoVector(p_r9VsEta_,
"Profile",
"r9VsEta",
"Avg R9 vs #eta;#eta;R9",etaBin,etaMin,etaMax,r9Bin,r9Min,r9Max);
276 book3DHistoVector(h_phoSigmaIetaIeta_,
"1D",
"phoSigmaIetaIeta",
"#sigma_{i#etai#eta};#sigma_{i#etai#eta}",sigmaIetaBin,sigmaIetaMin,sigmaIetaMax);
277 book2DHistoVector(h_sigmaIetaIetaVsEta_,
"2D",
"sigmaIetaIetaVsEta2D",
"#sigma_{i#etai#eta} vs #eta;#eta;#sigma_{i#etai#eta}",reducedEtaBin,etaMin,etaMax,sigmaIetaBin,sigmaIetaMin,sigmaIetaMax);
278 book2DHistoVector(p_sigmaIetaIetaVsEta_,
"Profile",
"sigmaIetaIetaVsEta",
"Avg #sigma_{i#etai#eta} vs #eta;#eta;#sigma_{i#etai#eta}",etaBin,etaMin,etaMax,sigmaIetaBin,sigmaIetaMin,sigmaIetaMax);
281 book2DHistoVector(h_e1x5VsEt_,
"2D",
"e1x5VsEt2D",
"E1x5 vs E_{T};E_{T} (GeV);E1X5 (GeV)",reducedEtBin,etMin,etMax,reducedEtBin,etMin,etMax);
282 book2DHistoVector(p_e1x5VsEt_,
"Profile",
"e1x5VsEt",
"Avg E1x5 vs E_{T};E_{T} (GeV);E1X5 (GeV)",etBin,etMin,etMax,etBin,etMin,etMax);
283 book2DHistoVector(h_e1x5VsEta_,
"2D",
"e1x5VsEta2D",
"E1x5 vs #eta;#eta;E1X5 (GeV)",reducedEtaBin,etaMin,etaMax,reducedEtBin,etMin,etMax);
284 book2DHistoVector(p_e1x5VsEta_,
"Profile",
"e1x5VsEta",
"Avg E1x5 vs #eta;#eta;E1X5 (GeV)",etaBin,etaMin,etaMax,etBin,etMin,etMax);
287 book2DHistoVector(h_e2x5VsEt_,
"2D",
"e2x5VsEt2D",
"E2x5 vs E_{T};E_{T} (GeV);E2X5 (GeV)",reducedEtBin,etMin,etMax,reducedEtBin,etMin,etMax);
288 book2DHistoVector(p_e2x5VsEt_,
"Profile",
"e2x5VsEt",
"Avg E2x5 vs E_{T};E_{T} (GeV);E2X5 (GeV)",etBin,etMin,etMax,etBin,etMin,etMax);
289 book2DHistoVector(h_e2x5VsEta_,
"2D",
"e2x5VsEta2D",
"E2x5 vs #eta;#eta;E2X5 (GeV)",reducedEtaBin,etaMin,etaMax,reducedEtBin,etMin,etMax);
290 book2DHistoVector(p_e2x5VsEta_,
"Profile",
"e2x5VsEta",
"Avg E2x5 vs #eta;#eta;E2X5 (GeV)",etaBin,etaMin,etaMax,etBin,etMin,etMax);
293 book2DHistoVector(h_r1x5VsEt_,
"2D",
"r1x5VsEt2D",
"R1x5 vs E_{T};E_{T} (GeV);R1X5",reducedEtBin,etMin,etMax,reducedR9Bin,r9Min,r9Max);
294 book2DHistoVector(p_r1x5VsEt_,
"Profile",
"r1x5VsEt",
"Avg R1x5 vs E_{T};E_{T} (GeV);R1X5",etBin,etMin,etMax,r9Bin,r9Min,r9Max);
295 book2DHistoVector(h_r1x5VsEta_,
"2D",
"r1x5VsEta2D",
"R1x5 vs #eta;#eta;R1X5",reducedEtaBin,etaMin,etaMax,reducedR9Bin,r9Min,r9Max);
296 book2DHistoVector(p_r1x5VsEta_,
"Profile",
"r1x5VsEta",
"Avg R1x5 vs #eta;#eta;R1X5",etaBin,etaMin,etaMax,r9Bin,r9Min,r9Max);
299 book2DHistoVector( h_r2x5VsEt_ ,
"2D",
"r2x5VsEt2D",
"R2x5 vs E_{T};E_{T} (GeV);R2X5",reducedEtBin,etMin,etMax,reducedR9Bin,r9Min,r9Max);
300 book2DHistoVector( p_r2x5VsEt_ ,
"Profile",
"r2x5VsEt",
"Avg R2x5 vs E_{T};E_{T} (GeV);R2X5",etBin,etMin,etMax,r9Bin,r9Min,r9Max);
301 book2DHistoVector( h_r2x5VsEta_ ,
"2D",
"r2x5VsEta2D",
"R2x5 vs #eta;#eta;R2X5",reducedEtaBin,etaMin,etaMax,reducedR9Bin,r9Min,r9Max);
302 book2DHistoVector( p_r2x5VsEta_ ,
"Profile",
"r2x5VsEta",
"Avg R2x5 vs #eta;#eta;R2X5",etaBin,etaMin,etaMax,r9Bin,r9Min,r9Max);
305 book2DHistoVector( h_maxEXtalOver3x3VsEt_ ,
"2D",
"maxEXtalOver3x3VsEt2D",
"(Max Xtal E)/E3x3 vs E_{T};E_{T} (GeV);(Max Xtal E)/E3x3",reducedEtBin,etMin,etMax,r9Bin,r9Min,r9Max);
306 book2DHistoVector( 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);
307 book2DHistoVector( h_maxEXtalOver3x3VsEta_ ,
"2D",
"maxEXtalOver3x3VsEta2D",
"(Max Xtal E)/E3x3 vs #eta;#eta;(Max Xtal E)/E3x3",reducedEtaBin,etaMin,etaMax,r9Bin,r9Min,r9Max);
308 book2DHistoVector( p_maxEXtalOver3x3VsEta_ ,
"Profile",
"maxEXtalOver3x3VsEta",
"Avg (Max Xtal E)/E3x3 vs #eta;#eta;(Max Xtal E)/E3x3",etaBin,etaMin,etaMax,r9Bin,r9Min,r9Max);
314 book2DHistoVector( h_nTrackIsolSolid_ ,
"1D",
"nIsoTracksSolid",
"Number Of Tracks in the Solid Iso Cone;# tracks",numberBin,numberMin,numberMax);
315 book2DHistoVector( h_nTrackIsolSolidVsEt_ ,
"2D",
"nIsoTracksSolidVsEt2D",
"Number Of Tracks in the Solid Iso Cone vs E_{T};E_{T};# tracks",reducedEtBin,etMin, etMax,numberBin,numberMin,numberMax);
316 book2DHistoVector( 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);
317 book2DHistoVector( h_nTrackIsolSolidVsEta_ ,
"2D",
"nIsoTracksSolidVsEta2D",
"Number Of Tracks in the Solid Iso Cone vs #eta;#eta;# tracks",reducedEtaBin,etaMin, etaMax,numberBin,numberMin,numberMax);
318 book2DHistoVector( p_nTrackIsolSolidVsEta_ ,
"Profile",
"nIsoTracksSolidVsEta",
"Avg Number Of Tracks in the Solid Iso Cone vs #eta;#eta;# tracks",etaBin,etaMin, etaMax,numberBin,numberMin,numberMax);
321 book2DHistoVector( h_nTrackIsolHollow_ ,
"1D",
"nIsoTracksHollow",
"Number Of Tracks in the Hollow Iso Cone;# tracks",numberBin,numberMin,numberMax);
322 book2DHistoVector( h_nTrackIsolHollowVsEt_ ,
"2D",
"nIsoTracksHollowVsEt2D",
"Number Of Tracks in the Hollow Iso Cone vs E_{T};E_{T};# tracks",reducedEtBin,etMin, etMax,numberBin,numberMin,numberMax);
323 book2DHistoVector( 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);
324 book2DHistoVector( h_nTrackIsolHollowVsEta_ ,
"2D",
"nIsoTracksHollowVsEta2D",
"Number Of Tracks in the Hollow Iso Cone vs #eta;#eta;# tracks",reducedEtaBin,etaMin, etaMax,numberBin,numberMin,numberMax);
325 book2DHistoVector( p_nTrackIsolHollowVsEta_ ,
"Profile",
"nIsoTracksHollowVsEta",
"Avg Number Of Tracks in the Hollow Iso Cone vs #eta;#eta;# tracks",etaBin,etaMin, etaMax,numberBin,numberMin,numberMax);
328 book2DHistoVector( h_trackPtSumSolid_ ,
"1D",
"isoPtSumSolid",
"Track P_{T} Sum in the Solid Iso Cone;P_{T} (GeV)",sumBin,sumMin,sumMax);
329 book2DHistoVector( 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);
330 book2DHistoVector( 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);
331 book2DHistoVector( h_trackPtSumSolidVsEta_ ,
"2D",
"isoPtSumSolidVsEta2D",
"Track P_{T} Sum in the Solid Iso Cone;#eta;P_{T} (GeV)",reducedEtaBin,etaMin, etaMax,reducedSumBin,sumMin,sumMax);
332 book2DHistoVector( 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);
335 book2DHistoVector( h_trackPtSumHollow_ ,
"1D",
"isoPtSumHollow",
"Track P_{T} Sum in the Hollow Iso Cone;P_{T} (GeV)",sumBin,sumMin,sumMax);
336 book2DHistoVector( 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);
337 book2DHistoVector( 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);
338 book2DHistoVector( h_trackPtSumHollowVsEta_ ,
"2D",
"isoPtSumHollowVsEta2D",
"Track P_{T} Sum in the Hollow Iso Cone;#eta;P_{T} (GeV)",reducedEtaBin,etaMin, etaMax,reducedSumBin,sumMin,sumMax);
339 book2DHistoVector( 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);
345 book2DHistoVector( h_ecalSum_ ,
"1D",
"ecalSum",
"Ecal Sum in the Iso Cone;E (GeV)",sumBin,sumMin,sumMax);
346 book2DHistoVector( h_ecalSumEBarrel_,
"1D",
"ecalSumEBarrel",
"Ecal Sum in the IsoCone for Barrel;E (GeV)",sumBin,sumMin,sumMax);
347 book2DHistoVector( h_ecalSumEEndcap_,
"1D",
"ecalSumEEndcap",
"Ecal Sum in the IsoCone for Endcap;E (GeV)",sumBin,sumMin,sumMax);
348 book2DHistoVector( h_ecalSumVsEt_ ,
"2D",
"ecalSumVsEt2D",
"Ecal Sum in the Iso Cone;E_{T} (GeV);E (GeV)",reducedEtBin,etMin, etMax,reducedSumBin,sumMin,sumMax);
349 book3DHistoVector( 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);
350 book2DHistoVector( h_ecalSumVsEta_ ,
"2D",
"ecalSumVsEta2D",
"Ecal Sum in the Iso Cone;#eta;E (GeV)",reducedEtaBin,etaMin, etaMax,reducedSumBin,sumMin,sumMax);
351 book2DHistoVector( p_ecalSumVsEta_ ,
"Profile",
"ecalSumVsEta",
"Avg Ecal Sum in the Iso Cone vs #eta;#eta;E (GeV)",etaBin,etaMin, etaMax,sumBin,sumMin,sumMax);
354 book2DHistoVector( h_hcalSum_ ,
"1D",
"hcalSum",
"Hcal Sum in the Iso Cone;E (GeV)",sumBin,sumMin,sumMax);
355 book2DHistoVector( h_hcalSumEBarrel_,
"1D",
"hcalSumEBarrel",
"Hcal Sum in the IsoCone for Barrel;E (GeV)",sumBin,sumMin,sumMax);
356 book2DHistoVector( h_hcalSumEEndcap_,
"1D",
"hcalSumEEndcap",
"Hcal Sum in the IsoCone for Endcap;E (GeV)",sumBin,sumMin,sumMax);
357 book2DHistoVector( h_hcalSumVsEt_ ,
"2D",
"hcalSumVsEt2D",
"Hcal Sum in the Iso Cone;E_{T} (GeV);E (GeV)",reducedEtBin,etMin, etMax,reducedSumBin,sumMin,sumMax);
358 book3DHistoVector( 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);
359 book2DHistoVector( h_hcalSumVsEta_ ,
"2D",
"hcalSumVsEta2D",
"Hcal Sum in the Iso Cone;#eta;E (GeV)",reducedEtaBin,etaMin, etaMax,reducedSumBin,sumMin,sumMax);
360 book2DHistoVector( p_hcalSumVsEta_ ,
"Profile",
"hcalSumVsEta",
"Avg Hcal Sum in the Iso Cone vs #eta;#eta;E (GeV)",etaBin,etaMin, etaMax,sumBin,sumMin,sumMax);
363 book3DHistoVector( h_hOverE_ ,
"1D",
"hOverE",
"H/E;H/E",hOverEBin,hOverEMin,hOverEMax);
364 book2DHistoVector( p_hOverEVsEt_ ,
"Profile",
"hOverEVsEt",
"Avg H/E vs Et;E_{T} (GeV);H/E",etBin,etMin,etMax,hOverEBin,hOverEMin,hOverEMax);
365 book2DHistoVector( p_hOverEVsEta_ ,
"Profile",
"hOverEVsEta",
"Avg H/E vs #eta;#eta;H/E",etaBin,etaMin,etaMax,hOverEBin,hOverEMin,hOverEMax);
366 book3DHistoVector( h_h1OverE_ ,
"1D",
"h1OverE",
"H/E for Depth 1;H/E",hOverEBin,hOverEMin,hOverEMax);
367 book3DHistoVector( h_h2OverE_ ,
"1D",
"h2OverE",
"H/E for Depth 2;H/E",hOverEBin,hOverEMin,hOverEMax);
373 book2DHistoVector( h_phoEt_BadChannels_ ,
"1D",
"phoEtBadChannels",
"Fraction Containing Bad Channels: E_{T};E_{T} (GeV)",etBin,etMin,etMax);
374 book2DHistoVector( h_phoEta_BadChannels_ ,
"1D",
"phoEtaBadChannels",
"Fraction Containing Bad Channels: #eta;#eta",etaBin,etaMin,etaMax);
375 book2DHistoVector( h_phoPhi_BadChannels_ ,
"1D",
"phoPhiBadChannels",
"Fraction Containing Bad Channels: #phi;#phi",phiBin,phiMin,phiMax);
384 book3DHistoVector( h_phoConvE_ ,
"1D",
"phoConvE",
"E;E (GeV)",eBin,eMin,eMax);
385 book3DHistoVector( h_phoConvEt_ ,
"1D",
"phoConvEt",
"E_{T};E_{T} (GeV)",etBin,etMin,etMax);
389 book2DHistoVector( h_phoConvEta_ ,
"1D",
"phoConvEta",
"#eta;#eta",etaBin,etaMin,etaMax);
390 book3DHistoVector( h_phoConvPhi_ ,
"1D",
"phoConvPhi",
"#phi;#phi",phiBin,phiMin,phiMax);
394 book3DHistoVector( h_nConv_ ,
"1D",
"nConv",
"Number Of Conversions per Event ;# conversions",numberBin,numberMin,numberMax);
398 book3DHistoVector( h_phoConvR9_ ,
"1D",
"phoConvR9",
"R9;R9",r9Bin,r9Min,r9Max);
402 book3DHistoVector( h_eOverPTracks_ ,
"1D",
"eOverPTracks",
"E/P;E/P",eOverPBin,eOverPMin,eOverPMax);
403 book3DHistoVector( h_pOverETracks_ ,
"1D",
"pOverETracks",
"P/E;P/E",eOverPBin,eOverPMin,eOverPMax);
405 book3DHistoVector( h_dPhiTracksAtVtx_ ,
"1D",
"dPhiTracksAtVtx",
"#Delta#phi of Tracks at Vertex;#Delta#phi",dPhiTracksBin,dPhiTracksMin,dPhiTracksMax);
406 book3DHistoVector( h_dPhiTracksAtEcal_ ,
"1D",
"dPhiTracksAtEcal",
"Abs(#Delta#phi) of Tracks at Ecal;#Delta#phi",dPhiTracksBin,0.,dPhiTracksMax);
407 book3DHistoVector( h_dEtaTracksAtEcal_ ,
"1D",
"dEtaTracksAtEcal",
"#Delta#eta of Tracks at Ecal;#Delta#eta",dEtaTracksBin,dEtaTracksMin,dEtaTracksMax);
409 book3DHistoVector( h_dCotTracks_ ,
"1D",
"dCotTracks",
"#Deltacot(#theta) of Tracks;#Deltacot(#theta)",dEtaTracksBin,dEtaTracksMin,dEtaTracksMax);
410 book2DHistoVector( p_dCotTracksVsEta_ ,
"Profile",
"dCotTracksVsEta",
"Avg #Deltacot(#theta) of Tracks vs #eta;#eta;#Deltacot(#theta)",etaBin,etaMin,etaMax,dEtaTracksBin,dEtaTracksMin,dEtaTracksMax);
412 book2DHistoVector( p_nHitsVsEta_ ,
"Profile",
"nHitsVsEta",
"Avg Number of Hits per Track vs #eta;#eta;# hits",etaBin,etaMin,etaMax,etaBin,0,16);
414 book2DHistoVector( h_tkChi2_ ,
"1D",
"tkChi2",
"#chi^{2} of Track Fitting;#chi^{2}",chi2Bin,chi2Min,chi2Max);
415 book2DHistoVector( p_tkChi2VsEta_ ,
"Profile",
"tkChi2VsEta",
"Avg #chi^{2} of Track Fitting vs #eta;#eta;#chi^{2}",etaBin,etaMin,etaMax,chi2Bin,chi2Min,chi2Max);
419 book2DHistoVector( h_convVtxRvsZ_ ,
"2D",
"convVtxRvsZ",
"Vertex Position;Z (cm);R (cm)",500,zMin,zMax,rBin,rMin,rMax);
420 book2DHistoVector( h_convVtxZEndcap_ ,
"1D",
"convVtxZEndcap",
"Vertex Position: #eta > 1.5;Z (cm)",zBin,zMin,zMax);
421 book2DHistoVector( h_convVtxZ_ ,
"1D",
"convVtxZ",
"Vertex Position;Z (cm)",zBin,zMin,zMax);
422 book2DHistoVector( h_convVtxR_ ,
"1D",
"convVtxR",
"Vertex Position: #eta < 1;R (cm)",rBin,rMin,rMax);
423 book2DHistoVector( h_convVtxYvsX_ ,
"2D",
"convVtxYvsX",
"Vertex Position: #eta < 1;X (cm);Y (cm)",xBin,xMin,xMax,yBin,yMin,yMax);
427 book2DHistoVector( h_vertexChi2Prob_ ,
"1D",
"vertexChi2Prob",
"#chi^{2} Probability of Vertex Fitting;#chi^{2}",100,0.,1.0);
441 if (nEvt_% prescaleFactor_ )
return;
443 LogInfo(
"PhotonAnalyzer") <<
"PhotonAnalyzer Analyzing event number: " << e.
id() <<
" Global Counter " << nEvt_ <<
"\n";
446 bool validTriggerEvent=
true;
449 e.
getByToken(triggerEvent_token_,triggerEventHandle);
450 if(!triggerEventHandle.isValid()) {
451 edm::LogInfo(
"PhotonAnalyzer") <<
"Error! Can't get the product: triggerEvent_" << endl;
452 validTriggerEvent=
false;
454 if(validTriggerEvent) triggerEvent = *(triggerEventHandle.product());
457 bool validPhotons=
true;
461 if ( !photonHandle.isValid()) {
462 edm::LogInfo(
"PhotonAnalyzer") <<
"Error! Can't get the product: photon_token_" << endl;
465 if(validPhotons) photonCollection = *(photonHandle.product());
468 bool validloosePhotonID=
true;
471 e.
getByToken(PhotonIDLoose_token_, loosePhotonFlag);
472 if ( !loosePhotonFlag.isValid()) {
473 edm::LogInfo(
"PhotonAnalyzer") <<
"Error! Can't get the product: PhotonIDLoose_token_" << endl;
474 validloosePhotonID=
false;
476 if (validloosePhotonID) loosePhotonID = *(loosePhotonFlag.product());
478 bool validtightPhotonID=
true;
481 e.
getByToken(PhotonIDTight_token_, tightPhotonFlag);
482 if ( !tightPhotonFlag.isValid()) {
483 edm::LogInfo(
"PhotonAnalyzer") <<
"Error! Can't get the product: PhotonIDTight_token_" << endl;
484 validtightPhotonID=
false;
486 if (validtightPhotonID) tightPhotonID = *(tightPhotonFlag.product());
501 int nConv[100][3][3];
517 for(uint filterIndex=0;filterIndex<triggerEvent.sizeFilters();++filterIndex){
519 string label = triggerEvent.filterTag(filterIndex).label();
521 if(label.find(
"Photon" ) != string::npos ) {
523 for(uint filterKeyIndex=0;filterKeyIndex<triggerEvent.filterKeys(filterIndex).size();++filterKeyIndex){
524 Keys.push_back(triggerEvent.filterKeys(filterIndex)[filterKeyIndex]);
534 for ( uint
i=0 ;
i<
Keys.size() ; )
536 if (
i!=(
Keys.size()-1))
546 int photonCounter = 0;
550 for( reco::PhotonCollection::const_iterator iPho = photonCollection.begin(); iPho != photonCollection.end(); iPho++) {
555 h_phoEta_preHLT_->Fill((*iPho).eta());
556 h_phoEt_preHLT_->Fill( (*iPho).et());
560 double deltaRMin=1000.;
564 for (vector<int>::const_iterator objectKey=
Keys.begin();objectKey!=
Keys.end();objectKey++){
566 deltaR =
reco::deltaR(triggerEvent.getObjects()[(*objectKey)].eta(),triggerEvent.getObjects()[(*objectKey)].phi(),(*iPho).superCluster()->eta(),(*iPho).superCluster()->phi());
567 if(deltaR < deltaRMin) deltaRMin =
deltaR;
571 if(deltaRMin > deltaRMax) {
572 if(useTriggerFiltering_)
continue;
575 if(deltaRMin <= deltaRMax) {
576 h_phoEta_postHLT_->Fill((*iPho).eta() );
577 h_phoEt_postHLT_->Fill( (*iPho).et() );
580 if ((*iPho).et() < minPhoEtCut_)
continue;
587 bool isLoosePhoton(
false), isTightPhoton(
false);
588 if ( !isHeavyIon_ ) {
589 isLoosePhoton = (loosePhotonID)[photonref];
590 isTightPhoton = (tightPhotonID)[photonref];
596 bool phoIsInBarrel=
false;
597 bool phoIsInEndcap=
false;
598 float etaPho = (*iPho).superCluster()->eta();
599 if ( fabs(etaPho) < 1.479 )
606 if ( phoIsInBarrel ) part = 1;
607 if ( phoIsInEndcap ) part = 2;
610 bool isIsolated=
false;
611 if ( isolationStrength_ == 0) isIsolated = isLoosePhoton;
612 if ( isolationStrength_ == 1) isIsolated = isTightPhoton;
615 if ( isIsolated ) type=1;
616 if ( !excludeBkgHistos_ && !isIsolated ) type=2;
620 bool validEcalRecHits=
true;
623 if ( phoIsInBarrel ) {
625 e.
getByToken(barrelRecHit_token_, ecalRecHitHandle);
626 if (!ecalRecHitHandle.
isValid()) {
627 edm::LogError(
"PhotonAnalyzer") <<
"Error! Can't get the product: barrelRecHit_token_";
628 validEcalRecHits=
false;
631 else if ( phoIsInEndcap ) {
633 e.
getByToken(endcapRecHit_token_, ecalRecHitHandle);
634 if (!ecalRecHitHandle.
isValid()) {
635 edm::LogError(
"PhotonAnalyzer") <<
"Error! Can't get the product: endcapRecHit_token";
636 validEcalRecHits=
false;
639 if (validEcalRecHits) ecalRecHitCollection = *(ecalRecHitHandle.
product());
647 h_phoEta_Loose_->Fill((*iPho).eta());
648 h_phoEt_Loose_->Fill( (*iPho).et() );
651 h_phoEta_Tight_->Fill((*iPho).eta());
652 h_phoEt_Tight_->Fill( (*iPho).et() );
657 for (
int cut = 0;
cut !=numberOfSteps_; ++
cut) {
658 double Et = (*iPho).et();
659 bool passesCuts =
false;
662 if ( useBinning_ && Et > (
cut+1)*cutStep_ && ( (Et < (
cut+2)*cutStep_) | (
cut == numberOfSteps_-1) ) ){
665 else if ( !useBinning_ && Et > (
cut+1)*cutStep_ ){
674 fill2DHistoVector(h_nTrackIsolSolid_, (*iPho).nTrkSolidConeDR04(),
cut,
type);
675 fill2DHistoVector(h_nTrackIsolHollow_,(*iPho).nTrkHollowConeDR04(),
cut,
type);
677 fill2DHistoVector(h_nTrackIsolSolidVsEta_, (*iPho).eta(),(*iPho).nTrkSolidConeDR04(),
cut,
type);
678 fill2DHistoVector(p_nTrackIsolSolidVsEta_, (*iPho).eta(),(*iPho).nTrkSolidConeDR04(),
cut,
type);
679 fill2DHistoVector(h_nTrackIsolHollowVsEta_,(*iPho).eta(),(*iPho).nTrkHollowConeDR04(),
cut,
type);
680 fill2DHistoVector(p_nTrackIsolHollowVsEta_,(*iPho).eta(),(*iPho).nTrkHollowConeDR04(),
cut,
type);
682 fill2DHistoVector(h_nTrackIsolSolidVsEt_, (*iPho).et(), (*iPho).nTrkSolidConeDR04(),
cut,
type);
683 fill2DHistoVector(p_nTrackIsolSolidVsEt_, (*iPho).et(), (*iPho).nTrkSolidConeDR04(),
cut,
type);
684 fill2DHistoVector(h_nTrackIsolHollowVsEt_, (*iPho).et(), (*iPho).nTrkHollowConeDR04(),
cut,
type);
685 fill2DHistoVector(p_nTrackIsolHollowVsEt_, (*iPho).et(), (*iPho).nTrkHollowConeDR04(),
cut,
type);
688 fill2DHistoVector(h_trackPtSumSolid_, (*iPho).trkSumPtSolidConeDR04(),
cut,
type);
689 fill2DHistoVector(h_trackPtSumHollow_,(*iPho).trkSumPtSolidConeDR04(),
cut,
type);
691 fill2DHistoVector(h_trackPtSumSolidVsEta_, (*iPho).eta(),(*iPho).trkSumPtSolidConeDR04(),
cut,
type);
692 fill2DHistoVector(p_trackPtSumSolidVsEta_, (*iPho).eta(),(*iPho).trkSumPtSolidConeDR04(),
cut,
type);
693 fill2DHistoVector(h_trackPtSumHollowVsEta_,(*iPho).eta(),(*iPho).trkSumPtHollowConeDR04(),
cut,
type);
694 fill2DHistoVector(p_trackPtSumHollowVsEta_,(*iPho).eta(),(*iPho).trkSumPtHollowConeDR04(),
cut,
type);
696 fill2DHistoVector(h_trackPtSumSolidVsEt_, (*iPho).et(), (*iPho).trkSumPtSolidConeDR04(),
cut,
type);
697 fill2DHistoVector(p_trackPtSumSolidVsEt_, (*iPho).et(), (*iPho).trkSumPtSolidConeDR04(),
cut,
type);
698 fill2DHistoVector(h_trackPtSumHollowVsEt_, (*iPho).et(), (*iPho).trkSumPtHollowConeDR04(),
cut,
type);
699 fill2DHistoVector(p_trackPtSumHollowVsEt_, (*iPho).et(), (*iPho).trkSumPtHollowConeDR04(),
cut,
type);
702 fill2DHistoVector(h_ecalSum_,(*iPho).ecalRecHitSumEtConeDR04(),
cut,
type);
703 if(iPho->isEB()){fill2DHistoVector(h_ecalSumEBarrel_,(*iPho).ecalRecHitSumEtConeDR04(),
cut,
type);}
704 if(iPho->isEE()){fill2DHistoVector(h_ecalSumEEndcap_,(*iPho).ecalRecHitSumEtConeDR04(),
cut,
type);}
705 fill2DHistoVector(h_ecalSumVsEta_,(*iPho).eta(),(*iPho).ecalRecHitSumEtConeDR04(),
cut,
type);
706 fill2DHistoVector(p_ecalSumVsEta_,(*iPho).eta(),(*iPho).ecalRecHitSumEtConeDR04(),
cut,
type);
707 fill2DHistoVector(h_ecalSumVsEt_, (*iPho).et(), (*iPho).ecalRecHitSumEtConeDR04(),
cut,
type);
708 fill3DHistoVector(p_ecalSumVsEt_, (*iPho).et(), (*iPho).ecalRecHitSumEtConeDR04(),
cut,
type,
part);
712 fill2DHistoVector(h_hcalSum_,(*iPho).hcalTowerSumEtConeDR04(),
cut,
type);
713 if(iPho->isEB()){fill2DHistoVector(h_hcalSumEBarrel_,(*iPho).hcalTowerSumEtConeDR04(),
cut,
type);}
714 if(iPho->isEE()){fill2DHistoVector(h_hcalSumEEndcap_,(*iPho).hcalTowerSumEtConeDR04(),
cut,
type);}
715 fill2DHistoVector(h_hcalSumVsEta_,(*iPho).eta(),(*iPho).hcalTowerSumEtConeDR04(),
cut,
type);
716 fill2DHistoVector(p_hcalSumVsEta_,(*iPho).eta(),(*iPho).hcalTowerSumEtConeDR04(),
cut,
type);
717 fill2DHistoVector(h_hcalSumVsEt_, (*iPho).et(), (*iPho).hcalTowerSumEtConeDR04(),
cut,
type);
718 fill3DHistoVector(p_hcalSumVsEt_, (*iPho).et(), (*iPho).hcalTowerSumEtConeDR04(),
cut,
type,
part);
720 fill3DHistoVector(h_hOverE_,(*iPho).hadronicOverEm(),
cut,
type,
part);
721 fill2DHistoVector(p_hOverEVsEta_,(*iPho).eta(),(*iPho).hadronicOverEm(),
cut,
type);
722 fill2DHistoVector(p_hOverEVsEt_, (*iPho).et(), (*iPho).hadronicOverEm(),
cut,
type);
724 fill3DHistoVector(h_h1OverE_,(*iPho).hadronicDepth1OverEm(),
cut,
type,
part);
725 fill3DHistoVector(h_h2OverE_,(*iPho).hadronicDepth2OverEm(),
cut,
type,
part);
736 fill3DHistoVector(h_phoE_, (*iPho).energy(),
cut,
type,
part);
737 fill3DHistoVector(h_phoEt_,(*iPho).et(),
cut,
type,
part);
741 fill2DHistoVector(h_phoEta_,(*iPho).eta(),
cut,
type);
742 fill2DHistoVector(h_scEta_, (*iPho).superCluster()->eta(),
cut,
type);
744 fill3DHistoVector(h_phoPhi_,(*iPho).phi(),
cut,
type,
part);
745 fill3DHistoVector(h_scPhi_, (*iPho).superCluster()->phi(),
cut,
type,
part);
749 fill3DHistoVector(h_r9_,(*iPho).r9(),
cut,
type,
part);
750 fill2DHistoVector(h_r9VsEta_,(*iPho).eta(),(*iPho).r9(),
cut,
type);
751 fill2DHistoVector(p_r9VsEta_,(*iPho).eta(),(*iPho).r9(),
cut,
type);
752 fill2DHistoVector(h_r9VsEt_, (*iPho).et(), (*iPho).r9(),
cut,
type);
753 fill2DHistoVector(p_r9VsEt_, (*iPho).et(), (*iPho).r9(),
cut,
type);
755 fill2DHistoVector(h_e1x5VsEta_,(*iPho).eta(),(*iPho).e1x5(),
cut,
type);
756 fill2DHistoVector(p_e1x5VsEta_,(*iPho).eta(),(*iPho).e1x5(),
cut,
type);
757 fill2DHistoVector(h_e1x5VsEt_, (*iPho).et(), (*iPho).e1x5(),
cut,
type);
758 fill2DHistoVector(p_e1x5VsEt_, (*iPho).et(), (*iPho).e1x5(),
cut,
type);
760 fill2DHistoVector(h_e2x5VsEta_,(*iPho).eta(),(*iPho).e2x5(),
cut,
type);
761 fill2DHistoVector(p_e2x5VsEta_,(*iPho).eta(),(*iPho).e2x5(),
cut,
type);
762 fill2DHistoVector(h_e2x5VsEt_, (*iPho).et(), (*iPho).e2x5(),
cut,
type);
763 fill2DHistoVector(p_e2x5VsEt_, (*iPho).et(), (*iPho).e2x5(),
cut,
type);
765 fill2DHistoVector(h_maxEXtalOver3x3VsEta_,(*iPho).eta(),(*iPho).maxEnergyXtal()/(*iPho).e3x3(),
cut,
type);
766 fill2DHistoVector(p_maxEXtalOver3x3VsEta_,(*iPho).eta(),(*iPho).maxEnergyXtal()/(*iPho).e3x3(),
cut,
type);
767 fill2DHistoVector(h_maxEXtalOver3x3VsEt_, (*iPho).et(), (*iPho).maxEnergyXtal()/(*iPho).e3x3(),
cut,
type);
768 fill2DHistoVector(p_maxEXtalOver3x3VsEt_, (*iPho).et(), (*iPho).maxEnergyXtal()/(*iPho).e3x3(),
cut,
type);
771 fill2DHistoVector(h_r1x5VsEta_,(*iPho).eta(),(*iPho).r1x5(),
cut,
type);
772 fill2DHistoVector(p_r1x5VsEta_,(*iPho).eta(),(*iPho).r1x5(),
cut,
type);
773 fill2DHistoVector(h_r1x5VsEt_, (*iPho).et(), (*iPho).r1x5(),
cut,
type);
774 fill2DHistoVector(p_r1x5VsEt_, (*iPho).et(), (*iPho).r1x5(),
cut,
type);
776 fill2DHistoVector(h_r2x5VsEta_,(*iPho).eta(),(*iPho).r2x5(),
cut,
type);
777 fill2DHistoVector(p_r2x5VsEta_,(*iPho).eta(),(*iPho).r2x5(),
cut,
type);
778 fill2DHistoVector(h_r2x5VsEt_, (*iPho).et(), (*iPho).r2x5(),
cut,
type);
779 fill2DHistoVector(p_r2x5VsEt_, (*iPho).et(), (*iPho).r2x5(),
cut,
type);
781 fill3DHistoVector(h_phoSigmaIetaIeta_,(*iPho).sigmaIetaIeta(),
cut,
type,
part);
782 fill2DHistoVector(h_sigmaIetaIetaVsEta_,(*iPho).eta(),(*iPho).sigmaIetaIeta(),
cut,
type);
783 fill2DHistoVector(p_sigmaIetaIetaVsEta_,(*iPho).eta(),(*iPho).sigmaIetaIeta(),
cut,
type);
789 bool atLeastOneDeadChannel=
false;
790 for(
reco::CaloCluster_iterator bcIt = (*iPho).superCluster()->clustersBegin();bcIt != (*iPho).superCluster()->clustersEnd(); ++bcIt) {
791 for(vector< pair<DetId, float> >::const_iterator rhIt = (*bcIt)->hitsAndFractions().begin();rhIt != (*bcIt)->hitsAndFractions().end(); ++rhIt) {
794 if (rhIt->first == (*it).id() ) {
795 if ( (*it).recoFlag() == 9 ) {
796 atLeastOneDeadChannel=
true;
803 if ( atLeastOneDeadChannel ) {
804 fill2DHistoVector(h_phoPhi_BadChannels_,(*iPho).phi(),
cut,
type);
805 fill2DHistoVector(h_phoEta_BadChannels_,(*iPho).eta(),
cut,
type);
806 fill2DHistoVector(h_phoEt_BadChannels_, (*iPho).et(),
cut,
type);
811 if((*iPho).hasConversionTracks()){
821 for (
unsigned int iConv=0; iConv<conversions.
size(); iConv++) {
825 if ( aConv->nTracks() <2 )
continue;
828 if(
cut==0) h_phoEta_Vertex_->Fill(aConv->refittedPairMomentum().eta());
830 if ( !(aConv->conversionVertex().isValid()) )
continue;
832 float chi2Prob =
ChiSquaredProbability( aConv->conversionVertex().chi2(), aConv->conversionVertex().ndof() );
834 if(chi2Prob<0.0005)
continue;
836 fill2DHistoVector(h_vertexChi2Prob_,chi2Prob,
cut,type);
840 fill3DHistoVector(h_phoConvE_, (*iPho).energy(),
cut,
type,
part);
841 fill3DHistoVector(h_phoConvEt_,(*iPho).et(),
cut,
type,
part);
842 fill3DHistoVector(h_phoConvR9_,(*iPho).r9(),
cut,
type,
part);
844 if (
cut==0 && isLoosePhoton){
845 h_convEta_Loose_->Fill((*iPho).eta());
846 h_convEt_Loose_->Fill( (*iPho).et() );
848 if (
cut==0 && isTightPhoton){
849 h_convEta_Tight_->Fill((*iPho).eta());
850 h_convEt_Tight_->Fill( (*iPho).et() );
853 fill2DHistoVector(h_phoConvEta_,aConv->refittedPairMomentum().eta(),
cut,
type);
854 fill3DHistoVector(h_phoConvPhi_,aConv->refittedPairMomentum().phi(),
cut,
type,
part);
858 fill2DHistoVector(h_phoConvEtaForEfficiency_,(*iPho).eta(),
cut,
type);
859 fill3DHistoVector(h_phoConvPhiForEfficiency_,(*iPho).phi(),
cut,
type,
part);
863 double convR=
sqrt(aConv->conversionVertex().position().perp2());
864 double scalar = aConv->conversionVertex().position().x()*aConv->refittedPairMomentum().x() + aConv->conversionVertex().position().y()*aConv->refittedPairMomentum().y();
865 if ( scalar < 0 ) convR= -convR;
867 fill2DHistoVector(h_convVtxRvsZ_,aConv->conversionVertex().position().z(), convR,
cut,
type);
868 fill2DHistoVector(h_convVtxZ_,aConv->conversionVertex().position().z(),
cut,
type);
870 if(fabs(aConv->caloCluster()[0]->eta()) > 1.5){
871 fill2DHistoVector(h_convVtxZEndcap_,aConv->conversionVertex().position().z(),
cut,
type);
873 else if(fabs(aConv->caloCluster()[0]->eta()) < 1){
874 fill2DHistoVector(h_convVtxR_,convR,cut,type);
875 fill2DHistoVector(h_convVtxYvsX_,aConv->conversionVertex().position().x(),aConv->conversionVertex().position().y(),
cut,
type);
878 const std::vector<edm::RefToBase<reco::Track> >
tracks = aConv->tracks();
881 for (
unsigned int i=0;
i<tracks.size();
i++) {
882 fill2DHistoVector(h_tkChi2_,tracks[
i]->normalizedChi2(),cut,type);
883 fill2DHistoVector(p_tkChi2VsEta_,aConv->caloCluster()[0]->eta(),tracks[
i]->normalizedChi2(),
cut,
type);
884 fill2DHistoVector(p_dCotTracksVsEta_,aConv->caloCluster()[0]->eta(),aConv->pairCotThetaSeparation(),
cut,
type);
885 fill2DHistoVector(p_nHitsVsEta_,aConv->caloCluster()[0]->eta(),float(tracks[
i]->numberOfValidHits()),
cut,
type);
890 float DPhiTracksAtVtx = -99;
891 float dPhiTracksAtEcal= -99;
892 float dEtaTracksAtEcal= -99;
894 float phiTk1= aConv->tracksPin()[0].phi();
895 float phiTk2= aConv->tracksPin()[1].phi();
896 DPhiTracksAtVtx = phiTk1-phiTk2;
897 DPhiTracksAtVtx = phiNormalization( DPhiTracksAtVtx );
899 if (aConv->bcMatchingWithTracks()[0].
isNonnull() && aConv->bcMatchingWithTracks()[1].
isNonnull() ) {
900 float recoPhi1 = aConv->ecalImpactPosition()[0].phi();
901 float recoPhi2 = aConv->ecalImpactPosition()[1].phi();
902 float recoEta1 = aConv->ecalImpactPosition()[0].eta();
903 float recoEta2 = aConv->ecalImpactPosition()[1].eta();
905 recoPhi1 = phiNormalization(recoPhi1);
906 recoPhi2 = phiNormalization(recoPhi2);
908 dPhiTracksAtEcal = recoPhi1 -recoPhi2;
909 dPhiTracksAtEcal = phiNormalization( dPhiTracksAtEcal );
910 dEtaTracksAtEcal = recoEta1 -recoEta2;
915 fill3DHistoVector(h_dPhiTracksAtVtx_,DPhiTracksAtVtx,cut,type,part);
916 fill3DHistoVector(h_dPhiTracksAtEcal_,fabs(dPhiTracksAtEcal),cut,type,part);
917 fill3DHistoVector(h_dEtaTracksAtEcal_, dEtaTracksAtEcal,cut,type,part);
918 fill3DHistoVector(h_eOverPTracks_,aConv->EoverPrefittedTracks(),
cut,
type,
part);
919 fill3DHistoVector(h_pOverETracks_,1./aConv->EoverPrefittedTracks(),
cut,
type,
part);
920 fill3DHistoVector(h_dCotTracks_,aConv->pairCotThetaSeparation(),
cut,
type,
part);
934 if (isIsolated && iPho->et()>=invMassEtCut_){
936 for (reco::PhotonCollection::const_iterator iPho2=iPho+1; iPho2!=photonCollection.end(); iPho2++){
941 bool isTightPhoton2(
false), isLoosePhoton2(
false);
943 if ( !isHeavyIon_ ) {
944 isTightPhoton2 = (tightPhotonID)[photonref2];
945 isLoosePhoton2 = (loosePhotonID)[photonref2];
948 bool isIsolated2=
false;
949 if ( isolationStrength_ == 0) isIsolated2 = isLoosePhoton2;
950 if ( isolationStrength_ == 1) isIsolated2 = isTightPhoton2;
955 if(isIsolated2 && iPho2->et()>=invMassEtCut_){
958 float gamgamMass2 = p12.Dot(p12);
961 h_invMassAllPhotons_ ->
Fill(
sqrt( gamgamMass2 ));
962 if(iPho->isEB() && iPho2->isEB()){h_invMassPhotonsEBarrel_ ->
Fill(
sqrt( gamgamMass2 ));}
963 if(iPho->isEE() || iPho2->isEE()){h_invMassPhotonsEEndcap_ ->
Fill(
sqrt( gamgamMass2 ));}
965 if(conversions.
size()!=0 && conversions[0]->nTracks() >= 2){
966 if(conversions2.
size()!=0 && conversions2[0]->nTracks() >= 2) h_invMassTwoWithTracks_ ->
Fill(
sqrt( gamgamMass2 ));
967 else h_invMassOneWithTracks_ ->
Fill(
sqrt( gamgamMass2 ));
969 else if(conversions2.
size()!=0 && conversions2[0]->nTracks() >= 2) h_invMassOneWithTracks_ ->
Fill(
sqrt( gamgamMass2 ));
970 else h_invMassZeroWithTracks_ ->
Fill(
sqrt( gamgamMass2 ));
983 for (
int cut = 0;
cut !=numberOfSteps_; ++
cut) {
1001 totalNumberOfHistos_efficiencyFolder->Fill(histo_index_efficiency_);
1002 totalNumberOfHistos_invMassFolder->Fill(histo_index_invMass_);
1003 totalNumberOfHistos_photonsFolder->Fill(histo_index_photons_);
1004 totalNumberOfHistos_conversionsFolder->Fill(histo_index_conversions_);
1018 totalNumberOfHistos_efficiencyFolder->Fill(histo_index_efficiency_);
1019 totalNumberOfHistos_invMassFolder->Fill(histo_index_invMass_);
1020 totalNumberOfHistos_photonsFolder->Fill(histo_index_photons_);
1021 totalNumberOfHistos_conversionsFolder->Fill(histo_index_conversions_);
1036 const float PI = 3.1415927;
1039 if(phi > PI) {phi = phi -
TWOPI;}
1040 if(phi < -PI) {phi = phi +
TWOPI;}
1048 histoVector[
cut][0]->Fill(x,y);
1049 if(histoVector[cut].
size()>1) histoVector[
cut][
type]->Fill(x,y);
1055 histoVector[
cut][0]->Fill(x);
1056 histoVector[
cut][
type]->Fill(x);
1062 histoVector[
cut][0][0]->Fill(x);
1063 histoVector[
cut][0][
part]->Fill(x);
1064 histoVector[
cut][
type][0]->Fill(x);
1071 histoVector[
cut][0][0]->Fill(x,y);
1072 histoVector[
cut][0][
part]->Fill(x,y);
1073 histoVector[
cut][
type][0]->Fill(x,y);
1082 int histo_index = 0;
1083 stringstream histo_number_stream;
1086 if(
dbe_->
pwd().find(
"InvMass" ) != string::npos){
1087 histo_index_invMass_++;
1088 histo_index = histo_index_invMass_;
1090 if(
dbe_->
pwd().find(
"Efficiencies" ) != string::npos){
1091 histo_index_efficiency_++;
1092 histo_index = histo_index_efficiency_;
1095 histo_number_stream <<
"h_";
1096 if(histo_index<10) histo_number_stream <<
"0";
1097 histo_number_stream << histo_index;
1105 string histoType,
string histoName,
string title,
1107 int ybin,
double ymin,
double ymax)
1109 int histo_index = 0;
1111 vector<MonitorElement*> temp1DVector;
1115 bool conversionPlot =
false;
1116 if(
dbe_->
pwd().find(
"Conversions" ) != string::npos) conversionPlot =
true;
1117 bool TwoDPlot =
false;
1118 if(histoName.find(
"2D" ) != string::npos) TwoDPlot =
true;
1121 histo_index_conversions_++;
1122 histo_index = histo_index_conversions_;
1125 histo_index_photons_++;
1126 histo_index = histo_index_photons_;
1129 stringstream histo_number_stream;
1130 histo_number_stream <<
"h_";
1131 if(histo_index<10) histo_number_stream <<
"0";
1132 histo_number_stream << histo_index <<
"_";
1136 for(
int cut = 0;
cut != numberOfSteps_; ++
cut){
1140 currentFolder_.str(
"");
1141 currentFolder_ <<
"Egamma/PhotonAnalyzer/" << types_[
type] <<
"Photons/Et above " << (
cut+1)*cutStep_ <<
" GeV";
1142 if(conversionPlot) currentFolder_ <<
"/Conversions";
1147 if(conversionPlot) kind =
" Conversions: ";
1148 else kind =
" Photons: ";
1150 if(histoType==
"1D") temp1DVector.push_back(
dbe_->
book1D( histo_number_stream.str()+histoName,types_[
type]+kind+
title,xbin,
xmin,
xmax));
1151 else if(histoType==
"2D"){
1152 if((TwoDPlot &&
type==0) || !TwoDPlot){
1157 else cout <<
"bad histoType\n";
1160 temp2DVector.push_back(temp1DVector);
1161 temp1DVector.clear();
1170 string histoType,
string histoName,
string title,
1172 int ybin,
double ymin,
double ymax)
1176 int histo_index = 0;
1178 vector<MonitorElement*> temp1DVector;
1179 vector<vector<MonitorElement*> > temp2DVector;
1184 bool conversionPlot =
false;
1185 if(
dbe_->
pwd().find(
"Conversions" ) != string::npos) conversionPlot =
true;
1189 histo_index_conversions_++;
1190 histo_index = histo_index_conversions_;
1193 histo_index_photons_++;
1194 histo_index = histo_index_photons_;
1199 stringstream histo_number_stream;
1200 histo_number_stream <<
"h_";
1201 if(histo_index<10) histo_number_stream <<
"0";
1202 histo_number_stream << histo_index <<
"_";
1204 for(
int cut = 0;
cut != numberOfSteps_; ++
cut){
1210 currentFolder_.str(
"");
1211 currentFolder_ <<
"Egamma/PhotonAnalyzer/" << types_[
type] <<
"Photons/Et above " << (
cut+1)*cutStep_ <<
" GeV";
1212 if(conversionPlot) currentFolder_ <<
"/Conversions";
1217 if(conversionPlot) kind =
" Conversions: ";
1218 else kind =
" Photons: ";
1223 else cout <<
"bad histoType\n";
1228 temp2DVector.push_back(temp1DVector);
1229 temp1DVector.clear();
1232 temp3DVector.push_back(temp2DVector);
1233 temp2DVector.clear();
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
The single EDProduct to be saved for each event (AOD case)
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
MonitorElement * bookHisto(std::string histoName, std::string title, int bin, double min, double max)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< EcalRecHit >::const_iterator const_iterator
#define TWOPI
EgammaCoreTools.
void fill3DHistoVector(std::vector< std::vector< std::vector< MonitorElement * > > > &histoVector, double x, int cut, int type, int part)
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
bool isNonnull() const
Checks for non-null.
void fill2DHistoVector(std::vector< std::vector< MonitorElement * > > &histoVector, double x, int cut, int type)
const T & max(const T &a, const T &b)
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
float ChiSquaredProbability(double chiSquared, double nrDOF)
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
float phiNormalization(float &a)
void book3DHistoVector(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)
const_iterator end() const
double deltaR(double eta1, double eta2, double phi1, double phi2)
virtual ~PhotonAnalyzer()
virtual void endRun(const edm::Run &, const edm::EventSetup &)
std::vector< size_type > Keys
virtual void analyze(const edm::Event &, const edm::EventSetup &)
std::vector< Photon > PhotonCollection
collectin of Photon objects
T const * product() const
size_type size() const
Size of the RefVector.
MonitorElement * bookInt(const char *name)
Book int.
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
tuple size
Write out results.
void setCurrentFolder(const std::string &fullpath)
PhotonAnalyzer(const edm::ParameterSet &)
const_iterator begin() const
const std::string & pwd(void) const
double scalar(const CLHEP::HepGenMatrix &m)
Return the matrix as a scalar. Raise an assertion if the matris is not .
void book2DHistoVector(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)