CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 }
bool isValid() const override
const uint32_t & fedKey() const
const uint16_t & fecRing() const
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
void print(std::stringstream &, uint32_t not_used=0) override
const uint16_t & lldChan() const
const uint16_t & fecSlot() const
static const uint16_t valid_
Definition: Constants.h:17
const uint32_t & key() const
Definition: SiStripKey.h:120
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_[]
tuple key
prepare the HTCondor submission files and eventually submit them
static const char dqmRoot_[]
const uint32_t & fecKey() const
static const char apv_[]
std::vector< uint16_t > VInt
const uint16_t & fecCrate() const
virtual void header(std::stringstream &) const
const uint16_t & ccuAddr() const
static const uint16_t invalid_
Definition: Constants.h:16
const uint16_t & ccuChan() const
Abstract base for derived classes that provide analysis of commissioning histograms.
const VString & getErrorCodes() const
const std::string & myName() const
void reset() override
void summary(std::stringstream &) const override