2 // Class AliRsnAnalysisManager
4 // This is the uppermost level of analysis objects collection.
5 // It contains a list of pair managers, which all will process
6 // a pool of events passed to this object, and fill their histograms.
8 // The utility of this object is to define a unique implementation
9 // of the whole processing, which can then be included in the different
10 // designs of AnalysisTask provided for SE and ME analysis.
12 // The base architecture is still AliRsnVManager, but in this case
13 // all the objects in the list will be AliRsnPairManager's.
15 // author : M. Vala [martin.vala@cern.ch]
16 // revised by : A. Pulvirenti [alberto.pulvirenti@ct.infn.it]
21 #include "AliRsnAnalysisManager.h"
23 ClassImp(AliRsnAnalysisManager)
25 //_____________________________________________________________________________
26 AliRsnAnalysisManager::AliRsnAnalysisManager(const char*name) :
30 // Default constructor
33 AliDebug(AliLog::kDebug+2, "<-");
34 AliDebug(AliLog::kDebug+2, "->");
37 //_____________________________________________________________________________
38 //void AliRsnAnalysisManager::Add(AliRsnPairManager *pair)
39 void AliRsnAnalysisManager::Add(TObject *objPairMgr)
42 // Adds a new pair manager to the list.
45 AliDebug(AliLog::kDebug+2,"<-");
46 AliRsnPairManager *pair = dynamic_cast<AliRsnPairManager*>(objPairMgr);
49 AliWarning(Form("AliRsnPairManager is %p. Skipping ...", pair));
53 AliDebug(AliLog::kDebug+1, Form("Adding %s [%d]...", pair->GetName(), fArray.GetEntries()));
54 fArray.Add((AliRsnPairManager*)pair);
56 AliDebug(AliLog::kDebug+2,"->");
59 //_____________________________________________________________________________
60 void AliRsnAnalysisManager::Print(Option_t* /*dummy*/) const
63 // Overload of the TObject::Print() method
66 AliInfo(Form("\t======== Analysis Manager %s ========", GetName()));
70 //_____________________________________________________________________________
71 void AliRsnAnalysisManager::PrintArray() const
74 // Calls the "Print" method of all included pair managers
77 AliDebug(AliLog::kDebug+2,"<-");
79 AliRsnPairManager *mgr = 0;
80 TObjArrayIter next(&fArray);
81 while ((mgr = (AliRsnPairManager*)next())) mgr->Print();
83 AliDebug(AliLog::kDebug+2,"->");
86 //_____________________________________________________________________________
87 TList* AliRsnAnalysisManager::InitAllPairMgrs()
90 // Initialize all pair managers, and put all the TList of histograms
91 // generated by each one into a unique final output TList
94 AliDebug(AliLog::kDebug+2,"<-");
96 TList *list = new TList();
97 list->SetName(GetName());
100 AliRsnPairManager *pairMgr = 0;
101 TObjArrayIter next(&fArray);
103 while ((pairMgr = (AliRsnPairManager*)next())) {
104 AliDebug(AliLog::kDebug+1, Form("InitAllPairs of the AnalysisManager(%s) [%d] ...", pairMgr->GetName(), i++));
105 list->Add(pairMgr->InitAllPairs());
107 AliDebug(AliLog::kDebug+2, "->");
111 //_____________________________________________________________________________
112 void AliRsnAnalysisManager::ProcessAllPairMgrs
113 (AliRsnPIDIndex *pidIndexes1, AliRsnEvent *ev1, AliRsnPIDIndex *pidIndexes2, AliRsnEvent *ev2)
116 // Process one or two events for all pair managers.
119 AliDebug(AliLog::kDebug+2,"<-");
121 AliRsnPairManager *pairMgr = 0;
122 TObjArrayIter next(&fArray);
125 while ((pairMgr = (AliRsnPairManager*)next())) {
126 AliDebug(AliLog::kDebug+1, Form("ProcessAllPairMgrs of the AnalysisManager(%s) [%d] ...", pairMgr->GetName(), i++));
127 pairMgr->ProcessAllPairs(pidIndexes1, ev1, pidIndexes2, ev2);
130 AliDebug(AliLog::kDebug+2,"->");
133 //_____________________________________________________________________________
134 void AliRsnAnalysisManager::AddConfig
135 (TString config,TString prefix,TString functionName)
138 // Adds a new AliRsnPair generated according to a configuration macro
139 // which is called interactively and executed from a ROOT session
142 AliDebug(AliLog::kDebug+2,"<-");
144 gROOT->LoadMacro(config.Data());
146 config.ReplaceAll(".C","");
147 prefix.ReplaceAll("_","-");
149 if (!functionName.IsNull()) config = functionName;
151 AliRsnPairManager *pairMgr = (AliRsnPairManager*)gROOT->ProcessLine(Form("%s(\"%s\");", config.Data(), prefix.Data()));
154 AliDebug(AliLog::kDebug+2,"->");