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