}
//____________________________________________________________________________________________
#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, 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");
+ }
+ }
+ else {
+ storageSTR = Form("local://%s",storage);
+ man->SetDefaultStorage(storageSTR.Data());
}
AliCDBEntry *cdbEntry = man->Get("ITS/Calib/SPDDead", runNr);
TObjArray* spdEntry;
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, 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");
+ }
+ }
+ else {
+ storageSTR = Form("local://%s",storage);
+ man->SetDefaultStorage(storageSTR.Data());
}
AliCDBEntry *cdbEntry = man->Get("ITS/Calib/SPDNoisy", runNr);
TObjArray* spdEntry;
return kTRUE;
}
//____________________________________________________________________________________________
-Bool_t AliITSOnlineCalibrationSPDhandler::ReadFromDB(Int_t runNr, Bool_t treeSerial) {
+Bool_t AliITSOnlineCalibrationSPDhandler::ReadFromDB(Int_t runNr, 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, 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");
+ }
+ }
+ else {
+ storageSTR = Form("local://%s",storage);
+ man->SetDefaultStorage(storageSTR.Data());
}
AliCDBEntry *cdbEntry = man->Get("ITS/Calib/SPDDead", runNr);
TObjArray* spdEntry;
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);
return kTRUE;
}
//____________________________________________________________________________________________
-Bool_t AliITSOnlineCalibrationSPDhandler::ReadNoisyFromDB(Int_t runNr, Bool_t treeSerial) {
+Bool_t AliITSOnlineCalibrationSPDhandler::ReadNoisyFromDB(Int_t runNr, 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");
+ }
+ }
+ else {
+ storageSTR = Form("local://%s",storage);
+ man->SetDefaultStorage(storageSTR.Data());
}
AliCDBEntry *cdbEntry = man->Get("ITS/Calib/SPDNoisy", runNr);
TObjArray* spdEntry;
return kTRUE;
}
//____________________________________________________________________________________________
+Bool_t AliITSOnlineCalibrationSPDhandler::ReadDeadFromDBasNoisy(Int_t runNr, 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");
+ }
+ }
+ else {
+ storageSTR = Form("local://%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++) {
return kTRUE;
}
//____________________________________________________________________________________________
-Bool_t AliITSOnlineCalibrationSPDhandler::WriteToDB(Int_t runNrStart, Int_t runNrEnd) {
+Bool_t AliITSOnlineCalibrationSPDhandler::WriteToDB(Int_t runNrStart, Int_t runNrEnd, 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, 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");
+ }
+ }
+ else {
+ storageSTR = Form("local://%s",storage);
+ man->SetDefaultStorage(storageSTR.Data());
}
AliCDBMetaData* metaData = new AliCDBMetaData();
metaData->SetResponsible("Henrik Tydesjo");
return kTRUE;
}
//____________________________________________________________________________________________
-Bool_t AliITSOnlineCalibrationSPDhandler::WriteDeadToDBasNoisy(Int_t runNrStart, Int_t runNrEnd) {
+Bool_t AliITSOnlineCalibrationSPDhandler::WriteDeadToDBasNoisy(Int_t runNrStart, Int_t runNrEnd, 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");
+ }
+ }
+ else {
+ storageSTR = Form("local://%s",storage);
+ man->SetDefaultStorage(storageSTR.Data());
}
AliCDBMetaData* metaData = new AliCDBMetaData();
metaData->SetResponsible("Henrik Tydesjo");
return kTRUE;
}
//____________________________________________________________________________________________
-Bool_t AliITSOnlineCalibrationSPDhandler::WriteNoisyToDB(Int_t runNrStart, Int_t runNrEnd) {
+Bool_t AliITSOnlineCalibrationSPDhandler::WriteNoisyToDB(Int_t runNrStart, Int_t runNrEnd, 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");
+ }
+ }
+ else {
+ storageSTR = Form("local://%s",storage);
+ man->SetDefaultStorage(storageSTR.Data());
}
AliCDBMetaData* metaData = new AliCDBMetaData();
metaData->SetResponsible("Henrik Tydesjo");