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>
25 #include "AliEMCalTriggerTracksAnalysisComponent.h"
26 #include "AliEMCalTriggerEventSelection.h"
27 #include "AliEMCalTriggerTaskGroup.h"
29 ClassImp(EMCalTriggerPtAnalysis::AliEMCalTriggerTaskGroup)
31 namespace EMCalTriggerPtAnalysis {
33 //______________________________________________________________________________
34 AliEMCalTriggerTaskGroup::AliEMCalTriggerTaskGroup() :
36 fAnalysisComponents(NULL),
40 * Dummy constructor, not to be used
44 //______________________________________________________________________________
45 AliEMCalTriggerTaskGroup::AliEMCalTriggerTaskGroup(const char* name) :
47 fAnalysisComponents(NULL),
51 * Main constructor: to be used by the users
53 fAnalysisComponents = new TObjArray();
54 fAnalysisComponents->SetOwner();
57 //______________________________________________________________________________
58 AliEMCalTriggerTaskGroup::~AliEMCalTriggerTaskGroup() {
62 if(fEventSelection) delete fEventSelection;
63 if(fAnalysisComponents) delete fAnalysisComponents;
66 //______________________________________________________________________________
67 TList *AliEMCalTriggerTaskGroup::InitialiseAnalysisComponents() {
69 * Initialise all analysis components. Build a global histlist for the full group
71 * @return: the global histogram list
73 TIter compIter(fAnalysisComponents);
74 AliEMCalTriggerTracksAnalysisComponent *ana(NULL);
75 // Build a global histogram list
76 TList *histlist = new TList;
78 while((ana = dynamic_cast<AliEMCalTriggerTracksAnalysisComponent *>(compIter()))){
80 TList *ltmp = ana->GetHistList();
82 while((htmp = hiter())) histlist->Add(htmp);
87 //______________________________________________________________________________
88 void AliEMCalTriggerTaskGroup::Process(const AliEMCalTriggerEventData* const event) {
90 * Run analysis of the different groups. Apply event selection if requested;
92 * @param event: The combined event data
94 if(fEventSelection && !fEventSelection->IsEventSelected(event)) return;
95 TIter compIter(fAnalysisComponents);
96 AliEMCalTriggerTracksAnalysisComponent *ana(NULL);
97 while((ana = dynamic_cast<AliEMCalTriggerTracksAnalysisComponent *>(compIter())))
101 //______________________________________________________________________________
102 void AliEMCalTriggerTaskGroup::AddAnalysisComponent(AliEMCalTriggerTracksAnalysisComponent * const analysis) {
104 * Add new analysis component to the task group
106 * @param analysis: the analysis component to be added
108 fAnalysisComponents->Add(analysis);
111 } /* namespace EMCalTriggerPtAnalysis */