CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ExoticaDQM.cc
Go to the documentation of this file.
2 
3 #include <memory>
4 
5 // DQM
8 
9 // Framework
18 
19 // Candidate handling
37 
38 // Vertex utilities
41 
42 // Other
46 
47 // Math
55 
58 // Transient tracks
66 
67 //JetCorrection
69 
70 // ROOT
71 #include "TLorentzVector.h"
72 
73 // STDLIB
74 #include <iostream>
75 #include <iomanip>
76 #include <stdio.h>
77 #include <string>
78 #include <sstream>
79 #include <math.h>
80 
81 using namespace edm;
82 using namespace std;
83 using namespace reco;
84 using namespace trigger;
85 
86 typedef vector<string> vstring;
87 
88 
89 //
90 // -- Constructor
91 //
93 
94  edm::LogInfo("ExoticaDQM") << " Starting ExoticaDQM " << "\n" ;
95 
96  typedef std::vector<edm::InputTag> vtag;
97 
98  // Get parameters from configuration file
99  // Trigger
100  TriggerToken_ = consumes<TriggerResults>(
101  ps.getParameter<edm::InputTag>("TriggerResults"));
102  HltPaths_ = ps.getParameter<vector<string> >("HltPaths");
103 
104  VertexToken_ = consumes<reco::VertexCollection>(
105  ps.getParameter<InputTag>("vertexCollection"));
106  //
107  ElectronToken_ = consumes<reco::GsfElectronCollection>(
108  ps.getParameter<InputTag>("electronCollection"));
109  //
110  MuonToken_ = consumes<reco::MuonCollection>(
111  ps.getParameter<InputTag>("muonCollection"));
112  //
113  PhotonToken_ = consumes<reco::PhotonCollection>(
114  ps.getParameter<InputTag>("photonCollection"));
115  //
116  PFJetToken_ = consumes<reco::PFJetCollection>(
117  ps.getParameter<InputTag>("pfJetCollection"));
118  //
119  DiJetPFJetCollection_ = ps.getParameter<std::vector<edm::InputTag> >("DiJetPFJetCollection");
120  for (std::vector<edm::InputTag>::const_iterator jetlabel = DiJetPFJetCollection_.begin(), jetlabelEnd = DiJetPFJetCollection_.end(); jetlabel != jetlabelEnd; ++jetlabel) {
121  DiJetPFJetToken_.push_back(consumes<reco::PFJetCollection>(*jetlabel));
122  }
123  //
124  PFMETToken_ = consumes<reco::PFMETCollection>(
125  ps.getParameter<InputTag>("pfMETCollection"));
126  ecalBarrelRecHitToken_ = consumes<EBRecHitCollection>(
127  ps.getUntrackedParameter<InputTag>("ecalBarrelRecHit", InputTag("reducedEcalRecHitsEB")));
128  ecalEndcapRecHitToken_ = consumes<EERecHitCollection>(
129  ps.getUntrackedParameter<InputTag>("ecalEndcapRecHit", InputTag("reducedEcalRecHitsEE")));
130 
131  correctorToken_ = consumes<reco::JetCorrector>(ps.getParameter<edm::InputTag>("corrector"));
132 
133  //Cuts - MultiJets
134  jetID = new reco::helper::JetIDHelper(ps.getParameter<ParameterSet>("JetIDParams"), consumesCollector());
135 
136  //Varibles and Cuts for each Module:
137  //Dijet
138  dijet_PFJet1_pt_cut_ = ps.getParameter<double>("dijet_PFJet1_pt_cut");
139  dijet_PFJet2_pt_cut_ = ps.getParameter<double>("dijet_PFJet2_pt_cut");
140  //DiMuon
141  dimuon_Muon1_pt_cut_ = ps.getParameter<double>("dimuon_Muon1_pt_cut");
142  dimuon_Muon2_pt_cut_ = ps.getParameter<double>("dimuon_Muon2_pt_cut");
143  //DiElectron
144  dielectron_Electron1_pt_cut_ = ps.getParameter<double>("dielectron_Electron2_pt_cut");
145  dielectron_Electron2_pt_cut_ = ps.getParameter<double>("dielectron_Electron2_pt_cut");
146  //DiPhoton
147  diphoton_Photon1_pt_cut_ = ps.getParameter<double>("diphoton_Photon2_pt_cut");
148  diphoton_Photon2_pt_cut_ = ps.getParameter<double>("diphoton_Photon2_pt_cut");
149  //MonoJet
150  monojet_PFJet_pt_cut_ = ps.getParameter<double>("monojet_PFJet_pt_cut");
151  monojet_PFJet_met_cut_ = ps.getParameter<double>("monojet_PFJet_met_cut");
152  //MonoMuon
153  monomuon_Muon_pt_cut_ = ps.getParameter<double>("monomuon_Muon_pt_cut");
154  monomuon_Muon_met_cut_ = ps.getParameter<double>("monomuon_Muon_met_cut");
155  //MonoElectron
156  monoelectron_Electron_pt_cut_ = ps.getParameter<double>("monoelectron_Electron_pt_cut");
157  monoelectron_Electron_met_cut_ = ps.getParameter<double>("monoelectron_Electron_met_cut");
158  //MonoPhoton
159  monophoton_Photon_pt_cut_ = ps.getParameter<double>("monophoton_Photon_pt_cut");
160  monophoton_Photon_met_cut_ = ps.getParameter<double>("monophoton_Photon_met_cut");
161 
162 }
163 
164 
165 //
166 // -- Destructor
167 //
169  edm::LogInfo("ExoticaDQM") << " Deleting ExoticaDQM " << "\n" ;
170 }
171 
172 
173 //
174 // -- Book histograms
175 //
177  edm::EventSetup const&) {
178  bei.cd();
179 
180  //--- DiJet
181  for (unsigned int icoll = 0; icoll < DiJetPFJetCollection_.size(); ++icoll) {
182  std::stringstream ss;
183  ss << "Physics/Exotica/Dijets/" << DiJetPFJetCollection_[icoll].label();
184  bei.setCurrentFolder(ss.str().c_str());
185  //bei.setCurrentFolder("Physics/Exotica/Dijets");
186  dijet_PFJet_pt.push_back(bei.book1D("dijet_PFJet_pt", "Pt of PFJet (GeV)", 50, 30.0 , 5000));
187  dijet_PFJet_eta.push_back(bei.book1D("dijet_PFJet_eta", "#eta (PFJet)", 50, -2.5, 2.5));
188  dijet_PFJet_phi.push_back(bei.book1D("dijet_PFJet_phi", "#phi (PFJet)", 50, -3.14,3.14));
189  dijet_PFJet_rapidity.push_back(bei.book1D("dijet_PFJet_rapidity", "Rapidity (PFJet)", 50, -6.0,6.0));
190  dijet_PFJet_mass.push_back(bei.book1D("dijet_PFJet_mass", "Mass (PFJets)", 50, 0., 500.));
191  dijet_deltaPhiPFJet1PFJet2.push_back(bei.book1D("dijet_deltaPhiPFJet1PFJet2", "#Delta#phi(Leading PFJet, Sub PFJet)", 40, 0., 3.15));
192  dijet_deltaEtaPFJet1PFJet2.push_back(bei.book1D("dijet_deltaEtaPFJet1PFJet2", "#Delta#eta(Leading PFJet, Sub PFJet)", 40, -5., 5.));
193  dijet_deltaRPFJet1PFJet2.push_back(bei.book1D("dijet_deltaRPFJet1PFJet2", "#DeltaR(Leading PFJet, Sub PFJet)", 50, 0., 6.));
194  dijet_invMassPFJet1PFJet2.push_back(bei.book1D("dijet_invMassPFJet1PFJet2", "Leading PFJet, SubLeading PFJet Invariant mass (GeV)", 50, 0. , 8000.));
195  dijet_PFchef.push_back(bei.book1D("dijet_PFchef", "Leading PFJet CHEF", 50, 0.0 , 1.0));
196  dijet_PFnhef.push_back(bei.book1D("dijet_PFnhef", "Leading PFJet NHEF", 50, 0.0 , 1.0));
197  dijet_PFcemf.push_back(bei.book1D("dijet_PFcemf", "Leading PFJet CEMF", 50, 0.0 , 1.0));
198  dijet_PFnemf.push_back(bei.book1D("dijet_PFnemf", "Leading PFJEt NEMF", 50, 0.0 , 1.0));
199  dijet_PFJetMulti.push_back(bei.book1D("dijet_PFJetMulti", "No. of PFJets", 10, 0., 10.));
200  }
201  //--- DiMuon
202  bei.setCurrentFolder("Physics/Exotica/DiMuons");
203  dimuon_Muon_pt = bei.book1D("dimuon_Muon_pt", "Pt of Muon (GeV)", 50, 30.0 , 2000);
204  dimuon_Muon_eta = bei.book1D("dimuon_Muon_eta", "#eta (Muon)", 50, -2.5, 2.5);
205  dimuon_Muon_phi = bei.book1D("dimuon_Muon_phi", "#phi (Muon)", 50, -3.14,3.14);
206  dimuon_Charge = bei.book1D("dimuon_Charge", "Charge of the Muon", 10, -5., 5.);
207  dimuon_deltaEtaMuon1Muon2 = bei.book1D("dimuon_deltaEtaMuon1Muon2", "#Delta#eta(Leading Muon, Sub Muon)", 40, -5., 5.);
208  dimuon_deltaPhiMuon1Muon2 = bei.book1D("dimuon_deltaPhiMuon1Muon2", "#Delta#phi(Leading Muon, Sub Muon)", 40, 0., 3.15);
209  dimuon_deltaRMuon1Muon2 = bei.book1D("dimuon_deltaRMuon1Muon2", "#DeltaR(Leading Muon, Sub Muon)", 50, 0., 6.);
210  dimuon_invMassMuon1Muon2 = bei.book1D("dimuon_invMassMuon1Muon2", "Leading Muon, SubLeading Muon Low Invariant mass (GeV)", 50, 1000. , 4000.);
211  dimuon_MuonMulti = bei.book1D("dimuon_MuonMulti", "No. of Muons", 10, 0., 10.);
212  //--- DiElectrons
213  bei.setCurrentFolder("Physics/Exotica/DiElectrons");
214  dielectron_Electron_pt = bei.book1D("dielectron_Electron_pt", "Pt of Electron (GeV)", 50, 30.0 , 2000);
215  dielectron_Electron_eta = bei.book1D("dielectron_Electron_eta", "#eta (Electron)", 50, -2.5, 2.5);
216  dielectron_Electron_phi = bei.book1D("dielectron_Electron_phi", "#phi (Electron)", 50, -3.14,3.14);
217  dielectron_Charge = bei.book1D("dielectron_Charge", "Charge of the Electron", 10, -5., 5.);
218  dielectron_deltaEtaElectron1Electron2 = bei.book1D("dielectron_deltaEtaElectron1Electron2", "#Delta#eta(Leading Electron, Sub Electron)", 40, -5., 5.);
219  dielectron_deltaPhiElectron1Electron2 = bei.book1D("dielectron_deltaPhiElectron1Electron2", "#Delta#phi(Leading Electron, Sub Electron)", 40, 0., 3.15);
220  dielectron_deltaRElectron1Electron2 = bei.book1D("dielectron_deltaRElectron1Electron2", "#DeltaR(Leading Electron, Sub Electron)", 50, 0., 6.);
221  dielectron_invMassElectron1Electron2 = bei.book1D("dielectron_invMassElectron1Electron2", "Leading Electron, SubLeading Electron Invariant mass (GeV)", 50, 1000. , 4000.);
222  dielectron_ElectronMulti = bei.book1D("dielectron_ElectronMulti", "No. of Electrons", 10, 0., 10.);
223  //--- DiPhotons
224  bei.setCurrentFolder("Physics/Exotica/DiPhotons");
225  diphoton_Photon_energy = bei.book1D("diphoton_Photon_energy", "Energy of Photon (GeV)", 50, 30.0 , 300);
226  diphoton_Photon_et = bei.book1D("diphoton_Photon_et", "Et of Photon (GeV)", 50, 30.0 , 300);
227  diphoton_Photon_pt = bei.book1D("diphoton_Photon_pt", "Pt of Photon (GeV)", 50, 30.0 , 300);
228  diphoton_Photon_eta = bei.book1D("diphoton_Photon_eta", "#eta (Photon)", 50, -2.5, 2.5);
229  diphoton_Photon_etasc = bei.book1D("diphoton_Photon_etasc", "#eta sc(Photon)", 50, -2.5, 2.5);
230  diphoton_Photon_phi = bei.book1D("diphoton_Photon_phi", "#phi (Photon)", 50, -3.14,3.14);
231  diphoton_Photon_hovere_eb = bei.book1D("diphoton_Photon_hovere_eb", "H/E (Photon) EB", 50, 0., 0.50);
232  diphoton_Photon_hovere_ee = bei.book1D("diphoton_Photon_hovere_ee", "H/E (Photon) EE", 50, 0., 0.50);
233  diphoton_Photon_sigmaietaieta_eb = bei.book1D("diphoton_Photon_sigmaietaieta_eb", "#sigma_{i #eta i #eta} (Photon) EB", 50, 0., 0.03);
234  diphoton_Photon_sigmaietaieta_ee = bei.book1D("diphoton_Photon_sigmaietaieta_ee", "#sigma_{i #eta i #eta} (Photon) EE", 50, 0., 0.03);
235  diphoton_Photon_trksumptsolidconedr03_eb = bei.book1D("diphoton_Photon_trksumptsolidconedr03_eb", "TrkSumPtDr03 (Photon) EB", 50, 0., 15.);
236  diphoton_Photon_trksumptsolidconedr03_ee = bei.book1D("diphoton_Photon_trksumptsolidconedr03_ee", "TrkSumPtDr03 (Photon) EE", 50, 0., 15.);
237  diphoton_Photon_e1x5e5x5_eb = bei.book1D("diphoton_Photon_e1x5e5x5_eb", "E_{1x5}/E_{5x5} (Photon) EB", 50, 0., 1.);
238  diphoton_Photon_e1x5e5x5_ee = bei.book1D("diphoton_Photon_e1x5e5x5_ee", "E_{1x5}/E_{5x5} (Photon) EE", 50, 0., 1.);
239  diphoton_Photon_e2x5e5x5_eb = bei.book1D("diphoton_Photon_e2x5e5x5_eb", "E_{2x5}/E_{5x5} (Photon) EB", 50, 0., 1.);
240  diphoton_Photon_e2x5e5x5_ee = bei.book1D("diphoton_Photon_e2x5e5x5_ee", "E_{2x5}/E_{5x5} (Photon) EE", 50, 0., 1.);
241  diphoton_deltaEtaPhoton1Photon2 = bei.book1D("diphoton_deltaEtaPhoton1Photon2", "#Delta#eta(SubLeading Photon, Sub Photon)", 40, -5., 5.);
242  diphoton_deltaPhiPhoton1Photon2 = bei.book1D("diphoton_deltaPhiPhoton1Photon2", "#Delta#phi(SubLeading Photon, Sub Photon)", 40, 0., 3.15);
243  diphoton_deltaRPhoton1Photon2 = bei.book1D("diphoton_deltaRPhoton1Photon2", "#DeltaR(SubLeading Photon, Sub Photon)", 50, 0., 6.);
244  diphoton_invMassPhoton1Photon2 = bei.book1D("diphoton_invMassPhoton1Photon2", "SubLeading Photon, SubSubLeading Photon Invariant mass (GeV)", 50, 100. , 150.);
245  diphoton_PhotonMulti = bei.book1D("diphoton_PhotonMulti", "No. of Photons", 10, 0., 10.);
246  //--- MonoJet
247  bei.setCurrentFolder("Physics/Exotica/MonoJet");
248  monojet_PFJet_pt = bei.book1D("monojet_PFJet_pt", "Pt of MonoJet (GeV)", 50, 30.0 , 1000);
249  monojet_PFJet_eta = bei.book1D("monojet_PFJet_eta", "#eta(MonoJet)", 50, -2.5, 2.5);
250  monojet_PFJet_phi = bei.book1D("monojet_PFJet_phi", "#phi(MonoJet)", 50, -3.14,3.14);
251  monojet_PFMet = bei.book1D("monojet_PFMet", "Pt of PFMET (GeV)", 40, 0.0 , 1000);
252  monojet_PFMet_phi = bei.book1D("monojet_PFMet_phi", "#phi(PFMET #phi)", 50, -3.14,3.14);
253  monojet_PFJetPtOverPFMet = bei.book1D("monojet_PFJetPtOverPFMet", "Pt of MonoJet/MET (GeV)", 40, 0.0 , 5.);
254  monojet_deltaPhiPFJetPFMet = bei.book1D("monojet_deltaPhiPFJetPFMet", "#Delta#phi(MonoJet, PFMet)", 40, 0., 3.15);
255  monojet_PFchef = bei.book1D("monojet_PFchef", "MonojetJet CHEF", 50, 0.0 , 1.0);
256  monojet_PFnhef = bei.book1D("monojet_PFnhef", "MonojetJet NHEF", 50, 0.0 , 1.0);
257  monojet_PFcemf = bei.book1D("monojet_PFcemf", "MonojetJet CEMF", 50, 0.0 , 1.0);
258  monojet_PFnemf = bei.book1D("monojet_PFnemf", "MonojetJet NEMF", 50, 0.0 , 1.0);
259  monojet_PFJetMulti = bei.book1D("monojet_PFJetMulti", "No. of PFJets", 10, 0., 10.);
260  //--- MonoMuon
261  bei.setCurrentFolder("Physics/Exotica/MonoMuon");
262  monomuon_Muon_pt = bei.book1D("monomuon_Muon_pt", "Pt of Monomuon (GeV)", 50, 30.0 , 2000);
263  monomuon_Muon_eta = bei.book1D("monomuon_Muon_eta", "#eta(Monomuon)", 50, -2.5, 2.5);
264  monomuon_Muon_phi = bei.book1D("monomuon_Muon_phi", "#phi(Monomuon)", 50, -3.14,3.14);
265  monomuon_Charge = bei.book1D("monomuon_Charge", "Charge of the MonoMuon", 10, -5., 5.);
266  monomuon_PFMet = bei.book1D("monomuon_PFMet", "Pt of PFMET (GeV)", 40, 0.0 , 2000);
267  monomuon_PFMet_phi = bei.book1D("monomuon_PFMet_phi", "PFMET #phi", 50, -3.14,3.14);
268  monomuon_MuonPtOverPFMet = bei.book1D("monomuon_MuonPtOverPFMet", "Pt of Monomuon/PFMet", 40, 0.0 , 5.);
269  monomuon_deltaPhiMuonPFMet = bei.book1D("monomuon_deltaPhiMuonPFMet", "#Delta#phi(Monomuon, PFMet)", 40, 0., 3.15);
270  monomuon_TransverseMass = bei.book1D("monomuon_TransverseMass", "Transverse Mass M_{T} GeV", 40, 200., 3000.);
271  monomuon_MuonMulti = bei.book1D("monomuon_MuonMulti", "No. of Muons", 10, 0., 10.);
272  //--- MonoElectron
273  bei.setCurrentFolder("Physics/Exotica/MonoElectron");
274  monoelectron_Electron_pt = bei.book1D("monoelectron_Electron_pt", "Pt of Monoelectron (GeV)", 50, 30.0 , 4000);
275  monoelectron_Electron_eta = bei.book1D("monoelectron_Electron_eta", "#eta(MonoElectron)", 50, -2.5, 2.5);
276  monoelectron_Electron_phi = bei.book1D("monoelectron_Electron_phi", "#phi(MonoElectron)", 50, -3.14,3.14);
277  monoelectron_Charge = bei.book1D("monoelectron_Charge", "Charge of the MonoElectron", 10, -5., 5.);
278  monoelectron_PFMet = bei.book1D("monoelectron_PFMet", "Pt of PFMET (GeV)", 40, 0.0 , 4000);
279  monoelectron_PFMet_phi = bei.book1D("monoelectron_PFMet_phi", "PFMET #phi", 50, -3.14,3.14);
280  monoelectron_ElectronPtOverPFMet = bei.book1D("monoelectron_ElectronPtOverPFMet", "Pt of Monoelectron/PFMet", 40, 0.0 , 5.);
281  monoelectron_deltaPhiElectronPFMet = bei.book1D("monoelectron_deltaPhiElectronPFMet", "#Delta#phi(MonoElectron, PFMet)", 40, 0., 3.15);
282  monoelectron_TransverseMass = bei.book1D("monoelectron_TransverseMass", "Transverse Mass M_{T} GeV", 40, 200., 4000.);
283  monoelectron_ElectronMulti = bei.book1D("monoelectron_ElectronMulti", "No. of Electrons", 10, 0., 10.);
284 
285  //--- DiPhotons
286  bei.setCurrentFolder("Physics/Exotica/MonoPhotons");
287  monophoton_Photon_energy = bei.book1D("monophoton_Photon_energy", "Energy of Leading Photon (GeV)", 50, 30.0 , 1000);
288  monophoton_Photon_et = bei.book1D("monophoton_Photon_et", "Et of Leading Photon (GeV)", 50, 30.0 , 1000);
289  monophoton_Photon_pt = bei.book1D("monophoton_Photon_pt", "Pt of Leading Photon (GeV)", 50, 30.0 , 1000);
290  monophoton_Photon_eta = bei.book1D("monophoton_Photon_eta", "#eta (Leading Photon)", 50, -2.5, 2.5);
291  monophoton_Photon_etasc = bei.book1D("monophoton_Photon_etasc", "#eta sc(Leading Photon)", 50, -2.5, 2.5);
292  monophoton_Photon_phi = bei.book1D("monophoton_Photon_phi", "#phi(Leading Photon)", 50, -3.14,3.14);
293  monophoton_Photon_hovere = bei.book1D("monophoton_Photon_hovere", "H/E (Leading Photon)", 50, 0., 0.50);
294  monophoton_Photon_sigmaietaieta = bei.book1D("monophoton_Photon_sigmaietaieta", "#sigma_{i #eta i #eta} (Leading Photon)", 50, 0., 0.03);
295  monophoton_Photon_trksumptsolidconedr03 = bei.book1D("monophoton_Photon_trksumptsolidconedr03", "TrkSumPtDr03 (Leading Photon)", 50, 0., 15.);
296  monophoton_Photon_e1x5e5x5 = bei.book1D("monophoton_Photon_e1x5e5x5", "E_{1x5}/E_{5x5} (Leading Photon)", 50, 0., 1.);
297  monophoton_Photon_e2x5e5x5 = bei.book1D("monophoton_Photon_e2x5e5x5", "E_{2x5}/E_{5x5} (Leading Photon)", 50, 0., 1.);
298  monophoton_PFMet = bei.book1D("monophoton_PFMet", "Pt of PFMET (GeV)", 40, 0.0 , 1000);
299  monophoton_PFMet_phi = bei.book1D("monophoton_PFMet_phi", "PFMET #phi", 50, -3.14,3.14);
300  monophoton_PhotonPtOverPFMet = bei.book1D("monophoton_PhotonPtOverPFMet", "Pt of Monophoton/PFMet", 40, 0.0 , 5.);
301  monophoton_deltaPhiPhotonPFMet = bei.book1D("monophoton_deltaPhiPhotonPFMet", "#Delta#phi(SubLeading Photon, PFMet)", 40, 0., 3.15);
302  monophoton_PhotonMulti = bei.book1D("monophoton_PhotonMulti", "No. of Photons", 10, 0., 10.);
303 
304  bei.cd();
305 }
306 
307 
308 //
309 // -- Analyze
310 //
312 
313  // objects
314 
315  //Trigger
316  bool ValidTriggers = iEvent.getByToken(TriggerToken_, TriggerResults_);
317  if (!ValidTriggers) return;
318 
319  // Vertices
320  bool ValidVertices = iEvent.getByToken(VertexToken_, VertexCollection_);
321  if (!ValidVertices) return;
322 
323  // Electrons
324  bool ValidGedGsfElectron = iEvent.getByToken(ElectronToken_, ElectronCollection_);
325  if(!ValidGedGsfElectron) return;
326 
327  // Muons
328  bool ValidPFMuon = iEvent.getByToken(MuonToken_, MuonCollection_);
329  if(!ValidPFMuon) return;
330 
331  // Jets
332  bool ValidPFJet = iEvent.getByToken(PFJetToken_, pfJetCollection_);
333  if(!ValidPFJet) return;
334  pfjets = *pfJetCollection_;
335 
336  // MET
337  //bool ValidCaloMET = iEvent.getByToken(CaloMETToken_, caloMETCollection_);
338  //if(!ValidCaloMET) return;
339 
340  // PFMETs
341  bool ValidPFMET = iEvent.getByToken(PFMETToken_, pfMETCollection_);
342  if(!ValidPFMET) return;
343 
344  // Photons
345  bool ValidCaloPhoton = iEvent.getByToken(PhotonToken_, PhotonCollection_);
346  if(!ValidCaloPhoton) return;
347 
348  //Trigger
349 
350  int N_Triggers = TriggerResults_->size();
351  int N_GoodTriggerPaths = HltPaths_.size();
352  bool triggered_event = false;
353  const edm::TriggerNames& trigName = iEvent.triggerNames(*TriggerResults_);
354  for (int i_Trig = 0; i_Trig < N_Triggers; ++i_Trig) {
355  if (TriggerResults_.product()->accept(i_Trig)) {
356  for (int n = 0; n < N_GoodTriggerPaths; n++) {
357  if (trigName.triggerName(i_Trig).find(HltPaths_[n])!=std::string::npos){
358  //printf("Triggers fired? %i %s \n",i_Trig, trigName.triggerName(i_Trig).data());
359  triggered_event = true;
360  }
361  }
362  }
363  }
364  if (triggered_event == false) return;
365 
366  // if (triggered_event == false) {
367  // printf("NO TRIGGER!!!!! \n");
368  // for (int i_Trig = 0; i_Trig < N_Triggers; ++i_Trig) {
369  // if (TriggerResults_.product()->accept(i_Trig)) {
370  // printf("Triggers fired? %i %s \n",i_Trig, trigName.triggerName(i_Trig).data());
371  // }
372  // }
373  // }
374 
375  for(int i=0; i<2; i++){
376  //Jets
377  PFJetPx[i] = 0.; PFJetPy[i] = 0.; PFJetPt[i] = 0.; PFJetEta[i] = 0.; PFJetPhi[i] = 0.;
378  PFJetNHEF[i] = 0.; PFJetCHEF[i] = 0.; PFJetNEMF[i] = 0.; PFJetCEMF[i] = 0.;
379  //Muons
380  MuonPx[i] = 0.; MuonPy[i] = 0.; MuonPt[i] = 0.;
381  MuonEta[i] = 0.; MuonPhi[i] = 0.; MuonCharge[i] = 0.;
382  //Electrons
383  ElectronPx[i] = 0.; ElectronPy[i] = 0.; ElectronPt[i] = 0.;
384  ElectronEta[i] = 0.; ElectronPhi[i] = 0.; ElectronCharge[i] = 0.;
385  //Photons
386  PhotonEnergy[i] = 0.; PhotonPt[i] = 0.; PhotonEt[i] = 0.; PhotonEta[i] = 0.; PhotonEtaSc[i] = 0.; PhotonPhi[i] = 0.; PhotonHoverE[i] = 0.;
387  PhotonSigmaIetaIeta[i] = 0.; PhotonTrkSumPtSolidConeDR03[i] = 0.; PhotonE1x5E5x5[i] = 0.; PhotonE2x5E5x5[i] = 0.;
388  }
389 
390  //Getting information from the RecoObjects
391  dijet_countPFJet_=0;
392  monojet_countPFJet_=0;
393  edm::Handle<reco::JetCorrector> jetCorrector;
394  iEvent.getByToken( correctorToken_, jetCorrector );
395 
396  PFJetCollection::const_iterator pfjet_ = pfjets.begin();
397  for(; pfjet_ != pfjets.end(); ++pfjet_){
398  double scale = jetCorrector->correction(*pfjet_);
399  if(scale*pfjet_->pt()>PFJetPt[0]){
400  PFJetPt[1] = PFJetPt[0];
401  PFJetPx[1] = PFJetPx[0];
402  PFJetPy[1] = PFJetPy[0];
403  PFJetEta[1] = PFJetEta[0];
404  PFJetPhi[1] = PFJetPhi[0];
405  PFJetRapidity[1] = PFJetRapidity[0];
406  PFJetMass[1] = PFJetMass[0];
407  PFJetNHEF[1] = PFJetNHEF[0];
408  PFJetCHEF[1] = PFJetCHEF[0];
409  PFJetNEMF[1] = PFJetNEMF[0];
410  PFJetCEMF[1] = PFJetCEMF[0];
411  //
412  PFJetPt[0] = scale*pfjet_->pt();
413  PFJetPx[0] = scale*pfjet_->px();
414  PFJetPy[0] = scale*pfjet_->py();
415  PFJetEta[0] = pfjet_->eta();
416  PFJetPhi[0] = pfjet_->phi();
417  PFJetRapidity[0] = pfjet_->rapidity();
418  PFJetMass[0] = pfjet_->mass();
419  PFJetNHEF[0] = pfjet_->neutralHadronEnergyFraction();
420  PFJetCHEF[0] = pfjet_->chargedHadronEnergyFraction();
421  PFJetNEMF[0] = pfjet_->neutralEmEnergyFraction();
422  PFJetCEMF[0] = pfjet_->chargedEmEnergyFraction();
423  }
424  else if(scale*pfjet_->pt()<PFJetPt[0] && scale*pfjet_->pt()>PFJetPt[1] ){
425  PFJetPt[1] = scale*pfjet_->pt();
426  PFJetPx[1] = scale*pfjet_->px();
427  PFJetPy[1] = scale*pfjet_->py();
428  PFJetEta[1] = pfjet_->eta();
429  PFJetPhi[1] = pfjet_->phi();
430  PFJetRapidity[1] = pfjet_->rapidity();
431  PFJetMass[1] = pfjet_->mass();
432  PFJetNHEF[1] = pfjet_->neutralHadronEnergyFraction();
433  PFJetCHEF[1] = pfjet_->chargedHadronEnergyFraction();
434  PFJetNEMF[1] = pfjet_->neutralEmEnergyFraction();
435  PFJetCEMF[1] = pfjet_->chargedEmEnergyFraction();
436  }
437  else{}
438  if(scale*pfjet_->pt()>dijet_PFJet1_pt_cut_) dijet_countPFJet_++;
439  if(scale*pfjet_->pt()>dijet_PFJet1_pt_cut_) monojet_countPFJet_++;
440  }
441 
442  VertexCollection vertexCollection = *(VertexCollection_.product());
443  reco::VertexCollection::const_iterator primaryVertex_ = vertexCollection.begin();
444 
445  dimuon_countMuon_ = 0;
446  monomuon_countMuon_ = 0;
447  reco::MuonCollection::const_iterator muon_ = MuonCollection_->begin();
448  for(; muon_ != MuonCollection_->end(); muon_++){
449  // Muon High Pt ID
450  bool HighPt = false;
451  if (muon_->isGlobalMuon() && muon_->globalTrack()->hitPattern().numberOfValidMuonHits() >0 && muon_->numberOfMatchedStations() > 1 &&
452  muon_->innerTrack()->hitPattern().trackerLayersWithMeasurement() > 5 && muon_->innerTrack()->hitPattern().numberOfValidPixelHits() > 0 &&
453  muon_->muonBestTrack()->ptError()/muon_->muonBestTrack()->pt() < 0.3 &&
454  fabs(muon_->muonBestTrack()->dxy(primaryVertex_->position())) < 0.2 && fabs(muon_->bestTrack()->dz(primaryVertex_->position())) < 0.5
455  && fabs(muon_->eta()) <2.1) HighPt = true;
456 
457  if (HighPt == true ){
458  if(muon_->pt()>MuonPt[0]){
459  MuonPt[1] = MuonPt[0];
460  MuonPx[1] = MuonPx[0];
461  MuonPy[1] = MuonPy[0];
462  MuonEta[1] = MuonEta[0];
463  MuonPhi[1] = MuonPhi[0];
464  MuonCharge[1] = MuonCharge[0];
465  //
466  MuonPt[0] = muon_->pt();
467  MuonPx[0] = muon_->px();
468  MuonPy[0] = muon_->py();
469  MuonEta[0] = muon_->eta();
470  MuonPhi[0] = muon_->phi();
471  MuonCharge[0] = muon_->charge();
472  }
473  }
474  if (muon_->pt() > dimuon_Muon1_pt_cut_) dimuon_countMuon_++;
475  if (muon_->pt() > dimuon_Muon1_pt_cut_) monomuon_countMuon_++;
476  }
477 
478  dielectron_countElectron_ = 0;
479  monoelectron_countElectron_ = 0;
480  reco::GsfElectronCollection::const_iterator electron_ = ElectronCollection_->begin();
481  for(; electron_ != ElectronCollection_->end(); electron_++){
482  //HEEP Selection 4.1 (some cuts)
483  if (electron_->e5x5()<=0) continue;
484  if (electron_->gsfTrack().isNull()) continue;
485  bool HEPP_ele = false;
486  double sceta = electron_->caloPosition().eta();
487  double dEtaIn = fabs(electron_->deltaEtaSuperClusterTrackAtVtx());
488  double dPhiIn = fabs(electron_->deltaPhiSuperClusterTrackAtVtx());
489  double HoverE = electron_->hadronicOverEm();
490  // double depth1Iso = electron_->dr03EcalRecHitSumEt()+electron_->dr03HcalDepth1TowerSumEt();
491  // double hoDensity = (*rhoHandle);
492  int missingHits = electron_->gsfTrack()->hitPattern().numberOfLostTrackerHits(HitPattern::MISSING_INNER_HITS);
493  double dxy = electron_->gsfTrack()->dxy(primaryVertex_->position());
494  double tkIso = electron_->dr03TkSumPt();
495  double e2x5Fraction = electron_->e2x5Max()/electron_->e5x5();
496  double e1x5Fraction = electron_->e1x5()/electron_->e5x5();
497  double scSigmaIetaIeta = electron_->scSigmaIEtaIEta();
498  if (electron_->ecalDriven() && electron_->pt()>35.) {
499  if (fabs(sceta)<1.442) { // barrel
500  if (fabs(dEtaIn)<0.005 && fabs(dPhiIn)<0.06 && HoverE<0.05 && tkIso<5. && missingHits<=1 && fabs(dxy)<0.02
501  && (e2x5Fraction>0.94 || e1x5Fraction>0.83)) HEPP_ele =true;
502  }else if (fabs(sceta)>1.56 && fabs(sceta)<2.5) { // endcap
503  if (fabs(dEtaIn)<0.007 && fabs(dPhiIn)<0.06 && HoverE<0.05 && tkIso<5. && missingHits<=1 && fabs(dxy)<0.02
504  && scSigmaIetaIeta<0.03) HEPP_ele =true;
505  }
506  }
507  //
508  if (HEPP_ele == false) continue;
509  if(electron_->pt()>ElectronPt[0] ){
510  ElectronPt[1] = ElectronPt[0];
511  ElectronPx[1] = ElectronPx[0];
512  ElectronPy[1] = ElectronPy[0];
513  ElectronEta[1] = ElectronEta[0];
514  ElectronPhi[1] = ElectronPhi[0];
515  ElectronCharge[1] = ElectronCharge[0];
516  //
517  ElectronPt[0] = electron_->pt();
518  ElectronPx[0] = electron_->px();
519  ElectronPy[0] = electron_->py();
520  ElectronEta[0] = electron_->eta();
521  ElectronPhi[0] = electron_->phi();
522  ElectronCharge[0] = electron_->charge();
523  }
524  if (electron_->pt() > dielectron_Electron1_pt_cut_) dielectron_countElectron_++;
525  if (electron_->pt() > dielectron_Electron1_pt_cut_) monoelectron_countElectron_++;
526  }
527 
528 
529  diphoton_countPhoton_ = 0.;
530  reco::PhotonCollection::const_iterator photon_ = PhotonCollection_->begin();
531  for(; photon_ != PhotonCollection_->end(); ++photon_){
532  if(photon_->pt()>PhotonPt[0] ){
533  PhotonEnergy[1] = PhotonEnergy[0];
534  PhotonPt[1] = PhotonPt[0];
535  PhotonEt[1] = PhotonEt[0];
536  PhotonEta[1] = PhotonEta[0];
537  PhotonEtaSc[1] = PhotonEtaSc[0];
538  PhotonPhi[1] = PhotonPhi[0];
539  PhotonHoverE[1] = PhotonHoverE[0];
540  PhotonSigmaIetaIeta[1] = PhotonSigmaIetaIeta[0];
541  PhotonTrkSumPtSolidConeDR03[1] = PhotonTrkSumPtSolidConeDR03[0];
542  PhotonE1x5E5x5[1] = PhotonE1x5E5x5[0];
543  PhotonE2x5E5x5[1] = PhotonE2x5E5x5[0];
544 
545  PhotonEnergy[0] = photon_->energy();
546  PhotonPt[0] = photon_->pt();
547  PhotonEt[0] = photon_->et();
548  PhotonEta[0] = photon_->eta();
549  PhotonEtaSc[0] = photon_->caloPosition().eta();
550  PhotonPhi[0] = photon_->phi();
551  PhotonHoverE[0] = photon_->hadronicOverEm();
552  PhotonSigmaIetaIeta[0] = photon_->sigmaIetaIeta();
553  PhotonTrkSumPtSolidConeDR03[0] = photon_->trkSumPtSolidConeDR03();
554  PhotonE1x5E5x5[0] = photon_->e1x5()/photon_->e5x5();
555  PhotonE2x5E5x5[0] = photon_->e2x5()/photon_->e5x5();
556 
557  if (photon_->pt() > dielectron_Electron1_pt_cut_) diphoton_countPhoton_ ++;
558  }
559  }
560  //#######################################################
561  // Analyze
562  //
563 
564  //Resonances
565  analyzeDiJets(iEvent);
566  analyzeDiMuons(iEvent);
567  analyzeDiElectrons(iEvent);
568  analyzeDiPhotons(iEvent);
569 
570  //MonoSearches
571  analyzeMonoJets(iEvent);
572  analyzeMonoMuons(iEvent);
573  analyzeMonoElectrons(iEvent);
574 
575  //
576  //analyzeMultiJetsTrigger(iEvent);
577  //analyzeLongLivedTrigger(iEvent);
578 
579 }
581  for (unsigned int icoll = 0; icoll < DiJetPFJetCollection_.size(); ++icoll) {
582  dijet_countPFJet_=0;
583  bool ValidDiJetPFJets = iEvent.getByToken(DiJetPFJetToken_[icoll], DiJetpfJetCollection_);
584  if (!ValidDiJetPFJets) continue;
585  DiJetpfjets = *DiJetpfJetCollection_;
586  for(int i=0; i<2; i++){
587  PFJetPx[i] = 0.; PFJetPy[i] = 0.; PFJetPt[i] = 0.; PFJetEta[i] = 0.; PFJetPhi[i] = 0.;
588  PFJetNHEF[i] = 0.; PFJetCHEF[i] = 0.; PFJetNEMF[i] = 0.; PFJetCEMF[i] = 0.;
589  }
590  //const JetCorrector* pfcorrector = JetCorrector::getJetCorrector(PFJetCorService_,iSetup);
591  PFJetCollection::const_iterator DiJetpfjet_ = DiJetpfjets.begin();
592  for(; DiJetpfjet_ != DiJetpfjets.end(); ++DiJetpfjet_){
593  //double scale = pfcorrector->correction(*pfjet_,iEvent, iSetup);
594  //if (icoll == 0.) continue; // info already saved
595  double scale = 1.;
596  if(scale*DiJetpfjet_->pt()>PFJetPt[0]){
597  PFJetPt[1] = PFJetPt[0];
598  PFJetPx[1] = PFJetPx[0];
599  PFJetPy[1] = PFJetPy[0];
600  PFJetEta[1] = PFJetEta[0];
601  PFJetPhi[1] = PFJetPhi[0];
602  PFJetRapidity[1] = DiJetpfjet_->rapidity();
603  PFJetMass[1] = DiJetpfjet_->mass();
604  PFJetNHEF[1] = PFJetNHEF[0];
605  PFJetCHEF[1] = PFJetCHEF[0];
606  PFJetNEMF[1] = PFJetNEMF[0];
607  PFJetCEMF[1] = PFJetCEMF[0];
608  //
609  PFJetPt[0] = scale*DiJetpfjet_->pt();
610  PFJetPx[0] = scale*DiJetpfjet_->px();
611  PFJetPy[0] = scale*DiJetpfjet_->py();
612  PFJetEta[0] = DiJetpfjet_->eta();
613  PFJetPhi[0] = DiJetpfjet_->phi();
614  PFJetRapidity[0] = DiJetpfjet_->rapidity();
615  PFJetMass[0] = DiJetpfjet_->mass();
616  PFJetNHEF[0] = DiJetpfjet_->neutralHadronEnergyFraction();
617  PFJetCHEF[0] = DiJetpfjet_->chargedHadronEnergyFraction();
618  PFJetNEMF[0] = DiJetpfjet_->neutralEmEnergyFraction();
619  PFJetCEMF[0] = DiJetpfjet_->chargedEmEnergyFraction();
620  }else if(scale*DiJetpfjet_->pt()<PFJetPt[0] && scale*DiJetpfjet_->pt()>PFJetPt[1] ){
621  PFJetPt[1] = scale*DiJetpfjet_->pt();
622  PFJetPx[1] = scale*DiJetpfjet_->px();
623  PFJetPy[1] = scale*DiJetpfjet_->py();
624  PFJetEta[1] = DiJetpfjet_->eta();
625  PFJetPhi[1] = DiJetpfjet_->phi();
626  PFJetRapidity[1] = DiJetpfjet_->rapidity();
627  PFJetMass[1] = DiJetpfjet_->mass();
628  PFJetNHEF[1] = DiJetpfjet_->neutralHadronEnergyFraction();
629  PFJetCHEF[1] = DiJetpfjet_->chargedHadronEnergyFraction();
630  PFJetNEMF[1] = DiJetpfjet_->neutralEmEnergyFraction();
631  PFJetCEMF[1] = DiJetpfjet_->chargedEmEnergyFraction();
632  }else{}
633  if(scale*DiJetpfjet_->pt()>dijet_PFJet1_pt_cut_) dijet_countPFJet_++;
634  }
635  if(PFJetPt[0]> dijet_PFJet1_pt_cut_ && PFJetPt[1]> dijet_PFJet2_pt_cut_){
636  dijet_PFJet_pt[icoll]->Fill(PFJetPt[0]);
637  dijet_PFJet_eta[icoll]->Fill(PFJetEta[0]);
638  dijet_PFJet_phi[icoll]->Fill(PFJetPhi[0]);
639  dijet_PFJet_rapidity[icoll]->Fill(PFJetRapidity[0]);
640  dijet_PFJet_mass[icoll]->Fill(PFJetMass[0]);
641  dijet_PFJet_pt[icoll]->Fill(PFJetPt[1]);
642  dijet_PFJet_eta[icoll]->Fill(PFJetEta[1]);
643  dijet_PFJet_phi[icoll]->Fill(PFJetPhi[1]);
644  dijet_PFJet_rapidity[icoll]->Fill(PFJetRapidity[1]);
645  dijet_PFJet_mass[icoll]->Fill(PFJetMass[1]);
646  dijet_deltaPhiPFJet1PFJet2[icoll]->Fill(deltaPhi(PFJetPhi[0],PFJetPhi[1]));
647  dijet_deltaEtaPFJet1PFJet2[icoll]->Fill(PFJetEta[0]-PFJetEta[1]);
648  dijet_deltaRPFJet1PFJet2[icoll]->Fill(deltaR(PFJetEta[0],PFJetPhi[0],PFJetEta[1],PFJetPhi[1]));
649  dijet_invMassPFJet1PFJet2[icoll]->Fill(sqrt(2*PFJetPt[0]*PFJetPt[1]*(cosh(PFJetEta[0]-PFJetEta[1])-cos(PFJetPhi[0]-PFJetPhi[1]))));
650  dijet_PFchef[icoll]->Fill(PFJetCHEF[0]);
651  dijet_PFnhef[icoll]->Fill(PFJetNHEF[0]);
652  dijet_PFcemf[icoll]->Fill(PFJetCEMF[0]);
653  dijet_PFnemf[icoll]->Fill(PFJetNEMF[0]);
654  dijet_PFJetMulti[icoll]->Fill(dijet_countPFJet_);
655  }
656  }
657 }
659  if(MuonPt[0] > dimuon_Muon1_pt_cut_ && MuonPt[1]> dimuon_Muon2_pt_cut_ && MuonCharge[0]*MuonCharge[1] == -1){
660  dimuon_Muon_pt->Fill(MuonPt[0]);
661  dimuon_Muon_eta->Fill(MuonEta[0]);
662  dimuon_Muon_phi->Fill(MuonPhi[0]);
663  dimuon_Muon_pt->Fill(MuonPt[1]);
664  dimuon_Muon_eta->Fill(MuonEta[1]);
665  dimuon_Muon_phi->Fill(MuonPhi[1]);
666  dimuon_Charge->Fill(MuonCharge[0]);
667  dimuon_Charge->Fill(MuonCharge[1]);
668  dimuon_deltaPhiMuon1Muon2->Fill(deltaPhi(MuonPhi[0],MuonPhi[1]));
669  dimuon_deltaEtaMuon1Muon2->Fill(MuonEta[0]-MuonEta[1]);
670  dimuon_deltaRMuon1Muon2->Fill(deltaR(MuonEta[0],MuonPhi[0],MuonEta[1],MuonPhi[1]));
671  dimuon_invMassMuon1Muon2->Fill(sqrt(2*MuonPt[0]*MuonPt[1]*(cosh(MuonEta[0]-MuonEta[1])-cos(MuonPhi[0]-MuonPhi[1]))));
672  dimuon_MuonMulti->Fill(dimuon_countMuon_);
673  }
674 }
676  if(ElectronPt[0] > dielectron_Electron1_pt_cut_ && ElectronPt[1]> dielectron_Electron2_pt_cut_ && ElectronCharge[0]*ElectronCharge[1] == -1.){
677  dielectron_Electron_pt->Fill(ElectronPt[0]);
678  dielectron_Electron_eta->Fill(ElectronEta[0]);
679  dielectron_Electron_phi->Fill(ElectronPhi[0]);
680  dielectron_Electron_pt->Fill(ElectronPt[1]);
681  dielectron_Electron_eta->Fill(ElectronEta[1]);
682  dielectron_Electron_phi->Fill(ElectronPhi[1]);
683  dielectron_Charge->Fill(ElectronCharge[0]);
684  dielectron_Charge->Fill(ElectronCharge[1]);
685  dielectron_deltaPhiElectron1Electron2->Fill(deltaPhi(ElectronPhi[0],ElectronPhi[1]));
686  dielectron_deltaEtaElectron1Electron2->Fill(ElectronEta[0]-ElectronEta[1]);
687  dielectron_deltaRElectron1Electron2->Fill(deltaR(ElectronEta[0],ElectronPhi[0],ElectronEta[1],ElectronPhi[1]));
688  dielectron_invMassElectron1Electron2->Fill(sqrt(2*ElectronPt[0]*ElectronPt[1]*(cosh(ElectronEta[0]-ElectronEta[1])-cos(ElectronPhi[0]-ElectronPhi[1]))));
689  dielectron_ElectronMulti->Fill(dielectron_countElectron_);
690  }
691 }
693  if(PhotonPt[0] > diphoton_Photon1_pt_cut_ && PhotonPt[1]> diphoton_Photon2_pt_cut_ ){
694  diphoton_Photon_energy->Fill(PhotonEnergy[0]);
695  diphoton_Photon_pt->Fill(PhotonPt[0]);
696  diphoton_Photon_et->Fill(PhotonEt[0]);
697  diphoton_Photon_eta->Fill(PhotonEta[0]);
698  diphoton_Photon_etasc->Fill(PhotonEtaSc[0]);
699  diphoton_Photon_phi->Fill(PhotonPhi[0]);
700  if (fabs(PhotonEtaSc[0]) < 1.442){
701  diphoton_Photon_hovere_eb->Fill(PhotonHoverE[0]);
702  diphoton_Photon_sigmaietaieta_eb->Fill(PhotonSigmaIetaIeta[0]);
703  diphoton_Photon_trksumptsolidconedr03_eb->Fill(PhotonTrkSumPtSolidConeDR03[0]);
704  diphoton_Photon_e1x5e5x5_eb->Fill(PhotonE1x5E5x5[0]);
705  diphoton_Photon_e2x5e5x5_eb->Fill(PhotonE2x5E5x5[0]);
706  }
707  if (fabs(PhotonEtaSc[0]) > 1.566 && fabs(PhotonEtaSc[0]) < 2.5){
708  diphoton_Photon_hovere_ee->Fill(PhotonHoverE[0]);
709  diphoton_Photon_sigmaietaieta_ee->Fill(PhotonSigmaIetaIeta[0]);
710  diphoton_Photon_trksumptsolidconedr03_ee->Fill(PhotonTrkSumPtSolidConeDR03[0]);
711  diphoton_Photon_e1x5e5x5_ee->Fill(PhotonE1x5E5x5[0]);
712  diphoton_Photon_e2x5e5x5_ee->Fill(PhotonE2x5E5x5[0]);
713  }
714  diphoton_Photon_energy->Fill(PhotonEnergy[1]);
715  diphoton_Photon_pt->Fill(PhotonPt[1]);
716  diphoton_Photon_et->Fill(PhotonEt[1]);
717  diphoton_Photon_eta->Fill(PhotonEta[1]);
718  diphoton_Photon_etasc->Fill(PhotonEtaSc[1]);
719  diphoton_Photon_phi->Fill(PhotonPhi[1]);
720  if (fabs(PhotonEtaSc[1]) < 1.4442){
721  diphoton_Photon_hovere_eb->Fill(PhotonHoverE[1]);
722  diphoton_Photon_sigmaietaieta_eb->Fill(PhotonSigmaIetaIeta[1]);
723  diphoton_Photon_trksumptsolidconedr03_eb->Fill(PhotonTrkSumPtSolidConeDR03[1]);
724  diphoton_Photon_e1x5e5x5_eb->Fill(PhotonE1x5E5x5[1]);
725  diphoton_Photon_e2x5e5x5_eb->Fill(PhotonE2x5E5x5[1]);
726  }
727  if (fabs(PhotonEtaSc[1]) > 1.566 && fabs(PhotonEtaSc[1]) < 2.5){
728  diphoton_Photon_hovere_ee->Fill(PhotonHoverE[1]);
729  diphoton_Photon_sigmaietaieta_ee->Fill(PhotonSigmaIetaIeta[1]);
730  diphoton_Photon_trksumptsolidconedr03_ee->Fill(PhotonTrkSumPtSolidConeDR03[1]);
731  diphoton_Photon_e1x5e5x5_ee->Fill(PhotonE1x5E5x5[1]);
732  diphoton_Photon_e2x5e5x5_ee->Fill(PhotonE2x5E5x5[1]);
733  }
734  diphoton_deltaPhiPhoton1Photon2->Fill(deltaPhi(PhotonPhi[0],PhotonPhi[1]));
735  diphoton_deltaEtaPhoton1Photon2->Fill(PhotonEta[0]-PhotonEta[1]);
736  diphoton_deltaRPhoton1Photon2->Fill(deltaR(PhotonEta[0],PhotonPhi[0],PhotonEta[1],PhotonPhi[1]));
737  diphoton_invMassPhoton1Photon2->Fill(sqrt(2*PhotonPt[0]*PhotonPt[1]*(cosh(PhotonEta[0]-PhotonEta[1])-cos(PhotonPhi[0]-PhotonPhi[1]))));
738  diphoton_PhotonMulti->Fill(diphoton_countPhoton_);
739  }
740 }
742  const PFMETCollection *pfmetcol = pfMETCollection_.product();
743  const PFMET pfmet = pfmetcol->front();
744  if(PFJetPt[0]> monojet_PFJet_pt_cut_ && pfmet.et() > monojet_PFJet_met_cut_){
745  monojet_PFJet_pt->Fill(PFJetPt[0]);
746  monojet_PFJet_eta->Fill(PFJetEta[0]);
747  monojet_PFJet_phi->Fill(PFJetPhi[0]);
748  monojet_PFMet->Fill(pfmet.et());
749  monojet_PFMet_phi->Fill(pfmet.phi());
750  monojet_PFJetPtOverPFMet->Fill(PFJetPt[0]/pfmet.et());
751  monojet_deltaPhiPFJetPFMet->Fill(deltaPhi(PFJetPhi[0],pfmet.phi()));
752  monojet_PFchef->Fill(PFJetCHEF[0]);
753  monojet_PFnhef->Fill(PFJetNHEF[0]);
754  monojet_PFcemf->Fill(PFJetCEMF[0]);
755  monojet_PFnemf->Fill(PFJetNEMF[0]);
756  monojet_PFJetMulti->Fill(monojet_countPFJet_);
757  }
758 }
760  const PFMETCollection *pfmetcol = pfMETCollection_.product();
761  const PFMET pfmet = pfmetcol->front();
762  if(MuonPt[0]> monomuon_Muon_pt_cut_ && pfmet.et() > monomuon_Muon_met_cut_){
763  monomuon_Muon_pt->Fill(MuonPt[0]);
764  monomuon_Muon_eta->Fill(MuonEta[0]);
765  monomuon_Muon_phi->Fill(MuonPhi[0]);
766  monomuon_Charge->Fill(MuonCharge[0]);
767  monomuon_PFMet->Fill(pfmet.et());
768  monomuon_PFMet_phi->Fill(pfmet.phi());
769  monomuon_MuonPtOverPFMet->Fill(MuonPt[0]/pfmet.et());
770  monomuon_deltaPhiMuonPFMet->Fill(deltaPhi(MuonPhi[0],pfmet.phi()));
771  monomuon_TransverseMass->Fill(sqrt(2*MuonPt[0]*pfmet.et()*(1-cos(deltaPhi(MuonPhi[0],pfmet.phi())))));
772  monomuon_MuonMulti->Fill(monomuon_countMuon_);
773  }
774 }
776  const PFMETCollection *pfmetcol = pfMETCollection_.product();
777  const PFMET pfmet = pfmetcol->front();
778  if(ElectronPt[0]> monoelectron_Electron_pt_cut_ && pfmet.et() > monoelectron_Electron_met_cut_){
779  monoelectron_Electron_pt->Fill(ElectronPt[0]);
780  monoelectron_Electron_eta->Fill(ElectronEta[0]);
781  monoelectron_Electron_phi->Fill(ElectronPhi[0]);
782  monoelectron_Charge->Fill(ElectronCharge[0]);
783  monoelectron_PFMet->Fill(pfmet.et());
784  monoelectron_PFMet_phi->Fill(pfmet.phi());
785  monoelectron_ElectronPtOverPFMet->Fill(ElectronPt[0]/pfmet.et());
786  monoelectron_deltaPhiElectronPFMet->Fill(deltaPhi(ElectronPhi[0],pfmet.phi()));
787  monoelectron_TransverseMass->Fill(sqrt(2*ElectronPt[0]*pfmet.et()*(1-cos(deltaPhi(ElectronPhi[0],pfmet.phi())))));
788  monoelectron_ElectronMulti->Fill(monoelectron_countElectron_);
789  }
790 }
792  const PFMETCollection *pfmetcol = pfMETCollection_.product();
793  const PFMET pfmet = pfmetcol->front();
794  if(PhotonPt[0]> monophoton_Photon_pt_cut_ && pfmet.et() > monophoton_Photon_met_cut_){
795  monophoton_Photon_energy->Fill(PhotonEnergy[0]);
796  monophoton_Photon_pt->Fill(PhotonPt[0]);
797  monophoton_Photon_et->Fill(PhotonEt[0]);
798  monophoton_Photon_eta->Fill(PhotonEta[0]);
799  monophoton_Photon_etasc->Fill(PhotonEtaSc[0]);
800  monophoton_Photon_phi->Fill(PhotonPhi[0]);
801  monophoton_Photon_hovere->Fill(PhotonHoverE[0]);
802  monophoton_Photon_sigmaietaieta->Fill(PhotonSigmaIetaIeta[0]);
803  monophoton_Photon_trksumptsolidconedr03->Fill(PhotonTrkSumPtSolidConeDR03[0]);
804  monophoton_Photon_e1x5e5x5->Fill(PhotonE1x5E5x5[0]);
805  monophoton_Photon_e2x5e5x5->Fill(PhotonE2x5E5x5[0]);
806  monophoton_PFMet->Fill(pfmet.et());
807  monophoton_PFMet_phi->Fill(pfmet.phi());
808  monophoton_PhotonPtOverPFMet->Fill(PhotonPt[0]/pfmet.et());
809  monophoton_deltaPhiPhotonPFMet->Fill(deltaPhi(PhotonPhi[0],pfmet.phi()));
810  monophoton_PhotonMulti->Fill(monophoton_countPhoton_);
811  }
812 }
813 
814 
virtual void analyzeMonoElectrons(edm::Event const &e)
Definition: ExoticaDQM.cc:775
virtual void analyzeDiJets(edm::Event const &e)
Definition: ExoticaDQM.cc:580
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
Definition: Event.cc:215
virtual void analyzeMonoMuons(edm::Event const &e)
Definition: ExoticaDQM.cc:759
ExoticaDQM(const edm::ParameterSet &ps)
Definition: ExoticaDQM.cc:92
virtual void analyzeMonoJets(edm::Event const &e)
Definition: ExoticaDQM.cc:741
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
void cd(void)
Definition: DQMStore.cc:268
virtual void analyzeDiMuons(edm::Event const &e)
Definition: ExoticaDQM.cc:658
virtual double phi() const final
momentum azimuthal angle
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
void bookHistograms(DQMStore::IBooker &bei, edm::Run const &, edm::EventSetup const &) override
Definition: ExoticaDQM.cc:176
tuple vertexCollection
int iEvent
Definition: GenABIO.cc:230
T sqrt(T t)
Definition: SSEVec.h:18
virtual void analyzeDiPhotons(edm::Event const &e)
Definition: ExoticaDQM.cc:692
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
virtual void analyzeMonoPhotons(edm::Event const &e)
Definition: ExoticaDQM.cc:791
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
virtual void analyze(edm::Event const &e, edm::EventSetup const &eSetup)
Definition: ExoticaDQM.cc:311
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:276
virtual ~ExoticaDQM()
Definition: ExoticaDQM.cc:168
std::string const & triggerName(unsigned int index) const
Definition: TriggerNames.cc:27
virtual double et() const final
transverse energy
virtual void analyzeDiElectrons(edm::Event const &e)
Definition: ExoticaDQM.cc:675
std::vector< std::string > vstring
Definition: Schedule.cc:358
Definition: Run.h:43
Collection of PF MET.
int icoll
Definition: AMPTWrapper.h:136