CMS 3D CMS Logo

PedsOnlyAnalysis.cc
Go to the documentation of this file.
5 #include <iostream>
6 #include <iomanip>
7 #include <cmath>
8 
9 using namespace sistrip;
10 
11 // ----------------------------------------------------------------------------
12 //
14  : CommissioningAnalysis(key, "PedsOnlyAnalysis"),
15  peds_(2, VFloat(128, sistrip::invalid_)),
16  raw_(2, VFloat(128, sistrip::invalid_)),
17  pedsMean_(2, sistrip::invalid_),
18  pedsSpread_(2, sistrip::invalid_),
19  rawMean_(2, sistrip::invalid_),
20  rawSpread_(2, sistrip::invalid_),
21  pedsMax_(2, sistrip::invalid_),
22  pedsMin_(2, sistrip::invalid_),
23  rawMax_(2, sistrip::invalid_),
24  rawMin_(2, sistrip::invalid_),
25  legacy_(false) {}
26 
27 // ----------------------------------------------------------------------------
28 //
30  : CommissioningAnalysis("PedsOnlyAnalysis"),
31  peds_(2, VFloat(128, sistrip::invalid_)),
32  raw_(2, VFloat(128, sistrip::invalid_)),
33  pedsMean_(2, sistrip::invalid_),
34  pedsSpread_(2, sistrip::invalid_),
35  rawMean_(2, sistrip::invalid_),
36  rawSpread_(2, sistrip::invalid_),
37  pedsMax_(2, sistrip::invalid_),
38  pedsMin_(2, sistrip::invalid_),
39  rawMax_(2, sistrip::invalid_),
40  rawMin_(2, sistrip::invalid_),
41  legacy_(false) {}
42 
43 // ----------------------------------------------------------------------------
44 //
56  legacy_ = false;
57 }
58 
59 // ----------------------------------------------------------------------------
60 //
68 }
69 
70 // ----------------------------------------------------------------------------
71 //
72 void PedsOnlyAnalysis::summary(std::stringstream& ss) const {
73  SiStripFecKey fec_key(fecKey());
74  SiStripFedKey fed_key(fedKey());
75 
77 
78  std::stringstream extra1, extra2, extra3;
79  if (legacy_) {
83  } else {
87  }
88 
90  type,
92  fed_key.key(),
94  fec_key.lldChan(),
95  extra1.str())
96  .title();
98  type,
100  fed_key.key(),
102  fec_key.lldChan(),
103  extra2.str())
104  .title();
106  type,
108  fed_key.key(),
109  sistrip::APV,
110  SiStripFecKey::i2cAddr(fec_key.lldChan(), true),
111  extra3.str())
112  .title();
114  type,
116  fed_key.key(),
117  sistrip::APV,
118  SiStripFecKey::i2cAddr(fec_key.lldChan(), false),
119  extra3.str())
120  .title();
121 
122  ss << " Summary"
123  << ":" << (isValid() ? "Valid" : "Invalid") << ":" << sistrip::controlView_ << ":" << fec_key.fecCrate() << "/"
124  << fec_key.fecSlot() << "/" << fec_key.fecRing() << "/" << fec_key.ccuAddr() << "/" << fec_key.ccuChan() << ":"
125  << sistrip::dqmRoot_ << sistrip::dir_ << "Collate" << sistrip::dir_
126  << SiStripFecKey(fec_key.fecCrate(), fec_key.fecSlot(), fec_key.fecRing(), fec_key.ccuAddr(), fec_key.ccuChan())
127  .path()
128  << ":" << title1 << ";" << title2 << ";" << title3 << ";" << title4 << std::endl;
129 }
130 
131 // ----------------------------------------------------------------------------
132 //
133 void PedsOnlyAnalysis::print(std::stringstream& ss, uint32_t iapv) {
134  if (iapv == 1 || iapv == 2) {
135  iapv--;
136  } else {
137  iapv = 0;
138  }
139 
140  if (peds_[iapv].size() < 128 || raw_[iapv].size() < 128) {
141  edm::LogWarning(mlCommissioning_) << "[" << myName() << "::" << __func__ << "]"
142  << " Unexpected number of pedestal/noise values: " << peds_[iapv].size() << ", "
143  << raw_[iapv].size();
144  return;
145  }
146 
147  header(ss);
148  ss << " Monitorables for APV number : " << iapv;
149  if (iapv == 0) {
150  ss << " (first of pair)";
151  } else if (iapv == 1) {
152  ss << " (second of pair)";
153  }
154  ss << std::endl;
155  ss << std::fixed << std::setprecision(2);
156  ss << " Example peds/noise for strips : "
157  << " 0, 31, 63, 127" << std::endl
158  << " Peds [ADC] : " << std::setw(6) << peds_[iapv][0] << ", " << std::setw(6)
159  << peds_[iapv][31] << ", " << std::setw(6) << peds_[iapv][63] << ", " << std::setw(6) << peds_[iapv][127]
160  << std::endl
161  << " Raw noise [ADC] : " << std::setw(6) << raw_[iapv][0] << ", " << std::setw(6) << raw_[iapv][31]
162  << ", " << std::setw(6) << raw_[iapv][63] << ", " << std::setw(6) << raw_[iapv][127] << std::endl;
163  ss << " Mean peds +/- spread [ADC] : " << pedsMean_[iapv] << " +/- " << pedsSpread_[iapv] << std::endl
164  << " Min/Max pedestal [ADC] : " << pedsMin_[iapv] << " <-> " << pedsMax_[iapv] << std::endl
165  << " Mean raw noise +/- spread [ADC] : " << rawMean_[iapv] << " +/- " << rawSpread_[iapv] << std::endl
166  << " Min/Max raw noise [ADC] : " << rawMin_[iapv] << " <-> " << rawMax_[iapv] << std::endl
167  << std::boolalpha << " isValid : " << isValid() << std::endl
168  << std::noboolalpha << " Error codes (found " << std::setw(2) << std::setfill(' ') << getErrorCodes().size()
169  << ") : ";
170  if (getErrorCodes().empty()) {
171  ss << "(none)";
172  } else {
173  VString::const_iterator istr = getErrorCodes().begin();
174  VString::const_iterator jstr = getErrorCodes().end();
175  for (; istr != jstr; ++istr) {
176  ss << *istr << " ";
177  }
178  }
179  ss << std::endl;
180 }
PedsOnlyAnalysis::raw_
VVFloat raw_
Definition: PedsOnlyAnalysis.h:68
CommissioningAnalysis::getErrorCodes
const VString & getErrorCodes() const
Definition: CommissioningAnalysis.h:131
SiStripEnumsAndStrings::runType
static std::string runType(const sistrip::RunType &)
Definition: SiStripEnumsAndStrings.cc:39
sistrip::extrainfo::commonMode_
static const char commonMode_[]
Definition: ConstantsForDqm.h:48
alignBH_cfg.fixed
fixed
Definition: alignBH_cfg.py:54
runGCPTkAlMap.title
string title
Definition: runGCPTkAlMap.py:94
PedsOnlyAnalysis::PedsOnlyAnalysis
PedsOnlyAnalysis()
Definition: PedsOnlyAnalysis.cc:29
MessageLogger.h
funct::false
false
Definition: Factorize.h:29
PedsOnlyAnalysis::summary
void summary(std::stringstream &) const override
Definition: PedsOnlyAnalysis.cc:72
PedsOnlyAnalysis::rawMax_
VFloat rawMax_
Definition: PedsOnlyAnalysis.h:91
SiStripKey::key
const uint32_t & key() const
Definition: SiStripKey.h:120
SiStripFecKey::lldChan
const uint16_t & lldChan() const
Definition: SiStripFecKey.h:203
CommissioningAnalysis::fedKey
const uint32_t & fedKey() const
Definition: CommissioningAnalysis.h:134
sistrip::dir_
static const char dir_[]
Definition: ConstantsForDqm.h:17
PedsOnlyAnalysis::pedsSpread_
VFloat pedsSpread_
Definition: PedsOnlyAnalysis.h:76
SiStripFecKey::fecCrate
const uint16_t & fecCrate() const
Definition: SiStripFecKey.h:198
sistrip::RunType
RunType
Definition: ConstantsForRunType.h:70
SiStripFedKey
A container class for generic run and event-related info, information required by the commissioning a...
Definition: SiStripFedKey.h:56
sistrip::extrainfo::pedsAndCmSubNoise_
static const char pedsAndCmSubNoise_[]
Definition: ConstantsForDqm.h:55
CommissioningAnalysis::VFloat
std::vector< float > VFloat
Definition: CommissioningAnalysis.h:30
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
sistrip::mlCommissioning_
static const char mlCommissioning_[]
Definition: ConstantsForLogger.h:15
PedsOnlyAnalysis::reset
void reset() override
Definition: PedsOnlyAnalysis.cc:45
CommissioningAnalysis::header
virtual void header(std::stringstream &) const
Definition: CommissioningAnalysis.cc:33
SiStripFecKey::fecRing
const uint16_t & fecRing() const
Definition: SiStripFecKey.h:200
sistrip::EXPERT_HISTO
Definition: ConstantsForHistoType.h:29
sistrip::extrainfo::pedestals_
static const char pedestals_[]
Definition: ConstantsForDqm.h:45
SiStripFecKey
Utility class that identifies a position within the strip tracker control structure,...
Definition: SiStripFecKey.h:45
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SiStripFecKey::ccuChan
const uint16_t & ccuChan() const
Definition: SiStripFecKey.h:202
PedsOnlyAnalysis::rawSpread_
VFloat rawSpread_
Definition: PedsOnlyAnalysis.h:82
PedsOnlyAnalysis::print
void print(std::stringstream &, uint32_t apv_number=0) override
Definition: PedsOnlyAnalysis.cc:133
PedsOnlyAnalysis::rawMin_
VFloat rawMin_
Definition: PedsOnlyAnalysis.h:94
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
sistrip::maximum_
static const uint16_t maximum_
Definition: Constants.h:20
sistrip::controlView_
static const char controlView_[]
Definition: ConstantsForView.h:21
PedsOnlyAnalysis::pedsMean_
VFloat pedsMean_
Definition: PedsOnlyAnalysis.h:73
sistrip::APV
Definition: ConstantsForGranularity.h:79
PedsOnlyAnalysis.h
PedsOnlyAnalysis::legacy_
bool legacy_
Definition: PedsOnlyAnalysis.h:97
sistrip::invalid_
static const uint16_t invalid_
Definition: Constants.h:16
sistrip::extrainfo::pedsAndRawNoise_
static const char pedsAndRawNoise_[]
Definition: ConstantsForDqm.h:53
sistrip::dqmRoot_
static const char dqmRoot_[]
Definition: ConstantsForDqm.h:28
CommissioningAnalysis
Abstract base for derived classes that provide analysis of commissioning histograms.
Definition: CommissioningAnalysis.h:18
PedsOnlyAnalysis::pedsMin_
VFloat pedsMin_
Definition: PedsOnlyAnalysis.h:88
SiStripFecKey::i2cAddr
const uint16_t & i2cAddr() const
Definition: SiStripFecKey.h:204
CommissioningAnalysis::fecKey
const uint32_t & fecKey() const
Definition: CommissioningAnalysis.h:133
PedsOnlyAnalysis::peds_
VVFloat peds_
Definition: PedsOnlyAnalysis.h:65
SiStripEnumsAndStrings.h
PedsOnlyAnalysis::rawMean_
VFloat rawMean_
Definition: PedsOnlyAnalysis.h:79
relativeConstraints.empty
bool empty
Definition: relativeConstraints.py:46
SiStripFecKey::ccuAddr
const uint16_t & ccuAddr() const
Definition: SiStripFecKey.h:201
SiStripHistoTitle.h
CommissioningAnalysis::myName
const std::string & myName() const
Definition: CommissioningAnalysis.h:139
SiStripHistoTitle
Utility class that holds histogram title.
Definition: SiStripHistoTitle.h:20
PedsOnlyAnalysis::isValid
bool isValid() const override
Definition: PedsOnlyAnalysis.cc:61
sistrip::extrainfo::rawNoise_
static const char rawNoise_[]
Definition: ConstantsForDqm.h:46
CommissioningAnalysis::VVFloat
std::vector< VFloat > VVFloat
Definition: CommissioningAnalysis.h:32
castor_dqm_sourceclient_file_cfg.path
path
Definition: castor_dqm_sourceclient_file_cfg.py:37
PedsOnlyAnalysis::pedsMax_
VFloat pedsMax_
Definition: PedsOnlyAnalysis.h:85
sistrip::FED_KEY
Definition: ConstantsForKeyType.h:30
sistrip
sistrip classes
Definition: SiStripQualityHelpers.h:14
SiStripFecKey::fecSlot
const uint16_t & fecSlot() const
Definition: SiStripFecKey.h:199
crabWrapper.key
key
Definition: crabWrapper.py:19
sistrip::LLD_CHAN
Definition: ConstantsForGranularity.h:78
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443