AliPhysics  d497547 (d497547)
 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 
25 namespace EMCalTriggerPtAnalysis {
26 
27 class AliEMCalTriggerAnaTriggerDecision;
28 class AliEMCalTriggerEventData;
29 
40 public:
45  TObject(),
46  fPattern(""),
47  fInString(kTRUE)
48  {}
54  AliEMCalTriggerAnaPatternObject(const char *pattern, bool inString):
55  TObject(),
56  fPattern(pattern),
57  fInString(inString)
58  {}
63 
64  Bool_t MatchTriggerString(const char *triggerstring) const;
65 
66 private:
69 
73 };
74 
80 public:
82  TObject(),
83  fPatterns()
84  {
85  fPatterns.SetOwner(kTRUE);
86  }
91 
97  void AddPattern(const char *pattern, bool isRequested){
98  fPatterns.Add(new AliEMCalTriggerAnaPatternObject(pattern, isRequested));
99  }
100 
101  bool CheckTriggerString(const char * triggerstring) const;
102 
103 private:
105 
109 };
110 
116 public:
121  TObject(),
123  {}
133 
139 
140 private:
142 
146 };
147 
148 /*
149  * Exceptions:
150  */
151 
156 class TriggerMethodUndefinedException : public std::exception{
157 public:
162  TriggerMethodUndefinedException(std::string triggerclass):
163  fMessage("")
164  {
165  fMessage = "Trigger method undefined for trigger class " + triggerclass;
166  }
170  virtual ~TriggerMethodUndefinedException() throw () { }
171 
176  const char *what() const throw () {
177  return fMessage.c_str();
178  }
179 private:
180  std::string fMessage;
181 };
182 
187 class PatchHandlerMissingException : public std::exception{
188 public:
193  PatchHandlerMissingException(std::string triggerclass):
194  fMessage("")
195  {
196  fMessage = "Trigger method undefined for trigger class " + triggerclass;
197  }
201  virtual ~PatchHandlerMissingException() throw () { }
202 
207  const char *what() const throw () {
208  return fMessage.c_str();
209  }
210 private:
211  std::string fMessage;
212 };
213 
218 class EventCorruptionException : public std::exception{
219 public:
225  EventCorruptionException(std::string triggerclass, std::string reason):
226  fMessage("")
227  {
228  std::stringstream messagebuilder;
229  messagebuilder << "Event corrupted for trigger class " << triggerclass << ": " << reason;
230  fMessage = messagebuilder.str();
231  }
235  virtual ~EventCorruptionException() throw () { }
236 
241  const char *what() const throw () {
242  return fMessage.c_str();
243  }
244 
245 private:
246  std::string fMessage;
247 };
248 
263 public:
265  AliEMCalTriggerAnaTriggerClass(const char *name, const char *title);
267 
268  bool IsEventTriggered(const AliEMCalTriggerEventData * const) const;
273  bool IsMinBiasTrigger() const { return fIsMinBiasTrigger; }
274 
279  void AddTriggerBit(UInt_t triggerbit) {
280  fTriggerBits |= triggerbit;
281  fDecisionFromTriggerBits = kTRUE;
282  }
288  void AddTriggerStringPattern(const char *triggerpattern, bool isRequested) {
289  fTriggerStringPattern.AddPattern(triggerpattern, isRequested);
291  }
298  }
308  void SetMinBiasTrigger(Bool_t isMinBias) { fIsMinBiasTrigger = isMinBias; }
309 
310 protected:
314 
320 
322  ClassDef(AliEMCalTriggerAnaTriggerClass, 1);
324 };
325 
326 } /* namespace EMCalTriggerPtAnalysis */
327 
328 #endif /* ALIEMCALTRIGGERANATRIGGERCLASS_H */
Class performing the selection of triggered events.
const char * title
Definition: MakeQAPdf.C:27
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.
unsigned int UInt_t
Definition: External.C:33
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
bool Bool_t
Definition: External.C:53
UInt_t fTriggerBits
Trigger bits used for event selection.
Exception class for events where the trigger patch handler is not set.