00001
00002
00003
00004
00005
00006
00007 #include "TMath.h"
00008 #include "FWCore/Framework/interface/EDAnalyzer.h"
00009 #include "DataFormats/Common/interface/Handle.h"
00010 #include "FWCore/Framework/interface/Run.h"
00011 #include "FWCore/Framework/interface/MakerMacros.h"
00012 #include "FWCore/Framework/interface/ESHandle.h"
00013
00014 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00015 #include "DQMOffline/Trigger/interface/JetMETHLTOfflineSource.h"
00016
00017 #include "DataFormats/Common/interface/TriggerResults.h"
00018 #include "DataFormats/HLTReco/interface/TriggerEvent.h"
00019 #include "DataFormats/HLTReco/interface/TriggerObject.h"
00020 #include "FWCore/Common/interface/TriggerNames.h"
00021 #include "DataFormats/HLTReco/interface/TriggerTypeDefs.h"
00022 #include "HLTrigger/HLTcore/interface/HLTConfigProvider.h"
00023
00024 #include "DataFormats/Math/interface/deltaR.h"
00025
00026 #include "DQMServices/Core/interface/MonitorElement.h"
00027 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00028 #include "math.h"
00029 #include "TH1F.h"
00030 #include "TProfile.h"
00031 #include "TH2F.h"
00032 #include "TPRegexp.h"
00033
00034 using namespace edm;
00035 using namespace reco;
00036 using namespace std;
00037
00038
00039 JetMETHLTOfflineSource::JetMETHLTOfflineSource(const edm::ParameterSet& iConfig):
00040 isSetup_(false)
00041 {
00042 LogDebug("JetMETHLTOfflineSource") << "constructor....";
00043
00044 dbe = Service < DQMStore > ().operator->();
00045 if ( ! dbe ) {
00046 LogDebug("JetMETHLTOfflineSource") << "unabel to get DQMStore service?";
00047 }
00048 if (iConfig.getUntrackedParameter < bool > ("DQMStore", false)) {
00049 dbe->setVerbose(0);
00050 }
00051
00052 dirname_ = iConfig.getUntrackedParameter("dirname",
00053 std::string("HLT/JetMET/"));
00054
00055
00056 processname_ = iConfig.getParameter<std::string>("processname");
00057 verbose_ = iConfig.getUntrackedParameter< bool >("verbose", false);
00058 plotAll_ = iConfig.getUntrackedParameter< bool >("plotAll", false);
00059 plotAllwrtMu_ = iConfig.getUntrackedParameter< bool >("plotAllwrtMu", false);
00060 plotEff_ = iConfig.getUntrackedParameter< bool >("plotEff", false);
00061 nameForEff_ = iConfig.getUntrackedParameter< bool >("nameForEff", true);
00062 jetID = new reco::helper::JetIDHelper(iConfig.getParameter<ParameterSet>("JetIDParams"));
00063
00064
00065 MuonTrigPaths_ = iConfig.getUntrackedParameter<vector<std::string> >("pathnameMuon");
00066 MBTrigPaths_ = iConfig.getUntrackedParameter<vector<std::string> >("pathnameMB");
00067 caloJetsTag_ = iConfig.getParameter<edm::InputTag>("CaloJetCollectionLabel");
00068 caloMETTag_ = iConfig.getParameter<edm::InputTag>("CaloMETCollectionLabel");
00069 triggerSummaryLabel_ = iConfig.getParameter<edm::InputTag>("triggerSummaryLabel");
00070 triggerResultsLabel_ = iConfig.getParameter<edm::InputTag>("triggerResultsLabel");
00071 custompathname = iConfig.getUntrackedParameter<vector<std::string> >("paths");
00072 _fEMF = iConfig.getUntrackedParameter< double >("fEMF", 0.01);
00073 _feta = iConfig.getUntrackedParameter< double >("feta", 2.60);
00074 _fHPD = iConfig.getUntrackedParameter< double >("fHPD", 0.98);
00075 _n90Hits = iConfig.getUntrackedParameter< double >("n90Hits", 1.0);
00076
00077 std::vector<edm::ParameterSet> paths = iConfig.getParameter<std::vector<edm::ParameterSet> >("pathPairs");
00078 for(std::vector<edm::ParameterSet>::iterator pathconf = paths.begin() ; pathconf != paths.end(); pathconf++) {
00079
00080 std::pair<std::string, std::string> custompathnamepair;
00081 custompathnamepair.first =pathconf->getParameter<std::string>("pathname");
00082 custompathnamepair.second = pathconf->getParameter<std::string>("denompathname");
00083 custompathnamepairs_.push_back(custompathnamepair);
00084 }
00085
00086
00087 }
00088
00089
00090 JetMETHLTOfflineSource::~JetMETHLTOfflineSource() {
00091
00092
00093
00094
00095
00096
00097 }
00098
00099
00100 void
00101 JetMETHLTOfflineSource::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup){
00102 using namespace edm;
00103 using namespace trigger;
00104 using namespace reco;
00105
00106 iEvent.getByLabel(triggerResultsLabel_, triggerResults_);
00107 if(!triggerResults_.isValid()) {
00108 edm::InputTag triggerResultsLabelFU(triggerResultsLabel_.label(),triggerResultsLabel_.instance(), "FU");
00109 iEvent.getByLabel(triggerResultsLabelFU,triggerResults_);
00110 if(!triggerResults_.isValid()) {
00111 edm::LogInfo("FourVectorHLTOffline") << "TriggerResults not found, "
00112 "skipping event";
00113 return;
00114 }
00115 }
00116
00117 if(&triggerResults_) {
00118 triggerNames_ = iEvent.triggerNames(*triggerResults_);
00119 } else {
00120
00121 edm::LogInfo("CaloMETHLTOfflineSource") << "TriggerResults::HLT not found, "
00122 "automatically select events";
00123 return;
00124
00125 }
00126
00127 iEvent.getByLabel(triggerSummaryLabel_,triggerObj_);
00128 if(!triggerObj_.isValid()) {
00129 edm::InputTag triggerSummaryLabelFU(triggerSummaryLabel_.label(),triggerSummaryLabel_.instance(), "FU");
00130 iEvent.getByLabel(triggerSummaryLabelFU,triggerObj_);
00131 if(!triggerObj_.isValid()) {
00132 edm::LogInfo("FourVectorHLTOffline") << "TriggerEvent not found, "
00133 "skipping event";
00134 return;
00135 }
00136 }
00137
00138 bool ValidJetColl_ = iEvent.getByLabel(caloJetsTag_,calojetColl_);
00139 if(!ValidJetColl_)return;
00140 calojet = *calojetColl_;
00141 std::stable_sort( calojet.begin(), calojet.end(), PtSorter() );
00142
00143 bool ValidMETColl_ = iEvent.getByLabel(caloMETTag_, calometColl_);
00144 if(!ValidMETColl_)return;
00145
00146 if(calometColl_.isValid()){
00147 const CaloMETCollection *calometcol = calometColl_.product();
00148 const CaloMET met = calometcol->front();
00149 }
00150 fillMEforMonTriggerSummary();
00151 if(plotAll_)fillMEforMonAllTrigger(iEvent);
00152 if(plotAllwrtMu_)fillMEforMonAllTriggerwrtMuonTrigger(iEvent);
00153 if(plotEff_)
00154 {
00155 fillMEforEffAllTrigger(iEvent);
00156 fillMEforEffWrtMuTrigger(iEvent);
00157 fillMEforEffWrtMBTrigger(iEvent);
00158 }
00159 fillMEforTriggerNTfired();
00160 }
00161
00162
00163 void JetMETHLTOfflineSource::fillMEforMonTriggerSummary(){
00164
00165
00166 bool muTrig = false;
00167 bool mbTrig = false;
00168 for(size_t i=0;i<MuonTrigPaths_.size();++i){
00169 if(isHLTPathAccepted(MuonTrigPaths_[i])){
00170 muTrig = true;
00171 break;
00172 }
00173 }
00174 for(size_t i=0;i<MBTrigPaths_.size();++i){
00175 if(isHLTPathAccepted(MBTrigPaths_[i])){
00176 mbTrig = true;
00177 break;
00178 }
00179 }
00180 for(PathInfoCollection::iterator v = hltPathsAll_.begin(); v!= hltPathsAll_.end(); ++v )
00181 {
00182 bool trigFirst= false;
00183 double binV = TriggerPosition(v->getPath());
00184 if(isHLTPathAccepted(v->getPath())) trigFirst = true;
00185 if(!trigFirst)continue;
00186 if(trigFirst)
00187 {
00188 rate_All->Fill(binV);
00189 correlation_All->Fill(binV,binV);
00190 if(muTrig){
00191 rate_AllWrtMu->Fill(binV);
00192 correlation_AllWrtMu->Fill(binV,binV);
00193 }
00194 if(mbTrig){
00195 rate_AllWrtMB->Fill(binV);
00196 correlation_AllWrtMB->Fill(binV,binV);
00197 }
00198 }
00199 for(PathInfoCollection::iterator w = v+1; w!= hltPathsAll_.end(); ++w )
00200 {
00201 bool trigSec = false;
00202 double binW = TriggerPosition(w->getPath());
00203 if(isHLTPathAccepted(w->getPath()))trigSec = true;
00204 if(trigSec && trigFirst)
00205 {
00206 correlation_All->Fill(binV,binW);
00207 if(muTrig)correlation_AllWrtMu->Fill(binV,binW);
00208 if(mbTrig)correlation_AllWrtMB->Fill(binV,binW);
00209 }
00210 if(!trigSec && trigFirst)
00211 {
00212 correlation_All->Fill(binW,binV);
00213 if(muTrig)correlation_AllWrtMu->Fill(binW,binV);
00214 if(mbTrig)correlation_AllWrtMB->Fill(binW,binV);
00215
00216 }
00217 }
00218 }
00219 }
00220
00221 void JetMETHLTOfflineSource::fillMEforTriggerNTfired(){
00222
00223 if(! &triggerResults_) {
00224 return;
00225 }
00226 for(PathInfoCollection::iterator v = hltPathsAll_.begin(); v!= hltPathsAll_.end(); ++v )
00227 {
00228 unsigned index = triggerNames_.triggerIndex(v->getPath());
00229 if (index < triggerNames_.size() )
00230 {
00231 v->getMEhisto_TriggerSummary()->Fill(0.);
00232 edm::InputTag l1Tag(v->getl1Path(),"",processname_);
00233 const int l1Index = triggerObj_->filterIndex(l1Tag);
00234 bool l1found = false;
00235 if ( l1Index < triggerObj_->sizeFilters() ) l1found = true;
00236 if(!l1found)v->getMEhisto_TriggerSummary()->Fill(1.);
00237 if(!l1found && !(triggerResults_->accept(index)))v->getMEhisto_TriggerSummary()->Fill(2.);
00238 if(!l1found && (triggerResults_->accept(index)))v->getMEhisto_TriggerSummary()->Fill(3.);
00239 if(l1found)v->getMEhisto_TriggerSummary()->Fill(4.);
00240 if(l1found && (triggerResults_->accept(index)))v->getMEhisto_TriggerSummary()->Fill(5.);
00241 if(l1found && !(triggerResults_->accept(index)))v->getMEhisto_TriggerSummary()->Fill(6.);
00242 if(!(triggerResults_->accept(index)) && l1found)
00243 {
00244
00245 if((v->getTriggerType().compare("SingleJet_Trigger") == 0) && (calojetColl_.isValid()) && calojet.size())
00246
00247 {
00248 CaloJetCollection::const_iterator jet = calojet.begin();
00249 v->getMEhisto_JetPt()->Fill(jet->pt());
00250 v->getMEhisto_EtavsPt()->Fill(jet->eta(),jet->pt());
00251 v->getMEhisto_PhivsPt()->Fill(jet->phi(),jet->pt());
00252
00253 }
00254
00255 if((v->getTriggerType().compare("DiJet_Trigger") == 0) && calojetColl_.isValid() && calojet.size())
00256 {
00257 v->getMEhisto_JetSize()->Fill(calojet.size()) ;
00258 if (calojet.size()>=2){
00259 CaloJetCollection::const_iterator jet = calojet.begin();
00260 CaloJetCollection::const_iterator jet2= calojet.begin(); jet2++;
00261 double jet3pt = 0.;
00262 if(calojet.size()>2)
00263 {
00264 CaloJetCollection::const_iterator jet3 = jet2++;
00265 jet3pt = jet3->pt();
00266 }
00267 v->getMEhisto_Pt12()->Fill((jet->pt()+jet2->pt())/2.);
00268 v->getMEhisto_Eta12()->Fill((jet->eta()+jet2->eta())/2.);
00269 v->getMEhisto_Phi12()->Fill(deltaPhi(jet->phi(),jet2->phi()));
00270 v->getMEhisto_Pt3()->Fill(jet3pt);
00271 v->getMEhisto_Pt12Pt3()->Fill((jet->pt()+jet2->pt())/2., jet3pt);
00272 v->getMEhisto_Pt12Phi12()->Fill((jet->pt()+jet2->pt())/2., deltaPhi(jet->phi(),jet2->phi()));
00273
00274 }
00275 }
00276
00277 if((v->getTriggerType().compare("MET_Trigger") == 0) && calometColl_.isValid() )
00278 {
00279 const CaloMETCollection *calometcol = calometColl_.product();
00280 const CaloMET met = calometcol->front();
00281 v->getMEhisto_JetPt()->Fill(met.pt());
00282 }
00283 }
00284 }
00285 }
00286
00287
00288
00289 }
00290
00291
00292 void JetMETHLTOfflineSource::fillMEforMonAllTrigger(const Event & iEvent){
00293 if(! &triggerResults_) {
00294 return;
00295 }
00296
00297 const trigger::TriggerObjectCollection & toc(triggerObj_->getObjects());
00298 for(PathInfoCollection::iterator v = hltPathsAll_.begin(); v!= hltPathsAll_.end(); ++v )
00299 {
00300 if (isHLTPathAccepted(v->getPath()))
00301 {
00302 std::vector<double>jetPtVec;
00303 std::vector<double>jetPhiVec;
00304 std::vector<double>jetEtaVec;
00305 std::vector<double>jetPxVec;
00306 std::vector<double>jetPyVec;
00307
00308 std::vector<double>hltPtVec;
00309 std::vector<double>hltPhiVec;
00310 std::vector<double>hltEtaVec;
00311 std::vector<double>hltPxVec;
00312 std::vector<double>hltPyVec;
00313 bool fillL1HLT = false;
00314
00315 edm::InputTag l1Tag(v->getl1Path(),"",processname_);
00316 const int l1Index = triggerObj_->filterIndex(l1Tag);
00317 edm::InputTag hltTag(v->getLabel(),"",processname_);
00318 const int hltIndex = triggerObj_->filterIndex(hltTag);
00319
00320 bool hltTrigBool = false;
00321 bool diJetFire = false;
00322 int jetsize = 0;
00323 if ( l1Index >= triggerObj_->sizeFilters() ) {
00324 edm::LogInfo("JetMETHLTOfflineSource") << "no index "<< l1Index << " of that name "<<l1Tag;
00325 } else {
00326
00327 const trigger::Keys & kl1 = triggerObj_->filterKeys(l1Index);
00328 if(v->getObjectType() == trigger::TriggerJet)v->getMEhisto_N_L1()->Fill(kl1.size());
00329 for( trigger::Keys::const_iterator ki = kl1.begin(); ki != kl1.end(); ++ki)
00330 {
00331 double l1TrigEta = -100;
00332 double l1TrigPhi = -100;
00333
00334 if(v->getObjectType() == trigger::TriggerJet)
00335 {
00336 l1TrigEta = toc[*ki].eta();
00337 l1TrigPhi = toc[*ki].phi();
00338 v->getMEhisto_Pt_L1()->Fill(toc[*ki].pt());
00339 if (isBarrel(toc[*ki].eta())) v->getMEhisto_PtBarrel_L1()->Fill(toc[*ki].pt());
00340 if (isEndCap(toc[*ki].eta())) v->getMEhisto_PtEndcap_L1()->Fill(toc[*ki].pt());
00341 if (isForward(toc[*ki].eta())) v->getMEhisto_PtForward_L1()->Fill(toc[*ki].pt());
00342 v->getMEhisto_Eta_L1()->Fill(toc[*ki].eta());
00343 v->getMEhisto_Phi_L1()->Fill(toc[*ki].phi());
00344 v->getMEhisto_EtaPhi_L1()->Fill(toc[*ki].eta(),toc[*ki].phi());
00345 }
00346 if(v->getObjectType() == trigger::TriggerMET)
00347 {
00348 v->getMEhisto_Pt_L1()->Fill(toc[*ki].pt());
00349 v->getMEhisto_Phi_L1()->Fill(toc[*ki].phi());
00350 }
00351
00352 if ( hltIndex >= triggerObj_->sizeFilters() ) {
00353 edm::LogInfo("JetMETHLTOfflineSource") << "no index hlt"<< hltIndex << " of that name ";
00354 } else {
00355 const trigger::Keys & khlt = triggerObj_->filterKeys(hltIndex);
00356 if((v->getObjectType() == trigger::TriggerJet) && (ki == kl1.begin()))v->getMEhisto_N_HLT()->Fill(khlt.size());
00357
00358 for(trigger::Keys::const_iterator kj = khlt.begin();kj != khlt.end(); ++kj)
00359 {
00360 double hltTrigEta = -100;
00361 double hltTrigPhi = -100;
00362 if(v->getObjectType() == trigger::TriggerJet)
00363 {
00364 hltTrigEta = toc[*kj].eta();
00365 hltTrigPhi = toc[*kj].phi();
00366 if((deltaR(hltTrigEta, hltTrigPhi, l1TrigEta, l1TrigPhi)) < 0.4 && (v->getTriggerType().compare("DiJet_Trigger") == 0))hltTrigBool = true;
00367 }
00368 }
00369 for(trigger::Keys::const_iterator kj = khlt.begin();kj != khlt.end(); ++kj)
00370 {
00371 double hltTrigEta = -100;
00372 double hltTrigPhi = -100;
00373 fillL1HLT = true;
00374
00375 if(v->getObjectType() == trigger::TriggerMET)
00376 {
00377 v->getMEhisto_Pt_HLT()->Fill(toc[*kj].pt());
00378 v->getMEhisto_Phi_HLT()->Fill(toc[*kj].phi());
00379 v->getMEhisto_PtCorrelation_L1HLT()->Fill(toc[*ki].pt(),toc[*kj].pt());
00380 v->getMEhisto_PhiCorrelation_L1HLT()->Fill(toc[*ki].phi(),toc[*kj].phi());
00381 v->getMEhisto_PtResolution_L1HLT()->Fill((toc[*ki].pt()-toc[*kj].pt())/(toc[*ki].pt()));
00382 v->getMEhisto_PhiResolution_L1HLT()->Fill((toc[*ki].phi()-toc[*kj].phi())/(toc[*ki].phi()));
00383 }
00384
00385 if(v->getObjectType() == trigger::TriggerJet)
00386 {
00387 hltTrigEta = toc[*kj].eta();
00388 hltTrigPhi = toc[*kj].phi();
00389
00390 if((deltaR(hltTrigEta, hltTrigPhi, l1TrigEta, l1TrigPhi)) < 0.4)
00391 {
00392
00393 v->getMEhisto_PtCorrelation_L1HLT()->Fill(toc[*ki].pt(),toc[*kj].pt());
00394 v->getMEhisto_EtaCorrelation_L1HLT()->Fill(toc[*ki].eta(),toc[*kj].eta());
00395 v->getMEhisto_PhiCorrelation_L1HLT()->Fill(toc[*ki].phi(),toc[*kj].phi());
00396
00397 v->getMEhisto_PtResolution_L1HLT()->Fill((toc[*ki].pt()-toc[*kj].pt())/(toc[*ki].pt()));
00398 v->getMEhisto_EtaResolution_L1HLT()->Fill((toc[*ki].eta()-toc[*kj].eta())/(toc[*ki].eta()));
00399 v->getMEhisto_PhiResolution_L1HLT()->Fill((toc[*ki].phi()-toc[*kj].phi())/(toc[*ki].phi()));
00400 }
00401
00402 if(((deltaR(hltTrigEta, hltTrigPhi, l1TrigEta, l1TrigPhi) < 0.4 ) || ((v->getTriggerType().compare("DiJet_Trigger") == 0) && hltTrigBool)) && !diJetFire)
00403 {
00404 v->getMEhisto_Pt_HLT()->Fill(toc[*kj].pt());
00405 if (isBarrel(toc[*kj].eta())) v->getMEhisto_PtBarrel_HLT()->Fill(toc[*kj].pt());
00406 if (isEndCap(toc[*kj].eta())) v->getMEhisto_PtEndcap_HLT()->Fill(toc[*kj].pt());
00407 if (isForward(toc[*kj].eta())) v->getMEhisto_PtForward_HLT()->Fill(toc[*kj].pt());
00408 v->getMEhisto_Eta_HLT()->Fill(toc[*kj].eta());
00409 v->getMEhisto_Phi_HLT()->Fill(toc[*kj].phi());
00410 v->getMEhisto_EtaPhi_HLT()->Fill(toc[*kj].eta(),toc[*kj].phi());
00411
00412
00413 if(calojetColl_.isValid() && (v->getObjectType() == trigger::TriggerJet)){
00414
00415 for(CaloJetCollection::const_iterator jet = calojet.begin(); jet != calojet.end(); ++jet ) {
00416 double jetEta = jet->eta();
00417 double jetPhi = jet->phi();
00418 if(deltaR(hltTrigEta, hltTrigPhi, jetEta, jetPhi) < 0.4)
00419 {
00420 jetsize++;
00421 v->getMEhisto_Pt()->Fill(jet->pt());
00422 if (isBarrel(jet->eta())) v->getMEhisto_PtBarrel()->Fill(jet->pt());
00423 if (isEndCap(jet->eta())) v->getMEhisto_PtEndcap()->Fill(jet->pt());
00424 if (isForward(jet->eta())) v->getMEhisto_PtForward()->Fill(jet->pt());
00425 v->getMEhisto_Eta()->Fill(jet->eta());
00426 v->getMEhisto_Phi()->Fill(jet->phi());
00427 v->getMEhisto_EtaPhi()->Fill(jet->eta(),jet->phi());
00428
00429 v->getMEhisto_PtCorrelation_HLTRecObj()->Fill(toc[*kj].pt(),jet->pt());
00430 v->getMEhisto_EtaCorrelation_HLTRecObj()->Fill(toc[*kj].eta(),jet->eta());
00431 v->getMEhisto_PhiCorrelation_HLTRecObj()->Fill(toc[*kj].phi(),jet->phi());
00432
00433 v->getMEhisto_PtResolution_HLTRecObj()->Fill((toc[*kj].pt()-jet->pt())/(toc[*kj].pt()));
00434 v->getMEhisto_EtaResolution_HLTRecObj()->Fill((toc[*kj].eta()-jet->eta())/(toc[*kj].eta()));
00435 v->getMEhisto_PhiResolution_HLTRecObj()->Fill((toc[*kj].phi()-jet->phi())/(toc[*kj].phi()));
00436
00437
00438 if((v->getTriggerType().compare("DiJet_Trigger") == 0))
00439 {
00440 jetPhiVec.push_back(jet->phi());
00441 jetPtVec.push_back(jet->pt());
00442 jetEtaVec.push_back(jet->eta());
00443 jetPxVec.push_back(jet->px());
00444 jetPyVec.push_back(jet->py());
00445
00446 hltPhiVec.push_back(toc[*kj].phi());
00447 hltPtVec.push_back(toc[*kj].pt());
00448 hltEtaVec.push_back(toc[*kj].eta());
00449 hltPxVec.push_back(toc[*kj].px());
00450 hltPyVec.push_back(toc[*kj].py());
00451
00452 }
00453
00454
00455 }
00456
00457 }
00458 }
00459 }
00460
00461 }
00462
00463 if(calometColl_.isValid() && (v->getObjectType() == trigger::TriggerMET)){
00464 const CaloMETCollection *calometcol = calometColl_.product();
00465 const CaloMET met = calometcol->front();
00466 v->getMEhisto_Pt()->Fill(met.pt());
00467 v->getMEhisto_Phi()->Fill(met.phi());
00468
00469 v->getMEhisto_PtCorrelation_HLTRecObj()->Fill(toc[*kj].pt(),met.pt());
00470 v->getMEhisto_PhiCorrelation_HLTRecObj()->Fill(toc[*kj].phi(),met.phi());
00471 v->getMEhisto_PtResolution_HLTRecObj()->Fill((toc[*kj].pt()-met.pt())/(toc[*kj].pt()));
00472 v->getMEhisto_PhiResolution_HLTRecObj()->Fill((toc[*kj].phi()-met.phi())/(toc[*kj].phi()));
00473 }
00474
00475
00476
00477 }
00478 if((v->getTriggerType().compare("DiJet_Trigger") == 0))diJetFire = true;
00479 }
00480 }
00481 }
00482 v->getMEhisto_N()->Fill(jetsize);
00483
00484 if((v->getTriggerType().compare("DiJet_Trigger") == 0) && jetPtVec.size() >1)
00485 {
00486 double AveJetPt = (jetPtVec[0] + jetPtVec[1])/2;
00487 double AveJetEta = (jetEtaVec[0] + jetEtaVec[1])/2;
00488 double JetDelPhi = deltaPhi(jetPhiVec[0],jetPhiVec[1]);
00489 double AveHLTPt = (hltPtVec[0] + hltPtVec[1])/2;
00490 double AveHLTEta = (hltEtaVec[0] + hltEtaVec[1])/2;
00491 double HLTDelPhi = deltaPhi(hltPhiVec[0],hltPhiVec[1]);
00492 v->getMEhisto_AveragePt_RecObj()->Fill(AveJetPt);
00493 v->getMEhisto_AverageEta_RecObj()->Fill(AveJetEta);
00494 v->getMEhisto_DeltaPhi_RecObj()->Fill(JetDelPhi);
00495
00496 v->getMEhisto_AveragePt_HLTObj()->Fill(AveHLTPt);
00497 v->getMEhisto_AverageEta_HLTObj()->Fill(AveHLTEta);
00498 v->getMEhisto_DeltaPhi_HLTObj()->Fill(HLTDelPhi);
00499
00500
00501 }
00502
00503 if(v->getPath().find("L1") != std::string::npos && !fillL1HLT)
00504 {
00505 if ( l1Index >= triggerObj_->sizeFilters() ) {
00506 edm::LogInfo("JetMETHLTOfflineSource") << "no index "<< l1Index << " of that name "<<l1Tag;
00507 } else {
00508
00509 const trigger::Keys & kl1 = triggerObj_->filterKeys(l1Index);
00510 for( trigger::Keys::const_iterator ki = kl1.begin(); ki != kl1.end(); ++ki)
00511 {
00512 double l1TrigEta = toc[*ki].eta();
00513 double l1TrigPhi = toc[*ki].phi();
00514 if(calojetColl_.isValid() && (v->getObjectType() == trigger::TriggerJet) && (v->getTriggerType().compare("SingleJet_Trigger") == 0) ){
00515 for(CaloJetCollection::const_iterator jet = calojet.begin(); jet != calojet.end(); ++jet ) {
00516 double jetEta = jet->eta();
00517 double jetPhi = jet->phi();
00518 if(deltaR(l1TrigEta, l1TrigPhi, jetEta, jetPhi) < 0.4)
00519 {
00520 jetsize++;
00521 v->getMEhisto_Pt()->Fill(jet->pt());
00522 if (isBarrel(jet->eta())) v->getMEhisto_PtBarrel()->Fill(jet->pt());
00523 if (isEndCap(jet->eta())) v->getMEhisto_PtEndcap()->Fill(jet->pt());
00524 if (isForward(jet->eta())) v->getMEhisto_PtForward()->Fill(jet->pt());
00525 v->getMEhisto_Eta()->Fill(jet->eta());
00526 v->getMEhisto_Phi()->Fill(jet->phi());
00527 v->getMEhisto_EtaPhi()->Fill(jet->eta(),jet->phi());
00528
00529 v->getMEhisto_PtCorrelation_HLTRecObj()->Fill(toc[*ki].pt(),jet->pt());
00530 v->getMEhisto_EtaCorrelation_HLTRecObj()->Fill(toc[*ki].eta(),jet->eta());
00531 v->getMEhisto_PhiCorrelation_HLTRecObj()->Fill(toc[*ki].phi(),jet->phi());
00532
00533 v->getMEhisto_PtResolution_HLTRecObj()->Fill((toc[*ki].pt()-jet->pt())/(toc[*ki].pt()));
00534 v->getMEhisto_EtaResolution_HLTRecObj()->Fill((toc[*ki].eta()-jet->eta())/(toc[*ki].eta()));
00535 v->getMEhisto_PhiResolution_HLTRecObj()->Fill((toc[*ki].phi()-jet->phi())/(toc[*ki].phi()));
00536
00537 }
00538
00539 }
00540 v->getMEhisto_N()->Fill(jetsize);
00541 }
00542
00543 if(calometColl_.isValid() && (v->getObjectType() == trigger::TriggerMET)){
00544 const CaloMETCollection *calometcol = calometColl_.product();
00545 const CaloMET met = calometcol->front();
00546 v->getMEhisto_Pt()->Fill(met.pt());
00547 v->getMEhisto_Phi()->Fill(met.phi());
00548
00549 v->getMEhisto_PtCorrelation_HLTRecObj()->Fill(toc[*ki].pt(),met.pt());
00550 v->getMEhisto_PhiCorrelation_HLTRecObj()->Fill(toc[*ki].phi(),met.phi());
00551 v->getMEhisto_PtResolution_HLTRecObj()->Fill((toc[*ki].pt()-met.pt())/(toc[*ki].pt()));
00552 v->getMEhisto_PhiResolution_HLTRecObj()->Fill((toc[*ki].phi()-met.phi())/(toc[*ki].phi()));
00553 }
00554
00555
00556 }
00557 }
00558 }
00559
00560 }
00561 }
00562
00563 }
00564
00565
00566 void JetMETHLTOfflineSource::fillMEforMonAllTriggerwrtMuonTrigger(const Event & iEvent){
00567
00568 if(! &triggerResults_) {
00569 return;
00570 }
00571
00572 bool muTrig = false;
00573 for(size_t i=0;i<MuonTrigPaths_.size();++i){
00574 if(isHLTPathAccepted(MuonTrigPaths_[i])){
00575 muTrig = true;
00576 break;
00577 }
00578 }
00579 if(muTrig)
00580 {
00581
00582 const trigger::TriggerObjectCollection & toc(triggerObj_->getObjects());
00583 for(PathInfoCollection::iterator v = hltPathsAll_.begin(); v!= hltPathsAll_.end(); ++v )
00584 {
00585 if (isHLTPathAccepted(v->getPath()))
00586 {
00587 std::vector<double>jetPtVec;
00588 std::vector<double>jetPhiVec;
00589 std::vector<double>jetEtaVec;
00590 std::vector<double>jetPxVec;
00591 std::vector<double>jetPyVec;
00592
00593 std::vector<double>hltPtVec;
00594 std::vector<double>hltPhiVec;
00595 std::vector<double>hltEtaVec;
00596 std::vector<double>hltPxVec;
00597 std::vector<double>hltPyVec;
00598 bool fillL1HLT = false;
00599
00600 edm::InputTag l1Tag(v->getl1Path(),"",processname_);
00601 const int l1Index = triggerObj_->filterIndex(l1Tag);
00602 edm::InputTag hltTag(v->getLabel(),"",processname_);
00603 const int hltIndex = triggerObj_->filterIndex(hltTag);
00604
00605 bool hltTrigBool = false;
00606 bool diJetFire = false;
00607 int jetsize = 0;
00608 if ( l1Index >= triggerObj_->sizeFilters() ) {
00609 edm::LogInfo("JetMETHLTOfflineSource") << "no index "<< l1Index << " of that name "<<l1Tag;
00610 } else {
00611
00612 const trigger::Keys & kl1 = triggerObj_->filterKeys(l1Index);
00613 if(v->getObjectType() == trigger::TriggerJet)v->getMEhisto_N_L1()->Fill(kl1.size());
00614 for( trigger::Keys::const_iterator ki = kl1.begin(); ki != kl1.end(); ++ki)
00615 {
00616 double l1TrigEta = -100;
00617 double l1TrigPhi = -100;
00618
00619 if(v->getObjectType() == trigger::TriggerJet)
00620 {
00621 l1TrigEta = toc[*ki].eta();
00622 l1TrigPhi = toc[*ki].phi();
00623 v->getMEhisto_Pt_L1()->Fill(toc[*ki].pt());
00624 if (isBarrel(toc[*ki].eta())) v->getMEhisto_PtBarrel_L1()->Fill(toc[*ki].pt());
00625 if (isEndCap(toc[*ki].eta())) v->getMEhisto_PtEndcap_L1()->Fill(toc[*ki].pt());
00626 if (isForward(toc[*ki].eta())) v->getMEhisto_PtForward_L1()->Fill(toc[*ki].pt());
00627 v->getMEhisto_Eta_L1()->Fill(toc[*ki].eta());
00628 v->getMEhisto_Phi_L1()->Fill(toc[*ki].phi());
00629 v->getMEhisto_EtaPhi_L1()->Fill(toc[*ki].eta(),toc[*ki].phi());
00630 }
00631 if(v->getObjectType() == trigger::TriggerMET)
00632 {
00633 v->getMEhisto_Pt_L1()->Fill(toc[*ki].pt());
00634 v->getMEhisto_Phi_L1()->Fill(toc[*ki].phi());
00635 }
00636
00637 if ( hltIndex >= triggerObj_->sizeFilters() ) {
00638 edm::LogInfo("JetMETHLTOfflineSource") << "no index hlt"<< hltIndex << " of that name ";
00639 } else {
00640 const trigger::Keys & khlt = triggerObj_->filterKeys(hltIndex);
00641 if((v->getObjectType() == trigger::TriggerJet) && (ki == kl1.begin()))v->getMEhisto_N_HLT()->Fill(khlt.size());
00642
00643 for(trigger::Keys::const_iterator kj = khlt.begin();kj != khlt.end(); ++kj)
00644 {
00645 double hltTrigEta = -100;
00646 double hltTrigPhi = -100;
00647 if(v->getObjectType() == trigger::TriggerJet)
00648 {
00649 hltTrigEta = toc[*kj].eta();
00650 hltTrigPhi = toc[*kj].phi();
00651 if((deltaR(hltTrigEta, hltTrigPhi, l1TrigEta, l1TrigPhi)) < 0.4 && (v->getTriggerType().compare("DiJet_Trigger") == 0))hltTrigBool = true;
00652 }
00653 }
00654 for(trigger::Keys::const_iterator kj = khlt.begin();kj != khlt.end(); ++kj)
00655 {
00656 double hltTrigEta = -100;
00657 double hltTrigPhi = -100;
00658 fillL1HLT = true;
00659
00660 if(v->getObjectType() == trigger::TriggerMET)
00661 {
00662 v->getMEhisto_Pt_HLT()->Fill(toc[*kj].pt());
00663 v->getMEhisto_Phi_HLT()->Fill(toc[*kj].phi());
00664 v->getMEhisto_PtCorrelation_L1HLT()->Fill(toc[*ki].pt(),toc[*kj].pt());
00665 v->getMEhisto_PhiCorrelation_L1HLT()->Fill(toc[*ki].phi(),toc[*kj].phi());
00666 v->getMEhisto_PtResolution_L1HLT()->Fill((toc[*ki].pt()-toc[*kj].pt())/(toc[*ki].pt()));
00667 v->getMEhisto_PhiResolution_L1HLT()->Fill((toc[*ki].phi()-toc[*kj].phi())/(toc[*ki].phi()));
00668 }
00669
00670 if(v->getObjectType() == trigger::TriggerJet)
00671 {
00672 hltTrigEta = toc[*kj].eta();
00673 hltTrigPhi = toc[*kj].phi();
00674
00675 if((deltaR(hltTrigEta, hltTrigPhi, l1TrigEta, l1TrigPhi)) < 0.4)
00676 {
00677
00678 v->getMEhisto_PtCorrelation_L1HLT()->Fill(toc[*ki].pt(),toc[*kj].pt());
00679 v->getMEhisto_EtaCorrelation_L1HLT()->Fill(toc[*ki].eta(),toc[*kj].eta());
00680 v->getMEhisto_PhiCorrelation_L1HLT()->Fill(toc[*ki].phi(),toc[*kj].phi());
00681
00682 v->getMEhisto_PtResolution_L1HLT()->Fill((toc[*ki].pt()-toc[*kj].pt())/(toc[*ki].pt()));
00683 v->getMEhisto_EtaResolution_L1HLT()->Fill((toc[*ki].eta()-toc[*kj].eta())/(toc[*ki].eta()));
00684 v->getMEhisto_PhiResolution_L1HLT()->Fill((toc[*ki].phi()-toc[*kj].phi())/(toc[*ki].phi()));
00685 }
00686
00687 if(((deltaR(hltTrigEta, hltTrigPhi, l1TrigEta, l1TrigPhi) < 0.4 ) || ((v->getTriggerType().compare("DiJet_Trigger") == 0) && hltTrigBool)
00688 ) && !diJetFire)
00689 {
00690 v->getMEhisto_Pt_HLT()->Fill(toc[*kj].pt());
00691 if (isBarrel(toc[*kj].eta())) v->getMEhisto_PtBarrel_HLT()->Fill(toc[*kj].pt());
00692 if (isEndCap(toc[*kj].eta())) v->getMEhisto_PtEndcap_HLT()->Fill(toc[*kj].pt());
00693 if (isForward(toc[*kj].eta())) v->getMEhisto_PtForward_HLT()->Fill(toc[*kj].pt());
00694 v->getMEhisto_Eta_HLT()->Fill(toc[*kj].eta());
00695 v->getMEhisto_Phi_HLT()->Fill(toc[*kj].phi());
00696 v->getMEhisto_EtaPhi_HLT()->Fill(toc[*kj].eta(),toc[*kj].phi());
00697
00698
00699 if(calojetColl_.isValid() && (v->getObjectType() == trigger::TriggerJet)){
00700
00701 for(CaloJetCollection::const_iterator jet = calojet.begin(); jet != calojet.end(); ++jet ) {
00702 double jetEta = jet->eta();
00703 double jetPhi = jet->phi();
00704 if(deltaR(hltTrigEta, hltTrigPhi, jetEta, jetPhi) < 0.4)
00705 {
00706 jetsize++;
00707 v->getMEhisto_Pt()->Fill(jet->pt());
00708 if (isBarrel(jet->eta())) v->getMEhisto_PtBarrel()->Fill(jet->pt());
00709 if (isEndCap(jet->eta())) v->getMEhisto_PtEndcap()->Fill(jet->pt());
00710 if (isForward(jet->eta())) v->getMEhisto_PtForward()->Fill(jet->pt());
00711 v->getMEhisto_Eta()->Fill(jet->eta());
00712 v->getMEhisto_Phi()->Fill(jet->phi());
00713 v->getMEhisto_EtaPhi()->Fill(jet->eta(),jet->phi());
00714
00715 v->getMEhisto_PtCorrelation_HLTRecObj()->Fill(toc[*kj].pt(),jet->pt());
00716 v->getMEhisto_EtaCorrelation_HLTRecObj()->Fill(toc[*kj].eta(),jet->eta());
00717 v->getMEhisto_PhiCorrelation_HLTRecObj()->Fill(toc[*kj].phi(),jet->phi());
00718
00719 v->getMEhisto_PtResolution_HLTRecObj()->Fill((toc[*kj].pt()-jet->pt())/(toc[*kj].pt()));
00720 v->getMEhisto_EtaResolution_HLTRecObj()->Fill((toc[*kj].eta()-jet->eta())/(toc[*kj].eta()));
00721 v->getMEhisto_PhiResolution_HLTRecObj()->Fill((toc[*kj].phi()-jet->phi())/(toc[*kj].phi()));
00722
00723
00724 if((v->getTriggerType().compare("DiJet_Trigger") == 0))
00725 {
00726 jetPhiVec.push_back(jet->phi());
00727 jetPtVec.push_back(jet->pt());
00728 jetEtaVec.push_back(jet->eta());
00729 jetPxVec.push_back(jet->px());
00730 jetPyVec.push_back(jet->py());
00731
00732 hltPhiVec.push_back(toc[*kj].phi());
00733 hltPtVec.push_back(toc[*kj].pt());
00734 hltEtaVec.push_back(toc[*kj].eta());
00735 hltPxVec.push_back(toc[*kj].px());
00736 hltPyVec.push_back(toc[*kj].py());
00737
00738 }
00739
00740
00741 }
00742
00743 }
00744 }
00745 }
00746
00747 }
00748
00749 if(calometColl_.isValid() && (v->getObjectType() == trigger::TriggerMET)){
00750 const CaloMETCollection *calometcol = calometColl_.product();
00751 const CaloMET met = calometcol->front();
00752 v->getMEhisto_Pt()->Fill(met.pt());
00753 v->getMEhisto_Phi()->Fill(met.phi());
00754
00755 v->getMEhisto_PtCorrelation_HLTRecObj()->Fill(toc[*kj].pt(),met.pt());
00756 v->getMEhisto_PhiCorrelation_HLTRecObj()->Fill(toc[*kj].phi(),met.phi());
00757 v->getMEhisto_PtResolution_HLTRecObj()->Fill((toc[*kj].pt()-met.pt())/(toc[*kj].pt()));
00758 v->getMEhisto_PhiResolution_HLTRecObj()->Fill((toc[*kj].phi()-met.phi())/(toc[*kj].phi()));
00759 }
00760
00761
00762
00763 }
00764 if((v->getTriggerType().compare("DiJet_Trigger") == 0))diJetFire = true;
00765 }
00766 }
00767 }
00768 v->getMEhisto_N()->Fill(jetsize);
00769
00770 if((v->getTriggerType().compare("DiJet_Trigger") == 0) && jetPtVec.size() >1)
00771 {
00772 double AveJetPt = (jetPtVec[0] + jetPtVec[1])/2;
00773 double AveJetEta = (jetEtaVec[0] + jetEtaVec[1])/2;
00774 double JetDelPhi = deltaPhi(jetPhiVec[0],jetPhiVec[1]);
00775 double AveHLTPt = (hltPtVec[0] + hltPtVec[1])/2;
00776 double AveHLTEta = (hltEtaVec[0] + hltEtaVec[1])/2;
00777 double HLTDelPhi = deltaPhi(hltPhiVec[0],hltPhiVec[1]);
00778 v->getMEhisto_AveragePt_RecObj()->Fill(AveJetPt);
00779 v->getMEhisto_AverageEta_RecObj()->Fill(AveJetEta);
00780 v->getMEhisto_DeltaPhi_RecObj()->Fill(JetDelPhi);
00781
00782 v->getMEhisto_AveragePt_HLTObj()->Fill(AveHLTPt);
00783 v->getMEhisto_AverageEta_HLTObj()->Fill(AveHLTEta);
00784 v->getMEhisto_DeltaPhi_HLTObj()->Fill(HLTDelPhi);
00785
00786
00787 }
00788
00789 if(v->getPath().find("L1") != std::string::npos && !fillL1HLT)
00790 {
00791 if ( l1Index >= triggerObj_->sizeFilters() ) {
00792 edm::LogInfo("JetMETHLTOfflineSource") << "no index "<< l1Index << " of that name "<<l1Tag;
00793 } else {
00794
00795 const trigger::Keys & kl1 = triggerObj_->filterKeys(l1Index);
00796 for( trigger::Keys::const_iterator ki = kl1.begin(); ki != kl1.end(); ++ki)
00797 {
00798 double l1TrigEta = toc[*ki].eta();
00799 double l1TrigPhi = toc[*ki].phi();
00800 if(calojetColl_.isValid() && (v->getObjectType() == trigger::TriggerJet) && (v->getTriggerType().compare("SingleJet_Trigger") == 0) ){
00801 for(CaloJetCollection::const_iterator jet = calojet.begin(); jet != calojet.end(); ++jet ) {
00802 double jetEta = jet->eta();
00803 double jetPhi = jet->phi();
00804 if(deltaR(l1TrigEta, l1TrigPhi, jetEta, jetPhi) < 0.4)
00805 {
00806 jetsize++;
00807 v->getMEhisto_Pt()->Fill(jet->pt());
00808 if (isBarrel(jet->eta())) v->getMEhisto_PtBarrel()->Fill(jet->pt());
00809 if (isEndCap(jet->eta())) v->getMEhisto_PtEndcap()->Fill(jet->pt());
00810 if (isForward(jet->eta())) v->getMEhisto_PtForward()->Fill(jet->pt());
00811 v->getMEhisto_Eta()->Fill(jet->eta());
00812 v->getMEhisto_Phi()->Fill(jet->phi());
00813 v->getMEhisto_EtaPhi()->Fill(jet->eta(),jet->phi());
00814
00815 v->getMEhisto_PtCorrelation_HLTRecObj()->Fill(toc[*ki].pt(),jet->pt());
00816 v->getMEhisto_EtaCorrelation_HLTRecObj()->Fill(toc[*ki].eta(),jet->eta());
00817 v->getMEhisto_PhiCorrelation_HLTRecObj()->Fill(toc[*ki].phi(),jet->phi());
00818
00819 v->getMEhisto_PtResolution_HLTRecObj()->Fill((toc[*ki].pt()-jet->pt())/(toc[*ki].pt()));
00820 v->getMEhisto_EtaResolution_HLTRecObj()->Fill((toc[*ki].eta()-jet->eta())/(toc[*ki].eta()));
00821 v->getMEhisto_PhiResolution_HLTRecObj()->Fill((toc[*ki].phi()-jet->phi())/(toc[*ki].phi()));
00822
00823 }
00824
00825 }
00826 v->getMEhisto_N()->Fill(jetsize);
00827 }
00828
00829 if(calometColl_.isValid() && (v->getObjectType() == trigger::TriggerMET)){
00830 const CaloMETCollection *calometcol = calometColl_.product();
00831 const CaloMET met = calometcol->front();
00832 v->getMEhisto_Pt()->Fill(met.pt());
00833 v->getMEhisto_Phi()->Fill(met.phi());
00834
00835 v->getMEhisto_PtCorrelation_HLTRecObj()->Fill(toc[*ki].pt(),met.pt());
00836 v->getMEhisto_PhiCorrelation_HLTRecObj()->Fill(toc[*ki].phi(),met.phi());
00837 v->getMEhisto_PtResolution_HLTRecObj()->Fill((toc[*ki].pt()-met.pt())/(toc[*ki].pt()));
00838 v->getMEhisto_PhiResolution_HLTRecObj()->Fill((toc[*ki].phi()-met.phi())/(toc[*ki].phi()));
00839 }
00840
00841
00842 }
00843 }
00844 }
00845
00846 }
00847 }
00848
00849
00850 }
00851
00852
00853 }
00854
00855 void JetMETHLTOfflineSource::fillMEforEffAllTrigger(const Event & iEvent){
00856 if(! &triggerResults_) {
00857 return;
00858 }
00859 int num = -1;
00860 int denom = -1;
00861 for(PathInfoCollection::iterator v = hltPathsEff_.begin(); v!= hltPathsEff_.end(); ++v )
00862 {
00863 num++;
00864 denom++;
00865 bool denompassed = false;
00866 bool numpassed = false;
00867
00868 unsigned indexNum = triggerNames_.triggerIndex(v->getPath());
00869 unsigned indexDenom = triggerNames_.triggerIndex(v->getDenomPath());
00870
00871 if(indexNum < triggerNames_.size() && triggerResults_->accept(indexNum))numpassed = true;
00872 if(indexDenom < triggerNames_.size() && triggerResults_->accept(indexDenom))denompassed = true;
00873
00874 if(denompassed){
00875 if(calojetColl_.isValid() && (v->getObjectType() == trigger::TriggerJet)){
00876 bool jetIDbool = false;
00877 if((v->getTriggerType().compare("SingleJet_Trigger") == 0) && calojet.size())
00878 {
00879
00880 CaloJetCollection::const_iterator jet = calojet.begin();
00881 jetID->calculate(iEvent, *jet);
00882
00883 if(verbose_)cout<<"n90Hits==="<<jetID->n90Hits()<<"==fHPDs=="<<jetID->fHPD()<<endl;
00884 if((jet->emEnergyFraction()>_fEMF || fabs(jet->eta()) > _feta) && (jetID->fHPD()) < _fHPD && (jetID->n90Hits()) > _n90Hits)
00885 {
00886 jetIDbool = true;
00887 v->getMEhisto_DenominatorPt()->Fill(jet->pt());
00888 if (isBarrel(jet->eta())) v->getMEhisto_DenominatorPtBarrel()->Fill(jet->pt());
00889 if (isEndCap(jet->eta())) v->getMEhisto_DenominatorPtEndcap()->Fill(jet->pt());
00890 if (isForward(jet->eta())) v->getMEhisto_DenominatorPtForward()->Fill(jet->pt());
00891 v->getMEhisto_DenominatorEta()->Fill(jet->eta());
00892 v->getMEhisto_DenominatorPhi()->Fill(jet->phi());
00893 v->getMEhisto_DenominatorEtaPhi()->Fill(jet->eta(),jet->phi());
00894 }
00895 }
00896 if((v->getTriggerType().compare("DiJet_Trigger") == 0) && calojet.size()>1)
00897 {
00898 CaloJetCollection::const_iterator jet = calojet.begin();
00899 CaloJetCollection::const_iterator jet2 = jet++;
00900 jetID->calculate(iEvent, *jet2);
00901 if(jetIDbool && ((jet2->emEnergyFraction()>_fEMF || fabs(jet2->eta()) > _feta) && (jetID->fHPD()) < _fHPD && (jetID->n90Hits()) > _n90Hits))
00902 {
00903 v->getMEhisto_DenominatorPt()->Fill((jet->pt() + jet2->pt())/2.);
00904 v->getMEhisto_DenominatorEta()->Fill((jet->eta() + jet2->eta())/2.);
00905 }
00906 }
00907
00908 }
00909 if(calometColl_.isValid() && (v->getObjectType() == trigger::TriggerMET)){
00910 const CaloMETCollection *calometcol = calometColl_.product();
00911 const CaloMET met = calometcol->front();
00912 v->getMEhisto_DenominatorPt()->Fill(met.pt());
00913 v->getMEhisto_DenominatorPhi()->Fill(met.phi());
00914
00915 }
00916
00917 if (numpassed)
00918 {
00919 if(calojetColl_.isValid() && (v->getObjectType() == trigger::TriggerJet)){
00920 bool jetIDbool = false;
00921 if((v->getTriggerType().compare("SingleJet_Trigger") == 0) && calojet.size())
00922 {
00923 CaloJetCollection::const_iterator jet = calojet.begin();
00924 jetID->calculate(iEvent, *jet);
00925 if((jet->emEnergyFraction()>_fEMF || fabs(jet->eta()) > _feta) && (jetID->fHPD()) < _fHPD && (jetID->n90Hits()) > _n90Hits)
00926 {
00927 jetIDbool = true;
00928 v->getMEhisto_NumeratorPt()->Fill(jet->pt());
00929 if (isBarrel(jet->eta())) v->getMEhisto_NumeratorPtBarrel()->Fill(jet->pt());
00930 if (isEndCap(jet->eta())) v->getMEhisto_NumeratorPtEndcap()->Fill(jet->pt());
00931 if (isForward(jet->eta())) v->getMEhisto_NumeratorPtForward()->Fill(jet->pt());
00932 v->getMEhisto_NumeratorEta()->Fill(jet->eta());
00933 v->getMEhisto_NumeratorPhi()->Fill(jet->phi());
00934 v->getMEhisto_NumeratorEtaPhi()->Fill(jet->eta(),jet->phi());
00935 }
00936 }
00937 if((v->getTriggerType().compare("DiJet_Trigger") == 0) && calojet.size() > 1)
00938 {
00939 CaloJetCollection::const_iterator jet = calojet.begin();
00940 CaloJetCollection::const_iterator jet2 = jet++;
00941 jetID->calculate(iEvent, *jet2);
00942 if(jetIDbool && ((jet2->emEnergyFraction()>_fEMF || fabs(jet2->eta()) > _feta) && (jetID->fHPD()) < _fHPD && (jetID->n90Hits()) > _n90Hits))
00943 {
00944 v->getMEhisto_NumeratorPt()->Fill((jet->pt() + jet2->pt())/2.);
00945 v->getMEhisto_NumeratorEta()->Fill((jet->eta() + jet2->eta())/2.);
00946 }
00947 }
00948 }
00949 if(calometColl_.isValid() && (v->getObjectType() == trigger::TriggerMET)){
00950 const CaloMETCollection *calometcol = calometColl_.product();
00951 const CaloMET met = calometcol->front();
00952 v->getMEhisto_NumeratorPt()->Fill(met.pt());
00953 v->getMEhisto_NumeratorPhi()->Fill(met.phi());
00954
00955 }
00956 }
00957 }
00958 }
00959
00960 }
00961
00962
00963 void JetMETHLTOfflineSource::fillMEforEffWrtMuTrigger(const Event & iEvent){
00964
00965 if(! &triggerResults_) {
00966 return;
00967 }
00968 bool muTrig = false;
00969 bool denompassed = false;
00970 for(size_t i=0;i<MuonTrigPaths_.size();++i){
00971 if(isHLTPathAccepted(MuonTrigPaths_[i])){
00972 muTrig = true;
00973 break;
00974 }
00975 }
00976 for(PathInfoCollection::iterator v = hltPathsEffWrtMu_.begin(); v!= hltPathsEffWrtMu_.end(); ++v )
00977 {
00978 bool numpassed = false;
00979 if(muTrig)denompassed = true;
00980
00981 unsigned indexNum = triggerNames_.triggerIndex(v->getPath());
00982 if(indexNum < triggerNames_.size() && triggerResults_->accept(indexNum))numpassed = true;
00983
00984 if(denompassed){
00985 if(calojetColl_.isValid() && (v->getObjectType() == trigger::TriggerJet)){
00986 bool jetIDbool = false;
00987 if((v->getTriggerType().compare("SingleJet_Trigger") == 0) && calojet.size())
00988 {
00989 CaloJetCollection::const_iterator jet = calojet.begin();
00990 jetID->calculate(iEvent, *jet);
00991 if((jet->emEnergyFraction()>_fEMF || fabs(jet->eta()) > _feta) && (jetID->fHPD()) < _fHPD && (jetID->n90Hits()) > _n90Hits)
00992 {
00993 jetIDbool = true;
00994 v->getMEhisto_DenominatorPt()->Fill(jet->pt());
00995 if (isBarrel(jet->eta())) v->getMEhisto_DenominatorPtBarrel()->Fill(jet->pt());
00996 if (isEndCap(jet->eta())) v->getMEhisto_DenominatorPtEndcap()->Fill(jet->pt());
00997 if (isForward(jet->eta())) v->getMEhisto_DenominatorPtForward()->Fill(jet->pt());
00998 v->getMEhisto_DenominatorEta()->Fill(jet->eta());
00999 v->getMEhisto_DenominatorPhi()->Fill(jet->phi());
01000 v->getMEhisto_DenominatorEtaPhi()->Fill(jet->eta(),jet->phi());
01001 }
01002 }
01003 if((v->getTriggerType().compare("DiJet_Trigger") == 0) && calojet.size() > 1)
01004 {
01005 CaloJetCollection::const_iterator jet = calojet.begin();
01006 CaloJetCollection::const_iterator jet2 = jet++;
01007 jetID->calculate(iEvent, *jet2);
01008 if(jetIDbool && ((jet2->emEnergyFraction()>_fEMF || fabs(jet2->eta()) > _feta) && (jetID->fHPD()) < _fHPD && (jetID->n90Hits()) > _n90Hits))
01009 {
01010 v->getMEhisto_DenominatorPt()->Fill((jet->pt() + jet2->pt())/2.);
01011 v->getMEhisto_DenominatorEta()->Fill((jet->eta() + jet2->eta())/2.);
01012 }
01013 }
01014
01015 }
01016 if(calometColl_.isValid() && (v->getObjectType() == trigger::TriggerMET)){
01017 const CaloMETCollection *calometcol = calometColl_.product();
01018 const CaloMET met = calometcol->front();
01019 v->getMEhisto_DenominatorPt()->Fill(met.pt());
01020 v->getMEhisto_DenominatorPhi()->Fill(met.phi());
01021
01022 }
01023
01024 if (numpassed)
01025 {
01026 if(calojetColl_.isValid() && (v->getObjectType() == trigger::TriggerJet)){
01027 bool jetIDbool = false;
01028 if((v->getTriggerType().compare("SingleJet_Trigger") == 0) && calojet.size())
01029 {
01030 CaloJetCollection::const_iterator jet = calojet.begin();
01031 jetID->calculate(iEvent, *jet);
01032 if((jet->emEnergyFraction()>_fEMF || fabs(jet->eta()) > _feta) && (jetID->fHPD()) < _fHPD && (jetID->n90Hits()) > _n90Hits)
01033 {
01034 jetIDbool = true;
01035 v->getMEhisto_NumeratorPt()->Fill(jet->pt());
01036 if (isBarrel(jet->eta())) v->getMEhisto_NumeratorPtBarrel()->Fill(jet->pt());
01037 if (isEndCap(jet->eta())) v->getMEhisto_NumeratorPtEndcap()->Fill(jet->pt());
01038 if (isForward(jet->eta())) v->getMEhisto_NumeratorPtForward()->Fill(jet->pt());
01039 v->getMEhisto_NumeratorEta()->Fill(jet->eta());
01040 v->getMEhisto_NumeratorPhi()->Fill(jet->phi());
01041 v->getMEhisto_NumeratorEtaPhi()->Fill(jet->eta(),jet->phi());
01042 }
01043 }
01044 if((v->getTriggerType().compare("DiJet_Trigger") == 0) && calojet.size() > 1)
01045 {
01046 CaloJetCollection::const_iterator jet = calojet.begin();
01047 CaloJetCollection::const_iterator jet2 = jet++;
01048 jetID->calculate(iEvent, *jet2);
01049 if(jetIDbool && ((jet2->emEnergyFraction()>_fEMF || fabs(jet2->eta()) > _feta) && (jetID->fHPD()) < _fHPD && (jetID->n90Hits()) > _n90Hits))
01050 {
01051 v->getMEhisto_NumeratorPt()->Fill((jet->pt() + jet2->pt())/2.);
01052 v->getMEhisto_NumeratorEta()->Fill((jet->eta() + jet2->eta())/2.);
01053 }
01054 }
01055
01056 }
01057 if(calometColl_.isValid() && (v->getObjectType() == trigger::TriggerMET)){
01058 const CaloMETCollection *calometcol = calometColl_.product();
01059 const CaloMET met = calometcol->front();
01060 v->getMEhisto_NumeratorPt()->Fill(met.pt());
01061 v->getMEhisto_NumeratorPhi()->Fill(met.phi());
01062
01063 }
01064 }
01065 }
01066 }
01067
01068
01069 }
01070
01071
01072 void JetMETHLTOfflineSource::fillMEforEffWrtMBTrigger(const Event & iEvent){
01073
01074 if(! &triggerResults_) {
01075 return;
01076 }
01077 bool mbTrig = false;
01078 bool denompassed = false;
01079 for(size_t i=0;i<MBTrigPaths_.size();++i){
01080 if(isHLTPathAccepted(MBTrigPaths_[i])){
01081 mbTrig = true;
01082 break;
01083 }
01084 }
01085 for(PathInfoCollection::iterator v = hltPathsEffWrtMB_.begin(); v!= hltPathsEffWrtMB_.end(); ++v )
01086 {
01087 bool numpassed = false;
01088 if(mbTrig)denompassed = true;
01089
01090 unsigned indexNum = triggerNames_.triggerIndex(v->getPath());
01091 if(indexNum < triggerNames_.size() && triggerResults_->accept(indexNum))numpassed = true;
01092
01093 if(denompassed){
01094 if(calojetColl_.isValid() && (v->getObjectType() == trigger::TriggerJet)){
01095 bool jetIDbool = false;
01096 if((v->getTriggerType().compare("SingleJet_Trigger") == 0) && calojet.size())
01097 {
01098 CaloJetCollection::const_iterator jet = calojet.begin();
01099 jetID->calculate(iEvent, *jet);
01100 if((jet->emEnergyFraction()>_fEMF || fabs(jet->eta()) > _feta) && (jetID->fHPD()) < _fHPD && (jetID->n90Hits()) > _n90Hits)
01101 {
01102 jetIDbool = true;
01103 v->getMEhisto_DenominatorPt()->Fill(jet->pt());
01104 if (isBarrel(jet->eta())) v->getMEhisto_DenominatorPtBarrel()->Fill(jet->pt());
01105 if (isEndCap(jet->eta())) v->getMEhisto_DenominatorPtEndcap()->Fill(jet->pt());
01106 if (isForward(jet->eta())) v->getMEhisto_DenominatorPtForward()->Fill(jet->pt());
01107 v->getMEhisto_DenominatorEta()->Fill(jet->eta());
01108 v->getMEhisto_DenominatorPhi()->Fill(jet->phi());
01109 v->getMEhisto_DenominatorEtaPhi()->Fill(jet->eta(),jet->phi());
01110 }
01111 }
01112 if((v->getTriggerType().compare("DiJet_Trigger") == 0) && calojet.size() >1)
01113 {
01114 CaloJetCollection::const_iterator jet = calojet.begin();
01115 CaloJetCollection::const_iterator jet2 = jet++;
01116 jetID->calculate(iEvent, *jet2);
01117 if(jetIDbool && ((jet2->emEnergyFraction()>_fEMF || fabs(jet2->eta()) > _feta) && (jetID->fHPD()) < _fHPD && (jetID->n90Hits()) > _n90Hits))
01118 {
01119 v->getMEhisto_DenominatorPt()->Fill((jet->pt() + jet2->pt())/2.);
01120 v->getMEhisto_DenominatorEta()->Fill((jet->eta() + jet2->eta())/2.);
01121 }
01122 }
01123 }
01124 if(calometColl_.isValid() && (v->getObjectType() == trigger::TriggerMET)){
01125 const CaloMETCollection *calometcol = calometColl_.product();
01126 const CaloMET met = calometcol->front();
01127 v->getMEhisto_DenominatorPt()->Fill(met.pt());
01128 v->getMEhisto_DenominatorPhi()->Fill(met.phi());
01129
01130 }
01131
01132 if (numpassed)
01133 {
01134 if(calojetColl_.isValid() && (v->getObjectType() == trigger::TriggerJet)){
01135 bool jetIDbool = false;
01136 if((v->getTriggerType().compare("SingleJet_Trigger") == 0) && calojet.size())
01137 {
01138 CaloJetCollection::const_iterator jet = calojet.begin();
01139 jetID->calculate(iEvent, *jet);
01140 if((jet->emEnergyFraction()>_fEMF || fabs(jet->eta()) > _feta) && (jetID->fHPD()) < _fHPD && (jetID->n90Hits()) > _n90Hits)
01141 {
01142 jetIDbool = true;
01143 v->getMEhisto_NumeratorPt()->Fill(jet->pt());
01144 if (isBarrel(jet->eta())) v->getMEhisto_NumeratorPtBarrel()->Fill(jet->pt());
01145 if (isEndCap(jet->eta())) v->getMEhisto_NumeratorPtEndcap()->Fill(jet->pt());
01146 if (isForward(jet->eta())) v->getMEhisto_NumeratorPtForward()->Fill(jet->pt());
01147 v->getMEhisto_NumeratorEta()->Fill(jet->eta());
01148 v->getMEhisto_NumeratorPhi()->Fill(jet->phi());
01149 v->getMEhisto_NumeratorEtaPhi()->Fill(jet->eta(),jet->phi());
01150 }
01151 }
01152 if((v->getTriggerType().compare("DiJet_Trigger") == 0) && calojet.size() > 1)
01153 {
01154 CaloJetCollection::const_iterator jet = calojet.begin();
01155 CaloJetCollection::const_iterator jet2 = jet++;
01156 jetID->calculate(iEvent, *jet2);
01157 if(jetIDbool && ((jet2->emEnergyFraction()>_fEMF || fabs(jet2->eta()) > _feta) && (jetID->fHPD()) < _fHPD && (jetID->n90Hits()) > _n90Hits))
01158 {
01159 v->getMEhisto_NumeratorPt()->Fill((jet->pt() + jet2->pt())/2.);
01160 v->getMEhisto_NumeratorEta()->Fill((jet->eta() + jet2->eta())/2.);
01161 }
01162 }
01163 }
01164 if(calometColl_.isValid() && (v->getObjectType() == trigger::TriggerMET)){
01165 const CaloMETCollection *calometcol = calometColl_.product();
01166 const CaloMET met = calometcol->front();
01167 v->getMEhisto_NumeratorPt()->Fill(met.pt());
01168 v->getMEhisto_NumeratorPhi()->Fill(met.phi());
01169
01170 }
01171 }
01172 }
01173 }
01174
01175
01176 }
01177
01178
01179
01180 void JetMETHLTOfflineSource::beginJob(){
01181
01182 }
01183
01184
01185 void JetMETHLTOfflineSource::beginRun(const edm::Run& run, const edm::EventSetup& c){
01186 if(!isSetup_)
01187 {
01188 DQMStore *dbe = 0;
01189 dbe = Service<DQMStore>().operator->();
01190 if (dbe) {
01191 dbe->setCurrentFolder(dirname_);
01192 dbe->rmdir(dirname_);
01193 }
01194 if (dbe) {
01195 dbe->setCurrentFolder(dirname_);
01196 }
01197
01198
01199 bool changed(true);
01200 if (!hltConfig_.init(run, c, processname_, changed)) {
01201 LogDebug("HLTJetMETDQMSource") << "HLTConfigProvider failed to initialize.";
01202 }
01203
01204
01205
01206
01207
01208
01209
01210
01211
01212
01213
01214 const unsigned int n(hltConfig_.size());
01215 int singleJet = 0;
01216 int diJet = 0;
01217 int met = 0;
01218 for (unsigned int i=0; i!=n; ++i) {
01219 bool denomFound = false;
01220 bool numFound = false;
01221 bool mbFound = false;
01222 bool muFound = false;
01223 std::string pathname = hltConfig_.triggerName(i);
01224 if(verbose_)cout<<"==pathname=="<<pathname<<endl;
01225 std::string dpathname = MuonTrigPaths_[0];
01226 std::string l1pathname = "dummy";
01227 std::string denompathname = "";
01228 unsigned int usedPrescale = 1;
01229 unsigned int objectType = 0;
01230 std::string triggerType = "";
01231 std::string filtername("dummy");
01232 std::string Denomfiltername("denomdummy");
01233
01234 if (pathname.find("Jet") != std::string::npos && !(pathname.find("DoubleJet") != std::string::npos) && !(pathname.find("DiJet") != std::string::npos) && !(pathname.find("BTag") != std::string::npos) && !(pathname.find("Mu") != std::string::npos) && !(pathname.find("Fwd") != std::string::npos)){
01235 triggerType = "SingleJet_Trigger";
01236 objectType = trigger::TriggerJet;
01237 }
01238 if (pathname.find("DiJet") != std::string::npos || pathname.find("DoubleJet") != std::string::npos){
01239 triggerType = "DiJet_Trigger";
01240 objectType = trigger::TriggerJet;
01241 }
01242 if (pathname.find("MET") != std::string::npos || pathname.find("HT") != std::string::npos){
01243 triggerType = "MET_Trigger";
01244 objectType = trigger::TriggerMET;
01245 }
01246
01247
01248 if(objectType == trigger::TriggerJet && !(pathname.find("DiJet") != std::string::npos) && !(pathname.find("DoubleJet") != std::string::npos))
01249 {
01250 singleJet++;
01251 if(singleJet > 1)dpathname = dpathname = hltConfig_.triggerName(i-1);
01252 if(singleJet == 1)dpathname = MuonTrigPaths_[0];
01253 }
01254
01255 if(objectType == trigger::TriggerJet && (pathname.find("DiJet") != std::string::npos))
01256 {
01257 diJet++;
01258 if(diJet > 1)dpathname = dpathname = hltConfig_.triggerName(i-1);
01259 if(diJet == 1)dpathname = MuonTrigPaths_[0];
01260 }
01261 if(objectType == trigger::TriggerMET )
01262 {
01263 met++;
01264 if(met > 1)dpathname = dpathname = hltConfig_.triggerName(i-1);
01265 if(met == 1)dpathname = MuonTrigPaths_[0];
01266 }
01267
01268
01269
01270
01271 for (unsigned int i=0; i!=n; ++i) {
01272 std::string HLTname = hltConfig_.triggerName(i);
01273 if(HLTname == pathname)numFound = true;
01274 if(HLTname == dpathname)denomFound = true;
01275 if(HLTname == MBTrigPaths_[0])mbFound = true;
01276 if(HLTname == MuonTrigPaths_[0])muFound = true;
01277 }
01278
01279 if(numFound)
01280 {
01281 std::vector<std::string> numpathmodules = hltConfig_.moduleLabels(pathname);
01282 for(std::vector<std::string>::iterator numpathmodule = numpathmodules.begin(); numpathmodule!= numpathmodules.end(); ++numpathmodule ) {
01283 edm::InputTag testTag(*numpathmodule,"",processname_);
01284 if ((hltConfig_.moduleType(*numpathmodule) == "HLT1CaloJet")|| (hltConfig_.moduleType(*numpathmodule) == "HLTDiJetAveFilter") || (hltConfig_.moduleType(*numpathmodule) == "HLT1CaloMET" ) || (hltConfig_.moduleType(*numpathmodule) == "HLTPrescaler") )filtername = *numpathmodule;
01285 if (hltConfig_.moduleType(*numpathmodule) == "HLTLevel1GTSeed")l1pathname = *numpathmodule;
01286 }
01287 }
01288
01289 if(objectType != 0 && denomFound)
01290 {
01291 std::vector<std::string> numpathmodules = hltConfig_.moduleLabels(dpathname);
01292 for(std::vector<std::string>::iterator numpathmodule = numpathmodules.begin(); numpathmodule!= numpathmodules.end(); ++numpathmodule ) {
01293 edm::InputTag testTag(*numpathmodule,"",processname_);
01294 if ((hltConfig_.moduleType(*numpathmodule) == "HLT1CaloJet")|| (hltConfig_.moduleType(*numpathmodule) == "HLTDiJetAveFilter") || (hltConfig_.moduleType(*numpathmodule) == "HLT1CaloMET" ) || (hltConfig_.moduleType(*numpathmodule) == "HLTPrescaler") )Denomfiltername = *numpathmodule;
01295 }
01296 }
01297
01298 if(objectType != 0 && numFound)
01299 {
01300 if(verbose_)cout<<"==pathname=="<<pathname<<"==denompath=="<<dpathname<<"==filtername=="<<filtername<<"==denomfiltername=="<<Denomfiltername<<"==l1pathname=="<<l1pathname<<"==objectType=="<<objectType<<endl;
01301 if(!((pathname.find("HT") != std::string::npos) || (pathname.find("Quad") != std::string::npos)))
01302 {
01303 hltPathsAll_.push_back(PathInfo(usedPrescale, dpathname, pathname, l1pathname, filtername, Denomfiltername, processname_, objectType, triggerType));
01304 if(muFound)hltPathsAllWrtMu_.push_back(PathInfo(usedPrescale, dpathname, pathname, l1pathname, filtername, Denomfiltername, processname_, objectType, triggerType));
01305 if(muFound)hltPathsEffWrtMu_.push_back(PathInfo(usedPrescale, dpathname, pathname, l1pathname, filtername, Denomfiltername, processname_, objectType, triggerType));
01306 if(mbFound)hltPathsEffWrtMB_.push_back(PathInfo(usedPrescale, dpathname, pathname, l1pathname, filtername, Denomfiltername, processname_, objectType, triggerType));
01307
01308 if(!nameForEff_ && denomFound) hltPathsEff_.push_back(PathInfo(usedPrescale, dpathname, pathname, l1pathname, filtername, Denomfiltername, processname_, objectType, triggerType));
01309 }
01310
01311 hltPathsAllTriggerSummary_.push_back(PathInfo(usedPrescale, dpathname, pathname, l1pathname, filtername, Denomfiltername, processname_, objectType, triggerType));
01312
01313 }
01314 }
01315
01316
01317 if(nameForEff_)
01318 {
01319 std::string l1pathname = "dummy";
01320 std::string denompathname = "";
01321 unsigned int usedPrescale = 1;
01322 unsigned int objectType = 0;
01323 std::string triggerType = "";
01324 std::string filtername("dummy");
01325 std::string Denomfiltername("denomdummy");
01326 for (std::vector<std::pair<std::string, std::string> >::iterator custompathnamepair = custompathnamepairs_.begin(); custompathnamepair != custompathnamepairs_.end(); ++custompathnamepair)
01327 {
01328 std::string pathname = custompathnamepair->first;
01329 std::string dpathname = custompathnamepair->second;
01330 bool numFound = false;
01331 bool denomFound = false;
01332
01333 for (unsigned int i=0; i!=n; ++i) {
01334 std::string HLTname = hltConfig_.triggerName(i);
01335 if(HLTname == pathname)numFound = true;
01336 if(HLTname == dpathname)denomFound = true;
01337 }
01338 if(numFound && denomFound)
01339 {
01340 if (pathname.find("Jet") != std::string::npos && !(pathname.find("DiJet") != std::string::npos) && !(pathname.find("DoubleJet") != std::string::npos) && !(pathname.find("BTag") != std::string::npos) && !(pathname.find("Mu") != std::string::npos) && !(pathname.find("Fwd") != std::string::npos)){
01341 triggerType = "SingleJet_Trigger";
01342 objectType = trigger::TriggerJet;
01343 }
01344 if (pathname.find("DiJet") != std::string::npos || pathname.find("DoubleJet") != std::string::npos ){
01345 triggerType = "DiJet_Trigger";
01346 objectType = trigger::TriggerJet;
01347 }
01348 if (pathname.find("MET") != std::string::npos ){
01349 triggerType = "MET_Trigger";
01350 objectType = trigger::TriggerMET;
01351 }
01352
01353 std::vector<std::string> numpathmodules = hltConfig_.moduleLabels(pathname);
01354 for(std::vector<std::string>::iterator numpathmodule = numpathmodules.begin(); numpathmodule!= numpathmodules.end(); ++numpathmodule ) {
01355 edm::InputTag testTag(*numpathmodule,"",processname_);
01356 if ((hltConfig_.moduleType(*numpathmodule) == "HLT1CaloJet")|| (hltConfig_.moduleType(*numpathmodule) == "HLTDiJetAveFilter") || (hltConfig_.moduleType(*numpathmodule) == "HLT1CaloMET" ) || (hltConfig_.moduleType(*numpathmodule) == "HLTPrescaler") )filtername = *numpathmodule;
01357 if (hltConfig_.moduleType(*numpathmodule) == "HLTLevel1GTSeed")l1pathname = *numpathmodule;
01358 }
01359
01360 if(objectType != 0)
01361 {
01362 std::vector<std::string> numpathmodules = hltConfig_.moduleLabels(dpathname);
01363 for(std::vector<std::string>::iterator numpathmodule = numpathmodules.begin(); numpathmodule!= numpathmodules.end(); ++numpathmodule ) {
01364 edm::InputTag testTag(*numpathmodule,"",processname_);
01365 if ((hltConfig_.moduleType(*numpathmodule) == "HLT1CaloJet")|| (hltConfig_.moduleType(*numpathmodule) == "HLTDiJetAveFilter") || (hltConfig_.moduleType(*numpathmodule) == "HLT1CaloMET" ) || (hltConfig_.moduleType(*numpathmodule) == "HLTPrescaler") )Denomfiltername = *numpathmodule;
01366 }
01367
01368 if(verbose_)cout<<"==pathname=="<<pathname<<"==denompath=="<<dpathname<<"==filtername=="<<filtername<<"==denomfiltername=="<<Denomfiltername<<"==l1pathname=="<<l1pathname<<"==objectType=="<<objectType<<endl;
01369 hltPathsEff_.push_back(PathInfo(usedPrescale, dpathname, pathname, l1pathname, filtername, Denomfiltername, processname_, objectType, triggerType));
01370
01371 }
01372 }
01373 }
01374 }
01375
01376
01377 if(!isSetup_)
01378 {
01379 std::string foldernm = "/TriggerSummary/";
01380 if (dbe) {
01381 dbe->setCurrentFolder(dirname_ + foldernm);
01382 }
01383 int TrigBins_ = hltPathsAllTriggerSummary_.size();
01384 double TrigMin_ = -0.5;
01385 double TrigMax_ = hltPathsAllTriggerSummary_.size()-0.5;
01386 std::string histonm="JetMET_TriggerRate";
01387 std::string histot="JetMET TriggerRate Summary";
01388
01389 rate_All = dbe->book1D(histonm.c_str(),histot.c_str(),TrigBins_,TrigMin_,TrigMax_);
01390
01391
01392 histonm="JetMET_TriggerRate_Correlation";
01393 histot="JetMET TriggerRate Correlation Summary;y&&!x;x&&y";
01394
01395 correlation_All = dbe->book2D(histonm.c_str(),histot.c_str(),TrigBins_,TrigMin_,TrigMax_,TrigBins_,TrigMin_,TrigMax_);
01396
01397
01398 histonm="JetMET_TriggerRate_WrtMuTrigger";
01399 histot="JetMET TriggerRate Summary Wrt Muon Trigger ";
01400
01401 rate_AllWrtMu = dbe->book1D(histonm.c_str(),histot.c_str(),TrigBins_,TrigMin_,TrigMax_);
01402
01403
01404 histonm="JetMET_TriggerRate_Correlation_WrtMuTrigger";
01405 histot="JetMET TriggerRate Correlation Summary Wrt Muon Trigger;y&&!x;x&&y";
01406
01407 correlation_AllWrtMu = dbe->book2D(histonm.c_str(),histot.c_str(),TrigBins_,TrigMin_,TrigMax_,TrigBins_,TrigMin_,TrigMax_);
01408
01409 histonm="JetMET_TriggerRate_WrtMBTrigger";
01410 histot="JetMET TriggerRate Summary Wrt MB Trigger";
01411
01412 rate_AllWrtMB = dbe->book1D(histonm.c_str(),histot.c_str(),TrigBins_,TrigMin_,TrigMax_);
01413
01414
01415 histonm="JetMET_TriggerRate_Correlation_WrtMBTrigger";
01416 histot="JetMET TriggerRate Correlation Wrt MB Trigger;y&&!x;x&&y";
01417
01418 correlation_AllWrtMB = dbe->book2D(histonm.c_str(),histot.c_str(),TrigBins_,TrigMin_,TrigMax_,TrigBins_,TrigMin_,TrigMax_);
01419 isSetup_ = true;
01420
01421 }
01422
01423
01424 for(PathInfoCollection::iterator v = hltPathsAllTriggerSummary_.begin(); v!= hltPathsAllTriggerSummary_.end(); ++v ){
01425 std::string labelnm("dummy");
01426 labelnm = v->getPath();
01427 int nbins = rate_All->getTH1()->GetNbinsX();
01428 for(int ibin=1; ibin<nbins+1; ibin++)
01429 {
01430 const char * binLabel = rate_All->getTH1()->GetXaxis()->GetBinLabel(ibin);
01431 std::string binLabel_str = string(binLabel);
01432 if(binLabel_str.compare(labelnm)==0)break;
01433 if(binLabel[0]=='\0')
01434 {
01435 rate_All->setBinLabel(ibin,labelnm);
01436 rate_AllWrtMu->setBinLabel(ibin,labelnm);
01437 rate_AllWrtMB->setBinLabel(ibin,labelnm);
01438 correlation_All->setBinLabel(ibin,labelnm,1);
01439 correlation_AllWrtMu->setBinLabel(ibin,labelnm,1);
01440 correlation_AllWrtMB->setBinLabel(ibin,labelnm,1);
01441 correlation_All->setBinLabel(ibin,labelnm,2);
01442 correlation_AllWrtMu->setBinLabel(ibin,labelnm,2);
01443 correlation_AllWrtMB->setBinLabel(ibin,labelnm,2);
01444 break;
01445 }
01446 }
01447
01448 }
01449
01450
01451 if(plotAll_)
01452 {
01453 int Nbins_ = 10;
01454 int Nmin_ = -0.5;
01455 int Nmax_ = 9.5;
01456 int Ptbins_ = 40;
01457 int Etabins_ = 40;
01458 int Phibins_ = 35;
01459 int Resbins_ = 30;
01460 double PtMin_ = 0.;
01461 double PtMax_ = 200.;
01462 double EtaMin_ = -5.;
01463 double EtaMax_ = 5.;
01464 double PhiMin_ = -3.14159;
01465 double PhiMax_ = 3.14159;
01466 double ResMin_ = -1.5;
01467 double ResMax_ = 1.5;
01468 std::string dirName = dirname_ + "/MonitorAllTriggers/";
01469 for(PathInfoCollection::iterator v = hltPathsAll_.begin(); v!= hltPathsAll_.end(); ++v ){
01470
01471 std::string subdirName = dirName + v->getPath();
01472 std::string trigPath = "("+v->getPath()+")";
01473 dbe->setCurrentFolder(subdirName);
01474
01475 MonitorElement *dummy, *N, *Pt, *PtBarrel, *PtEndcap, *PtForward, *Eta, *Phi, *EtaPhi,
01476 *N_L1, *Pt_L1, *PtBarrel_L1, *PtEndcap_L1, *PtForward_L1, *Eta_L1, *Phi_L1, *EtaPhi_L1,
01477 *N_HLT, *Pt_HLT, *PtBarrel_HLT, *PtEndcap_HLT, *PtForward_HLT, *Eta_HLT, *Phi_HLT, *EtaPhi_HLT,
01478 *PtResolution_L1HLT, *EtaResolution_L1HLT,*PhiResolution_L1HLT,
01479 *PtResolution_HLTRecObj, *EtaResolution_HLTRecObj,*PhiResolution_HLTRecObj,
01480 *PtCorrelation_L1HLT,*EtaCorrelation_L1HLT,*PhiCorrelation_L1HLT,
01481 *PtCorrelation_HLTRecObj,*EtaCorrelation_HLTRecObj,*PhiCorrelation_HLTRecObj,
01482 *jetAveragePt, *jetAverageEta, *jetPhiDifference, *hltAveragePt, *hltAverageEta, *hltPhiDifference;
01483
01484 dummy = dbe->bookFloat("dummy");
01485 N = dbe->bookFloat("N");
01486 Pt = dbe->bookFloat("Pt");
01487 PtBarrel = dbe->bookFloat("PtBarrel");
01488 PtEndcap = dbe->bookFloat("PtEndcap");
01489 PtForward = dbe->bookFloat("PtForward");
01490 Eta = dbe->bookFloat("Eta");
01491 Phi = dbe->bookFloat("Phi");
01492 EtaPhi = dbe->bookFloat("EtaPhi");
01493 N_L1 = dbe->bookFloat("N_L1");
01494 Pt_L1 = dbe->bookFloat("Pt_L1");
01495 PtBarrel_L1 = dbe->bookFloat("PtBarrel_L1");
01496 PtEndcap_L1 = dbe->bookFloat("PtEndcap_L1");
01497 PtForward_L1 = dbe->bookFloat("PtForward_L1");
01498 Eta_L1 = dbe->bookFloat("Eta_L1");
01499 Phi_L1 = dbe->bookFloat("Phi_L1");
01500 EtaPhi_L1 = dbe->bookFloat("EtaPhi_L1");
01501
01502 N_HLT = dbe->bookFloat("N_HLT");
01503 Pt_HLT = dbe->bookFloat("Pt_HLT");
01504 PtBarrel_HLT = dbe->bookFloat("PtBarrel_HLT");
01505 PtEndcap_HLT = dbe->bookFloat("PtEndcap_HLT");
01506 PtForward_HLT = dbe->bookFloat("PtForward_HLT");
01507 Eta_HLT = dbe->bookFloat("Eta_HLT");
01508 Phi_HLT = dbe->bookFloat("Phi_HLT");
01509 EtaPhi_HLT = dbe->bookFloat("EtaPhi_HLT");
01510
01511 PtResolution_L1HLT = dbe->bookFloat("PtResolution_L1HLT");
01512 EtaResolution_L1HLT = dbe->bookFloat("EtaResolution_L1HLT");
01513 PhiResolution_L1HLT = dbe->bookFloat("PhiResolution_L1HLT");
01514 PtResolution_HLTRecObj = dbe->bookFloat("PtResolution_HLTRecObj");
01515 EtaResolution_HLTRecObj = dbe->bookFloat("EtaResolution_HLTRecObj");
01516 PhiResolution_HLTRecObj = dbe->bookFloat("PhiResolution_HLTRecObj");
01517 PtCorrelation_L1HLT = dbe->bookFloat("PtCorrelation_L1HLT");
01518 EtaCorrelation_L1HLT = dbe->bookFloat("EtaCorrelation_L1HLT");
01519 PhiCorrelation_L1HLT = dbe->bookFloat("PhiCorrelation_L1HLT");
01520 PtCorrelation_HLTRecObj = dbe->bookFloat("PtCorrelation_HLTRecObj");
01521 EtaCorrelation_HLTRecObj = dbe->bookFloat("EtaCorrelation_HLTRecObj");
01522 PhiCorrelation_HLTRecObj = dbe->bookFloat("PhiCorrelation_HLTRecObj");
01523
01524 jetAveragePt = dbe->bookFloat("jetAveragePt");
01525 jetAverageEta = dbe->bookFloat("jetAverageEta");
01526 jetPhiDifference = dbe->bookFloat("jetPhiDifference");
01527 hltAveragePt = dbe->bookFloat("hltAveragePt");
01528 hltAverageEta = dbe->bookFloat("hltAverageEta");
01529 hltPhiDifference = dbe->bookFloat("hltPhiDifference");
01530
01531 std::string labelname("ME");
01532 std::string histoname(labelname+"");
01533 std::string title(labelname+"");
01534 if(v->getObjectType() == trigger::TriggerJet)
01535 {
01536
01537 histoname = labelname+"_recObjN";
01538 title = labelname+"_recObjN;Reco multiplicity()"+trigPath;
01539 N = dbe->book1D(histoname.c_str(),title.c_str(),Nbins_,Nmin_,Nmax_);
01540 N->getTH1();
01541
01542
01543 histoname = labelname+"_recObjPt";
01544 title = labelname+"_recObjPt; Reco Pt[GeV/c]"+trigPath;
01545 Pt = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
01546 Pt->getTH1();
01547
01548
01549 histoname = labelname+"_recObjPtBarrel";
01550 title = labelname+"_recObjPtBarrel;Reco Pt[GeV/c]"+trigPath;
01551 PtBarrel = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
01552 PtBarrel->getTH1();
01553
01554
01555 histoname = labelname+"_recObjPtEndcap";
01556 title = labelname+"_recObjPtEndcap;Reco Pt[GeV/c]"+trigPath;
01557 PtEndcap = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
01558 PtEndcap->getTH1();
01559
01560
01561 histoname = labelname+"_recObjPtForward";
01562 title = labelname+"_recObjPtForward;Reco Pt[GeV/c]"+trigPath;
01563 PtForward = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
01564 PtForward->getTH1();
01565
01566
01567 histoname = labelname+"_recObjEta";
01568 title = labelname+"_recObjEta;Reco #eta"+trigPath;
01569 Eta = dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
01570 Eta->getTH1();
01571
01572
01573 histoname = labelname+"_recObjPhi";
01574 title = labelname+"_recObjPhi;Reco #Phi"+trigPath;
01575 Phi = dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
01576 Phi->getTH1();
01577
01578
01579 histoname = labelname+"_recObjEtaPhi";
01580 title = labelname+"_recObjEtaPhi;Reco #eta;Reco #Phi"+trigPath;
01581 EtaPhi = dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
01582 EtaPhi->getTH1();
01583
01584
01585
01586 histoname = labelname+"_l1ObjN";
01587 title = labelname+"_l1ObjN;L1 multiplicity"+trigPath;
01588 N_L1 = dbe->book1D(histoname.c_str(),title.c_str(),Nbins_,Nmin_,Nmax_);
01589 N_L1->getTH1();
01590
01591
01592 histoname = labelname+"_l1ObjPt";
01593 title = labelname+"_l1ObjPt;L1 Pt[GeV/c]"+trigPath;
01594 Pt_L1 = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
01595 Pt_L1->getTH1();
01596
01597
01598 histoname = labelname+"_l1ObjPtBarrel";
01599 title = labelname+"_l1ObjPtBarrel;L1 Pt[GeV/c]"+trigPath;
01600 PtBarrel_L1 = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
01601 PtBarrel_L1->getTH1();
01602
01603
01604 histoname = labelname+"_l1ObjPtEndcap";
01605 title = labelname+"_l1ObjPtEndcap;L1 Pt[GeV/c]"+trigPath;
01606 PtEndcap_L1 = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
01607 PtEndcap_L1->getTH1();
01608
01609
01610 histoname = labelname+"_l1ObjPtForward";
01611 title = labelname+"_l1ObjPtForward;L1 Pt[GeV/c]"+trigPath;
01612 PtForward_L1 = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
01613 PtForward_L1->getTH1();
01614
01615
01616 histoname = labelname+"_l1ObjEta";
01617 title = labelname+"_l1ObjEta;L1 #eta"+trigPath;
01618 Eta_L1 = dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
01619 Eta_L1->getTH1();
01620
01621
01622 histoname = labelname+"_l1ObjPhi";
01623 title = labelname+"_l1ObjPhi;L1 #Phi"+trigPath;
01624 Phi_L1 = dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
01625 Phi_L1->getTH1();
01626
01627
01628 histoname = labelname+"_l1ObjEtaPhi";
01629 title = labelname+"_l1ObjEtaPhi;L1 #eta;L1 #Phi"+trigPath;
01630 EtaPhi_L1 = dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
01631 EtaPhi_L1->getTH1();
01632
01633
01634 histoname = labelname+"_hltObjN";
01635 title = labelname+"_hltObjN;HLT multiplicity"+trigPath;
01636 N_HLT = dbe->book1D(histoname.c_str(),title.c_str(),Nbins_,Nmin_,Nmax_);
01637 N_HLT->getTH1();
01638
01639
01640 histoname = labelname+"_hltObjPt";
01641 title = labelname+"_hltObjPt;HLT Pt[GeV/c]"+trigPath;
01642 Pt_HLT = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
01643 Pt_HLT->getTH1();
01644
01645
01646 histoname = labelname+"_hltObjPtBarrel";
01647 title = labelname+"_hltObjPtBarrel;HLT Pt[GeV/c]"+trigPath;
01648 PtBarrel_HLT = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
01649 PtBarrel_HLT->getTH1();
01650
01651
01652 histoname = labelname+"_hltObjPtEndcap";
01653 title = labelname+"_hltObjPtEndcap;HLT Pt[GeV/c]"+trigPath;
01654 PtEndcap_HLT = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
01655 PtEndcap_HLT->getTH1();
01656
01657
01658 histoname = labelname+"_hltObjPtForward";
01659 title = labelname+"_hltObjPtForward;HLT Pt[GeV/c]"+trigPath;
01660 PtForward_HLT = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
01661 PtForward_HLT->getTH1();
01662
01663
01664 histoname = labelname+"_hltObjEta";
01665 title = labelname+"_hltObjEta;HLT #eta"+trigPath;
01666 Eta_HLT = dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
01667 Eta_HLT->getTH1();
01668
01669
01670 histoname = labelname+"_hltObjPhi";
01671 title = labelname+"_hltObjPhi;HLT #Phi"+trigPath;
01672 Phi_HLT = dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
01673 Phi_HLT->getTH1();
01674
01675
01676 histoname = labelname+"_hltObjEtaPhi";
01677 title = labelname+"_hltObjEtaPhi;HLT #eta;HLT #Phi"+trigPath;
01678 EtaPhi_HLT = dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
01679 EtaPhi_HLT->getTH1();
01680
01681
01682 histoname = labelname+"_l1HLTPtResolution";
01683 title = labelname+"_l1HLTPtResolution;(Pt(L1)-Pt(HLT))/Pt(L1)"+trigPath;
01684 PtResolution_L1HLT = dbe->book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
01685 PtResolution_L1HLT->getTH1();
01686
01687
01688 histoname = labelname+"_l1HLTEtaResolution";
01689 title = labelname+"_l1HLTEtaResolution;(#eta(L1)-#eta(HLT))/#eta(L1)"+trigPath;
01690 EtaResolution_L1HLT = dbe->book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
01691 EtaResolution_L1HLT->getTH1();
01692
01693
01694 histoname = labelname+"_l1HLTPhiResolution";
01695 title = labelname+"_l1HLTPhiResolution;(#Phi(L1)-#Phi(HLT))/#Phi(L1)"+trigPath;
01696 PhiResolution_L1HLT = dbe->book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
01697 PhiResolution_L1HLT->getTH1();
01698
01699
01700 histoname = labelname+"_l1HLTPtCorrelation";
01701 title = labelname+"_l1HLTPtCorrelation;Pt(L1)[GeV/c];Pt(HLT)[GeV/c]"+trigPath;
01702 PtCorrelation_L1HLT = dbe->book2D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_,Ptbins_,PtMin_,PtMax_);
01703 PtCorrelation_L1HLT->getTH1();
01704
01705
01706 histoname = labelname+"_l1HLTEtaCorrelation";
01707 title = labelname+"_l1HLTEtaCorrelation;#eta(L1);#eta(HLT)"+trigPath;
01708 EtaCorrelation_L1HLT = dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Etabins_,EtaMin_,EtaMax_);
01709 EtaCorrelation_L1HLT->getTH1();
01710
01711
01712 histoname = labelname+"_l1HLTPhiCorrelation";
01713 title = labelname+"_l1HLTPhiCorrelation;#Phi(L1);#Phi(HLT)"+trigPath;
01714 PhiCorrelation_L1HLT = dbe->book2D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_,Phibins_,PhiMin_,PhiMax_);
01715 PhiCorrelation_L1HLT->getTH1();
01716
01717
01718
01719 histoname = labelname+"_hltRecObjPtResolution";
01720 title = labelname+"_hltRecObjPtResolution;(Pt(HLT)-Pt(Reco))/Pt(HLT)"+trigPath;
01721 PtResolution_HLTRecObj = dbe->book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
01722 PtResolution_HLTRecObj->getTH1();
01723
01724
01725 histoname = labelname+"_hltRecObjEtaResolution";
01726 title = labelname+"_hltRecObjEtaResolution;(#eta(HLT)-#eta(Reco))/#eta(HLT)"+trigPath;
01727 EtaResolution_HLTRecObj = dbe->book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
01728 EtaResolution_HLTRecObj->getTH1();
01729
01730
01731 histoname = labelname+"_hltRecObjPhiResolution";
01732 title = labelname+"_hltRecObjPhiResolution;(#Phi(HLT)-#Phi(Reco))/#Phi(HLT)"+trigPath;
01733 PhiResolution_HLTRecObj = dbe->book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
01734 PhiResolution_HLTRecObj->getTH1();
01735
01736
01737
01738 histoname = labelname+"_hltRecObjPtCorrelation";
01739 title = labelname+"_hltRecObjPtCorrelation;Pt(HLT)[GeV/c];Pt(Reco)[GeV/c]"+trigPath;
01740 PtCorrelation_HLTRecObj = dbe->book2D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_,Ptbins_,PtMin_,PtMax_);
01741 PtCorrelation_HLTRecObj->getTH1();
01742
01743
01744 histoname = labelname+"_hltRecObjEtaCorrelation";
01745 title = labelname+"_hltRecObjEtaCorrelation;#eta(HLT);#eta(Reco)"+trigPath;
01746 EtaCorrelation_HLTRecObj = dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Etabins_,EtaMin_,EtaMax_);
01747 EtaCorrelation_HLTRecObj->getTH1();
01748
01749
01750 histoname = labelname+"_hltRecObjPhiCorrelation";
01751 title = labelname+"_hltRecObjPhiCorrelation;#Phi(HLT);#Phi(Reco)"+trigPath;
01752 PhiCorrelation_HLTRecObj = dbe->book2D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_,Phibins_,PhiMin_,PhiMax_);
01753 PhiCorrelation_HLTRecObj->getTH1();
01754
01755
01756 if((v->getTriggerType().compare("DiJet_Trigger") == 0))
01757 {
01758 histoname = labelname+"_RecObjAveragePt";
01759 title = labelname+"_RecObjAveragePt;Reco Average Pt[GeV/c]"+trigPath;
01760 jetAveragePt = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
01761 jetAveragePt->getTH1();
01762
01763
01764 histoname = labelname+"_RecObjAverageEta";
01765 title = labelname+"_RecObjAverageEta;Reco Average #eta"+trigPath;
01766 jetAverageEta = dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
01767 jetAverageEta->getTH1();
01768
01769
01770 histoname = labelname+"_RecObjPhiDifference";
01771 title = labelname+"_RecObjPhiDifference;Reco #Delta#Phi"+trigPath;
01772 jetPhiDifference = dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
01773 jetPhiDifference->getTH1();
01774
01775
01776 histoname = labelname+"_hltObjAveragePt";
01777 title = labelname+"_hltObjAveragePt;HLT Average Pt[GeV/c]"+trigPath;
01778 hltAveragePt = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
01779 hltAveragePt->getTH1();
01780
01781
01782 histoname = labelname+"_hltObjAverageEta";
01783 title = labelname+"_hltObjAverageEta;HLT Average #eta"+trigPath;
01784 hltAverageEta = dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
01785 hltAverageEta->getTH1();
01786
01787
01788 histoname = labelname+"_hltObjPhiDifference";
01789 title = labelname+"_hltObjPhiDifference;Reco #Delta#Phi"+trigPath;
01790 hltPhiDifference = dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
01791 hltPhiDifference->getTH1();
01792
01793
01794 }
01795
01796 }
01797
01798
01799 if(v->getObjectType() == trigger::TriggerMET)
01800 {
01801 histoname = labelname+"_recObjPt";
01802 title = labelname+"_recObjPt;Reco Pt[GeV/c]"+trigPath;
01803 Pt = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
01804 Pt->getTH1();
01805
01806
01807
01808 histoname = labelname+"_recObjPhi";
01809 title = labelname+"_recObjPhi;Reco #Phi"+trigPath;
01810 Phi = dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
01811 Phi->getTH1();
01812
01813
01814 histoname = labelname+"_l1ObjPt";
01815 title = labelname+"_l1ObjPt;L1 Pt[GeV/c]"+trigPath;
01816 Pt_L1 = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
01817 Pt_L1->getTH1();
01818
01819
01820
01821 histoname = labelname+"_l1ObjPhi";
01822 title = labelname+"_l1ObjPhi;L1 #Phi"+trigPath;
01823 Phi_L1 = dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
01824 Phi_L1->getTH1();
01825
01826
01827
01828 histoname = labelname+"_hltObjPt";
01829 title = labelname+"_hltObjPt;HLT Pt[GeV/c]"+trigPath;
01830 Pt_HLT = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
01831 Pt_HLT->getTH1();
01832
01833
01834
01835 histoname = labelname+"_hltObjPhi";
01836 title = labelname+"_hltObjPhi;HLT #Phi"+trigPath;
01837 Phi_HLT = dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
01838 Phi_HLT->getTH1();
01839
01840
01841
01842 histoname = labelname+"_l1HLTPtResolution";
01843 title = labelname+"_l1HLTPtResolution;(Pt(L1)-Pt(HLT))/Pt(L1)"+trigPath;
01844 PtResolution_L1HLT = dbe->book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
01845 PtResolution_L1HLT->getTH1();
01846
01847
01848
01849 histoname = labelname+"_l1HLTPhiResolution";
01850 title = labelname+"_l1HLTPhiResolution;(#Phi(L1)-#Phi(HLT))/#Phi(L1)"+trigPath;
01851 PhiResolution_L1HLT = dbe->book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
01852 PhiResolution_L1HLT->getTH1();
01853
01854
01855
01856
01857 histoname = labelname+"_l1HLTPtCorrelation";
01858 title = labelname+"_l1HLTPtCorrelation;Pt(L1)[GeV/c];Pt(HLT)[GeV/c]"+trigPath;
01859 PtCorrelation_L1HLT = dbe->book2D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_,Ptbins_,PtMin_,PtMax_);
01860 PtCorrelation_L1HLT->getTH1();
01861
01862
01863
01864 histoname = labelname+"_l1HLTPhiCorrelation";
01865 title = labelname+"_l1HLTPhiCorrelation;#Phi(L1);#Phi(HLT)"+trigPath;
01866 PhiCorrelation_L1HLT = dbe->book2D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_,Phibins_,PhiMin_,PhiMax_);
01867 PhiCorrelation_L1HLT->getTH1();
01868
01869
01870
01871 histoname = labelname+"_hltRecObjPtResolution";
01872 title = labelname+"_hltRecObjPtResolution;(Pt(HLT)-Pt(Reco))/Pt(HLT)"+trigPath;
01873 PtResolution_HLTRecObj = dbe->book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
01874 PtResolution_HLTRecObj->getTH1();
01875
01876
01877
01878 histoname = labelname+"_hltRecObjPhiResolution";
01879 title = labelname+"_hltRecObjPhiResolution;(#Phi(HLT)-#Phi(Reco))/#Phi(HLT)"+trigPath;
01880 PhiResolution_HLTRecObj = dbe->book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
01881 PhiResolution_HLTRecObj->getTH1();
01882
01883
01884
01885
01886 histoname = labelname+"_hltRecObjPtCorrelation";
01887 title = labelname+"_hltRecObjPtCorrelation;Pt(HLT)[GeV/c];Pt(Reco)[GeV/c]"+trigPath;
01888 PtCorrelation_HLTRecObj = dbe->book2D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_,Ptbins_,PtMin_,PtMax_);
01889 PtCorrelation_HLTRecObj->getTH1();
01890
01891
01892
01893 histoname = labelname+"_hltRecObjPhiCorrelation";
01894 title = labelname+"_hltRecObjPhiCorrelation;#Phi(HLT);#Phi(Reco)"+trigPath;
01895 PhiCorrelation_HLTRecObj = dbe->book2D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_,Phibins_,PhiMin_,PhiMax_);
01896 PhiCorrelation_HLTRecObj->getTH1();
01897
01898
01899
01900 }
01901
01902 v->setHistos( N, Pt, PtBarrel, PtEndcap, PtForward, Eta, Phi, EtaPhi,
01903 N_L1, Pt_L1, PtBarrel_L1, PtEndcap_L1, PtForward_L1, Eta_L1, Phi_L1, EtaPhi_L1,
01904 N_HLT, Pt_HLT, PtBarrel_HLT, PtEndcap_HLT, PtForward_HLT, Eta_HLT, Phi_HLT, EtaPhi_HLT,
01905 PtResolution_L1HLT, EtaResolution_L1HLT,PhiResolution_L1HLT,
01906 PtResolution_HLTRecObj,EtaResolution_HLTRecObj,PhiResolution_HLTRecObj,
01907 PtCorrelation_L1HLT,EtaCorrelation_L1HLT,PhiCorrelation_L1HLT,
01908 PtCorrelation_HLTRecObj,EtaCorrelation_HLTRecObj,PhiCorrelation_HLTRecObj,
01909 jetAveragePt, jetAverageEta, jetPhiDifference, hltAveragePt, hltAverageEta, hltPhiDifference,
01910 dummy, dummy, dummy);
01911
01912 }
01913
01914 }
01915 if(plotAllwrtMu_)
01916 {
01917 int Nbins_ = 10;
01918 int Nmin_ = -0.5;
01919 int Nmax_ = 9.5;
01920 int Ptbins_ = 40;
01921 int Etabins_ = 40;
01922 int Phibins_ = 35;
01923 int Resbins_ = 30;
01924 double PtMin_ = 0.;
01925 double PtMax_ = 200.;
01926 double EtaMin_ = -5.;
01927 double EtaMax_ = 5.;
01928 double PhiMin_ = -3.14159;
01929 double PhiMax_ = 3.14159;
01930 double ResMin_ = -1.5;
01931 double ResMax_ = 1.5;
01932
01933 std::string dirName = dirname_ + "/MonitorAllTriggersWrtMuonTrigger/";
01934 for(PathInfoCollection::iterator v = hltPathsAllWrtMu_.begin(); v!= hltPathsAllWrtMu_.end(); ++v ){
01935
01936 std::string subdirName = dirName + v->getPath();
01937 std::string trigPath = "("+v->getPath()+")";
01938 dbe->setCurrentFolder(subdirName);
01939
01940
01941 MonitorElement *dummy, *N, *Pt, *PtBarrel, *PtEndcap, *PtForward, *Eta, *Phi, *EtaPhi,
01942 *N_L1, *Pt_L1, *PtBarrel_L1, *PtEndcap_L1, *PtForward_L1, *Eta_L1, *Phi_L1, *EtaPhi_L1,
01943 *N_HLT, *Pt_HLT, *PtBarrel_HLT, *PtEndcap_HLT, *PtForward_HLT, *Eta_HLT, *Phi_HLT, *EtaPhi_HLT,
01944 *PtResolution_L1HLT, *EtaResolution_L1HLT,*PhiResolution_L1HLT,
01945 *PtResolution_HLTRecObj, *EtaResolution_HLTRecObj,*PhiResolution_HLTRecObj,
01946 *PtCorrelation_L1HLT,*EtaCorrelation_L1HLT,*PhiCorrelation_L1HLT,
01947 *PtCorrelation_HLTRecObj,*EtaCorrelation_HLTRecObj,*PhiCorrelation_HLTRecObj,
01948 *jetAveragePt, *jetAverageEta, *jetPhiDifference, *hltAveragePt, *hltAverageEta, *hltPhiDifference;
01949
01950 dummy = dbe->bookFloat("dummy");
01951 N = dbe->bookFloat("N");
01952 Pt = dbe->bookFloat("Pt");
01953 PtBarrel = dbe->bookFloat("PtBarrel");
01954 PtEndcap = dbe->bookFloat("PtEndcap");
01955 PtForward = dbe->bookFloat("PtForward");
01956 Eta = dbe->bookFloat("Eta");
01957 Phi = dbe->bookFloat("Phi");
01958 EtaPhi = dbe->bookFloat("EtaPhi");
01959 N_L1 = dbe->bookFloat("N_L1");
01960 Pt_L1 = dbe->bookFloat("Pt_L1");
01961 PtBarrel_L1 = dbe->bookFloat("PtBarrel_L1");
01962 PtEndcap_L1 = dbe->bookFloat("PtEndcap_L1");
01963 PtForward_L1 = dbe->bookFloat("PtForward_L1");
01964 Eta_L1 = dbe->bookFloat("Eta_L1");
01965 Phi_L1 = dbe->bookFloat("Phi_L1");
01966 EtaPhi_L1 = dbe->bookFloat("EtaPhi_L1");
01967
01968 N_HLT = dbe->bookFloat("N_HLT");
01969 Pt_HLT = dbe->bookFloat("Pt_HLT");
01970 PtBarrel_HLT = dbe->bookFloat("PtBarrel_HLT");
01971 PtEndcap_HLT = dbe->bookFloat("PtEndcap_HLT");
01972 PtForward_HLT = dbe->bookFloat("PtForward_HLT");
01973 Eta_HLT = dbe->bookFloat("Eta_HLT");
01974 Phi_HLT = dbe->bookFloat("Phi_HLT");
01975 EtaPhi_HLT = dbe->bookFloat("EtaPhi_HLT");
01976
01977 PtResolution_L1HLT = dbe->bookFloat("PtResolution_L1HLT");
01978 EtaResolution_L1HLT = dbe->bookFloat("EtaResolution_L1HLT");
01979 PhiResolution_L1HLT = dbe->bookFloat("PhiResolution_L1HLT");
01980 PtResolution_HLTRecObj = dbe->bookFloat("PtResolution_HLTRecObj");
01981 EtaResolution_HLTRecObj = dbe->bookFloat("EtaResolution_HLTRecObj");
01982 PhiResolution_HLTRecObj = dbe->bookFloat("PhiResolution_HLTRecObj");
01983 PtCorrelation_L1HLT = dbe->bookFloat("PtCorrelation_L1HLT");
01984 EtaCorrelation_L1HLT = dbe->bookFloat("EtaCorrelation_L1HLT");
01985 PhiCorrelation_L1HLT = dbe->bookFloat("PhiCorrelation_L1HLT");
01986 PtCorrelation_HLTRecObj = dbe->bookFloat("PtCorrelation_HLTRecObj");
01987 EtaCorrelation_HLTRecObj = dbe->bookFloat("EtaCorrelation_HLTRecObj");
01988 PhiCorrelation_HLTRecObj = dbe->bookFloat("PhiCorrelation_HLTRecObj");
01989
01990 jetAveragePt = dbe->bookFloat("jetAveragePt");
01991 jetAverageEta = dbe->bookFloat("jetAverageEta");
01992 jetPhiDifference = dbe->bookFloat("jetPhiDifference");
01993 hltAveragePt = dbe->bookFloat("hltAveragePt");
01994 hltAverageEta = dbe->bookFloat("hltAverageEta");
01995 hltPhiDifference = dbe->bookFloat("hltPhiDifference");
01996 std::string labelname("ME");
01997 std::string histoname(labelname+"");
01998 std::string title(labelname+"");
01999 if(v->getObjectType() == trigger::TriggerJet)
02000 {
02001
02002 histoname = labelname+"_recObjN";
02003 title = labelname+"_recObjN;Reco multiplicity()"+trigPath;
02004 N = dbe->book1D(histoname.c_str(),title.c_str(),Nbins_,Nmin_,Nmax_);
02005 N->getTH1();
02006
02007
02008 histoname = labelname+"_recObjPt";
02009 title = labelname+"_recObjPt; Reco Pt[GeV/c]"+trigPath;
02010 Pt = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02011 Pt->getTH1();
02012
02013
02014 histoname = labelname+"_recObjPtBarrel";
02015 title = labelname+"_recObjPtBarrel;Reco Pt[GeV/c]"+trigPath;
02016 PtBarrel = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02017 PtBarrel->getTH1();
02018
02019
02020 histoname = labelname+"_recObjPtEndcap";
02021 title = labelname+"_recObjPtEndcap;Reco Pt[GeV/c]"+trigPath;
02022 PtEndcap = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02023 PtEndcap->getTH1();
02024
02025
02026 histoname = labelname+"_recObjPtForward";
02027 title = labelname+"_recObjPtForward;Reco Pt[GeV/c]"+trigPath;
02028 PtForward = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02029 PtForward->getTH1();
02030
02031
02032 histoname = labelname+"_recObjEta";
02033 title = labelname+"_recObjEta;Reco #eta"+trigPath;
02034 Eta = dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
02035 Eta->getTH1();
02036
02037
02038 histoname = labelname+"_recObjPhi";
02039 title = labelname+"_recObjPhi;Reco #Phi"+trigPath;
02040 Phi = dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
02041 Phi->getTH1();
02042
02043
02044 histoname = labelname+"_recObjEtaPhi";
02045 title = labelname+"_recObjEtaPhi;Reco #eta;Reco #Phi"+trigPath;
02046 EtaPhi = dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
02047 EtaPhi->getTH1();
02048
02049
02050
02051 histoname = labelname+"_l1ObjN";
02052 title = labelname+"_l1ObjN;L1 multiplicity"+trigPath;
02053 N_L1 = dbe->book1D(histoname.c_str(),title.c_str(),Nbins_,Nmin_,Nmax_);
02054 N_L1->getTH1();
02055
02056
02057 histoname = labelname+"_l1ObjPt";
02058 title = labelname+"_l1ObjPt;L1 Pt[GeV/c]"+trigPath;
02059 Pt_L1 = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02060 Pt_L1->getTH1();
02061
02062
02063 histoname = labelname+"_l1ObjPtBarrel";
02064 title = labelname+"_l1ObjPtBarrel;L1 Pt[GeV/c]"+trigPath;
02065 PtBarrel_L1 = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02066 PtBarrel_L1->getTH1();
02067
02068
02069 histoname = labelname+"_l1ObjPtEndcap";
02070 title = labelname+"_l1ObjPtEndcap;L1 Pt[GeV/c]"+trigPath;
02071 PtEndcap_L1 = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02072 PtEndcap_L1->getTH1();
02073
02074
02075 histoname = labelname+"_l1ObjPtForward";
02076 title = labelname+"_l1ObjPtForward;L1 Pt[GeV/c]"+trigPath;
02077 PtForward_L1 = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02078 PtForward_L1->getTH1();
02079
02080
02081 histoname = labelname+"_l1ObjEta";
02082 title = labelname+"_l1ObjEta;L1 #eta"+trigPath;
02083 Eta_L1 = dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
02084 Eta_L1->getTH1();
02085
02086
02087 histoname = labelname+"_l1ObjPhi";
02088 title = labelname+"_l1ObjPhi;L1 #Phi"+trigPath;
02089 Phi_L1 = dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
02090 Phi_L1->getTH1();
02091
02092
02093 histoname = labelname+"_l1ObjEtaPhi";
02094 title = labelname+"_l1ObjEtaPhi;L1 #eta;L1 #Phi"+trigPath;
02095 EtaPhi_L1 = dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
02096 EtaPhi_L1->getTH1();
02097
02098
02099 histoname = labelname+"_hltObjN";
02100 title = labelname+"_hltObjN;HLT multiplicity"+trigPath;
02101 N_HLT = dbe->book1D(histoname.c_str(),title.c_str(),Nbins_,Nmin_,Nmax_);
02102 N_HLT->getTH1();
02103
02104
02105 histoname = labelname+"_hltObjPt";
02106 title = labelname+"_hltObjPt;HLT Pt[GeV/c]"+trigPath;
02107 Pt_HLT = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02108 Pt_HLT->getTH1();
02109
02110
02111 histoname = labelname+"_hltObjPtBarrel";
02112 title = labelname+"_hltObjPtBarrel;HLT Pt[GeV/c]"+trigPath;
02113 PtBarrel_HLT = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02114 PtBarrel_HLT->getTH1();
02115
02116
02117 histoname = labelname+"_hltObjPtEndcap";
02118 title = labelname+"_hltObjPtEndcap;HLT Pt[GeV/c]"+trigPath;
02119 PtEndcap_HLT = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02120 PtEndcap_HLT->getTH1();
02121
02122
02123 histoname = labelname+"_hltObjPtForward";
02124 title = labelname+"_hltObjPtForward;HLT Pt[GeV/c]"+trigPath;
02125 PtForward_HLT = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02126 PtForward_HLT->getTH1();
02127
02128
02129 histoname = labelname+"_hltObjEta";
02130 title = labelname+"_hltObjEta;HLT #eta"+trigPath;
02131 Eta_HLT = dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
02132 Eta_HLT->getTH1();
02133
02134
02135 histoname = labelname+"_hltObjPhi";
02136 title = labelname+"_hltObjPhi;HLT #Phi"+trigPath;
02137 Phi_HLT = dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
02138 Phi_HLT->getTH1();
02139
02140
02141 histoname = labelname+"_hltObjEtaPhi";
02142 title = labelname+"_hltObjEtaPhi;HLT #eta;HLT #Phi"+trigPath;
02143 EtaPhi_HLT = dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
02144 EtaPhi_HLT->getTH1();
02145
02146
02147 histoname = labelname+"_l1HLTPtResolution";
02148 title = labelname+"_l1HLTPtResolution;(Pt(L1)-Pt(HLT))/Pt(L1)"+trigPath;
02149 PtResolution_L1HLT = dbe->book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
02150 PtResolution_L1HLT->getTH1();
02151
02152
02153 histoname = labelname+"_l1HLTEtaResolution";
02154 title = labelname+"_l1HLTEtaResolution;(#eta(L1)-#eta(HLT))/#eta(L1)"+trigPath;
02155 EtaResolution_L1HLT = dbe->book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
02156 EtaResolution_L1HLT->getTH1();
02157
02158
02159 histoname = labelname+"_l1HLTPhiResolution";
02160 title = labelname+"_l1HLTPhiResolution;(#Phi(L1)-#Phi(HLT))/#Phi(L1)"+trigPath;
02161 PhiResolution_L1HLT = dbe->book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
02162 PhiResolution_L1HLT->getTH1();
02163
02164
02165 histoname = labelname+"_l1HLTPtCorrelation";
02166 title = labelname+"_l1HLTPtCorrelation;Pt(L1)[GeV/c];Pt(HLT)[GeV/c]"+trigPath;
02167 PtCorrelation_L1HLT = dbe->book2D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_,Ptbins_,PtMin_,PtMax_);
02168 PtCorrelation_L1HLT->getTH1();
02169
02170
02171 histoname = labelname+"_l1HLTEtaCorrelation";
02172 title = labelname+"_l1HLTEtaCorrelation;#eta(L1);#eta(HLT)"+trigPath;
02173 EtaCorrelation_L1HLT = dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Etabins_,EtaMin_,EtaMax_);
02174 EtaCorrelation_L1HLT->getTH1();
02175
02176
02177 histoname = labelname+"_l1HLTPhiCorrelation";
02178 title = labelname+"_l1HLTPhiCorrelation;#Phi(L1);#Phi(HLT)"+trigPath;
02179 PhiCorrelation_L1HLT = dbe->book2D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_,Phibins_,PhiMin_,PhiMax_);
02180 PhiCorrelation_L1HLT->getTH1();
02181
02182
02183
02184 histoname = labelname+"_hltRecObjPtResolution";
02185 title = labelname+"_hltRecObjPtResolution;(Pt(HLT)-Pt(Reco))/Pt(HLT)"+trigPath;
02186 PtResolution_HLTRecObj = dbe->book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
02187 PtResolution_HLTRecObj->getTH1();
02188
02189
02190 histoname = labelname+"_hltRecObjEtaResolution";
02191 title = labelname+"_hltRecObjEtaResolution;(#eta(HLT)-#eta(Reco))/#eta(HLT)"+trigPath;
02192 EtaResolution_HLTRecObj = dbe->book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
02193 EtaResolution_HLTRecObj->getTH1();
02194
02195
02196 histoname = labelname+"_hltRecObjPhiResolution";
02197 title = labelname+"_hltRecObjPhiResolution;(#Phi(HLT)-#Phi(Reco))/#Phi(HLT)"+trigPath;
02198 PhiResolution_HLTRecObj = dbe->book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
02199 PhiResolution_HLTRecObj->getTH1();
02200
02201
02202
02203 histoname = labelname+"_hltRecObjPtCorrelation";
02204 title = labelname+"_hltRecObjPtCorrelation;Pt(HLT)[GeV/c];Pt(Reco)[GeV/c]"+trigPath;
02205 PtCorrelation_HLTRecObj = dbe->book2D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_,Ptbins_,PtMin_,PtMax_);
02206 PtCorrelation_HLTRecObj->getTH1();
02207
02208
02209 histoname = labelname+"_hltRecObjEtaCorrelation";
02210 title = labelname+"_hltRecObjEtaCorrelation;#eta(HLT);#eta(Reco)"+trigPath;
02211 EtaCorrelation_HLTRecObj = dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Etabins_,EtaMin_,EtaMax_);
02212 EtaCorrelation_HLTRecObj->getTH1();
02213
02214
02215 histoname = labelname+"_hltRecObjPhiCorrelation";
02216 title = labelname+"_hltRecObjPhiCorrelation;#Phi(HLT);#Phi(Reco)"+trigPath;
02217 PhiCorrelation_HLTRecObj = dbe->book2D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_,Phibins_,PhiMin_,PhiMax_);
02218 PhiCorrelation_HLTRecObj->getTH1();
02219
02220
02221 if((v->getTriggerType().compare("DiJet_Trigger") == 0))
02222 {
02223 histoname = labelname+"_RecObjAveragePt";
02224 title = labelname+"_RecObjAveragePt;Reco Average Pt[GeV/c]"+trigPath;
02225 jetAveragePt = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02226 jetAveragePt->getTH1();
02227
02228
02229 histoname = labelname+"_RecObjAverageEta";
02230 title = labelname+"_RecObjAverageEta;Reco Average #eta"+trigPath;
02231 jetAverageEta = dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
02232 jetAverageEta->getTH1();
02233
02234
02235 histoname = labelname+"_RecObjPhiDifference";
02236 title = labelname+"_RecObjPhiDifference;Reco #Delta#Phi"+trigPath;
02237 jetPhiDifference = dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
02238 jetPhiDifference->getTH1();
02239
02240
02241 histoname = labelname+"_hltObjAveragePt";
02242 title = labelname+"_hltObjAveragePt;HLT Average Pt[GeV/c]"+trigPath;
02243 hltAveragePt = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02244 hltAveragePt->getTH1();
02245
02246
02247 histoname = labelname+"_hltObjAverageEta";
02248 title = labelname+"_hltObjAverageEta;HLT Average #eta"+trigPath;
02249 hltAverageEta = dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
02250 hltAverageEta->getTH1();
02251
02252
02253 histoname = labelname+"_hltObjPhiDifference";
02254 title = labelname+"_hltObjPhiDifference;Reco #Delta#Phi"+trigPath;
02255 hltPhiDifference = dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
02256 hltPhiDifference->getTH1();
02257
02258
02259 }
02260
02261 }
02262
02263
02264 if(v->getObjectType() == trigger::TriggerMET)
02265 {
02266 histoname = labelname+"_recObjPt";
02267 title = labelname+"_recObjPt;Reco Pt[GeV/c]"+trigPath;
02268 Pt = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02269 Pt->getTH1();
02270
02271
02272
02273 histoname = labelname+"_recObjPhi";
02274 title = labelname+"_recObjPhi;Reco #Phi"+trigPath;
02275 Phi = dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
02276 Phi->getTH1();
02277
02278
02279 histoname = labelname+"_l1ObjPt";
02280 title = labelname+"_l1ObjPt;L1 Pt[GeV/c]"+trigPath;
02281 Pt_L1 = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02282 Pt_L1->getTH1();
02283
02284
02285
02286 histoname = labelname+"_l1ObjPhi";
02287 title = labelname+"_l1ObjPhi;L1 #Phi"+trigPath;
02288 Phi_L1 = dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
02289 Phi_L1->getTH1();
02290
02291
02292
02293 histoname = labelname+"_hltObjPt";
02294 title = labelname+"_hltObjPt;HLT Pt[GeV/c]"+trigPath;
02295 Pt_HLT = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02296 Pt_HLT->getTH1();
02297
02298
02299
02300 histoname = labelname+"_hltObjPhi";
02301 title = labelname+"_hltObjPhi;HLT #Phi"+trigPath;
02302 Phi_HLT = dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
02303 Phi_HLT->getTH1();
02304
02305
02306
02307 histoname = labelname+"_l1HLTPtResolution";
02308 title = labelname+"_l1HLTPtResolution;(Pt(L1)-Pt(HLT))/Pt(L1)"+trigPath;
02309 PtResolution_L1HLT = dbe->book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
02310 PtResolution_L1HLT->getTH1();
02311
02312
02313
02314 histoname = labelname+"_l1HLTPhiResolution";
02315 title = labelname+"_l1HLTPhiResolution;(#Phi(L1)-#Phi(HLT))/#Phi(L1)"+trigPath;
02316 PhiResolution_L1HLT = dbe->book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
02317 PhiResolution_L1HLT->getTH1();
02318
02319
02320
02321
02322 histoname = labelname+"_l1HLTPtCorrelation";
02323 title = labelname+"_l1HLTPtCorrelation;Pt(L1)[GeV/c];Pt(HLT)[GeV/c]"+trigPath;
02324 PtCorrelation_L1HLT = dbe->book2D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_,Ptbins_,PtMin_,PtMax_);
02325 PtCorrelation_L1HLT->getTH1();
02326
02327
02328
02329 histoname = labelname+"_l1HLTPhiCorrelation";
02330 title = labelname+"_l1HLTPhiCorrelation;#Phi(L1);#Phi(HLT)"+trigPath;
02331 PhiCorrelation_L1HLT = dbe->book2D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_,Phibins_,PhiMin_,PhiMax_);
02332 PhiCorrelation_L1HLT->getTH1();
02333
02334
02335
02336 histoname = labelname+"_hltRecObjPtResolution";
02337 title = labelname+"_hltRecObjPtResolution;(Pt(HLT)-Pt(Reco))/Pt(HLT)"+trigPath;
02338 PtResolution_HLTRecObj = dbe->book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
02339 PtResolution_HLTRecObj->getTH1();
02340
02341
02342
02343 histoname = labelname+"_hltRecObjPhiResolution";
02344 title = labelname+"_hltRecObjPhiResolution;(#Phi(HLT)-#Phi(Reco))/#Phi(HLT)"+trigPath;
02345 PhiResolution_HLTRecObj = dbe->book1D(histoname.c_str(),title.c_str(),Resbins_,ResMin_,ResMax_);
02346 PhiResolution_HLTRecObj->getTH1();
02347
02348
02349
02350
02351 histoname = labelname+"_hltRecObjPtCorrelation";
02352 title = labelname+"_hltRecObjPtCorrelation;Pt(HLT)[GeV/c];Pt(Reco)[GeV/c]"+trigPath;
02353 PtCorrelation_HLTRecObj = dbe->book2D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_,Ptbins_,PtMin_,PtMax_);
02354 PtCorrelation_HLTRecObj->getTH1();
02355
02356
02357
02358 histoname = labelname+"_hltRecObjPhiCorrelation";
02359 title = labelname+"_hltRecObjPhiCorrelation;#Phi(HLT);#Phi(Reco)"+trigPath;
02360 PhiCorrelation_HLTRecObj = dbe->book2D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_,Phibins_,PhiMin_,PhiMax_);
02361 PhiCorrelation_HLTRecObj->getTH1();
02362
02363
02364
02365 }
02366 v->setHistos( N, Pt, PtBarrel, PtEndcap, PtForward, Eta, Phi, EtaPhi,
02367 N_L1, Pt_L1, PtBarrel_L1, PtEndcap_L1, PtForward_L1, Eta_L1, Phi_L1, EtaPhi_L1,
02368 N_HLT, Pt_HLT, PtBarrel_HLT, PtEndcap_HLT, PtForward_HLT, Eta_HLT, Phi_HLT, EtaPhi_HLT,
02369 PtResolution_L1HLT, EtaResolution_L1HLT,PhiResolution_L1HLT,
02370 PtResolution_HLTRecObj,EtaResolution_HLTRecObj,PhiResolution_HLTRecObj,
02371 PtCorrelation_L1HLT,EtaCorrelation_L1HLT,PhiCorrelation_L1HLT,
02372 PtCorrelation_HLTRecObj,EtaCorrelation_HLTRecObj,PhiCorrelation_HLTRecObj,
02373 jetAveragePt, jetAverageEta, jetPhiDifference, hltAveragePt, hltAverageEta, hltPhiDifference,
02374 dummy, dummy, dummy);
02375
02376 }
02377
02378 }
02379
02380 if(plotEff_)
02381 {
02382 int Ptbins_ = 100;
02383 int Etabins_ = 40;
02384 int Phibins_ = 35;
02385 double PtMin_ = 0.;
02386 double PtMax_ = 200.;
02387 double EtaMin_ = -5.;
02388 double EtaMax_ = 5.;
02389 double PhiMin_ = -3.14159;
02390 double PhiMax_ = 3.14159;
02391
02392 std::string dirName1 = dirname_ + "/RelativeTriggerEff/";
02393 for(PathInfoCollection::iterator v = hltPathsEff_.begin(); v!= hltPathsEff_.end(); ++v ){
02394 std::string labelname("ME") ;
02395 std::string subdirName = dirName1 + v->getPath() + "_wrt_" + v->getDenomPath();
02396 dbe->setCurrentFolder(subdirName);
02397 std::string histoname(labelname+"");
02398 std::string title(labelname+"");
02399
02400 MonitorElement *dummy;
02401 dummy = dbe->bookFloat("dummy");
02402
02403 if((v->getObjectType() == trigger::TriggerJet) && (v->getTriggerType().compare("SingleJet_Trigger") == 0))
02404 {
02405 histoname = labelname+"_NumeratorPt";
02406 title = labelname+"NumeratorPt;Calo Pt[GeV/c]";
02407 MonitorElement * NumeratorPt = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02408 NumeratorPt->getTH1();
02409
02410
02411 histoname = labelname+"_NumeratorPtBarrel";
02412 title = labelname+"NumeratorPtBarrel;Calo Pt[GeV/c] ";
02413 MonitorElement * NumeratorPtBarrel = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02414 NumeratorPtBarrel->getTH1();
02415
02416
02417 histoname = labelname+"_NumeratorPtEndcap";
02418 title = labelname+"NumeratorPtEndcap;Calo Pt[GeV/c]";
02419 MonitorElement * NumeratorPtEndcap = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02420 NumeratorPtEndcap->getTH1();
02421
02422
02423 histoname = labelname+"_NumeratorPtForward";
02424 title = labelname+"NumeratorPtForward;Calo Pt[GeV/c]";
02425 MonitorElement * NumeratorPtForward = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02426 NumeratorPtForward->getTH1();
02427
02428
02429 histoname = labelname+"_NumeratorEta";
02430 title = labelname+"NumeratorEta;Calo #eta ";
02431 MonitorElement * NumeratorEta = dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
02432 NumeratorEta->getTH1();
02433
02434
02435 histoname = labelname+"_NumeratorPhi";
02436 title = labelname+"NumeratorPhi;Calo #Phi";
02437 MonitorElement * NumeratorPhi = dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
02438 NumeratorPhi->getTH1();
02439
02440
02441 histoname = labelname+"_NumeratorEtaPhi";
02442 title = labelname+"NumeratorEtaPhi;Calo #eta;Calo #Phi";
02443 MonitorElement * NumeratorEtaPhi = dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
02444 NumeratorEtaPhi->getTH1();
02445
02446
02447 histoname = labelname+"_DenominatorPt";
02448 title = labelname+"DenominatorPt;Calo Pt[GeV/c]";
02449 MonitorElement * DenominatorPt = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02450 DenominatorPt->getTH1();
02451
02452
02453 histoname = labelname+"_DenominatorPtBarrel";
02454 title = labelname+"DenominatorPtBarrel;Calo Pt[GeV/c]";
02455 MonitorElement * DenominatorPtBarrel = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02456 DenominatorPtBarrel->getTH1();
02457
02458
02459 histoname = labelname+"_DenominatorPtEndcap";
02460 title = labelname+"DenominatorPtEndcap;Calo Pt[GeV/c]";
02461 MonitorElement * DenominatorPtEndcap = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02462 DenominatorPtEndcap->getTH1();
02463
02464
02465 histoname = labelname+"_DenominatorPtForward";
02466 title = labelname+"DenominatorPtForward;Calo Pt[GeV/c] ";
02467 MonitorElement * DenominatorPtForward = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02468 DenominatorPtForward->getTH1();
02469
02470
02471 histoname = labelname+"_DenominatorEta";
02472 title = labelname+"DenominatorEta;Calo #eta ";
02473 MonitorElement * DenominatorEta = dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
02474 DenominatorEta->getTH1();
02475
02476
02477 histoname = labelname+"_DenominatorPhi";
02478 title = labelname+"DenominatorPhi;Calo #Phi";
02479 MonitorElement * DenominatorPhi = dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
02480 DenominatorPhi->getTH1();
02481
02482
02483 histoname = labelname+"_DenominatorEtaPhi";
02484 title = labelname+"DenominatorEtaPhi;Calo #eta; Calo #Phi";
02485 MonitorElement * DenominatorEtaPhi = dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
02486 DenominatorEtaPhi->getTH1();
02487
02488
02489
02490 v->setEffHistos( NumeratorPt, NumeratorPtBarrel, NumeratorPtEndcap, NumeratorPtForward, NumeratorEta, NumeratorPhi, NumeratorEtaPhi,
02491 DenominatorPt, DenominatorPtBarrel, DenominatorPtEndcap, DenominatorPtForward, DenominatorEta, DenominatorPhi, DenominatorEtaPhi);
02492 }
02493
02494 if((v->getObjectType() == trigger::TriggerJet) && (v->getTriggerType().compare("DiJet_Trigger") == 0))
02495 {
02496
02497 histoname = labelname+"_NumeratorAvrgPt";
02498 title = labelname+"NumeratorAvrgPt;Calo Pt[GeV/c]";
02499 MonitorElement * NumeratorPt = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02500 NumeratorPt->getTH1();
02501
02502
02503 histoname = labelname+"_NumeratorAvrgEta";
02504 title = labelname+"NumeratorAvrgEta;Calo #eta";
02505 MonitorElement * NumeratorEta = dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
02506 NumeratorEta->getTH1();
02507
02508
02509 histoname = labelname+"_DenominatorAvrgPt";
02510 title = labelname+"DenominatorAvrgPt;Calo Pt[GeV/c] ";
02511 MonitorElement * DenominatorPt = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02512 DenominatorPt->getTH1();
02513
02514
02515 histoname = labelname+"_DenominatorAvrgEta";
02516 title = labelname+"DenominatorAvrgEta;Calo #eta";
02517 MonitorElement * DenominatorEta = dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
02518 DenominatorEta->getTH1();
02519
02520
02521 v->setEffHistos( NumeratorPt, dummy, dummy, dummy, NumeratorEta, dummy, dummy,
02522 DenominatorPt, dummy, dummy, dummy, DenominatorEta, dummy, dummy);
02523
02524
02525 }
02526
02527 if(v->getObjectType() == trigger::TriggerMET)
02528 {
02529 histoname = labelname+"_NumeratorPt";
02530 title = labelname+"NumeratorPt;Calo Pt[GeV/c]";
02531 MonitorElement * NumeratorPt = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02532 NumeratorPt->getTH1();
02533
02534
02535
02536 histoname = labelname+"_NumeratorPhi";
02537 title = labelname+"NumeratorPhi;Calo #Phi";
02538 MonitorElement * NumeratorPhi = dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
02539 NumeratorPhi->getTH1();
02540
02541
02542
02543 histoname = labelname+"_DenominatorPt";
02544 title = labelname+"DenominatorPt;Calo Pt[GeV/c]";
02545 MonitorElement * DenominatorPt = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02546 DenominatorPt->getTH1();
02547
02548
02549
02550 histoname = labelname+"_DenominatorPhi";
02551 title = labelname+"DenominatorPhi;Calo #Phi";
02552 MonitorElement * DenominatorPhi = dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
02553 DenominatorPhi->getTH1();
02554
02555
02556
02557 v->setEffHistos( NumeratorPt, dummy, dummy, dummy, dummy, NumeratorPhi, dummy,
02558 DenominatorPt, dummy, dummy, dummy, dummy, DenominatorPhi, dummy);
02559
02560
02561 }
02562 }
02563
02564
02565 std::string dirName2 = dirname_ + "/EffWrtMuonTrigger/";
02566 for(PathInfoCollection::iterator v = hltPathsEffWrtMu_.begin(); v!= hltPathsEffWrtMu_.end(); ++v ){
02567 std::string labelname("ME") ;
02568 std::string subdirName = dirName2 + v->getPath();
02569 std::string histoname(labelname+"");
02570 std::string title(labelname+"");
02571 dbe->setCurrentFolder(subdirName);
02572
02573 MonitorElement *dummy;
02574 dummy = dbe->bookFloat("dummy");
02575 if((v->getObjectType() == trigger::TriggerJet) && (v->getTriggerType().compare("SingleJet_Trigger") == 0))
02576 {
02577 histoname = labelname+"_NumeratorPt";
02578 title = labelname+"NumeratorPt;Pt[GeV/c]";
02579 MonitorElement * NumeratorPt = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02580 NumeratorPt->getTH1();
02581
02582
02583 histoname = labelname+"_NumeratorPtBarrel";
02584 title = labelname+"NumeratorPtBarrel;Calo Pt[GeV/c]";
02585 MonitorElement * NumeratorPtBarrel = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02586 NumeratorPtBarrel->getTH1();
02587
02588
02589 histoname = labelname+"_NumeratorPtEndcap";
02590 title = labelname+"NumeratorPtEndcap;Calo Pt[GeV/c]";
02591 MonitorElement * NumeratorPtEndcap = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02592 NumeratorPtEndcap->getTH1();
02593
02594
02595 histoname = labelname+"_NumeratorPtForward";
02596 title = labelname+"NumeratorPtForward;Calo Pt[GeV/c]";
02597 MonitorElement * NumeratorPtForward = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02598 NumeratorPtForward->getTH1();
02599
02600
02601 histoname = labelname+"_NumeratorEta";
02602 title = labelname+"NumeratorEta;Calo #eta ";
02603 MonitorElement * NumeratorEta = dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
02604 NumeratorEta->getTH1();
02605
02606
02607 histoname = labelname+"_NumeratorPhi";
02608 title = labelname+"NumeratorPhi;Calo #Phi";
02609 MonitorElement * NumeratorPhi = dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
02610 NumeratorPhi->getTH1();
02611
02612
02613 histoname = labelname+"_NumeratorEtaPhi";
02614 title = labelname+"NumeratorEtaPhi;Calo #eta;Calo #Phi";
02615 MonitorElement * NumeratorEtaPhi = dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
02616 NumeratorEtaPhi->getTH1();
02617
02618
02619 histoname = labelname+"_DenominatorPt";
02620 title = labelname+"DenominatorPt;Calo Pt[GeV/c]";
02621 MonitorElement * DenominatorPt = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02622 DenominatorPt->getTH1();
02623
02624
02625 histoname = labelname+"_DenominatorPtBarrel";
02626 title = labelname+"DenominatorPtBarrel;Calo Pt[GeV/c]";
02627 MonitorElement * DenominatorPtBarrel = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02628 DenominatorPtBarrel->getTH1();
02629
02630
02631 histoname = labelname+"_DenominatorPtEndcap";
02632 title = labelname+"DenominatorPtEndcap;Calo Pt[GeV/c]";
02633 MonitorElement * DenominatorPtEndcap = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02634 DenominatorPtEndcap->getTH1();
02635
02636
02637 histoname = labelname+"_DenominatorPtForward";
02638 title = labelname+"DenominatorPtForward;Calo Pt[GeV/c] ";
02639 MonitorElement * DenominatorPtForward = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02640 DenominatorPtForward->getTH1();
02641
02642
02643 histoname = labelname+"_DenominatorEta";
02644 title = labelname+"DenominatorEta;Calo #eta";
02645 MonitorElement * DenominatorEta = dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
02646 DenominatorEta->getTH1();
02647
02648
02649 histoname = labelname+"_DenominatorPhi";
02650 title = labelname+"DenominatorPhi;Calo #Phi";
02651 MonitorElement * DenominatorPhi = dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
02652 DenominatorPhi->getTH1();
02653
02654
02655 histoname = labelname+"_DenominatorEtaPhi";
02656 title = labelname+"DenominatorEtaPhi;Calo #eta (IC5);Calo #Phi ";
02657 MonitorElement * DenominatorEtaPhi = dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
02658 DenominatorEtaPhi->getTH1();
02659
02660
02661
02662 v->setEffHistos( NumeratorPt, NumeratorPtBarrel, NumeratorPtEndcap, NumeratorPtForward, NumeratorEta, NumeratorPhi, NumeratorEtaPhi,
02663 DenominatorPt, DenominatorPtBarrel, DenominatorPtEndcap, DenominatorPtForward, DenominatorEta, DenominatorPhi, DenominatorEtaPhi);
02664 }
02665
02666 if((v->getObjectType() == trigger::TriggerJet) && (v->getTriggerType().compare("DiJet_Trigger") == 0))
02667 {
02668 histoname = labelname+"_NumeratorAvrgPt";
02669 title = labelname+"NumeratorAvrgPt;Calo Pt[GeV/c] ";
02670 MonitorElement * NumeratorPt = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02671 NumeratorPt->getTH1();
02672
02673
02674 histoname = labelname+"_NumeratorAvrgEta";
02675 title = labelname+"NumeratorAvrgEta;Calo #eta";
02676 MonitorElement * NumeratorEta = dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
02677 NumeratorEta->getTH1();
02678
02679
02680 histoname = labelname+"_DenominatorAvrgPt";
02681 title = labelname+"DenominatorAvrgPt;Calo Pt[GeV/c]";
02682 MonitorElement * DenominatorPt = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02683 DenominatorPt->getTH1();
02684
02685
02686 histoname = labelname+"_DenominatorAvrgEta";
02687 title = labelname+"DenominatorAvrgEta;Calo #eta ";
02688 MonitorElement * DenominatorEta = dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
02689 DenominatorEta->getTH1();
02690
02691
02692 v->setEffHistos( NumeratorPt, dummy, dummy, dummy, NumeratorEta, dummy, dummy,
02693 DenominatorPt, dummy, dummy, dummy, DenominatorEta, dummy, dummy);
02694
02695
02696 }
02697 if(v->getObjectType() == trigger::TriggerMET)
02698 {
02699 histoname = labelname+"_NumeratorPt";
02700 title = labelname+"NumeratorPt;Calo Pt[GeV/c]";
02701 MonitorElement * NumeratorPt = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02702 NumeratorPt->getTH1();
02703
02704
02705
02706 histoname = labelname+"_NumeratorPhi";
02707 title = labelname+"NumeratorPhi;Calo #Phi";
02708 MonitorElement * NumeratorPhi = dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
02709 NumeratorPhi->getTH1();
02710
02711
02712
02713 histoname = labelname+"_DenominatorPt";
02714 title = labelname+"DenominatorPt;Calo Pt[GeV/c]";
02715 MonitorElement * DenominatorPt = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02716 DenominatorPt->getTH1();
02717
02718
02719
02720 histoname = labelname+"_DenominatorPhi";
02721 title = labelname+"DenominatorPhi;Calo #Phi";
02722 MonitorElement * DenominatorPhi = dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
02723 DenominatorPhi->getTH1();
02724
02725
02726
02727 v->setEffHistos( NumeratorPt, dummy, dummy, dummy, dummy, NumeratorPhi, dummy,
02728 DenominatorPt, dummy, dummy, dummy, dummy, DenominatorPhi, dummy);
02729
02730
02731 }
02732 }
02733
02734 std::string dirName3 = dirname_ + "/EffWrtMBTrigger/";
02735 for(PathInfoCollection::iterator v = hltPathsEffWrtMB_.begin(); v!= hltPathsEffWrtMB_.end(); ++v ){
02736 std::string labelname("ME") ;
02737 std::string subdirName = dirName3 + v->getPath() ;
02738 std::string histoname(labelname+"");
02739 std::string title(labelname+"");
02740 dbe->setCurrentFolder(subdirName);
02741 MonitorElement *dummy;
02742 dummy = dbe->bookFloat("dummy");
02743 if((v->getObjectType() == trigger::TriggerJet) && (v->getTriggerType().compare("SingleJet_Trigger") == 0))
02744 {
02745 histoname = labelname+"_NumeratorPt";
02746 title = labelname+"NumeratorPt;Calo Pt[GeV/c] ";
02747 MonitorElement * NumeratorPt = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02748 NumeratorPt->getTH1();
02749
02750
02751 histoname = labelname+"_NumeratorPtBarrel";
02752 title = labelname+"NumeratorPtBarrel;Calo Pt[GeV/c]";
02753 MonitorElement * NumeratorPtBarrel = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02754 NumeratorPtBarrel->getTH1();
02755
02756
02757 histoname = labelname+"_NumeratorPtEndcap";
02758 title = labelname+"NumeratorPtEndcap; Calo Pt[GeV/c] ";
02759 MonitorElement * NumeratorPtEndcap = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02760 NumeratorPtEndcap->getTH1();
02761
02762
02763 histoname = labelname+"_NumeratorPtForward";
02764 title = labelname+"NumeratorPtForward;Calo Pt[GeV/c]";
02765 MonitorElement * NumeratorPtForward = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02766 NumeratorPtForward->getTH1();
02767
02768
02769 histoname = labelname+"_NumeratorEta";
02770 title = labelname+"NumeratorEta;Calo #eta ";
02771 MonitorElement * NumeratorEta = dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
02772 NumeratorEta->getTH1();
02773
02774
02775 histoname = labelname+"_NumeratorPhi";
02776 title = labelname+"NumeratorPhi;Calo #Phi";
02777 MonitorElement * NumeratorPhi = dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
02778 NumeratorPhi->getTH1();
02779
02780
02781 histoname = labelname+"_NumeratorEtaPhi";
02782 title = labelname+"NumeratorEtaPhi;Calo #eta;Calo #Phi ";
02783 MonitorElement * NumeratorEtaPhi = dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
02784 NumeratorEtaPhi->getTH1();
02785
02786
02787 histoname = labelname+"_DenominatorPt";
02788 title = labelname+"DenominatorPt;Calo Pt[GeV/c]";
02789 MonitorElement * DenominatorPt = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02790 DenominatorPt->getTH1();
02791
02792
02793 histoname = labelname+"_DenominatorPtBarrel";
02794 title = labelname+"DenominatorPtBarrel;Calo Pt[GeV/c]";
02795 MonitorElement * DenominatorPtBarrel = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02796 DenominatorPtBarrel->getTH1();
02797
02798
02799 histoname = labelname+"_DenominatorPtEndcap";
02800 title = labelname+"DenominatorPtEndcap;Calo Pt[GeV/c]";
02801 MonitorElement * DenominatorPtEndcap = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02802 DenominatorPtEndcap->getTH1();
02803
02804
02805 histoname = labelname+"_DenominatorPtForward";
02806 title = labelname+"DenominatorPtForward;Calo Pt[GeV/c]";
02807 MonitorElement * DenominatorPtForward = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02808 DenominatorPtForward->getTH1();
02809
02810
02811 histoname = labelname+"_DenominatorEta";
02812 title = labelname+"DenominatorEta;Calo #eta ";
02813 MonitorElement * DenominatorEta = dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
02814 DenominatorEta->getTH1();
02815
02816
02817 histoname = labelname+"_DenominatorPhi";
02818 title = labelname+"DenominatorPhi;Calo #Phi";
02819 MonitorElement * DenominatorPhi = dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
02820 DenominatorPhi->getTH1();
02821
02822
02823 histoname = labelname+"_DenominatorEtaPhi";
02824 title = labelname+"DenominatorEtaPhi;Calo #eta ;Calo #Phi ";
02825 MonitorElement * DenominatorEtaPhi = dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Phibins_,PhiMin_,PhiMax_);
02826 DenominatorEtaPhi->getTH1();
02827
02828
02829
02830 v->setEffHistos( NumeratorPt, NumeratorPtBarrel, NumeratorPtEndcap, NumeratorPtForward, NumeratorEta, NumeratorPhi, NumeratorEtaPhi,
02831 DenominatorPt, DenominatorPtBarrel, DenominatorPtEndcap, DenominatorPtForward, DenominatorEta, DenominatorPhi, DenominatorEtaPhi);
02832 }
02833
02834
02835 if((v->getObjectType() == trigger::TriggerJet) && (v->getTriggerType().compare("DiJet_Trigger") == 0))
02836 {
02837
02838 histoname = labelname+"_NumeratorAvrgPt";
02839 title = labelname+"NumeratorAvrgPt;Calo Pt[GeV/c] ";
02840 MonitorElement * NumeratorPt = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02841 NumeratorPt->getTH1();
02842
02843
02844 histoname = labelname+"_NumeratorAvrgEta";
02845 title = labelname+"NumeratorAvrgEta;Calo #eta ";
02846 MonitorElement * NumeratorEta = dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
02847 NumeratorEta->getTH1();
02848
02849
02850 histoname = labelname+"_DenominatorAvrgPt";
02851 title = labelname+"DenominatorAvrgPt;Calo Pt[GeV/c] ";
02852 MonitorElement * DenominatorPt = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02853 DenominatorPt->getTH1();
02854
02855
02856 histoname = labelname+"_DenominatorAvrgEta";
02857 title = labelname+"DenominatorAvrgEta;Calo #eta ";
02858 MonitorElement * DenominatorEta = dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
02859 DenominatorEta->getTH1();
02860
02861
02862 v->setEffHistos( NumeratorPt, dummy, dummy, dummy, NumeratorEta, dummy, dummy,
02863 DenominatorPt, dummy, dummy, dummy, DenominatorEta, dummy, dummy);
02864
02865
02866
02867 }
02868 if(v->getObjectType() == trigger::TriggerMET)
02869 {
02870 histoname = labelname+"_NumeratorPt";
02871 title = labelname+"NumeratorPt;Calo Pt[GeV/c]";
02872 MonitorElement * NumeratorPt = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02873 NumeratorPt->getTH1();
02874
02875
02876
02877 histoname = labelname+"_NumeratorPhi";
02878 title = labelname+"NumeratorPhi;Calo #Phi";
02879 MonitorElement * NumeratorPhi = dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
02880 NumeratorPhi->getTH1();
02881
02882
02883
02884 histoname = labelname+"_DenominatorPt";
02885 title = labelname+"DenominatorPt;Calo Pt[GeV/c]";
02886 MonitorElement * DenominatorPt = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02887 DenominatorPt->getTH1();
02888
02889
02890
02891 histoname = labelname+"_DenominatorPhi";
02892 title = labelname+"DenominatorPhi;Calo #Phi";
02893 MonitorElement * DenominatorPhi = dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
02894 DenominatorPhi->getTH1();
02895
02896
02897
02898
02899
02900 v->setEffHistos( NumeratorPt, dummy, dummy, dummy, dummy, NumeratorPhi, dummy,
02901 DenominatorPt, dummy, dummy, dummy, dummy, DenominatorPhi, dummy);
02902
02903
02904 }
02905 }
02906
02907
02908 }
02909
02910 int Nbins_ = 10;
02911 int Nmin_ = 0;
02912 int Nmax_ = 10;
02913 int Ptbins_ = 100;
02914 int Etabins_ = 40;
02915 int Phibins_ = 35;
02916 double PtMin_ = 0.;
02917 double PtMax_ = 200.;
02918 double EtaMin_ = -5.;
02919 double EtaMax_ = 5.;
02920 double PhiMin_ = -3.14159;
02921 double PhiMax_ = 3.14159;
02922
02923 std::string dirName4_ = dirname_ + "/TriggerNotFired/";
02924 for(PathInfoCollection::iterator v = hltPathsAll_.begin(); v!= hltPathsAll_.end(); ++v ){
02925
02926 MonitorElement *dummy;
02927 dummy = dbe->bookFloat("dummy");
02928
02929
02930 std::string labelname("ME") ;
02931 std::string histoname(labelname+"");
02932 std::string title(labelname+"");
02933 dbe->setCurrentFolder(dirName4_ + v->getPath());
02934
02935 histoname = labelname+"_TriggerSummary";
02936 title = labelname+"Summary of trigger levels";
02937 MonitorElement * TriggerSummary = dbe->book1D(histoname.c_str(),title.c_str(),7, -0.5,6.5);
02938
02939 std::vector<std::string> trigger;
02940 trigger.push_back("Nevt");
02941 trigger.push_back("L1 failed");
02942 trigger.push_back("L1 & HLT failed");
02943 trigger.push_back("L1 failed but not HLT");
02944 trigger.push_back("L1 passed");
02945 trigger.push_back("L1 & HLT passed");
02946 trigger.push_back("L1 passed but not HLT");
02947 for(unsigned int i =0; i < trigger.size(); i++)TriggerSummary->setBinLabel(i+1, trigger[i]);
02948
02949 if((v->getTriggerType().compare("SingleJet_Trigger") == 0))
02950 {
02951 histoname = labelname+"_JetPt";
02952 title = labelname+"Leading jet pT;Pt[GeV/c]";
02953 MonitorElement * JetPt = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02954 JetPt->getTH1();
02955
02956
02957 histoname = labelname+"_JetEtaVsPt";
02958 title = labelname+"Leading jet #eta vs pT;#eta;Pt[GeV/c]";
02959 MonitorElement * JetEtaVsPt = dbe->book2D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_,Ptbins_,PtMin_,PtMax_);
02960 JetEtaVsPt->getTH1();
02961
02962
02963 histoname = labelname+"_JetPhiVsPt";
02964 title = labelname+"Leading jet #Phi vs pT;#Phi;Pt[GeV/c]";
02965 MonitorElement * JetPhiVsPt = dbe->book2D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_,Ptbins_,PtMin_,PtMax_);
02966 JetPhiVsPt->getTH1();
02967
02968
02969
02970
02971 v->setDgnsHistos( TriggerSummary, dummy, JetPt, JetEtaVsPt, JetPhiVsPt, dummy, dummy, dummy, dummy, dummy, dummy);
02972 }
02973
02974 if((v->getTriggerType().compare("DiJet_Trigger") == 0))
02975 {
02976 histoname = labelname+"_JetSize";
02977 title = labelname+"Jet Size;multiplicity";
02978 MonitorElement * JetSize = dbe->book1D(histoname.c_str(),title.c_str(),Nbins_,Nmin_,Nmax_);
02979 JetSize->getTH1();
02980
02981
02982
02983 histoname = labelname+"_AvergPt";
02984 title = labelname+"Average Pt;Pt[GeV/c]";
02985 MonitorElement * Pt12 = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
02986 Pt12->getTH1();
02987
02988
02989 histoname = labelname+"_AvergEta";
02990 title = labelname+"Average Eta;#eta";
02991 MonitorElement * Eta12 = dbe->book1D(histoname.c_str(),title.c_str(),Etabins_,EtaMin_,EtaMax_);
02992 Eta12->getTH1();
02993
02994
02995 histoname = labelname+"_PhiDifference";
02996 title = labelname+"#Delta#Phi;#Delta#Phi";
02997 MonitorElement * Phi12 = dbe->book1D(histoname.c_str(),title.c_str(),Phibins_,PhiMin_,PhiMax_);
02998 Phi12->getTH1();
02999
03000
03001 histoname = labelname+"_Pt3Jet";
03002 title = labelname+"Pt of 3rd Jet;Pt[GeV/c]";
03003 MonitorElement * Pt3 = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
03004 Pt3->getTH1();
03005
03006
03007 histoname = labelname+"_Pt12VsPt3Jet";
03008 title = labelname+"Pt of 3rd Jet vs Average Pt of leading jets;Avergage Pt[GeV/c]; Pt of 3rd Jet [GeV/c]";
03009 MonitorElement * Pt12Pt3 = dbe->book2D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_,Ptbins_,PtMin_,PtMax_);
03010 Pt12Pt3->getTH1();
03011
03012
03013 histoname = labelname+"_Pt12VsPhi12";
03014 title = labelname+"Average Pt of leading jets vs #Delta#Phi between leading jets;Avergage Pt[GeV/c]; #Delta#Phi";
03015 MonitorElement * Pt12Phi12 = dbe->book2D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_,Phibins_,PhiMin_,PhiMax_);
03016 Pt12Phi12->getTH1();
03017
03018
03019 v->setDgnsHistos( TriggerSummary, JetSize, dummy, dummy, dummy, Pt12, Eta12, Phi12, Pt3, Pt12Pt3, Pt12Phi12);
03020
03021 }
03022
03023 if((v->getTriggerType().compare("MET_Trigger") == 0))
03024 {
03025 histoname = labelname+"_MET";
03026 title = labelname+"MET;Pt[GeV/c]";
03027 MonitorElement * MET = dbe->book1D(histoname.c_str(),title.c_str(),Ptbins_,PtMin_,PtMax_);
03028
03029
03030 v->setDgnsHistos(TriggerSummary, dummy, MET, dummy, dummy, dummy, dummy, dummy,dummy,dummy,dummy);
03031 }
03032
03033
03034 }
03035
03036 }
03037 }
03038
03039
03040 void JetMETHLTOfflineSource::beginLuminosityBlock(const LuminosityBlock& lumiSeg,
03041 const EventSetup& context) {
03042 }
03043
03044 void JetMETHLTOfflineSource::endLuminosityBlock(const LuminosityBlock& lumiSeg,
03045 const EventSetup& context) {
03046 }
03047
03048 void
03049 JetMETHLTOfflineSource::endJob() {
03050 delete jetID;
03051 }
03052
03054 void JetMETHLTOfflineSource::endRun(const edm::Run& run, const edm::EventSetup& c){
03055 if (verbose_) std::cout << "endRun, run " << run.id() << std::endl;
03056 }
03057
03058 bool JetMETHLTOfflineSource::isBarrel(double eta){
03059 bool output = false;
03060 if (fabs(eta)<=1.3) output=true;
03061 return output;
03062 }
03063
03064
03065 bool JetMETHLTOfflineSource::isEndCap(double eta){
03066 bool output = false;
03067 if (fabs(eta)<=3.0 && fabs(eta)>1.3) output=true;
03068 return output;
03069 }
03070
03071
03072 bool JetMETHLTOfflineSource::isForward(double eta){
03073 bool output = false;
03074 if (fabs(eta)>3.0) output=true;
03075 return output;
03076 }
03077
03078
03079 bool JetMETHLTOfflineSource::validPathHLT(std::string pathname){
03080
03081 bool output=false;
03082 for (unsigned int j=0; j!=hltConfig_.size(); ++j) {
03083 if (hltConfig_.triggerName(j) == pathname )
03084 output=true;
03085 }
03086 return output;
03087 }
03088
03089 bool JetMETHLTOfflineSource::isHLTPathAccepted(std::string pathName){
03090
03091 bool output=false;
03092 if(&triggerResults_) {
03093 unsigned index = triggerNames_.triggerIndex(pathName);
03094 if(index < triggerNames_.size() && triggerResults_->accept(index)) output = true;
03095 }
03096 return output;
03097 }
03098
03099 double JetMETHLTOfflineSource::TriggerPosition(std::string trigName){
03100 int nbins = rate_All->getTH1()->GetNbinsX();
03101 double binVal = -100;
03102 for(int ibin=1; ibin<nbins+1; ibin++)
03103 {
03104 const char * binLabel = rate_All->getTH1()->GetXaxis()->GetBinLabel(ibin);
03105 if(binLabel[0]=='\0')continue;
03106
03107
03108 if(trigName.compare(binLabel)!=0)continue;
03109
03110 if(trigName.compare(binLabel)==0){
03111 binVal = rate_All->getTH1()->GetBinCenter(ibin);
03112 break;
03113 }
03114 }
03115 return binVal;
03116 }
03117 bool JetMETHLTOfflineSource::isTriggerObjectFound(std::string objectName){
03118
03119 bool output=false;
03120 edm::InputTag testTag(objectName,"",processname_);
03121 const int index = triggerObj_->filterIndex(testTag);
03122 if ( index >= triggerObj_->sizeFilters() ) {
03123 edm::LogInfo("JetMETHLTOfflineSource") << "no index "<< index << " of that name ";
03124 } else {
03125 const trigger::Keys & k = triggerObj_->filterKeys(index);
03126 if (k.size()) output=true;
03127 }
03128 return output;
03129 }
03130
03131