+
+//______________________________________________________________________________
+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;
+}