sipm-characterisation 0.1.0
SiPM characterisation for ePIC — IV/DCR/gain, laser, readout, irradiation
Loading...
Searching...
No Matches
alcor.h
Go to the documentation of this file.
1#pragma once
2
3// Addition of fine tune class
4namespace alcor
5{
6 // Converter from integer to string w/ device name and reverse
7 std::map<int, std::string> device_int2string = {
8 {192, "kc705-192"},
9 {193, "kc705-193"},
10 {194, "kc705-194"},
11 {195, "kc705-195"},
12 {196, "kc705-196"},
13 {197, "kc705-197"},
14 {198, "kc705-198"},
15 {207, "kc705-207"}};
16 std::map<std::string, int> device_string2int = {
17 {"kc705-192", 192},
18 {"kc705-193", 193},
19 {"kc705-194", 194},
20 {"kc705-195", 195},
21 {"kc705-196", 196},
22 {"kc705-197", 197},
23 {"kc705-198", 198},
24 {"kc705-207", 207}};
25 // All possible devices from beam test in string and indeces
26 std::vector<std::string> devices = {
27 "kc705-192",
28 "kc705-193",
29 "kc705-194",
30 "kc705-195",
31 "kc705-196",
32 "kc705-197",
33 "kc705-198",
34 "kc705-207"};
35 std::vector<int> devices_indices = {
36 192,
37 193,
38 194,
39 195,
40 196,
41 197,
42 198,
43 207};
44 //
45 // --- Constants
46 const int maximum_TDC = 768;
47 //
50 const double coarse_to_s = 3.1250000e-09;
51 const double coarse_to_ms = 3.1250000e-06;
52 const double coarse_to_us = 3.1250000e-03;
53 const double coarse_to_ns = 3.1250000;
55 const int rollover_to_coarse = 32768;
56 const double rollover_to_s = 0.0001024;
57 const double rollover_to_ms = 0.1024;
58 const double rollover_to_us = 102.4;
59 const double rollover_to_ns = 102400.;
60
61 // Read raw data structure
62 struct t_hit
63 {
65 double time;
66 };
67
69 {
70
73 auto fin = TFile::Open(infilename.c_str());
74 auto tin = (TTree *)fin->Get("alcor");
75 tin->SetBranchAddress("fifo", &hit.fifo);
76 tin->SetBranchAddress("type", &hit.type);
77 tin->SetBranchAddress("counter", &hit.counter);
78 tin->SetBranchAddress("column", &hit.column);
79 tin->SetBranchAddress("pixel", &hit.pixel);
80 tin->SetBranchAddress("tdc", &hit.tdc);
81 tin->SetBranchAddress("rollover", &hit.rollover);
82 tin->SetBranchAddress("coarse", &hit.coarse);
83 tin->SetBranchAddress("fine", &hit.fine);
84 return tin;
85 }
86}
TH2_Type * build_fine_tune_raw_histogram(std::vector< TString > kInputFileNames, TString kRunTag, TString kOutputFileName, bool kRecalculate)
Functions -------------------------------------------------------------------------------------------...
Definition fine_analysis.h:80
Definition alcor.h:5
std::vector< std::string > devices
Definition alcor.h:26
const int maximum_TDC
Definition alcor.h:46
const double rollover_to_us
Definition alcor.h:58
const double rollover_to_ms
Definition alcor.h:57
const double coarse_to_us
Definition alcor.h:52
const double rollover_to_ns
Definition alcor.h:59
const double coarse_to_s
— Convertion — — Coarse
Definition alcor.h:50
const int rollover_to_coarse
— — Rollover
Definition alcor.h:55
const double coarse_to_ns
Definition alcor.h:53
TTree * load_alcor_data_tree(const std::string infilename, t_hit &hit)
Definition alcor.h:68
std::map< int, std::string > device_int2string
Definition alcor.h:7
const double rollover_to_s
Definition alcor.h:56
std::vector< int > devices_indices
Definition alcor.h:35
const double coarse_to_ms
Definition alcor.h:51
std::map< std::string, int > device_string2int
Definition alcor.h:16
Definition alcor.h:63
int coarse
Definition alcor.h:64
int column
Definition alcor.h:64
int tdc
Definition alcor.h:64
int fifo
Definition alcor.h:64
double time
Definition alcor.h:65
int pixel
Definition alcor.h:64
int rollover
Definition alcor.h:64
int counter
Definition alcor.h:64
int fine
Definition alcor.h:64
int type
Definition alcor.h:64