CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 }
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
void print(std::stringstream &, uint32_t not_used=0) override
static const uint32_t invalid32_
Definition: Constants.h:15
static const float dirtyThreshold_
static const uint16_t nBitsForDcuId_
const uint16_t & lldChan() const
void header(std::stringstream &) const override
const uint16_t & fecSlot() const
static const uint16_t valid_
Definition: Constants.h:17
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 &)
bool isValid() const override
static const char fastCablingAnalysis_[]
const uint32_t & dcuId() const
tuple key
prepare the HTCondor submission files and eventually submit them
static const char dqmRoot_[]
const uint32_t & fecKey() const
const std::string & path() const
Definition: SiStripKey.h:121
uint16_t fedChannel() const
const uint16_t & fecCrate() const
bool isValid() const override
const uint16_t & feUnit() const
const uint16_t & ccuAddr() const
static const uint16_t invalid_
Definition: Constants.h:16
const uint16_t & feChan() const
void summary(std::stringstream &) const override
const uint32_t & detId() const
const uint16_t & ccuChan() const
const uint16_t & fedId() const
Abstract base for derived classes that provide analysis of commissioning histograms.
const VString & getErrorCodes() const
const std::string & myName() const
static const char readoutView_[]
static const float trimDacThreshold_
static const float threshold_
static const uint16_t nBitsForLldCh_