CMS 3D CMS Logo

FedTimingAnalysis.cc
Go to the documentation of this file.
5 #include <iostream>
6 #include <iomanip>
7 #include <cmath>
8 
9 using namespace sistrip;
10 
11 // ----------------------------------------------------------------------------
12 //
14  : CommissioningAnalysis(key, "FedTimingAnalysis"),
15  time_(sistrip::invalid_),
16  max_(sistrip::invalid_),
17  delay_(sistrip::invalid_),
18  error_(sistrip::invalid_),
19  base_(sistrip::invalid_),
20  peak_(sistrip::invalid_),
21  height_(sistrip::invalid_),
22  optimumSamplingPoint_(15.) {
23  ;
24 }
25 
26 // ----------------------------------------------------------------------------
27 //
29  : CommissioningAnalysis("FedTimingAnalysis"),
38  ;
39 }
40 
41 // ----------------------------------------------------------------------------
42 //
51 }
52 
53 // ----------------------------------------------------------------------------
54 //
55 void FedTimingAnalysis::print(std::stringstream& ss, uint32_t not_used) {
56  header(ss);
57  ss << " Time of tick rising edge [ns] : " << time_ << "\n"
58  << " Maximum time (sampling point) [ns] : " << max_ << "\n"
59  << " Delay required wrt max time [ns] : " << delay_ << "\n"
60  << " Error on delay [ns] : " << error_ << "\n"
61  << " Baseline [adc] : " << base_ << "\n"
62  << " Tick peak [adc] : " << peak_ << "\n"
63  << " Tick height [adc] : " << height_ << "\n";
64 }
65 
66 // ----------------------------------------------------------------------------
67 //
68 void FedTimingAnalysis::max(const float& max) {
69  max_ = max;
70  if (time_ > sistrip::maximum_) {
71  return;
72  }
73  int32_t adjustment = 25 - static_cast<int32_t>(rint(max_ + optimumSamplingPoint_)) % 25;
74  max_ += adjustment;
75  delay_ = max_ - time_;
76 }
void print(std::stringstream &, uint32_t not_used=0) override
sistrip classes
void reset() override
static const uint16_t maximum_
Definition: Constants.h:20
virtual void header(std::stringstream &) const
static const uint16_t invalid_
Definition: Constants.h:16
Abstract base for derived classes that provide analysis of commissioning histograms.
const float & max() const