LArSoft
v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
|
Shower calibration service provider correcting according to PID. More...
#include "ShowerCalibrationGaloreFromPID.h"
Classes | |
struct | CalibrationInfo_t |
Internal structure containing the calibration information. More... | |
struct | Config |
Collection of configuration parameters for the service. More... | |
Public Types | |
using | parameters_type = fhicl::Table< Config > |
Type describing all the parameters. More... | |
using | PDGID_t = int |
A type representing a particle ID in Particle Data Group convention. More... | |
Public Member Functions | |
ShowerCalibrationGaloreFromPID (Config const &config) | |
Constructor from the complete configuration object. More... | |
ShowerCalibrationGaloreFromPID (fhicl::ParameterSet const &pset) | |
Constructor from a parameter set. More... | |
virtual std::string | report () const override |
Returns a string with a short report of the current corrections. More... | |
void | readCalibration (std::string path) |
Reads the calibration information from the specified file. More... | |
template<typename Stream > | |
void | reportTo (Stream &&out) const |
Prints a short report of the current corrections. More... | |
Correction query | |
virtual float | correctionFactor (recob::Shower const &, PDGID_t=unknownID) const override |
Returns a correction factor for a given reconstructed shower. More... | |
virtual Correction_t | correction (recob::Shower const &, PDGID_t=unknownID) const override |
Returns the correction for a given reconstructed shower. More... | |
Static Public Member Functions | |
static void | verifyOrder (TGraph const *graph) |
Static Public Attributes | |
static constexpr PDGID_t | unknownID = 0 |
A mnemonic constant for unknown particle ID. More... | |
Private Member Functions | |
CalibrationInfo_t const & | selectCorrection (PDGID_t id) const |
Returns the correct CalibrationInfo_t for specified id. More... | |
CalibrationInfo_t | readParticleCalibration (TDirectory *SourceDir, std::string GraphName) const |
Reads and returns calibration information from the specified graph. More... | |
CalibrationInfo_t | readParticleCalibration (TDirectory *SourceDir, std::string GraphName, PDGID_t id) const |
CalibrationInfo_t | readParticleCalibration (TDirectory *SourceDir, std::string GraphName, std::initializer_list< PDGID_t > ids) const |
Static Private Member Functions | |
static TDirectory * | OpenROOTdirectory (std::string path) |
Opens the specified ROOT directory, as in path/to/file.root:dir/dir. More... | |
static std::unique_ptr< ROOT::Math::Interpolator > | createInterpolator (unsigned int N, double const *x, double const *y) |
Creates a ROOT interpolator from a set of N points. More... | |
Private Attributes | |
CalibrationInfo_t | Calibration_pi0 |
neutral pion calibration More... | |
CalibrationInfo_t | Calibration_photon |
photon calibration More... | |
CalibrationInfo_t | Calibration_electron |
electron/positron calibration More... | |
CalibrationInfo_t | Calibration_muon |
muon/antimuon calibration More... | |
CalibrationInfo_t | Calibration_other |
default calibration More... | |
Shower calibration service provider correcting according to PID.
The service provider computes a calibration factor for a reconstructed shower. The calibration factor depends on an hypothesis on the type of particle. The calibration factors are extracted from the specified ROOT file.
Calibration is represented by a list of objects with specific names:
"Pi0"
(TGraphErrors
): neutral pion calibration vs. reconstructed energy"Photon"
(TGraphErrors
): photon calibration vs. reconstructed energy"Electron"
(TGraphErrors
): electron/positron calibration vs. reconstructed energy"Muon"
(TGraphErrors
): muon/antimuon calibration vs. reconstructed energy"Default"
(TGraphErrors
): other particle calibration vs. reconstructed energyEach graph is required to hold at least one point, and its points must be already sorted by energy. Energy is measured in GeV.
The input calibration objects are graphs with symmetric errors. The independent variable is the best estimation of the reconstructed energy of the shower. The correction factor is interpolated (by a cubic spline) between the points in the graph; errors are likewise interpolated. If the requested energy is outside the range of the graph the correction is the same as the closest available energy point, with its uncertainty doubled every half full range of the graph. As a special case, if the graph has only one point, the correction is uniform in the full energy spectrum (including its uncertainty).
path/to/file.root:Calibrations/Shower
expects a nested ROOT directory structure Calibrations/Shower
in the ROOT file path/to/file.root
, where path
is accessible from the usual search path in FW_SEARCH_PATH
Definition at line 121 of file ShowerCalibrationGaloreFromPID.h.
Type describing all the parameters.
Definition at line 141 of file ShowerCalibrationGaloreFromPID.h.
|
inherited |
A type representing a particle ID in Particle Data Group convention.
Definition at line 66 of file ShowerCalibrationGalore.h.
|
inline |
Constructor from the complete configuration object.
Definition at line 146 of file ShowerCalibrationGaloreFromPID.h.
References lar::example::ShowerCalibrationGaloreFromPID::Config::CalibrationFile.
|
inline |
Constructor from a parameter set.
Definition at line 151 of file ShowerCalibrationGaloreFromPID.h.
|
overridevirtual |
Returns the correction for a given reconstructed shower.
The returned value includes a correction factor to be applied to any shower energy to calibrate it, with its global uncertainty.
Implements lar::example::ShowerCalibrationGalore.
Definition at line 50 of file ShowerCalibrationGaloreFromPID.cxx.
References recob::Shower::best_plane(), E, recob::Shower::Energy(), lar::example::ShowerCalibrationGaloreFromPID::CalibrationInfo_t::evalError(), lar::example::ShowerCalibrationGaloreFromPID::CalibrationInfo_t::evalFactor(), and readCalibration().
Referenced by correctionFactor().
|
overridevirtual |
Returns a correction factor for a given reconstructed shower.
LArSoft libraries.
The returned value includes a correction factor to be applied to the shower energy to calibrate it, but no uncertainty.
framework and utility libraries
Implements lar::example::ShowerCalibrationGalore.
Definition at line 37 of file ShowerCalibrationGaloreFromPID.cxx.
References recob::Shower::best_plane(), correction(), E, recob::Shower::Energy(), and lar::example::ShowerCalibrationGaloreFromPID::CalibrationInfo_t::evalFactor().
|
staticprivate |
Creates a ROOT interpolator from a set of N points.
Definition at line 311 of file ShowerCalibrationGaloreFromPID.cxx.
Referenced by lar::example::ShowerCalibrationGaloreFromPID::CalibrationInfo_t::evalError(), and readParticleCalibration().
|
staticprivate |
Opens the specified ROOT directory, as in path/to/file.root:dir/dir.
Definition at line 221 of file ShowerCalibrationGaloreFromPID.cxx.
References lar::example::ShowerCalibrationGaloreFromPID::CalibrationInfo_t::applyTo(), dir, and lar::example::splitROOTpath().
Referenced by readParticleCalibration().
void lar::example::ShowerCalibrationGaloreFromPID::readCalibration | ( | std::string | path | ) |
Reads the calibration information from the specified file.
Definition at line 62 of file ShowerCalibrationGaloreFromPID.cxx.
References e.
Referenced by correction().
|
private |
Reads and returns calibration information from the specified graph.
Definition at line 136 of file ShowerCalibrationGaloreFromPID.cxx.
References createInterpolator(), lar::example::ShowerCalibrationGaloreFromPID::CalibrationInfo_t::error, lar::example::ShowerCalibrationGaloreFromPID::CalibrationInfo_t::factor, lar::example::ShowerCalibrationGaloreFromPID::CalibrationInfo_t::maxE, lar::example::ShowerCalibrationGaloreFromPID::CalibrationInfo_t::minE, and verifyOrder().
Referenced by readParticleCalibration(), selectCorrection(), and verifyOrder().
|
private |
Reads and returns calibration information from the specified graph and register a particle ID in it
Definition at line 200 of file ShowerCalibrationGaloreFromPID.cxx.
References lar::example::ShowerCalibrationGaloreFromPID::CalibrationInfo_t::applyTo(), and readParticleCalibration().
|
private |
Reads and returns calibration information from the specified graph and register a list of particle IDs to it
Definition at line 209 of file ShowerCalibrationGaloreFromPID.cxx.
References lar::example::ShowerCalibrationGaloreFromPID::CalibrationInfo_t::applyTo(), OpenROOTdirectory(), and readParticleCalibration().
|
inlineoverridevirtual |
Returns a string with a short report of the current corrections.
Implements lar::example::ShowerCalibrationGalore.
Definition at line 188 of file ShowerCalibrationGaloreFromPID.h.
void lar::example::ShowerCalibrationGaloreFromPID::reportTo | ( | Stream && | out | ) | const |
Prints a short report of the current corrections.
Definition at line 322 of file ShowerCalibrationGaloreFromPID.h.
References lar::example::ShowerCalibrationGaloreFromPID::CalibrationInfo_t::reportTo().
|
private |
Returns the correct CalibrationInfo_t for specified id.
Definition at line 113 of file ShowerCalibrationGaloreFromPID.cxx.
References Calibration_electron, Calibration_muon, Calibration_other, Calibration_photon, Calibration_pi0, readParticleCalibration(), and lar::example::ShowerCalibrationGalore::unknownID.
|
static |
Verifies that points in specified graph have increasing abscissa
cet::exception | if points are not sorted by growing x |
Definition at line 174 of file ShowerCalibrationGaloreFromPID.cxx.
References readParticleCalibration(), and x.
Referenced by readParticleCalibration().
|
private |
electron/positron calibration
Definition at line 237 of file ShowerCalibrationGaloreFromPID.h.
Referenced by selectCorrection().
|
private |
muon/antimuon calibration
Definition at line 238 of file ShowerCalibrationGaloreFromPID.h.
Referenced by selectCorrection().
|
private |
default calibration
Definition at line 239 of file ShowerCalibrationGaloreFromPID.h.
Referenced by selectCorrection().
|
private |
photon calibration
Definition at line 236 of file ShowerCalibrationGaloreFromPID.h.
Referenced by selectCorrection().
|
private |
neutral pion calibration
Definition at line 235 of file ShowerCalibrationGaloreFromPID.h.
Referenced by selectCorrection().
|
staticinherited |
A mnemonic constant for unknown particle ID.
Definition at line 69 of file ShowerCalibrationGalore.h.
Referenced by selectCorrection().