X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=GRP%2FUpdateCDBVertexDiamond.C;h=c34acd0ef7b930cbb761ff7a9f65d1c3e5c22cd3;hb=32d432960540cc2372ebcf8fc674bd398e1cd26c;hp=28035a83f8bb2e2301e841531b2fbda26d7abda1;hpb=162637e45086576ffcf0568d28fa43359819765a;p=u%2Fmrichter%2FAliRoot.git diff --git a/GRP/UpdateCDBVertexDiamond.C b/GRP/UpdateCDBVertexDiamond.C index 28035a83f8b..c34acd0ef7b 100644 --- a/GRP/UpdateCDBVertexDiamond.C +++ b/GRP/UpdateCDBVertexDiamond.C @@ -11,7 +11,64 @@ #include "AliLog.h" #endif -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) { +void UpdateCDBVertexDiamond(const char* objName, Double_t xmed, Double_t ymed, Double_t zmed, Double_t sigx, Double_t sigy, Double_t sigz) { + // produce the mean vertex with the current AliRoot and store it in the + // CDB + // andrea.dainese@pd.infn.it + + AliCDBManager* man = AliCDBManager::Instance(); + if(!gSystem->Getenv("STORAGE")){ + man->SetDefaultStorage("local://$ALICE_ROOT/OCDB"); + }else{ + man->SetDefaultStorage(gSystem->Getenv("STORAGE")); + } + + Int_t firstRun=0; + if(gSystem->Getenv("FIRSTRUN")) firstRun=TString(gSystem->Getenv("FIRSTRUN")).Atoi(); + Int_t lastRun=AliCDBRunRange::Infinity(); + if(gSystem->Getenv("LASTRUN")) lastRun=TString(gSystem->Getenv("LASTRUN")).Atoi(); + TString objFullName="GRP/Calib/"; + + if(objName=="MeanVertex" || objName=="MeanVertexSPD" || objName=="MeanVertexTPC"){ + objFullName += objName; + }else{ + Printf("\"%s\" is not a valid calibration object. Exiting!",objName); + return; + } + AliCDBId id(objFullName.Data(),firstRun,lastRun); + AliCDBMetaData *metadata= new AliCDBMetaData(); + + // Get root and AliRoot versions + const char* rootv = gROOT->GetVersion(); + TString av(ALIROOT_BRANCH); + TString revnum(ALIROOT_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 %s",rootv,av.Data(),revnum)); + + + Printf(Form("Storing in CDB the default mean vertex produced with root version %s and" + "AliRoot version %s, revision number %s", rootv, av.Data(), revnum)); + + Double_t sigma[3],position[3]; + position[0]=xmed; + position[1]=ymed; + position[2]=zmed; + sigma[0]=sigx; + sigma[1]=sigy; + sigma[2]=sigz; + + AliESDVertex *vertex = new AliESDVertex(position,sigma,"vtxmean"); + vertex->PrintStatus(); + + man->Put(vertex,id,metadata); + +} + + +void UpdateCDBVertexDiamondOld(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 @@ -25,17 +82,17 @@ void UpdateCDBVertexDiamond(Double_t xmed = 0., Double_t ymed = 0., Double_t sig // Get root and AliRoot versions const char* rootv = gROOT->GetVersion(); - TString av(ALIROOT_SVN_BRANCH); - Int_t revnum = ALIROOT_SVN_REVISION; + TString av(ALIROOT_BRANCH); + TString revnum(ALIROOT_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)); + metadata->SetComment(Form("Default mean vertex produced with root version %s and AliRoot %s, revision number %s",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)); + "AliRoot version %s, revision number %s", rootv, av.Data(), revnum)); 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)