Histogram-based analysis for opto bias/gain scan. More...
#include <OptoScanAnalysis.h>
Public Member Functions | |
const VFloat & | baseSlope () const |
const VInt & | bias () const |
const uint16_t & | gain () const |
bool | isValid () const |
const VFloat & | liftOff () const |
const VFloat & | linkNoise () const |
const VFloat & | measGain () 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 VFloat & | threshold () const |
const VFloat & | tickHeight () const |
const VFloat & | zeroLight () 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 |
Histogram-based analysis for opto bias/gain scan.
Definition at line 15 of file OptoScanAnalysis.h.
OptoScanAnalysis::OptoScanAnalysis | ( | const uint32_t & | key | ) |
Definition at line 26 of file OptoScanAnalysis.cc.
: CommissioningAnalysis(key,sistrip::optoScanAnalysis_), gain_(sistrip::invalid_), bias_(4,sistrip::invalid_), measGain_(4,sistrip::invalid_), zeroLight_(4,sistrip::invalid_), linkNoise_(4,sistrip::invalid_), liftOff_(4,sistrip::invalid_), threshold_(4,sistrip::invalid_), tickHeight_(4,sistrip::invalid_), baseSlope_(4,sistrip::invalid_) {;}
OptoScanAnalysis::OptoScanAnalysis | ( | ) |
Definition at line 41 of file OptoScanAnalysis.cc.
: CommissioningAnalysis(sistrip::optoScanAnalysis_), gain_(sistrip::invalid_), bias_(4,sistrip::invalid_), measGain_(4,sistrip::invalid_), zeroLight_(4,sistrip::invalid_), linkNoise_(4,sistrip::invalid_), liftOff_(4,sistrip::invalid_), threshold_(4,sistrip::invalid_), tickHeight_(4,sistrip::invalid_), baseSlope_(4,sistrip::invalid_) {;}
virtual OptoScanAnalysis::~OptoScanAnalysis | ( | ) | [inline, virtual] |
Definition at line 25 of file OptoScanAnalysis.h.
{;}
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] |
Identifies if analysis is valid or not.
Reimplemented from CommissioningAnalysis.
Definition at line 71 of file OptoScanAnalysis.cc.
References bias_, relativeConstraints::empty, gain_, CommissioningAnalysis::getErrorCodes(), and sistrip::maximum_.
Referenced by OptoScanHistosUsingDb::create(), OptoScanHistograms::histoAnalysis(), print(), and summary().
{ return ( gain_ < sistrip::maximum_ && bias_[gain_] < sistrip::maximum_ && getErrorCodes().empty() ); }
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] |
Resets analysis member data.
Implements CommissioningAnalysis.
Definition at line 56 of file OptoScanAnalysis.cc.
References baseSlope_, bias_, gain_, sistrip::invalid_, liftOff_, linkNoise_, measGain_, threshold_, tickHeight_, and zeroLight_.
{ gain_ = sistrip::invalid_; bias_ = VInt(4,sistrip::invalid_); measGain_ = VFloat(4,sistrip::invalid_); zeroLight_ = VFloat(4,sistrip::invalid_); linkNoise_ = VFloat(4,sistrip::invalid_); liftOff_ = VFloat(4,sistrip::invalid_); threshold_ = VFloat(4,sistrip::invalid_); tickHeight_ = VFloat(4,sistrip::invalid_); baseSlope_ = VFloat(4,sistrip::invalid_); }
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(), path(), SiStripEnumsAndStrings::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_; }
friend class OptoScanAlgorithm [friend] |
Definition at line 27 of file OptoScanAnalysis.h.
VFloat OptoScanAnalysis::baseSlope_ [private] |
Slope of baseline [ADC/I2C]
Definition at line 112 of file OptoScanAnalysis.h.
Referenced by OptoScanAlgorithm::analyse(), baseSlope(), print(), and reset().
VInt OptoScanAnalysis::bias_ [private] |
LLD bias value for each gain setting
Definition at line 91 of file OptoScanAnalysis.h.
Referenced by OptoScanAlgorithm::analyse(), bias(), isValid(), print(), and reset().
const uint16_t OptoScanAnalysis::defaultBiasSetting_ = sistrip::invalid_ [static] |
Default LLD bias setting if analysis fails.
Definition at line 78 of file OptoScanAnalysis.h.
Referenced by OptoScanAlgorithm::analyse().
const uint16_t OptoScanAnalysis::defaultGainSetting_ = sistrip::invalid_ [static] |
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().
VFloat OptoScanAnalysis::liftOff_ [private] |
Baseline "lift-off" values [mA]
Definition at line 103 of file OptoScanAnalysis.h.
Referenced by OptoScanAlgorithm::analyse(), liftOff(), print(), and reset().
VFloat OptoScanAnalysis::linkNoise_ [private] |
Noise value at "zero light" levels [ADC]
Definition at line 100 of file OptoScanAnalysis.h.
Referenced by OptoScanAlgorithm::analyse(), linkNoise(), print(), and reset().
VFloat OptoScanAnalysis::measGain_ [private] |
Measured gains for each setting [V/V].
Definition at line 94 of file OptoScanAnalysis.h.
Referenced by OptoScanAlgorithm::analyse(), measGain(), print(), and reset().
VFloat OptoScanAnalysis::threshold_ [private] |
Laser thresholds [mA]
Definition at line 106 of file OptoScanAnalysis.h.
Referenced by OptoScanAlgorithm::analyse(), print(), reset(), and threshold().
VFloat OptoScanAnalysis::tickHeight_ [private] |
Tick mark heights [ADC]
Definition at line 109 of file OptoScanAnalysis.h.
Referenced by OptoScanAlgorithm::analyse(), print(), reset(), and tickHeight().
VFloat OptoScanAnalysis::zeroLight_ [private] |
"Zero light" levels [ADC]
Definition at line 97 of file OptoScanAnalysis.h.
Referenced by OptoScanAlgorithm::analyse(), print(), reset(), and zeroLight().