Skip to content

Commit 6c9a9fb

Browse files
Update calibration db to provide nonlinearity params
1 parent 012b13b commit 6c9a9fb

3 files changed

Lines changed: 26 additions & 2 deletions

File tree

sbndcode/Calibration/PDSDatabaseInterface/PMTCalibrationDatabase.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ namespace sbndDB {
3232
virtual double getSPEAmplitudeStd(unsigned int channelID) const = 0;
3333
virtual double getGaussFilterPower(unsigned int channelID) const = 0;
3434
virtual double getGaussFilterWC(unsigned int channelID) const = 0;
35+
virtual double getNonLineatiryPESat(unsigned int channelID) const = 0;
36+
virtual double getNonLineatiryAlpha(unsigned int channelID) const = 0;
3537
virtual std::vector<double> getSER(unsigned int channelID) const = 0;
3638
}; // end class
3739

sbndcode/Calibration/PDSDatabaseInterface/PMTCalibrationDatabaseProvider.cxx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,21 @@ void sbndDB::PMTCalibrationDatabaseProvider::ReadPMTCalibration(uint32_t run)
178178
<< dbname << "\n";
179179
fPMTCalibrationData[channel].gauss_wc = _gauss_wc;
180180

181+
double _nonlinearity_pesat = 0.;
182+
error = db.GetNamedChannelData(channel, "nonlinearity_pesat", _nonlinearity_pesat);
183+
if (error)
184+
throw cet::exception("PMTTimingCorrectionsProvider")
185+
<< "Encountered error (code " << error
186+
<< ") while trying to access 'nonlinearity_pesat' on table " << dbname << "\n";
187+
fPMTCalibrationData[channel].nonlinearity_pesat = _nonlinearity_pesat;
188+
double _nonlinearity_alpha = 0.;
189+
error = db.GetNamedChannelData(channel, "nonlinearity_alpha", _nonlinearity_alpha);
190+
if (error)
191+
throw cet::exception("PMTTimingCorrectionsProvider")
192+
<< "Encountered error (code " << error
193+
<< ") while trying to access 'nonlinearity_alpha' on table " << dbname << "\n";
194+
fPMTCalibrationData[channel].nonlinearity_alpha = _nonlinearity_alpha;
195+
181196
// Read SER
182197
std::vector<double> _ser;
183198
std::string name_base = "ser_vec_";

sbndcode/Calibration/PDSDatabaseInterface/PMTCalibrationDatabaseProvider.h

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@ class sbndDB::PMTCalibrationDatabaseProvider : public PMTCalibrationDatabase {
7171
double getGaussFilterWC( unsigned int channelID ) const override {
7272
return getChannelCorrOrDefault(channelID).gauss_wc;
7373
};
74+
double getNonLineatiryPESat( unsigned int channelID ) const override {
75+
return getChannelCorrOrDefault(channelID).nonlinearity_pesat;
76+
};
77+
double getNonLineatiryAlpha( unsigned int channelID ) const override {
78+
return getChannelCorrOrDefault(channelID).nonlinearity_alpha;
79+
};
7480
std::vector<double> getSER( unsigned int channelID ) const override {
7581
return getChannelCorrOrDefault(channelID).ser;
7682
};
@@ -96,11 +102,12 @@ class sbndDB::PMTCalibrationDatabaseProvider : public PMTCalibrationDatabase {
96102
double spe_amplitude_std=0.;
97103
double gauss_wc_power=0.;
98104
double gauss_wc=0.;
105+
double nonlinearity_pesat=0.;
106+
double nonlinearity_alpha=0.;
99107
std::vector<double> ser={};
100108
};
101109

102-
const PMTCalibrationDB CorrectionDefaults = {0, 0, 0, 0, 0.0, 0.0, 0.0, {}};
103-
110+
const PMTCalibrationDB CorrectionDefaults = {0, 0, 0, 0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, {}};
104111
/// Map of corrections by channel
105112
std::map<unsigned int, PMTCalibrationDB> fPMTCalibrationData;
106113

0 commit comments

Comments
 (0)