2 // This macro transfers OCDB data of one single ("detName") or all ALICE detectors from one location to another,
3 // It is possible to set new run range, path etc...
5 void CDBToGrid(const char *detName="", const char* fromUri="local://$ALICE_ROOT",
6 const char* toUri="local://newOCDB")
9 AliCDBManager *man = AliCDBManager::Instance();
11 man->SetDefaultStorage(fromUri);
13 AliCDBStorage *dest = man->GetStorage(toUri);
24 //calib = man->GetAll("*/Calib/*");
25 //align = man->GetAll("*/Align/Data");
26 //recpar = man->GetAll("*/RecParam/*");
27 //config = man->GetAll("*/Config/*");
29 // drain everything, really!
30 calib = man->GetAll("*");
33 // drain calibration and alignment for detector "detName"
35 TString calibPath = detName;
36 TString alignPath = calibPath;
37 calibPath+="/Calib/*";
38 alignPath+="/Align/Data";
40 //calib = man->GetAll(calibPath);
41 //align = man->GetAll(alignPath);
43 // drain everything, really!
44 calib = man->GetAll(Form("%s/*",detName.Data()));
49 Int_t ok=0; TString failed="";
52 for(int i=0;i<calib->GetEntries();i++){
54 entry = (AliCDBEntry*) calib->At(i);
55 entry->GetId().SetRunRange(0,999999999);
57 TString path=entry->GetId().GetPath();
59 cout << path.Data() << endl;
61 if (path == "ITS/Resp/RespSDD") entry->GetId().SetPath("ITS/Calib/RespSDD"); // bug in ITS/Resp/RespSDD
63 if(path == "TOF/Calib/Par" || path == "TOF/Calib/SimPar" || path.Contains("TOF/CDB")) continue;
65 if (dest->Put(entry)) {
68 failed += path.Data(); failed += " ";
71 printf("\n************ CALIB *********** \n");
72 printf("************ Stored %d objects over %d *********** \n", ok, calib->GetEntries());
74 printf("***** List of failed objects: %s \n", failed.Data());
81 for(int i=0;i<align->GetEntries();i++){
83 entry = (AliCDBEntry*) align->At(i);
84 entry->GetId().SetRunRange(0,999999999);
85 TString path=entry->GetId().GetPath();
87 if (dest->Put(entry)) {
90 failed += path.Data(); failed += " ";
93 printf("\n************ ALIGN *********** \n");
94 printf("************ Stored %d objects over %d *********** \n", ok, align->GetEntries());
96 printf("***** List of failed objects: %s \n", failed.Data());
102 for(int i=0;i<recpar->GetEntries();i++){
104 entry = (AliCDBEntry*) recpar->At(i);
105 entry->GetId().SetRunRange(0,999999999);
106 TString path=entry->GetId().GetPath();
108 if (dest->Put(entry)) {
111 failed += path.Data(); failed += " ";
114 printf("\n************ RECPAR *********** \n");
115 printf("************ Stored %d objects over %d *********** \n", ok, recpar->GetEntries());
117 printf("***** List of failed objects: %s \n", failed.Data());
123 for(int i=0;i<config->GetEntries();i++){
125 entry = (AliCDBEntry*) config->At(i);
126 entry->GetId().SetRunRange(0,999999999);
127 TString path=entry->GetId().GetPath();
129 if (dest->Put(entry)) {
132 failed += path.Data(); failed += " ";
135 printf("\n************ CONFIG *********** \n");
136 printf("************ Stored %d objects over %d *********** \n", ok, config->GetEntries());
138 printf("***** List of failed objects: %s \n", failed.Data());