X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=blobdiff_plain;f=GRP%2FUpdateCDBVertexDiamond.C;h=026b2d039f2b9fd21993bc4d1ec50d91fc087598;hp=d977a69c1890d9b61145b89b05e8415841fa99d2;hb=e83a0426c4670765500d1de656c22c3d7cb8408c;hpb=b2eb2c8f2dab76acf111b31e2515978861a03a4c diff --git a/GRP/UpdateCDBVertexDiamond.C b/GRP/UpdateCDBVertexDiamond.C index d977a69c189..026b2d039f2 100644 --- a/GRP/UpdateCDBVertexDiamond.C +++ b/GRP/UpdateCDBVertexDiamond.C @@ -1,43 +1,71 @@ -void UpdateCDBVertexDiamond() { - // produce the trigger descriptorwith the current AliRoot and store it in the +#include "ARVersion.h" +#if !defined(__CINT__) || defined(__MAKECINT__) +#include "AliCDBManager.h" +#include "AliCDBStorage.h" +#include "AliCDBId.h" +#include "AliCDBMetaData.h" +#include "AliESDVertex.h" +#include +#include "AliRun.h" +#include +#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) { + // produce the mean vertex with 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()); + AliCDBId idTPC("GRP/Calib/MeanVertexTPC",0,AliCDBRunRange::Infinity()); AliCDBMetaData *metadata= new AliCDBMetaData(); - // Get root version + // Get root and AliRoot versions const char* rootv = gROOT->GetVersion(); + TString av(ALIROOT_SVN_BRANCH); + Int_t revnum = ALIROOT_SVN_REVISION; + + metadata->SetResponsible("prino@to.infn.it"); + metadata->SetComment("Default mean vertex position"); + metadata->SetAliRootVersion(av.Data()); + metadata->SetComment(Form("Default mean vertex produced with root version %s and AliRoot %s, revision number %d",rootv,av.Data(),revnum)); + + + 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)); - // 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(); + Double_t resolx=35./10000.; + Double_t resoly=35./10000.; + Double_t sigma[3],position[3]; + 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 *vertex = new AliESDVertex(position,sigma,"vtxmean"); + vertex->PrintStatus(); man->Put(vertex,id,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 *vertexTPC = new AliESDVertex(position,sigma,"vtxmean"); + vertexTPC->PrintStatus(); + + man->Put(vertexTPC,idTPC,metadata); + + + } + +