Changes to fast embedding and jetresponse: QA plot for delta AOD, Jet eta phi selecti...
[u/mrichter/AliRoot.git] / PWG4 / macros / AddTaskJetResponse.C
CommitLineData
46465e39 1AliAnalysisTaskJetResponse* AddTaskJetResponse(Char_t* type = "clusters", Char_t* jf = "FASTKT", Float_t radius = 0.4, UInt_t filterMask = 256 , Float_t ptTrackMin = 0.15, Int_t iBack = 1, Int_t eventClassMin = 1, Int_t eventClassMax = 4){
2a436fa1 2
3 Printf("adding task jet response\n");
4
5 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
6 if(!mgr){
46465e39 7 ::Error("AddTaskJetResponse", "No analysis manager to connect to.");
2a436fa1 8 return NULL;
9 }
10 if(!mgr->GetInputEventHandler()){
11 ::Error("AddTaskJetResponse", "This task requires an input event handler.");
12 return NULL;
13 }
14
1a2bb6d5 15 TString suffix = "";
16 suffix += Form("_%s", jf);
17 suffix += Form("%02d", (int)((radius+0.01)*10.));
18 suffix += Form("_B0"); // no background subtraction for extra-only
19 suffix += Form("_Filter%05d", filterMask);
20 suffix += Form("_Cut%05d", (int)((1000.*ptTrackMin)));
21 if(type=="clusters") suffix += Form("_Skip00");
22
23 TString suffix2 = "";
24 suffix2 += Form("_%s", jf);
25 suffix2 += Form("%02d", (int)((radius+0.01)*10.));
26 suffix2 += Form("_B%d", iBack);
27 suffix2 += Form("_Filter%05d", filterMask);
28 suffix2 += Form("_Cut%05d", (int)((1000.*ptTrackMin)));
29 if(type=="clusters") suffix2 += Form("_Skip00");
30
31 AliAnalysisTaskJetResponse *task = new AliAnalysisTaskJetResponse(Form("JetResponse%s", suffix2.Data()));
32
33 TString branch1 = Form("%sAODextraonly%s",type, suffix.Data());
2a436fa1 34 Printf("Branch1: %s",branch1.Data());
35
1a2bb6d5 36 TString branch2 = Form("%sAODextra%s",type, suffix2.Data());
2a436fa1 37 Printf("Branch2: %s",branch2.Data());
38
39 task->SetBranchNames(branch1,branch2);
1a2bb6d5 40 task->SetOfflineTrgMask(AliVEvent::kMB);
2a436fa1 41
42 task->SetEvtClassMin(eventClassMin);
43 task->SetEvtClassMax(eventClassMax);
44 task->SetCentMin(0.);
45 task->SetCentMax(100.);
46465e39 46 //task->SetJetDeltaEta(0.2);
47 //task->SetJetDeltaPhi(0.2);
2a436fa1 48
49
50 mgr->AddTask(task);
51
52 AliAnalysisDataContainer *coutputJetResponse = mgr->CreateContainer(
1a2bb6d5 53 Form("jetresponse_%s%s", type,suffix2.Data()), TList::Class(), AliAnalysisManager::kOutputContainer,
54 Form("%s:PWG4_JetResponse_%s%s", AliAnalysisManager::GetCommonFileName(), type, suffix2.Data()));
2a436fa1 55
56 mgr->ConnectInput (task, 0, mgr->GetCommonInputContainer());
57 mgr->ConnectOutput(task, 0, mgr->GetCommonOutputContainer());
58 mgr->ConnectOutput(task, 1, coutputJetResponse);
59
60 return task;
61}