CMS 3D CMS Logo

DaqScopeModeSummaryFactory.cc
Go to the documentation of this file.
5 #include <iostream>
6 #include <sstream>
7 
8 using namespace sistrip;
9 
10 // -----------------------------------------------------------------------------
11 //
13 
14  DaqScopeModeAnalysis* anal = dynamic_cast<DaqScopeModeAnalysis*>( 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  float valueAlt = 1. * sistrip::invalid_;
26 
27  bool all_strips = false;
28  if ( mon_ == sistrip::PEDESTALS_ALL_STRIPS ) {
29  all_strips = true;
30  uint16_t bins = peds[0].size();
31  if ( peds[0].size() < peds[1].size() ) { bins = peds[1].size(); }
32  for ( uint16_t iped = 0; iped < bins; iped++ ) {
33  value[0][iped] = peds[0][iped];
34  value[1][iped] = peds[1][iped];
35  }
36  } else if ( mon_ == sistrip::PEDESTALS_MEAN ) {
37  value[0][0] = anal->pedsMean()[0];
38  value[1][0] = anal->pedsMean()[1];
39  } else if ( mon_ == sistrip::PEDESTALS_SPREAD ) {
40  value[0][0] = anal->pedsSpread()[0];
41  value[1][0] = anal->pedsSpread()[1];
42  } else if ( mon_ == sistrip::PEDESTALS_MAX ) {
43  value[0][0] = anal->pedsMax()[0];
44  value[1][0] = anal->pedsMax()[1];
45  } else if ( mon_ == sistrip::PEDESTALS_MIN ) {
46  value[0][0] = anal->pedsMin()[0];
47  value[1][0] = anal->pedsMin()[1];
48  } else if ( mon_ == sistrip::NOISE_ALL_STRIPS ) {
49  all_strips = true;
50  uint16_t bins = noise[0].size();
51  if ( noise[0].size() < noise[1].size() ) { bins = noise[1].size(); }
52  for ( uint16_t inoise = 0; inoise < bins; inoise++ ) {
53  value[0][inoise] = noise[0][inoise];
54  value[1][inoise] = noise[1][inoise];
55  }
56  } else if ( mon_ == sistrip::NOISE_MEAN ) {
57  value[0][0] = anal->noiseMean()[0];
58  value[1][0] = anal->noiseMean()[1];
59  } else if ( mon_ == sistrip::NOISE_SPREAD ) {
60  value[0][0] = anal->noiseSpread()[0];
61  value[1][0] = anal->noiseSpread()[1];
62  } else if ( mon_ == sistrip::NOISE_MAX ) {
63  value[0][0] = anal->noiseMax()[0];
64  value[1][0] = anal->noiseMax()[1];
65  } else if ( mon_ == sistrip::NOISE_MIN ) {
66  value[0][0] = anal->noiseMin()[0];
67  value[1][0] = anal->noiseMin()[1];
68  } else if ( mon_ == sistrip::NUM_OF_DEAD ) {
69  value[0][0] = 1. * anal->dead()[0].size();
70  value[1][0] = 1. * anal->dead()[1].size();
71  } else if ( mon_ == sistrip::NUM_OF_NOISY ) {
72  value[0][0] = 1. * anal->noisy()[0].size();
73  value[1][0] = 1. * anal->noisy()[1].size();
74  } else if ( mon_ == sistrip::APV_TIMING_BASE ) {
75  valueAlt = anal->base();
76  } else if ( mon_ == sistrip::APV_TIMING_PEAK ) {
77  valueAlt = anal->peak();
78  } else if ( mon_ == sistrip::APV_TIMING_HEIGHT ) {
79  valueAlt = anal->height();
80  }
81  else {
83  << "[SummaryPlotFactory::" << __func__ << "]"
84  << " Unexpected monitorable: "
86  return;
87  }
88 
89  if ( !all_strips ) {
90 
93  iter->first,
94  value[0][0] );
95 
98  iter->first,
99  value[1][0] );
100 
103  iter->first,
104  valueAlt );
105 
106  } else {
107 
108  for ( uint16_t istr = 0; istr < value[0].size(); istr++ ) {
111  iter->first,
112  value[0][istr] );
113  }
114 
115  for ( uint16_t istr = 0; istr < value[1].size(); istr++ ) {
118  iter->first,
119  value[1][istr] );
120  }
121 
122  }
123 
124 }
125 
126 // -----------------------------------------------------------------------------
127 //
129 
130  if ( mon_ == sistrip::PEDESTALS_ALL_STRIPS ) {
131  generator_->axisLabel( "Pedestal value [adc]" );
132  } else if ( mon_ == sistrip::PEDESTALS_MEAN ) {
133  } else if ( mon_ == sistrip::PEDESTALS_SPREAD ) {
134  } else if ( mon_ == sistrip::PEDESTALS_MAX ) {
135  } else if ( mon_ == sistrip::PEDESTALS_MIN ) {
136  } else if ( mon_ == sistrip::NOISE_ALL_STRIPS ) {
137  generator_->axisLabel( "Noise [adc]" );
138  } else if ( mon_ == sistrip::NOISE_MEAN ) {
139  } else if ( mon_ == sistrip::NOISE_SPREAD ) {
140  } else if ( mon_ == sistrip::NOISE_MAX ) {
141  } else if ( mon_ == sistrip::NOISE_MIN ) {
142  } else if ( mon_ == sistrip::NUM_OF_DEAD ) {
143  } else if ( mon_ == sistrip::NUM_OF_NOISY ) {
144  }
146  SummaryPlotFactoryBase::generator_->axisLabel( "Timing delay [ns]" );
153  } else {
155  << "[SummaryPlotFactory::" << __func__ << "]"
156  << " Unexpected SummaryHisto value:"
158  }
159 
160 }
size
Write out results.
static std::string monitorable(const sistrip::Monitorable &)
const VFloat & noiseMean() const
const VVInt & dead() const
sistrip::Monitorable mon_
const VFloat & noiseSpread() const
const VFloat & noiseMax() const
sistrip classes
void fillMap(const std::string &top_level_dir, const sistrip::Granularity &, const uint32_t &key, const float &value, const float &error=0.)
const VFloat & pedsSpread() const
const VVFloat & noise() const
const float & base() const
const VVFloat & peds() const
const float & height() const
sistrip::Granularity gran_
const VFloat & noiseMin() const
const float & peak() const
static const char mlSummaryPlots_[]
const VFloat & pedsMean() const
const VVInt & noisy() const
SummaryGenerator * generator_
static const uint16_t invalid_
Definition: Constants.h:16
const VFloat & pedsMax() const
const VFloat & pedsMin() const
void axisLabel(const std::string &)
Analysis for scope mode data.