AliAODEvent::GetHeader() returns AliVHeader
authormfloris <michele.floris@cern.ch>
Wed, 3 Sep 2014 20:03:47 +0000 (22:03 +0200)
committerhristov <Peter.Hristov@cern.ch>
Mon, 27 Oct 2014 12:45:49 +0000 (13:45 +0100)
Transition completed, added dynamic or c-style casts where needed

103 files changed:
ANALYSIS/AliAnalysisUtils.cxx
ANALYSIS/AliCentralitySelectionTask.cxx
ANALYSIS/AliEPSelectionTask.cxx
ANALYSIS/ESDfilter/AliAnalysisTaskESDfilter.cxx
MUON/AliMUONAlignmentTask.cxx
PWG/DevNanoAOD/AliAnalysisNanoAODCuts.cxx
PWG/EMCAL/AliAnalysisTaskEMCALClusterizeFast.cxx
PWG/EMCAL/AliAnalysisTaskEmcal.cxx
PWG/EMCAL/AliEmcalPhysicsSelection.cxx
PWG/FLOW/Tasks/AliAnalysisTaskFlowEPCascade.cxx
PWG/FLOW/Tasks/AliAnalysisTaskFlowEventforRP.cxx
PWG/FLOW/Tasks/AliAnalysisTaskFlowStrange.cxx
PWG/FLOW/Tasks/AliFlowEventCuts.cxx
PWG/muon/AliAODMuonReplicator.cxx
PWG/muon/AliAnalysisMuonUtility.cxx
PWG/muon/AliAnalysisTaskCreateMixedDimuons.cxx
PWG/muon/AliAnalysisTaskESDMuonFilter.cxx
PWG/muon/AliAnalysisTaskLinkToMC.cxx
PWG/muon/AliAnalysisTaskMuonAODfromGeneral.cxx
PWGCF/Correlations/Base/AliAnalyseLeadingTrackUE.cxx
PWGCF/Correlations/DPhi/AliAnalysisTask3PCorrelations.cxx
PWGCF/Correlations/DPhi/AliAnalysisTaskContMC.cxx
PWGCF/Correlations/DPhi/AliAnalysisTaskDiHadron.cxx
PWGCF/Correlations/DPhi/AliAnalysisTaskDptDptCorrelations.cxx
PWGCF/Correlations/DPhi/AliAnalysisTaskDptDptQA.cxx
PWGCF/Correlations/DPhi/AliAnalysisTaskLongRangeCorrelations.cxx
PWGCF/Correlations/DPhi/AliAnalysisTaskMinijet.cxx
PWGCF/Correlations/DPhi/AliAnalysisTaskPhiCorrelations.cxx
PWGCF/Correlations/DPhi/AliAnalysisTaskTwoPlusOne.cxx
PWGCF/Correlations/DPhi/AliDptDptInMC.cxx
PWGCF/Correlations/DPhi/AliLeadingV0Correlation.cxx
PWGCF/Correlations/DPhi/DiHadronPID/AliAODEventCutsDiHadronPID.cxx
PWGCF/Correlations/DPhi/FourierDecomposition/AliDhcTask.cxx
PWGCF/Correlations/DPhi/MuonHadron/AliAnalysisTaskDiMuonCorrelations.cxx
PWGCF/Correlations/DPhi/MuonHadron/AliAnalysisTaskMuonHadronCorrelations.cxx
PWGCF/Correlations/DPhi/TriggerPID/AliTwoParticlePIDCorr.cxx
PWGCF/EBYE/BalanceFunctions/AliAnalysisTaskBF.cxx
PWGCF/EBYE/BalanceFunctions/AliAnalysisTaskEventMixingBF.cxx
PWGCF/EBYE/Fluctuations/AliEbyEHigherMomentsEffContTask.cxx
PWGCF/EBYE/Fluctuations/AliEbyEHigherMomentsTask.cxx
PWGCF/EBYE/Fluctuations/AliEbyEHigherMomentsTaskPID.cxx
PWGCF/EBYE/Fluctuations/AliEbyEMultFluctuationTask.cxx
PWGCF/EBYE/Fluctuations/AliHigherMomentsToyModel.cxx
PWGCF/EBYE/NetParticle/AliAnalysisNetParticleHelper.cxx
PWGCF/EBYE/NetParticle/AliAnalysisTaskNetParticle.cxx
PWGCF/EBYE/PIDFluctuation/task/AliEbyEParticleRatioFluctuationTask.cxx
PWGCF/EBYE/PIDFluctuation/task/AliEbyEPidTTask.cxx
PWGCF/EBYE/PIDFluctuation/task/AliEbyEPidTTaskMC.cxx
PWGCF/FEMTOSCOPY/AliFemto/AliAnalysisTaskFemto.cxx
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderAOD.cxx
PWGCF/FEMTOSCOPY/AliFemto/AliFemtoEventReaderStandard.cxx
PWGCF/FEMTOSCOPY/AliFemtoUser/AliAnalysisTaskParticleEfficiency.cxx
PWGCF/FEMTOSCOPYAOD/AliAnalysisTaskPWG2ESDfilter.cxx
PWGDQ/dielectron/AliAnalysisTaskDielectronFilter.cxx
PWGDQ/dielectron/AliAnalysisTaskReducedTree.cxx
PWGDQ/dielectron/AliDielectronVarManager.h
PWGGA/CaloTasks/AliAnalysisTaskCaloFilter.cxx
PWGGA/EMCALTasks/AliAnalysisTaskEMCALClusterize.cxx
PWGGA/EMCALTasks/AliAnalysisTaskEMCALPi0PbPb.cxx
PWGGA/GammaConv/AliConvEventCuts.cxx
PWGGA/GammaConv/AliConversionCuts.cxx
PWGGA/PHOSTasks/PHOS_embedding/AliAnalysisTaskPi0DiffEfficiency.cxx
PWGGA/PHOSTasks/PHOS_embedding/AliAnalysisTaskPi0Efficiency.cxx
PWGGA/PHOSTasks/PHOS_embedding/AliPHOSEmbedding.cxx
PWGHF/correlationHF/AliAnalysisTaskDStarCorrelations.cxx
PWGHF/correlationHF/AliAnalysisTaskDxHFECorrelation.cxx
PWGHF/correlationHF/AliDxHFECorrelation.cxx
PWGHF/correlationHF/AliHFCorrelator.cxx
PWGHF/hfe/AliAnalysisTaskEMCalHFEpA.cxx
PWGHF/hfe/AliAnalysisTaskHFEemcQA.cxx
PWGHF/vertexingHF/AliAnalysisTaskSEHFQA.cxx
PWGHF/vertexingHF/AliRDHFCuts.cxx
PWGJE/AliAnalysisTaskAj.cxx
PWGJE/AliAnalysisTaskFragmentationFunction.cxx
PWGJE/AliAnalysisTaskJetCore.cxx
PWGJE/AliAnalysisTaskJetCorePP.cxx
PWGJE/AliAnalysisTaskJetServices.cxx
PWGJE/AliAnalysisTaskJetSpectrum2.cxx
PWGJE/AliAnalysisTaskPartonDisc.cxx
PWGJE/AliPWG4HighPtTrackQA.cxx
PWGJE/StrangenessInJets/AliAnalysisTaskJetChem.cxx
PWGJE/StrangenessInJets/AliAnalysisTaskV0sInJets.cxx
PWGJE/UserTasks/AliAnalysisTaskIDFFTCF.cxx
PWGJE/UserTasks/AliAnalysisTaskIDFragmentationFunction.cxx
PWGJE/UserTasks/AliAnalysisTaskJetAntenna.cxx
PWGJE/UserTasks/AliAnalysisTaskJetShape.cxx
PWGJE/UserTasks/AliAnalysisTaskPPJetSpectra.cxx
PWGLF/FORWARD/analysis2/AliBasedNdetaTask.cxx
PWGLF/FORWARD/analysis2/AliCopyHeaderTask.cxx
PWGLF/RESONANCES/AliRsnMiniAnalysisTask.cxx
PWGLF/SPECTRA/Nuclei/B2/AliAnalysisTaskB2AOD.cxx
PWGLF/SPECTRA/PiKaPr/TestAOD/AliSpectraAODEventCuts.cxx
PWGLF/SPECTRA/PiKaPr/TestAOD/AliSpectraBothEventCuts.cxx
PWGLF/STRANGENESS/Correlations/AliAnalysisTaskV0ChCorrelations.cxx
PWGLF/STRANGENESS/Hypernuclei/AliAODMCNuclExReplicator.cxx
PWGLF/STRANGENESS/Hypernuclei/AliAODNuclExReplicator.cxx
PWGLF/STRANGENESS/Hypernuclei/AliAnalysisTaskReadNuclexAOD.cxx
PWGPP/EvTrkSelection/AliCFSingleTrackEfficiencyTask.cxx
PWGPP/ITS/AliAnalysisTaskSEImpParRes.cxx
PWGUD/UPC/AliAnalysisTaskUpcK0sK0s.cxx
STEER/AOD/AliNanoAODHeader.h
STEER/STEERBase/AliVAODHeader.h
STEER/STEERBase/AliVHeader.h

index 8890165..15fef1d 100644 (file)
@@ -114,7 +114,8 @@ Bool_t AliAnalysisUtils::IsFirstEventInChunk(AliVEvent *event)
 
   if(fisAOD){
     AliAODHeader *aodheader = 0x0;
-    aodheader = aod->GetHeader();
+    aodheader = dynamic_cast<AliAODHeader*>(aod->GetHeader());
+    if(!aodheader) AliFatal("Not a standard AOD");
     if(!aodheader){
       AliFatal("AOD header not there ?!");
       return kFALSE;
@@ -216,11 +217,11 @@ Bool_t AliAnalysisUtils::IsOutOfBunchPileUp(AliVEvent *event)
     AliFatal("Event is neither of AOD nor ESD type");
     return kFALSE;
   }
-  Int_t bc2 = (aod)?aod->GetHeader()->GetIRInt2ClosestInteractionMap():esd->GetHeader()->GetIRInt2ClosestInteractionMap();
+  Int_t bc2 = (aod)?((AliVAODHeader*)aod->GetHeader())->GetIRInt2ClosestInteractionMap():esd->GetHeader()->GetIRInt2ClosestInteractionMap();
   if (bc2 != 0)
     return kTRUE;
   
-  Int_t bc1 = (aod)?aod->GetHeader()->GetIRInt1ClosestInteractionMap():esd->GetHeader()->GetIRInt1ClosestInteractionMap();
+  Int_t bc1 = (aod)?((AliVAODHeader*)aod->GetHeader())->GetIRInt1ClosestInteractionMap():esd->GetHeader()->GetIRInt1ClosestInteractionMap();
   if (bc1 != 0)
     return kTRUE;
   
index bb06834..75c0e8f 100644 (file)
@@ -1444,7 +1444,8 @@ void AliCentralitySelectionTask::UserExec(Option_t */*option*/)
     //nTracks    = event->GetNumberOfTracks();     
     nTracks    = fTrackCuts ? (Short_t)fTrackCuts->GetReferenceMultiplicity(esd,kTRUE):-1;
   } else {
-    AliAODHeader *h = aod->GetHeader();
+    AliAODHeader *h = dynamic_cast<AliAODHeader*>(aod->GetHeader());
+    if(!h) AliFatal("Not a standard AOD");
     nTracks    = h!=0 ? (Short_t)h->GetTPConlyRefMultiplicity():-1;
   }
 
@@ -1493,7 +1494,8 @@ void AliCentralitySelectionTask::UserExec(Option_t */*option*/)
   } else {
     AliAODTracklets *mult = aod->GetTracklets();
     nTracklets = mult->GetNumberOfTracklets();
-    AliAODHeader *h = aod->GetHeader();
+    AliAODHeader *h = dynamic_cast<AliAODHeader*>(aod->GetHeader());
+    if(!h) AliFatal("Not a standard AOD");
     for(Int_t ilay=0; ilay<6; ilay++){
       nClusters[ilay] = h->GetNumberOfITSClusters(ilay);
     }
@@ -1580,7 +1582,8 @@ void AliCentralitySelectionTask::UserExec(Option_t */*option*/)
     if (zpcFired) zpcTower = ZPCtower[0];
 
   } else {
-    AliAODHeader *h = aod->GetHeader();
+    AliAODHeader *h = dynamic_cast<AliAODHeader*>(aod->GetHeader());
+    if(!h) AliFatal("Not a standard AOD");
     zncEnergy  = (Float_t) (h->GetZDCN1Energy());
     zpcEnergy  = (Float_t) (h->GetZDCP1Energy());
     znaEnergy  = (Float_t) (h->GetZDCN2Energy());
index 601035b..cf7bd3e 100644 (file)
@@ -365,7 +365,9 @@ void AliEPSelectionTask::UserExec(Option_t */*option*/)
        if (headerH) fRP = headerH->GetReactionPlaneAngle();
       }
   
-      esdEP = aod->GetHeader()->GetEventplaneP();
+      AliAODHeader * header = dynamic_cast<AliAODHeader*>(aod->GetHeader());
+      if(!header) AliFatal("Not a standard AOD");
+      esdEP = header->GetEventplaneP();
       if(!esdEP) return; // protection against missing EP branch (nanoAODs)
       esdEP->Reset(); 
      
index 24c0dd6..5e1d52d 100644 (file)
@@ -367,7 +367,8 @@ AliAODHeader* AliAnalysisTaskESDfilter::ConvertHeader(const AliESDEvent& esd)
 
   AliCodeTimerAuto("",0);
   
-  AliAODHeader* header = AODEvent()->GetHeader();
+  AliAODHeader* header = dynamic_cast<AliAODHeader*>(AODEvent()->GetHeader());
+  if(!header) AliFatal("Not a standard AOD");
   
   header->SetRunNumber(esd.GetRunNumber());
   header->SetOfflineTrigger(fInputHandler->IsEventSelected()); // propagate the decision of the physics selection
index 08e96aa..dc09612 100644 (file)
@@ -364,7 +364,8 @@ void AliMUONAlignmentTask::UserExec(Option_t *)
       if( handler )
       {
         AliAODEvent* aod = handler->GetAOD();
-        AliAODHeader* header = aod->GetHeader();
+        AliAODHeader* header = dynamic_cast<AliAODHeader*>(aod->GetHeader());
+        if(!header) AliFatal("Not a standard AOD");
         header->SetRunNumber(lESD->GetRunNumber());
         AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()->SetFillAOD(kTRUE);
 
index 72dd3c1..ae5b4e8 100644 (file)
@@ -51,9 +51,12 @@ Bool_t AliAnalysisNanoAODEventCuts::IsSelected(TObject* obj)
 
 
 void AliNanoAODSimpleSetter::SetNanoAODHeader(const AliAODEvent * event   , AliNanoAODHeader * head  ) {
+
+  AliAODHeader * header = dynamic_cast<AliAODHeader*>(event->GetHeader());
+  if (!header) AliFatal("Not a standard AOD");
   // Set custom nano aod vars
-  Double_t centr    = event->GetHeader()->GetCentralityP()->GetCentralityPercentile("V0M");
-  Double_t magfield = event->GetHeader()->GetMagneticField();
+  Double_t centr    = header->GetCentralityP()->GetCentralityPercentile("V0M");
+  Double_t magfield = header->GetMagneticField();
   head->SetVar(0, centr);
   head->SetVar(1, magfield);
 
index 1e30462..6a78c61 100644 (file)
@@ -223,7 +223,7 @@ void AliAnalysisTaskEMCALClusterizeFast::UserExec(Option_t *)
     AliAnalysisManager *am = AliAnalysisManager::GetAnalysisManager();
     offtrigger = ((AliInputEventHandler*)(am->GetInputEventHandler()))->IsEventSelected();
   } else {
-    offtrigger =  fAod->GetHeader()->GetOfflineTrigger();
+    offtrigger =  ((AliVAODHeader*)fAod->GetHeader())->GetOfflineTrigger();
   }
 
   if (!MCEvent()) {
@@ -829,7 +829,8 @@ void AliAnalysisTaskEMCALClusterizeFast::Init()
         if (fEsd) {
           gm = fEsd->GetEMCALMatrix(mod);
         } else {
-          AliAODHeader *aodheader = fAod->GetHeader();
+          AliAODHeader *aodheader = dynamic_cast<AliAODHeader*>(fAod->GetHeader());
+          if(!aodheader) AliFatal("Not a standard AOD");
           if (aodheader) {
             gm = aodheader->GetEMCALMatrix(mod);
           }
index 06ed828..46a9cbc 100644 (file)
@@ -782,7 +782,7 @@ Bool_t AliAnalysisTaskEmcal::IsEventSelected()
     } else {
       const AliAODEvent *aev = dynamic_cast<const AliAODEvent*>(InputEvent());
       if (aev) {
-        res = aev->GetHeader()->GetOfflineTrigger();
+        res = ((AliVAODHeader*)aev->GetHeader())->GetOfflineTrigger();
       }
     }
     if ((res & fOffTrigger) == 0) {
index d194f07..a7e68ce 100644 (file)
@@ -56,14 +56,14 @@ UInt_t AliEmcalPhysicsSelection::GetSelectionMask(const TObject* obj)
     am->LoadBranch("AliESDRun.");
     TString title(eev->GetHeader()->GetTitle());
     if (1&&(title.Length()>0)) {
-      res = eev->GetHeader()->GetUniqueID();
+      res = ((AliVAODHeader*)eev->GetHeader())->GetUniqueID();
       res &= 0x4FFFFFFF;
     } else {
       res = IsCollisionCandidate(eev); 
     }
   } else {
     aev = dynamic_cast<const AliAODEvent*>(obj);
-    res = aev->GetHeader()->GetOfflineTrigger();
+    res = ((AliVAODHeader*)aev->GetHeader())->GetOfflineTrigger();
   }
 
   // return 0, if 0 found
index 81d4263..fed211d 100644 (file)
@@ -768,7 +768,8 @@ void AliAnalysisTaskFlowEPCascade::UserExec(Option_t *)
 
     //At the momment the cutting class does not handle AOD event properly
     //so we are doing the cuts explicitly here
-    AliAODHeader *aodHeader = fAOD->GetHeader();
+    AliAODHeader *aodHeader = dynamic_cast<AliAODHeader*>(fAOD->GetHeader());
+    if(!aodHeader) AliFatal("Not a standard AOD");
     if(!aodHeader) return;
     AliCentrality *centrality = aodHeader->GetCentralityP();
     if(!centrality) return;
@@ -1433,7 +1434,7 @@ void AliAnalysisTaskFlowEPCascade::ReadFromESDv0(AliESDEvent *fESD){
 
 void AliAnalysisTaskFlowEPCascade::ReadFromAODv0(AliAODEvent *fAOD){
 
-  AliEventplane * ep = (fAOD->GetHeader())->GetEventplaneP();
+  AliEventplane * ep = ((AliVAODHeader*)fAOD->GetHeader())->GetEventplaneP();
   Double_t psiTPC = ep->GetEventplane("Q", fAOD, 2); // in range of [0, pi]
   //  if(psiTPC > TMath::PiOver2()) 
   //  psiTPC -= TMath::Pi();
index 2c6ffcc..f294786 100644 (file)
@@ -192,7 +192,8 @@ void AliAnalysisTaskFlowEventforRP::UserExec(Option_t *)
 
     
     // Update the header
-    AliAODHeader* header = AODEvent()->GetHeader();
+    AliAODHeader* header = dynamic_cast<AliAODHeader*>(AODEvent()->GetHeader());
+    if(!header) AliFatal("Not a standard AOD");
     header->SetRunNumber(esd->GetRunNumber());
     header->SetQTheta(dRP,1);
         
index bc2e95e..e502a60 100644 (file)
@@ -876,7 +876,7 @@ Bool_t AliAnalysisTaskFlowStrange::AcceptAAEvent(AliESDEvent*) {
 //=======================================================================
 Bool_t AliAnalysisTaskFlowStrange::MinimumRequirementsAA(AliAODEvent *tAOD) {
   fRunNumber = tAOD->GetRunNumber();
-  AliCentrality *cent = tAOD->GetHeader()->GetCentralityP();
+  AliCentrality *cent = ((AliVAODHeader*)tAOD->GetHeader())->GetCentralityP();
   fV0M = cent->GetCentralityPercentile("V0M");
   fTRK = cent->GetCentralityPercentile("TRK");
   TString mycent = fCentMethod;
@@ -989,9 +989,9 @@ Bool_t AliAnalysisTaskFlowStrange::AcceptPAEvent(AliAODEvent*) {
   // PA reading discontinued: TO BE UPDATED
   /*
   //if(aod->GetHeader()->GetEventNumberESDFile() == 0) return; //rejecting first chunk NOT NEEDED ANYMORE
-  Int_t bc2 = tAOD->GetHeader()->GetIRInt2ClosestInteractionMap();
+  Int_t bc2 = ((AliVAODHeader*)tAOD->GetHeader())->GetIRInt2ClosestInteractionMap();
   if(bc2!=0) return kFALSE;
-  Int_t bc1 = tAOD->GetHeader()->GetIRInt1ClosestInteractionMap();
+  Int_t bc1 = ((AliVAODHeader*)tAOD->GetHeader())->GetIRInt1ClosestInteractionMap();
   if(bc1!=0) return kFALSE;
   Short_t isPileup = tAOD->IsPileupFromSPD(5);
   if(isPileup!=0) return kFALSE;
index e6bdcf5..87b6054 100644 (file)
@@ -426,7 +426,7 @@ Bool_t AliFlowEventCuts::PassesCuts(AliVEvent *event, AliMCEvent *mcevent)
       Double_t tSPDVtxZ = aodevent->GetPrimaryVertexSPD()->GetZ();
       if( TMath::Abs(tVtxZ-tSPDVtxZ) > 0.5 ) pass = kFALSE;
     }
-    AliCentrality* centr = aodevent->GetHeader()->GetCentralityP();
+    AliCentrality* centr = ((AliVAODHeader*)aodevent->GetHeader())->GetCentralityP();
     if(fCutTPCmultiplicityOutliers || fCutTPCmultiplicityOutliersAOD){
       Double_t v0Centr  = centr->GetCentralityPercentile("V0M");
       Double_t trkCentr = centr->GetCentralityPercentile("TRK"); 
@@ -503,7 +503,7 @@ Float_t AliFlowEventCuts::GetCentrality(AliVEvent* event, AliMCEvent* /*mcEvent*
   if (esdEvent)
     centr = esdEvent->GetCentrality();
   if (aodEvent) 
-    centr = aodEvent->GetHeader()->GetCentralityP();
+    centr = ((AliVAODHeader*)aodEvent->GetHeader())->GetCentralityP();
   
   if (!centr) return -1.;
 
index 8f7a1bf..548f098 100644 (file)
@@ -390,7 +390,9 @@ void AliAODMuonReplicator::ReplicateAndFilter(const AliAODEvent& source)
   
   if (fReplicateHeader)
   {
-    *fHeader = *(source.GetHeader());
+    AliAODHeader * header = dynamic_cast<AliAODHeader*>(source.GetHeader());
+    if(!header) AliFatal("Not a standard AOD");
+    *fHeader = *(header);
   }
 
   if (fReplicateTracklets)
index 8a9eb4d..1b039ce 100644 (file)
@@ -51,6 +51,7 @@
 
 // CORRFW includes
 #include "AliCFGridSparse.h"
+#include "assert.h"
 
 /// \cond CLASSIMP
 ClassImp(AliAnalysisMuonUtility) // Class implementation in ROOT context
@@ -443,7 +444,9 @@ TString AliAnalysisMuonUtility::GetPassName ( const AliInputEventHandler* eventH
     // try first to find the info in the AOD header
     // (which is a priori safer because it works even on local copies of AODs)
     // and if it does not work, directly check the path to the AOD
-    filePath = static_cast<const AliAODEvent*> (event)->GetHeader()->GetESDFileName();
+    AliAODHeader * header = dynamic_cast<AliAODHeader*>(static_cast<const AliAODEvent*> (event)->GetHeader());
+    assert(header && "Not a standard AOD");
+    filePath = header->GetESDFileName();
     TString passName = GetPassName(filePath.Data());
     if ( passName.IsNull() ) AliWarningClass("Check again with the AOD path");
     else return passName;
index c7bd3fa..d61d8ec 100644 (file)
@@ -197,9 +197,12 @@ void AliAnalysisTaskCreateMixedDimuons::UserExec(Option_t *) {
          }
        }
        
-       fOutputUserAOD->GetHeader()->SetRefMultiplicity(nFWMUonsAdded); 
-       fOutputUserAOD->GetHeader()->SetRefMultiplicityPos(nPosTracksAdded);
-       fOutputUserAOD->GetHeader()->SetRefMultiplicityNeg(nNegTracksAdded);
+
+        AliAODHeader * header = dynamic_cast<AliAODHeader*>(fOutputUserAOD->GetHeader());
+        if(!header) AliFatal("Not a standard AOD");
+       header->SetRefMultiplicity(nFWMUonsAdded); 
+       header->SetRefMultiplicityPos(nPosTracksAdded);
+       header->SetRefMultiplicityNeg(nNegTracksAdded);
        
        fOutputUserHandler -> FinishEvent();
        
index df66140..d4ee6e9 100644 (file)
@@ -238,7 +238,8 @@ void AliAnalysisTaskESDMuonFilter::ConvertESDtoAOD()
   //  for (Int_t i = 0; i < 10; pid[i++] = 0.) {}
   //  pid[AliAODTrack::kMuon]=1.;
   
-  AliAODHeader* header = AODEvent()->GetHeader();
+  AliAODHeader* header = dynamic_cast<AliAODHeader*>(AODEvent()->GetHeader());
+  if(!header) AliFatal("Not a standard AOD");
   AliAODTrack *aodTrack = 0x0;
   AliESDMuonTrack *esdMuTrack = 0x0;
   
index dead252..49f57ce 100644 (file)
@@ -589,7 +589,8 @@ void AliAnalysisTaskLinkToMC::CreateAODTracks(TMap& links)
        // for (Int_t i = 0; i < 10; pid[i++] = 0.) {}
        // pid[AliAODTrack::kMuon]=1.;
        
-       AliAODHeader* header = AODEvent()->GetHeader();
+       AliAODHeader* header = dynamic_cast<AliAODHeader*>(AODEvent()->GetHeader());
+       if(!header) AliFatal("Not a standard AOD");
        AliAODTrack *aodTrack = 0x0;
        AliESDMuonTrack *esdMuTrack = 0x0;
        
index f28982b..0663a67 100644 (file)
@@ -112,7 +112,8 @@ void AliAnalysisTaskMuonAODfromGeneral::Exec(Option_t *) {
   Double_t covVtx[6];
   
     // Access to the header
-    AliAODHeader *header = fNewAOD->GetHeader();
+    AliAODHeader *header = dynamic_cast<AliAODHeader*>(fNewAOD->GetHeader());
+    if(!header) AliFatal("Not a standard AOD");
 
   // fill the header
   header->SetRunNumber       (fOrgAOD->GetRunNumber()       );
index 9e55828..d156f4e 100644 (file)
@@ -725,7 +725,7 @@ AliVParticle*  AliAnalyseLeadingTrackUE::ParticleWithCuts(TObject* obj, Int_t ip
          Double_t pos[2];
          Double_t covar[3];
          AliAODTrack* clone = (AliAODTrack*) part->Clone();
-         Bool_t success = clone->PropagateToDCA(vertex, aodEvent->GetHeader()->GetMagneticField(), 3, pos, covar);
+         Bool_t success = clone->PropagateToDCA(vertex, ((AliVAODHeader*)aodEvent->GetHeader())->GetMagneticField(), 3, pos, covar);
          delete clone;
          if (!success)
            return 0;
index e5676b7..54111c2 100644 (file)
@@ -1054,7 +1054,7 @@ void  AliAnalysisTask3PCorrelations::UserExec(Option_t */*option*/)
   _eventAccounting->Fill(1);// count all calls to this function with a valid pointer
   
   //Centrality
-  AliCentrality* centralityObject =  fAODEvent->GetHeader()->GetCentralityP();
+  AliCentrality* centralityObject =  ((AliVAODHeader*)fAODEvent->GetHeader())->GetCentralityP();
   if (centralityObject)
     {
     // cout << "AliAnalysisTask3PCorrelations::UserExec(Option_t *option) - 6" << endl;
index b317455..bfe2f95 100644 (file)
@@ -113,7 +113,7 @@ void AliAnalysisTaskContMC::UserExec(Option_t *)
     }
   Double_t centrality = 0;
 
-  AliCentrality *centralityObj = fAOD->GetHeader()->GetCentralityP();
+  AliCentrality *centralityObj = ((AliVAODHeader*)fAOD->GetHeader())->GetCentralityP();
   if (centralityObj)
     {
       centrality = centralityObj->GetCentralityPercentileUnchecked("V0M");
index 4b9ba1b..ac95e48 100644 (file)
@@ -2130,7 +2130,8 @@ void AliAnalysisTaskDiHadron::Exec(Option_t *)
       else tMult=fESD->GetVZEROData()->GetMTotV0A()+fESD->GetVZEROData()->GetMTotV0C();
     }
     else{
-      AliAODHeader *tHeader=fAOD->GetHeader();
+      AliAODHeader *tHeader=dynamic_cast<AliAODHeader*>(fAOD->GetHeader());
+      if(!tHeader) AliFatal("Not a standard AOD");
       tMult=tHeader->GetCentrality();
     }
 
index 0586883..7a286ef 100644 (file)
@@ -1087,7 +1087,7 @@ void  AliAnalysisTaskDptDptCorrelations::UserExec(Option_t */*option*/)
   if(fAODEvent)
     {
       //Centrality
-      AliCentrality* centralityObject =  fAODEvent->GetHeader()->GetCentralityP();
+      AliCentrality* centralityObject =  ((AliVAODHeader*)fAODEvent->GetHeader())->GetCentralityP();
       if (centralityObject)
        {
          //cout << "AliAnalysisTaskDptDptCorrelations::UserExec(Option_t *option) - 6" << endl;
index 784e453..914233c 100644 (file)
@@ -1053,7 +1053,7 @@ void  AliAnalysisTaskDptDptQA::UserExec(Option_t */*option*/)
     //cout << "AliAnalysisTaskDptDptQA::UserExec(Option_t *option) - 5" << endl;
     
     //Centrality
-    AliCentrality* centralityObject =  fAODEvent->GetHeader()->GetCentralityP();
+    AliCentrality* centralityObject =  ((AliVAODHeader*)fAODEvent->GetHeader())->GetCentralityP();
     if (centralityObject)
       {
       //cout << "AliAnalysisTaskDptDptQA::UserExec(Option_t *option) - 6" << endl;
index bf875b6..4d26c93 100644 (file)
@@ -156,7 +156,8 @@ void AliAnalysisTaskLongRangeCorrelations::UserExec(Option_t* ) {
   AliAODEvent* pAOD(dynamic_cast<AliAODEvent*>(InputEvent()));
   if (NULL == pAOD) return;
 
-  AliAODHeader *pAODHeader = pAOD->GetHeader();
+  AliAODHeader *pAODHeader = dynamic_cast<AliAODHeader*>(pAOD->GetHeader());
+  if(!pAODHeader) AliFatal("Not a standard AOD");
   if (NULL == pAODHeader) return;
 
   AliAODMCHeader *pAODMCHeader(dynamic_cast<AliAODMCHeader*>(pAOD->FindListObject(AliAODMCHeader::StdBranchName())));
index 16a9693..852ba5b 100644 (file)
@@ -552,7 +552,7 @@ void AliAnalysisTaskMinijet::UserExec(Option_t *)
     {
         AliCentrality *centralityObj = 0;
         if (fAODEvent)
-            centralityObj = fAODEvent->GetHeader()->GetCentralityP();
+            centralityObj = ((AliVAODHeader*)fAODEvent->GetHeader())->GetCentralityP();
         else if (fESDEvent)
             centralityObj = fESDEvent->GetCentrality();
         if (centralityObj)
index 7761f70..c74e0e7 100644 (file)
@@ -518,7 +518,7 @@ void  AliAnalysisTaskPhiCorrelations::AnalyseCorrectionMode()
     {
       AliCentrality *centralityObj = 0;
       if (fAOD)
-       centralityObj = fAOD->GetHeader()->GetCentralityP();
+       centralityObj = ((AliVAODHeader*)fAOD->GetHeader())->GetCentralityP();
       else if (fESD)
        centralityObj = fESD->GetCentrality();
       
@@ -1106,7 +1106,7 @@ void  AliAnalysisTaskPhiCorrelations::AnalyseDataMode()
    else
     {
       if (fAOD)
-       centralityObj = fAOD->GetHeader()->GetCentralityP();
+       centralityObj = ((AliVAODHeader*)fAOD->GetHeader())->GetCentralityP();
       else if (fESD)
        centralityObj = fESD->GetCentrality();
       
@@ -1263,7 +1263,7 @@ void  AliAnalysisTaskPhiCorrelations::AnalyseDataMode()
     referenceMultiplicity = AliESDtrackCuts::GetReferenceMultiplicity(fESD);
   else if (fAOD)
     referenceMultiplicity = tracks->GetEntriesFast(); // TODO to be replaced by the estimator once available in the AOD
-//    referenceMultiplicity = fAOD->GetHeader()->GetRefMultiplicityComb05();
+//    referenceMultiplicity = ((AliVAODHeader*)fAOD->GetHeader())->GetRefMultiplicityComb05();
 
   ((TH2F*) fListOfHistos->FindObject("referenceMultiplicity"))->Fill(centrality, referenceMultiplicity);
   
index d4b469c..3537fc0 100644 (file)
@@ -123,7 +123,7 @@ void AliAnalysisTaskTwoPlusOne::UserExec(Option_t *)
   Double_t centrality = 0;
   AliCentrality *centralityObj = 0;
 
-  centralityObj = fAOD->GetHeader()->GetCentralityP();
+  centralityObj = ((AliVAODHeader*)fAOD->GetHeader())->GetCentralityP();
 
 
  if (centralityObj)
index 368121b..4ca3f12 100644 (file)
@@ -1219,8 +1219,8 @@ void  AliDptDptInMC::UserExec(Option_t */*option*/)
     {
 
       //Centrality                                                                                                                          
-      //AliAODHeader* centralityObject = fAODEvent->GetHeader()->GetCentralityP();                                                          
-      AliCentrality* centralityObject =  fAODEvent->GetHeader()->GetCentralityP();
+      //AliAODHeader* centralityObject = ((AliVAODHeader*)fAODEvent->GetHeader())->GetCentralityP();                                                          
+      AliCentrality* centralityObject =  ((AliVAODHeader*)fAODEvent->GetHeader())->GetCentralityP();
       if (centralityObject)
         {
           v0Centr  = centralityObject->GetCentralityPercentile("V0M");
index 1fdc1c7..ecbf162 100644 (file)
@@ -441,7 +441,9 @@ void AliLeadingV0Correlation::UserExec(Option_t *)
        // Before Physics Selection
        //------------------------------------------------ 
        ltrackMultiplicity   = (InputEvent())->GetNumberOfTracks();
-       lrefMultiplicity     =fAODEvent->GetHeader()->GetRefMultiplicity();
+        AliAODHeader * header = dynamic_cast<AliAODHeader*>(fAODEvent->GetHeader());
+        if(!header) AliFatal("Not a standard AOD");
+       lrefMultiplicity     = header->GetRefMultiplicity();
        
        fHist_Mult_B4_Trg_Sel->Fill(ltrackMultiplicity,lrefMultiplicity);
        
index 7cd03d9..abd9a5b 100644 (file)
@@ -329,7 +329,8 @@ Bool_t AliAODEventCutsDiHadronPID::IsSelected(AliAODEvent* event) {
        }
        
        // Get the event header.
-       AliAODHeader* CurrentHeader = event->GetHeader();
+       AliAODHeader* CurrentHeader = dynamic_cast<AliAODHeader*>(event->GetHeader());
+       if(!CurrentHeader) AliFatal("Not a standard AOD");
        
        // Test minimum reference multiplicity.
        Int_t CurrentRefMultiplicity = CurrentHeader->GetRefMultiplicity();
index 00ea259..91d0417 100644 (file)
@@ -491,7 +491,10 @@ void AliDhcTask::UserExec(Option_t *)
           Info("Exec()", "Event REJECTED (AOD vertex not OK). z = %.1f", fZVertex);
         return;
       }
-      const AliCentrality *aodCent = fAOD->GetHeader()->GetCentralityP();
+      AliAODHeader * header = dynamic_cast<AliAODHeader*>(fAOD);
+      if(!header) AliFatal("Not a standard AOD");
+
+      const AliCentrality *aodCent = header->GetCentralityP();
       if (aodCent) {
         fCentrality = aodCent->GetCentralityPercentile(fCentMethod);
       }
index be6457e..f0832b8 100644 (file)
@@ -511,7 +511,7 @@ Int_t AliAnalysisTaskDiMuonCorrelations::GetCentBin() {
 
 Double_t AliAnalysisTaskDiMuonCorrelations::GetITSMultiplicity() {
 
-  Double_t multiplicity = fAOD->GetHeader()->GetNumberOfITSClusters(1);
+  Double_t multiplicity = ((AliVAODHeader*)fAOD->GetHeader())->GetNumberOfITSClusters(1);
 
   return multiplicity;
 
index 652d1c6..bee7237 100644 (file)
@@ -576,7 +576,7 @@ Int_t AliAnalysisTaskMuonHadronCorrelations::GetCentBin() {
 
 Double_t AliAnalysisTaskMuonHadronCorrelations::GetITSMultiplicity() {
 
-  Double_t multiplicity = fAOD->GetHeader()->GetNumberOfITSClusters(1);
+  Double_t multiplicity = ((AliVAODHeader*)fAOD->GetHeader())->GetNumberOfITSClusters(1);
 
   return multiplicity;
 
index 877f679..5d8735e 100644 (file)
@@ -1927,7 +1927,7 @@ if(tracksMCtruth) delete tracksMCtruth;
 //now deal with reco tracks
 
 
-   Float_t bSign1=aod->GetHeader()->GetMagneticField() ;//used for reconstructed track dca cut
+ Float_t bSign1=((AliVAODHeader*)aod->GetHeader())->GetMagneticField() ;//used for reconstructed track dca cut
 
 //detrmine the ref mult in case of Reco(not required if we get centrality info from AliCentrality)
  if (fSampleType=="pp_2_76" || fCentralityMethod.EndsWith("_MANUAL") || (fSampleType=="pp_7" && fPPVsMultUtils==kFALSE)) cent_v0=refmultReco;
@@ -2039,10 +2039,10 @@ isduplicate2=kTRUE;
   AliAODTrack *PIDtrack=track;//for PID purpose, mainly important for TPC only tracks
 
   if(fFilterBit==128){
-Int_t gid1 = track->GetID();
-//if(gid1>=0) PIDtrack = track;
- PIDtrack = aod->GetTrack(trackMap->GetValue(-1-gid1));
-if(!PIDtrack) continue;//for safety; so that each of the TPC only tracks have corresponding global track along with it
+    Int_t gid1 = track->GetID();
+    //if(gid1>=0) PIDtrack = track;
+    PIDtrack = dynamic_cast<AliAODTrack*>(aod->GetTrack(trackMap->GetValue(-1-gid1)));
+    if(!PIDtrack) continue;//for safety; so that each of the TPC only tracks have corresponding global track along with it
   }
 
   trackscount++;
@@ -2393,7 +2393,7 @@ if (!fPID) return;//this should be available with each event even if we don't do
 
 
  bSign = (aod->GetMagneticField() > 0) ? 1 : -1;//for two track efficiency cut in correlation function calculation
- Float_t bSign1=aod->GetHeader()->GetMagneticField() ;//for dca cut in ClassifyTrack(), i.e in track loop
+ Float_t bSign1=((AliVAODHeader*)aod->GetHeader())->GetMagneticField() ;//for dca cut in ClassifyTrack(), i.e in track loop
 
 
 // check event cuts and fill event histograms and return the centrality or reference multiplicity value
@@ -2453,10 +2453,10 @@ TExMap *trackMap = new TExMap();
 AliAODTrack *PIDtrack=track;//for PID purpose, mainly important for TPC only tracks
 
   if(fFilterBit==128){
-Int_t gid1 = track->GetID();
-//if(gid1>=0) PIDtrack = track;
- PIDtrack = aod->GetTrack(trackMap->GetValue(-1-gid1));
-if(!PIDtrack) continue;//for safety; so that each of the TPC only tracks have corresponding global track along with it
+    Int_t gid1 = track->GetID();
+    //if(gid1>=0) PIDtrack = track;
+    PIDtrack = dynamic_cast<AliAODTrack*>(aod->GetTrack(trackMap->GetValue(-1-gid1)));
+    if(!PIDtrack) continue;//for safety; so that each of the TPC only tracks have corresponding global track along with it
   }
 
 //check for eta , phi holes
@@ -4782,7 +4782,7 @@ if (v0Centr < 80){ // analysis only for 0-80% centrality classes
 
     for(Int_t iT = 0; iT < nAODTracks; iT++) {
       
-      AliAODTrack* aodTrack = event->GetTrack(iT);
+      AliAODTrack* aodTrack = dynamic_cast<AliAODTrack*>(event->GetTrack(iT));
       
       if (!aodTrack){
        continue;
index 3390ec7..c6dda4d 100755 (executable)
@@ -670,7 +670,8 @@ void AliAnalysisTaskBF::UserExec(Option_t *) {
     // for HBT like cuts need magnetic field sign
     bSign = (gAOD->GetMagneticField() > 0) ? 1 : -1;
 
-    AliAODHeader *aodHeader = gAOD->GetHeader();
+    AliAODHeader *aodHeader = dynamic_cast<AliAODHeader*>(gAOD->GetHeader());
+    if(!aodHeader) AliFatal("Not a standard AOD");
 
     // store offline trigger bits
     fHistTriggerStats->Fill(aodHeader->GetOfflineTrigger());
index ee6c1d2..62a2e79 100755 (executable)
@@ -434,7 +434,8 @@ void AliAnalysisTaskEventMixingBF::UserExecMix(Option_t *)
      // for HBT like cuts need magnetic field sign
      bSign = (aodEventMain->GetMagneticField() > 0) ? 1 : -1;
       
-     AliAODHeader *aodHeaderMain = aodEventMain->GetHeader();  
+     AliAODHeader *aodHeaderMain = dynamic_cast<AliAODHeader*>(aodEventMain->GetHeader());
+     if(!aodHeaderMain) AliFatal("Not a standard AOD");  
 
       // event selection done in AliAnalysisTaskSE::Exec() --> this is not used
       fHistEventStats->Fill(1); //all events
index abfe26d..f44d3f9 100644 (file)
@@ -423,7 +423,8 @@ void AliEbyEHigherMomentsEffContTask::doAODEvent(){
   }  
   
   
-  AliAODHeader *aodHeader = fAOD->GetHeader();
+  AliAODHeader *aodHeader = dynamic_cast<AliAODHeader*>(fAOD->GetHeader());
+  if(!aodHeader) AliFatal("Not a standard AOD");
   
   Int_t cent = -1;
   cent =  aodHeader->GetCentralityP()->GetCentralityClass10(fCentralityEstimator.Data());
@@ -630,7 +631,8 @@ void AliEbyEHigherMomentsEffContTask::doMCAODEvent(){
     return;
   }
   
-  AliAODHeader *aodHeader = fAOD->GetHeader();
+  AliAODHeader *aodHeader = dynamic_cast<AliAODHeader*>(fAOD->GetHeader());
+  if(!aodHeader) AliFatal("Not a standard AOD");
   
   Int_t cent = -1;
   cent =  aodHeader->GetCentralityP()->GetCentralityClass10(fCentralityEstimator.Data());
index 472e620..3dd76a5 100644 (file)
@@ -240,7 +240,8 @@ void AliEbyEHigherMomentsTask::doAODEvent(){
   
   if(!ProperVertex(fAOD)) return;   
   
-  AliAODHeader *aodHeader = fAOD->GetHeader();
+  AliAODHeader *aodHeader = dynamic_cast<AliAODHeader*>(fAOD->GetHeader());
+  if(!aodHeader) AliFatal("Not a standard AOD");
   
   fCentrality = (Int_t)aodHeader->GetCentralityP()->GetCentralityPercentile(fCentralityEstimator.Data());
   
@@ -361,7 +362,8 @@ void AliEbyEHigherMomentsTask::doMCAODEvent(){
   
   if(!ProperVertex(fAOD)) return;
 
-  AliAODHeader *aodHeader = fAOD->GetHeader();
+  AliAODHeader *aodHeader = dynamic_cast<AliAODHeader*>(fAOD->GetHeader());
+  if(!aodHeader) AliFatal("Not a standard AOD");
   
   fCentrality = (Int_t)aodHeader->GetCentralityP()->GetCentralityPercentile(fCentralityEstimator.Data());
 
index fc21036..e36618e 100644 (file)
@@ -316,7 +316,8 @@ void AliEbyEHigherMomentsTaskPID::doAODEvent(){
 
   if(!ProperVertex(fAOD)) return;   
   
-  AliAODHeader *aodHeader = fAOD->GetHeader();
+  AliAODHeader *aodHeader = dynamic_cast<AliAODHeader*>(fAOD->GetHeader());
+  if(!aodHeader) AliFatal("Not a standard AOD");
   
   fCentrality = (Int_t)aodHeader->GetCentralityP()->GetCentralityPercentile(fCentralityEstimator.Data());
   
@@ -462,7 +463,8 @@ void AliEbyEHigherMomentsTaskPID::doMCAODEvent(){
   
   if(!ProperVertex(fAOD)) return;
 
-  AliAODHeader *aodHeader = fAOD->GetHeader();
+  AliAODHeader *aodHeader = dynamic_cast<AliAODHeader*>(fAOD->GetHeader());
+  if(!aodHeader) AliFatal("Not a standard AOD");
   
   fCentrality = (Int_t)aodHeader->GetCentralityP()->GetCentralityPercentile(fCentralityEstimator.Data());
 
index 17ed978..aaae655 100644 (file)
@@ -317,7 +317,8 @@ if(!isSelected) return;
 
 
        
-               AliAODHeader *fHeader = fAOD->GetHeader();
+               AliAODHeader *fHeader = dynamic_cast<AliAODHeader*>(fAOD->GetHeader());
+               if(!fHeader) AliFatal("Not a standard AOD");
                Int_t spdmult0 = fHeader->GetNumberOfITSClusters(0);
                Int_t spdmult1 = fHeader->GetNumberOfITSClusters(1);
                Int_t run = fHeader->GetRunNumber();
index ea81e8b..fc92bdd 100644 (file)
@@ -356,7 +356,8 @@ void AliHigherMomentsToyModel::doAODEvent(){
   }  
   
   
-  AliAODHeader *aodHeader = fAOD->GetHeader();
+  AliAODHeader *aodHeader = dynamic_cast<AliAODHeader*>(fAOD->GetHeader());
+  if(!aodHeader) AliFatal("Not a standard AOD");
   
   fCentrality = (Int_t)aodHeader->GetCentralityP()->GetCentralityPercentile(fCentralityEstimator.Data());
   /* Int_t cent = -1;
@@ -573,7 +574,8 @@ void AliHigherMomentsToyModel::doMCAODEvent(){
     return;
   }
   
-  AliAODHeader *aodHeader = fAOD->GetHeader();
+  AliAODHeader *aodHeader = dynamic_cast<AliAODHeader*>(fAOD->GetHeader());
+  if(!aodHeader) AliFatal("Not a standard AOD");
   
   fCentrality = (Int_t)aodHeader->GetCentralityP()->GetCentralityPercentile(fCentralityEstimator.Data());
   
index 14dfda9..24d6b29 100644 (file)
@@ -377,7 +377,7 @@ Int_t AliAnalysisNetParticleHelper::SetupEvent(AliESDInputHandler *esdHandler, A
   if(esdHandler)
     centrality = fESD->GetCentrality();
   else if(aodHandler)
-    centrality = fAOD->GetHeader()->GetCentralityP();
+    centrality = ((AliVAODHeader*)fAOD->GetHeader())->GetCentralityP();
 
   if (!centrality) {
     AliError("Centrality not available");
index cfd82d5..5f9466e 100644 (file)
@@ -536,7 +536,7 @@ Int_t AliAnalysisTaskNetParticle::SetupAODEvent() {
 
   // -- Check Centrality
   // ------------------------------------------------------------------
-  if (!fAOD->GetHeader()->GetCentralityP()) {
+  if (!((AliVAODHeader*)fAOD->GetHeader())->GetCentralityP()) {
     AliError("Could not get centrality");
     return -1;
   }
index 7d6eb9b..6abe315 100644 (file)
@@ -143,7 +143,8 @@ void AliEbyEParticleRatioFluctuationTask::UserExec( Option_t * ){
   Int_t gCent   = -1;
   Float_t gRefMul = -1;
   
-  AliAODHeader *aodHeader = event->GetHeader();
+  AliAODHeader *aodHeader = dynamic_cast<AliAODHeader*>(event->GetHeader());
+  if(!aodHeader) AliFatal("Not a standard AOD");
   gCent = (Int_t)aodHeader->GetCentralityP()->GetCentralityPercentile(fCentralityEstimator.Data());
   gRefMul = aodHeader->GetRefMultiplicity();
   if (gCent < 0 || gCent > 100) return;
index 9e7b330..99c6275 100644 (file)
@@ -152,7 +152,8 @@ void AliEbyEPidTTask::UserExec( Option_t * ){
   Int_t gCent   = -1;
  // Float_t gRefMul = -1;
   
-  AliAODHeader *aodHeader = event->GetHeader();
+  AliAODHeader *aodHeader = dynamic_cast<AliAODHeader*>(event->GetHeader());
+  if(!aodHeader) AliFatal("Not a standard AOD");
   gCent = (Int_t)aodHeader->GetCentralityP()->GetCentralityPercentile(fCentralityEstimator.Data());
  // gRefMul = aodHeader->GetRefMultiplicity();
   if (gCent < 0 || gCent > 100) return;
index 78461a8..3bb5fe1 100644 (file)
@@ -149,7 +149,8 @@ void AliEbyEPidTTaskMC::UserExec( Option_t * ){
   Int_t gCent   = -1;
   //Float_t gRefMul = -1;
   
-  AliAODHeader *aodHeader = event->GetHeader();
+  AliAODHeader *aodHeader = dynamic_cast<AliAODHeader*>(event->GetHeader());
+  if(!aodHeader) AliFatal("Not a standard AOD");
   gCent = (Int_t)aodHeader->GetCentralityP()->GetCentralityPercentile(fCentralityEstimator.Data());
  // gRefMul = aodHeader->GetRefMultiplicity();
   if (gCent < 0 || gCent > 100) return;
index 02b3317..c237b2c 100644 (file)
@@ -265,7 +265,8 @@ void AliAnalysisTaskFemto::ConnectInputData(Option_t *) {
       cout<<"AliAnalysisTaskFemto::AodpidUtil:"<<fAODpidUtil<<endl;
       femtoReaderAOD->SetAODpidUtil(fAODpidUtil);
 
-      fAODheader = fAOD->GetHeader();
+      fAODheader = dynamic_cast<AliAODHeader*>(fAOD->GetHeader());
+      if(!fAODheader) AliFatal("Not a standard AOD");
       femtoReaderAOD->SetAODheader(fAODheader);
    
     }
index 88de7f9..5907126 100644 (file)
@@ -30,6 +30,7 @@
 
 #include "AliAODpidUtil.h"
 #include "AliAnalysisUtils.h"
+#include "assert.h"
 #include "AliGenHijingEventHeader.h"
 
 ClassImp(AliFemtoEventReaderAOD)
@@ -313,7 +314,10 @@ AliFemtoEvent* AliFemtoEventReaderAOD::CopyAODtoFemtoEvent()
     }
   }
 
-  tEvent->SetReactionPlaneAngle(fEvent->GetHeader()->GetQTheta(0)/2.0);
+  AliAODHeader * header = dynamic_cast<AliAODHeader*>(fEvent->GetHeader());
+  assert(header&&"Not a standard AOD");
+
+  tEvent->SetReactionPlaneAngle(header->GetQTheta(0)/2.0);
   // Int_t *motherids=0;
   // if (mcP) {
   //   const int motherTabSize = ((AliAODMCParticle *) mcP->At(mcP->GetEntries()-1))->GetLabel();
@@ -402,7 +406,8 @@ AliFemtoEvent* AliFemtoEventReaderAOD::CopyAODtoFemtoEvent()
 
   // looking for global tracks and saving their numbers to copy from them PID information to TPC-only tracks in the main loop over tracks
   for (int i=0;i<nofTracks;i++) {
-    const AliAODTrack *aodtrack=fEvent->GetTrack(i);
+    const AliAODTrack *aodtrack=dynamic_cast<const AliAODTrack*>(fEvent->GetTrack(i));
+    assert(aodtrack&&"Not a standard AOD");
     if (!aodtrack->TestFilterBit(fFilterBit)) {
       if(aodtrack->GetID() < 0) continue;
       labels[aodtrack->GetID()] = i;
@@ -539,8 +544,9 @@ AliFemtoEvent* AliFemtoEventReaderAOD::CopyAODtoFemtoEvent()
     // No additional information exists
     // Read in the normal AliAODTracks
 
-    // const AliAODTrack *aodtrack=fEvent->GetTrack(i); // getting the AODtrack directly
-    AliAODTrack *aodtrack=fEvent->GetTrack(i); // getting the AODtrack directly
+    // const AliAODTrack *aodtrack=dynamic_cast<AliAODTrack*>(fEvent->GetTrack(i));
+    AliAODTrack *aodtrack=dynamic_cast<AliAODTrack*>(fEvent->GetTrack(i));
+    assert(aodtrack&&"Not a standard AOD"); // getting the AODtrack directly
 
 
 
@@ -585,11 +591,12 @@ AliFemtoEvent* AliFemtoEventReaderAOD::CopyAODtoFemtoEvent()
 
     AliAODTrack *aodtrackpid;
     if((fFilterBit ==  (1 << (7))) || fFilterMask == 128) {//for TPC Only tracks we have to copy PID information from corresponding global tracks
-      aodtrackpid = fEvent->GetTrack(labels[-1-fEvent->GetTrack(i)->GetID()]);
+      aodtrackpid = dynamic_cast<AliAODTrack*>(fEvent->GetTrack(labels[-1-fEvent->GetTrack(i)->GetID()]));
     }
     else {
-      aodtrackpid = fEvent->GetTrack(i);
+      aodtrackpid = dynamic_cast<AliAODTrack*>(fEvent->GetTrack(i));
     }
+    assert(aodtrackpid&&"Not a standard AOD");
 
     CopyPIDtoFemtoTrack(aodtrackpid, trackCopy);
 
index 5c2aa67..cf8a4db 100644 (file)
@@ -32,6 +32,7 @@
 #include "AliAODMCParticle.h"
 
 #include "AliVertexerTracks.h"
+#include "assert.h"
 
 ClassImp(AliFemtoEventReaderStandard)
 
@@ -288,8 +289,10 @@ AliFemtoEvent* AliFemtoEventReaderStandard::ReturnHbtEvent()
     if (!mcP) {
       cout << "AOD MC information requested, but no particle array found!" << endl;
     }
+    AliAODHeader * header = dynamic_cast<AliAODHeader*>(fAODEvent->GetHeader());
+    assert(header&&"Not a standard AOD");
 
-    hbtEvent->SetReactionPlaneAngle(fAODEvent->GetHeader()->GetQTheta(0)/2.0);
+    hbtEvent->SetReactionPlaneAngle(header->GetQTheta(0)/2.0);
     
     if (mcP) {
       motherids = new Int_t[((AliAODMCParticle *) mcP->At(mcP->GetEntries()-1))->GetLabel()];
index fb92409..dabeed7 100644 (file)
@@ -366,7 +366,8 @@ void AliAnalysisTaskParticleEfficiency::UserExec(Option_t *)
   //AliESDEvent *esdEvent = dynamic_cast<AliESDEvent *>(InputEvent());
   AliAODEvent* aodEvent = dynamic_cast<AliAODEvent*>(InputEvent());
   if (!aodEvent) return;
-  AliAODHeader *fAODheader = aodEvent->GetHeader();
+  AliAODHeader *fAODheader = dynamic_cast<AliAODHeader*>(aodEvent->GetHeader());
+  if(!fAODheader) AliFatal("Not a standard AOD");
   Double_t mult = fAODheader->GetRefMultiplicity();
 // AliCentrality* alicent= aodEvent->GetCentrality(); //in PbPb and pPb
 //  Double_t mult = alicent->GetCentralityPercentile("V0A"); //in pPb
index 1d28b09..acf3ef9 100644 (file)
@@ -191,7 +191,8 @@ void AliAnalysisTaskPWG2ESDfilter::Exec(Option_t */*option*/)
     
     // Update the header
 
-    AliAODHeader* header = fAOD->GetHeader();
+    AliAODHeader* header = dynamic_cast<AliAODHeader*>(fAOD->GetHeader());
+    if(!header) AliFatal("Not a standard AOD");
     header->SetRunNumber(fESD->GetRunNumber());
     if (old) {
        header->SetBunchCrossNumber(0);
index 9c435c8..8d9b7ab 100644 (file)
@@ -326,11 +326,15 @@ void AliAnalysisTaskDielectronFilter::UserExec(Option_t *)
        nanoEv->GetVertex(0)->SetNContributors((static_cast<AliAODEvent*>(InputEvent()))->GetPrimaryVertex()->GetNContributors());
        nanoEv->GetVertex(1)->SetNContributors((static_cast<AliAODEvent*>(InputEvent()))->GetPrimaryVertexSPD()->GetNContributors());
        // set event plane 
-       nanoEv->GetHeader()->SetEventplane((static_cast<AliAODEvent*>(InputEvent()))->GetHeader()->GetEventplaneP());
-       nanoEv->GetHeader()->ResetEventplanePointer(); 
+       AliAODHeader * header = dynamic_cast<AliAODHeader*>(nanoEv->GetHeader());
+       if(!header) AliFatal("Not a standard AOD");
+
+
+       header->SetEventplane(((AliVAODHeader*)static_cast<AliAODEvent*>(InputEvent())->GetHeader())->GetEventplaneP());
+       header->ResetEventplanePointer(); 
        // set multiplicity
-       nanoEv->GetHeader()->SetRefMultiplicity((Int_t)values[AliDielectronVarManager::kNTrk]);
-       nanoEv->GetHeader()->SetRefMultiplicityPos((Int_t)values[AliDielectronVarManager::kNacc]);
+       header->SetRefMultiplicity((Int_t)values[AliDielectronVarManager::kNTrk]);
+       header->SetRefMultiplicityPos((Int_t)values[AliDielectronVarManager::kNacc]);
        //nanoEv->GetHeader()->SetRefMultiplicityNeg(values[AliDielectronVarManager::kMatchEffITSTPC]);
 
          for(int kj=0; kj<(fDielectron->GetTrackArray(0))->GetEntries(); kj++){
@@ -384,10 +388,12 @@ void AliAnalysisTaskDielectronFilter::UserExec(Option_t *)
  
   if(fCreateNanoAOD && isAOD && (!hasCand) &&  fStoreHeader)  
    {
-   // set event plane 
-   extDielectron->GetAOD()->GetHeader()->SetEventplane((static_cast<AliAODEvent*>(InputEvent()))->GetHeader()->GetEventplaneP());
-   extDielectron->GetAOD()->GetHeader()->ResetEventplanePointer();
-   extDielectron->GetTree()->Fill(); // fill header for all events without tracks
+     // set event plane 
+     AliAODHeader * header = dynamic_cast<AliAODHeader*>(extDielectron->GetAOD()->GetHeader());
+     if(!header) AliFatal("Not a standard AOD");     
+     header->SetEventplane(((AliAODHeader*)(static_cast<AliAODEvent*>(InputEvent()))->GetHeader())->GetEventplaneP());
+     header->ResetEventplanePointer();
+     extDielectron->GetTree()->Fill(); // fill header for all events without tracks
    }
  
   PostData(1, const_cast<THashList*>(fDielectron->GetHistogramList()));
index a8d4fa9..2ccc926 100644 (file)
@@ -420,12 +420,16 @@ void AliAnalysisTaskReducedTree::FillEventInfo()
     }
   }
   if(isAOD) {
-    fReducedEvent->fIRIntClosestIntMap[0] = aodEvent->GetHeader()->GetIRInt1ClosestInteractionMap();
-    fReducedEvent->fIRIntClosestIntMap[1] = aodEvent->GetHeader()->GetIRInt2ClosestInteractionMap();
-    fReducedEvent->fEventNumberInFile = aodEvent->GetHeader()->GetEventNumberESDFile();
-    fReducedEvent->fL0TriggerInputs = aodEvent->GetHeader()->GetL0TriggerInputs();
-    fReducedEvent->fL1TriggerInputs = aodEvent->GetHeader()->GetL1TriggerInputs();
-    fReducedEvent->fL2TriggerInputs = aodEvent->GetHeader()->GetL2TriggerInputs();
+    AliAODHeader * header = dynamic_cast<AliAODHeader*>(aodEvent->GetHeader());
+    if(!header) AliFatal("Not a standard AOD");
+
+
+    fReducedEvent->fIRIntClosestIntMap[0] = header->GetIRInt1ClosestInteractionMap();
+    fReducedEvent->fIRIntClosestIntMap[1] = header->GetIRInt2ClosestInteractionMap();
+    fReducedEvent->fEventNumberInFile = header->GetEventNumberESDFile();
+    fReducedEvent->fL0TriggerInputs = header->GetL0TriggerInputs();
+    fReducedEvent->fL1TriggerInputs = header->GetL1TriggerInputs();
+    fReducedEvent->fL2TriggerInputs = header->GetL2TriggerInputs();
     fReducedEvent->fTimeStamp     = 0;
     fReducedEvent->fNpileupSPD    = aodEvent->GetNumberOfPileupVerticesSPD();
     fReducedEvent->fNpileupTracks = aodEvent->GetNumberOfPileupVerticesTracks();
index a75e1c3..4f4e150 100644 (file)
@@ -73,6 +73,7 @@
 #include "AliVZEROEPSelectionTask.h"
 
 #include "AliAODMCHeader.h"
+#include "assert.h"
 
 class AliVEvent;
 
@@ -2013,7 +2014,8 @@ inline void AliDielectronVarManager::FillVarAODEvent(const AliAODEvent *event, D
   FillVarVEvent(event, values);
 
   // Fill AliAODEvent interface specific information
-  AliAODHeader *header = event->GetHeader();
+  AliAODHeader *header = dynamic_cast<AliAODHeader*>(event->GetHeader());
+  assert(header&&"Not a standard AOD");
 
   Double_t centralityF=-1; Double_t centralitySPD=-1;
   AliCentrality *aodCentrality = header->GetCentralityP();
@@ -2587,7 +2589,8 @@ inline void AliDielectronVarManager::GetVzeroRP(const AliVEvent* event, Double_t
   }
   if(event->IsA() == AliAODEvent::Class()) {
     const AliAODEvent* aodEv = static_cast<const AliAODEvent*>(event);
-    AliAODHeader *header = aodEv->GetHeader();
+    AliAODHeader *header = dynamic_cast<AliAODHeader*>(aodEv->GetHeader());
+    assert(header&&"Not a standard AOD");
     AliCentrality *aodCentrality = header->GetCentralityP();
     if(aodCentrality) centralitySPD = aodCentrality->GetCentralityPercentile("CL1");
   }
@@ -2716,7 +2719,7 @@ inline void AliDielectronVarManager::GetZDCRP(const AliVEvent* event, Double_t q
 
   if(fgZDCRecentering[0][0]){
     const AliAODEvent* aodEv = static_cast<const AliAODEvent*>(event);
-    AliAODHeader *header = aodEv->GetHeader();
+    AliAODHeader *header = dynamic_cast<AliAODHeader*>(aodEv->GetHeader());
     if(!header) return;
     TPCRefMulti = header -> GetTPConlyRefMultiplicity();
 
index e39501c..cadc787 100644 (file)
@@ -623,12 +623,13 @@ void AliAnalysisTaskCaloFilter::FillAODHeader()
 {
   // AOD header copy
   
-  AliAODHeader* header = AODEvent()->GetHeader();
+  AliAODHeader* header = dynamic_cast<AliAODHeader*>(AODEvent()->GetHeader());
+  if(!header) AliFatal("Not a standard AOD");
   
   // Copy from AODs
   if(fAODEvent)
   {
-    *header = *(fAODEvent->GetHeader());
+    *header = *((AliAODHeader*)fAODEvent->GetHeader());
     return;
   }
   
index 11f67ef..843d623 100644 (file)
@@ -849,7 +849,8 @@ void AliAnalysisTaskEMCALClusterize::FillAODHeader()
   Double_t covVtx[6];
   for (Int_t i = 0; i < 6; i++)  covVtx[i] = 0.;
   
-  AliAODHeader* header = AODEvent()->GetHeader();
+  AliAODHeader* header = dynamic_cast<AliAODHeader*>(AODEvent()->GetHeader());
+  if(!header) AliFatal("Not a standard AOD");
   header->SetRunNumber(fEvent->GetRunNumber());
   
   if(esdevent)
@@ -861,7 +862,11 @@ void AliAnalysisTaskEMCALClusterize::FillAODHeader()
       if (file) header->SetESDFileName(file->GetName());
     }
   }
-  else if (aodevent) header->SetESDFileName(aodevent->GetHeader()->GetESDFileName());
+  else if (aodevent) {
+    AliAODHeader * aodheader = dynamic_cast<AliAODHeader*>(aodevent->GetHeader());
+    if(!aodheader) AliFatal("Not a standard AOD");
+    header->SetESDFileName(aodheader->GetESDFileName());
+  }
   
   header->SetBunchCrossNumber(fEvent->GetBunchCrossNumber());
   header->SetOrbitNumber(fEvent->GetOrbitNumber());
index 7d5b93a..1dd7c2a 100644 (file)
@@ -603,7 +603,7 @@ void AliAnalysisTaskEMCALPi0PbPb::UserExec(Option_t *)
       return;
     }
     am->LoadBranch("header");
-    offtrigger =  fAodEv->GetHeader()->GetOfflineTrigger();
+    offtrigger =  ((AliVAODHeader*)fAodEv->GetHeader())->GetOfflineTrigger();
   }
   if (!fMcMode && (offtrigger & AliVEvent::kFastOnly)) {
     AliWarning(Form("EMCAL not in fast only partition"));
@@ -626,8 +626,11 @@ void AliAnalysisTaskEMCALPi0PbPb::UserExec(Option_t *)
       const TGeoHMatrix *geom = 0;
       if (fEsdEv)
         geom = fEsdEv->GetESDRun()->GetEMCALMatrix(i);
-      else 
-        geom = fAodEv->GetHeader()->GetEMCALMatrix(i);
+      else {
+        AliAODHeader * aodheader = dynamic_cast<AliAODHeader*>(fAodEv->GetHeader());
+        if(!aodheader) AliFatal("Not a standard AOD");
+        geom = aodheader->GetEMCALMatrix(i);
+      }
       if (!geom)
         continue;
       geom->Print();
@@ -1614,17 +1617,20 @@ void AliAnalysisTaskEMCALPi0PbPb::FillNtuple()
 
   AliAnalysisManager *am = AliAnalysisManager::GetAnalysisManager();
   if (fAodEv) {
+    AliAODHeader * aodheader = dynamic_cast<AliAODHeader*>(fAodEv->GetHeader());
+    if(!aodheader) AliFatal("Not a standard AOD");
+
     fHeader->fRun            = fAodEv->GetRunNumber();
-    fHeader->fOrbit          = fAodEv->GetHeader()->GetOrbitNumber(); 
-    fHeader->fPeriod         = fAodEv->GetHeader()->GetPeriodNumber();
-    fHeader->fBx             = fAodEv->GetHeader()->GetBunchCrossNumber();
-    fHeader->fL0             = fAodEv->GetHeader()->GetL0TriggerInputs();
-    fHeader->fL1             = fAodEv->GetHeader()->GetL1TriggerInputs();
-    fHeader->fL2             = fAodEv->GetHeader()->GetL2TriggerInputs();
-    fHeader->fTrClassMask    = fAodEv->GetHeader()->GetTriggerMask();
-    fHeader->fTrCluster      = fAodEv->GetHeader()->GetTriggerCluster();
-    fHeader->fOffTriggers    = fAodEv->GetHeader()->GetOfflineTrigger();
-    fHeader->fFiredTriggers  = fAodEv->GetHeader()->GetFiredTriggerClasses();
+    fHeader->fOrbit          = aodheader->GetOrbitNumber(); 
+    fHeader->fPeriod         = aodheader->GetPeriodNumber();
+    fHeader->fBx             = aodheader->GetBunchCrossNumber();
+    fHeader->fL0             = aodheader->GetL0TriggerInputs();
+    fHeader->fL1             = aodheader->GetL1TriggerInputs();
+    fHeader->fL2             = aodheader->GetL2TriggerInputs();
+    fHeader->fTrClassMask    = aodheader->GetTriggerMask();
+    fHeader->fTrCluster      = aodheader->GetTriggerCluster();
+    fHeader->fOffTriggers    = aodheader->GetOfflineTrigger();
+    fHeader->fFiredTriggers  = aodheader->GetFiredTriggerClasses();
   } else {
     fHeader->fRun            = fEsdEv->GetRunNumber();
     fHeader->fOrbit          = fEsdEv->GetHeader()->GetOrbitNumber(); 
index 0998f16..4030169 100644 (file)
@@ -1310,7 +1310,7 @@ Double_t AliConvEventCuts::GetCentrality(AliVEvent *event)
 
        AliAODEvent *aodEvent=dynamic_cast<AliAODEvent*>(event);
        if(aodEvent){
-               if(aodEvent->GetHeader()){return aodEvent->GetHeader()->GetCentrality();}
+          if(aodEvent->GetHeader()){return ((AliVAODHeader*)aodEvent->GetHeader())->GetCentrality();}
        }
 
        return -1;
index 44f229c..18db1a9 100644 (file)
@@ -3542,7 +3542,7 @@ Double_t AliConversionCuts::GetCentrality(AliVEvent *event)
 
    AliAODEvent *aodEvent=dynamic_cast<AliAODEvent*>(event);
    if(aodEvent){
-      if(aodEvent->GetHeader()){return aodEvent->GetHeader()->GetCentrality();}
+     if(aodEvent->GetHeader()){return ((AliVAODHeader*)aodEvent->GetHeader())->GetCentrality();}
    }
 
    return -1;
index 08b3b93..2d42790 100644 (file)
@@ -714,7 +714,8 @@ void AliAnalysisTaskPi0DiffEfficiency::UserExec(Option_t *)
   }
   
   FillHistogram("hSelEvents",1.5) ;
-  AliAODHeader *header = event->GetHeader() ;
+  AliAODHeader *header = dynamic_cast<AliAODHeader*>(event->GetHeader()) ;
+  if(!header) AliFatal("Not a standard AOD");
   
   // Checks if we have a primary vertex
   // Get primary vertices form ESD
index 23575f7..94bc636 100644 (file)
@@ -418,7 +418,8 @@ void AliAnalysisTaskPi0Efficiency::UserExec(Option_t *)
   }
   
   FillHistogram("hSelEvents",1.5) ;
-  AliAODHeader *header = event->GetHeader() ;
+  AliAODHeader *header = dynamic_cast<AliAODHeader*>(event->GetHeader()) ;
+  if(!header) AliFatal("Not a standard AOD");
   
   // Checks if we have a primary vertex
   // Get primary vertices form ESD
index e7acd7a..da77109 100644 (file)
@@ -589,7 +589,8 @@ void AliPHOSEmbedding::ConvertMCParticles(const AliAODEvent* aod)
 //______________________________________________________________________________
 void AliPHOSEmbedding::ConvertHeader(AliESDEvent & esd){
   
-  AliAODHeader* header = AODEvent()->GetHeader();
+  AliAODHeader* header = dynamic_cast<AliAODHeader*>(AODEvent()->GetHeader());
+  if(!header) AliFatal("Not a standard AOD");
   
   header->SetRunNumber(esd.GetRunNumber());
   header->SetOfflineTrigger(fInputHandler->IsEventSelected()); // propagate the decision of the physics selection
index 66eb930..ca4cd4b 100644 (file)
@@ -1454,7 +1454,7 @@ void AliAnalysisTaskDStarCorrelations::EventMixingChecks(AliAODEvent* AOD){
        }
        if(fSystem == AA){ // PbPb
                
-               centralityObj = AOD->GetHeader()->GetCentralityP();
+               centralityObj = ((AliVAODHeader*)AOD->GetHeader())->GetCentralityP();
                MultipOrCent = centralityObj->GetCentralityPercentileUnchecked("V0M");
                AliInfo(Form("Centrality is %f", MultipOrCent));
        }
index 519210c..2ebac97 100644 (file)
@@ -283,7 +283,7 @@ void AliAnalysisTaskDxHFECorrelation::UserExec(Option_t* /*option*/)
     Double_t MultipOrCent = -1;
     AliAODEvent* aodEvent=dynamic_cast<AliAODEvent*>(pEvent);
     if (aodEvent) {
-      centralityObj = aodEvent->GetHeader()->GetCentralityP();
+      centralityObj = ((AliVAODHeader*)aodEvent->GetHeader())->GetCentralityP();
       if (centralityObj) {
        MultipOrCent = centralityObj->GetCentralityPercentileUnchecked("V0M");
       }
index ab09c67..fbdd421 100644 (file)
@@ -597,7 +597,7 @@ void AliDxHFECorrelation::EventMixingChecks(const AliVEvent* pEvent){
     MultipOrCent = multiplicity; // convert from Int_t to Double_t
   }
   if(fSystem){ // PbPb         
-    centralityObj = AOD->GetHeader()->GetCentralityP();
+    centralityObj = ((AliVAODHeader*)AOD->GetHeader())->GetCentralityP();
     MultipOrCent = centralityObj->GetCentralityPercentileUnchecked("V0M");
     AliInfo(Form("Centrality is %f", MultipOrCent));
   }
index 54d3b7b..5881603 100644 (file)
@@ -261,7 +261,7 @@ Bool_t AliHFCorrelator::Initialize(){
        if(fUseCentrality){ // PbPb
                if(!fDMesonCutObject){
            
-               centralityObj = fAODEvent->GetHeader()->GetCentralityP();
+                centralityObj = ((AliVAODHeader*)fAODEvent->GetHeader())->GetCentralityP();
                fMultCentr = centralityObj->GetCentralityPercentileUnchecked("V0M");
         }
         else fMultCentr = fDMesonCutObject->GetCentrality(fAODEvent);
index 243f4df..026042b 100644 (file)
@@ -1835,7 +1835,7 @@ void AliAnalysisTaskEMCalHFEpA::UserExec(Option_t *)
                
                if(fIsAOD) 
                {
-                       fCentrality = fAOD->GetHeader()->GetCentralityP();
+                       fCentrality = ((AliVAODHeader*)fAOD->GetHeader())->GetCentralityP();
                }
                else
                {
@@ -2159,7 +2159,8 @@ void AliAnalysisTaskEMCalHFEpA::UserExec(Option_t *)
        
        if(fIsAOD){
                
-                       //AliAODHeader * aodh = fAOD->GetHeader();
+                       //AliAODHeader * aodh = dynamic_cast<AliAODHeader*>(fAOD->GetHeader());
+          //  if(!aodh) AliFatal("Not a standard AOD");
                        //Int_t bc= aodh->GetBunchCrossNumber();
 
                
index 59a33a4..ee859a7 100644 (file)
@@ -407,7 +407,9 @@ void AliAnalysisTaskHFEemcQA::UserExec(Option_t *)
 
   Int_t trigger = -1;
   if (fAOD){
-    Double_t multiplicity=fAOD->GetHeader()->GetRefMultiplicity();
+    AliAODHeader * header = dynamic_cast<AliAODHeader*>(fAOD->GetHeader());
+    if(!header) AliFatal("Not a standard AOD");
+    Double_t multiplicity=header->GetRefMultiplicity();
     fTrigMulti->Fill(-0.5, multiplicity);
     if(evSelMask & AliVEvent::kAny) fTrigMulti->Fill(0.5, multiplicity);
     if(evSelMask & AliVEvent::kMB) fTrigMulti->Fill(1.5, multiplicity);
index 6fe3ffa..116dbf6 100644 (file)
@@ -1317,7 +1317,10 @@ void AliAnalysisTaskSEHFQA::UserExec(Option_t */*option*/)
   
   UInt_t evSelMask=((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected();
   Double_t centrality=fCuts->GetCentrality(aod);
-  Double_t multiplicity=aod->GetHeader()->GetRefMultiplicity();
+  AliAODHeader * header = dynamic_cast<AliAODHeader*>(aod->GetHeader());
+  if(!header) AliFatal("Not a standard AOD");
+
+  Double_t multiplicity=header->GetRefMultiplicity();
   Int_t runNumber = aod->GetRunNumber();
   TString trigClass=aod->GetFiredTriggerClasses();
   Int_t nAODtracks=aod->GetNumberOfTracks();
@@ -1742,14 +1745,18 @@ void AliAnalysisTaskSEHFQA::UserExec(Option_t */*option*/)
       if(mincent==100)mincent--;
       ((AliCounterCollection*)fOutputCounters->FindObject("secondEstimator"))->Count(Form("centralityclass:%d_%d/Run:%d",mincent,mincent+10,runNumber));
 
+      AliAODHeader * header = dynamic_cast<AliAODHeader*>(aod->GetHeader());
+      if(!header) AliFatal("Not a standard AOD");
+
+
       if(stdCent<fCuts->GetMinCentrality() || stdCent>fCuts->GetMaxCentrality()){
        ((TH1F*)fOutputCheckCentrality->FindObject("hNtrackletsOut"))->Fill(aod->GetTracklets()->GetNumberOfTracklets());
-       ((TH1F*)fOutputCheckCentrality->FindObject("hMultOut"))->Fill(aod->GetHeader()->GetRefMultiplicity());
+       ((TH1F*)fOutputCheckCentrality->FindObject("hMultOut"))->Fill(header->GetRefMultiplicity());
       }else{
        ((TH1F*)fOutputCheckCentrality->FindObject("hNtrackletsIn"))->Fill(aod->GetTracklets()->GetNumberOfTracklets());
-       ((TH1F*)fOutputCheckCentrality->FindObject("hMultIn"))->Fill(aod->GetHeader()->GetRefMultiplicity());
+       ((TH1F*)fOutputCheckCentrality->FindObject("hMultIn"))->Fill(header->GetRefMultiplicity());
       }
-      ((TH2F*)fOutputCheckCentrality->FindObject("hMultvsPercentile"))->Fill(aod->GetHeader()->GetRefMultiplicity(),stdCentf);
+      ((TH2F*)fOutputCheckCentrality->FindObject("hMultvsPercentile"))->Fill(header->GetRefMultiplicity(),stdCentf);
       ((TH2F*)fOutputCheckCentrality->FindObject("hntrklvsPercentile"))->Fill(aod->GetTracklets()->GetNumberOfTracklets(),stdCentf);
       ((TH2F*)fOutputCheckCentrality->FindObject("hntrklvsPercentile01"))->Fill(AliVertexingHFUtils::GetNumberOfTrackletsInEtaRange(aod,-1.,1.),stdCentf);
       ((TH2F*)fOutputCheckCentrality->FindObject("hnTPCTracksvsPercentile"))->Fill(nSelTracksTPCOnly,stdCentf);
@@ -1767,10 +1774,10 @@ void AliAnalysisTaskSEHFQA::UserExec(Option_t */*option*/)
       if(fOnOff[0]){
        ((TH1F*)fOutputTrack->FindObject("hNtracklets"))->Fill(aod->GetTracklets()->GetNumberOfTracklets());
        ((TH1F*)fOutputTrack->FindObject("hNtracklets01"))->Fill(AliVertexingHFUtils::GetNumberOfTrackletsInEtaRange(aod,-1.,1.));
-       ((TH1F*)fOutputTrack->FindObject("hMult"))->Fill(aod->GetHeader()->GetRefMultiplicity());
+       ((TH1F*)fOutputTrack->FindObject("hMult"))->Fill(header->GetRefMultiplicity());
        ((TH1F*)fOutputTrack->FindObject("hMultFBit4"))->Fill(ntracksFBit4);
-       ((TH1F*)fOutputTrack->FindObject("hMultComb05"))->Fill(aod->GetHeader()->GetRefMultiplicityComb05());
-       ((TH1F*)fOutputTrack->FindObject("hMultComb08"))->Fill(aod->GetHeader()->GetRefMultiplicityComb08());
+       ((TH1F*)fOutputTrack->FindObject("hMultComb05"))->Fill(header->GetRefMultiplicityComb05());
+       ((TH1F*)fOutputTrack->FindObject("hMultComb08"))->Fill(header->GetRefMultiplicityComb08());
       }
     }
   }
index 8810918..800fe49 100644 (file)
@@ -1178,7 +1178,8 @@ Float_t AliRDHFCuts::GetCentrality(AliAODEvent* aodEvent,AliRDHFCuts::ECentralit
   TClonesArray *mcArray = (TClonesArray*)((AliAODEvent*)aodEvent)->GetList()->FindObject(AliAODMCParticle::StdBranchName());
   if(mcArray) {fUseAOD049=kFALSE;}
 
-  AliAODHeader *header=aodEvent->GetHeader();
+  AliAODHeader *header=dynamic_cast<AliAODHeader*>(aodEvent->GetHeader());
+  if(!header) AliFatal("Not a standard AOD");
   AliCentrality *centrality=header->GetCentralityP();
   Float_t cent=-999.;
   Bool_t isSelRun=kFALSE;
index 94b2888..5f613e1 100644 (file)
@@ -479,7 +479,7 @@ void AliAnalysisTaskAj::UserExec(Option_t *)
    Double_t centValue = 0.; 
    if(fESD) {cent = fESD->GetCentrality();
      if(cent) centValue = cent->GetCentralityPercentile("V0M");}
-   else     centValue=aod->GetHeader()->GetCentrality();
+   else     centValue=((AliVAODHeader*)aod->GetHeader())->GetCentrality();
    
    if(fDebug) printf("centrality: %f\n", centValue);
    //  if (centValue < fCentMin || centValue > fCentMax){
index 3b75fe8..ccd5ac7 100644 (file)
@@ -2140,7 +2140,7 @@ void AliAnalysisTaskFragmentationFunction::UserExec(Option_t *)
     Int_t cl = 0;
     if(handler->InheritsFrom("AliAODInputHandler")){ 
       // since it is not supported by the helper task define own classes
-      centPercent = fAOD->GetHeader()->GetCentrality();
+      centPercent = ((AliVAODHeader*)fAOD->GetHeader())->GetCentrality();
       cl = 1;
       if(centPercent>10) cl = 2;
       if(centPercent>30) cl = 3;
index 66e1c55..3562be2 100644 (file)
@@ -665,7 +665,7 @@ void AliAnalysisTaskJetCore::UserExec(Option_t *)
    if(fIsPbPb){
    if(fESD) {cent = fESD->GetCentrality();
      if(cent) centValue = cent->GetCentralityPercentile("V0M");}
-   else     centValue=aod->GetHeader()->GetCentrality();
+   else     centValue=((AliVAODHeader*)aod->GetHeader())->GetCentrality();
    
    if(fDebug) printf("centrality: %f\n", centValue);
       if (centValue < fCentMin || centValue > fCentMax){
@@ -765,8 +765,8 @@ void AliAnalysisTaskJetCore::UserExec(Option_t *)
    Int_t iCount=0; 
    Int_t trigJet=-1;
    Int_t trigBBTrack=-1;
-   //   Int_t trigInTrack=-1;
-   fRPAngle = aod->GetHeader()->GetEventplane();     
+          // Int_t trigInTrack=-1;
+   fRPAngle = ((AliVAODHeader*)aod->GetHeader())->GetEventplane();     
 
    if(fHardest==0 || fHardest==1){
    AliVParticle *partback = (AliVParticle*)ParticleList.At(nT);     
@@ -1166,7 +1166,8 @@ Int_t  AliAnalysisTaskJetCore::GetListOfTracks(TList *list){
 
     
      for(int it = 0;it < aod->GetNumberOfTracks();++it){
-      AliAODTrack *tr = aod->GetTrack(it);
+      AliAODTrack *tr = dynamic_cast<AliAODTrack*>(aod->GetTrack(it));
+      if(!tr) AliFatal("Not a standard AOD");
       Bool_t bGood = false;
       if(fFilterType == 0)bGood = true;
       else if(fFilterType == 1)bGood = tr->IsHybridTPCConstrainedGlobal();
@@ -1230,7 +1231,8 @@ Int_t  AliAnalysisTaskJetCore::SelectTrigger(TList *list,Double_t minT,Double_t
      for(Int_t cr=0;cr<100;cr++){triggers[cr]=-1;}
      Int_t im=0;
      for(int it = 0;it < aod->GetNumberOfTracks();++it){
-      AliAODTrack *tr = aod->GetTrack(it);
+      AliAODTrack *tr = dynamic_cast<AliAODTrack*>(aod->GetTrack(it));
+      if(!tr) AliFatal("Not a standard AOD");
       Bool_t bGood = false;
       if(fFilterType == 0)bGood = true;
       else if(fFilterType == 1)bGood = tr->IsHybridTPCConstrainedGlobal();
@@ -1292,7 +1294,8 @@ Int_t  AliAnalysisTaskJetCore::SelectTrigger(TList *list,Double_t minT,Double_t
     // Double_t dif=0;
     Int_t iCount=0;
     for(int it = 0;it < aod->GetNumberOfTracks();++it){
-      AliAODTrack *tr = aod->GetTrack(it);
+      AliAODTrack *tr = dynamic_cast<AliAODTrack*>(aod->GetTrack(it));
+      if(!tr) AliFatal("Not a standard AOD");
       if((fFilterMask>0)&&!(tr->TestFilterBit(fFilterMask)))continue;
       if(TMath::Abs(tr->Eta())>0.9)continue;
       if(tr->Pt()<0.15)continue;
@@ -1324,7 +1327,8 @@ Int_t  AliAnalysisTaskJetCore::SelectTrigger(TList *list,Double_t minT,Double_t
      else aod = fAODOut;   
   
       for(int it = 0;it < aod->GetNumberOfTracks();++it){
-      AliAODTrack *tr = aod->GetTrack(it);
+      AliAODTrack *tr = dynamic_cast<AliAODTrack*>(aod->GetTrack(it));
+      if(!tr) AliFatal("Not a standard AOD");
       if((fFilterMask>0)&&!(tr->TestFilterBit(fFilterMask)))continue;
       if(TMath::Abs(tr->Eta())>0.9)continue;
       if(tr->Pt()<0.15)continue;
index 173e610..678856c 100644 (file)
@@ -1102,7 +1102,7 @@ void AliAnalysisTaskJetCorePP::UserExec(Option_t *)
          cent = fESD->GetCentrality();
          if(cent) centValue = cent->GetCentralityPercentile("V0M");
       }else{
-         centValue = aod->GetHeader()->GetCentrality();
+         centValue = ((AliVAODHeader*)aod->GetHeader())->GetCentrality();
       }   
       if(fDebug) printf("centrality: %f\n", centValue);
       //Input events
@@ -1120,7 +1120,10 @@ void AliAnalysisTaskJetCorePP::UserExec(Option_t *)
  
    //-----------------select disjunct event subsamples ----------------
    if(!fIsKine){ //reconstructed data
-      Int_t eventnum  = aod->GetHeader()->GetEventNumberESDFile();
+      AliAODHeader * header = dynamic_cast<AliAODHeader*>(aod->GetHeader());
+      if(!header) AliFatal("Not a standard AOD");
+
+      Int_t eventnum  = header->GetEventNumberESDFile();
       Int_t lastdigit = eventnum % 10;
       if(!(fEventNumberRangeLow<=lastdigit && lastdigit<=fEventNumberRangeHigh)){
          fHistEvtSelection->Fill(5);
index 868f8c9..34d2db6 100644 (file)
@@ -535,7 +535,7 @@ void AliAnalysisTaskJetServices::UserExec(Option_t */*option*/)
 
   Float_t cent = 0;
   if(fCollisionType==kPbPb){
-    if(aod)cent = aod->GetHeader()->GetCentrality();
+    if(aod)cent = ((AliVAODHeader*)aod->GetHeader())->GetCentrality();
     if(fDebug)Printf("%s:%d %3.3f",(char*)__FILE__,__LINE__,cent);
     if(cent<0)cent = 101;
   }
@@ -624,8 +624,8 @@ void AliAnalysisTaskJetServices::UserExec(Option_t */*option*/)
     Float_t zvtx = vtxAOD->GetZ();
     Int_t  iCl = GetEventClass(aod);
     AliAnalysisHelperJetTasks::EventClass(kTRUE,iCl);
-    Bool_t cand = aod->GetHeader()->GetOfflineTrigger()&fPhysicsSelectionFlag;
-    if(fDebug)Printf("%s:%d AOD selection %d %d",(char*)__FILE__,__LINE__,cand,aod->GetHeader()->GetOfflineTrigger());
+    Bool_t cand = ((AliVAODHeader*)aod->GetHeader())->GetOfflineTrigger()&fPhysicsSelectionFlag;
+    if(fDebug)Printf("%s:%d AOD selection %d %d",(char*)__FILE__,__LINE__,cand,((AliVAODHeader*)aod->GetHeader())->GetOfflineTrigger());
     fh2TriggerCount->Fill(0.,kAllTriggered); 
     fh2TriggerCount->Fill(iCl,kAllTriggered); 
     if(cand){
@@ -671,7 +671,7 @@ void AliAnalysisTaskJetServices::UserExec(Option_t */*option*/)
       TList recTracks;
       GetListOfTracks(&recTracks);
       CalculateReactionPlaneAngleVZERO(aod);
-      fRPAngle = aod->GetHeader()->GetEventplane();
+      fRPAngle = ((AliVAODHeader*)aod->GetHeader())->GetEventplane();
       fh1RP->Fill(fRPAngle);
       fh2RPCentrality->Fill(fCentrality,fRPAngle);
       fh2RPACentrality->Fill(fCentrality,fPsiVZEROA);
@@ -1069,7 +1069,7 @@ Int_t AliAnalysisTaskJetServices::GetEventClass(AliESDEvent *esd){
 Int_t AliAnalysisTaskJetServices::GetEventClass(AliAODEvent *aod){
 
   if(fCollisionType==kPbPb){
-    Float_t cent = aod->GetHeader()->GetCentrality();
+    Float_t cent = ((AliVAODHeader*)aod->GetHeader())->GetCentrality();
     if(cent>80||cent<0)return 5;
     if(cent>50)return 4;
     if(cent>30)return 3;
index dd811e2..1863b73 100644 (file)
@@ -964,9 +964,11 @@ void AliAnalysisTaskJetSpectrum2::UserExec(Option_t */*option*/){
   //  CalculateReactionPlaneAngle(&recParticles);
   fRPAngle = 0;
   
-  if(fRPMethod==0)fRPAngle = aod->GetHeader()->GetEventplane();
+  if(fRPMethod==0)fRPAngle = ((AliVAODHeader*)aod->GetHeader())->GetEventplane();
   else if(fRPMethod==1||fRPMethod==2){
-    fRPAngle = aod->GetHeader()->GetQTheta(fRPMethod);
+    AliAODHeader * aodheader = dynamic_cast<AliAODHeader*>(aod->GetHeader());
+    if(!aodheader) AliFatal("Not a standard AOD");
+    fRPAngle = aodheader->GetQTheta(fRPMethod);
   }
   fh1RP->Fill(fRPAngle);
   fh2RPCentrality->Fill(fCentrality,fRPAngle);
@@ -1671,7 +1673,7 @@ Float_t AliAnalysisTaskJetSpectrum2::GetCentrality(){
   if(!aod){
     return 101;
   }
-  return aod->GetHeader()->GetCentrality();
+  return ((AliVAODHeader*)aod->GetHeader())->GetCentrality();
 }
 
 
index 03b9906..a163785 100644 (file)
@@ -1174,7 +1174,8 @@ void AliAnalysisTaskPartonDisc::UserExec(Option_t *)
 
   if(fIsHIevent)
     {
-      AliAODHeader *aodHeader = fAOD->GetHeader();
+      AliAODHeader *aodHeader = dynamic_cast<AliAODHeader*>(fAOD->GetHeader());
+      if(!aodHeader) AliFatal("Not a standard AOD");
       fEventCent = aodHeader->GetCentrality();
     }
 
@@ -1190,7 +1191,10 @@ void AliAnalysisTaskPartonDisc::UserExec(Option_t *)
     fJetAcceptance = 0.5 - fIncExcR; // if the increase is 0.1 -> only jets within |eta|<0.4 
 
   // First test of reference multiplicity
-  Int_t refMultiplicity = fAOD->GetHeader()->GetRefMultiplicity();
+  AliAODHeader * header = dynamic_cast<AliAODHeader*>(fAOD->GetHeader());
+  if(!header) AliFatal("Not a standard AOD");
+
+  Int_t refMultiplicity = header->GetRefMultiplicity();
   fRefMult->Fill(refMultiplicity);
 
   // Multiplicity from V0 (V0A+V0C)
index 2a99def..7f195f2 100644 (file)
@@ -842,8 +842,8 @@ Bool_t AliPWG4HighPtTrackQA::SelectEvent()
        }
       }
       else if(fDataType==kAOD) {
-       if(dynamic_cast<AliAODEvent*>(fEvent)->GetHeader()->GetCentrality())
-         cent = dynamic_cast<AliAODEvent*>(fEvent)->GetHeader()->GetCentrality();
+       if(((AliVAODHeader*)dynamic_cast<AliAODEvent*>(fEvent)->GetHeader())->GetCentrality())
+         cent = ((AliVAODHeader*)dynamic_cast<AliAODEvent*>(fEvent)->GetHeader())->GetCentrality();
        }
       if(cent>90.) {
        fNEventReject->Fill("cent>90",1);
@@ -901,7 +901,7 @@ Int_t AliPWG4HighPtTrackQA::CalculateCentrality(const AliAODEvent *aod)
   //
 
   if(!aod) return 5;
-  Float_t cent = aod->GetHeader()->GetCentrality();
+  Float_t cent = ((AliVAODHeader*)aod->GetHeader())->GetCentrality();
   if(fDebug>3) printf("centrality: %f\n",cent);
 
   return GetCentralityClass(cent);
index 0b43682..d40f61e 100644 (file)
@@ -2178,7 +2178,7 @@ void AliAnalysisTaskJetChem::UserExec(Option_t *)
     
     if(handler && handler->InheritsFrom("AliAODInputHandler")){ 
       
-      centPercent = fAOD->GetHeader()->GetCentrality();
+      centPercent = ((AliVAODHeader*)fAOD->GetHeader())->GetCentrality();
       cl = 1;
       //std::cout<<"centPercent: "<<centPercent<<std::endl;
       
index 6513460..9490f72 100644 (file)
@@ -1325,8 +1325,8 @@ void AliAnalysisTaskV0sInJets::UserExec(Option_t*)
     return;
   }
 
-//  fdCentrality = fAODIn->GetHeader()->GetCentrality(); // event centrality
-  fdCentrality = fAODIn->GetHeader()->GetCentralityP()->GetCentralityPercentile("V0M"); // event centrality
+//  fdCentrality = ((AliVAODHeader*)fAODIn->GetHeader())->GetCentrality(); // event centrality
+  fdCentrality = ((AliVAODHeader*)fAODIn->GetHeader())->GetCentralityP()->GetCentralityPercentile("V0M"); // event centrality
   if(!fbIsPbPb)
     fdCentrality = 0.;
   Int_t iCentIndex = GetCentralityBinIndex(fdCentrality); // get index of centrality bin
@@ -3118,7 +3118,7 @@ Bool_t AliAnalysisTaskV0sInJets::IsSelectedForJets(AliAODEvent* fAOD, Double_t d
     return kFALSE;
   Double_t centrality;
 //  centrality = fAOD->GetHeader()->GetCentrality();
-  centrality = fAOD->GetHeader()->GetCentralityP()->GetCentralityPercentile("V0M");
+  centrality = ((AliVAODHeader*)fAOD->GetHeader())->GetCentralityP()->GetCentralityPercentile("V0M");
   if(fbIsPbPb)
   {
     if(centrality < 0)
index 50c8167..2183c91 100644 (file)
@@ -1650,7 +1650,7 @@ void AliAnalysisTaskIDFFTCF::UserExec(Option_t *)
     Int_t cl = 0;
     if(handler->InheritsFrom("AliAODInputHandler")){ 
       // since it is not supported by the helper task define own classes
-      centPercent = fAOD->GetHeader()->GetCentrality();
+      centPercent = ((AliVAODHeader*)fAOD->GetHeader())->GetCentrality();
       cl = 1;
       if(centPercent>10) cl = 2;
       if(centPercent>30) cl = 3;
index 477e3d0..672c813 100644 (file)
@@ -2580,7 +2580,7 @@ void AliAnalysisTaskIDFragmentationFunction::UserExec(Option_t *)
     Int_t cl = 0;
     if(handler->InheritsFrom("AliAODInputHandler")){ 
       // since it is not supported by the helper task define own classes
-      centPercent = fAOD->GetHeader()->GetCentrality();
+      centPercent = ((AliVAODHeader*)fAOD->GetHeader())->GetCentrality();
       cl = 1;
       if(centPercent>10) cl = 2;
       if(centPercent>30) cl = 3;
@@ -2601,8 +2601,12 @@ void AliAnalysisTaskIDFragmentationFunction::UserExec(Option_t *)
   }
   
   // Retrieve reference multiplicities in |eta|<0.8 and <0.5
-  const Int_t refMult5 = fAOD->GetHeader()->GetRefMultiplicityComb05();
-  const Int_t refMult8 = fAOD->GetHeader()->GetRefMultiplicityComb08();
+
+  AliAODHeader * header = dynamic_cast<AliAODHeader*>(fAOD->GetHeader());
+  if(!header) AliFatal("Not a standard AOD");
+
+  const Int_t refMult5 = header->GetRefMultiplicityComb05();
+  const Int_t refMult8 = header->GetRefMultiplicityComb08();
   const Double_t centPercentPP = fAnaUtils->GetMultiplicityPercentile(fAOD, "V0M");
   
   
@@ -4005,7 +4009,8 @@ Int_t AliAnalysisTaskIDFragmentationFunction::GetListOfTracks(TList *list, Int_t
     // all rec. tracks, esd filter mask, eta range
     
     for(Int_t it=0; it<fAOD->GetNumberOfTracks(); ++it){
-      AliAODTrack *tr = fAOD->GetTrack(it);
+      AliAODTrack *tr = dynamic_cast<AliAODTrack*>(fAOD->GetTrack(it));
+      if(!tr) AliFatal("Not a standard AOD");
       
       if(type == kTrackAODCuts || type==kTrackAODQualityCuts || type==kTrackAODExtraCuts){
 
index cfb9ba1..03830cd 100644 (file)
@@ -396,7 +396,7 @@ void AliAnalysisTaskJetAntenna::UserExec(Option_t *)
   if(fIsPbPb){
     if(fESD) {cent = fESD->GetCentrality();
       if(cent) centValue = cent->GetCentralityPercentile("V0M");}
-    else     centValue=aod->GetHeader()->GetCentrality();
+    else     centValue=((AliVAODHeader*)aod->GetHeader())->GetCentrality();
 
     if(fDebug) printf("centrality: %f\n", centValue);
     if (centValue < fCentMin || centValue > fCentMax){
index 537e6d5..77829e3 100644 (file)
@@ -1929,7 +1929,7 @@ if(!aodH){
 
    if(fESD) {cent = fESD->GetCentrality();
      if(cent) centrality = cent->GetCentralityPercentile("V0M");}
-   else     centrality=aodE->GetHeader()->GetCentrality();
+   else     centrality=((AliVAODHeader*)aodE->GetHeader())->GetCentrality();
 
 
    if(!fkIsPbPb) {
index 2796b36..bbabf17 100755 (executable)
@@ -501,7 +501,7 @@ Bool_t AliAnalysisTaskPPJetSpectra::EventSelection(Double_t evtContainer[6]) {
   Float_t centrality = -1;
   if(fEventClass > 0)
   {
-    if(handler->InheritsFrom("AliAODHandler")) centrality = fAODIn->GetHeader()->GetCentrality();
+    if(handler->InheritsFrom("AliAODHandler")) centrality = ((AliVAODHeader*)fAODIn->GetHeader())->GetCentrality();
     else if(fESD) centrality = fESD->GetCentrality()->GetCentralityPercentile("V0M");
     else centrality = AliAnalysisHelperJetTasks::EventClass();
   }
index 8d22ebf..e6044d6 100644 (file)
@@ -447,7 +447,8 @@ AliBasedNdetaTask::Event(AliAODEvent& aod)
   if (HasCentrality()) {
     Double_t       cent    = forward->GetCentrality();
     if (!fCentMethod.IsNull()) { 
-      AliAODHeader* hdr = aod.GetHeader();
+      AliAODHeader* hdr = dynamic_cast<AliAODHeader*>(aod.GetHeader());
+      if(!hdr) AliFatal("Not a standard AOD");
       if (hdr) { 
        AliCentrality* cP = hdr->GetCentralityP();
        if (cP) { 
index ffc92a5..f476b7a 100644 (file)
@@ -46,7 +46,8 @@ AliCopyHeaderTask::UserExec(Option_t*)
 
   LoadBranches();
 
-  AliAODHeader* aodHeader = aod->GetHeader();
+  AliAODHeader* aodHeader = dynamic_cast<AliAODHeader*>(aod->GetHeader());
+  if(!aodHeader) AliFatal("Not a standard AOD");
   if (!aodHeader) { 
     AliWarning("Missing AOD header");
     aodHeader = new AliAODHeader(esd->GetRunNumber(),
index 4caaf37..7f51183 100644 (file)
@@ -842,7 +842,7 @@ Double_t AliRsnMiniAnalysisTask::ComputeAngle()
       plane = fInputEvent->GetEventplane();
    else if (fInputEvent->InheritsFrom(AliAODEvent::Class())) {
       AliAODEvent *aodEvent = (AliAODEvent *)fInputEvent;
-      plane = aodEvent->GetHeader()->GetEventplaneP();
+      plane = ((AliVAODHeader*)aodEvent->GetHeader())->GetEventplaneP();
    }
 
    if (plane)
index b76c59e..4e70591 100644 (file)
@@ -212,8 +212,10 @@ void AliAnalysisTaskB2AOD::UserExec(Option_t* )
        if(fLnID == 0) AliFatal("PID not set");
        
        // multiplicity and centrality
-       
-       fNtrk = (fMaxEta > 0.5) ? fAODevent->GetHeader()->GetRefMultiplicityComb08() : fAODevent->GetHeader()->GetRefMultiplicityComb05();
+       AliAODHeader * header = dynamic_cast<AliAODHeader*>(fAODevent->GetHeader());
+        if(!header) AliFatal("Not a standard AOD");
+
+       fNtrk = (fMaxEta > 0.5) ? header->GetRefMultiplicityComb08() : header->GetRefMultiplicityComb05();
        
        if(fSimulation) fNch = this->GetChargedMultiplicity(fMaxEta);
        
@@ -226,7 +228,7 @@ void AliAnalysisTaskB2AOD::UserExec(Option_t* )
        
        if(fHeavyIons)
        {
-               Double_t centrality = fAODevent->GetHeader()->GetCentrality();
+               Double_t centrality = ((AliVAODHeader*)fAODevent->GetHeader())->GetCentrality();
 
                fCentTriggerFired = (centrality >= fMinCentrality) && (centrality < fMaxCentrality);
        }
index 8b8ccb8..6bce862 100644 (file)
@@ -186,8 +186,9 @@ Bool_t AliSpectraAODEventCuts::IsSelected(AliAODEvent * aod,AliSpectraAODTrackCu
        }
        Int_t Nch=0;
        for (Int_t iTracks = 0; iTracks < fAOD->GetNumberOfTracks(); iTracks++) {
-               AliAODTrack* track = fAOD->GetTrack(iTracks);
-               if (!fTrackCuts->IsSelected(track,kFALSE)) continue;
+               AliAODTrack* track = dynamic_cast<AliAODTrack*>(fAOD->GetTrack(iTracks));
+               if(!track) AliFatal("Not a standard AOD");
+               if (!fTrackCuts->IsSelected(track,kFALSE)) continue;
                ((TH1F*)fOutput->FindObject("fHistoEtaBefSel"))->Fill(track->Eta());
                if(fIsSelected){
                        ((TH1F*)fOutput->FindObject("fHistoEtaAftSel"))->Fill(track->Eta());
@@ -237,7 +238,8 @@ Bool_t AliSpectraAODEventCuts::CheckMultiplicityCut()
        // FIXME: why this is not tracket in the track stats histos?
        Int_t Ncharged=0;
        for (Int_t iTracks = 0; iTracks < fAOD->GetNumberOfTracks(); iTracks++){
-               AliAODTrack* track = fAOD->GetTrack(iTracks);
+               AliAODTrack* track = dynamic_cast<AliAODTrack*>(fAOD->GetTrack(iTracks));
+               if(!track) AliFatal("Not a standard AOD");
                if (!fTrackCuts->IsSelected(track,kFALSE)) continue;
                Ncharged++;
        }
@@ -401,7 +403,8 @@ Double_t AliSpectraAODEventCuts::CalculateQVectorTPC(Double_t etaMin,Double_t et
        Double_t Qx2 = 0, Qy2 = 0;
        Int_t mult = 0;
        for(Int_t iT = 0; iT < fAOD->GetNumberOfTracks(); iT++) {
-               AliAODTrack* aodTrack = fAOD->GetTrack(iT);
+               AliAODTrack* aodTrack = dynamic_cast<AliAODTrack*>(fAOD->GetTrack(iT));
+               if(!aodTrack) AliFatal("Not a standard AOD");
                if (!aodTrack->TestFilterBit(128)) continue;  //FIXME track type hard coded -> TPC only constrained to the vertex
                if (aodTrack->Eta() <etaMin || aodTrack->Eta() > etaMax)continue;
                mult++;
@@ -458,7 +461,7 @@ Short_t AliSpectraAODEventCuts::GetCentrCode(AliVEvent* ev)
 
        AliCentrality* centrality = 0;
        AliAODEvent* aod = (AliAODEvent*)ev;
-       centrality = aod->GetHeader()->GetCentralityP();
+       centrality = ((AliVAODHeader*)aod->GetHeader())->GetCentralityP();
 
        Float_t centV0 = centrality->GetCentralityPercentile("V0M");
        Float_t centTrk = centrality->GetCentralityPercentile("TRK");
index fa3e54c..87b75e5 100644 (file)
@@ -386,10 +386,13 @@ Bool_t AliSpectraBothEventCuts::CheckMultiplicityCut()
        {
                AliAODEvent* aodevent=0x0;
                aodevent=dynamic_cast<AliAODEvent*>(fAOD);
+                AliAODHeader * header = dynamic_cast<AliAODHeader*>(aodevent->GetHeader());
+                if(!header) AliFatal("Not a standard AOD");
+
                if(TMath::Abs(0.8-fetarangeofmultiplicitycut)<0.1)
-                       Ncharged=aodevent->GetHeader()->GetRefMultiplicityComb08();
+                       Ncharged=header->GetRefMultiplicityComb08();
                else if (TMath::Abs(0.5-fetarangeofmultiplicitycut)<0.1)
-                       Ncharged=aodevent->GetHeader()->GetRefMultiplicityComb05();
+                       Ncharged=header->GetRefMultiplicityComb05();
                else 
                        Ncharged=-1;
        }
index 5cf673d..d7ae965 100644 (file)
@@ -300,7 +300,7 @@ void AliAnalysisTaskV0ChCorrelations::UserExec(Option_t *)
   // Centrality definition
   Double_t lCent = 0.0;
   AliCentrality *centralityObj = 0;
-  centralityObj = aod->GetHeader()->GetCentralityP();
+  centralityObj = ((AliVAODHeader*)aod->GetHeader())->GetCentralityP();
   lCent = centralityObj->GetCentralityPercentile("V0M");
   if ((lCent < 0.)||(lCent > 90.)) return;
   fHistCentVtx->Fill(lCent,lPVz);
index 5dea00d..31caac3 100644 (file)
@@ -266,7 +266,9 @@ void AliAODMCNuclExReplicator::ReplicateAndFilter(const AliAODEvent& source)
 
   if (fReplicateHeader)
     {
-      *fHeader = *(source.GetHeader());
+      AliAODHeader * header = dynamic_cast<AliAODHeader*>(source.GetHeader());
+      if(!header) AliFatal("Not a standard AOD");
+      *fHeader = *(header);
     }
     
   fVertices->Clear("C");                       
index cd338d9..bfc853d 100644 (file)
@@ -438,7 +438,9 @@ void AliAODNuclExReplicator::ReplicateAndFilter(const AliAODEvent& source)
 
   if (fReplicateHeader)
     {
-      *fHeader = *(source.GetHeader());
+      AliAODHeader * header = dynamic_cast<AliAODHeader*>(source.GetHeader());
+      if(!header) AliFatal("Not a standard AOD");
+      *fHeader = *(header);
     }
     
   fVertices->Clear("C");                       
index 6141141..2529d11 100644 (file)
@@ -638,7 +638,7 @@ void AliAnalysisTaskReadNuclexAOD::UserExec(Option_t *)
   centrality = lAODevent->GetCentrality();
     
   Float_t percentile=centrality->GetCentralityPercentile("V0M");
-  Float_t refMult = lAODevent->GetHeader()->GetRefMultiplicity();
+  Float_t refMult = ((AliVAODHeader*)lAODevent->GetHeader())->GetRefMultiplicity();
   
   fHistTrackMultiplicity->Fill(refMult,percentile); //tracce per evento
 
index eebed12..3dbf229 100644 (file)
@@ -710,7 +710,8 @@ Double_t AliCFSingleTrackEfficiencyTask::GetCentrality()
   if(isAOD) {
     AliAODEvent* aodEvent = dynamic_cast<AliAODEvent*>(fInputEvent);
     if(!aodEvent) return cent;
-    AliAODHeader* header = aodEvent->GetHeader();
+    AliAODHeader* header = dynamic_cast<AliAODHeader*>(aodEvent->GetHeader());
+    if(!header) AliFatal("Not a standard AOD");
     if(!header) return cent;
     AliCentrality *centrality = header->GetCentralityP();
     if(!centrality) return cent;
index 5262ad5..e406586 100644 (file)
@@ -1163,7 +1163,7 @@ void AliAnalysisTaskSEImpParRes::UserExec(Option_t */*option*/)
   if(fIsAOD){
     Int_t nclsITS = 0;
     runNumber=((AliAODEvent*)event)->GetRunNumber();
-    nclsITS = ((AliAODEvent*)event)->GetHeader()->GetNumberOfITSClusters(1);
+    nclsITS = ((AliVAODHeader*)((AliAODEvent*)event)->GetHeader())->GetNumberOfITSClusters(1);
     if(nclsITS<fMinMult || nclsITS>fMaxMult) return;
     firedTriggerClasses=((AliAODEvent*)event)->GetFiredTriggerClasses();
     if(!firedTriggerClasses.Contains(fTriggerClass.Data())) return;
index 0bbf707..6b985b5 100644 (file)
@@ -314,8 +314,11 @@ void AliAnalysisTaskUpcK0sK0s::RunAODtree()
   if(!aod) return;
 
   //input data
-  fDataFilnam = aod->GetHeader()->GetESDFileName();
-  fEvtNum = aod->GetHeader()->GetEventNumberESDFile();
+  AliAODHeader * header = dynamic_cast<AliAODHeader*>(aod->GetHeader());
+if(!header) AliFatal("Not a standard AOD");
+
+  fDataFilnam = header->GetESDFileName();
+  fEvtNum = header->GetEventNumberESDFile();
   fRunNum = aod->GetRunNumber();
   
 
@@ -334,8 +337,8 @@ void AliAnalysisTaskUpcK0sK0s::RunAODtree()
   if(!isTriggered ) return;
 
   //trigger inputs
-  fL0inputs = aod->GetHeader()->GetL0TriggerInputs();
-  fL1inputs = aod->GetHeader()->GetL1TriggerInputs();
+  fL0inputs = ((AliVAODHeader*)aod->GetHeader())->GetL0TriggerInputs();
+  fL1inputs = ((AliVAODHeader*)aod->GetHeader())->GetL1TriggerInputs();
 
   //Event identification
   fPerNum = aod ->GetPeriodNumber();
index 60e618d..dd396f6 100644 (file)
@@ -63,6 +63,7 @@ public:
   // FIXME: use dynamic cast in AliAODEVent?
   virtual AliCentrality* GetCentralityP()  const {AliError("Not Implemented"); return 0;};
   virtual AliEventplane* GetEventplaneP()  const {AliError("Not Implemented"); return 0;};
+  virtual Double_t       GetEventplane()     const {AliError("Not Implemented"); return 0;};
   virtual const Float_t* GetVZEROEqFactors() const {AliError("Not Implemented"); return 0;};
   virtual Float_t        GetVZEROEqFactors(Int_t /* i */) const {AliError("Not Implemented"); return 0;};
   virtual void           SetVZEROEqFactors(const Float_t* /*factors*/) {AliError("Not Implemented"); } 
@@ -74,9 +75,14 @@ public:
  
   virtual void Clear(Option_t * opt) ;
 
+  virtual Int_t  GetIRInt2ClosestInteractionMap()                  const {AliError("Not Implemented"); return 0;};
+  virtual Int_t  GetIRInt1ClosestInteractionMap(Int_t /*gap = 3*/) const {AliError("Not Implemented"); return 0;};
+
+
+  virtual Int_t     GetRefMultiplicity()    const { AliError("Not Impletented"); return 0; }
 
   Double_t  GetMagneticField()      const { return GetVar(1); }
-  Double_t  GetCentrality (const char *estimator = "V0M") { return GetVar(0);}
+  Double_t  GetCentrality (/*estimator = "V0M"*/) const { return GetVar(0);}
   
   ClassDef(AliNanoAODHeader, 1)
 
index 3ccce64..64949fb 100644 (file)
@@ -71,10 +71,13 @@ class AliVAODHeader : public AliVHeader {
   // FIXME: use dynamic cast in AliAODEVent?                       
   virtual AliCentrality* GetCentralityP()                   const  = 0;
   virtual AliEventplane* GetEventplaneP()                   const  = 0;
+  virtual Double_t       GetCentrality () const = 0;
   virtual const Float_t* GetVZEROEqFactors()                const  = 0;
   virtual Float_t        GetVZEROEqFactors(Int_t /* i */)   const  = 0;
   virtual void           SetVZEROEqFactors(const Float_t* /*factors*/)  = 0;
-  virtual UInt_t GetOfflineTrigger()  = 0;
+  virtual UInt_t         GetOfflineTrigger()  = 0;
+  virtual Int_t          GetRefMultiplicity()    const  =0;
+  virtual Double_t       GetEventplane()         const =0;
 
 
 };
index 20c2c6b..6b8a50a 100644 (file)
@@ -42,6 +42,9 @@ class AliVHeader : public TNamed {
   virtual TBits  GetIRInt2InteractionMap() const { static TBits dummy; return dummy; }
   virtual TBits  GetIRInt1InteractionMap() const { static TBits dummy; return dummy; }
 
+  virtual Int_t  GetIRInt2ClosestInteractionMap()                    const {return 0;}
+  virtual Int_t  GetIRInt1ClosestInteractionMap(Int_t =3/*gap = 3*/) const {return 0;}
+
 
   virtual void Print(Option_t* option = "") const  = 0;