]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - GRP/UpdateCDBVertexDiamond.C
recMC.C submitMC.sh
[u/mrichter/AliRoot.git] / GRP / UpdateCDBVertexDiamond.C
index 026b2d039f2b9fd21993bc4d1ec50d91fc087598..28035a83f8bb2e2301e841531b2fbda26d7abda1 100644 (file)
 #include "AliLog.h"
 #endif
 
-void UpdateCDBVertexDiamond(Double_t xmed = 0., Double_t ymed = 0., Double_t sigx = 0.005, Double_t sigy = 0.005, Double_t sigz = 5.3) {
+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) {
   // produce the mean vertex with the current AliRoot and store it in the
   // CDB
   
   AliCDBManager* man = AliCDBManager::Instance();
-  man->SetDefaultStorage("local://$ALICE_ROOT");
+  man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
   man->SetRun(0);
   AliCDBId id("GRP/Calib/MeanVertex",0,AliCDBRunRange::Infinity());
   AliCDBId idTPC("GRP/Calib/MeanVertexTPC",0,AliCDBRunRange::Infinity());
+  AliCDBId idSPD("GRP/Calib/MeanVertexSPD",0,AliCDBRunRange::Infinity());
   AliCDBMetaData *metadata= new AliCDBMetaData();
 
   // Get root and AliRoot versions
@@ -36,8 +37,8 @@ void UpdateCDBVertexDiamond(Double_t xmed = 0., Double_t ymed = 0., Double_t sig
   Printf(Form("Storing in CDB the default mean vertex produced with root version %s and"
                          "AliRoot version %s, revision number %d", rootv, av.Data(), revnum));
 
-  Double_t resolx=35./10000.;
-  Double_t resoly=35./10000.;
+  Double_t resolx=5./10000.; // this is error on the weighted mean (5 micron) 
+  Double_t resoly=5./10000.; // this is error on the weighted mean (5 micron)
   Double_t sigma[3],position[3];
   position[0]=xmed;
   position[1]=ymed;
@@ -63,6 +64,18 @@ void UpdateCDBVertexDiamond(Double_t xmed = 0., Double_t ymed = 0., Double_t sig
 
   man->Put(vertexTPC,idTPC,metadata);
 
+  position[0]=xmed;
+  position[1]=ymed;
+  position[2]=0.;
+  sigma[0]=TMath::Sqrt(sigx*sigx+resolx*resolx);
+  sigma[1]=TMath::Sqrt(sigy*sigy+resoly*resoly);
+  sigma[2]=sigz;
+
+  AliESDVertex *vertexSPD = new AliESDVertex(position,sigma,"vtxmean");
+  vertexSPD->PrintStatus();
+
+  man->Put(vertexSPD,idSPD,metadata);
+
 
 
 }