1 /***************************************************************************
5 * Author: Frank Laue, Ohio State, laue@mps.ohio-state.edu
6 ***************************************************************************
8 * Description: part of STAR HBT Framework: AliFemtoMaker 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.
13 ***************************************************************************
16 * Revision 1.1 2007/05/16 10:22:12 akisiel
17 * Making the directory structure of AliFemto flat. All files go into one common directory
19 * Revision 1.2 2007/05/03 09:39:37 akisiel
20 * Fixing Effective C++ warnings
22 * Revision 1.1.1.1 2007/04/25 15:38:41 panos
23 * Importing the HBT code dir
25 * Revision 1.1.1.1 2007/03/07 10:14:49 mchojnacki
26 * First version on CVS
28 * Revision 1.5 2001/05/25 23:24:00 lisa
29 * Added in AliFemtoKink stuff
31 * Revision 1.4 2000/08/31 22:31:32 laue
32 * AliFemtoSimpleAnalysis: output changed (a little bit less)
33 * AliFemtoEvent: new version, members for reference mult added
34 * AliFemtoIOBinary: new IO for new AliFemtoEvent version
35 * AliFemtoTypes: TTree typedef to AliFemtoTTree added
36 * AliFemtoVertexAnalysis: overflow and underflow added
38 * Revision 1.1 2000/07/16 21:44:11 laue
39 * Collection and analysis for vertex dependent event mixing
42 **************************************************************************/
44 #include "AliFemtoVertexAnalysis.h"
45 #include "AliFemtoParticleCollection.h"
46 #include "AliFemtoTrackCut.h"
47 #include "AliFemtoV0Cut.h"
48 #include "AliFemtoKinkCut.h"
49 #include "AliFemtoPicoEventCollectionVector.h"
50 #include "AliFemtoPicoEventCollectionVectorHideAway.h"
54 ClassImp(AliFemtoVertexAnalysis)
57 extern void FillHbtParticleCollection(AliFemtoParticleCut* partCut,
58 AliFemtoEvent* hbtEvent,
59 AliFemtoParticleCollection* partCollection);
62 //____________________________
63 AliFemtoVertexAnalysis::AliFemtoVertexAnalysis(unsigned int bins, double min, double max):
68 // mControlSwitch = 0;
70 fFirstParticleCut = 0;
71 fSecondParticleCut = 0;
73 fCorrFctnCollection= 0;
74 fCorrFctnCollection = new AliFemtoCorrFctnCollection;
80 if (fMixingBuffer) delete fMixingBuffer;
81 fPicoEventCollectionVectorHideAway = new AliFemtoPicoEventCollectionVectorHideAway(fVertexBins,fVertexZ[0],fVertexZ[1]);
83 //____________________________
85 AliFemtoVertexAnalysis::AliFemtoVertexAnalysis(const AliFemtoVertexAnalysis& a) :
86 AliFemtoSimpleAnalysis(),
91 //AliFemtoVertexAnalysis();
93 fFirstParticleCut = 0;
94 fSecondParticleCut = 0;
96 fCorrFctnCollection= 0;
97 fCorrFctnCollection = new AliFemtoCorrFctnCollection;
98 fVertexBins = a.fVertexBins;
99 fVertexZ[0] = a.fVertexZ[0];
100 fVertexZ[1] = a.fVertexZ[1];
103 if (fMixingBuffer) delete fMixingBuffer;
104 fPicoEventCollectionVectorHideAway = new AliFemtoPicoEventCollectionVectorHideAway(fVertexBins,fVertexZ[0],fVertexZ[1]);
106 // find the right event cut
107 fEventCut = a.fEventCut->Clone();
108 // find the right first particle cut
109 fFirstParticleCut = a.fFirstParticleCut->Clone();
110 // find the right second particle cut
111 if (a.fFirstParticleCut==a.fSecondParticleCut)
112 SetSecondParticleCut(fFirstParticleCut); // identical particle hbt
114 fSecondParticleCut = a.fSecondParticleCut->Clone();
116 fPairCut = a.fPairCut->Clone();
119 SetEventCut(fEventCut); // this will set the myAnalysis pointer inside the cut
120 cout << " AliFemtoVertexAnalysis::AliFemtoVertexAnalysis(const AliFemtoVertexAnalysis& a) - event cut set " << endl;
122 if ( fFirstParticleCut ) {
123 SetFirstParticleCut(fFirstParticleCut); // this will set the myAnalysis pointer inside the cut
124 cout << " AliFemtoVertexAnalysis::AliFemtoVertexAnalysis(const AliFemtoVertexAnalysis& a) - first particle cut set " << endl;
126 if ( fSecondParticleCut ) {
127 SetSecondParticleCut(fSecondParticleCut); // this will set the myAnalysis pointer inside the cut
128 cout << " AliFemtoVertexAnalysis::AliFemtoVertexAnalysis(const AliFemtoVertexAnalysis& a) - second particle cut set " << endl;
130 SetPairCut(fPairCut); // this will set the myAnalysis pointer inside the cut
131 cout << " AliFemtoVertexAnalysis::AliFemtoVertexAnalysis(const AliFemtoVertexAnalysis& a) - pair cut set " << endl;
134 AliFemtoCorrFctnIterator iter;
135 for (iter=a.fCorrFctnCollection->begin(); iter!=a.fCorrFctnCollection->end();iter++){
136 cout << " AliFemtoVertexAnalysis::AliFemtoVertexAnalysis(const AliFemtoVertexAnalysis& a) - looking for correlation functions " << endl;
137 AliFemtoCorrFctn* fctn = (*iter)->Clone();
138 if (fctn) AddCorrFctn(fctn);
139 else cout << " AliFemtoVertexAnalysis::AliFemtoVertexAnalysis(const AliFemtoVertexAnalysis& a) - correlation function not found " << endl;
142 fNumEventsToMix = a.fNumEventsToMix;
144 cout << " AliFemtoVertexAnalysis::AliFemtoVertexAnalysis(const AliFemtoVertexAnalysis& a) - analysis copied " << endl;
147 //____________________________
148 AliFemtoVertexAnalysis::~AliFemtoVertexAnalysis(){
149 // now delete every PicoEvent in the EventMixingBuffer and then the Buffer itself
150 delete fPicoEventCollectionVectorHideAway;
153 //____________________________
154 AliFemtoString AliFemtoVertexAnalysis::Report()
156 cout << "AliFemtoVertexAnalysis - constructing Report..."<<endl;
158 AliFemtoString temp = "-----------\nHbt AliFemtoVertexAnalysis Report:\n";
159 sprintf(Ctemp,"Events are mixed in %d bins in the range %E cm to %E cm.\n",fVertexBins,fVertexZ[0],fVertexZ[1]);
161 sprintf(Ctemp,"Events underflowing: %d\n",fUnderFlow);
163 sprintf(Ctemp,"Events overflowing: %d\n",fOverFlow);
165 sprintf(Ctemp,"Now adding AliFemtoSimpleAnalysis(base) Report\n");
167 temp += AliFemtoSimpleAnalysis::Report();
168 AliFemtoString returnThis=temp;
171 //_________________________
172 void AliFemtoVertexAnalysis::ProcessEvent(const AliFemtoEvent* hbtEvent) {
173 cout << " AliFemtoVertexAnalysis::ProcessEvent(const AliFemtoEvent* hbtEvent) " << endl;
174 // get right mixing buffer
175 double vertexZ = hbtEvent->PrimVertPos().z();
176 fMixingBuffer = fPicoEventCollectionVectorHideAway->PicoEventCollection(vertexZ);
177 if (!fMixingBuffer) {
178 if ( vertexZ < fVertexZ[0] ) fUnderFlow++;
179 if ( vertexZ > fVertexZ[1] ) fOverFlow++;
182 // call ProcessEvent() from AliFemtoSimpleAnalysis-base
183 AliFemtoSimpleAnalysis::ProcessEvent(hbtEvent);