CMS 3D CMS Logo

List of all members | Public Member Functions
SummaryGeneratorReadoutView Class Reference

Fills "summary histograms" in FED or "readout" view. More...

#include <SummaryGeneratorReadoutView.h>

Inheritance diagram for SummaryGeneratorReadoutView:
SummaryGenerator

Public Member Functions

void fill (const std::string &directory_level, const sistrip::Granularity &, const uint32_t &key, const float &value, const float &error) override
 
 SummaryGeneratorReadoutView ()
 
 ~SummaryGeneratorReadoutView () override
 
- Public Member Functions inherited from SummaryGenerator
void axisLabel (const std::string &)
 
void clearMap ()
 
void fillMap (const std::string &top_level_dir, const sistrip::Granularity &, const uint32_t &key, const float &value, const float &error=0.)
 
void format (const sistrip::RunType &, const sistrip::Monitorable &, const sistrip::Presentation &, const sistrip::View &, const std::string &directory, const sistrip::Granularity &, TH1 &)
 
void histo1D (TH1 &)
 
void histo2DScatter (TH1 &)
 
void histo2DSum (TH1 &)
 
const std::string & myName () const
 
uint32_t nBins () const
 
void printMap ()
 
void profile1D (TH1 &)
 
uint32_t size () const
 
 SummaryGenerator (std::string name)
 
virtual ~SummaryGenerator ()
 

Additional Inherited Members

- Public Types inherited from SummaryGenerator
typedef std::vector< DataBinData
 
typedef std::pair< float, float > Data
 
typedef std::map< std::string, BinDataHistoData
 
- Static Public Member Functions inherited from SummaryGenerator
static TH1 * histogram (const sistrip::Presentation &, const uint32_t &xbins)
 
static SummaryGeneratorinstance (const sistrip::View &)
 
static std::string name (const sistrip::RunType &, const sistrip::Monitorable &, const sistrip::Presentation &, const sistrip::View &, const std::string &directory)
 
- Protected Attributes inherited from SummaryGenerator
float entries_
 
std::string label_
 
HistoData map_
 
float max_
 
float min_
 

Detailed Description

Fills "summary histograms" in FED or "readout" view.

Author
M.Wingham, R.Bainbridge

Definition at line 12 of file SummaryGeneratorReadoutView.h.

Constructor & Destructor Documentation

◆ SummaryGeneratorReadoutView()

SummaryGeneratorReadoutView::SummaryGeneratorReadoutView ( )

Definition at line 15 of file SummaryGeneratorReadoutView.cc.

15 : SummaryGenerator("SummaryGeneratorReadoutView") { ; }
SummaryGenerator(std::string name)

◆ ~SummaryGeneratorReadoutView()

SummaryGeneratorReadoutView::~SummaryGeneratorReadoutView ( )
inlineoverride

Definition at line 16 of file SummaryGeneratorReadoutView.h.

16 { ; }

Member Function Documentation

◆ fill()

void SummaryGeneratorReadoutView::fill ( const std::string &  top_level_dir,
const sistrip::Granularity gran,
const uint32_t &  key,
const float &  value,
const float &  error 
)
overridevirtual

Fills the map used to generate the histogram.

Reimplemented from SummaryGenerator.

Definition at line 19 of file SummaryGeneratorReadoutView.cc.

References sistrip::APV, newFWLiteAna::bin, sistrip::dir_, SummaryGenerator::entries_, relativeConstraints::error, 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_, castor_dqm_sourceclient_file_cfg::path, alignCSCRings::pwd, AlCaHLTBitMon_QueryRunRegistry::string, groupFilesInBlocks::temp, sistrip::UNDEFINED_GRAN, sistrip::UNKNOWN_GRAN, and relativeConstraints::value.

23  {
24  // Check granularity is recognised
26 
30  edm::LogWarning(mlSummaryPlots_) << "[SummaryGeneratorReadoutView::" << __func__ << "]"
31  << " Unexpected granularity requested: " << gran;
32  return;
33  }
34 
35  // Create key representing "top level" directory
36  SiStripFedKey top(top_level_dir);
37 
38  // Path and std::string for "present working directory" as defined by device key
39  SiStripFedKey path(device_key);
40  const std::string& pwd = path.path();
41 
42  // Check path is "within" top-level directory structure
43  if (top.isValid() && path.isValid() && (path.fedId() == top.fedId() || !top.fedId()) &&
44  (path.feUnit() == top.feUnit() || !top.feUnit()) && (path.feChan() == top.feChan() || !top.feChan())) {
45  // Extract path and std::string corresponding to "top-level down to granularity"
46  std::string sub_dir = pwd;
47  size_t pos = pwd.find(gran);
48  if (pos != std::string::npos) {
49  sub_dir = pwd.substr(0, pwd.find(sistrip::dir_, pos));
50  } else if (granularity == sistrip::UNKNOWN_GRAN) {
51  sub_dir = pwd;
52  }
53 
54  SiStripFedKey sub_path(sub_dir);
55 
56  // LogTrace(mlTest_)
57  // << "TEST "
58  // << "sub_path " << sub_path;
59 
60  // Construct bin label
61  std::stringstream bin;
62  if (sub_path.fedId() && sub_path.fedId() != sistrip::invalid_) {
63  bin << std::setw(3) << std::setfill('0') << sub_path.fedId();
64  }
65  if (sub_path.feUnit() && sub_path.feUnit() != sistrip::invalid_) {
66  bin << sistrip::dir_ << std::setw(1) << std::setfill('0') << sub_path.feUnit();
67  }
68  if (sub_path.feChan() && sub_path.feChan() != sistrip::invalid_) {
69  bin << sistrip::dir_ << std::setw(2) << std::setfill('0') << sub_path.feChan();
70  }
71  if (sub_path.fedApv() && sub_path.fedApv() != sistrip::invalid_) {
72  bin << sistrip::dir_ << std::setw(1) << std::setfill('0') << sub_path.fedApv();
73  }
74  // if ( granularity == sistrip::APV &&
75  // path.fedApv() != sistrip::invalid_ ) { bin << sistrip::dot_ << path.fedApv(); }
76 
77  // Store "value" in appropriate std::vector within std::map (key is bin label)
78  map_[bin.str()].push_back(Data(value, error));
79  entries_ += value;
80  // LogTrace(mlTest_)
81  // << "TEST "
82  // << " filling " << bin.str()
83  // << " " << value
84  // << " " << error;
85 
86  } else {
87  // std::stringstream ss;
88  // ss << "[SummaryGeneratorReadoutView::" << __func__ << "]"
89  // << " Path for 'pwd' is not within top-level directory!" << std::endl
90  // << "Top-level: " << top << std::endl
91  // << "Path: " << path << std::endl;
92  // edm::LogWarning(mlSummaryPlots_) << ss.str();
93  }
94 }
static const char dir_[]
A container class for generic run and event-related info, information required by the commissioning a...
Definition: SiStripFedKey.h:56
static std::string granularity(const sistrip::Granularity &)
Definition: value.py:1
static const char mlSummaryPlots_[]
std::pair< float, float > Data
static const uint16_t invalid_
Definition: Constants.h:16
Log< level::Warning, false > LogWarning