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"
48 StHbtParticleCollection* partCollection);
52 StHbtVertexMultAnalysis::StHbtVertexMultAnalysis(
unsigned int binsVertex,
double minVertex,
double maxVertex,
53 unsigned int binsMult,
double minMult,
double maxMult)
54 : mVertexZBins(binsVertex), mMultBins(binsMult) {
57 mFirstParticleCut = 0;
58 mSecondParticleCut = 0;
60 mCorrFctnCollection= 0;
61 mCorrFctnCollection =
new StHbtCorrFctnCollection;
62 mVertexZ[0] = minVertex;
63 mVertexZ[1] = maxVertex;
64 mUnderFlowVertexZ = 0;
70 if (mMixingBuffer)
delete mMixingBuffer;
72 mMultBins,mMult[0],mMult[1]);
79 mFirstParticleCut = 0;
80 mSecondParticleCut = 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;
89 mMultBins = a.mMultBins;
90 mMult[0] = a.mMult[0];
91 mMult[1] = a.mMult[1];
94 if (mMixingBuffer)
delete mMixingBuffer;
96 mMultBins,mMult[0],mMult[1]);
99 mEventCut = a.mEventCut->Clone();
101 mFirstParticleCut = a.mFirstParticleCut->Clone();
103 if (a.mFirstParticleCut==a.mSecondParticleCut)
104 SetSecondParticleCut(mFirstParticleCut);
106 mSecondParticleCut = a.mSecondParticleCut->Clone();
108 mPairCut = a.mPairCut->Clone();
111 SetEventCut(mEventCut);
112 cout <<
" StHbtVertexMultAnalysis::StHbtVertexMultAnalysis(const StHbtVertexMultAnalysis& a) - event cut set " << endl;
114 if ( mFirstParticleCut ) {
115 SetFirstParticleCut(mFirstParticleCut);
116 cout <<
" StHbtVertexMultAnalysis::StHbtVertexMultAnalysis(const StHbtVertexMultAnalysis& a) - first particle cut set " << endl;
118 if ( mSecondParticleCut ) {
119 SetSecondParticleCut(mSecondParticleCut);
120 cout <<
" StHbtVertexMultAnalysis::StHbtVertexMultAnalysis(const StHbtVertexMultAnalysis& a) - second particle cut set " << endl;
122 SetPairCut(mPairCut);
123 cout <<
" StHbtVertexMultAnalysis::StHbtVertexMultAnalysis(const StHbtVertexMultAnalysis& a) - pair cut set " << endl;
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;
130 if (fctn) AddCorrFctn(fctn);
131 else cout <<
" StHbtVertexMultAnalysis::StHbtVertexMultAnalysis(const StHbtVertexMultAnalysis& a) - correlation function not found " << endl;
134 mNumEventsToMix = a.mNumEventsToMix;
136 cout <<
" StHbtVertexMultAnalysis::StHbtVertexMultAnalysis(const StHbtVertexMultAnalysis& a) - analysis copied " << endl;
140 StHbtVertexMultAnalysis::~StHbtVertexMultAnalysis(){
142 delete mPicoEventCollectionVectorHideAway;
146 StHbtString StHbtVertexMultAnalysis::Report()
148 cout <<
"StHbtVertexMultAnalysis - constructing Report..."<<endl;
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]);
153 sprintf(Ctemp,
"Events underflowing: %d\n",mUnderFlowVertexZ);
155 sprintf(Ctemp,
"Events overflowing: %d\n",mOverFlowVertexZ);
157 sprintf(Ctemp,
"Events are mixed in %d Mult bins in the range %E cm to %E cm.\n",mMultBins,mMult[0],mMult[1]);
159 sprintf(Ctemp,
"Events underflowing: %d\n",mUnderFlowMult);
161 sprintf(Ctemp,
"Events overflowing: %d\n",mOverFlowMult);
163 sprintf(Ctemp,
"Now adding StHbtAnalysis(base) Report\n");
165 temp += StHbtAnalysis::Report();
166 StHbtString returnThis=temp;
171 cout <<
" StHbtVertexMultAnalysis::ProcessEvent(const StHbtEvent* hbtEvent) " << endl;
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++;
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