StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StHbtThreeParticleAnalysis.h
1 /***************************************************************************
2  *
3  * $Id: StHbtThreeParticleAnalysis.h,v 1.8 2002/11/01 20:52:39 magestro Exp $
4  *
5  * Author: Robert Willson, Ohio State, willson@bnl.gov
6  ***************************************************************************
7  *
8  * Description: part of STAR HBT Framework: StHbtMaker package.
9  * This is the derived class for three particle analysis objects.
10  * Each of the simultaneous analyses should have one of derived
11  * analysis classes running these instantiated. They link
12  * into the manager in an analysis collection.
13  *
14  ***************************************************************************
15  *
16  * $Log: StHbtThreeParticleAnalysis.h,v $
17  * Revision 1.8 2002/11/01 20:52:39 magestro
18  * removed unused class declaration
19  *
20  * Revision 1.7 2001/06/03 20:56:10 willson
21  * Sectoring, Cos(phi) calculation added
22  *
23  * Revision 1.6 2000/08/11 16:35:41 rcwells
24  * Added number of events processed to each HBT analysis
25  *
26  * Revision 1.5 2000/07/25 03:26:52 willson
27  * Error with small event collections fixed.
28  *
29  * Revision 1.4 2000/06/15 18:54:08 willson
30  * Methods to access cuts and correlation functions moved to derived analysis
31  * classes.
32  *
33  * Revision 1.3 2000/05/11 21:18:56 willson
34  * Removed StHbtThreeParticleCorrFctn's...put methods in StHbtCorrFctn
35  * Some methods in derived analysis classes moved to base analysis class
36  *
37  * Revision 1.2 2000/04/12 01:54:33 willson
38  * Initial Installation - Comments Added
39  *
40  *
41  ***************************************************************************/
42 
43 
44 #ifndef StHbtThreeParticleAnalysis_hh
45 #define StHbtThreeParticleAnalysis_hh
46 
47 #include "StHbtMaker/Base/StHbtBaseAnalysis.h" // base analysis class
48 #include "StHbtMaker/Base/StHbtTripletCut.h" // base class
49 #include "StHbtMaker/Base/StHbtEventCut.h"
50 #include "StHbtMaker/Base/StHbtParticleCut.h"
51 #include "StHbtMaker/Base/StHbtCorrFctn.hh"
52 #include "StHbtMaker/Infrastructure/StHbtCorrFctnCollection.hh"
53 #include "StHbtMaker/Infrastructure/StHbtPicoEventCollection.hh"
54 #include "StHbtMaker/Infrastructure/StHbtSectoredPicoEventCollection.hh"
55 
57 
58 public:
59 
61  virtual ~StHbtThreeParticleAnalysis();
62 
63  int CreateRealTriplets(StHbtSectoredPicoEvent*, int Index1);
64  int CreateRealTriplets(StHbtSectoredPicoEvent*, int Index1, int Index2);
65  int CreateRealTriplets(StHbtSectoredPicoEvent*, int Index1, int Index2, int Index3);
66  int CalculateCosPhi(StHbtSectoredPicoEvent*, int Index1);
67  int CalculateCosPhi(StHbtSectoredPicoEvent*, int Index1, int Index2);
68  int CalculateCosPhi(StHbtSectoredPicoEvent*, int Index1, int Index2, int Index3);
69  int CreateMixedTriplets(StHbtParticleCollection*, StHbtParticleCollection*, StHbtParticleCollection*);
70  void SortHbtParticleCollection(StHbtParticleCut*, StHbtEvent*, StHbtParticleCollection**);
71  int Index(int, int, int);
72 
73  // Gets and Sets
74 
75  StHbt1DHisto* Q2CF();
76  StHbt1DHisto* Q3CF();
77  StHbt1DHisto* CosPhi();
78  StHbt1DHisto* CosPhiN();
79  bool CalcCosPhi();
80  bool IsSectoring();
81 
82  virtual StHbtTripletCut* TripletCut();
83  virtual StHbtEventCut* EventCut();
84  virtual StHbtParticleCut* FirstParticleCut();
85  virtual StHbtParticleCut* SecondParticleCut();
86  virtual StHbtParticleCut* ThirdParticleCut();
87 
88  StHbtCorrFctnCollection* CorrFctnCollection();
89  virtual StHbtCorrFctn* CorrFctn(int n); // Access to CFs within the collection
90  void AddCorrFctn(StHbtCorrFctn*);
91  void AddEventProcessed();
92 
93  void SetTripletCut(StHbtTripletCut*);
94  void SetEventCut(StHbtEventCut*);
95  void SetFirstParticleCut(StHbtParticleCut*);
96  void SetSecondParticleCut(StHbtParticleCut*);
97  void SetThirdParticleCut(StHbtParticleCut*);
98  void SetQ2CF(StHbt1DHisto*);
99  void SetQ3CF(StHbt1DHisto*);
100  void SetCosPhi(StHbt1DHisto*);
101  void SetCosPhiN(StHbt1DHisto*);
102  void SetCalcCosPhi(const char*);
103  void SetSectoring(bool);
104  void SetNormFactor(const double);
105 
106  int NumBinsX();
107  int NumBinsY();
108  int NumBinsZ();
109  float PXmax();
110  float PXmin();
111  float PYmax();
112  float PYmin();
113  float PZmax();
114  float PZmin();
115  float DeltaP();
116 
117  void SetPXmax(float);
118  void SetPXmin(float);
119  void SetPYmax(float);
120  void SetPYmin(float);
121  void SetPZmax(float);
122  void SetPZmin(float);
123  void SetDeltaP(float);
124 
125  unsigned int NumEventsToMix();
126  void SetNumEventsToMix(const unsigned int&);
127  StHbtPicoEventCollection* MixingBuffer();
128  bool MixingBufferFull();
129  StHbtSectoredPicoEventCollection* SectoredMixingBuffer();
130  bool SectoredMixingBufferFull();
131 
132  bool AnalyzeIdenticalParticles();
133  virtual StHbtString Report();
134 
135  virtual void ProcessEvent(const StHbtEvent*);
136  void EventBegin(const StHbtEvent*); //startup for EbyE
137  void EventEnd(const StHbtEvent*); // cleanup for EbyE
138  int GetNeventsProcessed();
139 
140  virtual void Finish();
141 
142 
143 protected:
144  unsigned int mNumEventsToMix;
145  unsigned int mNeventsProcessed;
146  StHbtTripletCut* mTripletCut;
147  StHbtCorrFctnCollection* mCorrFctnCollection;
148  StHbtEventCut* mEventCut;
149  StHbtParticleCut* mFirstParticleCut;
150  StHbtParticleCut* mSecondParticleCut;
151  StHbtParticleCut* mThirdParticleCut;
152  StHbtPicoEventCollection* mMixingBuffer;
153  StHbtSectoredPicoEventCollection* mSectoredMixingBuffer;
154 
155  float mPXmax; // Sectoring Information
156  float mPXmin;
157  float mPYmax;
158  float mPYmin;
159  float mPZmax;
160  float mPZmin;
161  float mDeltaP;
162  int mNumBinsX;
163  int mNumBinsY;
164  int mNumBinsZ;
165 
166  double mNormFactor; // 3P Norm Factor
167 
168  StHbt1DHisto* mQ2CF; // Two particle correlation function used to calculate Cos(phi)
169  StHbt1DHisto* mQ3CF; // Three particle correlation function used to calculate Cos(phi)
170  StHbt1DHisto* mCosPhi; // Cos(phi) histogram
171  StHbt1DHisto* mCosPhiN; // Number of entries for each bin, used to calculate Cos(phi) histogram
172  StHbt1DHisto* mCosPhiE; // Error in CosPhi histo
173  bool mCalcCosPhi; // If this is 0, normal correlation function processing occurs, else, calculate Cos(phi)
174  bool mIsSectoring; // If this is 0, normal correlation function calculation, if 1, use sectoring.
175  char mSaveFile[100]; // Place to save cosphi histo
176 
177 #ifdef __ROOT__
178  ClassDef(StHbtThreeParticleAnalysis, 0)
179 #endif
180 
181 };
182 
183 // Get's
184 inline StHbtTripletCut* StHbtThreeParticleAnalysis::TripletCut() {return mTripletCut;}
185 inline StHbtEventCut* StHbtThreeParticleAnalysis::EventCut() {return mEventCut;}
186 inline StHbtParticleCut* StHbtThreeParticleAnalysis::FirstParticleCut() {return mFirstParticleCut;}
187 inline StHbtParticleCut* StHbtThreeParticleAnalysis::SecondParticleCut() {return mSecondParticleCut;}
188 inline StHbtParticleCut* StHbtThreeParticleAnalysis::ThirdParticleCut() {return mThirdParticleCut;}
189 inline StHbtCorrFctnCollection* StHbtThreeParticleAnalysis::CorrFctnCollection() {return mCorrFctnCollection;}
190 inline unsigned int StHbtThreeParticleAnalysis::NumEventsToMix(){return mNumEventsToMix;}
191 
192 inline StHbt1DHisto* StHbtThreeParticleAnalysis::Q2CF() {return mQ2CF;}
193 inline StHbt1DHisto* StHbtThreeParticleAnalysis::Q3CF() {return mQ3CF;}
194 inline StHbt1DHisto* StHbtThreeParticleAnalysis::CosPhi() {return mCosPhi;}
195 inline StHbt1DHisto* StHbtThreeParticleAnalysis::CosPhiN() {return mCosPhiN;}
196 inline bool StHbtThreeParticleAnalysis::CalcCosPhi() {return mCalcCosPhi;}
197 inline bool StHbtThreeParticleAnalysis::IsSectoring() {return mIsSectoring;}
198 
199 inline StHbtPicoEventCollection* StHbtThreeParticleAnalysis::MixingBuffer() {return mMixingBuffer;}
200 inline StHbtSectoredPicoEventCollection* StHbtThreeParticleAnalysis::SectoredMixingBuffer() {return mSectoredMixingBuffer;}
201 
202 inline float StHbtThreeParticleAnalysis::PXmax() {return mPXmax;}
203 inline float StHbtThreeParticleAnalysis::PXmin() {return mPXmin;}
204 inline float StHbtThreeParticleAnalysis::PYmax() {return mPYmax;}
205 inline float StHbtThreeParticleAnalysis::PYmin() {return mPYmin;}
206 inline float StHbtThreeParticleAnalysis::PZmax() {return mPZmax;}
207 inline float StHbtThreeParticleAnalysis::PZmin() {return mPZmin;}
208 inline float StHbtThreeParticleAnalysis::DeltaP() {return mDeltaP;}
209 inline int StHbtThreeParticleAnalysis::NumBinsX() {return mNumBinsX;}
210 inline int StHbtThreeParticleAnalysis::NumBinsY() {return mNumBinsY;}
211 inline int StHbtThreeParticleAnalysis::NumBinsZ() {return mNumBinsZ;}
212 
213 // Set's
214 inline bool StHbtThreeParticleAnalysis::AnalyzeIdenticalParticles(){return ((mFirstParticleCut==mSecondParticleCut) && (mSecondParticleCut==mThirdParticleCut));}
215 inline void StHbtThreeParticleAnalysis::SetTripletCut(StHbtTripletCut* x) { mTripletCut = x; x->SetAnalysis((StHbtBaseAnalysis*)this);}
216 inline void StHbtThreeParticleAnalysis::AddCorrFctn(StHbtCorrFctn* cf) {mCorrFctnCollection->push_back(cf); cf->SetAnalysis((StHbtBaseAnalysis*)this);}
217 inline void StHbtThreeParticleAnalysis::SetEventCut(StHbtEventCut* x) {mEventCut = x; x->SetAnalysis((StHbtBaseAnalysis*)this);}
218 inline void StHbtThreeParticleAnalysis::SetFirstParticleCut(StHbtParticleCut* x) {mFirstParticleCut = x; x->SetAnalysis((StHbtBaseAnalysis*)this);}
219 inline void StHbtThreeParticleAnalysis::SetSecondParticleCut(StHbtParticleCut* x) {mSecondParticleCut = x; x->SetAnalysis((StHbtBaseAnalysis*)this);}
220 inline void StHbtThreeParticleAnalysis::SetThirdParticleCut(StHbtParticleCut* x) {mThirdParticleCut = x; /*x->SetAnalysis((StHbtBaseAnalysis)this);*/}
221 
222 inline void StHbtThreeParticleAnalysis::SetQ2CF(StHbt1DHisto* x) {mQ2CF = x;}
223 inline void StHbtThreeParticleAnalysis::SetQ3CF(StHbt1DHisto* x) {mQ3CF = x;}
224 inline void StHbtThreeParticleAnalysis::SetCosPhi(StHbt1DHisto* x) {mCosPhi = x;}
225 inline void StHbtThreeParticleAnalysis::SetCosPhiN(StHbt1DHisto* x) {mCosPhiN = x;}
226 inline void StHbtThreeParticleAnalysis::SetNormFactor(const double x) {mNormFactor = x;}
227 
228 inline void StHbtThreeParticleAnalysis::SetCalcCosPhi(const char* x)
229 {
230  mCalcCosPhi = true;
231  // Copy save filename
232  sprintf(mSaveFile, "%s", x);
233  // Create Error Histogram to be used in CosPhi calculation
234  mCosPhiE = new StHbt1DHisto("CosPhiE", "Error Histo", mCosPhi->GetNbinsX(), mCosPhi->GetXaxis()->GetBinUpEdge(0), mCosPhi->GetXaxis()->GetBinUpEdge(mCosPhi->GetNbinsX()));
235 }
236 
237 inline void StHbtThreeParticleAnalysis::SetNumEventsToMix(const unsigned int& nmix){ mNumEventsToMix = nmix;}
238 inline bool StHbtThreeParticleAnalysis::MixingBufferFull(){return (mMixingBuffer->size() >= mNumEventsToMix);}
239 inline bool StHbtThreeParticleAnalysis::SectoredMixingBufferFull(){return (mSectoredMixingBuffer->size() >= NumEventsToMix());}
240 inline int StHbtThreeParticleAnalysis::GetNeventsProcessed() {return mNeventsProcessed;}
241 
242 inline void StHbtThreeParticleAnalysis::SetSectoring(bool x) {mIsSectoring = x;}
243 inline void StHbtThreeParticleAnalysis::SetPXmax(float x) {
244  mPXmax = x;
245  if (mPXmax<mPXmin) mNumBinsX=0;
246  else mNumBinsX = (int)ceil((mPXmax-mPXmin)/mDeltaP);
247 }
248 inline void StHbtThreeParticleAnalysis::SetPXmin(float x) {
249  mPXmin = x;
250  if (mPXmax<mPXmin) mNumBinsX=0;
251  else mNumBinsX = (int)ceil((mPXmax-mPXmin)/mDeltaP);
252 }
253 inline void StHbtThreeParticleAnalysis::SetPYmax(float x) {
254  mPYmax = x;
255  if (mPYmax<mPYmin) mNumBinsY=0;
256  else mNumBinsY = (int)ceil((mPYmax-mPYmin)/mDeltaP);
257 }
258 inline void StHbtThreeParticleAnalysis::SetPYmin(float x) {
259  mPYmin = x;
260  if (mPYmax<mPYmin) mNumBinsY=0;
261  else mNumBinsY = (int)ceil((mPYmax-mPYmin)/mDeltaP);
262 }
263 inline void StHbtThreeParticleAnalysis::SetPZmax(float x) {
264  mPZmax = x;
265  if (mPZmax<mPZmin) mNumBinsZ=0;
266  else mNumBinsZ = (int)ceil((mPZmax-mPZmin)/mDeltaP);
267 }
268 inline void StHbtThreeParticleAnalysis::SetPZmin(float x) {
269  mPZmin = x;
270  if (mPZmax<mPZmin) mNumBinsZ=0;
271  else mNumBinsZ = (int)ceil((mPZmax-mPZmin)/mDeltaP);
272 }
273 inline void StHbtThreeParticleAnalysis::SetDeltaP(float x) {
274  if (x<=0) {
275  mDeltaP = 1.0;
276  cout << "****ERROR**** DeltaP must be greater than zero...setting DeltaP to 1.0" << endl;
277  }
278  else {
279  mDeltaP = x;
280  mNumBinsX = (int)ceil((mPXmax-mPXmin)/mDeltaP);
281  mNumBinsY = (int)ceil((mPYmax-mPYmin)/mDeltaP);
282  mNumBinsZ = (int)ceil((mPZmax-mPZmin)/mDeltaP);
283  }
284 }
285 
286 #endif
virtual void ProcessEvent(const StHbtEvent *)
returns reports of all cuts applied and correlation functions being done