Tests for LArSoft examples. More...
Classes | |
class | AtomicNumberTest |
Tests AtomicNumberService. More... | |
class | CheckDataProductSize |
Checks the size of the specified collection. More... | |
class | DumpCheatTracks |
Dumps lar::example::CheatTrack data product and associations. More... | |
class | ParticleMaker |
Creates a collection of simulated particles. More... | |
class | ShowerCalibrationGaloreTest |
Tests ShowerCalibrationGaloreService. More... | |
class | SpacePointMaker |
Creates a collection of space points. More... | |
Functions | |
int | CreateTestShowerCalibrationFromPID (std::string outputPath) |
Creates a test calibration file for ShowerCalibrationGaloreFromPID. More... | |
std::string | centerString (std::string const &s, unsigned int width, char pad= ' ') |
Returns a string padding s to be centered in a width w. More... | |
recob::Shower | MakeShower (float E, int bestPlane=2, int ID=1) |
template<typename Stream > | |
unsigned int | ShowerCalibrationTableTest (Stream &&out, lar::example::ShowerCalibrationGalore const *calibration, float Emin=0.0, float Emax=2.5, float Estep=0.1, std::vector< lar::example::ShowerCalibrationGalore::PDGID_t > const &pids={11, 13, 111, 2212, 22}) |
Synthetic test: prints corrections for showers in a energy range. More... | |
recob::SpacePoint | MakeSpacePoint (int ID, double const *pos, double error=0.) |
Creates and returns a new space point. More... | |
unsigned int | FillSpacePointGrid (std::vector< recob::SpacePoint > &spacePoints, geo::BoxBoundedGeo const &box, double stepSize) |
Creates space points distributed in a grid. More... | |
Tests for LArSoft examples.
|
inline |
Returns a string padding s to be centered in a width w.
Definition at line 34 of file ShowerCalibrationGaloreTests.h.
int lar::example::tests::CreateTestShowerCalibrationFromPID | ( | std::string | outputPath | ) |
Creates a test calibration file for ShowerCalibrationGaloreFromPID.
outputPath
is a full ROOT directory path made of a UNIX path and a ROOT directory path. For example, "data/calibrations.root:Showers/ByType"
will create a directory data
and a calibrations.root
ROOT file in it (or update it if exists), create a structure of two nested ROOT directories, Showers/ByType
, and write all the calibration graphs in there.
It currently writes:
"Pi0"
(TGraphErrors
): neutral pion calibration vs. reconstructed energy, [ 0; 2 ] GeV range"Photon"
(TGraphErrors
): photon calibration vs. reconstructed energy, [ 0; 2 ] GeV range"Electron"
(TGraphErrors
): electron/positron calibration vs. reconstructed energy, [ 0; 2 ] GeV range"Muon"
(TGraphErrors
): muon/antimuon calibration vs. reconstructed energy, [ 0; 2 ] GeV range"Default"
(TGraphErrors
): other particle calibration vs. reconstructed energy, [ 0; 5 ] GeV range Definition at line 328 of file CreateTestShowerCalibrationFromPID.cxx.
unsigned int lar::example::tests::FillSpacePointGrid | ( | std::vector< recob::SpacePoint > & | spacePoints, |
geo::BoxBoundedGeo const & | box, | ||
double | stepSize | ||
) |
Creates space points distributed in a grid.
spacePoints | the container to be filled |
box | the extend of volume to be filled |
stepSize | the spacing between points |
The function adds space points to the specified collection. The centre of the box hosts a space point. The other space points are added shifting by multiples of stepSize in all directions. The IDs are incremental, starting from the ID next to the one from the last space point in the collection, or 1 if the collection is empty.
Points have an uncertainty of , with the step size.
Definition at line 40 of file SpacePointTestUtils.cxx.
|
inline |
Definition at line 47 of file ShowerCalibrationGaloreTests.h.
recob::SpacePoint lar::example::tests::MakeSpacePoint | ( | int | ID, |
double const * | pos, | ||
double | error = 0. |
||
) |
Creates and returns a new space point.
ID | space point identifier |
pos | space point position: { x, y, z } [cm] |
error | uncertainty on position (applies to all the coordinates) |
Points are uncorrelated.
Definition at line 26 of file SpacePointTestUtils.cxx.
unsigned int lar::example::tests::ShowerCalibrationTableTest | ( | Stream && | out, |
lar::example::ShowerCalibrationGalore const * | calibration, | ||
float | Emin = 0.0 , |
||
float | Emax = 2.5 , |
||
float | Estep = 0.1 , |
||
std::vector< lar::example::ShowerCalibrationGalore::PDGID_t > const & | pids = { 11, 13, 111, 2212, 22 } |
||
) |
Synthetic test: prints corrections for showers in a energy range.
Stream | type of output stream |
out | output stream |
calibration | service provider |
Emin | lower shower energy for the printout [GeV] (default: 0) |
Emax | upper shower energy for the printout GeV |
Estep | energy step size for the printout [GeV] (default: have 10 steps) |
pids | use these PIDs (default: { 11, 13, 111, 2212, 22 }) |
The corrections are printed in a table like:
Definition at line 83 of file ShowerCalibrationGaloreTests.h.