PWGCF/Correlations converted to native cmake
[u/mrichter/AliRoot.git] / PWGCF / Correlations / JCORRAN / AliJFilter.h
CommitLineData
9dc4f671 1// $Id: AliJFilter.h,v 1.5 2012/04/19 15:19:52 jkral Exp $
2
3//______________________________________________________________________________
4// Analysis task for high pt particle correlations
5// author: R.Diaz, J. Rak, D.J. Kim
6// ALICE Group University of Jyvaskyla
7// Finland
8//
9// Fill the analysis containers for ESD or AOD
10// Note: Adapted for AliAnalysisTaskSE
11//////////////////////////////////////////////////////////////////////////////
12
13#ifndef ALIJFILTER_H
14#define ALIJFILTER_H
15
16#include "TNamed.h"
17#include "AliJRunHeader.h"
18#include "AliESDEvent.h"
19#include "AliAODEvent.h"
20#include "AliAnalysisTaskSE.h"
21#include <iostream>
22
23#include <AliJConst.h>
24#include <TVectorT.h>
25
26//==============================================================
27
28#ifndef AliJMaxDimBuffer
29#define AliJMaxDimBuffer
30const int kMaxDimBuffer = 300;//max length of a line read to a buffe
31#endif
32
33class AliJEventHeader;
34class AliJRunHeader;
35class AliJTrack;
36class AliAnalysisTaskSE;
37
38class TH1D;
39class TH2D;
40class TNtuple;
41class TList;
42class TTree;
43class TFormula;
44class TRefArray;
45class TArrayI;
46
47class AliMCEvent;
48class AliESDEvent;
49class AliESDtrack;
50class AliAODEvent;
51class AliAODTrack;
52class AliESDtrackCuts;
53class AliESDVZERO;
54class AliESDCentrality;
55class AliVCluster;
56class AliVCaloCells;
57class AliVEvent;
58
59class AliEMCALGeometry;
60class AliEMCALGeoUtils;
61class AliEMCALRecoUtils;
62class AliPHOSGeoUtils;
63
64class AliMCEvent;
65class AliAnalysisFilter;
66
67class AliESDTZERO;
68class AliESDZDC;
69class AliPIDResponse;
70class AliPIDResponse;
71class AliPIDCombined;
72class AliESDTZERO;
73class AliAnalysisUtils;
74
75using namespace std;
76
77class AliJFilter : public TNamed {
78
79 public:
80 AliJFilter();
81 AliJFilter(const char *name, AliAnalysisTaskSE *task);
82 AliJFilter(const AliJFilter& ap);
83 AliJFilter& operator = (const AliJFilter& ap);
84 virtual ~AliJFilter();
85
86 // methods to fill from AliAnalysisTaskSE
87 virtual void UserCreateOutputObjects();
88 virtual void Init();
89 virtual void LocalInit() { Init(); }
90 virtual void UserExec(Option_t *option);
91 virtual void Terminate(Option_t * opt = "");
92
93
94 void SetTrackFilter( AliAnalysisFilter * filter ){ fESDFilter = filter; }
95 bool GetEventSuccess() const { return fEventSuccess; }
96 //are ESDs from real exp or MonteCarlo
97 // AliEMCALGeoUtils* GetEMCALGeoUtils (bool doDelete=kFALSE);
98 void SetClusterThreshold(double t) { fClusterThreshold = t; }
99 void SetTrackThreshold(double t) { fTrackThreshold = t; }
100 void SetMyTask( AliAnalysisTaskSE *t ) { fMyTask = t; }
101 TClonesArray *GetTrackList() const { return fTrackList; }
102 TClonesArray *GetPhotonList() const { return fPhotonList; }
103 TClonesArray *GetCaloCellList() const { return fCaloCellList; }
104 TClonesArray *GetMCTrackList() const { return fMCTrackList; }
105 TClonesArray *GetHeaderList() const { return fHeaderList; }
106 TList *GetRunInfoList() const { return fRunInfoList; }
107
108 AliESDVZERO *GetESDVZERO() const { return fVZEROData; }
109 AliESDTZERO *GetESDTZERO() const { return fTZEROData; }
110 // AliESDFMD* fFMDData;
111 AliESDZDC* GetESDZDC() const { return fZDCData; }
112
113 TClonesArray **GetTrackListP() { return &fTrackList; }
114 TClonesArray **GetPhotonListP() { return &fPhotonList; }
115 TClonesArray **GetCaloCellListP() { return &fCaloCellList; }
116 TClonesArray **GetMCTrackListP() { return &fMCTrackList; }
117 TClonesArray **GetHeaderListP() { return &fHeaderList; }
118 TList **GetRunInfoListP() { return &fRunInfoList; }
119
120 AliESDVZERO** GetESDVZEROP() { return &fVZEROData; }
121 AliESDTZERO** GetESDTZEROP() { return &fTZEROData; }
122 // AliESDFMD* fFMDData;
123 AliESDZDC** GetESDZDCP() { return &fZDCData; }
124
125 Bool_t GetStoreEventPlaneSource(){ return fAliJRunHeader->GetStoreEventPlaneSource(); }
126 Bool_t GetStoreEMCalInfo(){ return fAliJRunHeader->GetStoreEMCalInfo(); }
127 AliESDEvent * ESDEvent(){ return FromESD()? dynamic_cast<AliESDEvent*>(Event()):NULL;}
128 AliAODEvent * AODEvent(){ return FromAOD()? dynamic_cast<AliAODEvent*>(Event()):NULL;}
129 AliVEvent * Event(){ return fMyTask->InputEvent(); }
130 AliMCEvent * MCEvent(){ return IsMC()?fMyTask->MCEvent():NULL; }
131
132 Bool_t IsMC(){ return fAliJRunHeader->IsMC(); }
133 Bool_t FromESD(){ return fAliJRunHeader->FromESD(); }
134 Bool_t FromAOD(){ return fAliJRunHeader->FromAOD(); }
135
136 AliJRunHeader* GetAliJRunHeader() const { return fAliJRunHeader; }
137 void SetAliJRunHeader( AliJRunHeader* header ){ fAliJRunHeader=header; }
138 private:
139
140 Int_t DebugLevel(){ return fMyTask->DebugLevel(); }
141 inline void DEBUG(int level, int type, TString msg1, TString msg2=""){
142 if(DebugLevel()>level) std::cout<<type<<"\t"<<msg1<<" : "<<msg2<<std::endl;
143 }
144
145 AliJEventHeader* ReadCommonHeader(AliVEvent *event);
146 // methods to read data from ESD
147 void ReadESDTracks(AliESDEvent* esd);
148 void ConvertESDTPCOnlyTracks(AliESDEvent* esd, int iTrack, AliJTrack * ctrack, double ptMin, double ptMax);
149 void ConvertESDGCGTracks(AliESDEvent* esd, int iTrack, AliJTrack * ctrack, double ptMin, double ptMax);
0c61c973 150 void ReadESDCaloClusters(const AliESDEvent* esd){;} // Not implemented
151 void ReadESDCaloCells(const AliESDEvent* esd){;} // Not implemented
9dc4f671 152 void ReadESDHeader(AliESDEvent* esd);
153 void ReadESDPID(AliESDtrack* track, AliJTrack* ctrack);
154 // methods to read data from AOD
155 Bool_t ReadAODTracks(const AliAODEvent* aod);
0c61c973 156 Bool_t ReadAODCaloClusters(const AliAODEvent* aod) {return kFALSE;} // Not implemented
157 void ReadAODCaloCells(const AliAODEvent* aod){;} // Not implemented
9dc4f671 158 void ReadAODHeader(AliAODEvent* aod);
159 void ReadFilter();
160 void ReadMCTracksFromESD();
161 void ReadMCTracksFromAOD();
162 void RemapMCLabels();
163
164 Int_t GetSuperModuleNumber(bool isemcal, AliVCluster *cluster, AliVCaloCells *cells, Int_t absId);
165 Double_t* GetCellsAmplitude( bool isemcal, AliVCluster *cluster, AliVCaloCells *emCells, AliVCaloCells *phoCells );
166
167 UInt_t ConvertTriggerMask();//Converts alice trigger mask to JCorran trigger mask
168 //functions used for event selction:
169 bool AcceptAODTrack(AliAODTrack* aodTrack);
170 void SetOADBPath(const char* path) {fOADBPath=path;}
171 const char* GetOADBPath() const { return fOADBPath.Data(); }
172
173 // method to fill jcorran
174 void PrintOut() const;
175
176 // UTILS
177 void AddList(const char* aname, const char* cname, TClonesArray **obj, int nlist);
178
179 // d a t a m e m b e r s
180 AliESDtrackCuts* fEsdTrackCuts; // track selection cuts
181 AliAnalysisFilter * fESDFilter; // filter set of track selection BS
182 TVectorT<double> fIsRealOrMC; // flags if the input are real (0) ESDs or MonteCarlo ESDs (1)
183 TString fActiveTriggers[kRangeTriggerTableAlice]; // alice table mapping trigger bit to trigger name
184 TString fTriggerTableJCorran[kRangeTriggerTableJCorran]; // JCorran trigger table TBit 0 =MinBias
185 Bool_t fStoreEventPlaneSource; // store event plane
186 TString fOADBPath; // oadb path
187 TRefArray *fCaloClustersArr; //! calo cluster array
188 Double_t fClusterThreshold; // for event tropping
189 Double_t fTrackThreshold; // for event tropping
190 Bool_t fEventSuccess; //! if filter was successful with current event
191
192 TArrayI *fMcMap; //! mc index map
193
194 // jcorran output objects
195 TClonesArray * fTrackList; //! list of charged track objects
196 TClonesArray * fMCTrackList; //! list of charged track objects
197 TClonesArray * fPhotonList; //! list of photons objects
198 TClonesArray * fCaloCellList; //! list of calo cells
199 TClonesArray * fHeaderList; //! event details
200 TList * fRunInfoList; //! run details
201 AliPIDResponse *fPIDResponse; //! PID response object
202 AliPIDCombined *fPIDCombined; //! PID response object
203
204 AliESDVZERO* fVZEROData; //!
205 AliESDTZERO* fTZEROData; //!
206 // AliESDFMD* fFMDData;
207 AliESDZDC* fZDCData; //!
208
209 vector<Int_t> fEMCLabels; //! EMCal hit labels
210 vector<Int_t> fEMCTreeLabels; //! cascades for EMCal hits
211
212 AliJRunHeader* fAliJRunHeader; //! run details (mg field, trigger mask,etc...)
213 AliEMCALGeometry * fEMCALGeometry; //! emcal geometry
214 AliEMCALRecoUtils * fEMCALRecoUtils; //! reco utils
215 AliPHOSGeoUtils * fPHOSGeom; //! phos geometry matrix
216 AliAnalysisUtils *fAnaUtils; //! analysis utils ALICE
217 AliAnalysisTaskSE *fMyTask; //! task pointer
218
219
220 ClassDef(AliJFilter, 1);
221};
222#endif // AliJFilter_H