CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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_)
48 {
55  sistrip::invalid_ ).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 //
91  min_ = 1.*sistrip::invalid_;
92 }
93 
94 // ----------------------------------------------------------------------------
95 //
97  return ( dcuHardId_ < sistrip::invalid32_ &&
105  range_ < sistrip::valid_ &&
107  max_ < sistrip::valid_ &&
108  min_ < sistrip::valid_ &&
109  getErrorCodes().empty() );
110 }
111 
112 // ----------------------------------------------------------------------------
113 //
115  return ( highMean_ < dirtyThreshold_ );
116 }
117 
118 // ----------------------------------------------------------------------------
119 //
121  return ( lowMean_ < trimDacThreshold_ );
122 }
123 
124 // ----------------------------------------------------------------------------
125 //
126 void FastFedCablingAnalysis::header( std::stringstream& ss ) const {
127  ss << "[" << myName() << "] Monitorables (65535 means \"invalid\"):" << std::endl;
128 
129  //summary(ss);
130 
131  SiStripFecKey fec_key( fecKey() );
132  if ( fec_key.isValid() ) {
133  ss << " Crate/FEC/Ring/CCU/Mod/LLD : "
134  << fec_key.fecCrate() << "/"
135  << fec_key.fecSlot() << "/"
136  << fec_key.fecRing() << "/"
137  << fec_key.ccuAddr() << "/"
138  << fec_key.ccuChan() << "/"
139  << fec_key.lldChan()
140  << std::endl;
141  } else {
142  ss << " Crate/FEC/Ring/CCU/Mod/LLD : (invalid)"
143  << std::endl;
144  }
145 
146  SiStripFedKey fed_key( fedKey() );
147  ss << " FedId/FeUnit/FeChan/FedChannel : "
148  << fed_key.fedId() << "/"
149  << fed_key.feUnit() << "/"
150  << fed_key.feChan() << "/"
151  << fed_key.fedChannel()
152  << std::endl;
153  // if ( fed_key.fedChannel() != sistrip::invalid_ ) { ss << fed_key.fedChannel(); }
154  // else { ss << "(invalid)"; }
155  // ss << std::endl;
156 
157  ss << " FecKey/Fedkey (hex) : 0x"
158  << std::hex
159  << std::setw(8) << std::setfill('0') << fecKey()
160  << " / 0x"
161  << std::setw(8) << std::setfill('0') << fedKey()
162  << std::dec
163  << std::endl;
164 
165  ss << " DcuId (hex/dec) : 0x"
166  << std::hex
167  << std::setw(8) << std::setfill('0') << dcuId()
168  << " / "
169  << std::dec
170  << std::setw(10) << std::setfill(' ') << dcuId()
171  << std::endl;
172 
173  ss << " DetId (hex/dec) : 0x"
174  << std::hex
175  << std::setw(8) << std::setfill('0') << detId()
176  << " / "
177  << std::dec
178  << std::setw(10) << std::setfill(' ') << detId()
179  << std::endl;
180 
181 }
182 
183 // ----------------------------------------------------------------------------
184 //
185 void FastFedCablingAnalysis::summary( std::stringstream& ss ) const {
186 
187  SiStripFecKey fec_key( fecKey() );
188  SiStripFedKey fed_key( fedKey() );
189 
192  type,
194  fed_key.key(),
196  fec_key.lldChan() ).title();
197 
198  ss << " Summary"
199  << ":"
200  << ( isValid() ? "Valid" : "Invalid" )
201  << ":"
202  << sistrip::readoutView_ << ":"
203  << fed_key.fedId() << "/"
204  << fed_key.feUnit() << "/"
205  << fed_key.feChan()
206  << ":"
208  << "Collate" << sistrip::dir_
209  << fed_key.path()
210  << ":"
211  << title
212  << std::endl;
213 
214 }
215 
216 // ----------------------------------------------------------------------------
217 //
218 void FastFedCablingAnalysis::print( std::stringstream& ss, uint32_t not_used ) {
219  header( ss );
220  ss << std::fixed << std::setprecision(2)
221  << " DCU id extracted from histo : 0x"
222  << std::hex
223  << std::setw(8) << std::setfill('0') << dcuHardId_ << std::endl
224  << std::dec
225  << " LLD chan extracted from histo : " << ( lldCh_ > 3 ? sistrip::invalid_ : lldCh_ ) << std::endl
226  << " \"High\" level (mean+/-rms) [ADC] : " << highMean_ << " +/- " << highRms_ << std::endl
227  << " \"Low\" level (mean+/-rms) [ADC] : " << lowMean_ << " +/- " << lowRms_ << std::endl
228  << " Median \"high\" level [ADC] : " << highMedian_ << std::endl
229  << " Median \"low\" level [ADC] : " << lowMedian_ << std::endl
230  << " Range [ADC] : " << range_ << std::endl
231  << " Mid-range level [ADC] : " << midRange_ << std::endl
232  << " Maximum level [ADC] : " << max_ << std::endl
233  << " Minimum level [ADC] : " << min_ << std::endl;
234  ss << std::boolalpha
235  << " isValid : " << isValid() << std::endl
236  << " isDirty : " << isDirty() << std::endl
237  << " badTrimDac : " << badTrimDac() << std::endl
238  << std::noboolalpha
239  << " Error codes (found "
240  << std::setw(2) << std::setfill(' ') << getErrorCodes().size()
241  << ") : ";
242  if ( getErrorCodes().empty() ) { ss << "(none)"; }
243  else {
244  VString::const_iterator istr = getErrorCodes().begin();
245  VString::const_iterator jstr = getErrorCodes().end();
246  for ( ; istr != jstr; ++istr ) { ss << *istr << " "; }
247  }
248  ss << std::endl;
249 }
void summary(std::stringstream &) 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
static const uint32_t invalid32_
Definition: Constants.h:15
static const float dirtyThreshold_
static const uint16_t nBitsForDcuId_
const uint16_t & lldChan() const
const uint16_t & fecSlot() const
static const uint16_t valid_
Definition: Constants.h:17
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 header(std::stringstream &) const
static std::string runType(const sistrip::RunType &)
static const char fastCablingAnalysis_[]
const uint32_t & dcuId() const
void print(std::stringstream &, uint32_t not_used=0)
static const char dqmRoot_[]
const uint32_t & fecKey() const
const std::string & path() const
Definition: SiStripKey.h:126
uint16_t fedChannel() const
const uint16_t & fecCrate() const
const uint16_t & feUnit() const
const uint16_t & ccuAddr() const
static const uint16_t invalid_
Definition: Constants.h:16
bool isValid() const
const uint16_t & feChan() const
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_