Public Member Functions | Public Attributes | List of all members
lar::example::ShowerCalibrationGaloreFromPID::CalibrationInfo_t Struct Reference

Internal structure containing the calibration information. More...

Public Member Functions

double evalFactor (double E) const
 
double evalError (double E) const
 
bool present () const
 
bool uniform () const
 
CalibrationInfo_tapplyTo (PDGID_t id)
 
CalibrationInfo_tapplyTo (std::initializer_list< PDGID_t > ids)
 
template<typename Stream >
void reportTo (Stream &&out) const
 Prints a short report of this correction. More...
 

Public Attributes

std::vector< PDGID_tappliesTo
 PID it applies to; unused. More...
 
double minE = -1.
 lower end of the energy range covered [GeV] More...
 
double maxE = -1.
 upper end of the energy range covered [GeV] More...
 
std::unique_ptr< ROOT::Math::Interpolator > factor
 parametrisation of the correction factor More...
 
std::unique_ptr< ROOT::Math::Interpolator > error
 parametrisation of the correction uncertainty More...
 

Detailed Description

Internal structure containing the calibration information.

Definition at line 209 of file ShowerCalibrationGaloreFromPID.h.

Member Function Documentation

lar::example::ShowerCalibrationGaloreFromPID::CalibrationInfo_t & lar::example::ShowerCalibrationGaloreFromPID::CalibrationInfo_t::applyTo ( PDGID_t  id)

Definition at line 271 of file ShowerCalibrationGaloreFromPID.cxx.

272 {
273  auto it = std::lower_bound(appliesTo.begin(), appliesTo.end(), id);
274  if ((it == appliesTo.end()) || (*it != id))
275  appliesTo.insert(it, id);
276  return *this;
277 } // ShowerCalibrationGaloreFromPID::CalibrationInfo_t::applyTo(ID)
lar::example::ShowerCalibrationGaloreFromPID::CalibrationInfo_t & lar::example::ShowerCalibrationGaloreFromPID::CalibrationInfo_t::applyTo ( std::initializer_list< PDGID_t ids)

Definition at line 282 of file ShowerCalibrationGaloreFromPID.cxx.

283 {
284  appliesTo.insert(appliesTo.begin(), ids.begin(), ids.end());
285  std::sort(appliesTo.begin(), appliesTo.end());
286  return *this;
287 } // ShowerCalibrationGaloreFromPID::CalibrationInfo_t::applyTo(IDs)
double lar::example::ShowerCalibrationGaloreFromPID::CalibrationInfo_t::evalError ( double  E) const

Definition at line 301 of file ShowerCalibrationGaloreFromPID.cxx.

302 {
303  double const boundE = std::min(maxE, std::max(minE, E));
304  return error->Eval(boundE);
305 }
error
Definition: include.cc:26
static int max(int a, int b)
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:55
double lar::example::ShowerCalibrationGaloreFromPID::CalibrationInfo_t::evalFactor ( double  E) const

Definition at line 293 of file ShowerCalibrationGaloreFromPID.cxx.

294 {
295  double const boundE = std::min(maxE, std::max(minE, E));
296  return factor->Eval(boundE);
297 }
static int max(int a, int b)
std::unique_ptr< ROOT::Math::Interpolator > factor
parametrisation of the correction factor
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:55
bool lar::example::ShowerCalibrationGaloreFromPID::CalibrationInfo_t::present ( ) const
inline

Definition at line 223 of file ShowerCalibrationGaloreFromPID.h.

223 { return maxE >= 0.; }
template<typename Stream >
void lar::example::ShowerCalibrationGaloreFromPID::CalibrationInfo_t::reportTo ( Stream &&  out) const

Prints a short report of this correction.

Definition at line 342 of file ShowerCalibrationGaloreFromPID.h.

343 {
344  if (!present()) {
345  out << "not present";
346  return;
347  }
348  if (uniform()) {
349  out << "uniform correction " << factor->Eval(minE) << " +/- "
350  << error->Eval(minE) << " for all energies";
351  }
352  else {
353  out << "correction valid from E=" << minE
354  << " GeV (" << factor->Eval(minE) << " +/- " << error->Eval(minE)
355  << ") to E=" << maxE
356  << " GeV (" << factor->Eval(maxE) << " +/- " << error->Eval(maxE)
357  << ")";
358  }
359  if (!appliesTo.empty()) {
360  out << "; covers particles ID={";
361  for (auto id: appliesTo) out << " " << id;
362  out << " }";
363  }
364 
365 } // lar::example::ShowerCalibrationGaloreFromPID::CalibrationInfo_t::report()
error
Definition: include.cc:26
std::unique_ptr< ROOT::Math::Interpolator > factor
parametrisation of the correction factor
bool lar::example::ShowerCalibrationGaloreFromPID::CalibrationInfo_t::uniform ( ) const
inline

Definition at line 224 of file ShowerCalibrationGaloreFromPID.h.

224 { return minE == maxE; }

Member Data Documentation

std::vector<PDGID_t> lar::example::ShowerCalibrationGaloreFromPID::CalibrationInfo_t::appliesTo

PID it applies to; unused.

Definition at line 210 of file ShowerCalibrationGaloreFromPID.h.

std::unique_ptr<ROOT::Math::Interpolator> lar::example::ShowerCalibrationGaloreFromPID::CalibrationInfo_t::error

parametrisation of the correction uncertainty

Definition at line 218 of file ShowerCalibrationGaloreFromPID.h.

std::unique_ptr<ROOT::Math::Interpolator> lar::example::ShowerCalibrationGaloreFromPID::CalibrationInfo_t::factor

parametrisation of the correction factor

Definition at line 215 of file ShowerCalibrationGaloreFromPID.h.

double lar::example::ShowerCalibrationGaloreFromPID::CalibrationInfo_t::maxE = -1.

upper end of the energy range covered [GeV]

Definition at line 212 of file ShowerCalibrationGaloreFromPID.h.

double lar::example::ShowerCalibrationGaloreFromPID::CalibrationInfo_t::minE = -1.

lower end of the energy range covered [GeV]

Definition at line 211 of file ShowerCalibrationGaloreFromPID.h.


The documentation for this struct was generated from the following files: