some more updates
[u/mrichter/AliRoot.git] / PWGPP / macros / AddTaskITSTPCalignment.C
CommitLineData
51cfc50d 1AliAnalysisTaskITSTPCalignment *AddTaskITSTPCalignment()
2{
3 //add the ITS TPC alignemtn task to the manager
20ef1093 4 //Mikolaj Krzewicki, mikolaj.krzewicki@cern.ch
51cfc50d 5
6 //______________________________________________________________________________
7 // Get the pointer to the existing analysis manager via the static access method.
8 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
9 if (!mgr)
10 {
11 ::Error("AddTaskITSTPCalignment", "No analysis manager to connect to.");
12 return NULL;
13 }
14
15 //______________________________________________________________________________
16 // Check the analysis type using the event handlers connected to the analysis manager.
17 if (!mgr->GetInputEventHandler())
18 {
19 ::Error("AddTaskITSTPCalignment", "This task requires an input event handler");
20 return NULL;
21 }
22 TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
23 if (type!="ESD")
24 {
25 ::Error("AddTaskITSTPCalignment", "This task only works on ESDs");
26 return NULL;
27 }
28
29 //___________________________________________________________________________
30 // Create the task, add it to manager and configure it.
31 AliAnalysisTaskITSTPCalignment *task = new AliAnalysisTaskITSTPCalignment("taskITSTPCalignment");
32 TTimeStamp t0(2009,11,1,0,0,0);
20ef1093 33 TTimeStamp tend(2012,12,31,0,0,0);
51cfc50d 34 Int_t slotwidth = 3600;
35 task->SetupAlignerArray(t0.GetSec(),tend.GetSec(),slotwidth);
36 task->SetFillDebugTree(kFALSE);
37 task->SetDoQA(kTRUE);
38 task->SetMinPt(0.4);
39 task->SetMinNclsITS(4);
20ef1093 40 task->SetMinNclsTPC(70);
51cfc50d 41 task->SetRejectOutliers(kTRUE); //internal KF outlier rejection (kalman update-based)
42 task->SetRejectOutliersSigma2Median(kTRUE); //input data outlier removal
43 task->SetOutRejSigma(1.); //max distance the kf state is allowed to jump
20ef1093 44 task->SetOutRejSigmaOnMerge(10.); //outlier rejection when merging vertically
45 task->SetOutRejSigma2Median(2.); //max distance from median for input data
51cfc50d 46 task->SetUseITSoutGlobalTrack(kFALSE);
47 task->SetUseITSoutITSSAtrack(kTRUE);
48
49 mgr->AddTask(task);
50
51 //______________________________________________________________________________
52 //connect output
53 TString outputFilename = "outputITSTPCalignment.root";
54
55 AliAnalysisDataContainer* coutput0 = mgr->CreateContainer("outputTree",
56 TTree::Class(),
57 AliAnalysisManager::kOutputContainer,
58 outputFilename.Data());
59 AliAnalysisDataContainer* coutput1 = mgr->CreateContainer("outputList",
60 TList::Class(),
61 AliAnalysisManager::kOutputContainer,
62 outputFilename.Data());
63 AliAnalysisDataContainer* coutput2 = mgr->CreateContainer("outputArrayITSglobal",
64 AliRelAlignerKalmanArray::Class(),
65 AliAnalysisManager::kOutputContainer,
66 outputFilename.Data());
67 AliAnalysisDataContainer* coutput3 = mgr->CreateContainer("outputArrayITSSA",
68 AliRelAlignerKalmanArray::Class(),
69 AliAnalysisManager::kOutputContainer,
70 outputFilename.Data());
71
72 mgr->ConnectInput(task,0,mgr->GetCommonInputContainer());
73 mgr->ConnectOutput(task,0,coutput0);
74 mgr->ConnectOutput(task,1,coutput1);
75 mgr->ConnectOutput(task,2,coutput2);
76 mgr->ConnectOutput(task,3,coutput3);
77
78 return task;
79}
80