13 #include <Geant4/G4ParticleTable.hh> 
   14 #include <Geant4/G4ParticleDefinition.hh> 
   16 #include <TLorentzVector.h> 
   20 #include <gsl/gsl_randist.h> 
   21 #include <gsl/gsl_const.h> 
  101   cout << 
Name() << 
" random seed: " << iseed << endl;
 
  102   gRandom->SetSeed(iseed);
 
  104   fsin = 
new TF1(
"fsin",
"sin(x)",0,M_PI);
 
  108   frap->SetParameter(0,1.0);
 
  109   frap->SetParameter(1,0.0);
 
  110   frap->SetParameter(2,0.8749);
 
  114   fpt = 
new TF1(
"fpt",
"[0]*x*pow((1.0 + x*x/[1]/[1]),[2])",
pt_min,
pt_max);
 
  115   fpt->SetParameter(0,1.16930e+04);
 
  116   fpt->SetParameter(1,3.03486e+00);
 
  117   fpt->SetParameter(2,-5.42819e+00);
 
  126   PHG4InEvent *ineve = findNode::getClass<PHG4InEvent>(topNode,
"PHG4INEVENT");
 
  128   double tau = 410.1e-15; 
 
  129   double cc = GSL_CONST_CGSM_SPEED_OF_LIGHT; 
 
  130   double ctau = tau*cc*1.0e+04;  
 
  150       pt = 
fpt->GetRandom();
 
  162       y  = 
frap->GetRandom();
 
  175   double mt = sqrt(pow(mnow,2) + pow(pt,2));
 
  176   double eta = TMath::ASinH(TMath::SinH(y)*mt/pt);
 
  181   vd0.SetPtEtaPhiM(pt,eta,phi,mnow);
 
  183   double beta = vd0.Beta();
 
  184   double gamma = vd0.Gamma();
 
  185   double lifetime = gsl_ran_exponential(
RandomGenerator,410.1e-03)* 1.0e-12; 
 
  186   double lifepath = lifetime*gamma*beta*cc;  
 
  189       cout << 
"D0 px,py,pz: " << vd0.Px() << 
" " << vd0.Py() << 
" " << vd0.Pz() << 
" " << beta << 
" " << gamma << endl;
 
  190       cout << 
"   ctau = " << ctau << 
" " << lifetime << 
" " << lifepath << 
" " << lifepath*1.0e+04 << endl;
 
  193   vtx_x = vd0.Px()/vd0.P()*lifepath;
 
  194   vtx_y = vd0.Py()/vd0.P()*lifepath;
 
  206   double E1 = (pow(mnow,2) - pow(
m2,2) + pow(
m1,2)) / (2.0 * mnow);
 
  207   double p1 = sqrt( ( pow(mnow,2) - pow(
m1+
m2,2) )*( pow(mnow,2) - pow(
m1-
m2,2) ) ) / (2.0 * mnow);
 
  213   double th1 = 
fsin->GetRandom();
 
  218   double px1 = p1*sin(th1)*cos(phi1);
 
  219   double py1 = p1*sin(th1)*sin(phi1);
 
  220   double pz1 = p1*cos(th1);
 
  222   v1.SetPxPyPzE(px1,py1,pz1,E1);
 
  227   double betax = vd0.Px()/vd0.E();
 
  228   double betay = vd0.Py()/vd0.E();
 
  229   double betaz = vd0.Pz()/vd0.E();
 
  230   v1.Boost(betax,betay,betaz);
 
  234   TLorentzVector v2 = vd0 - v1;
 
  243   vector<PHG4Particle *>::const_iterator iter;
 
  259       cout << endl << 
"Output some sanity check info from PHG4ParticleGeneratorD0:" << endl;
 
  261       cout << 
"Event vertex: (" << 
vtx_x << 
", " << 
vtx_y << 
", " << 
vtx_z << 
")" << endl;
 
  263       cout << 
"Kaon : " << v1.Pt() << 
" " << v1.PseudoRapidity() << 
" " << v1.M() << endl;
 
  264       cout << 
"pion : " << v2.Pt() << 
" " << v2.PseudoRapidity() << 
" " << v2.M() << endl;
 
  265       cout << 
"D0 : " << vd0.Pt() << 
" " << vd0.PseudoRapidity() << 
" " << vd0.M() << endl;
 
  266       TLorentzVector vreco = v1 + v2;
 
  267       cout << 
"reconstructed D0 : " << vreco.Pt() << 
" " << vreco.PseudoRapidity() << 
" " << vreco.M() << endl;
 
int verbosity
The verbosity level. 0 means not verbose at all.
virtual const std::string Name() const
Returns the name of this module.
int AddParticle(const int vtxid, PHG4Particle *particle)
int AddVtx(const double x, const double y, const double z, const double t)
virtual void identify(std::ostream &os=std::cout) const
void AddEmbeddedParticle(PHG4Particle *particle, int flag)
virtual int ReuseExistingVertex(PHCompositeNode *topNode)
std::vector< PHG4Particle * > particlelist
virtual void AddParticle(const std::string &particle, const double x, const double y, const double z)
void SetParticleId(PHG4Particle *particle, PHG4InEvent *ineve)
gsl_rng * RandomGenerator
void set_mom_range(const double mom_min, const double mom_max)
int process_event(PHCompositeNode *topNode)
void set_pt_range(const double pt_min, const double pt_max)
void set_eta_range(const double eta_min, const double eta_max)
PHG4ParticleGeneratorD0(const std::string &name="D0GEN")
void set_rapidity_range(const double y_min, const double y_max)
int InitRun(PHCompositeNode *topNode)
void set_vtx_zrange(const double zmin, const double zmax)
void set_mass(const double mass)