CMS 3D CMS Logo

VpspScanAnalysis.cc
Go to the documentation of this file.
5 #include <iostream>
6 #include <sstream>
7 #include <iomanip>
8 #include <cmath>
9 
10 using namespace sistrip;
11 
12 // -----------------------------------------------------------------------------
13 //
15  : CommissioningAnalysis(key, "VpspScanAnalysis"),
16  vpsp_(2, sistrip::invalid_),
17  adcLevel_(2, sistrip::invalid_),
18  fraction_(2, sistrip::invalid_),
19  topEdge_(2, sistrip::invalid_),
20  bottomEdge_(2, sistrip::invalid_),
21  topLevel_(2, sistrip::invalid_),
22  bottomLevel_(2, sistrip::invalid_) {
23  ;
24 }
25 
26 // -----------------------------------------------------------------------------
27 //
29  : CommissioningAnalysis("VpspScanAnalysis"),
30  vpsp_(2, sistrip::invalid_),
31  adcLevel_(2, sistrip::invalid_),
32  fraction_(2, sistrip::invalid_),
33  topEdge_(2, sistrip::invalid_),
34  bottomEdge_(2, sistrip::invalid_),
35  topLevel_(2, sistrip::invalid_),
36  bottomLevel_(2, sistrip::invalid_) {
37  ;
38 }
39 
40 // -----------------------------------------------------------------------------
41 //
43 
44 // ----------------------------------------------------------------------------
45 //
47  return (vpsp_[0] < 1. * sistrip::valid_ && vpsp_[1] < 1. * sistrip::valid_ && adcLevel_[0] < 1. * sistrip::valid_ &&
48  adcLevel_[1] < 1. * sistrip::valid_ && topLevel_[0] < 1. * sistrip::valid_ &&
49  topLevel_[1] < 1. * sistrip::valid_ && bottomLevel_[0] < 1. * sistrip::valid_ &&
51 }
52 
53 // ----------------------------------------------------------------------------
54 //
55 void VpspScanAnalysis::summary(std::stringstream& ss) const {
56  SiStripFecKey fec_key(fecKey());
57  SiStripFedKey fed_key(fedKey());
58 
60 
61  std::stringstream extra1, extra2;
62  extra1 << sistrip::apv_ << "0";
63  extra2 << sistrip::apv_ << "1";
64 
66  type,
68  fed_key.key(),
70  fec_key.lldChan(),
71  extra1.str())
72  .title();
74  type,
76  fed_key.key(),
78  fec_key.lldChan(),
79  extra2.str())
80  .title();
81 
82  ss << " Summary"
83  << ":" << (isValid() ? "Valid" : "Invalid") << ":" << sistrip::controlView_ << ":" << fec_key.fecCrate() << "/"
84  << fec_key.fecSlot() << "/" << fec_key.fecRing() << "/" << fec_key.ccuAddr() << "/" << fec_key.ccuChan() << ":"
85  << sistrip::dqmRoot_ << sistrip::dir_ << "Collate" << sistrip::dir_
86  << SiStripFecKey(fec_key.fecCrate(), fec_key.fecSlot(), fec_key.fecRing(), fec_key.ccuAddr(), fec_key.ccuChan())
87  .path()
88  << ":" << title1 << ";" << title2 << std::endl;
89 }
90 
91 // ----------------------------------------------------------------------------
92 //
93 void VpspScanAnalysis::print(std::stringstream& ss, uint32_t iapv) {
94  if (iapv == 1 || iapv == 2) {
95  iapv--;
96  } else {
97  iapv = 0;
98  }
99  header(ss);
100  ss << " Monitorables for APV : " << iapv;
101  if (iapv == 0) {
102  ss << " (first of pair)";
103  } else if (iapv == 1) {
104  ss << " (second of pair)";
105  }
106  ss << std::endl;
107  ss << std::fixed << std::setprecision(2) << " VPSP setting : " << vpsp_[iapv] << std::endl
108  << " Signal level [ADC] : " << adcLevel_[iapv] << std::endl
109  << " Fraction [%] : "
110  << "(N/A)" /*fraction_[iapv]*/ << std::endl
111  << " Top edge [bin] : " << topEdge_[iapv] << std::endl
112  << " Bottom edge [bin] : " << bottomEdge_[iapv] << std::endl
113  << " Top level [ADC] : " << topLevel_[iapv] << std::endl
114  << " Bottom level [ADC] : " << bottomLevel_[iapv] << std::endl
115  << std::boolalpha << " isValid : " << isValid() << std::endl
116  << std::noboolalpha << " Error codes (found " << std::setw(2) << std::setfill(' ') << getErrorCodes().size()
117  << "): ";
118  if (getErrorCodes().empty()) {
119  ss << "(none)";
120  } else {
121  VString::const_iterator istr = getErrorCodes().begin();
122  VString::const_iterator jstr = getErrorCodes().end();
123  for (; istr != jstr; ++istr) {
124  ss << *istr << " ";
125  }
126  }
127  ss << std::endl;
128 }
CommissioningAnalysis::getErrorCodes
const VString & getErrorCodes() const
Definition: CommissioningAnalysis.h:131
SiStripEnumsAndStrings::runType
static std::string runType(const sistrip::RunType &)
Definition: SiStripEnumsAndStrings.cc:39
alignBH_cfg.fixed
fixed
Definition: alignBH_cfg.py:54
MessageLogger.h
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
VpspScanAnalysis::bottomLevel_
VInt bottomLevel_
Definition: VpspScanAnalysis.h:80
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::valid_
static const uint16_t valid_
Definition: Constants.h:17
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
VpspScanAnalysis::topEdge_
VInt topEdge_
Definition: VpspScanAnalysis.h:74
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
VpspScanAnalysis::reset
void reset() override
Definition: VpspScanAnalysis.cc:42
VpspScanAnalysis::vpsp_
VInt vpsp_
Definition: VpspScanAnalysis.h:68
VpspScanAnalysis::VpspScanAnalysis
VpspScanAnalysis()
Definition: VpspScanAnalysis.cc:28
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
VpspScanAnalysis::summary
void summary(std::stringstream &) const override
Definition: VpspScanAnalysis.cc:55
VpspScanAnalysis::isValid
bool isValid() const override
Definition: VpspScanAnalysis.cc:46
sistrip::controlView_
static const char controlView_[]
Definition: ConstantsForView.h:21
VpspScanAnalysis::topLevel_
VInt topLevel_
Definition: VpspScanAnalysis.h:78
VpspScanAnalysis::adcLevel_
VInt adcLevel_
Definition: VpspScanAnalysis.h:70
sistrip::invalid_
static const uint16_t invalid_
Definition: Constants.h:16
sistrip::dqmRoot_
static const char dqmRoot_[]
Definition: ConstantsForDqm.h:28
CommissioningAnalysis::VInt
std::vector< uint16_t > VInt
Definition: CommissioningAnalysis.h:34
overlapproblemtsosanalyzer_cfi.title
title
Definition: overlapproblemtsosanalyzer_cfi.py:7
CommissioningAnalysis
Abstract base for derived classes that provide analysis of commissioning histograms.
Definition: CommissioningAnalysis.h:18
type
type
Definition: HCALResponse.h:21
sistrip::apv_
static const char apv_[]
Definition: ConstantsForGranularity.h:40
CommissioningAnalysis::fecKey
const uint32_t & fecKey() const
Definition: CommissioningAnalysis.h:133
SiStripEnumsAndStrings.h
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
VpspScanAnalysis::print
void print(std::stringstream &, uint32_t not_used=0) override
Definition: VpspScanAnalysis.cc:93
castor_dqm_sourceclient_file_cfg.path
path
Definition: castor_dqm_sourceclient_file_cfg.py:37
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
VpspScanAnalysis.h
VpspScanAnalysis::bottomEdge_
VInt bottomEdge_
Definition: VpspScanAnalysis.h:76