--- PamCut/MiscCuts/OBTPktNumCut/OBTPktNumCut.cpp 2010/06/29 07:47:18 1.1.2.1 +++ PamCut/MiscCuts/OBTPktNumCut/OBTPktNumCut.cpp 2011/11/30 17:02:41 1.1.2.2 @@ -7,8 +7,9 @@ #include "OBTPktNumCut.h" -OBTPktNumCut::OBTPktNumCut(const char *cutName, vector > &list) : - PamCut(cutName), _list(list) { +OBTPktNumCut::OBTPktNumCut(const char *cutName, vector > &list, bool verbose) : + PamCut(cutName), _list(list), _verbose(verbose) { + } OBTPktNumCut::OBTPktNumCut(const char *cutName, TString listFileName) : @@ -35,13 +36,16 @@ unsigned int pktNum = event->GetOrbitalInfo()->pkt_num; vector >::iterator currPair = _list.begin(); - while (currPair->first != OBT && currPair->second != pktNum){ + while (currPair->first != OBT || currPair->second != pktNum) { currPair++; if (currPair > _list.end()) return 0; // Event not found in the list } _list.erase(currPair); // Don't search anymore for the current pair (already found) + if (_verbose) { + cout << "** " << GetName() << ": event found. OBT: " << OBT << ", pktNum: " << pktNum << endl; + } return CUTOK; }