00001
00002 #ifndef HLTriggerOffline_TopValidation_H
00003 #define HLTriggerOffline_TopValidation_H
00004
00005
00006
00007 #include <memory>
00008 #include <string>
00009
00010
00011 #include "FWCore/Framework/interface/Frameworkfwd.h"
00012 #include "FWCore/Framework/interface/EDAnalyzer.h"
00013 #include "FWCore/Framework/interface/Event.h"
00014 #include "FWCore/Framework/interface/MakerMacros.h"
00015 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00016
00017 #include "DataFormats/Common/interface/Ref.h"
00018 #include "DataFormats/Common/interface/DetSetVector.h"
00019 #include "DataFormats/Candidate/interface/Candidate.h"
00020 #include "DataFormats/JetReco/interface/Jet.h"
00021 #include "DataFormats/JetReco/interface/CaloJetCollection.h"
00022 #include "DataFormats/TrackReco/interface/Track.h"
00023 #include "DataFormats/TrackReco/interface/TrackExtra.h"
00024 #include "DataFormats/CaloTowers/interface/CaloTowerCollection.h"
00025
00026 #include "DataFormats/MuonReco/interface/MuonFwd.h"
00027 #include "DataFormats/MuonReco/interface/Muon.h"
00028 #include "DataFormats/METReco/interface/MET.h"
00029 #include "DataFormats/METReco/interface/CaloMETCollection.h"
00030 #include "DataFormats/METReco/interface/GenMET.h"
00031 #include "DataFormats/METReco/interface/GenMETCollection.h"
00032
00033
00034
00035 #include <DataFormats/HepMCCandidate/interface/GenParticle.h>
00036 #include "DataFormats/Candidate/interface/Candidate.h"
00037 #include "DataFormats/RecoCandidate/interface/RecoCandidate.h"
00038
00039
00040
00041 #include "DataFormats/VertexReco/interface/Vertex.h"
00042 #include "RecoVertex/PrimaryVertexProducer/interface/PrimaryVertexSorter.h"
00043 #include "DataFormats/Common/interface/Handle.h"
00044 #include "DataFormats/Common/interface/TriggerResults.h"
00045 #include "DataFormats/Common/interface/RefToBase.h"
00046 #include "HLTrigger/HLTfilters/interface/HLTHighLevel.h"
00047 #include "DataFormats/EgammaCandidates/interface/GsfElectron.h"
00048 #include "DataFormats/EgammaCandidates/interface/GsfElectronFwd.h"
00049
00050 #include "DataFormats/EgammaCandidates/interface/Electron.h"
00051 #include "DataFormats/EgammaCandidates/interface/ElectronFwd.h"
00052 #include "DataFormats/EgammaReco/interface/SuperCluster.h"
00053 #include "DataFormats/EgammaReco/interface/BasicCluster.h"
00054 #include "DataFormats/EgammaReco/interface/BasicClusterFwd.h"
00055
00056 #include "FWCore/ServiceRegistry/interface/Service.h"
00057 #include "PhysicsTools/UtilAlgos/interface/TFileService.h"
00058
00059
00060
00061 #include "DQMServices/Core/interface/DQMStore.h"
00062 #include "DQMServices/Core/interface/MonitorElement.h"
00063
00064
00065
00066
00067 #include "TH1F.h"
00068 #include "TVector3.h"
00069 #include "TLorentzVector.h"
00070 #include <string.h>
00071 #include <sstream>
00072 #include <stdlib.h>
00073 #include <string.h>
00074 #include <math.h>
00075 #include <TMath.h>
00076 #include "TFile.h"
00077
00078
00079
00080 class TH1F;
00081
00082
00083
00084
00085
00086 class TopValidation : public edm::EDAnalyzer {
00087 public:
00088 explicit TopValidation(const edm::ParameterSet&);
00089 ~TopValidation();
00090
00091
00092 private:
00093 virtual void beginJob(const edm::EventSetup&) ;
00094 virtual void analyze(const edm::Event&, const edm::EventSetup&);
00095 virtual void endJob() ;
00096
00097
00098
00099
00100
00101
00102 string fOutputFileName ;
00103
00104 std::string outFile_, outputFileName;
00105
00106 bool outputMEsInRootFile;
00107
00108
00109
00110 edm::ParameterSet parameters;
00111
00112 DQMStore* dbe;
00114
00115
00116 MonitorElement* eta_trig_off_mu;
00117 MonitorElement* eta_off_mu;
00118 MonitorElement* pt_trig_off_mu;
00119 MonitorElement* pt_off_mu;
00120
00121
00122
00123 MonitorElement* eta_trig_off_dimu0;
00124 MonitorElement* eta_off_dimu0;
00125 MonitorElement* pt_trig_off_dimu0;
00126 MonitorElement* pt_off_dimu0;
00127
00128 MonitorElement* eta_trig_off_dimu1;
00129 MonitorElement* eta_off_dimu1;
00130 MonitorElement* pt_trig_off_dimu1;
00131 MonitorElement* pt_off_dimu1;
00132
00133
00134 MonitorElement* eta_trig_off_el;
00135 MonitorElement* eta_off_el;
00136 MonitorElement* pt_trig_off_el;
00137 MonitorElement* pt_off_el;
00138 MonitorElement* pt_trig_off_el_ni;
00139 MonitorElement* pt_trig_off_el_li;
00140 MonitorElement* eta_trig_off_el_ni;
00141 MonitorElement* eta_trig_off_el_li;
00142
00143
00144 MonitorElement* eta_trig_off_diel0;
00145 MonitorElement* eta_off_diel0;
00146 MonitorElement* pt_trig_off_diel0;
00147 MonitorElement* pt_off_diel0;
00148
00149 MonitorElement* eta_trig_off_diel1;
00150 MonitorElement* eta_off_diel1;
00151 MonitorElement* pt_trig_off_diel1;
00152 MonitorElement* pt_off_diel1;
00153
00154
00155 MonitorElement* eta_trig_off_emu_muon;
00156 MonitorElement* eta_off_emu_muon;
00157 MonitorElement* pt_trig_off_emu_muon;
00158 MonitorElement* pt_off_emu_muon;
00159
00160 MonitorElement* eta_trig_off_emu_electron;
00161 MonitorElement* eta_off_emu_electron;
00162 MonitorElement* pt_trig_off_emu_electron;
00163 MonitorElement* pt_off_emu_electron;
00164
00165
00166
00168 TH1F* Nttbar;
00169 TH1F* Ndilep;
00170 TH1F* Nsemilep;
00171 TH1F* Nhadronic;
00172 TH1F* Nsemimu;
00173 TH1F* Nsemiel;
00174 TH1F* Nsemitau;
00175 TH1F* Ndimu;
00176 TH1F* Ndiel;
00177 TH1F* Nemu;
00178 TH1F* Nditau;
00179 TH1F* Ntaumu;
00180 TH1F* Ntauel;
00181
00182
00183
00184
00186 TH1F* acceptmu;
00187 TH1F* acceptel;
00188 TH1F* acceptdimu;
00189 TH1F* acceptdiel;
00190 TH1F* acceptemu;
00191
00192 TH1F* acceptmufromtau;
00193 TH1F* acceptelfromtau;
00194 TH1F* acceptdimufromtau;
00195 TH1F* acceptdielfromtau;
00196 TH1F* acceptemufromtau;
00197
00199
00201 TH1F* Noffmu;
00202
00203 TH1F* hlt1muon_off_semimu;
00204 TH1F* hlt1muon_semimu;
00205 TH1F* off_hlt1muon_semimu;
00206
00207 TH1F* hlt1muoniso_semimu;
00208 TH1F* off_hlt1muoniso_semimu;
00209 TH1F* hlt1muoniso_off_semimu;
00210
00211 TH1F* hlt1elecrelax_semimu;
00212 TH1F* off_hlt1elecrelax_semimu;
00213 TH1F* hlt1elecrelax_off_semimu;
00214
00215 TH1F* hlt1elec_semimu;
00216 TH1F* off_hlt1elec_semimu;
00217 TH1F* hlt1elec_off_semimu;
00218
00219 TH1F* hlt2muon_semimu;
00220 TH1F* off_hlt2muon_semimu;
00221 TH1F* hlt2muon_off_semimu;
00222
00223 TH1F* hlt2elec_semimu;
00224 TH1F* off_hlt2elec_semimu;
00225 TH1F* hlt2elec_off_semimu;
00226
00227 TH1F* hltelecmu_semimu;
00228 TH1F* off_hltelecmu_semimu;
00229 TH1F* hltelecmu_off_semimu;
00230
00231 TH1F* hltelecmurelax_semimu;
00232 TH1F* off_hltelecmurelax_semimu;
00233 TH1F* hltelecmurelax_off_semimu;
00234
00235 TH1F* hlt1jet_semimu;
00236 TH1F* off_hlt1jet_semimu;
00237 TH1F* hlt1jet_off_semimu;
00238
00239
00240
00241 TH1F* hlt4jet30_semimu;
00242 TH1F* hlt4jet30_off_semimu;
00243 TH1F* hlt1elec15_li_semimu;
00244 TH1F* hlt1elec15_li_off_semimu;
00245 TH1F* hlt1elec15_ni_semimu;
00246 TH1F* hlt1elec15_ni_off_semimu;
00247
00248
00250
00251 TH1F* Noffel;
00252
00253 TH1F* hlt1muon_off_semiel;
00254 TH1F* hlt1muon_semiel;
00255 TH1F* off_hlt1muon_semiel;
00256
00257 TH1F* hlt1muoniso_semiel;
00258 TH1F* off_hlt1muoniso_semiel;
00259 TH1F* hlt1muoniso_off_semiel;
00260
00261 TH1F* hlt1elecrelax_semiel;
00262 TH1F* off_hlt1elecrelax_semiel;
00263 TH1F* hlt1elecrelax_off_semiel;
00264
00265 TH1F* hlt1elec_semiel;
00266 TH1F* off_hlt1elec_semiel;
00267 TH1F* hlt1elec_off_semiel;
00268
00269 TH1F* hlt2muon_semiel;
00270 TH1F* off_hlt2muon_semiel;
00271 TH1F* hlt2muon_off_semiel;
00272
00273 TH1F* hlt2elec_semiel;
00274 TH1F* off_hlt2elec_semiel;
00275 TH1F* hlt2elec_off_semiel;
00276
00277 TH1F* hltelecmu_semiel;
00278 TH1F* off_hltelecmu_semiel;
00279 TH1F* hltelecmu_off_semiel;
00280
00281 TH1F* hltelecmurelax_semiel;
00282 TH1F* off_hltelecmurelax_semiel;
00283 TH1F* hltelecmurelax_off_semiel;
00284
00285 TH1F* hlt1jet_semiel;
00286 TH1F* off_hlt1jet_semiel;
00287 TH1F* hlt1jet_off_semiel;
00288
00289
00290
00291 TH1F* hlt4jet30_semiel;
00292 TH1F* hlt4jet30_off_semiel;
00293 TH1F* hlt1elec15_li_semiel;
00294 TH1F* hlt1elec15_li_off_semiel;
00295 TH1F* hlt1elec15_ni_semiel;
00296 TH1F* hlt1elec15_ni_off_semiel;
00297
00298
00299
00301
00302 TH1F* Noffdimu;
00303
00304 TH1F* hlt1muon_off_dimu;
00305 TH1F* hlt1muon_dimu;
00306 TH1F* off_hlt1muon_dimu;
00307
00308
00309 TH1F* hlt1muoniso_dimu;
00310 TH1F* off_hlt1muoniso_dimu;
00311 TH1F* hlt1muoniso_off_dimu;
00312
00313 TH1F* hlt1elecrelax_dimu;
00314 TH1F* off_hlt1elecrelax_dimu;
00315 TH1F* hlt1elecrelax_off_dimu;
00316
00317 TH1F* hlt1elec_dimu;
00318 TH1F* off_hlt1elec_dimu;
00319 TH1F* hlt1elec_off_dimu;
00320
00321 TH1F* hlt2muon_dimu;
00322 TH1F* off_hlt2muon_dimu;
00323 TH1F* hlt2muon_off_dimu;
00324
00325 TH1F* hlt2elec_dimu;
00326 TH1F* off_hlt2elec_dimu;
00327 TH1F* hlt2elec_off_dimu;
00328
00329 TH1F* hltelecmu_dimu;
00330 TH1F* off_hltelecmu_dimu;
00331 TH1F* hltelecmu_off_dimu;
00332
00333 TH1F* hltelecmurelax_dimu;
00334 TH1F* off_hltelecmurelax_dimu;
00335 TH1F* hltelecmurelax_off_dimu;
00336
00337 TH1F* hlt1jet_dimu;
00338 TH1F* off_hlt1jet_dimu;
00339 TH1F* hlt1jet_off_dimu;
00340
00341
00342
00343 TH1F* hlt4jet30_dimu;
00344 TH1F* hlt4jet30_off_dimu;
00345 TH1F* hlt1elec15_li_dimu;
00346 TH1F* hlt1elec15_li_off_dimu;
00347 TH1F* hlt1elec15_ni_dimu;
00348 TH1F* hlt1elec15_ni_off_dimu;
00349
00350
00351
00353
00354 TH1F* Noffdiel;
00355
00356 TH1F* hlt1muon_off_diel;
00357 TH1F* hlt1muon_diel;
00358 TH1F* off_hlt1muon_diel;
00359
00360
00361 TH1F* hlt1muoniso_diel;
00362 TH1F* off_hlt1muoniso_diel;
00363 TH1F* hlt1muoniso_off_diel;
00364
00365 TH1F* hlt1elecrelax_diel;
00366 TH1F* off_hlt1elecrelax_diel;
00367 TH1F* hlt1elecrelax_off_diel;
00368
00369 TH1F* hlt1elec_diel;
00370 TH1F* off_hlt1elec_diel;
00371 TH1F* hlt1elec_off_diel;
00372
00373 TH1F* hlt2muon_diel;
00374 TH1F* off_hlt2muon_diel;
00375 TH1F* hlt2muon_off_diel;
00376
00377 TH1F* hlt2elec_diel;
00378 TH1F* off_hlt2elec_diel;
00379 TH1F* hlt2elec_off_diel;
00380
00381 TH1F* hltelecmu_diel;
00382 TH1F* off_hltelecmu_diel;
00383 TH1F* hltelecmu_off_diel;
00384
00385 TH1F* hltelecmurelax_diel;
00386 TH1F* off_hltelecmurelax_diel;
00387 TH1F* hltelecmurelax_off_diel;
00388
00389 TH1F* hlt1jet_diel;
00390 TH1F* off_hlt1jet_diel;
00391 TH1F* hlt1jet_off_diel;
00392
00393
00394
00395 TH1F* hlt4jet30_diel;
00396 TH1F* hlt4jet30_off_diel;
00397 TH1F* hlt1elec15_li_diel;
00398 TH1F* hlt1elec15_li_off_diel;
00399 TH1F* hlt1elec15_ni_diel;
00400 TH1F* hlt1elec15_ni_off_diel;
00401
00402
00404
00405 TH1F* Noffemu;
00406
00407 TH1F* hlt1muon_off_emu;
00408 TH1F* hlt1muon_emu;
00409 TH1F* off_hlt1muon_emu;
00410
00411
00412 TH1F* hlt1muoniso_emu;
00413 TH1F* off_hlt1muoniso_emu;
00414 TH1F* hlt1muoniso_off_emu;
00415
00416 TH1F* hlt1elecrelax_emu;
00417 TH1F* off_hlt1elecrelax_emu;
00418 TH1F* hlt1elecrelax_off_emu;
00419
00420 TH1F* hlt1elec_emu;
00421 TH1F* off_hlt1elec_emu;
00422 TH1F* hlt1elec_off_emu;
00423
00424 TH1F* hlt2muon_emu;
00425 TH1F* off_hlt2muon_emu;
00426 TH1F* hlt2muon_off_emu;
00427
00428 TH1F* hlt2elec_emu;
00429 TH1F* off_hlt2elec_emu;
00430 TH1F* hlt2elec_off_emu;
00431
00432 TH1F* hltelecmu_emu;
00433 TH1F* off_hltelecmu_emu;
00434 TH1F* hltelecmu_off_emu;
00435
00436 TH1F* hltelecmurelax_emu;
00437 TH1F* off_hltelecmurelax_emu;
00438 TH1F* hltelecmurelax_off_emu;
00439
00440 TH1F* hlt1jet_emu;
00441 TH1F* off_hlt1jet_emu;
00442 TH1F* hlt1jet_off_emu;
00443
00444 TH1F* OR_emu;
00445 TH1F* OR_off_emu;
00446 TH1F* OR_emu_li;
00447 TH1F* OR_emu_ni;
00448 TH1F* OR_off_emu_li;
00449 TH1F* OR_off_emu_ni;
00450
00451
00452
00453 TH1F* hlt4jet30_emu;
00454 TH1F* hlt4jet30_off_emu;
00455 TH1F* hlt1elec15_li_emu;
00456 TH1F* hlt1elec15_li_off_emu;
00457 TH1F* hlt1elec15_ni_emu;
00458 TH1F* hlt1elec15_ni_off_emu;
00459
00460
00461
00462
00463
00464 unsigned int nEvents;
00465 unsigned int nAccepted;
00466 unsigned int n_top;
00467 unsigned int n_w;
00468 unsigned int n_z;
00469
00470
00471 unsigned int dilepEvent,semilepEvent,hadronicEvent;
00472 unsigned int dimuEvent,dielEvent,emuEvent,muEvent,tauEvent,elecEvent,taumuEvent,tauelEvent,ditauEvent;
00473
00474 unsigned int munoiso;
00475
00476 TString name51,name50,name33,name0,name32,name35,name92,name93,name53;
00477 TString name52,name34,name54,name36,name94,name1;
00478
00479
00480 void efficiencies (TH1F *select, TH1F *path1,TH1F *path2, TH1F *path3, TH1F *path4,
00481 TH1F* path5, TH1F *path6, TH1F *path7, TH1F *path8, TH1F *path9, TH1F *path10,
00482 TH1F* path11, TH1F* path12);
00483
00484
00485
00486 edm::InputTag inputTag_;
00487 edm::TriggerNames triggerNames_;
00488
00489
00490
00491
00492 std::string triggerTag_;
00493
00494
00495
00496
00497 MonitorElement *l1eteff;
00498 MonitorElement *l2eteff;
00499 MonitorElement *l25eteff;
00500 MonitorElement *l3eteff;
00501
00502 MonitorElement *refEt;
00503 MonitorElement *refEta;
00504
00505 MonitorElement *l1etaeff;
00506 MonitorElement *l2etaeff;
00507 MonitorElement *l25etaeff;
00508 MonitorElement *l3etaeff;
00509
00510 MonitorElement *accepted_events;
00511 MonitorElement *accepted_events_matched;
00512
00513
00514
00515 bool HLT1MuonNonIso;
00516 bool HLT2MuonNonIso ;
00517 bool HLT1MuonIso;
00518 bool HLT1ElectronRelaxed;
00519 bool HLT2ElectronRelaxed;
00520 bool HLTXElectronMuon;
00521 bool HLT1Electron;
00522 bool HLTXElectronMuonRelaxed;
00523 bool HLT1jet;
00524
00525 bool HLT4jet30 ;
00526 bool HLT1Electron15_NI ;
00527 bool HLT1Electron15_LI ;
00528
00529
00530 };
00531
00532
00533 #endif