]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGUD/mcValidation/runTrackletsTaskOnProof.C
change order of histo and remove one from constructor
[u/mrichter/AliRoot.git] / PWGUD / mcValidation / runTrackletsTaskOnProof.C
CommitLineData
5e03d366 1void Load(const char* taskName, Bool_t debug)
2{
3 TString compileTaskName;
4 compileTaskName.Form("%s.cxx++", taskName);
5 if (debug)
6 compileTaskName += "g";
7
8 if (gProof) {
9 gProof->Load(compileTaskName);
10 } else
11 gROOT->Macro(compileTaskName);
12
13 // Enable debug printouts
14 if (debug)
15 {
16 AliLog::SetClassDebugLevel(taskName, AliLog::kDebug+2);
17 }
18 else
19 AliLog::SetClassDebugLevel(taskName, AliLog::kWarning);
20}
21
22void runTrackletsTaskOnProof(const Char_t* data, Int_t nRuns=20, Int_t offset=0, Bool_t aDebug = kFALSE, Int_t aProof = kFALSE, Bool_t mcFlag = kFALSE)
23{
24 //
25 // aProof option: 0 no proof
26 // 1 proof with chain
27 // 2 proof with dataset
28 //
29
30 if (nRuns < 0)
31 nRuns = 1234567890;
32
33 if (aProof)
34 {
35 gEnv->SetValue("XSec.GSI.DelegProxy","2");
36 TProof::Open("alicecaf");
37 gProof->Exec("TGrid::Connect\(\"alien://\"\), kTRUE");
38
39 // Enable the needed package
40 gProof->UploadPackage("$ALICE_ROOT/STEERBase");
41 gProof->EnablePackage("$ALICE_ROOT/STEERBase");
42 gProof->UploadPackage("$ALICE_ROOT/ESD");
43 gProof->EnablePackage("$ALICE_ROOT/ESD");
44 gProof->UploadPackage("$ALICE_ROOT/AOD");
45 gProof->EnablePackage("$ALICE_ROOT/AOD");
46 gProof->UploadPackage("$ALICE_ROOT/ANALYSIS");
47 gProof->EnablePackage("$ALICE_ROOT/ANALYSIS");
48 gProof->UploadPackage("$ALICE_ROOT/ANALYSISalice");
49 gProof->EnablePackage("$ALICE_ROOT/ANALYSISalice");
50 }
51 else
52 {
53 gSystem->AddIncludePath("-I${ALICE_ROOT}/include/");
54 gSystem->Load("libVMC");
55 gSystem->Load("libTree");
56 gSystem->Load("libProof");
57 gSystem->Load("libSTEERBase");
58 gSystem->Load("libESD");
59 gSystem->Load("libAOD");
60 gSystem->Load("libANALYSIS");
61 gSystem->Load("libANALYSISalice");
62 }
63
64 // Create the analysis manager
65 mgr = new AliAnalysisManager;
66
67 // Add ESD handler
68 AliESDInputHandler* esdH = new AliESDInputHandler;
69 esdH->SetInactiveBranches("AliESDACORDE AliRawDataErrorLogs CaloClusters Cascades EMCALCells EMCALTrigger ESDfriend Kinks Kinks Cascades MuonTracks TrdTracks CaloClusters");
70 mgr->SetInputEventHandler(esdH);
71
72 cInput = mgr->GetCommonInputContainer();
73
74 Load("../AliTrackletsTask", aDebug);
75 task = new AliTrackletsTask();
76 gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPhysicsSelection.C");
77 printf("The flag for the Physics selection is set to %d\n",(Int_t)mcFlag);
78 AliPhysicsSelectionTask* physSelTask = AddTaskPhysicsSelection(mcFlag);
79
80 mgr->AddTask(task);
81
82 // Attach input
83 mgr->ConnectInput(task, 0, cInput);
84
85 // Attach output
86 cOutput = mgr->CreateContainer("cOutput", TList::Class(), AliAnalysisManager::kOutputContainer,"output.root");
87 mgr->ConnectOutput(task, 0, cOutput);
88
89 // Enable debug printouts
90 if (aDebug)
91 mgr->SetDebugLevel(2);
92
93 // graphical settings
94 gROOT->SetStyle("Plain");
95 gStyle->SetPalette(1);
96 gStyle->SetOptStat(111);
97 gStyle->SetPalette(1);
98 gStyle->SetCanvasColor(0);
99 gStyle->SetFrameFillColor(0);
100 gStyle->SetOptTitle(0);
101
102 // Run analysis
103 mgr->InitAnalysis();
104 mgr->PrintStatus();
105
106 if (aProof == 2){
107 // process dataset
108 mgr->StartAnalysis("proof", data, nRuns, offset);
109 }
110 else if (aProof == 3){
111 gROOT->ProcessLine(".L CreateChainFromDataSet.C");
112 ds = gProof->GetDataSet(data)->GetStagedSubset();
113 chain = CreateChainFromDataSet(ds);
114 mgr->StartAnalysis("local", chain, nRuns, offset);
115 }
116 else{
117 // Create chain of input files
118 TGrid::Connect("alien://");
119 gROOT->LoadMacro("../PWG0/CreateESDChain.C");
120 chain = CreateESDChain(data, nRuns, offset,kTRUE);
121 mgr->StartAnalysis((aProof > 0) ? "proof" : "local", chain);
122 }
123}