CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Protected Member Functions
NoiseSummaryFactory Class Reference

#include <NoiseSummaryFactory.h>

Inheritance diagram for NoiseSummaryFactory:
SummaryPlotFactory< CommissioningAnalysis * > SummaryPlotFactoryBase

Protected Member Functions

void extract (Iterator)
 
void format ()
 
- Protected Member Functions inherited from SummaryPlotFactoryBase
void fill (TH1 &summary_histo)
 
void init (const sistrip::Monitorable &, const sistrip::Presentation &, const sistrip::View &, const std::string &top_level_dir, const sistrip::Granularity &)
 
 SummaryPlotFactoryBase ()
 
 ~SummaryPlotFactoryBase ()
 

Additional Inherited Members

- Public Types inherited from SummaryPlotFactory< CommissioningAnalysis * >
typedef std::map< uint32_t,
CommissioningAnalysis * >
::const_iterator 
Iterator
 
- Public Member Functions inherited from SummaryPlotFactory< CommissioningAnalysis * >
void fill (TH1 &summary_histo)
 
uint32_t init (const sistrip::Monitorable &, const sistrip::Presentation &, const sistrip::View &, const std::string &top_level_dir, const sistrip::Granularity &, const std::map< uint32_t, CommissioningAnalysis * > &data)
 
 SummaryPlotFactory ()
 
virtual ~SummaryPlotFactory ()
 
- Protected Attributes inherited from SummaryPlotFactoryBase
SummaryGeneratorgenerator_
 
sistrip::Granularity gran_
 
std::string level_
 
sistrip::Monitorable mon_
 
sistrip::Presentation pres_
 
sistrip::View view_
 

Detailed Description

Definition at line 6 of file NoiseSummaryFactory.h.

Member Function Documentation

void NoiseSummaryFactory::extract ( Iterator  iter)
protectedvirtual

Reimplemented from SummaryPlotFactory< CommissioningAnalysis * >.

Definition at line 12 of file NoiseSummaryFactory.cc.

References NoiseAnalysis::dead(), SummaryGenerator::fillMap(), SummaryPlotFactoryBase::generator_, SummaryPlotFactoryBase::gran_, sistrip::invalid_, SummaryPlotFactoryBase::level_, sistrip::mlSummaryPlots_, SummaryPlotFactoryBase::mon_, SiStripEnumsAndStrings::monitorable(), NoiseAnalysis::noise(), HLT_FULL_cff::noise, sistrip::NOISE_ALL_STRIPS, sistrip::NOISE_MAX, sistrip::NOISE_MEAN, sistrip::NOISE_MIN, sistrip::NOISE_SPREAD, NoiseAnalysis::noiseMax(), NoiseAnalysis::noiseMean(), NoiseAnalysis::noiseMin(), NoiseAnalysis::noiseSpread(), NoiseAnalysis::noisy(), sistrip::NUM_OF_DEAD, sistrip::NUM_OF_NOISY, sistrip::PEDESTALS_ALL_STRIPS, sistrip::PEDESTALS_MAX, sistrip::PEDESTALS_MEAN, sistrip::PEDESTALS_MIN, sistrip::PEDESTALS_SPREAD, NoiseAnalysis::peds(), NoiseAnalysis::pedsMax(), NoiseAnalysis::pedsMean(), NoiseAnalysis::pedsMin(), NoiseAnalysis::pedsSpread(), findQualityFiles::size, groupFilesInBlocks::temp, and relativeConstraints::value.

Referenced by BeautifulSoup.PageElement::_invert(), and BeautifulSoup.Tag::decompose().

12  {
13 
14  NoiseAnalysis* anal = dynamic_cast<NoiseAnalysis*>( iter->second );
15  if ( !anal ) { return; }
16 
17  std::vector<float> temp(128, 1. * sistrip::invalid_ );
18  std::vector< std::vector<float> > value( 2, temp );
19  std::vector< std::vector<float> > peds( 2, temp );
20  std::vector< std::vector<float> > noise( 2, temp );
21  peds[0] = anal->peds()[0];
22  peds[1] = anal->peds()[1];
23  noise[0] = anal->noise()[0];
24  noise[1] = anal->noise()[1];
25 
26  bool all_strips = false;
28  all_strips = true;
29  uint16_t bins = peds[0].size();
30  if ( peds[0].size() < peds[1].size() ) { bins = peds[1].size(); }
31  for ( uint16_t iped = 0; iped < bins; iped++ ) {
32  value[0][iped] = peds[0][iped];
33  value[1][iped] = peds[1][iped];
34  }
35  } else if ( mon_ == sistrip::PEDESTALS_MEAN ) {
36  value[0][0] = anal->pedsMean()[0];
37  value[1][0] = anal->pedsMean()[1];
38  } else if ( mon_ == sistrip::PEDESTALS_SPREAD ) {
39  value[0][0] = anal->pedsSpread()[0];
40  value[1][0] = anal->pedsSpread()[1];
41  } else if ( mon_ == sistrip::PEDESTALS_MAX ) {
42  value[0][0] = anal->pedsMax()[0];
43  value[1][0] = anal->pedsMax()[1];
44  } else if ( mon_ == sistrip::PEDESTALS_MIN ) {
45  value[0][0] = anal->pedsMin()[0];
46  value[1][0] = anal->pedsMin()[1];
47  } else if ( mon_ == sistrip::NOISE_ALL_STRIPS ) {
48  all_strips = true;
49  uint16_t bins = noise[0].size();
50  if ( noise[0].size() < noise[1].size() ) { bins = noise[1].size(); }
51  for ( uint16_t inoise = 0; inoise < bins; inoise++ ) {
52  value[0][inoise] = noise[0][inoise];
53  value[1][inoise] = noise[1][inoise];
54  }
55  } else if ( mon_ == sistrip::NOISE_MEAN ) {
56  value[0][0] = anal->noiseMean()[0];
57  value[1][0] = anal->noiseMean()[1];
58  } else if ( mon_ == sistrip::NOISE_SPREAD ) {
59  value[0][0] = anal->noiseSpread()[0];
60  value[1][0] = anal->noiseSpread()[1];
61  } else if ( mon_ == sistrip::NOISE_MAX ) {
62  value[0][0] = anal->noiseMax()[0];
63  value[1][0] = anal->noiseMax()[1];
64  } else if ( mon_ == sistrip::NOISE_MIN ) {
65  value[0][0] = anal->noiseMin()[0];
66  value[1][0] = anal->noiseMin()[1];
67  } else if ( mon_ == sistrip::NUM_OF_DEAD ) {
68  value[0][0] = 1. * anal->dead()[0].size();
69  value[1][0] = 1. * anal->dead()[1].size();
70  } else if ( mon_ == sistrip::NUM_OF_NOISY ) {
71  value[0][0] = 1. * anal->noisy()[0].size();
72  value[1][0] = 1. * anal->noisy()[1].size();
73  } else {
75  << "[SummaryPlotFactory::" << __func__ << "]"
76  << " Unexpected monitorable: "
78  return;
79  }
80 
81  if ( !all_strips ) {
82 
85  iter->first,
86  value[0][0] );
87 
90  iter->first,
91  value[1][0] );
92 
93  } else {
94 
95  for ( uint16_t istr = 0; istr < value[0].size(); istr++ ) {
98  iter->first,
99  value[0][istr] );
100  }
101 
102  for ( uint16_t istr = 0; istr < value[1].size(); istr++ ) {
105  iter->first,
106  value[1][istr] );
107  }
108 
109  }
110 
111 }
static std::string monitorable(const sistrip::Monitorable &)
const VVInt & dead() const
const VFloat & noiseMean() const
const VFloat & noiseSpread() const
sistrip::Monitorable mon_
const VFloat & pedsMax() const
const VFloat & pedsMean() const
void fillMap(const std::string &top_level_dir, const sistrip::Granularity &, const uint32_t &key, const float &value, const float &error=0.)
const VVFloat & noise() const
const VVInt & noisy() const
sistrip::Granularity gran_
const VFloat & pedsSpread() const
const VFloat & noiseMin() const
static const char mlSummaryPlots_[]
const VFloat & noiseMax() const
SummaryGenerator * generator_
static const uint16_t invalid_
Definition: Constants.h:16
const VVFloat & peds() const
Histogram-based analysis for pedestal run.
Definition: NoiseAnalysis.h:15
tuple size
Write out results.
const VFloat & pedsMin() const
void NoiseSummaryFactory::format ( )
protectedvirtual

Reimplemented from SummaryPlotFactory< CommissioningAnalysis * >.

Definition at line 115 of file NoiseSummaryFactory.cc.

References sistrip::mlSummaryPlots_, SummaryPlotFactoryBase::mon_, SiStripEnumsAndStrings::monitorable(), sistrip::NOISE_ALL_STRIPS, sistrip::NOISE_MAX, sistrip::NOISE_MEAN, sistrip::NOISE_MIN, sistrip::NOISE_SPREAD, sistrip::NUM_OF_DEAD, sistrip::NUM_OF_NOISY, sistrip::PEDESTALS_ALL_STRIPS, sistrip::PEDESTALS_MAX, sistrip::PEDESTALS_MEAN, sistrip::PEDESTALS_MIN, and sistrip::PEDESTALS_SPREAD.

115  {
116 
118  generator_->axisLabel( "Pedestal value [adc]" );
119  } else if ( mon_ == sistrip::PEDESTALS_MEAN ) {
120  } else if ( mon_ == sistrip::PEDESTALS_SPREAD ) {
121  } else if ( mon_ == sistrip::PEDESTALS_MAX ) {
122  } else if ( mon_ == sistrip::PEDESTALS_MIN ) {
123  } else if ( mon_ == sistrip::NOISE_ALL_STRIPS ) {
124  generator_->axisLabel( "Noise [adc]" );
125  } else if ( mon_ == sistrip::NOISE_MEAN ) {
126  } else if ( mon_ == sistrip::NOISE_SPREAD ) {
127  } else if ( mon_ == sistrip::NOISE_MAX ) {
128  } else if ( mon_ == sistrip::NOISE_MIN ) {
129  } else if ( mon_ == sistrip::NUM_OF_DEAD ) {
130  } else if ( mon_ == sistrip::NUM_OF_NOISY ) {
131  } else {
133  << "[SummaryPlotFactory::" << __func__ << "]"
134  << " Unexpected SummaryHisto value:"
136  }
137 
138 }
static std::string monitorable(const sistrip::Monitorable &)
sistrip::Monitorable mon_
static const char mlSummaryPlots_[]
SummaryGenerator * generator_
void axisLabel(const std::string &)