AliPhysics  7f2a7c4 (7f2a7c4)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
31 
35 
36 namespace EMCalTriggerPtAnalysis {
37 
41 AliAnalysisTaskPtEMCalTriggerV1::AliAnalysisTaskPtEMCalTriggerV1() :
43  fTaskGroups(NULL),
44  fBinning(NULL),
45  fTriggerDecisionConfig(NULL),
46  fTriggerClassManager(NULL),
47  fMCJetContainer(),
48  fDataJetContainer(),
49  fSwapTriggerThresholds(kFALSE),
50  fDoTriggerDebug(kFALSE)
51 {
52 }
53 
59  AliAnalysisTaskEmcalJet(name, kTRUE),
60  fTaskGroups(NULL),
61  fBinning(NULL),
62  fTriggerDecisionConfig(NULL),
63  fTriggerClassManager(NULL),
64  fMCJetContainer(),
65  fDataJetContainer(),
66  fSwapTriggerThresholds(kFALSE),
67  fDoTriggerDebug(kFALSE)
68 {
70  fTaskGroups = new TObjArray;
71  fTaskGroups->SetOwner();
74  SetCaloTriggerPatchInfoName("EmcalTriggers"); // Default settings here, to be able to override it in the wagon configuration
75 }
76 
81  delete fTriggerClassManager;
82  delete fTaskGroups;
83  delete fBinning;
84 }
85 
92 
94  binmaker.Create(fBinning);
95 
96  TIter groupIter(fTaskGroups);
97  AliEMCalTriggerTaskGroup *mygroup(NULL);
98  TList *outputList = new TList;
99  outputList->SetName(Form("histos%s", GetName()));
100  while((mygroup = dynamic_cast<AliEMCalTriggerTaskGroup *>(groupIter()))){
101  mygroup->SetGlobalBinning(fBinning);
103  // Collect output list and append it to the global output list
104  TIter listIter(ltmp);
105  TObject *hist(NULL);
106  while((hist = listIter())) outputList->Add(hist);
107  }
108  fOutput->Add(outputList);
109  PostData(1, fOutput);
110 
111 }
112 
121  AliEMCalTriggerAnaTriggerDecision triggerDecision;
122  if(fDoTriggerDebug) triggerDecision.SetDebugMode();
124  triggerDecision.Create(event);
125  fTriggerClassManager->SetTriggerDecision(&triggerDecision);
127  TIter groupIter(fTaskGroups);
128  AliEMCalTriggerTaskGroup *mygroup(NULL);
129  while((mygroup = dynamic_cast<AliEMCalTriggerTaskGroup *>(groupIter()))){
130  mygroup->Process(event);
131  }
132 
133  delete event;
134 
135  PostData(1, fOutput);
136  return kTRUE;
137 }
138 
146 void AliAnalysisTaskPtEMCalTriggerV1::SetBinning(const char* dimname, int nbins, double* binning) {
147  fBinning->SetBinning(dimname, nbins, binning);
148 }
149 
155 void AliAnalysisTaskPtEMCalTriggerV1::SetBinning(const char* dimname, const TArrayD &binning) {
156  fBinning->SetBinning(dimname, binning);
157 }
158 
168  eventstruct->SetRecEvent(fInputEvent);
169  // Check whether all tracks have the back pointer to the event itself set
170  for(int itrk = 0; itrk < fInputEvent->GetNumberOfTracks(); itrk++){
171  FixTrackInputEvent(static_cast<AliVTrack *>(fInputEvent->GetTrack(itrk)));
172  }
173  eventstruct->SetTriggerBitSelection(fInputHandler->IsEventSelected());
174  eventstruct->SetMCEvent(fMCEvent);
176  eventstruct->SetClusterContainer(fCaloClusters);
177  eventstruct->SetTrackContainer(fTracks);
178  for(TIter trackIter = TIter(fTracks).Begin(); trackIter != TIter::End(); ++trackIter)
179  FixTrackInputEvent(static_cast<AliVTrack *>(*trackIter));
180  if(fMCJetContainer.Length()){
181  AliJetContainer *jcmc = dynamic_cast<AliJetContainer *>(fJetCollArray.FindObject(fMCJetContainer.Data()));
182  eventstruct->SetParticleContainer(jcmc->GetParticleContainer()->GetArray());
183  eventstruct->SetMCJetContainer(jcmc);
184  }
185  if(fDataJetContainer.Length()){
186  AliJetContainer *jcdat = dynamic_cast<AliJetContainer *>(fJetCollArray.FindObject(fDataJetContainer.Data()));
187  eventstruct->SetDataJetContainer(jcdat);
188  }
189  return eventstruct;
190 }
191 
197  fTaskGroups->Add(taskGroup);
198 }
199 
206  if(!trk->GetEvent()){
207  if(trk->IsA() == AliESDtrack::Class())
208  (static_cast<AliESDtrack *>(trk))->SetESDEvent(static_cast<AliESDEvent *>(fInputEvent));
209  else if(trk->IsA() == AliAODTrack::Class())
210  (static_cast<AliAODTrack *>(trk))->SetAODEvent(static_cast<AliAODEvent *>(fInputEvent));
211  else if(trk->IsA() == AliPicoTrack::Class()){
212  AliPicoTrack *mytrk = static_cast<AliPicoTrack *>(trk);
213  if(!mytrk->GetEvent()){
214  if(mytrk->GetTrack()->IsA() == AliESDtrack::Class())
215  (static_cast<AliESDtrack *>(mytrk->GetTrack()))->SetESDEvent(static_cast<AliESDEvent *>(fInputEvent));
216  else
217  (static_cast<AliAODTrack *>(mytrk->GetTrack()))->SetAODEvent(static_cast<AliAODEvent *>(fInputEvent));
218  }
219  }
220  }
221 }
222 
223 } /* namespace EMCalTriggerPtAnalysis */
AliEMCalTriggerAnaTriggerDecisionConfig * fTriggerDecisionConfig
Configuration for the trigger decision handling.
void SetClusterContainer(const TClonesArray *const cont)
Class performing the selection of triggered events.
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 SetGlobalBinning(const AliEMCalTriggerBinningComponent *const binning)
void SetCaloTriggerPatchInfoName(const char *n)
void Process(const AliEMCalTriggerEventData *const event)
void ConfigureTriggerDecision(const AliEMCalTriggerAnaTriggerDecisionConfig &conf)
Re-structured analysis task of high- tracks in triggered events.
AliParticleContainer * GetParticleContainer() const
TClonesArray * fCaloClusters
!clusters
Container class for analysis components with common event selection.
Global binning handler used by several analysis components.
AliEMCalTriggerAnaClassManager * fTriggerClassManager
Manager for trigger classes.
Declaration of the re-structured analysis task of high- tracks in triggered events. Task only behaves as steering task for analysis components.
void SetBinning(const char *dimname, int nbins, const double *binning)
AliEMCalTriggerBinningComponent * fBinning
Global binning component.
Global binning definition for the high- charged particle analysis.
TObjArray fJetCollArray
jet collection array
AliVTrack * GetTrack() const
Definition: AliPicoTrack.h:59
AliEmcalList * fOutput
!output list
TClonesArray * fTracks
!tracks
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
void SetMakeGeneralHistograms(Bool_t g)
TClonesArray * fTriggerPatchInfo
!trigger patch info array
TString fMCJetContainer
Name of the Monte-Carlo jet container.
Base task in the EMCAL jet framework.
Simple event container within the high- track analysis.
const Int_t nbins
bool Bool_t
Definition: External.C:53
void SetParticleContainer(const TClonesArray *const cont)
Event Data used in exchange to the different analysis components.
Container for jet within the EMCAL jet framework.
Container class for Analysis components with a common event selection.