CMS 3D CMS Logo

FastFedCablingAnalysis.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 //
14 const float FastFedCablingAnalysis::threshold_ = 100.; // [ADC]
15 
16 // ----------------------------------------------------------------------------
17 //
18 const float FastFedCablingAnalysis::dirtyThreshold_ = 800; // [ADC]
19 
20 // ----------------------------------------------------------------------------
21 //
22 const float FastFedCablingAnalysis::trimDacThreshold_ = 10; // [ADC]
23 
24 // ----------------------------------------------------------------------------
25 //
26 const uint16_t FastFedCablingAnalysis::nBitsForDcuId_ = 32;
27 
28 // ----------------------------------------------------------------------------
29 //
31 
32 // ----------------------------------------------------------------------------
33 //
36  dcuHardId_(sistrip::invalid32_),
37  lldCh_(sistrip::invalid_),
38  highMedian_(1. * sistrip::invalid_),
39  highMean_(1. * sistrip::invalid_),
40  highRms_(1. * sistrip::invalid_),
41  lowMedian_(1. * sistrip::invalid_),
42  lowMean_(1. * sistrip::invalid_),
43  lowRms_(1. * sistrip::invalid_),
44  range_(1. * sistrip::invalid_),
45  midRange_(1. * sistrip::invalid_),
46  max_(1. * sistrip::invalid_),
47  min_(1. * sistrip::invalid_) {
55  .key());
56  fedKey(key);
57 }
58 
59 // ----------------------------------------------------------------------------
60 //
63  dcuHardId_(sistrip::invalid32_),
64  lldCh_(sistrip::invalid_),
65  highMedian_(1. * sistrip::invalid_),
66  highMean_(1. * sistrip::invalid_),
67  highRms_(1. * sistrip::invalid_),
68  lowMedian_(1. * sistrip::invalid_),
69  lowMean_(1. * sistrip::invalid_),
70  lowRms_(1. * sistrip::invalid_),
71  range_(1. * sistrip::invalid_),
72  midRange_(1. * sistrip::invalid_),
73  max_(1. * sistrip::invalid_),
74  min_(1. * sistrip::invalid_) {
75  ;
76 }
77 
78 // ----------------------------------------------------------------------------
79 //
91  max_ = 1. * sistrip::invalid_;
92  min_ = 1. * sistrip::invalid_;
93 }
94 
95 // ----------------------------------------------------------------------------
96 //
102 }
103 
104 // ----------------------------------------------------------------------------
105 //
107 
108 // ----------------------------------------------------------------------------
109 //
111 
112 // ----------------------------------------------------------------------------
113 //
114 void FastFedCablingAnalysis::header(std::stringstream& ss) const {
115  ss << "[" << myName() << "] Monitorables (65535 means \"invalid\"):" << std::endl;
116 
117  //summary(ss);
118 
119  SiStripFecKey fec_key(fecKey());
120  if (fec_key.isValid()) {
121  ss << " Crate/FEC/Ring/CCU/Mod/LLD : " << fec_key.fecCrate() << "/" << fec_key.fecSlot() << "/"
122  << fec_key.fecRing() << "/" << fec_key.ccuAddr() << "/" << fec_key.ccuChan() << "/" << fec_key.lldChan()
123  << std::endl;
124  } else {
125  ss << " Crate/FEC/Ring/CCU/Mod/LLD : (invalid)" << std::endl;
126  }
127 
128  SiStripFedKey fed_key(fedKey());
129  ss << " FedId/FeUnit/FeChan/FedChannel : " << fed_key.fedId() << "/" << fed_key.feUnit() << "/" << fed_key.feChan()
130  << "/" << fed_key.fedChannel() << std::endl;
131  // if ( fed_key.fedChannel() != sistrip::invalid_ ) { ss << fed_key.fedChannel(); }
132  // else { ss << "(invalid)"; }
133  // ss << std::endl;
134 
135  ss << " FecKey/Fedkey (hex) : 0x" << std::hex << std::setw(8) << std::setfill('0') << fecKey() << " / 0x"
136  << std::setw(8) << std::setfill('0') << fedKey() << std::dec << std::endl;
137 
138  ss << " DcuId (hex/dec) : 0x" << std::hex << std::setw(8) << std::setfill('0') << dcuId() << " / "
139  << std::dec << std::setw(10) << std::setfill(' ') << dcuId() << std::endl;
140 
141  ss << " DetId (hex/dec) : 0x" << std::hex << std::setw(8) << std::setfill('0') << detId() << " / "
142  << std::dec << std::setw(10) << std::setfill(' ') << detId() << std::endl;
143 }
144 
145 // ----------------------------------------------------------------------------
146 //
147 void FastFedCablingAnalysis::summary(std::stringstream& ss) const {
148  SiStripFecKey fec_key(fecKey());
149  SiStripFedKey fed_key(fedKey());
150 
155  .title();
156 
157  ss << " Summary"
158  << ":" << (isValid() ? "Valid" : "Invalid") << ":" << sistrip::readoutView_ << ":" << fed_key.fedId() << "/"
159  << fed_key.feUnit() << "/" << fed_key.feChan() << ":" << sistrip::dqmRoot_ << sistrip::dir_ << "Collate"
160  << sistrip::dir_ << fed_key.path() << ":" << title << std::endl;
161 }
162 
163 // ----------------------------------------------------------------------------
164 //
165 void FastFedCablingAnalysis::print(std::stringstream& ss, uint32_t not_used) {
166  header(ss);
167  ss << std::fixed << std::setprecision(2) << " DCU id extracted from histo : 0x" << std::hex << std::setw(8)
168  << std::setfill('0') << dcuHardId_ << std::endl
169  << std::dec << " LLD chan extracted from histo : " << (lldCh_ > 3 ? sistrip::invalid_ : lldCh_) << std::endl
170  << " \"High\" level (mean+/-rms) [ADC] : " << highMean_ << " +/- " << highRms_ << std::endl
171  << " \"Low\" level (mean+/-rms) [ADC] : " << lowMean_ << " +/- " << lowRms_ << std::endl
172  << " Median \"high\" level [ADC] : " << highMedian_ << std::endl
173  << " Median \"low\" level [ADC] : " << lowMedian_ << std::endl
174  << " Range [ADC] : " << range_ << std::endl
175  << " Mid-range level [ADC] : " << midRange_ << std::endl
176  << " Maximum level [ADC] : " << max_ << std::endl
177  << " Minimum level [ADC] : " << min_ << std::endl;
178  ss << std::boolalpha << " isValid : " << isValid() << std::endl
179  << " isDirty : " << isDirty() << std::endl
180  << " badTrimDac : " << badTrimDac() << std::endl
181  << std::noboolalpha << " Error codes (found " << std::setw(2) << std::setfill(' ') << getErrorCodes().size()
182  << ") : ";
183  if (getErrorCodes().empty()) {
184  ss << "(none)";
185  } else {
186  VString::const_iterator istr = getErrorCodes().begin();
187  VString::const_iterator jstr = getErrorCodes().end();
188  for (; istr != jstr; ++istr) {
189  ss << *istr << " ";
190  }
191  }
192  ss << std::endl;
193 }
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
runGCPTkAlMap.title
string title
Definition: runGCPTkAlMap.py:94
FastFedCablingAnalysis::dcuHardId_
uint32_t dcuHardId_
Definition: FastFedCablingAnalysis.h:101
FastFedCablingAnalysis::lowMean_
float lowMean_
Definition: FastFedCablingAnalysis.h:119
MessageLogger.h
FastFedCablingAnalysis::range_
float range_
Definition: FastFedCablingAnalysis.h:125
sistrip::invalid32_
static const uint32_t invalid32_
Definition: Constants.h:15
FastFedCablingAnalysis::lldCh_
uint16_t lldCh_
Definition: FastFedCablingAnalysis.h:104
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
sistrip::dir_
static const char dir_[]
Definition: ConstantsForDqm.h:17
FastFedCablingAnalysis::highMedian_
float highMedian_
Definition: FastFedCablingAnalysis.h:107
CommissioningAnalysis::dcuId
const uint32_t & dcuId() const
Definition: CommissioningAnalysis.h:136
FastFedCablingAnalysis::highRms_
float highRms_
Definition: FastFedCablingAnalysis.h:113
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
FastFedCablingAnalysis::lowRms_
float lowRms_
Definition: FastFedCablingAnalysis.h:122
FastFedCablingAnalysis::FastFedCablingAnalysis
FastFedCablingAnalysis()
Definition: FastFedCablingAnalysis.cc:61
FastFedCablingAnalysis::trimDacThreshold_
static const float trimDacThreshold_
Definition: FastFedCablingAnalysis.h:89
sistrip::valid_
static const uint16_t valid_
Definition: Constants.h:17
FastFedCablingAnalysis::lowMedian_
float lowMedian_
Definition: FastFedCablingAnalysis.h:116
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
FastFedCablingAnalysis::threshold_
static const float threshold_
Definition: FastFedCablingAnalysis.h:83
FastFedCablingAnalysis::summary
void summary(std::stringstream &) const override
Definition: FastFedCablingAnalysis.cc:147
SiStripFecKey::fecRing
const uint16_t & fecRing() const
Definition: SiStripFecKey.h:200
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
FastFedCablingAnalysis::highMean_
float highMean_
Definition: FastFedCablingAnalysis.h:110
SiStripKey::path
const std::string & path() const
Definition: SiStripKey.h:121
sistrip::fastCablingAnalysis_
static const char fastCablingAnalysis_[]
Definition: ConstantsForCommissioningAnalysis.h:26
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
FastFedCablingAnalysis::badTrimDac
bool badTrimDac() const
Definition: FastFedCablingAnalysis.cc:110
CommissioningAnalysis::detId
const uint32_t & detId() const
Definition: CommissioningAnalysis.h:137
FastFedCablingAnalysis::header
void header(std::stringstream &) const override
Definition: FastFedCablingAnalysis.cc:114
FastFedCablingAnalysis::nBitsForDcuId_
static const uint16_t nBitsForDcuId_
Definition: FastFedCablingAnalysis.h:92
FastFedCablingAnalysis::reset
void reset() override
Definition: FastFedCablingAnalysis.cc:80
SiStripFedKey::feUnit
const uint16_t & feUnit() const
Definition: SiStripFedKey.h:189
FastFedCablingAnalysis::nBitsForLldCh_
static const uint16_t nBitsForLldCh_
Definition: FastFedCablingAnalysis.h:95
sistrip::invalid_
static const uint16_t invalid_
Definition: Constants.h:16
sistrip::dqmRoot_
static const char dqmRoot_[]
Definition: ConstantsForDqm.h:28
CommissioningAnalysis
Abstract base for derived classes that provide analysis of commissioning histograms.
Definition: CommissioningAnalysis.h:18
FastFedCablingAnalysis::max_
float max_
Definition: FastFedCablingAnalysis.h:131
FastFedCablingAnalysis::isDirty
bool isDirty() const
Definition: FastFedCablingAnalysis.cc:106
SiStripFedKey::fedChannel
uint16_t fedChannel() const
Definition: SiStripFedKey.h:192
CommissioningAnalysis::fecKey
const uint32_t & fecKey() const
Definition: CommissioningAnalysis.h:133
FastFedCablingAnalysis::min_
float min_
Definition: FastFedCablingAnalysis.h:134
SiStripEnumsAndStrings.h
relativeConstraints.empty
bool empty
Definition: relativeConstraints.py:46
FastFedCablingAnalysis::print
void print(std::stringstream &, uint32_t not_used=0) override
Definition: FastFedCablingAnalysis.cc:165
SiStripFecKey::ccuAddr
const uint16_t & ccuAddr() const
Definition: SiStripFecKey.h:201
SiStripHistoTitle.h
FastFedCablingAnalysis::dirtyThreshold_
static const float dirtyThreshold_
Definition: FastFedCablingAnalysis.h:86
FastFedCablingAnalysis::midRange_
float midRange_
Definition: FastFedCablingAnalysis.h:128
CommissioningAnalysis::myName
const std::string & myName() const
Definition: CommissioningAnalysis.h:139
SiStripHistoTitle
Utility class that holds histogram title.
Definition: SiStripHistoTitle.h:20
sistrip::readoutView_
static const char readoutView_[]
Definition: ConstantsForView.h:20
sistrip::FED_KEY
Definition: ConstantsForKeyType.h:30
sistrip
sistrip classes
Definition: SiStripQualityHelpers.h:14
FastFedCablingAnalysis.h
SiStripFecKey::fecSlot
const uint16_t & fecSlot() const
Definition: SiStripFecKey.h:199
crabWrapper.key
key
Definition: crabWrapper.py:19
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
sistrip::LLD_CHAN
Definition: ConstantsForGranularity.h:78
SiStripFedKey::fedId
const uint16_t & fedId() const
Definition: SiStripFedKey.h:188
SiStripFedKey::feChan
const uint16_t & feChan() const
Definition: SiStripFedKey.h:190
FastFedCablingAnalysis::isValid
bool isValid() const override
Definition: FastFedCablingAnalysis.cc:97
SiStripFecKey::isValid
bool isValid() const override
Definition: SiStripFecKey.cc:244