CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/GeneratorInterface/ExternalDecays/interface/TauolaInterface.h

Go to the documentation of this file.
00001 #ifndef gen_ExternalDecays_TauolaInterface_h
00002 #define gen_ExternalDecays_TauolaInterface_h
00003 
00004 // #include "HepPDT/defs.h"
00005 // #include "HepPDT/TableBuilder.hh"
00006 #include "HepPDT/ParticleDataTable.hh"
00007 
00008 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00009 #include "FWCore/Framework/interface/ESHandle.h"
00010 #include "FWCore/Framework/interface/EventSetup.h"
00011 
00012 namespace HepMC 
00013 {
00014 class GenEvent;
00015 }
00016 
00017 namespace CLHEP
00018 {
00019 class HepRandomEngine;
00020 }
00021 
00022 namespace gen {
00023 
00024 /* for old tauola27 
00025    class TauolaInterface
00026    {
00027       public:
00028       
00029       // ctor & dtor
00030       TauolaInterface( const edm::ParameterSet& );
00031       ~TauolaInterface();
00032       
00033       void enablePolarization()  { fPolarization = 1; return; }
00034       void disablePolarization() { fPolarization = 0; return; }
00035       void init( const edm::EventSetup& );
00036       const std::vector<int>& operatesOnParticles() { return fPDGs; }
00037       HepMC::GenEvent* decay( HepMC::GenEvent* );
00038       void statistics() ;
00039       
00040       private: 
00041       
00042       //            
00043       std::vector<int> fPDGs;
00044       int              fPolarization;
00045       
00046       edm::ESHandle<HepPDT::ParticleDataTable> fPDGTable ;
00047       Pythia6Service*                          fPy6Service;
00048       bool                                     fIsInitialized;
00049       //CLHEP::HepRandomEngine*                  fRandomEngine;
00050       //CLHEP::RandFlat*                         fRandomGenerator;
00051        
00052    };
00053 */
00054 
00055 /* this is the code for new Tauola++ */
00056 
00057    extern "C" {
00058       void ranmar_( float *rvec, int *lenv );
00059       void rmarin_( int*, int*, int* );
00060    }
00061 
00062    double TauolappInterface_RandGetter();
00063 
00064    class TauolaInterface
00065    {
00066       public:
00067       
00068       // ctor & dtor
00069       // TauolaInterface( const edm::ParameterSet& );
00070       static TauolaInterface* getInstance() ;
00071       ~TauolaInterface();
00072       
00073       void setPSet( const edm::ParameterSet& );
00074       void enablePolarization()  { fPolarization = true; return; }
00075       void disablePolarization() { fPolarization = false; return; }
00076       void init( const edm::EventSetup& );
00077       const std::vector<int>& operatesOnParticles() { return fPDGs; }
00078       HepMC::GenEvent* decay( HepMC::GenEvent* );
00079       void statistics() ;
00080       
00081       private: 
00082       
00083       friend void gen::ranmar_( float *rvec, int *lenv );
00084       friend double gen::TauolappInterface_RandGetter();      
00085       // ctor
00086       TauolaInterface();
00087       
00088       // member function(s)
00089       float flat();
00090       void decodeMDTAU( int );
00091       void selectDecayByMDTAU();
00092       int selectLeptonic();
00093       int selectHadronic();
00094       
00095       
00096       //
00097       CLHEP::HepRandomEngine*                  fRandomEngine;            
00098       std::vector<int>                         fPDGs;
00099       bool                                     fPolarization;      
00100       edm::ESHandle<HepPDT::ParticleDataTable> fPDGTable ;
00101       edm::ParameterSet*                       fPSet;
00102       bool                                     fIsInitialized;
00103       
00104       int                                      fMDTAU;
00105       bool                                     fSelectDecayByEvent;
00106       std::vector<int>                         fLeptonModes;
00107       std::vector<int>                         fHadronModes;
00108       std::vector<double>                      fScaledLeptonBrRatios;
00109       std::vector<double>                      fScaledHadronBrRatios;
00110       
00111       static TauolaInterface*                  fInstance;
00112        
00113    };
00114 
00115 
00116 /* */
00117 
00118 }
00119 
00120 #endif