| 8 |
/*! @file EffCollection.cpp The EffCollection class implementation file. */ |
/*! @file EffCollection.cpp The EffCollection class implementation file. */ |
| 9 |
|
|
| 10 |
#include "EffCollection.h" |
#include "EffCollection.h" |
| 11 |
|
#include "TGraphAsymmErrors.h" |
| 12 |
|
|
| 13 |
extern "C" { |
extern "C" { |
| 14 |
bool efficiency_(Int_t*, Int_t*, Double_t*, Double_t*, Double_t*); |
bool efficiency_(Int_t*, Int_t*, Double_t*, Double_t*, Double_t*); |
| 15 |
} |
} |
| 16 |
|
|
| 17 |
EffCollection::EffCollection(const char *collectionName, TString outFileBase) : |
EffCollection::EffCollection(const char *collectionName, TString outFileBase, int errMethod) : |
| 18 |
VerboseCollection(collectionName), _selCollection("selCollection"), _detCollection("detCollection"), _outFileBase( |
VerboseCollection(collectionName), _selCollection("selCollection"), _detCollection("detCollection"), _outFileBase( |
| 19 |
outFileBase), _det(0), _sel(0) { |
outFileBase), _errMethod(errMethod), _det(0), _sel(0) { |
| 20 |
|
|
| 21 |
} |
} |
| 22 |
|
|
| 64 |
Int_t sel = (Int_t) _sel; |
Int_t sel = (Int_t) _sel; |
| 65 |
Int_t det = (Int_t) _det; |
Int_t det = (Int_t) _det; |
| 66 |
Double_t eff, errLow, errHigh; |
Double_t eff, errLow, errHigh; |
| 67 |
efficiency_(&sel, &det, &eff, &errLow, &errHigh); |
if (_errMethod == EFFRIG_ROOT) { |
| 68 |
|
if (sel < 8) { |
| 69 |
|
eff = 1.1; |
| 70 |
|
errLow = errHigh = 0.; |
| 71 |
|
} |
| 72 |
|
else { |
| 73 |
|
TH1I pass("pass", "pass", 1, 0., 1.); |
| 74 |
|
TH1I total("total", "total", 1, 0., 1.); |
| 75 |
|
pass.Fill(0.5, det); |
| 76 |
|
total.Fill(0.5, sel); |
| 77 |
|
TGraphAsymmErrors errGraph; |
| 78 |
|
errGraph.BayesDivide(&pass, &total); |
| 79 |
|
Double_t dummy; |
| 80 |
|
errGraph.GetPoint(0, dummy, eff); |
| 81 |
|
errLow = errGraph.GetErrorYlow(0); |
| 82 |
|
errHigh = errGraph.GetErrorYhigh(0); |
| 83 |
|
} |
| 84 |
|
} |
| 85 |
|
if (_errMethod == EFFRIG_SERGIO) { |
| 86 |
|
efficiency_(&sel, &det, &eff, &errLow, &errHigh); |
| 87 |
|
} |
| 88 |
|
|
| 89 |
// Add some info about efficiency to the stdout |
// Add some info about efficiency to the stdout |
| 90 |
cout << " ****** Efficiency informations ******\n"; |
cout << " ****** Efficiency informations ******\n"; |