]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGJE/EMCALJetTasks/macros/AddTaskCLQA.C
implement qc6
[u/mrichter/AliRoot.git] / PWGJE / EMCALJetTasks / macros / AddTaskCLQA.C
1 // $Id$
2
3 AliAnalysisTaskCLQA* AddTaskCLQA(
4   const char *ntracks            = "",
5   const char *nclusters          = "",
6   const char *njets              = "",
7   Bool_t doCumulants             = kFALSE,
8   Double_t cumMmin               = 10,
9   Double_t cumPtMin              = 0.3,
10   Double_t cumPtMax              = 5.0,
11   Double_t cumEtaMin             = -1.0,
12   Double_t cumEtaMax             = +1.0,
13   UInt_t trigsel                 = AliVEvent::kAnyINT|AliVEvent::kHighMult|AliVEvent::kCentral|AliVEvent::kSemiCentral|AliVEvent::kINT8,
14   const char *taskname           = "ATCLQA"
15 )
16 {  
17   // Get the pointer to the existing analysis manager via the static access method.
18   //==============================================================================
19   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
20   if (!mgr)
21   {
22     ::Error("AddTaskCLQA", "No analysis manager to connect to.");
23     return NULL;
24   }  
25   
26   // Check the analysis type using the event handlers connected to the analysis manager.
27   //==============================================================================
28   if (!mgr->GetInputEventHandler())
29   {
30     ::Error("AddTaskCLQA", "This task requires an input event handler");
31     return NULL;
32   }
33   
34   //-------------------------------------------------------
35   // Init the task and do settings
36   //-------------------------------------------------------
37   
38   TString name(taskname);
39   if (strcmp(ntracks,"")) {
40     name += "_";
41     name += ntracks;
42   }
43   if (strcmp(nclusters,"")) {
44     name += "_";
45     name += nclusters;
46   }
47   if (strcmp(njets,"")) {
48     name += "_";
49     name += njets;
50   }
51
52   AliAnalysisTaskCLQA* qaTask = new AliAnalysisTaskCLQA(name);
53   qaTask->SetTracksName(ntracks);
54   qaTask->SetClusName(nclusters);
55   qaTask->SetDoCumulants(doCumulants);
56   qaTask->SetCumParams(cumMmin,cumPtMin,cumPtMax,cumEtaMin,cumEtaMax);
57   qaTask->SelectCollisionCandidates(trigsel);
58
59   //-------------------------------------------------------
60   // Final settings, pass to manager and set the containers
61   //-------------------------------------------------------
62
63   mgr->AddTask(qaTask);
64   
65   // Create containers for input/output
66   AliAnalysisDataContainer *cinput  = mgr->GetCommonInputContainer()  ;
67
68   TString contName(name);
69   contName += "_histos";
70   AliAnalysisDataContainer *coutput = mgr->CreateContainer(contName.Data(), 
71                                                            TList::Class(),
72                                                            AliAnalysisManager::kOutputContainer,
73                                                            Form("%s", AliAnalysisManager::GetCommonFileName()));
74   mgr->ConnectInput  (qaTask, 0,  cinput );
75   mgr->ConnectOutput (qaTask, 1, coutput );
76
77   return qaTask;
78 }