AliPhysics  9b6b435 (9b6b435)
AliAnalysisTaskClusterQA.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Authors: Nicolas Schmidt *
5  * Version 1.0 *
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 
17 //---------------------------------------------
18 // Class used to create a tree for QA of clusters
19 //---------------------------------------------
21 
23 #include "TChain.h"
24 #include "TRandom.h"
25 #include "AliAnalysisManager.h"
26 #include "TParticle.h"
27 #include "TVectorF.h"
28 #include "AliPIDResponse.h"
29 #include "TFile.h"
30 #include "AliESDtrackCuts.h"
31 #include "AliAODMCParticle.h"
32 #include "AliAODMCHeader.h"
33 #include "AliAODEvent.h"
34 #include "AliMultSelection.h"
35 
36 class iostream;
37 
38 using namespace std;
39 
41 
42 //________________________________________________________________________
44  fV0Reader(NULL),
45  fV0ReaderName("V0ReaderV1"),
46  fCorrTaskSetting(""),
47  fConversionCuts(NULL),
48  fEventCuts(NULL),
49  fClusterCutsEMC(NULL),
50  fClusterCutsDMC(NULL),
51  fMesonCuts(NULL),
52  fMinNLMCut(1),
53  fMaxNLMCut(1),
54  fInputEvent(NULL),
55  fMCEvent(NULL),
56  fWeightJetJetMC(1),
57  fGeomEMCAL(NULL),
58  fClusterTree(NULL),
59  fIsHeavyIon(kFALSE),
60  ffillTree(-100),
61  ffillHistograms(kFALSE),
62  fOutputList(NULL),
63  fIsMC(kFALSE),
64  fCorrectForNonlinearity(kFALSE),
65  fSaveEventProperties(0),
66  fSaveCells(0),
67  fSaveSurroundingCells(0),
68  fSaveTracks(0),
69  fConeRadius(0),
70  fMinTrackPt(0),
71  fMinClusterEnergy(0),
72  fSaveMCInformation(0),
73  fSaveAdditionalHistos(0),
74  fExtractionPercentages(),
75  fExtractionPercentagePtBins(),
76  fBuffer_EventID(0),
77  fBuffer_ClusterE(0),
78  fBuffer_ClusterPhi(0),
79  fBuffer_ClusterEta(0),
80  fBuffer_ClusterIsEMCAL(kFALSE),
81  fBuffer_MC_Cluster_Flag(0),
82  fBuffer_ClusterNumCells(0),
83  fBuffer_LeadingCell_ID(0),
84  fBuffer_LeadingCell_E(0),
85  fBuffer_LeadingCell_Eta(0),
86  fBuffer_LeadingCell_Phi(0),
87  fBuffer_ClusterM02(0),
88  fBuffer_ClusterM20(0),
89  fBuffer_Event_Vertex_X(0),
90  fBuffer_Event_Vertex_Y(0),
91  fBuffer_Event_Vertex_Z(0),
92  fBuffer_Event_Multiplicity(0),
93  fBuffer_Event_NumActiveCells(0),
94  fBuffer_Cells_ID(0),
95  fBuffer_Cells_E(0),
96  fBuffer_Cells_RelativeEta(0),
97  fBuffer_Cells_RelativePhi(0),
98  fBuffer_Surrounding_NCells(0),
99  fBuffer_Surrounding_Cells_ID(0),
100  fBuffer_Surrounding_Cells_R(0),
101  fBuffer_Surrounding_Cells_E(0),
102  fBuffer_Surrounding_Cells_RelativeEta(0),
103  fBuffer_Surrounding_Cells_RelativePhi(0),
104  fBuffer_Surrounding_NTracks(10),
105  fBuffer_Surrounding_Tracks_R(0),
106  fBuffer_Surrounding_Tracks_Pt(0),
107  fBuffer_Surrounding_Tracks_P(0),
108  fBuffer_Surrounding_Tracks_RelativeEta(0),
109  fBuffer_Surrounding_Tracks_RelativePhi(0),
110  fBuffer_Cluster_MC_Label(-10),
111  fBuffer_Mother_MC_Label(-10),
112  hNCellsInClustersVsCentrality(NULL),
113  hNActiveCellsVsCentrality(NULL),
114  hNActiveCellsAbove50MeVVsCentrality(NULL),
115  hNActiveCellsAbove80MeVVsCentrality(NULL),
116  hNActiveCellsAbove100MeVVsCentrality(NULL),
117  hNActiveCellsAbove150MeVVsCentrality(NULL),
118  hECellsInClustersVsCentrality(NULL),
119  hEActiveCellsVsCentrality(NULL),
120  hEActiveCells50MeVVsCentrality(NULL),
121  hEActiveCells80MeVVsCentrality(NULL),
122  hEActiveCells100MeVVsCentrality(NULL),
123  hEActiveCells150MeVVsCentrality(NULL)
124 {
125  fBuffer_Cells_ID = new Int_t[kMaxActiveCells];
126  fBuffer_Cells_E = new Float_t[kMaxActiveCells];
127  fBuffer_Cells_RelativeEta = new Float_t[kMaxActiveCells];
128  fBuffer_Cells_RelativePhi = new Float_t[kMaxActiveCells];
129  fBuffer_Surrounding_Cells_ID = new Int_t[kMaxActiveCells];
130  fBuffer_Surrounding_Cells_R = new Float_t[kMaxActiveCells];
131  fBuffer_Surrounding_Cells_E = new Float_t[kMaxActiveCells];
132  fBuffer_Surrounding_Cells_RelativeEta = new Float_t[kMaxActiveCells];
133  fBuffer_Surrounding_Cells_RelativePhi = new Float_t[kMaxActiveCells];
134  fBuffer_Surrounding_Tracks_R = new Float_t[kMaxNTracks];
135  fBuffer_Surrounding_Tracks_Pt = new Float_t[kMaxNTracks];
136  fBuffer_Surrounding_Tracks_P = new Float_t[kMaxNTracks];
137  fBuffer_Surrounding_Tracks_RelativeEta= new Float_t[kMaxNTracks];
138  fBuffer_Surrounding_Tracks_RelativePhi= new Float_t[kMaxNTracks];
139 }
140 
142  fV0Reader(NULL),
143  fV0ReaderName("V0ReaderV1"),
144  fCorrTaskSetting(""),
145  fConversionCuts(NULL),
146  fEventCuts(NULL),
147  fClusterCutsEMC(NULL),
148  fClusterCutsDMC(NULL),
149  fMesonCuts(NULL),
150  fMinNLMCut(1),
151  fMaxNLMCut(1),
152  fInputEvent(NULL),
153  fMCEvent(NULL),
154  fWeightJetJetMC(1),
155  fGeomEMCAL(NULL),
156  fClusterTree(NULL),
157  fIsHeavyIon(kFALSE),
158  ffillTree(-100),
159  ffillHistograms(kFALSE),
160  fOutputList(NULL),
161  fIsMC(kFALSE),
162  fCorrectForNonlinearity(kFALSE),
163  fSaveEventProperties(0),
164  fSaveCells(0),
165  fSaveSurroundingCells(0),
166  fSaveTracks(0),
167  fConeRadius(0),
168  fMinTrackPt(0),
169  fMinClusterEnergy(0),
170  fSaveMCInformation(0),
171  fSaveAdditionalHistos(0),
172  fExtractionPercentages(),
173  fExtractionPercentagePtBins(),
174  fBuffer_EventID(0),
175  fBuffer_ClusterE(0),
176  fBuffer_ClusterPhi(0),
177  fBuffer_ClusterEta(0),
178  fBuffer_ClusterIsEMCAL(kFALSE),
179  fBuffer_MC_Cluster_Flag(0),
180  fBuffer_ClusterNumCells(0),
181  fBuffer_LeadingCell_ID(0),
182  fBuffer_LeadingCell_E(0),
183  fBuffer_LeadingCell_Eta(0),
184  fBuffer_LeadingCell_Phi(0),
185  fBuffer_ClusterM02(0),
186  fBuffer_ClusterM20(0),
187  fBuffer_Event_Vertex_X(0),
188  fBuffer_Event_Vertex_Y(0),
189  fBuffer_Event_Vertex_Z(0),
190  fBuffer_Event_Multiplicity(0),
191  fBuffer_Event_NumActiveCells(0),
192  fBuffer_Cells_ID(0),
193  fBuffer_Cells_E(0),
194  fBuffer_Cells_RelativeEta(0),
195  fBuffer_Cells_RelativePhi(0),
196  fBuffer_Surrounding_NCells(0),
197  fBuffer_Surrounding_Cells_ID(0),
198  fBuffer_Surrounding_Cells_R(0),
199  fBuffer_Surrounding_Cells_E(0),
200  fBuffer_Surrounding_Cells_RelativeEta(0),
201  fBuffer_Surrounding_Cells_RelativePhi(0),
202  fBuffer_Surrounding_NTracks(10),
203  fBuffer_Surrounding_Tracks_R(0),
204  fBuffer_Surrounding_Tracks_Pt(0),
205  fBuffer_Surrounding_Tracks_P(0),
206  fBuffer_Surrounding_Tracks_RelativeEta(0),
207  fBuffer_Surrounding_Tracks_RelativePhi(0),
208  fBuffer_Cluster_MC_Label(-10),
209  fBuffer_Mother_MC_Label(-10),
210  hNCellsInClustersVsCentrality(NULL),
211  hNActiveCellsVsCentrality(NULL),
212  hNActiveCellsAbove50MeVVsCentrality(NULL),
213  hNActiveCellsAbove80MeVVsCentrality(NULL),
214  hNActiveCellsAbove100MeVVsCentrality(NULL),
215  hNActiveCellsAbove150MeVVsCentrality(NULL),
216  hECellsInClustersVsCentrality(NULL),
217  hEActiveCellsVsCentrality(NULL),
218  hEActiveCells50MeVVsCentrality(NULL),
219  hEActiveCells80MeVVsCentrality(NULL),
220  hEActiveCells100MeVVsCentrality(NULL),
221  hEActiveCells150MeVVsCentrality(NULL)
222 {
237  // Default constructor
238 
239  DefineInput(0, TChain::Class());
240  DefineOutput(1, TList::Class());
241  DefineOutput(2, TTree::Class());
242 }
243 
244 //________________________________________________________________________
246 {
247  // default deconstructor
248 
249 }
250 //________________________________________________________________________
252 {
253  // Create User Output Objects
254 
255  if(fOutputList != NULL){
256  delete fOutputList;
257  fOutputList = NULL;
258  }
259  if(fOutputList == NULL){
260  fOutputList = new TList();
261  fOutputList->SetOwner(kTRUE);
262  }
263 
264  if(ffillHistograms){
265 
266  if(((AliConvEventCuts*)fEventCuts)->GetCutHistograms()){
267  fOutputList->Add(((AliConvEventCuts*)fEventCuts)->GetCutHistograms());
268  }
269 
270  if(((AliCaloPhotonCuts*)fClusterCutsEMC)->GetCutHistograms()){
271  fOutputList->Add(((AliCaloPhotonCuts*)fClusterCutsEMC)->GetCutHistograms());
272  }
273  if(((AliCaloPhotonCuts*)fClusterCutsDMC)->GetCutHistograms()){
274  fOutputList->Add(((AliCaloPhotonCuts*)fClusterCutsDMC)->GetCutHistograms());
275  }
276  if(((AliConversionMesonCuts*)fMesonCuts)->GetCutHistograms()){
277  fOutputList->Add(((AliConversionMesonCuts*)fMesonCuts)->GetCutHistograms());
278  }
280  hNCellsInClustersVsCentrality = new TH2F("NCellsInClusters_Centrality","NCellsInClusters_Centrality",18000, 0, 18000, 100, 0, 100);
282  hNActiveCellsVsCentrality = new TH2F("NActiveCells_Centrality","NActiveCells_Centrality",18000, 0, 18000, 100, 0, 100);
284  hNActiveCellsAbove50MeVVsCentrality = new TH2F("NActiveCells50MeV_Centrality","NActiveCells50MeV_Centrality",18000, 0, 18000, 100, 0, 100);
286  hNActiveCellsAbove80MeVVsCentrality = new TH2F("NActiveCells80MeV_Centrality","NActiveCells80MeV_Centrality",18000, 0, 18000, 100, 0, 100);
288  hNActiveCellsAbove100MeVVsCentrality = new TH2F("NActiveCells100MeV_Centrality","NActiveCells100MeV_Centrality",18000, 0, 18000, 100, 0, 100);
290  hNActiveCellsAbove150MeVVsCentrality = new TH2F("NActiveCells150MeV_Centrality","NActiveCells150MeV_Centrality",18000, 0, 18000, 100, 0, 100);
292 
293  hECellsInClustersVsCentrality = new TH2F("EofCellsInClusters_Centrality","EofCellsInClusters_Centrality",2000, 0, 20, 100, 0, 100);
295  hEActiveCellsVsCentrality = new TH2F("EofActiveCells_Centrality","EofActiveCells_Centrality",2000, 0, 20, 100, 0, 100);
297  hEActiveCells50MeVVsCentrality = new TH2F("EofActiveCells50MeV_Centrality","EofActiveCells50MeV_Centrality",2000, 0, 20, 100, 0, 100);
299  hEActiveCells80MeVVsCentrality = new TH2F("EofActiveCells80MeV_Centrality","EofActiveCells80MeV_Centrality",2000, 0, 20, 100, 0, 100);
301  hEActiveCells100MeVVsCentrality = new TH2F("EofActiveCells100MeV_Centrality","EofActiveCells100MeV_Centrality",2000, 0, 20, 100, 0, 100);
303  hEActiveCells150MeVVsCentrality = new TH2F("EofActiveCells150MeV_Centrality","EofActiveCells150MeV_Centrality",2000, 0, 20, 100, 0, 100);
305  }
306  PostData(1, fOutputList);
307  }
308 
309  fClusterTree = new TTree(Form("ClusterQA_%s_%s_%s",(fEventCuts->GetCutNumber()).Data(),(fClusterCutsEMC->GetCutNumber()).Data(),(fClusterCutsDMC->GetCutNumber()).Data()),Form("ClusterQA_%s_%s_%s",(fEventCuts->GetCutNumber()).Data(),(fClusterCutsEMC->GetCutNumber()).Data(),(fClusterCutsDMC->GetCutNumber()).Data()));
310 
311  fClusterTree->Branch("Cluster_E", &fBuffer_ClusterE, "Cluster_E/F");
312  fClusterTree->Branch("Cluster_Eta", &fBuffer_ClusterEta, "Cluster_Eta/F");
313  fClusterTree->Branch("Cluster_Phi", &fBuffer_ClusterPhi, "Cluster_Phi/F");
314  fClusterTree->Branch("Cluster_IsEMCAL", &fBuffer_ClusterIsEMCAL, "Cluster_IsEMCAL/O");
315  fClusterTree->Branch("Cluster_NumCells", &fBuffer_ClusterNumCells, "Cluster_NumCells/I");
316  fClusterTree->Branch("Cluster_LeadingCell_ID", &fBuffer_LeadingCell_ID, "Cluster_LeadingCell_ID/I");
317  fClusterTree->Branch("Cluster_LeadingCell_E", &fBuffer_LeadingCell_E, "Cluster_LeadingCell_E/F");
318  fClusterTree->Branch("Cluster_LeadingCell_Eta", &fBuffer_LeadingCell_Eta, "Cluster_LeadingCell_Eta/F");
319  fClusterTree->Branch("Cluster_LeadingCell_Phi", &fBuffer_LeadingCell_Phi, "Cluster_LeadingCell_Phi/F");
320  fClusterTree->Branch("Cluster_M02", &fBuffer_ClusterM02, "Cluster_M02/F");
321  fClusterTree->Branch("Cluster_M20", &fBuffer_ClusterM20, "Cluster_M20/F");
323  {
324  fClusterTree->Branch("Event_ID", &fBuffer_EventID, "Event_ID/l");
325  fClusterTree->Branch("Event_Vertex_X", &fBuffer_Event_Vertex_X, "Event_Vertex_X/F");
326  fClusterTree->Branch("Event_Vertex_Y", &fBuffer_Event_Vertex_Y, "Event_Vertex_Y/F");
327  fClusterTree->Branch("Event_Vertex_Z", &fBuffer_Event_Vertex_Z, "Event_Vertex_Z/F");
328  fClusterTree->Branch("Event_Multiplicity", &fBuffer_Event_Multiplicity, "Event_Multiplicity/F");
329  fClusterTree->Branch("Event_NumActiveCells", &fBuffer_Event_NumActiveCells, "Event_NumActiveCells/I");
330  }
331 
332  if(fSaveCells)
333  {
334  fClusterTree->Branch("Cluster_Cells_ID", fBuffer_Cells_ID, "Cluster_Cells_ID[Cluster_NumCells]/I");
335  fClusterTree->Branch("Cluster_Cells_E", fBuffer_Cells_E, "Cluster_Cells_E[Cluster_NumCells]/F");
336  fClusterTree->Branch("Cluster_Cells_RelativeEta", fBuffer_Cells_RelativeEta, "Cluster_Cells_RelativeEta[Cluster_NumCells]/F");
337  fClusterTree->Branch("Cluster_Cells_RelativePhi", fBuffer_Cells_RelativePhi, "Cluster_Cells_RelativePhi[Cluster_NumCells]/F");
338  }
339 
341  {
342  fClusterTree->Branch("Surrounding_NCells", &fBuffer_Surrounding_NCells, "Surrounding_NCells/I");
343  fClusterTree->Branch("Surrounding_Cells_ID", fBuffer_Surrounding_Cells_ID, "Surrounding_Cells_ID[Surrounding_NCells]/I");
344  fClusterTree->Branch("Surrounding_Cells_R", fBuffer_Surrounding_Cells_R, "Surrounding_Cells_R[Surrounding_NCells]/F");
345  fClusterTree->Branch("Surrounding_Cells_E", fBuffer_Surrounding_Cells_E, "Surrounding_Cells_E[Surrounding_NCells]/F");
346  fClusterTree->Branch("Surrounding_Cells_RelativeEta", fBuffer_Surrounding_Cells_RelativeEta, "Surrounding_Cells_RelativeEta[Surrounding_NCells]/F");
347  fClusterTree->Branch("Surrounding_Cells_RelativePhi", fBuffer_Surrounding_Cells_RelativePhi, "Surrounding_Cells_RelativePhi[Surrounding_NCells]/F");
348  }
349  if(fSaveTracks)
350  {
351  fClusterTree->Branch("Surrounding_NTracks", &fBuffer_Surrounding_NTracks, "Surrounding_NTracks/I");
352  fClusterTree->Branch("Surrounding_Tracks_R", fBuffer_Surrounding_Tracks_R, "Surrounding_Tracks_R[Surrounding_NTracks]/F");
353  fClusterTree->Branch("Surrounding_Tracks_Pt", fBuffer_Surrounding_Tracks_Pt, "Surrounding_Tracks_Pt[Surrounding_NTracks]/F");
354  fClusterTree->Branch("Surrounding_Tracks_P", fBuffer_Surrounding_Tracks_P, "Surrounding_Tracks_P[Surrounding_NTracks]/F");
355  fClusterTree->Branch("Surrounding_Tracks_RelativeEta", fBuffer_Surrounding_Tracks_RelativeEta, "Surrounding_Tracks_RelativeEta[Surrounding_NTracks]/F");
356  fClusterTree->Branch("Surrounding_Tracks_RelativePhi", fBuffer_Surrounding_Tracks_RelativePhi, "Surrounding_Tracks_RelativePhi[Surrounding_NTracks]/F");
357  }
358 
360  {
361  fClusterTree->Branch("Cluster_MC_Label", &fBuffer_Cluster_MC_Label, "Cluster_MC_Label/I");
362  fClusterTree->Branch("Mother_MC_Label", &fBuffer_Mother_MC_Label, "Mother_MC_Label/I");
363  }
364 
365  fV0Reader=(AliV0ReaderV1*)AliAnalysisManager::GetAnalysisManager()->GetTask(fV0ReaderName.Data());
366  OpenFile(2);
367  PostData(2, fClusterTree);
368 }
369 //_____________________________________________________________________________
371 {
376  }
377 
378  return kTRUE;
379 }
380 //________________________________________________________________________
382 
383  Int_t eventQuality = ((AliConvEventCuts*)fV0Reader->GetEventCuts())->GetEventQuality();
384  if(eventQuality != 0){// Event Not Accepted
385  return;
386  }
387  fInputEvent = InputEvent();
388  if(fIsMC) fMCEvent = MCEvent();
389 
391  if(eventNotAccepted) return; // Check Centrality, PileUp, SDD and V0AND --> Not Accepted => eventQuality = 1
392 
393  fGeomEMCAL = AliEMCALGeometry::GetInstance();
394  if(!fGeomEMCAL){ AliFatal("EMCal geometry not initialized!");}
395 
396  Int_t nclus = 0;
397  TClonesArray * arrClustersProcess = NULL;
398  // fNCurrentClusterBasic = 0;
399  if(!fCorrTaskSetting.CompareTo("")){
400  nclus = fInputEvent->GetNumberOfCaloClusters();
401  } else {
402  arrClustersProcess = dynamic_cast<TClonesArray*>(fInputEvent->FindListObject(Form("%sClustersBranch",fCorrTaskSetting.Data())));
403  if(!arrClustersProcess)
404  AliFatal(Form("%sClustersBranch was not found in AliAnalysisTaskGammaCalo! Check the correction framework settings!",fCorrTaskSetting.Data()));
405  nclus = arrClustersProcess->GetEntries();
406  }
407 
408  if(nclus == 0) return;
409 
410  ((AliCaloPhotonCuts*)fClusterCutsEMC)->FillHistogramsExtendedQA(fInputEvent,fIsMC);
411  // ((AliCaloPhotonCuts*)fClusterCutsDMC)->FillHistogramsExtendedQA(fInputEvent,fIsMC);
412 
413  // match tracks to clusters
414  ((AliCaloPhotonCuts*)fClusterCutsEMC)->MatchTracksToClusters(fInputEvent,fWeightJetJetMC,kTRUE, fMCEvent);
415  // ((AliCaloPhotonCuts*)fClusterCutsDMC)->MatchTracksToClusters(fInputEvent,fWeightJetJetMC,kTRUE, fMCEvent);
416 
417  AliVCaloCells* cells = fInputEvent->GetEMCALCells();
418  Double_t centrality = 0;
420  centrality = GetCentrality(fInputEvent);
421 
422  Int_t numberOfActiveCells50MeV =0;
423  Int_t numberOfActiveCells80MeV =0;
424  Int_t numberOfActiveCells100MeV =0;
425  Int_t numberOfActiveCells150MeV =0;
426  for(Int_t aCell=0;aCell<cells->GetNumberOfCells();aCell++){
427  // Define necessary variables
428  Short_t cellNumber = 0;
429  Double_t cellAmplitude = 0, cellTime = 0, cellEFrac = 0;
430  Int_t cellMCLabel = 0;
431  // Get Cell ID
432  cells->GetCell(aCell,cellNumber,cellAmplitude,cellTime,cellMCLabel,cellEFrac);
433  Double_t cellEnergy = cells->GetCellAmplitude(cellNumber);
434  hEActiveCellsVsCentrality->Fill(cellEnergy,centrality);
435  if(cellEnergy >0.050 ){
436  numberOfActiveCells50MeV++;
437  hEActiveCells50MeVVsCentrality->Fill(cellEnergy,centrality);
438  }
439  if(cellEnergy >0.080 ){
440  numberOfActiveCells80MeV++;
441  hEActiveCells80MeVVsCentrality->Fill(cellEnergy,centrality);
442  }
443  if(cellEnergy >0.100 ){
444  numberOfActiveCells100MeV++;
445  hEActiveCells100MeVVsCentrality->Fill(cellEnergy,centrality);
446  }
447  if(cellEnergy >0.150 ){
448  numberOfActiveCells150MeV++;
449  hEActiveCells150MeVVsCentrality->Fill(cellEnergy,centrality);
450  }
451  }
452  hNActiveCellsVsCentrality->Fill(cells->GetNumberOfCells(),centrality);
453  hNActiveCellsAbove50MeVVsCentrality->Fill(numberOfActiveCells50MeV,centrality);
454  hNActiveCellsAbove80MeVVsCentrality->Fill(numberOfActiveCells80MeV,centrality);
455  hNActiveCellsAbove100MeVVsCentrality->Fill(numberOfActiveCells100MeV,centrality);
456  hNActiveCellsAbove150MeVVsCentrality->Fill(numberOfActiveCells150MeV,centrality);
457  }
458 
459  // vertex
460  Double_t vertex[3] = {0};
461  InputEvent()->GetPrimaryVertex()->GetXYZ(vertex);
462 
463  map<Long_t,Int_t> mapIsClusterAccepted;
464  map<Long_t,Int_t> mapIsClusterAcceptedWithoutTrackMatch;
465  Int_t nCellInCluster = 0;
466  // Loop over EMCal clusters
467  for(Long_t i = 0; i < nclus; i++){
468  Double_t tempClusterWeight = fWeightJetJetMC;
469  AliVCluster* clus = NULL;
470  if(fInputEvent->IsA()==AliESDEvent::Class()){
471  if(arrClustersProcess)
472  clus = new AliESDCaloCluster(*(AliESDCaloCluster*)arrClustersProcess->At(i));
473  else
474  clus = new AliESDCaloCluster(*(AliESDCaloCluster*)fInputEvent->GetCaloCluster(i));
475  } else if(fInputEvent->IsA()==AliAODEvent::Class()){
476  if(arrClustersProcess)
477  clus = new AliAODCaloCluster(*(AliAODCaloCluster*)arrClustersProcess->At(i));
478  else
479  clus = new AliAODCaloCluster(*(AliAODCaloCluster*)fInputEvent->GetCaloCluster(i));
480  }
481  if(!clus) continue;
482 
483 
484  if ( !clus->IsEMCAL()){ // for PHOS: cluster->GetType() == AliVCluster::kPHOSNeutral
485  delete clus;
486  continue;
487  }
489  nCellInCluster+=clus->GetNCells();
490  for(Int_t iCell=0;iCell<clus->GetNCells();iCell++){
491  hECellsInClustersVsCentrality->Fill(cells->GetCellAmplitude(clus->GetCellAbsId(iCell)),centrality);
492  }
493  }
494 
495  if ( clus->E() < fMinClusterEnergy){
496  delete clus;
497  continue;
498  }
499 
500  if(!((AliCaloPhotonCuts*)fClusterCutsEMC)->ClusterIsSelected(clus,fInputEvent,fMCEvent,fIsMC, tempClusterWeight,i) && !((AliCaloPhotonCuts*)fClusterCutsDMC)->ClusterIsSelected(clus,fInputEvent,fMCEvent,fIsMC, tempClusterWeight,i)){
501  delete clus;
502  continue;
503  }
504  ResetBuffer();
506  }
508  hNCellsInClustersVsCentrality->Fill(nCellInCluster,centrality);
509 
510  PostData(1, fOutputList);
511 }
512 
514 void AliAnalysisTaskClusterQA::ProcessQATreeCluster(AliVEvent *event, AliVCluster* cluster, Long_t indexCluster){
515  Float_t clusPos[3] = { 0,0,0 };
516  cluster->GetPosition(clusPos);
517  TVector3 clusterVector(clusPos[0],clusPos[1],clusPos[2]);
518  Double_t etaCluster = clusterVector.Eta();
519  Double_t phiCluster = clusterVector.Phi();
520  if (phiCluster < 0) phiCluster += 2*TMath::Pi();
521 
523  // Vertex position x, y, z
524  fBuffer_Event_Vertex_X = fInputEvent->GetPrimaryVertex()->GetX();
525  fBuffer_Event_Vertex_Y = fInputEvent->GetPrimaryVertex()->GetY();
526  fBuffer_Event_Vertex_Z = fInputEvent->GetPrimaryVertex()->GetZ();
527 
528  // Unique event ID of the current cluster
529  // AliESDEvent* esdEvent = dynamic_cast<AliESDEvent*>(event);
530  fBuffer_EventID = 0;
531  // if(esdEvent->GetHeader()){
532  // fBuffer_EventID = GetUniqueEventID(esdEvent->GetHeader());
533  // printf("event id: %lld\n",fBuffer_EventID);
534  // }
535 
536  // V0-based multiplicity of the event
537  fBuffer_Event_Multiplicity = fInputEvent->GetVZEROData()->GetMTotV0A()+fInputEvent->GetVZEROData()->GetMTotV0C();
538  }
539 
540  // Properties of the current cluster
541  fBuffer_ClusterE = cluster->E();
542 
543  if(etaCluster < 0.67 && etaCluster > -0.67){
544  if(phiCluster < 3.2 && phiCluster > 1.4){
545  fBuffer_ClusterIsEMCAL = kTRUE;
546  }
547  }
548  if(etaCluster < 0.67 && etaCluster > -0.67){
549  if(etaCluster > 0.23 || etaCluster < -0.23){
550  if(phiCluster < 5.6 && phiCluster > 4.6){
551  fBuffer_ClusterIsEMCAL = kFALSE;
552  }
553  }
554  }
555 
556  fBuffer_ClusterPhi = phiCluster;
557  fBuffer_ClusterEta = etaCluster;
558  fBuffer_ClusterM02 = cluster->GetM02();
559  fBuffer_ClusterM20 = cluster->GetM20();
560 
561  // Get all cells from the event
562  AliVCaloCells* cells = NULL;
563  if(cluster->IsEMCAL())
564  cells = event->GetEMCALCells();
565  else
566  return;
567 
568  // Determine all active cells in the event
570  fBuffer_Event_NumActiveCells = cells->GetNumberOfCells();
571 
572  // Get the number of cells from the current cluster
573  Int_t nCellCluster = cluster->GetNCells();
574  fBuffer_ClusterNumCells = nCellCluster;
575 
576  // Find the leading cell in the cluster and its position
578  fBuffer_LeadingCell_E = cells->GetCellAmplitude(fBuffer_LeadingCell_ID);
579  Float_t leadcelleta = 0.;
580  Float_t leadcellphi = 0.;
581  fGeomEMCAL->EtaPhiFromIndex(fBuffer_LeadingCell_ID, leadcelleta, leadcellphi);
582  if ( leadcellphi < 0 ) leadcellphi+=TMath::TwoPi();
583  fBuffer_LeadingCell_Eta = leadcelleta;
584  fBuffer_LeadingCell_Phi = leadcellphi;
585  // Treat the remaining cells of the cluster and get their relative position compared to the leading cell
586  if(fSaveCells){
587  for(Int_t iCell=0;iCell<nCellCluster;iCell++){
588  if(iCell<100){ // maximum number of cells for a cluster is set to 100
589  fBuffer_Cells_ID[iCell] = cluster->GetCellAbsId(iCell);
590  fBuffer_Cells_E[iCell] = cells->GetCellAmplitude(cluster->GetCellAbsId(iCell));
591  Float_t celleta = 0.;
592  Float_t cellphi = 0.;
593  fGeomEMCAL->EtaPhiFromIndex(fBuffer_Cells_ID[iCell], celleta, cellphi);
594  if ( cellphi < 0 ) cellphi+=TMath::TwoPi();
595  fBuffer_Cells_RelativeEta[iCell] = leadcelleta-celleta;
596  fBuffer_Cells_RelativePhi[iCell] = leadcellphi-cellphi;
597  }
598  }
599  }
601  Int_t nActiveCellsSurroundingInR = 0;
602  // fill surrounding cell buffer
603  for(Int_t aCell=0;aCell<cells->GetNumberOfCells();aCell++){
604  // Define necessary variables
605  Short_t cellNumber = 0;
606  Double_t cellAmplitude = 0, cellTime = 0, cellEFrac = 0;
607  Int_t cellMCLabel = 0;
608  Float_t surrcelleta = 0.;
609  Float_t surrcellphi = 0.;
610  // Get Cell ID
611  cells->GetCell(aCell,cellNumber,cellAmplitude,cellTime,cellMCLabel,cellEFrac);
612 
613  // Get eta and phi for the surounding cells
614  fGeomEMCAL->EtaPhiFromIndex(cellNumber, surrcelleta, surrcellphi);
615  if ( surrcellphi < 0 ) surrcellphi+=TMath::TwoPi();
616  Double_t dR2 = pow(leadcelleta-surrcelleta,2) + pow(leadcellphi-surrcellphi,2);
617  // Select those cells that are within fConeRadius of the leading cluster cell
618  if( dR2 < fConeRadius){
619  fBuffer_Surrounding_Cells_E[nActiveCellsSurroundingInR] = cells->GetCellAmplitude(cellNumber);
620  fBuffer_Surrounding_Cells_ID[nActiveCellsSurroundingInR] = cellNumber;
621  fBuffer_Surrounding_Cells_R[nActiveCellsSurroundingInR] = dR2;
622  fBuffer_Surrounding_Cells_RelativeEta[nActiveCellsSurroundingInR] = leadcelleta-surrcelleta;
623  fBuffer_Surrounding_Cells_RelativePhi[nActiveCellsSurroundingInR] = leadcellphi-surrcellphi;
624  nActiveCellsSurroundingInR+=1;
625  }
626  }
627  fBuffer_Surrounding_NCells = nActiveCellsSurroundingInR;
628  }
629 
630  // write PDG code of mother of particle that mainly contributed to cluster to tree
631  if(fIsMC> 0){
632  if (cluster->GetNLabels()>0){
633  if((cluster->GetLabelAt(0)!=-1)){
634  if(fInputEvent->IsA()==AliESDEvent::Class()){
635  fBuffer_Mother_MC_Label = (fMCEvent->Particle(cluster->GetLabelAt(0)))->GetPdgCode(); // mother of leading contribution
636  } else if(fInputEvent->IsA()==AliAODEvent::Class()){
637  TClonesArray *AODMCTrackArray = dynamic_cast<TClonesArray*>(fInputEvent->FindListObject(AliAODMCParticle::StdBranchName()));
638  if (AODMCTrackArray == NULL) return;
639 
640  AliAODMCParticle* particle = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(cluster->GetLabelAt(0)));
641  fBuffer_Mother_MC_Label = particle->GetPdgCode();
642  }
643 
644  } else{
645  // mother is initial collision
647  }
648  } else{
649  // no mothers found (should not happen)
651  }
652  }
653  if(fIsMC) fBuffer_Cluster_MC_Label = MakePhotonCandidates(cluster, cells,indexCluster);
654  if(fSaveTracks) ProcessTracksAndMatching(cluster,indexCluster);
655  // Add everything to the tree
656  if (fClusterTree) fClusterTree->Fill();
657 }
658 
659 //________________________________________________________________________
661 
662 }
663 
664 //________________________________________________________________________
665 Int_t AliAnalysisTaskClusterQA::FindLargestCellInCluster(AliVCluster* cluster, AliVEvent* event){
666 
667  const Int_t nCells = cluster->GetNCells();
668  AliVCaloCells* cells = NULL;
669 
670  if(cluster->IsEMCAL())
671  cells = event->GetEMCALCells();
672  else if(cluster->IsPHOS())
673  cells = event->GetPHOSCells();
674 
675  Float_t eMax = 0.;
676  Int_t idMax = -1;
677 
678  if (nCells < 1) return idMax;
679  for (Int_t iCell = 0;iCell < nCells;iCell++){
680  Int_t cellAbsID = cluster->GetCellsAbsId()[iCell];
681  if (cells->GetCellAmplitude(cellAbsID)> eMax){
682  eMax = cells->GetCellAmplitude(cellAbsID);
683  idMax = cellAbsID;
684  }
685  }
686  return idMax;
687 }
688 
689 //________________________________________________________________________
691  Int_t nSupMod=0, nModule=0, nIphi=0, nIeta=0;
692  row=0;
693  column=0;
694  // Get SM number and relative row/column for SM
695  fGeomEMCAL->GetCellIndex(cellIndex, nSupMod,nModule,nIphi,nIeta);
696  fGeomEMCAL->GetCellPhiEtaIndexInSModule(nSupMod,nModule,nIphi,nIeta, row,column);
697  row += nSupMod/2 * 24;
698  column += nSupMod%2 * 48;
699 }
700 
701 //________________________________________________________________________
702 Int_t AliAnalysisTaskClusterQA::MakePhotonCandidates(AliVCluster* clus, AliVCaloCells* cells, Long_t indexCluster){
703 
704  Double_t vertex[3] = {0};
705  InputEvent()->GetPrimaryVertex()->GetXYZ(vertex);
706 
707  TLorentzVector clusterVector;
708  clus->GetMomentum(clusterVector,vertex);
709 
710  TLorentzVector* tmpvec = new TLorentzVector();
711  tmpvec->SetPxPyPzE(clusterVector.Px(),clusterVector.Py(),clusterVector.Pz(),clusterVector.E());
712 
713  // convert to AODConversionPhoton
714  AliAODConversionPhoton *PhotonCandidate=new AliAODConversionPhoton(tmpvec);
715  if(!PhotonCandidate){
716  delete clus;
717  delete tmpvec;
718  if (PhotonCandidate) delete PhotonCandidate;
719  return -9;
720  }
721  // Flag Photon as CaloPhoton
722  PhotonCandidate->SetIsCaloPhoton();
723  PhotonCandidate->SetCaloClusterRef(indexCluster);
724 
725  // get MC label
726  if(fIsMC> 0){
727  Int_t* mclabelsCluster = clus->GetLabels();
728  Int_t nValidClusters = 0;
729  if (clus->GetNLabels()>0){
730  for (Int_t k =0; k< (Int_t)clus->GetNLabels(); k++){
731  if (mclabelsCluster[k]>0){
732  if (nValidClusters< 50)PhotonCandidate->SetCaloPhotonMCLabel(nValidClusters,mclabelsCluster[k]);
733  nValidClusters++;
734  }
735  }
736  }
737  PhotonCandidate->SetNCaloPhotonMCLabels(nValidClusters);
738  }
739 
740  AliAODCaloCluster* clusSub1 = new AliAODCaloCluster();
741  AliAODCaloCluster* clusSub2 = new AliAODCaloCluster();
742 
743 
744  // split clusters according to their shares in the cluster (NLM == 1) needs to be treated differently
745  if (fMinNLMCut == 1 && fMaxNLMCut == 1 ){
746  Int_t absCellIdFirst = ((AliCaloPhotonCuts*)fClusterCutsEMC)->FindLargestCellInCluster(clus, fInputEvent);
747  Int_t absCellIdSecond = ((AliCaloPhotonCuts*)fClusterCutsEMC)->FindSecondLargestCellInCluster(clus, fInputEvent);
748 
749  ((AliCaloPhotonCuts*)fClusterCutsEMC)->SplitEnergy(absCellIdFirst, absCellIdSecond, clus, fInputEvent, fIsMC, clusSub1, clusSub2);
750  } else if (fMinNLMCut > 1 ){
751  const Int_t nc = clus->GetNCells();
752  Int_t absCellIdList[nc];
753 
754  ((AliCaloPhotonCuts*)fClusterCutsEMC)->SplitEnergy(absCellIdList[0], absCellIdList[1], clus, fInputEvent, fIsMC, clusSub1, clusSub2);
755  }
756 
757  // TLorentzvector with sub cluster 1
758  TLorentzVector clusterVector1;
759  clusSub1->GetMomentum(clusterVector1,vertex);
760  TLorentzVector* tmpvec1 = new TLorentzVector();
761  tmpvec1->SetPxPyPzE(clusterVector1.Px(),clusterVector1.Py(),clusterVector1.Pz(),clusterVector1.E());
762  // convert to AODConversionPhoton
763  AliAODConversionPhoton *PhotonCandidate1=new AliAODConversionPhoton(tmpvec1);
764  if(!PhotonCandidate1){
765  delete clusSub1;
766  delete tmpvec1;
767  return -9;
768  }
769  // Flag Photon as CaloPhoton
770  PhotonCandidate1->SetIsCaloPhoton();
771  // TLorentzvector with sub cluster 2
772  TLorentzVector clusterVector2;
773  clusSub2->GetMomentum(clusterVector2,vertex);
774  TLorentzVector* tmpvec2 = new TLorentzVector();
775  tmpvec2->SetPxPyPzE(clusterVector2.Px(),clusterVector2.Py(),clusterVector2.Pz(),clusterVector2.E());
776  // convert to AODConversionPhoton
777  AliAODConversionPhoton *PhotonCandidate2=new AliAODConversionPhoton(tmpvec2);
778  if(!PhotonCandidate2){
779  delete clusSub2;
780  delete tmpvec2;
781  return -9;
782  }
783  // Flag Photon as CaloPhoton
784  PhotonCandidate2->SetIsCaloPhoton();
785  Int_t mclabel = -3;
786  // create pi0 candidate
787  //AliAODConversionMother *pi0cand = new AliAODConversionMother(PhotonCandidate1,PhotonCandidate2);
788 // if((((AliConversionMesonCuts*)fMesonCuts)->MesonIsSelected(pi0cand,kTRUE,fEventCuts->GetEtaShift()))){
789  if(fIsMC> 0 && PhotonCandidate && PhotonCandidate1 && PhotonCandidate2 && fSaveMCInformation){
790  if(fInputEvent->IsA()==AliESDEvent::Class())
791  mclabel = ProcessTrueClusterCandidates(PhotonCandidate, clus->GetM02(), PhotonCandidate1, PhotonCandidate2);
792  if(fInputEvent->IsA()==AliAODEvent::Class())
793  mclabel = ProcessTrueClusterCandidatesAOD(PhotonCandidate, clus->GetM02(), PhotonCandidate1, PhotonCandidate2);
794  return mclabel;
795  } else {
796  return -7;
797  }
798  return -1;
799 }
800 
801 //________________________________________________________________________
802 void AliAnalysisTaskClusterQA::ProcessTracksAndMatching(AliVCluster* clus, Long_t indexCluster){
803 
804 
805  Int_t nTracksInR = 0;
806  Int_t nModules = fGeomEMCAL->GetNumberOfSuperModules();
807 
808  AliESDEvent *esdev = dynamic_cast<AliESDEvent*>(fInputEvent);
809  AliAODEvent *aodev = 0;
810  if (!esdev) {
811  aodev = dynamic_cast<AliAODEvent*>(fInputEvent);
812  if (!aodev) {
813  AliError("Task needs AOD or ESD event, returning");
814  return;
815  }
816  }
817  AliESDtrackCuts *EsdTrackCuts = 0x0;
818  // Using standard function for setting Cuts
819  static int prevRun = -1;
820  // Using standard function for setting Cuts
821  if (esdev){
822  Int_t runNumber = fInputEvent->GetRunNumber();
823  if (prevRun!=runNumber) {
824  delete EsdTrackCuts;
825  EsdTrackCuts = 0;
826  prevRun = runNumber;
827  }
828  // if LHC11a or earlier or if LHC13g or if LHC12a-i -> use 2010 cuts
829  if( (runNumber<=146860) || (runNumber>=197470 && runNumber<=197692) || (runNumber>=172440 && runNumber<=193766) ){
830  EsdTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2010();
831  // else if run2 data use 2015 PbPb cuts
832  }else if (runNumber>=209122){
833  // hard coded track cuts for the moment, because AliESDtrackCuts::GetStandardITSTPCTrackCuts2015PbPb() gives spams warnings
834  EsdTrackCuts = new AliESDtrackCuts();
835  EsdTrackCuts->AliESDtrackCuts::SetMinNCrossedRowsTPC(70);
836  EsdTrackCuts->AliESDtrackCuts::SetMinRatioCrossedRowsOverFindableClustersTPC(0.8);
837  EsdTrackCuts->AliESDtrackCuts::SetMaxChi2PerClusterTPC(4);
838  EsdTrackCuts->AliESDtrackCuts::SetAcceptKinkDaughters(kFALSE);
839  EsdTrackCuts->AliESDtrackCuts::SetRequireTPCRefit(kTRUE);
840  // ITS
841  EsdTrackCuts->AliESDtrackCuts::SetRequireITSRefit(kTRUE);
842  EsdTrackCuts->AliESDtrackCuts::SetClusterRequirementITS(AliESDtrackCuts::kSPD,
843  AliESDtrackCuts::kAny);
844  EsdTrackCuts->AliESDtrackCuts::SetMaxDCAToVertexXYPtDep("0.0105+0.0350/pt^1.1");
845  EsdTrackCuts->AliESDtrackCuts::SetMaxChi2TPCConstrainedGlobal(36);
846  EsdTrackCuts->AliESDtrackCuts::SetMaxDCAToVertexZ(2);
847  EsdTrackCuts->AliESDtrackCuts::SetDCAToVertex2D(kFALSE);
848  EsdTrackCuts->AliESDtrackCuts::SetRequireSigmaToVertex(kFALSE);
849  EsdTrackCuts->AliESDtrackCuts::SetMaxChi2PerClusterITS(36);
850  // else use 2011 version of track cuts
851  }else{
852  EsdTrackCuts = AliESDtrackCuts::GetStandardITSTPCTrackCuts2011();
853  }
854  EsdTrackCuts->SetMaxDCAToVertexZ(2);
855  EsdTrackCuts->SetEtaRange(-0.8, 0.8);
856  EsdTrackCuts->SetPtRange(0.15);
857  }
858 
859  for (Int_t itr=0;itr<fInputEvent->GetNumberOfTracks();itr++){
860  AliExternalTrackParam *trackParam = 0;
861  AliVTrack *inTrack = 0x0;
862  if(esdev){
863  inTrack = esdev->GetTrack(itr);
864  if(!inTrack) continue;
865  if(inTrack->Pt()<fMinTrackPt) continue;
866  AliESDtrack *esdt = dynamic_cast<AliESDtrack*>(inTrack);
867  // check track cuts
868  if(!EsdTrackCuts->AcceptTrack(esdt)) continue;
869  const AliExternalTrackParam *in = esdt->GetInnerParam();
870  if (!in){AliError("Could not get InnerParam of Track, continue");continue;}
871  trackParam =new AliExternalTrackParam(*in);
872  } else if(aodev){
873  inTrack = dynamic_cast<AliVTrack*>(aodev->GetTrack(itr));
874  if(!inTrack) continue;
875  if(inTrack->Pt()<fMinTrackPt) continue;
876  AliAODTrack *aodt = dynamic_cast<AliAODTrack*>(inTrack);
877  // check track cuts
878  if(!aodt->IsHybridGlobalConstrainedGlobal()) continue;
879 
880  Double_t xyz[3] = {0}, pxpypz[3] = {0}, cv[21] = {0};
881  aodt->GetPxPyPz(pxpypz);
882  aodt->GetXYZ(xyz);
883  aodt->GetCovarianceXYZPxPyPz(cv);
884 
885  trackParam = new AliExternalTrackParam(xyz,pxpypz,cv,aodt->Charge());
886  }
887  AliExternalTrackParam emcParam(*trackParam);
888  Float_t eta, phi, pt;
889 
890  //propagate tracks to emc surfaces
891  if (!AliEMCALRecoUtils::ExtrapolateTrackToEMCalSurface(&emcParam, 440., 0.139, 20., eta, phi, pt)) {
892  delete trackParam;
893  continue;
894  }
895  if( TMath::Abs(eta) > 0.75 ) {
896  delete trackParam;
897  continue;
898  }
899  // Save some time and memory in case of no DCal present
900  if( nModules < 13 && ( phi < 70*TMath::DegToRad() || phi > 190*TMath::DegToRad())){
901  delete trackParam;
902  continue;
903  }
904  // Save some time and memory in case of run2
905  if( nModules > 12 ){
906  if (( phi < 70*TMath::DegToRad() || phi > 190*TMath::DegToRad()) && ( phi < 250*TMath::DegToRad() || phi > 340*TMath::DegToRad())){
907  delete trackParam;
908  continue;
909  }
910  }
911  Float_t dEta=-999, dPhi=-999;
912  Double_t trkPos[3] = {0.,0.,0.};
913  if (!emcParam.GetXYZ(trkPos)){
914  delete trackParam;
915  continue;
916  }
917 
918  AliExternalTrackParam trackParamTmp(emcParam);//Retrieve the starting point every time before the extrapolation
919  if(!AliEMCALRecoUtils::ExtrapolateTrackToCluster(&trackParamTmp, clus, 0.139, 5., dEta, dPhi)) continue;
920 
921  Float_t dR2 = dPhi*dPhi + dEta*dEta;
922  if(dR2 < fConeRadius){
923  fBuffer_Surrounding_Tracks_R[nTracksInR]=dR2;
924  fBuffer_Surrounding_Tracks_Pt[nTracksInR]=inTrack->Pt();
925  fBuffer_Surrounding_Tracks_P[nTracksInR]=inTrack->P();
928  nTracksInR+=1;
929  }
930  }
931  fBuffer_Surrounding_NTracks = nTracksInR;
932  if(nTracksInR==0){
933  fBuffer_Surrounding_Tracks_R[nTracksInR]=-1;
934  fBuffer_Surrounding_Tracks_Pt[nTracksInR]=-1;
935  fBuffer_Surrounding_Tracks_P[nTracksInR]=-1;
938  }
939 
940  if(EsdTrackCuts){
941  delete EsdTrackCuts;
942  EsdTrackCuts=0x0;
943  }
944 }
945 
946 //________________________________________________________________________
948  AliAODConversionPhoton *TrueSubClusterCandidate1,
949  AliAODConversionPhoton *TrueSubClusterCandidate2)
950 {
951 
952  Int_t mcLabelCluster = -5;
953  const AliVVertex* primVtxMC = fMCEvent->GetPrimaryVertex();
954  Double_t mcProdVtxX = primVtxMC->GetX();
955  Double_t mcProdVtxY = primVtxMC->GetY();
956  Double_t mcProdVtxZ = primVtxMC->GetZ();
957 
958  TParticle *Photon = NULL;
959  if (!TrueClusterCandidate->GetIsCaloPhoton()) AliFatal("CaloPhotonFlag has not been set task will abort");
960  if (TrueClusterCandidate->GetCaloPhotonMCLabel(0) < 0){
961  mcLabelCluster = -10;
962  return mcLabelCluster;
963  }
964  if (TrueClusterCandidate->GetNCaloPhotonMCLabels()>0){
965  Photon = fMCEvent->Particle(TrueClusterCandidate->GetCaloPhotonMCLabel(0));
966  } else{
967  mcLabelCluster = -11;
968  return mcLabelCluster;
969  }
970  if(Photon == NULL){
971  mcLabelCluster = -12;
972  return mcLabelCluster;
973  }
974  AliAODConversionMother *mesoncand = new AliAODConversionMother(TrueSubClusterCandidate1,TrueSubClusterCandidate2);
975 // Bool_t mesonIsSelected = (((AliConversionMesonCuts*)fMesonCuts)->MesonIsSelected(mesoncand,kTRUE,fEventCuts->GetEtaShift()));
976 // if (!mesonIsSelected){
977 // delete mesoncand;
978 // mcLabelCluster = -13;
979 // return mcLabelCluster;
980 // }
981 
982  TrueClusterCandidate->SetCaloPhotonMCFlags(fMCEvent, kFALSE);
983 
984  // cluster classification:
985  // 1 - nice merged cluster (2 gamma | contributions from 2 gamma) from pi0/eta
986  // 2 - contribution from only 1 partner (1 gamma, 1 fully coverted gamma) from pi0/eta
987  // 3 - contribution from part of 1 partner (1 electron) from pi0/eta
988 
989 
990  Int_t clusterClass = 0;
991  Bool_t isPrimary = fEventCuts->IsConversionPrimaryESD( fMCEvent, TrueClusterCandidate->GetCaloPhotonMCLabel(0), mcProdVtxX, mcProdVtxY, mcProdVtxZ);
992 
993 
994  Long_t motherLab = -1;
995  if (TrueClusterCandidate->IsMerged() || TrueClusterCandidate->IsMergedPartConv()){
996  clusterClass = 1;
997  motherLab = TrueClusterCandidate->GetCaloPhotonMotherMCLabel(0);
998  } else if (TrueClusterCandidate->GetNCaloPhotonMotherMCLabels()> 0){
999  if (TrueClusterCandidate->IsLargestComponentElectron() || TrueClusterCandidate->IsLargestComponentPhoton()){
1000  if (TrueClusterCandidate->GetCaloPhotonMotherMCLabel(0) > -1 && (fMCEvent->Particle(TrueClusterCandidate->GetCaloPhotonMotherMCLabel(0))->GetPdgCode() == 111 || fMCEvent->Particle(TrueClusterCandidate->GetCaloPhotonMotherMCLabel(0))->GetPdgCode() == 221) ){
1001  if ( TrueClusterCandidate->IsConversion() && !TrueClusterCandidate->IsConversionFullyContained() ){
1002  clusterClass = 3;
1003  motherLab = TrueClusterCandidate->GetCaloPhotonMotherMCLabel(0);
1004  } else {
1005  clusterClass = 2;
1006  motherLab = TrueClusterCandidate->GetCaloPhotonMotherMCLabel(0);
1007  }
1008  }
1009  } else if (TrueClusterCandidate->IsSubLeadingEM()){
1010  if (TrueClusterCandidate->GetNCaloPhotonMotherMCLabels()> 1){
1011  if ( TrueClusterCandidate->GetCaloPhotonMotherMCLabel(1) > -1){
1012  if (fMCEvent->Particle(TrueClusterCandidate->GetCaloPhotonMotherMCLabel(1))->GetPdgCode() == 111 || fMCEvent->Particle(TrueClusterCandidate->GetCaloPhotonMotherMCLabel(1))->GetPdgCode() == 221 ){
1013  clusterClass = 2;
1014  motherLab = TrueClusterCandidate->GetCaloPhotonMotherMCLabel(1);
1015  }
1016  }
1017  }
1018  } else {
1019  motherLab = TrueClusterCandidate->GetCaloPhotonMotherMCLabel(0);
1020  }
1021  }
1022 
1023  // Get Mother particle
1024  TParticle *mother = NULL;
1025  Int_t motherPDG = -1;
1026  if (motherLab > -1)
1027  mother = fMCEvent->Particle(motherLab);
1028  if (mother)
1029  motherPDG = TMath::Abs(mother->GetPdgCode());
1030 
1031  //
1032  if (clusterClass == 1 || clusterClass == 2 || clusterClass == 3 ){
1033  // separate different components
1034  if (clusterClass == 1 && TrueClusterCandidate->IsMerged()){
1035  if (motherPDG == 111){
1036  mcLabelCluster = 10; // NOTE merged pi0
1037  if (!isPrimary && m02 >= 0 && m02 <= 4.8 )
1038  mcLabelCluster = 11; // NOTE secondary merged pi0
1039  }
1040  if (motherPDG == 221)
1041  mcLabelCluster = 12; // NOTE merged eta
1042  } else if (clusterClass == 1 && TrueClusterCandidate->IsMergedPartConv()){
1043  if (motherPDG == 111){
1044  mcLabelCluster = 13; // NOTE merged pi0 with one converted gamma
1045  if (!isPrimary && m02 >= 0 && m02 <= 4.8 )
1046  mcLabelCluster = 14; // NOTE merged secondary pi0 with one converted gamma
1047  }
1048  if (motherPDG == 221)
1049  mcLabelCluster = 15; // NOTE merged eta with one converted gamma
1050  } else if (clusterClass == 2){
1051  if (motherPDG == 111){
1052  mcLabelCluster = 20; // NOTE decay photon from pi0
1053  if (!isPrimary && m02 >= 0 && m02 <= 4.8 )
1054  mcLabelCluster = 21; // NOTE decay photon from secondary pi0
1055  }
1056  if (motherPDG == 221)
1057  mcLabelCluster = 22; // NOTE decay photon from eta
1058  } else if (clusterClass == 3){
1059  if (motherPDG == 111) {
1060  mcLabelCluster = 30; // NOTE electron from decayed pi0
1061  if (!isPrimary && m02 >= 0 && m02 <= 4.8 )
1062  mcLabelCluster = 31; // NOTE electron from decayed secondary pi0
1063  }
1064  if (motherPDG == 221)
1065  mcLabelCluster = 32; // NOTE electron from decayed eta
1066  }
1067 
1068  // leading particle is a photon or the conversion is fully contained and its not from pi0 || eta
1069  } else if (TrueClusterCandidate->IsLargestComponentPhoton() || TrueClusterCandidate->IsConversionFullyContained()
1070  || TrueClusterCandidate->IsElectronFromFragPhoton()){
1071 
1072  if(TrueClusterCandidate->IsLargestComponentPhoton()){
1073  // cluster is produced by a photon that either has no mother or the mother is neither from a pi^0 nor eta, e.g. inital collision
1074 
1075  if (motherLab == -1) mcLabelCluster = 40; // direct photon from initial collision
1076  else if ((motherLab >0) && (motherLab<9)) mcLabelCluster = 41; // photon from quark
1077  else if (motherLab == 11) mcLabelCluster = 42; // photon from electron
1078  else if (motherLab == 22){ // check for frag photon
1079 
1080  TParticle *dummyMother = fMCEvent->Particle(motherLab);
1081  Bool_t originReached = kFALSE;
1082  Bool_t isFragPhoton = kFALSE;
1083 
1084  while (dummyMother->GetPdgCode() == 22 && !originReached){ // follow photon's history, as long as the mother is a photon
1085  if (dummyMother->GetMother(0) > -1){
1086  dummyMother = fMCEvent->Particle(dummyMother->GetMother(0));
1087  if (TMath::Abs(dummyMother->GetPdgCode()) == 22){ // if mother of mother is again a photon, continue
1088  if (dummyMother->GetMother(0) > -1){
1089  dummyMother = fMCEvent->Particle(dummyMother->GetMother(0));
1090  } else {
1091  originReached = kTRUE;
1092  }
1093  } else {
1094  originReached = kTRUE;
1095  }
1096  isFragPhoton = (TMath::Abs(dummyMother->GetPdgCode()) < 6);// photon stems from quark = fragmentation photon
1097  } else {
1098  originReached = kTRUE;
1099  }
1100  }
1101 
1102  if(isFragPhoton) mcLabelCluster = 43; // Fragmentation photon
1103  else{
1104  mcLabelCluster = 47; // something like cluster <- photon <- photon <- X (not photon)
1105  AliInfo(Form("Mother of photon is photon etc. but origin is not quark. ID: %li", motherLab));
1106  }
1107  }
1108  else{
1109  mcLabelCluster = 44; // other (e.g. from meson decays that are not pi0 or eta0)
1110  AliInfo(Form("Single cluster is mainly produced by a photon and mother is %li", motherLab));
1111  }
1112  } else if(TrueClusterCandidate->IsConversionFullyContained()){
1113  // cluster is from a fully contained conversion
1114  mcLabelCluster = 45;
1115  } else if(TrueClusterCandidate->IsElectronFromFragPhoton()){
1116  mcLabelCluster = 46; // electron from frac
1117  }
1118 
1119  // leading particle is an electron and its not from pi0 || eta and no electron from fragmentation photon conversion
1120  } else if (TrueClusterCandidate->IsLargestComponentElectron() && !TrueClusterCandidate->IsElectronFromFragPhoton()){
1121  mcLabelCluster = 50; // NOTE single electron
1122  } else {
1123  // leading particle from hadron
1124  mcLabelCluster = 60; // NOTE hadron cluster
1125  AliInfo(Form("Single cluster is mainly produced by hadron with id: %li", motherLab));
1126  }
1127 
1128  delete mesoncand;
1129  return mcLabelCluster;
1130 }
1131 
1132 //________________________________________________________________________
1134  AliAODConversionPhoton *TrueSubClusterCandidate1,
1135  AliAODConversionPhoton *TrueSubClusterCandidate2)
1136 {
1137  Int_t mcLabelCluster = -5;
1138  const AliVVertex* primVtxMC = fMCEvent->GetPrimaryVertex();
1139  Double_t mcProdVtxX = primVtxMC->GetX();
1140  Double_t mcProdVtxY = primVtxMC->GetY();
1141  Double_t mcProdVtxZ = primVtxMC->GetZ();
1142 
1143  AliAODMCParticle *Photon = NULL;
1144  TClonesArray *AODMCTrackArray = dynamic_cast<TClonesArray*>(fInputEvent->FindListObject(AliAODMCParticle::StdBranchName()));
1145 
1146  if (AODMCTrackArray){
1147  if (!TrueClusterCandidate->GetIsCaloPhoton()) AliFatal("CaloPhotonFlag has not been set task will abort");
1148  if (TrueClusterCandidate->GetCaloPhotonMCLabel(0) < 0) {
1149  mcLabelCluster = -10;
1150  return mcLabelCluster;
1151  }
1152  if (TrueClusterCandidate->GetNCaloPhotonMCLabels()>0) Photon = (AliAODMCParticle*) AODMCTrackArray->At(TrueClusterCandidate->GetCaloPhotonMCLabel(0));
1153  else{
1154  mcLabelCluster = -11;
1155  return mcLabelCluster;
1156  }
1157  } else {
1158  AliInfo("AODMCTrackArray could not be loaded");
1159  mcLabelCluster = -90;
1160  return mcLabelCluster;
1161  }
1162  if(Photon == NULL){
1163  mcLabelCluster = -12;
1164  return mcLabelCluster;
1165  }
1166  AliAODConversionMother *mesoncand = new AliAODConversionMother(TrueSubClusterCandidate1,TrueSubClusterCandidate2);
1167 
1168  TrueClusterCandidate->SetCaloPhotonMCFlagsAOD(fInputEvent, kFALSE);
1169 
1170  Int_t clusterClass = 0;
1171  Bool_t isPrimary = ((AliConvEventCuts*)fEventCuts)->IsConversionPrimaryAOD( fInputEvent, Photon, mcProdVtxX, mcProdVtxY, mcProdVtxZ);
1172 
1173  Long_t motherLab = -1;
1174  if (TrueClusterCandidate->IsMerged() || TrueClusterCandidate->IsMergedPartConv()){
1175  clusterClass = 1;
1176  motherLab = TrueClusterCandidate->GetCaloPhotonMotherMCLabel(0);
1177  } else if (TrueClusterCandidate->GetNCaloPhotonMotherMCLabels()> 0){
1178  if (TrueClusterCandidate->IsLargestComponentElectron() || TrueClusterCandidate->IsLargestComponentPhoton()){
1179  if (TrueClusterCandidate->GetCaloPhotonMotherMCLabel(0) > -1 && (((AliAODMCParticle*) AODMCTrackArray->At(TrueClusterCandidate->GetCaloPhotonMotherMCLabel(0)))->GetPdgCode() == 111 || ((AliAODMCParticle*) AODMCTrackArray->At(TrueClusterCandidate->GetCaloPhotonMotherMCLabel(0)))->GetPdgCode() == 221) ){
1180  if ( TrueClusterCandidate->IsConversion() && !TrueClusterCandidate->IsConversionFullyContained() ){
1181  clusterClass = 3;
1182  motherLab = TrueClusterCandidate->GetCaloPhotonMotherMCLabel(0);
1183  } else {
1184  clusterClass = 2;
1185  motherLab = TrueClusterCandidate->GetCaloPhotonMotherMCLabel(0);
1186  }
1187  }
1188  } else if (TrueClusterCandidate->IsSubLeadingEM()){
1189  if (TrueClusterCandidate->GetNCaloPhotonMotherMCLabels()> 1){
1190  if ( TrueClusterCandidate->GetCaloPhotonMotherMCLabel(1) > -1){
1191  if (TMath::Abs(((AliAODMCParticle*) AODMCTrackArray->At(TrueClusterCandidate->GetCaloPhotonMotherMCLabel(1)))->GetPdgCode()) == 111 || TMath::Abs(((AliAODMCParticle*) AODMCTrackArray->At(TrueClusterCandidate->GetCaloPhotonMotherMCLabel(1)))->GetPdgCode()) == 221 ){
1192  clusterClass = 2;
1193  motherLab = TrueClusterCandidate->GetCaloPhotonMotherMCLabel(1);
1194  }
1195  }
1196  }
1197  } else {
1198  motherLab = TrueClusterCandidate->GetCaloPhotonMotherMCLabel(0);
1199  }
1200  }
1201 
1202  // Get Mother particle
1203  AliAODMCParticle *mother = NULL;
1204  Int_t motherPDG = -1;
1205  if (motherLab > -1)
1206  mother = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(motherLab));
1207  if (mother)
1208  motherPDG = TMath::Abs(mother->GetPdgCode());
1209 
1210  if (clusterClass == 1 || clusterClass == 2 || clusterClass == 3 ){
1211  // separate different components
1212  if (clusterClass == 1 && TrueClusterCandidate->IsMerged()){
1213  if (motherPDG == 111){
1214  mcLabelCluster = 10; // NOTE merged pi0
1215  if (!isPrimary && m02 >= 0 && m02 <= 4.8 )
1216  mcLabelCluster = 11; // NOTE secondary merged pi0
1217  }
1218  if (motherPDG == 221)
1219  mcLabelCluster = 12; // NOTE merged eta
1220  } else if (clusterClass == 1 && TrueClusterCandidate->IsMergedPartConv()){
1221  if (motherPDG == 111){
1222  mcLabelCluster = 13; // NOTE merged pi0 with one converted gamma
1223  if (!isPrimary && m02 >= 0 && m02 <= 4.8 )
1224  mcLabelCluster = 14; // NOTE merged secondary pi0 with one converted gamma
1225  }
1226  if (motherPDG == 221)
1227  mcLabelCluster = 15; // NOTE merged eta with one converted gamma
1228  } else if (clusterClass == 2){
1229  if (motherPDG == 111){
1230  mcLabelCluster = 20; // NOTE decay photon from pi0
1231  if (!isPrimary && m02 >= 0 && m02 <= 4.8 )
1232  mcLabelCluster = 21; // NOTE decay photon from secondary pi0
1233  }
1234  if (motherPDG == 221)
1235  mcLabelCluster = 22; // NOTE decay photon from eta
1236  } else if (clusterClass == 3){
1237  if (motherPDG == 111) {
1238  mcLabelCluster = 30; // NOTE electron from decayed pi0
1239  if (!isPrimary && m02 >= 0 && m02 <= 4.8 )
1240  mcLabelCluster = 31; // NOTE electron from decayed secondary pi0
1241  }
1242  if (motherPDG == 221)
1243  mcLabelCluster = 32; // NOTE electron from decayed eta
1244  }
1245  // leading particle is a photon or the conversion is fully contained and its not from pi0 || eta
1246  } else if (TrueClusterCandidate->IsLargestComponentPhoton() || TrueClusterCandidate->IsConversionFullyContained()
1247  || TrueClusterCandidate->IsElectronFromFragPhoton()){
1248 
1249  if(TrueClusterCandidate->IsLargestComponentPhoton()){
1250  // cluster is produced by a photon that either has no mother or the mother is neither from a pi^0 nor eta, e.g. inital collision
1251 
1252  if (motherLab == -1) mcLabelCluster = 40; // direct photon from initial collision
1253  else if ((motherLab >0) && (motherLab<9)) mcLabelCluster = 41; // photon from quark
1254  else if (motherLab == 11) mcLabelCluster = 42; // photon from electron
1255  else if (motherLab == 22){ // check for frag photon
1256 
1257  AliAODMCParticle *dummyMother = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(motherLab));
1258  Bool_t originReached = kFALSE;
1259  Bool_t isFragPhoton = kFALSE;
1260 
1261  while (dummyMother->GetPdgCode() == 22 && !originReached){ // follow photon's history, as long as the mother is a photon
1262  if (dummyMother->GetMother() > -1){
1263  dummyMother = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(dummyMother->GetMother()));
1264 
1265  if (TMath::Abs(dummyMother->GetPdgCode()) == 22){ // if mother of mother is again a photon, continue
1266  if (dummyMother->GetMother() > -1){
1267  dummyMother = static_cast<AliAODMCParticle*>(AODMCTrackArray->At(dummyMother->GetMother()));
1268  } else {
1269  originReached = kTRUE;
1270  }
1271  } else {
1272  originReached = kTRUE;
1273  }
1274  isFragPhoton = (TMath::Abs(dummyMother->GetPdgCode()) < 6);// photon stems from quark = fragmentation photon
1275  } else {
1276  originReached = kTRUE;
1277  }
1278  }
1279 
1280  if(isFragPhoton) mcLabelCluster = 43; // Fragmentation photon
1281  else{
1282  mcLabelCluster = 47; // something like cluster <- photon <- photon <- X (not photon)
1283  AliInfo(Form("Mother of photon is photon etc. but origin is not quark. ID: %li", motherLab));
1284  }
1285  }
1286  else{
1287  mcLabelCluster = 44; // other (e.g. from meson decays that are not pi0 or eta0)
1288  AliInfo(Form("Single cluster is mainly produced by a photon and mother is %li", motherLab));
1289  }
1290  } else if(TrueClusterCandidate->IsConversionFullyContained()){
1291  // cluster is from a fully contained conversion
1292  mcLabelCluster = 45;
1293  } else if(TrueClusterCandidate->IsElectronFromFragPhoton()){
1294  mcLabelCluster = 46; // electron from frac
1295  }
1296 
1297  // leading particle is an electron and its not from pi0 || eta and no electron from fragmentation photon conversion
1298  } else if (TrueClusterCandidate->IsLargestComponentElectron() && !TrueClusterCandidate->IsElectronFromFragPhoton()){
1299  mcLabelCluster = 50; // NOTE single electron
1300  } else {
1301  // leading particle from hadron
1302  mcLabelCluster = 60; // NOTE hadron cluster
1303  AliInfo(Form("Single cluster is mainly produced by hadron with id: %li", motherLab));
1304  }
1305 
1306  delete mesoncand;
1307  return mcLabelCluster;
1308 }
1309 //_____________________________________________________________________________
1310 ULong64_t AliAnalysisTaskClusterQA::GetUniqueEventID(AliVHeader* header)
1311 {
1312  // To have a unique id for each event in a run!
1313  // Modified from AliRawReader.h
1314  return ((ULong64_t)header->GetBunchCrossNumber()+
1315  (ULong64_t)header->GetOrbitNumber()*3564+
1316  (ULong64_t)header->GetPeriodNumber()*16777215*3564);
1317 }
1318 
1319 //-------------------------------------------------------------
1321 { // Get Event Centrality
1322 
1323  AliESDEvent *esdEvent=dynamic_cast<AliESDEvent*>(event);
1324  if(esdEvent){
1325  AliMultSelection *MultSelection = (AliMultSelection*)event->FindListObject("MultSelection");
1326  if(!MultSelection){
1327  AliWarning ("AliMultSelection object not found !");
1328  return -1;
1329  }else{
1330  return MultSelection->GetMultiplicityPercentile("V0M");// default
1331  }
1332  }
1333 
1334 
1335  return -1;
1336 }
1338  fBuffer_EventID = 0;
1339  fBuffer_ClusterE = 0;
1340  fBuffer_ClusterPhi = 0;
1341  fBuffer_ClusterEta = 0;
1342  fBuffer_ClusterIsEMCAL = kFALSE;
1349  fBuffer_ClusterM02 = 0;
1350  fBuffer_ClusterM20 = 0;
1358 
1359  for(Int_t cell = 0; cell < kMaxActiveCells; cell++){
1360  fBuffer_Cells_E[cell] = 0;
1361  fBuffer_Cells_RelativeEta[cell] = 0;
1362  fBuffer_Cells_RelativePhi[cell] = 0;
1363  fBuffer_Surrounding_Cells_ID[cell] = 0;
1364  fBuffer_Surrounding_Cells_R[cell] = 0;
1365  fBuffer_Surrounding_Cells_E[cell] = 0;
1368  }
1369  for(Int_t track = 0; track < kMaxNTracks; track++){
1370  fBuffer_Surrounding_Tracks_R[track] = 0;
1371  fBuffer_Surrounding_Tracks_Pt[track] = 0;
1372  fBuffer_Surrounding_Tracks_P[track] = 0;
1375  }
1376 }
1377 
void SetPeriodEnum(TString periodName)
Int_t fBuffer_Surrounding_NTracks
! array buffer
void SetCaloClusterRef(Long_t ref)
double Double_t
Definition: External.C:58
Float_t fBuffer_ClusterPhi
! array buffer
virtual void UserExec(Option_t *option)
Definition: External.C:236
void SetCaloPhotonMCFlags(AliMCEvent *mcEvent, Bool_t enableSort)
ULong64_t GetUniqueEventID(AliVHeader *header)
Float_t fBuffer_Event_Vertex_Y
! array buffer
Int_t MakePhotonCandidates(AliVCluster *clus, AliVCaloCells *cells, Long_t indexCluster)
PeriodVar GetPeriodEnum()
Bool_t fSaveMCInformation
save MC information
void SetPeriodEnumExplicit(PeriodVar periodEnum)
const Int_t kMaxNTracks
Float_t fBuffer_ClusterE
! array buffer
centrality
Float_t * fBuffer_Cells_RelativeEta
! array buffer
Bool_t fSaveEventProperties
save general event properties (centrality etc.)
Float_t fConeRadius
save arrays of all cells in event
TString GetPeriodName()
void SetCaloPhotonMCLabel(Int_t i, Int_t labelCaloPhoton)
Int_t fBuffer_Mother_MC_Label
! array buffer
Float_t * fBuffer_Surrounding_Tracks_R
! array buffer
Float_t fBuffer_Event_Vertex_Z
! array buffer
Int_t GetCaloPhotonMotherMCLabel(Int_t i)
Bool_t fBuffer_ClusterIsEMCAL
! array buffer
Float_t fBuffer_Event_Vertex_X
! array buffer
Int_t fBuffer_LeadingCell_ID
! array buffer
void GetRowAndColumnFromAbsCellID(Int_t cellIndex, Int_t &row, Int_t &column)
void ProcessTracksAndMatching(AliVCluster *clus, Long_t indexCluster)
Float_t fBuffer_Event_Multiplicity
! array buffer
Int_t * fBuffer_Surrounding_Cells_ID
! array buffer
Int_t FindLargestCellInCluster(AliVCluster *cluster, AliVEvent *event)
Float_t * fBuffer_Surrounding_Cells_E
! array buffer
Float_t fBuffer_LeadingCell_Phi
! array buffer
Int_t IsEventAcceptedByCut(AliConvEventCuts *ReaderCuts, AliVEvent *event, AliMCEvent *mcEvent, Int_t isHeavyIon, Bool_t isEMCALAnalysis)
int Int_t
Definition: External.C:63
Float_t * fBuffer_Surrounding_Cells_R
! array buffer
Class handling all kinds of selection cuts for Gamma Calo analysis.
void ProcessQATreeCluster(AliVEvent *event, AliVCluster *cluster, Long_t indexCluster)
Float_t * fBuffer_Cells_RelativePhi
! array buffer
Float_t * fBuffer_Surrounding_Tracks_RelativeEta
! array buffer
float Float_t
Definition: External.C:68
Float_t * fBuffer_Surrounding_Tracks_Pt
! array buffer
Bool_t IsConversionPrimaryESD(AliMCEvent *mcEvent, Long_t eventpos, Double_t prodVtxX, Double_t prodVtxY, Double_t prodVtxZ)
Int_t fBuffer_Cluster_MC_Label
! array buffer
Bool_t fSaveSurroundingCells
save arrays of all cells in event
Float_t fBuffer_ClusterM20
! array buffer
Bool_t fSaveAdditionalHistos
save MC information
Float_t fMinClusterEnergy
save arrays of all cells in event
Int_t * fBuffer_Cells_ID
! array buffer
Int_t fMaxNLMCut
save MC information
Bool_t Data(TH1F *h, Double_t *rangefit, Bool_t writefit, Double_t &sgn, Double_t &errsgn, Double_t &bkg, Double_t &errbkg, Double_t &sgnf, Double_t &errsgnf, Double_t &sigmafit, Int_t &status)
short Short_t
Definition: External.C:23
Float_t fBuffer_ClusterM02
! array buffer
virtual void Terminate(Option_t *)
Int_t fBuffer_Event_NumActiveCells
! array buffer
Float_t fBuffer_ClusterEta
! array buffer
Float_t GetCentrality(AliVEvent *event)
Bool_t fSaveCells
save arrays of cluster cells
static Bool_t ExtrapolateTrackToCluster(AliExternalTrackParam *trkParam, const AliVCluster *cluster, Double_t mass, Double_t step, Float_t &tmpEta, Float_t &tmpPhi)
Float_t * fBuffer_Surrounding_Tracks_P
! array buffer
ULong64_t fBuffer_EventID
! array buffer
Float_t * fBuffer_Surrounding_Cells_RelativePhi
! array buffer
Class handling all kinds of selection cuts for Gamma Conversion analysis.
Int_t fBuffer_ClusterNumCells
! array buffer
void SetNCaloPhotonMCLabels(Int_t nLabels)
Float_t fBuffer_LeadingCell_Eta
! array buffer
const Int_t kMaxActiveCells
Class handling all kinds of selection cuts for Gamma Conversion analysis.
Int_t fBuffer_MC_Cluster_Flag
! array buffer
Float_t * fBuffer_Surrounding_Cells_RelativeEta
! array buffer
Int_t ProcessTrueClusterCandidatesAOD(AliAODConversionPhoton *TrueClusterCandidate, Float_t m02, AliAODConversionPhoton *TrueSubClusterCandidate1, AliAODConversionPhoton *TrueSubClusterCandidate2)
AliConversionMesonCuts * fMesonCuts
Float_t fBuffer_LeadingCell_E
! array buffer
AliConvEventCuts * GetEventCuts()
Definition: AliV0ReaderV1.h:90
const char Option_t
Definition: External.C:48
bool Bool_t
Definition: External.C:53
Float_t * fBuffer_Surrounding_Tracks_RelativePhi
! array buffer
void SetCaloPhotonMCFlagsAOD(AliVEvent *event, Bool_t enableSort)
Float_t * fBuffer_Cells_E
! array buffer
Int_t fMinNLMCut
save MC information
Int_t fBuffer_Surrounding_NCells
! array buffer
Bool_t fSaveTracks
save arrays of all cells in event
Int_t ProcessTrueClusterCandidates(AliAODConversionPhoton *TrueClusterCandidate, Float_t m02, AliAODConversionPhoton *TrueSubClusterCandidate1, AliAODConversionPhoton *TrueSubClusterCandidate2)
TList * OpenFile(const char *fname)
Definition: DrawAnaELoss.C:65
Float_t fMinTrackPt
save arrays of all cells in event