StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
mikesStarStandardEventCut.cxx
1 /***************************************************************************
2  *
3  * $Id: mikesStarStandardEventCut.cxx,v 1.1 2000/09/04 16:27:15 lisa 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. This one calculates and then cuts on the number of
11  * negative primary tracks with -0.5<eta<0.5, which is the STAR standard.
12  * The cuts are (copied from StEventUtilities/StuRefMult.hh
13  * primary tracks only
14  * flag > 0
15  * charge < 0
16  * fit points >= 10
17  * abs(eta) < 0.5
18  * dca < 3 cm
19  *
20  * Also, this cut was used to check the correlation between the "old"
21  * HBT multiplicity and the "new" STAR standard multiplicity definition,
22  * by way of an output ASCII file. I have commented this part out, but
23  * just uncomment it in the constructor (where the file is openned) and
24  * in the Pass() method (where the file is written to) and you will get
25  * the file.
26  *
27  ***************************************************************************
28  *
29  * $Log: mikesStarStandardEventCut.cxx,v $
30  * Revision 1.1 2000/09/04 16:27:15 lisa
31  * added StarStandard multiplicity cut and modified mikesTrackCut to allow NOT cutting on charge sign
32  *
33  *
34  **************************************************************************/
35 
36 #include "StHbtMaker/Cut/mikesStarStandardEventCut.h"
37 #include <cstdio>
38 
39 
40 
41 #ifdef __ROOT__
43 #endif
44 
45 mikesStarStandardEventCut::mikesStarStandardEventCut(){
46  mNEventsPassed = mNEventsFailed = 0;
47  // mOutFile = new ofstream("Mult_vs_mult.dat");
48 }
49 //------------------------------
50 //mikesStarStandardEventCut::~mikesStarStandardEventCut(){
51 // mOutFile->close();
52 // delete mOutFile;
53 // /* noop */
54 //}
55 //------------------------------
56 bool mikesStarStandardEventCut::Pass(const StHbtEvent* event){
57 
58 
59  double VertexZPos = event->PrimVertPos().z();
60  cout << "mikesStarStandardEventCut:: VertexZPos: " << mVertZPos[0] << " < " << VertexZPos << " < " << mVertZPos[1] << endl;
61  bool goodEvent =
62  ((VertexZPos > mVertZPos[0]) &&
63  (VertexZPos < mVertZPos[1]));
64  if (goodEvent){
65  // int mult = event->NumberOfTracks();
66  int mult = 0;
68  for (StHbtTrackIterator pIter=event->TrackCollection()->begin();pIter!=event->TrackCollection()->end();pIter++){
69  track = *pIter;
70  if ((track->Charge()<0)&&(track->NHits()>=10)&&(track->DCAxy()<3.0)&&(fabs(track->P().pseudoRapidity())<0.5)){
71  mult++;
72  }
73  }
74 
75  // (*mOutFile) << event->NumberOfTracks() << " " << mult << " " << VertexZPos << endl;
76  cout << "mikesStarStandardEventCut:: mult: " << mEventMult[0] << " < " << mult << " < " << mEventMult[1] << endl;
77  goodEvent = (goodEvent&& (mult > mEventMult[0]) && (mult < mEventMult[1]));
78  }
79 
80  goodEvent ? mNEventsPassed++ : mNEventsFailed++ ;
81  cout << "mikesStarStandardEventCut:: return : " << goodEvent << endl;
82 
83 
84  return (goodEvent);
85 }
86 //------------------------------
87 StHbtString mikesStarStandardEventCut::Report(){
88  string Stemp;
89  char Ctemp[100];
90  sprintf(Ctemp,"\nMultiplicity:\t %d-%d",mEventMult[0],mEventMult[1]);
91  Stemp = Ctemp;
92  sprintf(Ctemp,"\nVertex Z-position:\t %E-%E",mVertZPos[0],mVertZPos[1]);
93  Stemp += Ctemp;
94  sprintf(Ctemp,"\nNumber of events which passed:\t%ld Number which failed:\t%ld",mNEventsPassed,mNEventsFailed);
95  Stemp += Ctemp;
96  StHbtString returnThis = Stemp;
97  return returnThis;
98 }