]>
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 | * Re-structured analysis task of the pt analysis on EMCal-triggered events: | |
17 | * Analysis steps are moved to analysis components, which are grouped by a common | |
18 | * event selection. The analysis task steers the event builder, runs each group, | |
19 | * and collects the output of all groups. | |
20 | * | |
21 | * Author: Markus Fasel | |
22 | */ | |
23 | #include "AliJetContainer.h" | |
24 | #include "AliParticleContainer.h" | |
25 | #include "AliEMCalTriggerEventData.h" | |
26 | #include "AliEMCalTriggerTaskGroup.h" | |
27 | #include "AliAnalysisTaskPtEMCalTriggerV1.h" | |
28 | #include "AliVEvent.h" | |
29 | ||
30 | ClassImp(EMCalTriggerPtAnalysis::AliAnalysisTaskPtEMCalTriggerV1) | |
31 | ||
32 | namespace EMCalTriggerPtAnalysis { | |
33 | ||
34 | //______________________________________________________________________________ | |
35 | AliAnalysisTaskPtEMCalTriggerV1::AliAnalysisTaskPtEMCalTriggerV1() : | |
36 | AliAnalysisTaskEmcalJet(), | |
37 | fTaskGroups(NULL), | |
38 | fMCJetContainer(), | |
39 | fDataJetContainer() | |
40 | { | |
41 | /* | |
42 | * Dummy constructor | |
43 | */ | |
44 | } | |
45 | ||
46 | //______________________________________________________________________________ | |
47 | AliAnalysisTaskPtEMCalTriggerV1::AliAnalysisTaskPtEMCalTriggerV1(const char* name) : | |
48 | AliAnalysisTaskEmcalJet(name, kTRUE), | |
49 | fTaskGroups(NULL), | |
50 | fMCJetContainer(), | |
51 | fDataJetContainer() | |
52 | { | |
53 | /* | |
54 | * Main Constructor | |
55 | */ | |
56 | fTaskGroups = new TObjArray; | |
57 | fTaskGroups->SetOwner(); | |
58 | SetMakeGeneralHistograms(kTRUE); | |
59 | } | |
60 | ||
61 | //______________________________________________________________________________ | |
62 | AliAnalysisTaskPtEMCalTriggerV1::~AliAnalysisTaskPtEMCalTriggerV1() { | |
63 | /* | |
64 | * Destructor | |
65 | */ | |
66 | } | |
67 | ||
68 | //______________________________________________________________________________ | |
69 | void AliAnalysisTaskPtEMCalTriggerV1::UserCreateOutputObjects() { | |
70 | /* | |
71 | * Initialise all analysis components | |
72 | */ | |
73 | AliAnalysisTaskEmcal::UserCreateOutputObjects(); | |
74 | ||
75 | TIter groupIter(fTaskGroups); | |
76 | AliEMCalTriggerTaskGroup *mygroup(NULL); | |
77 | TList *outputList = new TList; | |
78 | outputList->SetName(Form("histos%s", GetName())); | |
79 | while((mygroup = dynamic_cast<AliEMCalTriggerTaskGroup *>(groupIter()))){ | |
80 | TList *ltmp = mygroup->InitialiseAnalysisComponents(); | |
81 | // Collect output list and append it to the global output list | |
82 | TIter listIter(ltmp); | |
83 | TObject *hist(NULL); | |
84 | while((hist = listIter())) outputList->Add(hist); | |
85 | } | |
86 | fOutput->Add(outputList); | |
87 | PostData(1, fOutput); | |
88 | ||
89 | } | |
90 | ||
91 | //______________________________________________________________________________ | |
92 | Bool_t AliAnalysisTaskPtEMCalTriggerV1::Run() { | |
93 | /* | |
94 | * Run the analysis: | |
95 | * 1st build the event data shared among the tasks | |
96 | * 2nd loop over task groups and run them | |
97 | */ | |
98 | AliEMCalTriggerEventData *event = BuildEvent(); | |
99 | TIter groupIter(fTaskGroups); | |
100 | AliEMCalTriggerTaskGroup *mygroup(NULL); | |
101 | while((mygroup = dynamic_cast<AliEMCalTriggerTaskGroup *>(groupIter()))) | |
102 | mygroup->Process(event); | |
103 | ||
104 | delete event; | |
105 | ||
106 | PostData(1, fOutput); | |
107 | return kTRUE; | |
108 | } | |
109 | ||
110 | //______________________________________________________________________________ | |
111 | AliEMCalTriggerEventData* AliAnalysisTaskPtEMCalTriggerV1::BuildEvent() const { | |
112 | /* | |
113 | * Build event structure. Take the information about the different containers | |
114 | * from the base analysis task. | |
115 | * | |
116 | * @return: the resulting event structure | |
117 | */ | |
118 | AliEMCalTriggerEventData *eventstruct = new AliEMCalTriggerEventData; | |
119 | eventstruct->SetRecEvent(fInputEvent); | |
120 | eventstruct->SetMCEvent(fMCEvent); | |
121 | eventstruct->SetTriggerPatchContainer(fTriggerPatchInfo); | |
122 | eventstruct->SetClusterContainer(fCaloClusters); | |
123 | eventstruct->SetTrackContainer(fTracks); | |
124 | if(fMCJetContainer.Length()){ | |
125 | AliJetContainer *jcmc = dynamic_cast<AliJetContainer *>(fJetCollArray.FindObject(fMCJetContainer.Data())); | |
126 | eventstruct->SetParticleContainer(jcmc->GetParticleContainer()->GetArray()); | |
127 | eventstruct->SetMCJetContainer(jcmc); | |
128 | } | |
129 | if(fDataJetContainer.Length()){ | |
130 | AliJetContainer *jcdat = dynamic_cast<AliJetContainer *>(fJetCollArray.FindObject(fDataJetContainer.Data())); | |
131 | eventstruct->SetDataJetContainer(jcdat); | |
132 | } | |
133 | return eventstruct; | |
134 | } | |
135 | ||
136 | //______________________________________________________________________________ | |
137 | void AliAnalysisTaskPtEMCalTriggerV1::AddAnalysisGroup(AliEMCalTriggerTaskGroup *taskGroup) { | |
138 | /* | |
139 | * Add group of analysis components to the task | |
140 | * | |
141 | * @param taskGroup: Group of analysis components | |
142 | */ | |
143 | fTaskGroups->Add(taskGroup); | |
144 | } | |
145 | ||
146 | } /* namespace EMCalTriggerPtAnalysis */ |