AliPhysics  4c20e6b (4c20e6b)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliEMCalTriggerAnaTriggerClass.h
Go to the documentation of this file.
1 
12 #ifndef ALIEMCALTRIGGERANATRIGGERCLASS_H
13 #define ALIEMCALTRIGGERANATRIGGERCLASS_H
14 /* Copyright(c) 1998-2015, ALICE Experiment at CERN, All rights reserved. *
15  * See cxx source for full Copyright notice */
16 
17 #include <exception>
18 #include <string>
19 #include <sstream>
20 #include <TNamed.h>
21 #include <TObjArray.h>
22 #include <TString.h>
24 
32 namespace EMCalTriggerPtAnalysis {
33 
34 class AliEMCalTriggerAnaTriggerDecision;
35 class AliEMCalTriggerEventData;
36 
46 class AliEMCalTriggerAnaPatternObject: public TObject {
47 public:
52  TObject(),
53  fPattern(""),
54  fInString(kTRUE)
55  {}
61  AliEMCalTriggerAnaPatternObject(const char *pattern, bool inString):
62  TObject(),
63  fPattern(pattern),
64  fInString(inString)
65  {}
70 
71  Bool_t MatchTriggerString(const char *triggerstring) const;
72 
73 private:
74  TString fPattern;
75  Bool_t fInString;
76 
80 };
81 
86 class AliEMCalTriggerAnaPatternContainer : public TObject{
87 public:
89  TObject(),
90  fPatterns()
91  {
92  fPatterns.SetOwner(kTRUE);
93  }
98 
104  void AddPattern(const char *pattern, bool isRequested){
105  fPatterns.Add(new AliEMCalTriggerAnaPatternObject(pattern, isRequested));
106  }
107 
108  bool CheckTriggerString(const char * triggerstring) const;
109 
110 private:
111  TObjArray fPatterns;
112 
116 };
117 
123 public:
128  TObject(),
130  {}
140 
146 
147 private:
149 
153 };
154 
155 /*
156  * Exceptions:
157  */
158 
163 class TriggerMethodUndefinedException : public std::exception{
164 public:
169  TriggerMethodUndefinedException(std::string triggerclass):
170  fMessage("")
171  {
172  fMessage = "Trigger method undefined for trigger class " + triggerclass;
173  }
177  virtual ~TriggerMethodUndefinedException() throw () { }
178 
183  const char *what() const throw () {
184  return fMessage.c_str();
185  }
186 private:
187  std::string fMessage;
188 };
189 
194 class PatchHandlerMissingException : public std::exception{
195 public:
200  PatchHandlerMissingException(std::string triggerclass):
201  fMessage("")
202  {
203  fMessage = "Trigger method undefined for trigger class " + triggerclass;
204  }
208  virtual ~PatchHandlerMissingException() throw () { }
209 
214  const char *what() const throw () {
215  return fMessage.c_str();
216  }
217 private:
218  std::string fMessage;
219 };
220 
225 class EventCorruptionException : public std::exception{
226 public:
232  EventCorruptionException(std::string triggerclass, std::string reason):
233  fMessage("")
234  {
235  std::stringstream messagebuilder;
236  messagebuilder << "Event corrupted for trigger class " << triggerclass << ": " << reason;
237  fMessage = messagebuilder.str();
238  }
242  virtual ~EventCorruptionException() throw () { }
243 
248  const char *what() const throw () {
249  return fMessage.c_str();
250  }
251 
252 private:
253  std::string fMessage;
254 };
255 
269 class AliEMCalTriggerAnaTriggerClass: public TNamed {
270 public:
272  AliEMCalTriggerAnaTriggerClass(const char *name, const char *title);
274 
275  bool IsEventTriggered(const AliEMCalTriggerEventData * const) const;
280  bool IsMinBiasTrigger() const { return fIsMinBiasTrigger; }
281 
286  void AddTriggerBit(UInt_t triggerbit) {
287  fTriggerBits |= triggerbit;
288  fDecisionFromTriggerBits = kTRUE;
289  }
295  void AddTriggerStringPattern(const char *triggerpattern, bool isRequested) {
296  fTriggerStringPattern.AddPattern(triggerpattern, isRequested);
298  }
305  }
315  void SetMinBiasTrigger(Bool_t isMinBias) { fIsMinBiasTrigger = isMinBias; }
316 
317 protected:
321 
323  UInt_t fTriggerBits;
325  TObjArray fTriggerPatchTypes;
327 
329  ClassDef(AliEMCalTriggerAnaTriggerClass, 1);
331 };
332 
333 } /* namespace EMCalTriggerPtAnalysis */
334 
335 #endif /* ALIEMCALTRIGGERANATRIGGERCLASS_H */
Class performing the selection of triggered events.
const char * title
Definition: MakeQAPdf.C:26
Bool_t fIsMinBiasTrigger
Flag class as min. bias trigger class.
Exception class for events trigger classes which do not have a method for event selection defined...
Helper class containing different trigger patterns to check in the trigger string.
Bool_t fDecisionFromTriggerString
Switch for using the trigger string for event selection.
EventCorruptionException(std::string triggerclass, std::string reason)
Bool_t fInString
Trigger pattern to check for in the trigger string.
ETATriggerType
Trigger types defined for this analysis.
Bool_t fDecisionFromTriggerBits
Switch for using trigger bits for event selection.
void AddTriggerStringPattern(const char *triggerpattern, bool isRequested)
Bool_t fDecisionFromTriggerPatches
Switch for using reconstructed trigger patches for event selection.
void SetTriggerDecisionHandler(AliEMCalTriggerAnaTriggerDecision *triggerhandler)
TObjArray fTriggerPatchTypes
Trigger patch types used for the selection.
AliEMCalTriggerAnaTriggerDecision * fEmcalTriggerHandler
Handling of trigger patch selection.
Helper class describing a trigger pattern in the trigger string.
Simple event container within the high- track analysis.
Exception class thrown when event collection is corrupted (event pointer 0 or trigger patch container...
AliEMCalTriggerAnaPatternContainer fTriggerStringPattern
Trigger patterns used for event selection.
bool IsEventTriggered(const AliEMCalTriggerEventData *const) const
UInt_t fTriggerBits
Trigger bits used for event selection.
Exception class for events where the trigger patch handler is not set.