Skip to content

Commit 700f6ec

Browse files
Add off channel attribute for digitalization
1 parent 6c9a9fb commit 700f6ec

3 files changed

Lines changed: 14 additions & 1 deletion

File tree

sbndcode/Calibration/PDSDatabaseInterface/PMTCalibrationDatabase.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ namespace sbndDB {
2525
virtual int getBreakoutBox(unsigned int channelID) const = 0;
2626
virtual int getCAENDigitizer(unsigned int channelID) const = 0;
2727
virtual int getCAENDigitizerChannel(unsigned int channelID) const = 0;
28+
virtual bool getOnPMT(unsigned int channelID) const = 0;
2829
virtual bool getReconstructChannel(unsigned int channelID) const = 0;
2930
virtual double getTotalTransitTime(unsigned int channelID) const = 0;
3031
virtual double getCosmicTimeCorrection(unsigned int channelID) const = 0;

sbndcode/Calibration/PDSDatabaseInterface/PMTCalibrationDatabaseProvider.cxx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,14 @@ void sbndDB::PMTCalibrationDatabaseProvider::ReadPMTCalibration(uint32_t run)
114114
<< "Encountered error (code " << error
115115
<< ") while trying to access 'caen_digitizer_channel' on table " << dbname << "\n";
116116
fPMTCalibrationData[channel].caenDigitizerChannel = static_cast<int>(_caen_digitizer_channel);
117+
// Read on PMT
118+
bool _on_pmt = false;
119+
error = db.GetNamedChannelData(channel, "on_pmt", _on_pmt);
120+
if (error)
121+
throw cet::exception("PMTTimingCorrectionsProvider")
122+
<< "Encountered error (code " << error
123+
<< ") while trying to access 'on_pmt' on table " << dbname << "\n";
124+
fPMTCalibrationData[channel].onPMT = _on_pmt;
117125

118126
// Read reconstruct channel
119127
bool _reconstruct_channel = false;

sbndcode/Calibration/PDSDatabaseInterface/PMTCalibrationDatabaseProvider.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ class sbndDB::PMTCalibrationDatabaseProvider : public PMTCalibrationDatabase {
5050
int getCAENDigitizerChannel( unsigned int channelID ) const override {
5151
return getChannelCorrOrDefault(channelID).caenDigitizerChannel;
5252
};
53+
bool getOnPMT(unsigned int channelID) const override {
54+
return getChannelCorrOrDefault(channelID).onPMT;
55+
};
5356
bool getReconstructChannel(unsigned int channelID) const override {
5457
return getChannelCorrOrDefault(channelID).reconstructChannel;
5558
};
@@ -95,6 +98,7 @@ class sbndDB::PMTCalibrationDatabaseProvider : public PMTCalibrationDatabase {
9598
size_t breakoutBox=0;
9699
size_t caenDigitizer=0;
97100
size_t caenDigitizerChannel=0;
101+
bool onPMT=true;
98102
bool reconstructChannel=false;
99103
double totalTransitTime=0.;
100104
double cosmicTimeCorrection=0.;
@@ -107,7 +111,7 @@ class sbndDB::PMTCalibrationDatabaseProvider : public PMTCalibrationDatabase {
107111
std::vector<double> ser={};
108112
};
109113

110-
const PMTCalibrationDB CorrectionDefaults = {0, 0, 0, 0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, {}};
114+
const PMTCalibrationDB CorrectionDefaults = {0, 0, 0, true, false, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, {}};
111115
/// Map of corrections by channel
112116
std::map<unsigned int, PMTCalibrationDB> fPMTCalibrationData;
113117

0 commit comments

Comments
 (0)