![]() |
MaCh3
2.5.0
Reference Guide
|
#include "Samples/SampleStructs.h"#include "Parameters/ParameterStructs.h"#include "Manager/YamlHelper.h"Go to the source code of this file.
Namespaces | |
| M3 | |
| Main namespace for MaCh3 software. | |
Functions | |
| double | OverflowIntegral (TH2Poly *poly) |
| WP: Helper function for calculating unbinned Integral of TH2Poly i.e including overflow. More... | |
| double | NoOverflowIntegral (TH2Poly *poly) |
| WP: Helper function for calculating binned Integral of TH2Poly i.e not including overflow. More... | |
| TH1D * | PolyProjectionX (TObject *poly, std::string TempName, const std::vector< double > &xbins, const bool computeErrors=false) |
| WP: Poly Projectors. More... | |
| TH1D * | PolyProjectionY (TObject *poly, std::string TempName, const std::vector< double > &ybins, const bool computeErrors=false) |
| WP: Poly Projectors. More... | |
| TH2D * | ConvertTH2PolyToTH2D (TH2Poly *poly, TH2D *TH2Dhist) |
| KS: Convert TH2D to TH2Poly. More... | |
| TH2Poly * | ConvertTH2DtoTH2Poly (TH2D *TH2Dhist) |
| KS: Convert TH2Poly to TH2D. More... | |
| TH2Poly * | NormalisePoly (TH2Poly *Histogram) |
| WP: Helper to Normalise histograms. More... | |
| void | NormaliseTH2Poly (TH2Poly *Histogram) |
| Helper to Normalise histograms. More... | |
| TH2Poly * | PolyScaleWidth (TH2Poly *Histogram, double scale) |
| WP: Helper to scale th2poly analogous to th2d scale with option "width". More... | |
| double | PolyIntegralWidth (TH2Poly *Histogram) |
| WP: Helper to calc integral of th2poly analogous to th2d integra; with option "width". More... | |
| template<class HistType > | |
| HistType * | RatioHists (HistType *NumHist, HistType *DenomHist) |
| Helper to make ratio histograms. More... | |
| TH2Poly * | RatioPolys (TH2Poly *NumPoly, TH2Poly *DenomPoly) |
| Helper to make ratio of TH2Polys. More... | |
| TH2Poly * | MakePolyHist (const std::string &name, const std::vector< double > &BinArray_x, const std::vector< double > &BinArray_y) |
| WP: Helper function to create TH2Poly histogram with uniform binning. More... | |
| void | CheckTH2PolyFileVersion (TFile *file) |
| KS: ROOT changes something with binning when moving from ROOT 5 to ROOT 6. If you open ROOT5 produced file with ROOT6 you will be missing 9 last bins. More... | |
| void | RemoveFitter (TH1D *hist, const std::string &name) |
| KS: Remove fitted TF1 from hist to make comparison easier. More... | |
| void | MakeFluctuatedHistogramStandard (TH1D *FluctHist, TH1D *PolyHist, TRandom3 *rand) |
| Make Poisson fluctuation of TH1D hist using default fast method. More... | |
| void | MakeFluctuatedHistogramAlternative (TH1D *FluctHist, TH1D *PolyHist, TRandom3 *rand) |
| Make Poisson fluctuation of TH1D hist using slow method which is only for cross-check. More... | |
| void | MakeFluctuatedHistogramStandard (TH2D *FluctHist, TH2D *PolyHist, TRandom3 *rand) |
| Make Poisson fluctuation of TH2D hist using default fast method. More... | |
| void | MakeFluctuatedHistogramAlternative (TH2D *FluctHist, TH2D *PolyHist, TRandom3 *rand) |
| Make Poisson fluctuation of TH2D hist. More... | |
| void | MakeFluctuatedHistogramStandard (TH2Poly *FluctHist, TH2Poly *PolyHist, TRandom3 *rand) |
| Make Poisson fluctuation of TH2Poly hist using default fast method. More... | |
| void | MakeFluctuatedHistogramAlternative (TH2Poly *FluctHist, TH2Poly *PolyHist, TRandom3 *rand) |
| Make Poisson fluctuation of TH2Poly hist using slow method which is only for cross-check. More... | |
| int | GetRandomPoly2 (const TH2Poly *PolyHist, TRandom3 *rand) |
| KS: ROOT developers were too lazy do develop getRanom2 for TH2Poly, this implementation is based on link More... | |
| void | FastViolinFill (TH2D *violin, TH1D *hist_1d) |
| KS: Fill Violin histogram with entry from a toy. More... | |
| template<typename Derived , typename Base > | |
| std::vector< std::unique_ptr< Base > > | CastVector (std::vector< std::unique_ptr< Derived >> &&inputVec) |
| Converts a vector of pointers from a derived type to a base type. More... | |
| std::string | file_exists (std::string filename) |
| Helper to check if files exist or not. More... | |
| double | returnCherenkovThresholdMomentum (const int PDG) |
| DB Get the Cherenkov momentum threshold in MeV. More... | |
| double | CalculateQ2 (double PLep, double PUpd, double EnuTrue, double InitialQ2=0.0) |
| Recalculate Q^2 after Eb shift. Takes in shifted lepton momentum, lepton angle, and true neutrino energy. More... | |
| double | CalculateEnu (double PLep, double cosTheta, double EB, bool neutrino) |
| Recalculate Enu after Eb shift. Takes in shifted lepton momentum, lepton angle, and binding energy change, and if nu/anu. More... | |
| std::unique_ptr< TH1D > | MakeSummaryFromSpectra (const TH2D *Spectra, const std::string &name) |
| Build a 1D posterior-predictive summary from a violin spectrum. More... | |
| template<typename ObjectType > | |
| std::unique_ptr< ObjectType > | M3::Clone (const ObjectType *obj, const std::string &name="") |
| KS: Creates a copy of a ROOT-like object and wraps it in a smart pointer. More... | |
| TFile * | M3::Open (const std::string &Name, const std::string &Type, const std::string &File, const int Line) |
| Opens a ROOT file with the given name and mode. More... | |
| void | M3::ScaleHistogram (TH1 *Sample_Hist, const double scale) |
| Scale histogram to get divided by bin width. More... | |
| void | M3::CheckBinningMatch (const TH1D *Hist1, const TH1D *Hist2, const std::string &File, const int Line) |
| KS: Helper function check if data and MC binning matches. More... | |
| void | M3::CheckBinningMatch (const TH2D *Hist1, const TH2D *Hist2, const std::string &File, const int Line) |
| KS: Helper function check if data and MC binning matches. More... | |
| void | M3::CheckBinningMatch (TH2Poly *Hist1, TH2Poly *Hist2, const std::string &File, const int Line) |
| KS: Helper function check if data and MC binning matches. More... | |
| YAML::Node | M3::PolyToYaml (TH2Poly *Hist, const std::string &YamlName, const std::string &File, const int Line) |
| KS: Convert TH2Poly into yaml config accepted by MaCh3. More... | |
Definition in file HistogramUtils.h.
| double CalculateEnu | ( | double | PLep, |
| double | cosTheta, | ||
| double | EB, | ||
| bool | neutrino | ||
| ) |
Recalculate Enu after Eb shift. Takes in shifted lepton momentum, lepton angle, and binding energy change, and if nu/anu.
| PLep | Shifted outgoing lepton momentum (MeV/c). |
| cosTheta | Cosine of the lepton scattering angle. |
| EB | Binding energy shift applied to the interaction (MeV). |
| neutrino | True if the interaction is neutrino, false if antineutrino. |
Definition at line 604 of file HistogramUtils.cpp.
| double CalculateQ2 | ( | double | PLep, |
| double | PUpd, | ||
| double | EnuTrue, | ||
| double | InitialQ2 = 0.0 |
||
| ) |
Recalculate Q^2 after Eb shift. Takes in shifted lepton momentum, lepton angle, and true neutrino energy.
| PLep | Shifted outgoing lepton momentum (MeV/c). |
| PUpd | Updated lepton angle or related kinematic quantity used in the recalculation. |
| EnuTrue | True neutrino energy (MeV). |
| InitialQ2 | Optional initial Q^2 value (used as seed or fallback, default = 0). |
Definition at line 584 of file HistogramUtils.cpp.
| std::vector<std::unique_ptr<Base> > CastVector | ( | std::vector< std::unique_ptr< Derived >> && | inputVec | ) |
Converts a vector of pointers from a derived type to a base type.
| Derived | The derived class type. |
| Base | The base class type. |
| inputVec | A std::vector of pointers to Derived objects. |
std::vector of pointers to Base objects. Definition at line 95 of file HistogramUtils.h.
| void CheckTH2PolyFileVersion | ( | TFile * | file | ) |
KS: ROOT changes something with binning when moving from ROOT 5 to ROOT 6. If you open ROOT5 produced file with ROOT6 you will be missing 9 last bins.
However if you use ROOT6 and have ROOT6 file exactly the same code will work. Something have changed with how TH2Poly bins are stored in TFile
| file | ROOT file that we will make version checks |
Definition at line 14 of file HistogramUtils.cpp.
| TH2Poly* ConvertTH2DtoTH2Poly | ( | TH2D * | TH2Dhist | ) |
| TH2D* ConvertTH2PolyToTH2D | ( | TH2Poly * | poly, |
| TH2D * | TH2Dhist | ||
| ) |
KS: Convert TH2D to TH2Poly.
Definition at line 251 of file HistogramUtils.cpp.
| void FastViolinFill | ( | TH2D * | violin, |
| TH1D * | hist_1d | ||
| ) |
KS: Fill Violin histogram with entry from a toy.
| violin | hist that will be filled |
| hist_1d | refence hist from which we take entries to be filled |
Definition at line 562 of file HistogramUtils.cpp.
|
inline |
| int GetRandomPoly2 | ( | const TH2Poly * | PolyHist, |
| TRandom3 * | rand | ||
| ) |
KS: ROOT developers were too lazy do develop getRanom2 for TH2Poly, this implementation is based on link
Definition at line 511 of file HistogramUtils.cpp.
| void MakeFluctuatedHistogramAlternative | ( | TH1D * | FluctHist, |
| TH1D * | PolyHist, | ||
| TRandom3 * | rand | ||
| ) |
Make Poisson fluctuation of TH1D hist using slow method which is only for cross-check.
Definition at line 469 of file HistogramUtils.cpp.
| void MakeFluctuatedHistogramAlternative | ( | TH2D * | FluctHist, |
| TH2D * | PolyHist, | ||
| TRandom3 * | rand | ||
| ) |
| void MakeFluctuatedHistogramAlternative | ( | TH2Poly * | FluctHist, |
| TH2Poly * | PolyHist, | ||
| TRandom3 * | rand | ||
| ) |
Make Poisson fluctuation of TH2Poly hist using slow method which is only for cross-check.
Definition at line 540 of file HistogramUtils.cpp.
| void MakeFluctuatedHistogramStandard | ( | TH1D * | FluctHist, |
| TH1D * | PolyHist, | ||
| TRandom3 * | rand | ||
| ) |
Make Poisson fluctuation of TH1D hist using default fast method.
Definition at line 408 of file HistogramUtils.cpp.
| void MakeFluctuatedHistogramStandard | ( | TH2D * | FluctHist, |
| TH2D * | PolyHist, | ||
| TRandom3 * | rand | ||
| ) |
Make Poisson fluctuation of TH2D hist using default fast method.
Definition at line 446 of file HistogramUtils.cpp.
| void MakeFluctuatedHistogramStandard | ( | TH2Poly * | FluctHist, |
| TH2Poly * | PolyHist, | ||
| TRandom3 * | rand | ||
| ) |
Make Poisson fluctuation of TH2Poly hist using default fast method.
Definition at line 427 of file HistogramUtils.cpp.
| TH2Poly* MakePolyHist | ( | const std::string & | name, |
| const std::vector< double > & | BinArray_x, | ||
| const std::vector< double > & | BinArray_y | ||
| ) |
WP: Helper function to create TH2Poly histogram with uniform binning.
| name | This will be title of output histogram |
| BinArray_x | Bin edges for X axis |
| BinArray_y | Bin edges for Y axis |
Definition at line 373 of file HistogramUtils.cpp.
| std::unique_ptr<TH1D> MakeSummaryFromSpectra | ( | const TH2D * | Spectra, |
| const std::string & | name | ||
| ) |
Build a 1D posterior-predictive summary from a violin spectrum.
| Spectra | Input TH2D violin/density histogram. |
| name | Name of the output TH1D. |
Definition at line 624 of file HistogramUtils.cpp.
| double NoOverflowIntegral | ( | TH2Poly * | poly | ) |
WP: Helper function for calculating binned Integral of TH2Poly i.e not including overflow.
Definition at line 53 of file HistogramUtils.cpp.
| TH2Poly* NormalisePoly | ( | TH2Poly * | Histogram | ) |
WP: Helper to Normalise histograms.
Definition at line 201 of file HistogramUtils.cpp.
| void NormaliseTH2Poly | ( | TH2Poly * | Histogram | ) |
Helper to Normalise histograms.
| Histogram | hist which we normalise |
Definition at line 214 of file HistogramUtils.cpp.
| double OverflowIntegral | ( | TH2Poly * | poly | ) |
WP: Helper function for calculating unbinned Integral of TH2Poly i.e including overflow.
Definition at line 38 of file HistogramUtils.cpp.
| double PolyIntegralWidth | ( | TH2Poly * | Histogram | ) |
WP: Helper to calc integral of th2poly analogous to th2d integra; with option "width".
Definition at line 354 of file HistogramUtils.cpp.
| TH1D* PolyProjectionX | ( | TObject * | poly, |
| std::string | TempName, | ||
| const std::vector< double > & | xbins, | ||
| const bool | computeErrors = false |
||
| ) |
WP: Poly Projectors.
Definition at line 66 of file HistogramUtils.cpp.
| TH1D* PolyProjectionY | ( | TObject * | poly, |
| std::string | TempName, | ||
| const std::vector< double > & | ybins, | ||
| const bool | computeErrors = false |
||
| ) |
WP: Poly Projectors.
Definition at line 134 of file HistogramUtils.cpp.
| TH2Poly* PolyScaleWidth | ( | TH2Poly * | Histogram, |
| double | scale | ||
| ) |
WP: Helper to scale th2poly analogous to th2d scale with option "width".
Definition at line 334 of file HistogramUtils.cpp.
| HistType* RatioHists | ( | HistType * | NumHist, |
| HistType * | DenomHist | ||
| ) |
Helper to make ratio histograms.
Definition at line 226 of file HistogramUtils.cpp.
| TH2Poly* RatioPolys | ( | TH2Poly * | NumPoly, |
| TH2Poly * | DenomPoly | ||
| ) |
| void RemoveFitter | ( | TH1D * | hist, |
| const std::string & | name | ||
| ) |
KS: Remove fitted TF1 from hist to make comparison easier.
Definition at line 397 of file HistogramUtils.cpp.
| double returnCherenkovThresholdMomentum | ( | const int | PDG | ) |
DB Get the Cherenkov momentum threshold in MeV.
| PDG | PDG code of the particle for which the Cherenkov threshold is requested. |
Definition at line 574 of file HistogramUtils.cpp.