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

Diff of /PamCut/Collections/EffRigCollection/EffRigCollection.cpp

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

revision 1.5 by pam-fi, Tue Oct 27 10:18:54 2009 UTC revision 1.7 by pam-fi, Thu Mar 18 14:40:51 2010 UTC
# Line 34  extern "C" { Line 34  extern "C" {
34  bool efficiency_(Int_t* sel, Int_t* det, Double_t* eff, Double_t* errLow, Double_t* errHigh);  bool efficiency_(Int_t* sel, Int_t* det, Double_t* eff, Double_t* errLow, Double_t* errHigh);
35  }  }
36    
37  EffRigCollection::EffRigCollection(const char *collectionName, TString outFileBase, TString rigBinsFile, int errMethod, bool owns) :  EffRigCollection::EffRigCollection(const char *collectionName, TString outFileBase, TString rigBinsFile, int errMethod,
38    EffCollection(collectionName, outFileBase, errMethod, owns), _bins(0), _selVector(0), _detVector(0), _outUp(0), _outDown(0) {      bool owns) :
39      EffCollection(collectionName, outFileBase, errMethod, owns), _bins(0), _selVector(0), _detVector(0), _outUp(0),
40          _outDown(0) {
41    
42    ifstream rigBinListFile;    ifstream rigBinListFile;
43    rigBinListFile.open(rigBinsFile);    rigBinListFile.open(rigBinsFile);
# Line 117  void EffRigCollection::Finalize() { Line 119  void EffRigCollection::Finalize() {
119    errGraph.SetMarkerStyle(7);    errGraph.SetMarkerStyle(7);
120    errGraph.GetYaxis()->SetRangeUser(0, 1.2);    errGraph.GetYaxis()->SetRangeUser(0, 1.2);
121    
   
122    if (_errMethod == EFFERR_ROOT) {    if (_errMethod == EFFERR_ROOT) {
123      double binning[_bins.size()];      double binning[_bins.size()];
124      for (unsigned int i = 0; i < _bins.size(); i++)      for (unsigned int i = 0; i < _bins.size(); i++)
# Line 173  void EffRigCollection::Finalize() { Line 174  void EffRigCollection::Finalize() {
174      outTextFile.precision(newPrec);      outTextFile.precision(newPrec);
175      outTextFile.setf(ios::fixed, ios::floatfield);      outTextFile.setf(ios::fixed, ios::floatfield);
176      for (unsigned int i = 0; i < _selVector.size(); i++) {      for (unsigned int i = 0; i < _selVector.size(); i++) {
177        outTextFile << setw(10) << _bins[i] << setw(10) << _bins[i + 1] << setw(10) << _detVector[i] << setw(10)        outTextFile << setw(10) << _bins[i] << " " << setw(10) << _bins[i + 1] << " " << setw(10) << _detVector[i] << " "
178            << _selVector[i];            << setw(10) << _selVector[i] << " ";
179        if (_selVector[i] != 0)        if (_selVector[i] != 0)
180          outTextFile << setw(10) << eff[i] << setw(10) << errLow[i] << setw(10) << errHigh[i] << "\n";          outTextFile << setw(10) << eff[i] << " " << setw(10) << errLow[i] << " " << setw(10) << errHigh[i];
181        else        else
182          outTextFile << setw(10) << 0. << setw(10) << 0. << setw(10) << 0.;          outTextFile << setw(10) << 0. << " " << setw(10) << 0. << " " << setw(10) << 0.;
183        if (i < _selVector.size() - 1) //Avoids to print an empty line at the end of the file        if (i < _selVector.size() - 1) //Avoids to print an empty line at the end of the file
184          outTextFile << endl;          outTextFile << endl;
185    

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

  ViewVC Help
Powered by ViewVC 1.1.23