StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StHbtSectoredAnalysis.h
1 /***************************************************************************
2  *
3  * $Id: StHbtSectoredAnalysis.h,v 1.4 2000/08/11 16:35:41 rcwells 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 a derived class for two-particle analysis objects.
10  * In this analysis, momentum space is sectored into a number of
11  * cubes, which are then mixed with nearest neighbors. Several
12  * initializations are needed to set up the sectoring, see
13  * StHbtSectoredExample.C in the /doc directory for use.
14  *
15  ***************************************************************************
16  *
17  * $Log: StHbtSectoredAnalysis.h,v $
18  * Revision 1.4 2000/08/11 16:35:41 rcwells
19  * Added number of events processed to each HBT analysis
20  *
21  * Revision 1.3 2000/06/15 18:54:08 willson
22  * Methods to access cuts and correlation functions moved to derived analysis
23  * classes.
24  *
25  * Revision 1.2 2000/05/11 21:18:56 willson
26  * Removed StHbtThreeParticleCorrFctn's...put methods in StHbtCorrFctn
27  * Some methods in derived analysis classes moved to base analysis class
28  *
29  * Revision 1.1 2000/04/12 01:46:34 willson
30  * Initial Installation
31  *
32  *
33  ***************************************************************************/
34 
35 #ifndef StHbtSectoredAnalysis_hh
36 #define StHbtSectoredAnalysis_hh
37 
38 #include "StHbtMaker/Base/StHbtBaseAnalysis.h" // base analysis class
39 #include "StHbtMaker/Base/StHbtPairCut.h"
40 #include "StHbtMaker/Base/StHbtEventCut.h"
41 #include "StHbtMaker/Base/StHbtParticleCut.h"
42 #include "StHbtMaker/Base/StHbtCorrFctn.hh"
43 #include "StHbtMaker/Infrastructure/StHbtCorrFctnCollection.hh"
44 #include "StHbtMaker/Infrastructure/StHbtSectoredPicoEventCollection.hh"
45 
47 
48 public:
49 
51  StHbtSectoredAnalysis(const StHbtSectoredAnalysis&); // copy constructor
52  virtual ~StHbtSectoredAnalysis();
53 
54  void CreateRealPairs(StHbtParticleCollection*);
55  void CreateRealPairs(StHbtParticleCollection*, StHbtParticleCollection*);
56  void CreateMixedPairs(StHbtParticleCollection*, StHbtParticleCollection*);
57  void SortHbtParticleCollection(StHbtParticleCut*, StHbtEvent*, StHbtParticleCollection**);
58  int Index(int, int, int);
59 
60  // Gets and Sets
61  virtual StHbtPairCut* PairCut();
62  virtual StHbtEventCut* EventCut();
63  virtual StHbtParticleCut* FirstParticleCut();
64  virtual StHbtParticleCut* SecondParticleCut();
65 
66  StHbtCorrFctnCollection* CorrFctnCollection();
67  virtual StHbtCorrFctn* CorrFctn(int n); // Access to CFs within the collection
68  void AddCorrFctn(StHbtCorrFctn*);
69 
70  void SetPairCut(StHbtPairCut*);
71  void SetEventCut(StHbtEventCut*);
72  void SetFirstParticleCut(StHbtParticleCut*);
73  void SetSecondParticleCut(StHbtParticleCut*);
74 
75 
76 
77  int NumBinsX();
78  int NumBinsY();
79  int NumBinsZ();
80  float PXmax();
81  float PXmin();
82  float PYmax();
83  float PYmin();
84  float PZmax();
85  float PZmin();
86  float DeltaP();
87 
88  void SetPXmax(float);
89  void SetPXmin(float);
90  void SetPYmax(float);
91  void SetPYmin(float);
92  void SetPZmax(float);
93  void SetPZmin(float);
94  void SetDeltaP(float);
95 
96  unsigned int NumEventsToMix();
97  void SetNumEventsToMix(const unsigned int&);
98  StHbtSectoredPicoEventCollection* SectoredMixingBuffer();
99  bool SectoredMixingBufferFull();
100 
101  bool AnalyzeIdenticalParticles();
102  virtual StHbtString Report();
103 
104  virtual void ProcessEvent(const StHbtEvent*);
105  void EventBegin(const StHbtEvent*); //startup for EbyE
106  void EventEnd(const StHbtEvent*); // cleanup for EbyE
107  int GetNeventsProcessed();
108 
109  virtual void Finish();
110 
111 
112 private:
113 
114  void AddEventProcessed();
115 
116  StHbtPairCut* mPairCut;
117  StHbtCorrFctnCollection* mCorrFctnCollection;
118  StHbtEventCut* mEventCut;
119  StHbtParticleCut* mFirstParticleCut;
120  StHbtParticleCut* mSecondParticleCut;
121  float mPXmax;
122  float mPXmin;
123  float mPYmax;
124  float mPYmin;
125  float mPZmax;
126  float mPZmin;
127  float mDeltaP;
128  int mNumBinsX;
129  int mNumBinsY;
130  int mNumBinsZ;
131  StHbtSectoredPicoEventCollection* mSectoredMixingBuffer;
132  unsigned int mNumEventsToMix;
133  unsigned int mNeventsProcessed;
134 
135 
136 #ifdef __ROOT__
137  ClassDef(StHbtSectoredAnalysis, 0)
138 #endif
139 
140 };
141 
142 // Get's
143 inline StHbtPairCut* StHbtSectoredAnalysis::PairCut() {return mPairCut;}
144 inline StHbtEventCut* StHbtSectoredAnalysis::EventCut() {return mEventCut;}
145 inline StHbtParticleCut* StHbtSectoredAnalysis::FirstParticleCut() {return mFirstParticleCut;}
146 inline StHbtParticleCut* StHbtSectoredAnalysis::SecondParticleCut() {return mSecondParticleCut;}
147 inline StHbtCorrFctnCollection* StHbtSectoredAnalysis::CorrFctnCollection() {return mCorrFctnCollection;}
148 inline unsigned int StHbtSectoredAnalysis::NumEventsToMix(){return mNumEventsToMix;}
149 inline StHbtSectoredPicoEventCollection* StHbtSectoredAnalysis::SectoredMixingBuffer() {return mSectoredMixingBuffer;}
150 
151 inline float StHbtSectoredAnalysis::PXmax() {return mPXmax;}
152 inline float StHbtSectoredAnalysis::PXmin() {return mPXmin;}
153 inline float StHbtSectoredAnalysis::PYmax() {return mPYmax;}
154 inline float StHbtSectoredAnalysis::PYmin() {return mPYmin;}
155 inline float StHbtSectoredAnalysis::PZmax() {return mPZmax;}
156 inline float StHbtSectoredAnalysis::PZmin() {return mPZmin;}
157 inline float StHbtSectoredAnalysis::DeltaP() {return mDeltaP;}
158 inline int StHbtSectoredAnalysis::NumBinsX() {return mNumBinsX;}
159 inline int StHbtSectoredAnalysis::NumBinsY() {return mNumBinsY;}
160 inline int StHbtSectoredAnalysis::NumBinsZ() {return mNumBinsZ;}
161 
162 // Set's
163 
164 inline bool StHbtSectoredAnalysis::AnalyzeIdenticalParticles() {return (mFirstParticleCut==mSecondParticleCut);}
165 inline void StHbtSectoredAnalysis::SetPairCut(StHbtPairCut* x) { mPairCut = x; x->SetAnalysis((StHbtBaseAnalysis*)this);}
166 inline void StHbtSectoredAnalysis::AddCorrFctn(StHbtCorrFctn* cf) {mCorrFctnCollection->push_back(cf); cf->SetAnalysis((StHbtBaseAnalysis*)this);}
167 inline void StHbtSectoredAnalysis::SetEventCut(StHbtEventCut* x) {mEventCut = x; x->SetAnalysis((StHbtBaseAnalysis*)this);}
168 inline void StHbtSectoredAnalysis::SetFirstParticleCut(StHbtParticleCut* x) {mFirstParticleCut = x; x->SetAnalysis((StHbtBaseAnalysis*)this);}
169 inline void StHbtSectoredAnalysis::SetSecondParticleCut(StHbtParticleCut* x) {mSecondParticleCut = x; x->SetAnalysis((StHbtBaseAnalysis*)this);}
170 
171 inline void StHbtSectoredAnalysis::SetNumEventsToMix(const unsigned int& nmix){ mNumEventsToMix = nmix;}
172 inline bool StHbtSectoredAnalysis::SectoredMixingBufferFull(){return (mSectoredMixingBuffer->size() >= NumEventsToMix());}
173 
174 inline void StHbtSectoredAnalysis::SetPXmax(float x) {
175  mPXmax = x;
176  if (mPXmax<mPXmin) mNumBinsX=1;
177  else mNumBinsX = (int)ceil((mPXmax-mPXmin)/mDeltaP);
178  if (mNumBinsX==0) mNumBinsX=1;
179 }
180 inline void StHbtSectoredAnalysis::SetPXmin(float x) {
181  mPXmin = x;
182  if (mPXmax<mPXmin) mNumBinsX=1;
183  else mNumBinsX = (int)ceil((mPXmax-mPXmin)/mDeltaP);
184  if (mNumBinsX==0) mNumBinsX=1;
185 }
186 inline void StHbtSectoredAnalysis::SetPYmax(float x) {
187  mPYmax = x;
188  if (mPYmax<mPYmin) mNumBinsY=1;
189  else mNumBinsY = (int)ceil((mPYmax-mPYmin)/mDeltaP);
190  if (mNumBinsY==0) mNumBinsY=1;
191 }
192 inline void StHbtSectoredAnalysis::SetPYmin(float x) {
193  mPYmin = x;
194  if (mPYmax<mPYmin) mNumBinsY=1;
195  else mNumBinsY = (int)ceil((mPYmax-mPYmin)/mDeltaP);
196  if (mNumBinsY==0) mNumBinsY=1;
197 }
198 inline void StHbtSectoredAnalysis::SetPZmax(float x) {
199  mPZmax = x;
200  if (mPZmax<mPZmin) mNumBinsZ=1;
201  else mNumBinsZ = (int)ceil((mPZmax-mPZmin)/mDeltaP);
202  if (mNumBinsZ==0) mNumBinsZ=1;
203 }
204 inline void StHbtSectoredAnalysis::SetPZmin(float x) {
205  mPZmin = x;
206  if (mPZmax<mPZmin) mNumBinsZ=1;
207  else mNumBinsZ = (int)ceil((mPZmax-mPZmin)/mDeltaP);
208  if (mNumBinsZ==0) mNumBinsZ=1;
209 }
210 inline void StHbtSectoredAnalysis::SetDeltaP(float x) {
211  if (x<=0) {
212  mDeltaP = 1.0;
213  cout << "****ERROR**** DeltaP must be greater than zero...setting DeltaP to 1.0" << endl;
214  }
215  else {
216  mDeltaP = x;
217  mNumBinsX = (int)ceil((mPXmax-mPXmin)/mDeltaP);
218  if (mNumBinsX==0) mNumBinsX=1;
219  mNumBinsY = (int)ceil((mPYmax-mPYmin)/mDeltaP);
220  if (mNumBinsY==0) mNumBinsY=1;
221  mNumBinsZ = (int)ceil((mPZmax-mPZmin)/mDeltaP);
222  if (mNumBinsZ==0) mNumBinsZ=1;
223  }
224 }
225 
226 #endif
227 
228 inline int StHbtSectoredAnalysis::GetNeventsProcessed() {return mNeventsProcessed;}
virtual void ProcessEvent(const StHbtEvent *)
returns reports of all cuts applied and correlation functions being done