AliRoot Core  edcc906 (edcc906)
MakeOCDBDiff.C
Go to the documentation of this file.
1 
7 Bool_t MakeOCDBDiff(const char *ocdb1, const char *ocdb2){
15 
16  /*
17  ocdb1="Run188720_192738_v2_s0.root"
18  ocdb1="Run0_188719_v2_s0.root"
19  ocdb2="Run192739_999999999_v2_s0.root"
20  */
21  TFile * f1 = TFile::Open(ocdb1);
22  TFile * f2 = TFile::Open(ocdb2);
23  {if (!f1 || !f2){
24  printf("Problem 0: Files not accessible (%s,%s)\n",ocdb1,ocdb2);
25  return kFALSE;
26  }}
27  AliCDBEntry * entry1 = (AliCDBEntry*)f1->Get("AliCDBEntry");
28  AliCDBEntry * entry2 = (AliCDBEntry*)f2->Get("AliCDBEntry");
29  {if (!entry1||!entry2){
30  printf("Problem 1: OCDB entry not available (%s,%s)\n",ocdb1,ocdb2);
31  return kFALSE;
32  }}
33  TObject* object1=entry1->GetObject();
34  TObject* object2=entry2->GetObject();
35  TMessage * file1 = new TMessage(TBuffer::kWrite);
36  file1->WriteObject(object1);
37  Int_t size1=file1->Length();
38  TMessage * file2 = new TMessage(TBuffer::kWrite);
39  file2->WriteObject(object2);
40  Int_t size2=file2->Length();
41  {if (size1!=size2){
42  printf("Problem 2: OCDB entry of different size (%d,%d)",size1,size2);
43  return kFALSE;
44  }}
45  Int_t countDiff=0;
46  for (Int_t i=0; i<size1; i++) if (file1->Buffer()[i]!=file2->Buffer()[i]) countDiff++;
47  {if (countDiff>0){
48  printf("Objects are different. %d different bytes\n", countDiff );
49  return kFALSE;
50  }}
51  printf("OCDB Objects are the same\n");
52 
53  TClass *cl1= object1->Class();
54 
55 
56  return kTRUE;
57 }
printf("Chi2/npoints = %f\n", TMath::Sqrt(chi2/npoints))
TFile * Open(const char *filename, Long64_t &nevents)
Bool_t MakeOCDBDiff(const char *ocdb1, const char *ocdb2)
Definition: MakeOCDBDiff.C:7
TObject * GetObject()
Definition: AliCDBEntry.h:56
Definition: AliCDBEntry.h:18