]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGGA/EMCALTasks/AliAnalysisTaskEMCALTriggerQA.cxx
try to fix coverity on non static array indexes plus cosmetics
[u/mrichter/AliRoot.git] / PWGGA / EMCALTasks / AliAnalysisTaskEMCALTriggerQA.cxx
CommitLineData
863e74f5 1 /**************************************************************************
bce9493b 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
863e74f5 16//------------------------------------------------------------------------//
bce9493b 17// Fill histograms with basic QA information for EMCAL offline trigger //
e395081d 18// Author: Nicolas Arbor (LPSC-Grenoble), Rachid Guernane (LPSC-Grenoble)//
bce9493b 19// Gustavo Conesa Balbastre (LPSC-Grenoble) //
20// //
863e74f5 21// $Id$ //
bce9493b 22//------------------------------------------------------------------------//
23
bce9493b 24#include <TList.h>
bce9493b 25#include <TH2F.h>
26#include <TF1.h>
863e74f5 27#include <TProfile2D.h>
3200214a 28#include <TStreamerInfo.h>
29#include <TFile.h>
bce9493b 30
31#include "AliLog.h"
32#include "AliVCluster.h"
33#include "AliVCaloCells.h"
34#include "AliVEvent.h"
ec77a234 35#include "AliCentrality.h"
36
997b261e 37#include "AliVEvent.h"
38//#include "AliVVZERO.h"
39#include "AliVCaloTrigger.h"
40
41//#include "AliESDEvent.h"
bce9493b 42#include "AliESDVZERO.h"
997b261e 43//#include "AliESDCaloTrigger.h"
44
bce9493b 45#include "AliEMCALGeometry.h"
6bfd1538 46#include "AliEMCALRecoUtils.h"
2b4e1cc5 47#include "AliOADBContainer.h"
31a3f95a 48#include "AliAnalysisManager.h"
bce9493b 49
50#include "AliAnalysisTaskEMCALTriggerQA.h"
51
52ClassImp(AliAnalysisTaskEMCALTriggerQA)
53
85196c29 54//______________________________________________________________
863e74f5 55AliAnalysisTaskEMCALTriggerQA::AliAnalysisTaskEMCALTriggerQA() :
56AliAnalysisTaskSE(),
ec77a234 57fOutputList(0), fRecoUtils(0x0),
863e74f5 58fGeoSet(0), fGeometry(0), fGeoName(""),
31a3f95a 59fOADBSet(kFALSE), fAccessOADB(kTRUE), fOADBFilePath(""),
60fBitEGA(0), fBitEJE(0),
61fEtaPhiEnMin(10.),
46fec84c 62fSTUTotal(0), fTRUTotal(0),
63fV0Trigger(0), fV0A(0), fV0C(0),
64fEventMB (0), fEventL0 (0),
65fEventL1G (0), fEventL1G2 (0),
66fEventL1J (0), fEventL1J2 (0),
67fEventCen (0), fEventSem (0),
31a3f95a 68//Histograms
ec77a234 69fhNEvents(0), fhFORAmp(0),
46fec84c 70fhFORAmpL1G(0), fhFORAmpL1G2(0),
71fhFORAmpL1J(0), fhFORAmpL1J2(0),
863e74f5 72fhL0Amp(0), fhL0AmpL1G(0), fhL0AmpL1J(0),
73fhL1Amp(0), fhL1GAmp(0), fhL1G2Amp(0),
74fhL1JAmp(0), fhL1J2Amp(0), fhL1FOREnergy(0),
75fhL0Patch(0), fhL1GPatch(0), fhL1G2Patch(0),
76fhL1GPatchNotFake(0), fhL1GPatchFake(0), fhL1GPatchNotAllFake(0),
77fhL1GPatchAllFake(0), fhL1GPatchNotAllFakeMax(0),
78fhL1GPatchAllFakeMax(0), fhL1GPatchNotAllFakeMaxE(0),
79fhL1GPatchAllFakeMaxE(0), fhL1GPatchNotAllFakeE(0),
80fhL1GPatchAllFakeE(0), fhL1GPatchFakeE(0),
46fec84c 81fhL1GPatchNotFakeE(0), fhNPatchFake(0), fhNPatchNotFake(0),
6be2314f 82fhL1JPatch(0), fhL1J2Patch(0),
ec77a234 83fhFEESTU(0), fhTRUSTU(0), fhV0STU(0),
84fhGPMaxVV0TT(0), fhJPMaxVV0TT(0),
85fhFORMeanAmp(0), fhL0MeanAmp(0), fhL1MeanAmp(0),
46fec84c 86fhL1GPatchMax(0), fhL1G2PatchMax(0),
87fhL1JPatchMax(0), fhL1J2PatchMax(0),
ec77a234 88//Histogram settings
89fNBinsSTUSignal (2000), fMaxSTUSignal (200000),
90fNBinsTRUSignal (2000), fMaxTRUSignal (200000),
91fNBinsV0Signal (5000), fMaxV0Signal (100000),
92fNBinsSTUFEERatio(1000), fMaxSTUFEERatio(100),
93fNBinsSTUTRURatio(1000), fMaxSTUTRURatio(100),
46fec84c 94fNBinsClusterE (500), fMaxClusterE (200),
95fMapCell (),
96fMapCellL1G (), fMapCellL1G2 (),
97fMapCellL1J (), fMapCellL1J2 (),
98fMapTrigL0 (), fMapTrigL1 (),
99fMapTrigL0L1G(), fMapTrigL0L1J(),
100fMapTrigL1G (), fMapTrigL1G2 (),
101fMapTrigL1J (), fMapTrigL1J2 ()
bce9493b 102{
103 // Constructor
863e74f5 104
31a3f95a 105 InitHistogramArrays();
106
ec77a234 107 DefineOutput(1, TList::Class());
108
863e74f5 109}
bce9493b 110
85196c29 111//______________________________________________________________________________
863e74f5 112AliAnalysisTaskEMCALTriggerQA::AliAnalysisTaskEMCALTriggerQA(const char *name) :
113AliAnalysisTaskSE(name),
ec77a234 114fOutputList(0), fRecoUtils(0x0),
863e74f5 115fGeoSet(0), fGeometry(0), fGeoName(""),
31a3f95a 116fOADBSet(kFALSE), fAccessOADB(kTRUE), fOADBFilePath(""),
117fBitEGA(0), fBitEJE(0),
118fEtaPhiEnMin(10.),
46fec84c 119fSTUTotal(0), fTRUTotal(0),
120fV0Trigger(0), fV0A(0), fV0C(0),
121fEventMB (0), fEventL0 (0),
122fEventL1G (0), fEventL1G2 (0),
123fEventL1J (0), fEventL1J2 (0),
124fEventCen (0), fEventSem (0),
31a3f95a 125//Histograms
ec77a234 126fhNEvents(0), fhFORAmp(0),
46fec84c 127fhFORAmpL1G(0), fhFORAmpL1G2(0),
128fhFORAmpL1J(0), fhFORAmpL1J2(0),
863e74f5 129fhL0Amp(0), fhL0AmpL1G(0), fhL0AmpL1J(0),
130fhL1Amp(0), fhL1GAmp(0), fhL1G2Amp(0),
131fhL1JAmp(0), fhL1J2Amp(0), fhL1FOREnergy(0),
132fhL0Patch(0), fhL1GPatch(0), fhL1G2Patch(0),
133fhL1GPatchNotFake(0), fhL1GPatchFake(0), fhL1GPatchNotAllFake(0),
134fhL1GPatchAllFake(0), fhL1GPatchNotAllFakeMax(0),
135fhL1GPatchAllFakeMax(0), fhL1GPatchNotAllFakeMaxE(0),
136fhL1GPatchAllFakeMaxE(0), fhL1GPatchNotAllFakeE(0),
137fhL1GPatchAllFakeE(0), fhL1GPatchFakeE(0),
46fec84c 138fhL1GPatchNotFakeE(0), fhNPatchFake(0), fhNPatchNotFake(0),
6be2314f 139fhL1JPatch(0), fhL1J2Patch(0),
ec77a234 140fhFEESTU(0), fhTRUSTU(0), fhV0STU(0),
141fhGPMaxVV0TT(0), fhJPMaxVV0TT(0),
142fhFORMeanAmp(0), fhL0MeanAmp(0), fhL1MeanAmp(0),
46fec84c 143fhL1GPatchMax(0), fhL1G2PatchMax(0),
144fhL1JPatchMax(0), fhL1J2PatchMax(0),
ec77a234 145//Histogram settings
146fNBinsSTUSignal (2000), fMaxSTUSignal (200000),
147fNBinsTRUSignal (2000), fMaxTRUSignal (200000),
148fNBinsV0Signal (5000), fMaxV0Signal (100000),
149fNBinsSTUFEERatio(1000), fMaxSTUFEERatio(100),
150fNBinsSTUTRURatio(1000), fMaxSTUTRURatio(100),
46fec84c 151fNBinsClusterE (500), fMaxClusterE (200),
152fMapCell (),
153fMapCellL1G (), fMapCellL1G2 (),
154fMapCellL1J (), fMapCellL1J2 (),
155fMapTrigL0 (), fMapTrigL1 (),
156fMapTrigL0L1G(), fMapTrigL0L1J(),
157fMapTrigL1G (), fMapTrigL1G2 (),
158fMapTrigL1J (), fMapTrigL1J2 ()
bce9493b 159{
160 // Constructor
863e74f5 161
31a3f95a 162 InitHistogramArrays();
863e74f5 163
2b4e1cc5 164 DefineOutput(1, TList::Class());
bce9493b 165
2b4e1cc5 166}
167
2b4e1cc5 168//______________________________________________
169void AliAnalysisTaskEMCALTriggerQA::AccessOADB()
170{
171 // Set the AODB bad channels at least once
ec77a234 172
2b4e1cc5 173 //Set it only once
863e74f5 174 if(fOADBSet) return ;
31a3f95a 175
863e74f5 176 if(fOADBFilePath == "") fOADBFilePath = "$ALICE_ROOT/OADB/EMCAL" ;
2b4e1cc5 177
178 Int_t runnumber = InputEvent()->GetRunNumber() ;
179
180 if(DebugLevel() > 0)
181 printf("AliAnalysisTaskEMCALClusterize::SetOADBParameters() - Get AODB parameters from EMCAL in %s for run %d\n",fOADBFilePath.Data(),runnumber);
182
183 Int_t nSM = fGeometry->GetNumberOfSuperModules();
184
185 // Bad map
186 if(fRecoUtils->IsBadChannelsRemovalSwitchedOn())
187 {
188 AliOADBContainer *contBC=new AliOADBContainer("");
863e74f5 189 contBC->InitFromFile(Form("%s/EMCALBadChannels.root",fOADBFilePath.Data()),"AliEMCALBadChannels");
2b4e1cc5 190
191 TObjArray *arrayBC=(TObjArray*)contBC->GetObject(runnumber);
192
193 if(arrayBC)
863e74f5 194 {
2b4e1cc5 195 if(DebugLevel() > 0)
196 printf("AliAnalysisTaskEMCALClusterize::SetOADBParameters() - Remove EMCAL bad cells \n");
197
863e74f5 198 for (Int_t i=0; i<nSM; ++i)
2b4e1cc5 199 {
200 TH2I *hbm = fRecoUtils->GetEMCALChannelStatusMap(i);
201
202 if (hbm)
203 delete hbm;
204
205 hbm=(TH2I*)arrayBC->FindObject(Form("EMCALBadChannelMap_Mod%d",i));
206
863e74f5 207 if (!hbm)
2b4e1cc5 208 {
209 AliError(Form("Can not get EMCALBadChannelMap_Mod%d",i));
210 continue;
211 }
212
213 hbm->SetDirectory(0);
214 fRecoUtils->SetEMCALChannelStatusMap(i,hbm);
215
216 } // loop
217 } else if(DebugLevel() > 0)
218 printf("AliAnalysisTaskEMCALClusterize::SetOADBParameters() - Do NOT remove EMCAL bad channels\n"); // run array
219 } // Remove bad
66bdaa44 220
221 fOADBSet = kTRUE;
222
863e74f5 223}
2b4e1cc5 224
46fec84c 225//________________________________________________
226void AliAnalysisTaskEMCALTriggerQA::FillCellMaps()
227{
228 // Cells analysis
229 // Fill FEE energy per channel array
230 Int_t posX = -1, posY = -1;
231 Int_t nSupMod = -1, ieta = -1, iphi = -1, nModule = -1, nIphi = -1, nIeta = -1;
232 Short_t absId = -1;
233 Int_t nCells = 0;
234
235 AliVCaloCells& cells= *(InputEvent()->GetEMCALCells());
236
237 if(cells.IsEMCAL())
238 {
239 for (Int_t icell = 0; icell < cells.GetNumberOfCells(); icell++)
240 {
241 nCells ++;
242
243 Double_t amp =0., time = 0., efrac = 0;
244 Int_t mclabel = -1;
245
246 cells.GetCell(icell, absId, amp, time,mclabel,efrac);
247
248 fGeometry->GetCellIndex(absId, nSupMod, nModule, nIphi, nIeta);
249 fGeometry->GetCellPhiEtaIndexInSModule(nSupMod, nModule, nIphi, nIeta, iphi, ieta);
250
251 posX = (nSupMod % 2) ? ieta + AliEMCALGeoParams::fgkEMCALCols : ieta;
252 posY = iphi + AliEMCALGeoParams::fgkEMCALRows * int(nSupMod / 2);
253
73c5a035 254 Int_t indexX = Int_t(posX/2);
255 Int_t indexY = Int_t(posY/2);
256
257 if(indexX > fgkFALTROCols || indexY > fgkFALTRORows )
46fec84c 258 {
259 if(DebugLevel() > 0) printf("AliAnalysisTaskEMCALTriggerQA::UserExec() - Wrong Position (x,y) = (%d,%d)\n",posX,posY);
260 continue;
261 }
262
263 // here it is the amplitude for each cell
73c5a035 264 fMapCell[indexY][indexX] += amp;
46fec84c 265
266 if(fEventL1G)
267 {
73c5a035 268 fMapCellL1G[indexY][indexX] += amp;
269 //printf("L1G cell[%i,%i] amp=%f\n",indexY,indexX,fMapCellL1G[indexY][indexX]);
46fec84c 270 }
271
272 if(fEventL1G2)
273 {
73c5a035 274 fMapCellL1G2[indexY][indexX] += amp;
275 //printf("L1G2 cell[%i,%i] amp=%f\n",indexY,indexX,fMapCellL1G2[indexY][indexX]);
46fec84c 276 }
277
73c5a035 278 if(fEventL1J) fMapCellL1J [indexY][indexX] += amp;
279 if(fEventL1J2) fMapCellL1J2[indexY][indexX] += amp;
46fec84c 280
73c5a035 281 //printf("cell[%i,%i] amp=%f\n",indexY,indexX,fMapCell[indexY][indexX]);
46fec84c 282
283 }
284 }
285
286}
287
288//______________________________________________________________________________
289void AliAnalysisTaskEMCALTriggerQA::FillTriggerPatchMaps(TString triggerclasses)
290{
291 // Trigger analysis, fill L0, L1 arrays
292
293 AliVCaloTrigger& trg= * (InputEvent()->GetCaloTrigger("EMCAL"));
294
295 fV0Trigger = trg.GetL1V0(0)+trg.GetL1V0(1); // used elsewhere
296
297 Int_t posX = -1, posY = -1;
298
299 Int_t nL0Patch = 0 ;
300 //Int_t nL1Patch = 0 ;
301 fSTUTotal = 0;
302 fTRUTotal = 0;
303
304 trg.Reset();
305 // loop on FASTOR
306
307 while (trg.Next())
308 {
309 trg.GetPosition(posX,posY);
310
311 if (posX > -1 && posY > -1)
312 {
313 //L0 analysis
314 Int_t nTimes = 0;
315 trg.GetNL0Times(nTimes);
316 Int_t l0Times[10];
317 trg.GetL0Times(l0Times);
318
319 Float_t ampL0 = 0.;
320 trg.GetAmplitude(ampL0);
321 if (ampL0 > 0) fMapTrigL0[posY][posX] = ampL0;
322
323 if(triggerclasses.Contains("CEMC7EGA-B-NOPF-CENTNOTRD") || triggerclasses.Contains("CPBI2EGA") || triggerclasses.Contains("CPBI2EG1")) fMapTrigL0L1G[posY][posX] += ampL0;
324 if(triggerclasses.Contains("CEMC7EJE-B-NOPF-CENTNOTRD") || triggerclasses.Contains("CPBI2EJE") || triggerclasses.Contains("CPBI2EJ1")) fMapTrigL0L1J[posY][posX] += ampL0;
325 fTRUTotal += ampL0;
326
327 int l0fired = 0;
328 for (int itime = 0; itime < nTimes; itime++)
329 {
330 if (l0Times[itime] > 7 && l0Times[itime] < 10) l0fired = 1;
331 // time bin too open? restrict to time bin 8-9?
332 }
333
334 if (l0fired)
335 {
336 nL0Patch += nTimes;
337 fhL0Patch->Fill(posX,posY);
338 }
339
340 //L1 analysis
341 Int_t bit = 0;
342 trg.GetTriggerBits(bit);
343
344 Int_t ts = 0;
345 trg.GetL1TimeSum(ts);
346 if (ts > 0) fMapTrigL1[posY][posX] = ts;
347 fSTUTotal += ts;
348 // cout << "ts =" <<ts<<endl;
349
350 //L1
28da9717 351 Bool_t isEGA1 = ((bit >> fBitEGA ) & 0x1) && fEventL1G ;
352 Bool_t isEGA2 = ((bit >> (fBitEGA+1)) & 0x1) && fEventL1G2 ;
353 Bool_t isEJE1 = ((bit >> fBitEJE ) & 0x1) && fEventL1J ;
354 Bool_t isEJE2 = ((bit >> (fBitEJE+1)) & 0x1) && fEventL1J2 ;
46fec84c 355
356 //if(isEGA1 || isEGA2 || isEJE1 || isEJE2) nL1Patch++;
357 //if(isEJE1 || isEJE2) printf("Jet STU patch %d, time sum %d, posX %d , posY %d\n",nL1Patch,ts,posX, posY);
358
359 // L1-Gamma
360
361 if (isEGA1)
362 {
363 fhL1GPatch ->Fill(posX,posY);
364 if (ts > 0) fMapTrigL1G [posY][posX] = ts;
365 }
366
367 if (isEGA2)
368 {
369 fhL1G2Patch->Fill(posX,posY);
370 if (ts > 0) fMapTrigL1G2[posY][posX] = ts;
371 }
372
373 // L1-Jet
374 if (isEJE1)
375 {
376 fhL1JPatch ->Fill(posX,posY);
377 if (ts > 0) fMapTrigL1J [posY][posX] = ts;
378
379 }
380
381 if (isEJE2)
382 {
383 fhL1J2Patch->Fill(posX,posY);
384 if (ts > 0) fMapTrigL1J2[posY][posX] = ts;
385 }
386
387 }
388 }
389
390 if (!nL0Patch)
391 {
392 fEventL0 = kFALSE;
393 if (!triggerclasses.Contains("CPBI2")) fEventL1G = fEventL1G2 = fEventL1J = fEventL1J2 = kFALSE; // pp running
394 }
395
396 if(fTRUTotal > fMaxTRUSignal && DebugLevel() > 0) printf("AliAnalysisTaskEMCALTriggerQA::FillTriggerPatchMaps() - Large fTRUTotal %f\n",fTRUTotal);
397 if(fSTUTotal > fMaxSTUSignal && DebugLevel() > 0) printf("AliAnalysisTaskEMCALTriggerQA::FillTriggerPatchMaps() - Large fSTUTotal %d\n",fSTUTotal);
398
399}
400
401//___________________________________________________
402void AliAnalysisTaskEMCALTriggerQA::ClusterAnalysis()
403{
404 // Loop on clusters and fill corresponding histograms
405
406 //Get Vertex
407 Double_t v[3] = {0,0,0};
408 InputEvent()->GetPrimaryVertex()->GetXYZ(v);
409
410 //clusters distribution
411 TRefArray* caloClus = new TRefArray();
412 InputEvent()->GetEMCALClusters(caloClus);
413
414 Int_t nCaloClusters = caloClus->GetEntriesFast();
415
416 Float_t emax = 0;
417 Float_t etamax = 0;
418 Float_t phimax = 0;
419 Float_t ietamax=-1;
420 Float_t iphimax=-1;
421
422 Float_t e = 0;
423 Float_t eta = 0;
424 Float_t phi = 0;
425
426 Int_t nSupMod = -1, ieta = -1, iphi = -1;
427
428 TLorentzVector mom;
429
430 //Get vertex for momentum calculation
431 Double_t vertex[] = {0.0,0.0,0.0};
432 //InputEvent()->GetPrimaryVertex()->GetXYZ(vertex);
433
434 Float_t centrality = -1;
435 if(InputEvent()->GetCentrality()) centrality = InputEvent()->GetCentrality()->GetCentralityPercentile("V0M");
436
437 for(Int_t icalo = 0; icalo < nCaloClusters; icalo++)
438 {
439 AliVCluster *clus = (AliVCluster*) (caloClus->At(icalo));
440
441 if(!clus->IsEMCAL()) continue;
442
443 if(!fRecoUtils->IsGoodCluster(clus,fGeometry,InputEvent()->GetEMCALCells(),InputEvent()->GetBunchCrossNumber()))
444 continue;
445
446 if(clus->GetNCells() < 2) continue ; // Avoid 1 cell clusters, noisy, exotic.
447
448 clus->GetMomentum(mom, vertex);
449
450 Bool_t shared = kFALSE;
451 Int_t idAbs = -1, iphi0 = -1, ieta0 = -1;
452 fRecoUtils->GetMaxEnergyCell(fGeometry, InputEvent()->GetEMCALCells(),clus,
453 idAbs,nSupMod,ieta0,iphi0,shared);
454 //Change index to be continuous over SM
455 ieta = (nSupMod % 2) ? ieta0 + AliEMCALGeoParams::fgkEMCALCols : ieta0;
456 iphi = iphi0 + AliEMCALGeoParams::fgkEMCALRows * int(nSupMod / 2);
457 ieta/=2;
458 iphi/=2;
459
460 if(ieta > fgkFALTROCols || iphi > fgkFALTRORows )
461 printf("AliAnalysisTaskEMCALTriggerQA::UserExec() - Wrong Position (x,y) = (%d,%d)\n",ieta,iphi);
462
463 e = clus->E();
464 eta = mom.Eta();
465 phi = mom.Phi();
466
467 if(e > emax)
468 {
469 emax = e;
470 etamax = eta;
471 phimax = phi;
472 ietamax = ieta;
473 iphimax = iphi;
474 }
475
476 // Fill cluster histograms depending on the event trigger selection
477 if( fEventMB ) FillClusterHistograms(kMBTrig ,kFALSE,e,eta,phi,ieta,iphi,centrality,fV0A+fV0C);
478 if( fEventCen ) FillClusterHistograms(kCentralTrig ,kFALSE,e,eta,phi,ieta,iphi,centrality,fV0A+fV0C);
479 if( fEventSem ) FillClusterHistograms(kSemiCentralTrig,kFALSE,e,eta,phi,ieta,iphi,centrality,fV0A+fV0C);
480
481 if( fEventL0 ) FillClusterHistograms(kL0Trig ,kFALSE,e,eta,phi,ieta,iphi,centrality,fV0A+fV0C);
482 if( fEventL1G ) FillClusterHistograms(kL1GammaTrig ,kFALSE,e,eta,phi,ieta,iphi,centrality,fV0A+fV0C);
483 if( fEventL1G2) FillClusterHistograms(kL1GammaTrig2 ,kFALSE,e,eta,phi,ieta,iphi,centrality,fV0A+fV0C);
484 if( fEventL1J ) FillClusterHistograms(kL1JetTrig ,kFALSE,e,eta,phi,ieta,iphi,centrality,fV0A+fV0C);
485 if( fEventL1J2) FillClusterHistograms(kL1JetTrig2 ,kFALSE,e,eta,phi,ieta,iphi,centrality,fV0A+fV0C);
486
487 if( fEventL1G && !fEventL1J )
488 FillClusterHistograms (kL1GammaOnlyTrig,kFALSE,e,eta,phi,ieta,iphi,centrality,fV0A+fV0C);
489 if( fEventL1J && !fEventL1G )
490 FillClusterHistograms (kL1JetOnlyTrig ,kFALSE,e,eta,phi,ieta,iphi,centrality,fV0A+fV0C);
491
492 if( fEventMB && !fEventL1G && !fEventL1J && !fEventL0 ) fhClusMBPure[0] ->Fill(e);
493 if( fEventCen && !fEventL1G && !fEventL1J && !fEventL0 ) fhClusMBPure[1] ->Fill(e);
494 if( fEventSem && !fEventL1G && !fEventL1J && !fEventL0 ) fhClusMBPure[2] ->Fill(e);
495
496 }
497
498 // Maximum energy cluster per event histograms
499
500 if( fEventMB ) FillClusterHistograms(kMBTrig ,kTRUE,emax,etamax,phimax,ietamax,iphimax,centrality,fV0A+fV0C);
501 if( fEventCen ) FillClusterHistograms(kCentralTrig ,kTRUE,emax,etamax,phimax,ietamax,iphimax,centrality,fV0A+fV0C);
502 if( fEventSem ) FillClusterHistograms(kSemiCentralTrig,kTRUE,emax,etamax,phimax,ietamax,iphimax,centrality,fV0A+fV0C);
503
504 if( fEventL0 ) FillClusterHistograms(kL0Trig ,kTRUE,emax,etamax,phimax,ietamax,iphimax,centrality,fV0A+fV0C);
505 if( fEventL1G ) FillClusterHistograms(kL1GammaTrig ,kTRUE,emax,etamax,phimax,ietamax,iphimax,centrality,fV0A+fV0C);
506 if( fEventL1G2) FillClusterHistograms(kL1GammaTrig2 ,kTRUE,emax,etamax,phimax,ietamax,iphimax,centrality,fV0A+fV0C);
507 if( fEventL1J ) FillClusterHistograms(kL1JetTrig ,kTRUE,emax,etamax,phimax,ietamax,iphimax,centrality,fV0A+fV0C);
508 if( fEventL1J2) FillClusterHistograms(kL1JetTrig2 ,kTRUE,emax,etamax,phimax,ietamax,iphimax,centrality,fV0A+fV0C);
509
510 if( fEventL1G && !fEventL1J )
511 FillClusterHistograms (kL1GammaOnlyTrig,kTRUE,emax,etamax,phimax,ietamax,iphimax,centrality,fV0A+fV0C);
512 if( fEventL1J && !fEventL1G )
513 FillClusterHistograms (kL1JetOnlyTrig ,kTRUE,emax,etamax,phimax,ietamax,iphimax,centrality,fV0A+fV0C);
514
515 if( fEventMB && !fEventL1G && !fEventL1J && !fEventL0 ) fhClusMaxMBPure[0] ->Fill(emax);
516 if( fEventCen && !fEventL1G && !fEventL1J && !fEventL0 ) fhClusMaxMBPure[1] ->Fill(emax);
517 if( fEventSem && !fEventL1G && !fEventL1J && !fEventL0 ) fhClusMaxMBPure[2] ->Fill(emax);
518
519}
520
521//______________________________________________________________________________________________
69aa892c 522void AliAnalysisTaskEMCALTriggerQA::FillClusterHistograms(Int_t triggerNumber, Bool_t max,
523 Float_t e, Float_t eta, Float_t phi,
524 Float_t ieta, Float_t iphi,
46fec84c 525 Float_t centrality, Float_t fV0AC)
31a3f95a 526{
cf170170 527 //Fill normal cluster related histograms depending on the trigger type selection
528 // (10 options, MB, L0, L1 Gamma ... defined in enum triggerType)
863e74f5 529
31a3f95a 530 if(!max)
531 {
cf170170 532 fhClus [triggerNumber]->Fill(e);
533 fhClusCen[triggerNumber]->Fill(e,centrality);
46fec84c 534 fhClusV0 [triggerNumber]->Fill(e,fV0AC);
cf170170 535 fhClusEta[triggerNumber]->Fill(e,eta);
536 fhClusPhi[triggerNumber]->Fill(e,phi);
863e74f5 537
538 if(e > fEtaPhiEnMin)
31a3f95a 539 {
cf170170 540 fhClusEtaPhiHigh [triggerNumber]->Fill( eta, phi);
541 fhClusEtaPhiHighCellMax[triggerNumber]->Fill(ieta,iphi);
31a3f95a 542 }
863e74f5 543 else
544 {
cf170170 545 fhClusEtaPhiLow [triggerNumber]->Fill( eta, phi);
546 fhClusEtaPhiLowCellMax[triggerNumber]->Fill(ieta,iphi);
31a3f95a 547 }
548 }
549 else
550 {
cf170170 551 fhClusMax [triggerNumber]->Fill(e);
552 fhClusCenMax[triggerNumber]->Fill(e,centrality);
46fec84c 553 fhClusV0Max [triggerNumber]->Fill(e,fV0AC);
cf170170 554 fhClusEtaMax[triggerNumber]->Fill(e,eta);
555 fhClusPhiMax[triggerNumber]->Fill(e,phi);
863e74f5 556
557 if(e > fEtaPhiEnMin)
31a3f95a 558 {
cf170170 559 fhClusEtaPhiHighCluMax [triggerNumber]->Fill( eta, phi);
560 fhClusEtaPhiHighCellMaxCluMax[triggerNumber]->Fill(ieta,iphi);
31a3f95a 561 }
863e74f5 562 else
563 {
cf170170 564 fhClusEtaPhiLowCluMax [triggerNumber]->Fill( eta, phi);
565 fhClusEtaPhiLowCellMaxCluMax[triggerNumber]->Fill(ieta,iphi);
31a3f95a 566 }
567 }
568}
569
46fec84c 570//_____________________________________________________________
571void AliAnalysisTaskEMCALTriggerQA::FillCorrelationHistograms()
2b4e1cc5 572{
46fec84c 573 //FEE-TRU-STU correlation checks
574
575 Double_t ampFOR[30] = {0.}, ampL0[30] = {0.}, ampL1[30] = {0.};
576 for (Int_t i = 0; i < fgkFALTRORows; i++)
577 {
578 for (Int_t j = 0; j < fgkFALTROCols; j++)
579 {
580 //method to get TRU number
581 Int_t idFOR = -1;
582 fGeometry->GetAbsFastORIndexFromPositionInEMCAL(j,i,idFOR);
583 Int_t iTRU = -1;
584 Int_t iADC = -1;
585 fGeometry->GetTRUFromAbsFastORIndex(idFOR,iTRU,iADC);
586
587 //printf("i %d, j %d, iTRU %d, iADC %d, idFOR %d; cell %f, L0 %f, L1 %f\n",
588 // i,j,iTRU,iADC,idFOR, fMapCell [i][j],fMapTrigL0[i][j],fMapTrigL1[i][j]);
589
590 if (iTRU >= 0)
591 {
592 ampFOR[iTRU] += fMapCell [i][j];
593 ampL0[iTRU] += fMapTrigL0[i][j];
594 ampL1[iTRU] += fMapTrigL1[i][j];
595 }
596 }
597 }
863e74f5 598
46fec84c 599 // FEE vs STU and TRU vs STU ratios
600 for (Int_t i = 0; i < 30; i++)
2b4e1cc5 601 {
46fec84c 602 if (ampFOR[i] != 0 && ampL1[i] != 0)
603 {
604 fhFEESTU->Fill(ampL1[i]/ampFOR[i],i);
605 if(ampL1[i]/ampFOR[i] > fMaxSTUFEERatio && DebugLevel() > 0 ) printf("AliAnalysisTaskEMCALTriggerQA::FillCorrelationHistograms() - Large STU/FEE ratio %f\n",ampL1[i]/ampFOR[i]);
606 }
607
608 if (ampL0[i] != 0 && ampL1[i] != 0)
609 {
610 fhTRUSTU->Fill(ampL1[i]/ampL0[i] ,i);
611 if(ampL1[i]/ampL0[i] > fMaxSTUTRURatio && DebugLevel() > 0 ) printf("AliAnalysisTaskEMCALTriggerQA::FillCorrelationHistograms() - Large STU/TRU ratio %f\n",ampL1[i]/ampL0[i]);
612 }
2b4e1cc5 613 }
863e74f5 614}
2b4e1cc5 615
46fec84c 616//_____________________________________________________________
617void AliAnalysisTaskEMCALTriggerQA::FillEventCounterHistogram()
2b4e1cc5 618{
46fec84c 619 // Fill a TH1 histogram, each bin corresponds to a even trigger type
620
621 fhNEvents->Fill(0.5); // All physics events
622
623 if( fEventMB )
624 {
625 fhNEvents->Fill(1.5);
626 if( !fEventL1G && !fEventL1J && !fEventL1G2 && !fEventL1J2 && !fEventL0 ) fhNEvents->Fill(12.5);
627 }
628 else
629 {
630 if( fEventL0 ) fhNEvents->Fill(13.5);
631 if( fEventL1G ) fhNEvents->Fill(14.5);
632 if( fEventL1J ) fhNEvents->Fill(15.5);
633 }
634
635 if( fEventCen) fhNEvents->Fill(2.5);
636 if( fEventSem) fhNEvents->Fill(3.5);
637
638 if( fEventL0 )
639 {
640 fhNEvents->Fill(4.5);
641 }
642
643 if( fEventL1G )
644 {
645 fhNEvents->Fill(5.5);
646 if(!fEventL1J) fhNEvents->Fill(9.5);
647 if(fEventCen || fEventSem) fhNEvents->Fill(16.5);
648 }
649
650 if( fEventL1G2 )fhNEvents->Fill(6.5);
651 if( fEventL1J2 )fhNEvents->Fill(8.5);
652
653 if( fEventL1J )
654 {
655 fhNEvents->Fill(7.5);
656 if(!fEventL1G) fhNEvents->Fill(10.5);
657 if(fEventCen || fEventSem) fhNEvents->Fill(17.5);
658 }
659
660 if(fEventL1J && fEventL1G) fhNEvents->Fill(11.5);
661
662}
663
664//______________________________________________________________
665void AliAnalysisTaskEMCALTriggerQA::FillL1GammaPatchHistograms()
666{
667 // L1 Gamma
668
669 // Study fakes - Make it more understandable!!!
670
73c5a035 671 Int_t areAllFakes = 2;
672 Int_t numberpatchNotFake = 0;
673 Int_t numberpatchFake = 0;
46fec84c 674
73c5a035 675 Int_t threshold = 10;// 10 GeV !it's not GeV it's ADC !!
676 Bool_t enoughE = kFALSE;
677 Double_t patchMax = 0;
678 Int_t colMax = -1;
679 Int_t rowMax = -1;
680 Int_t shiftCol = -1;
681 Int_t shiftRow = -1;
46fec84c 682
683 // loop on patchs
73c5a035 684 for (Int_t posx = 0; posx < fgkFALTROCols; posx++)
46fec84c 685 {
73c5a035 686 for (Int_t posy = 0; posy < fgkFALTRORows; posy++)
46fec84c 687 {
73c5a035 688 Double_t patchEnergy = 0;
46fec84c 689
73c5a035 690 if(fMapTrigL1G[posy][posx] > 0)
46fec84c 691 {
73c5a035 692 for(Int_t irow = 0; irow < 2; irow++)
46fec84c 693 {
73c5a035 694 for(Int_t icol = 0; icol < 2; icol++)
695 {
696 // loop on cells
697 shiftCol = posx+icol;
698 shiftRow = posy+irow;
699
700 // printf("cell[%i,%i]=%f\n",posy+icol,posx+irow, fMapCellL1G[posy+icol][posx+irow]);
701 if(shiftRow < fgkFALTRORows && shiftCol < fgkFALTROCols)
702 patchEnergy += fMapCellL1G[shiftRow][shiftCol] ;
703
704 if( fMapCellL1G[shiftRow][shiftCol] >threshold/2) enoughE = kTRUE;
705 }
46fec84c 706 }
707
708 if (patchEnergy > patchMax)
709 {
710 patchMax = patchEnergy;
711 colMax = posx;
712 rowMax = posy;
713 }
714
715 if(patchEnergy>threshold || (patchEnergy>threshold-3 && enoughE))
716 {
717 numberpatchNotFake++;
718 fhL1GPatchNotFake ->Fill(posx,posy);
719 fhL1GPatchNotFakeE->Fill(patchEnergy);
73c5a035 720 areAllFakes = 1;
46fec84c 721 }
722 else
723 {
724 numberpatchFake++;
73c5a035 725 areAllFakes = 0;
726 fhL1GPatchFake ->Fill(posx,posy);
46fec84c 727 fhL1GPatchFakeE->Fill(patchEnergy);
728 }
729 }
730 }
731 }
732
733 fhNPatchNotFake->Fill(areAllFakes,numberpatchNotFake);
734 fhNPatchFake ->Fill(areAllFakes,numberpatchFake);
735
73c5a035 736 if(areAllFakes == 0)
46fec84c 737 {
738 // loop on patchs
73c5a035 739 for (Int_t col = 0; col < fgkFALTROCols; col++)
46fec84c 740 {
73c5a035 741 for (Int_t row = 0; row < fgkFALTRORows; row++)
46fec84c 742 {
73c5a035 743 if(fMapTrigL1G[row][col] > 0)
46fec84c 744 {
745 // cout <<"checking fMapTrigL1G[row][col]"<<fMapTrigL1G[row][col]<<endl;
746 fhL1GPatchAllFake->Fill(col,row);
747
73c5a035 748 Double_t patchEnergy=0;
749 for(Int_t irow = 0; irow < 2; irow++)
750 {
751 for(Int_t icol = 0; icol < 2; icol++)
752 {
753 shiftCol = col+icol;
754 shiftRow = row+irow;
755
756 if(shiftRow < fgkFALTRORows && shiftCol < fgkFALTROCols)
757 patchEnergy += fMapCellL1G[shiftRow][shiftCol] ;
758
759 }
760 }
46fec84c 761 fhL1GPatchAllFakeE->Fill(patchEnergy);
762 }
763 }
764 }
765 // cout << "row max"<<rowMax<<" colmax"<<colMax<< " fMapTrigL1G[rowMax][colMax]"<< fMapTrigL1G[rowMax][colMax]<<endl;
766
73c5a035 767 if(fMapTrigL1G[rowMax][colMax] > 0)
46fec84c 768 {
769 // printf("\npatch max [%i,%i] = %f\n",rowMax,colMax,patchMax);
770 fhL1GPatchAllFakeMax ->Fill(colMax,rowMax);
771 fhL1GPatchAllFakeMaxE->Fill(patchMax);
772 }
773 }
774 else
775 {
776 // loop on patches
73c5a035 777 for (Int_t col = 0; col < fgkFALTROCols; col++)
46fec84c 778 {
73c5a035 779 for (Int_t row = 0; row < fgkFALTRORows; row++)
46fec84c 780 {
73c5a035 781 if(fMapTrigL1G[row][col] > 0)
46fec84c 782 {
73c5a035 783 fhL1GPatchNotAllFake->Fill(col,row);
784
785 Double_t patchEnergy = 0;
786 for(Int_t irow = 0; irow < 2; irow++)
787 {
788 for(Int_t icol = 0; icol < 2; icol++)
789 {
790 shiftCol = col+icol;
791 shiftRow = row+irow;
792
793 if(shiftRow < fgkFALTRORows && shiftCol < fgkFALTROCols)
794 patchEnergy += fMapCellL1G[shiftRow][shiftCol] ;
795 }
796 }
797
798 fhL1GPatchNotAllFakeE->Fill(patchEnergy);
799
46fec84c 800 }
46fec84c 801 }
802 }
803
73c5a035 804 if(fMapTrigL1G[rowMax][colMax] > 0 )
46fec84c 805 {
806 fhL1GPatchNotAllFakeMax ->Fill(colMax,rowMax);
807 fhL1GPatchNotAllFakeMaxE->Fill(patchMax);
808 }
809 }
810
811 fhGPMaxVV0TT->Fill(fV0Trigger, patchMax);
73c5a035 812 if( fEventL1G ) fhL1GPatchMax ->Fill(colMax,rowMax);
813 if( fEventL1G2 ) fhL1G2PatchMax->Fill(colMax,rowMax);
46fec84c 814
815}
816
817//____________________________________________________________
818void AliAnalysisTaskEMCALTriggerQA::FillL1JetPatchHistograms()
819{
820 // L1 Jet
821
73c5a035 822 Double_t patchMax = 0;
823 Int_t colMax = -1;
824 Int_t rowMax = -1;
825 Int_t col, row = 0;
826
46fec84c 827 for (Int_t i = 0; i < 9; i++)
828 {
829 for (Int_t j = 0; j < 12; j++)
830 {
831 Int_t patchJ = 0;
832 col = i;
833 row = j;
834
835 for (Int_t k = 0; k < 16; k++)
836 {
837 for (Int_t l = 0; l < 16; l++)
838 {
839 patchJ += Int_t(fMapTrigL1[4*j + l][4*i + k]);
840 }
841 }
842
843 if (patchJ > patchMax)
844 {
845 patchMax = patchJ;
846 colMax = 4*col;
847 rowMax = 4*row;
848 }
849 }
850 }
851
852 fhJPMaxVV0TT->Fill(fV0Trigger, patchMax);
73c5a035 853 if( fEventL1J ) fhL1JPatchMax ->Fill(colMax,rowMax);
854 if( fEventL1J2 ) fhL1J2PatchMax->Fill(colMax,rowMax);
46fec84c 855
856}
857
858//______________________________________________________
859void AliAnalysisTaskEMCALTriggerQA::FillMapHistograms()
860{
861 //Matrix with signal per channel
862
863 for (Int_t i = 0; i < fgkFALTRORows; i++)
864 {
865 for (Int_t j = 0; j < fgkFALTROCols; j++) //check x,y direction for reading FOR ((0,0) = top left);
866 {
867 fhFORAmp ->Fill( j, i, fMapCell [i][j]);
868 fhFORAmpL1G ->Fill( j, i, fMapCellL1G [i][j]);
869 fhFORAmpL1G2->Fill( j, i, fMapCellL1G2 [i][j]);
870 fhFORAmpL1J ->Fill( j, i, fMapCellL1J [i][j]);
871 fhFORAmpL1J2->Fill( j, i, fMapCellL1J2 [i][j]);
872 fhL0Amp ->Fill( j, i, fMapTrigL0 [i][j]);
873 fhL0AmpL1G ->Fill( j, i, fMapTrigL0L1G[i][j]);
874 fhL0AmpL1J ->Fill( j, i, fMapTrigL0L1J[i][j]);
875 fhL1Amp ->Fill( j, i, fMapTrigL1 [i][j]);
876
877 fhL1FOREnergy->Fill(i+fgkFALTRORows*j, fMapTrigL1 [i][j]);
878 fhL1GAmp ->Fill( j, i, fMapTrigL1G [i][j]);
879 fhL1G2Amp ->Fill( j, i, fMapTrigL1G2 [i][j]);
880 fhL1JAmp ->Fill( j, i, fMapTrigL1J [i][j]);
881 fhL1J2Amp ->Fill( j, i, fMapTrigL1J2 [i][j]);
882 fhFORMeanAmp->Fill( j, i, fMapCell [i][j]);
883 fhL0MeanAmp ->Fill( j, i, fMapTrigL0 [i][j]);
884 fhL1MeanAmp ->Fill( j, i, fMapTrigL1 [i][j]);
885 }
886 }
887}
888
889//____________________________________________________
890void AliAnalysisTaskEMCALTriggerQA::FillV0Histograms()
891{
892 //V0 analysis, only for ESDs
893
894 AliESDVZERO* eventV0 = dynamic_cast<AliESDVZERO*> (InputEvent()->GetVZEROData());
895
896 if(eventV0)
897 {
898 for (Int_t i = 0; i < 32; i++)
899 {
900 fV0C += eventV0->GetAdcV0C(i);
901 fV0A += eventV0->GetAdcV0A(i);
902 }
903
904 if (fSTUTotal != 0)
905 {
906 fhV0STU->Fill(fV0A+fV0C,fSTUTotal);
907 if( fV0A+fV0C > fMaxV0Signal && DebugLevel() > 0) printf("AliAnalysisTaskEMCALTriggerQA::UserExec() - Large fV0A+fV0C %f\n",fV0A+fV0C);
908 }
909
910 if( fEventL1G ) fhV0[kL1GammaTrig] ->Fill(fV0A+fV0C);
911 if( fEventL1G2 ) fhV0[kL1GammaTrig2] ->Fill(fV0A+fV0C);
912 if( fEventL1J ) fhV0[kL1JetTrig] ->Fill(fV0A+fV0C);
913 if( fEventL1J2 ) fhV0[kL1JetTrig2] ->Fill(fV0A+fV0C);
914 if( fEventMB ) fhV0[kMBTrig] ->Fill(fV0A+fV0C);
915 if( fEventL0 ) fhV0[kL0Trig] ->Fill(fV0A+fV0C);
916 if( fEventCen ) fhV0[kCentralTrig] ->Fill(fV0A+fV0C);
917 if( fEventSem ) fhV0[kSemiCentralTrig]->Fill(fV0A+fV0C);
918 if( fEventL1G && !fEventL1J) fhV0[kL1GammaOnlyTrig]->Fill(fV0A+fV0C);
919 if( fEventL1J && !fEventL1G) fhV0[kL1JetOnlyTrig] ->Fill(fV0A+fV0C);
920
921 //if(nL0Patch!=0 || nL1Patch!=0) printf("total TRU %f, total STU %f, V0C+V0A %f; nL0 %d, nL1 %d \n",
922 // fTRUTotal,fSTUTotal,fV0A+fV0C,nL0Patch,nL1Patch);
923 }
924}
925
926//________________________________________
927void AliAnalysisTaskEMCALTriggerQA::Init()
928{
929 //Init analysis parameters not set before
930
931 if(!fRecoUtils)
932 {
933 fRecoUtils = new AliEMCALRecoUtils ;
934 fRecoUtils->SwitchOnBadChannelsRemoval();
935 }
936
937}
938
939//_____________________________________________________
940void AliAnalysisTaskEMCALTriggerQA::InitCellPatchMaps()
941{
942 //Init to 0 and per event different cell/patch maps, depending on trigger type
943
944 for (Int_t i = 0; i < fgkFALTRORows; i++)
945 {
946 for (Int_t j = 0; j < fgkFALTROCols; j++)
947 {
948 fMapTrigL0 [i][j] = 0.;
949 fMapTrigL0L1G[i][j] = 0.;
950 fMapTrigL0L1J[i][j] = 0.;
951 fMapTrigL1G [i][j] = 0.;
952 fMapTrigL1G2 [i][j] = 0.;
953 fMapTrigL1J [i][j] = 0.;
954 fMapTrigL1J2 [i][j] = 0.;
955 fMapTrigL1 [i][j] = 0.;
956 fMapCell [i][j] = 0.;
957 fMapCellL1G [i][j] = 0.;
958 fMapCellL1G2 [i][j] = 0.;
959 fMapCellL1J [i][j] = 0.;
960 fMapCellL1J2 [i][j] = 0.;
961 }
962 }
963}
964
965//________________________________________________
966void AliAnalysisTaskEMCALTriggerQA::InitGeometry()
967{
968 // Init geometry and set the geometry matrix, for the first event, skip the rest
969 // Also set once the run dependent calibrations
2b4e1cc5 970
971 if(fGeoSet) return;
972
31a3f95a 973 // Init the trigger bit once, correct depending on version
863e74f5 974 fBitEGA = 4;
975 fBitEJE = 5;
31a3f95a 976
977 TFile* file = AliAnalysisManager::GetAnalysisManager()->GetTree()->GetCurrentFile();
863e74f5 978
31a3f95a 979 const TList *clist = file->GetStreamerInfoCache();
980
981 if(clist)
863e74f5 982 {
31a3f95a 983 TStreamerInfo *cinfo = (TStreamerInfo*)clist->FindObject("AliESDCaloTrigger");
cf170170 984 Int_t verid = 5; // newer ESD header version
985 if(!cinfo)
986 {
987 cinfo = (TStreamerInfo*)clist->FindObject("AliAODCaloTrigger");
988 verid = 2; // newer AOD header version
989 }
863e74f5 990 if(cinfo)
31a3f95a 991 {
992 Int_t classversionid = cinfo->GetClassVersion();
cf170170 993 //printf("********* Header class version %d *********** \n",classversionid);
31a3f95a 994
cf170170 995 if (classversionid >= verid)
31a3f95a 996 {
997 fBitEGA = 6;
998 fBitEJE = 8;
999 }
1000 } else printf("AliAnalysisTaskEMCALTriggerQA - Streamer info for trigger class not available, bit not changed\n");
1001 } else printf("AliAnalysisTaskEMCALTriggerQA - Streamer list not available!, bit not changed\n");
1002
2b4e1cc5 1003 Int_t runnumber = InputEvent()->GetRunNumber() ;
1004
1005 if (!fGeometry)
1006 {
1007 if(fGeoName=="")
1008 {
1009 if (runnumber < 140000) fGeoName = "EMCAL_FIRSTYEARV1";
1010 else if(runnumber < 171000) fGeoName = "EMCAL_COMPLETEV1";
863e74f5 1011 else fGeoName = "EMCAL_COMPLETE12SMV1";
2b4e1cc5 1012 if(DebugLevel() > 0)
1013 printf("AliAnalysisTaskEMCALTriggerQA::InitGeometry() - Set EMCAL geometry name to <%s> for run %d\n",fGeoName.Data(),runnumber);
1014 }
1015
863e74f5 1016 fGeometry = AliEMCALGeometry::GetInstance(fGeoName);
1017 }
bce9493b 1018
66bdaa44 1019 fGeoSet = kTRUE;
863e74f5 1020
bce9493b 1021}
1022
31a3f95a 1023//_______________________________________________________
1024void AliAnalysisTaskEMCALTriggerQA::InitHistogramArrays()
1025{
31a3f95a 1026 //Histograms array initialization
1027
863e74f5 1028 for (Int_t i = 0; i < 10; i++)
1029 {
cf170170 1030 fhV0 [i] = 0;
1031 fhClus [i] = 0; fhClusMax [i] = 0;
1032 fhClusCen[i] = 0; fhClusCenMax[i] = 0;
1033 fhClusV0 [i] = 0; fhClusV0Max [i] = 0;
1034 fhClusEta[i] = 0; fhClusEtaMax[i] = 0;
1035 fhClusPhi[i] = 0; fhClusPhiMax[i] = 0;
1036
1037 fhClusEtaPhiHigh [i] = 0; fhClusEtaPhiHighCluMax [i] = 0;
1038 fhClusEtaPhiHighCellMax[i] = 0; fhClusEtaPhiHighCellMaxCluMax[i] = 0;
1039 fhClusEtaPhiLow [i] = 0; fhClusEtaPhiLowCluMax [i] = 0;
1040 fhClusEtaPhiLowCellMax [i] = 0; fhClusEtaPhiLowCellMaxCluMax [i] = 0;
1041
1042 if(i<3){ fhClusMBPure[i] = 0; fhClusMaxMBPure[i] = 0; }
31a3f95a 1043 }
31a3f95a 1044}
1045
46fec84c 1046//_____________________________________________________________________________
1047void AliAnalysisTaskEMCALTriggerQA::SetTriggerEventBit( TString triggerclasses)
1048{
1049 // Check what trigger is the event, set the corresponding bit
1050
1051 // Init trigger event bit
1052 fEventMB = kFALSE;
1053 fEventL0 = kFALSE;
1054 fEventL1G = kFALSE;
1055 fEventL1G2 = kFALSE;
1056 fEventL1J = kFALSE;
1057 fEventL1J2 = kFALSE;
1058 fEventCen = kFALSE;
1059 fEventSem = kFALSE;
1060
1061 //Min bias event trigger?
1062 if((triggerclasses.Contains("CINT") || triggerclasses.Contains("CPBI2_B1") ) &&
1063 (triggerclasses.Contains("-B-") || triggerclasses.Contains("-I-")) &&
1064 triggerclasses.Contains("-NOPF-ALLNOTRD") ) fEventMB = kTRUE;
1065
1066 // EMC triggered event? Which type?
1067 if( triggerclasses.Contains("-B-") || triggerclasses.Contains("-S-") || triggerclasses.Contains("-I-") )
1068 {
1069 if( triggerclasses.Contains("CEMC") &&
1070 !triggerclasses.Contains("EGA" ) &&
1071 !triggerclasses.Contains("EJE" ) &&
1072 !triggerclasses.Contains("EG1" ) &&
1073 !triggerclasses.Contains("EJ1" ) &&
1074 !triggerclasses.Contains("EG2" ) &&
1075 !triggerclasses.Contains("EJ2" ) ) fEventL0 = kTRUE;
1076
1077 if( triggerclasses.Contains("EGA" ) || triggerclasses.Contains("EG1" ) ) fEventL1G = kTRUE;
1078 if( triggerclasses.Contains("EG2" ) ) fEventL1G2 = kTRUE;
1079
1080 if( triggerclasses.Contains("EJE" ) || triggerclasses.Contains("EJ1" ) ) fEventL1J = kTRUE;
1081 if( triggerclasses.Contains("EJ2" ) ) fEventL1J2 = kTRUE;
1082 }
1083
1084 // Semi/Central PbPb trigger
1085 if (triggerclasses.Contains("CCENT_R2-B-NOPF-ALLNOTRD")) fEventCen = kTRUE;
1086 else if(triggerclasses.Contains("CSEMI_R1-B-NOPF-ALLNOTRD")) fEventSem = kTRUE;
1087
1088 // printf("MB : %d; L0 : %d; L1-Gam : %d; L1-Jet : %d; Central : %d; SemiCentral : %d; Trigger Names : %s \n ",
1089 // fEventMB,fEventL0,fEventL1G,fEventL1J,fEventCen,fEventSem,triggerclasses.Data());
1090
1091}
1092
85196c29 1093//___________________________________________________________
863e74f5 1094void AliAnalysisTaskEMCALTriggerQA::UserCreateOutputObjects()
bce9493b 1095{
863e74f5 1096 // Init histograms and geometry
31a3f95a 1097
85196c29 1098 fOutputList = new TList;
1099 fOutputList ->SetOwner(kTRUE);
bce9493b 1100
997b261e 1101 fhNEvents = new TH1F("hNEvents","Number of selected events",18,0,18);
85196c29 1102 fhNEvents ->SetYTitle("N events");
77626b4a 1103 fhNEvents ->GetXaxis()->SetBinLabel(1 ,"All");
0d896539 1104 fhNEvents ->GetXaxis()->SetBinLabel(2 ,"MB");
31a3f95a 1105 fhNEvents ->GetXaxis()->SetBinLabel(3 ,"Central Pb");
1106 fhNEvents ->GetXaxis()->SetBinLabel(4 ,"SemiCentral Pb");
1107 fhNEvents ->GetXaxis()->SetBinLabel(5 ,"L0");
1108 fhNEvents ->GetXaxis()->SetBinLabel(6 ,"L1-G");
6be2314f 1109 fhNEvents ->GetXaxis()->SetBinLabel(7 ,"L1-G2");
1110 fhNEvents ->GetXaxis()->SetBinLabel(8 ,"L1-J");
1111 fhNEvents ->GetXaxis()->SetBinLabel(9 ,"L1-J2");
1112 fhNEvents ->GetXaxis()->SetBinLabel(10 ,"L1-G & !L1-J");
1113 fhNEvents ->GetXaxis()->SetBinLabel(11 ,"L1-J & !L1-G");
863e74f5 1114 fhNEvents ->GetXaxis()->SetBinLabel(12 ,"L1-J & L1-G");
6be2314f 1115 fhNEvents ->GetXaxis()->SetBinLabel(13 ,"MB & !L1 & !L0");
1116 fhNEvents ->GetXaxis()->SetBinLabel(14,"L0 & !MB");
1117 fhNEvents ->GetXaxis()->SetBinLabel(15,"L1-G & !MB");
1118 fhNEvents ->GetXaxis()->SetBinLabel(16,"L1-J & !MB");
997b261e 1119 fhNEvents ->GetXaxis()->SetBinLabel(17,"L1-G & (Cen | Semi)");
1120 fhNEvents ->GetXaxis()->SetBinLabel(18,"L1-J & (Cen | Semi)");
1121
75e10d6a 1122 fhFORAmp = new TH2F("hFORAmp", "FEE cells deposited energy, grouped like FastOR 2x2 per Row and Column",
1123 fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
1124 fhFORAmp ->SetXTitle("Index #eta (columnns)");
e022364d 1125 fhFORAmp ->SetYTitle("Index #phi (rows)");
1126 fhFORAmp ->SetZTitle("Amplitude");
e395081d 1127
75e10d6a 1128 fhFORAmpL1G = new TH2F("hFORAmpL1G", "FEE cells deposited energy, grouped like FastOR 2x2 per Row and Column, with L1G trigger condition",
1129 fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
1130 fhFORAmpL1G ->SetXTitle("Index #eta (columnns)");
a40222c8 1131 fhFORAmpL1G ->SetYTitle("Index #phi (rows)");
1132 fhFORAmpL1G ->SetZTitle("Amplitude");
863e74f5 1133
6be2314f 1134 fhFORAmpL1G2 = new TH2F("hFORAmpL1G2", "FEE cells deposited energy, grouped like FastOR 2x2 per Row and Column, with L1G2 trigger condition",
cf170170 1135 fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
6be2314f 1136 fhFORAmpL1G2 ->SetXTitle("Index #eta (columnns)");
1137 fhFORAmpL1G2 ->SetYTitle("Index #phi (rows)");
1138 fhFORAmpL1G2 ->SetZTitle("Amplitude");
e395081d 1139
75e10d6a 1140 fhFORAmpL1J = new TH2F("hFORAmpL1J", "FEE cells deposited energy, grouped like FastOR 2x2 per Row and Column, with L1J trigger condition",
1141 fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
1142 fhFORAmpL1J ->SetXTitle("Index #eta (columnns)");
a40222c8 1143 fhFORAmpL1J ->SetYTitle("Index #phi (rows)");
1144 fhFORAmpL1J ->SetZTitle("Amplitude");
863e74f5 1145
6be2314f 1146 fhFORAmpL1J2 = new TH2F("hFORAmpL1J2", "FEE cells deposited energy, grouped like FastOR 2x2 per Row and Column, with L1J2 trigger condition",
cf170170 1147 fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
6be2314f 1148 fhFORAmpL1J2 ->SetXTitle("Index #eta (columnns)");
1149 fhFORAmpL1J2 ->SetYTitle("Index #phi (rows)");
1150 fhFORAmpL1J2 ->SetZTitle("Amplitude");
cf170170 1151
aff917ac 1152
75e10d6a 1153 fhL0Amp = new TH2F("hL0Amp","FALTRO signal per Row and Column",
1154 fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
1155 fhL0Amp ->SetXTitle("Index #eta (columnns)");
e022364d 1156 fhL0Amp ->SetYTitle("Index #phi (rows)");
1157 fhL0Amp ->SetZTitle("Amplitude");
e395081d 1158
75e10d6a 1159 fhL0AmpL1G = new TH2F("hL0AmpL1G","FALTRO signal per Row and Column, with L1G trigger condition",
1160 fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
1161 fhL0AmpL1G ->SetXTitle("Index #eta (columnns)");
a40222c8 1162 fhL0AmpL1G ->SetYTitle("Index #phi (rows)");
1163 fhL0AmpL1G ->SetZTitle("Amplitude");
863e74f5 1164
e395081d 1165
75e10d6a 1166 fhL0AmpL1J = new TH2F("hL0AmpL1J","FALTRO signal per Row and Column, with L1j trigger condition",
1167 fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
1168 fhL0AmpL1J ->SetXTitle("Index #eta (columnns)");
a40222c8 1169 fhL0AmpL1J ->SetYTitle("Index #phi (rows)");
1170 fhL0AmpL1J ->SetZTitle("Amplitude");
863e74f5 1171
aff917ac 1172
75e10d6a 1173 fhL1Amp = new TH2F("hL1Amp","STU signal per Row and Column",
1174 fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
1175 fhL1Amp ->SetXTitle("Index #eta (columnns)");
aff917ac 1176 fhL1Amp ->SetYTitle("Index #phi (rows)");
1177 fhL1Amp ->SetZTitle("Amplitude");
1178
75e10d6a 1179 fhL1GAmp = new TH2F("hL1GAmp","STU signal per Row and Column for L1 Gamma",
1180 fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
1181 fhL1GAmp ->SetXTitle("Index #eta (columnns)");
e022364d 1182 fhL1GAmp ->SetYTitle("Index #phi (rows)");
1183 fhL1GAmp ->SetZTitle("Amplitude");
863e74f5 1184
6be2314f 1185 fhL1G2Amp = new TH2F("hL1G2Amp","STU signal per Row and Column for L1 Gamma2",
cf170170 1186 fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
6be2314f 1187 fhL1G2Amp ->SetXTitle("Index #eta (columnns)");
1188 fhL1G2Amp ->SetYTitle("Index #phi (rows)");
1189 fhL1G2Amp ->SetZTitle("Amplitude");
aff917ac 1190
75e10d6a 1191 fhL1JAmp = new TH2F("hL1JAmp","STU signal per Row and Column for L1 Jet",
77626b4a 1192 fgkFALTROCols/4,0,fgkFALTROCols,fgkFALTRORows/4,0,fgkFALTRORows);
75e10d6a 1193 fhL1JAmp ->SetXTitle("Index #eta (columnns)");
e022364d 1194 fhL1JAmp ->SetYTitle("Index #phi (rows)");
1195 fhL1JAmp ->SetZTitle("Amplitude");
863e74f5 1196
6be2314f 1197 fhL1J2Amp = new TH2F("hL1J2Amp","STU signal per Row and Column for L1 Jet2",
cf170170 1198 fgkFALTROCols/4,0,fgkFALTROCols,fgkFALTRORows/4,0,fgkFALTRORows);
6be2314f 1199 fhL1J2Amp ->SetXTitle("Index #eta (columnns)");
1200 fhL1J2Amp ->SetYTitle("Index #phi (rows)");
1201 fhL1J2Amp ->SetZTitle("Amplitude");
863e74f5 1202
6be2314f 1203 fhL1FOREnergy = new TH2F("hL1FOREnergy","FOR index vs FOR energy",
cf170170 1204 fgkFALTROCols*fgkFALTRORows,0,fgkFALTROCols*fgkFALTRORows,200,0,200);
6be2314f 1205 fhL1FOREnergy ->SetXTitle("Index FOR");
1206 fhL1FOREnergy ->SetYTitle("Energy (ADC)");
aff917ac 1207
75e10d6a 1208 fhL0Patch = new TH2F("hL0Patch","FOR with associated L0 Patch",
1209 fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
1210 fhL0Patch ->SetXTitle("Index #eta (columnns)");
85196c29 1211 fhL0Patch ->SetYTitle("Index #phi (rows)");
e022364d 1212 fhL0Patch ->SetZTitle("counts");
aff917ac 1213
75e10d6a 1214 fhL1GPatch = new TH2F("hL1GPatch","FOR with associated L1 Gamma Patch",
1215 fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
1216 fhL1GPatch ->SetXTitle("Index #eta (columnns)");
85196c29 1217 fhL1GPatch ->SetYTitle("Index #phi (rows)");
e022364d 1218 fhL1GPatch ->SetZTitle("counts");
863e74f5 1219
6be2314f 1220 fhL1G2Patch = new TH2F("hL1G2Patch","FOR with associated L1 Gamma2 Patch",
cf170170 1221 fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
6be2314f 1222 fhL1G2Patch ->SetXTitle("Index #eta (columnns)");
1223 fhL1G2Patch ->SetYTitle("Index #phi (rows)");
1224 fhL1G2Patch ->SetZTitle("counts");
1225
1226 fhL1GPatchNotFake = new TH2F("hL1GPatchNotFake","FOR with L1 Gamma Patch associated to energetic cells",
cf170170 1227 fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
6be2314f 1228 fhL1GPatchNotFake ->SetXTitle("Index #eta (columnns)");
1229 fhL1GPatchNotFake ->SetYTitle("Index #phi (rows)");
1230 fhL1GPatchNotFake ->SetZTitle("counts");
863e74f5 1231
6be2314f 1232 fhL1GPatchFake = new TH2F("hL1GPatchFake","FOR without L1 Gamma Patch associated to energetic cells",
cf170170 1233 fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
6be2314f 1234 fhL1GPatchFake ->SetXTitle("Index #eta (columnns)");
1235 fhL1GPatchFake ->SetYTitle("Index #phi (rows)");
1236 fhL1GPatchFake ->SetZTitle("counts");
863e74f5 1237
1238
6be2314f 1239 fhL1GPatchNotAllFake = new TH2F("hL1GPatchNotAllFake","FOR with one L1 Gamma Patch associated to an energetic cell",
cf170170 1240 fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
6be2314f 1241 fhL1GPatchNotAllFake ->SetXTitle("Index #eta (columnns)");
1242 fhL1GPatchNotAllFake ->SetYTitle("Index #phi (rows)");
1243 fhL1GPatchNotAllFake ->SetZTitle("counts");
863e74f5 1244
6be2314f 1245 fhL1GPatchAllFake = new TH2F("hL1GPatchAllFake","FOR without any L1 Gamma Patch associated to an energetic cell",
cf170170 1246 fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
6be2314f 1247 fhL1GPatchAllFake ->SetXTitle("Index #eta (columnns)");
1248 fhL1GPatchAllFake ->SetYTitle("Index #phi (rows)");
1249 fhL1GPatchAllFake ->SetZTitle("counts");
863e74f5 1250
6be2314f 1251 fhL1GPatchAllFakeMax = new TH2F("hL1GPatchAllFakeMax","FOR with L1 Gamma Patch Max not associated to an energetic cell",
cf170170 1252 fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
6be2314f 1253 fhL1GPatchAllFakeMax ->SetXTitle("Index #eta (columnns)");
1254 fhL1GPatchAllFakeMax ->SetYTitle("Index #phi (rows)");
1255 fhL1GPatchAllFakeMax ->SetZTitle("counts");
863e74f5 1256
6be2314f 1257 fhL1GPatchNotAllFakeMax = new TH2F("hL1GPatchNotAllFakeMax","FOR with one L1 Gamma Patch Max associated to an energetic cell",
cf170170 1258 fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
6be2314f 1259 fhL1GPatchNotAllFakeMax ->SetXTitle("Index #eta (columnns)");
1260 fhL1GPatchNotAllFakeMax ->SetYTitle("Index #phi (rows)");
1261 fhL1GPatchNotAllFakeMax ->SetZTitle("counts");
863e74f5 1262
1263 fhL1GPatchNotAllFakeMaxE = new TH1F("hL1GPatchNotAllFakeMaxE","Energy distribution of FOR in events with L1 Gamma Patch Max associated to an energetic cell",
cf170170 1264 fNBinsClusterE,0,fMaxClusterE);
863e74f5 1265 fhL1GPatchNotAllFakeMaxE ->SetXTitle("Energy (GeV)");
aff917ac 1266
863e74f5 1267
6be2314f 1268 fhL1GPatchAllFakeMaxE = new TH1F("hL1GPatchAllFakeMaxE","Energy distribution of FOR in events with L1 Gamma Patch Max not associated to an energetic cell",
cf170170 1269 fNBinsClusterE,0,fMaxClusterE);
863e74f5 1270 fhL1GPatchAllFakeMaxE ->SetXTitle("Energy (GeV)");
6be2314f 1271
1272 fhL1GPatchNotAllFakeE = new TH1F("hL1GPatchNotAllFakeE","Energy distribution of FOR in events with L1 Gamma Patch not associated to an energetic cell",
cf170170 1273 fNBinsClusterE,0,fMaxClusterE);
863e74f5 1274 fhL1GPatchNotAllFakeE ->SetXTitle("Energy (GeV)");
1275
6be2314f 1276 fhL1GPatchAllFakeE = new TH1F("hL1GPatchAllFakeE","Energy distribution of FOR in events with L1 Gamma Patch associated to an energetic cell",
cf170170 1277 fNBinsClusterE,0,fMaxClusterE);
863e74f5 1278 fhL1GPatchAllFakeE ->SetXTitle("Energy (GeV)");
1279
1280
6be2314f 1281 fhL1GPatchFakeE = new TH1F("hL1GPatchFakeE","Energy distribution of FOR with L1 Gamma Patch not associated to an energetic cell",
cf170170 1282 fNBinsClusterE,0,fMaxClusterE);
863e74f5 1283 fhL1GPatchFakeE ->SetXTitle("Energy (GeV)");
1284
6be2314f 1285 fhL1GPatchNotFakeE = new TH1F("hL1GPatchNotFakeE","Energy distribution of FOR with L1 Gamma Patch associated to an energetic cell",
cf170170 1286 fNBinsClusterE,0,fMaxClusterE);
863e74f5 1287 fhL1GPatchNotFakeE ->SetXTitle("Energy (GeV)");
1288
73c5a035 1289 fhNPatchFake = new TH2F("hNPatchFake","number of fake patchs vs. all patchs are fake",
cf170170 1290 3,0,3, 2880,0,2880);
46fec84c 1291 fhNPatchFake ->SetYTitle("number of fake patchs");
1292 fhNPatchFake ->SetXTitle("all fake event");
1293 fhNPatchFake ->SetZTitle("counts");
863e74f5 1294
1295
73c5a035 1296 fhNPatchNotFake = new TH2F("hNPatchNotFake","number of Not fake patchs vs. all patchs are fake",
cf170170 1297 3, 0, 3, 2000,0,2000);
46fec84c 1298 fhNPatchNotFake ->SetYTitle("number of Not fake patchs");
1299 fhNPatchNotFake ->SetXTitle("all fake event");
1300 fhNPatchNotFake ->SetZTitle("counts");
863e74f5 1301
1302
75e10d6a 1303 fhL1JPatch = new TH2F("hL1JPatch","FOR with associated L1 Jet Patch",
77626b4a 1304 fgkFALTROCols/4,0,fgkFALTROCols,fgkFALTRORows/4,0,fgkFALTRORows);
75e10d6a 1305 fhL1JPatch ->SetXTitle("Index #eta (columnns)");
85196c29 1306 fhL1JPatch ->SetYTitle("Index #phi (rows)");
e022364d 1307 fhL1JPatch ->SetZTitle("counts");
863e74f5 1308
6be2314f 1309 fhL1J2Patch = new TH2F("hL1J2Patch","FOR with associated L1 Jet2 Patch",
cf170170 1310 fgkFALTROCols/4,0,fgkFALTROCols,fgkFALTRORows/4,0,fgkFALTRORows);
6be2314f 1311 fhL1J2Patch ->SetXTitle("Index #eta (columnns)");
1312 fhL1J2Patch ->SetYTitle("Index #phi (rows)");
1313 fhL1J2Patch ->SetZTitle("counts");
aff917ac 1314
75e10d6a 1315 fhV0STU = new TH2I("hV0STU","Total signal STU vs V0C+V0S",
1316 fNBinsV0Signal,0,fMaxV0Signal,fNBinsSTUSignal,0,fMaxSTUSignal);
85196c29 1317 fhV0STU ->SetXTitle("Signal V0C+V0A");
1318 fhV0STU ->SetYTitle("Total signal STU");
e022364d 1319 fhV0STU ->SetZTitle("counts");
aff917ac 1320
480b9db0 1321
85196c29 1322 fhFEESTU = new TH2F("hFEESTU","STU / FEE vs channel", fNBinsSTUFEERatio,0,fMaxSTUFEERatio,30,0,30);
1323 fhFEESTU ->SetXTitle("STU/FEE signal");
1324 fhFEESTU ->SetYTitle("channel");
e022364d 1325 fhFEESTU ->SetZTitle("counts");
aff917ac 1326
85196c29 1327 fhTRUSTU = new TH2F("hTRUSTU","STU / TRU vs channel", fNBinsSTUTRURatio,0,fMaxSTUTRURatio,30,0,30);
1328 fhTRUSTU ->SetXTitle("STU/TRU signal");
1329 fhTRUSTU ->SetYTitle("channel");
e022364d 1330 fhTRUSTU ->SetZTitle("counts");
aff917ac 1331
0d896539 1332 fhGPMaxVV0TT = new TH2F("hGPMaxVV0TT","Maximum patch of L1-Gamma vs V0 signal in STU",fNBinsV0Signal,0,fMaxV0Signal,1000,0,1000);
1333 fhGPMaxVV0TT ->SetXTitle("V0 from STU");
faa45c63 1334 fhGPMaxVV0TT ->SetYTitle("Patch Max");
4ee53435 1335
0d896539 1336 fhJPMaxVV0TT = new TH2F("hJPMaxVV0TT","Maximum patch of L1-Jet vs V0 signal in STU",fNBinsV0Signal,0,fMaxV0Signal,1000,0,1000);
1337 fhJPMaxVV0TT ->SetXTitle("V0 from STU");
faa45c63 1338 fhJPMaxVV0TT ->SetYTitle("Patch Max");
ec77a234 1339
0d896539 1340 fhFORMeanAmp = new TProfile2D("hFORMeanAmp", "Mean FastOR(FEE) signal per Row and Column", fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
1341 fhFORMeanAmp->SetXTitle("Index #eta");
1342 fhFORMeanAmp->SetYTitle("Index #phi");
1343
1344 fhL0MeanAmp = new TProfile2D("hL0MeanAmp", "Mean FastOR(TRU) signal per Row and Column", fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
1345 fhL0MeanAmp->SetXTitle("Index #eta");
1346 fhL0MeanAmp->SetYTitle("Index #phi");
4ee53435 1347
0d896539 1348 fhL1MeanAmp = new TProfile2D("hL1MeanAmp", "Mean FastOR(STU) signal per Row and Column", fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
1349 fhL1MeanAmp->SetXTitle("Index #eta");
1350 fhL1MeanAmp->SetYTitle("Index #phi");
ec77a234 1351
0d896539 1352 fhL1GPatchMax = new TH2F("hL1GPatchMax","FOR of max amplitude patch with associated L1 Gamma Patch",
ec77a234 1353 fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
0d896539 1354 fhL1GPatchMax ->SetXTitle("Index #eta (columnns)");
1355 fhL1GPatchMax ->SetYTitle("Index #phi (rows)");
1356 fhL1GPatchMax ->SetZTitle("counts");
863e74f5 1357
6be2314f 1358 fhL1G2PatchMax = new TH2F("hL1G2PatchMax","FOR of max amplitude patch with associated L1 Gamma2 Patch",
cf170170 1359 fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
6be2314f 1360 fhL1G2PatchMax ->SetXTitle("Index #eta (columnns)");
1361 fhL1G2PatchMax ->SetYTitle("Index #phi (rows)");
1362 fhL1G2PatchMax ->SetZTitle("counts");
0d896539 1363
1364 fhL1JPatchMax = new TH2F("hL1JPatchMax","FOR of max amplitude patch with associated L1 Jet Patch",
ec77a234 1365 fgkFALTROCols/4,0,fgkFALTROCols,fgkFALTRORows/4,0,fgkFALTRORows);
0d896539 1366 fhL1JPatchMax ->SetXTitle("Index #eta (columnns)");
1367 fhL1JPatchMax ->SetYTitle("Index #phi (rows)");
1368 fhL1JPatchMax ->SetZTitle("counts");
863e74f5 1369
6be2314f 1370 fhL1J2PatchMax = new TH2F("hL1JPatchMax","FOR of max amplitude patch with associated L1 Jet2 Patch",
cf170170 1371 fgkFALTROCols/4,0,fgkFALTROCols,fgkFALTRORows/4,0,fgkFALTRORows);
6be2314f 1372 fhL1J2PatchMax ->SetXTitle("Index #eta (columnns)");
1373 fhL1J2PatchMax ->SetYTitle("Index #phi (rows)");
1374 fhL1J2PatchMax ->SetZTitle("counts");
0d896539 1375
bce9493b 1376 fOutputList->Add(fhNEvents);
1377 fOutputList->Add(fhV0STU);
e022364d 1378 fOutputList->Add(fhFORAmp);
a40222c8 1379 fOutputList->Add(fhFORAmpL1G);
6be2314f 1380 fOutputList->Add(fhFORAmpL1G2);
a40222c8 1381 fOutputList->Add(fhFORAmpL1J);
6be2314f 1382 fOutputList->Add(fhFORAmpL1J2);
e022364d 1383 fOutputList->Add(fhL0Amp);
a40222c8 1384 fOutputList->Add(fhL0AmpL1G);
1385 fOutputList->Add(fhL0AmpL1J);
aff917ac 1386 fOutputList->Add(fhL1Amp);
e022364d 1387 fOutputList->Add(fhL1GAmp);
6be2314f 1388 fOutputList->Add(fhL1G2Amp);
e022364d 1389 fOutputList->Add(fhL1JAmp);
6be2314f 1390 fOutputList->Add(fhL1J2Amp);
1391 fOutputList->Add(fhL1FOREnergy);
bce9493b 1392 fOutputList->Add(fhL0Patch);
1393 fOutputList->Add(fhL1GPatch);
6be2314f 1394 fOutputList->Add(fhL1G2Patch);
1395 fOutputList->Add(fhL1GPatchNotFake);
1396 fOutputList->Add(fhL1GPatchFake);
1397 fOutputList->Add(fhL1GPatchAllFake);
1398 fOutputList->Add(fhL1GPatchNotAllFake);
1399 fOutputList->Add(fhL1GPatchNotAllFakeMax);
1400 fOutputList->Add(fhL1GPatchAllFakeMax);
863e74f5 1401 fOutputList->Add(fhL1GPatchNotAllFakeMaxE);
6be2314f 1402 fOutputList->Add(fhL1GPatchAllFakeMaxE);
863e74f5 1403 fOutputList->Add(fhL1GPatchNotAllFakeE);
6be2314f 1404 fOutputList->Add(fhL1GPatchAllFakeE);
863e74f5 1405 fOutputList->Add(fhL1GPatchFakeE);
6be2314f 1406 fOutputList->Add(fhL1GPatchNotFakeE);
46fec84c 1407 fOutputList->Add(fhNPatchFake);
1408 fOutputList->Add(fhNPatchNotFake);
863e74f5 1409
bce9493b 1410 fOutputList->Add(fhL1JPatch);
6be2314f 1411 fOutputList->Add(fhL1J2Patch);
ec77a234 1412 fOutputList->Add(fhFEESTU);
1413 fOutputList->Add(fhTRUSTU);
1414
1415 fOutputList->Add(fhGPMaxVV0TT);
1416 fOutputList->Add(fhJPMaxVV0TT);
1417
1418 fOutputList->Add(fhFORMeanAmp);
1419 fOutputList->Add(fhL0MeanAmp);
1420 fOutputList->Add(fhL1MeanAmp);
863e74f5 1421
ec77a234 1422 fOutputList->Add(fhL1GPatchMax);
6be2314f 1423 fOutputList->Add(fhL1G2PatchMax);
ec77a234 1424 fOutputList->Add(fhL1JPatchMax);
6be2314f 1425 fOutputList->Add(fhL1J2PatchMax);
ec77a234 1426
1427 // Cluster histograms, E
6be2314f 1428 TString hName [] = {"MB","L0","L1G","L1G2","L1J","L1J2","L1GOnly","L1JOnly","Central","SemiCentral"};
1429 TString hTitle [] = {"MB trigger","L0 trigger","L1 Gamma trigger","L1 Gamma2 trigger","L1 Jet trigger","L1 Jet2 trigger",
31a3f95a 1430 "L1 Gamma trigger and not L1 Jet","L1 Jet trigger and not L1 Gamma","Central trigger","SemiCentral trigger"};
863e74f5 1431
31a3f95a 1432 for(Int_t i=0; i < 3; i++)
1433 {
1434 Int_t j = i+5;
1435 if(i==0)j=0;
1436
1437 fhClusMBPure[i] = new TH1F(Form("hClus%sPure",hName[j].Data()),
1438 Form("clusters E distribution for %s, no other EMCAL trigger on",hTitle[j].Data()),
1439 fNBinsClusterE,0,fMaxClusterE);
1440 fhClusMBPure[i] ->SetXTitle("Energy (GeV)");
1441 fOutputList->Add(fhClusMBPure[i]);
863e74f5 1442
31a3f95a 1443 fhClusMaxMBPure[i] = new TH1F(Form("hClusMax%sPure",hName[j].Data()),
1444 Form("maximum energy cluster per event for %s, no other EMCAL trigger on",hTitle[j].Data()),
cf170170 1445 fNBinsClusterE,0,fMaxClusterE);
31a3f95a 1446 fhClusMaxMBPure[i] ->SetXTitle("Energy (GeV)");
863e74f5 1447 fOutputList->Add(fhClusMaxMBPure[i]);
31a3f95a 1448 }
bce9493b 1449
6be2314f 1450 for(Int_t i=0; i < 10; i++)
31a3f95a 1451 {
1452 fhV0[i] = new TH1F(Form("hV0%s",hName[i].Data()),
cf170170 1453 Form("V0 distribution for %s",hTitle[i].Data()),
1454 fNBinsV0Signal,0,fMaxV0Signal);
31a3f95a 1455 fhV0[i]->SetXTitle("V0");
1456 fOutputList->Add(fhV0[i] );
863e74f5 1457
31a3f95a 1458 fhClus[i] = new TH1F(Form("hClus%s",hName[i].Data()),
1459 Form("clusters E distribution for %s",hTitle[i].Data()),
1460 fNBinsClusterE,0,fMaxClusterE);
1461 fhClus[i] ->SetXTitle("Energy (GeV)");
1462 fOutputList->Add(fhClus[i]);
1463
1464 fhClusMax[i] = new TH1F(Form("hClusMax%s",hName[i].Data()),
1465 Form("maximum energy cluster per event for %s",hTitle[i].Data()),
1466 fNBinsClusterE,0,fMaxClusterE);
1467 fhClusMax[i]->SetXTitle("Energy (GeV)");
1468 fOutputList->Add(fhClusMax[i]);
1469
1470 // Cluster histograms, E vs Cen
1471
1472 fhClusCen[i] = new TH2F(Form("hClusCen%s",hName[i].Data()),
1473 Form("clusters E distribution vs centrality for %s",hTitle[i].Data()),
1474 fNBinsClusterE,0,fMaxClusterE,100, 0, 100);
1475 fhClusCen[i] ->SetXTitle("Energy (GeV)");
1476 fhClusCen[i] ->SetYTitle("Centrality");
863e74f5 1477 fOutputList->Add(fhClusCen[i]);
31a3f95a 1478
1479 fhClusCenMax[i] = new TH2F(Form("hClusCenMax%s",hName[i].Data()),
1480 Form("maximum energy cluster per event vs centrality for %s",hTitle[i].Data()),
1481 fNBinsClusterE,0,fMaxClusterE,100, 0, 100);
1482 fhClusCenMax[i]->SetXTitle("Energy (GeV)");
1483 fhClusCenMax[i]->SetYTitle("Centrality");
1484 fOutputList->Add(fhClusCenMax[i]);
1485
1486 // Cluster histograms, E vs V0
1487
1488 fhClusV0[i] = new TH2F(Form("hClusV0%s",hName[i].Data()),
1489 Form("clusters E distribution vs V0 for %s",hTitle[i].Data()),
1490 fNBinsClusterE,0,fMaxClusterE,fNBinsV0Signal,0,fMaxV0Signal);
1491 fhClusV0[i] ->SetXTitle("Energy (GeV)");
863e74f5 1492 fhClusV0[i] ->SetYTitle("V0");
31a3f95a 1493 fOutputList->Add(fhClusV0[i]);
1494
1495 fhClusV0Max[i] = new TH2F(Form("hClusV0Max%s",hName[i].Data()),
1496 Form("maximum energy cluster per event vs V0 for %s",hTitle[i].Data()),
1497 fNBinsClusterE,0,fMaxClusterE,fNBinsV0Signal,0,fMaxV0Signal);
1498 fhClusV0Max[i]->SetXTitle("Energy (GeV)");
1499 fhClusV0Max[i]->SetYTitle("V0");
1500 fOutputList->Add(fhClusV0Max[i]);
1501
1502 // Cluster histograms, E vs Pseudorapidity
1503 Float_t etamin =-0.8;
1504 Float_t etamax = 0.8;
1505 Int_t neta = 160;
1506 fhClusEta[i] = new TH2F(Form("hClusEta%s",hName[i].Data()),
1507 Form("clusters distribution vs #eta for %s",hTitle[i].Data()),
1508 fNBinsClusterE,0,fMaxClusterE,neta, etamin, etamax);
1509 fhClusEta[i] ->SetXTitle("Energy (GeV)");
1510 fhClusEta[i] ->SetYTitle("#eta");
863e74f5 1511 fOutputList->Add(fhClusEta[i]);
31a3f95a 1512
1513 fhClusEtaMax[i] = new TH2F(Form("hClusEtaMax%s",hName[i].Data()),
1514 Form("maximum energy cluster per event vs #eta for %s",hTitle[i].Data()),
1515 fNBinsClusterE,0,fMaxClusterE,neta, etamin, etamax);
1516 fhClusEtaMax[i]->SetXTitle("Energy (GeV)");
1517 fhClusEtaMax[i]->SetYTitle("#eta");
1518 fOutputList->Add(fhClusEtaMax[i]);
1519
1520 // Cluster histograms, E vs Azimuthal angle
1521 Float_t phimin = 80. *TMath::DegToRad();
1522 Float_t phimax = 190.*TMath::DegToRad();
1523 Int_t nphi = 110;
1524
1525 fhClusPhi[i] = new TH2F(Form("hClusPhi%s",hName[i].Data()),
1526 Form("clusters distribution vs #phi for %s",hTitle[i].Data()),
1527 fNBinsClusterE,0,fMaxClusterE,nphi, phimin, phimax);
1528 fhClusPhi[i] ->SetXTitle("Energy (GeV)");
1529 fhClusPhi[i] ->SetYTitle("#phi (rad)");
863e74f5 1530 fOutputList->Add(fhClusPhi[i]);
31a3f95a 1531
1532 fhClusPhiMax[i] = new TH2F(Form("hClusPhiMax%s",hName[i].Data()),
1533 Form("maximum energy cluster per event vs #phi for %s",hTitle[i].Data()),
1534 fNBinsClusterE,0,fMaxClusterE,nphi, phimin, phimax);
1535 fhClusPhiMax[i]->SetXTitle("Energy (GeV)");
863e74f5 1536 fhClusPhiMax[i]->SetYTitle("#phi (rad)");
31a3f95a 1537 fOutputList->Add(fhClusPhiMax[i]);
1538
1539 // Cluster histograms, Pseudorapidity vs Azimuthal angle
1540
1541 fhClusEtaPhiHigh[i] = new TH2F(Form("hClusEtaPhiHigh%s",hName[i].Data()),
1542 Form("clusters distribution #eta vs #phi for %s, E > 10 GeV",hTitle[i].Data()),
1543 neta, etamin, etamax,nphi, phimin, phimax);
1544 fhClusEtaPhiHigh[i] ->SetXTitle("#eta");
1545 fhClusEtaPhiHigh[i] ->SetYTitle("#phi (rad)");
863e74f5 1546 fOutputList->Add(fhClusEtaPhiHigh[i]);
31a3f95a 1547
1548 fhClusEtaPhiHighCluMax[i] = new TH2F(Form("hClusEtaPhiHighCluMax%s",hName[i].Data()),
1549 Form("maximum energy cluster per event #eta vs #phi for %s, E > 10 GeV",hTitle[i].Data()),
1550 neta, etamin, etamax,nphi, phimin, phimax);
1551 fhClusEtaPhiHighCluMax[i]->SetXTitle("#eta");
1552 fhClusEtaPhiHighCluMax[i]->SetYTitle("#phi (rad)");
1553 fOutputList->Add(fhClusEtaPhiHighCluMax[i]);
1554
1555 fhClusEtaPhiLow[i] = new TH2F(Form("hClusEtaPhiLow%s",hName[i].Data()),
1556 Form("clusters distribution #eta vs #phi for %s, E < 10 GeV",hTitle[i].Data()),
1557 neta, etamin, etamax,nphi, phimin, phimax);
1558 fhClusEtaPhiLow[i] ->SetXTitle("#eta");
1559 fhClusEtaPhiLow[i] ->SetYTitle("#phi (rad)");
1560 fOutputList->Add(fhClusEtaPhiLow[i]);
1561
1562 fhClusEtaPhiLowCluMax[i] = new TH2F(Form("hClusEtaPhiLowCluMax%s",hName[i].Data()),
1563 Form("maximum energy cluster per event #eta vs #phi for %s, E < 10 GeV",hTitle[i].Data()),
1564 neta, etamin, etamax,nphi, phimin, phimax);
1565 fhClusEtaPhiLowCluMax[i]->SetXTitle("#eta");
1566 fhClusEtaPhiLowCluMax[i]->SetYTitle("#phi (rad)");
1567 fOutputList->Add(fhClusEtaPhiLowCluMax[i]);
1568
1569 fhClusEtaPhiHighCellMax[i] = new TH2F(Form("hClusEtaPhiHighCellMax%s",hName[i].Data()),
1570 Form("Cluster hit map in calorimeter (max cell), column vs row for %s, E > 10 GeV",hTitle[i].Data()),
1571 fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
1572 fhClusEtaPhiHighCellMax[i] ->SetXTitle("Index #eta (columnns)");
1573 fhClusEtaPhiHighCellMax[i] ->SetYTitle("Index #phi (rows)");
1574 fOutputList->Add(fhClusEtaPhiHighCellMax[i]);
1575
1576 fhClusEtaPhiHighCellMaxCluMax[i] = new TH2F(Form("hClusEtaPhiHighCellMaxCluMax%s",hName[i].Data()),
1577 Form("Max E cluster hit map in calorimeter (max cell), column vs row for %s, E > 10 GeV",
1578 hTitle[i].Data()),fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
1579 fhClusEtaPhiHighCellMaxCluMax[i]->SetXTitle("Index #eta (columnns)");
1580 fhClusEtaPhiHighCellMaxCluMax[i]->SetYTitle("Index #phi (rows)");
1581 fOutputList->Add(fhClusEtaPhiHighCellMaxCluMax[i]);
1582
1583 fhClusEtaPhiLowCellMax[i] = new TH2F(Form("hClusEtaPhiLowCellMax%s",hName[i].Data()),
1584 Form("Cluster hit map in calorimeter (max cell), column vs row for %s, E < 10 GeV",hTitle[i].Data()),
1585 fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
1586 fhClusEtaPhiLowCellMax[i] ->SetXTitle("Index #eta (columnns)");
1587 fhClusEtaPhiLowCellMax[i] ->SetYTitle("#phi (rad)");
1588 fOutputList->Add(fhClusEtaPhiLowCellMax[i]);
1589
1590 fhClusEtaPhiLowCellMaxCluMax[i] = new TH2F(Form("hClusEtaPhiLowCellMaxCluMax%s",hName[i].Data()),
1591 Form("Max E cluster hit map in calorimeter (max cell), column vs row for %s, E < 10 GeV",
1592 hTitle[i].Data()),fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
1593 fhClusEtaPhiLowCellMaxCluMax[i]->SetXTitle("Index #eta (columnns)");
863e74f5 1594 fhClusEtaPhiLowCellMaxCluMax[i]->SetYTitle("#phi (rad)");
31a3f95a 1595 fOutputList->Add(fhClusEtaPhiLowCellMaxCluMax[i]);
1596 }
ec77a234 1597
863e74f5 1598 PostData(1, fOutputList);
bce9493b 1599}
cf170170 1600
85196c29 1601//______________________________________________________
863e74f5 1602void AliAnalysisTaskEMCALTriggerQA::UserExec(Option_t *)
bce9493b 1603{
1604 // Main loop
863e74f5 1605
bce9493b 1606 AliVEvent* event = InputEvent();
1607
997b261e 1608 if (!event)
bce9493b 1609 {
997b261e 1610 AliError("No Event, exit");
bce9493b 1611 return;
1612 }
1613
2b4e1cc5 1614 InitGeometry(); // only once, must be done before OADB, geo OADB accessed here
1615
1616 if(fAccessOADB) AccessOADB(); // only once
1617
46fec84c 1618 InitCellPatchMaps(); //init to 0 map for cells and patches
1619
a40222c8 1620 //trigger configuration
997b261e 1621 TString triggerclasses = event->GetFiredTriggerClasses();
77626b4a 1622
997b261e 1623 Int_t eventType = ((AliVHeader*)event->GetHeader())->GetEventType();
46fec84c 1624 //std::cout << "trigger = " << triggerclasses << std::endl;
1625
6b4638cc 1626 // physics events eventType=7, select only those
6b4638cc 1627 if(triggerclasses=="" || eventType != 7) return;
0d896539 1628
46fec84c 1629 SetTriggerEventBit(triggerclasses);
997b261e 1630
46fec84c 1631 FillEventCounterHistogram();
0d896539 1632
46fec84c 1633 FillCellMaps();
0d896539 1634
46fec84c 1635 FillTriggerPatchMaps(triggerclasses);
bce9493b 1636
46fec84c 1637 FillMapHistograms();
bce9493b 1638
46fec84c 1639 FillV0Histograms();
bce9493b 1640
46fec84c 1641 FillL1GammaPatchHistograms();
bce9493b 1642
46fec84c 1643 FillL1JetPatchHistograms();
6be2314f 1644
46fec84c 1645 // FEE vs STU vs TRU
1646 FillCorrelationHistograms();
863e74f5 1647
46fec84c 1648 ClusterAnalysis();
0d896539 1649
863e74f5 1650 PostData(1, fOutputList);
85196c29 1651
1652}