AliPhysics  master (3d17d9d)
AliIsolationCut.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: The ALICE Off-line Project. *
5  * Contributors are mentioned in the code where appropriate. *
6  * *
7  * Permission to use, copy, modify and distribute this software and its *
8  * documentation strictly for non-commercial purposes is hereby granted *
9  * without fee, provided that the above copyright notice appears in all *
10  * copies and that both the copyright notice and this permission notice *
11  * appear in the supporting documentation. The authors make no claims *
12  * about the suitability of this software for any purpose. It is *
13  * provided "as is" without express or implied warranty. *
14  **************************************************************************/
15 
16 // --- ROOT system ---
17 #include <TObjArray.h>
18 
19 // --- AliRoot system ---
21 #include "AliEMCALGeometry.h"
22 #include "AliEMCALGeoParams.h"
23 #include "AliAODTrack.h"
24 #include "AliVCluster.h"
25 #include "AliMixedEvent.h"
26 #include "AliLog.h"
27 
28 // --- CaloTrackCorrelations ---
29 #include "AliCaloTrackReader.h"
30 #include "AliCalorimeterUtils.h"
31 #include "AliCaloPID.h"
32 #include "AliFiducialCut.h"
33 #include "AliHistogramRanges.h"
34 
35 #include "AliIsolationCut.h"
36 
38 ClassImp(AliIsolationCut) ;
40 
41 //____________________________________
43 //____________________________________
45 TObject(),
46 fFillHistograms(0), fFillEtaPhiHistograms(0), fMakeConeExcessCorr(0),
47 fConeSize(0.), fPtThreshold(0.), fPtThresholdMax(10000.),
48 fSumPtThreshold(0.), fSumPtThresholdMax(10000.), fPtFraction(0.),
49 fICMethod(0), fPartInCone(0),
50 fFracIsThresh(1), fIsTMClusterInConeRejected(1), fDistMinToTrigger(-1.),
51 fNeutralOverChargedRatio(0),
52 fDebug(0), fMomentum(), fTrackVector(),
53 fEMCEtaSize(-1), fEMCPhiMin(-1), fEMCPhiMax(-1),
54 fTPCEtaSize(-1), fTPCPhiSize(-1),
55 // Histograms
56 fHistoRanges(0),
57 fhPtInCone(0),
58 fhPtClusterInCone(0), fhPtTrackInCone(0),
59 fhConeSumPt(0),
60 fhConeSumPtCluster(0), fhConeSumPtTrack(0),
61 fhConeSumPtClustervsTrack(0), fhConeSumPtClusterTrackFrac(0),
62 fhConeSumPtTrigEtaPhi(0),
63 fhConeSumPtUESub(0),
64 fhConeSumPtUESubCluster(0), fhConeSumPtUESubTrack(0),
65 fhConeSumPtUESubClustervsTrack(0), fhConeSumPtUESubClusterTrackFrac(0),
66 fhConeSumPtUESubTrigEtaPhi(0),
67 fhConePtLead(0),
68 fhConePtLeadCluster(0), fhConePtLeadTrack(0),
69 fhConePtLeadClustervsTrack(0), fhConePtLeadClusterTrackFrac(0),
70 fhEtaPhiCluster(0), fhEtaPhiTrack(0),
71 fhEtaPhiInConeCluster(0), fhEtaPhiInConeTrack(0),
72 fhPtInPerpCone(0), fhPerpConeSumPt(0),
73 fhEtaPhiInPerpCone(0), fhConeSumPtVSPerpCone(0),
74 fhPerpConeSumPtTrigEtaPhi(0),
75 fhEtaBandClusterPt(0), fhPhiBandClusterPt(0),
76 fhEtaBandTrackPt(0), fhPhiBandTrackPt(0),
77 fhConeSumPtEtaBandUECluster(0), fhConeSumPtPhiBandUECluster(0),
78 fhConeSumPtEtaBandUETrack(0), fhConeSumPtPhiBandUETrack(0),
79 fhEtaBandClusterEtaPhi(0), fhPhiBandClusterEtaPhi(0),
80 fhEtaBandTrackEtaPhi(0), fhPhiBandTrackEtaPhi(0),
81 fhConeSumPtEtaBandUEClusterTrigEtaPhi(0), fhConeSumPtPhiBandUEClusterTrigEtaPhi(0),
82 fhConeSumPtEtaBandUETrackTrigEtaPhi(0), fhConeSumPtPhiBandUETrackTrigEtaPhi(0),
83 fhConeSumPtVSUETracksEtaBand(0), fhConeSumPtVSUETracksPhiBand(0),
84 fhConeSumPtVSUEClusterEtaBand(0), fhConeSumPtVSUEClusterPhiBand(0),
85 fhConeSumPtUEBandNormCluster(0), fhConeSumPtUEBandNormTrack(0),
86 fhFractionTrackOutConeEta(0), fhFractionTrackOutConeEtaTrigEtaPhi(0),
87 fhFractionClusterOutConeEta(0), fhFractionClusterOutConeEtaTrigEtaPhi(0),
88 fhFractionClusterOutConePhi(0), fhFractionClusterOutConePhiTrigEtaPhi(0),
89 fhFractionClusterOutConeEtaPhi(0), fhFractionClusterOutConeEtaPhiTrigEtaPhi(0),
90 fhConeSumPtUEBandSubClustervsTrack(0),
91 fhBandClustervsTrack(0), fhBandNormClustervsTrack(0),
92 fhConeSumPtTrackSubVsNoSub(0), fhConeSumPtClusterSubVsNoSub(0)
93 {
95 }
96 
97 //_________________________________________________________________________________________________________________________________
113 //_________________________________________________________________________________________________________________________________
115 (
117  Bool_t bFillAOD , Bool_t useRefs,
118  TString aodArrayRefName , TObjArray * bgCls,
119  Int_t calorimeter , AliCaloPID * pid,
120  Int_t & nPart , Int_t & nfrac,
121  Float_t & coneptsumCluster , Float_t & coneptLeadCluster,
122  Float_t & etaBandPtSumCluster, Float_t & phiBandPtSumCluster,
123  Double_t histoWeight
124 )
125 {
126  if ( fPartInCone == kOnlyCharged ) return ;
127 
128  // Get the array with clusters
129  //
130  TObjArray * plNe = 0x0;
131 
132  if ( bgCls )
133  {
134  plNe = bgCls ;
135  }
136  else if ( !useRefs )
137  {
138  if (calorimeter == AliFiducialCut::kPHOS )
139  plNe = reader->GetPHOSClusters();
140  else if (calorimeter == AliFiducialCut::kEMCAL)
141  plNe = reader->GetEMCALClusters();
142  }
143  else
144  {
145  plNe = pCandidate->GetObjArray(aodArrayRefName+"Clusters");
146  }
147 
148  if ( !plNe )
149  {
150  // In case of no entries, add 0 to histogram to keep number of trigger entries
151  if ( fFillHistograms )
152  {
153  if( fICMethod != kSumBkgSubIC )
154  fhConeSumPtCluster ->Fill(pCandidate->Pt(), 0., histoWeight);
155 
156  fhConePtLeadCluster->Fill(pCandidate->Pt(), 0., histoWeight);
157  }
158 
159  if ( coneptLeadCluster > 0 || coneptsumCluster > 0 )
160  AliError(Form("No ref clusters!!! sum %f, lead %f",coneptsumCluster,coneptLeadCluster));
161 
162  return ;
163  }
164 
165  // Init parameters
166  //
167  Float_t ptC = pCandidate->Pt() ;
168  Float_t phiC = pCandidate->Phi() ;
169  if ( phiC < 0 ) phiC+=TMath::TwoPi();
170  Float_t etaC = pCandidate->Eta() ;
171 
172  Float_t pt = -100. ;
173  Float_t eta = -100. ;
174  Float_t phi = -100. ;
175  Float_t rad = -100. ;
176 
177  TObjArray * refclusters = 0x0;
178  Int_t nclusterrefs = 0;
179 
180  // Get the clusters
181  //
182  //printf("Loop calo\n");
183  for(Int_t ipr = 0;ipr < plNe->GetEntries() ; ipr ++ )
184  {
185  AliVCluster * calo = dynamic_cast<AliVCluster *>(plNe->At(ipr)) ;
186 
187  if ( calo )
188  {
189  // Get the index where the cluster comes, to retrieve the corresponding vertex
190  Int_t evtIndex = 0 ;
191  if ( reader->GetMixedEvent() )
192  evtIndex=reader->GetMixedEvent()->EventIndexForCaloCluster(calo->GetID()) ;
193 
194 
195  // Do not count the candidate (photon or pi0) or the daughters of the candidate
196  if ( calo->GetID() == pCandidate->GetCaloLabel(0) ||
197  calo->GetID() == pCandidate->GetCaloLabel(1) ) continue ;
198 
199  // Skip matched clusters with tracks in case of neutral+charged analysis
201  {
203  pid->IsTrackMatched(calo,reader->GetCaloUtils(),reader->GetInputEvent()) ) continue ;
204  }
205 
206  // Assume that come from vertex in straight line
207  calo->GetMomentum(fMomentum,reader->GetVertex(evtIndex)) ;
208 
209  pt = fMomentum.Pt() ;
210  eta = fMomentum.Eta() ;
211  phi = fMomentum.Phi() ;
212  }
213  else
214  {// Mixed event stored in AliCaloTrackParticles
215  AliCaloTrackParticle * calomix = dynamic_cast<AliCaloTrackParticle*>(plNe->At(ipr)) ;
216 
217  if ( !calomix )
218  {
219  AliWarning("Wrong calo data type, continue");
220  continue;
221  }
222 
223  pt = calomix->Pt();
224  eta = calomix->Eta();
225  phi = calomix->Phi() ;
226  }
227 
228  // ** Calculate distance between candidate and tracks **
229 
230  if( phi < 0 ) phi+=TMath::TwoPi();
231 
232  rad = Radius(etaC, phiC, eta, phi);
233 
234  // ** Exclude clusters too close to the candidate, inactive by default **
235 
236  if ( rad < fDistMinToTrigger ) continue ;
237 
238  // ** For the background out of cone **
239 
241  fhEtaPhiCluster->Fill(eta, phi, histoWeight);
242 
243  if ( fICMethod >= kSumBkgSubIC && rad > fConeSize )
244  {
245  // phi band
246  if(eta > (etaC-fConeSize) && eta < (etaC+fConeSize))
247  {
248  phiBandPtSumCluster += pt;
249 
250  if ( fFillHistograms )
251  {
252  fhPhiBandClusterPt->Fill(ptC, pt, histoWeight);
253 
254  if ( fFillEtaPhiHistograms )
255  fhPhiBandClusterEtaPhi->Fill(eta, phi, histoWeight);
256  }
257  } // phi band
258 
259  // eta band
260  if(phi > (phiC-fConeSize) && phi < (phiC+fConeSize))
261  {
262  etaBandPtSumCluster += pt;
263 
264  if ( fFillHistograms )
265  {
266  fhEtaBandClusterPt->Fill(ptC, pt, histoWeight);
267 
268  if ( fFillEtaPhiHistograms )
269  fhEtaBandClusterEtaPhi->Fill(eta, phi, histoWeight);
270  }
271  } // eta band
272  } // out of cone
273 
274  //-------------------------------------------------------------
275  // ** For the isolated particle **
276  //-------------------------------------------------------------
277 
278  // Only loop the particle at the same side of candidate
279  if ( TMath::Abs(phi-phiC)>TMath::PiOver2() ) continue ;
280 
281  // // If at the same side has particle larger than candidate,
282  // // then candidate can not be the leading, skip such events
283  // if(pt > ptC)
284  // {
285  // n = -1;
286  // nfrac = -1;
287  // coneptsumCluster = -1;
288  // isolated = kFALSE;
289  //
290  // pCandidate->SetLeadingParticle(kFALSE);
291  //
292  // if(bFillAOD)
293  // {
294  // if(reftracks)
295  // {
296  // reftracks ->Clear();
297  // delete reftracks;
298  // }
299  //
300  // if(refclusters)
301  // {
302  // refclusters->Clear();
303  // delete refclusters;
304  // }
305  // }
306  // return ;
307  // }
308 
309  AliDebug(2,Form("\t Cluster %d, pT %2.2f, eta %1.2f, phi %2.2f, R candidate %2.2f",
310  ipr,pt,eta,phi,rad));
311 
312  //
313  // Select calorimeter clusters inside the isolation radius
314  //
315  if ( rad > fConeSize ) continue ;
316 
317  AliDebug(2,"Inside candidate cone");
318 
319  if ( bFillAOD )
320  {
321  nclusterrefs++;
322 
323  if ( nclusterrefs == 1 )
324  {
325  refclusters = new TObjArray(0);
326  //refclusters->SetName(Form("Clusters%s",aodArrayRefName.Data()));
327  TString tempo(aodArrayRefName) ;
328  tempo += "Clusters" ;
329  refclusters->SetName(tempo);
330  refclusters->SetOwner(kFALSE);
331  }
332 
333  refclusters->Add(calo);
334  }
335 
336  coneptsumCluster+=pt;
337 
338  if ( coneptLeadCluster < pt ) coneptLeadCluster = pt;
339 
340  if ( fFillHistograms )
341  {
342  fhPtInCone->Fill(ptC, pt, histoWeight);
343 
345  fhPtClusterInCone->Fill(ptC, pt, histoWeight);
346 
347  if ( fFillEtaPhiHistograms )
348  fhEtaPhiInConeCluster->Fill(eta, phi, histoWeight);
349  }
350 
351  // *Before*, count particles in cone
352  //
353  if ( pt > fPtThreshold && pt < fPtThresholdMax ) nPart++;
354 
355  //if fPtFraction*ptC<fPtThreshold then consider the fPtThreshold directly
356  if ( fFracIsThresh )
357  {
358  if ( fPtFraction*ptC < fPtThreshold )
359  {
360  if ( pt > fPtThreshold ) nfrac++ ;
361  }
362  else
363  {
364  if ( pt > fPtFraction*ptC ) nfrac++;
365  }
366  }
367  else
368  {
369  if ( pt > fPtFraction*ptC ) nfrac++;
370  }
371 
372  }// neutral particle loop
373  //printf("end loop, fill histo\n");
374  if ( fFillHistograms ) // Do not fill in perp cones case
375  {
376  //printf("A\n");
378  {
379  fhConeSumPtCluster ->Fill(ptC, coneptsumCluster , histoWeight);
380  fhConePtLeadCluster->Fill(ptC, coneptLeadCluster, histoWeight);
381  }
382 
383  //printf("B\n");
384 
385  // UE substraction
387  {
388  fhConeSumPtEtaBandUECluster->Fill(ptC, etaBandPtSumCluster, histoWeight);
389  fhConeSumPtPhiBandUECluster->Fill(ptC, phiBandPtSumCluster, histoWeight);
390 
391  //printf("C\n");
392 
393  fhConeSumPtVSUEClusterEtaBand->Fill(coneptsumCluster, etaBandPtSumCluster, histoWeight);
394  fhConeSumPtVSUEClusterPhiBand->Fill(coneptsumCluster, phiBandPtSumCluster, histoWeight);
395 
396  //printf("A\n");
397 
398  if ( fFillEtaPhiHistograms )
399  {
400  fhConeSumPtEtaBandUEClusterTrigEtaPhi->Fill(etaC, phiC, etaBandPtSumCluster*histoWeight); // Check
401  fhConeSumPtPhiBandUEClusterTrigEtaPhi->Fill(etaC, phiC, phiBandPtSumCluster*histoWeight); // Check
402  }
403  } // UE sub
404  } // fill histo
405 
406  // Add calculated values to pCandidate, might be modified later
407  // if UE subtraction and normalization requested
408 
409  // Add reference arrays to AOD when filling AODs only
410  if ( bFillAOD && refclusters ) pCandidate->AddObjArray(refclusters);
411 }
412 
413 //_________________________________________________________________________________________________________________________________
431 //_________________________________________________________________________________________________________________________________
433 (
435  Bool_t bFillAOD , Bool_t useRefs,
436  TString aodArrayRefName , TObjArray * bgTrk,
437  Int_t & nPart , Int_t & nfrac,
438  Float_t & coneptsumTrack , Float_t & coneptLeadTrack,
439  Float_t & etaBandPtSumTrack, Float_t & phiBandPtSumTrack,
440  Float_t & perpConePtSumTrack, Double_t histoWeight
441 )
442 {
443  if ( fPartInCone == kOnlyNeutral ) return ;
444 
445  // Get the array with tracks
446  //
447  TObjArray * plCTS = 0x0;
448  if ( bgTrk )
449  {
450  plCTS = bgTrk;
451  }
452  else if ( !useRefs )
453  {
454  plCTS = reader->GetCTSTracks();
455  }
456  else
457  {
458  plCTS = pCandidate->GetObjArray(aodArrayRefName+"Tracks");
459  }
460 
461  if ( !plCTS )
462  {
463  // In case of no entries, add 0 to histogram to keep number of trigger entries
464  if ( fFillHistograms )
465  {
466  fhConeSumPtTrack ->Fill(pCandidate->Pt(), 0., histoWeight);
467 
468  fhConePtLeadTrack ->Fill(pCandidate->Pt(), 0., histoWeight);
469  } // histograms
470 
471  if(coneptLeadTrack > 0 || coneptsumTrack > 0)
472  AliError(Form("No ref tracks!!! sum %f, lead %f",coneptsumTrack,coneptLeadTrack));
473 
474  return ;
475  }
476 
477  //-----------------------------------------------------------
478  // Init parameters
479  //
480  Float_t ptTrig = pCandidate->Pt() ;
481  Float_t phiTrig = pCandidate->Phi() ;
482  if ( phiTrig < 0 ) phiTrig+=TMath::TwoPi();
483  Float_t etaTrig = pCandidate->Eta() ;
484 
485  Float_t ptTrack = -100. ;
486  Float_t etaTrack = -100. ;
487  Float_t phiTrack = -100. ;
488  Float_t rad = -100. ;
489 
490  TObjArray * reftracks = 0x0;
491  Int_t ntrackrefs = 0;
492 
493  //-----------------------------------------------------------
494  // Get the tracks in cone
495  //
496  //-----------------------------------------------------------
497  for(Int_t ipr = 0;ipr < plCTS->GetEntries() ; ipr ++ )
498  {
499  AliVTrack* track = dynamic_cast<AliVTrack*>(plCTS->At(ipr)) ;
500 
501  if(track)
502  {
503  // In case of isolation of single tracks or conversion photon (2 tracks) or pi0 (4 tracks),
504  // do not count the candidate or the daughters of the candidate
505  // in the isolation conte
506  if ( pCandidate->GetDetectorTag() == AliFiducialCut::kCTS ) // make sure conversions are tagged as kCTS!!!
507  {
508  Int_t trackID = reader->GetTrackID(track) ; // needed instead of track->GetID() since AOD needs some manipulations
509  Bool_t contained = kFALSE;
510 
511  for(Int_t i = 0; i < 4; i++)
512  {
513  if( trackID == pCandidate->GetTrackLabel(i) ) contained = kTRUE;
514  }
515 
516  if ( contained ) continue ;
517  }
518 
519  fTrackVector.SetXYZ(track->Px(),track->Py(),track->Pz());
520  ptTrack = fTrackVector.Pt();
521  etaTrack = fTrackVector.Eta();
522  phiTrack = fTrackVector.Phi() ;
523  }
524  else
525  {// Mixed event stored in AliCaloTrackParticles
526  AliCaloTrackParticle * trackmix = dynamic_cast<AliCaloTrackParticle*>(plCTS->At(ipr)) ;
527  if(!trackmix)
528  {
529  AliWarning("Wrong track data type, continue");
530  continue;
531  }
532 
533  ptTrack = trackmix->Pt();
534  etaTrack = trackmix->Eta();
535  phiTrack = trackmix->Phi() ;
536  }
537 
538  // ** Calculate distance between candidate and tracks **
539 
540  if ( phiTrack < 0 ) phiTrack+=TMath::TwoPi();
541 
542  rad = Radius(etaTrig, phiTrig, etaTrack, phiTrack);
543 
544  // ** Exclude tracks too close to the candidate, inactive by default **
545 
546  if ( rad < fDistMinToTrigger ) continue ;
547 
548  // ** For the background out of cone **
549 
551  fhEtaPhiTrack->Fill(etaTrack, phiTrack, histoWeight);
552 
553  if ( fICMethod >= kSumBkgSubIC && rad > fConeSize )
554  {
555  // Phi band
556  if ( etaTrack > (etaTrig-fConeSize) && etaTrack < (etaTrig+fConeSize) &&
557  TMath::Abs(phiTrig-phiTrack) < TMath::PiOver2() ) // Look only half TPC with respect candidate, avoid opposite side jet
558  {
559  phiBandPtSumTrack += ptTrack;
560 
561  if ( fFillHistograms )
562  {
563  fhPhiBandTrackPt->Fill(ptTrig , ptTrack, histoWeight);
564 
565  if ( fFillEtaPhiHistograms )
566  fhPhiBandTrackEtaPhi->Fill(etaTrig, phiTrig, histoWeight);
567  }
568  } // phi band
569 
570  // Eta band
571  if ( phiTrack > (phiTrig-fConeSize) && phiTrack < (phiTrig+fConeSize) )
572  {
573  etaBandPtSumTrack += ptTrack;
574 
575  if ( fFillHistograms )
576  {
577  fhEtaBandTrackPt->Fill(ptTrig , ptTrack, histoWeight);
578 
579  if ( fFillEtaPhiHistograms )
580  fhEtaBandTrackEtaPhi->Fill(etaTrig, phiTrig, histoWeight);
581  }
582  } // eta band
583 
584  } // out of cone
585 
586  //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
587  // Fill the histograms at +-45 degrees in phi
588  // from trigger particle, perpedicular to trigger axis in phi
589  //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
590  if ( fICMethod == kSumBkgSubIC )
591  {
592  Double_t dEta = etaTrig - etaTrack;
593 
594  Double_t dPhiPlu = phiTrig - phiTrack + TMath::PiOver2();
595  Double_t dPhiMin = phiTrig - phiTrack - TMath::PiOver2();
596 
597  Double_t argPlu = dPhiPlu*dPhiPlu + dEta*dEta;
598  Double_t argMin = dPhiMin*dPhiMin + dEta*dEta;
599 
600  Bool_t fillPerp = kFALSE;
601  if ( TMath::Sqrt(argPlu) < fConeSize ) fillPerp = kTRUE ;
602  if ( TMath::Sqrt(argMin) < fConeSize ) fillPerp = kTRUE ;
603 
604  if ( fillPerp )
605  {
606  perpConePtSumTrack+=ptTrack;
607 
608  if ( fFillHistograms )
609  {
610  fhPtInPerpCone->Fill(ptTrig, ptTrack, histoWeight);
611 
612  if ( fFillEtaPhiHistograms )
613  fhEtaPhiInPerpCone->Fill(etaTrack,phiTrack, histoWeight);
614  }
615  }
616  }
617  //-------------------------------------------------------------
618  // ** For the isolated particle **
619  //-------------------------------------------------------------
620 
621  // Only loop the particle at the same side of candidate
622  if ( TMath::Abs(phiTrack-phiTrig) > TMath::PiOver2() ) continue ;
623 
624  // // If at the same side has particle larger than candidate,
625  // // then candidate can not be the leading, skip such events
626  // if(pt > ptTrig)
627  // {
628  // n = -1;
629  // nfrac = -1;
630  // coneptsumTrack = -1;
631  // isolated = kFALSE;
632  //
633  // pCandidate->SetLeadingParticle(kFALSE);
634  //
635  // if(bFillAOD && reftracks)
636  // {
637  // reftracks->Clear();
638  // delete reftracks;
639  // }
640  //
641  // return ;
642  // }
643 
644  AliDebug(2,Form("\t Track %d, pT %2.2f, eta %1.2f, phi %2.2f, R candidate %2.2f",
645  ipr,ptTrack,etaTrack,phiTrack,rad));
646 
647  //
648  // Select tracks inside the isolation radius
649  //
650  if ( rad > fConeSize ) continue ;
651 
652  AliDebug(2,"Inside candidate cone");
653 
654  if ( bFillAOD )
655  {
656  ntrackrefs++;
657 
658  if ( ntrackrefs == 1 )
659  {
660  reftracks = new TObjArray(0);
661  //reftracks->SetName(Form("Tracks%s",aodArrayRefName.Data()));
662  TString tempo(aodArrayRefName) ;
663  tempo += "Tracks" ;
664  reftracks->SetName(tempo);
665  reftracks->SetOwner(kFALSE);
666  }
667 
668  reftracks->Add(track);
669  }
670 
671  coneptsumTrack+=ptTrack;
672 
673  if ( coneptLeadTrack < ptTrack ) coneptLeadTrack = ptTrack;
674 
675  if ( fFillHistograms )
676  {
677  fhPtInCone->Fill(ptTrig , ptTrack, histoWeight);
678 
680  fhPtTrackInCone->Fill(ptTrig , ptTrack, histoWeight);
681 
682  if ( fFillEtaPhiHistograms )
683  fhEtaPhiInConeTrack->Fill(etaTrack, phiTrack, histoWeight);
684  } // histograms
685 
686  // *Before*, count particles in cone
687  if ( ptTrack > fPtThreshold && ptTrack < fPtThresholdMax ) nPart++;
688 
689  //if fPtFraction*ptTrig<fPtThreshold then consider the fPtThreshold directly
690  if ( fFracIsThresh )
691  {
692  if ( fPtFraction*ptTrig < fPtThreshold )
693  {
694  if ( ptTrack > fPtThreshold ) nfrac++ ;
695  }
696  else
697  {
698  if ( ptTrack > fPtFraction*ptTrig ) nfrac++;
699  }
700  }
701  else
702  {
703  if ( ptTrack > fPtFraction*ptTrig ) nfrac++;
704  }
705 
706  }// charged particle loop
707 
708  // 2 perpendicular cones added, divide by 2 total amount of energy.
709  perpConePtSumTrack /= 2;
710 
711  if ( fFillHistograms )
712  {
714  {
715  fhConeSumPtTrack ->Fill(ptTrig, coneptsumTrack , histoWeight);
716  fhConePtLeadTrack->Fill(ptTrig, coneptLeadTrack , histoWeight);
717  }
718 
719  // UE subtraction
720  if ( fICMethod == kSumBkgSubIC )
721  {
722  fhPerpConeSumPt->Fill(ptTrig, perpConePtSumTrack, histoWeight);
723 
724  fhConeSumPtVSPerpCone->Fill(coneptsumTrack, perpConePtSumTrack, histoWeight);
725 
726  if ( fFillEtaPhiHistograms )
727  fhPerpConeSumPtTrigEtaPhi->Fill(etaTrig, phiTrig, perpConePtSumTrack*histoWeight);
728  }
729 
730  if ( fICMethod > kSumBkgSubIC )
731  {
732  fhConeSumPtEtaBandUETrack->Fill(ptTrig, etaBandPtSumTrack , histoWeight);
733  fhConeSumPtPhiBandUETrack->Fill(ptTrig, phiBandPtSumTrack , histoWeight);
734 
735  fhConeSumPtVSUETracksEtaBand->Fill(coneptsumTrack, etaBandPtSumTrack, histoWeight);
736  fhConeSumPtVSUETracksPhiBand->Fill(coneptsumTrack, phiBandPtSumTrack, histoWeight);
737 
738  if ( fFillEtaPhiHistograms )
739  {
740  fhConeSumPtEtaBandUETrackTrigEtaPhi->Fill(etaTrig, phiTrig, etaBandPtSumTrack *histoWeight); // check
741  fhConeSumPtPhiBandUETrackTrigEtaPhi->Fill(etaTrig, phiTrig, phiBandPtSumTrack *histoWeight); // check
742  }
743  } // UE sub
744  } // fill histograms
745 
746  // Add calculated values to pCandidate, might be modified later
747  // if UE subtraction and normalization requested
748 
749  // Add reference arrays to AOD when filling AODs only
750  if ( bFillAOD && reftracks ) pCandidate->AddObjArray(reftracks);
751 }
752 
753 //_________________________________________________________________________________________________________________________________
755 //_________________________________________________________________________________________________________________________________
757  Float_t excessEta, Float_t excessPhi,
758  Float_t excessAreaEta, Float_t excessAreaPhi,
759  Float_t etaUEptsumCluster, Float_t phiUEptsumCluster,
760  Float_t & etaUEptsumClusterNorm, Float_t & phiUEptsumClusterNorm) const
761 {
762  Float_t coneA = fConeSize*fConeSize*TMath::Pi(); // A = pi R^2, isolation cone area
763  if ( fDistMinToTrigger > 0 ) coneA -= fDistMinToTrigger*fDistMinToTrigger*TMath::Pi();
764 
765  Float_t fEMCPhiSize = fEMCPhiMax-fEMCPhiMin;
766 
767  /* //Catherine code
768  if(((((2*fConeSize*fEMCPhiSize)-coneA))*phiBandBadCellsCoeff)!=0)phiUEptsumClusterNorm = phiUEptsumCluster*(coneA*coneBadCellsCoeff / (((2*fConeSize*fEMCPhiSize)-coneA))*phiBandBadCellsCoeff); // pi * R^2 / (2 R * 2 100 deg) - trigger cone
769  if(((((2*(fConeSize-excess)*fEMCPhiSize)-(coneA-excessFracEta))*etaBandBadCellsCoeff))!=0)phiUEptsumClusterNorm = phiUEptsumCluster*(coneA *coneBadCellsCoeff/ (((2*(fConeSize-excess)*fEMCPhiSize)-(coneA/excessFracEta))*etaBandBadCellsCoeff));
770  if(((2*(fConeSize-excess)*fEMCEtaSize)-(coneA-excessFracPhi))*phiBandBadCellsCoeff!=0) etaUEptsumClusterNorm = etaUEptsumCluster*(coneA*coneBadCellsCoeff / (((2*(fConeSize-excess)*fEMCEtaSize)-(coneA/excessFracPhi))*phiBandBadCellsCoeff));
771  */
772 
773  // UE band cans also be out of acceptance, need to estimate corrected area
774  //
775  if ( excessEta != 0 ) coneA /= excessAreaEta;
776  if ( excessPhi != 0 ) coneA /= excessAreaPhi;
777  if ( excessPhi != 0 ) coneA /= excessAreaPhi;
778 
779  // Calculate normalization
780  //
781  if(((2*fConeSize-excessEta)*fEMCPhiSize-coneA) != 0 ) phiUEptsumClusterNorm = phiUEptsumCluster*(coneA / ((((2*fConeSize-excessEta)*fEMCPhiSize)-coneA))); // pi * R^2 / (2 R * 2 100 deg) - trigger cone
782  if(((2*fConeSize-excessPhi)*fEMCEtaSize-coneA) != 0 ) etaUEptsumClusterNorm = etaUEptsumCluster*(coneA / ((((2*fConeSize-excessPhi)*fEMCEtaSize)-coneA))); // pi * R^2 / (2 R * 2*0.7) - trigger cone
783 }
784 
785 //________________________________________________________________________________________________________________________________
787 //________________________________________________________________________________________________________________________________
789  Float_t excessEta ,
790  Float_t excessAreaEta ,
791  Float_t etaUEptsumTrack , Float_t phiUEptsumTrack,
792  Float_t & etaUEptsumTrackNorm, Float_t & phiUEptsumTrackNorm) const
793 {
794  Float_t coneA = fConeSize*fConeSize*TMath::Pi(); // A = pi R^2, isolation cone area
795  if ( fDistMinToTrigger > 0 ) coneA -= fDistMinToTrigger*fDistMinToTrigger*TMath::Pi();
796 
797  /*//Catherine code
798  //phiUEptsumTrackNorm = phiUEptsumTrack*(coneA*coneBadCellsCoeff / (((2*fConeSize*tpcPhiSize)-coneA))*phiBandBadCellsCoeff); // pi * R^2 / (2 R * 2 pi) - trigger cone
799  //etaUEptsumTrackNorm = etaUEptsumTrack*(coneA*coneBadCellsCoeff / (((2*fConeSize*fTPCEtaSize)-coneA))*etaBandBadCellsCoeff); // pi * R^2 / (2 R * 1.6) - trigger cone
800  if((2*fConeSize*tpcPhiSize-coneA)!=0)phiUEptsumTrackNorm = phiUEptsumTrack*(coneA / (((2*fConeSize*tpcPhiSize)-coneA))); // pi * R^2 / (2 R * 2 pi) - trigger cone
801  if((2*fConeSize*fTPCEtaSize-coneA)!=0)etaUEptsumTrackNorm = etaUEptsumTrack*(coneA / (((2*fConeSize*fTPCEtaSize)-coneA))); // pi * R^2 / (2 R * 1.6) - trigger cone
802  if((2*(fConeSize-excess)*tpcPhiSize)-(coneA-excessFracEta)!=0)phiUEptsumTrackNorm = phiUEptsumTrack*(coneA / (((2*(fConeSize-excess)*tpcPhiSize)-(coneA/excessFracEta))));
803  */ //end Catherine code
804 
805  // UE band cans also be out of acceptance, need to estimate corrected area
806  //
807  if ( excessEta != 0 ) coneA /= excessAreaEta;
808 
809  // Calculate normalization
810  //
811  if(((2*fConeSize-excessEta)*fTPCPhiSize - coneA) !=0 ) phiUEptsumTrackNorm = phiUEptsumTrack*(coneA / ((((2*fConeSize-excessEta)*fTPCPhiSize)-coneA))); // pi * R^2 / (2 R * 2 pi) - trigger cone
812  if(( 2*fConeSize *fTPCEtaSize - coneA) !=0 ) etaUEptsumTrackNorm = etaUEptsumTrack*(coneA / ((( 2*fConeSize *fTPCEtaSize)-coneA))); // pi * R^2 / (2 R * 1.6) - trigger cone
813 
814 }
815 
816 //________________________________________________________________________
820 //________________________________________________________________________
822 {
823  Float_t angle = 2*TMath::ACos( (fConeSize-excess) / fConeSize );
824 
825  Float_t coneA = fConeSize*fConeSize*TMath::Pi(); // A = pi R^2, isolation cone area
826 
827  Float_t excessA = fConeSize*fConeSize / 2 * (angle-TMath::Sin(angle));
828 
829  if ( coneA > excessA ) return coneA / (coneA-excessA);
830  else
831  {
832  AliWarning(Form("Please Check : Excess %2.3f, coneA %2.2f, excessA %2.2f, angle %2.2f,factor %2.2f",
833  excess,coneA, excessA, angle*TMath::RadToDeg(), coneA / (coneA-excessA)));
834  return 1;
835  }
836 }
837 
838 //________________________________________________________________________
845 //________________________________________________________________________
847 ( Float_t etaC, Float_t phiC,
848  Float_t & excessTrkEta, Float_t & excessAreaTrkEta,
849  Float_t & excessClsEta, Float_t & excessAreaClsEta,
850  Float_t & excessClsPhi, Float_t & excessAreaClsPhi ) const
851 {
852  excessTrkEta = 0;
853  excessClsEta = 0;
854  excessClsPhi = 0;
855 
856  if ( TMath::Abs(etaC)+fConeSize > fTPCEtaSize/2. )
857  excessTrkEta = TMath::Abs(etaC) + fConeSize - fTPCEtaSize/2.;
858 
859  if(TMath::Abs(etaC)+fConeSize > fEMCEtaSize/2.)
860  excessClsEta = TMath::Abs(etaC) + fConeSize - fEMCEtaSize/2.;
861 
862  if ( TMath::Abs(phiC)+fConeSize > fEMCPhiMax )
863  excessClsPhi = (TMath::Abs(phiC) + fConeSize) - fEMCPhiMax;
864  else if( TMath::Abs(phiC)-fConeSize < fEMCPhiMax )
865  excessClsPhi = fEMCPhiMin - (TMath::Abs(phiC) - fConeSize) ;
866 
867  excessAreaTrkEta = CalculateExcessAreaFraction(excessTrkEta);
868  excessAreaClsEta = CalculateExcessAreaFraction(excessClsEta);
869  excessAreaClsPhi = CalculateExcessAreaFraction(excessClsPhi);
870 }
871 
872 //_________________________________________________________________________________
876 //_________________________________________________________________________________
878 {
879  if ( fEMCEtaSize > 0 ) return ; // Already set
880 
882  reader->GetFiducialCut()->GetEMCALFidCutMinEtaArray()->At(0) ;
883  fEMCPhiMin = reader->GetFiducialCut()->GetEMCALFidCutMinPhiArray()->At(0) ;
884  fEMCPhiMax = reader->GetFiducialCut()->GetEMCALFidCutMaxPhiArray()->At(0) ;
885 
886  if ( calorimeter == AliFiducialCut::kPHOS)
887  {
888  fEMCEtaSize = reader->GetFiducialCut()->GetPHOSFidCutMaxEtaArray()->At(0) -
889  reader->GetFiducialCut()->GetPHOSFidCutMinEtaArray()->At(0) ;
890  fEMCPhiMin = reader->GetFiducialCut()->GetPHOSFidCutMinPhiArray()->At(0) ;
891  fEMCPhiMax = reader->GetFiducialCut()->GetPHOSFidCutMaxPhiArray()->At(0) ;
892  }
893 
894  // Info stored in degrees, put them on radians
895  fEMCPhiMin *= TMath::DegToRad();
896  fEMCPhiMax *= TMath::DegToRad();
897 
898  // Get the cut used for the TPC tracks in the reader, +-0.8, +-0.9 ...
899  // Only valid in simple fidutial cut case and if the cut is applied, careful!
900  fTPCEtaSize = reader->GetFiducialCut()->GetCTSFidCutMaxEtaArray()->At(0) -
901  reader->GetFiducialCut()->GetCTSFidCutMinEtaArray()->At(0) ;
902  fTPCPhiSize = TMath::Pi(); // Half TPC tracks with respect trigger candidate inspected
903 
904  AliDebug(1,Form("TPC: Deta %2.2f; Dphi %2.2f; Calo: Deta %2.2f, phi min %2.2f, max %2.2f",
906  fEMCPhiMin*TMath::RadToDeg(),fEMCPhiMax*TMath::RadToDeg()));
907 
908 // printf("TPC: Deta %2.2f; Dphi %2.2f; Calo: Deta %2.2f, phi min %2.2f, max %2.2f\n",
909 // fTPCEtaSize,fTPCPhiSize,fEMCEtaSize,
910 // fEMCPhiMin*TMath::RadToDeg(),fEMCPhiMax*TMath::RadToDeg());
911 }
912 
913 //_________________________________________________________________________________
915 //_________________________________________________________________________________
917  AliCaloTrackReader * reader) const
918 {
919  Double_t coneCells = 0.; //number of cells in cone with radius fConeSize
920  Double_t coneCellsBad = 0.; //number of bad cells in cone with radius fConeSize
921  Double_t cellDensity = 1.;
922 
923  Float_t phiC = pCandidate->Phi() ;
924  if(phiC<0) phiC+=TMath::TwoPi();
925  Float_t etaC = pCandidate->Eta() ;
926 
927  if(pCandidate->GetDetectorTag() == AliCaloTrackReader::kEMCAL)
928  {
929  AliEMCALGeometry* eGeom = AliEMCALGeometry::GetInstance();
930  AliCalorimeterUtils *cu = reader->GetCaloUtils();
931 
932  Int_t absId = -999;
933  if (eGeom->GetAbsCellIdFromEtaPhi(etaC,phiC,absId))
934  {
935  // Get absolute (col,row) of candidate
936  Int_t iEta=-1, iPhi=-1, iRCU = -1;
937  Int_t nSupMod = cu->GetModuleNumberCellIndexes(absId, pCandidate->GetDetectorTag(), iEta, iPhi, iRCU);
938 
939  Int_t colC = iEta;
940  if (nSupMod % 2) colC = AliEMCALGeoParams::fgkEMCALCols + iEta ;
941  Int_t rowC = iPhi + AliEMCALGeoParams::fgkEMCALRows*int(nSupMod/2);
942 
943  Int_t sqrSize = int(fConeSize/0.0143) ; // Size of cell in radians
944  Int_t status = 0;
945  // Loop on cells in a square of side fConeSize to check cells in cone
946  for(Int_t icol = colC-sqrSize; icol < colC+sqrSize;icol++)
947  {
948  for(Int_t irow = rowC-sqrSize; irow < rowC+sqrSize; irow++)
949  {
950  if (Radius(colC, rowC, icol, irow) < sqrSize)
951  {
952  coneCells += 1.;
953 
954  Int_t cellSM = -999;
955  Int_t cellEta = -999;
956  Int_t cellPhi = -999;
957  if(icol > AliEMCALGeoParams::fgkEMCALCols-1)
958  {
959  cellSM = 0+int(irow/AliEMCALGeoParams::fgkEMCALRows)*2;
960  cellEta = icol-AliEMCALGeoParams::fgkEMCALCols;
961  cellPhi = irow-AliEMCALGeoParams::fgkEMCALRows*int(cellSM/2);
962  }
963  if(icol < AliEMCALGeoParams::fgkEMCALCols)
964  {
965  cellSM = 1+int(irow/AliEMCALGeoParams::fgkEMCALRows)*2;
966  cellEta = icol;
967  cellPhi = irow-AliEMCALGeoParams::fgkEMCALRows*int(cellSM/2);
968  }
969 
970  //Count as bad "cells" out of EMCAL acceptance
971  if(icol < 0 || icol > AliEMCALGeoParams::fgkEMCALCols*2 ||
972  irow < 0 || irow > AliEMCALGeoParams::fgkEMCALRows*16./3) //5*nRows+1/3*nRows
973  {
974  coneCellsBad += 1.;
975  }
976  // Count as bad "cells" marked as bad in the DataBase
977  else if (cu->GetEMCALChannelStatus(cellSM,cellEta,cellPhi,status)==1)
978  {
979  coneCellsBad += 1. ;
980  }
981  }
982  }
983  }//end of cells loop
984  }
985  else AliWarning("Cluster with bad (eta,phi) in EMCal for energy density calculation");
986 
987  if (coneCells > 0.)
988  {
989  cellDensity = (coneCells-coneCellsBad)/coneCells;
990  //printf("Energy density = %f\n", cellDensity);
991  }
992  }
993 
994  return cellDensity;
995 }
996 
997 //___________________________________________________________________________________
999 //___________________________________________________________________________________
1001  AliCaloTrackReader * reader,
1002  Float_t & coneBadCellsCoeff,
1003  Float_t & etaBandBadCellsCoeff,
1004  Float_t & phiBandBadCellsCoeff)
1005 {
1006  Double_t coneCells = 0.; //number of cells in cone with radius fConeSize
1007  Double_t phiBandCells = 0.; //number of cells in band phi
1008  Double_t etaBandCells = 0.; //number of cells in band eta
1009 
1010  Float_t phiC = pCandidate->Phi() ;
1011  if ( phiC < 0 ) phiC+=TMath::TwoPi();
1012  Float_t etaC = pCandidate->Eta() ;
1013 
1014  if(pCandidate->GetDetectorTag() == AliCaloTrackReader::kEMCAL)
1015  {
1016  AliEMCALGeometry* eGeom = AliEMCALGeometry::GetInstance();
1017  AliCalorimeterUtils *cu = reader->GetCaloUtils();
1018 
1019  Int_t absId = -999;
1020  if (eGeom->GetAbsCellIdFromEtaPhi(etaC,phiC,absId))
1021  {
1022  //Get absolute (col,row) of candidate
1023  Int_t iEta=-1, iPhi=-1, iRCU = -1;
1024  Int_t nSupMod = cu->GetModuleNumberCellIndexes(absId, pCandidate->GetDetectorTag(),
1025  iEta, iPhi, iRCU);
1026 
1027  Int_t colC = iEta;
1028  if (nSupMod % 2) colC = AliEMCALGeoParams::fgkEMCALCols + iEta ;
1029  Int_t rowC = iPhi + AliEMCALGeoParams::fgkEMCALRows*int(nSupMod/2);
1030 
1031  Int_t sqrSize = int(fConeSize/0.0143) ; // Size of cell in radians
1032  Int_t status = 0;
1033  for(Int_t icol = 0; icol < 2*AliEMCALGeoParams::fgkEMCALCols-1;icol++)
1034  {
1035  for(Int_t irow = 0; irow < 5*AliEMCALGeoParams::fgkEMCALRows -1; irow++)
1036  {
1037  //loop on cells in a square of side fConeSize to check cells in cone
1038  if ( Radius(colC, rowC, icol, irow) < sqrSize ) { coneCells += 1.; }
1039  else if( icol>colC-sqrSize && icol<colC+sqrSize ) { phiBandCells += 1 ; }
1040  else if( irow>rowC-sqrSize && irow<rowC+sqrSize ) { etaBandCells += 1 ; }
1041 
1042  Int_t cellSM = -999;
1043  Int_t cellEta = -999;
1044  Int_t cellPhi = -999;
1045  if(icol > AliEMCALGeoParams::fgkEMCALCols-1)
1046  {
1047  cellSM = 0+int(irow/AliEMCALGeoParams::fgkEMCALRows)*2;
1048  cellEta = icol-AliEMCALGeoParams::fgkEMCALCols;
1049  cellPhi = irow-AliEMCALGeoParams::fgkEMCALRows*int(cellSM/2);
1050  }
1051  if(icol < AliEMCALGeoParams::fgkEMCALCols)
1052  {
1053  cellSM = 1+int(irow/AliEMCALGeoParams::fgkEMCALRows)*2;
1054  cellEta = icol;
1055  cellPhi = irow-AliEMCALGeoParams::fgkEMCALRows*int(cellSM/2);
1056  }
1057 
1058  if( (icol < 0 || icol > AliEMCALGeoParams::fgkEMCALCols*2-1 ||
1059  irow < 0 || irow > AliEMCALGeoParams::fgkEMCALRows*5 - 1) //5*nRows+1/3*nRows //Count as bad "cells" out of EMCAL acceptance
1060  || (cu->GetEMCALChannelStatus(cellSM,cellEta,cellPhi,status)==1)) //Count as bad "cells" marked as bad in the DataBase
1061  {
1062  if ( Radius(colC, rowC, icol, irow) < sqrSize ) coneBadCellsCoeff += 1.;
1063  else if( icol>colC-sqrSize && icol<colC+sqrSize ) phiBandBadCellsCoeff += 1 ;
1064  else if( irow>rowC-sqrSize && irow<rowC+sqrSize ) etaBandBadCellsCoeff += 1 ;
1065  }
1066  }
1067  }//end of cells loop
1068  }
1069  else AliWarning("Cluster with bad (eta,phi) in EMCal for energy density coeff calculation");
1070 
1071  if (coneCells > 0.)
1072  {
1073  // printf("Energy density coneBadCellsCoeff= %.2f coneCells%.2f\n", coneBadCellsCoeff,coneCells);
1074  coneBadCellsCoeff = (coneCells-coneBadCellsCoeff)/coneCells;
1075  // printf("coneBadCellsCoeff= %.2f\n", coneBadCellsCoeff);
1076  }
1077 
1078  if (phiBandCells > 0.)
1079  {
1080  // printf("Energy density phiBandBadCellsCoeff = %.2f phiBandCells%.2f\n", phiBandBadCellsCoeff,phiBandCells);
1081  phiBandBadCellsCoeff = (phiBandCells-phiBandBadCellsCoeff)/phiBandCells;
1082  // printf("phiBandBadCellsCoeff = %.2f\n", phiBandBadCellsCoeff);
1083  }
1084 
1085  if (etaBandCells > 0.)
1086  {
1087  //printf("Energy density etaBandBadCellsCoeff = %.2f etaBandCells%.2f\n", etaBandBadCellsCoeff,etaBandCells);
1088  etaBandBadCellsCoeff = (etaBandCells-etaBandBadCellsCoeff)/etaBandCells;
1089  // printf("etaBandBadCellsCoeff = %.2f\n",etaBandBadCellsCoeff);
1090  }
1091  }
1092 }
1093 
1094 
1095 //_________________________________________________________
1098 //_________________________________________________________
1100 {
1101  if ( !fHistoRanges )
1102  {
1103  AliFatal("Histogram ranges data base not initialized!");
1104  return 0x0;
1105  }
1106 
1107  fFillHistograms = kTRUE;
1108 
1109  TList * outputContainer = new TList() ;
1110  outputContainer->SetName("IsolationCutBase") ;
1111  outputContainer->SetOwner(kFALSE);
1112 
1114  Int_t nphibins = fHistoRanges->GetHistoPhiBins();
1115  Int_t netabins = fHistoRanges->GetHistoEtaBins();
1117  Float_t phimax = fHistoRanges->GetHistoPhiMax();
1122 
1123  Int_t nptsumbins = fHistoRanges->GetHistoNPtSumBins();
1124  Float_t ptsummax = fHistoRanges->GetHistoPtSumMax();
1125  Float_t ptsummin = fHistoRanges->GetHistoPtSumMin();
1126  Int_t nptinconebins = fHistoRanges->GetHistoNPtInConeBins();
1127  Float_t ptinconemax = fHistoRanges->GetHistoPtInConeMax();
1128  Float_t ptinconemin = fHistoRanges->GetHistoPtInConeMin();
1129 
1130  // For UE subtracted histograms, shift it down by 20 GeV
1131  // keep same histogram binning.
1132  Float_t ptsumminUESub = ptsummin-20;
1133  Float_t ptsummaxUESub = ptsummax;
1134  Int_t nptsumbinsUESub = nptsumbins*(1.+20./(ptsummax-ptsummin));
1135 
1136  TString sParticle = ", x^{0,#pm}";
1137  if ( fPartInCone == kOnlyNeutral ) sParticle = ", x^{0}";
1138  else if ( fPartInCone == kOnlyCharged ) sParticle = ", x^{#pm}";
1139 
1140  TString parTitleR = Form("#it{R} = %2.2f%s",fConeSize,sParticle.Data());
1141 
1143  {
1144  // Pt in cone
1145  fhPtTrackInCone = new TH2F
1146  ("hPtTrackInCone",
1147  Form("#it{p}_{T} of tracks in isolation cone for #it{R} = %2.2f",fConeSize),
1148  nptbins,ptmin,ptmax,nptinconebins,ptinconemin,ptinconemax);
1149  fhPtTrackInCone->SetYTitle("#it{p}_{T in cone} (GeV/#it{c})");
1150  fhPtTrackInCone->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1151  outputContainer->Add(fhPtTrackInCone) ;
1152 
1153  fhPtClusterInCone = new TH2F
1154  ("hPtClusterInCone",
1155  Form("#it{p}_{T} of clusters in isolation cone for #it{R} = %2.2f",fConeSize),
1156  nptbins,ptmin,ptmax,nptinconebins,ptinconemin,ptinconemax);
1157  fhPtClusterInCone->SetYTitle("#it{p}_{T in cone} (GeV/#it{c})");
1158  fhPtClusterInCone->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1159  outputContainer->Add(fhPtClusterInCone) ;
1160 
1161  // Leading in cone
1162  fhConePtLeadTrack = new TH2F
1163  ("hConeLeadPtTrack",
1164  Form("Track leading in isolation cone for #it{R} = %2.2f",fConeSize),
1165  nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
1166  fhConePtLeadTrack->SetYTitle("#it{p}_{T, leading} (GeV/#it{c})");
1167  fhConePtLeadTrack->SetXTitle("#it{p}_{T, trigger} (GeV/#it{c})");
1168  outputContainer->Add(fhConePtLeadTrack) ;
1169 
1171  ("hConeLeadPtCluster",
1172  Form("Cluster leading in isolation cone for #it{R} = %2.2f",fConeSize),
1173  nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
1174  fhConePtLeadCluster->SetYTitle("#it{p}_{T, leading} (GeV/#it{c})");
1175  fhConePtLeadCluster->SetXTitle("#it{p}_{T, trigger} (GeV/#it{c})");
1176  outputContainer->Add(fhConePtLeadCluster) ;
1177 
1179  ("hConePtLeadClustervsTrack",
1180  Form("Track vs Cluster lead #it{p}_{T} in isolation cone for #it{R} = %2.2f",fConeSize),
1181  nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
1182  fhConePtLeadClustervsTrack->SetXTitle("#it{p}^{leading cluster}_{T} (GeV/#it{c})");
1183  fhConePtLeadClustervsTrack->SetYTitle("#it{p}^{leading track}_{T} (GeV/#it{c})");
1184  outputContainer->Add(fhConePtLeadClustervsTrack) ;
1185 
1187  ("hConePtLeadClusterTrackFraction",
1188  Form(" #it{p}^{leading cluster}_{T}/#it{p}^{leading track}_{T} in isolation cone for #it{R} = %2.2f",fConeSize),
1189  nptbins,ptmin,ptmax,200,0,5);
1190  fhConePtLeadClusterTrackFrac->SetYTitle("#it{p}^{leading cluster}_{T}/ #it{p}^{leading track}_{T}");
1191  fhConePtLeadClusterTrackFrac->SetXTitle("#it{p}^{trigger}_{T} (GeV/#it{c})");
1192  outputContainer->Add(fhConePtLeadClusterTrackFrac) ;
1193 
1194  // Sum pt in cone
1195  fhConeSumPtTrack = new TH2F
1196  ("hConePtSumTrack",
1197  Form("Track #Sigma #it{p}_{T}, #it{R}=%2.2f",fConeSize),
1198  nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
1199  fhConeSumPtTrack->SetYTitle("#Sigma #it{p}_{T} (GeV/#it{c})");
1200  fhConeSumPtTrack->SetXTitle("#it{p}_{T, trigger} (GeV/#it{c})");
1201  outputContainer->Add(fhConeSumPtTrack) ;
1202 
1203  fhConeSumPtCluster = new TH2F
1204  ("hConePtSumCluster",
1205  Form("Cluster #Sigma #it{p}_{T}, #it{R}=%2.2f",fConeSize),
1206  nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
1207  fhConeSumPtCluster->SetYTitle("#Sigma #it{p}_{T} (GeV/#it{c})");
1208  fhConeSumPtCluster->SetXTitle("#it{p}_{T, trigger} (GeV/#it{c})");
1209  outputContainer->Add(fhConeSumPtCluster) ;
1210 
1211  // No need with perpendicular cones filled with tracks
1212  if ( fICMethod != kSumBkgSubIC )
1213  {
1215  ("hConePtSumClustervsTrack",
1216  Form("Track vs Cluster #Sigma #it{p}_{T}, #it{R}=%2.2f",fConeSize),
1217  nptsumbins,ptsummin,ptsummax,nptsumbins,ptsummin,ptsummax);
1218  fhConeSumPtClustervsTrack->SetXTitle("#Sigma #it{p}_{T}^{cluster} (GeV/#it{c})");
1219  fhConeSumPtClustervsTrack->SetYTitle("#Sigma #it{p}_{T}^{track} (GeV/#it{c})");
1220  outputContainer->Add(fhConeSumPtClustervsTrack) ;
1221 
1223  ("hConePtSumClusterTrackFraction",
1224  Form("#Sigma #it{p}_{T}^{cluster}/#Sigma #it{p}_{T}^{track}, #it{R}=%2.2f",fConeSize),
1225  nptbins,ptmin,ptmax,200,0,5);
1226  fhConeSumPtClusterTrackFrac->SetYTitle("#Sigma #it{p}^{cluster}_{T} /#Sigma #it{p}_{T}^{track}");
1227  fhConeSumPtClusterTrackFrac->SetXTitle("#it{p}^{trigger}_{T} (GeV/#it{c})");
1228  outputContainer->Add(fhConeSumPtClusterTrackFrac) ;
1229  }
1230 
1231  if ( fICMethod >= kSumBkgSubIC )
1232  {
1234  ("hConePtSumUESubTrack",
1235  Form("Track #Sigma #it{p}_{T},#it{R}=%2.2f, UE correction",fConeSize),
1236  nptbins,ptmin,ptmax,nptsumbinsUESub,ptsumminUESub,ptsummaxUESub);
1237  fhConeSumPtUESubTrack->SetYTitle("#Sigma #it{p}_{T} (GeV/#it{c})");
1238  fhConeSumPtUESubTrack->SetXTitle("#it{p}_{T, trigger} (GeV/#it{c})");
1239  outputContainer->Add(fhConeSumPtUESubTrack) ;
1240 
1242  ("hConePtSumUESubCluster",
1243  Form("Cluster #Sigma #it{p}_{T},#it{R}=%2.2f, UE correction",fConeSize),
1244  nptbins,ptmin,ptmax,nptsumbinsUESub,ptsumminUESub,ptsummaxUESub);
1245  fhConeSumPtUESubCluster->SetYTitle("#Sigma #it{p}_{T} (GeV/#it{c})");
1246  fhConeSumPtUESubCluster->SetXTitle("#it{p}_{T, trigger} (GeV/#it{c})");
1247  outputContainer->Add(fhConeSumPtUESubCluster) ;
1248 
1249  // No need in perp cones analysis
1250  if ( fICMethod != kSumBkgSubIC )
1251  {
1253  ("hConePtSumUESubClustervsTrack",
1254  Form("Track vs Cluster #Sigma #it{p}_{T}, #it{R}=%2.2f, UE correction",fConeSize),
1255  nptsumbinsUESub,ptsumminUESub,ptsummaxUESub,
1256  nptsumbinsUESub,ptsumminUESub,ptsummaxUESub);
1257  fhConeSumPtUESubClustervsTrack->SetXTitle("#Sigma #it{p}_{T}^{cluster} (GeV/#it{c})");
1258  fhConeSumPtUESubClustervsTrack->SetYTitle("#Sigma #it{p}_{T}^{track} (GeV/#it{c})");
1259  outputContainer->Add(fhConeSumPtUESubClustervsTrack) ;
1260 
1262  ("hConePtSumUESubClusterTrackFraction",
1263  Form("#Sigma #it{p}_{T}^{cluster}/#Sigma #it{p}_{T}^{track}, #it{R}=%2.2f, UE correction",fConeSize),
1264  nptbins,ptmin,ptmax,200,0,5);
1265  fhConeSumPtUESubClusterTrackFrac->SetYTitle("#Sigma #it{p}^{cluster}_{T} /#Sigma #it{p}_{T}^{track}");
1266  fhConeSumPtUESubClusterTrackFrac->SetXTitle("#it{p}^{trigger}_{T} (GeV/#it{c})");
1267  outputContainer->Add(fhConeSumPtUESubClusterTrackFrac) ;
1268  } // per cones
1269  } // UE sub
1270  }
1271 
1272  fhPtInCone = new TH2F
1273  ("hPtInCone",
1274  Form("#it{p}_{T} of clusters and tracks in isolation cone for %s",parTitleR.Data()),
1275  nptbins,ptmin,ptmax,nptinconebins,ptinconemin,ptinconemax);
1276  fhPtInCone->SetYTitle("#it{p}_{T in cone} (GeV/#it{c})");
1277  fhPtInCone->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1278  outputContainer->Add(fhPtInCone) ;
1279 
1280  fhConePtLead = new TH2F
1281  ("hConePtLead",
1282  Form("Track or Cluster leading #it{p}_{T} in isolation cone for #it{R} = %2.2f",fConeSize),
1283  nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
1284  fhConePtLead->SetYTitle("#it{p}_{T, leading} (GeV/#it{c})");
1285  fhConePtLead->SetXTitle("#it{p}_{T, trigger} (GeV/#it{c})");
1286  outputContainer->Add(fhConePtLead) ;
1287 
1288  fhConeSumPt = new TH2F
1289  ("hConePtSum",
1290  Form("Track and Cluster #Sigma #it{p}_{T} in isolation cone for #it{R} = %2.2f",fConeSize),
1291  nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
1292  fhConeSumPt->SetYTitle("#Sigma #it{p}_{T} (GeV/#it{c})");
1293  fhConeSumPt->SetXTitle("#it{p}_{T, trigger} (GeV/#it{c})");
1294  outputContainer->Add(fhConeSumPt) ;
1295 
1296  if ( fFillEtaPhiHistograms )
1297  {
1299  ("hConePtSumTrigEtaPhi",
1300  Form("Trigger #eta vs #varphi, #Sigma #it{p}_{T} in isolation cone for %s",parTitleR.Data()),
1301  netabins,etamin,etamax,nphibins,phimin,phimax);
1302  fhConeSumPtTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T} (GeV/#it{c})");
1303  fhConeSumPtTrigEtaPhi->SetXTitle("#eta_{trigger}");
1304  fhConeSumPtTrigEtaPhi->SetYTitle("#varphi_{trigger} (rad)");
1305  outputContainer->Add(fhConeSumPtTrigEtaPhi) ;
1306  }
1307 
1308  if ( fICMethod >= kSumBkgSubIC )
1309  {
1310  fhConeSumPtUESub = new TH2F
1311  ("hConePtSumUESub",
1312  Form("Track and/or Cluster #Sigma #it{p}_{T} in #it{R} = %2.2f, after UE correction",fConeSize),
1313  nptbins,ptmin,ptmax,nptsumbinsUESub,ptsumminUESub,ptsummaxUESub);
1314  fhConeSumPtUESub->SetYTitle("#Sigma #it{p}_{T} (GeV/#it{c})");
1315  fhConeSumPtUESub->SetXTitle("#it{p}_{T, trigger} (GeV/#it{c})");
1316  outputContainer->Add(fhConeSumPtUESub) ;
1317 
1318  if ( fFillEtaPhiHistograms )
1319  {
1321  ("hConePtSumUESubTrigEtaPhi",
1322  Form("Trigger #eta vs #varphi, #Sigma #it{p}_{T} for %s, after UE correction",parTitleR.Data()),
1323  netabins,etamin,etamax,nphibins,phimin,phimax);
1324  fhConeSumPtUESubTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T} (GeV/#it{c})");
1325  fhConeSumPtUESubTrigEtaPhi->SetXTitle("#eta_{trigger}");
1326  fhConeSumPtUESubTrigEtaPhi->SetYTitle("#varphi_{trigger} (rad)");
1327  outputContainer->Add(fhConeSumPtUESubTrigEtaPhi) ;
1328  }
1329  }
1330 
1332  {
1333  fhEtaPhiCluster = new TH2F
1334  ("hEtaPhiCluster",
1335  Form("#eta vs #varphi of all clusters"),
1336  netabins,-1,1,nphibins,0,TMath::TwoPi());
1337  fhEtaPhiCluster->SetXTitle("#eta");
1338  fhEtaPhiCluster->SetYTitle("#varphi (rad)");
1339  outputContainer->Add(fhEtaPhiCluster) ;
1340 
1342  ("hEtaPhiInConeCluster",
1343  Form("#eta vs #varphi of clusters in cone for #it{R} = %2.2f",fConeSize),
1344  netabins,-1,1,nphibins,0,TMath::TwoPi());
1345  fhEtaPhiInConeCluster->SetXTitle("#eta");
1346  fhEtaPhiInConeCluster->SetYTitle("#varphi (rad)");
1347  outputContainer->Add(fhEtaPhiInConeCluster) ;
1348  }
1349 
1350  // UE bands
1352  {
1353  fhEtaBandClusterPt = new TH2F
1354  ("hEtaBandClusterPt",
1355  Form("#it{p}_{T} of clusters in #eta band isolation cone for #it{R} = %2.2f",fConeSize),
1356  nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
1357  fhEtaBandClusterPt->SetXTitle("#it{p}_{T}^{trig} (GeV/#it{c})");
1358  fhEtaBandClusterPt->SetYTitle("#it{p}_{T}^{cluster-band} (GeV/#it{c})");
1359  outputContainer->Add(fhEtaBandClusterPt) ;
1360 
1361  fhPhiBandClusterPt = new TH2F
1362  ("hPhiBandClusterPt",
1363  Form("#it{p}_{T} of clusters in #varphi band isolation cone for #it{R} = %2.2f",fConeSize),
1364  nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
1365  fhPhiBandClusterPt->SetXTitle("#it{p}_{T}^{trig} (GeV/#it{c})");
1366  fhPhiBandClusterPt->SetYTitle("#it{p}_{T}^{cluster-band} (GeV/#it{c})");
1367  outputContainer->Add(fhPhiBandClusterPt) ;
1368 
1369  if ( fFillEtaPhiHistograms )
1370  {
1372  ("hEtaBandClusterEtaPhi",
1373  Form("#eta vs #varphi of clusters in #eta band isolation cone for #it{R} = %2.2f",fConeSize),
1374  netabins,-1,1,nphibins,0,TMath::TwoPi());
1375  fhEtaBandClusterEtaPhi->SetXTitle("#eta");
1376  fhEtaBandClusterEtaPhi->SetYTitle("#varphi (rad)");
1377  outputContainer->Add(fhEtaBandClusterEtaPhi) ;
1378 
1380  ("hPhiBandClusterEtaPhi",
1381  Form("#eta vs #varphi of clusters in #varphi band isolation cone for #it{R} = %2.2f",fConeSize),
1382  netabins,-1,1,nphibins,0,TMath::TwoPi());
1383  fhPhiBandClusterEtaPhi->SetXTitle("#eta");
1384  fhPhiBandClusterEtaPhi->SetYTitle("#varphi (rad)");
1385  outputContainer->Add(fhPhiBandClusterEtaPhi) ;
1386  }
1387 
1388  if ( fICMethod >= kSumBkgSubEtaBandIC )
1389  {
1391  ("hConePtSumEtaBandUECluster",
1392  "#Sigma cluster #it{p}_{T} in UE Eta Band",
1393  nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
1394  fhConeSumPtEtaBandUECluster->SetYTitle("#Sigma #it{p}_{T} (GeV/#it{c})");
1395  fhConeSumPtEtaBandUECluster->SetXTitle("#it{p}_{T, trigger} (GeV/#it{c})");
1396  outputContainer->Add(fhConeSumPtEtaBandUECluster) ;
1397 
1399  ("hConePtSumPhiBandUECluster",
1400  "#Sigma cluster #it{p}_{T} UE Phi Band",
1401  nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
1402  fhConeSumPtPhiBandUECluster->SetYTitle("#Sigma #it{p}_{T} (GeV/#it{c})");
1403  fhConeSumPtPhiBandUECluster->SetXTitle("#it{p}_{T, trigger} (GeV/#it{c})");
1404  outputContainer->Add(fhConeSumPtPhiBandUECluster) ;
1405 
1407  ("hConeSumPtVSUEClusterEtaBand",
1408  Form("#Sigma #it{p}_{T} in cone versus #Sigma #it{p}_{T} in #eta band for cluster (before normalization), R=%2.2f",fConeSize),
1409  nptsumbins,ptsummin,ptsummax,2*nptsumbins,ptsummin,2*ptsummax);
1410  fhConeSumPtVSUEClusterEtaBand->SetXTitle("#Sigma #it{p}_{T} cone (GeV/#it{c})");
1411  fhConeSumPtVSUEClusterEtaBand->SetYTitle("#Sigma #it{p}_{T} UE (GeV/#it{c})");
1412  outputContainer->Add(fhConeSumPtVSUEClusterEtaBand);
1413 
1415  ("hConeSumPtVSUEClusterPhiBand",
1416  Form("#Sigma #it{p}_{T} in cone versus #Sigma #it{p}_{T} in #varphi band for cluster (before normalization), R=%2.2f",fConeSize),
1417  nptsumbins,ptsummin,ptsummax,8*nptsumbins,ptsummin,8*ptsummax);
1418  fhConeSumPtVSUEClusterPhiBand->SetXTitle("#Sigma #it{p}_{T} cone (GeV/#it{c})");
1419  fhConeSumPtVSUEClusterPhiBand->SetYTitle("#Sigma #it{p}_{T} UE (GeV/#it{c})");
1420  outputContainer->Add(fhConeSumPtVSUEClusterPhiBand);
1421 
1422  if ( fFillEtaPhiHistograms )
1423  {
1425  ("hConePtSumEtaBandUEClusterTrigEtaPhi",
1426  "Trigger #eta vs #varphi, #Sigma cluster #it{p}_{T} in UE Eta Band",
1427  netabins,etamin,etamax,nphibins,phimin,phimax);
1428  fhConeSumPtEtaBandUEClusterTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
1429  fhConeSumPtEtaBandUEClusterTrigEtaPhi->SetXTitle("#eta_{trigger}");
1430  fhConeSumPtEtaBandUEClusterTrigEtaPhi->SetYTitle("#varphi_{trigger} (rad)");
1431  outputContainer->Add(fhConeSumPtEtaBandUEClusterTrigEtaPhi) ;
1432 
1434  ("hConePtSumPhiBandUEClusterTrigEtaPhi",
1435  "Trigger #eta vs #varphi, #Sigma cluster #it{p}_{T} UE Phi Band",
1436  netabins,etamin,etamax,nphibins,phimin,phimax);
1437  fhConeSumPtPhiBandUEClusterTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
1438  fhConeSumPtPhiBandUEClusterTrigEtaPhi->SetXTitle("#eta_{trigger}");
1439  fhConeSumPtPhiBandUEClusterTrigEtaPhi->SetYTitle("#varphi_{trigger} (rad)");
1440  outputContainer->Add(fhConeSumPtPhiBandUEClusterTrigEtaPhi) ;
1441  }
1442 
1443  // Subtraction
1445  ("hConeSumPtUEBandNormCluster",
1446  Form("Clusters #Sigma #it{p}_{T} in normalized #eta or #varphi band, #it{R} = %2.2f",fConeSize),
1447  nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
1448  fhConeSumPtUEBandNormCluster->SetYTitle("#Sigma #it{p}_{T}^{band-norm} (GeV/#it{c})");
1449  fhConeSumPtUEBandNormCluster->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1450  outputContainer->Add(fhConeSumPtUEBandNormCluster) ;
1451 
1453  ("hConeSumPtClusterSubVsNoSub",
1454  Form("#Sigma #it{p}_{T} in cone before vs after UE bkg sub from #eta or #varphi band, R=%2.2f",fConeSize),
1455  nptsumbins,ptsummin,ptsummax,nptsumbinsUESub,ptsumminUESub,ptsummaxUESub);
1456  fhConeSumPtClusterSubVsNoSub->SetXTitle("#Sigma #it{p}_{T} (GeV/#it{c})");
1457  fhConeSumPtClusterSubVsNoSub->SetYTitle("#Sigma #it{p}_{T, sub} (GeV/#it{c})");
1458  outputContainer->Add(fhConeSumPtClusterSubVsNoSub);
1459  }
1460  } // clusters
1461 
1463  {
1464  fhEtaPhiTrack = new TH2F
1465  ("hEtaPhiTrack",
1466  Form("#eta vs #varphi of all Tracks"),
1467  netabins,-1,1,nphibins,0,TMath::TwoPi());
1468  fhEtaPhiTrack->SetXTitle("#eta");
1469  fhEtaPhiTrack->SetYTitle("#varphi (rad)");
1470  outputContainer->Add(fhEtaPhiTrack) ;
1471 
1473  ("hEtaPhiInConeTrack",
1474  Form("#eta vs #varphi of Tracks in cone for #it{R} = %2.2f",fConeSize),
1475  netabins,-1,1,nphibins,0,TMath::TwoPi());
1476  fhEtaPhiInConeTrack->SetXTitle("#eta");
1477  fhEtaPhiInConeTrack->SetYTitle("#varphi");
1478  outputContainer->Add(fhEtaPhiInConeTrack) ;
1479  }
1480 
1481  // UE subtraction
1483  {
1484  // UE in perpendicular cones
1485  //
1486  if ( fICMethod == kSumBkgSubIC )
1487  {
1488  fhPtInPerpCone = new TH2F
1489  ("hPtInPerpCone",
1490  Form("#it{p}_{T} in isolation cone at #pm 45 degree #varphi from trigger particle, #it{R} = %2.2f",fConeSize),
1491  nptbins,ptmin,ptmax,nptinconebins,ptinconemin,ptinconemax);
1492  fhPtInPerpCone->SetYTitle("#it{p}_{T in #perp cone} (GeV/#it{c})");
1493  fhPtInPerpCone->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1494  outputContainer->Add(fhPtInPerpCone) ;
1495 
1496  fhPerpConeSumPt = new TH2F
1497  ("hPerpConePtSum",
1498  Form("#Sigma #it{p}_{T} in 2 isolation cones at #pm 45 degree #varphi from trigger particle, norm. to 1 cone, #it{R} = %2.2f",fConeSize),
1499  nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
1500  fhPerpConeSumPt->SetYTitle("#Sigma #it{p}_{T}^{in #perp cone} (GeV/#it{c})");
1501  fhPerpConeSumPt->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1502  outputContainer->Add(fhPerpConeSumPt) ;
1503 
1505  ("hConeSumPtVSPerpCone",
1506  Form("#Sigma #it{p}_{T} in cone versus #Sigma #it{p}_{T} in 2 isolation cones at #pm 45 degree #varphi, R=%2.2f",fConeSize),
1507  nptsumbins,ptsummin,ptsummax,nptsumbins,ptsummin,ptsummax);
1508  fhConeSumPtVSPerpCone->SetXTitle("#Sigma #it{p}_{T} (GeV/#it{c})");
1509  fhConeSumPtVSPerpCone->SetYTitle("#Sigma #it{p}_{T}^{in #perp cone} (GeV/#it{c})");
1510  outputContainer->Add(fhConeSumPtVSPerpCone);
1511 
1512  if ( fFillEtaPhiHistograms )
1513  {
1514  fhEtaPhiInPerpCone = new TH2F
1515  ("hEtaPhiInPerpCone",
1516  Form("#eta vs #varphi of all Tracks in #perp cones"),
1517  netabins,-1,1,nphibins,0,TMath::TwoPi());
1518  fhEtaPhiInPerpCone->SetXTitle("#eta");
1519  fhEtaPhiInPerpCone->SetYTitle("#varphi (rad)");
1520  outputContainer->Add(fhEtaPhiInPerpCone) ;
1521 
1523  ("hPerpConeSumPtTrigEtaPhi",
1524  "Trigger #eta vs #varphi, #Sigma track #it{p}_{T} in #perp cones",
1525  netabins,etamin,etamax,nphibins,phimin,phimax);
1526  fhPerpConeSumPtTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}^{in #perp cone} (GeV/#it{c})");
1527  fhPerpConeSumPtTrigEtaPhi->SetXTitle("#eta_{trigger}");
1528  fhPerpConeSumPtTrigEtaPhi->SetYTitle("#varphi_{trigger} (rad)");
1529  outputContainer->Add(fhPerpConeSumPtTrigEtaPhi) ;
1530  }
1531  } // perpendicular
1532 
1533  // UE bands
1534  fhEtaBandTrackPt = new TH2F
1535  ("hEtaBandTrackPt",
1536  Form("#it{p}_{T} of tracks in #eta band isolation cone for #it{R} = %2.2f",fConeSize),
1537  nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
1538  fhEtaBandTrackPt->SetXTitle("#it{p}_{T}^{trig} (GeV/#it{c})");
1539  fhEtaBandTrackPt->SetYTitle("#it{p}_{T}^{track-band} (GeV/#it{c})");
1540  outputContainer->Add(fhEtaBandTrackPt) ;
1541 
1542  fhPhiBandTrackPt = new TH2F
1543  ("hPhiBandTrackPt",
1544  Form("#eta vs #varphi of tracks in #varphi band isolation cone for #it{R} = %2.2f",fConeSize),
1545  nptbins,ptmin,ptmax,nptbins,ptmin,ptmax);
1546  fhPhiBandTrackPt->SetXTitle("#it{p}_{T}^{trig} (GeV/#it{c})");
1547  fhPhiBandTrackPt->SetYTitle("#it{p}_{T}^{track-band} (GeV/#it{c})");
1548  outputContainer->Add(fhPhiBandTrackPt) ;
1549 
1550  if ( fFillEtaPhiHistograms )
1551  {
1553  ("hEtaBandTrackEtaPhi",
1554  Form("#eta vs #varphi of tracks in #eta band isolation cone for #it{R} = %2.2f",fConeSize),
1555  netabins,-1,1,nphibins,0,TMath::TwoPi());
1556  fhEtaBandTrackEtaPhi->SetXTitle("#eta");
1557  fhEtaBandTrackEtaPhi->SetYTitle("#varphi (rad)");
1558  outputContainer->Add(fhEtaBandTrackEtaPhi) ;
1559 
1561  ("hPhiBandTrackEtaPhi",
1562  Form("#eta vs #varphi of tracks in #varphi band isolation cone for #it{R} = %2.2f",fConeSize),
1563  netabins,-1,1,nphibins,0,TMath::TwoPi());
1564  fhPhiBandTrackEtaPhi->SetXTitle("#eta");
1565  fhPhiBandTrackEtaPhi->SetYTitle("#varphi (rad)");
1566  outputContainer->Add(fhPhiBandTrackEtaPhi) ;
1567  }
1568 
1569  if ( fICMethod >= kSumBkgSubEtaBandIC )
1570  {
1572  ("hConePtSumEtaBandUETrack",
1573  "#Sigma track #it{p}_{T} in UE Eta Band",
1574  nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
1575  fhConeSumPtEtaBandUETrack->SetYTitle("#Sigma #it{p}_{T} (GeV/#it{c})");
1576  fhConeSumPtEtaBandUETrack->SetXTitle("#it{p}_{T, trigger} (GeV/#it{c})");
1577  outputContainer->Add(fhConeSumPtEtaBandUETrack) ;
1578 
1580  ("hConePtSumPhiBandUETrack",
1581  "#Sigma track #it{p}_{T} in UE Phi Band",
1582  nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
1583  fhConeSumPtPhiBandUETrack->SetYTitle("#Sigma #it{p}_{T} (GeV/#it{c})");
1584  fhConeSumPtPhiBandUETrack->SetXTitle("#it{p}_{T, trigger} (GeV/#it{c})");
1585  outputContainer->Add(fhConeSumPtPhiBandUETrack) ;
1586 
1588  ("hConeSumPtVSUETracksEtaBand",
1589  Form("#Sigma #it{p}_{T} in cone versus #Sigma #it{p}_{T} in #eta band for tracks (before normalization), R=%2.2f",fConeSize),
1590  nptsumbins,ptsummin,ptsummax,2*nptsumbins,ptsummin,2*ptsummax);
1591  fhConeSumPtVSUETracksEtaBand->SetXTitle("#Sigma #it{p}_{T} cone (GeV/#it{c})");
1592  fhConeSumPtVSUETracksEtaBand->SetYTitle("#Sigma #it{p}_{T} UE (GeV/#it{c})");
1593  outputContainer->Add(fhConeSumPtVSUETracksEtaBand);
1594 
1596  ("hConeSumPtVSUETracksPhiBand",
1597  Form("#Sigma #it{p}_{T} in cone versus #Sigma #it{p}_{T} in #varphi band for tracks (before normalization), R=%2.2f",fConeSize),
1598  nptsumbins,ptsummin,ptsummax,8*nptsumbins,ptsummin,8*ptsummax);
1599  fhConeSumPtVSUETracksPhiBand->SetXTitle("#Sigma #it{p}_{T} cone (GeV/#it{c})");
1600  fhConeSumPtVSUETracksPhiBand->SetYTitle("#Sigma #it{p}_{T} UE (GeV/#it{c})");
1601  outputContainer->Add(fhConeSumPtVSUETracksPhiBand);
1602 
1603  if ( fFillEtaPhiHistograms )
1604  {
1606  ("hConePtSumEtaBandUETrackTrigEtaPhi",
1607  "Trigger #eta vs #varphi, #Sigma track #it{p}_{T} in UE Eta Band",
1608  netabins,etamin,etamax,nphibins,phimin,phimax);
1609  fhConeSumPtEtaBandUETrackTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T} (GeV/#it{c})");
1610  fhConeSumPtEtaBandUETrackTrigEtaPhi->SetXTitle("#eta_{trigger}");
1611  fhConeSumPtEtaBandUETrackTrigEtaPhi->SetYTitle("#varphi_{trigger} (rad)");
1612  outputContainer->Add(fhConeSumPtEtaBandUETrackTrigEtaPhi) ;
1613 
1615  ("hConePtSumPhiBandUETrackTrigEtaPhi",
1616  "Trigger #eta vs #varphi, #Sigma track #it{p}_{T} in UE Phi Band",
1617  netabins,etamin,etamax,nphibins,phimin,phimax);
1618  fhConeSumPtPhiBandUETrackTrigEtaPhi->SetZTitle("#Sigma #it{p}_{T}");
1619  fhConeSumPtPhiBandUETrackTrigEtaPhi->SetXTitle("#eta_{trigger}");
1620  fhConeSumPtPhiBandUETrackTrigEtaPhi->SetYTitle("#varphi_{trigger} (rad)");
1621  outputContainer->Add(fhConeSumPtPhiBandUETrackTrigEtaPhi) ;
1622  }
1623 
1624  // Subtraction
1626  ("hConeSumPtUEBandNormTrack",
1627  Form("Tracks #Sigma #it{p}_{T} in normalized #eta or #varphi band, #it{R} = %2.2f",fConeSize),
1628  nptbins,ptmin,ptmax,nptsumbins,ptsummin,ptsummax);
1629  fhConeSumPtUEBandNormTrack->SetYTitle("#Sigma #it{p}_{T}^{band-norm} (GeV/#it{c})");
1630  fhConeSumPtUEBandNormTrack->SetXTitle("#it{p}_{T} (GeV/#it{c})");
1631  outputContainer->Add(fhConeSumPtUEBandNormTrack) ;
1632 
1634  ("hConeSumPtTrackSubVsNoSub",
1635  Form("#Sigma #it{p}_{T} in cone before and after UE bkg subtraction from #eta or #varphi band, R=%2.2f",fConeSize),
1636  nptsumbins,ptsummin,ptsummax,nptsumbinsUESub,ptsumminUESub,ptsummaxUESub);
1637  fhConeSumPtTrackSubVsNoSub->SetXTitle("#Sigma #it{p}_{T} (GeV/#it{c})");
1638  fhConeSumPtTrackSubVsNoSub->SetYTitle("#Sigma #it{p}_{T, UE sub} (GeV/#it{c})");
1639  outputContainer->Add(fhConeSumPtTrackSubVsNoSub);
1640  }
1641  } // charged
1642 
1643  // UE subtraction
1644 
1646  {
1648  ("hConePtSumUEBandSubClustervsTrack",
1649  Form("Track vs Cluster #Sigma #it{p}_{T} UE sub #eta or #varphi band in isolation cone for #it{R} = %2.2f",fConeSize),
1650  nptsumbinsUESub,ptsumminUESub,ptsummaxUESub,
1651  nptsumbinsUESub,ptsumminUESub,ptsummaxUESub);
1652  fhConeSumPtUEBandSubClustervsTrack->SetXTitle("#Sigma #it{p}_{T}^{cluster} (GeV/#it{c})");
1653  fhConeSumPtUEBandSubClustervsTrack->SetYTitle("#Sigma #it{p}_{T}^{track} (GeV/#it{c})");
1654  outputContainer->Add(fhConeSumPtUEBandSubClustervsTrack) ;
1655 
1657  ("hBandClustervsTrack",
1658  Form("Track vs Cluster #Sigma #it{p}_{T} in #eta or #varphi band in isolation cone for #it{R} = %2.2f",fConeSize),
1659  nptsumbins,ptsummin,ptsummax,nptsumbins,ptsummin,ptsummax);
1660  fhBandClustervsTrack->SetXTitle("#Sigma #it{p}_{T}^{cluster} (GeV/#it{c})");
1661  fhBandClustervsTrack->SetYTitle("#Sigma #it{p}_{T}^{track} (GeV/#it{c})");
1662  outputContainer->Add(fhBandClustervsTrack) ;
1663 
1665  ("hBandNormClustervsTrack",
1666  Form("Track vs Cluster Normalized #Sigma #it{p}_{T} in #eta or #varphi band in isolation cone for #it{R} = %2.2f",fConeSize),
1667  nptsumbins,ptsummin,ptsummax,nptsumbins,ptsummin,ptsummax);
1668  fhBandNormClustervsTrack->SetXTitle("#Sigma #it{p}_{T}^{cluster} (GeV/#it{c})");
1669  fhBandNormClustervsTrack->SetYTitle("#Sigma #it{p}_{T}^{track} (GeV/#it{c})");
1670  outputContainer->Add(fhBandNormClustervsTrack) ;
1671  } // UE, neutral + charged
1672 
1673  if ( fFillHistograms)
1674  {
1676  {
1678  ("hFractionClusterOutConeEta",
1679  Form("Fraction of cone area (#it{R} = %2.2f), out of clusters #eta acceptance",fConeSize),
1680  nptbins,ptmin,ptmax,100,0,1);
1681  fhFractionClusterOutConeEta->SetYTitle("1-(#it{A}_{cone}+#it{A}_{excess})/#it{A}_{cone}");
1682  fhFractionClusterOutConeEta->SetXTitle("#it{p}_{T,trigger} (GeV/#it{c})");
1683  outputContainer->Add(fhFractionClusterOutConeEta) ;
1684 
1686  ("hFractionClusterOutConeEtaTrigEtaPhi",
1687  Form("Fraction of cone area (#it{R} = %2.2f), out of clusters #eta acceptance, in trigger #eta-#varphi ",fConeSize),
1688  netabins,etamin,etamax,nphibins,phimin,phimax);
1689  fhFractionClusterOutConeEtaTrigEtaPhi->SetZTitle("1-(#it{A}_{cone}+#it{A}_{excess})/#it{A}_{cone}");
1690  fhFractionClusterOutConeEtaTrigEtaPhi->SetXTitle("#eta_{trigger}");
1691  fhFractionClusterOutConeEtaTrigEtaPhi->SetYTitle("#varphi_{trigger} (rad)");
1692  outputContainer->Add(fhFractionClusterOutConeEtaTrigEtaPhi) ;
1693 
1695  ("hFractionClusterOutConePhi",
1696  Form("Fraction of cone area (#it{R} = %2.2f), out of clusters #varphi acceptance",fConeSize),
1697  nptbins,ptmin,ptmax,100,0,1);
1698  fhFractionClusterOutConePhi->SetYTitle("1-(#it{A}_{cone}+#it{A}_{excess})/#it{A}_{cone}");
1699  fhFractionClusterOutConePhi->SetXTitle("#it{p}_{T,trigger} (GeV/#it{c})");
1700  outputContainer->Add(fhFractionClusterOutConePhi) ;
1701 
1703  ("hFractionClusterOutConePhiTrigEtaPhi",
1704  Form("Fraction of cone area (#it{R} = %2.2f), out of clusters #varphi acceptance, in trigger #eta-#varphi ",fConeSize),
1705  netabins,etamin,etamax,nphibins,phimin,phimax);
1706  fhFractionClusterOutConePhiTrigEtaPhi->SetZTitle("1-(#it{A}_{cone}+#it{A}_{excess})/#it{A}_{cone}");
1707  fhFractionClusterOutConePhiTrigEtaPhi->SetXTitle("#eta_{trigger}");
1708  fhFractionClusterOutConePhiTrigEtaPhi->SetYTitle("#varphi_{trigger} (rad)");
1709  outputContainer->Add(fhFractionClusterOutConePhiTrigEtaPhi) ;
1710 
1712  ("hFractionClusterOutConeEtaPhi",
1713  Form("Fraction of cone area (#it{R} = %2.2f), out of clusters #eta x #varphi acceptance",fConeSize),
1714  nptbins,ptmin,ptmax,100,0,1);
1715  fhFractionClusterOutConeEtaPhi->SetYTitle("1-(#it{A}_{cone}+#it{A}_{excess})/#it{A}_{cone}");
1716  fhFractionClusterOutConeEtaPhi->SetXTitle("#it{p}_{T,trigger} (GeV/#it{c})");
1717  outputContainer->Add(fhFractionClusterOutConeEtaPhi) ;
1718 
1720  ("hFractionClusterOutConeEtaPhiTrigEtaPhi",
1721  Form("Fraction of cone area (#it{R} = %2.2f), out of clusters #eta x #varphi acceptance, in trigger #eta-#varphi ",fConeSize),
1722  netabins,etamin,etamax,nphibins,phimin,phimax);
1723  fhFractionClusterOutConeEtaPhiTrigEtaPhi->SetZTitle("1-(#it{A}_{cone}+#it{A}_{excess})/#it{A}_{cone}");
1724  fhFractionClusterOutConeEtaPhiTrigEtaPhi->SetXTitle("#eta_{trigger}");
1725  fhFractionClusterOutConeEtaPhiTrigEtaPhi->SetYTitle("#varphi_{trigger} (rad)");
1726  outputContainer->Add(fhFractionClusterOutConeEtaPhiTrigEtaPhi) ;
1727 
1729  ("hFractionTrackOutConeEta",
1730  Form("Fraction of cone area (#it{R} = %2.2f), out of tracks #eta acceptance",fConeSize),
1731  nptbins,ptmin,ptmax,100,0,1);
1732  fhFractionTrackOutConeEta->SetYTitle("1-(#it{A}_{cone}+#it{A}_{excess})/#it{A}_{cone}");
1733  fhFractionTrackOutConeEta->SetXTitle("#it{p}_{T,trigger} (GeV/#it{c})");
1734  outputContainer->Add(fhFractionTrackOutConeEta) ;
1735 
1737  ("hFractionTrackOutConeEtaTrigEtaPhi",
1738  Form("Fraction of cone area (#it{R} = %2.2f), out of tracks #eta acceptance, in trigger #eta-#varphi ",fConeSize),
1739  netabins,etamin,etamax,nphibins,phimin,phimax);
1740  fhFractionTrackOutConeEtaTrigEtaPhi->SetZTitle("1-(#it{A}_{cone}+#it{A}_{excess})/#it{A}_{cone}");
1741  fhFractionTrackOutConeEtaTrigEtaPhi->SetXTitle("#eta_{trigger}");
1742  fhFractionTrackOutConeEtaTrigEtaPhi->SetYTitle("#varphi_{trigger} (rad)");
1743  outputContainer->Add(fhFractionTrackOutConeEtaTrigEtaPhi) ;
1744  }
1745  }
1746 
1747  return outputContainer;
1748 }
1749 
1750 //____________________________________________
1753 //____________________________________________
1755 {
1756  TString parList ; //this will be list of parameters used for this analysis.
1757  const Int_t buffersize = 255;
1758  char onePar[buffersize] ;
1759 
1760  snprintf(onePar,buffersize,"--- AliIsolationCut ---:") ;
1761  parList+=onePar ;
1762  snprintf(onePar,buffersize,"fConeSize=%1.2f;",fConeSize) ;
1763  parList+=onePar ;
1764  snprintf(onePar,buffersize,"fPtThreshold>%2.2f;<%2.2f;",fPtThreshold,fPtThresholdMax) ;
1765  parList+=onePar ;
1766  snprintf(onePar,buffersize,"fSumPtThreshold>%2.2f;<%2.2f;",fSumPtThreshold,fSumPtThresholdMax) ;
1767  parList+=onePar ;
1768  snprintf(onePar,buffersize,"fPtFraction=%2.2f;",fPtFraction) ;
1769  parList+=onePar ;
1770  snprintf(onePar,buffersize,"fICMethod=%d;",fICMethod) ;
1771  parList+=onePar ;
1772  snprintf(onePar,buffersize,"fPartInCone=%d;",fPartInCone) ;
1773  parList+=onePar ;
1774  snprintf(onePar,buffersize,"fFracIsThresh=%i;",fFracIsThresh) ;
1775  parList+=onePar ;
1776  snprintf(onePar,buffersize," fIsTMClusterInConeRejected=%i;", fIsTMClusterInConeRejected) ;
1777  parList+=onePar ;
1778  snprintf(onePar,buffersize,"fDistMinToTrigger=%1.2f;",fDistMinToTrigger) ;
1779  parList+=onePar ;
1780  snprintf(onePar,buffersize,"fFillHistograms=%d,fFillEtaPhiHistograms=%d;",fFillHistograms,fFillEtaPhiHistograms) ;
1781  parList+=onePar ;
1782 
1783  return parList;
1784 }
1785 
1786 //____________________________________
1787 // Initialize the parameters of the analysis.
1788 //____________________________________
1790 {
1791  fFillHistograms = kFALSE; // True in GetCreateOutputObjects();
1792  fFillEtaPhiHistograms = kFALSE;
1793  fConeSize = 0.4 ;
1794  fPtThreshold = 0.5 ;
1795  fPtThresholdMax = 10000. ;
1796  fSumPtThreshold = 2.0 ;
1797  fSumPtThresholdMax = 10000. ;
1798  fPtFraction = 0.1 ;
1800  fICMethod = kSumPtIC; // 0 pt threshol method, 1 cone pt sum method
1801  fFracIsThresh = 1;
1802  fDistMinToTrigger = -1.; // no effect
1803  fNeutralOverChargedRatio = 0.363; // Based on pPb analysis, to be confirmed on other systems.
1804  // Use eta band for charged and neutrals for estimation.
1805 }
1806 
1807 //________________________________________________________________________________
1827 //________________________________________________________________________________
1831  Bool_t bFillAOD, Bool_t useRefs, TString aodArrayRefName,
1832  TObjArray * bgTrk, TObjArray * bgCls,
1833  Int_t calorimeter, AliCaloPID * pid,
1834  Int_t & nPart , Int_t & nfrac,
1835  Float_t & coneptsum , Float_t & ptLead,
1836  Bool_t & isolated , Double_t histoWeight
1837 )
1838 {
1840  {
1841  AliFatal("Only neutral in cone and perpendicular cones combination not supported \n");
1842  return;
1843  }
1844 
1845  Float_t ptC = pCandidate->Pt() ;
1846  Float_t phiC = pCandidate->Phi() ;
1847  if ( phiC < 0 ) phiC+=TMath::TwoPi();
1848  Float_t etaC = pCandidate->Eta() ;
1849 
1850  Float_t coneptsumCluster = 0;
1851  Float_t coneptsumTrack = 0;
1852  Float_t coneptLeadCluster = 0;
1853  Float_t coneptLeadTrack = 0;
1854 
1855  Float_t etaBandPtSumTrack = 0;
1856  Float_t phiBandPtSumTrack = 0;
1857  Float_t perpPtSumTrack = 0;
1858  Float_t etaBandPtSumCluster = 0;
1859  Float_t phiBandPtSumCluster = 0;
1860 
1861  nPart = 0 ;
1862  nfrac = 0 ;
1863  isolated = kFALSE;
1864 
1865  AliDebug(1,Form("Candidate pT %2.2f, eta %2.2f, phi %2.2f, cone %1.2f, thres %2.2f, Fill AOD? %d",
1866  pCandidate->Pt(), pCandidate->Eta(), pCandidate->Phi()*TMath::RadToDeg(),
1867  fConeSize, fPtThreshold, bFillAOD));
1868 
1869  // ------------------------------------------
1870  // Get charged tracks and clusters in cone.
1871  // Add the pt or get the leading one
1872  // ------------------------------------------
1873 
1874  //printf("Get track signal\n");
1875  CalculateTrackSignalInCone (pCandidate , reader,
1876  bFillAOD , useRefs,
1877  aodArrayRefName , bgTrk,
1878  nPart , nfrac,
1879  coneptsumTrack , coneptLeadTrack,
1880  etaBandPtSumTrack , phiBandPtSumTrack,
1881  perpPtSumTrack , histoWeight);
1882 
1883  //printf("Get calo signal\n");
1884  CalculateCaloSignalInCone (pCandidate , reader,
1885  bFillAOD , useRefs,
1886  aodArrayRefName , bgCls,
1887  calorimeter , pid,
1888  nPart , nfrac,
1889  coneptsumCluster , coneptLeadCluster,
1890  etaBandPtSumCluster, phiBandPtSumCluster,
1891  histoWeight);
1892 
1893  // Add leading found information to candidate object
1894  pCandidate->SetNeutralLeadPtInCone(coneptLeadCluster);
1895  pCandidate->SetChargedLeadPtInCone(coneptLeadTrack);
1896 
1897  // Calculate how much of the cone got out the detectors acceptance
1898  //
1899  Float_t excessAreaTrkEta = 1;
1900  Float_t excessAreaClsEta = 1;
1901  Float_t excessAreaClsPhi = 1;
1902  Float_t excessTrkEta = 0;
1903  Float_t excessClsEta = 0;
1904  Float_t excessClsPhi = 0;
1905 
1907  {
1908  GetDetectorAngleLimits(reader,calorimeter); // Do it once, check done inside
1909 
1911  excessTrkEta, excessAreaTrkEta,
1912  excessClsEta, excessAreaClsEta,
1913  excessClsPhi, excessAreaClsPhi);
1914 
1915  // Store excess areas
1916  pCandidate->SetNeutralConeExcessAreaEta(excessAreaClsEta);
1917  pCandidate->SetNeutralConeExcessAreaPhi(excessAreaClsPhi);
1918  pCandidate->SetChargedConeExcessAreaEta(excessAreaTrkEta);
1919  pCandidate->SetChargedConeExcessAreaPhi(1);
1920 
1921  if ( fFillHistograms )
1922  {
1923  fhFractionTrackOutConeEta ->Fill(ptC , excessAreaTrkEta-1, histoWeight);
1924  fhFractionTrackOutConeEtaTrigEtaPhi ->Fill(etaC, phiC, (excessAreaTrkEta-1)*histoWeight); // check
1925  fhFractionClusterOutConeEta ->Fill(ptC , excessAreaClsEta-1, histoWeight);
1926  fhFractionClusterOutConeEtaTrigEtaPhi->Fill(etaC, phiC, (excessAreaClsEta-1)*histoWeight); // check
1927  fhFractionClusterOutConePhi ->Fill(ptC , excessAreaClsPhi-1, histoWeight);
1928  fhFractionClusterOutConePhiTrigEtaPhi->Fill(etaC, phiC, (excessAreaClsPhi-1)*histoWeight); // check
1929  fhFractionClusterOutConeEtaPhi ->Fill(ptC , excessAreaClsPhi*excessAreaClsEta-1, histoWeight);
1930  fhFractionClusterOutConeEtaPhiTrigEtaPhi->Fill(etaC, phiC, (excessAreaClsPhi*excessAreaClsEta-1)*histoWeight); // check
1931  }
1932  }
1933 
1934  // Calculate sum of cone energy, applying excess cone correction factor.
1935  //
1936  coneptsum = coneptsumCluster * excessAreaClsEta * excessAreaClsPhi +
1937  coneptsumTrack * excessAreaTrkEta;
1938  // coneptsum = coneptsumCluster + coneptsumTrack ;
1939 
1940  //-------------------------------------------------------------------
1941  // Check isolation, depending on selected isolation criteria requested
1942  //-------------------------------------------------------------------
1943  Double_t coneptsumUESub = coneptsum;
1944  Double_t coneptsumUESubCluster = coneptsumCluster;
1945  Double_t coneptsumUESubTrack = coneptsumTrack;
1946 
1947  // *Now*, just check the leading particle in the cone if the threshold is passed
1948  if ( ptLead > fPtThreshold && ptLead < fPtThresholdMax) nPart = 1;
1949 
1950  //if fPtFraction*ptC<fPtThreshold then consider the fPtThreshold directly
1951  if ( fFracIsThresh )
1952  {
1953  if ( fPtFraction*ptC < fPtThreshold )
1954  {
1955  if ( ptLead > fPtThreshold ) nfrac = 1 ;
1956  }
1957  else
1958  {
1959  if ( ptLead > fPtFraction*ptC ) nfrac = 1;
1960  }
1961  }
1962  else
1963  {
1964  if ( ptLead > fPtFraction*ptC ) nfrac = 1;
1965  }
1966 
1967  // Here start each of the selection methods
1968  //
1969  if ( fICMethod == kPtThresIC )
1970  {
1971  if ( nPart == 0 ) isolated = kTRUE ;
1972 
1973  AliDebug(1,Form("pT Cand %2.2f, pT Lead %2.2f, %2.2f<pT Lead< %2.2f, isolated %d",
1974  ptC,ptLead,fPtThreshold,fPtThresholdMax,isolated));
1975  }
1976  else if ( fICMethod == kSumPtIC )
1977  {
1978  if ( coneptsum > fSumPtThreshold &&
1979  coneptsum < fSumPtThresholdMax )
1980  isolated = kFALSE ;
1981  else
1982  isolated = kTRUE ;
1983 
1984  AliDebug(1,Form("pT Cand %2.2f, SumPt %2.2f, %2.2f<Sum pT< %2.2f, isolated %d",
1985  ptC,ptLead,fSumPtThreshold,fSumPtThresholdMax,isolated));
1986  }
1987  else if ( fICMethod == kPtFracIC )
1988  {
1989  if ( nfrac == 0 ) isolated = kTRUE ;
1990  }
1991  else if ( fICMethod == kSumPtFracIC )
1992  {
1993  //when the fPtFraction*ptC < fSumPtThreshold then consider the later case
1994  // printf("photon analysis IsDataMC() ?%i\n",IsDataMC());
1995  if ( fFracIsThresh )
1996  {
1997  if( fPtFraction*ptC < fSumPtThreshold && coneptsum < fSumPtThreshold ) isolated = kTRUE ;
1998  if( fPtFraction*ptC > fSumPtThreshold && coneptsum < fPtFraction*ptC ) isolated = kTRUE ;
1999  }
2000  else
2001  {
2002  if ( coneptsum < fPtFraction*ptC ) isolated = kTRUE ;
2003  }
2004  }
2005  else if ( fICMethod == kSumDensityIC )
2006  {
2007  // Get good cell density (number of active cells over all cells in cone)
2008  // and correct energy in cone.
2009  // Old method to study feasibility of analysis with cells as input and not clusters
2010  Float_t cellDensity = GetCellDensity(pCandidate,reader);
2011 
2012  if ( coneptsum < fSumPtThreshold*cellDensity )
2013  isolated = kTRUE;
2014  }
2015  else if ( fICMethod >= kSumBkgSubIC )
2016  {
2017  //printf("Do perp isolation\n");
2018  // First get the background to be subtracted to the cone content
2019  // Different ways: perpendicular cones, eta band, phi band
2020  //Double_t coneptsumBkg = 0.;
2021  Double_t coneptsumBkgTrk = 0.;
2022  Double_t coneptsumBkgCls = 0.;
2023 
2024  Double_t coneptsumBkgTrkRaw = 0.;
2025  Double_t coneptsumBkgClsRaw = 0.;
2026 
2027  if ( fICMethod == kSumBkgSubIC )
2028  {
2029  coneptsumBkgTrk = perpPtSumTrack;
2030  coneptsumBkgCls = perpPtSumTrack*fNeutralOverChargedRatio;
2031  //coneptsumBkg = perpPtSumTrack*(1+fNeutralOverChargedRatio);
2032 
2033  // Add to candidate object
2034  pCandidate->SetChargedPtSumInPerpCone(perpPtSumTrack*excessAreaTrkEta);
2035  } // UE subtraction by perpendicular cones
2036  else if ( fICMethod >= kSumBkgSubEtaBandIC ) // eta or phi band
2037  {
2038  //printf("UE band\n");
2039  Float_t etaBandPtSumTrackNorm = 0;
2040  Float_t phiBandPtSumTrackNorm = 0;
2041  Float_t etaBandPtSumClusterNorm = 0;
2042  Float_t phiBandPtSumClusterNorm = 0;
2043 
2044  Float_t coneptsumTrackSub = 0 ;
2045  Float_t coneptsumClusterSub = 0 ;
2046 
2047  // Normalize background to cone area
2048  if ( fPartInCone != kOnlyCharged )
2049  {
2051  excessClsEta , excessClsPhi ,
2052  excessAreaClsEta , excessAreaClsPhi ,
2053  etaBandPtSumCluster , phiBandPtSumCluster ,
2054  etaBandPtSumClusterNorm, phiBandPtSumClusterNorm);
2055 
2056  if ( fICMethod == kSumBkgSubEtaBandIC )
2057  {
2058  coneptsumBkgClsRaw = etaBandPtSumCluster;
2059  coneptsumBkgCls = etaBandPtSumClusterNorm;
2060  coneptsumClusterSub = coneptsumCluster - coneptsumBkgCls;
2061 
2062  }
2063  else if( fICMethod == kSumBkgSubPhiBandIC )
2064  {
2065  coneptsumBkgClsRaw = phiBandPtSumCluster;
2066  coneptsumBkgCls = phiBandPtSumClusterNorm;
2067  coneptsumClusterSub = coneptsumCluster - coneptsumBkgCls;
2068  }
2069 
2070 
2071  // printf("Cluster: sumpT %2.2f, phi: sum pT %2.2f, sumpT norm %2.2f, excess %2.2f;\n"
2072  // "\t eta: sum pT %2.2f, sumpT norm %2.2f, excess %2.2f;\n"
2073  // "\t subtracted: %2.2f\n",
2074  // coneptsumCluster, phiBandPtSumCluster, coneptsumBkgCls, excessFracPhiCluster,
2075  // coneptsumBkgClsRaw, coneptsumBkgCls, excessFracEtaCluster,
2076  // coneptsumClusterSubEta);
2077 
2078  if ( fFillHistograms )
2079  {
2080  fhConeSumPtUEBandNormCluster->Fill(ptC, coneptsumBkgCls, histoWeight);
2081  fhConeSumPtClusterSubVsNoSub->Fill(coneptsumCluster, coneptsumClusterSub, histoWeight);
2082  } // histograms
2083  } // clusters in cone
2084 
2085  //printf("Pass cluster\n");
2086 
2087  if ( fPartInCone != kOnlyNeutral )
2088  {
2090  excessTrkEta ,
2091  excessAreaTrkEta ,
2092  etaBandPtSumTrack , phiBandPtSumTrack,
2093  etaBandPtSumTrackNorm, phiBandPtSumTrackNorm);
2094 
2095  if ( fICMethod == kSumBkgSubEtaBandIC )
2096  {
2097  coneptsumBkgTrkRaw = etaBandPtSumTrack;
2098  coneptsumBkgTrk = etaBandPtSumTrackNorm;
2099  coneptsumTrackSub = coneptsumTrack - coneptsumBkgTrk;
2100  }
2101  else if( fICMethod == kSumBkgSubPhiBandIC )
2102  {
2103  coneptsumBkgTrkRaw = phiBandPtSumTrack;
2104  coneptsumBkgTrk = phiBandPtSumTrackNorm;
2105  coneptsumTrackSub = coneptsumTrack - coneptsumBkgTrk;
2106  }
2107 
2108  // printf("Track: sumpT %2.2f, phi: sum pT %2.2f, sumpT norm %2.2f, excess %2.2f;\n"
2109  // "\t eta: sum pT %2.2f, sumpT norm %2.2f, excess %2.2f;\n"
2110  // "\t subtracted: %2.2f\n",
2111  // coneptsumTrack, phiBandPtSumTrack, coneptsumBkgTrk, excessFracPhiTrack,
2112  // etaBandPtSumTrack, coneptsumBkgTrk, excessFracEtaTrack,
2113  // coneptsumTrackSub);
2114 
2115  if ( fFillHistograms )
2116  {
2117  fhConeSumPtUEBandNormTrack->Fill(ptC, coneptsumBkgTrk, histoWeight);
2118  fhConeSumPtTrackSubVsNoSub->Fill(coneptsumTrack, coneptsumTrackSub, histoWeight);
2119  } // fill
2120  } // tracks in cone
2121 
2122  //printf("Pass track\n");
2123 
2125  fFillHistograms )
2126  {
2127  fhBandClustervsTrack ->Fill(coneptsumBkgClsRaw, coneptsumBkgTrkRaw, histoWeight);
2128  fhBandNormClustervsTrack->Fill(coneptsumBkgCls , coneptsumBkgTrk , histoWeight);
2129 
2130  fhConeSumPtUEBandSubClustervsTrack->Fill(coneptsumClusterSub, coneptsumTrackSub, histoWeight);
2131  }
2132 
2133  //printf("Pass both\n");
2134 
2135  // Add to candidate object
2136  pCandidate->SetNeutralPtSumEtaBand(coneptsumBkgCls);
2137  pCandidate->SetNeutralPtSumPhiBand(coneptsumBkgCls);
2138 
2139  pCandidate->SetChargedPtSumEtaBand(coneptsumBkgTrk);
2140  pCandidate->SetChargedPtSumPhiBand(coneptsumBkgTrk);
2141 
2142  } // UE subtraction by Eta band
2143 
2144  coneptsumUESubCluster -= coneptsumBkgCls;
2145  coneptsumUESubTrack -= coneptsumBkgTrk;
2146 
2147  // Calculated in case of fICMethod == kSumBkgSubEtaBandIC,
2148  // reset excess areas to 1 if not used in final result.
2149  if ( !fMakeConeExcessCorr )
2150  {
2151  excessAreaTrkEta = 1;
2152  excessAreaClsEta = 1;
2153  excessAreaClsPhi = 1;
2154  }
2155 
2156  if ( fPartInCone == kNeutralAndCharged ) coneptsumUESub = coneptsumUESubCluster * excessAreaClsPhi*excessAreaClsEta +
2157  coneptsumUESubTrack * excessAreaTrkEta;
2158  else if ( fPartInCone == kOnlyCharged ) coneptsumUESub = coneptsumUESubTrack * excessAreaTrkEta;
2159  else if ( fPartInCone == kOnlyNeutral ) coneptsumUESub = coneptsumUESubCluster * excessAreaClsPhi*excessAreaClsEta;
2160 
2161  // Put final subtracted and corrected (if requested, if not it will be without the correction)
2162  pCandidate->SetNeutralPtSumInCone (coneptsumUESubCluster *excessAreaClsEta * excessAreaClsPhi);
2163  pCandidate->SetChargedPtSumInCone (coneptsumUESubTrack *excessAreaTrkEta);
2164 
2165  if ( coneptsumUESub > fSumPtThreshold && coneptsumUESub < fSumPtThresholdMax )
2166  isolated = kFALSE ;
2167  else
2168  isolated = kTRUE ;
2169  //printf("isolated %d\n",isolated);
2170 
2171  } // UE subtraction, different options
2172 
2173  //-------------------------------------------------------------------
2174  // Fill histograms
2175  //-------------------------------------------------------------------
2176 
2177  if ( !fFillHistograms ) return;
2178 
2179  // Sum pt in cone
2180  //
2181  //printf("fill histo");
2182  fhConeSumPt->Fill(ptC, coneptsum, histoWeight);
2183 
2184  if ( fFillEtaPhiHistograms )
2185  fhConeSumPtTrigEtaPhi->Fill(etaC, phiC, coneptsum*histoWeight); // check
2186 
2187  if ( fPartInCone == kNeutralAndCharged && fICMethod != kSumBkgSubIC ) // No need for perpendicular or charged/neutral only analysis
2188  {
2189  fhConeSumPtClustervsTrack ->Fill(coneptsumCluster, coneptsumTrack, histoWeight);
2190  if(coneptsumTrack > 0) fhConeSumPtClusterTrackFrac ->Fill(ptC, coneptsumCluster /coneptsumTrack, histoWeight);
2191  }
2192 
2193  // Here the sum in cone before subtraction, if done, to check the effect.
2194  //
2195  if ( fICMethod >= kSumBkgSubIC )
2196  {
2197  fhConeSumPtUESub ->Fill(ptC, coneptsumUESub, histoWeight);
2198 
2199  if ( fFillEtaPhiHistograms )
2200  fhConeSumPtUESubTrigEtaPhi->Fill(etaC, phiC, coneptsumUESub*histoWeight); // check
2201 
2202  // No for charged/neutral only analysis
2204  {
2205  fhConeSumPtUESubTrack ->Fill(ptC, coneptsumUESubTrack , histoWeight);
2206  fhConeSumPtUESubCluster->Fill(ptC, coneptsumUESubCluster, histoWeight);
2207 
2208  // No need for perpendicular cones
2209  if( fICMethod != kSumBkgSubIC )
2210  {
2211 
2212  fhConeSumPtUESubClustervsTrack ->Fill(coneptsumUESubCluster, coneptsumUESubTrack, histoWeight);
2213  if ( TMath::Abs(coneptsumUESubTrack) > 0 )
2214  fhConeSumPtUESubClusterTrackFrac ->Fill(ptC, coneptsumUESubCluster /coneptsumUESubTrack, histoWeight);
2215  }
2216  }
2217  }
2218 
2219  // Leading in cone
2220  //
2221  Float_t coneptLead = coneptLeadTrack;
2222  if(coneptLeadCluster > coneptLeadTrack)
2223  coneptLead = coneptLeadCluster;
2224 
2226  {
2227  fhConePtLeadClustervsTrack->Fill(coneptLeadCluster,coneptLeadTrack, histoWeight);
2228 
2229  if ( coneptLeadTrack > 0 )
2230  fhConePtLeadClusterTrackFrac->Fill(ptC, coneptLeadCluster/coneptLeadTrack, histoWeight);
2231  }
2232 
2233  fhConePtLead->Fill(ptC, coneptLead, histoWeight);
2234 
2235 }
2236 
2237 //_____________________________________________________
2239 //_____________________________________________________
2241 {
2242  if(! opt)
2243  return;
2244 
2245  printf("**** Print %s %s **** \n", GetName(), GetTitle() ) ;
2246 
2247  printf("IC method = %d\n", fICMethod ) ;
2248  printf("Cone Size = %1.2f\n", fConeSize ) ;
2249  printf("pT threshold = >%2.1f;<%2.1f\n", fPtThreshold , fPtThresholdMax) ;
2250  printf("Sum pT threshold = >%2.1f;<%2.1f\n", fSumPtThreshold,fSumPtThresholdMax) ;
2251  printf("pT fraction = %3.1f\n", fPtFraction ) ;
2252  printf("particle type in cone = %d\n", fPartInCone ) ;
2253  printf("using fraction for high pt leading instead of frac ? %i\n",fFracIsThresh);
2254  printf("minimum distance to candidate, R>%1.2f\n",fDistMinToTrigger);
2255  printf("correct cone excess = %d \n",fMakeConeExcessCorr);
2256  printf(" \n") ;
2257 }
2258 
2259 //______________________________________________________________
2265 //______________________________________________________________
2267  Float_t eta , Float_t phi) const
2268 {
2269  Float_t dEta = etaC-eta;
2270  Float_t dPhi = phiC-phi;
2271 
2272  if(TMath::Abs(dPhi) >= TMath::Pi())
2273  dPhi = TMath::TwoPi()-TMath::Abs(dPhi);
2274 
2275  return TMath::Sqrt( dEta*dEta + dPhi*dPhi );
2276 }
2277 
2278 
2279 
Float_t GetHistoPtMax() const
virtual void SetNeutralPtSumEtaBand(Float_t s)
virtual Double_t Eta() const
TH2F * fhConeSumPtEtaBandUETrackTrigEtaPhi
! Track Sum Pt in the eta band for tracks, per eta-phi bin of trigger, before normalization.
virtual Double_t Pt() const
Float_t GetHistoPtMin() const
AliCalorimeterUtils * GetCaloUtils() const
double Double_t
Definition: External.C:58
TH2F * fhPerpConeSumPtTrigEtaPhi
! Track Sum Pt in the perpendicular cones for tracks, per eta-phi bin of trigger. ...
TH2F * fhConePtLeadClustervsTrack
! Tracks vs Clusters leading pt.
TH2F * fhConeSumPtTrigEtaPhi
! Cluster and tracks Sum Pt Sum Pt in the cone, per eta-phi bin of trigger.
Int_t GetHistoNPtInConeBins() const
TArrayF * GetCTSFidCutMaxEtaArray() const
Definition: External.C:236
Bool_t fFracIsThresh
Use threshold instead of fraction when pt leading is small.
TH2F * fhConeSumPt
! Cluster and tracks Sum Pt in the cone.
TArrayF * GetPHOSFidCutMaxPhiArray() const
virtual void SetNeutralConeExcessAreaEta(Float_t s)
TLorentzVector fMomentum
! Momentum of cluster, temporal object.
Class with utils to perform Isolation Cuts.
TH2F * fhConeSumPtEtaBandUEClusterTrigEtaPhi
! Cluster Sum Pt in the eta band for clusters, per eta-phi bin of trigger,before normalization.
virtual void SetChargedLeadPtInCone(Float_t ptl)
TH2F * fhConeSumPtVSUEClusterEtaBand
! Clusters, eta band: sum pT in cone vs bkg to subtract.
TH2F * fhEtaBandClusterEtaPhi
! Eta vs Phi in Eta band to estimate UE in cone, only clusters.
Isolated if pt particle in cone > fPtFraction*pt Candidate.
virtual TObjArray * GetEMCALClusters() const
void CalculateUEBandTrackNormalization(Float_t etaC, Float_t excessEta, Float_t excessAreaEta, Float_t etaUEptsumTrack, Float_t phiUEptsumTrack, Float_t &etaUEptsumTrackNorm, Float_t &phiUEptsumTrackNorm) const
Get normalization of track background band.
TH2F * fhConeSumPtUEBandSubClustervsTrack
! Cluster vs tracks Sum Pt Sum Pt in the cone, after subtraction in eta or phi band.
TH2F * fhPtClusterInCone
! Cluster Pt in the cone.
Consider tracks and neutral calorimeter clusters in cone for isolation decission. ...
Float_t fTPCEtaSize
Eta size of TPC.
virtual AliVEvent * GetInputEvent() const
virtual void AddObjArray(TObjArray *refarray)
TH2F * fhEtaPhiInConeCluster
! Eta vs. phi of clusters in cone.
virtual Int_t GetTrackLabel(Int_t i) const
Consider calorimeter clusters in cone for isolation decission.
TArrayF * GetEMCALFidCutMaxPhiArray() const
TH2F * fhConePtLeadTrack
! Tracks leading pt in the cone.
virtual void SetChargedConeExcessAreaPhi(Float_t s)
Bool_t IsTrackMatched(AliVCluster *cluster, AliCalorimeterUtils *cu, AliVEvent *event)
Int_t fICMethod
Isolation cut method to be used: kPtIC, kSumPtIC, kPtFracIC, kSumPtFracIC.
Int_t GetHistoPhiBins() const
TH2F * fhConeSumPtUESub
! Cluster and tracks Sum Pt in the cone minus UE and excess corrected.
Float_t fPtThreshold
Minimum pt of the particles in the cone or sum in cone (UE pt mean in the forward region cone) ...
TH2F * fhPtInCone
! Histogram bins and ranges data-base
TH2F * fhEtaBandTrackPt
! pT in Eta band to estimate UE in cone, only tracks.
TH2F * fhFractionClusterOutConePhiTrigEtaPhi
! Fraction of cone out of clusters acceptance in phi, vs trigger eta-phi.
virtual AliMixedEvent * GetMixedEvent() const
TH2F * fhPtInPerpCone
! Particle Pt in cone at the perpendicular phi region to trigger axis (phi +90).
Float_t GetHistoPtInConeMax() const
TH2F * fhConeSumPtUEBandNormCluster
! Cluster Sum Pt in the normalized eta or phi UE cone vs pT trigger.
virtual void SetChargedPtSumEtaBand(Float_t s)
TH2F * fhConeSumPtVSUETracksPhiBand
! Tracks, phi band: sum pT in cone vs bkg to subtract.
Float_t GetCellDensity(AliCaloTrackParticleCorrelation *pCandidate, AliCaloTrackReader *reader) const
Get good cell density (number of active cells over all cells in cone).
const TString calorimeter
Definition: anaM.C:36
virtual TObjArray * GetObjArray(TString refname) const
virtual void GetVertex(Double_t v[3]) const
virtual UInt_t GetDetectorTag() const
Int_t fPartInCone
Type of particles inside cone: kNeutralAndCharged, kOnlyNeutral, kOnlyCharged.
TH2F * fhConeSumPtClusterSubVsNoSub
! Clusters, UE band: sum pT in cone after bkg sub vs sum pT in cone before bkg sub ...
TH2F * fhConeSumPtTrack
! Tracks Sum Pt in the cone.
TString GetICParametersList()
TArrayF * GetPHOSFidCutMinEtaArray() const
Float_t GetHistoPhiMin() const
TH2F * fhEtaBandTrackEtaPhi
! Eta vs Phi in Eta band to estimate UE in cone, only tracks.
Float_t fEMCPhiMax
Maximum Phi limit of Calo.
TH2F * fhConeSumPtUESubTrack
! Tracks Sum Pt in the cone minus UE and excess corrected.
TH2F * fhConeSumPtUESubClusterTrackFrac
! Cluster / tracks Sum Pt Sum Pt in the cone minus UE and excess corrected.
Isolated if any particle pt in cone < fPtThreshold.
virtual void SetChargedConeExcessAreaEta(Float_t s)
TH2F * fhConeSumPtUESubCluster
! Clusters Sum Pt in the cone minus UE and excess corrected.
Float_t fEMCPhiMin
Minimim Phi limit of Calo.
Bool_t fFillHistograms
Fill histograms if GetCreateOuputObjects() was called.
TH2F * fhPhiBandTrackPt
! pT in Phi band to estimate UE in cone, only tracks.
Daughter of AliCaloTrackParticle that includes correlation part.
const Double_t etamin
virtual void SetChargedPtSumPhiBand(Float_t s)
virtual void SetNeutralPtSumPhiBand(Float_t s)
TVector3 fTrackVector
! Track moment, temporal object.
Consider tracks in cone for isolation decission.
TH2F * fhBandClustervsTrack
! Accumulated pT in eta or phi band to estimate UE in cone, clusters vs tracks.
Float_t fSumPtThresholdMax
Maximum of sum pt of the particles in the cone (UE sum in the forward region cone) ...
TH2F * fhConePtLead
! Cluster and tracks leading pt in the cone.
TH2F * fhFractionClusterOutConeEtaPhiTrigEtaPhi
! Fraction of cone out of clusters acceptance in eta x phi, vs trigger eta-phi.
virtual void SetNeutralConeExcessAreaPhi(Float_t s)
Bool_t fMakeConeExcessCorr
virtual AliFiducialCut * GetFiducialCut()
int Int_t
Definition: External.C:63
Container for input particle information on CaloTrackCorr package.
TH2F * fhConeSumPtTrackSubVsNoSub
! Tracks, UE band: sum pT in cone after bkg sub vs sum pT in cone before bkg sub
void GetDetectorAngleLimits(AliCaloTrackReader *reader, Int_t calorimeter)
TH2F * fhEtaPhiInPerpCone
! Eta vs. phi of tracks in perpendicular cone
Bool_t fFillEtaPhiHistograms
Fill histograms if GetCreateOuputObjects() was called with eta/phi or band related histograms...
float Float_t
Definition: External.C:68
TH2F * fhConeSumPtClustervsTrack
! Cluster vs tracks Sum Pt Sum Pt in the cone.
virtual void SetNeutralPtSumInCone(Float_t pts)
const Double_t ptmax
TArrayF * GetEMCALFidCutMinEtaArray() const
TH2F * fhConeSumPtVSPerpCone
! Perpendicular cones tracks: sum pT in cone vs bkg to subtract.=
Float_t fConeSize
Make cone excess from detector correction.
TH2F * fhBandNormClustervsTrack
! Accumulated pT in eta or phi band to estimate UE in cone, normalized to cone size, clusters vs tracks.
TArrayF * GetPHOSFidCutMinPhiArray() const
TH2F * fhConeSumPtEtaBandUECluster
! Cluster Sum Pt in the eta band for clusters, before normalization.
TH2F * fhConeSumPtPhiBandUECluster
! Cluster Sum Pt in the phi band for clusters, before normalization.
TH2F * fhPhiBandClusterEtaPhi
! Eta vs Phi in Phi band to estimate UE in cone, only clusters.
Base class for event, clusters and tracks filtering and preparation for the analysis.
virtual void SetChargedPtSumInPerpCone(Float_t s)
virtual Int_t GetTrackID(AliVTrack *track)
const Double_t ptmin
void Print(const Option_t *opt) const
Print some relevant parameters set for the analysis.
TH2F * fhConeSumPtPhiBandUETrack
! Track Sum Pt in the phi band for tracks, before normalization.
Int_t GetHistoNPtSumBins() const
Isolated if sum pt particle in cone < fPtFraction*pt Candidate.
TH2F * fhFractionClusterOutConeEta
! Fraction of cone out of clusters acceptance in eta.
TH2F * fhConePtLeadCluster
! Clusters leading pt in the cone.
AliHistogramRanges * fHistoRanges
TH2F * fhPhiBandTrackEtaPhi
! Eta vs Phi in Phi band to estimate UE in cone, only tracks.
virtual TObjArray * GetPHOSClusters() const
Float_t GetHistoEtaMin() const
TH2F * fhFractionClusterOutConeEtaPhi
! Fraction of cone out of clusters acceptance in eta x phi.
TList * GetCreateOutputObjects()
Float_t GetHistoPtSumMin() const
TH2F * fhConeSumPtEtaBandUETrack
! Track Sum Pt in the eta band for tracks, before normalization.
TH2F * fhPerpConeSumPt
! Sum Pt in cone at the perpendicular phi region to trigger axis (phi +90).
Float_t fDistMinToTrigger
Minimal distance between isolation candidate particle and particles in cone to count them for this is...
Float_t fPtThresholdMax
Maximum pt of the particles outside the cone (needed to fit shower distribution isolated/non-isolated...
TH2F * fhConeSumPtClusterTrackFrac
! Cluster / tracks Sum Pt Sum Pt in the cone.
TH2F * fhConePtLeadClusterTrackFrac
! Trigger pt vs cluster/track leading pt.
Float_t GetHistoEtaMax() const
Int_t GetHistoPtBins() const
Bool_t fIsTMClusterInConeRejected
Enable to remove the Track matching removal of clusters in cone sum pt calculation in case of kNeutra...
void CalculateUEBandClusterNormalization(Float_t etaC, Float_t phiC, Float_t excessEta, Float_t excessPhi, Float_t excessAreaEta, Float_t excessAreaPhi, Float_t etaUEptsumCluster, Float_t phiUEptsumCluster, Float_t &etaUEptsumClusterNorm, Float_t &phiUEptsumClusterNorm) const
Get normalization of cluster background band.
TH2F * fhEtaBandClusterPt
! pT in Eta band to estimate UE in cone, only clusters.
void MakeIsolationCut(AliCaloTrackParticleCorrelation *pCandidate, AliCaloTrackReader *reader, Bool_t bFillAOD, Bool_t useRefs, TString aodObjArrayName, TObjArray *bgTrk, TObjArray *bgCls, Int_t calorimeter, AliCaloPID *pid, Int_t &n, Int_t &nfrac, Float_t &ptSum, Float_t &ptLead, Bool_t &isolated, Double_t histoWeight=1)
Float_t fSumPtThreshold
Minimum of sum pt of the particles in the cone (UE sum in the forward region cone) ...
TH2F * fhConeSumPtUEBandNormTrack
! Track Sum Pt in the normalized eta or phi UE cone vs pT trigger.
void CalculateCaloSignalInCone(AliCaloTrackParticleCorrelation *aodParticle, AliCaloTrackReader *reader, Bool_t bFillAOD, Bool_t useRefs, TString refArrayName, TObjArray *bgTrk, Int_t calorimeter, AliCaloPID *pid, Int_t &nPart, Int_t &nfrac, Float_t &coneptsum, Float_t &coneptLead, Float_t &etaBandPtSum, Float_t &phiBandPtSum, Double_t histoWeight=1)
TH2F * fhEtaPhiTrack
! Eta vs. phi of all tracks.
TH2F * fhFractionClusterOutConePhi
! Fraction of cone out of clusters acceptance in phi.
TH2F * fhPtTrackInCone
! Track Pt in the cone.
Float_t fPtFraction
Fraction of the momentum of particles in cone or sum in cone.
void CalculateTrackSignalInCone(AliCaloTrackParticleCorrelation *aodParticle, AliCaloTrackReader *reader, Bool_t bFillAOD, Bool_t useRefs, TString refArrayName, TObjArray *bgCls, Int_t &nPart, Int_t &nfrac, Float_t &coneptsum, Float_t &coneptLead, Float_t &etaBandPtSum, Float_t &phiBandPtSum, Float_t &perpBandPtSum, Double_t histoWeight=1)
TH2F * fhConeSumPtVSUETracksEtaBand
! Tracks, eta band: sum pT in cone vs bkg to subtract.
TH2F * fhConeSumPtPhiBandUEClusterTrigEtaPhi
! Cluster Sum Pt in the phi band for clusters, per eta-phi bin of trigger, before normalization...
const Double_t etamax
virtual Double_t Phi() const
void GetCoeffNormBadCell(AliCaloTrackParticleCorrelation *pCandidate, AliCaloTrackReader *reader, Float_t &coneBadCellsCoeff, Float_t &etaBandBadCellsCoeff, Float_t &phiBandBadCellsCoeff)
Get good cell density (number of active cells over all cells in cone).
Same as kSumPtIC, but sum pt particle in cone subtracted from UE estimated in perpendicular cones...
TH2F * fhFractionClusterOutConeEtaTrigEtaPhi
! Fraction of cone out of clusters acceptance in eta, vs trigger eta-phi.
const char Option_t
Definition: External.C:48
Class for PID selection with calorimeters.
Definition: AliCaloPID.h:53
void CalculateExcessAreaFractionForChargedAndNeutral(Float_t etaC, Float_t phiC, Float_t &excessTrkEta, Float_t &excessAreaTrkEta, Float_t &excessClsEta, Float_t &excessAreaClsEta, Float_t &excessClsPhi, Float_t &excessAreaClsPhi) const
TH2F * fhConeSumPtUESubTrigEtaPhi
! Cluster and tracks Sum Pt Sum Pt in the cone, per eta-phi bin of trigger minus UE and excess correc...
Float_t GetHistoPhiMax() const
bool Bool_t
Definition: External.C:53
TH2F * fhConeSumPtCluster
! Clusters Sum Pt in the cone.
Float_t fNeutralOverChargedRatio
Fix ratio of sum pT of neutrals over charged. For perpendicular cones UE subtraction.
Class with utils specific to calorimeter clusters/cells.
AliIsolationCut()
Default constructor. Initialize parameters.
Int_t GetHistoEtaBins() const
TArrayF * GetEMCALFidCutMaxEtaArray() const
Float_t Radius(Float_t etaCandidate, Float_t phiCandidate, Float_t eta, Float_t phi) const
TH2F * fhEtaPhiCluster
! Eta vs. phi of all clusters.
TArrayF * GetPHOSFidCutMaxEtaArray() const
Float_t CalculateExcessAreaFraction(Float_t excess) const
TH2F * fhFractionTrackOutConeEtaTrigEtaPhi
! Fraction of cone out of tracks acceptance in eta, vs trigger eta-phi.
TArrayF * GetCTSFidCutMinEtaArray() const
TH2F * fhEtaPhiInConeTrack
! Eta vs. phi of tracks in cone.
TArrayF * GetEMCALFidCutMinPhiArray() const
TH2F * fhConeSumPtPhiBandUETrackTrigEtaPhi
! Track Sum Pt in the phi band for tracks, per eta-phi bin of trigger, before normalization.
Float_t GetHistoPtSumMax() const
Isolated if sum pt particle in cone < fSumPtThreshold.
Float_t fTPCPhiSize
Phi size of TPC, it is 360 degrees, but here set to half.
Int_t GetEMCALChannelStatus(Int_t iSM, Int_t iCol, Int_t iRow, Int_t status) const
Float_t GetHistoPtInConeMin() const
Int_t nptbins
Isolated if sum pt particle in cone < fPtFraction* cell density, old not to be used.
virtual Int_t GetCaloLabel(Int_t i) const
TH2F * fhPhiBandClusterPt
! pT in Phi band to estimate UE in cone, only clusters.
virtual void SetChargedPtSumInCone(Float_t pts)
TH2F * fhConeSumPtVSUEClusterPhiBand
! Clusters, phi band: sum pT in cone vs bkg to subtract.
Int_t GetModuleNumberCellIndexes(Int_t absId, Int_t calo, Int_t &icol, Int_t &irow, Int_t &iRCU) const
Get the EMCAL/PHOS module, columns, row and RCU/DDL number that corresponds to this absId...
TH2F * fhFractionTrackOutConeEta
! Fraction of cone out of tracks acceptance in eta.
const Double_t phimin
virtual void SetNeutralLeadPtInCone(Float_t ptl)
virtual TObjArray * GetCTSTracks() const
TH2F * fhConeSumPtUESubClustervsTrack
! Cluster vs tracks Sum Pt Sum Pt in the cone minus UE and excess corrected.
Float_t fEMCEtaSize
Eta size of Calo.