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