4#include "../utils/general_utility.h"
5#include "../utils/tree_database.h"
16 std::vector<std::string>
fields = {
"run",
"status",
"step",
"board",
"channels"};
17 std::vector<std::string>
sub_run_fields = {
"channel",
"bcrconfig",
"opmode",
"deltathreshold",
"vbias",
"directory",
"notes"};
22 std::vector<std::string>
laser_positions = {
"empty",
"center",
"top-left",
"top-right",
"bottom-left",
"bottom-right"};
39 std::unordered_map<std::string, std::vector<std::string>>
get_run_infos(std::string
run);
47 std::unordered_map<std::string, std::unordered_map<std::string, std::vector<std::string>>>
get_sub_runs_infos(std::string
run, std::string
channel, std::string
vbias, std::string type, std::string
position);
48 std::unordered_map<std::string, std::unordered_map<std::string, std::vector<std::string>>>
get_sub_runs_infos(std::string
board, std::string
step, std::string
channel, std::string
vbias, std::string type, std::string
position) {
return get_sub_runs_infos(
get_latest_laser_run(
board,
step).
second,
channel,
vbias, type,
position); }
142 cerr <<
"[WARNING][datbase::laser::read_sub_run_database] no run entry in general database, abort loading sub_run" <<
endl;
147 cerr <<
"[WARNING][datbase::laser::read_sub_run_database] too many run entries in general database, abort loading sub_run" <<
endl;
169 cerr <<
"[WARNING][datbase::laser::read_sub_run_database] no run entry in general database, abort loading sub_run" <<
endl;
174 cerr <<
"[WARNING][datbase::laser::read_sub_run_database] too many run entries in general database, abort loading sub_run" <<
endl;
242 std::unordered_map<std::string, std::vector<std::string>>
result;
250 std::unordered_map<std::string, std::vector<std::string>>
result;
258 std::unordered_map<std::string, std::vector<std::string>>
result;
281 [](
const std::pair<int, std::string> &
a,
const std::pair<int, std::string> &
b)
282 { return a.second > b.second; });
287 std::unordered_map<std::string, std::unordered_map<std::string, std::vector<std::string>>>
result;
317 std::array<std::array<float, 2>, 2>
result;
326 return {{{0., 0.}, {0., 0.}}};
370 result->GetXaxis()->SetTitle(
"V_{bias} (V)");
371 result->GetYaxis()->SetTitle(
"Pseudo-efficiency (%)");
416 result->GetXaxis()->SetTitle(
"V_{bias} (V)");
417 result->GetYaxis()->SetTitle(
"Pseudo-efficiency (%)");
462 result->GetXaxis()->SetTitle(
"V_{bias} (V)");
463 result->GetYaxis()->SetTitle(
"Pseudo-efficiency (%)");
504 std::map<std::string, TGraphErrors *>
result;
531 [](
const std::pair<int, std::string> &
pair)
532 { return pair.second; });
553 [](
const std::pair<int, std::string> &
pair)
554 { return pair.second; });
Definition tree_database.h:6
TH2_Type * build_fine_tune_raw_histogram(std::vector< TString > kInputFileNames, TString kRunTag, TString kOutputFileName, bool kRecalculate)
Functions -------------------------------------------------------------------------------------------...
Definition fine_analysis.h:80
std::unordered_map< std::string, std::vector< std::string > > get_sub_run_infos(std::string sub_run)
Definition database_laser.C:248
tree_database database
Definition database_laser.C:19
std::map< std::string, TGraphErrors * > get_stability_check(std::vector< std::string > run_list)
Definition database_laser.C:502
std::vector< std::string > fields
Definition database_laser.C:16
std::array< std::array< float, 2 >, 2 > get_sub_run_value(std::string sub_run)
Definition database_laser.C:315
void download_run(std::string campaign, std::string target_run_tag=".")
Definition database_laser.C:190
void read_all_sub_runs()
Definition database_laser.C:183
std::string basedir
Definition database_laser.C:24
std::array< float, 2 > get_sub_run_bkg(std::string sub_run)
Definition database_laser.C:54
std::map< std::string, TGraphErrors * > get_graph_sensor_from_channel(std::string run, std::string sensor, std::string type, std::string position, TGraphErrors *(*graph_getter)(std::string, std::string, std::string, std::string))
Definition database_laser.C:307
void show_stability_check(std::vector< std::string > run_list)
Definition database_laser.C:535
std::unordered_map< std::string, std::unordered_map< std::string, std::vector< std::string > > > get_sub_runs_infos(std::string run, std::string channel, std::string vbias, std::string type, std::string position)
Definition database_laser.C:285
const double coarse_to_ns
Definition database_laser.C:13
void read_database(std::string database_input_file)
Definition database_laser.C:68
std::vector< std::pair< int, std::string > > get_all_laser_runs()
Definition database_laser.C:43
std::array< float, 2 > get_sub_run_sig(std::string sub_run)
Definition database_laser.C:53
std::vector< std::string > sub_run_fields
Definition database_laser.C:17
std::unordered_map< std::string, std::vector< std::string > > get_run_infos(std::string run)
Definition database_laser.C:240
std::map< std::string, TGraphErrors * > get_sensor_bkg_vs_vbias(std::string run, std::string sensor, std::string type, std::string position)
Definition database_laser.C:59
void read_sub_run_database(std::string database_input_file, std::string type="target")
Definition database_laser.C:116
std::vector< std::string > laser_positions
Definition database_laser.C:22
std::map< std::string, TGraphErrors * > get_sensor_pPDE_vs_bkg(std::string run, std::string sensor, std::string type, std::string position)
Definition database_laser.C:60
TGraphErrors * get_bkg_vs_vbias(std::string run, std::string channel, std::string type, std::string position)
Definition database_laser.C:410
TGraphErrors * get_pPDE_vs_vbias(std::string run, std::string channel, std::string type, std::string position)
Definition database_laser.C:364
std::unordered_map< int, std::vector< std::string > > info_database
Definition database_laser.C:20
TGraphErrors * get_pPDE_vs_bkg(std::string run, std::string channel, std::string type, std::string position)
Definition database_laser.C:456
void unzip_all_sub_runs(std::string target_run_tag)
Definition database_laser.C:215
void unzip_sub_run(std::string target_file, std::string target_dir=".", std::string campaign="2024-laser-window")
Definition database_laser.C:207
std::pair< int, std::string > get_latest_laser_run(std::string board, std::string step)
Definition database_laser.C:277
std::map< std::string, TGraphErrors * > get_sensor_pPDE_vs_vbias(std::string run, std::string sensor, std::string type, std::string position)
Definition database_laser.C:58
void update_local_data_repository(std::string current_campaign="2024-laser-window")
Definition database_laser.C:224
std::unordered_map< std::string, std::vector< std::string > > sensor_to_channels
Definition database.C:93
std::map< std::string, TGraphErrors * > average_graphs(std::vector< TGraphErrors * > graphs_list)
Definition graphutils.C:171
std::map< std::string, TGraphErrors * > average_same_x(TGraphErrors *target_graph)
Definition graphutils.C:125
std::vector< std::string > get_folders(const std::string &dir_path)
Definition general_utility.h:85