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)
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::Print(Option_t* /*dummy*/) const
59 // Overload of TObject::Print() method.
60 // With respect to the other print method, adds a title string.
63 AliDebug(AliLog::kDebug+2,"<-");
65 AliInfo(Form("\t\t======== Pair Manager %s ========", GetName()));
68 AliDebug(AliLog::kDebug+2,"->");
71 //_____________________________________________________________________________
72 void AliRsnPairManager::PrintArray() const
78 AliDebug(AliLog::kDebug+2,"<-");
81 TObjArrayIter next(&fArray);
82 while ((pair = (AliRsnPair*)next())) pair->Print();
84 AliDebug(AliLog::kDebug+2,"->");
87 //_____________________________________________________________________________
88 TList* AliRsnPairManager::InitAllPairs()
91 // Initialize all pairs, and builds a TList of histograms
92 // which are created by each of them, in order to link it
93 // to the output handler in the AnalysisTasks.
96 AliDebug(AliLog::kDebug+2, "<-");
98 TList *list = new TList();
99 list->SetName(GetName());
102 AliRsnPair *pair = 0;
103 TObjArrayIter next(&fArray);
106 while ((pair = (AliRsnPair*)next())) {
108 AliDebug(AliLog::kDebug+1, Form("InitAllPairs of the PairManager(%s) [%d] ...", pair->GetPairName().Data(), i++));
109 list->Add(pair->GenerateHistograms(GetName()));
112 AliDebug(AliLog::kDebug+2, "->");
116 //_____________________________________________________________________________
117 void AliRsnPairManager::ProcessAllPairs
118 (AliRsnPIDIndex *pidIndexes1, AliRsnEvent *ev1, AliRsnPIDIndex *pidIndexes2, AliRsnEvent *ev2)
121 // Processes one (single-event analysis) or two (event-mixing) events
122 // to fill histograms in all stored pairs.
125 AliDebug(AliLog::kDebug+2, "<-");
127 AliRsnPair *pair = 0;
128 TObjArrayIter next(&fArray);
131 while ((pair = (AliRsnPair*)next())) {
133 AliDebug(AliLog::kDebug+1, Form("ProcessAllPairs of the PairManager(%s) [%d] ...", pair->GetPairName().Data(), i++));
134 pair->LoopPair(pidIndexes1, ev1, pidIndexes2, ev2);
137 AliDebug(AliLog::kDebug+2, "->");