AliPhysics  a0db429 (a0db429)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
AliAnalysisTaskEMCALTriggerQA.cxx
Go to the documentation of this file.
1  /**************************************************************************
2  * Copyright(c) 1998-1999, 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 
16 #include <TList.h>
17 #include <TH2F.h>
18 #include <TF1.h>
19 #include <TProfile2D.h>
20 #include <TStreamerInfo.h>
21 #include <TFile.h>
22 
23 #include "AliLog.h"
24 #include "AliVCluster.h"
25 #include "AliVCaloCells.h"
26 #include "AliVEvent.h"
27 #include "AliCentrality.h"
28 
29 #include "AliVEvent.h"
30 #include "AliVCaloTrigger.h"
31 #include "AliESDVZERO.h"
32 
33 #include "AliEMCALGeometry.h"
34 #include "AliEMCALRecoUtils.h"
35 #include "AliOADBContainer.h"
36 #include "AliAnalysisManager.h"
37 
39 
43 
44 //______________________________________________________________________________
47 //______________________________________________________________________________
49 AliAnalysisTaskSE(),
50 fOutputList(0), fRecoUtils(0x0),
51 fGeoSet(0), fGeometry(0), fGeoName(""),
52 fOADBSet(kFALSE), fAccessOADB(kTRUE), fOADBFilePath(""),
53 fBitEGA(0), fBitEJE(0),
54 fEtaPhiEnMin(2.),
55 fSTUTotal(0), fTRUTotal(0),
56 fV0Trigger(0), fV0A(0), fV0C(0),
57 fFillV0SigHisto(0), fFillCenHisto(0), fFillClusAcceptHisto(0),
58 fMCData(kFALSE),
59 fFirstSM (0), fLastSM (0),
60 fCentEstimator("V0M"),
61 fEventMB (0),
62 fEventL0 (0), fEventL0D (0),
63 fEventL1G (0), fEventL1GD (0),
64 fEventL1G2 (0), fEventL1G2D(0),
65 fEventL1J (0), fEventL1JD (0),
66 fEventL1J2 (0), fEventL1J2D(0),
67 fEventCen (0), fEventSem (0),
68 fMomentum(),
69 //Histograms
70 fhNEvents(0), fhFORAmp(0),
71 fhFORAmpL1G(0), fhFORAmpL1G2(0),
72 fhFORAmpL1J(0), fhFORAmpL1J2(0),
73 fhL0Amp(0), fhL0AmpL1G(0), fhL0AmpL1J(0),
74 fhL1Amp(0), fhL1GAmp(0), fhL1G2Amp(0),
75 fhL1JAmp(0), fhL1J2Amp(0), fhL1FOREnergy(0),
76 fhL0Patch(0), fhL1GPatch(0), fhL1G2Patch(0),
77 fhL1GPatchNotFake(0), fhL1GPatchFake(0), fhL1GPatchNotAllFake(0),
78 fhL1GPatchAllFake(0), fhL1GPatchNotAllFakeMax(0),
79 fhL1GPatchAllFakeMax(0), fhL1GPatchNotAllFakeMaxE(0),
80 fhL1GPatchAllFakeMaxE(0), fhL1GPatchNotAllFakeE(0),
81 fhL1GPatchAllFakeE(0), fhL1GPatchFakeE(0),
82 fhL1GPatchNotFakeE(0), fhNPatchFake(0), fhNPatchNotFake(0),
83 fhL1JPatch(0), fhL1J2Patch(0),
84 fhFEESTU(0), fhTRUSTU(0), fhV0STU(0),
85 fhGPMaxVV0TT(0), fhJPMaxVV0TT(0),
86 fhFORMeanAmp(0), fhL0MeanAmp(0), fhL1MeanAmp(0),
87 fhL1GPatchMax(0), fhL1G2PatchMax(0),
88 fhL1JPatchMax(0), fhL1J2PatchMax(0),
89 //Histogram settings
90 fNBinsSTUSignal (300), fMaxSTUSignal (30000),
91 fNBinsTRUSignal (300), fMaxTRUSignal (30000),
92 fNBinsV0Signal (300), fMaxV0Signal (30000),
93 fNBinsSTUFEERatio(300), fMaxSTUFEERatio(100),
94 fNBinsSTUTRURatio(300), fMaxSTUTRURatio(100),
95 fNBinsClusterE (100), fMaxClusterE (50),
96 fNBinsClusterPhi (250), fMaxClusterPhi (5.71), fMinClusterPhi (1.39),
97 fNBinsClusterEta (96), fMaxClusterEta (0.7),
98 fMapCell (),
99 fMapCellL1G (), fMapCellL1G2 (),
100 fMapCellL1J (), fMapCellL1J2 (),
101 fMapTrigL0 (), fMapTrigL1 (),
102 fMapTrigL0L1G(), fMapTrigL0L1J(),
103 fMapTrigL1G (), fMapTrigL1G2 (),
104 fMapTrigL1J (), fMapTrigL1J2 ()
105 {
107 }
108 
109 //______________________________________________________________________________
111 //______________________________________________________________________________
113 AliAnalysisTaskSE(name),
114 fOutputList(0), fRecoUtils(0x0),
115 fGeoSet(0), fGeometry(0), fGeoName(""),
116 fOADBSet(kFALSE), fAccessOADB(kTRUE), fOADBFilePath(""),
117 fBitEGA(0), fBitEJE(0),
118 fEtaPhiEnMin(2.),
119 fSTUTotal(0), fTRUTotal(0),
120 fV0Trigger(0), fV0A(0), fV0C(0),
121 fFillV0SigHisto(0), fFillCenHisto(0), fFillClusAcceptHisto(0),
122 fMCData(kFALSE),
123 fFirstSM (0), fLastSM (0),
124 fCentEstimator("V0M"),
125 fEventMB (0),
126 fEventL0 (0), fEventL0D (0),
127 fEventL1G (0), fEventL1GD (0),
128 fEventL1G2 (0), fEventL1G2D(0),
129 fEventL1J (0), fEventL1JD (0),
130 fEventL1J2 (0), fEventL1J2D(0),
131 fEventCen (0), fEventSem (0),
132 fMomentum(),
133 //Histograms
134 fhNEvents(0), fhFORAmp(0),
135 fhFORAmpL1G(0), fhFORAmpL1G2(0),
136 fhFORAmpL1J(0), fhFORAmpL1J2(0),
137 fhL0Amp(0), fhL0AmpL1G(0), fhL0AmpL1J(0),
138 fhL1Amp(0), fhL1GAmp(0), fhL1G2Amp(0),
139 fhL1JAmp(0), fhL1J2Amp(0), fhL1FOREnergy(0),
140 fhL0Patch(0), fhL1GPatch(0), fhL1G2Patch(0),
141 fhL1GPatchNotFake(0), fhL1GPatchFake(0), fhL1GPatchNotAllFake(0),
142 fhL1GPatchAllFake(0), fhL1GPatchNotAllFakeMax(0),
143 fhL1GPatchAllFakeMax(0), fhL1GPatchNotAllFakeMaxE(0),
144 fhL1GPatchAllFakeMaxE(0), fhL1GPatchNotAllFakeE(0),
145 fhL1GPatchAllFakeE(0), fhL1GPatchFakeE(0),
146 fhL1GPatchNotFakeE(0), fhNPatchFake(0), fhNPatchNotFake(0),
147 fhL1JPatch(0), fhL1J2Patch(0),
148 fhFEESTU(0), fhTRUSTU(0), fhV0STU(0),
149 fhGPMaxVV0TT(0), fhJPMaxVV0TT(0),
150 fhFORMeanAmp(0), fhL0MeanAmp(0), fhL1MeanAmp(0),
151 fhL1GPatchMax(0), fhL1G2PatchMax(0),
152 fhL1JPatchMax(0), fhL1J2PatchMax(0),
153 //Histogram settings
154 fNBinsSTUSignal (300), fMaxSTUSignal (30000),
155 fNBinsTRUSignal (300), fMaxTRUSignal (30000),
156 fNBinsV0Signal (300), fMaxV0Signal (30000),
157 fNBinsSTUFEERatio(300), fMaxSTUFEERatio(100),
158 fNBinsSTUTRURatio(300), fMaxSTUTRURatio(100),
159 fNBinsClusterE (100), fMaxClusterE (50),
160 fNBinsClusterPhi (250), fMaxClusterPhi (5.71), fMinClusterPhi (1.39),
161 fNBinsClusterEta (96), fMaxClusterEta (0.7),
162 fMapCell (),
163 fMapCellL1G (), fMapCellL1G2 (),
164 fMapCellL1J (), fMapCellL1J2 (),
165 fMapTrigL0 (), fMapTrigL1 (),
166 fMapTrigL0L1G(), fMapTrigL0L1J(),
167 fMapTrigL1G (), fMapTrigL1G2 (),
168 fMapTrigL1J (), fMapTrigL1J2 ()
169 {
171 
172  DefineOutput(1, TList::Class());
173 }
174 
175 //______________________________________________
177 //______________________________________________
179 {
180  // Set it only once
181  if(fOADBSet) return ;
182 
183  if(fOADBFilePath == "") fOADBFilePath = "$ALICE_PHYSICS/OADB/EMCAL" ;
184 
185  Int_t runnumber = InputEvent()->GetRunNumber() ;
186 
187  AliInfo(Form("Get AODB parameters from EMCAL in %s for run %d",fOADBFilePath.Data(),runnumber));
188 
189  Int_t nSM = fGeometry->GetNumberOfSuperModules();
190 
191  // Bad map
192  if(fRecoUtils->IsBadChannelsRemovalSwitchedOn())
193  {
194  AliOADBContainer *contBC=new AliOADBContainer("");
195  contBC->InitFromFile(Form("%s/EMCALBadChannels.root",fOADBFilePath.Data()),"AliEMCALBadChannels");
196 
197  TObjArray *arrayBC=(TObjArray*)contBC->GetObject(runnumber);
198 
199  if(arrayBC)
200  {
201  AliInfo("Remove EMCAL bad cells");
202 
203  for (Int_t i=0; i<nSM; ++i)
204  {
205  TH2I *hbm = fRecoUtils->GetEMCALChannelStatusMap(i);
206 
207  if (hbm)
208  delete hbm;
209 
210  hbm=(TH2I*)arrayBC->FindObject(Form("EMCALBadChannelMap_Mod%d",i));
211  if (!hbm)
212  {
213  AliError(Form("Can not get EMCALBadChannelMap_Mod%d",i));
214  continue;
215  }
216 
217  hbm->SetDirectory(0);
218  fRecoUtils->SetEMCALChannelStatusMap(i,hbm);
219 
220  //printf("Bad map for SM %d: %3.0f entries\n",i,fRecoUtils->GetEMCALChannelStatusMap(i)->Integral());
221 
222  } // loop
223  } else AliInfo("Do NOT remove EMCAL bad channels"); // run array
224 
225  delete contBC;
226  } // Remove bad
227 
228  fOADBSet = kTRUE;
229 }
230 
231 //________________________________________________
233 //________________________________________________
235 {
236  Int_t posX = -1, posY = -1;
237  Int_t nSupMod = -1, ieta = -1, iphi = -1, nModule = -1, nIphi = -1, nIeta = -1;
238  Short_t absId = -1;
239  Int_t nCells = 0;
240 
241  AliVCaloCells& cells= *(InputEvent()->GetEMCALCells());
242 
243  if(cells.IsEMCAL())
244  {
245  for (Int_t icell = 0; icell < cells.GetNumberOfCells(); icell++)
246  {
247  nCells ++;
248 
249  Double_t amp =0., time = 0., efrac = 0;
250  Int_t mclabel = -1;
251 
252  cells.GetCell(icell, absId, amp, time,mclabel,efrac);
253 
254  fGeometry->GetCellIndex(absId, nSupMod, nModule, nIphi, nIeta);
255  fGeometry->GetCellPhiEtaIndexInSModule(nSupMod, nModule, nIphi, nIeta, iphi, ieta);
256 
257  //
258  // Shift collumns in even SM
259  Int_t shiftEta = AliEMCALGeoParams::fgkEMCALCols;
260 
261  // Shift collumn even more due to smaller acceptance of DCal collumns
262  if ( nSupMod > 11 && nSupMod < 18) shiftEta+=AliEMCALGeoParams::fgkEMCALCols/3;
263 
264  posX = (nSupMod % 2) ? ieta + shiftEta : ieta;
265  posY = iphi + AliEMCALGeoParams::fgkEMCALRows * int(nSupMod / 2);
266 
267  // Shift row less due to smaller acceptance of SM 10 and 11 to count DCal rows
268  if ( nSupMod > 11 && nSupMod < 20) posY -= (2*AliEMCALGeoParams::fgkEMCALRows / 3);
269 
270  Int_t indexX = Int_t(posX/2);
271  Int_t indexY = Int_t(posY/2);
272 
273  if(indexX >= fgkFALTROCols || indexY >= fgkFALTRORows )
274  {
275  AliWarning(Form("Wrong Position (x,y) = (%d,%d)",posX,posY));
276 
277  continue;
278  }
279 
280  // here it is the amplitude for each cell
281  fMapCell[indexY][indexX] += amp;
282 
283  if(fEventL1G || fEventL1GD)
284  {
285  fMapCellL1G[indexY][indexX] += amp;
286  //printf("L1G cell[%i,%i] amp=%f\n",indexY,indexX,fMapCellL1G[indexY][indexX]);
287  }
288 
289  if(fEventL1G2 || fEventL1G2D)
290  {
291  fMapCellL1G2[indexY][indexX] += amp;
292  //printf("L1G2 cell[%i,%i] amp=%f\n",indexY,indexX,fMapCellL1G2[indexY][indexX]);
293  }
294 
295  if(fEventL1J || fEventL1JD) fMapCellL1J [indexY][indexX] += amp;
296  if(fEventL1J2 || fEventL1J2D) fMapCellL1J2[indexY][indexX] += amp;
297 
298  //printf("cell[%i,%i] amp=%f\n",indexY,indexX,fMapCell[indexY][indexX]);
299  }
300  }
301 }
302 
303 //______________________________________________________________________________
305 //______________________________________________________________________________
307 {
308  AliVCaloTrigger& trg= * (InputEvent()->GetCaloTrigger("EMCAL"));
309 
310  fV0Trigger = trg.GetL1V0(0)+trg.GetL1V0(1); // used elsewhere
311 
312  Int_t posX = -1, posY = -1;
313 
314  Int_t nL0Patch = 0 ;
315  //Int_t nL1Patch = 0 ;
316  fSTUTotal = 0;
317  fTRUTotal = 0;
318 
319  trg.Reset();
320  // loop on FASTOR
321 
322  while (trg.Next())
323  {
324  trg.GetPosition(posX,posY);
325 
326  if (posX > -1 && posY > -1)
327  {
328  //L0 analysis
329  Int_t nTimes = 0;
330  trg.GetNL0Times(nTimes);
331  Int_t l0Times[10];
332  trg.GetL0Times(l0Times);
333 
334  Float_t ampL0 = 0.;
335  trg.GetAmplitude(ampL0);
336  if (ampL0 > 0) fMapTrigL0[posY][posX] = ampL0;
337 
338  if(triggerclasses.Contains("CEMC7EGA-B-NOPF-CENTNOTRD") || triggerclasses.Contains("CPBI2EGA") ||
339  triggerclasses.Contains("CPBI2EG1") || triggerclasses.Contains("CINT7EG1-B-NOPF-CENTNOPMD") ||
340  triggerclasses.Contains("CINT7DG1-B-NOPF-CENTNOPMD")) fMapTrigL0L1G[posY][posX] += ampL0;
341 
342  if(triggerclasses.Contains("CEMC7EJE-B-NOPF-CENTNOTRD") || triggerclasses.Contains("CPBI2EJE") ||
343  triggerclasses.Contains("CPBI2EJ1") || triggerclasses.Contains("CINT7EJ1-B-NOPF-CENTNOPMD") ||
344  triggerclasses.Contains("CINT7DJ1-B-NOPF-CENTNOPMD")) fMapTrigL0L1J[posY][posX] += ampL0;
345  fTRUTotal += ampL0;
346 
347  Int_t l0fired = 0;
348  for (Int_t itime = 0; itime < nTimes; itime++)
349  {
350  if (l0Times[itime] > 7 && l0Times[itime] < 10) l0fired = 1;
351  }
352 
353  if (l0fired)
354  {
355  nL0Patch += nTimes;
356  fhL0Patch->Fill(posX,posY);
357  }
358 
359  //L1 analysis
360  Int_t bit = 0;
361  trg.GetTriggerBits(bit);
362 
363  Int_t ts = 0;
364  trg.GetL1TimeSum(ts);
365  if (ts > 0) fMapTrigL1[posY][posX] = ts;
366  fSTUTotal += ts;
367  // cout << "ts =" <<ts<<endl;
368 
369  //L1
370  Bool_t isEGA1 = ((bit >> fBitEGA ) & 0x1) && (fEventL1G || fEventL1GD ) ;
371  Bool_t isEGA2 = ((bit >> (fBitEGA+1)) & 0x1) && (fEventL1G2 || fEventL1G2D) ;
372  Bool_t isEJE1 = ((bit >> fBitEJE ) & 0x1) && (fEventL1J || fEventL1JD ) ;
373  Bool_t isEJE2 = ((bit >> (fBitEJE+1)) & 0x1) && (fEventL1J2 || fEventL1J2D) ;
374 
375  //if(isEGA1 || isEGA2 || isEJE1 || isEJE2) nL1Patch++;
376  //if(isEJE1 || isEJE2) printf("Jet STU patch %d, time sum %d, posX %d , posY %d\n",nL1Patch,ts,posX, posY);
377 
378  // L1-Gamma
379 
380  if (isEGA1)
381  {
382  fhL1GPatch ->Fill(posX,posY);
383  if (ts > 0) fMapTrigL1G [posY][posX] = ts;
384  }
385 
386  if (isEGA2)
387  {
388  fhL1G2Patch->Fill(posX,posY);
389  if (ts > 0) fMapTrigL1G2[posY][posX] = ts;
390  }
391 
392  // L1-Jet
393  if (isEJE1)
394  {
395  fhL1JPatch ->Fill(posX,posY);
396  if (ts > 0) fMapTrigL1J [posY][posX] = ts;
397 
398  }
399 
400  if (isEJE2)
401  {
402  fhL1J2Patch->Fill(posX,posY);
403  if (ts > 0) fMapTrigL1J2[posY][posX] = ts;
404  }
405 
406  }
407  }
408 
409 // // NOT SURE WHY THIS LINE, COMMENT IF NOT CLUSTER HISTO NOT FILLED FOR LHC13
410 // if (!nL0Patch)
411 // {
412 // fEventL0 = kFALSE;
413 // if (!triggerclasses.Contains("CPBI2")) fEventL1G = fEventL1G2 = fEventL1J = fEventL1J2 = kFALSE; // pp running
414 // }
415 
416  if(fTRUTotal > fMaxTRUSignal && DebugLevel() > 0)
417  AliInfo(Form("Large fTRUTotal %f",fTRUTotal));
418 
419  if(fSTUTotal > fMaxSTUSignal && DebugLevel() > 0)
420  AliInfo(Form("Large fSTUTotal %d",fSTUTotal));
421 }
422 
423 //___________________________________________________
426 //___________________________________________________
428 {
429  if(fMCData) return ;
430 
431  // Init OADB
432  if(fAccessOADB) AccessOADB(); // only once
433 
434  //Get Vertex
435  Double_t v[3] = {0,0,0};
436  InputEvent()->GetPrimaryVertex()->GetXYZ(v);
437 
438  //clusters distribution
439  TRefArray* caloClus = new TRefArray();
440  InputEvent()->GetEMCALClusters(caloClus);
441 
442  Int_t nCaloClusters = caloClus->GetEntriesFast();
443 
444  Float_t emax = 0;
445  Float_t etamax = 0;
446  Float_t phimax = 0;
447  Float_t ietamax=-1;
448  Float_t iphimax=-1;
449 
450  Float_t e = 0;
451  Float_t eta = 0;
452  Float_t phi = 0;
453 
454  Int_t nSupMod = -1, nSupModMax = -1, ieta = -1, iphi = -1;
455 
456  //Get vertex for momentum calculation
457  Double_t vertex[] = {0.0,0.0,0.0};
458  //InputEvent()->GetPrimaryVertex()->GetXYZ(vertex);
459 
460  Float_t centrality = -1;
461  if(InputEvent()->GetCentrality()) centrality = InputEvent()->GetCentrality()->GetCentralityPercentile(fCentEstimator);
462 
463  if(fFillCenHisto)
464  {
465  if( fEventL1G ) fhCentrality[kL1GammaTrig] ->Fill(centrality);
466  if( fEventL1G2 ) fhCentrality[kL1GammaTrig2] ->Fill(centrality);
467  if( fEventL1J ) fhCentrality[kL1JetTrig] ->Fill(centrality);
468  if( fEventL1J2 ) fhCentrality[kL1JetTrig2] ->Fill(centrality);
469  if( fEventL1GD ) fhCentrality[kL1GammaTrigD] ->Fill(centrality);
470  if( fEventL1G2D ) fhCentrality[kL1GammaTrig2D] ->Fill(centrality);
471  if( fEventL1JD ) fhCentrality[kL1JetTrigD] ->Fill(centrality);
472  if( fEventL1J2D ) fhCentrality[kL1JetTrig2D] ->Fill(centrality);
473  if( fEventMB ) fhCentrality[kMBTrig] ->Fill(centrality);
474  if( fEventL0 ) fhCentrality[kL0Trig] ->Fill(centrality);
475  if( fEventCen ) fhCentrality[kCentralTrig] ->Fill(centrality);
476  if( fEventSem ) fhCentrality[kSemiCentralTrig]->Fill(centrality);
477  if( fEventL1G && !fEventL1J) fhCentrality[kL1GammaOnlyTrig] ->Fill(centrality);
478  if( fEventL1J && !fEventL1G) fhCentrality[kL1JetOnlyTrig] ->Fill(centrality);
479  if( fEventL1G2 && !fEventL1G) fhCentrality[kL1Gamma2OnlyGammaTrig]->Fill(centrality);
480  if( fEventL1J2 && !fEventL1J) fhCentrality[kL1Jet2OnlyJetTrig] ->Fill(centrality);
481  }
482 
483  //printf("Centrality %f for estimator %s\n",centrality, fCentEstimator.Data());
484 
485  //if(!fEventMB) printf("MB : %d; L0 : %d; L1-Gam1 : %d; L1-Gam2 : %d; L1-Jet1 : %d; L1-Jet2 : %d; Central : %d; SemiCentral : %d \n",
486  // fEventMB,fEventL0,fEventL1G,fEventL1G2,fEventL1J,fEventL1J2,fEventCen,fEventSem);
487 
488  for(Int_t icalo = 0; icalo < nCaloClusters; icalo++)
489  {
490  AliVCluster *clus = (AliVCluster*) (caloClus->At(icalo));
491 
492  if(!clus->IsEMCAL()) continue;
493 
494  if(!fRecoUtils->IsGoodCluster(clus,fGeometry,InputEvent()->GetEMCALCells(),InputEvent()->GetBunchCrossNumber()))
495  continue;
496 
497  if(clus->GetNCells() < 2) continue ; // Avoid 1 cell clusters, noisy, exotic.
498 
499  clus->GetMomentum(fMomentum, vertex);
500 
501  Bool_t shared = kFALSE;
502  Int_t idAbs = -1, iphi0 = -1, ieta0 = -1;
503  fRecoUtils->GetMaxEnergyCell(fGeometry, InputEvent()->GetEMCALCells(),clus,
504  idAbs,nSupMod,ieta0,iphi0,shared);
505 
506  //Change index to be continuous over SM
507  //
508  // Shift collumns in even SM
509  Int_t shiftEta = AliEMCALGeoParams::fgkEMCALCols;
510 
511  // Shift collumn even more due to smaller acceptance of DCal collumns
512  if ( nSupMod > 11 && nSupMod < 18) shiftEta+=AliEMCALGeoParams::fgkEMCALCols/3;
513 
514  ieta = (nSupMod % 2) ? ieta0 + shiftEta : ieta0;
515  iphi = iphi0 + AliEMCALGeoParams::fgkEMCALRows * int(nSupMod / 2);
516 
517  // Shift row less due to smaller acceptance of SM 10 and 11 to count DCal rows
518  if ( nSupMod > 11 && nSupMod < 20) iphi -= (2*AliEMCALGeoParams::fgkEMCALRows / 3);
519 
520  ieta/=2;
521  iphi/=2;
522 
523  if(ieta > fgkFALTROCols || iphi > fgkFALTRORows )
524  AliWarning(Form("Wrong Position (x,y) = (%d,%d)",ieta,iphi));
525 
526  e = clus->E();
527  eta = fMomentum.Eta();
528  phi = fMomentum.Phi();
529  if( phi < 0 ) phi+=TMath::TwoPi();
530 
531  if(e > emax)
532  {
533  emax = e;
534  etamax = eta;
535  phimax = phi;
536  ietamax = ieta;
537  iphimax = iphi;
538  nSupModMax = nSupMod;
539  }
540 
541  // Fill cluster histograms depending on the event trigger selection
542  if( fEventMB ) FillClusterHistograms(kMBTrig ,kFALSE,e,eta,phi,ieta,iphi,nSupMod,centrality,fV0A+fV0C);
543  if( fEventCen ) FillClusterHistograms(kCentralTrig ,kFALSE,e,eta,phi,ieta,iphi,nSupMod,centrality,fV0A+fV0C);
544  if( fEventSem ) FillClusterHistograms(kSemiCentralTrig,kFALSE,e,eta,phi,ieta,iphi,nSupMod,centrality,fV0A+fV0C);
545 
546  if( fEventL0 ) FillClusterHistograms(kL0Trig ,kFALSE,e,eta,phi,ieta,iphi,nSupMod,centrality,fV0A+fV0C);
547  if( fEventL1G ) FillClusterHistograms(kL1GammaTrig ,kFALSE,e,eta,phi,ieta,iphi,nSupMod,centrality,fV0A+fV0C);
548  if( fEventL1G2) FillClusterHistograms(kL1GammaTrig2 ,kFALSE,e,eta,phi,ieta,iphi,nSupMod,centrality,fV0A+fV0C);
549  if( fEventL1J ) FillClusterHistograms(kL1JetTrig ,kFALSE,e,eta,phi,ieta,iphi,nSupMod,centrality,fV0A+fV0C);
550  if( fEventL1J2) FillClusterHistograms(kL1JetTrig2 ,kFALSE,e,eta,phi,ieta,iphi,nSupMod,centrality,fV0A+fV0C);
551 
552  if( fEventL0D ) FillClusterHistograms(kL0TrigD ,kFALSE,e,eta,phi,ieta,iphi,nSupMod,centrality,fV0A+fV0C);
553  if( fEventL1GD ) FillClusterHistograms(kL1GammaTrigD ,kFALSE,e,eta,phi,ieta,iphi,nSupMod,centrality,fV0A+fV0C);
554  if( fEventL1G2D) FillClusterHistograms(kL1GammaTrig2D ,kFALSE,e,eta,phi,ieta,iphi,nSupMod,centrality,fV0A+fV0C);
555  if( fEventL1JD ) FillClusterHistograms(kL1JetTrigD ,kFALSE,e,eta,phi,ieta,iphi,nSupMod,centrality,fV0A+fV0C);
556  if( fEventL1J2D) FillClusterHistograms(kL1JetTrig2D ,kFALSE,e,eta,phi,ieta,iphi,nSupMod,centrality,fV0A+fV0C);
557 
558  if( fEventL0 && !fEventL0D ) FillClusterHistograms(kL0TrigPureEMC , kFALSE,e,eta,phi,ieta,iphi,nSupMod,centrality,fV0A+fV0C);
559  if( !fEventL0 && fEventL0D ) FillClusterHistograms(kL0TrigPureDMC , kFALSE,e,eta,phi,ieta,iphi,nSupMod,centrality,fV0A+fV0C);
560  if( fEventL1G && !fEventL1GD ) FillClusterHistograms(kL1GTrigPureEMC, kFALSE,e,eta,phi,ieta,iphi,nSupMod,centrality,fV0A+fV0C);
561  if( !fEventL1G && fEventL1GD ) FillClusterHistograms(kL1GTrigPureDMC, kFALSE,e,eta,phi,ieta,iphi,nSupMod,centrality,fV0A+fV0C);
562  if( fEventL1J && !fEventL1JD ) FillClusterHistograms(kL1JTrigPureEMC, kFALSE,e,eta,phi,ieta,iphi,nSupMod,centrality,fV0A+fV0C);
563  if( !fEventL1J && fEventL1JD ) FillClusterHistograms(kL1JTrigPureDMC, kFALSE,e,eta,phi,ieta,iphi,nSupMod,centrality,fV0A+fV0C);
564 
565  if( fEventL1G2 && !fEventL1G) FillClusterHistograms(kL1Gamma2OnlyGammaTrig,kFALSE,e,eta,phi,ieta,iphi,nSupMod,centrality,fV0A+fV0C);
566  if( fEventL1J2 && !fEventL1J) FillClusterHistograms(kL1Jet2OnlyJetTrig ,kFALSE,e,eta,phi,ieta,iphi,nSupMod,centrality,fV0A+fV0C);
567 
568  if( fEventL1G2D && !fEventL1GD) FillClusterHistograms(kL1Gamma2OnlyGammaTrigD,kFALSE,e,eta,phi,ieta,iphi,nSupMod,centrality,fV0A+fV0C);
569  if( fEventL1J2D && !fEventL1JD) FillClusterHistograms(kL1Jet2OnlyJetTrigD ,kFALSE,e,eta,phi,ieta,iphi,nSupMod,centrality,fV0A+fV0C);
570 
571 
572  if( fEventL1G && !fEventL1J )
573  FillClusterHistograms (kL1GammaOnlyTrig,kFALSE,e,eta,phi,ieta,iphi,nSupMod,centrality,fV0A+fV0C);
574 
575  if( fEventL1J && !fEventL1G )
576  FillClusterHistograms (kL1JetOnlyTrig ,kFALSE,e,eta,phi,ieta,iphi,nSupMod,centrality,fV0A+fV0C);
577 
578  if( fEventL1GD && !fEventL1JD )
579  FillClusterHistograms (kL1GammaOnlyTrig,kFALSE,e,eta,phi,ieta,iphi,nSupMod,centrality,fV0A+fV0C);
580 
581  if( fEventL1JD && !fEventL1GD )
582  FillClusterHistograms (kL1JetOnlyTrig ,kFALSE,e,eta,phi,ieta,iphi,nSupMod,centrality,fV0A+fV0C);
583 
584  if(!fEventL1G && !fEventL1J && !fEventL0 && !fEventL1GD && !fEventL1JD && !fEventL0D)
585  {
586  if( fEventMB ) fhClusMBPure[0] ->Fill(e);
587  if( fEventCen ) fhClusMBPure[1] ->Fill(e);
588  if( fEventSem ) fhClusMBPure[2] ->Fill(e);
589  }
590 
591  }
592 
593  // Maximum energy cluster per event histograms
594 
595  if( fEventMB ) FillClusterHistograms(kMBTrig ,kTRUE,emax,etamax,phimax,ietamax,iphimax,nSupModMax,centrality,fV0A+fV0C);
596  if( fEventCen ) FillClusterHistograms(kCentralTrig ,kTRUE,emax,etamax,phimax,ietamax,iphimax,nSupModMax,centrality,fV0A+fV0C);
597  if( fEventSem ) FillClusterHistograms(kSemiCentralTrig,kTRUE,emax,etamax,phimax,ietamax,iphimax,nSupModMax,centrality,fV0A+fV0C);
598 
599  if( fEventL0 ) FillClusterHistograms(kL0Trig ,kTRUE,emax,etamax,phimax,ietamax,iphimax,nSupModMax,centrality,fV0A+fV0C);
600  if( fEventL1G ) FillClusterHistograms(kL1GammaTrig ,kTRUE,emax,etamax,phimax,ietamax,iphimax,nSupModMax,centrality,fV0A+fV0C);
601  if( fEventL1G2) FillClusterHistograms(kL1GammaTrig2 ,kTRUE,emax,etamax,phimax,ietamax,iphimax,nSupModMax,centrality,fV0A+fV0C);
602  if( fEventL1J ) FillClusterHistograms(kL1JetTrig ,kTRUE,emax,etamax,phimax,ietamax,iphimax,nSupModMax,centrality,fV0A+fV0C);
603  if( fEventL1J2) FillClusterHistograms(kL1JetTrig2 ,kTRUE,emax,etamax,phimax,ietamax,iphimax,nSupModMax,centrality,fV0A+fV0C);
604 
605  if( fEventL0D ) FillClusterHistograms(kL0TrigD ,kTRUE,emax,etamax,phimax,ietamax,iphimax,nSupModMax,centrality,fV0A+fV0C);
606  if( fEventL1GD ) FillClusterHistograms(kL1GammaTrigD ,kTRUE,emax,etamax,phimax,ietamax,iphimax,nSupModMax,centrality,fV0A+fV0C);
607  if( fEventL1G2D) FillClusterHistograms(kL1GammaTrig2D ,kTRUE,emax,etamax,phimax,ietamax,iphimax,nSupModMax,centrality,fV0A+fV0C);
608  if( fEventL1JD ) FillClusterHistograms(kL1JetTrigD ,kTRUE,emax,etamax,phimax,ietamax,iphimax,nSupModMax,centrality,fV0A+fV0C);
609  if( fEventL1J2D) FillClusterHistograms(kL1JetTrig2D ,kTRUE,emax,etamax,phimax,ietamax,iphimax,nSupModMax,centrality,fV0A+fV0C);
610 
611  if( fEventL0 && !fEventL0D ) FillClusterHistograms(kL0TrigPureEMC , kTRUE,emax,etamax,phimax,ietamax,iphimax,nSupModMax,centrality,fV0A+fV0C);
612  if( !fEventL0 && fEventL0D ) FillClusterHistograms(kL0TrigPureDMC , kTRUE,emax,etamax,phimax,ietamax,iphimax,nSupModMax,centrality,fV0A+fV0C);
613  if( fEventL1G && !fEventL1GD ) FillClusterHistograms(kL1GTrigPureEMC, kTRUE,emax,etamax,phimax,ietamax,iphimax,nSupModMax,centrality,fV0A+fV0C);
614  if( !fEventL1G && fEventL1GD ) FillClusterHistograms(kL1GTrigPureDMC, kTRUE,emax,etamax,phimax,ietamax,iphimax,nSupModMax,centrality,fV0A+fV0C);
615  if( fEventL1J && !fEventL1JD ) FillClusterHistograms(kL1JTrigPureEMC, kTRUE,emax,etamax,phimax,ietamax,iphimax,nSupModMax,centrality,fV0A+fV0C);
616  if( !fEventL1J && fEventL1JD ) FillClusterHistograms(kL1JTrigPureDMC, kTRUE,emax,etamax,phimax,ietamax,iphimax,nSupModMax,centrality,fV0A+fV0C);
617 
618  if( fEventL1G2 && !fEventL1G) FillClusterHistograms(kL1Gamma2OnlyGammaTrig,kTRUE,emax,etamax,phimax,ietamax,iphimax,nSupModMax,centrality,fV0A+fV0C);
619  if( fEventL1J2 && !fEventL1J) FillClusterHistograms(kL1Jet2OnlyJetTrig ,kTRUE,emax,etamax,phimax,ietamax,iphimax,nSupModMax,centrality,fV0A+fV0C);
620 
621  if( fEventL1G2D && !fEventL1GD) FillClusterHistograms(kL1Gamma2OnlyGammaTrigD,kTRUE,emax,etamax,phimax,ietamax,iphimax,nSupModMax,centrality,fV0A+fV0C);
622  if( fEventL1J2D && !fEventL1JD) FillClusterHistograms(kL1Jet2OnlyJetTrigD ,kTRUE,emax,etamax,phimax,ietamax,iphimax,nSupModMax,centrality,fV0A+fV0C);
623 
624  if( fEventL1GD && !fEventL1JD )
625  FillClusterHistograms (kL1GammaOnlyTrigD,kTRUE,emax,etamax,phimax,ietamax,iphimax,nSupModMax,centrality,fV0A+fV0C);
626  if( fEventL1JD && !fEventL1GD )
627  FillClusterHistograms (kL1JetOnlyTrigD ,kTRUE,emax,etamax,phimax,ietamax,iphimax,nSupModMax,centrality,fV0A+fV0C);
628 
629  if(!fEventL1G && !fEventL1J && !fEventL0 && !fEventL1GD && !fEventL1JD && !fEventL0D)
630  {
631  if( fEventMB ) fhClusMaxMBPure[0] ->Fill(emax);
632  if( fEventCen ) fhClusMaxMBPure[1] ->Fill(emax);
633  if( fEventSem ) fhClusMaxMBPure[2] ->Fill(emax);
634  }
635 }
636 
637 //______________________________________________________________________________________________
640 //______________________________________________________________________________________________
641 void AliAnalysisTaskEMCALTriggerQA::FillClusterHistograms(Int_t triggerNumber, Bool_t max,
642  Float_t e, Float_t eta, Float_t phi,
643  Float_t ieta, Float_t iphi, Int_t nSupMod,
644  Float_t centrality, Float_t fV0AC)
645 {
646  if(!max)
647  {
648  fhClus [triggerNumber]->Fill(e);
649  if(fFillCenHisto) fhClusCen[triggerNumber]->Fill(e,centrality);
650  if(fFillV0SigHisto) fhClusV0 [triggerNumber]->Fill(e,fV0AC);
651 
652  if ( nSupMod >= fFirstSM && nSupMod <= fLastSM )
653  {
654  fhClusSM [triggerNumber][nSupMod]->Fill(e);
655  if(fFillCenHisto) fhClusCenSM[triggerNumber][nSupMod]->Fill(e,centrality);
656  if(fFillV0SigHisto) fhClusV0SM [triggerNumber][nSupMod]->Fill(e,fV0AC);
657  }
658 
660  {
661  // just fill 2
662  if(e > fEtaPhiEnMin) fhClusEtaPhiHigh[triggerNumber]->Fill( eta, phi);
663  else fhClusEtaPhiLow [triggerNumber]->Fill( eta, phi);
664  }
665  else
666  {
667  fhClusEta[triggerNumber]->Fill(e,eta);
668  fhClusPhi[triggerNumber]->Fill(e,phi);
669 
670  if(e > fEtaPhiEnMin)
671  {
672  fhClusEtaPhiHigh [triggerNumber]->Fill( eta, phi);
673  fhClusEtaPhiHighCellMax[triggerNumber]->Fill(ieta,iphi);
674  }
675  else
676  {
677  fhClusEtaPhiLow [triggerNumber]->Fill( eta, phi);
678  fhClusEtaPhiLowCellMax[triggerNumber]->Fill(ieta,iphi);
679  }
680  }
681  }
682  else
683  {
684  fhClusMax [triggerNumber]->Fill(e);
685  if(fFillCenHisto) fhClusCenMax[triggerNumber]->Fill(e,centrality);
686  if(fFillV0SigHisto) fhClusV0Max [triggerNumber]->Fill(e,fV0AC);
687 
689  {
690  fhClusEtaMax[triggerNumber]->Fill(e,eta);
691  fhClusPhiMax[triggerNumber]->Fill(e,phi);
692 
693  if(e > fEtaPhiEnMin)
694  {
695  fhClusEtaPhiHighCluMax [triggerNumber]->Fill( eta, phi);
696  fhClusEtaPhiHighCellMaxCluMax[triggerNumber]->Fill(ieta,iphi);
697  }
698  else
699  {
700  fhClusEtaPhiLowCluMax [triggerNumber]->Fill( eta, phi);
701  fhClusEtaPhiLowCellMaxCluMax[triggerNumber]->Fill(ieta,iphi);
702  }
703  }
704  }
705 }
706 
707 //_____________________________________________________________
709 //_____________________________________________________________
711 {
712  Double_t ampFOR[60] = {0.}, ampL0[60] = {0.}, ampL1[60] = {0.};
713  for (Int_t i = 0; i < fgkFALTRORows; i++)
714  {
715  for (Int_t j = 0; j < fgkFALTROCols; j++)
716  {
717  //method to get TRU number
718  Int_t idFOR = -1;
719  fGeometry->GetAbsFastORIndexFromPositionInEMCAL(j,i,idFOR);
720  Int_t iTRU = -1;
721  Int_t iADC = -1;
722  fGeometry->GetTRUFromAbsFastORIndex(idFOR,iTRU,iADC);
723 
724  //printf("i %d, j %d, iTRU %d, iADC %d, idFOR %d; cell %f, L0 %f, L1 %f\n",
725  // i,j,iTRU,iADC,idFOR, fMapCell [i][j],fMapTrigL0[i][j],fMapTrigL1[i][j]);
726 
727  if (iTRU >= 0)
728  {
729  ampFOR[iTRU] += fMapCell [i][j];
730  ampL0[iTRU] += fMapTrigL0[i][j];
731  ampL1[iTRU] += fMapTrigL1[i][j];
732  }
733  }
734  }
735 
736  // FEE vs STU and TRU vs STU ratios
737  for (Int_t i = 0; i < 60; i++)
738  {
739  if (ampFOR[i] != 0 && ampL1[i] != 0)
740  {
741  fhFEESTU->Fill(ampL1[i]/ampFOR[i],i);
742  if(ampL1[i]/ampFOR[i] > fMaxSTUFEERatio && DebugLevel() > 0 )
743  AliWarning(Form("Large STU/FEE ratio %f",ampL1[i]/ampFOR[i]));
744  }
745 
746  if (ampL0[i] != 0 && ampL1[i] != 0)
747  {
748  fhTRUSTU->Fill(ampL1[i]/ampL0[i] ,i);
749  if(ampL1[i]/ampL0[i] > fMaxSTUTRURatio && DebugLevel() > 0 )
750  AliWarning(Form("Large STU/TRU ratio %f",ampL1[i]/ampL0[i]));
751  }
752  }
753 }
754 
755 //_____________________________________________________________
757 //_____________________________________________________________
759 {
760  fhNEvents->Fill(0.5); // All physics events
761 
762  if( fEventMB )
763  {
764  fhNEvents->Fill(1.5);
765  if( !fEventL1G && !fEventL1J && !fEventL1G2 && !fEventL1J2 && !fEventL0 ) fhNEvents->Fill(12.5);
766  }
767  else
768  {
769  if( fEventL0 ) fhNEvents->Fill(13.5);
770  if( fEventL1G ) fhNEvents->Fill(14.5);
771  if( fEventL1J ) fhNEvents->Fill(15.5);
772  }
773 
774  if( fEventCen) fhNEvents->Fill(2.5);
775  if( fEventSem) fhNEvents->Fill(3.5);
776 
777  if( fEventL0 )
778  {
779  fhNEvents->Fill(4.5);
780  }
781 
782  if( fEventL1G )
783  {
784  fhNEvents->Fill(5.5);
785  if(!fEventL1J) fhNEvents->Fill(9.5);
786  if(fEventCen || fEventSem) fhNEvents->Fill(16.5);
787  }
788 
789  if( fEventL1G2 )
790  {
791  fhNEvents->Fill(6.5);
792  if( !fEventL1G ) fhNEvents->Fill(18.5);
793 
794  }
795 
796  if( fEventL1J )
797  {
798  fhNEvents->Fill(7.5);
799  if(!fEventL1G) fhNEvents->Fill(10.5);
800  if(fEventCen || fEventSem) fhNEvents->Fill(17.5);
801  }
802 
803  if( fEventL1J2 )
804  {
805  fhNEvents->Fill(8.5);
806  if( !fEventL1J ) fhNEvents->Fill(19.5);
807  }
808 
809  if(fEventL1J && fEventL1G) fhNEvents->Fill(11.5);
810 
811  if( fEventL0D ) fhNEvents->Fill(20.5);
812  if( fEventL1GD ) fhNEvents->Fill(21.5);
813  if( fEventL1JD ) fhNEvents->Fill(22.5);
814 
815  if( fEventL0 && !fEventL0D ) fhNEvents->Fill(23.5);
816  if( fEventL1G && !fEventL1GD ) fhNEvents->Fill(24.5);
817  if( fEventL1J && !fEventL1JD ) fhNEvents->Fill(25.5);
818 }
819 
820 //______________________________________________________________
822 //______________________________________________________________
824 {
825  // Study fakes - Make it more understandable!!!
826 
827  Int_t areAllFakes = 2;
828  Int_t numberpatchNotFake = 0;
829  Int_t numberpatchFake = 0;
830 
831  Int_t threshold = 10;// it's not GeV it's ADC !!
832  Bool_t enoughE = kFALSE;
833  Double_t patchMax = 0;
834  Int_t colMax = -1;
835  Int_t rowMax = -1;
836  Int_t shiftCol = -1;
837  Int_t shiftRow = -1;
838 
839  // loop on patches
840  for (Int_t posx = 0; posx < fgkFALTROCols; posx++)
841  {
842  for (Int_t posy = 0; posy < fgkFALTRORows; posy++)
843  {
844  Double_t patchEnergy = 0;
845 
846  if(fMapTrigL1G[posy][posx] > 0)
847  {
848  for(Int_t irow = 0; irow < 2; irow++)
849  {
850  for(Int_t icol = 0; icol < 2; icol++)
851  {
852  // loop on cells
853  shiftCol = posx+icol;
854  shiftRow = posy+irow;
855 
856  // printf("cell[%i,%i]=%f\n",posy+icol,posx+irow, fMapCellL1G[posy+icol][posx+irow]);
857  if(shiftRow < fgkFALTRORows && shiftCol < fgkFALTROCols)
858  {
859  patchEnergy += fMapCellL1G[shiftRow][shiftCol] ;
860 
861  if( fMapCellL1G[shiftRow][shiftCol] > threshold/2 ) enoughE = kTRUE;
862  }
863  }
864  }
865 
866  if (patchEnergy > patchMax)
867  {
868  patchMax = patchEnergy;
869  colMax = posx;
870  rowMax = posy;
871  }
872 
873  if(patchEnergy>threshold || (patchEnergy>threshold-3 && enoughE))
874  {
875  numberpatchNotFake++;
876  fhL1GPatchNotFake ->Fill(posx,posy);
877  fhL1GPatchNotFakeE->Fill(patchEnergy);
878  areAllFakes = 1;
879  }
880  else
881  {
882  numberpatchFake++;
883  areAllFakes = 0;
884  fhL1GPatchFake ->Fill(posx,posy);
885  fhL1GPatchFakeE->Fill(patchEnergy);
886  }
887  }
888  }
889  }
890 
891  fhNPatchNotFake->Fill(areAllFakes,numberpatchNotFake);
892  fhNPatchFake ->Fill(areAllFakes,numberpatchFake);
893 
894  if(areAllFakes == 0)
895  {
896  // loop on patchs
897  for (Int_t col = 0; col < fgkFALTROCols; col++)
898  {
899  for (Int_t row = 0; row < fgkFALTRORows; row++)
900  {
901  if(fMapTrigL1G[row][col] > 0)
902  {
903  // cout <<"checking fMapTrigL1G[row][col]"<<fMapTrigL1G[row][col]<<endl;
904  fhL1GPatchAllFake->Fill(col,row);
905 
906  Double_t patchEnergy=0;
907  for(Int_t irow = 0; irow < 2; irow++)
908  {
909  for(Int_t icol = 0; icol < 2; icol++)
910  {
911  shiftCol = col+icol;
912  shiftRow = row+irow;
913 
914  if(shiftRow < fgkFALTRORows && shiftCol < fgkFALTROCols)
915  patchEnergy += fMapCellL1G[shiftRow][shiftCol] ;
916 
917  }
918  }
919  fhL1GPatchAllFakeE->Fill(patchEnergy);
920  }
921  }
922  }
923  // cout << "row max"<<rowMax<<" colmax"<<colMax<< " fMapTrigL1G[rowMax][colMax]"<< fMapTrigL1G[rowMax][colMax]<<endl;
924 
925  if(fMapTrigL1G[rowMax][colMax] > 0)
926  {
927  // printf("\npatch max [%i,%i] = %f\n",rowMax,colMax,patchMax);
928  fhL1GPatchAllFakeMax ->Fill(colMax,rowMax);
929  fhL1GPatchAllFakeMaxE->Fill(patchMax);
930  }
931  }
932  else
933  {
934  // loop on patches
935  for (Int_t col = 0; col < fgkFALTROCols; col++)
936  {
937  for (Int_t row = 0; row < fgkFALTRORows; row++)
938  {
939  if(fMapTrigL1G[row][col] > 0)
940  {
941  fhL1GPatchNotAllFake->Fill(col,row);
942 
943  Double_t patchEnergy = 0;
944  for(Int_t irow = 0; irow < 2; irow++)
945  {
946  for(Int_t icol = 0; icol < 2; icol++)
947  {
948  shiftCol = col+icol;
949  shiftRow = row+irow;
950 
951  if(shiftRow < fgkFALTRORows && shiftCol < fgkFALTROCols)
952  patchEnergy += fMapCellL1G[shiftRow][shiftCol] ;
953  }
954  }
955 
956  fhL1GPatchNotAllFakeE->Fill(patchEnergy);
957 
958  }
959  }
960  }
961 
962  if(fMapTrigL1G[rowMax][colMax] > 0 )
963  {
964  fhL1GPatchNotAllFakeMax ->Fill(colMax,rowMax);
965  fhL1GPatchNotAllFakeMaxE->Fill(patchMax);
966  }
967  }
968 
969  if( fFillV0SigHisto ) fhGPMaxVV0TT->Fill(fV0Trigger, patchMax);
970  if( fEventL1G ) fhL1GPatchMax ->Fill(colMax,rowMax);
971  if( fEventL1G2 ) fhL1G2PatchMax->Fill(colMax,rowMax);
972 }
973 
974 //____________________________________________________________
976 //____________________________________________________________
978 {
979  Double_t patchMax = 0;
980  Int_t colMax = -1;
981  Int_t rowMax = -1;
982  Int_t col, row = 0;
983 
984  for (Int_t i = 0; i < 9; i++)
985  {
986  for (Int_t j = 0; j < 12; j++)
987  {
988  Int_t patchJ = 0;
989  col = i;
990  row = j;
991 
992  for (Int_t k = 0; k < 16; k++)
993  {
994  for (Int_t l = 0; l < 16; l++)
995  {
996  patchJ += Int_t(fMapTrigL1[4*j + l][4*i + k]);
997  }
998  }
999 
1000  if (patchJ > patchMax)
1001  {
1002  patchMax = patchJ;
1003  colMax = 4*col;
1004  rowMax = 4*row;
1005  }
1006  }
1007  }
1008 
1009  if( fFillV0SigHisto ) fhJPMaxVV0TT->Fill(fV0Trigger, patchMax);
1010  if( fEventL1J ) fhL1JPatchMax ->Fill(colMax,rowMax);
1011  if( fEventL1J2 ) fhL1J2PatchMax->Fill(colMax,rowMax);
1012 }
1013 
1014 //______________________________________________________
1016 //______________________________________________________
1018 {
1019  for (Int_t i = 0; i < fgkFALTRORows; i++)
1020  {
1021  for (Int_t j = 0; j < fgkFALTROCols; j++) //check x,y direction for reading FOR ((0,0) = top left);
1022  {
1023  fhFORAmp ->Fill( j, i, fMapCell [i][j]);
1024  fhFORAmpL1G ->Fill( j, i, fMapCellL1G [i][j]);
1025  fhFORAmpL1G2->Fill( j, i, fMapCellL1G2 [i][j]);
1026  fhFORAmpL1J ->Fill( j, i, fMapCellL1J [i][j]);
1027  fhFORAmpL1J2->Fill( j, i, fMapCellL1J2 [i][j]);
1028  fhL0Amp ->Fill( j, i, fMapTrigL0 [i][j]);
1029  fhL0AmpL1G ->Fill( j, i, fMapTrigL0L1G[i][j]);
1030  fhL0AmpL1J ->Fill( j, i, fMapTrigL0L1J[i][j]);
1031  fhL1Amp ->Fill( j, i, fMapTrigL1 [i][j]);
1032 
1033  fhL1FOREnergy->Fill(i+fgkFALTRORows*j, fMapTrigL1 [i][j]);
1034  fhL1GAmp ->Fill( j, i, fMapTrigL1G [i][j]);
1035  fhL1G2Amp ->Fill( j, i, fMapTrigL1G2 [i][j]);
1036  fhL1JAmp ->Fill( j, i, fMapTrigL1J [i][j]);
1037  fhL1J2Amp ->Fill( j, i, fMapTrigL1J2 [i][j]);
1038  fhFORMeanAmp->Fill( j, i, fMapCell [i][j]);
1039  fhL0MeanAmp ->Fill( j, i, fMapTrigL0 [i][j]);
1040  fhL1MeanAmp ->Fill( j, i, fMapTrigL1 [i][j]);
1041  }
1042  }
1043 }
1044 
1045 //____________________________________________________
1047 //____________________________________________________
1049 {
1050  AliESDVZERO* eventV0 = dynamic_cast<AliESDVZERO*> (InputEvent()->GetVZEROData());
1051 
1052  if(eventV0)
1053  {
1054  for (Int_t i = 0; i < 32; i++)
1055  {
1056  fV0C += eventV0->GetAdcV0C(i);
1057  fV0A += eventV0->GetAdcV0A(i);
1058  }
1059 
1060  if (fSTUTotal != 0 && fFillV0SigHisto)
1061  {
1062  fhV0STU->Fill(fV0A+fV0C,fSTUTotal);
1063 
1064  if( fV0A+fV0C > fMaxV0Signal && DebugLevel() > 0)
1065  AliWarning(Form("Large fV0A+fV0C %f",fV0A+fV0C));
1066  }
1067 
1068  //printf("V0A %f, V0C %f\n",fV0A,fV0C);
1069 
1070  // Not interesting in case of data analysis, REVISE in future
1071  if(fMCData || !fFillV0SigHisto) return ;
1072 
1073  if( fEventL1G ) fhV0[kL1GammaTrig] ->Fill(fV0A+fV0C);
1074  if( fEventL1G2 ) fhV0[kL1GammaTrig2] ->Fill(fV0A+fV0C);
1075  if( fEventL1J ) fhV0[kL1JetTrig] ->Fill(fV0A+fV0C);
1076  if( fEventL1J2 ) fhV0[kL1JetTrig2] ->Fill(fV0A+fV0C);
1077  if( fEventL1GD ) fhV0[kL1GammaTrigD] ->Fill(fV0A+fV0C);
1078  if( fEventL1G2D ) fhV0[kL1GammaTrig2D] ->Fill(fV0A+fV0C);
1079  if( fEventL1JD ) fhV0[kL1JetTrigD] ->Fill(fV0A+fV0C);
1080  if( fEventL1J2D ) fhV0[kL1JetTrig2D] ->Fill(fV0A+fV0C);
1081  if( fEventMB ) fhV0[kMBTrig] ->Fill(fV0A+fV0C);
1082  if( fEventL0 ) fhV0[kL0Trig] ->Fill(fV0A+fV0C);
1083  if( fEventCen ) fhV0[kCentralTrig] ->Fill(fV0A+fV0C);
1084  if( fEventSem ) fhV0[kSemiCentralTrig]->Fill(fV0A+fV0C);
1085  if( fEventL1G && !fEventL1J) fhV0[kL1GammaOnlyTrig] ->Fill(fV0A+fV0C);
1086  if( fEventL1J && !fEventL1G) fhV0[kL1JetOnlyTrig] ->Fill(fV0A+fV0C);
1089  //if(nL0Patch!=0 || nL1Patch!=0) printf("total TRU %f, total STU %f, V0C+V0A %f; nL0 %d, nL1 %d \n",
1090  // fTRUTotal,fSTUTotal,fV0A+fV0C,nL0Patch,nL1Patch);
1091  }
1092 }
1093 
1094 //________________________________________
1096 //________________________________________
1098 {
1099  if(!fRecoUtils)
1100  {
1101  fRecoUtils = new AliEMCALRecoUtils ;
1102  fRecoUtils->SwitchOnBadChannelsRemoval();
1103  }
1104 }
1105 
1106 //_____________________________________________________
1109 //_____________________________________________________
1111 {
1112  for (Int_t i = 0; i < fgkFALTRORows; i++)
1113  {
1114  for (Int_t j = 0; j < fgkFALTROCols; j++)
1115  {
1116  fMapTrigL0 [i][j] = 0.;
1117  fMapTrigL0L1G[i][j] = 0.;
1118  fMapTrigL0L1J[i][j] = 0.;
1119  fMapTrigL1G [i][j] = 0.;
1120  fMapTrigL1G2 [i][j] = 0.;
1121  fMapTrigL1J [i][j] = 0.;
1122  fMapTrigL1J2 [i][j] = 0.;
1123  fMapTrigL1 [i][j] = 0.;
1124  fMapCell [i][j] = 0.;
1125  fMapCellL1G [i][j] = 0.;
1126  fMapCellL1G2 [i][j] = 0.;
1127  fMapCellL1J [i][j] = 0.;
1128  fMapCellL1J2 [i][j] = 0.;
1129  }
1130  }
1131 }
1132 
1133 //________________________________________________
1137 //________________________________________________
1139 {
1140  if(fGeoSet) return;
1141 
1142  // Init the trigger bit once, correct depending on version
1143  fBitEGA = 4;
1144  fBitEJE = 5;
1145 
1146  TFile* file = AliAnalysisManager::GetAnalysisManager()->GetTree()->GetCurrentFile();
1147 
1148  const TList *clist = file->GetStreamerInfoCache();
1149 
1150  if(clist)
1151  {
1152  TStreamerInfo *cinfo = (TStreamerInfo*)clist->FindObject("AliESDCaloTrigger");
1153  Int_t verid = 5; // newer ESD header version
1154  if(!cinfo)
1155  {
1156  cinfo = (TStreamerInfo*)clist->FindObject("AliAODCaloTrigger");
1157  verid = 3; // newer AOD header version
1158  }
1159  if(cinfo)
1160  {
1161  Int_t classversionid = cinfo->GetClassVersion();
1162  //printf("********* Header class version %d *********** \n",classversionid);
1163 
1164  if (classversionid >= verid)
1165  {
1166  fBitEGA = 6;
1167  fBitEJE = 8;
1168  }
1169  } else AliInfo("Streamer info for trigger class not available, bit not changed");
1170  } else AliInfo("Streamer list not available!, bit not changed");
1171 
1172  Int_t runnumber = InputEvent()->GetRunNumber() ;
1173 
1174  if (!fGeometry)
1175  {
1176  if(fGeoName=="")
1177  {
1178  fGeometry = AliEMCALGeometry::GetInstanceFromRunNumber(runnumber);
1179  AliInfo(Form("Get EMCAL geometry name to <%s> for run %d",fGeometry->GetName(),runnumber));
1180  }
1181  else
1182  {
1183  fGeometry = AliEMCALGeometry::GetInstance(fGeoName);
1184  AliInfo(Form("Set EMCAL geometry name to <%s>",fGeoName.Data()));
1185  }
1186  }
1187 
1188  fGeoSet = kTRUE;
1189 }
1190 
1191 //_______________________________________________________
1193 //_______________________________________________________
1195 {
1196  for (Int_t i = 0; i < fgkTriggerCombi; i++)
1197  {
1198  fhV0 [i] = 0; fhCentrality[i] = 0;
1199  fhClus [i] = 0; fhClusMax [i] = 0;
1200  fhClusCen[i] = 0; fhClusCenMax[i] = 0;
1201  fhClusV0 [i] = 0; fhClusV0Max [i] = 0;
1202  fhClusEta[i] = 0; fhClusEtaMax[i] = 0;
1203  fhClusPhi[i] = 0; fhClusPhiMax[i] = 0;
1204 
1205  fhClusEtaPhiHigh [i] = 0; fhClusEtaPhiHighCluMax [i] = 0;
1207  fhClusEtaPhiLow [i] = 0; fhClusEtaPhiLowCluMax [i] = 0;
1209 
1210  if(i<3){ fhClusMBPure[i] = 0; fhClusMaxMBPure[i] = 0; }
1211 
1212  for(Int_t ism = 0; ism < 20; ism++)
1213  {
1214  fhClusSM [i][ism] = 0;
1215  fhClusCenSM[i][ism] = 0;
1216  fhClusV0SM [i][ism] = 0;
1217  }
1218  }
1219 }
1220 
1221 //_____________________________________________________________________________
1223 //_____________________________________________________________________________
1225 {
1226  // Init trigger event bit
1227 
1228  fEventMB = kFALSE;
1229  fEventL0 = kFALSE;
1230  fEventL1G = kFALSE;
1231  fEventL1G2 = kFALSE;
1232  fEventL1J = kFALSE;
1233  fEventL1J2 = kFALSE;
1234  fEventL0D = kFALSE;
1235  fEventL1GD = kFALSE;
1236  fEventL1G2D= kFALSE;
1237  fEventL1JD = kFALSE;
1238  fEventL1J2D= kFALSE;
1239  fEventCen = kFALSE;
1240  fEventSem = kFALSE;
1241 
1242  // Minimum bias event trigger?
1243  if((triggerclasses.Contains("CINT7") || triggerclasses.Contains("CPBI2_B1") ) &&
1244  (triggerclasses.Contains("-B-") || triggerclasses.Contains("-I-")) &&
1245  triggerclasses.Contains("-NOPF") ) fEventMB = kTRUE;
1246  //triggerclasses.Contains("-NOPF-ALLNOTRD") ) fEventMB = kTRUE;
1247 
1248  //if(triggerclasses.Contains("CINT7-B-NOPF-CENT")) fEventMB = kTRUE;
1249 
1250  if(fMCData && triggerclasses.Contains("MB")) fEventMB = kTRUE;
1251 
1252  // EMC triggered event? Which type?
1253  if( triggerclasses.Contains("-B-") || triggerclasses.Contains("-S-") || triggerclasses.Contains("-I-") )
1254  {
1255  if( triggerclasses.Contains("CEMC") &&
1256  !triggerclasses.Contains("EGA" ) &&
1257  !triggerclasses.Contains("EJE" ) &&
1258  !triggerclasses.Contains("EG1" ) &&
1259  !triggerclasses.Contains("EJ1" ) &&
1260  !triggerclasses.Contains("EG2" ) &&
1261  !triggerclasses.Contains("EJ2" ) ) fEventL0 = kTRUE;
1262 
1263  if( triggerclasses.Contains("CDMC") &&
1264  !triggerclasses.Contains("DGA" ) &&
1265  !triggerclasses.Contains("DJE" ) &&
1266  !triggerclasses.Contains("DG1" ) &&
1267  !triggerclasses.Contains("DJ1" ) &&
1268  !triggerclasses.Contains("DG2" ) &&
1269  !triggerclasses.Contains("DJ2" ) ) fEventL0D = kTRUE;
1270 
1271 
1272  if( triggerclasses.Contains("EGA" ) || triggerclasses.Contains("EG1" ) ) fEventL1G = kTRUE;
1273  if( triggerclasses.Contains("EG2" ) ) fEventL1G2 = kTRUE;
1274 
1275  if( triggerclasses.Contains("DGA" ) || triggerclasses.Contains("DG1" ) ) fEventL1GD = kTRUE;
1276  if( triggerclasses.Contains("DG2" ) ) fEventL1G2D = kTRUE;
1277 
1278  if( triggerclasses.Contains("EJE" ) || triggerclasses.Contains("EJ1" ) ) fEventL1J = kTRUE;
1279  if( triggerclasses.Contains("EJ2" ) ) fEventL1J2 = kTRUE;
1280 
1281  if( triggerclasses.Contains("DJE" ) || triggerclasses.Contains("DJ1" ) ) fEventL1JD = kTRUE;
1282  if( triggerclasses.Contains("DJ2" ) ) fEventL1J2D = kTRUE;
1283  }
1284 
1285  // Semi/Central PbPb trigger
1286  if (triggerclasses.Contains("CCENT_R2-B-NOPF-ALLNOTRD")) fEventCen = kTRUE;
1287  else if(triggerclasses.Contains("CSEMI_R1-B-NOPF-ALLNOTRD")) fEventSem = kTRUE;
1288 
1289 // printf("MB : %d; L0-E : %d; L0-D : %d; L1-EGam1 : %d; L1-DGam1 : %d; "
1290 // "L1-EGam2 : %d; L1-DGam2 : %d;\n L1-EJet1 : %d; L1-DJet1 : %d; L1-EJet2 : %d;L1-DJet2 : %d; "
1291 // "Central : %d; SemiCentral : %d; \n Trigger Names : %s \n ",
1292 // fEventMB,fEventL0,fEventL0D,fEventL1G,fEventL1GD,fEventL1G2,fEventL1G2D,
1293 // fEventL1J,fEventL1JD,fEventL1J2,fEventL1J2D,
1294 // fEventCen,fEventSem,triggerclasses.Data());
1295 }
1296 
1297 //___________________________________________________________
1299 //___________________________________________________________
1301 {
1302  fOutputList = new TList;
1303  fOutputList ->SetOwner(kTRUE);
1304 
1305  fhNEvents = new TH1F("hNEvents","Number of selected events",26,0,26);
1306  fhNEvents ->SetYTitle("N events");
1307  fhNEvents ->GetXaxis()->SetBinLabel(1 ,"All");
1308  fhNEvents ->GetXaxis()->SetBinLabel(2 ,"MB");
1309  fhNEvents ->GetXaxis()->SetBinLabel(3 ,"Central Pb");
1310  fhNEvents ->GetXaxis()->SetBinLabel(4 ,"SemiCentral Pb");
1311  fhNEvents ->GetXaxis()->SetBinLabel(5 ,"L0");
1312  fhNEvents ->GetXaxis()->SetBinLabel(6 ,"L1-G1");
1313  fhNEvents ->GetXaxis()->SetBinLabel(7 ,"L1-G2");
1314  fhNEvents ->GetXaxis()->SetBinLabel(8 ,"L1-J1");
1315  fhNEvents ->GetXaxis()->SetBinLabel(9 ,"L1-J2");
1316  fhNEvents ->GetXaxis()->SetBinLabel(10 ,"L1-G1 & !L1-J1");
1317  fhNEvents ->GetXaxis()->SetBinLabel(11 ,"L1-J1 & !L1-G1");
1318  fhNEvents ->GetXaxis()->SetBinLabel(12 ,"L1-J1 & L1-G1");
1319  fhNEvents ->GetXaxis()->SetBinLabel(13 ,"MB & !L1 & !L0");
1320  fhNEvents ->GetXaxis()->SetBinLabel(14,"L0 & !MB");
1321  fhNEvents ->GetXaxis()->SetBinLabel(15,"L1-G1 & !MB");
1322  fhNEvents ->GetXaxis()->SetBinLabel(16,"L1-J1 & !MB");
1323  fhNEvents ->GetXaxis()->SetBinLabel(17,"L1-G1 & (Cen | Semi)");
1324  fhNEvents ->GetXaxis()->SetBinLabel(18,"L1-J1 & (Cen | Semi)");
1325  fhNEvents ->GetXaxis()->SetBinLabel(19,"L1-G2 & !L1-G1");
1326  fhNEvents ->GetXaxis()->SetBinLabel(20,"L1-J2 & !L1-J1");
1327  fhNEvents ->GetXaxis()->SetBinLabel(21,"L0 DCal");
1328  fhNEvents ->GetXaxis()->SetBinLabel(22,"L1-G1 DCal");
1329  fhNEvents ->GetXaxis()->SetBinLabel(23,"L1-J1 DCal");
1330  fhNEvents ->GetXaxis()->SetBinLabel(24,"L0 !DCal");
1331  fhNEvents ->GetXaxis()->SetBinLabel(25,"L1-G1 !DCal");
1332  fhNEvents ->GetXaxis()->SetBinLabel(26,"L1-J1 !DCal");
1333 
1334  fhFORAmp = new TH2F("hFORAmp", "FEE cells deposited energy, grouped like FastOR 2x2 per Row and Column",
1336  fhFORAmp ->SetXTitle("Index #eta (columnns)");
1337  fhFORAmp ->SetYTitle("Index #phi (rows)");
1338  fhFORAmp ->SetZTitle("Amplitude");
1339 
1340  fhFORAmpL1G = new TH2F("hFORAmpL1G1", "FEE cells deposited energy, grouped like FastOR 2x2 per Row and Column, with L1G1 trigger condition",
1342  fhFORAmpL1G ->SetXTitle("Index #eta (columnns)");
1343  fhFORAmpL1G ->SetYTitle("Index #phi (rows)");
1344  fhFORAmpL1G ->SetZTitle("Amplitude");
1345 
1346  fhFORAmpL1G2 = new TH2F("hFORAmpL1G2", "FEE cells deposited energy, grouped like FastOR 2x2 per Row and Column, with L1G2 trigger condition",
1348  fhFORAmpL1G2 ->SetXTitle("Index #eta (columnns)");
1349  fhFORAmpL1G2 ->SetYTitle("Index #phi (rows)");
1350  fhFORAmpL1G2 ->SetZTitle("Amplitude");
1351 
1352  fhFORAmpL1J = new TH2F("hFORAmpL1J1", "FEE cells deposited energy, grouped like FastOR 2x2 per Row and Column, with L1J1 trigger condition",
1354  fhFORAmpL1J ->SetXTitle("Index #eta (columnns)");
1355  fhFORAmpL1J ->SetYTitle("Index #phi (rows)");
1356  fhFORAmpL1J ->SetZTitle("Amplitude");
1357 
1358  fhFORAmpL1J2 = new TH2F("hFORAmpL1J2", "FEE cells deposited energy, grouped like FastOR 2x2 per Row and Column, with L1J2 trigger condition",
1360  fhFORAmpL1J2 ->SetXTitle("Index #eta (columnns)");
1361  fhFORAmpL1J2 ->SetYTitle("Index #phi (rows)");
1362  fhFORAmpL1J2 ->SetZTitle("Amplitude");
1363 
1364 
1365  fhL0Amp = new TH2F("hL0Amp","FALTRO signal per Row and Column",
1367  fhL0Amp ->SetXTitle("Index #eta (columnns)");
1368  fhL0Amp ->SetYTitle("Index #phi (rows)");
1369  fhL0Amp ->SetZTitle("Amplitude");
1370 
1371  fhL0AmpL1G = new TH2F("hL0AmpL1G","FALTRO signal per Row and Column, with L1G trigger condition",
1373  fhL0AmpL1G ->SetXTitle("Index #eta (columnns)");
1374  fhL0AmpL1G ->SetYTitle("Index #phi (rows)");
1375  fhL0AmpL1G ->SetZTitle("Amplitude");
1376 
1377 
1378  fhL0AmpL1J = new TH2F("hL0AmpL1J","FALTRO signal per Row and Column, with L1j trigger condition",
1380  fhL0AmpL1J ->SetXTitle("Index #eta (columnns)");
1381  fhL0AmpL1J ->SetYTitle("Index #phi (rows)");
1382  fhL0AmpL1J ->SetZTitle("Amplitude");
1383 
1384 
1385  fhL1Amp = new TH2F("hL1Amp","STU signal per Row and Column",
1387  fhL1Amp ->SetXTitle("Index #eta (columnns)");
1388  fhL1Amp ->SetYTitle("Index #phi (rows)");
1389  fhL1Amp ->SetZTitle("Amplitude");
1390 
1391  fhL1GAmp = new TH2F("hL1G1Amp","STU signal per Row and Column for L1 Gamma1",
1393  fhL1GAmp ->SetXTitle("Index #eta (columnns)");
1394  fhL1GAmp ->SetYTitle("Index #phi (rows)");
1395  fhL1GAmp ->SetZTitle("Amplitude");
1396 
1397  fhL1G2Amp = new TH2F("hL1G2Amp","STU signal per Row and Column for L1 Gamma2",
1399  fhL1G2Amp ->SetXTitle("Index #eta (columnns)");
1400  fhL1G2Amp ->SetYTitle("Index #phi (rows)");
1401  fhL1G2Amp ->SetZTitle("Amplitude");
1402 
1403  fhL1JAmp = new TH2F("hL1J1Amp","STU signal per Row and Column for L1 Jet1",
1405  fhL1JAmp ->SetXTitle("Index #eta (columnns)");
1406  fhL1JAmp ->SetYTitle("Index #phi (rows)");
1407  fhL1JAmp ->SetZTitle("Amplitude");
1408 
1409  fhL1J2Amp = new TH2F("hL1J2Amp","STU signal per Row and Column for L1 Jet2",
1411  fhL1J2Amp ->SetXTitle("Index #eta (columnns)");
1412  fhL1J2Amp ->SetYTitle("Index #phi (rows)");
1413  fhL1J2Amp ->SetZTitle("Amplitude");
1414 
1415  fhL1FOREnergy = new TH2F("hL1FOREnergy","FOR index vs FOR energy",
1416  fgkFALTROCols*fgkFALTRORows,0,fgkFALTROCols*fgkFALTRORows,200,0,200);
1417  fhL1FOREnergy ->SetXTitle("Index FOR");
1418  fhL1FOREnergy ->SetYTitle("Energy (ADC)");
1419 
1420  fhL0Patch = new TH2F("hL0Patch","FOR with associated L0 Patch",
1421  fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
1422  fhL0Patch ->SetXTitle("Index #eta (columnns)");
1423  fhL0Patch ->SetYTitle("Index #phi (rows)");
1424  fhL0Patch ->SetZTitle("counts");
1425 
1426  fhL1GPatch = new TH2F("hL1G1Patch","FOR with associated L1 Gamma Patch1",
1427  fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
1428  fhL1GPatch ->SetXTitle("Index #eta (columnns)");
1429  fhL1GPatch ->SetYTitle("Index #phi (rows)");
1430  fhL1GPatch ->SetZTitle("counts");
1431 
1432  fhL1G2Patch = new TH2F("hL1G2Patch","FOR with associated L1 Gamma2 Patch",
1433  fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
1434  fhL1G2Patch ->SetXTitle("Index #eta (columnns)");
1435  fhL1G2Patch ->SetYTitle("Index #phi (rows)");
1436  fhL1G2Patch ->SetZTitle("counts");
1437 
1438  fhL1GPatchNotFake = new TH2F("hL1G1PatchNotFake","FOR with L1 Gamma1 Patch associated to energetic cells",
1439  fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
1440  fhL1GPatchNotFake ->SetXTitle("Index #eta (columnns)");
1441  fhL1GPatchNotFake ->SetYTitle("Index #phi (rows)");
1442  fhL1GPatchNotFake ->SetZTitle("counts");
1443 
1444  fhL1GPatchFake = new TH2F("hL1G1PatchFake","FOR without L1 Gamma1 Patch associated to energetic cells",
1445  fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
1446  fhL1GPatchFake ->SetXTitle("Index #eta (columnns)");
1447  fhL1GPatchFake ->SetYTitle("Index #phi (rows)");
1448  fhL1GPatchFake ->SetZTitle("counts");
1449 
1450 
1451  fhL1GPatchNotAllFake = new TH2F("hL1G1PatchNotAllFake","FOR with one L1 Gamma1 Patch associated to an energetic cell",
1452  fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
1453  fhL1GPatchNotAllFake ->SetXTitle("Index #eta (columnns)");
1454  fhL1GPatchNotAllFake ->SetYTitle("Index #phi (rows)");
1455  fhL1GPatchNotAllFake ->SetZTitle("counts");
1456 
1457  fhL1GPatchAllFake = new TH2F("hL1G1PatchAllFake","FOR without any L1 Gamma1 Patch associated to an energetic cell",
1458  fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
1459  fhL1GPatchAllFake ->SetXTitle("Index #eta (columnns)");
1460  fhL1GPatchAllFake ->SetYTitle("Index #phi (rows)");
1461  fhL1GPatchAllFake ->SetZTitle("counts");
1462 
1463  fhL1GPatchAllFakeMax = new TH2F("hL1G1PatchAllFakeMax","FOR with L1 Gamma1 Patch Max not associated to an energetic cell",
1464  fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
1465  fhL1GPatchAllFakeMax ->SetXTitle("Index #eta (columnns)");
1466  fhL1GPatchAllFakeMax ->SetYTitle("Index #phi (rows)");
1467  fhL1GPatchAllFakeMax ->SetZTitle("counts");
1468 
1469  fhL1GPatchNotAllFakeMax = new TH2F("hL1G1PatchNotAllFakeMax","FOR with one L1 Gamma1 Patch Max associated to an energetic cell",
1470  fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
1471  fhL1GPatchNotAllFakeMax ->SetXTitle("Index #eta (columnns)");
1472  fhL1GPatchNotAllFakeMax ->SetYTitle("Index #phi (rows)");
1473  fhL1GPatchNotAllFakeMax ->SetZTitle("counts");
1474 
1475  fhL1GPatchNotAllFakeMaxE = new TH1F("hL1G1PatchNotAllFakeMaxE","Energy distribution of FOR in events with L1 Gamma1 Patch Max associated to an energetic cell",
1477  fhL1GPatchNotAllFakeMaxE ->SetXTitle("Energy (GeV)");
1478 
1479 
1480  fhL1GPatchAllFakeMaxE = new TH1F("hL1G1PatchAllFakeMaxE","Energy distribution of FOR in events with L1 Gamma1 Patch Max not associated to an energetic cell",
1482  fhL1GPatchAllFakeMaxE ->SetXTitle("Energy (GeV)");
1483 
1484  fhL1GPatchNotAllFakeE = new TH1F("hL1G1PatchNotAllFakeE","Energy distribution of FOR in events with L1 Gamma1 Patch not associated to an energetic cell",
1486  fhL1GPatchNotAllFakeE ->SetXTitle("Energy (GeV)");
1487 
1488  fhL1GPatchAllFakeE = new TH1F("hL1G1PatchAllFakeE","Energy distribution of FOR in events with L1 Gamma1 Patch associated to an energetic cell",
1490  fhL1GPatchAllFakeE ->SetXTitle("Energy (GeV)");
1491 
1492 
1493  fhL1GPatchFakeE = new TH1F("hL1G1PatchFakeE","Energy distribution of FOR with L1 Gamma1 Patch not associated to an energetic cell",
1495  fhL1GPatchFakeE ->SetXTitle("Energy (GeV)");
1496 
1497  fhL1GPatchNotFakeE = new TH1F("hL1G1PatchNotFakeE","Energy distribution of FOR with L1 Gamma1 Patch associated to an energetic cell",
1499  fhL1GPatchNotFakeE ->SetXTitle("Energy (GeV)");
1500 
1501  fhNPatchFake = new TH2F("hNPatchFake","number of fake patchs vs. all patchs are fake",
1502  3,0,3, 2880,0,2880);
1503  fhNPatchFake ->SetYTitle("number of fake patchs");
1504  fhNPatchFake ->SetXTitle("all fake event");
1505  fhNPatchFake ->SetZTitle("counts");
1506 
1507 
1508  fhNPatchNotFake = new TH2F("hNPatchNotFake","number of Not fake patchs vs. all patchs are fake",
1509  3, 0, 3, 200,0,1000);
1510  fhNPatchNotFake ->SetYTitle("number of Not fake patchs");
1511  fhNPatchNotFake ->SetXTitle("all fake event");
1512  fhNPatchNotFake ->SetZTitle("counts");
1513 
1514 
1515  fhL1JPatch = new TH2F("hL1J1Patch","FOR with associated L1 Jet1 Patch",
1516  fgkFALTROCols/4,0,fgkFALTROCols,fgkFALTRORows/4,0,fgkFALTRORows);
1517  fhL1JPatch ->SetXTitle("Index #eta (columnns)");
1518  fhL1JPatch ->SetYTitle("Index #phi (rows)");
1519  fhL1JPatch ->SetZTitle("counts");
1520 
1521  fhL1J2Patch = new TH2F("hL1J2Patch","FOR with associated L1 Jet2 Patch",
1522  fgkFALTROCols/4,0,fgkFALTROCols,fgkFALTRORows/4,0,fgkFALTRORows);
1523  fhL1J2Patch ->SetXTitle("Index #eta (columnns)");
1524  fhL1J2Patch ->SetYTitle("Index #phi (rows)");
1525  fhL1J2Patch ->SetZTitle("counts");
1526 
1527  // Uncomment when corresponding method is active
1528 // fhFEESTU = new TH2F("hFEESTU","STU / FEE vs channel", fNBinsSTUFEERatio,0,fMaxSTUFEERatio,30,0,30);
1529 // fhFEESTU ->SetXTitle("STU/FEE signal");
1530 // fhFEESTU ->SetYTitle("channel");
1531 // fhFEESTU ->SetZTitle("counts");
1532 //
1533 // fhTRUSTU = new TH2F("hTRUSTU","STU / TRU vs channel", fNBinsSTUTRURatio,0,fMaxSTUTRURatio,30,0,30);
1534 // fhTRUSTU ->SetXTitle("STU/TRU signal");
1535 // fhTRUSTU ->SetYTitle("channel");
1536 // fhTRUSTU ->SetZTitle("counts");
1537 
1538  fhFORMeanAmp = new TProfile2D("hFORMeanAmp", "Mean FastOR(FEE) signal per Row and Column", fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
1539  fhFORMeanAmp->SetXTitle("Index #eta");
1540  fhFORMeanAmp->SetYTitle("Index #phi");
1541 
1542  fhL0MeanAmp = new TProfile2D("hL0MeanAmp", "Mean FastOR(TRU) signal per Row and Column", fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
1543  fhL0MeanAmp->SetXTitle("Index #eta");
1544  fhL0MeanAmp->SetYTitle("Index #phi");
1545 
1546  fhL1MeanAmp = new TProfile2D("hL1MeanAmp", "Mean FastOR(STU) signal per Row and Column", fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
1547  fhL1MeanAmp->SetXTitle("Index #eta");
1548  fhL1MeanAmp->SetYTitle("Index #phi");
1549 
1550  fhL1GPatchMax = new TH2F("hL1G1PatchMax","FOR of max amplitude patch with associated L1 Gamma1 Patch",
1551  fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
1552  fhL1GPatchMax ->SetXTitle("Index #eta (columnns)");
1553  fhL1GPatchMax ->SetYTitle("Index #phi (rows)");
1554  fhL1GPatchMax ->SetZTitle("counts");
1555 
1556  fhL1G2PatchMax = new TH2F("hL1G2PatchMax","FOR of max amplitude patch with associated L1 Gamma2 Patch",
1557  fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
1558  fhL1G2PatchMax ->SetXTitle("Index #eta (columnns)");
1559  fhL1G2PatchMax ->SetYTitle("Index #phi (rows)");
1560  fhL1G2PatchMax ->SetZTitle("counts");
1561 
1562  fhL1JPatchMax = new TH2F("hL1J1PatchMax","FOR of max amplitude patch with associated L1 Jet1 Patch",
1563  fgkFALTROCols/4,0,fgkFALTROCols,fgkFALTRORows/4,0,fgkFALTRORows);
1564  fhL1JPatchMax ->SetXTitle("Index #eta (columnns)");
1565  fhL1JPatchMax ->SetYTitle("Index #phi (rows)");
1566  fhL1JPatchMax ->SetZTitle("counts");
1567 
1568  fhL1J2PatchMax = new TH2F("hL1J2PatchMax","FOR of max amplitude patch with associated L1 Jet2 Patch",
1569  fgkFALTROCols/4,0,fgkFALTROCols,fgkFALTRORows/4,0,fgkFALTRORows);
1570  fhL1J2PatchMax ->SetXTitle("Index #eta (columnns)");
1571  fhL1J2PatchMax ->SetYTitle("Index #phi (rows)");
1572  fhL1J2PatchMax ->SetZTitle("counts");
1573 
1574  fOutputList->Add(fhNEvents);
1575  fOutputList->Add(fhFORAmp);
1576  fOutputList->Add(fhFORAmpL1G);
1577  fOutputList->Add(fhFORAmpL1G2);
1578  fOutputList->Add(fhFORAmpL1J);
1579  fOutputList->Add(fhFORAmpL1J2);
1580  fOutputList->Add(fhL0Amp);
1581  fOutputList->Add(fhL0AmpL1G);
1582  fOutputList->Add(fhL0AmpL1J);
1583  fOutputList->Add(fhL1Amp);
1584  fOutputList->Add(fhL1GAmp);
1585  fOutputList->Add(fhL1G2Amp);
1586  fOutputList->Add(fhL1JAmp);
1587  fOutputList->Add(fhL1J2Amp);
1588  fOutputList->Add(fhL1FOREnergy);
1589  fOutputList->Add(fhL0Patch);
1590  fOutputList->Add(fhL1GPatch);
1591  fOutputList->Add(fhL1G2Patch);
1604  fOutputList->Add(fhNPatchFake);
1606 
1607  fOutputList->Add(fhL1JPatch);
1608  fOutputList->Add(fhL1J2Patch);
1609 
1610  // Uncomment when corresponding method is active
1611 // fOutputList->Add(fhFEESTU);
1612 // fOutputList->Add(fhTRUSTU);
1613 
1614  fOutputList->Add(fhFORMeanAmp);
1615  fOutputList->Add(fhL0MeanAmp);
1616  fOutputList->Add(fhL1MeanAmp);
1617 
1618  fOutputList->Add(fhL1GPatchMax);
1620  fOutputList->Add(fhL1JPatchMax);
1622 
1623  if(fFillV0SigHisto)
1624  {
1625  fhV0STU = new TH2I("hV0STU","Total signal STU vs V0C+V0S",
1627  fhV0STU ->SetXTitle("Signal V0C+V0A");
1628  fhV0STU ->SetYTitle("Total signal STU");
1629  fhV0STU ->SetZTitle("counts");
1630 
1631  fhGPMaxVV0TT = new TH2F("hGPMaxVV0TT","Maximum patch of L1-Gamma vs V0 signal in STU",fNBinsV0Signal,0,fMaxV0Signal, 500,0,1000);
1632  fhGPMaxVV0TT ->SetXTitle("V0 from STU");
1633  fhGPMaxVV0TT ->SetYTitle("Patch Max");
1634 
1635  fhJPMaxVV0TT = new TH2F("hJPMaxVV0TT","Maximum patch of L1-Jet vs V0 signal in STU",fNBinsV0Signal,0,fMaxV0Signal, 500,0,1000);
1636  fhJPMaxVV0TT ->SetXTitle("V0 from STU");
1637  fhJPMaxVV0TT ->SetYTitle("Patch Max");
1638 
1639  fOutputList->Add(fhV0STU);
1640  fOutputList->Add(fhGPMaxVV0TT);
1641  fOutputList->Add(fhJPMaxVV0TT);
1642  }
1643 
1644  if(fMCData)
1645  {
1646  PostData(1, fOutputList);
1647  return;
1648  }
1649 
1650  // Cluster histograms, E
1651  TString hName [] = { "MB","L0","L0D",
1652  "L1G1","L1G1D","L1G2","L1G2D",
1653  "L1J1","L1J1D","L1J2","L2J2D",
1654  "L1G1NoL1J1","L1G1NoL1J1D","L1J1NoL1G1","L1J1NoL1G1D",
1655  "L1G2NoL1G1","L1G2NoL1G1D","L1J2NoL1J1","L1J2NoL1J1D",
1656  "L0E","L0D","L1EG1","L1DG1","L1EJ1","L1DJ1",
1657  "Central","SemiCentral" } ;
1658  TString hTitle [] = { "MB trigger","EMC-L0 trigger","DMC L0 trigger",
1659  "EMC-L1 Gamma1 trigger","EMC-L1 Gamma1 trigger", "EMC-L1 Gamma2 trigger","EMC-L1 Gamma2 trigger",
1660  "EMC-L1 Jet1 trigger" ,"DMC-L1 Jet1 trigger" , "DMC-L1 Jet2 trigger" ,"DMC-L1 Jet2 trigger",
1661  "EMC-L1 Gamma1 trigger and not L1 Jet1", "DMC-L1 Gamma1 trigger and not L1 Jet1",
1662  "EMC-L1 Jet1 trigger and not L1 Gamma1", "DMC-L1 Jet1 trigger and not L1 Gamma1",
1663  "EMC-L1 Gamma2 trigger and not L1 Gamma1","DMC-L1 Gamma2 trigger and not L1 Gamma1",
1664  "EMC-L1 Jet2 trigger and not L1 Jet1", "DMC-L1 Jet2 trigger and not L1 Jet1",
1665  "L0 EMC Pure", "L0 DMC Pure", "L1-Gamma1 EMC Pure", "L1-Gamma1 DMC Pure",
1666  "L1-Jet EMC Pure", "L1-Jet DMC Pure"
1667  "Central trigger","SemiCentral trigger" } ;
1668 
1669  for(Int_t i=0; i < 3; i++)
1670  {
1671  Int_t j = i+5;
1672  if(i==0)j=0;
1673 
1674  fhClusMBPure[i] = new TH1F(Form("hClus%sPure",hName[j].Data()),
1675  Form("clusters E distribution for %s, no other EMCAL trigger on",hTitle[j].Data()),
1677  fhClusMBPure[i] ->SetXTitle("Energy (GeV)");
1678  fOutputList->Add(fhClusMBPure[i]);
1679 
1680  fhClusMaxMBPure[i] = new TH1F(Form("hClusMax%sPure",hName[j].Data()),
1681  Form("maximum energy cluster per event for %s, no other EMCAL trigger on",hTitle[j].Data()),
1683  fhClusMaxMBPure[i] ->SetXTitle("Energy (GeV)");
1684  fOutputList->Add(fhClusMaxMBPure[i]);
1685  }
1686 
1687  for(Int_t i=0; i < fgkTriggerCombi; i++)
1688  {
1689  if(fFillV0SigHisto)
1690  {
1691  fhV0[i] = new TH1F(Form("hV0%s",hName[i].Data()),
1692  Form("V0 distribution for %s",hTitle[i].Data()),
1694  fhV0[i]->SetXTitle("V0");
1695  fOutputList->Add(fhV0[i]);
1696  }
1697 
1698  fhClus[i] = new TH1F(Form("hClus%s",hName[i].Data()),
1699  Form("clusters E distribution for %s",hTitle[i].Data()),
1701  fhClus[i] ->SetXTitle("Energy (GeV)");
1702  fOutputList->Add(fhClus[i]);
1703 
1704  fhClusMax[i] = new TH1F(Form("hClusMax%s",hName[i].Data()),
1705  Form("maximum energy cluster per event for %s",hTitle[i].Data()),
1707  fhClusMax[i]->SetXTitle("Energy (GeV)");
1708  fOutputList->Add(fhClusMax[i]);
1709 
1710  // Cluster histograms, E vs Cen
1711 
1712  if(fFillCenHisto)
1713  {
1714 
1715  fhCentrality[i] = new TH1F(Form("hCentrality%s",hName[i].Data()),
1716  Form("Centrality distribution for %s",hTitle[i].Data()),
1717  100, 0, 100);
1718  fhCentrality[i]->SetXTitle("Centrality (%)");
1719  fOutputList->Add(fhCentrality[i]);
1720 
1721  fhClusCen[i] = new TH2F(Form("hClusCen%s",hName[i].Data()),
1722  Form("clusters E distribution vs centrality for %s",hTitle[i].Data()),
1723  fNBinsClusterE,0,fMaxClusterE,100, 0, 100);
1724  fhClusCen[i] ->SetXTitle("Energy (GeV)");
1725  fhClusCen[i] ->SetYTitle("Centrality (%)");
1726  fOutputList->Add(fhClusCen[i]);
1727 
1728  fhClusCenMax[i] = new TH2F(Form("hClusCenMax%s",hName[i].Data()),
1729  Form("maximum energy cluster per event vs centrality for %s",hTitle[i].Data()),
1730  fNBinsClusterE,0,fMaxClusterE,100, 0, 100);
1731  fhClusCenMax[i]->SetXTitle("Energy (GeV)");
1732  fhClusCenMax[i]->SetYTitle("Centrality (%)");
1733  fOutputList->Add(fhClusCenMax[i]);
1734  }
1735 
1736  // Cluster histograms, E vs V0
1737 
1738  if(fFillV0SigHisto)
1739  {
1740  fhClusV0[i] = new TH2F(Form("hClusV0%s",hName[i].Data()),
1741  Form("clusters E distribution vs V0 for %s",hTitle[i].Data()),
1743  fhClusV0[i] ->SetXTitle("Energy (GeV)");
1744  fhClusV0[i] ->SetYTitle("V0");
1745  fOutputList->Add(fhClusV0[i]);
1746 
1747  fhClusV0Max[i] = new TH2F(Form("hClusV0Max%s",hName[i].Data()),
1748  Form("maximum energy cluster per event vs V0 for %s",hTitle[i].Data()),
1750  fhClusV0Max[i]->SetXTitle("Energy (GeV)");
1751  fhClusV0Max[i]->SetYTitle("V0");
1752  fOutputList->Add(fhClusV0Max[i]);
1753  }
1754 
1755  // SM dependent histograms
1756  for(Int_t ism = fFirstSM; ism <= fLastSM; ism++)
1757  {
1758  fhClusSM[i][ism] = new TH1F(Form("hClus%s_SM%d",hName[i].Data(),ism),
1759  Form("clusters E distribution for %s and SM%d",hTitle[i].Data(), ism),
1761  fhClusSM[i][ism]->SetXTitle("Energy (GeV)");
1762  fOutputList->Add(fhClusSM[i][ism]);
1763 
1764  if(fFillCenHisto)
1765  {
1766  fhClusCenSM[i][ism] = new TH2F(Form("hClusCen%s_SM%d",hName[i].Data(),ism),
1767  Form("clusters E distribution vs centrality for %s and SM%d",hTitle[i].Data(),ism),
1768  fNBinsClusterE,0,fMaxClusterE,100, 0, 100);
1769  fhClusCenSM[i][ism]->SetXTitle("Energy (GeV)");
1770  fhClusCenSM[i][ism]->SetYTitle("Centrality");
1771  fOutputList->Add(fhClusCenSM[i][ism] );
1772  }
1773 
1774  if(fFillV0SigHisto)
1775  {
1776  fhClusV0SM[i][ism] = new TH2F(Form("hClusV0%s_SM%d",hName[i].Data(),ism),
1777  Form("clusters E distribution vs V0 for %s and SM%d",hTitle[i].Data(),ism),
1779  fhClusV0SM[i][ism]->SetXTitle("Energy (GeV)");
1780  fhClusV0SM[i][ism]->SetYTitle("V0");
1781  fOutputList->Add(fhClusV0SM[i][ism] );
1782  }
1783  }
1784 
1785  // Cluster histograms, Pseudorapidity vs Azimuthal angle
1786 
1787  fhClusEtaPhiHigh[i] = new TH2F(Form("hClusEtaPhiHigh%s",hName[i].Data()),
1788  Form("clusters distribution #eta vs #phi for %s, E > %1.1f GeV",hTitle[i].Data(),fEtaPhiEnMin),
1790  fhClusEtaPhiHigh[i] ->SetXTitle("#eta");
1791  fhClusEtaPhiHigh[i] ->SetYTitle("#phi (rad)");
1792  fOutputList->Add(fhClusEtaPhiHigh[i]);
1793 
1794  fhClusEtaPhiLow[i] = new TH2F(Form("hClusEtaPhiLow%s",hName[i].Data()),
1795  Form("clusters distribution #eta vs #phi for %s, E < %1.1f GeV",hTitle[i].Data(),fEtaPhiEnMin),
1797  fhClusEtaPhiLow[i] ->SetXTitle("#eta");
1798  fhClusEtaPhiLow[i] ->SetYTitle("#phi (rad)");
1799  fOutputList->Add(fhClusEtaPhiLow[i]);
1800 
1802  {
1803  fhClusEtaPhiHighCluMax[i] = new TH2F(Form("hClusEtaPhiHighCluMax%s",hName[i].Data()),
1804  Form("maximum energy cluster per event #eta vs #phi for %s, E > %1.1f GeV",hTitle[i].Data(),fEtaPhiEnMin),
1806  fhClusEtaPhiHighCluMax[i]->SetXTitle("#eta");
1807  fhClusEtaPhiHighCluMax[i]->SetYTitle("#phi (rad)");
1809 
1810  fhClusEtaPhiLowCluMax[i] = new TH2F(Form("hClusEtaPhiLowCluMax%s",hName[i].Data()),
1811  Form("maximum energy cluster per event #eta vs #phi for %s, E < %1.1f GeV",hTitle[i].Data(),fEtaPhiEnMin),
1813  fhClusEtaPhiLowCluMax[i]->SetXTitle("#eta");
1814  fhClusEtaPhiLowCluMax[i]->SetYTitle("#phi (rad)");
1816 
1817  fhClusEtaPhiHighCellMax[i] = new TH2F(Form("hClusEtaPhiHighCellMax%s",hName[i].Data()),
1818  Form("Cluster hit map in calorimeter (max cell), column vs row for %s, E > %1.1f GeV",hTitle[i].Data(),fEtaPhiEnMin),
1819  fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
1820  fhClusEtaPhiHighCellMax[i] ->SetXTitle("Index #eta (columnns)");
1821  fhClusEtaPhiHighCellMax[i] ->SetYTitle("Index #phi (rows)");
1823 
1824  fhClusEtaPhiHighCellMaxCluMax[i] = new TH2F(Form("hClusEtaPhiHighCellMaxCluMax%s",hName[i].Data()),
1825  Form("Max E cluster hit map in calorimeter (max cell), column vs row for %s, E > %1.1f GeV",
1826  hTitle[i].Data(),fEtaPhiEnMin),fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
1827  fhClusEtaPhiHighCellMaxCluMax[i]->SetXTitle("Index #eta (columnns)");
1828  fhClusEtaPhiHighCellMaxCluMax[i]->SetYTitle("Index #phi (rows)");
1830 
1831  fhClusEtaPhiLowCellMax[i] = new TH2F(Form("hClusEtaPhiLowCellMax%s",hName[i].Data()),
1832  Form("Cluster hit map in calorimeter (max cell), column vs row for %s, E < %1.1f GeV",hTitle[i].Data(),fEtaPhiEnMin),
1833  fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
1834  fhClusEtaPhiLowCellMax[i] ->SetXTitle("Index #eta (columnns)");
1835  fhClusEtaPhiLowCellMax[i] ->SetYTitle("#phi (rad)");
1837 
1838  fhClusEtaPhiLowCellMaxCluMax[i] = new TH2F(Form("hClusEtaPhiLowCellMaxCluMax%s",hName[i].Data()),
1839  Form("Max E cluster hit map in calorimeter (max cell), column vs row for %s, E < %1.1f GeV",
1840  hTitle[i].Data(),fEtaPhiEnMin),fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
1841  fhClusEtaPhiLowCellMaxCluMax[i]->SetXTitle("Index #eta (columnns)");
1842  fhClusEtaPhiLowCellMaxCluMax[i]->SetYTitle("#phi (rad)");
1844 
1845  // Cluster histograms, E vs Pseudorapidity
1846 
1847  fhClusEta[i] = new TH2F(Form("hClusEta%s",hName[i].Data()),
1848  Form("clusters distribution vs #eta for %s",hTitle[i].Data()),
1850  fhClusEta[i] ->SetXTitle("Energy (GeV)");
1851  fhClusEta[i] ->SetYTitle("#eta");
1852  fOutputList->Add(fhClusEta[i]);
1853 
1854  fhClusEtaMax[i] = new TH2F(Form("hClusEtaMax%s",hName[i].Data()),
1855  Form("maximum energy cluster per event vs #eta for %s",hTitle[i].Data()),
1857  fhClusEtaMax[i]->SetXTitle("Energy (GeV)");
1858  fhClusEtaMax[i]->SetYTitle("#eta");
1859  fOutputList->Add(fhClusEtaMax[i]);
1860 
1861  // Cluster histograms, E vs Azimuthal angle
1862 
1863  fhClusPhi[i] = new TH2F(Form("hClusPhi%s",hName[i].Data()),
1864  Form("clusters distribution vs #phi for %s",hTitle[i].Data()),
1866  fhClusPhi[i] ->SetXTitle("Energy (GeV)");
1867  fhClusPhi[i] ->SetYTitle("#phi (rad)");
1868  fOutputList->Add(fhClusPhi[i]);
1869 
1870  fhClusPhiMax[i] = new TH2F(Form("hClusPhiMax%s",hName[i].Data()),
1871  Form("maximum energy cluster per event vs #phi for %s",hTitle[i].Data()),
1873  fhClusPhiMax[i]->SetXTitle("Energy (GeV)");
1874  fhClusPhiMax[i]->SetYTitle("#phi (rad)");
1875  fOutputList->Add(fhClusPhiMax[i]);
1876  }
1877  }
1878 
1879  PostData(1, fOutputList);
1880 }
1881 
1882 //______________________________________________________
1883 // Main method executed per event, all the action is happens here.
1884 //______________________________________________________
1886 {
1887  AliVEvent* event = InputEvent();
1888 
1889  if (!event)
1890  {
1891  AliError("No Event, exit");
1892  return;
1893  }
1894 
1896  // Execute task on physics events with triggers
1897 
1898  //trigger configuration
1899  TString triggerclasses = event->GetFiredTriggerClasses();
1900 
1901  // event type
1902  Int_t eventType = ((AliVHeader*)event->GetHeader())->GetEventType();
1903 
1904  if(!fMCData)
1905  {
1906  // physics events eventType=7, select only those
1907  if(triggerclasses=="" || eventType != 7) return;
1908  }
1909 
1910  //printf("Event Type %d; Trigger classes: %s\n",eventType,triggerclasses.Data());
1911 
1912  // Check what trigger we had
1913  SetTriggerEventBit(triggerclasses);
1914 
1915  if(!fEventMB && !fEventL0 && !fEventL1G && !fEventL1G2 && !fEventL1J && ! fEventL1J2 && !fEventCen && !fEventSem) return;
1916 
1918  // Init geometry, OADB, maps
1919 
1920  InitGeometry(); // only once, must be done before OADB, geo OADB accessed here
1921 
1922  InitCellPatchMaps(); //init to 0 map for cells and patches
1923 
1925  // Do the analysis
1926 
1928 
1929  FillCellMaps();
1930 
1931  FillTriggerPatchMaps(triggerclasses);
1932 
1933  //if(!fEventMB)printf("MB : %d; L0 : %d; L1-Gam1 : %d; L1-Gam2 : %d; L1-Jet1 : %d; L1-Jet2 : %d; Central : %d; SemiCentral : %d; Trigger Names : %s \n",
1934  // fEventMB,fEventL0,fEventL1G,fEventL1G2,fEventL1J,fEventL1J2,fEventCen,fEventSem,triggerclasses.Data());
1935 
1937 
1938  FillV0Histograms();
1939 
1941 
1943 
1944  // FEE vs STU vs TRU
1945  //FillCorrelationHistograms();
1946 
1947  ClusterAnalysis();
1948 
1949  PostData(1, fOutputList);
1950 
1951 }
Bool_t fEventSem
Bit for Semi Central events.
Bool_t fEventL1JD
Bit for L1 Jet 1 events, DCal.
TH2F * fhL0Amp
! FALTRO signal per Row and Column for FOR involves L0 patch
ClassImp(AliAnalysisTaskTriggerRates) AliAnalysisTaskTriggerRates
TH2F * fhL1Amp
! STU signal per Row and Column for FOR involves L0 patch
void FillTriggerPatchMaps(TString triggerclasses)
Fill L0, L1 patch arrays.
TH2F * fhClusCenSM[fgkTriggerCombi][20]
! Clusters Centrality vs E distribution for a trigger, per SM
TH2F * fhClusPhi[fgkTriggerCombi]
! Clusters Phi vs E distribution for a trigger
void UserCreateOutputObjects()
Init histograms and geometry.
TH2F * fhNPatchFake
! number of fake patchs per event vs. if all were fakes or not
TH2F * fhL1GPatchMax
! FOR of max. amplitude patch with L1 Gamma patch associated
static const int fgkFALTROCols
Total number of fake altro collumns in EMCAL, (ALTRO channels in one SM times 2 SM divided by 2 per F...
TH1F * fhClusMax[fgkTriggerCombi]
! Maximum E Cluster per event distribution for MB trigger
TH2F * fhClusV0[fgkTriggerCombi]
! Clusters V0 vs E distribution for a trigger
TH2F * fhNPatchNotFake
! number of non fake patchs per events vs. if all were fakes or not
TH2F * fhClusPhiMax[fgkTriggerCombi]
! Maximum E Cluster vs Phi per event distribution for a trigger
TH2F * fhClusCenMax[fgkTriggerCombi]
! Maximum E Cluster vs Centrality per event distribution for a trigger
TH2F * fhL1JPatch
! FOR with L1 Jet patch associated
void FillV0Histograms()
Fill V0 histograms, only for ESDs.
TH2F * fhL1J2Patch
! FOR with L1 Jet patch associated
TProfile2D * fhFORMeanAmp
! Mean FastOR(FEE) signal per Row and Column
void AccessOADB()
Set the AODB bad channels at least once.
void FillL1JetPatchHistograms()
L1 jet trigger patches histograms.
void FillCorrelationHistograms()
FEE-TRU-STU correlation checks.
static const int fgkFALTRORows
Total number of fake altro rows in EMCAL, temporary, not considers DCal yet (ALTRO channels in one SM...
centrality
TH2F * fhClusEtaPhiHighCellMaxCluMax[fgkTriggerCombi]
! Maximum E Cluster, maximum energy cell index Phi vs Eta per event distribution for MB trigger...
TH2F * fhClusEtaPhiHighCellMax[fgkTriggerCombi]
! Clusters maximum energy cell index eta vs phi distribution for a trigger, energy above fEtaPhiEnMin...
TH2F * fhClusEtaPhiLowCellMax[fgkTriggerCombi]
! Clusters maximum energy cell index eta vs phi distribution for a trigger, energy below fEtaPhiEnMin...
TProfile2D * fhL0MeanAmp
! Mean FastOR(TRU) signal per Row and Column
TH2F * fhClusEta[fgkTriggerCombi]
! Clusters eta vs E distribution for a trigger
void FillEventCounterHistogram()
Fill a TH1 histogram, each bin corresponds to a even trigger type.
Bool_t fEventL1GD
Bit for L1 Gamma 1 events, DCal.
TH2F * fhClusEtaPhiHighCluMax[fgkTriggerCombi]
! Maximum E Cluster, Phi vs Eta per event distribution for a trigger, energy above fEtaPhiEnMin GeV ...
TH2F * fhL0AmpL1G
! FALTRO signal per Row and Column for FOR involves L0 patch, with L1G trigger event ...
TH2F * fhClusEtaPhiLowCellMaxCluMax[fgkTriggerCombi]
! Maximum E Cluster, maximum energy cell index Phi vs Eta per event distribution for MB trigger...
AliEMCALGeometry * fGeometry
Access to EMCAL geometry utils.
TH2F * fhL1JPatchMax
! FOR of max. amplitude patch with L1 Jet patch associated
TH1F * fhNEvents
! Number of selected events
AliEMCALRecoUtils * fRecoUtils
RecoUtils.
Double_t fMapTrigL1J2[fgkFALTRORows][fgkFALTROCols]
TH1F * fhL1GPatchAllFakeE
! Energy distrib of FOR forfake events, all patch energy
TH1F * fhL1GPatchNotFakeE
! Energy distrib of FOR for non fake events, all patch energy
TH2F * fhL1GAmp
! STU signal per Row and Column for FOR position of L1 Gamma patch (top-left)
TH2F * fhL0Patch
! FOR with L0 patch associated
TH1F * fhClusSM[fgkTriggerCombi][20]
! Clusters E distribution for a trigger, per SM
Double_t fMapTrigL0L1G[fgkFALTRORows][fgkFALTROCols]
TString fGeoName
Name of geometry used.
TH2F * fhL1JAmp
! STU signal per Row and Column for FOR position of L1 Jet patch (top-left)
TH2F * fhFORAmpL1G
! FEE cells deposited energy, grouped like FastOR 2x2 per Row and Column, with L1 Gamma trigger event...
Double_t fMapTrigL0[fgkFALTRORows][fgkFALTROCols]
TH1F * fhV0[fgkTriggerCombi]
! V0 distribution for a triggered event
Bool_t fAccessOADB
Get calibration from OADB for EMCAL.
TH2F * fhL1GPatchAllFakeMax
! FOR without any L1 Gamma patch associated with energy in the related cell, maximal energy patch : f...
TH1F * fhClusMBPure[3]
! Clusters E distribution for pure MB trigger
TH2F * fhL1G2Patch
! FOR with L1 Gamma patch associated
Float_t fTRUTotal
Sum of TRU amplitudes.
Double_t fMapTrigL1[fgkFALTRORows][fgkFALTROCols]
Double_t fMapTrigL1G[fgkFALTRORows][fgkFALTROCols]
TH2F * fhL0AmpL1J
! FALTRO signal per Row and Column for FOR involves L0 patch, with L1J trigger event ...
void Init()
Init analysis parameters not set before.
TH2F * fhJPMaxVV0TT
! V0 signal vs maximum jet L1 patch
TH1F * fhClus[fgkTriggerCombi]
! Clusters E distribution for a trigger
TH2F * fhTRUSTU
! Correlation TRU vs STU
TH1F * fhL1GPatchAllFakeMaxE
! Energy distrib FOR for fake events, patch of maximal energy
TString fCentEstimator
Centrality estimator string: V0M, TKL, FMD, ZEMvsZDC, ...
Bool_t fEventL1J2D
Bit for L1 JEt 2 events, DCal.
TH2F * fhClusEtaPhiLowCluMax[fgkTriggerCombi]
! Maximum E Cluster, Phi vs Eta per event distribution for MB trigger, energy below fEtaPhiEnMin GeV ...
TH2F * fhL1GPatchNotAllFakeMax
! FOR with at least one L1 Gamma patch associated with energy in the related cell, maximal energy patch : not fake events
TH2F * fhFORAmpL1J2
! FEE cells deposited energy, grouped like FastOR 2x2 per Row and Column, with L1 Jet2 trigger event ...
TH2F * fhL1GPatchAllFake
! FOR without any L1 Gamma patch associated with energy in the related cells: fake patch ...
TH1F * fhClusMaxMBPure[3]
! Maximum E Cluster per event distribution for pure MB trigger
TH2F * fhClusEtaMax[fgkTriggerCombi]
! Maximum E Cluster vs Eta per event distribution for a trigger
Bool_t fEventL1J
Bit for L1 Jet 1 events.
TH2F * fhL1J2Amp
! STU signal per Row and Column for FOR position of L1 Jet2 patch (top-left)
TH2F * fhFEESTU
! Correlation FEE vs STU
Int_t fFirstSM
Fill SM histograms for SM >= fFirstSM.
TH2F * fhL1J2PatchMax
! FOR of max. amplitude patch with L1 Jet patch associated
void FillL1GammaPatchHistograms()
L1 Gamma trigger patches histograms.
TH2F * fhClusEtaPhiHigh[fgkTriggerCombi]
! Clusters eta vs phi distribution for a trigger, energy above fEtaPhiEnMin GeV
void FillClusterHistograms(Int_t triggerNumber, Bool_t maxCluster, Float_t e, Float_t eta, Float_t phi, Float_t ietamax, Float_t iphimax, Int_t sm, Float_t centrality, Float_t v0AC)
Bool_t fEventL1J2
Bit for L1 JEt 2 events.
TH2F * fhClusV0SM[fgkTriggerCombi][20]
! Clusters V0 vs E distribution for a trigger, per SM
Double_t fMapCellL1G[fgkFALTRORows][fgkFALTROCols]
static const int fgkTriggerCombi
Total number of trigger combinations defined above.
TH2F * fhClusCen[fgkTriggerCombi]
! Clusters Centrality vs E distribution for a trigger
Double_t fMapTrigL1G2[fgkFALTRORows][fgkFALTROCols]
Bool_t Data(TH1F *h, Double_t *rangefit, Bool_t writefit, Double_t &sgn, Double_t &errsgn, Double_t &bkg, Double_t &errbkg, Double_t &sgnf, Double_t &errsgnf, Double_t &sigmafit, Int_t &status)
void FillMapHistograms()
Matrix with signal per channel.
TH2F * fhL1G2PatchMax
! FOR of max. amplitude patch with L1 Gamma patch associated
TH1F * fhCentrality[fgkTriggerCombi]
! Centrality distribution for a triggered event
Bool_t fFillV0SigHisto
V0 signal creation and fill.
TH1F * fhL1GPatchNotAllFakeE
! Energy distrib of FOR for non fake events, all patch energy
TH2F * fhFORAmp
! FEE cells deposited energy, grouped like FastOR 2x2 per Row and Column
void InitHistogramArrays()
Histograms array initialization called in constructor.
Bool_t fEventL1G2D
Bit for L1 Gamma 2 events, DCal.
TProfile2D * fhL1MeanAmp
! Mean FastOR(STU) signal per Row and Column
Bool_t fFillClusAcceptHisto
Fill eta/phi distributions.
TH2I * fhV0STU
! Total signal STU vs V0C+V0S
Bool_t fEventL0D
Bit for L0 events, DCal.
TString fOADBFilePath
Default path $ALICE_PHYSICS/OADB/EMCAL, if needed change.
Bool_t fFillCenHisto
Centrality histograms creation and fill.
TLorentzVector fMomentum
Cluster kinematics, temporal, avoid recreation per event.
TH2F * fhL1GPatchNotFake
! FOR with L1 Gamma patch associated but no energy in the related cells
TFile * file
const Double_t etamax
Int_t fLastSM
Fill SM histograms for SM <= fLastSM.
Bool_t fEventL1G2
Bit for L1 Gamma 2 events.
TH2F * fhL1GPatchFake
! FOR with L1 Gamma patch associated
Double_t fMapCellL1J2[fgkFALTRORows][fgkFALTROCols]
Double_t fMapCellL1G2[fgkFALTRORows][fgkFALTROCols]
void FillCellMaps()
Cells analysis. Fill FEE energy per channel array.
TH2F * fhClusEtaPhiLow[fgkTriggerCombi]
! Clusters eta vs phi distribution for a trigger, energy below fEtaPhiEnMin GeV
Float_t fV0Trigger
V0 signal from trigger.
TH2F * fhL1GPatchNotAllFake
! FOR with at least 1 L1 Gamma patch associated that has energy in the related celles : not a fake ev...
TH1F * fhL1GPatchNotAllFakeMaxE
! Energy distrib of FOR for non fake events, patch of maximal energy
TH2F * fhGPMaxVV0TT
! V0 signal vs maximum gamma L1 patch
Float_t fEtaPhiEnMin
Min energy for Eta/Phi histograms.
Fill histograms with basic QA information for EMCAL offline trigger.
Bool_t fEventCen
Bit for Central events.
TH2F * fhClusV0Max[fgkTriggerCombi]
! Maximum E Cluster vs Centrality per event distribution for a trigger
TH2F * fhFORAmpL1J
! FEE cells deposited energy, grouped like FastOR 2x2 per Row and Column, with L1 Jet trigger event ...
Double_t fMapCell[fgkFALTRORows][fgkFALTROCols]
TH2F * fhFORAmpL1G2
! FEE cells deposited energy, grouped like FastOR 2x2 per Row and Column, with L1 Gamma2 trigger even...
TH2F * fhL1FOREnergy
! STU signal per Row and Column for FOR position vs FOR energy
Double_t fMapTrigL0L1J[fgkFALTRORows][fgkFALTROCols]
Bool_t fOADBSet
AODB parameters already set.
TH2F * fhL1G2Amp
! STU signal per Row and Column for FOR position of L1 Gamma2 patch (top-left)
void SetTriggerEventBit(TString list)
Check what trigger is the event, set the corresponding bit.
Double_t fMapCellL1J[fgkFALTRORows][fgkFALTROCols]
TH1F * fhL1GPatchFakeE
! Energy distrib of FOR for fake events, all patch energy
Double_t fMapTrigL1J[fgkFALTRORows][fgkFALTROCols]
Bool_t fEventL1G
Bit for L1 Gamma 1 events.
TH2F * fhL1GPatch
! FOR with L1 Gamma patch associated