]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/CDBToGrid.C
Change from Int_t/SHort_t to smaller data types, the change from Float_t/Double_t...
[u/mrichter/AliRoot.git] / STEER / CDBToGrid.C
1
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... 
4
5 void CDBToGrid(const char *detName="", const char* fromUri="local://$ALICE_ROOT", 
6         const char* toUri="local://newOCDB"){
7
8 AliCDBManager *man = AliCDBManager::Instance();
9
10 man->SetDefaultStorage(fromUri);
11
12 AliCDBStorage *dest = man->GetStorage(toUri);
13
14 man->SetRun(0);
15
16 if(detName == ""){
17 // drain everything
18         TList *calib = man->GetAll("*/Calib/*");
19         TList *align = man->GetAll("*/Align/Data");
20 } else {
21 // drain calibration and aliignment for detector "detName"
22
23         TString calibPath = detName;
24         TString alignPath = calibPath;
25         calibPath+="/Calib/*";
26         alignPath+="/Align/Data";
27
28         TList *calib = man->GetAll(calibPath);
29         TList *align = man->GetAll(alignPath);
30 }
31
32 AliCDBEntry *entry;
33 for(int i=0;i<calib->GetEntries();i++){
34
35         entry = (AliCDBEntry*) calib->At(i);
36         
37         // change run range
38         entry->GetId().SetRunRange(0,999999999);
39
40         TString path=entry->GetId().GetPath();
41         if (path == "ITS/Resp/RespSDD") entry->GetId().SetPath("ITS/Calib/RespSDD"); // bug in ITS/Resp/RespSDD
42
43         dest->Put(entry);
44 }
45
46  
47 for(int i=0;i<align->GetEntries();i++){
48         entry = (AliCDBEntry*) align->At(i);
49         entry->GetId().SetRunRange(0,999999999);
50         dest->Put(entry);
51 }
52
53
54 man->Destroy();
55
56 }