]> git.uio.no Git - u/mrichter/AliRoot.git/blob - GRP/UpdateCDBVertexDiamond.C
Default vertex diamond profile (Panos)
[u/mrichter/AliRoot.git] / GRP / UpdateCDBVertexDiamond.C
1 void UpdateCDBVertexDiamond() {
2   // produce the trigger descriptorwith the current AliRoot and store it in the
3   // CDB
4   
5   AliCDBManager* man = AliCDBManager::Instance();
6   man->SetDefaultStorage("local://$ALICE_ROOT");
7   man->SetRun(0);
8   AliCDBId id("GRP/Calib/MeanVertex",0,AliCDBRunRange::Infinity());
9   AliCDBMetaData *metadata= new AliCDBMetaData();
10
11   // Get root version
12   const char* rootv = gROOT->GetVersion();
13
14   // Get AliRoot version from file to set it in the metadata of the entry
15   TFile *fv= TFile::Open("$ALICE_ROOT/CVS/Repository?filetype=raw","READ");
16   Int_t size = fv->GetSize();
17   char *buf = new Char_t[size];
18   memset(buf, '\0', size);
19   fv->Seek(0);
20   char* alirootv;
21   if ( fv->ReadBuffer(buf, size) ) {
22     Printf("Error reading AliRoot version from file to buffer!");
23     alirootv = "";
24   }
25   if(buf=="AliRoot"){
26     alirootv="HEAD";
27   }else{
28     alirootv = buf;
29     metadata->SetResponsible("Tapan Nayak");
30     metadata->SetAliRootVersion(alirootv);
31     metadata->SetComment(Form("Default trigger description produced with root version %s and AliRoot version %s",rootv,alirootv));
32   }
33
34   Printf("Storing in CDB the default trigger description produced with root version %s and AliRoot version %s",rootv,alirootv);
35
36   Double_t position[3] = {0.0,0.0,0.0};
37   Double_t sigma[3] = {0.0,0.0,0.0};
38   AliESDVertex *vertex = new AliESDVertex(position,sigma,"Default");
39   vertex->Print();
40
41   man->Put(vertex,id,metadata);
42 }
43