Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4Pythia6Decayer Class Reference

#include <G4Pythia6Decayer.hh>

Inheritance diagram for G4Pythia6Decayer:
Collaboration diagram for G4Pythia6Decayer:

Public Member Functions

 G4Pythia6Decayer ()
 
virtual ~G4Pythia6Decayer ()
 
virtual G4DecayProductsImportDecayProducts (const G4Track &track)
 
void ForceDecayType (EDecayType decayType)
 
void SetVerboseLevel (G4int verboseLevel)
 
- Public Member Functions inherited from G4VExtDecayer
 G4VExtDecayer (const G4String &name="")
 
virtual ~G4VExtDecayer ()
 
const G4StringGetName () const
 

Additional Inherited Members

- Protected Attributes inherited from G4VExtDecayer
G4String decayerName
 

Detailed Description

Pythia6 decayer

Implements the G4VExtDecayer abstract class using the Pythia6 interface. According to TPythia6Decayer class in Root: http://root.cern.ch/ see http://root.cern.ch/root/License.html

Definition at line 53 of file G4Pythia6Decayer.hh.

Constructor & Destructor Documentation

G4Pythia6Decayer::G4Pythia6Decayer ( )

Standard constructor

Definition at line 55 of file G4Pythia6Decayer.cc.

56  : G4VExtDecayer("G4Pythia6Decayer"),
57  fMessenger(this),
58  fVerboseLevel(0),
59  fDecayType(fgkDefaultDecayType),
60  fDecayProductsArray(0)
61 {
63 
64  fDecayProductsArray = new ParticleVector();
65 
66  ForceDecay(fDecayType);
67 }
std::vector< Pythia6Particle * > ParticleVector
Definition: Pythia6.hh:149
G4VExtDecayer(const G4String &name="")
G4Pythia6Decayer::~G4Pythia6Decayer ( )
virtual

Destructor

Definition at line 71 of file G4Pythia6Decayer.cc.

72 {
74 
75  delete fDecayProductsArray;
76 }

Member Function Documentation

void G4Pythia6Decayer::ForceDecayType ( EDecayType  decayType)

Force a given decay type

Definition at line 617 of file G4Pythia6Decayer.cc.

618 {
620 
621  // Do nothing if the decay type is not different from current one
622  if ( decayType == fDecayType ) return;
623 
624  fDecayType = decayType;
625  ForceDecay(fDecayType);
626 }

Here is the caller graph for this function:

G4DecayProducts * G4Pythia6Decayer::ImportDecayProducts ( const G4Track track)
virtual

Import decay products

Implements G4VExtDecayer.

Definition at line 538 of file G4Pythia6Decayer.cc.

539 {
541 
542  // get particle momentum
543  G4ThreeVector momentum = track.GetMomentum();
544  G4double etot = track.GetDynamicParticle()->GetTotalEnergy();;
546  p[0] = momentum.x() / GeV;
547  p[1] = momentum.y() / GeV;
548  p[2] = momentum.z() / GeV;
549  p[3] = etot / GeV;
550 
551  // get particle PDG
552  // ask G4Pythia6Decayer to get PDG encoding
553  // (in order to get PDG from extended TDatabasePDG
554  // in case the standard PDG code is not defined)
555  G4ParticleDefinition* particleDef = track.GetDefinition();
556  G4int pdgEncoding = particleDef->GetPDGEncoding();
557 
558  // let Pythia6Decayer decay the particle
559  // and import the decay products
560  Decay(pdgEncoding, p);
561  G4int nofParticles = ImportParticles(fDecayProductsArray);
562 
563  if ( fVerboseLevel > 0 ) {
564  G4cout << "nofParticles: " << nofParticles << G4endl;
565  }
566 
567  // convert decay products Pythia6Particle type
568  // to G4DecayProducts
569  G4DecayProducts* decayProducts
570  = new G4DecayProducts(*(track.GetDynamicParticle()));
571 
572  G4int counter = 0;
573  for (G4int i=0; i<nofParticles; i++) {
574 
575  // get particle from ParticleVector
576  Pythia6Particle* particle = (*fDecayProductsArray)[i];
577 
578  G4int status = particle->fKS;
579  G4int pdg = particle->fKF;
580  if ( status>0 && status<11 &&
581  std::abs(pdg)!=12 && std::abs(pdg)!=14 && std::abs(pdg)!=16 ) {
582  // pass to tracking final particles only;
583  // skip neutrinos
584 
585  if ( fVerboseLevel > 0 ) {
586  G4cout << " " << i << "th particle PDG: " << pdg << " ";
587  }
588 
589  // create G4DynamicParticle
590  G4DynamicParticle* dynamicParticle
591  = CreateDynamicParticle(particle);
592 
593  if (dynamicParticle) {
594 
595  if ( fVerboseLevel > 0 ) {
596  G4cout << " G4 particle name: "
597  << dynamicParticle->GetDefinition()->GetParticleName()
598  << G4endl;
599  }
600 
601  // add dynamicParticle to decayProducts
602  decayProducts->PushProducts(dynamicParticle);
603 
604  counter++;
605  }
606  }
607  }
608  if ( fVerboseLevel > 0 ) {
609  G4cout << "nofParticles for tracking: " << counter << G4endl;
610  }
611 
612  return decayProducts;
613 }
G4ParticleDefinition * GetDefinition() const
G4double GetTotalEnergy() const
double x() const
const G4DynamicParticle * GetDynamicParticle() const
G4int PushProducts(G4DynamicParticle *aParticle)
const char * p
Definition: xmltok.h:285
Structure for Pythia6 particle properties.
Definition: Pythia6.hh:119
G4ParticleDefinition * GetDefinition() const
int G4int
Definition: G4Types.hh:78
const G4String & GetParticleName() const
double z() const
G4GLOB_DLL std::ostream G4cout
G4ThreeVector GetMomentum() const
double y() const
static constexpr double GeV
Definition: G4SIunits.hh:217
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
Definition: Decay.hh:48

Here is the call graph for this function:

void G4Pythia6Decayer::SetVerboseLevel ( G4int  verboseLevel)
inline

Definition at line 63 of file G4Pythia6Decayer.hh.

63 { fVerboseLevel = verboseLevel; }

Here is the caller graph for this function:


The documentation for this class was generated from the following files: