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

Diff of /PamCut/TrkCuts/TrkSigmaDeflCut/TrkSigmaDeflCut.cpp

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

revision 1.1 by pam-fi, Wed May 27 13:30:09 2009 UTC revision 1.2 by pam-fi, Mon May 3 14:37:16 2010 UTC
# Line 5  Line 5 
5   *      Author: S. Ricciarini   *      Author: S. Ricciarini
6   */   */
7    
8  /*! @file TrkSigmaDeflCut.cpp The TrkRigGeoCut class implementation file */  /*! @file TrkSigmaDeflCut.cpp The TrkRigGeoCut class implementation file. */
9    
10  #include "TrkSigmaDeflCut.h"  #include "TrkSigmaDeflCut.h"
11    
12  TrkSigmaDeflCut::TrkSigmaDeflCut(const char *cutName, const char* rigBinListFileName) :  TrkSigmaDeflCut::TrkSigmaDeflCut(const char *cutName, const char* rigBinListFileName, float sigmaDeflFactor) :
13      PamCut(cutName), _binning(0) {    PamCut(cutName), _binning(0), _sigmaDeflFactor(sigmaDeflFactor) {
14    
15      ifstream rigBinList;    ifstream rigBinList;
16      rigBinList.open(rigBinListFileName);    rigBinList.open(rigBinListFileName);
17      TString bin;    TString bin;
18    
19      while (!rigBinList.eof()) {    while (!rigBinList.eof()) {
20        rigBinList >> bin;      rigBinList >> bin;
21        if (bin != "") {      if (bin != "") {
22          _binning.push_back(bin.Atof());        _binning.push_back(bin.Atof());
23  #ifdef DEBUGPAMCUT  #ifdef DEBUGPAMCUT
24          cout << "Bin: " << bin.Atof() << endl;        cout << "Bin: " << bin.Atof() << endl;
25  #endif  #endif
       }  
26      }      }
27      }
28    
29      rigBinList.close();    rigBinList.close();
30    
31  #ifdef DEBUGPAMCUT  #ifdef DEBUGPAMCUT
32      cout << "\nNumber of bins: " << _binning.size() << endl;    cout << "\nNumber of bins: " << _binning.size() << endl;
33  #endif  #endif
34    }  }
35    
36  int TrkSigmaDeflCut::Check(PamLevel2 *event) {  int TrkSigmaDeflCut::Check(PamLevel2 *event) {
37    
38    TrkTrack *trkTrack = event->GetTrack(0)->GetTrkTrack();    TrkTrack *trkTrack = event->GetTrack(0)->GetTrkTrack();
39    
40    float sigmaDefl = pow(trkTrack->coval[4][4],0.5);    float sigmaDefl = pow(trkTrack->coval[4][4], 0.5);
41    float rigMod = trkTrack->GetRigidity();    float rigMod = trkTrack->GetRigidity();
42    
 //  cout << "sigmaDefl: " << sigmaDefl << endl;  
 //  cout << "rigMod: " << rigMod << endl;  
   
43    // check on overall binning interval    // check on overall binning interval
44    if (rigMod >= _binning[_binning.size() - 1] || rigMod < _binning[0]) {    if (rigMod >= _binning[_binning.size() - 1] || rigMod < _binning[0]) {
45      return 0;      return 0;
# Line 54  int TrkSigmaDeflCut::Check(PamLevel2 *ev Line 51  int TrkSigmaDeflCut::Check(PamLevel2 *ev
51      i++;      i++;
52    }    }
53    
54  //  cout << "binmax: " << _binning[i] << endl;    if (!(sigmaDefl * _sigmaDeflFactor < 1. / _binning[i])) { // required condition: sigma_defl * _sigmaFactor < |defl_min(bin)| = 1./|rig_max(bin)| = 1./_binning[i]
   
   if ( ! ( sigmaDefl < 1./_binning[i]) ) { // required condition: sigma_defl < |defl_min(bin)| = 1./|rig_max(bin)| = 1./_binning[i]  
55      return 1;      return 1;
56    }    }
57    
 //  cout << "OK" << endl;  
 //  cout << endl;  
   
58    return CUTOK;    return CUTOK;
59  }  }

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

  ViewVC Help
Powered by ViewVC 1.1.23