StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StjTowerEnergyListCut.cxx
1 // $Id: StjTowerEnergyListCut.cxx,v 1.1 2008/11/27 07:35:31 tai Exp $
2 // Copyright (C) 2008 Tai Sakuma <sakuma@bnl.gov>
3 #include "StjTowerEnergyListCut.h"
4 
5 ClassImp(StjTowerEnergyListCut)
6 
7 using namespace std;
8 
9 StjTowerEnergyList StjTowerEnergyListCut::operator()(const StjTowerEnergyList &energyList)
10 {
11  StjTowerEnergyList ret;
12 
13  for(StjTowerEnergyList::const_iterator it = energyList.begin(); it != energyList.end(); ++it) {
14 
15  if(shouldNotKeep(*it)) continue;
16 
17  ret.push_back(*it);
18 
19  }
20 
21  return ret;
22 }
23 
24 
25 bool StjTowerEnergyListCut::shouldNotKeep(const StjTowerEnergy& energyDeposit)
26 {
27  for(CutList::iterator cut = _cutList.begin(); cut != _cutList.end(); ++cut){
28  if((**cut)(energyDeposit)) return true;
29  }
30 
31  return false;
32 }