AliPhysics  v5-06-11-01 (156c7f3)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
AliAnalysisTaskPtEMCalTriggerV1.cxx
Go to the documentation of this file.
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 #include "AliInputEventHandler.h"
16 #include "AliParticleContainer.h"
17 #include "AliJetContainer.h"
18 
19 #include "AliESDEvent.h"
20 
26 #include "AliEMCalHistoContainer.h"
28 
32 
33 namespace EMCalTriggerPtAnalysis {
34 
38 AliAnalysisTaskPtEMCalTriggerV1::AliAnalysisTaskPtEMCalTriggerV1() :
39  AliAnalysisTaskEmcalJet(),
40  fTaskGroups(NULL),
41  fBinning(NULL),
42  fTriggerDecisionConfig(NULL),
43  fMCJetContainer(),
44  fDataJetContainer(),
45  fSwapTriggerThresholds(kFALSE),
46  fDoTriggerDebug(kFALSE)
47 {
48 }
49 
55  AliAnalysisTaskEmcalJet(name, kTRUE),
56  fTaskGroups(NULL),
57  fBinning(NULL),
58  fTriggerDecisionConfig(NULL),
59  fMCJetContainer(),
60  fDataJetContainer(),
61  fSwapTriggerThresholds(kFALSE),
62  fDoTriggerDebug(kFALSE)
63 {
64  fTaskGroups = new TObjArray;
65  fTaskGroups->SetOwner();
67  SetMakeGeneralHistograms(kTRUE);
68  SetCaloTriggerPatchInfoName("EmcalTriggers"); // Default settings here, to be able to override it in the wagon configuration
69 }
70 
75  delete fTaskGroups;
76  delete fBinning;
77 }
78 
84  AliAnalysisTaskEmcal::UserCreateOutputObjects();
85 
87  binmaker.Create(fBinning);
88 
89  TIter groupIter(fTaskGroups);
90  AliEMCalTriggerTaskGroup *mygroup(NULL);
91  TList *outputList = new TList;
92  outputList->SetName(Form("histos%s", GetName()));
93  while((mygroup = dynamic_cast<AliEMCalTriggerTaskGroup *>(groupIter()))){
94  mygroup->SetGlobalBinning(fBinning);
95  TList *ltmp = mygroup->InitialiseAnalysisComponents();
96  // Collect output list and append it to the global output list
97  TIter listIter(ltmp);
98  TObject *hist(NULL);
99  while((hist = listIter())) outputList->Add(hist);
100  }
101  fOutput->Add(outputList);
102  PostData(1, fOutput);
103 
104 }
105 
114  AliEMCalTriggerAnaTriggerDecision triggerDecision;
115  if(fDoTriggerDebug) triggerDecision.SetDebugMode();
117  triggerDecision.Create(event);
118  triggerDecision.SetIsMinBias(fInputHandler->IsEventSelected() & AliVEvent::kINT7);
119  TIter groupIter(fTaskGroups);
120  AliEMCalTriggerTaskGroup *mygroup(NULL);
121  while((mygroup = dynamic_cast<AliEMCalTriggerTaskGroup *>(groupIter()))){
122  mygroup->SetTriggerDecision(&triggerDecision);
123  mygroup->Process(event);
124  }
125 
126  delete event;
127 
128  PostData(1, fOutput);
129  return kTRUE;
130 }
131 
139 void AliAnalysisTaskPtEMCalTriggerV1::SetBinning(const char* dimname, int nbins, double* binning) {
140  fBinning->SetBinning(dimname, nbins, binning);
141 }
142 
148 void AliAnalysisTaskPtEMCalTriggerV1::SetBinning(const char* dimname, const TArrayD &binning) {
149  fBinning->SetBinning(dimname, binning);
150 }
151 
160  eventstruct->SetRecEvent(fInputEvent);
161  eventstruct->SetMCEvent(fMCEvent);
162  eventstruct->SetTriggerPatchContainer(fTriggerPatchInfo);
163  eventstruct->SetClusterContainer(fCaloClusters);
164  eventstruct->SetTrackContainer(fTracks);
165  if(fMCJetContainer.Length()){
166  AliJetContainer *jcmc = dynamic_cast<AliJetContainer *>(fJetCollArray.FindObject(fMCJetContainer.Data()));
167  eventstruct->SetParticleContainer(jcmc->GetParticleContainer()->GetArray());
168  eventstruct->SetMCJetContainer(jcmc);
169  }
170  if(fDataJetContainer.Length()){
171  AliJetContainer *jcdat = dynamic_cast<AliJetContainer *>(fJetCollArray.FindObject(fDataJetContainer.Data()));
172  eventstruct->SetDataJetContainer(jcdat);
173  }
174  return eventstruct;
175 }
176 
182  fTaskGroups->Add(taskGroup);
183 }
184 
185 } /* namespace EMCalTriggerPtAnalysis */
AliEMCalTriggerAnaTriggerDecisionConfig * fTriggerDecisionConfig
Configuration for the trigger decision handling.
void SetClusterContainer(const TClonesArray *const cont)
Class performing the selection of triggered events.
ClassImp(AliAnalysisTaskTriggerRates) AliAnalysisTaskTriggerRates
Declaration of class AliEMCalTriggerAnaTriggerDecision, a container for trigger decision in EMCAL-tri...
void SetBinning(const char *dimname, int nbins, double *binning)
void SetTriggerPatchContainer(const TClonesArray *const cont)
void SetBinning(const char *dimname, int nbins, double *binning)
void SetTrackContainer(const TClonesArray *const cont)
void Create(AliEMCalTriggerBinningComponent *const data)
void SetGlobalBinning(const AliEMCalTriggerBinningComponent *const binning)
void Process(const AliEMCalTriggerEventData *const event)
void ConfigureTriggerDecision(const AliEMCalTriggerAnaTriggerDecisionConfig &conf)
Re-structured analysis task of high- tracks in triggered events.
Container class for analysis components with common event selection.
void SetTriggerDecision(const AliEMCalTriggerAnaTriggerDecision *trigger)
Declaration of the re-structured analysis task of high- tracks in triggered events. Task only behaves as steering task for analysis components.
AliEMCalTriggerBinningComponent * fBinning
Global binning component.
TString fMCJetContainer
Name of the Monte-Carlo jet container.
void SetParticleContainer(const TClonesArray *const cont)
Container class for Analysis components with a common event selection.