StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StjMCParticleCutFirstMotherId.h
1 // -*- mode: c++;-*-
2 // $Id: StjMCParticleCutFirstMotherId.h,v 1.1 2008/11/27 07:40:03 tai Exp $
3 // Copyright (C) 2008 Tai Sakuma <sakuma@bnl.gov>
4 #ifndef STJMCPARTICLECUTFIRSTMOTHERID_H
5 #define STJMCPARTICLECUTFIRSTMOTHERID_H
6 
7 #include "StjMCParticleCut.h"
8 
9 #include <set>
10 
12 
13 public:
14  StjMCParticleCutFirstMotherId(int goodFirstMotherId = 1)
15  : _goodFirstMotherIdSet(&goodFirstMotherId, &goodFirstMotherId + 1) { }
16  StjMCParticleCutFirstMotherId(int nGoodFirstMotherIdes, int* goodFirstMotherIdes)
17  : _goodFirstMotherIdSet(goodFirstMotherIdes, goodFirstMotherIdes + nGoodFirstMotherIdes) { }
18  virtual ~StjMCParticleCutFirstMotherId() { }
19 
20  bool operator()(const StjMCParticle& p4)
21  {
22  if( _goodFirstMotherIdSet.count(p4.firstMotherId) == 0 ) return true;
23 
24  return false;
25  }
26 
27 private:
28 
29  std::set<int> _goodFirstMotherIdSet;
31 
32 };
33 
34 #endif // STJMCPARTICLECUTFIRSTMOTHERID_H