added TOF calibration library and code for pass0/passX calibration
[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 */
33 AliAnalysisDataContainer *outputc1 = mgr->CreateContainer("Histos", TList::Class(), AliAnalysisManager::kOutputContainer, "TOFCalibPass0.root");
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();
41 mgr->ConnectInput(task, 0, inputc);
42 mgr->ConnectOutput(task, 1, outputc1);
43
44 /* setup task */
45 task->SetEventSelectionFlag(kFALSE);
46 task->SetVertexSelectionFlag(kTRUE);
47 task->SetVertexCut(25.0);
48 /* setup TOF calib */
49 task->GetTOFcalib()->SetRemoveMeanT0(kFALSE);
50 task->GetTOFcalib()->SetCalibrateTOFsignal(kTRUE);
51 task->GetTOFcalib()->SetCorrectTExp(kFALSE);
52 /* setup track cuts */
53 AliESDtrackCuts *trackCuts = task->GetTrackCuts();
54 trackCuts->SetPtRange(0.5, 10.);
55 trackCuts->SetEtaRange(-1.0, 1.0);
56 trackCuts->SetRequireITSRefit(kTRUE);
57 trackCuts->SetMinNClustersITS(1);
58 trackCuts->SetRequireTPCRefit(kTRUE);
59 trackCuts->SetMinNClustersTPC(70);
60 trackCuts->SetMaxChi2PerClusterTPC(4.);
61 trackCuts->SetAcceptKinkDaughters(kFALSE);
62 trackCuts->SetMaxDCAToVertexZ(3.2);
63 trackCuts->SetMaxDCAToVertexXY(2.4);
64 trackCuts->SetDCAToVertex2D(kTRUE);
65
66 /* return task */
67 return task;
68
69}