Lines getting the matched track moved to a method in AliCalorimeterUtils. Lines copie...
[u/mrichter/AliRoot.git] / PWG2 / FEMTOSCOPY / AliFemto / AliFemtoAnalysisReactionPlane.cxx
CommitLineData
cf32f0e9 1////////////////////////////////////////////////////////////////////////////
2// //
3// AliFemtoAnalysisReactionPlane - Femtoscopic analysis which mixes event //
4// with respect to the z position of the primary vertex and event total //
5// multiplicity and uses only events in certain reaction plane angle bin //
6// //
7////////////////////////////////////////////////////////////////////////////
8
9#include <TMath.h>
10#include "AliFemtoAnalysisReactionPlane.h"
11#include "AliFemtoParticleCollection.h"
12#include "AliFemtoTrackCut.h"
13#include "AliFemtoV0Cut.h"
14#include "AliFemtoKinkCut.h"
15#include "AliFemtoPicoEventCollectionVector.h"
16#include "AliFemtoPicoEventCollectionVectorHideAway.h"
17
18#ifdef __ROOT__
19ClassImp(AliFemtoAnalysisReactionPlane)
20#endif
21
22extern void FillHbtParticleCollection(AliFemtoParticleCut* partCut,
23 AliFemtoEvent* hbtEvent,
24 AliFemtoParticleCollection* partCollection);
25
26
27//____________________________
28AliFemtoAnalysisReactionPlane::AliFemtoAnalysisReactionPlane(unsigned int binsVertex, double minVertex, double maxVertex,
29 unsigned int binsMult, double minMult, double maxMult, unsigned short binsRP)
30 :
31 fVertexZBins(binsVertex),
32 fOverFlowVertexZ(0),
33 fUnderFlowVertexZ(0),
34 fMultBins(binsMult) ,
35 fOverFlowMult(0),
36 fUnderFlowMult(0),
37 fRPBins(binsRP),
38 fCurrentRP(0)
39{
40 // mControlSwitch = 0;
41 fEventCut = 0;
42 fFirstParticleCut = 0;
43 fSecondParticleCut = 0;
44 fPairCut = 0;
45 fCorrFctnCollection= 0;
46 fCorrFctnCollection = new AliFemtoCorrFctnCollection;
47 fVertexZ[0] = minVertex;
48 fVertexZ[1] = maxVertex;
49 fUnderFlowVertexZ = 0;
50 fOverFlowVertexZ = 0;
51 fMult[0] = minMult;
52 fMult[1] = maxMult;
53 fUnderFlowMult = 0;
54 fOverFlowMult = 0;
55 if (fMixingBuffer) delete fMixingBuffer;
56 fPicoEventCollectionVectorHideAway = new AliFemtoPicoEventCollectionVectorHideAway(fVertexZBins,fVertexZ[0],fVertexZ[1],
57 fMultBins,fMult[0],fMult[1],
58 fRPBins,0.0,TMath::Pi());
59}
60//____________________________
61
62AliFemtoAnalysisReactionPlane::AliFemtoAnalysisReactionPlane(const AliFemtoAnalysisReactionPlane& a) :
63 AliFemtoSimpleAnalysis(),
64 fVertexZBins(a.fVertexZBins),
65 fOverFlowVertexZ(0),
66 fUnderFlowVertexZ(0),
67 fMultBins(a.fMultBins) ,
68 fOverFlowMult(0),
69 fUnderFlowMult(0),
70 fRPBins(a.fRPBins),
71 fCurrentRP(0)
72{
73 //AliFemtoAnalysisReactionPlane();
74 fEventCut = 0;
75 fFirstParticleCut = 0;
76 fSecondParticleCut = 0;
77 fPairCut = 0;
78 fCorrFctnCollection= 0;
79 fCorrFctnCollection = new AliFemtoCorrFctnCollection;
80 fVertexZ[0] = a.fVertexZ[0];
81 fVertexZ[1] = a.fVertexZ[1];
82 fUnderFlowVertexZ = 0;
83 fOverFlowVertexZ = 0;
84 fMult[0] = a.fMult[0];
85 fMult[1] = a.fMult[1];
86 fUnderFlowMult = 0;
87 fOverFlowMult = 0;
88 if (fMixingBuffer) delete fMixingBuffer;
89 fPicoEventCollectionVectorHideAway = new AliFemtoPicoEventCollectionVectorHideAway(fVertexZBins,fVertexZ[0],fVertexZ[1],
90 fMultBins,fMult[0],fMult[1],
91 fRPBins,0.0,TMath::Pi());
92
93 // find the right event cut
94 fEventCut = a.fEventCut->Clone();
95 // find the right first particle cut
96 fFirstParticleCut = a.fFirstParticleCut->Clone();
97 // find the right second particle cut
98 if (a.fFirstParticleCut==a.fSecondParticleCut)
99 SetSecondParticleCut(fFirstParticleCut); // identical particle hbt
100 else
101 fSecondParticleCut = a.fSecondParticleCut->Clone();
102
103 fPairCut = a.fPairCut->Clone();
104
105 if ( fEventCut ) {
106 SetEventCut(fEventCut); // this will set the myAnalysis pointer inside the cut
107 cout << " AliFemtoAnalysisReactionPlane::AliFemtoAnalysisReactionPlane(const AliFemtoAnalysisReactionPlane& a) - event cut set " << endl;
108 }
109 if ( fFirstParticleCut ) {
110 SetFirstParticleCut(fFirstParticleCut); // this will set the myAnalysis pointer inside the cut
111 cout << " AliFemtoAnalysisReactionPlane::AliFemtoAnalysisReactionPlane(const AliFemtoAnalysisReactionPlane& a) - first particle cut set " << endl;
112 }
113 if ( fSecondParticleCut ) {
114 SetSecondParticleCut(fSecondParticleCut); // this will set the myAnalysis pointer inside the cut
115 cout << " AliFemtoAnalysisReactionPlane::AliFemtoAnalysisReactionPlane(const AliFemtoAnalysisReactionPlane& a) - second particle cut set " << endl;
116 } if ( fPairCut ) {
117 SetPairCut(fPairCut); // this will set the myAnalysis pointer inside the cut
118 cout << " AliFemtoAnalysisReactionPlane::AliFemtoAnalysisReactionPlane(const AliFemtoAnalysisReactionPlane& a) - pair cut set " << endl;
119 }
120
121 AliFemtoCorrFctnIterator iter;
122 for (iter=a.fCorrFctnCollection->begin(); iter!=a.fCorrFctnCollection->end();iter++){
123 cout << " AliFemtoAnalysisReactionPlane::AliFemtoAnalysisReactionPlane(const AliFemtoAnalysisReactionPlane& a) - looking for correlation functions " << endl;
124 AliFemtoCorrFctn* fctn = (*iter)->Clone();
125 if (fctn) AddCorrFctn(fctn);
126 else cout << " AliFemtoAnalysisReactionPlane::AliFemtoAnalysisReactionPlane(const AliFemtoAnalysisReactionPlane& a) - correlation function not found " << endl;
127 }
128
129 fNumEventsToMix = a.fNumEventsToMix;
130
131 cout << " AliFemtoAnalysisReactionPlane::AliFemtoAnalysisReactionPlane(const AliFemtoAnalysisReactionPlane& a) - analysis copied " << endl;
132
133}
2f903d90 134AliFemtoAnalysisReactionPlane& AliFemtoAnalysisReactionPlane::operator=(const AliFemtoAnalysisReactionPlane& TheOriginalAnalysis)
135{
136 if (this != &TheOriginalAnalysis) {
137
138 //AliFemtoAnalysisReactionPlane();
139 fVertexZ[0] = TheOriginalAnalysis.fVertexZ[0];
140 fVertexZ[1] = TheOriginalAnalysis.fVertexZ[1];
141 fUnderFlowVertexZ = 0;
142 fOverFlowVertexZ = 0;
143 fMult[0] = TheOriginalAnalysis.fMult[0];
144 fMult[1] = TheOriginalAnalysis.fMult[1];
145 fUnderFlowMult = 0;
146 fOverFlowMult = 0;
147 if (fMixingBuffer) delete fMixingBuffer;
148 fVertexZBins = TheOriginalAnalysis.fVertexZBins;
149 fMultBins = TheOriginalAnalysis.fMultBins;
150 fRPBins = TheOriginalAnalysis.fRPBins;
151 fCurrentRP = 0;
152
153 if (fEventCut) delete fEventCut;
154 fEventCut = TheOriginalAnalysis.fEventCut->Clone();
155
156 if (fFirstParticleCut) delete fFirstParticleCut;
157 fFirstParticleCut = TheOriginalAnalysis.fFirstParticleCut->Clone();
158
159 if (fSecondParticleCut) delete fSecondParticleCut;
160 if (TheOriginalAnalysis.fFirstParticleCut==TheOriginalAnalysis.fSecondParticleCut)
161 SetSecondParticleCut(fFirstParticleCut); // identical particle hbt
162 else
163 fSecondParticleCut = TheOriginalAnalysis.fSecondParticleCut->Clone();
164
165 if (fPairCut) delete fPairCut;
166 fPairCut = TheOriginalAnalysis.fPairCut->Clone();
167
168 if ( fEventCut ) {
169 SetEventCut(fEventCut); // this will set the myAnalysis pointer inside the cut
170 }
171 if ( fFirstParticleCut ) {
172 SetFirstParticleCut(fFirstParticleCut); // this will set the myAnalysis pointer inside the cut
173 }
174 if ( fSecondParticleCut ) {
175 SetSecondParticleCut(fSecondParticleCut); // this will set the myAnalysis pointer inside the cut
176 } if ( fPairCut ) {
177 SetPairCut(fPairCut); // this will set the myAnalysis pointer inside the cut
178 }
179
180 if (fPicoEventCollectionVectorHideAway) delete fPicoEventCollectionVectorHideAway;
181 fPicoEventCollectionVectorHideAway = new AliFemtoPicoEventCollectionVectorHideAway(fVertexZBins,fVertexZ[0],fVertexZ[1],
182 fMultBins,fMult[0],fMult[1],
183 fRPBins,0.0,TMath::Pi());
184
185 AliFemtoCorrFctnIterator iter;
186 for (iter=TheOriginalAnalysis.fCorrFctnCollection->begin(); iter!=TheOriginalAnalysis.fCorrFctnCollection->end();iter++){
187 AliFemtoCorrFctn* fctn = (*iter)->Clone();
188 if (fctn) AddCorrFctn(fctn);
189 }
190
191 fNumEventsToMix = TheOriginalAnalysis.fNumEventsToMix;
192
193 }
194
195 return *this;
196}
197
cf32f0e9 198//____________________________
199AliFemtoAnalysisReactionPlane::~AliFemtoAnalysisReactionPlane(){
200 // now delete every PicoEvent in the EventMixingBuffer and then the Buffer itself
201 delete fPicoEventCollectionVectorHideAway;
202}
203
204//____________________________
205AliFemtoString AliFemtoAnalysisReactionPlane::Report()
206{
207 // Prepare a report of the execution
208 cout << "AliFemtoAnalysisReactionPlane - constructing Report..."<<endl;
209 char ctemp[200];
210 AliFemtoString temp = "-----------\nHbt AliFemtoAnalysisReactionPlane Report:\n";
3be563bf 211 snprintf(ctemp , 200, "Events are mixed in %d VertexZ bins in the range %E cm to %E cm.\n",fVertexZBins,fVertexZ[0],fVertexZ[1]);
cf32f0e9 212 temp += ctemp;
3be563bf 213 snprintf(ctemp , 200, "Events underflowing: %d\n",fUnderFlowVertexZ);
cf32f0e9 214 temp += ctemp;
3be563bf 215 snprintf(ctemp , 200, "Events overflowing: %d\n",fOverFlowVertexZ);
cf32f0e9 216 temp += ctemp;
3be563bf 217 snprintf(ctemp , 200, "Events are mixed in %d Mult bins in the range %E cm to %E cm.\n",fMultBins,fMult[0],fMult[1]);
cf32f0e9 218 temp += ctemp;
3be563bf 219 snprintf(ctemp , 200, "Events underflowing: %d\n",fUnderFlowMult);
cf32f0e9 220 temp += ctemp;
3be563bf 221 snprintf(ctemp , 200, "Events overflowing: %d\n",fOverFlowMult);
cf32f0e9 222 temp += ctemp;
3be563bf 223 snprintf(ctemp , 200, "Now adding AliFemtoSimpleAnalysis(base) Report\n");
cf32f0e9 224 temp += ctemp;
225 temp += AliFemtoSimpleAnalysis::Report();
226 AliFemtoString returnThis=temp;
227 return returnThis;
228}
229//_________________________
230void AliFemtoAnalysisReactionPlane::ProcessEvent(const AliFemtoEvent* hbtEvent) {
231 // Perform event processing
232 // in bins of z vertex and multiplicity
233
234 // cout << " AliFemtoAnalysisReactionPlane::ProcessEvent(const AliFemtoEvent* hbtEvent) " << endl;
235 // get right mixing buffer
236 double vertexZ = hbtEvent->PrimVertPos().z();
237 double mult = hbtEvent->UncorrectedNumberOfPrimaries();
fee52126 238 fCurrentRP = hbtEvent->ReactionPlaneAngle();
cf32f0e9 239
240 fMixingBuffer = fPicoEventCollectionVectorHideAway->PicoEventCollection(vertexZ,mult,fCurrentRP);
241 if (!fMixingBuffer) {
242 if ( vertexZ < fVertexZ[0] ) fUnderFlowVertexZ++;
243 if ( vertexZ > fVertexZ[1] ) fOverFlowVertexZ++;
244 if ( mult < fMult[0] ) fUnderFlowMult++;
245 if ( mult > fMult[1] ) fOverFlowMult++;
246 return;
247 }
248 // call ProcessEvent() from AliFemtoSimpleAnalysis-base
249 AliFemtoSimpleAnalysis::ProcessEvent(hbtEvent);
250}
251
fee52126 252double AliFemtoAnalysisReactionPlane::GetCurrentReactionPlane()
cf32f0e9 253{
254 return fCurrentRP;
255}