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

Author
M. Wingham, R.Bainbridge

Definition at line 15 of file PedestalsAnalysis.h.

Constructor & Destructor Documentation

PedestalsAnalysis::PedestalsAnalysis ( const uint32_t &  key)

Definition at line 13 of file PedestalsAnalysis.cc.

References dead_, and noisy_.

14  : CommissioningAnalysis(key,"PedestalsAnalysis"),
17  raw_(2,VFloat(128,sistrip::invalid_)),
32  legacy_(false)
33 {
34  dead_[0].reserve(256); dead_[1].reserve(256);
35  noisy_[0].reserve(256); noisy_[1].reserve(256);
36 }
std::vector< float > VFloat
std::vector< uint16_t > VInt
static const uint16_t invalid_
Definition: Constants.h:16
PedestalsAnalysis::PedestalsAnalysis ( )

Definition at line 40 of file PedestalsAnalysis.cc.

References dead_, and noisy_.

41  : CommissioningAnalysis("PedestalsAnalysis"),
44  raw_(2,VFloat(128,sistrip::invalid_)),
59  legacy_(false)
60 {
61  dead_[0].reserve(256); dead_[1].reserve(256);
62  noisy_[0].reserve(256); noisy_[1].reserve(256);
63 }
std::vector< float > VFloat
std::vector< uint16_t > VInt
static const uint16_t invalid_
Definition: Constants.h:16
PedestalsAnalysis::~PedestalsAnalysis ( )
inlineoverride

Definition at line 25 of file PedestalsAnalysis.h.

25 {;}

Member Function Documentation

const PedestalsAnalysis::VVInt & PedestalsAnalysis::dead ( ) const
inline
bool PedestalsAnalysis::isValid ( void  ) const
overridevirtual

Identifies if analysis is valid or not.

Reimplemented from CommissioningAnalysis.

Definition at line 94 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(), PedestalsHistosUsingDb::create(), PedestalsHistograms::histoAnalysis(), print(), core.AutoHandle.AutoHandle::ReallyLoad(), and summary().

94  {
95  return ( pedsMean_[0] < sistrip::maximum_ &&
115  rawMax_[0] < sistrip::maximum_ &&
116  rawMax_[1] < sistrip::maximum_ &&
117  rawMin_[0] < sistrip::maximum_ &&
118  rawMin_[1] < sistrip::maximum_ &&
119  getErrorCodes().empty() );
120  //noiseMean_[0] <= rawMean_[0] && //@@ temp
121  //noiseMean_[1] <= rawMean_[1] ); //@@ temp
122 }
static const uint16_t maximum_
Definition: Constants.h:20
const VString & getErrorCodes() const
const PedestalsAnalysis::VVFloat & PedestalsAnalysis::noise ( ) const
inline

Definition at line 139 of file PedestalsAnalysis.h.

References noise_.

Referenced by PedestalsSummaryFactory::extract(), and PedestalsHistosUsingDb::update().

139 { return noise_; }
const PedestalsAnalysis::VFloat & PedestalsAnalysis::noiseMax ( ) const
inline

Definition at line 154 of file PedestalsAnalysis.h.

References noiseMax_.

Referenced by PedestalsHistosUsingDb::create(), and PedestalsSummaryFactory::extract().

154 { return noiseMax_; }
const PedestalsAnalysis::VFloat & PedestalsAnalysis::noiseMean ( ) const
inline

Definition at line 147 of file PedestalsAnalysis.h.

References noiseMean_.

Referenced by PedestalsHistosUsingDb::create(), and PedestalsSummaryFactory::extract().

147 { return noiseMean_; }
const PedestalsAnalysis::VFloat & PedestalsAnalysis::noiseMin ( ) const
inline

Definition at line 155 of file PedestalsAnalysis.h.

References noiseMin_.

Referenced by PedestalsHistosUsingDb::create(), and PedestalsSummaryFactory::extract().

155 { return noiseMin_; }
const PedestalsAnalysis::VFloat & PedestalsAnalysis::noiseSpread ( ) const
inline

Definition at line 148 of file PedestalsAnalysis.h.

References noiseSpread_.

Referenced by PedestalsHistosUsingDb::create(), and PedestalsSummaryFactory::extract().

148 { return noiseSpread_; }
const PedestalsAnalysis::VVInt & PedestalsAnalysis::noisy ( ) const
inline
const PedestalsAnalysis::VVFloat & PedestalsAnalysis::peds ( ) const
inline

Definition at line 138 of file PedestalsAnalysis.h.

References peds_.

Referenced by PedestalsSummaryFactory::extract(), and PedestalsHistosUsingDb::update().

138 { return peds_; }
const PedestalsAnalysis::VFloat & PedestalsAnalysis::pedsMax ( ) const
inline

Definition at line 152 of file PedestalsAnalysis.h.

References pedsMax_.

Referenced by PedestalsHistosUsingDb::create(), and PedestalsSummaryFactory::extract().

152 { return pedsMax_; }
const PedestalsAnalysis::VFloat & PedestalsAnalysis::pedsMean ( ) const
inline

Definition at line 145 of file PedestalsAnalysis.h.

References pedsMean_.

Referenced by PedestalsHistosUsingDb::create(), and PedestalsSummaryFactory::extract().

145 { return pedsMean_; }
const PedestalsAnalysis::VFloat & PedestalsAnalysis::pedsMin ( ) const
inline
const PedestalsAnalysis::VFloat & PedestalsAnalysis::pedsSpread ( ) const
inline

Definition at line 146 of file PedestalsAnalysis.h.

References pedsSpread_.

Referenced by PedestalsHistosUsingDb::create(), and PedestalsSummaryFactory::extract().

146 { return pedsSpread_; }
void PedestalsAnalysis::print ( std::stringstream &  ss,
uint32_t  apv_number = 0 
)
overridevirtual

Prints analysis results.

Implements CommissioningAnalysis.

Definition at line 200 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_, and findQualityFiles::size.

200  {
201 
202  if ( iapv == 1 || iapv == 2 ) { iapv--; }
203  else { iapv = 0; }
204 
205  if ( peds_[iapv].size() < 128 ||
206  noise_[iapv].size() < 128 ||
207  raw_[iapv].size() < 128 ) {
209  << "[" << myName() << "::" << __func__ << "]"
210  << " Unexpected number of pedestal/noise values: "
211  << peds_[iapv].size() << ", "
212  << noise_[iapv].size() << ", "
213  << raw_[iapv].size();
214  return;
215  }
216 
217  header( ss );
218  ss << " Monitorables for APV number : " << iapv;
219  if ( iapv == 0 ) { ss << " (first of pair)"; }
220  else if ( iapv == 1 ) { ss << " (second of pair)"; }
221  ss << std::endl;
222  ss << std::fixed << std::setprecision(2);
223  ss << " Example peds/noise for strips : "
224  << " 0, 31, 63, 127" << std::endl
225  << " Peds [ADC] : "
226  << std::setw(6) << peds_[iapv][0] << ", "
227  << std::setw(6) << peds_[iapv][31] << ", "
228  << std::setw(6) << peds_[iapv][63] << ", "
229  << std::setw(6) << peds_[iapv][127] << std::endl
230  << " Noise [ADC] : "
231  << std::setw(6) << noise_[iapv][0] << ", "
232  << std::setw(6) << noise_[iapv][31] << ", "
233  << std::setw(6) << noise_[iapv][63] << ", "
234  << std::setw(6) << noise_[iapv][127] << std::endl
235  << " Raw noise [ADC] : "
236  << std::setw(6) << raw_[iapv][0] << ", "
237  << std::setw(6) << raw_[iapv][31] << ", "
238  << std::setw(6) << raw_[iapv][63] << ", "
239  << std::setw(6) << raw_[iapv][127] << std::endl
240  << " Dead strips (<5s) [strip] : (" << dead_[iapv].size() << " in total) ";
241  for ( uint16_t ii = 0; ii < dead_[iapv].size(); ii++ ) {
242  ss << dead_[iapv][ii] << " "; }
243 
244  ss << std::endl;
245  ss << " Noisy strips (>5s) [strip] : (" << noisy_[iapv].size() << " in total) ";
246  for ( uint16_t ii = 0; ii < noisy_[iapv].size(); ii++ ) {
247  ss << noisy_[iapv][ii] << " ";
248  }
249  ss << std::endl;
250  ss << " Mean peds +/- spread [ADC] : " << pedsMean_[iapv] << " +/- " << pedsSpread_[iapv] << std::endl
251  << " Min/Max pedestal [ADC] : " << pedsMin_[iapv] << " <-> " << pedsMax_[iapv] << std::endl
252  << " Mean noise +/- spread [ADC] : " << noiseMean_[iapv] << " +/- " << noiseSpread_[iapv] << std::endl
253  << " Min/Max noise [ADC] : " << noiseMin_[iapv] << " <-> " << noiseMax_[iapv] << std::endl
254  << " Mean raw noise +/- spread [ADC] : " << rawMean_[iapv] << " +/- " << rawSpread_[iapv] << std::endl
255  << " Min/Max raw noise [ADC] : " << rawMin_[iapv] << " <-> " << rawMax_[iapv] << std::endl
256  << " Normalised noise : " << "(yet to be implemented...)" << std::endl
257  << std::boolalpha
258  << " isValid : " << isValid() << std::endl
259  << std::noboolalpha
260  << " Error codes (found "
261  << std::setw(2) << std::setfill(' ') << getErrorCodes().size()
262  << ") : ";
263  if ( getErrorCodes().empty() ) { ss << "(none)"; }
264  else {
265  VString::const_iterator istr = getErrorCodes().begin();
266  VString::const_iterator jstr = getErrorCodes().end();
267  for ( ; istr != jstr; ++istr ) { ss << *istr << " "; }
268  }
269  ss << std::endl;
270 }
size
Write out results.
bool isValid() const override
static const char mlCommissioning_[]
ii
Definition: cuy.py:590
virtual void header(std::stringstream &) const
const VString & getErrorCodes() const
const std::string & myName() const
const PedestalsAnalysis::VVFloat & PedestalsAnalysis::raw ( ) const
inline

Definition at line 140 of file PedestalsAnalysis.h.

References raw_.

140 { return raw_; }
const PedestalsAnalysis::VFloat & PedestalsAnalysis::rawMax ( ) const
inline

Definition at line 156 of file PedestalsAnalysis.h.

References rawMax_.

Referenced by PedestalsHistosUsingDb::create().

156 { return rawMax_; }
const PedestalsAnalysis::VFloat & PedestalsAnalysis::rawMean ( ) const
inline

Definition at line 149 of file PedestalsAnalysis.h.

References rawMean_.

Referenced by PedestalsHistosUsingDb::create().

149 { return rawMean_; }
const PedestalsAnalysis::VFloat & PedestalsAnalysis::rawMin ( ) const
inline

Definition at line 157 of file PedestalsAnalysis.h.

References rawMin_.

Referenced by PedestalsHistosUsingDb::create().

157 { return rawMin_; }
const PedestalsAnalysis::VFloat & PedestalsAnalysis::rawSpread ( ) const
inline

Definition at line 150 of file PedestalsAnalysis.h.

References rawSpread_.

Referenced by PedestalsHistosUsingDb::create().

150 { return rawSpread_; }
void PedestalsAnalysis::reset ( void  )
overridevirtual

Resets analysis member data.

Implements CommissioningAnalysis.

Definition at line 67 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().

67  {
85  dead_[0].reserve(256);
86  dead_[1].reserve(256);
87  noisy_[0].reserve(256);
88  noisy_[1].reserve(256);
89  legacy_ = false;
90 }
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
void PedestalsAnalysis::summary ( std::stringstream &  ss) const
overridevirtual

Overrides base method.

Reimplemented from CommissioningAnalysis.

Definition at line 126 of file PedestalsAnalysis.cc.

References sistrip::APV, SiStripFecKey::ccuAddr(), SiStripFecKey::ccuChan(), sistrip::extrainfo::commonMode_, sistrip::controlView_, sistrip::dir_, sistrip::dqmRoot_, sistrip::EXPERT_HISTO, funct::false, 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(), callgraph::path, sistrip::extrainfo::pedestals_, sistrip::extrainfo::pedsAndCmSubNoise_, sistrip::extrainfo::pedsAndRawNoise_, sistrip::extrainfo::rawNoise_, SiStripEnumsAndStrings::runType(), AlCaHLTBitMon_QueryRunRegistry::string, fftjetcommon_cfi::title, and funct::true.

126  {
127 
128  SiStripFecKey fec_key( fecKey() );
129  SiStripFedKey fed_key( fedKey() );
130 
132 
133  std::stringstream extra1,extra2,extra3;
134  if ( legacy_ ) {
138  } else {
142  }
143 
145  type,
147  fed_key.key(),
149  fec_key.lldChan(),
150  extra1.str() ).title();
152  type,
154  fed_key.key(),
156  fec_key.lldChan(),
157  extra2.str() ).title();
159  type,
161  fed_key.key(),
162  sistrip::APV,
163  SiStripFecKey::i2cAddr( fec_key.lldChan(), true ),
164  extra3.str() ).title();
166  type,
168  fed_key.key(),
169  sistrip::APV,
170  SiStripFecKey::i2cAddr( fec_key.lldChan(), false ),
171  extra3.str() ).title();
172 
173 
174  ss << " Summary"
175  << ":"
176  << ( isValid() ? "Valid" : "Invalid" )
177  << ":"
178  << sistrip::controlView_ << ":"
179  << fec_key.fecCrate() << "/"
180  << fec_key.fecSlot() << "/"
181  << fec_key.fecRing() << "/"
182  << fec_key.ccuAddr() << "/"
183  << fec_key.ccuChan()
184  << ":"
186  << "Collate" << sistrip::dir_
187  << SiStripFecKey( fec_key.fecCrate(),
188  fec_key.fecSlot(),
189  fec_key.fecRing(),
190  fec_key.ccuAddr(),
191  fec_key.ccuChan() ).path()
192  << ":"
193  << title1 << ";" << title2 << ";" << title3 << ";" << title4
194  << std::endl;
195 
196 }
type
Definition: HCALResponse.h:21
static const char rawNoise_[]
const uint32_t & fedKey() const
bool isValid() const override
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
const uint16_t & i2cAddr() const
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 controlView_[]
static const char dqmRoot_[]
const uint32_t & fecKey() const
static const char commonMode_[]
static const char pedestals_[]
static const char pedsAndCmSubNoise_[]
const std::string & myName() const

Friends And Related Function Documentation

friend class PedestalsAlgorithm
friend

Definition at line 27 of file PedestalsAnalysis.h.

Member Data Documentation

VVInt PedestalsAnalysis::dead_
private

Dead strips.

Definition at line 88 of file PedestalsAnalysis.h.

Referenced by PedestalsAlgorithm::analyse(), dead(), PedestalsAnalysis(), print(), and reset().

bool PedestalsAnalysis::legacy_
private

Definition at line 132 of file PedestalsAnalysis.h.

Referenced by PedestalsAlgorithm::extract(), reset(), and summary().

VVFloat PedestalsAnalysis::noise_
private

Noise values.

Definition at line 80 of file PedestalsAnalysis.h.

Referenced by PedestalsAlgorithm::analyse(), noise(), print(), and reset().

VFloat PedestalsAnalysis::noiseMax_
private

Max noise value.

Definition at line 120 of file PedestalsAnalysis.h.

Referenced by PedestalsAlgorithm::analyse(), isValid(), noiseMax(), print(), and reset().

VFloat PedestalsAnalysis::noiseMean_
private

Mean noise value.

Definition at line 102 of file PedestalsAnalysis.h.

Referenced by PedestalsAlgorithm::analyse(), isValid(), noiseMean(), print(), and reset().

VFloat PedestalsAnalysis::noiseMin_
private

Min noise value.

Definition at line 123 of file PedestalsAnalysis.h.

Referenced by PedestalsAlgorithm::analyse(), isValid(), noiseMin(), print(), and reset().

VFloat PedestalsAnalysis::noiseSpread_
private

Rms spread in noise.

Definition at line 105 of file PedestalsAnalysis.h.

Referenced by PedestalsAlgorithm::analyse(), isValid(), noiseSpread(), print(), and reset().

VVInt PedestalsAnalysis::noisy_
private

Noisy strips.

Definition at line 91 of file PedestalsAnalysis.h.

Referenced by PedestalsAlgorithm::analyse(), noisy(), PedestalsAnalysis(), print(), and reset().

VVFloat PedestalsAnalysis::peds_
private

Peds values.

Definition at line 77 of file PedestalsAnalysis.h.

Referenced by PedestalsAlgorithm::analyse(), peds(), print(), and reset().

VFloat PedestalsAnalysis::pedsMax_
private

Max peds value.

Definition at line 114 of file PedestalsAnalysis.h.

Referenced by PedestalsAlgorithm::analyse(), isValid(), pedsMax(), print(), and reset().

VFloat PedestalsAnalysis::pedsMean_
private

Mean peds value.

Definition at line 96 of file PedestalsAnalysis.h.

Referenced by PedestalsAlgorithm::analyse(), isValid(), pedsMean(), print(), and reset().

VFloat PedestalsAnalysis::pedsMin_
private

Min peds value.

Definition at line 117 of file PedestalsAnalysis.h.

Referenced by PedestalsAlgorithm::analyse(), isValid(), pedsMin(), print(), and reset().

VFloat PedestalsAnalysis::pedsSpread_
private

Rms spread in peds.

Definition at line 99 of file PedestalsAnalysis.h.

Referenced by PedestalsAlgorithm::analyse(), isValid(), pedsSpread(), print(), and reset().

VVFloat PedestalsAnalysis::raw_
private

Raw noise values.

Definition at line 83 of file PedestalsAnalysis.h.

Referenced by PedestalsAlgorithm::analyse(), print(), raw(), and reset().

VFloat PedestalsAnalysis::rawMax_
private

Max raw noise value.

Definition at line 126 of file PedestalsAnalysis.h.

Referenced by PedestalsAlgorithm::analyse(), isValid(), print(), rawMax(), and reset().

VFloat PedestalsAnalysis::rawMean_
private

Mean raw noise value.

Definition at line 108 of file PedestalsAnalysis.h.

Referenced by PedestalsAlgorithm::analyse(), isValid(), print(), rawMean(), and reset().

VFloat PedestalsAnalysis::rawMin_
private

Min raw noise value.

Definition at line 129 of file PedestalsAnalysis.h.

Referenced by PedestalsAlgorithm::analyse(), isValid(), print(), rawMin(), and reset().

VFloat PedestalsAnalysis::rawSpread_
private

Rms spread in raw noise.

Definition at line 111 of file PedestalsAnalysis.h.

Referenced by PedestalsAlgorithm::analyse(), isValid(), print(), rawSpread(), and reset().