]>
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"); | |
8ec63e76 | 21 | |
674af238 | 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://"); | |
8ec63e76 | 29 | |
674af238 | 30 | // Steering Tasks - set output storage |
31 | // DefaultStorage set already before - in ConfigCalibTrain.C | |
8ec63e76 | 32 | //ocdbStorage+="?se=ALICE::CERN::SE"; |
33 | ||
674af238 | 34 | AliCDBManager::Instance()->SetSpecificStorage("*/*/*",ocdbStorage.Data()); |
8ec63e76 | 35 | |
674af238 | 36 | // set OCDB storage |
37 | if (ocdbStorage.Length()==0) ocdbStorage+="local://"+gSystem->GetFromPipe("pwd")+"/OCDB"; | |
38 | ||
39 | // TPC part | |
40 | TFile fcalib("CalibObjects.root"); | |
41 | AliTPCPreprocessorOffline proces; | |
42 | ||
43 | // switch on parameter validation | |
44 | proces.SwitchOnValidation(); | |
45 | ||
46 | // Make timegain calibration | |
47 | //proces.CalibTimeGain("CalibObjects.root", runNumber,AliCDBRunRange::Infinity(),ocdbStorage); | |
48 | proces.CalibTimeGain("CalibObjects.root", runNumber,runNumber,ocdbStorage); | |
49 | ||
50 | // Make vdrift calibration | |
51 | //proces.CalibTimeVdrift("CalibObjects.root",runNumber,AliCDBRunRange::Infinity(),ocdbStorage); | |
52 | proces.CalibTimeVdrift("CalibObjects.root",runNumber,runNumber,ocdbStorage); | |
b171a803 | 53 | // |
54 | // TOF part | |
55 | // | |
56 | AliTOFAnalysisTaskCalibPass0 calibTask; | |
57 | Printf("Calibrating TOF"); | |
58 | calibTask.ProcessOutput("CalibObjects.root", ocdbStorage); | |
674af238 | 59 | |
60 | ||
61 | // TRD part | |
62 | AliTRDPreprocessorOffline procestrd; | |
63 | procestrd.SetLinearFitForVdrift(kTRUE); | |
64 | procestrd.Init("CalibObjects.root"); | |
65 | Int_t versionVdriftUsed = procestrd.GetVersionVdriftUsed(); | |
66 | Int_t subversionVdriftUsed = procestrd.GetSubVersionVdriftUsed(); | |
b171a803 | 67 | if(versionVdriftUsed != 0) { |
68 | ||
8ec63e76 | 69 | const AliTRDCalDet* caldet=procestrd.SetCalDetVdrift(GetCalDetVdrift(runNumber,versionVdriftUsed,subversionVdriftUsed)); |
3f660744 | 70 | |
b171a803 | 71 | if(caldet) { |
8ec63e76 | 72 | |
b171a803 | 73 | procestrd.SetMinStatsVdriftT0PH(600*10); |
74 | procestrd.SetMinStatsVdriftLinear(60); | |
75 | procestrd.SetMinStatsGain(600); | |
8ec63e76 | 76 | |
b171a803 | 77 | procestrd.CalibVdriftT0("CalibObjects.root",runNumber,runNumber,ocdbStorage); |
78 | procestrd.CalibGain("CalibObjects.root",runNumber,runNumber,ocdbStorage); | |
79 | procestrd.CalibChamberStatus(runNumber,runNumber,ocdbStorage); | |
80 | } | |
81 | } | |
674af238 | 82 | return; |
83 | } | |
84 | ||
85 | const AliTRDCalDet *GetCalDetVdrift(Int_t runNumber, Int_t version, Int_t subversion){ | |
8ec63e76 | 86 | // |
674af238 | 87 | // Get Cal Det used during reconstruction for vdrift |
88 | // | |
8ec63e76 | 89 | |
90 | ||
674af238 | 91 | AliCDBEntry *entry = AliCDBManager::Instance()->Get("TRD/Calib/ChamberVdrift",runNumber, version, subversion); |
92 | if(!entry) { | |
93 | printf("Found no entry\n"); | |
94 | return 0x0; | |
95 | } | |
96 | const AliCDBId id = entry->GetId(); | |
97 | version = id.GetVersion(); | |
98 | subversion = id.GetSubVersion(); | |
99 | //printf("Found version %d and subversion %d for vdrift\n",version,subversion); | |
100 | const AliTRDCalDet* calDet = (AliTRDCalDet *)entry->GetObject(); | |
101 | ||
102 | return calDet; | |
103 | ||
104 | } |