Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ sbnd::LightPropagationCorrection::LightPropagationCorrection(fhicl::ParameterSet
fOpDetX.push_back(pdCenter.X());
fOpDetY.push_back(pdCenter.Y());
fOpDetZ.push_back(pdCenter.Z());
if(fPDSMap.pdType(opch)=="pmt_coated") fOpDetType.push_back(0);
else if(fPDSMap.pdType(opch)=="pmt_uncoated") fOpDetType.push_back(1);
else if(fPDSMap.pdType(opch)=="xarapuca_vuv") fOpDetType.push_back(2);
else if(fPDSMap.pdType(opch)=="xarapuca_vis") fOpDetType.push_back(3);
else fOpDetType.push_back(-1);
Comment on lines +39 to +43
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of questions:

  1. Given this is only used in one place, is it worth having this vector? Could just have the if statements directly query the fPDSMap.pdType.
  2. If you are keeping the vector setup, is it worth defining the numbers as an enum in the header file?

}

auto const& tpc = art::ServiceHandle<geo::Geometry>()->TPC();
Expand Down Expand Up @@ -442,16 +447,17 @@ void sbnd::LightPropagationCorrection::GetPropagationTimeCorrectionPerChannel()
double dy = fSpacePointY[sp] - _opDetY;
double dz = fSpacePointZ[sp] - _opDetZ;
double distanceToOpDet = std::sqrt(dx*dx + dy*dy + dz*dz);
//double spToCathode = abs(fSpacePointX[sp]); // Distance from space point to cathode in mm
//double cathodeToOpDet = std::sqrt(_opDetX*_opDetX + dy*dy + dz*dz); // Distance from cathode to OpDet in mm
//float lightPropTimeVIS = spToCathode/fVGroupVUV + cathodeToOpDet/fVGroupVIS; // Speed

double cathodeToOpDet = std::sqrt(_opDetX*_opDetX + (dy/2)*(dy/2) + (dz/2)*(dz/2)); // Distance from cathode to OpDet in mm
double spToCathode = std::sqrt( fSpacePointX[sp]*fSpacePointX[sp] + (dy/2)*(dy/2) + (dz/2)*(dz/2)); // Distance from space point to cathode in mm

float lightPropTimeVIS = spToCathode/fVGroupVUV + cathodeToOpDet/fVGroupVIS; // Speed
float lightPropTimeVUV = distanceToOpDet / fVGroupVUV; // Speed of light in mm/ns for VUV
float lightPropTime = std::min(lightPropTimeVIS, lightPropTimeVUV);
float lightPropTime = 0;
if(fOpDetType[opdet]==0)
lightPropTime = std::min(lightPropTimeVIS, lightPropTimeVUV);
else if(fOpDetType[opdet]==1)
lightPropTime = lightPropTimeVIS;
else
continue;
float partPropTime = std::sqrt((fSpacePointX[sp]-fRecoVx)*(fSpacePointX[sp]-fRecoVx) + (fSpacePointY[sp]-fRecoVy)*(fSpacePointY[sp]-fRecoVy) + (fSpacePointZ[sp]-fRecoVz)*(fSpacePointZ[sp]-fRecoVz))/fSpeedOfLight;
float PropTime = lightPropTime + partPropTime;
if(PropTime < minPropTime) minPropTime = PropTime;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ private:


geo::WireReadoutGeom const& fWireReadout = art::ServiceHandle<geo::WireReadout>()->Get();

opdet::sbndPDMapAlg fPDSMap;
//Flash finder manager
::lightana::FlashFinderManager _mgr;
::lightana::FlashFinderManager _mgr_tpc0;
Expand All @@ -162,6 +162,7 @@ private:
std::vector<double> fOpDetX;
std::vector<double> fOpDetY;
std::vector<double> fOpDetZ;
std::vector<int> fOpDetType;

std::string fReco2Label;
std::string fOpT0FinderModuleLabel;
Expand Down