StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StMuCut.h
1 /***************************************************************************
2  *
3  * $Id: StMuCut.h,v 1.6 2004/11/24 19:46:09 jeromel Exp $
4  * Author: Frank Laue, BNL, laue@bnl.gov
5  *
6  ***************************************************************************/
15 #ifndef StMuCut_h
16 #define StMuCut_h
17 
18 #include "TObject.h"
19 
20 class StEvent;
21 class StTrack;
22 class StV0Vertex;
23 class StXiVertex;
24 class StKinkVertex;
25 class StV0MuDst;
26 class StXiMuDst;
27 class StKinkMuDst;
28 
29 class StMuCut : public TObject {
30  public:
31  StMuCut();
32  virtual ~StMuCut() {};
33 
34  bool pass( const StEvent* );
35  bool pass( const StTrack* );
36  bool pass( const StV0Vertex* );
37  bool pass( const StXiVertex* );
38  bool pass( const StKinkVertex* );
39  bool pass( const StV0MuDst* );
40  bool pass( const StXiMuDst* );
41  bool pass( const StKinkMuDst* );
42  protected:
43  virtual bool accept( const StEvent* ) = 0;
44  virtual bool accept( const StTrack* ) = 0;
45  virtual bool accept( const StV0Vertex* ) = 0;
46  virtual bool accept( const StXiVertex* ) = 0;
47  virtual bool accept( const StKinkVertex* ) = 0;
48  virtual bool accept( const StV0MuDst* ) = 0;
49  virtual bool accept( const StXiMuDst* ) = 0;
50  virtual bool accept( const StKinkMuDst* ) = 0;
51 
52  bool leave(bool b, unsigned int counter[2]);
53 
54  // counters for passed and failed calls to cut
55  unsigned int mNStEvent[2];
56  unsigned int mNStTrack[2];
57  unsigned int mNStV0Vertex[2];
58  unsigned int mNStXiVertex[2];
59  unsigned int mNStKinkVertex[2];
60  unsigned int mNStV0MuDst[2];
61  unsigned int mNStXiMuDst[2];
62  unsigned int mNStKinkMuDst[2];
63 
64  ClassDef(StMuCut,1)
65 };
66 
67 inline bool StMuCut::leave(bool b, unsigned int counter[2]) { (b) ? counter[0]++ : counter[1]++; return b; }
68 inline bool StMuCut::pass( const StEvent* e) { return leave( accept(e), mNStEvent ); }
69 inline bool StMuCut::pass( const StTrack* t) { return leave( accept(t), mNStTrack ); }
70 inline bool StMuCut::pass( const StV0Vertex* v) { return leave( accept(v), mNStV0Vertex ); }
71 inline bool StMuCut::pass( const StXiVertex* x) { return leave( accept(x), mNStXiVertex ); }
72 inline bool StMuCut::pass( const StKinkVertex* k) { return leave( accept(k), mNStKinkVertex ); }
73 inline bool StMuCut::pass( const StV0MuDst* v) { return leave( accept(v), mNStV0MuDst ); }
74 inline bool StMuCut::pass( const StXiMuDst* x) { return leave( accept(x), mNStXiMuDst ); }
75 inline bool StMuCut::pass( const StKinkMuDst* k) { return leave( accept(k), mNStKinkMuDst ); }
76 
77 
78 
79 #endif
80 
81 /***************************************************************************
82  *
83  * $Log: StMuCut.h,v $
84  * Revision 1.6 2004/11/24 19:46:09 jeromel
85  * Forgot .h file commit
86  *
87  * Revision 1.5 2004/05/02 04:10:13 perev
88  * private => protected
89  *
90  * Revision 1.4 2003/09/10 22:33:41 perev
91  * Grid for MuDst corrections
92  *
93  * Revision 1.3 2002/09/11 21:02:41 laue
94  * added cut on track encoded method for ITTF
95  *
96  * Revision 1.2 2002/05/04 23:56:29 laue
97  * some documentation added
98  *
99  * Revision 1.1 2002/03/08 17:04:17 laue
100  * initial revision
101  *
102  *
103  **************************************************************************/
bool pass(const StEvent *)
called by user code, returns true if argument passes cuts, else false
Definition: StMuCut.h:68
virtual bool accept(const StEvent *)=0
abstract cut function, has to be overwritten by derived class
bool leave(bool b, unsigned int counter[2])
increment pass/fail counter (2nd argument) depending on 1st argument and return 1st argument ...
Definition: StMuCut.h:67