]>
Commit | Line | Data |
---|---|---|
674af238 | 1 | /* |
2 | macro to extract the OCDB entries | |
3 | ||
4 | input: CalibObjects.root | |
5 | ouput: TimeGain and TimeVdrift calibration objects for TPC and TRD | |
6 | ||
7 | Example: | |
8 | .L $ALICE_ROOT/ANALYSIS/CalibMacros/MergeCalibration/makeOCDB.C | |
9 | makeOCDB("105160"); | |
10 | ||
11 | */ | |
12 | ||
13 | const AliTRDCalDet *GetCalDetVdrift(Int_t runNumber, Int_t version, Int_t subversion); | |
14 | void makeOCDB(TString runNumberString, TString ocdbStorage="") | |
15 | { | |
16 | // | |
17 | // extract TPC OCDB entries | |
18 | // | |
19 | gROOT->Macro("LoadLibraries.C"); | |
20 | gROOT->LoadMacro("ConfigCalibTrain.C"); | |
21 | ||
22 | // switch off log info | |
23 | AliLog::SetClassDebugLevel("AliESDEvent",0); | |
24 | ||
25 | // config GRP | |
26 | Int_t runNumber = runNumberString.Atoi(); | |
27 | printf("runNumber from runCalibTrain = %d\n",runNumber); | |
28 | ConfigCalibTrain(runNumber, "raw://"); | |
29 | ||
30 | // Steering Tasks - set output storage | |
31 | // DefaultStorage set already before - in ConfigCalibTrain.C | |
604d265e | 32 | ocdbStorage+="?se=ALICE::CERN::SE"; |
674af238 | 33 | AliCDBManager::Instance()->SetSpecificStorage("*/*/*",ocdbStorage.Data()); |
34 | ||
35 | // set OCDB storage | |
36 | if (ocdbStorage.Length()==0) ocdbStorage+="local://"+gSystem->GetFromPipe("pwd")+"/OCDB"; | |
37 | ||
38 | // TPC part | |
39 | TFile fcalib("CalibObjects.root"); | |
40 | AliTPCPreprocessorOffline proces; | |
41 | ||
42 | // switch on parameter validation | |
43 | proces.SwitchOnValidation(); | |
44 | ||
45 | // Make timegain calibration | |
46 | //proces.CalibTimeGain("CalibObjects.root", runNumber,AliCDBRunRange::Infinity(),ocdbStorage); | |
47 | proces.CalibTimeGain("CalibObjects.root", runNumber,runNumber,ocdbStorage); | |
48 | ||
49 | // Make vdrift calibration | |
50 | //proces.CalibTimeVdrift("CalibObjects.root",runNumber,AliCDBRunRange::Infinity(),ocdbStorage); | |
51 | proces.CalibTimeVdrift("CalibObjects.root",runNumber,runNumber,ocdbStorage); | |
52 | ||
53 | ||
54 | // TRD part | |
55 | AliTRDPreprocessorOffline procestrd; | |
56 | procestrd.SetLinearFitForVdrift(kTRUE); | |
57 | procestrd.Init("CalibObjects.root"); | |
58 | Int_t versionVdriftUsed = procestrd.GetVersionVdriftUsed(); | |
59 | Int_t subversionVdriftUsed = procestrd.GetSubVersionVdriftUsed(); | |
60 | procestrd.SetCalDetVdrift(GetCalDetVdrift(runNumber,versionVdriftUsed,subversionVdriftUsed)); | |
61 | ||
62 | procestrd.SetMinStatsVdriftT0PH(600*10); | |
604d265e | 63 | procestrd.SetMinStatsVdriftLinear(60); |
674af238 | 64 | procestrd.SetMinStatsGain(600); |
604d265e | 65 | |
674af238 | 66 | procestrd.CalibVdriftT0("CalibObjects.root",runNumber,runNumber,ocdbStorage); |
67 | procestrd.CalibGain("CalibObjects.root",runNumber,runNumber,ocdbStorage); | |
604d265e | 68 | |
3f660744 | 69 | // TOF part |
70 | AliTOFAnalysisTaskCalibPass0 calibTask; | |
71 | Printf("Calibrating TOF"); | |
72 | calibTask.ProcessOutput("CalibObjects.root", ocdbStorage); | |
73 | ||
674af238 | 74 | return; |
75 | } | |
76 | ||
77 | const AliTRDCalDet *GetCalDetVdrift(Int_t runNumber, Int_t version, Int_t subversion){ | |
78 | // | |
79 | // Get Cal Det used during reconstruction for vdrift | |
80 | // | |
81 | ||
82 | AliCDBEntry *entry = AliCDBManager::Instance()->Get("TRD/Calib/ChamberVdrift",runNumber, version, subversion); | |
83 | if(!entry) { | |
84 | printf("Found no entry\n"); | |
85 | return 0x0; | |
86 | } | |
87 | const AliCDBId id = entry->GetId(); | |
88 | version = id.GetVersion(); | |
89 | subversion = id.GetSubVersion(); | |
90 | //printf("Found version %d and subversion %d for vdrift\n",version,subversion); | |
91 | const AliTRDCalDet* calDet = (AliTRDCalDet *)entry->GetObject(); | |
92 | ||
93 | return calDet; | |
94 | ||
95 | } |