Fixing a memory leak. The cluster array *must* be deleted and not only cleared, other...
[u/mrichter/AliRoot.git] / PWG4 / JetTasks / AliAnalysisTaskLeadingTrackUE.h
CommitLineData
a75aacd6 1#ifndef ALIANALYSISTASKLEADINGTRACKUE_H
2#define ALIANALYSISTASKLEADINGTRACKUE_H
3
4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6
7////////////////////////////////////////////////////////////////////////
8//
9// Analysis class for Underlying Event studies w.r.t. leading track
10//
11// Look for correlations on the tranverse regions w.r.t
12// the leading track in the event
13//
14// This class needs input AODs.
15// The output is a list of analysis-specific containers.
16//
17// The AOD can be either connected to the InputEventHandler
18// for a chain of AOD files
19// or
20// to the OutputEventHandler
21// for a chain of ESD files,
22// in this case the class should be in the train after the jet-finder
23//
24// Authors:
25// Arian Abrahantes Quintana
26// Jan Fiete Grosse-Oetringhaus
27// Ernesto Lopez Torres
28// Sara Vallero
29//
30////////////////////////////////////////////////////////////////////////
31
32#include "AliAnalysisTask.h"
33#include "AliUEHist.h"
34
35class AliAODEvent;
36class AliAnalyseLeadingTrackUE;
37class AliInputEventHandler;
38class AliMCEvent;
39class AliMCEventHandler;
40class AliUEHistograms;
41class AliVParticle;
42class TH1D;
43class TObjArray;
44
45class AliAnalysisTaskLeadingTrackUE : public AliAnalysisTask
46 {
47 public:
48 AliAnalysisTaskLeadingTrackUE(const char* name="AliAnalysisTaskLeadingTrackUE");
49 virtual ~AliAnalysisTaskLeadingTrackUE() {if ( fListOfHistos ) delete fListOfHistos; }
50
51
52 // Implementation of interace methods
53 virtual Bool_t Notify();
54 virtual void ConnectInputData(Option_t *);
55 virtual void CreateOutputObjects();
56 virtual void Exec(Option_t *option);
57 virtual void Terminate(Option_t *);
58
59 void FillReducedEfficiency(Int_t eventId, AliUEHist::CFStep step, TObjArray* ltRECO, Bool_t twoStep);
60
61 // Setters/Getters
62 // general configuration
63 virtual void SetDebugLevel( Int_t level ) { fDebug = level; }
64 virtual void SetMode(Int_t mode) { fMode = mode; }
65
66 // histogram settings
67 void SetPtRangeInHist( Int_t bin, Double_t min, Double_t max ) {
68 fBinsPtInHist = bin;
69 fMinJetPtInHist = min;
70 fMaxJetPtInHist = max;
71 }
72 void SetTrackingEfficiency(TH1D* hist) { fTrackingEfficiency = hist; }
73
74 // for event QA
75 void SetTracksInVertex( Int_t val ){ fnTracksVertex = val; }
76 void SetZVertex( Double_t val ) { fZVertex = val; }
77
78 // track cuts
79 void SetTrackEtaCut(Double_t val) { fTrackEtaCut = val; }
80 void SetLeadingTrackEtaCut( Double_t val ) { fLeadingTrackEtaCut = val; }
81 void SetFilterBit( UInt_t val ) { fFilterBit = val; }
82 void SetUseChargeHadrons( Bool_t val ) { fUseChargeHadrons = val; }
83
84 protected:
85 static AliAnalysisTaskLeadingTrackUE* fgTaskLeadingTrackUE; // Pointer to single instance
86
87 private:
88 AliAnalysisTaskLeadingTrackUE(const AliAnalysisTaskLeadingTrackUE &det);
89 AliAnalysisTaskLeadingTrackUE& operator=(const AliAnalysisTaskLeadingTrackUE &det);
90 void AddSettingsTree(); // add list of settings to output list
91 // Analysis methods
92 void AnalyseCorrectionMode(); // main algorithm to get correction maps
93 void AnalyseDataMode(); // main algorithm to get raw distributions
94 void Initialize(); // initialize some common pointer
95
96
97
98 // General configuration
99 Int_t fDebug; // Debug flag
100 Int_t fMode; // fMode = 0: data-like analysis
101 // fMode = 1: corrections analysis
102
103 // Pointers to external UE classes
104 AliAnalyseLeadingTrackUE* fAnalyseUE; //! points to class containing common analysis algorithms
105 AliUEHistograms* fHistosUE; //! points to class to handle histograms/containers
106
107 TH1D* fTrackingEfficiency; // used for study of bias by tracking
108
109 // Handlers and events
110 AliAODEvent* fAOD; //! AOD Event
111 TClonesArray* fArrayMC; //! Array of MC particles
112 AliInputEventHandler* fInputHandler; //! Generic InputEventHandler
113 AliMCEvent* fMcEvent; //! MC event
114 AliMCEventHandler* fMcHandler; //! MCEventHandler
115
116 // Histogram settings
117 TList* fListOfHistos; // Output list of containers
118 Int_t fBinsPtInHist; // # bins for pT histos
119 Double_t fMinJetPtInHist; // min Jet Pt value for histo range
120 Double_t fMaxJetPtInHist; // max Jet Pt value for histo range
121
122
123 // Event QA cuts
124 Int_t fnTracksVertex; // QA tracks pointing to principal vertex (= 3 default)
125 Double_t fZVertex; // Position of Vertex in Z direction
126
127 // Track cuts
128 Double_t fTrackEtaCut; // Eta cut on inclusive tracks
129 Double_t fLeadingTrackEtaCut; // Eta cut on leading track
130 UInt_t fFilterBit; // Select tracks from an specific track cut (default 0xFF all track selected)
131 Bool_t fUseChargeHadrons; // Only use charge hadrons
132
133 // MC cross-section
134 Double_t fAvgTrials; // average trials used to fill the fh1Trials histogram in case we do not have trials on a event by event basis
135
136 ClassDef( AliAnalysisTaskLeadingTrackUE, 1); // Analysis task for Underlying Event analysis w.r.t. leading track
137 };
138
139#endif
140
141