CMS 3D CMS Logo

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

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

#include <PedestalsAnalysis.h>

Inheritance diagram for PedestalsAnalysis:
CommissioningAnalysis

Public Member Functions

const VVIntdead () const
 
bool isValid () const override
 
const VVFloatnoise () const
 
const VFloatnoiseMax () const
 
const VFloatnoiseMean () const
 
const VFloatnoiseMin () const
 
const VFloatnoiseSpread () const
 
const VVIntnoisy () const
 
 PedestalsAnalysis (const uint32_t &key)
 
 PedestalsAnalysis ()
 
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
 
 ~PedestalsAnalysis () 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 PedestalsAlgorithm
 

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 PedestalsAnalysis.h.

Constructor & Destructor Documentation

◆ PedestalsAnalysis() [1/2]

PedestalsAnalysis::PedestalsAnalysis ( const uint32_t &  key)

Definition at line 13 of file PedestalsAnalysis.cc.

References dead_, and noisy_.

14  : CommissioningAnalysis(key, "PedestalsAnalysis"),
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 }
std::vector< float > VFloat
key
prepare the HTCondor submission files and eventually submit them
std::vector< uint16_t > VInt
static const uint16_t invalid_
Definition: Constants.h:16

◆ PedestalsAnalysis() [2/2]

PedestalsAnalysis::PedestalsAnalysis ( )

Definition at line 41 of file PedestalsAnalysis.cc.

References dead_, and noisy_.

42  : CommissioningAnalysis("PedestalsAnalysis"),
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 }
std::vector< float > VFloat
std::vector< uint16_t > VInt
static const uint16_t invalid_
Definition: Constants.h:16

◆ ~PedestalsAnalysis()

PedestalsAnalysis::~PedestalsAnalysis ( )
inlineoverride

Definition at line 23 of file PedestalsAnalysis.h.

23 { ; }

Member Function Documentation

◆ dead()

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

Definition at line 138 of file PedestalsAnalysis.h.

References dead_.

138 { return dead_; }

◆ isValid()

bool PedestalsAnalysis::isValid ( void  ) const
overridevirtual

Identifies if analysis is valid or not.

Reimplemented from CommissioningAnalysis.

Definition at line 96 of file PedestalsAnalysis.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
static const uint16_t maximum_
Definition: Constants.h:20

◆ noise()

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

Definition at line 135 of file PedestalsAnalysis.h.

References noise_.

135 { return noise_; }

◆ noiseMax()

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

Definition at line 150 of file PedestalsAnalysis.h.

References noiseMax_.

150 { return noiseMax_; }

◆ noiseMean()

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

Definition at line 143 of file PedestalsAnalysis.h.

References noiseMean_.

143 { return noiseMean_; }

◆ noiseMin()

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

Definition at line 151 of file PedestalsAnalysis.h.

References noiseMin_.

151 { return noiseMin_; }

◆ noiseSpread()

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

Definition at line 144 of file PedestalsAnalysis.h.

References noiseSpread_.

144 { return noiseSpread_; }

◆ noisy()

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

Definition at line 139 of file PedestalsAnalysis.h.

References noisy_.

139 { return noisy_; }

◆ peds()

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

Definition at line 134 of file PedestalsAnalysis.h.

References peds_.

134 { return peds_; }

◆ pedsMax()

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

Definition at line 148 of file PedestalsAnalysis.h.

References pedsMax_.

148 { return pedsMax_; }

◆ pedsMean()

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

Definition at line 141 of file PedestalsAnalysis.h.

References pedsMean_.

141 { return pedsMean_; }

◆ pedsMin()

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

Definition at line 149 of file PedestalsAnalysis.h.

References pedsMin_.

149 { return pedsMin_; }

◆ pedsSpread()

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

Definition at line 142 of file PedestalsAnalysis.h.

References pedsSpread_.

142 { return pedsSpread_; }

◆ print()

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

Prints analysis results.

Implements CommissioningAnalysis.

Definition at line 173 of file PedestalsAnalysis.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
const std::string & myName() const
static const char mlCommissioning_[]
bool isValid() const override
ii
Definition: cuy.py:589
virtual void header(std::stringstream &) const
Log< level::Warning, false > LogWarning

◆ raw()

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

Definition at line 136 of file PedestalsAnalysis.h.

References raw_.

136 { return raw_; }

◆ rawMax()

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

Definition at line 152 of file PedestalsAnalysis.h.

References rawMax_.

152 { return rawMax_; }

◆ rawMean()

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

Definition at line 145 of file PedestalsAnalysis.h.

References rawMean_.

145 { return rawMean_; }

◆ rawMin()

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

Definition at line 153 of file PedestalsAnalysis.h.

References rawMin_.

153 { return rawMin_; }

◆ rawSpread()

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

Definition at line 146 of file PedestalsAnalysis.h.

References rawSpread_.

146 { return rawSpread_; }

◆ reset()

void PedestalsAnalysis::reset ( void  )
overridevirtual

Resets analysis member data.

Implements CommissioningAnalysis.

Definition at line 69 of file PedestalsAnalysis.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 }
std::vector< float > VFloat
std::vector< uint16_t > VInt
std::vector< VInt > VVInt
static const uint16_t invalid_
Definition: Constants.h:16
std::vector< VFloat > VVFloat

◆ summary()

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

Overrides base method.

Reimplemented from CommissioningAnalysis.

Definition at line 112 of file PedestalsAnalysis.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(), EnsembleCalibrationLA_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
bool isValid() const override
static const char pedestals_[]
static const char pedsAndCmSubNoise_[]

Friends And Related Function Documentation

◆ PedestalsAlgorithm

friend class PedestalsAlgorithm
friend

Definition at line 25 of file PedestalsAnalysis.h.

Member Data Documentation

◆ dead_

VVInt PedestalsAnalysis::dead_
private

Dead strips.

Definition at line 85 of file PedestalsAnalysis.h.

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

◆ legacy_

bool PedestalsAnalysis::legacy_
private

Definition at line 129 of file PedestalsAnalysis.h.

Referenced by reset(), and summary().

◆ noise_

VVFloat PedestalsAnalysis::noise_
private

Noise values.

Definition at line 77 of file PedestalsAnalysis.h.

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

◆ noiseMax_

VFloat PedestalsAnalysis::noiseMax_
private

Max noise value.

Definition at line 117 of file PedestalsAnalysis.h.

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

◆ noiseMean_

VFloat PedestalsAnalysis::noiseMean_
private

Mean noise value.

Definition at line 99 of file PedestalsAnalysis.h.

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

◆ noiseMin_

VFloat PedestalsAnalysis::noiseMin_
private

Min noise value.

Definition at line 120 of file PedestalsAnalysis.h.

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

◆ noiseSpread_

VFloat PedestalsAnalysis::noiseSpread_
private

Rms spread in noise.

Definition at line 102 of file PedestalsAnalysis.h.

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

◆ noisy_

VVInt PedestalsAnalysis::noisy_
private

Noisy strips.

Definition at line 88 of file PedestalsAnalysis.h.

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

◆ peds_

VVFloat PedestalsAnalysis::peds_
private

Peds values.

Definition at line 74 of file PedestalsAnalysis.h.

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

◆ pedsMax_

VFloat PedestalsAnalysis::pedsMax_
private

Max peds value.

Definition at line 111 of file PedestalsAnalysis.h.

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

◆ pedsMean_

VFloat PedestalsAnalysis::pedsMean_
private

Mean peds value.

Definition at line 93 of file PedestalsAnalysis.h.

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

◆ pedsMin_

VFloat PedestalsAnalysis::pedsMin_
private

Min peds value.

Definition at line 114 of file PedestalsAnalysis.h.

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

◆ pedsSpread_

VFloat PedestalsAnalysis::pedsSpread_
private

Rms spread in peds.

Definition at line 96 of file PedestalsAnalysis.h.

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

◆ raw_

VVFloat PedestalsAnalysis::raw_
private

Raw noise values.

Definition at line 80 of file PedestalsAnalysis.h.

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

◆ rawMax_

VFloat PedestalsAnalysis::rawMax_
private

Max raw noise value.

Definition at line 123 of file PedestalsAnalysis.h.

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

◆ rawMean_

VFloat PedestalsAnalysis::rawMean_
private

Mean raw noise value.

Definition at line 105 of file PedestalsAnalysis.h.

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

◆ rawMin_

VFloat PedestalsAnalysis::rawMin_
private

Min raw noise value.

Definition at line 126 of file PedestalsAnalysis.h.

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

◆ rawSpread_

VFloat PedestalsAnalysis::rawSpread_
private

Rms spread in raw noise.

Definition at line 108 of file PedestalsAnalysis.h.

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