CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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)
 
 SummaryGeneratorReadoutView ()
 
virtual ~SummaryGeneratorReadoutView ()
 
- 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,
BinData
HistoData
 
- 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 ( )

Definition at line 15 of file SummaryGeneratorReadoutView.cc.

15  :
16  SummaryGenerator("SummaryGeneratorReadoutView") {;}
SummaryGenerator(std::string name)
virtual SummaryGeneratorReadoutView::~SummaryGeneratorReadoutView ( )
inlinevirtual

Definition at line 18 of file SummaryGeneratorReadoutView.h.

18 {;}

Member Function Documentation

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, newFWLiteAna::bin, 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_, getHLTPrescaleColumns::path, SiStripKey::path(), alignCSCRings::pwd, AlCaHLTBitMon_QueryRunRegistry::string, groupFilesInBlocks::temp, sistrip::UNDEFINED_GRAN, sistrip::UNKNOWN_GRAN, and relativeConstraints::value.

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