CMS 3D CMS Logo

CalibrationScanAnalysis.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 
26 const float CalibrationScanAnalysis::VFSrange_ = 20;
27 
28 CalibrationScanAnalysis::CalibrationScanAnalysis(const uint32_t& key, const bool& deconv)
29  : CommissioningAnalysis(key, "CalibrationScanAnalysis"), deconv_(deconv) {
44 }
45 
46 // ----------------------------------------------------------------------------
47 //
49  : CommissioningAnalysis("CalibrationScanAnalysis"), deconv_(deconv) {
52 
65 }
66 // ----------------------------------------------------------------------------
67 //
68 void CalibrationScanAnalysis::addOneCalibrationPoint(const std::string& key) // key of form isha_%d_vfs_%d
69 {
81 }
82 
83 // ----------------------------------------------------------------------------
84 //
100 
101  for (const auto& key : amplitude_) {
102  amplitude_[key.first] = VFloat(2, sistrip::invalid_);
103  tail_[key.first] = VFloat(2, sistrip::invalid_);
104  riseTime_[key.first] = VFloat(2, sistrip::invalid_);
105  turnOn_[key.first] = VFloat(2, sistrip::invalid_);
106  peakTime_[key.first] = VFloat(2, sistrip::invalid_);
108  baseline_[key.first] = VFloat(2, sistrip::invalid_);
109  smearing_[key.first] = VFloat(2, sistrip::invalid_);
110  chi2_[key.first] = VFloat(2, sistrip::invalid_);
111  decayTime_[key.first] = VFloat(2, sistrip::invalid_);
112  }
113 }
114 
115 // ----------------------------------------------------------------------------
116 //
117 void CalibrationScanAnalysis::print(std::stringstream& ss, uint32_t iapv) {
118  header(ss);
119  ss << " Monitorables for APV number : " << iapv;
120  if (iapv == 0) {
121  ss << " (first of pair)";
122  } else if (iapv == 1) {
123  ss << " (second of pair)";
124  }
125  ss << std::endl;
126  ss << " Looking at key " << amplitude_.begin()->first << std::endl;
127  ss << " Amplitude of the pulse : " << amplitude_[amplitude_.begin()->first][iapv] << std::endl
128  << " Baseline : " << baseline_[amplitude_.begin()->first][iapv] << std::endl
129  << " Rise time : " << riseTime_[amplitude_.begin()->first][iapv] << std::endl
130  << " Turn-on time : " << turnOn_[amplitude_.begin()->first][iapv] << std::endl
131  << " Peak time : " << peakTime_[amplitude_.begin()->first][iapv] << std::endl
132  << " Undershoot : " << undershoot_[amplitude_.begin()->first][iapv] << std::endl
133  << " Time constant : " << decayTime_[amplitude_.begin()->first][iapv] << std::endl
134  << " Smearing : " << smearing_[amplitude_.begin()->first][iapv] << std::endl
135  << " Chi2 : " << chi2_[amplitude_.begin()->first][iapv] << std::endl;
136  if (deconvMode()) {
137  ss << "Data obtained in deconvolution mode." << std::endl;
138  } else {
139  ss << "Data obtained in peak mode." << std::endl;
140  }
141 }
142 
143 bool CalibrationScanAnalysis::isValid() const { return true; }
static const float maxDecayTimeThreshold_
static const float minAmplitudeThreshold_
std::map< std::string, VFloat > turnOn_
std::map< std::string, VFloat > tail_
static const float minBaselineThreshold_
std::map< std::string, VFloat > decayTime_
static const float minDecayTimeThreshold_
static const float maxTurnOnThreshold_
std::map< std::string, VFloat > amplitude_
sistrip classes
std::map< std::string, VBool > isvalid_
static const float maxISHAforVFSTune_
static const float maxPeakTimeThreshold_
std::vector< float > VFloat
static const float maxChi2Threshold_
std::map< std::string, VFloat > riseTime_
std::vector< bool > VBool
static const float maxRiseTimeThreshold_
static const float minISHAforVFSTune_
std::vector< uint16_t > VInt
static const uint16_t invalid_
Definition: Constants.h:16
void addOneCalibrationPoint(const std::string &key)
std::map< std::string, VFloat > smearing_
void print(std::stringstream &, uint32_t not_used=0) override
CalibrationScanAnalysis(const uint32_t &key, const bool &deconv)
virtual void header(std::stringstream &) const
std::map< std::string, VFloat > baseline_
static const float minPeakTimeThreshold_
std::map< std::string, VFloat > peakTime_
static const float minRiseTimeThreshold_
std::map< std::string, VFloat > undershoot_
Abstract base for derived classes that provide analysis of commissioning histograms.
static const float maxBaselineThreshold_
std::map< std::string, VFloat > chi2_
static const float minTurnOnThreshold_