-
- return returnEvent;
-}
-
-//_____________________________________________________________________________
-void AliRsnPair::LoopPair
-(AliRsnEvent * ev1, TArrayI * a1, AliRsnEvent * ev2, TArrayI * a2)
-{
-//
-// Loop on all pairs of tracks of the defined types/charges,
-// using the arrays of indexes and the events containing them.
-//
-
- if (!a1) {AliDebug(4, "No TArrayI 1 from currentEvent->GetTracksArray(...)"); return;}
- if (!a2) {AliDebug(4, "No TArrayI 2 from currentEvent->GetTracksArray(...)"); return;}
-
- AliRsnDaughter::SetPIDMethod(fTypePID);
- AliRsnDaughter *daughter1 = 0;
- AliRsnDaughter *daughter2 = 0;
- AliRsnFunction *fcn = 0;
- Int_t j, startj = 0;
- for (Int_t i = 0; i < a1->GetSize(); i++)
- {
- // get track #1
- daughter1 = (AliRsnDaughter *) ev1->GetTrack(a1->At(i));
- if (!daughter1) continue;
- // cuts on track #1
- if (!CutPass(daughter1)) continue;
- // get track #2
- daughter2 = 0;
- // check starting index for searching the event:
- // for like-sign pairs we avoid duplicating the pairs
- if (fIsLikeSign) startj = i+1; else startj = 0;
- // AliInfo(Form("%d",startj));
- // loop on event for all track #2 to be combined with the found track #1
- for (j = startj; j < a2->GetSize(); j++)
- {
- daughter2 = (AliRsnDaughter *) ev2->GetTrack(a2->At(j));
- if (!daughter2) continue;
- // cuts on track #2
- if (!CutPass(daughter2)) continue;
- // make pair
- AliRsnPairParticle pairParticle;
- pairParticle.SetPair(daughter1, daughter2);
- // cuts on pair
- if (!CutPass(&pairParticle)) continue;
- // fill all histograms
- TObjArrayIter nextFcn(&fFunctions);
- while ( (fcn = (AliRsnFunction*)nextFcn()) ) {
- fcn->Fill(&pairParticle, fPairDef);
- }
- }
- }
-}
-
-//_____________________________________________________________________________
-TList * AliRsnPair::GenerateHistograms(TString prefix)
-{
-//
-// Generates needed histograms
-//
-
- TList *list = new TList();
- list->SetName(GetPairHistName(0x0).Data());
-
- Char_t hName[255], hTitle[255];
- AliRsnFunction *fcn = 0;
- for (Int_t i=0;i< fFunctions.GetEntries();i++)
- {
- fcn = (AliRsnFunction*)fFunctions.At(i);
- sprintf(hName, "%s_%s", prefix.Data(), GetPairHistName(fcn).Data());
- sprintf(hTitle, "%s", GetPairHistTitle(fcn).Data());
- TList *histos = fcn->Init(hName, hTitle);
- histos->Print();
- list->Add(histos);
- }
-
- return list;
-}
-
-//_____________________________________________________________________________
-void AliRsnPair::GenerateHistograms(TString prefix, TList *tgt)
-{
-//
-// Generates needed histograms
-//
-
- if (!tgt) {
- AliError("NULL target list!");
- return;
- }
-
- Char_t hName[255], hTitle[255];
- AliRsnFunction *fcn = 0;
- for (Int_t i=0;i< fFunctions.GetEntries();i++)