61 if(version==
"v1"||version==
"v2"||version==
"v3"||version==
"v3.1"||version==
"v4"||version==
"v5"||version==
"v5.1"||version==
"v6"){
75 double interpPart = 1;
77 typedef std::vector<Pt>::const_iterator it_t;
84 it_t itPrev = itNext; --itPrev;
87 const double w0 = itPrev->w;
const double y0 = itPrev->factor;
88 const double w1 = itNext->w;
const double y1 = itNext->factor;
90 interpPart = ((w1-
w)*y0+(w-w0)*
y1)/(w1-w0);
93 return expPart*edgePart*interpPart;
131 const int vldTime = 1;
135 fprintf(fConsts,
"%g,%g,%g,%g,%g,%g,%g,%g,%d,%d\n",
141 for(
int n = 0;
n < N; ++
n){
142 fprintf(fPoints,
"%g,%g,%d,%d\n",
151 os <<
"Attenuation fit results for " 153 <<
", " << res.
chan <<
": ";
161 << res.
background <<
" background. Rolloffs start at -" 165 os <<
"Interpolation points are: [ ";
167 for(
int n = 0;
n < N; ++
n)
static std::string GetName(int id)
Float_t y1[n_points_granero]
bool IsCalibrated() const
static AttenCurve * Uninitialized(int det, geo::OfflineChan chan)
Return a new AttenCurve objects with fields uninitialized.
float center_offset
Nonzero in short muon-catcher cells. Positive is closer to readout.
int ToDBValidityChan() const
Encapsulate the geometry of one entire detector (near, far, ndos)
fvar< T > exp(const fvar< T > &x)
assert(nhit_max >=nhit_nbins)
float MeanPEPerCmAt(double w) const
Mean response of this channel at this distance from detector centre.
void WriteToCSVs(FILE *fConsts, FILE *fPoints, bool mc) const
std::ostream & operator<<(std::ostream &os, const AttenCurve &res)
std::vector< Pt > interp_pts
void AddInterpPoint(float w, float factor)