]> git.uio.no Git - u/mrichter/AliRoot.git/blob - AliFemtoVertexAnalysis.cxx
bcdfd6393a98f079ff9f531ddfdc543cbfa6eec7
[u/mrichter/AliRoot.git] / AliFemtoVertexAnalysis.cxx
1 /***************************************************************************
2  *
3  * $Id$
4  *
5  * Author: Frank Laue, Ohio State, laue@mps.ohio-state.edu
6  ***************************************************************************
7  *
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.
12  *
13  ***************************************************************************
14  *
15  * $Log$
16  * Revision 1.1  2007/05/16 10:22:12  akisiel
17  * Making the directory structure of AliFemto flat. All files go into one common directory
18  *
19  * Revision 1.2  2007/05/03 09:39:37  akisiel
20  * Fixing Effective C++ warnings
21  *
22  * Revision 1.1.1.1  2007/04/25 15:38:41  panos
23  * Importing the HBT code dir
24  *
25  * Revision 1.1.1.1  2007/03/07 10:14:49  mchojnacki
26  * First version on CVS
27  *
28  * Revision 1.5  2001/05/25 23:24:00  lisa
29  * Added in AliFemtoKink stuff
30  *
31  * Revision 1.4  2000/08/31 22:31:32  laue
32  * AliFemtoSimpleAnalysis: output changed (a little bit less)
33  * AliFemtoEvent: new version, members for reference mult added
34  * AliFemtoIOBinary: new IO for new AliFemtoEvent version
35  * AliFemtoTypes: TTree typedef to AliFemtoTTree added
36  * AliFemtoVertexAnalysis: overflow and underflow added
37  *
38  * Revision 1.1  2000/07/16 21:44:11  laue
39  * Collection and analysis for vertex dependent event mixing
40  *
41  *
42  **************************************************************************/
43
44 #include "AliFemtoVertexAnalysis.h"
45 #include "AliFemtoParticleCollection.h"
46 #include "AliFemtoTrackCut.h"
47 #include "AliFemtoV0Cut.h"
48 #include "AliFemtoKinkCut.h"
49 #include "AliFemtoPicoEventCollectionVector.h"
50 #include "AliFemtoPicoEventCollectionVectorHideAway.h"
51
52
53 #ifdef __ROOT__ 
54 ClassImp(AliFemtoVertexAnalysis)
55 #endif
56
57 extern void FillHbtParticleCollection(AliFemtoParticleCut*         partCut,
58                                      AliFemtoEvent*               hbtEvent,
59                                      AliFemtoParticleCollection*  partCollection);
60
61
62 //____________________________
63 AliFemtoVertexAnalysis::AliFemtoVertexAnalysis(unsigned int bins, double min, double max):
64   fVertexBins(0),
65   fOverFlow(0),  
66   fUnderFlow(0)
67 {
68   //  mControlSwitch     = 0;
69   fEventCut          = 0;
70   fFirstParticleCut  = 0;
71   fSecondParticleCut = 0;
72   fPairCut           = 0;
73   fCorrFctnCollection= 0;
74   fCorrFctnCollection = new AliFemtoCorrFctnCollection;
75   fVertexBins = bins;
76   fVertexZ[0] = min;
77   fVertexZ[1] = max;
78   fUnderFlow = 0; 
79   fOverFlow = 0; 
80   if (fMixingBuffer) delete fMixingBuffer;
81   fPicoEventCollectionVectorHideAway = new AliFemtoPicoEventCollectionVectorHideAway(fVertexBins,fVertexZ[0],fVertexZ[1]);
82 };
83 //____________________________
84
85 AliFemtoVertexAnalysis::AliFemtoVertexAnalysis(const AliFemtoVertexAnalysis& a) : 
86   AliFemtoSimpleAnalysis(),
87   fVertexBins(0),
88   fOverFlow(0),  
89   fUnderFlow(0)
90 {
91   //AliFemtoVertexAnalysis();
92   fEventCut          = 0;
93   fFirstParticleCut  = 0;
94   fSecondParticleCut = 0;
95   fPairCut           = 0;
96   fCorrFctnCollection= 0;
97   fCorrFctnCollection = new AliFemtoCorrFctnCollection;
98   fVertexBins = a.fVertexBins; 
99   fVertexZ[0] = a.fVertexZ[0]; 
100   fVertexZ[1] = a.fVertexZ[1];
101   fUnderFlow = 0; 
102   fOverFlow = 0; 
103   if (fMixingBuffer) delete fMixingBuffer;
104   fPicoEventCollectionVectorHideAway = new AliFemtoPicoEventCollectionVectorHideAway(fVertexBins,fVertexZ[0],fVertexZ[1]);
105
106   // find the right event cut
107   fEventCut = a.fEventCut->Clone();
108   // find the right first particle cut
109   fFirstParticleCut = a.fFirstParticleCut->Clone();
110   // find the right second particle cut
111   if (a.fFirstParticleCut==a.fSecondParticleCut) 
112     SetSecondParticleCut(fFirstParticleCut); // identical particle hbt
113   else
114   fSecondParticleCut = a.fSecondParticleCut->Clone();
115
116   fPairCut = a.fPairCut->Clone();
117   
118   if ( fEventCut ) {
119       SetEventCut(fEventCut); // this will set the myAnalysis pointer inside the cut
120       cout << " AliFemtoVertexAnalysis::AliFemtoVertexAnalysis(const AliFemtoVertexAnalysis& a) - event cut set " << endl;
121   }
122   if ( fFirstParticleCut ) {
123       SetFirstParticleCut(fFirstParticleCut); // this will set the myAnalysis pointer inside the cut
124       cout << " AliFemtoVertexAnalysis::AliFemtoVertexAnalysis(const AliFemtoVertexAnalysis& a) - first particle cut set " << endl;
125   }
126   if ( fSecondParticleCut ) {
127       SetSecondParticleCut(fSecondParticleCut); // this will set the myAnalysis pointer inside the cut
128       cout << " AliFemtoVertexAnalysis::AliFemtoVertexAnalysis(const AliFemtoVertexAnalysis& a) - second particle cut set " << endl;
129   }  if ( fPairCut ) {
130       SetPairCut(fPairCut); // this will set the myAnalysis pointer inside the cut
131       cout << " AliFemtoVertexAnalysis::AliFemtoVertexAnalysis(const AliFemtoVertexAnalysis& a) - pair cut set " << endl;
132   }
133
134   AliFemtoCorrFctnIterator iter;
135   for (iter=a.fCorrFctnCollection->begin(); iter!=a.fCorrFctnCollection->end();iter++){
136     cout << " AliFemtoVertexAnalysis::AliFemtoVertexAnalysis(const AliFemtoVertexAnalysis& a) - looking for correlation functions " << endl;
137     AliFemtoCorrFctn* fctn = (*iter)->Clone();
138     if (fctn) AddCorrFctn(fctn);
139     else cout << " AliFemtoVertexAnalysis::AliFemtoVertexAnalysis(const AliFemtoVertexAnalysis& a) - correlation function not found " << endl;
140   }
141
142   fNumEventsToMix = a.fNumEventsToMix;
143
144   cout << " AliFemtoVertexAnalysis::AliFemtoVertexAnalysis(const AliFemtoVertexAnalysis& a) - analysis copied " << endl;
145
146 }
147 //____________________________
148 AliFemtoVertexAnalysis::~AliFemtoVertexAnalysis(){
149   // now delete every PicoEvent in the EventMixingBuffer and then the Buffer itself
150   delete fPicoEventCollectionVectorHideAway;
151 }
152
153 //____________________________
154 AliFemtoString AliFemtoVertexAnalysis::Report()
155 {
156   cout << "AliFemtoVertexAnalysis - constructing Report..."<<endl;
157   char Ctemp[200];
158   AliFemtoString temp = "-----------\nHbt AliFemtoVertexAnalysis Report:\n";
159   sprintf(Ctemp,"Events are mixed in %d bins in the range %E cm to %E cm.\n",fVertexBins,fVertexZ[0],fVertexZ[1]);
160   temp += Ctemp;
161   sprintf(Ctemp,"Events underflowing: %d\n",fUnderFlow);
162   temp += Ctemp;
163   sprintf(Ctemp,"Events overflowing: %d\n",fOverFlow);
164   temp += Ctemp;
165   sprintf(Ctemp,"Now adding AliFemtoSimpleAnalysis(base) Report\n");
166   temp += Ctemp;
167   temp += AliFemtoSimpleAnalysis::Report();
168   AliFemtoString returnThis=temp;
169   return returnThis;
170 }
171 //_________________________
172 void AliFemtoVertexAnalysis::ProcessEvent(const AliFemtoEvent* hbtEvent) {
173   cout << " AliFemtoVertexAnalysis::ProcessEvent(const AliFemtoEvent* hbtEvent) " << endl;
174   // get right mixing buffer
175   double vertexZ = hbtEvent->PrimVertPos().z();
176   fMixingBuffer = fPicoEventCollectionVectorHideAway->PicoEventCollection(vertexZ); 
177   if (!fMixingBuffer) {
178     if ( vertexZ < fVertexZ[0] ) fUnderFlow++;
179     if ( vertexZ > fVertexZ[1] ) fOverFlow++;
180     return;
181   }
182   // call ProcessEvent() from AliFemtoSimpleAnalysis-base
183   AliFemtoSimpleAnalysis::ProcessEvent(hbtEvent);
184 }