@@ -22,31 +22,6 @@ double median(std::vector<T>& val) {
2222 return 0.5 * (*mid + *mid2);
2323}
2424
25- // Class
26-
27- class DataFitter
28- {
29- public:
30- DataFitter ();
31-
32- // Member functions
33-
34- void sort_and_append (std::vector<int >& inv_vrefs,
35- std::vector<int >& pedestals);
36-
37- // Member variables
38-
39- struct Point {
40- int x_;
41- int y_;
42- double LH_;
43- double RH_;
44- };
45- std::vector<Point> linear_;
46- std::vector<Point> nonlinear_;
47-
48- };
49-
5025void DataFitter::sort_and_append (std::vector<int >& inv_vrefs, std::vector<int >& pedestals) {
5126 static auto the_log_{::pflib::logging::get (" inv_vref_scan" )};
5227 // We ignore first and last elements since they miss derivs
@@ -66,7 +41,7 @@ void DataFitter::sort_and_append(std::vector<int>& inv_vrefs, std::vector<int>&
6641
6742 // Threshold check. CMS uses 0.05
6843 if (std::abs (LH) <= flat_threshold || std::abs (RH) <= flat_threshold) { // flat regime
69- nonlinear_.push_back (inv_vrefs[i], pedestals[i], LH, RH)
44+ nonlinear_.push_back ({ inv_vrefs[i], pedestals[i], LH, RH});
7045 } else { // we're in a linear regime or there's an outlier
7146 slope_points.push_back ({i, LH, RH});
7247 LH_derivs.push_back (LH);
@@ -79,7 +54,7 @@ void DataFitter::sort_and_append(std::vector<int>& inv_vrefs, std::vector<int>&
7954
8055 for (const auto & p : slope_points) {
8156 if (std::abs (p.LH - LH_median) < 0.3 * LH_median) { // Linear regime. implement RH_median here as well?
82- linear_.push_back (inv_vrefs[p.i ], pedestals[p.i ], p.LH , p.RH );
57+ linear_.push_back ({ inv_vrefs[p.i ], pedestals[p.i ], p.LH , p.RH } );
8358 }
8459 }
8560
@@ -149,9 +124,9 @@ static void inv_vref_scan_writer(Target* tgt, pflib::ROC& roc, size_t nevents,
149124 // increment inv_vref in increments of 20. 10 bit value but only scanning to
150125 // 600
151126 int range = 10 ; // defines range of inv_vref values (x-range)
152- std::vector<double > pedestals_l0;
153- std::vector<double > pedestals_l1;
154- std::vector<double > inv_vrefs;
127+ std::vector<int > pedestals_l0;
128+ std::vector<int > pedestals_l1;
129+ std::vector<int > inv_vrefs;
155130
156131 for (inv_vref = 300 ; inv_vref <= 310 ; inv_vref += 1 ) {
157132 pflib_log (info) << " Running INV_VREF = " << inv_vref;
0 commit comments