Bug correction
[u/mrichter/AliRoot.git] / HBTAN / AliHBTAnalysisStavinskyMixing.cxx
CommitLineData
b74dff53 1#include "AliHBTAnalysisStavinskyMixing.h"
2//_________________________________________________________
3////////////////////////////////////////////////////////////////////////////
4//
5// class AliHBTAnalysisStavinskyMixing
6//
7// Central Object Of HBTAnalyser:
8// This class performs main looping within HBT Analysis
9// User must plug a reader of Type AliReader
10// User plugs in coorelation and monitor functions
11// as well as monitor functions
12//
13// HBT Analysis Tool, which is integral part of AliRoot,
14// ALICE Off-Line framework:
15//
16// Piotr.Skowronski@cern.ch
17// more info: http://alisoft.cern.ch/people/skowron/analyzer/index.html
18//
19////////////////////////////////////////////////////////////////////////////
20//_________________________________________________________
21
22
23#include <TSystem.h>
24#include <TFile.h>
25
26#include "AliAOD.h"
27#include "AliAODParticle.h"
28#include "AliAODPairCut.h"
29#include "AliEventCut.h"
30
31#include "AliEventBuffer.h"
32
33#include "AliReader.h"
34#include "AliHBTPair.h"
35#include "AliHBTFunction.h"
36#include "AliHBTMonitorFunction.h"
37
38
39ClassImp(AliHBTAnalysisStavinskyMixing)
40
41
42Int_t AliHBTAnalysisStavinskyMixing::ProcessRecAndSim(AliAOD* aodrec, AliAOD* aodsim)
43{
44//Does analysis for both tracks and particles
45//mainly for resolution study and analysies with weighting algirithms
46
47// cut on particles only -- why?
48// - PID: when we make resolution analysis we want to take only tracks with correct PID
49// We need cut on tracks because there are data characteristic
50
51 AliVAODParticle * part1, * part2;
52 AliVAODParticle * track1, * track2;
53
54 AliAOD * trackEvent = aodrec, *partEvent = aodsim;
55 AliAOD* trackEvent1 = new AliAOD();
56 AliAOD* partEvent1 = new AliAOD();
57
b74dff53 58
59// Int_t N1, N2, N=0; //number of particles in current event(we prcess two events in one time)
60
61// Int_t nev = fReader->GetNumberOfTrackEvents();
62 static AliHBTPair tpair;
63 static AliHBTPair ppair;
64
65 AliHBTPair* trackpair = &tpair;
66 AliHBTPair* partpair = &ppair;
67
68 AliHBTPair * tmptrackpair;//temprary pointers to pairs
69 AliHBTPair * tmppartpair;
70
71 register UInt_t ii;
72
73
74
75 if ( !partEvent || !trackEvent )
76 {
77 Error("ProcessRecAndSim","<<%s>> Can not get event",GetName());
78 return 1;
79 }
80
81 if ( partEvent->GetNumberOfParticles() != trackEvent->GetNumberOfParticles() )
82 {
83 Error("ProcessRecAndSim",
84 "Number of simulated particles (%d) not equal to number of reconstructed tracks (%d). Skipping Event.",
85 partEvent->GetNumberOfParticles() , trackEvent->GetNumberOfParticles());
86 return 2;
87 }
88
89
90 for (Int_t j = 0; j<partEvent->GetNumberOfParticles() ; j++)
91 {
92 /***************************************/
93 /****** Looping same events ********/
94 /****** filling numerators ********/
95 /***************************************/
96 if ( (j%fDisplayMixingInfo) == 0)
97 Info("ProcessTracksAndParticles",
98 "Mixing particle %d with particles from the same event",j);
99
100 part1= partEvent->GetParticle(j);
101 track1= trackEvent->GetParticle(j);
102
103 Bool_t firstcut = (this->*fkPass1)(part1,track1);
104 if (fBufferSize != 0)
105 if ( (firstcut == kFALSE) || ( (this->*fkPass2)(part1,track1) == kFALSE ) )
106 {
107 //accepted by any cut
108 // we have to copy because reader keeps only one event
109
110 partEvent1->AddParticle(part1);
111 trackEvent1->AddParticle(track1);
112 }
113
114 if (firstcut) continue;
115
116 for(ii = 0; ii<fNParticleMonitorFunctions; ii++)
117 fParticleMonitorFunctions[ii]->Process(part1);
118 for(ii = 0; ii<fNTrackMonitorFunctions; ii++)
119 fTrackMonitorFunctions[ii]->Process(track1);
120 for(ii = 0; ii<fNParticleAndTrackMonitorFunctions; ii++)
121 fParticleAndTrackMonitorFunctions[ii]->Process(track1,part1);
122
123 if (fNoCorrfctns) continue;
124
125 for (Int_t k =j+1; k < partEvent->GetNumberOfParticles() ; k++)
126 {
127 part2= partEvent->GetParticle(k);
128 if (part1->GetUID() == part2->GetUID()) continue;
129 partpair->SetParticles(part1,part2);
130
131 track2= trackEvent->GetParticle(k);
132 trackpair->SetParticles(track1,track2);
133
134 if( (this->*fkPass)(partpair,trackpair) ) //check pair cut
135 { //do not meets crietria of the pair cut, try with swapped pairs
136 if( (this->*fkPass)((AliHBTPair*)partpair->GetSwappedPair(),(AliHBTPair*)trackpair->GetSwappedPair()) )
137 continue; //swaped pairs do not meet criteria of pair cut as well, take next particle
138 else
139 { //swaped pair meets all the criteria
140 tmppartpair = (AliHBTPair*)partpair->GetSwappedPair();
141 tmptrackpair = (AliHBTPair*)trackpair->GetSwappedPair();
142 }
143 }
144 else
145 {//meets criteria of the pair cut
146 tmptrackpair = trackpair;
147 tmppartpair = partpair;
148 }
149
150 for(ii = 0;ii<fNParticleFunctions;ii++)
151 fParticleFunctions[ii]->ProcessSameEventParticles(tmppartpair);
152
153 for(ii = 0;ii<fNTrackFunctions;ii++)
154 fTrackFunctions[ii]->ProcessSameEventParticles(tmptrackpair);
155
156 for(ii = 0;ii<fNParticleAndTrackFunctions;ii++)
157 fParticleAndTrackFunctions[ii]->ProcessSameEventParticles(tmptrackpair,tmppartpair);
158
159
160 /***************************************/
161 /***** Filling denominators *********/
162 /***************************************/
163
164 tmppartpair->MirrorSecond();
165 tmptrackpair->MirrorSecond();
166
167 if((this->*fkPass)(tmppartpair,tmptrackpair) == kFALSE)
168 {
169 for(ii = 0;ii<fNParticleFunctions;ii++)
170 fParticleFunctions[ii]->ProcessDiffEventParticles(tmppartpair);
171
172 for(ii = 0;ii<fNTrackFunctions;ii++)
173 fTrackFunctions[ii]->ProcessDiffEventParticles(tmptrackpair);
174
175 for(ii = 0;ii<fNParticleAndTrackFunctions;ii++)
176 fParticleAndTrackFunctions[ii]->ProcessDiffEventParticles(tmptrackpair,tmppartpair);
177
178 }
179
180 tmppartpair->DeleteSecond();
181 tmptrackpair->DeleteSecond();
182
183 //end of 2nd loop over particles from the same event
184 }//for (Int_t k =j+1; k < partEvent->GetNumberOfParticles() ; k++)
185
186 //end of loop over particles from first event
187 }//for (Int_t j = 0; j<partEvent->GetNumberOfParticles() ; j++)
188 delete fPartBuffer->Push(partEvent1);
189 delete fTrackBuffer->Push(trackEvent1);
190 //end of loop over events
191 return 0;
192}
193/*************************************************************************************/
194
195Int_t AliHBTAnalysisStavinskyMixing::ProcessSim(AliAOD* /*aodrec*/, AliAOD* aodsim)
196{
197 //Does analysis of simulated data
198 AliVAODParticle * part1, * part2;
199
200 AliAOD* partEvent = aodsim;
201 AliAOD* partEvent1 = new AliAOD();
202
203 AliAOD* partEvent2;
204
b74dff53 205
b74dff53 206
207 AliHBTPair * tmppartpair;
208
209 register UInt_t ii;
210
211
212 if ( !partEvent )
213 {
214 Error("ProcessRecAndSim","Can not get event");
215 return 1;
216 }
217
218
219 for (Int_t j = 0; j<partEvent->GetNumberOfParticles() ; j++)
220 {
221 /***************************************/
222 /****** Looping same events ********/
223 /****** filling numerators ********/
224 /***************************************/
225 Warning("ProcessTracksAndParticles","Non-std MIXING");
226 if ( (j%fDisplayMixingInfo) == 0)
227 Info("ProcessTracksAndParticles",
228 "Mixing particle %d with particles from the same event",j);
229
230 part1= partEvent->GetParticle(j);
231
232 Bool_t firstcut = fPairCut->GetFirstPartCut()->Rejected(part1);
233
234 if (fBufferSize != 0)
235 if ( (firstcut == kFALSE) || ( fPairCut->GetSecondPartCut()->Rejected(part1) == kFALSE ) )
236 {
237 //accepted by any cut
238 // we have to copy because reader keeps only one event
239
240 partEvent1->AddParticle(part1);
241 }
242
243 if (firstcut) continue;
244
245 for(ii = 0; ii<fNParticleMonitorFunctions; ii++)
246 fParticleMonitorFunctions[ii]->Process(part1);
247
248 if ( fNParticleFunctions == 0 ) continue;
249
250 for (Int_t k =j+1; k < partEvent->GetNumberOfParticles() ; k++)
251 {
252 part2= partEvent->GetParticle(k);
253 if (part1->GetUID() == part2->GetUID()) continue;
254 partpair->SetParticles(part1,part2);
255
256 if(fPairCut->Rejected(partpair)) //check pair cut
257 { //do not meets crietria of the
258 if( fPairCut->Rejected((AliHBTPair*)partpair->GetSwappedPair()) ) continue;
259 else tmppartpair = (AliHBTPair*)partpair->GetSwappedPair();
260 }
261 else
262 {
263 tmppartpair = partpair;
264 }
265
266 for(ii = 0;ii<fNParticleFunctions;ii++)
267 fParticleFunctions[ii]->ProcessSameEventParticles(tmppartpair);
268
269
270 /***************************************/
271 /***** Filling denominators *********/
272 /***************************************/
273
274 tmppartpair->MirrorSecond();
275
276 if(fPairCut->Rejected(partpair) == kFALSE)
277 {
278 for(ii = 0;ii<fNParticleFunctions;ii++)
279 fParticleFunctions[ii]->ProcessDiffEventParticles(tmppartpair);
280 }
281 tmppartpair->DeleteSecond();
282
283 //end of 2nd loop over particles from the same event
284 }//for (Int_t k =j+1; k < partEvent->GetNumberOfParticles() ; k++)
285
286 }
287 delete fPartBuffer->Push(partEvent1);
288 //end of loop over events
289 return 0;
290}
291/*************************************************************************************/
292Int_t AliHBTAnalysisStavinskyMixing::ProcessRec(AliAOD* aodrec, AliAOD* /*aodsim*/)
293{
294 //Does analysis of reconstructed data
295 AliVAODParticle * track1, * track2;
296
297 AliAOD* trackEvent = aodrec;
298 AliAOD* trackEvent1 = new AliAOD();
299
300 AliAOD* trackEvent2;
301
302 AliHBTPair tpair;
303
304 AliHBTPair* trackpair = &tpair;
305
306 AliHBTPair * tmptrackpair;
307
308 register UInt_t ii;
309
310
311 if ( !trackEvent )
312 {
313 Error("ProcessRecAndSim","Can not get event");
314 return 1;
315 }
316
317
318 for (Int_t j = 0; j<trackEvent->GetNumberOfParticles() ; j++)
319 {
320 /***************************************/
321 /****** Looping same events ********/
322 /****** filling numerators ********/
323 /***************************************/
324 if ( (j%fDisplayMixingInfo) == 0)
325 Info("ProcessTracksAndParticles",
326 "Mixing Particle %d with Particles from the same event",j);
327
328 track1= trackEvent->GetParticle(j);
329
330 Bool_t firstcut = fPairCut->GetFirstPartCut()->Rejected(track1);
331
332 if (fBufferSize != 0)
333 if ( (firstcut == kFALSE) || ( fPairCut->GetSecondPartCut()->Rejected(track1) == kFALSE ) )
334 {
335 //accepted by any cut
336 // we have to copy because reader keeps only one event
337
338 trackEvent1->AddParticle(track1);
339 }
340
341 if (firstcut) continue;
342
343 for(ii = 0; ii<fNParticleMonitorFunctions; ii++)
344 fParticleMonitorFunctions[ii]->Process(track1);
345
346 if ( fNParticleFunctions == 0 ) continue;
347
348 for (Int_t k =j+1; k < trackEvent->GetNumberOfParticles() ; k++)
349 {
350 track2= trackEvent->GetParticle(k);
351 if (track1->GetUID() == track2->GetUID()) continue;
352 trackpair->SetParticles(track1,track2);
353
354 if(fPairCut->Rejected(trackpair)) //check pair cut
355 { //do not meets crietria of the
356 if( fPairCut->Rejected((AliHBTPair*)trackpair->GetSwappedPair()) ) continue;
357 else tmptrackpair = (AliHBTPair*)trackpair->GetSwappedPair();
358 }
359 else
360 {
361 tmptrackpair = trackpair;
362 }
363
364 for(ii = 0;ii<fNTrackFunctions;ii++)
365 fParticleFunctions[ii]->ProcessSameEventParticles(tmptrackpair);
366
367 //end of 2nd loop over Particles from the same event
368 }//for (Int_t k =j+1; k < trackEvent->GetNumberOfParticles() ; k++)
369
370 /***************************************/
371 /***** Filling denominators *********/
372 /***************************************/
373 if (fBufferSize == 0) continue;
374
375 fTrackBuffer->ResetIter();
376 Int_t m = 0;
377 while (( trackEvent2 = fTrackBuffer->Next() ))
378 {
379 m++;
380 if ( (j%fDisplayMixingInfo) == 0)
381 Info("ProcessParticles",
382 "Mixing Particle %d from current event with Particles from event %d",j,-m);
383 for(Int_t l = 0; l<trackEvent2->GetNumberOfParticles();l++) // ... on all Particles
384 {
385
386 track2= trackEvent2->GetParticle(l);
387 trackpair->SetParticles(track1,track2);
388
389 if( fPairCut->Rejected(trackpair) ) //check pair cut
390 { //do not meets crietria of the
391 if( fPairCut->Rejected((AliHBTPair*)trackpair->GetSwappedPair()) )
392 continue;
393 else
394 {
395 tmptrackpair = (AliHBTPair*)trackpair->GetSwappedPair();
396 }
397 }
398 else
399 {//meets criteria of the pair cut
400 tmptrackpair = trackpair;
401 }
402
403 for(ii = 0;ii<fNTrackFunctions;ii++)
404 fTrackFunctions[ii]->ProcessDiffEventParticles(tmptrackpair);
405
406 }//for(Int_t l = 0; l<N2;l++) // ... on all Particles
407 }
408 }
409 delete fTrackBuffer->Push(trackEvent1);
410 //end of loop over events
411 return 0;
412}
413/*************************************************************************************/
414
415Int_t AliHBTAnalysisStavinskyMixing::ProcessRecAndSimNonId(AliAOD* aodrec, AliAOD* aodsim)
416{
417//Analyzes both reconstructed and simulated data
418 if (aodrec == 0x0)
419 {
420 Error("ProcessTracksAndParticlesNonIdentAnal","Reconstructed event is NULL");
421 return 1;
422 }
423
424 if (aodsim == 0x0)
425 {
426 Error("ProcessTracksAndParticlesNonIdentAnal","Simulated event is NULL");
427 return 1;
428 }
429
430 if ( aodrec->GetNumberOfParticles() != aodsim->GetNumberOfParticles() )
431 {
432 Error("ProcessTracksAndParticlesNonIdentAnal",
433 "Number of simulated particles (%d) not equal to number of reconstructed tracks (%d)",
434 aodsim->GetNumberOfParticles() , aodrec->GetNumberOfParticles());
435 return 2;
436 }
437
438
439 AliVAODParticle * part1, * part2;
440 AliVAODParticle * track1, * track2;
441
442 static AliAOD aodrec1;
443 static AliAOD aodsim1;
444
445 AliAOD * trackEvent1=&aodrec1,*partEvent1=&aodsim1;//Particle that passes first particle cut, this event
446 trackEvent1->Reset();
447 partEvent1->Reset();
448 AliAOD * trackEvent2=0x0,*partEvent2=0x0;//Particle that passes second particle cut, this event
449 AliAOD * trackEvent3=0x0,*partEvent3=0x0;//Particle that passes second particle cut, events from buffer
450
451 AliAOD* rawtrackEvent = aodrec;//this we get from Reader
452 AliAOD* rawpartEvent = aodsim;//this we get from Reader
453
454 static AliHBTPair tpair;
455 static AliHBTPair ppair;
456
457 AliHBTPair* trackpair = &tpair;
458 AliHBTPair* partpair = &ppair;
459
460 register UInt_t ii;
461
462 /********************************/
463 /* Filtering out */
464 /********************************/
465 if ( ( (partEvent2==0x0) || (trackEvent2==0x0)) )//in case fBufferSize == 0 and pointers are created do not eneter
466 {
467 partEvent2 = new AliAOD();
468 trackEvent2 = new AliAOD();
469 }
470
471 FilterOut(partEvent1, partEvent2, rawpartEvent, trackEvent1, trackEvent2, rawtrackEvent);
472
473 for (Int_t j = 0; j<partEvent1->GetNumberOfParticles() ; j++)
474 {
475 if ( (j%fDisplayMixingInfo) == 0)
476 Info("ProcessTracksAndParticlesNonIdentAnal",
477 "Mixing particle %d from current event with particles from current event",j);
478
479 part1= partEvent1->GetParticle(j);
480 track1= trackEvent1->GetParticle(j);
481
482
483 for(ii = 0; ii<fNParticleMonitorFunctions; ii++)
484 fParticleMonitorFunctions[ii]->Process(part1);
485 for(ii = 0; ii<fNTrackMonitorFunctions; ii++)
486 fTrackMonitorFunctions[ii]->Process(track1);
487 for(ii = 0; ii<fNParticleAndTrackMonitorFunctions; ii++)
488 fParticleAndTrackMonitorFunctions[ii]->Process(track1,part1);
489
490 if (fNoCorrfctns) continue;
491
492 /***************************************/
493 /****** filling numerators ********/
494 /****** (particles from event2) ********/
495 /***************************************/
496
497 for (Int_t k = 0; k < partEvent2->GetNumberOfParticles() ; k++) //partEvent1 and partEvent2 are particles from the same event but separated to two groups
498 {
499 part2= partEvent2->GetParticle(k);
500 if (part1->GetUID() == part2->GetUID()) continue;//this is the same particle but with different PID
501 partpair->SetParticles(part1,part2);
502
503 track2= trackEvent2->GetParticle(k);
504 trackpair->SetParticles(track1,track2);
505
506 if( (this->*fkPassPairProp)(partpair,trackpair) ) //check pair cut
507 { //do not meets crietria of the pair cut
508 continue;
509 }
510 else
511 {//meets criteria of the pair cut
512 for(ii = 0;ii<fNParticleFunctions;ii++)
513 fParticleFunctions[ii]->ProcessSameEventParticles(partpair);
514
515 for(ii = 0;ii<fNTrackFunctions;ii++)
516 fTrackFunctions[ii]->ProcessSameEventParticles(trackpair);
517
518 for(ii = 0;ii<fNParticleAndTrackFunctions;ii++)
519 fParticleAndTrackFunctions[ii]->ProcessSameEventParticles(trackpair,partpair);
520 }
521 }
522
523 if ( fBufferSize == 0) continue;//do not mix diff histograms
524 /***************************************/
525 /***** Filling denominators *********/
526 /***************************************/
527 fPartBuffer->ResetIter();
528 fTrackBuffer->ResetIter();
529
530 Int_t nmonitor = 0;
531
532 while ( (partEvent3 = fPartBuffer->Next() ) != 0x0)
533 {
534 trackEvent3 = fTrackBuffer->Next();
535
536 if ( (j%fDisplayMixingInfo) == 0)
537 Info("ProcessTracksAndParticlesNonIdentAnal",
538 "Mixing particle %d from current event with particles from event%d",j,-(++nmonitor));
539
540 for (Int_t k = 0; k < partEvent3->GetNumberOfParticles() ; k++)
541 {
542 part2= partEvent3->GetParticle(k);
543 partpair->SetParticles(part1,part2);
544
545 track2= trackEvent3->GetParticle(k);
546 trackpair->SetParticles(track1,track2);
547
548 if( (this->*fkPassPairProp)(partpair,trackpair) ) //check pair cut
549 { //do not meets crietria of the pair cut
550 continue;
551 }
552 else
553 {//meets criteria of the pair cut
554 UInt_t ii;
555 for(ii = 0;ii<fNParticleFunctions;ii++)
556 fParticleFunctions[ii]->ProcessDiffEventParticles(partpair);
557
558 for(ii = 0;ii<fNTrackFunctions;ii++)
559 fTrackFunctions[ii]->ProcessDiffEventParticles(trackpair);
560
561 for(ii = 0;ii<fNParticleAndTrackFunctions;ii++)
562 fParticleAndTrackFunctions[ii]->ProcessDiffEventParticles(trackpair,partpair);
563 }
564 }// for particles event2
565 }//while event2
566 }//for over particles in event1
567
568 delete fPartBuffer->Push(partEvent2);
569 delete fTrackBuffer->Push(trackEvent2);
570
571 return 0;
572}
573/*************************************************************************************/
574Int_t AliHBTAnalysisStavinskyMixing::ProcessSimNonId(AliAOD* /*aodrec*/, AliAOD* aodsim)
575{
576//does analysis of simulated (MC) data in non-identical mode
577//i.e. when particles selected by first part. cut are a disjunctive set than particles
578//passed by the second part. cut
579 if (aodsim == 0x0)
580 {
581 return 1;
582 }
583
584
585 AliVAODParticle * part1, * part2;
586
587 static AliAOD aodsim1;
588
589 AliAOD* partEvent1=&aodsim1;//Particle that passes first particle cut, this event
590 partEvent1->Reset();
591 AliAOD* partEvent2=0x0;//Particle that passes second particle cut, this event
592 AliAOD* partEvent3=0x0;//Particle that passes second particle cut, events from buffer
593
594 AliAOD* rawpartEvent = aodsim;//this we get from Reader
595
596 static AliHBTPair ppair;
597
598 AliHBTPair* partpair = &ppair;
599
600 register UInt_t ii;
601
602 /********************************/
603 /* Filtering out */
604 /********************************/
605 if (partEvent2==0x0)//in case fBufferSize == 0 and pointers are created do not eneter
606 {
607 partEvent2 = new AliAOD();
608 }
609
610 FilterOut(partEvent1, partEvent2, rawpartEvent);
611
612 for (Int_t j = 0; j<partEvent1->GetNumberOfParticles() ; j++)
613 {
614 if ( (j%fDisplayMixingInfo) == 0)
615 Info("ProcessParticlesNonIdentAnal",
616 "Mixing particle %d from current event with particles from current event",j);
617
618 part1= partEvent1->GetParticle(j);
619
620
621 for(ii = 0; ii<fNParticleMonitorFunctions; ii++)
622 fParticleMonitorFunctions[ii]->Process(part1);
623
624 if (fNParticleFunctions == 0) continue;
625
626 /***************************************/
627 /****** filling numerators ********/
628 /****** (particles from event2) ********/
629 /***************************************/
630
631 for (Int_t k = 0; k < partEvent2->GetNumberOfParticles() ; k++) //partEvent1 and partEvent2 are particles from the same event but separated to two groups
632 {
633 part2= partEvent2->GetParticle(k);
634 if (part1->GetUID() == part2->GetUID()) continue;//this is the same particle but with different PID
635 partpair->SetParticles(part1,part2);
636
637
638 if(fPairCut->PassPairProp(partpair) ) //check pair cut
639 { //do not meets crietria of the pair cut
640 continue;
641 }
642 else
643 {//meets criteria of the pair cut
644 for(ii = 0;ii<fNParticleFunctions;ii++)
645 fParticleFunctions[ii]->ProcessSameEventParticles(partpair);
646 }
647 }
648
649 if ( fBufferSize == 0) continue;//do not mix diff histograms
650 /***************************************/
651 /***** Filling denominators *********/
652 /***************************************/
653 fPartBuffer->ResetIter();
654
655 Int_t nmonitor = 0;
656
657 while ( (partEvent3 = fPartBuffer->Next() ) != 0x0)
658 {
659
660 if ( (j%fDisplayMixingInfo) == 0)
661 Info("ProcessParticlesNonIdentAnal",
662 "Mixing particle %d from current event with particles from event%d",j,-(++nmonitor));
663
664 for (Int_t k = 0; k < partEvent3->GetNumberOfParticles() ; k++)
665 {
666 part2= partEvent3->GetParticle(k);
667 partpair->SetParticles(part1,part2);
668
669
670 if(fPairCut->PassPairProp(partpair) ) //check pair cut
671 { //do not meets crietria of the pair cut
672 continue;
673 }
674 else
675 {//meets criteria of the pair cut
676 for(ii = 0;ii<fNParticleFunctions;ii++)
677 {
678 fParticleFunctions[ii]->ProcessDiffEventParticles(partpair);
679 }
680 }
681 }// for particles event2
682 }//while event2
683 }//for over particles in event1
684
685 delete fPartBuffer->Push(partEvent2);
686
687 return 0;
688}
689/*************************************************************************************/
690Int_t AliHBTAnalysisStavinskyMixing::ProcessRecNonId(AliAOD* aodrec, AliAOD* /*aodsim*/)
691{
692//Analyzes both reconstructed and simulated data
693 if (aodrec == 0x0)
694 {
695 return 1;
696 }
697
698 AliVAODParticle * track1, * track2;
699
700 static AliAOD aodrec1;
701 AliAOD * trackEvent1=&aodrec1;//Particle that passes first particle cut, this event
702 trackEvent1->Reset();
703 AliAOD * trackEvent2=0x0;//Particle that passes second particle cut, this event
704 AliAOD * trackEvent3=0x0;//Particle that passes second particle cut, events from buffer
705 AliAOD* rawtrackEvent = aodrec;//this we get from Reader
706
707 static AliHBTPair tpair;
708
709 AliHBTPair* trackpair = &tpair;
710
711 register UInt_t ii;
712
713
714 /********************************/
715 /* Filtering out */
716 /********************************/
717 if ( trackEvent2==0x0 )//in case fBufferSize == 0 and pointers are created do not eneter
718 {
719 trackEvent2 = new AliAOD();
720 }
721
722 FilterOut(trackEvent1, trackEvent2, rawtrackEvent);
723
724 for (Int_t j = 0; j<trackEvent1->GetNumberOfParticles() ; j++)
725 {
726 if ( (j%fDisplayMixingInfo) == 0)
727 Info("ProcessTracksNonIdentAnal",
728 "Mixing particle %d from current event with particles from current event",j);
729
730 track1= trackEvent1->GetParticle(j);
731
732
733 for(ii = 0; ii<fNTrackMonitorFunctions; ii++)
734 fTrackMonitorFunctions[ii]->Process(track1);
735
736 if (fNTrackFunctions == 0x0) continue;
737
738 /***************************************/
739 /****** filling numerators ********/
740 /****** (particles from event2) ********/
741 /***************************************/
742
743 for (Int_t k = 0; k < trackEvent2->GetNumberOfParticles() ; k++) //partEvent1 and partEvent2 are particles from the same event but separated to two groups
744 {
745 track2= trackEvent2->GetParticle(k);
746 if (track1->GetUID() == track2->GetUID()) continue;//this is the same particle but with different PID
747 trackpair->SetParticles(track1,track2);
748
749
750 if( fPairCut->PassPairProp(trackpair)) //check pair cut
751 { //do not meets crietria of the pair cut
752 continue;
753 }
754 else
755 {//meets criteria of the pair cut
756 UInt_t ii;
757 for(ii = 0;ii<fNTrackFunctions;ii++)
758 fTrackFunctions[ii]->ProcessSameEventParticles(trackpair);
759 }
760 }
761
762 if ( fBufferSize == 0) continue;//do not mix diff histograms
763 /***************************************/
764 /***** Filling denominators *********/
765 /***************************************/
766 fTrackBuffer->ResetIter();
767
768 Int_t nmonitor = 0;
769
770 while ( (trackEvent3 = fTrackBuffer->Next() ) != 0x0)
771 {
772 if ( (j%fDisplayMixingInfo) == 0)
773 Info("ProcessTracksNonIdentAnal",
774 "Mixing particle %d from current event with particles from event%d",j,-(++nmonitor));
775
776 for (Int_t k = 0; k < trackEvent3->GetNumberOfParticles() ; k++)
777 {
778 track2= trackEvent3->GetParticle(k);
779 trackpair->SetParticles(track1,track2);
780
781 if( fPairCut->PassPairProp(trackpair)) //check pair cut
782 { //do not meets crietria of the pair cut
783 continue;
784 }
785 else
786 {//meets criteria of the pair cut
787 for(ii = 0;ii<fNTrackFunctions;ii++)
788 fTrackFunctions[ii]->ProcessDiffEventParticles(trackpair);
789 }
790 }// for particles event2
791 }//while event2
792 }//for over particles in event1
793
794 delete fTrackBuffer->Push(trackEvent2);
795
796 return 0;
797}
798/*************************************************************************************/