CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
 
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_)
 
void reset ()
 
void summary (std::stringstream &) const
 
const VFloatthreshold () const
 
const VFloattickHeight () const
 
const VFloatzeroLight () const
 
virtual ~OptoScanAnalysis ()
 
- 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< float > VFloat
 
typedef std::vector< uint16_t > VInt
 
typedef std::vector< std::string > VString
 
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::OptoScanAnalysis ( const uint32_t &  key)
OptoScanAnalysis::OptoScanAnalysis ( )
virtual OptoScanAnalysis::~OptoScanAnalysis ( )
inlinevirtual

Definition at line 25 of file OptoScanAnalysis.h.

25 {;}

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

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

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

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

71  {
72  return ( gain_ < sistrip::maximum_ &&
74  getErrorCodes().empty() );
75 }
static const uint16_t maximum_
Definition: Constants.h:21
const VString & getErrorCodes() const
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().

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

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

120 { 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_.

139  {
140 
141  if ( gain >= 4 ) { gain = gain_; }
142 
143  if ( gain >= bias_.size() ) {
145  << "[" << myName() << "::" << __func__ << "]"
146  << " Unexpected gain setting: " << gain;
147  return;
148  }
149 
150  header( ss );
151  ss << std::fixed << std::setprecision(2)
152  << " Optimum LLD gain setting : " << gain_ << std::endl
153  << " LLD gain setting : " << gain << std::endl
154  << " LLD bias setting : " << bias_[gain] << std::endl
155  << " Measured gain [V/V] : " << measGain_[gain] << std::endl
156  << " Zero light level [ADC] : " << zeroLight_[gain] << std::endl
157  << " Link noise [ADC] : " << linkNoise_[gain] << std::endl
158  << " Baseline 'lift off' [mA] : " << liftOff_[gain] << std::endl
159  << " Laser threshold [mA] : " << threshold_[gain] << std::endl
160  << " Tick mark height [ADC] : " << tickHeight_[gain] << std::endl
161  << " Baseline slope [ADC/I2C] : " << baseSlope_[gain] << std::endl
162  << std::boolalpha
163  << " isValid : " << isValid() << std::endl
164  << std::noboolalpha
165  << " Error codes (found "
166  << std::setw(2) << std::setfill(' ') << getErrorCodes().size()
167  << ") : ";
168  if ( getErrorCodes().empty() ) { ss << "(none)"; }
169  else {
170  VString::const_iterator istr = getErrorCodes().begin();
171  VString::const_iterator jstr = getErrorCodes().end();
172  for ( ; istr != jstr; ++istr ) { ss << *istr << " "; }
173  }
174  ss << std::endl;
175 
176 }
const uint16_t & gain() const
bool isValid() const
static const char mlCommissioning_[]
virtual void header(std::stringstream &) const
const VString & getErrorCodes() const
const std::string & myName() const
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_.

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

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(), getHLTPrescaleColumns::path, SiStripEnumsAndStrings::runType(), AlCaHLTBitMon_QueryRunRegistry::string, and indexGen::title.

79  {
80 
81  SiStripFecKey fec_key( fecKey() );
82  SiStripFedKey fed_key( fedKey() );
83 
85 
86  std::stringstream extra1,extra2,extra3;
88  extra2 << sistrip::extrainfo::gain_ << gain() << sistrip::extrainfo::digital_ << "1";
90 
92  type,
94  fed_key.key(),
96  fec_key.lldChan(),
97  extra1.str() ).title();
99  type,
101  fed_key.key(),
103  fec_key.lldChan(),
104  extra2.str() ).title();
106  type,
108  fed_key.key(),
110  fec_key.lldChan(),
111  extra3.str() ).title();
112 
113  ss << " Summary"
114  << ":"
115  << ( isValid() ? "Valid" : "Invalid" )
116  << ":"
117  << sistrip::controlView_ << ":"
118  << fec_key.fecCrate() << "/"
119  << fec_key.fecSlot() << "/"
120  << fec_key.fecRing() << "/"
121  << fec_key.ccuAddr() << "/"
122  << fec_key.ccuChan()
123  << ":"
125  << "Collate" << sistrip::dir_
126  << SiStripFecKey( fec_key.fecCrate(),
127  fec_key.fecSlot(),
128  fec_key.fecRing(),
129  fec_key.ccuAddr(),
130  fec_key.ccuChan() ).path()
131  << ":"
132  << title1 << ";" << title2 << ";" << title3
133  << std::endl;
134 
135 }
const uint16_t & gain() const
type
Definition: HCALResponse.h:21
const uint32_t & fedKey() const
bool isValid() 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 baselineRms_[]
static const char controlView_[]
static const char dqmRoot_[]
const uint32_t & fecKey() const
static const char digital_[]
static const char gain_[]
const std::string & myName() const
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().

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

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

121 { return zeroLight_; }

Friends And Related Function Documentation

friend class OptoScanAlgorithm
friend

Definition at line 27 of file OptoScanAnalysis.h.

Member Data Documentation

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