updates in TRD
[u/mrichter/AliRoot.git] / PWG1 / CalibMacros / Pass0 / AddTaskTRDCalib.C
CommitLineData
674af238 1//=============================================================================
2//
3// *** AddTaskTRDCalib
4//
5// This macros setup the TRD calibration task
6//
7//=============================================================================
8
674af238 9AliAnalysisTask *AddTaskTRDCalib(Int_t runNumber)
10{
11 gSystem->Load("libTRDcalib");
12 // pointer to the analysis manager
13 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
14 if (!mgr) {
15 Error("AddTaskTRDCalib", "No analysis manager to connect to.");
16 return NULL;
278563e2 17 }
18
674af238 19 // check the input handler
20 if (!mgr->GetInputEventHandler()) {
21 ::Error("AddTask", "This task requires an input event handler");
22 return NULL;
278563e2 23 }
674af238 24
25 ////////////////////////////////////////////
26 // Number of timebins
27 ///////////////////////////////////////////
28 AliTRDcalibDB *calib = AliTRDcalibDB::Instance();
29 Int_t nbOfTimeBins = calib->GetNumberOfTimeBinsDCS();
30 if(nbOfTimeBins < 0) nbOfTimeBins = 27;
31 ////////////////////////////////////////////
32 //
33 /////////////////////////////////////////////
34 Int_t versiongain, subversiongain, versionvdrift, subversionvdrift;
35
36 /////////////////////////
37 // The TRD calib Task
38 /////////////////////////
39 AliTRDCalibTask *calibTask = new AliTRDCalibTask();
8b5ef4b6 40
41 // Disabling TRD CPAss0 as per https://savannah.cern.ch/bugs/?88813
42 //calibTask->SetMaxEvent(-1);
43
44 calibTask->SetMaxNbTracks(600);
674af238 45 calibTask->SetHisto2d(kTRUE);
46 calibTask->SetVector2d(kFALSE);
47 calibTask->SetVdriftLinear(kTRUE);
68307a00 48 calibTask->SetExbAlt(kTRUE);
674af238 49 calibTask->SetNz(0,0);
50 calibTask->SetNrphi(0,0);
51 calibTask->SetNz(0,1);
52 calibTask->SetNrphi(0,1);
53 calibTask->SetNz(0,2);
54 calibTask->SetNrphi(0,2);
55 calibTask->SetLow(0);
56 calibTask->SetHigh(30);
57 calibTask->SetFillZero(kFALSE);
278563e2 58 // now
59 calibTask->AddSelectedTriggerClass("C0OB0-ABCE-NOPF-ALL");
60 calibTask->AddSelectedTriggerClass("CTRDCO2-ABCE-NOPF-CENT");
61 calibTask->AddSelectedTriggerClass("CTRDCO2-ABCE-NOPF-TRD");
62 calibTask->AddSelectedTriggerClass("CTRDCO2-ABCE-NOPF-ALL");
63 calibTask->SetReject(kTRUE);
64 // before
65 //calibTask->AddSelectedTriggerClass("CINT1B-ABCE-NOPF-ALL");
66 //calibTask->AddSelectedTriggerClass("CINT1WU-B-NOPF-ALL");
67 //calibTask->AddSelectedTriggerClass("CINT7WU-B-NOPF-ALL");
68 //calibTask->AddSelectedTriggerClass("CINT7WU-I-NOPF-ALL");
69 //calibTask->SetReject(kFALSE);
674af238 70 //calibTask->SetDebug(2);
71 calibTask->SetNbTimeBins(nbOfTimeBins);
72 //calibTask->SetMaxEvent(10);
73 //calibTask->SetThresholdP(1.0);
74 calibTask->SetRequirePrimaryVertex(kTRUE);
75 calibTask->SetMinNbOfContributors(1);
76 calibTask->SetMaxCluster(100.0);
77 calibTask->SetNbMaxCluster(2);
78 //calibTask->SetLimitChargeIntegration(kTRUE);
79
674af238 80
81 /////////////////////////////
82 // Track cuts
83 /////////////////////////////
84 AliESDtrackCuts *trackCuts = new AliESDtrackCuts("trackcuts","trackcuts");
85 trackCuts->SetMinNClustersTPC(50);
86 trackCuts->SetMaxChi2PerClusterTPC(3.5);
87 //trackCuts->SetMaxCovDiagonalElements(2,2,0.5,0.5,2);
88 trackCuts->SetRequireTPCRefit(kTRUE);
89 //trackCuts->SetRequireITSRefit(kTRUE);
90 //trackCuts->SetMinNsigmaToVertex(10);
91 trackCuts->SetRequireSigmaToVertex(kFALSE);
92 trackCuts->SetAcceptKinkDaughters(kFALSE);
93 trackCuts->SetMaxDCAToVertexZ(30.0);
94 trackCuts->SetMaxDCAToVertexXY(3.0);
95 trackCuts->SetDCAToVertex2D(kFALSE);
96
97 calibTask->SetESDtrackCuts(trackCuts);
98
99 mgr->AddTask(calibTask);
100
101 AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
102 //AliAnalysisDataContainer *cinput = mgr->GetCommonOutputContainer();
278563e2 103
104 if (!cinput) cinput = mgr->CreateContainer("cchain",TChain::Class(),
674af238 105 AliAnalysisManager::kInputContainer);
106
278563e2 107 AliAnalysisDataContainer *coutput =mgr->CreateContainer("TRDCalib",TList::Class(), AliAnalysisManager::kOutputContainer, "AliESDfriends_v1.root");
674af238 108
109
110 mgr->ConnectInput(calibTask,0,cinput);
111 mgr->ConnectOutput(calibTask,1,coutput);
112 return calibTask;
113
114}
8b5ef4b6 115