00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065 #include "StHbtMaker/Cut/helensEventCut.h"
00066 #include <cstdio>
00067
00068 #ifdef __ROOT__
00069 ClassImp(helensEventCut)
00070 #endif
00071
00072 helensEventCut::helensEventCut(){
00073 mNEventsPassed = mNEventsFailed = 0;
00074 mV0Mult[0] =-10;
00075 mV0Mult[1] = 100000;
00076 mTrkV0MatchCollection = new StHbtTrkV0MatchCollection;
00077 }
00078
00079
00080
00081
00082
00083 bool helensEventCut::Pass(const StHbtEvent* event){
00084
00085 int v0Mult=0;
00086 int mult = event->NumberOfTracks();
00087 if( event->V0Collection()){
00088 v0Mult= event->V0Collection()->size();
00089 }
00090 double VertexZPos = event->PrimVertPos().z();
00091 cout << "helensEventCut:: mult: " << mEventMult[0] << " < " << mult << " < " << mEventMult[1] << endl;
00092 cout << "helensEventCut:: VertexZPos: " << mVertZPos[0] << " < " << VertexZPos << " < " << mVertZPos[1] << endl;
00093 cout << "helensEventCut:: V0Mult: " << mV0Mult[0] << " < " << v0Mult << " < " << mV0Mult[1] << endl;
00094 bool goodEvent =
00095 ((mult > mEventMult[0]) &&
00096 (mult < mEventMult[1]) &&
00097 (VertexZPos > mVertZPos[0]) &&
00098 (VertexZPos < mVertZPos[1]) &&
00099 (v0Mult > mV0Mult[0]) &&
00100 (v0Mult < mV0Mult[1]));
00101 goodEvent ? mNEventsPassed++ : mNEventsFailed++ ;
00102
00103
00104
00105
00106
00107 StHbtTrkV0Iterator pIter;
00108 if( TrkV0MatchCollection()->size() > 0){
00109 for( pIter=TrkV0MatchCollection()->begin(); pIter!=TrkV0MatchCollection()->end();
00110 pIter++){
00111 delete *pIter;
00112 }
00113
00114 TrkV0MatchCollection()->clear();
00115 }
00116
00117
00118
00119 StHbtTrackIterator TrkIter;
00120 StHbtTrack* pParticle;
00121
00122 for( TrkIter=event->TrackCollection()->begin(); TrkIter!=event->TrackCollection()->end(); TrkIter++){
00123
00124 pParticle = *TrkIter;
00125 StHbtTrkV0Match* TrackV0Match = new StHbtTrkV0Match;
00126 TrackV0Match->SetTrkId( pParticle->TrackId());
00127 TrackV0Match->SetdEdx( pParticle->dEdx());
00128 TrackV0Match->SetUsed(0);
00129 TrkV0MatchCollection()->push_back(TrackV0Match);
00130
00131 }
00132
00133 cout << "TrkV0MatchCollection Size= " << TrkV0MatchCollection()->size() << endl;
00134 cout << "helensEventCut:: return : " << goodEvent << endl;
00135 return (goodEvent);
00136 }
00137
00138 StHbtString helensEventCut::Report(){
00139 string Stemp;
00140 char Ctemp[100];
00141 sprintf(Ctemp,"\nMultiplicity:\t %d-%d",mEventMult[0],mEventMult[1]);
00142 Stemp = Ctemp;
00143 sprintf(Ctemp,"\nVertex Z-position:\t %E-%E",mVertZPos[0],mVertZPos[1]);
00144 Stemp += Ctemp;
00145 sprintf(Ctemp,"\nV0Multiplicity:\t %d-%d",mV0Mult[0],mV0Mult[1]);
00146 Stemp = Ctemp;
00147 sprintf(Ctemp,"\nNumber of events which passed:\t%ld Number which failed:\t%ld",mNEventsPassed,mNEventsFailed);
00148 Stemp += Ctemp;
00149 StHbtString returnThis = Stemp;
00150 return returnThis;
00151 }