AliPhysics  vAN-20151012 (2287573)
 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 #include <TSortedList.h>
36 #include "AliLog.h"
38 #include "AliAnalysisTaskEmcal.h"
39 
59  public:
75  };
76 
77  /***
78  * \enum TriggerMakerTriggerBitConfig_t
79  * \brief Definition of trigger bit configurations
80  *
81  * This enumeration handles different trigger bit configurations for the
82  * EMCAL Level1 triggers (with and without different thresholds) applied
83  * in the reconstruction of different samples.
84  */
88  };
89 
97  struct AliEmcalTriggerChannelPosition : public TObject{
98  public:
108  AliEmcalTriggerChannelPosition(int col, int row): fCol(col), fRow(row) { }
113 
118  int GetCol() const { return fCol; }
123  int GetRow() const { return fRow; }
124 
129  void SetCol(int col) { fCol = col; }
134  void SetRow(int row) { fRow = row; }
135 
136  inline virtual Bool_t IsEqual(const TObject *ref);
137  inline virtual Int_t Compare(const TObject *ref);
138  private:
139  Int_t fCol;
140  Int_t fRow;
141 
143  ClassDef(AliEmcalTriggerChannelPosition, 1);
145  };
146 
155  struct AliEmcalTriggerChannelContainer : public TObject {
156  public:
161 
166 
167  void AddChannel(int col, int row);
168  bool HasChannel(int col, int row);
169 
170  private:
171  TSortedList fChannels;
172 
174  ClassDef(AliEmcalTriggerChannelContainer, 1);
176  };
177 
179  AliEmcalTriggerMaker(const char *name, Bool_t doQA = kFALSE);
180  virtual ~AliEmcalTriggerMaker();
181 
182  void SetRunQA(Bool_t doQA = kTRUE) { fDoQA = doQA; }
183  void SetCaloTriggersOutName(const char *name) { fCaloTriggersOutName = name; }
184  void SetCaloTriggerSetupOutName(const char *name) { fCaloTriggerSetupOutName = name; }
185  void SetTriggerThresholdJetLow ( Int_t a, Int_t b, Int_t c ) { fThresholdConstants[2][0] = a; fThresholdConstants[2][1] = b; fThresholdConstants[2][2] = c; }
186  void SetTriggerThresholdJetHigh ( Int_t a, Int_t b, Int_t c ) { fThresholdConstants[0][0] = a; fThresholdConstants[0][1] = b; fThresholdConstants[0][2] = c; }
187  void SetTriggerThresholdGammaLow ( Int_t a, Int_t b, Int_t c ) { fThresholdConstants[3][0] = a; fThresholdConstants[3][1] = b; fThresholdConstants[3][2] = c; }
188  void SetTriggerThresholdGammaHigh( Int_t a, Int_t b, Int_t c ) { fThresholdConstants[3][0] = a; fThresholdConstants[1][1] = b; fThresholdConstants[1][2] = c; }
189  void SetV0InName(const char *name) { fV0InName = name; }
190  void AddHotFastor(int col, int row) { fBadChannels.AddChannel(col, row); }
191 
192  void SetRunTriggerType(TriggerMakerTriggerType_t type, Bool_t doTrigger = kTRUE) { fRunTriggerType[type] = doTrigger; }
195 
200  void SetRejectOffAcceptancePatches(Bool_t doReject = kTRUE) { fRejectOffAcceptancePatches = doReject; }
201 
202  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; }
203  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; }
204  Bool_t IsLevel0(Int_t tBits) const { if( tBits & (1 << (fTriggerBitConfig->GetLevel0Bit() + fTriggerBitConfig->GetLevel0Bit()) | (1 << fTriggerBitConfig->GetLevel0Bit()))) return kTRUE; return kFALSE; }
205 
206  protected:
207  enum{
210  };
211 
213  void ExecOnce();
214  Bool_t Run();
216  Bool_t NextTrigger( Bool_t &isOfflineSimple );
217  AliEmcalTriggerPatchInfo* ProcessPatch(TriggerMakerTriggerType_t type, Bool_t isOfflineSimple);
218  Bool_t CheckForL0(const AliVCaloTrigger &trg) const;
219 
223  TString fV0InName;
225  Int_t fThresholdConstants[4][3];
227  TClonesArray *fCaloTriggersOut;
231  AliAODCaloTrigger *fSimpleOfflineTriggers;
233  AliVVZERO *fV0;
243  Int_t fITrigger;
245  Bool_t fRunTriggerType[5];
246  Bool_t fDoQA;
248  THistManager *fQAHistos;
250  static const TString fgkTriggerTypeNames[5];
252  private:
253  AliEmcalTriggerMaker(const AliEmcalTriggerMaker&); // not implemented
254  AliEmcalTriggerMaker &operator=(const AliEmcalTriggerMaker&); // not implemented
255 
257  ClassDef(AliEmcalTriggerMaker, 6) // Task to make array of EMCAL trigger patches
259 };
260 
269  const AliEmcalTriggerChannelPosition *refpos = dynamic_cast<const AliEmcalTriggerChannelPosition *>(ref);
270  if(!refpos) return false;
271  return fCol == refpos->fCol && fRow == refpos->fRow;
272 }
273 
281  const AliEmcalTriggerChannelPosition *refpos = dynamic_cast<const AliEmcalTriggerChannelPosition *>(ref);
282  if(!refpos) return 1;
283  if(fCol == refpos->fCol){
284  if(fRow == refpos->fRow) return 0;
285  else if(fRow < refpos->fRow) return -1;
286  else return 1;
287  }
288  else if(fCol < refpos->fCol) return -1;
289  else return 1;
290 }
291 #endif
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
TriggerMakerTriggerType_t
Definition of different trigger patch types.
Bool_t fDoQA
Fill QA histograms.
const AliEmcalTriggerBitConfig * fTriggerBitConfig
void SetTriggerThresholdGammaHigh(Int_t a, Int_t b, Int_t c)
Int_t fITrigger
trigger counter
AliEmcalTriggerMaker & operator=(const AliEmcalTriggerMaker &)
Float_t fPatchAmplitudes[kPatchCols][kPatchRows]
TRU Amplitudes (for L0)
AliEmcalTriggerChannelContainer fBadChannels
Container of bad channels.
void SetCaloTriggersOutName(const char *name)
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.
Int_t fPatchADC[kPatchCols][kPatchRows]
ADC values map.
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
Double_t fPatchADCSimple[kPatchCols][kPatchRows]
patch map for simple offline trigger
AliVVZERO * fV0
V0 object.
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
void SetRunTriggerType(TriggerMakerTriggerType_t type, Bool_t doTrigger=kTRUE)
THistManager * fQAHistos
Histograms for QA.
EMCAL Gamma patches, recalculated.
Char_t fLevel0TimeMap[kPatchCols][kPatchRows]
Map needed to store the level0 times.
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