/[PAMELA software]/PamCut/Collections/EffCollection/EffCollection.cpp
ViewVC logotype

Diff of /PamCut/Collections/EffCollection/EffCollection.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by pam-fi, Thu Sep 24 18:17:28 2009 UTC revision 1.6 by pam-fi, Fri Sep 25 15:02:03 2009 UTC
# Line 8  Line 8 
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    
# Line 63  void EffCollection::Finalize() { Line 64  void EffCollection::Finalize() {
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";

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

  ViewVC Help
Powered by ViewVC 1.1.23