CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
OptoScanAnalysis.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 
16 // ----------------------------------------------------------------------------
17 //
19 
20 // ----------------------------------------------------------------------------
21 //
22 const float OptoScanAnalysis::fedAdcGain_ = 1.024 / 1024.; // [V/ADC]
23 
24 // ----------------------------------------------------------------------------
25 //
28  gain_(sistrip::invalid_),
29  bias_(4,sistrip::invalid_),
30  measGain_(4,sistrip::invalid_),
31  zeroLight_(4,sistrip::invalid_),
32  linkNoise_(4,sistrip::invalid_),
33  liftOff_(4,sistrip::invalid_),
34  threshold_(4,sistrip::invalid_),
35  tickHeight_(4,sistrip::invalid_),
36  baseSlope_(4,sistrip::invalid_)
37 {;}
38 
39 // ----------------------------------------------------------------------------
40 //
43  gain_(sistrip::invalid_),
44  bias_(4,sistrip::invalid_),
45  measGain_(4,sistrip::invalid_),
46  zeroLight_(4,sistrip::invalid_),
47  linkNoise_(4,sistrip::invalid_),
48  liftOff_(4,sistrip::invalid_),
49  threshold_(4,sistrip::invalid_),
50  tickHeight_(4,sistrip::invalid_),
51  baseSlope_(4,sistrip::invalid_)
52 {;}
53 
54 // ----------------------------------------------------------------------------
55 //
66 }
67 
68 
69 // ----------------------------------------------------------------------------
70 //
72  return ( gain_ < sistrip::maximum_ &&
74  getErrorCodes().empty() );
75 }
76 
77 // ----------------------------------------------------------------------------
78 //
79 void OptoScanAnalysis::summary( std::stringstream& ss ) const {
80 
81  SiStripFecKey fec_key( fecKey() );
82  SiStripFedKey fed_key( fedKey() );
83 
85 
86  std::stringstream extra1,extra2,extra3;
88  extra2 << sistrip::extrainfo::gain_ << gain() << sistrip::extrainfo::digital_ << "1";
90 
92  type,
94  fed_key.key(),
96  fec_key.lldChan(),
97  extra1.str() ).title();
99  type,
101  fed_key.key(),
103  fec_key.lldChan(),
104  extra2.str() ).title();
106  type,
108  fed_key.key(),
110  fec_key.lldChan(),
111  extra3.str() ).title();
112 
113  ss << " Summary"
114  << ":"
115  << ( isValid() ? "Valid" : "Invalid" )
116  << ":"
117  << sistrip::controlView_ << ":"
118  << fec_key.fecCrate() << "/"
119  << fec_key.fecSlot() << "/"
120  << fec_key.fecRing() << "/"
121  << fec_key.ccuAddr() << "/"
122  << fec_key.ccuChan()
123  << ":"
125  << "Collate" << sistrip::dir_
126  << SiStripFecKey( fec_key.fecCrate(),
127  fec_key.fecSlot(),
128  fec_key.fecRing(),
129  fec_key.ccuAddr(),
130  fec_key.ccuChan() ).path()
131  << ":"
132  << title1 << ";" << title2 << ";" << title3
133  << std::endl;
134 
135 }
136 
137 // ----------------------------------------------------------------------------
138 //
139 void OptoScanAnalysis::print( std::stringstream& ss, uint32_t gain ) {
140 
141  if ( gain >= 4 ) { gain = gain_; }
142 
143  if ( gain >= bias_.size() ) {
145  << "[" << myName() << "::" << __func__ << "]"
146  << " Unexpected gain setting: " << gain;
147  return;
148  }
149 
150  header( ss );
151  ss << std::fixed << std::setprecision(2)
152  << " Optimum LLD gain setting : " << gain_ << std::endl
153  << " LLD gain setting : " << gain << std::endl
154  << " LLD bias setting : " << bias_[gain] << std::endl
155  << " Measured gain [V/V] : " << measGain_[gain] << std::endl
156  << " Zero light level [ADC] : " << zeroLight_[gain] << std::endl
157  << " Link noise [ADC] : " << linkNoise_[gain] << std::endl
158  << " Baseline 'lift off' [mA] : " << liftOff_[gain] << std::endl
159  << " Laser threshold [mA] : " << threshold_[gain] << std::endl
160  << " Tick mark height [ADC] : " << tickHeight_[gain] << std::endl
161  << " Baseline slope [ADC/I2C] : " << baseSlope_[gain] << std::endl
162  << std::boolalpha
163  << " isValid : " << isValid() << std::endl
164  << std::noboolalpha
165  << " Error codes (found "
166  << std::setw(2) << std::setfill(' ') << getErrorCodes().size()
167  << ") : ";
168  if ( getErrorCodes().empty() ) { ss << "(none)"; }
169  else {
170  VString::const_iterator istr = getErrorCodes().begin();
171  VString::const_iterator jstr = getErrorCodes().end();
172  for ( ; istr != jstr; ++istr ) { ss << *istr << " "; }
173  }
174  ss << std::endl;
175 
176 }
const uint16_t & gain() const
type
Definition: HCALResponse.h:21
const uint32_t & fedKey() const
const uint16_t & fecRing() const
bool isValid() 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
const uint16_t & lldChan() const
const uint16_t & fecSlot() const
const uint32_t & key() const
Definition: SiStripKey.h:125
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 baselineRms_[]
static const char optoScanAnalysis_[]
static const float fedAdcGain_
std::vector< float > VFloat
tuple path
else: Piece not in the list, fine.
static const char mlCommissioning_[]
static const char controlView_[]
static const uint16_t maximum_
Definition: Constants.h:20
static const char dqmRoot_[]
const uint32_t & fecKey() const
void print(std::stringstream &, uint32_t gain_setting=sistrip::invalid_)
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
static const char digital_[]
std::vector< uint16_t > VInt
const uint16_t & fecCrate() const
static const uint16_t defaultBiasSetting_
virtual void header(std::stringstream &) const
const uint16_t & ccuAddr() const
void summary(std::stringstream &) const
static const uint16_t invalid_
Definition: Constants.h:16
static const char gain_[]
const uint16_t & ccuChan() const
Abstract base for derived classes that provide analysis of commissioning histograms.
static const uint16_t defaultGainSetting_
const VString & getErrorCodes() const
const std::string & myName() const