16 #include "fhiclcpp/types/Atom.h"
17 #include "art/Utilities/ToolMacros.h"
18 #include "art/Utilities/make_tool.h"
19 #include "art/Utilities/ToolConfigTable.h"
20 #include "art/Framework/Services/Registry/ServiceHandle.h"
45 fhicl::Comment(
"Filepath to the calibration ROOT file")
50 fhicl::Comment(
"Group velocity for VUV photons")
55 fhicl::Comment(
"Group velocity for VIS photons")
101 : fCalibrationFile { config().CalibrationFile() },
102 fVGroupVUV { config().VGroupVUV() },
103 fVGroupVIS { config().VGroupVIS() }
108 cet::search_path sp(
"FW_SEARCH_PATH");
109 if ( !sp.find_file(fCalibrationFile, file_name) )
110 throw cet::exception(
"DriftEstimatorPMTRatio") <<
"Calibration file " <<
111 fCalibrationFile <<
" not found in FW_SEARCH_PATH\n";
113 TFile* input_file = TFile::Open(file_name.c_str(),
"READ");
114 TProfile * hProf_Calibration = (TProfile*)input_file->Get(
"PMTRatioCalibrationProfile");
117 fNCalBins = hProf_Calibration->GetNbinsX();
118 for (
int ix=1; ix<=fNCalBins; ix++){
119 fPMTRatioCal.push_back( hProf_Calibration->GetBinCenter(ix) );
120 fDriftCal.push_back( hProf_Calibration->GetBinContent(ix) );
122 fPMTRatio_MinVal = hProf_Calibration->GetBinCenter(1);
123 fPMTRatio_MaxVal = hProf_Calibration->GetBinCenter(fNCalBins);
130 fVISLightPropTime = fDriftDistance/fVGroupVIS;
131 fKinkDistance = 0.5*fDriftDistance*(1-fVGroupVUV/fVGroupVIS);
133 fVGroupVUV_I = 1./fVGroupVUV;
138 double coatedPE=0, uncoatedPE=0;
140 for(
size_t oc=0; oc<PE_v.size(); oc++){
142 else if(
fPDSMap.
pdType(oc)==
"pmt_uncoated" ) uncoatedPE+=PE_v[oc];
147 pmtratio = 4*uncoatedPE/coatedPE;
149 double drift_distance;
157 return drift_distance;
Utilities related to art service access.
fhicl::Atom< double > VGroupVIS
double PEToPropagationTime(std::vector< double > PE_v)
double GetPropagationTime(double drift) override
std::vector< double > fPMTRatioCal
fhicl::Atom< std::string > CalibrationFile
then echo fcl sbnd_project sbnd_project sbnd_project sbnd_project production production file_name
BEGIN_PROLOG vertical distance to the surface Name
Description of geometry of one entire detector.
double DriftDistance() const
double Interpolate(double val)
double GetDriftPosition(std::vector< double > PE_v) override
DriftEstimatorPMTRatio(art::ToolConfigTable< Config > const &config)
opdet::sbndPDMapAlg fPDSMap
TPCGeo const & TPC(unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified TPC.
fhicl::Atom< double > VGroupVUV
std::string fCalibrationFile
std::string pdType(size_t ch) const override
art framework interface to geometry description
std::vector< double > fDriftCal