]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/FEMTOSCOPY/AliFemto/AliFemtoVertexAnalysis.cxx
V0 rescaling in MC and multiple bins in correct.C
[u/mrichter/AliRoot.git] / PWG2 / FEMTOSCOPY / AliFemto / AliFemtoVertexAnalysis.cxx
CommitLineData
ea77036b 1////////////////////////////////////////////////////////////////////////////
2// //
3// AliFemtoVertexAnalysis - Femtoscopic analysis which mixes events //
4// with respect to the z position of the primary vertex //
5// //
6////////////////////////////////////////////////////////////////////////////
67427ff7 7/***************************************************************************
8 *
9 * $Id$
10 *
11 * Author: Frank Laue, Ohio State, laue@mps.ohio-state.edu
12 ***************************************************************************
13 *
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.
18 *
19 ***************************************************************************
20 *
21 * $Log$
ea77036b 22 * Revision 1.2.2.2 2007/10/12 14:28:37 akisiel
23 * New wave of cleanup and rule conformance
24 *
25 * Revision 1.2.2.1 2007/10/05 09:38:17 akisiel
26 * Fix stray colons
27 *
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
30 *
a5b23aa6 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
33 *
d0e92d9a 34 * Revision 1.2 2007/05/03 09:39:37 akisiel
35 * Fixing Effective C++ warnings
36 *
0215f606 37 * Revision 1.1.1.1 2007/04/25 15:38:41 panos
38 * Importing the HBT code dir
39 *
67427ff7 40 * Revision 1.1.1.1 2007/03/07 10:14:49 mchojnacki
41 * First version on CVS
42 *
43 * Revision 1.5 2001/05/25 23:24:00 lisa
44 * Added in AliFemtoKink stuff
45 *
46 * Revision 1.4 2000/08/31 22:31:32 laue
a5b23aa6 47 * AliFemtoSimpleAnalysis: output changed (a little bit less)
67427ff7 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
52 *
53 * Revision 1.1 2000/07/16 21:44:11 laue
54 * Collection and analysis for vertex dependent event mixing
55 *
56 *
57 **************************************************************************/
58
d0e92d9a 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"
67427ff7 66
67
68#ifdef __ROOT__
69ClassImp(AliFemtoVertexAnalysis)
70#endif
71
72extern void FillHbtParticleCollection(AliFemtoParticleCut* partCut,
73 AliFemtoEvent* hbtEvent,
74 AliFemtoParticleCollection* partCollection);
75
76
77//____________________________
0215f606 78AliFemtoVertexAnalysis::AliFemtoVertexAnalysis(unsigned int bins, double min, double max):
79 fVertexBins(0),
80 fOverFlow(0),
81 fUnderFlow(0)
82{
67427ff7 83 // mControlSwitch = 0;
84 fEventCut = 0;
85 fFirstParticleCut = 0;
86 fSecondParticleCut = 0;
87 fPairCut = 0;
88 fCorrFctnCollection= 0;
89 fCorrFctnCollection = new AliFemtoCorrFctnCollection;
90 fVertexBins = bins;
91 fVertexZ[0] = min;
92 fVertexZ[1] = max;
93 fUnderFlow = 0;
94 fOverFlow = 0;
95 if (fMixingBuffer) delete fMixingBuffer;
96 fPicoEventCollectionVectorHideAway = new AliFemtoPicoEventCollectionVectorHideAway(fVertexBins,fVertexZ[0],fVertexZ[1]);
ea77036b 97}
67427ff7 98//____________________________
99
0215f606 100AliFemtoVertexAnalysis::AliFemtoVertexAnalysis(const AliFemtoVertexAnalysis& a) :
a5b23aa6 101 AliFemtoSimpleAnalysis(),
0215f606 102 fVertexBins(0),
103 fOverFlow(0),
104 fUnderFlow(0)
105{
67427ff7 106 //AliFemtoVertexAnalysis();
107 fEventCut = 0;
108 fFirstParticleCut = 0;
109 fSecondParticleCut = 0;
110 fPairCut = 0;
111 fCorrFctnCollection= 0;
112 fCorrFctnCollection = new AliFemtoCorrFctnCollection;
113 fVertexBins = a.fVertexBins;
114 fVertexZ[0] = a.fVertexZ[0];
115 fVertexZ[1] = a.fVertexZ[1];
116 fUnderFlow = 0;
117 fOverFlow = 0;
118 if (fMixingBuffer) delete fMixingBuffer;
119 fPicoEventCollectionVectorHideAway = new AliFemtoPicoEventCollectionVectorHideAway(fVertexBins,fVertexZ[0],fVertexZ[1]);
120
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
128 else
129 fSecondParticleCut = a.fSecondParticleCut->Clone();
130
131 fPairCut = a.fPairCut->Clone();
132
133 if ( fEventCut ) {
134 SetEventCut(fEventCut); // this will set the myAnalysis pointer inside the cut
135 cout << " AliFemtoVertexAnalysis::AliFemtoVertexAnalysis(const AliFemtoVertexAnalysis& a) - event cut set " << endl;
136 }
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;
140 }
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;
144 } if ( fPairCut ) {
145 SetPairCut(fPairCut); // this will set the myAnalysis pointer inside the cut
146 cout << " AliFemtoVertexAnalysis::AliFemtoVertexAnalysis(const AliFemtoVertexAnalysis& a) - pair cut set " << endl;
147 }
148
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;
155 }
156
157 fNumEventsToMix = a.fNumEventsToMix;
158
159 cout << " AliFemtoVertexAnalysis::AliFemtoVertexAnalysis(const AliFemtoVertexAnalysis& a) - analysis copied " << endl;
160
161}
162//____________________________
163AliFemtoVertexAnalysis::~AliFemtoVertexAnalysis(){
164 // now delete every PicoEvent in the EventMixingBuffer and then the Buffer itself
165 delete fPicoEventCollectionVectorHideAway;
166}
167
168//____________________________
169AliFemtoString AliFemtoVertexAnalysis::Report()
170{
ea77036b 171 // prepare report fromt the execution
67427ff7 172 cout << "AliFemtoVertexAnalysis - constructing Report..."<<endl;
ea77036b 173 char ctemp[200];
67427ff7 174 AliFemtoString temp = "-----------\nHbt AliFemtoVertexAnalysis Report:\n";
ea77036b 175 sprintf(ctemp,"Events are mixed in %d bins in the range %E cm to %E cm.\n",fVertexBins,fVertexZ[0],fVertexZ[1]);
176 temp += ctemp;
177 sprintf(ctemp,"Events underflowing: %d\n",fUnderFlow);
178 temp += ctemp;
179 sprintf(ctemp,"Events overflowing: %d\n",fOverFlow);
180 temp += ctemp;
181 sprintf(ctemp,"Now adding AliFemtoSimpleAnalysis(base) Report\n");
182 temp += ctemp;
a5b23aa6 183 temp += AliFemtoSimpleAnalysis::Report();
67427ff7 184 AliFemtoString returnThis=temp;
185 return returnThis;
186}
187//_________________________
188void AliFemtoVertexAnalysis::ProcessEvent(const AliFemtoEvent* hbtEvent) {
ea77036b 189 // Put the event though the analysis
67427ff7 190 cout << " AliFemtoVertexAnalysis::ProcessEvent(const AliFemtoEvent* hbtEvent) " << endl;
191 // get right mixing buffer
192 double vertexZ = hbtEvent->PrimVertPos().z();
193 fMixingBuffer = fPicoEventCollectionVectorHideAway->PicoEventCollection(vertexZ);
194 if (!fMixingBuffer) {
195 if ( vertexZ < fVertexZ[0] ) fUnderFlow++;
196 if ( vertexZ > fVertexZ[1] ) fOverFlow++;
197 return;
198 }
a5b23aa6 199 // call ProcessEvent() from AliFemtoSimpleAnalysis-base
200 AliFemtoSimpleAnalysis::ProcessEvent(hbtEvent);
67427ff7 201}