pflib v2.7.0-1-gd371ab6a
Polarfire Interaction Library
pftool_tasks.h
1#ifndef PFTOOL_TASKS_H
2#define PFTOOL_TASKS_H
3
4#include "pftool.h"
5
6#include "pflib/decoding/SuperPacket.h"
7#include "pftool_bias.h"
8#include "pftool_roc.h"
9#include "pftool_elinks.h"
10#include "pftool_fastcontrol.h"
11#include "pftool_daq.h"
12#include "pftool_hardcoded_values.h"
13#include <sys/stat.h>
14#include <ctime>
15#include <algorithm>
16#include <numeric>
17#include <cmath>
18
30void tasks( const std::string& cmd, pflib::PolarfireTarget* pft );
31
32void beamprep(pflib::PolarfireTarget* pft);
33
34void tot_tune(pflib::PolarfireTarget* pft);
35
36void make_scan_csv_header(PolarfireTarget* pft,
37 std::ofstream& csv_out,
38 const std::string& valuename);
39
40void take_N_calibevents_with_channel(PolarfireTarget* pft,
41 std::ofstream& csv_out,
42 const int SiPM_bias,
43 const int capacitor_type,
44 const int events_per_step,
45 const int ichan,
46 const int value);
47
48
49void set_one_channel_per_elink(PolarfireTarget* pft,
50 const std::string& parameter,
51 const int channels_per_elink,
52 const int ichan,
53 const int value);
54
55void enable_one_channel_per_elink(PolarfireTarget* pft, const std::string& modeinfo,
56 const int channels_per_elink,
57 const int ichan);
58void disable_one_channel_per_elink(PolarfireTarget* pft, const std::string& modeinfo,
59 const int channels_per_elink,
60 const int ichan);
61
62void scan_N_steps(PolarfireTarget* pft,
63 std::ofstream& csv_out,
64 const int SiPM_bias,
65 const int events_per_step,
66 const int steps,
67 const int low_value,
68 const int high_value,
69 const std::string& valuename,
70 const std::string& pagetemplate,
71 const std::string& modeinfo);
72// This screams for RAII...
73void teardown_charge_injection(PolarfireTarget* pft);
74void prepare_charge_injection(PolarfireTarget* pft);
75
76
77void calibrun_ledruns(pflib::PolarfireTarget* pft,
78 const std::vector<std::string>& led_filenames);
79void calibrun(pflib::PolarfireTarget* pft,
80 const std::string& pedestal_filename,
81 const std::string& chargescan_filename,
82 const std::vector<std::string>& led_filenames);
83
84std::vector<std::string> make_led_filenames();
85std::string make_default_led_template();
86std::string make_default_chargescan_filename(PolarfireTarget* pft,
87 const int dpm,
88 const std::string& valuename,
89 const int calib_offset = -1);
90bool directory_exists(const std::string& directory);
91std::string get_yearmonthday();
92std::string get_output_directory();
93
94
95double get_average_adc(pflib::PolarfireTarget* pft,
97 const int link,
98 const int ch);
99
100std::vector<double> get_pedestal_stats(pflib::PolarfireTarget*pft,
102 const int link);
103
104std::vector<double> get_pedestal_stats(pflib::PolarfireTarget* pft);
105void test_dacb_one_channel_at_a_time(pflib::PolarfireTarget* pft);
106void read_charge(PolarfireTarget* pft);
107void read_samples(PolarfireTarget* pft, const pflib::decoding::SuperPacket& data);
108void read_pedestal(PolarfireTarget* pft);
109#endif /* PFTOOL_TASKS_H */
Definition of settings.
Definition: DetectorConfiguration.cxx:22
Decoding of entire "super packet" which holds multiple polarfire packets - one for each sample in an ...
Definition: SuperPacket.h:20
Interface to a single polarfire.
Definition: PolarfireTarget.h:33