f2543a21182f52a7020faa9ffc902f5fed09fec7
[u/mrichter/AliRoot.git] / HLT / global / physics / AliHLTMultiplicityCorrelations.cxx
1 //-*- Mode: C++ -*-
2 // $Id: AliHLTMultiplicityCorrelations.cxx  $
3 //**************************************************************************
4 //* This file is property of and copyright by the ALICE HLT Project        * 
5 //* ALICE Experiment at CERN, All rights reserved.                         *
6 //*                                                                        *
7 //* Primary Authors: Jochen Thaeder <jochen@thaeder.de>                    *
8 //*                  for The ALICE HLT Project.                            *
9 //*                                                                        *
10 //* Permission to use, copy, modify and distribute this software and its   *
11 //* documentation strictly for non-commercial purposes is hereby granted   *
12 //* without fee, provided that the above copyright notice appears in all   *
13 //* copies and that both the copyright notice and this permission notice   *
14 //* appear in the supporting documentation. The authors make no claims     *
15 //* about the suitability of this software for any purpose. It is          *
16 //* provided "as is" without express or implied warranty.                  *
17 //**************************************************************************
18
19 /** @file   AliHLTMultiplicityCorrelations.cxx
20     @author Jochen Thaeder <jochen@thaeder.de>
21     @brief  Correlation plots for multiplicity studies
22 */
23
24 // see header file for class documentation
25 // or
26 // refer to README to build package
27 // or
28 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
29
30 #if __GNUC__>= 3
31    using namespace std;
32 #endif
33
34 #include "TH1F.h"
35 #include "TH2F.h"
36 #include "TList.h"
37
38 #include "AliHLTMultiplicityCorrelations.h"
39
40 /** ROOT macro for the implementation of ROOT specific class methods */
41 ClassImp(AliHLTMultiplicityCorrelations)
42
43 /*
44  * ---------------------------------------------------------------------------------
45  *                            Constructor / Destructor
46  * ---------------------------------------------------------------------------------
47  */
48
49 //##################################################################################
50 AliHLTMultiplicityCorrelations::AliHLTMultiplicityCorrelations() :
51   fHistList(NULL),
52   fESDEvent(NULL),
53   fESDZDC(NULL),
54   fESDVZERO(NULL),
55   fESDTrackCuts(NULL),
56   fEsdTracks(0), fEsdTracksA(0),
57   fTpcTracks(0), fTpcTracksA(0),
58   fVzeroMult(0.), fVzeroMultA(0.), fVzeroMultC(0.),
59   fVzeroMultFlagged(0.), fVzeroMultFlaggedA(0.), fVzeroMultFlaggedC(0.),
60   fSpdNClusters(0),
61   fVzeroBinning(350), fVzeroBinningMin(0.), fVzeroBinningMax(35000.),
62   fTpcBinning(200),fTpcBinningMin(0.),fTpcBinningMax(8000.),
63   fZdcBinning(280),fZdcBinningMin(0.),fZdcBinningMax(140.),
64   fZemBinning(100),fZemBinningMin(0.),fZemBinningMax(5.),
65   fZnpBinning(200),fZnpBinningMin(0.),fZnpBinningMax(100.),
66   fProcessPhos(true), fProcessEmcal(true),
67   fPhosTotalEt(0.0), fEmcalTotalEt(0.0),
68   fCaloBinning(100),fCaloBinningMin(0.),fCaloBinningMax(100.),
69   fSpdBinning(200),fSpdBinningMin(0.),fSpdBinningMax(15000.) {
70   // see header file for class documentation
71   // or
72   // refer to README to build package
73   // or
74   // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
75   
76 }
77
78 //##################################################################################
79 AliHLTMultiplicityCorrelations::~AliHLTMultiplicityCorrelations() {
80   // see header file for class documentation
81
82   if ( fHistList ) {
83     fHistList->Clear();
84     delete fHistList;
85   }
86   fHistList = NULL;
87 }
88
89 /*
90  * ---------------------------------------------------------------------------------
91  *                                   Initialize / Reset
92  * ---------------------------------------------------------------------------------
93  */
94
95 //##################################################################################
96 Int_t AliHLTMultiplicityCorrelations::Initialize() {
97   // see header file for class documentation  
98
99   Int_t iResult = 0;
100
101   fHistList = new TList();
102   fHistList->SetOwner(kTRUE);
103
104   iResult = SetupHistograms();
105
106   return iResult;
107 }
108
109 /*
110  * ---------------------------------------------------------------------------------
111  *                             Output - public
112  * ---------------------------------------------------------------------------------
113  */
114
115 //##################################################################################
116 Int_t AliHLTMultiplicityCorrelations::ProcessEvent( AliESDEvent *esd, Int_t nSpdClusters) {
117   // see header file for class documentation  
118
119   Int_t iResult = 0;
120
121   if ( ! AddESDEvent(esd) ) {
122     HLTWarning("No ESD event.");
123     return -1;
124   }
125
126   // -- TPC .. To be done before the others
127   if (fESDEvent->GetNumberOfTracks() > 0)
128     iResult = ProcessTPC();
129
130   fSpdNClusters = nSpdClusters;
131   iResult = ProcessSPD();
132   
133   // -- CALO, process with or without clusters, we want the zero-bin
134   iResult = ProcessCALO();
135   
136   // -- VZERO
137   if (fESDVZERO)
138     iResult = ProcessVZERO();
139
140   // -- ZDC and Correlations
141   if (fESDZDC)
142     iResult = ProcessZDC();
143
144   
145
146
147   return iResult;
148 }
149
150 ////////////////////////////////////////////////////////////////////////////////////
151 ////////////////////////////////////////////////////////////////////////////////////
152 ///                                                                              ///
153 //////                             PRIVATE                                    //////
154 ///                                                                              ///
155 ////////////////////////////////////////////////////////////////////////////////////
156 ////////////////////////////////////////////////////////////////////////////////////
157
158 /*
159  * ---------------------------------------------------------------------------------
160  *                          Setup / Initialize - private
161  * ---------------------------------------------------------------------------------
162  */
163
164 //##################################################################################
165 Bool_t AliHLTMultiplicityCorrelations::AddESDEvent( AliESDEvent* esd ) {
166   // see header file for class documentation  
167
168   fESDEvent = esd;
169   
170   // -- Check for ESD
171   if ( !fESDEvent ) {
172     HLTWarning("No ESD event present.");
173     return kFALSE;
174   }
175   
176   // -- Check for PrimaryVertex
177   if ( !esd->GetPrimaryVertexTracks() ){
178     HLTError("No Vertex present.");
179     return kFALSE;
180   }
181   
182   fESDZDC = esd->GetESDZDC();
183   if ( !fESDZDC ) {
184     HLTInfo("No ZDC information !");
185   }
186   
187   fESDVZERO = esd->GetVZEROData();
188   if ( !fESDVZERO ) {
189     HLTInfo("No VZERO information !");
190   }
191   
192   return kTRUE;
193 }
194
195 //##################################################################################
196 Int_t AliHLTMultiplicityCorrelations::SetupHistograms() {
197   // see header file for class documentation  
198
199   Int_t iResult = 0;
200   
201   iResult = SetupVZERO();
202   iResult = SetupZDC();
203   iResult = SetupTPC();
204   iResult = SetupCALO();
205   iResult = SetupSPD();
206   iResult = SetupCorrelations();
207
208   return iResult;
209 }
210
211 //##################################################################################
212 Int_t AliHLTMultiplicityCorrelations::SetupVZERO() {
213   // see header file for class documentation  
214
215   // VzeroMult
216   fHistList->Add(new TH1F("fVzeroMult",  "Multiplicity^{VZERO};Multiplicity^{VZERO};N_{Events}",   
217                           fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax));
218   fHistList->Add(new TH1F("fVzeroMultA", "Multiplicity^{VZERO} A;Multiplicity^{VZERO};N_{Events}", 
219                           fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax));
220   fHistList->Add(new TH1F("fVzeroMultC", "Multiplicity^{VZERO} C;Multiplicity^{VZERO};N_{Events}", 
221                           fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax)); 
222
223   // Flagged VzeroMult
224   fHistList->Add(new TH1F("fVzeroFlaggedMult",  "Multiplicity_{flagged}^{VZERO};Multiplicity^{VZERO};N_{Events}",   
225                           fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax)); 
226   fHistList->Add(new TH1F("fVzeroFlaggedMultA", "Multiplicity_{flagged}^{VZERO} A;Multiplicity^{VZERO};N_{Events}", 
227                           fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax)); 
228   fHistList->Add(new TH1F("fVzeroFlaggedMultC", "Multiplicity_{flagged}^{VZERO} C;Multiplicity^{VZERO};N_{Events}", 
229                           fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax)); 
230   
231   fHistList->Add(new TH1F("fVzeroTime",  "Time;Time;N_{Events}",   500, 0, 1000));
232   fHistList->Add(new TH1F("fVzeroTimeA", "Time A;Time;N_{Events}", 500, 0, 1000));
233   fHistList->Add(new TH1F("fVzeroTimeC", "Time B;Time;N_{Events}", 500, 0, 1000));
234
235   fHistList->Add(new TH1F("fVzeroADC",  "ADC;ADC;N_{Events}",   500, 0, 150000));
236   fHistList->Add(new TH1F("fVzeroADCA", "ADC A;ADC;N_{Events}", 500, 0, 100000));
237   fHistList->Add(new TH1F("fVzeroADCC", "ADC B;ADC;N_{Events}", 500, 0, 100000));
238
239   return 0;
240 }
241
242 //##################################################################################
243 Int_t AliHLTMultiplicityCorrelations::SetupZDC() {
244   // see header file for class documentation  
245   
246   // E_{ZN}
247   fHistList->Add(new TH1F("fZdcEzn",  "E_{ZN};E_{ZN} (TeV);N_{Events}",   
248                           fZnpBinning,fZnpBinningMin,fZnpBinningMax));
249   fHistList->Add(new TH1F("fZdcEznA", "E_{ZN} A;E_{ZN} (TeV);N_{Events}", 
250                           fZnpBinning,fZnpBinningMin,fZnpBinningMax));
251   fHistList->Add(new TH1F("fZdcEznC", "E_{ZN} C;E_{ZN} (TeV);N_{Events}", 
252                           fZnpBinning,fZnpBinningMin,fZnpBinningMax));
253   
254   // E_{ZP}
255   fHistList->Add(new TH1F("fZdcEzp",  "E_{ZP};E_{ZP} (TeV);N_{Events}",   
256                           fZnpBinning,fZnpBinningMin,fZnpBinningMax));
257   fHistList->Add(new TH1F("fZdcEzpA", "E_{ZP} A;E_{ZP} (TeV);N_{Events}", 
258                           fZnpBinning,fZnpBinningMin,fZnpBinningMax));
259   fHistList->Add(new TH1F("fZdcEzpC", "E_{ZP} C;E_{ZP} (TeV);N_{Events}", 
260                           fZnpBinning,fZnpBinningMin,fZnpBinningMax));
261   
262   // E_{ZDC}
263   fHistList->Add(new TH1F("fZdcEzdc",  "E_{ZDC};E_{ZDC} (TeV);N_{Events}",   
264                           fZdcBinning,fZdcBinningMin,fZdcBinningMax));
265   fHistList->Add(new TH1F("fZdcEzdcA", "E_{ZDC} A;E_{ZDC} (TeV);N_{Events}", 
266                           fZdcBinning,fZdcBinningMin,fZdcBinningMax));
267   fHistList->Add(new TH1F("fZdcEzdcC", "E_{ZDC} C;E_{ZDC} (TeV);N_{Events}", 
268                           fZdcBinning,fZdcBinningMin,fZdcBinningMax));
269
270   // E_{ZEM}
271   fHistList->Add(new TH1F("fZdcEzem",  "E_{ZEM};E_{ZEM} (TeV);N_{Events}",   
272                           fZemBinning,fZemBinningMin,fZemBinningMax));
273   fHistList->Add(new TH1F("fZdcEzemA", "E_{ZEM} A;E_{ZEM} (TeV);N_{Events}", 
274                           fZemBinning,fZemBinningMin,fZemBinningMax));
275   fHistList->Add(new TH1F("fZdcEzemC", "E_{ZEM} C;E_{ZEM} (TeV);N_{Events}", 
276                           fZemBinning,fZemBinningMin,fZemBinningMax));
277   
278   // N_{Part}
279   fHistList->Add(new TH1F("fZdcNpart",  "N_{Part} ;N_{Part};N_{Events}",  50,0,499));
280   fHistList->Add(new TH1F("fZdcNpartA", "N_{Part} A;N_{Part};N_{Events}", 50,0,499));
281   fHistList->Add(new TH1F("fZdcNpartC", "N_{Part} C;N_{Part};N_{Events}", 50,0,499));
282   
283   // b
284   fHistList->Add(new TH1F("fZdcB",  "b;b {fm);N_{Events}",   31,0,30));
285   fHistList->Add(new TH1F("fZdcBA", "b A;b (fm);N_{Events}", 31,0,30));
286   fHistList->Add(new TH1F("fZdcBC", "b C;b (fm);N_{Events}", 31,0,30));
287
288   // E_{ZEM} vs E_{ZDC} 
289   fHistList->Add(new TH2F("fZdcEzemEzdc", "E_{ZEM} vs E_{ZDC};E_{ZEM} (TeV); E_{ZDC} (TeV)",   
290                           fZemBinning,fZemBinningMin,fZemBinningMax, fZdcBinning,fZdcBinningMin,fZdcBinningMax));
291   fHistList->Add(new TH2F("fZdcEzemEzdcA","E_{ZEM} vs E_{ZDC} A;E_{ZEM} (TeV); E_{ZDC} (TeV)", 
292                           fZemBinning,fZemBinningMin,fZemBinningMax, fZdcBinning,fZdcBinningMin,fZdcBinningMax));
293   fHistList->Add(new TH2F("fZdcEzemEzdcC","E_{ZEM} vs E_{ZDC} C;E_{ZEM} (TeV); E_{ZDC} (TeV)", 
294                           fZemBinning,fZemBinningMin,fZemBinningMax, fZdcBinning,fZdcBinningMin,fZdcBinningMax));
295
296   return 0;
297 }
298
299 //##################################################################################
300 Int_t AliHLTMultiplicityCorrelations::SetupTPC() {
301   // see header file for class documentation  
302
303   Int_t    n = 50;
304   Double_t s = 0.1;
305   Double_t e = 50.;
306   
307   // -- Create LogPtBinning
308   // ------------------------
309   Double_t logMin = TMath::Log10(s);
310   Double_t logMax = TMath::Log10(e);
311   Double_t binwidth = (logMax-logMin)/n;
312   
313   Double_t *logBinning = new Double_t[n+1];
314
315   logBinning[0] = s;
316   for (Int_t ii = 1; ii <= n; ii++)
317     logBinning[ii] = s + TMath::Power(10, logMin + ii*binwidth);
318   // - - - - - - - - - - - - - - - - - - - - - - - - - - - 
319
320   // dN_{ch} / dP_{T}
321   fHistList->Add(new TH1F("fTpcPt0", "dN_{ch} / dP_{T} esdTracks; P_{T} (GeV/c);dN/dP_{T} (c/GeV)", n, logBinning));  
322   fHistList->Add(new TH1F("fTpcPt1", "dN_{ch} / dP_{T} accepted esdTracks; P_{T} (GeV/c);dN/dP_{T} (c/GeV)", n, logBinning));  
323   fHistList->Add(new TH1F("fTpcPt2", "dN_{ch} / dP_{T} tpcTracks; P_{T} (GeV/c);dN/dP_{T} (c/GeV)", n, logBinning));  
324   fHistList->Add(new TH1F("fTpcPt3", "dN_{ch} / dP_{T} accepted tpcTracks; P_{T} (GeV/c);dN/dP_{T} (c/GeV)", n, logBinning));  
325
326   // Multiplicty
327   fHistList->Add(new TH1F("fTpcNch0", "N_{ch} esdTracks; N_{ch};N_{Events}", 
328                           fTpcBinning,fTpcBinningMin,fTpcBinningMax));
329   fHistList->Add(new TH1F("fTpcNch1", "N_{ch} accepted esdTracks; N_{ch};N_{Events}", 
330                           fTpcBinning,fTpcBinningMin,fTpcBinningMax));
331   fHistList->Add(new TH1F("fTpcNch2", "N_{ch} tpcTracks; N_{ch};N_{Events}", 
332                           fTpcBinning,fTpcBinningMin,fTpcBinningMax));
333   fHistList->Add(new TH1F("fTpcNch3", "N_{ch} accepted tpcTracks; N_{ch};N_{Events}", 
334                           fTpcBinning,fTpcBinningMin,fTpcBinningMax));
335
336   return 0;
337 }
338
339 //##################################################################################
340 Int_t AliHLTMultiplicityCorrelations::SetupCorrelations() {
341   // see header file for class documentation  
342
343   // ----------------------------------------------------
344   //   ZDC vs TPC
345   // ----------------------------------------------------
346
347   // E_{ZDC} vs N_{ch}
348   fHistList->Add(new TH2F("fCorrEzdcNch", "E_{ZDC} vs N_{ch}^{TPC};E_{ZDC} (TeV);N_{ch}^{TPC}",   
349                           fZdcBinning,fZdcBinningMin,fZdcBinningMax, fTpcBinning,fTpcBinningMin,fTpcBinningMax));
350   fHistList->Add(new TH2F("fCorrEzdcANch","E_{ZDC} vs N_{ch}^{TPC} A;E_{ZDC} (TeV);N_{ch}^{TPC}", 
351                           fZdcBinning,fZdcBinningMin,fZdcBinningMax, fTpcBinning,fTpcBinningMin,fTpcBinningMax));
352   fHistList->Add(new TH2F("fCorrEzdcCNch","E_{ZDC} vs N_{ch}^{TPC} C;E_{ZDC} (TeV);N_{ch}^{TPC}", 
353                           fZdcBinning,fZdcBinningMin,fZdcBinningMax, fTpcBinning,fTpcBinningMin,fTpcBinningMax));
354   
355   // E_{ZEM} vs N_{ch}
356   fHistList->Add(new TH2F("fCorrEzemNch", "E_{ZEM} vs N_{ch}^{TPC};E_{ZEM} (TeV);N_{ch}^{TPC}",   
357                           fZemBinning,fZemBinningMin,fZemBinningMax, fTpcBinning,fTpcBinningMin,fTpcBinningMax));
358   fHistList->Add(new TH2F("fCorrEzemANch","E_{ZEM} vs N_{ch}^{TPC} A;E_{ZEM} (TeV);N_{ch}^{TPC}", 
359                           fZemBinning,fZemBinningMin,fZemBinningMax, fTpcBinning,fTpcBinningMin,fTpcBinningMax));
360   fHistList->Add(new TH2F("fCorrEzemCNch","E_{ZEM} vs N_{ch}^{TPC} C;E_{ZEM} (TeV);N_{ch}^{TPC}", 
361                           fZemBinning,fZemBinningMin,fZemBinningMax, fTpcBinning,fTpcBinningMin,fTpcBinningMax));
362   
363   // E_{ZP} vs N_{ch}
364   fHistList->Add(new TH2F("fCorrEzpNch", "E_{ZP} vs N_{ch}^{TPC};E_{ZP} (TeV);N_{ch}^{TPC}",   
365                           fZnpBinning,fZnpBinningMin,fZnpBinningMax, fTpcBinning,fTpcBinningMin,fTpcBinningMax));
366   fHistList->Add(new TH2F("fCorrEzpANch","E_{ZP} vs N_{ch}^{TPC} A;E_{ZP} (TeV);N_{ch}^{TPC}", 
367                           fZnpBinning,fZnpBinningMin,fZnpBinningMax, fTpcBinning,fTpcBinningMin,fTpcBinningMax));
368   fHistList->Add(new TH2F("fCorrEzpCNch","E_{ZP} vs N_{ch}^{TPC} C;E_{ZP} (TeV);N_{ch}^{TPC}", 
369                           fZnpBinning,fZnpBinningMin,fZnpBinningMax, fTpcBinning,fTpcBinningMin,fTpcBinningMax));
370   
371   // E_{ZN} vs N_{ch}
372   fHistList->Add(new TH2F("fCorrEznNch", "E_{ZN} vs N_{ch}^{TPC};E_{ZN} (TeV);N_{ch}^{TPC}",   
373                           fZnpBinning,fZnpBinningMin,fZnpBinningMax, fTpcBinning,fTpcBinningMin,fTpcBinningMax));
374   fHistList->Add(new TH2F("fCorrEznANch","E_{ZN} vs N_{ch}^{TPC} A;E_{ZN} (TeV);N_{ch}^{TPC}", 
375                           fZnpBinning,fZnpBinningMin,fZnpBinningMax, fTpcBinning,fTpcBinningMin,fTpcBinningMax));
376   fHistList->Add(new TH2F("fCorrEznCNch","E_{ZN} vs N_{ch}^{TPC} C;E_{ZN} (TeV);N_{ch}^{TPC}", 
377                           fZnpBinning,fZnpBinningMin,fZnpBinningMax, fTpcBinning,fTpcBinningMin,fTpcBinningMax));
378   
379   // N_{Part} vs N_{ch}
380   fHistList->Add(new TH2F("fCorrZdcNpartNch", "N_{part} vs N_{ch}^{TPC};N_{Events};N_{ch}^{TPC}",   
381                           50,0,499, fTpcBinning,fTpcBinningMin,fTpcBinningMax)); 
382   fHistList->Add(new TH2F("fCorrZdcNpartANch","N_{part} vs N_{ch}^{TPC} A;N_{Events};N_{ch}^{TPC}", 
383                           50,0,499, fTpcBinning,fTpcBinningMin,fTpcBinningMax));
384   fHistList->Add(new TH2F("fCorrZdcNpartCNch","N_{part} vs N_{ch}^{TPC} C;N_{Events};N_{ch}^{TPC}", 
385                           50,0,499, fTpcBinning,fTpcBinningMin,fTpcBinningMax));
386
387   // b vs N_{ch}
388   fHistList->Add(new TH2F("fCorrZdcbNch", "b_{ZDC} vs N_{ch}^{TPC};b (fm);N_{ch}^{TPC}",  
389                           31,0,30, fTpcBinning,fTpcBinningMin,fTpcBinningMax));
390   fHistList->Add(new TH2F("fCorrZdcbANch","b_{ZDC} vs N_{ch}^{TPC} A;b (fm);N_{ch}^{TPC}", 
391                           31,0,30, fTpcBinning,fTpcBinningMin,fTpcBinningMax));
392   fHistList->Add(new TH2F("fCorrZdcbCNch","b_{ZDC} vs N_{ch}^{TPC} C;b (fm);N_{ch}^{TPC}", 
393                           31,0,30, fTpcBinning,fTpcBinningMin,fTpcBinningMax));
394
395   // ----------------------------------------------------
396   //   ZDC vs VZERO
397   // ----------------------------------------------------
398
399   // E_{ZDC} vs Multiplicty VZERO
400   fHistList->Add(new TH2F("fCorrEzdcVzero", 
401                           "E_{ZDC} vs Multiplicity^{VZERO};E_{ZDC} (TeV);Multiplicity^{VZERO}",  
402                           fZdcBinning,fZdcBinningMin,fZdcBinningMax, fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax));
403   fHistList->Add(new TH2F("fCorrEzdcVzeroA",
404                           "E_{ZDC} vs Multiplicity^{VZERO} A;E_{ZDC} (TeV);Multiplicity^{VZERO}",
405                           fZdcBinning,fZdcBinningMin,fZdcBinningMax, fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax));
406   fHistList->Add(new TH2F("fCorrEzdcVzeroC",
407                           "E_{ZDC} vs Multiplicity^{VZERO} C;E_{ZDC} (TeV);Multiplicity^{VZERO}",
408                           fZdcBinning,fZdcBinningMin,fZdcBinningMax, fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax));
409   
410   // E_{ZEM} vs Multiplicty VZERO
411   fHistList->Add(new TH2F("fCorrEzemVzero", 
412                           "E_{ZEM} vs Multiplicity^{VZERO};E_{ZEM} (TeV);Multiplicity^{VZERO}",  
413                           fZemBinning,fZemBinningMin,fZemBinningMax, fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax));
414   fHistList->Add(new TH2F("fCorrEzemVzeroA",
415                           "E_{ZEM} vs Multiplicity^{VZERO} A;E_{ZEM} (TeV);Multiplicity^{VZERO}",
416                           fZemBinning,fZemBinningMin,fZemBinningMax, fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax));
417   fHistList->Add(new TH2F("fCorrEzemVzeroC",
418                           "E_{ZEM} vs Multiplicity^{VZERO} C;E_{ZEM} (TeV);Multiplicity^{VZERO}",
419                           fZemBinning,fZemBinningMin,fZemBinningMax, fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax));
420   
421   // E_{ZP} vs Multiplicty VZERO
422   fHistList->Add(new TH2F("fCorrEzpVzero", 
423                           "E_{ZP} vs Multiplicity^{VZERO};E_{ZP} (TeV);Multiplicity^{VZERO}",  
424                           fZnpBinning,fZnpBinningMin,fZnpBinningMax, fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax));
425   fHistList->Add(new TH2F("fCorrEzpVzeroA",
426                           "E_{ZP} vs Multiplicity^{VZERO} A;E_{ZP} (TeV);Multiplicity^{VZERO}",
427                           fZnpBinning,fZnpBinningMin,fZnpBinningMax, fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax));
428   fHistList->Add(new TH2F("fCorrEzpVzeroC",
429                           "E_{ZP} vs Multiplicity^{VZERO} C;E_{ZP} (TeV);Multiplicity^{VZERO}",
430                           fZnpBinning,fZnpBinningMin,fZnpBinningMax, fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax));
431   
432   // E_{ZN} vs Multiplicty VZERO
433   fHistList->Add(new TH2F("fCorrEznVzero", 
434                           "E_{ZN} vs Multiplicity^{VZERO};E_{ZN} (TeV);Multiplicity^{VZERO}",   
435                           fZnpBinning,fZnpBinningMin,fZnpBinningMax, fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax));
436   fHistList->Add(new TH2F("fCorrEznVzeroA",
437                           "E_{ZN} vs Multiplicity^{VZERO} A;E_{ZN} (TeV);Multiplicity^{VZERO}",
438                           fZnpBinning,fZnpBinningMin,fZnpBinningMax, fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax));
439   fHistList->Add(new TH2F("fCorrEznVzeroC",
440                           "E_{ZN} vs Multiplicity^{VZERO} C;E_{ZN} (TeV);Multiplicity^{VZERO}",
441                           fZnpBinning,fZnpBinningMin,fZnpBinningMax, fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax));
442   
443   // N_{Part} vs Multiplicty VZERO
444   fHistList->Add(new TH2F("fCorrZdcNpartVzero", 
445                           "N_{part} vs Multiplicity^{VZERO};N_{Events};Multiplicity^{VZERO}",   
446                           50,0,499, fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax)); 
447   fHistList->Add(new TH2F("fCorrZdcNpartVzeroA",
448                           "N_{part} vs Multiplicity^{VZERO} A;N_{Events};Multiplicity^{VZERO}", 
449                           50,0,499, fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax));
450   fHistList->Add(new TH2F("fCorrZdcNpartVzeroC",
451                           "N_{part} vs Multiplicity^{VZERO} C;N_{Events};Multiplicity^{VZERO}",
452                           50,0,499, fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax));
453
454   // b vs Multiplicty VZERO
455   fHistList->Add(new TH2F("fCorrZdcbVzero", "b_{ZDC} vs Multiplicity^{VZERO};b (fm);Multiplicity^{VZERO}",    
456                           31,0,30, fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax));
457   fHistList->Add(new TH2F("fCorrZdcbVzeroA","b_{ZDC} vs Multiplicity^{VZERO} A;b (fm);Multiplicity^{VZERO}",  
458                           31,0,30, fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax));
459   fHistList->Add(new TH2F("fCorrZdcbVzeroC","b_{ZDC} vs Multiplicity^{VZERO} C;b (fm);Multiplicity^{VZERO}",  
460                           31,0,30, fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax));
461
462   // -- -- -- -- -- -- -- 
463
464   // E_{ZDC} vs Multiplicty VZERO flagged
465   fHistList->Add(new TH2F("fCorrEzdcVzeroF", 
466                           "E_{ZDC} vs Multiplicity_{flagged}^{VZERO};E_{ZDC} (TeV);Multiplicity^{VZERO}",   
467                           fZdcBinning,fZdcBinningMin,fZdcBinningMax, fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax));
468   fHistList->Add(new TH2F("fCorrEzdcVzeroFA",
469                           "E_{ZDC} vs Multiplicity_{flagged}^{VZERO} A;E_{ZDC} (TeV);Multiplicity^{VZERO}", 
470                           fZdcBinning,fZdcBinningMin,fZdcBinningMax, fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax));
471   fHistList->Add(new TH2F("fCorrEzdcVzeroFC",
472                           "E_{ZDC} vs Multiplicity_{flagged}^{VZERO} C;E_{ZDC} (TeV);Multiplicity^{VZERO}", 
473                           fZdcBinning,fZdcBinningMin,fZdcBinningMax, fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax));
474   
475   // E_{ZEM} vs Multiplicty VZERO flagged
476   fHistList->Add(new TH2F("fCorrEzemVzeroF", 
477                           "E_{ZEM} vs Multiplicity_{flagged}^{VZERO};E_{ZEM} (TeV);Multiplicity^{VZERO}",   
478                           fZemBinning,fZemBinningMin,fZemBinningMax, fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax));
479   fHistList->Add(new TH2F("fCorrEzemVzeroFA",
480                           "E_{ZEM} vs Multiplicity_{flagged}^{VZERO} A;E_{ZEM} (TeV);Multiplicity^{VZERO}", 
481                           fZemBinning,fZemBinningMin,fZemBinningMax, fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax));
482   fHistList->Add(new TH2F("fCorrEzemVzeroFC",
483                           "E_{ZEM} vs Multiplicity_{flagged}^{VZERO} C;E_{ZEM} (TeV);Multiplicity^{VZERO}", 
484                           fZemBinning,fZemBinningMin,fZemBinningMax, fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax));
485   
486   // E_{ZP} vs Multiplicty VZERO flagged
487   fHistList->Add(new TH2F("fCorrEzpVzeroF", 
488                           "E_{ZP} vs Multiplicity_{flagged}^{VZERO};E_{ZP} (TeV);Multiplicity^{VZERO}",   
489                           fZnpBinning,fZnpBinningMin,fZnpBinningMax, fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax));
490   fHistList->Add(new TH2F("fCorrEzpVzeroFA",
491                           "E_{ZP} vs Multiplicity_{flagged}^{VZERO} A;E_{ZP} (TeV);Multiplicity^{VZERO}", 
492                           fZnpBinning,fZnpBinningMin,fZnpBinningMax, fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax));
493   fHistList->Add(new TH2F("fCorrEzpVzeroFC",
494                           "E_{ZP} vs Multiplicity_{flagged}^{VZERO} C;E_{ZP} (TeV);Multiplicity^{VZERO}",
495                           fZnpBinning,fZnpBinningMin,fZnpBinningMax, fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax));
496   
497   // E_{ZN} vs Multiplicty VZERO flagged
498   fHistList->Add(new TH2F("fCorrEznVzeroF", 
499                           "E_{ZN} vs Multiplicity_{flagged}^{VZERO};E_{ZN} (TeV);Multiplicity^{VZERO}",  
500                           fZnpBinning,fZnpBinningMin,fZnpBinningMax, fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax));
501   fHistList->Add(new TH2F("fCorrEznVzeroFA",
502                           "E_{ZN} vs Multiplicity_{flagged}^{VZERO} A;E_{ZN} (TeV);Multiplicity^{VZERO}", 
503                           fZnpBinning,fZnpBinningMin,fZnpBinningMax, fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax));
504   fHistList->Add(new TH2F("fCorrEznVzeroFC",
505                           "E_{ZN} vs Multiplicity_{flagged}^{VZERO} C;E_{ZN} (TeV);Multiplicity^{VZERO}", 
506                           fZnpBinning,fZnpBinningMin,fZnpBinningMax, fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax));
507   
508   // N_{Part} vs Multiplicty VZERO flagged
509   fHistList->Add(new TH2F("fCorrZdcNpartVzeroF", 
510                           "N_{part} vs Multiplicity_{flagged}^{VZERO};N_{Events};Multiplicity^{VZERO}",   
511                           50,0,499, fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax)); 
512   fHistList->Add(new TH2F("fCorrZdcNpartVzeroFA",
513                           "N_{part} vs Multiplicity_{flagged}^{VZERO} A;N_{Events};Multiplicity^{VZERO}", 
514                           50,0,499, fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax));
515   fHistList->Add(new TH2F("fCorrZdcNpartVzeroFC",
516                           "N_{part} vs Multiplicity_{flagged}^{VZERO} C;N_{Events};Multiplicity^{VZERO}", 
517                           50,0,499, fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax));
518
519   // b vs Multiplicty VZERO flagged
520   fHistList->Add(new TH2F("fCorrZdcbVzeroF", 
521                           "b_{ZDC} vs Multiplicity_{flagged}^{VZERO};b (fm);Multiplicity^{VZERO}",    
522                           31,0,30, fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax));
523   fHistList->Add(new TH2F("fCorrZdcbVzeroFA",
524                           "b_{ZDC} vs Multiplicity_{flagged}^{VZERO} A;b (fm);Multiplicity^{VZERO}",  
525                           31,0,30, fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax));
526   fHistList->Add(new TH2F("fCorrZdcbVzeroFC",
527                           "b_{ZDC} vs Multiplicity_{flagged}^{VZERO} C;b (fm);Multiplicity^{VZERO}",  
528                           31,0,30, fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax));
529
530   // ----------------------------------------------------
531   //   VZERO vs TPC
532   // ----------------------------------------------------
533
534   fHistList->Add(new TH2F("fCorrVzeroNch", 
535                           "Multiplicity^{VZERO} vs N_{ch}^{TPC};Multiplicity^{VZERO};N_{ch}^{TPC}", 
536                           fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax, fTpcBinning,fTpcBinningMin,fTpcBinningMax));
537   fHistList->Add(new TH2F("fCorrVzeroANch", 
538                           "Multiplicity^{VZERO} vs N_{ch}^{TPC} A;Multiplicity^{VZERO};N_{ch}^{TPC}", 
539                           fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax, fTpcBinning,fTpcBinningMin,fTpcBinningMax));
540   fHistList->Add(new TH2F("fCorrVzeroCNch", 
541                           "Multiplicity^{VZERO} vs N_{ch}^{TPC} C;Multiplicity^{VZERO};N_{ch}^{TPC}", 
542                           fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax, fTpcBinning,fTpcBinningMin,fTpcBinningMax));
543
544   fHistList->Add(new TH2F("fCorrVzeroFNch", 
545                           "Multiplicity^{VZERO} vs N_{ch}^{TPC};Multiplicity_{flagged}^{VZERO};N_{ch}^{TPC}", 
546                           fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax, fTpcBinning,fTpcBinningMin,fTpcBinningMax));
547   fHistList->Add(new TH2F("fCorrVzeroFANch", 
548                           "Multiplicity^{VZERO} vs N_{ch}^{TPC} A;Multiplicity_{flagged}^{VZERO};N_{ch}^{TPC}", 
549                           fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax, fTpcBinning,fTpcBinningMin,fTpcBinningMax));
550   fHistList->Add(new TH2F("fCorrVzeroFCNch", 
551                           "Multiplicity^{VZERO} vs N_{ch}^{TPC} C;Multiplicity_{flagged}^{VZERO};N_{ch}^{TPC}", 
552                           fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax, fTpcBinning,fTpcBinningMin,fTpcBinningMax));
553
554   // ----------------------------------------------------
555   //   ZDC vs CALO
556   // ----------------------------------------------------
557   fHistList->Add(new TH2F("fCorrZdcTotEvsPhosTotEt", 
558                           "Total E_{ZDC} vs Total E_{T} in PHOS;Total E_{ZDC} (TeV);E_{T} (GeV)", 
559                           fZdcBinning,fZdcBinningMin,fZdcBinningMax, fCaloBinning,fCaloBinningMin,fCaloBinningMax));
560   fHistList->Add(new TH2F("fCorrZdcTotEvsEmcalTotEt", 
561                           "Total E_{ZDC} vs Total E_{T} in EMCAL;Total E_{ZDC} (TeV);E_{T} (GeV)", 
562                           fZdcBinning,fZdcBinningMin,fZdcBinningMax, fCaloBinning,fCaloBinningMin,fCaloBinningMax));
563   fHistList->Add(new TH2F("fCorrZdcTotEvsTotEt", 
564                           "Total E_{ZDC} vs Total E_{T} in calorimeters;Total E_{ZDC} (TeV);E_{T} (GeV)", 
565                           fZdcBinning,fZdcBinningMin,fZdcBinningMax, fCaloBinning,fCaloBinningMin,fCaloBinningMax));
566   
567   // ----------------------------------------------------
568   //   VZERO vs CALO
569   // ----------------------------------------------------
570   fHistList->Add(new TH2F("fCorrVzerovsPhosTotEt", 
571                           "Multiplicity^{VZERO} vs Total E_{T} in PHOS;Multiplicity^{VZERO};E_{T} (GeV)", 
572                           fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax, fCaloBinning,fCaloBinningMin,fCaloBinningMax));
573   fHistList->Add(new TH2F("fCorrVzerovsEmcalTotEt", 
574                           "Multiplicity^{VZERO} vs Total E_{T} in EMCAL;Multiplicity^{VZERO};E_{T} (GeV)", 
575                           fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax, fCaloBinning,fCaloBinningMin,fCaloBinningMax));
576   fHistList->Add(new TH2F("fCorrVzerovsTotEt", 
577                           "Multiplicity^{VZERO} vs Total E_{T} in Calorimeters;Multiplicity^{VZERO};E_{T} (GeV)", 
578                           fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax, fCaloBinning,fCaloBinningMin,fCaloBinningMax));
579   
580   fHistList->Add(new TH2F("fCorrVzeroFlaggedvsPhosTotEt", 
581                           "Multiplicity_{flagged}^{VZERO} vs Total E_{T} in PHOS;Multiplicity_{flagged}^{VZERO};E_{T} (GeV)", 
582                           fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax, fCaloBinning,fCaloBinningMin,fCaloBinningMax));
583   fHistList->Add(new TH2F("fCorrVzeroFlaggedvsEmcalTotEt", 
584                           "Multiplicity_{flagged}^{VZERO} vs Total E_{T} in EMCAL;Multiplicity_{flagged}^{VZERO};E_{T} (GeV)", 
585                           fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax, fCaloBinning,fCaloBinningMin,fCaloBinningMax));
586   fHistList->Add(new TH2F("fCorrVzeroFlaggedvsTotEt", 
587                           "Multiplicity_{flagged}^{VZERO} vs Total E_{T} in Calorimeters;Multiplicity_{flagged}^{VZERO};E_{T} (GeV)", 
588                           fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax, fCaloBinning,fCaloBinningMin,fCaloBinningMax));
589   
590   // ----------------------------------------------------
591   //   SPD vs TPC
592   // ----------------------------------------------------
593
594   fHistList->Add(new TH2F("fCorrSpdTpcNch", "N_{clusters}^{SPD} vs N_{ch}^{TPC};N_{clusters}^{SPD};N_{ch}^{TPC}",   
595                           fSpdBinning,fSpdBinningMin,fSpdBinningMax, fTpcBinning,fTpcBinningMin,fTpcBinningMax));  
596
597   // ----------------------------------------------------
598   //   SPD vs VZERO
599   // ----------------------------------------------------
600
601   fHistList->Add(new TH2F("fCorrVzeroSpd", 
602                           "Multiplicity^{VZERO} vs N_{ch}^{SPD};Multiplicity^{VZERO};N^{SPD}", 
603                           fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax, fSpdBinning,fSpdBinningMin,fSpdBinningMax));
604   fHistList->Add(new TH2F("fCorrVzeroASpd", 
605                           "Multiplicity^{VZERO} vs N_{ch}^{SPD} A;Multiplicity^{VZERO};N^{SPD}", 
606                           fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax, fSpdBinning,fSpdBinningMin,fSpdBinningMax));
607   fHistList->Add(new TH2F("fCorrVzeroCSpd", 
608                           "Multiplicity^{VZERO} vs N_{ch}^{SPD} C;Multiplicity^{VZERO};N^{SPD}", 
609                           fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax, fSpdBinning,fSpdBinningMin,fSpdBinningMax));
610
611   fHistList->Add(new TH2F("fCorrVzeroFSpd", 
612                           "Multiplicity^{VZERO} vs N_{ch}^{SPD};Multiplicity_{flagged}^{VZERO};N^{SPD}", 
613                           fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax, fSpdBinning,fSpdBinningMin,fSpdBinningMax));
614   fHistList->Add(new TH2F("fCorrVzeroFASpd", 
615                           "Multiplicity^{VZERO} vs N_{ch}^{SPD} A;Multiplicity_{flagged}^{VZERO};N^{SPD}", 
616                           fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax, fSpdBinning,fSpdBinningMin,fSpdBinningMax));
617   fHistList->Add(new TH2F("fCorrVzeroFCSpd", 
618                           "Multiplicity^{VZERO} vs N_{ch}^{SPD} C;Multiplicity_{flagged}^{VZERO};N^{SPD}", 
619                           fVzeroBinning,fVzeroBinningMin,fVzeroBinningMax, fSpdBinning,fSpdBinningMin,fSpdBinningMax));
620
621   // ----------------------------------------------------
622   //   SPD vs ZDC
623   // ----------------------------------------------------
624
625   // E_{ZDC} vs Multiplicty SPD
626   fHistList->Add(new TH2F("fCorrEzdcSpd", "E_{ZDC} vs N_{ch}^{SPD};E_{ZDC} (TeV);N^{SPD}",   
627                           fZdcBinning,fZdcBinningMin,fZdcBinningMax, fSpdBinning,fSpdBinningMin,fSpdBinningMax));
628   fHistList->Add(new TH2F("fCorrEzdcASpd","E_{ZDC} vs N_{ch}^{SPD} A;E_{ZDC} (TeV);N^{SPD}", 
629                           fZdcBinning,fZdcBinningMin,fZdcBinningMax, fSpdBinning,fSpdBinningMin,fSpdBinningMax));
630   fHistList->Add(new TH2F("fCorrEzdcCSpd","E_{ZDC} vs N_{ch}^{SPD} C;E_{ZDC} (TeV);N^{SPD}", 
631                           fZdcBinning,fZdcBinningMin,fZdcBinningMax, fSpdBinning,fSpdBinningMin,fSpdBinningMax));
632   
633
634   return 0;
635 }
636
637 //##################################################################################
638 Int_t AliHLTMultiplicityCorrelations::SetupCALO() {
639   // see header file for class documentation  
640
641   if(fProcessPhos) {
642     fHistList->Add(new TH1F("fPhosEt",  "Total E_{T} in PHOS:E (GeV)",   
643                             fCaloBinning,fCaloBinningMin,fCaloBinningMax));
644   }
645   if(fProcessEmcal) {
646     fHistList->Add(new TH1F("fEmcalEt",  "Total E_{T} in EMCAL:E (GeV)",   
647                             fCaloBinning,fCaloBinningMin,fCaloBinningMax));
648   }
649   if(fProcessPhos || fProcessEmcal) {
650     fHistList->Add(new TH1F("fTotalEt",  "Total E_{T} in calorimeters:E (GeV)",   
651                             fCaloBinning,fCaloBinningMin,fCaloBinningMax));
652   }
653   return 0;
654 }
655
656 //##################################################################################
657 Int_t AliHLTMultiplicityCorrelations::SetupSPD() {
658   // see header file for class documentation  
659   
660   fHistList->Add(new TH1F("fSpdNClusters", "Multplicity_{SPD};Multplicity_{SPD};N_{Events}",   
661                           fSpdBinning,fSpdBinningMin,fSpdBinningMax));
662
663   return 0;
664 }
665
666
667 /*
668  * ---------------------------------------------------------------------------------
669  *                               Process - private
670  * ---------------------------------------------------------------------------------
671  */
672
673 //##################################################################################
674 Int_t AliHLTMultiplicityCorrelations::ProcessTPC() {
675   // see header file for class documentation  
676
677   Int_t iResult = 0 ;
678
679   TH1F* hPt0 = static_cast<TH1F*>(fHistList->FindObject("fTpcPt0")); // all
680   TH1F* hPt1 = static_cast<TH1F*>(fHistList->FindObject("fTpcPt1")); // all accepted
681
682   TH1F* hPt2 = static_cast<TH1F*>(fHistList->FindObject("fTpcPt2")); // GetTPCInnerParam
683   TH1F* hPt3 = static_cast<TH1F*>(fHistList->FindObject("fTpcPt3")); // GetTPCInnerParam A
684
685   fEsdTracks = 0;  
686   fEsdTracksA = 0;  
687   fTpcTracks = 0;  
688   fTpcTracksA = 0;  
689   
690   // -----------------------------------------------------------------
691   for (Int_t idx = 0; idx < fESDEvent->GetNumberOfTracks(); idx++) {
692
693     // -- check  track
694     AliESDtrack* esdTrack = fESDEvent->GetTrack(idx);
695     if (!esdTrack) continue;
696
697     ++fEsdTracks;
698     hPt0->Fill(esdTrack->Pt());
699     
700     //______________________________________________
701     if (!fESDTrackCuts->AcceptTrack(esdTrack)) continue;
702     ++fEsdTracksA;
703
704     hPt1->Fill(esdTrack->Pt());
705   }
706   // -----------------------------------------------------------------
707   for (Int_t idx = 0; idx < fESDEvent->GetNumberOfTracks(); idx++) {
708
709     // -- check  track
710     AliESDtrack* esdTrack = fESDEvent->GetTrack(idx);
711     if (!esdTrack) continue;
712
713     // -- TPC only
714     const AliExternalTrackParam *tpcTrack = esdTrack->GetTPCInnerParam();
715     if (!tpcTrack) continue;
716     ++fTpcTracks;
717     hPt2->Fill(tpcTrack->Pt());
718     
719     //______________________________________________
720     if (!fESDTrackCuts->AcceptTrack(esdTrack)) continue;
721     ++fTpcTracksA;
722
723     hPt3->Fill(tpcTrack->Pt());
724   }
725   // -----------------------------------------------------------------
726
727   (static_cast<TH1F*>(fHistList->FindObject("fTpcNch0")))->Fill(fEsdTracks);
728   (static_cast<TH1F*>(fHistList->FindObject("fTpcNch1")))->Fill(fEsdTracksA);
729   (static_cast<TH1F*>(fHistList->FindObject("fTpcNch2")))->Fill(fTpcTracks);
730   (static_cast<TH1F*>(fHistList->FindObject("fTpcNch3")))->Fill(fTpcTracksA);
731
732   return iResult;
733 }
734
735 //##################################################################################
736 Int_t AliHLTMultiplicityCorrelations::ProcessVZERO() {
737   // see header file for class documentation  
738
739   Int_t iResult = 0 ;
740
741   fVzeroMultA = fESDVZERO->GetMTotV0A();
742   fVzeroMultC = fESDVZERO->GetMTotV0C();
743   fVzeroMult  = fVzeroMultA + fVzeroMultC;
744
745   (static_cast<TH1F*>(fHistList->FindObject("fVzeroMult")))->Fill(fVzeroMult);
746   (static_cast<TH1F*>(fHistList->FindObject("fVzeroMultA")))->Fill(fVzeroMultA);
747   (static_cast<TH1F*>(fHistList->FindObject("fVzeroMultC")))->Fill(fVzeroMultC);
748   
749   fVzeroMultFlaggedA = 0.;
750   fVzeroMultFlaggedC = 0.;
751   
752   Double_t vzeroTimeA = 0.;
753   Double_t vzeroTimeC = 0.;
754   
755   Double_t vzeroAdcA = 0.;
756   Double_t vzeroAdcC = 0.;
757   
758   for (Int_t idx = 0; idx < 32; idx++) {
759     
760     if ( fESDVZERO->GetBBFlag(idx) )
761       fVzeroMultFlaggedC += fESDVZERO->GetMultiplicityV0C(idx);
762     if ( fESDVZERO->GetBBFlag(idx+32) )
763       fVzeroMultFlaggedA += fESDVZERO->GetMultiplicityV0A(idx);
764     
765     vzeroTimeA += fESDVZERO->GetTimeV0A(idx);
766     vzeroTimeC += fESDVZERO->GetTimeV0C(idx);
767     
768     vzeroAdcA += fESDVZERO->GetAdcV0A(idx);
769     vzeroAdcC += fESDVZERO->GetAdcV0C(idx);
770   }
771
772   fVzeroMultFlagged = fVzeroMultFlaggedA + fVzeroMultFlaggedC;
773
774   Double_t vzeroTime     = vzeroTimeA + vzeroTimeC;
775   Double_t vzeroAdc      = vzeroAdcA + vzeroAdcC;
776   
777   (static_cast<TH1F*>(fHistList->FindObject("fVzeroFlaggedMult")))->Fill(fVzeroMultFlagged);
778   (static_cast<TH1F*>(fHistList->FindObject("fVzeroFlaggedMultA")))->Fill(fVzeroMultFlaggedA);
779   (static_cast<TH1F*>(fHistList->FindObject("fVzeroFlaggedMultC")))->Fill(fVzeroMultFlaggedC);
780   
781   (static_cast<TH1F*>(fHistList->FindObject("fVzeroTime")))->Fill(vzeroTime);
782   (static_cast<TH1F*>(fHistList->FindObject("fVzeroTimeA")))->Fill(vzeroTimeA);
783   (static_cast<TH1F*>(fHistList->FindObject("fVzeroTimeC")))->Fill(vzeroTimeC);
784   
785   (static_cast<TH1F*>(fHistList->FindObject("fVzeroADC")))->Fill(vzeroAdc);
786   (static_cast<TH1F*>(fHistList->FindObject("fVzeroADCA")))->Fill(vzeroAdcA);
787   (static_cast<TH1F*>(fHistList->FindObject("fVzeroADCC")))->Fill(vzeroAdcC);
788
789   // -- VZERO - TPC correlations
790   if (fESDEvent->GetNumberOfTracks() > 0) {
791     (static_cast<TH2F*>(fHistList->FindObject("fCorrVzeroNch")))->Fill(fVzeroMult, fTpcTracksA);
792     (static_cast<TH2F*>(fHistList->FindObject("fCorrVzeroANch")))->Fill(fVzeroMultA, fTpcTracksA);
793     (static_cast<TH2F*>(fHistList->FindObject("fCorrVzeroCNch")))->Fill(fVzeroMultC, fTpcTracksA);
794     
795     (static_cast<TH2F*>(fHistList->FindObject("fCorrVzeroFNch")))->Fill(fVzeroMultFlagged, fTpcTracksA);
796     (static_cast<TH2F*>(fHistList->FindObject("fCorrVzeroFANch")))->Fill(fVzeroMultFlaggedA, fTpcTracksA);
797     (static_cast<TH2F*>(fHistList->FindObject("fCorrVzeroFCNch")))->Fill(fVzeroMultFlaggedC, fTpcTracksA);
798   }
799
800   // -- VZERO - SPD correlations
801   if (fESDEvent->GetNumberOfTracks() > 0) {
802     (static_cast<TH2F*>(fHistList->FindObject("fCorrVzeroSpd")))->Fill(fVzeroMult, fSpdNClusters);
803     (static_cast<TH2F*>(fHistList->FindObject("fCorrVzeroASpd")))->Fill(fVzeroMultA, fSpdNClusters);
804     (static_cast<TH2F*>(fHistList->FindObject("fCorrVzeroCSpd")))->Fill(fVzeroMultC, fSpdNClusters);
805     
806     (static_cast<TH2F*>(fHistList->FindObject("fCorrVzeroFSpd")))->Fill(fVzeroMultFlagged, fSpdNClusters);
807     (static_cast<TH2F*>(fHistList->FindObject("fCorrVzeroFASpd")))->Fill(fVzeroMultFlaggedA, fSpdNClusters);
808     (static_cast<TH2F*>(fHistList->FindObject("fCorrVzeroFCSpd")))->Fill(fVzeroMultFlaggedC, fSpdNClusters);
809   }
810   
811   // -- VZERO - CALO correlations
812   if (fProcessPhos || fProcessEmcal) {
813     (static_cast<TH2F*>(fHistList->FindObject("fCorrVzerovsTotEt")))->Fill(fVzeroMult, fPhosTotalEt + fEmcalTotalEt);
814     (static_cast<TH2F*>(fHistList->FindObject("fCorrVzeroFlaggedvsTotEt")))->Fill(fVzeroMultFlagged, fPhosTotalEt + fEmcalTotalEt);
815     if(fProcessPhos)
816     {
817       (static_cast<TH2F*>(fHistList->FindObject("fCorrVzerovsPhosTotEt")))->Fill(fVzeroMult, fPhosTotalEt);
818       (static_cast<TH2F*>(fHistList->FindObject("fCorrVzeroFlaggedvsPhosTotEt")))->Fill(fVzeroMultFlagged, fPhosTotalEt);
819     }
820     if(fProcessEmcal)
821     {
822       (static_cast<TH2F*>(fHistList->FindObject("fCorrVzerovsEmcalTotEt")))->Fill(fVzeroMult, fEmcalTotalEt);
823       (static_cast<TH2F*>(fHistList->FindObject("fCorrVzeroFlaggedvsEmcalTotEt")))->Fill(fVzeroMultFlagged, fEmcalTotalEt);
824     }
825   }
826   return iResult;
827 }
828
829 //##################################################################################
830 Int_t AliHLTMultiplicityCorrelations::ProcessZDC() {
831   // see header file for class documentation  
832
833   Int_t iResult = 0 ;
834
835   Double_t zdcEznA = fESDZDC->GetZDCN2Energy() / 1000.;
836   Double_t zdcEznC = fESDZDC->GetZDCN1Energy() / 1000.;
837   Double_t zdcEzn  = zdcEznA + zdcEznC;
838   
839   (static_cast<TH1F*>(fHistList->FindObject("fZdcEzn")))->Fill(zdcEzn);
840   (static_cast<TH1F*>(fHistList->FindObject("fZdcEznA")))->Fill(zdcEznA);
841   (static_cast<TH1F*>(fHistList->FindObject("fZdcEznC")))->Fill(zdcEznC);
842   
843   Double_t zdcEzpA = fESDZDC->GetZDCP2Energy() / 1000.;
844   Double_t zdcEzpC = fESDZDC->GetZDCP1Energy() / 1000.;
845   Double_t zdcEzp  = zdcEzpA + zdcEzpC;
846   
847   (static_cast<TH1F*>(fHistList->FindObject("fZdcEzp")))->Fill(zdcEzp);
848   (static_cast<TH1F*>(fHistList->FindObject("fZdcEzpA")))->Fill(zdcEzpA);
849   (static_cast<TH1F*>(fHistList->FindObject("fZdcEzpC")))->Fill(zdcEzpC);
850   
851   Double_t zdcEA = (zdcEznA + zdcEzpA);
852   Double_t zdcEC = (zdcEznC + zdcEzpC);
853   Double_t zdcE = zdcEA + zdcEC;
854   
855   (static_cast<TH1F*>(fHistList->FindObject("fZdcEzdc")))->Fill(zdcE);
856   (static_cast<TH1F*>(fHistList->FindObject("fZdcEzdcA")))->Fill(zdcEA);
857   (static_cast<TH1F*>(fHistList->FindObject("fZdcEzdcC")))->Fill(zdcEC);
858   
859   Double_t zdcEzemA = fESDZDC->GetZDCEMEnergy(1) / 1000.;
860   Double_t zdcEzemC = fESDZDC->GetZDCEMEnergy(0) / 1000.;
861   Double_t zdcEzem  = zdcEzemA + zdcEzemC;
862   
863   (static_cast<TH1F*>(fHistList->FindObject("fZdcEzem")))->Fill(zdcEzem);
864   (static_cast<TH1F*>(fHistList->FindObject("fZdcEzemA")))->Fill(zdcEzemA);
865   (static_cast<TH1F*>(fHistList->FindObject("fZdcEzemC")))->Fill(zdcEzemC);
866  
867   (static_cast<TH2F*>(fHistList->FindObject("fZdcEzemEzdc")))->Fill(zdcEzem, zdcE);
868   (static_cast<TH2F*>(fHistList->FindObject("fZdcEzemEzdcA")))->Fill(zdcEzemA, zdcEA);
869   (static_cast<TH2F*>(fHistList->FindObject("fZdcEzemEzdcC")))->Fill(zdcEzemC, zdcEC);
870  
871   (static_cast<TH1F*>(fHistList->FindObject("fZdcNpart")))->Fill(fESDZDC->GetZDCParticipants());
872   (static_cast<TH1F*>(fHistList->FindObject("fZdcNpartA")))->Fill(fESDZDC->GetZDCPartSideA());
873   (static_cast<TH1F*>(fHistList->FindObject("fZdcNpartC")))->Fill(fESDZDC->GetZDCPartSideC());
874   
875   (static_cast<TH1F*>(fHistList->FindObject("fZdcB")))->Fill(fESDZDC->GetImpactParameter());
876   (static_cast<TH1F*>(fHistList->FindObject("fZdcBA")))->Fill(fESDZDC->GetImpactParamSideA());
877   (static_cast<TH1F*>(fHistList->FindObject("fZdcBC")))->Fill(fESDZDC->GetImpactParamSideC());
878  
879   // -- ZDC - TPC correlations
880   if (fESDEvent->GetNumberOfTracks() > 0) {
881     (static_cast<TH2F*>(fHistList->FindObject("fCorrEzdcNch")))->Fill(zdcE, fTpcTracksA);
882     (static_cast<TH2F*>(fHistList->FindObject("fCorrEzdcANch")))->Fill(zdcEA, fTpcTracksA);
883     (static_cast<TH2F*>(fHistList->FindObject("fCorrEzdcCNch")))->Fill(zdcEC, fTpcTracksA);
884     
885     (static_cast<TH2F*>(fHistList->FindObject("fCorrEzemNch")))->Fill(zdcEzem, fTpcTracksA);
886     (static_cast<TH2F*>(fHistList->FindObject("fCorrEzemANch")))->Fill(zdcEzemA, fTpcTracksA);
887     (static_cast<TH2F*>(fHistList->FindObject("fCorrEzemCNch")))->Fill(zdcEzemC, fTpcTracksA);
888     
889     (static_cast<TH2F*>(fHistList->FindObject("fCorrEzpNch")))->Fill(zdcEzp, fTpcTracksA);
890     (static_cast<TH2F*>(fHistList->FindObject("fCorrEzpANch")))->Fill(zdcEzpA, fTpcTracksA);
891     (static_cast<TH2F*>(fHistList->FindObject("fCorrEzpCNch")))->Fill(zdcEzpC, fTpcTracksA);
892     
893     (static_cast<TH2F*>(fHistList->FindObject("fCorrEznNch")))->Fill(zdcEzn, fTpcTracksA);
894     (static_cast<TH2F*>(fHistList->FindObject("fCorrEznANch")))->Fill(zdcEznA, fTpcTracksA);
895     (static_cast<TH2F*>(fHistList->FindObject("fCorrEznCNch")))->Fill(zdcEznC, fTpcTracksA);
896     
897     (static_cast<TH2F*>(fHistList->FindObject("fCorrZdcNpartNch")))->Fill(fESDZDC->GetZDCParticipants(), fTpcTracksA);
898     (static_cast<TH2F*>(fHistList->FindObject("fCorrZdcNpartANch")))->Fill(fESDZDC->GetZDCPartSideA(),   fTpcTracksA);
899     (static_cast<TH2F*>(fHistList->FindObject("fCorrZdcNpartCNch")))->Fill(fESDZDC->GetZDCPartSideC(),   fTpcTracksA);
900     
901     (static_cast<TH2F*>(fHistList->FindObject("fCorrZdcbNch")))->Fill(fESDZDC->GetImpactParameter(),   fTpcTracksA);
902     (static_cast<TH2F*>(fHistList->FindObject("fCorrZdcbANch")))->Fill(fESDZDC->GetImpactParamSideA(), fTpcTracksA);
903     (static_cast<TH2F*>(fHistList->FindObject("fCorrZdcbCNch")))->Fill(fESDZDC->GetImpactParamSideC(), fTpcTracksA);
904   }
905   
906   // -- ZDC - SPD correlations
907   (static_cast<TH2F*>(fHistList->FindObject("fCorrEzdcSpd")))->Fill(zdcE, fSpdNClusters);
908   (static_cast<TH2F*>(fHistList->FindObject("fCorrEzdcASpd")))->Fill(zdcEA, fSpdNClusters);
909   (static_cast<TH2F*>(fHistList->FindObject("fCorrEzdcCSpd")))->Fill(zdcEC, fSpdNClusters);
910     
911
912   // -- VZERO - ZDC correlations
913   if (fESDVZERO) {
914     (static_cast<TH2F*>(fHistList->FindObject("fCorrEzdcVzero")))->Fill(zdcE, fVzeroMult);
915     (static_cast<TH2F*>(fHistList->FindObject("fCorrEzdcVzeroA")))->Fill(zdcEA, fVzeroMultA);
916     (static_cast<TH2F*>(fHistList->FindObject("fCorrEzdcVzeroC")))->Fill(zdcEC, fVzeroMultC);
917     
918     (static_cast<TH2F*>(fHistList->FindObject("fCorrEzemVzero")))->Fill(zdcEzem, fVzeroMult);
919     (static_cast<TH2F*>(fHistList->FindObject("fCorrEzemVzeroA")))->Fill(zdcEzemA, fVzeroMultA);
920     (static_cast<TH2F*>(fHistList->FindObject("fCorrEzemVzeroC")))->Fill(zdcEzemC, fVzeroMultC);
921     
922     (static_cast<TH2F*>(fHistList->FindObject("fCorrEzpVzero")))->Fill(zdcEzp, fVzeroMult);
923     (static_cast<TH2F*>(fHistList->FindObject("fCorrEzpVzeroA")))->Fill(zdcEzpA, fVzeroMultA);
924     (static_cast<TH2F*>(fHistList->FindObject("fCorrEzpVzeroC")))->Fill(zdcEzpC, fVzeroMultC);
925     
926     (static_cast<TH2F*>(fHistList->FindObject("fCorrEznVzero")))->Fill(zdcEzn, fVzeroMult);
927     (static_cast<TH2F*>(fHistList->FindObject("fCorrEznVzeroA")))->Fill(zdcEznA, fVzeroMultA);
928     (static_cast<TH2F*>(fHistList->FindObject("fCorrEznVzeroC")))->Fill(zdcEznC, fVzeroMultC);
929     
930     (static_cast<TH2F*>(fHistList->FindObject("fCorrZdcNpartVzero")))->Fill(fESDZDC->GetZDCParticipants(), fVzeroMult);
931     (static_cast<TH2F*>(fHistList->FindObject("fCorrZdcNpartVzeroA")))->Fill(fESDZDC->GetZDCPartSideA(),   fVzeroMultA);
932     (static_cast<TH2F*>(fHistList->FindObject("fCorrZdcNpartVzeroC")))->Fill(fESDZDC->GetZDCPartSideC(),   fVzeroMultC);
933     
934     (static_cast<TH2F*>(fHistList->FindObject("fCorrZdcbVzero")))->Fill(fESDZDC->GetImpactParameter(),   fVzeroMult);
935     (static_cast<TH2F*>(fHistList->FindObject("fCorrZdcbVzeroA")))->Fill(fESDZDC->GetImpactParamSideA(), fVzeroMultA);
936     (static_cast<TH2F*>(fHistList->FindObject("fCorrZdcbVzeroC")))->Fill(fESDZDC->GetImpactParamSideC(), fVzeroMultC);
937
938     // -- -- -- -- 
939
940     (static_cast<TH2F*>(fHistList->FindObject("fCorrEzdcVzeroF")))->Fill(zdcE, fVzeroMultFlagged);
941     (static_cast<TH2F*>(fHistList->FindObject("fCorrEzdcVzeroFA")))->Fill(zdcEA, fVzeroMultFlaggedA);
942     (static_cast<TH2F*>(fHistList->FindObject("fCorrEzdcVzeroFC")))->Fill(zdcEC, fVzeroMultFlaggedC);
943     
944     (static_cast<TH2F*>(fHistList->FindObject("fCorrEzemVzeroF")))->Fill(zdcEzem, fVzeroMultFlagged);
945     (static_cast<TH2F*>(fHistList->FindObject("fCorrEzemVzeroFA")))->Fill(zdcEzemA, fVzeroMultFlaggedA);
946     (static_cast<TH2F*>(fHistList->FindObject("fCorrEzemVzeroFC")))->Fill(zdcEzemC, fVzeroMultFlaggedC);
947     
948     (static_cast<TH2F*>(fHistList->FindObject("fCorrEzpVzeroF")))->Fill(zdcEzp, fVzeroMultFlagged);
949     (static_cast<TH2F*>(fHistList->FindObject("fCorrEzpVzeroFA")))->Fill(zdcEzpA, fVzeroMultFlaggedA);
950     (static_cast<TH2F*>(fHistList->FindObject("fCorrEzpVzeroFC")))->Fill(zdcEzpC, fVzeroMultFlaggedC);
951     
952     (static_cast<TH2F*>(fHistList->FindObject("fCorrEznVzeroF")))->Fill(zdcEzn, fVzeroMultFlagged);
953     (static_cast<TH2F*>(fHistList->FindObject("fCorrEznVzeroFA")))->Fill(zdcEznA, fVzeroMultFlaggedA);
954     (static_cast<TH2F*>(fHistList->FindObject("fCorrEznVzeroFC")))->Fill(zdcEznC, fVzeroMultFlaggedC);
955     
956     (static_cast<TH2F*>(fHistList->FindObject("fCorrZdcNpartVzero")))->Fill(fESDZDC->GetZDCParticipants(), fVzeroMultFlagged);
957     (static_cast<TH2F*>(fHistList->FindObject("fCorrZdcNpartVzeroFA")))->Fill(fESDZDC->GetZDCPartSideA(),   fVzeroMultFlaggedA);
958     (static_cast<TH2F*>(fHistList->FindObject("fCorrZdcNpartVzeroFC")))->Fill(fESDZDC->GetZDCPartSideC(),   fVzeroMultFlaggedC);
959     
960     (static_cast<TH2F*>(fHistList->FindObject("fCorrZdcbVzeroF")))->Fill(fESDZDC->GetImpactParameter(),   fVzeroMultFlagged);
961     (static_cast<TH2F*>(fHistList->FindObject("fCorrZdcbVzeroFA")))->Fill(fESDZDC->GetImpactParamSideA(), fVzeroMultFlaggedA);
962     (static_cast<TH2F*>(fHistList->FindObject("fCorrZdcbVzeroFC")))->Fill(fESDZDC->GetImpactParamSideC(), fVzeroMultFlaggedC);
963   }
964
965   // -- ZDC - CALO correlations
966   if (fProcessPhos || fProcessEmcal) {
967     (static_cast<TH2F*>(fHistList->FindObject("fCorrZdcTotEvsTotEt")))->Fill(zdcE, fPhosTotalEt + fEmcalTotalEt);
968     if(fProcessPhos)
969     {
970       (static_cast<TH2F*>(fHistList->FindObject("fCorrZdcTotEvsPhosTotEt")))->Fill(zdcE, fPhosTotalEt);
971     }
972     if(fProcessEmcal)
973     {
974       (static_cast<TH2F*>(fHistList->FindObject("fCorrZdcTotEvsEmcalTotEt")))->Fill(zdcE, fEmcalTotalEt);
975     }
976   }
977
978   return iResult;
979 }
980
981 //##################################################################################
982 Int_t AliHLTMultiplicityCorrelations::ProcessCALO() {
983   // see header file for class documentation  
984   
985   TH1F* hPhosEt = static_cast<TH1F*>(fHistList->FindObject("fPhosEt")); // PHOS Tot E_T
986   TH1F* hEmcalEt = static_cast<TH1F*>(fHistList->FindObject("fEmcalEt")); // EMCAL Tot E_T
987   TH1F* hTotalEt = static_cast<TH1F*>(fHistList->FindObject("fTotalEt")); // CALO Tot E_T
988   
989   fPhosTotalEt = 0;
990   fEmcalTotalEt = 0;
991   
992   for(Int_t cl = 0; cl < fESDEvent->GetNumberOfCaloClusters(); cl++)
993   {
994     
995     AliESDCaloCluster *cluster = fESDEvent->GetCaloCluster(cl);
996     if(cluster->IsPHOS() && fProcessPhos)
997     {
998       fPhosTotalEt += cluster->E();
999     }
1000     if(cluster->IsEMCAL() && fProcessEmcal)
1001     {
1002       fEmcalTotalEt += cluster->E();
1003     }
1004   }
1005
1006   if(hPhosEt)hPhosEt->Fill(fPhosTotalEt);
1007   if(hEmcalEt)hEmcalEt->Fill(fEmcalTotalEt);
1008   if(hTotalEt)hTotalEt->Fill(fPhosTotalEt + fEmcalTotalEt);
1009   
1010   return 0;
1011 }
1012
1013 //##################################################################################
1014 Int_t AliHLTMultiplicityCorrelations::ProcessSPD() {
1015   // see header file for class documentation
1016   
1017   (static_cast<TH2F*>(fHistList->FindObject("fSpdNClusters")))->Fill(fSpdNClusters);
1018   (static_cast<TH2F*>(fHistList->FindObject("fCorrSpdTpcNch")))->Fill(fSpdNClusters,fTpcTracksA);
1019
1020   return 0;
1021 }