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