3 // Emcal Neutral Cluster analysis base task.
5 // Authors: D.Lodato,L.Ronflette, M.Marquard
9 #include <TClonesArray.h>
13 #include <TLorentzVector.h>
16 #include <THnSparse.h>
17 #include "AliAnalysisManager.h"
18 #include "AliCentrality.h"
19 #include "AliEMCALGeometry.h"
20 #include "AliESDEvent.h"
21 #include "AliAODEvent.h"
23 #include "AliVCluster.h"
24 #include "AliVEventHandler.h"
25 #include "AliVParticle.h"
26 #include "AliClusterContainer.h"
27 #include "AliVTrack.h"
28 #include "AliEmcalParticle.h"
29 #include "AliParticleContainer.h"
30 #include "AliAODCaloCluster.h"
31 #include "AliESDCaloCluster.h"
32 #include "AliVCaloCells.h"
33 #include "AliPicoTrack.h"
35 #include "AliAnalysisTaskEMCALPhotonIsolation.h"
40 ClassImp(AliAnalysisTaskEMCALPhotonIsolation)
42 //________________________________________________________________________
43 AliAnalysisTaskEMCALPhotonIsolation::AliAnalysisTaskEMCALPhotonIsolation() :
44 AliAnalysisTaskEmcal("AliAnalysisTaskEMCALPhotonIsolation",kTRUE),
45 //fParticleCollArray(),
60 fDeltaETAClusTrackVSpT(0),
61 fDeltaPHIClusTrackVSpT(0),
72 fPerpConesUETracks(0),
73 fTPCWithoutIsoConeB2BbandUE(0),
112 // Default constructor.
114 //fParticleCollArray.SetOwner(kTRUE);
115 // for(Int_t i = 0; i < 12; i++) fGeomMatrix[i] = 0;
117 SetMakeGeneralHistograms(kTRUE);
120 //________________________________________________________________________
121 AliAnalysisTaskEMCALPhotonIsolation::AliAnalysisTaskEMCALPhotonIsolation(const char *name, Bool_t histo) :
122 AliAnalysisTaskEmcal(name, histo),
123 //fParticleCollArray(),
138 fDeltaETAClusTrackVSpT(0),
139 fDeltaPHIClusTrackVSpT(0),
150 fPerpConesUETracks(0),
151 fTPCWithoutIsoConeB2BbandUE(0),
156 fEtIsolatedTracks(0),
190 // Standard constructor.
192 //fParticleCollArray.SetOwner(kTRUE);
193 // for(Int_t i = 0; i < 12; i++) fGeomMatrix[i] = 0;
195 SetMakeGeneralHistograms(kTRUE);
198 //________________________________________________________________________
199 AliAnalysisTaskEMCALPhotonIsolation::~AliAnalysisTaskEMCALPhotonIsolation(){
204 //________________________________________________________________________
205 void AliAnalysisTaskEMCALPhotonIsolation::UserCreateOutputObjects(){
206 // Create ouput histograms and THnSparse and TTree
208 AliAnalysisTaskEmcal::UserCreateOutputObjects();
211 if ((fIsoMethod == 0 || fIsoMethod == 1) && fTPC4Iso){
212 cout<<"Error: Iso_Methods with CELLS and CLUSTERS work only within EMCAL "<<endl;
213 cout<<"Please Set Iso_Method and TPC4Iso Accordingly!!"<<endl;
216 if ((fIsoMethod == 0 || fIsoMethod == 1) && fUEMethod> 1) {
217 cout<<"Error: UE_Methods with CELLS and CLUSTERS work only within EMCAL"<<endl;
218 cout<<"Please Set Iso_Method and UE_Method Accordingly!!"<<endl;
223 TString sIsoMethod="\0",sUEMethod="\0",sBoundaries="\0";
226 sIsoMethod = "Cells";
227 else if(fIsoMethod==1)
228 sIsoMethod = "Clust";
229 else if(fIsoMethod==2)
230 sIsoMethod = "Tracks";
233 sUEMethod = "PhiBand";
234 else if(fUEMethod==1)
235 sUEMethod = "EtaBand";
236 else if(fUEMethod==2)
237 sUEMethod = "PerpCones";
238 else if(fUEMethod==3)
239 sUEMethod = "FullTPC";
242 sBoundaries = "TPC Acceptance";
244 sBoundaries = "EMCAL Acceptance";
246 if(fWho>1 || fWho==-1){
247 cout<<"Error!!! OutputMode Can Only Be 0: TTree; 1: THnSparse"<<endl;
251 fOutput = new TList();
253 //Initialize the common Output histograms
257 //Initialization by Lucile and Marco
258 fOutputTree = new TTree("OutTree","OutTree");
259 fOutputTree->Branch("fevents",&fevents);
260 fOutputTree->Branch("flambda0T",&flambda0T);
261 fOutputTree->Branch("fEtT",&fEtT);
262 fOutputTree->Branch("fPtT",&fPtT);
263 fOutputTree->Branch("fEtisoT",&fEtisoT);
264 fOutputTree->Branch("fPtTiso",&fPtisoT);
265 fOutputTree->Branch("fetaT",&fetaT);
266 fOutputTree->Branch("fphiT",&fphiT);
267 fOutputTree->Branch("fsumEtisoconeT",&fsumEtisoconeT);
268 fOutputTree->Branch("fsumEtUE",&fsumEtUE);
270 fOutput->Add(fOutputTree);
274 //Initialization by Davide;
277 Int_t binTrackMult=100, binPT=70, binM02=100, binETiso=100, binETUE=110, binETisoUE=110, binetacl=140,binphicl=100, binPTMC=70;
278 Int_t bins[] = {binTrackMult, binPT, binM02, binETiso, binETUE, binETisoUE, binetacl, binphicl, binPTMC, binPTMC};
280 fNDimensions = sizeof(bins)/sizeof(Int_t);
281 const Int_t ndims = fNDimensions;
283 Double_t xmin[]= { 0., 0., 0., -10., -10., -10.,-1.0, 1. ,-10.,-10.};
285 Double_t xmax[]= {1000., 70., 2., 100., 100., 100., 1.0, 3.5, 60., 60.};
287 sTitle = Form("Direct Photons: Track Multiplicity, p_{T} , M02 , E_{T} Iso%s in %s, E_{T} UE %s in %s, E_{T} Iso_%s - E_{T} UE_%s in %s, #eta_{clus} distribution,#phi_{clus} distribution,MC_pT,MC_pT_incone; N_{ch}; p_{T} (GeV/c); M02; E_{T}^{iso%s} (GeV/c) ; E_{T}^{UE%s} (GeV/c); E_{T}^{iso%s}-E_{T}^{UE%s} (GeV/c); #eta_{cl}; #phi_{cl}; MC p_{T}; MC p_{T}^{incone}", sIsoMethod.Data(), sBoundaries.Data(), sUEMethod.Data(), sBoundaries.Data(), sIsoMethod.Data(), sUEMethod.Data(), sBoundaries.Data(), sIsoMethod.Data(), sUEMethod.Data(), sIsoMethod.Data(), sUEMethod.Data());
289 fOutputTHnS = new THnSparseF("fHnOutput",sTitle.Data(), ndims, bins, xmin, xmax);
291 fOutput->Add(fOutputTHnS);
293 Int_t binsbis[] = {binPT, binM02, binETisoUE};
294 Double_t xminbis[] = { 0., 0., -10.};
295 Double_t xmaxbis[] = {100., 2., 100.};
297 fOutPTMAX = new THnSparseF ("fOutPTMAX","3D matrix E_{#gamma} VS M02 VS pT_{max}^{cone}; E_{T}^{#gamma} (GeV/c); M02; p_{T}^{Iso}(GeV/c)",3,binsbis,xminbis,xmaxbis);
299 fOutput->Add(fOutPTMAX);
305 //Include QA plots to the OutputList //DEFINE BETTER THE BINNING AND THE AXES LIMITS
306 fTrackMult = new TH1D ("hTrackMult","Tracks multiplicity Distribution",250,0.,1000.);
308 fOutput->Add(fTrackMult);
310 fTrackMultEMCAL = new TH1D ("hTrackMultEMCAL","Tracks multiplicity Distribution inside EMCAL acceptance",250,0.,1000.);
311 fTrackMultEMCAL->Sumw2();
312 fOutput->Add(fTrackMultEMCAL);
314 fClustMult = new TH1D ("hClustMult","Clusters multiplicity Distribution",250,0.,1000.);
316 fOutput->Add(fClustMult);
318 fRecoPV = new TH1D("hRecoPV","Prim. vert. reconstruction (yes or no);reco (0=no, 1=yes) ;",2,-0.5,1.5);
320 fOutput->Add(fRecoPV);
322 fPVZBefore = new TH1D ("hPVZDistr","Z Distribution for the Reconstructed Vertex",200,0.,40.);
324 fOutput->Add(fPVZBefore);
326 fEtaPhiCell = new TH2D ("hEtaPhiCellActivity","",250,0.,1000., 250, 0., 1000.);
327 fEtaPhiCell->Sumw2();
328 fOutput->Add(fEtaPhiCell);
330 fEtaPhiClus = new TH2D ("hEtaPhiClusActivity","",250,0.,1000., 250, 0., 1000.);
331 fEtaPhiClus->Sumw2();
332 fOutput->Add(fEtaPhiClus);
334 fClusEvsClusT = new TH2D ("hEnVSTime","",250,0.,1000., 250,0.,1000.);
335 fClusEvsClusT->Sumw2();
336 fOutput->Add(fClusEvsClusT);
338 fDeltaETAClusTrackVSpT = new TH2D("hTC_Dz","Track-Cluster Dz vs pT of Cluster",100,0.,100.,100,-0.05,0.05);
339 fDeltaETAClusTrackVSpT->Sumw2();
340 fOutput->Add(fDeltaETAClusTrackVSpT);
342 fDeltaPHIClusTrackVSpT = new TH2D("hTC_Dx","Track-Cluster Dx vs pT of Cluster",100,0.,100.,100,-0.05,0.05);
343 fDeltaPHIClusTrackVSpT->Sumw2();
344 fOutput->Add(fDeltaPHIClusTrackVSpT);
347 //Initialize only the Common THistos for the Three different output
349 fGoodEventsOnPVZ = new TH1D ("hGOODwrtPVZ","Number of Selected Events wrt Cut on Primary Vertex Z (0=disregarded,1=selected)",2,0.,2.);
350 fGoodEventsOnPVZ->Sumw2();
351 fOutput->Add(fGoodEventsOnPVZ);
353 fPT = new TH1D("hPt_NC","P_{T} distribution for Neutral Clusters",100,0.,100.);
357 fM02 = new TH2D("hM02_NC","M02 distribution for Neutral Clusters vs E",100,0.,100.,500,0.,5.);
361 fNLM = new TH1D("hNLM_NC","NLM distribution for Neutral Clusters",200,0.,4.);
365 fEtIsoCells = new TH1D("hEtIsoCell_NC","E_{T}^{iso cone} in iso cone distribution for Neutral Clusters with EMCAL Cells",100,0.,100.);
366 fEtIsoCells->SetXTitle("#Sigma E_{T}^{iso cone} (GeV/c)");
367 fEtIsoCells->Sumw2();
368 fOutput->Add(fEtIsoCells);
370 fEtIsoClust = new TH1D("hEtIsoClus_NC","#Sigma E_{T}^{iso cone} in iso cone distribution for Neutral Clusters with EMCAL Clusters",100,0.,100.);
371 fEtIsoClust->SetXTitle("#Sigma E_{T}^{iso cone} (GeV/c)");
372 fEtIsoClust->Sumw2();
373 fOutput->Add(fEtIsoClust);
375 fPtIsoTrack = new TH1D("hPtIsoTrack_NC"," #Sigma P_{T}^{iso cone} in iso cone distribution for Neutral Clusters with Tracks",100,0.,100.);
376 fPtIsoTrack->SetXTitle("#Sigma P_{T}^{iso cone} (GeV/c)");
377 fPtIsoTrack->Sumw2();
378 fOutput->Add(fPtIsoTrack);
380 fPtEtIsoTC = new TH1D("hPtEtIsoTrackClust_NC","#Sigma P_{T}^{iso cone} + #Sigma E_{T}^{iso cone} in iso cone distribution for Neutral Clusters with Tracks and Clusters",100,0.,100.);
381 fPtEtIsoTC->SetXTitle("#Sigma P_{T}^{iso cone} + #Sigma E_{T}^{iso cone} (GeV/c)");
383 fOutput->Add(fPtEtIsoTC);
385 fPhiBandUEClust = new TH2D(Form("hPhiBandUE_Cluster"),Form("UE Estimation with Phi Band Clusters"),100,0.,100.,100,0.,100.);
386 fPhiBandUEClust->SetXTitle("E_{T}");
387 fPhiBandUEClust->SetYTitle("#Sigma E_{T}^{UE}");
388 fPhiBandUEClust->Sumw2();
389 fOutput->Add(fPhiBandUEClust);
391 fEtaBandUEClust = new TH2D(Form("hEtaBandUE_Cluster"),Form("UE Estimation with Phi Band Clusters"),100,0.,100.,100,0.,100.);
392 fEtaBandUEClust->SetXTitle("E_{T}");
393 fEtaBandUEClust->SetYTitle("#Sigma E_{T}^{UE}");
394 fEtaBandUEClust->Sumw2();
395 fOutput->Add(fEtaBandUEClust);
397 fPhiBandUECells = new TH2D(Form("hPhiBandUE_CELLS"),Form("UE Estimation with Phi Band CELLS"),100,0.,100.,100,0.,100.);
398 fPhiBandUECells->SetXTitle("E_{T}");
399 fPhiBandUECells->SetYTitle("#Sigma E_{T}^{UE}");
400 fPhiBandUECells->Sumw2();
401 fOutput->Add(fPhiBandUECells);
403 fEtaBandUECells = new TH2D(Form("hEtaBandUE_CELLS"),Form("UE Estimation with Phi Band and CELLS"),100,0.,100.,100,0.,100.);
404 fEtaBandUECells->SetXTitle("E_{T}");
405 fEtaBandUECells->SetYTitle("#Sigma E_{T}^{UE}");
406 fEtaBandUECells->Sumw2();
407 fOutput->Add(fEtaBandUECells);
409 fPhiBandUETracks = new TH2D(Form("hPhiBandUE_TPC"),Form("UE Estimation with Phi Band TPC "),100,0.,100.,100,0.,100.);
410 fPhiBandUETracks->SetXTitle("E_{T}");
411 fPhiBandUETracks->SetYTitle("#Sigma P_{T}^{UE}");
412 fPhiBandUETracks->Sumw2();
413 fOutput->Add(fPhiBandUETracks);
415 fEtaBandUETracks = new TH2D(Form("hEtaBandUE_TPC"),Form("UE Estimation with Phi Band and TPC"),100,0.,100.,100,0.,100.);
416 fEtaBandUETracks->SetXTitle("E_{T}");
417 fEtaBandUETracks->SetYTitle("#Sigma P_{T}^{UE}");
418 fEtaBandUETracks->Sumw2();
419 fOutput->Add(fEtaBandUETracks);
421 fPerpConesUETracks = new TH2D("hConesUE","UE Estimation with Perpendicular Cones in TPC",100,0.,100.,100,0.,100.);
422 fPerpConesUETracks->SetXTitle("E_{T}");
423 fPerpConesUETracks->SetYTitle("#Sigma P_{T}^{UE}");
424 fPerpConesUETracks->Sumw2();
425 fOutput->Add(fPerpConesUETracks);
427 fTPCWithoutIsoConeB2BbandUE = new TH2D("hFullTPCUE","UE Estimation with almost Full TPC",100,0.,100.,100,0.,100.);
428 fPhiBandUEClust->SetXTitle("E_{T}");
429 fPhiBandUEClust->SetYTitle("#Sigma E_{T}^{UE}");
430 fTPCWithoutIsoConeB2BbandUE->Sumw2();
431 fOutput->Add(fTPCWithoutIsoConeB2BbandUE);
433 fEtIsolatedClust = new TH1D("hEtIsolatedClust","E_{T} distribution for Isolated Photons with clusters; #Sigma E_{T}^{iso cone}<Ethres",100,0.,100.);
434 fEtIsolatedClust->SetXTitle("E_{T}^{iso}");
435 fEtIsolatedClust->Sumw2();
436 fOutput->Add(fEtIsolatedClust);
438 fEtIsolatedCells = new TH1D("hEtIsolatedCells","E_{T} distribution for Isolated Photons with cells; #Sigma E_{T}^{iso cone}<Ethres",100,0.,100.);
439 fEtIsolatedCells->SetXTitle("E_{T}^{iso}");
440 fEtIsolatedCells->Sumw2();
441 fOutput->Add(fEtIsolatedCells);
443 fEtIsolatedTracks = new TH1D("hEtIsolatedTracks","E_{T} distribution for Isolated Photons with tracks; #Sigma P_{T}^{iso cone}<Pthres",100,0.,100.);
444 fEtIsolatedTracks->SetXTitle("E_{T}^{iso}");
445 fEtIsolatedTracks->Sumw2();
446 fOutput->Add(fEtIsolatedTracks);
448 fTest = new TH1D ("hTest","test cluster collection",100,-2.,6.);
453 PostData(1, fOutput);
457 //________________________________________________________________________
458 Float_t* AliAnalysisTaskEMCALPhotonIsolation::GenerateFixedBinArray(Int_t n, Float_t min, Float_t max) const
460 // Generate the bin array for the ThnSparse
462 Float_t *bins = new Float_t[n+1];
464 Float_t binWidth = (max-min)/n;
466 for (Int_t i = 1; i <= n; i++) {
467 bins[i] = bins[i-1]+binWidth;
473 //________________________________________________________________________
474 void AliAnalysisTaskEMCALPhotonIsolation::ExecOnce()
476 // Init the analysis.
480 if (fParticleCollArray.GetEntriesFast()<2) {
481 AliError(Form("Wrong number of particle collections (%d), required 2",fParticleCollArray.GetEntriesFast()));
486 // for (Int_t i = 0; i < 2; i++) {
487 // AliParticleContainer *contain = static_cast<AliParticleContainer*>(fParticleCollArray.At(i));
488 // // contain->GetClassName("AliEmcalParticle");
493 AliAnalysisTaskEmcal::ExecOnce();
496 AliError(Form("AliAnalysisTask not initialized"));
504 //______________________________________________________________________________________
505 Bool_t AliAnalysisTaskEMCALPhotonIsolation::Run()
510 AliParticleContainer *clusters = static_cast<AliParticleContainer*>(fParticleCollArray.At(1));
511 AliEmcalParticle *emccluster = 0;
513 // delete output USEFUL LATER FOR CONTAINER CREATION !!
514 //fOutClusters->Delete();
516 //Int_t clusCount = 0; AliError(Form("Should be here each time"));
517 // loop over all clusters
518 clusters->ResetCurrentID();
521 //Double_t ETleadingclust = 0., M02leadingcluster = 0., lambda0cluster = 0., phileadingclust = 0., etaleadingclust = 0., ptmc = 0.,mcptsum = 0.;
523 //Definition of the Array for Davide's Output
524 //const Int_t ndims = fNDimensions;
525 //Double_t outputValues[ndims];
529 // AliError(Form("Check the loop"));
530 // get the leading particle
533 emccluster = static_cast<AliEmcalParticle*>(clusters->GetLeadingParticle());
537 AliError(Form("no leading one"));
543 // emccluster = clusters->GetLeadingParticle();
544 index = emccluster->IdInCollection();
546 //add a command to get the index of the leading cluster!
547 if (!emccluster->IsEMCAL()) return kTRUE;
549 AliVCluster *coi = emccluster->GetCluster();
550 if (!coi) return kTRUE;
552 TLorentzVector vecCOI;
553 coi->GetMomentum(vecCOI,fVertex);
556 if(!CheckBoundaries(vecCOI))
559 if(ClustTrackMatching(coi))
563 FillGeneralHistograms(coi,vecCOI, index);
566 //get the entries of the Cluster Container
567 //whatever is a RETURN in LCAnalysis here is a CONTINUE,
568 //since there are more than 1 Cluster per Event
570 while((emccluster = static_cast<AliEmcalParticle*>(clusters->GetNextAcceptParticle()))){
572 if (!emccluster->IsEMCAL()) return kTRUE;
574 AliVCluster *coi = emccluster->GetCluster();
575 if(!coi) return kTRUE;
577 TLorentzVector vecCOI;
578 coi->GetMomentum(vecCOI,fVertex);
580 if(!CheckBoundaries(vecCOI))
583 if(ClustTrackMatching(coi))
586 FillGeneralHistograms(coi,vecCOI, index);
590 // PostData(1, fOutput);
595 //__________________________________________________________________________
596 Bool_t AliAnalysisTaskEMCALPhotonIsolation::ClustTrackMatching(AliVCluster *cluster) {
597 // Check if the cluster match to a track
602 AliParticleContainer *tracks = static_cast<AliParticleContainer*>(fParticleCollArray.At(0));
603 // for an incoming cluster reject it if there is a track corresponding with a deta and dphi lower than the cuts
604 TLorentzVector nPart;
605 cluster->GetMomentum(nPart, fVertex);
607 AliVTrack *mt = NULL;
608 AliAODCaloCluster *acl = dynamic_cast<AliAODCaloCluster*>(cluster);
610 if(acl->GetNTracksMatched()>1)
611 mt = static_cast<AliVTrack*>(acl->GetTrackMatched(0));
614 AliESDCaloCluster *ecl = dynamic_cast<AliESDCaloCluster*>(cluster);
616 AliError("ClusTrack matching did not work");
619 Int_t im = ecl->GetTrackMatchedIndex();
620 if(tracks && im>=0) {
621 mt = static_cast<AliVTrack*>(tracks->GetParticle(im));
624 // if(mt && mt->TestFilterBit(768)) { //Hybrid tracks with AOD
625 AliPicoTrack::GetEtaPhiDiff(mt, cluster, dphi, deta);
626 fDeltaETAClusTrackVSpT->Fill(nPart.Pt(), deta);
627 fDeltaPHIClusTrackVSpT->Fill(nPart.Pt(), dphi);
638 //__________________________________________________________________________
639 void AliAnalysisTaskEMCALPhotonIsolation::EtIsoCellPhiBand(TLorentzVector c, Float_t &etIso, Float_t &phiBandcells){
640 // Underlying events study with EMCAL cells in phi band
642 AliEMCALGeometry* emcalGeom = AliEMCALGeometry::GetInstance();
644 Float_t sumEnergyPhiBandCells=0., sumEnergyConeCells=0.;
647 // check the cell corresponding to the leading cluster
649 //maybe best to call it LeadingCellIdinClus or better maxId since it won't be used anywhere else ???
650 Bool_t cellLeadingClustID = emcalGeom->GetAbsCellIdFromEtaPhi(c.Eta(),c.Phi(),absId);
651 if(!cellLeadingClustID) return;
656 Int_t imEta=-1, imPhi=-1;
657 Int_t iEta =-1, iPhi =-1;
659 emcalGeom->GetCellIndex(absId,iModule,iTower,imPhi,imEta); // to get the module, the tower, eta and phi for the cell corresponding to the leading cluster
660 emcalGeom->GetCellPhiEtaIndexInSModule(iModule,iTower,imPhi,imEta,iPhi,iEta); // to get the cell eta and phi in the super module for the cell coming from the leading cluster
662 // Get the row and the column of the cell corresponding to the leading cluster in EMCAL
663 Int_t colCellLeadingClust = iEta;
664 if(iModule % 2) colCellLeadingClust = AliEMCALGeoParams::fgkEMCALCols + iEta ; // if the SM number is even you need to translate to have the one corresponding in EMCAL
665 Int_t rowCellLeadingClust = iPhi + AliEMCALGeoParams::fgkEMCALRows*int(iModule/2); // to have the corresponding row in EMCAL
667 // total number or rows and columns in EMCAL
668 Int_t nTotalRows = AliEMCALGeoParams::fgkEMCALRows*16/3 ; // 5 + 2/3 supermodules in a row
669 Int_t nTotalCols = 2*AliEMCALGeoParams::fgkEMCALCols; // 2 supermodules in a column
671 Int_t nbConeSize = int(fIsoConeRadius/0.0143); //0.0143 tower acceptance
674 AliVCaloCells * cells =InputEvent()->GetEMCALCells();
676 // define the max and min row and column corresponding to the isolation cone around the seed cell from the leading cluster
677 Int_t iRowMinCone = rowCellLeadingClust-nbConeSize;
678 if(iRowMinCone<0) iRowMinCone=0;
680 Int_t iRowMaxCone = rowCellLeadingClust+nbConeSize;
681 if(iRowMaxCone>AliEMCALGeoParams::fgkEMCALRows) iRowMaxCone=AliEMCALGeoParams::fgkEMCALRows; // AliEMCALGeoParams::fgkEMCALRows = 24 in a supermodule
683 Int_t iColMinCone = colCellLeadingClust - nbConeSize;
684 if(iColMinCone<0) iColMinCone = 0;
686 Int_t iColMaxCone = colCellLeadingClust+nbConeSize;
687 if(iColMaxCone>AliEMCALGeoParams::fgkEMCALCols) iColMaxCone=AliEMCALGeoParams::fgkEMCALCols; // AliEMCALGeoParams::fgkEMCALCols = 48 in a supermodule
690 for(Int_t iCol=0; iCol<nTotalCols; iCol++){
691 for(Int_t iRow=0; iRow<nTotalRows; iRow++){
692 // now recover the cell indexes in a supermodule
693 Int_t iSector = int(iRow/AliEMCALGeoParams::fgkEMCALRows); // check in which SM is the cell
694 if(iSector==5) continue; //
697 if(iCol < AliEMCALGeoParams::fgkEMCALCols){ // if the SM number is odd the column is the one corresponding in the supermodule
698 inModule = 2*iSector + 1;
701 else if(iCol > AliEMCALGeoParams::fgkEMCALCols - 1){ // if the SM number is even the column isn't the one corresponding in the supermodule
702 inModule = 2*iSector;
703 iColLoc = iCol-AliEMCALGeoParams::fgkEMCALCols;
706 Int_t iRowLoc = iRow - AliEMCALGeoParams::fgkEMCALRows*iSector ;
708 if(TMath::Abs(iCol-colCellLeadingClust)<nbConeSize && TMath::Abs(iCol+colCellLeadingClust)>nbConeSize){
709 if(iRow<iRowMaxCone && iRow>iRowMinCone){
710 Int_t iabsId = emcalGeom->GetAbsCellIdFromCellIndexes(inModule,iRowLoc,iColLoc); // verifier les iRow et iCol
711 sumEnergyPhiBandCells+=cells->GetAmplitude(iabsId); //should be Et
714 else if (TMath::Abs(iCol-colCellLeadingClust)>nbConeSize && TMath::Abs(iCol+colCellLeadingClust)<nbConeSize){
715 Int_t iabsId = emcalGeom->GetAbsCellIdFromCellIndexes(inModule,iRowLoc,iColLoc); // verifier les iRow et iCol
716 sumEnergyConeCells+=cells->GetAmplitude(iabsId); //should be Et
721 etIso = sumEnergyConeCells;
722 phiBandcells = sumEnergyPhiBandCells;
726 //__________________________________________________________________________
727 void AliAnalysisTaskEMCALPhotonIsolation::EtIsoCellEtaBand(TLorentzVector c, Float_t &etIso, Float_t &etaBandcells){
728 // Underlying events study with EMCAL cell in eta band
731 AliEMCALGeometry* emcalGeom = AliEMCALGeometry::GetInstance();
733 Float_t sumEnergyEtaBandCells=0., sumEnergyConeCells=0.;
737 // check the cell corresponding to the leading cluster
739 //maybe best to call it LeadingCellIdinClus or better maxId since it won't be used anywhere else ???
740 Bool_t cellLeadingClustID = emcalGeom->GetAbsCellIdFromEtaPhi(c.Eta(),c.Phi(),absId);
741 if(!cellLeadingClustID) return;
747 Int_t imEta=-1, imPhi=-1;
748 Int_t iEta =-1, iPhi =-1;
750 emcalGeom->GetCellIndex(absId,iModule,iTower,imPhi,imEta); // to get the module, the tower, eta and phi for the cell corresponding to the leading cluster
751 emcalGeom->GetCellPhiEtaIndexInSModule(iModule,iTower,imPhi,imEta,iPhi,iEta); // to get the cell eta and phi in the super module for the cell coming from the leading cluster
753 // Get the row and the column of the cell corresponding to the leading cluster in EMCAL
754 Int_t colCellLeadingClust = iEta;
755 if(iModule % 2) colCellLeadingClust = AliEMCALGeoParams::fgkEMCALCols + iEta ; // if the SM number is even you need to translate to have the one corresponding in EMCAL
756 Int_t rowCellLeadingClust = iPhi + AliEMCALGeoParams::fgkEMCALRows*int(iModule/2); // to have the corresponding row in EMCAL
758 // total number or rows and columns in EMCAL
759 Int_t nTotalRows = AliEMCALGeoParams::fgkEMCALRows*16/3 ; // 5 + 2/3 supermodules in a row
760 Int_t nTotalCols = 2*AliEMCALGeoParams::fgkEMCALCols; // 2 supermodules in a column
762 Int_t nbConeSize = int(fIsoConeRadius/0.0143); //0.0143 tower acceptance
765 AliVCaloCells * cells =InputEvent()->GetEMCALCells();
767 // define the max and min row and column corresponding to the isolation cone around the seed cell from the leading cluster
768 Int_t iRowMinCone = rowCellLeadingClust-nbConeSize;
769 if(iRowMinCone<0) iRowMinCone=0;
771 Int_t iRowMaxCone = rowCellLeadingClust+nbConeSize;
772 if(iRowMaxCone>AliEMCALGeoParams::fgkEMCALRows) iRowMaxCone=AliEMCALGeoParams::fgkEMCALRows; // AliEMCALGeoParams::fgkEMCALRows = 24 in a supermodule
774 Int_t iColMinCone = colCellLeadingClust-nbConeSize;
775 if(iColMinCone<0) iColMinCone = 0;
777 Int_t iColMaxCone = colCellLeadingClust+nbConeSize;
778 if(iColMaxCone>AliEMCALGeoParams::fgkEMCALCols) iColMaxCone=AliEMCALGeoParams::fgkEMCALCols; // AliEMCALGeoParams::fgkEMCALCols = 48 in a supermodule
781 for(Int_t iCol=0; iCol<nTotalCols; iCol++)
783 for(Int_t iRow=0; iRow<nTotalRows; iRow++)
785 // now recover the cell indexes in a supermodule
786 Int_t iSector = int(iRow/AliEMCALGeoParams::fgkEMCALRows); // check in which SM is the cell
787 if(iSector==5) continue; //
790 if(iCol < AliEMCALGeoParams::fgkEMCALCols){ // if the SM number is odd the column is the one corresponding in the supermodule
791 inModule = 2*iSector + 1;
794 else if(iCol > AliEMCALGeoParams::fgkEMCALCols - 1){ // if the SM number is even the column isn't the one corresponding in the supermodule
795 inModule = 2*iSector;
796 iColLoc = iCol-AliEMCALGeoParams::fgkEMCALCols;
799 Int_t iRowLoc = iRow - AliEMCALGeoParams::fgkEMCALRows*iSector ;
801 if(TMath::Abs(iCol-colCellLeadingClust)<nbConeSize && TMath::Abs(iCol+colCellLeadingClust)>nbConeSize){
802 if(iCol<iColMaxCone && iCol>iColMinCone){
803 Int_t iabsId = emcalGeom->GetAbsCellIdFromCellIndexes(inModule,iRowLoc,iColLoc); // verifier les iRow et iCol
804 sumEnergyEtaBandCells+=cells->GetAmplitude(iabsId); //should be Et
807 else if (TMath::Abs(iCol-colCellLeadingClust)>nbConeSize && TMath::Abs(iCol+colCellLeadingClust)<nbConeSize){
808 Int_t iabsId = emcalGeom->GetAbsCellIdFromCellIndexes(inModule,iRowLoc,iColLoc); // verifier les iRow et iCol
809 sumEnergyConeCells+=cells->GetAmplitude(iabsId); //should be Et
814 etIso = sumEnergyConeCells;
815 etaBandcells = sumEnergyEtaBandCells;
819 //__________________________________________________________________________
820 void AliAnalysisTaskEMCALPhotonIsolation::EtIsoClusPhiBand(TLorentzVector c, Float_t &etIso, Float_t &phiBandclus, Int_t index){
821 // Underlying events study with clusters in phi band
823 Float_t sumEnergyPhiBandClus=0., sumEnergyConeClus=0.;
825 //needs a check on the same cluster
826 AliParticleContainer *clusters = static_cast<AliParticleContainer*>(fParticleCollArray.At(1));
827 AliEmcalParticle *clust;
830 while((clust = static_cast<AliEmcalParticle*>(clusters->GetNextAcceptParticle()))){ //check the position of other clusters in respect to the leading cluster
832 if(localIndex==index) continue;
834 AliVCluster *cluster= clust->GetCluster();
836 TLorentzVector nClust; //STILL NOT INITIALIZED
837 cluster->GetMomentum(nClust,fVertex);
838 Float_t phiClust =nClust.Phi();
839 Float_t etaClust= nClust.Eta();
840 //redefine phi/c.Eta() from the cluster we passed to the function
842 Float_t radius = TMath::Sqrt(TMath::Power(phiClust- c.Phi(),2)+TMath::Power(etaClust-c.Eta(),2)); // define the radius between the leading cluster and the considered cluster
844 if(radius>fIsoConeRadius){ // the cluster is outside the isolation cone in this case study UE
846 // actually phi band here
847 if(TMath::Abs(etaClust - c.Eta()) < fIsoConeRadius){
848 sumEnergyPhiBandClus += nClust.Pt();
851 else // if the cluster is in the isolation cone, add the cluster pT
852 sumEnergyConeClus += nClust.Pt();
855 etIso = sumEnergyConeClus;
856 phiBandclus = sumEnergyPhiBandClus;
860 //__________________________________________________________________________
861 void AliAnalysisTaskEMCALPhotonIsolation::EtIsoClusEtaBand(TLorentzVector c, Float_t &etIso, Float_t &etaBandclus, Int_t index){
862 // Underlying events study with clusters in eta band
864 Float_t sumEnergyEtaBandClus =0., sumEnergyConeClus=0.;
865 AliParticleContainer *clusters = static_cast<AliParticleContainer*>(fParticleCollArray.At(1));
867 AliEmcalParticle *clust;
870 while((clust = static_cast<AliEmcalParticle*>(clusters->GetNextAcceptParticle()))){ //check the position of other clusters in respect to the leading cluster
872 if(localIndex==index) continue;
874 AliVCluster *cluster= clust->GetCluster();
876 TLorentzVector nClust; //STILL NOT INITIALIZED
877 cluster->GetMomentum(nClust,fVertex);
879 Float_t phiClust =nClust.Phi();
880 Float_t etaClust= nClust.Eta();
881 //redefine phi/c.Eta() from the cluster we passed to the function
883 // define the radius between the leading cluster and the considered cluster
884 Float_t radius = TMath::Sqrt(TMath::Power(phiClust-c.Phi(),2)+TMath::Power(etaClust-c.Eta(),2));
886 if(radius>fIsoConeRadius){ // the cluster is outside the isolation cone in this case study UE
888 // actually eta band here
889 if(TMath::Abs(etaClust - c.Eta()) < fIsoConeRadius){
890 sumEnergyEtaBandClus += nClust.Pt();
893 else // if the cluster is in the isolation cone, add the cluster pT
894 sumEnergyConeClus += nClust.Pt();
897 etIso = sumEnergyConeClus;
898 etaBandclus = sumEnergyEtaBandClus;
902 //__________________________________________________________________________
903 void AliAnalysisTaskEMCALPhotonIsolation::PtIsoTrackPhiBand(TLorentzVector c, Float_t &ptIso, Float_t &phiBandtrack){
904 // Underlying events study with tracks in phi band in EMCAL acceptance
906 //INSERT BOUNDARIES ACCORDING TO THE FLAG WE WANT TO USE
907 Float_t sumpTConeCharged=0., sumpTPhiBandTrack=0.;
908 Float_t minPhi= 0., maxPhi= 2*TMath::Pi(), minEta = -0.9, maxEta= 0.9;
910 AliParticleContainer *tracks = static_cast<AliParticleContainer*>(fParticleCollArray.At(0));
916 maxPhi = TMath::Pi();
919 AliVParticle *track = tracks->GetNextAcceptParticle(0);
923 //CHECK IF TRACK IS IN BOUNDARIES
924 Float_t phiTrack = track->Phi();
925 Float_t etaTrack = track->Eta();
926 // define the radius between the leading cluster and the considered cluster
927 //redefine phi/c.Eta() from the cluster we passed to the function
928 if(phiTrack < maxPhi && phiTrack > minPhi && etaTrack < maxEta && etaTrack > minEta){
929 Float_t radius = TMath::Sqrt(TMath::Power(phiTrack - c.Phi(),2)+TMath::Power(etaTrack - c.Eta(),2));
931 if(radius>fIsoConeRadius){ // if tracks are outside the isolation cone study
933 // actually phi band here --- ADD Boundaries conditions
934 if(TMath::Abs(etaTrack - c.Eta()) < fIsoConeRadius){
935 sumpTPhiBandTrack += track->Pt();
939 sumpTConeCharged+=track->Pt(); // should not double count if the track matching is already done
941 track=tracks->GetNextAcceptParticle();
943 ptIso = sumpTConeCharged;
944 phiBandtrack = sumpTPhiBandTrack;
948 //__________________________________________________________________________
949 void AliAnalysisTaskEMCALPhotonIsolation::PtIsoTrackEtaBand(TLorentzVector c, Float_t &ptIso, Float_t &etaBandtrack){
950 // Underlying events study with tracks in eta band in EMCAL acceptance
952 //INSERT BOUNDARIES ACCORDING TO THE FLAG WE WANT TO USE
953 Float_t sumpTConeCharged=0., sumpTEtaBandTrack=0.;
954 Float_t minPhi= 0., maxPhi= 2*TMath::Pi(), minEta = -0.9, maxEta= 0.9;
956 AliParticleContainer *tracks = static_cast<AliParticleContainer*>(fParticleCollArray.At(0));
963 maxPhi = TMath::Pi();
967 AliVParticle *track = tracks->GetNextAcceptParticle(0);
971 Float_t phiTrack = track->Phi();
972 Float_t etaTrack = track->Eta();
973 //redefine phi/c.Eta() from the cluster we passed to the function
974 if(phiTrack < maxPhi && phiTrack > minPhi && etaTrack < maxEta && etaTrack > minEta){
975 Float_t radius = TMath::Sqrt(TMath::Power(phiTrack-c.Phi(),2)+TMath::Power(etaTrack-c.Eta(),2)); // define the radius between the leading cluster and the considered cluster
976 if(radius>fIsoConeRadius){ // if tracks are outside the isolation cone study UE
978 // actually eta band here --- ADD Boundaries conditions
979 if(TMath::Abs(phiTrack - c.Phi()) < fIsoConeRadius){
980 sumpTEtaBandTrack += track->Pt();
984 sumpTConeCharged += track->Pt(); // should not double count if the track matching is already done
986 track=tracks->GetNextAcceptParticle();
988 ptIso = sumpTConeCharged;
989 etaBandtrack = sumpTEtaBandTrack;
993 //__________________________________________________________________________
994 void AliAnalysisTaskEMCALPhotonIsolation::PtIsoTrackOrthCones(TLorentzVector c, Float_t &ptIso, Float_t &cones){
995 // Underlying events study with tracks in orthogonal cones in TPC
997 Float_t sumpTConeCharged=0., sumpTPerpConeTrack=0.;
999 AliParticleContainer *tracks = static_cast<AliParticleContainer*>(fParticleCollArray.At(0));
1001 Float_t etaClus = c.Eta();
1002 Float_t phiClus = c.Phi();
1003 Float_t phiCone1 = phiClus - TMath::PiOver2();
1004 Float_t phiCone2 = phiClus + TMath::PiOver2();
1006 if (phiCone1 < 0.) phiCone1 += 2*TMath::Pi();
1008 AliVParticle *track = tracks->GetNextAcceptParticle(0);
1012 Float_t phiTrack = track->Phi();
1013 Float_t etaTrack = track->Eta();
1015 Float_t dist2Clust = TMath::Sqrt(TMath::Power(etaTrack-etaClus, 2)+TMath::Power(phiTrack-phiClus, 2));
1016 if (dist2Clust<fIsoConeRadius)// if tracks are inside the IsoCone
1017 sumpTConeCharged += track->Pt();
1019 else{//tracks outside the IsoCone
1020 //Distances from the centres of the two Orthogonal Cones
1021 Float_t dist2Cone1 = TMath::Sqrt(TMath::Power(etaTrack-etaClus, 2)+TMath::Power(phiTrack-phiCone1, 2));
1022 Float_t dist2Cone2 = TMath::Sqrt(TMath::Power(etaTrack-etaClus, 2)+TMath::Power(phiTrack-phiCone2, 2));
1024 //Is the Track Inside one of the two Cones ->Add to UE
1025 if((dist2Cone1 < fIsoConeRadius) || (dist2Cone2 < fIsoConeRadius))
1026 sumpTPerpConeTrack += track->Pt();
1028 track=tracks->GetNextAcceptParticle();
1030 ptIso = sumpTConeCharged;
1031 cones = sumpTPerpConeTrack;
1034 //__________________________________________________________________________
1035 void AliAnalysisTaskEMCALPhotonIsolation::PtIsoTrackFullTPC(TLorentzVector c, Float_t &ptIso, Float_t &full){
1036 // Underlying events study with tracks in full TPC except back to back bands
1038 Float_t sumpTConeCharged=0., sumpTTPCexceptB2B=0.;
1040 AliParticleContainer *tracks = static_cast<AliParticleContainer*>(fParticleCollArray.At(0));
1041 AliVParticle *track = tracks->GetNextAcceptParticle(0);
1045 Float_t phiTrack = track->Phi();
1046 Float_t etaTrack = track->Eta();
1047 //redefine phi/c.Eta() from the cluster we passed to the function
1049 Float_t radius = TMath::Sqrt(TMath::Power(phiTrack-c.Phi(),2)+TMath::Power(etaTrack-c.Eta(),2)); // define the radius between the leading cluster and the considered cluster
1050 if(radius>fIsoConeRadius){ // if tracks are outside the isolation cone study UE
1051 Double_t dphiUp = c.Phi() + TMath::Pi() - fIsoConeRadius;
1052 Double_t dphiDown = c.Phi() + TMath::Pi() + fIsoConeRadius;
1054 if(TMath::Power(phiTrack-c.Phi(),2) +TMath::Power(etaTrack-c.Eta(),2) > TMath::Power((fIsoConeRadius+0.1),2) && phiTrack < dphiDown && phiTrack> dphiUp)
1055 sumpTTPCexceptB2B += track->Pt();
1058 sumpTConeCharged += track->Pt(); // should not double count if the track matching is already done
1060 track=tracks->GetNextAcceptParticle();
1062 ptIso = sumpTConeCharged;
1063 full = sumpTTPCexceptB2B;
1066 //__________________________________________________________________________
1067 Bool_t AliAnalysisTaskEMCALPhotonIsolation::CheckBoundaries(TLorentzVector vecCOI){
1068 // Check if the cone around the considered cluster is in EMCAL acceptance
1070 Float_t minPhiBound= 1.5 , minEtaBound= -0.5, maxPhiBound= TMath::Pi()-0.1, maxEtaBound= 0.5;
1071 Bool_t isINBoundaries;
1074 minPhiBound = 1.4+0.4; //to be changed with fIsoConeR
1075 maxPhiBound = TMath::Pi()-0.4;
1076 minEtaBound = -0.7+0.4;
1077 maxEtaBound = 0.7-0.4;
1080 if(vecCOI.Eta() > maxEtaBound || vecCOI.Eta() < minEtaBound || vecCOI.Phi() > maxPhiBound || vecCOI.Phi() >minPhiBound)
1081 isINBoundaries=kFALSE;
1083 isINBoundaries=kTRUE;
1085 return isINBoundaries;
1088 //__________________________________________________________________________
1089 Bool_t AliAnalysisTaskEMCALPhotonIsolation::FillGeneralHistograms(AliVCluster *coi, TLorentzVector vecCOI, Int_t index){
1090 // Fill the histograms for underlying events and isolation studies
1092 AliParticleContainer *tracks = static_cast<AliParticleContainer*>(fParticleCollArray.At(0));
1094 AliEmcalParticle *emcTrack = 0;
1097 tracks->ResetCurrentID();
1098 while ((emcTrack = static_cast<AliEmcalParticle*>(tracks->GetNextAcceptParticle()))) {
1099 AliVTrack *track = emcTrack->GetTrack();
1100 if(!track) continue;
1101 // if(!(track->TestFilterBit("kHybrid"))) continue;
1106 Double_t eTCOI = 0., m02COI = 0., lambda0cluster = 0., ptmc = 0., mcptsum = 0.;
1108 //Definition of the Array for Davide's Output
1109 const Int_t ndims = fNDimensions;
1110 Double_t outputValues[ndims];
1112 eTCOI = vecCOI.Et();
1113 m02COI = coi->GetM02();
1116 // ******** Isolation and UE calculation with different methods *********
1118 Double_t eTThreshold = 5;
1120 switch(fEtIsoMethod)
1122 case 0: // SumEt<EtThr
1123 if(fM02mincut < m02COI && m02COI < fM02maxcut) // photon candidate, cuts have to be decided after studies
1125 eTThreshold = fEtIsoThreshold;
1129 case 1: // SumEt<%Ephoton
1130 if(fM02mincut < m02COI && m02COI < fM02maxcut) // photon candidate, cuts have to be decided after studies
1132 eTThreshold = fEtIsoThreshold * eTCOI;
1136 case 2: // Etmax<eTThreshold
1137 eTThreshold = fEtIsoThreshold;
1138 if(fM02mincut < m02COI && m02COI < fM02maxcut && eTCOI<eTThreshold) // photon candidate, cuts have to be decided after studies
1140 fEtIsolatedClust->Fill(eTCOI);
1145 //DO NOT CHANGE EVER AGAIN THE FOLLOWING DEFINITIONS
1146 Float_t isoConeArea = TMath::Pi()*fIsoConeRadius*fIsoConeRadius;
1147 Float_t etaBandArea = (1.4 - 2.*fIsoConeRadius)*2.*fIsoConeRadius;
1148 Float_t phiBandArea = ((5./9.)*TMath::Pi()- 2.*fIsoConeRadius)*2.*fIsoConeRadius;
1149 Float_t etaBandAreaTr = (1.8 - 2.*fIsoConeRadius)*2.*fIsoConeRadius;
1150 Float_t phiBandAreaTr = (2.*TMath::Pi() - 4.*fIsoConeRadius)*2.*fIsoConeRadius;//there is a 2 more because of the JET CONE B2B
1151 Float_t perpConesArea = 2.*isoConeArea;
1152 Float_t fullTPCArea = 1.8*2.*TMath::Pi()-fIsoConeRadius*(TMath::Pi()*fIsoConeRadius + 3.6);
1154 Float_t isolation, ue;
1156 if(!fTPC4Iso){ //EMCAL Only for Acceptance of Clusters
1159 case 0: //EMCAL CELLS
1164 EtIsoCellPhiBand(vecCOI, isolation, ue);
1165 //Normalisation ue wrt Area - TO DO-
1166 ue = ue * (isoConeArea / phiBandArea);
1167 fPhiBandUECells->Fill(vecCOI.Pt() , ue);
1168 fEtIsoCells->Fill(isolation);
1169 if(isolation<eTThreshold)
1171 fEtIsolatedCells->Fill(eTCOI);
1173 fPtisoT=vecCOI.Pt();
1177 EtIsoCellEtaBand(vecCOI, isolation, ue);
1178 //Normalisation ue wrt Area - TO DO-
1179 ue = ue * (isoConeArea / etaBandArea);
1180 fEtaBandUECells->Fill(vecCOI.Pt() , ue);
1181 fEtIsoCells->Fill(isolation);
1182 if(isolation<eTThreshold)
1184 fEtIsolatedCells->Fill(eTCOI);
1186 fPtisoT=vecCOI.Pt();
1192 case 1: //EMCAL CLUSTERS
1197 EtIsoClusPhiBand(vecCOI, isolation, ue,index);
1198 //Normalisation ue wrt Area - TO DO-
1199 ue = ue * (isoConeArea / phiBandArea);
1200 fPhiBandUEClust->Fill(vecCOI.Pt() , ue);
1201 fEtIsoClust->Fill(isolation);
1204 EtIsoClusEtaBand(vecCOI, isolation, ue,index);
1205 //Normalisation ue wrt Area - TO DO-
1206 ue = ue * (isoConeArea / etaBandArea);
1207 fEtaBandUEClust->Fill(vecCOI.Pt() , ue);
1208 fEtIsoClust->Fill(isolation);
1209 if(isolation<eTThreshold)
1211 fEtIsolatedClust->Fill(eTCOI);
1213 fPtisoT=vecCOI.Pt();
1217 case 2: //TRACKS (TBD which tracks) //EMCAL tracks
1221 PtIsoTrackPhiBand(vecCOI, isolation, ue);
1222 //Normalisation ue wrt Area - TO DO-
1223 ue = ue * (isoConeArea / phiBandAreaTr);
1224 fPhiBandUETracks->Fill(vecCOI.Pt() , ue);
1225 fPtIsoTrack->Fill(isolation);
1226 if(isolation<eTThreshold)
1228 fEtIsolatedTracks->Fill(eTCOI);
1230 fPtisoT=vecCOI.Pt();
1234 PtIsoTrackEtaBand(vecCOI, isolation, ue);
1235 //Normalisation ue wrt Area - TO DO-
1236 ue = ue * (isoConeArea / etaBandAreaTr);
1237 fEtaBandUETracks->Fill(vecCOI.Pt() , ue);
1238 fPtIsoTrack->Fill(isolation);
1239 if(isolation<eTThreshold)
1241 fEtIsolatedTracks->Fill(eTCOI);
1243 fPtisoT=vecCOI.Pt();
1247 // PtIsoTrackOrthCones(vecCOI, absId, isolation, ue);
1249 // case 3: //Full TPC
1250 // PtIsoTrackFullTPC(vecCOI, absId, isolation, ue);
1255 else{ //EMCAL + TPC (Only tracks for the Isolation since IsoCone Goes Out of EMCAL)
1259 PtIsoTrackPhiBand(vecCOI, isolation, ue);
1260 //Normalisation ue wrt Area - TO DO-
1261 ue = ue * (isoConeArea / phiBandAreaTr);
1262 fPhiBandUETracks->Fill(vecCOI.Pt() , ue);
1263 fPtIsoTrack->Fill(isolation);
1264 if(isolation<eTThreshold)
1266 fEtIsolatedTracks->Fill(eTCOI);
1268 fPtisoT=vecCOI.Pt();
1272 PtIsoTrackEtaBand(vecCOI, isolation, ue);
1273 //Normalisation ue wrt Area - TO DO-
1274 ue = ue * (isoConeArea / etaBandAreaTr);
1275 fEtaBandUETracks->Fill(vecCOI.Pt() , ue);
1276 fPtIsoTrack->Fill(isolation);
1277 if(isolation<eTThreshold)
1279 fEtIsolatedTracks->Fill(eTCOI);
1281 fPtisoT=vecCOI.Pt();
1285 PtIsoTrackOrthCones(vecCOI, isolation, ue);
1286 //Normalisation ue wrt Area - TO DO-
1287 ue = ue * (isoConeArea / perpConesArea);
1288 fPerpConesUETracks ->Fill(vecCOI.Pt() , ue);
1289 fPtIsoTrack->Fill(isolation);
1290 if(isolation<eTThreshold)
1292 fEtIsolatedTracks->Fill(eTCOI);
1294 fPtisoT=vecCOI.Pt();
1298 PtIsoTrackFullTPC(vecCOI, isolation, ue);
1299 //Normalisation ue wrt Area - TO DO-
1300 ue = ue * (isoConeArea / fullTPCArea);
1301 fTPCWithoutIsoConeB2BbandUE->Fill(vecCOI.Pt() , ue);
1302 fPtIsoTrack->Fill(isolation);
1303 if(isolation<eTThreshold)
1305 fEtIsolatedTracks->Fill(eTCOI);
1307 fPtisoT=vecCOI.Pt();
1314 //Here we should call something to know the number of tracks...
1315 //Soon I'll put in this version the "old way"; please let me know if
1316 //any of you could do the same with the JET framework
1325 fsumEtisoconeT=isolation;
1326 // AliError(Form("lambda 0 %f",flambda0T));
1329 fOutputTree->Fill();
1333 outputValues[0] = nTracks;
1334 outputValues[1] = eTCOI;
1335 outputValues[2] = lambda0cluster;
1336 outputValues[3] = isolation;
1337 outputValues[4] = ue;
1338 outputValues[5] = isolation-ue;
1339 outputValues[6] = vecCOI.Eta();
1340 outputValues[7] = vecCOI.Phi();
1342 outputValues[8] = ptmc;
1343 outputValues[9] = mcptsum;
1345 fOutputTHnS -> Fill(outputValues);
1347 // // fOutPTMAX -> Fill(outputValues[1],outputValues[2],);