]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Adapt trigger patch maker to different bit settings:
authormfasel <mfasel@lbl.gov>
Fri, 28 Nov 2014 13:25:51 +0000 (14:25 +0100)
committermfasel <mfasel@lbl.gov>
Fri, 28 Nov 2014 15:12:19 +0000 (16:12 +0100)
============================================================
It turned out that the number of trigger bits used in different aliroot
versions is different (old aliroot - no distinction between high and low
threshold triggers). Therefore the usage of the trigger bits defined in
AliEmcalTriggerTypes.h leads to incorrect trigger patches when using it
for samples producecd with old aliroot versions. In order to overcome
the problem, the enum with hard coded trigger bits is removed from the
trigger maker and the trigger patches, and replaced by a class storing a
trigger bit configuration, which can be adapted to the conditions of the
sample to be analysed. The fix also fixes a bug introduced by a naming
clash for the Level0 trigger bit.

PWG/CMakelibPWGEMCAL.pkg
PWG/EMCAL/AliEmcalTriggerBitConfig.cxx [new file with mode: 0644]
PWG/EMCAL/AliEmcalTriggerBitConfig.h [new file with mode: 0644]
PWG/EMCAL/AliEmcalTriggerMaker.cxx
PWG/EMCAL/AliEmcalTriggerMaker.h
PWG/EMCAL/AliEmcalTriggerPatchInfo.h

index 0e301974d20dd5d6dadc14c9ac7053ff296274e3..4772e92062db23279aab7a535b8e2a85da844203 100644 (file)
@@ -50,6 +50,7 @@ set ( SRCS
  EMCAL/AliEmcalTenderTask.cxx
  EMCAL/AliEmcalTrackingQATask.cxx
  EMCAL/AliEmcalTrackPropagatorTask.cxx
+ EMCAL/AliEmcalTriggerBitConfig.cxx
  EMCAL/AliEmcalTriggerMaker.cxx
  EMCAL/AliEmcalTriggerPatchInfo.cxx
  EMCAL/AliEmcalTriggerSetupInfo.cxx
diff --git a/PWG/EMCAL/AliEmcalTriggerBitConfig.cxx b/PWG/EMCAL/AliEmcalTriggerBitConfig.cxx
new file mode 100644 (file)
index 0000000..2bf260e
--- /dev/null
@@ -0,0 +1,96 @@
+/**************************************************************************
+ * Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/*
+ * Trigger bit configuration used in the trigger patch maker and by the trigger patches
+ * themselves in order to identify of which type the trigger patch is. Can be adapted to different
+ * trigger bit configurations use in different reconstructions
+ *
+ *   Author: Markus Fasel
+ */
+
+#include "AliEmcalTriggerBitConfig.h"
+
+ClassImp(AliEmcalTriggerBitConfig)
+ClassImp(AliEmcalTriggerBitConfigOld)
+ClassImp(AliEmcalTriggerBitConfigNew)
+
+//________________________________________________________________________
+AliEmcalTriggerBitConfig::AliEmcalTriggerBitConfig():
+    TObject(),
+    fL0Bit(-1),
+    fJHighBit(-1),
+    fJLowBit(-1),
+    fGHighBit(-1),
+    fGLowBit(-1),
+    fTriggerTypesEnd(-1)
+{
+  /*
+   * Dummy constructor for the configuraiton base classes, not to be callled
+   */
+}
+
+//________________________________________________________________________
+AliEmcalTriggerBitConfig::AliEmcalTriggerBitConfig(
+    Int_t l0bit,
+    Int_t jhighbit,
+    Int_t jlowbit,
+    Int_t ghighbit,
+    Int_t glowbit,
+    Int_t mcoffset):
+    TObject(),
+    fL0Bit(l0bit),
+    fJHighBit(jhighbit),
+    fJLowBit(jlowbit),
+    fGHighBit(ghighbit),
+    fGLowBit(glowbit),
+    fTriggerTypesEnd(mcoffset)
+{
+  /*
+   * Constructor initialising the configurations. Used by the inheriting classes
+   */
+}
+
+//________________________________________________________________________
+void AliEmcalTriggerBitConfig::Initialise(const AliEmcalTriggerBitConfig& ref) {
+  /*
+   * Initialise from other object
+   */
+  fL0Bit = ref.GetLevel0Bit();
+  fJHighBit = ref.GetJetHighBit();
+  fJLowBit = ref.GetJetLowBit();
+  fGHighBit = ref.GetGammaHighBit();
+  fGLowBit = ref.GetJetLowBit();
+  fTriggerTypesEnd = ref.GetTriggerTypesEnd();
+}
+
+//________________________________________________________________________
+AliEmcalTriggerBitConfigOld::AliEmcalTriggerBitConfigOld():
+    AliEmcalTriggerBitConfig(0,2,2,1,1,3)       // To be checked
+{
+  /*
+   * Settings for the 2-bit configuration
+   */
+}
+
+//________________________________________________________________________
+AliEmcalTriggerBitConfigNew::AliEmcalTriggerBitConfigNew():
+    AliEmcalTriggerBitConfig(0,3,4,1,2,5)       // To be checked
+{
+  /*
+   * Settings for the 4-bit configuration
+   */
+}
+
diff --git a/PWG/EMCAL/AliEmcalTriggerBitConfig.h b/PWG/EMCAL/AliEmcalTriggerBitConfig.h
new file mode 100644 (file)
index 0000000..960ef4f
--- /dev/null
@@ -0,0 +1,52 @@
+#ifndef ALIEMCALTRIGGERBITCONFIG_H
+#define ALIEMCALTRIGGERBITCONFIG_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+// Author: Markus Fasel
+
+#include "AliLog.h"
+
+class AliEmcalTriggerBitConfig  : public TObject {
+public:
+  AliEmcalTriggerBitConfig();
+  AliEmcalTriggerBitConfig(Int_t l0bit, Int_t j1bit, Int_t j2bit, Int_t g1bit, Int_t g2bit, Int_t mcoffset);
+  virtual ~AliEmcalTriggerBitConfig() {}
+
+  void Initialise(const AliEmcalTriggerBitConfig &ref);
+
+  Int_t GetLevel0Bit() const { if(fL0Bit < 0) AliFatal("Invalid trigger configuration: Level0 bit < 0"); return fL0Bit; }
+  Int_t GetJetHighBit() const { if(fJHighBit < 0) AliFatal("Invalid trigger configuration: Jet high bit < 0"); return fJHighBit; }
+  Int_t GetJetLowBit() const { if(fJLowBit < 0) AliFatal("Invalid trigger configuration: Jet low bit < 0"); return fJLowBit; }
+  Int_t GetGammaHighBit() const { if(fGHighBit < 0) AliFatal("Invalid trigger configuration: Gamma high bit < 0"); return fGHighBit; }
+  Int_t GetGammaLowBit() const { if(fGLowBit < 0) AliFatal("Invalid trigger configuration: Gamma low bit < 0"); return fGLowBit; }
+  Int_t GetTriggerTypesEnd() const {if(fTriggerTypesEnd < 0) AliFatal("Invalid trigger configuration: MC Offset bit < 0"); return fTriggerTypesEnd; }
+
+protected:
+ Int_t fL0Bit;      // Level0 bit
+ Int_t fJHighBit;   // Jet High bit
+ Int_t fJLowBit;    // Jet Low bit
+ Int_t fGHighBit;   // Gamma High bit
+ Int_t fGLowBit;    // Gamma Low bit
+ Int_t fTriggerTypesEnd;   // Monte-Carlo offset
+
+ ClassDef(AliEmcalTriggerBitConfig, 1);
+};
+
+class AliEmcalTriggerBitConfigOld : public AliEmcalTriggerBitConfig{
+public:
+  AliEmcalTriggerBitConfigOld();
+  virtual ~AliEmcalTriggerBitConfigOld() {}
+
+  ClassDef(AliEmcalTriggerBitConfigOld, 1);
+};
+
+class AliEmcalTriggerBitConfigNew : public AliEmcalTriggerBitConfig{
+public:
+  AliEmcalTriggerBitConfigNew();
+  virtual ~AliEmcalTriggerBitConfigNew() {}
+
+  ClassDef(AliEmcalTriggerBitConfigNew, 1);
+};
+
+#endif /* ALIEMCALTRIGGERBITCONFIG_H */
index 62bde4c986083417ec73ccea5bec1b1a41fa7cce..c64d30e97589f2b055704da20d1ade83a71cea85 100644 (file)
@@ -30,6 +30,8 @@ AliEmcalTriggerMaker::AliEmcalTriggerMaker() :
   fCaloTriggersOutName("EmcalTriggers"),
   fCaloTriggerSetupOutName("EmcalTriggersSetup"),
   fV0InName("AliAODVZERO"),
+  fUseTriggerBitConfig(kNewConfig),
+  fTriggerBitConfig(NULL),
   fCaloTriggersOut(0),
   fCaloTriggerSetupOut(0),
   fSimpleOfflineTriggers(0),
@@ -53,6 +55,8 @@ AliEmcalTriggerMaker::AliEmcalTriggerMaker(const char *name, Bool_t doQA) :
   fCaloTriggersOutName("EmcalTriggers"),
   fCaloTriggerSetupOutName("EmcalTriggersSetup"),
   fV0InName("AliAODVZERO"),
+  fUseTriggerBitConfig(kNewConfig),
+  fTriggerBitConfig(NULL),
   fCaloTriggersOut(0),
   fCaloTriggerSetupOut(0),
   fSimpleOfflineTriggers(0),
@@ -74,6 +78,7 @@ AliEmcalTriggerMaker::AliEmcalTriggerMaker(const char *name, Bool_t doQA) :
 AliEmcalTriggerMaker::~AliEmcalTriggerMaker()
 {
   // Destructor.
+  if(fTriggerBitConfig) delete fTriggerBitConfig;
 }
 
 //________________________________________________________________________
@@ -86,6 +91,17 @@ void AliEmcalTriggerMaker::ExecOnce()
   if (!fInitialized)
     return;
 
+  if(!fTriggerBitConfig){
+    switch(fUseTriggerBitConfig){
+    case kNewConfig:
+      fTriggerBitConfig = new AliEmcalTriggerBitConfigNew();
+      break;
+    case kOldConfig:
+      fTriggerBitConfig = new AliEmcalTriggerBitConfigOld();
+      break;
+    }
+  }
+
   if (!fCaloTriggersOutName.IsNull()) {
     fCaloTriggersOut = new TClonesArray("AliEmcalTriggerPatchInfo");
     fCaloTriggersOut->SetName(fCaloTriggersOutName);
@@ -528,25 +544,28 @@ AliEmcalTriggerPatchInfo* AliEmcalTriggerMaker::ProcessPatch(TriggerMakerTrigger
   edge2 -= vertex;
 
   Int_t isMC = MCEvent() ? 1 : 0;
-  Int_t offSet = (1 - isMC) * kTriggerTypeEnd;
+  Int_t offSet = (1 - isMC) * fTriggerBitConfig->GetTriggerTypesEnd();
        
   // fix tbits .. remove the unwanted type triggers
   // for Jet and Gamma triggers we remove also the level 0 bit since it will be stored in the level 0 patch
   // for level 0 we remove all gamma and jet trigger bits
   switch(type){
   case kTMEMCalJet:
-    tBits = tBits & ~( 1 << (kTriggerTypeEnd + kL1GammaLow) | 1 << (kTriggerTypeEnd + kL1GammaHigh) | 1 << (kL1GammaLow) | 1 << (kL1GammaHigh) |
-                      1 << (kTriggerTypeEnd + kL0) | 1 << (kL0));
+    tBits = tBits & ~( 1 << (fTriggerBitConfig->GetTriggerTypesEnd() + fTriggerBitConfig->GetGammaLowBit()) | 1 << (fTriggerBitConfig->GetTriggerTypesEnd() + fTriggerBitConfig->GetGammaHighBit()) |
+        1 << (fTriggerBitConfig->GetGammaLowBit()) | 1 << (fTriggerBitConfig->GetGammaHighBit()) |
+                      1 << (fTriggerBitConfig->GetTriggerTypesEnd() + fTriggerBitConfig->GetLevel0Bit()) | 1 << (fTriggerBitConfig->GetLevel0Bit()));
     break;
   case kTMEMCalGamma:
-    tBits = tBits & ~( 1 << (kTriggerTypeEnd + kL1JetLow) | 1 << (kTriggerTypeEnd + kL1JetHigh) | 1 << (kL1JetLow) | 1 << (kL1JetHigh) |
-                      1 << (kTriggerTypeEnd + kL0) | 1 << (kL0));
+    tBits = tBits & ~( 1 << (fTriggerBitConfig->GetTriggerTypesEnd() + fTriggerBitConfig->GetJetLowBit()) | 1 << (kTriggerTypeEnd + fTriggerBitConfig->GetJetHighBit()) |
+        1 << (fTriggerBitConfig->GetJetLowBit()) | 1 << (fTriggerBitConfig->GetJetHighBit()) |
+                      1 << (fTriggerBitConfig->GetTriggerTypesEnd() + fTriggerBitConfig->GetLevel0Bit()) | 1 << (fTriggerBitConfig->GetLevel0Bit()));
     break;
   case kTMEMCalLevel0:
     // Explicitly set the level 0 bit to overcome the masking out
-    tBits |= 1 << (offSet + kL0);
-    tBits = tBits & ~( 1 << (kTriggerTypeEnd + kL1JetLow) | 1 << (kTriggerTypeEnd + kL1JetHigh) | 1 << (kL1JetLow) | 1 << (kL1JetHigh) |
-                      1 << (kTriggerTypeEnd + kL1GammaLow) | 1 << (kTriggerTypeEnd + kL1GammaHigh) | 1 << (kL1GammaLow) | 1 << (kL1GammaHigh));
+    tBits |= 1 << (offSet + fTriggerBitConfig->GetLevel0Bit());
+    tBits = tBits & ~( 1 << (fTriggerBitConfig->GetTriggerTypesEnd() + fTriggerBitConfig->GetJetLowBit()) | 1 << (fTriggerBitConfig->GetTriggerTypesEnd() + fTriggerBitConfig->GetJetHighBit()) |
+        1 << (fTriggerBitConfig->GetJetLowBit()) | 1 << (fTriggerBitConfig->GetJetHighBit()) | 1 << (fTriggerBitConfig->GetTriggerTypesEnd() + fTriggerBitConfig->GetGammaLowBit()) |
+        1 << (fTriggerBitConfig->GetTriggerTypesEnd() + fTriggerBitConfig->GetGammaHighBit()) | 1 << (fTriggerBitConfig->GetGammaLowBit()) | 1 << (fTriggerBitConfig->GetGammaHighBit()));
     break;
   };
 
@@ -554,6 +573,7 @@ AliEmcalTriggerPatchInfo* AliEmcalTriggerMaker::ProcessPatch(TriggerMakerTrigger
   AliEmcalTriggerPatchInfo *trigger = 
     new ((*fCaloTriggersOut)[fITrigger]) AliEmcalTriggerPatchInfo();
   fITrigger++;
+  trigger->SetTriggerBitConfig(fTriggerBitConfig);
   trigger->SetCenterGeo(centerGeo, amp);
   trigger->SetCenterMass(centerMass, amp);
   trigger->SetEdge1(edge1, amp);
@@ -601,9 +621,9 @@ void AliEmcalTriggerMaker::RunSimpleOfflineTrigger()
       
       // check thresholds
       if (tSum > fCaloTriggerSetupOut->GetThresholdJetLowSimple())
-        tBits = tBits | ( 1 << ( kTriggerTypeEnd + kL1JetLow ));
+        tBits = tBits | ( 1 << ( fTriggerBitConfig->GetTriggerTypesEnd() + fTriggerBitConfig->GetJetLowBit() ));
       if (tSum > fCaloTriggerSetupOut->GetThresholdJetHighSimple())
-        tBits = tBits | ( 1 << ( kTriggerTypeEnd + kL1JetHigh ));
+        tBits = tBits | ( 1 << ( fTriggerBitConfig->GetTriggerTypesEnd() + fTriggerBitConfig->GetJetHighBit() ));
       
       // add trigger values
       if (tBits != 0) {
@@ -632,9 +652,9 @@ void AliEmcalTriggerMaker::RunSimpleOfflineTrigger()
       
       // check thresholds
       if (tSum > fCaloTriggerSetupOut->GetThresholdGammaLowSimple())
-        tBits = tBits | ( 1 << ( kTriggerTypeEnd + kL1GammaLow ));
+        tBits = tBits | ( 1 << ( fTriggerBitConfig->GetTriggerTypesEnd() + fTriggerBitConfig->GetGammaLowBit() ));
       if (tSum > fCaloTriggerSetupOut->GetThresholdGammaHighSimple())
-        tBits = tBits | ( 1 << ( kTriggerTypeEnd + kL1GammaHigh ));
+        tBits = tBits | ( 1 << ( fTriggerBitConfig->GetTriggerTypesEnd() + fTriggerBitConfig->GetGammaHighBit() ));
       
       // add trigger values
       if (tBits != 0) {
@@ -679,7 +699,7 @@ Bool_t AliEmcalTriggerMaker::CheckForL0(const AliVCaloTrigger& trg) const {
     // For Monte-Carlo select
     Int_t tbits(-1);
     trg.GetTriggerBits(tbits);
-    return tbits & (1 << kL0);
+    return tbits & (1 << fTriggerBitConfig->GetLevel0Bit());
   } else {
     // For Data check from the level0 times if the trigger has fired at level0
     Int_t nl0times(0);
index c0231d96c5402d196416f8b8fb4e266d28133a9b..7c7560f369aedb92d675c0630a78dad6b5291d21 100644 (file)
@@ -9,9 +9,11 @@ class AliAODCaloTrigger;
 class AliVVZERO;
 class THistManager;
 
-#include "AliEMCALTriggerTypes.h"
+#include "AliLog.h"
+#include "AliEmcalTriggerBitConfig.h"
 #include "AliAnalysisTaskEmcal.h"
 
+
 class AliEmcalTriggerMaker : public AliAnalysisTaskEmcal {
  public:
   enum TriggerMakerTriggerType_t {
@@ -19,6 +21,10 @@ class AliEmcalTriggerMaker : public AliAnalysisTaskEmcal {
     kTMEMCalGamma = 1,
     kTMEMCalLevel0 = 2
   };
+  enum TriggerMakerBitConfig_t {
+    kOldConfig = 0,
+    kNewConfig = 1
+  };
   AliEmcalTriggerMaker();
   AliEmcalTriggerMaker(const char *name, Bool_t doQA = kFALSE);
   virtual ~AliEmcalTriggerMaker();
@@ -33,10 +39,12 @@ class AliEmcalTriggerMaker : public AliAnalysisTaskEmcal {
   void SetV0InName(const char *name) { fV0InName      = name; }
 
   void SetRunTriggerType(TriggerMakerTriggerType_t type, Bool_t doTrigger = kTRUE) { fRunTriggerType[type] = doTrigger; }
+  void SetUseTriggerBitConfig(TriggerMakerBitConfig_t bitConfig) { fUseTriggerBitConfig = bitConfig; }
+  void SetTriggerBitConfig(const AliEmcalTriggerBitConfig *conf) { fTriggerBitConfig = conf; }
 
-  Bool_t IsEJE(Int_t tBits) const { if( tBits & ( 1 << (kTriggerTypeEnd + kL1JetLow) | 1 << (kTriggerTypeEnd + kL1JetHigh) | 1 << (kL1JetLow) | 1 << (kL1JetHigh) )) return kTRUE; else return kFALSE; }
-  Bool_t IsEGA(Int_t tBits) const { if( tBits & ( 1 << (kTriggerTypeEnd + kL1GammaLow) | 1 << (kTriggerTypeEnd + kL1GammaHigh) | 1 << (kL1GammaLow) | 1 << (kL1GammaHigh) )) return kTRUE; else return kFALSE; }
-  Bool_t IsLevel0(Int_t tBits) const { if( tBits & (1 << (kTriggerTypeEnd + kL0) | (1 << kL0))) return kTRUE; return kFALSE; }
+  Bool_t IsEJE(Int_t tBits) const { if( tBits & ( 1 << (fTriggerBitConfig->GetTriggerTypesEnd() + fTriggerBitConfig->GetJetLowBit()) | 1 << (fTriggerBitConfig->GetTriggerTypesEnd() + fTriggerBitConfig->GetJetHighBit()) | 1 << (fTriggerBitConfig->GetJetLowBit()) | 1 << (fTriggerBitConfig->GetJetHighBit()) )) return kTRUE; else return kFALSE; }
+  Bool_t IsEGA(Int_t tBits) const { if( tBits & ( 1 << (fTriggerBitConfig->GetTriggerTypesEnd() + fTriggerBitConfig->GetGammaLowBit()) | 1 << (fTriggerBitConfig->GetTriggerTypesEnd() + fTriggerBitConfig->GetGammaHighBit()) | 1 << (fTriggerBitConfig->GetGammaLowBit()) | 1 << (fTriggerBitConfig->GetGammaHighBit()) )) return kTRUE; else return kFALSE; }
+  Bool_t IsLevel0(Int_t tBits) const { if( tBits & (1 << (fTriggerBitConfig->GetLevel0Bit() + fTriggerBitConfig->GetLevel0Bit()) | (1 << fTriggerBitConfig->GetLevel0Bit()))) return kTRUE; return kFALSE; }
 
  protected:  
   enum{
@@ -54,7 +62,9 @@ class AliEmcalTriggerMaker : public AliAnalysisTaskEmcal {
   TString                    fCaloTriggersOutName;      // name of output track array
   TString                    fCaloTriggerSetupOutName;  // name of output track array
   TString                    fV0InName;                 // name of output track array
+  TriggerMakerBitConfig_t    fUseTriggerBitConfig;      // type of trigger config
   Int_t                      fThresholdConstants[4][3]; // simple offline trigger thresholds constants
+  const AliEmcalTriggerBitConfig  *fTriggerBitConfig;         // Trigger bit configuration, aliroot-dependent
   TClonesArray              *fCaloTriggersOut;          //!trigger array out
   AliEmcalTriggerSetupInfo  *fCaloTriggerSetupOut;      //!trigger setup
   AliAODCaloTrigger         *fSimpleOfflineTriggers;    //!simple offline trigger
index 289139c0b5240db56a98489488980cc1f37d6629..92b10c79767d6d82e3f7ad5aaa11be53567ef8e9 100644 (file)
@@ -7,6 +7,7 @@
 
 #include <TLorentzVector.h>
 #include <TMath.h>
+#include "AliEmcalTriggerBitConfig.h"
 #include "AliEMCALTriggerTypes.h"
 #include "AliEmcalTriggerSetupInfo.h"
 
@@ -37,16 +38,16 @@ class AliEmcalTriggerPatchInfo: public TObject {
   Int_t    GetEdgeCellY() const { return fEdgeCell[1]; }
   void     GetCellIndices( AliEMCALGeometry *geom, TArrayI *cells );
   
-  Bool_t   IsLevel0() const { return (Bool_t)((fTriggerBits >> (fOffSet + kL0))&(!(fTriggerBits >> 25))&1); }
-  Bool_t   IsJetLow() const { return (Bool_t)((fTriggerBits >> (fOffSet + kL1JetLow))&(!(fTriggerBits >> 25))&1); }
-  Bool_t   IsJetHigh() const { return (Bool_t)((fTriggerBits >> (fOffSet + kL1JetHigh))&(!(fTriggerBits >> 25))&1); }
-  Bool_t   IsGammaLow() const { return (Bool_t)((fTriggerBits >> (fOffSet + kL1GammaLow))&(!(fTriggerBits >> 25))&1); }
-  Bool_t   IsGammaHigh() const { return (Bool_t)((fTriggerBits >> (fOffSet + kL1GammaHigh))&(!(fTriggerBits >> 25))&1); }
+  Bool_t   IsLevel0() const { return (Bool_t)((fTriggerBits >> (fOffSet + fTriggerBitConfig.GetLevel0Bit()))&(!(fTriggerBits >> 25))&1); }
+  Bool_t   IsJetLow() const { return (Bool_t)((fTriggerBits >> (fOffSet + fTriggerBitConfig.GetJetLowBit()))&(!(fTriggerBits >> 25))&1); }
+  Bool_t   IsJetHigh() const { return (Bool_t)((fTriggerBits >> (fOffSet + fTriggerBitConfig.GetJetHighBit()))&(!(fTriggerBits >> 25))&1); }
+  Bool_t   IsGammaLow() const { return (Bool_t)((fTriggerBits >> (fOffSet + fTriggerBitConfig.GetGammaLowBit()))&(!(fTriggerBits >> 25))&1); }
+  Bool_t   IsGammaHigh() const { return (Bool_t)((fTriggerBits >> (fOffSet + fTriggerBitConfig.GetGammaHighBit()))&(!(fTriggerBits >> 25))&1); }
   Bool_t   IsMainTrigger() const { return (Bool_t)((fTriggerBits >> 24)&(!(fTriggerBits >> 25))&1); }
-  Bool_t   IsJetLowSimple() const { return (Bool_t)((fTriggerBits >> (fOffSet + kL1JetLow))&(fTriggerBits >> 25)&1); }
-  Bool_t   IsJetHighSimple() const { return (Bool_t)((fTriggerBits >> (fOffSet + kL1JetHigh))&(fTriggerBits >> 25)&1); }
-  Bool_t   IsGammaLowSimple() const { return (Bool_t)((fTriggerBits >> (fOffSet + kL1GammaLow))&(fTriggerBits >> 25)&1); }
-  Bool_t   IsGammaHighSimple() const { return (Bool_t)((fTriggerBits >> (fOffSet + kL1GammaHigh))&(fTriggerBits >> 25)&1); }
+  Bool_t   IsJetLowSimple() const { return (Bool_t)((fTriggerBits >> (fOffSet + fTriggerBitConfig.GetJetLowBit()))&(fTriggerBits >> 25)&1); }
+  Bool_t   IsJetHighSimple() const { return (Bool_t)((fTriggerBits >> (fOffSet + fTriggerBitConfig.GetJetHighBit()))&(fTriggerBits >> 25)&1); }
+  Bool_t   IsGammaLowSimple() const { return (Bool_t)((fTriggerBits >> (fOffSet + fTriggerBitConfig.GetGammaLowBit()))&(fTriggerBits >> 25)&1); }
+  Bool_t   IsGammaHighSimple() const { return (Bool_t)((fTriggerBits >> (fOffSet + fTriggerBitConfig.GetGammaHighBit()))&(fTriggerBits >> 25)&1); }
   Bool_t   IsMainTriggerSimple() const { return (Bool_t)((fTriggerBits >> 24)&(fTriggerBits >> 25)&1); }
   Bool_t   IsOfflineSimple() const { return (Bool_t)((fTriggerBits >> 25)&1); }
   
@@ -67,6 +68,8 @@ class AliEmcalTriggerPatchInfo: public TObject {
 
   void SetOffSet(Int_t i)        { fOffSet      = i; }
 
+  void SetTriggerBitConfig(const AliEmcalTriggerBitConfig * ref) { fTriggerBitConfig.Initialise(*ref); }
+
 
  protected:
   TLorentzVector   &GetLorentzVector(const Double_t *vertex = 0)  const;
@@ -79,7 +82,8 @@ class AliEmcalTriggerPatchInfo: public TObject {
   Int_t             fTriggerBits;                   //trigger bit mask
   Int_t             fEdgeCell[2];                   // cell "bottom lower" edge (min phi, max eta)
   Int_t             fOffSet;                        // offset of bit (different in data and MC)
+  AliEmcalTriggerBitConfig   fTriggerBitConfig;     // Trigger bit configuration
 
-  ClassDef(AliEmcalTriggerPatchInfo, 4) // Emcal particle class
+  ClassDef(AliEmcalTriggerPatchInfo, 5) // Emcal particle class
 };
 #endif