Default vertex diamond profile (Panos)
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 23 Aug 2007 13:05:21 +0000 (13:05 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 23 Aug 2007 13:05:21 +0000 (13:05 +0000)
GRP/Calib/MeanVertex/Run0_999999999_v0_s0.root [new file with mode: 0644]
GRP/UpdateCDBVertexDiamond.C [new file with mode: 0644]

diff --git a/GRP/Calib/MeanVertex/Run0_999999999_v0_s0.root b/GRP/Calib/MeanVertex/Run0_999999999_v0_s0.root
new file mode 100644 (file)
index 0000000..e32fd66
Binary files /dev/null and b/GRP/Calib/MeanVertex/Run0_999999999_v0_s0.root differ
diff --git a/GRP/UpdateCDBVertexDiamond.C b/GRP/UpdateCDBVertexDiamond.C
new file mode 100644 (file)
index 0000000..d977a69
--- /dev/null
@@ -0,0 +1,43 @@
+void UpdateCDBVertexDiamond() {
+  // produce the trigger descriptorwith the current AliRoot and store it in the
+  // CDB
+  
+  AliCDBManager* man = AliCDBManager::Instance();
+  man->SetDefaultStorage("local://$ALICE_ROOT");
+  man->SetRun(0);
+  AliCDBId id("GRP/Calib/MeanVertex",0,AliCDBRunRange::Infinity());
+  AliCDBMetaData *metadata= new AliCDBMetaData();
+
+  // Get root version
+  const char* rootv = gROOT->GetVersion();
+
+  // Get AliRoot version from file to set it in the metadata of the entry
+  TFile *fv= TFile::Open("$ALICE_ROOT/CVS/Repository?filetype=raw","READ");
+  Int_t size = fv->GetSize();
+  char *buf = new Char_t[size];
+  memset(buf, '\0', size);
+  fv->Seek(0);
+  char* alirootv;
+  if ( fv->ReadBuffer(buf, size) ) {
+    Printf("Error reading AliRoot version from file to buffer!");
+    alirootv = "";
+  }
+  if(buf=="AliRoot"){
+    alirootv="HEAD";
+  }else{
+    alirootv = buf;
+    metadata->SetResponsible("Tapan Nayak");
+    metadata->SetAliRootVersion(alirootv);
+    metadata->SetComment(Form("Default trigger description produced with root version %s and AliRoot version %s",rootv,alirootv));
+  }
+
+  Printf("Storing in CDB the default trigger description produced with root version %s and AliRoot version %s",rootv,alirootv);
+
+  Double_t position[3] = {0.0,0.0,0.0};
+  Double_t sigma[3] = {0.0,0.0,0.0};
+  AliESDVertex *vertex = new AliESDVertex(position,sigma,"Default");
+  vertex->Print();
+
+  man->Put(vertex,id,metadata);
+}
+