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)
16 #include "AliRsnPair.h"
18 #include "AliRsnPairManager.h"
20 ClassImp(AliRsnPairManager)
22 //_____________________________________________________________________________
23 AliRsnPairManager::AliRsnPairManager(const char*name) :
27 // Default constructor
30 AliDebug(AliLog::kDebug +2, "<-");
31 AliDebug(AliLog::kDebug +2, "->");
34 //_____________________________________________________________________________
35 void AliRsnPairManager::Add(TObject* objPair)
38 // Adds a new AliRsnPair to the list owned by this object.
41 AliDebug(AliLog::kDebug+2, "<-");
42 AliRsnPair *pair = dynamic_cast<AliRsnPair*>(objPair);
45 AliWarning(Form("Pair is %p. Skipping ...", pair));
49 AliDebug(AliLog::kDebug+1, Form("Adding %s [%d entries] ...", pair->GetPairName().Data(), fArray.GetEntries()));
50 fArray.Add((AliRsnPair*)pair);
52 AliDebug(AliLog::kDebug+2, "->");
55 //_____________________________________________________________________________
56 void AliRsnPairManager::AddPair(AliRsnPair* pair)
59 // Adds a new AliRsnPair to the list owned by this object.
66 //_____________________________________________________________________________
67 void AliRsnPairManager::Print(Option_t* /*dummy*/) const
70 // Overload of TObject::Print() method.
71 // With respect to the other print method, adds a title string.
74 AliDebug(AliLog::kDebug+2,"<-");
76 AliInfo(Form("\t\t======== Pair Manager %s ========", GetName()));
79 AliDebug(AliLog::kDebug+2,"->");
82 //_____________________________________________________________________________
83 void AliRsnPairManager::PrintArray() const
89 AliDebug(AliLog::kDebug+2,"<-");
92 TObjArrayIter next(&fArray);
93 while ((pair = (AliRsnPair*)next())) pair->Print();
95 AliDebug(AliLog::kDebug+2,"->");
98 //_____________________________________________________________________________
99 void AliRsnPairManager::InitAllPairs(TList* list)
102 // Initialize all pairs, and builds a TList of histograms
103 // which are created by each of them, in order to link it
104 // to the output handler in the AnalysisTasks.
107 AliDebug(AliLog::kDebug+2, "<-");
109 // TList *list = new TList();
110 // list->SetName(GetName());
113 AliRsnPair *pair = 0;
114 TObjArrayIter next(&fArray);
117 while ((pair = (AliRsnPair*)next())) {
119 AliDebug(AliLog::kDebug+1, Form("InitAllPairs of the PairManager(%s) [%d] ...", pair->GetPairName().Data(), i++));
120 pair->GenerateHistograms(GetName(),list);
123 AliDebug(AliLog::kDebug+2, "->");
127 //_____________________________________________________________________________
128 void AliRsnPairManager::ProcessAllPairs
129 (AliRsnPIDIndex *pidIndexes1, AliRsnEvent *ev1, AliRsnPIDIndex *pidIndexes2, AliRsnEvent *ev2)
132 // Processes one (single-event analysis) or two (event-mixing) events
133 // to fill histograms in all stored pairs.
136 AliDebug(AliLog::kDebug+2, "<-");
138 AliRsnPair *pair = 0;
139 TObjArrayIter next(&fArray);
142 while ((pair = (AliRsnPair*)next())) {
144 AliDebug(AliLog::kDebug+1, Form("ProcessAllPairs of the PairManager(%s) [%d] ...", pair->GetPairName().Data(), i++));
145 pair->LoopPair(pidIndexes1, ev1, pidIndexes2, ev2);
148 AliDebug(AliLog::kDebug+2, "->");