#include "TFile.h"
#include "TTree.h"
#include "TH1F.h"
#include "TF1.h"
#include "TRegexp.h"
#include "TCanvas.h"
#include <iostream>
Go to the source code of this file.
Definition at line 10 of file getpars.C.
References c1, f, f1, f2, h, mode, printf(), t, and TString.
12 TRegexp regntp(
"n[0-9]+");
14 TString smode = ntp(1,ntp.Length());
15 int mode = smode.Atoi()/10;
17 bool dst = (mode == 11 || mode == 13 || mode == 15);
19 TFile *
f=
new TFile(fname,
"READ");
20 TTree *
t=(TTree*)f->Get(ntp);
22 TCanvas *
c1=
new TCanvas(
"c1",
"c1",800,600);
23 t->Draw(
"xm>>h",
"xmct");
25 TH1F *
h=(TH1F*)gDirectory->Get(
"h");
27 TF1
f1(
"f1",
"gaus(0)");
28 f1.SetParameters(h->GetMaximum(), h->GetMean(), h->GetRMS());
32 printf(
"MEAN = %6.4f SIGMA = %6.4f\n",
f1.GetParameter(1),
f1.GetParameter(2));
36 t->Draw(
"xmdif>>hd",
"xmct");
38 TH1F *hd=(TH1F*)gDirectory->Get(
"hd");
40 TF1
f2(
"f2",
"gaus(0)");
41 f2.SetParameters(hd->GetMaximum(), hd->GetMean(), hd->GetRMS());
45 printf(
"dM: MEAN = %6.4f SIGMA = %6.4f\n",
f2.GetParameter(1),
f2.GetParameter(2));
printf("RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime)