Skip to content

Commit 00e23d5

Browse files
Cleanup
1 parent 7a520f6 commit 00e23d5

4 files changed

Lines changed: 13 additions & 30 deletions

File tree

sbndcode/DatabaseInterface/IPMTCalibrationDatabaseService.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ DECLARE_ART_SERVICE_INTERFACE(sbndDB::IPMTCalibrationDatabaseService, SHARED)
2727

2828
// -----------------------------------------------------------------------------
2929

30-
#endif // ICARUSCODE_DATABASEINTERFACE_IPMTCALIBRATIONDATABASESERVICE_H
30+
#endif

sbndcode/DatabaseInterface/PMTCalibrationDatabaseProvider.cxx

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,13 @@ sbndDB::PMTCalibrationDatabaseProvider::PMTCalibrationDatabaseProvider(
3030
, fLogCategory{pset.get<std::string>("LogCategory", "PMTTimingCorrection")}
3131
{
3232
fhicl::ParameterSet const tags{pset.get<fhicl::ParameterSet>("CorrectionTags")};
33-
fCablesTag = tags.get<std::string>("CablesTag");
33+
fPMTCalibrationDatabaseTag = tags.get<std::string>("PMTCalibrationDatabaseTag");
3434
fDatabaseTimeStamp = tags.get<long>("DatabaseTimeStamp");
3535
fTableName = tags.get<std::string>("TableName");
36-
fVariabletoread = tags.get<std::string>("VariableToRead");
3736
fSERLength = tags.get<size_t>("SERLength");
3837
if (fVerbose)
3938
mf::LogInfo(fLogCategory) << "Database tags for timing corrections:\n"
40-
<< "Cables corrections " << fCablesTag << "\n";
39+
<< "Cables corrections " << fPMTCalibrationDatabaseTag << "\n";
4140
}
4241

4342
// -------------------------------------------------------------------------------
@@ -47,7 +46,7 @@ uint64_t sbndDB::PMTCalibrationDatabaseProvider::RunToDatabaseTimestamp(uint32_t
4746

4847
// Run number to timestamp used in the db
4948
// DBFolder.h only takes 19 digit (= timestamp in nano second),
50-
// but ICARUS tables are currently using run numbers
49+
// but SBND tables are currently using run numbers
5150
// Step 1) Add 1000000000 to the run number; e.g., run XXXXX -> 10000XXXXX
5251
// Step 2) Multiply 1000000000
5352
uint64_t runNum = uint64_t(run);
@@ -65,14 +64,10 @@ uint64_t sbndDB::PMTCalibrationDatabaseProvider::RunToDatabaseTimestamp(uint32_t
6564
/// Function to look up the calibration database at the table holding the pmt hardware cables corrections
6665
void sbndDB::PMTCalibrationDatabaseProvider::ReadPMTCalibration(uint32_t run)
6766
{
68-
69-
// pmt_cables_delay: delays of the cables relative to trigger
70-
// and reset distribution
71-
7267
const std::string dbname(fTableName);
73-
lariov::DBFolder db(dbname, "", "", fCablesTag, true, false);
68+
lariov::DBFolder db(dbname, "", "", fPMTCalibrationDatabaseTag, true, false);
7469

75-
bool ret = db.UpdateData(fDatabaseTimeStamp); // select table based on run number
70+
bool ret = db.UpdateData(fDatabaseTimeStamp); // select table based on timestamp (this is temporary, once we generate db based on run numbers this should be changed)
7671
mf::LogDebug(fLogCategory) << dbname + " corrections" << (ret ? "" : " not")
7772
<< " updated for run " << run;
7873
mf::LogTrace(fLogCategory)

sbndcode/DatabaseInterface/PMTCalibrationDatabaseProvider.h

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,6 @@ namespace sbndDB{ class PMTCalibrationDatabaseProvider; }
3131
* @brief
3232
*
3333
* This module reads the PMT timing corrections from the database.
34-
* Corrections are picked according to the run number being processed.
35-
*
36-
* All time corrections are offsets (in microseconds) that need to be _added_ to the uncorrected time.
37-
*
38-
* Configuration parameters
39-
* -------------------------
40-
* * `CorrectionTags`: tags to select the correction versions:
41-
* * `CablesTag` (default: `v1r0`): correction for cable delay.
42-
* * `LaserTag` (default: `v1r0`): first order PMT time correction, from laser data.
43-
* * `CosmicsTag` (default: `v1r0`): second order PMT time correction, from cosmic rays.
44-
* * `Verbose` (default: `false`): Print-out the corrections read from the database.
45-
* * `LogCategory` (default: `PMTTimingCorrection")
4634
*
4735
*/
4836
class sbndDB::PMTCalibrationDatabaseProvider : public PMTCalibrationDatabase {
@@ -51,10 +39,8 @@ class sbndDB::PMTCalibrationDatabaseProvider : public PMTCalibrationDatabase {
5139

5240
PMTCalibrationDatabaseProvider(const fhicl::ParameterSet& pset);
5341

54-
/// Read timing corrections from the database
5542
void readPMTCalibrationDatabase(const art::Run& run);
5643

57-
/// Get time delay on the trigger line
5844
int getBreakoutBox( unsigned int channelID ) const override {
5945
return getChannelCorrOrDefault(channelID).breakoutBox;
6046
};
@@ -83,12 +69,9 @@ class sbndDB::PMTCalibrationDatabaseProvider : public PMTCalibrationDatabase {
8369

8470
bool fVerbose = false; ///< Whether to print the configuration we read.
8571
std::string fLogCategory; ///< Category tag for messages.
86-
std::string fCablesTag; ///< Tag for cable corrections database.
72+
std::string fPMTCalibrationDatabaseTag;
8773
long fDatabaseTimeStamp;
88-
std::string fLaserTag; ///< Tag for laser corrections database.
89-
std::string fCosmicsTag; ///< Tag for cosmics corrections database.
9074
std::string fTableName;
91-
std::string fVariabletoread;
9275
size_t fSERLength;
9376

9477
/// Structure for single channel corrections

sbndcode/DatabaseInterface/database_config.fcl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@ BEGIN_PROLOG
22

33
sbnd_pmttimingservice : {
44
service_provider: PMTTimingCorrectionService
5-
CorrectionTags: {CablesTag: "v1r0"}
5+
CorrectionTags: {
6+
PMTCalibrationDatabaseTag: "v1r1"
7+
DatabaseTimeStamp: 1740739388000000000
8+
TableName: "pds_calibration"
9+
SERLength: 550
10+
}
611
Verbose: false
712
}
813

0 commit comments

Comments
 (0)