AliPhysics  0e0bd91 (0e0bd91)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
AliEMCalTriggerAnaClassManager.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 <TObjArray.h>
16 
20 
24 
25 namespace EMCalTriggerPtAnalysis {
26 
30 AliEMCalTriggerAnaClassManager::AliEMCalTriggerAnaClassManager():
31  TNamed(),
32  fTriggerClasses(NULL),
33  fSelected(NULL)
34 {
35 }
36 
42  TNamed(name, ""),
43  fTriggerClasses(NULL),
44  fSelected(NULL)
45 {
46  fTriggerClasses = new TObjArray;
47  fTriggerClasses->SetOwner(kTRUE);
48  fSelected = new TObjArray;
49  fSelected->SetOwner(kFALSE);
50 }
51 
57  TNamed(ref),
58  fTriggerClasses(NULL),
59  fSelected(NULL)
60 {
61  fTriggerClasses = new TObjArray;
62  fTriggerClasses->SetOwner(kFALSE);
63  // Copy trigger classes - only pointers
64  for(TIter classiter = TIter(ref.fTriggerClasses).Begin(); classiter != TIter::End(); ++classiter){
65  fTriggerClasses->Add(*classiter);
66  }
67  fSelected = new TObjArray;
68  fSelected->SetOwner(kFALSE);
69 }
70 
77  TNamed::operator=(ref);
78  if(this != &ref){
79  fSelected->Clear();
80  fTriggerClasses->Clear();
81  // Copy trigger classes - only pointers
82  for(TIter classiter = TIter(ref.fTriggerClasses).Begin(); classiter != TIter::End(); ++classiter){
83  fTriggerClasses->Add(*classiter);
84  }
85  }
86  return *this;
87 }
88 
89 
95  if(fSelected) delete fSelected;
96 }
97 
104  fSelected->Clear();
105  if(!fTriggerClasses->GetEntries()) throw TriggerManagerEmptyException();
106  for(TIter clsiter = TIter(fTriggerClasses).Begin(); clsiter != TIter::End(); ++clsiter){
107  AliEMCalTriggerAnaTriggerClass * myclass = static_cast<AliEMCalTriggerAnaTriggerClass *>(*clsiter);
108  if(myclass->IsEventTriggered(trgevent)) fSelected->Add(myclass);
109  }
110 }
111 
117  fTriggerClasses->Add(triggerclass);
118 }
124  for(TIter clsiter = TIter(fTriggerClasses).Begin(); clsiter != TIter::End(); ++clsiter){
125  (static_cast<AliEMCalTriggerAnaTriggerClass *>(*clsiter))->SetTriggerDecisionHandler(triggerdecision);
126  }
127 }
128 
134  bool result = kFALSE;
135  for(TIter clsiter = TIter(fSelected).Begin(); clsiter != TIter::End(); ++clsiter){
136  if((static_cast<AliEMCalTriggerAnaTriggerClass *>(*clsiter))->IsMinBiasTrigger()){
137  result = kTRUE;
138  break;
139  }
140  }
141  return kTRUE;
142 }
143 
150  if(!fTriggerClasses->GetEntries()) throw TriggerManagerEmptyException();
151  return fSelected;
152 }
159  if(!fTriggerClasses->GetEntries()) throw TriggerManagerEmptyException();
160  return fTriggerClasses;
161 }
162 
163 } /* namespace EMCalTriggerPtAnalysis */
Class performing the selection of triggered events.
ClassImp(AliAnalysisTaskTriggerRates) AliAnalysisTaskTriggerRates
Declaration of class AliEMCalTriggerAnaTriggerDecision, a container for trigger decision in EMCAL-tri...
void SetTriggerDecision(AliEMCalTriggerAnaTriggerDecision *triggerdecision)
TObjArray * fSelected
List of selected trigger classes.
AliEMCalTriggerAnaClassManager & operator=(const AliEMCalTriggerAnaClassManager &ref)
Exception handling in case event selection is performed on an empty trigger manager.
void AddTriggerClass(AliEMCalTriggerAnaTriggerClass *triggerclass)
Declaration of a management class for trigger classes.
Simple event container within the high- track analysis.
bool IsEventTriggered(const AliEMCalTriggerEventData *const) const
Definition of a trigger class.