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... | |
Public Types inherited from lar::example::ShowerCalibrationGalore | |
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 Correction_t | correction (recob::Shower const &, PDGID_t=unknownID) const override |
Returns the correction for a given reconstructed shower. 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... | |
Public Member Functions inherited from lar::example::ShowerCalibrationGalore | |
virtual | ~ShowerCalibrationGalore ()=default |
virtual float | correctionFactor (recob::Shower const &shower, PDGID_t PDGID=unknownID) const =0 |
Returns a correction factor for a given reconstructed shower. More... | |
Static Public Member Functions | |
static void | verifyOrder (TGraph const *graph) |
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... | |
Additional Inherited Members | |
Static Public Attributes inherited from lar::example::ShowerCalibrationGalore | |
static constexpr PDGID_t | unknownID = 0 |
A mnemonic constant for unknown particle ID. More... | |
Protected Member Functions inherited from lar::UncopiableClass | |
UncopiableClass ()=default | |
Default constructor. More... | |
~UncopiableClass ()=default | |
Default destructor. More... | |
UncopiableClass (UncopiableClass const &)=delete | |
Deleted copy and move constructors and assignments. More... | |
UncopiableClass (UncopiableClass &&)=default | |
UncopiableClass & | operator= (UncopiableClass const &)=delete |
UncopiableClass & | operator= (UncopiableClass &&)=default |
Protected Member Functions inherited from lar::UnmovableClass | |
UnmovableClass ()=default | |
Default constructor. More... | |
~UnmovableClass ()=default | |
Default destructor. More... | |
UnmovableClass (UnmovableClass const &)=default | |
Default copy constructor and assignment. More... | |
UnmovableClass & | operator= (UnmovableClass const &)=default |
UnmovableClass (UnmovableClass &&)=delete | |
Deleted move constructor and assignment. More... | |
UnmovableClass & | operator= (UnmovableClass &&)=delete |
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.
using lar::example::ShowerCalibrationGaloreFromPID::parameters_type = fhicl::Table<Config> |
Type describing all the parameters.
Definition at line 141 of file ShowerCalibrationGaloreFromPID.h.
|
inline |
Constructor from the complete configuration object.
Definition at line 146 of file ShowerCalibrationGaloreFromPID.h.
|
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.
|
staticprivate |
Creates a ROOT interpolator from a set of N points.
Definition at line 311 of file ShowerCalibrationGaloreFromPID.cxx.
|
staticprivate |
Opens the specified ROOT directory, as in path/to/file.root:dir/dir.
Definition at line 221 of file ShowerCalibrationGaloreFromPID.cxx.
void lar::example::ShowerCalibrationGaloreFromPID::readCalibration | ( | std::string | path | ) |
Reads the calibration information from the specified file.
Definition at line 62 of file ShowerCalibrationGaloreFromPID.cxx.
|
private |
Reads and returns calibration information from the specified graph.
Definition at line 136 of file ShowerCalibrationGaloreFromPID.cxx.
|
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.
|
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.
|
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.
|
private |
Returns the correct CalibrationInfo_t for specified id.
Definition at line 113 of file ShowerCalibrationGaloreFromPID.cxx.
|
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.
|
private |
electron/positron calibration
Definition at line 237 of file ShowerCalibrationGaloreFromPID.h.
|
private |
muon/antimuon calibration
Definition at line 238 of file ShowerCalibrationGaloreFromPID.h.
|
private |
default calibration
Definition at line 239 of file ShowerCalibrationGaloreFromPID.h.
|
private |
photon calibration
Definition at line 236 of file ShowerCalibrationGaloreFromPID.h.
|
private |
neutral pion calibration
Definition at line 235 of file ShowerCalibrationGaloreFromPID.h.