]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG4/UserTasks/EmcalTasks/AliAnalysisTaskEMCALTriggerQA.cxx
Removing non existent class
[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"
6bfd1538 37#include "AliEMCALRecoUtils.h"
bce9493b 38
39#include "AliAnalysisTaskEMCALTriggerQA.h"
40
41ClassImp(AliAnalysisTaskEMCALTriggerQA)
42
85196c29 43//______________________________________________________________
bce9493b 44AliAnalysisTaskEMCALTriggerQA::AliAnalysisTaskEMCALTriggerQA() :
45AliAnalysisTaskSE(),
46fOutputList(0),
6bfd1538 47fGeometry(0), fGeoName("EMCAL_COMPLETEV1"), fRecoUtils(new AliEMCALRecoUtils),
bce9493b 48fhNEvents(0),
e022364d 49fhFORAmp(0),
a40222c8 50fhFORAmpL1G(0),
51fhFORAmpL1J(0),
e022364d 52fhL0Amp(0),
a40222c8 53fhL0AmpL1G(0),
54fhL0AmpL1J(0),
aff917ac 55fhL1Amp(0),
e022364d 56fhL1GAmp(0),
57fhL1JAmp(0),
bce9493b 58fhL0Patch(0),
59fhL1GPatch(0),
60fhL1JPatch(0),
85196c29 61fhFEESTU(0),
62fhTRUSTU(0),
bce9493b 63fhV0STU(0),
64fhFullTRUSTU(0),
65fhSTUChecks(0),
75e10d6a 66fhClusMB(0),
67fhClusL0(0),
68fhClusL1G(0),
69fhClusL1J(0),
480b9db0 70fhClusL1GOnly(0),
71fhClusL1JOnly(0),
72fhClusMaxMB(0),
73fhClusMaxL0(0),
74fhClusMaxL1G(0),
75fhClusMaxL1J(0),
76fhClusMaxL1GOnly(0),
77fhClusMaxL1JOnly(0),
e98e49c3 78fhGPMaxVV0TT(0),
79fhJPMaxVV0TT(0),
85196c29 80fNBinsSTUSignal (2000), fMaxSTUSignal (200000),
81fNBinsTRUSignal (2000), fMaxTRUSignal (200000),
82fNBinsV0Signal (2000), fMaxV0Signal (20000),
83fNBinsSTUFEERatio(2000), fMaxSTUFEERatio(20000),
8a50a36c 84fNBinsSTUTRURatio(2000), fMaxSTUTRURatio(200),
85fNBinsClusterE (500), fMaxClusterE (100)
bce9493b 86
87{
88 // Constructor
bce9493b 89
90}
91
85196c29 92//______________________________________________________________________________
bce9493b 93AliAnalysisTaskEMCALTriggerQA::AliAnalysisTaskEMCALTriggerQA(const char *name) :
94AliAnalysisTaskSE(name),
95fOutputList(0),
6bfd1538 96fGeometry(0), fGeoName("EMCAL_COMPLETEV1"), fRecoUtils(new AliEMCALRecoUtils),
bce9493b 97fhNEvents(0),
e022364d 98fhFORAmp(0),
a40222c8 99fhFORAmpL1G(0),
100fhFORAmpL1J(0),
e022364d 101fhL0Amp(0),
a40222c8 102fhL0AmpL1G(0),
103fhL0AmpL1J(0),
aff917ac 104fhL1Amp(0),
e022364d 105fhL1GAmp(0),
106fhL1JAmp(0),
bce9493b 107fhL0Patch(0),
108fhL1GPatch(0),
109fhL1JPatch(0),
85196c29 110fhFEESTU(0),
111fhTRUSTU(0),
bce9493b 112fhV0STU(0),
113fhFullTRUSTU(0),
114fhSTUChecks(0),
75e10d6a 115fhClusMB(0),
116fhClusL0(0),
117fhClusL1G(0),
118fhClusL1J(0),
480b9db0 119fhClusL1GOnly(0),
120fhClusL1JOnly(0),
121fhClusMaxMB(0),
122fhClusMaxL0(0),
123fhClusMaxL1G(0),
124fhClusMaxL1J(0),
125fhClusMaxL1GOnly(0),
126fhClusMaxL1JOnly(0),
e98e49c3 127fhGPMaxVV0TT(0),
128fhJPMaxVV0TT(0),
85196c29 129fNBinsSTUSignal (2000), fMaxSTUSignal (200000),
130fNBinsTRUSignal (2000), fMaxTRUSignal (200000),
4ee53435 131fNBinsV0Signal (5000), fMaxV0Signal (50000),
85196c29 132fNBinsSTUFEERatio(2000), fMaxSTUFEERatio(20000),
8a50a36c 133fNBinsSTUTRURatio(2000), fMaxSTUTRURatio(200),
134fNBinsClusterE (500), fMaxClusterE (100)
bce9493b 135{
136 // Constructor
bce9493b 137
138 DefineOutput(1, TList::Class());
139
140}
141
142
85196c29 143//___________________________________________________________
bce9493b 144void AliAnalysisTaskEMCALTriggerQA::UserCreateOutputObjects()
145{
146 // Init histograms and geometry
147
148 fGeometry = AliEMCALGeometry::GetInstance(fGeoName);
149
85196c29 150 fOutputList = new TList;
151 fOutputList ->SetOwner(kTRUE);
bce9493b 152
480b9db0 153 fhNEvents = new TH1F("hNEvents","Number of selected events",7,0,7);
85196c29 154 fhNEvents ->SetYTitle("N events");
77626b4a 155 fhNEvents ->GetXaxis()->SetBinLabel(1 ,"All");
156 fhNEvents ->GetXaxis()->SetBinLabel(2 ,"INT");
157 fhNEvents ->GetXaxis()->SetBinLabel(3 ,"L0");
158 fhNEvents ->GetXaxis()->SetBinLabel(4 ,"L1-G");
159 fhNEvents ->GetXaxis()->SetBinLabel(5 ,"L1-J");
480b9db0 160 fhNEvents ->GetXaxis()->SetBinLabel(6 ,"L1-G - !L1-J");
161 fhNEvents ->GetXaxis()->SetBinLabel(7 ,"L1-J - !L1-G");
77626b4a 162
bce9493b 163
75e10d6a 164 fhFORAmp = new TH2F("hFORAmp", "FEE cells deposited energy, grouped like FastOR 2x2 per Row and Column",
165 fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
166 fhFORAmp ->SetXTitle("Index #eta (columnns)");
e022364d 167 fhFORAmp ->SetYTitle("Index #phi (rows)");
168 fhFORAmp ->SetZTitle("Amplitude");
a40222c8 169
75e10d6a 170 fhFORAmpL1G = new TH2F("hFORAmpL1G", "FEE cells deposited energy, grouped like FastOR 2x2 per Row and Column, with L1G trigger condition",
171 fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
172 fhFORAmpL1G ->SetXTitle("Index #eta (columnns)");
a40222c8 173 fhFORAmpL1G ->SetYTitle("Index #phi (rows)");
174 fhFORAmpL1G ->SetZTitle("Amplitude");
175
75e10d6a 176 fhFORAmpL1J = new TH2F("hFORAmpL1J", "FEE cells deposited energy, grouped like FastOR 2x2 per Row and Column, with L1J trigger condition",
177 fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
178 fhFORAmpL1J ->SetXTitle("Index #eta (columnns)");
a40222c8 179 fhFORAmpL1J ->SetYTitle("Index #phi (rows)");
180 fhFORAmpL1J ->SetZTitle("Amplitude");
aff917ac 181
75e10d6a 182 fhL0Amp = new TH2F("hL0Amp","FALTRO signal per Row and Column",
183 fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
184 fhL0Amp ->SetXTitle("Index #eta (columnns)");
e022364d 185 fhL0Amp ->SetYTitle("Index #phi (rows)");
186 fhL0Amp ->SetZTitle("Amplitude");
a40222c8 187
75e10d6a 188 fhL0AmpL1G = new TH2F("hL0AmpL1G","FALTRO signal per Row and Column, with L1G trigger condition",
189 fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
190 fhL0AmpL1G ->SetXTitle("Index #eta (columnns)");
a40222c8 191 fhL0AmpL1G ->SetYTitle("Index #phi (rows)");
192 fhL0AmpL1G ->SetZTitle("Amplitude");
193
75e10d6a 194 fhL0AmpL1J = new TH2F("hL0AmpL1J","FALTRO signal per Row and Column, with L1j trigger condition",
195 fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
196 fhL0AmpL1J ->SetXTitle("Index #eta (columnns)");
a40222c8 197 fhL0AmpL1J ->SetYTitle("Index #phi (rows)");
198 fhL0AmpL1J ->SetZTitle("Amplitude");
aff917ac 199
75e10d6a 200 fhL1Amp = new TH2F("hL1Amp","STU signal per Row and Column",
201 fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
202 fhL1Amp ->SetXTitle("Index #eta (columnns)");
aff917ac 203 fhL1Amp ->SetYTitle("Index #phi (rows)");
204 fhL1Amp ->SetZTitle("Amplitude");
205
75e10d6a 206 fhL1GAmp = new TH2F("hL1GAmp","STU signal per Row and Column for L1 Gamma",
207 fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
208 fhL1GAmp ->SetXTitle("Index #eta (columnns)");
e022364d 209 fhL1GAmp ->SetYTitle("Index #phi (rows)");
210 fhL1GAmp ->SetZTitle("Amplitude");
aff917ac 211
75e10d6a 212 fhL1JAmp = new TH2F("hL1JAmp","STU signal per Row and Column for L1 Jet",
77626b4a 213 fgkFALTROCols/4,0,fgkFALTROCols,fgkFALTRORows/4,0,fgkFALTRORows);
75e10d6a 214 fhL1JAmp ->SetXTitle("Index #eta (columnns)");
e022364d 215 fhL1JAmp ->SetYTitle("Index #phi (rows)");
216 fhL1JAmp ->SetZTitle("Amplitude");
aff917ac 217
75e10d6a 218 fhL0Patch = new TH2F("hL0Patch","FOR with associated L0 Patch",
219 fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
220 fhL0Patch ->SetXTitle("Index #eta (columnns)");
85196c29 221 fhL0Patch ->SetYTitle("Index #phi (rows)");
e022364d 222 fhL0Patch ->SetZTitle("counts");
aff917ac 223
75e10d6a 224 fhL1GPatch = new TH2F("hL1GPatch","FOR with associated L1 Gamma Patch",
225 fgkFALTROCols,0,fgkFALTROCols,fgkFALTRORows,0,fgkFALTRORows);
226 fhL1GPatch ->SetXTitle("Index #eta (columnns)");
85196c29 227 fhL1GPatch ->SetYTitle("Index #phi (rows)");
e022364d 228 fhL1GPatch ->SetZTitle("counts");
aff917ac 229
75e10d6a 230 fhL1JPatch = new TH2F("hL1JPatch","FOR with associated L1 Jet Patch",
77626b4a 231 fgkFALTROCols/4,0,fgkFALTROCols,fgkFALTRORows/4,0,fgkFALTRORows);
75e10d6a 232 fhL1JPatch ->SetXTitle("Index #eta (columnns)");
85196c29 233 fhL1JPatch ->SetYTitle("Index #phi (rows)");
e022364d 234 fhL1JPatch ->SetZTitle("counts");
aff917ac 235
75e10d6a 236 fhFullTRUSTU = new TH2I("hFullTRUSTU","Total signal STU vs TRU",
237 fNBinsTRUSignal,0,fMaxTRUSignal,fNBinsSTUSignal,0,fMaxSTUSignal);
bce9493b 238 fhFullTRUSTU->SetXTitle("Total signal TRU");
239 fhFullTRUSTU->SetYTitle("Total signal STU");
e022364d 240 fhFullTRUSTU->SetZTitle("counts");
aff917ac 241
75e10d6a 242 fhV0STU = new TH2I("hV0STU","Total signal STU vs V0C+V0S",
243 fNBinsV0Signal,0,fMaxV0Signal,fNBinsSTUSignal,0,fMaxSTUSignal);
85196c29 244 fhV0STU ->SetXTitle("Signal V0C+V0A");
245 fhV0STU ->SetYTitle("Total signal STU");
e022364d 246 fhV0STU ->SetZTitle("counts");
aff917ac 247
85196c29 248 fhSTUChecks = new TH2I("hSTUChecks","Check FEE/STU link",2,0,2,15,0,15);
249 fhSTUChecks ->SetXTitle("Index #eta");
250 fhSTUChecks ->SetYTitle("Index #phi");
75e10d6a 251
8a50a36c 252 fhClusMB = new TH1F("hClusMB","clusters distribution for MB trigger",fNBinsClusterE,0,fMaxClusterE);
75e10d6a 253 fhClusMB->SetXTitle("Energy (GeV)");
254
8a50a36c 255 fhClusL0 = new TH1F("hClusL0","clusters distribution for L0 trigger",fNBinsClusterE,0,fMaxClusterE);
75e10d6a 256 fhClusMB->SetXTitle("Energy (GeV)");
257
8a50a36c 258 fhClusL1G = new TH1F("hClusL1G","clusters distribution for L1G trigger",fNBinsClusterE,0,fMaxClusterE);
75e10d6a 259 fhClusL1G->SetXTitle("Energy (GeV)");
260
8a50a36c 261 fhClusL1J = new TH1F("hClusL1J","clusters distribution for L1J trigger",fNBinsClusterE,0,fMaxClusterE);
75e10d6a 262 fhClusL1J->SetXTitle("Energy (GeV)");
aff917ac 263
8a50a36c 264 fhClusL1GOnly = new TH1F("hClusL1GOnly","clusters distribution for L1G trigger and not L1J",fNBinsClusterE,0,fMaxClusterE);
480b9db0 265 fhClusL1GOnly->SetXTitle("Energy (GeV)");
266
8a50a36c 267 fhClusL1JOnly = new TH1F("hClusL1JOnly","clusters distribution for L1J trigger and not L1G",fNBinsClusterE,0,fMaxClusterE);
480b9db0 268 fhClusL1JOnly->SetXTitle("Energy (GeV)");
269
8a50a36c 270 fhClusMaxMB = new TH1F("hClusMaxMB","maximum energy cluster per event for MB trigger",fNBinsClusterE,0,fMaxClusterE);
480b9db0 271 fhClusMaxMB->SetXTitle("Energy (GeV)");
272
8a50a36c 273 fhClusMaxL0 = new TH1F("hClusMaxL0","maximum energy cluster per event for L0 trigger",fNBinsClusterE,0,fMaxClusterE);
480b9db0 274 fhClusMaxMB->SetXTitle("Energy (GeV)");
275
8a50a36c 276 fhClusMaxL1G = new TH1F("hClusMaxL1G","maximum energy cluster per event for L1G trigger",fNBinsClusterE,0,fMaxClusterE);
480b9db0 277 fhClusMaxL1G->SetXTitle("Energy (GeV)");
278
8a50a36c 279 fhClusMaxL1J = new TH1F("hClusMaxL1J","maximum energy cluster per event for L1J trigger",fNBinsClusterE,0,fMaxClusterE);
480b9db0 280 fhClusMaxL1J->SetXTitle("Energy (GeV)");
281
8a50a36c 282 fhClusMaxL1GOnly = new TH1F("hClusMaxL1GOnly","maximum energy cluster per event for L1G trigger and not L1J",fNBinsClusterE,0,fMaxClusterE);
480b9db0 283 fhClusMaxL1GOnly->SetXTitle("Energy (GeV)");
284
8a50a36c 285 fhClusMaxL1JOnly = new TH1F("hClusMaxL1JOnly","maximum energy cluster per event for L1J trigger and not L1G",fNBinsClusterE,0,fMaxClusterE);
480b9db0 286 fhClusMaxL1JOnly->SetXTitle("Energy (GeV)");
287
85196c29 288 fhFEESTU = new TH2F("hFEESTU","STU / FEE vs channel", fNBinsSTUFEERatio,0,fMaxSTUFEERatio,30,0,30);
289 fhFEESTU ->SetXTitle("STU/FEE signal");
290 fhFEESTU ->SetYTitle("channel");
e022364d 291 fhFEESTU ->SetZTitle("counts");
aff917ac 292
85196c29 293 fhTRUSTU = new TH2F("hTRUSTU","STU / TRU vs channel", fNBinsSTUTRURatio,0,fMaxSTUTRURatio,30,0,30);
294 fhTRUSTU ->SetXTitle("STU/TRU signal");
295 fhTRUSTU ->SetYTitle("channel");
e022364d 296 fhTRUSTU ->SetZTitle("counts");
aff917ac 297
4ee53435 298 fhGPMaxVV0TT = new TH2F("hGPMaxVV0TT","Maximum patch of L1-Gamma vs V0 signal",fNBinsV0Signal,0,fMaxV0Signal,1000,0,1000);
299 fhGPMaxVV0TT ->SetXTitle("V0 TT");
300 fhGPMaxVV0TT ->SetXTitle("Patch Max");
301
302 fhJPMaxVV0TT = new TH2F("hJPMaxVV0TT","Maximum patch of L1-Jet vs V0 signal",fNBinsV0Signal,0,fMaxV0Signal,1000,0,1000);
303 fhJPMaxVV0TT ->SetXTitle("V0 TT");
304 fhJPMaxVV0TT ->SetXTitle("Patch Max");
305
bce9493b 306 fOutputList->Add(fhNEvents);
307 fOutputList->Add(fhV0STU);
e022364d 308 fOutputList->Add(fhFORAmp);
a40222c8 309 fOutputList->Add(fhFORAmpL1G);
310 fOutputList->Add(fhFORAmpL1J);
e022364d 311 fOutputList->Add(fhL0Amp);
a40222c8 312 fOutputList->Add(fhL0AmpL1G);
313 fOutputList->Add(fhL0AmpL1J);
aff917ac 314 fOutputList->Add(fhL1Amp);
e022364d 315 fOutputList->Add(fhL1GAmp);
316 fOutputList->Add(fhL1JAmp);
bce9493b 317 fOutputList->Add(fhL0Patch);
318 fOutputList->Add(fhL1GPatch);
319 fOutputList->Add(fhL1JPatch);
320 fOutputList->Add(fhFullTRUSTU);
321 fOutputList->Add(fhSTUChecks);
480b9db0 322
75e10d6a 323 fOutputList->Add(fhClusMB);
324 fOutputList->Add(fhClusL0);
325 fOutputList->Add(fhClusL1G);
326 fOutputList->Add(fhClusL1J);
480b9db0 327 fOutputList->Add(fhClusL1GOnly);
328 fOutputList->Add(fhClusL1JOnly);
329
330 fOutputList->Add(fhClusMaxMB);
331 fOutputList->Add(fhClusMaxL0);
332 fOutputList->Add(fhClusMaxL1G);
333 fOutputList->Add(fhClusMaxL1J);
334 fOutputList->Add(fhClusMaxL1GOnly);
335 fOutputList->Add(fhClusMaxL1JOnly);
336
85196c29 337 fOutputList->Add(fhFEESTU);
338 fOutputList->Add(fhTRUSTU);
e98e49c3 339
340 fOutputList->Add(fhGPMaxVV0TT);
341 fOutputList->Add(fhJPMaxVV0TT);
bce9493b 342
343 PostData(1, fOutputList);
344
345}
85196c29 346//______________________________________________________
bce9493b 347void AliAnalysisTaskEMCALTriggerQA::UserExec(Option_t *)
348{
349 // Main loop
bce9493b 350
351 AliVEvent* event = InputEvent();
352
353 //Remove next lines when AODs ready
354 AliESDEvent *esdEvent = dynamic_cast<AliESDEvent*>(event);
355
356 if (!esdEvent)
357 {
358 AliError("Work only with ESDs, not available, exit");
359 return;
360 }
361
a40222c8 362 //trigger configuration
363 TString triggerclasses = esdEvent->GetFiredTriggerClasses();
77626b4a 364
365 if(triggerclasses=="") return;
366
367 fhNEvents->Fill(0.5);
6bfd1538 368 if(triggerclasses.Contains("CINT7-B-NOPF-ALLNOTRD") ||
369 triggerclasses.Contains("CINT7-I-NOPF-ALLNOTRD") ||
370 triggerclasses.Contains("CINT1-I-NOPF-ALLNOTRD") ||
8a50a36c 371 triggerclasses.Contains("CINT1-B-NOPF-ALLNOTRD") ||
0e91f259 372 triggerclasses.Contains("CPBI2_B1-B-NOPF-ALLNOTRD") ) fhNEvents->Fill(1.5);
77626b4a 373 if(triggerclasses.Contains("CEMC7-B-NOPF-ALLNOTRD") ||
6bfd1538 374 triggerclasses.Contains("CEMC1-B-NOPF-ALLNOTRD") ) fhNEvents->Fill(2.5);
8a50a36c 375 if(triggerclasses.Contains("CEMC7EGA-B-NOPF-CENTNOTRD") ||
376 triggerclasses.Contains("CPBI2EGA") ) { fhNEvents->Fill(3.5);
377 if(!triggerclasses.Contains("CEMC7EJE-B-NOPF-CENTNOTRD") &&
378 !triggerclasses.Contains("CPBI2EJE") ) fhNEvents->Fill(5.5); }
379 if(triggerclasses.Contains("CEMC7EJE-B-NOPF-CENTNOTRD") ||
380 triggerclasses.Contains("CPBI2EJE") ) { fhNEvents->Fill(4.5);
381 if(!triggerclasses.Contains("CEMC7EGA-B-NOPF-CENTNOTRD") &&
382 !triggerclasses.Contains("CPBI2EGA") ) fhNEvents->Fill(6.5); }
77626b4a 383
0e91f259 384 std::cout << "trigger = " << triggerclasses << std::endl;
bce9493b 385
bce9493b 386 //map for cells and patches
387
75e10d6a 388 Double_t emcalCell [fgkFALTRORows][fgkFALTROCols], emcalCellL1G [fgkFALTRORows][fgkFALTROCols];
389 Double_t emcalCellL1J [fgkFALTRORows][fgkFALTROCols], emcalTrigL0 [fgkFALTRORows][fgkFALTROCols];
390 Double_t emcalTrigL0L1G[fgkFALTRORows][fgkFALTROCols], emcalTrigL0L1J[fgkFALTRORows][fgkFALTROCols];
391 Double_t emcalTrigL1G [fgkFALTRORows][fgkFALTROCols], emcalTrigL1J [fgkFALTRORows][fgkFALTROCols], emcalTrigL1 [fgkFALTRORows][fgkFALTROCols];
392 Double_t emcalPatchL0 [fgkFALTRORows][fgkFALTROCols], emcalPatchL1G [fgkFALTRORows][fgkFALTROCols], emcalPatchL1J[fgkFALTRORows][fgkFALTROCols];
bce9493b 393
394 for (Int_t i = 0; i < fgkFALTRORows; i++)
395 {
396 for (Int_t j = 0; j < fgkFALTROCols; j++)
397 {
85196c29 398 emcalTrigL0[i][j] = 0.;
a40222c8 399 emcalTrigL0L1G[i][j]= 0.;
400 emcalTrigL0L1J[i][j]= 0.;
e022364d 401 emcalTrigL1G[i][j] = 0.;
402 emcalTrigL1J[i][j] = 0.;
85196c29 403 emcalTrigL1[i][j] = 0.;
404 emcalCell[i][j] = 0.;
a40222c8 405 emcalCellL1G[i][j] = 0.;
406 emcalCellL1J[i][j] = 0.;
85196c29 407 emcalPatchL0[i][j] = 0.;
bce9493b 408 emcalPatchL1G[i][j] = 0.;
409 emcalPatchL1J[i][j] = 0.;
410 }
411 }
412
413 // ---------------------------------
414 // Cells analysis
415 // Fill FEE energy per channel array
416 // ---------------------------------
417
418 Int_t posX = -1, posY = -1;
419 Int_t nSupMod = -1, ieta = -1, iphi = -1, nModule = -1, nIphi = -1, nIeta = -1;
420 Short_t absId = -1;
421 Int_t nCells = 0;
422
423 AliVCaloCells& cells= *(event->GetEMCALCells());
424
425 if (cells.IsEMCAL())
426 {
427 for (Int_t icell = 0; icell < cells.GetNumberOfCells(); icell++)
428 {
429 nCells ++;
430
431 Double_t amp =0., time = 0.;
432
433 cells.GetCell(icell, absId, amp, time);
434
435 fGeometry->GetCellIndex(absId, nSupMod, nModule, nIphi, nIeta);
436 fGeometry->GetCellPhiEtaIndexInSModule(nSupMod, nModule, nIphi, nIeta, iphi, ieta);
437
438 posX = (nSupMod % 2) ? ieta + AliEMCALGeoParams::fgkEMCALCols : ieta;
439 posY = iphi + AliEMCALGeoParams::fgkEMCALRows * int(nSupMod / 2);
bce9493b 440
85196c29 441 if(int(posX/2) > fgkFALTROCols || int(posY/2) > fgkFALTRORows ) {
442 printf("AliAnalysisTaskEMCALTriggerQA::UserExec() - Wrong Position (x,y) = (%d,%d)\n",posX,posY);
443 continue;
444 }
445
446 emcalCell[int(posY/2)][int(posX/2)] += amp;
a40222c8 447
0e91f259 448 if(triggerclasses.Contains("CEMC7EGA-B-NOPF-CENTNOTRD") || triggerclasses.Contains("CPBI2EGA")) emcalCellL1G[int(posY/2)][int(posX/2)] += amp;
449 if(triggerclasses.Contains("CEMC7EJE-B-NOPF-CENTNOTRD") || triggerclasses.Contains("CPBI2EJE")) emcalCellL1J[int(posY/2)][int(posX/2)] += amp;
85196c29 450
bce9493b 451 }
452 }
453
85196c29 454 //-------------------------------------
455 // Trigger analysis, fill L0, L1 arrays
456 //-------------------------------------
bce9493b 457
458 AliESDCaloTrigger& trg= * (esdEvent->GetCaloTrigger("EMCAL"));
459
460 Int_t nL0Patch = 0 ;
461 Int_t nL1Patch = 0 ;
462 Double_t totSTU = 0.;
463 Double_t totTRU = 0.;
464
465 trg.Reset();
466 while (trg.Next())
467 {
468 trg.GetPosition(posX,posY);
469
470
471 if (posX > -1 && posY > -1)
472 {
473 //L0 analysis
474 Int_t nTimes = 0;
475 trg.GetNL0Times(nTimes);
85196c29 476
aff917ac 477 Float_t ampL0 = 0.;
478 trg.GetAmplitude(ampL0);
479 emcalTrigL0[posY][posX] += ampL0;
0e91f259 480 if(triggerclasses.Contains("CEMC7EGA-B-NOPF-CENTNOTRD") || triggerclasses.Contains("CPBI2EGA")) emcalTrigL0L1G[posY][posX] += ampL0;
481 if(triggerclasses.Contains("CEMC7EJE-B-NOPF-CENTNOTRD") || triggerclasses.Contains("CPBI2EJE")) emcalTrigL0L1J[posY][posX] += ampL0;
aff917ac 482 totTRU += ampL0;
483
bce9493b 484 if (nTimes)
485 {
486 nL0Patch += nTimes;
bce9493b 487 emcalPatchL0[posY][posX] = 1.;
aff917ac 488 fhL0Patch->Fill(posX,59-posY);//59 is due to FOR reference
bce9493b 489 }
490
491 //L1 analysis
492 Int_t bit = 0;
493 trg.GetTriggerBits(bit);
494
aff917ac 495 Int_t ts = 0;
496 trg.GetL1TimeSum(ts);
e98e49c3 497 emcalTrigL1 [posY][posX] = ts;
aff917ac 498 totSTU += ts;
499
bce9493b 500 //L1-Gamma
501 if (bit >> 4 & 0x1)
502 {
503 nL1Patch ++;
504 emcalPatchL1G[posY][posX] = 1.;
aff917ac 505 fhL1GPatch->Fill(posX,59-posY);
506
507 emcalTrigL1G[posY][posX] += ts;
bce9493b 508
85196c29 509 //printf("Gamma STU patch %d, time sum %d, posX %d , posY %d\n",nL1Patch,ts,posX, posY);
bce9493b 510 }
511
512 //L1-Jet
513 if (bit >> 5 & 0x1)
514 {
515 nL1Patch ++;
516 emcalPatchL1J[posY][posX] = 1.;
aff917ac 517 fhL1JPatch->Fill(posX,59-posY);
518
519 emcalTrigL1J[posY][posX] += ts;
bce9493b 520
85196c29 521 //printf("Jet STU patch %d, time sum %d, posX %d , posY %d\n",nL1Patch,ts,posX, posY);
aff917ac 522
bce9493b 523 }
524
525 }
526 }
527
85196c29 528 if(totTRU > fMaxTRUSignal)printf("AliAnalysisTaskEMCALTriggerQA::UserExec() - Large totTRU %f\n",totTRU);
529 if(totSTU > fMaxSTUSignal)printf("AliAnalysisTaskEMCALTriggerQA::UserExec() - Large totSTU %f\n",totSTU);
bce9493b 530
531 if (totTRU != 0) fhFullTRUSTU->Fill(totTRU,totSTU);
532
533 //V0 analysis
534 AliESDVZERO* eventV0 = esdEvent->GetVZEROData();
535
e98e49c3 536 Float_t v0C = 0, v0A = 0, v0TT = trg.GetL1V0(0)+trg.GetL1V0(1);
bce9493b 537
538 if (eventV0)
539 {
540 for (Int_t i = 0; i < 32; i++)
541 {
542 v0C += eventV0->GetAdcV0C(i);
543 v0A += eventV0->GetAdcV0A(i);
544 }
545 }
e98e49c3 546
bce9493b 547 if (totSTU != 0) {
548 fhV0STU->Fill(v0A+v0C,totSTU);
85196c29 549 if( v0A+v0C > fMaxV0Signal) printf("AliAnalysisTaskEMCALTriggerQA::UserExec() - Large v0A+v0C %f\n",v0A+v0C);
bce9493b 550 }
551
85196c29 552 //if(nL0Patch!=0 || nL1Patch!=0) printf("total TRU %f, total STU %f, V0C+V0A %f; nL0 %d, nL1 %d \n",
553 // totTRU,totSTU,v0A+v0C,nL0Patch,nL1Patch);
554
e98e49c3 555 Int_t patchMax = 0;
556
557 for (Int_t i = 0; i < 47; i++)
558 {
559 for (Int_t j = 0; j < 59; j++)
560 {
561 Int_t patchG = 0;
562
563 for (Int_t k = 0; k < 2; k++)
564 {
565 for (Int_t l = 0; l < 2; l++)
566 {
567 patchG += int(emcalTrigL1[i + k][j + l]);
568 }
569 }
570
571 if (patchG > patchMax) patchMax = patchG;
572 }
573 }
574
575 fhGPMaxVV0TT->Fill(v0TT, patchMax);
576
577 patchMax = 0;
578
579 for (Int_t i = 0; i < 9; i++)
580 {
581 for (Int_t j = 0; j < 12; j++)
582 {
583 Int_t patchJ = 0;
584
585 for (Int_t k = 0; k < 16; k++)
586 {
587 for (Int_t l = 0; l < 16; l++)
588 {
589 patchJ += int(emcalTrigL1[4*i + k][4*j + l]);
590 }
591 }
592
593 if (patchJ > patchMax) patchMax = patchJ;
594 }
595 }
596
597 fhJPMaxVV0TT->Fill(v0TT, patchMax);
598
bce9493b 599 //Matrix with signal per channel
e022364d 600 for (Int_t i = 0; i < fgkFALTRORows; i++)
bce9493b 601 {
e022364d 602 for (Int_t j = 0; j < fgkFALTROCols; j++) //check x,y direction for reading FOR ((0,0) = top left);
bce9493b 603 {
e022364d 604 fhFORAmp->Fill( j, fgkFALTRORows-i-1, emcalCell [i][j]);
a40222c8 605 fhFORAmpL1G->Fill( j, fgkFALTRORows-i-1, emcalCellL1G [i][j]);
606 fhFORAmpL1J->Fill( j, fgkFALTRORows-i-1, emcalCellL1J [i][j]);
e022364d 607 fhL0Amp ->Fill( j, fgkFALTRORows-i-1, emcalTrigL0 [i][j]);
a40222c8 608 fhL0AmpL1G ->Fill( j, fgkFALTRORows-i-1, emcalTrigL0L1G [i][j]);
609 fhL0AmpL1J ->Fill( j, fgkFALTRORows-i-1, emcalTrigL0L1J [i][j]);
610 fhL1Amp ->Fill( j, fgkFALTRORows-i-1, emcalTrigL1 [i][j]);
e022364d 611 fhL1GAmp->Fill( j, fgkFALTRORows-i-1, emcalTrigL1G[i][j]);
612 fhL1JAmp->Fill( j, fgkFALTRORows-i-1, emcalTrigL1J[i][j]);
bce9493b 613 }
614 }
615
aff917ac 616 //FEE-TRU-STU correlation checks
bce9493b 617 Double_t ampFOR[30] = {0.}, ampL0[30] = {0.}, ampL1[30] = {0.};
e022364d 618 for (Int_t i = 0; i < fgkFALTRORows; i++)
bce9493b 619 {
e022364d 620 for (Int_t j = 0; j < fgkFALTROCols; j++)
bce9493b 621 {
622
623 //method to get TRU number
85196c29 624 Int_t idFOR = -1;
625 fGeometry->GetAbsFastORIndexFromPositionInEMCAL(j,i,idFOR);
626 Int_t iTRU = -1;
627 Int_t iADC = -1;
628 fGeometry->GetTRUFromAbsFastORIndex(idFOR,iTRU,iADC);
629 //printf("i %d, j %d, iTRU %d, iADC %d, idFOR %d; cell %f, L0 %f, L1 %f\n",
630 // i,j,iTRU,iADC,idFOR, emcalCell [i][j],emcalTrigL0[i][j],emcalTrigL1[i][j]);
bce9493b 631 if (iTRU >= 0)
632 {
633 ampFOR[iTRU] += emcalCell [i][j];
634 ampL0[iTRU] += emcalTrigL0[i][j];
635 ampL1[iTRU] += emcalTrigL1[i][j];
636 }
637 }
638 }
639
85196c29 640 // FEE vs STU and TRU vs STU ratios
bce9493b 641 for (Int_t i = 0; i < 30; i++)
642 {
85196c29 643
644 if (ampFOR[i] != 0 && ampL1[i] != 0) {
645 fhFEESTU->Fill(ampL1[i]/ampFOR[i],i);
646 if(ampL1[i]/ampFOR[i] > fMaxSTUFEERatio) printf("AliAnalysisTaskEMCALTriggerQA::UserExec() - Large STU/FEE ratio %f\n",ampL1[i]/ampFOR[i]);
647 }
648
649 if (ampL0[i] != 0 && ampL1[i] != 0) {
650 fhTRUSTU->Fill(ampL1[i]/ampL0[i] ,i);
651 if(ampL1[i]/ampL0[i] > fMaxSTUTRURatio) printf("AliAnalysisTaskEMCALTriggerQA::UserExec() - Large STU/TRU ratio %f\n",ampL1[i]/ampL0[i]);
652 }
653
bce9493b 654 }
655
75e10d6a 656 //Get Vertex
657 Double_t v[3] = {0,0,0};
658 esdEvent->GetVertex()->GetXYZ(v);
659
660 //clusters distribution
661 TRefArray* caloClus = new TRefArray();
662 esdEvent->GetEMCALClusters(caloClus);
663
664 Int_t nCaloClusters = caloClus->GetEntriesFast();
480b9db0 665 Float_t emax = 0;
75e10d6a 666 for(Int_t icalo = 0; icalo < nCaloClusters; icalo++)
667 {
668 AliESDCaloCluster *clus = (AliESDCaloCluster*) (caloClus->At(icalo));
669
6bfd1538 670 if(!clus->IsEMCAL()) continue;
671
672 if(!fRecoUtils->IsGoodCluster(clus,fGeometry,InputEvent()->GetEMCALCells(),InputEvent()->GetBunchCrossNumber())){
8a50a36c 673 continue;
6bfd1538 674 }
675
8a50a36c 676 if(clus->GetNCells() < 2) continue ; // Avoid 1 cell clusters, noisy.
677
480b9db0 678 if(clus->E() > emax) emax = clus->E();
679
6bfd1538 680 if(triggerclasses.Contains("CINT7-B-NOPF-ALLNOTRD") ||
681 triggerclasses.Contains("CINT7-I-NOPF-ALLNOTRD") ||
682 triggerclasses.Contains("CINT1-I-NOPF-ALLNOTRD") ||
8a50a36c 683 triggerclasses.Contains("CINT1-B-NOPF-ALLNOTRD") ||
0e91f259 684 triggerclasses.Contains("CPBI2_B1-B-NOPF-ALLNOTRD") ) fhClusMB ->Fill(clus->E());
75e10d6a 685 if(triggerclasses.Contains("CEMC7-B-NOPF-ALLNOTRD") ||
480b9db0 686 triggerclasses.Contains("CEMC1-B-NOPF-ALLNOTRD") ) fhClusL0 ->Fill(clus->E());
8a50a36c 687 if(triggerclasses.Contains("CEMC7EGA-B-NOPF-CENTNOTRD") ||
688 triggerclasses.Contains("CPBI2EGA") ) { fhClusL1G ->Fill(clus->E());
689 if(!triggerclasses.Contains("CEMC7EJE-B-NOPF-CENTNOTRD") &&
690 !triggerclasses.Contains("CPBI2EJE") ) fhClusL1GOnly->Fill(clus->E()); }
691 if(triggerclasses.Contains("CEMC7EJE-B-NOPF-CENTNOTRD") ||
692 triggerclasses.Contains("CPBI2EJE") ) { fhClusL1J ->Fill(clus->E());
693 if(!triggerclasses.Contains("CEMC7EGA-B-NOPF-CENTNOTRD") &&
694 !triggerclasses.Contains("CPBI2EGA") ) fhClusL1JOnly->Fill(clus->E()); }
480b9db0 695
75e10d6a 696 }
480b9db0 697
698 if(triggerclasses.Contains("CINT7-B-NOPF-ALLNOTRD") ||
699 triggerclasses.Contains("CINT7-I-NOPF-ALLNOTRD") ||
700 triggerclasses.Contains("CINT1-I-NOPF-ALLNOTRD") ||
8a50a36c 701 triggerclasses.Contains("CINT1-B-NOPF-ALLNOTRD") ||
0e91f259 702 triggerclasses.Contains("CPBI2_B1-B-NOPF-ALLNOTRD") ) fhClusMaxMB ->Fill(emax);
480b9db0 703 if(triggerclasses.Contains("CEMC7-B-NOPF-ALLNOTRD") ||
704 triggerclasses.Contains("CEMC1-B-NOPF-ALLNOTRD") ) fhClusMaxL0 ->Fill(emax);
8a50a36c 705 if(triggerclasses.Contains("CEMC7EGA-B-NOPF-CENTNOTRD") ||
706 triggerclasses.Contains("CPBI2EGA") ) { fhClusMaxL1G ->Fill(emax);
707 if(!triggerclasses.Contains("CEMC7EJE-B-NOPF-CENTNOTRD") &&
708 !triggerclasses.Contains("CPBI2EJE") ) fhClusMaxL1GOnly->Fill(emax); }
709 if(triggerclasses.Contains("CEMC7EJE-B-NOPF-CENTNOTRD") ||
710 triggerclasses.Contains("CPBI2EJE") ) { fhClusMaxL1J ->Fill(emax);
711 if(!triggerclasses.Contains("CEMC7EGA-B-NOPF-CENTNOTRD") &&
712 !triggerclasses.Contains("CPBI2EGA") ) fhClusMaxL1JOnly->Fill(emax); }
480b9db0 713
bce9493b 714 PostData(1, fOutputList);
715
716}
717
85196c29 718//_______________________________________________________
719void AliAnalysisTaskEMCALTriggerQA::Terminate(Option_t *)
720{
721 // Terminate analysis
722 // Do some plots
723
724 Int_t checkSTU[30];
725 for (Int_t i = 0; i < 30; i++)
726 {
727 checkSTU[i] = 1 ; // Init array
728 TH1F* hTRUSTUChannel = (TH1F*) fhTRUSTU->ProjectionY(Form("hTRUSTUChannel%d",i),i,i);
729 //printf("AliAnalysisTaskEMCALTriggerQA::Terminate() - Channel %d TRUSTU Entries %d, Integral(10,20) %f ",
730 // i, hTRUSTUChannel->GetEntries(), hTRUSTUChannel->Integral(10,20));
aff917ac 731 Int_t binMin = hTRUSTUChannel->FindBin(10);
732 Int_t binMax = hTRUSTUChannel->FindBin(20);
85196c29 733 if (hTRUSTUChannel->GetEntries() > 0 &&
aff917ac 734 hTRUSTUChannel->Integral(binMin,binMax)/hTRUSTUChannel->GetEntries() < 0.9)
85196c29 735 checkSTU[i] = 0;
736 else if(hTRUSTUChannel->GetEntries() <= 0)
737 checkSTU[i] = 0;
738
739 //printf(" - %d\n",checkSTU[i]);
740 delete hTRUSTUChannel;
741 }
742
743 for (Int_t i = 0; i < 30; i++)
744 {
745 if (i<15) fhSTUChecks->Fill(0.,i,checkSTU[i]);
746 else fhSTUChecks->Fill(1.,i,checkSTU[i]);
747 }
748
749}