ROOT logo
// run.C
//
// Template run macro for producer/consumer tasks
//
// Author: Andrei Gheata
//
void CreateAlienHandler();

//______________________________________________________________________________
void runEx02()
{
    // load libraries
    gSystem->Load("libCore.so");        
    gSystem->Load("libGeom.so");
    gSystem->Load("libVMC.so");
    gSystem->Load("libPhysics.so");
    gSystem->Load("libTree.so");
    gSystem->Load("libSTEERBase.so");
    gSystem->Load("libESD.so");
    gSystem->Load("libAOD.so");
    gSystem->Load("libANALYSIS.so");
    gSystem->Load("libOADB.so");
    gSystem->Load("libANALYSISalice.so");
  
    // add aliroot indlude path
    gROOT->ProcessLine(Form(".include %s/include",gSystem->ExpandPathName("$ALICE_ROOT")));
    gROOT->SetStyle("Plain");
        
    // analysis manager
    AliAnalysisManager* mgr = new AliAnalysisManager("example for using producer/consumer tasks");
    mgr->SetCommonFileName("output.root");

    // create the alien handler and attach it to the manager
    AliAnalysisGrid *plugin = CreateAlienHandler(); 
    mgr->SetGridHandler(plugin);
    
    // create the alien handler and attach it to the manager
    
    AliVEventHandler* iH = new AliESDInputHandler();
    mgr->SetInputEventHandler(iH);        
                
    // create 2 producer tasks
    gROOT->LoadMacro("TaskExchange.cxx+g");
    gROOT->LoadMacro("AddTaskProducer.C");
    TaskProducer *prod1 = AddTaskProducer("producer1");
    TaskProducer *prod2 = AddTaskProducer("producer2");
    if (!prod1 || !prod2) return;
    
    // Create 1 consumer task
    gROOT->LoadMacro("AddTaskConsumer.C");
    TaskConsumer *task = AddTaskConsumer("consumer", "producer1", "producer2");
        
    // enable debug printouts
    mgr->SetDebugLevel(2);
    if (!mgr->InitAnalysis()) return;
    mgr->PrintStatus();
  
    // start analysis
    Printf("Starting analysis example for producer/consumers...");
    mgr->StartAnalysis("local",3);
}

//______________________________________________________________________________
AliAnalysisGrid* CreateAlienHandler()
{
    AliAnalysisAlien *plugin = new AliAnalysisAlien();
    // Set the run mode (can be "full", "test", "offline", "submit" or "terminate")
    plugin->SetRunMode("test");
    // Plugin test mode works only providing a file containing test file locations, used in "local" mode also
    plugin->SetFileForTestMode("files.txt"); // file should contain path name to a local directory containg *ESDs.root etc
    return plugin;
}
 runEx02.C:1
 runEx02.C:2
 runEx02.C:3
 runEx02.C:4
 runEx02.C:5
 runEx02.C:6
 runEx02.C:7
 runEx02.C:8
 runEx02.C:9
 runEx02.C:10
 runEx02.C:11
 runEx02.C:12
 runEx02.C:13
 runEx02.C:14
 runEx02.C:15
 runEx02.C:16
 runEx02.C:17
 runEx02.C:18
 runEx02.C:19
 runEx02.C:20
 runEx02.C:21
 runEx02.C:22
 runEx02.C:23
 runEx02.C:24
 runEx02.C:25
 runEx02.C:26
 runEx02.C:27
 runEx02.C:28
 runEx02.C:29
 runEx02.C:30
 runEx02.C:31
 runEx02.C:32
 runEx02.C:33
 runEx02.C:34
 runEx02.C:35
 runEx02.C:36
 runEx02.C:37
 runEx02.C:38
 runEx02.C:39
 runEx02.C:40
 runEx02.C:41
 runEx02.C:42
 runEx02.C:43
 runEx02.C:44
 runEx02.C:45
 runEx02.C:46
 runEx02.C:47
 runEx02.C:48
 runEx02.C:49
 runEx02.C:50
 runEx02.C:51
 runEx02.C:52
 runEx02.C:53
 runEx02.C:54
 runEx02.C:55
 runEx02.C:56
 runEx02.C:57
 runEx02.C:58
 runEx02.C:59
 runEx02.C:60
 runEx02.C:61
 runEx02.C:62
 runEx02.C:63
 runEx02.C:64
 runEx02.C:65
 runEx02.C:66
 runEx02.C:67
 runEx02.C:68
 runEx02.C:69
 runEx02.C:70
 runEx02.C:71
 runEx02.C:72
 runEx02.C:73