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)
77 //____________________________
78 AliFemtoVertexMultAnalysis::AliFemtoVertexMultAnalysis(unsigned int binsVertex, double minVertex, double maxVertex,
79 unsigned int binsMult, double minMult, double maxMult)
81 fVertexZBins(binsVertex),
88 // mControlSwitch = 0;
90 fFirstParticleCut = 0;
91 fSecondParticleCut = 0;
93 fCorrFctnCollection= 0;
94 fCorrFctnCollection = new AliFemtoCorrFctnCollection;
95 fVertexZ[0] = minVertex;
96 fVertexZ[1] = maxVertex;
97 fUnderFlowVertexZ = 0;
103 if (fMixingBuffer) delete fMixingBuffer;
104 fPicoEventCollectionVectorHideAway = new AliFemtoPicoEventCollectionVectorHideAway(fVertexZBins,fVertexZ[0],fVertexZ[1],
105 fMultBins,fMult[0],fMult[1]);
107 //____________________________
109 AliFemtoVertexMultAnalysis::AliFemtoVertexMultAnalysis(const AliFemtoVertexMultAnalysis& a) :
110 AliFemtoSimpleAnalysis(),
111 fVertexZBins(a.fVertexZBins),
113 fUnderFlowVertexZ(0),
114 fMultBins(a.fMultBins) ,
118 //AliFemtoVertexMultAnalysis();
120 fFirstParticleCut = 0;
121 fSecondParticleCut = 0;
123 fCorrFctnCollection= 0;
124 fCorrFctnCollection = new AliFemtoCorrFctnCollection;
125 fVertexZ[0] = a.fVertexZ[0];
126 fVertexZ[1] = a.fVertexZ[1];
127 fUnderFlowVertexZ = 0;
128 fOverFlowVertexZ = 0;
129 fMult[0] = a.fMult[0];
130 fMult[1] = a.fMult[1];
133 if (fMixingBuffer) delete fMixingBuffer;
134 fPicoEventCollectionVectorHideAway = new AliFemtoPicoEventCollectionVectorHideAway(fVertexZBins,fVertexZ[0],fVertexZ[1],
135 fMultBins,fMult[0],fMult[1]);
137 // find the right event cut
138 fEventCut = a.fEventCut->Clone();
139 // find the right first particle cut
140 fFirstParticleCut = a.fFirstParticleCut->Clone();
141 // find the right second particle cut
142 if (a.fFirstParticleCut==a.fSecondParticleCut)
143 SetSecondParticleCut(fFirstParticleCut); // identical particle hbt
145 fSecondParticleCut = a.fSecondParticleCut->Clone();
147 fPairCut = a.fPairCut->Clone();
150 SetEventCut(fEventCut); // this will set the myAnalysis pointer inside the cut
151 cout << " AliFemtoVertexMultAnalysis::AliFemtoVertexMultAnalysis(const AliFemtoVertexMultAnalysis& a) - event cut set " << endl;
153 if ( fFirstParticleCut ) {
154 SetFirstParticleCut(fFirstParticleCut); // this will set the myAnalysis pointer inside the cut
155 cout << " AliFemtoVertexMultAnalysis::AliFemtoVertexMultAnalysis(const AliFemtoVertexMultAnalysis& a) - first particle cut set " << endl;
157 if ( fSecondParticleCut ) {
158 SetSecondParticleCut(fSecondParticleCut); // this will set the myAnalysis pointer inside the cut
159 cout << " AliFemtoVertexMultAnalysis::AliFemtoVertexMultAnalysis(const AliFemtoVertexMultAnalysis& a) - second particle cut set " << endl;
161 SetPairCut(fPairCut); // this will set the myAnalysis pointer inside the cut
162 cout << " AliFemtoVertexMultAnalysis::AliFemtoVertexMultAnalysis(const AliFemtoVertexMultAnalysis& a) - pair cut set " << endl;
165 AliFemtoCorrFctnIterator iter;
166 for (iter=a.fCorrFctnCollection->begin(); iter!=a.fCorrFctnCollection->end();iter++){
167 cout << " AliFemtoVertexMultAnalysis::AliFemtoVertexMultAnalysis(const AliFemtoVertexMultAnalysis& a) - looking for correlation functions " << endl;
168 AliFemtoCorrFctn* fctn = (*iter)->Clone();
169 if (fctn) AddCorrFctn(fctn);
170 else cout << " AliFemtoVertexMultAnalysis::AliFemtoVertexMultAnalysis(const AliFemtoVertexMultAnalysis& a) - correlation function not found " << endl;
173 fNumEventsToMix = a.fNumEventsToMix;
175 cout << " AliFemtoVertexMultAnalysis::AliFemtoVertexMultAnalysis(const AliFemtoVertexMultAnalysis& a) - analysis copied " << endl;
178 AliFemtoVertexMultAnalysis& AliFemtoVertexMultAnalysis::operator=(const AliFemtoVertexMultAnalysis& TheOriginalAnalysis)
180 if (this != &TheOriginalAnalysis) {
181 AliFemtoVertexMultAnalysis::operator=(TheOriginalAnalysis);
182 fVertexZBins = TheOriginalAnalysis.fVertexZBins;
183 fMultBins = TheOriginalAnalysis.fMultBins;
186 fFirstParticleCut = 0;
187 fSecondParticleCut = 0;
189 if (fCorrFctnCollection) delete fCorrFctnCollection;
190 fCorrFctnCollection = new AliFemtoCorrFctnCollection;
191 fVertexZ[0] = TheOriginalAnalysis.fVertexZ[0];
192 fVertexZ[1] = TheOriginalAnalysis.fVertexZ[1];
193 fUnderFlowVertexZ = 0;
194 fOverFlowVertexZ = 0;
195 fMult[0] = TheOriginalAnalysis.fMult[0];
196 fMult[1] = TheOriginalAnalysis.fMult[1];
199 if (fMixingBuffer) delete fMixingBuffer;
200 if (fPicoEventCollectionVectorHideAway) delete fPicoEventCollectionVectorHideAway;
201 fPicoEventCollectionVectorHideAway = new AliFemtoPicoEventCollectionVectorHideAway(fVertexZBins,fVertexZ[0],fVertexZ[1],
202 fMultBins,fMult[0],fMult[1]);
204 // find the right event cut
205 fEventCut = TheOriginalAnalysis.fEventCut->Clone();
206 // find the right first particle cut
207 fFirstParticleCut = TheOriginalAnalysis.fFirstParticleCut->Clone();
208 // find the right second particle cut
209 if (TheOriginalAnalysis.fFirstParticleCut==TheOriginalAnalysis.fSecondParticleCut)
210 SetSecondParticleCut(fFirstParticleCut); // identical particle hbt
212 fSecondParticleCut = TheOriginalAnalysis.fSecondParticleCut->Clone();
214 fPairCut = TheOriginalAnalysis.fPairCut->Clone();
217 SetEventCut(fEventCut); // this will set the myAnalysis pointer inside the cut
219 if ( fFirstParticleCut ) {
220 SetFirstParticleCut(fFirstParticleCut); // this will set the myAnalysis pointer inside the cut
222 if ( fSecondParticleCut ) {
223 SetSecondParticleCut(fSecondParticleCut); // this will set the myAnalysis pointer inside the cut
225 SetPairCut(fPairCut); // this will set the myAnalysis pointer inside the cut
229 AliFemtoCorrFctnIterator iter;
230 for (iter=TheOriginalAnalysis.fCorrFctnCollection->begin(); iter!=TheOriginalAnalysis.fCorrFctnCollection->end();iter++){
231 AliFemtoCorrFctn* fctn = (*iter)->Clone();
232 if (fctn) AddCorrFctn(fctn);
235 fNumEventsToMix = TheOriginalAnalysis.fNumEventsToMix;
240 //____________________________
241 AliFemtoVertexMultAnalysis::~AliFemtoVertexMultAnalysis(){
242 // now delete every PicoEvent in the EventMixingBuffer and then the Buffer itself
243 delete fPicoEventCollectionVectorHideAway;
246 //____________________________
247 AliFemtoString AliFemtoVertexMultAnalysis::Report()
249 // Prepare a report of the execution
250 cout << "AliFemtoVertexMultAnalysis - constructing Report..."<<endl;
252 AliFemtoString temp = "-----------\nHbt AliFemtoVertexMultAnalysis Report:\n";
253 snprintf(ctemp , 200, "Events are mixed in %d VertexZ bins in the range %E cm to %E cm.\n",fVertexZBins,fVertexZ[0],fVertexZ[1]);
255 snprintf(ctemp , 200, "Events underflowing: %d\n",fUnderFlowVertexZ);
257 snprintf(ctemp , 200, "Events overflowing: %d\n",fOverFlowVertexZ);
259 snprintf(ctemp , 200, "Events are mixed in %d Mult bins in the range %E cm to %E cm.\n",fMultBins,fMult[0],fMult[1]);
261 snprintf(ctemp , 200, "Events underflowing: %d\n",fUnderFlowMult);
263 snprintf(ctemp , 200, "Events overflowing: %d\n",fOverFlowMult);
265 snprintf(ctemp , 200, "Now adding AliFemtoSimpleAnalysis(base) Report\n");
267 temp += AliFemtoSimpleAnalysis::Report();
268 AliFemtoString returnThis=temp;
271 //_________________________
272 void AliFemtoVertexMultAnalysis::ProcessEvent(const AliFemtoEvent* hbtEvent) {
273 // Perform event processing
274 // in bins of z vertex and multiplicity
276 // cout << " AliFemtoVertexMultAnalysis::ProcessEvent(const AliFemtoEvent* hbtEvent) " << endl;
277 // get right mixing buffer
278 double vertexZ = hbtEvent->PrimVertPos().z();
279 double mult = hbtEvent->UncorrectedNumberOfPrimaries();
280 fMixingBuffer = fPicoEventCollectionVectorHideAway->PicoEventCollection(vertexZ,mult);
281 if (!fMixingBuffer) {
282 if ( vertexZ < fVertexZ[0] ) fUnderFlowVertexZ++;
283 if ( vertexZ > fVertexZ[1] ) fOverFlowVertexZ++;
284 if ( mult < fMult[0] ) fUnderFlowMult++;
285 if ( mult > fMult[1] ) fOverFlowMult++;
288 //cout<<" AliFemtoVertexMultAnalysis:: -> Simple"<<endl;
289 // call ProcessEvent() from AliFemtoSimpleAnalysis-base
290 AliFemtoSimpleAnalysis::ProcessEvent(hbtEvent);