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