add L1 patch cluster matching
authorgconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 21 Jun 2013 20:54:54 +0000 (20:54 +0000)
committergconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 21 Jun 2013 20:54:54 +0000 (20:54 +0000)
PWG/CaloTrackCorrBase/AliAnalysisTaskCaloTrackCorrelation.cxx
PWG/CaloTrackCorrBase/AliCaloTrackReader.cxx
PWG/CaloTrackCorrBase/AliCaloTrackReader.h

index 711ed07..5b4a555 100755 (executable)
@@ -166,6 +166,8 @@ void AliAnalysisTaskCaloTrackCorrelation::Init()
   if((fAna->GetReader())->GetDeltaAODFileName()!="")
          AliAnalysisManager::GetAnalysisManager()->RegisterExtraFile((fAna->GetReader())->GetDeltaAODFileName());
   
+       // Selected Trigger
+       fAna->GetReader()->SetEventTriggerMask(GetCollisionCandidates());
   if (DebugLevel() > 1) printf("AliAnalysisTaskCaloTrackCorrelation::Init() - End\n");
   
 }
index 5d6cc65..89e1e43 100755 (executable)
@@ -27,6 +27,7 @@
 // --- ROOT system ---
 #include <TFile.h>
 #include <TGeoManager.h>
+#include <TStreamerInfo.h>
 
 // ---- ANALYSIS system ----
 #include "AliMCEvent.h"
@@ -84,7 +85,14 @@ fSelectHybridTracks(0),      fSelectSPDHitTracks(kFALSE),
 fTrackMult(0),               fTrackMultEtaCut(0.9),
 fReadStack(kFALSE),          fReadAODMCParticles(kFALSE), 
 fDeltaAODFileName(""),       fFiredTriggerClassName(""),      
+
 fEventTriggerMask(0),        fMixEventTriggerMask(0),         fEventTriggerAtSE(0), 
+fEventTrigMinBias(0),        fEventTrigCentral(0),
+fEventTrigSemiCentral(0),    fEventTrigEMCALL0(0),
+fEventTrigEMCALL1Gamma1(0),  fEventTrigEMCALL1Gamma2(0), 
+fEventTrigEMCALL1Jet1(0),    fEventTrigEMCALL1Jet2(0),
+fBitEGA(0),                  fBitEJE(0),
+
 fAnaLED(kFALSE),
 fTaskName(""),               fCaloUtils(0x0), 
 fMixedEvent(NULL),           fNMixedEvent(0),                 fVertex(NULL), 
@@ -445,7 +453,7 @@ void AliCaloTrackReader::Init()
 
   if(!fESDtrackCuts)
     fESDtrackCuts = AliESDtrackCuts::GetStandardTPCOnlyTrackCuts(); //initialize with TPC only tracks
-
+       
 }
 
 //_______________________________________
@@ -911,8 +919,11 @@ Bool_t AliCaloTrackReader::FillInputEvent(const Int_t iEntry,
   // or out BC cluster
   //----------------------------------------------------------------------
 
+       // Set a bit with the event kind, MB, L0, L1 ... 
+       SetEventTriggerBit();
+       
   //Get Patches that triggered
-  TArrayI patches = GetL0TriggerPatches();
+  TArrayI patches = GetTriggerPatches();
 /*
   if(fRemoveExoticEvents)
   {
@@ -945,7 +956,7 @@ Bool_t AliCaloTrackReader::FillInputEvent(const Int_t iEntry,
     //       fIsExoticEvent,fIsBadCellEvent, fIsBadMaxCellEvent, fTriggerClusterBC,fIsTriggerMatch);
     if     (fIsExoticEvent)         return kFALSE;
     else if(fIsBadCellEvent)        return kFALSE;
-    else if(fTriggerClusterBC == 0) return kFALSE;
+    else if(fTriggerClusterBC != 0) return kFALSE;
     //printf("\t *** YES\n");
   }
   
@@ -1829,17 +1840,18 @@ Bool_t AliCaloTrackReader::CheckForPrimaryVertex()
 }
 
 //_______________________________________________
-TArrayI AliCaloTrackReader::GetL0TriggerPatches()
+TArrayI AliCaloTrackReader::GetTriggerPatches()
 {
-  //Select the patches that triggered
-  
+  // Select the patches that triggered
+  // Depend on L0 or L1
+       
   // some variables
   Int_t  trigtimes[30], globCol, globRow,ntimes, i;
   Int_t  absId  = -1; //[100];
   Int_t  nPatch = 0;
-  
+       
   TArrayI patches(0);
-  
+       
   // get object pointer
   AliVCaloTrigger *caloTrigger = GetInputEvent()->GetCaloTrigger( "EMCAL" );
   
@@ -1855,42 +1867,72 @@ TArrayI AliCaloTrackReader::GetL0TriggerPatches()
       // get position in global 2x2 tower coordinates
       caloTrigger->GetPosition( globCol, globRow );
       
-      // get dimension of time arrays
-      caloTrigger->GetNL0Times( ntimes );
-      
-      // no L0s in this channel
-      // presence of the channel in the iterator still does not guarantee that L0 was produced!!
-      if( ntimes < 1 )
-        continue;
-      
-      // get timing array
-      caloTrigger->GetL0Times( trigtimes );
-      
-      //printf("trigger time window %d - %d\n",fTriggerPatchTimeWindow[0],fTriggerPatchTimeWindow[1]);
-      // go through the array
-      for( i = 0; i < ntimes; i++ )
-      {
-        // check if in cut - 8,9 shall be accepted in 2011
-        if( trigtimes[i] >= fTriggerPatchTimeWindow[0] && trigtimes[i] <= fTriggerPatchTimeWindow[1] )
-        {
-          //printf("Accepted trigger time %d \n",trigtimes[i]);
-          //if(nTrig > 99) continue;
-          GetCaloUtils()->GetEMCALGeometry()->GetAbsFastORIndexFromPositionInEMCAL(globCol,globRow, absId);//absIDTrig[nTrig]) ;
-          //printf("pass the time cut globCol %d, globRow %d absId %d\n",globCol,globRow, absIDTrig[nTrig]);
-          patches.Set(nPatch+1);
-          patches.AddAt(absId,nPatch++);
-        }
-      } // trigger time array
-      
+                       //L0
+                       if(IsEventEMCALL0())
+                       {
+                               // get dimension of time arrays
+                               caloTrigger->GetNL0Times( ntimes );
+                               
+                               // no L0s in this channel
+                               // presence of the channel in the iterator still does not guarantee that L0 was produced!!
+                               if( ntimes < 1 )
+                                       continue;
+                               
+                               // get timing array
+                               caloTrigger->GetL0Times( trigtimes );
+                               
+                               //printf("trigger time window %d - %d\n",fTriggerPatchTimeWindow[0],fTriggerPatchTimeWindow[1]);
+                               // go through the array
+                               for( i = 0; i < ntimes; i++ )
+                               {
+                                       // check if in cut - 8,9 shall be accepted in 2011
+                                       if( trigtimes[i] >= fTriggerPatchTimeWindow[0] && trigtimes[i] <= fTriggerPatchTimeWindow[1] )
+                                       {
+                                               //printf("Accepted trigger time %d \n",trigtimes[i]);
+                                               //if(nTrig > 99) continue;
+                                               GetCaloUtils()->GetEMCALGeometry()->GetAbsFastORIndexFromPositionInEMCAL(globCol,globRow, absId);
+                                               //printf("pass the time cut globCol %d, globRow %d absId %d\n",globCol,globRow, absIDTrig[nTrig]);
+                                               patches.Set(nPatch+1);
+                                               patches.AddAt(absId,nPatch++);
+                                       }
+                               } // trigger time array
+      }//L0
+                       else if(IsEventEMCALL1()) // L1
+                       {
+                               Int_t bit = 0;
+                               caloTrigger->GetTriggerBits(bit);
+                                       
+                               Bool_t isEGA = ((bit >> fBitEGA) & 0x1) && IsEventEMCALL1Gamma() ;
+                               Bool_t isEJE = ((bit >> fBitEJE) & 0x1) && IsEventEMCALL1Jet  () ;
+                               
+                               if(!isEGA && !isEJE) continue;
+                               
+                               Int_t patchsize = -1;
+                               if      (isEGA) patchsize =  2;
+                               else if (isEJE) patchsize = 16;
+                               
+                               // add 2x2 (EGA) or 16x16 (EJE) patches
+                               for(Int_t irow=0; irow < patchsize; irow++)
+                               {
+                                       for(Int_t icol=0; icol < patchsize; icol++)
+                                       {
+                                               GetCaloUtils()->GetEMCALGeometry()->GetAbsFastORIndexFromPositionInEMCAL(globCol+icol,globRow+irow, absId);
+                                               //printf("pass the time cut globCol %d, globRow %d absId %d\n",globCol,globRow, absIDTrig[nTrig]);
+                                               patches.Set(nPatch+1);
+                                               patches.AddAt(absId,nPatch++);  
+                                       }
+                               }
+                               
+                       } // L1
+                       
     } // trigger iterator
   } // go thorough triggers
 
-  //printf("N patches %d, test %d,first %d, last %d\n",patches.GetSize(), nTrig, patches.At(0), patches.At(patches.GetSize()-1));
+  //printf("N patches %d, test %d,first %d, last %d\n",patches.GetSize(), nPatch, patches.At(0), patches.At(patches.GetSize()-1));
   
   return patches;
 }
 
-
 //______________________________________________________________________
 void  AliCaloTrackReader::MatchTriggerCluster(TArrayI patches)
 {
@@ -1906,7 +1948,7 @@ void  AliCaloTrackReader::MatchTriggerCluster(TArrayI patches)
   fIsBadMaxCellEvent   = kFALSE;
   
   // Do only analysis for triggered events
-  if(!GetFiredTriggerClasses().Contains("EMC"))
+  if(!IsEventEMCALL1() && !IsEventEMCALL0())
   {
     fTriggerClusterBC = 0;
     return;
@@ -1945,7 +1987,12 @@ void  AliCaloTrackReader::MatchTriggerCluster(TArrayI patches)
   Bool_t  exoMax      = kFALSE;
   
   Int_t   nOfHighECl  = 0 ;
-
+       
+       Float_t minE = fTriggerEventThreshold / 2.;
+       // This method is not really suitable for JET trigger
+       // but in case, reduce the energy cut since we do not trigger on high energy particle
+       if(IsEventEMCALL1()) minE = 1;
+       
   // Loop on the clusters, check if there is any that falls into one of the patches
   for (Int_t iclus =  0; iclus <  nclusters; iclus++)
   {
@@ -1958,7 +2005,7 @@ void  AliCaloTrackReader::MatchTriggerCluster(TArrayI patches)
     if ( !IsEMCALCluster(clus)) continue ;
       
     //Skip clusters with too low energy to be triggering
-    if ( clus->E() < fTriggerEventThreshold / 2. ) continue ;
+    if ( clus->E() < minE )    continue ;
     
     Float_t  frac       = -1;
     Int_t    absIdMax   = GetCaloUtils()->GetMaxEnergyCell(fInputEvent->GetEMCALCells(), clus,frac);
@@ -1992,8 +2039,8 @@ void  AliCaloTrackReader::MatchTriggerCluster(TArrayI patches)
       GetCaloUtils()->GetEMCALRecoUtils()->RecalibrateCellTime(absIdMax,fInputEvent->GetBunchCrossNumber(),tof);
     tof *=1.e9;
     
-//    printf("cluster %d, ID %d, E %2.2f, tof %2.2f, AbsId max %d, exotic %d, bad Cluster %d, bad Cell %d\n",
-//           iclus,idclus, energy,tof,absIdMax, exotic, badCluster,badCell);
+    //printf("cluster %d, ID %d, E %2.2f, tof %2.2f, AbsId max %d, exotic %d, bad Cluster %d, bad Cell %d\n",
+    //       iclus,idclus, energy,tof,absIdMax, exotic, badCluster,badCell);
 
     // Find the highest energy cluster, avobe trigger threshold
     // in the event in case no match to trigger is found
@@ -2117,6 +2164,154 @@ Bool_t  AliCaloTrackReader::RejectLEDEvents()
   
 }
 
+//___________________________________________
+void AliCaloTrackReader::SetEventTriggerBit()
+{
+ // Tag event depeding on trigger name
+       
+       fEventTrigMinBias       = kFALSE;        
+       fEventTrigCentral       = kFALSE;
+       fEventTrigSemiCentral   = kFALSE;    
+       fEventTrigEMCALL0       = kFALSE;
+       fEventTrigEMCALL1Gamma1 = kFALSE;  
+       fEventTrigEMCALL1Gamma2 = kFALSE; 
+       fEventTrigEMCALL1Jet1   = kFALSE;    
+       fEventTrigEMCALL1Jet2   = kFALSE; 
+       
+       if(fEventTriggerMask <=0 )// in case no mask set 
+       {
+               // EMC triggered event? Which type?
+               if( GetFiredTriggerClasses().Contains("-B-") || GetFiredTriggerClasses().Contains("-S-") || GetFiredTriggerClasses().Contains("-I-") )
+               {
+                       if     ( GetFiredTriggerClasses().Contains("EGA" ) || 
+                                                       GetFiredTriggerClasses().Contains("EG1" )   )
+                       { 
+                               fEventTrigEMCALL1Gamma1 = kTRUE;   
+                               if( GetFiredTriggerClasses().Contains("EG1" ) && !fFiredTriggerClassName.Contains("EG1") ) fEventTrigEMCALL1Gamma1 = kFALSE;   
+                       }
+                       else if( GetFiredTriggerClasses().Contains("EG2" )   )
+                       {                                      
+                               fEventTrigEMCALL1Gamma2   = kTRUE; 
+                               if( !fFiredTriggerClassName.Contains("EG2") ) fEventTrigEMCALL1Gamma2 = kFALSE;   
+                       }
+                       else if( GetFiredTriggerClasses().Contains("EJE" ) || 
+                                                       GetFiredTriggerClasses().Contains("EJ1" )   )
+                       { 
+                               fEventTrigEMCALL1Jet1   = kTRUE;
+                               if( GetFiredTriggerClasses().Contains("EJ1" ) && !fFiredTriggerClassName.Contains("EJ1") ) 
+                                       fEventTrigEMCALL1Jet1 = kFALSE;   
+                       }
+                       else if( GetFiredTriggerClasses().Contains("EJ2" )   )
+                       {
+                               fEventTrigEMCALL1Jet2   = kTRUE;
+                               if( !fFiredTriggerClassName.Contains("EJ2") ) fEventTrigEMCALL1Jet2 = kFALSE;   
+                       }
+                       else if( GetFiredTriggerClasses().Contains("CEMC") && 
+                                                       !GetFiredTriggerClasses().Contains("EGA" ) &&
+                                                       !GetFiredTriggerClasses().Contains("EJE" ) &&
+                                                       !GetFiredTriggerClasses().Contains("EG1" ) &&
+                                                       !GetFiredTriggerClasses().Contains("EJ1" ) &&
+                                                       !GetFiredTriggerClasses().Contains("EG2" ) && 
+                                                       !GetFiredTriggerClasses().Contains("EJ2" )    )
+                               fEventTrigEMCALL0 = kTRUE;
+                       
+                       //Min bias event trigger?
+                       if     (GetFiredTriggerClasses().Contains("CCENT_R2-B-NOPF-ALLNOTRD")) 
+                               fEventTrigCentral     = kTRUE;
+                       else if(GetFiredTriggerClasses().Contains("CSEMI_R1-B-NOPF-ALLNOTRD")) 
+                               fEventTrigSemiCentral = kTRUE;
+                       else if((GetFiredTriggerClasses().Contains("CINT") || GetFiredTriggerClasses().Contains("CPBI2_B1") ) && 
+                                                        GetFiredTriggerClasses().Contains("-NOPF-ALLNOTRD") ) 
+                               fEventTrigMinBias = kTRUE;
+               }
+       }
+       else
+       {
+               // EMC L1 Gamma
+               if     ( fEventTriggerMask & AliVEvent::kEMCEGA      )
+               {               
+                       if     (GetFiredTriggerClasses().Contains("EG1" ) ||
+                                                 GetFiredTriggerClasses().Contains("EGA" )    )
+                       {
+                               fEventTrigEMCALL1Gamma1 = kTRUE;        
+                               if( GetFiredTriggerClasses().Contains("EG1" ) && !fFiredTriggerClassName.Contains("EG1") ) fEventTrigEMCALL1Gamma1 = kFALSE;   
+                       }
+                       else if(GetFiredTriggerClasses().Contains("EG2" ))
+                       {
+                               fEventTrigEMCALL1Gamma2 = kTRUE;        
+                               if(!fFiredTriggerClassName.Contains("EG2") ) fEventTrigEMCALL1Gamma2 = kFALSE;   
+                       }
+               }
+               // EMC L1 Jet
+               else if( fEventTriggerMask & AliVEvent::kEMCEJE      )
+               {               
+                       if     (GetFiredTriggerClasses().Contains("EJ1" )||
+                                                 GetFiredTriggerClasses().Contains("EJE" )  )
+                       {
+                               fEventTrigEMCALL1Jet1 = kTRUE;                  
+                               if( GetFiredTriggerClasses().Contains("EJ1" ) && !fFiredTriggerClassName.Contains("EJ1") ) fEventTrigEMCALL1Jet1 = kFALSE;   
+                       }
+                       else if(GetFiredTriggerClasses().Contains("EJ2" ))
+                       {
+                               fEventTrigEMCALL1Jet2 = kTRUE;                          
+                               if( !fFiredTriggerClassName.Contains("EJ2") ) fEventTrigEMCALL1Jet2 = kFALSE;   
+                       }
+               }
+               // EMC L0
+               else if((fEventTriggerMask & AliVEvent::kEMC7) ||    
+                                               (fEventTriggerMask & AliVEvent::kEMC1)       )          
+                       fEventTrigEMCALL0 = kTRUE;              
+               // Min Bias Pb-Pb
+               else if( fEventTriggerMask & AliVEvent::kCentral     )          
+                       fEventTrigSemiCentral = kTRUE;
+               // Min Bias Pb-Pb
+               else if( fEventTriggerMask & AliVEvent::kSemiCentral )          
+                       fEventTrigCentral = kTRUE;
+    // Min Bias pp, PbPb, pPb
+               else if((fEventTriggerMask & AliVEvent::kMB  ) || 
+                                               (fEventTriggerMask & AliVEvent::kINT7) || 
+                                               (fEventTriggerMask & AliVEvent::kINT8)       )          
+                       fEventTrigMinBias = kTRUE;
+  }
+       
+       if(fDebug > 0 )
+               printf("AliCaloTrackReader::SetEventTriggerBit() - Event bits: \n \t MB   %d, Cen  %d, Sem  %d, L0   %d, L1G1 %d, L1G2 %d, L1J1 %d, L1J2 %d \n",
+                                        fEventTrigMinBias,      fEventTrigCentral,       fEventTrigSemiCentral, 
+                                        fEventTrigEMCALL0 ,     fEventTrigEMCALL1Gamma1, fEventTrigEMCALL1Gamma2,
+                                        fEventTrigEMCALL1Jet1 , fEventTrigEMCALL1Jet2);
+       
+       if(fBitEGA == 0 && fBitEJE ==0) 
+       {
+               // Init the trigger bit once, correct depending on version
+               fBitEGA = 4; 
+               fBitEJE = 5;    
+               
+               TFile* file = AliAnalysisManager::GetAnalysisManager()->GetTree()->GetCurrentFile();
+               
+               const TList *clist = file->GetStreamerInfoCache();
+               
+               if(clist)
+               {  
+                       TStreamerInfo *cinfo = (TStreamerInfo*)clist->FindObject("AliESDCaloTrigger");
+                       if(!cinfo)     cinfo = (TStreamerInfo*)clist->FindObject("AliAODCaloTrigger");
+                       
+                       if(cinfo) 
+                       {
+                               Int_t classversionid = cinfo->GetClassVersion();
+                               
+                               if (classversionid >= 5) 
+                               {
+                                       fBitEGA = 6;
+                                       fBitEJE = 8;
+                               }
+                       }  else printf("AliCaloTrackReader()::Init() - Streamer info for trigger class not available, bit not changed\n");
+               } else printf("AliCaloTrackReader::Init() -  Streamer list not available!, bit not changed\n");
+               
+       } // set once the EJE, EGA trigger bit
+       
+}
+
+
 //____________________________________________________________
 void  AliCaloTrackReader::SetTrackCuts(AliESDtrackCuts * cuts)
 { 
index 0712980..7d83e30 100755 (executable)
@@ -245,10 +245,14 @@ public:
   TString          GetFiredTriggerClasses() ;               
   
   UInt_t           GetEventTriggerMask()             const { return fEventTriggerMask        ; }
-  void             SetEventTriggerMaks(UInt_t evtTrig = AliVEvent::kAny) 
+  void             SetEventTriggerMask(UInt_t evtTrig = AliVEvent::kAny) 
                                                            { fEventTriggerMask = evtTrig     ; }
-  
-  TArrayI          GetL0TriggerPatches();
+       Bool_t           IsEventTriggerAtSEOn()            const { return fEventTriggerAtSE        ; }
+  void             SwitchOnEventTriggerAtSE()              { fEventTriggerAtSE      = kTRUE  ; }
+  void             SwitchOffEventTriggerAtSE()             { fEventTriggerAtSE      = kFALSE ; }
+               
+       
+  TArrayI          GetTriggerPatches();
   // void            RejectExoticEvents(TArrayI patches);
   //void             RejectTriggeredEventsByPileUp(TArrayI patches);
   void             MatchTriggerCluster(TArrayI patches);
@@ -276,11 +280,20 @@ public:
   UInt_t           GetMixEventTriggerMask()             const { return fMixEventTriggerMask  ; }
   void             SetMixEventTriggerMaks(UInt_t evtTrig = AliVEvent::kAnyINT) 
                                                            { fMixEventTriggerMask = evtTrig  ; }
-  
-  Bool_t           IsEventTriggerAtSEOn()            const { return fEventTriggerAtSE        ; }
-  void             SwitchOnEventTriggerAtSE()              { fEventTriggerAtSE      = kTRUE  ; }
-  void             SwitchOffEventTriggerAtSE()             { fEventTriggerAtSE      = kFALSE ; }
-  
+       void             SetEventTriggerBit();
+       Bool_t           IsEventMinimumBias()              const { return fEventTrigMinBias        ; }
+       Bool_t           IsEventCentral()                  const { return fEventTrigCentral        ; }
+       Bool_t           IsEventSemiCentral()              const { return fEventTrigSemiCentral    ; }
+       Bool_t           IsEventEMCALL0()                  const { return fEventTrigEMCALL0        ; }
+       Bool_t           IsEventEMCALL1Gamma1()            const { return fEventTrigEMCALL1Gamma1  ; }
+       Bool_t           IsEventEMCALL1Gamma2()            const { return fEventTrigEMCALL1Gamma2  ; }
+       Bool_t           IsEventEMCALL1Jet1()              const { return fEventTrigEMCALL1Jet1    ; }
+       Bool_t           IsEventEMCALL1Jet2()              const { return fEventTrigEMCALL1Jet2    ; }
+       Bool_t           IsEventEMCALL1Gamma()             const { return (fEventTrigEMCALL1Gamma1 || fEventTrigEMCALL1Gamma2) ; }
+  Bool_t           IsEventEMCALL1Jet()               const { return (fEventTrigEMCALL1Jet1   || fEventTrigEMCALL1Jet2  ) ; }
+       Bool_t           IsEventEMCALL1()                  const { return (IsEventEMCALL1Gamma()   || IsEventEMCALL1Jet()    ) ; }
+       
+       
   void             SwitchOnEventSelection()                { fDoEventSelection      = kTRUE  ; }
   void             SwitchOffEventSelection()               { fDoEventSelection      = kFALSE ; }
   Bool_t           IsEventSelectionDone()            const { return fDoEventSelection        ; }
@@ -301,6 +314,7 @@ public:
   void             SwitchOffRejectNoTrackEvents()          { fDoRejectNoTrackEvents = kFALSE ; }
   Bool_t           IsEventWithNoTrackRejectionDone() const { return fDoRejectNoTrackEvents   ; }
   
+
   //Time Stamp
   
   Double_t         GetRunTimeStampMin()              const { return fTimeStampRunMin         ; }
@@ -387,7 +401,7 @@ public:
   Bool_t           IsCaloFilterPatchOn()             const { 
                     if(fDataType == kAOD) { return fCaloFilterPatch ; } 
                     else                  { return kFALSE           ; }                     }
-       
+       
   //-------------------------------
   //Vertex methods
   //-------------------------------
@@ -522,97 +536,110 @@ public:
 
   
  protected:
-  Int_t                   fEventNumber;            // Event number
-  Int_t            fDataType ;              // Select MC:Kinematics, Data:ESD/AOD, MCData:Both
-  Int_t            fDebug;                  // Debugging level
-  AliFiducialCut * fFiducialCut;            // Acceptance cuts
-  Bool_t           fCheckFidCut ;           // Do analysis for clusters in defined region         
-
-  Bool_t           fComparePtHardAndJetPt;  // In MonteCarlo, jet events, reject fake events with wrong jet energy.
-  Float_t          fPtHardAndJetPtFactor;   // Factor between ptHard and jet pT to reject/accept event.
-
-  Bool_t           fComparePtHardAndClusterPt;  // In MonteCarlo, jet events, reject events with too large cluster energy
-  Float_t          fPtHardAndClusterPtFactor;   // Factor between ptHard and cluster pT to reject/accept event.
-  
-  Float_t          fCTSPtMin;               // pT Threshold on charged particles 
-  Float_t          fEMCALPtMin;             // pT Threshold on emcal clusters
-  Float_t          fPHOSPtMin;              // pT Threshold on phos clusters
-  Float_t          fCTSPtMax;               // pT Threshold on charged particles 
-  Float_t          fEMCALPtMax;             // pT Threshold on emcal clusters
-  Float_t          fPHOSPtMax;              // pT Threshold on phos clusters
-  Bool_t           fUseEMCALTimeCut;        // Do time cut selection
-  Bool_t           fUseParamTimeCut;        // Use simple or parametrized time cut
-  Bool_t           fUseTrackTimeCut;        // Do time cut selection
-  Double_t         fEMCALTimeCutMin;        // Remove clusters/cells with time smaller than this value, in ns
-  Double_t         fEMCALTimeCutMax;        // Remove clusters/cells with time larger than this value, in ns
-  Float_t          fEMCALParamTimeCutMin[4];// Remove clusters/cells with time smaller than parametrized value, in ns
-  Double_t         fEMCALParamTimeCutMax[4];// Remove clusters/cells with time larger than parametrized value, in ns
-  Double_t         fTrackTimeCutMin;        // Remove tracks with time smaller than this value, in ns
-  Double_t         fTrackTimeCutMax;        // Remove tracks with time larger than this value, in ns
-  Bool_t           fUseTrackDCACut;         // Do DCA selection
-  Double_t         fTrackDCACut[3];         // Remove tracks with DCA larger than cut, parameters of function stored here
-
-  TList          * fAODBranchList ;         //-> List with AOD branches created and needed in analysis
-  TObjArray      * fCTSTracks ;             //-> temporal array with tracks
-  TObjArray      * fEMCALClusters ;         //-> temporal array with EMCAL CaloClusters
-  TObjArray      * fPHOSClusters ;          //-> temporal array with PHOS  CaloClusters
-  AliVCaloCells  * fEMCALCells ;            //! temporal array with EMCAL CaloCells
-  AliVCaloCells  * fPHOSCells ;             //! temporal array with PHOS  CaloCells
-
-  AliVEvent      * fInputEvent;             //! pointer to esd or aod input
-  AliAODEvent    * fOutputEvent;            //! pointer to aod output
-  AliMCEvent     * fMC;                     //! Monte Carlo Event Handler  
-
-  Bool_t           fFillCTS;                // use data from CTS
-  Bool_t           fFillEMCAL;              // use data from EMCAL
-  Bool_t           fFillPHOS;               // use data from PHOS
-  Bool_t           fFillEMCALCells;         // use data from EMCAL
-  Bool_t           fFillPHOSCells;          // use data from PHOS
-  Bool_t           fRecalculateClusters;    // Correct clusters, recalculate them if recalibration parameters is given
-  Bool_t           fSelectEmbeddedClusters; // Use only simulated clusters that come from embedding.
-  
-  ULong_t          fTrackStatus        ;    // Track selection bit, select tracks refitted in TPC, ITS ...
-  ULong_t          fTrackFilterMask    ;    // Track selection bit, for AODs (any difference with track status?)
-  AliESDtrackCuts *fESDtrackCuts       ;    // Track cut
-  AliESDtrackCuts *fESDtrackComplementaryCuts;    // Track cut, complementary cuts for hybrids
-  Bool_t           fConstrainTrack     ;    // Constrain Track to vertex
-  Bool_t           fSelectHybridTracks ;    // Select CTS tracks of type hybrid (only for AODs)
-  Bool_t           fSelectSPDHitTracks ;    // Ensure that track hits SPD layers
-  Int_t            fTrackMult          ;    // Track multiplicity
-  Float_t          fTrackMultEtaCut    ;    // Track multiplicity eta cut
-  Bool_t           fReadStack          ;    // Access kine information from stack
-  Bool_t                fReadAODMCParticles ;    // Access kine information from filtered AOD MC particles
+  Int_t                   fEventNumber;               // Event number
+  Int_t            fDataType ;                 // Select MC:Kinematics, Data:ESD/AOD, MCData:Both
+  Int_t            fDebug;                     // Debugging level
+  AliFiducialCut * fFiducialCut;               // Acceptance cuts
+  Bool_t           fCheckFidCut ;              // Do analysis for clusters in defined region         
+
+  Bool_t           fComparePtHardAndJetPt;     // In MonteCarlo, jet events, reject fake events with wrong jet energy.
+  Float_t          fPtHardAndJetPtFactor;      // Factor between ptHard and jet pT to reject/accept event.
+
+  Bool_t           fComparePtHardAndClusterPt; // In MonteCarlo, jet events, reject events with too large cluster energy
+  Float_t          fPtHardAndClusterPtFactor;  // Factor between ptHard and cluster pT to reject/accept event.
+  
+  Float_t          fCTSPtMin;                  // pT Threshold on charged particles 
+  Float_t          fEMCALPtMin;                // pT Threshold on emcal clusters
+  Float_t          fPHOSPtMin;                 // pT Threshold on phos clusters
+  Float_t          fCTSPtMax;                  // pT Threshold on charged particles 
+  Float_t          fEMCALPtMax;                // pT Threshold on emcal clusters
+  Float_t          fPHOSPtMax;                 // pT Threshold on phos clusters
+  Bool_t           fUseEMCALTimeCut;           // Do time cut selection
+  Bool_t           fUseParamTimeCut;           // Use simple or parametrized time cut
+  Bool_t           fUseTrackTimeCut;           // Do time cut selection
+  Double_t         fEMCALTimeCutMin;           // Remove clusters/cells with time smaller than this value, in ns
+  Double_t         fEMCALTimeCutMax;           // Remove clusters/cells with time larger than this value, in ns
+  Float_t          fEMCALParamTimeCutMin[4];   // Remove clusters/cells with time smaller than parametrized value, in ns
+  Double_t         fEMCALParamTimeCutMax[4];   // Remove clusters/cells with time larger than parametrized value, in ns
+  Double_t         fTrackTimeCutMin;           // Remove tracks with time smaller than this value, in ns
+  Double_t         fTrackTimeCutMax;           // Remove tracks with time larger than this value, in ns
+  Bool_t           fUseTrackDCACut;            // Do DCA selection
+  Double_t         fTrackDCACut[3];            // Remove tracks with DCA larger than cut, parameters of function stored here
+
+  TList          * fAODBranchList ;            //-> List with AOD branches created and needed in analysis
+  TObjArray      * fCTSTracks ;                //-> temporal array with tracks
+  TObjArray      * fEMCALClusters ;            //-> temporal array with EMCAL CaloClusters
+  TObjArray      * fPHOSClusters ;             //-> temporal array with PHOS  CaloClusters
+  AliVCaloCells  * fEMCALCells ;               //! temporal array with EMCAL CaloCells
+  AliVCaloCells  * fPHOSCells ;                //! temporal array with PHOS  CaloCells
+
+  AliVEvent      * fInputEvent;                //! pointer to esd or aod input
+  AliAODEvent    * fOutputEvent;               //! pointer to aod output
+  AliMCEvent     * fMC;                        //! Monte Carlo Event Handler  
+
+  Bool_t           fFillCTS;                   // use data from CTS
+  Bool_t           fFillEMCAL;                 // use data from EMCAL
+  Bool_t           fFillPHOS;                  // use data from PHOS
+  Bool_t           fFillEMCALCells;            // use data from EMCAL
+  Bool_t           fFillPHOSCells;             // use data from PHOS
+  Bool_t           fRecalculateClusters;       // Correct clusters, recalculate them if recalibration parameters is given
+  Bool_t           fSelectEmbeddedClusters;    // Use only simulated clusters that come from embedding.
+  
+  ULong_t          fTrackStatus        ;       // Track selection bit, select tracks refitted in TPC, ITS ...
+  ULong_t          fTrackFilterMask    ;       // Track selection bit, for AODs (any difference with track status?)
+  AliESDtrackCuts *fESDtrackCuts       ;       // Track cut
+  AliESDtrackCuts *fESDtrackComplementaryCuts; // Track cut, complementary cuts for hybrids
+  Bool_t           fConstrainTrack     ;       // Constrain Track to vertex
+  Bool_t           fSelectHybridTracks ;       // Select CTS tracks of type hybrid (only for AODs)
+  Bool_t           fSelectSPDHitTracks ;       // Ensure that track hits SPD layers
+  Int_t            fTrackMult          ;       // Track multiplicity
+  Float_t          fTrackMultEtaCut    ;       // Track multiplicity eta cut
+  Bool_t           fReadStack          ;       // Access kine information from stack
+  Bool_t                fReadAODMCParticles ;       // Access kine information from filtered AOD MC particles
        
-  TString          fDeltaAODFileName   ;    // Delta AOD file name
-  TString          fFiredTriggerClassName;  // Name of trigger event type used to do the analysis
-
-  UInt_t           fEventTriggerMask ;      // select this triggerered event
-  UInt_t           fMixEventTriggerMask ;   // select this triggerered event for mixing, tipically kMB or kAnyINT
-  Bool_t           fEventTriggerAtSE;       // select triggered event at SE base task or here
-  
-  Bool_t           fAnaLED;                 // Analyze LED data only.
+  TString          fDeltaAODFileName   ;       // Delta AOD file name
+  TString          fFiredTriggerClassName;     // Name of trigger event type used to do the analysis
+
+       // Trigger bit
+  UInt_t           fEventTriggerMask ;         // select this triggerered event
+  UInt_t           fMixEventTriggerMask ;      // select this triggerered event for mixing, tipically kMB or kAnyINT
+  Bool_t           fEventTriggerAtSE;          // select triggered event at SE base task or here
+  
+       Bool_t           fEventTrigMinBias ;         // Event is min bias on its name, it should correspond to AliVEvent::kMB, AliVEvent::kAnyInt
+       Bool_t           fEventTrigCentral ;         // Event is AliVEvent::kCentral on its name,  it should correspond to PbPb
+       Bool_t           fEventTrigSemiCentral ;     // Event is AliVEvent::kSemiCentral on its name,  it should correspond to PbPb 
+       Bool_t           fEventTrigEMCALL0 ;         // Event is EMCal L0 on its name, it should correspond to AliVEvent::kEMC7, AliVEvent::kEMC1
+       Bool_t           fEventTrigEMCALL1Gamma1 ;   // Event is L1-Gamma, threshold 1 on its name,  it should correspond kEMCEGA
+       Bool_t           fEventTrigEMCALL1Gamma2 ;   // Event is L1-Gamma, threshold 2 on its name,  it should correspond kEMCEGA  
+       Bool_t           fEventTrigEMCALL1Jet1 ;     // Event is L1-Gamma, threshold 1 on its name,  it should correspond kEMCEGA
+       Bool_t           fEventTrigEMCALL1Jet2 ;     // Event is L1-Gamma, threshold 2 on its name,  it should correspond kEMCEGA  
+       
+       Int_t            fBitEGA;                    // Trigger bit on VCaloTrigger for EGA
+       Int_t            fBitEJE;                    // Trigger bit on VCaloTrigger for EJE
+       
+  Bool_t           fAnaLED;                    // Analyze LED data only.
 
-  TString          fTaskName;               // Name of task that executes the analysis
+  TString          fTaskName;                  // Name of task that executes the analysis
        
-  AliCalorimeterUtils * fCaloUtils ;        //  Pointer to CalorimeterUtils
+  AliCalorimeterUtils * fCaloUtils ;           //  Pointer to CalorimeterUtils
 
-  AliMixedEvent  * fMixedEvent  ;           //! mixed event object. This class is not the owner
-  Int_t            fNMixedEvent ;           // number of events in mixed event buffer
-  Double_t      ** fVertex      ;           //! vertex array 3 dim for each mixed event buffer
+  AliMixedEvent  * fMixedEvent  ;              //! mixed event object. This class is not the owner
+  Int_t            fNMixedEvent ;              // number of events in mixed event buffer
+  Double_t      ** fVertex      ;              //! vertex array 3 dim for each mixed event buffer
   
-  TList **         fListMixedTracksEvents ; //! Container for tracks stored for different events, used in case of own mixing, set in analysis class
-  TList **         fListMixedCaloEvents;    //! Container for photon stored for different events, used in case of own mixing, set in analysis class
-  Int_t            fLastMixedTracksEvent  ; //  Temporary container with the last event added to the mixing list for tracks
-  Int_t            fLastMixedCaloEvent ;    //  Temporary container with the last event added to the mixing list for photons
+  TList **         fListMixedTracksEvents ;    //! Container for tracks stored for different events, used in case of own mixing, set in analysis class
+  TList **         fListMixedCaloEvents;       //! Container for photon stored for different events, used in case of own mixing, set in analysis class
+  Int_t            fLastMixedTracksEvent  ;    //  Temporary container with the last event added to the mixing list for tracks
+  Int_t            fLastMixedCaloEvent ;       //  Temporary container with the last event added to the mixing list for photons
   
-  Bool_t           fWriteOutputDeltaAOD;    // Write the created delta AOD objects into file  
-       Bool_t           fOldAOD;                 // Old AODs, before revision 4.20
+  Bool_t           fWriteOutputDeltaAOD;       // Write the created delta AOD objects into file  
+       Bool_t           fOldAOD;                    // Old AODs, before revision 4.20
   
-  Int_t            fV0ADC[2]    ;           // Integrated V0 signal
-  Int_t            fV0Mul[2]    ;           // Integrated V0 Multiplicity
+  Int_t            fV0ADC[2]    ;              // Integrated V0 signal
+  Int_t            fV0Mul[2]    ;              // Integrated V0 Multiplicity
 
-  Bool_t           fCaloFilterPatch;        // CaloFilter patch
-  TString          fEMCALClustersListName;  // Alternative list of clusters produced elsewhere and not from InputEvent
+  Bool_t           fCaloFilterPatch;           // CaloFilter patch
+  TString          fEMCALClustersListName;     // Alternative list of clusters produced elsewhere and not from InputEvent
   
   // Event selection
   Float_t          fZvtxCut ;                     // Cut on vertex position
@@ -662,19 +689,19 @@ public:
   Bool_t           fRecalculateVertexBC;         // Recalculate vertex BC from tracks pointing to vertex
   
   //Centrality/Event plane
-  TString          fCentralityClass;        // Name of selected centrality class     
-  Int_t            fCentralityOpt;          // Option for the returned value of the centrality, possible options 5, 10, 100
-  Int_t            fCentralityBin[2];       // Minimum and maximum value of the centrality for the analysis
-  TString          fEventPlaneMethod;       // Name of event plane method, by default "Q"
+  TString          fCentralityClass;            // Name of selected centrality class     
+  Int_t            fCentralityOpt;              // Option for the returned value of the centrality, possible options 5, 10, 100
+  Int_t            fCentralityBin[2];           // Minimum and maximum value of the centrality for the analysis
+  TString          fEventPlaneMethod;           // Name of event plane method, by default "Q"
   
-  Bool_t           fImportGeometryFromFile; // Import geometry settings in geometry.root file
-  TString          fImportGeometryFilePath; // path fo geometry.root file
+  Bool_t           fImportGeometryFromFile;     // Import geometry settings in geometry.root file
+  TString          fImportGeometryFilePath;     // path fo geometry.root file
 
-  
+       
   AliCaloTrackReader(              const AliCaloTrackReader & r) ; // cpy ctor
   AliCaloTrackReader & operator = (const AliCaloTrackReader & r) ; // cpy assignment
   
-  ClassDef(AliCaloTrackReader,55)
+  ClassDef(AliCaloTrackReader,56)
   
 } ;