CMS 3D CMS Logo

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

List of all members.

Public Types

typedef std::map< uint32_t,
uint16_t > 
Candidates

Public Member Functions

bool badTrimDac () const
const uint32_t & dcuHardId () const
 FastFedCablingAnalysis ()
 FastFedCablingAnalysis (const uint32_t &key)
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 ()

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)
FastFedCablingAnalysis::FastFedCablingAnalysis ( )
virtual FastFedCablingAnalysis::~FastFedCablingAnalysis ( ) [inline, virtual]

Definition at line 26 of file FastFedCablingAnalysis.h.

{;}

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().

                                              {
  return ( lowMean_ < 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().

                                                               { 
  ss << "[" << myName() << "] Monitorables (65535 means \"invalid\"):" << std::endl;

  //summary(ss);

  SiStripFecKey fec_key( fecKey() );
  if ( fec_key.isValid() ) {
    ss << " Crate/FEC/Ring/CCU/Mod/LLD     : " 
       << fec_key.fecCrate() << "/" 
       << fec_key.fecSlot() << "/" 
       << fec_key.fecRing() << "/" 
       << fec_key.ccuAddr() << "/" 
       << fec_key.ccuChan() << "/" 
       << fec_key.lldChan() 
       << std::endl;
  } else {
    ss << " Crate/FEC/Ring/CCU/Mod/LLD     : (invalid)" 
       << std::endl;
  }

  SiStripFedKey fed_key( fedKey() );
  ss << " FedId/FeUnit/FeChan/FedChannel : " 
     << fed_key.fedId() << "/" 
     << fed_key.feUnit() << "/" 
     << fed_key.feChan() << "/"
     << fed_key.fedChannel()
     << std::endl;
  // if ( fed_key.fedChannel() != sistrip::invalid_ ) { ss << fed_key.fedChannel(); }
  // else { ss << "(invalid)"; }
  // ss << std::endl;
  
  ss << " FecKey/Fedkey (hex)            : 0x" 
     << std::hex 
     << std::setw(8) << std::setfill('0') << fecKey()
     << " / 0x" 
     << std::setw(8) << std::setfill('0') << fedKey()
     << std::dec
     << std::endl;
  
  ss << " DcuId (hex/dec)                : 0x" 
     << std::hex 
     << std::setw(8) << std::setfill('0') << dcuId() 
     << " / "
     << std::dec
     << std::setw(10) << std::setfill(' ') << dcuId() 
     << std::endl;

  ss << " DetId (hex/dec)                : 0x" 
     << std::hex 
     << std::setw(8) << std::setfill('0') << detId() 
     << " / "
     << std::dec
     << std::setw(10) << std::setfill(' ') << detId() 
     << std::endl;
  
}
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().

{ 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().

{ return highRms_; }
bool FastFedCablingAnalysis::isDirty ( ) const
bool FastFedCablingAnalysis::isValid ( void  ) const [virtual]
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().

{ 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().

{ 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().

{ 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().

{ 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().

{ 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().

                                                                           { 
  header( ss );
  ss <<  std::fixed << std::setprecision(2)
     << " DCU id extracted from histo     : 0x" 
     << std::hex
     << std::setw(8) << std::setfill('0') << dcuHardId_ << std::endl
     << std::dec
     << " LLD chan extracted from histo   : " <<  ( lldCh_ > 3 ? sistrip::invalid_ : lldCh_ )  << std::endl
     << " \"High\" level (mean+/-rms) [ADC] : " << highMean_ << " +/- " << highRms_ << std::endl
     << " \"Low\" level (mean+/-rms)  [ADC] : " << lowMean_ << " +/- " << lowRms_ << std::endl
     << " Median \"high\" level       [ADC] : " << highMedian_ << std::endl
     << " Median \"low\" level        [ADC] : " << lowMedian_ << std::endl
     << " Range                     [ADC] : " << range_ << std::endl
     << " Mid-range level           [ADC] : " << midRange_ << std::endl
     << " Maximum level             [ADC] : " << max_ << std::endl
     << " Minimum level             [ADC] : " << min_ << std::endl;
  ss << std::boolalpha
     << " isValid                         : " << isValid()  << std::endl
     << " isDirty                         : " << isDirty()  << std::endl
     << " badTrimDac                      : " << badTrimDac()  << std::endl
     << std::noboolalpha
     << " Error codes (found "  
     << std::setw(2) << std::setfill(' ') << getErrorCodes().size() 
     << ")          : ";
  if ( getErrorCodes().empty() ) { ss << "(none)"; }
  else { 
    VString::const_iterator istr = getErrorCodes().begin();
    VString::const_iterator jstr = getErrorCodes().end();
    for ( ; istr != jstr; ++istr ) { ss << *istr << " "; }
  }
  ss << std::endl;
}
void FastFedCablingAnalysis::reset ( void  ) [virtual]
void FastFedCablingAnalysis::summary ( std::stringstream &  ss) const [virtual]

Friends And Related Function Documentation

friend class FastFedCablingAlgorithm [friend]

Definition at line 30 of file FastFedCablingAnalysis.h.


Member Data Documentation

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().

Definition at line 111 of file FastFedCablingAnalysis.h.

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

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().

Definition at line 120 of file FastFedCablingAnalysis.h.

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

Definition at line 132 of file FastFedCablingAnalysis.h.

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

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().

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().