CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Pythia6Decays.cc
Go to the documentation of this file.
1 // HepMC Headers
2 #include "HepMC/PythiaWrapper6_4.h"
3 
4 // Pythia6 framework integration service Headers
6 
7 // FAMOS Headers
11 
12 #define PYTHIA6PYDECY pythia6pydecy_
13 
14 extern "C" {
15  void PYTHIA6PYDECY(int *ip);
16 }
17 
19 {
20  // Create a new Pythia6jets
21  pyjets = new Pythia6jets();
22  // Create a new Pythia6Service helper
24  // The PYTHIA decay tables will be initialized later
25 }
26 
28  delete pyjets;
29  delete pyservice;
30 }
31 
34 {
35  gen::Pythia6Service::InstanceWrapper guard(pyservice); // grab Py6 context
36 
37  // Pythia6jets pyjets;
38  int ip;
39 
40  pyjets->k(1,1) = 1;
41  pyjets->k(1,2) = particle.pid();
42  pyjets->p(1,1) = particle.Px();
43  pyjets->p(1,2) = particle.Py();
44  pyjets->p(1,3) = particle.Pz();
45  pyjets->p(1,4) = std::max(particle.mass(),particle.e());
46  pyjets->p(1,5) = particle.mass();
47  pyjets->v(1,1) = particle.X();
48  pyjets->v(1,2) = particle.Y();
49  pyjets->v(1,3) = particle.Z();
50  pyjets->v(1,4) = particle.T();
51  pyjets->n() = 1;
52 
53  ip = 1;
54  PYTHIA6PYDECY(&ip);
55 
56  // Fill the list of daughters
57  theList.clear();
58  if ( pyjets->n()==1 ) return theList;
59 
60  theList.resize(pyjets->n()-1,RawParticle());
61 
62  for (int i=2;i<=pyjets->n();++i) {
63 
64  theList[i-2].SetXYZT(pyjets->p(i,1),pyjets->p(i,2),
65  pyjets->p(i,3),pyjets->p(i,4));
66  theList[i-2].setVertex(pyjets->v(i,1),pyjets->v(i,2),
67  pyjets->v(i,3),pyjets->v(i,4));
68  theList[i-2].setID(pyjets->k(i,2));
69  theList[i-2].setMass(pyjets->p(i,5));
70 
71  }
72 
73  return theList;
74 
75 }
int i
Definition: DBlmapReader.cc:9
int & n(void)
Definition: Pythia6jets.cc:37
int pid() const
get the HEP particle ID number
Definition: RawParticle.h:264
double mass() const
get the MEASURED mass
Definition: RawParticle.h:282
double & v(int i, int j)
Definition: Pythia6jets.cc:73
const T & max(const T &a, const T &b)
const DaughterParticleList & particleDaughters(ParticlePropagator &particle)
std::vector< RawParticle > DaughterParticleList
Definition: Pythia6Decays.h:8
double Y() const
y of vertex
Definition: RawParticle.h:274
double Z() const
z of vertex
Definition: RawParticle.h:275
DaughterParticleList theList
Definition: Pythia6Decays.h:28
int & k(int i, int j)
Definition: Pythia6jets.cc:49
gen::Pythia6Service * pyservice
Definition: Pythia6Decays.h:26
double X() const
x of vertex
Definition: RawParticle.h:273
Pythia6jets * pyjets
Definition: Pythia6Decays.h:27
double T() const
vertex time
Definition: RawParticle.h:276
#define PYTHIA6PYDECY
double & p(int i, int j)
Definition: Pythia6jets.cc:61