#include <NuFCExperiment.h>
Public Member Functions | |
| NuFCExperiment (UInt_t id, const NuMatrixSpectrum &pdf, TRandom3 *rgen=0) | |
| Creates the experiment. Note: The passed in PDF is used to set the correct POT, and for the average eventcount. So make sure that it is set up correctly. | |
| NuFCExperiment (UInt_t id, const NuMatrixSpectrum &fdNQ, const NuMatrixSpectrum &fdPQ) | |
| Creates the experiment from existing spectra. This creates a NuFCExperiment, but from an existing NuMatrixSpectrum pair. | |
| virtual | ~NuFCExperiment () |
| const NuMatrixSpectrum & | GetPQSpectrum () const |
| Retrieves the experiments PQ spectrum. | |
| const NuMatrixSpectrum & | GetNQSpectrum () const |
| Retrieves a blank spectrum, with the correct POT. | |
| const std::string & | GetName () const |
| Retrieves the experiments name. | |
Private Member Functions | |
| void | GenerateExperiment (const NuMatrixSpectrum &pdf) |
| Actually does the calculation to make a random experiment. | |
| void | SetId (UInt_t id) |
| Sets the ID, and generates the histogram name. | |
| ClassDef (NuFCExperiment, 0) | |
Private Attributes | |
| NuMatrixSpectrum | fPQHist |
| The experiments spectrum. | |
| NuMatrixSpectrum | fNQHist |
| TRandom * | fRandy |
| Pointer to the random number generator. | |
| UInt_t | fId |
| Numeric ID of this experiment. | |
| std::string | fName |
| String name of this experiment. | |
Definition at line 29 of file NuFCExperiment.h.
|
||||||||||||||||
|
Creates the experiment. Note: The passed in PDF is used to set the correct POT, and for the average eventcount. So make sure that it is set up correctly.
Definition at line 22 of file NuFCExperiment.cxx. References fRandy, GenerateExperiment(), and SetId(). 00024 : fPQHist(pdf), fNQHist(pdf.PoT()), fRandy(rgen), fId(id) 00025 { 00026 // Check if our random number generator is correctly setup 00027 if (!fRandy) { 00028 // If not, just use gRandom 00029 fRandy = gRandom; 00030 } 00031 00032 // Set our ID, and build the name 00033 SetId(id); 00034 00035 // Now, fill our histogram 00036 GenerateExperiment(pdf); 00037 }
|
|
||||||||||||||||
|
Creates the experiment from existing spectra. This creates a NuFCExperiment, but from an existing NuMatrixSpectrum pair.
Definition at line 41 of file NuFCExperiment.cxx. References SetId(). 00043 : fPQHist(fdPQ), fNQHist(fdNQ), fRandy(0), fId(id) 00044 { 00045 // Reset the histogram names 00046 SetId(id); 00047 }
|
|
|
Definition at line 48 of file NuFCExperiment.h. 00048 {}
|
|
||||||||||||
|
|
|
|
Actually does the calculation to make a random experiment.
Definition at line 52 of file NuFCExperiment.cxx. References fPQHist, fRandy, NuMatrixSpectrum::Integral(), and NuMatrixSpectrum::Spectrum(). Referenced by NuFCExperiment(). 00053 {
00054 // Get the average events by integrating the PDF
00055 Double_t average_events = pdf.Spectrum()->Integral();
00056
00057 // Get the number of events to generate
00058 Int_t nevents = fRandy->Poisson(average_events);
00059
00060 // cout << "Average Events: " << average_events << ", This: " << nevents << endl;
00061
00062 // Scale our copy of the histogram to zero, so we have a blank,
00063 // correctly binned histogram
00064 fPQHist.Spectrum()->Scale(0);
00065 fPQHist.Spectrum()->SetDirectory(0);
00066
00067 // Fill our histogram with random events
00068 fPQHist.Spectrum()->FillRandom(pdf.Spectrum(), nevents);
00069 }
|
|
|
Retrieves the experiments name.
Definition at line 56 of file NuFCExperiment.h. 00056 { return fName; }
|
|
|
Retrieves a blank spectrum, with the correct POT.
Definition at line 53 of file NuFCExperiment.h. Referenced by NuFCFitter::NuFCFitter(). 00053 { return fNQHist; }
|
|
|
Retrieves the experiments PQ spectrum.
Definition at line 51 of file NuFCExperiment.h. Referenced by NuFCFitter::NuFCFitter(). 00051 { return fPQHist; }
|
|
|
Sets the ID, and generates the histogram name.
Definition at line 73 of file NuFCExperiment.cxx. References fId, fName, fPQHist, NuMatrixSpectrum::SetName(), and NuMatrixSpectrum::Spectrum(). Referenced by NuFCExperiment(). 00074 {
00075 // Assign the id..
00076 fId = id;
00077
00078 // Now, make the name
00079 ostringstream expname;
00080 expname << "fchist_" << fId;
00081 fName = expname.str();
00082
00083 expname << "_PQ";
00084 // Set the histograms name
00085 fPQHist.Spectrum()->SetName(expname.str().c_str());
00086
00087 // Now do NQ
00088 // ostringstream expnameNQ;
00089 // expnameNQ << "fchist_" << fId << "_NQ";
00090 // fNQHist.Spectrum()->SetName(expnameNQ.str().c_str());
00091 }
|
|
|
Numeric ID of this experiment.
Definition at line 71 of file NuFCExperiment.h. Referenced by SetId(). |
|
|
String name of this experiment.
Definition at line 73 of file NuFCExperiment.h. Referenced by SetId(). |
|
|
Definition at line 67 of file NuFCExperiment.h. |
|
|
The experiments spectrum.
Definition at line 66 of file NuFCExperiment.h. Referenced by GenerateExperiment(), and SetId(). |
|
|
Pointer to the random number generator.
Definition at line 69 of file NuFCExperiment.h. Referenced by GenerateExperiment(), and NuFCExperiment(). |
1.3.9.1