Fixes for coverity.
[u/mrichter/AliRoot.git] / STEER / CreateMeanVertex.C
CommitLineData
7e3468ff 1void CreateMeanVertex(Double_t xmed=0., Double_t ymed=0., Double_t sigx=0.005,Double_t sigy=0.005, Double_t sigz=5.3){
2 Double_t resolx=35./10000.;
3 Double_t resoly=35./10000.;
4 Double_t sigma[3],position[3];
5 position[0]=xmed;
6 position[1]=ymed;
7 position[2]=0.;
8 sigma[0]=TMath::Sqrt(sigx*sigx+resolx*resolx);
9 sigma[1]=TMath::Sqrt(sigy*sigy+resoly*resoly);
10 sigma[2]=sigz;
11 AliESDVertex *vave=new AliESDVertex(position,sigma,"vtxmean");
12 vave->PrintStatus();
13
14 AliCDBManager* man = AliCDBManager::Instance();
162637e4 15 man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
7e3468ff 16
17 AliCDBId id("GRP/Calib/MeanVertex", 0, AliCDBRunRange::Infinity());
18 AliCDBMetaData md;
19
20 md.SetResponsible("prino@to.infn.it");
21 md.SetComment("Default mean vertex position");
22 md.SetAliRootVersion("Default mean vertex position");
23
24 man->Put(vave, id, &md);
25
26 man->Destroy();
27
28// TFile *outf=new TFile("AliESDMeanVertex.root","recreate");
29// outf->cd();
30// vave->Write();
31// outf->Close();
32}