2 #if !defined(__CINT__) || defined(__MAKECINT__)
3 #include "AliCDBManager.h"
4 #include "AliCDBStorage.h"
6 #include "AliCDBMetaData.h"
7 #include "AliESDVertex.h"
14 void UpdateCDBVertexDiamond(Double_t xmed = 0., Double_t ymed = 0., Double_t sigx = 0.0060, Double_t sigy = 0.0060, Double_t sigz = 3.8) {
15 // produce the mean vertex with the current AliRoot and store it in the
18 AliCDBManager* man = AliCDBManager::Instance();
19 man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
21 AliCDBId id("GRP/Calib/MeanVertex",0,AliCDBRunRange::Infinity());
22 AliCDBId idTPC("GRP/Calib/MeanVertexTPC",0,AliCDBRunRange::Infinity());
23 AliCDBId idSPD("GRP/Calib/MeanVertexSPD",0,AliCDBRunRange::Infinity());
24 AliCDBMetaData *metadata= new AliCDBMetaData();
26 // Get root and AliRoot versions
27 const char* rootv = gROOT->GetVersion();
28 TString av(ALIROOT_SVN_BRANCH);
29 Int_t revnum = ALIROOT_SVN_REVISION;
31 metadata->SetResponsible("prino@to.infn.it");
32 metadata->SetComment("Default mean vertex position");
33 metadata->SetAliRootVersion(av.Data());
34 metadata->SetComment(Form("Default mean vertex produced with root version %s and AliRoot %s, revision number %d",rootv,av.Data(),revnum));
37 Printf(Form("Storing in CDB the default mean vertex produced with root version %s and"
38 "AliRoot version %s, revision number %d", rootv, av.Data(), revnum));
40 Double_t resolx=5./10000.; // this is error on the weighted mean (5 micron)
41 Double_t resoly=5./10000.; // this is error on the weighted mean (5 micron)
42 Double_t sigma[3],position[3];
46 sigma[0]=TMath::Sqrt(sigx*sigx+resolx*resolx);
47 sigma[1]=TMath::Sqrt(sigy*sigy+resoly*resoly);
50 AliESDVertex *vertex = new AliESDVertex(position,sigma,"vtxmean");
51 vertex->PrintStatus();
53 man->Put(vertex,id,metadata);
58 sigma[0]=TMath::Sqrt(sigx*sigx+resolx*resolx);
59 sigma[1]=TMath::Sqrt(sigy*sigy+resoly*resoly);
62 AliESDVertex *vertexTPC = new AliESDVertex(position,sigma,"vtxmean");
63 vertexTPC->PrintStatus();
65 man->Put(vertexTPC,idTPC,metadata);
70 sigma[0]=TMath::Sqrt(sigx*sigx+resolx*resolx);
71 sigma[1]=TMath::Sqrt(sigy*sigy+resoly*resoly);
74 AliESDVertex *vertexSPD = new AliESDVertex(position,sigma,"vtxmean");
75 vertexSPD->PrintStatus();
77 man->Put(vertexSPD,idSPD,metadata);