fInputs(0),
fOutputs(0),
fParamCont(0),
+ fExchangeCont(0),
fDebugOptions(0),
fFileDescriptors(new TObjArray()),
fCurrentDescriptor(0),
fInputs = new TObjArray();
fOutputs = new TObjArray();
fParamCont = new TObjArray();
+ fExchangeCont = new TObjArray();
fGlobals = new TMap();
}
fIOTimer = new TStopwatch();
fInputs(NULL),
fOutputs(NULL),
fParamCont(NULL),
+ fExchangeCont(NULL),
fDebugOptions(NULL),
fFileDescriptors(new TObjArray()),
fCurrentDescriptor(0),
fInputs = new TObjArray(*other.fInputs);
fOutputs = new TObjArray(*other.fOutputs);
fParamCont = new TObjArray(*other.fParamCont);
+ fExchangeCont = new TObjArray(*other.fExchangeCont);
fgCommonFileName = "AnalysisResults.root";
fgAnalysisManager = this;
}
fInputs = new TObjArray(*other.fInputs);
fOutputs = new TObjArray(*other.fOutputs);
fParamCont = new TObjArray(*other.fParamCont);
+ fExchangeCont = new TObjArray(*other.fExchangeCont);
fDebugOptions = NULL;
fFileDescriptors = new TObjArray();
fCurrentDescriptor = 0;
{
// Destructor.
if (fTasks) {fTasks->Delete(); delete fTasks;}
- if (fTopTasks) delete fTopTasks;
- if (fZombies) delete fZombies;
+ delete fTopTasks;
+ delete fZombies;
if (fContainers) {fContainers->Delete(); delete fContainers;}
- if (fInputs) delete fInputs;
- if (fOutputs) delete fOutputs;
- if (fParamCont) delete fParamCont;
- if (fDebugOptions) delete fDebugOptions;
- if (fGridHandler) delete fGridHandler;
- if (fInputEventHandler) delete fInputEventHandler;
- if (fOutputEventHandler) delete fOutputEventHandler;
- if (fMCtruthEventHandler) delete fMCtruthEventHandler;
- if (fEventPool) delete fEventPool;
+ delete fInputs;
+ delete fOutputs;
+ delete fParamCont;
+ delete fExchangeCont;
+ delete fDebugOptions;
+ delete fGridHandler;
+ delete fInputEventHandler;
+ delete fOutputEventHandler;
+ delete fMCtruthEventHandler;
+ delete fEventPool;
if (fgAnalysisManager==this) fgAnalysisManager = NULL;
if (fGlobals) {fGlobals->DeleteAll(); delete fGlobals;}
if (fFileDescriptors) {fFileDescriptors->Delete(); delete fFileDescriptors;}
return;
}
gEnv->SetValue("TFile.AsyncPrefetching",(Int_t)fAsyncReading);
- if (fAsyncReading) gEnv->SetValue("Cache.Directory",Form("file://%s/cache", gSystem->WorkingDirectory()));
- if (fAsyncReading) gEnv->SetValue("TFile.AsyncReading",1);
+// if (fAsyncReading) gEnv->SetValue("Cache.Directory",Form("file://%s/cache", gSystem->WorkingDirectory()));
+// if (fAsyncReading) gEnv->SetValue("TFile.AsyncReading",1);
fTree->SetCacheSize(fCacheSize);
TTreeCache::SetLearnEntries(1); //<<< we can take the decision after 1 entry
if (!fAutoBranchHandling && !fRequestedBranches.IsNull()) {
AliAnalysisTask *task;
// Call CreateOutputObjects for all tasks
Bool_t getsysInfo = ((fNSysInfo>0) && (fMode==kLocalAnalysis))?kTRUE:kFALSE;
+ if (getsysInfo) AliSysInfo::SetVerbose(kTRUE);
Bool_t dirStatus = TH1::AddDirectoryStatus();
Int_t itask = 0;
while ((task=(AliAnalysisTask*)next())) {
TIter next(fTasks);
TStopwatch timer;
Bool_t getsysInfo = ((fNSysInfo>0) && (fMode==kLocalAnalysis))?kTRUE:kFALSE;
+ if (getsysInfo) AliSysInfo::SetVerbose(kTRUE);
// Call Terminate() for tasks
Int_t itask = 0;
while (!IsSkipTerminate() && (task=(AliAnalysisTask*)next())) {
}
break;
case kExchangeContainer:
+ cont->SetExchange(kTRUE);
+ fExchangeCont->Add(cont);
+ cont->SetDataOwned(kFALSE); // data owned by the publisher
break;
}
return cont;
return;
}
Bool_t getsysInfo = ((fNSysInfo>0) && (fMode==kLocalAnalysis))?kTRUE:kFALSE;
- if (getsysInfo)
+ if (getsysInfo) {
+ AliSysInfo::SetVerbose(kTRUE);
Info("PrintStatus", "System information will be collected each %lld events", fNSysInfo);
- TIter next(fTopTasks);
+ }
+ AliAnalysisDataContainer *cont = fCommonInput;
+ if (!cont) cont = (AliAnalysisDataContainer*)fInputs->At(0);
+ printf("=== TOP CONTAINER:\n");
+ cont->PrintContainer(option,0);
+ // Reset "touched" flag
+ TIter next(fContainers);
+ while ((cont = (AliAnalysisDataContainer*)next())) cont->SetTouched(kFALSE);
+ TIter nextt(fTasks);
AliAnalysisTask *task;
- while ((task=(AliAnalysisTask*)next()))
- task->PrintTask(option);
+ while ((task=(AliAnalysisTask*)nextt()))
+ task->SetActive(kFALSE);
if (!fAutoBranchHandling && !fRequestedBranches.IsNull())
printf("Requested input branches:\n%s\n", fRequestedBranches.Data());
void AliAnalysisManager::ResetAnalysis()
{
// Reset all execution flags and clean containers.
- CleanContainers();
+ TIter nextTask(fTasks);
+ AliAnalysisTask *task;
+ while ((task=(AliAnalysisTask*)nextTask())) {
+ // Clean all tasks
+ task->Reset();
+ }
+// CleanContainers();
}
//______________________________________________________________________________
}
Bool_t getsysInfo = ((fNSysInfo>0) && (fMode==kLocalAnalysis))?kTRUE:kFALSE;
- if (getsysInfo) AliSysInfo::AddStamp("Start", 0);
+ if (getsysInfo) {
+ AliSysInfo::SetVerbose(kTRUE);
+ AliSysInfo::AddStamp("Start", 0);
+ }
// Initialize locally all tasks (happens for all modes)
TIter next(fTasks);
AliAnalysisTask *task;
}
fNcalls++;
AliAnalysisTask *task;
+ // Reset the analysis
+ ResetAnalysis();
// Check if the top tree is active.
if (fTree) {
if (getsysInfo && ((fNcalls%fNSysInfo)==0))
AliSysInfo::AddStamp("Handlers_BeginEventGroup",fNcalls, 1002, 0);
TIter next(fTasks);
- // De-activate all tasks
- while ((task=(AliAnalysisTask*)next())) task->SetActive(kFALSE);
+ // De-activate all tasks (not needed anymore after ResetAnalysis
+// while ((task=(AliAnalysisTask*)next())) task->SetActive(kFALSE);
AliAnalysisDataContainer *cont = fCommonInput;
if (!cont) cont = (AliAnalysisDataContainer*)fInputs->At(0);
if (!cont) {
if (cdir) cdir->cd();
return;
}
- cont->SetData(fTree); // This will notify all consumers
+ cont->SetData(fTree); // This set activity for all tasks reading only from the top container
Long64_t entry = fTree->GetTree()->GetReadEntry();
//
// Call BeginEvent() for optional input/output and MC services
TIter next1(fTopTasks);
Int_t itask = 0;
while ((task=(AliAnalysisTask*)next1())) {
+ task->SetActive(kTRUE);
if (fDebug >1) {
cout << " Executing task " << task->GetName() << endl;
}