CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes | Friends
PedsOnlyAnalysis Class Reference

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

#include <PedsOnlyAnalysis.h>

Inheritance diagram for PedsOnlyAnalysis:
CommissioningAnalysis

Public Member Functions

bool isValid () const
 
const VVFloatpeds () const
 
const VFloatpedsMax () const
 
const VFloatpedsMean () const
 
const VFloatpedsMin () const
 
 PedsOnlyAnalysis (const uint32_t &key)
 
 PedsOnlyAnalysis ()
 
const VFloatpedsSpread () const
 
void print (std::stringstream &, uint32_t apv_number=0)
 
const VVFloatraw () const
 
const VFloatrawMax () const
 
const VFloatrawMean () const
 
const VFloatrawMin () const
 
const VFloatrawSpread () const
 
void reset ()
 
void summary (std::stringstream &) const
 
virtual ~PedsOnlyAnalysis ()
 
- 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

bool legacy_
 
VVFloat peds_
 
VFloat pedsMax_
 
VFloat pedsMean_
 
VFloat pedsMin_
 
VFloat pedsSpread_
 
VVFloat raw_
 
VFloat rawMax_
 
VFloat rawMean_
 
VFloat rawMin_
 
VFloat rawSpread_
 

Friends

class PedsOnlyAlgorithm
 

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

Constructor & Destructor Documentation

PedsOnlyAnalysis::PedsOnlyAnalysis ( const uint32_t &  key)

Definition at line 13 of file PedsOnlyAnalysis.cc.

14  : CommissioningAnalysis(key,"PedsOnlyAnalysis"),
16  raw_(2,VFloat(128,sistrip::invalid_)),
25  legacy_(false)
26 {}
std::vector< float > VFloat
static const uint16_t invalid_
Definition: Constants.h:17
list key
Definition: combine.py:13
PedsOnlyAnalysis::PedsOnlyAnalysis ( )

Definition at line 30 of file PedsOnlyAnalysis.cc.

31  : CommissioningAnalysis("PedsOnlyAnalysis"),
33  raw_(2,VFloat(128,sistrip::invalid_)),
42  legacy_(false)
43 {}
std::vector< float > VFloat
static const uint16_t invalid_
Definition: Constants.h:17
virtual PedsOnlyAnalysis::~PedsOnlyAnalysis ( )
inlinevirtual

Definition at line 25 of file PedsOnlyAnalysis.h.

25 {;}

Member Function Documentation

bool PedsOnlyAnalysis::isValid ( void  ) const
virtual

Identifies if analysis is valid or not.

Reimplemented from CommissioningAnalysis.

Definition at line 63 of file PedsOnlyAnalysis.cc.

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

Referenced by PedsOnlyHistosUsingDb::create(), PedsOnlyHistograms::histoAnalysis(), print(), and summary().

63  {
64  return ( pedsMean_[0] < sistrip::maximum_ &&
80  getErrorCodes().empty() );
81 }
static const uint16_t maximum_
Definition: Constants.h:21
const VString & getErrorCodes() const
const PedsOnlyAnalysis::VVFloat & PedsOnlyAnalysis::peds ( ) const
inline

Definition at line 106 of file PedsOnlyAnalysis.h.

References peds_.

Referenced by PedsOnlySummaryFactory::extract(), and PedsOnlyHistosUsingDb::update().

106 { return peds_; }
const PedsOnlyAnalysis::VFloat & PedsOnlyAnalysis::pedsMax ( ) const
inline

Definition at line 114 of file PedsOnlyAnalysis.h.

References pedsMax_.

Referenced by PedsOnlyHistosUsingDb::create(), and PedsOnlySummaryFactory::extract().

114 { return pedsMax_; }
const PedsOnlyAnalysis::VFloat & PedsOnlyAnalysis::pedsMean ( ) const
inline

Definition at line 109 of file PedsOnlyAnalysis.h.

References pedsMean_.

Referenced by PedsOnlyHistosUsingDb::create(), and PedsOnlySummaryFactory::extract().

109 { return pedsMean_; }
const PedsOnlyAnalysis::VFloat & PedsOnlyAnalysis::pedsMin ( ) const
inline
const PedsOnlyAnalysis::VFloat & PedsOnlyAnalysis::pedsSpread ( ) const
inline

Definition at line 110 of file PedsOnlyAnalysis.h.

References pedsSpread_.

Referenced by PedsOnlyHistosUsingDb::create(), and PedsOnlySummaryFactory::extract().

110 { return pedsSpread_; }
void PedsOnlyAnalysis::print ( std::stringstream &  ss,
uint32_t  apv_number = 0 
)
virtual

Prints analysis results.

Implements CommissioningAnalysis.

Definition at line 159 of file PedsOnlyAnalysis.cc.

References relativeConstraints::empty, CommissioningAnalysis::getErrorCodes(), CommissioningAnalysis::header(), isValid(), sistrip::mlCommissioning_, CommissioningAnalysis::myName(), peds_, pedsMax_, pedsMean_, pedsMin_, pedsSpread_, raw_, rawMax_, rawMean_, rawMin_, rawSpread_, and findQualityFiles::size.

159  {
160 
161  if ( iapv == 1 || iapv == 2 ) { iapv--; }
162  else { iapv = 0; }
163 
164  if ( peds_[iapv].size() < 128 ||
165  raw_[iapv].size() < 128 ) {
167  << "[" << myName() << "::" << __func__ << "]"
168  << " Unexpected number of pedestal/noise values: "
169  << peds_[iapv].size() << ", "
170  << raw_[iapv].size();
171  return;
172  }
173 
174  header( ss );
175  ss << " Monitorables for APV number : " << iapv;
176  if ( iapv == 0 ) { ss << " (first of pair)"; }
177  else if ( iapv == 1 ) { ss << " (second of pair)"; }
178  ss << std::endl;
179  ss << std::fixed << std::setprecision(2);
180  ss << " Example peds/noise for strips : "
181  << " 0, 31, 63, 127" << std::endl
182  << " Peds [ADC] : "
183  << std::setw(6) << peds_[iapv][0] << ", "
184  << std::setw(6) << peds_[iapv][31] << ", "
185  << std::setw(6) << peds_[iapv][63] << ", "
186  << std::setw(6) << peds_[iapv][127] << std::endl
187  << " Raw noise [ADC] : "
188  << std::setw(6) << raw_[iapv][0] << ", "
189  << std::setw(6) << raw_[iapv][31] << ", "
190  << std::setw(6) << raw_[iapv][63] << ", "
191  << std::setw(6) << raw_[iapv][127] << std::endl;
192  ss << " Mean peds +/- spread [ADC] : " << pedsMean_[iapv] << " +/- " << pedsSpread_[iapv] << std::endl
193  << " Min/Max pedestal [ADC] : " << pedsMin_[iapv] << " <-> " << pedsMax_[iapv] << std::endl
194  << " Mean raw noise +/- spread [ADC] : " << rawMean_[iapv] << " +/- " << rawSpread_[iapv] << std::endl
195  << " Min/Max raw noise [ADC] : " << rawMin_[iapv] << " <-> " << rawMax_[iapv] << std::endl
196  << std::boolalpha
197  << " isValid : " << isValid() << std::endl
198  << std::noboolalpha
199  << " Error codes (found "
200  << std::setw(2) << std::setfill(' ') << getErrorCodes().size()
201  << ") : ";
202  if ( getErrorCodes().empty() ) { ss << "(none)"; }
203  else {
204  VString::const_iterator istr = getErrorCodes().begin();
205  VString::const_iterator jstr = getErrorCodes().end();
206  for ( ; istr != jstr; ++istr ) { ss << *istr << " "; }
207  }
208  ss << std::endl;
209 }
bool isValid() const
static const char mlCommissioning_[]
virtual void header(std::stringstream &) const
const VString & getErrorCodes() const
const std::string & myName() const
tuple size
Write out results.
const PedsOnlyAnalysis::VVFloat & PedsOnlyAnalysis::raw ( ) const
inline

Definition at line 107 of file PedsOnlyAnalysis.h.

References raw_.

Referenced by PedsOnlySummaryFactory::extract(), and PedsOnlyHistosUsingDb::update().

107 { return raw_; }
const PedsOnlyAnalysis::VFloat & PedsOnlyAnalysis::rawMax ( ) const
inline

Definition at line 116 of file PedsOnlyAnalysis.h.

References rawMax_.

Referenced by PedsOnlyHistosUsingDb::create(), and PedsOnlySummaryFactory::extract().

116 { return rawMax_; }
const PedsOnlyAnalysis::VFloat & PedsOnlyAnalysis::rawMean ( ) const
inline

Definition at line 111 of file PedsOnlyAnalysis.h.

References rawMean_.

Referenced by PedsOnlyHistosUsingDb::create(), and PedsOnlySummaryFactory::extract().

111 { return rawMean_; }
const PedsOnlyAnalysis::VFloat & PedsOnlyAnalysis::rawMin ( ) const
inline

Definition at line 117 of file PedsOnlyAnalysis.h.

References rawMin_.

Referenced by PedsOnlyHistosUsingDb::create(), and PedsOnlySummaryFactory::extract().

117 { return rawMin_; }
const PedsOnlyAnalysis::VFloat & PedsOnlyAnalysis::rawSpread ( ) const
inline

Definition at line 112 of file PedsOnlyAnalysis.h.

References rawSpread_.

Referenced by PedsOnlyHistosUsingDb::create(), and PedsOnlySummaryFactory::extract().

112 { return rawSpread_; }
void PedsOnlyAnalysis::reset ( void  )
virtual

Resets analysis member data.

Implements CommissioningAnalysis.

Definition at line 47 of file PedsOnlyAnalysis.cc.

References sistrip::invalid_, legacy_, peds_, pedsMax_, pedsMean_, pedsMin_, pedsSpread_, raw_, rawMax_, rawMean_, rawMin_, and rawSpread_.

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

47  {
58  legacy_ = false;
59 }
std::vector< float > VFloat
static const uint16_t invalid_
Definition: Constants.h:17
std::vector< VFloat > VVFloat
void PedsOnlyAnalysis::summary ( std::stringstream &  ss) const
virtual

Overrides base method.

Reimplemented from CommissioningAnalysis.

Definition at line 85 of file PedsOnlyAnalysis.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(), scaleCards::path, sistrip::extrainfo::pedestals_, sistrip::extrainfo::pedsAndCmSubNoise_, sistrip::extrainfo::pedsAndRawNoise_, sistrip::extrainfo::rawNoise_, SiStripEnumsAndStrings::runType(), indexGen::title, and funct::true.

85  {
86 
87  SiStripFecKey fec_key( fecKey() );
88  SiStripFedKey fed_key( fedKey() );
89 
91 
92  std::stringstream extra1,extra2,extra3;
93  if ( legacy_ ) {
97  } else {
101  }
102 
103  std::string title1 = SiStripHistoTitle( sistrip::EXPERT_HISTO,
104  type,
106  fed_key.key(),
108  fec_key.lldChan(),
109  extra1.str() ).title();
110  std::string title2 = SiStripHistoTitle( sistrip::EXPERT_HISTO,
111  type,
113  fed_key.key(),
115  fec_key.lldChan(),
116  extra2.str() ).title();
117  std::string title3 = SiStripHistoTitle( sistrip::EXPERT_HISTO,
118  type,
120  fed_key.key(),
121  sistrip::APV,
122  SiStripFecKey::i2cAddr( fec_key.lldChan(), true ),
123  extra3.str() ).title();
124  std::string title4 = SiStripHistoTitle( sistrip::EXPERT_HISTO,
125  type,
127  fed_key.key(),
128  sistrip::APV,
129  SiStripFecKey::i2cAddr( fec_key.lldChan(), false ),
130  extra3.str() ).title();
131 
132 
133  ss << " Summary"
134  << ":"
135  << ( isValid() ? "Valid" : "Invalid" )
136  << ":"
137  << sistrip::controlView_ << ":"
138  << fec_key.fecCrate() << "/"
139  << fec_key.fecSlot() << "/"
140  << fec_key.fecRing() << "/"
141  << fec_key.ccuAddr() << "/"
142  << fec_key.ccuChan()
143  << ":"
145  << "Collate" << sistrip::dir_
146  << SiStripFecKey( fec_key.fecCrate(),
147  fec_key.fecSlot(),
148  fec_key.fecRing(),
149  fec_key.ccuAddr(),
150  fec_key.ccuChan() ).path()
151  << ":"
152  << title1 << ";" << title2 << ";" << title3 << ";" << title4
153  << std::endl;
154 
155 }
type
Definition: HCALResponse.h:22
static const char rawNoise_[]
const uint32_t & fedKey() const
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:57
bool isValid() const
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:46
static std::string runType(const sistrip::RunType &)
list path
Definition: scaleCards.py:51
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 PedsOnlyAlgorithm
friend

Definition at line 27 of file PedsOnlyAnalysis.h.

Member Data Documentation

bool PedsOnlyAnalysis::legacy_
private
VVFloat PedsOnlyAnalysis::peds_
private

Peds values.

Definition at line 68 of file PedsOnlyAnalysis.h.

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

VFloat PedsOnlyAnalysis::pedsMax_
private

Max peds value.

Definition at line 88 of file PedsOnlyAnalysis.h.

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

VFloat PedsOnlyAnalysis::pedsMean_
private

Mean peds value.

Definition at line 76 of file PedsOnlyAnalysis.h.

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

VFloat PedsOnlyAnalysis::pedsMin_
private

Min peds value.

Definition at line 91 of file PedsOnlyAnalysis.h.

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

VFloat PedsOnlyAnalysis::pedsSpread_
private

Rms spread in peds.

Definition at line 79 of file PedsOnlyAnalysis.h.

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

VVFloat PedsOnlyAnalysis::raw_
private

Raw noise values.

Definition at line 71 of file PedsOnlyAnalysis.h.

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

VFloat PedsOnlyAnalysis::rawMax_
private

Max raw noise value.

Definition at line 94 of file PedsOnlyAnalysis.h.

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

VFloat PedsOnlyAnalysis::rawMean_
private

Mean raw noise value.

Definition at line 82 of file PedsOnlyAnalysis.h.

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

VFloat PedsOnlyAnalysis::rawMin_
private

Min raw noise value.

Definition at line 97 of file PedsOnlyAnalysis.h.

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

VFloat PedsOnlyAnalysis::rawSpread_
private

Rms spread in raw noise.

Definition at line 85 of file PedsOnlyAnalysis.h.

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