14 #include <TDatabasePDG.h>
15 #include <TLorentzVector.h>
16 #include <TParticlePDG.h>
27 base.fYPt.Copy(this->fYPt);
28 fYPt.SetDirectory(
nullptr);
37 fYPt.SetDirectory(
nullptr);
44 fYPt.SetDirectory(
nullptr);
52 for (
int i = 1; i <= fYPt.GetNbinsX(); i++) {
53 for (
int j = 1; j < fYPt.GetNbinsY(); j++) {
54 if (fYPt.GetBinContent(i, j) < 0) {
55 LOG(fatal) <<
"FairYPtGenerator negative entries !";
59 if (fYPt.GetEntries() == 0) {
60 LOG(fatal) <<
"FairYPtGenerator lack entries !";
71 Double_t e = TMath::Sqrt(pt * pt +
GetMass2());
72 Double_t phi = gRandom->Uniform(-TMath::Pi(), TMath::Pi());
73 Double_t pz = TMath::Sign(e * 0.5, y) * TMath::Exp(-y) * (TMath::Exp(2.0 * y) - 1.0);
74 Double_t px = pt * TMath::Cos(phi);
75 Double_t py = pt * TMath::Sin(phi);
76 LOG(debug) <<
"FairYPtGenerator: " << Form(
"PDG %i p=(%.2f, %.2f, %.2f) GeV,",
GetPDGType(), px, py, pz);
void SetYPt(const TH2D &yPt)
virtual FairGenerator * CloneGenerator() const
void GetYPt(Double_t &y, Double_t &pt)
FairBaseMCGenerator & operator=(const FairBaseMCGenerator &rhs)=default
virtual void AddTrack(Int_t pdgid, Double_t px, Double_t py, Double_t pz, Double_t vx, Double_t vy, Double_t vz, Int_t parent=-1, Bool_t wanttracking=true, Double_t e=-9e9, Double_t tof=0., Double_t weight=0., TMCProcess proc=kPPrimary)
virtual void GenerateEventParameters()
virtual ~FairYPtGenerator()
Double_t GetMass2() const
Int_t GetMultiplicity() const
FairYPtGenerator & operator=(const FairYPtGenerator &rhs)
virtual Bool_t ReadEvent(FairPrimaryGenerator *primGen)