message: fix automatic weight application in case of getting cross section from event header
diff: @@ -105,7 +105,6 @@ Double_t AliAnaWeights::GetWeight()
  Double_t temp = GetPythiaCrossSection() ;
  AliDebug(1,Form("MC pT-hard weight: %e",temp));
  -
  weight*=temp;
  }
  @@ -180,14 +179,20 @@ Double_t AliAnaWeights::GetPythiaCrossSection()
  // -----------------------------------------------
  if ( fPyEventHeader && fCheckPythiaEventHeader )
  {
  - fMCWeight = 1 ;
  -
  - AliDebug(fDebug,Form("Pythia event header: xs %2.2e, trial %d", fPyEventHeader->GetXsection(),fPyEventHeader->Trials()));
  + AliDebug(fDebug,Form("Pythia event header: xs %2.2e, trial %d",
  + fPyEventHeader->GetXsection(),fPyEventHeader->Trials()));
  fhXsec ->Fill("<#sigma>" ,fPyEventHeader->GetXsection());
  fhTrials->Fill("#sum{ntrials}",fPyEventHeader->Trials());
  - return 1 ;
  + if ( !fJustFillCrossSecHist )
  + {
  + fMCWeight = fPyEventHeader->GetXsection() / fPyEventHeader->Trials() ;
  + AliDebug(1,Form("MC Weight: %e",fMCWeight));
  + }
  + else fMCWeight = 1;
  +
  + return fMCWeight ;
  }
  // -----------------------------------------------
  