AliPhysics  vAN-20151016 (8d2b0e8)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
AliEmcalTriggerMaker.h
Go to the documentation of this file.
1 
24 #ifndef ALIEMCALTRIGGERMAKER_H
25 #define ALIEMCALTRIGGERMAKER_H
26 /* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
27  * See cxx source for full Copyright notice */
28 
29 class TClonesArray;
31 class AliAODCaloTrigger;
32 class AliVVZERO;
33 class THistManager;
34 
35 template<class T> class AliEmcalTriggerDataGrid;
36 
37 #include <TSortedList.h>
38 #include "AliLog.h"
40 #include "AliAnalysisTaskEmcal.h"
41 
61  public:
77  };
78 
79  /***
80  * \enum TriggerMakerTriggerBitConfig_t
81  * \brief Definition of trigger bit configurations
82  *
83  * This enumeration handles different trigger bit configurations for the
84  * EMCAL Level1 triggers (with and without different thresholds) applied
85  * in the reconstruction of different samples.
86  */
90  };
91 
99  struct AliEmcalTriggerChannelPosition : public TObject{
100  public:
110  AliEmcalTriggerChannelPosition(int col, int row): fCol(col), fRow(row) { }
115 
120  int GetCol() const { return fCol; }
125  int GetRow() const { return fRow; }
126 
131  void SetCol(int col) { fCol = col; }
136  void SetRow(int row) { fRow = row; }
137 
138  inline virtual Bool_t IsEqual(const TObject *ref);
139  inline virtual Int_t Compare(const TObject *ref);
140  private:
141  Int_t fCol;
142  Int_t fRow;
143 
145  ClassDef(AliEmcalTriggerChannelPosition, 1);
147  };
148 
157  struct AliEmcalTriggerChannelContainer : public TObject {
158  public:
163 
168 
169  void AddChannel(int col, int row);
170  bool HasChannel(int col, int row);
171 
172  private:
173  TSortedList fChannels;
174 
176  ClassDef(AliEmcalTriggerChannelContainer, 1);
178  };
179 
181  AliEmcalTriggerMaker(const char *name, Bool_t doQA = kFALSE);
182  virtual ~AliEmcalTriggerMaker();
183 
184  void SetRunQA(Bool_t doQA = kTRUE) { fDoQA = doQA; }
185  void SetCaloTriggersOutName(const char *name) { fCaloTriggersOutName = name; }
186  void SetCaloTriggerSetupOutName(const char *name) { fCaloTriggerSetupOutName = name; }
187  void SetTriggerThresholdJetLow ( Int_t a, Int_t b, Int_t c ) { fThresholdConstants[2][0] = a; fThresholdConstants[2][1] = b; fThresholdConstants[2][2] = c; }
188  void SetTriggerThresholdJetHigh ( Int_t a, Int_t b, Int_t c ) { fThresholdConstants[0][0] = a; fThresholdConstants[0][1] = b; fThresholdConstants[0][2] = c; }
189  void SetTriggerThresholdGammaLow ( Int_t a, Int_t b, Int_t c ) { fThresholdConstants[3][0] = a; fThresholdConstants[3][1] = b; fThresholdConstants[3][2] = c; }
190  void SetTriggerThresholdGammaHigh( Int_t a, Int_t b, Int_t c ) { fThresholdConstants[3][0] = a; fThresholdConstants[1][1] = b; fThresholdConstants[1][2] = c; }
191  void SetDebugLevel(Int_t debugLevel) { fDebugLevel = debugLevel; }
192  void SetV0InName(const char *name) { fV0InName = name; }
193  void AddHotFastor(int col, int row) { fBadChannels.AddChannel(col, row); }
194 
195  void SetRunTriggerType(TriggerMakerTriggerType_t type, Bool_t doTrigger = kTRUE) { fRunTriggerType[type] = doTrigger; }
198 
203  void SetRejectOffAcceptancePatches(Bool_t doReject = kTRUE) { fRejectOffAcceptancePatches = doReject; }
204 
205  inline Bool_t IsEJE(Int_t tBits) const;
206  inline Bool_t IsEGA(Int_t tBits) const;
207  inline Bool_t IsLevel0(Int_t tBits) const;
208 
209  protected:
210  static const TString fgkTriggerTypeNames[5];
211  static const int kColsEta;
212 
214  void ExecOnce();
215  Bool_t Run();
217  Bool_t NextTrigger( Bool_t &isOfflineSimple );
218  AliEmcalTriggerPatchInfo* ProcessPatch(TriggerMakerTriggerType_t type, Bool_t isOfflineSimple);
219  Bool_t CheckForL0(const AliVCaloTrigger &trg) const;
220 
224  TString fV0InName;
226  Int_t fThresholdConstants[4][3];
228  TClonesArray *fCaloTriggersOut;
230  AliAODCaloTrigger *fSimpleOfflineTriggers;
231  AliVVZERO *fV0;
236  Int_t fITrigger;
237  Bool_t fRunTriggerType[5];
238  Bool_t fDoQA;
240  THistManager *fQAHistos;
241 
242  Int_t fDebugLevel;
243 
244  private:
245  AliEmcalTriggerMaker(const AliEmcalTriggerMaker&); // not implemented
246  AliEmcalTriggerMaker &operator=(const AliEmcalTriggerMaker&); // not implemented
247 
249  ClassDef(AliEmcalTriggerMaker, 6) // Task to make array of EMCAL trigger patches
251 };
252 
261  const AliEmcalTriggerChannelPosition *refpos = dynamic_cast<const AliEmcalTriggerChannelPosition *>(ref);
262  if(!refpos) return false;
263  return fCol == refpos->fCol && fRow == refpos->fRow;
264 }
265 
273  const AliEmcalTriggerChannelPosition *refpos = dynamic_cast<const AliEmcalTriggerChannelPosition *>(ref);
274  if(!refpos) return 1;
275  if(fCol == refpos->fCol){
276  if(fRow == refpos->fRow) return 0;
277  else if(fRow < refpos->fRow) return -1;
278  else return 1;
279  }
280  else if(fCol < refpos->fCol) return -1;
281  else return 1;
282 }
283 
289 Bool_t AliEmcalTriggerMaker::IsEJE(Int_t tBits) const {
291  return kTRUE;
292  else
293  return kFALSE;
294 }
295 
301 Bool_t AliEmcalTriggerMaker::IsEGA(Int_t tBits) const {
303  return kTRUE;
304  else
305  return kFALSE;
306 }
307 
313 Bool_t AliEmcalTriggerMaker::IsLevel0(Int_t tBits) const {
315  return kTRUE;
316  return kFALSE;
317 }
318 
319 #endif
Bool_t fRejectOffAcceptancePatches
Switch for rejection of patches outside the acceptance.
void SetCaloTriggerSetupOutName(const char *name)
TString fCaloTriggersOutName
name of output track array
Old configuration, no distinction between high and low threshold.
Bool_t IsLevel0(Int_t tBits) const
void SetTriggerThresholdJetHigh(Int_t a, Int_t b, Int_t c)
TriggerMakerBitConfig_t fUseTriggerBitConfig
type of trigger config
AliEmcalTriggerDataGrid< char > * fLevel0TimeMap
! Map needed to store the level0 times
TriggerMakerTriggerType_t
Definition of different trigger patch types.
Bool_t fDoQA
Fill QA histograms.
const AliEmcalTriggerBitConfig * fTriggerBitConfig
Trigger bit configuration, aliroot-dependent.
void SetTriggerThresholdGammaHigh(Int_t a, Int_t b, Int_t c)
Int_t fITrigger
! trigger counter
AliEmcalTriggerMaker & operator=(const AliEmcalTriggerMaker &)
void SetDebugLevel(Int_t debugLevel)
AliEmcalTriggerChannelContainer fBadChannels
Container of bad channels.
void SetCaloTriggersOutName(const char *name)
static const int kColsEta
Number of columns in eta direction.
New configuration, distiction between high and low threshold.
static const TString fgkTriggerTypeNames[5]
Histogram name tags.
2D position of a trigger channel on the EMCAL surface
Bool_t IsEGA(Int_t tBits) const
Main data structure storing all relevant information of EMCAL/DCAL trigger patches.
Container for ADC / Amplitudes from the EMCAL triggers.
Int_t fThresholdConstants[4][3]
simple offline trigger thresholds constants
Bool_t IsEJE(Int_t tBits) const
void SetUseTriggerBitConfig(TriggerMakerBitConfig_t bitConfig)
TString fV0InName
name of output track array
EMCAL Jet patches, recalculated.
void SetTriggerBitConfig(const AliEmcalTriggerBitConfig *conf)
void SetRejectOffAcceptancePatches(Bool_t doReject=kTRUE)
AliEmcalTriggerSetupInfo * fCaloTriggerSetupOut
! trigger setup
Int_t fDebugLevel
Debug lebel;.
AliVVZERO * fV0
! V0 object
AliEmcalTriggerDataGrid< float > * fPatchAmplitudes
! TRU Amplitudes (for L0)
AliAODCaloTrigger * fSimpleOfflineTriggers
! simple offline trigger
Definition of trigger bit configurations.
Definition of EMCAL trigger bit configurations.
void SetTriggerThresholdGammaLow(Int_t a, Int_t b, Int_t c)
EMCAL trigger patch maker.
void SetV0InName(const char *name)
TClonesArray * fCaloTriggersOut
! trigger array out
AliEmcalTriggerDataGrid< int > * fPatchADC
! ADC values map
void SetRunTriggerType(TriggerMakerTriggerType_t type, Bool_t doTrigger=kTRUE)
THistManager * fQAHistos
! Histograms for QA
AliEmcalTriggerDataGrid< double > * fPatchADCSimple
! patch map for simple offline trigger
EMCAL Gamma patches, recalculated.
Bool_t fRunTriggerType[5]
Run patch maker for a given trigger type.
TString fCaloTriggerSetupOutName
name of output track array
void SetRunQA(Bool_t doQA=kTRUE)
void SetTriggerThresholdJetLow(Int_t a, Int_t b, Int_t c)
Settings manager for the trigger patch algorithm.
AliEmcalTriggerPatchInfo * ProcessPatch(TriggerMakerTriggerType_t type, Bool_t isOfflineSimple)
Structure for position of trigger channels.
Bool_t NextTrigger(Bool_t &isOfflineSimple)
TSortedList fChannels
Container for listed channels.
void AddHotFastor(int col, int row)
Bool_t CheckForL0(const AliVCaloTrigger &trg) const