]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSOnlineCalibrationSPDhandler.cxx
macros with recent trigger
[u/mrichter/AliRoot.git] / ITS / AliITSOnlineCalibrationSPDhandler.cxx
index e9c97ed011a8f0f081333c28c00cd85432e6a99f..dfc46cb80ca1a32465ac334c5eb6fe1ff8f5df31 100644 (file)
@@ -13,6 +13,7 @@
 
 #include "AliITSOnlineCalibrationSPDhandler.h"
 #include "AliITSOnlineCalibrationSPD.h"
+#include "AliITSTriggerConditions.h"
 #include "AliITSIntMap.h"
 #include <TObjArray.h>
 #include <TArrayI.h>
 #endif
 
 /* $Id$ */
+
 //____________________________________________________________________________________________
 AliITSOnlineCalibrationSPDhandler::AliITSOnlineCalibrationSPDhandler():
-  fFileLocation(".")
+  fFileLocation("."),
+  fTriggerConditions(0)
 {
   // constructor
   for (UInt_t gloChip=0; gloChip<1200; gloChip++) {
@@ -44,7 +47,8 @@ AliITSOnlineCalibrationSPDhandler::AliITSOnlineCalibrationSPDhandler():
 }
 //____________________________________________________________________________________________
 AliITSOnlineCalibrationSPDhandler::AliITSOnlineCalibrationSPDhandler(const AliITSOnlineCalibrationSPDhandler& handle): 
-  fFileLocation(".")
+  fFileLocation("."),
+  fTriggerConditions(handle.fTriggerConditions)
 {
   // copy constructor
   for (UInt_t gloChip=0; gloChip<1200; gloChip++) {
@@ -248,15 +252,15 @@ Bool_t AliITSOnlineCalibrationSPDhandler::ReadDeadFromFileName(const char *fileN
          UInt_t row = GetRowFromKey(key);
          SetDeadPixel(eq,hs,chip,col,row);
        }
-       UInt_t eq = calib->GetEqNr();
-       if (calib->IsDeadEq()) SetDeadEq(eq);
-       else                   SetDeadEq(eq,kFALSE);
+       UInt_t eq1 = calib->GetEqNr();
+       if (calib->IsDeadEq()) SetDeadEq(eq1);
+       else                   SetDeadEq(eq1,kFALSE);
        for (UInt_t hs=0; hs<6; hs++) {
-         if (calib->IsDeadHS(hs)) SetDeadHS(eq,hs);
-         else                     SetDeadHS(eq,hs,kFALSE);
+         if (calib->IsDeadHS(hs)) SetDeadHS(eq1,hs);
+         else                     SetDeadHS(eq1,hs,kFALSE);
          for (UInt_t chip=0; chip<10; chip++) {
-           if (calib->IsDeadChip(hs,chip)) SetDeadChip(eq,hs,chip);
-           else                            SetDeadChip(eq,hs,chip,kFALSE);
+           if (calib->IsDeadChip(hs,chip)) SetDeadChip(eq1,hs,chip);
+           else                            SetDeadChip(eq1,hs,chip,kFALSE);
          }
        }
        if (inactive) {
@@ -381,6 +385,35 @@ UInt_t AliITSOnlineCalibrationSPDhandler::ReadNoisyFromText(const char *fileName
   return newNrNoisy;
 }
 //____________________________________________________________________________________________
+void AliITSOnlineCalibrationSPDhandler::ReadPITConditionsFromText(const char *fileName) {
+  // read PIT conditions file from text as printed out at P2
+  //  !!! please note that the chip numbering goes from 9 to 0 in the text. In PVSS panels is the opposite.
+  if(fTriggerConditions) fTriggerConditions->ResetAll();
+  else fTriggerConditions = new AliITSTriggerConditions();
+  fTriggerConditions->ReadFromTextFile(fileName);
+}
+//____________________________________________________________________________________________
+Bool_t AliITSOnlineCalibrationSPDhandler::ReadPITConditionsFromDB(Int_t runNr, const Char_t *storage){
+// read PIT conditions from the OCDB
+
+  AliCDBManager* man = AliCDBManager::Instance();
+  TString storageSTR = Form("%s",storage);
+  if (storageSTR.CompareTo("default")==0) {
+    if(!man->IsDefaultStorageSet()) {
+      man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
+    }
+  }
+  else {
+    storageSTR = Form("%s",storage);
+    man->SetDefaultStorage(storageSTR.Data());
+  }
+  AliCDBEntry *cdbEntry = man->Get("TRIGGER/SPD/PITConditions", runNr);
+ if(cdbEntry) {
+  fTriggerConditions = (AliITSTriggerConditions*)cdbEntry->GetObject();
+  return kTRUE;
+  } else return kFALSE;
+}
+//____________________________________________________________________________________________
 void AliITSOnlineCalibrationSPDhandler::WriteToFilesAlways() {
   // write the lists of active,dead,noisy to files
   for (UInt_t eq=0; eq<20; eq++) {
@@ -504,11 +537,18 @@ void AliITSOnlineCalibrationSPDhandler::WriteNoisyToFile(UInt_t eq) {
 }
 //____________________________________________________________________________________________
 #ifndef SPD_DA_OFF
-Bool_t AliITSOnlineCalibrationSPDhandler::ReadDeadModuleFromDB(UInt_t module, Int_t runNr, Bool_t treeSerial) {
+Bool_t AliITSOnlineCalibrationSPDhandler::ReadDeadModuleFromDB(UInt_t module, Int_t runNr, const Char_t *storage, Bool_t treeSerial) {
   // reads dead pixels from DB for given module and runNr
   AliCDBManager* man = AliCDBManager::Instance();
-  if(!man->IsDefaultStorageSet()) {
-    man->SetDefaultStorage("local://$ALICE_ROOT");
+  TString storageSTR = Form("%s",storage);
+  if (storageSTR.CompareTo("default")==0) {
+    if(!man->IsDefaultStorageSet()) {
+      man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
+    }
+  }
+  else {
+    storageSTR = Form("%s",storage);
+    man->SetDefaultStorage(storageSTR.Data());
   }
   AliCDBEntry *cdbEntry = man->Get("ITS/Calib/SPDDead", runNr);
   TObjArray* spdEntry;
@@ -550,11 +590,18 @@ Bool_t AliITSOnlineCalibrationSPDhandler::ReadDeadModuleFromDB(UInt_t module, In
   return kTRUE;
 }
 //____________________________________________________________________________________________
-Bool_t AliITSOnlineCalibrationSPDhandler::ReadNoisyModuleFromDB(UInt_t module, Int_t runNr, Bool_t treeSerial) {
+Bool_t AliITSOnlineCalibrationSPDhandler::ReadNoisyModuleFromDB(UInt_t module, Int_t runNr, const Char_t *storage, Bool_t treeSerial) {
   // reads noisy pixels from DB for given module and runNr
   AliCDBManager* man = AliCDBManager::Instance();
-  if(!man->IsDefaultStorageSet()) {
-    man->SetDefaultStorage("local://$ALICE_ROOT");
+  TString storageSTR = Form("%s",storage);
+  if (storageSTR.CompareTo("default")==0) {
+    if(!man->IsDefaultStorageSet()) {
+      man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
+    }
+  }
+  else {
+    storageSTR = Form("%s",storage);
+    man->SetDefaultStorage(storageSTR.Data());
   }
   AliCDBEntry *cdbEntry = man->Get("ITS/Calib/SPDNoisy", runNr);
   TObjArray* spdEntry;
@@ -584,18 +631,25 @@ Bool_t AliITSOnlineCalibrationSPDhandler::ReadNoisyModuleFromDB(UInt_t module, I
   return kTRUE;
 }
 //____________________________________________________________________________________________
-Bool_t AliITSOnlineCalibrationSPDhandler::ReadFromDB(Int_t runNr, Bool_t treeSerial) {
+Bool_t AliITSOnlineCalibrationSPDhandler::ReadFromDB(Int_t runNr, const Char_t *storage, Bool_t treeSerial) {
   // reads dead and noisy pixels from DB for given runNr
   // note that you may want to clear the lists (if they are not empty) before reading
-  return (ReadNoisyFromDB(runNr,treeSerial) && ReadDeadFromDB(runNr,treeSerial));
+  return (ReadNoisyFromDB(runNr,storage,treeSerial) && ReadDeadFromDB(runNr,storage,treeSerial));
 }
 //____________________________________________________________________________________________
-Bool_t AliITSOnlineCalibrationSPDhandler::ReadDeadFromDB(Int_t runNr, Bool_t treeSerial) {
+Bool_t AliITSOnlineCalibrationSPDhandler::ReadDeadFromDB(Int_t runNr, const Char_t *storage, Bool_t treeSerial) {
   // reads dead pixels from DB for given runNr
   // note that you may want to clear the list (if it is not empty) before reading
   AliCDBManager* man = AliCDBManager::Instance();
-  if(!man->IsDefaultStorageSet()) {
-    man->SetDefaultStorage("local://$ALICE_ROOT");
+  TString storageSTR = Form("%s",storage);
+  if (storageSTR.CompareTo("default")==0) {
+    if(!man->IsDefaultStorageSet()) {
+      man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
+    }
+  }
+  else {
+    storageSTR = Form("%s",storage);
+    man->SetDefaultStorage(storageSTR.Data());
   }
   AliCDBEntry *cdbEntry = man->Get("ITS/Calib/SPDDead", runNr);
   TObjArray* spdEntry;
@@ -612,7 +666,10 @@ Bool_t AliITSOnlineCalibrationSPDhandler::ReadDeadFromDB(Int_t runNr, Bool_t tre
     calibSPD = (AliITSCalibrationSPD*) spdEntry->At(module);
     UInt_t nrDead = calibSPD->GetNrBadSingle();
     if (nrDead>0) {
-      if (!treeSerial) RecursiveInsertDead(calibSPD,module,0,nrDead-1);
+      if (!treeSerial) {
+       RecursiveInsertDead(calibSPD,module,0,nrDead-1);
+      }
+
       else {
        for (UInt_t index=0; index<nrDead; index++) {
          UInt_t colM = calibSPD->GetBadColAt(index);
@@ -637,12 +694,19 @@ Bool_t AliITSOnlineCalibrationSPDhandler::ReadDeadFromDB(Int_t runNr, Bool_t tre
   return kTRUE;
 }
 //____________________________________________________________________________________________
-Bool_t AliITSOnlineCalibrationSPDhandler::ReadNoisyFromDB(Int_t runNr, Bool_t treeSerial) {
+Bool_t AliITSOnlineCalibrationSPDhandler::ReadNoisyFromDB(Int_t runNr, const Char_t *storage, Bool_t treeSerial) {
   // reads noisy pixels from DB for given runNr
   // note that you may want to clear the list (if it is not empty) before reading
   AliCDBManager* man = AliCDBManager::Instance();
-  if(!man->IsDefaultStorageSet()) {
-    man->SetDefaultStorage("local://$ALICE_ROOT");
+  TString storageSTR = Form("%s",storage);
+  if (storageSTR.CompareTo("default")==0) {
+    if(!man->IsDefaultStorageSet()) {
+      man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
+    }
+  }
+  else {
+    storageSTR = Form("%s",storage);
+    man->SetDefaultStorage(storageSTR.Data());
   }
   AliCDBEntry *cdbEntry = man->Get("ITS/Calib/SPDNoisy", runNr);
   TObjArray* spdEntry;
@@ -676,6 +740,63 @@ Bool_t AliITSOnlineCalibrationSPDhandler::ReadNoisyFromDB(Int_t runNr, Bool_t tr
   return kTRUE;
 }
 //____________________________________________________________________________________________
+Bool_t AliITSOnlineCalibrationSPDhandler::ReadDeadFromDBasNoisy(Int_t runNr, const Char_t *storage, Bool_t treeSerial) {
+  // reads dead pixels (put as noisy) from DB for given runNr
+  // note that you may want to clear the list (if it is not empty) before reading
+  AliCDBManager* man = AliCDBManager::Instance();
+  TString storageSTR = Form("%s",storage);
+  if (storageSTR.CompareTo("default")==0) {
+    if(!man->IsDefaultStorageSet()) {
+      man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
+    }
+  }
+  else {
+    storageSTR = Form("%s",storage);
+    man->SetDefaultStorage(storageSTR.Data());
+  }
+  AliCDBEntry *cdbEntry = man->Get("ITS/Calib/SPDNoisy", runNr);
+  TObjArray* spdEntry;
+  if(cdbEntry) {
+    spdEntry = (TObjArray*)cdbEntry->GetObject();
+    if(!spdEntry) return kFALSE;
+  }
+  else {
+    Warning("AliITSOnlineCalibrationSPDhandler::ReadDeadFromDBasNoisy","Calibration for run %d not found in database.",runNr);
+    return kFALSE;
+  }
+  AliITSCalibrationSPD* calibSPD;
+  for (UInt_t module=0; module<240; module++) {
+    calibSPD = (AliITSCalibrationSPD*) spdEntry->At(module);
+    UInt_t nrDead = calibSPD->GetNrBadSingle();
+    if (nrDead>0) {
+      if (!treeSerial) {
+       RecursiveInsertDead(calibSPD,module,0,nrDead-1);
+      }
+
+      else {
+       for (UInt_t index=0; index<nrDead; index++) {
+         UInt_t colM = calibSPD->GetBadColAt(index);
+         UInt_t rowM = calibSPD->GetBadRowAt(index);
+         SetDeadPixelM(module,colM,rowM);
+       }
+      }
+    }
+    for (UInt_t chipIndex=0; chipIndex<5; chipIndex++) {
+      UInt_t eq,hs,chip,col,row;
+      AliITSRawStreamSPD::OfflineToOnline(module, chipIndex*32, 0, eq, hs, chip, col, row);
+      if (calibSPD->IsChipBad(chipIndex)) {
+       SetDeadChip(eq,hs,chip);
+      }
+      else {
+       SetDeadChip(eq,hs,chip,kFALSE);
+      }
+    }
+  }
+  spdEntry->SetOwner(kTRUE);
+  spdEntry->Clear();
+  return kTRUE;
+}
+//____________________________________________________________________________________________
 Bool_t AliITSOnlineCalibrationSPDhandler::ReadDeadFromCalibObj(TObjArray* calObj) {
   // reads dead pixels from calib object
   for (UInt_t module=0; module<240; module++) {
@@ -708,18 +829,25 @@ Bool_t AliITSOnlineCalibrationSPDhandler::ReadNoisyFromCalibObj(TObjArray* calOb
   return kTRUE;
 }
 //____________________________________________________________________________________________
-Bool_t AliITSOnlineCalibrationSPDhandler::WriteToDB(Int_t runNrStart, Int_t runNrEnd) {
+Bool_t AliITSOnlineCalibrationSPDhandler::WriteToDB(Int_t runNrStart, Int_t runNrEnd, const Char_t *storage) {
   // writes dead and noisy pixels to DB for given runNrs
   // overwrites any previous entries
-  return (WriteNoisyToDB(runNrStart,runNrEnd) && WriteDeadToDB(runNrStart,runNrEnd));
+  return (WriteNoisyToDB(runNrStart,runNrEnd,storage) && WriteDeadToDB(runNrStart,runNrEnd,storage));
 }
 //____________________________________________________________________________________________
-Bool_t AliITSOnlineCalibrationSPDhandler::WriteDeadToDB(Int_t runNrStart, Int_t runNrEnd) {
+Bool_t AliITSOnlineCalibrationSPDhandler::WriteDeadToDB(Int_t runNrStart, Int_t runNrEnd, const Char_t *storage) {
   // writes dead pixels to DB for given runNrs
   // overwrites any previous entries
   AliCDBManager* man = AliCDBManager::Instance();
-  if(!man->IsDefaultStorageSet()) {
-    man->SetDefaultStorage("local://$ALICE_ROOT");
+  TString storageSTR = Form("%s",storage);
+  if (storageSTR.CompareTo("default")==0) {
+    if(!man->IsDefaultStorageSet()) {
+      man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
+    }
+  }
+  else {
+    storageSTR = Form("%s",storage);
+    man->SetDefaultStorage(storageSTR.Data());
   }
   AliCDBMetaData* metaData = new AliCDBMetaData();
   metaData->SetResponsible("Henrik Tydesjo");
@@ -754,12 +882,66 @@ Bool_t AliITSOnlineCalibrationSPDhandler::WriteDeadToDB(Int_t runNrStart, Int_t
   return kTRUE;
 }
 //____________________________________________________________________________________________
-Bool_t AliITSOnlineCalibrationSPDhandler::WriteNoisyToDB(Int_t runNrStart, Int_t runNrEnd) {
+Bool_t AliITSOnlineCalibrationSPDhandler::WriteDeadToDBasNoisy(Int_t runNrStart, Int_t runNrEnd, const Char_t *storage) {
+  // writes dead pixels to DB for given runNrs
+  // overwrites any previous entries
+  AliCDBManager* man = AliCDBManager::Instance();
+  TString storageSTR = Form("%s",storage);
+  if (storageSTR.CompareTo("default")==0) {
+    if(!man->IsDefaultStorageSet()) {
+      man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
+    }
+  }
+  else {
+    storageSTR = Form("%s",storage);
+    man->SetDefaultStorage(storageSTR.Data());
+  }
+  AliCDBMetaData* metaData = new AliCDBMetaData();
+  metaData->SetResponsible("Henrik Tydesjo");
+  metaData->SetComment("Created by AliITSOnlineCalibrationSPDhandler.");
+  AliCDBId idCalSPD("ITS/Calib/SPDNoisy",runNrStart,runNrEnd);
+  TObjArray* spdEntry = new TObjArray(240);
+  spdEntry->SetOwner(kTRUE);
+  for(UInt_t module=0; module<240; module++){
+    AliITSCalibrationSPD* calibSPD = new AliITSCalibrationSPD();
+    spdEntry->Add(calibSPD);
+  }
+  for(UInt_t module=0; module<240; module++){
+    AliITSCalibrationSPD* calibSPD = (AliITSCalibrationSPD*) spdEntry->At(module);
+    calibSPD->SetNrBadSingle( GetNrDeadSingle(module) );
+    calibSPD->SetBadList( GetDeadArray(module) );
+    for (UInt_t chipIndex=0; chipIndex<5; chipIndex++) {
+      UInt_t eq,hs,chip,col,row;
+      AliITSRawStreamSPD::OfflineToOnline(module, chipIndex*32, 0, eq, hs, chip, col, row);
+      if (IsSilentChip(eq,hs,chip)) {
+       calibSPD->SetChipBad(chipIndex);
+      }
+      else {
+       calibSPD->UnSetChipBad(chipIndex);
+      }
+    }
+  }
+  AliCDBEntry* cdbEntry = new AliCDBEntry((TObject*)spdEntry,idCalSPD,metaData);
+  man->Put(cdbEntry);
+  delete spdEntry;
+  delete cdbEntry;
+  delete metaData;
+  return kTRUE;
+}
+//____________________________________________________________________________________________
+Bool_t AliITSOnlineCalibrationSPDhandler::WriteNoisyToDB(Int_t runNrStart, Int_t runNrEnd, const Char_t *storage) {
   // writes noisy pixels to DB for given runNrs
   // overwrites any previous entries
   AliCDBManager* man = AliCDBManager::Instance();
-  if(!man->IsDefaultStorageSet()) {
-    man->SetDefaultStorage("local://$ALICE_ROOT");
+  TString storageSTR = Form("%s",storage);
+  if (storageSTR.CompareTo("default")==0) {
+    if(!man->IsDefaultStorageSet()) {
+      man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
+    }
+  }
+  else {
+    storageSTR = Form("%s",storage);
+    man->SetDefaultStorage(storageSTR.Data());
   }
   AliCDBMetaData* metaData = new AliCDBMetaData();
   metaData->SetResponsible("Henrik Tydesjo");
@@ -1272,7 +1454,7 @@ Bool_t AliITSOnlineCalibrationSPDhandler::IsPixelNoisy(UInt_t eq, UInt_t hs, UIn
   // is the pixel noisy?
   UInt_t gloChip = GetGloChip(eq,hs,chip);
   if (gloChip>=1200 || col>=32 || row>=256) {
-    Error("AliITSOnlineCalibrationSPDhandler::IsPixelNoisy", "eq,hs,chip,col,row nrs (%d,%d,%d) out of bounds.",eq,hs,chip,col,row);
+    Error("AliITSOnlineCalibrationSPDhandler::IsPixelNoisy",Form("eq,hs,chip,col,row nrs (%d,%d,%d,%d,%d) out of bounds.",eq,hs,chip,col,row));
     return kFALSE;
   }
   UInt_t key = GetKey(eq,hs,chip,col,row);
@@ -2752,3 +2934,163 @@ Bool_t AliITSOnlineCalibrationSPDhandler::IsSilentChip(UInt_t eq, UInt_t hs, UIn
   }
   return (!IsActiveEq(eq) || IsDeadEq(eq) || !IsActiveHS(eq,hs) || IsDeadHS(eq,hs) || !IsActiveChip(eq,hs,chip) || IsDeadChip(eq,hs,chip));
 }
+//____________________________________________________________________________________________
+Bool_t AliITSOnlineCalibrationSPDhandler::IsNoisyChip(UInt_t eq, UInt_t hs, UInt_t chip) const {
+  // returns true if there is at least a noisy pixel in the chip
+
+  if (eq>=20 || hs>=6 || chip>=10) {
+    Error("AliITSOnlineCalibrationSPDhandler::IsNoisyChip", "eq,hs,chip (%d,%d,%d) out of bounds.",eq,hs,chip);
+    return kFALSE;
+  }
+  Bool_t isNoisy = kFALSE;
+
+  UInt_t nrNoisy = GetNrNoisy();
+  for (UInt_t i=0; i<nrNoisy; i++) {
+    if(eq  == GetNoisyEqIdAt(i)){
+      if(hs  == GetNoisyHSAt(i)){
+        if(chip == GetNoisyChipAt(i)) {
+            UInt_t col  = GetNoisyColAt(i);
+            UInt_t row  = GetNoisyRowAt(i);
+            if (IsPixelNoisy(eq,hs,chip,col,row)) isNoisy = kTRUE;
+        }
+      }
+    }
+  }
+  return isNoisy;
+}
+//____________________________________________________________________________________________
+Bool_t AliITSOnlineCalibrationSPDhandler::WritePITConditionsToDB(Int_t runNrStart, Int_t runNrEnd, const Char_t *storage) {
+  // writes noisy pixels to DB for given runNrs
+  // overwrites any previous entries
+  AliCDBManager* man = AliCDBManager::Instance();
+  TString storageSTR = Form("%s",storage);
+  if (storageSTR.CompareTo("default")==0) {
+    if(!man->IsDefaultStorageSet()) {
+      man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
+    }
+  }
+  else {
+    storageSTR = Form("%s",storage);
+    man->SetDefaultStorage(storageSTR.Data());
+  }
+  AliCDBMetaData* metaData = new AliCDBMetaData();
+  metaData->SetResponsible("Annalisa Mastroserio");
+  metaData->SetComment("Created by AliITSOnlineCalibrationSPDhandler.");
+  AliCDBId idCalSPD("TRIGGER/SPD/PITConditions",runNrStart,runNrEnd);
+  AliCDBEntry* cdbEntry = new AliCDBEntry((TObject*)fTriggerConditions,idCalSPD,metaData);
+  man->Put(cdbEntry);
+  delete cdbEntry;
+  delete metaData;
+  return kTRUE;
+}
+
+//____________________________________________________________________________________________
+Bool_t AliITSOnlineCalibrationSPDhandler::SetInactiveChipInPITmask(UInt_t eq, UInt_t hs, UInt_t chip){
+  //
+  fTriggerConditions->SetInActiveChip(eq,hs,chip);
+  return kTRUE;
+}
+//____________________________________________________________________________________________
+Bool_t AliITSOnlineCalibrationSPDhandler::UnSetInactiveChipInPITmask(UInt_t eq, UInt_t hs, UInt_t chip){
+  //
+  fTriggerConditions->SetInActiveChip(eq,hs,chip);
+  return kTRUE;
+}
+//____________________________________________________________________________________________
+void AliITSOnlineCalibrationSPDhandler::PrintDiffInDead(AliITSOnlineCalibrationSPDhandler *other) const {
+  //
+  // Printout of the differences between two ocdb files for SPD Dead channel map
+  //
+  UInt_t nrChipOk=0;
+  UInt_t nrDeadChipOk=0; 
+  UInt_t nrDeadHsOk=0;
+  UInt_t nrDeadHs =0;
+  UInt_t nrDeadChip=0;
+  UInt_t nrDeadHsInOther =0;
+  UInt_t nrDeadChipInOther=0;
+  UInt_t nrMismatch =0;
+  UInt_t nrMismatchInOther =0;
+  printf("\n\n ****** loop over chips ***** \n");
+  for(Int_t eq=0; eq<20; eq++){
+   if(TMath::Abs((Int_t)GetNrBadEq(eq) - (Int_t)other->GetNrBadEq(eq)) >0) printf("-----> dead pixels differ in eq %i!   %i - %i in the other \n",eq,GetNrBadEq(eq),other->GetNrBadEq(eq));
+   for(Int_t hs=0; hs<6; hs++){
+    Short_t nchips =0;
+    Short_t nchipsOther =0;
+    Short_t nok=0;
+    for(Int_t chip=0; chip<10; chip++){
+      UInt_t chipkey = AliITSRawStreamSPD::GetOfflineChipKeyFromOnline(eq,hs,chip);
+     // test if everything is coherent
+     if(IsDeadChip(eq,hs,chip) && other->IsDeadChip(eq,hs,chip)) {
+      nok++;
+      nrChipOk++;
+      nrDeadChipOk++;
+     }
+     if(!IsDeadChip(eq,hs,chip) && !other->IsDeadChip(eq,hs,chip)) nrChipOk++;
+     // now testing if mismatches
+     if(IsDeadChip(eq,hs,chip)) {
+      nrDeadChip++;
+      nchips++;
+      if(!other->IsDeadChip(eq,hs,chip)) {
+        nrMismatch++;
+        printf("  mismatch -> eq %i  hs %i  chip %i is DEAD  - ALIVE in the other (chipkey %i)\n",eq,hs,chip,chipkey);
+       }
+      }
+     if(other->IsDeadChip(eq,hs,chip)){
+      nrDeadChipInOther++;
+      nchipsOther++;
+      if(!IsDeadChip(eq,hs,chip)) {
+       nrMismatchInOther++;
+       printf("  mismatch -> eq %i  hs %i  chip %i is ALIVE -  DEAD in the other (chipkey %i)\n",eq,hs,chip,chipkey);
+      }
+     }
+    }
+    if(nok==10) nrDeadHsOk++;
+    if(nchips==10) nrDeadHs++;
+    if(nchipsOther==10) nrDeadHsInOther++;
+   }
+  }
+
+printf("\n\n\n*************SUMMARY****************\n");
+printf(" BOTH have : %i Dead HS and %i Dead chips  with %i coherent chips \n",nrDeadHsOk,nrDeadChipOk,nrChipOk);
+printf("\n_________MISMATCH RESULTS___________\n");
+printf(" THIS  : Nr Dead HS %i - Nr Dead Chip %i \n",nrDeadHs,nrDeadChip);
+printf(" OTHER : Nr Dead HS %i - Nr Dead Chip %i \n",nrDeadHsInOther,nrDeadChipInOther);
+printf(" N Mismatches in Dead  chips (=ALIVE in the other) %i \n",nrMismatch);
+printf(" N Mismatches in Alive chips (=DEAD  in the other) %i \n",nrMismatchInOther);
+}
+//____________________________________________________________________________________________
+void AliITSOnlineCalibrationSPDhandler::PrintDiffInPITmask(AliITSOnlineCalibrationSPDhandler *other) const {
+  //
+  // Printout of the differences between two ocdb files for SPD Dead channel map
+  //
+
+Int_t nOk =0;
+Int_t nMismatch =0;
+Int_t nMismatchInOther =0;
+
+printf("\n\n ****** loop over chips in PIT mask***** \n");
+for(Int_t eq=0; eq<20; eq++){
+  for(Int_t hs=0; hs<6; hs++){
+   for(Int_t chip=0; chip<10; chip++){
+
+  UInt_t chipkey = AliITSRawStreamSPD::GetOfflineChipKeyFromOnline(eq,hs,chip);
+
+  if(fTriggerConditions->IsChipActive(eq,hs,chip) && (other->GetTriggerConditions())->IsChipActive(eq,hs,chip)) nOk++;
+  if(fTriggerConditions->IsChipActive(eq,hs,chip) && !(other->GetTriggerConditions())->IsChipActive(eq,hs,chip)) {
+   nMismatch++;
+   printf("Mismatch -> eq %i  hs %i chip %i is ACTIVE - INACTIVE in the other (chipkey %i) \n",eq,hs,chip,chipkey);
+  }
+  if(!fTriggerConditions->IsChipActive(eq,hs,chip) && (other->GetTriggerConditions())->IsChipActive(eq,hs,chip)) {
+   nMismatchInOther++;
+   printf("Mismatch -> eq %i  hs %i chip %i is INACTIVE - ACTIVE in the other (chipkey %i) \n",eq,hs,chip,chipkey);
+   }
+  if(!fTriggerConditions->IsChipActive(eq,hs,chip) && !(other->GetTriggerConditions())->IsChipActive(eq,hs,chip)) nOk++;
+  }
+ }
+}
+
+printf("n Chips OK %i : ACTIVE mismatch %i  - INACTIVE mismatch in %i \n",nOk,nMismatch,nMismatchInOther);
+
+}
+
+