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.2.2.2 2007/10/12 14:28:37 akisiel
17 * New wave of cleanup and rule conformance
19 * Revision 1.2.2.1 2007/10/05 09:38:17 akisiel
22 * Revision 1.2 2007/07/09 16:17:11 mlisa
23 * several files changed to change name of AliFemtoAnalysis to AliFemtoSimpleAnalysis and AliFemtoBaseAnalysis to AliFemtoAnalysis. Also removed some hard-coded cuts of Marek
25 * Revision 1.1 2007/05/16 10:22:12 akisiel
26 * Making the directory structure of AliFemto flat. All files go into one common directory
28 * Revision 1.2 2007/05/03 09:39:37 akisiel
29 * Fixing Effective C++ warnings
31 * Revision 1.1.1.1 2007/04/25 15:38:41 panos
32 * Importing the HBT code dir
34 * Revision 1.1.1.1 2007/03/07 10:14:49 mchojnacki
35 * First version on CVS
37 * Revision 1.2 2005/06/28 23:12:24 chajecki
38 * UncorrectedNumberOfNegativePrimaries() -> UncorrectedNumberOfPrimaries()
40 * For data taken in Y2 and later the centrality definition bases
41 * on UncorrectedNumberOfPrimaries() while for Y1(AuAu@130)
42 * it based on UncorrectedNumberOfNegativePrimaries().
43 * But in many places of HBT code the number of negative primaries
44 * was used as a multiplicity for all productions.
45 * This has been fixed.
47 * Revision 1.1 2001/11/11 18:34:14 laue
48 * AliFemtoPicoEventCollectionVectorHideAway: updated for 3d grid
49 * AliFemtoVertexMultAnalysis: new
52 **************************************************************************/
53 ////////////////////////////////////////////////////////////////////////////
55 // AliFemtoVertexMultAnalysis - Femtoscopic analysis which mixes event //
56 // with respect to the z position of the primary vertex and event total //
58 // You need to provide the number of z-vertex and multiplicity bins //
59 // as well as ranges for the variables //
61 ////////////////////////////////////////////////////////////////////////////
63 #include "AliFemtoVertexMultAnalysis.h"
64 #include "AliFemtoParticleCollection.h"
65 #include "AliFemtoTrackCut.h"
66 #include "AliFemtoV0Cut.h"
67 #include "AliFemtoKinkCut.h"
68 #include "AliFemtoPicoEventCollectionVector.h"
69 #include "AliFemtoPicoEventCollectionVectorHideAway.h"
73 ClassImp(AliFemtoVertexMultAnalysis)
76 extern void FillHbtParticleCollection(AliFemtoParticleCut* partCut,
77 AliFemtoEvent* hbtEvent,
78 AliFemtoParticleCollection* partCollection);
81 //____________________________
82 AliFemtoVertexMultAnalysis::AliFemtoVertexMultAnalysis(unsigned int binsVertex, double minVertex, double maxVertex,
83 unsigned int binsMult, double minMult, double maxMult)
85 fVertexZBins(binsVertex),
92 // mControlSwitch = 0;
94 fFirstParticleCut = 0;
95 fSecondParticleCut = 0;
97 fCorrFctnCollection= 0;
98 fCorrFctnCollection = new AliFemtoCorrFctnCollection;
99 fVertexZ[0] = minVertex;
100 fVertexZ[1] = maxVertex;
101 fUnderFlowVertexZ = 0;
102 fOverFlowVertexZ = 0;
107 if (fMixingBuffer) delete fMixingBuffer;
108 fPicoEventCollectionVectorHideAway = new AliFemtoPicoEventCollectionVectorHideAway(fVertexZBins,fVertexZ[0],fVertexZ[1],
109 fMultBins,fMult[0],fMult[1]);
111 //____________________________
113 AliFemtoVertexMultAnalysis::AliFemtoVertexMultAnalysis(const AliFemtoVertexMultAnalysis& a) :
114 AliFemtoSimpleAnalysis(),
115 fVertexZBins(a.fVertexZBins),
117 fUnderFlowVertexZ(0),
118 fMultBins(a.fMultBins) ,
122 //AliFemtoVertexMultAnalysis();
124 fFirstParticleCut = 0;
125 fSecondParticleCut = 0;
127 fCorrFctnCollection= 0;
128 fCorrFctnCollection = new AliFemtoCorrFctnCollection;
129 fVertexZ[0] = a.fVertexZ[0];
130 fVertexZ[1] = a.fVertexZ[1];
131 fUnderFlowVertexZ = 0;
132 fOverFlowVertexZ = 0;
133 fMult[0] = a.fMult[0];
134 fMult[1] = a.fMult[1];
137 if (fMixingBuffer) delete fMixingBuffer;
138 fPicoEventCollectionVectorHideAway = new AliFemtoPicoEventCollectionVectorHideAway(fVertexZBins,fVertexZ[0],fVertexZ[1],
139 fMultBins,fMult[0],fMult[1]);
141 // find the right event cut
142 fEventCut = a.fEventCut->Clone();
143 // find the right first particle cut
144 fFirstParticleCut = a.fFirstParticleCut->Clone();
145 // find the right second particle cut
146 if (a.fFirstParticleCut==a.fSecondParticleCut)
147 SetSecondParticleCut(fFirstParticleCut); // identical particle hbt
149 fSecondParticleCut = a.fSecondParticleCut->Clone();
151 fPairCut = a.fPairCut->Clone();
154 SetEventCut(fEventCut); // this will set the myAnalysis pointer inside the cut
155 cout << " AliFemtoVertexMultAnalysis::AliFemtoVertexMultAnalysis(const AliFemtoVertexMultAnalysis& a) - event cut set " << endl;
157 if ( fFirstParticleCut ) {
158 SetFirstParticleCut(fFirstParticleCut); // this will set the myAnalysis pointer inside the cut
159 cout << " AliFemtoVertexMultAnalysis::AliFemtoVertexMultAnalysis(const AliFemtoVertexMultAnalysis& a) - first particle cut set " << endl;
161 if ( fSecondParticleCut ) {
162 SetSecondParticleCut(fSecondParticleCut); // this will set the myAnalysis pointer inside the cut
163 cout << " AliFemtoVertexMultAnalysis::AliFemtoVertexMultAnalysis(const AliFemtoVertexMultAnalysis& a) - second particle cut set " << endl;
165 SetPairCut(fPairCut); // this will set the myAnalysis pointer inside the cut
166 cout << " AliFemtoVertexMultAnalysis::AliFemtoVertexMultAnalysis(const AliFemtoVertexMultAnalysis& a) - pair cut set " << endl;
169 AliFemtoCorrFctnIterator iter;
170 for (iter=a.fCorrFctnCollection->begin(); iter!=a.fCorrFctnCollection->end();iter++){
171 cout << " AliFemtoVertexMultAnalysis::AliFemtoVertexMultAnalysis(const AliFemtoVertexMultAnalysis& a) - looking for correlation functions " << endl;
172 AliFemtoCorrFctn* fctn = (*iter)->Clone();
173 if (fctn) AddCorrFctn(fctn);
174 else cout << " AliFemtoVertexMultAnalysis::AliFemtoVertexMultAnalysis(const AliFemtoVertexMultAnalysis& a) - correlation function not found " << endl;
177 fNumEventsToMix = a.fNumEventsToMix;
179 cout << " AliFemtoVertexMultAnalysis::AliFemtoVertexMultAnalysis(const AliFemtoVertexMultAnalysis& a) - analysis copied " << endl;
182 AliFemtoVertexMultAnalysis& AliFemtoVertexMultAnalysis::operator=(const AliFemtoVertexMultAnalysis& TheOriginalAnalysis)
184 if (this != &TheOriginalAnalysis) {
185 AliFemtoVertexMultAnalysis::operator=(TheOriginalAnalysis);
186 fVertexZBins = TheOriginalAnalysis.fVertexZBins;
187 fMultBins = TheOriginalAnalysis.fMultBins;
190 fFirstParticleCut = 0;
191 fSecondParticleCut = 0;
193 if (fCorrFctnCollection) delete fCorrFctnCollection;
194 fCorrFctnCollection = new AliFemtoCorrFctnCollection;
195 fVertexZ[0] = TheOriginalAnalysis.fVertexZ[0];
196 fVertexZ[1] = TheOriginalAnalysis.fVertexZ[1];
197 fUnderFlowVertexZ = 0;
198 fOverFlowVertexZ = 0;
199 fMult[0] = TheOriginalAnalysis.fMult[0];
200 fMult[1] = TheOriginalAnalysis.fMult[1];
203 if (fMixingBuffer) delete fMixingBuffer;
204 if (fPicoEventCollectionVectorHideAway) delete fPicoEventCollectionVectorHideAway;
205 fPicoEventCollectionVectorHideAway = new AliFemtoPicoEventCollectionVectorHideAway(fVertexZBins,fVertexZ[0],fVertexZ[1],
206 fMultBins,fMult[0],fMult[1]);
208 // find the right event cut
209 fEventCut = TheOriginalAnalysis.fEventCut->Clone();
210 // find the right first particle cut
211 fFirstParticleCut = TheOriginalAnalysis.fFirstParticleCut->Clone();
212 // find the right second particle cut
213 if (TheOriginalAnalysis.fFirstParticleCut==TheOriginalAnalysis.fSecondParticleCut)
214 SetSecondParticleCut(fFirstParticleCut); // identical particle hbt
216 fSecondParticleCut = TheOriginalAnalysis.fSecondParticleCut->Clone();
218 fPairCut = TheOriginalAnalysis.fPairCut->Clone();
221 SetEventCut(fEventCut); // this will set the myAnalysis pointer inside the cut
223 if ( fFirstParticleCut ) {
224 SetFirstParticleCut(fFirstParticleCut); // this will set the myAnalysis pointer inside the cut
226 if ( fSecondParticleCut ) {
227 SetSecondParticleCut(fSecondParticleCut); // this will set the myAnalysis pointer inside the cut
229 SetPairCut(fPairCut); // this will set the myAnalysis pointer inside the cut
233 AliFemtoCorrFctnIterator iter;
234 for (iter=TheOriginalAnalysis.fCorrFctnCollection->begin(); iter!=TheOriginalAnalysis.fCorrFctnCollection->end();iter++){
235 AliFemtoCorrFctn* fctn = (*iter)->Clone();
236 if (fctn) AddCorrFctn(fctn);
239 fNumEventsToMix = TheOriginalAnalysis.fNumEventsToMix;
244 //____________________________
245 AliFemtoVertexMultAnalysis::~AliFemtoVertexMultAnalysis(){
246 // now delete every PicoEvent in the EventMixingBuffer and then the Buffer itself
247 delete fPicoEventCollectionVectorHideAway;
250 //____________________________
251 AliFemtoString AliFemtoVertexMultAnalysis::Report()
253 // Prepare a report of the execution
254 cout << "AliFemtoVertexMultAnalysis - constructing Report..."<<endl;
256 AliFemtoString temp = "-----------\nHbt AliFemtoVertexMultAnalysis Report:\n";
257 snprintf(ctemp , 200, "Events are mixed in %d VertexZ bins in the range %E cm to %E cm.\n",fVertexZBins,fVertexZ[0],fVertexZ[1]);
259 snprintf(ctemp , 200, "Events underflowing: %d\n",fUnderFlowVertexZ);
261 snprintf(ctemp , 200, "Events overflowing: %d\n",fOverFlowVertexZ);
263 snprintf(ctemp , 200, "Events are mixed in %d Mult bins in the range %E cm to %E cm.\n",fMultBins,fMult[0],fMult[1]);
265 snprintf(ctemp , 200, "Events underflowing: %d\n",fUnderFlowMult);
267 snprintf(ctemp , 200, "Events overflowing: %d\n",fOverFlowMult);
269 snprintf(ctemp , 200, "Now adding AliFemtoSimpleAnalysis(base) Report\n");
271 temp += AliFemtoSimpleAnalysis::Report();
272 AliFemtoString returnThis=temp;
275 //_________________________
276 void AliFemtoVertexMultAnalysis::ProcessEvent(const AliFemtoEvent* hbtEvent) {
277 // Perform event processing
278 // in bins of z vertex and multiplicity
280 // cout << " AliFemtoVertexMultAnalysis::ProcessEvent(const AliFemtoEvent* hbtEvent) " << endl;
281 // get right mixing buffer
282 double vertexZ = hbtEvent->PrimVertPos().z();
283 double mult = hbtEvent->UncorrectedNumberOfPrimaries();
284 fMixingBuffer = fPicoEventCollectionVectorHideAway->PicoEventCollection(vertexZ,mult);
285 if (!fMixingBuffer) {
286 if ( vertexZ < fVertexZ[0] ) fUnderFlowVertexZ++;
287 if ( vertexZ > fVertexZ[1] ) fOverFlowVertexZ++;
288 if ( mult < fMult[0] ) fUnderFlowMult++;
289 if ( mult > fMult[1] ) fOverFlowMult++;
292 //cout<<" AliFemtoVertexMultAnalysis:: -> Simple"<<endl;
293 // call ProcessEvent() from AliFemtoSimpleAnalysis-base
294 AliFemtoSimpleAnalysis::ProcessEvent(hbtEvent);