fMustClean(kFALSE),
fIsRemote(kFALSE),
fLocked(kFALSE),
+ fMCLoop(kFALSE),
fDebug(0),
fSpecialOutputLocation(""),
fTasks(0),
fMustClean(other.fMustClean),
fIsRemote(other.fIsRemote),
fLocked(other.fLocked),
+ fMCLoop(other.fMCLoop),
fDebug(other.fDebug),
fSpecialOutputLocation(""),
fTasks(NULL),
fInitOK = other.fInitOK;
fIsRemote = other.fIsRemote;
fLocked = other.fLocked;
+ fMCLoop = other.fMCLoop;
fDebug = other.fDebug;
fTasks = new TObjArray(*other.fTasks);
fTopTasks = new TObjArray(*other.fTopTasks);
if (fAsyncReading) gEnv->SetValue("TFile.AsyncReading",1);
fTree->SetCacheSize(fCacheSize);
TTreeCache::SetLearnEntries(1); //<<< we can take the decision after 1 entry
- fTree->AddBranchToCache("*",kTRUE); //<<< add all branches to the cache
+ if (!fAutoBranchHandling && !fRequestedBranches.IsNull()) {
+ TObjArray *arr = fRequestedBranches.Tokenize(",");
+ TIter next(arr);
+ TObject *obj;
+ while ((obj=next()))
+ fTree->AddBranchToCache(obj->GetName(),kTRUE); //<<< add requested branches to cache
+ delete arr;
+ } else {
+ fTree->AddBranchToCache("*", kTRUE); //<<< add all branches to cache
+ }
if (fDebug) {
Info("CreateReadCache","Read cache enabled %lld bytes with async reading=%d",fCacheSize, (Int_t)fAsyncReading);
}
return;
}
+
+//______________________________________________________________________________
+Bool_t AliAnalysisManager::EventLoop(Long64_t nevents)
+{
+// Initialize an event loop where the data producer is the input handler
+// The handler must implement MakeTree creating the tree of events (likely
+// memory resident) and generate the current event in the method BeginEvent.
+// If the tree is memory resident, the handler should never call TTree::Fill
+// method.
+ cout << "===== RUNNING IN EVENT LOOP MODE: " << GetName() << endl;
+ if (!fInputEventHandler) {
+ Error("EventLoop", "No input handler: exiting");
+ return kFALSE;
+ }
+ TTree *tree = new TTree("DummyTree", "Dummy tree for AliAnalysisManager::EventLoop");
+ SetExternalLoop(kTRUE);
+ if (!Init(tree)) return kFALSE;
+ SlaveBegin(tree);
+ for (Long64_t iev=0; iev<nevents; iev++)
+ ExecAnalysis();
+ TList dummyList;
+ PackOutput(&dummyList);
+ fIsRemote = kTRUE;
+ Terminate();
+ return kTRUE;
+}
//______________________________________________________________________________
Int_t AliAnalysisManager::GetEntry(Long64_t entry, Int_t getall)
if (!fInitOK) return kFALSE;
fTree = tree;
if (fMode != kProofAnalysis) CreateReadCache();
- fTable.Rehash(100);
+ else {
+ // cholm - here we should re-add to the table or branches
+ fTable.Clear();
+ }
AliAnalysisDataContainer *top = fCommonInput;
if (!top) top = (AliAnalysisDataContainer*)fInputs->At(0);
if (!top) {
}
top->SetData(tree);
CheckBranches(kFALSE);
+ fTable.Rehash(100);
if (fDebug > 1) {
printf("<-AliAnalysisManager::Init(%s)\n", tree->GetName());
}
if (fCurrentDescriptor) fCurrentDescriptor->Done();
fCurrentDescriptor = new AliAnalysisFileDescriptor(curfile);
fFileDescriptors->Add(fCurrentDescriptor);
- }
+ }
if (fDebug > 1) printf("->AliAnalysisManager::Notify() file: %s\n", curfile->GetName());
Int_t run = AliAnalysisManager::GetRunFromAlienPath(curfile->GetName());
Error("CheckBranches", "Could not find branch %s",obj->GetName());
continue;
}
+ fTable.Add(br);
}
- fTable.Add(br);
if (load && br->GetReadEntry()!=GetCurrentEntry()) {
br->GetEntry(GetCurrentEntry());
}
}
//______________________________________________________________________________
-Bool_t AliAnalysisManager::IsMacroLoaded(const char filename)
+Bool_t AliAnalysisManager::IsMacroLoaded(const char * filename)
{
// Check if a macro was loaded.
return fgMacroNames.Contains(filename);