1 /**************************************************************************
2 * Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
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
20 * Author: Markus Fasel
22 #include <THashList.h>
24 #include "AliEMCalTriggerTracksAnalysisComponent.h"
25 #include "AliEMCalTriggerEventSelection.h"
27 #include "AliEMCalTriggerTaskGroup.h"
29 ClassImp(EMCalTriggerPtAnalysis::AliEMCalTriggerTaskGroup)
31 namespace EMCalTriggerPtAnalysis {
33 //______________________________________________________________________________
34 AliEMCalTriggerTaskGroup::AliEMCalTriggerTaskGroup() :
36 fAnalysisComponents(NULL),
37 fEventSelection(NULL),
42 * Dummy constructor, not to be used
46 //______________________________________________________________________________
47 AliEMCalTriggerTaskGroup::AliEMCalTriggerTaskGroup(const char* name) :
49 fAnalysisComponents(NULL),
50 fEventSelection(NULL),
55 * Main constructor: to be used by the users
57 fAnalysisComponents = new TObjArray();
58 fAnalysisComponents->SetOwner();
61 //______________________________________________________________________________
62 AliEMCalTriggerTaskGroup::~AliEMCalTriggerTaskGroup() {
66 if(fEventSelection) delete fEventSelection;
67 if(fAnalysisComponents) delete fAnalysisComponents;
70 //______________________________________________________________________________
71 TList *AliEMCalTriggerTaskGroup::InitialiseAnalysisComponents() {
73 * Initialise all analysis components. Build a global histlist for the full group
75 * @return: the global histogram list
77 TIter compIter(fAnalysisComponents);
78 AliEMCalTriggerTracksAnalysisComponent *ana(NULL);
79 // Build a global histogram list
80 TList *histlist = new TList;
82 while((ana = dynamic_cast<AliEMCalTriggerTracksAnalysisComponent *>(compIter()))){
84 ana->SetBinning(fBinning);
85 ana->SetKineCuts(fKineCuts);
86 TList *ltmp = ana->GetHistList();
88 while((htmp = hiter())) histlist->Add(htmp);
93 //______________________________________________________________________________
94 void AliEMCalTriggerTaskGroup::Process(const AliEMCalTriggerEventData* const event) {
96 * Run analysis of the different groups. Apply event selection if requested;
98 * @param event: The combined event data
100 if(fEventSelection && !fEventSelection->IsEventSelected(event)) return;
101 TIter compIter(fAnalysisComponents);
102 AliEMCalTriggerTracksAnalysisComponent *ana(NULL);
103 while((ana = dynamic_cast<AliEMCalTriggerTracksAnalysisComponent *>(compIter())))
107 //______________________________________________________________________________
108 void AliEMCalTriggerTaskGroup::AddAnalysisComponent(AliEMCalTriggerTracksAnalysisComponent * const analysis) {
110 * Add new analysis component to the task group
112 * @param analysis: the analysis component to be added
114 fAnalysisComponents->Add(analysis);
117 //______________________________________________________________________________
118 void EMCalTriggerPtAnalysis::AliEMCalTriggerTaskGroup::SetTriggerDecision(
119 const AliEMCalTriggerAnaTriggerDecision* trigger) {
121 * Forward trigger decision to the analysis components
123 * @param trigger: the trigger decision
125 AliEMCalTriggerTracksAnalysisComponent *myana(NULL);
126 TIter compIter(fAnalysisComponents);
127 while((myana = dynamic_cast<AliEMCalTriggerTracksAnalysisComponent *>(compIter())))
128 myana->SetTriggerDecision(trigger);
132 } /* namespace EMCalTriggerPtAnalysis */