57
57
class RealDataDigitization {
59
// typedef std::vector< std::vector< std::vector< Json::Value > > > JsonBoardBankChannelArray;
61
// typedef std::vector< std::vector< std::vector< bool > > > BoolBoardBankChannelArray;
63
59
typedef std::vector<int> IntChannelArray;
65
61
RealDataDigitization();
67
63
~RealDataDigitization();
69
67
/** @brief Processes a spill from DAQ
70
68
* @params spill A SciFiSpill to be filled
71
69
* @params input_event The DAQ JSON Tracker Event
73
void process(Spill &spill, Json::Value const &input_event);
71
void process(Spill *spill, Json::Value const &input_event);
73
void process_VLSB(Json::Value input_event,
75
TrackerDaq *tracker0daq_event,
76
TrackerDaq *tracker1daq_event);
78
void process_VLSB_c(Json::Value input_event,
80
TrackerDaq *tracker0daq_event,
81
TrackerDaq *tracker1daq_event);
75
83
/** @brief Reads in the calibration.
77
85
bool load_calibration(std::string filename);
79
/** @brief Saves calibration to vectors.
81
void read_in_all_Boards(std::ifstream &inf);
83
87
/** @brief Loads the mapping.
85
89
bool load_mapping(std::string file);
96
100
/** @brief Returns value depends on the goodness of the channel.
98
bool is_good_channel(int board, int bank, int chan_ro) const;
102
bool is_good_channel(int bank, int chan_ro) const;
100
int get_calibration_unique_chan_numb(int board, int bank, int chan) const {
101
return _calibration_unique_chan_number[board][bank][chan]; }
104
// int get_calibration_unique_chan_numb(int bank, int chan) const {
105
// return _calibration_unique_chan_number[board][bank][chan]; }
104
static const int _number_channels;
105
static const int _number_banks;
106
static const int _number_boards;
107
static const int _total_number_channels;
109
/// A vector containing calibration values for every 4 banks of the 16 boards.
110
double _calibration_pedestal[16][4][128];
112
double _calibration_gain[16][4][128];
114
int _calibration_unique_chan_number[16][4][128];
108
static const int _number_channels = 128;
109
static const int _number_banks = 64;
110
static const int _number_boards = 16;
111
static const int _total_number_channels = 6403;
112
static const double _pedestal_min = 0.000000001;
114
/// Arrays containing calibration values for every channel in the 4 banks of the 16 boards.
115
Json::Value calibration_[_number_banks][_number_channels];
116
116
/// This is an array storing the goodness of each channel.
117
bool _good_chan[16][4][128];
117
bool _good_chan[_number_banks][_number_channels];
119
// std::vector<int> _cryo;
120
// std::vector<int> _cass;
119
/// This is for the mapping storage.
121
120
IntChannelArray _board;
122
121
IntChannelArray _bank;
123
122
IntChannelArray _chan_ro;