message: Changed GenEventHeader for impact parameter
diff: #include "AliGenEventHeader.h"
  #include "AliCollisionGeometry.h"
  #include "AliGenHijingEventHeader.h"
  +#include "AliGenHepMCEventHeader.h"
  #include "AliDecorrFlowCorrTask.h"
  #include "AliVParticle.h"
  #include "AliVTrack.h"
  @@ -83,8 +84,8 @@ AliAnalysisDecorrTask::AliAnalysisDecorrTask() : AliAnalysisTaskSE(),
  fIndexSampling{0},
  fAOD(nullptr),
  fIsMC(kFALSE),
  - fMCEvent(0),
  - fEvent(0),
  + fMCEvent(nullptr),
  + fEvent(nullptr),
  fInitTask{kFALSE},
  fOnTheFly(kFALSE),
  fImpactParameterMC{0.0},
  @@ -178,8 +179,8 @@ AliAnalysisDecorrTask::AliAnalysisDecorrTask(const char* name, Bool_t IsMC) : Al
  fIndexSampling{0},
  fAOD(nullptr),
  fIsMC(IsMC),
  - fMCEvent(0),
  - fEvent(0),
  + fMCEvent(nullptr),
  + fEvent(nullptr),
  fInitTask{kFALSE},
  fOnTheFly(kFALSE),
  fImpactParameterMC{0.0},
  @@ -716,8 +717,6 @@ void AliAnalysisDecorrTask::FillAfterWeights()
  //_____________________________________________________________________________
  void AliAnalysisDecorrTask::UserExec(Option_t *)
  {
  -
  -
  if(!fInitTask) { AliFatal("Something went wrong! Task not initialized"); return; }
  AliAnalysisManager* man = AliAnalysisManager::GetAnalysisManager();
  @@ -786,6 +785,8 @@ void AliAnalysisDecorrTask::UserExec(Option_t *)
  AliMultSelection *multSelect =static_cast<AliMultSelection*>(fAOD->FindListObject("MultSelection"));
  if(multSelect) centrality = multSelect->GetMultiplicityPercentile(fCentEstimator);
  }
  + if(centrality < 0) return;
  +
  if(fFillAfterWeights && !fOnTheFly)
  {
  FillAfterWeights();
  @@ -1110,7 +1111,6 @@ void AliAnalysisDecorrTask::CalculateCorrelations(const AliDecorrFlowCorrTask* c
  //Method to fill RP vectors and stat histograms
  void AliAnalysisDecorrTask::FillRPvectors(const AliDecorrFlowCorrTask* const task)
  {
  -
  ResetFlowVector(Qvector);
  ResetFlowVector(Qvector10P);
  ResetFlowVector(Qvector10M);
  @@ -1896,7 +1896,7 @@ Double_t AliAnalysisDecorrTask::GetCentralityFromImpactParameter()
  }
  else
  {
  - return -1.0;
  + continue;
  }
  }
  return -1.0;
  @@ -1917,8 +1917,8 @@ Bool_t AliAnalysisDecorrTask::IsMCEventSelected()
  if(TMath::Abs(vertex->GetY()) > fPVtxCutY) return kFALSE;
  if(TMath::Abs(vertex->GetZ()) > fPVtxCutZ) return kFALSE;
  -
  AliCollisionGeometry* headerH;
  + AliGenHepMCEventHeader* headertmp;
  TString genName;
  TList *ltgen = (TList*)ev->GetCocktailList();
  if (ltgen) {
  @@ -1931,12 +1931,14 @@ Bool_t AliAnalysisDecorrTask::IsMCEventSelected()
  }
  }
  else
  - headerH = dynamic_cast<AliCollisionGeometry*>(ev->GenEventHeader());
  - if(headerH){
  - fImpactParameterMC = headerH->ImpactParameter();
  + {
  + headertmp = dynamic_cast<AliGenHepMCEventHeader*>(ev->GenEventHeader());
  + }
  + if(headertmp){
  + fImpactParameterMC = headertmp->impact_parameter();
  if(!fImpactParameterMC) { AliFatal("Impact parameter not found"); return kFALSE; }
  }
  -
  + else return kFALSE;
  return kTRUE;
  }
  //_____________________________________________________________________________
  