]>
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: | |
b171a803 | 8 | .L $ALICE_ROOT/PWG1/CalibMacros/Pass0/makeOCDB.C |
674af238 | 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); | |
b171a803 | 52 | // |
53 | // TOF part | |
54 | // | |
55 | AliTOFAnalysisTaskCalibPass0 calibTask; | |
56 | Printf("Calibrating TOF"); | |
57 | calibTask.ProcessOutput("CalibObjects.root", ocdbStorage); | |
674af238 | 58 | |
59 | ||
60 | // TRD part | |
61 | AliTRDPreprocessorOffline procestrd; | |
62 | procestrd.SetLinearFitForVdrift(kTRUE); | |
63 | procestrd.Init("CalibObjects.root"); | |
64 | Int_t versionVdriftUsed = procestrd.GetVersionVdriftUsed(); | |
65 | Int_t subversionVdriftUsed = procestrd.GetSubVersionVdriftUsed(); | |
b171a803 | 66 | if(versionVdriftUsed != 0) { |
67 | ||
68 | procestrd.SetCalDetVdrift(GetCalDetVdrift(runNumber,versionVdriftUsed,subversionVdriftUsed)); | |
3f660744 | 69 | |
b171a803 | 70 | if(caldet) { |
71 | ||
72 | procestrd.SetMinStatsVdriftT0PH(600*10); | |
73 | procestrd.SetMinStatsVdriftLinear(60); | |
74 | procestrd.SetMinStatsGain(600); | |
75 | ||
76 | procestrd.CalibVdriftT0("CalibObjects.root",runNumber,runNumber,ocdbStorage); | |
77 | procestrd.CalibGain("CalibObjects.root",runNumber,runNumber,ocdbStorage); | |
78 | procestrd.CalibChamberStatus(runNumber,runNumber,ocdbStorage); | |
79 | } | |
80 | } | |
674af238 | 81 | return; |
82 | } | |
83 | ||
84 | const AliTRDCalDet *GetCalDetVdrift(Int_t runNumber, Int_t version, Int_t subversion){ | |
85 | // | |
86 | // Get Cal Det used during reconstruction for vdrift | |
87 | // | |
88 | ||
89 | AliCDBEntry *entry = AliCDBManager::Instance()->Get("TRD/Calib/ChamberVdrift",runNumber, version, subversion); | |
90 | if(!entry) { | |
91 | printf("Found no entry\n"); | |
92 | return 0x0; | |
93 | } | |
94 | const AliCDBId id = entry->GetId(); | |
95 | version = id.GetVersion(); | |
96 | subversion = id.GetSubVersion(); | |
97 | //printf("Found version %d and subversion %d for vdrift\n",version,subversion); | |
98 | const AliTRDCalDet* calDet = (AliTRDCalDet *)entry->GetObject(); | |
99 | ||
100 | return calDet; | |
101 | ||
102 | } |