AliPhysics  2e7186c (2e7186c)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnalysisTaskEmcalTriggerBase.h
Go to the documentation of this file.
1 #ifndef ALIANALYSISTASKEMCALTRIGGERBASE_H
2 #define ALIANALYSISTASKEMCALTRIGGERBASE_H
3 /* Copyright(c) 1998-2016, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice */
5 
6 #include <TString.h>
7 #include <vector>
8 
9 #include "AliAnalysisTaskEmcal.h"
10 #include "AliCutValueRange.h"
12 
13 class TClonesArray;
14 class THistManager;
15 class AliOADBContainer;
16 
17 namespace EMCalTriggerPtAnalysis {
18 
59 public:
60 
65 
73  AliAnalysisTaskEmcalTriggerBase(const char *name);
74 
79 
86  void EnableDCALTriggers(Bool_t doEnable) { fEnableDCALTriggers = doEnable; }
87 
97  void SetDownscaleOADB(TString oadbname) { fNameDownscaleOADB = oadbname; }
98 
104  void SetExcludeNoiseEvents(Bool_t doExclude = true) { fRejectNoiseEvents = doExclude; }
105 
111  void SetSelectNoiseEvents(Bool_t doSelect = true) { fSelectNoiseEvents = doSelect; }
112 
117  void AddMaskedFastor(int fastorID) { fMaskedFastors.push_back(fastorID); }
118 
123  void SetMaskedFastorOADB(TString oadbname) { fNameMaskedFastorOADB = oadbname; }
124 
135 
145 
151  void SetVertexCut(double zmin, double zmax) { fVertexCut.SetLimits(zmin, zmax); }
152 
158 
164  void SetOnlineTriggerThreshold(const TString &triggerclass, Int_t threshold);
165 
172  void SetUseTriggerBits(Bool_t doUse) { fUseTriggerBits = doUse; }
173 
180  void SetRequireBunchCrossing(Bool_t doRequire) { fRequireBunchCrossing = doRequire; }
181 
187  void SetRequireAnalysisUtils(Bool_t doRequire) { fRequireAnalysisUtils = doRequire; }
188 
196  void SetTriggerAcceptanceOADB(const TString &nameAcceptanceOADB) { fNameAcceptanceOADB = nameAcceptanceOADB; }
197 
198 protected:
199 
206  virtual void UserCreateOutputObjects();
207 
217  virtual bool IsEventSelected();
218 
224  virtual bool IsUserEventSelected() { return true; }
225 
231  virtual void CreateUserHistos() = 0;
232 
237  virtual void CreateUserObjects() = 0;
238 
245  virtual void ExecOnce();
246 
254  virtual void RunChanged(Int_t runnuber);
255 
261 
267 
274  std::vector<TString> GetSupportedTriggers();
275 
284  Double_t GetTriggerWeight(const TString &triggerclass) const;
285 
291  TString GetFiredTriggerClassesFromPatches(const TClonesArray* triggerpatches) const;
292 
300  void TriggerSelection();
301 
310 
316  void SetClusterContainer(TString clustercontname) { fNameClusterContainer = clustercontname; }
317 
323  bool OnlineThresholdsInitialized() const;
324 
331 
337  Int_t GetOnlineTriggerThresholdByName(const TString &name) const;
338 
346  Bool_t SelectFiredPatch(const TString &triggerclass, Int_t adc) const;
347 
348 
350 
355  std::vector<TString> fSelectedTriggers;
357 
360 
362  AliOADBContainer *fDownscaleOADB;
365  AliOADBContainer *fMaskedFastorOADB;
366  std::vector<int> fMaskedFastors;
369 
373 
374 private:
377 };
378 
379 } /* namespace EMCalTriggerPtAnalysis */
380 
381 #endif /* ALIANALYSISTASKEMCALTRIGGERBASE_H */
std::vector< TString > fSelectedTriggers
! Triggers selected for given event
double Double_t
Definition: External.C:58
Int_t GetOnlineTriggerThresholdByIndex(AliEmcalTriggerOfflineSelection::EmcalTriggerClass trg) const
Bool_t fRejectNoiseEvents
Reject events triggered by noisy fastors.
Base task in the EMCAL framework.
void SetOnlineTriggerThreshold(const TString &triggerclass, Int_t threshold)
TString GetFiredTriggerClassesFromPatches(const TClonesArray *triggerpatches) const
AliEmcalTriggerOfflineSelection * fTriggerSelection
Offline trigger selection.
AliAnalysisTaskEmcalTriggerBase & operator=(const AliAnalysisTaskEmcalTriggerBase &)
Helper class selecting events on the presence of a trigger patch for the given type above threshold...
TObjArray fOnlineTriggerThresholds
Trigger thresholds applied at online level.
Bool_t fEnableDCALTriggers
Enable / Disable event selection for DCAL trigger classes.
void SetOfflineTriggerSelection(AliEmcalTriggerOfflineSelection *sel)
Set an offline trigger selection.
TString fNameMaskedFastorOADB
Name of the masked fastor OADB container.
Bool_t fRequireAnalysisUtils
Switch whether to require event selection in AliAnalysisUtils.
bool SelectOnlineTrigger(AliEmcalTriggerOfflineSelection::EmcalTriggerClass trigger) const
Bool_t fRequireBunchCrossing
Require bunch-bunch events (tag -B- in trigger string)
AliEmcalTriggerOfflineSelection * GetOfflineTriggerSelection() const
Providing access to the offline trigger selection.
TString fNameClusterContainer
Name of the cluster container in the event.
int Int_t
Definition: External.C:63
EmcalTriggerClass
Definition of the various supported trigger types.
const Double_t zmin
TString fNameDownscaleOADB
Name of the downscale OADB container.
TString fNameAcceptanceOADB
Name of the OADB container with the trigger acceptance.
AliOADBContainer * fMaskedFastorOADB
! Container with masked fastors
Bool_t fSelectNoiseEvents
Explicitly select events triggered only by noisy fastors.
Bool_t fUseTriggerBits
Switch whether using trigger bits (relies on physics selection)
Bool_t fTriggerStringFromPatches
Do rebuild the trigger string from trigger patches.
AliOADBContainer * fDownscaleOADB
! Container with downscale factors for different triggers
Container class for histograms.
Definition: THistManager.h:43
const Double_t zmax
AliCutValueRange< double > fVertexCut
Cut on the z-position of the primary vertex.
bool Bool_t
Definition: External.C:53
Bool_t SelectFiredPatch(const TString &triggerclass, Int_t adc) const