00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include "StHbtMaker/Cut/rotateToReactionPlaneEventCut.h"
00025 #include "Randomize.h"
00026 #include "PhysicalConstants.h"
00027 #include "SystemOfUnits.h"
00028
00029 #include <cstdio>
00030
00031 #ifdef __ROOT__
00032 ClassImp(rotateToReactionPlaneEventCut)
00033 #endif
00034
00035 rotateToReactionPlaneEventCut::rotateToReactionPlaneEventCut() : mRotation(true), mSmear(0) {
00036 mNEventsPassed = mNEventsFailed = 0;
00037 engine = new HepJamesRandom();
00038 gauss = new RandGauss(engine);
00039 }
00040
00041
00042
00043
00044
00045 bool rotateToReactionPlaneEventCut::Pass(const StHbtEvent* event){
00046 int mult;
00047 double VertexZPos;
00048 double angle;
00049 bool goodEvent = true;
00050
00051 if ( event->TrackCollection()->size() + event->V0Collection()->size() > 0 ) {
00052 mult = event->NumberOfTracks();
00053 VertexZPos = event->PrimVertPos().z();
00054 goodEvent =
00055 ((mult > mEventMult[0]) &&
00056 (mult < mEventMult[1]) &&
00057 (VertexZPos > mVertZPos[0]) &&
00058 (VertexZPos < mVertZPos[1]));
00059
00060 if (goodEvent && mRotation ) {
00061 angle = gauss->shoot()*mSmear*2.*pi;
00062 ((StHbtEvent*)event)->RotateZ(-1.* event->ReactionPlane() + angle);
00063 }
00064 goodEvent ? mNEventsPassed++ : mNEventsFailed++ ;
00065 }
00066
00067 return (goodEvent);
00068 }
00069
00070 StHbtString rotateToReactionPlaneEventCut::Report(){
00071 string Stemp="";
00072 char Ctemp[100];
00073 sprintf(Ctemp,"rotateToReactionPlaneEventCut: ");
00074 Stemp += Ctemp;
00075 sprintf(Ctemp,"\n Rotation :\t %d",(int) mRotation);
00076 Stemp += Ctemp;
00077 sprintf(Ctemp,"\n Multiplicity:\t %d-%d",mEventMult[0],mEventMult[1]);
00078 Stemp += Ctemp;
00079 sprintf(Ctemp,"\n Vertex Z-position:\t %E-%E",mVertZPos[0],mVertZPos[1]);
00080 Stemp += Ctemp;
00081 sprintf(Ctemp,"\n Number of events which passed:\t%ld Number which failed:\t%ld",mNEventsPassed,mNEventsFailed);
00082 Stemp += Ctemp;
00083 StHbtString returnThis = Stemp;
00084 return returnThis;
00085 }