]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/FEMTOSCOPY/AliFemto/AliFemtoVertexMultAnalysis.cxx
Pad size less then cell size + ideal geom in v2
[u/mrichter/AliRoot.git] / PWG2 / FEMTOSCOPY / AliFemto / AliFemtoVertexMultAnalysis.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.2  2007/05/03 09:39:37  akisiel
17  * Fixing Effective C++ warnings
18  *
19  * Revision 1.1.1.1  2007/04/25 15:38:41  panos
20  * Importing the HBT code dir
21  *
22  * Revision 1.1.1.1  2007/03/07 10:14:49  mchojnacki
23  * First version on CVS
24  *
25  * Revision 1.2  2005/06/28 23:12:24  chajecki
26  * UncorrectedNumberOfNegativePrimaries() -> UncorrectedNumberOfPrimaries()
27  *
28  * For data taken in Y2 and later the centrality definition bases
29  * on UncorrectedNumberOfPrimaries() while for Y1(AuAu@130)
30  * it based on UncorrectedNumberOfNegativePrimaries().
31  * But in many places of HBT code the number of negative primaries
32  * was used as a multiplicity for all productions.
33  * This has been fixed.
34  *
35  * Revision 1.1  2001/11/11 18:34:14  laue
36  * AliFemtoPicoEventCollectionVectorHideAway: updated for 3d grid
37  * AliFemtoVertexMultAnalysis: new
38  *
39  *
40  **************************************************************************/
41
42 #include "AliFemtoVertexMultAnalysis.h"
43 #include "AliFemtoParticleCollection.h"
44 #include "AliFemtoTrackCut.h"
45 #include "AliFemtoV0Cut.h"
46 #include "AliFemtoKinkCut.h"
47 #include "AliFemtoPicoEventCollectionVector.h"
48 #include "AliFemtoPicoEventCollectionVectorHideAway.h"
49
50
51 #ifdef __ROOT__ 
52 ClassImp(AliFemtoVertexMultAnalysis)
53 #endif
54
55 extern void FillHbtParticleCollection(AliFemtoParticleCut*         partCut,
56                                      AliFemtoEvent*               hbtEvent,
57                                      AliFemtoParticleCollection*  partCollection);
58
59
60 //____________________________
61 AliFemtoVertexMultAnalysis::AliFemtoVertexMultAnalysis(unsigned int binsVertex, double minVertex, double maxVertex,
62                                                  unsigned int binsMult, double minMult, double maxMult) 
63   : 
64   fVertexZBins(binsVertex), 
65   fOverFlowVertexZ(0), 
66   fUnderFlowVertexZ(0),
67   fMultBins(binsMult) ,
68   fOverFlowMult(0),    
69   fUnderFlowMult(0)    
70 {
71   //  mControlSwitch     = 0;
72   fEventCut          = 0;
73   fFirstParticleCut  = 0;
74   fSecondParticleCut = 0;
75   fPairCut           = 0;
76   fCorrFctnCollection= 0;
77   fCorrFctnCollection = new AliFemtoCorrFctnCollection;
78   fVertexZ[0] = minVertex;
79   fVertexZ[1] = maxVertex;
80   fUnderFlowVertexZ = 0; 
81   fOverFlowVertexZ = 0; 
82   fMult[0] = minMult;
83   fMult[1] = maxMult;
84   fUnderFlowMult = 0; 
85   fOverFlowMult = 0; 
86   if (fMixingBuffer) delete fMixingBuffer;
87   fPicoEventCollectionVectorHideAway = new AliFemtoPicoEventCollectionVectorHideAway(fVertexZBins,fVertexZ[0],fVertexZ[1],
88                                                                                   fMultBins,fMult[0],fMult[1]);
89 };
90 //____________________________
91
92 AliFemtoVertexMultAnalysis::AliFemtoVertexMultAnalysis(const AliFemtoVertexMultAnalysis& a) : 
93   AliFemtoAnalysis(),
94   fVertexZBins(a.fVertexZBins), 
95   fOverFlowVertexZ(0), 
96   fUnderFlowVertexZ(0),
97   fMultBins(a.fMultBins) ,
98   fOverFlowMult(0),    
99   fUnderFlowMult(0)    
100 {
101   //AliFemtoVertexMultAnalysis();
102   fEventCut          = 0;
103   fFirstParticleCut  = 0;
104   fSecondParticleCut = 0;
105   fPairCut           = 0;
106   fCorrFctnCollection= 0;
107   fCorrFctnCollection = new AliFemtoCorrFctnCollection;
108   fVertexZ[0] = a.fVertexZ[0]; 
109   fVertexZ[1] = a.fVertexZ[1];
110   fUnderFlowVertexZ = 0; 
111   fOverFlowVertexZ = 0; 
112   fMult[0] = a.fMult[0]; 
113   fMult[1] = a.fMult[1];
114   fUnderFlowMult = 0; 
115   fOverFlowMult = 0; 
116   if (fMixingBuffer) delete fMixingBuffer;
117   fPicoEventCollectionVectorHideAway = new AliFemtoPicoEventCollectionVectorHideAway(fVertexZBins,fVertexZ[0],fVertexZ[1],
118                                                                                   fMultBins,fMult[0],fMult[1]);
119
120   // find the right event cut
121   fEventCut = a.fEventCut->Clone();
122   // find the right first particle cut
123   fFirstParticleCut = a.fFirstParticleCut->Clone();
124   // find the right second particle cut
125   if (a.fFirstParticleCut==a.fSecondParticleCut) 
126     SetSecondParticleCut(fFirstParticleCut); // identical particle hbt
127   else
128   fSecondParticleCut = a.fSecondParticleCut->Clone();
129
130   fPairCut = a.fPairCut->Clone();
131   
132   if ( fEventCut ) {
133       SetEventCut(fEventCut); // this will set the myAnalysis pointer inside the cut
134       cout << " AliFemtoVertexMultAnalysis::AliFemtoVertexMultAnalysis(const AliFemtoVertexMultAnalysis& a) - event cut set " << endl;
135   }
136   if ( fFirstParticleCut ) {
137       SetFirstParticleCut(fFirstParticleCut); // this will set the myAnalysis pointer inside the cut
138       cout << " AliFemtoVertexMultAnalysis::AliFemtoVertexMultAnalysis(const AliFemtoVertexMultAnalysis& a) - first particle cut set " << endl;
139   }
140   if ( fSecondParticleCut ) {
141       SetSecondParticleCut(fSecondParticleCut); // this will set the myAnalysis pointer inside the cut
142       cout << " AliFemtoVertexMultAnalysis::AliFemtoVertexMultAnalysis(const AliFemtoVertexMultAnalysis& a) - second particle cut set " << endl;
143   }  if ( fPairCut ) {
144       SetPairCut(fPairCut); // this will set the myAnalysis pointer inside the cut
145       cout << " AliFemtoVertexMultAnalysis::AliFemtoVertexMultAnalysis(const AliFemtoVertexMultAnalysis& a) - pair cut set " << endl;
146   }
147
148   AliFemtoCorrFctnIterator iter;
149   for (iter=a.fCorrFctnCollection->begin(); iter!=a.fCorrFctnCollection->end();iter++){
150     cout << " AliFemtoVertexMultAnalysis::AliFemtoVertexMultAnalysis(const AliFemtoVertexMultAnalysis& a) - looking for correlation functions " << endl;
151     AliFemtoCorrFctn* fctn = (*iter)->Clone();
152     if (fctn) AddCorrFctn(fctn);
153     else cout << " AliFemtoVertexMultAnalysis::AliFemtoVertexMultAnalysis(const AliFemtoVertexMultAnalysis& a) - correlation function not found " << endl;
154   }
155
156   fNumEventsToMix = a.fNumEventsToMix;
157
158   cout << " AliFemtoVertexMultAnalysis::AliFemtoVertexMultAnalysis(const AliFemtoVertexMultAnalysis& a) - analysis copied " << endl;
159
160 }
161 //____________________________
162 AliFemtoVertexMultAnalysis::~AliFemtoVertexMultAnalysis(){
163   // now delete every PicoEvent in the EventMixingBuffer and then the Buffer itself
164   delete fPicoEventCollectionVectorHideAway;
165 }
166
167 //____________________________
168 AliFemtoString AliFemtoVertexMultAnalysis::Report()
169 {
170   cout << "AliFemtoVertexMultAnalysis - constructing Report..."<<endl;
171   char Ctemp[200];
172   AliFemtoString temp = "-----------\nHbt AliFemtoVertexMultAnalysis Report:\n";
173   sprintf(Ctemp,"Events are mixed in %d VertexZ bins in the range %E cm to %E cm.\n",fVertexZBins,fVertexZ[0],fVertexZ[1]);
174   temp += Ctemp;
175   sprintf(Ctemp,"Events underflowing: %d\n",fUnderFlowVertexZ);
176   temp += Ctemp;
177   sprintf(Ctemp,"Events overflowing: %d\n",fOverFlowVertexZ);
178   temp += Ctemp;
179   sprintf(Ctemp,"Events are mixed in %d Mult bins in the range %E cm to %E cm.\n",fMultBins,fMult[0],fMult[1]);
180   temp += Ctemp;
181   sprintf(Ctemp,"Events underflowing: %d\n",fUnderFlowMult);
182   temp += Ctemp;
183   sprintf(Ctemp,"Events overflowing: %d\n",fOverFlowMult);
184   temp += Ctemp;
185   sprintf(Ctemp,"Now adding AliFemtoAnalysis(base) Report\n");
186   temp += Ctemp;
187   temp += AliFemtoAnalysis::Report();
188   AliFemtoString returnThis=temp;
189   return returnThis;
190 }
191 //_________________________
192 void AliFemtoVertexMultAnalysis::ProcessEvent(const AliFemtoEvent* hbtEvent) {
193   cout << " AliFemtoVertexMultAnalysis::ProcessEvent(const AliFemtoEvent* hbtEvent) " << endl;
194   // get right mixing buffer
195   double vertexZ = hbtEvent->PrimVertPos().z();
196   double mult = hbtEvent->UncorrectedNumberOfPrimaries();
197   fMixingBuffer = fPicoEventCollectionVectorHideAway->PicoEventCollection(vertexZ,mult); 
198   if (!fMixingBuffer) {
199     if ( vertexZ < fVertexZ[0] ) fUnderFlowVertexZ++;
200     if ( vertexZ > fVertexZ[1] ) fOverFlowVertexZ++;
201     if ( mult < fMult[0] ) fUnderFlowMult++;
202     if ( mult > fMult[1] ) fOverFlowMult++;
203     return;
204   }
205   // call ProcessEvent() from AliFemtoAnalysis-base
206   AliFemtoAnalysis::ProcessEvent(hbtEvent);
207 }