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") { ; }

◆ ~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.

23  {
24  // Check granularity is recognised
26 
27  if (granularity != sistrip::UNDEFINED_GRAN && granularity != sistrip::FE_DRIVER && granularity != sistrip::FE_UNIT &&
28  granularity != sistrip::FE_CHAN && granularity != sistrip::APV) {
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 }

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.

alignCSCRings.pwd
pwd
Definition: alignCSCRings.py:57
pos
Definition: PixelAliasList.h:18
SummaryGenerator::entries_
float entries_
Definition: SummaryGenerator.h:119
sistrip::dir_
static const char dir_[]
Definition: ConstantsForDqm.h:17
sistrip::FE_UNIT
Definition: ConstantsForGranularity.h:83
SiStripFedKey
A container class for generic run and event-related info, information required by the commissioning a...
Definition: SiStripFedKey.h:56
sistrip::UNKNOWN_GRAN
Definition: ConstantsForGranularity.h:62
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
relativeConstraints.error
error
Definition: relativeConstraints.py:53
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
SummaryGenerator::Data
std::pair< float, float > Data
Definition: SummaryGenerator.h:27
SiStripEnumsAndStrings::granularity
static std::string granularity(const sistrip::Granularity &)
Definition: SiStripEnumsAndStrings.cc:265
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
sistrip::APV
Definition: ConstantsForGranularity.h:79
value
Definition: value.py:1
sistrip::invalid_
static const uint16_t invalid_
Definition: Constants.h:16
SummaryGenerator::SummaryGenerator
SummaryGenerator(std::string name)
Definition: SummaryGenerator.cc:16
newFWLiteAna.bin
bin
Definition: newFWLiteAna.py:161
sistrip::mlSummaryPlots_
static const char mlSummaryPlots_[]
Definition: ConstantsForLogger.h:26
relativeConstraints.value
value
Definition: relativeConstraints.py:53
castor_dqm_sourceclient_file_cfg.path
path
Definition: castor_dqm_sourceclient_file_cfg.py:37
sistrip::FE_DRIVER
Definition: ConstantsForGranularity.h:82
sistrip::UNDEFINED_GRAN
Definition: ConstantsForGranularity.h:61
sistrip::FE_CHAN
Definition: ConstantsForGranularity.h:84
SummaryGenerator::map_
HistoData map_
Definition: SummaryGenerator.h:117