# | Line 29 | Line 29 | TH1F* eff(TH1F* h1, TH1F* h2, const char | |
---|---|---|
29 | TH1F* temp = (TH1F*) h1->Clone(name); | |
30 | temp->SetTitle(name); | |
31 | temp->Reset(); | |
32 | < | temp->Sumw2(); |
32 | > | if (!temp->GetSumw2N()) |
33 | > | temp->Sumw2(); |
34 | ||
35 | // Do the calculation | |
36 | temp->Divide(h2, h1, 1., 1., "B"); | |
# | Line 52 | Line 53 | TH1F* eff(const char* name1, const char* | |
53 | TH1F* h2 = 0; | |
54 | TString str1 = Form("%s", name1); | |
55 | TString str2 = Form("%s", name2); | |
56 | < | while (obj = iter->Next()) { |
56 | > | while ((obj = iter->Next())) { |
57 | TString objName = obj->GetName(); | |
58 | if (objName == str1) h1 = (TH1F*) obj; | |
59 | if (objName == str2) h2 = (TH1F*) obj; |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |