#include <DQM/SiStripCommissioningSummary/interface/SummaryGeneratorControlView.h>
Public Member Functions | |
void | fill (const std::string &directory_level, const sistrip::Granularity &, const uint32_t &key, const float &value, const float &error) |
Fills the map used to generate the histogram. | |
SummaryGeneratorControlView () | |
virtual | ~SummaryGeneratorControlView () |
Fills "summary histograms" in FEC or "control" view.
Definition at line 12 of file SummaryGeneratorControlView.h.
SummaryGeneratorControlView::SummaryGeneratorControlView | ( | ) |
Definition at line 15 of file SummaryGeneratorControlView.cc.
00015 : 00016 SummaryGenerator("SummaryGeneratorControlView") {;}
virtual SummaryGeneratorControlView::~SummaryGeneratorControlView | ( | ) | [inline, virtual] |
void SummaryGeneratorControlView::fill | ( | const std::string & | top_level_dir, | |
const sistrip::Granularity & | gran, | |||
const uint32_t & | key, | |||
const float & | value, | |||
const float & | error | |||
) | [virtual] |
Fills the map used to generate the histogram.
Reimplemented from SummaryGenerator.
Definition at line 20 of file SummaryGeneratorControlView.cc.
References sistrip::APV, sistrip::CCU_ADDR, sistrip::CCU_CHAN, SiStripFecKey::ccuAddr(), SiStripFecKey::ccuChan(), SiStripKey::channel(), sistrip::dir_, sistrip::dot_, SummaryGenerator::entries_, sistrip::FEC_CRATE, sistrip::FEC_RING, sistrip::FEC_SLOT, SiStripFecKey::fecCrate(), SiStripFecKey::fecRing(), SiStripFecKey::fecSlot(), SiStripEnumsAndStrings::granularity(), sistrip::invalid_, SiStripFecKey::isValid(), sistrip::LLD_CHAN, SummaryGenerator::map_, sistrip::mlSummaryPlots_, path(), SiStripKey::path(), pyDBSRunClass::temp, sistrip::UNDEFINED_GRAN, and sistrip::UNKNOWN_GRAN.
00024 { 00025 00026 // Check granularity is recognised 00027 std::string gran = SiStripEnumsAndStrings::granularity( granularity ); 00028 00029 if ( granularity != sistrip::UNDEFINED_GRAN && 00030 granularity != sistrip::FEC_CRATE && 00031 granularity != sistrip::FEC_SLOT && 00032 granularity != sistrip::FEC_RING && 00033 granularity != sistrip::CCU_ADDR && 00034 granularity != sistrip::CCU_CHAN && 00035 granularity != sistrip::LLD_CHAN && 00036 granularity != sistrip::APV ) { 00037 std::string temp = SiStripEnumsAndStrings::granularity( sistrip::LLD_CHAN ); 00038 edm::LogWarning(mlSummaryPlots_) 00039 << "[SummaryGeneratorControlView::" << __func__ << "]" 00040 << " Unexpected granularity requested: " << gran; 00041 return; 00042 } 00043 00044 // Create key representing "top level" directory 00045 SiStripFecKey top( top_level_dir ); 00046 00047 // Path and std::string for "present working directory" as defined by device key 00048 SiStripFecKey path( device_key ); 00049 std::string pwd = path.path(); 00050 00051 // LogTrace(mlTest_) 00052 // << "TEST " 00053 // << "top " << top 00054 // << "path " << path; 00055 00056 if ( top.isValid() && 00057 path.isValid() && 00058 ( path.fecCrate() == top.fecCrate() || !top.fecCrate() ) && 00059 ( path.fecSlot() == top.fecSlot() || !top.fecSlot() ) && 00060 ( path.fecRing() == top.fecRing() || !top.fecRing() ) && 00061 ( path.ccuAddr() == top.ccuAddr() || !top.ccuAddr() ) && 00062 ( path.ccuChan() == top.ccuChan() || !top.ccuChan() ) ) { 00063 00064 // Extract path and std::string corresponding to "top-level down to granularity" 00065 std::string sub_dir = pwd; 00066 uint32_t pos = pwd.find( gran ); 00067 if ( pos != std::string::npos ) { 00068 sub_dir = pwd.substr( 0, pwd.find(sistrip::dir_,pos) ); 00069 } else if ( granularity == sistrip::UNKNOWN_GRAN ) { 00070 sub_dir = pwd; 00071 } 00072 00073 SiStripFecKey sub_path( sub_dir ); 00074 00075 // LogTrace(mlTest_) 00076 // << "TEST " 00077 // << "sub_path " << sub_path; 00078 00079 // Construct bin label 00080 std::stringstream bin; 00081 if ( sub_path.fecCrate() != sistrip::invalid_ ) { bin << std::setw(1) << std::setfill('0') << sub_path.fecCrate(); } 00082 if ( sub_path.fecSlot() != sistrip::invalid_ ) { bin << sistrip::dot_ << std::setw(2) << std::setfill('0') << sub_path.fecSlot(); } 00083 if ( sub_path.fecRing() != sistrip::invalid_ ) { bin << sistrip::dot_ << std::setw(1) << std::setfill('0') << sub_path.fecRing(); } 00084 if ( sub_path.ccuAddr() != sistrip::invalid_ ) { bin << sistrip::dot_ << std::setw(3) << std::setfill('0') << sub_path.ccuAddr(); } 00085 if ( sub_path.ccuChan() != sistrip::invalid_ ) { bin << sistrip::dot_ << std::setw(2) << std::setfill('0') << sub_path.ccuChan(); } 00086 if ( ( granularity == sistrip::LLD_CHAN || 00087 granularity == sistrip::APV ) && 00088 path.channel() != sistrip::invalid_ ) { bin << sistrip::dot_ << path.channel(); } 00089 00090 // Store "value" in appropriate std::vector within std::map (key is bin label) 00091 map_[bin.str()].push_back( Data(value,error) ); 00092 entries_++; 00093 // LogTrace(mlTest_) 00094 // << "TEST " 00095 // << " filling " << bin.str() << " " << value << " " << error << " "; 00096 00097 } 00098 00099 }