StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StHbtVertexMultAnalysis.cxx
1 /***************************************************************************
2  *
3  * $Id: StHbtVertexMultAnalysis.cxx,v 1.2 2005/06/28 23:12:24 chajecki Exp $
4  *
5  * Author: Frank Laue, Ohio State, laue@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: StHbtVertexMultAnalysis.cxx,v $
16  * Revision 1.2 2005/06/28 23:12:24 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.1 2001/11/11 18:34:14 laue
27  * StHbtPicoEventCollectionVectorHideAway: updated for 3d grid
28  * StHbtVertexMultAnalysis: new
29  *
30  *
31  **************************************************************************/
32 
33 #include "StHbtMaker/Infrastructure/StHbtVertexMultAnalysis.h"
34 #include "StHbtMaker/Infrastructure/StHbtParticleCollection.hh"
35 #include "StHbtMaker/Base/StHbtTrackCut.h"
36 #include "StHbtMaker/Base/StHbtV0Cut.h"
37 #include "StHbtMaker/Base/StHbtKinkCut.h"
38 #include "StHbtMaker/Infrastructure/StHbtPicoEventCollectionVector.hh"
39 #include "StHbtMaker/Infrastructure/StHbtPicoEventCollectionVectorHideAway.hh"
40 
41 
42 #ifdef __ROOT__
44 #endif
45 
46 extern void FillHbtParticleCollection(StHbtParticleCut* partCut,
47  StHbtEvent* hbtEvent,
48  StHbtParticleCollection* partCollection);
49 
50 
51 //____________________________
52 StHbtVertexMultAnalysis::StHbtVertexMultAnalysis(unsigned int binsVertex, double minVertex, double maxVertex,
53  unsigned int binsMult, double minMult, double maxMult)
54  : mVertexZBins(binsVertex), mMultBins(binsMult) {
55  // mControlSwitch = 0;
56  mEventCut = 0;
57  mFirstParticleCut = 0;
58  mSecondParticleCut = 0;
59  mPairCut = 0;
60  mCorrFctnCollection= 0;
61  mCorrFctnCollection = new StHbtCorrFctnCollection;
62  mVertexZ[0] = minVertex;
63  mVertexZ[1] = maxVertex;
64  mUnderFlowVertexZ = 0;
65  mOverFlowVertexZ = 0;
66  mMult[0] = minMult;
67  mMult[1] = maxMult;
68  mUnderFlowMult = 0;
69  mOverFlowMult = 0;
70  if (mMixingBuffer) delete mMixingBuffer;
71  mPicoEventCollectionVectorHideAway = new StHbtPicoEventCollectionVectorHideAway(mVertexZBins,mVertexZ[0],mVertexZ[1],
72  mMultBins,mMult[0],mMult[1]);
73 };
74 //____________________________
75 
76 StHbtVertexMultAnalysis::StHbtVertexMultAnalysis(const StHbtVertexMultAnalysis& a) : StHbtAnalysis() {
77  //StHbtVertexMultAnalysis();
78  mEventCut = 0;
79  mFirstParticleCut = 0;
80  mSecondParticleCut = 0;
81  mPairCut = 0;
82  mCorrFctnCollection= 0;
83  mCorrFctnCollection = new StHbtCorrFctnCollection;
84  mVertexZBins = a.mVertexZBins;
85  mVertexZ[0] = a.mVertexZ[0];
86  mVertexZ[1] = a.mVertexZ[1];
87  mUnderFlowVertexZ = 0;
88  mOverFlowVertexZ = 0;
89  mMultBins = a.mMultBins;
90  mMult[0] = a.mMult[0];
91  mMult[1] = a.mMult[1];
92  mUnderFlowMult = 0;
93  mOverFlowMult = 0;
94  if (mMixingBuffer) delete mMixingBuffer;
95  mPicoEventCollectionVectorHideAway = new StHbtPicoEventCollectionVectorHideAway(mVertexZBins,mVertexZ[0],mVertexZ[1],
96  mMultBins,mMult[0],mMult[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 << " StHbtVertexMultAnalysis::StHbtVertexMultAnalysis(const StHbtVertexMultAnalysis& a) - event cut set " << endl;
113  }
114  if ( mFirstParticleCut ) {
115  SetFirstParticleCut(mFirstParticleCut); // this will set the myAnalysis pointer inside the cut
116  cout << " StHbtVertexMultAnalysis::StHbtVertexMultAnalysis(const StHbtVertexMultAnalysis& a) - first particle cut set " << endl;
117  }
118  if ( mSecondParticleCut ) {
119  SetSecondParticleCut(mSecondParticleCut); // this will set the myAnalysis pointer inside the cut
120  cout << " StHbtVertexMultAnalysis::StHbtVertexMultAnalysis(const StHbtVertexMultAnalysis& a) - second particle cut set " << endl;
121  } if ( mPairCut ) {
122  SetPairCut(mPairCut); // this will set the myAnalysis pointer inside the cut
123  cout << " StHbtVertexMultAnalysis::StHbtVertexMultAnalysis(const StHbtVertexMultAnalysis& a) - pair cut set " << endl;
124  }
125 
126  StHbtCorrFctnIterator iter;
127  for (iter=a.mCorrFctnCollection->begin(); iter!=a.mCorrFctnCollection->end();iter++){
128  cout << " StHbtVertexMultAnalysis::StHbtVertexMultAnalysis(const StHbtVertexMultAnalysis& a) - looking for correlation functions " << endl;
129  StHbtCorrFctn* fctn = (*iter)->Clone();
130  if (fctn) AddCorrFctn(fctn);
131  else cout << " StHbtVertexMultAnalysis::StHbtVertexMultAnalysis(const StHbtVertexMultAnalysis& a) - correlation function not found " << endl;
132  }
133 
134  mNumEventsToMix = a.mNumEventsToMix;
135 
136  cout << " StHbtVertexMultAnalysis::StHbtVertexMultAnalysis(const StHbtVertexMultAnalysis& a) - analysis copied " << endl;
137 
138 }
139 //____________________________
140 StHbtVertexMultAnalysis::~StHbtVertexMultAnalysis(){
141  // now delete every PicoEvent in the EventMixingBuffer and then the Buffer itself
142  delete mPicoEventCollectionVectorHideAway;
143 }
144 
145 //____________________________
146 StHbtString StHbtVertexMultAnalysis::Report()
147 {
148  cout << "StHbtVertexMultAnalysis - constructing Report..."<<endl;
149  char Ctemp[200];
150  StHbtString temp = "-----------\nHbt StHbtVertexMultAnalysis Report:\n";
151  sprintf(Ctemp,"Events are mixed in %d VertexZ bins in the range %E cm to %E cm.\n",mVertexZBins,mVertexZ[0],mVertexZ[1]);
152  temp += Ctemp;
153  sprintf(Ctemp,"Events underflowing: %d\n",mUnderFlowVertexZ);
154  temp += Ctemp;
155  sprintf(Ctemp,"Events overflowing: %d\n",mOverFlowVertexZ);
156  temp += Ctemp;
157  sprintf(Ctemp,"Events are mixed in %d Mult bins in the range %E cm to %E cm.\n",mMultBins,mMult[0],mMult[1]);
158  temp += Ctemp;
159  sprintf(Ctemp,"Events underflowing: %d\n",mUnderFlowMult);
160  temp += Ctemp;
161  sprintf(Ctemp,"Events overflowing: %d\n",mOverFlowMult);
162  temp += Ctemp;
163  sprintf(Ctemp,"Now adding StHbtAnalysis(base) Report\n");
164  temp += Ctemp;
165  temp += StHbtAnalysis::Report();
166  StHbtString returnThis=temp;
167  return returnThis;
168 }
169 //_________________________
171  cout << " StHbtVertexMultAnalysis::ProcessEvent(const StHbtEvent* hbtEvent) " << endl;
172  // get right mixing buffer
173  double vertexZ = hbtEvent->PrimVertPos().z();
174  double mult = hbtEvent->UncorrectedNumberOfPrimaries();
175  mMixingBuffer = mPicoEventCollectionVectorHideAway->PicoEventCollection(vertexZ,mult);
176  if (!mMixingBuffer) {
177  if ( vertexZ < mVertexZ[0] ) mUnderFlowVertexZ++;
178  if ( vertexZ > mVertexZ[1] ) mOverFlowVertexZ++;
179  if ( mult < mMult[0] ) mUnderFlowMult++;
180  if ( mult > mMult[1] ) mOverFlowMult++;
181  return;
182  }
183  // call ProcessEvent() from StHbtAnalysis-base
184  StHbtAnalysis::ProcessEvent(hbtEvent);
185 }
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