AliPhysics  v5-07-18-02 (20ec537)
 All Classes Namespaces Files Functions Variables 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  } else if (fTriggerCategory == kTriggerRecalcJet) {
334  if(!patch->IsRecalcGamma()) continue;
335  }
336 
337  // method for filling collection output array of 'saved' recalculated patches
338  (*fRecalcTriggerPatches)[patchacc] = patch;
339  ++patchacc;
340 
341  // fill QA counter histo for Recalculated 'trig class' patches
342  FillTriggerPatchQA(fhQAinfoCounter, trig, patch);
343 
344  // find max patch energy
345  if(patch->GetPatchE()>emax) {
346  fMaxPatch = patch;
347  emax = patch->GetPatchE();
348  } // max patch
349  } // loop over patches
350 
351  // check on patch Energy
352  if(firedTrigClass.Contains(fTriggerClass) && fMaxPatch && fMaxPatch->GetPatchE() > fPatchECut) {
353  // get cluster container and find leading cluster
355  if(!clusContp) {
356  AliError(Form("ERROR: Cluster container doesn't exist\n"));
357  return;
358  }
359 
360  AliVCluster* leadclus = clusContp->GetLeadingCluster();
361  if(!leadclus) return;
362 
363  // initialize variables and get leading cluster parameters
364  double leadclusEta = 0, leadclusPhi = 0, leadclusE = 0;
365  TLorentzVector clusvect;
366  leadclus->GetMomentum(clusvect, const_cast<Double_t*>(fVertex));
367  leadclusEta = clusvect.Eta();
368  leadclusPhi = clusvect.Phi();
369  leadclusE = leadclus->E();
370 
371  // get patch variables
372  double fMaxPatchPhiCM = fMaxPatch->GetPhiCM();
373  double fMaxPatchPhiGeo = fMaxPatch->GetPhiGeo();
374  double fMaxPatchEtaCM = fMaxPatch->GetEtaCM();
375  double fMaxPatchEtaGeo = fMaxPatch->GetEtaGeo();
376  double fMaxPatchPhiMin = fMaxPatch->GetPhiMin();
377  double fMaxPatchPhiMax = fMaxPatch->GetPhiMax();
378  double fMaxPatchEtaMin = fMaxPatch->GetEtaMin();
379  double fMaxPatchEtaMax = fMaxPatch->GetEtaMax();
380  Int_t nTrigBit = fMaxPatch->GetTriggerBits();
381 
382  // positional variables
383  double dEtaGeo = 1.0*TMath::Abs(leadclusEta - fMaxPatchEtaGeo);
384  double dEtaCM = 1.0*TMath::Abs(leadclusEta - fMaxPatchEtaCM);
385  double dPhiGeo = 1.0*TMath::Abs(leadclusPhi - fMaxPatchPhiGeo);
386  double dPhiCM = 1.0*TMath::Abs(leadclusPhi - fMaxPatchPhiCM);
387  double maxPatchE = fMaxPatch->GetPatchE();
388  double maxPatchADC = fMaxPatch->GetADCAmpGeVRough();
389 
390  // patch summary (meeting energy cut requirement)
391  if(doComments) {
392  cout<<endl<<"Patch summary: "<<endl;
393  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;
394  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;
395  cout<<Form("phi min = %f, phi max = %f, eta min = %f, eta max = %f", fMaxPatchPhiMin, fMaxPatchPhiMax, fMaxPatchEtaMin, fMaxPatchEtaMax)<<endl;
396  }
397 
398  Double_t fill[7] = {dEtaGeo, dEtaCM, dPhiGeo, dPhiCM, maxPatchADC, maxPatchE, leadclusE};
399  fhnPatchMaxClus->Fill(fill);
400 
401  } // patch energy cut
402 
403 // cout<<Form("Jet: low: %d, high: %d," ,nJ2, nJ1)<<" ";//<<endl;
404 // cout<<Form("Gamma: low: %d, high: %d," ,nG2, nG1)<<" ";//<<endl;
405 // cout<<Form("L0: %d", nL0)<<endl;
406 // cout<<Form("Max Patch Energy: %f GeV", fMaxPatch->GetPatchE())<<endl;
407 }
408 
409 //________________________________________________________________________
411 {
412  // Create user output.
414 
415  Bool_t oldStatus = TH1::AddDirectoryStatus();
416  TH1::AddDirectory(kFALSE);
417 
418  fhNEvents = new TH1F("fhNEvents","fhNEvents;selection;N_{evt}",5,0,5);
419  fOutput->Add(fhNEvents);
420 
421  fhTriggerbit = new TProfile("fhTriggerbit","fhTriggerbit;;TriggerBit",1,0,1);
422  fOutput->Add(fhTriggerbit);
423 
424  Int_t fgkNCentBins = 21;
425  Float_t kMinCent = 0.;
426  Float_t kMaxCent = 105.;
427  Double_t *binsCent = new Double_t[fgkNCentBins+1];
428  for(Int_t i=0; i<=fgkNCentBins; i++) binsCent[i]=(Double_t)kMinCent + (kMaxCent-kMinCent)/fgkNCentBins*(Double_t)i ;
429  binsCent[fgkNCentBins-1] = 100.5;
430  binsCent[fgkNCentBins] = 101.5;
431 
432  Int_t fgkNdEPBins = 18*8;
433  Float_t kMindEP = 0.;
434  Float_t kMaxdEP = 1.*TMath::Pi()/2.;
435  Double_t *binsdEP = new Double_t[fgkNdEPBins+1];
436  for(Int_t i=0; i<=fgkNdEPBins; i++) binsdEP[i]=(Double_t)kMindEP + (kMaxdEP-kMindEP)/fgkNdEPBins*(Double_t)i ;
437 
438  Int_t fgkNPtBins = 200;
439  Float_t kMinPt = -50.;
440  Float_t kMaxPt = 150.;
441  Double_t *binsPt = new Double_t[fgkNPtBins+1];
442  for(Int_t i=0; i<=fgkNPtBins; i++) binsPt[i]=(Double_t)kMinPt + (kMaxPt-kMinPt)/fgkNPtBins*(Double_t)i ;
443 
444  Int_t fgkNPhiBins = 18*8;
445  Float_t kMinPhi = 0.;
446  Float_t kMaxPhi = 2.*TMath::Pi();
447  Double_t *binsPhi = new Double_t[fgkNPhiBins+1];
448  for(Int_t i=0; i<=fgkNPhiBins; i++) binsPhi[i]=(Double_t)kMinPhi + (kMaxPhi-kMinPhi)/fgkNPhiBins*(Double_t)i ;
449 
450  Int_t fgkNEtaBins = 100;
451  Float_t fgkEtaMin = -1.;
452  Float_t fgkEtaMax = 1.;
453  Double_t *binsEta=new Double_t[fgkNEtaBins+1];
454  for(Int_t i=0; i<=fgkNEtaBins; i++) binsEta[i]=(Double_t)fgkEtaMin + (fgkEtaMax-fgkEtaMin)/fgkNEtaBins*(Double_t)i ;
455 
456  Int_t fgkNConstBins = 100;
457  Float_t kMinConst = 0.;
458  Float_t kMaxConst = 100.;
459  Double_t *binsConst = new Double_t[fgkNConstBins+1];
460  for(Int_t i=0; i<=fgkNConstBins; i++) binsConst[i]=(Double_t)kMinConst + (kMaxConst-kMinConst)/fgkNConstBins*(Double_t)i ;
461 
462  Int_t fgkNTimeBins = 100;
463  Float_t kMinTime = -200.;
464  Float_t kMaxTime = 200;
465  Double_t *binsTime = new Double_t[fgkNTimeBins+1];
466  for(Int_t i=0; i<=fgkNTimeBins; i++) binsTime[i]=(Double_t)kMinTime + (kMaxTime-kMinTime)/fgkNTimeBins*(Double_t)i ;
467 
468  Int_t fgkNVZEROBins = 100;
469  Float_t kMinVZERO = 0.;
470  Float_t kMaxVZERO = 25000;
471  Double_t *binsVZERO = new Double_t[fgkNVZEROBins+1];
472  for(Int_t i=0; i<=fgkNVZEROBins; i++) binsVZERO[i]=(Double_t)kMinVZERO + (kMaxVZERO-kMinVZERO)/fgkNVZEROBins*(Double_t)i ;
473 
474  Double_t enBinEdges[3][2];
475  enBinEdges[0][0] = 1.; //10 bins
476  enBinEdges[0][1] = 0.1;
477  enBinEdges[1][0] = 5.; //8 bins
478  enBinEdges[1][1] = 0.5;
479  enBinEdges[2][0] = 100.;//95 bins
480  enBinEdges[2][1] = 1.;
481 
482  const Float_t enmin1 = 0;
483  const Float_t enmax1 = enBinEdges[0][0];
484  const Float_t enmin2 = enmax1 ;
485  const Float_t enmax2 = enBinEdges[1][0];
486  const Float_t enmin3 = enmax2 ;
487  const Float_t enmax3 = enBinEdges[2][0];//fgkEnMax;
488  const Int_t nbin11 = (int)((enmax1-enmin1)/enBinEdges[0][1]);
489  const Int_t nbin12 = (int)((enmax2-enmin2)/enBinEdges[1][1])+nbin11;
490  const Int_t nbin13 = (int)((enmax3-enmin3)/enBinEdges[2][1])+nbin12;
491 
492  Int_t fgkNEnBins=nbin13;
493  Double_t *binsEn=new Double_t[fgkNEnBins+1];
494  for(Int_t i=0; i<=fgkNEnBins; i++) {
495  if(i<=nbin11) binsEn[i]=(Double_t)enmin1 + (enmax1-enmin1)/nbin11*(Double_t)i ;
496  if(i<=nbin12 && i>nbin11) binsEn[i]=(Double_t)enmin2 + (enmax2-enmin2)/(nbin12-nbin11)*((Double_t)i-(Double_t)nbin11) ;
497  if(i<=nbin13 && i>nbin12) binsEn[i]=(Double_t)enmin3 + (enmax3-enmin3)/(nbin13-nbin12)*((Double_t)i-(Double_t)nbin12) ;
498  }
499 
500  fh3PtEtaPhiTracks = new TH3F("fh3PtEtaPhiTracks","fh3PtEtaPhiTracks;#it{p}_{T}^{track}_{vtx};#eta_{vtx};#varphi_{vtx}",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
502 
503  fh3PtEtaPhiTracksOnEmcal = new TH3F("fh3PtEtaPhiTracksOnEmcal","fh3PtEtaPhiTracksOnEmcal;#it{p}_{T}^{track}_{emc};#eta_{emc};#varphi_{emc}",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
505 
506  fh3PtEtaPhiTracksToProp = new TH3F("fh3PtEtaPhiTracksToProp","fh3PtEtaPhiTracksToProp;#it{p}_{T}^{track}_{vtx};#eta_{vtx};#varphi_{vtx}",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
508 
509  fh3PtEtaPhiTracksProp = new TH3F("fh3PtEtaPhiTracksProp","fh3PtEtaPhiTracksProp;#it{p}_{T}^{track}_{vtx};#eta_{vtx};#varphi_{vtx}",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
511 
512  fh3PtEtaPhiTracksNoProp = new TH3F("fh3PtEtaPhiTracksNoProp","fh3PtEtaPhiTracksNoProp;#it{p}_{T}^{track}_{vtx};#eta_{vtx};#varphi_{vtx}",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
514 
515  fh3EEtaPhiCluster = new TH3F("fh3EEtaPhiCluster","fh3EEtaPhiCluster;E_{clus};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
517 
518  fh3PatchEnergyEtaPhiCenterJ1 = new TH3F("fh3PatchEnergyEtaPhiCenterJ1","fh3PatchEnergyEtaPhiCenterJ1;E_{patch};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
520 
521  fh3PatchEnergyEtaPhiCenterJ2 = new TH3F("fh3PatchEnergyEtaPhiCenterJ2","fh3PatchEnergyEtaPhiCenterJ2;E_{patch};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
523 
524  fh3PatchEnergyEtaPhiCenterJ1J2 = new TH3F("fh3PatchEnergyEtaPhiCenterJ1J2","fh3PatchEnergyEtaPhiCenterJ1J2;E_{patch};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
526 
527  fh3PatchADCEnergyEtaPhiCenterJ1 = new TH3F("fh3PatchADCEnergyEtaPhiCenterJ1","fh3PatchADCEnergyEtaPhiCenterJ1;E_{ADC,patch};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
529 
530  fh3PatchADCEnergyEtaPhiCenterJ2 = new TH3F("fh3PatchADCEnergyEtaPhiCenterJ2","fh3PatchADCEnergyEtaPhiCenterJ2;E_{ADC,patch};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
532 
533  fh3PatchADCEnergyEtaPhiCenterJ1J2 = new TH3F("fh3PatchADCEnergyEtaPhiCenterJ1J2","fh3PatchADCEnergyEtaPhiCenterJ1J2;E_{ADC,patch};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
535 
536  fh3PatchEnergyEtaPhiCenterG1 = new TH3F("fh3PatchEnergyEtaPhiCenterG1","fh3PatchEnergyEtaPhiCenterG1;E_{patch};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
538 
539  fh3PatchEnergyEtaPhiCenterG2 = new TH3F("fh3PatchEnergyEtaPhiCenterG2","fh3PatchEnergyEtaPhiCenterG2;E_{patch};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
541 
542  fh3PatchEnergyEtaPhiCenterG1G2 = new TH3F("fh3PatchEnergyEtaPhiCenterG1G2","fh3PatchEnergyEtaPhiCenterG1G2;E_{patch};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
544 
545  fh3PatchADCEnergyEtaPhiCenterG1 = new TH3F("fh3PatchADCEnergyEtaPhiCenterG1","fh3PatchADCEnergyEtaPhiCenterG1;E_{ADC,patch};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
547 
548  fh3PatchADCEnergyEtaPhiCenterG2 = new TH3F("fh3PatchADCEnergyEtaPhiCenterG2","fh3PatchADCEnergyEtaPhiCenterG2;E_{ADC,patch};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
550 
551  fh3PatchADCEnergyEtaPhiCenterG1G2 = new TH3F("fh3PatchADCEnergyEtaPhiCenterG1G2","fh3PatchADCEnergyEtaPhiCenterG1G2;E_{ADC,patch};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
553 
554  fh3PatchADCEnergyEtaPhiCenterAll = new TH3F("fh3PatchADCEnergyEtaPhiCenterAll","fh3PatchADCEnergyEtaPhiCenterAll;E_{ADC,patch};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
556 
557  fh3EEtaPhiCell = new TH3F("fh3EEtaPhiCell","fh3EEtaPhiCell;E_{cell};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
558  fOutput->Add(fh3EEtaPhiCell);
559 
560  fh2ECellVsCent = new TH2F("fh2ECellVsCent","fh2ECellVsCent;centrality;E_{cell}",101,-1,100,500,0.,5.);
561  fOutput->Add(fh2ECellVsCent);
562 
563  fh2CellEnergyVsTime = new TH2F("fh2CellEnergyVsTime","fh2CellEnergyVsTime;E_{cell};time",fgkNEnBins,binsEn,fgkNTimeBins,binsTime);
565 
566  fh3EClusELeadingCellVsTime = new TH3F("fh3EClusELeadingCellVsTime","fh3EClusELeadingCellVsTime;E_{cluster};E_{leading cell};time_{leading cell}",fgkNEnBins,binsEn,fgkNEnBins,binsEn,fgkNTimeBins,binsTime);
568 
569  fhQAinfoAllPatchesCounter = new TH1F("fhQAinfoAllPatchesCounter", "QA trigger info counters for all patches", 20, 0.5, 20.5);
571 
572  fhQAinfoCounter = new TH1F("fhQAinfoCounter", "QA trigger info counters", 20, 0.5, 20.5);
573  fOutput->Add(fhQAinfoCounter);
574 
575  fhQAmaxinfoCounter = new TH1F("fhQAmaxinfoCounter", "QA Max patch trigger info counters", 20, 0.5, 20.5);
577 
578  fhRecalcGammaPatchEnergy = new TH1F("fhRecalcGammaPatchEnergy", "Recalculated Gamma Patch Energy", 200, 0, 50); //100
580 
581  fhGammaLowPatchEnergy = new TH1F("fhGammaLowPatchEnergy", "Gamma Low Patch Energy", 200, 0, 50); //100
583 
584  fhGammaLowSimplePatchEnergy = new TH1F("fhGammaLowSimplePatchEnergy", "Gamma Low Simple Patch Energy", 200, 0, 50); //100
586 
587  fhRecalcJetPatchEnergy = new TH1F("fhRecalcJetPatchEnergy", "Recalculated Jet Patch Energy", 200, 0, 100);
589 
590  fhJetLowPatchEnergy = new TH1F("fhJetLowPatchEnergy", "Jet Low Patch Energy", 200, 0, 100);
592 
593  fhJetLowSimplePatchEnergy = new TH1F("fhJetLowSimplePatchEnergy", "Jet Low Simple Patch Energy", 200, 0, 100);
595 
596  fhMainTriggerPatchEnergy = new TH1F("fhMainTriggerPatchEnergy", "Main Trigger Patch Energy", 200, 0, 100);
598 
599  fHistClusEnergy = new TH1F("fHistClusEnergy", "Cluster Energy distribution", 200, 0, 50);
600  fOutput->Add(fHistClusEnergy);
601 
602  for(Int_t j=0; j<16; j++) {
603  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);
605  }
606 
607  Int_t nDim=7;
608  Int_t *nbins = new Int_t[nDim];
609  Double_t *xmin = new Double_t[nDim];
610  Double_t *xmax = new Double_t[nDim];
611  for (Int_t i=0; i<nDim; i++){
612  nbins[i]=144;
613  xmin[i]=0;
614  xmax[i]=2.016;
615  }
616 
617  nbins[4]=100; xmax[4]=100;
618  nbins[5]=100; xmax[5]=100.;
619  nbins[6]=100; xmax[6]=100.;
620 
621  fhnPatchMaxClus = new THnSparseF("fhnPatchMaxClus","fhn Patch Max Cluster Distributions", nDim,nbins,xmin,xmax);
622  fhnPatchMaxClus->GetAxis(0)->SetTitle("#Delta#etaGeo"); // 0
623  fhnPatchMaxClus->GetAxis(1)->SetTitle("#Delta#etaCM"); // 1
624  fhnPatchMaxClus->GetAxis(2)->SetTitle("#Delta#phiGeo"); // 2
625  fhnPatchMaxClus->GetAxis(3)->SetTitle("#Delta#phiCM"); // 3
626  fhnPatchMaxClus->GetAxis(4)->SetTitle("Max Patch ADC"); // 4
627  fhnPatchMaxClus->GetAxis(5)->SetTitle("Max Patch Energy"); // 5
628  fhnPatchMaxClus->GetAxis(6)->SetTitle("Leading Cluster Energy"); // 6
629  fOutput->Add(fhnPatchMaxClus);
630 
631  // QA before/after matching
632  Int_t nDim1=6;
633  Int_t *nbins1 = new Int_t[nDim1];
634  Double_t *xmin1 = new Double_t[nDim1];
635  Double_t *xmax1 = new Double_t[nDim1];
636  nbins1[0]=10; xmin1[0]=0.; xmax1[0]=100.;
637  nbins1[1]=200; xmin1[1]=0.; xmax1[1]=50;
638  nbins1[2]=144; xmin1[2]=0.; xmax1[2]=2.016;
639  nbins1[3]=144; xmin1[3]=0.; xmax1[3]=2.016;
640  nbins1[4]=300; xmin1[4]=0.; xmax1[4]=300;
641  nbins1[5]=500; xmin1[5]=0.; xmax1[5]=500;
642 
643  // before cuts to perform match
644  fhnPatchMatch = new THnSparseF("fhnPatchMatch","fhn Patch Match before cuts", nDim1,nbins1,xmin1,xmax1);
645  fhnPatchMatch->GetAxis(0)->SetTitle("Centrality %"); // 0
646  fhnPatchMatch->GetAxis(1)->SetTitle("Cluster Energy"); // 1
647  fhnPatchMatch->GetAxis(2)->SetTitle("#Delta#phi Geo"); // 2
648  fhnPatchMatch->GetAxis(3)->SetTitle("#Delta#eta Geo"); // 3
649  fhnPatchMatch->GetAxis(4)->SetTitle("Max Patch Energy"); // 4
650  fhnPatchMatch->GetAxis(5)->SetTitle("Max Patch ADC"); // 5
651  fOutput->Add(fhnPatchMatch);
652 
653  // after cuts to perform match
654  fhnPatchMatch2 = new THnSparseF("fhnPatchMatch2","fhn Patch Match after cuts", nDim1,nbins1,xmin1,xmax1);
655  fhnPatchMatch2->GetAxis(0)->SetTitle("Centrality %"); // 0
656  fhnPatchMatch2->GetAxis(1)->SetTitle("Cluster Energy"); // 1
657  fhnPatchMatch2->GetAxis(2)->SetTitle("#Delta#phi Geo"); // 2
658  fhnPatchMatch2->GetAxis(3)->SetTitle("#Delta#eta Geo"); // 3
659  fhnPatchMatch2->GetAxis(4)->SetTitle("Max Patch Energy"); // 4
660  fhnPatchMatch2->GetAxis(5)->SetTitle("Max Patch ADC"); // 5
661  fOutput->Add(fhnPatchMatch2);
662 
663  // for cluster matched to patch
664  Int_t nDim2=10;
665  Int_t *nbins2 = new Int_t[nDim2];
666  Double_t *xmin2 = new Double_t[nDim2];
667  Double_t *xmax2 = new Double_t[nDim2];
668  for (Int_t i=0; i<nDim2; i++){
669  nbins2[i]=144;
670  xmin2[i]=0;
671  }
672 
673  nbins2[0]=10; xmax2[0]=100;
674  nbins2[1]=200; xmax2[1]=50.;
675  nbins2[2]=72; xmin2[2]=1.2; xmax2[2]=3.4; //2.0*TMath::Pi();
676  nbins2[3]=56; xmin2[3]=-0.7; xmax2[3]=0.7;
677  nbins2[4]=500; xmax2[4]=500.;
678  nbins2[5]=500; xmax2[5]=500.;
679  nbins2[6]=300; xmax2[6]=300.;
680  nbins2[7]=300; xmax2[7]=300.;
681  nbins2[8]=72; xmin2[8]=1.4; xmax2[9]=3.2;
682  nbins2[9]=56; xmin2[9]=-0.7; xmax2[9]=0.7;
683 
684  //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}; ////
685 
686 /*
687  fhnPatchMatchJetLeadClus = new THnSparseF("fhnPatchMatchJetLeadClus","fhn Patch Match to Jet Leading Cluster", nDim2, nbins2,xmin2,xmax2); ////
688  fhnPatchMatchJetLeadClus->GetAxis(0)->SetTitle("Centrality %"); // 0
689  fhnPatchMatchJetLeadClus->GetAxis(1)->SetTitle("Max Cluster Energy constituent of Jet"); // 1
690  fhnPatchMatchJetLeadClus->GetAxis(2)->SetTitle("Cluster #phi"); // 2
691  fhnPatchMatchJetLeadClus->GetAxis(3)->SetTitle("Cluster #eta"); // 3
692  fhnPatchMatchJetLeadClus->GetAxis(4)->SetTitle("Max Patch Amplitude Online"); // 4
693  fhnPatchMatchJetLeadClus->GetAxis(5)->SetTitle("Max Patch Amplitude Offline"); // 5
694  fhnPatchMatchJetLeadClus->GetAxis(6)->SetTitle("Max Patch Energy Online"); // 6
695  fhnPatchMatchJetLeadClus->GetAxis(7)->SetTitle("Max Patch Energy Offline"); // 7
696  fhnPatchMatchJetLeadClus->GetAxis(8)->SetTitle("Max Patch Geometric Center in #phi"); // 8
697  fhnPatchMatchJetLeadClus->GetAxis(9)->SetTitle("Max Patch Geometric Center in #eta"); // 9
698  fOutput->Add(fhnPatchMatchJetLeadClus); ////
699 */
700 
701  // Event Selection QA histo
702  fHistEventSelectionQA = new TH1F("fHistEventSelectionQA", "Trigger Selection Counter", 20, 0.5, 20.5);
704 
705  // =========== Switch on Sumw2 for all histos ===========
706  for (Int_t i=0; i<fOutput->GetEntries(); ++i) {
707  TH1 *h1 = dynamic_cast<TH1*>(fOutput->At(i));
708  if (h1){
709  h1->Sumw2();
710  continue;
711  }
712  TH2 *h2 = dynamic_cast<TH2*>(fOutput->At(i));
713  if (h2){
714  h2->Sumw2();
715  continue;
716  }
717  TH3 *h3 = dynamic_cast<TH3*>(fOutput->At(i));
718  if (h3){
719  h3->Sumw2();
720  continue;
721  }
722  THnSparse *hn = dynamic_cast<THnSparse*>(fOutput->At(i));
723  if(hn)hn->Sumw2();
724  }
725 
726  TH1::AddDirectory(oldStatus);
727 
728  PostData(1, fOutput); // Post data for ALL output slots > 0 here.
729 
730  if(binsCent) delete [] binsCent;
731  if(binsdEP) delete [] binsdEP;
732  if(binsEn) delete [] binsEn;
733  if(binsPt) delete [] binsPt;
734  if(binsPhi) delete [] binsPhi;
735  if(binsEta) delete [] binsEta;
736  if(binsConst) delete [] binsConst;
737  if(binsTime) delete [] binsTime;
738  if(binsVZERO) delete [] binsVZERO;
739 
740 }
741 
742 //________________________________________________________________________
744  // Fill histograms.
745 
746  // check and fill a Event Selection QA histogram for different trigger selections
747  UInt_t trig = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
748 
749  // get fired trigger classes
750  TString firedTrigClass = InputEvent()->GetFiredTriggerClasses();
751 
752  // fill Event Trigger QA
754 
755  // create pointer to list of input event
756  TList *list = InputEvent()->GetList();
757  if(!list) {
758  AliError(Form("ERROR: list not attached\n"));
759  return kTRUE;
760  }
761 
762  // reset collection at start of event
763  fClusterTriggeredEvent->Clear();
764 
765  //Tracks
767  if (partCont) {
768  AliVTrack *track = dynamic_cast<AliVTrack*>(partCont->GetNextAcceptParticle(0));
769  while(track) {
770  Double_t trkphi = track->Phi()*TMath::RadToDeg();
771  fh3PtEtaPhiTracks->Fill(track->Pt(),track->Eta(),track->Phi());
772 
773  //Select tracks which should be propagated
774  if(track->Pt()>=0.350) {
775  if (TMath::Abs(track->Eta())<=0.9 && trkphi > 10 && trkphi < 250) {
776  fh3PtEtaPhiTracksOnEmcal->Fill(track->GetTrackPtOnEMCal(),track->GetTrackEtaOnEMCal(),track->GetTrackPhiOnEMCal());
777  fh3PtEtaPhiTracksToProp->Fill(track->Pt(),track->Eta(),track->Phi());
778  if(track->GetTrackPtOnEMCal()>=0) fh3PtEtaPhiTracksProp->Fill(track->Pt(),track->Eta(),track->Phi());
779  else
780  fh3PtEtaPhiTracksNoProp->Fill(track->Pt(),track->Eta(),track->Phi());
781  } // acceptance cut
782  } // track pt cut
783  track = dynamic_cast<AliPicoTrack*>(partCont->GetNextAcceptParticle());
784  } // track exist
785  } // particle container
786 
787  //Clusters - get cluster collection
788  TClonesArray *clusters = 0x0;
789  clusters = dynamic_cast<TClonesArray*>(list->FindObject("EmcCaloClusters"));
790  if (!clusters) {
791  AliError(Form("Pointer to clusters %s == 0", "EmcCaloClusters"));
792  return kTRUE;
793  } // verify existence of clusters
794 
795  // loop over clusters
796  const Int_t Nclusters = clusters->GetEntries();
797  for (Int_t iclus = 0; iclus < Nclusters; iclus++){
798  AliVCluster* clus = static_cast<AliVCluster*>(clusters->At(iclus));
799  if(!clus){
800  AliError(Form("Couldn't get AliVCluster %d\n", iclus));
801  continue;
802  }
803 
804  // is cluster in EMCal?
805  if (!clus->IsEMCAL()) {
806  AliDebug(2,Form("%s: Cluster is not emcal",GetName()));
807  continue;
808  }
809 
810  // get some info on cluster and fill histo
811  TLorentzVector lp;
812  clus->GetMomentum(lp, const_cast<Double_t*>(fVertex));
813  fHistClusEnergy->Fill(lp.E());
814  }
815 
816  //Clusters
818  if (clusCont) {
819  Int_t nclusters = clusCont->GetNClusters();
820  for (Int_t ic = 0, clusacc = 0; ic < nclusters; ic++) {
821  AliVCluster *cluster = static_cast<AliVCluster*>(clusCont->GetCluster(ic));
822  if (!cluster) {
823  AliDebug(2,Form("Could not receive cluster %d", ic));
824  continue;
825  }
826 
827  // is cluster in EMCal?
828  if (!cluster->IsEMCAL()) {
829  AliDebug(2,Form("%s: Cluster is not emcal",GetName()));
830  continue;
831  }
832 
833  TLorentzVector lp;
834  cluster->GetMomentum(lp, const_cast<Double_t*>(fVertex));
835  fh3EEtaPhiCluster->Fill(lp.E(),lp.Eta(),lp.Phi());
836  if(fCaloCells) {
837  Double_t leadCellE = GetEnergyLeadingCell(cluster);
838  Double_t leadCellT = cluster->GetTOF();
839  fh3EClusELeadingCellVsTime->Fill(lp.E(),leadCellE,leadCellT*1e9);
840  } // if calo cells exist
841 
842  // get cluster observables
843  Double_t ClusterEta = 0., ClusterPhi = 0., ClusterE = 0.;
844  ClusterEta = lp.Eta();
845  ClusterPhi = lp.Phi();
846  ClusterE = cluster->E();
847 
848  // check that trigger class was fired and require we have a cluster meeting energy cut - Matches to MAX Patch
849  if(ClusterE > fClusBias && fMaxPatch && firedTrigClass.Contains(fTriggerClass) && (!fUseALLrecalcPatches)) {
850  //cout<<Form("#Clus in container = %i, NACCcluster = %i, LeadClusE = %f, isEMCal? = %s", clusCont->GetNClusters(), clusCont->GetNAcceptedClusters(), leadclus->E(), leadclus->IsEMCAL()? "true":"false")<<endl;
851 
852  // get max patch location
853  double fMaxPatchPhiGeo = fMaxPatch->GetPhiGeo();
854  double fMaxPatchEtaGeo = fMaxPatch->GetEtaGeo();
855  double dPhiPatchLeadCl = 1.0*TMath::Abs(fMaxPatchPhiGeo - ClusterPhi);
856  double dEtaPatchLeadCl = 1.0*TMath::Abs(fMaxPatchEtaGeo - ClusterEta);
857 
858  // get offline/online Energy and ADC count
859  double kAmplitudeOnline = fMaxPatch->GetADCAmp();
860  double kAmplitudeOffline = fMaxPatch->GetADCOfflineAmp();
861  double kEnergyOnline = fMaxPatch->GetADCAmpGeVRough();
862  double kEnergyOffline = fMaxPatch->GetPatchE();
863 
864  // get patch variables
865  double etamin = TMath::Min(fMaxPatch->GetEtaMin(), fMaxPatch->GetEtaMax());
866  double etamax = TMath::Max(fMaxPatch->GetEtaMin(), fMaxPatch->GetEtaMax());
867  double phimin = TMath::Min(fMaxPatch->GetPhiMin(), fMaxPatch->GetPhiMax());
868  double phimax = TMath::Max(fMaxPatch->GetPhiMin(), fMaxPatch->GetPhiMax());
869 
870  for(int maxbinE = 0; maxbinE<16; maxbinE++) { if(ClusterE > maxbinE) fHistdPhidEtaPatchCluster[maxbinE]->Fill(dPhiPatchLeadCl, dEtaPatchLeadCl); }
871 
872  // fill sparse array before and after match
873  Double_t fillarr[6] = {fCent, ClusterE, dPhiPatchLeadCl, dEtaPatchLeadCl, kEnergyOffline, kAmplitudeOnline};
874  fhnPatchMatch->Fill(fillarr);
875  if(ClusterEta > etamin && ClusterEta < etamax && ClusterPhi > phimin && ClusterPhi < phimax) fhnPatchMatch2->Fill(fillarr);
876 
877  // patch meeting offline energy cut
878  if(fMaxPatch->GetPatchE() > fPatchECut) {
879  // look to geometrically match patch to leading cluster of jet
880  if(ClusterEta > etamin && ClusterEta < etamax && ClusterPhi > phimin && ClusterPhi < phimax){
881  if(doComments) {
882  cout<<"*********************************************"<<endl;
883  cout<<"Proper match (cluster to fired max patch): ";
884  cout<<Form("MaxClusterE = %f, Phi = %f, Eta = %f", ClusterE, ClusterPhi, ClusterEta)<<endl;
885  cout<<"*********************************************"<<endl;
886  } // do comments
887 
888  // fill sparse for match
889  //Double_t fill[10] = {fCent, ClusterE, ClusterPhi, ClusterEta, kAmplitudeOnline, kAmplitudeOffline, kEnergyOnline, kEnergyOffline, fMaxPatchPhiGeo, fMaxPatchEtaGeo};
890  //fhnPatchMatchJetLeadClus->Fill(fill);
891 
892  // method for filling collection output array of 'saved' clusters
893  (*fClusterTriggeredEvent)[clusacc] = cluster;
894  ++clusacc;
895 
896  } // MATCH!
897  } // patch > Ecut GeV
898  } // cluster energy > cut
899 
900 
901  // switch for recalculated patches
903  // apply cluster energy cut, make sure event fired trigger and require recalculated trigger patch object
904  if(ClusterE > fClusBias && firedTrigClass.Contains(fTriggerClass) && fRecalcTriggerPatches) {
905  // number of recalculated patches in event
906  Int_t nPatch = fRecalcTriggerPatches->GetEntriesFast();
907 
908  AliEmcalTriggerPatchInfo *patch;
909  for(Int_t iPatch = 0; iPatch < nPatch; iPatch++) {
910  patch = (AliEmcalTriggerPatchInfo*)fRecalcTriggerPatches->At(iPatch);
911  if(!patch) continue;
912 
913  // get max patch location
914  double fPatchPhiGeo = patch->GetPhiGeo();
915  double fPatchEtaGeo = patch->GetEtaGeo();
916  double dPhiPatchCl = 1.0*TMath::Abs(fPatchPhiGeo - ClusterPhi);
917  double dEtaPatchCl = 1.0*TMath::Abs(fPatchEtaGeo - ClusterEta);
918 
919  // get offline/online Energy and ADC count
920  double kAmplitudeOnline = patch->GetADCAmp();
921  double kAmplitudeOffline = patch->GetADCOfflineAmp();
922  double kEnergyOnline = patch->GetADCAmpGeVRough();
923  double kEnergyOffline = patch->GetPatchE();
924 
925  // get patch variables
926  double etamin = TMath::Min(patch->GetEtaMin(), patch->GetEtaMax());
927  double etamax = TMath::Max(patch->GetEtaMin(), patch->GetEtaMax());
928  double phimin = TMath::Min(patch->GetPhiMin(), patch->GetPhiMax());
929  double phimax = TMath::Max(patch->GetPhiMin(), patch->GetPhiMax());
930 
931  for(int maxbinE = 0; maxbinE<16; maxbinE++) { if(ClusterE > maxbinE) fHistdPhidEtaPatchCluster[maxbinE]->Fill(dPhiPatchCl, dEtaPatchCl); }
932 
933  // fill sparse array before and after match
934  Double_t fillarr[6] = {fCent, ClusterE, dPhiPatchCl, dEtaPatchCl, kEnergyOffline, kAmplitudeOnline};
935  fhnPatchMatch->Fill(fillarr);
936  if(ClusterEta > etamin && ClusterEta < etamax && ClusterPhi > phimin && ClusterPhi < phimax) fhnPatchMatch2->Fill(fillarr);
937 
938  // patch meeting offline energy cut
939  if(fMaxPatch->GetPatchE() > fPatchECut) {
940  // look to geometrically match patch to leading cluster of jet
941  if(ClusterEta > etamin && ClusterEta < etamax && ClusterPhi > phimin && ClusterPhi < phimax){
942  if(doComments) {
943  cout<<"*********************************************"<<endl;
944  cout<<"Proper match (cluster to fired max patch): ";
945  cout<<Form("MaxClusterE = %f, Phi = %f, Eta = %f", ClusterE, ClusterPhi, ClusterEta)<<endl;
946  cout<<"*********************************************"<<endl;
947  } // do comments
948 
949  // fill sparse for match
950  //Double_t fill[10] = {fCent, ClusterE, ClusterPhi, ClusterEta, kAmplitudeOnline, kAmplitudeOffline, kEnergyOnline, kEnergyOffline, fMaxPatchPhiGeo, fMaxPatchEtaGeo};
951  //fhnPatchMatchJetLeadClus->Fill(fill);
952 
953  // method for filling collection output array of 'saved' clusters
954  (*fClusterTriggeredEvent)[clusacc] = cluster;
955  ++clusacc;
956 
957  } // MATCH!
958  } // patch energy cut (should not really need)
959  } // recalculated patch loop
960  } // cluster energy cut
961  } // recalulated patch switch
962 
964  } // cluster loop
965  } // if cluster container exist
966 
967  //Get VZERO amplitude
968  Float_t VZEROAmp = InputEvent()->GetVZEROData()->GetTriggerChargeA() + InputEvent()->GetVZEROData()->GetTriggerChargeC();
969 
970  //Cells - some QA plots
971  if(fCaloCells) {
972  const Short_t nCells = fCaloCells->GetNumberOfCells();
973 
974  for(Int_t iCell=0; iCell<nCells; ++iCell) {
975  Short_t cellId = fCaloCells->GetCellNumber(iCell);
976  Double_t cellE = fCaloCells->GetCellAmplitude(cellId);
977  Double_t cellT = fCaloCells->GetCellTime(cellId);
978  TVector3 pos;
979  fGeom->GetGlobal(cellId, pos);
980  TLorentzVector lv(pos,cellE);
981  Double_t cellEta = lv.Eta();
982  Double_t cellPhi = lv.Phi();
983  if(cellPhi<0.) cellPhi+=TMath::TwoPi();
984  if(cellPhi>TMath::TwoPi()) cellPhi-=TMath::TwoPi();
985 
986  AliDebug(2,Form("cell energy = %f time = %f",cellE,cellT*1e9));
987  fh2CellEnergyVsTime->Fill(cellE,cellT*1e9);
988  fh3EEtaPhiCell->Fill(cellE,cellEta,cellPhi);
989  fh2ECellVsCent->Fill(fCent,cellE);
990  }
991  }
992 
993  return kTRUE;
994 }
995 
996 //________________________________________________________________________
998  // Run analysis code here, if needed. It will be executed before FillHistograms().
999  fhTriggerbit->Fill(0.5,GetCollisionCandidates());
1000 
1001  // just in case, set the geometry scheme
1002  fGeom = AliEMCALGeometry::GetInstance("EMCAL_COMPLETEV1");
1003 
1004  //Check if event is selected (vertex & pile-up)
1005  //if(!SelectEvent()) return kFALSE;
1006 
1007  // when we have the patch object to match, peform analysis
1009 
1010  return kTRUE; // If return kFALSE FillHistogram() will NOT be executed.
1011 }
1012 
1013 //_______________________________________________________________________
1015  // Called once at the end of the analysis.
1016 }
1017 
1018 //________________________________________________________________________
1020  //Get energy of leading cell in cluster
1021  if(!fCaloCells) return -1;
1022 
1023  Double_t emax = -1.;
1024  Int_t iCellAbsIdMax = -1;
1025  Int_t nCells = clus->GetNCells();
1026  for(Int_t i = 0; i<nCells; i++) {
1027  Int_t absId = clus->GetCellAbsId(i);
1028  Double_t cellE = fCaloCells->GetCellAmplitude(absId);
1029  if(cellE>emax) {
1030  emax = cellE;
1031  iCellAbsIdMax = absId;
1032  }
1033  }
1034  return iCellAbsIdMax;
1035 }
1036 
1037 //________________________________________________________________________
1039  //Get energy of leading cell in cluster
1040  if(!fCaloCells) return -1.;
1041 
1042  Int_t absID = GetLeadingCellId(clus);
1043  if(absID>-1) return fCaloCells->GetCellAmplitude(absID);
1044  else return -1.;
1045 }
1046 
1047 //________________________________________________________________________
1049  //Get Ecross = sum of energy of neighbouring cells (using uncalibrated energy)
1050  if(!fCaloCells) return -1.;
1051 
1052  Double_t ecross = -1.;
1053 
1054  Int_t absID1 = -1;
1055  Int_t absID2 = -1;
1056  Int_t absID3 = -1;
1057  Int_t absID4 = -1;
1058 
1059  Int_t imod = -1, iphi =-1, ieta=-1, iTower = -1, iIphi = -1, iIeta = -1;
1060  fGeom->GetCellIndex(absID,imod,iTower,iIphi,iIeta);
1061  fGeom->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,iphi,ieta);
1062 
1063  if( iphi < AliEMCALGeoParams::fgkEMCALRows-1)
1064  absID1 = fGeom->GetAbsCellIdFromCellIndexes(imod, iphi+1, ieta);
1065  if( iphi > 0 )
1066  absID2 = fGeom->GetAbsCellIdFromCellIndexes(imod, iphi-1, ieta);
1067 
1068  if( ieta == AliEMCALGeoParams::fgkEMCALCols-1 && !(imod%2) ) {
1069  absID3 = fGeom->GetAbsCellIdFromCellIndexes(imod+1, iphi, 0);
1070  absID4 = fGeom->GetAbsCellIdFromCellIndexes(imod, iphi, ieta-1);
1071  }
1072  else if( ieta == 0 && imod%2 ) {
1073  absID3 = fGeom->GetAbsCellIdFromCellIndexes(imod, iphi, ieta+1);
1074  absID4 = fGeom->GetAbsCellIdFromCellIndexes(imod-1, iphi, AliEMCALGeoParams::fgkEMCALCols-1);
1075  }
1076  else {
1077  if( ieta < AliEMCALGeoParams::fgkEMCALCols-1 )
1078  absID3 = fGeom->GetAbsCellIdFromCellIndexes(imod, iphi, ieta+1);
1079  if( ieta > 0 )
1080  absID4 = fGeom->GetAbsCellIdFromCellIndexes(imod, iphi, ieta-1);
1081  }
1082 
1083  Double_t ecell1 = fCaloCells->GetCellAmplitude(absID1);
1084  Double_t ecell2 = fCaloCells->GetCellAmplitude(absID2);
1085  Double_t ecell3 = fCaloCells->GetCellAmplitude(absID3);
1086  Double_t ecell4 = fCaloCells->GetCellAmplitude(absID4);
1087 
1088  ecross = ecell1+ecell2+ecell3+ecell4;
1089 
1090  return ecross;
1091 }
1092 
1093 //_________________________________________________________________________
1094 Float_t AliAnalysisTaskEmcalTriggerPatchClusterMatch::RelativeEP(Double_t objAng, Double_t EPAng) const {
1095  // function to calculate angle between object and EP in the 1st quadrant (0,Pi/2)
1096  Double_t dphi = EPAng - objAng;
1097 
1098  if( dphi<-1*TMath::Pi() )
1099  dphi = dphi + 1*TMath::Pi();
1100  if( dphi>1*TMath::Pi())
1101  dphi = dphi - 1*TMath::Pi();
1102 
1103  if( (dphi>0) && (dphi<1*TMath::Pi()/2) ){
1104  // Do nothing! we are in quadrant 1
1105  }else if( (dphi>1*TMath::Pi()/2) && (dphi<1*TMath::Pi()) ){
1106  dphi = 1*TMath::Pi() - dphi;
1107  }else if( (dphi<0) && (dphi>-1*TMath::Pi()/2) ){
1108  dphi = fabs(dphi);
1109  }else if( (dphi<-1*TMath::Pi()/2) && (dphi>-1*TMath::Pi()) ){
1110  dphi = dphi + 1*TMath::Pi();
1111  }
1112 
1113  return dphi; // dphi in [0, Pi/2]
1114 }
1115 
1116 TH1* AliAnalysisTaskEmcalTriggerPatchClusterMatch::FillTriggerPatchQA(TH1* h, UInt_t trig, AliEmcalTriggerPatchInfo *fPatch) {
1117  // check and fill a QA histogram
1118  if(fPatch->IsLevel0()) h->Fill(1);
1119  if(fPatch->IsJetLow()) h->Fill(2);
1120  if(fPatch->IsJetHigh()) h->Fill(3);
1121  if(fPatch->IsGammaLow()) h->Fill(4);
1122  if(fPatch->IsGammaHigh()) h->Fill(5);
1123  if(fPatch->IsMainTrigger()) h->Fill(6);
1124  if(fPatch->IsJetLowSimple()) h->Fill(7);
1125  if(fPatch->IsJetHighSimple()) h->Fill(8);
1126  if(fPatch->IsGammaLowSimple()) h->Fill(9);
1127  if(fPatch->IsGammaHighSimple()) h->Fill(10);
1128  if(fPatch->IsMainTriggerSimple()) h->Fill(11);
1129  if(fPatch->IsOfflineSimple()) h->Fill(12);
1130  if(fPatch->IsRecalcJet()) h->Fill(13);
1131  if(fPatch->IsRecalcGamma()) h->Fill(14);
1132  if(trig & AliVEvent::kEMCEJE) h->Fill(19);
1133  if(trig & AliVEvent::kEMCEGA) h->Fill(20);
1134 
1135  h->GetXaxis()->SetBinLabel(1, "Level0");
1136  h->GetXaxis()->SetBinLabel(2, "JetLow");
1137  h->GetXaxis()->SetBinLabel(3, "JetHigh");
1138  h->GetXaxis()->SetBinLabel(4, "GammaLow");
1139  h->GetXaxis()->SetBinLabel(5, "GammaHigh");
1140  h->GetXaxis()->SetBinLabel(6, "MainTrigger");
1141  h->GetXaxis()->SetBinLabel(7, "JetLowSimple");
1142  h->GetXaxis()->SetBinLabel(8, "JetHighSimple");
1143  h->GetXaxis()->SetBinLabel(9, "GammaLowSimple");
1144  h->GetXaxis()->SetBinLabel(10, "GammaHighSimple");
1145  h->GetXaxis()->SetBinLabel(11, "MainTriggerSimple");
1146  h->GetXaxis()->SetBinLabel(12, "OfflineSimple");
1147  h->GetXaxis()->SetBinLabel(13, "RecalcJet");
1148  h->GetXaxis()->SetBinLabel(14, "RecalcGamma");
1149  h->GetXaxis()->SetBinLabel(15, "");
1150  h->GetXaxis()->SetBinLabel(16, "");
1151  h->GetXaxis()->SetBinLabel(17, "");
1152  h->GetXaxis()->SetBinLabel(18, "");
1153  h->GetXaxis()->SetBinLabel(19, "kEMCEJE");
1154  h->GetXaxis()->SetBinLabel(20, "kEMCEGA");
1155 
1156  // set x-axis labels vertically
1157  //h->LabelsOption("v");
1158  //h->LabelsDeflate("X");
1159 
1160  return h;
1161 }
1162 
1163 Bool_t AliAnalysisTaskEmcalTriggerPatchClusterMatch::CorrelateToTrigger(Double_t etaclust, Double_t phiclust, TList *triggerpatches) const {
1164  Bool_t hasfound = kFALSE;
1165  for(TIter patchIter = TIter(triggerpatches).Begin(); patchIter != TIter::End(); ++patchIter){
1166  AliEmcalTriggerPatchInfo *mypatch = static_cast<AliEmcalTriggerPatchInfo *>(*patchIter);
1167  Double_t etamin = TMath::Min(mypatch->GetEtaMin(), mypatch->GetEtaMax()),
1168  etamax = TMath::Max(mypatch->GetEtaMin(), mypatch->GetEtaMax()),
1169  phimin = TMath::Min(mypatch->GetPhiMin(), mypatch->GetPhiMax()),
1170  phimax = TMath::Max(mypatch->GetPhiMin(), mypatch->GetPhiMax());
1171  if(etaclust > etamin && etaclust < etamax && phiclust > phimin && phiclust < phimax){
1172  hasfound = kTRUE;
1173  break;
1174  }
1175  }
1176  return hasfound;
1177 }
1178 
1180  // check and fill a Event Selection QA histogram for different trigger selections after cuts
1181  if(trig == 0) h->Fill(1);
1182  if(trig & AliVEvent::kAny) h->Fill(2);
1183  if(trig & AliVEvent::kAnyINT) h->Fill(3);
1184  if(trig & AliVEvent::kMB) h->Fill(4);
1185  if(trig & AliVEvent::kINT7) h->Fill(5);
1186  if(trig & AliVEvent::kEMC1) h->Fill(6);
1187  if(trig & AliVEvent::kEMC7) h->Fill(7);
1188  if(trig & AliVEvent::kEMC8) h->Fill(8);
1189  if(trig & AliVEvent::kEMCEJE) h->Fill(9);
1190  if(trig & AliVEvent::kEMCEGA) h->Fill(10);
1191  if(trig & AliVEvent::kCentral) h->Fill(11);
1192  if(trig & AliVEvent::kSemiCentral) h->Fill(12);
1193  if(trig & AliVEvent::kINT8) h->Fill(13);
1194 
1195  if(trig & (AliVEvent::kEMCEJE | AliVEvent::kMB)) h->Fill(14);
1196  if(trig & (AliVEvent::kEMCEGA | AliVEvent::kMB)) h->Fill(15);
1197  if(trig & (AliVEvent::kAnyINT | AliVEvent::kMB)) h->Fill(16);
1198 
1199  if(trig & (AliVEvent::kEMCEJE & (AliVEvent::kMB | AliVEvent::kCentral | AliVEvent::kSemiCentral))) h->Fill(17);
1200  if(trig & (AliVEvent::kEMCEGA & (AliVEvent::kMB | AliVEvent::kCentral | AliVEvent::kSemiCentral))) h->Fill(18);
1201  if(trig & (AliVEvent::kAnyINT & (AliVEvent::kMB | AliVEvent::kCentral | AliVEvent::kSemiCentral))) h->Fill(19);
1202 
1203  // label bins of the analysis trigger selection summary
1204  h->GetXaxis()->SetBinLabel(1, "no trigger");
1205  h->GetXaxis()->SetBinLabel(2, "kAny");
1206  h->GetXaxis()->SetBinLabel(3, "kAnyINT");
1207  h->GetXaxis()->SetBinLabel(4, "kMB");
1208  h->GetXaxis()->SetBinLabel(5, "kINT7");
1209  h->GetXaxis()->SetBinLabel(6, "kEMC1");
1210  h->GetXaxis()->SetBinLabel(7, "kEMC7");
1211  h->GetXaxis()->SetBinLabel(8, "kEMC8");
1212  h->GetXaxis()->SetBinLabel(9, "kEMCEJE");
1213  h->GetXaxis()->SetBinLabel(10, "kEMCEGA");
1214  h->GetXaxis()->SetBinLabel(11, "kCentral");
1215  h->GetXaxis()->SetBinLabel(12, "kSemiCentral");
1216  h->GetXaxis()->SetBinLabel(13, "kINT8");
1217  h->GetXaxis()->SetBinLabel(14, "kEMCEJE or kMB");
1218  h->GetXaxis()->SetBinLabel(15, "kEMCEGA or kMB");
1219  h->GetXaxis()->SetBinLabel(16, "kAnyINT or kMB");
1220  h->GetXaxis()->SetBinLabel(17, "kEMCEJE & (kMB or kCentral or kSemiCentral)");
1221  h->GetXaxis()->SetBinLabel(18, "kEMCEGA & (kMB or kCentral or kSemiCentral)");
1222  h->GetXaxis()->SetBinLabel(19, "kAnyINT & (kMB or kCentral or kSemiCentral)");
1223 
1224  // set x-axis labels vertically
1225  h->LabelsOption("v");
1226  //h->LabelsDeflate("X");
1227 
1228  return h;
1229 }
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