New task for analysis of jet core (L. Cunqueiro)
[u/mrichter/AliRoot.git] / PWG4 / macros / AddTaskJetCore.C
1
2
3 AliAnalysisTaskJetCore* AddTaskJetCore(const char* bRec1,const char* bRec2, UInt_t filterMask = 272 , Float_t ptTrackMin = 0.15,  Int_t eventClassMin = 0, Int_t eventClassMax = 4){
4
5    Printf("adding task jet core\n");
6
7    AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
8    if(!mgr){
9       ::Error("AddTaskJetCore", "No analysis manager to connect to.");
10       return NULL;
11    }
12    if(!mgr->GetInputEventHandler()){
13       ::Error("AddTaskJetCore", "This task requires an input event handler.");
14       return NULL;
15    }
16
17      
18    //jetsin bRec1 branch have larger radius than those in bRec2  
19
20   TString typeRec(bRec1);
21   TString typeGen(bRec2);
22       
23   AliAnalysisTaskJetCore *task = new AliAnalysisTaskJetCore(Form("JetCore_%s_%s",bRec1,bRec2));
24    
25
26
27    task->SetBranchNames(bRec1,bRec2);
28    task->SetOfflineTrgMask(AliVEvent::kMB);
29
30    task->SetEvtClassMin(eventClassMin);
31    task->SetEvtClassMax(eventClassMax);
32    task->SetCentMin(0.);
33    task->SetCentMax(100.);
34
35  
36    
37    task->SetJetPtMin(0.);   
38    
39    //task->SetRadioFrac(0.2);   //radius of the concentric cone
40                                 //within which you sum up the pT of
41                                 //the tracks to compute the core fraction
42                                 //in method3. It is also the maxium distance
43                                 //between jet axis in method2. Default is 0.2 
44
45    //task->SetMinDist(0.1);     //minimum distance between jets to be 
46                                 //concentric in method1. Default is 0.1
47
48  
49    task->SetBackgroundBranch("jeteventbackground_clustersAOD_KT04_B0_Filter00272_Cut00150_Skip00"); 
50
51    mgr->AddTask(task);
52
53
54    AliAnalysisDataContainer *coutputJetCore = mgr->CreateContainer(Form("pwg4jetcore_%s_%s",bRec1,bRec2), TList::Class(),AliAnalysisManager::kOutputContainer,Form("%s:PWG4_jetcore_%s_%s",AliAnalysisManager::GetCommonFileName(),bRec1,bRec2));
55
56
57
58
59
60    mgr->ConnectInput (task, 0, mgr->GetCommonInputContainer());
61    mgr->ConnectOutput(task, 0, mgr->GetCommonOutputContainer());
62    mgr->ConnectOutput(task, 1, coutputJetCore);
63
64    return task;
65 }