]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGGA/EMCALTasks/AliAnalysisTaskEMCALTriggerQA.cxx
- changes to new Conv Calo Task for efficient running on the grid
[u/mrichter/AliRoot.git] / PWGGA / EMCALTasks / AliAnalysisTaskEMCALTriggerQA.cxx
index d430cd6c249bf5f870aa4c579bd2240e8630ee6a..c543c8bd95b439f9e1c475d963198283aa30d59f 100644 (file)
 #include "AliCentrality.h"
 
 #include "AliVEvent.h"
-//#include "AliVVZERO.h"
 #include "AliVCaloTrigger.h"
-
-//#include "AliESDEvent.h"
 #include "AliESDVZERO.h"
-//#include "AliESDCaloTrigger.h"
 
 #include "AliEMCALGeometry.h"
 #include "AliEMCALRecoUtils.h"
@@ -58,9 +54,11 @@ fOutputList(0),            fRecoUtils(0x0),
 fGeoSet(0),                fGeometry(0),         fGeoName(""),
 fOADBSet(kFALSE),          fAccessOADB(kTRUE),   fOADBFilePath(""),
 fBitEGA(0),                fBitEJE(0),
-fEtaPhiEnMin(10.),
+fEtaPhiEnMin(3.),
 fSTUTotal(0),              fTRUTotal(0),
 fV0Trigger(0),             fV0A(0),              fV0C(0),
+fFillV0SigHisto(1),        fFillClusAcceptHisto(0),
+fMCData(kFALSE),
 fEventMB   (0),            fEventL0   (0),
 fEventL1G  (0),            fEventL1G2 (0),
 fEventL1J  (0),            fEventL1J2 (0),
@@ -115,9 +113,11 @@ fOutputList(0),            fRecoUtils(0x0),
 fGeoSet(0),                fGeometry(0),         fGeoName(""),
 fOADBSet(kFALSE),          fAccessOADB(kTRUE),   fOADBFilePath(""),
 fBitEGA(0),                fBitEJE(0),
-fEtaPhiEnMin(10.),
+fEtaPhiEnMin(3.),
 fSTUTotal(0),              fTRUTotal(0),
 fV0Trigger(0),             fV0A(0),              fV0C(0),
+fFillV0SigHisto(1),        fFillClusAcceptHisto(0),
+fMCData(kFALSE),
 fEventMB   (0),            fEventL0   (0),
 fEventL1G  (0),            fEventL1G2 (0),
 fEventL1J  (0),            fEventL1J2 (0),
@@ -251,31 +251,35 @@ void AliAnalysisTaskEMCALTriggerQA::FillCellMaps()
       posX = (nSupMod % 2) ? ieta + AliEMCALGeoParams::fgkEMCALCols : ieta;
       posY = iphi + AliEMCALGeoParams::fgkEMCALRows * int(nSupMod / 2);
       
-      if(int(posX/2) > fgkFALTROCols || int(posY/2) > fgkFALTRORows )
+      Int_t indexX = Int_t(posX/2);
+      Int_t indexY = Int_t(posY/2);
+      
+      if(indexX >= fgkFALTROCols || indexY >= fgkFALTRORows )
       {
-        if(DebugLevel() > 0) printf("AliAnalysisTaskEMCALTriggerQA::UserExec() - Wrong Position (x,y) = (%d,%d)\n",posX,posY);
+        if(DebugLevel() > 0) printf("AliAnalysisTaskEMCALTriggerQA::UserExec() - Wrong Position (x,y) = (%d,%d)\n",
+                                    posX,posY);
         continue;
       }
       
       // here it is the amplitude for each cell
-      fMapCell[int(posY/2)][int(posX/2)] += amp;
+      fMapCell[indexY][indexX] += amp;
       
       if(fEventL1G)
       {
-        fMapCellL1G[int(posY/2)][int(posX/2)] += amp;
-        //printf("L1G cell[%i,%i] amp=%f\n",int(posY/2),int(posX/2),fMapCellL1G[int(posY/2)][int(posX/2)]);
+        fMapCellL1G[indexY][indexX] += amp;
+        //printf("L1G cell[%i,%i] amp=%f\n",indexY,indexX,fMapCellL1G[indexY][indexX]);
       }
       
       if(fEventL1G2)
       {
-        fMapCellL1G2[int(posY/2)][int(posX/2)] += amp;
-        //printf("L1G2 cell[%i,%i] amp=%f\n",int(posY/2),int(posX/2),fMapCellL1G2[int(posY/2)][int(posX/2)]);
+        fMapCellL1G2[indexY][indexX] += amp;
+        //printf("L1G2 cell[%i,%i] amp=%f\n",indexY,indexX,fMapCellL1G2[indexY][indexX]);
       }
                        
-      if(fEventL1J)  fMapCellL1J [int(posY/2)][int(posX/2)] += amp;
-      if(fEventL1J2) fMapCellL1J2[int(posY/2)][int(posX/2)] += amp;
+      if(fEventL1J)  fMapCellL1J [indexY][indexX] += amp;
+      if(fEventL1J2) fMapCellL1J2[indexY][indexX] += amp;
                        
-      //printf("cell[%i,%i] amp=%f\n",int(posY/2),int(posX/2),fMapCell[int(posY/2)][int(posX/2)]);
+      //printf("cell[%i,%i] amp=%f\n",indexY,indexX,fMapCell[indexY][indexX]);
                        
     }
   }
@@ -300,7 +304,7 @@ void AliAnalysisTaskEMCALTriggerQA::FillTriggerPatchMaps(TString triggerclasses)
   
   trg.Reset();
   // loop on FASTOR
-       
+        
   while (trg.Next())
   {
     trg.GetPosition(posX,posY);
@@ -321,11 +325,10 @@ void AliAnalysisTaskEMCALTriggerQA::FillTriggerPatchMaps(TString triggerclasses)
       if(triggerclasses.Contains("CEMC7EJE-B-NOPF-CENTNOTRD") || triggerclasses.Contains("CPBI2EJE") || triggerclasses.Contains("CPBI2EJ1")) fMapTrigL0L1J[posY][posX] += ampL0;
       fTRUTotal += ampL0;
       
-      int l0fired = 0;
-      for (int itime = 0; itime < nTimes; itime++)
+      Int_t l0fired = 0;
+      for (Int_t itime = 0; itime < nTimes; itime++)
       {
         if (l0Times[itime] > 7 && l0Times[itime] < 10) l0fired = 1;
-        // time bin too open? restrict to time bin 8-9?
       }
                        
       if (l0fired)
@@ -343,12 +346,12 @@ void AliAnalysisTaskEMCALTriggerQA::FillTriggerPatchMaps(TString triggerclasses)
       if (ts > 0) fMapTrigL1[posY][posX] = ts;
       fSTUTotal += ts;
       // cout << "ts =" <<ts<<endl;
-                       
+
       //L1
-      Bool_t isEGA1 = ((bit >> fBitEGA  ) & 0x1) && fEventL1G  ;
-      Bool_t isEGA2 = ((bit >> fBitEGA+1) & 0x1) && fEventL1G2 ;
-      Bool_t isEJE1 = ((bit >> fBitEJE  ) & 0x1) && fEventL1J  ;
-      Bool_t isEJE2 = ((bit >> fBitEJE+1) & 0x1) && fEventL1J2 ;
+      Bool_t isEGA1 = ((bit >>  fBitEGA   ) & 0x1) && fEventL1G  ;
+      Bool_t isEGA2 = ((bit >> (fBitEGA+1)) & 0x1) && fEventL1G2 ;
+      Bool_t isEJE1 = ((bit >>  fBitEJE   ) & 0x1) && fEventL1J  ;
+      Bool_t isEJE2 = ((bit >> (fBitEJE+1)) & 0x1) && fEventL1J2 ;
       
       //if(isEGA1 || isEGA2 || isEJE1 || isEJE2) nL1Patch++;
       //if(isEJE1 || isEJE2) printf("Jet STU patch %d, time sum %d, posX %d , posY %d\n",nL1Patch,ts,posX, posY);
@@ -383,13 +386,14 @@ void AliAnalysisTaskEMCALTriggerQA::FillTriggerPatchMaps(TString triggerclasses)
       
     }
   }
-       
-  if (!nL0Patch)
-  {
-    fEventL0 = kFALSE;
-    if (!triggerclasses.Contains("CPBI2")) fEventL1G = fEventL1G2 = fEventL1J = fEventL1J2 = kFALSE; // pp running
-  }
-       
+//  // NOT SURE WHY THIS LINE, COMMENT IF NOT CLUSTER HISTO NOT FILLED FOR LHC13
+//  if (!nL0Patch)
+//  {
+//    fEventL0 = kFALSE;
+//    if (!triggerclasses.Contains("CPBI2")) fEventL1G = fEventL1G2 = fEventL1J = fEventL1J2 = kFALSE; // pp running
+//  }
+        
   if(fTRUTotal > fMaxTRUSignal && DebugLevel() > 0) printf("AliAnalysisTaskEMCALTriggerQA::FillTriggerPatchMaps() - Large fTRUTotal %f\n",fTRUTotal);
   if(fSTUTotal > fMaxSTUSignal && DebugLevel() > 0) printf("AliAnalysisTaskEMCALTriggerQA::FillTriggerPatchMaps() - Large fSTUTotal %d\n",fSTUTotal);
        
@@ -400,6 +404,12 @@ void AliAnalysisTaskEMCALTriggerQA::ClusterAnalysis()
 {
   // Loop on clusters and fill corresponding histograms
   
+  // Not interesting in case of data analysis, REVISE in future
+  if(fMCData) return ;
+  
+  // Init OADB
+  if(fAccessOADB) AccessOADB(); // only once
+  
   //Get Vertex
   Double_t v[3] = {0,0,0};
   InputEvent()->GetPrimaryVertex()->GetXYZ(v);
@@ -431,6 +441,9 @@ void AliAnalysisTaskEMCALTriggerQA::ClusterAnalysis()
   Float_t centrality = -1;
   if(InputEvent()->GetCentrality()) centrality = InputEvent()->GetCentrality()->GetCentralityPercentile("V0M");
   
+  //if(!fEventMB) printf("MB : %d; L0 : %d; L1-Gam1 : %d; L1-Gam2 : %d; L1-Jet1 : %d; L1-Jet2 : %d; Central : %d; SemiCentral : %d \n",
+       //       fEventMB,fEventL0,fEventL1G,fEventL1G2,fEventL1J,fEventL1J2,fEventCen,fEventSem);
+  
   for(Int_t icalo = 0; icalo < nCaloClusters; icalo++)
   {
     AliVCluster *clus = (AliVCluster*) (caloClus->At(icalo));
@@ -438,7 +451,7 @@ void AliAnalysisTaskEMCALTriggerQA::ClusterAnalysis()
     if(!clus->IsEMCAL()) continue;
     
     if(!fRecoUtils->IsGoodCluster(clus,fGeometry,InputEvent()->GetEMCALCells(),InputEvent()->GetBunchCrossNumber()))
-    continue;
+      continue;
     
     if(clus->GetNCells() < 2) continue ; // Avoid 1 cell clusters, noisy, exotic.
     
@@ -455,7 +468,7 @@ void AliAnalysisTaskEMCALTriggerQA::ClusterAnalysis()
     iphi/=2;
     
     if(ieta > fgkFALTROCols || iphi > fgkFALTRORows )
-    printf("AliAnalysisTaskEMCALTriggerQA::UserExec() - Wrong Position (x,y) = (%d,%d)\n",ieta,iphi);
+      printf("AliAnalysisTaskEMCALTriggerQA::UserExec() - Wrong Position (x,y) = (%d,%d)\n",ieta,iphi);
     
     e   = clus->E();
     eta = mom.Eta();
@@ -480,7 +493,10 @@ void AliAnalysisTaskEMCALTriggerQA::ClusterAnalysis()
     if( fEventL1G2) FillClusterHistograms(kL1GammaTrig2   ,kFALSE,e,eta,phi,ieta,iphi,centrality,fV0A+fV0C);
     if( fEventL1J ) FillClusterHistograms(kL1JetTrig      ,kFALSE,e,eta,phi,ieta,iphi,centrality,fV0A+fV0C);
     if( fEventL1J2) FillClusterHistograms(kL1JetTrig2     ,kFALSE,e,eta,phi,ieta,iphi,centrality,fV0A+fV0C);
-    
+
+    if( fEventL1G2 && !fEventL1G) FillClusterHistograms(kL1Gamma2OnlyGammaTrig,kFALSE,e,eta,phi,ieta,iphi,centrality,fV0A+fV0C);
+    if( fEventL1J2 && !fEventL1J) FillClusterHistograms(kL1Jet2OnlyJetTrig    ,kFALSE,e,eta,phi,ieta,iphi,centrality,fV0A+fV0C);
+
     if( fEventL1G && !fEventL1J )
     FillClusterHistograms       (kL1GammaOnlyTrig,kFALSE,e,eta,phi,ieta,iphi,centrality,fV0A+fV0C);
     if( fEventL1J && !fEventL1G )
@@ -503,7 +519,10 @@ void AliAnalysisTaskEMCALTriggerQA::ClusterAnalysis()
   if( fEventL1G2) FillClusterHistograms(kL1GammaTrig2   ,kTRUE,emax,etamax,phimax,ietamax,iphimax,centrality,fV0A+fV0C);
   if( fEventL1J ) FillClusterHistograms(kL1JetTrig      ,kTRUE,emax,etamax,phimax,ietamax,iphimax,centrality,fV0A+fV0C);
   if( fEventL1J2) FillClusterHistograms(kL1JetTrig2     ,kTRUE,emax,etamax,phimax,ietamax,iphimax,centrality,fV0A+fV0C);
-  
+
+  if( fEventL1G2 && !fEventL1G) FillClusterHistograms(kL1Gamma2OnlyGammaTrig,kTRUE,emax,etamax,phimax,ietamax,iphimax,centrality,fV0A+fV0C);
+  if( fEventL1J2 && !fEventL1J) FillClusterHistograms(kL1Jet2OnlyJetTrig    ,kTRUE,emax,etamax,phimax,ietamax,iphimax,centrality,fV0A+fV0C);
+
   if( fEventL1G && !fEventL1J )
   FillClusterHistograms         (kL1GammaOnlyTrig,kTRUE,emax,etamax,phimax,ietamax,iphimax,centrality,fV0A+fV0C);
   if( fEventL1J && !fEventL1G )
@@ -528,38 +547,52 @@ void AliAnalysisTaskEMCALTriggerQA::FillClusterHistograms(Int_t triggerNumber, B
   {
     fhClus   [triggerNumber]->Fill(e);
     fhClusCen[triggerNumber]->Fill(e,centrality);
-    fhClusV0 [triggerNumber]->Fill(e,fV0AC);
-    fhClusEta[triggerNumber]->Fill(e,eta);
-    fhClusPhi[triggerNumber]->Fill(e,phi);
-               
-    if(e > fEtaPhiEnMin)
+    if(fFillV0SigHisto) fhClusV0 [triggerNumber]->Fill(e,fV0AC);
+    
+    if(!fFillClusAcceptHisto)
     {
-      fhClusEtaPhiHigh       [triggerNumber]->Fill( eta, phi);
-      fhClusEtaPhiHighCellMax[triggerNumber]->Fill(ieta,iphi);
+      // just fill 2
+      if(e > fEtaPhiEnMin) fhClusEtaPhiHigh[triggerNumber]->Fill( eta, phi);
+      else                 fhClusEtaPhiLow [triggerNumber]->Fill( eta, phi);
     }
     else
     {
-      fhClusEtaPhiLow       [triggerNumber]->Fill( eta, phi);
-      fhClusEtaPhiLowCellMax[triggerNumber]->Fill(ieta,iphi);
+      fhClusEta[triggerNumber]->Fill(e,eta);
+      fhClusPhi[triggerNumber]->Fill(e,phi);
+      
+      if(e > fEtaPhiEnMin)
+      {
+        fhClusEtaPhiHigh       [triggerNumber]->Fill( eta, phi);
+        fhClusEtaPhiHighCellMax[triggerNumber]->Fill(ieta,iphi);
+      }
+      else
+      {
+        fhClusEtaPhiLow       [triggerNumber]->Fill( eta, phi);
+        fhClusEtaPhiLowCellMax[triggerNumber]->Fill(ieta,iphi);
+      }
     }
   }
   else
   {
     fhClusMax   [triggerNumber]->Fill(e);
     fhClusCenMax[triggerNumber]->Fill(e,centrality);
-    fhClusV0Max [triggerNumber]->Fill(e,fV0AC);
-    fhClusEtaMax[triggerNumber]->Fill(e,eta);
-    fhClusPhiMax[triggerNumber]->Fill(e,phi);
-               
-    if(e > fEtaPhiEnMin)
-    {
-      fhClusEtaPhiHighCluMax       [triggerNumber]->Fill( eta, phi);
-      fhClusEtaPhiHighCellMaxCluMax[triggerNumber]->Fill(ieta,iphi);
-    }
-    else
+    if(fFillV0SigHisto) fhClusV0Max [triggerNumber]->Fill(e,fV0AC);
+    
+    if(fFillClusAcceptHisto)
     {
-      fhClusEtaPhiLowCluMax       [triggerNumber]->Fill( eta, phi);
-      fhClusEtaPhiLowCellMaxCluMax[triggerNumber]->Fill(ieta,iphi);
+      fhClusEtaMax[triggerNumber]->Fill(e,eta);
+      fhClusPhiMax[triggerNumber]->Fill(e,phi);
+      
+      if(e > fEtaPhiEnMin)
+      {
+        fhClusEtaPhiHighCluMax       [triggerNumber]->Fill( eta, phi);
+        fhClusEtaPhiHighCellMaxCluMax[triggerNumber]->Fill(ieta,iphi);
+      }
+      else
+      {
+        fhClusEtaPhiLowCluMax       [triggerNumber]->Fill( eta, phi);
+        fhClusEtaPhiLowCellMaxCluMax[triggerNumber]->Fill(ieta,iphi);
+      }
     }
   }
 }
@@ -644,8 +677,12 @@ void AliAnalysisTaskEMCALTriggerQA::FillEventCounterHistogram()
     if(fEventCen || fEventSem) fhNEvents->Fill(16.5);
   }
        
-  if( fEventL1G2 )fhNEvents->Fill(6.5);
-  if( fEventL1J2 )fhNEvents->Fill(8.5);
+  if( fEventL1G2 )
+  {
+    fhNEvents->Fill(6.5);
+    if( !fEventL1G ) fhNEvents->Fill(18.5);
+    
+  }
   
   if( fEventL1J )
   {
@@ -654,6 +691,12 @@ void AliAnalysisTaskEMCALTriggerQA::FillEventCounterHistogram()
     if(fEventCen || fEventSem) fhNEvents->Fill(17.5);
   }
   
+  if( fEventL1J2 )
+  {
+    fhNEvents->Fill(8.5);
+    if( !fEventL1J ) fhNEvents->Fill(19.5);
+  }
+  
   if(fEventL1J && fEventL1G) fhNEvents->Fill(11.5);
   
 }
@@ -665,33 +708,43 @@ void AliAnalysisTaskEMCALTriggerQA::FillL1GammaPatchHistograms()
   
   // Study fakes  - Make it more understandable!!!
   
-  Int_t areAllFakes=2;
-  Int_t numberpatchNotFake=0; Int_t numberpatchFake=0;
+  Int_t    areAllFakes        = 2;
+  Int_t    numberpatchNotFake = 0;
+  Int_t    numberpatchFake    = 0;
 
-  Int_t threshold =10;// 10 GeV !it's not GeV it's ADC !!
-  //  bool isFake=kTRUE;
-  bool enoughE=kFALSE;
-  Double_t patchMax = 0;
-  Int_t colMax = -1;
-  Int_t rowMax = -1;
+  Int_t    threshold = 10;// it's not GeV it's ADC !!
+  Bool_t   enoughE   = kFALSE;
+  Double_t patchMax  = 0;
+  Int_t    colMax    = -1;
+  Int_t    rowMax    = -1;
+  Int_t    shiftCol  = -1;
+  Int_t    shiftRow  = -1;
   
   // loop on patchs
-  for (Int_t posx = 0; posx < 47; posx++)
+  for (Int_t posx = 0; posx < fgkFALTROCols; posx++)
   {
-    for (Int_t posy = 0; posy < 59; posy++)
+    for (Int_t posy = 0; posy < fgkFALTRORows; posy++)
     {
-      Double_t patchEnergy=0;
+      Double_t patchEnergy = 0;
       
-      if(fMapTrigL1G[posy][posx]>0)
+      if(fMapTrigL1G[posy][posx] > 0)
       {
-        for(Int_t irow=0;irow<2;irow++)
-        for(Int_t icol=0;icol<2;icol++)
+        for(Int_t irow = 0; irow < 2; irow++)
         {
-          // loop on cells
-          //       printf("cell[%i,%i]=%f\n",posy+icol,posx+irow, fMapCellL1G[posy+icol][posx+irow]);
-          patchEnergy += fMapCellL1G[posy+icol][posx+irow] ;
-          
-          if( fMapCellL1G[posy+icol][posx+irow] >threshold/2) enoughE=kTRUE;
+          for(Int_t icol = 0; icol < 2; icol++)
+          {
+            // loop on cells
+            shiftCol = posx+icol;
+            shiftRow = posy+irow;
+            
+            //     printf("cell[%i,%i]=%f\n",posy+icol,posx+irow, fMapCellL1G[posy+icol][posx+irow]);
+            if(shiftRow < fgkFALTRORows && shiftCol < fgkFALTROCols)
+            {
+              patchEnergy += fMapCellL1G[shiftRow][shiftCol] ;
+            
+              if( fMapCellL1G[shiftRow][shiftCol] > threshold/2 ) enoughE = kTRUE;
+            }
+          }
         }
         
         if (patchEnergy > patchMax)
@@ -706,13 +759,13 @@ void AliAnalysisTaskEMCALTriggerQA::FillL1GammaPatchHistograms()
           numberpatchNotFake++;
           fhL1GPatchNotFake ->Fill(posx,posy);
           fhL1GPatchNotFakeE->Fill(patchEnergy);
-          areAllFakes=1;
+          areAllFakes = 1;
         }
         else
         {
           numberpatchFake++;
-          areAllFakes=0;
-          fhL1GPatchFake->Fill(posx,posy);
+          areAllFakes = 0;
+          fhL1GPatchFake ->Fill(posx,posy);
           fhL1GPatchFakeE->Fill(patchEnergy);
         }
       }
@@ -722,30 +775,38 @@ void AliAnalysisTaskEMCALTriggerQA::FillL1GammaPatchHistograms()
   fhNPatchNotFake->Fill(areAllFakes,numberpatchNotFake);
   fhNPatchFake   ->Fill(areAllFakes,numberpatchFake);
   
-  if(areAllFakes==0)
+  if(areAllFakes == 0)
   {
     // loop on patchs
-    for (Int_t col = 0; col < 47; col++)
+    for (Int_t col = 0; col < fgkFALTROCols; col++)
     {
-      for (Int_t row = 0; row < 59; row++)
+      for (Int_t row = 0; row < fgkFALTRORows; row++)
       {
-        if(fMapTrigL1G[row][col]>0)
+        if(fMapTrigL1G[row][col] > 0)
         {
           //   cout <<"checking fMapTrigL1G[row][col]"<<fMapTrigL1G[row][col]<<endl;
           fhL1GPatchAllFake->Fill(col,row);
           
-          double patchEnergy=0;
-          for(Int_t irow=0;irow<2;irow++)
-          for(Int_t icol=0;icol<2;icol++)
-          patchEnergy += fMapCellL1G[col+icol][row+irow] ;
-          
+          Double_t patchEnergy=0;
+          for(Int_t irow = 0; irow < 2; irow++)
+          {
+            for(Int_t icol = 0; icol < 2; icol++)
+            {
+              shiftCol = col+icol;
+              shiftRow = row+irow;
+              
+              if(shiftRow < fgkFALTRORows && shiftCol < fgkFALTROCols)
+                patchEnergy += fMapCellL1G[shiftRow][shiftCol] ;
+
+            }
+          }
           fhL1GPatchAllFakeE->Fill(patchEnergy);
         }
       }
     }
     //  cout << "row max"<<rowMax<<" colmax"<<colMax<< " fMapTrigL1G[rowMax][colMax]"<< fMapTrigL1G[rowMax][colMax]<<endl;
     
-    if(fMapTrigL1G[rowMax][colMax]>0)
+    if(fMapTrigL1G[rowMax][colMax] > 0)
     {
       //  printf("\npatch max [%i,%i] = %f\n",rowMax,colMax,patchMax);
       fhL1GPatchAllFakeMax ->Fill(colMax,rowMax);
@@ -755,26 +816,34 @@ void AliAnalysisTaskEMCALTriggerQA::FillL1GammaPatchHistograms()
   else
   {
     // loop on patches
-    for (Int_t col = 0; col < 47; col++)
-    for (Int_t row = 0; row < 59; row++)
+    for (Int_t col = 0; col < fgkFALTROCols; col++)
     {
-      if(fMapTrigL1G[row][col]>0)
+      for (Int_t row = 0; row < fgkFALTRORows; row++)
       {
-        fhL1GPatchNotAllFake->Fill(col,row);
-        
-        double patchEnergy=0;
-        for(Int_t irow=0;irow<2;irow++)
-        for(Int_t icol=0;icol<2;icol++)
+        if(fMapTrigL1G[row][col] > 0)
         {
-          patchEnergy += fMapCellL1G[col+icol][row+irow] ;
+          fhL1GPatchNotAllFake->Fill(col,row);
+          
+          Double_t patchEnergy = 0;
+          for(Int_t irow = 0; irow < 2; irow++)
+          {
+            for(Int_t icol = 0; icol < 2; icol++)
+            {
+              shiftCol = col+icol;
+              shiftRow = row+irow;
+              
+              if(shiftRow < fgkFALTRORows && shiftCol < fgkFALTROCols)
+                patchEnergy += fMapCellL1G[shiftRow][shiftCol] ;
+            }
+          }
+          
+          fhL1GPatchNotAllFakeE->Fill(patchEnergy);
+          
         }
-        
-        fhL1GPatchNotAllFakeE->Fill(patchEnergy);
-        
       }
     }
     
-    if(fMapTrigL1G[rowMax][colMax]>0)
+    if(fMapTrigL1G[rowMax][colMax] > 0 )
     {
       fhL1GPatchNotAllFakeMax ->Fill(colMax,rowMax);
       fhL1GPatchNotAllFakeMaxE->Fill(patchMax);
@@ -782,8 +851,8 @@ void AliAnalysisTaskEMCALTriggerQA::FillL1GammaPatchHistograms()
   }
   
   fhGPMaxVV0TT->Fill(fV0Trigger, patchMax);
-  if( fEventL1G ) fhL1GPatchMax ->Fill(colMax,rowMax);
-  if( fEventL1G2 )fhL1G2PatchMax->Fill(colMax,rowMax);
+  if( fEventL1G )  fhL1GPatchMax ->Fill(colMax,rowMax);
+  if( fEventL1G2 ) fhL1G2PatchMax->Fill(colMax,rowMax);
   
 }
 
@@ -792,10 +861,11 @@ void AliAnalysisTaskEMCALTriggerQA::FillL1JetPatchHistograms()
 {
   // L1 Jet
   
-  Double_t patchMax = 0;
-  Int_t colMax = -1;
-  Int_t rowMax = -1;
-  Int_t col,row=0;
+  Double_t patchMax =  0;
+  Int_t    colMax   = -1;
+  Int_t    rowMax   = -1;
+  Int_t    col, row =  0;
+  
   for (Int_t i = 0; i < 9; i++)
   {
     for (Int_t j = 0; j < 12; j++)
@@ -822,8 +892,8 @@ void AliAnalysisTaskEMCALTriggerQA::FillL1JetPatchHistograms()
   }
   
   fhJPMaxVV0TT->Fill(fV0Trigger, patchMax);
-  if( fEventL1J ) fhL1JPatchMax ->Fill(colMax,rowMax);
-  if( fEventL1J2 )fhL1J2PatchMax->Fill(colMax,rowMax);
+  if( fEventL1J )  fhL1JPatchMax ->Fill(colMax,rowMax);
+  if( fEventL1J2 ) fhL1J2PatchMax->Fill(colMax,rowMax);
   
 }
 
@@ -863,6 +933,7 @@ void AliAnalysisTaskEMCALTriggerQA::FillV0Histograms()
 {
   //V0 analysis, only for ESDs
   
+  
   AliESDVZERO* eventV0 = dynamic_cast<AliESDVZERO*> (InputEvent()->GetVZEROData());
   
   if(eventV0)
@@ -873,12 +944,15 @@ void AliAnalysisTaskEMCALTriggerQA::FillV0Histograms()
       fV0A += eventV0->GetAdcV0A(i);
     }
     
-    if (fSTUTotal != 0)
+    if (fSTUTotal != 0 && fFillV0SigHisto)
     {
       fhV0STU->Fill(fV0A+fV0C,fSTUTotal);
       if( fV0A+fV0C > fMaxV0Signal && DebugLevel() > 0) printf("AliAnalysisTaskEMCALTriggerQA::UserExec() - Large fV0A+fV0C %f\n",fV0A+fV0C);
     }
     
+    // Not interesting in case of data analysis, REVISE in future
+    if(fMCData || !fFillV0SigHisto) return ;
+    
     if( fEventL1G )  fhV0[kL1GammaTrig]    ->Fill(fV0A+fV0C);
     if( fEventL1G2 ) fhV0[kL1GammaTrig2]   ->Fill(fV0A+fV0C);
     if( fEventL1J )  fhV0[kL1JetTrig]      ->Fill(fV0A+fV0C);
@@ -887,9 +961,10 @@ void AliAnalysisTaskEMCALTriggerQA::FillV0Histograms()
     if( fEventL0  )  fhV0[kL0Trig]         ->Fill(fV0A+fV0C);
     if( fEventCen )  fhV0[kCentralTrig]    ->Fill(fV0A+fV0C);
     if( fEventSem )  fhV0[kSemiCentralTrig]->Fill(fV0A+fV0C);
-    if( fEventL1G && !fEventL1J)  fhV0[kL1GammaOnlyTrig]->Fill(fV0A+fV0C);
-    if( fEventL1J && !fEventL1G)  fhV0[kL1JetOnlyTrig]  ->Fill(fV0A+fV0C);
-    
+    if( fEventL1G  && !fEventL1J) fhV0[kL1GammaOnlyTrig]      ->Fill(fV0A+fV0C);
+    if( fEventL1J  && !fEventL1G) fhV0[kL1JetOnlyTrig]        ->Fill(fV0A+fV0C);
+    if( fEventL1G2 && !fEventL1G) fhV0[kL1Gamma2OnlyGammaTrig]->Fill(fV0A+fV0C);
+    if( fEventL1J2 && !fEventL1J) fhV0[kL1Jet2OnlyJetTrig]    ->Fill(fV0A+fV0C);
     //if(nL0Patch!=0 || nL1Patch!=0) printf("total TRU %f, total STU %f, V0C+V0A %f; nL0 %d, nL1 %d \n",
     //       fTRUTotal,fSTUTotal,fV0A+fV0C,nL0Patch,nL1Patch);
   }
@@ -949,7 +1024,7 @@ void AliAnalysisTaskEMCALTriggerQA::InitGeometry()
   TFile* file = AliAnalysisManager::GetAnalysisManager()->GetTree()->GetCurrentFile();
        
   const TList *clist = file->GetStreamerInfoCache();
-  
   if(clist)
   {
     TStreamerInfo *cinfo = (TStreamerInfo*)clist->FindObject("AliESDCaloTrigger");
@@ -957,7 +1032,7 @@ void AliAnalysisTaskEMCALTriggerQA::InitGeometry()
     if(!cinfo)
     {
       cinfo = (TStreamerInfo*)clist->FindObject("AliAODCaloTrigger");
-      verid = 2; // newer AOD header version
+      verid = 3; // newer AOD header version
     }
     if(cinfo)
     {
@@ -997,7 +1072,7 @@ void AliAnalysisTaskEMCALTriggerQA::InitHistogramArrays()
 {
   //Histograms array initialization
   
-  for (Int_t i = 0; i < 10; i++)
+  for (Int_t i = 0; i < fgkTriggerCombi; i++)
   {
     fhV0     [i] = 0;
     fhClus   [i] = 0;              fhClusMax   [i] = 0;
@@ -1035,6 +1110,8 @@ void AliAnalysisTaskEMCALTriggerQA::SetTriggerEventBit( TString triggerclasses)
      (triggerclasses.Contains("-B-")  || triggerclasses.Contains("-I-"))       &&
                 triggerclasses.Contains("-NOPF-ALLNOTRD") )   fEventMB  = kTRUE;
   
+  if(fMCData && triggerclasses.Contains("MB")) fEventMB = kTRUE;
+  
   // EMC triggered event? Which type?
   if( triggerclasses.Contains("-B-") || triggerclasses.Contains("-S-") || triggerclasses.Contains("-I-") )
   {
@@ -1057,8 +1134,8 @@ void AliAnalysisTaskEMCALTriggerQA::SetTriggerEventBit( TString triggerclasses)
   if     (triggerclasses.Contains("CCENT_R2-B-NOPF-ALLNOTRD")) fEventCen = kTRUE;
   else if(triggerclasses.Contains("CSEMI_R1-B-NOPF-ALLNOTRD")) fEventSem = kTRUE;
 
-  //  printf("MB : %d; L0 : %d; L1-Gam : %d; L1-Jet : %d; Central : %d; SemiCentral : %d; Trigger Names : %s \n ",
-       //       fEventMB,fEventL0,fEventL1G,fEventL1J,fEventCen,fEventSem,triggerclasses.Data());
+  //printf("MB : %d; L0 : %d; L1-Gam1 : %d; L1-Gam2 : %d; L1-Jet1 : %d; L1-Jet2 : %d; Central : %d; SemiCentral : %d; Trigger Names : %s \n ",
+       //       fEventMB,fEventL0,fEventL1G,fEventL1G2,fEventL1J,fEventL1J2,fEventCen,fEventSem,triggerclasses.Data());
   
 }
 
@@ -1070,34 +1147,36 @@ void AliAnalysisTaskEMCALTriggerQA::UserCreateOutputObjects()
   fOutputList  = new TList;
   fOutputList ->SetOwner(kTRUE);
   
-  fhNEvents    = new TH1F("hNEvents","Number of selected events",18,0,18);
+  fhNEvents    = new TH1F("hNEvents","Number of selected events",20,0,20);
   fhNEvents   ->SetYTitle("N events");
   fhNEvents   ->GetXaxis()->SetBinLabel(1 ,"All");
   fhNEvents   ->GetXaxis()->SetBinLabel(2 ,"MB");
   fhNEvents   ->GetXaxis()->SetBinLabel(3 ,"Central Pb");
   fhNEvents   ->GetXaxis()->SetBinLabel(4 ,"SemiCentral Pb");
   fhNEvents   ->GetXaxis()->SetBinLabel(5 ,"L0");
-  fhNEvents   ->GetXaxis()->SetBinLabel(6 ,"L1-G");
+  fhNEvents   ->GetXaxis()->SetBinLabel(6 ,"L1-G1");
   fhNEvents   ->GetXaxis()->SetBinLabel(7 ,"L1-G2");
-  fhNEvents   ->GetXaxis()->SetBinLabel(8 ,"L1-J");
+  fhNEvents   ->GetXaxis()->SetBinLabel(8 ,"L1-J1");
   fhNEvents   ->GetXaxis()->SetBinLabel(9 ,"L1-J2");
-  fhNEvents   ->GetXaxis()->SetBinLabel(10 ,"L1-G & !L1-J");
-  fhNEvents   ->GetXaxis()->SetBinLabel(11 ,"L1-J & !L1-G");
-  fhNEvents   ->GetXaxis()->SetBinLabel(12 ,"L1-J & L1-G");
+  fhNEvents   ->GetXaxis()->SetBinLabel(10 ,"L1-G1 & !L1-J1");
+  fhNEvents   ->GetXaxis()->SetBinLabel(11 ,"L1-J1 & !L1-G1");
+  fhNEvents   ->GetXaxis()->SetBinLabel(12 ,"L1-J1 & L1-G1");
   fhNEvents   ->GetXaxis()->SetBinLabel(13 ,"MB & !L1 & !L0");
   fhNEvents   ->GetXaxis()->SetBinLabel(14,"L0 & !MB");
-  fhNEvents   ->GetXaxis()->SetBinLabel(15,"L1-G & !MB");
-  fhNEvents   ->GetXaxis()->SetBinLabel(16,"L1-J & !MB");
-  fhNEvents   ->GetXaxis()->SetBinLabel(17,"L1-G & (Cen | Semi)");
-  fhNEvents   ->GetXaxis()->SetBinLabel(18,"L1-J & (Cen | Semi)");
-  
+  fhNEvents   ->GetXaxis()->SetBinLabel(15,"L1-G1 & !MB");
+  fhNEvents   ->GetXaxis()->SetBinLabel(16,"L1-J1 & !MB");
+  fhNEvents   ->GetXaxis()->SetBinLabel(17,"L1-G1 & (Cen | Semi)");
+  fhNEvents   ->GetXaxis()->SetBinLabel(18,"L1-J1 & (Cen | Semi)");
+  fhNEvents   ->GetXaxis()->SetBinLabel(19,"L1-G2 & !L1-G1");
+  fhNEvents   ->GetXaxis()->SetBinLabel(20,"L1-J2 & !L1-J1");
+
   fhFORAmp     = new TH2F("hFORAmp", "FEE cells deposited energy, grouped like FastOR 2x2 per Row and Column",
                           fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
   fhFORAmp    ->SetXTitle("Index #eta (columnns)");
   fhFORAmp    ->SetYTitle("Index #phi (rows)");
   fhFORAmp    ->SetZTitle("Amplitude");
   
-  fhFORAmpL1G  = new TH2F("hFORAmpL1G", "FEE cells deposited energy, grouped like FastOR 2x2 per Row and Column, with L1G trigger condition",
+  fhFORAmpL1G  = new TH2F("hFORAmpL1G1", "FEE cells deposited energy, grouped like FastOR 2x2 per Row and Column, with L1G1 trigger condition",
                           fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
   fhFORAmpL1G ->SetXTitle("Index #eta (columnns)");
   fhFORAmpL1G ->SetYTitle("Index #phi (rows)");
@@ -1109,7 +1188,7 @@ void AliAnalysisTaskEMCALTriggerQA::UserCreateOutputObjects()
   fhFORAmpL1G2 ->SetYTitle("Index #phi (rows)");
   fhFORAmpL1G2 ->SetZTitle("Amplitude");
   
-  fhFORAmpL1J  = new TH2F("hFORAmpL1J", "FEE cells deposited energy, grouped like FastOR 2x2 per Row and Column, with L1J trigger condition",
+  fhFORAmpL1J  = new TH2F("hFORAmpL1J1", "FEE cells deposited energy, grouped like FastOR 2x2 per Row and Column, with L1J1 trigger condition",
                           fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
   fhFORAmpL1J ->SetXTitle("Index #eta (columnns)");
   fhFORAmpL1J ->SetYTitle("Index #phi (rows)");
@@ -1148,7 +1227,7 @@ void AliAnalysisTaskEMCALTriggerQA::UserCreateOutputObjects()
   fhL1Amp     ->SetYTitle("Index #phi (rows)");
   fhL1Amp     ->SetZTitle("Amplitude");
   
-  fhL1GAmp     = new TH2F("hL1GAmp","STU signal per Row and Column for L1 Gamma",
+  fhL1GAmp     = new TH2F("hL1G1Amp","STU signal per Row and Column for L1 Gamma1",
                           fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
   fhL1GAmp    ->SetXTitle("Index #eta (columnns)");
   fhL1GAmp    ->SetYTitle("Index #phi (rows)");
@@ -1160,7 +1239,7 @@ void AliAnalysisTaskEMCALTriggerQA::UserCreateOutputObjects()
   fhL1G2Amp    ->SetYTitle("Index #phi (rows)");
   fhL1G2Amp    ->SetZTitle("Amplitude");
   
-  fhL1JAmp     = new TH2F("hL1JAmp","STU signal per Row and Column for L1 Jet",
+  fhL1JAmp     = new TH2F("hL1J1Amp","STU signal per Row and Column for L1 Jet1",
                           fgkFALTROCols/4,0,fgkFALTROCols,fgkFALTRORows/4,0,fgkFALTRORows);
   fhL1JAmp    ->SetXTitle("Index #eta (columnns)");
   fhL1JAmp    ->SetYTitle("Index #phi (rows)");
@@ -1183,7 +1262,7 @@ void AliAnalysisTaskEMCALTriggerQA::UserCreateOutputObjects()
   fhL0Patch   ->SetYTitle("Index #phi (rows)");
   fhL0Patch   ->SetZTitle("counts");
   
-  fhL1GPatch   = new TH2F("hL1GPatch","FOR with associated L1 Gamma Patch",
+  fhL1GPatch   = new TH2F("hL1G1Patch","FOR with associated L1 Gamma Patch1",
                           fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
   fhL1GPatch  ->SetXTitle("Index #eta (columnns)");
   fhL1GPatch  ->SetYTitle("Index #phi (rows)");
@@ -1195,84 +1274,84 @@ void AliAnalysisTaskEMCALTriggerQA::UserCreateOutputObjects()
   fhL1G2Patch  ->SetYTitle("Index #phi (rows)");
   fhL1G2Patch  ->SetZTitle("counts");
   
-  fhL1GPatchNotFake   = new TH2F("hL1GPatchNotFake","FOR with L1 Gamma Patch associated to energetic cells",
+  fhL1GPatchNotFake   = new TH2F("hL1G1PatchNotFake","FOR with L1 Gamma1 Patch associated to energetic cells",
                                  fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
   fhL1GPatchNotFake  ->SetXTitle("Index #eta (columnns)");
   fhL1GPatchNotFake  ->SetYTitle("Index #phi (rows)");
   fhL1GPatchNotFake  ->SetZTitle("counts");
        
-  fhL1GPatchFake   = new TH2F("hL1GPatchFake","FOR without L1 Gamma Patch associated to energetic cells",
+  fhL1GPatchFake   = new TH2F("hL1G1PatchFake","FOR without L1 Gamma1 Patch associated to energetic cells",
                               fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
   fhL1GPatchFake  ->SetXTitle("Index #eta (columnns)");
   fhL1GPatchFake  ->SetYTitle("Index #phi (rows)");
   fhL1GPatchFake  ->SetZTitle("counts");
        
        
-  fhL1GPatchNotAllFake   = new TH2F("hL1GPatchNotAllFake","FOR with one L1 Gamma Patch associated to an energetic cell",
+  fhL1GPatchNotAllFake   = new TH2F("hL1G1PatchNotAllFake","FOR with one L1 Gamma1 Patch associated to an energetic cell",
                                     fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
   fhL1GPatchNotAllFake  ->SetXTitle("Index #eta (columnns)");
   fhL1GPatchNotAllFake  ->SetYTitle("Index #phi (rows)");
   fhL1GPatchNotAllFake  ->SetZTitle("counts");
        
-  fhL1GPatchAllFake   = new TH2F("hL1GPatchAllFake","FOR without any L1 Gamma Patch associated to an energetic cell",
+  fhL1GPatchAllFake   = new TH2F("hL1G1PatchAllFake","FOR without any L1 Gamma1 Patch associated to an energetic cell",
                                  fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
   fhL1GPatchAllFake  ->SetXTitle("Index #eta (columnns)");
   fhL1GPatchAllFake  ->SetYTitle("Index #phi (rows)");
   fhL1GPatchAllFake  ->SetZTitle("counts");
        
-  fhL1GPatchAllFakeMax   = new TH2F("hL1GPatchAllFakeMax","FOR with L1 Gamma Patch Max not associated to an energetic cell",
+  fhL1GPatchAllFakeMax   = new TH2F("hL1G1PatchAllFakeMax","FOR with L1 Gamma1 Patch Max not associated to an energetic cell",
                                     fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
   fhL1GPatchAllFakeMax  ->SetXTitle("Index #eta (columnns)");
   fhL1GPatchAllFakeMax  ->SetYTitle("Index #phi (rows)");
   fhL1GPatchAllFakeMax  ->SetZTitle("counts");
        
-  fhL1GPatchNotAllFakeMax   = new TH2F("hL1GPatchNotAllFakeMax","FOR with one L1 Gamma Patch Max associated to an energetic cell",
+  fhL1GPatchNotAllFakeMax   = new TH2F("hL1G1PatchNotAllFakeMax","FOR with one L1 Gamma1 Patch Max associated to an energetic cell",
                                        fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
   fhL1GPatchNotAllFakeMax  ->SetXTitle("Index #eta (columnns)");
   fhL1GPatchNotAllFakeMax  ->SetYTitle("Index #phi (rows)");
   fhL1GPatchNotAllFakeMax  ->SetZTitle("counts");
        
-       fhL1GPatchNotAllFakeMaxE   = new TH1F("hL1GPatchNotAllFakeMaxE","Energy distribution of FOR in events with L1 Gamma Patch Max associated to an energetic cell",
+       fhL1GPatchNotAllFakeMaxE   = new TH1F("hL1G1PatchNotAllFakeMaxE","Energy distribution of FOR in events with L1 Gamma1 Patch Max associated to an energetic cell",
                                         fNBinsClusterE,0,fMaxClusterE);
        fhL1GPatchNotAllFakeMaxE ->SetXTitle("Energy (GeV)");
   
        
-  fhL1GPatchAllFakeMaxE   = new TH1F("hL1GPatchAllFakeMaxE","Energy distribution of FOR in events with L1 Gamma Patch Max not associated to an energetic cell",
+  fhL1GPatchAllFakeMaxE   = new TH1F("hL1G1PatchAllFakeMaxE","Energy distribution of FOR in events with L1 Gamma1 Patch Max not associated to an energetic cell",
                                      fNBinsClusterE,0,fMaxClusterE);
        fhL1GPatchAllFakeMaxE ->SetXTitle("Energy (GeV)");
   
-  fhL1GPatchNotAllFakeE   = new TH1F("hL1GPatchNotAllFakeE","Energy distribution of FOR in events with L1 Gamma Patch not associated to an energetic cell",
+  fhL1GPatchNotAllFakeE   = new TH1F("hL1G1PatchNotAllFakeE","Energy distribution of FOR in events with L1 Gamma1 Patch not associated to an energetic cell",
                                      fNBinsClusterE,0,fMaxClusterE);
        fhL1GPatchNotAllFakeE ->SetXTitle("Energy (GeV)");
        
-  fhL1GPatchAllFakeE   = new TH1F("hL1GPatchAllFakeE","Energy distribution of FOR in events with L1 Gamma Patch  associated to an energetic cell",
+  fhL1GPatchAllFakeE   = new TH1F("hL1G1PatchAllFakeE","Energy distribution of FOR in events with L1 Gamma1 Patch  associated to an energetic cell",
                                   fNBinsClusterE,0,fMaxClusterE);
        fhL1GPatchAllFakeE ->SetXTitle("Energy (GeV)");
        
        
-  fhL1GPatchFakeE   = new TH1F("hL1GPatchFakeE","Energy distribution of FOR with L1 Gamma Patch not associated to an energetic cell",
+  fhL1GPatchFakeE   = new TH1F("hL1G1PatchFakeE","Energy distribution of FOR with L1 Gamma1 Patch not associated to an energetic cell",
                                fNBinsClusterE,0,fMaxClusterE);
        fhL1GPatchFakeE ->SetXTitle("Energy (GeV)");
        
-  fhL1GPatchNotFakeE   = new TH1F("hL1GPatchNotFakeE","Energy distribution of FOR with L1 Gamma Patch  associated to an energetic cell",
+  fhL1GPatchNotFakeE   = new TH1F("hL1G1PatchNotFakeE","Energy distribution of FOR with L1 Gamma1 Patch  associated to an energetic cell",
                                   fNBinsClusterE,0,fMaxClusterE);
        fhL1GPatchNotFakeE ->SetXTitle("Energy (GeV)");
        
-  fhNPatchFake   = new TH2F("hnpatchFake","number of fake patchs vs. all patchs are fake",
+  fhNPatchFake   = new TH2F("hNPatchFake","number of fake patchs vs. all patchs are fake",
                             3,0,3, 2880,0,2880);
   fhNPatchFake  ->SetYTitle("number of fake patchs");
   fhNPatchFake  ->SetXTitle("all fake event");
   fhNPatchFake  ->SetZTitle("counts");
        
        
-  fhNPatchNotFake   = new TH2F("hnpatchNotFake","number of Not fake patchs vs. all patchs are fake",
+  fhNPatchNotFake   = new TH2F("hNPatchNotFake","number of Not fake patchs vs. all patchs are fake",
                                3, 0, 3, 2000,0,2000);
   fhNPatchNotFake  ->SetYTitle("number of Not fake patchs");
   fhNPatchNotFake  ->SetXTitle("all fake event");
   fhNPatchNotFake  ->SetZTitle("counts");
        
        
-  fhL1JPatch   = new TH2F("hL1JPatch","FOR with associated L1 Jet Patch",
+  fhL1JPatch   = new TH2F("hL1J1Patch","FOR with associated L1 Jet1 Patch",
                           fgkFALTROCols/4,0,fgkFALTROCols,fgkFALTRORows/4,0,fgkFALTRORows);
   fhL1JPatch  ->SetXTitle("Index #eta (columnns)");
   fhL1JPatch  ->SetYTitle("Index #phi (rows)");
@@ -1284,12 +1363,14 @@ void AliAnalysisTaskEMCALTriggerQA::UserCreateOutputObjects()
   fhL1J2Patch  ->SetYTitle("Index #phi (rows)");
   fhL1J2Patch  ->SetZTitle("counts");
   
-  fhV0STU      = new TH2I("hV0STU","Total signal STU vs V0C+V0S",
-                          fNBinsV0Signal,0,fMaxV0Signal,fNBinsSTUSignal,0,fMaxSTUSignal);
-  fhV0STU     ->SetXTitle("Signal V0C+V0A");
-  fhV0STU     ->SetYTitle("Total signal STU");
-  fhV0STU     ->SetZTitle("counts");
-  
+  if(fFillV0SigHisto)
+  {
+    fhV0STU      = new TH2I("hV0STU","Total signal STU vs V0C+V0S",
+                            fNBinsV0Signal,0,fMaxV0Signal,fNBinsSTUSignal,0,fMaxSTUSignal);
+    fhV0STU     ->SetXTitle("Signal V0C+V0A");
+    fhV0STU     ->SetYTitle("Total signal STU");
+    fhV0STU     ->SetZTitle("counts");
+  }
   
   fhFEESTU     = new TH2F("hFEESTU","STU / FEE vs channel", fNBinsSTUFEERatio,0,fMaxSTUFEERatio,30,0,30);
   fhFEESTU    ->SetXTitle("STU/FEE signal");
@@ -1321,7 +1402,7 @@ void AliAnalysisTaskEMCALTriggerQA::UserCreateOutputObjects()
   fhL1MeanAmp->SetXTitle("Index #eta");
   fhL1MeanAmp->SetYTitle("Index #phi");
   
-  fhL1GPatchMax   = new TH2F("hL1GPatchMax","FOR of max amplitude patch with associated L1 Gamma Patch",
+  fhL1GPatchMax   = new TH2F("hL1G1PatchMax","FOR of max amplitude patch with associated L1 Gamma1 Patch",
                              fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
   fhL1GPatchMax  ->SetXTitle("Index #eta (columnns)");
   fhL1GPatchMax  ->SetYTitle("Index #phi (rows)");
@@ -1333,13 +1414,13 @@ void AliAnalysisTaskEMCALTriggerQA::UserCreateOutputObjects()
   fhL1G2PatchMax  ->SetYTitle("Index #phi (rows)");
   fhL1G2PatchMax  ->SetZTitle("counts");
   
-  fhL1JPatchMax   = new TH2F("hL1JPatchMax","FOR of max amplitude patch with associated L1 Jet Patch",
+  fhL1JPatchMax   = new TH2F("hL1J1PatchMax","FOR of max amplitude patch with associated L1 Jet1 Patch",
                              fgkFALTROCols/4,0,fgkFALTROCols,fgkFALTRORows/4,0,fgkFALTRORows);
   fhL1JPatchMax  ->SetXTitle("Index #eta (columnns)");
   fhL1JPatchMax  ->SetYTitle("Index #phi (rows)");
   fhL1JPatchMax  ->SetZTitle("counts");
        
-  fhL1J2PatchMax   = new TH2F("hL1JPatchMax","FOR of max amplitude patch with associated L1 Jet2 Patch",
+  fhL1J2PatchMax   = new TH2F("hL1J2PatchMax","FOR of max amplitude patch with associated L1 Jet2 Patch",
                               fgkFALTROCols/4,0,fgkFALTROCols,fgkFALTRORows/4,0,fgkFALTRORows);
   fhL1J2PatchMax  ->SetXTitle("Index #eta (columnns)");
   fhL1J2PatchMax  ->SetYTitle("Index #phi (rows)");
@@ -1396,10 +1477,18 @@ void AliAnalysisTaskEMCALTriggerQA::UserCreateOutputObjects()
   fOutputList->Add(fhL1JPatchMax);
   fOutputList->Add(fhL1J2PatchMax);
   
+  if(fMCData)
+  {
+    PostData(1, fOutputList);
+    return;
+  }
+  
   // Cluster histograms, E
-  TString hName [] = {"MB","L0","L1G","L1G2","L1J","L1J2","L1GOnly","L1JOnly","Central","SemiCentral"};
-  TString hTitle [] = {"MB trigger","L0 trigger","L1 Gamma trigger","L1 Gamma2 trigger","L1 Jet trigger","L1 Jet2 trigger",
-    "L1 Gamma trigger and not L1 Jet","L1 Jet trigger and not L1 Gamma","Central trigger","SemiCentral trigger"};
+  TString hName  [] = {"MB","L0","L1G1","L1G2","L1J1","L1J2","L1G1NoL1J1","L1J1NoLG1","L1G2NoL1G1","L1J2NoL1J1","Central","SemiCentral"};
+  TString hTitle [] = {"MB trigger","L0 trigger","L1 Gamma1 trigger","L1 Gamma2 trigger","L1 Jet1 trigger","L1 Jet2 trigger",
+                       "L1 Gamma1 trigger and not L1 Jet1"  ,"L1 Jet1 trigger and not L1 Gamma1",
+                       "L1 Gamma2 trigger and not L1 Gamma1","L1 Jet2 trigger and not L1 Jet1",
+                        "Central trigger","SemiCentral trigger"};
        
   for(Int_t i=0; i < 3; i++)
   {
@@ -1419,14 +1508,17 @@ void AliAnalysisTaskEMCALTriggerQA::UserCreateOutputObjects()
     fOutputList->Add(fhClusMaxMBPure[i]);
   }
   
-  for(Int_t i=0; i < 10; i++)
+  for(Int_t i=0; i < fgkTriggerCombi; i++)
   {
-    fhV0[i] = new TH1F(Form("hV0%s",hName[i].Data()),
-                       Form("V0 distribution for %s",hTitle[i].Data()),
-                       fNBinsV0Signal,0,fMaxV0Signal);
-    fhV0[i]->SetXTitle("V0");
-    fOutputList->Add(fhV0[i] );
-               
+    if(fFillV0SigHisto)
+    {
+      fhV0[i] = new TH1F(Form("hV0%s",hName[i].Data()),
+                         Form("V0 distribution for %s",hTitle[i].Data()),
+                         fNBinsV0Signal,0,fMaxV0Signal);
+      fhV0[i]->SetXTitle("V0");
+      fOutputList->Add(fhV0[i] );
+               }
+    
     fhClus[i]    = new TH1F(Form("hClus%s",hName[i].Data()),
                             Form("clusters E distribution for %s",hTitle[i].Data()),
                             fNBinsClusterE,0,fMaxClusterE);
@@ -1457,114 +1549,124 @@ void AliAnalysisTaskEMCALTriggerQA::UserCreateOutputObjects()
     
     // Cluster histograms, E vs V0
     
-    fhClusV0[i]    = new TH2F(Form("hClusV0%s",hName[i].Data()),
-                              Form("clusters E distribution vs V0 for %s",hTitle[i].Data()),
-                              fNBinsClusterE,0,fMaxClusterE,fNBinsV0Signal,0,fMaxV0Signal);
-    fhClusV0[i]   ->SetXTitle("Energy (GeV)");
-    fhClusV0[i]   ->SetYTitle("V0");
-    fOutputList->Add(fhClusV0[i]);
-    
-    fhClusV0Max[i] = new TH2F(Form("hClusV0Max%s",hName[i].Data()),
-                              Form("maximum energy cluster per event vs V0 for %s",hTitle[i].Data()),
-                              fNBinsClusterE,0,fMaxClusterE,fNBinsV0Signal,0,fMaxV0Signal);
-    fhClusV0Max[i]->SetXTitle("Energy (GeV)");
-    fhClusV0Max[i]->SetYTitle("V0");
-    fOutputList->Add(fhClusV0Max[i]);
-    
-    // Cluster histograms, E vs Pseudorapidity
-    Float_t etamin =-0.8;
-    Float_t etamax = 0.8;
-    Int_t neta     = 160;
-    fhClusEta[i]    = new TH2F(Form("hClusEta%s",hName[i].Data()),
-                               Form("clusters distribution vs #eta for %s",hTitle[i].Data()),
-                               fNBinsClusterE,0,fMaxClusterE,neta, etamin, etamax);
-    fhClusEta[i]   ->SetXTitle("Energy (GeV)");
-    fhClusEta[i]   ->SetYTitle("#eta");
-    fOutputList->Add(fhClusEta[i]);
+    if(fFillV0SigHisto)
+    {
+      fhClusV0[i]    = new TH2F(Form("hClusV0%s",hName[i].Data()),
+                                Form("clusters E distribution vs V0 for %s",hTitle[i].Data()),
+                                fNBinsClusterE,0,fMaxClusterE,fNBinsV0Signal,0,fMaxV0Signal);
+      fhClusV0[i]   ->SetXTitle("Energy (GeV)");
+      fhClusV0[i]   ->SetYTitle("V0");
+      fOutputList->Add(fhClusV0[i]);
+      
+      fhClusV0Max[i] = new TH2F(Form("hClusV0Max%s",hName[i].Data()),
+                                Form("maximum energy cluster per event vs V0 for %s",hTitle[i].Data()),
+                                fNBinsClusterE,0,fMaxClusterE,fNBinsV0Signal,0,fMaxV0Signal);
+      fhClusV0Max[i]->SetXTitle("Energy (GeV)");
+      fhClusV0Max[i]->SetYTitle("V0");
+      fOutputList->Add(fhClusV0Max[i]);
+    }
     
-    fhClusEtaMax[i] = new TH2F(Form("hClusEtaMax%s",hName[i].Data()),
-                               Form("maximum energy cluster per event vs #eta for %s",hTitle[i].Data()),
-                               fNBinsClusterE,0,fMaxClusterE,neta, etamin, etamax);
-    fhClusEtaMax[i]->SetXTitle("Energy (GeV)");
-    fhClusEtaMax[i]->SetYTitle("#eta");
-    fOutputList->Add(fhClusEtaMax[i]);
+    // Cluster acceptance histograms
+    Float_t etamin =-0.7;
+    Float_t etamax = 0.7;
+    Int_t neta     = 140;
     
-    // Cluster histograms, E vs Azimuthal angle
     Float_t phimin = 80. *TMath::DegToRad();
     Float_t phimax = 190.*TMath::DegToRad();
     Int_t   nphi   = 110;
     
-    fhClusPhi[i]    = new TH2F(Form("hClusPhi%s",hName[i].Data()),
-                               Form("clusters distribution vs #phi for %s",hTitle[i].Data()),
-                               fNBinsClusterE,0,fMaxClusterE,nphi, phimin, phimax);
-    fhClusPhi[i]   ->SetXTitle("Energy (GeV)");
-    fhClusPhi[i]   ->SetYTitle("#phi (rad)");
-    fOutputList->Add(fhClusPhi[i]);
-    
-    fhClusPhiMax[i] = new TH2F(Form("hClusPhiMax%s",hName[i].Data()),
-                               Form("maximum energy cluster per event vs #phi for %s",hTitle[i].Data()),
-                               fNBinsClusterE,0,fMaxClusterE,nphi, phimin, phimax);
-    fhClusPhiMax[i]->SetXTitle("Energy (GeV)");
-    fhClusPhiMax[i]->SetYTitle("#phi (rad)");
-    fOutputList->Add(fhClusPhiMax[i]);
-    
     // Cluster histograms, Pseudorapidity vs Azimuthal angle
     
     fhClusEtaPhiHigh[i]    = new TH2F(Form("hClusEtaPhiHigh%s",hName[i].Data()),
-                                      Form("clusters distribution #eta vs #phi for %s, E > 10 GeV",hTitle[i].Data()),
+                                      Form("clusters distribution #eta vs #phi for %s, E > %1.1f GeV",hTitle[i].Data(),fEtaPhiEnMin),
                                       neta, etamin, etamax,nphi, phimin, phimax);
     fhClusEtaPhiHigh[i]   ->SetXTitle("#eta");
     fhClusEtaPhiHigh[i]   ->SetYTitle("#phi (rad)");
     fOutputList->Add(fhClusEtaPhiHigh[i]);
     
-    fhClusEtaPhiHighCluMax[i] = new TH2F(Form("hClusEtaPhiHighCluMax%s",hName[i].Data()),
-                                         Form("maximum energy cluster per event #eta  vs #phi for %s, E > 10 GeV",hTitle[i].Data()),
-                                         neta, etamin, etamax,nphi, phimin, phimax);
-    fhClusEtaPhiHighCluMax[i]->SetXTitle("#eta");
-    fhClusEtaPhiHighCluMax[i]->SetYTitle("#phi (rad)");
-    fOutputList->Add(fhClusEtaPhiHighCluMax[i]);
-    
     fhClusEtaPhiLow[i]    = new TH2F(Form("hClusEtaPhiLow%s",hName[i].Data()),
-                                     Form("clusters distribution #eta vs #phi for %s, E < 10 GeV",hTitle[i].Data()),
+                                     Form("clusters distribution #eta vs #phi for %s, E < %1.1f GeV",hTitle[i].Data(),fEtaPhiEnMin),
                                      neta, etamin, etamax,nphi, phimin, phimax);
     fhClusEtaPhiLow[i]   ->SetXTitle("#eta");
     fhClusEtaPhiLow[i]   ->SetYTitle("#phi (rad)");
     fOutputList->Add(fhClusEtaPhiLow[i]);
-    
-    fhClusEtaPhiLowCluMax[i] = new TH2F(Form("hClusEtaPhiLowCluMax%s",hName[i].Data()),
-                                        Form("maximum energy cluster per event #eta  vs #phi for %s, E < 10 GeV",hTitle[i].Data()),
-                                        neta, etamin, etamax,nphi, phimin, phimax);
-    fhClusEtaPhiLowCluMax[i]->SetXTitle("#eta");
-    fhClusEtaPhiLowCluMax[i]->SetYTitle("#phi (rad)");
-    fOutputList->Add(fhClusEtaPhiLowCluMax[i]);
-    
-    fhClusEtaPhiHighCellMax[i]    = new TH2F(Form("hClusEtaPhiHighCellMax%s",hName[i].Data()),
-                                             Form("Cluster hit map in calorimeter (max cell), column vs row for %s, E > 10 GeV",hTitle[i].Data()),
-                                             fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
-    fhClusEtaPhiHighCellMax[i]   ->SetXTitle("Index #eta (columnns)");
-    fhClusEtaPhiHighCellMax[i]   ->SetYTitle("Index #phi (rows)");
-    fOutputList->Add(fhClusEtaPhiHighCellMax[i]);
-    
-    fhClusEtaPhiHighCellMaxCluMax[i] = new TH2F(Form("hClusEtaPhiHighCellMaxCluMax%s",hName[i].Data()),
-                                                Form("Max E cluster hit map in calorimeter (max cell), column vs row  for %s, E > 10 GeV",
-                                                     hTitle[i].Data()),fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
-    fhClusEtaPhiHighCellMaxCluMax[i]->SetXTitle("Index #eta (columnns)");
-    fhClusEtaPhiHighCellMaxCluMax[i]->SetYTitle("Index #phi (rows)");
-    fOutputList->Add(fhClusEtaPhiHighCellMaxCluMax[i]);
-    
-    fhClusEtaPhiLowCellMax[i]    = new TH2F(Form("hClusEtaPhiLowCellMax%s",hName[i].Data()),
-                                            Form("Cluster hit map in calorimeter (max cell), column vs row for %s, E < 10 GeV",hTitle[i].Data()),
-                                            fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
-    fhClusEtaPhiLowCellMax[i]   ->SetXTitle("Index #eta (columnns)");
-    fhClusEtaPhiLowCellMax[i]   ->SetYTitle("#phi (rad)");
-    fOutputList->Add(fhClusEtaPhiLowCellMax[i]);
-    
-    fhClusEtaPhiLowCellMaxCluMax[i] = new TH2F(Form("hClusEtaPhiLowCellMaxCluMax%s",hName[i].Data()),
-                                               Form("Max E cluster hit map in calorimeter (max cell), column vs row  for %s, E < 10 GeV",
-                                                    hTitle[i].Data()),fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
-    fhClusEtaPhiLowCellMaxCluMax[i]->SetXTitle("Index #eta (columnns)");
-    fhClusEtaPhiLowCellMaxCluMax[i]->SetYTitle("#phi (rad)");
-    fOutputList->Add(fhClusEtaPhiLowCellMaxCluMax[i]);
+
+    if(fFillClusAcceptHisto)
+    {
+      fhClusEtaPhiHighCluMax[i] = new TH2F(Form("hClusEtaPhiHighCluMax%s",hName[i].Data()),
+                                           Form("maximum energy cluster per event #eta  vs #phi for %s, E > %1.1f GeV",hTitle[i].Data(),fEtaPhiEnMin),
+                                           neta, etamin, etamax,nphi, phimin, phimax);
+      fhClusEtaPhiHighCluMax[i]->SetXTitle("#eta");
+      fhClusEtaPhiHighCluMax[i]->SetYTitle("#phi (rad)");
+      fOutputList->Add(fhClusEtaPhiHighCluMax[i]);
+      
+      fhClusEtaPhiLowCluMax[i] = new TH2F(Form("hClusEtaPhiLowCluMax%s",hName[i].Data()),
+                                          Form("maximum energy cluster per event #eta  vs #phi for %s, E < %1.1f GeV",hTitle[i].Data(),fEtaPhiEnMin),
+                                          neta, etamin, etamax,nphi, phimin, phimax);
+      fhClusEtaPhiLowCluMax[i]->SetXTitle("#eta");
+      fhClusEtaPhiLowCluMax[i]->SetYTitle("#phi (rad)");
+      fOutputList->Add(fhClusEtaPhiLowCluMax[i]);
+      
+      fhClusEtaPhiHighCellMax[i]    = new TH2F(Form("hClusEtaPhiHighCellMax%s",hName[i].Data()),
+                                               Form("Cluster hit map in calorimeter (max cell), column vs row for %s, E > %1.1f GeV",hTitle[i].Data(),fEtaPhiEnMin),
+                                               fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
+      fhClusEtaPhiHighCellMax[i]   ->SetXTitle("Index #eta (columnns)");
+      fhClusEtaPhiHighCellMax[i]   ->SetYTitle("Index #phi (rows)");
+      fOutputList->Add(fhClusEtaPhiHighCellMax[i]);
+      
+      fhClusEtaPhiHighCellMaxCluMax[i] = new TH2F(Form("hClusEtaPhiHighCellMaxCluMax%s",hName[i].Data()),
+                                                  Form("Max E cluster hit map in calorimeter (max cell), column vs row  for %s, E > %1.1f GeV",
+                                                       hTitle[i].Data(),fEtaPhiEnMin),fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
+      fhClusEtaPhiHighCellMaxCluMax[i]->SetXTitle("Index #eta (columnns)");
+      fhClusEtaPhiHighCellMaxCluMax[i]->SetYTitle("Index #phi (rows)");
+      fOutputList->Add(fhClusEtaPhiHighCellMaxCluMax[i]);
+      
+      fhClusEtaPhiLowCellMax[i]    = new TH2F(Form("hClusEtaPhiLowCellMax%s",hName[i].Data()),
+                                              Form("Cluster hit map in calorimeter (max cell), column vs row for %s, E < %1.1f GeV",hTitle[i].Data(),fEtaPhiEnMin),
+                                              fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
+      fhClusEtaPhiLowCellMax[i]   ->SetXTitle("Index #eta (columnns)");
+      fhClusEtaPhiLowCellMax[i]   ->SetYTitle("#phi (rad)");
+      fOutputList->Add(fhClusEtaPhiLowCellMax[i]);
+      
+      fhClusEtaPhiLowCellMaxCluMax[i] = new TH2F(Form("hClusEtaPhiLowCellMaxCluMax%s",hName[i].Data()),
+                                                 Form("Max E cluster hit map in calorimeter (max cell), column vs row  for %s, E < %1.1f GeV",
+                                                      hTitle[i].Data(),fEtaPhiEnMin),fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
+      fhClusEtaPhiLowCellMaxCluMax[i]->SetXTitle("Index #eta (columnns)");
+      fhClusEtaPhiLowCellMaxCluMax[i]->SetYTitle("#phi (rad)");
+      fOutputList->Add(fhClusEtaPhiLowCellMaxCluMax[i]);
+      
+      // Cluster histograms, E vs Pseudorapidity
+      
+      fhClusEta[i]    = new TH2F(Form("hClusEta%s",hName[i].Data()),
+                                 Form("clusters distribution vs #eta for %s",hTitle[i].Data()),
+                                 fNBinsClusterE,0,fMaxClusterE,neta, etamin, etamax);
+      fhClusEta[i]   ->SetXTitle("Energy (GeV)");
+      fhClusEta[i]   ->SetYTitle("#eta");
+      fOutputList->Add(fhClusEta[i]);
+      
+      fhClusEtaMax[i] = new TH2F(Form("hClusEtaMax%s",hName[i].Data()),
+                                 Form("maximum energy cluster per event vs #eta for %s",hTitle[i].Data()),
+                                 fNBinsClusterE,0,fMaxClusterE,neta, etamin, etamax);
+      fhClusEtaMax[i]->SetXTitle("Energy (GeV)");
+      fhClusEtaMax[i]->SetYTitle("#eta");
+      fOutputList->Add(fhClusEtaMax[i]);
+      
+      // Cluster histograms, E vs Azimuthal angle
+      
+      fhClusPhi[i]    = new TH2F(Form("hClusPhi%s",hName[i].Data()),
+                                 Form("clusters distribution vs #phi for %s",hTitle[i].Data()),
+                                 fNBinsClusterE,0,fMaxClusterE,nphi, phimin, phimax);
+      fhClusPhi[i]   ->SetXTitle("Energy (GeV)");
+      fhClusPhi[i]   ->SetYTitle("#phi (rad)");
+      fOutputList->Add(fhClusPhi[i]);
+      
+      fhClusPhiMax[i] = new TH2F(Form("hClusPhiMax%s",hName[i].Data()),
+                                 Form("maximum energy cluster per event vs #phi for %s",hTitle[i].Data()),
+                                 fNBinsClusterE,0,fMaxClusterE,nphi, phimin, phimax);
+      fhClusPhiMax[i]->SetXTitle("Energy (GeV)");
+      fhClusPhiMax[i]->SetYTitle("#phi (rad)");
+      fOutputList->Add(fhClusPhiMax[i]);
+    }
   }
   
   PostData(1, fOutputList);
@@ -1583,29 +1685,47 @@ void AliAnalysisTaskEMCALTriggerQA::UserExec(Option_t *)
     return;
   }
   
-  InitGeometry(); // only once, must be done before OADB, geo OADB accessed here
-  
-  if(fAccessOADB) AccessOADB(); // only once
-  
-  InitCellPatchMaps();   //init to 0 map for cells and patches
+  ////////////////////////////////////////////////
+  // Execute task on physics events with triggers
   
   //trigger configuration
   TString triggerclasses = event->GetFiredTriggerClasses();
   
+  // event type
   Int_t eventType = ((AliVHeader*)event->GetHeader())->GetEventType();
-  //std::cout << "trigger = " << triggerclasses << std::endl;
-
-  // physics events eventType=7, select only those
-  if(triggerclasses=="" || eventType != 7) return;
   
+  if(!fMCData)
+  {
+    // physics events eventType=7, select only those
+    if(triggerclasses=="" || eventType != 7) return;
+  }
+  
+  //printf("Event Type %d; Trigger classes: %s\n",eventType,triggerclasses.Data());
+  
+  // Check what trigger we had
   SetTriggerEventBit(triggerclasses);
-               
+  
+  if(!fEventMB && !fEventL0 && !fEventL1G && !fEventL1G2 && !fEventL1J && ! fEventL1J2 && !fEventCen && !fEventSem) return;
+  
+  ////////////////////////////
+  // Init geometry, OADB, maps
+  
+  InitGeometry(); // only once, must be done before OADB, geo OADB accessed here
+  
+  InitCellPatchMaps();   //init to 0 map for cells and patches
+  
+  ///////////////////
+  // Do the analysis
+  
   FillEventCounterHistogram();
   
   FillCellMaps();
   
   FillTriggerPatchMaps(triggerclasses);
   
+  //if(!fEventMB)printf("MB : %d; L0 : %d; L1-Gam1 : %d; L1-Gam2 : %d; L1-Jet1 : %d; L1-Jet2 : %d; Central : %d; SemiCentral : %d; Trigger Names : %s \n",
+  //                    fEventMB,fEventL0,fEventL1G,fEventL1G2,fEventL1J,fEventL1J2,fEventCen,fEventSem,triggerclasses.Data());
+
   FillMapHistograms();
   
   FillV0Histograms();