]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGGA/EMCALTasks/AliAnalysisTaskEMCALIsoPhoton.cxx
fixing the time cut in the QA loop
[u/mrichter/AliRoot.git] / PWGGA / EMCALTasks / AliAnalysisTaskEMCALIsoPhoton.cxx
index 29e5e823d9ec49044ceaaf651688247e7d4945cd..53ada2dcc5477dea6f445647e183dbe698cb08b7 100644 (file)
@@ -74,8 +74,19 @@ AliAnalysisTaskEMCALIsoPhoton::AliAnalysisTaskEMCALIsoPhoton() :
   fMaxPtTrack(0),
   fMaxEClus(0),
   fNCells50(0),
+  fFilterBit(0),
+  fSelHybrid(kFALSE),
+  fFillQA(kFALSE),
+  fClusIdFromTracks(""),
+  fCpvFromTrack(kFALSE),
+  fNBinsPt(200),
+  fPtBinLowEdge(-0.25),
+  fPtBinHighEdge(99.75),
+  fNCuts(5),
+  fCuts(""),
   fESD(0),
   fAOD(0),
+  fVEvent(0),
   fMCEvent(0),
   fStack(0),
   fOutputList(0),
@@ -86,6 +97,7 @@ AliAnalysisTaskEMCALIsoPhoton::AliAnalysisTaskEMCALIsoPhoton() :
   fTrMultDist(0),
   fMCDirPhotonPtEtaPhi(0),
   fMCIsoDirPhotonPtEtaPhi(0),
+  fMCDirPhotonPtEtIso(0),
   fDecayPhotonPtMC(0),
   fCellAbsIdVsAmpl(0),       
   fNClusHighClusE(0),
@@ -108,6 +120,10 @@ AliAnalysisTaskEMCALIsoPhoton::AliAnalysisTaskEMCALIsoPhoton() :
   fEmcNClusCut(0), 
   fNTracksECut(0), 
   fEmcNCellsCut(0),
+  fEmcClusETM1(0),
+  fEmcClusETM2(0),
+  fEmcClusNotExo(0),
+  fEmcClusEClusCuts(0),
   fEmcClusEPhi(0),    
   fEmcClusEPhiCut(0), 
   fEmcClusEEta(0),    
@@ -155,8 +171,19 @@ AliAnalysisTaskEMCALIsoPhoton::AliAnalysisTaskEMCALIsoPhoton(const char *name) :
   fMaxPtTrack(0),
   fMaxEClus(0),
   fNCells50(0),
+  fFilterBit(0),
+  fSelHybrid(kFALSE),
+  fFillQA(kFALSE),
+  fClusIdFromTracks(""),
+  fCpvFromTrack(kFALSE),
+  fNBinsPt(200),
+  fPtBinLowEdge(-0.25),
+  fPtBinHighEdge(99.75),
+  fNCuts(5),
+  fCuts(""),
   fESD(0),
   fAOD(0),
+  fVEvent(0),
   fMCEvent(0),
   fStack(0),
   fOutputList(0),
@@ -167,6 +194,7 @@ AliAnalysisTaskEMCALIsoPhoton::AliAnalysisTaskEMCALIsoPhoton(const char *name) :
   fTrMultDist(0),
   fMCDirPhotonPtEtaPhi(0),
   fMCIsoDirPhotonPtEtaPhi(0),
+  fMCDirPhotonPtEtIso(0),
   fDecayPhotonPtMC(0),
   fCellAbsIdVsAmpl(0),       
   fNClusHighClusE(0),   
@@ -189,6 +217,10 @@ AliAnalysisTaskEMCALIsoPhoton::AliAnalysisTaskEMCALIsoPhoton(const char *name) :
   fEmcNClusCut(0), 
   fNTracksECut(0), 
   fEmcNCellsCut(0),
+  fEmcClusETM1(0),
+  fEmcClusETM2(0),
+  fEmcClusNotExo(0),
+  fEmcClusEClusCuts(0),
   fEmcClusEPhi(0),    
   fEmcClusEPhiCut(0), 
   fEmcClusEEta(0),    
@@ -249,7 +281,12 @@ void AliAnalysisTaskEMCALIsoPhoton::UserCreateOutputObjects()
   fMCIsoDirPhotonPtEtaPhi->Sumw2();
   fOutputList->Add(fMCIsoDirPhotonPtEtaPhi);
 
-  fDecayPhotonPtMC = new TH1F("hDecayPhotonPtMC","decay photon p_{T};GeV/c;dN/dp_{T} (c GeV^{-1})",1000,0,100);
+  fMCDirPhotonPtEtIso = new TH2F("hMCDirPhotonPtEtIso",Form("photon (gq->#gammaq @MC) p_{T}, E_{T}^{ISO} (R=%1.1f);GeV/c;E_{T}^{ISO} GeV/c",fIsoConeR),100,-0.5,99.5,20,-0.25,9.75);
+  fMCDirPhotonPtEtIso->Sumw2();
+  fOutputList->Add(fMCDirPhotonPtEtIso);
+
+
+  fDecayPhotonPtMC = new TH1F("hDecayPhotonPtMC","decay photon p_{T};GeV/c;dN/dp_{T} (c GeV^{-1})",fNBinsPt, fPtBinLowEdge,fPtBinHighEdge);
   fDecayPhotonPtMC->Sumw2();
   fOutputList->Add(fDecayPhotonPtMC);
 
@@ -259,7 +296,7 @@ void AliAnalysisTaskEMCALIsoPhoton::UserCreateOutputObjects()
   fNClusHighClusE = new TH2F("hNClusHighClusE","total number of clusters vs. highest clus energy in the event;E (GeV);NClus",200,0,100,301,-0.5,300.5);
   fOutputList->Add(fNClusHighClusE);
 
-  fHigherPtConeM02 = new TH2F("hHigherPtConeM02","#lambda_{0}^{2} vs. in-cone-p_{T}^{max};p_{T}^{max} (GeV/c, in the cone);#lambda_{0}^{2}",1000,0,100,400,0,4);
+  fHigherPtConeM02 = new TH2F("hHigherPtConeM02","#lambda_{0}^{2} vs. in-cone-p_{T}^{max};p_{T}^{max} (GeV/c, in the cone);#lambda_{0}^{2}",fNBinsPt, fPtBinLowEdge,fPtBinHighEdge,400,0,4);
   fOutputList->Add(fHigherPtConeM02);
 
   fClusEtMcPt = new TH2F("hClusEtMcPt","E_{T}^{clus} vs. p_{T}^{mc}; p_{T}^{mc};E_{T}^{clus}",500,0,100,500,0,100);
@@ -283,22 +320,22 @@ void AliAnalysisTaskEMCALIsoPhoton::UserCreateOutputObjects()
   fMcPtInConeSBGnoUE  = new TH2F("hMcPtInConeSBGnoUE","#sum_{in-cone}p_{T}^{mc-primaries} vs. ISO^{TRK+EMC} (SBG range);ISO^{TRK+EMC} (GeV);#sum_{in-cone}p_{T}^{mc-primaries}",600,-10,50,1000,0,100);
   fOutputList->Add(fMcPtInConeSBGnoUE);
 
-  fAllIsoEtMcGamma  = new TH2F("hAllIsoEtMcGammaE","ISO^{TRK+EMC} vs. E_{T}^{clus} for clusters comming from a MC prompt #gamma; E_{T}^{clus} (GeV);ISO^{TRK+EMC} (GeV);",1000,0,100,600,-10,50);
+  fAllIsoEtMcGamma  = new TH2F("hAllIsoEtMcGammaE","ISO^{TRK+EMC} vs. E_{T}^{clus} for clusters comming from a MC prompt #gamma; E_{T}^{clus} (GeV);ISO^{TRK+EMC} (GeV);",fNBinsPt, fPtBinLowEdge,fPtBinHighEdge,600,-10,50);
   fOutputList->Add(fAllIsoEtMcGamma);
 
-  fAllIsoNoUeEtMcGamma  = new TH2F("hAllIsoNoUeEtMcGammaE","ISO^{TRK+EMC}_{noue} vs. E_{T}^{clus} for clusters comming from a MC prompt #gamma; E_{T}^{clus} (GeV);ISO^{TRK+EMC}_{noue} (GeV);",1000,0,100,600,-10,50);
+  fAllIsoNoUeEtMcGamma  = new TH2F("hAllIsoNoUeEtMcGammaE","ISO^{TRK+EMC}_{noue} vs. E_{T}^{clus} for clusters comming from a MC prompt #gamma; E_{T}^{clus} (GeV);ISO^{TRK+EMC}_{noue} (GeV);",fNBinsPt, fPtBinLowEdge,fPtBinHighEdge,600,-10,50);
   fOutputList->Add(fAllIsoNoUeEtMcGamma);
 
 
-  fMCDirPhotonPtEtaPhiNoClus = new TH3F("hMCDirPhotonPhiEtaNoClus","p_{T}, #eta and  #phi of prompt photons with no reco clusters;p_{T};#eta;#phi",1000,0,100,154,-0.77,0.77,130,1.38,3.20);
+  fMCDirPhotonPtEtaPhiNoClus = new TH3F("hMCDirPhotonPhiEtaNoClus","p_{T}, #eta and  #phi of prompt photons with no reco clusters;p_{T};#eta;#phi",fNBinsPt, fPtBinLowEdge,fPtBinHighEdge,154,-0.77,0.77,130,1.38,3.20);
   fOutputList->Add(fMCDirPhotonPtEtaPhiNoClus);
 
-  Int_t nEt=1000, nM02=400, nCeIso=1000, nTrIso=1000,  nAllIso=1000,  nCeIsoNoUE=1000,  nAllIsoNoUE=1000, nTrClDphi=200, nTrClDeta=100, nClEta=140, nClPhi=128, nTime=60, nMult=100, nPhoMcPt=100;
+  Int_t nEt=fNBinsPt, nM02=400, nCeIso=1000, nTrIso=1000,  nAllIso=1000,  nCeIsoNoUE=1000,  nAllIsoNoUE=1000, nTrClDphi=200, nTrClDeta=100, nClEta=140, nClPhi=128, nTime=60, nMult=100, nPhoMcPt=100;
   Int_t bins[] = {nEt, nM02, nCeIso, nTrIso, nAllIso, nCeIsoNoUE, nAllIsoNoUE, nTrClDphi, nTrClDeta,nClEta,nClPhi,nTime,nMult,nPhoMcPt};
   fNDimensions = sizeof(bins)/sizeof(Int_t);
   const Int_t ndims =   fNDimensions;
-  Double_t xmin[] = { -0.5,   0.,  -10.,   -10., -10., -10., -10., -0.1,-0.05, -0.7, 1.4,-0.15e-06,-0.5,-0.5};
-  Double_t xmax[] = { 99.5, 4., 190., 190., 190.,  190., 190., 0.1, 0.05, 0.7, 3.192, 0.15e-06,99.5,99.5};
+  Double_t xmin[] = { fPtBinLowEdge,   0.,  -10.,   -10., -10., -10., -10., -0.1,-0.05, -0.7, 1.4,-0.15e-06,-0.5,-0.5};
+  Double_t xmax[] = { fPtBinHighEdge, 4., 190., 190., 190.,  190., 190., 0.1, 0.05, 0.7, 3.192, 0.15e-06,99.5,99.5};
   if(fPeriod.Contains("11h")){
     xmax[12]=3999.5;
   }
@@ -328,33 +365,44 @@ void AliAnalysisTaskEMCALIsoPhoton::UserCreateOutputObjects()
   fEmcNCellsCut = new TH1F("fEmcNCellsCut",";n/event;count",120,-0.5,119.5);
   fEmcNCellsCut->Sumw2();
   fQAList->Add(fEmcNCellsCut);
-  fEmcClusEPhi = new TH2F("fEmcClusEPhi",";GeV;#phi",100,-0.25,49.75,63,0,6.3);    
+  fEmcClusETM1 = new TH1F("fEmcClusETM1","(method clus->GetTrackDx,z);GeV;counts",fNBinsPt, fPtBinLowEdge,fPtBinHighEdge);
+  fEmcClusETM1->Sumw2();
+  fQAList->Add(fEmcClusETM1);
+  fEmcClusETM2 = new TH1F("fEmcClusETM2","(method track->GetEMCALcluster());GeV;counts",fNBinsPt, fPtBinLowEdge,fPtBinHighEdge);
+  fEmcClusETM2->Sumw2();
+  fQAList->Add(fEmcClusETM2);
+  fEmcClusNotExo  = new TH1F("fEmcClusNotExo","exotics removed;GeV;counts",fNBinsPt, fPtBinLowEdge,fPtBinHighEdge);
+  fEmcClusNotExo->Sumw2();
+  fQAList->Add(fEmcClusNotExo);
+  fEmcClusEPhi = new TH2F("fEmcClusEPhi",";GeV;#phi",fNBinsPt, fPtBinLowEdge,fPtBinHighEdge,63,0,6.3);    
   fEmcClusEPhi->Sumw2();
   fQAList->Add(fEmcClusEPhi);
-  fEmcClusEPhiCut = new TH2F("fEmcClusEPhiCut",";GeV;#phi",100,-0.25,49.75,63,0,6.3); 
+  fEmcClusEPhiCut = new TH2F("fEmcClusEPhiCut",";GeV;#phi",fNBinsPt, fPtBinLowEdge,fPtBinHighEdge,63,0,6.3); 
   fEmcClusEPhiCut->Sumw2();
   fQAList->Add(fEmcClusEPhiCut);
-  fEmcClusEEta = new TH2F("fEmcClusEEta",";GeV;#eta",100,-0.25,49.75,19,-0.9,0.9);    
+  fEmcClusEEta = new TH2F("fEmcClusEEta",";GeV;#eta",fNBinsPt, fPtBinLowEdge,fPtBinHighEdge,19,-0.9,0.9);    
   fEmcClusEEta->Sumw2();
   fQAList->Add(fEmcClusEEta);
-  fEmcClusEEtaCut = new TH2F("fEmcClusEEtaCut",";GeV;#eta",100,-0.25,49.75,18,-0.9,0.9); 
+  fEmcClusEEtaCut = new TH2F("fEmcClusEEtaCut",";GeV;#eta",fNBinsPt, fPtBinLowEdge,fPtBinHighEdge,18,-0.9,0.9); 
   fEmcClusEEtaCut->Sumw2();
   fQAList->Add(fEmcClusEEtaCut);
-  fTrackPtPhi = new TH2F("fTrackPtPhi",";p_{T} [GeV/c];#phi",100,-0.25,49.75,63,0,6.3);     
+  fTrackPtPhi = new TH2F("fTrackPtPhi",";p_{T} [GeV/c];#phi",fNBinsPt, fPtBinLowEdge,fPtBinHighEdge,63,0,6.3);     
   fTrackPtPhi->Sumw2();
   fQAList->Add(fTrackPtPhi);
-  fTrackPtPhiCut = new TH2F("fTrackPtPhiCut",";p_{T} [GeV/c];#phi",100,-0.25,49.75,63,0,6.3);     
+  fTrackPtPhiCut = new TH2F("fTrackPtPhiCut",";p_{T} [GeV/c];#phi",fNBinsPt, fPtBinLowEdge,fPtBinHighEdge,63,0,6.3);     
   fTrackPtPhiCut->Sumw2();
   fQAList->Add(fTrackPtPhiCut);
-  fTrackPtEta = new TH2F("fTrackPtEta",";p_{T} [GeV/c];#eta",100,-0.25,49.75,18,-0.9,0.9);     
+  fTrackPtEta = new TH2F("fTrackPtEta",";p_{T} [GeV/c];#eta",fNBinsPt, fPtBinLowEdge,fPtBinHighEdge,18,-0.9,0.9);     
   fTrackPtEta->Sumw2();
   fQAList->Add(fTrackPtEta);
-  fTrackPtEtaCut = new TH2F("fTrackPtEtaCut",";p_{T} [GeV/c];#eta",100,-0.25,49.75,18,-0.9,0.9);     
+  fTrackPtEtaCut = new TH2F("fTrackPtEtaCut",";p_{T} [GeV/c];#eta",fNBinsPt, fPtBinLowEdge,fPtBinHighEdge,18,-0.9,0.9);     
   fTrackPtEtaCut->Sumw2();
   fQAList->Add(fTrackPtEtaCut);
+  fEmcClusEClusCuts = new TH2F("fEmcClusEClusCuts",";GeV;cut",fNBinsPt, fPtBinLowEdge,fPtBinHighEdge,fNCuts,-0.5,fNCuts-0.5);
+  fEmcClusEClusCuts->Sumw2();
+  fQAList->Add(fEmcClusEClusCuts);
 
-
-  fMaxCellEPhi = new TH2F("fMaxCellEPhi","Most energetic cell in event; GeV;#phi",100,-0.25,49.75,63,0,6.3); 
+  fMaxCellEPhi = new TH2F("fMaxCellEPhi","Most energetic cell in event; GeV;#phi",fNBinsPt, fPtBinLowEdge,fPtBinHighEdge,63,0,6.3); 
   fMaxCellEPhi->Sumw2();
   fQAList->Add(fMaxCellEPhi);
 
@@ -406,8 +454,8 @@ void AliAnalysisTaskEMCALIsoPhoton::UserExec(Option_t *)
     if(!filename.Contains(fPathStrOpt.Data()))
       return;
   }
-  AliVEvent *event = (AliVEvent*)InputEvent();
-  if (!event) {
+  fVEvent = (AliVEvent*)InputEvent();
+  if (!fVEvent) {
     printf("ERROR: event not available\n");
     return;
   }
@@ -415,9 +463,9 @@ void AliAnalysisTaskEMCALIsoPhoton::UserExec(Option_t *)
   if(fDebug)
     printf("run number = %d\n",runnumber);
 
-  fESD = dynamic_cast<AliESDEvent*>(event);
+  fESD = dynamic_cast<AliESDEvent*>(fVEvent);
   if(!fESD){
-    fAOD = dynamic_cast<AliAODEvent*>(event);
+    fAOD = dynamic_cast<AliAODEvent*>(fVEvent);
     if(!fAOD){
       printf("ERROR: Invalid type of event!!!\n");
       return;
@@ -431,12 +479,16 @@ void AliAnalysisTaskEMCALIsoPhoton::UserExec(Option_t *)
     printf("event is ok,\n run number=%d\n",runnumber);
 
   
-  AliVVertex *pv = (AliVVertex*)event->GetPrimaryVertex();
+  AliVVertex *pv = (AliVVertex*)fVEvent->GetPrimaryVertex();
   Bool_t pvStatus = kTRUE;
   if(fESD){
     AliESDVertex *esdv = (AliESDVertex*)fESD->GetPrimaryVertex();
     pvStatus = esdv->GetStatus();
   }
+  /*if(fAOD){
+    AliAODVertex *aodv = (AliAODVertex*)fAOD->GetPrimaryVertex();
+    pvStatus = aodv->GetStatus();
+    }*/
   if(!pv)
     return;
   if(!pvStatus)
@@ -444,7 +496,7 @@ void AliAnalysisTaskEMCALIsoPhoton::UserExec(Option_t *)
   else
     fRecoPV->Fill(1);
   fPVtxZ->Fill(pv->GetZ());
-  if(TMath::Abs(pv->GetZ())>15)
+  if(TMath::Abs(pv->GetZ())>10)
     return;
   if(fDebug)
     printf("passed vertex cut\n");
@@ -471,13 +523,18 @@ void AliAnalysisTaskEMCALIsoPhoton::UserExec(Option_t *)
       continue;
     AliAODTrack *aodTrack = dynamic_cast<AliAODTrack*>(track);
     AliESDtrack *esdTrack = dynamic_cast<AliESDtrack*>(track);
-    if (esdTrack && fPrTrCuts && fPrTrCuts->IsSelected(track)){
-      fSelPrimTracks->Add(track);
-      /*if(fTrackMaxPt<track->Pt())
-       fTrackMaxPt = track->Pt();*/
-      //printf("pt,eta,phi:%1.1f,%1.1f,%1.1f \n",track->Pt(),track->Eta(), track->Phi());
+    if(esdTrack){
+      if(esdTrack->GetEMCALcluster()>0)
+       fClusIdFromTracks.Append(Form("%d ",esdTrack->GetEMCALcluster()));
+      if (fPrTrCuts && fPrTrCuts->IsSelected(track)){
+       fSelPrimTracks->Add(track);
+      }
     }
     else if(aodTrack){
+      if (fSelHybrid && !aodTrack->IsHybridGlobalConstrainedGlobal())       
+       continue ;
+      if(!fSelHybrid && !aodTrack->TestFilterBit(fFilterBit))
+       continue;
       fSelPrimTracks->Add(track);
       /*if(fTrackMaxPt<track->Pt())
        fTrackMaxPt = track->Pt();*/
@@ -491,7 +548,7 @@ void AliAnalysisTaskEMCALIsoPhoton::UserExec(Option_t *)
     /*if(fESD)
       fGeom->SetMisalMatrix(fESD->GetEMCALMatrix(mod), mod);
       else*/
-    // if(event->GetEMCALMatrix(mod))
+    // if(fVEvent->GetEMCALMatrix(mod))
     fGeomMatrix[mod] = (TGeoHMatrix*) matEMCAL->At(mod);
     fGeom->SetMisalMatrix(fGeomMatrix[mod] , mod);
   }
@@ -544,7 +601,8 @@ void AliAnalysisTaskEMCALIsoPhoton::UserExec(Option_t *)
   FillMcHists();
   if(fDebug)
     printf("passed calling of FillMcHists\n");
-  FillQA();
+  if(fFillQA)
+    FillQA();
   if(fDebug)
     printf("passed calling of FillQA\n");
   /*if(fESD)
@@ -552,6 +610,7 @@ void AliAnalysisTaskEMCALIsoPhoton::UserExec(Option_t *)
   fSelPrimTracks->Clear();
   fNClusForDirPho = 0;
   fNCells50 = 0;
+  fClusIdFromTracks = "";
 
   PostData(1, fOutputList);
   PostData(2, fQAList);
@@ -595,11 +654,14 @@ void AliAnalysisTaskEMCALIsoPhoton::FillClusHists()
       continue;
     if(c->E()<fECut)
       continue;
+    if(fCpvFromTrack && fClusIdFromTracks.Contains(Form("%d",ic)))
+       continue;
+    if(IsExotic(c))
+      continue;
     Short_t id;
     Double_t Emax = GetMaxCellEnergy( c, id);
-    Double_t Ecross = GetCrossEnergy( c, id);
-    if((1-Ecross/Emax)>fExoticCut)
-      continue;
+    if(fDebug)
+      printf("cluster max cell E=%1.1f",Emax);
     Float_t clsPos[3] = {0,0,0};
     c->GetPosition(clsPos);
     TVector3 clsVec(clsPos);
@@ -610,7 +672,7 @@ void AliAnalysisTaskEMCALIsoPhoton::FillClusHists()
       nclus10++;
     Float_t ceiso, cephiband, cecore;
     Float_t triso, trphiband, trcore;
-    Float_t alliso, allphiband, allcore;
+    Float_t alliso, allphiband;//, allcore;
     Float_t phibandArea = (1.4 - 2*fIsoConeR)*2*fIsoConeR;
     Float_t netConeArea = TMath::Pi()*(fIsoConeR*fIsoConeR - 0.04*0.04);
     GetCeIso(clsVec, id, ceiso, cephiband, cecore);
@@ -623,7 +685,7 @@ void AliAnalysisTaskEMCALIsoPhoton::FillClusHists()
     }
     alliso = ceiso + triso;
     allphiband = cephiband + trphiband;
-    allcore = cecore + trcore;
+    //allcore = cecore + trcore;
     Float_t ceisoue =  cephiband/phibandArea*netConeArea;
     Float_t trisoue =  trphiband/phibandArea*netConeArea;
     Float_t allisoue =  allphiband/phibandArea*netConeArea;
@@ -655,8 +717,16 @@ void AliAnalysisTaskEMCALIsoPhoton::FillClusHists()
     outputValues[4] = alliso/*cecore*/-allisoue - trcore;
     outputValues[5] = ceiso;
     outputValues[6] = alliso - trcore;
-    outputValues[7] = c->GetTrackDx();
-    outputValues[8] = c->GetTrackDz();
+    if(fDebug)
+      printf("track-cluster dphi=%1.3f, deta=%1.3f\n",c->GetTrackDx(),c->GetTrackDz());
+    if(TMath::Abs(c->GetTrackDx())<0.1)
+      outputValues[7] = c->GetTrackDx();
+    else
+      outputValues[7] = 0.099*c->GetTrackDx()/TMath::Abs(c->GetTrackDx());
+    if(TMath::Abs(c->GetTrackDz())<0.05)
+      outputValues[8] = c->GetTrackDz();
+    else
+      outputValues[8] = 0.049*c->GetTrackDz()/TMath::Abs(c->GetTrackDz());
     outputValues[9] = clsVec.Eta();
     outputValues[10] = clsVec.Phi();
     if(fESDCells)
@@ -908,11 +978,15 @@ void AliAnalysisTaskEMCALIsoPhoton ::FillMcHists()
     if(!mcmom)
       continue;
     Int_t pdgMom = mcmom->GetPdgCode();
+    Double_t mcphi = mcp->Phi();
+    Double_t mceta = mcp->Eta();
     if((imom==6 || imom==7) && pdgMom==22) {
       fMCDirPhotonPtEtaPhi->Fill(mcp->Pt(),mcp->Eta(),mcp->Phi());
       Float_t ptsum = GetMcPtSumInCone(mcp->Eta(), mcp->Phi(), fIsoConeR);
       if(ptsum<2)
        fMCIsoDirPhotonPtEtaPhi->Fill(mcp->Pt(),mcp->Eta(),mcp->Phi());
+      if(mcphi<(3.14-fIsoConeR) && mcphi>(1.4+fIsoConeR) && TMath::Abs(mceta)<(0.7-fIsoConeR))
+       fMCDirPhotonPtEtIso->Fill(mcp->Pt(),ptsum);
       if(fNClusForDirPho==0)
        fMCDirPhotonPtEtaPhiNoClus->Fill(mcp->Pt(),mcp->Eta(),mcp->Phi());
       if(fDebug){
@@ -1078,12 +1152,25 @@ Float_t AliAnalysisTaskEMCALIsoPhoton::GetMcPtSumInCone(Float_t etaclus, Float_t
 //________________________________________________________________________
 void AliAnalysisTaskEMCALIsoPhoton::FillQA() 
 {
+
+  TObjArray *clusters = fESDClusters;
+  //"none", "exotic", "exo+cpv1", "exo+cpv1+time", "exo+cpv1+time+m02"),
+  TString cuts[] = {"none", "exotic", "exo+cpv1", "exo+cpv1+time", "exo+cpv1+time+m02"};
+  if (!clusters){
+    clusters = fAODClusters;
+    if(fDebug)
+      printf("ESD clusters empty...");
+  }
+  if (!clusters){
+    if(fDebug)
+      printf("  and AOD clusters as well!!!\n"); 
+    return;
+  }
   if(!fSelPrimTracks)
     return;
   const int ntracks = fSelPrimTracks->GetEntriesFast();
   const int ncells = fNCells50;//fESDCells->GetNumberOfCells();
-  const Int_t nclus = fESDClusters->GetEntries();
-
+  const Int_t nclus = clusters->GetEntries();
   fNTracks->Fill(ntracks);
   fEmcNCells->Fill(ncells);
   fEmcNClus->Fill(nclus);
@@ -1104,8 +1191,8 @@ void AliAnalysisTaskEMCALIsoPhoton::FillQA()
     }
   }
   for(int ic=0;ic<nclus;ic++){
-    AliVCluster *c = dynamic_cast<AliVCluster*>(fESDClusters->At(ic));
-    //AliESDCaloCluster *c = (AliESDCaloCluster*)fESDClusters->At(ic);
+    AliVCluster *c = dynamic_cast<AliVCluster*>(clusters->At(ic));
+    //AliESDCaloCluster *c = (AliESDCaloCluster*)clusters->At(ic);
     if(!c)
       continue;
     if(!c->IsEMCAL())
@@ -1115,12 +1202,36 @@ void AliAnalysisTaskEMCALIsoPhoton::FillQA()
     TVector3 clsVec(clsPos);
     Double_t cphi = clsVec.Phi();
     Double_t ceta = clsVec.Eta();
+    Short_t id;
+    GetMaxCellEnergy( c, id);
+    fEmcClusEClusCuts->Fill(c->E(),cuts[0],1);
     fEmcClusEPhi->Fill(c->E(), cphi);
     fEmcClusEEta->Fill(c->E(), ceta);
     if(fMaxEClus>fECut){
       fEmcClusEPhiCut->Fill(c->E(), cphi);
       fEmcClusEEtaCut->Fill(c->E(), ceta);
     }
+    Double_t maxt=0;
+    if(fESDCells)
+      maxt = fESDCells->GetCellTime(id);
+    else if(fAODCells)
+      maxt = fAODCells->GetCellTime(id);
+    if(IsExotic(c))
+      continue;
+    fEmcClusNotExo->Fill(c->E());
+    fEmcClusEClusCuts->Fill(c->E(),cuts[1],1);
+    if(fClusIdFromTracks.Contains(Form("%d",ic)))
+      fEmcClusETM2->Fill(c->E());
+    if(TMath::Abs(c->GetTrackDx())<0.03 && TMath::Abs(c->GetTrackDz())<0.02){
+      fEmcClusETM1->Fill(c->E());
+      continue;
+    }
+    fEmcClusEClusCuts->Fill(c->E(),cuts[2],1);
+    if(TMath::Abs(maxt)>30e-9)
+      continue;
+    fEmcClusEClusCuts->Fill(c->E(),cuts[3],1);
+    if(c->GetM02()>0.1)
+      fEmcClusEClusCuts->Fill(c->E(),cuts[4],1);
   }
 }
 //________________________________________________________________________
@@ -1179,6 +1290,17 @@ void AliAnalysisTaskEMCALIsoPhoton::LoopOnCells()
 
 }
 //________________________________________________________________________
+bool AliAnalysisTaskEMCALIsoPhoton::IsExotic(AliVCluster *c)
+{
+  bool isExo = 0;
+  Short_t id;
+  Double_t Emax = GetMaxCellEnergy( c, id);
+  Double_t Ecross = GetCrossEnergy( c, id);
+  if((1-Ecross/Emax)>fExoticCut)
+    isExo = 1;
+  return isExo;
+}
+//________________________________________________________________________
 void AliAnalysisTaskEMCALIsoPhoton::Terminate(Option_t *) 
 {
   // Called once at the end of the query.