|
59 | 59 | #include "lardataobj/RecoBase/PFParticleMetadata.h" |
60 | 60 | #include "sbnobj/Common/Reco/TPCPMTBarycenterMatch.h" |
61 | 61 |
|
| 62 | +// Calibration database includes |
| 63 | +#include "sbndcode/Calibration/PDSDatabaseInterface/PMTCalibrationDatabase.h" |
| 64 | +#include "sbndcode/Calibration/PDSDatabaseInterface/IPMTCalibrationDatabaseService.h" |
| 65 | + |
62 | 66 | //ROOT includes |
63 | 67 | #include <Eigen/Dense> |
64 | 68 | #include <vector> |
@@ -231,7 +235,6 @@ class TPCPMTBarycenterMatchProducer : public art::EDProducer { |
231 | 235 | bool fCollectionOnly; ///< Only use TPC spacepoints from the collection plane |
232 | 236 | double fDistanceCandidateFlashes; ///< Maximum distance between candidate flashes to be considered for matching (cm) |
233 | 237 | std::vector<double> fCalAreaConst; /// Calibration area constants for wire plane |
234 | | - std::vector<int> fSkipChannelList; |
235 | 238 | double fOpDetCoVUVEff; // Efficiencies for PMT detection (Coated PMT VUV) |
236 | 239 | double fOpDetCoVISEff; // Efficiencies for PMT detection (Coated PMT VIS) |
237 | 240 | double fOpDetUncoVISEff; // Efficiencies for PMT detection (Uncoated PMT VIS) |
@@ -294,6 +297,9 @@ class TPCPMTBarycenterMatchProducer : public art::EDProducer { |
294 | 297 | fhicl::ParameterSet _vis_params; |
295 | 298 | std::shared_ptr<phot::OpticalPath> _optical_path_tool; |
296 | 299 |
|
| 300 | + sbndDB::PMTCalibrationDatabase const* fPMTCalibrationDatabaseService; |
| 301 | + |
| 302 | + |
297 | 303 | }; |
298 | 304 |
|
299 | 305 |
|
@@ -391,6 +397,9 @@ TPCPMTBarycenterMatchProducer::TPCPMTBarycenterMatchProducer(fhicl::ParameterSet |
391 | 397 | _vis_params = p.get<fhicl::ParameterSet>("VIVHits"); |
392 | 398 | _optical_path_tool = std::shared_ptr<phot::OpticalPath>(art::make_tool<phot::OpticalPath>(p.get<fhicl::ParameterSet>("OpticalPathTool"))); |
393 | 399 | _semi_model = std::make_unique<phot::SemiAnalyticalModel>(_vuv_params, _vis_params, _optical_path_tool, true, false); |
| 400 | + |
| 401 | + //Load PMT Calibration Database |
| 402 | + fPMTCalibrationDatabaseService = lar::providerFrom<sbndDB::IPMTCalibrationDatabaseService const>(); |
394 | 403 | } |
395 | 404 |
|
396 | 405 | void TPCPMTBarycenterMatchProducer::produce(art::Event& e) |
@@ -892,7 +901,7 @@ double TPCPMTBarycenterMatchProducer::GetFlashLight(double flash_pe, std::vector |
892 | 901 | double tot_visibility=0; |
893 | 902 |
|
894 | 903 | for(size_t ch=0; ch<dir_visibility.size(); ch++){ |
895 | | - if (std::find(fSkipChannelList.begin(), fSkipChannelList.end(), ch) != fSkipChannelList.end()) continue; |
| 904 | + if(!fPMTCalibrationDatabaseService->getReconstructChannel(ch)) continue; // Skip channels not reconstructed |
896 | 905 | if(fOpDetType[ch]==0) tot_visibility += fOpDetCoVUVEff*dir_visibility[ch] + fOpDetCoVISEff*ref_visibility[ch]; |
897 | 906 | else if(fOpDetType[ch]==1) tot_visibility += fOpDetUncoVISEff*ref_visibility[ch]; |
898 | 907 | else continue; // skip other types |
|
0 commit comments