updated to addtask macro
[u/mrichter/AliRoot.git] / PWGJE / macros / AddTaskCheckSingleTrackJetRejection.C
CommitLineData
635693ee 1AliAnalysisTaskCheckSingleTrackJetRejection *AddTaskCheckSingleTrackJetRejection(char *jf="ANTIKT",Float_t radius=0.4,UInt_t filter=256,Int_t backM=0,Float_t tPtcut=0.15,Int_t skipCone=0,Bool_t IsMC=true)\r
2{\r
3\r
4 // Creates a JetQA task, configures it and adds it to the analysis manager.\r
5 // Get the pointer to the existing analysis manager via the static access method.\r
6 //==============================================================================\r
7 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();\r
8 if (!mgr) {\r
9 ::Error("AddTaskCheckSingleTrackJetRejection", "No analysis manager to connect to.");\r
10 return NULL;\r
11 }\r
12\r
13 // Check the analysis type using the event handlers connected to the analysis manager.\r
14 //==============================================================================\r
15 if (!mgr->GetInputEventHandler()) {\r
16 ::Error("AddTaskCheckSingleTrackJetRejection", "This task requires an input event handler");\r
17 return NULL;\r
18 }\r
19\r
20 // Create the task and configure it.\r
21 //===========================================================================\r
22\r
23 AliAnalysisTaskCheckSingleTrackJetRejection *jetqamcana = new AliAnalysisTaskCheckSingleTrackJetRejection("TaskCheckSingleTrackJetRejection");\r
24 jetqamcana->SetDebugLevel(0);\r
25 jetqamcana->SetAlgorithm(jf);\r
26 jetqamcana->SetRadius(radius);\r
27 jetqamcana->SetFilterMask(filter);\r
28 jetqamcana->SetBackSubMode(backM);\r
29 jetqamcana->SetTrackPtCut(tPtcut);\r
30 jetqamcana->SetSkipCone(skipCone);\r
31 jetqamcana->SetMC(IsMC);\r
32 mgr->AddTask(jetqamcana); \r
33\r
34 TString cAdd = "";\r
35 cAdd += Form("%02d_",(int)((radius+0.01)*10.));\r
36 cAdd += Form("B%d",(int)backM);\r
37 cAdd += Form("_Filter%05d",filter);\r
38 cAdd += Form("_Cut%05d",(int)(1000.*tPtcut));\r
39 cAdd += Form("_Skip%02d",skipCone);\r
40 TString Branch;\r
41 if(IsMC)Branch = Form("MC_clustersAOD_%s%s",jf,cAdd.Data());\r
42 else Branch = Form("Data_clustersAOD_%s%s",jf,cAdd.Data());\r
43\r
38e78449 44 AliAnalysisDataContainer *cout_jetsqamc = mgr->CreateContainer("histlistchecksingletrackrejection", TList::Class(),AliAnalysisManager::kOutputContainer,Form("%s:PWG4_CheckSingleTrackJetRejection_%s",AliAnalysisManager::GetCommonFileName(),Branch.Data()));\r
635693ee 45\r
46 // Create ONLY the output containers for the data produced by the task.\r
47 // Get and connect other common input/output containers via the manager as below\r
48 //==============================================================================\r
49\r
50 mgr->ConnectInput (jetqamcana,0, mgr->GetCommonInputContainer()); \r
51 mgr->ConnectOutput(jetqamcana,0, mgr->GetCommonOutputContainer());\r
52 mgr->ConnectOutput(jetqamcana,1, cout_jetsqamc);\r
53\r
54\r
55 return jetqamcana;\r
56}\r