CMS 3D CMS Logo

List of all members | 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

Public Member Functions

const VFloatbaseSlope () const
 
const VIntbias () const
 
const uint16_t & gain () const
 
bool isValid () const override
 
const VFloatliftOff () const
 
const VFloatlinkNoise () const
 
const VFloatmeasGain () const
 
 OptoScanAnalysis (const uint32_t &key)
 
 OptoScanAnalysis ()
 
void print (std::stringstream &, uint32_t gain_setting=sistrip::invalid_) override
 
void reset () override
 
void summary (std::stringstream &) const override
 
const VFloatthreshold () const
 
const VFloattickHeight () const
 
const VFloatzeroLight () const
 
 ~OptoScanAnalysis () override
 
- 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
 
virtual void header (std::stringstream &) const
 
const std::string & myName () const
 
void setErrorCodes (const VString &errors)
 
virtual ~CommissioningAnalysis ()
 

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
 

Additional Inherited Members

- Public Types inherited from CommissioningAnalysis
typedef std::vector< bool > VBool
 
typedef std::vector< float > VFloat
 
typedef std::vector< uint16_t > VInt
 
typedef std::vector< std::string > VString
 
typedef std::vector< VBoolVVBool
 
typedef std::vector< VFloatVVFloat
 
typedef std::vector< VIntVVInt
 

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() [1/2]

OptoScanAnalysis::OptoScanAnalysis ( const uint32_t &  key)

◆ OptoScanAnalysis() [2/2]

OptoScanAnalysis::OptoScanAnalysis ( )

◆ ~OptoScanAnalysis()

OptoScanAnalysis::~OptoScanAnalysis ( )
inlineoverride

Definition at line 23 of file OptoScanAnalysis.h.

23 { ; }

Member Function Documentation

◆ baseSlope()

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

Baseline slope [ADC/I2C]

Definition at line 122 of file OptoScanAnalysis.h.

References baseSlope_.

122 { return baseSlope_; }

◆ bias()

const OptoScanAnalysis::VInt & OptoScanAnalysis::bias ( ) const
inline

LLD bias value for each gain setting

Definition at line 115 of file OptoScanAnalysis.h.

References bias_.

115 { return bias_; }

◆ gain()

const uint16_t & OptoScanAnalysis::gain ( ) const
inline

Optimum LLD gain setting

Definition at line 114 of file OptoScanAnalysis.h.

References gain_.

Referenced by print(), and summary().

114 { return gain_; }

◆ isValid()

bool OptoScanAnalysis::isValid ( void  ) const
overridevirtual

Identifies if analysis is valid or not.

Reimplemented from CommissioningAnalysis.

Definition at line 72 of file OptoScanAnalysis.cc.

References bias_, relativeConstraints::empty, gain_, CommissioningAnalysis::getErrorCodes(), and sistrip::maximum_.

Referenced by ntupleDataFormat._Object::_checkIsValid(), print(), core.AutoHandle.AutoHandle::ReallyLoad(), and summary().

72  {
74 }
const VString & getErrorCodes() const
static const uint16_t maximum_
Definition: Constants.h:20

◆ liftOff()

const OptoScanAnalysis::VFloat & OptoScanAnalysis::liftOff ( ) const
inline

Baseline "lift-off" values [mA]

Definition at line 119 of file OptoScanAnalysis.h.

References liftOff_.

119 { return liftOff_; }

◆ linkNoise()

const OptoScanAnalysis::VFloat & OptoScanAnalysis::linkNoise ( ) const
inline

Noise value at "zero light" levels [ADC]

Definition at line 118 of file OptoScanAnalysis.h.

References linkNoise_.

118 { return linkNoise_; }

◆ measGain()

const OptoScanAnalysis::VFloat & OptoScanAnalysis::measGain ( ) const
inline

Measured gains for each setting [V/V].

Definition at line 116 of file OptoScanAnalysis.h.

References measGain_.

116 { return measGain_; }

◆ print()

void OptoScanAnalysis::print ( std::stringstream &  ss,
uint32_t  gain_setting = sistrip::invalid_ 
)
overridevirtual

Prints analysis results.

Implements CommissioningAnalysis.

Definition at line 125 of file OptoScanAnalysis.cc.

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

125  {
126  if (gain >= 4) {
127  gain = gain_;
128  }
129 
130  if (gain >= bias_.size()) {
131  edm::LogWarning(mlCommissioning_) << "[" << myName() << "::" << __func__ << "]"
132  << " Unexpected gain setting: " << gain;
133  return;
134  }
135 
136  header(ss);
137  ss << std::fixed << std::setprecision(2) << " Optimum LLD gain setting : " << gain_ << std::endl
138  << " LLD gain setting : " << gain << std::endl
139  << " LLD bias setting : " << bias_[gain] << std::endl
140  << " Measured gain [V/V] : " << measGain_[gain] << std::endl
141  << " Zero light level [ADC] : " << zeroLight_[gain] << std::endl
142  << " Link noise [ADC] : " << linkNoise_[gain] << std::endl
143  << " Baseline 'lift off' [mA] : " << liftOff_[gain] << std::endl
144  << " Laser threshold [mA] : " << threshold_[gain] << std::endl
145  << " Tick mark height [ADC] : " << tickHeight_[gain] << std::endl
146  << " Baseline slope [ADC/I2C] : " << baseSlope_[gain] << std::endl
147  << std::boolalpha << " isValid : " << isValid() << std::endl
148  << std::noboolalpha << " Error codes (found " << std::setw(2) << std::setfill(' ') << getErrorCodes().size()
149  << ") : ";
150  if (getErrorCodes().empty()) {
151  ss << "(none)";
152  } else {
153  VString::const_iterator istr = getErrorCodes().begin();
154  VString::const_iterator jstr = getErrorCodes().end();
155  for (; istr != jstr; ++istr) {
156  ss << *istr << " ";
157  }
158  }
159  ss << std::endl;
160 }
const VString & getErrorCodes() const
const std::string & myName() const
static const char mlCommissioning_[]
const uint16_t & gain() const
virtual void header(std::stringstream &) const
Log< level::Warning, false > LogWarning
bool isValid() const override

◆ reset()

void OptoScanAnalysis::reset ( void  )
overridevirtual

Resets analysis member data.

Implements CommissioningAnalysis.

Definition at line 58 of file OptoScanAnalysis.cc.

References baseSlope_, bias_, gain_, sistrip::invalid_, liftOff_, linkNoise_, measGain_, threshold_, tickHeight_, and zeroLight_.

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

◆ summary()

void OptoScanAnalysis::summary ( std::stringstream &  ss) const
overridevirtual

Overrides base method.

Reimplemented from CommissioningAnalysis.

Definition at line 78 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(), castor_dqm_sourceclient_file_cfg::path, SiStripEnumsAndStrings::runType(), contentValuesCheck::ss, AlCaHLTBitMon_QueryRunRegistry::string, and runGCPTkAlMap::title.

78  {
79  SiStripFecKey fec_key(fecKey());
80  SiStripFedKey fed_key(fedKey());
81 
83 
84  std::stringstream extra1, extra2, extra3;
88 
90  type,
92  fed_key.key(),
94  fec_key.lldChan(),
95  extra1.str())
96  .title();
98  type,
100  fed_key.key(),
102  fec_key.lldChan(),
103  extra2.str())
104  .title();
106  type,
108  fed_key.key(),
110  fec_key.lldChan(),
111  extra3.str())
112  .title();
113 
114  ss << " Summary"
115  << ":" << (isValid() ? "Valid" : "Invalid") << ":" << sistrip::controlView_ << ":" << fec_key.fecCrate() << "/"
116  << fec_key.fecSlot() << "/" << fec_key.fecRing() << "/" << fec_key.ccuAddr() << "/" << fec_key.ccuChan() << ":"
117  << sistrip::dqmRoot_ << sistrip::dir_ << "Collate" << sistrip::dir_
118  << SiStripFecKey(fec_key.fecCrate(), fec_key.fecSlot(), fec_key.fecRing(), fec_key.ccuAddr(), fec_key.ccuChan())
119  .path()
120  << ":" << title1 << ";" << title2 << ";" << title3 << std::endl;
121 }
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:56
Utility class that identifies a position within the strip tracker control structure, down to the level of an APV25.
Definition: SiStripFecKey.h:45
static std::string runType(const sistrip::RunType &)
static const char baselineRms_[]
const std::string & myName() const
static const char controlView_[]
static const char dqmRoot_[]
const uint16_t & gain() const
const uint32_t & fecKey() const
const uint32_t & fedKey() const
static const char digital_[]
static const char gain_[]
bool isValid() const override

◆ threshold()

const OptoScanAnalysis::VFloat & OptoScanAnalysis::threshold ( ) const
inline

Laser thresholds [mA]

Definition at line 120 of file OptoScanAnalysis.h.

References threshold_.

120 { return threshold_; }

◆ tickHeight()

const OptoScanAnalysis::VFloat & OptoScanAnalysis::tickHeight ( ) const
inline

Tick mark heights [ADC]

Definition at line 121 of file OptoScanAnalysis.h.

References tickHeight_.

121 { return tickHeight_; }

◆ zeroLight()

const OptoScanAnalysis::VFloat & OptoScanAnalysis::zeroLight ( ) const
inline

"Zero light" levels [ADC]

Definition at line 117 of file OptoScanAnalysis.h.

References zeroLight_.

117 { return zeroLight_; }

Friends And Related Function Documentation

◆ OptoScanAlgorithm

friend class OptoScanAlgorithm
friend

Definition at line 25 of file OptoScanAnalysis.h.

Member Data Documentation

◆ baseSlope_

VFloat OptoScanAnalysis::baseSlope_
private

Slope of baseline [ADC/I2C]

Definition at line 109 of file OptoScanAnalysis.h.

Referenced by baseSlope(), print(), and reset().

◆ bias_

VInt OptoScanAnalysis::bias_
private

LLD bias value for each gain setting

Definition at line 88 of file OptoScanAnalysis.h.

Referenced by bias(), isValid(), print(), and reset().

◆ defaultBiasSetting_

const uint16_t OptoScanAnalysis::defaultBiasSetting_ = sistrip::invalid_
static

Default LLD bias setting if analysis fails.

Definition at line 76 of file OptoScanAnalysis.h.

Referenced by OptoScanAlgorithm::analyse().

◆ defaultGainSetting_

const uint16_t OptoScanAnalysis::defaultGainSetting_ = sistrip::invalid_
static

Default LLD gain setting if analysis fails.

Definition at line 73 of file OptoScanAnalysis.h.

Referenced by OptoScanAlgorithm::analyse().

◆ fedAdcGain_

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

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

Definition at line 79 of file OptoScanAnalysis.h.

Referenced by OptoScanAlgorithm::analyse().

◆ gain_

uint16_t OptoScanAnalysis::gain_
private

Optimum LLD gain setting

Definition at line 85 of file OptoScanAnalysis.h.

Referenced by gain(), isValid(), print(), and reset().

◆ liftOff_

VFloat OptoScanAnalysis::liftOff_
private

Baseline "lift-off" values [mA]

Definition at line 100 of file OptoScanAnalysis.h.

Referenced by liftOff(), print(), and reset().

◆ linkNoise_

VFloat OptoScanAnalysis::linkNoise_
private

Noise value at "zero light" levels [ADC]

Definition at line 97 of file OptoScanAnalysis.h.

Referenced by linkNoise(), print(), and reset().

◆ measGain_

VFloat OptoScanAnalysis::measGain_
private

Measured gains for each setting [V/V].

Definition at line 91 of file OptoScanAnalysis.h.

Referenced by measGain(), print(), and reset().

◆ threshold_

VFloat OptoScanAnalysis::threshold_
private

Laser thresholds [mA]

Definition at line 103 of file OptoScanAnalysis.h.

Referenced by print(), reset(), and threshold().

◆ tickHeight_

VFloat OptoScanAnalysis::tickHeight_
private

Tick mark heights [ADC]

Definition at line 106 of file OptoScanAnalysis.h.

Referenced by print(), reset(), and tickHeight().

◆ zeroLight_

VFloat OptoScanAnalysis::zeroLight_
private

"Zero light" levels [ADC]

Definition at line 94 of file OptoScanAnalysis.h.

Referenced by print(), reset(), and zeroLight().