AliPhysics  9fe175b (9fe175b)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliEmcalTriggerOfflineSelection.cxx
Go to the documentation of this file.
1 /*
2  * AliEmcalTriggerOfflineSelection.cxx
3  *
4  * Created on: Feb 23, 2016
5  * Author: markus
6  */
7 #include <TClonesArray.h>
8 
9 #include "AliEMCALTriggerPatchInfo.h"
11 
13 
14 namespace EMCalTriggerPtAnalysis {
15 
16 AliEmcalTriggerOfflineSelection::AliEmcalTriggerOfflineSelection() {
17  enum EmcalTriggerClass{
18  kCPREL0 = 0,
19  kCPREG1,
20  kCPREG2,
21  kCPREJ1,
22  kCPREJ2,
23  kCPRntrig
24  };
25 }
26 
35 Bool_t AliEmcalTriggerOfflineSelection::IsOfflineSelected(EmcalTriggerClass trgcls, const TClonesArray * const triggerpatches) const {
36  if(fOfflineEnergyThreshold[trgcls] < 0) return true;
37  bool isSingleShower = IsSingleShower(trgcls);
38  int nfound = 0;
39  AliEMCALTriggerPatchInfo *patch = NULL;
40  for(TIter patchIter = TIter(triggerpatches).Begin(); patchIter != TIter::End(); ++patchIter){
41  patch = static_cast<AliEMCALTriggerPatchInfo *>(*patchIter);
42  if(!patch->IsOfflineSimple()) continue;
43  if(isSingleShower){
44  if(!patch->IsGammaLowSimple()) continue;
45  } else {
46  if(!patch->IsJetLowSimple()) continue;
47  }
48  if(patch->GetPatchE() > fOfflineEnergyThreshold[trgcls]) nfound++;
49  }
50  return nfound > 0;
51 }
52 
53 Bool_t AliEmcalTriggerOfflineSelection::IsSingleShower(EmcalTriggerClass cls){
54  return ((cls == kTrgEG1) || (cls == kTrgEG2) || (cls == kTrgEL0) || (cls == kTrgDG1) || (cls == kTrgDG2) || (cls == kTrgDL0));
55 
56 }
57 
58 Bool_t AliEmcalTriggerOfflineSelection::IsDCAL(EmcalTriggerClass cls){
59  return ((cls == kTrgDL0) || (cls == kTrgDG1) || (cls == kTrgDG2) || (cls == kTrgDJ1) || (cls == kTrgDJ2));
60 }
61 
62 } /* namespace EMCalTriggerPtAnalysis */
ClassImp(EMCalTriggerPtAnalysis::AliEmcalTriggerOfflineSelection) namespace EMCalTriggerPtAnalysis