CMS 3D CMS Logo

PedsOnlySummaryFactory.cc
Go to the documentation of this file.
5 #include <iostream>
6 #include <sstream>
7 
8 using namespace sistrip;
9 
10 // -----------------------------------------------------------------------------
11 //
13 
14  PedsOnlyAnalysis* anal = dynamic_cast<PedsOnlyAnalysis*>( 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->raw()[0]; //@@ raw noise
24  noise[1] = anal->raw()[1]; //@@ raw noise
25 
26  bool all_strips = false;
27  if ( mon_ == sistrip::PEDESTALS_ALL_STRIPS ) {
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->rawMean()[0];
57  value[1][0] = anal->rawMean()[1];
58  } else if ( mon_ == sistrip::NOISE_SPREAD ) {
59  value[0][0] = anal->rawSpread()[0];
60  value[1][0] = anal->rawSpread()[1];
61  } else if ( mon_ == sistrip::NOISE_MAX ) {
62  value[0][0] = anal->rawMax()[0];
63  value[1][0] = anal->rawMax()[1];
64  } else if ( mon_ == sistrip::NOISE_MIN ) {
65  value[0][0] = anal->rawMin()[0];
66  value[1][0] = anal->rawMin()[1];
67  } else {
69  << "[SummaryPlotFactory::" << __func__ << "]"
70  << " Unexpected monitorable: "
72  return;
73  }
74 
75  if ( !all_strips ) {
76 
79  iter->first,
80  value[0][0] );
81 
84  iter->first,
85  value[1][0] );
86 
87  } else {
88 
89  for ( uint16_t istr = 0; istr < value[0].size(); istr++ ) {
92  iter->first,
93  value[0][istr] );
94  }
95 
96  for ( uint16_t istr = 0; istr < value[1].size(); istr++ ) {
99  iter->first,
100  value[1][istr] );
101  }
102 
103  }
104 
105 }
106 
107 // -----------------------------------------------------------------------------
108 //
110 
111  if ( mon_ == sistrip::PEDESTALS_ALL_STRIPS ) {
112  generator_->axisLabel( "Pedestal value [adc]" );
113  } else if ( mon_ == sistrip::PEDESTALS_MEAN ) {
114  } else if ( mon_ == sistrip::PEDESTALS_SPREAD ) {
115  } else if ( mon_ == sistrip::PEDESTALS_MAX ) {
116  } else if ( mon_ == sistrip::PEDESTALS_MIN ) {
117  } else if ( mon_ == sistrip::NOISE_ALL_STRIPS ) {
118  generator_->axisLabel( "Noise [adc]" );
119  } else if ( mon_ == sistrip::NOISE_MEAN ) {
120  } else if ( mon_ == sistrip::NOISE_SPREAD ) {
121  } else if ( mon_ == sistrip::NOISE_MAX ) {
122  } else if ( mon_ == sistrip::NOISE_MIN ) {
123  } else if ( mon_ == sistrip::NUM_OF_DEAD ) {
124  } else if ( mon_ == sistrip::NUM_OF_NOISY ) {
125  } else {
127  << "[SummaryPlotFactory::" << __func__ << "]"
128  << " Unexpected SummaryHisto value:"
130  }
131 
132 }
size
Write out results.
static std::string monitorable(const sistrip::Monitorable &)
Histogram-based analysis for pedestal run.
sistrip::Monitorable mon_
sistrip classes
const VFloat & rawSpread() const
const VVFloat & raw() const
void fillMap(const std::string &top_level_dir, const sistrip::Granularity &, const uint32_t &key, const float &value, const float &error=0.)
const VFloat & rawMin() const
const VFloat & pedsMin() const
const VFloat & pedsMax() const
sistrip::Granularity gran_
const VFloat & rawMax() const
static const char mlSummaryPlots_[]
void extract(Iterator) override
SummaryGenerator * generator_
static const uint16_t invalid_
Definition: Constants.h:16
const VVFloat & peds() const
const VFloat & pedsSpread() const
const VFloat & pedsMean() const
const VFloat & rawMean() const