AliPhysics  0e0bd91 (0e0bd91)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
AliEMCalTriggerAnaTriggerClass.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-2015, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: The ALICE Off-line Project. *
5  * Contributors are mentioned in the code where appropriate. *
6  * *
7  * Permission to use, copy, modify and distribute this software and its *
8  * documentation strictly for non-commercial purposes is hereby granted *
9  * without fee, provided that the above copyright notice appears in all *
10  * copies and that both the copyright notice and this permission notice *
11  * appear in the supporting documentation. The authors make no claims *
12  * about the suitability of this software for any purpose. It is *
13  * provided "as is" without express or implied warranty. *
14  **************************************************************************/
15 #include "AliLog.h"
16 #include "AliVEvent.h"
19 
22 ClassImp(EMCalTriggerPtAnalysis::AliEMCalTriggerAnaPatternObject)
23 ClassImp(EMCalTriggerPtAnalysis::AliEMCalTriggerAnaPatternContainer)
24 ClassImp(EMCalTriggerPtAnalysis::AliEMCalTriggerAnaTriggerPatchTypeObject)
26 
27 namespace EMCalTriggerPtAnalysis {
28 
32 AliEMCalTriggerAnaTriggerClass::AliEMCalTriggerAnaTriggerClass() :
33  TNamed(),
34  fDecisionFromTriggerBits(kFALSE),
35  fDecisionFromTriggerString(kFALSE),
36  fDecisionFromTriggerPatches(kFALSE),
37  fTriggerBits(0),
38  fIsMinBiasTrigger(kFALSE),
39  fTriggerStringPattern(),
40  fEmcalTriggerHandler(NULL)
41 {
42 }
43 
50  TNamed(name, title),
51  fDecisionFromTriggerBits(kFALSE),
52  fDecisionFromTriggerString(kFALSE),
53  fDecisionFromTriggerPatches(kFALSE),
54  fTriggerBits(0),
55  fIsMinBiasTrigger(kFALSE),
56  fTriggerStringPattern(),
57  fTriggerPatchTypes(),
58  fEmcalTriggerHandler(NULL)
59 {
60  fTriggerPatchTypes.SetOwner(kTRUE);
61 }
62 
67 
78  throw TriggerMethodUndefinedException(this->GetName());
79  bool result = kTRUE;
80 
82  result = result && (triggerevent->GetTriggerBitSelection() & fTriggerBits);
83  }
84  if(!result) return kFALSE;
85 
87  if(!triggerevent->GetRecEvent())
88  throw EventCorruptionException(this->GetName(), "Reconstructed event missing");
89  result = result && fTriggerStringPattern.CheckTriggerString(triggerevent->GetRecEvent()->GetFiredTriggerClasses().Data());
90  }
91  if(!result) return kFALSE;
92 
95  if(triggerevent->GetTriggerPatchContainer())
96  throw EventCorruptionException(this->GetName(), "Trigger patch container missing");
97  for(TIter typeiter = TIter(&fTriggerPatchTypes).Begin(); typeiter != TIter::End(); ++typeiter){
99  result = result && fEmcalTriggerHandler->IsTriggered(patchtype->GetTriggerType(), kTriggerPatches);
100  }
101  } else
102  throw PatchHandlerMissingException(this->GetName());
103  }
104 
105  return result;
106 }
107 
113 Bool_t AliEMCalTriggerAnaPatternObject::MatchTriggerString(const char *triggerstring) const {
114  Bool_t patternmatch = TString(triggerstring).Contains(fPattern);
115  return fInString ? patternmatch : !patternmatch;
116 }
117 
123 Bool_t AliEMCalTriggerAnaPatternContainer::CheckTriggerString(const char *triggerstring) const{
124  Bool_t result = kTRUE;
125 
126  for(TIter piter = TIter(&fPatterns).Begin(); piter != TIter::End(); ++piter){
127  const AliEMCalTriggerAnaPatternObject *toCheck = static_cast<const AliEMCalTriggerAnaPatternObject *>(*piter);
128  result = result && toCheck->MatchTriggerString(triggerstring);
129  }
130  return result;
131 }
132 
133 } /* namespace EMCalTriggerPtAnalysis */
ClassImp(AliAnalysisTaskTriggerRates) AliAnalysisTaskTriggerRates
const char * title
Definition: MakeQAPdf.C:26
Exception class for events trigger classes which do not have a method for event selection defined...
Bool_t fDecisionFromTriggerString
Switch for using the trigger string for event selection.
Bool_t IsTriggered(ETATriggerType trigger, ETriggerMethod_t method=kTriggerString) const
Bool_t fInString
Trigger pattern to check for in the trigger string.
Bool_t fDecisionFromTriggerBits
Switch for using trigger bits for event selection.
Bool_t fDecisionFromTriggerPatches
Switch for using reconstructed trigger patches for event selection.
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
Definition of a trigger class.
UInt_t fTriggerBits
Trigger bits used for event selection.
Event Data used in exchange to the different analysis components.
Exception class for events where the trigger patch handler is not set.