1 // This macro transfers OCDB data of one single ("detName") or all ALICE detectors from one location to another,
2 // It is possible to set new run range, path etc...
3 // draining "align" objects is in general to be avoided, since those present in the repository might not be updated
4 // some paths might be missing hereafter: this can be checked in advance by means of "listCdbEntries.sh" run on the
5 // starting OCDB folder
6 #if !defined(__CINT__) || defined(__MAKECINT__)
7 #include "AliCDBManager.h"
8 #include "AliCDBStorage.h"
9 #include "AliCDBEntry.h"
15 void CDBToGrid(const char *detName="", const char* fromUri="local://$ALICE_ROOT",
16 const char* toUri="local://newOCDB")
19 AliCDBManager *man = AliCDBManager::Instance();
20 man->SetDefaultStorage(fromUri);
21 AliCDBStorage *dest = man->GetStorage(toUri);
31 calib = man->GetAll("*/Calib/*");
32 //align = man->GetAll("*/Align/Data");
33 config = man->GetAll("*/Config/*");
35 // drain everything, really!
36 //calib = man->GetAll("*");
39 // drain calibration and alignment for detector "detName"
41 TString calibPath = detName;
42 TString alignPath = calibPath;
43 calibPath+="/Calib/*";
44 alignPath+="/Align/Data";
46 //calib = man->GetAll(calibPath);
47 //align = man->GetAll(alignPath);
49 // drain everything, really!
50 calib = man->GetAll(Form("%s/*",detName));
55 Int_t ok=0; TString failed="";
58 for(int i=0;i<calib->GetEntries();i++){
60 entry = (AliCDBEntry*) calib->At(i);
61 entry->GetId().SetRunRange(0,AliCDBRunRange::Infinity());
63 TString path=entry->GetId().GetPath();
65 printf("%s\n",path.Data());
67 if (path == "ITS/Resp/RespSDD") entry->GetId().SetPath("ITS/Calib/RespSDD"); // bug in ITS/Resp/RespSDD
69 if(path == "TOF/Calib/Par" || path == "TOF/Calib/SimPar" || path.Contains("TOF/CDB")) continue;
71 if (dest->Put(entry)) {
74 failed += path.Data(); failed += " ";
77 printf("\n************ CALIB *********** \n");
78 printf("************ Stored %d objects over %d *********** \n", ok, calib->GetEntries());
80 printf("***** List of failed objects: %s \n", failed.Data());
87 for(int i=0;i<align->GetEntries();i++){
89 entry = (AliCDBEntry*) align->At(i);
90 entry->GetId().SetRunRange(0,AliCDBRunRange::Infinity());
91 TString path=entry->GetId().GetPath();
93 if (dest->Put(entry)) {
96 failed += path.Data(); failed += " ";
99 printf("\n************ ALIGN *********** \n");
100 printf("************ Stored %d objects over %d *********** \n", ok, align->GetEntries());
102 printf("***** List of failed objects: %s \n", failed.Data());
108 for(int i=0;i<config->GetEntries();i++){
110 entry = (AliCDBEntry*) config->At(i);
111 entry->GetId().SetRunRange(0,AliCDBRunRange::Infinity());
112 TString path=entry->GetId().GetPath();
114 if (dest->Put(entry)) {
117 failed += path.Data(); failed += " ";
120 printf("\n************ CONFIG *********** \n");
121 printf("************ Stored %d objects over %d *********** \n", ok, config->GetEntries());
123 printf("***** List of failed objects: %s \n", failed.Data());