CMS 3D CMS Logo

CalibrationAnalysis.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 
24 
33 
34 CalibrationAnalysis::CalibrationAnalysis(const uint32_t& key, const bool& deconv)
35  : CommissioningAnalysis(key, "CalibrationAnalysis"),
36  amplitude_(2, VFloat(128, sistrip::invalid_)),
37  tail_(2, VFloat(128, sistrip::invalid_)),
38  riseTime_(2, VFloat(128, sistrip::invalid_)),
39  decayTime_(2, VFloat(128, sistrip::invalid_)),
40  turnOn_(2, VFloat(128, sistrip::invalid_)),
41  peakTime_(2, VFloat(128, sistrip::invalid_)),
42  undershoot_(2, VFloat(128, sistrip::invalid_)),
43  baseline_(2, VFloat(128, sistrip::invalid_)),
44  smearing_(2, VFloat(128, sistrip::invalid_)),
45  chi2_(2, VFloat(128, sistrip::invalid_)),
46  isvalid_(2, VBool(128, sistrip::invalid_)),
47  mean_amplitude_(2, sistrip::invalid_),
48  mean_tail_(2, sistrip::invalid_),
49  mean_riseTime_(2, sistrip::invalid_),
50  mean_decayTime_(2, sistrip::invalid_),
51  mean_turnOn_(2, sistrip::invalid_),
52  mean_peakTime_(2, sistrip::invalid_),
53  mean_undershoot_(2, sistrip::invalid_),
54  mean_baseline_(2, sistrip::invalid_),
55  mean_smearing_(2, sistrip::invalid_),
56  mean_chi2_(2, sistrip::invalid_),
57  min_amplitude_(2, sistrip::invalid_),
58  min_tail_(2, sistrip::invalid_),
59  min_riseTime_(2, sistrip::invalid_),
60  min_decayTime_(2, sistrip::invalid_),
61  min_turnOn_(2, sistrip::invalid_),
62  min_peakTime_(2, sistrip::invalid_),
63  min_undershoot_(2, sistrip::invalid_),
64  min_baseline_(2, sistrip::invalid_),
65  min_smearing_(2, sistrip::invalid_),
66  min_chi2_(2, sistrip::invalid_),
67  max_amplitude_(2, sistrip::invalid_),
68  max_tail_(2, sistrip::invalid_),
69  max_riseTime_(2, sistrip::invalid_),
70  max_decayTime_(2, sistrip::invalid_),
71  max_turnOn_(2, sistrip::invalid_),
72  max_peakTime_(2, sistrip::invalid_),
73  max_undershoot_(2, sistrip::invalid_),
74  max_baseline_(2, sistrip::invalid_),
75  max_smearing_(2, sistrip::invalid_),
76  max_chi2_(2, sistrip::invalid_),
77  spread_amplitude_(2, sistrip::invalid_),
78  spread_tail_(2, sistrip::invalid_),
79  spread_riseTime_(2, sistrip::invalid_),
80  spread_decayTime_(2, sistrip::invalid_),
81  spread_turnOn_(2, sistrip::invalid_),
82  spread_peakTime_(2, sistrip::invalid_),
83  spread_undershoot_(2, sistrip::invalid_),
84  spread_baseline_(2, sistrip::invalid_),
85  spread_smearing_(2, sistrip::invalid_),
86  spread_chi2_(2, sistrip::invalid_),
87  deconv_(deconv),
88  calChan_(0) {
89  ;
90 }
91 
92 // ----------------------------------------------------------------------------
93 //
95  : CommissioningAnalysis("CalibrationAnalysis"),
96  amplitude_(2, VFloat(128, sistrip::invalid_)),
97  tail_(2, VFloat(128, sistrip::invalid_)),
98  riseTime_(2, VFloat(128, sistrip::invalid_)),
99  decayTime_(2, VFloat(128, sistrip::invalid_)),
100  turnOn_(2, VFloat(128, sistrip::invalid_)),
101  peakTime_(2, VFloat(128, sistrip::invalid_)),
102  undershoot_(2, VFloat(128, sistrip::invalid_)),
103  baseline_(2, VFloat(128, sistrip::invalid_)),
104  smearing_(2, VFloat(128, sistrip::invalid_)),
105  chi2_(2, VFloat(128, sistrip::invalid_)),
106  isvalid_(2, VBool(128, sistrip::invalid_)),
107  mean_amplitude_(2, sistrip::invalid_),
108  mean_tail_(2, sistrip::invalid_),
109  mean_riseTime_(2, sistrip::invalid_),
110  mean_decayTime_(2, sistrip::invalid_),
111  mean_turnOn_(2, sistrip::invalid_),
112  mean_peakTime_(2, sistrip::invalid_),
113  mean_undershoot_(2, sistrip::invalid_),
114  mean_baseline_(2, sistrip::invalid_),
115  mean_smearing_(2, sistrip::invalid_),
116  mean_chi2_(2, sistrip::invalid_),
117  min_amplitude_(2, sistrip::invalid_),
118  min_tail_(2, sistrip::invalid_),
119  min_riseTime_(2, sistrip::invalid_),
120  min_decayTime_(2, sistrip::invalid_),
121  min_turnOn_(2, sistrip::invalid_),
122  min_peakTime_(2, sistrip::invalid_),
123  min_undershoot_(2, sistrip::invalid_),
124  min_baseline_(2, sistrip::invalid_),
125  min_smearing_(2, sistrip::invalid_),
126  min_chi2_(2, sistrip::invalid_),
127  max_amplitude_(2, sistrip::invalid_),
128  max_tail_(2, sistrip::invalid_),
129  max_riseTime_(2, sistrip::invalid_),
130  max_decayTime_(2, sistrip::invalid_),
131  max_turnOn_(2, sistrip::invalid_),
132  max_peakTime_(2, sistrip::invalid_),
133  max_undershoot_(2, sistrip::invalid_),
134  max_baseline_(2, sistrip::invalid_),
135  max_smearing_(2, sistrip::invalid_),
136  max_chi2_(2, sistrip::invalid_),
137  spread_amplitude_(2, sistrip::invalid_),
138  spread_tail_(2, sistrip::invalid_),
139  spread_riseTime_(2, sistrip::invalid_),
140  spread_decayTime_(2, sistrip::invalid_),
141  spread_turnOn_(2, sistrip::invalid_),
142  spread_peakTime_(2, sistrip::invalid_),
143  spread_undershoot_(2, sistrip::invalid_),
144  spread_baseline_(2, sistrip::invalid_),
145  spread_smearing_(2, sistrip::invalid_),
146  spread_chi2_(2, sistrip::invalid_),
147  deconv_(deconv),
148  calChan_(0) {
149  ;
150 }
151 
152 // ----------------------------------------------------------------------------
153 //
155  calChan_ = 0;
156 
168 
179 
190 
201 
212 }
213 
214 // ----------------------------------------------------------------------------
215 //
216 void CalibrationAnalysis::print(std::stringstream& ss, uint32_t iapv) {
217  header(ss);
218  ss << " Monitorables for APV number : " << iapv;
219  if (iapv == 0) {
220  ss << " (first of pair)";
221  } else if (iapv == 1) {
222  ss << " (second of pair)";
223  }
224  ss << std::endl;
225  ss << " Mean Amplitude of the pulse : " << mean_amplitude_[iapv] << std::endl
226  << " Mean Tail amplitude after 150ns : " << mean_tail_[iapv] << std::endl
227  << " Mean Rise time : " << mean_riseTime_[iapv] << std::endl
228  << " Mean Time constant : " << mean_decayTime_[iapv] << std::endl
229  << " Mean Turn on time : " << mean_turnOn_[iapv] << std::endl
230  << " Mean peak time : " << mean_peakTime_[iapv] << std::endl
231  << " Mean undershoot amplitude : " << mean_undershoot_[iapv] << std::endl
232  << " Mean baseline amplitude : " << mean_baseline_[iapv] << std::endl
233  << " Mean Smearing parameter : " << mean_smearing_[iapv] << std::endl
234  << " Mean Chi2 of the fit : " << mean_chi2_[iapv] << std::endl;
235  if (deconvMode()) {
236  ss << "Data obtained in deconvolution mode." << std::endl;
237  } else {
238  ss << "Data obtained in peak mode." << std::endl;
239  }
240 }
241 
242 bool CalibrationAnalysis::isValid() const { return true; }
static const float minRiseTimeThresholdDeco_
static const float maxTurnOnThreshold_
static const float maxRiseTimeThresholdDeco_
static const float minPeakTimeThreshold_
CalibrationAnalysis(const uint32_t &key, const bool &deconv)
static const float maxDecayTimeThresholdDeco_
static const float maxRiseTimeThreshold_
static const float maxBaselineThreshold_
void print(std::stringstream &, uint32_t not_used=0) override
sistrip classes
static const float minDecayTimeThresholdDeco_
bool isValid() const override
static const float minAmplitudeThreshold_
static const float maxDecayTimeThreshold_
static const float minTurnOnThresholdDeco_
static const float minDecayTimeThreshold_
std::vector< float > VFloat
std::vector< bool > VBool
static const float minPeakTimeThresholdDeco_
static const float minBaselineThreshold_
static const float maxTurnOnThresholdDeco_
static const float minRiseTimeThreshold_
static const uint16_t invalid_
Definition: Constants.h:16
std::vector< VBool > VVBool
static const float minTurnOnThreshold_
static const float maxChi2Threshold_
static const float maxPeakTimeThresholdDeco_
virtual void header(std::stringstream &) const
static const float maxPeakTimeThreshold_
std::vector< VFloat > VVFloat
Abstract base for derived classes that provide analysis of commissioning histograms.