2 .L $ALICE_ROOT/TPC/macros//MakeOCDBDiff.C
5 Bool_t MakeOCDBDiff(const char *ocdb1, const char *ocdb2){
7 // Compare by by byte the content of the OCDB entry
9 // ocdb1 - path to the OCDB file1
10 // ocdb2 - path to the OCDB file2
12 // kTRUE - in case the content of the OCDB object (persistent part) is exactly the same
15 ocdb1="Run188720_192738_v2_s0.root"
16 ocdb1="Run0_188719_v2_s0.root"
17 ocdb2="Run192739_999999999_v2_s0.root"
19 TFile * f1 = TFile::Open(ocdb1);
20 TFile * f2 = TFile::Open(ocdb2);
22 printf("Problem 0: Files not accessible (%s,%s)\n",ocdb1,ocdb2);
25 AliCDBEntry * entry1 = (AliCDBEntry*)f1->Get("AliCDBEntry");
26 AliCDBEntry * entry2 = (AliCDBEntry*)f2->Get("AliCDBEntry");
27 {if (!entry1||!entry2){
28 printf("Problem 1: OCDB entry not available (%s,%s)\n",ocdb1,ocdb2);
31 TObject* object1=entry1->GetObject();
32 TObject* object2=entry2->GetObject();
33 TMessage * file1 = new TMessage(TBuffer::kWrite);
34 file1->WriteObject(object1);
35 Int_t size1=file1->Length();
36 TMessage * file2 = new TMessage(TBuffer::kWrite);
37 file2->WriteObject(object2);
38 Int_t size2=file2->Length();
40 printf("Problem 2: OCDB entry of different size (%d,%d)",size1,size2);
44 for (Int_t i=0; i<size1; i++) if (file1->Buffer()[i]!=file2->Buffer()[i]) countDiff++;
46 printf("Objects are different. %d different bytes\n", countDiff );
49 printf("OCDB Objects are the same\n");
51 TClass *cl1= object1->Class();