Reduce binning a factor 4 for L1-Jet plots, fill event counter histogram for differen...
[u/mrichter/AliRoot.git] / PWG4 / UserTasks / EmcalTasks / AliAnalysisTaskEMCALTriggerQA.cxx
CommitLineData
bce9493b 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//------------------------------------------------------------------------//
17// Fill histograms with basic QA information for EMCAL offline trigger //
18// Author: Nicolas Arbor (LPSC-Grenoble) //
19// Gustavo Conesa Balbastre (LPSC-Grenoble) //
20// //
21//------------------------------------------------------------------------//
22
23
24#include <TList.h>
25#include <TH1F.h>
26#include <TH2F.h>
27#include <TF1.h>
28
29#include "AliLog.h"
30#include "AliVCluster.h"
31#include "AliVCaloCells.h"
32#include "AliVEvent.h"
33#include "AliESDEvent.h"
34#include "AliESDVZERO.h"
35#include "AliESDCaloTrigger.h"
36#include "AliEMCALGeometry.h"
37
38#include "AliAnalysisTaskEMCALTriggerQA.h"
39
40ClassImp(AliAnalysisTaskEMCALTriggerQA)
41
85196c29 42//______________________________________________________________
bce9493b 43AliAnalysisTaskEMCALTriggerQA::AliAnalysisTaskEMCALTriggerQA() :
44AliAnalysisTaskSE(),
45fOutputList(0),
46fGeometry(0), fGeoName("EMCAL_COMPLETEV1"),
47fhNEvents(0),
e022364d 48fhFORAmp(0),
a40222c8 49fhFORAmpL1G(0),
50fhFORAmpL1J(0),
e022364d 51fhL0Amp(0),
a40222c8 52fhL0AmpL1G(0),
53fhL0AmpL1J(0),
aff917ac 54fhL1Amp(0),
e022364d 55fhL1GAmp(0),
56fhL1JAmp(0),
bce9493b 57fhL0Patch(0),
58fhL1GPatch(0),
59fhL1JPatch(0),
85196c29 60fhFEESTU(0),
61fhTRUSTU(0),
bce9493b 62fhV0STU(0),
63fhFullTRUSTU(0),
64fhSTUChecks(0),
75e10d6a 65fhClusMB(0),
66fhClusL0(0),
67fhClusL1G(0),
68fhClusL1J(0),
85196c29 69fNBinsSTUSignal (2000), fMaxSTUSignal (200000),
70fNBinsTRUSignal (2000), fMaxTRUSignal (200000),
71fNBinsV0Signal (2000), fMaxV0Signal (20000),
72fNBinsSTUFEERatio(2000), fMaxSTUFEERatio(20000),
73fNBinsSTUTRURatio(2000), fMaxSTUTRURatio(200)
bce9493b 74
75{
76 // Constructor
bce9493b 77
78}
79
85196c29 80//______________________________________________________________________________
bce9493b 81AliAnalysisTaskEMCALTriggerQA::AliAnalysisTaskEMCALTriggerQA(const char *name) :
82AliAnalysisTaskSE(name),
83fOutputList(0),
84fGeometry(0), fGeoName("EMCAL_COMPLETEV1"),
85fhNEvents(0),
e022364d 86fhFORAmp(0),
a40222c8 87fhFORAmpL1G(0),
88fhFORAmpL1J(0),
e022364d 89fhL0Amp(0),
a40222c8 90fhL0AmpL1G(0),
91fhL0AmpL1J(0),
aff917ac 92fhL1Amp(0),
e022364d 93fhL1GAmp(0),
94fhL1JAmp(0),
bce9493b 95fhL0Patch(0),
96fhL1GPatch(0),
97fhL1JPatch(0),
85196c29 98fhFEESTU(0),
99fhTRUSTU(0),
bce9493b 100fhV0STU(0),
101fhFullTRUSTU(0),
102fhSTUChecks(0),
75e10d6a 103fhClusMB(0),
104fhClusL0(0),
105fhClusL1G(0),
106fhClusL1J(0),
85196c29 107fNBinsSTUSignal (2000), fMaxSTUSignal (200000),
108fNBinsTRUSignal (2000), fMaxTRUSignal (200000),
109fNBinsV0Signal (2000), fMaxV0Signal (20000),
110fNBinsSTUFEERatio(2000), fMaxSTUFEERatio(20000),
111fNBinsSTUTRURatio(2000), fMaxSTUTRURatio(200)
bce9493b 112
113{
114 // Constructor
bce9493b 115
116 DefineOutput(1, TList::Class());
117
118}
119
120
85196c29 121//___________________________________________________________
bce9493b 122void AliAnalysisTaskEMCALTriggerQA::UserCreateOutputObjects()
123{
124 // Init histograms and geometry
125
126 fGeometry = AliEMCALGeometry::GetInstance(fGeoName);
127
85196c29 128 fOutputList = new TList;
129 fOutputList ->SetOwner(kTRUE);
bce9493b 130
77626b4a 131 fhNEvents = new TH1F("hNEvents","Number of selected events",5,0,5);
85196c29 132 fhNEvents ->SetYTitle("N events");
77626b4a 133 fhNEvents ->GetXaxis()->SetBinLabel(1 ,"All");
134 fhNEvents ->GetXaxis()->SetBinLabel(2 ,"INT");
135 fhNEvents ->GetXaxis()->SetBinLabel(3 ,"L0");
136 fhNEvents ->GetXaxis()->SetBinLabel(4 ,"L1-G");
137 fhNEvents ->GetXaxis()->SetBinLabel(5 ,"L1-J");
138
bce9493b 139
75e10d6a 140 fhFORAmp = new TH2F("hFORAmp", "FEE cells deposited energy, grouped like FastOR 2x2 per Row and Column",
141 fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
142 fhFORAmp ->SetXTitle("Index #eta (columnns)");
e022364d 143 fhFORAmp ->SetYTitle("Index #phi (rows)");
144 fhFORAmp ->SetZTitle("Amplitude");
a40222c8 145
75e10d6a 146 fhFORAmpL1G = new TH2F("hFORAmpL1G", "FEE cells deposited energy, grouped like FastOR 2x2 per Row and Column, with L1G trigger condition",
147 fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
148 fhFORAmpL1G ->SetXTitle("Index #eta (columnns)");
a40222c8 149 fhFORAmpL1G ->SetYTitle("Index #phi (rows)");
150 fhFORAmpL1G ->SetZTitle("Amplitude");
151
75e10d6a 152 fhFORAmpL1J = new TH2F("hFORAmpL1J", "FEE cells deposited energy, grouped like FastOR 2x2 per Row and Column, with L1J trigger condition",
153 fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
154 fhFORAmpL1J ->SetXTitle("Index #eta (columnns)");
a40222c8 155 fhFORAmpL1J ->SetYTitle("Index #phi (rows)");
156 fhFORAmpL1J ->SetZTitle("Amplitude");
aff917ac 157
75e10d6a 158 fhL0Amp = new TH2F("hL0Amp","FALTRO signal per Row and Column",
159 fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
160 fhL0Amp ->SetXTitle("Index #eta (columnns)");
e022364d 161 fhL0Amp ->SetYTitle("Index #phi (rows)");
162 fhL0Amp ->SetZTitle("Amplitude");
a40222c8 163
75e10d6a 164 fhL0AmpL1G = new TH2F("hL0AmpL1G","FALTRO signal per Row and Column, with L1G trigger condition",
165 fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
166 fhL0AmpL1G ->SetXTitle("Index #eta (columnns)");
a40222c8 167 fhL0AmpL1G ->SetYTitle("Index #phi (rows)");
168 fhL0AmpL1G ->SetZTitle("Amplitude");
169
75e10d6a 170 fhL0AmpL1J = new TH2F("hL0AmpL1J","FALTRO signal per Row and Column, with L1j trigger condition",
171 fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
172 fhL0AmpL1J ->SetXTitle("Index #eta (columnns)");
a40222c8 173 fhL0AmpL1J ->SetYTitle("Index #phi (rows)");
174 fhL0AmpL1J ->SetZTitle("Amplitude");
aff917ac 175
75e10d6a 176 fhL1Amp = new TH2F("hL1Amp","STU signal per Row and Column",
177 fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
178 fhL1Amp ->SetXTitle("Index #eta (columnns)");
aff917ac 179 fhL1Amp ->SetYTitle("Index #phi (rows)");
180 fhL1Amp ->SetZTitle("Amplitude");
181
75e10d6a 182 fhL1GAmp = new TH2F("hL1GAmp","STU signal per Row and Column for L1 Gamma",
183 fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
184 fhL1GAmp ->SetXTitle("Index #eta (columnns)");
e022364d 185 fhL1GAmp ->SetYTitle("Index #phi (rows)");
186 fhL1GAmp ->SetZTitle("Amplitude");
aff917ac 187
75e10d6a 188 fhL1JAmp = new TH2F("hL1JAmp","STU signal per Row and Column for L1 Jet",
77626b4a 189 fgkFALTROCols/4,0,fgkFALTROCols,fgkFALTRORows/4,0,fgkFALTRORows);
75e10d6a 190 fhL1JAmp ->SetXTitle("Index #eta (columnns)");
e022364d 191 fhL1JAmp ->SetYTitle("Index #phi (rows)");
192 fhL1JAmp ->SetZTitle("Amplitude");
aff917ac 193
75e10d6a 194 fhL0Patch = new TH2F("hL0Patch","FOR with associated L0 Patch",
195 fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
196 fhL0Patch ->SetXTitle("Index #eta (columnns)");
85196c29 197 fhL0Patch ->SetYTitle("Index #phi (rows)");
e022364d 198 fhL0Patch ->SetZTitle("counts");
aff917ac 199
75e10d6a 200 fhL1GPatch = new TH2F("hL1GPatch","FOR with associated L1 Gamma Patch",
201 fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
202 fhL1GPatch ->SetXTitle("Index #eta (columnns)");
85196c29 203 fhL1GPatch ->SetYTitle("Index #phi (rows)");
e022364d 204 fhL1GPatch ->SetZTitle("counts");
aff917ac 205
75e10d6a 206 fhL1JPatch = new TH2F("hL1JPatch","FOR with associated L1 Jet Patch",
77626b4a 207 fgkFALTROCols/4,0,fgkFALTROCols,fgkFALTRORows/4,0,fgkFALTRORows);
75e10d6a 208 fhL1JPatch ->SetXTitle("Index #eta (columnns)");
85196c29 209 fhL1JPatch ->SetYTitle("Index #phi (rows)");
e022364d 210 fhL1JPatch ->SetZTitle("counts");
aff917ac 211
75e10d6a 212 fhFullTRUSTU = new TH2I("hFullTRUSTU","Total signal STU vs TRU",
213 fNBinsTRUSignal,0,fMaxTRUSignal,fNBinsSTUSignal,0,fMaxSTUSignal);
bce9493b 214 fhFullTRUSTU->SetXTitle("Total signal TRU");
215 fhFullTRUSTU->SetYTitle("Total signal STU");
e022364d 216 fhFullTRUSTU->SetZTitle("counts");
aff917ac 217
75e10d6a 218 fhV0STU = new TH2I("hV0STU","Total signal STU vs V0C+V0S",
219 fNBinsV0Signal,0,fMaxV0Signal,fNBinsSTUSignal,0,fMaxSTUSignal);
85196c29 220 fhV0STU ->SetXTitle("Signal V0C+V0A");
221 fhV0STU ->SetYTitle("Total signal STU");
e022364d 222 fhV0STU ->SetZTitle("counts");
aff917ac 223
85196c29 224 fhSTUChecks = new TH2I("hSTUChecks","Check FEE/STU link",2,0,2,15,0,15);
225 fhSTUChecks ->SetXTitle("Index #eta");
226 fhSTUChecks ->SetYTitle("Index #phi");
75e10d6a 227
228 fhClusMB = new TH1F("hClusMB","clusters distribution for MB trigger",500,0,100);
229 fhClusMB->SetXTitle("Energy (GeV)");
230
231 fhClusL0 = new TH1F("hClusL0","clusters distribution for L0 trigger",500,0,100);
232 fhClusMB->SetXTitle("Energy (GeV)");
233
234 fhClusL1G = new TH1F("hClusL1G","clusters distribution for L1G trigger",500,0,100);
235 fhClusL1G->SetXTitle("Energy (GeV)");
236
237 fhClusL1J = new TH1F("hClusL1J","clusters distribution for L1J trigger",500,0,100);
238 fhClusL1J->SetXTitle("Energy (GeV)");
aff917ac 239
85196c29 240 fhFEESTU = new TH2F("hFEESTU","STU / FEE vs channel", fNBinsSTUFEERatio,0,fMaxSTUFEERatio,30,0,30);
241 fhFEESTU ->SetXTitle("STU/FEE signal");
242 fhFEESTU ->SetYTitle("channel");
e022364d 243 fhFEESTU ->SetZTitle("counts");
aff917ac 244
85196c29 245 fhTRUSTU = new TH2F("hTRUSTU","STU / TRU vs channel", fNBinsSTUTRURatio,0,fMaxSTUTRURatio,30,0,30);
246 fhTRUSTU ->SetXTitle("STU/TRU signal");
247 fhTRUSTU ->SetYTitle("channel");
e022364d 248 fhTRUSTU ->SetZTitle("counts");
aff917ac 249
bce9493b 250 fOutputList->Add(fhNEvents);
251 fOutputList->Add(fhV0STU);
e022364d 252 fOutputList->Add(fhFORAmp);
a40222c8 253 fOutputList->Add(fhFORAmpL1G);
254 fOutputList->Add(fhFORAmpL1J);
e022364d 255 fOutputList->Add(fhL0Amp);
a40222c8 256 fOutputList->Add(fhL0AmpL1G);
257 fOutputList->Add(fhL0AmpL1J);
aff917ac 258 fOutputList->Add(fhL1Amp);
e022364d 259 fOutputList->Add(fhL1GAmp);
260 fOutputList->Add(fhL1JAmp);
bce9493b 261 fOutputList->Add(fhL0Patch);
262 fOutputList->Add(fhL1GPatch);
263 fOutputList->Add(fhL1JPatch);
264 fOutputList->Add(fhFullTRUSTU);
265 fOutputList->Add(fhSTUChecks);
75e10d6a 266 fOutputList->Add(fhClusMB);
267 fOutputList->Add(fhClusL0);
268 fOutputList->Add(fhClusL1G);
269 fOutputList->Add(fhClusL1J);
85196c29 270 fOutputList->Add(fhFEESTU);
271 fOutputList->Add(fhTRUSTU);
bce9493b 272
273 PostData(1, fOutputList);
274
275}
85196c29 276//______________________________________________________
bce9493b 277void AliAnalysisTaskEMCALTriggerQA::UserExec(Option_t *)
278{
279 // Main loop
bce9493b 280
281 AliVEvent* event = InputEvent();
282
283 //Remove next lines when AODs ready
284 AliESDEvent *esdEvent = dynamic_cast<AliESDEvent*>(event);
285
286 if (!esdEvent)
287 {
288 AliError("Work only with ESDs, not available, exit");
289 return;
290 }
291
a40222c8 292 //trigger configuration
293 TString triggerclasses = esdEvent->GetFiredTriggerClasses();
77626b4a 294
295 if(triggerclasses=="") return;
296
297 fhNEvents->Fill(0.5);
298 if(triggerclasses.Contains("CINT7-B-NOPF-ALLNOTRD") ||
299 triggerclasses.Contains("CINT1-B-NOPF-ALLNOTRD") ) fhNEvents->Fill(1.5);
300 if(triggerclasses.Contains("CEMC7-B-NOPF-ALLNOTRD") ||
301 triggerclasses.Contains("CEMC7-B-NOPF-ALLNOTRD") ) fhNEvents->Fill(2.5);
302 if(triggerclasses.Contains("CEMC7EGA-B-NOPF-CENTNOTRD")) fhNEvents->Fill(3.5);
303 if(triggerclasses.Contains("CEMC7EJE-B-NOPF-CENTNOTRD")) fhNEvents->Fill(4.5);
304
75e10d6a 305 //std::cout << "trigger = " << triggerclasses << std::endl;
bce9493b 306
bce9493b 307 //map for cells and patches
308
75e10d6a 309 Double_t emcalCell [fgkFALTRORows][fgkFALTROCols], emcalCellL1G [fgkFALTRORows][fgkFALTROCols];
310 Double_t emcalCellL1J [fgkFALTRORows][fgkFALTROCols], emcalTrigL0 [fgkFALTRORows][fgkFALTROCols];
311 Double_t emcalTrigL0L1G[fgkFALTRORows][fgkFALTROCols], emcalTrigL0L1J[fgkFALTRORows][fgkFALTROCols];
312 Double_t emcalTrigL1G [fgkFALTRORows][fgkFALTROCols], emcalTrigL1J [fgkFALTRORows][fgkFALTROCols], emcalTrigL1 [fgkFALTRORows][fgkFALTROCols];
313 Double_t emcalPatchL0 [fgkFALTRORows][fgkFALTROCols], emcalPatchL1G [fgkFALTRORows][fgkFALTROCols], emcalPatchL1J[fgkFALTRORows][fgkFALTROCols];
bce9493b 314
315 for (Int_t i = 0; i < fgkFALTRORows; i++)
316 {
317 for (Int_t j = 0; j < fgkFALTROCols; j++)
318 {
85196c29 319 emcalTrigL0[i][j] = 0.;
a40222c8 320 emcalTrigL0L1G[i][j]= 0.;
321 emcalTrigL0L1J[i][j]= 0.;
e022364d 322 emcalTrigL1G[i][j] = 0.;
323 emcalTrigL1J[i][j] = 0.;
85196c29 324 emcalTrigL1[i][j] = 0.;
325 emcalCell[i][j] = 0.;
a40222c8 326 emcalCellL1G[i][j] = 0.;
327 emcalCellL1J[i][j] = 0.;
85196c29 328 emcalPatchL0[i][j] = 0.;
bce9493b 329 emcalPatchL1G[i][j] = 0.;
330 emcalPatchL1J[i][j] = 0.;
331 }
332 }
333
334 // ---------------------------------
335 // Cells analysis
336 // Fill FEE energy per channel array
337 // ---------------------------------
338
339 Int_t posX = -1, posY = -1;
340 Int_t nSupMod = -1, ieta = -1, iphi = -1, nModule = -1, nIphi = -1, nIeta = -1;
341 Short_t absId = -1;
342 Int_t nCells = 0;
343
344 AliVCaloCells& cells= *(event->GetEMCALCells());
345
346 if (cells.IsEMCAL())
347 {
348 for (Int_t icell = 0; icell < cells.GetNumberOfCells(); icell++)
349 {
350 nCells ++;
351
352 Double_t amp =0., time = 0.;
353
354 cells.GetCell(icell, absId, amp, time);
355
356 fGeometry->GetCellIndex(absId, nSupMod, nModule, nIphi, nIeta);
357 fGeometry->GetCellPhiEtaIndexInSModule(nSupMod, nModule, nIphi, nIeta, iphi, ieta);
358
359 posX = (nSupMod % 2) ? ieta + AliEMCALGeoParams::fgkEMCALCols : ieta;
360 posY = iphi + AliEMCALGeoParams::fgkEMCALRows * int(nSupMod / 2);
bce9493b 361
85196c29 362 if(int(posX/2) > fgkFALTROCols || int(posY/2) > fgkFALTRORows ) {
363 printf("AliAnalysisTaskEMCALTriggerQA::UserExec() - Wrong Position (x,y) = (%d,%d)\n",posX,posY);
364 continue;
365 }
366
367 emcalCell[int(posY/2)][int(posX/2)] += amp;
a40222c8 368
75e10d6a 369 if(triggerclasses.Contains("CEMC7EGA-B-NOPF-CENTNOTRD")) emcalCellL1G[int(posY/2)][int(posX/2)] += amp;
370 if(triggerclasses.Contains("CEMC7EJE-B-NOPF-CENTNOTRD")) emcalCellL1J[int(posY/2)][int(posX/2)] += amp;
85196c29 371
bce9493b 372 }
373 }
374
85196c29 375 //-------------------------------------
376 // Trigger analysis, fill L0, L1 arrays
377 //-------------------------------------
bce9493b 378
379 AliESDCaloTrigger& trg= * (esdEvent->GetCaloTrigger("EMCAL"));
380
381 Int_t nL0Patch = 0 ;
382 Int_t nL1Patch = 0 ;
383 Double_t totSTU = 0.;
384 Double_t totTRU = 0.;
385
386 trg.Reset();
387 while (trg.Next())
388 {
389 trg.GetPosition(posX,posY);
390
391
392 if (posX > -1 && posY > -1)
393 {
394 //L0 analysis
395 Int_t nTimes = 0;
396 trg.GetNL0Times(nTimes);
85196c29 397
aff917ac 398 Float_t ampL0 = 0.;
399 trg.GetAmplitude(ampL0);
400 emcalTrigL0[posY][posX] += ampL0;
75e10d6a 401 if(triggerclasses.Contains("CEMC7EGA-B-NOPF-CENTNOTRD")) emcalTrigL0L1G[posY][posX] += ampL0;
402 if(triggerclasses.Contains("CEMC7EJE-B-NOPF-CENTNOTRD")) emcalTrigL0L1J[posY][posX] += ampL0;
aff917ac 403 totTRU += ampL0;
404
bce9493b 405 if (nTimes)
406 {
407 nL0Patch += nTimes;
bce9493b 408 emcalPatchL0[posY][posX] = 1.;
aff917ac 409 fhL0Patch->Fill(posX,59-posY);//59 is due to FOR reference
bce9493b 410 }
411
412 //L1 analysis
413 Int_t bit = 0;
414 trg.GetTriggerBits(bit);
415
aff917ac 416 Int_t ts = 0;
417 trg.GetL1TimeSum(ts);
418 emcalTrigL1 [posY][posX] += ts;
419 totSTU += ts;
420
bce9493b 421 //L1-Gamma
422 if (bit >> 4 & 0x1)
423 {
424 nL1Patch ++;
425 emcalPatchL1G[posY][posX] = 1.;
aff917ac 426 fhL1GPatch->Fill(posX,59-posY);
427
428 emcalTrigL1G[posY][posX] += ts;
bce9493b 429
85196c29 430 //printf("Gamma STU patch %d, time sum %d, posX %d , posY %d\n",nL1Patch,ts,posX, posY);
bce9493b 431 }
432
433 //L1-Jet
434 if (bit >> 5 & 0x1)
435 {
436 nL1Patch ++;
437 emcalPatchL1J[posY][posX] = 1.;
aff917ac 438 fhL1JPatch->Fill(posX,59-posY);
439
440 emcalTrigL1J[posY][posX] += ts;
bce9493b 441
85196c29 442 //printf("Jet STU patch %d, time sum %d, posX %d , posY %d\n",nL1Patch,ts,posX, posY);
aff917ac 443
bce9493b 444 }
445
446 }
447 }
448
85196c29 449 if(totTRU > fMaxTRUSignal)printf("AliAnalysisTaskEMCALTriggerQA::UserExec() - Large totTRU %f\n",totTRU);
450 if(totSTU > fMaxSTUSignal)printf("AliAnalysisTaskEMCALTriggerQA::UserExec() - Large totSTU %f\n",totSTU);
bce9493b 451
452 if (totTRU != 0) fhFullTRUSTU->Fill(totTRU,totSTU);
453
454 //V0 analysis
455 AliESDVZERO* eventV0 = esdEvent->GetVZEROData();
456
457 Float_t v0C = 0, v0A = 0;
458
459 if (eventV0)
460 {
461 for (Int_t i = 0; i < 32; i++)
462 {
463 v0C += eventV0->GetAdcV0C(i);
464 v0A += eventV0->GetAdcV0A(i);
465 }
466 }
467
468 if (totSTU != 0) {
469 fhV0STU->Fill(v0A+v0C,totSTU);
85196c29 470 if( v0A+v0C > fMaxV0Signal) printf("AliAnalysisTaskEMCALTriggerQA::UserExec() - Large v0A+v0C %f\n",v0A+v0C);
bce9493b 471 }
472
85196c29 473 //if(nL0Patch!=0 || nL1Patch!=0) printf("total TRU %f, total STU %f, V0C+V0A %f; nL0 %d, nL1 %d \n",
474 // totTRU,totSTU,v0A+v0C,nL0Patch,nL1Patch);
475
bce9493b 476 //Matrix with signal per channel
e022364d 477 for (Int_t i = 0; i < fgkFALTRORows; i++)
bce9493b 478 {
e022364d 479 for (Int_t j = 0; j < fgkFALTROCols; j++) //check x,y direction for reading FOR ((0,0) = top left);
bce9493b 480 {
e022364d 481 fhFORAmp->Fill( j, fgkFALTRORows-i-1, emcalCell [i][j]);
a40222c8 482 fhFORAmpL1G->Fill( j, fgkFALTRORows-i-1, emcalCellL1G [i][j]);
483 fhFORAmpL1J->Fill( j, fgkFALTRORows-i-1, emcalCellL1J [i][j]);
e022364d 484 fhL0Amp ->Fill( j, fgkFALTRORows-i-1, emcalTrigL0 [i][j]);
a40222c8 485 fhL0AmpL1G ->Fill( j, fgkFALTRORows-i-1, emcalTrigL0L1G [i][j]);
486 fhL0AmpL1J ->Fill( j, fgkFALTRORows-i-1, emcalTrigL0L1J [i][j]);
487 fhL1Amp ->Fill( j, fgkFALTRORows-i-1, emcalTrigL1 [i][j]);
e022364d 488 fhL1GAmp->Fill( j, fgkFALTRORows-i-1, emcalTrigL1G[i][j]);
489 fhL1JAmp->Fill( j, fgkFALTRORows-i-1, emcalTrigL1J[i][j]);
bce9493b 490 }
491 }
492
aff917ac 493 //FEE-TRU-STU correlation checks
bce9493b 494 Double_t ampFOR[30] = {0.}, ampL0[30] = {0.}, ampL1[30] = {0.};
e022364d 495 for (Int_t i = 0; i < fgkFALTRORows; i++)
bce9493b 496 {
e022364d 497 for (Int_t j = 0; j < fgkFALTROCols; j++)
bce9493b 498 {
499
500 //method to get TRU number
85196c29 501 Int_t idFOR = -1;
502 fGeometry->GetAbsFastORIndexFromPositionInEMCAL(j,i,idFOR);
503 Int_t iTRU = -1;
504 Int_t iADC = -1;
505 fGeometry->GetTRUFromAbsFastORIndex(idFOR,iTRU,iADC);
506 //printf("i %d, j %d, iTRU %d, iADC %d, idFOR %d; cell %f, L0 %f, L1 %f\n",
507 // i,j,iTRU,iADC,idFOR, emcalCell [i][j],emcalTrigL0[i][j],emcalTrigL1[i][j]);
bce9493b 508 if (iTRU >= 0)
509 {
510 ampFOR[iTRU] += emcalCell [i][j];
511 ampL0[iTRU] += emcalTrigL0[i][j];
512 ampL1[iTRU] += emcalTrigL1[i][j];
513 }
514 }
515 }
516
85196c29 517 // FEE vs STU and TRU vs STU ratios
bce9493b 518 for (Int_t i = 0; i < 30; i++)
519 {
85196c29 520
521 if (ampFOR[i] != 0 && ampL1[i] != 0) {
522 fhFEESTU->Fill(ampL1[i]/ampFOR[i],i);
523 if(ampL1[i]/ampFOR[i] > fMaxSTUFEERatio) printf("AliAnalysisTaskEMCALTriggerQA::UserExec() - Large STU/FEE ratio %f\n",ampL1[i]/ampFOR[i]);
524 }
525
526 if (ampL0[i] != 0 && ampL1[i] != 0) {
527 fhTRUSTU->Fill(ampL1[i]/ampL0[i] ,i);
528 if(ampL1[i]/ampL0[i] > fMaxSTUTRURatio) printf("AliAnalysisTaskEMCALTriggerQA::UserExec() - Large STU/TRU ratio %f\n",ampL1[i]/ampL0[i]);
529 }
530
bce9493b 531 }
532
75e10d6a 533 //Get Vertex
534 Double_t v[3] = {0,0,0};
535 esdEvent->GetVertex()->GetXYZ(v);
536
537 //clusters distribution
538 TRefArray* caloClus = new TRefArray();
539 esdEvent->GetEMCALClusters(caloClus);
540
541 Int_t nCaloClusters = caloClus->GetEntriesFast();
542 for(Int_t icalo = 0; icalo < nCaloClusters; icalo++)
543 {
544 AliESDCaloCluster *clus = (AliESDCaloCluster*) (caloClus->At(icalo));
545
546 if(triggerclasses.Contains("CINT7-B-NOPF-ALLNOTRD") ||
547 triggerclasses.Contains("CINT1-B-NOPF-ALLNOTRD") ) fhClusMB ->Fill(clus->E());
548 if(triggerclasses.Contains("CEMC7-B-NOPF-ALLNOTRD") ||
549 triggerclasses.Contains("CEMC7-B-NOPF-ALLNOTRD") ) fhClusL0 ->Fill(clus->E());
550 if(triggerclasses.Contains("CEMC7EGA-B-NOPF-CENTNOTRD")) fhClusL1G->Fill(clus->E());
551 if(triggerclasses.Contains("CEMC7EJE-B-NOPF-CENTNOTRD")) fhClusL1J->Fill(clus->E());
552 }
553
bce9493b 554 PostData(1, fOutputList);
555
556}
557
85196c29 558//_______________________________________________________
559void AliAnalysisTaskEMCALTriggerQA::Terminate(Option_t *)
560{
561 // Terminate analysis
562 // Do some plots
563
564 Int_t checkSTU[30];
565 for (Int_t i = 0; i < 30; i++)
566 {
567 checkSTU[i] = 1 ; // Init array
568 TH1F* hTRUSTUChannel = (TH1F*) fhTRUSTU->ProjectionY(Form("hTRUSTUChannel%d",i),i,i);
569 //printf("AliAnalysisTaskEMCALTriggerQA::Terminate() - Channel %d TRUSTU Entries %d, Integral(10,20) %f ",
570 // i, hTRUSTUChannel->GetEntries(), hTRUSTUChannel->Integral(10,20));
aff917ac 571 Int_t binMin = hTRUSTUChannel->FindBin(10);
572 Int_t binMax = hTRUSTUChannel->FindBin(20);
85196c29 573 if (hTRUSTUChannel->GetEntries() > 0 &&
aff917ac 574 hTRUSTUChannel->Integral(binMin,binMax)/hTRUSTUChannel->GetEntries() < 0.9)
85196c29 575 checkSTU[i] = 0;
576 else if(hTRUSTUChannel->GetEntries() <= 0)
577 checkSTU[i] = 0;
578
579 //printf(" - %d\n",checkSTU[i]);
580 delete hTRUSTUChannel;
581 }
582
583 for (Int_t i = 0; i < 30; i++)
584 {
585 if (i<15) fhSTUChecks->Fill(0.,i,checkSTU[i]);
586 else fhSTUChecks->Fill(1.,i,checkSTU[i]);
587 }
588
589}