CMS 3D CMS Logo

List of all members | Public Member Functions
SummaryGeneratorControlView Class Reference

Fills "summary histograms" in FEC or "control" view. More...

#include <SummaryGeneratorControlView.h>

Inheritance diagram for SummaryGeneratorControlView:
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
 
 SummaryGeneratorControlView ()
 
 ~SummaryGeneratorControlView () 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 FEC or "control" view.

Author
M.Wingham, R.Bainbridge

Definition at line 12 of file SummaryGeneratorControlView.h.

Constructor & Destructor Documentation

◆ SummaryGeneratorControlView()

SummaryGeneratorControlView::SummaryGeneratorControlView ( )

Definition at line 15 of file SummaryGeneratorControlView.cc.

15 : SummaryGenerator("SummaryGeneratorControlView") { ; }

◆ ~SummaryGeneratorControlView()

SummaryGeneratorControlView::~SummaryGeneratorControlView ( )
inlineoverride

Definition at line 16 of file SummaryGeneratorControlView.h.

16 { ; }

Member Function Documentation

◆ fill()

void SummaryGeneratorControlView::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 SummaryGeneratorControlView.cc.

23  {
24  // Check granularity is recognised
26 
27  if (granularity != sistrip::UNDEFINED_GRAN && granularity != sistrip::FEC_CRATE && granularity != sistrip::FEC_SLOT &&
28  granularity != sistrip::FEC_RING && granularity != sistrip::CCU_ADDR && granularity != sistrip::CCU_CHAN &&
29  granularity != sistrip::LLD_CHAN && granularity != sistrip::APV) {
31  edm::LogWarning(mlSummaryPlots_) << "[SummaryGeneratorControlView::" << __func__ << "]"
32  << " Unexpected granularity requested: " << gran;
33  return;
34  }
35 
36  // Create key representing "top level" directory
37  SiStripFecKey top(top_level_dir);
38 
39  // Path and std::string for "present working directory" as defined by device key
40  SiStripFecKey path(device_key);
41  const std::string& pwd = path.path();
42 
43  // LogTrace(mlTest_)
44  // << "TEST "
45  // << "top " << top
46  // << "path " << path;
47 
48  if (top.isValid() && path.isValid() && (path.fecCrate() == top.fecCrate() || !top.fecCrate()) &&
49  (path.fecSlot() == top.fecSlot() || !top.fecSlot()) && (path.fecRing() == top.fecRing() || !top.fecRing()) &&
50  (path.ccuAddr() == top.ccuAddr() || !top.ccuAddr()) && (path.ccuChan() == top.ccuChan() || !top.ccuChan())) {
51  // Extract path and std::string corresponding to "top-level down to granularity"
52  std::string sub_dir = pwd;
53  size_t pos = pwd.find(gran);
54  if (pos != std::string::npos) {
55  sub_dir = pwd.substr(0, pwd.find(sistrip::dir_, pos));
56  } else if (granularity == sistrip::UNKNOWN_GRAN) {
57  sub_dir = pwd;
58  }
59 
60  SiStripFecKey sub_path(sub_dir);
61 
62  // LogTrace(mlTest_)
63  // << "TEST "
64  // << "sub_path " << sub_path;
65 
66  // Construct bin label
67  std::stringstream bin;
68  if (sub_path.fecCrate() != sistrip::invalid_) {
69  bin << std::setw(1) << std::setfill('0') << sub_path.fecCrate();
70  }
71  if (sub_path.fecSlot() != sistrip::invalid_) {
72  bin << sistrip::dot_ << std::setw(2) << std::setfill('0') << sub_path.fecSlot();
73  }
74  if (sub_path.fecRing() != sistrip::invalid_) {
75  bin << sistrip::dot_ << std::setw(1) << std::setfill('0') << sub_path.fecRing();
76  }
77  if (sub_path.ccuAddr() != sistrip::invalid_) {
78  bin << sistrip::dot_ << std::setw(3) << std::setfill('0') << sub_path.ccuAddr();
79  }
80  if (sub_path.ccuChan() != sistrip::invalid_) {
81  bin << sistrip::dot_ << std::setw(2) << std::setfill('0') << sub_path.ccuChan();
82  }
83  if ((granularity == sistrip::LLD_CHAN || granularity == sistrip::APV) && path.channel() != sistrip::invalid_) {
84  bin << sistrip::dot_ << path.channel();
85  }
86 
87  // Store "value" in appropriate std::vector within std::map (key is bin label)
88  map_[bin.str()].push_back(Data(value, error));
89  entries_++;
90  // LogTrace(mlTest_)
91  // << "TEST "
92  // << " filling " << bin.str() << " " << value << " " << error << " ";
93  }
94 }

References sistrip::APV, newFWLiteAna::bin, sistrip::CCU_ADDR, sistrip::CCU_CHAN, SiStripFecKey::ccuAddr(), SiStripFecKey::ccuChan(), sistrip::dir_, sistrip::dot_, SummaryGenerator::entries_, relativeConstraints::error, 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_, castor_dqm_sourceclient_file_cfg::path, alignCSCRings::pwd, AlCaHLTBitMon_QueryRunRegistry::string, groupFilesInBlocks::temp, sistrip::UNDEFINED_GRAN, and sistrip::UNKNOWN_GRAN.

sistrip::dot_
static const char dot_[]
Definition: ConstantsForDqm.h:20
sistrip::CCU_CHAN
Definition: ConstantsForGranularity.h:93
alignCSCRings.pwd
pwd
Definition: alignCSCRings.py:57
sistrip::FEC_RING
Definition: ConstantsForGranularity.h:91
sistrip::CCU_ADDR
Definition: ConstantsForGranularity.h:92
pos
Definition: PixelAliasList.h:18
SummaryGenerator::entries_
float entries_
Definition: SummaryGenerator.h:119
sistrip::dir_
static const char dir_[]
Definition: ConstantsForDqm.h:17
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
SiStripFecKey
Utility class that identifies a position within the strip tracker control structure,...
Definition: SiStripFecKey.h:45
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
castor_dqm_sourceclient_file_cfg.path
path
Definition: castor_dqm_sourceclient_file_cfg.py:37
sistrip::FEC_CRATE
Definition: ConstantsForGranularity.h:89
sistrip::UNDEFINED_GRAN
Definition: ConstantsForGranularity.h:61
sistrip::LLD_CHAN
Definition: ConstantsForGranularity.h:78
sistrip::FEC_SLOT
Definition: ConstantsForGranularity.h:90
SummaryGenerator::map_
HistoData map_
Definition: SummaryGenerator.h:117