Skip to content

Commit 8ad40bc

Browse files
Merge branch 'develop' into Bugfix/linyan-keepdetsim
2 parents 4534429 + a1054f0 commit 8ad40bc

15 files changed

Lines changed: 112 additions & 6 deletions

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
cmake_minimum_required(VERSION 3.20 FATAL_ERROR)
1717

18-
set(${PROJECT_NAME}_CMAKE_PROJECT_VERSION_STRING 10.06.03)
18+
set(${PROJECT_NAME}_CMAKE_PROJECT_VERSION_STRING 10.09.00)
1919
find_package(cetmodules REQUIRED)
2020
project(sbndcode LANGUAGES CXX)
2121

sbndcode/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ add_subdirectory(OpDetSim)
1616
add_subdirectory(OpDetReco)
1717
add_subdirectory(OpDetAnalyzer)
1818
add_subdirectory(OpT0Finder)
19+
add_subdirectory(OpPathTool)
1920
#add_subdirectory(PDS)
2021
#add_subdirectory(CosmicId)
2122
add_subdirectory(ShowerAna)

sbndcode/Calibration/PDSDatabaseInterface/PMTCalibrationDatabase.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,11 @@ 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 getReconstructChannel(unsigned int channelID) const = 0;
2829
virtual double getTotalTransitTime(unsigned int channelID) const = 0;
30+
virtual double getCosmicTimeCorrection(unsigned int channelID) const = 0;
2931
virtual double getSPEAmplitude(unsigned int channelID) const = 0;
32+
virtual double getSPEAmplitudeStd(unsigned int channelID) const = 0;
3033
virtual double getGaussFilterPower(unsigned int channelID) const = 0;
3134
virtual double getGaussFilterWC(unsigned int channelID) const = 0;
3235
virtual std::vector<double> getSER(unsigned int channelID) const = 0;

sbndcode/Calibration/PDSDatabaseInterface/PMTCalibrationDatabaseProvider.cxx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,15 @@ void sbndDB::PMTCalibrationDatabaseProvider::ReadPMTCalibration(uint32_t run)
115115
<< ") while trying to access 'caen_digitizer_channel' on table " << dbname << "\n";
116116
fPMTCalibrationData[channel].caenDigitizerChannel = static_cast<int>(_caen_digitizer_channel);
117117

118+
// Read reconstruct channel
119+
bool _reconstruct_channel = false;
120+
error = db.GetNamedChannelData(channel, "reconstruct_channel", _reconstruct_channel);
121+
if (error)
122+
throw cet::exception("PMTTimingCorrectionsProvider")
123+
<< "Encountered error (code " << error
124+
<< ") while trying to access 'reconstruct_channel' on table " << dbname << "\n";
125+
fPMTCalibrationData[channel].reconstructChannel = _reconstruct_channel;
126+
118127
// Read total transit time
119128
double _total_transit_time = 0.;
120129
error = db.GetNamedChannelData(channel, "total_transit_time", _total_transit_time);
@@ -124,6 +133,15 @@ void sbndDB::PMTCalibrationDatabaseProvider::ReadPMTCalibration(uint32_t run)
124133
<< ") while trying to access 'total_transit_time' on table " << dbname << "\n";
125134
fPMTCalibrationData[channel].totalTransitTime = _total_transit_time;
126135

136+
// Read cosmic timing correction
137+
double _cosmic_timing_correction = 0.;
138+
error = db.GetNamedChannelData(channel, "cosmic_timing_correction", _cosmic_timing_correction);
139+
if (error)
140+
throw cet::exception("PMTTimingCorrectionsProvider")
141+
<< "Encountered error (code " << error
142+
<< ") while trying to access 'cosmic_timing_correction' on table " << dbname << "\n";
143+
fPMTCalibrationData[channel].cosmicTimeCorrection = _cosmic_timing_correction;
144+
127145
// Read spe amplitude
128146
double _spe_amplitude = 0.;
129147
error = db.GetNamedChannelData(channel, "spe_amp", _spe_amplitude);
@@ -133,6 +151,15 @@ void sbndDB::PMTCalibrationDatabaseProvider::ReadPMTCalibration(uint32_t run)
133151
<< ") while trying to access 'spe_amplitude' on table " << dbname << "\n";
134152
fPMTCalibrationData[channel].spe_amplitude = _spe_amplitude;
135153

154+
// Read spe amplitude std
155+
double _spe_amplitude_std = 0.;
156+
error = db.GetNamedChannelData(channel, "spe_amp_std", _spe_amplitude_std);
157+
if (error)
158+
throw cet::exception("PMTTimingCorrectionsProvider")
159+
<< "Encountered error (code " << error
160+
<< ") while trying to access 'spe_amplitude_std' on table " << dbname << "\n";
161+
fPMTCalibrationData[channel].spe_amplitude_std = _spe_amplitude_std;
162+
136163
// Read gauss filter power
137164
double _gauss_w_wc_power = 0;
138165
error = db.GetNamedChannelData(channel, "gauss_w_wc_power", _gauss_w_wc_power);

sbndcode/Calibration/PDSDatabaseInterface/PMTCalibrationDatabaseProvider.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,21 @@ class sbndDB::PMTCalibrationDatabaseProvider : public PMTCalibrationDatabase {
5050
int getCAENDigitizerChannel( unsigned int channelID ) const override {
5151
return getChannelCorrOrDefault(channelID).caenDigitizerChannel;
5252
};
53+
bool getReconstructChannel(unsigned int channelID) const override {
54+
return getChannelCorrOrDefault(channelID).reconstructChannel;
55+
};
5356
double getTotalTransitTime( unsigned int channelID ) const override {
5457
return getChannelCorrOrDefault(channelID).totalTransitTime;
5558
};
59+
double getCosmicTimeCorrection(unsigned int channelID) const override {
60+
return getChannelCorrOrDefault(channelID).cosmicTimeCorrection;
61+
};
5662
double getSPEAmplitude( unsigned int channelID ) const override {
5763
return getChannelCorrOrDefault(channelID).spe_amplitude;
5864
};
65+
double getSPEAmplitudeStd( unsigned int channelID ) const override {
66+
return getChannelCorrOrDefault(channelID).spe_amplitude_std;
67+
};
5968
double getGaussFilterPower( unsigned int channelID ) const override {
6069
return getChannelCorrOrDefault(channelID).gauss_wc_power;
6170
};
@@ -80,8 +89,11 @@ class sbndDB::PMTCalibrationDatabaseProvider : public PMTCalibrationDatabase {
8089
size_t breakoutBox=0;
8190
size_t caenDigitizer=0;
8291
size_t caenDigitizerChannel=0;
83-
size_t totalTransitTime=0;
92+
bool reconstructChannel=false;
93+
double totalTransitTime=0.;
94+
double cosmicTimeCorrection=0.;
8495
double spe_amplitude=0.;
96+
double spe_amplitude_std=0.;
8597
double gauss_wc_power=0.;
8698
double gauss_wc=0.;
8799
std::vector<double> ser={};

sbndcode/Calibration/PDSDatabaseInterface/pmtcalibrationdatabase_sbnd.fcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ sbnd_pmtcalibrationdatabaseservice : {
44
service_provider: "PMTCalibrationDatabaseService"
55
CorrectionTags: {
66
PMTCalibrationDatabaseTag: "v1r1"
7-
DatabaseTimeStamp: 1740739388000000000
7+
DatabaseTimeStamp: 1757601071000000000
88
TableName: "pds_calibration"
99
SERLength: 550
1010
}

sbndcode/LArSoftConfigurations/PDFastSim_sbnd.fcl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include "PDFastSimPVS.fcl"
33

44
#include "opticalsimparameterisations_sbnd.fcl"
5+
#include "sbndopticalpath_tool.fcl"
56

67
BEGIN_PROLOG
78

@@ -19,6 +20,8 @@ sbnd_pdfastsim_par.SimulationLabel: "ionandscint:priorSCE"
1920
# independently for the TPB-delay time and the emission (fast and slow) decay times.
2021
sbnd_pdfastsim_par.ScintTimeTool.SlowDecayTime: 1300.0
2122

23+
sbnd_pdfastsim_par.OpticalPathTool: @local::SBNDOpticalPath
24+
2225
# Direct (VUV)
2326
sbnd_pdfastsim_par.VUVTiming: @local::sbnd_vuv_timing_parameterization
2427
sbnd_pdfastsim_par.VUVHits: @local::sbnd_vuv_RS100cm_hits_parameterization

sbndcode/OpPathTool/CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
include (phot::OpticalPath)
2+
3+
cet_build_plugin(SBNDOpticalPath phot::OpticalPath
4+
LIBRARIES PRIVATE
5+
larsim::OpticalPath
6+
larcoreobj::geo_vectors
7+
)
8+
9+
install_headers()
10+
install_fhicl()
11+
install_source()
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// SBND optical path tool
2+
3+
#ifndef SBNDOpticalPath_H
4+
#define SBNDOpticalPath_H
5+
6+
#include "art/Utilities/ToolMacros.h"
7+
#include "larsim/PhotonPropagation/OpticalPathTools/OpticalPath.h"
8+
#include "larcoreobj/SimpleTypesAndConstants/geo_vectors.h"
9+
10+
#include <iostream>
11+
12+
namespace phot {
13+
class SBNDOpticalPath : public phot::OpticalPath {
14+
public:
15+
explicit SBNDOpticalPath(fhicl::ParameterSet const& ps) {};
16+
~SBNDOpticalPath() noexcept override = default;
17+
18+
const bool isOpDetVisible(geo::Point_t const& ScintPoint, geo::Point_t const& OpDetPoint) override {
19+
// special case for SBND
20+
// check x coordinate has same sign
21+
if ((ScintPoint.X() < 0.) != (OpDetPoint.X() < 0.)) return false;
22+
else return true;
23+
}
24+
};
25+
}
26+
27+
#endif
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#include "sbndcode/OpPathTool/SBNDOpticalPath.h"
2+
#include "art/Utilities/ToolMacros.h"
3+
4+
DEFINE_ART_CLASS_TOOL(phot::SBNDOpticalPath)

0 commit comments

Comments
 (0)