00001
00002
00003
00004 #include "DQMOffline/Trigger/interface/HLTTauL1DQMOfflineSource.h"
00005 #include "Math/GenVector/VectorUtil.h"
00006 #include <iostream>
00007 #include <iomanip>
00008 #include <fstream>
00009
00010
00011
00012
00013 HLTTauL1DQMOfflineSource::HLTTauL1DQMOfflineSource(const edm::ParameterSet& iConfig):
00014
00015 _refTauColl(iConfig.getUntrackedParameter<edm::InputTag>("RefTauCollection")),
00016 _refElecColl(iConfig.getUntrackedParameter<edm::InputTag>("RefElecCollection")),
00017 _refMuonColl(iConfig.getUntrackedParameter<edm::InputTag>("RefMuonCollection")),
00018
00019 _L1extraTauJetSource(iConfig.getParameter<edm::InputTag>("L1extraTauJetSource")),
00020 _L1extraCenJetSource(iConfig.getParameter<edm::InputTag>("L1extraCenJetSource")),
00021 _L1extraForJetSource(iConfig.getParameter<edm::InputTag>("L1extraForJetSource")),
00022 _L1extraMuonSource(iConfig.getParameter<edm::InputTag>("L1extraMuonSource")),
00023 _L1extraMETSource(iConfig.getParameter<edm::InputTag>("L1extraMETSource")),
00024 _L1extraNonIsoEgammaSource(iConfig.getParameter<edm::InputTag>("L1extraNonIsoEgammaSource")),
00025 _L1extraIsoEgammaSource(iConfig.getParameter<edm::InputTag>("L1extraIsoEgammaSource")),
00026
00027 _SingleTauThreshold(iConfig.getParameter<double>("SingleTauThreshold")),
00028 _DoubleTauThreshold(iConfig.getParameter<double>("DoubleTauThreshold")),
00029 _SingleTauMETThresholds(iConfig.getParameter< std::vector<double> >("SingleTauMETThresholds")),
00030 _MuTauThresholds(iConfig.getParameter< std::vector<double> >("MuTauThresholds")),
00031 _IsoEgTauThresholds(iConfig.getParameter< std::vector<double> >("IsoEgTauThresholds")),
00032
00033 _L1MCTauMinDeltaR(iConfig.getParameter<double>("L1RefTauMinDeltaR")),
00034 _MCTauHadMinEt(iConfig.getParameter<double>("RefTauHadMinEt")),
00035 _MCTauHadMaxAbsEta(iConfig.getParameter<double>("RefTauHadMaxAbsEta")),
00036
00037 _L1MCElecMinDeltaR(iConfig.getParameter<double>("L1RefElecMinDeltaR")),
00038 _MCElecMinEt(iConfig.getParameter<double>("RefElecMinEt")),
00039 _MCElecMaxAbsEta(iConfig.getParameter<double>("RefElecMaxAbsEta")),
00040
00041 _L1MCMuonMinDeltaR(iConfig.getParameter<double>("L1RefMuonMinDeltaR")),
00042 _MCMuonMinEt(iConfig.getParameter<double>("RefMuonMinEt")),
00043 _MCMuonMaxAbsEta(iConfig.getParameter<double>("RefMuonMaxAbsEta")),
00044
00045 _triggerTag((iConfig.getParameter<std::string>("TriggerTag"))),
00046 _outFile(iConfig.getParameter<std::string>("OutputFileName"))
00047
00048 {
00049 DQMStore* store = &*edm::Service<DQMStore>();
00050
00051 if(store)
00052 {
00053
00054 store->setCurrentFolder(_triggerTag);
00055 h_L1TauEt = store->book1D("L1TauEt","L1TauEt",50,0.,100.);
00056
00057 h_L1TauEta = store->book1D("L1TauEta","L1TauEta",60,-4.,4.);
00058 h_L1TauEta->getTH1F()->Sumw2();
00059 h_L1TauPhi = store->book1D("L1TauPhi","L1TauPhi",50,-3.2,3.2);
00060 h_L1TauPhi->getTH1F()->Sumw2();
00061
00062 h_L1Tau1Et = store->book1D("L1Tau1Et","L1Tau1Et",50,0.,100.);
00063 h_L1Tau1Et->getTH1F()->Sumw2();
00064 h_L1Tau1Eta = store->book1D("L1Tau1Eta","L1Tau1Eta",60,-4.,4.);
00065 h_L1Tau1Eta->getTH1F()->Sumw2();
00066 h_L1Tau1Phi = store->book1D("L1Tau1Phi","L1Tau1Phi",50,-3.2,3.2);
00067 h_L1Tau1Phi->getTH1F()->Sumw2();
00068
00069 h_L1Tau2Et = store->book1D("L1Tau2Et","L1Tau2Et",50,0.,100.);
00070 h_L1Tau2Et->getTH1F()->Sumw2();
00071 h_L1Tau2Eta = store->book1D("L1Tau2Eta","L1Tau2Eta",60,-4.,4.);
00072 h_L1Tau2Eta->getTH1F()->Sumw2();
00073 h_L1Tau2Phi = store->book1D("L1Tau2Phi","L1Tau2Phi",50,-3.2,3.2);
00074 h_L1Tau2Phi->getTH1F()->Sumw2();
00075
00076
00077 h_L1IsoEg1Et = store->book1D("L1IsoEg1Et","L1IsoEg1Et",80,0.,80.);
00078 h_L1IsoEg1Et->getTH1F()->Sumw2();
00079 h_L1IsoEg1Eta = store->book1D("L1IsoEg1Eta","L1IsoEg1Eta",60,-4.,4.);
00080 h_L1IsoEg1Eta->getTH1F()->Sumw2();
00081 h_L1IsoEg1Phi = store->book1D("L1IsoEg1Phi","L1IsoEg1Phi",50,-3.2,3.2);
00082 h_L1IsoEg1Phi->getTH1F()->Sumw2();
00083
00084 h_L1Muon1Et = store->book1D("L1Muon1Et","L1Muon1Et",80,0.,80.);
00085 h_L1Muon1Et->getTH1F()->Sumw2();
00086 h_L1Muon1Eta = store->book1D("L1Muon1Eta","L1Muon1Eta",60,-4.,4.);
00087 h_L1Muon1Eta->getTH1F()->Sumw2();
00088 h_L1Muon1Phi = store->book1D("L1Muon1Phi","L1Muon1Phi",50,-3.2,3.2);
00089 h_L1Muon1Phi->getTH1F()->Sumw2();
00090
00091
00092 h_L1Met = store->book1D("L1MetEt","L1MetEt",100,0.,200.);
00093 h_L1Met->getTH1F()->Sumw2();
00094 h_L1MetEta = store->book1D("L1MetEta","L1MetEta",60,-4.,4.);
00095 h_L1MetEta->getTH1F()->Sumw2();
00096 h_L1MetPhi = store->book1D("L1MetPhi","L1MetPhi",50,-3.2,3.2);
00097 h_L1MetPhi->getTH1F()->Sumw2();
00098
00099
00100 h_L1MCTauDeltaR = store->book1D("L1RefTauDeltaR","L1RefTauDeltaR",60,0.,6.);
00101 h_L1MCTauDeltaR->getTH1F()->Sumw2();
00102 h_L1minusMCTauEt = store->book1D("L1minusRefTauEt","L1minusRefTauEt",50,-50.,50.);
00103 h_L1minusMCTauEt->getTH1F()->Sumw2();
00104 h_L1minusMCoverMCTauEt = store->book1D("L1minusMCoverRefTauEt","L1minusRefoverMCTauEt",40,-1.2,1.2);
00105 h_L1minusMCoverMCTauEt->getTH1F()->Sumw2();
00106
00107
00108 h_GenTauHadEt = store->book1D("GenTauHadEt","GenTauHadEt",50,0.,100.);
00109 h_GenTauHadEt->getTH1F()->Sumw2();
00110 h_GenTauHadEta = store->book1D("GenTauHadEta","GenTauHadEt",60,-4.,4.);
00111 h_GenTauHadEta->getTH1F()->Sumw2();
00112 h_GenTauHadPhi = store->book1D("GenTauHadPhi","GenTauHadPhi",50,-3.2,3.2);
00113 h_GenTauHadPhi->getTH1F()->Sumw2();
00114
00115 h_GenTauElecEt = store->book1D("GenTauElecEt","GenTauElecEt",50,0.,100.);
00116 h_GenTauElecEt->getTH1F()->Sumw2();
00117 h_GenTauElecEta = store->book1D("GenTauElecEta","GenTauElecEt",60,-4.,4.);
00118 h_GenTauElecEta->getTH1F()->Sumw2();
00119 h_GenTauElecPhi = store->book1D("GenTauElecPhi","GenTauElecPhi",50,-3.2,3.2);
00120 h_GenTauElecPhi->getTH1F()->Sumw2();
00121
00122 h_GenTauMuonEt = store->book1D("GenTauMuonEt","GenTauMuonEt",50,0.,100.);
00123 h_GenTauMuonEt->getTH1F()->Sumw2();
00124 h_GenTauMuonEta = store->book1D("GenTauMuonEta","GenTauMuonEt",60,-4.,4.);
00125 h_GenTauMuonEta->getTH1F()->Sumw2();
00126 h_GenTauMuonPhi = store->book1D("GenTauMuonPhi","GenTauMuonPhi",50,-3.2,3.2);
00127 h_GenTauMuonPhi->getTH1F()->Sumw2();
00128
00129
00130
00131
00132 h_MCTauElecEt = store->book1D("RefTauElecEt","RefTauElecEt",50,0.,100.);
00133 h_MCTauElecEt->getTH1F()->Sumw2();
00134 h_MCTauElecEta = store->book1D("RefTauElecEta","RefTauElecEta",60,-4.,4.);
00135 h_MCTauElecEta->getTH1F()->Sumw2();
00136 h_MCTauElecPhi = store->book1D("RefTauElecPhi","RefTauElecPhi",50,-3.2,3.2);
00137 h_MCTauElecPhi->getTH1F()->Sumw2();
00138
00139 h_L1MCMatchedTauElecEt = store->book1D("L1RefMatchedTauElecEt","L1RefMatchedTauElecEt",50,0.,100.);
00140 h_L1MCMatchedTauElecEt->getTH1F()->Sumw2();
00141 h_L1MCMatchedTauElecEta = store->book1D("L1RefMatchedTauElecEta","L1RefMatchedTauElecEta",60,-4.,4.);
00142 h_L1MCMatchedTauElecEta->getTH1F()->Sumw2();
00143 h_L1MCMatchedTauElecPhi = store->book1D("L1RefMatchedTauElecPhi","L1RefMatchedTauElecPhi",50,-3.2,3.2);
00144 h_L1MCMatchedTauElecPhi->getTH1F()->Sumw2();
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157 h_MCTauMuonEt = store->book1D("RefTauMuonEt","RefTauMuonEt",50,0.,100.);
00158 h_MCTauMuonEt->getTH1F()->Sumw2();
00159 h_MCTauMuonEta = store->book1D("RefTauMuonEta","RefTauMuonEta",60,-4.,4.);
00160 h_MCTauMuonEta->getTH1F()->Sumw2();
00161 h_MCTauMuonPhi = store->book1D("RefTauMuonPhi","RefTauMuonPhi",50,-3.2,3.2);
00162 h_MCTauMuonPhi->getTH1F()->Sumw2();
00163
00164 h_L1MCMatchedTauMuonEt = store->book1D("L1RefMatchedTauMuonEt","L1RefMatchedTauMuonEt",50,0.,100.);
00165 h_L1MCMatchedTauMuonEt->getTH1F()->Sumw2();
00166 h_L1MCMatchedTauMuonEta = store->book1D("L1RefMatchedTauMuonEta","L1RefMatchedTauMuonEta",60,-4.,4.);
00167 h_L1MCMatchedTauMuonEta->getTH1F()->Sumw2();
00168 h_L1MCMatchedTauMuonPhi = store->book1D("L1RefMatchedTauMuonPhi","L1RefMatchedTauMuonPhi",50,-3.2,3.2);
00169 h_L1MCMatchedTauMuonPhi->getTH1F()->Sumw2();
00170
00171
00173
00174
00175
00176
00177
00178
00179
00180
00181 h_MCTauHadEt = store->book1D("RefTauHadEt","RefTauHadEt",50,0.,100.);
00182 h_MCTauHadEt->getTH1F()->Sumw2();
00183 h_MCTauHadEta = store->book1D("RefTauHadEta","RefTauHadEta",60,-4.,4.);
00184 h_MCTauHadEta->getTH1F()->Sumw2();
00185 h_MCTauHadPhi = store->book1D("RefTauHadPhi","RefTauHadPhi",50,-3.2,3.2);
00186 h_MCTauHadPhi->getTH1F()->Sumw2();
00187
00188 h_L1MCMatchedTauEt = store->book1D("L1RefMatchedTauEt","L1RefMatchedTauEt",50,0.,100.);
00189 h_L1MCMatchedTauEt->getTH1F()->Sumw2();
00190 h_L1MCMatchedTauEta = store->book1D("L1RefMatchedTauEta","L1RefMatchedTauEta",60,-4.,4.);
00191 h_L1MCMatchedTauEta->getTH1F()->Sumw2();
00192 h_L1MCMatchedTauPhi = store->book1D("L1RefMatchedTauPhi","L1RefMatchedTauPhi",50,-3.2,3.2);
00193 h_L1MCMatchedTauPhi->getTH1F()->Sumw2();
00194
00195
00196
00197
00198
00199
00200
00201
00202 h_L1SingleTauEffEt = store->book1D("L1SingleTauEffEt","L1SingleTauEffEt",
00203 50,0.,100.);
00204 h_L1SingleTauEffEt->getTH1F()->Sumw2();
00205 h_L1DoubleTauEffEt = store->book1D("L1DoubleTauEffEt","L1DoubleTauEffEt",
00206 40,0.,80.);
00207 h_L1DoubleTauEffEt->getTH1F()->Sumw2();
00208 h_L1SingleTauEffMCMatchEt = store->book1D("L1SingleTauEffRefMatchEt","L1SingleTauEffRefMatchEt",
00209 50,0.,100.);
00210 h_L1SingleTauEffMCMatchEt->getTH1F()->Sumw2();
00211 h_L1DoubleTauEffMCMatchEt = store->book1D("L1DoubleTauEffRefMatchEt","L1DoubleTauEffRefMatchEt",
00212 40,0.,80.);
00213 h_L1DoubleTauEffMCMatchEt->getTH1F()->Sumw2();
00214
00215 h_L1TauMETfixEffEt = store->book1D("L1TauMETfixEffEt","L1TauMETfixEffEt",
00216 50,0.,100.);
00217 h_L1TauMETfixEffEt->getTH1F()->Sumw2();
00218 h_L1TauMETfixEffMCMatchEt = store->book1D("L1TauMETfixEffRefMatchEt","L1TauMETfixEffRefMatchEt",
00219 50,0.,100.);
00220 h_L1TauMETfixEffMCMatchEt->getTH1F()->Sumw2();
00221
00222 h_L1METTaufixEffEt = store->book1D("L1METTaufixEffEt","L1METTaufixEffEt",
00223 50,0.,100.);
00224 h_L1METTaufixEffEt->getTH1F()->Sumw2();
00225 h_L1METTaufixEffMCMatchEt = store->book1D("L1METTaufixEffRefMatchEt","L1METTaufixEffRefMatchEt",
00226 50,0.,100.);
00227 h_L1METTaufixEffMCMatchEt->getTH1F()->Sumw2();
00228
00229 h_L1TauIsoEgfixEffEt = store->book1D("L1TauIsoEgfixEffEt","L1TauIsoEgfixEffEt",
00230 50,0.,100.);
00231 h_L1TauIsoEgfixEffEt->getTH1F()->Sumw2();
00232 h_L1TauIsoEgfixEffMCMatchEt = store->book1D("L1TauIsoEgfixEffRefMatchEt","L1TauIsoEgfixEffRefMatchEt",
00233 50,0.,100.);
00234 h_L1TauIsoEgfixEffMCMatchEt->getTH1F()->Sumw2();
00235 h_L1IsoEgTaufixEffEt = store->book1D("L1IsoEgTaufixEffEt","L1IsoEgTaufixEffEt",
00236 50,0.,100.);
00237 h_L1IsoEgTaufixEffEt->getTH1F()->Sumw2();
00238 h_L1IsoEgTaufixEffMCMatchEt = store->book1D("L1IsoEgTaufixEffRefMatchEt","L1IsoEgTaufixEffRefMatchEt",
00239 50,0.,100.);
00240 h_L1IsoEgTaufixEffMCMatchEt->getTH1F()->Sumw2();
00241
00242 h_L1TauMuonfixEffEt = store->book1D("L1TauMuonfixEffEt","L1TauMuonfixEffEt",
00243 50,0.,100.);
00244 h_L1TauMuonfixEffEt->getTH1F()->Sumw2();
00245 h_L1TauMuonfixEffMCMatchEt = store->book1D("L1TauMuonfixEffRefMatchEt","L1TauMuonfixEffRefMatchEt",
00246 50,0.,100.);
00247 h_L1TauMuonfixEffMCMatchEt->getTH1F()->Sumw2();
00248
00249 h_L1MuonTaufixEffEt = store->book1D("L1MuonTaufixEffEt","L1MuonTaufixEffEt",
00250 50,0.,100.);
00251 h_L1MuonTaufixEffEt->getTH1F()->Sumw2();
00252 h_L1MuonTaufixEffMCMatchEt = store->book1D("L1MuonTaufixEffRefMatchEt","L1MuonTaufixEffRefMatchEt",
00253 50,0.,100.);
00254 h_L1MuonTaufixEffMCMatchEt->getTH1F()->Sumw2();
00255
00256 h_nfidCounter = store->book1D("nfidCounter","NFID COUNTER",5,0.,5.);
00257
00258 }
00259 }
00260
00261
00262 void
00263 HLTTauL1DQMOfflineSource::beginJob(const edm::EventSetup&)
00264 {
00265
00266 _nEvents = 0;
00267
00268 _nfidEventsGenTauHad = 0;
00269 _nfidEventsDoubleGenTauHads = 0;
00270 _nfidEventsGenTauMuonTauHad = 0;
00271 _nfidEventsGenTauElecTauHad = 0;
00272
00273
00274 }
00275
00276 HLTTauL1DQMOfflineSource::~HLTTauL1DQMOfflineSource()
00277 {
00278 }
00279
00280
00281
00282
00283 void
00284 HLTTauL1DQMOfflineSource::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup)
00285 {
00286 using namespace edm;
00287
00288 _nEvents++;
00289 h_nfidCounter->Fill(0.5);
00290
00291
00292 getL1extraObjects(iEvent);
00293 evalL1extraDecisions();
00294
00295
00296 fillL1Histograms();
00297 fillL1MCTauMatchedHists(iEvent);
00298
00299 }
00300
00301
00302
00303
00304 void
00305 HLTTauL1DQMOfflineSource::endJob() {
00306
00307
00308
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319
00320
00321
00322
00323
00324
00325
00326
00327
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342
00343
00344 if(_outFile.size()>0)
00345 if (&*edm::Service<DQMStore>()) edm::Service<DQMStore>()->save (_outFile);
00346 }
00347
00348 void
00349 HLTTauL1DQMOfflineSource::getL1extraObjects(const edm::Event& iEvent)
00350 {
00351 using namespace edm;
00352 using namespace l1extra;
00353
00354
00355 _L1Taus.clear();
00356 Handle<L1JetParticleCollection> l1TauHandle;
00357 iEvent.getByLabel(_L1extraTauJetSource,l1TauHandle);
00358 if (l1TauHandle.isValid()){
00359 for( L1JetParticleCollection::const_iterator itr = l1TauHandle->begin() ;
00360 itr != l1TauHandle->end() ; ++itr ) {
00361 LV p(itr->px(),itr->py(),itr->pz(),itr->energy());
00362 _L1Taus.push_back(p);
00363 }
00364 }
00365
00366 _L1CenJets.clear();
00367 Handle<L1JetParticleCollection> l1CenJetHandle;
00368 iEvent.getByLabel(_L1extraCenJetSource,l1CenJetHandle);
00369 if (l1CenJetHandle.isValid()) {
00370 for( L1JetParticleCollection::const_iterator itr = l1CenJetHandle->begin() ;
00371 itr != l1CenJetHandle->end() ; ++itr ) {
00372 LV p(itr->px(),itr->py(),itr->pz(),itr->energy());
00373 _L1CenJets.push_back(p);
00374 }
00375 }
00376
00377 _L1ForJets.clear();
00378 Handle<L1JetParticleCollection> l1ForJetHandle;
00379 iEvent.getByLabel(_L1extraForJetSource,l1ForJetHandle);
00380 if (l1ForJetHandle.isValid()) {
00381 for( L1JetParticleCollection::const_iterator itr = l1ForJetHandle->begin() ;
00382 itr != l1ForJetHandle->end() ; ++itr ) {
00383 LV p(itr->px(),itr->py(),itr->pz(),itr->energy());
00384 _L1ForJets.push_back(p);
00385 }
00386 }
00387
00388 _L1IsoEgammas.clear();
00389 Handle<L1EmParticleCollection> l1IsoEgammaHandle;
00390 iEvent.getByLabel(_L1extraIsoEgammaSource,l1IsoEgammaHandle);
00391 if (l1IsoEgammaHandle.isValid()) {
00392 for( L1EmParticleCollection::const_iterator itr = l1IsoEgammaHandle->begin() ;
00393 itr != l1IsoEgammaHandle->end() ; ++itr ) {
00394 LV p(itr->px(),itr->py(),itr->pz(),itr->energy());
00395 _L1IsoEgammas.push_back(p);
00396 }
00397 }
00398
00399 _L1NonIsoEgammas.clear();
00400 Handle<L1EmParticleCollection> l1NonIsoEgammaHandle;
00401 iEvent.getByLabel(_L1extraNonIsoEgammaSource,l1NonIsoEgammaHandle);
00402 if (l1NonIsoEgammaHandle.isValid()) {
00403 for( L1EmParticleCollection::const_iterator itr = l1NonIsoEgammaHandle->begin() ;
00404 itr != l1NonIsoEgammaHandle->end() ; ++itr ) {
00405 LV p(itr->px(),itr->py(),itr->pz(),itr->energy());
00406 _L1NonIsoEgammas.push_back(p);
00407 }
00408 }
00409
00410 _L1Muons.clear();
00411 _L1MuQuals.clear();
00412 Handle<L1MuonParticleCollection> l1MuonHandle;
00413 iEvent.getByLabel(_L1extraMuonSource,l1MuonHandle);
00414 if (l1MuonHandle.isValid()) {
00415 for( L1MuonParticleCollection::const_iterator itr = l1MuonHandle->begin() ;
00416 itr != l1MuonHandle->end() ; ++itr ) {
00417 LV p(itr->px(),itr->py(),itr->pz(),itr->energy());
00418 _L1Muons.push_back(p);
00419 L1MuGMTExtendedCand gmtCand = itr->gmtMuonCand();
00420 _L1MuQuals.push_back(gmtCand.quality());
00421 }
00422 }
00423
00424 _L1METs.clear();
00425 Handle<L1EtMissParticleCollection> l1MetHandle;
00426 iEvent.getByLabel(_L1extraMETSource,l1MetHandle);
00427 if (l1MetHandle.isValid()) {
00428 for( L1EtMissParticleCollection::const_iterator itr = l1MetHandle->begin() ;
00429 itr != l1MetHandle->end() ; ++itr ) {
00430 LV p(itr->px(),itr->py(),itr->pz(),itr->energy());
00431 _L1METs.push_back(p);
00432 }
00433 }
00434
00435
00436
00437
00438
00439
00440
00441
00442
00443
00444
00445
00446
00447 }
00448
00449
00450 void
00451 HLTTauL1DQMOfflineSource::fillL1Histograms() {
00452 for (int i=0; i<(int)_L1Taus.size(); i++) {
00453 h_L1TauEt->Fill(_L1Taus[i].Et());
00454 h_L1TauEta->Fill(_L1Taus[i].Eta());
00455 h_L1TauPhi->Fill(_L1Taus[i].Phi());
00456 if (i==0) {
00457 h_L1Tau1Et->Fill(_L1Taus[i].Et());
00458 h_L1Tau1Eta->Fill(_L1Taus[i].Eta());
00459 h_L1Tau1Phi->Fill(_L1Taus[i].Phi());
00460 }
00461 if (i==1) {
00462 h_L1Tau2Et->Fill(_L1Taus[i].Et());
00463 h_L1Tau2Eta->Fill(_L1Taus[i].Eta());
00464 h_L1Tau2Phi->Fill(_L1Taus[i].Phi());
00465 }
00466 }
00467 for (int i=0; i<(int)_L1IsoEgammas.size(); i++) {
00468 if (i==0) {
00469 h_L1IsoEg1Et->Fill(_L1IsoEgammas[i].Et());
00470 h_L1IsoEg1Eta->Fill(_L1IsoEgammas[i].Eta());
00471 h_L1IsoEg1Phi->Fill(_L1IsoEgammas[i].Phi());
00472 }
00473 }
00474 for (int i=0; i<(int)_L1Muons.size(); i++) {
00475 if (i==0) {
00476 h_L1Muon1Et->Fill(_L1Muons[i].Et());
00477 h_L1Muon1Eta->Fill(_L1Muons[i].Eta());
00478 h_L1Muon1Phi->Fill(_L1Muons[i].Phi());
00479 }
00480 }
00481 for (int i=0; i<(int)_L1METs.size(); i++) {
00482 h_L1Met->Fill(_L1METs[i].Et());
00483 h_L1MetEta->Fill(_L1METs[i].Eta());
00484 h_L1MetPhi->Fill(_L1METs[i].Phi());
00485 }
00486
00487 }
00488
00489
00490 void
00491 HLTTauL1DQMOfflineSource::fillL1MCTauMatchedHists(const edm::Event& iEvent) {
00492 using namespace edm;
00493
00494 Handle<LVColl> RefTauH;
00495 iEvent.getByLabel(_refTauColl,RefTauH);
00496 if (!RefTauH.isValid())
00497 {
00498 return;
00499 }
00500 LVColl RefTau = *RefTauH;
00501
00502 int nfidTauHads = 0;
00503 for (int i=0; i<(int)RefTau.size(); i++) {
00504
00505 h_GenTauHadEt->Fill(RefTau[i].Et());
00506 h_GenTauHadEta->Fill(RefTau[i].Eta());
00507 h_GenTauHadPhi->Fill(RefTau[i].Phi());
00508
00509 if (std::abs(RefTau[i].Eta())<=_MCTauHadMaxAbsEta)
00510 h_MCTauHadEt->Fill(RefTau[i].Et());
00511 if (RefTau[i].Et()>=_MCTauHadMinEt)
00512 h_MCTauHadEta->Fill(RefTau[i].Eta());
00513 if (RefTau[i].Et()>=_MCTauHadMinEt && std::abs(RefTau[i].Eta())<=_MCTauHadMaxAbsEta) {
00514 h_MCTauHadPhi->Fill(RefTau[i].Phi());
00515 nfidTauHads++;
00516 }
00517 }
00519 if (nfidTauHads >= 1) { _nfidEventsGenTauHad++; h_nfidCounter->Fill(1.5); }
00520 if (nfidTauHads >= 2) {_nfidEventsDoubleGenTauHads++; h_nfidCounter->Fill(2.5);}
00521
00522 bool singleMatch = false;
00523 bool doubleMatch = false;
00524 int iSingle = -1;
00525 int iDouble = -1;
00526 for (unsigned int i = 0; i<_L1Taus.size();i++) {
00527 for (unsigned int j = 0; j<RefTau.size();j++) {
00528 double deltaR = ROOT::Math::VectorUtil::DeltaR(_L1Taus[i],RefTau[j]);
00529 h_L1MCTauDeltaR->Fill(deltaR);
00530 if (deltaR < _L1MCTauMinDeltaR) {
00531 if (RefTau[j].Et()>=_MCTauHadMinEt && std::abs(RefTau[j].Eta())<=_MCTauHadMaxAbsEta) {
00532 h_L1minusMCTauEt->Fill(_L1Taus[i].Et() - RefTau[j].Et());
00533 h_L1minusMCoverMCTauEt->Fill( (_L1Taus[i].Et() - RefTau[j].Et()) / RefTau[j].Et());
00534
00535 if (singleMatch) {
00536 doubleMatch = true;
00537 iDouble = i;
00538 }
00539 singleMatch = true;
00540 if (singleMatch && !doubleMatch)
00541 iSingle = i;
00542 }
00543
00544 if (std::abs(RefTau[j].Eta())<=_MCTauHadMaxAbsEta) {
00545 h_L1MCMatchedTauEt->Fill(RefTau[j].Et());
00546
00547 }
00548 if (RefTau[j].Et()>=_MCTauHadMinEt) {
00549 h_L1MCMatchedTauEta->Fill(RefTau[j].Eta());
00550
00551 }
00552 if (RefTau[j].Et()>=_MCTauHadMinEt && std::abs(RefTau[j].Eta())<=_MCTauHadMaxAbsEta) {
00553 h_L1MCMatchedTauPhi->Fill(RefTau[j].Phi());
00554
00555 }
00556 }
00557 }
00558 }
00559
00560
00561 Handle<LVColl> RefElecH;
00562 iEvent.getByLabel(_refElecColl,RefElecH);
00563 LVColl RefElec = *RefElecH;
00564
00565 Handle<LVColl> RefMuonH;
00566 iEvent.getByLabel(_refMuonColl,RefMuonH);
00567 LVColl RefMuon = *RefMuonH;
00568
00569 int nfidTauElecs = 0;
00570 for (int i=0; i<(int)RefElec.size(); i++) {
00571
00572 h_GenTauElecEt->Fill(RefElec[i].Et());
00573 h_GenTauElecEta->Fill(RefElec[i].Eta());
00574 h_GenTauElecPhi->Fill(RefElec[i].Phi());
00575
00576 if (std::abs(RefElec[i].Eta())<=_MCElecMaxAbsEta)
00577 h_MCTauElecEt->Fill(RefElec[i].Et());
00578 if (RefElec[i].Et()>=_MCElecMinEt)
00579 h_MCTauElecEta->Fill(RefElec[i].Eta());
00580 if (RefElec[i].Et()>=_MCElecMinEt && std::abs(RefElec[i].Eta())<=_MCElecMaxAbsEta) {
00581 h_MCTauElecPhi->Fill(RefElec[i].Phi());
00582 nfidTauElecs++;
00583 }
00584 }
00585
00586 int nfidTauMuons = 0;
00587 for (int i=0; i<(int)RefMuon.size(); i++) {
00588
00589 h_GenTauMuonEt->Fill(RefMuon[i].Et());
00590 h_GenTauMuonEta->Fill(RefMuon[i].Eta());
00591 h_GenTauMuonPhi->Fill(RefMuon[i].Phi());
00592
00593 if (std::abs(RefMuon[i].Eta())<=_MCMuonMaxAbsEta)
00594 h_MCTauMuonEt->Fill(RefMuon[i].Et());
00595 if (RefMuon[i].Et()>=_MCMuonMinEt)
00596 h_MCTauMuonEta->Fill(RefMuon[i].Eta());
00597 if (RefMuon[i].Et()>=_MCMuonMinEt && std::abs(RefMuon[i].Eta())<=_MCMuonMaxAbsEta) {
00598 h_MCTauMuonPhi->Fill(RefMuon[i].Phi());
00599 nfidTauMuons++;
00600 }
00601 }
00602
00603 for (unsigned int i = 0; i<_L1IsoEgammas.size();i++) {
00604 for (unsigned int j = 0; j<RefElec.size();j++) {
00605 double deltaR = ROOT::Math::VectorUtil::DeltaR(_L1IsoEgammas[i],RefElec[j]);
00606 if (deltaR < _L1MCElecMinDeltaR) {
00607
00608 if (std::abs(RefElec[j].Eta())<=_MCElecMaxAbsEta) {
00609 h_L1MCMatchedTauElecEt->Fill(RefElec[j].Et());
00610
00611 }
00612 if (RefElec[j].Et()>=_MCElecMinEt) {
00613 h_L1MCMatchedTauElecEta->Fill(RefElec[j].Eta());
00614
00615 }
00616 if (RefElec[j].Et()>=_MCElecMinEt && std::abs(RefElec[j].Eta())<=_MCElecMaxAbsEta) {
00617 h_L1MCMatchedTauElecPhi->Fill(RefElec[j].Phi());
00618
00619 }
00620 }
00621 }
00622 }
00623
00624 for (unsigned int i = 0; i<_L1Muons.size();i++) {
00625 for (unsigned int j = 0; j<RefMuon.size();j++) {
00626 double deltaR = ROOT::Math::VectorUtil::DeltaR(_L1IsoEgammas[i],RefMuon[j]);
00627 if (deltaR < _L1MCMuonMinDeltaR) {
00628
00629 if (std::abs(RefMuon[j].Eta())<=_MCMuonMaxAbsEta) {
00630 h_L1MCMatchedTauMuonEt->Fill(RefMuon[j].Et());
00631
00632 }
00633 if (RefMuon[j].Et()>=_MCMuonMinEt) {
00634 h_L1MCMatchedTauMuonEta->Fill(RefMuon[j].Eta());
00635
00636 }
00637 if (RefMuon[j].Et()>=_MCMuonMinEt && std::abs(RefMuon[j].Eta())<=_MCMuonMaxAbsEta) {
00638 h_L1MCMatchedTauMuonPhi->Fill(RefMuon[j].Phi());
00639
00640 }
00641 }
00642 }
00643 }
00645
00646
00647
00648 if (singleMatch && iSingle>=0) {
00649 h_L1SingleTauEffMCMatchEt->Fill(_L1Taus[iSingle].Et());
00650
00651 if (_L1Taus[iSingle].Et()>=_SingleTauMETThresholds[0])
00652 h_L1METTaufixEffMCMatchEt->Fill(_L1METs[0].Et());
00653 if (_L1METs[0].Et()>=_SingleTauMETThresholds[1])
00654 h_L1TauMETfixEffMCMatchEt->Fill(_L1Taus[iSingle].Et());
00655
00656
00657 for (int i=0;i<(int)_L1Muons.size();i++) {
00658
00659
00660 if ( _L1MuQuals[0]==3 || _L1MuQuals[0]==5 || _L1MuQuals[0]==6 || _L1MuQuals[0]==7 ) {
00661
00662 for (int j=0;j<(int)RefMuon.size();j++) {
00663 double deltaR = ROOT::Math::VectorUtil::DeltaR(RefMuon[j],_L1Muons[i]);
00664 if (deltaR < _L1MCMuonMinDeltaR) {
00665 if (_L1Taus[iSingle].Et()>=_MuTauThresholds[1])
00666 h_L1MuonTaufixEffMCMatchEt->Fill(_L1Muons[i].Et());
00667 if (_L1Muons[i].Et()>=_MuTauThresholds[0])
00668 h_L1TauMuonfixEffMCMatchEt->Fill(_L1Taus[iSingle].Et());
00669 break;
00670 }
00671 }
00672
00673 }
00674 }
00675
00676
00677 for (int j=0;j<(int)_L1IsoEgammas.size();j++) {
00678
00679
00680
00681
00682
00683
00684 for (int k=0;k<(int)RefElec.size();k++) {
00685 double deltaR = ROOT::Math::VectorUtil::DeltaR(RefElec[k],_L1IsoEgammas[j]);
00686 if (deltaR < _L1MCElecMinDeltaR) {
00687 if (_L1Taus[iSingle].Et()>=_IsoEgTauThresholds[1])
00688 h_L1IsoEgTaufixEffMCMatchEt->Fill(_L1IsoEgammas[j].Et());
00689 if (_L1IsoEgammas[j].Et()>=_IsoEgTauThresholds[0])
00690 h_L1TauIsoEgfixEffMCMatchEt->Fill(_L1Taus[iSingle].Et());
00691 break;
00692 }
00693 }
00694
00695
00696 }
00697
00698 }
00699
00700 if (doubleMatch && iDouble>=0) {
00701 h_L1DoubleTauEffMCMatchEt->Fill(_L1Taus[iDouble].Et());
00702 if (_L1Taus[iDouble].Et()>=_DoubleTauThreshold)
00703 ;
00704 for (int j=0;j<(int)_L1IsoEgammas.size();j++) {
00705 if (_L1Taus[iDouble].Et()>=_IsoEgTauThresholds[1] &&
00706 _L1IsoEgammas[j].Et()>=_IsoEgTauThresholds[0]) {
00707
00708
00709
00710
00711 for (int k=0;k<(int)RefElec.size();k++) {
00712 double deltaR = ROOT::Math::VectorUtil::DeltaR(RefElec[k],_L1IsoEgammas[j]);
00713 if (deltaR<_L1MCElecMinDeltaR) {
00714 ;
00715 break;
00716 }
00717
00718 }
00719 }
00720 }
00721 }
00722
00724 if (nfidTauHads >= 1 && nfidTauMuons >= 1) {_nfidEventsGenTauMuonTauHad++; h_nfidCounter->Fill(3.5);}
00725 if (nfidTauHads >= 1 && nfidTauElecs >= 1) {_nfidEventsGenTauElecTauHad++; h_nfidCounter->Fill(4.5);}
00726
00727
00728 }
00729
00730 void
00731 HLTTauL1DQMOfflineSource::evalL1extraDecisions() {
00732 if (_L1Taus.size()>=1) {
00733 h_L1SingleTauEffEt->Fill(_L1Taus[0].Et());
00734 if (_L1Taus[0].Et()>=_SingleTauMETThresholds[0])
00735 h_L1METTaufixEffEt->Fill(_L1METs[0].Et());
00736 if (_L1METs[0].Et()>=_SingleTauMETThresholds[1])
00737 h_L1TauMETfixEffEt->Fill(_L1Taus[0].Et());
00738
00739 if (_L1Muons.size()>=1) {
00740 if (_L1Taus[0].Et()>=_MuTauThresholds[1])
00741 h_L1MuonTaufixEffEt->Fill(_L1Muons[0].Et());
00742 if (_L1Muons[0].Et()>=_MuTauThresholds[0])
00743 h_L1TauMuonfixEffEt->Fill(_L1Taus[0].Et());
00744 }
00745 if (_L1IsoEgammas.size()>=1) {
00746 if (_L1Taus[0].Et()>=_IsoEgTauThresholds[1])
00747 h_L1IsoEgTaufixEffEt->Fill(_L1IsoEgammas[0].Et());
00748 if (_L1IsoEgammas[0].Et()>=_IsoEgTauThresholds[0])
00749 h_L1TauIsoEgfixEffEt->Fill(_L1Taus[0].Et());
00750 }
00751 }
00752 if (_L1Taus.size()>=2 ) {
00753 h_L1DoubleTauEffEt->Fill(_L1Taus[1].Et());
00754 }
00755 }
00756
00757
00758
00759
00760
00761
00762
00763
00764
00765
00766
00767
00768
00769
00770
00771
00772
00773
00774
00775
00776
00777
00778
00779
00780
00781
00782
00783
00784
00785
00786