RandomUniverseUtility.h
Go to the documentation of this file.
1 //
2 // Created by Brian Rebel on 4/20/20.
3 //
4 // Functions to help with creating and checking random universes for
5 // sensitivities
6 //
7 
8 #ifndef CMF_UTILITIES_CMFRANDOMUNIVERSEUTILITIES_H
9 #define CMF_UTILITIES_CMFRANDOMUNIVERSEUTILITIES_H
10 
11 #include "TRandom3.h"
12 #include "TH2.h"
13 
14 #include "fhiclcpp/ParameterSet.h"
15 
17 
18 namespace cmf{
20  public:
21 
23 
25  cmf::Location & vecLoc,
26  size_t universeNum);
28  std::vector<cmf::Location> & vecLocs);
30  cmf::Location & vecPoint,
31  size_t universeNum);
33  std::vector<cmf::Location> & vecLoc);
34 
35  void Initialize(fhicl::ParameterSet const& pset);
36 
37  void FillPoissonSpectrum(std::vector<float>& spectrum,
38  std::vector<float>& poissonSpectrum);
39 
41  unsigned int uNumber);
42 
43  private:
44 
46 
48 
49  void PoissonSpectrumBinByBin(std::vector<float>& spectrum,
50  std::vector<float>& poissonSpectrum);
52 
53  TRandom3 fRand; ///< RNG for picking the variation in parameters
54  TH2D* fSystDrawHist; ///< keep track of the systematic parameter values
55  TH2D* fOscParamDrawHist; ///< keep track of the oscillation parameter values
56  bool fPoissonFluctuate; ///< do we want to poisson fluctuate the FD prediction?
57  bool fPoissonByHist; ///< use histogram method for picking poisson numbers
58  bool fPoissonByBin; ///< use bin by bin method for picking poisson numbers
59  unsigned int fNumUniverses; ///< number of fake universes to create
60  };
61 
62  //----------------------------------------------------------------------------
63  // The calibration and light level systematic uncertainties are
64  // really only defined for a 1 sigma shift because their excursions
65  // are calculated from special data sets with the shift applied
66  // Also pull them from a uniform distribution as they are definitely
67  // not Gaussian.
69  {
70  return (name.find("lightmodel") != std::string::npos ||
71  name.find("ckv-proton") != std::string::npos ||
72  name.find("Calibration") != std::string::npos ||
73  name.find("fluxpca") != std::string::npos);
74  }
75 }
76 
77 
78 #endif //CMF_UTILITIES_CMFRANDOMUNIVERSEUTILITIES_H
const XML_Char * name
Definition: expat.h:151
void Initialize(fhicl::ParameterSet const &pset)
TH2D * fSystDrawHist
keep track of the systematic parameter values
void FillPoissonSpectrum(std::vector< float > &spectrum, std::vector< float > &poissonSpectrum)
void CreateLocationWithVariedOscParameters(cmf::Location const &nominalPoint, cmf::Location &vecPoint, size_t universeNum)
void CreateLocationWithVariedSystematics(cmf::Location const &nominalLoc, cmf::Location &vecLoc, size_t universeNum)
unsigned int fNumUniverses
number of fake universes to create
void MakeUniverseHistograms(cmf::FakeUniverse &fakeU, unsigned int uNumber)
Module to combine a set of results into a single file currently only does one data product type at a ...
Definition: Event.cxx:24
bool fPoissonByBin
use bin by bin method for picking poisson numbers
void CreateLocationsWithVariedSystematics(cmf::Location const &nominalLoc, std::vector< cmf::Location > &vecLocs)
static RandomUniverseUtility * Instance()
TH2D * fOscParamDrawHist
keep track of the oscillation parameter values
bool UniformDrawParameters(std::string const &name)
void PoissonSpectrumBinByBin(std::vector< float > &spectrum, std::vector< float > &poissonSpectrum)
bool fPoissonByHist
use histogram method for picking poisson numbers
TRandom3 fRand
RNG for picking the variation in parameters.
bool fPoissonFluctuate
do we want to poisson fluctuate the FD prediction?
void CreateLocationsWithVariedOscParameters(cmf::Location const &nominalLoc, std::vector< cmf::Location > &vecLoc)
enum BeamMode string