From 3479cee3be969ff6b7c47cf6de2fe0515dc73feb Mon Sep 17 00:00:00 2001 From: masera Date: Wed, 10 Oct 2007 17:14:17 +0000 Subject: [PATCH] updated as required to create proper calibration file using the macro AliITSStoreDeadSPD.C --- ITS/AliITSIntMap.cxx | 2 +- ITS/AliITSOnlineCalibrationSPDhandler.cxx | 67 +++++++++++++++++++++++ ITS/AliITSOnlineCalibrationSPDhandler.h | 10 ++++ 3 files changed, 78 insertions(+), 1 deletion(-) diff --git a/ITS/AliITSIntMap.cxx b/ITS/AliITSIntMap.cxx index fc91cb14c7e..b65aaf960f1 100644 --- a/ITS/AliITSIntMap.cxx +++ b/ITS/AliITSIntMap.cxx @@ -116,7 +116,7 @@ void AliITSIntMap::InsertNode(Int_t key, Int_t val, AliITSIntMapNode* &node, UIn InsertNode(key,val,node->Right(),height); } else { // (key==node->Key()): do nothing (avoid duplicates) - Warning("AliITSIntMap::InsertNode","Node with key %d already in map. Not inserted.",key); + // Warning("AliITSIntMap::InsertNode","Node with key %d already in map. Not inserted.",key); } } diff --git a/ITS/AliITSOnlineCalibrationSPDhandler.cxx b/ITS/AliITSOnlineCalibrationSPDhandler.cxx index 73b1f85e261..538a1d115dd 100644 --- a/ITS/AliITSOnlineCalibrationSPDhandler.cxx +++ b/ITS/AliITSOnlineCalibrationSPDhandler.cxx @@ -360,6 +360,17 @@ Bool_t AliITSOnlineCalibrationSPDhandler::WriteToDB(Int_t runNrStart, Int_t runN spdEntry->SetOwner(kTRUE); for(UInt_t module=0; module<240; module++){ AliITSCalibrationSPD* calObj = new AliITSCalibrationSPD(); + + // *** this is temporarily hard coded here ******************** + // (later these parameters will be separated from the cal.obj.) + calObj->SetThresholds(3000, 250); + calObj->SetBiasVoltage(18.182); + calObj->SetNoiseParam(0,0); + // CouplingRaw changed to 0.055 (fine tuning), was 0.047 in PDC06 + calObj->SetCouplingParam(0.,0.055); + // *** remove later... + // ************************************************************ + spdEntry->Add(calObj); } for(UInt_t module=0; module<240; module++){ @@ -377,6 +388,12 @@ Bool_t AliITSOnlineCalibrationSPDhandler::WriteToDB(Int_t runNrStart, Int_t runN } #endif +void AliITSOnlineCalibrationSPDhandler::WriteToFilesAlways() { + // write the lists of dead and noisy to files (only if there are >0 dead or noisy pixels) + for (UInt_t module=0; module<240; module++) { + WriteToFile(module); + } +} void AliITSOnlineCalibrationSPDhandler::WriteToFiles() { // write the lists of dead and noisy to files (only if there are >0 dead or noisy pixels) for (UInt_t module=0; module<240; module++) { @@ -520,6 +537,31 @@ Bool_t AliITSOnlineCalibrationSPDhandler::SetDeadPixelM(UInt_t module, UInt_t co return kFALSE; } +Bool_t AliITSOnlineCalibrationSPDhandler::UnSetDeadPixel(UInt_t eqId, UInt_t hs, UInt_t chip, UInt_t col, UInt_t row) { + // unset a dead pixel, returns false if pixel is not dead + UInt_t module = AliITSRawStreamSPD::GetModuleNumber(eqId,hs,chip); + Int_t key = GetKey(eqId,hs,chip,col,row); + if (fDeadPixelMap[module]->Remove(key)) { + fNrDead[module]--; + return kTRUE; + } + return kFALSE; +} + +Bool_t AliITSOnlineCalibrationSPDhandler::UnSetDeadPixelM(UInt_t module, UInt_t colM, UInt_t row) { + // unset a dead pixel, returns false if pixel is not dead + UInt_t eqId = GetEqIdFromOffline(module); + UInt_t hs = GetHSFromOffline(module); + UInt_t chip = GetChipFromOffline(module,colM); + UInt_t col = GetColFromOffline(colM); + Int_t key = GetKey(eqId,hs,chip,col,row); + if (fDeadPixelMap[module]->Remove(key)) { + fNrDead[module]--; + return kTRUE; + } + return kFALSE; +} + Bool_t AliITSOnlineCalibrationSPDhandler::IsPixelDeadKey(Int_t key) const { // is this pixel noisy? UInt_t eqId = GetEqIdFromKey(key); @@ -686,6 +728,31 @@ Bool_t AliITSOnlineCalibrationSPDhandler::SetNoisyPixelM(UInt_t module, UInt_t c return kFALSE; } +Bool_t AliITSOnlineCalibrationSPDhandler::UnSetNoisyPixel(UInt_t eqId, UInt_t hs, UInt_t chip, UInt_t col, UInt_t row) { + // unset a noisy pixel, returns false if not there + UInt_t module = AliITSRawStreamSPD::GetModuleNumber(eqId,hs,chip); + Int_t key = GetKey(eqId,hs,chip,col,row); + if (fNoisyPixelMap[module]->Remove(key)) { + fNrNoisy[module]--; + return kTRUE; + } + return kFALSE; +} + +Bool_t AliITSOnlineCalibrationSPDhandler::UnSetNoisyPixelM(UInt_t module, UInt_t colM, UInt_t row) { + // unset a noisy pixel, returns false if not there + UInt_t eqId = GetEqIdFromOffline(module); + UInt_t hs = GetHSFromOffline(module); + UInt_t chip = GetChipFromOffline(module,colM); + UInt_t col = GetColFromOffline(colM); + Int_t key = GetKey(eqId,hs,chip,col,row); + if (fNoisyPixelMap[module]->Remove(key)) { + fNrNoisy[module]--; + return kTRUE; + } + return kFALSE; +} + Bool_t AliITSOnlineCalibrationSPDhandler::IsPixelNoisyKey(Int_t key) const { // is this pixel noisy? UInt_t eqId = GetEqIdFromKey(key); diff --git a/ITS/AliITSOnlineCalibrationSPDhandler.h b/ITS/AliITSOnlineCalibrationSPDhandler.h index 8f0b079ca76..248d5a60e8a 100644 --- a/ITS/AliITSOnlineCalibrationSPDhandler.h +++ b/ITS/AliITSOnlineCalibrationSPDhandler.h @@ -1,6 +1,11 @@ #ifndef ALI_ITS_ONLINECALIBRATIONSPDHANDLER_H #define ALI_ITS_ONLINECALIBRATIONSPDHANDLER_H +/* Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. * + * See cxx source for full Copyright notice */ + +/* $Id$ */ + ////////////////////////////////////////////////////////////////////////// // Author: Henrik Tydesjo // // Class that simplifies the managing of dead and noisy pixels. // @@ -38,6 +43,7 @@ class AliITSOnlineCalibrationSPDhandler { Bool_t ReadDeadFromFileName(const char *fileName); Bool_t ReadNoisyFromFileName(const char *fileName); + void WriteToFilesAlways(); void WriteToFiles(); void WriteDeadToFiles(); void WriteNoisyToFiles(); @@ -61,6 +67,8 @@ class AliITSOnlineCalibrationSPDhandler { void ResetDeadForChip(UInt_t eqId, UInt_t hs, UInt_t chip); Bool_t SetDeadPixel(UInt_t eqId, UInt_t hs, UInt_t chip, UInt_t col, UInt_t row); Bool_t SetDeadPixelM(UInt_t module, UInt_t colM, UInt_t row); + Bool_t UnSetDeadPixel(UInt_t eqId, UInt_t hs, UInt_t chip, UInt_t col, UInt_t row); + Bool_t UnSetDeadPixelM(UInt_t module, UInt_t colM, UInt_t row); Bool_t IsPixelDead(UInt_t eqId, UInt_t hs, UInt_t chip, UInt_t col, UInt_t row) const; Bool_t IsPixelDeadM(UInt_t module, UInt_t colM, UInt_t row); @@ -75,6 +83,8 @@ class AliITSOnlineCalibrationSPDhandler { void ResetNoisyForChip(UInt_t eqId, UInt_t hs, UInt_t chip); Bool_t SetNoisyPixel(UInt_t eqId, UInt_t hs, UInt_t chip, UInt_t col, UInt_t row); Bool_t SetNoisyPixelM(UInt_t module, UInt_t colM, UInt_t row); + Bool_t UnSetNoisyPixel(UInt_t eqId, UInt_t hs, UInt_t chip, UInt_t col, UInt_t row); + Bool_t UnSetNoisyPixelM(UInt_t module, UInt_t colM, UInt_t row); Bool_t IsPixelNoisy(UInt_t eqId, UInt_t hs, UInt_t chip, UInt_t col, UInt_t row) const; Bool_t IsPixelNoisyM(UInt_t module, UInt_t colM, UInt_t row); -- 2.39.3