/* This file is part of MAUS: http://micewww.pp.rl.ac.uk:8080/projects/maus * * MAUS is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * MAUS is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with MAUS. If not, see . * */ /** @class RealDataDigitization * D... * */ #ifndef REALDATADIGITIZATION_HH #define REALDATADIGITIZATION_HH // C headers #include #include #include #include #include #include // C++ headers #include #include #include #include #include #include #include #include // G4MICE from commonCpp #include "Interface/dataCards.hh" #include "Interface/MICEEvent.hh" // from old file #include "Config/MiceModule.hh" #include "src/common_cpp/DataStructure/SciFiDigit.hh" #include "src/common_cpp/DataStructure/SciFiEvent.hh" #include "src/common_cpp/DataStructure/ReconEvent.hh" #include "src/common_cpp/DataStructure/Spill.hh" namespace MAUS { class RealDataDigitization { public: // typedef std::vector< std::vector< std::vector< Json::Value > > > JsonBoardBankChannelArray; // typedef std::vector< std::vector< std::vector< bool > > > BoolBoardBankChannelArray; typedef std::vector IntChannelArray; RealDataDigitization(); ~RealDataDigitization(); /** @brief Processes a spill from DAQ * @params spill A SciFiSpill to be filled * @params input_event The DAQ JSON Tracker Event */ void process(Spill &spill, Json::Value const &input_event); /** @brief Reads in the calibration. */ bool load_calibration(std::string filename); /** @brief Saves calibration to vectors. */ void read_in_all_Boards(std::ifstream &inf); /** @brief Loads the mapping. */ bool load_mapping(std::string file); /** @brief Converts read-out map into SciFi Fibre map */ bool get_StatPlaneChannel(int &board, int &bank, int &chan_ro, int &tracker, int &station, int &plane, int &channel) const; /** @brief Reads the bad channel list from file. */ bool load_bad_channels(); /** @brief Returns value depends on the goodness of the channel. */ bool is_good_channel(int board, int bank, int chan_ro) const; int get_calibration_unique_chan_numb(int board, int bank, int chan) const { return _calibration_unique_chan_number[board][bank][chan]; } private: static const int _number_channels; static const int _number_banks; static const int _number_boards; static const int _total_number_channels; /// A vector containing calibration values for every 4 banks of the 16 boards. double _calibration_pedestal[16][4][128]; double _calibration_gain[16][4][128]; int _calibration_unique_chan_number[16][4][128]; /// This is an array storing the goodness of each channel. bool _good_chan[16][4][128]; // std::vector _cryo; // std::vector _cass; IntChannelArray _board; IntChannelArray _bank; IntChannelArray _chan_ro; IntChannelArray _tracker; IntChannelArray _station; IntChannelArray _view; IntChannelArray _fibre; IntChannelArray _extWG; IntChannelArray _inWG; IntChannelArray _WGfib; }; // Don't forget this trailing colon!!!! } // ~namespace MAUS #endif