Undoing some unwanted method renames
[u/mrichter/AliRoot.git] / PWGJE / macros / AddTaskJetsTriggerTRD.C
CommitLineData
d08c45ea 1AliAnalysisTaskJetsTriggerTRD* AddTaskJetsTriggerTRD(const char *name = "jets_trg_trd", const char *jetBranchName = "")
2{
3 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
4 if(!mgr){
907b997b 5 ::Error("AddTaskJetsTriggerTRD", "No analysis manager to connect to.");
d08c45ea 6 return NULL;
7 }
8 if(!mgr->GetInputEventHandler()){
907b997b 9 ::Error("AddTaskJetsTriggerTRD", "This task requires an input event handler.");
d08c45ea 10 return NULL;
11 }
12
907b997b 13 Bool_t isMC = (mgr->GetMCtruthEventHandler() != 0x0);
14 TString inputDataType = mgr->GetInputEventHandler()->GetDataType();
15
d08c45ea 16 AliAnalysisTaskJetsTriggerTRD *task = new AliAnalysisTaskJetsTriggerTRD(name);
17
907b997b 18 // if no jet branch is specified, set default values depending on data type
d08c45ea 19 if (strlen(jetBranchName) > 0) {
20 task->SetJetBranchName(jetBranchName);
21 }
22 else {
907b997b 23 // for ESDs (MC and real) we use a preceding jet finder
24 if (isMC) {
25 task->SetJetBranchName("clustersAODMC_ANTIKT04_B0_Filter00272_Cut00150_Skip00");
26 }
27 else if (inputDataType.Contains("ESD")) {
d08c45ea 28 task->SetJetBranchName("clustersAOD_ANTIKT04_B0_Filter00272_Cut00150_Skip00");
29 }
907b997b 30 // for AODs we use an existing jet branch
d08c45ea 31 else if (inputDataType.Contains("AOD")) {
907b997b 32 task->SetJetBranchName("clustersAOD_ANTIKT02_B0_Filter00272_Cut00150_Skip00");
d08c45ea 33 }
34 else {
35 printf("unknown input data type\n");
36 }
37 }
38
39 mgr->AddTask(task);
40
41 AliAnalysisDataContainer *coutput =
e7808ddf 42 mgr->CreateContainer(Form("hist_%s", name), TList::Class(), AliAnalysisManager::kOutputContainer,
43 Form("%s:PWGJE_jets_trg_trd", AliAnalysisManager::GetCommonFileName()));
d08c45ea 44
45 mgr->ConnectInput (task, 0, mgr->GetCommonInputContainer());
907b997b 46 if (mgr->GetCommonOutputContainer())
47 mgr->ConnectOutput(task, 0, mgr->GetCommonOutputContainer());
d08c45ea 48 mgr->ConnectOutput(task, 1, coutput);
49
50 return task;
51}