CMS 3D CMS Logo

OptoScanAnalysis.cc
Go to the documentation of this file.
5 #include <iostream>
6 #include <sstream>
7 #include <iomanip>
8 #include <cmath>
9 
10 using namespace sistrip;
11 
12 // ----------------------------------------------------------------------------
13 //
15 
16 // ----------------------------------------------------------------------------
17 //
19 
20 // ----------------------------------------------------------------------------
21 //
22 const float OptoScanAnalysis::fedAdcGain_ = 1.024 / 1024.; // [V/ADC]
23 
24 // ----------------------------------------------------------------------------
25 //
29  bias_(4, sistrip::invalid_),
30  measGain_(4, sistrip::invalid_),
31  zeroLight_(4, sistrip::invalid_),
32  linkNoise_(4, sistrip::invalid_),
33  liftOff_(4, sistrip::invalid_),
34  threshold_(4, sistrip::invalid_),
35  tickHeight_(4, sistrip::invalid_),
36  baseSlope_(4, sistrip::invalid_) {
37  ;
38 }
39 
40 // ----------------------------------------------------------------------------
41 //
45  bias_(4, sistrip::invalid_),
53  ;
54 }
55 
56 // ----------------------------------------------------------------------------
57 //
68 }
69 
70 // ----------------------------------------------------------------------------
71 //
74 }
75 
76 // ----------------------------------------------------------------------------
77 //
78 void OptoScanAnalysis::summary(std::stringstream& ss) const {
79  SiStripFecKey fec_key(fecKey());
80  SiStripFedKey fed_key(fedKey());
81 
83 
84  std::stringstream extra1, extra2, extra3;
86  extra2 << sistrip::extrainfo::gain_ << gain() << sistrip::extrainfo::digital_ << "1";
88 
90  type,
92  fed_key.key(),
94  fec_key.lldChan(),
95  extra1.str())
96  .title();
98  type,
100  fed_key.key(),
102  fec_key.lldChan(),
103  extra2.str())
104  .title();
106  type,
108  fed_key.key(),
110  fec_key.lldChan(),
111  extra3.str())
112  .title();
113 
114  ss << " Summary"
115  << ":" << (isValid() ? "Valid" : "Invalid") << ":" << sistrip::controlView_ << ":" << fec_key.fecCrate() << "/"
116  << fec_key.fecSlot() << "/" << fec_key.fecRing() << "/" << fec_key.ccuAddr() << "/" << fec_key.ccuChan() << ":"
117  << sistrip::dqmRoot_ << sistrip::dir_ << "Collate" << sistrip::dir_
118  << SiStripFecKey(fec_key.fecCrate(), fec_key.fecSlot(), fec_key.fecRing(), fec_key.ccuAddr(), fec_key.ccuChan())
119  .path()
120  << ":" << title1 << ";" << title2 << ";" << title3 << std::endl;
121 }
122 
123 // ----------------------------------------------------------------------------
124 //
125 void OptoScanAnalysis::print(std::stringstream& ss, uint32_t gain) {
126  if (gain >= 4) {
127  gain = gain_;
128  }
129 
130  if (gain >= bias_.size()) {
131  edm::LogWarning(mlCommissioning_) << "[" << myName() << "::" << __func__ << "]"
132  << " Unexpected gain setting: " << gain;
133  return;
134  }
135 
136  header(ss);
137  ss << std::fixed << std::setprecision(2) << " Optimum LLD gain setting : " << gain_ << std::endl
138  << " LLD gain setting : " << gain << std::endl
139  << " LLD bias setting : " << bias_[gain] << std::endl
140  << " Measured gain [V/V] : " << measGain_[gain] << std::endl
141  << " Zero light level [ADC] : " << zeroLight_[gain] << std::endl
142  << " Link noise [ADC] : " << linkNoise_[gain] << std::endl
143  << " Baseline 'lift off' [mA] : " << liftOff_[gain] << std::endl
144  << " Laser threshold [mA] : " << threshold_[gain] << std::endl
145  << " Tick mark height [ADC] : " << tickHeight_[gain] << std::endl
146  << " Baseline slope [ADC/I2C] : " << baseSlope_[gain] << std::endl
147  << std::boolalpha << " isValid : " << isValid() << std::endl
148  << std::noboolalpha << " Error codes (found " << std::setw(2) << std::setfill(' ') << getErrorCodes().size()
149  << ") : ";
150  if (getErrorCodes().empty()) {
151  ss << "(none)";
152  } else {
153  VString::const_iterator istr = getErrorCodes().begin();
154  VString::const_iterator jstr = getErrorCodes().end();
155  for (; istr != jstr; ++istr) {
156  ss << *istr << " ";
157  }
158  }
159  ss << std::endl;
160 }
const uint16_t & gain() const
type
Definition: HCALResponse.h:21
const uint32_t & fedKey() const
const uint16_t & fecRing() const
static const char dir_[]
Utility class that holds histogram title.
A container class for generic run and event-related info, information required by the commissioning a...
Definition: SiStripFedKey.h:56
const uint16_t & lldChan() const
const uint16_t & fecSlot() const
sistrip classes
void print(std::stringstream &, uint32_t gain_setting=sistrip::invalid_) override
const uint32_t & key() const
Definition: SiStripKey.h:120
Utility class that identifies a position within the strip tracker control structure, down to the level of an APV25.
Definition: SiStripFecKey.h:45
static std::string runType(const sistrip::RunType &)
static const char baselineRms_[]
static const char optoScanAnalysis_[]
static const float fedAdcGain_
std::vector< float > VFloat
static const char mlCommissioning_[]
void summary(std::stringstream &) const override
static const char controlView_[]
void reset() override
static const uint16_t maximum_
Definition: Constants.h:20
static const char dqmRoot_[]
const uint32_t & fecKey() const
static const char digital_[]
std::vector< uint16_t > VInt
const uint16_t & fecCrate() const
static const uint16_t defaultBiasSetting_
virtual void header(std::stringstream &) const
const uint16_t & ccuAddr() const
static const uint16_t invalid_
Definition: Constants.h:16
static const char gain_[]
const uint16_t & ccuChan() const
Abstract base for derived classes that provide analysis of commissioning histograms.
static const uint16_t defaultGainSetting_
const VString & getErrorCodes() const
const std::string & myName() const
bool isValid() const override