CMS 3D CMS Logo

TopMonitor.cc
Go to the documentation of this file.
11 
12 
13 // -----------------------------
14 // constructors and destructor
15 // -----------------------------
16 
18  folderName_ ( iConfig.getParameter<std::string>("FolderName") )
19  , metToken_ ( consumes<reco::PFMETCollection> (iConfig.getParameter<edm::InputTag>("met") ) )
20  , jetToken_ ( mayConsume<reco::PFJetCollection> (iConfig.getParameter<edm::InputTag>("jets") ) )
21  , eleToken_ ( mayConsume<edm::View<reco::GsfElectron> >(iConfig.getParameter<edm::InputTag>("electrons") ) )
22  , muoToken_ ( mayConsume<reco::MuonCollection> (iConfig.getParameter<edm::InputTag>("muons") ) )
23  // Marina
24  , jetTagToken_ ( mayConsume<reco::JetTagCollection> (iConfig.getParameter<edm::InputTag>("btagalgo") ))
25  //Suvankar
26  , vtxToken_ ( mayConsume<reco::VertexCollection> (iConfig.getParameter<edm::InputTag>("vertices") ) )
27  , met_binning_ ( getHistoPSet (iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet> ("metPSet") ) )
28  , ls_binning_ ( getHistoLSPSet (iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet> ("lsPSet") ) )
29  , phi_binning_ ( getHistoPSet (iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet> ("phiPSet") ) )
30  , pt_binning_ ( getHistoPSet (iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet> ("ptPSet") ) )
31  , eta_binning_ ( getHistoPSet (iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet> ("etaPSet") ) )
32  , HT_binning_ ( getHistoPSet (iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet> ("htPSet") ) )
33  , DR_binning_ ( getHistoPSet (iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet> ("DRPSet") ) )
34  // Marina
35  , csv_binning_ ( getHistoPSet (iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet> ("csvPSet")))
36  //george
37  , invMass_mumu_binning_ ( getHistoPSet (iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet> ("invMassPSet")))
38  , MHT_binning_ ( getHistoPSet (iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<edm::ParameterSet> ("MHTPSet") ) )
39 
40  , met_variable_binning_ ( iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("metBinning") )
41  , HT_variable_binning_ ( iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("HTBinning") )
42  , jetPt_variable_binning_ ( iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("jetPtBinning") )
43  , muPt_variable_binning_ ( iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("muPtBinning") )
44  , elePt_variable_binning_ ( iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("elePtBinning") )
45  , jetEta_variable_binning_ ( iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("jetEtaBinning") )
46  , muEta_variable_binning_ ( iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("muEtaBinning") )
47  , eleEta_variable_binning_ ( iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("eleEtaBinning") )
48 
49  //george
50  , invMass_mumu_variable_binning_ ( iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("invMassVariableBinning") )
51  , MHT_variable_binning_ ( iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("MHTVariableBinning") )
52  , HT_variable_binning_2D_ ( iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("HTBinning2D") )
53  , jetPt_variable_binning_2D_ ( iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("jetPtBinning2D") )
54  , muPt_variable_binning_2D_ ( iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("muPtBinning2D") )
55  , elePt_variable_binning_2D_ ( iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("elePtBinning2D") )
56  , jetEta_variable_binning_2D_ ( iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("jetEtaBinning2D") )
57  , muEta_variable_binning_2D_ ( iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("muEtaBinning2D") )
58  , eleEta_variable_binning_2D_ ( iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("eleEtaBinning2D") )
59  , phi_variable_binning_2D_ ( iConfig.getParameter<edm::ParameterSet>("histoPSet").getParameter<std::vector<double> >("phiBinning2D") )
60  , num_genTriggerEventFlag_(new GenericTriggerEventFlag(iConfig.getParameter<edm::ParameterSet>("numGenericTriggerEventPSet"),consumesCollector(), *this))
61  , den_genTriggerEventFlag_(new GenericTriggerEventFlag(iConfig.getParameter<edm::ParameterSet>("denGenericTriggerEventPSet"),consumesCollector(), *this))
62  , metSelection_ ( iConfig.getParameter<std::string>("metSelection") )
63  , jetSelection_ ( iConfig.getParameter<std::string>("jetSelection") )
64  , eleSelection_ ( iConfig.getParameter<std::string>("eleSelection") )
65  , muoSelection_ ( iConfig.getParameter<std::string>("muoSelection") )
66  , HTdefinition_ ( iConfig.getParameter<std::string>("HTdefinition") )
67  , vtxSelection_ ( iConfig.getParameter<std::string>("vertexSelection") )
68  , bjetSelection_( iConfig.getParameter<std::string>("bjetSelection"))
69  , njets_ ( iConfig.getParameter<unsigned int>("njets" ) )
70  , nelectrons_ ( iConfig.getParameter<unsigned int>("nelectrons" ) )
71  , nmuons_ ( iConfig.getParameter<unsigned int>("nmuons" ) )
72  , leptJetDeltaRmin_ ( iConfig.getParameter<double>("leptJetDeltaRmin" ) )
73  , bJetMuDeltaRmax_ ( iConfig.getParameter<double>("bJetMuDeltaRmax" ) )
74  , bJetDeltaEtaMax_ ( iConfig.getParameter<double>("bJetDeltaEtaMax" ) )
75  , HTcut_ ( iConfig.getParameter<double>("HTcut" ) )
76  // Marina
77  , nbjets_ ( iConfig.getParameter<unsigned int>("nbjets"))
78  , workingpoint_(iConfig.getParameter<double>("workingpoint"))
79  //Suvankar
80  , usePVcuts_ ( iConfig.getParameter<bool>("applyleptonPVcuts") )
81  //george
82  , invMassUppercut_ (iConfig.getParameter<double>("invMassUppercut"))
83  , invMassLowercut_ (iConfig.getParameter<double>("invMassLowercut"))
84  , opsign_ (iConfig.getParameter<bool>("oppositeSignMuons"))
85  , MHTdefinition_ ( iConfig.getParameter<std::string>("MHTdefinition") )
86  , MHTcut_ ( iConfig.getParameter<double>("MHTcut" ) )
87 {
88 
89  std::string metcut_str = iConfig.getParameter<std::string>("metSelection");
90  metcut_str.erase(std::remove(metcut_str.begin(), metcut_str.end(), ' '), metcut_str.end());
91  if(metcut_str != "pt>0") applyMETcut_ = true;
92 
93  ObjME empty;
94 
95  muPhi_= std::vector<ObjME> (nmuons_,empty);
96  muEta_= std::vector<ObjME> (nmuons_,empty);
97  muPt_= std::vector<ObjME> (nmuons_,empty);
98  muEta_variableBinning_= std::vector<ObjME> (nmuons_,empty);
99  muPt_variableBinning_= std::vector<ObjME> (nmuons_,empty);
100  muPtEta_= std::vector<ObjME> (nmuons_,empty);
101  muEtaPhi_= std::vector<ObjME> (nmuons_,empty);
102 
103  elePhi_= std::vector<ObjME> (nelectrons_,empty);
104  eleEta_= std::vector<ObjME> (nelectrons_,empty);
105  elePt_= std::vector<ObjME> (nelectrons_,empty);
106  eleEta_variableBinning_= std::vector<ObjME> (nelectrons_,empty);
107  elePt_variableBinning_= std::vector<ObjME> (nelectrons_,empty);
108  elePtEta_= std::vector<ObjME> (nelectrons_,empty);
109  eleEtaPhi_= std::vector<ObjME> (nelectrons_,empty);
110 
111  jetPhi_= std::vector<ObjME> (njets_,empty);
112  jetEta_= std::vector<ObjME> (njets_,empty);
113  jetPt_= std::vector<ObjME> (njets_,empty);
114  jetEta_variableBinning_= std::vector<ObjME> (njets_,empty);
115  jetPt_variableBinning_= std::vector<ObjME> (njets_,empty);
116  jetPtEta_= std::vector<ObjME> (njets_,empty);
117  jetEtaPhi_= std::vector<ObjME> (njets_,empty);
118 
119  // Marina
120  bjetPhi_= std::vector<ObjME> (nbjets_,empty);
121  bjetEta_= std::vector<ObjME> (nbjets_,empty);
122  bjetPt_= std::vector<ObjME> (nbjets_,empty);
123  bjetCSV_= std::vector<ObjME> (nbjets_,empty);
124  bjetEta_variableBinning_= std::vector<ObjME> (nbjets_,empty);
125  bjetPt_variableBinning_= std::vector<ObjME> (nbjets_,empty);
126  bjetPtEta_= std::vector<ObjME> (nbjets_,empty);
127  bjetEtaPhi_= std::vector<ObjME> (nbjets_,empty);
128  bjetCSVHT_= std::vector<ObjME> (nbjets_,empty);
129 
130  //Suvankar
131  lepPVcuts_.dxy = (iConfig.getParameter<edm::ParameterSet>("leptonPVcuts")).getParameter<double>("dxy");
132  lepPVcuts_.dz = (iConfig.getParameter<edm::ParameterSet>("leptonPVcuts")).getParameter<double>("dz");
133 }
134 
136 {
139 }
140 
142  edm::Run const & iRun,
143  edm::EventSetup const & iSetup)
144 {
145  std::string histname, histtitle;
146 
147  std::string currentFolder = folderName_ ;
148  ibooker.setCurrentFolder(currentFolder.c_str());
149 
150  if (applyMETcut_){
151 
152  histname = "met"; histtitle = "PFMET";
153  bookME(ibooker,metME_,histname,histtitle,met_binning_.nbins,met_binning_.xmin, met_binning_.xmax);
154  setMETitle(metME_,"PF MET [GeV]","events / [GeV]");
155 
156  histname = "metPhi"; histtitle = "PFMET phi";
157  bookME(ibooker,metPhiME_,histname,histtitle, phi_binning_.nbins, phi_binning_.xmin, phi_binning_.xmax);
158  setMETitle(metPhiME_,"PF MET #phi","events / 0.1 rad");
159 
160  histname = "met_variable"; histtitle = "PFMET";
161  bookME(ibooker,metME_variableBinning_,histname,histtitle,met_variable_binning_);
162  setMETitle(metME_variableBinning_,"PF MET [GeV]","events / [GeV]");
163 
164  histname = "metVsLS"; histtitle = "PFMET vs LS";
166  setMETitle(metVsLS_,"LS","PF MET [GeV]");
167  }
168 
169  if (njets_ > 0){
170  histname = "jetVsLS"; histtitle = "jet pt vs LS";
172  setMETitle(jetVsLS_,"LS","jet pt [GeV]");
173 
174  histname = "jetEtaPhi_HEP17"; histtitle = "jet #eta-#phi for HEP17";
175  bookME(ibooker,jetEtaPhi_HEP17_,histname,histtitle,10,-2.5,2.5,18,-3.1415,3.1415); // for HEP17 monitoring
176  setMETitle(jetEtaPhi_HEP17_,"jet #eta","jet #phi");
177 
178  histname = "jetMulti"; histtitle = "jet multiplicity";
179  bookME(ibooker,jetMulti_,histname,histtitle, 11,-.5, 10.5);
180  setMETitle(jetMulti_,"jet multiplicity","events");
181  }
182 
183  if (nmuons_ > 0){
184  histname = "muVsLS"; histtitle = "muon pt vs LS";
186  setMETitle(muVsLS_,"LS","muon pt [GeV]");
187 
188  histname = "muMulti"; histtitle = "muon multiplicity";
189  bookME(ibooker,muMulti_,histname,histtitle, 6,-.5, 5.5);
190  setMETitle(muMulti_,"muon multiplicity","events");
191 
192  if (njets_ > 0){
193  histname = "DeltaR_jet_Mu"; histtitle = "#DeltaR(jet,mu)";
194  bookME(ibooker,DeltaR_jet_Mu_,histname,histtitle, DR_binning_.nbins, DR_binning_.xmin, DR_binning_.xmax );
195  setMETitle(DeltaR_jet_Mu_,"#DeltaR(jet,mu)","events");
196  }
197 
198  }
199 
200  if (nelectrons_ > 0){
201  histname = "eleVsLS"; histtitle = "electron pt vs LS";
203  setMETitle(eleVsLS_,"LS","electron pt [GeV]");
204 
205  histname = "eleMulti"; histtitle = "electron multiplicity";
206  bookME(ibooker,eleMulti_,histname,histtitle, 6,-.5, 5.5);
207  setMETitle(eleMulti_,"electron multiplicity","events");
208 
209  if (njets_>0){
210  histname = "elePt_jetPt"; histtitle = "electron pt vs jet pt";
212  setMETitle(elePt_jetPt_,"leading electron pt","leading jet pt");
213  }
214 
215  if (nmuons_>0){
216  histname = "elePt_muPt"; histtitle = "electron pt vs muon pt";
218  setMETitle(elePt_muPt_,"electron pt [GeV]","muon pt [GeV]");
219 
220  histname = "eleEta_muEta"; histtitle = "electron #eta vs muon #eta";
222  setMETitle(eleEta_muEta_,"electron #eta","muon #eta");
223  }
224 
225  }
226 
227  // Marina
228  if (nbjets_ > 0){
229  histname = "bjetVsLS"; histtitle = "b-jet pt vs LS";
231  setMETitle(bjetVsLS_,"LS","b-jet pt [GeV]");
232 
233  histname = "bjetMulti"; histtitle = "b-jet multiplicity";
234  bookME(ibooker,bjetMulti_,histname,histtitle, 6,-.5, 5.5);
235  setMETitle(bjetMulti_,"b-jet multiplicity","events");
236 
237  }
238 
239  if ( nelectrons_ > 1 ){
240  histname = "ele1Pt_ele2Pt"; histtitle = "electron-1 pt vs electron-2 pt";
242  setMETitle(ele1Pt_ele2Pt_,"electron-1 pt [GeV]","electron-2 pt [GeV]");
243 
244  histname = "ele1Eta_ele2Eta"; histtitle = "electron-1 #eta vs electron-2 #eta";
246  setMETitle(ele1Eta_ele2Eta_,"electron-1 #eta","electron-2 #eta");
247  }
248 
249  if ( nmuons_ > 1 ) {
250  histname = "mu1Pt_mu2Pt"; histtitle = "muon-1 pt vs muon-2 pt";
252  setMETitle(mu1Pt_mu2Pt_,"muon-1 pt [GeV]","muon-2 pt [GeV]");
253 
254  histname = "mu1Eta_mu2Eta"; histtitle = "muon-1 #eta vs muon-2 #eta";
256  setMETitle(mu1Eta_mu2Eta_,"muon-1 #eta","muon-2 #eta");
257  //george
258  histname = "invMass"; histtitle = "M mu1 mu2";
260  setMETitle(invMass_mumu_,"M(mu1,mu2) [GeV]","events");
261  histname = "invMass_variable"; histtitle = "M mu1 mu2 variable";
263  setMETitle(invMass_mumu_variableBinning_,"M(mu1,mu2) [GeV]","events / [GeV]");
264  }
265 
266  if (HTcut_ > 0){
267  histname = "htVsLS"; histtitle = "event HT vs LS";
269  setMETitle(htVsLS_,"LS","event HT [GeV]");
270 
271  histname = "eventHT"; histtitle = "event HT";
272  bookME(ibooker,eventHT_,histname,histtitle, HT_binning_.nbins,HT_binning_.xmin, HT_binning_.xmax);
273  setMETitle(eventHT_," event HT [GeV]","events");
274  histname.append("_variableBinning");
275  bookME(ibooker,eventHT_variableBinning_,histname,histtitle, HT_variable_binning_);
276  setMETitle(eventHT_variableBinning_,"event HT [GeV]","events");
277 
278  if (nelectrons_>0){
279  histname = "elePt_eventHT"; histtitle = "electron pt vs event HT";
281  setMETitle(elePt_eventHT_,"leading electron pt","event HT");
282  }
283 
284  }
285 
286  if (MHTcut_>0){
287  //george
288  histname = "eventMHT"; histtitle = "event MHT";
289  bookME(ibooker,eventMHT_,histname,histtitle, MHT_binning_.nbins,MHT_binning_.xmin, MHT_binning_.xmax);
290  setMETitle(eventMHT_," event MHT [GeV]","events");
291 
292  histname = "eventMHT_variable"; histtitle = "event MHT variable";
293  bookME(ibooker,eventMHT_variableBinning_,histname,histtitle,MHT_variable_binning_);
294  setMETitle(eventMHT_variableBinning_,"event MHT [GeV]","events / [GeV]");
295  }
296 
297 
298  for (unsigned int iMu=0; iMu<nmuons_; ++iMu){
299  std::string index = std::to_string(iMu+1);
300 
301  histname = "muPt_"; histtitle = "muon p_{T} - ";
302  histname.append(index); histtitle.append(index);
303  bookME(ibooker,muPt_.at(iMu),histname,histtitle, pt_binning_.nbins, pt_binning_.xmin, pt_binning_.xmax);
304  setMETitle(muPt_.at(iMu),"muon p_{T} [GeV]","events");
305  histname.append("_variableBinning");
306  bookME(ibooker,muPt_variableBinning_.at(iMu),histname,histtitle, muPt_variable_binning_);
307  setMETitle(muPt_variableBinning_.at(iMu),"muon p_{T} [GeV]","events");
308 
309  histname = "muEta_"; histtitle = "muon #eta - ";
310  histname.append(index); histtitle.append(index);
311  bookME(ibooker,muEta_.at(iMu),histname,histtitle, eta_binning_.nbins,eta_binning_.xmin, eta_binning_.xmax);
312  setMETitle(muEta_.at(iMu)," muon #eta","events");
313  histname.append("_variableBinning");
314  bookME(ibooker,muEta_variableBinning_.at(iMu),histname,histtitle, muEta_variable_binning_);
315  setMETitle(muEta_variableBinning_.at(iMu)," muon #eta","events");
316 
317  histname = "muPhi_"; histtitle = "muon #phi - ";
318  histname.append(index); histtitle.append(index);
319  bookME(ibooker,muPhi_.at(iMu),histname,histtitle, phi_binning_.nbins, phi_binning_.xmin, phi_binning_.xmax);
320  setMETitle(muPhi_.at(iMu)," muon #phi","events");
321 
322  histname = "muPtEta_"; histtitle = "muon p_{T} - #eta - ";
323  histname.append(index); histtitle.append(index);
324  bookME(ibooker,muPtEta_.at(iMu),histname,histtitle, muPt_variable_binning_2D_, muEta_variable_binning_2D_);
325  setMETitle(muPtEta_.at(iMu),"muon p_{T} [GeV]","muon #eta");
326 
327  histname = "muEtaPhi_"; histtitle = "muon #eta - #phi - ";
328  histname.append(index); histtitle.append(index);
329  bookME(ibooker,muEtaPhi_.at(iMu),histname,histtitle, muEta_variable_binning_2D_, phi_variable_binning_2D_);
330  setMETitle(muEtaPhi_.at(iMu),"muon #phi","muon #eta");
331 
332  }
333 
334  for (unsigned int iEle=0; iEle<nelectrons_; ++iEle){
335  std::string index = std::to_string(iEle+1);
336 
337  histname = "elePt_"; histtitle = "electron p_{T} - ";
338  histname.append(index); histtitle.append(index);
339  bookME(ibooker,elePt_.at(iEle),histname,histtitle, pt_binning_.nbins, pt_binning_.xmin, pt_binning_.xmax);
340  setMETitle(elePt_.at(iEle),"electron p_{T} [GeV]","events");
341  histname.append("_variableBinning");
342  bookME(ibooker,elePt_variableBinning_.at(iEle),histname,histtitle, elePt_variable_binning_);
343  setMETitle(elePt_variableBinning_.at(iEle),"electron p_{T} [GeV]","events");
344 
345  histname = "eleEta_"; histtitle = "electron #eta - ";
346  histname.append(index); histtitle.append(index);
347  bookME(ibooker,eleEta_.at(iEle),histname,histtitle, eta_binning_.nbins,eta_binning_.xmin, eta_binning_.xmax);
348  setMETitle(eleEta_.at(iEle)," electron #eta","events");
349  histname.append("_variableBinning");
350  bookME(ibooker,eleEta_variableBinning_.at(iEle),histname,histtitle, eleEta_variable_binning_);
351  setMETitle(eleEta_variableBinning_.at(iEle),"electron #eta","events");
352 
353  histname = "elePhi_"; histtitle = "electron #phi - ";
354  histname.append(index); histtitle.append(index);
355  bookME(ibooker,elePhi_.at(iEle),histname,histtitle, phi_binning_.nbins, phi_binning_.xmin, phi_binning_.xmax);
356  setMETitle(elePhi_.at(iEle)," electron #phi","events");
357 
358  histname = "elePtEta_"; histtitle = "electron p_{T} - #eta - ";
359  histname.append(index); histtitle.append(index);
360  bookME(ibooker,elePtEta_.at(iEle),histname,histtitle, elePt_variable_binning_2D_, eleEta_variable_binning_2D_);
361  setMETitle(elePtEta_.at(iEle),"electron p_{T} [GeV]","electron #eta");
362 
363  histname = "eleEtaPhi_"; histtitle = "electron #eta - #phi - ";
364  histname.append(index); histtitle.append(index);
365  bookME(ibooker,eleEtaPhi_.at(iEle),histname,histtitle, eleEta_variable_binning_2D_, phi_variable_binning_2D_);
366  setMETitle(eleEtaPhi_.at(iEle),"electron #phi","electron #eta");
367 
368 
369  }
370 
371  for (unsigned int iJet=0; iJet<njets_; ++iJet){
372  std::string index = std::to_string(iJet+1);
373 
374  histname = "jetPt_"; histtitle = "jet p_{T} - ";
375  histname.append(index); histtitle.append(index);
376  bookME(ibooker,jetPt_.at(iJet),histname,histtitle, pt_binning_.nbins, pt_binning_.xmin, pt_binning_.xmax);
377  setMETitle(jetPt_.at(iJet),"jet p_{T} [GeV]","events");
378  histname.append("_variableBinning");
379  bookME(ibooker,jetPt_variableBinning_.at(iJet),histname,histtitle, jetPt_variable_binning_);
380  setMETitle(jetPt_variableBinning_.at(iJet),"jet p_{T} [GeV]","events");
381 
382  histname = "jetEta_"; histtitle = "jet #eta - ";
383  histname.append(index); histtitle.append(index);
384  bookME(ibooker,jetEta_.at(iJet),histname,histtitle, eta_binning_.nbins,eta_binning_.xmin, eta_binning_.xmax);
385  setMETitle(jetEta_.at(iJet)," jet #eta","events");
386  histname.append("_variableBinning");
387  bookME(ibooker,jetEta_variableBinning_.at(iJet),histname,histtitle, jetEta_variable_binning_);
388  setMETitle(jetEta_variableBinning_.at(iJet),"jet #eta","events");
389 
390  histname = "jetPhi_"; histtitle = "jet #phi - ";
391  histname.append(index); histtitle.append(index);
392  bookME(ibooker,jetPhi_.at(iJet),histname,histtitle, phi_binning_.nbins, phi_binning_.xmin, phi_binning_.xmax);
393  setMETitle(jetPhi_.at(iJet)," jet #phi","events");
394 
395  histname = "jetPtEta_"; histtitle = "jet p_{T} - #eta - ";
396  histname.append(index); histtitle.append(index);
397  bookME(ibooker,jetPtEta_.at(iJet),histname,histtitle, jetPt_variable_binning_2D_, jetEta_variable_binning_2D_);
398  setMETitle(jetPtEta_.at(iJet),"jet p_{T} [GeV]","jet #eta");
399 
400  histname = "jetEtaPhi_"; histtitle = "jet #eta - #phi - ";
401  histname.append(index); histtitle.append(index);
402  bookME(ibooker,jetEtaPhi_.at(iJet),histname,histtitle, jetEta_variable_binning_2D_, phi_variable_binning_2D_);
403  setMETitle(jetEtaPhi_.at(iJet),"#phi","jet #eta");
404 
405 
406 
407  }
408 
409  // Marina
410  for (unsigned int iBJet=0; iBJet<nbjets_; ++iBJet){
411  std::string index = std::to_string(iBJet+1);
412 
413  histname = "bjetPt_"; histtitle = "b-jet p_{T} - ";
414  histname.append(index); histtitle.append(index);
415  bookME(ibooker,bjetPt_.at(iBJet),histname,histtitle, pt_binning_.nbins, pt_binning_.xmin, pt_binning_.xmax);
416  setMETitle(bjetPt_.at(iBJet)," b-jet p_{T} [GeV]","events");
417  histname.append("_variableBinning");
418  bookME(ibooker,bjetPt_variableBinning_.at(iBJet),histname,histtitle, jetPt_variable_binning_);
419  setMETitle(bjetPt_variableBinning_.at(iBJet),"b-jet p_{T} [GeV]","events");
420 
421  histname = "bjetEta_"; histtitle = "b-jet #eta - ";
422  histname.append(index); histtitle.append(index);
423  bookME(ibooker,bjetEta_.at(iBJet),histname,histtitle, eta_binning_.nbins,eta_binning_.xmin, eta_binning_.xmax);
424  setMETitle(bjetEta_.at(iBJet)," b-jet #eta","events");
425  histname.append("_variableBinning");
426  bookME(ibooker,bjetEta_variableBinning_.at(iBJet),histname,histtitle, jetEta_variable_binning_);
427  setMETitle(bjetEta_variableBinning_.at(iBJet),"b-jet #eta","events");
428 
429  histname = "bjetPhi_"; histtitle = "b-jet #phi - ";
430  histname.append(index); histtitle.append(index);
431  bookME(ibooker,bjetPhi_.at(iBJet),histname,histtitle, phi_binning_.nbins, phi_binning_.xmin, phi_binning_.xmax);
432  setMETitle(bjetPhi_.at(iBJet)," b-jet #phi","events");
433 
434  histname = "bjetCSV_"; histtitle = "b-jet CSV - ";
435  histname.append(index); histtitle.append(index);
436  bookME(ibooker,bjetCSV_.at(iBJet),histname,histtitle, csv_binning_.nbins, csv_binning_.xmin, csv_binning_.xmax);
437  setMETitle(bjetCSV_.at(iBJet)," b-jet CSV","events");
438 
439  histname = "bjetPtEta_"; histtitle = "b-jet p_{T} - #eta - ";
440  histname.append(index); histtitle.append(index);
441  bookME(ibooker,bjetPtEta_.at(iBJet),histname,histtitle, jetPt_variable_binning_2D_, jetEta_variable_binning_2D_);
442  setMETitle(bjetPtEta_.at(iBJet),"b-jet p_{T} [GeV]","b-jet #eta");
443 
444  histname = "bjetEtaPhi_"; histtitle = "b-jet #eta - #phi - ";
445  histname.append(index); histtitle.append(index);
446  bookME(ibooker,bjetEtaPhi_.at(iBJet),histname,histtitle, jetEta_variable_binning_2D_, phi_variable_binning_2D_);
447  setMETitle(bjetEtaPhi_.at(iBJet),"b-jet #phi","b-jet #eta");
448 
449  histname = "bjetCSVHT_"; histtitle = "HT - b-jet CSV - ";
450  histname.append(index); histtitle.append(index);
452  setMETitle(bjetCSVHT_.at(iBJet),"b-jet CSV", "event HT [GeV]");
453  }
454 
455 
456 
457 
458  // Initialize the GenericTriggerEventFlag
459  if ( num_genTriggerEventFlag_ && num_genTriggerEventFlag_->on() ) num_genTriggerEventFlag_->initRun( iRun, iSetup );
460  if ( den_genTriggerEventFlag_ && den_genTriggerEventFlag_->on() ) den_genTriggerEventFlag_->initRun( iRun, iSetup );
461 
462 }
463 
465  mll=-2;
466  sign=0;
467  // Filter out events if Trigger Filtering is requested
468  if (den_genTriggerEventFlag_->on() && ! den_genTriggerEventFlag_->accept( iEvent, iSetup) ) return;
469 
470  //Suvankar
472  iEvent.getByToken(vtxToken_, primaryVertices);
473  //Primary Vertex selection
474  const reco::Vertex* pv = nullptr;
475  for(auto const& v: *primaryVertices) {
476  if ( !vtxSelection_( v ) ) continue;
477  pv = &v;
478  break;
479  }
480  if(usePVcuts_ && pv == nullptr) return;
481 
483  iEvent.getByToken( metToken_, metHandle );
484  if (!metHandle.isValid() && applyMETcut_){
485  edm::LogWarning("TopMonitor") << "MET handle not valid \n";
486  return;
487  }
488 
489  float met = 0;
490  float phi = 0;
491 
492  if (applyMETcut_){
493  reco::PFMET pfmet = metHandle->front();
494  if ( ! metSelection_( pfmet ) ) return;
495  met = pfmet.pt();
496  phi = pfmet.phi();
497  }
498 
499 
501  iEvent.getByToken( eleToken_, eleHandle );
502  if (!eleHandle.isValid() && nelectrons_>0){
503  edm::LogWarning("TopMonitor") << "Electron handle not valid \n";
504  return;
505  }
506  std::vector<reco::GsfElectron> electrons;
507  if (nelectrons_>0){
508  if ( eleHandle->size() < nelectrons_ ) return;
509  for ( auto const & e : *eleHandle ) {
510  if (eleSelection_(e)) electrons.push_back(e);
511  //Suvankar
512  if ( usePVcuts_ &&
513  (std::fabs(e.gsfTrack()->dxy(pv->position())) >= lepPVcuts_.dxy || std::fabs(e.gsfTrack()->dz(pv->position())) >= lepPVcuts_.dz) ) continue;
514  }
515  if ( electrons.size() < nelectrons_ ) return;
516  }
518  iEvent.getByToken( muoToken_, muoHandle );
519  if (!muoHandle.isValid() && nmuons_>0){
520  edm::LogWarning("TopMonitor") << "Muon handle not valid \n";
521  return;
522  }
523  if ( muoHandle->size() < nmuons_ ) return;
524  std::vector<reco::Muon> muons;
525  if (nmuons_>0){
526  for ( auto const & m : *muoHandle ) {
527  if ( muoSelection_( m ) ) muons.push_back(m);
528  //Suvankar
529  if ( usePVcuts_ &&
530  (std::fabs(m.muonBestTrack()->dxy(pv->position())) >= lepPVcuts_.dxy || std::fabs(m.muonBestTrack()->dz(pv->position())) >= lepPVcuts_.dz) ) continue;
531  }
532  if ( muons.size() < nmuons_ ) return;
533  }
534  //george
535 
536  if (nmuons_>1){
537  mll = (muons[0].p4() + muons[1].p4()).M();
538  sign = muons[0].charge() * muons[1].charge();
539  }
541  if (nmuons_>1 && opsign_ && sign==1) return;
542 
543  //cout<<" mll="<<mll<<" invMasscut_="<<invMasscut_<<endl;
544  double eventHT = 0.;
545  math::XYZTLorentzVector eventMHT(0., 0., 0., 0.);
546 
548  iEvent.getByToken( jetToken_, jetHandle );
549  if (!jetHandle.isValid() && njets_>0) {
550  edm::LogWarning("TopMonitor") << "Jet handle not valid \n";
551  return;
552  }
553  std::vector<reco::PFJet> jets;
554  if (njets_>0){
555  if (jetHandle->size() < njets_) return;
556  for (auto const & j : *jetHandle) {
557  if (HTdefinition_(j)) {
558  eventHT += j.pt();
559  }
560  if (MHTdefinition_(j)) {
561  eventMHT += j.p4();
562  }
563  if (jetSelection_(j)) {
564  bool isJetOverlappedWithLepton = false;
565  if(nmuons_>0) {
566  for (auto const& m : muons) {
567  if (deltaR(j, m)<leptJetDeltaRmin_) {
568  isJetOverlappedWithLepton=true;
569  break;
570  }
571  }
572  }
573  if (isJetOverlappedWithLepton) continue;
574  if(nelectrons_>0) {
575  for (auto const & e: electrons) {
576  if (deltaR(j, e)<leptJetDeltaRmin_) {
577  isJetOverlappedWithLepton=true;
578  break;
579  }
580  }
581  }
582  if (isJetOverlappedWithLepton) continue;
583  jets.push_back(j);
584  }
585 
586  }
587  if (jets.size() < njets_) return;
588  }
589 
590  if (eventHT < HTcut_) return;
591  if (MHTcut_>0 && eventMHT.pt()<MHTcut_) return;
592 
593  // Marina
595  iEvent.getByToken( jetTagToken_, bjetHandle );
596  if (!bjetHandle.isValid() && nbjets_>0){
597  edm::LogWarning("TopMonitor") << "B-Jet handle not valid \n";
598  return;
599  }
600 
601  JetTagMap bjets;
602 
603  if (nbjets_>0){
604  const reco::JetTagCollection& bTags = *(bjetHandle.product());
605  if (bTags.size() < nbjets_ ) return;
606  for (unsigned int i=0; i!=bTags.size(); ++i){
607  // Apply Selections
608  if (!bjetSelection_(*dynamic_cast<const reco::Jet*>(bTags[i].first.get())) ) continue;
609  if (bTags[i].second < workingpoint_ ) continue;
610 
611  // Fill JetTag Map
612  bjets.insert(JetTagMap::value_type(bTags[i].first, bTags[i].second));
613  }
614  if (bjets.size() < nbjets_ ) return;
615  }
616 
617  if (nbjets_ > 1){
618  double deltaEta = std::abs(bjets.begin()->first->eta()-(++bjets.begin())->first->eta());
619  if (deltaEta > bJetDeltaEtaMax_) return;
620  }
621 
622  if ((nbjets_>0) && (nmuons_>0)){
623  bool foundMuonInsideJet = false;
624  for (auto const & bjet : bjets){
625  for (auto const & mu : muons){
626  double dR = deltaR(*bjet.first,mu);
627  if (dR < bJetMuDeltaRmax_){
628  foundMuonInsideJet = true;
629  break;
630  }
631  }
632  if(foundMuonInsideJet) break;
633  }
634 
635  if (!foundMuonInsideJet) return;
636  }
637 
638  int ls = iEvent.id().luminosityBlock();
639 
640  // filling histograms (denominator)
641  if (applyMETcut_){
642  metME_.denominator -> Fill(met);
644  metPhiME_.denominator -> Fill(phi);
645  metVsLS_.denominator -> Fill(ls, met);
646  }
647  if (HTcut_>0){
648  eventHT_.denominator -> Fill(eventHT);
650  htVsLS_.denominator -> Fill(ls, eventHT);
651  }
652 //george
653  if (MHTcut_>0){
654  eventMHT_.denominator -> Fill(eventMHT.pt());
655  eventMHT_variableBinning_.denominator -> Fill(eventMHT.pt());
656  }
657 
658  if (njets_>0) {
659  jetMulti_.denominator -> Fill(jets.size());
660  jetEtaPhi_HEP17_.denominator -> Fill (jets.at(0).eta(), jets.at(0).phi()); // for HEP17 monitorning
661  jetVsLS_.denominator -> Fill(ls, jets.at(0).pt());
662  }
663 
664  // Marina
665  if (nbjets_>0) {
666  bjetMulti_.denominator -> Fill(bjets.size());
667  bjetVsLS_.denominator -> Fill(ls, bjets.begin()->first->pt());
668  }
669 
670  if (nmuons_ > 0){
671  muMulti_.denominator -> Fill(muons.size());
672  muVsLS_.denominator -> Fill(ls, muons.at(0).pt());
673  if (nmuons_>1) {
674  mu1Pt_mu2Pt_.denominator->Fill(muons.at(0).pt(),muons.at(1).pt());
675  mu1Eta_mu2Eta_.denominator->Fill(muons.at(0).eta(),muons.at(1).eta());
678  }
679  if(njets_>0){
680  DeltaR_jet_Mu_.denominator -> Fill (deltaR(jets.at(0),muons.at(0)));
681  }
682  }
683 
684 
685  if (nelectrons_ > 0) {
686  eleMulti_.denominator -> Fill(electrons.size());
687  eleVsLS_.denominator -> Fill(ls, electrons.at(0).pt());
688  if (HTcut_>0) elePt_eventHT_.denominator -> Fill (electrons.at(0).pt(), eventHT);
689  if (njets_>0) elePt_jetPt_.denominator -> Fill (electrons.at(0).pt(), jets.at(0).pt());
690  if (nmuons_>0) {
691  elePt_muPt_.denominator->Fill(electrons.at(0).pt(),muons.at(0).pt());
692  eleEta_muEta_.denominator->Fill(electrons.at(0).eta(),muons.at(0).eta());
693  }
694  if (nelectrons_>1) {
695  ele1Pt_ele2Pt_.denominator->Fill(electrons.at(0).pt(),electrons.at(1).pt());
696  ele1Eta_ele2Eta_.denominator->Fill(electrons.at(0).eta(),electrons.at(1).eta());
697  }
698  }
699 
700 
701 
702  for (unsigned int iMu=0; iMu<muons.size(); ++iMu){
703  if (iMu>=nmuons_) break;
704  muPhi_.at(iMu).denominator -> Fill(muons.at(iMu).phi());
705  muEta_.at(iMu).denominator -> Fill(muons.at(iMu).eta());
706  muPt_.at(iMu).denominator -> Fill(muons.at(iMu).pt() );
707  muEta_variableBinning_.at(iMu).denominator -> Fill(muons.at(iMu).eta());
708  muPt_variableBinning_.at(iMu).denominator -> Fill(muons.at(iMu).pt() );
709  muPtEta_.at(iMu).denominator -> Fill(muons.at(iMu).pt(), muons.at(iMu).eta() );
710  muEtaPhi_.at(iMu).denominator -> Fill(muons.at(iMu).eta(), muons.at(iMu).phi() );
711  }
712  for (unsigned int iEle=0; iEle<electrons.size(); ++iEle){
713  if (iEle>=nelectrons_) break;
714  elePhi_.at(iEle).denominator -> Fill(electrons.at(iEle).phi());
715  eleEta_.at(iEle).denominator -> Fill(electrons.at(iEle).eta());
716  elePt_.at(iEle).denominator -> Fill(electrons.at(iEle).pt() );
717  eleEta_variableBinning_.at(iEle).denominator -> Fill(electrons.at(iEle).eta());
718  elePt_variableBinning_.at(iEle).denominator -> Fill(electrons.at(iEle).pt() );
719  elePtEta_.at(iEle).denominator -> Fill(electrons.at(iEle).pt(), electrons.at(iEle).eta() );
720  eleEtaPhi_.at(iEle).denominator -> Fill(electrons.at(iEle).eta(), electrons.at(iEle).phi() );
721  }
722  for (unsigned int iJet=0; iJet<jets.size(); ++iJet){
723  if (iJet>=njets_) break;
724  jetPhi_.at(iJet).denominator -> Fill(jets.at(iJet).phi());
725  jetEta_.at(iJet).denominator -> Fill(jets.at(iJet).eta());
726  jetPt_.at(iJet).denominator -> Fill(jets.at(iJet).pt() );
727  jetEta_variableBinning_.at(iJet).denominator -> Fill(jets.at(iJet).eta());
728  jetPt_variableBinning_.at(iJet).denominator -> Fill(jets.at(iJet).pt() );
729  jetPtEta_.at(iJet).denominator -> Fill(jets.at(iJet).pt(), jets.at(iJet).eta() );
730  jetEtaPhi_.at(iJet).denominator -> Fill(jets.at(iJet).eta(), jets.at(iJet).phi() );
731  }
732 
733  // Marina
734  unsigned int iBJet = 0;
735  for (auto & bjet: bjets){
736  if (iBJet >=nbjets_) break;
737 
738  bjetPhi_.at(iBJet).denominator -> Fill(bjet.first->phi());
739  bjetEta_.at(iBJet).denominator -> Fill(bjet.first->eta());
740  bjetPt_.at(iBJet).denominator -> Fill(bjet.first->pt());
741  bjetCSV_.at(iBJet).denominator -> Fill(std::fmax(0.0, bjet.second));
742  bjetEta_variableBinning_.at(iBJet).denominator -> Fill(bjet.first->eta());
743  bjetPt_variableBinning_.at(iBJet).denominator -> Fill(bjet.first->pt());
744  bjetPtEta_.at(iBJet).denominator -> Fill(bjet.first->pt(), bjet.first->eta());
745  bjetEtaPhi_.at(iBJet).denominator -> Fill(bjet.first->eta(), bjet.first->phi());
746  bjetCSVHT_.at(iBJet).denominator -> Fill(std::fmax(0.0, bjet.second), eventHT);
747 
748  iBJet++;
749  }
750 
751 
752 
753 
754  // applying selection for numerator
755  if (num_genTriggerEventFlag_->on() && ! num_genTriggerEventFlag_->accept( iEvent, iSetup) ) return;
756 
757  // filling histograms (num_genTriggerEventFlag_)
758 
759  if (applyMETcut_>0){
760  metME_.numerator -> Fill(met);
762  metPhiME_.numerator -> Fill(phi);
763  metVsLS_.numerator -> Fill(ls, met);
764  }
765 
766  if (HTcut_>0){
767  htVsLS_.numerator -> Fill(ls, eventHT);
768  eventHT_.numerator -> Fill(eventHT);
770  }
771 
772  if (MHTcut_>0){
773  eventMHT_.numerator -> Fill(eventMHT.pt());
774  eventMHT_variableBinning_.numerator -> Fill(eventMHT.pt());
775  }
776 
777  if (nmuons_ > 0){
778  muMulti_.numerator -> Fill(muons.size());
779  muVsLS_.numerator -> Fill(ls, muons.at(0).pt());
780  if (nmuons_>1) {
781  mu1Pt_mu2Pt_.numerator->Fill(muons.at(0).pt(),muons.at(1).pt());
782  mu1Eta_mu2Eta_.numerator->Fill(muons.at(0).eta(),muons.at(1).eta());
785  }
786  if(njets_>0){
787  DeltaR_jet_Mu_.numerator -> Fill (deltaR(jets.at(0),muons.at(0)));
788  }
789 
790  }
791  if (njets_ > 0){
792  jetMulti_.numerator -> Fill(jets.size());
793  jetVsLS_.numerator -> Fill(ls, jets.at(0).pt());
794  jetEtaPhi_HEP17_.numerator -> Fill (jets.at(0).eta(), jets.at(0).phi()); // for HEP17 monitorning
795  }
796 
797  if (nelectrons_ > 0) {
798  eleMulti_.numerator -> Fill(electrons.size());
799  eleVsLS_.numerator -> Fill(ls, electrons.at(0).pt());
800  if (HTcut_>0) elePt_eventHT_.numerator -> Fill (electrons.at(0).pt(), eventHT);
801  if (njets_>0) elePt_jetPt_.numerator -> Fill (electrons.at(0).pt(), jets.at(0).pt());
802  if (nmuons_>0) {
803  elePt_muPt_.numerator->Fill(electrons.at(0).pt(),muons.at(0).pt());
804  eleEta_muEta_.numerator->Fill(electrons.at(0).eta(),muons.at(0).eta());
805  }
806  if (nelectrons_>1) {
807  ele1Pt_ele2Pt_.numerator->Fill(electrons.at(0).pt(),electrons.at(1).pt());
808  ele1Eta_ele2Eta_.numerator->Fill(electrons.at(0).eta(),electrons.at(1).eta());
809  }
810  }
811 
812  // Marina
813  if (nbjets_ > 0){
814  bjetMulti_.numerator -> Fill(bjets.size());
815  bjetVsLS_.numerator-> Fill(ls, bjets.begin()->first->pt());
816  }
817 
818  for (unsigned int iMu=0; iMu<muons.size(); ++iMu){
819  if (iMu>=nmuons_) break;
820 
821  muPhi_.at(iMu).numerator -> Fill(muons.at(iMu).phi());
822  muEta_.at(iMu).numerator -> Fill(muons.at(iMu).eta());
823  muPt_.at(iMu).numerator -> Fill(muons.at(iMu).pt() );
824  muEta_variableBinning_.at(iMu).numerator -> Fill(muons.at(iMu).eta());
825  muPt_variableBinning_.at(iMu).numerator -> Fill(muons.at(iMu).pt() );
826  muPtEta_.at(iMu).numerator -> Fill(muons.at(iMu).pt(), muons.at(iMu).eta() );
827  muEtaPhi_.at(iMu).numerator -> Fill(muons.at(iMu).eta(), muons.at(iMu).phi() );
828  }
829  for (unsigned int iEle=0; iEle<electrons.size(); ++iEle){
830  if (iEle>=nelectrons_) break;
831  elePhi_.at(iEle).numerator -> Fill(electrons.at(iEle).phi());
832  eleEta_.at(iEle).numerator -> Fill(electrons.at(iEle).eta());
833  elePt_.at(iEle).numerator -> Fill(electrons.at(iEle).pt() );
834  eleEta_variableBinning_.at(iEle).numerator -> Fill(electrons.at(iEle).eta());
835  elePt_variableBinning_.at(iEle).numerator -> Fill(electrons.at(iEle).pt() );
836  elePtEta_.at(iEle).numerator -> Fill(electrons.at(iEle).pt(), electrons.at(iEle).eta() );
837  eleEtaPhi_.at(iEle).numerator -> Fill(electrons.at(iEle).eta(), electrons.at(iEle).phi() );
838  }
839  for (unsigned int iJet=0; iJet<jets.size(); ++iJet){
840  if (iJet>=njets_) break;
841  jetPhi_.at(iJet).numerator -> Fill(jets.at(iJet).phi());
842  jetEta_.at(iJet).numerator -> Fill(jets.at(iJet).eta());
843  jetPt_.at(iJet).numerator -> Fill(jets.at(iJet).pt() );
844  jetEta_variableBinning_.at(iJet).numerator -> Fill(jets.at(iJet).eta());
845  jetPt_variableBinning_.at(iJet).numerator -> Fill(jets.at(iJet).pt() );
846  jetPtEta_.at(iJet).numerator -> Fill(jets.at(iJet).pt(), jets.at(iJet).eta() );
847  jetEtaPhi_.at(iJet).numerator -> Fill(jets.at(iJet).eta(), jets.at(iJet).phi() );
848  }
849 
850  // Marina
851  unsigned int j = 0;
852  for (auto & bjet: bjets){
853  if (j >=nbjets_) break;
854  bjetPhi_.at(j).numerator -> Fill(bjet.first->pt());
855  bjetEta_.at(j).numerator -> Fill(bjet.first->eta());
856  bjetPt_.at(j).numerator -> Fill(bjet.first->pt());
857  bjetCSV_.at(j).numerator -> Fill(std::fmax(0.0,bjet.second));
858  bjetEta_variableBinning_.at(j).numerator -> Fill(bjet.first->eta());
859  bjetPt_variableBinning_.at(j).numerator -> Fill(bjet.first->pt());
860  bjetPtEta_.at(j).numerator -> Fill(bjet.first->pt(), bjet.first->eta());
861  bjetEtaPhi_.at(j).numerator -> Fill(bjet.first->eta(), bjet.first->phi());
862  bjetCSVHT_.at(j).numerator -> Fill(std::fmax(0.0,bjet.second), eventHT);
863 
864  j++;
865  }
866 
867 }
868 
870 {
872  desc.add<std::string> ( "FolderName", "HLT/TOP" );
873 
874  desc.add<edm::InputTag>( "met", edm::InputTag("pfMet") );
875  desc.add<edm::InputTag>( "jets", edm::InputTag("ak4PFJetsCHS") );
876  desc.add<edm::InputTag>( "electrons",edm::InputTag("gedGsfElectrons") );
877  desc.add<edm::InputTag>( "muons", edm::InputTag("muons") );
878  //Suvankar
879  desc.add<edm::InputTag>( "vertices", edm::InputTag("offlinePrimaryVertices") );
880  // Marina
881  desc.add<edm::InputTag>( "btagalgo", edm::InputTag("pfCombinedSecondaryVertexV2BJetTags") );
882  desc.add<std::string>("metSelection", "pt > 0");
883  desc.add<std::string>("jetSelection", "pt > 0");
884  desc.add<std::string>("eleSelection", "pt > 0");
885  desc.add<std::string>("muoSelection", "pt > 0");
886  desc.add<std::string>("HTdefinition", "pt > 0");
887  //Suvankar
888  desc.add<std::string>("vertexSelection", "!isFake");
889  desc.add<std::string>("bjetSelection","pt > 0");
890  desc.add<unsigned int>("njets", 0);
891  desc.add<unsigned int>("nelectrons", 0);
892  desc.add<unsigned int>("nmuons", 0);
893  desc.add<double>("leptJetDeltaRmin", 0);
894  desc.add<double>("bJetMuDeltaRmax" , 9999.);
895  desc.add<double>("bJetDeltaEtaMax" , 9999.);
896  desc.add<double>("HTcut", 0);
897  // Marina
898  desc.add<unsigned int>("nbjets", 0);
899  desc.add<double>("workingpoint", 0.8484); // medium CSV
900  //Suvankar
901  desc.add<bool>("applyleptonPVcuts", false);
902  //george
903  desc.add<double>("invMassUppercut",-1.0);
904  desc.add<double>("invMassLowercut",-1.0);
905  desc.add<bool>("oppositeSignMuons",false);
906  desc.add<std::string>("MHTdefinition", "pt > 0");
907  desc.add<double>("MHTcut", -1);
908 
909  edm::ParameterSetDescription genericTriggerEventPSet;
910  genericTriggerEventPSet.add<bool>("andOr");
911  genericTriggerEventPSet.add<edm::InputTag>("dcsInputTag", edm::InputTag("scalersRawToDigi") );
912  genericTriggerEventPSet.add<std::vector<int> >("dcsPartitions",{});
913  genericTriggerEventPSet.add<bool>("andOrDcs", false);
914  genericTriggerEventPSet.add<bool>("errorReplyDcs", true);
915  genericTriggerEventPSet.add<std::string>("dbLabel","");
916  genericTriggerEventPSet.add<bool>("andOrHlt", true);
917  genericTriggerEventPSet.add<edm::InputTag>("hltInputTag", edm::InputTag("TriggerResults::HLT") );
918  genericTriggerEventPSet.add<std::vector<std::string> >("hltPaths",{});
919  genericTriggerEventPSet.add<std::string>("hltDBKey","");
920  genericTriggerEventPSet.add<bool>("errorReplyHlt",false);
921  genericTriggerEventPSet.add<unsigned int>("verbosityLevel",1);
922 
923  desc.add<edm::ParameterSetDescription>("numGenericTriggerEventPSet", genericTriggerEventPSet);
924  desc.add<edm::ParameterSetDescription>("denGenericTriggerEventPSet", genericTriggerEventPSet);
925 
933  // Marina
935  //george
936  edm::ParameterSetDescription invMassPSet;
938  fillHistoPSetDescription(metPSet);
939  fillHistoPSetDescription(phiPSet);
940  fillHistoPSetDescription(ptPSet);
941  fillHistoPSetDescription(etaPSet);
942  fillHistoPSetDescription(htPSet);
943  fillHistoPSetDescription(DRPSet);
944  // Marina
945  fillHistoPSetDescription(csvPSet);
946  //george
947  fillHistoPSetDescription(MHTPSet);
948  fillHistoPSetDescription(invMassPSet);
949  histoPSet.add<edm::ParameterSetDescription>("metPSet", metPSet);
950  histoPSet.add<edm::ParameterSetDescription>("etaPSet", etaPSet);
951  histoPSet.add<edm::ParameterSetDescription>("phiPSet", phiPSet);
952  histoPSet.add<edm::ParameterSetDescription>("ptPSet", ptPSet);
953  histoPSet.add<edm::ParameterSetDescription>("htPSet", htPSet);
954  histoPSet.add<edm::ParameterSetDescription>("DRPSet", DRPSet);
955  // Marina
956  histoPSet.add<edm::ParameterSetDescription>("csvPSet", csvPSet);
957  //george
958  histoPSet.add<edm::ParameterSetDescription>("invMassPSet", invMassPSet);
959  histoPSet.add<edm::ParameterSetDescription>("MHTPSet", MHTPSet);
960 
961  std::vector<double> bins = {0.,20.,40.,60.,80.,90.,100.,110.,120.,130.,140.,150.,160.,170.,180.,190.,200.,220.,240.,260.,280.,300.,350.,400.,450.,1000.};
962  std::vector<double> eta_bins = {-3.,-2.5,-2.,-1.5,-1.,-.5,0.,.5,1.,1.5,2.,2.5,3.};
963  histoPSet.add<std::vector<double> >("metBinning", bins);
964  histoPSet.add<std::vector<double> >("HTBinning", bins);
965  histoPSet.add<std::vector<double> >("jetPtBinning", bins);
966  histoPSet.add<std::vector<double> >("elePtBinning", bins);
967  histoPSet.add<std::vector<double> >("muPtBinning", bins);
968  histoPSet.add<std::vector<double> >("jetEtaBinning", eta_bins);
969  histoPSet.add<std::vector<double> >("eleEtaBinning", eta_bins);
970  histoPSet.add<std::vector<double> >("muEtaBinning", eta_bins);
971  //george
972  histoPSet.add<std::vector<double> >("invMassVariableBinning", bins);
973  histoPSet.add<std::vector<double> >("MHTVariableBinning", bins);
974 
975  std::vector<double> bins_2D = {0.,40.,80.,100.,120.,140.,160.,180.,200.,240.,280.,350.,450.,1000.};
976  std::vector<double> eta_bins_2D = {-3.,-2.,-1.,0.,1.,2.,3.};
977  std::vector<double> phi_bins_2D = {-3.1415,-2.5132,-1.8849,-1.2566,-0.6283,0,0.6283,1.2566,1.8849,2.5132,3.1415};
978  histoPSet.add<std::vector<double> >("HTBinning2D", bins_2D);
979  histoPSet.add<std::vector<double> >("jetPtBinning2D", bins_2D);
980  histoPSet.add<std::vector<double> >("elePtBinning2D", bins_2D);
981  histoPSet.add<std::vector<double> >("muPtBinning2D", bins_2D);
982  histoPSet.add<std::vector<double> >("jetEtaBinning2D", eta_bins_2D);
983  histoPSet.add<std::vector<double> >("eleEtaBinning2D", eta_bins_2D);
984  histoPSet.add<std::vector<double> >("muEtaBinning2D", eta_bins_2D);
985  histoPSet.add<std::vector<double> >("phiBinning2D", phi_bins_2D);
986 
989  histoPSet.add<edm::ParameterSetDescription>("lsPSet", lsPSet);
990 
991  desc.add<edm::ParameterSetDescription>("histoPSet",histoPSet);
992  //Suvankar
993  edm::ParameterSetDescription lPVcutPSet;
994  lPVcutPSet.add<double>( "dxy", 9999. );
995  lPVcutPSet.add<double>( "dz", 9999. );
996  desc.add<edm::ParameterSetDescription>("leptonPVcuts", lPVcutPSet);
997 
998  descriptions.add("topMonitoring", desc);
999 }
1000 
1001 // Define this as a plug-in
1004 
StringCutObjectSelector< reco::Jet, true > bjetSelection_
Definition: TopMonitor.h:227
ObjME mu1Pt_mu2Pt_
Definition: TopMonitor.h:156
std::vector< double > elePt_variable_binning_2D_
Definition: TopMonitor.h:125
std::vector< ObjME > jetEta_variableBinning_
Definition: TopMonitor.h:198
T getParameter(std::string const &) const
virtual double pt() const final
transverse momentum
ObjME jetVsLS_
Definition: TopMonitor.h:136
MonitorElement * numerator
std::vector< double > jetEta_variable_binning_
Definition: TopMonitor.h:115
StringCutObjectSelector< reco::PFJet, true > jetSelection_
Definition: TopMonitor.h:219
std::vector< ObjME > jetEtaPhi_
Definition: TopMonitor.h:205
std::vector< ObjME > bjetPtEta_
Definition: TopMonitor.h:211
ObjME jetEtaPhi_HEP17_
Definition: TopMonitor.h:143
double bJetMuDeltaRmax_
Definition: TopMonitor.h:233
std::vector< double > muEta_variable_binning_
Definition: TopMonitor.h:116
static void fillHistoLSPSetDescription(edm::ParameterSetDescription &pset)
ObjME DeltaR_jet_Mu_
Definition: TopMonitor.h:167
std::vector< ObjME > muPt_
Definition: TopMonitor.h:174
std::vector< ObjME > jetPtEta_
Definition: TopMonitor.h:204
MEbinning invMass_mumu_binning_
Definition: TopMonitor.h:106
std::vector< ObjME > bjetCSVHT_
Definition: TopMonitor.h:213
std::vector< ObjME > bjetPt_variableBinning_
Definition: TopMonitor.h:194
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
ObjME muVsLS_
Definition: TopMonitor.h:137
std::vector< ObjME > muEta_
Definition: TopMonitor.h:173
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
MEbinning HT_binning_
Definition: TopMonitor.h:101
ObjME eleEta_muEta_
Definition: TopMonitor.h:159
ObjME eventMHT_variableBinning_
Definition: TopMonitor.h:164
std::vector< ObjME > elePt_variableBinning_
Definition: TopMonitor.h:191
std::vector< double > jetPt_variable_binning_
Definition: TopMonitor.h:112
ObjME ele1Pt_ele2Pt_
Definition: TopMonitor.h:154
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
ObjME ele1Eta_ele2Eta_
Definition: TopMonitor.h:155
Provides a code based selection for trigger and DCS information in order to have no failing filters i...
static void fillHistoPSetDescription(edm::ParameterSetDescription &pset)
ObjME elePt_eventHT_
Definition: TopMonitor.h:152
edm::EDGetTokenT< reco::VertexCollection > vtxToken_
Definition: TopMonitor.h:88
JetFloatAssociation::Container JetTagCollection
Definition: JetTag.h:18
std::vector< ObjME > bjetCSV_
Definition: TopMonitor.h:188
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:40
ObjME muMulti_
Definition: TopMonitor.h:147
std::vector< ObjME > eleEtaPhi_
Definition: TopMonitor.h:207
const Point & position() const
position
Definition: Vertex.h:109
void setMETitle(ObjME &me, const std::string &titleX, const std::string &titleY)
std::vector< double > muPt_variable_binning_
Definition: TopMonitor.h:113
ObjME metME_variableBinning_
Definition: TopMonitor.h:132
StringCutObjectSelector< reco::Vertex, true > vtxSelection_
Definition: TopMonitor.h:225
ObjME metME_
Definition: TopMonitor.h:131
static const double deltaEta
Definition: CaloConstants.h:8
MEbinning met_binning_
Definition: TopMonitor.h:96
std::vector< Muon > MuonCollection
collection of Muon objects
Definition: MuonFwd.h:9
edm::EDGetTokenT< reco::PFMETCollection > metToken_
Definition: TopMonitor.h:81
void Fill(long long x)
ObjME eventMHT_
Definition: TopMonitor.h:162
double bJetDeltaEtaMax_
Definition: TopMonitor.h:234
ObjME bjetVsLS_
Definition: TopMonitor.h:140
std::string folderName_
Definition: TopMonitor.h:78
ObjME metVsLS_
Definition: TopMonitor.h:133
TopMonitor(const edm::ParameterSet &)
Definition: TopMonitor.cc:17
edm::EDGetTokenT< reco::MuonCollection > muoToken_
Definition: TopMonitor.h:84
virtual double phi() const final
momentum azimuthal angle
PVcut lepPVcuts_
Definition: TopMonitor.h:241
U second(std::pair< T, U > const &p)
std::vector< ObjME > jetPt_variableBinning_
Definition: TopMonitor.h:192
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
ObjME elePt_jetPt_
Definition: TopMonitor.h:151
std::vector< ObjME > muPhi_
Definition: TopMonitor.h:172
std::vector< double > HT_variable_binning_
Definition: TopMonitor.h:111
edm::EDGetTokenT< reco::JetTagCollection > jetTagToken_
Definition: TopMonitor.h:86
std::vector< ObjME > muPt_variableBinning_
Definition: TopMonitor.h:190
int iEvent
Definition: GenABIO.cc:230
ObjME metPhiME_
Definition: TopMonitor.h:134
unsigned int njets_
Definition: TopMonitor.h:229
MonitorElement * denominator
std::vector< ObjME > bjetPt_
Definition: TopMonitor.h:187
ObjME jetMulti_
Definition: TopMonitor.h:145
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
StringCutObjectSelector< reco::PFJet, true > HTdefinition_
Definition: TopMonitor.h:222
std::vector< double > invMass_mumu_variable_binning_
Definition: TopMonitor.h:119
vector< PseudoJet > jets
std::vector< double > MHT_variable_binning_
Definition: TopMonitor.h:120
bool usePVcuts_
Definition: TopMonitor.h:242
ObjME invMass_mumu_variableBinning_
Definition: TopMonitor.h:163
std::vector< ObjME > muEtaPhi_
Definition: TopMonitor.h:209
edm::EDGetTokenT< edm::View< reco::GsfElectron > > eleToken_
Definition: TopMonitor.h:83
std::vector< ObjME > jetEta_
Definition: TopMonitor.h:181
unsigned int nelectrons_
Definition: TopMonitor.h:230
def pv(vc)
Definition: MetAnalyzer.py:6
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
unsigned int nmuons_
Definition: TopMonitor.h:231
ObjME bjetMulti_
Definition: TopMonitor.h:149
ObjME eleVsLS_
Definition: TopMonitor.h:138
std::vector< double > met_variable_binning_
Definition: TopMonitor.h:110
std::vector< ObjME > jetPhi_
Definition: TopMonitor.h:180
std::vector< ObjME > eleEta_
Definition: TopMonitor.h:177
std::vector< ObjME > muPtEta_
Definition: TopMonitor.h:208
const int mu
Definition: Constants.h:22
ParameterDescriptionBase * add(U const &iLabel, T const &value)
bool isValid() const
Definition: HandleBase.h:74
StringCutObjectSelector< reco::Muon, true > muoSelection_
Definition: TopMonitor.h:221
bool applyMETcut_
Definition: TopMonitor.h:244
std::vector< double > jetPt_variable_binning_2D_
Definition: TopMonitor.h:123
double MHTcut_
Definition: TopMonitor.h:251
std::vector< double > HT_variable_binning_2D_
Definition: TopMonitor.h:122
MEbinning MHT_binning_
Definition: TopMonitor.h:107
std::vector< double > phi_variable_binning_2D_
Definition: TopMonitor.h:129
std::vector< ObjME > jetPt_
Definition: TopMonitor.h:182
double HTcut_
Definition: TopMonitor.h:235
std::vector< ObjME > eleEta_variableBinning_
Definition: TopMonitor.h:197
ObjME elePt_muPt_
Definition: TopMonitor.h:158
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
std::vector< ObjME > elePhi_
Definition: TopMonitor.h:176
std::vector< double > jetEta_variable_binning_2D_
Definition: TopMonitor.h:126
ObjME invMass_mumu_
Definition: TopMonitor.h:161
std::vector< ObjME > bjetEta_variableBinning_
Definition: TopMonitor.h:200
std::vector< double > muPt_variable_binning_2D_
Definition: TopMonitor.h:124
StringCutObjectSelector< reco::MET, true > metSelection_
Definition: TopMonitor.h:218
StringCutObjectSelector< reco::PFJet, true > MHTdefinition_
Definition: TopMonitor.h:250
def ls(path, rec=False)
Definition: eostools.py:348
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:277
unsigned int nbjets_
Definition: TopMonitor.h:237
std::map< edm::RefToBase< reco::Jet >, float, JetRefCompare > JetTagMap
Definition: TopMonitor.h:72
T const * product() const
Definition: Handle.h:81
met
===> hadronic RAZOR
std::vector< ObjME > elePt_
Definition: TopMonitor.h:178
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
Definition: TopMonitor.cc:141
StringCutObjectSelector< reco::GsfElectron, true > eleSelection_
Definition: TopMonitor.h:220
std::vector< ObjME > bjetEtaPhi_
Definition: TopMonitor.h:212
ObjME htVsLS_
Definition: TopMonitor.h:141
std::vector< double > elePt_variable_binning_
Definition: TopMonitor.h:114
void add(std::string const &label, ParameterSetDescription const &psetDescription)
def remove(d, key, TELL=False)
Definition: MatrixUtil.py:209
MEbinning csv_binning_
Definition: TopMonitor.h:104
double workingpoint_
Definition: TopMonitor.h:238
ObjME mu1Eta_mu2Eta_
Definition: TopMonitor.h:157
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: TopMonitor.cc:869
std::unique_ptr< GenericTriggerEventFlag > den_genTriggerEventFlag_
Definition: TopMonitor.h:216
double invMassUppercut_
Definition: TopMonitor.h:247
std::vector< ObjME > bjetEta_
Definition: TopMonitor.h:186
edm::EventID id() const
Definition: EventBase.h:60
std::vector< PFJet > PFJetCollection
collection of PFJet objects
fixed size matrix
HLT enums.
void analyze(edm::Event const &iEvent, edm::EventSetup const &iSetup) override
Definition: TopMonitor.cc:464
MEbinning DR_binning_
Definition: TopMonitor.h:102
std::vector< ObjME > elePtEta_
Definition: TopMonitor.h:206
bool opsign_
Definition: TopMonitor.h:249
edm::EDGetTokenT< reco::PFJetCollection > jetToken_
Definition: TopMonitor.h:82
MEbinning phi_binning_
Definition: TopMonitor.h:98
MEbinning eta_binning_
Definition: TopMonitor.h:100
ObjME eleMulti_
Definition: TopMonitor.h:146
double mll
Definition: TopMonitor.h:252
double leptJetDeltaRmin_
Definition: TopMonitor.h:232
std::vector< double > muEta_variable_binning_2D_
Definition: TopMonitor.h:127
MEbinning ls_binning_
Definition: TopMonitor.h:97
std::vector< double > eleEta_variable_binning_2D_
Definition: TopMonitor.h:128
std::unique_ptr< GenericTriggerEventFlag > num_genTriggerEventFlag_
Definition: TopMonitor.h:215
double invMassLowercut_
Definition: TopMonitor.h:248
~TopMonitor() override
Definition: TopMonitor.cc:135
MEbinning pt_binning_
Definition: TopMonitor.h:99
void bookME(DQMStore::IBooker &, ObjME &me, const std::string &histname, const std::string &histtitle, unsigned nbins, double xmin, double xmax)
Definition: Run.h:42
size_type size() const
ObjME eventHT_variableBinning_
Definition: TopMonitor.h:170
std::vector< ObjME > muEta_variableBinning_
Definition: TopMonitor.h:196
std::vector< ObjME > bjetPhi_
Definition: TopMonitor.h:185
std::vector< double > eleEta_variable_binning_
Definition: TopMonitor.h:117
ObjME eventHT_
Definition: TopMonitor.h:169
Collection of PF MET.