All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
lightana::DriftEstimatorPMTRatio Class Reference
Inheritance diagram for lightana::DriftEstimatorPMTRatio:
lightana::DriftEstimatorBase

Classes

struct  Config
 

Public Member Functions

 DriftEstimatorPMTRatio (art::ToolConfigTable< Config > const &config)
 
double GetDriftPosition (std::vector< double > PE_v) override
 
double GetPropagationTime (double drift) override
 
double PEToPropagationTime (std::vector< double > PE_v)
 

Private Member Functions

double Interpolate (double val)
 
- Private Member Functions inherited from lightana::DriftEstimatorBase
virtual ~DriftEstimatorBase () noexcept=default
 

Private Attributes

std::string fCalibrationFile
 
double fVGroupVUV
 
double fVGroupVIS
 
double fVGroupVUV_I
 
double fDriftDistance
 
double fVISLightPropTime
 
double fKinkDistance
 
std::vector< double > fPMTRatioCal
 
std::vector< double > fDriftCal
 
int fNCalBins
 
double fPMTRatio_MinVal
 
double fPMTRatio_MaxVal
 
opdet::sbndPDMapAlg fPDSMap
 

Detailed Description

Definition at line 36 of file DriftEstimatorPMTRatio_tool.cc.

Constructor & Destructor Documentation

lightana::DriftEstimatorPMTRatio::DriftEstimatorPMTRatio ( art::ToolConfigTable< Config > const &  config)
explicit

Definition at line 100 of file DriftEstimatorPMTRatio_tool.cc.

101  : fCalibrationFile { config().CalibrationFile() },
102  fVGroupVUV { config().VGroupVUV() },
103  fVGroupVIS { config().VGroupVIS() }
104  {
105 
106  // Open input file
107  std::string file_name;
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";
112 
113  TFile* input_file = TFile::Open(file_name.c_str(), "READ");
114  TProfile * hProf_Calibration = (TProfile*)input_file->Get("PMTRatioCalibrationProfile");
115 
116  //Fill calibration variables
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) );
121  }
122  fPMTRatio_MinVal = hProf_Calibration->GetBinCenter(1);
123  fPMTRatio_MaxVal = hProf_Calibration->GetBinCenter(fNCalBins);
124 
125  input_file->Close();
126 
127  geo::GeometryCore const& geom = *(lar::providerFrom<geo::Geometry>());
128 
129  fDriftDistance = geom.TPC(0.0).DriftDistance();
132 
134  }
then echo fcl sbnd_project sbnd_project sbnd_project sbnd_project production production file_name
Description of geometry of one entire detector.
double DriftDistance() const
Definition: TPCGeo.h:155
TPCGeo const & TPC(unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified TPC.

Member Function Documentation

double lightana::DriftEstimatorPMTRatio::GetDriftPosition ( std::vector< double >  PE_v)
overridevirtual

Implements lightana::DriftEstimatorBase.

Definition at line 136 of file DriftEstimatorPMTRatio_tool.cc.

136  {
137 
138  double coatedPE=0, uncoatedPE=0;
139 
140  for(size_t oc=0; oc<PE_v.size(); oc++){
141  if( fPDSMap.pdType(oc)=="pmt_coated" ) coatedPE+=PE_v[oc];
142  else if( fPDSMap.pdType(oc)=="pmt_uncoated" ) uncoatedPE+=PE_v[oc];
143  }
144 
145  double pmtratio=1.;
146  if(coatedPE!=0)
147  pmtratio = 4*uncoatedPE/coatedPE;
148 
149  double drift_distance;
150  if(pmtratio<=fPMTRatioCal[0])
151  drift_distance=fDriftCal[0];
152  else if(pmtratio>=fPMTRatioCal[fNCalBins-1])
153  drift_distance=fDriftCal[fNCalBins-1];
154  else
155  drift_distance=Interpolate(pmtratio);
156 
157  return drift_distance;
158  }
std::string pdType(size_t ch) const override
double lightana::DriftEstimatorPMTRatio::GetPropagationTime ( double  drift)
overridevirtual

Implements lightana::DriftEstimatorBase.

Definition at line 160 of file DriftEstimatorPMTRatio_tool.cc.

160  {
161 
162  // drift is here the X coordinate
163  // cathode: x=0 cm, PDS: x=200 cm
164  if(std::abs(drift) > fKinkDistance)
165  return (fDriftDistance-std::abs(drift)) * fVGroupVUV_I ;
166  else
167  return std::abs(drift) * fVGroupVUV_I + fVISLightPropTime;
168  }
T abs(T value)
double lightana::DriftEstimatorPMTRatio::Interpolate ( double  val)
private

Definition at line 177 of file DriftEstimatorPMTRatio_tool.cc.

177  {
178 
179  size_t upix = std::upper_bound(fPMTRatioCal.begin(), fPMTRatioCal.end(), val)-fPMTRatioCal.begin();
180 
181  double slope = ( fDriftCal[upix]-fDriftCal[upix] ) / ( fPMTRatioCal[upix]-fPMTRatioCal[upix-1] );
182 
183  return fDriftCal[upix-1] + slope * ( val - fPMTRatioCal[upix-1] );
184  }
double lightana::DriftEstimatorPMTRatio::PEToPropagationTime ( std::vector< double >  PE_v)

Definition at line 170 of file DriftEstimatorPMTRatio_tool.cc.

170  {
171 
172  double _drift = GetDriftPosition(PE_v);
173 
174  return GetPropagationTime(_drift);
175  }
double GetPropagationTime(double drift) override
double GetDriftPosition(std::vector< double > PE_v) override

Member Data Documentation

std::string lightana::DriftEstimatorPMTRatio::fCalibrationFile
private

Definition at line 76 of file DriftEstimatorPMTRatio_tool.cc.

std::vector<double> lightana::DriftEstimatorPMTRatio::fDriftCal
private

Definition at line 90 of file DriftEstimatorPMTRatio_tool.cc.

double lightana::DriftEstimatorPMTRatio::fDriftDistance
private

Definition at line 84 of file DriftEstimatorPMTRatio_tool.cc.

double lightana::DriftEstimatorPMTRatio::fKinkDistance
private

Definition at line 86 of file DriftEstimatorPMTRatio_tool.cc.

int lightana::DriftEstimatorPMTRatio::fNCalBins
private

Definition at line 91 of file DriftEstimatorPMTRatio_tool.cc.

opdet::sbndPDMapAlg lightana::DriftEstimatorPMTRatio::fPDSMap
private

Definition at line 96 of file DriftEstimatorPMTRatio_tool.cc.

double lightana::DriftEstimatorPMTRatio::fPMTRatio_MaxVal
private

Definition at line 93 of file DriftEstimatorPMTRatio_tool.cc.

double lightana::DriftEstimatorPMTRatio::fPMTRatio_MinVal
private

Definition at line 92 of file DriftEstimatorPMTRatio_tool.cc.

std::vector<double> lightana::DriftEstimatorPMTRatio::fPMTRatioCal
private

Definition at line 89 of file DriftEstimatorPMTRatio_tool.cc.

double lightana::DriftEstimatorPMTRatio::fVGroupVIS
private

Definition at line 80 of file DriftEstimatorPMTRatio_tool.cc.

double lightana::DriftEstimatorPMTRatio::fVGroupVUV
private

Definition at line 79 of file DriftEstimatorPMTRatio_tool.cc.

double lightana::DriftEstimatorPMTRatio::fVGroupVUV_I
private

Definition at line 81 of file DriftEstimatorPMTRatio_tool.cc.

double lightana::DriftEstimatorPMTRatio::fVISLightPropTime
private

Definition at line 85 of file DriftEstimatorPMTRatio_tool.cc.


The documentation for this class was generated from the following file: