#include <DQMOffline/Trigger/interface/EgHLTOfflineClient.h>
Public Member Functions | |
virtual void | analyze (const edm::Event &, const edm::EventSetup &) |
virtual void | beginJob (const edm::EventSetup &) |
virtual void | beginLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context) |
virtual void | beginRun (const edm::Run &run, const edm::EventSetup &c) |
void | createLooseTightTrigEff (const std::string &filterName, const std::string ®ion="") |
void | createN1EffHists (const std::string &baseName, const std::string ®ion="") |
void | createTrigTagProbeEffHists (const std::string &filterName, const std::string ®ion="") |
EgHLTOfflineClient (const edm::ParameterSet &) | |
virtual void | endJob () |
virtual void | endLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c) |
virtual void | endRun (const edm::Run &run, const edm::EventSetup &c) |
MonitorElement * | makeEffMonElemFromPassAndAll (const std::string &name, const MonitorElement *pass, const MonitorElement *all) |
MonitorElement * | makeEffMonElemFromPassAndFail (const std::string &name, const MonitorElement *pass, const MonitorElement *fail) |
virtual | ~EgHLTOfflineClient () |
Private Member Functions | |
EgHLTOfflineClient (const EgHLTOfflineClient &rhs) | |
EgHLTOfflineClient & | operator= (const EgHLTOfflineClient &rhs) |
Private Attributes | |
DQMStore * | dbe_ |
std::string | dirName_ |
std::vector< std::string > | eleHLTFilterNames_ |
std::vector< std::string > | eleHLTPathNames_ |
std::vector< std::string > | eleHLTTightLooseFilters_ |
Definition at line 47 of file EgHLTOfflineClient.h.
EgHLTOfflineClient::EgHLTOfflineClient | ( | const EgHLTOfflineClient & | rhs | ) | [inline, private] |
EgHLTOfflineClient::EgHLTOfflineClient | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 20 of file EgHLTOfflineClient.cc.
References dbe_, dirName_, eleHLTFilterNames_, eleHLTPathNames_, eleHLTTightLooseFilters_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), DQMStore::setCurrentFolder(), and DQMStore::setVerbose().
00021 { 00022 dbe_ = edm::Service<DQMStore>().operator->(); 00023 if (!dbe_) { 00024 edm::LogInfo("EgHLTOfflineClient") << "unable to get DQMStore service?"; 00025 } 00026 if(iConfig.getUntrackedParameter<bool>("DQMStore", false)) { 00027 dbe_->setVerbose(0); 00028 } 00029 00030 eleHLTPathNames_ = iConfig.getParameter<std::vector<std::string> >("eleHLTPathNames"); 00031 eleHLTFilterNames_ = iConfig.getParameter<std::vector<std::string> >("eleHLTFilterNames"); 00032 eleHLTTightLooseFilters_ = iConfig.getParameter<std::vector<std::string> >("eleHLTTightLooseFilters"); 00033 dirName_=iConfig.getParameter<std::string>("DQMDirName");//"HLT/EgHLTOfflineClient_" + iConfig.getParameter<std::string>("sourceModuleName"); 00034 00035 if(dbe_) dbe_->setCurrentFolder(dirName_); 00036 00037 }
EgHLTOfflineClient::~EgHLTOfflineClient | ( | ) | [virtual] |
void EgHLTOfflineClient::analyze | ( | const edm::Event & | iEvent, | |
const edm::EventSetup & | iSetup | |||
) | [virtual] |
void EgHLTOfflineClient::beginJob | ( | const edm::EventSetup & | iSetup | ) | [virtual] |
virtual void EgHLTOfflineClient::beginLuminosityBlock | ( | const edm::LuminosityBlock & | lumiSeg, | |
const edm::EventSetup & | context | |||
) | [inline, virtual] |
void EgHLTOfflineClient::beginRun | ( | const edm::Run & | run, | |
const edm::EventSetup & | c | |||
) | [virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 56 of file EgHLTOfflineClient.cc.
References edm::Run::id(), and LogDebug.
void EgHLTOfflineClient::createLooseTightTrigEff | ( | const std::string & | filterName, | |
const std::string & | region = "" | |||
) |
Definition at line 181 of file EgHLTOfflineClient.cc.
References dbe_, dirName_, cmsPerfPublish::fail(), DQMStore::get(), makeEffMonElemFromPassAndFail(), and NULL.
Referenced by endLuminosityBlock().
00182 { 00183 std::vector<std::string> vsVarNames; 00184 vsVarNames.push_back("et"); 00185 vsVarNames.push_back("eta"); 00186 vsVarNames.push_back("charge"); 00187 00188 for(size_t varNr=0;varNr<vsVarNames.size();varNr++){ 00189 MonitorElement* fail = dbe_->get(dirName_+"/"+filterName+"_passLooseTrig_failTightTrig_"+vsVarNames[varNr]+"_"+region); 00190 if(fail==NULL){ 00191 edm::LogInfo("EgHLTOfflineClient") <<" couldnt get hist "<<dirName_+"/"+filterName+"_passLooseTrig_failTightTrig_"+vsVarNames[varNr]+"_"+region; 00192 continue; 00193 } 00194 00195 MonitorElement* pass = dbe_->get(dirName_+"/"+filterName+"_passLooseTrig_passTightTrig_"+vsVarNames[varNr]+"_"+region); 00196 if(pass==NULL){ 00197 edm::LogInfo("EgHLTOfflineClient") <<" couldnt get hist "<<dirName_+"/"+filterName+"_passLooseTrig_passTightTrig_"+vsVarNames[varNr]+"_"+region; 00198 continue; 00199 } 00200 const std::string newHistName(filterName+"_tightTrigEff_vs_"+vsVarNames[varNr]+"_"+region); 00201 makeEffMonElemFromPassAndFail(newHistName,pass,fail); 00202 } //end loop over vsVarNames 00203 00204 }
void EgHLTOfflineClient::createN1EffHists | ( | const std::string & | baseName, | |
const std::string & | region = "" | |||
) |
Definition at line 98 of file EgHLTOfflineClient.cc.
References dbe_, dirName_, DQMStore::get(), makeEffMonElemFromPassAndAll(), and NULL.
Referenced by endLuminosityBlock().
00099 { 00100 std::vector<std::string> varNames; 00101 varNames.push_back("dEtaIn"); 00102 varNames.push_back("dPhiIn"); 00103 varNames.push_back("hOverE"); 00104 varNames.push_back("sigmaEtaEta"); 00105 00106 MonitorElement* numer = dbe_->get(dirName_+"/"+baseName+"_allCuts_"+region); 00107 00108 for(size_t varNr=0;varNr<varNames.size();varNr++){ 00109 MonitorElement* denom = dbe_->get(dirName_+"/"+baseName+"_n1_"+varNames[varNr]+"_"+region); 00110 if(numer!=NULL && denom!=NULL){ 00111 std::string effHistName(baseName+"_n1Eff_"+varNames[varNr]+"_"+region); 00112 makeEffMonElemFromPassAndAll(effHistName,numer,denom); 00113 } 00114 }//end loop over varNames 00115 }
void EgHLTOfflineClient::createTrigTagProbeEffHists | ( | const std::string & | filterName, | |
const std::string & | region = "" | |||
) |
Definition at line 117 of file EgHLTOfflineClient.cc.
References python::cmstools::all(), dbe_, dirName_, DQMStore::get(), makeEffMonElemFromPassAndAll(), and NULL.
Referenced by endLuminosityBlock().
00118 { 00119 std::vector<std::string> vsVarNames; 00120 vsVarNames.push_back("et"); 00121 vsVarNames.push_back("eta"); 00122 vsVarNames.push_back("phi"); 00123 vsVarNames.push_back("charge"); 00124 00125 for(size_t varNr=0;varNr<vsVarNames.size();varNr++){ 00126 std::string allName(dirName_+"/"+filterName+"_trigTagProbe_all_"+vsVarNames[varNr]+"_"+region); 00127 MonitorElement* all = dbe_->get(allName); 00128 if(all==NULL){ 00129 edm::LogInfo("EgHLTOfflineClient") <<" couldnt get hist "<<allName; 00130 continue; 00131 } 00132 std::string passName(dirName_+"/"+filterName+"_trigTagProbe_pass_"+vsVarNames[varNr]+"_"+region); 00133 MonitorElement* pass = dbe_->get(passName); 00134 if(pass==NULL){ 00135 edm::LogInfo("EgHLTOfflineClient") <<" couldnt get hist "<<passName; 00136 continue; 00137 } 00138 00139 makeEffMonElemFromPassAndAll(filterName+"_trigTagProbeEff_vs_"+vsVarNames[varNr]+"_"+region,pass,all); 00140 }//end loop over vsVarNames 00141 }
Reimplemented from edm::EDAnalyzer.
Definition at line 51 of file EgHLTOfflineClient.cc.
References LogDebug.
00052 { 00053 LogDebug("EgHLTOfflineClient") << "ending job"; 00054 }
void EgHLTOfflineClient::endLuminosityBlock | ( | const edm::LuminosityBlock & | lumiSeg, | |
const edm::EventSetup & | c | |||
) | [virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 73 of file EgHLTOfflineClient.cc.
References createLooseTightTrigEff(), createN1EffHists(), createTrigTagProbeEffHists(), eleHLTFilterNames_, eleHLTPathNames_, and eleHLTTightLooseFilters_.
00074 { 00075 edm::LogInfo("EgHLTOfflineClient") << "end lumi block called"; 00076 std::vector<std::string> regions; 00077 regions.push_back("eb"); 00078 regions.push_back("ee"); 00079 for(size_t pathNr=0;pathNr<eleHLTPathNames_.size();pathNr++){ 00080 for(size_t filterNr=0;filterNr<eleHLTFilterNames_.size();filterNr++){ 00081 for(size_t regionNr=0;regionNr<regions.size();regionNr++){ 00082 createTrigTagProbeEffHists(eleHLTPathNames_[pathNr]+eleHLTFilterNames_[filterNr],regions[regionNr]); 00083 createN1EffHists(eleHLTPathNames_[pathNr]+eleHLTFilterNames_[filterNr]+"_gsfEle_effVsEt_tagProbe",regions[regionNr]); 00084 createN1EffHists(eleHLTPathNames_[pathNr]+eleHLTFilterNames_[filterNr]+"_gsfEle_effVsEt",regions[regionNr]); 00085 createN1EffHists(eleHLTPathNames_[pathNr]+eleHLTFilterNames_[filterNr]+"_gsfEle_effVsEt_fakeRate",regions[regionNr]); 00086 } 00087 } 00088 } 00089 00090 for(size_t filterNr=0;filterNr<eleHLTTightLooseFilters_.size();filterNr++){ 00091 for(size_t regionNr=0;regionNr<regions.size();regionNr++){ 00092 createLooseTightTrigEff(eleHLTTightLooseFilters_[filterNr],regions[regionNr]); 00093 } 00094 } 00095 00096 }
void EgHLTOfflineClient::endRun | ( | const edm::Run & | run, | |
const edm::EventSetup & | c | |||
) | [virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 62 of file EgHLTOfflineClient.cc.
References edm::Run::id(), and LogDebug.
MonitorElement * EgHLTOfflineClient::makeEffMonElemFromPassAndAll | ( | const std::string & | name, | |
const MonitorElement * | pass, | |||
const MonitorElement * | all | |||
) |
Definition at line 143 of file EgHLTOfflineClient.cc.
References DQMStore::book1D(), dbe_, dirName_, DQMStore::get(), MonitorElement::getTH1F(), and NULL.
Referenced by createN1EffHists(), and createTrigTagProbeEffHists().
00144 { 00145 TH1F* passHist = pass->getTH1F(); 00146 if(passHist->GetSumw2N()==0) passHist->Sumw2(); 00147 TH1F* allHist = all->getTH1F(); 00148 if(allHist->GetSumw2N()==0) allHist->Sumw2(); 00149 TH1F* effHist = (TH1F*) passHist->Clone(name.c_str()); 00150 effHist->Divide(passHist,allHist,1,1,"B"); 00151 00152 MonitorElement* eff = dbe_->get(dirName_+"/"+name); 00153 if(eff==NULL) eff= dbe_->book1D(name,effHist); 00154 else{ //I was having problems with collating the histograms, hence why I'm just reseting the histogram value 00155 *eff->getTH1F()=*effHist; 00156 delete effHist; 00157 } 00158 return eff; 00159 }
MonitorElement * EgHLTOfflineClient::makeEffMonElemFromPassAndFail | ( | const std::string & | name, | |
const MonitorElement * | pass, | |||
const MonitorElement * | fail | |||
) |
Definition at line 161 of file EgHLTOfflineClient.cc.
References DQMStore::book1D(), dbe_, dirName_, DQMStore::get(), MonitorElement::getTH1F(), and NULL.
Referenced by createLooseTightTrigEff().
00162 { 00163 TH1F* failHist = fail->getTH1F(); 00164 if(failHist->GetSumw2N()==0) failHist->Sumw2(); 00165 TH1F* passHist = pass->getTH1F(); 00166 if(passHist->GetSumw2N()==0) passHist->Sumw2(); 00167 00168 TH1F* effHist = (TH1F*) passHist->Clone(name.c_str()); 00169 effHist->Add(failHist); 00170 effHist->Divide(passHist,effHist,1,1,"B"); 00171 00172 MonitorElement* eff = dbe_->get(dirName_+"/"+name); 00173 if(eff==NULL) eff = dbe_->book1D(name,effHist); 00174 else{ //I was having problems with collating the histograms, hence why I'm just reseting the histogram value 00175 *eff->getTH1F()=*effHist; 00176 delete effHist; 00177 } 00178 return eff; 00179 }
EgHLTOfflineClient& EgHLTOfflineClient::operator= | ( | const EgHLTOfflineClient & | rhs | ) | [inline, private] |
DQMStore* EgHLTOfflineClient::dbe_ [private] |
Definition at line 50 of file EgHLTOfflineClient.h.
Referenced by createLooseTightTrigEff(), createN1EffHists(), createTrigTagProbeEffHists(), EgHLTOfflineClient(), makeEffMonElemFromPassAndAll(), and makeEffMonElemFromPassAndFail().
std::string EgHLTOfflineClient::dirName_ [private] |
Definition at line 51 of file EgHLTOfflineClient.h.
Referenced by createLooseTightTrigEff(), createN1EffHists(), createTrigTagProbeEffHists(), EgHLTOfflineClient(), makeEffMonElemFromPassAndAll(), and makeEffMonElemFromPassAndFail().
std::vector<std::string> EgHLTOfflineClient::eleHLTFilterNames_ [private] |
Definition at line 53 of file EgHLTOfflineClient.h.
Referenced by EgHLTOfflineClient(), and endLuminosityBlock().
std::vector<std::string> EgHLTOfflineClient::eleHLTPathNames_ [private] |
Definition at line 52 of file EgHLTOfflineClient.h.
Referenced by EgHLTOfflineClient(), and endLuminosityBlock().
std::vector<std::string> EgHLTOfflineClient::eleHLTTightLooseFilters_ [private] |
Definition at line 54 of file EgHLTOfflineClient.h.
Referenced by EgHLTOfflineClient(), and endLuminosityBlock().