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