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.5 2001/05/25 23:24:00 lisa
20 * Added in AliFemtoKink stuff
22 * Revision 1.4 2000/08/31 22:31:32 laue
23 * AliFemtoAnalysis: output changed (a little bit less)
24 * AliFemtoEvent: new version, members for reference mult added
25 * AliFemtoIOBinary: new IO for new AliFemtoEvent version
26 * AliFemtoTypes: TTree typedef to AliFemtoTTree added
27 * AliFemtoVertexAnalysis: overflow and underflow added
29 * Revision 1.1 2000/07/16 21:44:11 laue
30 * Collection and analysis for vertex dependent event mixing
33 **************************************************************************/
35 #include "Analysis/AliFemtoVertexAnalysis.h"
36 #include "Infrastructure/AliFemtoParticleCollection.h"
37 #include "Base/AliFemtoTrackCut.h"
38 #include "Base/AliFemtoV0Cut.h"
39 #include "Base/AliFemtoKinkCut.h"
40 #include "Infrastructure/AliFemtoPicoEventCollectionVector.h"
41 #include "Infrastructure/AliFemtoPicoEventCollectionVectorHideAway.h"
45 ClassImp(AliFemtoVertexAnalysis)
48 extern void FillHbtParticleCollection(AliFemtoParticleCut* partCut,
49 AliFemtoEvent* hbtEvent,
50 AliFemtoParticleCollection* partCollection);
53 //____________________________
54 AliFemtoVertexAnalysis::AliFemtoVertexAnalysis(unsigned int bins, double min, double max){
55 // mControlSwitch = 0;
57 fFirstParticleCut = 0;
58 fSecondParticleCut = 0;
60 fCorrFctnCollection= 0;
61 fCorrFctnCollection = new AliFemtoCorrFctnCollection;
67 if (fMixingBuffer) delete fMixingBuffer;
68 fPicoEventCollectionVectorHideAway = new AliFemtoPicoEventCollectionVectorHideAway(fVertexBins,fVertexZ[0],fVertexZ[1]);
70 //____________________________
72 AliFemtoVertexAnalysis::AliFemtoVertexAnalysis(const AliFemtoVertexAnalysis& a) : AliFemtoAnalysis() {
73 //AliFemtoVertexAnalysis();
75 fFirstParticleCut = 0;
76 fSecondParticleCut = 0;
78 fCorrFctnCollection= 0;
79 fCorrFctnCollection = new AliFemtoCorrFctnCollection;
80 fVertexBins = a.fVertexBins;
81 fVertexZ[0] = a.fVertexZ[0];
82 fVertexZ[1] = a.fVertexZ[1];
85 if (fMixingBuffer) delete fMixingBuffer;
86 fPicoEventCollectionVectorHideAway = new AliFemtoPicoEventCollectionVectorHideAway(fVertexBins,fVertexZ[0],fVertexZ[1]);
88 // find the right event cut
89 fEventCut = a.fEventCut->Clone();
90 // find the right first particle cut
91 fFirstParticleCut = a.fFirstParticleCut->Clone();
92 // find the right second particle cut
93 if (a.fFirstParticleCut==a.fSecondParticleCut)
94 SetSecondParticleCut(fFirstParticleCut); // identical particle hbt
96 fSecondParticleCut = a.fSecondParticleCut->Clone();
98 fPairCut = a.fPairCut->Clone();
101 SetEventCut(fEventCut); // this will set the myAnalysis pointer inside the cut
102 cout << " AliFemtoVertexAnalysis::AliFemtoVertexAnalysis(const AliFemtoVertexAnalysis& a) - event cut set " << endl;
104 if ( fFirstParticleCut ) {
105 SetFirstParticleCut(fFirstParticleCut); // this will set the myAnalysis pointer inside the cut
106 cout << " AliFemtoVertexAnalysis::AliFemtoVertexAnalysis(const AliFemtoVertexAnalysis& a) - first particle cut set " << endl;
108 if ( fSecondParticleCut ) {
109 SetSecondParticleCut(fSecondParticleCut); // this will set the myAnalysis pointer inside the cut
110 cout << " AliFemtoVertexAnalysis::AliFemtoVertexAnalysis(const AliFemtoVertexAnalysis& a) - second particle cut set " << endl;
112 SetPairCut(fPairCut); // this will set the myAnalysis pointer inside the cut
113 cout << " AliFemtoVertexAnalysis::AliFemtoVertexAnalysis(const AliFemtoVertexAnalysis& a) - pair cut set " << endl;
116 AliFemtoCorrFctnIterator iter;
117 for (iter=a.fCorrFctnCollection->begin(); iter!=a.fCorrFctnCollection->end();iter++){
118 cout << " AliFemtoVertexAnalysis::AliFemtoVertexAnalysis(const AliFemtoVertexAnalysis& a) - looking for correlation functions " << endl;
119 AliFemtoCorrFctn* fctn = (*iter)->Clone();
120 if (fctn) AddCorrFctn(fctn);
121 else cout << " AliFemtoVertexAnalysis::AliFemtoVertexAnalysis(const AliFemtoVertexAnalysis& a) - correlation function not found " << endl;
124 fNumEventsToMix = a.fNumEventsToMix;
126 cout << " AliFemtoVertexAnalysis::AliFemtoVertexAnalysis(const AliFemtoVertexAnalysis& a) - analysis copied " << endl;
129 //____________________________
130 AliFemtoVertexAnalysis::~AliFemtoVertexAnalysis(){
131 // now delete every PicoEvent in the EventMixingBuffer and then the Buffer itself
132 delete fPicoEventCollectionVectorHideAway;
135 //____________________________
136 AliFemtoString AliFemtoVertexAnalysis::Report()
138 cout << "AliFemtoVertexAnalysis - constructing Report..."<<endl;
140 AliFemtoString temp = "-----------\nHbt AliFemtoVertexAnalysis Report:\n";
141 sprintf(Ctemp,"Events are mixed in %d bins in the range %E cm to %E cm.\n",fVertexBins,fVertexZ[0],fVertexZ[1]);
143 sprintf(Ctemp,"Events underflowing: %d\n",fUnderFlow);
145 sprintf(Ctemp,"Events overflowing: %d\n",fOverFlow);
147 sprintf(Ctemp,"Now adding AliFemtoAnalysis(base) Report\n");
149 temp += AliFemtoAnalysis::Report();
150 AliFemtoString returnThis=temp;
153 //_________________________
154 void AliFemtoVertexAnalysis::ProcessEvent(const AliFemtoEvent* hbtEvent) {
155 cout << " AliFemtoVertexAnalysis::ProcessEvent(const AliFemtoEvent* hbtEvent) " << endl;
156 // get right mixing buffer
157 double vertexZ = hbtEvent->PrimVertPos().z();
158 fMixingBuffer = fPicoEventCollectionVectorHideAway->PicoEventCollection(vertexZ);
159 if (!fMixingBuffer) {
160 if ( vertexZ < fVertexZ[0] ) fUnderFlow++;
161 if ( vertexZ > fVertexZ[1] ) fOverFlow++;
164 // call ProcessEvent() from AliFemtoAnalysis-base
165 AliFemtoAnalysis::ProcessEvent(hbtEvent);