38 #include "StHbtMaker/Cut/calculateEventPlaneEventCut.h"
40 #include "StFlowMaker/StFlowMaker.h"
41 #include "StFlowMaker/StFlowEvent.h"
42 #include "StFlowAnalysisMaker/StFlowAnalysisMaker.h"
43 #include "StFlowMaker/StFlowSelection.h"
49 calculateEventPlaneEventCut::calculateEventPlaneEventCut(){
51 mFlowAnalysisMaker = 0;
53 mNEventsPassed = mNEventsFailed = 0;
66 bool calculateEventPlaneEventCut::Pass(
const StHbtEvent* ConstantEventIn){
73 bool goodEvent =
false;
77 double VertexZPos =
event->PrimVertPos().z();
78 goodEvent = ( (VertexZPos >= mVertZPos[0]) && (VertexZPos <= mVertZPos[1]) );
82 int mult =
event->UncorrectedNumberOfPrimaries();
83 goodEvent = (goodEvent && (mult >= mEventMult[0]) && (mult <= mEventMult[1]));
87 if (goodEvent && mFlowMaker) {
88 if (mFromHBT) mFlowMaker->FillFlowEvent(event);
89 if (mFlowMaker->FlowEventPointer()) {
90 StFlowEvent::SetPtWgt(
false);
92 mFlowMaker->FlowSelection()->SetSubevent(-1);
93 double reactionPlane = mFlowMaker->FlowEventPointer()->Psi(mFlowMaker->FlowSelection());
94 cout <<
"Reaction Plane " << reactionPlane << endl;
95 event->SetReactionPlane(reactionPlane,0);
97 mFlowMaker->FlowSelection()->SetSubevent(0);
98 double RP1 = mFlowMaker->FlowEventPointer()->Psi(mFlowMaker->FlowSelection());
99 mFlowMaker->FlowSelection()->SetSubevent(1);
100 double RP2 = mFlowMaker->FlowEventPointer()->Psi(mFlowMaker->FlowSelection());
101 event->SetReactionPlaneSubEventDifference(RP1-RP2,0);
103 StFlowEvent::SetPtWgt(
true);
105 mFlowMaker->FlowSelection()->SetSubevent(-1);
106 reactionPlane = mFlowMaker->FlowEventPointer()->Psi(mFlowMaker->FlowSelection());
107 cout <<
"Reaction Plane ptWgt " << reactionPlane << endl;
108 event->SetReactionPlane(reactionPlane,1);
110 mFlowMaker->FlowSelection()->SetSubevent(0);
111 RP1 = mFlowMaker->FlowEventPointer()->Psi(mFlowMaker->FlowSelection());
112 mFlowMaker->FlowSelection()->SetSubevent(1);
113 RP2 = mFlowMaker->FlowEventPointer()->Psi(mFlowMaker->FlowSelection());
114 event->SetReactionPlaneSubEventDifference(RP1-RP2,1);
116 if (mFlowAnalysisMaker) mFlowAnalysisMaker->
Make();
119 cout <<
"No flow event found" << endl;
120 event->SetReactionPlane(-999,0);
121 event->SetReactionPlane(-999,1);
122 event->SetReactionPlaneSubEventDifference(-999,0);
123 event->SetReactionPlaneSubEventDifference(-999,1);
128 cout <<
"Something wrong with HbtEvent" << endl;
129 event->SetReactionPlane(-99,0);
130 event->SetReactionPlane(-99,1);
131 event->SetReactionPlaneSubEventDifference(-99,0);
132 event->SetReactionPlaneSubEventDifference(-99,1);
134 goodEvent ? mNEventsPassed++ : mNEventsFailed++ ;
138 StHbtString calculateEventPlaneEventCut::Report(){
141 sprintf(Ctemp,
"\nNumber of events which passed:\t%ld Number which failed:\t%ld",mNEventsPassed,mNEventsFailed);
143 StHbtString returnThis = Stemp;