add protection against truncated events + coverity - Rachid
authorgconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 19 Apr 2011 13:36:19 +0000 (13:36 +0000)
committergconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 19 Apr 2011 13:36:19 +0000 (13:36 +0000)
EMCAL/AliEMCALReconstructor.cxx
EMCAL/AliEMCALTriggerData.cxx
EMCAL/AliEMCALTriggerData.h
EMCAL/AliEMCALTriggerRawDigitMaker.cxx
EMCAL/AliEMCALTriggerSTURawStream.cxx

index e41a446..83cbdc9 100644 (file)
@@ -258,7 +258,7 @@ void AliEMCALReconstructor::ConvertDigits(AliRawReader* rawReader, TTree* digits
   // Conversion from raw data to
   // EMCAL digits.
   // Works on a single-event basis
-  
+       
   rawReader->Reset() ; 
   
   fTriggerData->SetMode(1);    
@@ -273,7 +273,7 @@ void AliEMCALReconstructor::ConvertDigits(AliRawReader* rawReader, TTree* digits
   
   //Skip calibration events do the rest
   Bool_t doFit = kTRUE;
-  if ( !(GetRecParam()->FitLEDEvents()) && GetRecParam()->GetEventSpecie()==AliRecoParam::kCalib) doFit = kFALSE;
+//  if ( !(GetRecParam()->FitLEDEvents()) && GetRecParam()->GetEventSpecie()==AliRecoParam::kCalib) doFit = kFALSE;
   if (doFit){
     //must be done here because, in constructor, option is not yet known
     fgRawUtils->SetOption(GetOption());
@@ -390,7 +390,7 @@ void AliEMCALReconstructor::FillESD(TTree* digitsTree, TTree* clustersTree,
          trgESD->SetL1V0(v0);  
          trgESD->SetL1FrameMask(fTriggerData->GetL1FrameMask());            
 
-         if (!saveOnce) 
+         if (!saveOnce && fTriggerData->GetL1DataDecoded()) 
          {
                  int type[8] = {0};
                  fTriggerData->GetL1TriggerType(type);
index 6ecd9d0..31f3577 100644 (file)
@@ -41,7 +41,8 @@ fL1GammaThreshold(0),
 fL1JetThreshold(0),
 fL1V0(),
 fL1FrameMask(0),
-fL1TriggerType()
+fL1TriggerType(),
+fL1DataDecoded(0)
 {  
        //
        for (Int_t i = 0; i < 2; i++)
@@ -260,6 +261,8 @@ void AliEMCALTriggerData::Reset()
        }
                
        for (Int_t i = 0; i < 2; i++) for (Int_t j = 0; j < 48; j++) for (Int_t k = 0; k < 64; k++) fL1Region[i][j][k] = 0;
+       
+       fL1DataDecoded = 0;
 }
 
 
index 0391aa7..ab33d75 100644 (file)
@@ -36,6 +36,7 @@ public:
        virtual void SetL1FrameMask(     Int_t  v) {     fL1FrameMask = v;}            
        virtual void SetL1TriggerType(   Int_t* v) {for (int i = 0; i < 8; i++) fL1TriggerType[i] = v[i];}
 
+       virtual void SetL1DataDecoded(   Int_t  v) {   fL1DataDecoded = v;} 
        
        virtual void          GetL0Trigger(  Int_t i, Int_t j, Int_t& k  ) const {   k = fL0Trigger[i][j];}
        virtual Int_t         GetL0Trigger(  Int_t i, Int_t j            ) const {return fL0Trigger[i][j];}
@@ -51,6 +52,8 @@ public:
        virtual Int_t         GetL1FrameMask(               ) const {return fL1FrameMask;}            
        virtual void          GetL1TriggerType(   Int_t  v[]) const {for (int i = 0; i < 8; i++) v[i] = fL1TriggerType[i];}
        
+       virtual Int_t         GetL1DataDecoded(             ) const {return fL1DataDecoded;}
+       
        virtual Int_t         GetMode() const {return fMode;}
        
        virtual void          Scan() const;
@@ -61,9 +64,9 @@ private:
     AliEMCALTriggerData(const AliEMCALTriggerData& rhs);            // NOT implemented
        AliEMCALTriggerData& operator=(const AliEMCALTriggerData& rhs); // NOT implemented
        
-       Int_t                      fMode;
+       Int_t                      fMode;          //
        
-       Int_t           fL0Trigger[2][32];
+       Int_t               fL0Trigger[2][32];      //
        
        TClonesArray*       fL0Patches[2];          // array of patches  
        
@@ -81,6 +84,8 @@ private:
        Int_t             fL1FrameMask;             //
        Int_t           fL1TriggerType[8];          //
        
+       Int_t           fL1DataDecoded;
+       
        ClassDef(AliEMCALTriggerData,2)
 };
 
index 41ac1e1..4aa4e7c 100644 (file)
@@ -311,6 +311,8 @@ void AliEMCALTriggerRawDigitMaker::PostProcess()
        
        if (STUin && fSTURawStream && fSTURawStream->ReadPayLoad())
        {
+               fTriggerData->SetL1DataDecoded(1);
+               
                fTriggerData->SetL1GammaThreshold(fSTURawStream->GetL1GammaThreshold());
                fTriggerData->SetL1JetThreshold(  fSTURawStream->GetL1JetThreshold()  );
                
@@ -326,7 +328,7 @@ void AliEMCALTriggerRawDigitMaker::PostProcess()
                        fSTURawStream->GetJC(),
                        fSTURawStream->GetRegionEnable(), 
                        fSTURawStream->GetFwVersion()
-               };
+               };              
                
                fTriggerData->SetL1FrameMask(fSTURawStream->GetFrameReceived());
                fTriggerData->SetL1V0(v0);
index dc11833..50a072b 100644 (file)
@@ -193,9 +193,6 @@ Bool_t AliEMCALTriggerSTURawStream::ReadPayLoad()
                        
                        break;
                }
-               default:
-                       AliError(Form("ERROR: STU payload size does not match any of the expected sizes! %d word32",iword));
-                       break;
        }
        
        ///////////