From c4227ef74f0f39b68584382959b9350ada8918bf Mon Sep 17 00:00:00 2001 From: guernane Date: Tue, 9 Apr 2013 16:13:14 +0000 Subject: [PATCH] Set default PF pattern when not set properly in OCDB --- EMCAL/AliEMCALTriggerTRU.cxx | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/EMCAL/AliEMCALTriggerTRU.cxx b/EMCAL/AliEMCALTriggerTRU.cxx index 0962da5eafc..8085adc5518 100644 --- a/EMCAL/AliEMCALTriggerTRU.cxx +++ b/EMCAL/AliEMCALTriggerTRU.cxx @@ -30,6 +30,8 @@ Author: R. GUERNANE LPSC Grenoble CNRS/IN2P3 #include #include #include +#include +#include namespace { @@ -155,29 +157,23 @@ Int_t AliEMCALTriggerTRU::L0() } AliDebug(999,Form("=== TRU PF: %x",fDCSConfig->GetSELPF())); - + UInt_t ma = fDCSConfig->GetSELPF() & 0xffff; -// int nb = 0; -// for (int i = 0; i < 7; i++) { -// UInt_t bit = ma & (1 << i); -// if (bit) nb++; -// } - + // Set default peak finder if null + if (!ma) ma = 0x1e1f; + int nb = ma & 0x7f; ma = (ma >> 8) & 0x7f; AliDebug(999,Form("=== TRU fw version %x ===",fDCSConfig->GetFw())); - - if (fDCSConfig->IsA()->GetClassVersion() >= 3) { - if (fDCSConfig->GetFw() < 0x4d) { - return L0v0(nb, ma); - } else { - return L0v1(nb, ma); - } - } else - return L0v0(nb, ma); + + if (fDCSConfig->GetFw() < 0x4d) { + return L0v0(nb, ma); + } else { + return L0v1(nb, ma); + } } //________________ @@ -292,7 +288,7 @@ Int_t AliEMCALTriggerTRU::L0v0(int mask, int pattern) idx[index] = fMap[int(j * fSubRegionSize->X()) + l][int(k * fSubRegionSize->Y()) + m]; - if ((patt[j + l][k + m] & mask) == pattern) { + if ((patt[j + l][k + m] & mask) == (pattern & mask)) { // cout << "setting peak at " << l << " " << m << endl; p->SetPeak(l, m, sizeX, sizeY); } @@ -416,7 +412,7 @@ Int_t AliEMCALTriggerTRU::L0v1(int mask, int pattern) buff[j][k] = sum; - if (othr[j][k] && (patt[j][k] & mask) == pattern) { + if (othr[j][k] && ((patt[j][k] & mask) == (pattern & mask))) { new((*fPatches)[fPatches->GetEntriesFast()]) AliEMCALTriggerPatch(j, k, othr[j][k], i); -- 2.43.0