]>
Commit | Line | Data |
---|---|---|
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 | ||
00cb53f4 | 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) { |
e83a0426 | 15 | // produce the mean vertex with the current AliRoot and store it in the |
b2eb2c8f | 16 | // CDB |
17 | ||
18 | AliCDBManager* man = AliCDBManager::Instance(); | |
162637e4 | 19 | man->SetDefaultStorage("local://$ALICE_ROOT/OCDB"); |
b2eb2c8f | 20 | man->SetRun(0); |
21 | AliCDBId id("GRP/Calib/MeanVertex",0,AliCDBRunRange::Infinity()); | |
e83a0426 | 22 | AliCDBId idTPC("GRP/Calib/MeanVertexTPC",0,AliCDBRunRange::Infinity()); |
f2a195c1 | 23 | AliCDBId idSPD("GRP/Calib/MeanVertexSPD",0,AliCDBRunRange::Infinity()); |
b2eb2c8f | 24 | AliCDBMetaData *metadata= new AliCDBMetaData(); |
25 | ||
e83a0426 | 26 | // Get root and AliRoot versions |
b2eb2c8f | 27 | const char* rootv = gROOT->GetVersion(); |
e83a0426 | 28 | TString av(ALIROOT_SVN_BRANCH); |
29 | Int_t revnum = ALIROOT_SVN_REVISION; | |
30 | ||
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)); | |
35 | ||
b2eb2c8f | 36 | |
e83a0426 | 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)); | |
b2eb2c8f | 39 | |
00cb53f4 | 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) | |
6920cd28 | 42 | Double_t sigma[3],position[3]; |
43 | position[0]=xmed; | |
44 | position[1]=ymed; | |
45 | position[2]=0.; | |
46 | sigma[0]=TMath::Sqrt(sigx*sigx+resolx*resolx); | |
47 | sigma[1]=TMath::Sqrt(sigy*sigy+resoly*resoly); | |
48 | sigma[2]=sigz; | |
49 | ||
50 | AliESDVertex *vertex = new AliESDVertex(position,sigma,"vtxmean"); | |
51 | vertex->PrintStatus(); | |
b2eb2c8f | 52 | |
53 | man->Put(vertex,id,metadata); | |
e83a0426 | 54 | |
55 | position[0]=xmed; | |
56 | position[1]=ymed; | |
57 | position[2]=0.; | |
58 | sigma[0]=TMath::Sqrt(sigx*sigx+resolx*resolx); | |
59 | sigma[1]=TMath::Sqrt(sigy*sigy+resoly*resoly); | |
60 | sigma[2]=sigz; | |
61 | ||
62 | AliESDVertex *vertexTPC = new AliESDVertex(position,sigma,"vtxmean"); | |
63 | vertexTPC->PrintStatus(); | |
64 | ||
65 | man->Put(vertexTPC,idTPC,metadata); | |
66 | ||
f2a195c1 | 67 | position[0]=xmed; |
68 | position[1]=ymed; | |
69 | position[2]=0.; | |
70 | sigma[0]=TMath::Sqrt(sigx*sigx+resolx*resolx); | |
71 | sigma[1]=TMath::Sqrt(sigy*sigy+resoly*resoly); | |
72 | sigma[2]=sigz; | |
73 | ||
74 | AliESDVertex *vertexSPD = new AliESDVertex(position,sigma,"vtxmean"); | |
75 | vertexSPD->PrintStatus(); | |
76 | ||
77 | man->Put(vertexSPD,idSPD,metadata); | |
78 | ||
e83a0426 | 79 | |
80 | ||
b2eb2c8f | 81 | } |
82 | ||
e83a0426 | 83 | |
84 |