#include <EgHLTOfflineSource.h>
Definition at line 56 of file EgHLTOfflineSource.h.
EgHLTOfflineSource::EgHLTOfflineSource | ( | const EgHLTOfflineSource & | rhs | ) | [inline, private] |
Definition at line 92 of file EgHLTOfflineSource.h.
{}
EgHLTOfflineSource::EgHLTOfflineSource | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 24 of file EgHLTOfflineSource.cc.
References binData_, cutMasks_, dbe_, diEleTightLooseTrigNames_, diPhoTightLooseTrigNames_, dirName_, eleHLTFilterNames2Leg_, eleHLTFilterNames_, eleTightLooseTrigNames_, filterInactiveTriggers_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), hltTag_, offEvtHelper_, cmsCodeRules::cppFunctionSkipper::operator, phoHLTFilterNames_, phoTightLooseTrigNames_, egHLT::BinData::setup(), egHLT::CutMasks::setup(), egHLT::OffHelper::setup(), and DQMStore::setVerbose().
: nrEventsProcessed_(0),isSetup_(false) { dbe_ = edm::Service<DQMStore>().operator->(); //only one chance to get this, if we ever have another shot, remember to check isSetup is okay if (!dbe_) { //our one and only error message ever logged edm::LogInfo("EgHLTOfflineSource") << "unable to get DQMStore service?"; } if(iConfig.getUntrackedParameter<bool>("DQMStore", false)) { dbe_->setVerbose(0); } binData_.setup(iConfig.getParameter<edm::ParameterSet>("binData")); cutMasks_.setup(iConfig.getParameter<edm::ParameterSet>("cutMasks")); eleHLTFilterNames_ = iConfig.getParameter<std::vector<std::string> >("eleHLTFilterNames"); eleHLTFilterNames2Leg_ = iConfig.getParameter<std::vector<std::string> >("eleHLTFilterNames2Leg"); phoHLTFilterNames_ = iConfig.getParameter<std::vector<std::string> >("phoHLTFilterNames"); eleTightLooseTrigNames_ = iConfig.getParameter<std::vector<std::string> >("eleTightLooseTrigNames"); diEleTightLooseTrigNames_ = iConfig.getParameter<std::vector<std::string> >("diEleTightLooseTrigNames"); phoTightLooseTrigNames_ = iConfig.getParameter<std::vector<std::string> >("phoTightLooseTrigNames"); diPhoTightLooseTrigNames_ = iConfig.getParameter<std::vector<std::string> >("diPhoTightLooseTrigNames"); filterInactiveTriggers_ =iConfig.getParameter<bool>("filterInactiveTriggers"); hltTag_ = iConfig.getParameter<std::string>("hltTag"); dirName_=iConfig.getParameter<std::string>("DQMDirName");//"HLT/EgHLTOfflineSource_" + iConfig.getParameter<std::string>("@module_label"); offEvtHelper_.setup(iConfig); }
EgHLTOfflineSource::~EgHLTOfflineSource | ( | ) | [virtual] |
Definition at line 59 of file EgHLTOfflineSource.cc.
References eleFilterMonHists_, eleMonElems_, i, phoFilterMonHists_, and phoMonElems_.
{ // LogDebug("EgHLTOfflineSource") << "destructor called"; for(size_t i=0;i<eleFilterMonHists_.size();i++){ delete eleFilterMonHists_[i]; } for(size_t i=0;i<phoFilterMonHists_.size();i++){ delete phoFilterMonHists_[i]; } for(size_t i=0;i<eleMonElems_.size();i++){ delete eleMonElems_[i]; } for(size_t i=0;i<phoMonElems_.size();i++){ delete phoMonElems_[i]; } }
void EgHLTOfflineSource::addEleTrigPath | ( | const std::string & | name | ) |
Definition at line 213 of file EgHLTOfflineSource.cc.
References binData_, cutMasks_, eleFilterMonHists_, and python::multivaluedict::sort().
Referenced by beginRun().
{ EleHLTFilterMon* filterMon = new EleHLTFilterMon(name,TrigCodes::getCode(name.c_str()),binData_,cutMasks_); eleFilterMonHists_.push_back(filterMon); std::sort(eleFilterMonHists_.begin(),eleFilterMonHists_.end(),EleHLTFilterMon::ptrLess<EleHLTFilterMon>()); //takes a minor efficiency hit at initalisation to ensure that the vector is always sorted }
void EgHLTOfflineSource::addPhoTrigPath | ( | const std::string & | name | ) |
Definition at line 220 of file EgHLTOfflineSource.cc.
References binData_, cutMasks_, phoFilterMonHists_, and python::multivaluedict::sort().
Referenced by beginRun().
{ PhoHLTFilterMon* filterMon = new PhoHLTFilterMon(name,TrigCodes::getCode(name.c_str()),binData_,cutMasks_); phoFilterMonHists_.push_back(filterMon); std::sort(phoFilterMonHists_.begin(),phoFilterMonHists_.end(),PhoHLTFilterMon::ptrLess<PhoHLTFilterMon>()); //takes a minor efficiency hit at initalisation to ensure that the vector is always sorted }
void EgHLTOfflineSource::analyze | ( | const edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [virtual] |
Implements edm::EDAnalyzer.
Definition at line 168 of file EgHLTOfflineSource.cc.
References dbe_, dqmErrsMonElem_, eleFilterMonHists_, eleMonElems_, egHLT::OffEvt::eles(), MonitorElement::Fill(), egHLT::OffHelper::makeOffEvt(), nrEventsProcessed_, nrEventsProcessedMonElem_, offEvt_, offEvtHelper_, phoFilterMonHists_, phoMonElems_, egHLT::OffEvt::phos(), and CommonMethods::weight().
{ //debugging info, commented out for prod // int nrProducts = debug::listAllProducts<edm::ValueMap<double> >(iEvent,"EgHLTOfflineSource"); //edm::LogInfo("EgHLTOfflineSource")<<" HERE "; // std::cout <<"here"<<std::endl; if(!dbe_) return; const double weight=1.; //we have the ability to weight but its disabled for now - maybe use this for prescales? nrEventsProcessed_++; nrEventsProcessedMonElem_->Fill(nrEventsProcessed_); int errCode = offEvtHelper_.makeOffEvt(iEvent,iSetup,offEvt_); if(errCode!=0){ dqmErrsMonElem_->Fill(errCode); return; } for(size_t pathNr=0;pathNr<eleFilterMonHists_.size();pathNr++){ eleFilterMonHists_[pathNr]->fill(offEvt_,weight); } for(size_t pathNr=0;pathNr<phoFilterMonHists_.size();pathNr++){ phoFilterMonHists_[pathNr]->fill(offEvt_,weight); } for(size_t monElemNr=0;monElemNr<eleMonElems_.size();monElemNr++){ const std::vector<OffEle>& eles = offEvt_.eles(); for(size_t eleNr=0;eleNr<eles.size();eleNr++){ eleMonElems_[monElemNr]->fill(eles[eleNr],offEvt_,weight); } } for(size_t monElemNr=0;monElemNr<phoMonElems_.size();monElemNr++){ const std::vector<OffPho>& phos = offEvt_.phos(); for(size_t phoNr=0;phoNr<phos.size();phoNr++){ phoMonElems_[monElemNr]->fill(phos[phoNr],offEvt_,weight); } } }
void EgHLTOfflineSource::beginJob | ( | void | ) | [virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 76 of file EgHLTOfflineSource.cc.
References DQMStore::book1D(), DQMStore::bookInt(), dbe_, dirName_, dqmErrsMonElem_, nrEventsProcessedMonElem_, and DQMStore::setCurrentFolder().
{ if(dbe_) { dbe_->setCurrentFolder(dirName_); //the one monitor element the source fills directly dqmErrsMonElem_ =dbe_->book1D("dqmErrors","EgHLTOfflineSource Errors",101,-0.5,100.5); nrEventsProcessedMonElem_ = dbe_->bookInt("nrEventsProcessed"); } }
void EgHLTOfflineSource::beginRun | ( | const edm::Run & | run, |
const edm::EventSetup & | c | ||
) | [virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 95 of file EgHLTOfflineSource.cc.
References addEleTrigPath(), addPhoTrigPath(), binData_, cutMasks_, dbe_, diEleTightLooseTrigNames_, diPhoTightLooseTrigNames_, dirName_, eleHLTFilterNames2Leg_, eleHLTFilterNames_, eleMonElems_, eleTightLooseTrigNames_, filterInactiveTriggers_, filterTriggers(), spr::find(), getHLTFilterNamesUsed(), HltComparatorCreateWorkflow::hltConfig, hltTag_, i, HLTConfigProvider::init(), egHLT::MonElemFuncs::initTightLooseDiObjTrigHistsTrigCuts(), egHLT::MonElemFuncs::initTightLooseTrigHists(), egHLT::MonElemFuncs::initTrigTagProbeHist(), egHLT::MonElemFuncs::initTrigTagProbeHist_2Leg(), isSetup_, offEvtHelper_, phoHLTFilterNames_, phoMonElems_, phoTightLooseTrigNames_, DQMStore::setCurrentFolder(), egHLT::OffHelper::setupTriggers(), egHLT::CutMasks::trigTPEle, and egHLT::CutMasks::trigTPPho.
{ if(dbe_ && !isSetup_){ HLTConfigProvider hltConfig; bool changed=false; hltConfig.init(run,c,hltTag_,changed); if(filterInactiveTriggers_) filterTriggers(hltConfig); std::vector<std::string> hltFiltersUsed; getHLTFilterNamesUsed(hltFiltersUsed); TrigCodes::setCodes(hltFiltersUsed); offEvtHelper_.setupTriggers(hltConfig,hltFiltersUsed); //now book ME's dbe_->setCurrentFolder(dirName_+"/Source_Histos"); //each trigger path with generate object distributions and efficiencies (BUT not trigger efficiencies...) for(size_t i=0;i<eleHLTFilterNames_.size();i++){dbe_->setCurrentFolder(dirName_+"/Source_Histos/"+eleHLTFilterNames_[i]); addEleTrigPath(eleHLTFilterNames_[i]);} for(size_t i=0;i<phoHLTFilterNames_.size();i++){dbe_->setCurrentFolder(dirName_+"/Source_Histos/"+phoHLTFilterNames_[i]); addPhoTrigPath(phoHLTFilterNames_[i]);} //efficiencies of one trigger path relative to another MonElemFuncs::initTightLooseTrigHists(eleMonElems_,eleTightLooseTrigNames_,binData_,"gsfEle"); //new EgHLTDQMVarCut<OffEle>(cutMasks_.stdEle,&OffEle::cutCode)); //MonElemFuncs::initTightLooseTrigHistsTrigCuts(eleMonElems_,eleTightLooseTrigNames_,binData_); MonElemFuncs::initTightLooseTrigHists(phoMonElems_,phoTightLooseTrigNames_,binData_,"pho"); // new EgHLTDQMVarCut<OffPho>(cutMasks_.stdPho,&OffPho::cutCode)); //MonElemFuncs::initTightLooseTrigHistsTrigCuts(phoMonElems_,phoTightLooseTrigNames_,binData_); //di-object triggers MonElemFuncs::initTightLooseTrigHists(eleMonElems_,diEleTightLooseTrigNames_,binData_,"gsfEle"); // new EgDiEleCut(cutMasks_.stdEle,&OffEle::cutCode)); MonElemFuncs::initTightLooseTrigHists(phoMonElems_,diPhoTightLooseTrigNames_,binData_,"pho"); // new EgDiPhoCut(cutMasks_.stdPho,&OffPho::cutCode)); MonElemFuncs::initTightLooseDiObjTrigHistsTrigCuts(eleMonElems_,diEleTightLooseTrigNames_,binData_); MonElemFuncs::initTightLooseDiObjTrigHistsTrigCuts(phoMonElems_,diPhoTightLooseTrigNames_,binData_); //tag and probe trigger efficiencies //this is to do measure the trigger efficiency with respect to a fully selected offline electron //using a tag and probe technique (note: this will be different to the trigger efficiency normally calculated) for(size_t i=0;i<eleHLTFilterNames_.size();i++){ dbe_->setCurrentFolder(dirName_+"/Source_Histos/"+eleHLTFilterNames_[i]); MonElemFuncs::initTrigTagProbeHist(eleMonElems_,eleHLTFilterNames_[i],cutMasks_.trigTPEle,binData_); } for(size_t i=0;i<phoHLTFilterNames_.size();i++){ dbe_->setCurrentFolder(dirName_+"/Source_Histos/"+phoHLTFilterNames_[i]); MonElemFuncs::initTrigTagProbeHist(phoMonElems_,phoHLTFilterNames_[i],cutMasks_.trigTPPho,binData_); } for(size_t i=0;i<eleHLTFilterNames2Leg_.size();i++){ dbe_->setCurrentFolder(dirName_+"/Source_Histos/"+eleHLTFilterNames2Leg_[i].substr(eleHLTFilterNames2Leg_[i].find("::")+2)); //std::cout<<"FilterName: "<<eleHLTFilterNames2Leg_[i]<<std::endl; //std::cout<<"Folder: "<<eleHLTFilterNames2Leg_[i].substr(eleHLTFilterNames2Leg_[i].find("::")+2)<<std::endl; MonElemFuncs::initTrigTagProbeHist_2Leg(eleMonElems_,eleHLTFilterNames2Leg_[i],cutMasks_.trigTPEle,binData_); } //tag and probe not yet implimented for photons (attemping to see if it makes sense first) // MonElemFuncs::initTrigTagProbeHists(phoMonElems,phoHLTFilterNames_); isSetup_=true; dbe_->setCurrentFolder(dirName_); } }
void EgHLTOfflineSource::endJob | ( | void | ) | [virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 86 of file EgHLTOfflineSource.cc.
{
// LogDebug("EgHLTOfflineSource") << "ending job";
}
void EgHLTOfflineSource::endRun | ( | const edm::Run & | run, |
const edm::EventSetup & | c | ||
) | [virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 162 of file EgHLTOfflineSource.cc.
{
//LogDebug("EgHLTOfflineSource") << "endRun, run " << run.id();
}
void EgHLTOfflineSource::filterTriggers | ( | const HLTConfigProvider & | hltConfig | ) |
Definition at line 274 of file EgHLTOfflineSource.cc.
References diEleTightLooseTrigNames_, diPhoTightLooseTrigNames_, eleHLTFilterNames2Leg_, eleHLTFilterNames_, eleTightLooseTrigNames_, egHLT::trigTools::filterInactiveTightLooseTriggers(), egHLT::trigTools::filterInactiveTriggers(), egHLT::trigTools::getActiveFilters(), phoHLTFilterNames_, and phoTightLooseTrigNames_.
Referenced by beginRun().
{ std::vector<std::string> activeFilters; std::vector<std::string> activeEleFilters; std::vector<std::string> activeEle2LegFilters; std::vector<std::string> activePhoFilters; std::vector<std::string> activePho2LegFilters; trigTools::getActiveFilters(hltConfig,activeFilters,activeEleFilters,activeEle2LegFilters,activePhoFilters,activePho2LegFilters); trigTools::filterInactiveTriggers(eleHLTFilterNames_,activeFilters); trigTools::filterInactiveTriggers(phoHLTFilterNames_,activePhoFilters); trigTools::filterInactiveTriggers(eleHLTFilterNames2Leg_,activeEle2LegFilters); trigTools::filterInactiveTightLooseTriggers(eleTightLooseTrigNames_,activeEleFilters); trigTools::filterInactiveTightLooseTriggers(diEleTightLooseTrigNames_,activeEleFilters); trigTools::filterInactiveTightLooseTriggers(phoTightLooseTrigNames_,activePhoFilters); trigTools::filterInactiveTightLooseTriggers(diPhoTightLooseTrigNames_,activePhoFilters); }
void EgHLTOfflineSource::getHLTFilterNamesUsed | ( | std::vector< std::string > & | filterNames | ) | const |
Definition at line 234 of file EgHLTOfflineSource.cc.
References diEleTightLooseTrigNames_, diPhoTightLooseTrigNames_, eleHLTFilterNames_, eleTightLooseTrigNames_, i, phoHLTFilterNames_, phoTightLooseTrigNames_, split, swap(), and trigNames.
Referenced by beginRun().
{ std::set<std::string> filterNameSet; for(size_t i=0;i<eleHLTFilterNames_.size();i++) filterNameSet.insert(eleHLTFilterNames_[i]); for(size_t i=0;i<phoHLTFilterNames_.size();i++) filterNameSet.insert(phoHLTFilterNames_[i]); //here we are little more complicated as entries are of the form "tightTrig:looseTrig" //so we need to split them first for(size_t tightLooseNr=0;tightLooseNr<eleTightLooseTrigNames_.size();tightLooseNr++){ std::vector<std::string> trigNames; boost::split(trigNames,eleTightLooseTrigNames_[tightLooseNr],boost::is_any_of(std::string(":"))); if(trigNames.size()!=2) continue; //format incorrect filterNameSet.insert(trigNames[0]); filterNameSet.insert(trigNames[1]); } for(size_t tightLooseNr=0;tightLooseNr<diEleTightLooseTrigNames_.size();tightLooseNr++){ std::vector<std::string> trigNames; boost::split(trigNames,diEleTightLooseTrigNames_[tightLooseNr],boost::is_any_of(std::string(":"))); if(trigNames.size()!=2) continue; //format incorrect filterNameSet.insert(trigNames[0]); filterNameSet.insert(trigNames[1]); } for(size_t tightLooseNr=0;tightLooseNr<phoTightLooseTrigNames_.size();tightLooseNr++){ std::vector<std::string> trigNames; boost::split(trigNames,phoTightLooseTrigNames_[tightLooseNr],boost::is_any_of(std::string(":"))); if(trigNames.size()!=2) continue; //format incorrect filterNameSet.insert(trigNames[0]); filterNameSet.insert(trigNames[1]); } for(size_t tightLooseNr=0;tightLooseNr<diPhoTightLooseTrigNames_.size();tightLooseNr++){ std::vector<std::string> trigNames; boost::split(trigNames,diPhoTightLooseTrigNames_[tightLooseNr],boost::is_any_of(std::string(":"))); if(trigNames.size()!=2) continue; //format incorrect filterNameSet.insert(trigNames[0]); filterNameSet.insert(trigNames[1]); } //right all the triggers are inserted once and only once in the set, convert to vector //very lazy, create a new vector so can use the constructor and then use swap to transfer std::vector<std::string>(filterNameSet.begin(),filterNameSet.end()).swap(filterNames); }
EgHLTOfflineSource& EgHLTOfflineSource::operator= | ( | const EgHLTOfflineSource & | rhs | ) | [inline, private] |
Definition at line 93 of file EgHLTOfflineSource.h.
{return *this;}
egHLT::BinData EgHLTOfflineSource::binData_ [private] |
Definition at line 84 of file EgHLTOfflineSource.h.
Referenced by addEleTrigPath(), addPhoTrigPath(), beginRun(), and EgHLTOfflineSource().
egHLT::CutMasks EgHLTOfflineSource::cutMasks_ [private] |
Definition at line 85 of file EgHLTOfflineSource.h.
Referenced by addEleTrigPath(), addPhoTrigPath(), beginRun(), and EgHLTOfflineSource().
DQMStore* EgHLTOfflineSource::dbe_ [private] |
Definition at line 59 of file EgHLTOfflineSource.h.
Referenced by analyze(), beginJob(), beginRun(), and EgHLTOfflineSource().
std::vector<std::string> EgHLTOfflineSource::diEleTightLooseTrigNames_ [private] |
Definition at line 81 of file EgHLTOfflineSource.h.
Referenced by beginRun(), EgHLTOfflineSource(), filterTriggers(), and getHLTFilterNamesUsed().
std::vector<std::string> EgHLTOfflineSource::diPhoTightLooseTrigNames_ [private] |
Definition at line 82 of file EgHLTOfflineSource.h.
Referenced by beginRun(), EgHLTOfflineSource(), filterTriggers(), and getHLTFilterNamesUsed().
std::string EgHLTOfflineSource::dirName_ [private] |
Definition at line 69 of file EgHLTOfflineSource.h.
Referenced by beginJob(), beginRun(), and EgHLTOfflineSource().
Definition at line 60 of file EgHLTOfflineSource.h.
Referenced by analyze(), and beginJob().
std::vector<egHLT::EleHLTFilterMon*> EgHLTOfflineSource::eleFilterMonHists_ [private] |
Definition at line 64 of file EgHLTOfflineSource.h.
Referenced by addEleTrigPath(), analyze(), and ~EgHLTOfflineSource().
std::vector<std::string> EgHLTOfflineSource::eleHLTFilterNames2Leg_ [private] |
Definition at line 78 of file EgHLTOfflineSource.h.
Referenced by beginRun(), EgHLTOfflineSource(), and filterTriggers().
std::vector<std::string> EgHLTOfflineSource::eleHLTFilterNames_ [private] |
Definition at line 76 of file EgHLTOfflineSource.h.
Referenced by beginRun(), EgHLTOfflineSource(), filterTriggers(), and getHLTFilterNamesUsed().
std::vector<egHLT::MonElemContainer<egHLT::OffEle>*> EgHLTOfflineSource::eleMonElems_ [private] |
Definition at line 66 of file EgHLTOfflineSource.h.
Referenced by analyze(), beginRun(), and ~EgHLTOfflineSource().
std::vector<std::string> EgHLTOfflineSource::eleTightLooseTrigNames_ [private] |
Definition at line 79 of file EgHLTOfflineSource.h.
Referenced by beginRun(), EgHLTOfflineSource(), filterTriggers(), and getHLTFilterNamesUsed().
bool EgHLTOfflineSource::filterInactiveTriggers_ [private] |
Definition at line 88 of file EgHLTOfflineSource.h.
Referenced by beginRun(), and EgHLTOfflineSource().
std::string EgHLTOfflineSource::hltTag_ [private] |
Definition at line 89 of file EgHLTOfflineSource.h.
Referenced by beginRun(), and EgHLTOfflineSource().
bool EgHLTOfflineSource::isSetup_ [private] |
Definition at line 87 of file EgHLTOfflineSource.h.
Referenced by beginRun().
int EgHLTOfflineSource::nrEventsProcessed_ [private] |
Definition at line 62 of file EgHLTOfflineSource.h.
Referenced by analyze().
Definition at line 61 of file EgHLTOfflineSource.h.
Referenced by analyze(), and beginJob().
egHLT::OffEvt EgHLTOfflineSource::offEvt_ [private] |
Definition at line 71 of file EgHLTOfflineSource.h.
Referenced by analyze().
Definition at line 72 of file EgHLTOfflineSource.h.
Referenced by analyze(), beginRun(), and EgHLTOfflineSource().
std::vector<egHLT::PhoHLTFilterMon*> EgHLTOfflineSource::phoFilterMonHists_ [private] |
Definition at line 65 of file EgHLTOfflineSource.h.
Referenced by addPhoTrigPath(), analyze(), and ~EgHLTOfflineSource().
std::vector<std::string> EgHLTOfflineSource::phoHLTFilterNames_ [private] |
Definition at line 77 of file EgHLTOfflineSource.h.
Referenced by beginRun(), EgHLTOfflineSource(), filterTriggers(), and getHLTFilterNamesUsed().
std::vector<egHLT::MonElemContainer<egHLT::OffPho>*> EgHLTOfflineSource::phoMonElems_ [private] |
Definition at line 67 of file EgHLTOfflineSource.h.
Referenced by analyze(), beginRun(), and ~EgHLTOfflineSource().
std::vector<std::string> EgHLTOfflineSource::phoTightLooseTrigNames_ [private] |
Definition at line 80 of file EgHLTOfflineSource.h.
Referenced by beginRun(), EgHLTOfflineSource(), filterTriggers(), and getHLTFilterNamesUsed().