Update SPD Diamond DA (with configuration file - A. Mastroserio)
[u/mrichter/AliRoot.git] / TOF / AddTOFAnalysisTaskCalibPass0.C
CommitLineData
3c8efc07 1AliTOFAnalysisTaskCalibPass0 *
2AddTOFAnalysisTaskCalibPass0()
3{
4
5 /* check analysis manager */
6 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
7 if (!mgr) {
8 Error("AddAnalysisTaskEventTime", "cannot get analysis manager");
9 return NULL;
10 }
11
12 /* check input event handler */
13 if (!mgr->GetInputEventHandler()) {
14 Error("AddAnalysisTaskEventTime", "cannot get input event handler");
15 return NULL;
16 }
17
18 /* check input data type */
19 TString str = mgr->GetInputEventHandler()->GetDataType();
20 if (str.CompareTo("ESD")) {
21 Error("AddAnalysisTaskEventTime", "input data type is not \"ESD\"");
22 return NULL;
23 }
24
25 /* get common input data container */
26 AliAnalysisDataContainer *inputc = mgr->GetCommonInputContainer();
27 if (!inputc) {
28 Error("AddAnalysisTaskEventTime", "cannot get common input container");
29 return NULL;
30 }
31
32 /* create output data container */
87ddb812 33 AliAnalysisDataContainer *outputc1 = mgr->CreateContainer("TOFHistos", TList::Class(), AliAnalysisManager::kOutputContainer, "AliESDfriends_v1.root");
3c8efc07 34 if (!outputc1) {
35 Error("AddAnalysisTaskEventTime", "cannot create output container \"Histos\"");
36 return NULL;
37 }
38
39 /* create task and connect input/output */
40 AliTOFAnalysisTaskCalibPass0 *task = new AliTOFAnalysisTaskCalibPass0();
87ddb812 41
42 // adding the task
43 mgr->AddTask(task);
44
3c8efc07 45 mgr->ConnectInput(task, 0, inputc);
46 mgr->ConnectOutput(task, 1, outputc1);
47
48 /* setup task */
b9a457fc 49 task->SetEventSelectionFlag(kTRUE);
3c8efc07 50 task->SetVertexSelectionFlag(kTRUE);
51 task->SetVertexCut(25.0);
52 /* setup TOF calib */
53 task->GetTOFcalib()->SetRemoveMeanT0(kFALSE);
54 task->GetTOFcalib()->SetCalibrateTOFsignal(kTRUE);
55 task->GetTOFcalib()->SetCorrectTExp(kFALSE);
56 /* setup track cuts */
57 AliESDtrackCuts *trackCuts = task->GetTrackCuts();
58 trackCuts->SetPtRange(0.5, 10.);
59 trackCuts->SetEtaRange(-1.0, 1.0);
60 trackCuts->SetRequireITSRefit(kTRUE);
61 trackCuts->SetMinNClustersITS(1);
62 trackCuts->SetRequireTPCRefit(kTRUE);
63 trackCuts->SetMinNClustersTPC(70);
64 trackCuts->SetMaxChi2PerClusterTPC(4.);
65 trackCuts->SetAcceptKinkDaughters(kFALSE);
66 trackCuts->SetMaxDCAToVertexZ(3.2);
67 trackCuts->SetMaxDCAToVertexXY(2.4);
68 trackCuts->SetDCAToVertex2D(kTRUE);
69
70 /* return task */
71 return task;
72
73}