~durga/maus/rel709

« back to all changes in this revision

Viewing changes to src/common_cpp/Recon/SciFi/RealDataDigitization.hh

  • Committer: Durga Rajaram
  • Date: 2013-08-27 04:36:50 UTC
  • mfrom: (659.1.73 rc)
  • Revision ID: durga@fnal.gov-20130827043650-me0hgsbzlzikdoik
Tags: MAUS-v0.7.0
MAUS-v0.7.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
 
57
57
class RealDataDigitization {
58
58
 public:
59
 
  // typedef std::vector< std::vector< std::vector< Json::Value > > > JsonBoardBankChannelArray;
60
 
 
61
 
  // typedef std::vector< std::vector< std::vector< bool > > > BoolBoardBankChannelArray;
62
 
 
63
59
  typedef std::vector<int> IntChannelArray;
64
60
 
65
61
  RealDataDigitization();
66
62
 
67
63
  ~RealDataDigitization();
68
64
 
 
65
  void initialise();
 
66
 
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
72
70
   */
73
 
  void process(Spill &spill, Json::Value const &input_event);
 
71
  void process(Spill *spill, Json::Value const &input_event);
 
72
 
 
73
  void process_VLSB(Json::Value input_event,
 
74
                      SciFiEvent* event,
 
75
                      TrackerDaq *tracker0daq_event,
 
76
                      TrackerDaq *tracker1daq_event);
 
77
 
 
78
  void process_VLSB_c(Json::Value input_event,
 
79
                      SciFiEvent* event,
 
80
                      TrackerDaq *tracker0daq_event,
 
81
                      TrackerDaq *tracker1daq_event);
74
82
 
75
83
  /** @brief Reads in the calibration.
76
84
   */
77
85
  bool load_calibration(std::string filename);
78
86
 
79
 
  /** @brief Saves calibration to vectors.
80
 
   */
81
 
  void read_in_all_Boards(std::ifstream &inf);
82
 
 
83
87
  /** @brief Loads the mapping.
84
88
   */
85
89
  bool load_mapping(std::string file);
95
99
 
96
100
  /** @brief Returns value depends on the goodness of the channel.
97
101
   */
98
 
  bool is_good_channel(int board, int bank, int chan_ro) const;
 
102
  bool is_good_channel(int bank, int chan_ro) const;
99
103
 
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]; }
102
106
 
103
107
 private:
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;
108
 
 
109
 
  /// A vector containing calibration values for every 4 banks of the 16 boards.
110
 
  double _calibration_pedestal[16][4][128];
111
 
 
112
 
  double _calibration_gain[16][4][128];
113
 
 
114
 
  int _calibration_unique_chan_number[16][4][128];
115
 
 
 
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;
 
113
 
 
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];
118
118
 
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;