Removing AliPHOSEMCAGeometry and AliPHOSCPVGeometry from libPHOSUtils, they belond...
[u/mrichter/AliRoot.git] / GRP / UpdateCDBVertexDiamond.C
CommitLineData
e83a0426 1#include "ARVersion.h"
2#if !defined(__CINT__) || defined(__MAKECINT__)
3#include "AliCDBManager.h"
4#include "AliCDBStorage.h"
5#include "AliCDBId.h"
6#include "AliCDBMetaData.h"
7#include "AliESDVertex.h"
8#include <TROOT.h>
9#include "AliRun.h"
10#include <TString.h>
11#include "AliLog.h"
12#endif
13
6920cd28 14void UpdateCDBVertexDiamond(Double_t xmed = 0., Double_t ymed = 0., Double_t sigx = 0.005, Double_t sigy = 0.005, Double_t sigz = 5.3) {
e83a0426 15 // produce the mean vertex with the current AliRoot and store it in the
b2eb2c8f 16 // CDB
17
18 AliCDBManager* man = AliCDBManager::Instance();
19 man->SetDefaultStorage("local://$ALICE_ROOT");
20 man->SetRun(0);
21 AliCDBId id("GRP/Calib/MeanVertex",0,AliCDBRunRange::Infinity());
e83a0426 22 AliCDBId idTPC("GRP/Calib/MeanVertexTPC",0,AliCDBRunRange::Infinity());
b2eb2c8f 23 AliCDBMetaData *metadata= new AliCDBMetaData();
24
e83a0426 25 // Get root and AliRoot versions
b2eb2c8f 26 const char* rootv = gROOT->GetVersion();
e83a0426 27 TString av(ALIROOT_SVN_BRANCH);
28 Int_t revnum = ALIROOT_SVN_REVISION;
29
30 metadata->SetResponsible("prino@to.infn.it");
31 metadata->SetComment("Default mean vertex position");
32 metadata->SetAliRootVersion(av.Data());
33 metadata->SetComment(Form("Default mean vertex produced with root version %s and AliRoot %s, revision number %d",rootv,av.Data(),revnum));
34
b2eb2c8f 35
e83a0426 36 Printf(Form("Storing in CDB the default mean vertex produced with root version %s and"
37 "AliRoot version %s, revision number %d", rootv, av.Data(), revnum));
b2eb2c8f 38
6920cd28 39 Double_t resolx=35./10000.;
40 Double_t resoly=35./10000.;
41 Double_t sigma[3],position[3];
42 position[0]=xmed;
43 position[1]=ymed;
44 position[2]=0.;
45 sigma[0]=TMath::Sqrt(sigx*sigx+resolx*resolx);
46 sigma[1]=TMath::Sqrt(sigy*sigy+resoly*resoly);
47 sigma[2]=sigz;
48
49 AliESDVertex *vertex = new AliESDVertex(position,sigma,"vtxmean");
50 vertex->PrintStatus();
b2eb2c8f 51
52 man->Put(vertex,id,metadata);
e83a0426 53
54 position[0]=xmed;
55 position[1]=ymed;
56 position[2]=0.;
57 sigma[0]=TMath::Sqrt(sigx*sigx+resolx*resolx);
58 sigma[1]=TMath::Sqrt(sigy*sigy+resoly*resoly);
59 sigma[2]=sigz;
60
61 AliESDVertex *vertexTPC = new AliESDVertex(position,sigma,"vtxmean");
62 vertexTPC->PrintStatus();
63
64 man->Put(vertexTPC,idTPC,metadata);
65
66
67
b2eb2c8f 68}
69
e83a0426 70
71