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"
38 ClassImp(AliAnalysisTaskEMCALPhotonIsolation)
40 //________________________________________________________________________
41 AliAnalysisTaskEMCALPhotonIsolation::AliAnalysisTaskEMCALPhotonIsolation() :
42 AliAnalysisTaskEmcal("AliAnalysisTaskEMCALPhotonIsolation",kTRUE),
43 //fParticleCollArray(),
58 fDeltaETAClusTrackVSpT(0),
59 fDeltaPHIClusTrackVSpT(0),
70 fPerpConesUETracks(0),
71 fTPCWithoutIsoConeB2BbandUE(0),
110 // Default constructor.
112 //fParticleCollArray.SetOwner(kTRUE);
113 // for(Int_t i = 0; i < 12; i++) fGeomMatrix[i] = 0;
115 SetMakeGeneralHistograms(kTRUE);
118 //________________________________________________________________________
119 AliAnalysisTaskEMCALPhotonIsolation::AliAnalysisTaskEMCALPhotonIsolation(const char *name, Bool_t histo) :
120 AliAnalysisTaskEmcal(name, histo),
121 //fParticleCollArray(),
136 fDeltaETAClusTrackVSpT(0),
137 fDeltaPHIClusTrackVSpT(0),
148 fPerpConesUETracks(0),
149 fTPCWithoutIsoConeB2BbandUE(0),
154 fEtIsolatedTracks(0),
188 // Standard constructor.
190 //fParticleCollArray.SetOwner(kTRUE);
191 // for(Int_t i = 0; i < 12; i++) fGeomMatrix[i] = 0;
193 SetMakeGeneralHistograms(kTRUE);
196 //________________________________________________________________________
197 AliAnalysisTaskEMCALPhotonIsolation::~AliAnalysisTaskEMCALPhotonIsolation(){
202 //________________________________________________________________________
203 void AliAnalysisTaskEMCALPhotonIsolation::UserCreateOutputObjects(){
204 // Create ouput histograms and THnSparse and TTree
206 AliAnalysisTaskEmcal::UserCreateOutputObjects();
209 if ((fIsoMethod == 0 || fIsoMethod == 1) && fTPC4Iso){
210 cout<<"Error: Iso_Methods with CELLS and CLUSTERS work only within EMCAL "<<endl;
211 cout<<"Please Set Iso_Method and TPC4Iso Accordingly!!"<<endl;
214 if ((fIsoMethod == 0 || fIsoMethod == 1) && fUEMethod> 1) {
215 cout<<"Error: UE_Methods with CELLS and CLUSTERS work only within EMCAL"<<endl;
216 cout<<"Please Set Iso_Method and UE_Method Accordingly!!"<<endl;
221 TString sIsoMethod="\0",sUEMethod="\0",sBoundaries="\0";
224 sIsoMethod = "Cells";
225 else if(fIsoMethod==1)
226 sIsoMethod = "Clust";
227 else if(fIsoMethod==2)
228 sIsoMethod = "Tracks";
231 sUEMethod = "PhiBand";
232 else if(fUEMethod==1)
233 sUEMethod = "EtaBand";
234 else if(fUEMethod==2)
235 sUEMethod = "PerpCones";
236 else if(fUEMethod==3)
237 sUEMethod = "FullTPC";
240 sBoundaries = "TPC Acceptance";
242 sBoundaries = "EMCAL Acceptance";
244 if(fWho>1 || fWho==-1){
245 cout<<"Error!!! OutputMode Can Only Be 0: TTree; 1: THnSparse"<<endl;
249 fOutput = new TList();
251 //Initialize the common Output histograms
255 //Initialization by Lucile and Marco
256 fOutputTree = new TTree("OutTree","OutTree");
257 fOutputTree->Branch("fevents",&fevents);
258 fOutputTree->Branch("flambda0T",&flambda0T);
259 fOutputTree->Branch("fEtT",&fEtT);
260 fOutputTree->Branch("fPtT",&fPtT);
261 fOutputTree->Branch("fEtisoT",&fEtisoT);
262 fOutputTree->Branch("fPtTiso",&fPtisoT);
263 fOutputTree->Branch("fetaT",&fetaT);
264 fOutputTree->Branch("fphiT",&fphiT);
265 fOutputTree->Branch("fsumEtisoconeT",&fsumEtisoconeT);
266 fOutputTree->Branch("fsumEtUE",&fsumEtUE);
268 fOutput->Add(fOutputTree);
272 //Initialization by Davide;
275 Int_t binTrackMult=100, binPT=70, binM02=100, binETiso=100, binETUE=110, binETisoUE=110, binetacl=140,binphicl=100, binPTMC=70;
276 Int_t bins[] = {binTrackMult, binPT, binM02, binETiso, binETUE, binETisoUE, binetacl, binphicl, binPTMC, binPTMC};
278 fNDimensions = sizeof(bins)/sizeof(Int_t);
279 const Int_t ndims = fNDimensions;
281 Double_t xmin[]= { 0., 0., 0., -10., -10., -10.,-1.0, 1. ,-10.,-10.};
283 Double_t xmax[]= {1000., 70., 2., 100., 100., 100., 1.0, 3.5, 60., 60.};
285 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());
287 fOutputTHnS = new THnSparseF("fHnOutput",sTitle.Data(), ndims, bins, xmin, xmax);
289 fOutput->Add(fOutputTHnS);
291 Int_t binsbis[] = {binPT, binM02, binETisoUE};
292 Double_t xminbis[] = { 0., 0., -10.};
293 Double_t xmaxbis[] = {100., 2., 100.};
295 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);
297 fOutput->Add(fOutPTMAX);
303 //Include QA plots to the OutputList //DEFINE BETTER THE BINNING AND THE AXES LIMITS
304 fTrackMult = new TH1D ("hTrackMult","Tracks multiplicity Distribution",250,0.,1000.);
306 fOutput->Add(fTrackMult);
308 fTrackMultEMCAL = new TH1D ("hTrackMultEMCAL","Tracks multiplicity Distribution inside EMCAL acceptance",250,0.,1000.);
309 fTrackMultEMCAL->Sumw2();
310 fOutput->Add(fTrackMultEMCAL);
312 fClustMult = new TH1D ("hClustMult","Clusters multiplicity Distribution",250,0.,1000.);
314 fOutput->Add(fClustMult);
316 fRecoPV = new TH1D("hRecoPV","Prim. vert. reconstruction (yes or no);reco (0=no, 1=yes) ;",2,-0.5,1.5);
318 fOutput->Add(fRecoPV);
320 fPVZBefore = new TH1D ("hPVZDistr","Z Distribution for the Reconstructed Vertex",200,0.,40.);
322 fOutput->Add(fPVZBefore);
324 fEtaPhiCell = new TH2D ("hEtaPhiCellActivity","",250,0.,1000., 250, 0., 1000.);
325 fEtaPhiCell->Sumw2();
326 fOutput->Add(fEtaPhiCell);
328 fEtaPhiClus = new TH2D ("hEtaPhiClusActivity","",250,0.,1000., 250, 0., 1000.);
329 fEtaPhiClus->Sumw2();
330 fOutput->Add(fEtaPhiClus);
332 fClusEvsClusT = new TH2D ("hEnVSTime","",250,0.,1000., 250,0.,1000.);
333 fClusEvsClusT->Sumw2();
334 fOutput->Add(fClusEvsClusT);
336 fDeltaETAClusTrackVSpT = new TH2D("hTC_Dz","Track-Cluster Dz vs pT of Cluster",100,0.,100.,100,-0.05,0.05);
337 fDeltaETAClusTrackVSpT->Sumw2();
338 fOutput->Add(fDeltaETAClusTrackVSpT);
340 fDeltaPHIClusTrackVSpT = new TH2D("hTC_Dx","Track-Cluster Dx vs pT of Cluster",100,0.,100.,100,-0.05,0.05);
341 fDeltaPHIClusTrackVSpT->Sumw2();
342 fOutput->Add(fDeltaPHIClusTrackVSpT);
345 //Initialize only the Common THistos for the Three different output
347 fGoodEventsOnPVZ = new TH1D ("hGOODwrtPVZ","Number of Selected Events wrt Cut on Primary Vertex Z (0=disregarded,1=selected)",2,0.,2.);
348 fGoodEventsOnPVZ->Sumw2();
349 fOutput->Add(fGoodEventsOnPVZ);
351 fPT = new TH1D("hPt_NC","P_{T} distribution for Neutral Clusters",100,0.,100.);
355 fM02 = new TH2D("hM02_NC","M02 distribution for Neutral Clusters vs E",100,0.,100.,500,0.,5.);
359 fNLM = new TH1D("hNLM_NC","NLM distribution for Neutral Clusters",200,0.,4.);
363 fEtIsoCells = new TH1D("hEtIsoCell_NC","E_{T}^{iso cone} in iso cone distribution for Neutral Clusters with EMCAL Cells",100,0.,100.);
364 fEtIsoCells->SetXTitle("#Sigma E_{T}^{iso cone} (GeV/c)");
365 fEtIsoCells->Sumw2();
366 fOutput->Add(fEtIsoCells);
368 fEtIsoClust = new TH1D("hEtIsoClus_NC","#Sigma E_{T}^{iso cone} in iso cone distribution for Neutral Clusters with EMCAL Clusters",100,0.,100.);
369 fEtIsoClust->SetXTitle("#Sigma E_{T}^{iso cone} (GeV/c)");
370 fEtIsoClust->Sumw2();
371 fOutput->Add(fEtIsoClust);
373 fPtIsoTrack = new TH1D("hPtIsoTrack_NC"," #Sigma P_{T}^{iso cone} in iso cone distribution for Neutral Clusters with Tracks",100,0.,100.);
374 fPtIsoTrack->SetXTitle("#Sigma P_{T}^{iso cone} (GeV/c)");
375 fPtIsoTrack->Sumw2();
376 fOutput->Add(fPtIsoTrack);
378 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.);
379 fPtEtIsoTC->SetXTitle("#Sigma P_{T}^{iso cone} + #Sigma E_{T}^{iso cone} (GeV/c)");
381 fOutput->Add(fPtEtIsoTC);
383 fPhiBandUEClust = new TH2D(Form("hPhiBandUE_Cluster"),Form("UE Estimation with Phi Band Clusters"),100,0.,100.,100,0.,100.);
384 fPhiBandUEClust->SetXTitle("E_{T}");
385 fPhiBandUEClust->SetYTitle("#Sigma E_{T}^{UE}");
386 fPhiBandUEClust->Sumw2();
387 fOutput->Add(fPhiBandUEClust);
389 fEtaBandUEClust = new TH2D(Form("hEtaBandUE_Cluster"),Form("UE Estimation with Phi Band Clusters"),100,0.,100.,100,0.,100.);
390 fEtaBandUEClust->SetXTitle("E_{T}");
391 fEtaBandUEClust->SetYTitle("#Sigma E_{T}^{UE}");
392 fEtaBandUEClust->Sumw2();
393 fOutput->Add(fEtaBandUEClust);
395 fPhiBandUECells = new TH2D(Form("hPhiBandUE_CELLS"),Form("UE Estimation with Phi Band CELLS"),100,0.,100.,100,0.,100.);
396 fPhiBandUECells->SetXTitle("E_{T}");
397 fPhiBandUECells->SetYTitle("#Sigma E_{T}^{UE}");
398 fPhiBandUECells->Sumw2();
399 fOutput->Add(fPhiBandUECells);
401 fEtaBandUECells = new TH2D(Form("hEtaBandUE_CELLS"),Form("UE Estimation with Phi Band and CELLS"),100,0.,100.,100,0.,100.);
402 fEtaBandUECells->SetXTitle("E_{T}");
403 fEtaBandUECells->SetYTitle("#Sigma E_{T}^{UE}");
404 fEtaBandUECells->Sumw2();
405 fOutput->Add(fEtaBandUECells);
407 fPhiBandUETracks = new TH2D(Form("hPhiBandUE_TPC"),Form("UE Estimation with Phi Band TPC "),100,0.,100.,100,0.,100.);
408 fPhiBandUETracks->SetXTitle("E_{T}");
409 fPhiBandUETracks->SetYTitle("#Sigma P_{T}^{UE}");
410 fPhiBandUETracks->Sumw2();
411 fOutput->Add(fPhiBandUETracks);
413 fEtaBandUETracks = new TH2D(Form("hEtaBandUE_TPC"),Form("UE Estimation with Phi Band and TPC"),100,0.,100.,100,0.,100.);
414 fEtaBandUETracks->SetXTitle("E_{T}");
415 fEtaBandUETracks->SetYTitle("#Sigma P_{T}^{UE}");
416 fEtaBandUETracks->Sumw2();
417 fOutput->Add(fEtaBandUETracks);
419 fPerpConesUETracks = new TH2D("hConesUE","UE Estimation with Perpendicular Cones in TPC",100,0.,100.,100,0.,100.);
420 fPerpConesUETracks->SetXTitle("E_{T}");
421 fPerpConesUETracks->SetYTitle("#Sigma P_{T}^{UE}");
422 fPerpConesUETracks->Sumw2();
423 fOutput->Add(fPerpConesUETracks);
425 fTPCWithoutIsoConeB2BbandUE = new TH2D("hFullTPCUE","UE Estimation with almost Full TPC",100,0.,100.,100,0.,100.);
426 fPhiBandUEClust->SetXTitle("E_{T}");
427 fPhiBandUEClust->SetYTitle("#Sigma E_{T}^{UE}");
428 fTPCWithoutIsoConeB2BbandUE->Sumw2();
429 fOutput->Add(fTPCWithoutIsoConeB2BbandUE);
431 fEtIsolatedClust = new TH1D("hEtIsolatedClust","E_{T} distribution for Isolated Photons with clusters; #Sigma E_{T}^{iso cone}<Ethres",100,0.,100.);
432 fEtIsolatedClust->SetXTitle("E_{T}^{iso}");
433 fEtIsolatedClust->Sumw2();
434 fOutput->Add(fEtIsolatedClust);
436 fEtIsolatedCells = new TH1D("hEtIsolatedCells","E_{T} distribution for Isolated Photons with cells; #Sigma E_{T}^{iso cone}<Ethres",100,0.,100.);
437 fEtIsolatedCells->SetXTitle("E_{T}^{iso}");
438 fEtIsolatedCells->Sumw2();
439 fOutput->Add(fEtIsolatedCells);
441 fEtIsolatedTracks = new TH1D("hEtIsolatedTracks","E_{T} distribution for Isolated Photons with tracks; #Sigma P_{T}^{iso cone}<Pthres",100,0.,100.);
442 fEtIsolatedTracks->SetXTitle("E_{T}^{iso}");
443 fEtIsolatedTracks->Sumw2();
444 fOutput->Add(fEtIsolatedTracks);
446 fTest = new TH1D ("hTest","test cluster collection",100,-2.,6.);
451 PostData(1, fOutput);
455 //________________________________________________________________________
456 Float_t* AliAnalysisTaskEMCALPhotonIsolation::GenerateFixedBinArray(Int_t n, Float_t min, Float_t max) const
458 // Generate the bin array for the ThnSparse
460 Float_t *bins = new Float_t[n+1];
462 Float_t binWidth = (max-min)/n;
464 for (Int_t i = 1; i <= n; i++) {
465 bins[i] = bins[i-1]+binWidth;
471 //________________________________________________________________________
472 void AliAnalysisTaskEMCALPhotonIsolation::ExecOnce()
474 // Init the analysis.
478 if (fParticleCollArray.GetEntriesFast()<2) {
479 AliError(Form("Wrong number of particle collections (%d), required 2",fParticleCollArray.GetEntriesFast()));
484 // for (Int_t i = 0; i < 2; i++) {
485 // AliParticleContainer *contain = static_cast<AliParticleContainer*>(fParticleCollArray.At(i));
486 // // contain->GetClassName("AliEmcalParticle");
491 AliAnalysisTaskEmcal::ExecOnce();
494 AliError(Form("AliAnalysisTask not initialized"));
502 //______________________________________________________________________________________
503 Bool_t AliAnalysisTaskEMCALPhotonIsolation::Run()
508 AliParticleContainer *clusters = static_cast<AliParticleContainer*>(fParticleCollArray.At(1));
509 AliEmcalParticle *emccluster = 0;
511 // delete output USEFUL LATER FOR CONTAINER CREATION !!
512 //fOutClusters->Delete();
514 //Int_t clusCount = 0; AliError(Form("Should be here each time"));
515 // loop over all clusters
516 clusters->ResetCurrentID();
519 //Double_t ETleadingclust = 0., M02leadingcluster = 0., lambda0cluster = 0., phileadingclust = 0., etaleadingclust = 0., ptmc = 0.,mcptsum = 0.;
521 //Definition of the Array for Davide's Output
522 //const Int_t ndims = fNDimensions;
523 //Double_t outputValues[ndims];
527 // AliError(Form("Check the loop"));
528 // get the leading particle
531 emccluster = static_cast<AliEmcalParticle*>(clusters->GetLeadingParticle());
535 AliError(Form("no leading one"));
541 // emccluster = clusters->GetLeadingParticle();
542 index = emccluster->IdInCollection();
544 //add a command to get the index of the leading cluster!
545 if (!emccluster->IsEMCAL()) return kTRUE;
547 AliVCluster *coi = emccluster->GetCluster();
548 if (!coi) return kTRUE;
550 TLorentzVector vecCOI;
551 coi->GetMomentum(vecCOI,fVertex);
554 if(!CheckBoundaries(vecCOI))
557 if(ClustTrackMatching(coi))
561 FillGeneralHistograms(coi,vecCOI, index);
564 //get the entries of the Cluster Container
565 //whatever is a RETURN in LCAnalysis here is a CONTINUE,
566 //since there are more than 1 Cluster per Event
568 while((emccluster = static_cast<AliEmcalParticle*>(clusters->GetNextAcceptParticle()))){
570 if (!emccluster->IsEMCAL()) return kTRUE;
572 AliVCluster *coi = emccluster->GetCluster();
573 if(!coi) return kTRUE;
575 TLorentzVector vecCOI;
576 coi->GetMomentum(vecCOI,fVertex);
578 if(!CheckBoundaries(vecCOI))
581 if(ClustTrackMatching(coi))
584 FillGeneralHistograms(coi,vecCOI, index);
588 // PostData(1, fOutput);
593 //__________________________________________________________________________
594 Bool_t AliAnalysisTaskEMCALPhotonIsolation::ClustTrackMatching(AliVCluster *cluster) {
595 // Check if the cluster match to a track
600 AliParticleContainer *tracks = static_cast<AliParticleContainer*>(fParticleCollArray.At(0));
601 // for an incoming cluster reject it if there is a track corresponding with a deta and dphi lower than the cuts
602 TLorentzVector nPart;
603 cluster->GetMomentum(nPart, fVertex);
605 AliVTrack *mt = NULL;
606 AliAODCaloCluster *acl = dynamic_cast<AliAODCaloCluster*>(cluster);
608 if(acl->GetNTracksMatched()>1)
609 mt = static_cast<AliVTrack*>(acl->GetTrackMatched(0));
612 AliESDCaloCluster *ecl = dynamic_cast<AliESDCaloCluster*>(cluster);
614 AliError("ClusTrack matching did not work");
617 Int_t im = ecl->GetTrackMatchedIndex();
618 if(tracks && im>=0) {
619 mt = static_cast<AliVTrack*>(tracks->GetParticle(im));
622 // if(mt && mt->TestFilterBit(768)) { //Hybrid tracks with AOD
623 AliPicoTrack::GetEtaPhiDiff(mt, cluster, dphi, deta);
624 fDeltaETAClusTrackVSpT->Fill(nPart.Pt(), deta);
625 fDeltaPHIClusTrackVSpT->Fill(nPart.Pt(), dphi);
636 //__________________________________________________________________________
637 void AliAnalysisTaskEMCALPhotonIsolation::EtIsoCellPhiBand(TLorentzVector c, Float_t &etIso, Float_t &phiBandcells){
638 // Underlying events study with EMCAL cells in phi band
640 AliEMCALGeometry* emcalGeom = AliEMCALGeometry::GetInstance();
642 Float_t sumEnergyPhiBandCells=0., sumEnergyConeCells=0.;
645 // check the cell corresponding to the leading cluster
647 //maybe best to call it LeadingCellIdinClus or better maxId since it won't be used anywhere else ???
648 Bool_t cellLeadingClustID = emcalGeom->GetAbsCellIdFromEtaPhi(c.Eta(),c.Phi(),absId);
649 if(!cellLeadingClustID) return;
654 Int_t imEta=-1, imPhi=-1;
655 Int_t iEta =-1, iPhi =-1;
657 emcalGeom->GetCellIndex(absId,iModule,iTower,imPhi,imEta); // to get the module, the tower, eta and phi for the cell corresponding to the leading cluster
658 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
660 // Get the row and the column of the cell corresponding to the leading cluster in EMCAL
661 Int_t colCellLeadingClust = iEta;
662 if(iModule % 2) colCellLeadingClust = AliEMCALGeoParams::fgkEMCALCols + iEta ; // if the SM number is even you need to translate to have the one corresponding in EMCAL
663 Int_t rowCellLeadingClust = iPhi + AliEMCALGeoParams::fgkEMCALRows*int(iModule/2); // to have the corresponding row in EMCAL
665 // total number or rows and columns in EMCAL
666 Int_t nTotalRows = AliEMCALGeoParams::fgkEMCALRows*16/3 ; // 5 + 2/3 supermodules in a row
667 Int_t nTotalCols = 2*AliEMCALGeoParams::fgkEMCALCols; // 2 supermodules in a column
669 Int_t nbConeSize = int(fIsoConeRadius/0.0143); //0.0143 tower acceptance
672 AliVCaloCells * cells =InputEvent()->GetEMCALCells();
674 // define the max and min row and column corresponding to the isolation cone around the seed cell from the leading cluster
675 Int_t iRowMinCone = rowCellLeadingClust-nbConeSize;
676 if(iRowMinCone<0) iRowMinCone=0;
678 Int_t iRowMaxCone = rowCellLeadingClust+nbConeSize;
679 if(iRowMaxCone>AliEMCALGeoParams::fgkEMCALRows) iRowMaxCone=AliEMCALGeoParams::fgkEMCALRows; // AliEMCALGeoParams::fgkEMCALRows = 24 in a supermodule
681 Int_t iColMinCone = colCellLeadingClust - nbConeSize;
682 if(iColMinCone<0) iColMinCone = 0;
684 Int_t iColMaxCone = colCellLeadingClust+nbConeSize;
685 if(iColMaxCone>AliEMCALGeoParams::fgkEMCALCols) iColMaxCone=AliEMCALGeoParams::fgkEMCALCols; // AliEMCALGeoParams::fgkEMCALCols = 48 in a supermodule
688 for(Int_t iCol=0; iCol<nTotalCols; iCol++){
689 for(Int_t iRow=0; iRow<nTotalRows; iRow++){
690 // now recover the cell indexes in a supermodule
691 Int_t iSector = int(iRow/AliEMCALGeoParams::fgkEMCALRows); // check in which SM is the cell
692 if(iSector==5) continue; //
695 if(iCol < AliEMCALGeoParams::fgkEMCALCols){ // if the SM number is odd the column is the one corresponding in the supermodule
696 iModule = 2*iSector + 1;
699 else if(iCol > AliEMCALGeoParams::fgkEMCALCols - 1){ // if the SM number is even the column isn't the one corresponding in the supermodule
700 inModule = 2*iSector;
701 iColLoc = iCol-AliEMCALGeoParams::fgkEMCALCols;
704 Int_t iRowLoc = iRow - AliEMCALGeoParams::fgkEMCALRows*iSector ;
706 if(TMath::Abs(iCol-colCellLeadingClust)<nbConeSize && TMath::Abs(iCol+colCellLeadingClust)>nbConeSize){
707 if(iRow<iRowMaxCone && iRow>iRowMinCone){
708 Int_t iabsId = emcalGeom->GetAbsCellIdFromCellIndexes(iModule,iRow,iCol); // verifier les iRow et iCol
709 sumEnergyPhiBandCells+=cells->GetAmplitude(iabsId); //should be Et
712 else if (TMath::Abs(iCol-colCellLeadingClust)>nbConeSize && TMath::Abs(iCol+colCellLeadingClust)<nbConeSize){
713 Int_t iabsId = emcalGeom->GetAbsCellIdFromCellIndexes(iModule,iRowLoc,iColLoc); // verifier les iRow et iCol
714 sumEnergyConeCells+=cells->GetAmplitude(iabsId); //should be Et
719 etIso = sumEnergyConeCells;
720 phiBandcells = sumEnergyPhiBandCells;
724 //__________________________________________________________________________
725 void AliAnalysisTaskEMCALPhotonIsolation::EtIsoCellEtaBand(TLorentzVector c, Float_t &etIso, Float_t &etaBandcells){
726 // Underlying events study with EMCAL cell in eta band
729 AliEMCALGeometry* emcalGeom = AliEMCALGeometry::GetInstance();
731 Float_t sumEnergyEtaBandCells=0., sumEnergyConeCells=0.;
735 // check the cell corresponding to the leading cluster
737 //maybe best to call it LeadingCellIdinClus or better maxId since it won't be used anywhere else ???
738 Bool_t cellLeadingClustID = emcalGeom->GetAbsCellIdFromEtaPhi(c.Eta(),c.Phi(),absId);
739 if(!cellLeadingClustID) return;
745 Int_t imEta=-1, imPhi=-1;
746 Int_t iEta =-1, iPhi =-1;
748 emcalGeom->GetCellIndex(absId,iModule,iTower,imPhi,imEta); // to get the module, the tower, eta and phi for the cell corresponding to the leading cluster
749 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
751 // Get the row and the column of the cell corresponding to the leading cluster in EMCAL
752 Int_t colCellLeadingClust = iEta;
753 if(iModule % 2) colCellLeadingClust = AliEMCALGeoParams::fgkEMCALCols + iEta ; // if the SM number is even you need to translate to have the one corresponding in EMCAL
754 Int_t rowCellLeadingClust = iPhi + AliEMCALGeoParams::fgkEMCALRows*int(iModule/2); // to have the corresponding row in EMCAL
756 // total number or rows and columns in EMCAL
757 Int_t nTotalRows = AliEMCALGeoParams::fgkEMCALRows*16/3 ; // 5 + 2/3 supermodules in a row
758 Int_t nTotalCols = 2*AliEMCALGeoParams::fgkEMCALCols; // 2 supermodules in a column
760 Int_t nbConeSize = int(fIsoConeRadius/0.0143); //0.0143 tower acceptance
763 AliVCaloCells * cells =InputEvent()->GetEMCALCells();
765 // define the max and min row and column corresponding to the isolation cone around the seed cell from the leading cluster
766 Int_t iRowMinCone = rowCellLeadingClust-nbConeSize;
767 if(iRowMinCone<0) iRowMinCone=0;
769 Int_t iRowMaxCone = rowCellLeadingClust+nbConeSize;
770 if(iRowMaxCone>AliEMCALGeoParams::fgkEMCALRows) iRowMaxCone=AliEMCALGeoParams::fgkEMCALRows; // AliEMCALGeoParams::fgkEMCALRows = 24 in a supermodule
772 Int_t iColMinCone = colCellLeadingClust-nbConeSize;
773 if(iColMinCone<0) iColMinCone = 0;
775 Int_t iColMaxCone = colCellLeadingClust+nbConeSize;
776 if(iColMaxCone>AliEMCALGeoParams::fgkEMCALCols) iColMaxCone=AliEMCALGeoParams::fgkEMCALCols; // AliEMCALGeoParams::fgkEMCALCols = 48 in a supermodule
779 for(Int_t iCol=0; iCol<nTotalCols; iCol++)
781 for(Int_t iRow=0; iRow<nTotalRows; iRow++)
783 // now recover the cell indexes in a supermodule
784 Int_t iSector = int(iRow/AliEMCALGeoParams::fgkEMCALRows); // check in which SM is the cell
785 if(iSector==5) continue; //
788 if(iCol < AliEMCALGeoParams::fgkEMCALCols){ // if the SM number is odd the column is the one corresponding in the supermodule
789 iModule = 2*iSector + 1;
792 else if(iCol > AliEMCALGeoParams::fgkEMCALCols - 1){ // if the SM number is even the column isn't the one corresponding in the supermodule
793 inModule = 2*iSector;
794 iColLoc = iCol-AliEMCALGeoParams::fgkEMCALCols;
797 Int_t iRowLoc = iRow - AliEMCALGeoParams::fgkEMCALRows*iSector ;
799 if(TMath::Abs(iCol-colCellLeadingClust)<nbConeSize && TMath::Abs(iCol+colCellLeadingClust)>nbConeSize){
800 if(iCol<iColMaxCone && iCol>iColMinCone){
801 Int_t iabsId = emcalGeom->GetAbsCellIdFromCellIndexes(iModule,iRow,iCol); // verifier les iRow et iCol
802 sumEnergyEtaBandCells+=cells->GetAmplitude(iabsId); //should be Et
805 else if (TMath::Abs(iCol-colCellLeadingClust)>nbConeSize && TMath::Abs(iCol+colCellLeadingClust)<nbConeSize){
806 Int_t iabsId = emcalGeom->GetAbsCellIdFromCellIndexes(iModule,iRowLoc,iColLoc); // verifier les iRow et iCol
807 sumEnergyConeCells+=cells->GetAmplitude(iabsId); //should be Et
812 etIso = sumEnergyConeCells;
813 etaBandcells = sumEnergyEtaBandCells;
817 //__________________________________________________________________________
818 void AliAnalysisTaskEMCALPhotonIsolation::EtIsoClusPhiBand(TLorentzVector c, Float_t &etIso, Float_t &phiBandclus, Int_t index){
819 // Underlying events study with clusters in phi band
821 Float_t sumEnergyPhiBandClus=0., sumEnergyConeClus=0.;
823 //needs a check on the same cluster
824 AliParticleContainer *clusters = static_cast<AliParticleContainer*>(fParticleCollArray.At(1));
825 AliEmcalParticle *clust;
828 while((clust = static_cast<AliEmcalParticle*>(clusters->GetNextAcceptParticle()))){ //check the position of other clusters in respect to the leading cluster
830 if(localIndex==index) continue;
832 AliVCluster *cluster= clust->GetCluster();
834 TLorentzVector nClust; //STILL NOT INITIALIZED
835 cluster->GetMomentum(nClust,fVertex);
836 Float_t phiClust =nClust.Phi();
837 Float_t etaClust= nClust.Eta();
838 //redefine phi/c.Eta() from the cluster we passed to the function
840 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
842 if(radius>fIsoConeRadius){ // the cluster is outside the isolation cone in this case study UE
844 // actually phi band here
845 if(TMath::Abs(etaClust - c.Eta()) < fIsoConeRadius){
846 sumEnergyPhiBandClus += nClust.Pt();
849 else // if the cluster is in the isolation cone, add the cluster pT
850 sumEnergyConeClus += nClust.Pt();
853 etIso = sumEnergyConeClus;
854 phiBandclus = sumEnergyPhiBandClus;
858 //__________________________________________________________________________
859 void AliAnalysisTaskEMCALPhotonIsolation::EtIsoClusEtaBand(TLorentzVector c, Float_t &etIso, Float_t &etaBandclus, Int_t index){
860 // Underlying events study with clusters in eta band
862 Float_t sumEnergyEtaBandClus =0., sumEnergyConeClus=0.;
863 AliParticleContainer *clusters = static_cast<AliParticleContainer*>(fParticleCollArray.At(1));
865 AliEmcalParticle *clust;
868 while((clust = static_cast<AliEmcalParticle*>(clusters->GetNextAcceptParticle()))){ //check the position of other clusters in respect to the leading cluster
870 if(localIndex==index) continue;
872 AliVCluster *cluster= clust->GetCluster();
874 TLorentzVector nClust; //STILL NOT INITIALIZED
875 cluster->GetMomentum(nClust,fVertex);
877 Float_t phiClust =nClust.Phi();
878 Float_t etaClust= nClust.Eta();
879 //redefine phi/c.Eta() from the cluster we passed to the function
881 // define the radius between the leading cluster and the considered cluster
882 Float_t radius = TMath::Sqrt(TMath::Power(phiClust-c.Phi(),2)+TMath::Power(etaClust-c.Eta(),2));
884 if(radius>fIsoConeRadius){ // the cluster is outside the isolation cone in this case study UE
886 // actually eta band here
887 if(TMath::Abs(etaClust - c.Eta()) < fIsoConeRadius){
888 sumEnergyEtaBandClus += nClust.Pt();
891 else // if the cluster is in the isolation cone, add the cluster pT
892 sumEnergyConeClus += nClust.Pt();
895 etIso = sumEnergyConeClus;
896 etaBandclus = sumEnergyEtaBandClus;
900 //__________________________________________________________________________
901 void AliAnalysisTaskEMCALPhotonIsolation::PtIsoTrackPhiBand(TLorentzVector c, Float_t &ptIso, Float_t &phiBandtrack){
902 // Underlying events study with tracks in phi band in EMCAL acceptance
904 //INSERT BOUNDARIES ACCORDING TO THE FLAG WE WANT TO USE
905 Float_t sumpTConeCharged=0., sumpTPhiBandTrack=0.;
906 Float_t minPhi= 0., maxPhi= 2*TMath::Pi(), minEta = -0.9, maxEta= 0.9;
908 AliParticleContainer *tracks = static_cast<AliParticleContainer*>(fParticleCollArray.At(0));
914 maxPhi = TMath::Pi();
917 AliVParticle *track = tracks->GetNextAcceptParticle(0);
921 //CHECK IF TRACK IS IN BOUNDARIES
922 Float_t phiTrack = track->Phi();
923 Float_t etaTrack = track->Eta();
924 // define the radius between the leading cluster and the considered cluster
925 //redefine phi/c.Eta() from the cluster we passed to the function
926 if(phiTrack < maxPhi && phiTrack > minPhi && etaTrack < maxEta && etaTrack > minEta){
927 Float_t radius = TMath::Sqrt(TMath::Power(phiTrack - c.Phi(),2)+TMath::Power(etaTrack - c.Eta(),2));
929 if(radius>fIsoConeRadius){ // if tracks are outside the isolation cone study
931 // actually phi band here --- ADD Boundaries conditions
932 if(TMath::Abs(etaTrack - c.Eta()) < fIsoConeRadius){
933 sumpTPhiBandTrack += track->Pt();
937 sumpTConeCharged+=track->Pt(); // should not double count if the track matching is already done
939 track=tracks->GetNextAcceptParticle();
941 ptIso = sumpTConeCharged;
942 phiBandtrack = sumpTPhiBandTrack;
946 //__________________________________________________________________________
947 void AliAnalysisTaskEMCALPhotonIsolation::PtIsoTrackEtaBand(TLorentzVector c, Float_t &ptIso, Float_t &etaBandtrack){
948 // Underlying events study with tracks in eta band in EMCAL acceptance
950 //INSERT BOUNDARIES ACCORDING TO THE FLAG WE WANT TO USE
951 Float_t sumpTConeCharged=0., sumpTEtaBandTrack=0.;
952 Float_t minPhi= 0., maxPhi= 2*TMath::Pi(), minEta = -0.9, maxEta= 0.9;
954 AliParticleContainer *tracks = static_cast<AliParticleContainer*>(fParticleCollArray.At(0));
961 maxPhi = TMath::Pi();
965 AliVParticle *track = tracks->GetNextAcceptParticle(0);
969 Float_t phiTrack = track->Phi();
970 Float_t etaTrack = track->Eta();
971 //redefine phi/c.Eta() from the cluster we passed to the function
972 if(phiTrack < maxPhi && phiTrack > minPhi && etaTrack < maxEta && etaTrack > minEta){
973 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
974 if(radius>fIsoConeRadius){ // if tracks are outside the isolation cone study UE
976 // actually eta band here --- ADD Boundaries conditions
977 if(TMath::Abs(phiTrack - c.Phi()) < fIsoConeRadius){
978 sumpTEtaBandTrack += track->Pt();
982 sumpTConeCharged += track->Pt(); // should not double count if the track matching is already done
984 track=tracks->GetNextAcceptParticle();
986 ptIso = sumpTConeCharged;
987 etaBandtrack = sumpTEtaBandTrack;
991 //__________________________________________________________________________
992 void AliAnalysisTaskEMCALPhotonIsolation::PtIsoTrackOrthCones(TLorentzVector c, Float_t &ptIso, Float_t &cones){
993 // Underlying events study with tracks in orthogonal cones in TPC
995 Float_t sumpTConeCharged=0., sumpTPerpConeTrack=0.;
997 AliParticleContainer *tracks = static_cast<AliParticleContainer*>(fParticleCollArray.At(0));
999 Float_t etaClus = c.Eta();
1000 Float_t phiClus = c.Phi();
1001 Float_t phiCone1 = phiClus - TMath::PiOver2();
1002 Float_t phiCone2 = phiClus + TMath::PiOver2();
1004 if (phiCone1 < 0.) phiCone1 += 2*TMath::Pi();
1006 AliVParticle *track = tracks->GetNextAcceptParticle(0);
1010 Float_t phiTrack = track->Phi();
1011 Float_t etaTrack = track->Eta();
1013 Float_t dist2Clust = TMath::Sqrt(TMath::Power(etaTrack-etaClus, 2)+TMath::Power(phiTrack-phiClus, 2));
1014 if (dist2Clust<fIsoConeRadius)// if tracks are inside the IsoCone
1015 sumpTConeCharged += track->Pt();
1017 else{//tracks outside the IsoCone
1018 //Distances from the centres of the two Orthogonal Cones
1019 Float_t dist2Cone1 = TMath::Sqrt(TMath::Power(etaTrack-etaClus, 2)+TMath::Power(phiTrack-phiCone1, 2));
1020 Float_t dist2Cone2 = TMath::Sqrt(TMath::Power(etaTrack-etaClus, 2)+TMath::Power(phiTrack-phiCone2, 2));
1022 //Is the Track Inside one of the two Cones ->Add to UE
1023 if((dist2Cone1 < fIsoConeRadius) || (dist2Cone2 < fIsoConeRadius))
1024 sumpTPerpConeTrack += track->Pt();
1026 track=tracks->GetNextAcceptParticle();
1028 ptIso = sumpTConeCharged;
1029 cones = sumpTPerpConeTrack;
1032 //__________________________________________________________________________
1033 void AliAnalysisTaskEMCALPhotonIsolation::PtIsoTrackFullTPC(TLorentzVector c, Float_t &ptIso, Float_t &full){
1034 // Underlying events study with tracks in full TPC except back to back bands
1036 Float_t sumpTConeCharged=0., sumpTTPCexceptB2B=0.;
1038 AliParticleContainer *tracks = static_cast<AliParticleContainer*>(fParticleCollArray.At(0));
1039 AliVParticle *track = tracks->GetNextAcceptParticle(0);
1043 Float_t phiTrack = track->Phi();
1044 Float_t etaTrack = track->Eta();
1045 //redefine phi/c.Eta() from the cluster we passed to the function
1047 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
1048 if(radius>fIsoConeRadius){ // if tracks are outside the isolation cone study UE
1049 Double_t dphiUp = c.Phi() + TMath::Pi() - fIsoConeRadius;
1050 Double_t dphiDown = c.Phi() + TMath::Pi() + fIsoConeRadius;
1052 if(TMath::Power(phiTrack-c.Phi(),2) +TMath::Power(etaTrack-c.Eta(),2) > TMath::Power((fIsoConeRadius+0.1),2) && phiTrack < dphiDown && phiTrack> dphiUp)
1053 sumpTTPCexceptB2B += track->Pt();
1056 sumpTConeCharged += track->Pt(); // should not double count if the track matching is already done
1058 track=tracks->GetNextAcceptParticle();
1060 ptIso = sumpTConeCharged;
1061 full = sumpTTPCexceptB2B;
1064 //__________________________________________________________________________
1065 Bool_t AliAnalysisTaskEMCALPhotonIsolation::CheckBoundaries(TLorentzVector vecCOI){
1066 // Check if the cone around the considered cluster is in EMCAL acceptance
1068 Float_t minPhiBound= 1.5 , minEtaBound= -0.5, maxPhiBound= TMath::Pi()-0.1, maxEtaBound= 0.5;
1069 Bool_t isINBoundaries;
1072 minPhiBound = 1.4+0.4; //to be changed with fIsoConeR
1073 maxPhiBound = TMath::Pi()-0.4;
1074 minEtaBound = -0.7+0.4;
1075 maxEtaBound = 0.7-0.4;
1078 if(vecCOI.Eta() > maxEtaBound || vecCOI.Eta() < minEtaBound || vecCOI.Phi() > maxPhiBound || vecCOI.Phi() >minPhiBound)
1079 isINBoundaries=kFALSE;
1081 isINBoundaries=kTRUE;
1083 return isINBoundaries;
1086 //__________________________________________________________________________
1087 Bool_t AliAnalysisTaskEMCALPhotonIsolation::FillGeneralHistograms(AliVCluster *coi, TLorentzVector vecCOI, Int_t index){
1088 // Fill the histograms for underlying events and isolation studies
1090 AliParticleContainer *tracks = static_cast<AliParticleContainer*>(fParticleCollArray.At(0));
1092 AliEmcalParticle *emcTrack = 0;
1095 tracks->ResetCurrentID();
1096 while ((emcTrack = static_cast<AliEmcalParticle*>(tracks->GetNextAcceptParticle()))) {
1097 AliVTrack *track = emcTrack->GetTrack();
1098 if(!track) continue;
1099 // if(!(track->TestFilterBit("kHybrid"))) continue;
1104 Double_t eTCOI = 0., m02COI = 0., lambda0cluster = 0., phiCOI = 0., etaCOI = 0., ptmc = 0., mcptsum = 0.;
1106 //Definition of the Array for Davide's Output
1107 const Int_t ndims = fNDimensions;
1108 Double_t outputValues[ndims];
1110 eTCOI = vecCOI.Et();
1111 m02COI = coi->GetM02();
1112 etaCOI = vecCOI.Eta();
1113 phiCOI = vecCOI.Phi();
1115 // ******** Isolation and UE calculation with different methods *********
1117 Double_t eTThreshold = 5;
1119 switch(fEtIsoMethod)
1121 case 0: // SumEt<EtThr
1122 if(fM02mincut < m02COI && m02COI < fM02maxcut) // photon candidate, cuts have to be decided after studies
1124 eTThreshold = fEtIsoThreshold;
1128 case 1: // SumEt<%Ephoton
1129 if(fM02mincut < m02COI && m02COI < fM02maxcut) // photon candidate, cuts have to be decided after studies
1131 eTThreshold = fEtIsoThreshold * eTCOI;
1135 case 2: // Etmax<eTThreshold
1136 eTThreshold = fEtIsoThreshold;
1137 if(fM02mincut < m02COI && m02COI < fM02maxcut && eTCOI<eTThreshold) // photon candidate, cuts have to be decided after studies
1139 fEtIsolatedClust->Fill(eTCOI);
1144 //DO NOT CHANGE EVER AGAIN THE FOLLOWING DEFINITIONS
1145 Float_t isoConeArea = TMath::Pi()*fIsoConeRadius*fIsoConeRadius;
1146 Float_t etaBandArea = (1.4 - 2.*fIsoConeRadius)*2.*fIsoConeRadius;
1147 Float_t phiBandArea = ((5./9.)*TMath::Pi()- 2.*fIsoConeRadius)*2.*fIsoConeRadius;
1148 Float_t etaBandAreaTr = (1.8 - 2.*fIsoConeRadius)*2.*fIsoConeRadius;
1149 Float_t phiBandAreaTr = (2.*TMath::Pi() - 4.*fIsoConeRadius)*2.*fIsoConeRadius;//there is a 2 more because of the JET CONE B2B
1150 Float_t perpConesArea = 2.*isoConeArea;
1151 Float_t fullTPCArea = 1.8*2.*TMath::Pi()-fIsoConeRadius*(TMath::Pi()*fIsoConeRadius + 3.6);
1153 Float_t isolation, ue;
1155 if(!fTPC4Iso){ //EMCAL Only for Acceptance of Clusters
1158 case 0: //EMCAL CELLS
1163 EtIsoCellPhiBand(vecCOI, isolation, ue);
1164 //Normalisation ue wrt Area - TO DO-
1165 ue = ue * (isoConeArea / phiBandArea);
1166 fPhiBandUECells->Fill(vecCOI.Pt() , ue);
1167 fEtIsoCells->Fill(isolation);
1168 if(isolation<eTThreshold)
1170 fEtIsolatedCells->Fill(eTCOI);
1172 fPtisoT=vecCOI.Pt();
1176 EtIsoCellEtaBand(vecCOI, isolation, ue);
1177 //Normalisation ue wrt Area - TO DO-
1178 ue = ue * (isoConeArea / etaBandArea);
1179 fEtaBandUECells->Fill(vecCOI.Pt() , ue);
1180 fEtIsoCells->Fill(isolation);
1181 if(isolation<eTThreshold)
1183 fEtIsolatedCells->Fill(eTCOI);
1185 fPtisoT=vecCOI.Pt();
1191 case 1: //EMCAL CLUSTERS
1196 EtIsoClusPhiBand(vecCOI, isolation, ue,index);
1197 //Normalisation ue wrt Area - TO DO-
1198 ue = ue * (isoConeArea / phiBandArea);
1199 fPhiBandUEClust->Fill(vecCOI.Pt() , ue);
1200 fEtIsoClust->Fill(isolation);
1203 EtIsoClusEtaBand(vecCOI, isolation, ue,index);
1204 //Normalisation ue wrt Area - TO DO-
1205 ue = ue * (isoConeArea / etaBandArea);
1206 fEtaBandUEClust->Fill(vecCOI.Pt() , ue);
1207 fEtIsoClust->Fill(isolation);
1208 if(isolation<eTThreshold)
1210 fEtIsolatedClust->Fill(eTCOI);
1212 fPtisoT=vecCOI.Pt();
1216 case 2: //TRACKS (TBD which tracks) //EMCAL tracks
1220 PtIsoTrackPhiBand(vecCOI, isolation, ue);
1221 //Normalisation ue wrt Area - TO DO-
1222 ue = ue * (isoConeArea / phiBandAreaTr);
1223 fPhiBandUETracks->Fill(vecCOI.Pt() , ue);
1224 fPtIsoTrack->Fill(isolation);
1225 if(isolation<eTThreshold)
1227 fEtIsolatedTracks->Fill(eTCOI);
1229 fPtisoT=vecCOI.Pt();
1233 PtIsoTrackEtaBand(vecCOI, isolation, ue);
1234 //Normalisation ue wrt Area - TO DO-
1235 ue = ue * (isoConeArea / etaBandAreaTr);
1236 fEtaBandUETracks->Fill(vecCOI.Pt() , ue);
1237 fPtIsoTrack->Fill(isolation);
1238 if(isolation<eTThreshold)
1240 fEtIsolatedTracks->Fill(eTCOI);
1242 fPtisoT=vecCOI.Pt();
1246 // PtIsoTrackOrthCones(vecCOI, absId, isolation, ue);
1248 // case 3: //Full TPC
1249 // PtIsoTrackFullTPC(vecCOI, absId, isolation, ue);
1254 else{ //EMCAL + TPC (Only tracks for the Isolation since IsoCone Goes Out of EMCAL)
1258 PtIsoTrackPhiBand(vecCOI, isolation, ue);
1259 //Normalisation ue wrt Area - TO DO-
1260 ue = ue * (isoConeArea / phiBandAreaTr);
1261 fPhiBandUETracks->Fill(vecCOI.Pt() , ue);
1262 fPtIsoTrack->Fill(isolation);
1263 if(isolation<eTThreshold)
1265 fEtIsolatedTracks->Fill(eTCOI);
1267 fPtisoT=vecCOI.Pt();
1271 PtIsoTrackEtaBand(vecCOI, isolation, ue);
1272 //Normalisation ue wrt Area - TO DO-
1273 ue = ue * (isoConeArea / etaBandAreaTr);
1274 fEtaBandUETracks->Fill(vecCOI.Pt() , ue);
1275 fPtIsoTrack->Fill(isolation);
1276 if(isolation<eTThreshold)
1278 fEtIsolatedTracks->Fill(eTCOI);
1280 fPtisoT=vecCOI.Pt();
1284 PtIsoTrackOrthCones(vecCOI, isolation, ue);
1285 //Normalisation ue wrt Area - TO DO-
1286 ue = ue * (isoConeArea / perpConesArea);
1287 fPerpConesUETracks ->Fill(vecCOI.Pt() , ue);
1288 fPtIsoTrack->Fill(isolation);
1289 if(isolation<eTThreshold)
1291 fEtIsolatedTracks->Fill(eTCOI);
1293 fPtisoT=vecCOI.Pt();
1297 PtIsoTrackFullTPC(vecCOI, isolation, ue);
1298 //Normalisation ue wrt Area - TO DO-
1299 ue = ue * (isoConeArea / fullTPCArea);
1300 fTPCWithoutIsoConeB2BbandUE->Fill(vecCOI.Pt() , ue);
1301 fPtIsoTrack->Fill(isolation);
1302 if(isolation<eTThreshold)
1304 fEtIsolatedTracks->Fill(eTCOI);
1306 fPtisoT=vecCOI.Pt();
1313 //Here we should call something to know the number of tracks...
1314 //Soon I'll put in this version the "old way"; please let me know if
1315 //any of you could do the same with the JET framework
1324 fsumEtisoconeT=isolation;
1325 // AliError(Form("lambda 0 %f",flambda0T));
1328 fOutputTree->Fill();
1332 outputValues[0] = nTracks;
1333 outputValues[1] = eTCOI;
1334 outputValues[2] = lambda0cluster;
1335 outputValues[3] = isolation;
1336 outputValues[4] = ue;
1337 outputValues[5] = isolation-ue;
1338 outputValues[6] = vecCOI.Eta();
1339 outputValues[7] = vecCOI.Phi();
1341 outputValues[8] = ptmc;
1342 outputValues[9] = mcptsum;
1344 fOutputTHnS -> Fill(outputValues);
1346 // // fOutPTMAX -> Fill(outputValues[1],outputValues[2],);