AliPhysics  a0db429 (a0db429)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
AliAnalysisTaskEmcalTriggerPatchClusterMatch.cxx
Go to the documentation of this file.
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 // 1) Analysis task to identify the cluster that fired the trigger patch
18 // 2) perform some QA on the patch / cluster
19 // 3) and pass the saved out collection of cluster(s) to other tasks
20 //
21 // currently set up for GA trigger
22 //
23 // Author: Joel Mazer (joel.mazer@cern.ch)
24 //-------------------------------------------------------------------------
25 
26 // task head include
27 //#include "AliAnalysisTaskEmcalTriggerPatchClusterMatch.h"
28 #include <iostream>
29 
30 // ROOT includes
31 #include <TClonesArray.h>
32 #include <TH1F.h>
33 #include <TH2F.h>
34 #include <TH3F.h>
35 #include <TProfile.h>
36 #include <THnSparse.h>
37 #include <TList.h>
38 #include <TLorentzVector.h>
39 
40 // event handler (and pico's) includes
41 #include "AliAnalysisManager.h"
42 #include <AliInputEventHandler.h>
43 #include <AliVEventHandler.h>
44 #include "AliESDInputHandler.h"
45 #include "AliVCluster.h"
46 #include "AliVTrack.h"
47 #include "AliVVZERO.h"
48 #include "AliLog.h"
49 #include "AliEmcalParticle.h"
50 #include "AliAODCaloTrigger.h"
51 #include "AliEMCALGeometry.h"
52 #include "AliVCaloCells.h"
53 #include "AliClusterContainer.h"
54 #include "AliParticleContainer.h"
55 #include "AliEmcalTriggerPatchInfoAP.h"
56 #include "AliAODHeader.h"
57 #include "AliPicoTrack.h"
58 
60 
61 using std::cout;
62 using std::endl;
63 
65 
66 //________________________________________________________________________
69  fDebug(kFALSE), fAttachToEvent(kTRUE),
70  fTriggerClass(""),
71  fMaxPatchEnergy(0), fMaxPatchADCEnergy(0),
72  fTriggerType(1), //-1),
73  fNFastOR(16),
74  fMainTrigCat(kTriggerLevel1Jet), // options: kTriggerLevel0, kTriggerLevel1Jet, kTriggerLevel1Gamma, kTriggerRecalcJet, kTriggerRecalGamma
75  //fMainTrigCat(kTriggerRecalcJet), // Recalculated max trigger patch; does not need to be above trigger threshold
76  //fMainTrigCat(kTriggerRecalcGamma),// Recalculated max trigger patch; does not need to be above trigger threshold
77  fTriggerCategory(kTriggerRecalcGamma),
78  fMainTrigSimple(kFALSE), // (kTRUE)
79  fPatchECut(10.0),
80  fTrkBias(0), fClusBias(0),
81  doComments(0), fUseALLrecalcPatches(0), // defaults to max patch only
82  fClusterTriggeredEventname("CLUSTERthatTriggeredEvent"),
83  fMaxPatch(0),
84  fMainPatchType(kManual), // (kEmcalJet)
85  fhNEvents(0),
86  fhTriggerbit(0),
87  fh3PtEtaPhiTracks(0), fh3PtEtaPhiTracksOnEmcal(0), fh3PtEtaPhiTracksToProp(0), fh3PtEtaPhiTracksProp(0), fh3PtEtaPhiTracksNoProp(0),
88  fh3EEtaPhiCluster(0),
89  fh3PatchEnergyEtaPhiCenterJ1(0), fh3PatchEnergyEtaPhiCenterJ2(0), fh3PatchEnergyEtaPhiCenterJ1J2(0),
90  fh3PatchADCEnergyEtaPhiCenterJ1(0), fh3PatchADCEnergyEtaPhiCenterJ2(0), fh3PatchADCEnergyEtaPhiCenterJ1J2(0),
91  fh3PatchEnergyEtaPhiCenterG1(0), fh3PatchEnergyEtaPhiCenterG2(0), fh3PatchEnergyEtaPhiCenterG1G2(0),
92  fh3PatchADCEnergyEtaPhiCenterG1(0), fh3PatchADCEnergyEtaPhiCenterG2(0), fh3PatchADCEnergyEtaPhiCenterG1G2(0),
93  fh3PatchADCEnergyEtaPhiCenterAll(0),
94  fh3EEtaPhiCell(0), fh2ECellVsCent(0), fh2CellEnergyVsTime(0), fh3EClusELeadingCellVsTime(0),
95  fHistClusEnergy(0),
96  fHistEventSelectionQA(0), fhQAinfoAllPatchesCounter(0), fhQAinfoCounter(0), fhQAmaxinfoCounter(0),
97  fhRecalcGammaPatchEnergy(0), fhGammaLowPatchEnergy(0), fhGammaLowSimplePatchEnergy(0),
98  fhRecalcJetPatchEnergy(0), fhJetLowPatchEnergy(0), fhJetLowSimplePatchEnergy(0),
99  fhMainTriggerPatchEnergy(0),
100  fClusterTriggeredEvent(0), fRecalcTriggerPatches(0),
101  fhnPatchMaxClus(0x0), fhnPatchMatch(0x0), fhnPatchMatch2(0x0)
102 {
103  // Default constructor.
104  for(Int_t j=0; j<16; j++) {
105  fHistdPhidEtaPatchCluster[j] = 0;
106  }
107 
108  SetMakeGeneralHistograms(kTRUE);
109 }
110 
111 //________________________________________________________________________
113  AliAnalysisTaskEmcal(name, kTRUE),
114  fDebug(kFALSE), fAttachToEvent(kTRUE),
115  fTriggerClass(""),
116  fMaxPatchEnergy(0), fMaxPatchADCEnergy(0),
117  fTriggerType(1), //-1),
118  fNFastOR(16),
119  fMainTrigCat(kTriggerLevel1Jet), // options: kTriggerLevel0, kTriggerLevel1Jet, kTriggerLevel1Gamma, kTriggerRecalcJet, kTriggerRecalGamma
120  //fMainTrigCat(kTriggerRecalcJet), // Recalculated max trigger patch; does not need to be above trigger threshold
121  //fMainTrigCat(kTriggerRecalcGamma),// Recalculated max trigger patch; does not need to be above trigger threshold
122  fTriggerCategory(kTriggerRecalcGamma),
123  fMainTrigSimple(kFALSE), // kTRUE
124  fPatchECut(10.0),
125  fTrkBias(0), fClusBias(0),
126  doComments(0), fUseALLrecalcPatches(0), // defaults to max patch only
127  fClusterTriggeredEventname("CLUSTERthatTriggeredEvent"),
128  fMaxPatch(0),
129  fMainPatchType(kManual), //kEmcalJet
130  fhNEvents(0),
131  fhTriggerbit(0),
132  fh3PtEtaPhiTracks(0), fh3PtEtaPhiTracksOnEmcal(0), fh3PtEtaPhiTracksToProp(0), fh3PtEtaPhiTracksProp(0), fh3PtEtaPhiTracksNoProp(0),
133  fh3EEtaPhiCluster(0),
134  fh3PatchEnergyEtaPhiCenterJ1(0), fh3PatchEnergyEtaPhiCenterJ2(0), fh3PatchEnergyEtaPhiCenterJ1J2(0),
135  fh3PatchADCEnergyEtaPhiCenterJ1(0), fh3PatchADCEnergyEtaPhiCenterJ2(0), fh3PatchADCEnergyEtaPhiCenterJ1J2(0),
136  fh3PatchEnergyEtaPhiCenterG1(0), fh3PatchEnergyEtaPhiCenterG2(0), fh3PatchEnergyEtaPhiCenterG1G2(0),
137  fh3PatchADCEnergyEtaPhiCenterG1(0), fh3PatchADCEnergyEtaPhiCenterG2(0), fh3PatchADCEnergyEtaPhiCenterG1G2(0),
138  fh3PatchADCEnergyEtaPhiCenterAll(0),
139  fh3EEtaPhiCell(0), fh2ECellVsCent(0), fh2CellEnergyVsTime(0), fh3EClusELeadingCellVsTime(0),
140  fHistClusEnergy(0),
141  fHistEventSelectionQA(0), fhQAinfoAllPatchesCounter(0), fhQAinfoCounter(0), fhQAmaxinfoCounter(0),
142  fhRecalcGammaPatchEnergy(0), fhGammaLowPatchEnergy(0), fhGammaLowSimplePatchEnergy(0),
143  fhRecalcJetPatchEnergy(0), fhJetLowPatchEnergy(0), fhJetLowSimplePatchEnergy(0),
144  fhMainTriggerPatchEnergy(0),
145  fClusterTriggeredEvent(0), fRecalcTriggerPatches(0),
146  fhnPatchMaxClus(0x0), fhnPatchMatch(0x0), fhnPatchMatch2(0x0)
147 {
148  // Standard constructor.
149  for(Int_t j=0; j<16; j++) {
151  }
152 
154 }
155 
156 //________________________________________________________________________
158 {
159  // Destructor.
160 }
161 
162 //_____________________________________________________________________________
165 
166  // Init the analysis
167  if(fClusterTriggeredEventname=="") fClusterTriggeredEventname = Form("fClusterTriggeredEventname_%s", GetName());
168  fClusterTriggeredEvent = new TClonesArray("AliVCluster");
170  fClusterTriggeredEvent->SetOwner(kTRUE);
171 
172  fRecalcTriggerPatches = new TClonesArray("AliEmcalTriggerPatchInfo");
173  fRecalcTriggerPatches->SetName("RecalcTriggerPatches");
174  fRecalcTriggerPatches->SetOwner(kTRUE);
175 
176  // add cluster object (of clustertriggering event) to event if not yet there
177  if(fAttachToEvent) {
178  if (InputEvent()->FindListObject(fClusterTriggeredEventname)) {
179  AliFatal(Form("%s: Container with same name %s already present. Aborting", GetName(), fClusterTriggeredEventname.Data()));
180  } else {
181  InputEvent()->AddObject(fClusterTriggeredEvent);
182  }
183  }
184 }
185 
186 //________________________________________________________________________
188  // Decide if event should be selected for analysis
189  fhNEvents->Fill(3.5);
190 
191  // this section isn't needed for LHC11h
192  if(!fTriggerClass.IsNull()) {
193  //Check if requested trigger was fired
194  TString trigType1 = "J1";
195  TString trigType2 = "J2";
196  if(fTriggerClass.Contains("G")) {
197  trigType1 = "G1";
198  trigType2 = "G2";
199  }
200 
201  // get fired trigger classes
202  TString firedTrigClass = InputEvent()->GetFiredTriggerClasses();
203 
204  if(fTriggerClass.Contains(trigType1.Data()) && fTriggerClass.Contains(trigType2.Data())) { //if events with J1&&J2 are requested
205  if(!firedTrigClass.Contains(trigType1.Data()) || !firedTrigClass.Contains(trigType2.Data()) ) //check if both are fired
206  return kFALSE;
207  } else {
208  if(!firedTrigClass.Contains(fTriggerClass)) return kFALSE;
209  else if(fTriggerClass.Contains(trigType1.Data()) && firedTrigClass.Contains(trigType2.Data())) //if J2 is requested also add triggers which have J1&&J2. Reject if J1 is requested and J2 is fired
210  return kFALSE;
211  }
212  }
213 
214  fhNEvents->Fill(1.5);
215 
216  return kTRUE;
217 }
218 
219 //________________________________________________________________________
221  // Fill trigger patch histos for main trigger
222  if(!fTriggerPatchInfo) {
223  AliFatal(Form("%s: TriggerPatchInfo object %s does not exist. Aborting", GetName(), fClusterTriggeredEventname.Data()));
224  return;
225  }
226 
227  // see if event was selected
228  UInt_t trig = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
229 
231  //if(fMainPatchType == kManual) ExtractMainPatch();
232  // not set up yet for jet patch
233  //else if(fMainPatchType == kEmcalJet) cout<<"kEmcalJet"<<endl; //fMaxPatch = GetMainTriggerPatch(fMainTrigCat,fMainTrigSimple);
234  //AliEmcalTriggerPatchInfo *patch = GetMainTriggerPatch(fMainTrigCat,fMainTrigSimple);
235 
236  fMaxPatchEnergy = 0;
237  fMaxPatchADCEnergy = 0;
238 
239  if(fMaxPatch) {
240  fMaxPatchEnergy = fMaxPatch->GetPatchE();
241  fMaxPatchADCEnergy = fMaxPatch->GetADCAmpGeVRough();
243 
244  // the following don't exist for LHC11h data
245  //Check if requested trigger was fired, relevant for data sets with 2 EMCal trigger thresholds
246  // JET trigger
247  if(fMaxPatch->IsJetLow() && !fMaxPatch->IsJetHigh()) { //main patch only fired low threshold trigger
248  fh3PatchEnergyEtaPhiCenterJ2->Fill(fMaxPatch->GetPatchE(),fMaxPatch->GetEtaGeo(),fMaxPatch->GetPhiGeo());
250  }
251  else if(fMaxPatch->IsJetHigh() && !fMaxPatch->IsJetLow()) { //main patch only fired high threshold trigger - should never happen
252  fh3PatchEnergyEtaPhiCenterJ1->Fill(fMaxPatch->GetPatchE(),fMaxPatch->GetEtaGeo(),fMaxPatch->GetPhiGeo());
254  }
255  else if(fMaxPatch->IsJetHigh() && fMaxPatch->IsJetLow()) { //main patch fired both triggers
256  fh3PatchEnergyEtaPhiCenterJ1J2->Fill(fMaxPatch->GetPatchE(),fMaxPatch->GetEtaGeo(),fMaxPatch->GetPhiGeo());
258  } // JE
259 
260  // GAMMA trigger
261  if(fMaxPatch->IsGammaLow() && !fMaxPatch->IsGammaHigh()) { //main patch only fired low threshold trigger
262  fh3PatchEnergyEtaPhiCenterG2->Fill(fMaxPatch->GetPatchE(),fMaxPatch->GetEtaGeo(),fMaxPatch->GetPhiGeo());
264  }
265  else if(fMaxPatch->IsGammaHigh() && !fMaxPatch->IsGammaLow()) { //main patch only fired high threshold trigger - should never happen
266  fh3PatchEnergyEtaPhiCenterG1->Fill(fMaxPatch->GetPatchE(),fMaxPatch->GetEtaGeo(),fMaxPatch->GetPhiGeo());
268  }
269  else if(fMaxPatch->IsGammaHigh() && fMaxPatch->IsGammaLow()) { //main patch fired both triggers
270  fh3PatchEnergyEtaPhiCenterG1G2->Fill(fMaxPatch->GetPatchE(),fMaxPatch->GetEtaGeo(),fMaxPatch->GetPhiGeo());
272  } // GA
273 
274  // fill max patch counters
276 
277  } // have patch
278 
279 }
280 
281 //_________________________________________________________________________________________
283  //Find main trigger
284  if(!fTriggerPatchInfo) return;
285 
286  // reset array of patches to save
287  fRecalcTriggerPatches->Clear();
288 
289  //number of patches in event
290  Int_t nPatch = fTriggerPatchInfo->GetEntriesFast();
291 
292  //loop over patches to define trigger type of event
293  Int_t nG1 = 0, nG2 = 0, nJ1 = 0, nJ2 = 0, nL0 = 0;
294 
295  // see if event was selected
296  UInt_t trig = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
297 
298  // check the Fired Trigger Classes
299  TString firedTrigClass = InputEvent()->GetFiredTriggerClasses();
300 
301  //extract main trigger patch
302  AliEmcalTriggerPatchInfo *patch;
303  Double_t emax = -1.;
304  for (Int_t iPatch = 0, patchacc = 0; iPatch < nPatch; iPatch++) {
305  patch = (AliEmcalTriggerPatchInfo*)fTriggerPatchInfo->At( iPatch );
306  if (!patch) continue;
307 
308  // count trigger types
309  if (patch->IsGammaHigh()) nG1++;
310  if (patch->IsGammaLow()) nG2++;
311  if (patch->IsJetHigh()) nJ1++;
312  if (patch->IsJetLow()) nJ2++;
313  if (patch->IsLevel0()) nL0++;
314 
315  // fill Energy spectra of recalculated Jet and GA patches
316  if(patch->IsRecalcGamma()) { fhRecalcGammaPatchEnergy->Fill(patch->GetPatchE()); }
317  if(patch->IsGammaLow()) { fhGammaLowPatchEnergy->Fill(patch->GetPatchE()); }
318  if(patch->IsGammaLowSimple()) { fhGammaLowSimplePatchEnergy->Fill(patch->GetPatchE()); }
319  if(patch->IsRecalcJet()) { fhRecalcJetPatchEnergy->Fill(patch->GetPatchE()); }
320  if(patch->IsJetLow()) { fhJetLowPatchEnergy->Fill(patch->GetPatchE()); }
321  if(patch->IsJetLowSimple()) { fhJetLowSimplePatchEnergy->Fill(patch->GetPatchE()); }
322  if(patch->IsMainTrigger()) { fhMainTriggerPatchEnergy->Fill(patch->GetPatchE()); }
323 
324  // fill QA counter histo for all 'trig class' patches
326 
327  // make sure trigger "fTriggerClass" actually was fired in event
328  if(!firedTrigClass.Contains(fTriggerClass)) continue;
329 
330  // check that we have a recalculated (OFFLINE) trigger patch of type fTriggerCategory
332  if(!patch->IsRecalcGamma()) continue;
333  //if(doComments) cout<<Form("#Patch = %i, PatchE = %f", iPatch, patch->GetPatchE())<<endl;
334  } else if (fTriggerCategory == kTriggerRecalcJet) {
335  if(!patch->IsRecalcJet()) continue;
336  }
337 
338  // method for filling collection output array of 'saved' recalculated patches
339  (*fRecalcTriggerPatches)[patchacc] = patch;
340  ++patchacc;
341 
342  if(doComments) {
343  cout<<"Have a recalculated patch: "<<endl;
344  cout<<Form("Cent = %f, #Patch = %i, #Acc = %i, PatchE = %f, PhiCM = %f, EtaCM = %f", fCent, iPatch, patchacc, patch->GetPatchE(), patch->GetPhiCM(), patch->GetEtaCM())<<endl;
345 
346  }
347 
348  // fill QA counter histo for Recalculated 'trig class' patches
349  FillTriggerPatchQA(fhQAinfoCounter, trig, patch);
350 
351  // find max patch energy
352  if(patch->GetPatchE()>emax) {
353  fMaxPatch = patch;
354  emax = patch->GetPatchE();
355  } // max patch
356  } // loop over patches
357 
358  // check on patch Energy
359  if(firedTrigClass.Contains(fTriggerClass) && fMaxPatch && fMaxPatch->GetPatchE() > fPatchECut) {
360  // get cluster container and find leading cluster
362  if(!clusContp) {
363  AliError(Form("ERROR: Cluster container doesn't exist\n"));
364  return;
365  }
366 
367  AliVCluster* leadclus = clusContp->GetLeadingCluster();
368  if(!leadclus) return;
369 
370  // initialize variables and get leading cluster parameters
371  double leadclusEta = 0, leadclusPhi = 0, leadclusE = 0;
372  TLorentzVector clusvect;
373  leadclus->GetMomentum(clusvect, const_cast<Double_t*>(fVertex));
374  leadclusEta = clusvect.Eta();
375  leadclusPhi = clusvect.Phi();
376  leadclusE = leadclus->E();
377 
378  // get patch variables
379  double fMaxPatchPhiCM = fMaxPatch->GetPhiCM();
380  double fMaxPatchPhiGeo = fMaxPatch->GetPhiGeo();
381  double fMaxPatchEtaCM = fMaxPatch->GetEtaCM();
382  double fMaxPatchEtaGeo = fMaxPatch->GetEtaGeo();
383  double fMaxPatchPhiMin = fMaxPatch->GetPhiMin();
384  double fMaxPatchPhiMax = fMaxPatch->GetPhiMax();
385  double fMaxPatchEtaMin = fMaxPatch->GetEtaMin();
386  double fMaxPatchEtaMax = fMaxPatch->GetEtaMax();
387  Int_t nTrigBit = fMaxPatch->GetTriggerBits();
388 
389  // positional variables
390  double dEtaGeo = 1.0*TMath::Abs(leadclusEta - fMaxPatchEtaGeo);
391  double dEtaCM = 1.0*TMath::Abs(leadclusEta - fMaxPatchEtaCM);
392  double dPhiGeo = 1.0*TMath::Abs(leadclusPhi - fMaxPatchPhiGeo);
393  double dPhiCM = 1.0*TMath::Abs(leadclusPhi - fMaxPatchPhiCM);
394  double maxPatchE = fMaxPatch->GetPatchE();
395  double maxPatchADC = fMaxPatch->GetADCAmpGeVRough();
396 
397  // patch summary (meeting energy cut requirement)
398 /*
399  if(doComments) {
400  cout<<endl<<"Patch summary: "<<endl;
401  cout<<Form("Number of patches = %d, Max Patch Energy = %f GeV, MAXClusterE = %f, Phi = %f, Eta = %f", nPatch, fMaxPatch->GetPatchE(), leadclus->E(), leadclusPhi, leadclusEta)<<endl;
402  cout<<Form("CM in Phi = %f, in Eta = %f, Geo Center in Phi = %f, in Eta = %f, TriggerBits = %d", fMaxPatchPhiCM, fMaxPatchEtaCM, fMaxPatchPhiGeo, fMaxPatchEtaGeo, nTrigBit)<<endl;
403  cout<<Form("phi min = %f, phi max = %f, eta min = %f, eta max = %f", fMaxPatchPhiMin, fMaxPatchPhiMax, fMaxPatchEtaMin, fMaxPatchEtaMax)<<endl;
404  }
405 */
406 
407  Double_t fill[7] = {dEtaGeo, dEtaCM, dPhiGeo, dPhiCM, maxPatchADC, maxPatchE, leadclusE};
408  fhnPatchMaxClus->Fill(fill);
409 
410  } // patch energy cut
411 
412 // cout<<Form("Jet: low: %d, high: %d," ,nJ2, nJ1)<<" ";//<<endl;
413 // cout<<Form("Gamma: low: %d, high: %d," ,nG2, nG1)<<" ";//<<endl;
414 // cout<<Form("L0: %d", nL0)<<endl;
415 // cout<<Form("Max Patch Energy: %f GeV", fMaxPatch->GetPatchE())<<endl;
416 }
417 
418 //________________________________________________________________________
420 {
421  // Create user output.
423 
424  Bool_t oldStatus = TH1::AddDirectoryStatus();
425  TH1::AddDirectory(kFALSE);
426 
427  fhNEvents = new TH1F("fhNEvents","fhNEvents;selection;N_{evt}",5,0,5);
428  fOutput->Add(fhNEvents);
429 
430  fhTriggerbit = new TProfile("fhTriggerbit","fhTriggerbit;;TriggerBit",1,0,1);
431  fOutput->Add(fhTriggerbit);
432 
433  Int_t fgkNCentBins = 21;
434  Float_t kMinCent = 0.;
435  Float_t kMaxCent = 105.;
436  Double_t *binsCent = new Double_t[fgkNCentBins+1];
437  for(Int_t i=0; i<=fgkNCentBins; i++) binsCent[i]=(Double_t)kMinCent + (kMaxCent-kMinCent)/fgkNCentBins*(Double_t)i ;
438  binsCent[fgkNCentBins-1] = 100.5;
439  binsCent[fgkNCentBins] = 101.5;
440 
441  Int_t fgkNdEPBins = 18*8;
442  Float_t kMindEP = 0.;
443  Float_t kMaxdEP = 1.*TMath::Pi()/2.;
444  Double_t *binsdEP = new Double_t[fgkNdEPBins+1];
445  for(Int_t i=0; i<=fgkNdEPBins; i++) binsdEP[i]=(Double_t)kMindEP + (kMaxdEP-kMindEP)/fgkNdEPBins*(Double_t)i ;
446 
447  Int_t fgkNPtBins = 200;
448  Float_t kMinPt = -50.;
449  Float_t kMaxPt = 150.;
450  Double_t *binsPt = new Double_t[fgkNPtBins+1];
451  for(Int_t i=0; i<=fgkNPtBins; i++) binsPt[i]=(Double_t)kMinPt + (kMaxPt-kMinPt)/fgkNPtBins*(Double_t)i ;
452 
453  Int_t fgkNPhiBins = 18*8;
454  Float_t kMinPhi = 0.;
455  Float_t kMaxPhi = 2.*TMath::Pi();
456  Double_t *binsPhi = new Double_t[fgkNPhiBins+1];
457  for(Int_t i=0; i<=fgkNPhiBins; i++) binsPhi[i]=(Double_t)kMinPhi + (kMaxPhi-kMinPhi)/fgkNPhiBins*(Double_t)i ;
458 
459  Int_t fgkNEtaBins = 100;
460  Float_t fgkEtaMin = -1.;
461  Float_t fgkEtaMax = 1.;
462  Double_t *binsEta=new Double_t[fgkNEtaBins+1];
463  for(Int_t i=0; i<=fgkNEtaBins; i++) binsEta[i]=(Double_t)fgkEtaMin + (fgkEtaMax-fgkEtaMin)/fgkNEtaBins*(Double_t)i ;
464 
465  Int_t fgkNConstBins = 100;
466  Float_t kMinConst = 0.;
467  Float_t kMaxConst = 100.;
468  Double_t *binsConst = new Double_t[fgkNConstBins+1];
469  for(Int_t i=0; i<=fgkNConstBins; i++) binsConst[i]=(Double_t)kMinConst + (kMaxConst-kMinConst)/fgkNConstBins*(Double_t)i ;
470 
471  Int_t fgkNTimeBins = 100;
472  Float_t kMinTime = -200.;
473  Float_t kMaxTime = 200;
474  Double_t *binsTime = new Double_t[fgkNTimeBins+1];
475  for(Int_t i=0; i<=fgkNTimeBins; i++) binsTime[i]=(Double_t)kMinTime + (kMaxTime-kMinTime)/fgkNTimeBins*(Double_t)i ;
476 
477  Int_t fgkNVZEROBins = 100;
478  Float_t kMinVZERO = 0.;
479  Float_t kMaxVZERO = 25000;
480  Double_t *binsVZERO = new Double_t[fgkNVZEROBins+1];
481  for(Int_t i=0; i<=fgkNVZEROBins; i++) binsVZERO[i]=(Double_t)kMinVZERO + (kMaxVZERO-kMinVZERO)/fgkNVZEROBins*(Double_t)i ;
482 
483  Double_t enBinEdges[3][2];
484  enBinEdges[0][0] = 1.; //10 bins
485  enBinEdges[0][1] = 0.1;
486  enBinEdges[1][0] = 5.; //8 bins
487  enBinEdges[1][1] = 0.5;
488  enBinEdges[2][0] = 100.;//95 bins
489  enBinEdges[2][1] = 1.;
490 
491  const Float_t enmin1 = 0;
492  const Float_t enmax1 = enBinEdges[0][0];
493  const Float_t enmin2 = enmax1 ;
494  const Float_t enmax2 = enBinEdges[1][0];
495  const Float_t enmin3 = enmax2 ;
496  const Float_t enmax3 = enBinEdges[2][0];//fgkEnMax;
497  const Int_t nbin11 = (int)((enmax1-enmin1)/enBinEdges[0][1]);
498  const Int_t nbin12 = (int)((enmax2-enmin2)/enBinEdges[1][1])+nbin11;
499  const Int_t nbin13 = (int)((enmax3-enmin3)/enBinEdges[2][1])+nbin12;
500 
501  Int_t fgkNEnBins=nbin13;
502  Double_t *binsEn=new Double_t[fgkNEnBins+1];
503  for(Int_t i=0; i<=fgkNEnBins; i++) {
504  if(i<=nbin11) binsEn[i]=(Double_t)enmin1 + (enmax1-enmin1)/nbin11*(Double_t)i ;
505  if(i<=nbin12 && i>nbin11) binsEn[i]=(Double_t)enmin2 + (enmax2-enmin2)/(nbin12-nbin11)*((Double_t)i-(Double_t)nbin11) ;
506  if(i<=nbin13 && i>nbin12) binsEn[i]=(Double_t)enmin3 + (enmax3-enmin3)/(nbin13-nbin12)*((Double_t)i-(Double_t)nbin12) ;
507  }
508 
509  fh3PtEtaPhiTracks = new TH3F("fh3PtEtaPhiTracks","fh3PtEtaPhiTracks;#it{p}_{T}^{track}_{vtx};#eta_{vtx};#varphi_{vtx}",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
511 
512  fh3PtEtaPhiTracksOnEmcal = new TH3F("fh3PtEtaPhiTracksOnEmcal","fh3PtEtaPhiTracksOnEmcal;#it{p}_{T}^{track}_{emc};#eta_{emc};#varphi_{emc}",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
514 
515  fh3PtEtaPhiTracksToProp = new TH3F("fh3PtEtaPhiTracksToProp","fh3PtEtaPhiTracksToProp;#it{p}_{T}^{track}_{vtx};#eta_{vtx};#varphi_{vtx}",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
517 
518  fh3PtEtaPhiTracksProp = new TH3F("fh3PtEtaPhiTracksProp","fh3PtEtaPhiTracksProp;#it{p}_{T}^{track}_{vtx};#eta_{vtx};#varphi_{vtx}",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
520 
521  fh3PtEtaPhiTracksNoProp = new TH3F("fh3PtEtaPhiTracksNoProp","fh3PtEtaPhiTracksNoProp;#it{p}_{T}^{track}_{vtx};#eta_{vtx};#varphi_{vtx}",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
523 
524  fh3EEtaPhiCluster = new TH3F("fh3EEtaPhiCluster","fh3EEtaPhiCluster;E_{clus};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
526 
527  fh3PatchEnergyEtaPhiCenterJ1 = new TH3F("fh3PatchEnergyEtaPhiCenterJ1","fh3PatchEnergyEtaPhiCenterJ1;E_{patch};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
529 
530  fh3PatchEnergyEtaPhiCenterJ2 = new TH3F("fh3PatchEnergyEtaPhiCenterJ2","fh3PatchEnergyEtaPhiCenterJ2;E_{patch};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
532 
533  fh3PatchEnergyEtaPhiCenterJ1J2 = new TH3F("fh3PatchEnergyEtaPhiCenterJ1J2","fh3PatchEnergyEtaPhiCenterJ1J2;E_{patch};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
535 
536  fh3PatchADCEnergyEtaPhiCenterJ1 = new TH3F("fh3PatchADCEnergyEtaPhiCenterJ1","fh3PatchADCEnergyEtaPhiCenterJ1;E_{ADC,patch};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
538 
539  fh3PatchADCEnergyEtaPhiCenterJ2 = new TH3F("fh3PatchADCEnergyEtaPhiCenterJ2","fh3PatchADCEnergyEtaPhiCenterJ2;E_{ADC,patch};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
541 
542  fh3PatchADCEnergyEtaPhiCenterJ1J2 = new TH3F("fh3PatchADCEnergyEtaPhiCenterJ1J2","fh3PatchADCEnergyEtaPhiCenterJ1J2;E_{ADC,patch};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
544 
545  fh3PatchEnergyEtaPhiCenterG1 = new TH3F("fh3PatchEnergyEtaPhiCenterG1","fh3PatchEnergyEtaPhiCenterG1;E_{patch};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
547 
548  fh3PatchEnergyEtaPhiCenterG2 = new TH3F("fh3PatchEnergyEtaPhiCenterG2","fh3PatchEnergyEtaPhiCenterG2;E_{patch};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
550 
551  fh3PatchEnergyEtaPhiCenterG1G2 = new TH3F("fh3PatchEnergyEtaPhiCenterG1G2","fh3PatchEnergyEtaPhiCenterG1G2;E_{patch};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
553 
554  fh3PatchADCEnergyEtaPhiCenterG1 = new TH3F("fh3PatchADCEnergyEtaPhiCenterG1","fh3PatchADCEnergyEtaPhiCenterG1;E_{ADC,patch};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
556 
557  fh3PatchADCEnergyEtaPhiCenterG2 = new TH3F("fh3PatchADCEnergyEtaPhiCenterG2","fh3PatchADCEnergyEtaPhiCenterG2;E_{ADC,patch};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
559 
560  fh3PatchADCEnergyEtaPhiCenterG1G2 = new TH3F("fh3PatchADCEnergyEtaPhiCenterG1G2","fh3PatchADCEnergyEtaPhiCenterG1G2;E_{ADC,patch};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
562 
563  fh3PatchADCEnergyEtaPhiCenterAll = new TH3F("fh3PatchADCEnergyEtaPhiCenterAll","fh3PatchADCEnergyEtaPhiCenterAll;E_{ADC,patch};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
565 
566  fh3EEtaPhiCell = new TH3F("fh3EEtaPhiCell","fh3EEtaPhiCell;E_{cell};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
567  fOutput->Add(fh3EEtaPhiCell);
568 
569  fh2ECellVsCent = new TH2F("fh2ECellVsCent","fh2ECellVsCent;centrality;E_{cell}",101,-1,100,500,0.,5.);
570  fOutput->Add(fh2ECellVsCent);
571 
572  fh2CellEnergyVsTime = new TH2F("fh2CellEnergyVsTime","fh2CellEnergyVsTime;E_{cell};time",fgkNEnBins,binsEn,fgkNTimeBins,binsTime);
574 
575  fh3EClusELeadingCellVsTime = new TH3F("fh3EClusELeadingCellVsTime","fh3EClusELeadingCellVsTime;E_{cluster};E_{leading cell};time_{leading cell}",fgkNEnBins,binsEn,fgkNEnBins,binsEn,fgkNTimeBins,binsTime);
577 
578  fhQAinfoAllPatchesCounter = new TH1F("fhQAinfoAllPatchesCounter", "QA trigger info counters for all patches", 20, 0.5, 20.5);
580 
581  fhQAinfoCounter = new TH1F("fhQAinfoCounter", "QA trigger info counters", 20, 0.5, 20.5);
582  fOutput->Add(fhQAinfoCounter);
583 
584  fhQAmaxinfoCounter = new TH1F("fhQAmaxinfoCounter", "QA Max patch trigger info counters", 20, 0.5, 20.5);
586 
587  fhRecalcGammaPatchEnergy = new TH1F("fhRecalcGammaPatchEnergy", "Recalculated Gamma Patch Energy", 200, 0, 50); //100
589 
590  fhGammaLowPatchEnergy = new TH1F("fhGammaLowPatchEnergy", "Gamma Low Patch Energy", 200, 0, 50); //100
592 
593  fhGammaLowSimplePatchEnergy = new TH1F("fhGammaLowSimplePatchEnergy", "Gamma Low Simple Patch Energy", 200, 0, 50); //100
595 
596  fhRecalcJetPatchEnergy = new TH1F("fhRecalcJetPatchEnergy", "Recalculated Jet Patch Energy", 200, 0, 100);
598 
599  fhJetLowPatchEnergy = new TH1F("fhJetLowPatchEnergy", "Jet Low Patch Energy", 200, 0, 100);
601 
602  fhJetLowSimplePatchEnergy = new TH1F("fhJetLowSimplePatchEnergy", "Jet Low Simple Patch Energy", 200, 0, 100);
604 
605  fhMainTriggerPatchEnergy = new TH1F("fhMainTriggerPatchEnergy", "Main Trigger Patch Energy", 200, 0, 100);
607 
608  fHistClusEnergy = new TH1F("fHistClusEnergy", "Cluster Energy distribution", 200, 0, 50);
609  fOutput->Add(fHistClusEnergy);
610 
611  for(Int_t j=0; j<16; j++) {
612  fHistdPhidEtaPatchCluster[j] = new TH2F(Form("fHistdPhidEtaPatchCluster_%d",j), "dPhi-dEta distribution between max recalculated Gamma patch and most energetic cluster", 144, 0, 2.016, 144, 0, 2.016);
614  }
615 
616  Int_t nDim=7;
617  Int_t *nbins = new Int_t[nDim];
618  Double_t *xmin = new Double_t[nDim];
619  Double_t *xmax = new Double_t[nDim];
620  for (Int_t i=0; i<nDim; i++){
621  nbins[i]=144;
622  xmin[i]=0;
623  xmax[i]=2.016;
624  }
625 
626  nbins[4]=100; xmax[4]=100;
627  nbins[5]=100; xmax[5]=100.;
628  nbins[6]=100; xmax[6]=100.;
629 
630  fhnPatchMaxClus = new THnSparseF("fhnPatchMaxClus","fhn Patch Max Cluster Distributions", nDim,nbins,xmin,xmax);
631  fhnPatchMaxClus->GetAxis(0)->SetTitle("#Delta#etaGeo"); // 0
632  fhnPatchMaxClus->GetAxis(1)->SetTitle("#Delta#etaCM"); // 1
633  fhnPatchMaxClus->GetAxis(2)->SetTitle("#Delta#phiGeo"); // 2
634  fhnPatchMaxClus->GetAxis(3)->SetTitle("#Delta#phiCM"); // 3
635  fhnPatchMaxClus->GetAxis(4)->SetTitle("Max Patch ADC"); // 4
636  fhnPatchMaxClus->GetAxis(5)->SetTitle("Max Patch Energy"); // 5
637  fhnPatchMaxClus->GetAxis(6)->SetTitle("Leading Cluster Energy"); // 6
638  fOutput->Add(fhnPatchMaxClus);
639 
640  // QA before/after matching
641  Int_t nDim1=6;
642  Int_t *nbins1 = new Int_t[nDim1];
643  Double_t *xmin1 = new Double_t[nDim1];
644  Double_t *xmax1 = new Double_t[nDim1];
645  nbins1[0]=10; xmin1[0]=0.; xmax1[0]=100.;
646  nbins1[1]=200; xmin1[1]=0.; xmax1[1]=50;
647  nbins1[2]=144; xmin1[2]=0.; xmax1[2]=2.016;
648  nbins1[3]=144; xmin1[3]=0.; xmax1[3]=2.016;
649  nbins1[4]=300; xmin1[4]=0.; xmax1[4]=300;
650  nbins1[5]=500; xmin1[5]=0.; xmax1[5]=500;
651 
652  // before cuts to perform match
653  fhnPatchMatch = new THnSparseF("fhnPatchMatch","fhn Patch Match before cuts", nDim1,nbins1,xmin1,xmax1);
654  fhnPatchMatch->GetAxis(0)->SetTitle("Centrality %"); // 0
655  fhnPatchMatch->GetAxis(1)->SetTitle("Cluster Energy"); // 1
656  fhnPatchMatch->GetAxis(2)->SetTitle("#Delta#phi Geo"); // 2
657  fhnPatchMatch->GetAxis(3)->SetTitle("#Delta#eta Geo"); // 3
658  fhnPatchMatch->GetAxis(4)->SetTitle("Max Patch Energy"); // 4
659  fhnPatchMatch->GetAxis(5)->SetTitle("Max Patch ADC"); // 5
660  fOutput->Add(fhnPatchMatch);
661 
662  // after cuts to perform match
663  fhnPatchMatch2 = new THnSparseF("fhnPatchMatch2","fhn Patch Match after cuts", nDim1,nbins1,xmin1,xmax1);
664  fhnPatchMatch2->GetAxis(0)->SetTitle("Centrality %"); // 0
665  fhnPatchMatch2->GetAxis(1)->SetTitle("Cluster Energy"); // 1
666  fhnPatchMatch2->GetAxis(2)->SetTitle("#Delta#phi Geo"); // 2
667  fhnPatchMatch2->GetAxis(3)->SetTitle("#Delta#eta Geo"); // 3
668  fhnPatchMatch2->GetAxis(4)->SetTitle("Max Patch Energy"); // 4
669  fhnPatchMatch2->GetAxis(5)->SetTitle("Max Patch ADC"); // 5
670  fOutput->Add(fhnPatchMatch2);
671 
672  // for cluster matched to patch
673  Int_t nDim2=10;
674  Int_t *nbins2 = new Int_t[nDim2];
675  Double_t *xmin2 = new Double_t[nDim2];
676  Double_t *xmax2 = new Double_t[nDim2];
677  for (Int_t i=0; i<nDim2; i++){
678  nbins2[i]=144;
679  xmin2[i]=0;
680  }
681 
682  nbins2[0]=10; xmax2[0]=100;
683  nbins2[1]=200; xmax2[1]=50.;
684  nbins2[2]=72; xmin2[2]=1.2; xmax2[2]=3.4; //2.0*TMath::Pi();
685  nbins2[3]=56; xmin2[3]=-0.7; xmax2[3]=0.7;
686  nbins2[4]=500; xmax2[4]=500.;
687  nbins2[5]=500; xmax2[5]=500.;
688  nbins2[6]=300; xmax2[6]=300.;
689  nbins2[7]=300; xmax2[7]=300.;
690  nbins2[8]=72; xmin2[8]=1.4; xmax2[9]=3.2;
691  nbins2[9]=56; xmin2[9]=-0.7; xmax2[9]=0.7;
692 
693  //Double_t fill[18] = {fCent, dEPJet, jet->Pt(), jet->Phi(), jet->Eta(), jet->Area(), jet->GetNumberOfTracks(), jet->MaxTrackPt(), jet->GetNumberOfClusters(), maxClusterE, maxClusterPhi, maxClusterEta, kAmplitudeOnline, kAmplitudeOnline, kEnergyOnline, kEnergyOffline, fMaxPatchPhiGeo, fMaxPatchEtaGeo}; ////
694 
695 /*
696  fhnPatchMatchJetLeadClus = new THnSparseF("fhnPatchMatchJetLeadClus","fhn Patch Match to Jet Leading Cluster", nDim2, nbins2,xmin2,xmax2); ////
697  fhnPatchMatchJetLeadClus->GetAxis(0)->SetTitle("Centrality %"); // 0
698  fhnPatchMatchJetLeadClus->GetAxis(1)->SetTitle("Max Cluster Energy constituent of Jet"); // 1
699  fhnPatchMatchJetLeadClus->GetAxis(2)->SetTitle("Cluster #phi"); // 2
700  fhnPatchMatchJetLeadClus->GetAxis(3)->SetTitle("Cluster #eta"); // 3
701  fhnPatchMatchJetLeadClus->GetAxis(4)->SetTitle("Max Patch Amplitude Online"); // 4
702  fhnPatchMatchJetLeadClus->GetAxis(5)->SetTitle("Max Patch Amplitude Offline"); // 5
703  fhnPatchMatchJetLeadClus->GetAxis(6)->SetTitle("Max Patch Energy Online"); // 6
704  fhnPatchMatchJetLeadClus->GetAxis(7)->SetTitle("Max Patch Energy Offline"); // 7
705  fhnPatchMatchJetLeadClus->GetAxis(8)->SetTitle("Max Patch Geometric Center in #phi"); // 8
706  fhnPatchMatchJetLeadClus->GetAxis(9)->SetTitle("Max Patch Geometric Center in #eta"); // 9
707  fOutput->Add(fhnPatchMatchJetLeadClus); ////
708 */
709 
710  // Event Selection QA histo
711  fHistEventSelectionQA = new TH1F("fHistEventSelectionQA", "Trigger Selection Counter", 20, 0.5, 20.5);
713 
714  // =========== Switch on Sumw2 for all histos ===========
715  for (Int_t i=0; i<fOutput->GetEntries(); ++i) {
716  TH1 *h1 = dynamic_cast<TH1*>(fOutput->At(i));
717  if (h1){
718  h1->Sumw2();
719  continue;
720  }
721  TH2 *h2 = dynamic_cast<TH2*>(fOutput->At(i));
722  if (h2){
723  h2->Sumw2();
724  continue;
725  }
726  TH3 *h3 = dynamic_cast<TH3*>(fOutput->At(i));
727  if (h3){
728  h3->Sumw2();
729  continue;
730  }
731  THnSparse *hn = dynamic_cast<THnSparse*>(fOutput->At(i));
732  if(hn)hn->Sumw2();
733  }
734 
735  TH1::AddDirectory(oldStatus);
736 
737  PostData(1, fOutput); // Post data for ALL output slots > 0 here.
738 
739  if(binsCent) delete [] binsCent;
740  if(binsdEP) delete [] binsdEP;
741  if(binsEn) delete [] binsEn;
742  if(binsPt) delete [] binsPt;
743  if(binsPhi) delete [] binsPhi;
744  if(binsEta) delete [] binsEta;
745  if(binsConst) delete [] binsConst;
746  if(binsTime) delete [] binsTime;
747  if(binsVZERO) delete [] binsVZERO;
748 
749 }
750 
751 //________________________________________________________________________
753  // Fill histograms.
754 
755  // check and fill a Event Selection QA histogram for different trigger selections
756  UInt_t trig = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
757 
758  // get fired trigger classes
759  TString firedTrigClass = InputEvent()->GetFiredTriggerClasses();
760 
761  // fill Event Trigger QA
763 
764  // create pointer to list of input event
765  TList *list = InputEvent()->GetList();
766  if(!list) {
767  AliError(Form("ERROR: list not attached\n"));
768  return kTRUE;
769  }
770 
771  // reset collection at start of event
772  fClusterTriggeredEvent->Clear();
773 
774  //Tracks
776  if (partCont) {
777  AliVTrack *track = dynamic_cast<AliVTrack*>(partCont->GetNextAcceptParticle(0));
778  while(track) {
779  Double_t trkphi = track->Phi()*TMath::RadToDeg();
780  fh3PtEtaPhiTracks->Fill(track->Pt(),track->Eta(),track->Phi());
781 
782  //Select tracks which should be propagated
783  if(track->Pt()>=0.350) {
784  if (TMath::Abs(track->Eta())<=0.9 && trkphi > 10 && trkphi < 250) {
785  fh3PtEtaPhiTracksOnEmcal->Fill(track->GetTrackPtOnEMCal(),track->GetTrackEtaOnEMCal(),track->GetTrackPhiOnEMCal());
786  fh3PtEtaPhiTracksToProp->Fill(track->Pt(),track->Eta(),track->Phi());
787  if(track->GetTrackPtOnEMCal()>=0) fh3PtEtaPhiTracksProp->Fill(track->Pt(),track->Eta(),track->Phi());
788  else
789  fh3PtEtaPhiTracksNoProp->Fill(track->Pt(),track->Eta(),track->Phi());
790  } // acceptance cut
791  } // track pt cut
792  track = dynamic_cast<AliPicoTrack*>(partCont->GetNextAcceptParticle());
793  } // track exist
794  } // particle container
795 
796  //Clusters - get cluster collection
797  TClonesArray *clusters = 0x0;
798  clusters = dynamic_cast<TClonesArray*>(list->FindObject("EmcCaloClusters"));
799  if (!clusters) {
800  AliError(Form("Pointer to clusters %s == 0", "EmcCaloClusters"));
801  return kTRUE;
802  } // verify existence of clusters
803 
804  // loop over clusters
805  const Int_t Nclusters = clusters->GetEntries();
806  for (Int_t iclus = 0; iclus < Nclusters; iclus++){
807  AliVCluster* clus = static_cast<AliVCluster*>(clusters->At(iclus));
808  if(!clus){
809  AliError(Form("Couldn't get AliVCluster %d\n", iclus));
810  continue;
811  }
812 
813  // is cluster in EMCal?
814  if (!clus->IsEMCAL()) {
815  AliDebug(2,Form("%s: Cluster is not emcal",GetName()));
816  continue;
817  }
818 
819  // get some info on cluster and fill histo
820  TLorentzVector lp;
821  clus->GetMomentum(lp, const_cast<Double_t*>(fVertex));
822  fHistClusEnergy->Fill(lp.E());
823  }
824 
825  //Clusters
827  if (clusCont) {
828  Int_t nclusters = clusCont->GetNClusters();
829  for (Int_t ic = 0, clusacc = 0; ic < nclusters; ic++) {
830  AliVCluster *cluster = static_cast<AliVCluster*>(clusCont->GetCluster(ic));
831  if (!cluster) {
832  AliDebug(2,Form("Could not receive cluster %d", ic));
833  continue;
834  }
835 
836  // is cluster in EMCal?
837  if (!cluster->IsEMCAL()) {
838  AliDebug(2,Form("%s: Cluster is not emcal",GetName()));
839  continue;
840  }
841 
842  TLorentzVector lp;
843  cluster->GetMomentum(lp, const_cast<Double_t*>(fVertex));
844  fh3EEtaPhiCluster->Fill(lp.E(),lp.Eta(),lp.Phi());
845  if(fCaloCells) {
846  Double_t leadCellE = GetEnergyLeadingCell(cluster);
847  Double_t leadCellT = cluster->GetTOF();
848  fh3EClusELeadingCellVsTime->Fill(lp.E(),leadCellE,leadCellT*1e9);
849  } // if calo cells exist
850 
851  // get cluster observables
852  Double_t ClusterEta = 0., ClusterPhi = 0., ClusterE = 0.;
853  ClusterEta = lp.Eta();
854  ClusterPhi = lp.Phi();
855  ClusterE = cluster->E();
856 
857  // check that trigger class was fired and require we have a cluster meeting energy cut - Matches to MAX Patch
858  if(ClusterE > fClusBias && fMaxPatch && firedTrigClass.Contains(fTriggerClass) && (!fUseALLrecalcPatches)) {
859  //cout<<Form("#Clus in container = %i, NACCcluster = %i, LeadClusE = %f, isEMCal? = %s", clusCont->GetNClusters(), clusCont->GetNAcceptedClusters(), leadclus->E(), leadclus->IsEMCAL()? "true":"false")<<endl;
860 
861  // get max patch location
862  double fMaxPatchPhiGeo = fMaxPatch->GetPhiGeo();
863  double fMaxPatchEtaGeo = fMaxPatch->GetEtaGeo();
864  double dPhiPatchLeadCl = 1.0*TMath::Abs(fMaxPatchPhiGeo - ClusterPhi);
865  double dEtaPatchLeadCl = 1.0*TMath::Abs(fMaxPatchEtaGeo - ClusterEta);
866 
867  // get offline/online Energy and ADC count
868  double kAmplitudeOnline = fMaxPatch->GetADCAmp();
869  double kAmplitudeOffline = fMaxPatch->GetADCOfflineAmp();
870  double kEnergyOnline = fMaxPatch->GetADCAmpGeVRough();
871  double kEnergyOffline = fMaxPatch->GetPatchE();
872 
873  // get patch variables
874  double etamin = TMath::Min(fMaxPatch->GetEtaMin(), fMaxPatch->GetEtaMax());
875  double etamax = TMath::Max(fMaxPatch->GetEtaMin(), fMaxPatch->GetEtaMax());
876  double phimin = TMath::Min(fMaxPatch->GetPhiMin(), fMaxPatch->GetPhiMax());
877  double phimax = TMath::Max(fMaxPatch->GetPhiMin(), fMaxPatch->GetPhiMax());
878 
879  for(int maxbinE = 0; maxbinE<16; maxbinE++) { if(ClusterE > maxbinE) fHistdPhidEtaPatchCluster[maxbinE]->Fill(dPhiPatchLeadCl, dEtaPatchLeadCl); }
880 
881  // fill sparse array before and after match
882  Double_t fillarr[6] = {fCent, ClusterE, dPhiPatchLeadCl, dEtaPatchLeadCl, kEnergyOffline, kAmplitudeOnline};
883  fhnPatchMatch->Fill(fillarr);
884  if(ClusterEta > etamin && ClusterEta < etamax && ClusterPhi > phimin && ClusterPhi < phimax) fhnPatchMatch2->Fill(fillarr);
885 
886  // patch meeting offline energy cut
887  if(fMaxPatch->GetPatchE() > fPatchECut) {
888  // look to geometrically match patch to leading cluster of jet
889  if(ClusterEta > etamin && ClusterEta < etamax && ClusterPhi > phimin && ClusterPhi < phimax){
890  if(doComments) {
891  cout<<"*********************************************"<<endl;
892  cout<<"Proper match (cluster to fired max patch): "<<endl;
893  cout<<Form("MaxClusterE = %f, Phi = %f, Eta = %f", ClusterE, ClusterPhi, ClusterEta)<<endl;
894  cout<<"*********************************************"<<endl;
895  } // do comments
896 
897  // fill sparse for match
898  //Double_t fill[10] = {fCent, ClusterE, ClusterPhi, ClusterEta, kAmplitudeOnline, kAmplitudeOffline, kEnergyOnline, kEnergyOffline, fMaxPatchPhiGeo, fMaxPatchEtaGeo};
899  //fhnPatchMatchJetLeadClus->Fill(fill);
900 
901  // method for filling collection output array of 'saved' clusters
902  (*fClusterTriggeredEvent)[clusacc] = cluster;
903  ++clusacc;
904 
905  } // MATCH!
906  } // patch > Ecut GeV
907  } // cluster energy > cut
908 
909 
910  // switch for recalculated patches
912  // apply cluster energy cut, make sure event fired trigger and require recalculated trigger patch object
913  if(ClusterE > fClusBias && firedTrigClass.Contains(fTriggerClass) && fRecalcTriggerPatches) {
914  // number of recalculated patches in event
915  Int_t nPatch = fRecalcTriggerPatches->GetEntriesFast();
916 
917  AliEmcalTriggerPatchInfo *patch;
918  for(Int_t iPatch = 0; iPatch < nPatch; iPatch++) {
919  patch = (AliEmcalTriggerPatchInfo*)fRecalcTriggerPatches->At(iPatch);
920  if(!patch) continue;
921 
922  // get max patch location
923  double fPatchPhiGeo = patch->GetPhiGeo();
924  double fPatchEtaGeo = patch->GetEtaGeo();
925  double dPhiPatchCl = 1.0*TMath::Abs(fPatchPhiGeo - ClusterPhi);
926  double dEtaPatchCl = 1.0*TMath::Abs(fPatchEtaGeo - ClusterEta);
927 
928  // get offline/online Energy and ADC count
929  double kAmplitudeOnline = patch->GetADCAmp();
930  double kAmplitudeOffline = patch->GetADCOfflineAmp();
931  double kEnergyOnline = patch->GetADCAmpGeVRough();
932  double kEnergyOffline = patch->GetPatchE();
933 
934  // get patch variables
935  double etamin = TMath::Min(patch->GetEtaMin(), patch->GetEtaMax());
936  double etamax = TMath::Max(patch->GetEtaMin(), patch->GetEtaMax());
937  double phimin = TMath::Min(patch->GetPhiMin(), patch->GetPhiMax());
938  double phimax = TMath::Max(patch->GetPhiMin(), patch->GetPhiMax());
939 
940  for(int maxbinE = 0; maxbinE<16; maxbinE++) { if(ClusterE > maxbinE) fHistdPhidEtaPatchCluster[maxbinE]->Fill(dPhiPatchCl, dEtaPatchCl); }
941 
942  // fill sparse array before and after match
943  Double_t fillarr[6] = {fCent, ClusterE, dPhiPatchCl, dEtaPatchCl, kEnergyOffline, kAmplitudeOnline};
944  fhnPatchMatch->Fill(fillarr);
945  // matched successfully
946  if(ClusterEta > etamin && ClusterEta < etamax && ClusterPhi > phimin && ClusterPhi < phimax) fhnPatchMatch2->Fill(fillarr);
947 
948  // patch meeting offline energy cut
949  if(patch->GetPatchE() > fPatchECut) {
950  // look to geometrically match patch to leading cluster of jet
951  if(ClusterEta > etamin && ClusterEta < etamax && ClusterPhi > phimin && ClusterPhi < phimax){
952  if(doComments) {
953  cout<<"*********************************************"<<endl;
954  cout<<"Proper match (cluster to fired max patch): ";
955  cout<<Form("Centrality = %f", fCent)<<endl;
956  cout<<Form("PatchE = %f, PhiMin = %f, PhiMax = %f, EtaMin = %f, EtaMax = %f, Patch# = %i", kEnergyOffline, phimin, phimax, etamin, etamax, iPatch)<<endl;
957  cout<<Form("ClusterE = %f, Phi = %f, Eta = %f", ClusterE, ClusterPhi, ClusterEta)<<endl;
958  cout<<"*********************************************"<<endl;
959  } // do comments
960 
961  // fill sparse for match
962  //Double_t fill[10] = {fCent, ClusterE, ClusterPhi, ClusterEta, kAmplitudeOnline, kAmplitudeOffline, kEnergyOnline, kEnergyOffline, fMaxPatchPhiGeo, fMaxPatchEtaGeo};
963  //fhnPatchMatchJetLeadClus->Fill(fill);
964 
965  // method for filling collection output array of 'saved' clusters
966  (*fClusterTriggeredEvent)[clusacc] = cluster;
967  ++clusacc;
968 
969  } // MATCH!
970  } // patch energy cut (should not really need)
971  } // recalculated patch loop
972  } // cluster energy cut
973  } // recalulated patch switch
974 
976  } // cluster loop
977  } // if cluster container exist
978 
979  //Get VZERO amplitude
980  Float_t VZEROAmp = InputEvent()->GetVZEROData()->GetTriggerChargeA() + InputEvent()->GetVZEROData()->GetTriggerChargeC();
981 
982  //Cells - some QA plots
983  if(fCaloCells) {
984  const Short_t nCells = fCaloCells->GetNumberOfCells();
985 
986  for(Int_t iCell=0; iCell<nCells; ++iCell) {
987  Short_t cellId = fCaloCells->GetCellNumber(iCell);
988  Double_t cellE = fCaloCells->GetCellAmplitude(cellId);
989  Double_t cellT = fCaloCells->GetCellTime(cellId);
990  TVector3 pos;
991  fGeom->GetGlobal(cellId, pos);
992  TLorentzVector lv(pos,cellE);
993  Double_t cellEta = lv.Eta();
994  Double_t cellPhi = lv.Phi();
995  if(cellPhi<0.) cellPhi+=TMath::TwoPi();
996  if(cellPhi>TMath::TwoPi()) cellPhi-=TMath::TwoPi();
997 
998  AliDebug(2,Form("cell energy = %f time = %f",cellE,cellT*1e9));
999  fh2CellEnergyVsTime->Fill(cellE,cellT*1e9);
1000  fh3EEtaPhiCell->Fill(cellE,cellEta,cellPhi);
1001  fh2ECellVsCent->Fill(fCent,cellE);
1002  }
1003  }
1004 
1005  return kTRUE;
1006 }
1007 
1008 //________________________________________________________________________
1010  // Run analysis code here, if needed. It will be executed before FillHistograms().
1011  fhTriggerbit->Fill(0.5,GetCollisionCandidates());
1012 
1013  // just in case, set the geometry scheme
1014  fGeom = AliEMCALGeometry::GetInstance("EMCAL_COMPLETEV1");
1015 
1016  //Check if event is selected (vertex & pile-up)
1017  //if(!SelectEvent()) return kFALSE;
1018 
1019  // when we have the patch object to match, peform analysis
1021 
1022  return kTRUE; // If return kFALSE FillHistogram() will NOT be executed.
1023 }
1024 
1025 //_______________________________________________________________________
1027  // Called once at the end of the analysis.
1028 }
1029 
1030 //________________________________________________________________________
1032  //Get energy of leading cell in cluster
1033  if(!fCaloCells) return -1;
1034 
1035  Double_t emax = -1.;
1036  Int_t iCellAbsIdMax = -1;
1037  Int_t nCells = clus->GetNCells();
1038  for(Int_t i = 0; i<nCells; i++) {
1039  Int_t absId = clus->GetCellAbsId(i);
1040  Double_t cellE = fCaloCells->GetCellAmplitude(absId);
1041  if(cellE>emax) {
1042  emax = cellE;
1043  iCellAbsIdMax = absId;
1044  }
1045  }
1046  return iCellAbsIdMax;
1047 }
1048 
1049 //________________________________________________________________________
1051  //Get energy of leading cell in cluster
1052  if(!fCaloCells) return -1.;
1053 
1054  Int_t absID = GetLeadingCellId(clus);
1055  if(absID>-1) return fCaloCells->GetCellAmplitude(absID);
1056  else return -1.;
1057 }
1058 
1059 //________________________________________________________________________
1061  //Get Ecross = sum of energy of neighbouring cells (using uncalibrated energy)
1062  if(!fCaloCells) return -1.;
1063 
1064  Double_t ecross = -1.;
1065 
1066  Int_t absID1 = -1;
1067  Int_t absID2 = -1;
1068  Int_t absID3 = -1;
1069  Int_t absID4 = -1;
1070 
1071  Int_t imod = -1, iphi =-1, ieta=-1, iTower = -1, iIphi = -1, iIeta = -1;
1072  fGeom->GetCellIndex(absID,imod,iTower,iIphi,iIeta);
1073  fGeom->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,iphi,ieta);
1074 
1075  if( iphi < AliEMCALGeoParams::fgkEMCALRows-1)
1076  absID1 = fGeom->GetAbsCellIdFromCellIndexes(imod, iphi+1, ieta);
1077  if( iphi > 0 )
1078  absID2 = fGeom->GetAbsCellIdFromCellIndexes(imod, iphi-1, ieta);
1079 
1080  if( ieta == AliEMCALGeoParams::fgkEMCALCols-1 && !(imod%2) ) {
1081  absID3 = fGeom->GetAbsCellIdFromCellIndexes(imod+1, iphi, 0);
1082  absID4 = fGeom->GetAbsCellIdFromCellIndexes(imod, iphi, ieta-1);
1083  }
1084  else if( ieta == 0 && imod%2 ) {
1085  absID3 = fGeom->GetAbsCellIdFromCellIndexes(imod, iphi, ieta+1);
1086  absID4 = fGeom->GetAbsCellIdFromCellIndexes(imod-1, iphi, AliEMCALGeoParams::fgkEMCALCols-1);
1087  }
1088  else {
1089  if( ieta < AliEMCALGeoParams::fgkEMCALCols-1 )
1090  absID3 = fGeom->GetAbsCellIdFromCellIndexes(imod, iphi, ieta+1);
1091  if( ieta > 0 )
1092  absID4 = fGeom->GetAbsCellIdFromCellIndexes(imod, iphi, ieta-1);
1093  }
1094 
1095  Double_t ecell1 = fCaloCells->GetCellAmplitude(absID1);
1096  Double_t ecell2 = fCaloCells->GetCellAmplitude(absID2);
1097  Double_t ecell3 = fCaloCells->GetCellAmplitude(absID3);
1098  Double_t ecell4 = fCaloCells->GetCellAmplitude(absID4);
1099 
1100  ecross = ecell1+ecell2+ecell3+ecell4;
1101 
1102  return ecross;
1103 }
1104 
1105 //_________________________________________________________________________
1106 Float_t AliAnalysisTaskEmcalTriggerPatchClusterMatch::RelativeEP(Double_t objAng, Double_t EPAng) const {
1107  // function to calculate angle between object and EP in the 1st quadrant (0,Pi/2)
1108  Double_t dphi = EPAng - objAng;
1109 
1110  if( dphi<-1*TMath::Pi() )
1111  dphi = dphi + 1*TMath::Pi();
1112  if( dphi>1*TMath::Pi())
1113  dphi = dphi - 1*TMath::Pi();
1114 
1115  if( (dphi>0) && (dphi<1*TMath::Pi()/2) ){
1116  // Do nothing! we are in quadrant 1
1117  }else if( (dphi>1*TMath::Pi()/2) && (dphi<1*TMath::Pi()) ){
1118  dphi = 1*TMath::Pi() - dphi;
1119  }else if( (dphi<0) && (dphi>-1*TMath::Pi()/2) ){
1120  dphi = fabs(dphi);
1121  }else if( (dphi<-1*TMath::Pi()/2) && (dphi>-1*TMath::Pi()) ){
1122  dphi = dphi + 1*TMath::Pi();
1123  }
1124 
1125  return dphi; // dphi in [0, Pi/2]
1126 }
1127 
1128 TH1* AliAnalysisTaskEmcalTriggerPatchClusterMatch::FillTriggerPatchQA(TH1* h, UInt_t trig, AliEmcalTriggerPatchInfo *fPatch) {
1129  // check and fill a QA histogram
1130  if(fPatch->IsLevel0()) h->Fill(1);
1131  if(fPatch->IsJetLow()) h->Fill(2);
1132  if(fPatch->IsJetHigh()) h->Fill(3);
1133  if(fPatch->IsGammaLow()) h->Fill(4);
1134  if(fPatch->IsGammaHigh()) h->Fill(5);
1135  if(fPatch->IsMainTrigger()) h->Fill(6);
1136  if(fPatch->IsJetLowSimple()) h->Fill(7);
1137  if(fPatch->IsJetHighSimple()) h->Fill(8);
1138  if(fPatch->IsGammaLowSimple()) h->Fill(9);
1139  if(fPatch->IsGammaHighSimple()) h->Fill(10);
1140  if(fPatch->IsMainTriggerSimple()) h->Fill(11);
1141  if(fPatch->IsOfflineSimple()) h->Fill(12);
1142  if(fPatch->IsRecalcJet()) h->Fill(13);
1143  if(fPatch->IsRecalcGamma()) h->Fill(14);
1144  if(trig & AliVEvent::kEMCEJE) h->Fill(19);
1145  if(trig & AliVEvent::kEMCEGA) h->Fill(20);
1146 
1147  h->GetXaxis()->SetBinLabel(1, "Level0");
1148  h->GetXaxis()->SetBinLabel(2, "JetLow");
1149  h->GetXaxis()->SetBinLabel(3, "JetHigh");
1150  h->GetXaxis()->SetBinLabel(4, "GammaLow");
1151  h->GetXaxis()->SetBinLabel(5, "GammaHigh");
1152  h->GetXaxis()->SetBinLabel(6, "MainTrigger");
1153  h->GetXaxis()->SetBinLabel(7, "JetLowSimple");
1154  h->GetXaxis()->SetBinLabel(8, "JetHighSimple");
1155  h->GetXaxis()->SetBinLabel(9, "GammaLowSimple");
1156  h->GetXaxis()->SetBinLabel(10, "GammaHighSimple");
1157  h->GetXaxis()->SetBinLabel(11, "MainTriggerSimple");
1158  h->GetXaxis()->SetBinLabel(12, "OfflineSimple");
1159  h->GetXaxis()->SetBinLabel(13, "RecalcJet");
1160  h->GetXaxis()->SetBinLabel(14, "RecalcGamma");
1161  h->GetXaxis()->SetBinLabel(15, "");
1162  h->GetXaxis()->SetBinLabel(16, "");
1163  h->GetXaxis()->SetBinLabel(17, "");
1164  h->GetXaxis()->SetBinLabel(18, "");
1165  h->GetXaxis()->SetBinLabel(19, "kEMCEJE");
1166  h->GetXaxis()->SetBinLabel(20, "kEMCEGA");
1167 
1168  // set x-axis labels vertically
1169  //h->LabelsOption("v");
1170  //h->LabelsDeflate("X");
1171 
1172  return h;
1173 }
1174 
1175 Bool_t AliAnalysisTaskEmcalTriggerPatchClusterMatch::CorrelateToTrigger(Double_t etaclust, Double_t phiclust, TList *triggerpatches) const {
1176  Bool_t hasfound = kFALSE;
1177  for(TIter patchIter = TIter(triggerpatches).Begin(); patchIter != TIter::End(); ++patchIter){
1178  AliEmcalTriggerPatchInfo *mypatch = static_cast<AliEmcalTriggerPatchInfo *>(*patchIter);
1179  Double_t etamin = TMath::Min(mypatch->GetEtaMin(), mypatch->GetEtaMax()),
1180  etamax = TMath::Max(mypatch->GetEtaMin(), mypatch->GetEtaMax()),
1181  phimin = TMath::Min(mypatch->GetPhiMin(), mypatch->GetPhiMax()),
1182  phimax = TMath::Max(mypatch->GetPhiMin(), mypatch->GetPhiMax());
1183  if(etaclust > etamin && etaclust < etamax && phiclust > phimin && phiclust < phimax){
1184  hasfound = kTRUE;
1185  break;
1186  }
1187  }
1188  return hasfound;
1189 }
1190 
1192  // check and fill a Event Selection QA histogram for different trigger selections after cuts
1193  if(trig == 0) h->Fill(1);
1194  if(trig & AliVEvent::kAny) h->Fill(2);
1195  if(trig & AliVEvent::kAnyINT) h->Fill(3);
1196  if(trig & AliVEvent::kMB) h->Fill(4);
1197  if(trig & AliVEvent::kINT7) h->Fill(5);
1198  if(trig & AliVEvent::kEMC1) h->Fill(6);
1199  if(trig & AliVEvent::kEMC7) h->Fill(7);
1200  if(trig & AliVEvent::kEMC8) h->Fill(8);
1201  if(trig & AliVEvent::kEMCEJE) h->Fill(9);
1202  if(trig & AliVEvent::kEMCEGA) h->Fill(10);
1203  if(trig & AliVEvent::kCentral) h->Fill(11);
1204  if(trig & AliVEvent::kSemiCentral) h->Fill(12);
1205  if(trig & AliVEvent::kINT8) h->Fill(13);
1206 
1207  if(trig & (AliVEvent::kEMCEJE | AliVEvent::kMB)) h->Fill(14);
1208  if(trig & (AliVEvent::kEMCEGA | AliVEvent::kMB)) h->Fill(15);
1209  if(trig & (AliVEvent::kAnyINT | AliVEvent::kMB)) h->Fill(16);
1210 
1211  if(trig & (AliVEvent::kEMCEJE & (AliVEvent::kMB | AliVEvent::kCentral | AliVEvent::kSemiCentral))) h->Fill(17);
1212  if(trig & (AliVEvent::kEMCEGA & (AliVEvent::kMB | AliVEvent::kCentral | AliVEvent::kSemiCentral))) h->Fill(18);
1213  if(trig & (AliVEvent::kAnyINT & (AliVEvent::kMB | AliVEvent::kCentral | AliVEvent::kSemiCentral))) h->Fill(19);
1214 
1215  // label bins of the analysis trigger selection summary
1216  h->GetXaxis()->SetBinLabel(1, "no trigger");
1217  h->GetXaxis()->SetBinLabel(2, "kAny");
1218  h->GetXaxis()->SetBinLabel(3, "kAnyINT");
1219  h->GetXaxis()->SetBinLabel(4, "kMB");
1220  h->GetXaxis()->SetBinLabel(5, "kINT7");
1221  h->GetXaxis()->SetBinLabel(6, "kEMC1");
1222  h->GetXaxis()->SetBinLabel(7, "kEMC7");
1223  h->GetXaxis()->SetBinLabel(8, "kEMC8");
1224  h->GetXaxis()->SetBinLabel(9, "kEMCEJE");
1225  h->GetXaxis()->SetBinLabel(10, "kEMCEGA");
1226  h->GetXaxis()->SetBinLabel(11, "kCentral");
1227  h->GetXaxis()->SetBinLabel(12, "kSemiCentral");
1228  h->GetXaxis()->SetBinLabel(13, "kINT8");
1229  h->GetXaxis()->SetBinLabel(14, "kEMCEJE or kMB");
1230  h->GetXaxis()->SetBinLabel(15, "kEMCEGA or kMB");
1231  h->GetXaxis()->SetBinLabel(16, "kAnyINT or kMB");
1232  h->GetXaxis()->SetBinLabel(17, "kEMCEJE & (kMB or kCentral or kSemiCentral)");
1233  h->GetXaxis()->SetBinLabel(18, "kEMCEGA & (kMB or kCentral or kSemiCentral)");
1234  h->GetXaxis()->SetBinLabel(19, "kAnyINT & (kMB or kCentral or kSemiCentral)");
1235 
1236  // set x-axis labels vertically
1237  h->LabelsOption("v");
1238  //h->LabelsDeflate("X");
1239 
1240  return h;
1241 }
TH3F * fh3PatchADCEnergyEtaPhiCenterG2
patch ADC energy vs eta, phi at center of patch, high threshold
Online energy, estimated from L0 time sums.
THnSparse * fhnPatchMatch
// patch-maxclus distributions sparse matrix
THnSparse * fhnPatchMatch2
// QA before matching patch sparse matrix
TH3F * fh3PatchADCEnergyEtaPhiCenterJ1
patch energy vs eta, phi at center of patch, low + high threshold
TH3F * fh3PatchADCEnergyEtaPhiCenterAll
patch ADC energy vs eta, phi at center of patch, low + high threshold
TH3F * fh3PatchEnergyEtaPhiCenterJ2
patch energy vs eta, phi at center of patch, high threshold
TH3F * fh3PatchEnergyEtaPhiCenterG1G2
patch energy vs eta, phi at center of patch, low threshold
TList * list
Offline amplitude, estimated from EMCAL cells.
TH1 * FillTriggerPatchQA(TH1 *h, UInt_t t, AliEmcalTriggerPatchInfo *fPatch)
TH1F * fhGammaLowPatchEnergy
Recalculated Gamma Patch Energy distribution.
TList * fOutput
x-section from pythia header
Online amplitude of the patch, from L0 time sums.
AliVCluster * GetLeadingCluster(const char *opt="")
AliParticleContainer * GetParticleContainer(Int_t i=0) const
const Double_t etamin
Bool_t CorrelateToTrigger(Double_t etaclust, Double_t phiclust, TList *triggerpatches) const
TH3F * fh3PatchEnergyEtaPhiCenterG2
patch energy vs eta, phi at center of patch, high threshold
AliEMCALGeometry * fGeom
whether it's an ESD analysis
TH1F * fhGammaLowSimplePatchEnergy
Gamma Low Patch Energy distribution.
TH3F * fh3PatchEnergyEtaPhiCenterJ1J2
patch energy vs eta, phi at center of patch, low threshold
AliClusterContainer * GetClusterContainer(Int_t i=0) const
Int_t GetNClusters() const
ClassImp(AliAnalysisTaskEmcalTriggerPatchClusterMatch) AliAnalysisTaskEmcalTriggerPatchClusterMatch
Double_t fCent
trigger patch info array
AliVParticle * GetNextAcceptParticle(Int_t i=-1)
TH1F * fhRecalcJetPatchEnergy
Gamma Low Simple Patch Energy distribution.
AliVCluster * GetCluster(Int_t i) const
TH3F * fh3PatchEnergyEtaPhiCenterG1
patch ADC energy vs eta, phi at center of patch, low + high threshold
TH3F * fh3EEtaPhiCell
patch ADC energy vs eta, phi at center of patch, all trigger patches
AliVCaloCells * fCaloCells
clusters
TH3F * fh3PatchADCEnergyEtaPhiCenterJ1J2
patch ADC energy vs eta, phi at center of patch, low threshold
Double_t fVertex[3]
event plane V0C
TH1F * fHistClusEnergy
cluster energy vs energy of leading cell in cluster vs time of the leading cell
const Double_t etamax
void SetMakeGeneralHistograms(Bool_t g)
TClonesArray * fTriggerPatchInfo
calo triggers
TH2F * fHistdPhidEtaPatchCluster[16]
Main Trigger patch energy distribution.
TH3F * fh3PatchADCEnergyEtaPhiCenterG1G2
patch ADC energy vs eta, phi at center of patch, low threshold
TH3F * fh3PtEtaPhiTracks
histogram containing the triggerbit (fOfflineTriggerMask)
const Int_t nbins
Offline energy, from cells, calibrated, exluding hot towers.
TH3F * fh3PatchADCEnergyEtaPhiCenterJ2
patch ADC energy vs eta, phi at center of patch, high threshold
TH1F * fhMainTriggerPatchEnergy
Jet Low Simple patch energy distribution.
TH1F * fhJetLowPatchEnergy
Recalculated Jet Patch Energy distribution.
TH3F * fh3PtEtaPhiTracksToProp
pt,eta,phi of tracks at Emcal surface
TH3F * fh3PatchADCEnergyEtaPhiCenterG1
patch energy vs eta, phi at center of patch, low + high threshold
const Double_t phimin