// Program to study various type of averages // Glen Cowan // RHUL Physics // Feb 2018 #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "Prof.h" #include "fitPar.h" using namespace std; int main(int argc, char **argv) { // Create a TRandom3 object to generate random numbers int seed = 12345; TRandom3* ran = new TRandom3(seed); // used for gamma distribution random sampling (from Will B.) ROOT::Math::Random* rgsl = new ROOT::Math::Random(); rgsl->SetSeed(431155); // read in data by creating Prof object string infile = "inputData.txt"; Prof* prof = new Prof(infile); int N = prof->N(); int M = prof->M(); prof->fit(M); double epl = prof->getEplus(); double emi = prof->getEminus(); double epa = prof->getEparab(); double minosave = 0.5 * (epl + abs(emi)); vector parVec = prof->parVec(); double muHat = parVec[0]; vector sigParVec = prof->sigParVec(); double sigmaMuHat = sigParVec[0]; cout << "muHat = " << muHat << " +- " << sigmaMuHat << endl; cout << "minos Ave err = " << minosave << endl; return 0; }