CMS 3D CMS Logo

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

Public Types

typedef std::map< uint32_t, uint16_t > Candidates
 
- 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
 

Public Member Functions

bool badTrimDac () const
 
const uint32_t & dcuHardId () const
 
 FastFedCablingAnalysis (const uint32_t &key)
 
 FastFedCablingAnalysis ()
 
void header (std::stringstream &) const override
 
const float & highLevel () const
 
const float & highRms () const
 
bool isDirty () const
 
bool isValid () const override
 
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) override
 
void reset () override
 
void summary (std::stringstream &) const override
 
 ~FastFedCablingAnalysis () 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
 
const std::string & myName () const
 
void setErrorCodes (const VString &errors)
 
virtual ~CommissioningAnalysis ()
 

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

◆ Candidates

typedef std::map<uint32_t, uint16_t> FastFedCablingAnalysis::Candidates

Definition at line 26 of file FastFedCablingAnalysis.h.

Constructor & Destructor Documentation

◆ FastFedCablingAnalysis() [1/2]

FastFedCablingAnalysis::FastFedCablingAnalysis ( const uint32_t &  key)

Definition at line 34 of file FastFedCablingAnalysis.cc.

References CommissioningAnalysis::fecKey(), CommissioningAnalysis::fedKey(), sistrip::invalid_, and submitPVResolutionJobs::key.

46  max_(1. * sistrip::invalid_),
47  min_(1. * sistrip::invalid_) {
55  .key());
56  fedKey(key);
57 }
static const uint32_t invalid32_
Definition: Constants.h:15
Utility class that identifies a position within the strip tracker control structure, down to the level of an APV25.
Definition: SiStripFecKey.h:45
static const char fastCablingAnalysis_[]
key
prepare the HTCondor submission files and eventually submit them
const uint32_t & fecKey() const
const uint32_t & fedKey() const
static const uint16_t invalid_
Definition: Constants.h:16

◆ FastFedCablingAnalysis() [2/2]

FastFedCablingAnalysis::FastFedCablingAnalysis ( )

Definition at line 61 of file FastFedCablingAnalysis.cc.

73  max_(1. * sistrip::invalid_),
74  min_(1. * sistrip::invalid_) {
75  ;
76 }
static const uint32_t invalid32_
Definition: Constants.h:15
static const char fastCablingAnalysis_[]
static const uint16_t invalid_
Definition: Constants.h:16

◆ ~FastFedCablingAnalysis()

FastFedCablingAnalysis::~FastFedCablingAnalysis ( )
inlineoverride

Definition at line 24 of file FastFedCablingAnalysis.h.

24 { ; }

Member Function Documentation

◆ badTrimDac()

bool FastFedCablingAnalysis::badTrimDac ( ) const

Identifies if TrimDAQ setting is valid or not.

Definition at line 110 of file FastFedCablingAnalysis.cc.

References lowMean_, and trimDacThreshold_.

Referenced by print().

◆ dcuHardId()

const uint32_t & FastFedCablingAnalysis::dcuHardId ( ) const
inline

DCU hardware id (32-bits).

Definition at line 139 of file FastFedCablingAnalysis.h.

References dcuHardId_.

139 { return dcuHardId_; }

◆ header()

void FastFedCablingAnalysis::header ( std::stringstream &  ss) const
overridevirtual

Header information for analysis print().

Reimplemented from CommissioningAnalysis.

Definition at line 114 of file FastFedCablingAnalysis.cc.

References SiStripFecKey::ccuAddr(), SiStripFecKey::ccuChan(), CommissioningAnalysis::dcuId(), TauDecayModes::dec, CommissioningAnalysis::detId(), SiStripFecKey::fecCrate(), SiStripFedKey::feChan(), CommissioningAnalysis::fecKey(), SiStripFecKey::fecRing(), SiStripFecKey::fecSlot(), SiStripFedKey::fedChannel(), SiStripFedKey::fedId(), CommissioningAnalysis::fedKey(), SiStripFedKey::feUnit(), SiStripFecKey::isValid(), SiStripFecKey::lldChan(), CommissioningAnalysis::myName(), and contentValuesCheck::ss.

Referenced by print().

114  {
115  ss << "[" << myName() << "] Monitorables (65535 means \"invalid\"):" << std::endl;
116 
117  //summary(ss);
118 
119  SiStripFecKey fec_key(fecKey());
120  if (fec_key.isValid()) {
121  ss << " Crate/FEC/Ring/CCU/Mod/LLD : " << fec_key.fecCrate() << "/" << fec_key.fecSlot() << "/"
122  << fec_key.fecRing() << "/" << fec_key.ccuAddr() << "/" << fec_key.ccuChan() << "/" << fec_key.lldChan()
123  << std::endl;
124  } else {
125  ss << " Crate/FEC/Ring/CCU/Mod/LLD : (invalid)" << std::endl;
126  }
127 
128  SiStripFedKey fed_key(fedKey());
129  ss << " FedId/FeUnit/FeChan/FedChannel : " << fed_key.fedId() << "/" << fed_key.feUnit() << "/" << fed_key.feChan()
130  << "/" << fed_key.fedChannel() << std::endl;
131  // if ( fed_key.fedChannel() != sistrip::invalid_ ) { ss << fed_key.fedChannel(); }
132  // else { ss << "(invalid)"; }
133  // ss << std::endl;
134 
135  ss << " FecKey/Fedkey (hex) : 0x" << std::hex << std::setw(8) << std::setfill('0') << fecKey() << " / 0x"
136  << std::setw(8) << std::setfill('0') << fedKey() << std::dec << std::endl;
137 
138  ss << " DcuId (hex/dec) : 0x" << std::hex << std::setw(8) << std::setfill('0') << dcuId() << " / "
139  << std::dec << std::setw(10) << std::setfill(' ') << dcuId() << std::endl;
140 
141  ss << " DetId (hex/dec) : 0x" << std::hex << std::setw(8) << std::setfill('0') << detId() << " / "
142  << std::dec << std::setw(10) << std::setfill(' ') << detId() << std::endl;
143 }
const uint32_t & detId() const
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
const std::string & myName() const
const uint32_t & dcuId() const
const uint32_t & fecKey() const
const uint32_t & fedKey() const

◆ highLevel()

const float & FastFedCablingAnalysis::highLevel ( ) const
inline

"High" light level [ADC].

Definition at line 141 of file FastFedCablingAnalysis.h.

References highMean_.

◆ highRms()

const float & FastFedCablingAnalysis::highRms ( ) const
inline

Spread in "high" ligh level [ADC].

Definition at line 142 of file FastFedCablingAnalysis.h.

References highRms_.

◆ isDirty()

bool FastFedCablingAnalysis::isDirty ( ) const

Identifies if fibre is dirty or not.

Definition at line 106 of file FastFedCablingAnalysis.cc.

References dirtyThreshold_, and highMean_.

Referenced by print().

◆ isValid()

bool FastFedCablingAnalysis::isValid ( void  ) const
overridevirtual

Identifies if analysis is valid or not.

Reimplemented from CommissioningAnalysis.

Definition at line 97 of file FastFedCablingAnalysis.cc.

References dcuHardId_, relativeConstraints::empty, CommissioningAnalysis::getErrorCodes(), highMean_, highMedian_, highRms_, sistrip::invalid32_, lldCh_, lowMean_, lowMedian_, lowRms_, max_, midRange_, min_, range_, and sistrip::valid_.

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

97  {
102 }
const VString & getErrorCodes() const
static const uint32_t invalid32_
Definition: Constants.h:15
static const uint16_t valid_
Definition: Constants.h:17

◆ lldCh()

const uint16_t & FastFedCablingAnalysis::lldCh ( ) const
inline

Linear Laser Driver channel.

Definition at line 140 of file FastFedCablingAnalysis.h.

References lldCh_.

140 { return lldCh_; }

◆ lowLevel()

const float & FastFedCablingAnalysis::lowLevel ( ) const
inline

"Low" light level [ADC].

Definition at line 143 of file FastFedCablingAnalysis.h.

References lowMean_.

◆ lowRms()

const float & FastFedCablingAnalysis::lowRms ( ) const
inline

Spread in "low" ligh level [ADC].

Definition at line 144 of file FastFedCablingAnalysis.h.

References lowRms_.

144 { return lowRms_; }

◆ max()

const float & FastFedCablingAnalysis::max ( ) const
inline

Maximum light level in data [ADC].

Definition at line 145 of file FastFedCablingAnalysis.h.

References max_.

145 { return max_; }

◆ min()

const float & FastFedCablingAnalysis::min ( ) const
inline

Minimum light level in data [ADC].

Definition at line 146 of file FastFedCablingAnalysis.h.

References min_.

146 { return min_; }

◆ print()

void FastFedCablingAnalysis::print ( std::stringstream &  ss,
uint32_t  not_used = 0 
)
overridevirtual

Prints analysis results.

Implements CommissioningAnalysis.

Definition at line 165 of file FastFedCablingAnalysis.cc.

References badTrimDac(), dcuHardId_, TauDecayModes::dec, relativeConstraints::empty, alignBH_cfg::fixed, CommissioningAnalysis::getErrorCodes(), header(), highMean_, highMedian_, highRms_, sistrip::invalid_, isDirty(), isValid(), lldCh_, lowMean_, lowMedian_, lowRms_, max_, midRange_, min_, range_, and contentValuesCheck::ss.

165  {
166  header(ss);
167  ss << std::fixed << std::setprecision(2) << " DCU id extracted from histo : 0x" << std::hex << std::setw(8)
168  << std::setfill('0') << dcuHardId_ << std::endl
169  << std::dec << " LLD chan extracted from histo : " << (lldCh_ > 3 ? sistrip::invalid_ : lldCh_) << std::endl
170  << " \"High\" level (mean+/-rms) [ADC] : " << highMean_ << " +/- " << highRms_ << std::endl
171  << " \"Low\" level (mean+/-rms) [ADC] : " << lowMean_ << " +/- " << lowRms_ << std::endl
172  << " Median \"high\" level [ADC] : " << highMedian_ << std::endl
173  << " Median \"low\" level [ADC] : " << lowMedian_ << std::endl
174  << " Range [ADC] : " << range_ << std::endl
175  << " Mid-range level [ADC] : " << midRange_ << std::endl
176  << " Maximum level [ADC] : " << max_ << std::endl
177  << " Minimum level [ADC] : " << min_ << std::endl;
178  ss << std::boolalpha << " isValid : " << isValid() << std::endl
179  << " isDirty : " << isDirty() << std::endl
180  << " badTrimDac : " << badTrimDac() << std::endl
181  << std::noboolalpha << " Error codes (found " << std::setw(2) << std::setfill(' ') << getErrorCodes().size()
182  << ") : ";
183  if (getErrorCodes().empty()) {
184  ss << "(none)";
185  } else {
186  VString::const_iterator istr = getErrorCodes().begin();
187  VString::const_iterator jstr = getErrorCodes().end();
188  for (; istr != jstr; ++istr) {
189  ss << *istr << " ";
190  }
191  }
192  ss << std::endl;
193 }
const VString & getErrorCodes() const
void header(std::stringstream &) const override
bool isValid() const override
static const uint16_t invalid_
Definition: Constants.h:16

◆ reset()

void FastFedCablingAnalysis::reset ( void  )
overridevirtual

Resets analysis member data.

Implements CommissioningAnalysis.

Definition at line 80 of file FastFedCablingAnalysis.cc.

References dcuHardId_, highMean_, highMedian_, highRms_, sistrip::invalid32_, sistrip::invalid_, lldCh_, lowMean_, lowMedian_, lowRms_, max_, midRange_, min_, and range_.

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

80  {
91  max_ = 1. * sistrip::invalid_;
92  min_ = 1. * sistrip::invalid_;
93 }
static const uint32_t invalid32_
Definition: Constants.h:15
static const uint16_t invalid_
Definition: Constants.h:16

◆ summary()

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

Overrides base method.

Reimplemented from CommissioningAnalysis.

Definition at line 147 of file FastFedCablingAnalysis.cc.

References sistrip::dir_, sistrip::dqmRoot_, sistrip::EXPERT_HISTO, SiStripFedKey::feChan(), CommissioningAnalysis::fecKey(), sistrip::FED_KEY, SiStripFedKey::fedId(), CommissioningAnalysis::fedKey(), SiStripFedKey::feUnit(), isValid(), SiStripKey::key(), sistrip::LLD_CHAN, SiStripFecKey::lldChan(), CommissioningAnalysis::myName(), SiStripKey::path(), sistrip::readoutView_, SiStripEnumsAndStrings::runType(), contentValuesCheck::ss, AlCaHLTBitMon_QueryRunRegistry::string, and runGCPTkAlMap::title.

147  {
148  SiStripFecKey fec_key(fecKey());
149  SiStripFedKey fed_key(fedKey());
150 
154  sistrip::EXPERT_HISTO, type, sistrip::FED_KEY, fed_key.key(), sistrip::LLD_CHAN, fec_key.lldChan())
155  .title();
156 
157  ss << " Summary"
158  << ":" << (isValid() ? "Valid" : "Invalid") << ":" << sistrip::readoutView_ << ":" << fed_key.fedId() << "/"
159  << fed_key.feUnit() << "/" << fed_key.feChan() << ":" << sistrip::dqmRoot_ << sistrip::dir_ << "Collate"
160  << sistrip::dir_ << fed_key.path() << ":" << title << std::endl;
161 }
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 &)
const std::string & myName() const
bool isValid() const override
static const char dqmRoot_[]
const uint32_t & fecKey() const
const uint32_t & fedKey() const
static const char readoutView_[]

Friends And Related Function Documentation

◆ FastFedCablingAlgorithm

friend class FastFedCablingAlgorithm
friend

Definition at line 28 of file FastFedCablingAnalysis.h.

Member Data Documentation

◆ dcuHardId_

uint32_t FastFedCablingAnalysis::dcuHardId_
private

Extracted DCU id.

Definition at line 101 of file FastFedCablingAnalysis.h.

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

◆ dirtyThreshold_

const float FastFedCablingAnalysis::dirtyThreshold_ = 800
static

Level [ADC] below which fibre is defined as "dirty".

Definition at line 86 of file FastFedCablingAnalysis.h.

Referenced by FastFedCablingHistosUsingDb::create(), and isDirty().

◆ highMean_

float FastFedCablingAnalysis::highMean_
private

Definition at line 110 of file FastFedCablingAnalysis.h.

Referenced by highLevel(), isDirty(), isValid(), print(), and reset().

◆ highMedian_

float FastFedCablingAnalysis::highMedian_
private

Definition at line 107 of file FastFedCablingAnalysis.h.

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

◆ highRms_

float FastFedCablingAnalysis::highRms_
private

Definition at line 113 of file FastFedCablingAnalysis.h.

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

◆ lldCh_

uint16_t FastFedCablingAnalysis::lldCh_
private

Extracted LLD channel.

Definition at line 104 of file FastFedCablingAnalysis.h.

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

◆ lowMean_

float FastFedCablingAnalysis::lowMean_
private

Definition at line 119 of file FastFedCablingAnalysis.h.

Referenced by badTrimDac(), isValid(), lowLevel(), print(), and reset().

◆ lowMedian_

float FastFedCablingAnalysis::lowMedian_
private

Definition at line 116 of file FastFedCablingAnalysis.h.

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

◆ lowRms_

float FastFedCablingAnalysis::lowRms_
private

Definition at line 122 of file FastFedCablingAnalysis.h.

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

◆ max_

float FastFedCablingAnalysis::max_
private

Definition at line 131 of file FastFedCablingAnalysis.h.

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

◆ midRange_

float FastFedCablingAnalysis::midRange_
private

Definition at line 128 of file FastFedCablingAnalysis.h.

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

◆ min_

float FastFedCablingAnalysis::min_
private

Definition at line 134 of file FastFedCablingAnalysis.h.

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

◆ nBitsForDcuId_

const uint16_t FastFedCablingAnalysis::nBitsForDcuId_ = 32
static

Definition at line 92 of file FastFedCablingAnalysis.h.

Referenced by FastFedCablingAlgorithm::analyse().

◆ nBitsForLldCh_

const uint16_t FastFedCablingAnalysis::nBitsForLldCh_ = 2
static

Definition at line 95 of file FastFedCablingAnalysis.h.

Referenced by FastFedCablingAlgorithm::analyse().

◆ range_

float FastFedCablingAnalysis::range_
private

Definition at line 125 of file FastFedCablingAnalysis.h.

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

◆ threshold_

const float FastFedCablingAnalysis::threshold_ = 100.
static

Threshold to identify digital high from digital low.

Definition at line 83 of file FastFedCablingAnalysis.h.

Referenced by FastFedCablingAlgorithm::analyse(), and FastFedCablingHistosUsingDb::create().

◆ trimDacThreshold_

const float FastFedCablingAnalysis::trimDacThreshold_ = 10
static

Level [ADC] below which TrimDAC setting is defined as "bad".

Definition at line 89 of file FastFedCablingAnalysis.h.

Referenced by badTrimDac().