67427ff7 |
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.1.1 2007/03/07 10:14:49 mchojnacki |
17 | * First version on CVS |
18 | * |
19 | * Revision 1.2 2005/06/28 23:12:24 chajecki |
20 | * UncorrectedNumberOfNegativePrimaries() -> UncorrectedNumberOfPrimaries() |
21 | * |
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. |
28 | * |
29 | * Revision 1.1 2001/11/11 18:34:14 laue |
30 | * AliFemtoPicoEventCollectionVectorHideAway: updated for 3d grid |
31 | * AliFemtoVertexMultAnalysis: new |
32 | * |
33 | * |
34 | **************************************************************************/ |
35 | |
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" |
43 | |
44 | |
45 | #ifdef __ROOT__ |
46 | ClassImp(AliFemtoVertexMultAnalysis) |
47 | #endif |
48 | |
49 | extern void FillHbtParticleCollection(AliFemtoParticleCut* partCut, |
50 | AliFemtoEvent* hbtEvent, |
51 | AliFemtoParticleCollection* partCollection); |
52 | |
53 | |
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; |
59 | fEventCut = 0; |
60 | fFirstParticleCut = 0; |
61 | fSecondParticleCut = 0; |
62 | fPairCut = 0; |
63 | fCorrFctnCollection= 0; |
64 | fCorrFctnCollection = new AliFemtoCorrFctnCollection; |
65 | fVertexZ[0] = minVertex; |
66 | fVertexZ[1] = maxVertex; |
67 | fUnderFlowVertexZ = 0; |
68 | fOverFlowVertexZ = 0; |
69 | fMult[0] = minMult; |
70 | fMult[1] = maxMult; |
71 | fUnderFlowMult = 0; |
72 | fOverFlowMult = 0; |
73 | if (fMixingBuffer) delete fMixingBuffer; |
74 | fPicoEventCollectionVectorHideAway = new AliFemtoPicoEventCollectionVectorHideAway(fVertexZBins,fVertexZ[0],fVertexZ[1], |
75 | fMultBins,fMult[0],fMult[1]); |
76 | }; |
77 | //____________________________ |
78 | |
79 | AliFemtoVertexMultAnalysis::AliFemtoVertexMultAnalysis(const AliFemtoVertexMultAnalysis& a) : AliFemtoAnalysis() { |
80 | //AliFemtoVertexMultAnalysis(); |
81 | fEventCut = 0; |
82 | fFirstParticleCut = 0; |
83 | fSecondParticleCut = 0; |
84 | fPairCut = 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; |
91 | fOverFlowVertexZ = 0; |
92 | fMultBins = a.fMultBins; |
93 | fMult[0] = a.fMult[0]; |
94 | fMult[1] = a.fMult[1]; |
95 | fUnderFlowMult = 0; |
96 | fOverFlowMult = 0; |
97 | if (fMixingBuffer) delete fMixingBuffer; |
98 | fPicoEventCollectionVectorHideAway = new AliFemtoPicoEventCollectionVectorHideAway(fVertexZBins,fVertexZ[0],fVertexZ[1], |
99 | fMultBins,fMult[0],fMult[1]); |
100 | |
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 |
108 | else |
109 | fSecondParticleCut = a.fSecondParticleCut->Clone(); |
110 | |
111 | fPairCut = a.fPairCut->Clone(); |
112 | |
113 | if ( fEventCut ) { |
114 | SetEventCut(fEventCut); // this will set the myAnalysis pointer inside the cut |
115 | cout << " AliFemtoVertexMultAnalysis::AliFemtoVertexMultAnalysis(const AliFemtoVertexMultAnalysis& a) - event cut set " << endl; |
116 | } |
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; |
120 | } |
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; |
124 | } if ( fPairCut ) { |
125 | SetPairCut(fPairCut); // this will set the myAnalysis pointer inside the cut |
126 | cout << " AliFemtoVertexMultAnalysis::AliFemtoVertexMultAnalysis(const AliFemtoVertexMultAnalysis& a) - pair cut set " << endl; |
127 | } |
128 | |
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; |
135 | } |
136 | |
137 | fNumEventsToMix = a.fNumEventsToMix; |
138 | |
139 | cout << " AliFemtoVertexMultAnalysis::AliFemtoVertexMultAnalysis(const AliFemtoVertexMultAnalysis& a) - analysis copied " << endl; |
140 | |
141 | } |
142 | //____________________________ |
143 | AliFemtoVertexMultAnalysis::~AliFemtoVertexMultAnalysis(){ |
144 | // now delete every PicoEvent in the EventMixingBuffer and then the Buffer itself |
145 | delete fPicoEventCollectionVectorHideAway; |
146 | } |
147 | |
148 | //____________________________ |
149 | AliFemtoString AliFemtoVertexMultAnalysis::Report() |
150 | { |
151 | cout << "AliFemtoVertexMultAnalysis - constructing Report..."<<endl; |
152 | char Ctemp[200]; |
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]); |
155 | temp += Ctemp; |
156 | sprintf(Ctemp,"Events underflowing: %d\n",fUnderFlowVertexZ); |
157 | temp += Ctemp; |
158 | sprintf(Ctemp,"Events overflowing: %d\n",fOverFlowVertexZ); |
159 | temp += Ctemp; |
160 | sprintf(Ctemp,"Events are mixed in %d Mult bins in the range %E cm to %E cm.\n",fMultBins,fMult[0],fMult[1]); |
161 | temp += Ctemp; |
162 | sprintf(Ctemp,"Events underflowing: %d\n",fUnderFlowMult); |
163 | temp += Ctemp; |
164 | sprintf(Ctemp,"Events overflowing: %d\n",fOverFlowMult); |
165 | temp += Ctemp; |
166 | sprintf(Ctemp,"Now adding AliFemtoAnalysis(base) Report\n"); |
167 | temp += Ctemp; |
168 | temp += AliFemtoAnalysis::Report(); |
169 | AliFemtoString returnThis=temp; |
170 | return returnThis; |
171 | } |
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++; |
184 | return; |
185 | } |
186 | // call ProcessEvent() from AliFemtoAnalysis-base |
187 | AliFemtoAnalysis::ProcessEvent(hbtEvent); |
188 | } |