CMS 3D CMS Logo

CalibrationScanSummaryFactory.cc
Go to the documentation of this file.
5 #include <iostream>
6 #include <sstream>
7 
8 using namespace sistrip;
9 
10 // -----------------------------------------------------------------------------
11 //
13 
14  CalibrationScanAnalysis* anal = dynamic_cast<CalibrationScanAnalysis*>( iter->second );
15  if ( !anal ) { return; }
16 
17  SiStripFecKey lldKey = SiStripFecKey(iter->first);
18 
19  uint32_t key1 = SiStripFecKey(lldKey.fecCrate(),
20  lldKey.fecSlot(),
21  lldKey.fecRing(),
22  lldKey.ccuAddr(),
23  lldKey.ccuChan(),
24  lldKey.lldChan(),
25  lldKey.i2cAddr(lldKey.lldChan(),true)).key();
26 
27  uint32_t key2 = SiStripFecKey(lldKey.fecCrate(),
28  lldKey.fecSlot(),
29  lldKey.fecRing(),
30  lldKey.ccuAddr(),
31  lldKey.ccuChan(),
32  lldKey.lldChan(),
33  lldKey.i2cAddr(lldKey.lldChan(),false)).key();
34 
35  std::vector<float> value (2,1*sistrip::invalid_);
36 
37  // search for the best isha and VFS values cose to the optimal ones
39  value[0] = anal->tunedAmplitude()[0];
40  value[1] = anal->tunedAmplitude()[1];
41  }
42  else if ( mon_ == sistrip::CALIBRATION_BASELINE_TUNED) {
43  value[0] = anal->tunedBaseline()[0];
44  value[1] = anal->tunedBaseline()[1];
45  }
46  else if ( mon_ == sistrip::CALIBRATION_TURNON_TUNED) {
47  value[0] = anal->tunedTurnOn()[0];
48  value[1] = anal->tunedTurnOn()[1];
49  }
50  else if ( mon_ == sistrip::CALIBRATION_RISETIME_TUNED) {
51  value[0] = anal->tunedRiseTime()[0];
52  value[1] = anal->tunedRiseTime()[1];
53  }
54  else if ( mon_ == sistrip::CALIBRATION_DECAYTIME_TUNED) {
55  value[0] = anal->tunedDecayTime()[0];
56  value[1] = anal->tunedDecayTime()[1];
57  }
58  else if ( mon_ == sistrip::CALIBRATION_PEAKTIME_TUNED) {
59  value[0] = anal->tunedPeakTime()[0];
60  value[1] = anal->tunedPeakTime()[1];
61  }
62  else if ( mon_ == sistrip::CALIBRATION_UNDERSHOOT_TUNED) {
63  value[0] = anal->tunedUndershoot()[0];
64  value[1] = anal->tunedUndershoot()[1];
65  }
66  else if ( mon_ == sistrip::CALIBRATION_TAIL_TUNED) {
67  value[0] = anal->tunedTail()[0];
68  value[1] = anal->tunedTail()[1];
69  }
70  else if ( mon_ == sistrip::CALIBRATION_SMEARING_TUNED) {
71  value[0] = anal->tunedSmearing()[0];
72  value[1] = anal->tunedSmearing()[1];
73  }
74  else if ( mon_ == sistrip::CALIBRATION_CHI2_TUNED) {
75  value[0] = anal->tunedChi2()[0];
76  value[1] = anal->tunedChi2()[1];
77  }
78  else if ( mon_ == sistrip::CALIBRATION_ISHA_TUNED) {
79  value[0] = anal->tunedISHA()[0];
80  value[1] = anal->tunedISHA()[1];
81  }
82  else if ( mon_ == sistrip::CALIBRATION_VFS_TUNED) {
83  value[0] = anal->tunedVFS()[0];
84  value[1] = anal->tunedVFS()[1];
85  }
86  else if ( mon_ == sistrip::CALIBRATION_ISHA_BEST) {
87  value[0] = anal->bestISHA()[0];
88  value[1] = anal->bestISHA()[1];
89  }
90  else if ( mon_ == sistrip::CALIBRATION_VFS_BEST) {
91  value[0] = anal->bestVFS()[0];
92  value[1] = anal->bestVFS()[1];
93  }
94  else {
96  << "[SummaryPlotFactory::" << __func__ << "]"
97  << " Unexpected monitorable: "
99  return;
100  }
101 
104  key1,
105  value[0] );
106 
109  key2,
110  value[1] );
111 
112  // set the x-axis
113  format();
114 
115 }
116 
117 //------------------------------------------------------------------------------
118 //
120 
121  // Histogram formatting
123  generator_->axisLabel( "Amplitude (ADC)" );
124 
125  else if ( mon_ == sistrip::CALIBRATION_BASELINE_TUNED)
126  generator_->axisLabel( "Baseline (ADC)" );
127 
128  else if ( mon_ == sistrip::CALIBRATION_TURNON_TUNED)
129  generator_->axisLabel( "Turn-On (ns)" );
130 
131  else if ( mon_ == sistrip::CALIBRATION_TAIL_TUNED)
132  generator_->axisLabel( "Tail (%)" );
133 
134  else if ( mon_ == sistrip::CALIBRATION_RISETIME_TUNED)
135  generator_->axisLabel( "Rise Time (ns)" );
136 
137  else if ( mon_ == sistrip::CALIBRATION_PEAKTIME_TUNED)
138  generator_->axisLabel( "Peak Time (ns)" );
139 
140  else if ( mon_ == sistrip::CALIBRATION_DECAYTIME_TUNED)
141  generator_->axisLabel( "Decay Time (ns)" );
142 
143  else if ( mon_ == sistrip::CALIBRATION_SMEARING_TUNED)
144  generator_->axisLabel( "Smearing (ns)" );
145 
146  else if ( mon_ == sistrip::CALIBRATION_CHI2_TUNED)
147  generator_->axisLabel( "Chi2/ndf" );
148 
149  else if ( mon_ == sistrip::CALIBRATION_VFS_TUNED or
151  generator_->axisLabel( "VFS" );
152 
153  else if ( mon_ == sistrip::CALIBRATION_ISHA_TUNED or
155  generator_->axisLabel( "ISHA" );
156  else {
158  << "[SummaryPlotFactory::" << __func__ << "]"
159  << " Unexpected SummaryHisto value:"
161  }
162 }
163 
static std::string monitorable(const sistrip::Monitorable &)
sistrip::Monitorable mon_
const uint16_t & fecRing() const
const uint16_t & lldChan() const
const uint16_t & fecSlot() const
const uint16_t & i2cAddr() const
sistrip classes
const uint32_t & key() const
Definition: SiStripKey.h:125
Utility class that identifies a position within the strip tracker control structure, down to the level of an APV25.
Definition: SiStripFecKey.h:45
void fillMap(const std::string &top_level_dir, const sistrip::Granularity &, const uint32_t &key, const float &value, const float &error=0.)
Analysis for calibration scans.
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
format
Some error handling for the usage.
sistrip::Granularity gran_
const uint16_t & fecCrate() const
static const char mlSummaryPlots_[]
SummaryGenerator * generator_
const uint16_t & ccuAddr() const
static const uint16_t invalid_
Definition: Constants.h:16
const uint16_t & ccuChan() const