32 #include "StHbtMaker/Infrastructure/StHbtVertexAnalysis.h"
33 #include "StHbtMaker/Infrastructure/StHbtParticleCollection.hh"
34 #include "StHbtMaker/Base/StHbtTrackCut.h"
35 #include "StHbtMaker/Base/StHbtV0Cut.h"
36 #include "StHbtMaker/Base/StHbtKinkCut.h"
37 #include "StHbtMaker/Infrastructure/StHbtPicoEventCollectionVector.hh"
38 #include "StHbtMaker/Infrastructure/StHbtPicoEventCollectionVectorHideAway.hh"
47 StHbtParticleCollection* partCollection);
51 StHbtVertexAnalysis::StHbtVertexAnalysis(
unsigned int bins,
double min,
double max){
54 mFirstParticleCut = 0;
55 mSecondParticleCut = 0;
57 mCorrFctnCollection= 0;
58 mCorrFctnCollection =
new StHbtCorrFctnCollection;
64 if (mMixingBuffer)
delete mMixingBuffer;
72 mFirstParticleCut = 0;
73 mSecondParticleCut = 0;
75 mCorrFctnCollection= 0;
76 mCorrFctnCollection =
new StHbtCorrFctnCollection;
77 mVertexBins = a.mVertexBins;
78 mVertexZ[0] = a.mVertexZ[0];
79 mVertexZ[1] = a.mVertexZ[1];
82 if (mMixingBuffer)
delete mMixingBuffer;
86 mEventCut = a.mEventCut->Clone();
88 mFirstParticleCut = a.mFirstParticleCut->Clone();
90 if (a.mFirstParticleCut==a.mSecondParticleCut)
91 SetSecondParticleCut(mFirstParticleCut);
93 mSecondParticleCut = a.mSecondParticleCut->Clone();
95 mPairCut = a.mPairCut->Clone();
98 SetEventCut(mEventCut);
99 cout <<
" StHbtVertexAnalysis::StHbtVertexAnalysis(const StHbtVertexAnalysis& a) - event cut set " << endl;
101 if ( mFirstParticleCut ) {
102 SetFirstParticleCut(mFirstParticleCut);
103 cout <<
" StHbtVertexAnalysis::StHbtVertexAnalysis(const StHbtVertexAnalysis& a) - first particle cut set " << endl;
105 if ( mSecondParticleCut ) {
106 SetSecondParticleCut(mSecondParticleCut);
107 cout <<
" StHbtVertexAnalysis::StHbtVertexAnalysis(const StHbtVertexAnalysis& a) - second particle cut set " << endl;
109 SetPairCut(mPairCut);
110 cout <<
" StHbtVertexAnalysis::StHbtVertexAnalysis(const StHbtVertexAnalysis& a) - pair cut set " << endl;
113 StHbtCorrFctnIterator iter;
114 for (iter=a.mCorrFctnCollection->begin(); iter!=a.mCorrFctnCollection->end();iter++){
115 cout <<
" StHbtVertexAnalysis::StHbtVertexAnalysis(const StHbtVertexAnalysis& a) - looking for correlation functions " << endl;
117 if (fctn) AddCorrFctn(fctn);
118 else cout <<
" StHbtVertexAnalysis::StHbtVertexAnalysis(const StHbtVertexAnalysis& a) - correlation function not found " << endl;
121 mNumEventsToMix = a.mNumEventsToMix;
123 cout <<
" StHbtVertexAnalysis::StHbtVertexAnalysis(const StHbtVertexAnalysis& a) - analysis copied " << endl;
127 StHbtVertexAnalysis::~StHbtVertexAnalysis(){
129 delete mPicoEventCollectionVectorHideAway;
133 StHbtString StHbtVertexAnalysis::Report()
135 cout <<
"StHbtVertexAnalysis - constructing Report..."<<endl;
137 StHbtString temp =
"-----------\nHbt StHbtVertexAnalysis Report:\n";
138 sprintf(Ctemp,
"Events are mixed in %d bins in the range %E cm to %E cm.\n",mVertexBins,mVertexZ[0],mVertexZ[1]);
140 sprintf(Ctemp,
"Events underflowing: %d\n",mUnderFlow);
142 sprintf(Ctemp,
"Events overflowing: %d\n",mOverFlow);
144 sprintf(Ctemp,
"Now adding StHbtAnalysis(base) Report\n");
146 temp += StHbtAnalysis::Report();
147 StHbtString returnThis=temp;
152 cout <<
" StHbtVertexAnalysis::ProcessEvent(const StHbtEvent* hbtEvent) " << endl;
154 double vertexZ = hbtEvent->PrimVertPos().z();
155 mMixingBuffer = mPicoEventCollectionVectorHideAway->PicoEventCollection(vertexZ);
156 if (!mMixingBuffer) {
157 if ( vertexZ < mVertexZ[0] ) mUnderFlow++;
158 if ( vertexZ > mVertexZ[1] ) mOverFlow++;
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