Merge lp:~christopher-hunt08/maus/maus_new_digitizer into lp:maus/merge

Proposed by Christopher Hunt
Status: Merged
Merged at revision: 1240
Proposed branch: lp:~christopher-hunt08/maus/maus_new_digitizer
Merge into: lp:maus/merge
Diff against target: 158 lines (+40/-17)
4 files modified
src/common_cpp/Recon/SciFi/RealDataDigitization.cc (+34/-16)
src/common_cpp/Recon/SciFi/RealDataDigitization.hh (+2/-0)
src/common_py/ConfigurationDefaults.py (+1/-0)
src/map/MapCppTrackerDigits/MapCppTrackerDigits.cc (+3/-1)
To merge this branch: bzr merge lp:~christopher-hunt08/maus/maus_new_digitizer
Reviewer Review Type Date Requested Status
MAUS Maintainers Pending
Review via email: mp+335054@code.launchpad.net

Description of the change

Updates to the SciFi Digitizer in aniticipation of an updated calibration system.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/common_cpp/Recon/SciFi/RealDataDigitization.cc'
--- src/common_cpp/Recon/SciFi/RealDataDigitization.cc 2016-08-31 11:59:03 +0000
+++ src/common_cpp/Recon/SciFi/RealDataDigitization.cc 2017-12-11 22:51:03 +0000
@@ -28,7 +28,8 @@
2828
29#define MIN_ADC 0.00000000129#define MIN_ADC 0.000000001
3030
31RealDataDigitization::RealDataDigitization() : _npe_cut(0.0), _chan_map(_n_entries) {31RealDataDigitization::RealDataDigitization() : _npe_cut(0.0), _do_adc_cut(true),
32 _chan_map(_n_entries) {
32 // Do nothing33 // Do nothing
33}34}
3435
@@ -37,12 +38,14 @@
37}38}
3839
39void RealDataDigitization::initialise(double npe_cut,40void RealDataDigitization::initialise(double npe_cut,
41 bool do_adc_cut,
40 const std::string& map_file,42 const std::string& map_file,
41 const std::string& calib_file,43 const std::string& calib_file,
42 const std::string& bad_channels_file) {44 const std::string& bad_channels_file) {
43 // Load calibration, mapping and bad channel list.45 // Load calibration, mapping and bad channel list.
44 // These calls are to be replaced by CDB interface.46 // These calls are to be replaced by CDB interface.
45 _npe_cut = npe_cut;47 _npe_cut = npe_cut;
48 _do_adc_cut = do_adc_cut;
46 bool map = load_mapping(map_file.c_str());49 bool map = load_mapping(map_file.c_str());
47 bool calib = load_calibration(calib_file.c_str());50 bool calib = load_calibration(calib_file.c_str());
48 bool bad_channels = load_bad_channels(bad_channels_file.c_str());51 bool bad_channels = load_bad_channels(bad_channels_file.c_str());
@@ -97,10 +100,17 @@
97 continue;100 continue;
98 }101 }
99102
103 if (_do_adc_cut) {
104 double adc_noise_cut = _calibration[bank][channel_ro]["adc_noise_cut"].asDouble();
105 if (adc <= adc_noise_cut) {
106 continue;
107 }
108 }
109
100 // Get pedestal and gain from calibration.110 // Get pedestal and gain from calibration.
101 // int new_bank = bank + 4*board;111 // int new_bank = bank + 4*board;
102 double adc_pedestal = _calibration[bank][channel_ro]["adc_pedestal"].asDouble();112 double adc_pedestal = _calibration[bank][channel_ro]["adc_pedestal"].asDouble();
103 double adc_gain = _calibration[bank][channel_ro]["adc_gain"].asDouble();113 double adc_gain = _calibration[bank][channel_ro]["adc_gain"].asDouble();
104 // double tdc_pedestal = _calibration[bank][channel_ro]["tdc_pedestal"].asDouble();114 // double tdc_pedestal = _calibration[bank][channel_ro]["tdc_pedestal"].asDouble();
105 // double tdc_gain = _calibration[bank][channel_ro]["tdc_gain"].asDouble();115 // double tdc_gain = _calibration[bank][channel_ro]["tdc_gain"].asDouble();
106116
@@ -117,11 +127,13 @@
117 /* No TDC calibration yet127 /* No TDC calibration yet
118 if ( tdc_pedestal > tdc_pedestal_min && tdc_gain > 0 ) {128 if ( tdc_pedestal > tdc_pedestal_min && tdc_gain > 0 ) {
119 time = (tdc-tdc_pedestal)/tdc_gain;129 time = (tdc-tdc_pedestal)/tdc_gain;
120 } else {
121 time = -10.0;
122 }130 }
123 */131 */
124132
133 if ( pe <= _npe_cut ) {
134 continue;
135 }
136
125 // Find tracker, station, plane, channel.137 // Find tracker, station, plane, channel.
126 int board = floor(bank/4);138 int board = floor(bank/4);
127 int old_bank = bank%4;139 int old_bank = bank%4;
@@ -136,7 +148,7 @@
136 tracker, station, plane, channel,148 tracker, station, plane, channel,
137 extWG, inWG, WGfib);149 extWG, inWG, WGfib);
138 // Exclude missing modules.150 // Exclude missing modules.
139 if ( found && (pe > _npe_cut ) ) {151 if ( found ) {
140 SciFiDigit *digit = new SciFiDigit(SpillNum, vlsb1.GetPartEventNumber(),152 SciFiDigit *digit = new SciFiDigit(SpillNum, vlsb1.GetPartEventNumber(),
141 tracker, station, plane, channel, pe, time);153 tracker, station, plane, channel, pe, time);
142 digit->set_adc(adc);154 digit->set_adc(adc);
@@ -254,17 +266,23 @@
254266
255 size_t n_channels = calibration_data.size();267 size_t n_channels = calibration_data.size();
256 for ( Json::Value::ArrayIndex i = 0; i < n_channels; ++i ) {268 for ( Json::Value::ArrayIndex i = 0; i < n_channels; ++i ) {
257 int bank = calibration_data[i]["bank"].asInt();269 int bank = calibration_data[i]["bank"].asInt();
258 int channel_n = calibration_data[i]["channel"].asInt();270 int channel_n = calibration_data[i]["channel"].asInt();
259 double adc_pedestal = calibration_data[i]["adc_pedestal"].asDouble();271 double adc_pedestal = calibration_data[i]["adc_pedestal"].asDouble();
260 double adc_gain = calibration_data[i]["adc_gain"].asDouble();272 double adc_gain = calibration_data[i]["adc_gain"].asDouble();
261 double tdc_pedestal = calibration_data[i]["tdc_pedestal"].asDouble();273 double tdc_pedestal = calibration_data[i]["tdc_pedestal"].asDouble();
262 double tdc_gain = calibration_data[i]["tdc_gain"].asDouble();274 double tdc_gain = calibration_data[i]["tdc_gain"].asDouble();
263 Json::Value channel;275 Json::Value channel;
264 channel["adc_pedestal"] = adc_pedestal;276 channel["adc_pedestal"] = adc_pedestal;
265 channel["adc_gain"] = adc_gain;277 channel["adc_gain"] = adc_gain;
266 channel["tdc_pedestal"] = tdc_pedestal;278 channel["tdc_pedestal"] = tdc_pedestal;
267 channel["tdc_gain"] = tdc_gain;279 channel["tdc_gain"] = tdc_gain;
280
281 if (_do_adc_cut) {
282 double adc_noise_cut = calibration_data[i]["adc_noise_cut"].asDouble();
283 channel["adc_noise_cut"] = adc_noise_cut;
284 }
285
268 _calibration[bank][channel_n] = channel;286 _calibration[bank][channel_n] = channel;
269 }287 }
270288
271289
=== modified file 'src/common_cpp/Recon/SciFi/RealDataDigitization.hh'
--- src/common_cpp/Recon/SciFi/RealDataDigitization.hh 2015-07-03 18:30:17 +0000
+++ src/common_cpp/Recon/SciFi/RealDataDigitization.hh 2017-12-11 22:51:03 +0000
@@ -96,6 +96,7 @@
96 ~RealDataDigitization();96 ~RealDataDigitization();
9797
98 void initialise(double npe_cut,98 void initialise(double npe_cut,
99 bool do_adc_cut,
99 const std::string& map_file,100 const std::string& map_file,
100 const std::string& calib_file,101 const std::string& calib_file,
101 const std::string& bad_channels_file);102 const std::string& bad_channels_file);
@@ -158,6 +159,7 @@
158 static const int _banks_per_board = 4;159 static const int _banks_per_board = 4;
159 static const int _n_entries = 8192;160 static const int _n_entries = 8192;
160 double _npe_cut;161 double _npe_cut;
162 bool _do_adc_cut;
161 // static const double _min = 0.000000001;163 // static const double _min = 0.000000001;
162164
163 /// Arrays containing calibration values for every channel in the 4 banks of the 16 boards.165 /// Arrays containing calibration values for every channel in the 4 banks of the 16 boards.
164166
=== modified file 'src/common_py/ConfigurationDefaults.py'
--- src/common_py/ConfigurationDefaults.py 2017-12-06 15:50:26 +0000
+++ src/common_py/ConfigurationDefaults.py 2017-12-11 22:51:03 +0000
@@ -263,6 +263,7 @@
263SciFiKunoSumT1S5 = 320.0 # Sum of channel #s in 3 planes if they form a spoint for T1 S5263SciFiKunoSumT1S5 = 320.0 # Sum of channel #s in 3 planes if they form a spoint for T1 S5
264SciFiKunoTolerance = 3.0 # Kuno conjecture tolerance264SciFiKunoTolerance = 3.0 # Kuno conjecture tolerance
265SciFiDigitizationNPECut = 2.0265SciFiDigitizationNPECut = 2.0
266SciFiDigitizationADCNoiseCut = False
266SciFiMappingFileName = "scifi_mapping.txt"267SciFiMappingFileName = "scifi_mapping.txt"
267SciFiCalibrationFileName = "scifi_calibration.txt"268SciFiCalibrationFileName = "scifi_calibration.txt"
268SciFiBadChannelsFileName = "scifi_bad_channels.txt"269SciFiBadChannelsFileName = "scifi_bad_channels.txt"
269270
=== modified file 'src/map/MapCppTrackerDigits/MapCppTrackerDigits.cc'
--- src/map/MapCppTrackerDigits/MapCppTrackerDigits.cc 2015-07-03 18:30:17 +0000
+++ src/map/MapCppTrackerDigits/MapCppTrackerDigits.cc 2017-12-11 22:51:03 +0000
@@ -50,11 +50,13 @@
50 std::string map_file = (*json)["SciFiMappingFileName"].asString();50 std::string map_file = (*json)["SciFiMappingFileName"].asString();
51 std::string calib_file = (*json)["SciFiCalibrationFileName"].asString();51 std::string calib_file = (*json)["SciFiCalibrationFileName"].asString();
52 std::string bad_channels_file = (*json)["SciFiBadChannelsFileName"].asString();52 std::string bad_channels_file = (*json)["SciFiBadChannelsFileName"].asString();
53 bool adc_cut = (*json)["SciFiDigitizationADCNoiseCut"].asBool();
53 std::cout << "INFO: MapCppTrackerDigits: Map file: " << map_file54 std::cout << "INFO: MapCppTrackerDigits: Map file: " << map_file
54 << ". Calib file: " << calib_file << ". NPE cut: " << npe_cut55 << ". Calib file: " << calib_file << ". NPE cut: " << npe_cut
55 << ". Bad Chan file: " << bad_channels_file << "\n";56 << ". Bad Chan file: " << bad_channels_file << "\n";
56 real = new RealDataDigitization();57 real = new RealDataDigitization();
57 real->initialise(npe_cut, map_file.c_str(), calib_file.c_str(), bad_channels_file.c_str());58 real->initialise(npe_cut, adc_cut, map_file.c_str(),
59 calib_file.c_str(), bad_channels_file.c_str());
58}60}
5961
60void MapCppTrackerDigits::_death() {}62void MapCppTrackerDigits::_death() {}

Subscribers

People subscribed via source and target branches