/[PAMELA software]/PamCut/MiscCuts/OBTPktNumCut/OBTPktNumCut.cpp
ViewVC logotype

Diff of /PamCut/MiscCuts/OBTPktNumCut/OBTPktNumCut.cpp

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

revision 1.1.2.2 by pam-fi, Wed Nov 30 17:02:41 2011 UTC revision 1.2 by pam-fi, Thu Jul 8 14:00:11 2010 UTC
# Line 7  Line 7 
7    
8  #include "OBTPktNumCut.h"  #include "OBTPktNumCut.h"
9    
10  OBTPktNumCut::OBTPktNumCut(const char *cutName, vector<pair<unsigned int, unsigned int> > &list, bool verbose) :  OBTPktNumCut::OBTPktNumCut(const char *cutName, vector<pair<unsigned int, unsigned int> > &list) :
11    PamCut(cutName), _list(list), _verbose(verbose) {    PamCut(cutName), _list(list) {
   
12  }  }
13    
14  OBTPktNumCut::OBTPktNumCut(const char *cutName, TString listFileName) :  OBTPktNumCut::OBTPktNumCut(const char *cutName, TString listFileName) :
# Line 36  int OBTPktNumCut::Check(PamLevel2 *event Line 35  int OBTPktNumCut::Check(PamLevel2 *event
35    unsigned int pktNum = event->GetOrbitalInfo()->pkt_num;    unsigned int pktNum = event->GetOrbitalInfo()->pkt_num;
36    
37    vector<pair<unsigned int, unsigned int> >::iterator currPair = _list.begin();    vector<pair<unsigned int, unsigned int> >::iterator currPair = _list.begin();
38    while (currPair->first != OBT || currPair->second != pktNum) {    while (currPair->first != OBT && currPair->second != pktNum){
39      currPair++;      currPair++;
40      if (currPair > _list.end())      if (currPair > _list.end())
41        return 0; // Event not found in the list        return 0; // Event not found in the list
42    }    }
43    
44    _list.erase(currPair); // Don't search anymore for the current pair (already found)    _list.erase(currPair); // Don't search anymore for the current pair (already found)
   if (_verbose) {  
     cout << "** " << GetName() << ": event found. OBT: " << OBT << ", pktNum: " << pktNum << endl;  
   }  
45    
46    return CUTOK;    return CUTOK;
47  }  }

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

  ViewVC Help
Powered by ViewVC 1.1.23