StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
helensEventCut.cxx
1 /***************************************************************************
2  *
3  * $Id: helensEventCut.cxx,v 1.1 2000/10/09 21:56:15 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: helensEventCut.cxx,v $
15  * Revision 1.1 2000/10/09 21:56:15 laue
16  * Helens new cuts
17  *
18  * Revision 1.7 2000/02/18 21:27:10 laue
19  * franksTrackCut changed. If mCharge is set to '0' there will be no cut
20  * on charge. This is important for front-loaded cuts.
21  *
22  * Revision 1.6 2000/01/25 17:35:02 laue
23  * I. In order to run the stand alone version of the StHbtMaker the following
24  * changes have been done:
25  * a) all ClassDefs and ClassImps have been put into #ifdef __ROOT__ statements
26  * b) unnecessary includes of StMaker.h have been removed
27  * c) the subdirectory StHbtMaker/doc/Make has been created including everything
28  * needed for the stand alone version
29  *
30  * II. To reduce the amount of compiler warning
31  * a) some variables have been type casted
32  * b) some destructors have been declared as virtual
33  *
34  * Revision 1.5 1999/10/15 01:57:03 lisa
35  * Important enhancement of StHbtMaker - implement Franks CutMonitors
36  * ----------------------------------------------------------
37  * This means 3 new files in Infrastructure area (CutMonitor),
38  * several specific CutMonitor classes in the Cut area
39  * and a new base class in the Base area (StHbtCutMonitor).
40  * This means also changing all Cut Base class header files from .hh to .h
41  * so we have access to CutMonitor methods from Cint command line.
42  * This last means
43  * 1) files which include these header files are slightly modified
44  * 2) a side benefit: the TrackCuts and V0Cuts no longer need
45  * a SetMass() implementation in each Cut class, which was stupid.
46  * Also:
47  * -----
48  * Include Franks StHbtAssociationReader
49  * ** None of these changes should affect any user **
50  *
51  * Revision 1.4 1999/07/24 16:24:20 lisa
52  * adapt StHbtMaker to dev version of library - solaris still gives problems with strings
53  *
54  * Revision 1.3 1999/07/19 14:24:04 hardtke
55  * modifications to implement uDST
56  *
57  * Revision 1.2 1999/07/06 22:33:21 lisa
58  * Adjusted all to work in pro and new - dev itself is broken
59  *
60  * Revision 1.1.1.1 1999/06/29 16:02:56 lisa
61  * Installation of StHbtMaker
62  *
63  **************************************************************************/
64 
65 #include "StHbtMaker/Cut/helensEventCut.h"
66 #include <cstdio>
67 
68 #ifdef __ROOT__
69 ClassImp(helensEventCut)
70 #endif
71 
72 helensEventCut::helensEventCut(){
73  mNEventsPassed = mNEventsFailed = 0;
74  mV0Mult[0] =-10;
75  mV0Mult[1] = 100000;
76  mTrkV0MatchCollection = new StHbtTrkV0MatchCollection;
77 }
78 //------------------------------
79 //helensEventCut::~helensEventCut(){
80 // /* noop */
81 //}
82 //------------------------------
83 bool helensEventCut::Pass(const StHbtEvent* event){
84 
85  int v0Mult=0;
86  int mult = event->NumberOfTracks();
87  if( event->V0Collection()){
88  v0Mult= event->V0Collection()->size();
89  }
90  double VertexZPos = event->PrimVertPos().z();
91  cout << "helensEventCut:: mult: " << mEventMult[0] << " < " << mult << " < " << mEventMult[1] << endl;
92  cout << "helensEventCut:: VertexZPos: " << mVertZPos[0] << " < " << VertexZPos << " < " << mVertZPos[1] << endl;
93  cout << "helensEventCut:: V0Mult: " << mV0Mult[0] << " < " << v0Mult << " < " << mV0Mult[1] << endl;
94  bool goodEvent =
95  ((mult > mEventMult[0]) &&
96  (mult < mEventMult[1]) &&
97  (VertexZPos > mVertZPos[0]) &&
98  (VertexZPos < mVertZPos[1]) &&
99  (v0Mult > mV0Mult[0]) &&
100  (v0Mult < mV0Mult[1]));
101  goodEvent ? mNEventsPassed++ : mNEventsFailed++ ;
102 
103 
104  // Delete list from previous event
105 
106 
107  StHbtTrkV0Iterator pIter;
108  if( TrkV0MatchCollection()->size() > 0){
109  for( pIter=TrkV0MatchCollection()->begin(); pIter!=TrkV0MatchCollection()->end();
110  pIter++){
111  delete *pIter;
112  }
113 
114  TrkV0MatchCollection()->clear();
115  }
116 
117  // Now build list for this event. There is one entry in list per track
118 
119  StHbtTrackIterator TrkIter;
120  StHbtTrack* pParticle;
121 
122  for( TrkIter=event->TrackCollection()->begin(); TrkIter!=event->TrackCollection()->end(); TrkIter++){
123 
124  pParticle = *TrkIter;
125  StHbtTrkV0Match* TrackV0Match = new StHbtTrkV0Match;
126  TrackV0Match->SetTrkId( pParticle->TrackId());
127  TrackV0Match->SetdEdx( pParticle->dEdx());
128  TrackV0Match->SetUsed(0);
129  TrkV0MatchCollection()->push_back(TrackV0Match);
130 
131  }
132 
133  cout << "TrkV0MatchCollection Size= " << TrkV0MatchCollection()->size() << endl;
134  cout << "helensEventCut:: return : " << goodEvent << endl;
135  return (goodEvent);
136 }
137 //------------------------------
138 StHbtString helensEventCut::Report(){
139  string Stemp;
140  char Ctemp[100];
141  sprintf(Ctemp,"\nMultiplicity:\t %d-%d",mEventMult[0],mEventMult[1]);
142  Stemp = Ctemp;
143  sprintf(Ctemp,"\nVertex Z-position:\t %E-%E",mVertZPos[0],mVertZPos[1]);
144  Stemp += Ctemp;
145  sprintf(Ctemp,"\nV0Multiplicity:\t %d-%d",mV0Mult[0],mV0Mult[1]);
146  Stemp = Ctemp;
147  sprintf(Ctemp,"\nNumber of events which passed:\t%ld Number which failed:\t%ld",mNEventsPassed,mNEventsFailed);
148  Stemp += Ctemp;
149  StHbtString returnThis = Stemp;
150  return returnThis;
151 }