add protection against truncated events + coverity - Rachid
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALTriggerData.cxx
index 1a0e03a2f0de1dfe0c6be131acf17f60db7d109d..31f3577130a5e1242471bcd1c12466f04790e750 100644 (file)
@@ -24,6 +24,7 @@ Author: R. GUERNANE LPSC Grenoble CNRS/IN2P3
 #include "AliEMCALTriggerData.h"
 #include "AliEMCALTriggerPatch.h"
 #include "AliLog.h"
+#include "TIterator.h"
 #include "Riostream.h"
 
 ClassImp(AliEMCALTriggerData)
@@ -37,7 +38,11 @@ fL1GammaPatches(),
 fL1JetPatches(),
 fL1Region(),
 fL1GammaThreshold(0),
-fL1JetThreshold(0)
+fL1JetThreshold(0),
+fL1V0(),
+fL1FrameMask(0),
+fL1TriggerType(),
+fL1DataDecoded(0)
 {  
        //
        for (Int_t i = 0; i < 2; i++)
@@ -49,6 +54,9 @@ fL1JetThreshold(0)
        
        for (Int_t i = 0; i < 32; i++) for (Int_t j = 0; j < 24; j++) for (Int_t k = 0; k <  4; k++) fL0Region[i][j][k] = 0;
        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;
+       
+       fL1V0[0] = fL1V0[1] = 0;
+       for (Int_t i = 0; i < 8; i++) fL1TriggerType[i] = 0;    
 }
 
 //_____________
@@ -214,11 +222,31 @@ void AliEMCALTriggerData::GetL1Region(Int_t i, Int_t arr[][64]) const
 void AliEMCALTriggerData::Scan() const
 {
        //
+       TIterator* nP;
+
        printf("L0:\n");
-       printf("\tFound (%2d , %2d) patches\n", fL0Patches[0]->GetEntriesFast(), fL0Patches[1]->GetEntriesFast());
+       printf("\tFound (%2d,%2d) patches\n", fL0Patches[1]->GetEntriesFast(), fL0Patches[0]->GetEntriesFast());
+       printf("\tRAW:\n");
+       nP = fL0Patches[1]->MakeIterator();
+       while (AliEMCALTriggerPatch* p = (AliEMCALTriggerPatch*)nP->Next()) {printf("\t"); p->Print("");}
+       printf("\tREC:\n");
+       nP = fL0Patches[0]->MakeIterator();
+       while (AliEMCALTriggerPatch* p = (AliEMCALTriggerPatch*)nP->Next()) {printf("\t"); p->Print("");}
        printf("L1:\n");
-       printf("\tFound (%4d,%4d) gamma patches\n",fL1GammaPatches[0]->GetEntriesFast(), fL1GammaPatches[1]->GetEntriesFast());
-       printf("\tFound (%4d,%4d) jet patches\n",fL1JetPatches[0]->GetEntriesFast(), fL1JetPatches[1]->GetEntriesFast());
+       printf("\tFound (%4d,%4d) gamma patches\n",fL1GammaPatches[1]->GetEntriesFast(), fL1GammaPatches[0]->GetEntriesFast());
+       printf("\tRAW:\n");
+       nP = fL1GammaPatches[1]->MakeIterator();
+       while (AliEMCALTriggerPatch* p = (AliEMCALTriggerPatch*)nP->Next()) {printf("\t"); p->Print("");}
+       printf("\tREC:\n");
+       nP = fL1GammaPatches[0]->MakeIterator();
+       while (AliEMCALTriggerPatch* p = (AliEMCALTriggerPatch*)nP->Next()) {printf("\t"); p->Print("");}
+       printf("\tFound (%4d,%4d) jet patches\n",fL1JetPatches[1]->GetEntriesFast(), fL1JetPatches[0]->GetEntriesFast());
+       printf("\tRAW:\n");
+       nP = fL1JetPatches[1]->MakeIterator();
+       while (AliEMCALTriggerPatch* p = (AliEMCALTriggerPatch*)nP->Next()) {printf("\t"); p->Print("");}
+       printf("\tREC:\n");
+       nP = fL1JetPatches[0]->MakeIterator();
+       while (AliEMCALTriggerPatch* p = (AliEMCALTriggerPatch*)nP->Next()) {printf("\t"); p->Print("");}
 }
 
 //_____________
@@ -233,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;
 }