CMS 3D CMS Logo

ZToMuMuGammaAnalyzer.cc
Go to the documentation of this file.
1 #include <iostream>
2 #include <iomanip>
3 
5 
16 using namespace std;
17 
19  fName_ = pset.getParameter<std::string>("analyzerName");
20  prescaleFactor_ = pset.getUntrackedParameter<int>("prescaleFactor", 1);
21  use2DHistos_ = pset.getParameter<bool>("use2DHistos");
22  makeProfiles_ = pset.getParameter<bool>("makeProfiles");
23 
24  triggerEvent_token_ = consumes<trigger::TriggerEvent>(pset.getParameter<edm::InputTag>("triggerEvent"));
25  offline_pvToken_ = consumes<reco::VertexCollection>(
26  pset.getUntrackedParameter<edm::InputTag>("offlinePV", edm::InputTag("offlinePrimaryVertices")));
27  photon_token_ = consumes<vector<reco::Photon> >(pset.getParameter<edm::InputTag>("phoProducer"));
28  muon_token_ = consumes<vector<reco::Muon> >(pset.getParameter<edm::InputTag>("muonProducer"));
29  pfCandidates_ = consumes<reco::PFCandidateCollection>(pset.getParameter<edm::InputTag>("pfCandidates"));
30  photonIsoValmap_token_ = consumes<edm::ValueMap<std::vector<reco::PFCandidateRef> > >(
31  pset.getParameter<edm::InputTag>("particleBasedIso"));
32  barrelRecHit_token_ = consumes<edm::SortedCollection<EcalRecHit, edm::StrictWeakOrdering<EcalRecHit> > >(
33  pset.getParameter<edm::InputTag>("barrelRecHitProducer"));
34  endcapRecHit_token_ = consumes<edm::SortedCollection<EcalRecHit, edm::StrictWeakOrdering<EcalRecHit> > >(
35  pset.getParameter<edm::InputTag>("endcapRecHitProducer"));
36  beamSpot_token_ = consumes<reco::BeamSpot>(pset.getParameter<edm::InputTag>("beamSpot"));
37 
38  nEvt_ = 0;
39 
40  // Muon selection
41  muonMinPt_ = pset.getParameter<double>("muonMinPt");
42  minPixStripHits_ = pset.getParameter<int>("minPixStripHits");
43  muonMaxChi2_ = pset.getParameter<double>("muonMaxChi2");
44  muonMaxDxy_ = pset.getParameter<double>("muonMaxDxy");
45  muonMatches_ = pset.getParameter<int>("muonMatches");
46  validPixHits_ = pset.getParameter<int>("validPixHits");
47  validMuonHits_ = pset.getParameter<int>("validMuonHits");
48  muonTrackIso_ = pset.getParameter<double>("muonTrackIso");
49  muonTightEta_ = pset.getParameter<double>("muonTightEta");
50  // Dimuon selection
51  minMumuInvMass_ = pset.getParameter<double>("minMumuInvMass");
52  maxMumuInvMass_ = pset.getParameter<double>("maxMumuInvMass");
53  // Photon selection
54  photonMinEt_ = pset.getParameter<double>("photonMinEt");
55  photonMaxEta_ = pset.getParameter<double>("photonMaxEta");
56  photonTrackIso_ = pset.getParameter<double>("photonTrackIso");
57  // mumuGamma selection
58  nearMuonDr_ = pset.getParameter<double>("nearMuonDr");
59  nearMuonHcalIso_ = pset.getParameter<double>("nearMuonHcalIso");
60  farMuonEcalIso_ = pset.getParameter<double>("farMuonEcalIso");
61  farMuonTrackIso_ = pset.getParameter<double>("farMuonTrackIso");
62  farMuonMinPt_ = pset.getParameter<double>("farMuonMinPt");
63  minMumuGammaInvMass_ = pset.getParameter<double>("minMumuGammaInvMass");
64  maxMumuGammaInvMass_ = pset.getParameter<double>("maxMumuGammaInvMass");
65 
66  // Histogram parameters
67  eMin_ = pset.getParameter<double>("eMin");
68  eMax_ = pset.getParameter<double>("eMax");
69  eBin_ = pset.getParameter<int>("eBin");
70 
71  etMin_ = pset.getParameter<double>("etMin");
72  etMax_ = pset.getParameter<double>("etMax");
73  etBin_ = pset.getParameter<int>("etBin");
74 
75  sumMin_ = pset.getParameter<double>("sumMin");
76  sumMax_ = pset.getParameter<double>("sumMax");
77  sumBin_ = pset.getParameter<int>("sumBin");
78 
79  etaMin_ = pset.getParameter<double>("etaMin");
80  etaMax_ = pset.getParameter<double>("etaMax");
81  etaBin_ = pset.getParameter<int>("etaBin");
82 
83  phiMin_ = pset.getParameter<double>("phiMin");
84  phiMax_ = pset.getParameter<double>("phiMax");
85  phiBin_ = pset.getParameter<int>("phiBin");
86 
87  r9Min_ = pset.getParameter<double>("r9Min");
88  r9Max_ = pset.getParameter<double>("r9Max");
89  r9Bin_ = pset.getParameter<int>("r9Bin");
90 
91  hOverEMin_ = pset.getParameter<double>("hOverEMin");
92  hOverEMax_ = pset.getParameter<double>("hOverEMax");
93  hOverEBin_ = pset.getParameter<int>("hOverEBin");
94 
95  numberMin_ = pset.getParameter<double>("numberMin");
96  numberMax_ = pset.getParameter<double>("numberMax");
97  numberBin_ = pset.getParameter<int>("numberBin");
98 
99  sigmaIetaMin_ = pset.getParameter<double>("sigmaIetaMin");
100  sigmaIetaMax_ = pset.getParameter<double>("sigmaIetaMax");
101  sigmaIetaBin_ = pset.getParameter<int>("sigmaIetaBin");
102 
103  reducedEtBin_ = etBin_ / 4;
104  reducedEtaBin_ = etaBin_ / 4;
105  reducedSumBin_ = sumBin_ / 4;
106  reducedR9Bin_ = r9Bin_ / 4;
107 }
108 
110 
112  edm::Run const& /* iRun */,
113  edm::EventSetup const& /* iSetup */) {
115  iBooker.setCurrentFolder("Egamma/" + fName_ + "/ZToMuMuGamma");
116 
117  h1_mumuInvMass_[0] = iBooker.book1D("mumuInvMass", "Two muon invariant mass: M (GeV)", etBin_, etMin_, etMax_);
118  h1_mumuGammaInvMass_[0] =
119  iBooker.book1D("mumuGammaInvMass", "Two-muon plus gamma invariant mass: M (GeV)", etBin_, etMin_, etMax_);
120  h1_mumuGammaInvMass_[1] =
121  iBooker.book1D("mumuGammaInvMassBarrel", "Two-muon plus gamma invariant mass: M (GeV)", etBin_, etMin_, etMax_);
122  h1_mumuGammaInvMass_[2] =
123  iBooker.book1D("mumuGammaInvMassEndcap", "Two-muon plus gamma invariant mass: M (GeV)", etBin_, etMin_, etMax_);
124 
127  h_nRecoVtx_ = iBooker.book1D("nOfflineVtx", "# of Offline Vertices", 200, -0.5, 199.5);
128 
129  //ENERGY
130  h_phoE_[0] = iBooker.book1D("phoE", "Energy;E (GeV)", eBin_, eMin_, eMax_);
131  h_phoSigmaEoverE_[0] = iBooker.book1D("phoSigmaEoverE", "All Ecal: #sigma_{E}/E;#sigma_{E}/E", eBin_, eMin_, eMax_);
132  h_phoEt_[0] = iBooker.book1D("phoEt", "E_{T};E_{T} (GeV)", etBin_, etMin_, etMax_);
133 
134  //NUMBER OF PHOTONS
135  h_nPho_[0] = iBooker.book1D("nPho", "Number of Photons per Event;# #gamma", numberBin_, numberMin_, numberMax_);
136 
137  //GEOMETRICAL
138  h_phoEta_[0] = iBooker.book1D("phoEta", "#eta;#eta", etaBin_, etaMin_, etaMax_);
139  h_phoPhi_[0] = iBooker.book1D("phoPhi", "#phi;#phi", phiBin_, phiMin_, phiMax_);
140 
141  h_scEta_[0] = iBooker.book1D("scEta", "SuperCluster #eta;#eta", etaBin_, etaMin_, etaMax_);
142  h_scPhi_[0] = iBooker.book1D("scPhi", "SuperCluster #phi;#phi", phiBin_, phiMin_, phiMax_);
143 
144  //SHOWER SHAPE
145  h_r9_[0] = iBooker.book1D("r9", "R9;R9", r9Bin_, r9Min_, r9Max_);
146  h_e1x5_[0] = iBooker.book1D("e1x5", "E1x5;E1X5 (GeV)", reducedEtBin_, etMin_, etMax_);
147  h_e2x5_[0] = iBooker.book1D("e2x5", "E2x5;E2X5 (GeV)", reducedEtBin_, etMin_, etMax_);
148  h_r1x5_[0] = iBooker.book1D("r1x5", "r1x5;r1X5 (GeV)", reducedEtBin_, etMin_, etMax_);
149  h_r2x5_[0] = iBooker.book1D("r2x5", "r2x5;r2X5 (GeV)", reducedEtBin_, etMin_, etMax_);
150  h_phoSigmaIetaIeta_[0] = iBooker.book1D(
151  "phoSigmaIetaIeta", "#sigma_{i#etai#eta};#sigma_{i#etai#eta}", sigmaIetaBin_, sigmaIetaMin_, sigmaIetaMax_);
152  //TRACK ISOLATION
153  h_nTrackIsolSolid_[0] = iBooker.book1D(
154  "nIsoTracksSolid", "Number Of Tracks in the Solid Iso Cone;# tracks", numberBin_, numberMin_, numberMax_);
155  h_nTrackIsolHollow_[0] = iBooker.book1D(
156  "nIsoTracksHollow", "Number Of Tracks in the Hollow Iso Cone;# tracks", numberBin_, numberMin_, numberMax_);
157  h_trackPtSumSolid_[0] =
158  iBooker.book1D("isoPtSumSolid", "Track P_{T} Sum in the Solid Iso Cone;P_{T} (GeV)", sumBin_, sumMin_, sumMax_);
159  h_trackPtSumHollow_[0] =
160  iBooker.book1D("isoPtSumHollow", "Track P_{T} Sum in the Hollow Iso Cone;P_{T} (GeV)", sumBin_, sumMin_, sumMax_);
161  //CALORIMETER ISOLATION VARIABLES
162  h_ecalSum_[0] = iBooker.book1D("ecalSum", "Ecal Sum in the Iso Cone;E (GeV)", sumBin_, sumMin_, sumMax_);
163  h_hcalSum_[0] = iBooker.book1D("hcalSum", "Hcal Sum in the Iso Cone;E (GeV)", sumBin_, sumMin_, sumMax_);
164  h_hOverE_[0] = iBooker.book1D("hOverE", "H/E;H/E", hOverEBin_, hOverEMin_, hOverEMax_);
165  h_h1OverE_[0] = iBooker.book1D("h1OverE", "H/E for Depth 1;H/E", hOverEBin_, hOverEMin_, hOverEMax_);
166  h_h2OverE_[0] = iBooker.book1D("h2OverE", "H/E for Depth 2;H/E", hOverEBin_, hOverEMin_, hOverEMax_);
167  string histname = "newhOverE";
168  h_newhOverE_[0] = iBooker.book1D(histname + "All", "new H/E: All Ecal", 100, 0., 0.1);
169  // Information from Particle Flow
170  histname = "chargedHadIso";
171  h_chHadIso_[0] = iBooker.book1D(histname + "All", "PF chargedHadIso: All Ecal", etBin_, etMin_, 20.);
172  histname = "neutralHadIso";
173  h_nHadIso_[0] = iBooker.book1D(histname + "All", "PF neutralHadIso: All Ecal", etBin_, etMin_, 20.);
174  histname = "photonIso";
175  h_phoIso_[0] = iBooker.book1D(histname + "All", "PF photonIso: All Ecal", etBin_, etMin_, 20.);
176  histname = "nCluOutMustache";
177  h_nCluOutsideMustache_[0] =
178  iBooker.book1D(histname + "All", "PF number of clusters outside Mustache: All Ecal", 50, 0., 50.);
179  histname = "etOutMustache";
180  h_etOutsideMustache_[0] = iBooker.book1D(histname + "All", "PF et outside Mustache: All Ecal", etBin_, etMin_, 20.);
181  histname = "pfMVA";
182  h_pfMva_[0] = iBooker.book1D(histname + "All", "PF MVA output: All Ecal", 50, -1., 2.);
184  histname = "SumPtOverPhoPt_ChHad_Cleaned";
185  h_SumPtOverPhoPt_ChHad_Cleaned_[0] =
186  iBooker.book1D(histname + "All", "Pf Cand Sum Pt Over photon pt Charged Hadrons: All Ecal", etBin_, etMin_, 2.);
187  histname = "SumPtOverPhoPt_NeuHad_Cleaned";
188  h_SumPtOverPhoPt_NeuHad_Cleaned_[0] =
189  iBooker.book1D(histname + "All", "Pf Cand Sum Pt Over photon pt Neutral Hadrons: All Ecal", etBin_, etMin_, 2.);
190  histname = "SumPtOverPhoPt_Pho_Cleaned";
191  h_SumPtOverPhoPt_Pho_Cleaned_[0] =
192  iBooker.book1D(histname + "All", "Pf Cand Sum Pt Over photon pt Photons Hadrons: All Ecal", etBin_, etMin_, 2.);
193  histname = "dRPhoPFcand_ChHad_Cleaned";
194  h_dRPhoPFcand_ChHad_Cleaned_[0] =
195  iBooker.book1D(histname + "All", "dR(pho,cand) Charged Hadrons : All Ecal", etBin_, etMin_, 0.7);
196  histname = "dRPhoPFcand_NeuHad_Cleaned";
197  h_dRPhoPFcand_NeuHad_Cleaned_[0] =
198  iBooker.book1D(histname + "All", "dR(pho,cand) Neutral Hadrons : All Ecal", etBin_, etMin_, 0.7);
199  histname = "dRPhoPFcand_Pho_Cleaned";
200  h_dRPhoPFcand_Pho_Cleaned_[0] =
201  iBooker.book1D(histname + "All", "dR(pho,cand) Photons : All Ecal", etBin_, etMin_, 0.7);
202  //
203  histname = "SumPtOverPhoPt_ChHad_unCleaned";
204  h_SumPtOverPhoPt_ChHad_unCleaned_[0] =
205  iBooker.book1D(histname + "All", "Pf Cand Sum Pt Over photon pt Charged Hadrons : All Ecal", etBin_, etMin_, 2.);
206  histname = "SumPtOverPhoPt_NeuHad_unCleaned";
207  h_SumPtOverPhoPt_NeuHad_unCleaned_[0] =
208  iBooker.book1D(histname + "All", "Pf Cand Sum Pt Over photon pt Neutral Hadrons : All Ecal", etBin_, etMin_, 2.);
209  histname = "SumPtOverPhoPt_Pho_unCleaned";
210  h_SumPtOverPhoPt_Pho_unCleaned_[0] =
211  iBooker.book1D(histname + "All", "Pf Cand Sum Pt Over photon pt Photons: All Ecal", etBin_, etMin_, 2.);
212  histname = "dRPhoPFcand_ChHad_unCleaned";
213  h_dRPhoPFcand_ChHad_unCleaned_[0] =
214  iBooker.book1D(histname + "All", "dR(pho,cand) Charged Hadrons : All Ecal", etBin_, etMin_, 0.7);
215  histname = "dRPhoPFcand_NeuHad_unCleaned";
216  h_dRPhoPFcand_NeuHad_unCleaned_[0] =
217  iBooker.book1D(histname + "All", "dR(pho,cand) Neutral Hadrons : All Ecal", etBin_, etMin_, 0.7);
218  histname = "dRPhoPFcand_Pho_unCleaned";
219  h_dRPhoPFcand_Pho_unCleaned_[0] =
220  iBooker.book1D(histname + "All", "dR(pho,cand) Photons: All Ecal", etBin_, etMin_, 0.7);
221 
222  // NUMBER OF PHOTONS
223  h_nPho_[1] = iBooker.book1D("nPhoBarrel", "Number of Photons per Event;# #gamma", numberBin_, numberMin_, numberMax_);
224  h_nPho_[2] = iBooker.book1D("nPhoEndcap", "Number of Photons per Event;# #gamma", numberBin_, numberMin_, numberMax_);
225  //EB ENERGY
226  h_phoE_[1] = iBooker.book1D("phoEBarrel", "Energy for Barrel;E (GeV)", eBin_, eMin_, eMax_);
227  h_phoSigmaEoverE_[1] = iBooker.book1D("phoSigmaEoverEBarrel", "Barrel: #sigma_E/E;#sigma_{E}/E", eBin_, eMin_, eMax_);
228  h_phoEt_[1] = iBooker.book1D("phoEtBarrel", "E_{T};E_{T} (GeV)", etBin_, etMin_, etMax_);
229  //EE ENERGY
230  h_phoEt_[2] = iBooker.book1D("phoEtEndcap", "E_{T};E_{T} (GeV)", etBin_, etMin_, etMax_);
231  h_phoE_[2] = iBooker.book1D("phoEEndcap", "Energy for Endcap;E (GeV)", eBin_, eMin_, eMax_);
232  h_phoSigmaEoverE_[2] =
233  iBooker.book1D("phoSigmaEoverEEndcap", "Endcap: #sigma_{E}/E;#sigma_{E}/E", eBin_, eMin_, eMax_);
234  //EB GEOMETRICAL
235  h_phoEta_[1] = iBooker.book1D("phoEtaBarrel", "#eta;#eta", etaBin_, etaMin_, etaMax_);
236  h_phoPhi_[1] = iBooker.book1D("phoPhiBarrel", "#phi;#phi", phiBin_, phiMin_, phiMax_);
237  h_scEta_[1] = iBooker.book1D("scEtaBarrel", "SuperCluster #eta;#eta", etaBin_, etaMin_, etaMax_);
238  h_scPhi_[1] = iBooker.book1D("scPhiBarrel", "SuperCluster #phi;#phi", phiBin_, phiMin_, phiMax_);
239  //EE GEOMETRICAL
240  h_phoEta_[2] = iBooker.book1D("phoEtaEndcap", "#eta;#eta", etaBin_, etaMin_, etaMax_);
241  h_phoPhi_[2] = iBooker.book1D("phoPhiEndcap", "#phi;#phi", phiBin_, phiMin_, phiMax_);
242  h_scEta_[2] = iBooker.book1D("scEtaEndcap", "SuperCluster #eta;#eta", etaBin_, etaMin_, etaMax_);
243  h_scPhi_[2] = iBooker.book1D("scPhiEndcap", "SuperCluster #phi;#phi", phiBin_, phiMin_, phiMax_);
244  //SHOWER SHAPES
245  h_r9_[1] = iBooker.book1D("r9Barrel", "R9;R9", r9Bin_, r9Min_, r9Max_);
246  h_r9_[2] = iBooker.book1D("r9Endcap", "R9;R9", r9Bin_, r9Min_, r9Max_);
247  h_e1x5_[1] = iBooker.book1D("e1x5Barrel", "E1x5;E1X5 (GeV)", reducedEtBin_, etMin_, etMax_);
248  h_e1x5_[2] = iBooker.book1D("e1x5Endcap", "E1x5;E1X5 (GeV)", reducedEtBin_, etMin_, etMax_);
249  h_e2x5_[1] = iBooker.book1D("e2x5Barrel", "E2x5;E2X5 (GeV)", reducedEtBin_, etMin_, etMax_);
250  h_e2x5_[2] = iBooker.book1D("e2x5Endcap", "E2x5;E2X5 (GeV)", reducedEtBin_, etMin_, etMax_);
251  h_r1x5_[1] = iBooker.book1D("r1x5Barrel", "r1x5;r1X5 (GeV)", reducedEtBin_, etMin_, etMax_);
252  h_r1x5_[2] = iBooker.book1D("r1x5Endcap", "r1x5;r1X5 (GeV)", reducedEtBin_, etMin_, etMax_);
253  h_r2x5_[1] = iBooker.book1D("r2x5Barrel", "r2x5;r2X5 (GeV)", reducedEtBin_, etMin_, etMax_);
254  h_r2x5_[2] = iBooker.book1D("r2x5Endcap", "r2x5;r2X5 (GeV)", reducedEtBin_, etMin_, etMax_);
255  h_phoSigmaIetaIeta_[1] = iBooker.book1D(
256  "phoSigmaIetaIetaBarrel", "#sigma_{i#etai#eta};#sigma_{i#etai#eta}", sigmaIetaBin_, sigmaIetaMin_, sigmaIetaMax_);
257  h_phoSigmaIetaIeta_[2] = iBooker.book1D(
258  "phoSigmaIetaIetaEndcap", "#sigma_{i#etai#eta};#sigma_{i#etai#eta}", sigmaIetaBin_, sigmaIetaMin_, sigmaIetaMax_);
259  // TRACK ISOLATION
260  h_nTrackIsolSolid_[1] = iBooker.book1D(
261  "nIsoTracksSolidBarrel", "Number Of Tracks in the Solid Iso Cone;# tracks", numberBin_, numberMin_, numberMax_);
262  h_nTrackIsolSolid_[2] = iBooker.book1D(
263  "nIsoTracksSolidEndcap", "Number Of Tracks in the Solid Iso Cone;# tracks", numberBin_, numberMin_, numberMax_);
264  h_nTrackIsolHollow_[1] = iBooker.book1D(
265  "nIsoTracksHollowBarrel", "Number Of Tracks in the Hollow Iso Cone;# tracks", numberBin_, numberMin_, numberMax_);
266  h_nTrackIsolHollow_[2] = iBooker.book1D(
267  "nIsoTracksHollowEndcap", "Number Of Tracks in the Hollow Iso Cone;# tracks", numberBin_, numberMin_, numberMax_);
268  h_trackPtSumSolid_[1] = iBooker.book1D(
269  "isoPtSumSolidBarrel", "Track P_{T} Sum in the Solid Iso Cone;P_{T} (GeV)", sumBin_, sumMin_, sumMax_);
270  h_trackPtSumSolid_[2] = iBooker.book1D(
271  "isoPtSumSolidEndcap", "Track P_{T} Sum in the Solid Iso Cone;P_{T} (GeV)", sumBin_, sumMin_, sumMax_);
272  h_trackPtSumHollow_[1] = iBooker.book1D(
273  "isoPtSumHollowBarrel", "Track P_{T} Sum in the Hollow Iso Cone;P_{T} (GeV)", sumBin_, sumMin_, sumMax_);
274  h_trackPtSumHollow_[2] = iBooker.book1D(
275  "isoPtSumHollowEndcap", "Track P_{T} Sum in the Hollow Iso Cone;P_{T} (GeV)", sumBin_, sumMin_, sumMax_);
276  // CALORIMETER ISOLATION VARIABLES
277  h_ecalSum_[1] = iBooker.book1D("ecalSumBarrel", "Ecal Sum in the Iso Cone;E (GeV)", sumBin_, sumMin_, sumMax_);
278  h_ecalSum_[2] = iBooker.book1D("ecalSumEndcap", "Ecal Sum in the Iso Cone;E (GeV)", sumBin_, sumMin_, sumMax_);
279  h_hcalSum_[1] = iBooker.book1D("hcalSumBarrel", "Hcal Sum in the Iso Cone;E (GeV)", sumBin_, sumMin_, sumMax_);
280  h_hcalSum_[2] = iBooker.book1D("hcalSumEndcap", "Hcal Sum in the Iso Cone;E (GeV)", sumBin_, sumMin_, sumMax_);
281  //H/E
282  // EB
283  h_hOverE_[1] = iBooker.book1D("hOverEBarrel", "H/E;H/E", hOverEBin_, hOverEMin_, hOverEMax_);
284  h_h1OverE_[1] = iBooker.book1D("h1OverEBarrel", "H/E for Depth 1;H/E", hOverEBin_, hOverEMin_, hOverEMax_);
285  h_h2OverE_[1] = iBooker.book1D("h2OverEBarrel", "H/E for Depth 2;H/E", hOverEBin_, hOverEMin_, hOverEMax_);
286  histname = "newhOverE";
287  h_newhOverE_[1] = iBooker.book1D(histname + "Barrel", "new H/E: Barrel", 100, 0., 0.1);
288  //EE
289  h_hOverE_[2] = iBooker.book1D("hOverEEndcap", "H/E;H/E", hOverEBin_, hOverEMin_, hOverEMax_);
290  h_h1OverE_[2] = iBooker.book1D("h1OverEEndcap", "H/E for Depth 1;H/E", hOverEBin_, hOverEMin_, hOverEMax_);
291  h_h2OverE_[2] = iBooker.book1D("h2OverEEndcap", "H/E for Depth 2;H/E", hOverEBin_, hOverEMin_, hOverEMax_);
292  histname = "newhOverE";
293  h_newhOverE_[2] = iBooker.book1D(histname + "Endcap", "new H/E: Endcap", 100, 0., 0.1);
294  // Information from Particle Flow
295  histname = "chargedHadIso";
296  h_chHadIso_[1] = iBooker.book1D(histname + "Barrel", "PF chargedHadIso: Barrel", etBin_, etMin_, 20.);
297  h_chHadIso_[2] = iBooker.book1D(histname + "Endcap", "PF chargedHadIso: Endcap", etBin_, etMin_, 20.);
298  histname = "neutralHadIso";
299  h_nHadIso_[1] = iBooker.book1D(histname + "Barrel", "PF neutralHadIso: Barrel", etBin_, etMin_, 20.);
300  h_nHadIso_[2] = iBooker.book1D(histname + "Endcap", "PF neutralHadIso: Endcap", etBin_, etMin_, 20.);
301  histname = "photonIso";
302  h_phoIso_[1] = iBooker.book1D(histname + "Barrel", "PF photonIso: Barrel", etBin_, etMin_, 20.);
303  h_phoIso_[2] = iBooker.book1D(histname + "Endcap", "PF photonIso: Endcap", etBin_, etMin_, 20.);
304  histname = "nCluOutMustache";
305  h_nCluOutsideMustache_[1] =
306  iBooker.book1D(histname + "Barrel", "PF number of clusters outside Mustache: Barrel", 50, 0., 50.);
307  h_nCluOutsideMustache_[2] =
308  iBooker.book1D(histname + "Endcap", "PF number of clusters outside Mustache: Endcap", 50, 0., 50.);
309  histname = "etOutMustache";
310  h_etOutsideMustache_[1] = iBooker.book1D(histname + "Barrel", "PF et outside Mustache: Barrel", etBin_, etMin_, 20.);
311  h_etOutsideMustache_[2] = iBooker.book1D(histname + "Endcap", "PF et outside Mustache: Endcap", etBin_, etMin_, 20.);
312  histname = "pfMVA";
313  h_pfMva_[1] = iBooker.book1D(histname + "Barrel", "PF MVA output: Barrel", 50, -1., 2.);
314  h_pfMva_[2] = iBooker.book1D(histname + "Endcap", "PF MVA output: Endcap", 50, -1, 2.);
316  histname = "SumPtOverPhoPt_ChHad_Cleaned";
317  h_SumPtOverPhoPt_ChHad_Cleaned_[1] =
318  iBooker.book1D(histname + "Barrel", "PF Cand Sum Pt Over photon pt Charged Hadrons: Barrel", etBin_, etMin_, 2.);
319  h_SumPtOverPhoPt_ChHad_Cleaned_[2] =
320  iBooker.book1D(histname + "Endcap", "PF Cand Sum Pt Over photon pt Charged Hadrons: Endcap", etBin_, etMin_, 2.);
321  histname = "SumPtOverPhoPt_NeuHad_Cleaned";
322  h_SumPtOverPhoPt_NeuHad_Cleaned_[1] =
323  iBooker.book1D(histname + "Barrel", "PF Cand Sum Pt Over photon pt Neutral Hadrons: Barrel", etBin_, etMin_, 2.);
324  h_SumPtOverPhoPt_NeuHad_Cleaned_[2] =
325  iBooker.book1D(histname + "Endcap", "PF Cand Sum Pt Over photon pt Neutral Hadrons: Endcap", etBin_, etMin_, 2.);
326  histname = "SumPtOverPhoPt_Pho_Cleaned";
327  h_SumPtOverPhoPt_Pho_Cleaned_[1] =
328  iBooker.book1D(histname + "Barrel", "PF Cand Sum Pt Over photon pt Photons Hadrons: Barrel", etBin_, etMin_, 2.);
329  h_SumPtOverPhoPt_Pho_Cleaned_[2] =
330  iBooker.book1D(histname + "Endcap", "PF Cand Sum Pt Over photon pt Photons Hadrons: Endcap", etBin_, etMin_, 2.);
331  histname = "dRPhoPFcand_ChHad_Cleaned";
332  h_dRPhoPFcand_ChHad_Cleaned_[1] =
333  iBooker.book1D(histname + "Barrel", "dR(pho,cand) Charged Hadrons : Barrel", etBin_, etMin_, 0.7);
334  h_dRPhoPFcand_ChHad_Cleaned_[2] =
335  iBooker.book1D(histname + "Endcap", "dR(pho,cand) Charged Hadrons : Endcap", etBin_, etMin_, 0.7);
336  histname = "dRPhoPFcand_NeuHad_Cleaned";
337  h_dRPhoPFcand_NeuHad_Cleaned_[1] =
338  iBooker.book1D(histname + "Barrel", "dR(pho,cand) Neutral Hadrons : Barrel", etBin_, etMin_, 0.7);
339  h_dRPhoPFcand_NeuHad_Cleaned_[2] =
340  iBooker.book1D(histname + "Endcap", "dR(pho,cand) Neutral Hadrons : Endcap", etBin_, etMin_, 0.7);
341  histname = "dRPhoPFcand_Pho_Cleaned";
342  h_dRPhoPFcand_Pho_Cleaned_[1] =
343  iBooker.book1D(histname + "Barrel", "dR(pho,cand) Photons : Barrel", etBin_, etMin_, 0.7);
344  h_dRPhoPFcand_Pho_Cleaned_[2] =
345  iBooker.book1D(histname + "Endcap", "dR(pho,cand) Photons : Endcap", etBin_, etMin_, 0.7);
346  //
347  histname = "SumPtOverPhoPt_ChHad_unCleaned";
348  h_SumPtOverPhoPt_ChHad_unCleaned_[1] =
349  iBooker.book1D(histname + "Barrel", "PF Cand Sum Pt Over photon pt Charged Hadrons: Barrel", etBin_, etMin_, 2.);
350  h_SumPtOverPhoPt_ChHad_unCleaned_[2] =
351  iBooker.book1D(histname + "Endcap", "PF Cand Sum Pt Over photon pt Charged Hadrons: Endcap", etBin_, etMin_, 2.);
352  histname = "SumPtOverPhoPt_NeuHad_unCleaned";
353  h_SumPtOverPhoPt_NeuHad_unCleaned_[1] =
354  iBooker.book1D(histname + "Barrel", "PF Cand Sum Pt Over photon pt Neutral Hadrons: Barrel", etBin_, etMin_, 2.);
355  h_SumPtOverPhoPt_NeuHad_unCleaned_[2] =
356  iBooker.book1D(histname + "Endcap", "PF Cand Sum Pt Over photon pt Neutral Hadrons: Endcap", etBin_, etMin_, 2.);
357  histname = "SumPtOverPhoPt_Pho_unCleaned";
358  h_SumPtOverPhoPt_Pho_unCleaned_[1] =
359  iBooker.book1D(histname + "Barrel", "PF Cand Sum Pt Over photon pt Photons: Barrel", etBin_, etMin_, 2.);
360  h_SumPtOverPhoPt_Pho_unCleaned_[2] =
361  iBooker.book1D(histname + "Endcap", "PF Cand Sum Pt Over photon pt Photons: Endcap", etBin_, etMin_, 2.);
362  histname = "dRPhoPFcand_ChHad_unCleaned";
363  h_dRPhoPFcand_ChHad_unCleaned_[1] =
364  iBooker.book1D(histname + "Barrel", "dR(pho,cand) Charged Hadrons : Barrel", etBin_, etMin_, 0.7);
365  h_dRPhoPFcand_ChHad_unCleaned_[2] =
366  iBooker.book1D(histname + "Endcap", "dR(pho,cand) Charged Hadrons : Endcap", etBin_, etMin_, 0.7);
367  histname = "dRPhoPFcand_NeuHad_unCleaned";
368  h_dRPhoPFcand_NeuHad_unCleaned_[1] =
369  iBooker.book1D(histname + "Barrel", "dR(pho,cand) Neutral Hadrons : Barrel", etBin_, etMin_, 0.7);
370  h_dRPhoPFcand_NeuHad_unCleaned_[2] =
371  iBooker.book1D(histname + "Endcap", "dR(pho,cand) Neutral Hadrons : Endcap", etBin_, etMin_, 0.7);
372  histname = "dRPhoPFcand_Pho_unCleaned";
373  h_dRPhoPFcand_Pho_unCleaned_[1] =
374  iBooker.book1D(histname + "Barrel", "dR(pho,cand) Photons: Barrel", etBin_, etMin_, 0.7);
375  h_dRPhoPFcand_Pho_unCleaned_[2] =
376  iBooker.book1D(histname + "Endcap", "dR(pho,cand) Photons: Endcap", etBin_, etMin_, 0.7);
377 
379  if (makeProfiles_) {
380  // p_r9VsEt_[0] = iBooker.bookProfile("r9VsEt","Avg R9 vs E_{T};E_{T} (GeV);R9",etBin_,etMin_,etMax_,r9Bin_,r9Min_,r9Max_);
381  p_r9VsEt_[1] = iBooker.bookProfile(
382  "r9VsEtBarrel", "Avg R9 vs E_{T};E_{T} (GeV);R9", etBin_, etMin_, etMax_, r9Bin_, r9Min_, r9Max_);
383  p_r9VsEt_[2] = iBooker.bookProfile(
384  "r9VsEtEndcap", "Avg R9 vs E_{T};E_{T} (GeV);R9", etBin_, etMin_, etMax_, r9Bin_, r9Min_, r9Max_);
385  p_r9VsEta_[0] =
386  iBooker.bookProfile("r9VsEta", "Avg R9 vs #eta;#eta;R9", etaBin_, etaMin_, etaMax_, r9Bin_, r9Min_, r9Max_);
387  //
388  p_sigmaIetaIetaVsEta_[0] = iBooker.bookProfile("sigmaIetaIetaVsEta",
389  "Avg #sigma_{i#etai#eta} vs #eta;#eta;#sigma_{i#etai#eta}",
390  etaBin_,
391  etaMin_,
392  etaMax_,
393  sigmaIetaBin_,
394  sigmaIetaMin_,
395  sigmaIetaMax_);
396  p_e1x5VsEt_[1] = iBooker.bookProfile(
397  "e1x5VsEtBarrel", "Avg E1x5 vs E_{T};E_{T} (GeV);E1X5 (GeV)", etBin_, etMin_, etMax_, etBin_, etMin_, etMax_);
398  p_e1x5VsEt_[2] = iBooker.bookProfile(
399  "e1x5VsEtEndcap", "Avg E1x5 vs E_{T};E_{T} (GeV);E1X5 (GeV)", etBin_, etMin_, etMax_, etBin_, etMin_, etMax_);
400  p_e1x5VsEta_[0] = iBooker.bookProfile(
401  "e1x5VsEta", "Avg E1x5 vs #eta;#eta;E1X5 (GeV)", etaBin_, etaMin_, etaMax_, etBin_, etMin_, etMax_);
402  p_e2x5VsEt_[1] = iBooker.bookProfile(
403  "e2x5VsEtBarrel", "Avg E2x5 vs E_{T};E_{T} (GeV);E2X5 (GeV)", etBin_, etMin_, etMax_, etBin_, etMin_, etMax_);
404  p_e2x5VsEt_[2] = iBooker.bookProfile(
405  "e2x5VsEtEndcap", "Avg E2x5 vs E_{T};E_{T} (GeV);E2X5 (GeV)", etBin_, etMin_, etMax_, etBin_, etMin_, etMax_);
406  p_e2x5VsEta_[0] = iBooker.bookProfile(
407  "e2x5VsEta", "Avg E2x5 vs #eta;#eta;E2X5 (GeV)", etaBin_, etaMin_, etaMax_, etBin_, etMin_, etMax_);
408  p_r1x5VsEt_[1] = iBooker.bookProfile(
409  "r1x5VsEtBarrel", "Avg R1x5 vs E_{T};E_{T} (GeV);R1X5", etBin_, etMin_, etMax_, r9Bin_, r9Min_, r9Max_);
410  p_r1x5VsEt_[2] = iBooker.bookProfile(
411  "r1x5VsEtEndcap", "Avg R1x5 vs E_{T};E_{T} (GeV);R1X5", etBin_, etMin_, etMax_, r9Bin_, r9Min_, r9Max_);
412  p_r1x5VsEta_[0] = iBooker.bookProfile(
413  "r1x5VsEta", "Avg R1x5 vs #eta;#eta;R1X5", etaBin_, etaMin_, etaMax_, r9Bin_, r9Min_, r9Max_);
414  p_r2x5VsEt_[1] = iBooker.bookProfile(
415  "r2x5VsEtBarrel", "Avg R2x5 vs E_{T};E_{T} (GeV);R2X5", etBin_, etMin_, etMax_, r9Bin_, r9Min_, r9Max_);
416  p_r2x5VsEt_[2] = iBooker.bookProfile(
417  "r2x5VsEtEndcap", "Avg R2x5 vs E_{T};E_{T} (GeV);R2X5", etBin_, etMin_, etMax_, r9Bin_, r9Min_, r9Max_);
418  p_r2x5VsEta_[0] = iBooker.bookProfile(
419  "r2x5VsEta", "Avg R2x5 vs #eta;#eta;R2X5", etaBin_, etaMin_, etaMax_, r9Bin_, r9Min_, r9Max_);
420  p_nTrackIsolSolidVsEt_[1] =
421  iBooker.bookProfile("nIsoTracksSolidVsEtBarrel",
422  "Avg Number Of Tracks in the Solid Iso Cone vs E_{T};E_{T};# tracks",
423  etBin_,
424  etMin_,
425  etMax_,
426  numberBin_,
427  numberMin_,
428  numberMax_);
429  p_nTrackIsolSolidVsEt_[2] =
430  iBooker.bookProfile("nIsoTracksSolidVsEtEndcap",
431  "Avg Number Of Tracks in the Solid Iso Cone vs E_{T};E_{T};# tracks",
432  etBin_,
433  etMin_,
434  etMax_,
435  numberBin_,
436  numberMin_,
437  numberMax_);
438  p_nTrackIsolSolidVsEta_[0] = iBooker.bookProfile("nIsoTracksSolidVsEta",
439  "Avg Number Of Tracks in the Solid Iso Cone vs #eta;#eta;# tracks",
440  etaBin_,
441  etaMin_,
442  etaMax_,
443  numberBin_,
444  numberMin_,
445  numberMax_);
446  p_nTrackIsolHollowVsEt_[1] =
447  iBooker.bookProfile("nIsoTracksHollowVsEtBarrel",
448  "Avg Number Of Tracks in the Hollow Iso Cone vs E_{T};E_{T};# tracks",
449  etBin_,
450  etMin_,
451  etMax_,
452  numberBin_,
453  numberMin_,
454  numberMax_);
455  p_nTrackIsolHollowVsEt_[2] =
456  iBooker.bookProfile("nIsoTracksHollowVsEtEndcap",
457  "Avg Number Of Tracks in the Hollow Iso Cone vs E_{T};E_{T};# tracks",
458  etBin_,
459  etMin_,
460  etMax_,
461  numberBin_,
462  numberMin_,
463  numberMax_);
464  p_nTrackIsolHollowVsEta_[0] =
465  iBooker.bookProfile("nIsoTracksHollowVsEta",
466  "Avg Number Of Tracks in the Hollow Iso Cone vs #eta;#eta;# tracks",
467  etaBin_,
468  etaMin_,
469  etaMax_,
470  numberBin_,
471  numberMin_,
472  numberMax_);
473  p_trackPtSumSolidVsEt_[1] =
474  iBooker.bookProfile("isoPtSumSolidVsEtBarrel",
475  "Avg Track P_{T} Sum in the Solid Iso Cone vs E_{T};E_{T} (GeV);P_{T} (GeV)",
476  etBin_,
477  etMin_,
478  etMax_,
479  sumBin_,
480  sumMin_,
481  sumMax_);
482  p_trackPtSumSolidVsEt_[2] =
483  iBooker.bookProfile("isoPtSumSolidVsEtEndcap",
484  "Avg Track P_{T} Sum in the Solid Iso Cone vs E_{T};E_{T} (GeV);P_{T} (GeV)",
485  etBin_,
486  etMin_,
487  etMax_,
488  sumBin_,
489  sumMin_,
490  sumMax_);
491  p_trackPtSumSolidVsEta_[0] =
492  iBooker.bookProfile("isoPtSumSolidVsEta",
493  "Avg Track P_{T} Sum in the Solid Iso Cone vs #eta;#eta;P_{T} (GeV)",
494  etaBin_,
495  etaMin_,
496  etaMax_,
497  sumBin_,
498  sumMin_,
499  sumMax_);
500  p_trackPtSumHollowVsEt_[1] =
501  iBooker.bookProfile("isoPtSumHollowVsEtBarrel",
502  "Avg Track P_{T} Sum in the Hollow Iso Cone vs E_{T};E_{T} (GeV);P_{T} (GeV)",
503  etBin_,
504  etMin_,
505  etMax_,
506  sumBin_,
507  sumMin_,
508  sumMax_);
509  p_trackPtSumHollowVsEt_[2] =
510  iBooker.bookProfile("isoPtSumHollowVsEtEndcap",
511  "Avg Track P_{T} Sum in the Hollow Iso Cone vs E_{T};E_{T} (GeV);P_{T} (GeV)",
512  etBin_,
513  etMin_,
514  etMax_,
515  sumBin_,
516  sumMin_,
517  sumMax_);
518  p_trackPtSumHollowVsEta_[0] =
519  iBooker.bookProfile("isoPtSumHollowVsEta",
520  "Avg Track P_{T} Sum in the Hollow Iso Cone vs #eta;#eta;P_{T} (GeV)",
521  etaBin_,
522  etaMin_,
523  etaMax_,
524  sumBin_,
525  sumMin_,
526  sumMax_);
527  p_ecalSumVsEt_[1] = iBooker.bookProfile("ecalSumVsEtBarrel",
528  "Avg Ecal Sum in the Iso Cone vs E_{T};E_{T} (GeV);E (GeV)",
529  etBin_,
530  etMin_,
531  etMax_,
532  sumBin_,
533  sumMin_,
534  sumMax_);
535  p_ecalSumVsEt_[2] = iBooker.bookProfile("ecalSumVsEtEndcap",
536  "Avg Ecal Sum in the Iso Cone vs E_{T};E_{T} (GeV);E (GeV)",
537  etBin_,
538  etMin_,
539  etMax_,
540  sumBin_,
541  sumMin_,
542  sumMax_);
543  p_ecalSumVsEta_[0] = iBooker.bookProfile("ecalSumVsEta",
544  "Avg Ecal Sum in the Iso Cone vs #eta;#eta;E (GeV)",
545  etaBin_,
546  etaMin_,
547  etaMax_,
548  sumBin_,
549  sumMin_,
550  sumMax_);
551  p_hcalSumVsEt_[1] = iBooker.bookProfile("hcalSumVsEtBarrel",
552  "Avg Hcal Sum in the Iso Cone vs E_{T};E_{T} (GeV);E (GeV)",
553  etBin_,
554  etMin_,
555  etMax_,
556  sumBin_,
557  sumMin_,
558  sumMax_);
559  p_hcalSumVsEt_[2] = iBooker.bookProfile("hcalSumVsEtEndcap",
560  "Avg Hcal Sum in the Iso Cone vs E_{T};E_{T} (GeV);E (GeV)",
561  etBin_,
562  etMin_,
563  etMax_,
564  sumBin_,
565  sumMin_,
566  sumMax_);
567  p_hcalSumVsEta_[0] = iBooker.bookProfile("hcalSumVsEta",
568  "Avg Hcal Sum in the Iso Cone vs #eta;#eta;E (GeV)",
569  etaBin_,
570  etaMin_,
571  etaMax_,
572  sumBin_,
573  sumMin_,
574  sumMax_);
575  p_hOverEVsEt_[1] = iBooker.bookProfile("p_hOverEVsEtBarrel",
576  "Avg H/E vs Et;E_{T} (GeV);H/E",
577  etBin_,
578  etMin_,
579  etMax_,
580  hOverEBin_,
581  hOverEMin_,
582  hOverEMax_);
583  p_hOverEVsEt_[2] = iBooker.bookProfile("p_hOverEVsEtEndcap",
584  "Avg H/E vs Et;E_{T} (GeV);H/E",
585  etBin_,
586  etMin_,
587  etMax_,
588  hOverEBin_,
589  hOverEMin_,
590  hOverEMax_);
591  p_hOverEVsEta_[0] = iBooker.bookProfile(
592  "p_hOverEVsEta", "Avg H/E vs #eta;#eta;H/E", etaBin_, etaMin_, etaMax_, hOverEBin_, hOverEMin_, hOverEMax_);
593 
594  // sigmaE/E
595  histname = "sigmaEoverEVsNVtx";
596  p_phoSigmaEoverEVsNVtx_[1] = iBooker.bookProfile(histname + "Barrel",
597  "Photons #sigma_{E}/E vs N_{vtx}: Barrel; N_{vtx}; #sigma_{E}/E ",
598  200,
599  -0.5,
600  199.5,
601  100,
602  0.,
603  0.08,
604  "");
605  p_phoSigmaEoverEVsNVtx_[2] = iBooker.bookProfile(histname + "Endcap",
606  "Photons #sigma_{E}/E vs N_{vtx}: Endcap; N_{vtx}; #sigma_{E}/E",
607  200,
608  -0.5,
609  199.5,
610  100,
611  0.,
612  0.08,
613  "");
614  }
615 
617  if (use2DHistos_) {
618  //SHOWER SHAPE
619  //r9
620  h2_r9VsEt_[0] = iBooker.book2D(
621  "r9VsEt2D", "R9 vs E_{T};E_{T} (GeV);R9", reducedEtBin_, etMin_, etMax_, reducedR9Bin_, r9Min_, r9Max_);
622  h2_r9VsEt_[1] = iBooker.book2D(
623  "r9VsEt2DBarrel", "R9 vs E_{T};E_{T} (GeV);R9", reducedEtBin_, etMin_, etMax_, reducedR9Bin_, r9Min_, r9Max_);
624  h2_r9VsEt_[2] = iBooker.book2D(
625  "r9VsEt2DEndcap", "R9 vs E_{T};E_{T} (GeV);R9", reducedEtBin_, etMin_, etMax_, reducedR9Bin_, r9Min_, r9Max_);
626  h2_r9VsEta_[0] = iBooker.book2D(
627  "r9VsEta2D", "R9 vs #eta;#eta;R9", reducedEtaBin_, etaMin_, etaMax_, reducedR9Bin_, r9Min_, r9Max_);
628  //sigmaIetaIeta
629  h2_sigmaIetaIetaVsEta_[0] = iBooker.book2D("sigmaIetaIetaVsEta2D",
630  "#sigma_{i#etai#eta} vs #eta;#eta;#sigma_{i#etai#eta}",
631  reducedEtaBin_,
632  etaMin_,
633  etaMax_,
634  sigmaIetaBin_,
635  sigmaIetaMin_,
636  sigmaIetaMax_);
637  //e1x5
638  h2_e1x5VsEt_[0] = iBooker.book2D("e1x5VsEt2D",
639  "E1x5 vs E_{T};E_{T} (GeV);E1X5 (GeV)",
640  reducedEtBin_,
641  etMin_,
642  etMax_,
643  reducedEtBin_,
644  etMin_,
645  etMax_);
646  h2_e1x5VsEt_[1] = iBooker.book2D("e1x5VsEt2DBarrel",
647  "E1x5 vs E_{T};E_{T} (GeV);E1X5 (GeV)",
648  reducedEtBin_,
649  etMin_,
650  etMax_,
651  reducedEtBin_,
652  etMin_,
653  etMax_);
654  h2_e1x5VsEt_[2] = iBooker.book2D("e1x5VsEt2DEndcap",
655  "E1x5 vs E_{T};E_{T} (GeV);E1X5 (GeV)",
656  reducedEtBin_,
657  etMin_,
658  etMax_,
659  reducedEtBin_,
660  etMin_,
661  etMax_);
662  h2_e1x5VsEta_[0] = iBooker.book2D(
663  "e1x5VsEta2D", "E1x5 vs #eta;#eta;E1X5 (GeV)", reducedEtaBin_, etaMin_, etaMax_, reducedEtBin_, etMin_, etMax_);
664  //e2x5
665  h2_e2x5VsEt_[0] = iBooker.book2D("e2x5VsEt2D",
666  "E2x5 vs E_{T};E_{T} (GeV);E2X5 (GeV)",
667  reducedEtBin_,
668  etMin_,
669  etMax_,
670  reducedEtBin_,
671  etMin_,
672  etMax_);
673  h2_e2x5VsEt_[1] = iBooker.book2D("e2x5VsEt2DBarrel",
674  "E2x5 vs E_{T};E_{T} (GeV);E2X5 (GeV)",
675  reducedEtBin_,
676  etMin_,
677  etMax_,
678  reducedEtBin_,
679  etMin_,
680  etMax_);
681  h2_e2x5VsEt_[2] = iBooker.book2D("e2x5VsEt2DEndcap",
682  "E2x5 vs E_{T};E_{T} (GeV);E2X5 (GeV)",
683  reducedEtBin_,
684  etMin_,
685  etMax_,
686  reducedEtBin_,
687  etMin_,
688  etMax_);
689  h2_e2x5VsEta_[0] = iBooker.book2D(
690  "e2x5VsEta2D", "E2x5 vs #eta;#eta;E2X5 (GeV)", reducedEtaBin_, etaMin_, etaMax_, reducedEtBin_, etMin_, etMax_);
691  //r1x5
692  h2_r1x5VsEt_[0] = iBooker.book2D(
693  "r1x5VsEt2D", "R1x5 vs E_{T};E_{T} (GeV);R1X5", reducedEtBin_, etMin_, etMax_, reducedR9Bin_, r9Min_, r9Max_);
694  h2_r1x5VsEt_[1] = iBooker.book2D("r1x5VsEt2DBarrel",
695  "R1x5 vs E_{T};E_{T} (GeV);R1X5",
696  reducedEtBin_,
697  etMin_,
698  etMax_,
699  reducedR9Bin_,
700  r9Min_,
701  r9Max_);
702  h2_r1x5VsEt_[2] = iBooker.book2D("r1x5VsEt2DEndcap",
703  "R1x5 vs E_{T};E_{T} (GeV);R1X5",
704  reducedEtBin_,
705  etMin_,
706  etMax_,
707  reducedR9Bin_,
708  r9Min_,
709  r9Max_);
710  h2_r1x5VsEta_[0] = iBooker.book2D(
711  "r1x5VsEta2D", "R1x5 vs #eta;#eta;R1X5", reducedEtaBin_, etaMin_, etaMax_, reducedR9Bin_, r9Min_, r9Max_);
712  //r2x5
713  h2_r2x5VsEt_[0] = iBooker.book2D(
714  "r2x5VsEt2D", "R2x5 vs E_{T};E_{T} (GeV);R2X5", reducedEtBin_, etMin_, etMax_, reducedR9Bin_, r9Min_, r9Max_);
715  h2_r2x5VsEt_[1] = iBooker.book2D("r2x5VsEt2DBarrel",
716  "R2x5 vs E_{T};E_{T} (GeV);R2X5",
717  reducedEtBin_,
718  etMin_,
719  etMax_,
720  reducedR9Bin_,
721  r9Min_,
722  r9Max_);
723  h2_r2x5VsEt_[2] = iBooker.book2D("r2x5VsEt2DEndcap",
724  "R2x5 vs E_{T};E_{T} (GeV);R2X5",
725  reducedEtBin_,
726  etMin_,
727  etMax_,
728  reducedR9Bin_,
729  r9Min_,
730  r9Max_);
731  h2_r2x5VsEta_[0] = iBooker.book2D(
732  "r2x5VsEta2D", "R2x5 vs #eta;#eta;R2X5", reducedEtaBin_, etaMin_, etaMax_, reducedR9Bin_, r9Min_, r9Max_);
733  //TRACK ISOLATION
734  //nTrackIsolSolid
735  h2_nTrackIsolSolidVsEt_[0] = iBooker.book2D("nIsoTracksSolidVsEt2D",
736  "Number Of Tracks in the Solid Iso Cone vs E_{T};E_{T};# tracks",
737  reducedEtBin_,
738  etMin_,
739  etMax_,
740  numberBin_,
741  numberMin_,
742  numberMax_);
743  h2_nTrackIsolSolidVsEta_[0] = iBooker.book2D("nIsoTracksSolidVsEta2D",
744  "Number Of Tracks in the Solid Iso Cone vs #eta;#eta;# tracks",
745  reducedEtaBin_,
746  etaMin_,
747  etaMax_,
748  numberBin_,
749  numberMin_,
750  numberMax_);
751  //nTrackIsolHollow
752  h2_nTrackIsolHollowVsEt_[0] = iBooker.book2D("nIsoTracksHollowVsEt2D",
753  "Number Of Tracks in the Hollow Iso Cone vs E_{T};E_{T};# tracks",
754  reducedEtBin_,
755  etMin_,
756  etMax_,
757  numberBin_,
758  numberMin_,
759  numberMax_);
760  h2_nTrackIsolHollowVsEta_[0] = iBooker.book2D("nIsoTracksHollowVsEta2D",
761  "Number Of Tracks in the Hollow Iso Cone vs #eta;#eta;# tracks",
762  reducedEtaBin_,
763  etaMin_,
764  etaMax_,
765  numberBin_,
766  numberMin_,
767  numberMax_);
768  //trackPtSumSolid
769  h2_trackPtSumSolidVsEt_[0] = iBooker.book2D("isoPtSumSolidVsEt2D",
770  "Track P_{T} Sum in the Solid Iso Cone;E_{T} (GeV);P_{T} (GeV)",
771  reducedEtBin_,
772  etMin_,
773  etMax_,
774  reducedSumBin_,
775  sumMin_,
776  sumMax_);
777  h2_trackPtSumSolidVsEta_[0] = iBooker.book2D("isoPtSumSolidVsEta2D",
778  "Track P_{T} Sum in the Solid Iso Cone;#eta;P_{T} (GeV)",
779  reducedEtaBin_,
780  etaMin_,
781  etaMax_,
782  reducedSumBin_,
783  sumMin_,
784  sumMax_);
785  //trackPtSumHollow
786  h2_trackPtSumHollowVsEt_[0] = iBooker.book2D("isoPtSumHollowVsEt2D",
787  "Track P_{T} Sum in the Hollow Iso Cone;E_{T} (GeV);P_{T} (GeV)",
788  reducedEtBin_,
789  etMin_,
790  etMax_,
791  reducedSumBin_,
792  sumMin_,
793  sumMax_);
794  h2_trackPtSumHollowVsEta_[0] = iBooker.book2D("isoPtSumHollowVsEta2D",
795  "Track P_{T} Sum in the Hollow Iso Cone;#eta;P_{T} (GeV)",
796  reducedEtaBin_,
797  etaMin_,
798  etaMax_,
799  reducedSumBin_,
800  sumMin_,
801  sumMax_);
802  //CALORIMETER ISOLATION VARIABLES
803  //ecal sum
804  h2_ecalSumVsEt_[0] = iBooker.book2D("ecalSumVsEt2D",
805  "Ecal Sum in the Iso Cone;E_{T} (GeV);E (GeV)",
806  reducedEtBin_,
807  etMin_,
808  etMax_,
809  reducedSumBin_,
810  sumMin_,
811  sumMax_);
812  h2_ecalSumVsEta_[0] = iBooker.book2D("ecalSumVsEta2D",
813  "Ecal Sum in the Iso Cone;#eta;E (GeV)",
814  reducedEtaBin_,
815  etaMin_,
816  etaMax_,
817  reducedSumBin_,
818  sumMin_,
819  sumMax_);
820  //hcal sum
821  h2_hcalSumVsEt_[0] = iBooker.book2D("hcalSumVsEt2D",
822  "Hcal Sum in the Iso Cone;E_{T} (GeV);E (GeV)",
823  reducedEtBin_,
824  etMin_,
825  etMax_,
826  reducedSumBin_,
827  sumMin_,
828  sumMax_);
829  h2_hcalSumVsEta_[0] = iBooker.book2D("hcalSumVsEta2D",
830  "Hcal Sum in the Iso Cone;#eta;E (GeV)",
831  reducedEtaBin_,
832  etaMin_,
833  etaMax_,
834  reducedSumBin_,
835  sumMin_,
836  sumMax_);
837  }
838 }
839 
841  using namespace edm;
842 
843  if (nEvt_ % prescaleFactor_)
844  return;
845  nEvt_++;
846  LogInfo("ZToMuMuGammaAnalyzer") << "ZToMuMuGammaAnalyzer Analyzing event number: " << e.id() << " Global Counter "
847  << nEvt_ << "\n";
848 
849  // Get the trigger results
850  bool validTriggerEvent = true;
851  edm::Handle<trigger::TriggerEvent> triggerEventHandle;
853  e.getByToken(triggerEvent_token_, triggerEventHandle);
854  if (!triggerEventHandle.isValid()) {
855  edm::LogInfo("PhotonAnalyzer") << "Error! Can't get the product: triggerEvent_token_" << endl;
856  validTriggerEvent = false;
857  }
858  if (validTriggerEvent)
859  triggerEvent = *(triggerEventHandle.product());
860 
861  // Get the reconstructed photons
862  // bool validPhotons=true;
863  Handle<reco::PhotonCollection> photonHandle;
865  e.getByToken(photon_token_, photonHandle);
866  if (!photonHandle.isValid()) {
867  edm::LogInfo("ZToMuMuGammaAnalyzer") << "Error! Can't get the product: photon_token_" << endl;
868  //validPhotons=false;
869  }
870  // if(validPhotons) photonCollection = *(photonHandle.product());
871 
872  // Get the PF refined cluster collection
873  Handle<reco::PFCandidateCollection> pfCandidateHandle;
874  e.getByToken(pfCandidates_, pfCandidateHandle);
875  if (!pfCandidateHandle.isValid()) {
876  edm::LogError("PhotonValidator") << "Error! Can't get the product pfCandidates " << std::endl;
877  }
878 
879  edm::Handle<edm::ValueMap<std::vector<reco::PFCandidateRef> > > phoToParticleBasedIsoMapHandle;
880  edm::ValueMap<std::vector<reco::PFCandidateRef> > phoToParticleBasedIsoMap;
881  if (fName_ == "zmumugammaGedValidation") {
882  e.getByToken(photonIsoValmap_token_, phoToParticleBasedIsoMapHandle);
883  // e.getByLabel("particleBasedIsolation",valueMapPhoPFCandIso_,phoToParticleBasedIsoMapHandle);
884  if (!phoToParticleBasedIsoMapHandle.isValid()) {
885  edm::LogInfo("PhotonValidator") << "Error! Can't get the product: valueMap photons to particle based iso "
886  << std::endl;
887  }
888  phoToParticleBasedIsoMap = *(phoToParticleBasedIsoMapHandle.product());
889  }
890 
891  // Get the reconstructed muons
892  bool validMuons = true;
893  Handle<reco::MuonCollection> muonHandle;
895  e.getByToken(muon_token_, muonHandle);
896  if (!muonHandle.isValid()) {
897  edm::LogInfo("ZToMuMuGammaAnalyzer") << "Error! Can't get the product: muon_token_" << endl;
898  validMuons = false;
899  }
900  if (validMuons)
901  muonCollection = *(muonHandle.product());
902 
903  // Get the beam spot
905  e.getByToken(beamSpot_token_, bsHandle);
906  if (!bsHandle.isValid()) {
907  edm::LogError("TrackerOnlyConversionProducer") << "Error! Can't get the product primary Vertex Collection "
908  << "\n";
909  return;
910  }
911  const reco::BeamSpot& thebs = *bsHandle.product();
912 
913  //Prepare list of photon-related HLT filter names
914  vector<int> Keys;
915  for (uint filterIndex = 0; filterIndex < triggerEvent.sizeFilters();
916  ++filterIndex) { //loop over all trigger filters in event (i.e. filters passed)
917  string label = triggerEvent.filterTag(filterIndex).label();
918  if (label.find("Photon") != string::npos) { //get photon-related filters
919  for (uint filterKeyIndex = 0; filterKeyIndex < triggerEvent.filterKeys(filterIndex).size();
920  ++filterKeyIndex) { //loop over keys to objects passing this filter
921  Keys.push_back(
922  triggerEvent.filterKeys(filterIndex)[filterKeyIndex]); //add keys to a vector for later reference
923  }
924  }
925  }
926 
927  // sort Keys vector in ascending order
928  // and erases duplicate entries from the vector
929  sort(Keys.begin(), Keys.end());
930  for (uint i = 0; i < Keys.size();) {
931  if (i != (Keys.size() - 1)) {
932  if (Keys[i] == Keys[i + 1]) {
933  Keys.erase(Keys.begin() + i + 1);
934  } else {
935  ++i;
936  }
937  } else {
938  ++i;
939  }
940  }
941 
943  e.getByToken(offline_pvToken_, vtxH);
944  h_nRecoVtx_->Fill(float(vtxH->size()));
945 
946  //photon counters
947  int nPho = 0;
948  int nPhoBarrel = 0;
949  int nPhoEndcap = 0;
950 
952  if (muonCollection.size() < 2)
953  return;
954 
955  for (reco::MuonCollection::const_iterator iMu = muonCollection.begin(); iMu != muonCollection.end(); iMu++) {
956  if (!basicMuonSelection(*iMu))
957  continue;
958 
959  for (reco::MuonCollection::const_iterator iMu2 = iMu + 1; iMu2 != muonCollection.end(); iMu2++) {
960  if (!basicMuonSelection(*iMu2))
961  continue;
962  if (iMu->charge() * iMu2->charge() > 0)
963  continue;
964 
965  if (!muonSelection(*iMu, thebs) && !muonSelection(*iMu2, thebs))
966  continue;
967 
968  float mumuMass = mumuInvMass(*iMu, *iMu2);
969  if (mumuMass < minMumuInvMass_ || mumuMass > maxMumuInvMass_)
970  continue;
971 
972  h1_mumuInvMass_[0]->Fill(mumuMass);
973 
974  if (photonHandle->empty())
975  continue;
976 
977  reco::Muon nearMuon;
978  reco::Muon farMuon;
979  for (unsigned int iPho = 0; iPho < photonHandle->size(); iPho++) {
980  reco::PhotonRef aPho(reco::PhotonRef(photonHandle, iPho));
981  //
982  double dr1 = deltaR((*iMu).eta(), aPho->eta(), (*iMu).phi(), aPho->phi());
983  double dr2 = deltaR((*iMu2).eta(), aPho->eta(), (*iMu2).phi(), aPho->phi());
984  double drNear = dr1;
985  if (dr1 < dr2) {
986  nearMuon = *iMu;
987  farMuon = *iMu2;
988  drNear = dr1;
989  } else {
990  nearMuon = *iMu2;
991  farMuon = *iMu;
992  drNear = dr2;
993  }
994  //
995  if (nearMuon.isolationR03().hadEt > nearMuonHcalIso_)
996  continue;
997  if (farMuon.isolationR03().sumPt > farMuonTrackIso_)
998  continue;
999  if (farMuon.isolationR03().emEt > farMuonEcalIso_)
1000  continue;
1001  if (farMuon.pt() < farMuonMinPt_)
1002  continue;
1003  if (drNear > nearMuonDr_)
1004  continue;
1005  //
1006  if (!photonSelection(aPho))
1007  continue;
1008  float mumuGammaMass = mumuGammaInvMass(*iMu, *iMu2, aPho);
1009  if (mumuGammaMass < minMumuGammaInvMass_ || mumuGammaMass > maxMumuGammaInvMass_)
1010  continue;
1011  //
1012  //counter: number of photons
1013  int iDet = 0;
1014  if (aPho->isEB() || aPho->isEE()) {
1015  nPho++;
1016  }
1017  if (aPho->isEB()) {
1018  iDet = 1;
1019  nPhoBarrel++;
1020  }
1021  if (aPho->isEE()) {
1022  iDet = 2;
1023  nPhoEndcap++;
1024  }
1025 
1026  //PHOTON RELATED HISTOGRAMS
1027  h1_mumuGammaInvMass_[0]->Fill(mumuGammaMass);
1028  h1_mumuGammaInvMass_[iDet]->Fill(mumuGammaMass);
1029  //ENERGY
1030  h_phoE_[0]->Fill(aPho->energy());
1031  h_phoSigmaEoverE_[0]->Fill(aPho->getCorrectedEnergyError(aPho->getCandidateP4type()) / aPho->energy());
1032  h_phoEt_[0]->Fill(aPho->et());
1033  h_phoE_[iDet]->Fill(aPho->energy());
1034  h_phoSigmaEoverE_[iDet]->Fill(aPho->getCorrectedEnergyError(aPho->getCandidateP4type()) / aPho->energy());
1035  p_phoSigmaEoverEVsNVtx_[iDet]->Fill(float(vtxH->size()),
1036  aPho->getCorrectedEnergyError(aPho->getCandidateP4type()) / aPho->energy());
1037  h_phoEt_[iDet]->Fill(aPho->et());
1038  //GEOMETRICAL
1039  h_phoEta_[0]->Fill(aPho->eta());
1040  h_phoPhi_[0]->Fill(aPho->phi());
1041  h_scEta_[0]->Fill(aPho->superCluster()->eta());
1042  h_scPhi_[0]->Fill(aPho->superCluster()->phi());
1043  h_phoEta_[iDet]->Fill(aPho->eta());
1044  h_phoPhi_[iDet]->Fill(aPho->phi());
1045  h_scEta_[iDet]->Fill(aPho->superCluster()->eta());
1046  h_scPhi_[iDet]->Fill(aPho->superCluster()->phi());
1047  //SHOWER SHAPE
1048  h_r9_[0]->Fill(aPho->r9());
1049  h_e1x5_[0]->Fill(aPho->e1x5());
1050  h_e2x5_[0]->Fill(aPho->e2x5());
1051  h_r1x5_[0]->Fill(aPho->r1x5());
1052  h_r2x5_[0]->Fill(aPho->r2x5());
1053  h_phoSigmaIetaIeta_[0]->Fill(aPho->sigmaIetaIeta());
1054  //
1055  h_r9_[iDet]->Fill(aPho->r9());
1056  h_e1x5_[iDet]->Fill(aPho->e1x5());
1057  h_e2x5_[iDet]->Fill(aPho->e2x5());
1058  h_r1x5_[iDet]->Fill(aPho->r1x5());
1059  h_r2x5_[iDet]->Fill(aPho->r2x5());
1060  h_phoSigmaIetaIeta_[iDet]->Fill(aPho->sigmaIetaIeta());
1061  //TRACK ISOLATION
1062  h_nTrackIsolSolid_[0]->Fill(aPho->nTrkSolidConeDR04());
1063  h_nTrackIsolHollow_[0]->Fill(aPho->nTrkHollowConeDR04());
1064  h_trackPtSumSolid_[0]->Fill(aPho->trkSumPtSolidConeDR04());
1065  h_trackPtSumHollow_[0]->Fill(aPho->trkSumPtSolidConeDR04());
1066  h_nTrackIsolSolid_[iDet]->Fill(aPho->nTrkSolidConeDR04());
1067  h_nTrackIsolHollow_[iDet]->Fill(aPho->nTrkHollowConeDR04());
1068  h_trackPtSumSolid_[iDet]->Fill(aPho->trkSumPtSolidConeDR04());
1069  h_trackPtSumHollow_[iDet]->Fill(aPho->trkSumPtSolidConeDR04());
1070  //CALORIMETER ISOLATION
1071  h_ecalSum_[0]->Fill(aPho->ecalRecHitSumEtConeDR04());
1072  h_hcalSum_[0]->Fill(aPho->hcalTowerSumEtConeDR04());
1073  h_hOverE_[0]->Fill(aPho->hadTowOverEm());
1074  h_h1OverE_[0]->Fill(aPho->hadTowDepth1OverEm());
1075  h_h2OverE_[0]->Fill(aPho->hadTowDepth2OverEm());
1076  h_newhOverE_[0]->Fill(aPho->hadTowOverEm());
1077  h_ecalSum_[iDet]->Fill(aPho->ecalRecHitSumEtConeDR04());
1078  h_hcalSum_[iDet]->Fill(aPho->hcalTowerSumEtConeDR04());
1079  h_hOverE_[iDet]->Fill(aPho->hadTowOverEm());
1080  h_h1OverE_[iDet]->Fill(aPho->hadTowDepth1OverEm());
1081  h_h2OverE_[iDet]->Fill(aPho->hadTowDepth2OverEm());
1082  h_newhOverE_[iDet]->Fill(aPho->hadTowOverEm());
1083  // Isolation from particle flow
1084  h_chHadIso_[0]->Fill(aPho->chargedHadronIso());
1085  h_nHadIso_[0]->Fill(aPho->neutralHadronIso());
1086  h_phoIso_[0]->Fill(aPho->photonIso());
1087  h_nCluOutsideMustache_[0]->Fill(float(aPho->nClusterOutsideMustache()));
1088  h_etOutsideMustache_[0]->Fill(aPho->etOutsideMustache());
1089  h_pfMva_[0]->Fill(aPho->pfMVA());
1090  h_chHadIso_[iDet]->Fill(aPho->chargedHadronIso());
1091  h_nHadIso_[iDet]->Fill(aPho->neutralHadronIso());
1092  h_phoIso_[iDet]->Fill(aPho->photonIso());
1093  h_nCluOutsideMustache_[iDet]->Fill(float(aPho->nClusterOutsideMustache()));
1094  h_etOutsideMustache_[iDet]->Fill(aPho->etOutsideMustache());
1095  h_pfMva_[iDet]->Fill(aPho->pfMVA());
1096 
1098  if (fName_ == "zmumugammaGedValidation") {
1099  float SumPtIsoValCh = 0.;
1100  float SumPtIsoValNh = 0.;
1101  float SumPtIsoValPh = 0.;
1102 
1103  float SumPtIsoValCleanCh = 0.;
1104  float SumPtIsoValCleanNh = 0.;
1105  float SumPtIsoValCleanPh = 0.;
1106 
1107  for (unsigned int lCand = 0; lCand < pfCandidateHandle->size(); lCand++) {
1108  reco::PFCandidateRef pfCandRef(reco::PFCandidateRef(pfCandidateHandle, lCand));
1109  float dR = deltaR(aPho->eta(), aPho->phi(), pfCandRef->eta(), pfCandRef->phi());
1110  if (dR < 0.4) {
1112  reco::PFCandidate::ParticleType type = pfCandRef->particleId();
1113  if (type == reco::PFCandidate::e)
1114  continue;
1115  if (type == reco::PFCandidate::gamma && pfCandRef->mva_nothing_gamma() > 0.)
1116  continue;
1117 
1118  if (type == reco::PFCandidate::h) {
1119  SumPtIsoValCh += pfCandRef->pt();
1120  h_dRPhoPFcand_ChHad_unCleaned_[0]->Fill(dR);
1121  h_dRPhoPFcand_ChHad_unCleaned_[iDet]->Fill(dR);
1122  }
1123  if (type == reco::PFCandidate::h0) {
1124  SumPtIsoValNh += pfCandRef->pt();
1125  h_dRPhoPFcand_NeuHad_unCleaned_[0]->Fill(dR);
1126  h_dRPhoPFcand_NeuHad_unCleaned_[iDet]->Fill(dR);
1127  }
1128  if (type == reco::PFCandidate::gamma) {
1129  SumPtIsoValPh += pfCandRef->pt();
1130  h_dRPhoPFcand_Pho_unCleaned_[0]->Fill(dR);
1131  h_dRPhoPFcand_Pho_unCleaned_[iDet]->Fill(dR);
1132  }
1134  bool skip = false;
1135  for (std::vector<reco::PFCandidateRef>::const_iterator i = phoToParticleBasedIsoMap[aPho].begin();
1136  i != phoToParticleBasedIsoMap[aPho].end();
1137  ++i) {
1138  // std::cout << " PhotonValidator PfCand pt " << pfCandRef->pt() << " id " <<pfCandRef->particleId() << " and in the map " << (*i)->pt() << " type " << (*i)->particleId() << std::endl;
1139  if ((*i) == pfCandRef) {
1140  skip = true;
1141  }
1142  } // loop over the PFCandidates flagged as overlapping with the photon
1143 
1144  if (skip)
1145  continue;
1146  if (type == reco::PFCandidate::h) {
1147  SumPtIsoValCleanCh += pfCandRef->pt();
1148  h_dRPhoPFcand_ChHad_Cleaned_[0]->Fill(dR);
1149  h_dRPhoPFcand_ChHad_Cleaned_[iDet]->Fill(dR);
1150  }
1151  if (type == reco::PFCandidate::h0) {
1152  SumPtIsoValCleanNh += pfCandRef->pt();
1153  h_dRPhoPFcand_NeuHad_Cleaned_[0]->Fill(dR);
1154  h_dRPhoPFcand_NeuHad_Cleaned_[iDet]->Fill(dR);
1155  }
1156  if (type == reco::PFCandidate::gamma) {
1157  SumPtIsoValCleanPh += pfCandRef->pt();
1158  h_dRPhoPFcand_Pho_Cleaned_[0]->Fill(dR);
1159  h_dRPhoPFcand_Pho_Cleaned_[iDet]->Fill(dR);
1160  }
1161  } // dr=0.4
1162  } // loop over all PF Candidates
1163 
1164  h_SumPtOverPhoPt_ChHad_Cleaned_[0]->Fill(SumPtIsoValCleanCh / aPho->pt());
1165  h_SumPtOverPhoPt_NeuHad_Cleaned_[0]->Fill(SumPtIsoValCleanNh / aPho->pt());
1166  h_SumPtOverPhoPt_Pho_Cleaned_[0]->Fill(SumPtIsoValCleanPh / aPho->pt());
1167  h_SumPtOverPhoPt_ChHad_unCleaned_[0]->Fill(SumPtIsoValCh / aPho->pt());
1168  h_SumPtOverPhoPt_NeuHad_unCleaned_[0]->Fill(SumPtIsoValNh / aPho->pt());
1169  h_SumPtOverPhoPt_Pho_unCleaned_[0]->Fill(SumPtIsoValPh / aPho->pt());
1170  //
1171  h_SumPtOverPhoPt_ChHad_Cleaned_[iDet]->Fill(SumPtIsoValCleanCh / aPho->pt());
1172  h_SumPtOverPhoPt_NeuHad_Cleaned_[iDet]->Fill(SumPtIsoValCleanNh / aPho->pt());
1173  h_SumPtOverPhoPt_Pho_Cleaned_[iDet]->Fill(SumPtIsoValCleanPh / aPho->pt());
1174  h_SumPtOverPhoPt_ChHad_unCleaned_[iDet]->Fill(SumPtIsoValCh / aPho->pt());
1175  h_SumPtOverPhoPt_NeuHad_unCleaned_[iDet]->Fill(SumPtIsoValNh / aPho->pt());
1176  h_SumPtOverPhoPt_Pho_unCleaned_[iDet]->Fill(SumPtIsoValPh / aPho->pt());
1177  } // only for zmumugammaGedValidation
1178 
1179  if (makeProfiles_) {
1180  p_r9VsEt_[iDet]->Fill(aPho->et(), aPho->r9());
1181  p_r9VsEta_[0]->Fill(aPho->eta(), aPho->r9());
1182  p_e1x5VsEt_[iDet]->Fill(aPho->et(), aPho->e1x5());
1183  p_e1x5VsEta_[0]->Fill(aPho->eta(), aPho->e1x5());
1184  p_e2x5VsEt_[iDet]->Fill(aPho->et(), aPho->e2x5());
1185  p_e2x5VsEta_[0]->Fill(aPho->eta(), aPho->e2x5());
1186  p_r1x5VsEt_[iDet]->Fill(aPho->et(), aPho->r1x5());
1187  p_r1x5VsEta_[0]->Fill(aPho->eta(), aPho->r1x5());
1188  p_r2x5VsEt_[iDet]->Fill(aPho->et(), aPho->r2x5());
1189  p_r2x5VsEta_[0]->Fill(aPho->eta(), aPho->r2x5());
1190  //
1191  p_sigmaIetaIetaVsEta_[0]->Fill(aPho->eta(), aPho->sigmaIetaIeta());
1192  p_nTrackIsolSolidVsEt_[iDet]->Fill(aPho->et(), aPho->nTrkSolidConeDR04());
1193  p_nTrackIsolSolidVsEta_[0]->Fill(aPho->eta(), aPho->nTrkSolidConeDR04());
1194  p_nTrackIsolHollowVsEt_[iDet]->Fill(aPho->et(), aPho->nTrkHollowConeDR04());
1195  p_nTrackIsolHollowVsEta_[0]->Fill(aPho->eta(), aPho->nTrkHollowConeDR04());
1196  p_trackPtSumSolidVsEt_[iDet]->Fill(aPho->et(), aPho->trkSumPtSolidConeDR04());
1197  p_trackPtSumSolidVsEta_[0]->Fill(aPho->eta(), aPho->trkSumPtSolidConeDR04());
1198  p_trackPtSumHollowVsEt_[iDet]->Fill(aPho->et(), aPho->trkSumPtHollowConeDR04());
1199  p_trackPtSumHollowVsEta_[0]->Fill(aPho->eta(), aPho->trkSumPtHollowConeDR04());
1200  //
1201  p_ecalSumVsEt_[iDet]->Fill(aPho->et(), aPho->ecalRecHitSumEtConeDR04());
1202  p_ecalSumVsEta_[0]->Fill(aPho->eta(), aPho->ecalRecHitSumEtConeDR04());
1203  p_hcalSumVsEt_[iDet]->Fill(aPho->et(), aPho->hcalTowerSumEtConeDR04());
1204  p_hcalSumVsEta_[0]->Fill(aPho->eta(), aPho->hcalTowerSumEtConeDR04());
1205  p_hOverEVsEt_[iDet]->Fill(aPho->et(), aPho->hadTowOverEm());
1206  p_hOverEVsEta_[0]->Fill(aPho->eta(), aPho->hadTowOverEm());
1207  }
1208 
1210  if (use2DHistos_) {
1211  //SHOWER SHAPE
1212  h2_r9VsEt_[iDet]->Fill(aPho->et(), aPho->r9());
1213  h2_r9VsEta_[0]->Fill(aPho->eta(), aPho->r9());
1214  h2_e1x5VsEt_[iDet]->Fill(aPho->et(), aPho->e1x5());
1215  h2_e1x5VsEta_[0]->Fill(aPho->eta(), aPho->e1x5());
1216  h2_e2x5VsEta_[0]->Fill(aPho->eta(), aPho->e2x5());
1217  h2_e2x5VsEt_[iDet]->Fill(aPho->et(), aPho->e2x5());
1218  h2_r1x5VsEta_[0]->Fill(aPho->eta(), aPho->r1x5());
1219  h2_r1x5VsEt_[iDet]->Fill(aPho->et(), aPho->r1x5());
1220  h2_r2x5VsEt_[iDet]->Fill(aPho->et(), aPho->r2x5());
1221  h2_r2x5VsEta_[0]->Fill(aPho->eta(), aPho->r2x5());
1222  h2_sigmaIetaIetaVsEta_[0]->Fill(aPho->eta(), aPho->sigmaIetaIeta());
1223  //TRACK ISOLATION
1224  h2_nTrackIsolSolidVsEt_[0]->Fill(aPho->et(), aPho->nTrkSolidConeDR04());
1225  h2_nTrackIsolSolidVsEta_[0]->Fill(aPho->eta(), aPho->nTrkSolidConeDR04());
1226  h2_nTrackIsolHollowVsEt_[0]->Fill(aPho->et(), aPho->nTrkHollowConeDR04());
1227  h2_nTrackIsolHollowVsEta_[0]->Fill(aPho->eta(), aPho->nTrkHollowConeDR04());
1228  h2_trackPtSumSolidVsEt_[0]->Fill(aPho->et(), aPho->trkSumPtSolidConeDR04());
1229  h2_trackPtSumSolidVsEta_[0]->Fill(aPho->eta(), aPho->trkSumPtSolidConeDR04());
1230  h2_trackPtSumHollowVsEt_[0]->Fill(aPho->et(), aPho->trkSumPtHollowConeDR04());
1231  h2_trackPtSumHollowVsEta_[0]->Fill(aPho->eta(), aPho->trkSumPtHollowConeDR04());
1232  //CALORIMETER ISOLATION
1233  h2_ecalSumVsEt_[iDet]->Fill(aPho->et(), aPho->ecalRecHitSumEtConeDR04());
1234  h2_ecalSumVsEta_[0]->Fill(aPho->eta(), aPho->ecalRecHitSumEtConeDR04());
1235  h2_hcalSumVsEt_[iDet]->Fill(aPho->et(), aPho->hcalTowerSumEtConeDR04());
1236  h2_hcalSumVsEta_[0]->Fill(aPho->eta(), aPho->hcalTowerSumEtConeDR04());
1237  }
1238  } //end photon loop
1239 
1240  h_nPho_[0]->Fill(float(nPho));
1241  h_nPho_[1]->Fill(float(nPhoBarrel));
1242  h_nPho_[2]->Fill(float(nPhoEndcap));
1243  } //end inner muon loop
1244  } //end outer muon loop
1245 } //End of Analyze method
1246 
1248  bool result = true;
1249  if (!mu.innerTrack().isNonnull())
1250  result = false;
1251  if (!mu.globalTrack().isNonnull())
1252  result = false;
1253  if (!mu.isGlobalMuon())
1254  result = false;
1255  if (mu.pt() < muonMinPt_)
1256  result = false;
1257  if (fabs(mu.eta()) > 2.4)
1258  result = false;
1259 
1260  int pixHits = 0;
1261  int tkHits = 0;
1262  if (mu.innerTrack().isNonnull()) {
1263  pixHits = mu.innerTrack()->hitPattern().numberOfValidPixelHits();
1264  tkHits = mu.innerTrack()->hitPattern().numberOfValidStripHits();
1265  }
1266 
1267  if (pixHits + tkHits < minPixStripHits_)
1268  result = false;
1269 
1270  return result;
1271 }
1272 
1274  bool result = true;
1275  if (mu.globalTrack()->normalizedChi2() > muonMaxChi2_)
1276  result = false;
1277  if (fabs(mu.globalTrack()->dxy(beamSpot)) > muonMaxDxy_)
1278  result = false;
1279  if (mu.numberOfMatches() < muonMatches_)
1280  result = false;
1281 
1282  if (mu.track()->hitPattern().numberOfValidPixelHits() < validPixHits_)
1283  result = false;
1284  if (mu.globalTrack()->hitPattern().numberOfValidMuonHits() < validMuonHits_)
1285  result = false;
1286  if (!mu.isTrackerMuon())
1287  result = false;
1288  // track isolation
1289  if (mu.isolationR03().sumPt > muonTrackIso_)
1290  result = false;
1291  if (fabs(mu.eta()) > muonTightEta_)
1292  result = false;
1293 
1294  return result;
1295 }
1296 
1298  bool result = true;
1299  if (pho->pt() < photonMinEt_)
1300  result = false;
1301  if (fabs(pho->eta()) > photonMaxEta_)
1302  result = false;
1303  if (pho->isEBEEGap())
1304  result = false;
1305 
1306  double EtCorrHcalIso = pho->hcalTowerSumEtConeDR03() - 0.005 * pho->pt();
1307  double EtCorrTrkIso = pho->trkSumPtHollowConeDR03() - 0.002 * pho->pt();
1308 
1309  if (pho->r9() <= 0.9) {
1310  if (pho->isEB() && (pho->hadTowOverEm() > 0.075 || pho->sigmaIetaIeta() > 0.014))
1311  result = false;
1312  if (pho->isEE() && (pho->hadTowOverEm() > 0.075 || pho->sigmaIetaIeta() > 0.034))
1313  result = false;
1315  if (EtCorrHcalIso > 4.0)
1316  result = false;
1317  if (EtCorrTrkIso > 4.0)
1318  result = false;
1319  if (pho->chargedHadronIso() > 4)
1320  result = false;
1321  } else {
1322  if (pho->isEB() && (pho->hadTowOverEm() > 0.082 || pho->sigmaIetaIeta() > 0.014))
1323  result = false;
1324  if (pho->isEE() && (pho->hadTowOverEm() > 0.075 || pho->sigmaIetaIeta() > 0.034))
1325  result = false;
1327  if (EtCorrHcalIso > 50.0)
1328  result = false;
1329  if (EtCorrTrkIso > 50.0)
1330  result = false;
1331  if (pho->chargedHadronIso() > 4)
1332  result = false;
1333  }
1334  return result;
1335 }
1336 
1338  math::XYZTLorentzVector p12 = mu1.p4() + mu2.p4();
1339  float mumuMass2 = p12.Dot(p12);
1340  float invMass = sqrt(mumuMass2);
1341  return invMass;
1342 }
1343 
1345  math::XYZTLorentzVector p12 = mu1.p4() + mu2.p4() + pho->p4();
1346  float Mass2 = p12.Dot(p12);
1347  float invMass = sqrt(Mass2);
1348  return invMass;
1349 }
ZToMuMuGammaAnalyzer::mumuGammaInvMass
float mumuGammaInvMass(const reco::Muon &mu1, const reco::Muon &mu2, const reco::PhotonRef &pho)
Definition: ZToMuMuGammaAnalyzer.cc:1344
mps_fire.i
i
Definition: mps_fire.py:428
pwdgSkimBPark_cfi.beamSpot
beamSpot
Definition: pwdgSkimBPark_cfi.py:5
PhotonMonitor_cff.photonSelection
photonSelection
Definition: PhotonMonitor_cff.py:43
ZToMuMuGammaAnalyzer::photonSelection
bool photonSelection(const reco::PhotonRef &p)
Definition: ZToMuMuGammaAnalyzer.cc:1297
edm::Handle::product
T const * product() const
Definition: Handle.h:70
reco::PFCandidate::e
Definition: PFCandidate.h:47
amptDefaultParameters_cff.mu
mu
Definition: amptDefaultParameters_cff.py:16
edm::Run
Definition: Run.h:45
reco::MuonIsolation::emEt
float emEt
ecal sum-Et
Definition: MuonIsolation.h:7
edm
HLT enums.
Definition: AlignableModifier.h:19
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
reco::PFCandidate::h
Definition: PFCandidate.h:46
ZToMuMuGammaAnalyzer::bookHistograms
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: ZToMuMuGammaAnalyzer.cc:111
reco::LeafCandidate::pt
double pt() const final
transverse momentum
Definition: LeafCandidate.h:146
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
edm::Handle< trigger::TriggerEvent >
parallelization.uint
uint
Definition: parallelization.py:124
reco::Muon
Definition: Muon.h:27
edm::Ref< PhotonCollection >
ZToMuMuGammaAnalyzer::~ZToMuMuGammaAnalyzer
~ZToMuMuGammaAnalyzer() override
Definition: ZToMuMuGammaAnalyzer.cc:109
optionsL1T.skip
skip
Definition: optionsL1T.py:30
reco::MuonIsolation::sumPt
float sumPt
sum-pt of tracks
Definition: MuonIsolation.h:6
reco::MuonCollection
std::vector< Muon > MuonCollection
collection of Muon objects
Definition: MuonFwd.h:9
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
reco::BeamSpot
Definition: BeamSpot.h:21
dqm::implementation::IBooker::bookProfile
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
Definition: DQMStore.h:322
PbPb_ZMuSkimMuonDPG_cff.deltaR
deltaR
Definition: PbPb_ZMuSkimMuonDPG_cff.py:63
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ValueMap::end
const_iterator end() const
Definition: ValueMap.h:230
edm::ParameterSet
Definition: ParameterSet.h:47
ZToMuMuGammaAnalyzer::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: ZToMuMuGammaAnalyzer.cc:840
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
DiDispStaMuonMonitor_cfi.muonSelection
muonSelection
Definition: DiDispStaMuonMonitor_cfi.py:36
reco::LeafCandidate::p4
const LorentzVector & p4() const final
four-momentum Lorentz vector
Definition: LeafCandidate.h:114
trigger::Keys
std::vector< size_type > Keys
Definition: TriggerTypeDefs.h:19
reco::PFCandidate::gamma
Definition: PFCandidate.h:49
edm::EventSetup
Definition: EventSetup.h:57
trigger::TriggerEvent
The single EDProduct to be saved for each event (AOD case)
Definition: TriggerEvent.h:25
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
PDWG_DiPhoton_SD_cff.triggerEvent
triggerEvent
Definition: PDWG_DiPhoton_SD_cff.py:39
pdwgLeptonRecoSkim_cfi.muonCollection
muonCollection
Definition: pdwgLeptonRecoSkim_cfi.py:7
ZToMuMuGammaAnalyzer::ZToMuMuGammaAnalyzer
ZToMuMuGammaAnalyzer(const edm::ParameterSet &)
Definition: ZToMuMuGammaAnalyzer.cc:18
ZToMuMuGammaAnalyzer.h
std
Definition: JetResolutionObject.h:76
reco::MuonIsolation::hadEt
float hadEt
hcal sum-Et
Definition: MuonIsolation.h:8
math::XYZTLorentzVector
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
edm::ValueMap
Definition: ValueMap.h:107
dqm::implementation::IBooker::book2D
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:177
reco::PFCandidate::h0
Definition: PFCandidate.h:50
reco::Muon::isolationR03
const MuonIsolation & isolationR03() const
Definition: Muon.h:166
dqm::implementation::IBooker
Definition: DQMStore.h:43
ZToMuMuGammaAnalyzer::muonSelection
bool muonSelection(const reco::Muon &m, const reco::BeamSpot &bs)
Definition: ZToMuMuGammaAnalyzer.cc:1273
ZToMuMuGammaAnalyzer::basicMuonSelection
bool basicMuonSelection(const reco::Muon &m)
Definition: ZToMuMuGammaAnalyzer.cc:1247
ZToMuMuGammaAnalyzer::mumuInvMass
float mumuInvMass(const reco::Muon &m1, const reco::Muon &m2)
Definition: ZToMuMuGammaAnalyzer.cc:1337
reco::PhotonCollection
std::vector< Photon > PhotonCollection
collectin of Photon objects
Definition: PhotonFwd.h:9
mps_fire.result
result
Definition: mps_fire.py:311
HGC3DClusterGenMatchSelector_cfi.dR
dR
Definition: HGC3DClusterGenMatchSelector_cfi.py:7
ExoticaDQM_cfi.photonCollection
photonCollection
Definition: ExoticaDQM_cfi.py:17
reco::PFCandidate::ParticleType
ParticleType
particle types
Definition: PFCandidate.h:44
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15
label
const char * label
Definition: PFTauDecayModeTools.cc:11
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37