Skip to content

Commit

Permalink
[ALIROOT-8649] Restore porting the event weight to the pythia header
Browse files Browse the repository at this point in the history
  • Loading branch information
mfasDa authored and chiarazampolli committed Apr 7, 2021
1 parent a048450 commit 71bc53c
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 1 deletion.
3 changes: 3 additions & 0 deletions PYTHIA6/AliPythia6/AliGenPythiaPlus.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1322,6 +1322,9 @@ void AliGenPythiaPlus::MakeHeader()
((AliGenPythiaEventHeader*) fHeader)->SetPtHard(fPythia->GetPtHard());
((AliGenPythiaEventHeader*) fHeader)->SetXsection(fPythia->GetXSection());

// Store Event weight
((AliGenPythiaEventHeader*) fHeader)->SetEventWeight(fPythia->GetEventWeight());

//
// Pass header
//
Expand Down
5 changes: 5 additions & 0 deletions PYTHIA6/AliPythia6/AliPythia6.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1660,6 +1660,11 @@ Float_t AliPythia6::GetPtHard()
return GetVINT(47);
}

Float_t AliPythia6::GetEventWeight()
{
return GetVINT(97);
}

Int_t AliPythia6::ProcessCode()
{
// Get the subprocess code
Expand Down
6 changes: 6 additions & 0 deletions PYTHIA6/AliPythia6/AliPythia6.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ class AliPythia6 : public TPythia6, public AliPythiaBase
// Common Getters
virtual void GetXandQ(Float_t& x1, Float_t& x2, Float_t& q);
virtual Float_t GetXSection();

/**
* @brief Get the event weight from the underlying pythia process
* @return Event weight
*/
virtual Float_t GetEventWeight();
virtual Int_t ProcessCode();
virtual Float_t GetPtHard();
virtual Int_t GetNMPI();
Expand Down
6 changes: 6 additions & 0 deletions PYTHIA6/AliPythia6/AliPythiaBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ class AliPythiaBase : public AliRndm
virtual Float_t GetPtHard() {return -1.;}
virtual Int_t GetNMPI() {return -1;}
virtual Int_t GetNSuperpositions() { return 1; }

/**
* @brief Get the event weight from the underlying pythia process
* @return Event weight
*/
virtual Float_t GetEventWeight() { return 1; }
//
//
virtual void SetDecayTable() {;}
Expand Down
5 changes: 4 additions & 1 deletion PYTHIA8/AliPythia8/AliPythia8.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,10 @@ Float_t AliPythia8::GetPtHard()
return Pythia8()->info.pTHat();
}


Float_t AliPythia8::GetEventWeight()
{
return Pythia8()->info.weight();
}


AliPythia8& AliPythia8::operator=(const AliPythia8& rhs)
Expand Down
6 changes: 6 additions & 0 deletions PYTHIA8/AliPythia8/AliPythia8.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ class AliPythia8 :public AliTPythia8, public AliPythiaBase
virtual void GetXandQ(Float_t& x1, Float_t& x2, Float_t& q);
virtual Float_t GetXSection();
virtual Float_t GetPtHard();

/**
* @brief Get the event weight from the underlying pythia process
* @return Event weight
*/
virtual Float_t GetEventWeight();
virtual Int_t GetNMPI() { return fLastNMPI; }
virtual Int_t GetNSuperpositions() { return fLastNSuperposition; }

Expand Down

0 comments on commit 71bc53c

Please sign in to comment.