CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Static Public Attributes | Private Attributes | Friends
FastFedCablingAnalysis Class Reference

Histogram-based analysis for connection loop. More...

#include <FastFedCablingAnalysis.h>

Inheritance diagram for FastFedCablingAnalysis:
CommissioningAnalysis

Public Types

typedef std::map< uint32_t,
uint16_t > 
Candidates
 
- Public Types inherited from CommissioningAnalysis
typedef std::vector< float > VFloat
 
typedef std::vector< uint16_t > VInt
 
typedef std::vector< std::string > VString
 
typedef std::vector< VFloatVVFloat
 
typedef std::vector< VIntVVInt
 

Public Member Functions

bool badTrimDac () const
 
const uint32_t & dcuHardId () const
 
 FastFedCablingAnalysis (const uint32_t &key)
 
 FastFedCablingAnalysis ()
 
void header (std::stringstream &) const
 
const float & highLevel () const
 
const float & highRms () const
 
bool isDirty () const
 
bool isValid () const
 
const uint16_t & lldCh () const
 
const float & lowLevel () const
 
const float & lowRms () const
 
const float & max () const
 
const float & min () const
 
void print (std::stringstream &, uint32_t not_used=0)
 
void reset ()
 
void summary (std::stringstream &) const
 
virtual ~FastFedCablingAnalysis ()
 
- Public Member Functions inherited from CommissioningAnalysis
virtual void addErrorCode (const std::string &error)
 
 CommissioningAnalysis (const uint32_t &key, const std::string &my_name)
 
 CommissioningAnalysis (const std::string &my_name)
 
const uint32_t & dcuId () const
 
void dcuId (const uint32_t &)
 
const uint32_t & detId () const
 
void detId (const uint32_t &)
 
const uint32_t & fecKey () const
 
void fecKey (const uint32_t &)
 
const uint32_t & fedKey () const
 
void fedKey (const uint32_t &)
 
const VStringgetErrorCodes () const
 
const std::string & myName () const
 
void setErrorCodes (const VString &errors)
 
virtual ~CommissioningAnalysis ()
 

Static Public Attributes

static const float dirtyThreshold_ = 800
 
static const uint16_t nBitsForDcuId_ = 32
 
static const uint16_t nBitsForLldCh_ = 2
 
static const float threshold_ = 100.
 
static const float trimDacThreshold_ = 10
 

Private Attributes

uint32_t dcuHardId_
 
float highMean_
 
float highMedian_
 
float highRms_
 
uint16_t lldCh_
 
float lowMean_
 
float lowMedian_
 
float lowRms_
 
float max_
 
float midRange_
 
float min_
 
float range_
 

Friends

class FastFedCablingAlgorithm
 

Detailed Description

Histogram-based analysis for connection loop.

Author
R.Bainbridge

Definition at line 16 of file FastFedCablingAnalysis.h.

Member Typedef Documentation

typedef std::map<uint32_t,uint16_t> FastFedCablingAnalysis::Candidates

Definition at line 28 of file FastFedCablingAnalysis.h.

Constructor & Destructor Documentation

FastFedCablingAnalysis::FastFedCablingAnalysis ( const uint32_t &  key)

Definition at line 34 of file FastFedCablingAnalysis.cc.

References CommissioningAnalysis::fecKey(), CommissioningAnalysis::fedKey(), sistrip::invalid_, and combine::key.

48 {
55  sistrip::invalid_ ).key() );
56  fedKey( key );
57 }
const uint32_t & fedKey() const
static const uint32_t invalid32_
Definition: Constants.h:16
Utility class that identifies a position within the strip tracker control structure, down to the level of an APV25.
Definition: SiStripFecKey.h:46
static const char fastCablingAnalysis_[]
const uint32_t & fecKey() const
static const uint16_t invalid_
Definition: Constants.h:17
list key
Definition: combine.py:13
FastFedCablingAnalysis::FastFedCablingAnalysis ( )

Definition at line 61 of file FastFedCablingAnalysis.cc.

75 {;}
static const uint32_t invalid32_
Definition: Constants.h:16
static const char fastCablingAnalysis_[]
static const uint16_t invalid_
Definition: Constants.h:17
virtual FastFedCablingAnalysis::~FastFedCablingAnalysis ( )
inlinevirtual

Definition at line 26 of file FastFedCablingAnalysis.h.

26 {;}

Member Function Documentation

bool FastFedCablingAnalysis::badTrimDac ( ) const

Identifies if TrimDAQ setting is valid or not.

Definition at line 120 of file FastFedCablingAnalysis.cc.

References lowMean_, and trimDacThreshold_.

Referenced by FastFedCablingHistosUsingDb::connections(), print(), FastFedCablingHistograms::printAnalyses(), and FastFedCablingHistograms::printSummary().

120  {
121  return ( lowMean_ < trimDacThreshold_ );
122 }
static const float trimDacThreshold_
const uint32_t & FastFedCablingAnalysis::dcuHardId ( ) const
inline
void FastFedCablingAnalysis::header ( std::stringstream &  ss) const
virtual

Header information for analysis print().

Reimplemented from CommissioningAnalysis.

Definition at line 126 of file FastFedCablingAnalysis.cc.

References SiStripFecKey::ccuAddr(), SiStripFecKey::ccuChan(), CommissioningAnalysis::dcuId(), CommissioningAnalysis::detId(), SiStripFecKey::fecCrate(), SiStripFedKey::feChan(), CommissioningAnalysis::fecKey(), SiStripFecKey::fecRing(), SiStripFecKey::fecSlot(), SiStripFedKey::fedChannel(), SiStripFedKey::fedId(), CommissioningAnalysis::fedKey(), SiStripFedKey::feUnit(), SiStripFecKey::isValid(), SiStripFecKey::lldChan(), and CommissioningAnalysis::myName().

Referenced by print().

126  {
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 }
const uint32_t & fedKey() const
A container class for generic run and event-related info, information required by the commissioning a...
Definition: SiStripFedKey.h:57
Utility class that identifies a position within the strip tracker control structure, down to the level of an APV25.
Definition: SiStripFecKey.h:46
const uint32_t & dcuId() const
const uint32_t & fecKey() const
const uint32_t & detId() const
const std::string & myName() const
const float & FastFedCablingAnalysis::highLevel ( ) const
inline

"High" light level [ADC].

Definition at line 146 of file FastFedCablingAnalysis.h.

References highMean_.

Referenced by FastFedCablingHistosUsingDb::create(), and FastFedCablingSummaryFactory::extract().

146 { return highMean_; }
const float & FastFedCablingAnalysis::highRms ( ) const
inline

Spread in "high" ligh level [ADC].

Definition at line 147 of file FastFedCablingAnalysis.h.

References highRms_.

Referenced by FastFedCablingHistosUsingDb::create(), and FastFedCablingSummaryFactory::extract().

147 { return highRms_; }
bool FastFedCablingAnalysis::isDirty ( ) const
bool FastFedCablingAnalysis::isValid ( void  ) const
virtual

Identifies if analysis is valid or not.

Reimplemented from CommissioningAnalysis.

Definition at line 96 of file FastFedCablingAnalysis.cc.

References dcuHardId_, relativeConstraints::empty, CommissioningAnalysis::getErrorCodes(), highMean_, highMedian_, highRms_, sistrip::invalid32_, lldCh_, lowMean_, lowMedian_, lowRms_, max_, midRange_, min_, range_, and sistrip::valid_.

Referenced by FastFedCablingHistosUsingDb::connections(), FastFedCablingHistosUsingDb::create(), FastFedCablingSummaryFactory::extract(), FastFedCablingHistograms::histoAnalysis(), print(), FastFedCablingHistograms::printAnalyses(), FastFedCablingHistograms::printSummary(), summary(), and FastFedCablingHistosUsingDb::update().

96  {
97  return ( dcuHardId_ < sistrip::invalid32_ &&
105  range_ < sistrip::valid_ &&
107  max_ < sistrip::valid_ &&
108  min_ < sistrip::valid_ &&
109  getErrorCodes().empty() );
110 }
static const uint32_t invalid32_
Definition: Constants.h:16
static const uint16_t valid_
Definition: Constants.h:18
const VString & getErrorCodes() const
const uint16_t & FastFedCablingAnalysis::lldCh ( ) const
inline

Linear Laser Driver channel.

Definition at line 145 of file FastFedCablingAnalysis.h.

References lldCh_.

Referenced by FastFedCablingHistosUsingDb::addDcuDetIds(), FastFedCablingHistosUsingDb::create(), and FastFedCablingHistosUsingDb::update().

145 { return lldCh_; }
const float & FastFedCablingAnalysis::lowLevel ( ) const
inline

"Low" light level [ADC].

Definition at line 148 of file FastFedCablingAnalysis.h.

References lowMean_.

Referenced by FastFedCablingHistosUsingDb::create(), and FastFedCablingSummaryFactory::extract().

148 { return lowMean_; }
const float & FastFedCablingAnalysis::lowRms ( ) const
inline

Spread in "low" ligh level [ADC].

Definition at line 149 of file FastFedCablingAnalysis.h.

References lowRms_.

Referenced by FastFedCablingHistosUsingDb::create(), and FastFedCablingSummaryFactory::extract().

149 { return lowRms_; }
const float & FastFedCablingAnalysis::max ( ) const
inline

Maximum light level in data [ADC].

Definition at line 150 of file FastFedCablingAnalysis.h.

References max_.

Referenced by FastFedCablingHistosUsingDb::create(), and FastFedCablingSummaryFactory::extract().

150 { return max_; }
const float & FastFedCablingAnalysis::min ( ) const
inline

Minimum light level in data [ADC].

Definition at line 151 of file FastFedCablingAnalysis.h.

References min_.

Referenced by FastFedCablingHistosUsingDb::create(), and FastFedCablingSummaryFactory::extract().

151 { return min_; }
void FastFedCablingAnalysis::print ( std::stringstream &  ss,
uint32_t  not_used = 0 
)
virtual

Prints analysis results.

Implements CommissioningAnalysis.

Definition at line 218 of file FastFedCablingAnalysis.cc.

References badTrimDac(), dcuHardId_, relativeConstraints::empty, CommissioningAnalysis::getErrorCodes(), header(), highMean_, highMedian_, highRms_, sistrip::invalid_, isDirty(), isValid(), lldCh_, lowMean_, lowMedian_, lowRms_, max_, midRange_, min_, and range_.

Referenced by FastFedCablingHistograms::printAnalyses().

218  {
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 header(std::stringstream &) const
static const uint16_t invalid_
Definition: Constants.h:17
const VString & getErrorCodes() const
void FastFedCablingAnalysis::reset ( void  )
virtual

Resets analysis member data.

Implements CommissioningAnalysis.

Definition at line 79 of file FastFedCablingAnalysis.cc.

References dcuHardId_, highMean_, highMedian_, highRms_, sistrip::invalid32_, sistrip::invalid_, lldCh_, lowMean_, lowMedian_, lowRms_, max_, midRange_, min_, and range_.

Referenced by MatrixReader.MatrixReader::__init__(), BeautifulSoup.BeautifulStoneSoup::__init__(), and MatrixReader.MatrixReader::showRaw().

79  {
91  min_ = 1.*sistrip::invalid_;
92 }
static const uint32_t invalid32_
Definition: Constants.h:16
static const uint16_t invalid_
Definition: Constants.h:17
void FastFedCablingAnalysis::summary ( std::stringstream &  ss) const
virtual

Overrides base method.

Reimplemented from CommissioningAnalysis.

Definition at line 185 of file FastFedCablingAnalysis.cc.

References sistrip::dir_, sistrip::dqmRoot_, sistrip::EXPERT_HISTO, SiStripFedKey::feChan(), CommissioningAnalysis::fecKey(), sistrip::FED_KEY, SiStripFedKey::fedId(), CommissioningAnalysis::fedKey(), SiStripFedKey::feUnit(), isValid(), SiStripKey::key(), sistrip::LLD_CHAN, SiStripFecKey::lldChan(), CommissioningAnalysis::myName(), SiStripKey::path(), sistrip::readoutView_, SiStripEnumsAndStrings::runType(), and indexGen::title.

Referenced by FastFedCablingHistograms::printSummary().

185  {
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 }
type
Definition: HCALResponse.h:22
const uint32_t & fedKey() 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:57
Utility class that identifies a position within the strip tracker control structure, down to the level of an APV25.
Definition: SiStripFecKey.h:46
static std::string runType(const sistrip::RunType &)
static const char dqmRoot_[]
const uint32_t & fecKey() const
const std::string & myName() const
static const char readoutView_[]

Friends And Related Function Documentation

friend class FastFedCablingAlgorithm
friend

Definition at line 30 of file FastFedCablingAnalysis.h.

Member Data Documentation

uint32_t FastFedCablingAnalysis::dcuHardId_
private

Extracted DCU id.

Definition at line 105 of file FastFedCablingAnalysis.h.

Referenced by FastFedCablingAlgorithm::analyse(), dcuHardId(), isValid(), print(), and reset().

const float FastFedCablingAnalysis::dirtyThreshold_ = 800
static

Level [ADC] below which fibre is defined as "dirty".

Definition at line 89 of file FastFedCablingAnalysis.h.

Referenced by FastFedCablingHistosUsingDb::create(), and isDirty().

float FastFedCablingAnalysis::highMean_
private
float FastFedCablingAnalysis::highMedian_
private

Definition at line 111 of file FastFedCablingAnalysis.h.

Referenced by FastFedCablingAlgorithm::analyse(), isValid(), print(), and reset().

float FastFedCablingAnalysis::highRms_
private
uint16_t FastFedCablingAnalysis::lldCh_
private

Extracted LLD channel.

Definition at line 108 of file FastFedCablingAnalysis.h.

Referenced by FastFedCablingAlgorithm::analyse(), isValid(), lldCh(), print(), and reset().

float FastFedCablingAnalysis::lowMean_
private
float FastFedCablingAnalysis::lowMedian_
private

Definition at line 120 of file FastFedCablingAnalysis.h.

Referenced by FastFedCablingAlgorithm::analyse(), isValid(), print(), and reset().

float FastFedCablingAnalysis::lowRms_
private
float FastFedCablingAnalysis::max_
private
float FastFedCablingAnalysis::midRange_
private

Definition at line 132 of file FastFedCablingAnalysis.h.

Referenced by FastFedCablingAlgorithm::analyse(), isValid(), print(), and reset().

float FastFedCablingAnalysis::min_
private
const uint16_t FastFedCablingAnalysis::nBitsForDcuId_ = 32
static

Definition at line 95 of file FastFedCablingAnalysis.h.

Referenced by FastFedCablingAlgorithm::analyse().

const uint16_t FastFedCablingAnalysis::nBitsForLldCh_ = 2
static

Definition at line 98 of file FastFedCablingAnalysis.h.

Referenced by FastFedCablingAlgorithm::analyse().

float FastFedCablingAnalysis::range_
private

Definition at line 129 of file FastFedCablingAnalysis.h.

Referenced by FastFedCablingAlgorithm::analyse(), isValid(), print(), and reset().

const float FastFedCablingAnalysis::threshold_ = 100.
static

Threshold to identify digital high from digital low.

Definition at line 86 of file FastFedCablingAnalysis.h.

Referenced by FastFedCablingAlgorithm::analyse(), and FastFedCablingHistosUsingDb::create().

const float FastFedCablingAnalysis::trimDacThreshold_ = 10
static

Level [ADC] below which TrimDAC setting is defined as "bad".

Definition at line 92 of file FastFedCablingAnalysis.h.

Referenced by badTrimDac().