7 |
|
|
8 |
#include "OBTPktNumCut.h" |
#include "OBTPktNumCut.h" |
9 |
|
|
10 |
OBTPktNumCut::OBTPktNumCut(const char *cutName, vector<pair<unsigned int, unsigned int> > &list) : |
OBTPktNumCut::OBTPktNumCut(const char *cutName, vector<pair<unsigned int, unsigned int> > &list, bool verbose) : |
11 |
PamCut(cutName), _list(list) { |
PamCut(cutName), _list(list), _verbose(verbose) { |
12 |
|
|
13 |
} |
} |
14 |
|
|
15 |
OBTPktNumCut::OBTPktNumCut(const char *cutName, TString listFileName) : |
OBTPktNumCut::OBTPktNumCut(const char *cutName, TString listFileName) : |
36 |
unsigned int pktNum = event->GetOrbitalInfo()->pkt_num; |
unsigned int pktNum = event->GetOrbitalInfo()->pkt_num; |
37 |
|
|
38 |
vector<pair<unsigned int, unsigned int> >::iterator currPair = _list.begin(); |
vector<pair<unsigned int, unsigned int> >::iterator currPair = _list.begin(); |
39 |
while (currPair->first != OBT && currPair->second != pktNum){ |
while (currPair->first != OBT || currPair->second != pktNum) { |
40 |
currPair++; |
currPair++; |
41 |
if (currPair > _list.end()) |
if (currPair > _list.end()) |
42 |
return 0; // Event not found in the list |
return 0; // Event not found in the list |
43 |
} |
} |
44 |
|
|
45 |
_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) |
46 |
|
if (_verbose) { |
47 |
|
cout << "** " << GetName() << ": event found. OBT: " << OBT << ", pktNum: " << pktNum << endl; |
48 |
|
} |
49 |
|
|
50 |
return CUTOK; |
return CUTOK; |
51 |
} |
} |