AddTask macro for fast embedding
[u/mrichter/AliRoot.git] / PWG4 / macros / AddTaskFastEmbedding.C
CommitLineData
2cc9dfde 1
2AliAnalysisTaskFastEmbedding* AddTaskFastEmbedding(){
3
4 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
5 if(!mgr){
6 ::Error("AddTaskCentralitySelection", "No analysis manager to connect ot.");
7 return NULL;
8 }
9 if(!mgr->GetInputEventHandler()){
10 ::Error("AddTaskCentralitySelection", "This task requires an input event handler.");
11 return NULL;
12 }
13
14
15 AliAnalysisTaskFastEmbedding *task = new AliAnalysisTaskFastEmbedding("FastEmbedding");
16 // ## set embedding mode ##
17 // kAODFull=0, kAODJetTracks, kAODJet4Mom, kToySingle4Mom
18 task->SetEmbedMode(AliAnalysisTaskFastEmbedding::kToyTracks);
19
20 // ## set ranges for toy ##
21 //SetToyTrackRanges(
22 // Double_t minPt = 50., Double_t maxPt = 50.,
23 // Double_t minEta = -.5, Double_t maxEta = .5,
24 // Double_t minPhi = 0., Double_t maxPhi = 2*TMath::Pi())
25 //task->SetToyNumberOfTrackRange(5,700);
26 //task->SetToyTrackRanges(0.15, 300., 5,-.9, .9, 0., 2*TMath::Pi());
27 task->SetToyTrackRanges();
28 task->SetToyFilterMap((1<<32)-1);
29
30 // ## set event selection for events of the addition AOD ##
31 // kEventsAll=0; kEventsJetPt
32 task->SetEvtSelecMode(AliAnalysisTaskFastEmbedding::kEventsJetPt);
33
34 // ## set jet pT range for event selection ##
35 // SetEvtSelJetPtRange(Float_t minPt, Float_t maxPt)
36 task->SetEvtSelJetPtRange(20.,-1.);
37
38 mgr->AddTask(task);
39
40 // ## create the output containers ##
41 AliAnalysisDataContainer *coutputFastEmbedding = mgr->CreateContainer(
42 "fastembedding", TList::Class(), AliAnalysisManager::kOutputContainer,
43 Form("%s:PWG4_FastEmbedding", AliAnalysisManager::GetCommonFileName()));
44
45 mgr->ConnectInput (task, 0, mgr->GetCommonInputContainer());
46 mgr->ConnectOutput(task, 0, mgr->GetCommonOutputContainer());
47 mgr->ConnectOutput(task, 1, coutputFastEmbedding);
48
49
50 return task;
51
52}
53
54AliAnalysisTaskFastEmbedding* AddTaskFastEmbedding(TObjArray* aodarray){
55
56 AliAnalysisTaskFastEmbedding *task = AddTaskFastEmbedding();
57 if(aodarray){
58 task->SetArrayOfAODPaths(aodarray);
59 task->SetEmbedMode(AliAnalysisTaskFastEmbedding::kAODFull);
60 }
61
62 return task;
63}
64
65
66AliAnalysisTaskFastEmbedding* AddTaskFastEmbedding(const char* filepath){
67
68 AliAnalysisTaskFastEmbedding *task = AddTaskFastEmbedding();
69 if(strlen(filepath)){
70 task->SetAODPath(filepath);
71 task->SetEmbedMode(AliAnalysisTaskFastEmbedding::kAODFull);
72 }
73
74 return task;
75}
76