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