LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
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.

Referenced by lar::example::ShowerCalibrationGaloreFromPID::OpenROOTdirectory(), and lar::example::ShowerCalibrationGaloreFromPID::readParticleCalibration().

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.

References evalFactor().

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.

References lar::example::ShowerCalibrationGaloreFromPID::createInterpolator(), max, maxE, min, and minE.

Referenced by lar::example::ShowerCalibrationGaloreFromPID::correction(), and evalFactor().

302 {
303  double const boundE = std::min(maxE, std::max(minE, E));
304  return error->Eval(boundE);
305 }
Float_t E
Definition: plot.C:23
std::unique_ptr< ROOT::Math::Interpolator > error
parametrisation of the correction uncertainty
Int_t max
Definition: plot.C:27
Int_t min
Definition: plot.C:26
double lar::example::ShowerCalibrationGaloreFromPID::CalibrationInfo_t::evalFactor ( double  E) const

Definition at line 293 of file ShowerCalibrationGaloreFromPID.cxx.

References evalError(), max, maxE, min, and minE.

Referenced by applyTo(), lar::example::ShowerCalibrationGaloreFromPID::correction(), and lar::example::ShowerCalibrationGaloreFromPID::correctionFactor().

294 {
295  double const boundE = std::min(maxE, std::max(minE, E));
296  return factor->Eval(boundE);
297 }
Float_t E
Definition: plot.C:23
Int_t max
Definition: plot.C:27
std::unique_ptr< ROOT::Math::Interpolator > factor
parametrisation of the correction factor
Int_t min
Definition: plot.C:26
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.

References maxE, minE, and art::productstatus::present().

Referenced by lar::example::ShowerCalibrationGaloreFromPID::reportTo().

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()
std::unique_ptr< ROOT::Math::Interpolator > error
parametrisation of the correction uncertainty
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.

References maxE.

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.

Referenced by lar::example::ShowerCalibrationGaloreFromPID::readParticleCalibration().

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.

Referenced by lar::example::ShowerCalibrationGaloreFromPID::readParticleCalibration().

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

upper end of the energy range covered [GeV]

Definition at line 212 of file ShowerCalibrationGaloreFromPID.h.

Referenced by lar::example::ShowerCalibrationGaloreFromPID::readParticleCalibration().

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

lower end of the energy range covered [GeV]

Definition at line 211 of file ShowerCalibrationGaloreFromPID.h.

Referenced by lar::example::ShowerCalibrationGaloreFromPID::readParticleCalibration().


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