removal of a few debug lines
[u/mrichter/AliRoot.git] / PWG0 / multiplicity / run.C
CommitLineData
a9017e49 1void run(Char_t* data, Int_t nRuns=20, Int_t offset=0, Bool_t aDebug = kFALSE, Bool_t aProof = kFALSE, const char* option = "")
2{
3 if (aProof)
4 {
5 TProof::Open("lxb6046");
6
7 // Enable the needed package
8 gProof->UploadPackage("STEERBase");
9 gProof->EnablePackage("STEERBase");
10 gProof->UploadPackage("ESD");
11 gProof->EnablePackage("ESD");
12 gProof->UploadPackage("AOD");
13 gProof->EnablePackage("AOD");
14 gProof->UploadPackage("ANALYSIS");
15 gProof->EnablePackage("ANALYSIS");
16 gProof->UploadPackage("PWG0base");
17 gProof->EnablePackage("PWG0base");
18
19 //gProof->AddInput(new TNamed("PROOF_Packetizer", "TPacketizer"));
20 }
21 else
22 {
23 gSystem->Load("libVMC");
24 gSystem->Load("libTree");
25 gSystem->Load("libSTEERBase");
26 gSystem->Load("libESD");
27 gSystem->Load("libAOD");
28 gSystem->Load("libANALYSIS");
29 gSystem->Load("libPWG0base");
30 }
31
32 // Create chain of input files
33 gROOT->LoadMacro("../CreateESDChain.C");
34 chain = CreateESDChain(data, nRuns, offset);
35
36 // Create the analysis manager
37 mgr = new AliAnalysisManager("testAnalysis");
38
39 // selection of esd tracks
40 gROOT->ProcessLine(".L CreateCuts.C");
41 AliESDtrackCuts* esdTrackCuts = CreateTrackCuts();
42 if (!esdTrackCuts)
43 {
44 printf("ERROR: esdTrackCuts could not be created\n");
45 return;
46 }
47
48 TString taskName("AliMultiplicityTask.cxx+");
49 if (aDebug)
50 taskName += "+g";
51
52 // Create, add task
53 if (aProof) {
54 gProof->Load(taskName);
55 } else
56 gROOT->Macro(taskName);
57
58 task = new AliMultiplicityTask;
59 task->SetTrackCuts(esdTrackCuts);
60 mgr->AddTask(task);
61
62 // Enable MC event handler
63 AliMCEventHandler* handler = new AliMCEventHandler;
64 handler->SetReadTR(kFALSE);
d659ac74 65 mgr->SetMCtruthEventHandler(handler);
a9017e49 66
67 // Add ESD handler
68 AliESDInputHandler* esdH = new AliESDInputHandler;
69 mgr->SetInputEventHandler(esdH);
70
71 // Attach input
72 cInput = mgr->CreateContainer("cInput", TChain::Class(), AliAnalysisManager::kInputContainer);
73 mgr->ConnectInput(task, 0, cInput);
74
75 // Attach output
76 cOutput = mgr->CreateContainer("cOutput", TList::Class(), AliAnalysisManager::kOutputContainer);
77 //cOutput->SetDataOwned(kTRUE);
78 mgr->ConnectOutput(task, 0, cOutput);
79
80 // Enable debug printouts
81 if (aDebug)
82 mgr->SetDebugLevel(2);
83
84 // Run analysis
85 mgr->InitAnalysis();
86 mgr->PrintStatus();
87 mgr->StartAnalysis((aProof) ? "proof" : "local", chain);
88}