AliPhysics  a9863a5 (a9863a5)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliAnalysisTaskEmcalJetHF.cxx
Go to the documentation of this file.
1 // $Id$
2 /****************************************************************************
3 * Copyright(c) 1998-2015, ALICE Experiment at CERN, All rights reserved. *
4 * *
5 * Author: The ALICE Off-line Project. *
6 * Contributors are mentioned in the code where appropriate. *
7 * *
8 * Permission to use, copy, modify and distribute this software and its *
9 * documentation strictly for non-commercial purposes is hereby granted *
10 * without fee, provided that the above copyright notice appears in all *
11 * copies and that both the copyright notice and this permission notice *
12 * appear in the supporting documentation. The authors make no claims *
13 * about the suitability of this software for any purpose. It is *
14 * provided "as is" without express or implied warranty. *
15 ****************************************************************************/
17 // Task to tag HFE Jets using the EMCal
18 // Andrew Castro (UTK)
19 // andrew.john.castro@cern.ch
22 // general ROOT includes
23 #include <TCanvas.h>
24 #include <TChain.h>
25 #include <TMath.h>
26 #include <TProfile.h>
27 #include <TAxis.h>
28 #include <TClonesArray.h>
29 #include <TH1F.h>
30 #include <TH2F.h>
31 #include <TH3F.h>
32 #include <THnSparse.h>
33 #include <TList.h>
34 #include <TLorentzVector.h>
35 #include <TParameter.h>
36 #include <TParticle.h>
37 #include <TTree.h>
38 #include <TVector3.h>
39 #include <TObjArray.h>
40 // AliROOT includes
41 #include "AliAODEvent.h"
42 #include "AliESDEvent.h"
43 #include "AliAnalysisManager.h"
44 #include "AliAnalysisTask.h"
45 #include "AliCentrality.h"
46 #include "AliEmcalJet.h"
47 #include "AliAODJet.h"
48 #include "AliVCluster.h"
49 #include "AliVTrack.h"
50 #include <AliVEvent.h>
51 #include <AliVParticle.h>
52 #include "AliRhoParameter.h"
53 #include "AliLog.h"
54 #include "AliJetContainer.h"
55 #include "AliParticleContainer.h"
56 #include "AliClusterContainer.h"
57 #include "AliEmcalParticle.h"
58 #include "AliESDCaloCluster.h"
59 #include <AliESDtrackCuts.h>
60 #include "AliPID.h"
61 #include "AliTPCdEdxInfo.h"
62 #include "AliEMCALTriggerPatchInfo.h"
63 #include "AliVVZERO.h"
64 #include "AliAnalysisTaskEmcal.h"
65 #include <AliInputEventHandler.h>
66 #include <AliVEventHandler.h>
68 #include "AliAODHandler.h"
69 #include "AliESDInputHandler.h"
70 #include "AliPicoTrack.h"
71 #include "AliEventPoolManager.h"
72 #include "AliAODTrack.h"
73 #include "AliESDtrack.h"
74 // PID includes
75 #include "AliPIDResponse.h"
76 #include "AliTPCPIDResponse.h"
77 #include "AliESDpid.h"
78 // magnetic field includes
79 #include "TGeoGlobalMagField.h"
80 #include "AliMagF.h"
81 
82 using std::cout;
83 using std::endl;
84 
86 
87 //________________________________________________________________________
89  AliAnalysisTaskEmcalJet("heavyF",kFALSE),
90  event(0),
91  fFillHists(0),
92  fEventTrigEMCALL1Gamma1(0),
93  fEventTrigEMCALL1Gamma2(0),
94  fGlobalQA(0),
95  fJetPID(0),
96  fInputEvent(0x0),
97  fCuts(0),
98  fPhimin(-10), fPhimax(10),
99  fEtamin(-0.9), fEtamax(0.9),
100  fAreacut(0.0),
101  fJetHIpt(20.0),
102  fTrackPtCut(2.0),
103  fTrackEta(0.9),
104  fTrkQAcut(0),
105  fM02max(0.35),
106  fM02min(0.006),
107  fesdTrackCuts(0),
108  fPIDResponse(0x0), fTPCResponse(),
109  fEsdtrackCutsITSTPC(),
110  fEsdtrackCutsTPC(),
111  fEsdtrackCutsITS(),
112  fJetsCont(0), fTracksCont(0), fCaloClustersCont(0), fTracksJetCont(0), fCaloClustersJetCont(0),
113  fESD(0), fAOD(0),
114  fMaxPatch(0),
115  fhnTriggerInfo(0),
116  fMainPatchType(kManual),
117  //fMainPatchType(kEmcalJet),
118  fMainTrigCat(kTriggerLevel0),
119  //fMainTrigCat(kTriggerLevel1Gamma),
120  //fMainTrigCat(kTriggerRecalcJet), // Recalculated max trigger patch; does not need to be above trigger threshold
121  //fMainTrigCat(kTriggerRecalcGamma),
122  fMainTrigSimple(kTRUE),
123  fHistTriggerBitInfo(0),
124  fHistMaxTriggerBitInfo(0),
125  fHistEventSelection(0),
126  fHistRecalcGASize(0),
127  fHistRecalcGAEnergy(0),
128  fHistCorrJetEvsPatchE(0),
129  fHistClusEvPatchE(0),
130  fHistdEtaPatchvdPhiPatch(0),
131  fHistRawJetEvPatchE(0),
132  fHistMatchedClusJet(0),
133  fhnTrackClusterQA(0x0), fhnPIDHFTtoC(0x0), fhnJetTrigger(0x0)
134 {
135  SetMakeGeneralHistograms(kTRUE);
136 }
137 
138 //________________________________________________________________________
140  AliAnalysisTaskEmcalJet(name,kTRUE),
141  event(0),
142  fFillHists(0),
143  fEventTrigEMCALL1Gamma1(0),
144  fEventTrigEMCALL1Gamma2(0),
145  fGlobalQA(0),
146  fJetPID(0),
147  fInputEvent(0x0),
148  fCuts(0),
149  fPhimin(-10), fPhimax(10),
150  fEtamin(-0.9), fEtamax(0.9),
151  fAreacut(0.0),
152  fJetHIpt(20.0),
153  fTrackPtCut(2.0),
154  fTrackEta(0.9),
155  fTrkQAcut(0),
156  fM02max(0.35),
157  fM02min(0.006),
158  fesdTrackCuts(0),
159  fPIDResponse(0x0), fTPCResponse(),
160  fEsdtrackCutsITSTPC(),
161  fEsdtrackCutsTPC(),
162  fEsdtrackCutsITS(),
163  fJetsCont(0), fTracksCont(0), fCaloClustersCont(0), fTracksJetCont(0), fCaloClustersJetCont(0),
164  fESD(0), fAOD(0),
165  fMaxPatch(0),
166  fhnTriggerInfo(0),
167  fMainPatchType(kManual),
168  //fMainPatchType(kEmcalJet),
169  fMainTrigCat(kTriggerLevel0),
170  //fMainTrigCat(kTriggerLevel1Gamma),
171  //fMainTrigCat(kTriggerRecalcJet), // Recalculated max trigger patch; does not need to be above trigger threshold
172  //fMainTrigCat(kTriggerRecalcGamma),
173  fMainTrigSimple(kTRUE),
174  fHistTriggerBitInfo(0),
175  fHistMaxTriggerBitInfo(0),
176  fHistEventSelection(0),
177  fHistRecalcGASize(0),
178  fHistRecalcGAEnergy(0),
179  fHistCorrJetEvsPatchE(0),
180  fHistClusEvPatchE(0),
181  fHistdEtaPatchvdPhiPatch(0),
182  fHistRawJetEvPatchE(0),
183  fHistMatchedClusJet(0),
184  fhnTrackClusterQA(0x0), fhnPIDHFTtoC(0x0), fhnJetTrigger(0x0)
185 {
187  DefineInput(0,TChain::Class());
188  DefineOutput(1, TList::Class());
189 }
190 //_______________________________________________________________________
192 {
193  // destructor
194  if (fOutput) {
195  delete fOutput;
196  fOutput = 0;
197  }
198 }
199 //________________________________________________________________________
201 {
202  if (! fCreateHisto) return;
204  //fJetsCont = GetJetContainer(0);
205  //if(fJetsCont) { //get particles and clusters connected to jets
206  // fTracksJetCont = fJetsCont->GetParticleContainer();
207  // fCaloClustersJetCont = fJetsCont->GetClusterContainer();
208  //}
209  //else { //no jets, just analysis tracks and clusters
212 //}
213  fTracksCont->SetClassName("AliVTrack");
214  fCaloClustersCont->SetClassName("AliVCluster");
215  TString histname;
216  TString name;
217  TString title;
218 
219  if(fFillHists>0){
220  fHistMatchedClusJet = new TH1F("MatchedGAClusterEE","ClusterEE; Energy (GeV)",100,0,100);
221  fHistCorrJetEvsPatchE = new TH2F("Corr Jet E vs Trigger Patch E","CorrJetEvTriggerE; Corrected Jet Energy (GeV); Patch Energy (GeV)",100,0,100,100,0,100);
222  fHistClusEvPatchE = new TH2F("ClusterEvPatchE","Cluster Energy v Patch E; Cluster Energy (GeV); Patch Energy (GeV)",100,0,100,100,0,100);
223  fHistdEtaPatchvdPhiPatch = new TH2F("dEtaPatchdPhiPatch; #eta; #phi","dEtaPatchdPhiPatch; #Delta#eta; #Delta#phi ",100,-0.1,0.1,100,-0.1,0.1);
224  fHistRawJetEvPatchE = new TH2F("RaeJetEvTriggerE","RawJetEvTriggerE; Jet Energy (GeV); Patch Energy (GeV)",100,0,100,100,0,100);
225  fHistTriggerBitInfo = new TH1F("TriggerBitInfo","TriggerBitInfo; ; Counts",15,0.5,15.5);
226  fHistMaxTriggerBitInfo = new TH1F("MaxPatchTriggerInfo","MaxPatchTriggerInfo; ;Counts",15,0.5,15.5);
227  fHistEventSelection = new TH1F("EventSelectionQA","EventSelectionQA",17,0.5,17.5);
228  fHistRecalcGASize = new TH2F("RecalcGAPatchSize","Patch_Size; #eta(Towers); #phi(Towers)",40,0,40,40,0,40);
229  fHistRecalcGAEnergy = new TH1F("ReclacGAEnergy","RecalcGAEnergy; Energy(GeV); Counts",150,0,150);
230 
231  fHistTriggerBitInfo->GetXaxis()->SetBinLabel(1,"IsLevel0");
232  fHistTriggerBitInfo->GetXaxis()->SetBinLabel(2,"IsJetlow");
233  fHistTriggerBitInfo->GetXaxis()->SetBinLabel(3,"IsJetHigh");
234  fHistTriggerBitInfo->GetXaxis()->SetBinLabel(4,"IsGammalow");
235  fHistTriggerBitInfo->GetXaxis()->SetBinLabel(5,"IsGammaHigh");
236  fHistTriggerBitInfo->GetXaxis()->SetBinLabel(6,"IsMainTrigger");
237  fHistTriggerBitInfo->GetXaxis()->SetBinLabel(7,"IsJetLowSimple");
238  fHistTriggerBitInfo->GetXaxis()->SetBinLabel(8,"IsJetHighSimple");
239  fHistTriggerBitInfo->GetXaxis()->SetBinLabel(9,"IsGammaLowSimple");
240  fHistTriggerBitInfo->GetXaxis()->SetBinLabel(10,"IsGammaHighSimple");
241  fHistTriggerBitInfo->GetXaxis()->SetBinLabel(11,"IsMainTriggerSimple");
242  fHistTriggerBitInfo->GetXaxis()->SetBinLabel(12,"IsOfflineSimple");
243  fHistTriggerBitInfo->GetXaxis()->SetBinLabel(13,"IsRecalcJet");
244  fHistTriggerBitInfo->GetXaxis()->SetBinLabel(14,"IsRecalcGamma");
245 
246  fHistMaxTriggerBitInfo->GetXaxis()->SetBinLabel(1,"IsLevel0");
247  fHistMaxTriggerBitInfo->GetXaxis()->SetBinLabel(2,"IsJetlow");
248  fHistMaxTriggerBitInfo->GetXaxis()->SetBinLabel(3,"IsJetHigh");
249  fHistMaxTriggerBitInfo->GetXaxis()->SetBinLabel(4,"IsGammalow");
250  fHistMaxTriggerBitInfo->GetXaxis()->SetBinLabel(5,"IsGammaHigh");
251  fHistMaxTriggerBitInfo->GetXaxis()->SetBinLabel(6,"IsMainTrigger");
252  fHistMaxTriggerBitInfo->GetXaxis()->SetBinLabel(7,"IsJetLowSimple");
253  fHistMaxTriggerBitInfo->GetXaxis()->SetBinLabel(8,"IsJetHighSimple");
254  fHistMaxTriggerBitInfo->GetXaxis()->SetBinLabel(9,"IsGammaLowSimple");
255  fHistMaxTriggerBitInfo->GetXaxis()->SetBinLabel(10,"IsGammaHighSimple");
256  fHistMaxTriggerBitInfo->GetXaxis()->SetBinLabel(11,"IsMainTriggerSimple");
257  fHistMaxTriggerBitInfo->GetXaxis()->SetBinLabel(12,"IsOfflineSimple");
258  fHistMaxTriggerBitInfo->GetXaxis()->SetBinLabel(13,"IsRecalcJet");
259  fHistMaxTriggerBitInfo->GetXaxis()->SetBinLabel(14,"IsRecalcGamma");
260 
261  fHistEventSelection->GetXaxis()->SetBinLabel(1,"AliVEvent::kMB");
262  fHistEventSelection->GetXaxis()->SetBinLabel(2,"AliVEvent::kINT7");
263  fHistEventSelection->GetXaxis()->SetBinLabel(3,"AliVEvent::kHighMult");
264  fHistEventSelection->GetXaxis()->SetBinLabel(4,"AliVEvent::kEMC1");
265  fHistEventSelection->GetXaxis()->SetBinLabel(5,"AliVEvent::kCINT5");
266  fHistEventSelection->GetXaxis()->SetBinLabel(6,"AliVEvent::kEMC7");
267  fHistEventSelection->GetXaxis()->SetBinLabel(7,"AliVEvent::kEMC8");
268  fHistEventSelection->GetXaxis()->SetBinLabel(8,"AliVEvent::kEMCEJE");
269  fHistEventSelection->GetXaxis()->SetBinLabel(9,"AliVEvent::kEMCEGA");
270  fHistEventSelection->GetXaxis()->SetBinLabel(10,"AliVEvent::kCentral");
271  fHistEventSelection->GetXaxis()->SetBinLabel(11,"AliVEvent::kSemiCentral");
272  fHistEventSelection->GetXaxis()->SetBinLabel(12,"AliVEvent::kZED");
273  fHistEventSelection->GetXaxis()->SetBinLabel(13,"AliVEvent::kINT8");
274  fHistEventSelection->GetXaxis()->SetBinLabel(14,"AliVEvent::kFastOnly");
275  fHistEventSelection->GetXaxis()->SetBinLabel(15,"AliVEvent::kAnyINT");
276  fHistEventSelection->GetXaxis()->SetBinLabel(16,"AliVEvent::kAny");
277 
278  const Int_t fgkNCentBins = 21;
279  Float_t kMinCent = 0.;
280  Float_t kMaxCent = 105.;
281  const Int_t fgkNVZEROBins = 100;
282  Float_t kMinVZERO = 0.;
283  Float_t kMaxVZERO = 25000;
284  const Int_t fgkNEPatch = 100;
285  Float_t kMinEPatch = 0.;
286  Float_t kMaxEPatch = 200.;
287  const Int_t fgkNADC = 100;
288  Float_t kMinADC = 0.;
289  Float_t kMaxADC = 1500.;
290  const Int_t fgkNEta = 10;
291  const Int_t fgkNPhi = 10;
292  const Int_t nDim = 8;//cent;V0mult;ptjet1;ptjet2;Epatch;ADCpatch;EtaPatch;PhiPatch
293  const Int_t nBins[nDim] = {fgkNCentBins,fgkNVZEROBins,fgkNEta,fgkNPhi,fgkNEPatch,fgkNADC,fgkNEta,fgkNPhi};
294  const Double_t xmin0[nDim] = {kMinCent,kMinVZERO,-0.7,1.4,kMinEPatch,kMinADC,-0.7,1.4};
295  const Double_t xmax0[nDim] = {kMaxCent,kMaxVZERO,0.7,3.14,kMaxEPatch,kMaxADC, 0.7,3.14};
296  //Trigger QA sparse in here for debugging purposes
297  fhnTriggerInfo = new THnSparseF("fhnTriggerInfo", "hnTriggerInfo;cent;V0mult;EtaPatchCM;PhiPatchCM;Epatch;ADCpatch;EtaPatchGeo;PhiPatchGEo",nDim,nBins,xmin0,xmax0);
298 
299  fOutput->Add(fhnTriggerInfo);
310 
311  }//Fill Histograms
312 
313  // ****************************** PID *****************************************************
314  // set up PID handler
315  AliAnalysisManager *man=AliAnalysisManager::GetAnalysisManager();
316  AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
317  if(!inputHandler) {
318  AliFatal("Input handler needed");
319  return;
320  }
321 
322  // PID response object
323  //fPIDResponse = (AliPIDResponse*)inputHandler->GetPIDResponse();
324  // inputHandler->CreatePIDResponse(fIsMC); // needed to create object, why though?
325  fPIDResponse = inputHandler->GetPIDResponse();
326  if (!fPIDResponse) {
327  AliError("PIDResponse object was not created");
328  return;
329  }
330  // ****************************************************************************************
331  UInt_t bitcoded3 = 0; // bit coded, see GetDimParamsPID() below
332  bitcoded3 = 1<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<5 | 1<<8 | 1<<9 | 1<<10 | 1<<15 | 1<<16 | 1<<17;
333  fhnTrackClusterQA = NewTHnSparseDHF("fhnTrackClusterQA", bitcoded3);
334 
335  UInt_t bitcoded7 = 0; // bit coded, see GetDimParamsPID() below
336  bitcoded7 = 1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<5 | 1<<6 | 1<<7 | 1<<8 | 1<<9 | 1<<10 | 1<<11 | 1<<12 | 1<<13| 1<<14 | 1<<15 | 1<<16 | 1<<17;
337  fhnPIDHFTtoC = NewTHnSparseDHF("fhnPIDHFTtoC", bitcoded7);
338 
339  UInt_t bitcoded8 = 0;
340  bitcoded8 = 1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<5 | 1<<6 | 1<<7 | 1<<8 | 1<<9 | 1<<10 | 1<<11 | 1<<12 | 1<<13 | 1<<14 | 1<<15 | 1<<16 | 1<<17;
341  fhnJetTrigger = NewTHnSparseDJetTrigger("fhnJetTrigger", bitcoded8);
342 
343  if(fJetPID>0) fOutput->Add(fhnPIDHFTtoC);
344  if(fJetPID>0) fOutput->Add(fhnJetTrigger);
345  if(fGlobalQA>0) fOutput->Add(fhnTrackClusterQA);
346  PostData(1, fOutput);
347 }
348 //________________________________________________________
350 {
351  // Initialize the analysis
353 
354  if (fJetsCont && fJetsCont->GetArray() == 0) fJetsCont = 0;
355  if (fTracksCont && fTracksCont->GetArray() == 0) fTracksCont = 0;
357 
358 
359 } // end of ExecOnce
360 
361 //________________________________________________________________________
363 {
364  // check to see if we have any tracks
365  if (!fTracks) return kTRUE;
366  if (!fJets) return kTRUE;
367 
368  UInt_t trig = ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
369  if(fFillHists>0) if(trig & AliVEvent::kMB) fHistEventSelection->Fill(1);
370  if(fFillHists>0) if(trig & AliVEvent::kINT7) fHistEventSelection->Fill(2);
371  if(fFillHists>0) if(trig & AliVEvent::kHighMult) fHistEventSelection->Fill(3);
372  if(fFillHists>0) if(trig & AliVEvent::kEMC1) fHistEventSelection->Fill(4);
373  if(fFillHists>0) if(trig & AliVEvent::kCINT5) fHistEventSelection->Fill(5);
374  if(fFillHists>0) if(trig & AliVEvent::kEMC7) fHistEventSelection->Fill(6);
375  if(fFillHists>0) if(trig & AliVEvent::kEMC8) fHistEventSelection->Fill(7);
376  if(fFillHists>0) if(trig & AliVEvent::kEMCEJE) fHistEventSelection->Fill(8);
377  if(fFillHists>0) if(trig & AliVEvent::kEMCEGA) fHistEventSelection->Fill(9);
378  if(fFillHists>0) if(trig & AliVEvent::kCentral) fHistEventSelection->Fill(10);
379  if(fFillHists>0) if(trig & AliVEvent::kSemiCentral) fHistEventSelection->Fill(11);
380  if(fFillHists>0) if(trig & AliVEvent::kZED) fHistEventSelection->Fill(12);
381  if(fFillHists>0) if(trig & AliVEvent::kINT8) fHistEventSelection->Fill(13);
382  if(fFillHists>0) if(trig & AliVEvent::kFastOnly) fHistEventSelection->Fill(14);
383  if(fFillHists>0) if(trig & AliVEvent::kAnyINT) fHistEventSelection->Fill(15);
384  if(fFillHists>0) if(trig & AliVEvent::kAny) fHistEventSelection->Fill(16);
385 
386  // what kind of event do we have: AOD or ESD?
387  Bool_t useAOD;
388  if (dynamic_cast<AliAODEvent*>(InputEvent())) useAOD = kTRUE;
389  else useAOD = kFALSE;
390 
391  fEventTrigEMCALL1Gamma1 = kFALSE;
392  fEventTrigEMCALL1Gamma2 = kFALSE;
393 
394  // if we have ESD event, set up ESD object
395  if(!useAOD){
396  fESD = dynamic_cast<AliESDEvent*>(InputEvent());
397  if (!fESD) {
398  AliError(Form("ERROR: fESD not available\n"));
399  return kTRUE;
400  }
401  }
402 
403  // if we have AOD event, set up AOD object
404  if(useAOD){
405  fAOD = dynamic_cast<AliAODEvent*>(InputEvent());
406  if(!fAOD) {
407  AliError(Form("ERROR: fAOD not available\n"));
408  return kTRUE;
409  }
410  }
411 
412  Double_t MagSign;
413  Double_t MagF;
414 
415  if(!useAOD){
416  // get magnetic field info for DCA
417  MagF = fESD->GetMagneticField();
418  MagSign = 1.0;
419  if(MagF<0)MagSign = -1.0;
420  // set magnetic field
421  if (!TGeoGlobalMagField::Instance()->GetField()) {
422  AliMagF* field = new AliMagF("Maps","Maps", MagSign, MagSign, AliMagF::k5kG);
423  TGeoGlobalMagField::Instance()->SetField(field);
424  }
425  }
426 
427  if(useAOD){
428  // get magnetic field info for DCA
429  MagF = fAOD->GetMagneticField();
430  MagSign = 1.0;
431  if(MagF<0)MagSign = -1.0;
432  // set magnetic field
433  if (!TGeoGlobalMagField::Instance()->GetField()) {
434  AliMagF* field = new AliMagF("Maps","Maps", MagSign, MagSign, AliMagF::k5kG);
435  TGeoGlobalMagField::Instance()->SetField(field);
436  }
437  }
438 
439  // get centrality bin
440  Int_t centbin = GetCentBin(fCent);
441  //for pp analyses we will just use the first centrality bin
442  if (centbin == -1) centbin = 0;
443 
444  // get vertex information
445  Double_t fvertex[3]={0,0,0};
446  InputEvent()->GetPrimaryVertex()->GetXYZ(fvertex);
447  //Double_t zVtx=fvertex[2];
448 
449  // create pointer to list of input event
450  TList *list = InputEvent()->GetList();
451  if(!list) {
452  AliError(Form("ERROR: list not attached\n"));
453  return kTRUE;
454  }
455 
456  // background density
457  fRhoVal = fRho->GetVal();
458 
459  // initialize TClonesArray pointers to jets and tracks
460  TClonesArray *jets = 0;
461  //TClonesArray *tracks = 0;
462  //TClonesArray *clusters = 0;
463  //TClonesArray * clusterList = 0;
464 
465  // get Jets object
466  jets = dynamic_cast<TClonesArray*>(list->FindObject(fJets));
467  if(!jets){
468  AliError(Form("Pointer to jets %s == 0", fJets->GetName()));
469  return kTRUE;
470  } // verify existence of jets
471 
472  // get number of jets and tracks
473  const Int_t Njets = jets->GetEntries();
474  if(Njets<1) return kTRUE;
475 
476  event++;
477  if (fTracksCont) {
479  AliVTrack *track = static_cast<AliVTrack*>(fTracksCont->GetNextAcceptParticle());
480  while(track) {
481  track = static_cast<AliVTrack*>(fTracksCont->GetNextAcceptParticle());
482  }
483  }
484  if (fCaloClustersCont) {
486  AliVCluster *cluster = fCaloClustersCont->GetNextAcceptCluster();
487  while(cluster) {
488  TLorentzVector nPart;
489  cluster->GetMomentum(nPart, fVertex);
491  }
492  }
493  // Start Jet Analysis
494  // initialize jet parameters
495  Double_t GAeta = 0.0;
496  Double_t GAphi = 0.0;
497  Double_t PatchEE = 0.0;
498  Double_t VZEROAmp = (Double_t)(InputEvent()->GetVZEROData()->GetTriggerChargeA() + InputEvent()->GetVZEROData()->GetTriggerChargeC());
499  Double_t PatchEtaMax, PatchEtaMin, PatchPhiMax, PatchPhiMin, PatchAreaE, PatchAreaP;
500  // Get GA Trigger Info
501  if(fTriggerPatchInfo) {
504 
505  PatchEE = fMaxPatch->GetPatchE();
506  GAphi = fMaxPatch->GetPhiGeo();
507  GAeta = fMaxPatch->GetEtaGeo();
508  PatchEtaMax = fMaxPatch->GetEtaMax();
509  PatchEtaMin = fMaxPatch->GetEtaMin();
510  PatchPhiMax = fMaxPatch->GetPhiMax();
511  PatchPhiMin = fMaxPatch->GetPhiMin();
512  PatchAreaE = PatchEtaMax - PatchEtaMin;
513  PatchAreaP = PatchPhiMax - PatchPhiMin;
514  Double_t var[8] = {fCent, VZEROAmp, fMaxPatch->GetEtaCM(), fMaxPatch->GetPhiCM(), fMaxPatch->GetPatchE(), (Double_t)fMaxPatch->GetADCAmp(), fMaxPatch->GetEtaGeo(), fMaxPatch->GetPhiGeo() };
515 
516  if(fFillHists>0){
517  if (fMaxPatch->IsLevel0() == 1 ) fHistMaxTriggerBitInfo->Fill(1);
518  if (fMaxPatch->IsJetLow() == 1 ) fHistMaxTriggerBitInfo->Fill(2);
519  if (fMaxPatch->IsJetHigh() == 1 ) fHistMaxTriggerBitInfo->Fill(3);
520  if (fMaxPatch->IsGammaLow() == 1 ) fHistMaxTriggerBitInfo->Fill(4);
521  if (fMaxPatch->IsGammaHigh() == 1 ) fHistMaxTriggerBitInfo->Fill(5);
522  if (fMaxPatch->IsMainTrigger() == 1 ) fHistMaxTriggerBitInfo->Fill(6);
523  if (fMaxPatch->IsJetLowSimple() == 1 ) fHistMaxTriggerBitInfo->Fill(7);
524  if (fMaxPatch->IsJetHighSimple() == 1 ) fHistMaxTriggerBitInfo->Fill(8);
525  if (fMaxPatch->IsGammaLowSimple() == 1 ) fHistMaxTriggerBitInfo->Fill(9);
526  if (fMaxPatch->IsGammaHighSimple() == 1 ) fHistMaxTriggerBitInfo->Fill(10);
527  if (fMaxPatch->IsMainTriggerSimple() == 1 ) fHistMaxTriggerBitInfo->Fill(11);
528  if (fMaxPatch->IsOfflineSimple() == 1 ) fHistMaxTriggerBitInfo->Fill(12);
529  if (fMaxPatch->IsRecalcJet() == 1 ) fHistMaxTriggerBitInfo->Fill(13);
530  if (fMaxPatch->IsRecalcGamma() == 1 ) fHistMaxTriggerBitInfo->Fill(14);
531  fHistRecalcGASize->Fill(PatchAreaE/0.014, PatchAreaP/0.014);
532  fhnTriggerInfo->Fill(var);
533  fHistRecalcGAEnergy->Fill(PatchEE);
534  }//Fill Patch Histograms and Trigger QA sparse
535  }//Max Energy Patch info
536 
537  // **********************************************************************
538  // JET LOOP
539  // **********************************************************************
540  // loop over jets in the event and make appropriate cuts
541  for (Int_t iJets = 0; iJets < Njets; ++iJets) {
542  AliEmcalJet *jet = static_cast<AliEmcalJet*>(fJets->At(iJets));
543  if (!jet) continue;
544 
545  // phi of jet, constrained to 1.6 < Phi < 2.94
546  Double_t jetphi = jet->Phi(); // phi of jet
547  // apply jet cuts
548  if(!AcceptMyJet(jet)) continue;
549 
550  Int_t JetClusters = jet->GetNumberOfClusters();
551  Int_t JetTracks = jet -> GetNumberOfTracks();
552  Int_t tag = -999;
553  // Initializations and Calculations
554  Double_t jetptraw = jet->Pt(); // raw pT of jet
555  Double_t jetPt = -500; // initialize corr jet pt LOCAL
556  Double_t jetarea = -500; // initialize jet area
557  jetarea = jet->Area(); // jet area
558  jetPt = jet->Pt() - jetarea*fRhoVal; // semi-corrected pT of jet from GLOBAL rho value
559 
560  if(jet->Pt() > fJetHIpt) {
561  if(!fTracksCont || !fCaloClustersCont) continue;
562  Double_t dEdx = -99;
563  Double_t EovP = -99;
564  Double_t DCAxy = -999;
565  Double_t DCAz = -999;
566  Double_t jeteta = -999.;
567  jeteta = jet->Eta();
568  jetphi = jet->Phi();
569  //******************************Cluster Matched To Closest Track
570  //**************************************************************
571  Int_t NumbTrackContainer = -999;
572  NumbTrackContainer = fTracksCont->GetNParticles();
573  for(int iTracks = 0; iTracks <= NumbTrackContainer; iTracks++){
574  AliVTrack *AcceptedTrack =static_cast<AliVTrack*>(fTracksCont->GetParticle(iTracks));
575  if(!AcceptedTrack){
576  AliError(Form("Couldn't get AliVTrack Container %d\n", iTracks));
577  continue;
578  }
579  if(!IsJetTrack(jet,iTracks,kFALSE))continue;
580  //Get matched cluster
581  Int_t emc1 = -999;
582  emc1 = AcceptedTrack->GetEMCALcluster();//Get EMCal Cluster Matched Index
583  if(emc1 < 0) continue;
584  Int_t TPCNclus = -999, ITSNclus = -999;
585  Double_t acceptTrackP = AcceptedTrack->P();
586  Double_t acceptTrackPt = AcceptedTrack->Pt();
587  Double_t acceptTrackEta = AcceptedTrack->Eta();
588  Double_t acceptTrackPhi = AcceptedTrack->Phi();
589  Double_t nSigmaElectron_TPC_at = fPIDResponse->NumberOfSigmasTPC(AcceptedTrack,AliPID::kElectron);
590  Double_t nSigmaElectron_TOF_at = fPIDResponse->NumberOfSigmasTOF(AcceptedTrack,AliPID::kElectron);
591  Double_t dEdxat = AcceptedTrack->GetTPCsignal();
592 
593  if(!useAOD){
594  AliESDtrack *ESDacceptedTrack = static_cast<AliESDtrack*>(AcceptedTrack);
595  if(!ESDacceptedTrack){
596  AliError(Form("Couldn't get AliESDTrack %d\n", iTracks));
597  continue;
598  }
599  //ESDacceptedTrack->GetImpactParameters(DCAxy_at, DCAz_at);
600  TPCNclus = ESDacceptedTrack->GetTPCNcls();
601  ITSNclus = ESDacceptedTrack->GetITSNcls();
602  }
603  if(useAOD){
604  AliAODTrack *AODacceptedTrack = static_cast<AliAODTrack*>(AcceptedTrack);
605  if(!AODacceptedTrack) continue;
606  if(!fPIDResponse) continue;
607  TPCNclus = AODacceptedTrack->GetTPCNcls();
608  ITSNclus = AODacceptedTrack->GetITSNcls();
609  // AODacceptedTrack->GetImpactParameters(DCAxy_at, DCAz_at);
610  }
611  if(fCaloClustersCont && emc1>=0) {
612  AliVCluster *clusMatch = fCaloClustersCont->GetCluster(emc1);
613  if(!clusMatch){
614  AliError(Form("Couldn't get matched AliVCluster %d\n", emc1));
615  continue;
616  }
617  Double_t m02 = -999.;
618  m02 = clusMatch->GetM02();
619  if(TPCNclus < 80) continue;
620  if(ITSNclus < 3) continue;
621  if(m02 <= fM02max && m02 >= fM02min) continue;
622  Double_t mClusterE = clusMatch->E();
623  Float_t pos_mc[3];
624  clusMatch->GetPosition(pos_mc); // Get cluster position
625  TVector3 mcp(pos_mc);
626  Double_t EovP_mc = -999;
627  EovP_mc = mClusterE/acceptTrackP;
628  if(fJetPID>0){
629  Double_t HF_tracks2[18] = {fCent, acceptTrackPt, acceptTrackP ,acceptTrackEta, acceptTrackPhi, EovP_mc, 0, 0, dEdxat,nSigmaElectron_TPC_at, nSigmaElectron_TOF_at,0 , jetPt, jet->Phi(), jet->Eta(),mClusterE,mcp.PseudoRapidity(),mcp.Phi()};
630  fhnPIDHFTtoC->Fill(HF_tracks2); // fill Sparse Histo with trigger entries
631  }
632  //Double_t minMatchedPatchEta = mcp.PseudoRapidity() - (6.0 * 0.014);
633  Double_t maxMatchedPatchEta = (7.0 * 0.014);
634  //Double_t minMatchedPatchPhi = mcp.Phi() - (6.0 * 0.014);
635  Double_t maxMatchedPatchPhi = (7.0 * 0.014);
636  Double_t mtchPosition = maxMatchedPatchPhi * maxMatchedPatchPhi + maxMatchedPatchEta * maxMatchedPatchEta;
637  Double_t rGApatch = TMath::Sqrt(mtchPosition);
638  Double_t rJetCluster = -999.;
639  Double_t PatchClusterdiff = (mcp.Phi() - fMaxPatch->GetPhiGeo())*(mcp.Phi() - fMaxPatch->GetPhiGeo()) + (mcp.PseudoRapidity() - fMaxPatch->GetEtaGeo())*(mcp.PseudoRapidity() - fMaxPatch->GetEtaGeo());
640  rJetCluster = TMath::Sqrt(PatchClusterdiff);
641 
642  //Matched Trigger Jet
643  if ( rJetCluster <= rGApatch ){
644 
645  Double_t dEtaPatch = 0.0;
646  Double_t dPhiPatch = 0.0;
647  dEtaPatch = fMaxPatch->GetEtaGeo() - mcp.PseudoRapidity();
648  dPhiPatch = fMaxPatch->GetPhiGeo() - mcp.Phi();
649  Double_t EovPJetGA = mClusterE / acceptTrackP;
650  Double_t nSigmaElectron_TPC_GA = fPIDResponse->NumberOfSigmasTPC(AcceptedTrack,AliPID::kElectron);
651 
652  if(fFillHists>0){
653  fHistCorrJetEvsPatchE->Fill(jetPt,fMaxPatch->GetPatchE());
654  fHistClusEvPatchE->Fill(mClusterE,fMaxPatch->GetPatchE());
655  fHistdEtaPatchvdPhiPatch->Fill(dEtaPatch,dPhiPatch);
656  fHistRawJetEvPatchE->Fill(jetptraw,fMaxPatch->GetPatchE());
657  }//Fill Histos
658  Double_t JetTrig[18] = {jetptraw, jetPt, jeteta, jetphi, jet->E(), fMaxPatch->GetPatchE(), fMaxPatch->GetEtaGeo(), fMaxPatch->GetPhiGeo(), (Double_t)fMaxPatch->GetADCAmp(), mClusterE, mcp.PseudoRapidity(), mcp.Phi(),acceptTrackP, acceptTrackPt, acceptTrackEta, acceptTrackPhi, EovPJetGA, nSigmaElectron_TPC_GA};
659  if(fJetPID>0) fhnJetTrigger->Fill(JetTrig);
660  }//Trigger Patch Matching 'if'
661 
662  //Start HFE Tagging for seprerate analysis tasks
663  if(AcceptJetforTag(clusMatch, AcceptedTrack)){
665  jet->AddFlavourTag(tag);
666  }
667 
668  } //Cluster Matched to Track loop
669  //AcceptedTrack = static_cast<AliVTrack*>(fTracksCont->GetNextAcceptParticle());
670  } //loop over tracks from Jet
671  } // highest pt jet cut
672  } // LOOP over JETS in event
674  return kTRUE;
675 }//________________________________________________________________________End of Main Task
676 //_________________________________________________________________________________________
678 {
679  cout<<"#######################"<<endl;
680  cout<<"#### Task Finished ####"<<endl;
681  cout<<"#######################"<<endl;
682 }//________________________________________________________________________End of Terminate
683 //_________________________________________________________________________________________
685  //Find main trigger
686  if(!fTriggerPatchInfo) return;
687  //number of patches in event
688  Int_t nPatch = fTriggerPatchInfo->GetEntriesFast();
689  //extract main trigger patch
690  Double_t emax = -1.;
691  for (Int_t iPatch = 0; iPatch < nPatch; iPatch++) {
692  AliEMCALTriggerPatchInfo *patch = (AliEMCALTriggerPatchInfo*)fTriggerPatchInfo->At( iPatch );
693  if (!patch) continue;
694  if(fFillHists>0){
695  if (patch->IsLevel0() == 1 ) fHistTriggerBitInfo->Fill(1);
696  if (patch->IsJetLow() == 1 ) fHistTriggerBitInfo->Fill(2);
697  if (patch->IsJetHigh() == 1 ) fHistTriggerBitInfo->Fill(3);
698  if (patch->IsGammaLow() == 1 ) fHistTriggerBitInfo->Fill(4);
699  if (patch->IsGammaHigh() == 1 ) fHistTriggerBitInfo->Fill(5);
700  if (patch->IsMainTrigger() == 1 ) fHistTriggerBitInfo->Fill(6);
701  if (patch->IsJetLowSimple() == 1 ) fHistTriggerBitInfo->Fill(7);
702  if (patch->IsJetHighSimple() == 1 ) fHistTriggerBitInfo->Fill(8);
703  if (patch->IsGammaLowSimple() == 1 ) fHistTriggerBitInfo->Fill(9);
704  if (patch->IsGammaHighSimple() == 1 ) fHistTriggerBitInfo->Fill(10);
705  if (patch->IsMainTriggerSimple() == 1 ) fHistTriggerBitInfo->Fill(11);
706  if (patch->IsOfflineSimple() == 1 ) fHistTriggerBitInfo->Fill(12);
707  if (patch->IsRecalcGamma() == 1 ) fHistTriggerBitInfo->Fill(13);
708  }
709  if (patch->IsRecalcGamma() == 1 ){
710  if(patch->GetPatchE()>emax) {
711  fMaxPatch = patch;
712  emax = patch->GetPatchE();
713  }
714  }
715  }
716 }//___________________________________________End of Extrating Highest Energy Trigger Patch
717 //_________________________________________________________________________________________
719 {
720  if(!fTracksCont || !fCaloClustersCont) return;
721  Int_t useAOD = 1;
722  if (dynamic_cast<AliAODEvent*>(InputEvent())) useAOD = 1;
723  else useAOD = 0;
724 
725  // if we have ESD event, set up ESD object
726  if(useAOD == 0){
727  fESD = dynamic_cast<AliESDEvent*>(InputEvent());
728  if (!fESD) {
729  AliError(Form("ERROR: fESD not available\n"));
730  }
731  }
732  // if we have AOD event, set up AOD object
733  if(useAOD == 1){
734  fAOD = dynamic_cast<AliAODEvent*>(InputEvent());
735  if(!fAOD) {
736  AliError(Form("ERROR: fAOD not available\n"));
737  }
738  }
739  Double_t pQA1 = -999.;
740  Double_t nSigmaElectron_TPC_QA1 = -999.;
741  Double_t nSigmaElectron_TOF_QA1 = -999.;
742  Double_t dEdxQA1 = -999.;
743  Double_t deta = 999;
744  Double_t dphi = 999;
745  //Get closest cluster to track
747  AliVTrack *track = static_cast<AliVTrack*>(fTracksCont->GetNextAcceptParticle());
748  while(track) {
749  //if(!track) continue;
750  if(!useAOD){
751  AliESDtrack *ESDtrackQA1 = static_cast<AliESDtrack*>(track);
752  if(!ESDtrackQA1) continue;
753  if(!fPIDResponse) continue;
754  pQA1 = track->P();
755  nSigmaElectron_TPC_QA1 = fPIDResponse->NumberOfSigmasTPC(ESDtrackQA1,AliPID::kElectron);
756  nSigmaElectron_TOF_QA1 = fPIDResponse->NumberOfSigmasTOF(ESDtrackQA1,AliPID::kElectron);
757  dEdxQA1 = ESDtrackQA1->GetTPCsignal();
758  }
759  if(useAOD){
760  AliAODTrack *AODtrackQA1 = static_cast<AliAODTrack*>(track);
761  if(!AODtrackQA1) continue;
762  if(!fPIDResponse) continue;
763  pQA1 = track->P();
764  nSigmaElectron_TPC_QA1 = fPIDResponse->NumberOfSigmasTPC(AODtrackQA1,AliPID::kElectron);
765  nSigmaElectron_TOF_QA1 = fPIDResponse->NumberOfSigmasTOF(AODtrackQA1,AliPID::kElectron);
766  dEdxQA1 = AODtrackQA1->GetTPCsignal();
767  }
768  //Get matched cluster
769  Int_t emc1 = track->GetEMCALcluster();
770  if(fCaloClustersCont && emc1>=0) {
771  AliVCluster *clusMatch = fCaloClustersCont->GetCluster(emc1);
772  if(!clusMatch) continue;
773  if(clusMatch) {
774  Double_t ClusterE_QA1 = clusMatch->E();
775  Double_t EovPQA1 = ClusterE_QA1/pQA1;
776  Float_t pos_mc1[3];
777  clusMatch->GetPosition(pos_mc1); // Get cluster position
778  TVector3 mc1(pos_mc1);
779  Double_t HF_tracks3[11] = {track->Pt(), track->P() , track->Eta(), track->Phi(), EovPQA1, dEdxQA1 ,nSigmaElectron_TPC_QA1, nSigmaElectron_TOF_QA1, clusMatch->E(), mc1.PseudoRapidity(),mc1.Phi()};
780  fhnTrackClusterQA->Fill(HF_tracks3);
781  }//clus matching
782  }//matched cluster
783  track = static_cast<AliVTrack*>(fTracksCont->GetNextAcceptParticle());
784  }//track loop
785 }//________________________________________________________________________End Event QA PID
786 //_________________________________________________________________________________________
788  //applies all jet cuts except pt
789  if ((jet->Phi()<fPhimin)||(jet->Phi()>fPhimax)) return 0;
790  if ((jet->Eta()<fEtamin)||(jet->Eta()>fEtamax)) return 0;
791  if (jet->Area()<fAreacut) return 0;
792  // prevents 0 area jets from sneaking by when area cut == 0
793  if (jet->Area()==0) return 0;
794  //exclude jets with extremely high pt tracks which are likely misreconstructed
795  if(jet->MaxTrackPt()>100) return 0;
796 
797  //passed all above cuts for jet acceptance
798  return 1;
799 }//____________________________________________________________________End of Jet QA checks
800 //_________________________________________________________________________________________
801 Int_t AliAnalysisTaskEmcalJetHF::AcceptJetforTag(AliVCluster *clusMatch, AliVTrack *AcceptedTrack) {
802  Double_t EovP_tag;
803  if (AcceptedTrack->Pt() < 5) return 0;
804  EovP_tag = clusMatch->E() / AcceptedTrack->P();
805  if(EovP_tag < 0.8) return 0;
806  if(EovP_tag > 1.2) return 0;
807  // passed rough cuts for HFE stats
808  return 1;
809 }//__________________________________________________________________End of Jet HFE tagging
810 //_________________________________________________________________________________________
811 Int_t AliAnalysisTaskEmcalJetHF::GetCentBin(Double_t cent) const
812 { // Get centrality bin.
813 
814  Int_t centbin = -1;
815  if (cent>=0 && cent<10)
816  centbin = 0;
817  else if (cent>=10 && cent<20)
818  centbin = 1;
819  else if (cent>=20 && cent<30)
820  centbin = 2;
821  else if (cent>=30 && cent<40)
822  centbin = 3;
823  else if (cent>=40 && cent<50)
824  centbin = 4;
825  else if (cent>=50 && cent<90)
826  centbin = 5;
827  return centbin;
828 }//________________________________________End of Centrality Binning for Histos and pp Runs
829 //_________________________________________________________________________________________
830 THnSparse* AliAnalysisTaskEmcalJetHF::NewTHnSparseDHF(const char* name, UInt_t entries)
831 {
832  // generate new THnSparseD PID, axes are defined in GetDimParams()
833  Int_t count = 0;
834  UInt_t tmp = entries;
835  while(tmp!=0){
836  count++;
837  tmp = tmp &~ -tmp; // clear lowest bit
838  }
839  TString hnTitle(name);
840  const Int_t dim = count;
841  Int_t nbins[dim];
842  Double_t xmin[dim];
843  Double_t xmax[dim];
844  Int_t i=0;
845  Int_t c=0;
846  while(c<dim && i<32){
847  if(entries&(1<<i)){
848  TString label("");
849  GetDimParamsHF(i, label, nbins[c], xmin[c], xmax[c]);
850  hnTitle += Form(";%s",label.Data());
851  c++;
852  }
853  i++;
854  }
855  hnTitle += ";";
856  return new THnSparseD(name, hnTitle.Data(), dim, nbins, xmin, xmax);
857 }//________________________________________________________________end of NewTHnSparseF PID
858 //_________________________________________________________________________________________
859 THnSparse* AliAnalysisTaskEmcalJetHF::NewTHnSparseDJetTrigger(const char* name, UInt_t entries)
860 {
861  Int_t count = 0;
862  UInt_t tmp = entries;
863  while(tmp!=0){
864  count++;
865  tmp = tmp &~ -tmp; // clear lowest bit
866  }
867 
868  TString hnTitle(name);
869  const Int_t dim = count;
870  Int_t nbins[dim];
871  Double_t xmin[dim];
872  Double_t xmax[dim];
873  Int_t i=0;
874  Int_t c=0;
875  while(c<dim && i<32){
876  if(entries&(1<<i)){
877  TString label("");
878  GetDimParamsJetTrigger(i, label, nbins[c], xmin[c], xmax[c]);
879  hnTitle += Form(";%s",label.Data());
880  c++;
881  }
882  i++;
883  }
884  hnTitle += ";";
885  return new THnSparseD(name, hnTitle.Data(), dim, nbins, xmin, xmax);
886 }//_________________________________________________________end of NewTHnSparseF JetTrigger
887 //_________________________________________________________________________________________
888 void AliAnalysisTaskEmcalJetHF::GetDimParamsHF(Int_t iEntry, TString &label, Int_t &nbins, Double_t &xmin, Double_t &xmax)
889 {
890  // stores label and binning of axis for THnSparse
891  const Double_t pi = TMath::Pi();
892  switch(iEntry){
893 
894  case 0:
895  label = "V0 centrality (%)";
896  nbins = 10;
897  xmin = 0.;
898  xmax = 100.;
899  break;
900 
901  case 1:
902  label = "Track p_{T}";
903  nbins = 300;
904  xmin = 0.;
905  xmax = 75.;
906  break;
907 
908  case 2:
909  label = "Track p";
910  nbins = 300;
911  xmin = 0.;
912  xmax = 75.;
913  break;
914 
915  case 3:
916  label = "Track Eta";
917  nbins = 48;
918  xmin = -1.2;
919  xmax = 1.2;
920  break;
921 
922  case 4:
923  label = "Track Phi";
924  nbins = 72;
925  xmin = 0;
926  xmax = 2*pi;
927  break;
928 
929  case 5:
930  label = "E/p of track";
931  nbins = 400;
932  xmin = 0;
933  xmax = 4.0;
934  break;
935 
936  case 6:
937  label = "DCA xy";
938  nbins = 20;
939  xmin = -10;
940  xmax = 10;
941  break;
942 
943  case 7:
944  label = "DCA z";
945  nbins = 20;
946  xmin = -10;
947  xmax = 10;
948  break;
949 
950  case 8:
951  label = "dEdX of track - TPC";
952  nbins = 300;
953  xmin = 0;
954  xmax = 300;
955  break;
956 
957  case 9:
958  label = "nSigma electron TPC";
959  nbins = 50;
960  xmin = -5;
961  xmax = 5;
962  break;
963 
964  case 10:
965  label = "nSigma electron TOF";
966  nbins = 50;
967  xmin = -5;
968  xmax = 5;
969  break;
970 
971  case 11:
972  label = "nSigma electron Emcal";
973  nbins = 50;
974  xmin = -5;
975  xmax = 5;
976  break;
977 
978  case 12:
979  label = "Jet pT";
980  nbins = 40;
981  xmin = 0;
982  xmax = 200;
983  break;
984 
985  case 13:
986  label = "Jet Phi";
987  nbins = 72;
988  xmin = 0;
989  xmax = 2*pi;
990  break;
991 
992  case 14:
993  label = "Jet Eta";
994  nbins = 24;
995  xmin = -1.2;
996  xmax = 1.2;
997  break;
998 
999  case 15:
1000  label = "Cluster Energy";
1001  nbins = 150;
1002  xmin = 0;
1003  xmax = 15;
1004  break;
1005 
1006  case 16:
1007  label = "Cluster Eta";
1008  nbins = 24;
1009  xmin = -1.2;
1010  xmax = 1.2;
1011  break;
1012 
1013  case 17:
1014  label = "Cluster Phi";
1015  nbins = 72;
1016  xmin = 0;
1017  xmax = 2*pi;
1018  break;
1019 
1020  } // end of switch
1021 } //______________________________________________________________end of getting dim-params
1022 //_________________________________________________________________________________________
1023 void AliAnalysisTaskEmcalJetHF::GetDimParamsJetTrigger(Int_t iEntry, TString &label, Int_t &nbins, Double_t &xmin, Double_t &xmax)
1024 {
1025  // stores label and binning of axis for THnSparse
1026  const Double_t pi = TMath::Pi();
1027  switch(iEntry){
1028 
1029  case 0:
1030  label = "Jet Pt";
1031  nbins = 50;
1032  xmin = 0.;
1033  xmax = 250.;
1034  break;
1035 
1036  case 1:
1037  label = "Jet Corr Pt";
1038  nbins = 50;
1039  xmin = -50.;
1040  xmax = 200.;
1041  break;
1042 
1043  case 2:
1044  label = "Jet Eta";
1045  nbins = 24;
1046  xmin = -1.2;
1047  xmax = 1.2;
1048  break;
1049 
1050  case 3:
1051  label = "Jet Phi";
1052  nbins = 72;
1053  xmin = 0;
1054  xmax = 2*pi;
1055  break;
1056 
1057  case 4:
1058  label = "Jet E";
1059  nbins = 50;
1060  xmin = 0.;
1061  xmax = 250.;
1062  break;
1063 
1064  case 5:
1065  label = "Trigger E";
1066  nbins = 100;
1067  xmin = 0.;
1068  xmax = 100.;
1069  break;
1070 
1071  case 6:
1072  label = "Trigger Eta";
1073  nbins = 24;
1074  xmin = -1.2;
1075  xmax = 1.2;
1076  break;
1077 
1078  case 7:
1079  label = "Trigger Phi";
1080  nbins = 72;
1081  xmin = 0;
1082  xmax = 2*pi;
1083  break;
1084 
1085  case 8:
1086  label = "Trigger ADC";
1087  nbins = 100;
1088  xmin = 0;
1089  xmax = 1500;
1090  break;
1091 
1092  case 9:
1093  label = "Cluster E";
1094  nbins = 15;
1095  xmin = 0.;
1096  xmax = 100.;
1097  break;
1098 
1099  case 10:
1100  label = "Cluster Eta";
1101  nbins = 24;
1102  xmin = -1.2;
1103  xmax = 1.2;
1104  break;
1105 
1106  case 11:
1107  label = "Cluster Phi";
1108  nbins = 72;
1109  xmin = 0;
1110  xmax = 2*pi;
1111  break;
1112 
1113  case 12:
1114  label = "Track P";
1115  nbins = 100;
1116  xmin = 0.;
1117  xmax = 100.;
1118  break;
1119 
1120  case 13:
1121  label= "Track Pt";
1122  nbins = 100;
1123  xmin = 0.;
1124  xmax = 100.;
1125  break;
1126 
1127  case 14:
1128  label="Track Eta";
1129  nbins = 24;
1130  xmin = -1.2;
1131  xmax = 1.2;
1132  break;
1133 
1134  case 15:
1135  label = "Track Phi";
1136  nbins = 72;
1137  xmin = 0;
1138  xmax = 2*pi;
1139  break;
1140 
1141  case 16:
1142  label = "EovP_Trigger";
1143  nbins = 160;
1144  xmin = 0;
1145  xmax = 1.6;
1146  break;
1147 
1148  case 17:
1149  label = "nSigma electron TPC";
1150  nbins = 50;
1151  xmin = -5;
1152  xmax = 5;
1153 
1154  } // end of switch
1155 } //______________________________________________________________end of getting dim-params
1156 
1157 
1158 
1159 
AliEMCALTriggerPatchInfo * fMaxPatch
AOD Object.
void AddFlavourTag(Int_t tag)
Definition: AliEmcalJet.h:217
Double_t Area() const
Definition: AliEmcalJet.h:97
virtual AliVParticle * GetNextAcceptParticle()
const char * title
Definition: MakeQAPdf.C:26
virtual Int_t AcceptMyJet(AliEmcalJet *jet)
Output message at end of analysis.
virtual void GetDimParamsJetTrigger(Int_t iEntry, TString &label, Int_t &nbins, Double_t &xmin, Double_t &xmax)
virtual Int_t AcceptJetforTag(AliVCluster *clusMatch, AliVTrack *AcceptedTrack)
applies basic jet tests/cuts before accepting
virtual THnSparse * NewTHnSparseDJetTrigger(const char *name, UInt_t entries)
Double_t Eta() const
Definition: AliEmcalJet.h:88
Bool_t fJetPID
Switch to Fill General Histograms.
AliAODEvent * fAOD
ESD object.
Double_t Phi() const
Definition: AliEmcalJet.h:84
Int_t GetNParticles() const
THnSparse * fhnJetTrigger
Jet PID using track to Cluster matching.
Double_t fJetHIpt
area cut on jet
TList * list
THnSparse * fhnTrackClusterQA
correlation between jets, patch energy and event observables
TH1F * fHistMatchedClusJet
use offline trigger instead of online from AliAnalysisTaskEmcal::GetMainTriggerPatch ...
Bool_t fFillHists
Switch for all HF Electron Candidates (Non-Jet)
virtual THnSparse * NewTHnSparseDHF(const char *name, UInt_t entries)
Bool_t fGlobalQA
ESD track cuts!!
Double_t E() const
Definition: AliEmcalJet.h:86
TList * fOutput
!output list
AliPIDResponse * fPIDResponse
event number (processed)
MainPatchType fMainPatchType
main patch
Double_t fM02min
Cut on max EMCal Shower shape size for Electron ID.
AliParticleContainer * fTracksCont
Jets.
Bool_t IsJetTrack(AliEmcalJet *jet, Int_t itrack, Bool_t sorted=kFALSE) const
AliParticleContainer * GetParticleContainer(Int_t i=0) const
UShort_t GetNumberOfClusters() const
Definition: AliEmcalJet.h:105
Bool_t fEventTrigEMCALL1Gamma2
Event is L1-Gamma, threshold 1 on its name, it should correspond kEMCEGA.
TH2F * fHistdEtaPatchvdPhiPatch
Matched Cluster E vs Patch E.
EFlavourTag
Bit definition for the flavor tagging.
Definition: AliEmcalJet.h:51
AliRhoParameter * fRho
! event rho
virtual AliVParticle * GetParticle(Int_t i=-1) const
TH2F * fHistCorrJetEvsPatchE
Highest Patch Energy per event.
AliClusterContainer * GetClusterContainer(Int_t i=0) const
Double_t MaxTrackPt() const
Definition: AliEmcalJet.h:122
Double_t fCent
!event centrality
TClonesArray * GetArray() const
TH1F * fHistRecalcGAEnergy
Highest Energy GA Patch size per event (tower)
AliVCluster * GetCluster(Int_t i) const
void SetClassName(const char *clname)
TClonesArray * fJets
! jets
Manager for constants used in the trigger maker.
virtual void Terminate(Option_t *)
Double_t Pt() const
Definition: AliEmcalJet.h:76
TH2F * fHistClusEvPatchE
Corrected Jet E v Trigger Patch E.
THnSparse * fhnPIDHFTtoC
track QA sparse
TClonesArray * fTracks
!tracks
Double_t fVertex[3]
!event vertex
Bool_t fCreateHisto
whether or not create histograms
virtual Int_t GetCentBin(Double_t cent) const
Accept Jet as HFE Jet to pass along to other tasks.
void SetMakeGeneralHistograms(Bool_t g)
TClonesArray * fTriggerPatchInfo
!trigger patch info array
AliJetContainer * fJetsCont
esd track cuts for ITS stand alone tracks
Base task in the EMCAL jet framework.
Represent a jet reconstructed using the EMCal jet framework.
Definition: AliEmcalJet.h:44
AliESDEvent * fESD
JetClusters.
Generic signal 1.
Definition: AliEmcalJet.h:54
const Double_t pi
const Int_t nbins
Double_t fRhoVal
! event rho value, same for local rho
AliVCluster * GetNextAcceptCluster()
void ResetCurrentID(Int_t i=-1)
AliClusterContainer * fCaloClustersCont
Tracks.
void ExecOnce()
Get Centrality bin.
virtual void GetDimParamsHF(Int_t iEntry, TString &label, Int_t &nbins, Double_t &xmin, Double_t &xmax)
TriggerCategory fMainTrigCat
method to select main patch
Bool_t fMainTrigSimple
trigger category for main trigger from AliAnalysisTaskEmcal::GetMainTriggerPatch
Double_t fPhimin
keeper of basic cut
AliEMCALTriggerPatchInfo * GetMainTriggerPatch(TriggerCategory triggersel=kTriggerLevel1Jet, Bool_t doOfflinSimple=kFALSE)
ClassImp(AliAnalysisTaskEmcalJetHF) AliAnalysisTaskEmcalJetHF