CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 //
28  : CommissioningAnalysis("VpspScanAnalysis"),
29  vpsp_(2,sistrip::invalid_),
30  adcLevel_(2,sistrip::invalid_),
31  fraction_(2,sistrip::invalid_),
32  topEdge_(2,sistrip::invalid_),
33  bottomEdge_(2,sistrip::invalid_),
34  topLevel_(2,sistrip::invalid_),
35  bottomLevel_(2,sistrip::invalid_)
36 {;}
37 
38 // -----------------------------------------------------------------------------
39 //
42 }
43 
44 // ----------------------------------------------------------------------------
45 //
47  return ( vpsp_[0] < 1. * sistrip::valid_ &&
48  vpsp_[1] < 1. * sistrip::valid_ &&
49  adcLevel_[0] < 1. * sistrip::valid_ &&
50  adcLevel_[1] < 1. * sistrip::valid_ &&
51  topLevel_[0] < 1. * sistrip::valid_ &&
52  topLevel_[1] < 1. * sistrip::valid_ &&
53  bottomLevel_[0] < 1. * sistrip::valid_ &&
54  bottomLevel_[1] < 1. * sistrip::valid_ &&
55  getErrorCodes().empty() );
56 }
57 
58 // ----------------------------------------------------------------------------
59 //
60 void VpspScanAnalysis::summary( std::stringstream& ss ) const {
61 
62  SiStripFecKey fec_key( fecKey() );
63  SiStripFedKey fed_key( fedKey() );
64 
66 
67  std::stringstream extra1,extra2;
68  extra1 << sistrip::apv_ << "0";
69  extra2 << sistrip::apv_ << "1";
70 
71  std::string title1 = SiStripHistoTitle( sistrip::EXPERT_HISTO,
72  type,
74  fed_key.key(),
76  fec_key.lldChan(),
77  extra1.str() ).title();
78  std::string title2 = SiStripHistoTitle( sistrip::EXPERT_HISTO,
79  type,
81  fed_key.key(),
83  fec_key.lldChan(),
84  extra2.str() ).title();
85 
86  ss << " Summary"
87  << ":"
88  << ( isValid() ? "Valid" : "Invalid" )
89  << ":"
90  << sistrip::controlView_ << ":"
91  << fec_key.fecCrate() << "/"
92  << fec_key.fecSlot() << "/"
93  << fec_key.fecRing() << "/"
94  << fec_key.ccuAddr() << "/"
95  << fec_key.ccuChan()
96  << ":"
98  << "Collate" << sistrip::dir_
99  << SiStripFecKey( fec_key.fecCrate(),
100  fec_key.fecSlot(),
101  fec_key.fecRing(),
102  fec_key.ccuAddr(),
103  fec_key.ccuChan() ).path()
104  << ":"
105  << title1 << ";" << title2
106  << std::endl;
107 
108 }
109 
110 // ----------------------------------------------------------------------------
111 //
112 void VpspScanAnalysis::print( std::stringstream& ss, uint32_t iapv ) {
113  if ( iapv == 1 || iapv == 2 ) { iapv--; }
114  else { iapv = 0; }
115  header( ss );
116  ss << " Monitorables for APV : " << iapv;
117  if ( iapv == 0 ) { ss << " (first of pair)"; }
118  else if ( iapv == 1 ) { ss << " (second of pair)"; }
119  ss << std::endl;
120  ss << std::fixed << std::setprecision(2)
121  << " VPSP setting : " << vpsp_[iapv] << std::endl
122  << " Signal level [ADC] : " << adcLevel_[iapv] << std::endl
123  << " Fraction [%] : " << "(N/A)" /*fraction_[iapv]*/ << std::endl
124  << " Top edge [bin] : " << topEdge_[iapv] << std::endl
125  << " Bottom edge [bin] : " << bottomEdge_[iapv] << std::endl
126  << " Top level [ADC] : " << topLevel_[iapv] << std::endl
127  << " Bottom level [ADC] : " << bottomLevel_[iapv] << std::endl
128  << std::boolalpha
129  << " isValid : " << isValid() << std::endl
130  << std::noboolalpha
131  << " Error codes (found "
132  << std::setw(2) << std::setfill(' ') << getErrorCodes().size()
133  << "): ";
134  if ( getErrorCodes().empty() ) { ss << "(none)"; }
135  else {
136  VString::const_iterator istr = getErrorCodes().begin();
137  VString::const_iterator jstr = getErrorCodes().end();
138  for ( ; istr != jstr; ++istr ) { ss << *istr << " "; }
139  }
140  ss << std::endl;
141 }
142 
143 
144 
145 
146 
147 
type
Definition: HCALResponse.h:22
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:57
const uint16_t & lldChan() const
const uint16_t & fecSlot() const
static const uint16_t valid_
Definition: Constants.h:18
const uint32_t & key() const
Definition: SiStripKey.h:126
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 &)
void print(std::stringstream &, uint32_t not_used=0)
list path
Definition: scaleCards.py:51
static const char controlView_[]
static const char dqmRoot_[]
const uint32_t & fecKey() const
static const char apv_[]
std::vector< uint16_t > VInt
void summary(std::stringstream &) const
const uint16_t & fecCrate() const
virtual void header(std::stringstream &) const
const uint16_t & ccuAddr() const
static const uint16_t invalid_
Definition: Constants.h:17
list key
Definition: combine.py:13
const uint16_t & ccuChan() const
Abstract base for derived classes that provide analysis of commissioning histograms.
bool isValid() const
const VString & getErrorCodes() const
const std::string & myName() const