]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG4/macros/AddTaskJFSystematics.C
Macro to display the output of SDD task in QA-train
[u/mrichter/AliRoot.git] / PWG4 / macros / AddTaskJFSystematics.C
CommitLineData
6b7d2b7e 1AliAnalysisTaskJFSystematics *AddTaskJFSystematics(char *jf1 = "jets",char *jf2 = "jetsAODMC_UA104")\r
76f9015f 2{\r
3\r
4 // Get the pointer to the existing analysis manager via the static access method.\r
5 //==============================================================================\r
6 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();\r
7 if (!mgr) {\r
8 ::Error("AddTaskJFSystematics", "No analysis manager to connect to.");\r
9 return NULL;\r
10 } \r
11 \r
12 // Check the analysis type using the event handlers connected to the analysis manager.\r
13 //==============================================================================\r
14 if (!mgr->GetInputEventHandler()) {\r
15 ::Error("AddTaskJFSystematics", "This task requires an input event handler");\r
16 return NULL;\r
17 }\r
18\r
19 // Create the task and configure it.\r
20 //===========================================================================\r
21 \r
5010a3f7 22 AliAnalysisTaskJFSystematics* pwg4jfs = new AliAnalysisTaskJFSystematics("JF Systematics");\r
76f9015f 23 \r
24 // or a config file\r
25 pwg4jfs->SetAnalysisType(AliAnalysisTaskJFSystematics::kSysJetOrder);\r
26 // if(iAODanalysis)pwg4spec->SetAODInput(kTRUE);\r
5010a3f7 27 // pwg4jfs->SetDebugLevel(11); \r
28 TString type = mgr->GetInputEventHandler()->GetDataType();\r
29 if(type == "AOD"){\r
30 pwg4jfs->SetAODInput(kTRUE);\r
31 }\r
32\r
6b7d2b7e 33 pwg4jfs->SetBranchGen(jf2); \r
34 pwg4jfs->SetBranchRec(jf1); \r
76f9015f 35 mgr->AddTask(pwg4jfs);\r
36 \r
37 // Create ONLY the output containers for the data produced by the task.\r
38 // Get and connect other common input/output containers via the manager as below\r
39 //==============================================================================\r
40 AliAnalysisDataContainer *coutput1_jfs = mgr->CreateContainer(Form("pwg4jfs_%s_%s",jf1,jf2), \r
41 TList::Class(),AliAnalysisManager::kOutputContainer,\r
561a15fa 42 Form("%s:PWG4_jfs_%s_%s",AliAnalysisManager::GetCommonFileName(),jf1,jf2));\r
76f9015f 43\r
44 mgr->ConnectInput (pwg4jfs, 0, mgr->GetCommonInputContainer());\r
45 mgr->ConnectOutput (pwg4jfs, 0, mgr->GetCommonOutputContainer());\r
46 mgr->ConnectOutput (pwg4jfs, 1, coutput1_jfs );\r
47 \r
48 return pwg4jfs;\r
49}\r