StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
mikesEventCut.cxx
1 /***************************************************************************
2  *
3  * $Id: mikesEventCut.cxx,v 1.7 2000/02/18 21:27:10 laue Exp $
4  *
5  * Author: Mike Lisa, Ohio State, lisa@mps.ohio-state.edu
6  ***************************************************************************
7  *
8  * Description: part of STAR HBT Framework: StHbtMaker package
9  * A simple event-wise cut that selects on multiplicity and z-position
10  * of primary vertex
11  *
12  ***************************************************************************
13  *
14  * $Log: mikesEventCut.cxx,v $
15  * Revision 1.7 2000/02/18 21:27:10 laue
16  * franksTrackCut changed. If mCharge is set to '0' there will be no cut
17  * on charge. This is important for front-loaded cuts.
18  *
19  * Revision 1.6 2000/01/25 17:35:02 laue
20  * I. In order to run the stand alone version of the StHbtMaker the following
21  * changes have been done:
22  * a) all ClassDefs and ClassImps have been put into #ifdef __ROOT__ statements
23  * b) unnecessary includes of StMaker.h have been removed
24  * c) the subdirectory StHbtMaker/doc/Make has been created including everything
25  * needed for the stand alone version
26  *
27  * II. To reduce the amount of compiler warning
28  * a) some variables have been type casted
29  * b) some destructors have been declared as virtual
30  *
31  * Revision 1.5 1999/10/15 01:57:03 lisa
32  * Important enhancement of StHbtMaker - implement Franks CutMonitors
33  * ----------------------------------------------------------
34  * This means 3 new files in Infrastructure area (CutMonitor),
35  * several specific CutMonitor classes in the Cut area
36  * and a new base class in the Base area (StHbtCutMonitor).
37  * This means also changing all Cut Base class header files from .hh to .h
38  * so we have access to CutMonitor methods from Cint command line.
39  * This last means
40  * 1) files which include these header files are slightly modified
41  * 2) a side benefit: the TrackCuts and V0Cuts no longer need
42  * a SetMass() implementation in each Cut class, which was stupid.
43  * Also:
44  * -----
45  * Include Franks StHbtAssociationReader
46  * ** None of these changes should affect any user **
47  *
48  * Revision 1.4 1999/07/24 16:24:20 lisa
49  * adapt StHbtMaker to dev version of library - solaris still gives problems with strings
50  *
51  * Revision 1.3 1999/07/19 14:24:04 hardtke
52  * modifications to implement uDST
53  *
54  * Revision 1.2 1999/07/06 22:33:21 lisa
55  * Adjusted all to work in pro and new - dev itself is broken
56  *
57  * Revision 1.1.1.1 1999/06/29 16:02:56 lisa
58  * Installation of StHbtMaker
59  *
60  **************************************************************************/
61 
62 #include "StHbtMaker/Cut/mikesEventCut.h"
63 #include <cstdio>
64 
65 #ifdef __ROOT__
66 ClassImp(mikesEventCut)
67 #endif
68 
69 mikesEventCut::mikesEventCut(){
70  mNEventsPassed = mNEventsFailed = 0;
71 }
72 //------------------------------
73 //mikesEventCut::~mikesEventCut(){
74 // /* noop */
75 //}
76 //------------------------------
77 bool mikesEventCut::Pass(const StHbtEvent* event){
78  int mult = event->NumberOfTracks();
79  double VertexZPos = event->PrimVertPos().z();
80  cout << "mikesEventCut:: mult: " << mEventMult[0] << " < " << mult << " < " << mEventMult[1] << endl;
81  cout << "mikesEventCut:: VertexZPos: " << mVertZPos[0] << " < " << VertexZPos << " < " << mVertZPos[1] << endl;
82  bool goodEvent =
83  ((mult > mEventMult[0]) &&
84  (mult < mEventMult[1]) &&
85  (VertexZPos > mVertZPos[0]) &&
86  (VertexZPos < mVertZPos[1]));
87  goodEvent ? mNEventsPassed++ : mNEventsFailed++ ;
88  cout << "mikesEventCut:: return : " << goodEvent << endl;
89  return (goodEvent);
90 }
91 //------------------------------
92 StHbtString mikesEventCut::Report(){
93  string Stemp;
94  char Ctemp[100];
95  sprintf(Ctemp,"\nMultiplicity:\t %d-%d",mEventMult[0],mEventMult[1]);
96  Stemp = Ctemp;
97  sprintf(Ctemp,"\nVertex Z-position:\t %E-%E",mVertZPos[0],mVertZPos[1]);
98  Stemp += Ctemp;
99  sprintf(Ctemp,"\nNumber of events which passed:\t%ld Number which failed:\t%ld",mNEventsPassed,mNEventsFailed);
100  Stemp += Ctemp;
101  StHbtString returnThis = Stemp;
102  return returnThis;
103 }