1 ////////////////////////////////////////////////////////////////////////////
3 // AliFemtoVertexAnalysis - Femtoscopic analysis which mixes events //
4 // with respect to the z position of the primary vertex //
6 ////////////////////////////////////////////////////////////////////////////
7 /***************************************************************************
11 * Author: Frank Laue, Ohio State, laue@mps.ohio-state.edu
12 ***************************************************************************
14 * Description: part of STAR HBT Framework: AliFemtoMaker package
15 * This is the Class for Analysis objects. Each of the simultaneous
16 * Analyses running should have one of these instantiated. They link
17 * into the Manager in an Analysis Collection.
19 ***************************************************************************
22 * Revision 1.2.2.2 2007/10/12 14:28:37 akisiel
23 * New wave of cleanup and rule conformance
25 * Revision 1.2.2.1 2007/10/05 09:38:17 akisiel
28 * Revision 1.2 2007/07/09 16:17:11 mlisa
29 * several files changed to change name of AliFemtoAnalysis to AliFemtoSimpleAnalysis and AliFemtoBaseAnalysis to AliFemtoAnalysis. Also removed some hard-coded cuts of Marek
31 * Revision 1.1 2007/05/16 10:22:12 akisiel
32 * Making the directory structure of AliFemto flat. All files go into one common directory
34 * Revision 1.2 2007/05/03 09:39:37 akisiel
35 * Fixing Effective C++ warnings
37 * Revision 1.1.1.1 2007/04/25 15:38:41 panos
38 * Importing the HBT code dir
40 * Revision 1.1.1.1 2007/03/07 10:14:49 mchojnacki
41 * First version on CVS
43 * Revision 1.5 2001/05/25 23:24:00 lisa
44 * Added in AliFemtoKink stuff
46 * Revision 1.4 2000/08/31 22:31:32 laue
47 * AliFemtoSimpleAnalysis: output changed (a little bit less)
48 * AliFemtoEvent: new version, members for reference mult added
49 * AliFemtoIOBinary: new IO for new AliFemtoEvent version
50 * AliFemtoTypes: TTree typedef to AliFemtoTTree added
51 * AliFemtoVertexAnalysis: overflow and underflow added
53 * Revision 1.1 2000/07/16 21:44:11 laue
54 * Collection and analysis for vertex dependent event mixing
57 **************************************************************************/
59 #include "AliFemtoVertexAnalysis.h"
60 #include "AliFemtoParticleCollection.h"
61 #include "AliFemtoTrackCut.h"
62 #include "AliFemtoV0Cut.h"
63 #include "AliFemtoKinkCut.h"
64 #include "AliFemtoPicoEventCollectionVector.h"
65 #include "AliFemtoPicoEventCollectionVectorHideAway.h"
69 ClassImp(AliFemtoVertexAnalysis)
72 extern void FillHbtParticleCollection(AliFemtoParticleCut* partCut,
73 AliFemtoEvent* hbtEvent,
74 AliFemtoParticleCollection* partCollection);
77 //____________________________
78 AliFemtoVertexAnalysis::AliFemtoVertexAnalysis(unsigned int bins, double min, double max):
83 // mControlSwitch = 0;
85 fFirstParticleCut = 0;
86 fSecondParticleCut = 0;
88 fCorrFctnCollection= 0;
89 fCorrFctnCollection = new AliFemtoCorrFctnCollection;
95 if (fMixingBuffer) delete fMixingBuffer;
96 fPicoEventCollectionVectorHideAway = new AliFemtoPicoEventCollectionVectorHideAway(fVertexBins,fVertexZ[0],fVertexZ[1]);
98 //____________________________
100 AliFemtoVertexAnalysis::AliFemtoVertexAnalysis(const AliFemtoVertexAnalysis& a) :
101 AliFemtoSimpleAnalysis(),
106 //AliFemtoVertexAnalysis();
108 fFirstParticleCut = 0;
109 fSecondParticleCut = 0;
111 fCorrFctnCollection= 0;
112 fCorrFctnCollection = new AliFemtoCorrFctnCollection;
113 fVertexBins = a.fVertexBins;
114 fVertexZ[0] = a.fVertexZ[0];
115 fVertexZ[1] = a.fVertexZ[1];
118 if (fMixingBuffer) delete fMixingBuffer;
119 fPicoEventCollectionVectorHideAway = new AliFemtoPicoEventCollectionVectorHideAway(fVertexBins,fVertexZ[0],fVertexZ[1]);
121 // find the right event cut
122 fEventCut = a.fEventCut->Clone();
123 // find the right first particle cut
124 fFirstParticleCut = a.fFirstParticleCut->Clone();
125 // find the right second particle cut
126 if (a.fFirstParticleCut==a.fSecondParticleCut)
127 SetSecondParticleCut(fFirstParticleCut); // identical particle hbt
129 fSecondParticleCut = a.fSecondParticleCut->Clone();
131 fPairCut = a.fPairCut->Clone();
134 SetEventCut(fEventCut); // this will set the myAnalysis pointer inside the cut
135 cout << " AliFemtoVertexAnalysis::AliFemtoVertexAnalysis(const AliFemtoVertexAnalysis& a) - event cut set " << endl;
137 if ( fFirstParticleCut ) {
138 SetFirstParticleCut(fFirstParticleCut); // this will set the myAnalysis pointer inside the cut
139 cout << " AliFemtoVertexAnalysis::AliFemtoVertexAnalysis(const AliFemtoVertexAnalysis& a) - first particle cut set " << endl;
141 if ( fSecondParticleCut ) {
142 SetSecondParticleCut(fSecondParticleCut); // this will set the myAnalysis pointer inside the cut
143 cout << " AliFemtoVertexAnalysis::AliFemtoVertexAnalysis(const AliFemtoVertexAnalysis& a) - second particle cut set " << endl;
145 SetPairCut(fPairCut); // this will set the myAnalysis pointer inside the cut
146 cout << " AliFemtoVertexAnalysis::AliFemtoVertexAnalysis(const AliFemtoVertexAnalysis& a) - pair cut set " << endl;
149 AliFemtoCorrFctnIterator iter;
150 for (iter=a.fCorrFctnCollection->begin(); iter!=a.fCorrFctnCollection->end();iter++){
151 cout << " AliFemtoVertexAnalysis::AliFemtoVertexAnalysis(const AliFemtoVertexAnalysis& a) - looking for correlation functions " << endl;
152 AliFemtoCorrFctn* fctn = (*iter)->Clone();
153 if (fctn) AddCorrFctn(fctn);
154 else cout << " AliFemtoVertexAnalysis::AliFemtoVertexAnalysis(const AliFemtoVertexAnalysis& a) - correlation function not found " << endl;
157 fNumEventsToMix = a.fNumEventsToMix;
159 cout << " AliFemtoVertexAnalysis::AliFemtoVertexAnalysis(const AliFemtoVertexAnalysis& a) - analysis copied " << endl;
163 AliFemtoVertexAnalysis& AliFemtoVertexAnalysis::operator=(const AliFemtoVertexAnalysis& OriginalAnalysis)
165 if (this != &OriginalAnalysis) {
166 //AliFemtoVertexAnalysis();
168 fFirstParticleCut = 0;
169 fSecondParticleCut = 0;
171 fCorrFctnCollection= 0;
172 fCorrFctnCollection = new AliFemtoCorrFctnCollection;
173 fVertexBins = OriginalAnalysis.fVertexBins;
174 fVertexZ[0] = OriginalAnalysis.fVertexZ[0];
175 fVertexZ[1] = OriginalAnalysis.fVertexZ[1];
178 if (fMixingBuffer) delete fMixingBuffer;
179 fPicoEventCollectionVectorHideAway = new AliFemtoPicoEventCollectionVectorHideAway(fVertexBins,fVertexZ[0],fVertexZ[1]);
181 // find the right event cut
182 fEventCut = OriginalAnalysis.fEventCut->Clone();
183 // find the right first particle cut
184 fFirstParticleCut = OriginalAnalysis.fFirstParticleCut->Clone();
185 // find the right second particle cut
186 if (OriginalAnalysis.fFirstParticleCut==OriginalAnalysis.fSecondParticleCut)
187 SetSecondParticleCut(fFirstParticleCut); // identical particle hbt
189 fSecondParticleCut = OriginalAnalysis.fSecondParticleCut->Clone();
191 fPairCut = OriginalAnalysis.fPairCut->Clone();
194 SetEventCut(fEventCut); // this will set the myAnalysis pointer inside the cut
195 cout << " AliFemtoVertexAnalysis::AliFemtoVertexAnalysis(const AliFemtoVertexAnalysis& a) - event cut set " << endl;
197 if ( fFirstParticleCut ) {
198 SetFirstParticleCut(fFirstParticleCut); // this will set the myAnalysis pointer inside the cut
199 cout << " AliFemtoVertexAnalysis::AliFemtoVertexAnalysis(const AliFemtoVertexAnalysis& a) - first particle cut set " << endl;
201 if ( fSecondParticleCut ) {
202 SetSecondParticleCut(fSecondParticleCut); // this will set the myAnalysis pointer inside the cut
203 cout << " AliFemtoVertexAnalysis::AliFemtoVertexAnalysis(const AliFemtoVertexAnalysis& a) - second particle cut set " << endl;
205 SetPairCut(fPairCut); // this will set the myAnalysis pointer inside the cut
206 cout << " AliFemtoVertexAnalysis::AliFemtoVertexAnalysis(const AliFemtoVertexAnalysis& a) - pair cut set " << endl;
209 AliFemtoCorrFctnIterator iter;
210 for (iter=OriginalAnalysis.fCorrFctnCollection->begin(); iter!=OriginalAnalysis.fCorrFctnCollection->end();iter++){
211 cout << " AliFemtoVertexAnalysis::AliFemtoVertexAnalysis(const AliFemtoVertexAnalysis& a) - looking for correlation functions " << endl;
212 AliFemtoCorrFctn* fctn = (*iter)->Clone();
213 if (fctn) AddCorrFctn(fctn);
214 else cout << " AliFemtoVertexAnalysis::AliFemtoVertexAnalysis(const AliFemtoVertexAnalysis& a) - correlation function not found " << endl;
217 fNumEventsToMix = OriginalAnalysis.fNumEventsToMix;
219 cout << " AliFemtoVertexAnalysis::AliFemtoVertexAnalysis(const AliFemtoVertexAnalysis& a) - analysis copied " << endl;
225 //____________________________
226 AliFemtoVertexAnalysis::~AliFemtoVertexAnalysis(){
227 // now delete every PicoEvent in the EventMixingBuffer and then the Buffer itself
228 delete fPicoEventCollectionVectorHideAway;
231 //____________________________
232 AliFemtoString AliFemtoVertexAnalysis::Report()
234 // prepare report fromt the execution
235 cout << "AliFemtoVertexAnalysis - constructing Report..."<<endl;
237 AliFemtoString temp = "-----------\nHbt AliFemtoVertexAnalysis Report:\n";
238 snprintf(ctemp , 200, "Events are mixed in %d bins in the range %E cm to %E cm.\n",fVertexBins,fVertexZ[0],fVertexZ[1]);
240 snprintf(ctemp , 200, "Events underflowing: %d\n",fUnderFlow);
242 snprintf(ctemp , 200, "Events overflowing: %d\n",fOverFlow);
244 snprintf(ctemp , 200, "Now adding AliFemtoSimpleAnalysis(base) Report\n");
246 temp += AliFemtoSimpleAnalysis::Report();
247 AliFemtoString returnThis=temp;
250 //_________________________
251 void AliFemtoVertexAnalysis::ProcessEvent(const AliFemtoEvent* hbtEvent) {
252 // Put the event though the analysis
253 cout << " AliFemtoVertexAnalysis::ProcessEvent(const AliFemtoEvent* hbtEvent) " << endl;
254 // get right mixing buffer
255 double vertexZ = hbtEvent->PrimVertPos().z();
256 fMixingBuffer = fPicoEventCollectionVectorHideAway->PicoEventCollection(vertexZ);
257 if (!fMixingBuffer) {
258 if ( vertexZ < fVertexZ[0] ) fUnderFlow++;
259 if ( vertexZ > fVertexZ[1] ) fOverFlow++;
262 // call ProcessEvent() from AliFemtoSimpleAnalysis-base
263 AliFemtoSimpleAnalysis::ProcessEvent(hbtEvent);