AliPhysics  vAN-20150507 (0645659)
 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  fMCJetContainer(),
48  fDataJetContainer(),
49  fMinBiasSelection(AliVEvent::kINT7),
50  fSwapTriggerThresholds(kFALSE),
51  fDoTriggerDebug(kFALSE)
52 {
53 }
54 
60  AliAnalysisTaskEmcalJet(name, kTRUE),
61  fTaskGroups(NULL),
62  fBinning(NULL),
63  fTriggerDecisionConfig(NULL),
64  fMCJetContainer(),
65  fDataJetContainer(),
66  fMinBiasSelection(AliVEvent::kINT7),
67  fSwapTriggerThresholds(kFALSE),
68  fDoTriggerDebug(kFALSE)
69 {
70  fTaskGroups = new TObjArray;
71  fTaskGroups->SetOwner();
73  SetMakeGeneralHistograms(kTRUE);
74  SetCaloTriggerPatchInfoName("EmcalTriggers"); // Default settings here, to be able to override it in the wagon configuration
75 }
76 
81  delete fTaskGroups;
82  delete fBinning;
83 }
84 
90  AliAnalysisTaskEmcal::UserCreateOutputObjects();
91 
93  binmaker.Create(fBinning);
94 
95  TIter groupIter(fTaskGroups);
96  AliEMCalTriggerTaskGroup *mygroup(NULL);
97  TList *outputList = new TList;
98  outputList->SetName(Form("histos%s", GetName()));
99  while((mygroup = dynamic_cast<AliEMCalTriggerTaskGroup *>(groupIter()))){
100  mygroup->SetGlobalBinning(fBinning);
101  TList *ltmp = mygroup->InitialiseAnalysisComponents();
102  // Collect output list and append it to the global output list
103  TIter listIter(ltmp);
104  TObject *hist(NULL);
105  while((hist = listIter())) outputList->Add(hist);
106  }
107  fOutput->Add(outputList);
108  PostData(1, fOutput);
109 
110 }
111 
120  AliEMCalTriggerAnaTriggerDecision triggerDecision;
121  if(fDoTriggerDebug) triggerDecision.SetDebugMode();
123  triggerDecision.Create(event);
124  triggerDecision.SetIsMinBias(fInputHandler->IsEventSelected() & fMinBiasSelection);
125  TIter groupIter(fTaskGroups);
126  AliEMCalTriggerTaskGroup *mygroup(NULL);
127  while((mygroup = dynamic_cast<AliEMCalTriggerTaskGroup *>(groupIter()))){
128  mygroup->SetTriggerDecision(&triggerDecision);
129  mygroup->Process(event);
130  }
131 
132  delete event;
133 
134  PostData(1, fOutput);
135  return kTRUE;
136 }
137 
145 void AliAnalysisTaskPtEMCalTriggerV1::SetBinning(const char* dimname, int nbins, double* binning) {
146  fBinning->SetBinning(dimname, nbins, binning);
147 }
148 
154 void AliAnalysisTaskPtEMCalTriggerV1::SetBinning(const char* dimname, const TArrayD &binning) {
155  fBinning->SetBinning(dimname, binning);
156 }
157 
167  eventstruct->SetRecEvent(fInputEvent);
168  // Check whether all tracks have the back pointer to the event itself set
169  for(int itrk = 0; itrk < fInputEvent->GetNumberOfTracks(); itrk++){
170  FixTrackInputEvent(static_cast<AliVTrack *>(fInputEvent->GetTrack(itrk)));
171  }
172  eventstruct->SetMCEvent(fMCEvent);
173  eventstruct->SetTriggerPatchContainer(fTriggerPatchInfo);
174  eventstruct->SetClusterContainer(fCaloClusters);
175  eventstruct->SetTrackContainer(fTracks);
176  for(TIter trackIter = TIter(fTracks).Begin(); trackIter != TIter::End(); ++trackIter)
177  FixTrackInputEvent(static_cast<AliVTrack *>(*trackIter));
178  if(fMCJetContainer.Length()){
179  AliJetContainer *jcmc = dynamic_cast<AliJetContainer *>(fJetCollArray.FindObject(fMCJetContainer.Data()));
180  eventstruct->SetParticleContainer(jcmc->GetParticleContainer()->GetArray());
181  eventstruct->SetMCJetContainer(jcmc);
182  }
183  if(fDataJetContainer.Length()){
184  AliJetContainer *jcdat = dynamic_cast<AliJetContainer *>(fJetCollArray.FindObject(fDataJetContainer.Data()));
185  eventstruct->SetDataJetContainer(jcdat);
186  }
187  return eventstruct;
188 }
189 
195  fTaskGroups->Add(taskGroup);
196 }
197 
204  if(!trk->GetEvent()){
205  if(trk->IsA() == AliESDtrack::Class())
206  (static_cast<AliESDtrack *>(trk))->SetESDEvent(static_cast<AliESDEvent *>(fInputEvent));
207  else if(trk->IsA() == AliAODTrack::Class())
208  (static_cast<AliAODTrack *>(trk))->SetAODEvent(static_cast<AliAODEvent *>(fInputEvent));
209  else if(trk->IsA() == AliPicoTrack::Class()){
210  AliPicoTrack *mytrk = static_cast<AliPicoTrack *>(trk);
211  if(!mytrk->GetEvent()){
212  if(mytrk->GetTrack()->IsA() == AliESDtrack::Class())
213  (static_cast<AliESDtrack *>(mytrk->GetTrack()))->SetESDEvent(static_cast<AliESDEvent *>(fInputEvent));
214  else
215  (static_cast<AliAODTrack *>(mytrk->GetTrack()))->SetAODEvent(static_cast<AliAODEvent *>(fInputEvent));
216  }
217  }
218  }
219 }
220 
221 } /* 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 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)
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.
Declarartion of class AliEMCalHistoContainer.
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.
Global binning definition for the high- charged particle analysis.
Declaration of the classes AliEMCalTriggerBinningComponent and AliEMCalTriggerBinningDimension.
TString fMCJetContainer
Name of the Monte-Carlo jet container.
Long_t fMinBiasSelection
Trigger bit selection for Min. Bias events.
void SetParticleContainer(const TClonesArray *const cont)
Container class for Analysis components with a common event selection.