AliRoot Core  edcc906 (edcc906)
AddTaskTPCCalib.C
Go to the documentation of this file.
1 
4 Int_t debugLevel = 2;
5 Int_t streamLevel = 20;
6 TTimeStamp startTime(2009,8,7,0,0,0);
7 TTimeStamp stopTime(2009,12,31,0,0,0);
8 char * prefix = "/V6/";
9 
10 void ConfigOCDB(Int_t crun);
11 
12 AliAnalysisTask *AddTaskTPCCalib(Int_t runNumber)
13 {
14  gSystem->Load("libTPCcalib");
15  // pointer to the analysis manager
16  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
17  if (!mgr) {
18  Error("AddTaskTPCCalib", "No analysis manager to connect to.");
19  return NULL;
20  }
21 
22  // check the input handler
23  if (!mgr->GetInputEventHandler()) {
24  ::Error("AddTask", "This task requires an input event handler");
25  return NULL;
26  }
27  ConfigOCDB(runNumber);
28  AliTPCAnalysisTaskcalib *task1=new AliTPCAnalysisTaskcalib("CalibObjectsTrain1");
29  //
30  SetupCalibTaskTrain1(task1);
31  mgr->AddTask(task1);
32  AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();
33 
34  if (!cinput1) cinput1 = mgr->CreateContainer("cchain",TChain::Class(),
35  AliAnalysisManager::kInputContainer);
36 
37  AliAnalysisDataContainer *coutput1 =mgr->CreateContainer("TPCCalib",TObjArray::Class(), AliAnalysisManager::kOutputContainer, "AliESDfriends_v1.root");
38  mgr->ConnectInput(task1,0,cinput1);
39  mgr->ConnectOutput(task1,0,coutput1);
40  return task1;
41 }
42 
43 
44 
45 
46 void AddCalibCalib(TObject* task){
51 
52  AliTPCAnalysisTaskcalib* myTask = (AliTPCAnalysisTaskcalib*) task;
53  AliTPCcalibCalib *calibCalib = new AliTPCcalibCalib("calibTPC","calibTPC");
54  calibCalib->SetDebugLevel(debugLevel);
55  calibCalib->SetStreamLevel(streamLevel);
56  calibCalib->SetTriggerMask(-1,-1,kFALSE); //accept everything
57  myTask->AddJob(calibCalib);
58 
59 }
60 void AddCalibTimeGain(TObject* task){
64 
65  AliTPCAnalysisTaskcalib* myTask = (AliTPCAnalysisTaskcalib*) task;
66  AliTPCcalibTimeGain *calibTimeGain = new AliTPCcalibTimeGain("calibTimeGain","calibTimeGain", startTime.GetSec(), stopTime.GetSec(), 30*60);
67  //calibTimeGain->SetLowMemoryConsumption(kTRUE);
68  //calibTimeGain->SetMIP(25.);
69  calibTimeGain->SetIsCosmic(kFALSE);
70  calibTimeGain->SetUseCookAnalytical(kTRUE);
71  calibTimeGain->SetUseMax(kFALSE);
72  calibTimeGain->SetDebugLevel(debugLevel);
73  calibTimeGain->SetStreamLevel(streamLevel);
74  calibTimeGain->SetTriggerMask(-1,-1,kTRUE); //reject laser
75  myTask->AddJob(calibTimeGain);
76 }
77 
78 void AddCalibTime(TObject* task){
81 
82  AliTPCAnalysisTaskcalib* myTask = (AliTPCAnalysisTaskcalib*) task;
83  AliTPCcalibTime *calibTime = new AliTPCcalibTime("calibTime","calibTime", startTime.GetSec(), stopTime.GetSec(), 20*60);
84  calibTime->SetDebugLevel(debugLevel);
85  calibTime->SetStreamLevel(streamLevel);
86  calibTime->SetTriggerMask(-1,-1,kFALSE); //accept everything
87  myTask->AddJob(calibTime);
88 }
89 
90 
91 void SetupCalibTaskTrain1(TObject* task){
93 
94  AliTPCAnalysisTaskcalib* myTask = (AliTPCAnalysisTaskcalib*) task;
95  //AddCalibCalib(task);
96  AddCalibTimeGain(task);
97  AddCalibTime(task);
98  //
99  TString path=gSystem->pwd();
100  path+=prefix;
101  gSystem->mkdir(path);
102  myTask->SetDebugOuputhPath(path.Data());
103 
104 }
105 
106 
107 
108 void ConfigOCDB(Int_t run){
110 
111  printf("SETUP OCBD for TPC\n");
112  printf("SETUP OCBD for TPC\n");
113  printf("SETUP OCBD for TPC\n");
114  //
115  //
117  param->ReadGeoMatrices();
118  //
119 
122  //
123  transform->SetCurrentRecoParam(tpcRecoParam);
124  tpcRecoParam->SetUseGainCorrectionTime(0);
125  tpcRecoParam->SetUseRPHICorrection(kTRUE);
126  tpcRecoParam->SetUseTOFCorrection(kFALSE);
127  //
128  tpcRecoParam->SetUseDriftCorrectionTime(1);
129  tpcRecoParam->SetUseDriftCorrectionGY(1);
130  //
131  tpcRecoParam->SetUseRadialCorrection(kFALSE);
132  tpcRecoParam->SetUseQuadrantAlignment(kTRUE);
133  //
134  tpcRecoParam->SetUseSectorAlignment(kFALSE);
135  tpcRecoParam->SetUseGainCorrectionTime(kFALSE);
136  tpcRecoParam->SetUseFieldCorrection(kFALSE);
137  tpcRecoParam->SetUseExBCorrection(kTRUE);
139 }
140 
141 
142 
143 
static AliTPCcalibDB * Instance()
printf("Chi2/npoints = %f\n", TMath::Sqrt(chi2/npoints))
void AddCalibCalib(TObject *task)
Int_t streamLevel
void SetUseSectorAlignment(Int_t flag)
static AliTPCRecoParam * GetCosmicTestParam(Bool_t bPedestal)
const char * path
Manager and of geomety classes for set: TPC.
Definition: AliTPCParam.h:18
Implementation of the TPC transformation class.
void SetUseGainCorrectionTime(Int_t flag)
void SetUseFieldCorrection(Int_t flag)
void SetUseTOFCorrection(Bool_t flag)
virtual Bool_t ReadGeoMatrices()
AliTPCParam * GetParameters() const
void AddCalibTimeGain(TObject *task)
AliTPCTransform * GetTransform() const
Definition: AliTPCcalibDB.h:63
TTimeStamp startTime(2009, 8, 7, 0, 0, 0)
char * prefix
void SetupCalibTaskTrain1(TObject *task)
void ConfigOCDB(Int_t crun)
AliTPCcalibTime * calibTime
Definition: CalibTime.C:20
void SetUseDriftCorrectionGY(Int_t flag)
void SetUseRadialCorrection(Int_t flag)
void SetUseQuadrantAlignment(Int_t flag)
void SetUseExBCorrection(Int_t flag)
void SetRun(Long64_t run)
void SetUseDriftCorrectionTime(Int_t flag)
TTimeStamp stopTime(2009, 12, 31, 0, 0, 0)
static Int_t runNumber
Definition: pdc06_config.C:126
Int_t debugLevel
Class with TPC reconstruction parameters.
void SetCurrentRecoParam(AliTPCRecoParam *param)
void AddCalibTime(TObject *task)
void SetUseRPHICorrection(Int_t flag)
AliAnalysisTask * AddTaskTPCCalib(Int_t runNumber)