]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG3/muondep/AddTaskMuonRefit.C
Fix for correctly getting the CDB path when running with plugin (Diego)
[u/mrichter/AliRoot.git] / PWG3 / muondep / AddTaskMuonRefit.C
CommitLineData
d0cf54cd 1AliAnalysisTaskMuonRefit* AddTaskMuonRefit(Double_t resNB = -1., Double_t resB = -1., Bool_t improveTracks = kFALSE,
2 Double_t sigmaCut = -1., Double_t sigmaCutTrig = -1.)
3{
4 /// Add AliAnalysisTaskMuonRefit to the train (Philippe Pillot)
5
6 // Get the pointer to the existing analysis manager via the static access method.
7 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
8 if(!mgr) {
9 Error("AddTaskMuonRefit","AliAnalysisManager not set!");
10 return NULL;
11 }
12
13 // This task run on ESDs
14 TString type = mgr->GetInputEventHandler()->GetDataType();
15 if (!type.Contains("ESD")) {
16 Error("AddTaskMuonRefit", "ESD input handler needed!");
17 return NULL;
18 }
19
20 // Create and configure task
21 AliAnalysisTaskMuonRefit *task = new AliAnalysisTaskMuonRefit("MuonRefit");
22 if (!task) {
23 Error("AddTaskMuonRefit", "Muon refit task cannot be created!");
24 return NULL;
25 }
26 Double_t clusterResNB[10];
27 Double_t clusterResB[10];
28 for (Int_t i=0; i<10; i++) { clusterResNB[i] = resNB; clusterResB[i] = resB; }
29 task->ResetClusterResolution(clusterResNB, clusterResB);
30 task->ImproveTracks(improveTracks, sigmaCut);
31 task->SetSigmaCutForTrigger(sigmaCutTrig);
32
33 // Add task to analysis manager
34 mgr->AddTask(task);
35
36 // Connect input container
37 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
38
39 return task;
40}
41