Fixing small memory leaks (Hans)
[u/mrichter/AliRoot.git] / TOF / ReadMeanVertexFromOCDB.C
CommitLineData
aee86d6d 1AliESDVertex *
2ReadMeanVertexFromOCDB(Int_t runNb, const Char_t* type = "MeanVertex")
3{
4
5 AliCDBManager *cdb = AliCDBManager::Instance();
6 cdb->SetDefaultStorage("raw://");
7 cdb->SetRun(runNb);
8 AliCDBEntry *cdbe = cdb->Get(Form("GRP/Calib/%s", type));
9 AliESDVertex *vertex = (AliESDVertex *)cdbe->GetObject();
10 Double_t vmean[3], vsigma[3];
11 vertex->GetXYZ(vmean);
12 vertex->GetSigmaXYZ(vsigma);
13 printf("vertex in run %d: z_mean = %f, z_sigma = %f\n", runNb, vmean[2], vsigma[2]);
14 return vertex;
15}