]>
Commit | Line | Data |
---|---|---|
a45764d9 | 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: | |
054d9070 | 8 | .L $ALICE_ROOT/PWGPP/CalibMacros/CPass1/makeOCDB.C |
a45764d9 | 9 | makeOCDB("105160"); |
10 | ||
11 | */ | |
12 | ||
7a569197 | 13 | void PrintDetectorStatus(); |
357f522b | 14 | |
15 | ||
16 | ||
a45764d9 | 17 | void makeOCDB(TString runNumberString, TString ocdbStorage="") |
18 | { | |
19 | // | |
20 | // extract TPC OCDB entries | |
21 | // | |
cd9dc5c7 | 22 | gROOT->Macro("$ALICE_ROOT/PWGPP/CalibMacros/CPass1/LoadLibraries.C"); |
23 | gROOT->LoadMacro("$ALICE_ROOT/PWGPP/CalibMacros/CPass1/ConfigCalibTrain.C"); | |
a45764d9 | 24 | |
25 | // switch off log info | |
26 | AliLog::SetClassDebugLevel("AliESDEvent",0); | |
27 | ||
28 | // config GRP | |
29 | Int_t runNumber = runNumberString.Atoi(); | |
30 | printf("runNumber from runCalibTrain = %d\n",runNumber); | |
31 | ConfigCalibTrain(runNumber, "raw://"); | |
32 | ||
33 | // Steering Tasks - set output storage | |
34 | // DefaultStorage set already before - in ConfigCalibTrain.C | |
35 | //ocdbStorage+="?se=ALICE::CERN::SE"; | |
36 | ||
37 | AliCDBManager::Instance()->SetSpecificStorage("*/*/*",ocdbStorage.Data()); | |
63f0f70b | 38 | AliCDBManager::Instance()->SetSpecificStorage("TPC/Calib/Correction","local://"); |
a45764d9 | 39 | |
40 | // set OCDB storage | |
41 | if (ocdbStorage.Length()==0) ocdbStorage+="local://"+gSystem->GetFromPipe("pwd")+"/OCDB"; | |
42 | ||
43 | // TPC part | |
44 | TFile fcalib("CalibObjects.root"); | |
357f522b | 45 | AliTPCPreprocessorOffline procesTPC; |
a45764d9 | 46 | |
47 | // switch on parameter validation | |
357f522b | 48 | procesTPC.SetTimeGainRange(0.5,3.0); |
49 | procesTPC.SwitchOnValidation(); | |
a45764d9 | 50 | |
51 | // Make timegain calibration | |
52 | //proces.CalibTimeGain("CalibObjects.root", runNumber,AliCDBRunRange::Infinity(),ocdbStorage); | |
357f522b | 53 | procesTPC.CalibTimeGain("CalibObjects.root", runNumber,runNumber,ocdbStorage); |
a45764d9 | 54 | |
55 | // Make vdrift calibration | |
56 | //proces.CalibTimeVdrift("CalibObjects.root",runNumber,AliCDBRunRange::Infinity(),ocdbStorage); | |
357f522b | 57 | procesTPC.CalibTimeVdrift("CalibObjects.root",runNumber,runNumber,ocdbStorage); |
a45764d9 | 58 | // |
59 | // TOF part | |
60 | // | |
61 | AliTOFAnalysisTaskCalibPass0 calibTask; | |
62 | Printf("Calibrating TOF"); | |
63 | calibTask.ProcessOutput("CalibObjects.root", ocdbStorage); | |
64 | // | |
65 | // | |
66 | ||
67 | // T0 part | |
68 | AliT0PreprocessorOffline procesT0; | |
69 | // Make calibration of channels offset | |
63f0f70b | 70 | procesT0.setDArun(179000); |
71 | procesT0.Process("CalibObjects.root",runNumber, runNumber, ocdbStorage); | |
a45764d9 | 72 | |
73 | ||
74 | ||
75 | //TRD part | |
76 | AliTRDPreprocessorOffline procestrd; | |
77 | procestrd.SetLinearFitForVdrift(kTRUE); | |
78 | procestrd.SetMinStatsVdriftT0PH(600*10); | |
79 | procestrd.SetMinStatsVdriftLinear(50); | |
80 | procestrd.SetMinStatsGain(600); | |
1611b277 | 81 | procestrd.SetLimitValidateNoData(60); |
82 | procestrd.SetLimitValidateBadCalib(60); | |
a45764d9 | 83 | procestrd.SetAlternativeDriftVelocityFit(kTRUE); |
84 | procestrd.Init("CalibObjects.root"); | |
85 | Int_t versionVdriftUsed = procestrd.GetVersionVdriftUsed(); | |
86 | Int_t subversionVdriftUsed = procestrd.GetSubVersionVdriftUsed(); | |
87 | Int_t versionGainUsed = procestrd.GetVersionGainUsed(); | |
88 | Int_t subversionGainUsed = procestrd.GetSubVersionGainUsed(); | |
89 | Int_t versionExBUsed = procestrd.GetVersionExBUsed(); | |
90 | Int_t subversionExBUsed = procestrd.GetSubVersionExBUsed(); | |
91 | printf("version and subversion vdrift %d and %d\n",versionVdriftUsed,subversionVdriftUsed); | |
92 | printf("version and subversion gain %d and %d\n",versionGainUsed,subversionGainUsed); | |
93 | printf("version and subversion exb %d and %d\n",versionExBUsed,subversionExBUsed); | |
94 | procestrd.Process("CalibObjects.root",runNumber,runNumber,ocdbStorage); | |
a45764d9 | 95 | |
96 | ||
63f0f70b | 97 | //Mean Vertex |
98 | //AliMeanVertexPreprocessorOffline procesMeanVtx; | |
99 | //procesMeanVtx.ProcessOutput("CalibObjects.root", ocdbStorage, runNumber); | |
357f522b | 100 | |
101 | // | |
102 | // Print calibration status into the stdout | |
103 | // | |
104 | Int_t trdStatus = procestrd.GetStatus(); | |
105 | Int_t tofStatus = calibTask.GetStatus(); | |
63f0f70b | 106 | Int_t tpcStatus = ((procesTPC.ValidateTimeDrift() || procesTPC.ValidateTimeGain())); |
107 | // | |
357f522b | 108 | printf("\n\n\n\n"); |
109 | printf("CPass1 calibration status\n"); | |
110 | printf("TRD calibration status=%d\n",trdStatus); | |
111 | printf("TOF calibration status=%d\n",tofStatus); | |
112 | printf("TPC calibration status=%d\n",tpcStatus); | |
113 | PrintDetectorStatus(); | |
114 | return; | |
115 | } | |
116 | ||
117 | ||
118 | ||
119 | ||
7a569197 | 120 | void PrintDetectorStatus(){ |
357f522b | 121 | // |
122 | // GetStatus for the detector which did not implement GetStatus function: | |
123 | // | |
124 | // AliTOFAnalysisTaskCalibPass0 calibTask; // GetStatus implemented | |
125 | // AliTRDPreprocessorOffline procestrd; // GetStatus implemented | |
126 | // AliTPCPreprocessorOffline proces; // GetStatus not implemented (next release) | |
127 | // // Logical or of the Validation function used instead | |
128 | // | |
129 | // AliMeanVertexPreprocessorOffline procesMeanVtx; // GetStatus not implemented | |
130 | // AliT0PreprocessorOffline procesT0; // GetStatus not implemented | |
131 | // SDDcalib // Not automatic update - Not needed | |
132 | // | |
133 | // CODE TO BE WRITTEN HERE FOR DETECTOT WITHOUT STATUS | |
a45764d9 | 134 | } |