]> git.uio.no Git - u/mrichter/AliRoot.git/blob - GRP/UpdateCDBVertexDiamond.C
Updated list of cosmic trigger classes (as sent by Federico A.). To be sent to Raffae...
[u/mrichter/AliRoot.git] / GRP / UpdateCDBVertexDiamond.C
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
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
16   // CDB
17   
18   AliCDBManager* man = AliCDBManager::Instance();
19   man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
20   man->SetRun(0);
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();
25
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;
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   
36
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));
39
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];
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();
52
53   man->Put(vertex,id,metadata);
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
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
79
80
81 }
82
83
84