Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TPythia6Decayer.h
Go to the documentation of this file.
1 // @(#)root/pythia6:$Id$
2 // Author: Christian Holm Christensen 22/04/06
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2006, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TPythia6Decayer
13 #define ROOT_TPythia6Decayer
14 
15 ///////////////////////////////////////////////////////////////////////////////
16 // //
17 // TPythia6Decayer //
18 // //
19 // This implements the TVirtualMCDecayer interface. The TPythia6 //
20 // singleton object is used to decay particles. Note, that since this //
21 // class modifies common blocks (global variables) it is defined as a //
22 // singleton. //
23 // //
24 ///////////////////////////////////////////////////////////////////////////////
25 
26 #include "TVirtualMCDecayer.h"
27 #include "TString.h"
28 #include "TArrayF.h"
29 
30 
31 class TPythia6Decayer : public TVirtualMCDecayer {
32 
33 public:
34  // enum of decay mode types
35  enum EDecayType {
36  kSemiElectronic,
37  kDiElectron,
38  kSemiMuonic,
39  kDiMuon,
40  kBJpsiDiMuon,
41  kBJpsiDiElectron,
42  kBPsiPrimeDiMuon,
43  kBPsiPrimeDiElectron,
44  kPiToMu,
45  kKaToMu,
46  kNoDecay,
47  kHadronicD,
48  kOmega,
49  kPhiKK,
50  kAll,
51  kNoDecayHeavy,
52  kHardMuons,
53  kBJpsi,
54  kWToMuon,
55  kWToCharm,
56  kWToCharmToMuon,
57  kZDiMuon,
58  kMaxDecay
59  };
60 
61 protected:
62  TString fDecayTableFile; // File to read decay table from
63  EDecayType fDecay; // Forced decay mode
64  TArrayF fBraPart; //! Branching ratios
65 
66  static TPythia6Decayer *fgInstance;
67 
68  // Extra functions
69  void ForceHadronicD();
70  void ForceOmega();
71  Int_t CountProducts(Int_t channel, Int_t particle);
72 
73 public:
74  TPythia6Decayer();
75  virtual ~TPythia6Decayer() { }
76  virtual void Init();
77  virtual void Decay(Int_t idpart, TLorentzVector* p);
78  virtual Int_t ImportParticles(TClonesArray *particles);
79  virtual void SetForceDecay(Int_t type);
80  virtual void ForceDecay();
81  void ForceParticleDecay(Int_t particle, Int_t* products,
82  Int_t* mult, Int_t npart);
83  void ForceParticleDecay(Int_t particle, Int_t product, Int_t mult);
84  virtual Float_t GetPartialBranchingRatio(Int_t ipart);
85  virtual Float_t GetLifetime(Int_t kf);
86  virtual void ReadDecayTable();
87  // Extension member functions
88  virtual void SetDecayTableFile(const char* name);
89  virtual void WriteDecayTable();
90  virtual void SetForceDecay(EDecayType type) { fDecay = type; }
91 
92  static TPythia6Decayer *Instance();
93 
94  ClassDef(TPythia6Decayer,1) // Particle Decayer Base Class
95 };
96 
97 inline void TPythia6Decayer::SetDecayTableFile(const char *name)
98 {
99  fDecayTableFile = name;
100 }
101 
102 #endif