2 AliCDBStorage *storLoc;
3 AliCDBStorage *storGrid;
4 AliCDBEntry *entry = 0;
5 AliTRDCalPad *calobj = 0;
6 AliTRDCalROC *calobjROC = 0;
11 // Single instance of AliCDBManager.
12 AliCDBManager *man = AliCDBManager::Instance();
14 printf("\nTRD :: Activating Local storage...\n");
15 storLoc = man->GetStorage("local://DBLocal");
17 // Create the new database object
18 AliTRDCalPad *calVdrift = new AliTRDCalPad("Vdrift","TRD drift velocities");
19 AliTRDCalROC *calROCVdrift = calVdrift->GetCalROC(0,2,0);
20 calROCVdrift->SetValue(1,1,1.50);
21 calROCVdrift->SetValue(2,2,1.55);
22 calROCVdrift->SetValue(3,3,1.60);
24 // Id of the object: AliCDBId("name", firstRun, lastRun)
25 AliCDBId id1("TRD/Calib/Vdrift",0,10);
27 // MetaData describing the object
28 AliCDBMetaData *md1= new AliCDBMetaData();
29 md1->SetObjectClassName("AliTRDCalPad");
30 md1->SetResponsible("Christoph Blume");
31 md1->SetBeamPeriod(1);
32 md1->SetAliRootVersion("05-04-00"); //root version
33 md1->SetComment("This is a Vdrift test");
34 TObjString *strVdrift = new TObjString("Drift velocities for 540 chambers");
35 md1->SetProperty("key1",strVdrift);
37 // Store the object into local storage
38 // Filename: DBLocal/TRD/Calib/Vdrift/Run0_10_v0_s0.root
39 printf("\nTRD :: Storing object into local storage...\n");
40 storLoc->Put(calVdrift,id1,md1);
42 // Read, update, store again
43 printf("\nTRD :: Retrieve object from local storage...\n");
44 entry = storLoc->Get("TRD/Calib/Vdrift",5);
46 calobj = (AliTRDCalPad *) entry->GetObject();
47 calobjROC = calobj->GetCalROC(0,2,0);
48 printf("\nTRD :: Drift velocities (1): %f (1,1), %f (2,2), %f (3.3)\n"
49 ,calobjROC->GetValue(1,1)
50 ,calobjROC->GetValue(2,2)
51 ,calobjROC->GetValue(3,3));
54 calobjROC->SetValue(1,1,1.60);
55 calobjROC->SetValue(2,2,1.35);
56 calobjROC->SetValue(3,3,1.10);
58 // Store into local: filename = Run0_10_v0_s1.root
59 printf("\nTRD :: Storing object into local storage...\n");
62 // Read, update, store again
63 printf("\nTRD :: Retrieve object from local storage...\n");
64 entry = storLoc->Get("TRD/Calib/Vdrift",5);
65 entry = storLoc->Get("TRD/Calib/Vdrift",5);
66 entry = storLoc->Get("TRD/Calib/Vdrift",5);
68 calobj = (AliTRDCalPad *) entry->GetObject();
69 calobjROC = calobj->GetCalROC(0,2,0);
70 printf("\nTRD :: Drift velocities (2): %f (1,1), %f (2,2), %f (3.3)\n"
71 ,calobjROC->GetValue(1,1)
72 ,calobjROC->GetValue(2,2)
73 ,calobjROC->GetValue(3,3));
75 printf("\nTRD :: Activating GRID storage...\n");
77 storGrid = man->GetStorage("alien://aliendb4.cern.ch:9000;cblume;DBGrid;ALICE::CERN::se01");
79 printf("\nTRD :: Failure in activating GRID storage...\n");
82 // Store into GRID: filename = DBGrid/TRD/Calib/Vdrift/Run0_10_v1.root
88 cout << entry->IsOwner() << endl;
90 AliCDBManager::Instance()->Destroy();