From 39c05eac22bebfd52f4bce705f90876b2e5f85db Mon Sep 17 00:00:00 2001 From: gconesab Date: Thu, 13 May 2010 09:17:24 +0000 Subject: [PATCH] trigger code update from Rachid --- EMCAL/AliEMCALTriggerElectronics.cxx | 2 ++ EMCAL/AliEMCALTriggerSTURawStream.cxx | 16 ++++++++++--- EMCAL/AliEMCALTriggerSTURawStream.h | 6 ++++- EMCAL/AliEMCALTriggerTRU.cxx | 33 ++++++++++++--------------- 4 files changed, 34 insertions(+), 23 deletions(-) diff --git a/EMCAL/AliEMCALTriggerElectronics.cxx b/EMCAL/AliEMCALTriggerElectronics.cxx index 6b9ddf0d55c..d853dbba7d7 100644 --- a/EMCAL/AliEMCALTriggerElectronics.cxx +++ b/EMCAL/AliEMCALTriggerElectronics.cxx @@ -204,6 +204,8 @@ void AliEMCALTriggerElectronics::Digits2Trigger(const TClonesArray* digits, cons data->SetL1V0( mv0 ); } + if ( AliDebugLevel() ) data->Scan(); + // Now reset the electronics for a fresh start with next event Reset(); } diff --git a/EMCAL/AliEMCALTriggerSTURawStream.cxx b/EMCAL/AliEMCALTriggerSTURawStream.cxx index 38b96e0d89b..a76d1e8f927 100644 --- a/EMCAL/AliEMCALTriggerSTURawStream.cxx +++ b/EMCAL/AliEMCALTriggerSTURawStream.cxx @@ -48,6 +48,7 @@ fL1JetPatchIndex(0x0), fNL0GammaPatch(0), fNL1JetPatch(0), fNL1GammaPatch(0), +fGetRawData(0), fL0(0) { // @@ -63,7 +64,8 @@ fL1GammaPatchIndex(0x0), fL1JetPatchIndex(0x0), fNL0GammaPatch(0), fNL1JetPatch(0), -fNL1GammaPatch(0), +fNL1GammaPatch(0), +fGetRawData(0), fL0(0) { // @@ -242,7 +244,13 @@ Bool_t AliEMCALTriggerSTURawStream::ReadPayLoad() // raw output // ////////////////////////////////////////////////////////// - if ( iword <= kPayLoadSize ) return kFALSE; + if ( iword <= kPayLoadSize ) + { + fGetRawData = 0; + return kFALSE; + } + + fGetRawData = 1; // extraction from stream for (Int_t index=0;index<96;index++) @@ -348,7 +356,9 @@ void AliEMCALTriggerSTURawStream::DumpPayLoad(const Option_t *option) const } } - if (op.Contains("ADC") || op.Contains("ALL")) + cout << "> RawData: " << fGetRawData << endl; + + if ( (op.Contains("ADC") || op.Contains("ALL")) && fGetRawData ) { for (Int_t i=0;i<32;i++) { diff --git a/EMCAL/AliEMCALTriggerSTURawStream.h b/EMCAL/AliEMCALTriggerSTURawStream.h index 64494e98adc..d767d3a741e 100644 --- a/EMCAL/AliEMCALTriggerSTURawStream.h +++ b/EMCAL/AliEMCALTriggerSTURawStream.h @@ -32,11 +32,13 @@ class AliEMCALTriggerSTURawStream: public TObject virtual Int_t GetNL0GammaPatch() const {return fNL0GammaPatch;} virtual Int_t GetNL1GammaPatch() const {return fNL1GammaPatch;} virtual Int_t GetNL1JetPatch() const {return fNL1JetPatch;} + virtual Int_t GetRawData() const {return fGetRawData;} virtual Bool_t GetL0GammaPatch(const Int_t i, Int_t& x, Int_t& y, Int_t& z) const; virtual Bool_t GetL1GammaPatch(const Int_t i, Int_t& x, Int_t& y, Int_t& z) const; virtual Bool_t GetL1JetPatch(const Int_t i, Int_t& x, Int_t& y) const; + virtual UInt_t L0() {return fL0;} private: @@ -56,8 +58,10 @@ private: Int_t fNL1JetPatch; Int_t fNL1GammaPatch; + Int_t fGetRawData; + UInt_t fADC[32][96]; - UInt_t fL0; + UInt_t fL0; ClassDef(AliEMCALTriggerSTURawStream,1) // class for reading EMCAL STU DDL raw data }; diff --git a/EMCAL/AliEMCALTriggerTRU.cxx b/EMCAL/AliEMCALTriggerTRU.cxx index 2c6aeb67a02..6ba02cf1296 100644 --- a/EMCAL/AliEMCALTriggerTRU.cxx +++ b/EMCAL/AliEMCALTriggerTRU.cxx @@ -246,8 +246,6 @@ Int_t AliEMCALTriggerTRU::L0() // for(Int_t j=0; jX(); j++) // for (Int_t k=0; kY(); k++) fRegion[j][k] = fRegion[j][k]>>2; // go to 12b before shipping to STU - Int_t nP = 0; - for (Int_t j=0; jGetEntriesFast(); j++) { AliEMCALTriggerPatch* p = (AliEMCALTriggerPatch*)fPatches->At( j ); @@ -262,6 +260,8 @@ Int_t AliEMCALTriggerTRU::L0() const Int_t psize = sizeX * sizeY; // Number of FastOR in the patch + Int_t foundPeak = 0; + Int_t* idx = new Int_t[psize]; for (Int_t xx=0;xxX())+xx][int(v.Y()*fSubRegionSize->Y())+yy]; // Get current patch FastOR ADC channels - if (peaks[int(v.X()*fSubRegionSize->X())+xx][int(v.Y()*fSubRegionSize->Y())+yy]) nP++; + if (peaks[int(v.X()*fSubRegionSize->X())+xx][int(v.Y()*fSubRegionSize->Y())+yy]) foundPeak++; if ( AliDebugLevel() ) ShowFastOR(i,idx[index]); } } - if ( nP ) + if ( !foundPeak ) { -// cout << "break patch loop" << endl; - break; - } - } - - if ( !nP ) - fPatches->Delete(); - else - { -// cout << "break time loop" << endl; - break; // Stop the algo when at least one patch is found ( thres & max ) + fPatches->RemoveAt( j ); + fPatches->Compress(); + } } - ZeroRegion(); // Clear fRegion for this time window before computing the next one - //Delete, avoid leak for (Int_t x = 0; x < xsize; x++) { delete [] peaks[x]; } delete [] peaks; - + + if ( !fPatches->GetEntriesFast() ) // No patch left + ZeroRegion(); + else + { + break; // Stop the algo when at least one patch is found ( thres & max ) + } } -// cout << "Nof patches: " << fPatches->GetEntriesFast() << endl; //Delete, avoid leak for (Int_t x = 0; x < xsize; x++) { -- 2.39.3