CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FedCablingAnalysis.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 FedCablingAnalysis::threshold_ = 100.; // [ADC]
15 
16 // ----------------------------------------------------------------------------
17 //
20  fedId_(sistrip::invalid_),
21  fedCh_(sistrip::invalid_),
22  adcLevel_(1.*sistrip::invalid_),
23  candidates_()
24 {;}
25 
26 // ----------------------------------------------------------------------------
27 //
30  fedId_(sistrip::invalid_),
31  fedCh_(sistrip::invalid_),
32  adcLevel_(1.*sistrip::invalid_),
33  candidates_()
34 {;}
35 
36 // ----------------------------------------------------------------------------
37 //
42  candidates_.clear();
43 }
44 
45 // ----------------------------------------------------------------------------
46 //
48  return ( fedId_ < sistrip::maximum_ &&
51  !candidates_.empty() &&
52  getErrorCodes().empty() );
53 }
54 
55 // ----------------------------------------------------------------------------
56 //
57 void FedCablingAnalysis::print( std::stringstream& ss, uint32_t not_used ) {
58  header( ss );
59  ss << std::fixed << std::setprecision(2)
60  << " Connected FED id : " << fedId_ << std::endl
61  << " Connected FED channel : " << fedCh_ << std::endl
62  << " Signal level [ADC] : " << adcLevel_ << std::endl;
63  ss << " nCandidates : " << candidates_.size() << std::endl
64  << " FedId/FedChannel/ADC) : ";
65  if ( candidates_.empty() ) { ss << "(none)"; }
66  else {
67  Candidates::const_iterator iter;
68  for ( iter = candidates_.begin(); iter != candidates_.end(); iter++ ) {
69  SiStripFedKey path( iter->first );
70  ss << path.fedId() << "/"
71  << path.fedChannel() << "/"
72  << iter->second << " ";
73  }
74  }
75  ss << std::endl;
76  ss << std::boolalpha
77  << " isValid : " << isValid() << std::endl
78  << std::noboolalpha
79  << " Error codes (found "
80  << std::setw(2) << std::setfill(' ') << getErrorCodes().size()
81  << ") : ";
82  if ( getErrorCodes().empty() ) { ss << "(none)"; }
83  else {
84  VString::const_iterator istr = getErrorCodes().begin();
85  VString::const_iterator jstr = getErrorCodes().end();
86  for ( ; istr != jstr; ++istr ) { ss << *istr << " "; }
87  }
88  ss << std::endl;
89 }
A container class for generic run and event-related info, information required by the commissioning a...
Definition: SiStripFedKey.h:57
static const char fedCablingAnalysis_[]
static const float threshold_
list path
Definition: scaleCards.py:51
static const uint16_t maximum_
Definition: Constants.h:21
uint16_t fedChannel() const
virtual void header(std::stringstream &) const
static const uint16_t invalid_
Definition: Constants.h:17
list key
Definition: combine.py:13
const uint16_t & fedId() const
Abstract base for derived classes that provide analysis of commissioning histograms.
const VString & getErrorCodes() const
void print(std::stringstream &, uint32_t not_used=0)