AliPhysics  vAN-20151012 (2287573)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
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 
43 class AliEMCalTriggerAnaPatternObject: public TObject {
44 public:
49  TObject(),
50  fPattern(""),
51  fInString(kTRUE)
52  {}
58  AliEMCalTriggerAnaPatternObject(const char *pattern, bool inString):
59  TObject(),
60  fPattern(pattern),
61  fInString(inString)
62  {}
67 
68  Bool_t MatchTriggerString(const char *triggerstring) const;
69 
70 private:
71  TString fPattern;
72  Bool_t fInString;
73 
77 };
78 
83 class AliEMCalTriggerAnaPatternContainer : public TObject{
84 public:
86  TObject(),
87  fPatterns()
88  {
89  fPatterns.SetOwner(kTRUE);
90  }
95 
101  void AddPattern(const char *pattern, bool isRequested){
102  fPatterns.Add(new AliEMCalTriggerAnaPatternObject(pattern, isRequested));
103  }
104 
105  bool CheckTriggerString(const char * triggerstring) const;
106 
107 private:
108  TObjArray fPatterns;
109 
113 };
114 
120 public:
125  TObject(),
127  {}
137 
143 
144 private:
146 
150 };
151 
152 /*
153  * Exceptions:
154  */
155 
160 class TriggerMethodUndefinedException : public std::exception{
161 public:
166  TriggerMethodUndefinedException(std::string triggerclass):
167  fMessage("")
168  {
169  fMessage = "Trigger method undefined for trigger class " + triggerclass;
170  }
174  virtual ~TriggerMethodUndefinedException() throw () { }
175 
180  const char *what() const throw () {
181  return fMessage.c_str();
182  }
183 private:
184  std::string fMessage;
185 };
186 
191 class PatchHandlerMissingException : public std::exception{
192 public:
197  PatchHandlerMissingException(std::string triggerclass):
198  fMessage("")
199  {
200  fMessage = "Trigger method undefined for trigger class " + triggerclass;
201  }
205  virtual ~PatchHandlerMissingException() throw () { }
206 
211  const char *what() const throw () {
212  return fMessage.c_str();
213  }
214 private:
215  std::string fMessage;
216 };
217 
222 class EventCorruptionException : public std::exception{
223 public:
229  EventCorruptionException(std::string triggerclass, std::string reason):
230  fMessage("")
231  {
232  std::stringstream messagebuilder;
233  messagebuilder << "Event corrupted for trigger class " << triggerclass << ": " << reason;
234  fMessage = messagebuilder.str();
235  }
239  virtual ~EventCorruptionException() throw () { }
240 
245  const char *what() const throw () {
246  return fMessage.c_str();
247  }
248 
249 private:
250  std::string fMessage;
251 };
252 
266 class AliEMCalTriggerAnaTriggerClass: public TNamed {
267 public:
269  AliEMCalTriggerAnaTriggerClass(const char *name, const char *title);
271 
272  bool IsEventTriggered(const AliEMCalTriggerEventData * const) const;
277  bool IsMinBiasTrigger() const { return fIsMinBiasTrigger; }
278 
283  void AddTriggerBit(UInt_t triggerbit) {
284  fTriggerBits |= triggerbit;
285  fDecisionFromTriggerBits = kTRUE;
286  }
292  void AddTriggerStringPattern(const char *triggerpattern, bool isRequested) {
293  fTriggerStringPattern.AddPattern(triggerpattern, isRequested);
295  }
302  }
312  void SetMinBiasTrigger(Bool_t isMinBias) { fIsMinBiasTrigger = isMinBias; }
313 
314 protected:
318 
320  UInt_t fTriggerBits;
322  TObjArray fTriggerPatchTypes;
324 
326  ClassDef(AliEMCalTriggerAnaTriggerClass, 1);
328 };
329 
330 } /* namespace EMCalTriggerPtAnalysis */
331 
332 #endif /* ALIEMCALTRIGGERANATRIGGERCLASS_H */
Class performing the selection of triggered events.
Declaration of class AliEMCalTriggerAnaTriggerDecision, a container for trigger decision in EMCAL-tri...
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.