// // Class AliRsnAnalysisManager // // This is the uppermost level of analysis objects collection. // It contains a list of pair managers, which all will process // a pool of events passed to this object, and fill their histograms. // // The utility of this object is to define a unique implementation // of the whole processing, which can then be included in the different // designs of AnalysisTask provided for SE and ME analysis. // // The base architecture is still AliRsnVManager, but in this case // all the objects in the list will be AliRsnPairManager's. // // author : M. Vala [martin.vala@cern.ch] // revised by : A. Pulvirenti [alberto.pulvirenti@ct.infn.it] // #include #include "AliLog.h" #include "AliRsnPIDIndex.h" #include "AliRsnEvent.h" #include "AliRsnPairManager.h" #include "AliRsnPair.h" #include "AliRsnAnalysisManager.h" ClassImp(AliRsnAnalysisManager) //_____________________________________________________________________________ AliRsnAnalysisManager::AliRsnAnalysisManager(const char*name) : AliRsnVManager(name) { // // Default constructor // AliDebug(AliLog::kDebug+2, "<-"); AliDebug(AliLog::kDebug+2, "->"); } //_____________________________________________________________________________ //void AliRsnAnalysisManager::Add(AliRsnPairManager *pair) void AliRsnAnalysisManager::Add(TObject *objPairMgr) { // // Adds a new pair manager to the list. // AliDebug(AliLog::kDebug+2,"<-"); AliRsnPairManager *pair = dynamic_cast(objPairMgr); if (!pair) { AliWarning(Form("AliRsnPairManager is %p. Skipping ...", pair)); return; } AliDebug(AliLog::kDebug+1, Form("Adding %s [%d]...", pair->GetName(), fArray.GetEntries())); fArray.Add((AliRsnPairManager*)pair); AliDebug(AliLog::kDebug+2,"->"); } //_____________________________________________________________________________ void AliRsnAnalysisManager::Print(Option_t* /*dummy*/) const { // // Overload of the TObject::Print() method // AliInfo(Form("\t======== Analysis Manager %s ========", GetName())); PrintArray(); } //_____________________________________________________________________________ void AliRsnAnalysisManager::PrintArray() const { // // Calls the "Print" method of all included pair managers // AliDebug(AliLog::kDebug+2,"<-"); AliRsnPairManager *mgr = 0; TObjArrayIter next(&fArray); while ((mgr = (AliRsnPairManager*)next())) mgr->Print(); AliDebug(AliLog::kDebug+2,"->"); } //_____________________________________________________________________________ void AliRsnAnalysisManager::InitAllPairMgrs(TList *list) { // // Initialize all pair managers, and put all the TList of histograms // generated by each one into a unique final output TList // AliDebug(AliLog::kDebug+2,"<-"); // TList *list = new TList(); // list->SetName(GetName()); // list->SetOwner(); AliRsnPairManager *pairMgr = 0; TObjArrayIter next(&fArray); Int_t i = 0; while ((pairMgr = (AliRsnPairManager*)next())) { AliDebug(AliLog::kDebug+1, Form("InitAllPairs of the AnalysisManager(%s) [%d] ...", pairMgr->GetName(), i++)); // list->Add(); pairMgr->InitAllPairs(list); } AliDebug(AliLog::kDebug+2, "->"); // return list; } //_____________________________________________________________________________ void AliRsnAnalysisManager::ProcessAllPairMgrs (AliRsnPIDIndex *pidIndexes1, AliRsnEvent *ev1, AliRsnPIDIndex *pidIndexes2, AliRsnEvent *ev2) { // // Process one or two events for all pair managers. // AliDebug(AliLog::kDebug+2,"<-"); AliRsnPairManager *pairMgr = 0; TObjArrayIter next(&fArray); Int_t i = 0; while ((pairMgr = (AliRsnPairManager*)next())) { AliDebug(AliLog::kDebug+1, Form("ProcessAllPairMgrs of the AnalysisManager(%s) [%d] ...", pairMgr->GetName(), i++)); pairMgr->ProcessAllPairs(pidIndexes1, ev1, pidIndexes2, ev2); } AliDebug(AliLog::kDebug+2,"->"); } //_____________________________________________________________________________ void AliRsnAnalysisManager::AddConfig (TString config,TString prefix,TString functionName) { // // Adds a new AliRsnPair generated according to a configuration macro // which is called interactively and executed from a ROOT session // AliDebug(AliLog::kDebug+2,"<-"); gROOT->LoadMacro(config.Data()); config.ReplaceAll(".C",""); prefix.ReplaceAll("_","-"); if (!functionName.IsNull()) config = functionName; AliRsnPairManager *pairMgr = (AliRsnPairManager*)gROOT->ProcessLine(Form("%s(\"%s\");", config.Data(), prefix.Data())); Add(pairMgr); AliDebug(AliLog::kDebug+2,"->"); }