TPythia8Decayer.cxx

Go to the documentation of this file.
00001 // @(#)root/pythia8:$Name$:$Id: TPythia8Decayer.cxx 31953 2010-01-04 08:44:40Z brun $
00002 // Author: Andreas Morsch   04/07/2008
00003 
00004 /**************************************************************************
00005  * Copyright(c) 1998-2008, ALICE Experiment at CERN, All rights reserved. *
00006  *                                                                        *
00007  * Author: The ALICE Off-line Project.                                    *
00008  * Contributors are mentioned in the code where appropriate.              *
00009  *                                                                        *
00010  * Permission to use, copy, modify and distribute this software and its   *
00011  * documentation strictly for non-commercial purposes is hereby granted   *
00012  * without fee, provided that the above copyright notice appears in all   *
00013  * copies and that both the copyright notice and this permission notice   *
00014  * appear in the supporting documentation. The authors make no claims     *
00015  * about the suitability of this software for any purpose. It is          *
00016  * provided "as is" without express or implied warranty.                  *
00017  **************************************************************************/
00018 
00019 #include <TLorentzVector.h>
00020 #include <TPythia8.h>
00021 #include "TPythia8Decayer.h"
00022 
00023 ClassImp(TPythia8Decayer)
00024 
00025 //___________________________________________________________________________
00026 TPythia8Decayer::TPythia8Decayer():
00027   fPythia8(new TPythia8()),
00028   fDebug(0)
00029 {
00030    //constructor
00031    fPythia8->Pythia8()->readString("SoftQCD:elastic = on");
00032    fPythia8->Pythia8()->init();
00033 }
00034 
00035 //___________________________________________________________________________
00036 void TPythia8Decayer::Init()
00037 {
00038    // Initialize the decayer
00039 }
00040 
00041 //___________________________________________________________________________
00042 void TPythia8Decayer::Decay(Int_t pdg, TLorentzVector* p)
00043 {
00044    // Decay a single particle
00045    ClearEvent();
00046    AppendParticle(pdg, p);
00047    Int_t idPart = fPythia8->Pythia8()->event[0].id();
00048    fPythia8->Pythia8()->particleData.mayDecay(idPart,kTRUE);
00049    fPythia8->Pythia8()->moreDecays();
00050    if (fDebug > 0) fPythia8->EventListing();
00051 }
00052 
00053 //___________________________________________________________________________
00054 Int_t TPythia8Decayer::ImportParticles(TClonesArray *particles)
00055 {
00056    //import the decay products into particles array
00057    return (fPythia8->ImportParticles(particles, "All"));
00058 }
00059 
00060 //___________________________________________________________________________
00061 void TPythia8Decayer::SetForceDecay(Int_t /*type*/)
00062 {
00063    // Set forced decay mode
00064    printf("SetForceDecay not yet implemented !\n");
00065 }
00066 //___________________________________________________________________________
00067 void TPythia8Decayer::ForceDecay()
00068 {
00069    // ForceDecay not yet implemented
00070    printf("ForceDecay not yet implemented !\n");
00071 }
00072 //___________________________________________________________________________
00073 Float_t TPythia8Decayer::GetPartialBranchingRatio(Int_t /*ipart*/)
00074 {
00075    return 0.0;
00076 }
00077 //___________________________________________________________________________
00078 Float_t TPythia8Decayer::GetLifetime(Int_t pdg) 
00079 {
00080    //return lifetime in seconds of teh particle with PDG number pdg
00081    return (fPythia8->Pythia8()->particleData.tau0(pdg) * 3.3333e-12) ;
00082 }
00083 
00084 //___________________________________________________________________________
00085 void    TPythia8Decayer::ReadDecayTable()
00086 {
00087    //to read a decay table (not yet implemented)
00088 }
00089 
00090 
00091 //___________________________________________________________________________
00092 void TPythia8Decayer::AppendParticle(Int_t pdg, TLorentzVector* p)
00093 {
00094    // Append a particle to the stack
00095    fPythia8->Pythia8()->event.append(pdg, 11, 0, 0, p->Px(), p->Py(), p->Pz(), p->E(), p->M());   
00096 }
00097 
00098 
00099 //___________________________________________________________________________
00100 void TPythia8Decayer::ClearEvent()
00101 {
00102    // Clear the event stack
00103    fPythia8->Pythia8()->event.clear();
00104 }
00105 

Generated on Tue Jul 5 14:45:16 2011 for ROOT_528-00b_version by  doxygen 1.5.1