]>
Commit | Line | Data |
---|---|---|
54b8f8e1 | 1 | //============================================================================= |
2 | // | |
3 | // *** AddTaskTPCCalib | |
4 | // | |
5 | // This macros setup the TPC calibration task | |
6 | // | |
7 | //============================================================================= | |
8 | ||
9 | ||
10 | ||
11 | ||
12 | Int_t debugLevel = 2; | |
13 | Int_t streamLevel = 20; | |
14 | TTimeStamp startTime(2009,8,7,0,0,0); | |
15 | TTimeStamp stopTime(2009,12,31,0,0,0); | |
16 | char * prefix = "/V6/"; | |
17 | ||
18 | void ConfigOCDB(Int_t crun); | |
19 | ||
20 | AliAnalysisTask *AddTaskTPCCalib(Int_t runNumber) | |
21 | { | |
22 | gSystem->Load("libTPCcalib"); | |
23 | // pointer to the analysis manager | |
24 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
25 | if (!mgr) { | |
26 | Error("AddTaskTPCCalib", "No analysis manager to connect to."); | |
27 | return NULL; | |
28 | } | |
29 | ||
30 | // check the input handler | |
31 | if (!mgr->GetInputEventHandler()) { | |
32 | ::Error("AddTask", "This task requires an input event handler"); | |
33 | return NULL; | |
34 | } | |
35 | ConfigOCDB(runNumber); | |
36 | AliTPCAnalysisTaskcalib *task1=new AliTPCAnalysisTaskcalib("CalibObjectsTrain1"); | |
37 | // | |
38 | SetupCalibTaskTrain1(task1); | |
39 | mgr->AddTask(task1); | |
40 | AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer(); | |
41 | ||
42 | if (!cinput1) cinput1 = mgr->CreateContainer("cchain",TChain::Class(), | |
43 | AliAnalysisManager::kInputContainer); | |
44 | ||
45 | AliAnalysisDataContainer *coutput1 =mgr->CreateContainer("TPCCalib",TObjArray::Class(), AliAnalysisManager::kOutputContainer, "AliESDfriends_v1.root"); | |
46 | mgr->ConnectInput(task1,0,cinput1); | |
47 | mgr->ConnectOutput(task1,0,coutput1); | |
48 | return task1; | |
49 | } | |
50 | ||
51 | ||
52 | ||
53 | ||
54 | void AddCalibCalib(TObject* task){ | |
55 | // | |
56 | // Responsible: Marian Ivanov | |
57 | // Description: | |
58 | // calibCalib is a prefilter | |
59 | // The current OCDB entries transformation are applied on cluster, tracks are refitted | |
60 | // | |
61 | AliTPCAnalysisTaskcalib* myTask = (AliTPCAnalysisTaskcalib*) task; | |
62 | AliTPCcalibCalib *calibCalib = new AliTPCcalibCalib("calibTPC","calibTPC"); | |
63 | calibCalib->SetDebugLevel(debugLevel); | |
64 | calibCalib->SetStreamLevel(streamLevel); | |
65 | calibCalib->SetTriggerMask(-1,-1,kFALSE); //accept everything | |
66 | myTask->AddJob(calibCalib); | |
67 | ||
68 | } | |
69 | void AddCalibTimeGain(TObject* task){ | |
70 | // | |
71 | // Responsible: Alexander Kalweit | |
72 | // Description: | |
73 | // Parameters to set | |
74 | AliTPCAnalysisTaskcalib* myTask = (AliTPCAnalysisTaskcalib*) task; | |
75 | AliTPCcalibTimeGain *calibTimeGain = new AliTPCcalibTimeGain("calibTimeGain","calibTimeGain", startTime.GetSec(), stopTime.GetSec(), 30*60); | |
76 | //calibTimeGain->SetLowMemoryConsumption(kTRUE); | |
77 | //calibTimeGain->SetMIP(25.); | |
78 | calibTimeGain->SetIsCosmic(kFALSE); | |
79 | calibTimeGain->SetUseCookAnalytical(kTRUE); | |
80 | calibTimeGain->SetUseMax(kFALSE); | |
81 | calibTimeGain->SetDebugLevel(debugLevel); | |
82 | calibTimeGain->SetStreamLevel(streamLevel); | |
83 | calibTimeGain->SetTriggerMask(-1,-1,kTRUE); //reject laser | |
84 | myTask->AddJob(calibTimeGain); | |
85 | } | |
86 | ||
87 | void AddCalibTime(TObject* task){ | |
88 | // | |
89 | // Responsible: Dag Larsen | |
90 | // Description: | |
91 | // | |
92 | // | |
93 | AliTPCAnalysisTaskcalib* myTask = (AliTPCAnalysisTaskcalib*) task; | |
94 | AliTPCcalibTime *calibTime = new AliTPCcalibTime("calibTime","calibTime", startTime.GetSec(), stopTime.GetSec(), 20*60); | |
95 | calibTime->SetDebugLevel(debugLevel); | |
96 | calibTime->SetStreamLevel(streamLevel); | |
97 | calibTime->SetTriggerMask(-1,-1,kFALSE); //accept everything | |
98 | myTask->AddJob(calibTime); | |
99 | } | |
100 | ||
101 | ||
102 | void SetupCalibTaskTrain1(TObject* task){ | |
103 | // | |
104 | // | |
105 | // | |
106 | AliTPCAnalysisTaskcalib* myTask = (AliTPCAnalysisTaskcalib*) task; | |
107 | //AddCalibCalib(task); | |
108 | AddCalibTimeGain(task); | |
109 | AddCalibTime(task); | |
110 | // | |
111 | TString path=gSystem->pwd(); | |
112 | path+=prefix; | |
113 | gSystem->mkdir(path); | |
114 | myTask->SetDebugOuputhPath(path.Data()); | |
115 | ||
116 | } | |
117 | ||
118 | ||
119 | ||
120 | void ConfigOCDB(Int_t run){ | |
121 | // | |
122 | printf("SETUP OCBD for TPC\n"); | |
123 | printf("SETUP OCBD for TPC\n"); | |
124 | printf("SETUP OCBD for TPC\n"); | |
125 | // | |
126 | // | |
127 | AliTPCParam *param= AliTPCcalibDB::Instance()->GetParameters(); | |
128 | param->ReadGeoMatrices(); | |
129 | // | |
130 | ||
131 | AliTPCTransform *transform = AliTPCcalibDB::Instance()->GetTransform() ; | |
132 | AliTPCRecoParam * tpcRecoParam = AliTPCRecoParam::GetCosmicTestParam(kTRUE); | |
133 | // | |
134 | transform->SetCurrentRecoParam(tpcRecoParam); | |
135 | tpcRecoParam->SetUseGainCorrectionTime(0); | |
136 | tpcRecoParam->SetUseRPHICorrection(kTRUE); | |
137 | tpcRecoParam->SetUseTOFCorrection(kFALSE); | |
138 | // | |
139 | tpcRecoParam->SetUseDriftCorrectionTime(1); | |
140 | tpcRecoParam->SetUseDriftCorrectionGY(1); | |
141 | // | |
142 | tpcRecoParam->SetUseRadialCorrection(kFALSE); | |
143 | tpcRecoParam->SetUseQuadrantAlignment(kTRUE); | |
144 | // | |
145 | tpcRecoParam->SetUseSectorAlignment(kFALSE); | |
146 | tpcRecoParam->SetUseGainCorrectionTime(kFALSE); | |
147 | tpcRecoParam->SetUseFieldCorrection(kFALSE); | |
148 | tpcRecoParam->SetUseExBCorrection(kTRUE); | |
149 | AliTPCcalibDB::Instance()->SetRun(run); | |
150 | } | |
151 | ||
152 | ||
153 | ||
154 |