16#ifndef PIXELDIGITIZATION_EFIELDINTERPOLATOR_H
17#define PIXELDIGITIZATION_EFIELDINTERPOLATOR_H
41 StatusCode
loadTCADlist(
const std::string& TCADfileListToLoad);
45 virtual StatusCode
finalize()
override;
48 const std::string
loadTCADfiles(
const std::string& targetList =
"");
52 double estimateEfield(std::vector<double> vvol,
const std::vector<double>& vflu,
const std::vector<std::vector<double> >& vfluvvol,
53 double aimFlu,
double aimVol,
const std::string& prepend =
"",
bool debug =
false);
55 const std::vector<std::vector<double> > & vfluvvol,
double aimFlu,
double aimVol,
59 TH1D*
getEfield(
double aimFluence,
double aimVoltage);
61 static void scaleIntegralTo(TH1* hin,
double aimInt,
int first = 1,
int last = -1);
62 void reliabilityCheck(
double aimFluence,
const std::vector<double>& fluences,
double aimVoltage,
63 const std::vector<double>& voltages);
68 this,
"initialized",
false,
"Flag whether already initalized"
73 this,
"useSpline",
true,
"Flag whether to use cubic splines for interpolation"
78 this,
"sensorDepth", 200,
"Depth of E fields in sensors in um"
84 std::vector<std::vector<TString> >
list_files(
const TString& fileList_TCADsamples);
85 static double extrapolateLinear(
double x1,
double y1,
double x2,
double y2,
double xaim);
86 int fillXYvectors(
const std::vector<double> &vLoop,
int ifix,
const std::vector<std::vector<double> > & v2vsv1,
87 std::vector<double>& xx, std::vector<double>& yy,
bool regularOrder =
true);
90 {
return(vval.front() <= aimval && aimval <= vval.back());};
92 {
return(vval->front() <= aimval && aimval <= vval->back());};
96 void saveTGraph(std::vector<double> vvol, std::vector<double> vflu, std::vector<std::vector<double> > vfluvvol,
97 double aimFlu,
double aimVol,
const std::string& prepend,
bool skipNegative =
true);
Gaudi::Property< bool > m_initialized
interpolationMethod m_efieldOrigin
virtual StatusCode finalize() override
Gaudi::Property< int > m_sensorDepth
EfieldInterpolator(const std::string &type, const std::string &name, const IInterface *parent)
TH1D * loadEfieldFromDat(const std::string &fname, bool fillEdges=true)
virtual StatusCode initialize() override
bool initializeFromFile(const std::string &finpath)
std::vector< std::vector< TString > > list_files(const TString &fileList_TCADsamples)
const std::string createInterpolationFromTCADtree(const std::string &fTCAD)
static double relativeDistance(double x1, double x2)
void saveTGraph(std::vector< double > vvol, std::vector< double > vflu, std::vector< std::vector< double > > vfluvvol, double aimFlu, double aimVol, const std::string &prepend, bool skipNegative=true)
bool initializeFromDirectory(const std::string &fpath)
static double extrapolateLinear(double x1, double y1, double x2, double y2, double xaim)
StatusCode loadTCADlist(const std::string &TCADfileListToLoad)
virtual ~EfieldInterpolator()
const std::string loadTCADfiles(const std::string &targetList="")
double estimateEfield(std::vector< double > vvol, const std::vector< double > &vflu, const std::vector< std::vector< double > > &vfluvvol, double aimFlu, double aimVol, const std::string &prepend="", bool debug=false)
int fillXYvectors(const std::vector< double > &vLoop, int ifix, const std::vector< std::vector< double > > &v2vsv1, std::vector< double > &xx, std::vector< double > &yy, bool regularOrder=true)
static void scaleIntegralTo(TH1 *hin, double aimInt, int first=1, int last=-1)
void fillEdgeValues(TH1D *hin)
TH1D * getEfield(double aimFluence, double aimVoltage)
void reliabilityCheck(double aimFluence, const std::vector< double > &fluences, double aimVoltage, const std::vector< double > &voltages)
TH1D * createEfieldProfile(double aimFluence, double aimVoltage)
bool isInterpolation(const std::vector< double > &vval, double aimval)
Gaudi::Property< bool > m_useSpline
bool isInterpolation(std::vector< double > *vval, double aimval)
double estimateEfieldInvDistance(const std::vector< double > &vvol, const std::vector< double > &vflu, const std::vector< std::vector< double > > &vfluvvol, double aimFlu, double aimVol, double measure=1.)
double estimateEfieldLinear(double aimVoltage)