CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes | Friends
NoiseAnalysis Class Reference

Histogram-based analysis for pedestal run. More...

#include <NoiseAnalysis.h>

Inheritance diagram for NoiseAnalysis:
CommissioningAnalysis

Public Member Functions

const VVIntdead () const
 
bool isValid () const override
 
const VVFloatnoise () const
 
 NoiseAnalysis (const uint32_t &key)
 
 NoiseAnalysis ()
 
const VFloatnoiseMax () const
 
const VFloatnoiseMean () const
 
const VFloatnoiseMin () const
 
const VFloatnoiseSpread () const
 
const VVIntnoisy () const
 
const VVFloatpeds () const
 
const VFloatpedsMax () const
 
const VFloatpedsMean () const
 
const VFloatpedsMin () const
 
const VFloatpedsSpread () const
 
void print (std::stringstream &, uint32_t apv_number=0) override
 
const VVFloatraw () const
 
const VFloatrawMax () const
 
const VFloatrawMean () const
 
const VFloatrawMin () const
 
const VFloatrawSpread () const
 
void reset () override
 
void summary (std::stringstream &) const override
 
 ~NoiseAnalysis () 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 ()
 

Private Attributes

VVInt dead_
 
bool legacy_
 
VVFloat noise_
 
VFloat noiseMax_
 
VFloat noiseMean_
 
VFloat noiseMin_
 
VFloat noiseSpread_
 
VVInt noisy_
 
VVFloat peds_
 
VFloat pedsMax_
 
VFloat pedsMean_
 
VFloat pedsMin_
 
VFloat pedsSpread_
 
VVFloat raw_
 
VFloat rawMax_
 
VFloat rawMean_
 
VFloat rawMin_
 
VFloat rawSpread_
 

Friends

class NoiseAlgorithm
 

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 pedestal run.

Author
M. Wingham, R.Bainbridge

Definition at line 15 of file NoiseAnalysis.h.

Constructor & Destructor Documentation

◆ NoiseAnalysis() [1/2]

NoiseAnalysis::NoiseAnalysis ( const uint32_t &  key)

Definition at line 13 of file NoiseAnalysis.cc.

References dead_, and noisy_.

14  : CommissioningAnalysis(key, "NoiseAnalysis"),
15  peds_(2, VFloat(128, sistrip::invalid_)),
17  raw_(2, VFloat(128, sistrip::invalid_)),
32  legacy_(false) {
33  dead_[0].reserve(256);
34  dead_[1].reserve(256);
35  noisy_[0].reserve(256);
36  noisy_[1].reserve(256);
37 }
VFloat pedsMean_
Definition: NoiseAnalysis.h:93
VFloat noiseMean_
Definition: NoiseAnalysis.h:99
std::vector< float > VFloat
VVFloat noise_
Definition: NoiseAnalysis.h:77
std::vector< uint16_t > VInt
VFloat noiseSpread_
static const uint16_t invalid_
Definition: Constants.h:16
VFloat pedsSpread_
Definition: NoiseAnalysis.h:96

◆ NoiseAnalysis() [2/2]

NoiseAnalysis::NoiseAnalysis ( )

Definition at line 41 of file NoiseAnalysis.cc.

References dead_, and noisy_.

42  : CommissioningAnalysis("NoiseAnalysis"),
43  peds_(2, VFloat(128, sistrip::invalid_)),
45  raw_(2, VFloat(128, sistrip::invalid_)),
60  legacy_(false) {
61  dead_[0].reserve(256);
62  dead_[1].reserve(256);
63  noisy_[0].reserve(256);
64  noisy_[1].reserve(256);
65 }
VFloat pedsMean_
Definition: NoiseAnalysis.h:93
VFloat noiseMean_
Definition: NoiseAnalysis.h:99
std::vector< float > VFloat
VVFloat noise_
Definition: NoiseAnalysis.h:77
std::vector< uint16_t > VInt
VFloat noiseSpread_
static const uint16_t invalid_
Definition: Constants.h:16
VFloat pedsSpread_
Definition: NoiseAnalysis.h:96

◆ ~NoiseAnalysis()

NoiseAnalysis::~NoiseAnalysis ( )
inlineoverride

Definition at line 23 of file NoiseAnalysis.h.

23 { ; }

Member Function Documentation

◆ dead()

const NoiseAnalysis::VVInt & NoiseAnalysis::dead ( ) const
inline

Definition at line 138 of file NoiseAnalysis.h.

References dead_.

138 { return dead_; }

◆ isValid()

bool NoiseAnalysis::isValid ( void  ) const
overridevirtual

Identifies if analysis is valid or not.

Reimplemented from CommissioningAnalysis.

Definition at line 96 of file NoiseAnalysis.cc.

References relativeConstraints::empty, CommissioningAnalysis::getErrorCodes(), sistrip::maximum_, noiseMax_, noiseMean_, noiseMin_, noiseSpread_, pedsMax_, pedsMean_, pedsMin_, pedsSpread_, rawMax_, rawMean_, rawMin_, and rawSpread_.

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

96  {
106  //noiseMean_[0] <= rawMean_[0] && //@@ temp
107  //noiseMean_[1] <= rawMean_[1] ); //@@ temp
108 }
const VString & getErrorCodes() const
VFloat pedsMean_
Definition: NoiseAnalysis.h:93
VFloat noiseMean_
Definition: NoiseAnalysis.h:99
static const uint16_t maximum_
Definition: Constants.h:20
VFloat noiseSpread_
VFloat pedsSpread_
Definition: NoiseAnalysis.h:96

◆ noise()

const NoiseAnalysis::VVFloat & NoiseAnalysis::noise ( ) const
inline

Definition at line 135 of file NoiseAnalysis.h.

References noise_.

135 { return noise_; }
VVFloat noise_
Definition: NoiseAnalysis.h:77

◆ noiseMax()

const NoiseAnalysis::VFloat & NoiseAnalysis::noiseMax ( ) const
inline

Definition at line 150 of file NoiseAnalysis.h.

References noiseMax_.

150 { return noiseMax_; }

◆ noiseMean()

const NoiseAnalysis::VFloat & NoiseAnalysis::noiseMean ( ) const
inline

Definition at line 143 of file NoiseAnalysis.h.

References noiseMean_.

143 { return noiseMean_; }
VFloat noiseMean_
Definition: NoiseAnalysis.h:99

◆ noiseMin()

const NoiseAnalysis::VFloat & NoiseAnalysis::noiseMin ( ) const
inline

Definition at line 151 of file NoiseAnalysis.h.

References noiseMin_.

151 { return noiseMin_; }

◆ noiseSpread()

const NoiseAnalysis::VFloat & NoiseAnalysis::noiseSpread ( ) const
inline

Definition at line 144 of file NoiseAnalysis.h.

References noiseSpread_.

144 { return noiseSpread_; }
VFloat noiseSpread_

◆ noisy()

const NoiseAnalysis::VVInt & NoiseAnalysis::noisy ( ) const
inline

Definition at line 139 of file NoiseAnalysis.h.

References noisy_.

139 { return noisy_; }

◆ peds()

const NoiseAnalysis::VVFloat & NoiseAnalysis::peds ( ) const
inline

Definition at line 134 of file NoiseAnalysis.h.

References peds_.

134 { return peds_; }

◆ pedsMax()

const NoiseAnalysis::VFloat & NoiseAnalysis::pedsMax ( ) const
inline

Definition at line 148 of file NoiseAnalysis.h.

References pedsMax_.

148 { return pedsMax_; }

◆ pedsMean()

const NoiseAnalysis::VFloat & NoiseAnalysis::pedsMean ( ) const
inline

Definition at line 141 of file NoiseAnalysis.h.

References pedsMean_.

141 { return pedsMean_; }
VFloat pedsMean_
Definition: NoiseAnalysis.h:93

◆ pedsMin()

const NoiseAnalysis::VFloat & NoiseAnalysis::pedsMin ( ) const
inline

Definition at line 149 of file NoiseAnalysis.h.

References pedsMin_.

149 { return pedsMin_; }

◆ pedsSpread()

const NoiseAnalysis::VFloat & NoiseAnalysis::pedsSpread ( ) const
inline

Definition at line 142 of file NoiseAnalysis.h.

References pedsSpread_.

142 { return pedsSpread_; }
VFloat pedsSpread_
Definition: NoiseAnalysis.h:96

◆ print()

void NoiseAnalysis::print ( std::stringstream &  ss,
uint32_t  apv_number = 0 
)
overridevirtual

Prints analysis results.

Implements CommissioningAnalysis.

Definition at line 173 of file NoiseAnalysis.cc.

References dead_, relativeConstraints::empty, alignBH_cfg::fixed, CommissioningAnalysis::getErrorCodes(), CommissioningAnalysis::header(), cuy::ii, isValid(), sistrip::mlCommissioning_, CommissioningAnalysis::myName(), noise_, noiseMax_, noiseMean_, noiseMin_, noiseSpread_, noisy_, peds_, pedsMax_, pedsMean_, pedsMin_, pedsSpread_, raw_, rawMax_, rawMean_, rawMin_, rawSpread_, findQualityFiles::size, and contentValuesCheck::ss.

173  {
174  if (iapv == 1 || iapv == 2) {
175  iapv--;
176  } else {
177  iapv = 0;
178  }
179 
180  if (peds_[iapv].size() < 128 || noise_[iapv].size() < 128 || raw_[iapv].size() < 128) {
181  edm::LogWarning(mlCommissioning_) << "[" << myName() << "::" << __func__ << "]"
182  << " Unexpected number of pedestal/noise values: " << peds_[iapv].size() << ", "
183  << noise_[iapv].size() << ", " << raw_[iapv].size();
184  return;
185  }
186 
187  header(ss);
188  ss << " Monitorables for APV number : " << iapv;
189  if (iapv == 0) {
190  ss << " (first of pair)";
191  } else if (iapv == 1) {
192  ss << " (second of pair)";
193  }
194  ss << std::endl;
195  ss << std::fixed << std::setprecision(2);
196  ss << " Example peds/noise for strips : "
197  << " 0, 31, 63, 127" << std::endl
198  << " Peds [ADC] : " << std::setw(6) << peds_[iapv][0] << ", " << std::setw(6)
199  << peds_[iapv][31] << ", " << std::setw(6) << peds_[iapv][63] << ", " << std::setw(6) << peds_[iapv][127]
200  << std::endl
201  << " Noise [ADC] : " << std::setw(6) << noise_[iapv][0] << ", " << std::setw(6)
202  << noise_[iapv][31] << ", " << std::setw(6) << noise_[iapv][63] << ", " << std::setw(6) << noise_[iapv][127]
203  << std::endl
204  << " Raw noise [ADC] : " << std::setw(6) << raw_[iapv][0] << ", " << std::setw(6) << raw_[iapv][31]
205  << ", " << std::setw(6) << raw_[iapv][63] << ", " << std::setw(6) << raw_[iapv][127] << std::endl
206  << " Dead strips (<5s) [strip] : (" << dead_[iapv].size() << " in total) ";
207  for (uint16_t ii = 0; ii < dead_[iapv].size(); ii++) {
208  ss << dead_[iapv][ii] << " ";
209  }
210 
211  ss << std::endl;
212  ss << " Noisy strips (>5s) [strip] : (" << noisy_[iapv].size() << " in total) ";
213  for (uint16_t ii = 0; ii < noisy_[iapv].size(); ii++) {
214  ss << noisy_[iapv][ii] << " ";
215  }
216  ss << std::endl;
217  ss << " Mean peds +/- spread [ADC] : " << pedsMean_[iapv] << " +/- " << pedsSpread_[iapv] << std::endl
218  << " Min/Max pedestal [ADC] : " << pedsMin_[iapv] << " <-> " << pedsMax_[iapv] << std::endl
219  << " Mean noise +/- spread [ADC] : " << noiseMean_[iapv] << " +/- " << noiseSpread_[iapv] << std::endl
220  << " Min/Max noise [ADC] : " << noiseMin_[iapv] << " <-> " << noiseMax_[iapv] << std::endl
221  << " Mean raw noise +/- spread [ADC] : " << rawMean_[iapv] << " +/- " << rawSpread_[iapv] << std::endl
222  << " Min/Max raw noise [ADC] : " << rawMin_[iapv] << " <-> " << rawMax_[iapv] << std::endl
223  << " Normalised noise : "
224  << "(yet to be implemented...)" << std::endl
225  << std::boolalpha << " isValid : " << isValid() << std::endl
226  << std::noboolalpha << " Error codes (found " << std::setw(2) << std::setfill(' ') << getErrorCodes().size()
227  << ") : ";
228  if (getErrorCodes().empty()) {
229  ss << "(none)";
230  } else {
231  VString::const_iterator istr = getErrorCodes().begin();
232  VString::const_iterator jstr = getErrorCodes().end();
233  for (; istr != jstr; ++istr) {
234  ss << *istr << " ";
235  }
236  }
237  ss << std::endl;
238 }
size
Write out results.
const VString & getErrorCodes() const
VFloat pedsMean_
Definition: NoiseAnalysis.h:93
VFloat noiseMean_
Definition: NoiseAnalysis.h:99
const std::string & myName() const
static const char mlCommissioning_[]
VVFloat noise_
Definition: NoiseAnalysis.h:77
ii
Definition: cuy.py:589
VFloat noiseSpread_
virtual void header(std::stringstream &) const
VFloat pedsSpread_
Definition: NoiseAnalysis.h:96
Log< level::Warning, false > LogWarning
bool isValid() const override

◆ raw()

const NoiseAnalysis::VVFloat & NoiseAnalysis::raw ( ) const
inline

Definition at line 136 of file NoiseAnalysis.h.

References raw_.

136 { return raw_; }

◆ rawMax()

const NoiseAnalysis::VFloat & NoiseAnalysis::rawMax ( ) const
inline

Definition at line 152 of file NoiseAnalysis.h.

References rawMax_.

152 { return rawMax_; }

◆ rawMean()

const NoiseAnalysis::VFloat & NoiseAnalysis::rawMean ( ) const
inline

Definition at line 145 of file NoiseAnalysis.h.

References rawMean_.

145 { return rawMean_; }

◆ rawMin()

const NoiseAnalysis::VFloat & NoiseAnalysis::rawMin ( ) const
inline

Definition at line 153 of file NoiseAnalysis.h.

References rawMin_.

153 { return rawMin_; }

◆ rawSpread()

const NoiseAnalysis::VFloat & NoiseAnalysis::rawSpread ( ) const
inline

Definition at line 146 of file NoiseAnalysis.h.

References rawSpread_.

146 { return rawSpread_; }

◆ reset()

void NoiseAnalysis::reset ( void  )
overridevirtual

Resets analysis member data.

Implements CommissioningAnalysis.

Definition at line 69 of file NoiseAnalysis.cc.

References dead_, sistrip::invalid_, legacy_, noise_, noiseMax_, noiseMean_, noiseMin_, noiseSpread_, noisy_, peds_, pedsMax_, pedsMean_, pedsMin_, pedsSpread_, raw_, rawMax_, rawMean_, rawMin_, and rawSpread_.

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

69  {
87  dead_[0].reserve(256);
88  dead_[1].reserve(256);
89  noisy_[0].reserve(256);
90  noisy_[1].reserve(256);
91  legacy_ = false;
92 }
VFloat pedsMean_
Definition: NoiseAnalysis.h:93
VFloat noiseMean_
Definition: NoiseAnalysis.h:99
std::vector< float > VFloat
VVFloat noise_
Definition: NoiseAnalysis.h:77
std::vector< uint16_t > VInt
VFloat noiseSpread_
std::vector< VInt > VVInt
static const uint16_t invalid_
Definition: Constants.h:16
VFloat pedsSpread_
Definition: NoiseAnalysis.h:96
std::vector< VFloat > VVFloat

◆ summary()

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

Overrides base method.

Reimplemented from CommissioningAnalysis.

Definition at line 112 of file NoiseAnalysis.cc.

References sistrip::APV, SiStripFecKey::ccuAddr(), SiStripFecKey::ccuChan(), sistrip::extrainfo::commonMode_, sistrip::controlView_, sistrip::dir_, sistrip::dqmRoot_, sistrip::EXPERT_HISTO, SiStripFecKey::fecCrate(), CommissioningAnalysis::fecKey(), SiStripFecKey::fecRing(), SiStripFecKey::fecSlot(), sistrip::FED_KEY, CommissioningAnalysis::fedKey(), SiStripFecKey::i2cAddr(), isValid(), SiStripKey::key(), legacy_, sistrip::LLD_CHAN, SiStripFecKey::lldChan(), CommissioningAnalysis::myName(), castor_dqm_sourceclient_file_cfg::path, sistrip::extrainfo::pedestals_, sistrip::extrainfo::pedsAndCmSubNoise_, sistrip::extrainfo::pedsAndRawNoise_, sistrip::extrainfo::rawNoise_, SiStripEnumsAndStrings::runType(), contentValuesCheck::ss, AlCaHLTBitMon_QueryRunRegistry::string, and runGCPTkAlMap::title.

112  {
113  SiStripFecKey fec_key(fecKey());
114  SiStripFedKey fed_key(fedKey());
115 
117 
118  std::stringstream extra1, extra2, extra3;
119  if (legacy_) {
123  } else {
127  }
128 
130  type,
132  fed_key.key(),
134  fec_key.lldChan(),
135  extra1.str())
136  .title();
138  type,
140  fed_key.key(),
142  fec_key.lldChan(),
143  extra2.str())
144  .title();
146  type,
148  fed_key.key(),
149  sistrip::APV,
150  SiStripFecKey::i2cAddr(fec_key.lldChan(), true),
151  extra3.str())
152  .title();
154  type,
156  fed_key.key(),
157  sistrip::APV,
158  SiStripFecKey::i2cAddr(fec_key.lldChan(), false),
159  extra3.str())
160  .title();
161 
162  ss << " Summary"
163  << ":" << (isValid() ? "Valid" : "Invalid") << ":" << sistrip::controlView_ << ":" << fec_key.fecCrate() << "/"
164  << fec_key.fecSlot() << "/" << fec_key.fecRing() << "/" << fec_key.ccuAddr() << "/" << fec_key.ccuChan() << ":"
165  << sistrip::dqmRoot_ << sistrip::dir_ << "Collate" << sistrip::dir_
166  << SiStripFecKey(fec_key.fecCrate(), fec_key.fecSlot(), fec_key.fecRing(), fec_key.ccuAddr(), fec_key.ccuChan())
167  .path()
168  << ":" << title1 << ";" << title2 << ";" << title3 << ";" << title4 << std::endl;
169 }
static const char rawNoise_[]
static const char pedsAndRawNoise_[]
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
const uint16_t & i2cAddr() const
static const char controlView_[]
static const char dqmRoot_[]
const uint32_t & fecKey() const
static const char commonMode_[]
const uint32_t & fedKey() const
static const char pedestals_[]
static const char pedsAndCmSubNoise_[]
bool isValid() const override

Friends And Related Function Documentation

◆ NoiseAlgorithm

friend class NoiseAlgorithm
friend

Definition at line 25 of file NoiseAnalysis.h.

Member Data Documentation

◆ dead_

VVInt NoiseAnalysis::dead_
private

Dead strips.

Definition at line 85 of file NoiseAnalysis.h.

Referenced by dead(), NoiseAnalysis(), print(), and reset().

◆ legacy_

bool NoiseAnalysis::legacy_
private

Definition at line 129 of file NoiseAnalysis.h.

Referenced by reset(), and summary().

◆ noise_

VVFloat NoiseAnalysis::noise_
private

Noise values.

Definition at line 77 of file NoiseAnalysis.h.

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

◆ noiseMax_

VFloat NoiseAnalysis::noiseMax_
private

Max noise value.

Definition at line 117 of file NoiseAnalysis.h.

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

◆ noiseMean_

VFloat NoiseAnalysis::noiseMean_
private

Mean noise value.

Definition at line 99 of file NoiseAnalysis.h.

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

◆ noiseMin_

VFloat NoiseAnalysis::noiseMin_
private

Min noise value.

Definition at line 120 of file NoiseAnalysis.h.

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

◆ noiseSpread_

VFloat NoiseAnalysis::noiseSpread_
private

Rms spread in noise.

Definition at line 102 of file NoiseAnalysis.h.

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

◆ noisy_

VVInt NoiseAnalysis::noisy_
private

Noisy strips.

Definition at line 88 of file NoiseAnalysis.h.

Referenced by NoiseAnalysis(), noisy(), print(), and reset().

◆ peds_

VVFloat NoiseAnalysis::peds_
private

Peds values.

Definition at line 74 of file NoiseAnalysis.h.

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

◆ pedsMax_

VFloat NoiseAnalysis::pedsMax_
private

Max peds value.

Definition at line 111 of file NoiseAnalysis.h.

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

◆ pedsMean_

VFloat NoiseAnalysis::pedsMean_
private

Mean peds value.

Definition at line 93 of file NoiseAnalysis.h.

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

◆ pedsMin_

VFloat NoiseAnalysis::pedsMin_
private

Min peds value.

Definition at line 114 of file NoiseAnalysis.h.

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

◆ pedsSpread_

VFloat NoiseAnalysis::pedsSpread_
private

Rms spread in peds.

Definition at line 96 of file NoiseAnalysis.h.

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

◆ raw_

VVFloat NoiseAnalysis::raw_
private

Raw noise values.

Definition at line 80 of file NoiseAnalysis.h.

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

◆ rawMax_

VFloat NoiseAnalysis::rawMax_
private

Max raw noise value.

Definition at line 123 of file NoiseAnalysis.h.

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

◆ rawMean_

VFloat NoiseAnalysis::rawMean_
private

Mean raw noise value.

Definition at line 105 of file NoiseAnalysis.h.

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

◆ rawMin_

VFloat NoiseAnalysis::rawMin_
private

Min raw noise value.

Definition at line 126 of file NoiseAnalysis.h.

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

◆ rawSpread_

VFloat NoiseAnalysis::rawSpread_
private

Rms spread in raw noise.

Definition at line 108 of file NoiseAnalysis.h.

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