CMS 3D CMS Logo

Public Member Functions | Static Public Attributes | Private Attributes | Friends

OptoScanAnalysis Class Reference

Histogram-based analysis for opto bias/gain scan. More...

#include <OptoScanAnalysis.h>

Inheritance diagram for OptoScanAnalysis:
CommissioningAnalysis

List of all members.

Public Member Functions

const VFloatbaseSlope () const
const VIntbias () const
const uint16_t & gain () const
bool isValid () const
const VFloatliftOff () const
const VFloatlinkNoise () const
const VFloatmeasGain () const
 OptoScanAnalysis ()
 OptoScanAnalysis (const uint32_t &key)
void print (std::stringstream &, uint32_t gain_setting=sistrip::invalid_)
void reset ()
void summary (std::stringstream &) const
const VFloatthreshold () const
const VFloattickHeight () const
const VFloatzeroLight () const
virtual ~OptoScanAnalysis ()

Static Public Attributes

static const uint16_t defaultBiasSetting_ = sistrip::invalid_
static const uint16_t defaultGainSetting_ = sistrip::invalid_
static const float fedAdcGain_ = 1.024 / 1024.

Private Attributes

VFloat baseSlope_
VInt bias_
uint16_t gain_
VFloat liftOff_
VFloat linkNoise_
VFloat measGain_
VFloat threshold_
VFloat tickHeight_
VFloat zeroLight_

Friends

class OptoScanAlgorithm

Detailed Description

Histogram-based analysis for opto bias/gain scan.

Author:
M. Wingham, R.Bainbridge

Definition at line 15 of file OptoScanAnalysis.h.


Constructor & Destructor Documentation

OptoScanAnalysis::OptoScanAnalysis ( const uint32_t &  key)
OptoScanAnalysis::OptoScanAnalysis ( )
virtual OptoScanAnalysis::~OptoScanAnalysis ( ) [inline, virtual]

Definition at line 25 of file OptoScanAnalysis.h.

{;}

Member Function Documentation

const OptoScanAnalysis::VFloat & OptoScanAnalysis::baseSlope ( ) const [inline]

Baseline slope [ADC/I2C]

Definition at line 126 of file OptoScanAnalysis.h.

References baseSlope_.

Referenced by OptoScanHistosUsingDb::create().

{ return baseSlope_; }
const OptoScanAnalysis::VInt & OptoScanAnalysis::bias ( ) const [inline]

LLD bias value for each gain setting

Definition at line 119 of file OptoScanAnalysis.h.

References bias_.

Referenced by OptoScanHistosUsingDb::create(), OptoScanSummaryFactory::extract(), and OptoScanHistosUsingDb::update().

{ return bias_; }
const uint16_t & OptoScanAnalysis::gain ( ) const [inline]

Optimum LLD gain setting

Definition at line 118 of file OptoScanAnalysis.h.

References gain_.

Referenced by OptoScanHistosUsingDb::create(), OptoScanSummaryFactory::extract(), print(), summary(), and OptoScanHistosUsingDb::update().

{ return gain_; }
bool OptoScanAnalysis::isValid ( void  ) const [virtual]
const OptoScanAnalysis::VFloat & OptoScanAnalysis::liftOff ( ) const [inline]

Baseline "lift-off" values [mA]

Definition at line 123 of file OptoScanAnalysis.h.

References liftOff_.

Referenced by OptoScanHistosUsingDb::create(), and OptoScanSummaryFactory::extract().

{ return liftOff_; }
const OptoScanAnalysis::VFloat & OptoScanAnalysis::linkNoise ( ) const [inline]

Noise value at "zero light" levels [ADC]

Definition at line 122 of file OptoScanAnalysis.h.

References linkNoise_.

Referenced by OptoScanHistosUsingDb::create(), and OptoScanSummaryFactory::extract().

{ return linkNoise_; }
const OptoScanAnalysis::VFloat & OptoScanAnalysis::measGain ( ) const [inline]

Measured gains for each setting [V/V].

Definition at line 120 of file OptoScanAnalysis.h.

References measGain_.

Referenced by OptoScanHistosUsingDb::create(), and OptoScanSummaryFactory::extract().

{ return measGain_; }
void OptoScanAnalysis::print ( std::stringstream &  ss,
uint32_t  gain_setting = sistrip::invalid_ 
) [virtual]

Prints analysis results.

Implements CommissioningAnalysis.

Definition at line 139 of file OptoScanAnalysis.cc.

References baseSlope_, bias_, relativeConstraints::empty, gain(), gain_, CommissioningAnalysis::getErrorCodes(), CommissioningAnalysis::header(), isValid(), liftOff_, linkNoise_, measGain_, sistrip::mlCommissioning_, CommissioningAnalysis::myName(), threshold_, tickHeight_, and zeroLight_.

                                                                 { 

  if ( gain >= 4 ) { gain = gain_; }

  if ( gain >= bias_.size() ) {
    edm::LogWarning(mlCommissioning_)
      << "[" << myName() << "::" << __func__ << "]"
      << " Unexpected gain setting: " << gain;
    return;
  }

  header( ss );
  ss <<  std::fixed << std::setprecision(2)
     << " Optimum LLD gain setting : " << gain_ << std::endl
     << " LLD gain setting         : " << gain << std::endl
     << " LLD bias setting         : " << bias_[gain] << std::endl
     << " Measured gain      [V/V] : " << measGain_[gain] << std::endl
     << " Zero light level   [ADC] : " << zeroLight_[gain] << std::endl
     << " Link noise [ADC]         : " << linkNoise_[gain] << std::endl
     << " Baseline 'lift off' [mA] : " << liftOff_[gain] << std::endl
     << " Laser threshold     [mA] : " << threshold_[gain] << std::endl
     << " Tick mark height   [ADC] : " << tickHeight_[gain] << std::endl
     << " Baseline slope [ADC/I2C] : " << baseSlope_[gain] << std::endl
     << std::boolalpha 
     << " isValid                  : " << isValid()  << 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 OptoScanAnalysis::reset ( void  ) [virtual]
void OptoScanAnalysis::summary ( std::stringstream &  ss) const [virtual]

Overrides base method.

Reimplemented from CommissioningAnalysis.

Definition at line 79 of file OptoScanAnalysis.cc.

References sistrip::extrainfo::baselineRms_, SiStripFecKey::ccuAddr(), SiStripFecKey::ccuChan(), sistrip::controlView_, sistrip::extrainfo::digital_, sistrip::dir_, sistrip::dqmRoot_, sistrip::EXPERT_HISTO, SiStripFecKey::fecCrate(), CommissioningAnalysis::fecKey(), SiStripFecKey::fecRing(), SiStripFecKey::fecSlot(), sistrip::FED_KEY, CommissioningAnalysis::fedKey(), gain(), sistrip::extrainfo::gain_, isValid(), SiStripKey::key(), sistrip::LLD_CHAN, SiStripFecKey::lldChan(), CommissioningAnalysis::myName(), scaleCards::path, environment_file_cff::runType, and indexGen::title.

                                                          { 

  SiStripFecKey fec_key( fecKey() );
  SiStripFedKey fed_key( fedKey() );
  
  sistrip::RunType type = SiStripEnumsAndStrings::runType( myName() );

  std::stringstream extra1,extra2,extra3; 
  extra1 << sistrip::extrainfo::gain_ << gain() << sistrip::extrainfo::digital_ << "0";
  extra2 << sistrip::extrainfo::gain_ << gain() << sistrip::extrainfo::digital_ << "1";
  extra3 << sistrip::extrainfo::gain_ << gain() << sistrip::extrainfo::baselineRms_;
  
  std::string title1 = SiStripHistoTitle( sistrip::EXPERT_HISTO, 
                                          type,
                                          sistrip::FED_KEY, 
                                          fed_key.key(),
                                          sistrip::LLD_CHAN, 
                                          fec_key.lldChan(),
                                          extra1.str() ).title();
  std::string title2 = SiStripHistoTitle( sistrip::EXPERT_HISTO, 
                                          type,
                                          sistrip::FED_KEY, 
                                          fed_key.key(),
                                          sistrip::LLD_CHAN, 
                                          fec_key.lldChan(),
                                          extra2.str() ).title();
  std::string title3 = SiStripHistoTitle( sistrip::EXPERT_HISTO, 
                                          type,
                                          sistrip::FED_KEY, 
                                          fed_key.key(),
                                          sistrip::LLD_CHAN, 
                                          fec_key.lldChan(),
                                          extra3.str() ).title();
  
  ss << " Summary"
     << ":"
     << ( isValid() ? "Valid" : "Invalid" )
     << ":"
     << sistrip::controlView_ << ":"
     << fec_key.fecCrate() << "/" 
     << fec_key.fecSlot() << "/" 
     << fec_key.fecRing() << "/" 
     << fec_key.ccuAddr() << "/" 
     << fec_key.ccuChan() 
     << ":"
     << sistrip::dqmRoot_ << sistrip::dir_ 
     << "Collate" << sistrip::dir_ 
     << SiStripFecKey( fec_key.fecCrate(),
                       fec_key.fecSlot(), 
                       fec_key.fecRing(), 
                       fec_key.ccuAddr(), 
                       fec_key.ccuChan() ).path()
     << ":"
     << title1 << ";" << title2 << ";" << title3
     << std::endl;
  
}
const OptoScanAnalysis::VFloat & OptoScanAnalysis::threshold ( ) const [inline]

Laser thresholds [mA]

Definition at line 124 of file OptoScanAnalysis.h.

References threshold_.

Referenced by OptoScanHistosUsingDb::create(), and OptoScanSummaryFactory::extract().

{ return threshold_; }
const OptoScanAnalysis::VFloat & OptoScanAnalysis::tickHeight ( ) const [inline]

Tick mark heights [ADC]

Definition at line 125 of file OptoScanAnalysis.h.

References tickHeight_.

Referenced by OptoScanHistosUsingDb::create(), and OptoScanSummaryFactory::extract().

{ return tickHeight_; }
const OptoScanAnalysis::VFloat & OptoScanAnalysis::zeroLight ( ) const [inline]

"Zero light" levels [ADC]

Definition at line 121 of file OptoScanAnalysis.h.

References zeroLight_.

Referenced by OptoScanHistosUsingDb::create(), and OptoScanSummaryFactory::extract().

{ return zeroLight_; }

Friends And Related Function Documentation

friend class OptoScanAlgorithm [friend]

Definition at line 27 of file OptoScanAnalysis.h.


Member Data Documentation

Slope of baseline [ADC/I2C]

Definition at line 112 of file OptoScanAnalysis.h.

Referenced by OptoScanAlgorithm::analyse(), baseSlope(), print(), and reset().

LLD bias value for each gain setting

Definition at line 91 of file OptoScanAnalysis.h.

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

Default LLD bias setting if analysis fails.

Definition at line 78 of file OptoScanAnalysis.h.

Referenced by OptoScanAlgorithm::analyse().

Default LLD gain setting if analysis fails.

Definition at line 75 of file OptoScanAnalysis.h.

Referenced by OptoScanAlgorithm::analyse().

const float OptoScanAnalysis::fedAdcGain_ = 1.024 / 1024. [static]

Peak-to-peak voltage for FED A/D converter [V/ADC].

Definition at line 81 of file OptoScanAnalysis.h.

Referenced by OptoScanAlgorithm::analyse().

uint16_t OptoScanAnalysis::gain_ [private]

Optimum LLD gain setting

Definition at line 88 of file OptoScanAnalysis.h.

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

Baseline "lift-off" values [mA]

Definition at line 103 of file OptoScanAnalysis.h.

Referenced by OptoScanAlgorithm::analyse(), liftOff(), print(), and reset().

Noise value at "zero light" levels [ADC]

Definition at line 100 of file OptoScanAnalysis.h.

Referenced by OptoScanAlgorithm::analyse(), linkNoise(), print(), and reset().

Measured gains for each setting [V/V].

Definition at line 94 of file OptoScanAnalysis.h.

Referenced by OptoScanAlgorithm::analyse(), measGain(), print(), and reset().

Laser thresholds [mA]

Definition at line 106 of file OptoScanAnalysis.h.

Referenced by OptoScanAlgorithm::analyse(), print(), reset(), and threshold().

Tick mark heights [ADC]

Definition at line 109 of file OptoScanAnalysis.h.

Referenced by OptoScanAlgorithm::analyse(), print(), reset(), and tickHeight().

"Zero light" levels [ADC]

Definition at line 97 of file OptoScanAnalysis.h.

Referenced by OptoScanAlgorithm::analyse(), print(), reset(), and zeroLight().