#include <SiPixelEDAClient.h>
Definition at line 25 of file SiPixelEDAClient.h.
SiPixelEDAClient::SiPixelEDAClient | ( | const edm::ParameterSet & | ps | ) |
Definition at line 59 of file SiPixelEDAClient.cc.
References actionOnLumiSec_, actionOnRunEnd_, bei_, BUF_SIZE, ExpressReco_HICollisions_FallBack::cerr, doHitEfficiency_, evtOffsetForInit_, edm::ParameterSet::getUntrackedParameter(), hiRes_, html_out_, recoMuon::in, noiseRate_, noiseRateDenominator_, offlineXMLfile_, cmsCodeRules::cppFunctionSkipper::operator, sipixelActionExecutor_, sipixelDataQuality_, sipixelInformationExtractor_, sipixelWebInterface_, staticUpdateFrequency_, summaryFrequency_, Tier0Flag_, and tkMapFrequency_.
: ModuleWeb("SiPixelEDAClient"){ // cout<<"Entering SiPixelEDAClient::SiPixelEDAClient: "<<endl; edm::LogInfo("SiPixelEDAClient") << " Creating SiPixelEDAClient " << "\n" ; bei_ = Service<DQMStore>().operator->(); summaryFrequency_ = ps.getUntrackedParameter<int>("SummaryCreationFrequency",20); tkMapFrequency_ = ps.getUntrackedParameter<int>("TkMapCreationFrequency",50); staticUpdateFrequency_ = ps.getUntrackedParameter<int>("StaticUpdateFrequency",10); actionOnLumiSec_ = ps.getUntrackedParameter<bool>("ActionOnLumiSection",false); //client actionOnRunEnd_ = ps.getUntrackedParameter<bool>("ActionOnRunEnd",true); //client evtOffsetForInit_ = ps.getUntrackedParameter<int>("EventOffsetForInit",10); //client offlineXMLfile_ = ps.getUntrackedParameter<bool>("UseOfflineXMLFile",false); //client hiRes_ = ps.getUntrackedParameter<bool>("HighResolutionOccupancy",false); //client noiseRate_ = ps.getUntrackedParameter<double>("NoiseRateCutValue",0.001); //client noiseRateDenominator_ = ps.getUntrackedParameter<int>("NEventsForNoiseCalculation",100000); //client Tier0Flag_ = ps.getUntrackedParameter<bool>("Tier0Flag",false); //client doHitEfficiency_ = ps.getUntrackedParameter<bool>("DoHitEfficiency",true); //client if(!Tier0Flag_){ string localPath = string("DQM/SiPixelMonitorClient/test/loader.html"); ifstream fin(edm::FileInPath(localPath).fullPath().c_str(), ios::in); char buf[BUF_SIZE]; if (!fin) { cerr << "Input File: loader.html"<< " could not be opened!" << endl; return; } while (fin.getline(buf, BUF_SIZE, '\n')) { // pops off the newline character html_out_ << buf ; } fin.close(); } // instantiate web interface sipixelWebInterface_ = new SiPixelWebInterface(bei_,offlineXMLfile_,Tier0Flag_); //instantiate the three work horses of the client: sipixelInformationExtractor_ = new SiPixelInformationExtractor(offlineXMLfile_); sipixelActionExecutor_ = new SiPixelActionExecutor(offlineXMLfile_, Tier0Flag_); sipixelDataQuality_ = new SiPixelDataQuality(offlineXMLfile_); // cout<<"...leaving SiPixelEDAClient::SiPixelEDAClient. "<<endl; }
SiPixelEDAClient::~SiPixelEDAClient | ( | ) | [virtual] |
Definition at line 109 of file SiPixelEDAClient.cc.
References sipixelActionExecutor_, sipixelDataQuality_, sipixelInformationExtractor_, and sipixelWebInterface_.
{ // cout<<"Entering SiPixelEDAClient::~SiPixelEDAClient: "<<endl; edm::LogInfo("SiPixelEDAClient") << " Deleting SiPixelEDAClient " << "\n" ; if (sipixelWebInterface_) { delete sipixelWebInterface_; sipixelWebInterface_ = 0; } if (sipixelInformationExtractor_) { delete sipixelInformationExtractor_; sipixelInformationExtractor_ = 0; } if (sipixelActionExecutor_) { delete sipixelActionExecutor_; sipixelActionExecutor_ = 0; } if (sipixelDataQuality_) { delete sipixelDataQuality_; sipixelDataQuality_ = 0; } // cout<<"...leaving SiPixelEDAClient::~SiPixelEDAClient. "<<endl; }
void SiPixelEDAClient::analyze | ( | edm::Event const & | e, |
edm::EventSetup const & | eSetup | ||
) | [protected, virtual] |
Implements edm::EDAnalyzer.
Definition at line 207 of file SiPixelEDAClient.cc.
References SiPixelWebInterface::CreatePlots, FEDRawData::data(), FEDRawDataCollection::FEDData(), edm::Event::getByLabel(), i, edm::HandleBase::isValid(), nEvents_, nFEDs_, SiPixelWebInterface::performAction(), SiPixelWebInterface::setActionFlag(), sipixelWebInterface_, FEDRawData::size(), and Tier0Flag_.
{ // cout<<"[SiPixelEDAClient::analyze()] "<<endl; nEvents_++; if(!Tier0Flag_){ if(nEvents_==1){ // check if any Pixel FED is in readout: edm::Handle<FEDRawDataCollection> rawDataHandle; e.getByLabel("source", rawDataHandle); if(!rawDataHandle.isValid()){ edm::LogInfo("SiPixelEDAClient") << "source" << " is empty"; return; } const FEDRawDataCollection& rawDataCollection = *rawDataHandle; nFEDs_ = 0; for(int i = 0; i != 40; i++){ if(rawDataCollection.FEDData(i).size() && rawDataCollection.FEDData(i).data()) nFEDs_++; } } // This is needed for plotting with the Pixel Expert GUI (interactive client): sipixelWebInterface_->setActionFlag(SiPixelWebInterface::CreatePlots); sipixelWebInterface_->performAction(); } }
void SiPixelEDAClient::beginJob | ( | void | ) | [protected, virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 135 of file SiPixelEDAClient.cc.
References firstRun.
{ firstRun = true; }
void SiPixelEDAClient::beginLuminosityBlock | ( | edm::LuminosityBlock const & | lumiSeg, |
edm::EventSetup const & | context | ||
) | [protected, virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 191 of file SiPixelEDAClient.cc.
References bei_, DQMStore::get(), MonitorElement::getBinContent(), nEvents_lastLS_, and MonitorElement::Reset().
{ // cout<<"Entering SiPixelEDAClient::beginLuminosityBlock: "<<endl; edm::LogInfo ("SiPixelEDAClient") <<"[SiPixelEDAClient]: Begin of LS transition"; MonitorElement * me = bei_->get("Pixel/AdditionalPixelErrors/byLumiErrors"); if(me){ nEvents_lastLS_ = int(me->getBinContent(0)); me->Reset(); } // cout<<"...leaving SiPixelEDAClient::beginLuminosityBlock. "<<endl; }
void SiPixelEDAClient::beginRun | ( | edm::Run const & | run, |
edm::EventSetup const & | eSetup | ||
) | [protected, virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 141 of file SiPixelEDAClient.cc.
References actionOnLumiSec_, actionOnRunEnd_, bei_, SiPixelActionExecutor::bookDeviations(), SiPixelActionExecutor::bookEfficiency(), SiPixelDataQuality::bookGlobalQualityFlag(), SiPixelInformationExtractor::bookNoisyPixels(), SiPixelActionExecutor::bookOccupancyPlots(), SiPixelActionExecutor::createSummary(), doHitEfficiency_, evtOffsetForInit_, firstRun, hiRes_, nEvents_, nFEDs_, nLumiSecs_, noiseRate_, SiPixelWebInterface::readConfiguration(), DQMStore::setCurrentFolder(), sipixelActionExecutor_, sipixelDataQuality_, sipixelInformationExtractor_, sipixelWebInterface_, summaryFrequency_, Tier0Flag_, and tkMapFrequency_.
{ edm::LogInfo ("SiPixelEDAClient") <<"[SiPixelEDAClient]: Begining of Run"; // cout<<"Entering SiPixelEDAClient::beginRun: "<<endl; if(firstRun){ // Read the summary configuration file if (!sipixelWebInterface_->readConfiguration(tkMapFrequency_,summaryFrequency_)) { edm::LogInfo ("SiPixelEDAClient") <<"[SiPixelEDAClient]: Error to read configuration file!! Summary will not be produced!!!"; summaryFrequency_ = -1; tkMapFrequency_ = -1; actionOnLumiSec_ = false; actionOnRunEnd_ = true; evtOffsetForInit_ = -1; } nLumiSecs_ = 0; nEvents_ = 0; if(Tier0Flag_) nFEDs_ = 40; else nFEDs_ = 0; bei_->setCurrentFolder("Pixel/"); // Setting up QTests: // sipixelActionExecutor_->setupQTests(bei_); // Creating Summary Histos: sipixelActionExecutor_->createSummary(bei_); // Booking Deviation Histos: if(!Tier0Flag_) sipixelActionExecutor_->bookDeviations(bei_); // Booking Efficiency Histos: if(doHitEfficiency_) sipixelActionExecutor_->bookEfficiency(bei_); // Creating occupancy plots: sipixelActionExecutor_->bookOccupancyPlots(bei_, hiRes_); // Booking noisy pixel ME's: if(noiseRate_>0.) sipixelInformationExtractor_->bookNoisyPixels(bei_, noiseRate_, Tier0Flag_); // Booking summary report ME's: sipixelDataQuality_->bookGlobalQualityFlag(bei_, Tier0Flag_, nFEDs_); // Booking Static Tracker Maps: // sipixelActionExecutor_->bookTrackerMaps(bei_, "adc"); // sipixelActionExecutor_->bookTrackerMaps(bei_, "charge"); // sipixelActionExecutor_->bookTrackerMaps(bei_, "ndigis"); // sipixelActionExecutor_->bookTrackerMaps(bei_, "NErrors"); firstRun = false; } // cout<<"...leaving SiPixelEDAClient::beginRun. "<<endl; }
void SiPixelEDAClient::defaultWebPage | ( | xgi::Input * | in, |
xgi::Output * | out | ||
) | [virtual] |
Reimplemented from evf::ModuleWeb.
Definition at line 336 of file SiPixelEDAClient.cc.
References SiPixelWebInterface::handleEDARequest(), html_out_, nEvents_, and sipixelWebInterface_.
{ // cout<<"Entering SiPixelEDAClient::defaultWebPage: "<<endl; bool isRequest = false; cgicc::Cgicc cgi(in); cgicc::CgiEnvironment cgie(in); // edm::LogInfo("SiPixelEDAClient") <<"[SiPixelEDAClient]: defaultWebPage " // << " query string : " << cgie.getQueryString(); // if ( xgi::Utils::hasFormElement(cgi,"ClientRequest") ) isRequest = true; string q_string = cgie.getQueryString(); if (q_string.find("RequestID") != string::npos) isRequest = true; if (!isRequest) { *out << html_out_.str() << std::endl; } else { // Handles all HTTP requests of the form int iter = nEvents_/100; sipixelWebInterface_->handleEDARequest(in, out, iter); } // cout<<"...leaving SiPixelEDAClient::defaultWebPage. "<<endl; }
void SiPixelEDAClient::endJob | ( | void | ) | [protected, virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 328 of file SiPixelEDAClient.cc.
{ // cout<<"In SiPixelEDAClient::endJob "<<endl; edm::LogInfo("SiPixelEDAClient") <<"[SiPixelEDAClient]: endjob called!"; }
void SiPixelEDAClient::endLuminosityBlock | ( | edm::LuminosityBlock const & | lumiSeg, |
edm::EventSetup const & | c | ||
) | [protected, virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 236 of file SiPixelEDAClient.cc.
References actionOnLumiSec_, bei_, DQMStore::cd(), SiPixelDataQuality::computeGlobalQualityFlagByLumi(), SiPixelActionExecutor::createEfficiency(), SiPixelActionExecutor::createOccupancy(), doHitEfficiency_, SiPixelDataQuality::fillGlobalQualityPlot(), SiPixelInformationExtractor::findNoisyPixels(), init, edm::LuminosityBlockBase::luminosityBlock(), nEvents_lastLS_, nFEDs_, nLumiSecs_, noiseRate_, noiseRateDenominator_, SiPixelWebInterface::performAction(), SiPixelWebInterface::QTestResult, SiPixelWebInterface::setActionFlag(), sipixelActionExecutor_, sipixelDataQuality_, sipixelInformationExtractor_, sipixelWebInterface_, SiPixelWebInterface::Summary, and Tier0Flag_.
{ // cout<<"Entering SiPixelEDAClient::endLuminosityBlock: "<<endl; edm::LogInfo ("SiPixelEDAClient") <<"[SiPixelEDAClient]: End of LS transition, performing the DQM client operation"; nLumiSecs_++; //cout << "nLumiSecs_: "<< nLumiSecs_ << endl; edm::LogInfo("SiPixelEDAClient") << "====================================================== " << endl << " ===> Iteration # " << nLumiSecs_ << " " << lumiSeg.luminosityBlock() << endl << "====================================================== " << endl; if(actionOnLumiSec_ && !Tier0Flag_ && nLumiSecs_ % 1 == 0 ){ //cout << " Updating Summary " << endl; sipixelWebInterface_->setActionFlag(SiPixelWebInterface::Summary); sipixelWebInterface_->performAction(); //cout << " Updating efficiency plots" << endl; if(doHitEfficiency_) sipixelActionExecutor_->createEfficiency(bei_); //cout << " Checking QTest results " << endl; sipixelWebInterface_->setActionFlag(SiPixelWebInterface::QTestResult); sipixelWebInterface_->performAction(); //cout << " Updating occupancy plots" << endl; sipixelActionExecutor_->createOccupancy(bei_); //cout << " Checking Pixel quality flags " << endl;; bei_->cd(); bool init=true; //sipixelDataQuality_->computeGlobalQualityFlag(bei_,init,nFEDs_,Tier0Flag_); sipixelDataQuality_->computeGlobalQualityFlagByLumi(bei_,init,nFEDs_,Tier0Flag_,nEvents_lastLS_); init=true; bei_->cd(); sipixelDataQuality_->fillGlobalQualityPlot(bei_,init,eSetup,nFEDs_,Tier0Flag_,nLumiSecs_); //cout << " Checking for new noisy pixels " << endl; init=true; if(noiseRate_>=0.) sipixelInformationExtractor_->findNoisyPixels(bei_, init, noiseRate_, noiseRateDenominator_, eSetup); // cout << "*** Creating Tracker Map Histos for End Run ***" << endl; // sipixelActionExecutor_->createMaps(bei_, "adc_siPixelDigis", "adc", Mean); // sipixelActionExecutor_->createMaps(bei_, "charge_siPixelClusters", "charge", Mean); // sipixelActionExecutor_->createMaps(bei_, "ndigis_siPixelDigis", "ndigis", WeightedSum); // sipixelActionExecutor_->createMaps(bei_, "NErrors_siPixelDigis", "NErrors", WeightedSum); // cout << "*** Done with Tracker Map Histos for End Run ***" << endl; } // cout<<"...leaving SiPixelEDAClient::endLuminosityBlock. "<<endl; }
void SiPixelEDAClient::endRun | ( | edm::Run const & | run, |
edm::EventSetup const & | eSetup | ||
) | [protected, virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 281 of file SiPixelEDAClient.cc.
References actionOnRunEnd_, bei_, DQMStore::cd(), SiPixelDataQuality::computeGlobalQualityFlag(), SiPixelActionExecutor::createEfficiency(), SiPixelActionExecutor::createOccupancy(), doHitEfficiency_, SiPixelDataQuality::fillGlobalQualityPlot(), SiPixelInformationExtractor::findNoisyPixels(), init, nFEDs_, nLumiSecs_, noiseRate_, noiseRateDenominator_, SiPixelWebInterface::performAction(), SiPixelWebInterface::QTestResult, SiPixelWebInterface::setActionFlag(), sipixelActionExecutor_, sipixelDataQuality_, sipixelInformationExtractor_, sipixelWebInterface_, SiPixelWebInterface::Summary, and Tier0Flag_.
{ //cout<<"Entering SiPixelEDAClient::endRun: "<<endl; //edm::LogVerbatim ("SiPixelEDAClient") <<"[SiPixelEDAClient]: End of Run, saving DQM output "; //int iRun = run.run(); if(actionOnRunEnd_){ //cout << " Updating Summary " << endl; sipixelWebInterface_->setActionFlag(SiPixelWebInterface::Summary); sipixelWebInterface_->performAction(); //cout << " Updating efficiency plots" << endl; if(doHitEfficiency_) sipixelActionExecutor_->createEfficiency(bei_); //cout << " Checking QTest results " << endl; sipixelWebInterface_->setActionFlag(SiPixelWebInterface::QTestResult); sipixelWebInterface_->performAction(); //cout << " Updating occupancy plots" << endl; sipixelActionExecutor_->createOccupancy(bei_); //cout << " Checking Pixel quality flags " << endl;; bei_->cd(); bool init=true; sipixelDataQuality_->computeGlobalQualityFlag(bei_,init,nFEDs_,Tier0Flag_); init=true; bei_->cd(); //cout << " Making run end reportSummaryMap: " <<nFEDs_<< endl;; sipixelDataQuality_->fillGlobalQualityPlot(bei_,init,eSetup,nFEDs_,Tier0Flag_,nLumiSecs_); //cout << " Checking for new noisy pixels " << endl; init=true; if(noiseRate_>=0.) sipixelInformationExtractor_->findNoisyPixels(bei_, init, noiseRate_, noiseRateDenominator_, eSetup); // cout << "*** Creating Tracker Map Histos for End Run ***" << endl; // sipixelActionExecutor_->createMaps(bei_, "adc_siPixelDigis", "adc", Mean); // sipixelActionExecutor_->createMaps(bei_, "charge_siPixelClusters", "charge", Mean); // sipixelActionExecutor_->createMaps(bei_, "ndigis_siPixelDigis", "ndigis", WeightedSum); // sipixelActionExecutor_->createMaps(bei_, "NErrors_siPixelDigis", "NErrors", WeightedSum); // cout << "*** Done with Tracker Map Histos for End Run ***" << endl; // On demand, dump module ID's and stuff on the screen: //sipixelActionExecutor_->dumpModIds(bei_,eSetup); // On demand, dump summary histo values for reference on the screen: //sipixelActionExecutor_->dumpRefValues(bei_,eSetup); } // cout<<"...leaving SiPixelEDAClient::endRun. "<<endl; }
void SiPixelEDAClient::publish | ( | xdata::InfoSpace * | ) | [inline, virtual] |
bool SiPixelEDAClient::actionOnLumiSec_ [private] |
Definition at line 70 of file SiPixelEDAClient.h.
Referenced by beginRun(), endLuminosityBlock(), and SiPixelEDAClient().
bool SiPixelEDAClient::actionOnRunEnd_ [private] |
Definition at line 71 of file SiPixelEDAClient.h.
Referenced by beginRun(), endRun(), and SiPixelEDAClient().
DQMStore* SiPixelEDAClient::bei_ [private] |
Definition at line 59 of file SiPixelEDAClient.h.
Referenced by beginLuminosityBlock(), beginRun(), endLuminosityBlock(), endRun(), and SiPixelEDAClient().
bool SiPixelEDAClient::doHitEfficiency_ [private] |
Definition at line 81 of file SiPixelEDAClient.h.
Referenced by beginRun(), endLuminosityBlock(), endRun(), and SiPixelEDAClient().
int SiPixelEDAClient::evtOffsetForInit_ [private] |
Definition at line 72 of file SiPixelEDAClient.h.
Referenced by beginRun(), and SiPixelEDAClient().
bool SiPixelEDAClient::firstRun [private] |
Definition at line 80 of file SiPixelEDAClient.h.
Referenced by beginJob(), and beginRun().
bool SiPixelEDAClient::hiRes_ [private] |
Definition at line 74 of file SiPixelEDAClient.h.
Referenced by beginRun(), and SiPixelEDAClient().
std::ostringstream SiPixelEDAClient::html_out_ [private] |
Definition at line 83 of file SiPixelEDAClient.h.
Referenced by defaultWebPage(), and SiPixelEDAClient().
unsigned long long SiPixelEDAClient::m_cacheID_ [private] |
Definition at line 53 of file SiPixelEDAClient.h.
int SiPixelEDAClient::nEvents_ [private] |
Definition at line 55 of file SiPixelEDAClient.h.
Referenced by analyze(), beginRun(), and defaultWebPage().
int SiPixelEDAClient::nEvents_lastLS_ [private] |
Definition at line 56 of file SiPixelEDAClient.h.
Referenced by beginLuminosityBlock(), and endLuminosityBlock().
int SiPixelEDAClient::nFEDs_ [private] |
Definition at line 78 of file SiPixelEDAClient.h.
Referenced by analyze(), beginRun(), endLuminosityBlock(), and endRun().
int SiPixelEDAClient::nLumiSecs_ [private] |
Definition at line 54 of file SiPixelEDAClient.h.
Referenced by beginRun(), endLuminosityBlock(), and endRun().
double SiPixelEDAClient::noiseRate_ [private] |
Definition at line 75 of file SiPixelEDAClient.h.
Referenced by beginRun(), endLuminosityBlock(), endRun(), and SiPixelEDAClient().
int SiPixelEDAClient::noiseRateDenominator_ [private] |
Definition at line 76 of file SiPixelEDAClient.h.
Referenced by endLuminosityBlock(), endRun(), and SiPixelEDAClient().
bool SiPixelEDAClient::offlineXMLfile_ [private] |
Definition at line 77 of file SiPixelEDAClient.h.
Referenced by SiPixelEDAClient().
Definition at line 64 of file SiPixelEDAClient.h.
Referenced by beginRun(), endLuminosityBlock(), endRun(), SiPixelEDAClient(), and ~SiPixelEDAClient().
Definition at line 63 of file SiPixelEDAClient.h.
Referenced by beginRun(), endLuminosityBlock(), endRun(), SiPixelEDAClient(), and ~SiPixelEDAClient().
Definition at line 62 of file SiPixelEDAClient.h.
Referenced by beginRun(), endLuminosityBlock(), endRun(), SiPixelEDAClient(), and ~SiPixelEDAClient().
Definition at line 61 of file SiPixelEDAClient.h.
Referenced by analyze(), beginRun(), defaultWebPage(), endLuminosityBlock(), endRun(), SiPixelEDAClient(), and ~SiPixelEDAClient().
unsigned int SiPixelEDAClient::staticUpdateFrequency_ [private] |
Definition at line 69 of file SiPixelEDAClient.h.
Referenced by SiPixelEDAClient().
int SiPixelEDAClient::summaryFrequency_ [private] |
Definition at line 68 of file SiPixelEDAClient.h.
Referenced by beginRun(), and SiPixelEDAClient().
std::string SiPixelEDAClient::summaryXMLfile_ [private] |
Definition at line 73 of file SiPixelEDAClient.h.
bool SiPixelEDAClient::Tier0Flag_ [private] |
Definition at line 79 of file SiPixelEDAClient.h.
Referenced by analyze(), beginRun(), endLuminosityBlock(), endRun(), and SiPixelEDAClient().
int SiPixelEDAClient::tkMapFrequency_ [private] |
Definition at line 67 of file SiPixelEDAClient.h.
Referenced by beginRun(), and SiPixelEDAClient().
Definition at line 65 of file SiPixelEDAClient.h.