#include <DQM/SiStripCommissioningClients/interface/CommissioningHistograms.h>
Public Types | |
typedef std::map< uint32_t, CommissioningAnalysis * > | Analyses |
typedef Analyses::iterator | Analysis |
typedef SummaryPlotFactory < CommissioningAnalysis * > | Factory |
typedef std::map< uint32_t, uint32_t > | FedToFecMap |
typedef std::vector< Histo * > | Histos |
typedef std::map< uint32_t, Histos > | HistosMap |
Public Member Functions | |
CommissioningHistograms () | |
CommissioningHistograms (DQMStore *const, const sistrip::RunType &) | |
CommissioningHistograms (DQMOldReceiver *const, const sistrip::RunType &) | |
virtual void | configure (const edm::ParameterSet &, const edm::EventSetup &) |
void | createCollations (const std::vector< std::string > &) |
virtual void | createSummaryHisto (const sistrip::Monitorable &, const sistrip::Presentation &, const std::string &top_level_dir, const sistrip::Granularity &) |
void | extractHistograms (const std::vector< std::string > &) |
virtual void | histoAnalysis (bool debug) |
virtual void | printAnalyses () |
virtual void | printSummary () |
void | remove (std::string pattern="") |
void | save (std::string &filename, uint32_t run_number=0) |
virtual | ~CommissioningHistograms () |
Static Public Member Functions | |
static void | copyCustomInformation (DQMStore *const, const std::vector< std::string > &) |
Extracts custom information from list of MonitorElements. | |
static void | getContents (DQMStore *const, std::vector< std::string > &) |
Retrieves list of histograms in form of strings. | |
static uint32_t | runNumber (DQMStore *const, const std::vector< std::string > &) |
static sistrip::RunType | runType (DQMStore *const, const std::vector< std::string > &) |
Extract run type string from "added contents". | |
Protected Member Functions | |
DQMStore *const | bei () const |
void | clearHistosMap () |
Analyses & | data () |
Factory *const | factory () |
TH1 * | histogram (const sistrip::Monitorable &, const sistrip::Presentation &, const sistrip::View &, const std::string &directory, const uint32_t &xbins, const float &xlow=1.*sistrip::invalid_, const float &xhigh=1.*sistrip::invalid_) |
const HistosMap & | histos () const |
const FedToFecMap & | mapping () const |
DQMOldReceiver *const | mui () const |
void | printHistosMap () |
const sistrip::RunType & | task () const |
Protected Attributes | |
std::auto_ptr< Factory > | factory_ |
Private Attributes | |
DQMStore * | bei_ |
Analyses | data_ |
HistosMap | histos_ |
FedToFecMap | mapping_ |
DQMOldReceiver * | mui_ |
sistrip::RunType | task_ |
Classes | |
class | Histo |
Definition at line 31 of file CommissioningHistograms.h.
typedef std::map<uint32_t,CommissioningAnalysis*> CommissioningHistograms::Analyses |
typedef Analyses::iterator CommissioningHistograms::Analysis |
Definition at line 79 of file CommissioningHistograms.h.
Reimplemented in DaqScopeModeHistograms, FedCablingHistograms, and FedTimingHistograms.
Definition at line 81 of file CommissioningHistograms.h.
typedef std::map<uint32_t,uint32_t> CommissioningHistograms::FedToFecMap |
Definition at line 87 of file CommissioningHistograms.h.
typedef std::vector<Histo*> CommissioningHistograms::Histos |
Definition at line 83 of file CommissioningHistograms.h.
typedef std::map<uint32_t,Histos> CommissioningHistograms::HistosMap |
Definition at line 85 of file CommissioningHistograms.h.
CommissioningHistograms::CommissioningHistograms | ( | DQMOldReceiver * const | mui, | |
const sistrip::RunType & | task | |||
) |
Definition at line 15 of file CommissioningHistograms.cc.
References bei_, clearHistosMap(), DQMOldReceiver::getBEInterface(), LogTrace, sistrip::mlDqmClient_, and mui_.
00017 : factory_(0), 00018 task_(task), 00019 mui_(mui), 00020 bei_(0), 00021 data_(), 00022 histos_() 00023 { 00024 LogTrace(mlDqmClient_) 00025 << "[" << __PRETTY_FUNCTION__ << "]" 00026 << " Constructing object..."; 00027 00028 // DQMOldReceiver 00029 if ( mui_ ) { bei_ = mui_->getBEInterface(); } 00030 else { 00031 edm::LogError(mlDqmClient_) 00032 << "[CommissioningHistograms::" << __func__ << "]" 00033 << " NULL pointer to DQMOldReceiver!"; 00034 } 00035 00036 // DQMStore 00037 if ( !bei_ ) { 00038 edm::LogError(mlDqmClient_) 00039 << "[CommissioningHistograms::" << __func__ << "]" 00040 << " NULL pointer to DQMStore!"; 00041 } 00042 00043 clearHistosMap(); 00044 }
CommissioningHistograms::CommissioningHistograms | ( | DQMStore * const | bei, | |
const sistrip::RunType & | task | |||
) |
Definition at line 48 of file CommissioningHistograms.cc.
References bei_, clearHistosMap(), LogTrace, and sistrip::mlDqmClient_.
00050 : factory_(0), 00051 task_(task), 00052 mui_(0), 00053 bei_(bei), 00054 data_(), 00055 histos_() 00056 { 00057 LogTrace(mlDqmClient_) 00058 << "[" << __PRETTY_FUNCTION__ << "]" 00059 << " Constructing object..."; 00060 00061 // DQMStore 00062 if ( !bei_ ) { 00063 edm::LogError(mlDqmClient_) 00064 << "[CommissioningHistograms::" << __func__ << "]" 00065 << " NULL pointer to DQMStore!"; 00066 } 00067 00068 clearHistosMap(); 00069 }
CommissioningHistograms::CommissioningHistograms | ( | ) |
Definition at line 73 of file CommissioningHistograms.cc.
References LogTrace, and sistrip::mlDqmClient_.
00074 : factory_(0), 00075 task_(sistrip::UNDEFINED_RUN_TYPE), 00076 mui_(0), 00077 bei_(0), 00078 data_(), 00079 histos_() 00080 { 00081 LogTrace(mlDqmClient_) 00082 << "[" << __PRETTY_FUNCTION__ << "]" 00083 << " Constructing object..."; 00084 }
CommissioningHistograms::~CommissioningHistograms | ( | ) | [virtual] |
Definition at line 88 of file CommissioningHistograms.cc.
References clearHistosMap(), LogTrace, and sistrip::mlDqmClient_.
00088 { 00089 LogTrace(mlDqmClient_) 00090 << "[" << __PRETTY_FUNCTION__ << "]" 00091 << " Destructing object..."; 00092 clearHistosMap(); 00093 //@@ do not delete MUI or BEI ptrs! 00094 }
DQMStore *const CommissioningHistograms::bei | ( | ) | const [inline, protected] |
Definition at line 182 of file CommissioningHistograms.h.
References task_.
Referenced by CalibrationHistograms::CalibrationHistograms(), and CalibrationHistosUsingDb::CalibrationHistosUsingDb().
00182 { return task_; }
void CommissioningHistograms::clearHistosMap | ( | ) | [protected] |
Definition at line 802 of file CommissioningHistograms.cc.
References histos_, LogTrace, and sistrip::mlDqmClient_.
Referenced by CommissioningHistograms(), and ~CommissioningHistograms().
00802 { 00803 LogTrace(mlDqmClient_) 00804 << "[CommissioningHistograms::" << __func__ << "]" 00805 << " Clearing histogram map..."; 00806 HistosMap::iterator ihistos = histos_.begin(); 00807 for ( ; ihistos != histos_.end(); ihistos++ ) { 00808 Histos::iterator ihisto = ihistos->second.begin(); 00809 for ( ; ihisto != ihistos->second.end(); ihisto++ ) { 00810 if ( *ihisto ) { delete *ihisto; } 00811 } 00812 ihistos->second.clear(); 00813 } 00814 histos_.clear(); 00815 }
virtual void CommissioningHistograms::configure | ( | const edm::ParameterSet & | , | |
const edm::EventSetup & | ||||
) | [inline, virtual] |
Reimplemented in SamplingHistograms, and FineDelayHistosUsingDb.
Definition at line 49 of file CommissioningHistograms.h.
Referenced by SiStripCommissioningOfflineDbClient::createHistos(), and SiStripCommissioningOfflineClient::createHistos().
void CommissioningHistograms::copyCustomInformation | ( | DQMStore * const | bei, | |
const std::vector< std::string > & | contents | |||
) | [static] |
Extracts custom information from list of MonitorElements.
Definition at line 322 of file CommissioningHistograms.cc.
References DQMStore::bookInt(), sistrip::dir_, MonitorElement::DQM_KIND_INT, DQMStore::get(), DQMStore::getContents(), sistrip::mlDqmClient_, path(), SiStripKey::path(), DQMStore::setCurrentFolder(), indexGen::title, and value.
Referenced by SiStripCommissioningOfflineClient::beginJob().
00323 { 00324 00325 // Check if histograms present 00326 if ( contents.empty() ) { 00327 edm::LogWarning(mlDqmClient_) 00328 << "[CommissioningHistograms::" << __func__ << "]" 00329 << " Found no histograms!"; 00330 return; 00331 } 00332 00333 // Iterate through added contents 00334 std::vector<std::string>::const_iterator istr = contents.begin(); 00335 while ( istr != contents.end() ) { 00336 00337 // Extract source directory path 00338 std::string source_dir = istr->substr( 0, istr->find(":") ); 00339 00340 // Generate corresponding client path (removing trailing "/") 00341 SiStripFecKey path( source_dir ); 00342 std::string client_dir = path.path(); 00343 std::string slash = client_dir.substr( client_dir.size()-1, 1 ); 00344 if ( slash == sistrip::dir_ ) { client_dir = client_dir.substr( 0, client_dir.size()-1 ); } 00345 00346 // Iterate though MonitorElements from source directory 00347 std::vector<MonitorElement*> me_list = bei->getContents( source_dir ); 00348 std::vector<MonitorElement*>::iterator ime = me_list.begin(); 00349 for ( ; ime != me_list.end(); ime++ ) { 00350 00351 if ( !(*ime) ) { 00352 edm::LogWarning(mlDqmClient_) 00353 << "[CommissioningHistograms::" << __func__ << "]" 00354 << " NULL pointer to MonitorElement!"; 00355 continue; 00356 } 00357 // Search for calchan, isha or vfs 00358 if((*ime)->kind()==MonitorElement::DQM_KIND_INT) { 00359 std::string title = (*ime)->getName(); 00360 std::string::size_type pos = title.find("calchan"); 00361 if( pos == std::string::npos ) pos = title.find("isha"); 00362 if( pos == std::string::npos ) pos = title.find("vfs"); 00363 if( pos != std::string::npos ) { 00364 int value = (*ime)->getIntValue(); 00365 if ( value>=0 ) { 00366 edm::LogVerbatim(mlDqmClient_) 00367 << "[CommissioningHistograms::" << __func__ << "]" 00368 << " Found \"" << title.substr(pos,std::string::npos) 00369 << "\" with value \"" << value << "\""; 00370 if ( !(bei->get(client_dir+"/"+title.substr(pos,std::string::npos))) ) { 00371 bei->setCurrentFolder(client_dir); 00372 bei->bookInt( title.substr(pos,std::string::npos))->Fill(value); 00373 edm::LogVerbatim(mlDqmClient_) 00374 << "[CommissioningHistograms::" << __func__ << "]" 00375 << " Booked \"" << title.substr(pos,std::string::npos) 00376 << "\" in directory \"" << client_dir << "\""; 00377 } 00378 } 00379 } 00380 } 00381 } 00382 istr++; 00383 } 00384 }
void CommissioningHistograms::createCollations | ( | const std::vector< std::string > & | contents | ) |
Definition at line 546 of file CommissioningHistograms.cc.
References sistrip::APV, bei_, SiStripHistoTitle::channel(), CommissioningHistograms::Histo::cme_, sistrip::collate_, sistrip::CONTROL_VIEW, sistrip::dir_, extract(), sistrip::FEC_SYSTEM, sistrip::FED_SYSTEM, DQMStore::get(), DQMStore::getMEs(), SiStripHistoTitle::granularity(), SiStripKey::granularity(), histo, histos_, sistrip::invalid32_, sistrip::invalid_, getDQMSummary::key, SiStripKey::key(), SiStripHistoTitle::keyValue(), SiStripFecKey::lldChan(), LogTrace, mapping_, me, CommissioningHistograms::Histo::me_, sistrip::mlDqmClient_, mui_, path(), DQMStore::pwd(), sistrip::READOUT_VIEW, edm::second(), DQMStore::setCurrentFolder(), pyDBSRunClass::temp, indexGen::title, CommissioningHistograms::Histo::title_, sistrip::UNDEFINED_GRAN, sistrip::undefinedView_, sistrip::UNKNOWN_GRAN, and SiStripEnumsAndStrings::view().
Referenced by SiStripCommissioningOfflineClient::beginJob().
00546 { 00547 00548 #ifndef USING_NEW_COLLATE_METHODS 00549 00550 LogTrace(mlDqmClient_) 00551 << "[CommissioningHistograms::" << __func__ << "]" 00552 << " Creating collated histograms..."; 00553 00554 // Check pointer 00555 if ( !mui_ ) { 00556 edm::LogError(mlDqmClient_) 00557 << "[CommissioningHistograms::" << __func__ << "]" 00558 << " NULL pointer to DQMOldReceiver!"; 00559 return; 00560 } 00561 00562 // Check list of histograms 00563 if ( contents.empty() ) { return; } 00564 00565 // Iterate through list of histograms 00566 std::vector<std::string>::const_iterator idir; 00567 for ( idir = contents.begin(); idir != contents.end(); idir++ ) { 00568 00569 // Ignore directories on client side 00570 //if ( idir->find(sistrip::collate_) != std::string::npos ) { continue; } 00571 00572 // Extract source directory path 00573 std::string source_dir = idir->substr( 0, idir->find(":") ); 00574 00575 // Extract view and create key 00576 sistrip::View view = SiStripEnumsAndStrings::view( source_dir ); 00577 SiStripKey path; 00578 if ( view == sistrip::CONTROL_VIEW ) { path = SiStripFecKey( source_dir ); } 00579 else if ( view == sistrip::READOUT_VIEW ) { path = SiStripFedKey( source_dir ); } 00580 else { path = SiStripKey(); } 00581 00582 // Check path is valid 00583 if ( path.granularity() == sistrip::FEC_SYSTEM || 00584 path.granularity() == sistrip::FED_SYSTEM || 00585 path.granularity() == sistrip::UNKNOWN_GRAN || 00586 path.granularity() == sistrip::UNDEFINED_GRAN ) { 00587 continue; 00588 } 00589 00590 // Generate corresponding client path (removing trailing "/") 00591 std::string client_dir(sistrip::undefinedView_); 00592 if ( view == sistrip::CONTROL_VIEW ) { client_dir = SiStripFecKey( path.key() ).path(); } 00593 else if ( view == sistrip::READOUT_VIEW ) { client_dir = SiStripFedKey( path.key() ).path(); } 00594 else { client_dir = SiStripKey( path.key() ).path(); } 00595 std::string slash = client_dir.substr( client_dir.size()-1, 1 ); 00596 if ( slash == sistrip::dir_ ) { client_dir = client_dir.substr( 0, client_dir.size()-1 ); } 00597 client_dir = sistrip::collate_ + sistrip::dir_ + client_dir; 00598 00599 // Retrieve MonitorElements from pwd directory 00600 bei_->setCurrentFolder( source_dir ); 00601 std::vector<std::string> me_list = bei_->getMEs(); 00602 00603 // Iterate through MonitorElements and create CMEs 00604 std::vector<std::string>::iterator ime = me_list.begin(); 00605 for ( ; ime != me_list.end(); ime++ ) { 00606 00607 // Retrieve histogram title 00608 SiStripHistoTitle title( *ime ); 00609 00610 // Check histogram type 00611 //if ( title.histoType() != sistrip::EXPERT_HISTO ) { continue; } 00612 00613 // Check granularity 00614 uint16_t channel = sistrip::invalid_; 00615 if ( title.granularity() == sistrip::APV ) { 00616 channel = SiStripFecKey::lldChan( title.channel() ); 00617 } else if ( title.granularity() == sistrip::UNKNOWN_GRAN || 00618 title.granularity() == sistrip::UNDEFINED_GRAN ) { 00619 edm::LogError(mlDqmClient_) 00620 << "[CommissioningHistograms::" << __func__ << "]" 00621 << " Unexpected granularity for histogram title: " 00622 << title << " found in path " << path; 00623 } else { 00624 channel = title.channel(); 00625 } 00626 00627 // Build key 00628 uint32_t key = sistrip::invalid32_; 00629 00630 if ( view == sistrip::CONTROL_VIEW ) { 00631 00632 // for all runs except cabling 00633 SiStripFecKey temp( path.key() ); 00634 key = SiStripFecKey( temp.fecCrate(), 00635 temp.fecSlot(), 00636 temp.fecRing(), 00637 temp.ccuAddr(), 00638 temp.ccuChan(), 00639 channel ).key(); 00640 mapping_[title.keyValue()] = key; 00641 00642 } else if ( view == sistrip::READOUT_VIEW ) { 00643 00644 // for cabling run 00645 key = SiStripFedKey( path.key() ).key(); 00646 uint32_t temp = SiStripFecKey( sistrip::invalid_, 00647 sistrip::invalid_, 00648 sistrip::invalid_, 00649 sistrip::invalid_, 00650 sistrip::invalid_, 00651 channel ).key(); // just record lld channel 00652 mapping_[title.keyValue()] = temp; 00653 00654 } else { key = SiStripKey( path.key() ).key(); } 00655 00656 // Find CME in histos map 00657 Histo* histo = 0; 00658 HistosMap::iterator ihistos = histos_.find( key ); 00659 if ( ihistos != histos_.end() ) { 00660 Histos::iterator ihis = ihistos->second.begin(); 00661 while ( !histo && ihis < ihistos->second.end() ) { 00662 if ( (*ime) == (*ihis)->title_ ) { histo = *ihis; } 00663 ihis++; 00664 } 00665 } 00666 00667 // Create CollateME if it doesn't exist 00668 if ( !histo ) { 00669 00670 // Retrieve ME pointer 00671 MonitorElement* me = bei_->get( bei_->pwd()+"/"+(*ime) ); 00672 00673 // Check if profile or 1D 00674 TProfile* prof = ExtractTObject<TProfile>().extract( me ); 00675 TH1F* his = ExtractTObject<TH1F>().extract( me ); 00676 00677 // Create CollateME and extract pointer to ME 00678 if ( prof || his ) { 00679 histos_[key].push_back( new Histo() ); 00680 histo = histos_[key].back(); 00681 histo->title_ = *ime; 00682 if ( prof ) { 00683 prof->SetErrorOption("s"); //@@ necessary? 00684 histo->cme_ = mui_->collateProf( (*ime), (*ime), client_dir ); 00685 } else if ( his ) { 00686 histo->cme_ = mui_->collate1D( (*ime), (*ime), client_dir ); 00687 } 00688 if ( histo->cme_ ) { 00689 mui_->add( histo->cme_, bei_->pwd()+"/"+(*ime) ); 00690 histo->me_ = histo->cme_->getMonitorElement(); 00691 } 00692 } 00693 00694 } 00695 00696 // Add to CollateME if found in histos map 00697 HistosMap::iterator jhistos = histos_.find( key ); 00698 if ( jhistos != histos_.end() ) { 00699 Histos::iterator ihis = jhistos->second.begin(); 00700 while ( ihis < jhistos->second.end() ) { 00701 if ( (*ime) == (*ihis)->title_ ) { 00702 if ( (*ihis)->cme_ ) { 00703 mui_->add( (*ihis)->cme_, bei_->pwd()+"/"+(*ime) ); 00704 } 00705 break; 00706 } 00707 ihis++; 00708 } 00709 } 00710 00711 } 00712 } 00713 00714 //printHistosMap(); 00715 00716 edm::LogVerbatim(mlDqmClient_) 00717 << "[CommissioningHistograms::" << __func__ << "]" 00718 << " Found histograms for " << histos_.size() 00719 << " structures in cached histogram map!"; 00720 00721 #endif 00722 00723 }
void CommissioningHistograms::createSummaryHisto | ( | const sistrip::Monitorable & | mon, | |
const sistrip::Presentation & | pres, | |||
const std::string & | top_level_dir, | |||
const sistrip::Granularity & | gran | |||
) | [virtual] |
Reimplemented in DaqScopeModeHistograms, FedCablingHistograms, and FedTimingHistograms.
Definition at line 819 of file CommissioningHistograms.cc.
References data(), empty, factory(), sistrip::FED_ADC_RANGE, SummaryPlotFactory< CommissioningAnalysis * >::fill(), sistrip::HISTO_1D, histoAnalysis(), histogram(), SummaryPlotFactory< CommissioningAnalysis * >::init(), LogTrace, sistrip::mlDqmClient_, summary, sistrip::UNKNOWN_VIEW, and SiStripEnumsAndStrings::view().
Referenced by SiStripCommissioningOfflineClient::beginJob().
00822 { 00823 LogTrace(mlDqmClient_) 00824 << "[CommissioningHistograms::" << __func__ << "]"; 00825 00826 // Check view 00827 sistrip::View view = SiStripEnumsAndStrings::view(dir); 00828 if ( view == sistrip::UNKNOWN_VIEW ) { return; } 00829 00830 // Analyze histograms 00831 if ( data().empty() ) { histoAnalysis( false ); } 00832 00833 // Check 00834 if ( data().empty() ) { 00835 edm::LogError(mlDqmClient_) 00836 << "[CommissioningHistograms::" << __func__ << "]" 00837 << " No analyses generated!"; 00838 return; 00839 } 00840 00841 // Extract data to be histogrammed 00842 uint32_t xbins = factory()->init( mon, pres, view, dir, gran, data() ); 00843 00844 // Only create histograms if entries are found! 00845 if ( !xbins ) { return; } 00846 00847 // Create summary histogram (if it doesn't already exist) 00848 TH1* summary = 0; 00849 if ( pres != sistrip::HISTO_1D ) { summary = histogram( mon, pres, view, dir, xbins ); } 00850 else { summary = histogram( mon, pres, view, dir, sistrip::FED_ADC_RANGE, 0., sistrip::FED_ADC_RANGE*1. ); } 00851 00852 // Fill histogram with data 00853 factory()->fill( *summary ); 00854 00855 }
CommissioningHistograms::Analyses & CommissioningHistograms::data | ( | ) | [inline, protected] |
Definition at line 183 of file CommissioningHistograms.h.
References mui_.
Referenced by FastFedCablingHistosUsingDb::addDcuDetIds(), CommissioningHistosUsingDb::addDcuDetIds(), FineDelayHistosUsingDb::computeDelays(), FastFedCablingHistosUsingDb::connections(), CommissioningHistosUsingDb::createAnalyses(), createSummaryHisto(), SamplingHistograms::histoAnalysis(), NoiseHistograms::histoAnalysis(), ApvTimingHistograms::histoAnalysis(), OptoScanHistograms::histoAnalysis(), CalibrationHistograms::histoAnalysis(), PedsOnlyHistograms::histoAnalysis(), PedestalsHistograms::histoAnalysis(), VpspScanHistograms::histoAnalysis(), FastFedCablingHistograms::histoAnalysis(), VpspScanHistograms::printAnalyses(), PedsOnlyHistograms::printAnalyses(), printAnalyses(), NoiseHistograms::printAnalyses(), PedestalsHistograms::printAnalyses(), OptoScanHistograms::printAnalyses(), FastFedCablingHistograms::printAnalyses(), CalibrationHistograms::printAnalyses(), FastFedCablingHistograms::printSummary(), printSummary(), FastFedCablingHistosUsingDb::update(), NoiseHistosUsingDb::update(), OptoScanHistosUsingDb::update(), PedsOnlyHistosUsingDb::update(), PedestalsHistosUsingDb::update(), LatencyHistosUsingDb::update(), ApvTimingHistosUsingDb::update(), and VpspScanHistosUsingDb::update().
00183 { return mui_; }
void CommissioningHistograms::extractHistograms | ( | const std::vector< std::string > & | contents | ) |
Definition at line 389 of file CommissioningHistograms.cc.
References sistrip::APV, bei_, sistrip::collate_, sistrip::CONTROL_VIEW, sistrip::dir_, lat::endl(), DQMStore::get(), DQMStore::getContents(), SiStripKey::granularity(), histo, histos_, sistrip::invalid32_, sistrip::invalid_, getDQMSummary::key, SiStripKey::key(), SiStripFecKey::lldChan(), LogTrace, mapping_, CommissioningHistograms::Histo::me_, sistrip::mlDqmClient_, path(), sistrip::READOUT_VIEW, edm::second(), ss, pyDBSRunClass::temp, indexGen::title, CommissioningHistograms::Histo::title_, sistrip::UNDEFINED_GRAN, sistrip::undefinedView_, sistrip::UNKNOWN_GRAN, and SiStripEnumsAndStrings::view().
Referenced by SiStripCommissioningOfflineClient::beginJob().
00389 { 00390 LogTrace(mlDqmClient_) 00391 << "[CommissioningHistograms::" << __func__ << "]" 00392 << " Extracting available histograms..."; 00393 00394 // Check pointer 00395 if ( !bei_ ) { 00396 edm::LogError(mlDqmClient_) 00397 << "[CommissioningHistograms::" << __func__ << "]" 00398 << " NULL pointer to DQMStore!"; 00399 return; 00400 } 00401 00402 // Check list of histograms 00403 if ( contents.empty() ) { 00404 edm::LogError(mlDqmClient_) 00405 << "[CommissioningHistograms::" << __func__ << "]" 00406 << " Empty contents vector!"; 00407 return; 00408 } 00409 00410 // Iterate through list of histograms 00411 std::vector<std::string>::const_iterator idir; 00412 for ( idir = contents.begin(); idir != contents.end(); idir++ ) { 00413 00414 // Ignore "DQM source" directories if looking in client file 00415 if ( idir->find(sistrip::collate_) == std::string::npos ) { continue; } 00416 00417 // Extract source directory path 00418 std::string source_dir = idir->substr( 0, idir->find(":") ); 00419 00420 // Extract view and create key 00421 sistrip::View view = SiStripEnumsAndStrings::view( source_dir ); 00422 SiStripKey path; 00423 if ( view == sistrip::CONTROL_VIEW ) { path = SiStripFecKey( source_dir ); } 00424 else if ( view == sistrip::READOUT_VIEW ) { path = SiStripFedKey( source_dir ); } 00425 else { path = SiStripKey(); } 00426 00427 // Check path is valid 00428 if ( path.granularity() == sistrip::UNKNOWN_GRAN || 00429 path.granularity() == sistrip::UNDEFINED_GRAN ) { 00430 continue; 00431 } 00432 00433 // Generate corresponding client path (removing trailing "/") 00434 std::string client_dir(sistrip::undefinedView_); 00435 if ( view == sistrip::CONTROL_VIEW ) { client_dir = SiStripFecKey( path.key() ).path(); } 00436 else if ( view == sistrip::READOUT_VIEW ) { client_dir = SiStripFedKey( path.key() ).path(); } 00437 else { client_dir = SiStripKey( path.key() ).path(); } 00438 std::string slash = client_dir.substr( client_dir.size()-1, 1 ); 00439 if ( slash == sistrip::dir_ ) { client_dir = client_dir.substr( 0, client_dir.size()-1 ); } 00440 client_dir = sistrip::collate_ + sistrip::dir_ + client_dir; 00441 00442 // Retrieve MonitorElements from source directory 00443 std::vector<MonitorElement*> me_list = bei_->getContents( source_dir ); 00444 00445 // Iterate though MonitorElements and create CMEs 00446 std::vector<MonitorElement*>::iterator ime = me_list.begin(); 00447 for ( ; ime != me_list.end(); ime++ ) { 00448 00449 // Retrieve histogram title 00450 SiStripHistoTitle title( (*ime)->getName() ); 00451 00452 // Check histogram type 00453 //if ( title.histoType() != sistrip::EXPERT_HISTO ) { continue; } 00454 00455 // Check granularity 00456 uint16_t channel = sistrip::invalid_; 00457 if ( title.granularity() == sistrip::APV ) { 00458 channel = SiStripFecKey::lldChan( title.channel() ); 00459 } else if ( title.granularity() == sistrip::UNKNOWN_GRAN || 00460 title.granularity() == sistrip::UNDEFINED_GRAN ) { 00461 std::stringstream ss; 00462 ss << "[CommissioningHistograms::" << __func__ << "]" 00463 << " Unexpected granularity for histogram title: " 00464 << std::endl << title 00465 << " found in path " 00466 << std::endl << path; 00467 edm::LogError(mlDqmClient_) << ss.str(); 00468 } else { 00469 channel = title.channel(); 00470 } 00471 00472 // Build key 00473 uint32_t key = sistrip::invalid32_; 00474 00475 if ( view == sistrip::CONTROL_VIEW ) { 00476 00477 // for all runs except cabling 00478 SiStripFecKey temp( path.key() ); 00479 key = SiStripFecKey( temp.fecCrate(), 00480 temp.fecSlot(), 00481 temp.fecRing(), 00482 temp.ccuAddr(), 00483 temp.ccuChan(), 00484 channel ).key(); 00485 mapping_[title.keyValue()] = key; 00486 00487 } else if ( view == sistrip::READOUT_VIEW ) { 00488 00489 // for cabling run 00490 key = SiStripFedKey( path.key() ).key(); 00491 uint32_t temp = SiStripFecKey( sistrip::invalid_, 00492 sistrip::invalid_, 00493 sistrip::invalid_, 00494 sistrip::invalid_, 00495 sistrip::invalid_, 00496 channel ).key(); // just record lld channel 00497 mapping_[title.keyValue()] = temp; 00498 00499 } else { key = SiStripKey( path.key() ).key(); } 00500 00501 // Find CME in histos map 00502 Histo* histo = 0; 00503 HistosMap::iterator ihistos = histos_.find( key ); 00504 if ( ihistos != histos_.end() ) { 00505 Histos::iterator ihis = ihistos->second.begin(); 00506 while ( !histo && ihis < ihistos->second.end() ) { 00507 if ( (*ime)->getName() == (*ihis)->title_ ) { histo = *ihis; } 00508 ihis++; 00509 } 00510 } 00511 00512 // Create CollateME if it doesn't exist 00513 if ( !histo ) { 00514 00515 histos_[key].push_back( new Histo() ); 00516 histo = histos_[key].back(); 00517 histo->title_ = (*ime)->getName(); 00518 00519 // If histogram present in client directory, add to map 00520 if ( source_dir.find(sistrip::collate_) != std::string::npos ) { 00521 histo->me_ = bei_->get( client_dir +"/"+(*ime)->getName() ); 00522 if ( !histo->me_ ) { 00523 edm::LogError(mlDqmClient_) 00524 << "[CommissioningHistograms::" << __func__ << "]" 00525 << " NULL pointer to MonitorElement!"; 00526 } 00527 } 00528 00529 } 00530 00531 } 00532 00533 } 00534 00535 //printHistosMap(); 00536 00537 edm::LogVerbatim(mlDqmClient_) 00538 << "[CommissioningHistograms::" << __func__ << "]" 00539 << " Found histograms for " << histos_.size() 00540 << " structures in cached histogram map!"; 00541 00542 }
CommissioningHistograms::Factory *const CommissioningHistograms::factory | ( | ) | [inline, protected] |
Definition at line 184 of file CommissioningHistograms.h.
References bei_.
Referenced by createSummaryHisto().
00184 { return bei_; }
void CommissioningHistograms::getContents | ( | DQMStore * const | bei, | |
std::vector< std::string > & | contents | |||
) | [static] |
Retrieves list of histograms in form of strings.
Definition at line 272 of file CommissioningHistograms.cc.
References DQMStore::cd(), DQMStore::getAllContents(), iter, LogTrace, sistrip::mlDqmClient_, DQMStore::pwd(), and pyDBSRunClass::temp.
00273 { 00274 00275 #ifndef USING_NEW_COLLATE_METHODS 00276 00277 LogTrace(mlDqmClient_) 00278 << "[CommissioningHistograms::" << __func__ << "]" 00279 << " Building histogram list..."; 00280 00281 contents.clear(); 00282 00283 if ( !bei ) { 00284 edm::LogError(mlDqmClient_) 00285 << "[CommissioningHistograms::" << __func__ << "]" 00286 << " NULL pointer to DQMStore!"; 00287 } 00288 00289 bei->cd(); 00290 std::vector<MonitorElement*> mons; 00291 mons = bei->getAllContents( bei->pwd() ); 00292 std::vector<MonitorElement*>::const_iterator iter = mons.begin(); 00293 for ( ; iter != mons.end(); iter++ ) { 00294 std::vector<std::string>::iterator istr = contents.begin(); 00295 bool found = false; 00296 while ( !found && istr != contents.end() ) { 00297 if ( std::string((*iter)->getPathname()+"/:") == *istr ) { found = true; } 00298 istr++; 00299 } 00300 if ( istr == contents.end() ) { 00301 std::string temp = (*iter)->getPathname() + "/:"; // + (*iter)->getName(); 00302 contents.push_back( temp ); 00303 } 00304 } 00305 00306 LogTrace(mlDqmClient_) 00307 << "[CommissioningHistograms::" << __func__ << "]" 00308 << " Found " << contents.size() << " directories!"; 00309 00310 if ( contents.empty() ) { 00311 edm::LogError(mlDqmClient_) 00312 << "[CommissioningHistograms::" << __func__ << "]" 00313 << " No directories found when building list!"; 00314 } 00315 00316 #endif 00317 00318 }
Reimplemented in ApvTimingHistograms, CalibrationHistograms, DaqScopeModeHistograms, FastFedCablingHistograms, FedCablingHistograms, FedTimingHistograms, NoiseHistograms, OptoScanHistograms, PedestalsHistograms, PedsOnlyHistograms, SamplingHistograms, and VpspScanHistograms.
Definition at line 727 of file CommissioningHistograms.cc.
References LogTrace, and sistrip::mlDqmClient_.
Referenced by SiStripCommissioningOfflineClient::beginJob(), and createSummaryHisto().
00727 { 00728 LogTrace(mlDqmClient_) 00729 << "[CommissioningHistograms::" << __func__ << "]" 00730 << " (Derived) implementation to come..."; 00731 }
TH1 * CommissioningHistograms::histogram | ( | const sistrip::Monitorable & | mon, | |
const sistrip::Presentation & | pres, | |||
const sistrip::View & | view, | |||
const std::string & | directory, | |||
const uint32_t & | xbins, | |||
const float & | xlow = 1. * sistrip::invalid_ , |
|||
const float & | xhigh = 1. * sistrip::invalid_ | |||
) | [protected] |
Definition at line 978 of file CommissioningHistograms.cc.
References bei_, DQMStore::book1D(), DQMStore::book2D(), DQMStore::bookProfile(), sistrip::collate_, sistrip::dir_, extract(), sistrip::FED_ADC_RANGE, DQMStore::get(), DQMOldReceiver::getBEInterface(), MonitorElement::getName(), WenuSkim_TriggerBit_cff::high, sistrip::HISTO_1D, sistrip::HISTO_2D_SCATTER, sistrip::HISTO_2D_SUM, LogTrace, me, sistrip::mlDqmClient_, mui_, name, SummaryGenerator::name(), SiStripEnumsAndStrings::presentation(), sistrip::PROFILE_1D, DQMStore::pwd(), DQMStore::removeElement(), DQMStore::setCurrentFolder(), summary, task_, and sistrip::valid_.
Referenced by FedCablingHistograms::createSummaryHisto(), createSummaryHisto(), DaqScopeModeHistograms::createSummaryHisto(), and FedTimingHistograms::createSummaryHisto().
00984 { 00985 00986 // Remember pwd 00987 std::string pwd = bei_->pwd(); 00988 bei_->setCurrentFolder( sistrip::collate_ + sistrip::dir_ + directory ); 00989 00990 // Construct histogram name 00991 std::string name = SummaryGenerator::name( task_, mon, pres, view, directory ); 00992 00993 // Check if summary plot already exists and remove 00994 MonitorElement* me = bei_->get( bei_->pwd() + "/" + name ); 00995 if ( me ) { 00996 mui_->getBEInterface()->removeElement( name ); 00997 me = 0; 00998 } 00999 01000 // Create summary plot 01001 float high = static_cast<float>( xbins ); 01002 if ( pres == sistrip::HISTO_1D ) { 01003 if ( xlow < 1. * sistrip::valid_ && 01004 xhigh < 1. * sistrip::valid_ ) { 01005 me = mui_->getBEInterface()->book1D( name, name, xbins, xlow, xhigh ); 01006 } else { 01007 me = mui_->getBEInterface()->book1D( name, name, xbins, 0., high ); 01008 } 01009 } else if ( pres == sistrip::HISTO_2D_SUM ) { 01010 me = mui_->getBEInterface()->book1D( name, name, 01011 xbins, 0., high ); 01012 } else if ( pres == sistrip::HISTO_2D_SCATTER ) { 01013 me = mui_->getBEInterface()->book2D( name, name, xbins, 0., high, 01014 sistrip::FED_ADC_RANGE+1, 01015 0., 01016 sistrip::FED_ADC_RANGE*1. ); 01017 } else if ( pres == sistrip::PROFILE_1D ) { 01018 me = mui_->getBEInterface()->bookProfile( name, name, xbins, 0., high, 01019 sistrip::FED_ADC_RANGE+1, 01020 0., 01021 sistrip::FED_ADC_RANGE*1. ); 01022 } else { 01023 me = 0; 01024 edm::LogWarning(mlDqmClient_) 01025 << "[CommissioningHistograms::" << __func__ << "]" 01026 << " Unexpected presentation \"" 01027 << SiStripEnumsAndStrings::presentation( pres ) 01028 << "\" Unable to create summary plot!"; 01029 } 01030 01031 // Check pointer 01032 if ( me ) { 01033 LogTrace(mlDqmClient_) 01034 << "[CommissioningHistograms::" << __func__ << "]" 01035 << " Created summary plot with name \"" << me->getName() 01036 << "\" in directory \"" 01037 << bei_->pwd() << "\"!"; 01038 } else { 01039 edm::LogWarning(mlDqmClient_) 01040 << "[CommissioningHistograms::" << __func__ << "]" 01041 << " NULL pointer to MonitorElement!" 01042 << " Unable to create summary plot!"; 01043 } 01044 01045 // Extract root object 01046 TH1* summary = ExtractTObject<TH1>().extract( me ); 01047 if ( !summary ) { 01048 edm::LogWarning(mlDqmClient_) 01049 << "[CommissioningHistograms::" << __func__ << "]" 01050 << " Unable to extract root object!" 01051 << " Returning NULL pointer!"; 01052 } 01053 01054 // Return to pwd 01055 bei_->setCurrentFolder( pwd ); 01056 01057 return summary; 01058 01059 }
const CommissioningHistograms::HistosMap & CommissioningHistograms::histos | ( | ) | const [inline, protected] |
Definition at line 185 of file CommissioningHistograms.h.
References data_.
Referenced by FedCablingHistograms::histoAnalysis(), SamplingHistograms::histoAnalysis(), NoiseHistograms::histoAnalysis(), ApvTimingHistograms::histoAnalysis(), OptoScanHistograms::histoAnalysis(), CalibrationHistograms::histoAnalysis(), PedestalsHistograms::histoAnalysis(), PedsOnlyHistograms::histoAnalysis(), VpspScanHistograms::histoAnalysis(), and FastFedCablingHistograms::histoAnalysis().
00185 { return data_; }
const CommissioningHistograms::FedToFecMap & CommissioningHistograms::mapping | ( | ) | const [inline, protected] |
Definition at line 186 of file CommissioningHistograms.h.
References factory_.
Referenced by FastFedCablingHistograms::histoAnalysis().
00186 { return factory_.get(); }
DQMOldReceiver *const CommissioningHistograms::mui | ( | ) | const [inline, protected] |
Definition at line 181 of file CommissioningHistograms.h.
void CommissioningHistograms::printAnalyses | ( | ) | [virtual] |
Reimplemented in CalibrationHistograms, FastFedCablingHistograms, FedCablingHistograms, NoiseHistograms, OptoScanHistograms, PedestalsHistograms, PedsOnlyHistograms, and VpspScanHistograms.
Definition at line 735 of file CommissioningHistograms.cc.
References data(), LogTrace, sistrip::mlDqmClient_, and ss.
Referenced by SiStripCommissioningOfflineClient::beginJob().
00735 { 00736 Analyses::iterator ianal = data().begin(); 00737 Analyses::iterator janal = data().end(); 00738 for ( ; ianal != janal; ++ianal ) { 00739 if ( ianal->second ) { 00740 std::stringstream ss; 00741 ianal->second->print( ss ); 00742 if ( ianal->second->isValid() ) { LogTrace(mlDqmClient_) << ss.str(); 00743 } else { edm::LogWarning(mlDqmClient_) << ss.str(); } 00744 } 00745 } 00746 }
void CommissioningHistograms::printHistosMap | ( | ) | [protected] |
Definition at line 780 of file CommissioningHistograms.cc.
References lat::endl(), histos_, LogTrace, sistrip::mlDqmClient_, and ss.
00780 { 00781 LogTrace(mlDqmClient_) 00782 << "[CommissioningHistograms::" << __func__ << "]" 00783 << " Printing histogram map, which has " 00784 << histos_.size() << " entries..."; 00785 HistosMap::const_iterator ihistos = histos_.begin(); 00786 for ( ; ihistos != histos_.end(); ihistos++ ) { 00787 std::stringstream ss; 00788 ss << " Found " << ihistos->second.size() 00789 << " histogram(s) for key: " << std::endl 00790 << SiStripFedKey(ihistos->first) << std::endl; 00791 Histos::const_iterator ihisto = ihistos->second.begin(); 00792 for ( ; ihisto != ihistos->second.end(); ihisto++ ) { 00793 if ( *ihisto ) { (*ihisto)->print(ss); } 00794 else { ss << " NULL pointer to Histo object!"; } 00795 } 00796 LogTrace(mlDqmClient_) << ss.str(); 00797 } 00798 }
void CommissioningHistograms::printSummary | ( | ) | [virtual] |
Reimplemented in FastFedCablingHistograms.
Definition at line 750 of file CommissioningHistograms.cc.
References data(), LogTrace, and sistrip::mlDqmClient_.
Referenced by SiStripCommissioningOfflineClient::beginJob().
00750 { 00751 00752 std::stringstream good; 00753 std::stringstream bad; 00754 00755 Analyses::iterator ianal = data().begin(); 00756 Analyses::iterator janal = data().end(); 00757 for ( ; ianal != janal; ++ianal ) { 00758 if ( ianal->second ) { 00759 if ( ianal->second->isValid() ) { ianal->second->summary( good ); } 00760 else { ianal->second->summary( bad ); } 00761 } 00762 } 00763 00764 if ( good.str().empty() ) { good << "None found!"; } 00765 LogTrace(mlDqmClient_) 00766 << "[CommissioningHistograms::" << __func__ << "]" 00767 << " Printing summary of good analyses:" << "\n" 00768 << good.str(); 00769 00770 if ( bad.str().empty() ) { return; } //@@ bad << "None found!"; } 00771 LogTrace(mlDqmClient_) 00772 << "[CommissioningHistograms::" << __func__ << "]" 00773 << " Printing summary of bad analyses:" << "\n" 00774 << bad.str(); 00775 00776 }
void CommissioningHistograms::remove | ( | std::string | pattern = "" |
) |
Definition at line 859 of file CommissioningHistograms.cc.
References DQMStore::cd(), DQMStore::dirExists(), DQMOldReceiver::getBEInterface(), LogTrace, sistrip::mlDqmClient_, mui_, DQMStore::removeContents(), DQMStore::rmdir(), and DQMStore::setVerbose().
Referenced by SiStripCommissioningOfflineClient::beginJob().
00859 { 00860 00861 if ( !mui_ ) { 00862 edm::LogError(mlDqmClient_) 00863 << "[CommissioningHistograms::" << __func__ << "]" 00864 << " NULL pointer to DQMOldReceiver!"; 00865 return; 00866 } 00867 00868 if ( !mui_->getBEInterface() ) { 00869 edm::LogError(mlDqmClient_) 00870 << "[CommissioningHistograms::" << __func__ << "]" 00871 << " NULL pointer to DQMStore!"; 00872 return; 00873 } 00874 00875 mui_->getBEInterface()->setVerbose(0); 00876 00877 LogTrace(mlDqmClient_) 00878 << "[CommissioningHistograms::" << __func__ << "]" 00879 << " Removing histograms..."; 00880 00881 if ( !pattern.empty() ) { 00882 00883 if ( mui_->getBEInterface()->dirExists(pattern) ) { 00884 mui_->getBEInterface()->rmdir(pattern); 00885 } 00886 00887 LogTrace(mlDqmClient_) 00888 << "[CommissioningHistograms::" << __func__ << "]" 00889 << " Removing directories (and MonitorElements" 00890 << " therein) that match the pattern \"" 00891 << pattern << "\""; 00892 00893 } else { 00894 00895 mui_->getBEInterface()->cd(); 00896 mui_->getBEInterface()->removeContents(); 00897 00898 if( mui_->getBEInterface()->dirExists("Collector") ) { 00899 mui_->getBEInterface()->rmdir("Collector"); 00900 } 00901 if( mui_->getBEInterface()->dirExists("EvF") ) { 00902 mui_->getBEInterface()->rmdir("EvF"); 00903 } 00904 if( mui_->getBEInterface()->dirExists("SiStrip") ) { 00905 mui_->getBEInterface()->rmdir("SiStrip"); 00906 } 00907 00908 LogTrace(mlDqmClient_) 00909 << "[CommissioningHistograms::" << __func__ << "]" 00910 << " Removing \"DQM source\" directories (and MonitorElements therein)"; 00911 00912 } 00913 00914 LogTrace(mlDqmClient_) 00915 << "[CommissioningHistograms::" << __func__ << "]" 00916 << " Removed histograms!"; 00917 00918 mui_->getBEInterface()->setVerbose(1); 00919 00920 }
uint32_t CommissioningHistograms::runNumber | ( | DQMStore * const | bei, | |
const std::vector< std::string > & | contents | |||
) | [static] |
Definition at line 113 of file CommissioningHistograms.cc.
References DQMStore::bookString(), sistrip::collate_, sistrip::dir_, DQMStore::get(), DQMStore::getContents(), LogTrace, sistrip::mlDqmClient_, path(), SiStripKey::path(), mergeAndRegister_online::run, sistrip::runNumber_, DQMStore::setCurrentFolder(), size, ss, indexGen::title, and value.
Referenced by SiStripCommissioningOfflineClient::beginJob().
00114 { 00115 00116 // Check if histograms present 00117 if ( contents.empty() ) { 00118 edm::LogError(mlDqmClient_) 00119 << "[CommissioningHistograms::" << __func__ << "]" 00120 << " Found no histograms!"; 00121 return 0; 00122 } 00123 00124 // Iterate through added contents 00125 std::vector<std::string>::const_iterator istr = contents.begin(); 00126 while ( istr != contents.end() ) { 00127 00128 // Extract source directory path 00129 std::string source_dir = istr->substr( 0, istr->find(":") ); 00130 00131 // Generate corresponding client path (removing trailing "/") 00132 SiStripFecKey path( source_dir ); 00133 std::string client_dir = path.path(); 00134 std::string slash = client_dir.substr( client_dir.size()-1, 1 ); 00135 if ( slash == sistrip::dir_ ) { client_dir = client_dir.substr( 0, client_dir.size()-1 ); } 00136 client_dir = sistrip::collate_ + sistrip::dir_ + client_dir; 00137 00138 // Iterate though MonitorElements from source directory 00139 std::vector<MonitorElement*> me_list = bei->getContents( source_dir ); 00140 std::vector<MonitorElement*>::iterator ime = me_list.begin(); 00141 for ( ; ime != me_list.end(); ime++ ) { 00142 00143 if ( !(*ime) ) { 00144 edm::LogError(mlDqmClient_) 00145 << "[CommissioningHistograms::" << __func__ << "]" 00146 << " NULL pointer to MonitorElement!"; 00147 continue; 00148 } 00149 00150 // Search for run type in string 00151 std::string title = (*ime)->getName(); 00152 std::string::size_type pos = title.find( sistrip::runNumber_ ); 00153 00154 // Extract run number from string 00155 if ( pos != std::string::npos ) { 00156 std::string value = title.substr( pos+sistrip::runNumber_.size()+1, std::string::npos ); 00157 if ( !value.empty() ) { 00158 LogTrace(mlDqmClient_) 00159 << "[CommissioningHistograms::" << __func__ << "]" 00160 << " Found string \"" << title.substr(pos,std::string::npos) 00161 << "\" with value \"" << value << "\""; 00162 if ( !(bei->get(client_dir+"/"+title.substr(pos,std::string::npos))) ) { 00163 bei->setCurrentFolder(client_dir); 00164 bei->bookString( title.substr(pos,std::string::npos), value ); 00165 LogTrace(mlDqmClient_) 00166 << "[CommissioningHistograms::" << __func__ << "]" 00167 << " Booked string \"" << title.substr(pos,std::string::npos) 00168 << "\" in directory \"" << client_dir << "\""; 00169 } 00170 uint32_t run; 00171 std::stringstream ss; 00172 ss << value; 00173 ss >> std::dec >> run; 00174 return run; 00175 } 00176 } 00177 00178 } 00179 00180 istr++; 00181 00182 } 00183 return 0; 00184 }
sistrip::RunType CommissioningHistograms::runType | ( | DQMStore * const | bei, | |
const std::vector< std::string > & | contents | |||
) | [static] |
Extract run type string from "added contents".
Definition at line 188 of file CommissioningHistograms.cc.
References DQMStore::bookString(), sistrip::collate_, sistrip::dir_, DQMStore::get(), DQMStore::getContents(), LogTrace, sistrip::mlDqmClient_, path(), SiStripKey::path(), SiStripEnumsAndStrings::runType(), DQMStore::setCurrentFolder(), size, sistrip::taskId_, indexGen::title, sistrip::UNKNOWN_RUN_TYPE, and value.
Referenced by SiStripCommissioningOfflineClient::beginJob().
00189 { 00190 00191 // Check if histograms present 00192 if ( contents.empty() ) { 00193 edm::LogError(mlDqmClient_) 00194 << "[CommissioningHistograms::" << __func__ << "]" 00195 << " Found no histograms!"; 00196 return sistrip::UNKNOWN_RUN_TYPE; 00197 } 00198 00199 // Iterate through added contents 00200 std::vector<std::string>::const_iterator istr = contents.begin(); 00201 while ( istr != contents.end() ) { 00202 00203 // Extract source directory path 00204 std::string source_dir = istr->substr( 0, istr->find(":") ); 00205 00206 // Generate corresponding client path (removing trailing "/") 00207 SiStripFecKey path( source_dir ); 00208 std::string client_dir = path.path(); 00209 std::string slash = client_dir.substr( client_dir.size()-1, 1 ); 00210 if ( slash == sistrip::dir_ ) { client_dir = client_dir.substr( 0, client_dir.size()-1 ); } 00211 client_dir = sistrip::collate_ + sistrip::dir_ + client_dir; 00212 00213 // Iterate though MonitorElements from source directory 00214 std::vector<MonitorElement*> me_list = bei->getContents( source_dir ); 00215 00216 if ( me_list.empty() ) { 00217 edm::LogError(mlDqmClient_) 00218 << "[CommissioningHistograms::" << __func__ << "]" 00219 << " No MonitorElements found in dir " << source_dir; 00220 return sistrip::UNKNOWN_RUN_TYPE; 00221 } 00222 00223 std::vector<MonitorElement*>::iterator ime = me_list.begin(); 00224 for ( ; ime != me_list.end(); ime++ ) { 00225 00226 if ( !(*ime) ) { 00227 edm::LogError(mlDqmClient_) 00228 << "[CommissioningHistograms::" << __func__ << "]" 00229 << " NULL pointer to MonitorElement!"; 00230 continue; 00231 } 00232 00233 // Search for run type in string 00234 std::string title = (*ime)->getName(); 00235 std::string::size_type pos = title.find( sistrip::taskId_ ); 00236 00237 // Extract commissioning task from string 00238 if ( pos != std::string::npos ) { 00239 std::string value = title.substr( pos+sistrip::taskId_.size()+1, std::string::npos ); 00240 if ( !value.empty() ) { 00241 LogTrace(mlDqmClient_) 00242 << "[CommissioningHistograms::" << __func__ << "]" 00243 << " Found string \"" << title.substr(pos,std::string::npos) 00244 << "\" with value \"" << value << "\""; 00245 if ( !(bei->get(client_dir+sistrip::dir_+title.substr(pos,std::string::npos))) ) { 00246 bei->setCurrentFolder(client_dir); 00247 bei->bookString( title.substr(pos,std::string::npos), value ); 00248 LogTrace(mlDqmClient_) 00249 << "[CommissioningHistograms::" << __func__ << "]" 00250 << " Booked string \"" << title.substr(pos,std::string::npos) 00251 << "\" in directory \"" << client_dir << "\""; 00252 } 00253 return SiStripEnumsAndStrings::runType( value ); 00254 } 00255 } 00256 00257 } 00258 00259 istr++; 00260 00261 } 00262 00263 edm::LogError(mlDqmClient_) 00264 << "[CommissioningHistograms::" << __func__ << "]" 00265 << " Unable to extract RunType!"; 00266 return sistrip::UNKNOWN_RUN_TYPE; 00267 00268 }
void CommissioningHistograms::save | ( | std::string & | filename, | |
uint32_t | run_number = 0 | |||
) |
Definition at line 924 of file CommissioningHistograms.cc.
References bei_, sistrip::collate_, dir, sistrip::dqmClientFileName_, LogTrace, sistrip::mlDqmClient_, mui_, NULL, DQMStore::save(), and ss.
Referenced by SiStripCommissioningOfflineClient::beginJob().
00925 { 00926 00927 if ( !mui_ ) { 00928 edm::LogError(mlDqmClient_) 00929 << "[CommissioningHistograms::" << __func__ << "]" 00930 << " NULL pointer to DQMOldReceiver!"; 00931 return; 00932 } 00933 00934 // Construct path and filename 00935 std::stringstream ss; 00936 00937 if ( !path.empty() ) { 00938 00939 ss << path; 00940 if ( ss.str().find(".root") == std::string::npos ) { ss << ".root"; } 00941 00942 } else { 00943 00944 // Retrieve SCRATCH directory 00945 std::string scratch = "SCRATCH"; 00946 std::string dir = ""; 00947 if ( getenv(scratch.c_str()) != NULL ) { 00948 dir = getenv(scratch.c_str()); 00949 } 00950 00951 // Add directory path 00952 if ( !dir.empty() ) { ss << dir << "/"; } 00953 else { ss << "/tmp/"; } 00954 00955 // Add filename with run number and ".root" extension 00956 ss << sistrip::dqmClientFileName_ << "_" 00957 << std::setfill('0') << std::setw(8) << run_number 00958 << ".root"; 00959 00960 } 00961 00962 // Save file with appropriate filename 00963 LogTrace(mlDqmClient_) 00964 << "[CommissioningHistograms::" << __func__ << "]" 00965 << " Saving histograms to root file" 00966 << " (This may take some time!)"; 00967 path = ss.str(); 00968 bei_->save( path, sistrip::collate_ ); 00969 edm::LogVerbatim(mlDqmClient_) 00970 << "[CommissioningHistograms::" << __func__ << "]" 00971 << " Saved histograms to root file \"" 00972 << ss.str() << "\"!"; 00973 00974 }
const sistrip::RunType & CommissioningHistograms::task | ( | ) | const [inline, protected] |
Definition at line 180 of file CommissioningHistograms.h.
Referenced by CalibrationHistograms::histoAnalysis().
DQMStore* CommissioningHistograms::bei_ [private] |
Definition at line 168 of file CommissioningHistograms.h.
Referenced by CommissioningHistograms(), createCollations(), extractHistograms(), factory(), histogram(), and save().
Analyses CommissioningHistograms::data_ [private] |
Reimplemented in DaqScopeModeHistograms, FedCablingHistograms, and FedTimingHistograms.
Definition at line 170 of file CommissioningHistograms.h.
Referenced by histos().
std::auto_ptr<Factory> CommissioningHistograms::factory_ [protected] |
Reimplemented in DaqScopeModeHistograms, FedCablingHistograms, and FedTimingHistograms.
Definition at line 160 of file CommissioningHistograms.h.
Referenced by ApvTimingHistograms::ApvTimingHistograms(), CalibrationHistograms::CalibrationHistograms(), FastFedCablingHistograms::FastFedCablingHistograms(), mapping(), NoiseHistograms::NoiseHistograms(), OptoScanHistograms::OptoScanHistograms(), PedestalsHistograms::PedestalsHistograms(), PedsOnlyHistograms::PedsOnlyHistograms(), SamplingHistograms::SamplingHistograms(), and VpspScanHistograms::VpspScanHistograms().
HistosMap CommissioningHistograms::histos_ [private] |
Definition at line 172 of file CommissioningHistograms.h.
Referenced by clearHistosMap(), createCollations(), extractHistograms(), and printHistosMap().
FedToFecMap CommissioningHistograms::mapping_ [private] |
Definition at line 174 of file CommissioningHistograms.h.
Referenced by createCollations(), and extractHistograms().
DQMOldReceiver* CommissioningHistograms::mui_ [private] |
Definition at line 166 of file CommissioningHistograms.h.
Referenced by CommissioningHistograms(), createCollations(), data(), histogram(), remove(), and save().