-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDoSysErr.C
More file actions
34 lines (29 loc) · 821 Bytes
/
Copy pathDoSysErr.C
File metadata and controls
34 lines (29 loc) · 821 Bytes
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
{
char name[100];
float nb[31], nc[31], rbc[31];
TFile *fout = new TFile("OutSysErr.root","RECREATE");
TTree *stree = new TTree("stree","stree");
stree->Branch("nb",&nb,"nb[31]/F");
stree->Branch("nc",&nc,"nc[31]/F");
stree->Branch("rbc",&rbc,"rbc[31]/F");
TH1D *hebrig, *hecrig, *hebcrig;
for(int i=0; i<500; i++)
{
sprintf(name,"output%d.root",i);
cout<<"Reading file: "<<name<<endl;
TFile fin(name,"READ");
if(fin.IsZombie()) continue;
hebrig = (TH1D*)fin.Get("hebrig");
hecrig = (TH1D*)fin.Get("hecrig");
hebcrig = (TH1D*)fin.Get("hebcrig");
for(int j=1; j<=31; j++)
{
nb[j] = hebrig->GetBinContent(j);
nc[j] = hecrig->GetBinContent(j);
rbc[j] = hebcrig->GetBinContent(j);
}
stree->Fill();
}
fout->Write();
fout->Close();
}