2 macro to extract the OCDB entries
4 input: CalibObjects.root
5 ouput: TimeGain and TimeVdrift calibration objects for TPC and TRD
8 .L $ALICE_ROOT/PWGPP/CalibMacros/CPass0/makeOCDB.C
13 //__________________________________________________________________
15 void makeOCDB(Int_t runNumber, TString ocdbStorage = "")
17 makeOCDB("CalibObjects.root", "ALL", runNumber, ocdbStorage);
20 //___________________________________________________________________
22 void makeOCDB(const Char_t *filename, TString component, Int_t runNumber, TString ocdbStorage = "")
25 // extract TPC OCDB entries
27 gROOT->Macro("$ALICE_ROOT/PWGPP/CalibMacros/CPass0/LoadLibraries.C");
28 gROOT->LoadMacro("$ALICE_ROOT/PWGPP/CalibMacros/CPass0/ConfigCalibTrain.C");
30 // switch off log info
31 AliLog::SetClassDebugLevel("AliESDEvent",0);
34 printf("runNumber from runCalibTrain = %d\n",runNumber);
36 /* configCalibTrain only if needed */
37 if (component == "TPC" || component == "TRD" || component == "ALL")
38 ConfigCalibTrain(runNumber, "raw://");
40 AliCDBManager::Instance()->SetDefaultStorage("raw://");
42 // Steering Tasks - set output storage
43 // DefaultStorage set already before - in ConfigCalibTrain.C
44 //ocdbStorage+="?se=ALICE::CERN::SE";
46 AliCDBManager::Instance()->SetSpecificStorage("*/*/*",ocdbStorage.Data());
49 if (ocdbStorage.Length()==0) ocdbStorage+="local://"+gSystem->GetFromPipe("pwd")+"/OCDB";
52 /* makeOCDB for selected component */
53 if (component == "TPC" || component == "ALL")
54 makeOCDB_TPC(filename, runNumber, ocdbStorage);
55 if (component == "TOF" || component == "ALL")
56 makeOCDB_TOF(filename, runNumber, ocdbStorage);
57 if (component == "T0" || component == "ALL")
58 makeOCDB_T0(filename, runNumber, ocdbStorage);
59 if (component == "TRD" || component == "ALL")
60 makeOCDB_TRD(filename, runNumber, ocdbStorage);
61 if (component == "MeanVertex" || component == "ALL")
62 makeOCDB_MeanVertex(filename, runNumber, ocdbStorage);
64 gSystem->Exec(Form("touch %s_ocdb_done", component.Data()));
68 //___________________________________________________________________
70 void makeOCDB_TPC(const Char_t *filename, Int_t runNumber, TString ocdbStorage)
74 TFile fcalib(filename);
75 AliTPCPreprocessorOffline proces;
77 // switch on parameter validation
78 proces.SetTimeGainRange(0.5,3.0);
79 proces.SwitchOnValidation();
81 // Make timegain calibration
82 //proces.CalibTimeGain(filename, runNumber,AliCDBRunRange::Infinity(),ocdbStorage);
83 proces.CalibTimeGain(filename, runNumber,runNumber,ocdbStorage);
85 // Make vdrift calibration
86 //proces.CalibTimeVdrift(filename,runNumber,AliCDBRunRange::Infinity(),ocdbStorage);
87 proces.CalibTimeVdrift(filename,runNumber,runNumber,ocdbStorage);
91 //___________________________________________________________________
93 void makeOCDB_TOF(const Char_t *filename, Int_t runNumber, TString ocdbStorage)
95 AliTOFAnalysisTaskCalibPass0 calibTask;
96 Printf("Calibrating TOF");
97 calibTask.ProcessOutput(filename, ocdbStorage);
100 //___________________________________________________________________
102 void makeOCDB_T0(const Char_t *filename, Int_t runNumber, TString ocdbStorage)
105 AliT0PreprocessorOffline procesT0;
106 // Make calibration of channels offset
107 procesT0.Process(filename,runNumber, runNumber, ocdbStorage);
110 //___________________________________________________________________
112 void makeOCDB_TRD(const Char_t *filename, Int_t runNumber, TString ocdbStorage)
115 AliTRDPreprocessorOffline procestrd;
116 procestrd.SetLinearFitForVdrift(kTRUE);
117 procestrd.SetMinStatsVdriftT0PH(600*10);
118 procestrd.SetMinStatsVdriftLinear(50);
119 procestrd.SetMinStatsGain(600);
120 procestrd.Init(filename);
121 Int_t versionVdriftUsed = procestrd.GetVersionVdriftUsed();
122 Int_t subversionVdriftUsed = procestrd.GetSubVersionVdriftUsed();
123 Int_t versionGainUsed = procestrd.GetVersionGainUsed();
124 Int_t subversionGainUsed = procestrd.GetSubVersionGainUsed();
125 Int_t versionExBUsed = procestrd.GetVersionExBUsed();
126 Int_t subversionExBUsed = procestrd.GetSubVersionExBUsed();
127 printf("version and subversion vdrift %d and %d\n",versionVdriftUsed,subversionVdriftUsed);
128 printf("version and subversion gain %d and %d\n",versionGainUsed,subversionGainUsed);
129 printf("version and subversion exb %d and %d\n",versionExBUsed,subversionExBUsed);
130 procestrd.Process(filename,runNumber,runNumber,ocdbStorage);
131 Int_t trdstatus = procestrd.GetStatus();
135 //___________________________________________________________________
137 void makeOCDB_MeanVertex(const Char_t *filename, Int_t runNumber, TString ocdbStorage)
140 AliMeanVertexPreprocessorOffline procesMeanVtx;
141 procesMeanVtx.ProcessOutput(filename, ocdbStorage, runNumber);
144 //___________________________________________________________________