00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #include "StHbtMaker/Infrastructure/StHbtVertexAnalysis.h"
00033 #include "StHbtMaker/Infrastructure/StHbtParticleCollection.hh"
00034 #include "StHbtMaker/Base/StHbtTrackCut.h"
00035 #include "StHbtMaker/Base/StHbtV0Cut.h"
00036 #include "StHbtMaker/Base/StHbtKinkCut.h"
00037 #include "StHbtMaker/Infrastructure/StHbtPicoEventCollectionVector.hh"
00038 #include "StHbtMaker/Infrastructure/StHbtPicoEventCollectionVectorHideAway.hh"
00039
00040
00041 #ifdef __ROOT__
00042 ClassImp(StHbtVertexAnalysis)
00043 #endif
00044
00045 extern void FillHbtParticleCollection(StHbtParticleCut* partCut,
00046 StHbtEvent* hbtEvent,
00047 StHbtParticleCollection* partCollection);
00048
00049
00050
00051 StHbtVertexAnalysis::StHbtVertexAnalysis(unsigned int bins, double min, double max){
00052
00053 mEventCut = 0;
00054 mFirstParticleCut = 0;
00055 mSecondParticleCut = 0;
00056 mPairCut = 0;
00057 mCorrFctnCollection= 0;
00058 mCorrFctnCollection = new StHbtCorrFctnCollection;
00059 mVertexBins = bins;
00060 mVertexZ[0] = min;
00061 mVertexZ[1] = max;
00062 mUnderFlow = 0;
00063 mOverFlow = 0;
00064 if (mMixingBuffer) delete mMixingBuffer;
00065 mPicoEventCollectionVectorHideAway = new StHbtPicoEventCollectionVectorHideAway(mVertexBins,mVertexZ[0],mVertexZ[1]);
00066 };
00067
00068
00069 StHbtVertexAnalysis::StHbtVertexAnalysis(const StHbtVertexAnalysis& a) : StHbtAnalysis() {
00070
00071 mEventCut = 0;
00072 mFirstParticleCut = 0;
00073 mSecondParticleCut = 0;
00074 mPairCut = 0;
00075 mCorrFctnCollection= 0;
00076 mCorrFctnCollection = new StHbtCorrFctnCollection;
00077 mVertexBins = a.mVertexBins;
00078 mVertexZ[0] = a.mVertexZ[0];
00079 mVertexZ[1] = a.mVertexZ[1];
00080 mUnderFlow = 0;
00081 mOverFlow = 0;
00082 if (mMixingBuffer) delete mMixingBuffer;
00083 mPicoEventCollectionVectorHideAway = new StHbtPicoEventCollectionVectorHideAway(mVertexBins,mVertexZ[0],mVertexZ[1]);
00084
00085
00086 mEventCut = a.mEventCut->Clone();
00087
00088 mFirstParticleCut = a.mFirstParticleCut->Clone();
00089
00090 if (a.mFirstParticleCut==a.mSecondParticleCut)
00091 SetSecondParticleCut(mFirstParticleCut);
00092 else
00093 mSecondParticleCut = a.mSecondParticleCut->Clone();
00094
00095 mPairCut = a.mPairCut->Clone();
00096
00097 if ( mEventCut ) {
00098 SetEventCut(mEventCut);
00099 cout << " StHbtVertexAnalysis::StHbtVertexAnalysis(const StHbtVertexAnalysis& a) - event cut set " << endl;
00100 }
00101 if ( mFirstParticleCut ) {
00102 SetFirstParticleCut(mFirstParticleCut);
00103 cout << " StHbtVertexAnalysis::StHbtVertexAnalysis(const StHbtVertexAnalysis& a) - first particle cut set " << endl;
00104 }
00105 if ( mSecondParticleCut ) {
00106 SetSecondParticleCut(mSecondParticleCut);
00107 cout << " StHbtVertexAnalysis::StHbtVertexAnalysis(const StHbtVertexAnalysis& a) - second particle cut set " << endl;
00108 } if ( mPairCut ) {
00109 SetPairCut(mPairCut);
00110 cout << " StHbtVertexAnalysis::StHbtVertexAnalysis(const StHbtVertexAnalysis& a) - pair cut set " << endl;
00111 }
00112
00113 StHbtCorrFctnIterator iter;
00114 for (iter=a.mCorrFctnCollection->begin(); iter!=a.mCorrFctnCollection->end();iter++){
00115 cout << " StHbtVertexAnalysis::StHbtVertexAnalysis(const StHbtVertexAnalysis& a) - looking for correlation functions " << endl;
00116 StHbtCorrFctn* fctn = (*iter)->Clone();
00117 if (fctn) AddCorrFctn(fctn);
00118 else cout << " StHbtVertexAnalysis::StHbtVertexAnalysis(const StHbtVertexAnalysis& a) - correlation function not found " << endl;
00119 }
00120
00121 mNumEventsToMix = a.mNumEventsToMix;
00122
00123 cout << " StHbtVertexAnalysis::StHbtVertexAnalysis(const StHbtVertexAnalysis& a) - analysis copied " << endl;
00124
00125 }
00126
00127 StHbtVertexAnalysis::~StHbtVertexAnalysis(){
00128
00129 delete mPicoEventCollectionVectorHideAway;
00130 }
00131
00132
00133 StHbtString StHbtVertexAnalysis::Report()
00134 {
00135 cout << "StHbtVertexAnalysis - constructing Report..."<<endl;
00136 char Ctemp[200];
00137 StHbtString temp = "-----------\nHbt StHbtVertexAnalysis Report:\n";
00138 sprintf(Ctemp,"Events are mixed in %d bins in the range %E cm to %E cm.\n",mVertexBins,mVertexZ[0],mVertexZ[1]);
00139 temp += Ctemp;
00140 sprintf(Ctemp,"Events underflowing: %d\n",mUnderFlow);
00141 temp += Ctemp;
00142 sprintf(Ctemp,"Events overflowing: %d\n",mOverFlow);
00143 temp += Ctemp;
00144 sprintf(Ctemp,"Now adding StHbtAnalysis(base) Report\n");
00145 temp += Ctemp;
00146 temp += StHbtAnalysis::Report();
00147 StHbtString returnThis=temp;
00148 return returnThis;
00149 }
00150
00151 void StHbtVertexAnalysis::ProcessEvent(const StHbtEvent* hbtEvent) {
00152 cout << " StHbtVertexAnalysis::ProcessEvent(const StHbtEvent* hbtEvent) " << endl;
00153
00154 double vertexZ = hbtEvent->PrimVertPos().z();
00155 mMixingBuffer = mPicoEventCollectionVectorHideAway->PicoEventCollection(vertexZ);
00156 if (!mMixingBuffer) {
00157 if ( vertexZ < mVertexZ[0] ) mUnderFlow++;
00158 if ( vertexZ > mVertexZ[1] ) mOverFlow++;
00159 return;
00160 }
00161
00162 StHbtAnalysis::ProcessEvent(hbtEvent);
00163 }