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.1.1.1 2007/03/07 10:14:49 mchojnacki
17 * First version on CVS
19 * Revision 1.2 2005/06/28 23:12:24 chajecki
20 * UncorrectedNumberOfNegativePrimaries() -> UncorrectedNumberOfPrimaries()
22 * For data taken in Y2 and later the centrality definition bases
23 * on UncorrectedNumberOfPrimaries() while for Y1(AuAu@130)
24 * it based on UncorrectedNumberOfNegativePrimaries().
25 * But in many places of HBT code the number of negative primaries
26 * was used as a multiplicity for all productions.
27 * This has been fixed.
29 * Revision 1.1 2001/11/11 18:34:14 laue
30 * AliFemtoPicoEventCollectionVectorHideAway: updated for 3d grid
31 * AliFemtoVertexMultAnalysis: new
34 **************************************************************************/
36 #include "Analysis/AliFemtoVertexMultAnalysis.h"
37 #include "Infrastructure/AliFemtoParticleCollection.h"
38 #include "Base/AliFemtoTrackCut.h"
39 #include "Base/AliFemtoV0Cut.h"
40 #include "Base/AliFemtoKinkCut.h"
41 #include "Infrastructure/AliFemtoPicoEventCollectionVector.h"
42 #include "Infrastructure/AliFemtoPicoEventCollectionVectorHideAway.h"
46 ClassImp(AliFemtoVertexMultAnalysis)
49 extern void FillHbtParticleCollection(AliFemtoParticleCut* partCut,
50 AliFemtoEvent* hbtEvent,
51 AliFemtoParticleCollection* partCollection);
54 //____________________________
55 AliFemtoVertexMultAnalysis::AliFemtoVertexMultAnalysis(unsigned int binsVertex, double minVertex, double maxVertex,
56 unsigned int binsMult, double minMult, double maxMult)
57 : fVertexZBins(binsVertex), fMultBins(binsMult) {
58 // mControlSwitch = 0;
60 fFirstParticleCut = 0;
61 fSecondParticleCut = 0;
63 fCorrFctnCollection= 0;
64 fCorrFctnCollection = new AliFemtoCorrFctnCollection;
65 fVertexZ[0] = minVertex;
66 fVertexZ[1] = maxVertex;
67 fUnderFlowVertexZ = 0;
73 if (fMixingBuffer) delete fMixingBuffer;
74 fPicoEventCollectionVectorHideAway = new AliFemtoPicoEventCollectionVectorHideAway(fVertexZBins,fVertexZ[0],fVertexZ[1],
75 fMultBins,fMult[0],fMult[1]);
77 //____________________________
79 AliFemtoVertexMultAnalysis::AliFemtoVertexMultAnalysis(const AliFemtoVertexMultAnalysis& a) : AliFemtoAnalysis() {
80 //AliFemtoVertexMultAnalysis();
82 fFirstParticleCut = 0;
83 fSecondParticleCut = 0;
85 fCorrFctnCollection= 0;
86 fCorrFctnCollection = new AliFemtoCorrFctnCollection;
87 fVertexZBins = a.fVertexZBins;
88 fVertexZ[0] = a.fVertexZ[0];
89 fVertexZ[1] = a.fVertexZ[1];
90 fUnderFlowVertexZ = 0;
92 fMultBins = a.fMultBins;
93 fMult[0] = a.fMult[0];
94 fMult[1] = a.fMult[1];
97 if (fMixingBuffer) delete fMixingBuffer;
98 fPicoEventCollectionVectorHideAway = new AliFemtoPicoEventCollectionVectorHideAway(fVertexZBins,fVertexZ[0],fVertexZ[1],
99 fMultBins,fMult[0],fMult[1]);
101 // find the right event cut
102 fEventCut = a.fEventCut->Clone();
103 // find the right first particle cut
104 fFirstParticleCut = a.fFirstParticleCut->Clone();
105 // find the right second particle cut
106 if (a.fFirstParticleCut==a.fSecondParticleCut)
107 SetSecondParticleCut(fFirstParticleCut); // identical particle hbt
109 fSecondParticleCut = a.fSecondParticleCut->Clone();
111 fPairCut = a.fPairCut->Clone();
114 SetEventCut(fEventCut); // this will set the myAnalysis pointer inside the cut
115 cout << " AliFemtoVertexMultAnalysis::AliFemtoVertexMultAnalysis(const AliFemtoVertexMultAnalysis& a) - event cut set " << endl;
117 if ( fFirstParticleCut ) {
118 SetFirstParticleCut(fFirstParticleCut); // this will set the myAnalysis pointer inside the cut
119 cout << " AliFemtoVertexMultAnalysis::AliFemtoVertexMultAnalysis(const AliFemtoVertexMultAnalysis& a) - first particle cut set " << endl;
121 if ( fSecondParticleCut ) {
122 SetSecondParticleCut(fSecondParticleCut); // this will set the myAnalysis pointer inside the cut
123 cout << " AliFemtoVertexMultAnalysis::AliFemtoVertexMultAnalysis(const AliFemtoVertexMultAnalysis& a) - second particle cut set " << endl;
125 SetPairCut(fPairCut); // this will set the myAnalysis pointer inside the cut
126 cout << " AliFemtoVertexMultAnalysis::AliFemtoVertexMultAnalysis(const AliFemtoVertexMultAnalysis& a) - pair cut set " << endl;
129 AliFemtoCorrFctnIterator iter;
130 for (iter=a.fCorrFctnCollection->begin(); iter!=a.fCorrFctnCollection->end();iter++){
131 cout << " AliFemtoVertexMultAnalysis::AliFemtoVertexMultAnalysis(const AliFemtoVertexMultAnalysis& a) - looking for correlation functions " << endl;
132 AliFemtoCorrFctn* fctn = (*iter)->Clone();
133 if (fctn) AddCorrFctn(fctn);
134 else cout << " AliFemtoVertexMultAnalysis::AliFemtoVertexMultAnalysis(const AliFemtoVertexMultAnalysis& a) - correlation function not found " << endl;
137 fNumEventsToMix = a.fNumEventsToMix;
139 cout << " AliFemtoVertexMultAnalysis::AliFemtoVertexMultAnalysis(const AliFemtoVertexMultAnalysis& a) - analysis copied " << endl;
142 //____________________________
143 AliFemtoVertexMultAnalysis::~AliFemtoVertexMultAnalysis(){
144 // now delete every PicoEvent in the EventMixingBuffer and then the Buffer itself
145 delete fPicoEventCollectionVectorHideAway;
148 //____________________________
149 AliFemtoString AliFemtoVertexMultAnalysis::Report()
151 cout << "AliFemtoVertexMultAnalysis - constructing Report..."<<endl;
153 AliFemtoString temp = "-----------\nHbt AliFemtoVertexMultAnalysis Report:\n";
154 sprintf(Ctemp,"Events are mixed in %d VertexZ bins in the range %E cm to %E cm.\n",fVertexZBins,fVertexZ[0],fVertexZ[1]);
156 sprintf(Ctemp,"Events underflowing: %d\n",fUnderFlowVertexZ);
158 sprintf(Ctemp,"Events overflowing: %d\n",fOverFlowVertexZ);
160 sprintf(Ctemp,"Events are mixed in %d Mult bins in the range %E cm to %E cm.\n",fMultBins,fMult[0],fMult[1]);
162 sprintf(Ctemp,"Events underflowing: %d\n",fUnderFlowMult);
164 sprintf(Ctemp,"Events overflowing: %d\n",fOverFlowMult);
166 sprintf(Ctemp,"Now adding AliFemtoAnalysis(base) Report\n");
168 temp += AliFemtoAnalysis::Report();
169 AliFemtoString returnThis=temp;
172 //_________________________
173 void AliFemtoVertexMultAnalysis::ProcessEvent(const AliFemtoEvent* hbtEvent) {
174 cout << " AliFemtoVertexMultAnalysis::ProcessEvent(const AliFemtoEvent* hbtEvent) " << endl;
175 // get right mixing buffer
176 double vertexZ = hbtEvent->PrimVertPos().z();
177 double mult = hbtEvent->UncorrectedNumberOfPrimaries();
178 fMixingBuffer = fPicoEventCollectionVectorHideAway->PicoEventCollection(vertexZ,mult);
179 if (!fMixingBuffer) {
180 if ( vertexZ < fVertexZ[0] ) fUnderFlowVertexZ++;
181 if ( vertexZ > fVertexZ[1] ) fOverFlowVertexZ++;
182 if ( mult < fMult[0] ) fUnderFlowMult++;
183 if ( mult > fMult[1] ) fOverFlowMult++;
186 // call ProcessEvent() from AliFemtoAnalysis-base
187 AliFemtoAnalysis::ProcessEvent(hbtEvent);