7 #include "FairPrimaryGenerator.h"
8 #include "TDatabasePDG.h"
10 #include "TLorentzVector.h"
12 #include "TParticlePDG.h"
54 TDatabasePDG* pdgBase = TDatabasePDG::Instance();
55 TParticlePDG* particle = pdgBase->GetParticle(
fPDGType);
57 Fatal(
"CbmLitPolarizedGenerator",
"PDG code %d not defined.",
fPDGType);
63 fPol =
new TF1(
"dsigdcostheta",
"1.+[0]*x*x", -1., 1.);
66 "pdg=%i y0=%4.2f sigma_y=%4.2f T_pt=%6.4f",
78 Double_t phi, pt,
y, mt, px, py, pz;
81 for (Int_t k = 0; k <
fMult; k++) {
83 phi = gRandom->Uniform(0, TMath::TwoPi());
88 px = pt * TMath::Cos(phi);
89 py = pt * TMath::Sin(phi);
95 pz = mt * TMath::SinH(
y);
108 FairPrimaryGenerator* primGen) {
112 part = TDatabasePDG::Instance()->GetParticle(
"mu+");
114 part = TDatabasePDG::Instance()->GetParticle(
"e+");
116 Fatal(
"GenerateDaughters",
"Polarized dilepton decay only implemented\n");
119 Double_t
m = part->Mass();
121 Double_t p = TMath::Sqrt(e * e -
m *
m);
123 Double_t cost =
fPol->GetRandom();
124 Double_t sint = TMath::Sqrt(1. - cost * cost);
125 Double_t phi = TMath::TwoPi() * gRandom->Rndm();
126 Double_t px = p * sint * TMath::Cos(phi);
127 Double_t py = p * sint * TMath::Sin(phi);
128 Double_t pz = p * cost;
130 TLorentzVector v1, v2, boosted1, boosted2;
131 v1.SetPxPyPzE(-px, -py, -pz, e);
132 v2.SetPxPyPzE(+px, +py, +pz, e);
137 TVector3 boost =
v.BoostVector();
143 zaxis = pMother.Unit();
148 TLorentzVector proj =
150 TLorentzVector targ = TLorentzVector(0., 0., 0., mp);
153 zaxis = (proj.Vect().Unit() - targ.Vect().Unit()).Unit();
155 zaxis = TVector3(0., 0., 1.);
164 Int_t pdg = part->PdgCode();
166 "Particle generated: pdg=%3i pt=%7.4f y=%7.4f",
171 "Particle generated: pdg=%3i pt=%7.4f y=%7.4f",
175 primGen->AddTrack(pdg, v1[0], v1[1], v1[2], 0, 0, 0);
176 primGen->AddTrack(-pdg, v2[0], v2[1], v2[2], 0, 0, 0);