/[PAMELA software]/PamCut/TrkCuts/RigFillCut/RigFillCut.cpp
ViewVC logotype

Diff of /PamCut/TrkCuts/RigFillCut/RigFillCut.cpp

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

revision 1.1 by pam-fi, Wed May 27 13:30:08 2009 UTC revision 1.2 by pam-fi, Wed Jun 10 12:44:55 2009 UTC
# Line 9  Line 9 
9    
10  #include "RigFillCut.h"  #include "RigFillCut.h"
11    
12    RigFillCut::RigFillCut(const char *cutName, const char* rigBinListFileName, float thresholdCoeff) :
13      PamCut(cutName), _binning(0), _histogram(0, 0, 0), _thresholdCoeff(thresholdCoeff) {
14    
15      ifstream rigBinList;
16      rigBinList.open(rigBinListFileName);
17      TString bin;
18    
19      while (!rigBinList.eof()) {
20        rigBinList >> bin;
21        if (bin != "") {
22          _binning.push_back(bin.Atof());
23    #ifdef DEBUGPAMCUT
24          cout << "Bin: " << bin.Atof() << endl;
25    #endif
26        }
27      }
28    
29      rigBinList.close();
30    
31      _histogram.Resize(_binning.size() - 1, _binning.size() - 1, 0);
32    
33    #ifdef DEBUGPAMCUT
34      cout << "\nNumber of bins: " << _binning.size() << endl;
35    #endif
36    }
37    
38  int RigFillCut::Check(PamLevel2 *event) {  int RigFillCut::Check(PamLevel2 *event) {
39    
40    float rigThreshold = _thresholdCoeff * event->GetOrbitalInfo()->GetCutoffSVL();    float rigThreshold = _thresholdCoeff * event->GetOrbitalInfo()->GetCutoffSVL();
# Line 32  void RigFillCut::OnGood(PamLevel2 *event Line 58  void RigFillCut::OnGood(PamLevel2 *event
58    float rig = event->GetTrack(0)->GetTrkTrack()->GetRigidity();    float rig = event->GetTrack(0)->GetTrkTrack()->GetRigidity();
59    
60    //Bin identification: value must be less than (<) bin maximum    //Bin identification: value must be less than (<) bin maximum
61      
62    int i = 1;    int i = 1;
63    while (rig >= _binning[i]) {    while (rig >= _binning[i]) {
64      i++;      i++;
65    }    }
66    i--;    i--;
67    
68  //  cout << _binning[i] << " < " <<  rig  << " < " << _binning[i+1] << endl;    //  cout << _binning[i] << " < " <<  rig  << " < " << _binning[i+1] << endl;
69    
70    int j = 1;    int j = 1;
71    while (rigThreshold >= _binning[j]) {    while (rigThreshold >= _binning[j]) {
# Line 47  void RigFillCut::OnGood(PamLevel2 *event Line 73  void RigFillCut::OnGood(PamLevel2 *event
73    }    }
74    j--;    j--;
75    
76  //  cout << _binning[j] << " < " <<  rigCutoff  << " < " << _binning[j+1] << endl;    //  cout << _binning[j] << " < " <<  rigCutoff  << " < " << _binning[j+1] << endl;
77  //  cout << endl;    //  cout << endl;
78    
79    _histogram[i][j]++;    _histogram[i][j]++;
80  }  }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.23