CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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)
 
 SummaryGeneratorControlView ()
 
virtual ~SummaryGeneratorControlView ()
 
- 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 FEC or "control" view.

Author
M.Wingham, R.Bainbridge

Definition at line 12 of file SummaryGeneratorControlView.h.

Constructor & Destructor Documentation

SummaryGeneratorControlView::SummaryGeneratorControlView ( )

Definition at line 15 of file SummaryGeneratorControlView.cc.

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

Definition at line 18 of file SummaryGeneratorControlView.h.

18 {;}

Member Function Documentation

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

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

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