#include <DQM/SiStripCommissioningSummary/interface/SummaryGeneratorReadoutView.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. | |
SummaryGeneratorReadoutView () | |
virtual | ~SummaryGeneratorReadoutView () |
Fills "summary histograms" in FED or "readout" view.
Definition at line 12 of file SummaryGeneratorReadoutView.h.
SummaryGeneratorReadoutView::SummaryGeneratorReadoutView | ( | ) |
Definition at line 15 of file SummaryGeneratorReadoutView.cc.
00015 : 00016 SummaryGenerator("SummaryGeneratorReadoutView") {;}
virtual SummaryGeneratorReadoutView::~SummaryGeneratorReadoutView | ( | ) | [inline, virtual] |
void SummaryGeneratorReadoutView::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 SummaryGeneratorReadoutView.cc.
References sistrip::APV, sistrip::dir_, SummaryGenerator::entries_, sistrip::FE_CHAN, sistrip::FE_DRIVER, sistrip::FE_UNIT, SiStripFedKey::feChan(), SiStripFedKey::fedApv(), SiStripFedKey::fedId(), SiStripFedKey::feUnit(), SiStripEnumsAndStrings::granularity(), sistrip::invalid_, SiStripFedKey::isValid(), 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::FE_DRIVER && 00031 granularity != sistrip::FE_UNIT && 00032 granularity != sistrip::FE_CHAN && 00033 granularity != sistrip::APV ) { 00034 std::string temp = SiStripEnumsAndStrings::granularity( sistrip::FE_CHAN ); 00035 edm::LogWarning(mlSummaryPlots_) 00036 << "[SummaryGeneratorReadoutView::" << __func__ << "]" 00037 << " Unexpected granularity requested: " << gran; 00038 return; 00039 } 00040 00041 // Create key representing "top level" directory 00042 SiStripFedKey top( top_level_dir ); 00043 00044 // Path and std::string for "present working directory" as defined by device key 00045 SiStripFedKey path( device_key ); 00046 std::string pwd = path.path(); 00047 00048 // Check path is "within" top-level directory structure 00049 if ( top.isValid() && 00050 path.isValid() && 00051 ( path.fedId() == top.fedId() || !top.fedId() ) && 00052 ( path.feUnit() == top.feUnit() || !top.feUnit() ) && 00053 ( path.feChan() == top.feChan() || !top.feChan() ) ) { 00054 00055 // Extract path and std::string corresponding to "top-level down to granularity" 00056 std::string sub_dir = pwd; 00057 uint32_t pos = pwd.find( gran ); 00058 if ( pos != std::string::npos ) { 00059 sub_dir = pwd.substr( 0, pwd.find(sistrip::dir_,pos) ); 00060 } else if ( granularity == sistrip::UNKNOWN_GRAN ) { 00061 sub_dir = pwd; 00062 } 00063 00064 SiStripFedKey sub_path( sub_dir ); 00065 00066 // LogTrace(mlTest_) 00067 // << "TEST " 00068 // << "sub_path " << sub_path; 00069 00070 // Construct bin label 00071 std::stringstream bin; 00072 if ( sub_path.fedId() && sub_path.fedId() != sistrip::invalid_ ) { bin << std::setw(3) << std::setfill('0') << sub_path.fedId(); } 00073 if ( sub_path.feUnit() && sub_path.feUnit() != sistrip::invalid_ ) { bin << sistrip::dir_ << std::setw(1) << std::setfill('0') << sub_path.feUnit(); } 00074 if ( sub_path.feChan() && sub_path.feChan() != sistrip::invalid_ ) { bin << sistrip::dir_ << std::setw(2) << std::setfill('0') << sub_path.feChan(); } 00075 if ( sub_path.fedApv() && sub_path.fedApv() != sistrip::invalid_ ) { bin << sistrip::dir_ << std::setw(1) << std::setfill('0') << sub_path.fedApv(); } 00076 // if ( granularity == sistrip::APV && 00077 // path.fedApv() != sistrip::invalid_ ) { bin << sistrip::dot_ << path.fedApv(); } 00078 00079 // Store "value" in appropriate std::vector within std::map (key is bin label) 00080 map_[bin.str()].push_back( Data(value,error) ); 00081 entries_ += value; 00082 // LogTrace(mlTest_) 00083 // << "TEST " 00084 // << " filling " << bin.str() 00085 // << " " << value 00086 // << " " << error; 00087 00088 00089 } else { 00090 // std::stringstream ss; 00091 // ss << "[SummaryGeneratorReadoutView::" << __func__ << "]" 00092 // << " Path for 'pwd' is not within top-level directory!" << std::endl 00093 // << "Top-level: " << top << std::endl 00094 // << "Path: " << path << std::endl; 00095 // edm::LogWarning(mlSummaryPlots_) << ss.str(); 00096 } 00097 00098 }