AliPhysics  c2a2810 (c2a2810)
 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 "AliAODEvent.h"
20 #include "AliAODTrack.h"
21 #include "AliESDEvent.h"
22 #include "AliESDtrack.h"
23 #include "AliPicoTrack.h"
24 
30 #include "AliEMCalHistoContainer.h"
32 
36 
37 namespace EMCalTriggerPtAnalysis {
38 
42 AliAnalysisTaskPtEMCalTriggerV1::AliAnalysisTaskPtEMCalTriggerV1() :
43  AliAnalysisTaskEmcalJet(),
44  fTaskGroups(NULL),
45  fBinning(NULL),
46  fTriggerDecisionConfig(NULL),
47  fTriggerClassManager(NULL),
48  fMCJetContainer(),
49  fDataJetContainer(),
50  fSwapTriggerThresholds(kFALSE),
51  fDoTriggerDebug(kFALSE)
52 {
53 }
54 
60  AliAnalysisTaskEmcalJet(name, kTRUE),
61  fTaskGroups(NULL),
62  fBinning(NULL),
63  fTriggerDecisionConfig(NULL),
64  fTriggerClassManager(NULL),
65  fMCJetContainer(),
66  fDataJetContainer(),
67  fSwapTriggerThresholds(kFALSE),
68  fDoTriggerDebug(kFALSE)
69 {
71  fTaskGroups = new TObjArray;
72  fTaskGroups->SetOwner();
74  SetMakeGeneralHistograms(kTRUE);
75  SetCaloTriggerPatchInfoName("EmcalTriggers"); // Default settings here, to be able to override it in the wagon configuration
76 }
77 
82  delete fTriggerClassManager;
83  delete fTaskGroups;
84  delete fBinning;
85 }
86 
93 
95  binmaker.Create(fBinning);
96 
97  TIter groupIter(fTaskGroups);
98  AliEMCalTriggerTaskGroup *mygroup(NULL);
99  TList *outputList = new TList;
100  outputList->SetName(Form("histos%s", GetName()));
101  while((mygroup = dynamic_cast<AliEMCalTriggerTaskGroup *>(groupIter()))){
102  mygroup->SetGlobalBinning(fBinning);
103  TList *ltmp = mygroup->InitialiseAnalysisComponents(fTriggerClassManager);
104  // Collect output list and append it to the global output list
105  TIter listIter(ltmp);
106  TObject *hist(NULL);
107  while((hist = listIter())) outputList->Add(hist);
108  }
109  fOutput->Add(outputList);
110  PostData(1, fOutput);
111 
112 }
113 
122  AliEMCalTriggerAnaTriggerDecision triggerDecision;
123  if(fDoTriggerDebug) triggerDecision.SetDebugMode();
125  triggerDecision.Create(event);
126  fTriggerClassManager->SetTriggerDecision(&triggerDecision);
128  TIter groupIter(fTaskGroups);
129  AliEMCalTriggerTaskGroup *mygroup(NULL);
130  while((mygroup = dynamic_cast<AliEMCalTriggerTaskGroup *>(groupIter()))){
131  mygroup->Process(event);
132  }
133 
134  delete event;
135 
136  PostData(1, fOutput);
137  return kTRUE;
138 }
139 
147 void AliAnalysisTaskPtEMCalTriggerV1::SetBinning(const char* dimname, int nbins, double* binning) {
148  fBinning->SetBinning(dimname, nbins, binning);
149 }
150 
156 void AliAnalysisTaskPtEMCalTriggerV1::SetBinning(const char* dimname, const TArrayD &binning) {
157  fBinning->SetBinning(dimname, binning);
158 }
159 
169  eventstruct->SetRecEvent(fInputEvent);
170  // Check whether all tracks have the back pointer to the event itself set
171  for(int itrk = 0; itrk < fInputEvent->GetNumberOfTracks(); itrk++){
172  FixTrackInputEvent(static_cast<AliVTrack *>(fInputEvent->GetTrack(itrk)));
173  }
174  eventstruct->SetTriggerBitSelection(fInputHandler->IsEventSelected());
175  eventstruct->SetMCEvent(fMCEvent);
176  eventstruct->SetTriggerPatchContainer(fTriggerPatchInfo);
177  eventstruct->SetClusterContainer(fCaloClusters);
178  eventstruct->SetTrackContainer(fTracks);
179  for(TIter trackIter = TIter(fTracks).Begin(); trackIter != TIter::End(); ++trackIter)
180  FixTrackInputEvent(static_cast<AliVTrack *>(*trackIter));
181  if(fMCJetContainer.Length()){
182  AliJetContainer *jcmc = dynamic_cast<AliJetContainer *>(fJetCollArray.FindObject(fMCJetContainer.Data()));
183  eventstruct->SetParticleContainer(jcmc->GetParticleContainer()->GetArray());
184  eventstruct->SetMCJetContainer(jcmc);
185  }
186  if(fDataJetContainer.Length()){
187  AliJetContainer *jcdat = dynamic_cast<AliJetContainer *>(fJetCollArray.FindObject(fDataJetContainer.Data()));
188  eventstruct->SetDataJetContainer(jcdat);
189  }
190  return eventstruct;
191 }
192 
198  fTaskGroups->Add(taskGroup);
199 }
200 
207  if(!trk->GetEvent()){
208  if(trk->IsA() == AliESDtrack::Class())
209  (static_cast<AliESDtrack *>(trk))->SetESDEvent(static_cast<AliESDEvent *>(fInputEvent));
210  else if(trk->IsA() == AliAODTrack::Class())
211  (static_cast<AliAODTrack *>(trk))->SetAODEvent(static_cast<AliAODEvent *>(fInputEvent));
212  else if(trk->IsA() == AliPicoTrack::Class()){
213  AliPicoTrack *mytrk = static_cast<AliPicoTrack *>(trk);
214  if(!mytrk->GetEvent()){
215  if(mytrk->GetTrack()->IsA() == AliESDtrack::Class())
216  (static_cast<AliESDtrack *>(mytrk->GetTrack()))->SetESDEvent(static_cast<AliESDEvent *>(fInputEvent));
217  else
218  (static_cast<AliAODTrack *>(mytrk->GetTrack()))->SetAODEvent(static_cast<AliAODEvent *>(fInputEvent));
219  }
220  }
221  }
222 }
223 
224 } /* 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 SetTriggerDecision(AliEMCalTriggerAnaTriggerDecision *triggerdecision)
void SetTriggerPatchContainer(const TClonesArray *const cont)
void SetBinning(const char *dimname, int nbins, double *binning)
TList * InitialiseAnalysisComponents(const AliEMCalTriggerAnaClassManager *mgr=NULL)
void SetTrackContainer(const TClonesArray *const cont)
void Create(AliEMCalTriggerBinningComponent *const data)
Declaration of class AliEMCalTriggerBinningFactory.
void SetGlobalBinning(const AliEMCalTriggerBinningComponent *const binning)
void Process(const AliEMCalTriggerEventData *const event)
void ConfigureTriggerDecision(const AliEMCalTriggerAnaTriggerDecisionConfig &conf)
void SetBinning(const char *dimname, int nbins, double *binning)
Re-structured analysis task of high- tracks in triggered events.
Container class for analysis components with common event selection.
Global binning handler used by several analysis components.
AliEMCalTriggerAnaClassManager * fTriggerClassManager
Manager for trigger classes.
Declarartion of class AliEMCalHistoContainer.
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.
Global binning definition for the high- charged particle analysis.
AliVTrack * GetTrack() const
Definition: AliPicoTrack.h:59
Declaration of the classes AliEMCalTriggerBinningComponent and AliEMCalTriggerBinningDimension.
TString fMCJetContainer
Name of the Monte-Carlo jet container.
Simple event container within the high- track analysis.
void SetParticleContainer(const TClonesArray *const cont)
Event Data used in exchange to the different analysis components.
Container class for Analysis components with a common event selection.