trigger code update from Rachid
authorgconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 13 May 2010 09:17:24 +0000 (09:17 +0000)
committergconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 13 May 2010 09:17:24 +0000 (09:17 +0000)
EMCAL/AliEMCALTriggerElectronics.cxx
EMCAL/AliEMCALTriggerSTURawStream.cxx
EMCAL/AliEMCALTriggerSTURawStream.h
EMCAL/AliEMCALTriggerTRU.cxx

index 6b9ddf0..d853dbb 100644 (file)
@@ -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();
 }
index 38b96e0..a76d1e8 100644 (file)
@@ -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++)
                {
index 64494e9..d767d3a 100644 (file)
@@ -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
 };
index 2c6aeb6..6ba02cf 100644 (file)
@@ -246,8 +246,6 @@ Int_t AliEMCALTriggerTRU::L0()
 //             for(Int_t j=0; j<fRegionSize->X(); j++)
 //                     for (Int_t k=0; k<fRegionSize->Y(); k++) fRegion[j][k] = fRegion[j][k]>>2; // go to 12b before shipping to STU
                
-               Int_t nP = 0;
-               
                for (Int_t j=0; j<fPatches->GetEntriesFast(); 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;xx<sizeX;xx++) 
@@ -272,39 +272,34 @@ Int_t AliEMCALTriggerTRU::L0()
                                        
                                        idx[index] = fMap[int(v.X()*fSubRegionSize->X())+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++)
        {