]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
making FillQA consistent with AOD
authormcosenti <mcosenti@cern.ch>
Tue, 22 Apr 2014 13:53:17 +0000 (10:53 -0300)
committermcosenti <mcosenti@cern.ch>
Tue, 22 Apr 2014 14:07:42 +0000 (11:07 -0300)
PWGGA/EMCALTasks/AliAnalysisTaskEMCALIsoPhoton.cxx
PWGGA/EMCALTasks/AliAnalysisTaskEMCALIsoPhoton.h

index a352eef3eeb103c89ca4f8263530a67b2ef5cdd3..5164fb709d1467037baf9470d993c9042b6af177 100644 (file)
@@ -78,6 +78,7 @@ AliAnalysisTaskEMCALIsoPhoton::AliAnalysisTaskEMCALIsoPhoton() :
   fSelHybrid(kFALSE),
   fESD(0),
   fAOD(0),
+  fVEvent(0),
   fMCEvent(0),
   fStack(0),
   fOutputList(0),
@@ -161,6 +162,7 @@ AliAnalysisTaskEMCALIsoPhoton::AliAnalysisTaskEMCALIsoPhoton(const char *name) :
   fSelHybrid(kFALSE),
   fESD(0),
   fAOD(0),
+  fVEvent(0),
   fMCEvent(0),
   fStack(0),
   fOutputList(0),
@@ -410,8 +412,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;
   }
@@ -419,9 +421,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;
@@ -435,7 +437,7 @@ 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();
@@ -499,7 +501,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);
   }
@@ -552,7 +554,7 @@ void AliAnalysisTaskEMCALIsoPhoton::UserExec(Option_t *)
   FillMcHists();
   if(fDebug)
     printf("passed calling of FillMcHists\n");
-  if(fESD)
+  //if(fESD)
     FillQA();
   if(fDebug)
     printf("passed calling of FillQA\n");
@@ -1087,11 +1089,24 @@ Float_t AliAnalysisTaskEMCALIsoPhoton::GetMcPtSumInCone(Float_t etaclus, Float_t
 //________________________________________________________________________
 void AliAnalysisTaskEMCALIsoPhoton::FillQA() 
 {
+
+  TObjArray *clusters = fESDClusters;
+
+  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);
@@ -1113,8 +1128,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())
index 09a36862c83f61054c2f9413103ba67e0d35ad2d..c6e489fc58154b3149de1c7196643cafe6622e9d 100644 (file)
@@ -104,6 +104,7 @@ class AliAnalysisTaskEMCALIsoPhoton : public AliAnalysisTaskSE {
  private:
   AliESDEvent *fESD;      //! ESD object
   AliAODEvent *fAOD;      //! AOD object
+  AliVEvent   *fVEvent;   //! AliVEvent
   AliMCEvent  *fMCEvent;  //! MC event object
   AliStack    *fStack;    //!MC particles stack object
   TGeoHMatrix *fGeomMatrix[12];//! Geometry misalignment matrices for EMCal