CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 //
28  : CommissioningAnalysis("FedTimingAnalysis"),
29  time_(sistrip::invalid_),
30  max_(sistrip::invalid_),
31  delay_(sistrip::invalid_),
32  error_(sistrip::invalid_),
33  base_(sistrip::invalid_),
34  peak_(sistrip::invalid_),
35  height_(sistrip::invalid_),
36  optimumSamplingPoint_(15.)
37 {;}
38 
39 // ----------------------------------------------------------------------------
40 //
49 }
50 
51 // ----------------------------------------------------------------------------
52 //
53 void FedTimingAnalysis::print( std::stringstream& ss, uint32_t not_used ) {
54  header( ss );
55  ss << " Time of tick rising edge [ns] : " << time_ << "\n"
56  << " Maximum time (sampling point) [ns] : " << max_ << "\n"
57  << " Delay required wrt max time [ns] : " << delay_ << "\n"
58  << " Error on delay [ns] : " << error_ << "\n"
59  << " Baseline [adc] : " << base_ << "\n"
60  << " Tick peak [adc] : " << peak_ << "\n"
61  << " Tick height [adc] : " << height_ << "\n";
62 }
63 
64 // ----------------------------------------------------------------------------
65 //
66 void FedTimingAnalysis::max( const float& max ) {
67  max_ = max;
68  if ( time_ > sistrip::maximum_ ) { return; }
69  int32_t adjustment = 25 - static_cast<int32_t>( rint( max_ + optimumSamplingPoint_ ) ) % 25;
70  max_ += adjustment;
71  delay_ = max_ - time_;
72 }
const T & max(const T &a, const T &b)
static const uint16_t maximum_
Definition: Constants.h:21
virtual void header(std::stringstream &) const
static const uint16_t invalid_
Definition: Constants.h:17
void print(std::stringstream &, uint32_t not_used=0)
list key
Definition: combine.py:13
Abstract base for derived classes that provide analysis of commissioning histograms.
const float & max() const