2 // Class AliRsnPairManager
4 // A collection of pairs for an analysis.
5 // The function of this collection is just for purposes of well-sorting
6 // the analyzed pairs into upper-level groups, in the case of a wide
7 // analysis containing many resonances at once, or different settings for the same one.
9 // Each PairMgr will result in a separate list of histograms, which
10 // can be seen as a folder in the output file, whose name is given by this object.
12 // author: M. Vala (email: martin.vala@cern.ch)
17 #include "AliRsnPairManager.h"
19 ClassImp(AliRsnPairManager)
21 //_____________________________________________________________________________
22 AliRsnPairManager::AliRsnPairManager(const char*name) :
26 // Default constructor
29 AliDebug(AliLog::kDebug +2, "<-");
30 AliDebug(AliLog::kDebug +2, "->");
33 //_____________________________________________________________________________
34 void AliRsnPairManager::Add(AliRsnPair *pair)
37 // Adds a new AliRsnPair to the list owned by this object.
40 AliDebug(AliLog::kDebug+2, "<-");
43 AliWarning(Form("Pair is %p. Skipping ...", pair));
47 AliDebug(AliLog::kDebug+1, Form("Adding %s [%d entries] ...", pair->GetPairName().Data(), fArray.GetEntries()));
48 fArray.Add((AliRsnPair*)pair);
50 AliDebug(AliLog::kDebug+2, "->");
53 //_____________________________________________________________________________
54 void AliRsnPairManager::Print(Option_t* /*dummy*/) const
57 // Overload of TObject::Print() method.
58 // With respect to the other print method, adds a title string.
61 AliDebug(AliLog::kDebug+2,"<-");
63 AliInfo(Form("\t\t======== Pair Manager %s ========", GetName()));
66 AliDebug(AliLog::kDebug+2,"->");
69 //_____________________________________________________________________________
70 void AliRsnPairManager::PrintArray() const
76 AliDebug(AliLog::kDebug+2,"<-");
79 TObjArrayIter next(&fArray);
80 while ((pair = (AliRsnPair*)next())) pair->Print();
82 AliDebug(AliLog::kDebug+2,"->");
85 //_____________________________________________________________________________
86 TList* AliRsnPairManager::InitAllPairs()
89 // Initialize all pairs, and builds a TList of histograms
90 // which are created by each of them, in order to link it
91 // to the output handler in the AnalysisTasks.
94 AliDebug(AliLog::kDebug+2, "<-");
96 TList *list = new TList();
97 list->SetName(GetName());
100 AliRsnPair *pair = 0;
101 TObjArrayIter next(&fArray);
104 while ((pair = (AliRsnPair*)next())) {
106 AliDebug(AliLog::kDebug+1, Form("InitAllPairs of the PairManager(%s) [%d] ...", pair->GetPairName().Data(), i++));
107 list->Add(pair->GenerateHistograms(GetName()));
110 AliDebug(AliLog::kDebug+2, "->");
114 //_____________________________________________________________________________
115 void AliRsnPairManager::ProcessAllPairs
116 (AliRsnPIDIndex *pidIndexes1, AliRsnEvent *ev1, AliRsnPIDIndex *pidIndexes2, AliRsnEvent *ev2)
119 // Processes one (single-event analysis) or two (event-mixing) events
120 // to fill histograms in all stored pairs.
123 AliDebug(AliLog::kDebug+2, "<-");
125 AliRsnPair *pair = 0;
126 TObjArrayIter next(&fArray);
129 while ((pair = (AliRsnPair*)next())) {
131 AliDebug(AliLog::kDebug+1, Form("ProcessAllPairs of the PairManager(%s) [%d] ...", pair->GetPairName().Data(), i++));
132 pair->LoopPair(pidIndexes1, ev1, pidIndexes2, ev2);
135 AliDebug(AliLog::kDebug+2, "->");