StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StHbtReactionPlaneAnalysis.cxx
1 /***************************************************************************
2  *
3  * $Id: StHbtReactionPlaneAnalysis.cxx,v 1.6 2005/06/28 23:12:53 chajecki Exp $
4  *
5  * Author: Randall Wells, Ohio State, rcwells@mps.ohio-state.edu
6  ***************************************************************************
7  *
8  * Description: part of STAR HBT Framework: StHbtMaker package
9  * This is the Class for Analysis objects. Each of the simultaneous
10  * Analyses running should have one of these instantiated. They link
11  * into the Manager in an Analysis Collection.
12  *
13  ***************************************************************************
14  *
15  * $Log: StHbtReactionPlaneAnalysis.cxx,v $
16  * Revision 1.6 2005/06/28 23:12:53 chajecki
17  * UncorrectedNumberOfNegativePrimaries() -> UncorrectedNumberOfPrimaries()
18  *
19  * For data taken in Y2 and later the centrality definition bases
20  * on UncorrectedNumberOfPrimaries() while for Y1(AuAu@130)
21  * it based on UncorrectedNumberOfNegativePrimaries().
22  * But in many places of HBT code the number of negative primaries
23  * was used as a multiplicity for all productions.
24  * This has been fixed.
25  *
26  * Revision 1.5 2004/04/12 14:05:46 magestro
27  * Added Vz dimension to event-mixing
28  *
29  * Revision 1.4 2002/05/28 14:04:07 rcwells
30  * Added multiplicity binning to StHbtReactionPlaneAnalysis
31  *
32  * Revision 1.2 2001/07/20 20:03:53 rcwells
33  * Added pT weighting and moved event angle cal. to event cut
34  *
35  * Revision 1.1 2001/07/13 20:03:14 rcwells
36  * Adding reaction plane analysis
37  *
38  *
39  **************************************************************************/
40 
41 #include "StHbtMaker/Infrastructure/StHbtReactionPlaneAnalysis.h"
42 #include "StHbtMaker/Infrastructure/StHbtParticleCollection.hh"
43 #include "StHbtMaker/Base/StHbtTrackCut.h"
44 #include "StHbtMaker/Base/StHbtV0Cut.h"
45 #include "StHbtMaker/Infrastructure/StHbtPicoEventCollectionVector.hh"
46 #include "StHbtMaker/Infrastructure/StHbtPicoEventCollectionVectorHideAway.hh"
47 #include "PhysicalConstants.h"
48 
49 #ifdef __ROOT__
51 #endif
52 
53 extern void FillHbtParticleCollection(StHbtParticleCut* partCut,
54  StHbtEvent* hbtEvent,
55  StHbtParticleCollection* partCollection);
56 
57 
58 //____________________________
59 StHbtReactionPlaneAnalysis::StHbtReactionPlaneAnalysis(int PtWgt, unsigned int binsRP, double minRP, double maxRP,
60  unsigned int binsMult, double minMult, double maxMult,
61  unsigned int binsVert, double minVert, double maxVert){
62  // mControlSwitch = 0;
63  mEventCut = 0;
64  mFirstParticleCut = 0;
65  mSecondParticleCut = 0;
66  mPairCut = 0;
67  mCorrFctnCollection= 0;
68  mCorrFctnCollection = new StHbtCorrFctnCollection;
69  mReactionPlaneBins = binsRP;
70  mReactionPlane[0] = minRP;
71  mReactionPlane[1] = maxRP;
72  mUnderFlow = 0;
73  mOverFlow = 0;
74  if (mMixingBuffer) delete mMixingBuffer;
75  mPicoEventCollectionVectorHideAway = new StHbtPicoEventCollectionVectorHideAway(mReactionPlaneBins,mReactionPlane[0],mReactionPlane[1],binsMult,minMult,maxMult
76  ,binsVert,minVert,maxVert);
77  mPtWgt = PtWgt;
78 };
79 //____________________________
80 
81 StHbtReactionPlaneAnalysis::StHbtReactionPlaneAnalysis(const StHbtReactionPlaneAnalysis& a) : StHbtAnalysis() {
82  //StHbtReactionPlaneAnalysis();
83  mPtWgt = a.mPtWgt;
84  mEventCut = 0;
85  mFirstParticleCut = 0;
86  mSecondParticleCut = 0;
87  mPairCut = 0;
88  mCorrFctnCollection= 0;
89  mCorrFctnCollection = new StHbtCorrFctnCollection;
90  mReactionPlaneBins = a.mReactionPlaneBins;
91  mReactionPlane[0] = a.mReactionPlane[0];
92  mReactionPlane[1] = a.mReactionPlane[1];
93  mUnderFlow = 0;
94  mOverFlow = 0;
95  if (mMixingBuffer) delete mMixingBuffer;
96  mPicoEventCollectionVectorHideAway = new StHbtPicoEventCollectionVectorHideAway(mReactionPlaneBins,mReactionPlane[0],mReactionPlane[1]);
97 
98  // find the right event cut
99  mEventCut = a.mEventCut->Clone();
100  // find the right first particle cut
101  mFirstParticleCut = a.mFirstParticleCut->Clone();
102  // find the right second particle cut
103  if (a.mFirstParticleCut==a.mSecondParticleCut)
104  SetSecondParticleCut(mFirstParticleCut); // identical particle hbt
105  else
106  mSecondParticleCut = a.mSecondParticleCut->Clone();
107 
108  mPairCut = a.mPairCut->Clone();
109 
110  if ( mEventCut ) {
111  SetEventCut(mEventCut); // this will set the myAnalysis pointer inside the cut
112  cout << " StHbtReactionPlaneAnalysis::StHbtReactionPlaneAnalysis(const StHbtReactionPlaneAnalysis& a) - event cut set " << endl;
113  }
114  if ( mFirstParticleCut ) {
115  SetFirstParticleCut(mFirstParticleCut); // this will set the myAnalysis pointer inside the cut
116  cout << " StHbtReactionPlaneAnalysis::StHbtReactionPlaneAnalysis(const StHbtReactionPlaneAnalysis& a) - first particle cut set " << endl;
117  }
118  if ( mSecondParticleCut ) {
119  SetSecondParticleCut(mSecondParticleCut); // this will set the myAnalysis pointer inside the cut
120  cout << " StHbtReactionPlaneAnalysis::StHbtReactionPlaneAnalysis(const StHbtReactionPlaneAnalysis& a) - second particle cut set " << endl;
121  } if ( mPairCut ) {
122  SetPairCut(mPairCut); // this will set the myAnalysis pointer inside the cut
123  cout << " StHbtReactionPlaneAnalysis::StHbtReactionPlaneAnalysis(const StHbtReactionPlaneAnalysis& a) - pair cut set " << endl;
124  }
125 
126  StHbtCorrFctnIterator iter;
127  for (iter=a.mCorrFctnCollection->begin(); iter!=a.mCorrFctnCollection->end();iter++){
128  cout << " StHbtReactionPlaneAnalysis::StHbtReactionPlaneAnalysis(const StHbtReactionPlaneAnalysis& a) - looking for correlation functions " << endl;
129  StHbtCorrFctn* fctn = (*iter)->Clone();
130  if (fctn) AddCorrFctn(fctn);
131  else cout << " StHbtReactionPlaneAnalysis::StHbtReactionPlaneAnalysis(const StHbtReactionPlaneAnalysis& a) - correlation function not found " << endl;
132  }
133 
134  mNumEventsToMix = a.mNumEventsToMix;
135 
136  cout << " StHbtReactionPlaneAnalysis::StHbtReactionPlaneAnalysis(const StHbtReactionPlaneAnalysis& a) - analysis copied " << endl;
137 
138 }
139 //____________________________
140 StHbtReactionPlaneAnalysis::~StHbtReactionPlaneAnalysis(){
141  // now delete every PicoEvent in the EventMixingBuffer and then the Buffer itself
142  delete mPicoEventCollectionVectorHideAway;
143 }
144 
145 //____________________________
146 StHbtString StHbtReactionPlaneAnalysis::Report()
147 {
148  cout << "StHbtReactionPlaneAnalysis - constructing Report..."<<endl;
149  char Ctemp[200];
150  StHbtString temp = "-----------\nHbt StHbtReactionPlaneAnalysis Report:\n";
151  sprintf(Ctemp,"Events are mixed in %d bins in the range %E cm to %E cm.\n",mReactionPlaneBins,mReactionPlane[0],mReactionPlane[1]);
152  temp += Ctemp;
153  sprintf(Ctemp,"Events underflowing: %d\n",mUnderFlow);
154  temp += Ctemp;
155  sprintf(Ctemp,"Events overflowing: %d\n",mOverFlow);
156  temp += Ctemp;
157  sprintf(Ctemp,"Now adding StHbtAnalysis(base) Report\n");
158  temp += Ctemp;
159  temp += StHbtAnalysis::Report();
160  StHbtString returnThis=temp;
161  return returnThis;
162 }
163 //_________________________
165  // get right mixing buffer
166  mVertexZ = hbtEvent->PrimVertPos().z();
167  if (mPtWgt) mReactionPlaneAngle = hbtEvent->ReactionPlane(1);
168  else mReactionPlaneAngle = hbtEvent->ReactionPlane(0);
169  // cout << "Reaction Plane " << mReactionPlaneAngle << endl;
170  if (mReactionPlaneAngle<-990) {
171  cout << "No event plane!" << endl;
172  return;
173  }
174  if ( mReactionPlaneAngle<0.0 ) mReactionPlaneAngle+=2*pi;
175  int multiplicity = hbtEvent->UncorrectedNumberOfPrimaries();
176  mMixingBuffer = mPicoEventCollectionVectorHideAway->PicoEventCollection(mReactionPlaneAngle,(double)multiplicity, mVertexZ);
177  if (!mMixingBuffer) {
178  if ( mReactionPlaneAngle < mReactionPlane[0] ) mUnderFlow++;
179  if ( mReactionPlaneAngle > mReactionPlane[1] ) mOverFlow++;
180  return;
181  }
182  // call ProcessEvent() from StHbtAnalysis-bas
183  StHbtAnalysis::ProcessEvent(hbtEvent);
184 }
virtual void ProcessEvent(const StHbtEvent *)
returns reports of all cuts applied and correlation functions being done
virtual void ProcessEvent(const StHbtEvent *)
returns reports of all cuts applied and correlation functions being done