-
Notifications
You must be signed in to change notification settings - Fork 2
/
listOutliers.C
65 lines (53 loc) · 2.05 KB
/
listOutliers.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#include "TFile.h"
#include "TTree.h"
#include "TString.h"
#include "RooFitResult.h"
#include "RooArgSet.h"
#include "<fstream>"
void listOutliers(TString infilename)
{
TFile* f = new TFile(infilename);
TTree* t = (TTree*) f->Get("tree_fit_sb");
std::cout << t->GetName() << ", " << t->GetEntries() << std::endl;
Double_t mu, muErr, muLoErr, muHiErr;
TBranch* bmu = t->GetBranch("mu");
TBranch* bmuErr = t->GetBranch("muErr");
TBranch* bmuLoErr = t->GetBranch("muLoErr");
TBranch* bmuHiErr = t->GetBranch("muHiErr");
bmu->SetAddress(&mu);
bmuErr->SetAddress(&muErr);
bmuLoErr->SetAddress(&muLoErr);
bmuHiErr->SetAddress(&muHiErr);
//std::fstream appendfile;
//appendfile.open("outliers.txt", std::fstream::in | std::fstream::out | std::fstream::app );
RooFitResult* rfit_s = f->Get("fit_s");
RooFitResult* rfit_b = f->Get("fit_b");
RooArgSet* rnorm_fit_s = f->Get("norm_fit_s");
RooArgSet* rnorm_fit_b = f->Get("norm_fit_b");
for(int i=0; i<t->GetEntries(); i++)
{
t->GetEvent(i);
if(TMath::Abs(muLoErr) > 20 || TMath::Abs(muHiErr) > 20)
{
std::cout << "\n !!!! FAIL !!!! \n" << std::endl;
}
else
{
std::cout << "\n ++++ PASS ++++ \n" << std::endl;
}
std::cout << Form("[ %s ] :: mu: %6.3f, muLoErr: %6.3f, muHiErr: %6.3f \n", infilename.Data(), mu, muLoErr, muHiErr) << std::endl;
//appendfile << Form("[ %s ] :: mu: %6.3f, muLoErr: %6.3f, muHiErr: %6.3f", infilename.Data(), mu, muLoErr, muHiErr) << std::endl;
std::cout << "fit_s \n" << std::endl;
rfit_s->Print();
std::cout << "fit_s verbose \n" << std::endl;
rfit_s->Print("v");
std::cout << "fit_s correlation M \n" << std::endl;
rfit_s->correlationMatrix().Print();
std::cout << "fit_s covariance M \n" << std::endl;
rfit_s->covarianceMatrix().Print();
//std::cout << "fit_b" << std::endl;
//rfit_b->Print();
break;
}
//appendfile.close();
}