]>
Commit | Line | Data |
---|---|---|
4d1a3169 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-2014, 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 | /* | |
16 | * Group of analysis components with the same event selection | |
17 | * Analysis components are initialised via the Initialise function, and executed, if | |
18 | * the event is selected, via the function process | |
19 | * | |
20 | * Author: Markus Fasel | |
21 | */ | |
22 | #include <THashList.h> | |
23 | #include <TList.h> | |
4d1a3169 | 24 | #include "AliEMCalTriggerTracksAnalysisComponent.h" |
25 | #include "AliEMCalTriggerEventSelection.h" | |
08f5b3a3 | 26 | |
4d1a3169 | 27 | #include "AliEMCalTriggerTaskGroup.h" |
28 | ||
29 | ClassImp(EMCalTriggerPtAnalysis::AliEMCalTriggerTaskGroup) | |
30 | ||
31 | namespace EMCalTriggerPtAnalysis { | |
32 | ||
33 | //______________________________________________________________________________ | |
34 | AliEMCalTriggerTaskGroup::AliEMCalTriggerTaskGroup() : | |
35 | TNamed(), | |
36 | fAnalysisComponents(NULL), | |
9de87858 | 37 | fEventSelection(NULL), |
44ef958c | 38 | fBinning(NULL), |
39 | fKineCuts(NULL) | |
4d1a3169 | 40 | { |
41 | /* | |
42 | * Dummy constructor, not to be used | |
43 | */ | |
44 | } | |
45 | ||
46 | //______________________________________________________________________________ | |
47 | AliEMCalTriggerTaskGroup::AliEMCalTriggerTaskGroup(const char* name) : | |
48 | TNamed(name, ""), | |
49 | fAnalysisComponents(NULL), | |
9de87858 | 50 | fEventSelection(NULL), |
44ef958c | 51 | fBinning(NULL), |
52 | fKineCuts(NULL) | |
4d1a3169 | 53 | { |
54 | /* | |
55 | * Main constructor: to be used by the users | |
56 | */ | |
57 | fAnalysisComponents = new TObjArray(); | |
58 | fAnalysisComponents->SetOwner(); | |
59 | } | |
60 | ||
61 | //______________________________________________________________________________ | |
62 | AliEMCalTriggerTaskGroup::~AliEMCalTriggerTaskGroup() { | |
63 | /* | |
64 | * Destructor | |
65 | */ | |
66 | if(fEventSelection) delete fEventSelection; | |
67 | if(fAnalysisComponents) delete fAnalysisComponents; | |
68 | } | |
69 | ||
70 | //______________________________________________________________________________ | |
71 | TList *AliEMCalTriggerTaskGroup::InitialiseAnalysisComponents() { | |
72 | /* | |
73 | * Initialise all analysis components. Build a global histlist for the full group | |
74 | * | |
75 | * @return: the global histogram list | |
76 | */ | |
77 | TIter compIter(fAnalysisComponents); | |
78 | AliEMCalTriggerTracksAnalysisComponent *ana(NULL); | |
79 | // Build a global histogram list | |
80 | TList *histlist = new TList; | |
81 | TObject *htmp(NULL); | |
82 | while((ana = dynamic_cast<AliEMCalTriggerTracksAnalysisComponent *>(compIter()))){ | |
9de87858 | 83 | ana->SetBinning(fBinning); |
44ef958c | 84 | ana->SetKineCuts(fKineCuts); |
0b065993 | 85 | ana->CreateHistos(); |
4d1a3169 | 86 | TList *ltmp = ana->GetHistList(); |
87 | TIter hiter(ltmp); | |
88 | while((htmp = hiter())) histlist->Add(htmp); | |
89 | } | |
90 | return histlist; | |
91 | } | |
92 | ||
93 | //______________________________________________________________________________ | |
94 | void AliEMCalTriggerTaskGroup::Process(const AliEMCalTriggerEventData* const event) { | |
95 | /* | |
96 | * Run analysis of the different groups. Apply event selection if requested; | |
97 | * | |
98 | * @param event: The combined event data | |
99 | */ | |
100 | if(fEventSelection && !fEventSelection->IsEventSelected(event)) return; | |
101 | TIter compIter(fAnalysisComponents); | |
102 | AliEMCalTriggerTracksAnalysisComponent *ana(NULL); | |
103 | while((ana = dynamic_cast<AliEMCalTriggerTracksAnalysisComponent *>(compIter()))) | |
104 | ana->Process(event); | |
105 | } | |
106 | ||
107 | //______________________________________________________________________________ | |
108 | void AliEMCalTriggerTaskGroup::AddAnalysisComponent(AliEMCalTriggerTracksAnalysisComponent * const analysis) { | |
109 | /* | |
110 | * Add new analysis component to the task group | |
111 | * | |
112 | * @param analysis: the analysis component to be added | |
113 | */ | |
114 | fAnalysisComponents->Add(analysis); | |
115 | } | |
116 | ||
d824c93c | 117 | //______________________________________________________________________________ |
118 | void EMCalTriggerPtAnalysis::AliEMCalTriggerTaskGroup::SetTriggerDecision( | |
119 | const AliEMCalTriggerAnaTriggerDecision* trigger) { | |
120 | /* | |
121 | * Forward trigger decision to the analysis components | |
122 | * | |
123 | * @param trigger: the trigger decision | |
124 | */ | |
125 | AliEMCalTriggerTracksAnalysisComponent *myana(NULL); | |
126 | TIter compIter(fAnalysisComponents); | |
127 | while((myana = dynamic_cast<AliEMCalTriggerTracksAnalysisComponent *>(compIter()))) | |
128 | myana->SetTriggerDecision(trigger); | |
129 | } | |
130 | ||
131 | ||
4d1a3169 | 132 | } /* namespace EMCalTriggerPtAnalysis */ |