]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/FEMTOSCOPY/AliFemto/AliFemtoSimpleAnalysis.cxx
Add dEdx monitoring. Add accepted multiplicity monitoring
[u/mrichter/AliRoot.git] / PWG2 / FEMTOSCOPY / AliFemto / AliFemtoSimpleAnalysis.cxx
CommitLineData
a5b23aa6 1///////////////////////////////////////////////////////////////////////////
2// //
3// AliFemtoSimpleAnalysis - the most basic analysis there is. All other //
4// inherit from this one. Provides basic functionality for the analysis. //
5// To properly set up the analysis the following steps should be taken: //
6// //
7// - create particle cuts and add them via SetFirstParticleCut and //
8// SetSecondParticleCut. If one analyzes identical particle //
9// correlations, the first particle cut must be also the second //
10// particle cut. //
11// //
12// - create pair cuts and add them via SetPairCut //
13// //
14// - create one or many correlation functions and add them via //
15// AddCorrFctn method. //
16// //
17// - specify how many events are to be strored in the mixing buffer for //
18// background construction //
19// //
20// Then, when the analysis is run, for each event, the EventBegin is //
21// called before any processing is done, then the ProcessEvent is called //
22// which takes care of creating real and mixed pairs and sending them //
23// to all the registered correlation functions. At the end of each event,//
24// after all pairs are processed, EventEnd is called. After the whole //
25// analysis finishes (there is no more events to process) Finish() is //
26// called. //
27// //
28///////////////////////////////////////////////////////////////////////////
29#include "AliFemtoSimpleAnalysis.h"
30#include "AliFemtoTrackCut.h"
31#include "AliFemtoV0Cut.h"
32#include "AliFemtoKinkCut.h"
33#include <string>
34#include <iostream>
35
36// blah blah
37
38#ifdef __ROOT__
39ClassImp(AliFemtoSimpleAnalysis)
40#endif
41
42AliFemtoEventCut* copyTheCut(AliFemtoEventCut*);
43AliFemtoParticleCut* copyTheCut(AliFemtoParticleCut*);
44AliFemtoPairCut* copyTheCut(AliFemtoPairCut*);
45AliFemtoCorrFctn* copyTheCorrFctn(AliFemtoCorrFctn*);
46
47// this little function used to apply ParticleCuts (TrackCuts or V0Cuts) and fill ParticleCollections of picoEvent
48// it is called from AliFemtoSimpleAnalysis::ProcessEvent()
49void FillHbtParticleCollection(AliFemtoParticleCut* partCut,
50 AliFemtoEvent* hbtEvent,
51 AliFemtoParticleCollection* partCollection)
52{
53 // Fill particle collections from the event
54 // by the particles that pass all the cuts
55 switch (partCut->Type()) {
56 case hbtTrack: // cut is cutting on Tracks
57 {
58 AliFemtoTrackCut* pCut = (AliFemtoTrackCut*) partCut;
59 AliFemtoTrack* pParticle;
60 AliFemtoTrackIterator pIter;
61 AliFemtoTrackIterator startLoop = hbtEvent->TrackCollection()->begin();
62 AliFemtoTrackIterator endLoop = hbtEvent->TrackCollection()->end();
63 for (pIter=startLoop;pIter!=endLoop;pIter++){
64 pParticle = *pIter;
65 bool tmpPassParticle = pCut->Pass(pParticle);
66 pCut->FillCutMonitor(pParticle, tmpPassParticle);
67 if (tmpPassParticle){
68 AliFemtoParticle* particle = new AliFemtoParticle(pParticle,pCut->Mass());
69 partCollection->push_back(particle);
70 }
71 }
72 break;
73 }
74 case hbtV0: // cut is cutting on V0s
75 {
76 AliFemtoV0Cut* pCut = (AliFemtoV0Cut*) partCut;
77 AliFemtoV0* pParticle;
78 AliFemtoV0Iterator pIter;
79 AliFemtoV0Iterator startLoop = hbtEvent->V0Collection()->begin();
80 AliFemtoV0Iterator endLoop = hbtEvent->V0Collection()->end();
81 // this following "for" loop is identical to the one above, but because of scoping, I can's see how to avoid repitition...
82 for (pIter=startLoop;pIter!=endLoop;pIter++){
83 pParticle = *pIter;
84 bool tmpPassV0 = pCut->Pass(pParticle);
85 pCut->FillCutMonitor(pParticle,tmpPassV0);
86 if (tmpPassV0){
87 AliFemtoParticle* particle = new AliFemtoParticle(pParticle,partCut->Mass());
88 partCollection->push_back(particle);
89 }
90 }
91 pCut->FillCutMonitor(hbtEvent,partCollection);// Gael 19/06/02
92 break;
93 }
94 case hbtKink: // cut is cutting on Kinks -- mal 25May2001
95 {
96 AliFemtoKinkCut* pCut = (AliFemtoKinkCut*) partCut;
97 AliFemtoKink* pParticle;
98 AliFemtoKinkIterator pIter;
99 AliFemtoKinkIterator startLoop = hbtEvent->KinkCollection()->begin();
100 AliFemtoKinkIterator endLoop = hbtEvent->KinkCollection()->end();
101 // this following "for" loop is identical to the one above, but because of scoping, I can's see how to avoid repitition...
102 for (pIter=startLoop;pIter!=endLoop;pIter++){
103 pParticle = *pIter;
104 bool tmpPass = pCut->Pass(pParticle);
105 pCut->FillCutMonitor(pParticle,tmpPass);
106 if (tmpPass){
107 AliFemtoParticle* particle = new AliFemtoParticle(pParticle,partCut->Mass());
108 partCollection->push_back(particle);
109 }
110 }
111 break;
112 }
113 default:
114 cout << "FillHbtParticleCollection function (in AliFemtoSimpleAnalysis.cxx) - undefined Particle Cut type!!! \n";
115 }
116}
117//____________________________
118AliFemtoSimpleAnalysis::AliFemtoSimpleAnalysis() :
119 fPicoEventCollectionVectorHideAway(0),
120 fPairCut(0),
121 fCorrFctnCollection(0),
122 fEventCut(0),
123 fFirstParticleCut(0),
124 fSecondParticleCut(0),
125 fMixingBuffer(0),
126 fPicoEvent(0),
127 fNumEventsToMix(0),
128 fNeventsProcessed(0),
129 fMinSizePartCollection(0)
130{
131 // Default constructor
132 // mControlSwitch = 0;
133 fCorrFctnCollection = new AliFemtoCorrFctnCollection;
134 fMixingBuffer = new AliFemtoPicoEventCollection;
135}
136//____________________________
137
138AliFemtoSimpleAnalysis::AliFemtoSimpleAnalysis(const AliFemtoSimpleAnalysis& a) :
139 AliFemtoAnalysis(),
140 fPicoEventCollectionVectorHideAway(0),
141 fPairCut(0),
142 fCorrFctnCollection(0),
143 fEventCut(0),
144 fFirstParticleCut(0),
145 fSecondParticleCut(0),
146 fMixingBuffer(0),
147 fPicoEvent(0),
148 fNumEventsToMix(0),
149 fNeventsProcessed(0),
150 fMinSizePartCollection(0)
151{
152 // Copy constructor
153 //AliFemtoSimpleAnalysis();
154 fCorrFctnCollection = new AliFemtoCorrFctnCollection;
155 fMixingBuffer = new AliFemtoPicoEventCollection;
156
157 // find the right event cut
158 fEventCut = a.fEventCut->Clone();
159 // find the right first particle cut
160 fFirstParticleCut = a.fFirstParticleCut->Clone();
161 // find the right second particle cut
162 if (a.fFirstParticleCut==a.fSecondParticleCut)
163 SetSecondParticleCut(fFirstParticleCut); // identical particle hbt
164 else
165 fSecondParticleCut = a.fSecondParticleCut->Clone();
166
167 fPairCut = a.fPairCut->Clone();
168
169 if ( fEventCut ) {
170 SetEventCut(fEventCut); // this will set the myAnalysis pointer inside the cut
171 cout << " AliFemtoSimpleAnalysis::AliFemtoSimpleAnalysis(const AliFemtoSimpleAnalysis& a) - event cut set " << endl;
172 }
173 if ( fFirstParticleCut ) {
174 SetFirstParticleCut(fFirstParticleCut); // this will set the myAnalysis pointer inside the cut
175 cout << " AliFemtoSimpleAnalysis::AliFemtoSimpleAnalysis(const AliFemtoSimpleAnalysis& a) - first particle cut set " << endl;
176 }
177 if ( fSecondParticleCut ) {
178 SetSecondParticleCut(fSecondParticleCut); // this will set the myAnalysis pointer inside the cut
179 cout << " AliFemtoSimpleAnalysis::AliFemtoSimpleAnalysis(const AliFemtoSimpleAnalysis& a) - second particle cut set " << endl;
180 } if ( fPairCut ) {
181 SetPairCut(fPairCut); // this will set the myAnalysis pointer inside the cut
182 cout << " AliFemtoSimpleAnalysis::AliFemtoSimpleAnalysis(const AliFemtoSimpleAnalysis& a) - pair cut set " << endl;
183 }
184
185 AliFemtoCorrFctnIterator iter;
186 for (iter=a.fCorrFctnCollection->begin(); iter!=a.fCorrFctnCollection->end();iter++){
187 cout << " AliFemtoSimpleAnalysis::AliFemtoSimpleAnalysis(const AliFemtoSimpleAnalysis& a) - looking for correlation functions " << endl;
188 AliFemtoCorrFctn* fctn = (*iter)->Clone();
189 if (fctn) AddCorrFctn(fctn);
190 else cout << " AliFemtoSimpleAnalysis::AliFemtoSimpleAnalysis(const AliFemtoSimpleAnalysis& a) - correlation function not found " << endl;
191 }
192
193 fNumEventsToMix = a.fNumEventsToMix;
194
195 fMinSizePartCollection = a.fMinSizePartCollection; // minimum # particles in ParticleCollection
196
197 cout << " AliFemtoSimpleAnalysis::AliFemtoSimpleAnalysis(const AliFemtoSimpleAnalysis& a) - analysis copied " << endl;
198
199}
200//____________________________
201AliFemtoSimpleAnalysis::~AliFemtoSimpleAnalysis(){
202 // destructor
203 cout << " AliFemtoSimpleAnalysis::~AliFemtoSimpleAnalysis()" << endl;
204 if (fEventCut) delete fEventCut; fEventCut=0;
205 if (fFirstParticleCut == fSecondParticleCut) fSecondParticleCut=0;
206 if (fFirstParticleCut) delete fFirstParticleCut; fFirstParticleCut=0;
207 if (fSecondParticleCut) delete fSecondParticleCut; fSecondParticleCut=0;
208 if (fPairCut) delete fPairCut; fPairCut=0;
209 // now delete every CorrFunction in the Collection, and then the Collection itself
210 AliFemtoCorrFctnIterator iter;
211 for (iter=fCorrFctnCollection->begin(); iter!=fCorrFctnCollection->end();iter++){
212 delete *iter;
213 }
214 delete fCorrFctnCollection;
215 // now delete every PicoEvent in the EventMixingBuffer and then the Buffer itself
216 if (fMixingBuffer) {
217 AliFemtoPicoEventIterator piter;
218 for (piter=fMixingBuffer->begin();piter!=fMixingBuffer->end();piter++){
219 delete *piter;
220 }
221 delete fMixingBuffer;
222 }
223}
224//______________________
225AliFemtoSimpleAnalysis& AliFemtoSimpleAnalysis::operator=(const AliFemtoSimpleAnalysis& aAna)
226{
227 // Assignment operator
228 if (this == &aAna)
229 return *this;
230
231 fCorrFctnCollection = new AliFemtoCorrFctnCollection;
232 fMixingBuffer = new AliFemtoPicoEventCollection;
233
234 // find the right event cut
235 fEventCut = aAna.fEventCut->Clone();
236 // find the right first particle cut
237 fFirstParticleCut = aAna.fFirstParticleCut->Clone();
238 // find the right second particle cut
239 if (aAna.fFirstParticleCut==aAna.fSecondParticleCut)
240 SetSecondParticleCut(fFirstParticleCut); // identical particle hbt
241 else
242 fSecondParticleCut = aAna.fSecondParticleCut->Clone();
243
244 fPairCut = aAna.fPairCut->Clone();
245
246 if ( fEventCut ) {
247 SetEventCut(fEventCut); // this will set the myAnalysis pointer inside the cut
248 cout << " AliFemtoSimpleAnalysis::AliFemtoSimpleAnalysis(const AliFemtoSimpleAnalysis& a) - event cut set " << endl;
249 }
250 if ( fFirstParticleCut ) {
251 SetFirstParticleCut(fFirstParticleCut); // this will set the myAnalysis pointer inside the cut
252 cout << " AliFemtoSimpleAnalysis::AliFemtoSimpleAnalysis(const AliFemtoSimpleAnalysis& a) - first particle cut set " << endl;
253 }
254 if ( fSecondParticleCut ) {
255 SetSecondParticleCut(fSecondParticleCut); // this will set the myAnalysis pointer inside the cut
256 cout << " AliFemtoSimpleAnalysis::AliFemtoSimpleAnalysis(const AliFemtoSimpleAnalysis& a) - second particle cut set " << endl;
257 } if ( fPairCut ) {
258 SetPairCut(fPairCut); // this will set the myAnalysis pointer inside the cut
259 cout << " AliFemtoSimpleAnalysis::AliFemtoSimpleAnalysis(const AliFemtoSimpleAnalysis& a) - pair cut set " << endl;
260 }
261
262 AliFemtoCorrFctnIterator iter;
263 for (iter=aAna.fCorrFctnCollection->begin(); iter!=aAna.fCorrFctnCollection->end();iter++){
264 cout << " AliFemtoSimpleAnalysis::AliFemtoSimpleAnalysis(const AliFemtoSimpleAnalysis& a) - looking for correlation functions " << endl;
265 AliFemtoCorrFctn* fctn = (*iter)->Clone();
266 if (fctn) AddCorrFctn(fctn);
267 else cout << " AliFemtoSimpleAnalysis::AliFemtoSimpleAnalysis(const AliFemtoSimpleAnalysis& a) - correlation function not found " << endl;
268 }
269
270 fNumEventsToMix = aAna.fNumEventsToMix;
271
272 fMinSizePartCollection = aAna.fMinSizePartCollection; // minimum # particles in ParticleCollection
273
274 cout << " AliFemtoSimpleAnalysis::AliFemtoSimpleAnalysis(const AliFemtoSimpleAnalysis& a) - analysis copied " << endl;
275
276 return *this;
277}
278//______________________
279AliFemtoCorrFctn* AliFemtoSimpleAnalysis::CorrFctn(int n){
280 // return pointer to n-th correlation function
281 if ( n<0 || n > (int)fCorrFctnCollection->size() )
282 return NULL;
283 AliFemtoCorrFctnIterator iter=fCorrFctnCollection->begin();
284 for (int i=0; i<n ;i++){
285 iter++;
286 }
287 return *iter;
288}
289//____________________________
290AliFemtoString AliFemtoSimpleAnalysis::Report()
291{
292 // Create a simple report from the analysis execution
293 cout << "AliFemtoSimpleAnalysis - constructing Report..."<<endl;
294 string temp = "-----------\nHbt Analysis Report:\n";
295 temp += "\nEvent Cuts:\n";
296 temp += fEventCut->Report();
297 temp += "\nParticle Cuts - First Particle:\n";
298 temp += fFirstParticleCut->Report();
299 temp += "\nParticle Cuts - Second Particle:\n";
300 temp += fSecondParticleCut->Report();
301 temp += "\nPair Cuts:\n";
302 temp += fPairCut->Report();
303 temp += "\nCorrelation Functions:\n";
304 AliFemtoCorrFctnIterator iter;
305 if ( fCorrFctnCollection->size()==0 ) {
306 cout << "AliFemtoSimpleAnalysis-Warning : no correlations functions in this analysis " << endl;
307 }
308 for (iter=fCorrFctnCollection->begin(); iter!=fCorrFctnCollection->end();iter++){
309 temp += (*iter)->Report();
310 temp += "\n";
311 }
312 temp += "-------------\n";
313 AliFemtoString returnThis=temp;
314 return returnThis;
315}
316//_________________________
317void AliFemtoSimpleAnalysis::ProcessEvent(const AliFemtoEvent* hbtEvent) {
318 // Add event to processed events
319 fPicoEvent=0; // we will get a new pico event, if not prevent corr. fctn to access old pico event
320 AddEventProcessed();
321 // startup for EbyE
322 EventBegin(hbtEvent);
323 // event cut and event cut monitor
324 bool tmpPassEvent = fEventCut->Pass(hbtEvent);
8a21a731 325 if (!tmpPassEvent)
326 fEventCut->FillCutMonitor(hbtEvent, tmpPassEvent);
a5b23aa6 327 if (tmpPassEvent) {
1dead9de 328// cout << "AliFemtoSimpleAnalysis::ProcessEvent() - Event has passed cut - build picoEvent from " <<
329// hbtEvent->TrackCollection()->size() << " tracks in TrackCollection" << endl;
330// cout << "Event has passed cut with " << hbtEvent->TrackCollection()->size() << " tracks" << endl;
a5b23aa6 331 // OK, analysis likes the event-- build a pico event from it, using tracks the analysis likes...
332 fPicoEvent = new AliFemtoPicoEvent; // this is what we will make pairs from and put in Mixing Buffer
333 // no memory leak. we will delete picoevents when they come out of the mixing buffer
334 FillHbtParticleCollection(fFirstParticleCut,(AliFemtoEvent*)hbtEvent,fPicoEvent->FirstParticleCollection());
335 if ( !(AnalyzeIdenticalParticles()) )
336 FillHbtParticleCollection(fSecondParticleCut,(AliFemtoEvent*)hbtEvent,fPicoEvent->SecondParticleCollection());
1dead9de 337// cout <<"AliFemtoSimpleAnalysis::ProcessEvent - #particles in First, Second Collections: " <<
338// fPicoEvent->FirstParticleCollection()->size() << " " <<
339// fPicoEvent->SecondParticleCollection()->size() << endl;
340
341 cout << "#particles in Collection 1, 2: " <<
a5b23aa6 342 fPicoEvent->FirstParticleCollection()->size() << " " <<
343 fPicoEvent->SecondParticleCollection()->size() << endl;
344
345 // mal - implement a switch which allows only using events with ParticleCollections containing a minimum
346 // number of entries (jun2002)
347 if ((fPicoEvent->FirstParticleCollection()->size() >= fMinSizePartCollection )
348 && ( AnalyzeIdenticalParticles() || (fPicoEvent->SecondParticleCollection()->size() >= fMinSizePartCollection ))) {
8a21a731 349 fEventCut->FillCutMonitor(hbtEvent, tmpPassEvent);
350
a5b23aa6 351
352//------------------------------------------------------------------------------
353// Temporary comment:
354// This whole section rewritten so that all pairs are built using the
355// same code... easier to read and manage, and MakePairs() can be called by
356// derived classes. Also, the requirement of a full mixing buffer before
357// mixing is removed.
358// Dan Magestro, 11/2002
359
360 //------ Make real pairs. If identical, make pairs for one collection ------//
361
362 if (AnalyzeIdenticalParticles()) {
363 MakePairs("real", fPicoEvent->FirstParticleCollection() );
364 }
365 else {
366 MakePairs("real", fPicoEvent->FirstParticleCollection(),
367 fPicoEvent->SecondParticleCollection() );
368 }
369 cout << "AliFemtoSimpleAnalysis::ProcessEvent() - reals done ";
370
371 //---- Make pairs for mixed events, looping over events in mixingBuffer ----//
372
373 AliFemtoPicoEvent* storedEvent;
374 AliFemtoPicoEventIterator fPicoEventIter;
375 for (fPicoEventIter=MixingBuffer()->begin();fPicoEventIter!=MixingBuffer()->end();fPicoEventIter++){
376 storedEvent = *fPicoEventIter;
377 if (AnalyzeIdenticalParticles()) {
378 MakePairs("mixed",fPicoEvent->FirstParticleCollection(),
379 storedEvent->FirstParticleCollection() );
380 }
381 else {
382 MakePairs("mixed",fPicoEvent->FirstParticleCollection(),
383 storedEvent->SecondParticleCollection() );
384
385 MakePairs("mixed",storedEvent->FirstParticleCollection(),
386 fPicoEvent->SecondParticleCollection() );
387 }
388 }
389 cout << " - mixed done " << endl;
390
391 //--------- If mixing buffer is full, delete oldest event ---------//
392
393 if ( MixingBufferFull() ) {
394 delete MixingBuffer()->back();
395 MixingBuffer()->pop_back();
396 }
397
398 //-------- Add current event (fPicoEvent) to mixing buffer --------//
399
400 MixingBuffer()->push_front(fPicoEvent);
401
402
403// Temporary comment: End of rewritten section... Dan Magestro, 11/2002
404//------------------------------------------------------------------------------
405
406
407 } // if ParticleCollections are big enough (mal jun2002)
408 else{
8a21a731 409 fEventCut->FillCutMonitor(hbtEvent, !tmpPassEvent);
a5b23aa6 410 delete fPicoEvent;
411 }
412 } // if currentEvent is accepted by currentAnalysis
413 EventEnd(hbtEvent); // cleanup for EbyE
414 //cout << "AliFemtoSimpleAnalysis::ProcessEvent() - return to caller ... " << endl;
415}
416//_________________________
417void AliFemtoSimpleAnalysis::MakePairs(const char* typeIn, AliFemtoParticleCollection *partCollection1,
3efcfa2f 418 AliFemtoParticleCollection *partCollection2){
a5b23aa6 419// Build pairs, check pair cuts, and call CFs' AddRealPair() or
420// AddMixedPair() methods. If no second particle collection is
421// specfied, make pairs within first particle collection.
422
423 string type = typeIn;
424
29bfb3b1 425 // int swpart = ((long int) partCollection1) % 2;
426 int swpart = fNeventsProcessed % 2;
3efcfa2f 427
a5b23aa6 428 AliFemtoPair* tPair = new AliFemtoPair;
429
430 AliFemtoCorrFctnIterator tCorrFctnIter;
431
432 AliFemtoParticleIterator tPartIter1, tPartIter2;
433
434 AliFemtoParticleIterator tStartOuterLoop = partCollection1->begin(); // always
435 AliFemtoParticleIterator tEndOuterLoop = partCollection1->end(); // will be one less if identical
436 AliFemtoParticleIterator tStartInnerLoop;
437 AliFemtoParticleIterator tEndInnerLoop;
438 if (partCollection2) { // Two collections:
439 tStartInnerLoop = partCollection2->begin(); // Full inner & outer loops
440 tEndInnerLoop = partCollection2->end(); //
441 }
442 else { // One collection:
443 tEndOuterLoop--; // Outer loop goes to next-to-last particle
444 tEndInnerLoop = partCollection1->end() ; // Inner loop goes to last particle
445 }
446 for (tPartIter1=tStartOuterLoop;tPartIter1!=tEndOuterLoop;tPartIter1++) {
447 if (!partCollection2){
448 tStartInnerLoop = tPartIter1;
449 tStartInnerLoop++;
450 }
451 tPair->SetTrack1(*tPartIter1);
452 for (tPartIter2 = tStartInnerLoop; tPartIter2!=tEndInnerLoop;tPartIter2++) {
453 tPair->SetTrack2(*tPartIter2);
454
455 // The following lines have to be uncommented if you want pairCutMonitors
456 // they are not in for speed reasons
457 // bool tmpPassPair = fPairCut->Pass(tPair);
458 // fPairCut->FillCutMonitor(tPair, tmpPassPair);
459 // if ( tmpPassPair )
460
461 //---- If pair passes cut, loop over CF's and add pair to real/mixed ----//
462
3efcfa2f 463 if (!partCollection2) {
464 if (swpart) {
465 tPair->SetTrack1(*tPartIter2);
466 tPair->SetTrack2(*tPartIter1);
467 swpart = 0;
468 }
469 else {
470 tPair->SetTrack1(*tPartIter1);
471 tPair->SetTrack2(*tPartIter2);
472 swpart = 1;
473 }
474 }
475
a5b23aa6 476 if (fPairCut->Pass(tPair)){
477 for (tCorrFctnIter=fCorrFctnCollection->begin();
478 tCorrFctnIter!=fCorrFctnCollection->end();tCorrFctnIter++){
479 AliFemtoCorrFctn* tCorrFctn = *tCorrFctnIter;
480 if(type == "real")
481 tCorrFctn->AddRealPair(tPair);
482 else if(type == "mixed")
483 tCorrFctn->AddMixedPair(tPair);
484 else
485 cout << "Problem with pair type, type = " << type.c_str() << endl;
486 }
487 }
488
489 } // loop over second particle
490
491 } // loop over first particle
492
493 delete tPair;
494
495}
496//_________________________
497void AliFemtoSimpleAnalysis::EventBegin(const AliFemtoEvent* ev){
498 // Perform initialization operations at the beginning of the event processing
499 //cout << " AliFemtoSimpleAnalysis::EventBegin(const AliFemtoEvent* ev) " << endl;
500 fFirstParticleCut->EventBegin(ev);
501 fSecondParticleCut->EventBegin(ev);
502 fPairCut->EventBegin(ev);
503 for (AliFemtoCorrFctnIterator iter=fCorrFctnCollection->begin(); iter!=fCorrFctnCollection->end();iter++){
504 (*iter)->EventBegin(ev);
505 }
506}
507//_________________________
508void AliFemtoSimpleAnalysis::EventEnd(const AliFemtoEvent* ev){
509 // Fiinsh operations at the end of event processing
510 fFirstParticleCut->EventEnd(ev);
511 fSecondParticleCut->EventEnd(ev);
512 fPairCut->EventEnd(ev);
513 for (AliFemtoCorrFctnIterator iter=fCorrFctnCollection->begin(); iter!=fCorrFctnCollection->end();iter++){
514 (*iter)->EventEnd(ev);
515 }
516}
517//_________________________
518void AliFemtoSimpleAnalysis::Finish(){
519 // Perform finishing operations after all events are processed
520 AliFemtoCorrFctnIterator iter;
521 for (iter=fCorrFctnCollection->begin(); iter!=fCorrFctnCollection->end();iter++){
522 (*iter)->Finish();
523 }
524}
525//_________________________
526void AliFemtoSimpleAnalysis::AddEventProcessed() {
527 // Increase count of processed events
528 fNeventsProcessed++;
529}
530//_________________________
531TList* AliFemtoSimpleAnalysis::ListSettings()
532{
0b3bd1ac 533 // Collect settings list
a5b23aa6 534 TList *tListSettings = new TList();
535
536 TList *p1Cut = fFirstParticleCut->ListSettings();
537
538 TListIter nextp1(p1Cut);
539 while (TObject *obj = nextp1.Next()) {
540 TString cuts(obj->GetName());
541 cuts.Prepend("AliFemtoSimpleAnalysis.");
542 tListSettings->Add(new TObjString(cuts.Data()));
543 }
544
545 if (fSecondParticleCut != fFirstParticleCut) {
546 TList *p2Cut = fSecondParticleCut->ListSettings();
547
548 TIter nextp2(p2Cut);
549 while (TObject *obj = nextp2()) {
550 TString cuts(obj->GetName());
551 cuts.Prepend("AliFemtoSimpleAnalysis.");
552 tListSettings->Add(new TObjString(cuts.Data()));
553 }
554 }
555
556 TList *pairCut = fPairCut->ListSettings();
557
558 TIter nextpair(pairCut);
559 while (TObject *obj = nextpair()) {
560 TString cuts(obj->GetName());
561 cuts.Prepend("AliFemtoSimpleAnalysis.");
562 tListSettings->Add(new TObjString(cuts.Data()));
563 }
564
565 return tListSettings;
566
567}
0b3bd1ac 568
569//_________________________
570TList* AliFemtoSimpleAnalysis::GetOutputList()
571{
572 // Collect the list of output objects
573 // to be written
574 TList *tOutputList = new TList();
575
576 TList *p1Cut = fFirstParticleCut->GetOutputList();
577
578 TListIter nextp1(p1Cut);
579 while (TObject *obj = nextp1.Next()) {
580 tOutputList->Add(obj);
581 }
582
583 if (fSecondParticleCut != fFirstParticleCut) {
584 TList *p2Cut = fSecondParticleCut->GetOutputList();
585
586 TIter nextp2(p2Cut);
587 while (TObject *obj = nextp2()) {
588 tOutputList->Add(obj);
589 }
590 }
591
592 TList *pairCut = fPairCut->GetOutputList();
593
594 TIter nextpair(pairCut);
595 while (TObject *obj = nextpair()) {
596 tOutputList->Add(obj);
597 }
598
76e2a578 599 TList *eventCut = fEventCut->GetOutputList();
600
601 TIter nextevent(eventCut);
602 while (TObject *obj = nextevent()) {
603 tOutputList->Add(obj);
604 }
605
0b3bd1ac 606 AliFemtoCorrFctnIterator iter;
607 for (iter=fCorrFctnCollection->begin(); iter!=fCorrFctnCollection->end();iter++){
608 TList *tListCf = (*iter)->GetOutputList();
609
610 TIter nextListCf(tListCf);
611 while (TObject *obj = nextListCf()) {
612 tOutputList->Add(obj);
613 }
614 }
615
616 return tOutputList;
617
618}