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_),
46  measGain_(4, sistrip::invalid_),
47  zeroLight_(4, sistrip::invalid_),
48  linkNoise_(4, sistrip::invalid_),
49  liftOff_(4, sistrip::invalid_),
50  threshold_(4, sistrip::invalid_),
51  tickHeight_(4, sistrip::invalid_),
52  baseSlope_(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;
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 }
CommissioningAnalysis::getErrorCodes
const VString & getErrorCodes() const
Definition: CommissioningAnalysis.h:131
SiStripEnumsAndStrings::runType
static std::string runType(const sistrip::RunType &)
Definition: SiStripEnumsAndStrings.cc:39
alignBH_cfg.fixed
fixed
Definition: alignBH_cfg.py:54
OptoScanAnalysis::print
void print(std::stringstream &, uint32_t gain_setting=sistrip::invalid_) override
Definition: OptoScanAnalysis.cc:125
MessageLogger.h
OptoScanAnalysis::liftOff_
VFloat liftOff_
Definition: OptoScanAnalysis.h:100
OptoScanAnalysis::baseSlope_
VFloat baseSlope_
Definition: OptoScanAnalysis.h:109
OptoScanAnalysis::tickHeight_
VFloat tickHeight_
Definition: OptoScanAnalysis.h:106
SiStripKey::key
const uint32_t & key() const
Definition: SiStripKey.h:120
SiStripFecKey::lldChan
const uint16_t & lldChan() const
Definition: SiStripFecKey.h:203
CommissioningAnalysis::fedKey
const uint32_t & fedKey() const
Definition: CommissioningAnalysis.h:134
OptoScanAnalysis::fedAdcGain_
static const float fedAdcGain_
Definition: OptoScanAnalysis.h:79
sistrip::dir_
static const char dir_[]
Definition: ConstantsForDqm.h:17
OptoScanAnalysis::gain
const uint16_t & gain() const
Definition: OptoScanAnalysis.h:114
sistrip::extrainfo::digital_
static const char digital_[]
Definition: ConstantsForDqm.h:40
sistrip::optoScanAnalysis_
static const char optoScanAnalysis_[]
Definition: ConstantsForCommissioningAnalysis.h:51
SiStripFecKey::fecCrate
const uint16_t & fecCrate() const
Definition: SiStripFecKey.h:198
sistrip::RunType
RunType
Definition: ConstantsForRunType.h:70
SiStripFedKey
A container class for generic run and event-related info, information required by the commissioning a...
Definition: SiStripFedKey.h:56
sistrip::extrainfo::baselineRms_
static const char baselineRms_[]
Definition: ConstantsForDqm.h:41
CommissioningAnalysis::VFloat
std::vector< float > VFloat
Definition: CommissioningAnalysis.h:30
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
sistrip::mlCommissioning_
static const char mlCommissioning_[]
Definition: ConstantsForLogger.h:15
CommissioningAnalysis::header
virtual void header(std::stringstream &) const
Definition: CommissioningAnalysis.cc:33
SiStripFecKey::fecRing
const uint16_t & fecRing() const
Definition: SiStripFecKey.h:200
OptoScanAnalysis::measGain_
VFloat measGain_
Definition: OptoScanAnalysis.h:91
sistrip::EXPERT_HISTO
Definition: ConstantsForHistoType.h:29
SiStripFecKey
Utility class that identifies a position within the strip tracker control structure,...
Definition: SiStripFecKey.h:45
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SiStripFecKey::ccuChan
const uint16_t & ccuChan() const
Definition: SiStripFecKey.h:202
edm::LogWarning
Definition: MessageLogger.h:141
OptoScanAnalysis.h
OptoScanAnalysis::OptoScanAnalysis
OptoScanAnalysis()
Definition: OptoScanAnalysis.cc:42
OptoScanAnalysis::zeroLight_
VFloat zeroLight_
Definition: OptoScanAnalysis.h:94
sistrip::extrainfo::gain_
static const char gain_[]
Definition: ConstantsForDqm.h:39
sistrip::maximum_
static const uint16_t maximum_
Definition: Constants.h:20
OptoScanAnalysis::reset
void reset() override
Definition: OptoScanAnalysis.cc:58
sistrip::controlView_
static const char controlView_[]
Definition: ConstantsForView.h:21
OptoScanAnalysis::defaultBiasSetting_
static const uint16_t defaultBiasSetting_
Definition: OptoScanAnalysis.h:76
OptoScanAnalysis::gain_
uint16_t gain_
Definition: OptoScanAnalysis.h:85
sistrip::invalid_
static const uint16_t invalid_
Definition: Constants.h:16
sistrip::dqmRoot_
static const char dqmRoot_[]
Definition: ConstantsForDqm.h:28
OptoScanAnalysis::linkNoise_
VFloat linkNoise_
Definition: OptoScanAnalysis.h:97
CommissioningAnalysis::VInt
std::vector< uint16_t > VInt
Definition: CommissioningAnalysis.h:34
overlapproblemtsosanalyzer_cfi.title
title
Definition: overlapproblemtsosanalyzer_cfi.py:7
PedestalClient_cfi.gain
gain
Definition: PedestalClient_cfi.py:37
CommissioningAnalysis
Abstract base for derived classes that provide analysis of commissioning histograms.
Definition: CommissioningAnalysis.h:18
OptoScanAnalysis::isValid
bool isValid() const override
Definition: OptoScanAnalysis.cc:72
type
type
Definition: HCALResponse.h:21
OptoScanAnalysis::defaultGainSetting_
static const uint16_t defaultGainSetting_
Definition: OptoScanAnalysis.h:73
CommissioningAnalysis::fecKey
const uint32_t & fecKey() const
Definition: CommissioningAnalysis.h:133
OptoScanAnalysis::bias_
VInt bias_
Definition: OptoScanAnalysis.h:88
SiStripEnumsAndStrings.h
relativeConstraints.empty
bool empty
Definition: relativeConstraints.py:46
SiStripFecKey::ccuAddr
const uint16_t & ccuAddr() const
Definition: SiStripFecKey.h:201
SiStripHistoTitle.h
CommissioningAnalysis::myName
const std::string & myName() const
Definition: CommissioningAnalysis.h:139
SiStripHistoTitle
Utility class that holds histogram title.
Definition: SiStripHistoTitle.h:20
OptoScanAnalysis::summary
void summary(std::stringstream &) const override
Definition: OptoScanAnalysis.cc:78
castor_dqm_sourceclient_file_cfg.path
path
Definition: castor_dqm_sourceclient_file_cfg.py:37
sistrip::FED_KEY
Definition: ConstantsForKeyType.h:30
sistrip
sistrip classes
Definition: SiStripQualityHelpers.h:14
SiStripFecKey::fecSlot
const uint16_t & fecSlot() const
Definition: SiStripFecKey.h:199
OptoScanAnalysis::threshold_
VFloat threshold_
Definition: OptoScanAnalysis.h:103
crabWrapper.key
key
Definition: crabWrapper.py:19
sistrip::LLD_CHAN
Definition: ConstantsForGranularity.h:78